@openclaw/codex 2026.10.5-beta.4 → 2026.10.10-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 +10 -3
- package/dist/.setup/{account-usage-runtime-CoVpNIlD.mjs → account-usage-runtime-BVO-lpvn.mjs} +15 -9
- package/dist/.setup/{app-server-policy-D_zv8J7V.mjs → app-server-policy-Cog6mm2i.mjs} +1 -1
- package/dist/.setup/{apply-BXDMd05l.mjs → apply-tJl5mopa.mjs} +11 -11
- package/dist/.setup/{attempt-client-cleanup-zNuNTKVr.mjs → attempt-client-cleanup-DMJWXGxM.mjs} +14 -8
- package/dist/.setup/attempt-terminal-sZutF0WY.mjs +1 -0
- package/dist/.setup/{attempt-workspace-context-CcwP3DA3.mjs → attempt-workspace-context-GYPLawX6.mjs} +2 -2
- package/dist/.setup/{auth-binding-BaxlhaNx.mjs → auth-binding-830RLAJW.mjs} +2 -2
- package/dist/.setup/{auth-cache-key-f8ODJ_OX.mjs → auth-cache-key-BW1YeaIk.mjs} +92 -80
- package/dist/.setup/{auth-profile-CgHQ8Vot.mjs → auth-profile-auwzSwwy.mjs} +14 -8
- package/dist/.setup/{auth-profile-health-oHizqgye.mjs → auth-profile-health-BVPZU9I8.mjs} +15 -8
- package/dist/.setup/{auth-profile-selection-hr8ocLtz.mjs → auth-profile-selection-Bp5PDk3W.mjs} +24 -7
- package/dist/.setup/{binding-connection-B7HAAZSI.mjs → binding-connection-GTgUj9pi.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-DAXn7iFl.mjs → binding-connection.runtime-RcWR3vQu.mjs} +4 -3
- package/dist/.setup/{bounded-turn-DfIJtRlv.mjs → bounded-turn-BQkmyyjB.mjs} +18 -22
- package/dist/.setup/{bounded-turn-isolation-BfDAo-qZ.mjs → bounded-turn-isolation-D8CDrAVX.mjs} +3 -3
- package/dist/.setup/{build-state-Ds14X10-.mjs → build-state-CjLCC0wm.mjs} +1 -1
- package/dist/.setup/{capabilities-DbOzOglY.mjs → capabilities-DAS-JX1z.mjs} +1 -1
- package/dist/.setup/{client-D93nbdB8.mjs → client--P8jwXvA.mjs} +47 -317
- package/dist/.setup/{client-catalog-response-CuVLp4I0.mjs → client-catalog-response-CsDxVVOZ.mjs} +2 -2
- package/dist/.setup/client-initialize-CjgZcX61.mjs +165 -0
- package/dist/.setup/{command-dispatch-DxdH5a9-.mjs → command-dispatch-DqaVBeR3.mjs} +3 -3
- package/dist/.setup/{command-formatters-xW9KpoSZ.mjs → command-formatters-B_7-QZ1c.mjs} +2 -2
- package/dist/.setup/{command-handlers-fiYvYYq0.mjs → command-handlers-i6mEjvfo.mjs} +539 -406
- package/dist/.setup/command-rpc-B65jEc0r.mjs +296 -0
- package/dist/.setup/compact-AO2H4RJe.mjs +823 -0
- package/dist/.setup/{computer-use-DL2v3Kxq.mjs → computer-use-YUnu0JVx.mjs} +21 -68
- package/dist/.setup/{config-C1YVVLEA.mjs → config-BfrAlTMT.mjs} +3 -3
- package/dist/.setup/{config-options-DDzeNQ8m.mjs → config-options-DMFZkd3X.mjs} +1 -1
- package/dist/.setup/{config-runtime-DWzK-k0n.mjs → config-runtime-BZRizyuG.mjs} +2 -2
- package/dist/.setup/{context-engine-projection-ps-yn_ci.mjs → context-engine-projection-PIeLSnR-.mjs} +16 -30
- package/dist/.setup/{conversation-binding-BieJZRRV.mjs → conversation-binding-CfnUR-IM.mjs} +228 -116
- package/dist/.setup/{conversation-binding-data-UgLuTSQT.mjs → conversation-binding-data-khgW0n-o.mjs} +4 -2
- package/dist/.setup/{conversation-control-GXM3unE4.mjs → conversation-control-B2EpVZEb.mjs} +53 -23
- package/dist/.setup/{cyber-failover-D4dgNfFf.mjs → cyber-failover-CqEZoQsj.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-ljgGGL0s.mjs → cyber-failover-notice-poL3Advd.mjs} +1 -1
- package/dist/.setup/{doctor-start-options-JjTAl-q_.mjs → doctor-start-options-8uIBXIzR.mjs} +8 -5
- package/dist/.setup/{dynamic-tool-build-DcaPmBlE.mjs → dynamic-tool-build-DOub3CB5.mjs} +208 -218
- package/dist/.setup/{dynamic-tools-CnQFnNKH.mjs → dynamic-tools-Us5mvq_N.mjs} +344 -118
- package/dist/.setup/{effective-mcp-catalog-B5HKFZNK.mjs → effective-mcp-catalog-DfUUoeeM.mjs} +11 -9
- package/dist/.setup/{ephemeral-turn-De3qb8EQ.mjs → ephemeral-turn-B2z0RIeF.mjs} +5 -4
- package/dist/.setup/{event-projector-assistant-message-CLMKN4x-.mjs → event-projector-assistant-message-ChOAY7rW.mjs} +16 -11
- package/dist/.setup/{event-projector-usage-BpKfdoTm.mjs → event-projector-usage-CBY0Hkga.mjs} +2 -2
- package/dist/.setup/{event-projector-values-CLvG1Hil.mjs → event-projector-values-yf4us9Pf.mjs} +1 -1
- package/dist/.setup/experimental-features-uGnVDtp-.mjs +19 -0
- package/dist/.setup/inference-context-HRw3PDwn.mjs +209 -0
- package/dist/.setup/{inference-dispatch-CO6tTs4q.mjs → inference-dispatch-C2zVSnrr.mjs} +2 -2
- package/dist/.setup/{inference-metadata-DCvcG_N_.mjs → inference-metadata-CYFWLHVk.mjs} +3 -1
- package/dist/.setup/{inference-proxy-BDWV0djM.mjs → inference-proxy-CiLbHMLf.mjs} +8 -8
- package/dist/.setup/installed-probe-lVC1X5ve.mjs +185 -0
- package/dist/.setup/{isolated-completion-BPJdvk5F.mjs → isolated-completion-CybgD6uU.mjs} +7 -7
- package/dist/.setup/managed-binary-DbKvGXKl.mjs +395 -0
- package/dist/.setup/{mcp-app-session-preparation-Dz2GOwyE.mjs → mcp-app-session-preparation-zUgpDLWR.mjs} +18 -14
- package/dist/.setup/{model-catalog-ZNwltCKl.mjs → model-catalog-CWY3wo0B.mjs} +28 -17
- package/dist/.setup/{models-BHpbAuz8.mjs → models-CmOBxsKF.mjs} +3 -3
- package/dist/.setup/{native-auth-esN5MdIv.mjs → native-auth-DpZIaY8N.mjs} +7 -4
- package/dist/.setup/native-execution-policy-D09tLP-u.mjs +152 -0
- package/dist/.setup/{native-hook-relay-wq7jrNLk.mjs → native-hook-relay-CocOW9YS.mjs} +45 -10
- package/dist/.setup/{native-mcp-app-DX3nyTtc.mjs → native-mcp-app-DrQeLxXj.mjs} +5 -5
- package/dist/.setup/{native-skill-isolation-DSBeF-Yy.mjs → native-skill-isolation-DL4-PQa4.mjs} +7 -7
- package/dist/.setup/{native-subagent-monitor-DOLEIf9r.mjs → native-subagent-monitor-C3CIIaZG.mjs} +485 -239
- package/dist/.setup/{native-subagent-pending-assignments-DmVhedNs.mjs → native-subagent-pending-assignments-CTinVtjo.mjs} +1 -1
- package/dist/.setup/{native-task-assignments-DimsQ9Qa.mjs → native-task-assignments-YJopbaVO.mjs} +9 -5
- package/dist/.setup/{node-cli-sessions-CzKg2nGq.mjs → node-cli-sessions-BuJnBnEq.mjs} +7 -4
- package/dist/.setup/{node-exec-server.runtime-BWkULhBM.mjs → node-exec-server.runtime-CP7RC1Nd.mjs} +3 -3
- package/dist/.setup/{plan-41-YOBMq.mjs → plan-Bqj6VQvQ.mjs} +7 -20
- package/dist/.setup/{plugin-activation-D7WkJMvU.mjs → plugin-activation-CXPWe-hl.mjs} +4 -4
- package/dist/.setup/{plugin-app-cache-key-Bg9DbDI6.mjs → plugin-app-cache-key-DRb-niJc.mjs} +17 -55
- package/dist/.setup/{plugin-approval-roundtrip-CD88q3yx.mjs → plugin-approval-roundtrip-CGEiG7hG.mjs} +1 -1
- package/dist/.setup/{plugin-inventory-CYgdo14P.mjs → plugin-inventory-DE9wcaeH.mjs} +2 -2
- package/dist/.setup/{plugin-metadata-cache-Bi8TAPwX.mjs → plugin-metadata-cache-BqC-a6Fb.mjs} +2 -15
- package/dist/.setup/{project-doc-thread-config-BVcvnps8.mjs → project-doc-thread-config-B0UI3f1D.mjs} +6 -6
- package/dist/.setup/protocol-CaPAVwe9.mjs +12 -0
- package/dist/.setup/{provider-LWKll6dV.mjs → provider-C_1fMsyD.mjs} +4 -4
- package/dist/.setup/{provider-capabilities-Dn2WwH4P.mjs → provider-capabilities-C7pYYpvh.mjs} +1 -1
- package/dist/.setup/{rate-limits-CI8pTPqL.mjs → rate-limits-BpfURnuy.mjs} +1 -1
- package/dist/.setup/{request-Bo0kKABI.mjs → request-C6U8q2uz.mjs} +132 -136
- package/dist/.setup/{responses-oauth-twnuTaAa.mjs → responses-oauth-CCV7aVYF.mjs} +6 -6
- package/dist/.setup/{rpc-error-C98SHchT.mjs → rpc-error-DemqqaxE.mjs} +7 -3
- package/dist/.setup/{run-attempt-ClU8MxhZ.mjs → run-attempt-BhuXanLv.mjs} +595 -426
- package/dist/.setup/{run-attempt-lifecycle-KN4oh-7O.mjs → run-attempt-lifecycle-DN-ATDp9.mjs} +1 -1
- package/dist/.setup/{runtime-artifact-C13pR7tD.mjs → runtime-artifact-CmLWeyJB.mjs} +3 -3
- package/dist/.setup/{runtime-artifact-connection-jS5DeCok.mjs → runtime-artifact-connection-DpWlZ02e.mjs} +3 -3
- package/dist/.setup/{sandbox-guard-DIImwCy1.mjs → sandbox-guard-DneAfNye.mjs} +70 -30
- package/dist/.setup/{session-binding-JEHNMPsr.mjs → session-binding-BgsWcbdY.mjs} +25 -23
- package/dist/.setup/{session-binding-record-DU_0biMD.mjs → session-binding-record-C_THntMe.mjs} +27 -12
- package/dist/.setup/{session-binding-record-codec-BpH8u_G9.mjs → session-binding-record-codec-DvmOI7g_.mjs} +1 -0
- package/dist/.setup/{session-binding-sidecars-DD-enC8w.mjs → session-binding-sidecars-BNSS6WL4.mjs} +55 -63
- package/dist/.setup/session-cancellation-DCN1FcBZ.mjs +43 -0
- package/dist/.setup/{session-catalog-adoption-Ca3OYGYM.mjs → session-catalog-adoption-ppsLlVLB.mjs} +24 -38
- package/dist/.setup/{session-catalog-archive-Bv6gV7x9.mjs → session-catalog-archive-CqLRHJ6z.mjs} +11 -13
- package/dist/.setup/{session-catalog-events-kR2Ot6nX.mjs → session-catalog-events-CEi6SuLQ.mjs} +5 -5
- package/dist/.setup/{session-catalog-index-order-CTfoefow.mjs → session-catalog-index-order-0Zqng2u8.mjs} +1 -1
- package/dist/.setup/{session-catalog-index-CrnfVEnT.mjs → session-catalog-index-qt4UWBua.mjs} +96 -271
- package/dist/.setup/{session-catalog-limits-BynIoOYm.mjs → session-catalog-limits-Dc6E0BZz.mjs} +1 -1
- package/dist/.setup/{session-catalog-list-request-D4MYNgDB.mjs → session-catalog-list-request-CAjoWjaH.mjs} +3 -4
- package/dist/.setup/{session-catalog-native-projection-CWqCU1I_.mjs → session-catalog-native-projection-BqBYi6kV.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-adoption-BdP9Zjqo.mjs → session-catalog-node-adoption-e9v8mGgx.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-continue-CNJibO4_.mjs → session-catalog-node-continue-H7nrzcUD.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-lookup-BH_DBGa9.mjs → session-catalog-node-lookup-BrZfDkA8.mjs} +2 -2
- package/dist/.setup/{session-catalog-parsing-DkeoVn60.mjs → session-catalog-parsing-V6jyFg9g.mjs} +2 -2
- package/dist/.setup/{session-catalog-projection-BzHiV818.mjs → session-catalog-projection-CNyhjZze.mjs} +8 -7
- package/dist/.setup/{session-catalog-provenance-CmsOE5mh.mjs → session-catalog-provenance-Dg9s12z-.mjs} +50 -30
- package/dist/.setup/{session-catalog-source-DGuRdGvM.mjs → session-catalog-source-z_mNyQdX.mjs} +2 -6
- package/dist/.setup/{session-cli-GwU0izn-.mjs → session-cli-CBGKiqdv.mjs} +1 -1
- package/dist/.setup/{session-history-BO6i_pfk.mjs → session-history-7W0cgTXF.mjs} +11 -9
- package/dist/.setup/{session-history-import-CaO8s6ta.mjs → session-history-import-BwPKwcNi.mjs} +4 -4
- package/dist/.setup/{session-initialization-Bi_2DKhc.mjs → session-initialization-Dn3vveGv.mjs} +2 -2
- package/dist/.setup/{session-retirement-B3U5hpGJ.mjs → session-retirement-RZStisKb.mjs} +8 -8
- package/dist/.setup/{session-history.worker-DJQfek5p.mjs → settled-turn-evidence--tRW6fSm.mjs} +2 -18
- package/dist/.setup/{settled-turn-finalizer-CYCVpTv2.mjs → settled-turn-finalizer-gioXygEX.mjs} +8 -8
- package/dist/.setup/{shared-client-BCx1wbyA.mjs → shared-client-CkyTrNB8.mjs} +380 -557
- package/dist/.setup/side-question-DHPWKgO3.mjs +998 -0
- package/dist/.setup/{source-DipMO9hL.mjs → source-63MLSmLJ.mjs} +5 -5
- package/dist/.setup/{thread-archive-guard-LKdwQKyr.mjs → thread-archive-guard-BWjSsA92.mjs} +1 -1
- package/dist/.setup/{thread-lifecycle-run-C_aYiYqk.mjs → thread-lifecycle-run-zCXYFW8W.mjs} +172 -75
- package/dist/.setup/{thread-model-selection-DcVebr8N.mjs → thread-model-selection-DxposL4X.mjs} +9 -9
- package/dist/.setup/{thread-ownership-BoUd0i6L.mjs → thread-ownership-Bmk5a2Gu.mjs} +7 -7
- package/dist/.setup/{thread-policy-B3wBRNph.mjs → thread-policy-DYtvZ5Ay.mjs} +6 -6
- package/dist/.setup/{thread-requests-BgzJwJtS.mjs → thread-requests-BjawdIVV.mjs} +14 -14
- package/dist/.setup/{thread-resume-D-3bsr1j.mjs → thread-resume-vBShG3-o.mjs} +6 -6
- package/dist/.setup/{transcript-history-projection-DfKcoZCB.mjs → transcript-history-projection-i-FVpyha.mjs} +1 -1
- package/dist/.setup/{transcript-mirror-Bee2o6jj.mjs → transcript-mirror-CEQJZlF3.mjs} +6 -9
- package/dist/.setup/{transport-stdio-CRWTkKOn.mjs → transport-stdio-Bq160Dhv.mjs} +63 -64
- package/dist/.setup/{transport-websocket-DIyPfkHo.mjs → transport-websocket-0YqiI_MH.mjs} +1 -1
- package/dist/.setup/{turn-router-DBVMToGo.mjs → turn-router-BGj67FMK.mjs} +2 -2
- package/dist/.setup/{upstream-session-fork-p5fwKi7w.mjs → upstream-session-fork-CWKjpdtW.mjs} +46 -219
- package/dist/.setup/{usage-C2Kq7oej.mjs → usage-AhrLFxZP.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-BQX8RHAd.mjs → usage-limit-error-BdNbGJC3.mjs} +4 -4
- package/dist/.setup/{web-search-item-CvokaZOo.mjs → web-search-item-DHVuNSqk.mjs} +1 -1
- package/dist/.setup/{web-search-provider.runtime-D89djc7e.mjs → web-search-provider.runtime-Yk6lnJBG.mjs} +3 -3
- package/dist/.setup/{workspace-write-sandbox-probe-BDWO2Qkh.mjs → workspace-write-sandbox-probe-DJxOXcF3.mjs} +2 -2
- package/dist/api.js +7 -28
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/client-version-api.js +25 -0
- package/dist/doctor-contract-api.js +5 -5
- package/dist/harness.js +59 -36
- package/dist/index.js +259 -295
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +1 -2
- package/dist/native-session-binding-api.js +1 -2
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-entrypoint.js +12 -0
- package/dist/session-history-worker-runtime.js +7 -18
- package/dist/session-history.worker.js +18 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +6 -6
- package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +0 -2
- package/dist/.setup/command-rpc-HIvsy3wS.mjs +0 -247
- package/dist/.setup/compact-ClZ7Ar7L.mjs +0 -808
- package/dist/.setup/inference-context-DNlGwzwy.mjs +0 -91
- package/dist/.setup/managed-binary-BtIjV7yN.mjs +0 -175
- package/dist/.setup/native-execution-policy-MXEe7PB3.mjs +0 -75
- package/dist/.setup/protocol-CANUwXJ3.mjs +0 -17
- package/dist/.setup/side-question-Bz2UQW0l.mjs +0 -826
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { r as isJsonObject } from "./protocol-CaPAVwe9.mjs";
|
|
2
|
+
import { o as isCodexAppServerOverloadError, r as CodexAppServerRpcError } from "./rpc-error-DemqqaxE.mjs";
|
|
3
|
+
import { n as describeControlFailure, t as CODEX_CONTROL_METHODS } from "./capabilities-DAS-JX1z.mjs";
|
|
4
|
+
import { a as withCodexAppServerJsonClient, r as requestCodexAppServerJson } from "./request-C6U8q2uz.mjs";
|
|
5
|
+
import "./config-BfrAlTMT.mjs";
|
|
6
|
+
import { n as resolveCodexAppServerRuntimeOptions, r as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-runtime-BZRizyuG.mjs";
|
|
7
|
+
import { a as resolveCodexAppServerAuthProfileStore, r as resolveCodexAppServerAuthProfileId } from "./auth-profile-auwzSwwy.mjs";
|
|
8
|
+
import { Q as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-CkyTrNB8.mjs";
|
|
9
|
+
import { a as isCodexAppServerIndeterminateTransportError, i as isCodexAppServerIndeterminateRequestCancellationError } from "./client--P8jwXvA.mjs";
|
|
10
|
+
import { o as closeCodexStartupClientBestEffort } from "./attempt-client-cleanup-DMJWXGxM.mjs";
|
|
11
|
+
import { r as prepareCodexAppServerAuthBinding } from "./auth-binding-830RLAJW.mjs";
|
|
12
|
+
import { r as listCodexAppServerModels } from "./models-CmOBxsKF.mjs";
|
|
13
|
+
import { n as createCodexSessionGenerationSupersededError } from "./session-binding-BgsWcbdY.mjs";
|
|
14
|
+
import { t as resumeCodexAppServerThread } from "./thread-resume-vBShG3-o.mjs";
|
|
15
|
+
import { t as __exportAll } from "./session-binding-sidecars-BNSS6WL4.mjs";
|
|
16
|
+
import { resolveAgentDir, resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
17
|
+
import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
18
|
+
import { prepareAgentRuntimeAuth } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
19
|
+
import { resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
20
|
+
import { captureSessionEntryCurrentCheckAsync, composeSessionEntryCommitGuards } from "openclaw/plugin-sdk/session-binding-runtime";
|
|
21
|
+
import { resolveSessionModelRef } from "openclaw/plugin-sdk/model-session-runtime";
|
|
22
|
+
import { resolveApiKeyForProvider } from "openclaw/plugin-sdk/provider-auth-runtime";
|
|
23
|
+
//#region extensions/codex/src/command-rpc.ts
|
|
24
|
+
var command_rpc_exports = /* @__PURE__ */ __exportAll({
|
|
25
|
+
codexControlRequest: () => codexControlRequest,
|
|
26
|
+
prepareCodexControlSessionAuth: () => prepareCodexControlSessionAuth,
|
|
27
|
+
readCodexStatusProbes: () => readCodexStatusProbes,
|
|
28
|
+
requestOptions: () => requestOptions,
|
|
29
|
+
safeCodexControlRequest: () => safeCodexControlRequest
|
|
30
|
+
});
|
|
31
|
+
/** Selects the same prepared auth partition as an admitted session turn. */
|
|
32
|
+
async function prepareCodexControlSessionAuth(options, startOptions) {
|
|
33
|
+
if (!options.config || !options.sessionKey || !options.sessionId) {
|
|
34
|
+
if (options.onResponse) throw new Error("Codex control subscription requires admitted session authority.");
|
|
35
|
+
return {
|
|
36
|
+
release() {},
|
|
37
|
+
authProfileId: options.authProfileId ?? void 0,
|
|
38
|
+
source: void 0,
|
|
39
|
+
clientOptions: { authProfileId: options.authProfileId }
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const config = options.config;
|
|
43
|
+
const { sessionAgentId } = resolveSessionAgentIdsStrict({
|
|
44
|
+
config,
|
|
45
|
+
sessionKey: options.sessionKey,
|
|
46
|
+
agentId: options.agentId
|
|
47
|
+
});
|
|
48
|
+
const agentDir = options.agentDir ?? resolveAgentDir(config, sessionAgentId);
|
|
49
|
+
const workspaceDir = resolveAgentWorkspaceDir(config, sessionAgentId);
|
|
50
|
+
const storePath = options.storePath?.trim() || resolveStorePath(config.session?.store, { agentId: sessionAgentId });
|
|
51
|
+
const current = await captureSessionEntryCurrentCheckAsync({
|
|
52
|
+
agentId: sessionAgentId,
|
|
53
|
+
storePath,
|
|
54
|
+
sessionKey: options.sessionKey,
|
|
55
|
+
fields: [
|
|
56
|
+
"model",
|
|
57
|
+
"modelProvider",
|
|
58
|
+
"modelOverride",
|
|
59
|
+
"providerOverride",
|
|
60
|
+
"authProfileOverride",
|
|
61
|
+
"authProfileOverrideSource"
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
try {
|
|
65
|
+
const { entry } = current;
|
|
66
|
+
const assertCurrent = composeSessionEntryCommitGuards([options.assertCurrent]);
|
|
67
|
+
const assertCurrentAsync = async () => {
|
|
68
|
+
await options.assertCurrentAsync?.();
|
|
69
|
+
await current.assertCurrent();
|
|
70
|
+
options.assertCurrent?.();
|
|
71
|
+
};
|
|
72
|
+
await assertCurrentAsync();
|
|
73
|
+
if (entry?.sessionId !== options.sessionId) throw createCodexSessionGenerationSupersededError(options.sessionId);
|
|
74
|
+
if (options.authProfileId === null || startOptions.homeScope === "user") return {
|
|
75
|
+
release: current.release,
|
|
76
|
+
authProfileId: options.authProfileId ?? void 0,
|
|
77
|
+
source: current.source,
|
|
78
|
+
clientOptions: {
|
|
79
|
+
authProfileId: options.authProfileId,
|
|
80
|
+
assertCurrent,
|
|
81
|
+
assertCurrentAsync,
|
|
82
|
+
storePath,
|
|
83
|
+
agentId: sessionAgentId
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const model = resolveSessionModelRef(config, entry, sessionAgentId);
|
|
87
|
+
const authProfileId = entry?.authProfileOverride ?? options.authProfileId;
|
|
88
|
+
const store = await resolveCodexAppServerAuthProfileStore({
|
|
89
|
+
agentDir,
|
|
90
|
+
config,
|
|
91
|
+
authProfileId
|
|
92
|
+
});
|
|
93
|
+
const { plan, attempts } = prepareAgentRuntimeAuth({
|
|
94
|
+
provider: model.provider,
|
|
95
|
+
modelId: model.model,
|
|
96
|
+
config,
|
|
97
|
+
agentDir,
|
|
98
|
+
workspaceDir,
|
|
99
|
+
authProfileStore: store,
|
|
100
|
+
sessionAuthProfileId: authProfileId,
|
|
101
|
+
sessionAuthProfileSource: entry?.authProfileOverrideSource,
|
|
102
|
+
harnessId: "codex",
|
|
103
|
+
harnessAuthBootstrap: "harness"
|
|
104
|
+
});
|
|
105
|
+
const route = plan.modelRoute;
|
|
106
|
+
const resolvedAuth = route ? await resolveApiKeyForProvider({
|
|
107
|
+
provider: route.provider,
|
|
108
|
+
modelId: route.modelId,
|
|
109
|
+
modelApi: route.api,
|
|
110
|
+
cfg: config,
|
|
111
|
+
agentDir,
|
|
112
|
+
workspaceDir,
|
|
113
|
+
store,
|
|
114
|
+
profileId: attempts[0]?.profileId,
|
|
115
|
+
lockedProfile: plan.forwardedAuthProfileSource === "user",
|
|
116
|
+
allowAuthProfileFallback: attempts[0]?.allowAuthProfileFallback,
|
|
117
|
+
skipSetupProviderFallback: true
|
|
118
|
+
}) : void 0;
|
|
119
|
+
const handoff = await resolveCodexAppServerPreparedAuthHandoff({
|
|
120
|
+
authRequirement: route?.authRequirement,
|
|
121
|
+
resolvedApiKey: resolvedAuth?.apiKey,
|
|
122
|
+
authProfileId: route ? plan.forwardedAuthProfileId : resolveCodexAppServerAuthProfileId({
|
|
123
|
+
authProfileId: plan.forwardedAuthProfileId,
|
|
124
|
+
store,
|
|
125
|
+
config
|
|
126
|
+
}),
|
|
127
|
+
authProfileStore: store,
|
|
128
|
+
agentDir,
|
|
129
|
+
homeScope: startOptions.homeScope ?? "agent",
|
|
130
|
+
config,
|
|
131
|
+
subscriptionProfileRequiredError: "Prepared Codex subscription route requires a forwarded OpenAI OAuth or token profile.",
|
|
132
|
+
subscriptionProfileUnusableError: "Prepared Codex subscription auth profile is unusable."
|
|
133
|
+
});
|
|
134
|
+
const binding = handoff.authProfileId ? await prepareCodexAppServerAuthBinding({
|
|
135
|
+
authProfileId: handoff.authProfileId,
|
|
136
|
+
authProfileStore: store,
|
|
137
|
+
agentDir,
|
|
138
|
+
config
|
|
139
|
+
}) : void 0;
|
|
140
|
+
await assertCurrentAsync();
|
|
141
|
+
return {
|
|
142
|
+
release: current.release,
|
|
143
|
+
authProfileId: handoff.authProfileId,
|
|
144
|
+
source: current.source,
|
|
145
|
+
clientOptions: {
|
|
146
|
+
...handoff.preparedAuth ? { preparedAuth: handoff.preparedAuth } : { authProfileId: handoff.authProfileId },
|
|
147
|
+
authRequirement: route?.authRequirement,
|
|
148
|
+
authProfileStore: binding?.authProfileStore ?? store,
|
|
149
|
+
authBindingFingerprint: binding?.fingerprint,
|
|
150
|
+
agentDir,
|
|
151
|
+
assertCurrent,
|
|
152
|
+
assertCurrentAsync,
|
|
153
|
+
storePath,
|
|
154
|
+
agentId: sessionAgentId
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
} catch (error) {
|
|
158
|
+
current.release();
|
|
159
|
+
throw error;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function requestOptions(pluginConfig, limit, config, agentDir) {
|
|
163
|
+
const runtime = resolveCodexAppServerRuntimeOptions({ pluginConfig });
|
|
164
|
+
return {
|
|
165
|
+
limit,
|
|
166
|
+
timeoutMs: runtime.requestTimeoutMs,
|
|
167
|
+
startOptions: runtime.start,
|
|
168
|
+
config,
|
|
169
|
+
agentDir
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
async function codexControlRequest(pluginConfig, method, requestParams, inputOptions = {}) {
|
|
173
|
+
const options = { ...inputOptions };
|
|
174
|
+
try {
|
|
175
|
+
options.controlObservation?.phase("prepare");
|
|
176
|
+
} catch {}
|
|
177
|
+
const runtime = options.startOptions ? resolveCodexSupervisionAppServerRuntimeOptions({ pluginConfig }) : resolveCodexAppServerRuntimeOptions({ pluginConfig });
|
|
178
|
+
const startOptions = options.startOptions ?? runtime.start;
|
|
179
|
+
const nativeAuthFork = method === "thread/fork" && options.startOptions !== void 0 && options.authProfileId === null;
|
|
180
|
+
const auth = options.onResponse && !nativeAuthFork ? await prepareCodexControlSessionAuth(options, startOptions) : {
|
|
181
|
+
release() {},
|
|
182
|
+
authProfileId: options.authProfileId ?? void 0,
|
|
183
|
+
source: void 0,
|
|
184
|
+
clientOptions: { authProfileId: options.authProfileId }
|
|
185
|
+
};
|
|
186
|
+
try {
|
|
187
|
+
const controlRequestOptions = {
|
|
188
|
+
timeoutMs: options.timeoutMs ?? runtime.requestTimeoutMs,
|
|
189
|
+
assertCurrent: options.assertCurrent,
|
|
190
|
+
assertCurrentAsync: options.assertCurrentAsync,
|
|
191
|
+
startOptions,
|
|
192
|
+
config: options.config,
|
|
193
|
+
agentId: options.agentId,
|
|
194
|
+
sessionKey: options.sessionKey,
|
|
195
|
+
sessionId: options.sessionId,
|
|
196
|
+
storePath: options.storePath,
|
|
197
|
+
agentDir: options.agentDir,
|
|
198
|
+
isolated: options.isolated,
|
|
199
|
+
...options.catalogPreview ? {
|
|
200
|
+
catalogPreview: true,
|
|
201
|
+
catalogPreviewCache: options.catalogPreviewCache,
|
|
202
|
+
catalogRows: options.catalogRows
|
|
203
|
+
} : {},
|
|
204
|
+
...options.controlObservation ? { controlObservation: options.controlObservation } : {},
|
|
205
|
+
...auth.clientOptions
|
|
206
|
+
};
|
|
207
|
+
if (options.onResponse || options.beforeRequest) return await withCodexAppServerJsonClient(controlRequestOptions, async (request, client, scope) => {
|
|
208
|
+
await options.beforeRequest?.(request, client, scope);
|
|
209
|
+
scope.assertCurrent();
|
|
210
|
+
let response;
|
|
211
|
+
if (method === "thread/resume") {
|
|
212
|
+
if (!isJsonObject(requestParams) || typeof requestParams.threadId !== "string") throw new Error("Codex thread/resume requires a thread id.");
|
|
213
|
+
response = await resumeCodexAppServerThread({
|
|
214
|
+
client,
|
|
215
|
+
request: {
|
|
216
|
+
...requestParams,
|
|
217
|
+
threadId: requestParams.threadId
|
|
218
|
+
},
|
|
219
|
+
requestResume: () => request({
|
|
220
|
+
method,
|
|
221
|
+
requestParams,
|
|
222
|
+
assertCurrent: options.assertOwnerCurrent
|
|
223
|
+
}),
|
|
224
|
+
abandonClient: () => closeCodexStartupClientBestEffort(client)
|
|
225
|
+
});
|
|
226
|
+
} else try {
|
|
227
|
+
response = await request({
|
|
228
|
+
method,
|
|
229
|
+
requestParams,
|
|
230
|
+
assertCurrent: options.assertOwnerCurrent
|
|
231
|
+
});
|
|
232
|
+
} catch (error) {
|
|
233
|
+
if (nativeAuthFork && (isCodexAppServerIndeterminateRequestCancellationError(error) || isCodexAppServerIndeterminateTransportError(error) || error instanceof CodexAppServerRpcError && !isCodexAppServerOverloadError(error))) await closeCodexStartupClientBestEffort(client);
|
|
234
|
+
throw error;
|
|
235
|
+
}
|
|
236
|
+
if (options.onResponse) await options.onResponse(response, client, {
|
|
237
|
+
authProfileId: auth.authProfileId,
|
|
238
|
+
assertCurrent: scope.assertCurrent,
|
|
239
|
+
source: auth.source,
|
|
240
|
+
assertCurrentAsync: controlRequestOptions.assertCurrentAsync
|
|
241
|
+
});
|
|
242
|
+
else scope.assertCurrent();
|
|
243
|
+
return response;
|
|
244
|
+
});
|
|
245
|
+
return await requestCodexAppServerJson({
|
|
246
|
+
method,
|
|
247
|
+
requestParams,
|
|
248
|
+
...controlRequestOptions,
|
|
249
|
+
...options.assertOwnerCurrent ? { assertCurrent: () => {
|
|
250
|
+
options.assertOwnerCurrent?.();
|
|
251
|
+
options.assertCurrent?.();
|
|
252
|
+
} } : {}
|
|
253
|
+
});
|
|
254
|
+
} finally {
|
|
255
|
+
auth.release();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
async function safeCodexControlRequest(pluginConfig, method, requestParams, options = {}) {
|
|
259
|
+
return await safeValue(async () => await codexControlRequest(pluginConfig, method, requestParams, options));
|
|
260
|
+
}
|
|
261
|
+
async function readCodexStatusProbes(pluginConfig, config, agentDir) {
|
|
262
|
+
const options = {
|
|
263
|
+
config,
|
|
264
|
+
agentDir
|
|
265
|
+
};
|
|
266
|
+
const probe = (method, params) => safeCodexControlRequest(pluginConfig, method, params, options);
|
|
267
|
+
const [models, account, limits, mcps, skills] = await Promise.all([
|
|
268
|
+
safeValue(() => listCodexAppServerModels(requestOptions(pluginConfig, 20, config, agentDir))),
|
|
269
|
+
probe(CODEX_CONTROL_METHODS.account, { refreshToken: false }),
|
|
270
|
+
probe(CODEX_CONTROL_METHODS.rateLimits, void 0),
|
|
271
|
+
probe(CODEX_CONTROL_METHODS.listMcpServers, { limit: 100 }),
|
|
272
|
+
probe(CODEX_CONTROL_METHODS.listSkills, {})
|
|
273
|
+
]);
|
|
274
|
+
return {
|
|
275
|
+
models,
|
|
276
|
+
account,
|
|
277
|
+
limits,
|
|
278
|
+
mcps,
|
|
279
|
+
skills
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
async function safeValue(read) {
|
|
283
|
+
try {
|
|
284
|
+
return {
|
|
285
|
+
ok: true,
|
|
286
|
+
value: await read()
|
|
287
|
+
};
|
|
288
|
+
} catch (error) {
|
|
289
|
+
return {
|
|
290
|
+
ok: false,
|
|
291
|
+
error: describeControlFailure(error)
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
//#endregion
|
|
296
|
+
export { requestOptions as a, readCodexStatusProbes as i, command_rpc_exports as n, safeCodexControlRequest as o, prepareCodexControlSessionAuth as r, codexControlRequest as t };
|