@openclaw/codex 2026.7.2-beta.7 → 2026.8.1-beta.2
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/{app-server-policy-BSaO2JIT.js → app-server-policy-zcBDc1JU.js} +1 -1
- package/dist/attempt-client-cleanup-DMLXUfa8.js +735 -0
- package/dist/{notification-correlation-CU6_AnOb.js → binding-connection-I5Bo-AsX.js} +3 -37
- package/dist/{bounded-turn-D2ZAgZVz.js → bounded-turn-qgZmzy_4.js} +50 -49
- package/dist/{capabilities-BFDTVYr4.js → capabilities-CybGI1oz.js} +8 -2
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-C336eRVS.js → command-formatters-B1AEz8ZA.js} +18 -18
- package/dist/{command-handlers-DAHUSry9.js → command-handlers-Db8pu_ds.js} +484 -95
- package/dist/{compact-D_uvHurS.js → compact-LspQaGfl.js} +213 -199
- package/dist/{conversation-binding-data-BHRpYbX3.js → conversation-binding-data-CW2GuupV.js} +6 -10
- package/dist/doctor-contract-api.js +40 -43
- package/dist/{dynamic-tools-D2gYkSBO.js → dynamic-tools-BVdyWkUD.js} +2597 -1221
- package/dist/{effective-mcp-catalog-Bbd98Inw.js → effective-mcp-catalog-DIIhAtOZ.js} +20 -15
- 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-e5huIQWu.js} +113 -29
- package/dist/harness.js +80 -14
- package/dist/image-payload-sanitizer-CnfoUPCE.js +65 -0
- package/dist/index.js +591 -240
- package/dist/isolated-completion-C58NbL40.js +75 -0
- package/dist/local-runtime-attribution-B_2mnqhb.js +19 -0
- package/dist/media-understanding-provider.js +5 -5
- package/dist/{models-BBMKU4jA.js → models-BFlpn1Ex.js} +12 -17
- package/dist/native-subagent-monitor-DyTGmTUx.js +3111 -0
- package/dist/{plugin-app-cache-key-DztPafOA.js → plugin-app-cache-key-C3H2CVp6.js} +5 -5
- package/dist/plugin-marketplace-discovery-CzrGJdCR.js +385 -0
- package/dist/{computer-use-CYEc8U3w.js → plugin-metadata-cache-CNJPj4_b.js} +105 -5
- package/dist/protocol-validators-B4F7L8Rf.js +2346 -0
- package/dist/{rate-limits-CU-gVCCS.js → rate-limits-DZXmOL8-.js} +17 -35
- package/dist/{request-qKh331yu.js → request-BRl5_UfX.js} +3 -3
- package/dist/{run-attempt-CY9WlDLc.js → run-attempt-P8BdxC1I.js} +4837 -9047
- package/dist/{runtime-artifact-CmtG_t1L.js → runtime-artifact-BVSPdd6g.js} +8 -23
- package/dist/{sandbox-guard-NuhpXmPB.js → sandbox-guard-Cmwc9eIk.js} +6 -13
- package/dist/{session-binding-BXpo9ymA.js → session-binding-DPxIvMgE.js} +246 -265
- package/dist/{session-catalog-DyOgR4WH.js → session-catalog-xwNi_SDM.js} +159 -109
- package/dist/{session-cli-2PZaFLRh.js → session-cli-7hgXZDV7.js} +1 -1
- package/dist/session-retirement-DoMMJFKm.js +36 -0
- package/dist/{session-upstream-marker-B6U7tLw5.js → session-upstream-marker-CrIFX06J.js} +1 -1
- package/dist/{settled-turn-finalizer-CXY2Z9dT.js → settled-turn-finalizer-BRWBO4MO.js} +21 -13
- package/dist/{shared-client-DTbvH-XV.js → shared-client-kIBbGjk4.js} +587 -223
- package/dist/{side-question-_ulBk1AL.js → side-question-9HAL26l9.js} +101 -52
- package/dist/{thread-lifecycle-DF53ogiA.js → thread-lifecycle-Bu1BTDXr.js} +694 -753
- package/dist/thread-ownership-6kOQHlyC.js +92 -0
- package/dist/thread-resume-CPrJNQVM.js +30 -0
- package/dist/transcript-mirror-B9gGgnJS.js +570 -0
- package/dist/{transport-stdio-DXgGZ7Ib.js → transport-stdio-DIImwDVS.js} +11 -0
- package/dist/upstream-prompt-provenance-ClRBije0.js +41 -0
- package/dist/{upstream-session-fork-Dy4Xvuoj.js → upstream-session-fork-CE-_LdnP.js} +5 -5
- package/dist/{usage-CQ6GhD5-.js → usage-CHlV0e-o.js} +3 -3
- package/dist/{web-search-provider.runtime-CCFhg2z5.js → web-search-provider.runtime-DRw2Vl42.js} +8 -9
- package/openclaw.plugin.json +18 -3
- package/package.json +5 -5
- package/dist/conversation-control-xsIeXbo4.js +0 -287
- package/dist/event-projector-usage-Xp4AlR2k.js +0 -86
- package/dist/transcript-mirror-DzsdNCf5.js +0 -6924
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./session-binding-meta-B7aEMU7g.js";
|
|
3
|
+
import { asOptionalRecord, asOptionalRecord as readRecord, normalizeOptionalString as readNonEmptyString, normalizeTrimmedStringList, parseBooleanValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { resolvePositiveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
5
|
-
import { AgentHarnessSessionSupersededError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
6
|
+
import { AgentHarnessPreflightError, AgentHarnessSessionSupersededError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
6
7
|
import { createHash, createHmac, randomBytes, randomUUID } from "node:crypto";
|
|
7
|
-
import { ensureAuthProfileStore, resolveDefaultAgentDir, resolveProviderIdForAuth, resolveSessionAgentIds as resolveSessionAgentIds$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
8
8
|
import { readFileSync } from "node:fs";
|
|
9
9
|
import { homedir, hostname } from "node:os";
|
|
10
|
+
import { ensureAuthProfileStore, resolveDefaultAgentDir, resolveProviderIdForAuth, resolveSessionAgentIds as resolveSessionAgentIds$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
11
|
+
import { parse } from "smol-toml";
|
|
10
12
|
import { resolveExecApprovalsFromFile } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
11
13
|
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
12
14
|
import { buildSecretInputSchema, normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
13
|
-
import { normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
14
15
|
import { detectWindowsSpawnCommandInlineArgs } from "openclaw/plugin-sdk/windows-spawn";
|
|
15
16
|
import { z } from "zod";
|
|
16
|
-
import { parse } from "smol-toml";
|
|
17
17
|
import { isLoopbackHost } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
18
18
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
19
19
|
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
20
|
-
//#region extensions/codex/src/app-server/config-contracts.ts
|
|
21
|
-
const CODEX_PLUGINS_MARKETPLACE_NAME = "openai-curated";
|
|
22
|
-
const CODEX_PLUGINS_WORKSPACE_MARKETPLACE_NAME = "workspace-directory";
|
|
23
|
-
//#endregion
|
|
24
20
|
//#region extensions/codex/src/app-server/config-utils.ts
|
|
25
21
|
const START_OPTIONS_KEY_SECRET_SYMBOL = Symbol.for("openclaw.codexAppServerStartOptionsKeySecret");
|
|
26
22
|
const START_OPTIONS_KEY_SECRET = getStartOptionsKeySecret();
|
|
27
23
|
const PLAIN_DECIMAL_NUMBER_RE = /^[+-]?(?:(?:\d+\.?\d*)|(?:\.\d+))$/;
|
|
28
|
-
function readRecord(value) {
|
|
29
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
30
|
-
}
|
|
31
24
|
function normalizeCodexServiceTier(value) {
|
|
32
25
|
if (typeof value !== "string") return;
|
|
33
26
|
const trimmed = value.trim();
|
|
@@ -53,24 +46,8 @@ function normalizeHeaders(value) {
|
|
|
53
46
|
function normalizeCodexAppServerSecretInput(params) {
|
|
54
47
|
return normalizeResolvedSecretInputString(params);
|
|
55
48
|
}
|
|
56
|
-
function normalizeStringList(value) {
|
|
57
|
-
return normalizeTrimmedStringList(value);
|
|
58
|
-
}
|
|
59
49
|
function readBooleanEnv(value) {
|
|
60
|
-
|
|
61
|
-
const normalized = value.trim().toLowerCase();
|
|
62
|
-
if ([
|
|
63
|
-
"1",
|
|
64
|
-
"true",
|
|
65
|
-
"yes",
|
|
66
|
-
"on"
|
|
67
|
-
].includes(normalized)) return true;
|
|
68
|
-
if ([
|
|
69
|
-
"0",
|
|
70
|
-
"false",
|
|
71
|
-
"no",
|
|
72
|
-
"off"
|
|
73
|
-
].includes(normalized)) return false;
|
|
50
|
+
return parseBooleanValue(value);
|
|
74
51
|
}
|
|
75
52
|
function readExecSecurity(value) {
|
|
76
53
|
return value === "deny" || value === "allowlist" || value === "full" ? value : void 0;
|
|
@@ -89,10 +66,6 @@ function resolveArgs(configArgs, envArgs) {
|
|
|
89
66
|
if (typeof configArgs === "string") return splitShellWords(configArgs);
|
|
90
67
|
return splitShellWords(envArgs ?? "");
|
|
91
68
|
}
|
|
92
|
-
function readNonEmptyString(value) {
|
|
93
|
-
if (typeof value !== "string") return;
|
|
94
|
-
return value.trim() || void 0;
|
|
95
|
-
}
|
|
96
69
|
function hashSecretForKey(value, label) {
|
|
97
70
|
if (!value) return null;
|
|
98
71
|
return createHmac("sha256", START_OPTIONS_KEY_SECRET).update(label).update("\0").update(value).digest("hex");
|
|
@@ -192,7 +165,7 @@ function resolveCodexPolicyModeForOpenClawExecMode(mode) {
|
|
|
192
165
|
return "guardian";
|
|
193
166
|
}
|
|
194
167
|
function assertCodexAppServerAllowedForOpenClawExecMode(mode) {
|
|
195
|
-
if (mode === "deny" || mode === "allowlist") throw new
|
|
168
|
+
if (mode === "deny" || mode === "allowlist") throw new AgentHarnessPreflightError(`Codex app-server local execution is unavailable because effective tools.exec.mode=${mode}. Execution-host approvals are authoritative. For gateway turns, inspect them with \`openclaw approvals get --gateway\` and update that same target with \`openclaw approvals set --gateway --stdin\`; for local \`agent exec\`, omit \`--gateway\`. Intentionally align that host policy before retrying.`, { scope: "harness" });
|
|
196
169
|
}
|
|
197
170
|
function createDefaultOpenClawExecPolicy() {
|
|
198
171
|
return {
|
|
@@ -301,219 +274,6 @@ function readExecMode(value) {
|
|
|
301
274
|
return value === "deny" || value === "allowlist" || value === "ask" || value === "auto" || value === "full" ? value : void 0;
|
|
302
275
|
}
|
|
303
276
|
//#endregion
|
|
304
|
-
//#region extensions/codex/src/app-server/session-discovery-config.ts
|
|
305
|
-
const codexSessionCatalogConfigSchema = z.object({ enabled: z.boolean().optional() }).strict();
|
|
306
|
-
const codexDiscoveryConfigSchema = z.object({
|
|
307
|
-
enabled: z.boolean().optional(),
|
|
308
|
-
timeoutMs: z.number().positive().optional()
|
|
309
|
-
}).strict();
|
|
310
|
-
//#endregion
|
|
311
|
-
//#region extensions/codex/src/app-server/config-parsing.ts
|
|
312
|
-
const DEFAULT_CODEX_COMPUTER_USE_PLUGIN_NAME = "computer-use";
|
|
313
|
-
const DEFAULT_CODEX_COMPUTER_USE_MARKETPLACE_DISCOVERY_TIMEOUT_MS = 6e4;
|
|
314
|
-
const DEFAULT_CODEX_COMPUTER_USE_LIVE_TEST_TIMEOUT_MS = 6e4;
|
|
315
|
-
const DEFAULT_CODEX_COMPUTER_USE_TOOL_CALL_TIMEOUT_MS = 6e4;
|
|
316
|
-
const DEFAULT_CODEX_APP_SERVER_NETWORK_PROXY_PROFILE_PREFIX = "openclaw-network";
|
|
317
|
-
const codexAppServerTransportSchema = z.enum([
|
|
318
|
-
"stdio",
|
|
319
|
-
"websocket",
|
|
320
|
-
"unix"
|
|
321
|
-
]);
|
|
322
|
-
const codexAppServerHomeScopeSchema = z.enum(["agent", "user"]);
|
|
323
|
-
const SecretInputSchema = buildSecretInputSchema();
|
|
324
|
-
const codexAppServerPolicyModeSchema = z.enum(["yolo", "guardian"]);
|
|
325
|
-
const codexAppServerApprovalPolicySchema = z.preprocess((value) => value === "on-failure" ? "on-request" : value, z.enum([
|
|
326
|
-
"never",
|
|
327
|
-
"on-request",
|
|
328
|
-
"untrusted"
|
|
329
|
-
]));
|
|
330
|
-
const codexAppServerSandboxSchema = z.enum([
|
|
331
|
-
"read-only",
|
|
332
|
-
"workspace-write",
|
|
333
|
-
"danger-full-access"
|
|
334
|
-
]);
|
|
335
|
-
const codexAppServerApprovalsReviewerSchema = z.enum([
|
|
336
|
-
"user",
|
|
337
|
-
"auto_review",
|
|
338
|
-
"guardian_subagent"
|
|
339
|
-
]);
|
|
340
|
-
const codexDynamicToolsLoadingSchema = z.enum(["searchable", "direct"]);
|
|
341
|
-
const codexComputerUseHealthIntervalSchema = z.union([
|
|
342
|
-
z.literal(30),
|
|
343
|
-
z.literal(60),
|
|
344
|
-
z.literal(120),
|
|
345
|
-
z.literal(240)
|
|
346
|
-
]);
|
|
347
|
-
const codexComputerUsePluginCacheModeSchema = z.enum(["shared", "independent"]);
|
|
348
|
-
const codexPluginDestructivePolicySchema = z.union([
|
|
349
|
-
z.boolean(),
|
|
350
|
-
z.literal("auto"),
|
|
351
|
-
z.literal("ask")
|
|
352
|
-
]);
|
|
353
|
-
const codexAppServerServiceTierSchema = z.preprocess((value) => value === null ? null : normalizeCodexServiceTier(value), z.string().trim().min(1).nullable().optional()).optional();
|
|
354
|
-
const codexAppServerExperimentalSchema = z.object({ sandboxExecServer: z.boolean().optional() }).strict();
|
|
355
|
-
const codexAppServerRemoteWorkspaceRootSchema = z.string().trim().min(1);
|
|
356
|
-
const codexAppServerNetworkProxyDomainPermissionSchema = z.enum(["allow", "deny"]);
|
|
357
|
-
const codexAppServerNetworkProxyUnixSocketPermissionSchema = z.enum(["allow", "none"]);
|
|
358
|
-
const codexAppServerNetworkProxySchema = z.object({
|
|
359
|
-
enabled: z.boolean().optional(),
|
|
360
|
-
profileName: z.string().trim().min(1).optional(),
|
|
361
|
-
baseProfile: z.enum(["read-only", "workspace"]).optional(),
|
|
362
|
-
mode: z.enum(["limited", "full"]).optional(),
|
|
363
|
-
domains: z.record(z.string(), codexAppServerNetworkProxyDomainPermissionSchema).optional(),
|
|
364
|
-
unixSockets: z.record(z.string(), codexAppServerNetworkProxyUnixSocketPermissionSchema).optional(),
|
|
365
|
-
proxyUrl: z.string().trim().min(1).optional(),
|
|
366
|
-
socksUrl: z.string().trim().min(1).optional(),
|
|
367
|
-
enableSocks5: z.boolean().optional(),
|
|
368
|
-
enableSocks5Udp: z.boolean().optional(),
|
|
369
|
-
allowUpstreamProxy: z.boolean().optional(),
|
|
370
|
-
allowLocalBinding: z.boolean().optional(),
|
|
371
|
-
dangerouslyAllowNonLoopbackProxy: z.boolean().optional(),
|
|
372
|
-
dangerouslyAllowAllUnixSockets: z.boolean().optional()
|
|
373
|
-
}).strict();
|
|
374
|
-
const codexPluginEntryConfigSchema = z.object({
|
|
375
|
-
enabled: z.boolean().optional(),
|
|
376
|
-
marketplaceName: z.enum([CODEX_PLUGINS_MARKETPLACE_NAME, CODEX_PLUGINS_WORKSPACE_MARKETPLACE_NAME]).optional(),
|
|
377
|
-
pluginName: z.string().trim().min(1).optional(),
|
|
378
|
-
allow_destructive_actions: codexPluginDestructivePolicySchema.optional()
|
|
379
|
-
}).strict();
|
|
380
|
-
const codexPluginsConfigSchema = z.object({
|
|
381
|
-
enabled: z.boolean().optional(),
|
|
382
|
-
allow_all_plugins: z.boolean().optional(),
|
|
383
|
-
allow_destructive_actions: codexPluginDestructivePolicySchema.optional(),
|
|
384
|
-
plugins: z.record(z.string(), codexPluginEntryConfigSchema).optional()
|
|
385
|
-
}).strict();
|
|
386
|
-
const codexSupervisionEndpointSchema = z.union([z.object({
|
|
387
|
-
id: z.string().optional(),
|
|
388
|
-
label: z.string().optional(),
|
|
389
|
-
transport: z.literal("stdio-proxy").optional(),
|
|
390
|
-
command: z.string().optional(),
|
|
391
|
-
args: z.array(z.string()).optional(),
|
|
392
|
-
cwd: z.string().optional()
|
|
393
|
-
}).strict(), z.object({
|
|
394
|
-
id: z.string().optional(),
|
|
395
|
-
label: z.string().optional(),
|
|
396
|
-
transport: z.literal("websocket"),
|
|
397
|
-
url: z.string(),
|
|
398
|
-
authTokenEnv: z.string().optional()
|
|
399
|
-
}).strict()]);
|
|
400
|
-
const codexSupervisionConfigSchema = z.object({
|
|
401
|
-
enabled: z.boolean().optional(),
|
|
402
|
-
endpoints: z.array(codexSupervisionEndpointSchema).optional(),
|
|
403
|
-
allowRawTranscripts: z.boolean().optional(),
|
|
404
|
-
allowWriteControls: z.boolean().optional()
|
|
405
|
-
}).strict();
|
|
406
|
-
const codexPluginConfigSchema = z.object({
|
|
407
|
-
codexDynamicToolsLoading: codexDynamicToolsLoadingSchema.optional(),
|
|
408
|
-
codexDynamicToolsExclude: z.array(z.string()).optional(),
|
|
409
|
-
sessionCatalog: codexSessionCatalogConfigSchema.optional(),
|
|
410
|
-
discovery: codexDiscoveryConfigSchema.optional(),
|
|
411
|
-
computerUse: z.object({
|
|
412
|
-
enabled: z.boolean().optional(),
|
|
413
|
-
autoInstall: z.boolean().optional(),
|
|
414
|
-
marketplaceDiscoveryTimeoutMs: z.number().positive().optional(),
|
|
415
|
-
liveTestTimeoutMs: z.number().positive().optional(),
|
|
416
|
-
toolCallTimeoutMs: z.number().positive().optional(),
|
|
417
|
-
healthCheckEnabled: z.boolean().optional(),
|
|
418
|
-
healthCheckIntervalMinutes: codexComputerUseHealthIntervalSchema.optional(),
|
|
419
|
-
pluginCacheMode: codexComputerUsePluginCacheModeSchema.optional(),
|
|
420
|
-
strictReadiness: z.boolean().optional(),
|
|
421
|
-
autoRepair: z.boolean().optional(),
|
|
422
|
-
marketplaceSource: z.string().optional(),
|
|
423
|
-
marketplacePath: z.string().optional(),
|
|
424
|
-
marketplaceName: z.string().optional(),
|
|
425
|
-
pluginName: z.string().optional(),
|
|
426
|
-
mcpServerName: z.string().optional()
|
|
427
|
-
}).strict().optional(),
|
|
428
|
-
codexPlugins: z.unknown().optional(),
|
|
429
|
-
supervision: codexSupervisionConfigSchema.optional(),
|
|
430
|
-
appServer: z.object({
|
|
431
|
-
mode: codexAppServerPolicyModeSchema.optional(),
|
|
432
|
-
transport: codexAppServerTransportSchema.optional(),
|
|
433
|
-
homeScope: codexAppServerHomeScopeSchema.optional(),
|
|
434
|
-
command: z.string().optional(),
|
|
435
|
-
args: z.union([z.array(z.string()), z.string()]).optional(),
|
|
436
|
-
url: z.string().optional(),
|
|
437
|
-
authToken: SecretInputSchema.optional(),
|
|
438
|
-
headers: z.record(z.string(), SecretInputSchema).optional(),
|
|
439
|
-
clearEnv: z.array(z.string()).optional(),
|
|
440
|
-
remoteWorkspaceRoot: codexAppServerRemoteWorkspaceRootSchema.optional(),
|
|
441
|
-
codeModeOnly: z.boolean().optional(),
|
|
442
|
-
loopDetectionPreToolUseRelay: z.boolean().optional(),
|
|
443
|
-
requestTimeoutMs: z.number().positive().optional(),
|
|
444
|
-
turnCompletionIdleTimeoutMs: z.number().positive().optional(),
|
|
445
|
-
turnAssistantCompletionIdleTimeoutMs: z.number().positive().optional(),
|
|
446
|
-
postToolRawAssistantCompletionIdleTimeoutMs: z.number().positive().optional(),
|
|
447
|
-
approvalPolicy: codexAppServerApprovalPolicySchema.optional(),
|
|
448
|
-
sandbox: codexAppServerSandboxSchema.optional(),
|
|
449
|
-
approvalsReviewer: codexAppServerApprovalsReviewerSchema.optional(),
|
|
450
|
-
serviceTier: codexAppServerServiceTierSchema,
|
|
451
|
-
networkProxy: codexAppServerNetworkProxySchema.optional(),
|
|
452
|
-
defaultWorkspaceDir: z.string().optional(),
|
|
453
|
-
experimental: codexAppServerExperimentalSchema.optional()
|
|
454
|
-
}).strict().optional()
|
|
455
|
-
}).strict();
|
|
456
|
-
function readCodexPluginConfig(value) {
|
|
457
|
-
const parsed = codexPluginConfigSchema.safeParse(value);
|
|
458
|
-
if (!parsed.success) return {};
|
|
459
|
-
const { codexPlugins: rawCodexPlugins, ...config } = parsed.data;
|
|
460
|
-
const plugins = codexPluginsConfigSchema.safeParse(rawCodexPlugins);
|
|
461
|
-
if (!plugins.success) return config;
|
|
462
|
-
return {
|
|
463
|
-
...config,
|
|
464
|
-
...plugins.data ? { codexPlugins: plugins.data } : {}
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
function isCodexSandboxExecServerEnabled(pluginConfig) {
|
|
468
|
-
return readCodexPluginConfig(pluginConfig).appServer?.experimental?.sandboxExecServer === true;
|
|
469
|
-
}
|
|
470
|
-
function assertCodexAppServerCommandHasNoInlineArgs(params) {
|
|
471
|
-
const inlineArgs = detectWindowsSpawnCommandInlineArgs(params.command);
|
|
472
|
-
if (!inlineArgs) return;
|
|
473
|
-
const sourceLabel = params.source === "env" ? "OPENCLAW_CODEX_APP_SERVER_BIN" : "plugins.entries.codex.config.appServer.command";
|
|
474
|
-
const argsLabel = params.source === "env" ? "OPENCLAW_CODEX_APP_SERVER_ARGS" : "plugins.entries.codex.config.appServer.args";
|
|
475
|
-
throw new Error(`${sourceLabel} must be only the Codex app-server executable path; "${inlineArgs.executable}" was configured with inline arguments "${inlineArgs.arguments}". Move those arguments to ${argsLabel}, or remove the override to use the managed Codex startup path.`);
|
|
476
|
-
}
|
|
477
|
-
function resolveCodexPluginsPolicy(pluginConfig) {
|
|
478
|
-
const config = readCodexPluginConfig(pluginConfig).codexPlugins;
|
|
479
|
-
const configured = config !== void 0;
|
|
480
|
-
const enabled = config?.enabled === true;
|
|
481
|
-
const destructivePolicy = resolveCodexPluginDestructivePolicy(config?.allow_destructive_actions ?? true);
|
|
482
|
-
const pluginPolicies = Object.entries(config?.plugins ?? {}).flatMap(([configKey, entry]) => {
|
|
483
|
-
if (!isCodexPluginMarketplaceName(entry.marketplaceName) || !entry.pluginName) return [];
|
|
484
|
-
const entryDestructivePolicy = resolveCodexPluginDestructivePolicy(entry.allow_destructive_actions ?? config?.allow_destructive_actions ?? true);
|
|
485
|
-
return [{
|
|
486
|
-
configKey,
|
|
487
|
-
marketplaceName: entry.marketplaceName,
|
|
488
|
-
pluginName: entry.pluginName,
|
|
489
|
-
enabled: enabled && entry.enabled !== false,
|
|
490
|
-
allowDestructiveActions: entryDestructivePolicy.allowDestructiveActions,
|
|
491
|
-
destructiveApprovalMode: entryDestructivePolicy.destructiveApprovalMode
|
|
492
|
-
}];
|
|
493
|
-
}).toSorted((left, right) => left.configKey.localeCompare(right.configKey));
|
|
494
|
-
return {
|
|
495
|
-
configured,
|
|
496
|
-
enabled,
|
|
497
|
-
allowAllPlugins: enabled && config?.allow_all_plugins === true,
|
|
498
|
-
allowDestructiveActions: destructivePolicy.allowDestructiveActions,
|
|
499
|
-
destructiveApprovalMode: destructivePolicy.destructiveApprovalMode,
|
|
500
|
-
pluginPolicies
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
function isCodexPluginMarketplaceName(value) {
|
|
504
|
-
return value === "openai-curated" || value === "workspace-directory";
|
|
505
|
-
}
|
|
506
|
-
function resolveCodexPluginDestructivePolicy(policy) {
|
|
507
|
-
if (policy === "auto" || policy === "ask") return {
|
|
508
|
-
allowDestructiveActions: true,
|
|
509
|
-
destructiveApprovalMode: policy
|
|
510
|
-
};
|
|
511
|
-
return {
|
|
512
|
-
allowDestructiveActions: policy,
|
|
513
|
-
destructiveApprovalMode: policy ? "allow" : "deny"
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
//#endregion
|
|
517
277
|
//#region extensions/codex/src/app-server/config-requirements.ts
|
|
518
278
|
const UNIX_CODEX_REQUIREMENTS_PATH = "/etc/codex/requirements.toml";
|
|
519
279
|
const WINDOWS_CODEX_REQUIREMENTS_SUFFIX = "\\OpenAI\\Codex\\requirements.toml";
|
|
@@ -911,6 +671,227 @@ function inferProviderFromModelRef(model) {
|
|
|
911
671
|
return slashIndex > 0 ? normalized?.slice(0, slashIndex) : void 0;
|
|
912
672
|
}
|
|
913
673
|
//#endregion
|
|
674
|
+
//#region extensions/codex/src/app-server/config-contracts.ts
|
|
675
|
+
const CODEX_PLUGINS_MARKETPLACE_NAME = "openai-curated";
|
|
676
|
+
const CODEX_PLUGINS_WORKSPACE_MARKETPLACE_NAME = "workspace-directory";
|
|
677
|
+
const CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
678
|
+
//#endregion
|
|
679
|
+
//#region extensions/codex/src/app-server/session-discovery-config.ts
|
|
680
|
+
const codexSessionCatalogConfigSchema = z.object({ enabled: z.boolean().optional() }).strict();
|
|
681
|
+
const codexDiscoveryConfigSchema = z.object({
|
|
682
|
+
enabled: z.boolean().optional(),
|
|
683
|
+
timeoutMs: z.number().positive().optional()
|
|
684
|
+
}).strict();
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region extensions/codex/src/app-server/config-parsing.ts
|
|
687
|
+
const DEFAULT_CODEX_COMPUTER_USE_PLUGIN_NAME = "computer-use";
|
|
688
|
+
const DEFAULT_CODEX_COMPUTER_USE_MARKETPLACE_DISCOVERY_TIMEOUT_MS = 6e4;
|
|
689
|
+
const DEFAULT_CODEX_COMPUTER_USE_LIVE_TEST_TIMEOUT_MS = 6e4;
|
|
690
|
+
const DEFAULT_CODEX_COMPUTER_USE_TOOL_CALL_TIMEOUT_MS = 6e4;
|
|
691
|
+
const DEFAULT_CODEX_APP_SERVER_NETWORK_PROXY_PROFILE_PREFIX = "openclaw-network";
|
|
692
|
+
const codexAppServerTransportSchema = z.enum([
|
|
693
|
+
"stdio",
|
|
694
|
+
"websocket",
|
|
695
|
+
"unix"
|
|
696
|
+
]);
|
|
697
|
+
const codexAppServerHomeScopeSchema = z.enum(["agent", "user"]);
|
|
698
|
+
const SecretInputSchema = buildSecretInputSchema();
|
|
699
|
+
const codexAppServerPolicyModeSchema = z.enum(["yolo", "guardian"]);
|
|
700
|
+
const codexAppServerApprovalPolicySchema = z.preprocess((value) => value === "on-failure" ? "on-request" : value, z.enum([
|
|
701
|
+
"never",
|
|
702
|
+
"on-request",
|
|
703
|
+
"untrusted"
|
|
704
|
+
]));
|
|
705
|
+
const codexAppServerSandboxSchema = z.enum([
|
|
706
|
+
"read-only",
|
|
707
|
+
"workspace-write",
|
|
708
|
+
"danger-full-access"
|
|
709
|
+
]);
|
|
710
|
+
const codexAppServerApprovalsReviewerSchema = z.enum([
|
|
711
|
+
"user",
|
|
712
|
+
"auto_review",
|
|
713
|
+
"guardian_subagent"
|
|
714
|
+
]);
|
|
715
|
+
const codexDynamicToolsLoadingSchema = z.enum(["searchable", "direct"]);
|
|
716
|
+
const codexComputerUseHealthIntervalSchema = z.union([
|
|
717
|
+
z.literal(30),
|
|
718
|
+
z.literal(60),
|
|
719
|
+
z.literal(120),
|
|
720
|
+
z.literal(240)
|
|
721
|
+
]);
|
|
722
|
+
const codexComputerUsePluginCacheModeSchema = z.enum(["shared", "independent"]);
|
|
723
|
+
const codexPluginDestructivePolicySchema = z.union([
|
|
724
|
+
z.boolean(),
|
|
725
|
+
z.literal("auto"),
|
|
726
|
+
z.literal("ask")
|
|
727
|
+
]);
|
|
728
|
+
const codexAppServerServiceTierSchema = z.preprocess((value) => value === null ? null : normalizeCodexServiceTier(value), z.string().trim().min(1).nullable().optional()).optional();
|
|
729
|
+
const codexAppServerExperimentalSchema = z.object({ sandboxExecServer: z.boolean().optional() }).strict();
|
|
730
|
+
const codexAppServerRemoteWorkspaceRootSchema = z.string().trim().min(1);
|
|
731
|
+
const codexAppServerNetworkProxyDomainPermissionSchema = z.enum(["allow", "deny"]);
|
|
732
|
+
const codexAppServerNetworkProxyUnixSocketPermissionSchema = z.enum(["allow", "none"]);
|
|
733
|
+
const codexAppServerNetworkProxySchema = z.object({
|
|
734
|
+
enabled: z.boolean().optional(),
|
|
735
|
+
profileName: z.string().trim().min(1).optional(),
|
|
736
|
+
baseProfile: z.enum(["read-only", "workspace"]).optional(),
|
|
737
|
+
mode: z.enum(["limited", "full"]).optional(),
|
|
738
|
+
domains: z.record(z.string(), codexAppServerNetworkProxyDomainPermissionSchema).optional(),
|
|
739
|
+
unixSockets: z.record(z.string(), codexAppServerNetworkProxyUnixSocketPermissionSchema).optional(),
|
|
740
|
+
proxyUrl: z.string().trim().min(1).optional(),
|
|
741
|
+
socksUrl: z.string().trim().min(1).optional(),
|
|
742
|
+
enableSocks5: z.boolean().optional(),
|
|
743
|
+
enableSocks5Udp: z.boolean().optional(),
|
|
744
|
+
allowUpstreamProxy: z.boolean().optional(),
|
|
745
|
+
allowLocalBinding: z.boolean().optional(),
|
|
746
|
+
dangerouslyAllowNonLoopbackProxy: z.boolean().optional(),
|
|
747
|
+
dangerouslyAllowAllUnixSockets: z.boolean().optional()
|
|
748
|
+
}).strict();
|
|
749
|
+
const codexPluginEntryConfigSchema = z.object({
|
|
750
|
+
enabled: z.boolean().optional(),
|
|
751
|
+
marketplaceName: z.string().regex(CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN).optional(),
|
|
752
|
+
pluginName: z.string().trim().min(1).optional(),
|
|
753
|
+
allow_destructive_actions: codexPluginDestructivePolicySchema.optional()
|
|
754
|
+
}).strict();
|
|
755
|
+
const codexPluginsConfigSchema = z.object({
|
|
756
|
+
enabled: z.boolean().optional(),
|
|
757
|
+
allow_all_plugins: z.boolean().optional(),
|
|
758
|
+
allow_destructive_actions: codexPluginDestructivePolicySchema.optional(),
|
|
759
|
+
plugins: z.record(z.string(), codexPluginEntryConfigSchema).optional()
|
|
760
|
+
}).strict();
|
|
761
|
+
const codexSupervisionEndpointSchema = z.union([z.object({
|
|
762
|
+
id: z.string().optional(),
|
|
763
|
+
label: z.string().optional(),
|
|
764
|
+
transport: z.literal("stdio-proxy").optional(),
|
|
765
|
+
command: z.string().optional(),
|
|
766
|
+
args: z.array(z.string()).optional(),
|
|
767
|
+
cwd: z.string().optional()
|
|
768
|
+
}).strict(), z.object({
|
|
769
|
+
id: z.string().optional(),
|
|
770
|
+
label: z.string().optional(),
|
|
771
|
+
transport: z.literal("websocket"),
|
|
772
|
+
url: z.string(),
|
|
773
|
+
authTokenEnv: z.string().optional()
|
|
774
|
+
}).strict()]);
|
|
775
|
+
const codexSupervisionConfigSchema = z.object({
|
|
776
|
+
enabled: z.boolean().optional(),
|
|
777
|
+
endpoints: z.array(codexSupervisionEndpointSchema).optional(),
|
|
778
|
+
allowRawTranscripts: z.boolean().optional(),
|
|
779
|
+
allowWriteControls: z.boolean().optional()
|
|
780
|
+
}).strict();
|
|
781
|
+
const codexPluginConfigSchema = z.object({
|
|
782
|
+
codexDynamicToolsLoading: codexDynamicToolsLoadingSchema.optional(),
|
|
783
|
+
codexDynamicToolsExclude: z.array(z.string()).optional(),
|
|
784
|
+
sessionCatalog: codexSessionCatalogConfigSchema.optional(),
|
|
785
|
+
discovery: codexDiscoveryConfigSchema.optional(),
|
|
786
|
+
computerUse: z.object({
|
|
787
|
+
enabled: z.boolean().optional(),
|
|
788
|
+
autoInstall: z.boolean().optional(),
|
|
789
|
+
marketplaceDiscoveryTimeoutMs: z.number().positive().optional(),
|
|
790
|
+
liveTestTimeoutMs: z.number().positive().optional(),
|
|
791
|
+
toolCallTimeoutMs: z.number().positive().optional(),
|
|
792
|
+
healthCheckEnabled: z.boolean().optional(),
|
|
793
|
+
healthCheckIntervalMinutes: codexComputerUseHealthIntervalSchema.optional(),
|
|
794
|
+
pluginCacheMode: codexComputerUsePluginCacheModeSchema.optional(),
|
|
795
|
+
strictReadiness: z.boolean().optional(),
|
|
796
|
+
autoRepair: z.boolean().optional(),
|
|
797
|
+
marketplaceSource: z.string().optional(),
|
|
798
|
+
marketplacePath: z.string().optional(),
|
|
799
|
+
marketplaceName: z.string().optional(),
|
|
800
|
+
pluginName: z.string().optional(),
|
|
801
|
+
mcpServerName: z.string().optional()
|
|
802
|
+
}).strict().optional(),
|
|
803
|
+
codexPlugins: z.unknown().optional(),
|
|
804
|
+
supervision: codexSupervisionConfigSchema.optional(),
|
|
805
|
+
appServer: z.object({
|
|
806
|
+
mode: codexAppServerPolicyModeSchema.optional(),
|
|
807
|
+
transport: codexAppServerTransportSchema.optional(),
|
|
808
|
+
homeScope: codexAppServerHomeScopeSchema.optional(),
|
|
809
|
+
command: z.string().optional(),
|
|
810
|
+
args: z.union([z.array(z.string()), z.string()]).optional(),
|
|
811
|
+
url: z.string().optional(),
|
|
812
|
+
authToken: SecretInputSchema.optional(),
|
|
813
|
+
headers: z.record(z.string(), SecretInputSchema).optional(),
|
|
814
|
+
clearEnv: z.array(z.string()).optional(),
|
|
815
|
+
remoteWorkspaceRoot: codexAppServerRemoteWorkspaceRootSchema.optional(),
|
|
816
|
+
codeModeOnly: z.boolean().optional(),
|
|
817
|
+
loopDetectionPreToolUseRelay: z.boolean().optional(),
|
|
818
|
+
requestTimeoutMs: z.number().positive().optional(),
|
|
819
|
+
turnCompletionIdleTimeoutMs: z.number().positive().optional(),
|
|
820
|
+
turnAssistantCompletionIdleTimeoutMs: z.number().positive().optional(),
|
|
821
|
+
postToolRawAssistantCompletionIdleTimeoutMs: z.number().positive().optional(),
|
|
822
|
+
approvalPolicy: codexAppServerApprovalPolicySchema.optional(),
|
|
823
|
+
sandbox: codexAppServerSandboxSchema.optional(),
|
|
824
|
+
approvalsReviewer: codexAppServerApprovalsReviewerSchema.optional(),
|
|
825
|
+
serviceTier: codexAppServerServiceTierSchema,
|
|
826
|
+
networkProxy: codexAppServerNetworkProxySchema.optional(),
|
|
827
|
+
defaultWorkspaceDir: z.string().optional(),
|
|
828
|
+
experimental: codexAppServerExperimentalSchema.optional()
|
|
829
|
+
}).strict().optional()
|
|
830
|
+
}).strict();
|
|
831
|
+
function readCodexPluginConfig(value) {
|
|
832
|
+
const parsed = codexPluginConfigSchema.safeParse(value);
|
|
833
|
+
if (!parsed.success) return {};
|
|
834
|
+
const { codexPlugins: rawCodexPlugins, ...config } = parsed.data;
|
|
835
|
+
const plugins = codexPluginsConfigSchema.safeParse(rawCodexPlugins);
|
|
836
|
+
if (!plugins.success) return config;
|
|
837
|
+
return {
|
|
838
|
+
...config,
|
|
839
|
+
...plugins.data ? { codexPlugins: plugins.data } : {}
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
function isCodexSandboxExecServerEnabled(pluginConfig, sandbox) {
|
|
843
|
+
return isCodexRemoteExecPlacementSandbox(sandbox) || readCodexPluginConfig(pluginConfig).appServer?.experimental?.sandboxExecServer === true;
|
|
844
|
+
}
|
|
845
|
+
function isCodexRemoteExecPlacementSandbox(sandbox) {
|
|
846
|
+
return typeof sandbox === "object" && sandbox !== null && "placementExecutionMode" in sandbox && sandbox.placementExecutionMode === "remote-exec";
|
|
847
|
+
}
|
|
848
|
+
function assertCodexAppServerCommandHasNoInlineArgs(params) {
|
|
849
|
+
const inlineArgs = detectWindowsSpawnCommandInlineArgs(params.command);
|
|
850
|
+
if (!inlineArgs) return;
|
|
851
|
+
const sourceLabel = params.source === "env" ? "OPENCLAW_CODEX_APP_SERVER_BIN" : "plugins.entries.codex.config.appServer.command";
|
|
852
|
+
const argsLabel = params.source === "env" ? "OPENCLAW_CODEX_APP_SERVER_ARGS" : "plugins.entries.codex.config.appServer.args";
|
|
853
|
+
throw new Error(`${sourceLabel} must be only the Codex app-server executable path; "${inlineArgs.executable}" was configured with inline arguments "${inlineArgs.arguments}". Move those arguments to ${argsLabel}, or remove the override to use the managed Codex startup path.`);
|
|
854
|
+
}
|
|
855
|
+
function resolveCodexPluginsPolicy(pluginConfig) {
|
|
856
|
+
const config = readCodexPluginConfig(pluginConfig).codexPlugins;
|
|
857
|
+
const configured = config !== void 0;
|
|
858
|
+
const enabled = config?.enabled === true;
|
|
859
|
+
const destructivePolicy = resolveCodexPluginDestructivePolicy(config?.allow_destructive_actions ?? true);
|
|
860
|
+
const pluginPolicies = Object.entries(config?.plugins ?? {}).flatMap(([configKey, entry]) => {
|
|
861
|
+
if (!isCodexPluginMarketplaceName(entry.marketplaceName) || !entry.pluginName) return [];
|
|
862
|
+
const entryDestructivePolicy = resolveCodexPluginDestructivePolicy(entry.allow_destructive_actions ?? config?.allow_destructive_actions ?? true);
|
|
863
|
+
return [{
|
|
864
|
+
configKey,
|
|
865
|
+
marketplaceName: entry.marketplaceName,
|
|
866
|
+
pluginName: entry.pluginName,
|
|
867
|
+
enabled: enabled && entry.enabled !== false,
|
|
868
|
+
allowDestructiveActions: entryDestructivePolicy.allowDestructiveActions,
|
|
869
|
+
destructiveApprovalMode: entryDestructivePolicy.destructiveApprovalMode
|
|
870
|
+
}];
|
|
871
|
+
}).toSorted((left, right) => left.configKey.localeCompare(right.configKey));
|
|
872
|
+
return {
|
|
873
|
+
configured,
|
|
874
|
+
enabled,
|
|
875
|
+
allowAllPlugins: enabled && config?.allow_all_plugins === true,
|
|
876
|
+
allowDestructiveActions: destructivePolicy.allowDestructiveActions,
|
|
877
|
+
destructiveApprovalMode: destructivePolicy.destructiveApprovalMode,
|
|
878
|
+
pluginPolicies
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
function isCodexPluginMarketplaceName(value) {
|
|
882
|
+
return typeof value === "string" && CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN.test(value);
|
|
883
|
+
}
|
|
884
|
+
function resolveCodexPluginDestructivePolicy(policy) {
|
|
885
|
+
if (policy === "auto" || policy === "ask") return {
|
|
886
|
+
allowDestructiveActions: true,
|
|
887
|
+
destructiveApprovalMode: policy
|
|
888
|
+
};
|
|
889
|
+
return {
|
|
890
|
+
allowDestructiveActions: policy,
|
|
891
|
+
destructiveApprovalMode: policy ? "allow" : "deny"
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
//#endregion
|
|
914
895
|
//#region extensions/codex/src/app-server/config-security.ts
|
|
915
896
|
function shouldAutoApproveCodexAppServerApprovals(appServer) {
|
|
916
897
|
return appServer.networkProxy === void 0 && appServer.approvalPolicy === "never" && appServer.sandbox === "danger-full-access";
|
|
@@ -1101,7 +1082,7 @@ function resolveCodexAppServerRuntimeOptions(params = {}) {
|
|
|
1101
1082
|
});
|
|
1102
1083
|
const args = resolveArgs(config.args, env.OPENCLAW_CODEX_APP_SERVER_ARGS);
|
|
1103
1084
|
const headers = normalizeHeaders(config.headers);
|
|
1104
|
-
const clearEnv =
|
|
1085
|
+
const clearEnv = normalizeTrimmedStringList(config.clearEnv);
|
|
1105
1086
|
const authToken = normalizeCodexAppServerSecretInput({
|
|
1106
1087
|
value: config.authToken,
|
|
1107
1088
|
path: "plugins.entries.codex.config.appServer.authToken"
|
|
@@ -1373,7 +1354,6 @@ var session_binding_exports = /* @__PURE__ */ __exportAll({
|
|
|
1373
1354
|
readCodexAppServerThreadBinding: () => readCodexAppServerThreadBinding,
|
|
1374
1355
|
readStoredCodexAppServerBinding: () => readStoredCodexAppServerBinding,
|
|
1375
1356
|
reclaimCurrentCodexSessionGeneration: () => reclaimCurrentCodexSessionGeneration,
|
|
1376
|
-
resolveCodexAppServerBindingModelProvider: () => resolveCodexAppServerBindingModelProvider,
|
|
1377
1357
|
resolveCodexRunSessionBindingAuthority: () => resolveCodexRunSessionBindingAuthority,
|
|
1378
1358
|
scopeCodexRunBindingStore: () => scopeCodexRunBindingStore,
|
|
1379
1359
|
sessionBindingIdentity: () => sessionBindingIdentity
|
|
@@ -1463,15 +1443,17 @@ const accountAppPolicyEntrySchema = z.object({
|
|
|
1463
1443
|
source: z.literal("account"),
|
|
1464
1444
|
appName: z.string(),
|
|
1465
1445
|
allowDestructiveActions: z.boolean(),
|
|
1446
|
+
allowOpenWorld: z.boolean().optional(),
|
|
1466
1447
|
destructiveApprovalMode: destructiveApprovalModeSchema,
|
|
1467
1448
|
mcpServerNames: z.array(z.string())
|
|
1468
1449
|
}).strict();
|
|
1469
1450
|
const pluginAppPolicyEntrySchema = z.object({
|
|
1470
1451
|
source: z.literal("plugin").optional(),
|
|
1471
1452
|
configKey: z.string(),
|
|
1472
|
-
marketplaceName: z.
|
|
1453
|
+
marketplaceName: z.string().regex(CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN),
|
|
1473
1454
|
pluginName: z.string(),
|
|
1474
1455
|
allowDestructiveActions: z.boolean(),
|
|
1456
|
+
allowOpenWorld: z.boolean().optional(),
|
|
1475
1457
|
destructiveApprovalMode: destructiveApprovalModeSchema,
|
|
1476
1458
|
mcpServerNames: z.array(z.string())
|
|
1477
1459
|
}).strict();
|
|
@@ -1511,8 +1493,11 @@ const threadBindingSchema = z.object({
|
|
|
1511
1493
|
nativeSkillIsolationFingerprint: optionalStringSchema,
|
|
1512
1494
|
userMcpServersFingerprint: optionalStringSchema,
|
|
1513
1495
|
mcpServersFingerprint: optionalStringSchema,
|
|
1496
|
+
configuredMcpOwnershipVersion: z.literal(1).optional().catch(void 0),
|
|
1514
1497
|
ringZeroConfigFingerprint: optionalStringSchema,
|
|
1515
1498
|
ringZeroClientInstanceId: optionalStringSchema,
|
|
1499
|
+
/** Durable fact preventing a later unrestricted turn from widening this thread. */
|
|
1500
|
+
nativeToolPolicyRestricted: z.literal(true).optional().catch(void 0),
|
|
1516
1501
|
nativeHookRelayGeneration: optionalNonBlankStringSchema,
|
|
1517
1502
|
appServerRuntimeFingerprint: optionalStringSchema,
|
|
1518
1503
|
pluginAppsFingerprint: optionalStringSchema,
|
|
@@ -1620,7 +1605,7 @@ function normalizeStoredCodexAppServerBindingFingerprints(value) {
|
|
|
1620
1605
|
}
|
|
1621
1606
|
/** Encodes a migrated sidecar binding as one canonical plugin-state row. */
|
|
1622
1607
|
function createStoredCodexAppServerBinding(value, options = {}) {
|
|
1623
|
-
const rawRecord =
|
|
1608
|
+
const rawRecord = asOptionalRecord(value);
|
|
1624
1609
|
if (!rawRecord) return;
|
|
1625
1610
|
const record = normalizeLegacyBindingFingerprints(rawRecord);
|
|
1626
1611
|
if (record.schemaVersion !== 1 && record.schemaVersion !== 2) return;
|
|
@@ -1860,7 +1845,8 @@ function createCodexAppServerBindingStore(state) {
|
|
|
1860
1845
|
const retiredGeneration = current?.state === "cleared" && current.retired === true && ownsGeneration;
|
|
1861
1846
|
const preservesSupervisionOwner = mutation.kind === "set" && active?.binding.connectionScope === "supervision" && isSameSupervisionOwner(active.binding, mutation.binding);
|
|
1862
1847
|
const clearsPendingSupervisionOwner = mutation.kind === "clear" && active?.binding.connectionScope === "supervision" && matchesPendingSupervisionClear(active.binding, mutation.threadId, mutation.expectedPendingSupervisionBranch);
|
|
1863
|
-
|
|
1848
|
+
const replacesExpectedOrdinaryOwner = mutation.kind === "replace-thread" && active?.binding.threadId === mutation.expectedThreadId && active.binding.connectionScope !== "supervision" && mutation.binding.connectionScope !== "supervision" && mutation.binding.threadId !== mutation.expectedThreadId;
|
|
1849
|
+
if (mutation.kind === "set" && (mutation.if?.kind === "absent" && storedActive || current !== void 0 && !ownsGeneration || retiredGeneration || active?.binding.connectionScope === "supervision" && !preservesSupervisionOwner) || mutation.kind === "patch" && active?.binding.threadId !== mutation.threadId || mutation.kind === "replace-thread" && !replacesExpectedOrdinaryOwner || (mutation.kind === "patch-pending-supervision-branch" || mutation.kind === "commit-pending-supervision-branch") && !matchesPendingSupervisionBranch(active?.binding, mutation.expected) || mutation.kind === "clear" && (mutation.threadId !== void 0 && active?.binding.threadId !== mutation.threadId || !ownsGeneration || active?.binding.connectionScope === "supervision" && !clearsPendingSupervisionOwner)) return { result: false };
|
|
1864
1850
|
if (mutation.kind === "clear" && retiredGeneration) return { result: true };
|
|
1865
1851
|
if (mutation.kind === "clear") return {
|
|
1866
1852
|
result: true,
|
|
@@ -1872,7 +1858,7 @@ function createCodexAppServerBindingStore(state) {
|
|
|
1872
1858
|
}
|
|
1873
1859
|
};
|
|
1874
1860
|
let binding;
|
|
1875
|
-
if (mutation.kind === "set") binding = validateBindingForWrite(mutation.binding);
|
|
1861
|
+
if (mutation.kind === "set" || mutation.kind === "replace-thread") binding = validateBindingForWrite(mutation.binding);
|
|
1876
1862
|
else if (mutation.kind === "patch-pending-supervision-branch") binding = validateBindingForWrite({
|
|
1877
1863
|
...active.binding,
|
|
1878
1864
|
pendingSupervisionBranch: mutation.pending
|
|
@@ -2114,40 +2100,39 @@ function stripUndefinedValue(value) {
|
|
|
2114
2100
|
if (!value || typeof value !== "object") return value;
|
|
2115
2101
|
return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== void 0).map(([key, entry]) => [key, stripUndefinedValue(entry)]));
|
|
2116
2102
|
}
|
|
2117
|
-
function asRecord(value) {
|
|
2118
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
2119
|
-
}
|
|
2120
2103
|
function readTimestamp(value) {
|
|
2121
2104
|
return optionalTimestampSchema.parse(value);
|
|
2122
2105
|
}
|
|
2123
2106
|
function readPluginAppPolicyContext(value, bindingSchemaVersion) {
|
|
2124
|
-
const record =
|
|
2107
|
+
const record = asOptionalRecord(value);
|
|
2125
2108
|
if (!record || typeof record.fingerprint !== "string") return;
|
|
2126
|
-
const apps =
|
|
2109
|
+
const apps = asOptionalRecord(record.apps);
|
|
2127
2110
|
if (!apps) return;
|
|
2128
2111
|
const parsedApps = {};
|
|
2129
2112
|
for (const [appId, rawEntry] of Object.entries(apps)) {
|
|
2130
|
-
const entry =
|
|
2113
|
+
const entry = asOptionalRecord(rawEntry);
|
|
2131
2114
|
if (!entry) return;
|
|
2132
2115
|
const destructiveApprovalMode = readDestructiveApprovalMode(entry.destructiveApprovalMode, bindingSchemaVersion);
|
|
2133
2116
|
const mcpServerNamesValid = Array.isArray(entry.mcpServerNames) && entry.mcpServerNames.every((serverName) => typeof serverName === "string");
|
|
2134
2117
|
if (entry.source === "account") {
|
|
2135
|
-
if ("appId" in entry || typeof entry.appName !== "string" || typeof entry.allowDestructiveActions !== "boolean" || destructiveApprovalMode === "invalid" || !mcpServerNamesValid) return;
|
|
2118
|
+
if ("appId" in entry || typeof entry.appName !== "string" || typeof entry.allowDestructiveActions !== "boolean" || entry.allowOpenWorld !== void 0 && typeof entry.allowOpenWorld !== "boolean" || destructiveApprovalMode === "invalid" || !mcpServerNamesValid) return;
|
|
2136
2119
|
parsedApps[appId] = {
|
|
2137
2120
|
source: "account",
|
|
2138
2121
|
appName: entry.appName,
|
|
2139
2122
|
allowDestructiveActions: entry.allowDestructiveActions,
|
|
2123
|
+
...typeof entry.allowOpenWorld === "boolean" ? { allowOpenWorld: entry.allowOpenWorld } : {},
|
|
2140
2124
|
...destructiveApprovalMode ? { destructiveApprovalMode } : {},
|
|
2141
2125
|
mcpServerNames: entry.mcpServerNames
|
|
2142
2126
|
};
|
|
2143
2127
|
continue;
|
|
2144
2128
|
}
|
|
2145
|
-
if ("appId" in entry || entry.source !== void 0 && entry.source !== "plugin" || typeof entry.configKey !== "string" || entry.marketplaceName !== "
|
|
2129
|
+
if ("appId" in entry || entry.source !== void 0 && entry.source !== "plugin" || typeof entry.configKey !== "string" || typeof entry.marketplaceName !== "string" || !CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN.test(entry.marketplaceName) || typeof entry.pluginName !== "string" || typeof entry.allowDestructiveActions !== "boolean" || entry.allowOpenWorld !== void 0 && typeof entry.allowOpenWorld !== "boolean" || destructiveApprovalMode === "invalid" || !mcpServerNamesValid) return;
|
|
2146
2130
|
parsedApps[appId] = {
|
|
2147
2131
|
configKey: entry.configKey,
|
|
2148
2132
|
marketplaceName: entry.marketplaceName,
|
|
2149
2133
|
pluginName: entry.pluginName,
|
|
2150
2134
|
allowDestructiveActions: entry.allowDestructiveActions,
|
|
2135
|
+
...typeof entry.allowOpenWorld === "boolean" ? { allowOpenWorld: entry.allowOpenWorld } : {},
|
|
2151
2136
|
...destructiveApprovalMode ? { destructiveApprovalMode } : {},
|
|
2152
2137
|
mcpServerNames: entry.mcpServerNames
|
|
2153
2138
|
};
|
|
@@ -2206,9 +2191,5 @@ function normalizeCodexAppServerBindingModelProvider(params) {
|
|
|
2206
2191
|
if (isCodexAppServerNativeAuthProfile(params) && modelProvider.toLowerCase() === PUBLIC_OPENAI_MODEL_PROVIDER) return;
|
|
2207
2192
|
return modelProvider;
|
|
2208
2193
|
}
|
|
2209
|
-
/** Restores the sole provider intentionally omitted from canonical binding rows. */
|
|
2210
|
-
function resolveCodexAppServerBindingModelProvider(params) {
|
|
2211
|
-
return params.modelProvider?.trim() || (isCodexAppServerNativeAuthProfile(params) ? PUBLIC_OPENAI_MODEL_PROVIDER : void 0);
|
|
2212
|
-
}
|
|
2213
2194
|
//#endregion
|
|
2214
|
-
export {
|
|
2195
|
+
export { resolveCodexAppServerUserHomeDir as A, isCodexRemoteExecPlacementSandbox as C, CODEX_PLUGINS_MARKETPLACE_NAME as D, resolveCodexPluginsPolicy as E, isCodexAppServerApprovalPolicyAllowedByRequirements as M, resolveOpenClawExecPolicyForCodexAppServer as N, CODEX_PLUGINS_WORKSPACE_MARKETPLACE_NAME as O, isCodexFastServiceTier as P, withMcpElicitationsApprovalPolicy as S, readCodexPluginConfig as T, resolveCodexAppServerStartOptionsForAgent as _, hashCodexAppServerBindingFingerprint as a, assertCodexAppServerConnectionSecurity as b, reclaimCurrentCodexSessionGeneration as c, sessionBindingIdentity as d, session_binding_exports as f, resolveCodexAppServerRuntimeOptions as g, resolveCodexAppServerHomeScope as h, createCodexSessionGenerationSupersededError as i, resolveCodexModelBackedReviewerPolicyContext as j, canUseCodexModelBackedApprovalsReviewerForModel as k, resolveCodexRunSessionBindingAuthority as l, codexSandboxPolicyForTurn as m, assertCodexBindingMayBeReplaced as n, isCodexAppServerNativeAuthProfile as o, codexAppServerStartOptionsKey as p, bindingStoreKey as r, normalizeCodexAppServerBindingModelProvider as s, CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS as t, scopeCodexRunBindingStore as u, resolveCodexComputerUseConfig as v, isCodexSandboxExecServerEnabled as w, shouldAutoApproveCodexAppServerApprovals as x, resolveCodexSupervisionAppServerRuntimeOptions as y };
|