diff options
| author | Dax <[email protected]> | 2025-12-07 19:04:14 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-07 19:04:14 -0500 |
| commit | ea7ec60f51f9fe3c6382f644c328188a43545b7b (patch) | |
| tree | 5204cbc059fe10b87c54ffd25782ad83710bdcdb /packages/sdk/js/src/client.ts | |
| parent | 6667856ba5dac3e5dd77c7008cee2d09be894472 (diff) | |
| download | opencode-ea7ec60f51f9fe3c6382f644c328188a43545b7b.tar.gz opencode-ea7ec60f51f9fe3c6382f644c328188a43545b7b.zip | |
v2 SDK (#5216)
Co-authored-by: GitHub Action <[email protected]>
Diffstat (limited to 'packages/sdk/js/src/client.ts')
| -rw-r--r-- | packages/sdk/js/src/client.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/sdk/js/src/client.ts b/packages/sdk/js/src/client.ts index ab4b75b5b..806ad26e5 100644 --- a/packages/sdk/js/src/client.ts +++ b/packages/sdk/js/src/client.ts @@ -1,19 +1,20 @@ export * from "./gen/types.gen.js" -export { type Config as OpencodeClientConfig, OpencodeClient } import { createClient } from "./gen/client/client.gen.js" 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 }) { if (!config?.fetch) { + const customFetch: any = (req: any) => { + // @ts-ignore + req.timeout = false + return fetch(req) + } config = { ...config, - fetch: (req) => { - // @ts-ignore - req.timeout = false - return fetch(req) - }, + fetch: customFetch, } } |
