@ai-sdk/harness-claude-code 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,496 @@
1
+ # @ai-sdk/harness-claude-code
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.40
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [86a84c9]
16
+ - @ai-sdk/harness@1.0.39
17
+
18
+ ## 1.0.39
19
+
20
+ ### Patch Changes
21
+
22
+ - f5cdb2d: chore(harness): update primary SDK dependencies
23
+ - Updated dependencies [02ffdcb]
24
+ - Updated dependencies [76cb673]
25
+ - @ai-sdk/provider-utils@5.0.12
26
+ - @ai-sdk/harness@1.0.38
27
+
28
+ ## 1.0.38
29
+
30
+ ### Patch Changes
31
+
32
+ - 6c3e639: fix(harness-claude-code): classify the Skill tool as readonly so `allow-reads` permission mode no longer requires approval for skill activations
33
+ - 0534507: fix(harness-claude-code): preserve nested user tool JSON schemas when exposing tools through the MCP bridge
34
+ - Updated dependencies [b460541]
35
+ - Updated dependencies [079591e]
36
+ - @ai-sdk/harness@1.0.37
37
+
38
+ ## 1.0.37
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [cd06458]
43
+ - @ai-sdk/provider-utils@5.0.11
44
+ - @ai-sdk/harness@1.0.36
45
+
46
+ ## 1.0.36
47
+
48
+ ### Patch Changes
49
+
50
+ - @ai-sdk/harness@1.0.35
51
+
52
+ ## 1.0.35
53
+
54
+ ### Patch Changes
55
+
56
+ - @ai-sdk/harness@1.0.34
57
+
58
+ ## 1.0.34
59
+
60
+ ### Patch Changes
61
+
62
+ - @ai-sdk/harness@1.0.33
63
+
64
+ ## 1.0.33
65
+
66
+ ### Patch Changes
67
+
68
+ - Updated dependencies [31c7be8]
69
+ - @ai-sdk/provider-utils@5.0.10
70
+ - @ai-sdk/harness@1.0.32
71
+
72
+ ## 1.0.32
73
+
74
+ ### Patch Changes
75
+
76
+ - c93c87e: fix(harness-claude-code): add ToolSearch to claude code builtin tools
77
+
78
+ ## 1.0.31
79
+
80
+ ### Patch Changes
81
+
82
+ - @ai-sdk/harness@1.0.31
83
+
84
+ ## 1.0.30
85
+
86
+ ### Patch Changes
87
+
88
+ - Updated dependencies [4be62c1]
89
+ - Updated dependencies [7805e4a]
90
+ - Updated dependencies [cd12954]
91
+ - @ai-sdk/provider-utils@5.0.9
92
+ - @ai-sdk/harness@1.0.30
93
+
94
+ ## 1.0.29
95
+
96
+ ### Patch Changes
97
+
98
+ - Updated dependencies [e193290]
99
+ - @ai-sdk/provider-utils@5.0.8
100
+ - @ai-sdk/harness@1.0.29
101
+
102
+ ## 1.0.28
103
+
104
+ ### Patch Changes
105
+
106
+ - @ai-sdk/harness@1.0.28
107
+
108
+ ## 1.0.27
109
+
110
+ ### Patch Changes
111
+
112
+ - @ai-sdk/harness@1.0.27
113
+
114
+ ## 1.0.26
115
+
116
+ ### Patch Changes
117
+
118
+ - @ai-sdk/harness@1.0.26
119
+
120
+ ## 1.0.25
121
+
122
+ ### Patch Changes
123
+
124
+ - Updated dependencies [44e988a]
125
+ - @ai-sdk/harness@1.0.25
126
+
127
+ ## 1.0.24
128
+
129
+ ### Patch Changes
130
+
131
+ - @ai-sdk/harness@1.0.24
132
+
133
+ ## 1.0.23
134
+
135
+ ### Patch Changes
136
+
137
+ - 39c8276: fix(harness): improve opaque sandbox bridge error handling
138
+ - 91fe6d8: fix(harness): emit `finish-step` stream parts correctly per the underlying model steps
139
+ - dcc7ecd: fix(harness-claude-code): fix Claude Code not displaying its reasoning by default
140
+ - Updated dependencies [39c8276]
141
+ - Updated dependencies [91fe6d8]
142
+ - Updated dependencies [0be5014]
143
+ - @ai-sdk/harness@1.0.23
144
+
145
+ ## 1.0.22
146
+
147
+ ### Patch Changes
148
+
149
+ - @ai-sdk/harness@1.0.22
150
+ - @ai-sdk/provider-utils@5.0.7
151
+
152
+ ## 1.0.21
153
+
154
+ ### Patch Changes
155
+
156
+ - Updated dependencies [ac306ed]
157
+ - @ai-sdk/provider-utils@5.0.6
158
+ - @ai-sdk/harness@1.0.21
159
+
160
+ ## 1.0.20
161
+
162
+ ### Patch Changes
163
+
164
+ - b2d0306: feat(harness): send `User-Agent` and `x-client-app` headers in harness adapters
165
+ - Updated dependencies [b7aa06a]
166
+ - @ai-sdk/harness@1.0.20
167
+
168
+ ## 1.0.19
169
+
170
+ ### Patch Changes
171
+
172
+ - @ai-sdk/harness@1.0.19
173
+
174
+ ## 1.0.18
175
+
176
+ ### Patch Changes
177
+
178
+ - @ai-sdk/harness@1.0.18
179
+
180
+ ## 1.0.17
181
+
182
+ ### Patch Changes
183
+
184
+ - Updated dependencies [5c5c0f5]
185
+ - @ai-sdk/provider-utils@5.0.5
186
+ - @ai-sdk/harness@1.0.17
187
+
188
+ ## 1.0.16
189
+
190
+ ### Patch Changes
191
+
192
+ - @ai-sdk/harness@1.0.16
193
+
194
+ ## 1.0.15
195
+
196
+ ### Patch Changes
197
+
198
+ - Updated dependencies [c6f5e62]
199
+ - @ai-sdk/provider-utils@5.0.4
200
+ - @ai-sdk/harness@1.0.15
201
+
202
+ ## 1.0.14
203
+
204
+ ### Patch Changes
205
+
206
+ - @ai-sdk/harness@1.0.14
207
+
208
+ ## 1.0.13
209
+
210
+ ### Patch Changes
211
+
212
+ - Updated dependencies [8c616f0]
213
+ - @ai-sdk/provider-utils@5.0.3
214
+ - @ai-sdk/harness@1.0.13
215
+
216
+ ## 1.0.12
217
+
218
+ ### Patch Changes
219
+
220
+ - 7859cea: feat(harness): add tool filtering via `activeTools` and `inactiveTools`
221
+ - c857346: feat(harness): add utility functions for certain duplicated layers in harnesses
222
+ - 7a24276: fix(harness-claude-code): declare Claude Code's Monitor tool as built-in tool
223
+ - Updated dependencies [7859cea]
224
+ - Updated dependencies [c857346]
225
+ - @ai-sdk/harness@1.0.12
226
+
227
+ ## 1.0.11
228
+
229
+ ### Patch Changes
230
+
231
+ - @ai-sdk/harness@1.0.11
232
+
233
+ ## 1.0.10
234
+
235
+ ### Patch Changes
236
+
237
+ - @ai-sdk/harness@1.0.10
238
+ - @ai-sdk/provider-utils@5.0.2
239
+
240
+ ## 1.0.9
241
+
242
+ ### Patch Changes
243
+
244
+ - @ai-sdk/harness@1.0.9
245
+
246
+ ## 1.0.8
247
+
248
+ ### Patch Changes
249
+
250
+ - @ai-sdk/harness@1.0.8
251
+
252
+ ## 1.0.7
253
+
254
+ ### Patch Changes
255
+
256
+ - @ai-sdk/harness@1.0.7
257
+
258
+ ## 1.0.6
259
+
260
+ ### Patch Changes
261
+
262
+ - Updated dependencies [6a436e3]
263
+ - @ai-sdk/provider-utils@5.0.1
264
+ - @ai-sdk/harness@1.0.6
265
+
266
+ ## 1.0.5
267
+
268
+ ### Patch Changes
269
+
270
+ - 43a8c68: fix(harness): use `shellQuote` where appropriate in harness adapters
271
+ - ba6d510: chore: fix deprecated use of zod `.passthrough()`
272
+ - @ai-sdk/harness@1.0.5
273
+
274
+ ## 1.0.4
275
+
276
+ ### Patch Changes
277
+
278
+ - c493634: fix(harness): fix harness Zod usage to be v3/v4 compatible
279
+ - Updated dependencies [c493634]
280
+ - @ai-sdk/harness@1.0.4
281
+
282
+ ## 1.0.3
283
+
284
+ ### Patch Changes
285
+
286
+ - Updated dependencies [51d10a0]
287
+ - @ai-sdk/harness@1.0.3
288
+
289
+ ## 1.0.2
290
+
291
+ ### Patch Changes
292
+
293
+ - @ai-sdk/harness@1.0.2
294
+
295
+ ## 1.0.1
296
+
297
+ ### Patch Changes
298
+
299
+ - @ai-sdk/harness@1.0.1
300
+
301
+ ## 1.0.0
302
+
303
+ ### Major Changes
304
+
305
+ - 3d9a50c: feat(harness): implement harness adapters for Claude Code, Codex, Pi
306
+
307
+ ### Patch Changes
308
+
309
+ - e5d4a24: chore(harness): update ws package
310
+ - bc77265: chore(harness): enforce more structural conventions in harness adapters
311
+ - aae0138: fix(harness): make listening for sandbox bridge readiness compatible with Bun
312
+ - 6b81cfe: chore(harness-claude-code): update Claude Code SDK
313
+ - 1ea15a3: fix(harness): fix various bugs with harness skills not being correctly processed by the harness adapters
314
+ - b8396f0: trigger initial beta release
315
+ - e551763: fix(harness): avoid using peer dependencies for underlying harness and sandbox SDKs
316
+ - 534dac6: fix(harness): fix incomplete OIDC token support for AI Gateway auth in harness adapters
317
+
318
+ ## 1.0.0-beta.24
319
+
320
+ ### Patch Changes
321
+
322
+ - @ai-sdk/harness@1.0.0-beta.27
323
+
324
+ ## 1.0.0-beta.23
325
+
326
+ ### Patch Changes
327
+
328
+ - Updated dependencies [a83a367]
329
+ - @ai-sdk/harness@1.0.0-beta.26
330
+
331
+ ## 1.0.0-beta.22
332
+
333
+ ### Patch Changes
334
+
335
+ - @ai-sdk/harness@1.0.0-beta.25
336
+
337
+ ## 1.0.0-beta.21
338
+
339
+ ### Patch Changes
340
+
341
+ - @ai-sdk/harness@1.0.0-beta.24
342
+
343
+ ## 1.0.0-beta.20
344
+
345
+ ### Patch Changes
346
+
347
+ - Updated dependencies [57e0a59]
348
+ - @ai-sdk/harness@1.0.0-beta.23
349
+
350
+ ## 1.0.0-beta.19
351
+
352
+ ### Patch Changes
353
+
354
+ - @ai-sdk/harness@1.0.0-beta.22
355
+ - @ai-sdk/provider-utils@5.0.0-beta.50
356
+
357
+ ## 1.0.0-beta.18
358
+
359
+ ### Patch Changes
360
+
361
+ - bc77265: chore(harness): enforce more structural conventions in harness adapters
362
+
363
+ ## 1.0.0-beta.17
364
+
365
+ ### Patch Changes
366
+
367
+ - @ai-sdk/harness@1.0.0-beta.21
368
+
369
+ ## 1.0.0-beta.16
370
+
371
+ ### Patch Changes
372
+
373
+ - e5d4a24: chore(harness): update ws package
374
+ - 6b81cfe: chore(harness-claude-code): update Claude Code SDK
375
+ - Updated dependencies [e5d4a24]
376
+ - @ai-sdk/harness@1.0.0-beta.20
377
+
378
+ ## 1.0.0-beta.15
379
+
380
+ ### Patch Changes
381
+
382
+ - @ai-sdk/harness@1.0.0-beta.19
383
+
384
+ ## 1.0.0-beta.14
385
+
386
+ ### Patch Changes
387
+
388
+ - @ai-sdk/harness@1.0.0-beta.18
389
+
390
+ ## 1.0.0-beta.13
391
+
392
+ ### Patch Changes
393
+
394
+ - 534dac6: fix(harness): fix incomplete OIDC token support for AI Gateway auth in harness adapters
395
+ - Updated dependencies [534dac6]
396
+ - @ai-sdk/harness@1.0.0-beta.17
397
+
398
+ ## 1.0.0-beta.12
399
+
400
+ ### Patch Changes
401
+
402
+ - @ai-sdk/harness@1.0.0-beta.16
403
+
404
+ ## 1.0.0-beta.11
405
+
406
+ ### Patch Changes
407
+
408
+ - @ai-sdk/harness@1.0.0-beta.15
409
+
410
+ ## 1.0.0-beta.10
411
+
412
+ ### Patch Changes
413
+
414
+ - b8396f0: trigger initial beta release
415
+ - Updated dependencies [b8396f0]
416
+ - @ai-sdk/harness@1.0.0-beta.14
417
+ - @ai-sdk/provider-utils@5.0.0-beta.49
418
+
419
+ ## 1.0.0-canary.9
420
+
421
+ ### Patch Changes
422
+
423
+ - @ai-sdk/harness@1.0.0-canary.13
424
+
425
+ ## 1.0.0-canary.8
426
+
427
+ ### Patch Changes
428
+
429
+ - @ai-sdk/harness@1.0.0-canary.12
430
+
431
+ ## 1.0.0-canary.7
432
+
433
+ ### Patch Changes
434
+
435
+ - Updated dependencies [be83911]
436
+ - @ai-sdk/harness@1.0.0-canary.11
437
+
438
+ ## 1.0.0-canary.6
439
+
440
+ ### Patch Changes
441
+
442
+ - @ai-sdk/harness@1.0.0-canary.10
443
+
444
+ ## 1.0.0-canary.5
445
+
446
+ ### Patch Changes
447
+
448
+ - @ai-sdk/harness@1.0.0-canary.9
449
+
450
+ ## 1.0.0-canary.4
451
+
452
+ ### Patch Changes
453
+
454
+ - aae0138: fix(harness): make listening for sandbox bridge readiness compatible with Bun
455
+ - Updated dependencies [aae0138]
456
+ - @ai-sdk/harness@1.0.0-canary.8
457
+
458
+ ## 1.0.0-canary.3
459
+
460
+ ### Patch Changes
461
+
462
+ - 1ea15a3: fix(harness): fix various bugs with harness skills not being correctly processed by the harness adapters
463
+ - e551763: fix(harness): avoid using peer dependencies for underlying harness and sandbox SDKs
464
+ - Updated dependencies [3d87086]
465
+ - Updated dependencies [aeda373]
466
+ - Updated dependencies [1ea15a3]
467
+ - Updated dependencies [375fdd7]
468
+ - Updated dependencies [b4507d5]
469
+ - @ai-sdk/harness@1.0.0-canary.7
470
+ - @ai-sdk/provider-utils@5.0.0-canary.48
471
+
472
+ ## 1.0.0-canary.2
473
+
474
+ ### Patch Changes
475
+
476
+ - @ai-sdk/harness@1.0.0-canary.6
477
+
478
+ ## 1.0.0-canary.1
479
+
480
+ ### Patch Changes
481
+
482
+ - Updated dependencies [d77bed4]
483
+ - Updated dependencies [bae5e2b]
484
+ - @ai-sdk/harness@1.0.0-canary.5
485
+ - @ai-sdk/provider-utils@5.0.0-canary.47
486
+
487
+ ## 1.0.0-canary.0
488
+
489
+ ### Major Changes
490
+
491
+ - 3d9a50c: feat(harness): implement harness adapters for Claude Code, Codex, Pi
492
+
493
+ ### Patch Changes
494
+
495
+ - Updated dependencies [3d9a50c]
496
+ - @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,64 @@
1
+ # AI SDK - Claude Code Harness
2
+
3
+ `HarnessV1` adapter backed by [`@anthropic-ai/claude-agent-sdk`](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk), which drives the `claude` 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-claude-code @ai-sdk/harness @ai-sdk/sandbox-vercel
9
+ ```
10
+
11
+ The bridge installs `@anthropic-ai/claude-agent-sdk` and `@anthropic-ai/claude-code` 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 { createClaudeCode } from '@ai-sdk/harness-claude-code';
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: createClaudeCode({
24
+ skills: [
25
+ {
26
+ name: 'careful-refactors',
27
+ description: 'Make minimal diffs and keep tests green.',
28
+ content: 'Prefer changes that touch the fewest files possible.',
29
+ },
30
+ ],
31
+ }),
32
+ id: 'demo',
33
+ sandbox: createVercelSandbox({
34
+ runtime: 'node24',
35
+ ports: [4000],
36
+ }),
37
+ tools: {
38
+ deploy: tool({
39
+ description: 'Deploy a service.',
40
+ inputSchema: z.object({ env: z.enum(['staging', 'production']) }),
41
+ execute: async ({ env }) => ({ url: `https://${env}.example.com` }),
42
+ }),
43
+ },
44
+ harnessOptions: {
45
+ 'claude-code': {
46
+ thinking: { type: 'adaptive', display: 'summarized' },
47
+ },
48
+ },
49
+ });
50
+
51
+ const session = await agent.createSession();
52
+
53
+ try {
54
+ const result = await agent.generate({
55
+ session,
56
+ prompt: 'Read README.md and summarise the goals.',
57
+ });
58
+ console.log(result.text);
59
+ } finally {
60
+ await session.destroy();
61
+ }
62
+ ```
63
+
64
+ 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.