@ai-sdk/harness-opencode 1.0.93 → 1.0.95
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/CHANGELOG.md +24 -0
- package/README.md +24 -0
- package/dist/bridge/index.mjs +51 -7
- package/dist/bridge/index.mjs.map +1 -1
- package/dist/bridge/package.json +2 -2
- package/dist/bridge/pnpm-lock.yaml +59 -59
- package/dist/bridge/pnpm-workspace.yaml +1 -1
- package/dist/index.d.ts +13 -32
- package/dist/index.js +73 -103
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/bridge/index.ts +25 -3
- package/src/bridge/package.json +2 -2
- package/src/bridge/pnpm-lock.yaml +59 -59
- package/src/bridge/pnpm-workspace.yaml +1 -1
- package/src/index.ts +1 -4
- package/src/opencode-auth.ts +36 -129
- package/src/opencode-bridge-protocol.ts +2 -0
- package/src/opencode-harness.ts +58 -37
package/dist/bridge/package.json
CHANGED
|
@@ -12,11 +12,11 @@ importers:
|
|
|
12
12
|
specifier: 1.29.0
|
|
13
13
|
version: 1.29.0(zod@3.25.76)
|
|
14
14
|
'@opencode-ai/sdk':
|
|
15
|
-
specifier: 1.18.
|
|
16
|
-
version: 1.18.
|
|
15
|
+
specifier: 1.18.23
|
|
16
|
+
version: 1.18.23
|
|
17
17
|
opencode-ai:
|
|
18
|
-
specifier: 1.18.
|
|
19
|
-
version: 1.18.
|
|
18
|
+
specifier: 1.18.23
|
|
19
|
+
version: 1.18.23
|
|
20
20
|
ws:
|
|
21
21
|
specifier: 8.21.0
|
|
22
22
|
version: 8.21.0
|
|
@@ -42,8 +42,8 @@ packages:
|
|
|
42
42
|
'@cfworker/json-schema':
|
|
43
43
|
optional: true
|
|
44
44
|
|
|
45
|
-
'@opencode-ai/sdk@1.18.
|
|
46
|
-
resolution: {integrity: sha512-
|
|
45
|
+
'@opencode-ai/sdk@1.18.23':
|
|
46
|
+
resolution: {integrity: sha512-VouYbL8O2ynLq0atr5fjzCv8YLtFi/zKLQ/uYkCvTJ4CmUdA01XwPn8om+u3TvxnGEfQsBfmThGU141vt3sg5w==}
|
|
47
47
|
|
|
48
48
|
accepts@2.0.0:
|
|
49
49
|
resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==}
|
|
@@ -286,72 +286,72 @@ packages:
|
|
|
286
286
|
once@1.4.0:
|
|
287
287
|
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
|
|
288
288
|
|
|
289
|
-
opencode-ai@1.18.
|
|
290
|
-
resolution: {integrity: sha512-
|
|
289
|
+
opencode-ai@1.18.23:
|
|
290
|
+
resolution: {integrity: sha512-3NkT0XINL7d0HYkTyGV1SPChHXhvRgKqNaTgKRTGb0TXUWszXA7MW/y3zMZw29y1AQuUDAzRvVYmQ9KGRQhroA==}
|
|
291
291
|
cpu: [arm64, x64]
|
|
292
292
|
os: [darwin, linux, win32]
|
|
293
293
|
hasBin: true
|
|
294
294
|
|
|
295
|
-
opencode-darwin-arm64@1.18.
|
|
296
|
-
resolution: {integrity: sha512-
|
|
295
|
+
opencode-darwin-arm64@1.18.23:
|
|
296
|
+
resolution: {integrity: sha512-QP9PjwpHtZoLVXw2WvUmPZecz7mWbQkT4t3K36B//fCaDG+zWa+SsztIeaW5azujNwwtUemLA5icE/zINng48Q==}
|
|
297
297
|
cpu: [arm64]
|
|
298
298
|
os: [darwin]
|
|
299
299
|
|
|
300
|
-
opencode-darwin-x64-baseline@1.18.
|
|
301
|
-
resolution: {integrity: sha512-
|
|
300
|
+
opencode-darwin-x64-baseline@1.18.23:
|
|
301
|
+
resolution: {integrity: sha512-QGx6I/nFYur7qJ/Nx2L3fC4XYQt44cyDsm7p8twNA+cdjGX3ndnPbMdAl5ikdZyAfSMUGYK8VWY2JMxv0rmfjw==}
|
|
302
302
|
cpu: [x64]
|
|
303
303
|
os: [darwin]
|
|
304
304
|
|
|
305
|
-
opencode-darwin-x64@1.18.
|
|
306
|
-
resolution: {integrity: sha512-
|
|
305
|
+
opencode-darwin-x64@1.18.23:
|
|
306
|
+
resolution: {integrity: sha512-R9nWP3edz/0FnEfwmuxtiWBB7bS4NtZCyCffJyiMlrbwdDC+bIXYrWxWXVrzaP1mJujs6g2MAwTCUSx/qpBhDw==}
|
|
307
307
|
cpu: [x64]
|
|
308
308
|
os: [darwin]
|
|
309
309
|
|
|
310
|
-
opencode-linux-arm64-musl@1.18.
|
|
311
|
-
resolution: {integrity: sha512-
|
|
310
|
+
opencode-linux-arm64-musl@1.18.23:
|
|
311
|
+
resolution: {integrity: sha512-VyDkzUJfJgkx9h9RhazTW9xeTgSXBmVFPblsbPGBW9tR612f6gjQxfOfu4cpHnQHK1qjuW9ClzLKHWqv3EcJTA==}
|
|
312
312
|
cpu: [arm64]
|
|
313
313
|
os: [linux]
|
|
314
314
|
libc: [musl]
|
|
315
315
|
|
|
316
|
-
opencode-linux-arm64@1.18.
|
|
317
|
-
resolution: {integrity: sha512-
|
|
316
|
+
opencode-linux-arm64@1.18.23:
|
|
317
|
+
resolution: {integrity: sha512-g1zDFhuE9FOYwjSGderlu69wfd4GQzS0xsDiIY11QUciuBmM6DrHqLvmhlLFsUVHYVnCPY1YeN1pq5ewE3x72Q==}
|
|
318
318
|
cpu: [arm64]
|
|
319
319
|
os: [linux]
|
|
320
320
|
|
|
321
|
-
opencode-linux-x64-baseline-musl@1.18.
|
|
322
|
-
resolution: {integrity: sha512-
|
|
321
|
+
opencode-linux-x64-baseline-musl@1.18.23:
|
|
322
|
+
resolution: {integrity: sha512-c1DPxauhzAurlIBhJBr/rokDpc65l084T4qTl36gDDT9Xzc/Nk5Q5yMDaPm1DDI3WeHKDt11MDlxT5AjQW5gtw==}
|
|
323
323
|
cpu: [x64]
|
|
324
324
|
os: [linux]
|
|
325
325
|
libc: [musl]
|
|
326
326
|
|
|
327
|
-
opencode-linux-x64-baseline@1.18.
|
|
328
|
-
resolution: {integrity: sha512-
|
|
327
|
+
opencode-linux-x64-baseline@1.18.23:
|
|
328
|
+
resolution: {integrity: sha512-yUhBOXfTQour2JCdAkwD3DDqSnyxB0grefwdPqEhYmJHIkYxfJIIzyy6V//pyouvkE0XMouFtiuZXw8S6Wo0iQ==}
|
|
329
329
|
cpu: [x64]
|
|
330
330
|
os: [linux]
|
|
331
331
|
|
|
332
|
-
opencode-linux-x64-musl@1.18.
|
|
333
|
-
resolution: {integrity: sha512-
|
|
332
|
+
opencode-linux-x64-musl@1.18.23:
|
|
333
|
+
resolution: {integrity: sha512-t/5mlnTBZKdZpqKHwdwxlWqGakntauvMSmXtyJc17M7XJRmZaaGHtNSaSefbbYFIL4agoQCXTvIkhhyxOvr7zQ==}
|
|
334
334
|
cpu: [x64]
|
|
335
335
|
os: [linux]
|
|
336
336
|
libc: [musl]
|
|
337
337
|
|
|
338
|
-
opencode-linux-x64@1.18.
|
|
339
|
-
resolution: {integrity: sha512-
|
|
338
|
+
opencode-linux-x64@1.18.23:
|
|
339
|
+
resolution: {integrity: sha512-5x9d1Cm/YtqzR6lAlNbgVprTQ3R3hx7qGTWCzm5l5u6lBNkhYTrhy2s8k25dxKKuxqZ9Kngqz9JYWvSVHy2Lmw==}
|
|
340
340
|
cpu: [x64]
|
|
341
341
|
os: [linux]
|
|
342
342
|
|
|
343
|
-
opencode-windows-arm64@1.18.
|
|
344
|
-
resolution: {integrity: sha512-
|
|
343
|
+
opencode-windows-arm64@1.18.23:
|
|
344
|
+
resolution: {integrity: sha512-QtJQcLU0yPz6on3jjks3f/EHgZuIDFw7FvAKu3wsHhL09NYDh7GczfRXDPRHa3NgqnU8dkB8p9mhqgaPRPogoQ==}
|
|
345
345
|
cpu: [arm64]
|
|
346
346
|
os: [win32]
|
|
347
347
|
|
|
348
|
-
opencode-windows-x64-baseline@1.18.
|
|
349
|
-
resolution: {integrity: sha512
|
|
348
|
+
opencode-windows-x64-baseline@1.18.23:
|
|
349
|
+
resolution: {integrity: sha512-AqXsTKaPcDx3rrid5bLUwJbQ/3vr9rJ6fvOStIznTzwrbOgP8wy5G4jCoIzu6KB/WxGx/d1MrV4cGaJ73qnjBA==}
|
|
350
350
|
cpu: [x64]
|
|
351
351
|
os: [win32]
|
|
352
352
|
|
|
353
|
-
opencode-windows-x64@1.18.
|
|
354
|
-
resolution: {integrity: sha512-
|
|
353
|
+
opencode-windows-x64@1.18.23:
|
|
354
|
+
resolution: {integrity: sha512-mMaIITuXzkNfjdcYL8uZaZuMDjulFyH/UCq9bxblam2mUZf9uWisoi5J6CXFsS/mkN7CZfTAt6PttSp4n3PH4g==}
|
|
355
355
|
cpu: [x64]
|
|
356
356
|
os: [win32]
|
|
357
357
|
|
|
@@ -508,7 +508,7 @@ snapshots:
|
|
|
508
508
|
transitivePeerDependencies:
|
|
509
509
|
- supports-color
|
|
510
510
|
|
|
511
|
-
'@opencode-ai/sdk@1.18.
|
|
511
|
+
'@opencode-ai/sdk@1.18.23':
|
|
512
512
|
dependencies:
|
|
513
513
|
cross-spawn: 7.0.6
|
|
514
514
|
|
|
@@ -752,55 +752,55 @@ snapshots:
|
|
|
752
752
|
dependencies:
|
|
753
753
|
wrappy: 1.0.2
|
|
754
754
|
|
|
755
|
-
opencode-ai@1.18.
|
|
755
|
+
opencode-ai@1.18.23:
|
|
756
756
|
optionalDependencies:
|
|
757
|
-
opencode-darwin-arm64: 1.18.
|
|
758
|
-
opencode-darwin-x64: 1.18.
|
|
759
|
-
opencode-darwin-x64-baseline: 1.18.
|
|
760
|
-
opencode-linux-arm64: 1.18.
|
|
761
|
-
opencode-linux-arm64-musl: 1.18.
|
|
762
|
-
opencode-linux-x64: 1.18.
|
|
763
|
-
opencode-linux-x64-baseline: 1.18.
|
|
764
|
-
opencode-linux-x64-baseline-musl: 1.18.
|
|
765
|
-
opencode-linux-x64-musl: 1.18.
|
|
766
|
-
opencode-windows-arm64: 1.18.
|
|
767
|
-
opencode-windows-x64: 1.18.
|
|
768
|
-
opencode-windows-x64-baseline: 1.18.
|
|
769
|
-
|
|
770
|
-
opencode-darwin-arm64@1.18.
|
|
757
|
+
opencode-darwin-arm64: 1.18.23
|
|
758
|
+
opencode-darwin-x64: 1.18.23
|
|
759
|
+
opencode-darwin-x64-baseline: 1.18.23
|
|
760
|
+
opencode-linux-arm64: 1.18.23
|
|
761
|
+
opencode-linux-arm64-musl: 1.18.23
|
|
762
|
+
opencode-linux-x64: 1.18.23
|
|
763
|
+
opencode-linux-x64-baseline: 1.18.23
|
|
764
|
+
opencode-linux-x64-baseline-musl: 1.18.23
|
|
765
|
+
opencode-linux-x64-musl: 1.18.23
|
|
766
|
+
opencode-windows-arm64: 1.18.23
|
|
767
|
+
opencode-windows-x64: 1.18.23
|
|
768
|
+
opencode-windows-x64-baseline: 1.18.23
|
|
769
|
+
|
|
770
|
+
opencode-darwin-arm64@1.18.23:
|
|
771
771
|
optional: true
|
|
772
772
|
|
|
773
|
-
opencode-darwin-x64-baseline@1.18.
|
|
773
|
+
opencode-darwin-x64-baseline@1.18.23:
|
|
774
774
|
optional: true
|
|
775
775
|
|
|
776
|
-
opencode-darwin-x64@1.18.
|
|
776
|
+
opencode-darwin-x64@1.18.23:
|
|
777
777
|
optional: true
|
|
778
778
|
|
|
779
|
-
opencode-linux-arm64-musl@1.18.
|
|
779
|
+
opencode-linux-arm64-musl@1.18.23:
|
|
780
780
|
optional: true
|
|
781
781
|
|
|
782
|
-
opencode-linux-arm64@1.18.
|
|
782
|
+
opencode-linux-arm64@1.18.23:
|
|
783
783
|
optional: true
|
|
784
784
|
|
|
785
|
-
opencode-linux-x64-baseline-musl@1.18.
|
|
785
|
+
opencode-linux-x64-baseline-musl@1.18.23:
|
|
786
786
|
optional: true
|
|
787
787
|
|
|
788
|
-
opencode-linux-x64-baseline@1.18.
|
|
788
|
+
opencode-linux-x64-baseline@1.18.23:
|
|
789
789
|
optional: true
|
|
790
790
|
|
|
791
|
-
opencode-linux-x64-musl@1.18.
|
|
791
|
+
opencode-linux-x64-musl@1.18.23:
|
|
792
792
|
optional: true
|
|
793
793
|
|
|
794
|
-
opencode-linux-x64@1.18.
|
|
794
|
+
opencode-linux-x64@1.18.23:
|
|
795
795
|
optional: true
|
|
796
796
|
|
|
797
|
-
opencode-windows-arm64@1.18.
|
|
797
|
+
opencode-windows-arm64@1.18.23:
|
|
798
798
|
optional: true
|
|
799
799
|
|
|
800
|
-
opencode-windows-x64-baseline@1.18.
|
|
800
|
+
opencode-windows-x64-baseline@1.18.23:
|
|
801
801
|
optional: true
|
|
802
802
|
|
|
803
|
-
opencode-windows-x64@1.18.
|
|
803
|
+
opencode-windows-x64@1.18.23:
|
|
804
804
|
optional: true
|
|
805
805
|
|
|
806
806
|
parseurl@1.3.3: {}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
allowBuilds:
|
|
2
|
-
'opencode-ai@1.18.
|
|
2
|
+
'opencode-ai@1.18.23': true
|
package/dist/index.d.ts
CHANGED
|
@@ -1,50 +1,31 @@
|
|
|
1
1
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
2
2
|
import * as _ai_sdk_harness from '@ai-sdk/harness';
|
|
3
|
-
import { HarnessV1CredentialForwarding, HarnessV1PortEndpoint, HarnessV1, HarnessV1BuiltinTool } from '@ai-sdk/harness';
|
|
3
|
+
import { HarnessV1Authentication, HarnessV1CredentialForwarding, HarnessV1PortEndpoint, HarnessV1, HarnessV1BuiltinTool } from '@ai-sdk/harness';
|
|
4
4
|
|
|
5
|
-
type
|
|
6
|
-
type OpenCodeAuthenticationMode = OpenCodeResolvedAuthenticationMode | 'auto';
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Passing an object to auth options is deprecated. Use an `OpenCodeAuthenticationMode` string value ("auto" | "anthropic" | "openai" | "ai-gateway") instead, and pass credentials via environment variables.
|
|
9
|
-
*/
|
|
10
|
-
type LegacyOpenCodeAuthOptions = {
|
|
11
|
-
readonly gateway?: {
|
|
12
|
-
readonly apiKey?: string;
|
|
13
|
-
readonly baseUrl?: string;
|
|
14
|
-
};
|
|
15
|
-
readonly anthropic?: {
|
|
16
|
-
readonly apiKey?: string;
|
|
17
|
-
readonly authToken?: string;
|
|
18
|
-
readonly baseUrl?: string;
|
|
19
|
-
};
|
|
20
|
-
readonly openai?: {
|
|
21
|
-
readonly apiKey?: string;
|
|
22
|
-
readonly baseUrl?: string;
|
|
23
|
-
readonly organization?: string;
|
|
24
|
-
readonly project?: string;
|
|
25
|
-
};
|
|
26
|
-
readonly openaiCompatible?: {
|
|
27
|
-
readonly apiKey?: string;
|
|
28
|
-
readonly baseUrl?: string;
|
|
29
|
-
readonly name?: string;
|
|
30
|
-
readonly queryParams?: Record<string, string>;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
type OpenCodeAuthOptions = OpenCodeAuthenticationMode | LegacyOpenCodeAuthOptions;
|
|
5
|
+
type OpenCodeAuthenticationMode = HarnessV1Authentication<'anthropic' | 'openai'>;
|
|
34
6
|
|
|
35
7
|
type OpenCodeHarnessSettings = {
|
|
36
|
-
readonly auth?:
|
|
8
|
+
readonly auth?: OpenCodeAuthenticationMode;
|
|
37
9
|
/**
|
|
38
10
|
* Customizes each credential value before it is forwarded into a sandbox
|
|
39
11
|
* process. This does not restrict which credentials the harness adapter can
|
|
40
12
|
* discover, read, or otherwise access in the host process.
|
|
41
13
|
*/
|
|
42
14
|
readonly credentialForwarding?: HarnessV1CredentialForwarding;
|
|
15
|
+
/**
|
|
16
|
+
* Additional configuration passed through to OpenCode as-is. OpenCode
|
|
17
|
+
* config keys must use their native names. Values managed by this adapter
|
|
18
|
+
* take precedence over conflicting entries.
|
|
19
|
+
*/
|
|
20
|
+
readonly openCodeConfig?: Record<string, unknown>;
|
|
43
21
|
/**
|
|
44
22
|
* MCP server definitions keyed by server name. Each definition uses the
|
|
45
23
|
* underlying runtime's native MCP server configuration format.
|
|
46
24
|
*/
|
|
47
25
|
readonly mcpServers?: Record<string, unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Use `model` on `HarnessAgent` instead.
|
|
28
|
+
*/
|
|
48
29
|
readonly model?: string;
|
|
49
30
|
readonly provider?: string;
|
|
50
31
|
/**
|
|
@@ -201,4 +182,4 @@ declare const openCode: _ai_sdk_harness.HarnessV1<{
|
|
|
201
182
|
}, any, any>;
|
|
202
183
|
}>;
|
|
203
184
|
|
|
204
|
-
export { type
|
|
185
|
+
export { type OpenCodeAuthenticationMode, type OpenCodeHarnessSettings, VERSION, createOpenCode, openCode };
|