@ai-sdk/harness-codex 0.0.0-07500555-20260730161446

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 ADDED
@@ -0,0 +1,498 @@
1
+ # @ai-sdk/harness-codex
2
+
3
+ ## 0.0.0-07500555-20260730161446
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [5f65e61]
8
+ - @ai-sdk/harness@0.0.0-07500555-20260730161446
9
+ - @ai-sdk/provider-utils@0.0.0-07500555-20260730161446
10
+
11
+ ## 1.0.41
12
+
13
+ ### Patch Changes
14
+
15
+ - b2f553b: fix(harness-codex): route Codex host tools through the CLI relay only instead of registering them as MCP tools
16
+ - Updated dependencies [86a84c9]
17
+ - @ai-sdk/harness@1.0.39
18
+
19
+ ## 1.0.40
20
+
21
+ ### Patch Changes
22
+
23
+ - f5cdb2d: chore(harness): update primary SDK dependencies
24
+ - Updated dependencies [02ffdcb]
25
+ - Updated dependencies [76cb673]
26
+ - @ai-sdk/provider-utils@5.0.12
27
+ - @ai-sdk/harness@1.0.38
28
+
29
+ ## 1.0.39
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [b460541]
34
+ - Updated dependencies [079591e]
35
+ - @ai-sdk/harness@1.0.37
36
+
37
+ ## 1.0.38
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies [cd06458]
42
+ - @ai-sdk/provider-utils@5.0.11
43
+ - @ai-sdk/harness@1.0.36
44
+
45
+ ## 1.0.37
46
+
47
+ ### Patch Changes
48
+
49
+ - @ai-sdk/harness@1.0.35
50
+
51
+ ## 1.0.36
52
+
53
+ ### Patch Changes
54
+
55
+ - @ai-sdk/harness@1.0.34
56
+
57
+ ## 1.0.35
58
+
59
+ ### Patch Changes
60
+
61
+ - @ai-sdk/harness@1.0.33
62
+
63
+ ## 1.0.34
64
+
65
+ ### Patch Changes
66
+
67
+ - Updated dependencies [31c7be8]
68
+ - @ai-sdk/provider-utils@5.0.10
69
+ - @ai-sdk/harness@1.0.32
70
+
71
+ ## 1.0.33
72
+
73
+ ### Patch Changes
74
+
75
+ - @ai-sdk/harness@1.0.31
76
+
77
+ ## 1.0.32
78
+
79
+ ### Patch Changes
80
+
81
+ - Updated dependencies [4be62c1]
82
+ - Updated dependencies [7805e4a]
83
+ - Updated dependencies [cd12954]
84
+ - @ai-sdk/provider-utils@5.0.9
85
+ - @ai-sdk/harness@1.0.30
86
+
87
+ ## 1.0.31
88
+
89
+ ### Patch Changes
90
+
91
+ - Updated dependencies [e193290]
92
+ - @ai-sdk/provider-utils@5.0.8
93
+ - @ai-sdk/harness@1.0.29
94
+
95
+ ## 1.0.30
96
+
97
+ ### Patch Changes
98
+
99
+ - @ai-sdk/harness@1.0.28
100
+
101
+ ## 1.0.29
102
+
103
+ ### Patch Changes
104
+
105
+ - c93803d: fix(harness): improve CLI relay tool invocation logic
106
+
107
+ ## 1.0.28
108
+
109
+ ### Patch Changes
110
+
111
+ - @ai-sdk/harness@1.0.27
112
+
113
+ ## 1.0.27
114
+
115
+ ### Patch Changes
116
+
117
+ - @ai-sdk/harness@1.0.26
118
+
119
+ ## 1.0.26
120
+
121
+ ### Patch Changes
122
+
123
+ - Updated dependencies [44e988a]
124
+ - @ai-sdk/harness@1.0.25
125
+
126
+ ## 1.0.25
127
+
128
+ ### Patch Changes
129
+
130
+ - @ai-sdk/harness@1.0.24
131
+
132
+ ## 1.0.24
133
+
134
+ ### Patch Changes
135
+
136
+ - 39c8276: fix(harness): improve opaque sandbox bridge error handling
137
+ - 91fe6d8: fix(harness): emit `finish-step` stream parts correctly per the underlying model steps
138
+ - Updated dependencies [39c8276]
139
+ - Updated dependencies [91fe6d8]
140
+ - Updated dependencies [0be5014]
141
+ - @ai-sdk/harness@1.0.23
142
+
143
+ ## 1.0.23
144
+
145
+ ### Patch Changes
146
+
147
+ - @ai-sdk/harness@1.0.22
148
+ - @ai-sdk/provider-utils@5.0.7
149
+
150
+ ## 1.0.22
151
+
152
+ ### Patch Changes
153
+
154
+ - Updated dependencies [ac306ed]
155
+ - @ai-sdk/provider-utils@5.0.6
156
+ - @ai-sdk/harness@1.0.21
157
+
158
+ ## 1.0.21
159
+
160
+ ### Patch Changes
161
+
162
+ - b2d0306: feat(harness): send `User-Agent` and `x-client-app` headers in harness adapters
163
+ - Updated dependencies [b7aa06a]
164
+ - @ai-sdk/harness@1.0.20
165
+
166
+ ## 1.0.20
167
+
168
+ ### Patch Changes
169
+
170
+ - @ai-sdk/harness@1.0.19
171
+
172
+ ## 1.0.19
173
+
174
+ ### Patch Changes
175
+
176
+ - @ai-sdk/harness@1.0.18
177
+
178
+ ## 1.0.18
179
+
180
+ ### Patch Changes
181
+
182
+ - Updated dependencies [5c5c0f5]
183
+ - @ai-sdk/provider-utils@5.0.5
184
+ - @ai-sdk/harness@1.0.17
185
+
186
+ ## 1.0.17
187
+
188
+ ### Patch Changes
189
+
190
+ - @ai-sdk/harness@1.0.16
191
+
192
+ ## 1.0.16
193
+
194
+ ### Patch Changes
195
+
196
+ - Updated dependencies [c6f5e62]
197
+ - @ai-sdk/provider-utils@5.0.4
198
+ - @ai-sdk/harness@1.0.15
199
+
200
+ ## 1.0.15
201
+
202
+ ### Patch Changes
203
+
204
+ - @ai-sdk/harness@1.0.14
205
+
206
+ ## 1.0.14
207
+
208
+ ### Patch Changes
209
+
210
+ - Updated dependencies [8c616f0]
211
+ - @ai-sdk/provider-utils@5.0.3
212
+ - @ai-sdk/harness@1.0.13
213
+
214
+ ## 1.0.13
215
+
216
+ ### Patch Changes
217
+
218
+ - 7859cea: feat(harness): add tool filtering via `activeTools` and `inactiveTools`
219
+ - c857346: feat(harness): add utility functions for certain duplicated layers in harnesses
220
+ - Updated dependencies [7859cea]
221
+ - Updated dependencies [c857346]
222
+ - @ai-sdk/harness@1.0.12
223
+
224
+ ## 1.0.12
225
+
226
+ ### Patch Changes
227
+
228
+ - 2933383: fix(harness): fix harness relay auth
229
+ - @ai-sdk/harness@1.0.11
230
+
231
+ ## 1.0.11
232
+
233
+ ### Patch Changes
234
+
235
+ - 0d1cb8e: fix(harness-codex): improve Codex prompt framing and avoid placing relay shim file in session workdir
236
+
237
+ ## 1.0.10
238
+
239
+ ### Patch Changes
240
+
241
+ - @ai-sdk/harness@1.0.10
242
+ - @ai-sdk/provider-utils@5.0.2
243
+
244
+ ## 1.0.9
245
+
246
+ ### Patch Changes
247
+
248
+ - @ai-sdk/harness@1.0.9
249
+
250
+ ## 1.0.8
251
+
252
+ ### Patch Changes
253
+
254
+ - c0e991c: fix(harness-codex): fix Codex sometimes stopping after a single text response when using `workflow-harness`
255
+ - @ai-sdk/harness@1.0.8
256
+
257
+ ## 1.0.7
258
+
259
+ ### Patch Changes
260
+
261
+ - @ai-sdk/harness@1.0.7
262
+
263
+ ## 1.0.6
264
+
265
+ ### Patch Changes
266
+
267
+ - Updated dependencies [6a436e3]
268
+ - @ai-sdk/provider-utils@5.0.1
269
+ - @ai-sdk/harness@1.0.6
270
+
271
+ ## 1.0.5
272
+
273
+ ### Patch Changes
274
+
275
+ - 43a8c68: fix(harness): use `shellQuote` where appropriate in harness adapters
276
+ - @ai-sdk/harness@1.0.5
277
+
278
+ ## 1.0.4
279
+
280
+ ### Patch Changes
281
+
282
+ - c493634: fix(harness): fix harness Zod usage to be v3/v4 compatible
283
+ - Updated dependencies [c493634]
284
+ - @ai-sdk/harness@1.0.4
285
+
286
+ ## 1.0.3
287
+
288
+ ### Patch Changes
289
+
290
+ - Updated dependencies [51d10a0]
291
+ - @ai-sdk/harness@1.0.3
292
+
293
+ ## 1.0.2
294
+
295
+ ### Patch Changes
296
+
297
+ - @ai-sdk/harness@1.0.2
298
+
299
+ ## 1.0.1
300
+
301
+ ### Patch Changes
302
+
303
+ - @ai-sdk/harness@1.0.1
304
+
305
+ ## 1.0.0
306
+
307
+ ### Major Changes
308
+
309
+ - 3d9a50c: feat(harness): implement harness adapters for Claude Code, Codex, Pi
310
+
311
+ ### Patch Changes
312
+
313
+ - e5d4a24: chore(harness): update ws package
314
+ - bc77265: chore(harness): enforce more structural conventions in harness adapters
315
+ - aae0138: fix(harness): make listening for sandbox bridge readiness compatible with Bun
316
+ - 1ea15a3: fix(harness): fix various bugs with harness skills not being correctly processed by the harness adapters
317
+ - b8396f0: trigger initial beta release
318
+ - e551763: fix(harness): avoid using peer dependencies for underlying harness and sandbox SDKs
319
+ - 534dac6: fix(harness): fix incomplete OIDC token support for AI Gateway auth in harness adapters
320
+
321
+ ## 1.0.0-beta.24
322
+
323
+ ### Patch Changes
324
+
325
+ - @ai-sdk/harness@1.0.0-beta.27
326
+
327
+ ## 1.0.0-beta.23
328
+
329
+ ### Patch Changes
330
+
331
+ - Updated dependencies [a83a367]
332
+ - @ai-sdk/harness@1.0.0-beta.26
333
+
334
+ ## 1.0.0-beta.22
335
+
336
+ ### Patch Changes
337
+
338
+ - @ai-sdk/harness@1.0.0-beta.25
339
+
340
+ ## 1.0.0-beta.21
341
+
342
+ ### Patch Changes
343
+
344
+ - @ai-sdk/harness@1.0.0-beta.24
345
+
346
+ ## 1.0.0-beta.20
347
+
348
+ ### Patch Changes
349
+
350
+ - Updated dependencies [57e0a59]
351
+ - @ai-sdk/harness@1.0.0-beta.23
352
+
353
+ ## 1.0.0-beta.19
354
+
355
+ ### Patch Changes
356
+
357
+ - @ai-sdk/harness@1.0.0-beta.22
358
+ - @ai-sdk/provider-utils@5.0.0-beta.50
359
+
360
+ ## 1.0.0-beta.18
361
+
362
+ ### Patch Changes
363
+
364
+ - bc77265: chore(harness): enforce more structural conventions in harness adapters
365
+
366
+ ## 1.0.0-beta.17
367
+
368
+ ### Patch Changes
369
+
370
+ - @ai-sdk/harness@1.0.0-beta.21
371
+
372
+ ## 1.0.0-beta.16
373
+
374
+ ### Patch Changes
375
+
376
+ - e5d4a24: chore(harness): update ws package
377
+ - Updated dependencies [e5d4a24]
378
+ - @ai-sdk/harness@1.0.0-beta.20
379
+
380
+ ## 1.0.0-beta.15
381
+
382
+ ### Patch Changes
383
+
384
+ - @ai-sdk/harness@1.0.0-beta.19
385
+
386
+ ## 1.0.0-beta.14
387
+
388
+ ### Patch Changes
389
+
390
+ - @ai-sdk/harness@1.0.0-beta.18
391
+
392
+ ## 1.0.0-beta.13
393
+
394
+ ### Patch Changes
395
+
396
+ - 534dac6: fix(harness): fix incomplete OIDC token support for AI Gateway auth in harness adapters
397
+ - Updated dependencies [534dac6]
398
+ - @ai-sdk/harness@1.0.0-beta.17
399
+
400
+ ## 1.0.0-beta.12
401
+
402
+ ### Patch Changes
403
+
404
+ - @ai-sdk/harness@1.0.0-beta.16
405
+
406
+ ## 1.0.0-beta.11
407
+
408
+ ### Patch Changes
409
+
410
+ - @ai-sdk/harness@1.0.0-beta.15
411
+
412
+ ## 1.0.0-beta.10
413
+
414
+ ### Patch Changes
415
+
416
+ - b8396f0: trigger initial beta release
417
+ - Updated dependencies [b8396f0]
418
+ - @ai-sdk/harness@1.0.0-beta.14
419
+ - @ai-sdk/provider-utils@5.0.0-beta.49
420
+
421
+ ## 1.0.0-canary.9
422
+
423
+ ### Patch Changes
424
+
425
+ - @ai-sdk/harness@1.0.0-canary.13
426
+
427
+ ## 1.0.0-canary.8
428
+
429
+ ### Patch Changes
430
+
431
+ - @ai-sdk/harness@1.0.0-canary.12
432
+
433
+ ## 1.0.0-canary.7
434
+
435
+ ### Patch Changes
436
+
437
+ - Updated dependencies [be83911]
438
+ - @ai-sdk/harness@1.0.0-canary.11
439
+
440
+ ## 1.0.0-canary.6
441
+
442
+ ### Patch Changes
443
+
444
+ - @ai-sdk/harness@1.0.0-canary.10
445
+
446
+ ## 1.0.0-canary.5
447
+
448
+ ### Patch Changes
449
+
450
+ - @ai-sdk/harness@1.0.0-canary.9
451
+
452
+ ## 1.0.0-canary.4
453
+
454
+ ### Patch Changes
455
+
456
+ - aae0138: fix(harness): make listening for sandbox bridge readiness compatible with Bun
457
+ - Updated dependencies [aae0138]
458
+ - @ai-sdk/harness@1.0.0-canary.8
459
+
460
+ ## 1.0.0-canary.3
461
+
462
+ ### Patch Changes
463
+
464
+ - 1ea15a3: fix(harness): fix various bugs with harness skills not being correctly processed by the harness adapters
465
+ - e551763: fix(harness): avoid using peer dependencies for underlying harness and sandbox SDKs
466
+ - Updated dependencies [3d87086]
467
+ - Updated dependencies [aeda373]
468
+ - Updated dependencies [1ea15a3]
469
+ - Updated dependencies [375fdd7]
470
+ - Updated dependencies [b4507d5]
471
+ - @ai-sdk/harness@1.0.0-canary.7
472
+ - @ai-sdk/provider-utils@5.0.0-canary.48
473
+
474
+ ## 1.0.0-canary.2
475
+
476
+ ### Patch Changes
477
+
478
+ - @ai-sdk/harness@1.0.0-canary.6
479
+
480
+ ## 1.0.0-canary.1
481
+
482
+ ### Patch Changes
483
+
484
+ - Updated dependencies [d77bed4]
485
+ - Updated dependencies [bae5e2b]
486
+ - @ai-sdk/harness@1.0.0-canary.5
487
+ - @ai-sdk/provider-utils@5.0.0-canary.47
488
+
489
+ ## 1.0.0-canary.0
490
+
491
+ ### Major Changes
492
+
493
+ - 3d9a50c: feat(harness): implement harness adapters for Claude Code, Codex, Pi
494
+
495
+ ### Patch Changes
496
+
497
+ - Updated dependencies [3d9a50c]
498
+ - @ai-sdk/harness@1.0.0-canary.4
package/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2023 Vercel, Inc.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,73 @@
1
+ # AI SDK - Codex Harness
2
+
3
+ `HarnessV1` adapter backed by [`@openai/codex-sdk`](https://www.npmjs.com/package/@openai/codex-sdk), which drives the `codex` CLI. The adapter ships a bridge process that runs inside a sandbox and talks to the host over a WebSocket on a sandbox-proxied loopback port.
4
+
5
+ ## Setup
6
+
7
+ ```bash
8
+ npm i @ai-sdk/harness-codex @ai-sdk/harness @ai-sdk/sandbox-vercel
9
+ ```
10
+
11
+ The bridge installs `@openai/codex-sdk` (and the `codex` CLI it depends on) inside the sandbox the first time the session starts.
12
+
13
+ ## Usage
14
+
15
+ ```ts
16
+ import { HarnessAgent } from '@ai-sdk/harness/agent';
17
+ import { createCodex } from '@ai-sdk/harness-codex';
18
+ import { createVercelSandbox } from '@ai-sdk/sandbox-vercel';
19
+ import { tool } from 'ai';
20
+ import { z } from 'zod/v4';
21
+
22
+ const agent = new HarnessAgent({
23
+ harness: createCodex(),
24
+ id: 'demo',
25
+ sandbox: createVercelSandbox({
26
+ runtime: 'node24',
27
+ ports: [4000],
28
+ }),
29
+ tools: {
30
+ deploy: tool({
31
+ description: 'Deploy a service.',
32
+ inputSchema: z.object({ env: z.enum(['staging', 'production']) }),
33
+ execute: async ({ env }) => ({ url: `https://${env}.example.com` }),
34
+ }),
35
+ },
36
+ harnessOptions: {
37
+ codex: { reasoningEffort: 'high' },
38
+ },
39
+ });
40
+ ```
41
+
42
+ > Codex does not auto-discover a skills directory the way the `claude` CLI
43
+ > does, so when you supply `skills: [...]` on the factory the adapter
44
+ > injects every skill inline into the user prompt on each turn. Use fewer,
45
+ > larger skills rather than many tiny ones.
46
+
47
+ ```ts
48
+ const agent = new HarnessAgent({
49
+ harness: createCodex({
50
+ skills: [
51
+ { name: 'haiku-mode', description: 'Answer in haikus.', content: '...' },
52
+ ],
53
+ }),
54
+ sandbox: createVercelSandbox({
55
+ runtime: 'node24',
56
+ ports: [4000],
57
+ }),
58
+ });
59
+
60
+ const session = await agent.createSession();
61
+
62
+ try {
63
+ const result = await agent.generate({
64
+ session,
65
+ prompt: 'List the files in this workspace and describe their purpose.',
66
+ });
67
+ console.log(result.text);
68
+ } finally {
69
+ await session.destroy();
70
+ }
71
+ ```
72
+
73
+ The adapter requires a `HarnessV1SandboxProvider` whose handles expose at least one port — `@ai-sdk/sandbox-vercel` is the supported choice today. The agent calls `provider.createSession()` when a session starts. Use `session.detach()` to park the bridge and sandbox, `session.stop()` to save state and stop the sandbox, or `session.destroy()` to clean up without keeping resume state.