@agentproto/adapter-codex 1.0.1 → 2.0.1

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 CHANGED
@@ -1,18 +1,18 @@
1
1
  ---
2
2
  name: codex
3
3
  id: codex
4
- description: OpenAI's Codex coding agent wrapped as an ACP server by Zed's @zed-industries/codex-acp. Spawned via `npx -y @zed-industries/codex-acp` and driven over stdio JSON-RPC. The wrapper bundles its own Codex runtime — no separate @openai/codex install required.
4
+ description: OpenAI's Codex coding agent wrapped as an ACP server by @agentclientprotocol/codex-acp. Spawned via `npx -y @agentclientprotocol/codex-acp` 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", "@zed-industries/codex-acp"]
7
+ bin_args: ["-y", "@agentclientprotocol/codex-acp"]
8
8
  install:
9
9
  - method: npm
10
- package: "@zed-industries/codex-acp"
10
+ package: "@agentclientprotocol/codex-acp"
11
11
  global: true
12
12
  version_check:
13
- cmd: npm view @zed-industries/codex-acp version
13
+ cmd: npm view @agentclientprotocol/codex-acp version
14
14
  parse: "(\\d+\\.\\d+\\.\\d+)"
15
- range: ">=0.14.0"
15
+ range: ">=1.1.7"
16
16
  timeout_ms: 15000
17
17
  auth:
18
18
  ref: ./SECRETS.md
@@ -49,11 +49,10 @@ tags: ["codex", "openai", "acp", "agent-runtime", "coding"]
49
49
  # Codex adapter
50
50
 
51
51
  `@agentproto/adapter-codex` wraps OpenAI's Codex coding agent as an
52
- AIP-45 agent CLI by spawning **`@zed-industries/codex-acp`** — a
53
- Rust-based ACP wrapper published by Zed Industries that bundles its
54
- own Codex runtime.
52
+ AIP-45 agent CLI by spawning **`@agentclientprotocol/codex-acp`** — the
53
+ maintained ACP bridge, which bundles a compatible Codex runtime.
55
54
 
56
- ## Why the Zed wrapper
55
+ ## Why this wrapper
57
56
 
58
57
  OpenAI's `@openai/codex` CLI does not expose an ACP mode. The Zed
59
58
  wrapper provides a stable stdio JSON-RPC bridge with full ACP session
@@ -65,10 +64,10 @@ full-access session modes.
65
64
 
66
65
  ```bash
67
66
  # npm (global) — recommended for fast spawn
68
- npm install -g @zed-industries/codex-acp
67
+ npm install -g @agentclientprotocol/codex-acp
69
68
 
70
69
  # or rely on the npx form (no manual install)
71
- npx -y @zed-industries/codex-acp
70
+ npx -y @agentclientprotocol/codex-acp
72
71
  ```
73
72
 
74
73
  The wrapper ships platform-specific native binaries via npm optional
package/dist/index.d.ts CHANGED
@@ -3,10 +3,10 @@ export { AgentCliHandle, AgentCliRuntime } from '@agentproto/driver-agent-cli';
3
3
 
4
4
  /**
5
5
  * @agentproto/adapter-codex — AIP-45 adapter for OpenAI Codex via the
6
- * Zed-published ACP wrapper @zed-industries/codex-acp.
6
+ * maintained ACP wrapper @agentclientprotocol/codex-acp.
7
7
  *
8
8
  * The wrapper bundles its own Codex runtime (Rust binary delivered via
9
- * npm optional deps) so a single `npx -y @zed-industries/codex-acp`
9
+ * npm dependency) so a single `npx -y @agentclientprotocol/codex-acp`
10
10
  * invocation is enough — no separate @openai/codex install needed.
11
11
  *
12
12
  * import { codex, codexRuntime } from "@agentproto/adapter-codex"
package/dist/index.mjs CHANGED
@@ -2,27 +2,27 @@ import { defineAgentCli, createAgentCliRuntime } from '@agentproto/driver-agent-
2
2
 
3
3
  /**
4
4
  * @agentproto/adapter-codex v0.1.0-alpha
5
- * AIP-45 adapter for OpenAI Codex via @zed-industries/codex-acp.
5
+ * AIP-45 adapter for OpenAI Codex via @agentclientprotocol/codex-acp.
6
6
  */
7
7
 
8
8
  var codex = defineAgentCli({
9
9
  name: "codex",
10
10
  id: "codex",
11
- description: "OpenAI's Codex coding agent wrapped as an ACP server by Zed's @zed-industries/codex-acp. Spawned via `npx -y @zed-industries/codex-acp` and driven over stdio JSON-RPC. The wrapper bundles its own Codex runtime \u2014 no separate @openai/codex install required.",
11
+ description: "OpenAI's Codex coding agent wrapped as an ACP server by @agentclientprotocol/codex-acp. Spawned via `npx -y @agentclientprotocol/codex-acp` and driven over stdio JSON-RPC. The wrapper bundles a compatible Codex runtime \u2014 no separate @openai/codex install required.",
12
12
  version: "0.1.0",
13
13
  bin: "npx",
14
- bin_args: ["-y", "@zed-industries/codex-acp"],
14
+ bin_args: ["-y", "@agentclientprotocol/codex-acp"],
15
15
  install: [
16
16
  {
17
17
  method: "npm",
18
- package: "@zed-industries/codex-acp",
18
+ package: "@agentclientprotocol/codex-acp",
19
19
  global: true
20
20
  }
21
21
  ],
22
22
  version_check: {
23
- cmd: "npm view @zed-industries/codex-acp version",
23
+ cmd: "npm view @agentclientprotocol/codex-acp version",
24
24
  parse: "(\\d+\\.\\d+\\.\\d+)",
25
- range: ">=0.14.0",
25
+ range: ">=1.1.7",
26
26
  timeout_ms: 15e3
27
27
  },
28
28
  auth: {
@@ -31,9 +31,28 @@ var codex = defineAgentCli({
31
31
  },
32
32
  // Billing-auth (opt-in — no authEnforce, so unconfigured spawns stay
33
33
  // ambient). Single-provider adapter: api-key mode SETS providerEnvVar
34
- // ("openai") = OPENAI_API_KEY, derived from the catalog. No authSubscription
35
- // ⇒ a `subscription` request fails loud with `unsupported_auth_mode`.
34
+ // ("openai") = OPENAI_API_KEY, derived from the catalog.
36
35
  provider: "openai",
36
+ // "Use my existing Codex login" — a FILE-BASED (external) subscription. The
37
+ // Codex CLI's ChatGPT/subscription login lives in `~/.codex/auth.json`
38
+ // (`tokens.access_token`), which the bundled codex runtime reads ITSELF; it
39
+ // has no env-bearer channel like claude-code's CLAUDE_CODE_OAUTH_TOKEN. So
40
+ // `external: true`: subscription mode injects NOTHING (no setEnv) — the host
41
+ // verifies the login is present (fail-loud, via the `codex` provision recipe)
42
+ // and the driver only SCRUBS the api-key vars so a leftover OPENAI_API_KEY /
43
+ // CODEX_API_KEY can't silently flip the spawn to per-token API billing under
44
+ // a "subscription" label. OPENAI_API_KEY is scrubbed automatically (it's the
45
+ // provider's api-key var); CODEX_API_KEY is the sibling the codex runtime
46
+ // also honors, so it's listed as a conflictEnv. Money-safe by construction:
47
+ // no OAuth bearer is ever written into an api-key env var, because no bearer
48
+ // is injected at all. An unconfigured codex spawn stays ambient — codex uses
49
+ // its own auth.json precedence (a ChatGPT login already outranks an ambient
50
+ // OPENAI_API_KEY), so this only ADDS an explicit, verified, billing-guaranteed
51
+ // opt-in on top of that.
52
+ authSubscription: {
53
+ external: true,
54
+ conflictEnv: ["CODEX_API_KEY"]
55
+ },
37
56
  sandbox: "./SANDBOX.md",
38
57
  protocol: "acp",
39
58
  acp: "./codex-acp.ACP.md",
@@ -43,23 +62,32 @@ var codex = defineAgentCli({
43
62
  context_carryover: true
44
63
  },
45
64
  models: {
46
- default: "gpt-5-codex",
47
- allowed: ["gpt-5-codex", "gpt-5", "gpt-5-mini", "gpt-5-pro"],
65
+ // Do not declare a fixed default: a ChatGPT subscription exposes valid
66
+ // models dynamically, and forcing a historic ID can make a session fail.
67
+ // Keep this curated menu for catalog consumers and compatibility with the
68
+ // existing CLI discovery contract. It is not a default or an allow-list:
69
+ // explicit model IDs are still validated dynamically by Codex.
70
+ allowed: [
71
+ "gpt-5-codex",
72
+ "gpt-5.1-codex",
73
+ "gpt-5.1-codex-mini",
74
+ "gpt-5.1-codex-max",
75
+ "gpt-5.2-codex",
76
+ "gpt-5",
77
+ "gpt-5-mini",
78
+ "gpt-5-pro"
79
+ ],
48
80
  env: { openai: "OPENAI_API_KEY", codex: "CODEX_API_KEY" },
49
- // codex-acp takes its model as a CLI config override, not an ACP
50
- // session config `codex-acp --help` documents `-c model="o3"`.
51
- // There is no `session/set_config_option` capability to fire at all
52
- // (confirmed against v0.16.0's `initialize` response); the model must
53
- // be composed into argv at spawn time instead.
54
- apply: "arg",
55
- bin_args_template: ["-c", 'model="{model}"']
81
+ // The maintained ACP bridge exposes `session/set_config_option`, so the
82
+ // model is selected after session creation rather than through argv.
83
+ apply: "config"
56
84
  },
57
85
  capabilities: {
58
86
  streaming: true,
59
87
  tool_calls: true,
60
88
  sub_agents: false,
61
89
  file_io: true,
62
- // The Zed wrapper forwards ACP image content blocks to Codex which
90
+ // The maintained wrapper forwards ACP image content blocks to Codex which
63
91
  // runs them through the underlying GPT-5 vision pipeline.
64
92
  multimodal: true,
65
93
  // codex-acp implements full ACP session lifecycle (newSession /
@@ -77,15 +105,8 @@ var codex = defineAgentCli({
77
105
  options: [
78
106
  {
79
107
  id: "model",
80
- type: "enum",
81
- enum: ["gpt-5-codex", "gpt-5", "gpt-5-mini", "gpt-5-pro"],
82
- description: "Override the default model for this operator binding."
83
- // No bin_args_template here — codex-acp doesn't accept a bare
84
- // `--model` flag (`error: unexpected argument '--model' found`,
85
- // confirmed against v0.16.0; it crashes the process before the ACP
86
- // handshake even starts). This option exists only so
87
- // `config.options.model` validates; the real composition happens
88
- // via `models.apply: "arg"` above.
108
+ type: "string",
109
+ description: "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."
89
110
  }
90
111
  ],
91
112
  continuation: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AAyBO,IAAM,QAAwB,cAAA,CAAe;AAAA,EAClD,IAAA,EAAM,OAAA;AAAA,EACN,EAAA,EAAI,OAAA;AAAA,EACJ,WAAA,EACE,sQAAA;AAAA,EACF,OAAA,EAAS,OAAA;AAAA,EACT,GAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAU,CAAC,IAAA,EAAM,2BAA2B,CAAA;AAAA,EAC5C,OAAA,EAAS;AAAA,IACP;AAAA,MACE,MAAA,EAAQ,KAAA;AAAA,MACR,OAAA,EAAS,2BAAA;AAAA,MACT,MAAA,EAAQ;AAAA;AACV,GACF;AAAA,EACA,aAAA,EAAe;AAAA,IACb,GAAA,EAAK,4CAAA;AAAA,IACL,KAAA,EAAO,sBAAA;AAAA,IACP,KAAA,EAAO,UAAA;AAAA,IACP,UAAA,EAAY;AAAA,GACd;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A;AAAA;AAAA;AAAA;AAAA;AAOf,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 * Zed-published ACP wrapper @zed-industries/codex-acp.\n *\n * The wrapper bundles its own Codex runtime (Rust binary delivered via\n * npm optional deps) so a single `npx -y @zed-industries/codex-acp`\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 Zed's @zed-industries/codex-acp. Spawned via `npx -y @zed-industries/codex-acp` and driven over stdio JSON-RPC. The wrapper bundles its own Codex runtime — no separate @openai/codex install required.\",\n version: \"0.1.0\",\n bin: \"npx\",\n bin_args: [\"-y\", \"@zed-industries/codex-acp\"],\n install: [\n {\n method: \"npm\",\n package: \"@zed-industries/codex-acp\",\n global: true,\n },\n ],\n version_check: {\n cmd: \"npm view @zed-industries/codex-acp version\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \">=0.14.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. No authSubscription\n // a `subscription` request fails loud with `unsupported_auth_mode`.\n provider: \"openai\",\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 default: \"gpt-5-codex\",\n allowed: [\"gpt-5-codex\", \"gpt-5\", \"gpt-5-mini\", \"gpt-5-pro\"],\n env: { openai: \"OPENAI_API_KEY\", codex: \"CODEX_API_KEY\" },\n // codex-acp takes its model as a CLI config override, not an ACP\n // session config `codex-acp --help` documents `-c model=\"o3\"`.\n // There is no `session/set_config_option` capability to fire at all\n // (confirmed against v0.16.0's `initialize` response); the model must\n // be composed into argv at spawn time instead.\n apply: \"arg\",\n bin_args_template: [\"-c\", 'model=\"{model}\"'],\n },\n capabilities: {\n streaming: true,\n tool_calls: true,\n sub_agents: false,\n file_io: true,\n // The Zed 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: \"enum\",\n enum: [\"gpt-5-codex\", \"gpt-5\", \"gpt-5-mini\", \"gpt-5-pro\"],\n description: \"Override the default model for this operator binding.\",\n // No bin_args_template here — codex-acp doesn't accept a bare\n // `--model` flag (`error: unexpected argument '--model' found`,\n // confirmed against v0.16.0; it crashes the process before the ACP\n // handshake even starts). This option exists only so\n // `config.options.model` validates; the real composition happens\n // via `models.apply: \"arg\"` above.\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":";;;;;;;AAyBO,IAAM,QAAwB,cAAA,CAAe;AAAA,EAClD,IAAA,EAAM,OAAA;AAAA,EACN,EAAA,EAAI,OAAA;AAAA,EACJ,WAAA,EACE,+QAAA;AAAA,EACF,OAAA,EAAS,OAAA;AAAA,EACT,GAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAU,CAAC,IAAA,EAAM,gCAAgC,CAAA;AAAA,EACjD,OAAA,EAAS;AAAA,IACP;AAAA,MACE,MAAA,EAAQ,KAAA;AAAA,MACR,OAAA,EAAS,gCAAA;AAAA,MACT,MAAA,EAAQ;AAAA;AACV,GACF;AAAA,EACA,aAAA,EAAe;AAAA,IACb,GAAA,EAAK,iDAAA;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,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,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 `npx -y @agentclientprotocol/codex-acp`\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 `npx -y @agentclientprotocol/codex-acp` 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 bin_args: [\"-y\", \"@agentclientprotocol/codex-acp\"],\n install: [\n {\n method: \"npm\",\n package: \"@agentclientprotocol/codex-acp\",\n global: true,\n },\n ],\n version_check: {\n cmd: \"npm view @agentclientprotocol/codex-acp version\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \">=1.1.7\",\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 \"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\",\n \"gpt-5-mini\",\n \"gpt-5-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,7 +1,7 @@
1
1
  {
2
2
  "name": "@agentproto/adapter-codex",
3
- "version": "1.0.1",
4
- "description": "@agentproto/adapter-codex — AIP-45 AGENT-CLI adapter for OpenAI's Codex CLI via @zed-industries/codex-acp. Spawns the ACP wrapper over stdio JSON-RPC.",
3
+ "version": "2.0.1",
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",
7
7
  "aip-45",
@@ -41,7 +41,7 @@
41
41
  "access": "public"
42
42
  },
43
43
  "dependencies": {
44
- "@agentproto/driver-agent-cli": "2.0.1"
44
+ "@agentproto/driver-agent-cli": "2.2.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/node": "^25.6.2",