@ai-sdk/harness-claude-code 0.0.0-d3900c59-20260626174016

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,225 @@
1
+ # @ai-sdk/harness-claude-code
2
+
3
+ ## 0.0.0-d3900c59-20260626174016
4
+
5
+ ### Patch Changes
6
+
7
+ - 691c7c4: fix(harness): fix harness Zod usage to be v3/v4 compatible
8
+ - Updated dependencies [691c7c4]
9
+ - @ai-sdk/harness@0.0.0-d3900c59-20260626174016
10
+
11
+ ## 1.0.3
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [51d10a0]
16
+ - @ai-sdk/harness@1.0.3
17
+
18
+ ## 1.0.2
19
+
20
+ ### Patch Changes
21
+
22
+ - @ai-sdk/harness@1.0.2
23
+
24
+ ## 1.0.1
25
+
26
+ ### Patch Changes
27
+
28
+ - @ai-sdk/harness@1.0.1
29
+
30
+ ## 1.0.0
31
+
32
+ ### Major Changes
33
+
34
+ - 3d9a50c: feat(harness): implement harness adapters for Claude Code, Codex, Pi
35
+
36
+ ### Patch Changes
37
+
38
+ - e5d4a24: chore(harness): update ws package
39
+ - bc77265: chore(harness): enforce more structural conventions in harness adapters
40
+ - aae0138: fix(harness): make listening for sandbox bridge readiness compatible with Bun
41
+ - 6b81cfe: chore(harness-claude-code): update Claude Code SDK
42
+ - 1ea15a3: fix(harness): fix various bugs with harness skills not being correctly processed by the harness adapters
43
+ - b8396f0: trigger initial beta release
44
+ - e551763: fix(harness): avoid using peer dependencies for underlying harness and sandbox SDKs
45
+ - 534dac6: fix(harness): fix incomplete OIDC token support for AI Gateway auth in harness adapters
46
+
47
+ ## 1.0.0-beta.24
48
+
49
+ ### Patch Changes
50
+
51
+ - @ai-sdk/harness@1.0.0-beta.27
52
+
53
+ ## 1.0.0-beta.23
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies [a83a367]
58
+ - @ai-sdk/harness@1.0.0-beta.26
59
+
60
+ ## 1.0.0-beta.22
61
+
62
+ ### Patch Changes
63
+
64
+ - @ai-sdk/harness@1.0.0-beta.25
65
+
66
+ ## 1.0.0-beta.21
67
+
68
+ ### Patch Changes
69
+
70
+ - @ai-sdk/harness@1.0.0-beta.24
71
+
72
+ ## 1.0.0-beta.20
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies [57e0a59]
77
+ - @ai-sdk/harness@1.0.0-beta.23
78
+
79
+ ## 1.0.0-beta.19
80
+
81
+ ### Patch Changes
82
+
83
+ - @ai-sdk/harness@1.0.0-beta.22
84
+ - @ai-sdk/provider-utils@5.0.0-beta.50
85
+
86
+ ## 1.0.0-beta.18
87
+
88
+ ### Patch Changes
89
+
90
+ - bc77265: chore(harness): enforce more structural conventions in harness adapters
91
+
92
+ ## 1.0.0-beta.17
93
+
94
+ ### Patch Changes
95
+
96
+ - @ai-sdk/harness@1.0.0-beta.21
97
+
98
+ ## 1.0.0-beta.16
99
+
100
+ ### Patch Changes
101
+
102
+ - e5d4a24: chore(harness): update ws package
103
+ - 6b81cfe: chore(harness-claude-code): update Claude Code SDK
104
+ - Updated dependencies [e5d4a24]
105
+ - @ai-sdk/harness@1.0.0-beta.20
106
+
107
+ ## 1.0.0-beta.15
108
+
109
+ ### Patch Changes
110
+
111
+ - @ai-sdk/harness@1.0.0-beta.19
112
+
113
+ ## 1.0.0-beta.14
114
+
115
+ ### Patch Changes
116
+
117
+ - @ai-sdk/harness@1.0.0-beta.18
118
+
119
+ ## 1.0.0-beta.13
120
+
121
+ ### Patch Changes
122
+
123
+ - 534dac6: fix(harness): fix incomplete OIDC token support for AI Gateway auth in harness adapters
124
+ - Updated dependencies [534dac6]
125
+ - @ai-sdk/harness@1.0.0-beta.17
126
+
127
+ ## 1.0.0-beta.12
128
+
129
+ ### Patch Changes
130
+
131
+ - @ai-sdk/harness@1.0.0-beta.16
132
+
133
+ ## 1.0.0-beta.11
134
+
135
+ ### Patch Changes
136
+
137
+ - @ai-sdk/harness@1.0.0-beta.15
138
+
139
+ ## 1.0.0-beta.10
140
+
141
+ ### Patch Changes
142
+
143
+ - b8396f0: trigger initial beta release
144
+ - Updated dependencies [b8396f0]
145
+ - @ai-sdk/harness@1.0.0-beta.14
146
+ - @ai-sdk/provider-utils@5.0.0-beta.49
147
+
148
+ ## 1.0.0-canary.9
149
+
150
+ ### Patch Changes
151
+
152
+ - @ai-sdk/harness@1.0.0-canary.13
153
+
154
+ ## 1.0.0-canary.8
155
+
156
+ ### Patch Changes
157
+
158
+ - @ai-sdk/harness@1.0.0-canary.12
159
+
160
+ ## 1.0.0-canary.7
161
+
162
+ ### Patch Changes
163
+
164
+ - Updated dependencies [be83911]
165
+ - @ai-sdk/harness@1.0.0-canary.11
166
+
167
+ ## 1.0.0-canary.6
168
+
169
+ ### Patch Changes
170
+
171
+ - @ai-sdk/harness@1.0.0-canary.10
172
+
173
+ ## 1.0.0-canary.5
174
+
175
+ ### Patch Changes
176
+
177
+ - @ai-sdk/harness@1.0.0-canary.9
178
+
179
+ ## 1.0.0-canary.4
180
+
181
+ ### Patch Changes
182
+
183
+ - aae0138: fix(harness): make listening for sandbox bridge readiness compatible with Bun
184
+ - Updated dependencies [aae0138]
185
+ - @ai-sdk/harness@1.0.0-canary.8
186
+
187
+ ## 1.0.0-canary.3
188
+
189
+ ### Patch Changes
190
+
191
+ - 1ea15a3: fix(harness): fix various bugs with harness skills not being correctly processed by the harness adapters
192
+ - e551763: fix(harness): avoid using peer dependencies for underlying harness and sandbox SDKs
193
+ - Updated dependencies [3d87086]
194
+ - Updated dependencies [aeda373]
195
+ - Updated dependencies [1ea15a3]
196
+ - Updated dependencies [375fdd7]
197
+ - Updated dependencies [b4507d5]
198
+ - @ai-sdk/harness@1.0.0-canary.7
199
+ - @ai-sdk/provider-utils@5.0.0-canary.48
200
+
201
+ ## 1.0.0-canary.2
202
+
203
+ ### Patch Changes
204
+
205
+ - @ai-sdk/harness@1.0.0-canary.6
206
+
207
+ ## 1.0.0-canary.1
208
+
209
+ ### Patch Changes
210
+
211
+ - Updated dependencies [d77bed4]
212
+ - Updated dependencies [bae5e2b]
213
+ - @ai-sdk/harness@1.0.0-canary.5
214
+ - @ai-sdk/provider-utils@5.0.0-canary.47
215
+
216
+ ## 1.0.0-canary.0
217
+
218
+ ### Major Changes
219
+
220
+ - 3d9a50c: feat(harness): implement harness adapters for Claude Code, Codex, Pi
221
+
222
+ ### Patch Changes
223
+
224
+ - Updated dependencies [3d9a50c]
225
+ - @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,62 @@
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': { thinking: 'adaptive' },
46
+ },
47
+ });
48
+
49
+ const session = await agent.createSession();
50
+
51
+ try {
52
+ const result = await agent.generate({
53
+ session,
54
+ prompt: 'Read README.md and summarise the goals.',
55
+ });
56
+ console.log(result.text);
57
+ } finally {
58
+ await session.destroy();
59
+ }
60
+ ```
61
+
62
+ 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.