@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.
@@ -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.3
16
- version: 1.18.3
15
+ specifier: 1.18.23
16
+ version: 1.18.23
17
17
  opencode-ai:
18
- specifier: 1.18.3
19
- version: 1.18.3
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.3':
46
- resolution: {integrity: sha512-Mevo4e6kQwbvto9E+42KSIVMhp+JBu+SwQhC5AomAvrV6Xkio3U249T+xDILDCXhl5Z/Hi/DlAuVLzpGnuh0gg==}
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.3:
290
- resolution: {integrity: sha512-HnItl/+uhSpj7JV9x6ITiE0XFq4b/PKF5OM03TIyiFoFiLw3MQoJOAXZFTEzC7IOgAIYcysRQBBmCmlXILkxww==}
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.3:
296
- resolution: {integrity: sha512-BkfJf4E502OVwpDXgaVz8eqTDOy2B9xXPefYebT+xv8TXYvEo1wtby4eu4MoN51o4o1qpzcvCCXDqUDXu1pBGQ==}
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.3:
301
- resolution: {integrity: sha512-8qQ9Ig7Zp7LEKaKGRL+OIlDb/uTLYkeAq6SGsN0fLHR2rHZRHyb61KrpkS5TgUlGwSWPtb5uCeVtTA9rGbEAKw==}
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.3:
306
- resolution: {integrity: sha512-ujy61O3WUEHjPqk+qXMBl97zR9q3crOzHbm2VLmXLHUWbqB5ZtN1HToODbuI1SBMKVR8GyZwPygRQVMfON4DHg==}
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.3:
311
- resolution: {integrity: sha512-s1vNP8dpIH3vFs8aoMzgHViBNVz6xtR7n24gGg0WOw4uSZVM+sRUmZKc3Hj56XjHQSsVBg5AkwR2Xm0nFSfIUQ==}
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.3:
317
- resolution: {integrity: sha512-K+1SPkfrYFUufPUYpbSurlB2ogpjv5in2usA1FwOM7HCOpNxR3ap7K+X4uQXnOV8AtsON+Vr9W5uYXQJA1yKlA==}
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.3:
322
- resolution: {integrity: sha512-F2nNPqYPdTCydLvNH1rvSXdlX3pfmOmOOfsFl+pqi3W0iE3Alyxmv28AjrIGUw4/6EfWhMKYcyxKjNIKLFyaZQ==}
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.3:
328
- resolution: {integrity: sha512-DDfspGSQ123yhsFhAlbpF+tsvje5kHOS2/PYUpWJroTlvgtqRLGmET51Anrxd5BrAFrqB6PXYA2kGh5QStPU/g==}
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.3:
333
- resolution: {integrity: sha512-SSp2zSpAM4dntcPZw8ISl3CmXYrWPftLc8u0HuAIeNWJOo6G4xAHPoXhNnXI3tQYqqGcppArf/3EMPnF9WnyFw==}
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.3:
339
- resolution: {integrity: sha512-p+19dSTf3pWL3+Rh/Ym94DvS9mNxNG94HJnR5oMCDhQvgimdT5tSdoK4ETtk4XOoCKz3OcTQDPHTdYKcJg32KQ==}
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.3:
344
- resolution: {integrity: sha512-qkz9/r6kUhhgLycQv71MoSQ2m5UI2QnZZx8SeZgyYD7oB8pDH6DIGbDWcs6BJ02ND1Y5hmgYWlP+rOrMkGlMJw==}
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.3:
349
- resolution: {integrity: sha512-+tyoxwSfY7msfZNY1IoA0ZWRL9XfdqY+ash6U3ldfE+GfF2WNAdhewmmYiUsC4lHjkdSmLt2brdWgoebQK9HAg==}
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.3:
354
- resolution: {integrity: sha512-V/Q4VkyZ7TkotLbpTCX/s5wP8MoFj5UnRqBHFJ8WGptb/+oYw36kamUUt1P1wN8iRjmw+8vwYhuYdAe+3xbgpQ==}
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.3':
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.3:
755
+ opencode-ai@1.18.23:
756
756
  optionalDependencies:
757
- opencode-darwin-arm64: 1.18.3
758
- opencode-darwin-x64: 1.18.3
759
- opencode-darwin-x64-baseline: 1.18.3
760
- opencode-linux-arm64: 1.18.3
761
- opencode-linux-arm64-musl: 1.18.3
762
- opencode-linux-x64: 1.18.3
763
- opencode-linux-x64-baseline: 1.18.3
764
- opencode-linux-x64-baseline-musl: 1.18.3
765
- opencode-linux-x64-musl: 1.18.3
766
- opencode-windows-arm64: 1.18.3
767
- opencode-windows-x64: 1.18.3
768
- opencode-windows-x64-baseline: 1.18.3
769
-
770
- opencode-darwin-arm64@1.18.3:
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.3:
773
+ opencode-darwin-x64-baseline@1.18.23:
774
774
  optional: true
775
775
 
776
- opencode-darwin-x64@1.18.3:
776
+ opencode-darwin-x64@1.18.23:
777
777
  optional: true
778
778
 
779
- opencode-linux-arm64-musl@1.18.3:
779
+ opencode-linux-arm64-musl@1.18.23:
780
780
  optional: true
781
781
 
782
- opencode-linux-arm64@1.18.3:
782
+ opencode-linux-arm64@1.18.23:
783
783
  optional: true
784
784
 
785
- opencode-linux-x64-baseline-musl@1.18.3:
785
+ opencode-linux-x64-baseline-musl@1.18.23:
786
786
  optional: true
787
787
 
788
- opencode-linux-x64-baseline@1.18.3:
788
+ opencode-linux-x64-baseline@1.18.23:
789
789
  optional: true
790
790
 
791
- opencode-linux-x64-musl@1.18.3:
791
+ opencode-linux-x64-musl@1.18.23:
792
792
  optional: true
793
793
 
794
- opencode-linux-x64@1.18.3:
794
+ opencode-linux-x64@1.18.23:
795
795
  optional: true
796
796
 
797
- opencode-windows-arm64@1.18.3:
797
+ opencode-windows-arm64@1.18.23:
798
798
  optional: true
799
799
 
800
- opencode-windows-x64-baseline@1.18.3:
800
+ opencode-windows-x64-baseline@1.18.23:
801
801
  optional: true
802
802
 
803
- opencode-windows-x64@1.18.3:
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.3': true
2
+ 'opencode-ai@1.18.23': true
package/src/index.ts CHANGED
@@ -9,7 +9,4 @@ export const openCode = createOpenCode();
9
9
  export { createOpenCode } from './opencode-harness';
10
10
  export { VERSION } from './version';
11
11
  export type { OpenCodeHarnessSettings } from './opencode-harness';
12
- export type {
13
- OpenCodeAuthenticationMode,
14
- OpenCodeAuthOptions,
15
- } from './opencode-auth';
12
+ export type { OpenCodeAuthenticationMode } from './opencode-auth';
@@ -1,10 +1,12 @@
1
1
  import type {
2
+ HarnessV1Authentication,
2
3
  HarnessV1RequestTransformation,
3
4
  HarnessV1RequestTransformationSources,
4
5
  } from '@ai-sdk/harness';
5
6
  import {
6
7
  createCredentialRequestTransformation,
7
8
  getAiGatewayAuthFromEnv,
9
+ isHarnessAuthenticationEnvironment,
8
10
  } from '@ai-sdk/harness/utils';
9
11
 
10
12
  export const OPENCODE_CREDENTIAL_ENVIRONMENT_VARIABLES = [
@@ -108,40 +110,9 @@ export type OpenCodeResolvedAuthenticationMode =
108
110
  | 'openai'
109
111
  | 'ai-gateway';
110
112
 
111
- export type OpenCodeAuthenticationMode =
112
- | OpenCodeResolvedAuthenticationMode
113
- | 'auto';
114
-
115
- /**
116
- * @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.
117
- */
118
- export type LegacyOpenCodeAuthOptions = {
119
- readonly gateway?: {
120
- readonly apiKey?: string;
121
- readonly baseUrl?: string;
122
- };
123
- readonly anthropic?: {
124
- readonly apiKey?: string;
125
- readonly authToken?: string;
126
- readonly baseUrl?: string;
127
- };
128
- readonly openai?: {
129
- readonly apiKey?: string;
130
- readonly baseUrl?: string;
131
- readonly organization?: string;
132
- readonly project?: string;
133
- };
134
- readonly openaiCompatible?: {
135
- readonly apiKey?: string;
136
- readonly baseUrl?: string;
137
- readonly name?: string;
138
- readonly queryParams?: Record<string, string>;
139
- };
140
- };
141
-
142
- export type OpenCodeAuthOptions =
143
- | OpenCodeAuthenticationMode
144
- | LegacyOpenCodeAuthOptions;
113
+ export type OpenCodeAuthenticationMode = HarnessV1Authentication<
114
+ 'anthropic' | 'openai'
115
+ >;
145
116
 
146
117
  export function resolveOpenCodeProvider({
147
118
  model,
@@ -188,37 +159,30 @@ export function resolveOpenCodeEnv({
188
159
  provider,
189
160
  processEnv = process.env,
190
161
  }: {
191
- auth: OpenCodeAuthOptions | undefined;
162
+ auth: OpenCodeAuthenticationMode | undefined;
192
163
  model?: string;
193
164
  provider?: string;
194
165
  processEnv?: Record<string, string | undefined>;
195
166
  }): Record<string, string> {
196
- const normalizedAuth = normalizeOpenCodeAuthToLegacyAuth(auth);
167
+ const suppliedEnvironment = isHarnessAuthenticationEnvironment(auth);
168
+ const authenticationEnvironment = suppliedEnvironment ? auth : processEnv;
197
169
  const selectedProvider = resolveOpenCodeProvider({ model, provider });
198
- if (normalizedAuth?.openaiCompatible) {
199
- return pickOpenAICompatible(normalizedAuth.openaiCompatible, processEnv);
170
+ if (selectedProvider === 'openai' && auth === 'openai') {
171
+ return pickOpenAI({ processEnv: authenticationEnvironment });
200
172
  }
201
- if (selectedProvider === 'openai') {
202
- if (normalizedAuth?.openai) {
203
- return pickOpenAI({ explicit: normalizedAuth.openai, processEnv });
204
- }
205
- } else if (normalizedAuth?.anthropic) {
206
- return pickAnthropic({ explicit: normalizedAuth.anthropic, processEnv });
173
+ if (selectedProvider === 'anthropic' && auth === 'anthropic') {
174
+ return pickAnthropic({ processEnv: authenticationEnvironment });
207
175
  }
208
176
 
209
- const gatewayAuthFromEnv = getAiGatewayAuthFromEnv({ env: processEnv });
210
- if (normalizedAuth?.gateway) {
211
- return pickGateway({
212
- explicit: normalizedAuth.gateway,
213
- gatewayAuthFromEnv,
214
- });
215
- }
216
- if (gatewayAuthFromEnv.apiKey) {
217
- return pickGateway({ explicit: {}, gatewayAuthFromEnv });
177
+ const gatewayAuthFromEnv = getAiGatewayAuthFromEnv({
178
+ env: authenticationEnvironment,
179
+ });
180
+ if (auth === 'ai-gateway' || gatewayAuthFromEnv.apiKey) {
181
+ return pickGateway({ gatewayAuthFromEnv });
218
182
  }
219
183
  return selectedProvider === 'openai'
220
- ? pickOpenAI({ processEnv })
221
- : pickAnthropic({ processEnv });
184
+ ? pickOpenAI({ processEnv: authenticationEnvironment })
185
+ : pickAnthropic({ processEnv: authenticationEnvironment });
222
186
  }
223
187
 
224
188
  export function resolveOpenCodeAuthenticationMode({
@@ -227,29 +191,24 @@ export function resolveOpenCodeAuthenticationMode({
227
191
  provider,
228
192
  processEnv = process.env,
229
193
  }: {
230
- auth: OpenCodeAuthOptions | undefined;
194
+ auth: OpenCodeAuthenticationMode | undefined;
231
195
  model?: string;
232
196
  provider?: string;
233
197
  processEnv?: Record<string, string | undefined>;
234
198
  }): OpenCodeResolvedAuthenticationMode {
235
- if (typeof auth !== 'string' && auth?.openaiCompatible) {
236
- return 'openai';
199
+ if (isHarnessAuthenticationEnvironment(auth)) {
200
+ return getAiGatewayAuthFromEnv({ env: auth }).apiKey
201
+ ? 'ai-gateway'
202
+ : resolveOpenCodeProvider({ model, provider });
237
203
  }
238
-
239
204
  const selectedProvider = resolveOpenCodeProvider({ model, provider });
240
- if (
241
- selectedProvider === 'openai' &&
242
- (auth === 'openai' || (typeof auth !== 'string' && auth?.openai))
243
- ) {
205
+ if (selectedProvider === 'openai' && auth === 'openai') {
244
206
  return 'openai';
245
207
  }
246
- if (
247
- selectedProvider === 'anthropic' &&
248
- (auth === 'anthropic' || (typeof auth !== 'string' && auth?.anthropic))
249
- ) {
208
+ if (selectedProvider === 'anthropic' && auth === 'anthropic') {
250
209
  return 'anthropic';
251
210
  }
252
- if (auth === 'ai-gateway' || (typeof auth !== 'string' && auth?.gateway)) {
211
+ if (auth === 'ai-gateway') {
253
212
  return 'ai-gateway';
254
213
  }
255
214
  if (getAiGatewayAuthFromEnv({ env: processEnv }).apiKey) {
@@ -258,99 +217,47 @@ export function resolveOpenCodeAuthenticationMode({
258
217
  return selectedProvider;
259
218
  }
260
219
 
261
- function normalizeOpenCodeAuthToLegacyAuth(
262
- auth: OpenCodeAuthOptions | undefined,
263
- ): LegacyOpenCodeAuthOptions | undefined {
264
- if (auth == null || auth === 'auto') {
265
- return undefined;
266
- }
267
- if (typeof auth === 'string') {
268
- switch (auth) {
269
- case 'anthropic':
270
- return { anthropic: {} };
271
- case 'openai':
272
- return { openai: {} };
273
- case 'ai-gateway':
274
- return { gateway: {} };
275
- default:
276
- return undefined;
277
- }
278
- }
279
-
280
- console.warn(
281
- '[opencode] Passing an object to auth options is deprecated. Use a string mode ("auto" | "anthropic" | "openai" | "ai-gateway") instead, and pass credentials via environment variables.',
282
- );
283
- return auth;
284
- }
285
-
286
- function pickOpenAICompatible(
287
- explicit: NonNullable<LegacyOpenCodeAuthOptions['openaiCompatible']>,
288
- processEnv: Record<string, string | undefined>,
289
- ): Record<string, string> {
290
- const env: Record<string, string> = {};
291
- const apiKey = explicit.apiKey ?? processEnv.OPENAI_API_KEY;
292
- if (apiKey) env.OPENAI_API_KEY = apiKey;
293
- const baseUrl = explicit.baseUrl ?? processEnv.OPENAI_BASE_URL;
294
- if (baseUrl) env.OPENAI_BASE_URL = baseUrl;
295
- const name = explicit.name ?? processEnv.OPENAI_NAME;
296
- if (name) env.OPENAI_NAME = name;
297
- if (explicit.queryParams && Object.keys(explicit.queryParams).length > 0) {
298
- env.OPENAI_QUERY_PARAMS_JSON = JSON.stringify(explicit.queryParams);
299
- } else if (processEnv.OPENAI_QUERY_PARAMS_JSON) {
300
- env.OPENAI_QUERY_PARAMS_JSON = processEnv.OPENAI_QUERY_PARAMS_JSON;
301
- }
302
- return env;
303
- }
304
-
305
220
  function pickOpenAI({
306
- explicit,
307
221
  processEnv,
308
222
  }: {
309
- explicit?: NonNullable<LegacyOpenCodeAuthOptions['openai']>;
310
223
  processEnv: Record<string, string | undefined>;
311
224
  }): Record<string, string> {
312
225
  const env: Record<string, string> = {};
313
- const apiKey = explicit?.apiKey ?? processEnv.OPENAI_API_KEY;
226
+ const apiKey = processEnv.OPENAI_API_KEY;
314
227
  if (apiKey) env.OPENAI_API_KEY = apiKey;
315
- const baseUrl = explicit?.baseUrl ?? processEnv.OPENAI_BASE_URL;
228
+ const baseUrl = processEnv.OPENAI_BASE_URL;
316
229
  if (baseUrl) env.OPENAI_BASE_URL = baseUrl;
317
- const organization = explicit?.organization ?? processEnv.OPENAI_ORGANIZATION;
230
+ const organization = processEnv.OPENAI_ORGANIZATION;
318
231
  if (organization) env.OPENAI_ORGANIZATION = organization;
319
- const project = explicit?.project ?? processEnv.OPENAI_PROJECT;
232
+ const project = processEnv.OPENAI_PROJECT;
320
233
  if (project) env.OPENAI_PROJECT = project;
321
234
  return env;
322
235
  }
323
236
 
324
237
  function pickAnthropic({
325
- explicit,
326
238
  processEnv,
327
239
  }: {
328
- explicit?: NonNullable<LegacyOpenCodeAuthOptions['anthropic']>;
329
240
  processEnv: Record<string, string | undefined>;
330
241
  }): Record<string, string> {
331
242
  const env: Record<string, string> = {};
332
- const apiKey = explicit?.apiKey ?? processEnv.ANTHROPIC_API_KEY;
243
+ const apiKey = processEnv.ANTHROPIC_API_KEY;
333
244
  if (apiKey) env.ANTHROPIC_API_KEY = apiKey;
334
- const authToken = explicit?.authToken ?? processEnv.ANTHROPIC_AUTH_TOKEN;
245
+ const authToken = processEnv.ANTHROPIC_AUTH_TOKEN;
335
246
  if (authToken) env.ANTHROPIC_AUTH_TOKEN = authToken;
336
- const baseUrl = explicit?.baseUrl ?? processEnv.ANTHROPIC_BASE_URL;
247
+ const baseUrl = processEnv.ANTHROPIC_BASE_URL;
337
248
  if (baseUrl) env.ANTHROPIC_BASE_URL = baseUrl;
338
249
  return env;
339
250
  }
340
251
 
341
252
  function pickGateway({
342
- explicit,
343
253
  gatewayAuthFromEnv,
344
254
  }: {
345
- explicit: NonNullable<LegacyOpenCodeAuthOptions['gateway']>;
346
255
  gatewayAuthFromEnv: ReturnType<typeof getAiGatewayAuthFromEnv>;
347
256
  }): Record<string, string> {
348
257
  const env: Record<string, string> = {};
349
- const apiKey = explicit.apiKey ?? gatewayAuthFromEnv.apiKey;
258
+ const apiKey = gatewayAuthFromEnv.apiKey;
350
259
  if (apiKey) env.AI_GATEWAY_API_KEY = apiKey;
351
- const baseUrl = toOpenCodeGatewayBaseUrl(
352
- explicit.baseUrl ?? gatewayAuthFromEnv.baseUrl,
353
- );
260
+ const baseUrl = toOpenCodeGatewayBaseUrl(gatewayAuthFromEnv.baseUrl);
354
261
  env.AI_GATEWAY_BASE_URL = baseUrl;
355
262
  return env;
356
263
  }
@@ -14,7 +14,9 @@ export const startMessageSchema = harnessV1BridgeStartBaseSchema.extend({
14
14
  provider: z.string().optional(),
15
15
  variant: z.string().optional(),
16
16
  instructions: z.string().optional(),
17
+ skillsChanged: z.boolean().optional(),
17
18
  resumeSessionId: z.string().optional(),
19
+ openCodeConfig: z.record(z.string(), z.unknown()).optional(),
18
20
  mcpServers: z.record(z.string(), z.unknown()).optional(),
19
21
  });
20
22