@openclaw/codex 2026.9.2 → 2026.9.3

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 (108) hide show
  1. package/README.md +2 -0
  2. package/dist/api.js +14 -19
  3. package/dist/apply-B6el6hdO.js +357 -0
  4. package/dist/{attempt-client-cleanup-Bp1ZOnk2.js → attempt-client-cleanup-D6cR54TV.js} +39 -19
  5. package/dist/{attempt-context-CSazkWns.js → attempt-context-AO4DSjE0.js} +8 -6
  6. package/dist/{event-projector-usage-ZqEVbAEY.js → attempt-notifications--H8zXR5-.js} +3 -106
  7. package/dist/auth-cache-key-Kq6oerr6.js +498 -0
  8. package/dist/auth-profile-CwzO4_RG.js +43 -0
  9. package/dist/auth-profile-selection-DFu9e167.js +45 -0
  10. package/dist/binding-connection-QqgcPCgk.js +60 -0
  11. package/dist/{bounded-turn-DxGJRYbY.js → bounded-turn-lRpmZHFv.js} +25 -122
  12. package/dist/build-state-6RL6qohz.js +19 -0
  13. package/dist/{capabilities-B1mgvpP8.js → capabilities-BeqLPbtM.js} +1 -1
  14. package/dist/cli-metadata.js +1 -1
  15. package/dist/client-BEKu4yDx.js +3983 -0
  16. package/dist/command-dispatch-CisT9Jqq.js +21 -0
  17. package/dist/{command-formatters-DSbGMXA0.js → command-formatters-DeTfrapr.js} +2 -2
  18. package/dist/{command-handlers-DOJvGv6-.js → command-handlers-BfIsJEuA.js} +31 -21
  19. package/dist/command-rpc-BMqRQOFX.js +226 -0
  20. package/dist/{compact-Y_xBqrHN.js → compact-CGJZ2rlb.js} +19 -14
  21. package/dist/config-JDfTI4VI.js +106 -0
  22. package/dist/{config-CyapYSji.js → config-options-jnIFvwxD.js} +204 -592
  23. package/dist/config-runtime-BWf6JLWG.js +11 -0
  24. package/dist/conversation-binding-CxOlHiix.js +889 -0
  25. package/dist/{plugin-marketplace-discovery-B7gHXJ3d.js → conversation-control-CUCrSIQI.js} +10 -142
  26. package/dist/doctor-contract-api.js +5 -5
  27. package/dist/{dynamic-tools-BwpvTxaX.js → dynamic-tools-D-JBoaLt.js} +66 -70
  28. package/dist/{effective-mcp-catalog-CY9Jn4bA.js → effective-mcp-catalog-J_5Ep5Um.js} +3 -3
  29. package/dist/{elicitation-input-DMkeki8d.js → elicitation-input-DPoK8F7w.js} +8 -22
  30. package/dist/ephemeral-turn-DSwzP8YY.js +101 -0
  31. package/dist/{event-projector-assistant-message-B9kp6iGC.js → event-projector-assistant-message-BmBM4qBV.js} +12 -25
  32. package/dist/event-projector-usage-CIyrYYid.js +102 -0
  33. package/dist/{harness-Czh2Sdoc.js → harness-FR6eQgyO.js} +31 -24
  34. package/dist/harness.js +1 -1
  35. package/dist/history-rejection-B4nOXNXF.js +13 -0
  36. package/dist/incognito-session-uhrBF6wJ.js +15 -0
  37. package/dist/index.js +411 -2875
  38. package/dist/{isolated-completion-CRh-51AK.js → isolated-completion-DHBefrzg.js} +7 -4
  39. package/dist/launch-args-RXQwn8zV.js +90 -0
  40. package/dist/{managed-binary-DcpnJF9x.js → managed-binary-DrjjRRUD.js} +4 -103
  41. package/dist/managed-thread-store-D1t5jh3G.js +66 -0
  42. package/dist/media-understanding-provider.js +4 -1
  43. package/dist/{model-catalog-DT5vo6qo.js → model-catalog-B_6M04Wo.js} +6 -5
  44. package/dist/{models-CcrgSMQR.js → models-P9k2qAof.js} +3 -3
  45. package/dist/native-execution-policy-umd0tgh4.js +128 -0
  46. package/dist/{native-subagent-monitor-B3bvQGcg.js → native-subagent-monitor-BbCUKRwC.js} +69 -42
  47. package/dist/node-cli-sessions-rj0ysJwM.js +527 -0
  48. package/dist/{node-exec-server.runtime-nfbUOtUB.js → node-exec-server.runtime-BY_ctYnT.js} +53 -22
  49. package/dist/plan-BMJdMOEF.js +711 -0
  50. package/dist/plugin-activation-BQK-f5sV.js +133 -0
  51. package/dist/{thread-resume-BLgqkUc1.js → plugin-app-cache-key-CdSQzWyX.js} +4 -52
  52. package/dist/{plugin-approval-roundtrip-aQVdyL5g.js → plugin-approval-roundtrip-DeW95wB5.js} +1 -1
  53. package/dist/plugin-inventory-CoRCzWW4.js +325 -0
  54. package/dist/plugin-marketplace-discovery-3akBizzF.js +134 -0
  55. package/dist/{plugin-metadata-cache-BwCLTY_U.js → plugin-metadata-cache-DgNfRAGA.js} +13 -9
  56. package/dist/protocol-CAAcVIKF.js +275 -0
  57. package/dist/{provider-capabilities-BpG9Ltc5.js → provider-capabilities-W4tfK5Y5.js} +2 -2
  58. package/dist/{rate-limits-Fx_l4eNa.js → rate-limits-Bqnx1N4z.js} +1 -1
  59. package/dist/request-CGvGOpeR.js +198 -0
  60. package/dist/{run-attempt-BzthFQSM.js → run-attempt-DwKds3DN.js} +589 -373
  61. package/dist/{runtime-artifact-Bh_gf6-t.js → runtime-artifact-T-NwqeSH.js} +27 -27
  62. package/dist/sandbox-guard-BcT66fWy.js +165 -0
  63. package/dist/{session-binding-4Ki04sW-.js → session-binding-CKSepwIC.js} +29 -47
  64. package/dist/{session-binding-record-CyaXZvTe.js → session-binding-record-CaZjYwNS.js} +11 -25
  65. package/dist/session-catalog-HaDcp7Sv.js +1533 -0
  66. package/dist/session-catalog-adoption-BKLtSrwi.js +251 -0
  67. package/dist/session-catalog-archive-D0i2pGj2.js +56 -0
  68. package/dist/session-catalog-home-id-D7-aLiNt.js +190 -0
  69. package/dist/session-catalog-node-adoption-BUuDYY8R.js +182 -0
  70. package/dist/session-catalog-node-continue-CBtc4wkI.js +238 -0
  71. package/dist/session-catalog-parsing-CdD3JhdM.js +280 -0
  72. package/dist/session-catalog-provenance-DkJHo735.js +124 -0
  73. package/dist/{session-cli-BjLhpmS1.js → session-cli-CbgaHh0f.js} +3 -2
  74. package/dist/{session-history-DWmMqiqW.js → session-history-Cz-tOOYj.js} +6 -3
  75. package/dist/{session-upstream-marker-DReTpGz6.js → session-history-import-DFN7sWRU.js} +5 -50
  76. package/dist/{session-history-read-LHldwvyh.js → session-history-read-cxPUxyVV.js} +21 -7
  77. package/dist/session-history-worker-runtime.js +18 -6
  78. package/dist/{session-history.worker-zZVcx0ME.js → session-history.worker-CNEvGaU5.js} +58 -51
  79. package/dist/session-history.worker.js +1 -1
  80. package/dist/{session-initialization-BCFVnLL4.js → session-initialization-Jo86C60I.js} +2 -2
  81. package/dist/{session-permission-policy-BaueHmSj.js → session-permission-policy-B22InTp_.js} +4 -7
  82. package/dist/{session-retirement-DNdmYdFc.js → session-retirement-BSNG_mhf.js} +6 -5
  83. package/dist/session-upstream-marker-D15C9NHp.js +46 -0
  84. package/dist/{settled-turn-context-BOM3Y1pl.js → settled-turn-context-Du6gdUDd.js} +9 -9
  85. package/dist/{settled-turn-finalizer-BI-b1sry.js → settled-turn-finalizer-BuLUrZl2.js} +7 -6
  86. package/dist/shared-client-CVhez2Uo.js +2911 -0
  87. package/dist/{side-question-B6DWAw1A.js → side-question-DLbr2vUU.js} +64 -169
  88. package/dist/source-Da-h6f7e.js +518 -0
  89. package/dist/thread-archive-guard-D1bP04Tf.js +53 -0
  90. package/dist/{thread-lifecycle-DPK30jad.js → thread-lifecycle-D1pzRwHB.js} +112 -616
  91. package/dist/{thread-ownership-CbucAmmp.js → thread-ownership-D6oASVRu.js} +13 -15
  92. package/dist/thread-policy-D8kI7yAO.js +54 -0
  93. package/dist/thread-resume-T5cveyxA.js +52 -0
  94. package/dist/timeout-BVw8aaM1.js +33 -0
  95. package/dist/{transcript-mirror-attestation-Byl34PC-.js → transcript-mirror-attestation-DibE0krH.js} +17 -4
  96. package/dist/{transcript-mirror-_njEB84z.js → transcript-mirror-t5TOccct.js} +50 -260
  97. package/dist/{transport-stdio-CzTngV0j.js → transport-stdio-BGjHoYLr.js} +73 -43
  98. package/dist/{upstream-session-fork-1fwbNKzQ.js → upstream-session-fork-De-sLJ2r.js} +26 -18
  99. package/dist/{usage-i9fv5-4m.js → usage-CPPTmBvZ.js} +4 -3
  100. package/dist/version-omm6IPI3.js +12 -0
  101. package/dist/{web-search-provider.runtime-DKQn67A7.js → web-search-provider.runtime-CSVgQL0w.js} +3 -3
  102. package/openclaw.plugin.json +22 -1
  103. package/package.json +4 -4
  104. package/dist/request-C8H22rPi.js +0 -475
  105. package/dist/session-catalog-B47uwekb.js +0 -3272
  106. package/dist/shared-client-CKhX2kFt.js +0 -7505
  107. package/dist/thread-policy-CTalhWFy.js +0 -105
  108. package/dist/{auth-binding-Ds_QVm-X.js → auth-binding-Co2Vfcf_.js} +1 -1
@@ -1,11 +1,11 @@
1
- import { i as resolvePackagedCodexNativeCommand } from "./managed-binary-DcpnJF9x.js";
2
- import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-CzTngV0j.js";
1
+ import { i as resolvePackagedCodexNativeCommand } from "./managed-binary-DrjjRRUD.js";
2
+ import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-BGjHoYLr.js";
3
3
  import { createHash } from "node:crypto";
4
- import fs from "node:fs/promises";
4
+ import { resolveWindowsExecutablePath, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
5
+ import { constants } from "node:fs";
5
6
  import path from "node:path";
7
+ import fs$1 from "node:fs/promises";
6
8
  import { isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
7
- import { constants } from "node:fs";
8
- import { resolveWindowsExecutablePath, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
9
9
  //#region extensions/codex/src/app-server/runtime-artifact.ts
10
10
  /** Exact local runtime artifact identity for verified Codex setup turns. */
11
11
  const ARTIFACT_ID_PREFIX = "codex-app-server:v1:";
@@ -66,9 +66,9 @@ function sameOpenedFile(left, right) {
66
66
  }
67
67
  async function readRegularFileFingerprint(params) {
68
68
  throwIfAborted(params.signal);
69
- if (!(await fs.lstat(params.filePath, { bigint: true })).isFile()) throw new Error(`Codex runtime artifact contains a non-regular file: ${params.filePath}`);
69
+ if (!(await fs$1.lstat(params.filePath, { bigint: true })).isFile()) throw new Error(`Codex runtime artifact contains a non-regular file: ${params.filePath}`);
70
70
  const flags = constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0);
71
- const handle = await fs.open(params.filePath, flags);
71
+ const handle = await fs$1.open(params.filePath, flags);
72
72
  try {
73
73
  const before = await handle.stat({ bigint: true });
74
74
  if (!before.isFile()) throw new Error(`Codex runtime artifact contains a non-regular file: ${params.filePath}`);
@@ -86,7 +86,7 @@ async function readRegularFileFingerprint(params) {
86
86
  offset += BigInt(bytesRead);
87
87
  }
88
88
  const after = await handle.stat({ bigint: true });
89
- const current = await fs.stat(params.filePath, { bigint: true });
89
+ const current = await fs$1.stat(params.filePath, { bigint: true });
90
90
  if (!sameOpenedFile(before, after) || !sameOpenedFile(after, current)) throw new Error(`Codex runtime artifact changed while reading: ${params.filePath}`);
91
91
  params.budget.fileCount += 1;
92
92
  params.budget.totalBytes += after.size;
@@ -105,7 +105,7 @@ async function listPackageFiles(params) {
105
105
  const visit = async (directory, depth) => {
106
106
  throwIfAborted(params.signal);
107
107
  if (depth > MAX_ARTIFACT_DEPTH) throw new Error("Codex runtime artifact exceeds the bounded directory depth");
108
- const entries = await fs.readdir(directory, {
108
+ const entries = await fs$1.readdir(directory, {
109
109
  withFileTypes: true,
110
110
  encoding: "utf8"
111
111
  });
@@ -202,21 +202,21 @@ function attestNodeOptions(value) {
202
202
  }
203
203
  async function hashSelectedArtifactFiles(descriptor, signal) {
204
204
  throwIfAborted(signal);
205
- if (await fs.realpath(descriptor.commandPath) !== descriptor.commandRealPath) throw new Error("Codex runtime launcher selection changed");
205
+ if (await fs$1.realpath(descriptor.commandPath) !== descriptor.commandRealPath) throw new Error("Codex runtime launcher selection changed");
206
206
  const packageRoot = descriptor.packageRoot;
207
207
  if (await resolvePackageRoot(descriptor.nativePath) !== packageRoot) throw new Error("Codex runtime package selection changed");
208
- if (packageRoot && await fs.realpath(packageRoot) !== packageRoot) throw new Error("Codex runtime package root changed");
208
+ if (packageRoot && await fs$1.realpath(packageRoot) !== packageRoot) throw new Error("Codex runtime package root changed");
209
209
  const allFiles = [
210
210
  descriptor.commandRealPath,
211
211
  ...descriptor.invocationPaths,
212
212
  descriptor.nativePath,
213
213
  ...descriptor.codeModeHostPath ? [descriptor.codeModeHostPath] : []
214
214
  ];
215
- for (const filePath of allFiles) if (await fs.realpath(filePath) !== filePath) throw new Error(`Codex runtime artifact file selection changed: ${filePath}`);
215
+ for (const filePath of allFiles) if (await fs$1.realpath(filePath) !== filePath) throw new Error(`Codex runtime artifact file selection changed: ${filePath}`);
216
216
  if (descriptor.codeModeHostPath) {
217
- if (await fs.realpath(descriptor.codeModeHostCandidatePath) !== descriptor.codeModeHostPath) throw new Error("Codex code-mode host selection changed");
217
+ if (await fs$1.realpath(descriptor.codeModeHostCandidatePath) !== descriptor.codeModeHostPath) throw new Error("Codex code-mode host selection changed");
218
218
  } else try {
219
- await fs.lstat(descriptor.codeModeHostCandidatePath);
219
+ await fs$1.lstat(descriptor.codeModeHostCandidatePath);
220
220
  throw new Error("Codex code-mode host selection changed");
221
221
  } catch (error) {
222
222
  if (!isMissingPathError(error)) throw error;
@@ -283,7 +283,7 @@ async function resolveCommandPath(command, env, cwd) {
283
283
  const entryPath = entry === "" ? cwd : path.isAbsolute(entry) ? entry : path.resolve(cwd, entry);
284
284
  const possible = path.join(entryPath, command);
285
285
  try {
286
- await fs.access(possible, constants.X_OK);
286
+ await fs$1.access(possible, constants.X_OK);
287
287
  candidate = possible;
288
288
  break;
289
289
  } catch {}
@@ -291,11 +291,11 @@ async function resolveCommandPath(command, env, cwd) {
291
291
  }
292
292
  if (!candidate) throw new Error(`Codex runtime launcher is unavailable: ${command}`);
293
293
  const absolute = path.resolve(candidate);
294
- if (!(await fs.stat(absolute)).isFile()) throw new Error(`Codex runtime launcher is not a regular file: ${absolute}`);
294
+ if (!(await fs$1.stat(absolute)).isFile()) throw new Error(`Codex runtime launcher is not a regular file: ${absolute}`);
295
295
  return absolute;
296
296
  }
297
297
  async function readShebang(filePath) {
298
- const handle = await fs.open(filePath, "r");
298
+ const handle = await fs$1.open(filePath, "r");
299
299
  try {
300
300
  const buffer = Buffer.alloc(4096);
301
301
  const { bytesRead } = await handle.read(buffer, 0, buffer.length, 0);
@@ -314,7 +314,7 @@ async function resolvePosixInvocationPaths(params) {
314
314
  if (!shebang) return paths;
315
315
  if (!params.nativeCommand) throw new Error("Codex runtime cannot attest a custom script launcher without its native target");
316
316
  const interpreter = await resolveCommandPath(shebang[0], params.env, params.cwd);
317
- paths.push(await fs.realpath(interpreter));
317
+ paths.push(await fs$1.realpath(interpreter));
318
318
  if (path.basename(interpreter) !== "env") {
319
319
  if (shebang.length !== 1) throw new Error("Codex runtime launcher uses unsupported interpreter arguments");
320
320
  return paths;
@@ -324,7 +324,7 @@ async function resolvePosixInvocationPaths(params) {
324
324
  const target = envArgs[commandIndex];
325
325
  if (!target || target.startsWith("-") || envArgs.length !== commandIndex + 1) throw new Error("Codex runtime launcher uses unsupported env arguments");
326
326
  const targetPath = await resolveCommandPath(target, params.env, params.cwd);
327
- paths.push(await fs.realpath(targetPath));
327
+ paths.push(await fs$1.realpath(targetPath));
328
328
  return paths;
329
329
  }
330
330
  async function resolvePackageRoot(nativePath) {
@@ -333,8 +333,8 @@ async function resolvePackageRoot(nativePath) {
333
333
  const candidate = path.dirname(binDir);
334
334
  const metadataPath = path.join(candidate, "codex-package.json");
335
335
  try {
336
- if (!(await fs.lstat(metadataPath)).isFile()) return;
337
- const root = await fs.realpath(candidate);
336
+ if (!(await fs$1.lstat(metadataPath)).isFile()) return;
337
+ const root = await fs$1.realpath(candidate);
338
338
  return isPathInside(root, nativePath) ? root : void 0;
339
339
  } catch {
340
340
  return;
@@ -342,8 +342,8 @@ async function resolvePackageRoot(nativePath) {
342
342
  }
343
343
  async function resolveOptionalRegularFile(filePath) {
344
344
  try {
345
- const canonical = await fs.realpath(filePath);
346
- return (await fs.stat(canonical)).isFile() ? canonical : void 0;
345
+ const canonical = await fs$1.realpath(filePath);
346
+ return (await fs$1.stat(canonical)).isFile() ? canonical : void 0;
347
347
  } catch {
348
348
  return;
349
349
  }
@@ -363,7 +363,7 @@ async function captureFilesystemDescriptor(params) {
363
363
  assertSafeNodeOptions(env);
364
364
  const spawnCwd = path.resolve(params.startOptions.cwd ?? process.cwd());
365
365
  const commandPath = await resolveCommandPath(params.startOptions.command, env, spawnCwd);
366
- const commandRealPath = await fs.realpath(commandPath);
366
+ const commandRealPath = await fs$1.realpath(commandPath);
367
367
  let nativeCommand = params.spawnIdentity.nativeCommand;
368
368
  let nativeCandidate = commandRealPath;
369
369
  let invocationPaths;
@@ -376,7 +376,7 @@ async function captureFilesystemDescriptor(params) {
376
376
  packageName: "@openai/codex"
377
377
  });
378
378
  const entrypoint = program.leadingArgv[0];
379
- if (program.resolution === "node-entrypoint" && entrypoint && !nativeCommand) nativeCommand = resolvePackagedCodexNativeCommand(await fs.realpath(entrypoint));
379
+ if (program.resolution === "node-entrypoint" && entrypoint && !nativeCommand) nativeCommand = resolvePackagedCodexNativeCommand(await fs$1.realpath(entrypoint));
380
380
  if (program.resolution === "node-entrypoint" && !nativeCommand) throw new Error("Codex runtime cannot attest a custom Node launcher without its native target");
381
381
  nativeCandidate = program.command;
382
382
  const invocationCandidates = [
@@ -387,7 +387,7 @@ async function captureFilesystemDescriptor(params) {
387
387
  invocationPaths = [];
388
388
  for (const candidate of invocationCandidates) {
389
389
  const resolved = await resolveCommandPath(candidate, env, spawnCwd);
390
- invocationPaths.push(await fs.realpath(resolved));
390
+ invocationPaths.push(await fs$1.realpath(resolved));
391
391
  }
392
392
  } else {
393
393
  nativeCommand ??= resolvePackagedCodexNativeCommand(commandRealPath);
@@ -400,7 +400,7 @@ async function captureFilesystemDescriptor(params) {
400
400
  }
401
401
  invocationPaths = [...new Set(invocationPaths)].toSorted(compareArtifactNames);
402
402
  if (invocationPaths.length > MAX_ARTIFACT_INVOCATION_PATHS) throw new Error("Codex runtime launcher exceeds the bounded invocation file count");
403
- const nativePath = await fs.realpath(await resolveCommandPath(nativeCommand ?? nativeCandidate, env, spawnCwd));
403
+ const nativePath = await fs$1.realpath(await resolveCommandPath(nativeCommand ?? nativeCandidate, env, spawnCwd));
404
404
  const packageRoot = await resolvePackageRoot(nativePath);
405
405
  const configuredCodeModeHost = readEffectiveSpawnEnvironmentValue(env, CODE_MODE_HOST_PATH_ENV)?.trim();
406
406
  const adjacentCodeModeHost = path.join(path.dirname(nativePath), process.platform === "win32" ? "codex-code-mode-host.exe" : "codex-code-mode-host");
@@ -0,0 +1,165 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
+ import { y as isCodexRemoteExecPlacementSandbox } from "./protocol-CAAcVIKF.js";
3
+ import { n as resolveCodexNativeExecutionPolicy, t as formatCodexNativeNodeExecBlock } from "./native-execution-policy-umd0tgh4.js";
4
+ import { tryResolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
5
+ import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
6
+ import { resolveSandboxRuntimeStatus } from "openclaw/plugin-sdk/sandbox";
7
+ //#region extensions/codex/src/app-server/sandbox-guard.ts
8
+ /**
9
+ * Blocks direct Codex app-server requests that would bypass OpenClaw sandbox or
10
+ * node-exec routing guarantees.
11
+ */
12
+ var sandbox_guard_exports = /* @__PURE__ */ __exportAll({
13
+ resolveCodexAppServerDirectSandboxBypassBlock: () => resolveCodexAppServerDirectSandboxBypassBlock,
14
+ resolveCodexNativeExecutionBlock: () => resolveCodexNativeExecutionBlock,
15
+ resolveCodexNativeSandboxBlock: () => resolveCodexNativeSandboxBlock
16
+ });
17
+ const DIRECT_METHOD_POLICIES = /* @__PURE__ */ new Map([
18
+ ["account/rateLimits/read", "allowed-control-plane"],
19
+ ["account/read", "allowed-control-plane"],
20
+ ["app/installed", "allowed-control-plane"],
21
+ ["app/list", "allowed-control-plane"],
22
+ ["app/read", "allowed-control-plane"],
23
+ ["config/batchWrite", "allowed-control-plane"],
24
+ ["config/mcpServer/reload", "allowed-control-plane"],
25
+ ["config/read", "allowed-control-plane"],
26
+ ["config/value/write", "allowed-control-plane"],
27
+ ["environment/add", "allowed-control-plane"],
28
+ ["experimentalFeature/enablement/set", "allowed-control-plane"],
29
+ ["feedback/upload", "allowed-control-plane"],
30
+ ["hooks/list", "allowed-control-plane"],
31
+ ["initialize", "allowed-control-plane"],
32
+ ["marketplace/add", "allowed-control-plane"],
33
+ ["mcpServerStatus/list", "allowed-control-plane"],
34
+ ["model/list", "allowed-control-plane"],
35
+ ["plugin/install", "allowed-control-plane"],
36
+ ["plugin/installed", "allowed-control-plane"],
37
+ ["plugin/list", "allowed-control-plane"],
38
+ ["plugin/read", "allowed-control-plane"],
39
+ ["skills/list", "allowed-control-plane"],
40
+ ["thread/archive", "allowed-control-plane"],
41
+ ["thread/inject_items", "allowed-control-plane"],
42
+ ["thread/list", "allowed-control-plane"],
43
+ ["thread/metadata/update", "allowed-control-plane"],
44
+ ["thread/name/set", "allowed-control-plane"],
45
+ ["thread/read", "allowed-control-plane"],
46
+ ["thread/rollback", "allowed-control-plane"],
47
+ ["thread/start", "requires-openclaw-environment"],
48
+ ["thread/unarchive", "allowed-control-plane"],
49
+ ["thread/unsubscribe", "allowed-control-plane"],
50
+ ["turn/interrupt", "allowed-control-plane"],
51
+ ["turn/steer", "allowed-control-plane"],
52
+ ["command/exec", "blocked-native-bypass"],
53
+ ["command/resize", "blocked-native-bypass"],
54
+ ["command/terminate", "blocked-native-bypass"],
55
+ ["command/write", "blocked-native-bypass"],
56
+ ["fuzzyFileSearch", "blocked-native-bypass"],
57
+ ["mcpServer/resource/read", "blocked-native-bypass"],
58
+ ["mcpServer/tool/call", "blocked-native-bypass"],
59
+ ["process/kill", "blocked-native-bypass"],
60
+ ["process/resizePty", "blocked-native-bypass"],
61
+ ["process/spawn", "blocked-native-bypass"],
62
+ ["process/writeStdin", "blocked-native-bypass"],
63
+ ["review/start", "blocked-native-bypass"],
64
+ ["thread/compact/start", "blocked-native-bypass"],
65
+ ["thread/fork", "blocked-native-bypass"],
66
+ ["thread/resume", "blocked-native-bypass"],
67
+ ["thread/shellCommand", "blocked-native-bypass"],
68
+ ["turn/start", "blocked-native-bypass"]
69
+ ]);
70
+ const BLOCKED_DIRECT_METHOD_PREFIXES = [
71
+ "command/",
72
+ "fs/",
73
+ "windowsSandbox/"
74
+ ];
75
+ const NODE_EXEC_BLOCKED_CONTROL_PLANE_METHODS = /* @__PURE__ */ new Set(["config/mcpServer/reload"]);
76
+ /** Returns a block message when a direct app-server method would bypass OpenClaw execution policy. */
77
+ function resolveCodexAppServerDirectSandboxBypassBlock(params) {
78
+ const policy = resolveDirectMethodPolicy(params.method);
79
+ if (NODE_EXEC_BLOCKED_CONTROL_PLANE_METHODS.has(params.method)) {
80
+ const nodeExecBlock = resolveCodexNativeNodeExecBlock({
81
+ config: params.config,
82
+ sessionKey: params.sessionKey,
83
+ sessionId: params.sessionId,
84
+ surface: `app-server method \`${params.method}\``
85
+ });
86
+ if (nodeExecBlock) return nodeExecBlock;
87
+ }
88
+ if (policy === "allowed-control-plane") return;
89
+ const nodeExecBlock = resolveCodexNativeNodeExecBlock({
90
+ config: params.config,
91
+ sessionKey: params.sessionKey,
92
+ sessionId: params.sessionId,
93
+ surface: `app-server method \`${params.method}\``
94
+ });
95
+ if (nodeExecBlock) return nodeExecBlock;
96
+ const sessionKey = params.sessionKey?.trim() || params.sessionId?.trim();
97
+ if (!sessionKey) return;
98
+ const sandboxBlock = resolveCodexNativeSandboxBlock({
99
+ config: params.config,
100
+ sessionKey,
101
+ sandbox: params.sandbox,
102
+ surface: `app-server method \`${params.method}\``
103
+ });
104
+ if (!sandboxBlock) return;
105
+ if (policy === "requires-openclaw-environment" && hasOpenClawSandboxEnvironmentSelection(params.requestParams)) return;
106
+ return sandboxBlock;
107
+ }
108
+ /** Resolves the generic native-execution block for sandboxed or node-hosted sessions. */
109
+ function resolveCodexNativeExecutionBlock(params) {
110
+ return resolveCodexNativeSandboxBlock(params) ?? resolveCodexNativeNodeExecBlock(params);
111
+ }
112
+ /** Returns a block message when native Codex execution cannot honor active sandboxing. */
113
+ function resolveCodexNativeSandboxBlock(params) {
114
+ if (params.sandboxEnvironmentSelected) return;
115
+ const sessionKey = params.sessionKey?.trim() || params.sessionId?.trim();
116
+ if (!sessionKey) return;
117
+ if (isCodexRemoteExecPlacementSandbox(params.sandbox) || params.sandbox?.enabled === true) return formatCodexNativeSandboxBlock({ surface: params.surface });
118
+ const sandboxAgentId = parseAgentSessionKey(sessionKey)?.agentId ?? params.agentId ?? tryResolveDefaultAgentId(params.config ?? {});
119
+ if (!sandboxAgentId) return;
120
+ if (!resolveSandboxRuntimeStatus({
121
+ cfg: params.config,
122
+ sessionKey,
123
+ agentId: sandboxAgentId,
124
+ classificationAgentId: sandboxAgentId
125
+ }).sandboxed) return;
126
+ return formatCodexNativeSandboxBlock({ surface: params.surface });
127
+ }
128
+ function resolveDirectMethodPolicy(method) {
129
+ const exact = DIRECT_METHOD_POLICIES.get(method);
130
+ if (exact) return exact;
131
+ if (BLOCKED_DIRECT_METHOD_PREFIXES.some((prefix) => method.startsWith(prefix))) return "blocked-native-bypass";
132
+ return "blocked-native-bypass";
133
+ }
134
+ function hasOpenClawSandboxEnvironmentSelection(value) {
135
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
136
+ const environments = value.environments;
137
+ return Array.isArray(environments) && environments.length > 0 && environments.every((entry) => {
138
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) return false;
139
+ const environment = entry;
140
+ return typeof environment.environmentId === "string" && environment.environmentId.startsWith("openclaw-sandbox-") && typeof environment.cwd === "string" && environment.cwd.trim().length > 0;
141
+ });
142
+ }
143
+ function formatCodexNativeSandboxBlock(params) {
144
+ return [
145
+ `Codex-native ${params.surface} is unavailable because OpenClaw sandboxing is active for this session.`,
146
+ "This mode cannot route execution through the OpenClaw sandbox backend.",
147
+ "Use a normal Codex harness turn, or run an intentionally unsandboxed session."
148
+ ].join(" ");
149
+ }
150
+ function resolveCodexNativeNodeExecBlock(params) {
151
+ const sessionKey = params.sessionKey?.trim() || params.sessionId?.trim();
152
+ const policy = resolveCodexNativeExecutionPolicy({
153
+ config: params.config,
154
+ sessionKey,
155
+ agentId: params.agentId,
156
+ readRuntimeSessionEntry: Boolean(sessionKey)
157
+ });
158
+ if (policy.nativeToolSurfaceAllowed) return;
159
+ return formatCodexNativeNodeExecBlock({
160
+ surface: params.surface,
161
+ reason: policy.blockReason
162
+ });
163
+ }
164
+ //#endregion
165
+ export { resolveCodexNativeSandboxBlock as n, sandbox_guard_exports as r, resolveCodexNativeExecutionBlock as t };
@@ -1,12 +1,13 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
2
  import { g as CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN } from "./config-utils-C57JiJrU.js";
3
- import { a as readCodexBindingTimestamp, c as readStoredCodexAppServerBinding, d as validateBindingForWrite, i as readCodexBindingSessionEntry, l as sessionBindingIdentity, n as ownsStoredSessionGeneration, o as readCodexSessionOwnershipBinding, r as readCodexAppServerThreadBinding, s as readCurrentCodexAppServerBinding, t as bindingStoreKey, u as stripUndefinedBinding } from "./session-binding-record-CyaXZvTe.js";
3
+ import { a as readCodexAppServerThreadBinding, c as readStoredCodexAppServerBinding, d as validateBindingForWrite, i as ownsStoredSessionGeneration, l as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as readCodexBindingTimestamp, r as bindingStoreKey, s as readCurrentCodexAppServerBinding, t as CodexSupervisionBindingReplacementError, u as stripUndefinedBinding } from "./session-binding-record-CaZjYwNS.js";
4
4
  import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./session-binding-meta-B7aEMU7g.js";
5
+ import { n as normalizeCodexAppServerBindingModelProvider } from "./auth-profile-CwzO4_RG.js";
5
6
  import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
6
7
  import { createHash, randomUUID } from "node:crypto";
7
- import { AgentHarnessPreflightError, AgentHarnessSessionSupersededError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
8
8
  import { isDeepStrictEqual } from "node:util";
9
- import { ensureAuthProfileStore, resolveDefaultAgentDir, resolveProviderIdForAuth } from "openclaw/plugin-sdk/agent-runtime";
9
+ import { AgentHarnessSessionSupersededError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
10
+ import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
10
11
  import { AsyncLocalStorage } from "node:async_hooks";
11
12
  //#region extensions/codex/src/app-server/session-binding.ts
12
13
  /** SQLite-backed Codex app-server thread bindings. */
@@ -21,8 +22,6 @@ var session_binding_exports = /* @__PURE__ */ __exportAll({
21
22
  createCodexSessionGenerationSupersededError: () => createCodexSessionGenerationSupersededError,
22
23
  createStoredCodexAppServerBinding: () => createStoredCodexAppServerBinding,
23
24
  hashCodexAppServerBindingFingerprint: () => hashCodexAppServerBindingFingerprint,
24
- isCodexAppServerNativeAuthProfile: () => isCodexAppServerNativeAuthProfile,
25
- normalizeCodexAppServerBindingModelProvider: () => normalizeCodexAppServerBindingModelProvider,
26
25
  normalizeStoredCodexAppServerBindingFingerprints: () => normalizeStoredCodexAppServerBindingFingerprints,
27
26
  readCodexAppServerThreadBinding: () => readCodexAppServerThreadBinding,
28
27
  readStoredCodexAppServerBinding: () => readStoredCodexAppServerBinding,
@@ -33,8 +32,6 @@ var session_binding_exports = /* @__PURE__ */ __exportAll({
33
32
  sessionBindingIdentity: () => sessionBindingIdentity,
34
33
  validateBindingForWrite: () => validateBindingForWrite
35
34
  });
36
- const CODEX_APP_SERVER_NATIVE_AUTH_PROVIDER = "openai";
37
- const PUBLIC_OPENAI_MODEL_PROVIDER = "openai";
38
35
  const BINDING_LEASE_RETRY_INTERVAL_MS = 1e3;
39
36
  const BOUNDED_BINDING_FINGERPRINT_PATTERN = /^sha256:[a-f0-9]{64}$/i;
40
37
  const CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS = 6e4;
@@ -46,6 +43,30 @@ const PHYSICAL_SESSION_RETIRE_TTL_MS = BINDING_LEASE_WAIT_MS;
46
43
  function resolveCodexRunSessionBindingAuthority(params) {
47
44
  return captureCodexSessionGenerationAuthority(params)[0];
48
45
  }
46
+ /** Host lineage is recorded in the same transaction as its successor generation. */
47
+ function readCodexBindingSessionEntry(params) {
48
+ const { identity } = params;
49
+ return identity.sessionKey?.trim() ? getSessionEntry({
50
+ agentId: identity.agentId,
51
+ sessionKey: identity.sessionKey.trim(),
52
+ storePath: params.storePath?.trim() || resolveStorePath(params.config?.session?.store, { agentId: identity.agentId }),
53
+ hydrateSkillPromptRefs: false,
54
+ readConsistency: "latest"
55
+ }) : void 0;
56
+ }
57
+ /** Synchronous model selection recognizes the predecessor; admission rewrites its fence. */
58
+ function readCodexSessionOwnershipBinding(params) {
59
+ const binding = params.bindingStore.read(params.identity);
60
+ if (binding || params.identity.kind !== "session") return binding;
61
+ const entry = readCodexBindingSessionEntry({
62
+ ...params,
63
+ identity: params.identity
64
+ });
65
+ return entry?.sessionId === params.identity.sessionId && entry.previousSessionId ? params.bindingStore.read({
66
+ ...params.identity,
67
+ sessionId: entry.previousSessionId
68
+ }) : void 0;
69
+ }
49
70
  function captureCodexSessionGenerationAuthority(params, assertCallerCurrent = () => {}) {
50
71
  const readEntry = () => {
51
72
  try {
@@ -78,16 +99,6 @@ function captureCodexSessionGenerationAuthority(params, assertCallerCurrent = ()
78
99
  function createCodexSessionGenerationSupersededError(sessionId) {
79
100
  return new AgentHarnessSessionSupersededError(`Codex session generation is no longer current: ${sessionId}`);
80
101
  }
81
- var CodexSupervisionBindingReplacementError = class extends Error {
82
- constructor(threadId, operation) {
83
- super(`Refusing to replace supervised Codex thread ${threadId} while ${operation}; its native user-home connection and model ownership must be preserved`);
84
- this.name = "CodexSupervisionBindingReplacementError";
85
- }
86
- };
87
- function assertCodexBindingMayBeReplaced(binding, operation, expected) {
88
- if (expected) throw new AgentHarnessPreflightError(`Codex native model ownership prevents ${operation}. Continue or compact the original session in its native runtime, or create a new chat with a concrete model; the original binding was preserved.`);
89
- if (binding?.connectionScope === "supervision") throw new CodexSupervisionBindingReplacementError(binding.threadId, operation);
90
- }
91
102
  function hashCodexAppServerBindingFingerprint(canonical) {
92
103
  return `sha256:${createHash("sha256").update(canonical).digest("hex")}`;
93
104
  }
@@ -724,34 +735,5 @@ function sleep(ms) {
724
735
  setTimeout(resolve, ms);
725
736
  });
726
737
  }
727
- /** Returns true when an auth profile uses native Codex/OpenAI app-server auth. */
728
- function isCodexAppServerNativeAuthProfile(lookup) {
729
- const authProfileId = lookup.authProfileId?.trim();
730
- if (!authProfileId) return false;
731
- try {
732
- const credential = (lookup.authProfileStore ?? ensureAuthProfileStore(lookup.agentDir?.trim() || resolveDefaultAgentDir(lookup.config ?? {}), {
733
- allowKeychainPrompt: false,
734
- config: lookup.config,
735
- externalCliProviderIds: [CODEX_APP_SERVER_NATIVE_AUTH_PROVIDER],
736
- externalCliProfileIds: [authProfileId]
737
- })).profiles[authProfileId];
738
- if (!credential || credential.type === "api_key") return false;
739
- const provider = credential.provider?.trim();
740
- return Boolean(provider && resolveProviderIdForAuth(provider, { config: lookup.config }) === CODEX_APP_SERVER_NATIVE_AUTH_PROVIDER);
741
- } catch (error) {
742
- embeddedAgentLog.debug("failed to resolve codex app-server auth profile provider", {
743
- authProfileId,
744
- error
745
- });
746
- return false;
747
- }
748
- }
749
- /** Hides redundant OpenAI provider attribution for native Codex auth bindings. */
750
- function normalizeCodexAppServerBindingModelProvider(params) {
751
- const modelProvider = params.modelProvider?.trim();
752
- if (!modelProvider) return;
753
- if (isCodexAppServerNativeAuthProfile(params) && modelProvider.toLowerCase() === PUBLIC_OPENAI_MODEL_PROVIDER) return;
754
- return modelProvider;
755
- }
756
738
  //#endregion
757
- export { isCodexAppServerNativeAuthProfile as a, resolveCodexRunSessionBindingAuthority as c, session_binding_exports as d, hashCodexAppServerBindingFingerprint as i, resolveCodexSessionBinding as l, assertCodexBindingMayBeReplaced as n, normalizeCodexAppServerBindingModelProvider as o, createCodexSessionGenerationSupersededError as r, reclaimCurrentCodexSessionGeneration as s, CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS as t, scopeCodexRunBindingStore as u };
739
+ export { resolveCodexRunSessionBindingAuthority as a, session_binding_exports as c, reclaimCurrentCodexSessionGeneration as i, createCodexSessionGenerationSupersededError as n, resolveCodexSessionBinding as o, hashCodexAppServerBindingFingerprint as r, scopeCodexRunBindingStore as s, CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS as t };
@@ -1,7 +1,7 @@
1
1
  import { g as CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN, i as normalizeCodexServiceTier } from "./config-utils-C57JiJrU.js";
2
2
  import { createHash } from "node:crypto";
3
+ import { AgentHarnessPreflightError } from "openclaw/plugin-sdk/agent-harness-registration";
3
4
  import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
4
- import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
5
5
  import { z } from "zod";
6
6
  //#region extensions/codex/src/app-server/session-binding-record.ts
7
7
  /** Canonical binding codec and synchronous generation-aware reads; no lifecycle or auth loading. */
@@ -242,29 +242,15 @@ function readCurrentCodexAppServerBinding(state, identity) {
242
242
  if (raw !== void 0 && !stored) throw new Error(`Invalid Codex app-server binding row: ${key}`);
243
243
  return stored?.state === "active" && ownsStoredSessionGeneration(identity, stored) ? stored.binding : void 0;
244
244
  }
245
- /** Host lineage is recorded in the same transaction as its successor generation. */
246
- function readCodexBindingSessionEntry(params) {
247
- const { identity } = params;
248
- return identity.sessionKey?.trim() ? getSessionEntry({
249
- agentId: identity.agentId,
250
- sessionKey: identity.sessionKey.trim(),
251
- storePath: params.storePath?.trim() || resolveStorePath(params.config?.session?.store, { agentId: identity.agentId }),
252
- hydrateSkillPromptRefs: false,
253
- readConsistency: "latest"
254
- }) : void 0;
255
- }
256
- /** Synchronous model selection recognizes the predecessor; admission rewrites its fence. */
257
- function readCodexSessionOwnershipBinding(params) {
258
- const binding = params.bindingStore.read(params.identity);
259
- if (binding || params.identity.kind !== "session") return binding;
260
- const entry = readCodexBindingSessionEntry({
261
- ...params,
262
- identity: params.identity
263
- });
264
- return entry?.sessionId === params.identity.sessionId && entry.previousSessionId ? params.bindingStore.read({
265
- ...params.identity,
266
- sessionId: entry.previousSessionId
267
- }) : void 0;
245
+ var CodexSupervisionBindingReplacementError = class extends Error {
246
+ constructor(threadId, operation) {
247
+ super(`Refusing to replace supervised Codex thread ${threadId} while ${operation}; its native user-home connection and model ownership must be preserved`);
248
+ this.name = "CodexSupervisionBindingReplacementError";
249
+ }
250
+ };
251
+ function assertCodexBindingMayBeReplaced(binding, operation, expected) {
252
+ if (expected) throw new AgentHarnessPreflightError(`Codex native model ownership prevents ${operation}. Continue or compact the original session in its native runtime, or create a new chat with a concrete model; the original binding was preserved.`);
253
+ if (binding?.connectionScope === "supervision") throw new CodexSupervisionBindingReplacementError(binding.threadId, operation);
268
254
  }
269
255
  //#endregion
270
- export { readCodexBindingTimestamp as a, readStoredCodexAppServerBinding as c, validateBindingForWrite as d, readCodexBindingSessionEntry as i, sessionBindingIdentity as l, ownsStoredSessionGeneration as n, readCodexSessionOwnershipBinding as o, readCodexAppServerThreadBinding as r, readCurrentCodexAppServerBinding as s, bindingStoreKey as t, stripUndefinedBinding as u };
256
+ export { readCodexAppServerThreadBinding as a, readStoredCodexAppServerBinding as c, validateBindingForWrite as d, ownsStoredSessionGeneration as i, sessionBindingIdentity as l, assertCodexBindingMayBeReplaced as n, readCodexBindingTimestamp as o, bindingStoreKey as r, readCurrentCodexAppServerBinding as s, CodexSupervisionBindingReplacementError as t, stripUndefinedBinding as u };