@openclaw/codex 2026.9.2 → 2026.9.4
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 +29 -26
- package/dist/apply-CvT8tW5i.js +356 -0
- package/dist/{attempt-client-cleanup-Bp1ZOnk2.js → attempt-client-cleanup-DKHzbwt5.js} +38 -214
- package/dist/{attempt-context-CSazkWns.js → attempt-context-D44yeDII.js} +9 -7
- package/dist/{event-projector-usage-ZqEVbAEY.js → attempt-notifications-C9XufG6l.js} +3 -106
- package/dist/{auth-binding-Ds_QVm-X.js → auth-binding-CWlKVccJ.js} +2 -2
- package/dist/auth-cache-key-7orQae_j.js +498 -0
- package/dist/auth-profile-CwzO4_RG.js +43 -0
- package/dist/auth-profile-selection-DFu9e167.js +45 -0
- package/dist/binding-connection-D3udKbIE.js +60 -0
- package/dist/{bounded-turn-DxGJRYbY.js → bounded-turn-C_Hneydj.js} +28 -125
- package/dist/build-state-BCmg9-5p.js +19 -0
- package/dist/{capabilities-B1mgvpP8.js → capabilities-8vx68WLH.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/client-B57KWPQx.js +4005 -0
- package/dist/command-dispatch-BpduNGVf.js +21 -0
- package/dist/{command-formatters-DSbGMXA0.js → command-formatters-lxlkNZgU.js} +4 -3
- package/dist/{command-handlers-DOJvGv6-.js → command-handlers-tiL9iWj7.js} +788 -135
- package/dist/command-rpc-CR5EOEZX.js +233 -0
- package/dist/{compact-Y_xBqrHN.js → compact-B_H3AOd7.js} +19 -14
- package/dist/config-oIORaQ5T.js +106 -0
- package/dist/{config-CyapYSji.js → config-options-CXMq1T-C.js} +205 -593
- package/dist/config-runtime-D0zGNIHu.js +11 -0
- package/dist/{config-utils-C57JiJrU.js → config-utils-DujwEnhg.js} +2 -4
- package/dist/conversation-binding-DsB4-O7U.js +900 -0
- package/dist/{plugin-marketplace-discovery-B7gHXJ3d.js → conversation-control-CtUu1b3m.js} +11 -143
- package/dist/doctor-contract-api.js +5 -5
- package/dist/{dynamic-tools-BwpvTxaX.js → dynamic-tools-CmN5RAip.js} +133 -76
- package/dist/{effective-mcp-catalog-CY9Jn4bA.js → effective-mcp-catalog-Bd73bqA8.js} +3 -3
- package/dist/{elicitation-input-DMkeki8d.js → elicitation-input-DPoK8F7w.js} +8 -22
- package/dist/ephemeral-turn-D78_VmzO.js +101 -0
- package/dist/{event-projector-assistant-message-B9kp6iGC.js → event-projector-assistant-message-BmBM4qBV.js} +12 -25
- package/dist/event-projector-items-5VhsECCO.js +200 -0
- package/dist/event-projector-usage-BfXmpOec.js +102 -0
- package/dist/{harness-Czh2Sdoc.js → harness-C7rRa7bm.js} +48 -24
- package/dist/harness.js +1 -1
- package/dist/history-rejection-B4nOXNXF.js +13 -0
- package/dist/incognito-session-uhrBF6wJ.js +15 -0
- package/dist/index.js +406 -2915
- package/dist/inference-context-Dr_mzvk4.js +94 -0
- package/dist/inference-proxy-HGXKUIre.js +311 -0
- package/dist/{isolated-completion-CRh-51AK.js → isolated-completion-DWVb5U2J.js} +7 -4
- package/dist/launch-args-RXQwn8zV.js +90 -0
- package/dist/{managed-binary-DcpnJF9x.js → managed-binary-D22rNEcR.js} +13 -103
- package/dist/managed-thread-store-D1t5jh3G.js +66 -0
- package/dist/media-understanding-provider.js +4 -1
- package/dist/migration-provider-api.js +2 -0
- package/dist/{model-catalog-DT5vo6qo.js → model-catalog-Dq2n8f_p.js} +6 -5
- package/dist/{models-CcrgSMQR.js → models-PCKOim-h.js} +3 -3
- package/dist/native-execution-policy-umd0tgh4.js +128 -0
- package/dist/native-subagent-history-DjtPloaU.js +140 -0
- package/dist/native-subagent-history-owner-Pcp7JuVF.js +34 -0
- package/dist/{native-subagent-monitor-B3bvQGcg.js → native-subagent-monitor-fQ7eIXEf.js} +115 -460
- package/dist/native-subagent-task-ids-BzTdT0Uw.js +387 -0
- package/dist/node-cli-sessions-DKaOmVUh.js +527 -0
- package/dist/{node-exec-server.runtime-nfbUOtUB.js → node-exec-server.runtime-Cl2vapEi.js} +55 -24
- package/dist/plan-7uG-Fp36.js +947 -0
- package/dist/plugin-activation-BYQculil.js +138 -0
- package/dist/{thread-resume-BLgqkUc1.js → plugin-app-cache-key-d0eKxy7b.js} +4 -52
- package/dist/{plugin-approval-roundtrip-aQVdyL5g.js → plugin-approval-roundtrip-Bz3FT8W5.js} +1 -1
- package/dist/plugin-inventory-oL4Na1ZG.js +328 -0
- package/dist/plugin-marketplace-discovery-P-Vndfqq.js +137 -0
- package/dist/{plugin-metadata-cache-BwCLTY_U.js → plugin-metadata-cache-ClPJpRio.js} +17 -9
- package/dist/protocol-5bh1G-H7.js +275 -0
- package/dist/provider-MQ8PVkuE.js +50 -0
- package/dist/{provider-capabilities-BpG9Ltc5.js → provider-capabilities-BvCUL69A.js} +2 -2
- package/dist/{rate-limits-Fx_l4eNa.js → rate-limits-CBMmWBr9.js} +1 -1
- package/dist/request-B7hEkBGq.js +212 -0
- package/dist/rpc-error-ttN_QjEm.js +30 -0
- package/dist/{run-attempt-BzthFQSM.js → run-attempt-CvsAAGa0.js} +664 -377
- package/dist/{runtime-artifact-Bh_gf6-t.js → runtime-artifact-BJ0rXBZ_.js} +27 -27
- package/dist/sandbox-guard-BxgyoM8M.js +166 -0
- package/dist/{session-binding-4Ki04sW-.js → session-binding-CI8UuilT.js} +30 -48
- package/dist/{session-binding-record-CyaXZvTe.js → session-binding-record-Bcvslnhf.js} +12 -26
- package/dist/session-catalog-adoption-tcZi1IfX.js +251 -0
- package/dist/session-catalog-archive-CwKg8Xz2.js +56 -0
- package/dist/session-catalog-ct-AH01I.js +1477 -0
- package/dist/session-catalog-home-id-CwhLdC03.js +18 -0
- package/dist/session-catalog-node-adoption-B1tgDW-m.js +182 -0
- package/dist/session-catalog-node-continue-Ci-DXyJP.js +238 -0
- package/dist/session-catalog-provenance-D-dIfRAH.js +96 -0
- package/dist/{session-cli-BjLhpmS1.js → session-cli-DNN_jhGc.js} +3 -2
- package/dist/{session-history-DWmMqiqW.js → session-history-Cz-tOOYj.js} +6 -3
- package/dist/{session-upstream-marker-DReTpGz6.js → session-history-import-DwyijFI6.js} +5 -50
- package/dist/{session-history-read-LHldwvyh.js → session-history-read-cxPUxyVV.js} +21 -7
- package/dist/session-history-worker-runtime.js +18 -6
- package/dist/session-history.worker-BeK1YOyT.js +378 -0
- package/dist/session-history.worker.js +1 -1
- package/dist/{session-initialization-BCFVnLL4.js → session-initialization-Ct0_Hzmg.js} +2 -2
- package/dist/{session-permission-policy-BaueHmSj.js → session-permission-policy-BBmXA8Eg.js} +4 -7
- package/dist/{session-retirement-DNdmYdFc.js → session-retirement-B2YfbAAT.js} +6 -5
- package/dist/session-upstream-marker-D15C9NHp.js +46 -0
- package/dist/{settled-turn-context-BOM3Y1pl.js → settled-turn-context-Du6gdUDd.js} +9 -9
- package/dist/{settled-turn-finalizer-BI-b1sry.js → settled-turn-finalizer-Dn91stmc.js} +8 -7
- package/dist/shared-client-CscigXXL.js +3109 -0
- package/dist/{side-question-B6DWAw1A.js → side-question-BGMJQf4U.js} +65 -170
- package/dist/source-CElXU0Oy.js +518 -0
- package/dist/thread-archive-guard-DfpBr-Sz.js +53 -0
- package/dist/thread-history-page-D0JIp48V.js +361 -0
- package/dist/{thread-lifecycle-DPK30jad.js → thread-lifecycle-DXl1-I6b.js} +187 -639
- package/dist/{thread-ownership-CbucAmmp.js → thread-ownership-BsDRTsyp.js} +13 -15
- package/dist/thread-policy-BuEQfE0g.js +54 -0
- package/dist/thread-resume-DsDOZpFg.js +52 -0
- package/dist/timeout-BVw8aaM1.js +33 -0
- package/dist/transcript-history-projection-v17wXgdK.js +238 -0
- package/dist/{transcript-mirror-_njEB84z.js → transcript-mirror-C5CKgNy6.js} +50 -260
- package/dist/{transcript-mirror-attestation-Byl34PC-.js → transcript-mirror-attestation-DibE0krH.js} +17 -4
- package/dist/{transport-stdio-CzTngV0j.js → transport-stdio-BGjHoYLr.js} +73 -43
- package/dist/{upstream-session-fork-1fwbNKzQ.js → upstream-session-fork-BZerMte_.js} +27 -19
- package/dist/{usage-i9fv5-4m.js → usage-tCk-mg_x.js} +4 -3
- package/dist/version-omm6IPI3.js +12 -0
- package/dist/{web-search-provider.runtime-DKQn67A7.js → web-search-provider.runtime-B7bGbGWq.js} +3 -3
- package/openclaw.plugin.json +23 -1
- package/package.json +4 -4
- package/dist/request-C8H22rPi.js +0 -475
- package/dist/session-catalog-B47uwekb.js +0 -3272
- package/dist/session-history.worker-zZVcx0ME.js +0 -267
- package/dist/shared-client-CKhX2kFt.js +0 -7505
- package/dist/thread-policy-CTalhWFy.js +0 -105
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
+
import { o as isJsonObject } from "./protocol-5bh1G-H7.js";
|
|
3
|
+
import { n as describeControlFailure, t as CODEX_CONTROL_METHODS } from "./capabilities-8vx68WLH.js";
|
|
4
|
+
import { i as requestCodexAppServerJson, o as withCodexAppServerJsonClient } from "./request-B7hEkBGq.js";
|
|
5
|
+
import "./config-oIORaQ5T.js";
|
|
6
|
+
import { n as resolveCodexAppServerRuntimeOptions, r as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-runtime-D0zGNIHu.js";
|
|
7
|
+
import { r as prepareCodexAppServerAuthBinding } from "./auth-binding-CWlKVccJ.js";
|
|
8
|
+
import { a as resolveCodexAppServerAuthProfileStore, r as resolveCodexAppServerAuthProfileId } from "./auth-profile-CwzO4_RG.js";
|
|
9
|
+
import { tt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-CscigXXL.js";
|
|
10
|
+
import { a as closeCodexStartupClientBestEffort } from "./attempt-client-cleanup-DKHzbwt5.js";
|
|
11
|
+
import { n as listCodexAppServerModels } from "./models-PCKOim-h.js";
|
|
12
|
+
import { n as createCodexSessionGenerationSupersededError } from "./session-binding-CI8UuilT.js";
|
|
13
|
+
import { t as resumeCodexAppServerThread } from "./thread-resume-DsDOZpFg.js";
|
|
14
|
+
import { resolveAgentDir, resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
15
|
+
import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
16
|
+
import { prepareAgentRuntimeAuth } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
17
|
+
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
18
|
+
import { resolveSessionModelRef } from "openclaw/plugin-sdk/model-session-runtime";
|
|
19
|
+
import { resolveApiKeyForProvider } from "openclaw/plugin-sdk/provider-auth-runtime";
|
|
20
|
+
//#region extensions/codex/src/command-rpc.ts
|
|
21
|
+
var command_rpc_exports = /* @__PURE__ */ __exportAll({
|
|
22
|
+
codexControlRequest: () => codexControlRequest,
|
|
23
|
+
prepareCodexControlSessionAuth: () => prepareCodexControlSessionAuth,
|
|
24
|
+
readCodexStatusProbes: () => readCodexStatusProbes,
|
|
25
|
+
requestOptions: () => requestOptions,
|
|
26
|
+
safeCodexControlRequest: () => safeCodexControlRequest
|
|
27
|
+
});
|
|
28
|
+
/** Selects the same prepared auth partition as an admitted session turn. */
|
|
29
|
+
async function prepareCodexControlSessionAuth(options, startOptions) {
|
|
30
|
+
if (!options.config || !options.sessionKey || !options.sessionId) {
|
|
31
|
+
if (options.onResponse) throw new Error("Codex control subscription requires admitted session authority.");
|
|
32
|
+
return {
|
|
33
|
+
authProfileId: options.authProfileId ?? void 0,
|
|
34
|
+
clientOptions: { authProfileId: options.authProfileId }
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const config = options.config;
|
|
38
|
+
const { sessionAgentId } = resolveSessionAgentIdsStrict({
|
|
39
|
+
config,
|
|
40
|
+
sessionKey: options.sessionKey,
|
|
41
|
+
agentId: options.agentId
|
|
42
|
+
});
|
|
43
|
+
const agentDir = options.agentDir ?? resolveAgentDir(config, sessionAgentId);
|
|
44
|
+
const workspaceDir = resolveAgentWorkspaceDir(config, sessionAgentId);
|
|
45
|
+
const entry = getSessionEntry({
|
|
46
|
+
agentId: sessionAgentId,
|
|
47
|
+
storePath: options.storePath?.trim() || resolveStorePath(config.session?.store, { agentId: sessionAgentId }),
|
|
48
|
+
sessionKey: options.sessionKey,
|
|
49
|
+
hydrateSkillPromptRefs: false,
|
|
50
|
+
readConsistency: "latest"
|
|
51
|
+
});
|
|
52
|
+
if (entry?.sessionId !== options.sessionId) throw createCodexSessionGenerationSupersededError(options.sessionId);
|
|
53
|
+
if (options.authProfileId === null || startOptions.homeScope === "user") return {
|
|
54
|
+
authProfileId: options.authProfileId ?? void 0,
|
|
55
|
+
clientOptions: { authProfileId: options.authProfileId }
|
|
56
|
+
};
|
|
57
|
+
const model = resolveSessionModelRef(config, entry, sessionAgentId);
|
|
58
|
+
const authProfileId = entry?.authProfileOverride ?? options.authProfileId;
|
|
59
|
+
const store = resolveCodexAppServerAuthProfileStore({
|
|
60
|
+
agentDir,
|
|
61
|
+
config,
|
|
62
|
+
authProfileId
|
|
63
|
+
});
|
|
64
|
+
const { plan, attempts } = prepareAgentRuntimeAuth({
|
|
65
|
+
provider: model.provider,
|
|
66
|
+
modelId: model.model,
|
|
67
|
+
config,
|
|
68
|
+
agentDir,
|
|
69
|
+
workspaceDir,
|
|
70
|
+
authProfileStore: store,
|
|
71
|
+
sessionAuthProfileId: authProfileId,
|
|
72
|
+
sessionAuthProfileSource: entry?.authProfileOverrideSource,
|
|
73
|
+
harnessId: "codex",
|
|
74
|
+
harnessAuthBootstrap: "harness"
|
|
75
|
+
});
|
|
76
|
+
const route = plan.modelRoute;
|
|
77
|
+
const resolvedAuth = route ? await resolveApiKeyForProvider({
|
|
78
|
+
provider: route.provider,
|
|
79
|
+
modelId: route.modelId,
|
|
80
|
+
modelApi: route.api,
|
|
81
|
+
cfg: config,
|
|
82
|
+
agentDir,
|
|
83
|
+
workspaceDir,
|
|
84
|
+
store,
|
|
85
|
+
profileId: attempts[0]?.profileId,
|
|
86
|
+
lockedProfile: plan.forwardedAuthProfileSource === "user",
|
|
87
|
+
allowAuthProfileFallback: attempts[0]?.allowAuthProfileFallback,
|
|
88
|
+
skipSetupProviderFallback: true
|
|
89
|
+
}) : void 0;
|
|
90
|
+
const handoff = await resolveCodexAppServerPreparedAuthHandoff({
|
|
91
|
+
authRequirement: route?.authRequirement,
|
|
92
|
+
resolvedApiKey: resolvedAuth?.apiKey,
|
|
93
|
+
authProfileId: route ? plan.forwardedAuthProfileId : resolveCodexAppServerAuthProfileId({
|
|
94
|
+
authProfileId: plan.forwardedAuthProfileId,
|
|
95
|
+
store,
|
|
96
|
+
config
|
|
97
|
+
}),
|
|
98
|
+
authProfileStore: store,
|
|
99
|
+
agentDir,
|
|
100
|
+
homeScope: startOptions.homeScope ?? "agent",
|
|
101
|
+
config,
|
|
102
|
+
subscriptionProfileRequiredError: "Prepared Codex subscription route requires a forwarded OpenAI OAuth or token profile.",
|
|
103
|
+
subscriptionProfileUnusableError: "Prepared Codex subscription auth profile is unusable."
|
|
104
|
+
});
|
|
105
|
+
const binding = handoff.authProfileId ? await prepareCodexAppServerAuthBinding({
|
|
106
|
+
authProfileId: handoff.authProfileId,
|
|
107
|
+
authProfileStore: store,
|
|
108
|
+
agentDir,
|
|
109
|
+
config
|
|
110
|
+
}) : void 0;
|
|
111
|
+
return {
|
|
112
|
+
authProfileId: handoff.authProfileId,
|
|
113
|
+
clientOptions: {
|
|
114
|
+
...handoff.preparedAuth ? { preparedAuth: handoff.preparedAuth } : { authProfileId: handoff.authProfileId },
|
|
115
|
+
authRequirement: route?.authRequirement,
|
|
116
|
+
authProfileStore: binding?.authProfileStore ?? store,
|
|
117
|
+
authBindingFingerprint: binding?.fingerprint,
|
|
118
|
+
agentDir
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function requestOptions(pluginConfig, limit, config, agentDir) {
|
|
123
|
+
const runtime = resolveCodexAppServerRuntimeOptions({ pluginConfig });
|
|
124
|
+
return {
|
|
125
|
+
limit,
|
|
126
|
+
timeoutMs: runtime.requestTimeoutMs,
|
|
127
|
+
startOptions: runtime.start,
|
|
128
|
+
config,
|
|
129
|
+
agentDir
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
async function codexControlRequest(pluginConfig, method, requestParams, options = {}) {
|
|
133
|
+
const runtime = options.startOptions ? resolveCodexSupervisionAppServerRuntimeOptions({ pluginConfig }) : resolveCodexAppServerRuntimeOptions({ pluginConfig });
|
|
134
|
+
const startOptions = options.startOptions ?? runtime.start;
|
|
135
|
+
const auth = options.onResponse ? await prepareCodexControlSessionAuth(options, startOptions) : {
|
|
136
|
+
authProfileId: options.authProfileId ?? void 0,
|
|
137
|
+
clientOptions: { authProfileId: options.authProfileId }
|
|
138
|
+
};
|
|
139
|
+
const controlRequestOptions = {
|
|
140
|
+
timeoutMs: options.timeoutMs ?? runtime.requestTimeoutMs,
|
|
141
|
+
assertCurrent: options.assertCurrent,
|
|
142
|
+
startOptions,
|
|
143
|
+
config: options.config,
|
|
144
|
+
sessionKey: options.sessionKey,
|
|
145
|
+
sessionId: options.sessionId,
|
|
146
|
+
agentDir: options.agentDir,
|
|
147
|
+
isolated: options.isolated,
|
|
148
|
+
...auth.clientOptions
|
|
149
|
+
};
|
|
150
|
+
if (options.onResponse || options.beforeRequest) return await withCodexAppServerJsonClient(controlRequestOptions, async (request, client, scope) => {
|
|
151
|
+
await options.beforeRequest?.(request, client, scope);
|
|
152
|
+
scope.assertCurrent();
|
|
153
|
+
let response;
|
|
154
|
+
if (method === "thread/resume") {
|
|
155
|
+
if (!isJsonObject(requestParams) || typeof requestParams.threadId !== "string") throw new Error("Codex thread/resume requires a thread id.");
|
|
156
|
+
response = await resumeCodexAppServerThread({
|
|
157
|
+
client,
|
|
158
|
+
request: {
|
|
159
|
+
...requestParams,
|
|
160
|
+
threadId: requestParams.threadId
|
|
161
|
+
},
|
|
162
|
+
requestResume: () => request({
|
|
163
|
+
method,
|
|
164
|
+
requestParams
|
|
165
|
+
}),
|
|
166
|
+
abandonClient: () => closeCodexStartupClientBestEffort(client)
|
|
167
|
+
});
|
|
168
|
+
} else response = await request({
|
|
169
|
+
method,
|
|
170
|
+
requestParams
|
|
171
|
+
});
|
|
172
|
+
await options.onResponse?.(response, client, {
|
|
173
|
+
authProfileId: auth.authProfileId,
|
|
174
|
+
assertCurrent: scope.assertCurrent
|
|
175
|
+
});
|
|
176
|
+
scope.assertCurrent();
|
|
177
|
+
return response;
|
|
178
|
+
});
|
|
179
|
+
return await requestCodexAppServerJson({
|
|
180
|
+
method,
|
|
181
|
+
requestParams,
|
|
182
|
+
...controlRequestOptions
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
async function safeCodexControlRequest(pluginConfig, method, requestParams, options = {}) {
|
|
186
|
+
return await safeValue(async () => await codexControlRequest(pluginConfig, method, requestParams, options));
|
|
187
|
+
}
|
|
188
|
+
async function safeCodexModelList(pluginConfig, limit, config, agentDir) {
|
|
189
|
+
return await safeValue(async () => await listCodexAppServerModels(requestOptions(pluginConfig, limit, config, agentDir)));
|
|
190
|
+
}
|
|
191
|
+
async function readCodexStatusProbes(pluginConfig, config, agentDir) {
|
|
192
|
+
const [models, account, limits, mcps, skills] = await Promise.all([
|
|
193
|
+
safeCodexModelList(pluginConfig, 20, config, agentDir),
|
|
194
|
+
safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.account, { refreshToken: false }, {
|
|
195
|
+
config,
|
|
196
|
+
agentDir
|
|
197
|
+
}),
|
|
198
|
+
safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.rateLimits, void 0, {
|
|
199
|
+
config,
|
|
200
|
+
agentDir
|
|
201
|
+
}),
|
|
202
|
+
safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.listMcpServers, { limit: 100 }, {
|
|
203
|
+
config,
|
|
204
|
+
agentDir
|
|
205
|
+
}),
|
|
206
|
+
safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.listSkills, {}, {
|
|
207
|
+
config,
|
|
208
|
+
agentDir
|
|
209
|
+
})
|
|
210
|
+
]);
|
|
211
|
+
return {
|
|
212
|
+
models,
|
|
213
|
+
account,
|
|
214
|
+
limits,
|
|
215
|
+
mcps,
|
|
216
|
+
skills
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
async function safeValue(read) {
|
|
220
|
+
try {
|
|
221
|
+
return {
|
|
222
|
+
ok: true,
|
|
223
|
+
value: await read()
|
|
224
|
+
};
|
|
225
|
+
} catch (error) {
|
|
226
|
+
return {
|
|
227
|
+
ok: false,
|
|
228
|
+
error: describeControlFailure(error)
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
//#endregion
|
|
233
|
+
export { requestOptions as a, readCodexStatusProbes as i, command_rpc_exports as n, safeCodexControlRequest as o, prepareCodexControlSessionAuth as r, codexControlRequest as t };
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { l as sessionBindingIdentity } from "./session-binding-record-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { l as sessionBindingIdentity } from "./session-binding-record-Bcvslnhf.js";
|
|
2
|
+
import { o as isJsonObject } from "./protocol-5bh1G-H7.js";
|
|
3
|
+
import { u as isCodexAppServerPrewriteRequestCancellationError } from "./client-B57KWPQx.js";
|
|
4
|
+
import { n as withCodexAppServerThreadMutation, t as isIncognitoSessionKey } from "./incognito-session-uhrBF6wJ.js";
|
|
5
|
+
import { t as CodexAppServerRpcError } from "./rpc-error-ttN_QjEm.js";
|
|
6
|
+
import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-D3udKbIE.js";
|
|
7
|
+
import { J as retainCodexAppServerLiveThread, R as consumeCodexAppServerLiveThread, c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-CscigXXL.js";
|
|
8
|
+
import { _ as readCodexNotificationTurnId, a as closeCodexStartupClientBestEffort, c as isCodexNoActiveTurnInterruptError, d as unsubscribeCodexThreadBestEffort, g as readCodexNotificationThreadId, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-DKHzbwt5.js";
|
|
9
|
+
import { s as readCodexNotificationItem } from "./attempt-notifications-C9XufG6l.js";
|
|
10
|
+
import { n as readCodexThreadContextSnapshot } from "./event-projector-usage-BfXmpOec.js";
|
|
11
|
+
import { o as resolveCodexSessionBinding, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-CI8UuilT.js";
|
|
12
|
+
import { r as assertCodexSupervisionThreadLineage } from "./thread-policy-BuEQfE0g.js";
|
|
13
|
+
import { t as resumeCodexAppServerThread } from "./thread-resume-DsDOZpFg.js";
|
|
14
|
+
import { t as isSameCodexAppServerThreadOwner } from "./thread-ownership-BsDRTsyp.js";
|
|
11
15
|
import { t as persistCodexContextCompactionActivity } from "./context-compaction-activity-CMla5FPJ.js";
|
|
16
|
+
import { t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-BxgyoM8M.js";
|
|
12
17
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
13
18
|
import { resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
19
|
+
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
14
20
|
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
21
|
+
import { resolveAgentDir as resolveAgentDir$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
15
22
|
import { embeddedAgentLog, resolveCompactionTimeoutMs } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
16
|
-
import { resolveAgentDir as resolveAgentDir$2 } from "openclaw/plugin-sdk/agent-runtime";
|
|
17
23
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
18
|
-
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
19
24
|
import { createDedupeCache } from "openclaw/plugin-sdk/dedupe-runtime";
|
|
20
25
|
//#region extensions/codex/src/app-server/compact.ts
|
|
21
26
|
const warnedIgnoredCompactionOverrides = createDedupeCache({
|
|
@@ -345,7 +350,7 @@ async function compactCodexNativeThread(params, options) {
|
|
|
345
350
|
authProfileId: requestedAuthProfileId ?? binding.authProfileId,
|
|
346
351
|
pluginConfig: options.pluginConfig,
|
|
347
352
|
config,
|
|
348
|
-
agentDir: resolveAgentDir$
|
|
353
|
+
agentDir: resolveAgentDir$1(config, agentId)
|
|
349
354
|
});
|
|
350
355
|
} catch (error) {
|
|
351
356
|
return {
|
|
@@ -409,7 +414,7 @@ async function compactCodexNativeThread(params, options) {
|
|
|
409
414
|
forceKillDelayMs: 250
|
|
410
415
|
});
|
|
411
416
|
if (appServer.start.transport === "stdio") {
|
|
412
|
-
if (transportStopped) return;
|
|
417
|
+
if (transportStopped.exited) return;
|
|
413
418
|
throw new Error("failed to stop unconfirmed codex app-server process");
|
|
414
419
|
}
|
|
415
420
|
if (usesSupervisionConnection) throw new Error("cannot detach an unconfirmed supervised codex thread");
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { c as readExecAsk, f as readRecord, l as readExecSecurity } from "./config-utils-DujwEnhg.js";
|
|
2
|
+
import { p as canUseCodexModelBackedApprovalsReviewerForModel$1 } from "./config-options-CXMq1T-C.js";
|
|
3
|
+
import "./protocol-5bh1G-H7.js";
|
|
4
|
+
import "./config-runtime-D0zGNIHu.js";
|
|
5
|
+
import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
6
|
+
import { execPolicy } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
7
|
+
import { resolveExecApprovalsFromFile } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
8
|
+
import { resolveProviderIdForAuth } from "openclaw/plugin-sdk/provider-auth-aliases";
|
|
9
|
+
//#region extensions/codex/src/app-server/config-exec-approvals.ts
|
|
10
|
+
function resolveOpenClawExecPolicyFromConfig(params) {
|
|
11
|
+
const globalExec = readRecord(params.config?.tools?.exec);
|
|
12
|
+
const globalPolicy = applyOpenClawExecPolicyLayer(createDefaultOpenClawExecPolicy(), globalExec);
|
|
13
|
+
const agentId = params.agentId?.trim();
|
|
14
|
+
return applyOpenClawExecPolicyLayer(globalPolicy, agentId ? readRecord(resolveAgentConfig(params.config ?? {}, agentId)?.tools?.exec) : void 0);
|
|
15
|
+
}
|
|
16
|
+
function resolveOpenClawExecPolicyForCodexAppServer(params) {
|
|
17
|
+
if (params.permissionMode === "full") return {
|
|
18
|
+
...resolveOpenClawExecPolicyForMode("full"),
|
|
19
|
+
touched: true
|
|
20
|
+
};
|
|
21
|
+
const overridePolicy = applyOpenClawExecPolicyLayer(resolveOpenClawExecPolicyFromConfig({
|
|
22
|
+
config: params.config,
|
|
23
|
+
agentId: params.agentId
|
|
24
|
+
}), params.execOverrides);
|
|
25
|
+
return applyOpenClawExecApprovalFloors(overridePolicy, resolveOpenClawExecApprovalFloorsForCodexAppServer({
|
|
26
|
+
approvals: params.approvals,
|
|
27
|
+
agentId: params.agentId,
|
|
28
|
+
policy: overridePolicy
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
function createDefaultOpenClawExecPolicy() {
|
|
32
|
+
return {
|
|
33
|
+
...resolveOpenClawExecPolicyForMode("full"),
|
|
34
|
+
touched: false
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function applyOpenClawExecPolicyLayer(base, exec) {
|
|
38
|
+
if (!exec) return base;
|
|
39
|
+
const mode = readExecMode(exec.mode);
|
|
40
|
+
if (mode !== void 0) return {
|
|
41
|
+
...resolveOpenClawExecPolicyForMode(mode),
|
|
42
|
+
touched: true
|
|
43
|
+
};
|
|
44
|
+
const security = readExecSecurity(exec.security);
|
|
45
|
+
const ask = readExecAsk(exec.ask);
|
|
46
|
+
if (security === void 0 && ask === void 0) return base;
|
|
47
|
+
const nextSecurity = security ?? base.security;
|
|
48
|
+
const nextAsk = ask ?? base.ask;
|
|
49
|
+
return {
|
|
50
|
+
mode: execPolicy.resolveExecModePolicy({
|
|
51
|
+
security: nextSecurity,
|
|
52
|
+
ask: nextAsk
|
|
53
|
+
}).mode,
|
|
54
|
+
security: nextSecurity,
|
|
55
|
+
ask: nextAsk,
|
|
56
|
+
touched: true
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function resolveOpenClawExecApprovalFloorsForCodexAppServer(params) {
|
|
60
|
+
if (!params.approvals) return;
|
|
61
|
+
return resolveExecApprovalsFromFile({
|
|
62
|
+
file: params.approvals,
|
|
63
|
+
agentId: params.agentId,
|
|
64
|
+
overrides: {
|
|
65
|
+
security: params.policy.security,
|
|
66
|
+
ask: params.policy.ask
|
|
67
|
+
}
|
|
68
|
+
}).agent;
|
|
69
|
+
}
|
|
70
|
+
function applyOpenClawExecApprovalFloors(base, approvalFloors) {
|
|
71
|
+
if (!approvalFloors) return base;
|
|
72
|
+
const nextSecurity = approvalFloors.security ? execPolicy.minSecurity(base.security, approvalFloors.security) : base.security;
|
|
73
|
+
const nextAsk = approvalFloors.ask ? execPolicy.maxAsk(base.ask, approvalFloors.ask) : base.ask;
|
|
74
|
+
if (nextSecurity === base.security && nextAsk === base.ask) return base;
|
|
75
|
+
return {
|
|
76
|
+
mode: execPolicy.resolveExecModePolicy({
|
|
77
|
+
security: nextSecurity,
|
|
78
|
+
ask: nextAsk
|
|
79
|
+
}).mode,
|
|
80
|
+
security: nextSecurity,
|
|
81
|
+
ask: nextAsk,
|
|
82
|
+
touched: true
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function resolveOpenClawExecPolicyForMode(mode) {
|
|
86
|
+
const { security, ask } = execPolicy.resolveExecModePolicy({
|
|
87
|
+
mode,
|
|
88
|
+
security: "full",
|
|
89
|
+
ask: "off"
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
mode,
|
|
93
|
+
security,
|
|
94
|
+
ask
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function readExecMode(value) {
|
|
98
|
+
return value === "deny" || value === "allowlist" || value === "ask" || value === "auto" || value === "full" ? value : void 0;
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region extensions/codex/src/app-server/config-reviewer.ts
|
|
102
|
+
function canUseCodexModelBackedApprovalsReviewerForModel(params) {
|
|
103
|
+
return canUseCodexModelBackedApprovalsReviewerForModel$1(params, resolveProviderIdForAuth);
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { resolveOpenClawExecPolicyForCodexAppServer as n, canUseCodexModelBackedApprovalsReviewerForModel as t };
|