@opencode-ai/sdk 1.0.73 → 1.0.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +3 -1
- package/dist/client.js +6 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ export * from "./gen/types.gen.js";
|
|
|
2
2
|
export { type Config as OpencodeClientConfig, OpencodeClient };
|
|
3
3
|
import { type Config } from "./gen/client/types.gen.js";
|
|
4
4
|
import { OpencodeClient } from "./gen/sdk.gen.js";
|
|
5
|
-
export declare function createOpencodeClient(config?: Config
|
|
5
|
+
export declare function createOpencodeClient(config?: Config & {
|
|
6
|
+
directory?: string;
|
|
7
|
+
}): OpencodeClient;
|
package/dist/client.js
CHANGED
|
@@ -13,6 +13,12 @@ export function createOpencodeClient(config) {
|
|
|
13
13
|
},
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
+
if (config?.directory) {
|
|
17
|
+
config.headers = {
|
|
18
|
+
...config.headers,
|
|
19
|
+
"x-opencode-directory": config.directory,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
16
22
|
const client = createClient(config);
|
|
17
23
|
return new OpencodeClient({ client });
|
|
18
24
|
}
|