@openclaw/codex 2026.8.1-beta.3 → 2026.9.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +3 -3
- package/dist/{attempt-client-cleanup-URjUlCHg.js → attempt-client-cleanup-bfsmcQ6m.js} +21 -2
- package/dist/{binding-connection-DAvZwp96.js → binding-connection-BMvPX73o.js} +2 -2
- package/dist/{bounded-turn-4BjrZEwW.js → bounded-turn-B7iBUcuP.js} +8 -8
- package/dist/{capabilities-CH3K57v4.js → capabilities-BRMh0aIq.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-D0nZ3qtd.js → command-formatters-DEsIufkt.js} +2 -2
- package/dist/{command-handlers-DC86lgT4.js → command-handlers-D_-1_qRp.js} +43 -32
- package/dist/{command-rpc-xUIIonsO.js → command-rpc-CCeCkf_v.js} +4 -4
- package/dist/{compact-COqgBRny.js → compact-BglNFZrQ.js} +8 -8
- package/dist/{config-CpNeo5AE.js → config-giW8X0QA.js} +82 -28
- package/dist/doctor-contract-api.js +9 -8
- package/dist/{dynamic-tools-fJZhl4CE.js → dynamic-tools-Dnlfa--w.js} +108 -820
- package/dist/{effective-mcp-catalog-4YKn51aG.js → effective-mcp-catalog-CTeGrnfO.js} +2 -2
- package/dist/{event-projector-assistant-message-BwxV4d6N.js → event-projector-assistant-message-C5-Ds8mA.js} +18 -1
- package/dist/{event-projector-usage-CLwNEJqW.js → event-projector-usage-Bk1I90Bg.js} +3 -3
- package/dist/{harness-DoKQcF8n.js → harness-Csz0F-DK.js} +11 -11
- package/dist/harness.js +1 -1
- package/dist/index.js +130 -172
- package/dist/{isolated-completion-DPMtlH9r.js → isolated-completion-Cv6FqygM.js} +4 -4
- package/dist/{managed-binary-By4FZC6i.js → managed-binary-DFYK4DWq.js} +43 -7
- package/dist/media-understanding-provider.js +1 -1
- package/dist/{model-catalog-CmGoqVKB.js → model-catalog-i9rNBthX.js} +4 -4
- package/dist/{models-CZw1wClT.js → models-TS3HBU-q.js} +4 -3
- package/dist/{native-subagent-monitor-GGq3RnOo.js → native-subagent-monitor-4Mfq2HDs.js} +176 -19
- package/dist/{node-exec-server.runtime-Bsu1LdFZ.js → node-exec-server.runtime-BpWqJO1V.js} +2 -2
- package/dist/{plugin-app-cache-key-DMNQ8Zi8.js → plugin-app-cache-key-C1CAdfcP.js} +6 -3
- package/dist/{plugin-approval-roundtrip-C75Yiiwc.js → plugin-approval-roundtrip-bUm777tR.js} +1 -1
- package/dist/{plugin-marketplace-discovery-CSWDkMrP.js → plugin-marketplace-discovery-B9DvaAG-.js} +29 -38
- package/dist/{plugin-metadata-cache-BXH5NF-4.js → plugin-metadata-cache-CTCT3w5L.js} +162 -135
- package/dist/{protocol-validators-VAVyEnDp.js → protocol-validators-VeJxxJ0U.js} +25 -3
- package/dist/{rate-limits-BI1dMHDG.js → rate-limits-C5_D8Gmb.js} +1 -1
- package/dist/{request-DSK0W6YI.js → request-DXXGHko0.js} +2 -2
- package/dist/{run-attempt-BV3HzuCf.js → run-attempt-DYc0QCBF.js} +346 -267
- package/dist/{sandbox-guard-C1qEeZ5C.js → sandbox-guard-kuWTn9C5.js} +1 -1
- package/dist/{session-binding-BTrLf9Qm.js → session-binding-Bcynfd-_.js} +1 -1
- package/dist/{session-catalog-ezP_UcRM.js → session-catalog-DaLKVtpH.js} +17 -16
- package/dist/{session-cli-B1hKvfkI.js → session-cli-DMc4oS2w.js} +1 -1
- package/dist/session-permission-policy-BrNH1bjy.js +160 -0
- package/dist/{session-retirement-CE4iMiLh.js → session-retirement-CcNC3YSY.js} +3 -3
- package/dist/{session-upstream-marker-D_2npHlA.js → session-upstream-marker-BIkusb95.js} +1 -1
- package/dist/{settled-turn-finalizer-Dx1onIqg.js → settled-turn-finalizer-Dc3ApjU4.js} +4 -4
- package/dist/{shared-client-Dw-rzii0.js → shared-client-DKz23hHY.js} +1026 -248
- package/dist/{side-question-DbXkJZzg.js → side-question-DjA_jsNe.js} +65 -36
- package/dist/{thread-lifecycle-DKdrnTMX.js → thread-lifecycle-L7oEkTlq.js} +850 -35
- package/dist/{thread-ownership-i2NBwDUL.js → thread-ownership-DZeuKH1j.js} +2 -2
- package/dist/{thread-resume-CdJk2Ehf.js → thread-resume-BE9qNEW0.js} +3 -3
- package/dist/{transcript-mirror-BU0_LKAL.js → transcript-mirror-DsCMWBca.js} +91 -10
- package/dist/{upstream-session-fork-BDVJCLAD.js → upstream-session-fork-DlaHxSLC.js} +3 -3
- package/dist/{usage-9dKJCgcy.js → usage-ROIaW3wo.js} +3 -3
- package/dist/{web-search-provider.runtime-DCdx4DGu.js → web-search-provider.runtime-ClaNPV7N.js} +3 -3
- package/openclaw.plugin.json +18 -1
- package/package.json +8 -8
- package/dist/app-server-policy-bg5QPSVP.js +0 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as isCodexRemoteExecPlacementSandbox } from "./config-
|
|
1
|
+
import { p as isCodexRemoteExecPlacementSandbox } from "./config-giW8X0QA.js";
|
|
2
2
|
import { resolveAgentConfig, tryResolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
3
3
|
import { getSessionEntry } from "openclaw/plugin-sdk/session-store-runtime";
|
|
4
4
|
import { normalizeAgentId, parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import {
|
|
2
|
+
import { P as normalizeCodexServiceTier, y as CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN } from "./config-giW8X0QA.js";
|
|
3
3
|
import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./session-binding-meta-B7aEMU7g.js";
|
|
4
4
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { AgentHarnessSessionSupersededError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { c as reclaimCurrentCodexSessionGeneration, d as sessionBindingIdentity } from "./session-binding-
|
|
4
|
-
import { n as assertCodexThreadForkParams } from "./protocol-validators-
|
|
5
|
-
import { i as replaceCodexCatalogConnectionHomes, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-
|
|
1
|
+
import { S as resolveCodexAppServerUserHomeDir, h as readCodexPluginConfig, s as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-giW8X0QA.js";
|
|
2
|
+
import { G as CodexAppServerRpcError, St as resolveCodexAppServerLocalHomeDir, U as resolveCodexAppServerClientInstanceId, ht as CODEX_INTERACTIVE_THREAD_SOURCE_KINDS, mt as CODEX_INTERACTIVE_CUSTOM_THREAD_SOURCES, o as getLeasedSharedCodexAppServerClient, p as releaseLeasedSharedCodexAppServerClient, rt as withTimeout, vt as isJsonObject, xt as resolveCodexAppServerHomeDir } from "./shared-client-DKz23hHY.js";
|
|
3
|
+
import { c as reclaimCurrentCodexSessionGeneration, d as sessionBindingIdentity } from "./session-binding-Bcynfd-_.js";
|
|
4
|
+
import { n as assertCodexThreadForkParams } from "./protocol-validators-VeJxxJ0U.js";
|
|
5
|
+
import { i as replaceCodexCatalogConnectionHomes, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-C1CAdfcP.js";
|
|
6
6
|
import { n as codexCatalogHomeId, t as canonicalCodexCatalogHome } from "./session-catalog-home-id-BNwAJ9D7.js";
|
|
7
|
-
import { r as importCodexThreadHistoryToTranscript } from "./transcript-mirror-
|
|
8
|
-
import { t as CODEX_CONTROL_METHODS } from "./capabilities-
|
|
9
|
-
import { r as formatCodexDisplayText } from "./command-formatters-
|
|
7
|
+
import { r as importCodexThreadHistoryToTranscript } from "./transcript-mirror-DsCMWBca.js";
|
|
8
|
+
import { t as CODEX_CONTROL_METHODS } from "./capabilities-BRMh0aIq.js";
|
|
9
|
+
import { r as formatCodexDisplayText } from "./command-formatters-DEsIufkt.js";
|
|
10
10
|
import { n as createCodexCliNodeConversationBindingData } from "./conversation-binding-data-CW2GuupV.js";
|
|
11
|
-
import { n as requestCodexAppServerClientJson } from "./request-
|
|
12
|
-
import { t as codexControlRequest } from "./command-rpc-
|
|
13
|
-
import { i as createImportedCodexSession, n as codexUpstreamBaseline, r as codexUpstreamContinueResult, t as codexLastTerminalTurnId } from "./session-upstream-marker-
|
|
11
|
+
import { n as requestCodexAppServerClientJson } from "./request-DXXGHko0.js";
|
|
12
|
+
import { t as codexControlRequest } from "./command-rpc-CCeCkf_v.js";
|
|
13
|
+
import { i as createImportedCodexSession, n as codexUpstreamBaseline, r as codexUpstreamContinueResult, t as codexLastTerminalTurnId } from "./session-upstream-marker-BIkusb95.js";
|
|
14
14
|
import { asFiniteNumber, isRecord, normalizeBoundedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
15
15
|
import fs from "node:fs/promises";
|
|
16
16
|
import path from "node:path";
|
|
@@ -19,7 +19,6 @@ import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path";
|
|
|
19
19
|
import fsSync from "node:fs";
|
|
20
20
|
import os from "node:os";
|
|
21
21
|
import { listAgentIds, resolveAgentDir, resolveAllowedModelRef, resolveDefaultAgentDir, resolveDefaultAgentId, resolveDefaultModelForAgent, resolveSessionAgentIds } from "openclaw/plugin-sdk/agent-runtime";
|
|
22
|
-
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
23
22
|
import { runCommandBuffered } from "openclaw/plugin-sdk/process-runtime";
|
|
24
23
|
import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
|
|
25
24
|
import { resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
@@ -31,6 +30,7 @@ import { root } from "openclaw/plugin-sdk/file-access-runtime";
|
|
|
31
30
|
import process$1 from "node:process";
|
|
32
31
|
import { createSessionCatalogAdoptionCoordinator, listSessionCatalogEntries, sessionCatalogAdoptedSessionKey, sessionCatalogAdoptedSourceKey } from "openclaw/plugin-sdk/session-catalog";
|
|
33
32
|
import { decodeNodePtyResumeParams, resolveNodeHostExecutable, runNodePtyCommand } from "openclaw/plugin-sdk/node-host";
|
|
33
|
+
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
34
34
|
import { createZstdDecompress } from "node:zlib";
|
|
35
35
|
//#region extensions/codex/src/jsonl-lines.ts
|
|
36
36
|
const JSONL_STREAM_THRESHOLD_BYTES = 4 * 1024 * 1024;
|
|
@@ -821,7 +821,7 @@ function filterCatalogPageByTitle(page, searchTerm) {
|
|
|
821
821
|
if (!searchTerm) return page;
|
|
822
822
|
return {
|
|
823
823
|
...page,
|
|
824
|
-
sessions: page.sessions.filter((session) => session.name?.toLocaleLowerCase().includes(searchTerm.toLocaleLowerCase()))
|
|
824
|
+
sessions: page.sessions.filter((session) => (session.name ?? session.fallbackName)?.toLocaleLowerCase().includes(searchTerm.toLocaleLowerCase()))
|
|
825
825
|
};
|
|
826
826
|
}
|
|
827
827
|
function unwrapNodeInvokePayload(value) {
|
|
@@ -1720,6 +1720,7 @@ async function readNodeCodexHistory(params) {
|
|
|
1720
1720
|
id: params.record.threadId,
|
|
1721
1721
|
createdAt: params.record.createdAt ?? 0,
|
|
1722
1722
|
modelProvider: params.record.modelProvider ?? "openai",
|
|
1723
|
+
projectId: null,
|
|
1723
1724
|
turns: page.data.toReversed()
|
|
1724
1725
|
};
|
|
1725
1726
|
return {
|
|
@@ -1783,7 +1784,7 @@ async function continueNodeCodexSessionInner(params) {
|
|
|
1783
1784
|
detachHint: "Start a new chat to leave the paired-node Codex session.",
|
|
1784
1785
|
data: createCodexCliNodeConversationBindingData({
|
|
1785
1786
|
nodeId,
|
|
1786
|
-
sessionId:
|
|
1787
|
+
sessionId: params.threadId,
|
|
1787
1788
|
agentId: adopted.agentId,
|
|
1788
1789
|
cwd: record.cwd
|
|
1789
1790
|
})
|
|
@@ -1802,7 +1803,7 @@ async function continueNodeCodexSession(params) {
|
|
|
1802
1803
|
const agentId = resolveSessionAgentIds({
|
|
1803
1804
|
config: params.config,
|
|
1804
1805
|
agentId: params.agentId
|
|
1805
|
-
}).
|
|
1806
|
+
}).sessionAgentId;
|
|
1806
1807
|
const sourceKey = sessionCatalogAdoptedSourceKey(`node:${nodeId}`, params.threadId);
|
|
1807
1808
|
const operationKey = sessionCatalogAdoptedSourceKey(agentId, sourceKey);
|
|
1808
1809
|
return await continueNodeAdoption({
|
|
@@ -2558,7 +2559,7 @@ function createCodexSessionCatalogControlFromRequests(params) {
|
|
|
2558
2559
|
continue;
|
|
2559
2560
|
}
|
|
2560
2561
|
const session = toCatalogSession(thread, false);
|
|
2561
|
-
if (session && (!search || session.name?.toLocaleLowerCase().includes(search))) sessions.push(session);
|
|
2562
|
+
if (session && (!search || (session.name ?? session.fallbackName)?.toLocaleLowerCase().includes(search))) sessions.push(session);
|
|
2562
2563
|
}
|
|
2563
2564
|
nextCursor = readControlCursor(response.nextCursor, "next response");
|
|
2564
2565
|
if (!nextCursor || sessions.length >= limit) break;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./session-catalog-
|
|
1
|
+
import "./session-catalog-DaLKVtpH.js";
|
|
2
2
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
4
4
|
import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { A as selectUserApprovalsReviewer, E as parseAllowedSandboxModesFromCodexRequirements, M as selectGuardianSandbox, O as selectGuardianApprovalPolicy, T as parseAllowedApprovalsReviewersFromCodexRequirements, k as selectGuardianApprovalsReviewer, l as resolveCodexAppServerNetworkProxy, w as parseAllowedApprovalPoliciesFromCodexRequirements, x as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-giW8X0QA.js";
|
|
2
|
+
import { hostname } from "node:os";
|
|
3
|
+
import { isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
|
|
4
|
+
//#region extensions/codex/src/app-server/app-server-policy.ts
|
|
5
|
+
function resolveCodexAppServerForModelProvider(params) {
|
|
6
|
+
const explicitProvider = normalizeModelBackedReviewerProvider(params.provider);
|
|
7
|
+
if (!isCodexModelBackedApprovalsReviewer(params.appServer.approvalsReviewer) || canUseCodexModelBackedApprovalsReviewerForModel({
|
|
8
|
+
modelProvider: explicitProvider,
|
|
9
|
+
model: params.model,
|
|
10
|
+
config: params.config,
|
|
11
|
+
env: {
|
|
12
|
+
...params.env ?? process.env,
|
|
13
|
+
...params.appServer.start.env
|
|
14
|
+
},
|
|
15
|
+
agentDir: params.agentDir,
|
|
16
|
+
codexConfigToml: params.codexConfigToml,
|
|
17
|
+
homeScope: params.appServer.start.homeScope,
|
|
18
|
+
codexArgs: params.appServer.start.args
|
|
19
|
+
})) return params.appServer;
|
|
20
|
+
return {
|
|
21
|
+
...params.appServer,
|
|
22
|
+
approvalsReviewer: "user"
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function isCodexModelBackedApprovalsReviewer(value) {
|
|
26
|
+
return value === "auto_review" || value === "guardian_subagent";
|
|
27
|
+
}
|
|
28
|
+
function normalizeModelBackedReviewerProvider(provider) {
|
|
29
|
+
return provider?.trim().toLowerCase() || void 0;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region extensions/codex/src/app-server/session-permission-policy.ts
|
|
33
|
+
const CODEX_SESSION_PERMISSION_EXEC_MODES = {
|
|
34
|
+
"read-only": "deny",
|
|
35
|
+
guarded: "ask",
|
|
36
|
+
workspace: "auto",
|
|
37
|
+
full: "full"
|
|
38
|
+
};
|
|
39
|
+
function tupleForMode(mode, canUseAutoReview) {
|
|
40
|
+
switch (mode) {
|
|
41
|
+
case "read-only": return {
|
|
42
|
+
sandbox: "read-only",
|
|
43
|
+
approvalPolicy: "on-request",
|
|
44
|
+
approvalsReviewer: "user"
|
|
45
|
+
};
|
|
46
|
+
case "guarded": return {
|
|
47
|
+
sandbox: "workspace-write",
|
|
48
|
+
approvalPolicy: "on-request",
|
|
49
|
+
approvalsReviewer: "user"
|
|
50
|
+
};
|
|
51
|
+
case "workspace": return {
|
|
52
|
+
sandbox: "workspace-write",
|
|
53
|
+
approvalPolicy: "on-request",
|
|
54
|
+
approvalsReviewer: canUseAutoReview ? "auto_review" : "user"
|
|
55
|
+
};
|
|
56
|
+
case "full": return {
|
|
57
|
+
sandbox: "danger-full-access",
|
|
58
|
+
approvalPolicy: "never",
|
|
59
|
+
approvalsReviewer: "user"
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return mode;
|
|
63
|
+
}
|
|
64
|
+
function requirementsAllowTuple(tuple, allowed) {
|
|
65
|
+
return (allowed.sandboxes === void 0 || allowed.sandboxes.has(tuple.sandbox)) && (allowed.approvalPolicies === void 0 || allowed.approvalPolicies.has(tuple.approvalPolicy)) && (allowed.reviewers === void 0 || allowed.reviewers.has(tuple.approvalsReviewer));
|
|
66
|
+
}
|
|
67
|
+
function tightenTupleForExecMode(tuple, execMode, requiresPerCommandApproval) {
|
|
68
|
+
switch (execMode) {
|
|
69
|
+
case "deny":
|
|
70
|
+
case "allowlist": return {
|
|
71
|
+
sandbox: "read-only",
|
|
72
|
+
approvalPolicy: "on-request",
|
|
73
|
+
approvalsReviewer: "user"
|
|
74
|
+
};
|
|
75
|
+
case "ask": return {
|
|
76
|
+
...tuple,
|
|
77
|
+
approvalPolicy: requiresPerCommandApproval ? "untrusted" : "on-request",
|
|
78
|
+
approvalsReviewer: "user"
|
|
79
|
+
};
|
|
80
|
+
case "auto":
|
|
81
|
+
case "full":
|
|
82
|
+
case void 0: return tuple;
|
|
83
|
+
}
|
|
84
|
+
return execMode;
|
|
85
|
+
}
|
|
86
|
+
function clampSessionPermissionTuple(params) {
|
|
87
|
+
if (!params.requirementsToml) return params.requested;
|
|
88
|
+
const allowed = {
|
|
89
|
+
sandboxes: parseAllowedSandboxModesFromCodexRequirements(params.requirementsToml, params.hostName ?? hostname()),
|
|
90
|
+
approvalPolicies: parseAllowedApprovalPoliciesFromCodexRequirements(params.requirementsToml),
|
|
91
|
+
reviewers: parseAllowedApprovalsReviewersFromCodexRequirements(params.requirementsToml)
|
|
92
|
+
};
|
|
93
|
+
if (requirementsAllowTuple(params.requested, allowed)) return params.requested;
|
|
94
|
+
if (params.requested.approvalPolicy === "untrusted" && allowed.approvalPolicies?.has("untrusted") === false) throw new Error("tools.exec.ask=always requires Codex app-server per-command approvals");
|
|
95
|
+
const userReviewRequired = params.mode === "read-only" || params.mode === "guarded" || params.mode === "workspace" && !params.canUseAutoReview;
|
|
96
|
+
const sandboxAuthority = {
|
|
97
|
+
"read-only": 0,
|
|
98
|
+
"workspace-write": 1,
|
|
99
|
+
"danger-full-access": 2
|
|
100
|
+
};
|
|
101
|
+
const allowedSandboxes = new Set([
|
|
102
|
+
"read-only",
|
|
103
|
+
"workspace-write",
|
|
104
|
+
"danger-full-access"
|
|
105
|
+
].filter((sandbox) => sandboxAuthority[sandbox] <= sandboxAuthority[params.requested.sandbox] && (allowed.sandboxes === void 0 || allowed.sandboxes.has(sandbox))));
|
|
106
|
+
if (allowedSandboxes.size === 0) throw new Error(`Codex session permission mode=${params.mode} cannot satisfy managed sandbox requirements without widening access`);
|
|
107
|
+
return {
|
|
108
|
+
sandbox: selectGuardianSandbox(allowedSandboxes),
|
|
109
|
+
approvalPolicy: params.requested.approvalPolicy === "untrusted" ? "untrusted" : selectGuardianApprovalPolicy(allowed.approvalPolicies, userReviewRequired ? "ask" : "auto"),
|
|
110
|
+
approvalsReviewer: userReviewRequired ? selectUserApprovalsReviewer(allowed.reviewers) : selectGuardianApprovalsReviewer(allowed.reviewers, "auto")
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/** Applies one complete session-mode tuple without mixing requirements-clamped fields. */
|
|
114
|
+
function applyCodexSessionPermissionPolicy(params) {
|
|
115
|
+
if (!params.permissionMode) return params.appServer;
|
|
116
|
+
const sessionRoot = params.sessionRoot?.trim() || params.defaultRoot;
|
|
117
|
+
if (params.policyLocked) return {
|
|
118
|
+
...params.appServer,
|
|
119
|
+
sessionRoot
|
|
120
|
+
};
|
|
121
|
+
const requested = tightenTupleForExecMode(tupleForMode(params.permissionMode, params.canUseAutoReview), params.execMode, params.appServer.approvalPolicy === "untrusted");
|
|
122
|
+
const tuple = params.appServer.start.transport === "stdio" ? clampSessionPermissionTuple({
|
|
123
|
+
mode: params.permissionMode,
|
|
124
|
+
requested,
|
|
125
|
+
requirementsToml: params.requirementsToml,
|
|
126
|
+
hostName: params.hostName,
|
|
127
|
+
canUseAutoReview: params.canUseAutoReview
|
|
128
|
+
}) : requested;
|
|
129
|
+
const networkProxy = params.appServer.networkProxy ? resolveCodexAppServerNetworkProxy(params.pluginConfig.appServer?.networkProxy, tuple.sandbox).networkProxy : void 0;
|
|
130
|
+
const resolved = {
|
|
131
|
+
...params.appServer,
|
|
132
|
+
...tuple,
|
|
133
|
+
sessionRoot
|
|
134
|
+
};
|
|
135
|
+
if (networkProxy) resolved.networkProxy = networkProxy;
|
|
136
|
+
else delete resolved.networkProxy;
|
|
137
|
+
return resolved;
|
|
138
|
+
}
|
|
139
|
+
function resolveCodexEffectiveSessionPermissionPolicy(params) {
|
|
140
|
+
if (!params.permissionMode) return;
|
|
141
|
+
const root = params.sessionRoot?.trim() || params.defaultRoot;
|
|
142
|
+
const { sandbox, approvalPolicy, approvalsReviewer } = params.appServer;
|
|
143
|
+
const fullAccess = params.permissionMode === "full" && sandbox === "danger-full-access" && approvalPolicy === "never";
|
|
144
|
+
const guardianReview = params.permissionMode !== "guarded" && sandbox === "workspace-write" && approvalPolicy === "on-request" && approvalsReviewer !== "user";
|
|
145
|
+
const mode = params.permissionMode === "read-only" || sandbox === "read-only" ? "read-only" : fullAccess ? "full" : guardianReview ? "workspace" : "guarded";
|
|
146
|
+
return {
|
|
147
|
+
mode,
|
|
148
|
+
root,
|
|
149
|
+
execMode: CODEX_SESSION_PERMISSION_EXEC_MODES[mode]
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/** Keeps relative execution inside the prepared root without filesystem rediscovery. */
|
|
153
|
+
function resolveCodexSessionPermissionCwd(params) {
|
|
154
|
+
if (!params.permissionMode) return params.requestedCwd ?? params.fallbackCwd;
|
|
155
|
+
const sessionRoot = params.sessionRoot?.trim() || params.defaultRoot;
|
|
156
|
+
const requestedCwd = params.requestedCwd?.trim();
|
|
157
|
+
return requestedCwd && isPathInside(sessionRoot, requestedCwd) ? requestedCwd : sessionRoot;
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
160
|
+
export { resolveCodexAppServerForModelProvider as a, resolveCodexSessionPermissionCwd as i, applyCodexSessionPermissionPolicy as n, resolveCodexEffectiveSessionPermissionPolicy as r, CODEX_SESSION_PERMISSION_EXEC_MODES as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as closeCodexStartupClientBestEffort, d as unsubscribeCodexThreadBestEffort, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-
|
|
1
|
+
import { $ as releaseCodexAppServerLiveThread, h as retainSharedCodexAppServerClientByInstanceId } from "./shared-client-DKz23hHY.js";
|
|
2
|
+
import { a as closeCodexStartupClientBestEffort, d as unsubscribeCodexThreadBestEffort, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-bfsmcQ6m.js";
|
|
3
3
|
import { t as isIncognitoSessionKey } from "./incognito-session-ET_ufDH-.js";
|
|
4
|
-
import { t as codexNativeSubagentMonitorRuntime } from "./native-subagent-monitor-
|
|
4
|
+
import { t as codexNativeSubagentMonitorRuntime } from "./native-subagent-monitor-4Mfq2HDs.js";
|
|
5
5
|
//#region extensions/codex/src/app-server/session-retirement.ts
|
|
6
6
|
/** Retire binding and native subscription under the same generation/physical-client ownership fence. */
|
|
7
7
|
async function retireCodexAppServerSessionGeneration(params) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as importCodexThreadHistoryToTranscript } from "./transcript-mirror-
|
|
1
|
+
import { r as importCodexThreadHistoryToTranscript } from "./transcript-mirror-DsCMWBca.js";
|
|
2
2
|
import { resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
3
3
|
//#region extensions/codex/src/app-server/session-history-import.ts
|
|
4
4
|
/** Creates a session whose transcript is derived from one verified Codex thread snapshot. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { vt as isJsonObject } from "./shared-client-DKz23hHY.js";
|
|
2
2
|
import { i as readUpstreamUserText, r as readMirrorIdentity, t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-CFmsKwr9.js";
|
|
3
|
-
import { c as readCodexMirrorSourceFingerprint, s as fingerprintCodexMirrorSourceMessage, t as codexTranscriptMirrorRuntime } from "./transcript-mirror-
|
|
4
|
-
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-
|
|
5
|
-
import {
|
|
3
|
+
import { c as readCodexMirrorSourceFingerprint, s as fingerprintCodexMirrorSourceMessage, t as codexTranscriptMirrorRuntime } from "./transcript-mirror-DsCMWBca.js";
|
|
4
|
+
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-B7iBUcuP.js";
|
|
5
|
+
import { r as createAssistantMessage } from "./event-projector-assistant-message-C5-Ds8mA.js";
|
|
6
6
|
import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { Buffer } from "node:buffer";
|
|
8
8
|
import { isSilentReplyText } from "openclaw/plugin-sdk/reply-runtime";
|