@penclipai/adapter-codex-local 2026.704.0 → 2026.714.0

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.
Files changed (69) hide show
  1. package/dist/cli/format-event.d.ts.map +1 -1
  2. package/dist/cli/format-event.js +5 -0
  3. package/dist/cli/format-event.js.map +1 -1
  4. package/dist/index.d.ts +3 -3
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +17 -7
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.test.js +12 -4
  9. package/dist/index.test.js.map +1 -1
  10. package/dist/server/acp.d.ts +31 -0
  11. package/dist/server/acp.d.ts.map +1 -0
  12. package/dist/server/acp.js +361 -0
  13. package/dist/server/acp.js.map +1 -0
  14. package/dist/server/acp.test.d.ts +2 -0
  15. package/dist/server/acp.test.d.ts.map +1 -0
  16. package/dist/server/acp.test.js +428 -0
  17. package/dist/server/acp.test.js.map +1 -0
  18. package/dist/server/codex-args.test.js +16 -1
  19. package/dist/server/codex-args.test.js.map +1 -1
  20. package/dist/server/codex-home.d.ts +35 -0
  21. package/dist/server/codex-home.d.ts.map +1 -1
  22. package/dist/server/codex-home.js +41 -0
  23. package/dist/server/codex-home.js.map +1 -1
  24. package/dist/server/codex-home.test.js +118 -1
  25. package/dist/server/codex-home.test.js.map +1 -1
  26. package/dist/server/config-schema.d.ts +3 -0
  27. package/dist/server/config-schema.d.ts.map +1 -0
  28. package/dist/server/config-schema.js +67 -0
  29. package/dist/server/config-schema.js.map +1 -0
  30. package/dist/server/execute.acp-fallback.test.d.ts +2 -0
  31. package/dist/server/execute.acp-fallback.test.d.ts.map +1 -0
  32. package/dist/server/execute.acp-fallback.test.js +126 -0
  33. package/dist/server/execute.acp-fallback.test.js.map +1 -0
  34. package/dist/server/execute.auth.test.js +2 -1
  35. package/dist/server/execute.auth.test.js.map +1 -1
  36. package/dist/server/execute.d.ts.map +1 -1
  37. package/dist/server/execute.js +48 -11
  38. package/dist/server/execute.js.map +1 -1
  39. package/dist/server/index.d.ts +4 -2
  40. package/dist/server/index.d.ts.map +1 -1
  41. package/dist/server/index.js +11 -5
  42. package/dist/server/index.js.map +1 -1
  43. package/dist/server/parse.d.ts +6 -0
  44. package/dist/server/parse.d.ts.map +1 -1
  45. package/dist/server/parse.js +9 -4
  46. package/dist/server/parse.js.map +1 -1
  47. package/dist/server/parse.test.js +12 -3
  48. package/dist/server/parse.test.js.map +1 -1
  49. package/dist/server/test.d.ts.map +1 -1
  50. package/dist/server/test.js +17 -0
  51. package/dist/server/test.js.map +1 -1
  52. package/dist/server/test.remote.test.js +3 -1
  53. package/dist/server/test.remote.test.js.map +1 -1
  54. package/dist/ui/build-config.d.ts.map +1 -1
  55. package/dist/ui/build-config.js +11 -0
  56. package/dist/ui/build-config.js.map +1 -1
  57. package/dist/ui/build-config.test.js +8 -0
  58. package/dist/ui/build-config.test.js.map +1 -1
  59. package/dist/ui/parse-stdout.d.ts.map +1 -1
  60. package/dist/ui/parse-stdout.js +4 -0
  61. package/dist/ui/parse-stdout.js.map +1 -1
  62. package/package.json +3 -2
  63. package/skills/paperclip/SKILL.md +45 -10
  64. package/skills/paperclip/references/api-reference.md +246 -1
  65. package/skills/paperclip/references/cases.md +295 -0
  66. package/skills/paperclip/references/company-skills.md +1 -1
  67. package/skills/paperclip-board/SKILL.md +3 -4
  68. package/skills/paperclip-converting-plans-to-tasks/SKILL.md +3 -7
  69. package/skills/para-memory-files/SKILL.md +3 -7
@@ -1 +1 @@
1
- {"version":3,"file":"format-event.d.ts","sourceRoot":"","sources":["../../src/cli/format-event.ts"],"names":[],"mappings":"AA6IA,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAuFxE"}
1
+ {"version":3,"file":"format-event.d.ts","sourceRoot":"","sources":["../../src/cli/format-event.ts"],"names":[],"mappings":"AA8IA,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CA2FxE"}
@@ -1,4 +1,5 @@
1
1
  import pc from "picocolors";
2
+ import { printAcpxStreamEvent } from "@penclipai/adapter-utils/acpx-engine/cli";
2
3
  function asRecord(value) {
3
4
  if (typeof value !== "object" || value === null || Array.isArray(value))
4
5
  return null;
@@ -145,6 +146,10 @@ export function printCodexStreamEvent(raw, _debug) {
145
146
  return;
146
147
  }
147
148
  const type = asString(parsed.type);
149
+ if (type.startsWith("acpx.")) {
150
+ printAcpxStreamEvent(line, _debug);
151
+ return;
152
+ }
148
153
  if (type === "thread.started") {
149
154
  const threadId = asString(parsed.thread_id);
150
155
  const model = asString(parsed.model);
@@ -1 +1 @@
1
- {"version":3,"file":"format-event.js","sourceRoot":"","sources":["../../src/cli/format-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrF,OAAO,KAAgC,CAAC;AAC1C,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc,EAAE,QAAQ,GAAG,EAAE;IAC7C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;AACtD,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc,EAAE,QAAQ,GAAG,CAAC;IAC5C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;AAChF,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,KAA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AC;QAC3B,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;QAC9C,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC;QAC9F,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,cAAc,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACnE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,KAAK,QAAQ,MAAM,WAAW,MAAM,EAAE,CAAC,CAAC,CAAC;QAC3E,OAAO;IACT,CAAC;IAED,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC;QACpE,IAAI,OAAO;YAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC,CAAC;QACtD,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,9 +2,9 @@ import type { AdapterModelProfileDefinition } from "@penclipai/adapter-utils";
2
2
  export declare const type = "codex_local";
3
3
  export declare const label = "Codex";
4
4
  export declare const SANDBOX_INSTALL_COMMAND = "npm install -g @openai/codex";
5
- export declare const DEFAULT_CODEX_LOCAL_MODEL = "gpt-5.5";
5
+ export declare const DEFAULT_CODEX_LOCAL_MODEL = "gpt-5.6";
6
6
  export declare const DEFAULT_CODEX_LOCAL_BYPASS_APPROVALS_AND_SANDBOX = true;
7
- export declare const CODEX_LOCAL_FAST_MODE_SUPPORTED_MODELS: readonly ["gpt-5.5", "gpt-5.4"];
7
+ export declare const CODEX_LOCAL_FAST_MODE_SUPPORTED_MODELS: readonly ["gpt-5.6", "gpt-5.5", "gpt-5.4"];
8
8
  export declare function isCodexLocalKnownModel(model: string | null | undefined): boolean;
9
9
  export declare function isCodexLocalManualModel(model: string | null | undefined): boolean;
10
10
  export declare function isCodexLocalFastModeSupported(model: string | null | undefined): boolean;
@@ -13,5 +13,5 @@ export declare const models: {
13
13
  label: string;
14
14
  }[];
15
15
  export declare const modelProfiles: AdapterModelProfileDefinition[];
16
- export declare const agentConfigurationDoc = "# codex_local agent configuration\n\nAdapter: codex_local\n\nCore fields:\n- cwd (string, optional): default absolute working directory fallback for the agent process (created if missing when possible)\n- instructionsFilePath (string, optional): absolute path to a markdown instructions file prepended to stdin prompt at runtime\n- model (string, optional): Codex model id\n- modelReasoningEffort (string, optional): reasoning effort override (minimal|low|medium|high|xhigh) passed via -c model_reasoning_effort=...\n- promptTemplate (string, optional): run prompt template\n- search (boolean, optional): run codex with --search\n- fastMode (boolean, optional): enable Codex Fast mode; supported on GPT-5.5, GPT-5.4 and passed through for manual model IDs\n- dangerouslyBypassApprovalsAndSandbox (boolean, optional): run with bypass flag\n- command (string, optional): defaults to \"codex\"\n- extraArgs (string[], optional): additional CLI args\n- env (object, optional): KEY=VALUE environment variables\n- workspaceStrategy (object, optional): execution workspace strategy; currently supports { type: \"git_worktree\", baseRef?, branchTemplate?, worktreeParentDir? }\n- workspaceRuntime (object, optional): reserved for workspace runtime metadata; workspace runtime services are manually controlled from the workspace UI and are not auto-started by heartbeats\n\nOperational fields:\n- timeoutSec (number, optional): run timeout in seconds\n- graceSec (number, optional): SIGTERM grace period in seconds\n- outputInactivityTimeoutMs (number | null, optional): inactivity monitor around the codex child. Resets on every parsed JSONL event from stdout. Defaults to 7 * 60_000 ms when unset or non-positive. Set to `null` to disable the monitor entirely (only do this for known-slow tasks; the platform-level 1h silent-run safety net still applies). On fire, the adapter sends SIGTERM to the process group, waits 5s, then SIGKILL, and surfaces the run as failed with errorMessage \"monitor: no codex output for {N}m {S}s\".\n\nNotes:\n- Prompts are piped via stdin (Codex receives \"-\" prompt argument).\n- If instructionsFilePath is configured, Paperclip prepends that file's contents to the stdin prompt on every run.\n- Codex exec automatically applies repo-scoped AGENTS.md instructions from the active workspace. Paperclip cannot suppress that discovery in exec mode, so repo AGENTS.md files may still apply even when you only configured an explicit instructionsFilePath.\n- Paperclip injects desired local skills into the effective CODEX_HOME/skills/ directory at execution time so Codex can discover \"$paperclip\" and related skills without polluting the project working directory. For new and updated agents, Paperclip assigns an isolated managed home at ~/.paperclip/instances/<id>/companies/<companyId>/agents/<agentId>/codex-home/skills/; when CODEX_HOME is explicitly overridden in adapter config, that override is used instead.\n- New and updated codex_local agents persist an empty OPENAI_API_KEY override by default so a host-level OPENAI_API_KEY cannot leak into Codex runs through process inheritance. Explicit CODEX_HOME overrides must not point at the shared company codex-home, $CODEX_HOME, or ~/.codex.\n- Some model/tool combinations reject certain effort levels (for example minimal with web search enabled).\n- Fast mode is supported on GPT-5.5, GPT-5.4 and manual model IDs. When enabled for those models, Paperclip applies `service_tier=\"fast\"` and `features.fast_mode=true`.\n- When Paperclip realizes a workspace/runtime for a run, it injects PAPERCLIP_WORKSPACE_* and PAPERCLIP_RUNTIME_* env vars for agent-side tooling.\n";
16
+ export declare const agentConfigurationDoc = "# codex_local agent configuration\n\nAdapter: codex_local\n\nCore fields:\n- engine (string, optional): leave unset/auto to use ACP when prerequisites pass and fall back to the Codex CLI with diagnostics. Use \"cli\" to pin the CLI lane or \"acp\" to require ACP.\n- cwd (string, optional): default absolute working directory fallback for the agent process (created if missing when possible)\n- instructionsFilePath (string, optional): absolute path to a markdown instructions file prepended to stdin prompt at runtime\n- model (string, optional): Codex model id\n- modelReasoningEffort (string, optional): reasoning effort override (minimal|low|medium|high|xhigh) passed via -c model_reasoning_effort=...\n- promptTemplate (string, optional): run prompt template\n- search (boolean, optional): run codex with --search\n- fastMode (boolean, optional): enable Codex Fast mode; supported on GPT-5.6, GPT-5.5, GPT-5.4 and passed through for manual model IDs\n- dangerouslyBypassApprovalsAndSandbox (boolean, optional): run with bypass flag\n- command (string, optional): defaults to \"codex\"\n- extraArgs (string[], optional): additional CLI args\n- env (object, optional): KEY=VALUE environment variables\n- workspaceStrategy (object, optional): execution workspace strategy; currently supports { type: \"git_worktree\", baseRef?, branchTemplate?, worktreeParentDir? }\n- workspaceRuntime (object, optional): reserved for workspace runtime metadata; workspace runtime services are manually controlled from the workspace UI and are not auto-started by heartbeats\n\nOperational fields:\n- timeoutSec (number, optional): run timeout in seconds\n- graceSec (number, optional): SIGTERM grace period in seconds\n- outputInactivityTimeoutMs (number | null, optional): inactivity monitor around the codex child. Resets on every parsed JSONL event from stdout. Defaults to 7 * 60_000 ms when unset or non-positive. Set to `null` to disable the monitor entirely (only do this for known-slow tasks; the platform-level 1h silent-run safety net still applies). On fire, the adapter sends SIGTERM to the process group, waits 5s, then SIGKILL, and surfaces the run as failed with errorMessage \"monitor: no codex output for {N}m {S}s\".\n- agentCommand (string, optional): ACP server command override used only when engine=\"acp\"; defaults to the package-local codex-acp binary\n- mode (string, optional): ACP session mode when engine=\"acp\"; persistent or oneshot\n- nonInteractivePermissions (string, optional): ACP non-interactive permission fallback when engine=\"acp\"; deny or fail\n- stateDir (string, optional): ACP state directory override when engine=\"acp\"\n- warmHandleIdleMs (number, optional): warm ACP process idle timeout when engine=\"acp\"; defaults to 0\n\nNotes:\n- Prompts are piped via stdin (Codex receives \"-\" prompt argument).\n- If instructionsFilePath is configured, Paperclip prepends that file's contents to the stdin prompt on every run.\n- Codex exec automatically applies repo-scoped AGENTS.md instructions from the active workspace. Paperclip cannot suppress that discovery in exec mode, so repo AGENTS.md files may still apply even when you only configured an explicit instructionsFilePath.\n- Paperclip injects desired local skills into the effective CODEX_HOME/skills/ directory at execution time so Codex can discover \"$paperclip\" and related skills without polluting the project working directory. For new and updated agents, Paperclip assigns an isolated managed home at ~/.paperclip/instances/<id>/companies/<companyId>/agents/<agentId>/codex-home/skills/; when CODEX_HOME is explicitly overridden in adapter config, that override is used instead.\n- New and updated codex_local agents persist an empty OPENAI_API_KEY override by default so a host-level OPENAI_API_KEY cannot leak into Codex runs through process inheritance. Explicit CODEX_HOME overrides must not point at the shared company codex-home, $CODEX_HOME, or ~/.codex.\n- Some model/tool combinations reject certain effort levels (for example minimal with web search enabled).\n- Fast mode is supported on GPT-5.6, GPT-5.5, GPT-5.4 and manual model IDs. When enabled for those models, Paperclip applies `service_tier=\"fast\"` and `features.fast_mode=true`.\n- When Paperclip realizes a workspace/runtime for a run, it injects PAPERCLIP_WORKSPACE_* and PAPERCLIP_RUNTIME_* env vars for agent-side tooling.\n- Codex ACP is the preferred auto lane when Node >=22.13.0 and the Codex ACP server are available. It reuses shared ACP prompt/runtime guidance, selected skill materialization into CODEX_HOME/skills, model/reasoning/fast-mode session config, and existing quota-window reporting. Auto selection falls back to CLI when ACP prerequisites are unavailable; explicit engine=\"acp\" fails loudly.\n";
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAE9E,eAAO,MAAM,IAAI,gBAAgB,CAAC;AAClC,eAAO,MAAM,KAAK,UAAU,CAAC;AAE7B,eAAO,MAAM,uBAAuB,iCAAiC,CAAC;AAEtE,eAAO,MAAM,yBAAyB,YAAY,CAAC;AACnD,eAAO,MAAM,gDAAgD,OAAO,CAAC;AACrE,eAAO,MAAM,sCAAsC,iCAAkC,CAAC;AAMtF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAIhF;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAGjF;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAWvF;AAED,eAAO,MAAM,MAAM;;;GAWlB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,6BAA6B,EAYxD,CAAC;AAEF,eAAO,MAAM,qBAAqB,2kHAiCjC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAE9E,eAAO,MAAM,IAAI,gBAAgB,CAAC;AAClC,eAAO,MAAM,KAAK,UAAU,CAAC;AAE7B,eAAO,MAAM,uBAAuB,iCAAiC,CAAC;AAEtE,eAAO,MAAM,yBAAyB,YAAY,CAAC;AACnD,eAAO,MAAM,gDAAgD,OAAO,CAAC;AACrE,eAAO,MAAM,sCAAsC,4CAA6C,CAAC;AAMjG,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAIhF;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAGjF;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAUvF;AAED,eAAO,MAAM,MAAM;;;GAelB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,6BAA6B,EAYxD,CAAC;AAEF,eAAO,MAAM,qBAAqB,6rJAwCjC,CAAC"}
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export const type = "codex_local";
2
2
  export const label = "Codex";
3
3
  export const SANDBOX_INSTALL_COMMAND = "npm install -g @openai/codex";
4
- export const DEFAULT_CODEX_LOCAL_MODEL = "gpt-5.5";
4
+ export const DEFAULT_CODEX_LOCAL_MODEL = "gpt-5.6";
5
5
  export const DEFAULT_CODEX_LOCAL_BYPASS_APPROVALS_AND_SANDBOX = true;
6
- export const CODEX_LOCAL_FAST_MODE_SUPPORTED_MODELS = ["gpt-5.5", "gpt-5.4"];
6
+ export const CODEX_LOCAL_FAST_MODE_SUPPORTED_MODELS = ["gpt-5.6", "gpt-5.5", "gpt-5.4"];
7
7
  function normalizeModelId(model) {
8
8
  return typeof model === "string" ? model.trim() : "";
9
9
  }
@@ -22,16 +22,19 @@ export function isCodexLocalFastModeSupported(model) {
22
22
  return true;
23
23
  const normalizedModel = typeof model === "string" ? model.trim() : "";
24
24
  // Empty means we're omitting --model so the Codex CLI picks its own default.
25
- // On subscription auth that's gpt-5.5 (fast-mode capable); manual model IDs
26
- // are also treated as supported. Match that policy: pass the fast-mode
27
- // overrides through and let the CLI reject them if the chosen model can't use them.
25
+ // Manual model IDs are also treated as supported: pass the fast-mode overrides
26
+ // through and let the CLI reject them if the chosen model can't use them.
28
27
  if (!normalizedModel)
29
28
  return true;
30
29
  return CODEX_LOCAL_FAST_MODE_SUPPORTED_MODELS.includes(normalizedModel);
31
30
  }
32
31
  export const models = [
33
32
  { id: DEFAULT_CODEX_LOCAL_MODEL, label: DEFAULT_CODEX_LOCAL_MODEL },
33
+ { id: "gpt-5.6-sol", label: "gpt-5.6-sol" },
34
+ { id: "gpt-5.6-terra", label: "gpt-5.6-terra" },
35
+ { id: "gpt-5.6-luna", label: "gpt-5.6-luna" },
34
36
  { id: "gpt-5.4", label: "gpt-5.4" },
37
+ { id: "gpt-5.4-mini", label: "gpt-5.4-mini" },
35
38
  { id: "gpt-5.3-codex-spark", label: "gpt-5.3-codex-spark" },
36
39
  { id: "gpt-5", label: "gpt-5" },
37
40
  { id: "o3", label: "o3" },
@@ -59,13 +62,14 @@ export const agentConfigurationDoc = `# codex_local agent configuration
59
62
  Adapter: codex_local
60
63
 
61
64
  Core fields:
65
+ - engine (string, optional): leave unset/auto to use ACP when prerequisites pass and fall back to the Codex CLI with diagnostics. Use "cli" to pin the CLI lane or "acp" to require ACP.
62
66
  - cwd (string, optional): default absolute working directory fallback for the agent process (created if missing when possible)
63
67
  - instructionsFilePath (string, optional): absolute path to a markdown instructions file prepended to stdin prompt at runtime
64
68
  - model (string, optional): Codex model id
65
69
  - modelReasoningEffort (string, optional): reasoning effort override (minimal|low|medium|high|xhigh) passed via -c model_reasoning_effort=...
66
70
  - promptTemplate (string, optional): run prompt template
67
71
  - search (boolean, optional): run codex with --search
68
- - fastMode (boolean, optional): enable Codex Fast mode; supported on GPT-5.5, GPT-5.4 and passed through for manual model IDs
72
+ - fastMode (boolean, optional): enable Codex Fast mode; supported on GPT-5.6, GPT-5.5, GPT-5.4 and passed through for manual model IDs
69
73
  - dangerouslyBypassApprovalsAndSandbox (boolean, optional): run with bypass flag
70
74
  - command (string, optional): defaults to "codex"
71
75
  - extraArgs (string[], optional): additional CLI args
@@ -77,6 +81,11 @@ Operational fields:
77
81
  - timeoutSec (number, optional): run timeout in seconds
78
82
  - graceSec (number, optional): SIGTERM grace period in seconds
79
83
  - outputInactivityTimeoutMs (number | null, optional): inactivity monitor around the codex child. Resets on every parsed JSONL event from stdout. Defaults to 7 * 60_000 ms when unset or non-positive. Set to \`null\` to disable the monitor entirely (only do this for known-slow tasks; the platform-level 1h silent-run safety net still applies). On fire, the adapter sends SIGTERM to the process group, waits 5s, then SIGKILL, and surfaces the run as failed with errorMessage "monitor: no codex output for {N}m {S}s".
84
+ - agentCommand (string, optional): ACP server command override used only when engine="acp"; defaults to the package-local codex-acp binary
85
+ - mode (string, optional): ACP session mode when engine="acp"; persistent or oneshot
86
+ - nonInteractivePermissions (string, optional): ACP non-interactive permission fallback when engine="acp"; deny or fail
87
+ - stateDir (string, optional): ACP state directory override when engine="acp"
88
+ - warmHandleIdleMs (number, optional): warm ACP process idle timeout when engine="acp"; defaults to 0
80
89
 
81
90
  Notes:
82
91
  - Prompts are piped via stdin (Codex receives "-" prompt argument).
@@ -85,7 +94,8 @@ Notes:
85
94
  - Paperclip injects desired local skills into the effective CODEX_HOME/skills/ directory at execution time so Codex can discover "$paperclip" and related skills without polluting the project working directory. For new and updated agents, Paperclip assigns an isolated managed home at ~/.paperclip/instances/<id>/companies/<companyId>/agents/<agentId>/codex-home/skills/; when CODEX_HOME is explicitly overridden in adapter config, that override is used instead.
86
95
  - New and updated codex_local agents persist an empty OPENAI_API_KEY override by default so a host-level OPENAI_API_KEY cannot leak into Codex runs through process inheritance. Explicit CODEX_HOME overrides must not point at the shared company codex-home, $CODEX_HOME, or ~/.codex.
87
96
  - Some model/tool combinations reject certain effort levels (for example minimal with web search enabled).
88
- - Fast mode is supported on GPT-5.5, GPT-5.4 and manual model IDs. When enabled for those models, Paperclip applies \`service_tier="fast"\` and \`features.fast_mode=true\`.
97
+ - Fast mode is supported on GPT-5.6, GPT-5.5, GPT-5.4 and manual model IDs. When enabled for those models, Paperclip applies \`service_tier="fast"\` and \`features.fast_mode=true\`.
89
98
  - When Paperclip realizes a workspace/runtime for a run, it injects PAPERCLIP_WORKSPACE_* and PAPERCLIP_RUNTIME_* env vars for agent-side tooling.
99
+ - Codex ACP is the preferred auto lane when Node >=22.13.0 and the Codex ACP server are available. It reuses shared ACP prompt/runtime guidance, selected skill materialization into CODEX_HOME/skills, model/reasoning/fast-mode session config, and existing quota-window reporting. Auto selection falls back to CLI when ACP prerequisites are unavailable; explicit engine="acp" fails loudly.
90
100
  `;
91
101
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC;AAClC,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,CAAC;AAE7B,M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 @@
1
1
  import { describe, expect, it } from "vitest";
2
- import { DEFAULT_CODEX_LOCAL_MODEL, models } from "./index.js";
2
+ import { DEFAULT_CODEX_LOCAL_MODEL, isCodexLocalFastModeSupported, models } from "./index.js";
3
3
  describe("codex local adapter metadata", () => {
4
- it("does not advertise the ChatGPT-unsupported gpt-5.3-codex model as a default option", () => {
5
- expect(DEFAULT_CODEX_LOCAL_MODEL).toBe("gpt-5.5");
6
- expect(models.map((model) => model.id)).not.toContain("gpt-5.3-codex");
4
+ it("advertises current GPT-5.6 Codex-capable OpenAI models by default", () => {
5
+ const modelIds = models.map((model) => model.id);
6
+ expect(DEFAULT_CODEX_LOCAL_MODEL).toBe("gpt-5.6");
7
+ expect(modelIds.slice(0, 4)).toEqual([
8
+ "gpt-5.6",
9
+ "gpt-5.6-sol",
10
+ "gpt-5.6-terra",
11
+ "gpt-5.6-luna",
12
+ ]);
13
+ expect(isCodexLocalFastModeSupported(DEFAULT_CODEX_LOCAL_MODEL)).toBe(true);
14
+ expect(modelIds).not.toContain("gpt-5.3-codex");
7
15
  });
8
16
  });
9
17
  //# sourceMappingURL=index.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAE/D,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,oFAAoF,EAAE,GAAG,EAAE;QAC5F,MAAM,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAE9F,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAEjD,MAAM,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClD,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YACnC,SAAS;YACT,aAAa;YACb,eAAe;YACf,cAAc;SACf,CAAC,CAAC;QACH,MAAM,CAAC,6BAA6B,CAAC,yBAAyB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5E,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { AdapterBillingType, AdapterEnvironmentTestContext, AdapterEnvironmentTestResult, AdapterExecutionContext, AdapterExecutionResult } from "@penclipai/adapter-utils";
2
+ import type { AcpxEngineExecutorOptions } from "@penclipai/adapter-utils/acpx-engine/execute";
3
+ export type CodexExecutionEngine = "cli" | "acp";
4
+ export interface CodexEngineSelection {
5
+ engine: CodexExecutionEngine;
6
+ explicit: boolean;
7
+ fallbackReason?: string;
8
+ }
9
+ type CodexEngineResolutionInput = Pick<AdapterExecutionContext, "config"> & Partial<Pick<AdapterExecutionContext, "executionTarget" | "executionTransport">>;
10
+ type CodexAcpExecutorOptions = Omit<AcpxEngineExecutorOptions, "adapterType" | "moduleDir" | "packageRootDir">;
11
+ type CodexAcpExecutor = (ctx: AdapterExecutionContext) => Promise<AdapterExecutionResult>;
12
+ export declare function resolveCodexExecutionEngine(config: Record<string, unknown>): CodexEngineSelection;
13
+ export declare function resolveCodexExecutionEngineForRun(input: CodexEngineResolutionInput): Promise<CodexEngineSelection>;
14
+ export declare function formatCodexAcpFallbackMessage(reason: string): string;
15
+ export declare function buildCodexAcpConfig(config: Record<string, unknown>): Record<string, unknown>;
16
+ /**
17
+ * Classify billing the same way the Codex CLI lane does so ACP runs land in
18
+ * the cost ledger with a real provider/billingType instead of acpx/unknown.
19
+ * Host env only counts for local execution targets; remote targets see just
20
+ * the adapter-config env.
21
+ */
22
+ export declare function resolveCodexAcpBillingIdentity(ctx: Pick<AdapterExecutionContext, "config"> & Partial<Pick<AdapterExecutionContext, "executionTarget" | "executionTransport">>): {
23
+ provider: string;
24
+ biller: string;
25
+ billingType: AdapterBillingType;
26
+ };
27
+ export declare function createCodexAcpExecutor(options?: CodexAcpExecutorOptions): CodexAcpExecutor;
28
+ export declare function nodeVersionMeetsCodexAcpMinimum(version?: string): boolean;
29
+ export declare function testCodexAcpEnvironment(ctx: AdapterEnvironmentTestContext): Promise<AdapterEnvironmentTestResult>;
30
+ export {};
31
+ //# sourceMappingURL=acp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp.d.ts","sourceRoot":"","sources":["../../src/server/acp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAElB,6BAA6B,EAC7B,4BAA4B,EAC5B,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAalC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAW9F,MAAM,MAAM,oBAAoB,GAAG,KAA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,CAc9F;AAQD,wBAAgB,+BAA+B,CAAC,OAAO,SAAkB,GAAG,OAAO,CAMlF;AAuID,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,6BAA6B,GACjC,OAAO,CAAC,4BAA4B,CAAC,CAqHvC"}
@@ -0,0 +1,361 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { inferOpenAiCompatibleBiller } from "@penclipai/adapter-utils";
5
+ import { ensureAdapterExecutionTargetCommandResolvable, readAdapterExecutionTarget, resolveAdapterExecutionTargetCwd, } from "@penclipai/adapter-utils/execution-target";
6
+ import { DEFAULT_ACP_ENGINE_MODE, DEFAULT_ACP_ENGINE_NON_INTERACTIVE_PERMISSIONS, DEFAULT_ACP_ENGINE_PERMISSION_MODE, DEFAULT_ACP_ENGINE_WARM_HANDLE_IDLE_MS, } from "@penclipai/adapter-utils/acpx-engine/constants";
7
+ import { asNumber, asString, parseObject, } from "@penclipai/adapter-utils/server-utils";
8
+ const moduleDir = path.dirname(fileURLToPath(import.meta.url));
9
+ const packageRootDir = path.resolve(moduleDir, "../..");
10
+ const MIN_ACP_NODE_VERSION = "22.13.0";
11
+ function normalizeEngine(value) {
12
+ const raw = typeof value === "string" ? value.trim().toLowerCase() : "";
13
+ if (raw === "acp")
14
+ return { engine: "acp", explicit: true };
15
+ if (raw === "cli")
16
+ return { engine: "cli", explicit: true };
17
+ return { engine: "acp", explicit: false };
18
+ }
19
+ export function resolveCodexExecutionEngine(config) {
20
+ return normalizeEngine(config.engine);
21
+ }
22
+ export async function resolveCodexExecutionEngineForRun(input) {
23
+ const selection = normalizeEngine(input.config.engine);
24
+ if (selection.explicit || selection.engine !== "acp")
25
+ return selection;
26
+ const fallbackReason = await defaultCodexAcpFallbackReason(input);
27
+ if (!fallbackReason)
28
+ return selection;
29
+ return { engine: "cli", explicit: false, fallbackReason };
30
+ }
31
+ export function formatCodexAcpFallbackMessage(reason) {
32
+ return `[paperclip] Codex ACP default unavailable; falling back to Codex CLI. ${reason} Set engine=acp to require ACP or engine=cli to silence this fallback.\n`;
33
+ }
34
+ function firstNonEmptyString(...values) {
35
+ for (const value of values) {
36
+ if (typeof value !== "string")
37
+ continue;
38
+ const trimmed = value.trim();
39
+ if (trimmed.length > 0)
40
+ return trimmed;
41
+ }
42
+ return undefined;
43
+ }
44
+ export function buildCodexAcpConfig(config) {
45
+ const agentCommand = firstNonEmptyString(config.agentCommand, config.acpAgentCommand);
46
+ const stateDir = firstNonEmptyString(config.stateDir, config.acpStateDir);
47
+ const mode = firstNonEmptyString(config.mode, config.acpMode) ?? DEFAULT_ACP_ENGINE_MODE;
48
+ const permissionMode = firstNonEmptyString(config.permissionMode, config.acpPermissionMode) ??
49
+ DEFAULT_ACP_ENGINE_PERMISSION_MODE;
50
+ const nonInteractivePermissions = firstNonEmptyString(config.nonInteractivePermissions, config.acpNonInteractivePermissions) ??
51
+ DEFAULT_ACP_ENGINE_NON_INTERACTIVE_PERMISSIONS;
52
+ const warmHandleIdleMs = config.warmHandleIdleMs ??
53
+ config.acpWarmHandleIdleMs ??
54
+ DEFAULT_ACP_ENGINE_WARM_HANDLE_IDLE_MS;
55
+ return {
56
+ ...config,
57
+ agent: "codex",
58
+ mode,
59
+ permissionMode,
60
+ nonInteractivePermissions,
61
+ warmHandleIdleMs,
62
+ ...(agentCommand ? { agentCommand } : {}),
63
+ ...(stateDir ? { stateDir } : {}),
64
+ };
65
+ }
66
+ function withCodexAcpDefaults(options) {
67
+ return {
68
+ resolveBillingIdentity: resolveCodexAcpBillingIdentity,
69
+ ...options,
70
+ adapterType: "codex_local",
71
+ moduleDir,
72
+ packageRootDir,
73
+ };
74
+ }
75
+ /**
76
+ * Classify billing the same way the Codex CLI lane does so ACP runs land in
77
+ * the cost ledger with a real provider/billingType instead of acpx/unknown.
78
+ * Host env only counts for local execution targets; remote targets see just
79
+ * the adapter-config env.
80
+ */
81
+ export function resolveCodexAcpBillingIdentity(ctx) {
82
+ const envConfig = parseObject(parseObject(ctx.config).env);
83
+ const target = readAdapterExecutionTarget({
84
+ executionTarget: ctx.executionTarget,
85
+ legacyRemoteExecution: ctx.executionTransport?.remoteExecution,
86
+ });
87
+ const considerHostEnv = target?.kind !== "remote";
88
+ const mergedEnv = {
89
+ ...(considerHostEnv ? process.env : {}),
90
+ ...Object.fromEntries(Object.entries(envConfig).filter((entry) => typeof entry[1] === "string")),
91
+ };
92
+ const apiKey = typeof mergedEnv.OPENAI_API_KEY === "string" && mergedEnv.OPENAI_API_KEY.trim().length > 0;
93
+ const billingType = apiKey ? "api" : "subscription";
94
+ const openAiCompatibleBiller = inferOpenAiCompatibleBiller(mergedEnv, "openai");
95
+ const biller = openAiCompatibleBiller === "openrouter"
96
+ ? "openrouter"
97
+ : billingType === "subscription"
98
+ ? "chatgpt"
99
+ : openAiCompatibleBiller ?? "openai";
100
+ return { provider: "openai", biller, billingType };
101
+ }
102
+ export function createCodexAcpExecutor(options = {}) {
103
+ let executor = null;
104
+ return async (ctx) => {
105
+ let currentExecutor = executor;
106
+ if (!currentExecutor) {
107
+ const { createAcpxEngineExecutor } = await import("@penclipai/adapter-utils/acpx-engine/execute");
108
+ currentExecutor = createAcpxEngineExecutor(withCodexAcpDefaults(options));
109
+ executor = currentExecutor;
110
+ }
111
+ return currentExecutor({
112
+ ...ctx,
113
+ config: buildCodexAcpConfig(ctx.config),
114
+ });
115
+ };
116
+ }
117
+ function parseVersion(version) {
118
+ const match = version.match(/^v?(\d+)\.(\d+)\.(\d+)/);
119
+ if (!match)
120
+ return [0, 0, 0];
121
+ return [Number(match[1]), Number(match[2]), Number(match[3])];
122
+ }
123
+ export function nodeVersionMeetsCodexAcpMinimum(version = process.version) {
124
+ const [major, minor, patch] = parseVersion(version);
125
+ const [minMajor, minMinor, minPatch] = parseVersion(MIN_ACP_NODE_VERSION);
126
+ if (major !== minMajor)
127
+ return major > minMajor;
128
+ if (minor !== minMinor)
129
+ return minor > minMinor;
130
+ return patch >= minPatch;
131
+ }
132
+ async function pathExists(candidate) {
133
+ return fs.access(candidate).then(() => true).catch(() => false);
134
+ }
135
+ function hasPathSeparator(command) {
136
+ return command.includes("/") || command.includes("\\");
137
+ }
138
+ function looksLikeShellCommand(command) {
139
+ return /\s/.test(command.trim());
140
+ }
141
+ async function findCommandOnPath(binName) {
142
+ const pathValue = process.env.PATH ?? "";
143
+ for (const segment of pathValue.split(path.delimiter)) {
144
+ if (!segment)
145
+ continue;
146
+ const candidate = path.join(segment, binName);
147
+ if (await pathExists(candidate))
148
+ return candidate;
149
+ }
150
+ return null;
151
+ }
152
+ async function findAncestorBin(startDir, binName) {
153
+ let current = path.resolve(startDir);
154
+ while (true) {
155
+ const candidate = path.join(current, "node_modules", ".bin", binName);
156
+ if (await pathExists(candidate))
157
+ return candidate;
158
+ const parent = path.dirname(current);
159
+ if (parent === current)
160
+ return null;
161
+ current = parent;
162
+ }
163
+ }
164
+ async function commandIsResolvable(command, input) {
165
+ const trimmed = command.trim();
166
+ if (!trimmed)
167
+ return false;
168
+ if (looksLikeShellCommand(trimmed))
169
+ return true;
170
+ const target = readAdapterExecutionTarget({
171
+ executionTarget: input?.executionTarget,
172
+ legacyRemoteExecution: input?.executionTransport?.remoteExecution,
173
+ });
174
+ if (target?.kind === "remote") {
175
+ try {
176
+ await ensureAdapterExecutionTargetCommandResolvable(trimmed, target, resolveAdapterExecutionTargetCwd(target, asString(input?.config.cwd, ""), process.cwd()), process.env);
177
+ return true;
178
+ }
179
+ catch {
180
+ return false;
181
+ }
182
+ }
183
+ if (path.isAbsolute(trimmed) || hasPathSeparator(trimmed))
184
+ return pathExists(trimmed);
185
+ return (await findCommandOnPath(trimmed)) !== null;
186
+ }
187
+ async function resolveCodexAcpCommand(config) {
188
+ const configured = firstNonEmptyString(config.agentCommand, config.acpAgentCommand);
189
+ if (configured)
190
+ return configured;
191
+ return ((await findAncestorBin(packageRootDir, "codex-acp")) ??
192
+ (await findCommandOnPath("codex-acp")) ??
193
+ path.join(packageRootDir, "node_modules", ".bin", "codex-acp"));
194
+ }
195
+ function sandboxTargetHasProcessSessionBridge(target) {
196
+ return target?.kind === "remote" && target.transport === "sandbox" && Boolean(target.runner);
197
+ }
198
+ async function resolveCodexAcpCommandForTarget(config, target) {
199
+ const configured = firstNonEmptyString(config.agentCommand, config.acpAgentCommand);
200
+ if (configured)
201
+ return configured;
202
+ if (target?.kind === "remote")
203
+ return "codex-acp";
204
+ return resolveCodexAcpCommand(config);
205
+ }
206
+ async function defaultCodexAcpFallbackReason(input) {
207
+ const target = readAdapterExecutionTarget({
208
+ executionTarget: input.executionTarget,
209
+ legacyRemoteExecution: input.executionTransport?.remoteExecution,
210
+ });
211
+ if (target?.kind === "remote" && !sandboxTargetHasProcessSessionBridge(target)) {
212
+ if (target.transport === "sandbox") {
213
+ return "Codex ACP requires a bidirectional remote process target; this sandbox exposes only one-shot command execution.";
214
+ }
215
+ return "Codex ACP supports sandbox remote targets only; this run targets a non-sandbox remote environment.";
216
+ }
217
+ if (!nodeVersionMeetsCodexAcpMinimum()) {
218
+ return `Node ${process.version} does not satisfy Codex ACP's Node >=${MIN_ACP_NODE_VERSION} prerequisite.`;
219
+ }
220
+ const command = await resolveCodexAcpCommandForTarget(input.config, target);
221
+ if (!(await commandIsResolvable(command, input))) {
222
+ return `Codex ACP server command is not available: ${command}.`;
223
+ }
224
+ return null;
225
+ }
226
+ function summarizeStatus(checks) {
227
+ if (checks.some((check) => check.level === "error"))
228
+ return "fail";
229
+ if (checks.some((check) => check.level === "warn"))
230
+ return "warn";
231
+ return "pass";
232
+ }
233
+ function isNonEmpty(value) {
234
+ return typeof value === "string" && value.trim().length > 0;
235
+ }
236
+ async function hasCodexNativeCredentials(codexHome) {
237
+ const raw = await fs.readFile(path.join(codexHome, "auth.json"), "utf8").catch(() => null);
238
+ if (!raw)
239
+ return false;
240
+ try {
241
+ const parsed = JSON.parse(raw);
242
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
243
+ return false;
244
+ const record = parsed;
245
+ return isNonEmpty(record.OPENAI_API_KEY) || isNonEmpty(record.refresh_token);
246
+ }
247
+ catch {
248
+ return false;
249
+ }
250
+ }
251
+ export async function testCodexAcpEnvironment(ctx) {
252
+ const checks = [];
253
+ const config = parseObject(ctx.config);
254
+ const target = ctx.executionTarget ?? null;
255
+ const targetIsRemote = target?.kind === "remote";
256
+ checks.push({
257
+ code: "codex_engine_selected",
258
+ level: "info",
259
+ message: "Execution engine selected: ACP.",
260
+ hint: "Set engine=cli to use the existing Codex CLI lane.",
261
+ });
262
+ if (targetIsRemote) {
263
+ checks.push({
264
+ code: "codex_acp_remote_target",
265
+ level: "info",
266
+ message: "Codex ACP will run against the remote execution environment.",
267
+ hint: "Remote ACP requires a bidirectional process target such as SSH or Paperclip's sandbox process-session bridge.",
268
+ });
269
+ }
270
+ const cwd = asString(config.cwd, process.cwd());
271
+ try {
272
+ await fs.mkdir(cwd, { recursive: true });
273
+ checks.push({
274
+ code: "codex_acp_cwd_valid",
275
+ level: "info",
276
+ message: `Working directory is valid: ${cwd}`,
277
+ });
278
+ }
279
+ catch (err) {
280
+ checks.push({
281
+ code: "codex_acp_cwd_invalid",
282
+ level: "error",
283
+ message: err instanceof Error ? err.message : "Invalid working directory",
284
+ detail: cwd,
285
+ });
286
+ }
287
+ checks.push({
288
+ code: nodeVersionMeetsCodexAcpMinimum() ? "codex_acp_node_supported" : "codex_acp_node_unsupported",
289
+ level: nodeVersionMeetsCodexAcpMinimum() ? "info" : "error",
290
+ message: nodeVersionMeetsCodexAcpMinimum()
291
+ ? `Node ${process.version} satisfies ACP runtime requirements.`
292
+ : `Node ${process.version} does not satisfy ACP runtime requirements.`,
293
+ hint: nodeVersionMeetsCodexAcpMinimum()
294
+ ? undefined
295
+ : `Run Codex ACP with Node >=${MIN_ACP_NODE_VERSION} or switch engine=cli.`,
296
+ });
297
+ const command = await resolveCodexAcpCommandForTarget(config, target);
298
+ const commandResolvable = await commandIsResolvable(command, {
299
+ config,
300
+ executionTarget: ctx.executionTarget,
301
+ });
302
+ checks.push({
303
+ code: commandResolvable ? "codex_acp_command_resolvable" : "codex_acp_command_missing",
304
+ level: commandResolvable ? "info" : "error",
305
+ message: commandResolvable
306
+ ? `Codex ACP server command is executable: ${command}`
307
+ : `Codex ACP server command is not available: ${command}`,
308
+ hint: commandResolvable
309
+ ? undefined
310
+ : "Install dependencies so @agentclientprotocol/codex-acp is present, or set agentCommand to a valid Codex ACP server command.",
311
+ });
312
+ const envConfig = parseObject(config.env);
313
+ const considerHostEnv = !targetIsRemote;
314
+ const configApiKey = envConfig.OPENAI_API_KEY;
315
+ const hostApiKey = considerHostEnv ? process.env.OPENAI_API_KEY : undefined;
316
+ if (isNonEmpty(configApiKey) || isNonEmpty(hostApiKey)) {
317
+ const source = isNonEmpty(configApiKey) ? "adapter config env" : "server environment";
318
+ checks.push({
319
+ code: "codex_acp_openai_api_key_detected",
320
+ level: "info",
321
+ message: "OPENAI_API_KEY is set for Codex ACP authentication.",
322
+ detail: `Detected in ${source}.`,
323
+ });
324
+ }
325
+ else if (!targetIsRemote) {
326
+ const codexHome = isNonEmpty(envConfig.CODEX_HOME)
327
+ ? envConfig.CODEX_HOME
328
+ : path.join(process.env.HOME ?? "", ".codex");
329
+ if (codexHome && await hasCodexNativeCredentials(codexHome)) {
330
+ checks.push({
331
+ code: "codex_acp_native_auth_detected",
332
+ level: "info",
333
+ message: "Codex ACP can use Codex native authentication.",
334
+ detail: `Credentials found in ${path.join(codexHome, "auth.json")}.`,
335
+ });
336
+ }
337
+ else {
338
+ checks.push({
339
+ code: "codex_acp_credentials_missing",
340
+ level: "warn",
341
+ message: "No Codex ACP credentials were detected.",
342
+ hint: "Set OPENAI_API_KEY or run `codex login` before starting a Codex ACP agent.",
343
+ });
344
+ }
345
+ }
346
+ const mode = firstNonEmptyString(config.mode, config.acpMode) ?? DEFAULT_ACP_ENGINE_MODE;
347
+ const warmHandleIdleMs = asNumber(config.warmHandleIdleMs ?? config.acpWarmHandleIdleMs, DEFAULT_ACP_ENGINE_WARM_HANDLE_IDLE_MS);
348
+ checks.push({
349
+ code: "codex_acp_runtime_scaffold",
350
+ level: "info",
351
+ message: "Codex ACP runtime execution is available through the shared ACP engine.",
352
+ detail: `mode=${mode}; warmHandleIdleMs=${warmHandleIdleMs}`,
353
+ });
354
+ return {
355
+ adapterType: ctx.adapterType,
356
+ status: summarizeStatus(checks),
357
+ checks,
358
+ testedAt: new Date().toISOString(),
359
+ };
360
+ }
361
+ //# sourceMappingURL=acp.js.map