diff options
| author | James Long <[email protected]> | 2026-03-09 10:28:04 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-09 10:28:04 -0400 |
| commit | 366b8a8034ef7f613e8b93cd872f13c71b836721 (patch) | |
| tree | 14bcb6e62b450e93cda721df5326531d612394cf /packages/sdk/js/src | |
| parent | ef9bc4ec9ee5101b7f6e584a80600136007ac7a7 (diff) | |
| download | opencode-366b8a8034ef7f613e8b93cd872f13c71b836721.tar.gz opencode-366b8a8034ef7f613e8b93cd872f13c71b836721.zip | |
feat(tui): add initial support for workspaces into the tui (#16230)
Diffstat (limited to 'packages/sdk/js/src')
| -rw-r--r-- | packages/sdk/js/src/v2/client.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/sdk/js/src/v2/client.ts b/packages/sdk/js/src/v2/client.ts index 8685be52d..ad956dd4b 100644 --- a/packages/sdk/js/src/v2/client.ts +++ b/packages/sdk/js/src/v2/client.ts @@ -5,7 +5,7 @@ import { type Config } from "./gen/client/types.gen.js" import { OpencodeClient } from "./gen/sdk.gen.js" export { type Config as OpencodeClientConfig, OpencodeClient } -export function createOpencodeClient(config?: Config & { directory?: string }) { +export function createOpencodeClient(config?: Config & { directory?: string; experimental_workspaceID?: string }) { if (!config?.fetch) { const customFetch: any = (req: any) => { // @ts-ignore @@ -27,6 +27,13 @@ export function createOpencodeClient(config?: Config & { directory?: string }) { } } + if (config?.experimental_workspaceID) { + config.headers = { + ...config.headers, + "x-opencode-workspace": config.experimental_workspaceID, + } + } + const client = createClient(config) return new OpencodeClient({ client }) } |
