@ai-sdk/harness-codex 1.0.125 → 1.0.128

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,32 @@
1
1
  # @ai-sdk/harness-codex
2
2
 
3
+ ## 1.0.128
4
+
5
+ ### Patch Changes
6
+
7
+ - af9597b: Compile packages for ES2022 runtime target
8
+ - Updated dependencies [af9597b]
9
+ - Updated dependencies [31742b9]
10
+ - Updated dependencies [bc49f78]
11
+ - @ai-sdk/harness@1.0.126
12
+ - @ai-sdk/provider-utils@5.0.49
13
+
14
+ ## 1.0.127
15
+
16
+ ### Patch Changes
17
+
18
+ - 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
19
+ - Updated dependencies [be877ff]
20
+ - @ai-sdk/provider-utils@5.0.48
21
+ - @ai-sdk/harness@1.0.125
22
+
23
+ ## 1.0.126
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [40231b6]
28
+ - @ai-sdk/harness@1.0.124
29
+
3
30
  ## 1.0.125
4
31
 
5
32
  ### 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.