@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 +26 -0
- package/README.md +12 -13
- package/dist/bridge/index.mjs +1248 -484
- package/dist/bridge/index.mjs.map +1 -1
- package/dist/bridge/package.json +1 -1
- package/dist/bridge/pnpm-lock.yaml +1 -9
- package/dist/index.d.ts +1399 -0
- package/dist/index.js +46 -73
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/bridge/codex-app-server-client.ts +320 -0
- package/src/bridge/codex-app-server-driver.ts +617 -0
- package/src/bridge/codex-step-tracker.ts +2 -0
- package/src/bridge/codex-tool-filtering-hook.ts +148 -0
- package/src/bridge/codex-tool-filtering.ts +42 -0
- package/src/bridge/create-app-server-event-handler.ts +531 -0
- package/src/bridge/create-emit-stream-event.ts +27 -2
- package/src/bridge/index.ts +64 -193
- package/src/bridge/package.json +1 -1
- package/src/bridge/pnpm-lock.yaml +1 -9
- package/src/codex-bridge-protocol.ts +4 -4
- package/src/codex-harness.ts +56 -117
- package/src/bridge/cli-relay.ts +0 -268
- package/src/bridge/tool-relay-auth.ts +0 -156
- package/src/bridge/tool-relay.ts +0 -119
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 [
|
|
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
|
|
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 {
|
|
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
|
|
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
|
|
80
|
+
The adapter needs a sandbox session with an exposed port. The caller ends the
|
|
81
|
+
harness session and sandbox separately.
|