@agentproto/adapter-codex 2.0.11 → 2.0.13
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/CODEX.md +55 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +23 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CODEX.md
CHANGED
|
@@ -4,15 +4,15 @@ id: codex
|
|
|
4
4
|
description: OpenAI's Codex coding agent wrapped as an ACP server by @agentclientprotocol/codex-acp. Spawned via a version-pinned npx package and driven over stdio JSON-RPC. The wrapper bundles a compatible Codex runtime — no separate @openai/codex install required.
|
|
5
5
|
version: 0.1.0
|
|
6
6
|
bin: npx
|
|
7
|
-
bin_args: ["-y", "@agentclientprotocol/codex-acp@1.1
|
|
7
|
+
bin_args: ["-y", "@agentclientprotocol/codex-acp@1.13.1"]
|
|
8
8
|
install:
|
|
9
9
|
- method: npm
|
|
10
|
-
package: "@agentclientprotocol/codex-acp@1.1
|
|
10
|
+
package: "@agentclientprotocol/codex-acp@1.13.1"
|
|
11
11
|
global: true
|
|
12
12
|
version_check:
|
|
13
|
-
cmd: npm
|
|
13
|
+
cmd: npm ls -g @agentclientprotocol/codex-acp --depth=0
|
|
14
14
|
parse: "(\\d+\\.\\d+\\.\\d+)"
|
|
15
|
-
range: "=1.1
|
|
15
|
+
range: "=1.13.1"
|
|
16
16
|
timeout_ms: 15000
|
|
17
17
|
auth:
|
|
18
18
|
ref: ./SECRETS.md
|
|
@@ -26,12 +26,61 @@ session:
|
|
|
26
26
|
idle_timeout_ms: 1800000
|
|
27
27
|
context_carryover: true
|
|
28
28
|
models:
|
|
29
|
+
# Mirrors `models.allowed` in src/index.ts. Not a gate: Codex validates
|
|
30
|
+
# explicit ids dynamically against the signed-in account, so this is a
|
|
31
|
+
# discovery menu for catalog consumers.
|
|
29
32
|
default: gpt-5-codex
|
|
30
33
|
allowed:
|
|
34
|
+
# Codex-specialized (coding) models.
|
|
31
35
|
- gpt-5-codex
|
|
36
|
+
- gpt-5.1-codex
|
|
37
|
+
- gpt-5.1-codex-mini
|
|
38
|
+
- gpt-5.1-codex-max
|
|
39
|
+
- gpt-5.2-codex
|
|
40
|
+
# GPT-5 generalist family.
|
|
32
41
|
- gpt-5
|
|
33
42
|
- gpt-5-mini
|
|
43
|
+
- gpt-5-nano
|
|
34
44
|
- gpt-5-pro
|
|
45
|
+
- gpt-5.1
|
|
46
|
+
- gpt-5.2
|
|
47
|
+
- gpt-5.4
|
|
48
|
+
- gpt-5.4-mini
|
|
49
|
+
- gpt-5.4-nano
|
|
50
|
+
- gpt-5.4-pro
|
|
51
|
+
- gpt-5.5
|
|
52
|
+
- gpt-5.5-pro
|
|
53
|
+
# GPT-5.6 family.
|
|
54
|
+
- gpt-5.6-luna
|
|
55
|
+
- gpt-5.6-luna-pro
|
|
56
|
+
- gpt-5.6-sol
|
|
57
|
+
- gpt-5.6-sol-pro
|
|
58
|
+
- gpt-5.6-terra
|
|
59
|
+
- gpt-5.6-terra-pro
|
|
60
|
+
# GPT-6 family (no gpt-6-terra and no gpt-6-codex exist upstream).
|
|
61
|
+
- gpt-6-luna
|
|
62
|
+
- gpt-6-luna-pro
|
|
63
|
+
- gpt-6-sol
|
|
64
|
+
- gpt-6-sol-pro
|
|
65
|
+
- gpt-6-astra
|
|
66
|
+
- gpt-6-astra-pro
|
|
67
|
+
# GPT-4.1 / 4o generation.
|
|
68
|
+
- gpt-4.1
|
|
69
|
+
- gpt-4.1-mini
|
|
70
|
+
- gpt-4.1-nano
|
|
71
|
+
- gpt-4o
|
|
72
|
+
- gpt-4o-mini
|
|
73
|
+
# o-series reasoning models.
|
|
74
|
+
- o3
|
|
75
|
+
- o3-pro
|
|
76
|
+
- o3-mini
|
|
77
|
+
- o3-deep-research
|
|
78
|
+
- o4-mini
|
|
79
|
+
- o4-mini-high
|
|
80
|
+
- o4-mini-deep-research
|
|
81
|
+
- o1
|
|
82
|
+
- o1-mini
|
|
83
|
+
- o1-pro
|
|
35
84
|
env:
|
|
36
85
|
openai: OPENAI_API_KEY
|
|
37
86
|
codex: CODEX_API_KEY
|
|
@@ -64,10 +113,10 @@ full-access session modes.
|
|
|
64
113
|
|
|
65
114
|
```bash
|
|
66
115
|
# npm (global) — recommended for fast spawn
|
|
67
|
-
npm install -g @agentclientprotocol/codex-acp@1.1
|
|
116
|
+
npm install -g @agentclientprotocol/codex-acp@1.13.1
|
|
68
117
|
|
|
69
118
|
# or rely on the npx form (no manual install)
|
|
70
|
-
npx -y @agentclientprotocol/codex-acp@1.1
|
|
119
|
+
npx -y @agentclientprotocol/codex-acp@1.13.1
|
|
71
120
|
```
|
|
72
121
|
|
|
73
122
|
The wrapper ships platform-specific native binaries via npm optional
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { AgentCliHandle, AgentCliRuntime } from '@agentproto/driver-agent-cli';
|
|
|
7
7
|
*
|
|
8
8
|
* The wrapper bundles its own Codex runtime (Rust binary delivered via
|
|
9
9
|
* npm dependency) so a single
|
|
10
|
-
* `npx -y @agentclientprotocol/codex-acp@1.
|
|
10
|
+
* `npx -y @agentclientprotocol/codex-acp@1.13.1`
|
|
11
11
|
* invocation is enough — no separate @openai/codex install needed.
|
|
12
12
|
*
|
|
13
13
|
* import { codex, codexRuntime } from "@agentproto/adapter-codex"
|
package/dist/index.mjs
CHANGED
|
@@ -14,11 +14,16 @@ var codex = defineAgentCli({
|
|
|
14
14
|
// Keep spawn deterministic. An unversioned npx target performs registry
|
|
15
15
|
// resolution at session startup and can silently replace both the bridge
|
|
16
16
|
// and its bundled Codex runtime exactly when either publishes an update.
|
|
17
|
-
|
|
17
|
+
// 1.13.1 bundles @openai/codex 0.156.1 (1.10.0 shipped 0.153.3). Nothing
|
|
18
|
+
// between 1.10.0 and 1.13.1 is flagged breaking: ACP protocolVersion stays
|
|
19
|
+
// 1, `session/new` and `session/set_config_option` are unchanged, and the
|
|
20
|
+
// additions (recommended model/effort, tool names on tool calls,
|
|
21
|
+
// experimental compaction updates and session notices) are opt-in extras.
|
|
22
|
+
bin_args: ["-y", "@agentclientprotocol/codex-acp@1.13.1"],
|
|
18
23
|
install: [
|
|
19
24
|
{
|
|
20
25
|
method: "npm",
|
|
21
|
-
package: "@agentclientprotocol/codex-acp@1.
|
|
26
|
+
package: "@agentclientprotocol/codex-acp@1.13.1",
|
|
22
27
|
global: true
|
|
23
28
|
}
|
|
24
29
|
],
|
|
@@ -27,7 +32,7 @@ var codex = defineAgentCli({
|
|
|
27
32
|
// claude-code's version_check note for the npm-view trap this replaces.
|
|
28
33
|
cmd: "npm ls -g @agentclientprotocol/codex-acp --depth=0",
|
|
29
34
|
parse: "(\\d+\\.\\d+\\.\\d+)",
|
|
30
|
-
range: "=1.
|
|
35
|
+
range: "=1.13.1",
|
|
31
36
|
timeout_ms: 15e3
|
|
32
37
|
},
|
|
33
38
|
auth: {
|
|
@@ -99,6 +104,21 @@ var codex = defineAgentCli({
|
|
|
99
104
|
"gpt-5.6-sol-pro",
|
|
100
105
|
"gpt-5.6-terra",
|
|
101
106
|
"gpt-5.6-terra-pro",
|
|
107
|
+
// GPT-6 family. Exactly the six ids that exist upstream — taken from
|
|
108
|
+
// the catalog's own synced OpenAI list (`openai-pricing.generated.ts`,
|
|
109
|
+
// OpenRouter passthrough) and cross-checked against the opencode-zen
|
|
110
|
+
// snapshot, which carries gpt-6-astra/luna/sol. Deliberately NOT a
|
|
111
|
+
// symmetric fill of the 5.6 shape: there is no `gpt-6-terra`, and no
|
|
112
|
+
// `gpt-6-codex` — inventing either would put an id in the menu that
|
|
113
|
+
// the bridge would reject on selection. The `:batch` variants the
|
|
114
|
+
// catalog also carries are omitted on purpose; batch is an offline
|
|
115
|
+
// job surface, not something an interactive ACP session selects.
|
|
116
|
+
"gpt-6-luna",
|
|
117
|
+
"gpt-6-luna-pro",
|
|
118
|
+
"gpt-6-sol",
|
|
119
|
+
"gpt-6-sol-pro",
|
|
120
|
+
"gpt-6-astra",
|
|
121
|
+
"gpt-6-astra-pro",
|
|
102
122
|
// GPT-4.1 / 4o generation.
|
|
103
123
|
"gpt-4.1",
|
|
104
124
|
"gpt-4.1-mini",
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AA0BO,IAAM,QAAwB,cAAA,CAAe;AAAA,EAClD,IAAA,EAAM,OAAA;AAAA,EACN,EAAA,EAAI,OAAA;AAAA,EACJ,WAAA,EACE,oQAAA;AAAA,EACF,OAAA,EAAS,OAAA;AAAA,EACT,GAAA,EAAK,KAAA;AAAA;AAAA;AAAA;AAAA,EAIL,QAAA,EAAU,CAAC,IAAA,EAAM,uCAAuC,CAAA;AAAA,EACxD,OAAA,EAAS;AAAA,IACP;AAAA,MACE,MAAA,EAAQ,KAAA;AAAA,MACR,OAAA,EAAS,uCAAA;AAAA,MACT,MAAA,EAAQ;AAAA;AACV,GACF;AAAA,EACA,aAAA,EAAe;AAAA;AAAA;AAAA,IAGb,GAAA,EAAK,oDAAA;AAAA,IACL,KAAA,EAAO,sBAAA;AAAA,IACP,KAAA,EAAO,SAAA;AAAA,IACP,UAAA,EAAY;AAAA,GACd;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,GAAA,EAAK,cAAA;AAAA,IACL,OAAO,EAAE,GAAA,EAAK,CAAC,gBAAA,EAAkB,eAAe,CAAA;AAAE,GACpD;AAAA;AAAA;AAAA;AAAA,EAIA,QAAA,EAAU,QAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBV,gBAAA,EAAkB;AAAA,IAChB,QAAA,EAAU,IAAA;AAAA,IACV,WAAA,EAAa,CAAC,eAAe;AAAA,GAC/B;AAAA,EACA,OAAA,EAAS,cAAA;AAAA,EACT,QAAA,EAAU,KAAA;AAAA,EACV,GAAA,EAAK,oBAAA;AAAA,EACL,OAAA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AA,IACX,aAAA,EAAe;AAAA,GACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAA,EAAS;AAAA,IACP;AAAA,MACE,EAAA,EAAI,OAAA;AAAA,MACJ,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EACE;AAAA;AACJ,GACF;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,OAAA,EAAS,eAAA;AAAA,IACT,SAAA,EAAW,CAAC,eAAA,EAAiB,gBAAA,EAAkB,cAAc,MAAM,CAAA;AAAA,IACnE,cAAA,EAAgB;AAAA,MACd,eAAA,EAAiB,IAAA;AAAA,MACjB,SAAA,EAAW,CAAC,cAAA,EAAgB,UAAU;AAAA;AACxC,GACF;AAAA,EACA,MAAM,CAAC,OAAA,EAAS,QAAA,EAAU,KAAA,EAAO,iBAAiB,QAAQ;AAC5D,CAAC;AAEM,SAAS,YAAA,GAAgC;AAC9C,EAAA,OAAO,sBAAsB,KAAK,CAAA;AACpC","file":"index.mjs","sourcesContent":["/**\n * @agentproto/adapter-codex — AIP-45 adapter for OpenAI Codex via the\n * maintained ACP wrapper @agentclientprotocol/codex-acp.\n *\n * The wrapper bundles its own Codex runtime (Rust binary delivered via\n * npm dependency) so a single\n * `npx -y @agentclientprotocol/codex-acp@1.10.0`\n * invocation is enough — no separate @openai/codex install needed.\n *\n * import { codex, codexRuntime } from \"@agentproto/adapter-codex\"\n * const session = await codexRuntime().start({\n * env: { OPENAI_API_KEY: \"sk-...\" },\n * })\n * for await (const evt of session.send({ role: \"user\", content: \"...\" })) {\n * console.log(evt)\n * }\n * await session.close()\n */\n\nimport {\n createAgentCliRuntime,\n defineAgentCli,\n type AgentCliHandle,\n type AgentCliRuntime,\n} from \"@agentproto/driver-agent-cli\"\n\nexport const codex: AgentCliHandle = defineAgentCli({\n name: \"codex\",\n id: \"codex\",\n description:\n \"OpenAI's Codex coding agent wrapped as an ACP server by @agentclientprotocol/codex-acp. Spawned via a version-pinned npx package and driven over stdio JSON-RPC. The wrapper bundles a compatible Codex runtime — no separate @openai/codex install required.\",\n version: \"0.1.0\",\n bin: \"npx\",\n // Keep spawn deterministic. An unversioned npx target performs registry\n // resolution at session startup and can silently replace both the bridge\n // and its bundled Codex runtime exactly when either publishes an update.\n bin_args: [\"-y\", \"@agentclientprotocol/codex-acp@1.10.0\"],\n install: [\n {\n method: \"npm\",\n package: \"@agentclientprotocol/codex-acp@1.10.0\",\n global: true,\n },\n ],\n version_check: {\n // PRESENCE probe — local (global npm tree), not a registry query. See\n // claude-code's version_check note for the npm-view trap this replaces.\n cmd: \"npm ls -g @agentclientprotocol/codex-acp --depth=0\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \"=1.10.0\",\n timeout_ms: 15_000,\n },\n auth: {\n ref: \"./SECRETS.md\",\n state: { env: [\"OPENAI_API_KEY\", \"CODEX_API_KEY\"] },\n },\n // Billing-auth (opt-in — no authEnforce, so unconfigured spawns stay\n // ambient). Single-provider adapter: api-key mode SETS providerEnvVar\n // (\"openai\") = OPENAI_API_KEY, derived from the catalog.\n provider: \"openai\",\n // \"Use my existing Codex login\" — a FILE-BASED (external) subscription. The\n // Codex CLI's ChatGPT/subscription login lives in `~/.codex/auth.json`\n // (`tokens.access_token`), which the bundled codex runtime reads ITSELF; it\n // has no env-bearer channel like claude-code's CLAUDE_CODE_OAUTH_TOKEN. So\n // `external: true`: subscription mode injects NOTHING (no setEnv) — the host\n // verifies the login is present (fail-loud, via the `codex` provision recipe)\n // and the driver only SCRUBS the api-key vars so a leftover OPENAI_API_KEY /\n // CODEX_API_KEY can't silently flip the spawn to per-token API billing under\n // a \"subscription\" label. OPENAI_API_KEY is scrubbed automatically (it's the\n // provider's api-key var); CODEX_API_KEY is the sibling the codex runtime\n // also honors, so it's listed as a conflictEnv. Money-safe by construction:\n // no OAuth bearer is ever written into an api-key env var, because no bearer\n // is injected at all. An unconfigured codex spawn stays ambient — codex uses\n // its own auth.json precedence (a ChatGPT login already outranks an ambient\n // OPENAI_API_KEY), so this only ADDS an explicit, verified, billing-guaranteed\n // opt-in on top of that.\n authSubscription: {\n external: true,\n conflictEnv: [\"CODEX_API_KEY\"],\n },\n sandbox: \"./SANDBOX.md\",\n protocol: \"acp\",\n acp: \"./codex-acp.ACP.md\",\n session: {\n mode: \"persistent\",\n idle_timeout_ms: 1_800_000,\n context_carryover: true,\n },\n models: {\n // Do not declare a fixed default: a ChatGPT subscription exposes valid\n // models dynamically, and forcing a historic ID can make a session fail.\n // Keep this curated menu for catalog consumers and compatibility with the\n // existing CLI discovery contract. It is not a default or an allow-list:\n // explicit model IDs are still validated dynamically by Codex.\n allowed: [\n // Codex-specialized (coding) models.\n \"gpt-5-codex\",\n \"gpt-5.1-codex\",\n \"gpt-5.1-codex-mini\",\n \"gpt-5.1-codex-max\",\n \"gpt-5.2-codex\",\n // GPT-5 generalist family.\n \"gpt-5\",\n \"gpt-5-mini\",\n \"gpt-5-nano\",\n \"gpt-5-pro\",\n \"gpt-5.1\",\n \"gpt-5.2\",\n \"gpt-5.4\",\n \"gpt-5.4-mini\",\n \"gpt-5.4-nano\",\n \"gpt-5.4-pro\",\n \"gpt-5.5\",\n \"gpt-5.5-pro\",\n // GPT-5.6 family.\n \"gpt-5.6-luna\",\n \"gpt-5.6-luna-pro\",\n \"gpt-5.6-sol\",\n \"gpt-5.6-sol-pro\",\n \"gpt-5.6-terra\",\n \"gpt-5.6-terra-pro\",\n // GPT-4.1 / 4o generation.\n \"gpt-4.1\",\n \"gpt-4.1-mini\",\n \"gpt-4.1-nano\",\n \"gpt-4o\",\n \"gpt-4o-mini\",\n // o-series reasoning models.\n \"o3\",\n \"o3-pro\",\n \"o3-mini\",\n \"o3-deep-research\",\n \"o4-mini\",\n \"o4-mini-high\",\n \"o4-mini-deep-research\",\n \"o1\",\n \"o1-mini\",\n \"o1-pro\",\n ],\n env: { openai: \"OPENAI_API_KEY\", codex: \"CODEX_API_KEY\" },\n // The maintained ACP bridge exposes `session/set_config_option`, so the\n // model is selected after session creation rather than through argv.\n apply: \"config\",\n },\n capabilities: {\n streaming: true,\n tool_calls: true,\n sub_agents: false,\n file_io: true,\n // The maintained wrapper forwards ACP image content blocks to Codex which\n // runs them through the underlying GPT-5 vision pipeline.\n multimodal: true,\n // codex-acp implements full ACP session lifecycle (newSession /\n // loadSession / resumeSession). Pair with the `native-resume`\n // continuation strategy for cold-start reattach.\n resumable: true,\n bidirectional: true,\n },\n // No manifest `modes[]`: codex's operation profiles (default / read-only /\n // full-access) are POSTURE, which no longer lives in the manifest (SPEC\n // §3.4a) — it is sourced from the harness's own ACP mode registry\n // (`SessionModeState.availableModes`) plus the daemon's canonical-posture\n // layer. codex has no context (`kind:\"context\"`) mode to declare, and route\n // comes from the model catalog, so the array would be empty — omit it.\n options: [\n {\n id: \"model\",\n type: \"string\",\n description:\n \"Optional Codex model ID. Omit it to use the model selected by the current ChatGPT or API-key account; the ACP bridge validates explicit IDs against that account.\",\n },\n ],\n continuation: {\n default: \"native-resume\",\n supported: [\"native-resume\", \"pinned-session\", \"transcript\", \"none\"],\n pinned_session: {\n idle_timeout_ms: 1_800_000,\n key_scope: [\"conversation\", \"operator\"],\n },\n },\n tags: [\"codex\", \"openai\", \"acp\", \"agent-runtime\", \"coding\"],\n})\n\nexport function codexRuntime(): AgentCliRuntime {\n return createAgentCliRuntime(codex)\n}\n\nexport type { AgentCliHandle, AgentCliRuntime }\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AA0BO,IAAM,QAAwB,cAAA,CAAe;AAAA,EAClD,IAAA,EAAM,OAAA;AAAA,EACN,EAAA,EAAI,OAAA;AAAA,EACJ,WAAA,EACE,oQAAA;AAAA,EACF,OAAA,EAAS,OAAA;AAAA,EACT,GAAA,EAAK,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASL,QAAA,EAAU,CAAC,IAAA,EAAM,uCAAuC,CAAA;AAAA,EACxD,OAAA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cAAc,MAAM,CAAA;AAAA,IACnE,cAAA,EAAgB;AAAA,MACd,eAAA,EAAiB,IAAA;AAAA,MACjB,SAAA,EAAW,CAAC,cAAA,EAAgB,UAAU;AAAA;AACxC,GACF;AAAA,EACA,MAAM,CAAC,OAAA,EAAS,QAAA,EAAU,KAAA,EAAO,iBAAiB,QAAQ;AAC5D,CAAC;AAEM,SAAS,YAAA,GAAgC;AAC9C,EAAA,OAAO,sBAAsB,KAAK,CAAA;AACpC","file":"index.mjs","sourcesContent":["/**\n * @agentproto/adapter-codex — AIP-45 adapter for OpenAI Codex via the\n * maintained ACP wrapper @agentclientprotocol/codex-acp.\n *\n * The wrapper bundles its own Codex runtime (Rust binary delivered via\n * npm dependency) so a single\n * `npx -y @agentclientprotocol/codex-acp@1.13.1`\n * invocation is enough — no separate @openai/codex install needed.\n *\n * import { codex, codexRuntime } from \"@agentproto/adapter-codex\"\n * const session = await codexRuntime().start({\n * env: { OPENAI_API_KEY: \"sk-...\" },\n * })\n * for await (const evt of session.send({ role: \"user\", content: \"...\" })) {\n * console.log(evt)\n * }\n * await session.close()\n */\n\nimport {\n createAgentCliRuntime,\n defineAgentCli,\n type AgentCliHandle,\n type AgentCliRuntime,\n} from \"@agentproto/driver-agent-cli\"\n\nexport const codex: AgentCliHandle = defineAgentCli({\n name: \"codex\",\n id: \"codex\",\n description:\n \"OpenAI's Codex coding agent wrapped as an ACP server by @agentclientprotocol/codex-acp. Spawned via a version-pinned npx package and driven over stdio JSON-RPC. The wrapper bundles a compatible Codex runtime — no separate @openai/codex install required.\",\n version: \"0.1.0\",\n bin: \"npx\",\n // Keep spawn deterministic. An unversioned npx target performs registry\n // resolution at session startup and can silently replace both the bridge\n // and its bundled Codex runtime exactly when either publishes an update.\n // 1.13.1 bundles @openai/codex 0.156.1 (1.10.0 shipped 0.153.3). Nothing\n // between 1.10.0 and 1.13.1 is flagged breaking: ACP protocolVersion stays\n // 1, `session/new` and `session/set_config_option` are unchanged, and the\n // additions (recommended model/effort, tool names on tool calls,\n // experimental compaction updates and session notices) are opt-in extras.\n bin_args: [\"-y\", \"@agentclientprotocol/codex-acp@1.13.1\"],\n install: [\n {\n method: \"npm\",\n package: \"@agentclientprotocol/codex-acp@1.13.1\",\n global: true,\n },\n ],\n version_check: {\n // PRESENCE probe — local (global npm tree), not a registry query. See\n // claude-code's version_check note for the npm-view trap this replaces.\n cmd: \"npm ls -g @agentclientprotocol/codex-acp --depth=0\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \"=1.13.1\",\n timeout_ms: 15_000,\n },\n auth: {\n ref: \"./SECRETS.md\",\n state: { env: [\"OPENAI_API_KEY\", \"CODEX_API_KEY\"] },\n },\n // Billing-auth (opt-in — no authEnforce, so unconfigured spawns stay\n // ambient). Single-provider adapter: api-key mode SETS providerEnvVar\n // (\"openai\") = OPENAI_API_KEY, derived from the catalog.\n provider: \"openai\",\n // \"Use my existing Codex login\" — a FILE-BASED (external) subscription. The\n // Codex CLI's ChatGPT/subscription login lives in `~/.codex/auth.json`\n // (`tokens.access_token`), which the bundled codex runtime reads ITSELF; it\n // has no env-bearer channel like claude-code's CLAUDE_CODE_OAUTH_TOKEN. So\n // `external: true`: subscription mode injects NOTHING (no setEnv) — the host\n // verifies the login is present (fail-loud, via the `codex` provision recipe)\n // and the driver only SCRUBS the api-key vars so a leftover OPENAI_API_KEY /\n // CODEX_API_KEY can't silently flip the spawn to per-token API billing under\n // a \"subscription\" label. OPENAI_API_KEY is scrubbed automatically (it's the\n // provider's api-key var); CODEX_API_KEY is the sibling the codex runtime\n // also honors, so it's listed as a conflictEnv. Money-safe by construction:\n // no OAuth bearer is ever written into an api-key env var, because no bearer\n // is injected at all. An unconfigured codex spawn stays ambient — codex uses\n // its own auth.json precedence (a ChatGPT login already outranks an ambient\n // OPENAI_API_KEY), so this only ADDS an explicit, verified, billing-guaranteed\n // opt-in on top of that.\n authSubscription: {\n external: true,\n conflictEnv: [\"CODEX_API_KEY\"],\n },\n sandbox: \"./SANDBOX.md\",\n protocol: \"acp\",\n acp: \"./codex-acp.ACP.md\",\n session: {\n mode: \"persistent\",\n idle_timeout_ms: 1_800_000,\n context_carryover: true,\n },\n models: {\n // Do not declare a fixed default: a ChatGPT subscription exposes valid\n // models dynamically, and forcing a historic ID can make a session fail.\n // Keep this curated menu for catalog consumers and compatibility with the\n // existing CLI discovery contract. It is not a default or an allow-list:\n // explicit model IDs are still validated dynamically by Codex.\n allowed: [\n // Codex-specialized (coding) models.\n \"gpt-5-codex\",\n \"gpt-5.1-codex\",\n \"gpt-5.1-codex-mini\",\n \"gpt-5.1-codex-max\",\n \"gpt-5.2-codex\",\n // GPT-5 generalist family.\n \"gpt-5\",\n \"gpt-5-mini\",\n \"gpt-5-nano\",\n \"gpt-5-pro\",\n \"gpt-5.1\",\n \"gpt-5.2\",\n \"gpt-5.4\",\n \"gpt-5.4-mini\",\n \"gpt-5.4-nano\",\n \"gpt-5.4-pro\",\n \"gpt-5.5\",\n \"gpt-5.5-pro\",\n // GPT-5.6 family.\n \"gpt-5.6-luna\",\n \"gpt-5.6-luna-pro\",\n \"gpt-5.6-sol\",\n \"gpt-5.6-sol-pro\",\n \"gpt-5.6-terra\",\n \"gpt-5.6-terra-pro\",\n // GPT-6 family. Exactly the six ids that exist upstream — taken from\n // the catalog's own synced OpenAI list (`openai-pricing.generated.ts`,\n // OpenRouter passthrough) and cross-checked against the opencode-zen\n // snapshot, which carries gpt-6-astra/luna/sol. Deliberately NOT a\n // symmetric fill of the 5.6 shape: there is no `gpt-6-terra`, and no\n // `gpt-6-codex` — inventing either would put an id in the menu that\n // the bridge would reject on selection. The `:batch` variants the\n // catalog also carries are omitted on purpose; batch is an offline\n // job surface, not something an interactive ACP session selects.\n \"gpt-6-luna\",\n \"gpt-6-luna-pro\",\n \"gpt-6-sol\",\n \"gpt-6-sol-pro\",\n \"gpt-6-astra\",\n \"gpt-6-astra-pro\",\n // GPT-4.1 / 4o generation.\n \"gpt-4.1\",\n \"gpt-4.1-mini\",\n \"gpt-4.1-nano\",\n \"gpt-4o\",\n \"gpt-4o-mini\",\n // o-series reasoning models.\n \"o3\",\n \"o3-pro\",\n \"o3-mini\",\n \"o3-deep-research\",\n \"o4-mini\",\n \"o4-mini-high\",\n \"o4-mini-deep-research\",\n \"o1\",\n \"o1-mini\",\n \"o1-pro\",\n ],\n env: { openai: \"OPENAI_API_KEY\", codex: \"CODEX_API_KEY\" },\n // The maintained ACP bridge exposes `session/set_config_option`, so the\n // model is selected after session creation rather than through argv.\n apply: \"config\",\n },\n capabilities: {\n streaming: true,\n tool_calls: true,\n sub_agents: false,\n file_io: true,\n // The maintained wrapper forwards ACP image content blocks to Codex which\n // runs them through the underlying GPT-5 vision pipeline.\n multimodal: true,\n // codex-acp implements full ACP session lifecycle (newSession /\n // loadSession / resumeSession). Pair with the `native-resume`\n // continuation strategy for cold-start reattach.\n resumable: true,\n bidirectional: true,\n },\n // No manifest `modes[]`: codex's operation profiles (default / read-only /\n // full-access) are POSTURE, which no longer lives in the manifest (SPEC\n // §3.4a) — it is sourced from the harness's own ACP mode registry\n // (`SessionModeState.availableModes`) plus the daemon's canonical-posture\n // layer. codex has no context (`kind:\"context\"`) mode to declare, and route\n // comes from the model catalog, so the array would be empty — omit it.\n options: [\n {\n id: \"model\",\n type: \"string\",\n description:\n \"Optional Codex model ID. Omit it to use the model selected by the current ChatGPT or API-key account; the ACP bridge validates explicit IDs against that account.\",\n },\n ],\n continuation: {\n default: \"native-resume\",\n supported: [\"native-resume\", \"pinned-session\", \"transcript\", \"none\"],\n pinned_session: {\n idle_timeout_ms: 1_800_000,\n key_scope: [\"conversation\", \"operator\"],\n },\n },\n tags: [\"codex\", \"openai\", \"acp\", \"agent-runtime\", \"coding\"],\n})\n\nexport function codexRuntime(): AgentCliRuntime {\n return createAgentCliRuntime(codex)\n}\n\nexport type { AgentCliHandle, AgentCliRuntime }\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentproto/adapter-codex",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "@agentproto/adapter-codex — AIP-45 AGENT-CLI adapter for OpenAI's Codex CLI via @agentclientprotocol/codex-acp. Spawns the ACP wrapper over stdio JSON-RPC.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentproto",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@agentproto/driver-agent-cli": "2.
|
|
44
|
+
"@agentproto/driver-agent-cli": "2.5.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^25.9.5",
|