@ai-sdk/harness-claude-code 0.0.0-6b196531-20260710185421

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,388 @@
1
+ # @ai-sdk/harness-claude-code
2
+
3
+ ## 0.0.0-6b196531-20260710185421
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [036463b]
8
+ - Updated dependencies [9988975]
9
+ - @ai-sdk/provider-utils@0.0.0-6b196531-20260710185421
10
+ - @ai-sdk/harness@0.0.0-6b196531-20260710185421
11
+
12
+ ## 1.0.25
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [44e988a]
17
+ - @ai-sdk/harness@1.0.25
18
+
19
+ ## 1.0.24
20
+
21
+ ### Patch Changes
22
+
23
+ - @ai-sdk/harness@1.0.24
24
+
25
+ ## 1.0.23
26
+
27
+ ### Patch Changes
28
+
29
+ - 39c8276: fix(harness): improve opaque sandbox bridge error handling
30
+ - 91fe6d8: fix(harness): emit `finish-step` stream parts correctly per the underlying model steps
31
+ - dcc7ecd: fix(harness-claude-code): fix Claude Code not displaying its reasoning by default
32
+ - Updated dependencies [39c8276]
33
+ - Updated dependencies [91fe6d8]
34
+ - Updated dependencies [0be5014]
35
+ - @ai-sdk/harness@1.0.23
36
+
37
+ ## 1.0.22
38
+
39
+ ### Patch Changes
40
+
41
+ - @ai-sdk/harness@1.0.22
42
+ - @ai-sdk/provider-utils@5.0.7
43
+
44
+ ## 1.0.21
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [ac306ed]
49
+ - @ai-sdk/provider-utils@5.0.6
50
+ - @ai-sdk/harness@1.0.21
51
+
52
+ ## 1.0.20
53
+
54
+ ### Patch Changes
55
+
56
+ - b2d0306: feat(harness): send `User-Agent` and `x-client-app` headers in harness adapters
57
+ - Updated dependencies [b7aa06a]
58
+ - @ai-sdk/harness@1.0.20
59
+
60
+ ## 1.0.19
61
+
62
+ ### Patch Changes
63
+
64
+ - @ai-sdk/harness@1.0.19
65
+
66
+ ## 1.0.18
67
+
68
+ ### Patch Changes
69
+
70
+ - @ai-sdk/harness@1.0.18
71
+
72
+ ## 1.0.17
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies [5c5c0f5]
77
+ - @ai-sdk/provider-utils@5.0.5
78
+ - @ai-sdk/harness@1.0.17
79
+
80
+ ## 1.0.16
81
+
82
+ ### Patch Changes
83
+
84
+ - @ai-sdk/harness@1.0.16
85
+
86
+ ## 1.0.15
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [c6f5e62]
91
+ - @ai-sdk/provider-utils@5.0.4
92
+ - @ai-sdk/harness@1.0.15
93
+
94
+ ## 1.0.14
95
+
96
+ ### Patch Changes
97
+
98
+ - @ai-sdk/harness@1.0.14
99
+
100
+ ## 1.0.13
101
+
102
+ ### Patch Changes
103
+
104
+ - Updated dependencies [8c616f0]
105
+ - @ai-sdk/provider-utils@5.0.3
106
+ - @ai-sdk/harness@1.0.13
107
+
108
+ ## 1.0.12
109
+
110
+ ### Patch Changes
111
+
112
+ - 7859cea: feat(harness): add tool filtering via `activeTools` and `inactiveTools`
113
+ - c857346: feat(harness): add utility functions for certain duplicated layers in harnesses
114
+ - 7a24276: fix(harness-claude-code): declare Claude Code's Monitor tool as built-in tool
115
+ - Updated dependencies [7859cea]
116
+ - Updated dependencies [c857346]
117
+ - @ai-sdk/harness@1.0.12
118
+
119
+ ## 1.0.11
120
+
121
+ ### Patch Changes
122
+
123
+ - @ai-sdk/harness@1.0.11
124
+
125
+ ## 1.0.10
126
+
127
+ ### Patch Changes
128
+
129
+ - @ai-sdk/harness@1.0.10
130
+ - @ai-sdk/provider-utils@5.0.2
131
+
132
+ ## 1.0.9
133
+
134
+ ### Patch Changes
135
+
136
+ - @ai-sdk/harness@1.0.9
137
+
138
+ ## 1.0.8
139
+
140
+ ### Patch Changes
141
+
142
+ - @ai-sdk/harness@1.0.8
143
+
144
+ ## 1.0.7
145
+
146
+ ### Patch Changes
147
+
148
+ - @ai-sdk/harness@1.0.7
149
+
150
+ ## 1.0.6
151
+
152
+ ### Patch Changes
153
+
154
+ - Updated dependencies [6a436e3]
155
+ - @ai-sdk/provider-utils@5.0.1
156
+ - @ai-sdk/harness@1.0.6
157
+
158
+ ## 1.0.5
159
+
160
+ ### Patch Changes
161
+
162
+ - 43a8c68: fix(harness): use `shellQuote` where appropriate in harness adapters
163
+ - ba6d510: chore: fix deprecated use of zod `.passthrough()`
164
+ - @ai-sdk/harness@1.0.5
165
+
166
+ ## 1.0.4
167
+
168
+ ### Patch Changes
169
+
170
+ - c493634: fix(harness): fix harness Zod usage to be v3/v4 compatible
171
+ - Updated dependencies [c493634]
172
+ - @ai-sdk/harness@1.0.4
173
+
174
+ ## 1.0.3
175
+
176
+ ### Patch Changes
177
+
178
+ - Updated dependencies [51d10a0]
179
+ - @ai-sdk/harness@1.0.3
180
+
181
+ ## 1.0.2
182
+
183
+ ### Patch Changes
184
+
185
+ - @ai-sdk/harness@1.0.2
186
+
187
+ ## 1.0.1
188
+
189
+ ### Patch Changes
190
+
191
+ - @ai-sdk/harness@1.0.1
192
+
193
+ ## 1.0.0
194
+
195
+ ### Major Changes
196
+
197
+ - 3d9a50c: feat(harness): implement harness adapters for Claude Code, Codex, Pi
198
+
199
+ ### Patch Changes
200
+
201
+ - e5d4a24: chore(harness): update ws package
202
+ - bc77265: chore(harness): enforce more structural conventions in harness adapters
203
+ - aae0138: fix(harness): make listening for sandbox bridge readiness compatible with Bun
204
+ - 6b81cfe: chore(harness-claude-code): update Claude Code SDK
205
+ - 1ea15a3: fix(harness): fix various bugs with harness skills not being correctly processed by the harness adapters
206
+ - b8396f0: trigger initial beta release
207
+ - e551763: fix(harness): avoid using peer dependencies for underlying harness and sandbox SDKs
208
+ - 534dac6: fix(harness): fix incomplete OIDC token support for AI Gateway auth in harness adapters
209
+
210
+ ## 1.0.0-beta.24
211
+
212
+ ### Patch Changes
213
+
214
+ - @ai-sdk/harness@1.0.0-beta.27
215
+
216
+ ## 1.0.0-beta.23
217
+
218
+ ### Patch Changes
219
+
220
+ - Updated dependencies [a83a367]
221
+ - @ai-sdk/harness@1.0.0-beta.26
222
+
223
+ ## 1.0.0-beta.22
224
+
225
+ ### Patch Changes
226
+
227
+ - @ai-sdk/harness@1.0.0-beta.25
228
+
229
+ ## 1.0.0-beta.21
230
+
231
+ ### Patch Changes
232
+
233
+ - @ai-sdk/harness@1.0.0-beta.24
234
+
235
+ ## 1.0.0-beta.20
236
+
237
+ ### Patch Changes
238
+
239
+ - Updated dependencies [57e0a59]
240
+ - @ai-sdk/harness@1.0.0-beta.23
241
+
242
+ ## 1.0.0-beta.19
243
+
244
+ ### Patch Changes
245
+
246
+ - @ai-sdk/harness@1.0.0-beta.22
247
+ - @ai-sdk/provider-utils@5.0.0-beta.50
248
+
249
+ ## 1.0.0-beta.18
250
+
251
+ ### Patch Changes
252
+
253
+ - bc77265: chore(harness): enforce more structural conventions in harness adapters
254
+
255
+ ## 1.0.0-beta.17
256
+
257
+ ### Patch Changes
258
+
259
+ - @ai-sdk/harness@1.0.0-beta.21
260
+
261
+ ## 1.0.0-beta.16
262
+
263
+ ### Patch Changes
264
+
265
+ - e5d4a24: chore(harness): update ws package
266
+ - 6b81cfe: chore(harness-claude-code): update Claude Code SDK
267
+ - Updated dependencies [e5d4a24]
268
+ - @ai-sdk/harness@1.0.0-beta.20
269
+
270
+ ## 1.0.0-beta.15
271
+
272
+ ### Patch Changes
273
+
274
+ - @ai-sdk/harness@1.0.0-beta.19
275
+
276
+ ## 1.0.0-beta.14
277
+
278
+ ### Patch Changes
279
+
280
+ - @ai-sdk/harness@1.0.0-beta.18
281
+
282
+ ## 1.0.0-beta.13
283
+
284
+ ### Patch Changes
285
+
286
+ - 534dac6: fix(harness): fix incomplete OIDC token support for AI Gateway auth in harness adapters
287
+ - Updated dependencies [534dac6]
288
+ - @ai-sdk/harness@1.0.0-beta.17
289
+
290
+ ## 1.0.0-beta.12
291
+
292
+ ### Patch Changes
293
+
294
+ - @ai-sdk/harness@1.0.0-beta.16
295
+
296
+ ## 1.0.0-beta.11
297
+
298
+ ### Patch Changes
299
+
300
+ - @ai-sdk/harness@1.0.0-beta.15
301
+
302
+ ## 1.0.0-beta.10
303
+
304
+ ### Patch Changes
305
+
306
+ - b8396f0: trigger initial beta release
307
+ - Updated dependencies [b8396f0]
308
+ - @ai-sdk/harness@1.0.0-beta.14
309
+ - @ai-sdk/provider-utils@5.0.0-beta.49
310
+
311
+ ## 1.0.0-canary.9
312
+
313
+ ### Patch Changes
314
+
315
+ - @ai-sdk/harness@1.0.0-canary.13
316
+
317
+ ## 1.0.0-canary.8
318
+
319
+ ### Patch Changes
320
+
321
+ - @ai-sdk/harness@1.0.0-canary.12
322
+
323
+ ## 1.0.0-canary.7
324
+
325
+ ### Patch Changes
326
+
327
+ - Updated dependencies [be83911]
328
+ - @ai-sdk/harness@1.0.0-canary.11
329
+
330
+ ## 1.0.0-canary.6
331
+
332
+ ### Patch Changes
333
+
334
+ - @ai-sdk/harness@1.0.0-canary.10
335
+
336
+ ## 1.0.0-canary.5
337
+
338
+ ### Patch Changes
339
+
340
+ - @ai-sdk/harness@1.0.0-canary.9
341
+
342
+ ## 1.0.0-canary.4
343
+
344
+ ### Patch Changes
345
+
346
+ - aae0138: fix(harness): make listening for sandbox bridge readiness compatible with Bun
347
+ - Updated dependencies [aae0138]
348
+ - @ai-sdk/harness@1.0.0-canary.8
349
+
350
+ ## 1.0.0-canary.3
351
+
352
+ ### Patch Changes
353
+
354
+ - 1ea15a3: fix(harness): fix various bugs with harness skills not being correctly processed by the harness adapters
355
+ - e551763: fix(harness): avoid using peer dependencies for underlying harness and sandbox SDKs
356
+ - Updated dependencies [3d87086]
357
+ - Updated dependencies [aeda373]
358
+ - Updated dependencies [1ea15a3]
359
+ - Updated dependencies [375fdd7]
360
+ - Updated dependencies [b4507d5]
361
+ - @ai-sdk/harness@1.0.0-canary.7
362
+ - @ai-sdk/provider-utils@5.0.0-canary.48
363
+
364
+ ## 1.0.0-canary.2
365
+
366
+ ### Patch Changes
367
+
368
+ - @ai-sdk/harness@1.0.0-canary.6
369
+
370
+ ## 1.0.0-canary.1
371
+
372
+ ### Patch Changes
373
+
374
+ - Updated dependencies [d77bed4]
375
+ - Updated dependencies [bae5e2b]
376
+ - @ai-sdk/harness@1.0.0-canary.5
377
+ - @ai-sdk/provider-utils@5.0.0-canary.47
378
+
379
+ ## 1.0.0-canary.0
380
+
381
+ ### Major Changes
382
+
383
+ - 3d9a50c: feat(harness): implement harness adapters for Claude Code, Codex, Pi
384
+
385
+ ### Patch Changes
386
+
387
+ - Updated dependencies [3d9a50c]
388
+ - @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.