@ai-sdk/harness-claude-code 0.0.0 → 1.0.0-beta.11

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,95 @@
1
+ # @ai-sdk/harness-claude-code
2
+
3
+ ## 1.0.0-beta.11
4
+
5
+ ### Patch Changes
6
+
7
+ - @ai-sdk/harness@1.0.0-beta.15
8
+
9
+ ## 1.0.0-beta.10
10
+
11
+ ### Patch Changes
12
+
13
+ - b8396f0: trigger initial beta release
14
+ - Updated dependencies [b8396f0]
15
+ - @ai-sdk/harness@1.0.0-beta.14
16
+ - @ai-sdk/provider-utils@5.0.0-beta.49
17
+
18
+ ## 1.0.0-canary.9
19
+
20
+ ### Patch Changes
21
+
22
+ - @ai-sdk/harness@1.0.0-canary.13
23
+
24
+ ## 1.0.0-canary.8
25
+
26
+ ### Patch Changes
27
+
28
+ - @ai-sdk/harness@1.0.0-canary.12
29
+
30
+ ## 1.0.0-canary.7
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [be83911]
35
+ - @ai-sdk/harness@1.0.0-canary.11
36
+
37
+ ## 1.0.0-canary.6
38
+
39
+ ### Patch Changes
40
+
41
+ - @ai-sdk/harness@1.0.0-canary.10
42
+
43
+ ## 1.0.0-canary.5
44
+
45
+ ### Patch Changes
46
+
47
+ - @ai-sdk/harness@1.0.0-canary.9
48
+
49
+ ## 1.0.0-canary.4
50
+
51
+ ### Patch Changes
52
+
53
+ - aae0138: fix(harness): make listening for sandbox bridge readiness compatible with Bun
54
+ - Updated dependencies [aae0138]
55
+ - @ai-sdk/harness@1.0.0-canary.8
56
+
57
+ ## 1.0.0-canary.3
58
+
59
+ ### Patch Changes
60
+
61
+ - 1ea15a3: fix(harness): fix various bugs with harness skills not being correctly processed by the harness adapters
62
+ - e551763: fix(harness): avoid using peer dependencies for underlying harness and sandbox SDKs
63
+ - Updated dependencies [3d87086]
64
+ - Updated dependencies [aeda373]
65
+ - Updated dependencies [1ea15a3]
66
+ - Updated dependencies [375fdd7]
67
+ - Updated dependencies [b4507d5]
68
+ - @ai-sdk/harness@1.0.0-canary.7
69
+ - @ai-sdk/provider-utils@5.0.0-canary.48
70
+
71
+ ## 1.0.0-canary.2
72
+
73
+ ### Patch Changes
74
+
75
+ - @ai-sdk/harness@1.0.0-canary.6
76
+
77
+ ## 1.0.0-canary.1
78
+
79
+ ### Patch Changes
80
+
81
+ - Updated dependencies [d77bed4]
82
+ - Updated dependencies [bae5e2b]
83
+ - @ai-sdk/harness@1.0.0-canary.5
84
+ - @ai-sdk/provider-utils@5.0.0-canary.47
85
+
86
+ ## 1.0.0-canary.0
87
+
88
+ ### Major Changes
89
+
90
+ - 3d9a50c: feat(harness): implement harness adapters for Claude Code, Codex, Pi
91
+
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies [3d9a50c]
95
+ - @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.