@openclaw/codex 2026.7.2-beta.7 → 2026.8.1-beta.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.
- package/README.md +2 -0
- package/dist/api.js +147 -0
- package/dist/app-server-policy-bg5QPSVP.js +25 -0
- package/dist/attempt-client-cleanup-URjUlCHg.js +735 -0
- package/dist/binding-connection-DAvZwp96.js +45 -0
- package/dist/{bounded-turn-D2ZAgZVz.js → bounded-turn-4BjrZEwW.js} +63 -56
- package/dist/{capabilities-BFDTVYr4.js → capabilities-CH3K57v4.js} +8 -2
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-C336eRVS.js → command-formatters-D0nZ3qtd.js} +18 -18
- package/dist/{command-handlers-DAHUSry9.js → command-handlers-DC86lgT4.js} +507 -101
- package/dist/command-rpc-xUIIonsO.js +90 -0
- package/dist/{compact-D_uvHurS.js → compact-COqgBRny.js} +234 -214
- package/dist/{session-binding-BXpo9ymA.js → config-CpNeo5AE.js} +284 -1163
- package/dist/context-compaction-activity-BOeJf7yo.js +58 -0
- package/dist/{conversation-binding-data-BHRpYbX3.js → conversation-binding-data-CW2GuupV.js} +6 -10
- package/dist/doctor-contract-api.js +48 -50
- package/dist/{dynamic-tools-D2gYkSBO.js → dynamic-tools-fJZhl4CE.js} +3442 -1433
- package/dist/{effective-mcp-catalog-Bbd98Inw.js → effective-mcp-catalog-4YKn51aG.js} +20 -15
- package/dist/elicitation-input-DMkeki8d.js +71 -0
- package/dist/{event-projector-assistant-message-DTgnPPVF.js → event-projector-assistant-message-BwxV4d6N.js} +11 -23
- package/dist/{attempt-notifications-AP-a-Q5k.js → event-projector-usage-CLwNEJqW.js} +113 -29
- package/dist/harness-DoKQcF8n.js +258 -0
- package/dist/harness.js +2 -160
- package/dist/image-payload-sanitizer-CnfoUPCE.js +65 -0
- package/dist/index.js +730 -256
- package/dist/isolated-completion-DPMtlH9r.js +75 -0
- package/dist/local-runtime-attribution-B_2mnqhb.js +19 -0
- package/dist/managed-binary-By4FZC6i.js +212 -0
- package/dist/media-understanding-provider.js +5 -5
- package/dist/model-catalog-CmGoqVKB.js +48 -0
- package/dist/{models-BBMKU4jA.js → models-CZw1wClT.js} +12 -17
- package/dist/native-subagent-monitor-GGq3RnOo.js +3225 -0
- package/dist/node-exec-server.runtime-Bsu1LdFZ.js +192 -0
- package/dist/{plugin-app-cache-key-DztPafOA.js → plugin-app-cache-key-DMNQ8Zi8.js} +18 -6
- package/dist/plugin-approval-roundtrip-C75Yiiwc.js +95 -0
- package/dist/plugin-marketplace-discovery-CSWDkMrP.js +399 -0
- package/dist/{computer-use-CYEc8U3w.js → plugin-metadata-cache-BXH5NF-4.js} +109 -6
- package/dist/protocol-validators-VAVyEnDp.js +2399 -0
- package/dist/{rate-limits-CU-gVCCS.js → rate-limits-BI1dMHDG.js} +17 -35
- package/dist/{request-qKh331yu.js → request-DSK0W6YI.js} +3 -3
- package/dist/{run-attempt-CY9WlDLc.js → run-attempt-BV3HzuCf.js} +3416 -7194
- package/dist/{runtime-artifact-CmtG_t1L.js → runtime-artifact-BvyT1uyd.js} +11 -29
- package/dist/{sandbox-guard-NuhpXmPB.js → sandbox-guard-C1qEeZ5C.js} +29 -30
- package/dist/session-binding-BTrLf9Qm.js +874 -0
- package/dist/{session-catalog-DyOgR4WH.js → session-catalog-ezP_UcRM.js} +1584 -1289
- package/dist/session-catalog-home-id-BNwAJ9D7.js +18 -0
- package/dist/{session-cli-2PZaFLRh.js → session-cli-B1hKvfkI.js} +20 -7
- package/dist/session-retirement-CE4iMiLh.js +36 -0
- package/dist/{session-upstream-marker-B6U7tLw5.js → session-upstream-marker-D_2npHlA.js} +1 -1
- package/dist/{settled-turn-finalizer-CXY2Z9dT.js → settled-turn-finalizer-Dx1onIqg.js} +40 -28
- package/dist/{shared-client-DTbvH-XV.js → shared-client-Dw-rzii0.js} +1315 -469
- package/dist/{side-question-_ulBk1AL.js → side-question-DbXkJZzg.js} +140 -69
- package/dist/{thread-lifecycle-DF53ogiA.js → thread-lifecycle-DKdrnTMX.js} +927 -768
- package/dist/thread-ownership-i2NBwDUL.js +92 -0
- package/dist/thread-resume-CdJk2Ehf.js +30 -0
- package/dist/transcript-mirror-BU0_LKAL.js +588 -0
- package/dist/{transport-stdio-DXgGZ7Ib.js → transport-stdio-DhoGy33Z.js} +13 -2
- package/dist/upstream-prompt-provenance-CFmsKwr9.js +39 -0
- package/dist/{upstream-session-fork-Dy4Xvuoj.js → upstream-session-fork-BDVJCLAD.js} +14 -8
- package/dist/{usage-CQ6GhD5-.js → usage-9dKJCgcy.js} +3 -3
- package/dist/{web-search-provider.runtime-CCFhg2z5.js → web-search-provider.runtime-DCdx4DGu.js} +8 -9
- package/openclaw.plugin.json +49 -4
- package/package.json +6 -5
- package/dist/app-server-policy-BSaO2JIT.js +0 -49
- package/dist/conversation-control-xsIeXbo4.js +0 -287
- package/dist/event-projector-usage-Xp4AlR2k.js +0 -86
- package/dist/notification-correlation-CU6_AnOb.js +0 -67
- package/dist/transcript-mirror-DzsdNCf5.js +0 -6924
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-
|
|
1
|
+
import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-DhoGy33Z.js";
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
import { constants } from "node:fs";
|
|
6
6
|
import { resolveWindowsExecutablePath, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
|
|
7
|
+
import { isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
|
|
7
8
|
//#region extensions/codex/src/app-server/runtime-artifact.ts
|
|
8
9
|
/** Exact local runtime artifact identity for verified Codex setup turns. */
|
|
9
10
|
const ARTIFACT_ID_PREFIX = "codex-app-server:v1:";
|
|
@@ -17,17 +18,6 @@ const MAX_ARTIFACT_FILES = 8192;
|
|
|
17
18
|
const MAX_ARTIFACT_TOTAL_BYTES = 1024n * 1024n * 1024n;
|
|
18
19
|
const READ_CHUNK_BYTES = 64 * 1024;
|
|
19
20
|
const CODE_MODE_HOST_PATH_ENV = "CODEX_CODE_MODE_HOST_PATH";
|
|
20
|
-
const RUNTIME_INJECTION_ENV_KEYS = /* @__PURE__ */ new Set([
|
|
21
|
-
"NODE_PATH",
|
|
22
|
-
"LD_AUDIT",
|
|
23
|
-
"LD_LIBRARY_PATH",
|
|
24
|
-
"LD_PRELOAD",
|
|
25
|
-
"DYLD_FALLBACK_FRAMEWORK_PATH",
|
|
26
|
-
"DYLD_FALLBACK_LIBRARY_PATH",
|
|
27
|
-
"DYLD_FRAMEWORK_PATH",
|
|
28
|
-
"DYLD_INSERT_LIBRARIES",
|
|
29
|
-
"DYLD_LIBRARY_PATH"
|
|
30
|
-
]);
|
|
31
21
|
const SAFE_NODE_OPTIONS_BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
|
|
32
22
|
"--enable-network-family-autoselection",
|
|
33
23
|
"--network-family-autoselection",
|
|
@@ -134,21 +124,13 @@ async function listPackageFiles(params) {
|
|
|
134
124
|
await visit(params.rootPath, 0);
|
|
135
125
|
return files;
|
|
136
126
|
}
|
|
137
|
-
function
|
|
138
|
-
const relative = path.relative(rootPath, candidatePath);
|
|
139
|
-
return relative === "" || !path.isAbsolute(relative) && !relative.startsWith(`..${path.sep}`) && relative !== "..";
|
|
140
|
-
}
|
|
141
|
-
function assertNoRuntimeInjectionEnvironment(env) {
|
|
127
|
+
function assertSafeNodeOptions(env) {
|
|
142
128
|
for (const [rawKey, value] of Object.entries(env)) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if (
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (result.option) throw new Error(`Codex runtime artifact cannot attest NODE_OPTIONS option ${result.option}`);
|
|
149
|
-
throw new Error("Codex runtime artifact cannot safely parse NODE_OPTIONS");
|
|
150
|
-
}
|
|
151
|
-
if (RUNTIME_INJECTION_ENV_KEYS.has(key) || key.startsWith("DYLD_")) throw new Error(`Codex runtime artifact cannot attest injected runtime environment: ${key}`);
|
|
129
|
+
if (rawKey.toUpperCase() !== "NODE_OPTIONS" || !value?.trim()) continue;
|
|
130
|
+
const result = attestNodeOptions(value);
|
|
131
|
+
if (result.ok) continue;
|
|
132
|
+
if (result.option) throw new Error(`Codex runtime artifact cannot attest NODE_OPTIONS option ${result.option}`);
|
|
133
|
+
throw new Error("Codex runtime artifact cannot safely parse NODE_OPTIONS");
|
|
152
134
|
}
|
|
153
135
|
}
|
|
154
136
|
function parseNodeOptions(value) {
|
|
@@ -238,7 +220,7 @@ async function hashSelectedArtifactFiles(descriptor, signal) {
|
|
|
238
220
|
} catch (error) {
|
|
239
221
|
if (!isMissingPathError(error)) throw error;
|
|
240
222
|
}
|
|
241
|
-
const externalFiles = [...new Set(allFiles)].filter((filePath) => !packageRoot || !
|
|
223
|
+
const externalFiles = [...new Set(allFiles)].filter((filePath) => !packageRoot || !isPathInside(packageRoot, filePath)).toSorted(compareArtifactNames);
|
|
242
224
|
const budget = {
|
|
243
225
|
fileCount: 0,
|
|
244
226
|
totalBytes: 0n
|
|
@@ -352,7 +334,7 @@ async function resolvePackageRoot(nativePath) {
|
|
|
352
334
|
try {
|
|
353
335
|
if (!(await fs.lstat(metadataPath)).isFile()) return;
|
|
354
336
|
const root = await fs.realpath(candidate);
|
|
355
|
-
return
|
|
337
|
+
return isPathInside(root, nativePath) ? root : void 0;
|
|
356
338
|
} catch {
|
|
357
339
|
return;
|
|
358
340
|
}
|
|
@@ -377,7 +359,7 @@ async function captureFilesystemDescriptor(params) {
|
|
|
377
359
|
throwIfAborted(params.signal);
|
|
378
360
|
if (params.startOptions.transport !== "stdio") throw new Error("Verified Codex inference requires a local stdio runtime artifact; WebSocket attestation is unsupported");
|
|
379
361
|
const env = resolveCodexAppServerSpawnEnv(params.startOptions);
|
|
380
|
-
|
|
362
|
+
assertSafeNodeOptions(env);
|
|
381
363
|
const spawnCwd = path.resolve(params.startOptions.cwd ?? process.cwd());
|
|
382
364
|
const commandPath = await resolveCommandPath(params.startOptions.command, env, spawnCwd);
|
|
383
365
|
const commandRealPath = await fs.realpath(commandPath);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { p as isCodexRemoteExecPlacementSandbox } from "./config-CpNeo5AE.js";
|
|
2
|
+
import { resolveAgentConfig, tryResolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
1
3
|
import { getSessionEntry } from "openclaw/plugin-sdk/session-store-runtime";
|
|
4
|
+
import { normalizeAgentId, parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
2
5
|
import { resolveSandboxRuntimeStatus } from "openclaw/plugin-sdk/sandbox";
|
|
3
6
|
//#region extensions/codex/src/app-server/native-execution-policy.ts
|
|
4
|
-
const DEFAULT_AGENT_ID = "main";
|
|
5
|
-
const VALID_AGENT_ID_PATTERN = /^[a-z0-9][a-z0-9_-]{0,63}$/i;
|
|
6
|
-
const INVALID_AGENT_ID_CHARS_PATTERN = /[^a-z0-9_-]+/g;
|
|
7
|
-
const LEADING_DASH_PATTERN = /^-+/;
|
|
8
|
-
const TRAILING_DASH_PATTERN = /-+$/;
|
|
9
7
|
/** Projects node execution ownership into the runtime tool factory options. */
|
|
10
8
|
function resolveCodexNodeExecToolOverrides(policy) {
|
|
11
9
|
if (policy.effectiveExecHost !== "node") return;
|
|
@@ -24,23 +22,26 @@ function resolveCodexNativeExecutionPolicy(params) {
|
|
|
24
22
|
sessionKey,
|
|
25
23
|
agentId: params.agentId
|
|
26
24
|
});
|
|
27
|
-
const canReadSessionEntry = params.readRuntimeSessionEntry && shouldReadRuntimeSessionEntry({
|
|
25
|
+
const canReadSessionEntry = Boolean(agentId) && params.readRuntimeSessionEntry && shouldReadRuntimeSessionEntry({
|
|
28
26
|
config,
|
|
29
27
|
sessionKey,
|
|
30
|
-
agentId
|
|
28
|
+
agentId
|
|
31
29
|
});
|
|
32
|
-
const sessionEntry = params.sessionEntry ?? (canReadSessionEntry && sessionKey ? readRuntimeSessionEntryBestEffort({
|
|
30
|
+
const sessionEntry = params.sessionEntry ?? (canReadSessionEntry && sessionKey && agentId ? readRuntimeSessionEntryBestEffort({
|
|
33
31
|
sessionKey,
|
|
34
32
|
agentId
|
|
35
33
|
}) : void 0);
|
|
36
|
-
const
|
|
34
|
+
const sandboxAgentId = parseAgentSessionKey(sessionKey)?.agentId ?? agentId;
|
|
35
|
+
const sandboxAvailable = params.sandboxAvailable ?? (sessionKey && sandboxAgentId ? resolveSandboxRuntimeStatus({
|
|
37
36
|
cfg: config,
|
|
38
|
-
sessionKey
|
|
37
|
+
sessionKey,
|
|
38
|
+
agentId: sandboxAgentId,
|
|
39
|
+
classificationAgentId: sandboxAgentId
|
|
39
40
|
}).sandboxed : false);
|
|
40
|
-
const agentExec = resolvePolicyAgentExec({
|
|
41
|
+
const agentExec = agentId ? resolvePolicyAgentExec({
|
|
41
42
|
config,
|
|
42
43
|
agentId
|
|
43
|
-
});
|
|
44
|
+
}) : void 0;
|
|
44
45
|
const globalExec = config.tools?.exec;
|
|
45
46
|
const requestedExecHost = normalizeExecTarget(params.execOverrides?.host) ?? normalizeExecTarget(sessionEntry?.execHost) ?? normalizeExecTarget(agentExec?.host) ?? normalizeExecTarget(globalExec?.host) ?? "auto";
|
|
46
47
|
const effectiveExecHost = resolveEffectiveExecHost({
|
|
@@ -75,13 +76,10 @@ function resolvePolicyAgentId(params) {
|
|
|
75
76
|
if (explicitAgentId) return explicitAgentId;
|
|
76
77
|
const sessionAgentId = parseAgentIdFromSessionKey(params.sessionKey);
|
|
77
78
|
if (sessionAgentId) return sessionAgentId;
|
|
78
|
-
return
|
|
79
|
+
return tryResolveDefaultAgentId(params.config);
|
|
79
80
|
}
|
|
80
81
|
function resolvePolicyAgentExec(params) {
|
|
81
|
-
return
|
|
82
|
-
}
|
|
83
|
-
function listAgentEntries(config) {
|
|
84
|
-
return (config.agents?.list ?? []).filter((entry) => entry !== null && typeof entry === "object");
|
|
82
|
+
return resolveAgentConfig(params.config, params.agentId)?.tools?.exec;
|
|
85
83
|
}
|
|
86
84
|
function parseAgentIdFromSessionKey(sessionKey) {
|
|
87
85
|
const raw = sessionKey?.trim();
|
|
@@ -102,21 +100,11 @@ function shouldReadRuntimeSessionEntry(params) {
|
|
|
102
100
|
return sessionAgentId === explicitAgentId;
|
|
103
101
|
}
|
|
104
102
|
function isDefaultAgentSessionKeyForAgent(params) {
|
|
105
|
-
return normalizeAgentId(params.agentId) ===
|
|
106
|
-
}
|
|
107
|
-
function resolveDefaultPolicyAgentId(agents) {
|
|
108
|
-
return normalizeAgentId((agents.find((entry) => entry?.default) ?? agents[0])?.id);
|
|
103
|
+
return normalizeAgentId(params.agentId) === tryResolveDefaultAgentId(params.config);
|
|
109
104
|
}
|
|
110
105
|
function normalizeAgentIdOrDefault(value) {
|
|
111
106
|
const normalized = normalizeAgentId(value);
|
|
112
|
-
return normalized ===
|
|
113
|
-
}
|
|
114
|
-
function normalizeAgentId(value) {
|
|
115
|
-
const trimmed = (value ?? "").trim();
|
|
116
|
-
if (!trimmed) return DEFAULT_AGENT_ID;
|
|
117
|
-
const normalized = trimmed.toLowerCase();
|
|
118
|
-
if (VALID_AGENT_ID_PATTERN.test(trimmed)) return normalized;
|
|
119
|
-
return normalized.replace(INVALID_AGENT_ID_CHARS_PATTERN, "-").replace(LEADING_DASH_PATTERN, "").replace(TRAILING_DASH_PATTERN, "").slice(0, 64) || DEFAULT_AGENT_ID;
|
|
107
|
+
return normalized === "main" && !(value ?? "").trim() ? void 0 : normalized;
|
|
120
108
|
}
|
|
121
109
|
function normalizeExecTarget(value) {
|
|
122
110
|
const normalized = value?.trim().toLowerCase();
|
|
@@ -139,6 +127,10 @@ function readRuntimeSessionEntryBestEffort(params) {
|
|
|
139
127
|
}
|
|
140
128
|
//#endregion
|
|
141
129
|
//#region extensions/codex/src/app-server/sandbox-guard.ts
|
|
130
|
+
/**
|
|
131
|
+
* Blocks direct Codex app-server requests that would bypass OpenClaw sandbox or
|
|
132
|
+
* node-exec routing guarantees.
|
|
133
|
+
*/
|
|
142
134
|
const DIRECT_METHOD_POLICIES = /* @__PURE__ */ new Map([
|
|
143
135
|
["account/rateLimits/read", "allowed-control-plane"],
|
|
144
136
|
["account/read", "allowed-control-plane"],
|
|
@@ -223,6 +215,7 @@ function resolveCodexAppServerDirectSandboxBypassBlock(params) {
|
|
|
223
215
|
const sandboxBlock = resolveCodexNativeSandboxBlock({
|
|
224
216
|
config: params.config,
|
|
225
217
|
sessionKey,
|
|
218
|
+
sandbox: params.sandbox,
|
|
226
219
|
surface: `app-server method \`${params.method}\``
|
|
227
220
|
});
|
|
228
221
|
if (!sandboxBlock) return;
|
|
@@ -235,11 +228,17 @@ function resolveCodexNativeExecutionBlock(params) {
|
|
|
235
228
|
}
|
|
236
229
|
/** Returns a block message when native Codex execution cannot honor active sandboxing. */
|
|
237
230
|
function resolveCodexNativeSandboxBlock(params) {
|
|
231
|
+
if (params.sandboxEnvironmentSelected) return;
|
|
238
232
|
const sessionKey = params.sessionKey?.trim() || params.sessionId?.trim();
|
|
239
233
|
if (!sessionKey) return;
|
|
234
|
+
if (isCodexRemoteExecPlacementSandbox(params.sandbox) || params.sandbox?.enabled === true) return formatCodexNativeSandboxBlock({ surface: params.surface });
|
|
235
|
+
const sandboxAgentId = parseAgentSessionKey(sessionKey)?.agentId ?? params.agentId ?? tryResolveDefaultAgentId(params.config ?? {});
|
|
236
|
+
if (!sandboxAgentId) return;
|
|
240
237
|
if (!resolveSandboxRuntimeStatus({
|
|
241
238
|
cfg: params.config,
|
|
242
|
-
sessionKey
|
|
239
|
+
sessionKey,
|
|
240
|
+
agentId: sandboxAgentId,
|
|
241
|
+
classificationAgentId: sandboxAgentId
|
|
243
242
|
}).sandboxed) return;
|
|
244
243
|
return formatCodexNativeSandboxBlock({ surface: params.surface });
|
|
245
244
|
}
|