@ai-sdk/harness-codex 1.0.126 → 1.0.129

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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # @ai-sdk/harness-codex
2
2
 
3
+ ## 1.0.129
4
+
5
+ ### Patch Changes
6
+
7
+ - @ai-sdk/harness@1.0.127
8
+
9
+ ## 1.0.128
10
+
11
+ ### Patch Changes
12
+
13
+ - af9597b: Compile packages for ES2022 runtime target
14
+ - Updated dependencies [af9597b]
15
+ - Updated dependencies [31742b9]
16
+ - Updated dependencies [bc49f78]
17
+ - @ai-sdk/harness@1.0.126
18
+ - @ai-sdk/provider-utils@5.0.49
19
+
20
+ ## 1.0.127
21
+
22
+ ### Patch Changes
23
+
24
+ - d17ead7: feat(harness-codex): migrate adapter to use Codex app server, unlocking more granular tool call emissions, built-in tool filtering, and mid-turn steering
25
+ - Updated dependencies [be877ff]
26
+ - @ai-sdk/provider-utils@5.0.48
27
+ - @ai-sdk/harness@1.0.125
28
+
3
29
  ## 1.0.126
4
30
 
5
31
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # AI SDK - Codex Harness
2
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.
3
+ `HarnessV1` adapter backed by the [Codex CLI](https://www.npmjs.com/package/@openai/codex). The adapter runs Codex app-server inside a sandbox and communicates with it over JSON-RPC. A bridge process connects app-server to the host over a WebSocket on a sandbox-proxied loopback port.
4
4
 
5
5
  ## Setup
6
6
 
@@ -8,14 +8,14 @@
8
8
  npm i @ai-sdk/harness-codex @ai-sdk/harness @ai-sdk/sandbox-vercel
9
9
  ```
10
10
 
11
- The bridge installs `@openai/codex-sdk` (and the `codex` CLI it depends on) inside the sandbox the first time the session starts.
11
+ The bridge installs the Codex CLI inside the sandbox the first time the session starts.
12
12
 
13
13
  ## Usage
14
14
 
15
15
  ```ts
16
16
  import { HarnessAgent } from '@ai-sdk/harness/agent';
17
17
  import { createCodex } from '@ai-sdk/harness-codex';
18
- import { createVercelSandbox } from '@ai-sdk/sandbox-vercel';
18
+ import { createVercelNetworkSandboxSession } from '@ai-sdk/sandbox-vercel';
19
19
  import { tool } from 'ai';
20
20
  import { z } from 'zod/v4';
21
21
 
@@ -26,10 +26,6 @@ const agent = new HarnessAgent({
26
26
  },
27
27
  }),
28
28
  id: 'demo',
29
- sandbox: createVercelSandbox({
30
- runtime: 'node24',
31
- ports: [4000],
32
- }),
33
29
  tools: {
34
30
  deploy: tool({
35
31
  description: 'Deploy a service.',
@@ -60,13 +56,14 @@ const agent = new HarnessAgent({
60
56
  { name: 'haiku-mode', description: 'Answer in haikus.', content: '...' },
61
57
  ],
62
58
  }),
63
- sandbox: createVercelSandbox({
64
- runtime: 'node24',
65
- ports: [4000],
66
- }),
67
59
  });
68
60
 
69
- const session = await agent.createSession();
61
+ const sandboxSession = await createVercelNetworkSandboxSession({
62
+ runtime: 'node24',
63
+ ports: [4000],
64
+ template: await agent.getSandboxTemplate(),
65
+ });
66
+ const session = await agent.createSession({ sandboxSession });
70
67
 
71
68
  try {
72
69
  const result = await agent.generate({
@@ -76,7 +73,9 @@ try {
76
73
  console.log(result.text);
77
74
  } finally {
78
75
  await session.destroy();
76
+ await sandboxSession.destroy();
79
77
  }
80
78
  ```
81
79
 
82
- 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.
80
+ The adapter needs a sandbox session with an exposed port. The caller ends the
81
+ harness session and sandbox separately.