refactor(app): rename cached context accessors (#33627)

This commit is contained in:
Brendan Allan 2026-06-24 16:55:57 +08:00 committed by GitHub
commit cacb7d045f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 30 additions and 30 deletions

View file

@ -2,7 +2,7 @@ import { createSimpleContext } from "@opencode-ai/ui/context"
import { type Accessor, createMemo } from "solid-js"
import { type ServerSDK, useServerSDK } from "./server-sdk"
export type DirectorySDK = ReturnType<ServerSDK["createDirSdkContext"]>
export type DirectorySDK = ReturnType<ServerSDK["ensureDirSdkContext"]>
export const { use: useSDK, provider: SDKProvider } = createSimpleContext({
name: "SDK",
@ -11,7 +11,7 @@ export const { use: useSDK, provider: SDKProvider } = createSimpleContext({
const serverSDK = useServerSDK()
return createMemo(() => {
const directory = typeof props.directory === "function" ? props.directory() : props.directory
return serverSDK().createDirSdkContext(directory)
return serverSDK().ensureDirSdkContext(directory)
})
},
})