@openclaw/codex 2026.9.6 → 2026.9.7
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/assets/icon.png +0 -0
- package/dist/.setup/{account-usage-runtime-Eem_WGqY.mjs → account-usage-runtime-DFhbh1zz.mjs} +5 -5
- package/dist/.setup/{apply-DDOi8uNx.mjs → apply-D3GcSoSa.mjs} +22 -36
- package/dist/.setup/{attempt-client-cleanup-CEv1cKwF.mjs → attempt-client-cleanup-DOP-cW5j.mjs} +128 -37
- package/dist/.setup/attempt-workspace-context-C5HigshI.mjs +164 -0
- package/dist/.setup/{auth-binding-DhLWa_7K.mjs → auth-binding-BLWz7stm.mjs} +14 -1
- package/dist/.setup/{auth-cache-key-B2mpaI9D.mjs → auth-cache-key-Dbvq-QgB.mjs} +36 -34
- package/dist/.setup/{auth-profile-WqZtZfXN.mjs → auth-profile-B0okYl2D.mjs} +1 -2
- package/dist/.setup/auth-start-options-BPIPeEX8.mjs +44 -0
- package/dist/.setup/{binding-connection-ThoatDcb.mjs → binding-connection-DTtN1KrX.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-yoHrABt-.mjs → binding-connection.runtime-6TpgD1M6.mjs} +4 -4
- package/dist/.setup/{bounded-turn-B2HScEgT.mjs → bounded-turn-CbjoN2OW.mjs} +15 -18
- package/dist/.setup/bounded-turn-isolation-B8K_ylqk.mjs +14 -0
- package/dist/.setup/{build-state-C7EnDVgr.mjs → build-state-Da1_z0kd.mjs} +1 -1
- package/dist/.setup/{capabilities-CDXOOFdZ.mjs → capabilities-B3WEZl4e.mjs} +2 -10
- package/dist/.setup/{client-Cs08OXVQ.mjs → client-N0JpgSzF.mjs} +138 -399
- package/dist/.setup/{client-catalog-response-BMgt_4q4.mjs → client-catalog-response-5HHLdcde.mjs} +1 -1
- package/dist/.setup/{command-dispatch-B4JuOsOk.mjs → command-dispatch-BeAoaovI.mjs} +5 -8
- package/dist/.setup/{command-formatters-Bmqvr9tO.mjs → command-formatters-R3ckE3Co.mjs} +29 -61
- package/dist/.setup/{command-handlers-DW7Lx9oH.mjs → command-handlers-ylTMS00z.mjs} +222 -343
- package/dist/.setup/{command-rpc-DixIj3HW.mjs → command-rpc-CGJGUQ6Y.mjs} +15 -18
- package/dist/.setup/compact-C2WamavS.mjs +776 -0
- package/dist/.setup/{config-BoTP_mrL.mjs → config-DKhXquav.mjs} +26 -28
- package/dist/.setup/{config-options-BvaRs51b.mjs → config-options-CzyWLTJt.mjs} +24 -37
- package/dist/.setup/{config-parsing-CcB9iPoq.mjs → config-parsing-b088LyhT.mjs} +57 -60
- package/dist/.setup/{config-runtime-C8Rw1m1m.mjs → config-runtime-C0NbLms1.mjs} +2 -2
- package/dist/.setup/{config-security-BEReZ6go.mjs → config-security-CE-FcGw9.mjs} +32 -111
- package/dist/.setup/{config-utils-DujwEnhg.mjs → config-utils-D0CXecki.mjs} +3 -13
- package/dist/.setup/context-engine-projection-PezSESth.mjs +387 -0
- package/dist/.setup/{conversation-binding-DP-gMrBP.mjs → conversation-binding-3Min8qvP.mjs} +67 -90
- package/dist/.setup/{conversation-binding-data-CrcyZk6O.mjs → conversation-binding-data-C746z5Pn.mjs} +8 -12
- package/dist/.setup/{conversation-control-uK9Jomlc.mjs → conversation-control-CEP8X5JC.mjs} +8 -8
- package/dist/.setup/{cyber-failover-DYwbmf1o.mjs → cyber-failover-XV0nNRZu.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-e9G3J9-e.mjs → cyber-failover-notice-RNpGpTyP.mjs} +1 -1
- package/dist/.setup/{dynamic-tools-BDXl-8Cw.mjs → dynamic-tools-DzlsLUuS.mjs} +2305 -2606
- package/dist/.setup/{effective-mcp-catalog-CvnvnGIe.mjs → effective-mcp-catalog-CxUtC-xG.mjs} +8 -17
- package/dist/.setup/{ephemeral-turn-poidXgek.mjs → ephemeral-turn-CDsPJOa2.mjs} +3 -3
- package/dist/.setup/event-projector-assistant-message-CigreO4K.mjs +69 -0
- package/dist/.setup/{event-projector-usage-CnBS8Wa3.mjs → event-projector-usage-03R0I2dM.mjs} +3 -25
- package/dist/.setup/event-projector-values-DJSz8BTk.mjs +106 -0
- package/dist/.setup/incognito-session-DWYapfwf.mjs +2 -0
- package/dist/.setup/{inference-context-D96l9-ew.mjs → inference-context-D-9gWlTR.mjs} +16 -18
- package/dist/.setup/inference-dispatch-CMZtjQyz.mjs +359 -0
- package/dist/.setup/inference-metadata-CgIf7sOx.mjs +81 -0
- package/dist/.setup/{inference-proxy-b-aJMSxm.mjs → inference-proxy-DhcXOgUE.mjs} +174 -214
- package/dist/.setup/{isolated-completion-BIZFhTNG.mjs → isolated-completion-Dm3PzxJk.mjs} +9 -12
- package/dist/.setup/{managed-binary-BnshlFag.mjs → managed-binary-kiWRhNRE.mjs} +8 -12
- package/dist/.setup/{model-catalog-CfXJf9Ay.mjs → model-catalog-PAuZgJC6.mjs} +11 -10
- package/dist/.setup/model-runtime-BdqzOMkU.mjs +11 -0
- package/dist/.setup/{models-KnqBv0hE.mjs → models-DHXZtVVk.mjs} +9 -18
- package/dist/.setup/{native-auth-rWbGbMn3.mjs → native-auth-CuG53tu4.mjs} +4 -4
- package/dist/.setup/{native-execution-policy-umd0tgh4.mjs → native-execution-policy-BxZJy5mP.mjs} +5 -30
- package/dist/.setup/{native-subagent-monitor-D3filLY2.mjs → native-subagent-monitor-Dpsmf2wz.mjs} +4395 -3609
- package/dist/.setup/native-subagent-pending-assignments-DwkCzLvD.mjs +203 -0
- package/dist/.setup/native-task-assignments-DMQ0g3hu.mjs +194 -0
- package/dist/.setup/{node-cli-sessions-r3avj02l.mjs → node-cli-sessions-HC4W6FLI.mjs} +19 -49
- package/dist/.setup/{node-exec-server.runtime-BDwWXVpK.mjs → node-exec-server.runtime-BgBfWQqo.mjs} +3 -6
- package/dist/.setup/{plan-CN3VwfNU.mjs → plan-Y-QIvrKB.mjs} +49 -92
- package/dist/.setup/{plugin-activation-DT3MNtqj.mjs → plugin-activation-cNHRfaxU.mjs} +8 -36
- package/dist/.setup/{plugin-app-cache-key-B2CsSdnV.mjs → plugin-app-cache-key-BL9B5H0L.mjs} +6 -23
- package/dist/.setup/{plugin-inventory-BoRei8Z4.mjs → plugin-inventory-Cky2XJUw.mjs} +21 -21
- package/dist/.setup/{plugin-marketplace-discovery-CDOi8IFs.mjs → plugin-marketplace-discovery-D_dV9FXa.mjs} +18 -24
- package/dist/.setup/{plugin-metadata-cache-Ctmo83k_.mjs → plugin-metadata-cache-DsjsL1dr.mjs} +115 -175
- package/dist/.setup/{provider-BOsxQHOM.mjs → provider-DH8NSzGt.mjs} +11 -14
- package/dist/.setup/{provider-capabilities-BfE88FZ5.mjs → provider-capabilities-CAxoF-X1.mjs} +13 -18
- package/dist/.setup/{rate-limits-CMU3DUD0.mjs → rate-limits-B7-X2TgG.mjs} +9 -31
- package/dist/.setup/{request-D2L0zMrq.mjs → request-BHZ1nz8d.mjs} +7 -6
- package/dist/.setup/responses-oauth-twnuTaAa.mjs +93 -0
- package/dist/.setup/rpc-error-BlD2vuzn.mjs +31 -0
- package/dist/.setup/{run-attempt-BHu11r7h.mjs → run-attempt-D8RZUOzY.mjs} +1035 -1023
- package/dist/.setup/{run-attempt-lifecycle-B7JbY4-F.mjs → run-attempt-lifecycle-C-6O3Exn.mjs} +10 -24
- package/dist/.setup/{runtime-artifact-CLZ8udh-.mjs → runtime-artifact-DDQ-HGXf.mjs} +16 -4
- package/dist/.setup/runtime-artifact-connection-D68qQn1m.mjs +78 -0
- package/dist/.setup/sandbox-guard-DjCz2eOw.mjs +126 -0
- package/dist/.setup/scope-DOC1Xjc8.mjs +6 -0
- package/dist/.setup/session-binding-DGCYAfvD.mjs +443 -0
- package/dist/.setup/{session-binding-record-BGoz8wOK.mjs → session-binding-record-Oe9L-CNY.mjs} +52 -130
- package/dist/.setup/{session-binding-sidecars-BlB5EvIS.mjs → session-binding-sidecars-jo6H8dFr.mjs} +196 -17
- package/dist/.setup/{session-catalog-Pno1xGcl.mjs → session-catalog-4sCdv5qx.mjs} +170 -324
- package/dist/.setup/{session-catalog-adoption-BI6UTDZT.mjs → session-catalog-adoption-BU_pHWG7.mjs} +7 -6
- package/dist/.setup/{session-catalog-archive-lHBqzhaO.mjs → session-catalog-archive-spHfihri.mjs} +6 -6
- package/dist/.setup/session-catalog-events-DePDzzjc.mjs +139 -0
- package/dist/.setup/session-catalog-home-id-vlih0B_g.mjs +22 -0
- package/dist/.setup/{session-catalog-index-B9_VQIUz.mjs → session-catalog-index-CZvDzC6z.mjs} +126 -122
- package/dist/.setup/{session-catalog-index-order-hcdz07yN.mjs → session-catalog-index-order-BcQpHks3.mjs} +1 -1
- package/dist/.setup/{session-catalog-index-state-Dgh8ORJm.mjs → session-catalog-index-state-TeO7EyO-.mjs} +3 -2
- package/dist/.setup/session-catalog-limits-DDxOsQeC.mjs +14 -0
- package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +170 -0
- package/dist/.setup/session-catalog-native-projection-DjhwGL6x.mjs +178 -0
- package/dist/.setup/{session-catalog-node-adoption-ITddWx_X.mjs → session-catalog-node-adoption-DgXvSGu0.mjs} +10 -27
- package/dist/.setup/{session-catalog-node-continue-6g6qi4A9.mjs → session-catalog-node-continue-DjKXHBbi.mjs} +8 -10
- package/dist/.setup/session-catalog-node-lookup-CtAXI5W5.mjs +56 -0
- package/dist/.setup/{session-catalog-native-projection-DowriLid.mjs → session-catalog-parsing-CPGaPYr-.mjs} +11 -194
- package/dist/.setup/{session-catalog-projection-zK_PUsiE.mjs → session-catalog-projection-Cr5qP5Dj.mjs} +6 -4
- package/dist/.setup/session-catalog-provenance-DoAvktcj.mjs +95 -0
- package/dist/.setup/{session-cli-irrD-uo7.mjs → session-cli-Cn_nCqfq.mjs} +9 -22
- package/dist/.setup/{session-history-BrqhSCf9.mjs → session-history-D83lJWHG.mjs} +4 -6
- package/dist/.setup/{session-history-import-D-3wAgOP.mjs → session-history-import-WhX-X33a.mjs} +7 -10
- package/dist/.setup/session-history-read-Ov3StuL4.mjs +133 -0
- package/dist/.setup/{session-history.worker-CaCh0xF_.mjs → session-history.worker-MnPKncqP.mjs} +9 -5
- package/dist/.setup/session-initialization-6aveB9qb.mjs +22 -0
- package/dist/.setup/{session-permission-policy-BI1QK_98.mjs → session-permission-policy-Ci_fVX6y.mjs} +4 -8
- package/dist/.setup/{session-retirement-BH-S6qkJ.mjs → session-retirement-qMTxkNx2.mjs} +17 -17
- package/dist/.setup/{settled-turn-context-fmwouT5I.mjs → settled-turn-context-D4yj4rxf.mjs} +1 -1
- package/dist/.setup/{settled-turn-finalizer-DiAi6Kx6.mjs → settled-turn-finalizer-BsvEabkw.mjs} +14 -10
- package/dist/.setup/{shared-client-DA4VR4Eb.mjs → shared-client-DqyTMYug.mjs} +783 -412
- package/dist/.setup/shared-client-lifecycle-DJIgqgMw.mjs +153 -0
- package/dist/.setup/{side-question-BJ1wSDcB.mjs → side-question-C4kCmQy1.mjs} +79 -143
- package/dist/.setup/{source-CUzJq5WN.mjs → source-CS_7GFJZ.mjs} +80 -137
- package/dist/.setup/{thread-lifecycle-B3mfz1TG.mjs → thread-lifecycle-DPflntEJ.mjs} +294 -737
- package/dist/.setup/{incognito-session-uhrBF6wJ.mjs → thread-ownership-queue-Dp24d7-F.mjs} +1 -2
- package/dist/.setup/{thread-ownership-DcTtAcXj.mjs → thread-ownership-roNP0l1c.mjs} +45 -10
- package/dist/.setup/{thread-policy-DGuQsuFC.mjs → thread-policy-DTd-DtkX.mjs} +46 -7
- package/dist/.setup/{thread-requests-BLvGkP2R.mjs → thread-requests-B_bRnMGN.mjs} +199 -302
- package/dist/.setup/{thread-resume-DIBXwOpE.mjs → thread-resume-CdDaoc7T.mjs} +6 -6
- package/dist/.setup/{timeout-C910MdAB.mjs → timeout-CXOfNoaX.mjs} +1 -35
- package/dist/.setup/{transcript-history-projection-ZZpkFkJ_.mjs → transcript-history-projection-DRSifI-1.mjs} +17 -89
- package/dist/.setup/{transcript-mirror-attestation-CzM-94NC.mjs → transcript-mirror-attestation-YSegaktH.mjs} +3 -4
- package/dist/.setup/{transcript-mirror-BtHDBp1G.mjs → transcript-mirror-kxmCYsuF.mjs} +7 -9
- package/dist/.setup/{transport-stdio-h2VHOskC.mjs → transport-stdio-Bdegpn2V.mjs} +5 -22
- package/dist/.setup/transport-websocket-BTBE-LD9.mjs +211 -0
- package/dist/.setup/{upstream-prompt-provenance-LphB8slG.mjs → upstream-prompt-provenance-fXkKbPVC.mjs} +3 -9
- package/dist/.setup/{upstream-session-fork-BUr4OUbC.mjs → upstream-session-fork-CBeVjBpT.mjs} +23 -23
- package/dist/.setup/{usage-BML0r-ua.mjs → usage-BMzNxeR_.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-DUMbefVY.mjs → usage-limit-error-QXerDo3i.mjs} +4 -19
- package/dist/.setup/{web-search-provider.runtime-CDKlN-Rv.mjs → web-search-provider.runtime-P77OUeoo.mjs} +8 -19
- package/dist/api.js +9 -11
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +50 -8
- package/dist/harness.js +344 -1
- package/dist/index.js +193 -245
- package/dist/media-understanding-provider.js +9 -22
- package/dist/migration-provider-api.js +1 -1
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +3 -3
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +14 -2
- package/package.json +7 -6
- package/dist/.setup/attempt-workspace-context-DUVEn_CS.mjs +0 -331
- package/dist/.setup/compact-Du5UvtxA.mjs +0 -680
- package/dist/.setup/event-projector-assistant-message-BsruvNrH.mjs +0 -103
- package/dist/.setup/event-projector-items-C6L_5ZiT.mjs +0 -234
- package/dist/.setup/harness-a_MsE4-_.mjs +0 -355
- package/dist/.setup/history-rejection-B4nOXNXF.mjs +0 -13
- package/dist/.setup/image-payload-sanitizer-tupAr-2o.mjs +0 -79
- package/dist/.setup/local-runtime-attribution-B_2mnqhb.mjs +0 -19
- package/dist/.setup/native-subagent-history-0nYYgo0k.mjs +0 -148
- package/dist/.setup/native-subagent-task-ids-wb8CKZGN.mjs +0 -441
- package/dist/.setup/plugin-approval-roundtrip-C0MZzCuP.mjs +0 -122
- package/dist/.setup/rolldown-runtime-8H4AJuhK.mjs +0 -14
- package/dist/.setup/sandbox-guard-C2sRMOEY.mjs +0 -166
- package/dist/.setup/session-binding-Cm0apEbd.mjs +0 -692
- package/dist/.setup/session-catalog-events-Bj6j94E_.mjs +0 -347
- package/dist/.setup/session-history-read-B3ZfSUbF.mjs +0 -50
- package/dist/.setup/session-initialization-rcgbZiid.mjs +0 -75
- package/dist/.setup/thread-history-page-DoVpnHim.mjs +0 -83
package/dist/index.js
CHANGED
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
import { registerCodexCliMetadata } from "./cli-metadata.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
2
|
+
import { j as CODEX_INTERACTIVE_THREAD_SOURCE_KINDS } from "./.setup/session-catalog-parsing-CPGaPYr-.mjs";
|
|
3
|
+
import { i as isJsonObject } from "./.setup/protocol-CANUwXJ3.mjs";
|
|
4
|
+
import { f as readCurrentCodexAppServerBinding, h as readCurrentNativePendingAssignments, m as readCurrentCodexNativeSubagentSubmissions, n as assertCodexBindingMayBeReplaced, p as readCurrentCodexAppServerBindings, v as sessionBindingIdentity } from "./.setup/session-binding-record-Oe9L-CNY.mjs";
|
|
5
|
+
import { n as defineCodexBuildState } from "./.setup/build-state-Da1_z0kd.mjs";
|
|
6
|
+
import { createCodexAppServerAgentHarness, createCodexAppServerNativeCompaction } from "./harness.js";
|
|
5
7
|
import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
6
8
|
import codexProviderDiscovery from "./provider-discovery.js";
|
|
7
9
|
import { n as createCodexAuthProfileSelection } from "./.setup/auth-profile-selection-DFu9e167.mjs";
|
|
8
|
-
import { t as assertCodexAppServerConnectionSecurity } from "./.setup/config-security-
|
|
9
|
-
import { d as readCodexPluginConfig } from "./.setup/config-parsing-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { o as setManagedCodexPluginRoot } from "./.setup/managed-binary-BnshlFag.mjs";
|
|
14
|
-
import { l as createCodexDesktopGenerationService, s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./.setup/auth-cache-key-B2mpaI9D.mjs";
|
|
10
|
+
import { t as assertCodexAppServerConnectionSecurity } from "./.setup/config-security-CE-FcGw9.mjs";
|
|
11
|
+
import { d as readCodexPluginConfig } from "./.setup/config-parsing-b088LyhT.mjs";
|
|
12
|
+
import { r as createCodexAppServerConfig, t as codexAppServerStartOptionsKey } from "./.setup/config-options-CzyWLTJt.mjs";
|
|
13
|
+
import { o as setManagedCodexPluginRoot } from "./.setup/managed-binary-kiWRhNRE.mjs";
|
|
14
|
+
import { l as createCodexDesktopGenerationService, s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./.setup/auth-cache-key-Dbvq-QgB.mjs";
|
|
15
15
|
import { n as CODEX_MANAGED_THREAD_NAMESPACE, r as createCodexManagedThreadStore, t as CODEX_MANAGED_THREAD_MAX_ENTRIES } from "./.setup/managed-thread-store-BMqgThVL.mjs";
|
|
16
16
|
import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./.setup/session-binding-meta-B7aEMU7g.mjs";
|
|
17
|
-
import {
|
|
18
|
-
import { s as createCodexAppServerProcessReaperService } from "./.setup/transport-stdio-
|
|
17
|
+
import { f as retireSharedCodexAppServerClientsBeforeDesktopGeneration } from "./.setup/shared-client-lifecycle-DJIgqgMw.mjs";
|
|
18
|
+
import { s as createCodexAppServerProcessReaperService } from "./.setup/transport-stdio-Bdegpn2V.mjs";
|
|
19
19
|
import { n as codexNativeProfileRecoveryService } from "./.setup/auth-profile-health-oHizqgye.mjs";
|
|
20
|
-
import {
|
|
21
|
-
import { c as canMutateCodexHost, n as filterCodexMarketplacePlugins, o as CODEX_NATIVE_EXECUTION_AUTH_ERROR, t as discoverCodexMarketplacePlugins } from "./.setup/plugin-marketplace-discovery-
|
|
22
|
-
import { o as formatCodexDisplayText } from "./.setup/command-formatters-
|
|
23
|
-
import { a as readCodexConversationBindingDataRecord, i as readCodexConversationBindingData, o as resolveCodexDefaultWorkspaceDir } from "./.setup/conversation-binding-data-
|
|
24
|
-
import { t as
|
|
25
|
-
import { t as
|
|
20
|
+
import { n as withCodexConversationThreadActivity } from "./.setup/thread-ownership-queue-Dp24d7-F.mjs";
|
|
21
|
+
import { c as canMutateCodexHost, n as filterCodexMarketplacePlugins, o as CODEX_NATIVE_EXECUTION_AUTH_ERROR, t as discoverCodexMarketplacePlugins } from "./.setup/plugin-marketplace-discovery-D_dV9FXa.mjs";
|
|
22
|
+
import { o as formatCodexDisplayText } from "./.setup/command-formatters-R3ckE3Co.mjs";
|
|
23
|
+
import { a as readCodexConversationBindingDataRecord, i as readCodexConversationBindingData, o as resolveCodexDefaultWorkspaceDir } from "./.setup/conversation-binding-data-C746z5Pn.mjs";
|
|
24
|
+
import { t as isIncognitoSessionKey } from "./.setup/incognito-session-DWYapfwf.mjs";
|
|
25
|
+
import { t as buildCodexMigrationProvider } from "./.setup/provider-DH8NSzGt.mjs";
|
|
26
|
+
import { t as CODEX_CONTROL_METHODS } from "./.setup/capabilities-B3WEZl4e.mjs";
|
|
26
27
|
import { t as assertCodexArchiveDescendantsUnowned } from "./.setup/thread-archive-guard-C9frICzX.mjs";
|
|
27
|
-
import { a as createCodexCliSessionNodeInvokePolicies, c as resolveCodexCliSessionForBindingOnNode, i as createCodexCliSessionNodeHostCommands, l as resumeCodexCliSessionOnNode, s as listCodexCliSessionsOnNode } from "./.setup/node-cli-sessions-
|
|
28
|
-
import { t as
|
|
29
|
-
import {
|
|
30
|
-
import { i as
|
|
28
|
+
import { a as createCodexCliSessionNodeInvokePolicies, c as resolveCodexCliSessionForBindingOnNode, i as createCodexCliSessionNodeHostCommands, l as resumeCodexCliSessionOnNode, s as listCodexCliSessionsOnNode } from "./.setup/node-cli-sessions-HC4W6FLI.mjs";
|
|
29
|
+
import { t as CODEX_CATALOG_MAX_ROWS } from "./.setup/session-catalog-limits-DDxOsQeC.mjs";
|
|
30
|
+
import { t as CODEX_CATALOG_STATE_NAMESPACE } from "./.setup/session-catalog-index-state-TeO7EyO-.mjs";
|
|
31
|
+
import { i as createCodexSessionCatalogNodeHostCommands, n as createCodexSessionCatalogNodeInvokePolicies, r as createCodexSessionCatalogControl, t as codexSessionCatalogRuntime } from "./.setup/session-catalog-4sCdv5qx.mjs";
|
|
32
|
+
import { i as requestCodexAppServerJson } from "./.setup/request-BHZ1nz8d.mjs";
|
|
31
33
|
import { t as createCodexWebSearchProviderBase } from "./.setup/web-search-provider.shared-BrZmlqyR.mjs";
|
|
32
34
|
import { normalizePluginsConfig, resolveEffectiveEnableState, resolveLivePluginConfigObject, resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
33
35
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
34
36
|
import { asBoolean, asOptionalRecord, asSafeIntegerInRange, isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
35
37
|
import { isDeepStrictEqual } from "node:util";
|
|
36
38
|
import { resolveDefaultAgentDir } from "openclaw/plugin-sdk/agent-harness-registration";
|
|
39
|
+
import { coerceErrorMessage, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
37
40
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
38
41
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
39
|
-
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
40
42
|
import { jsonResult } from "openclaw/plugin-sdk/tool-results";
|
|
41
43
|
import { Type } from "typebox";
|
|
42
44
|
import { readStringParam } from "openclaw/plugin-sdk/param-readers";
|
|
@@ -44,7 +46,7 @@ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
|
44
46
|
//#region extensions/codex/src/account-usage.ts
|
|
45
47
|
function registerCodexAccountUsage(api) {
|
|
46
48
|
api.registerGatewayMethod("codex.accountUsage", async (options) => {
|
|
47
|
-
const { handleCodexAccountUsage } = await import("./.setup/account-usage-runtime-
|
|
49
|
+
const { handleCodexAccountUsage } = await import("./.setup/account-usage-runtime-DFhbh1zz.mjs");
|
|
48
50
|
await handleCodexAccountUsage(options);
|
|
49
51
|
}, { scope: "operator.admin" });
|
|
50
52
|
}
|
|
@@ -56,7 +58,7 @@ function createCodexAppServerConnectionHealthService(options) {
|
|
|
56
58
|
let abortController;
|
|
57
59
|
let monitor;
|
|
58
60
|
const run = async (ctx, signal) => {
|
|
59
|
-
const { resolveCodexAppServerRuntimeOptions } = await import("./.setup/config-runtime-
|
|
61
|
+
const { resolveCodexAppServerRuntimeOptions } = await import("./.setup/config-runtime-C0NbLms1.mjs").then((n) => n.t);
|
|
60
62
|
let consecutiveFailures = 0;
|
|
61
63
|
while (!signal.aborted) {
|
|
62
64
|
let pluginConfig;
|
|
@@ -72,8 +74,8 @@ function createCodexAppServerConnectionHealthService(options) {
|
|
|
72
74
|
return;
|
|
73
75
|
}
|
|
74
76
|
if (runtime.start.transport !== "websocket") return;
|
|
75
|
-
const { getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./.setup/shared-client-
|
|
76
|
-
const { isUnsupportedCodexAppServerVersionError } = await import("./.setup/client-
|
|
77
|
+
const { getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./.setup/shared-client-DqyTMYug.mjs").then((n) => n.v);
|
|
78
|
+
const { isUnsupportedCodexAppServerVersionError } = await import("./.setup/client-N0JpgSzF.mjs").then((n) => n.n);
|
|
77
79
|
if (signal.aborted) return;
|
|
78
80
|
let leasedClient;
|
|
79
81
|
try {
|
|
@@ -174,7 +176,7 @@ function waitForReconnect(delayMs, signal) {
|
|
|
174
176
|
/** Keeps lifecycle/auth loading behind mutations while sharing the canonical read codec. */
|
|
175
177
|
function createLazyCodexAppServerBindingStore(state, managedThreadState) {
|
|
176
178
|
let resolved;
|
|
177
|
-
const store = () => resolved ??= import("./.setup/session-binding-
|
|
179
|
+
const store = () => resolved ??= import("./.setup/session-binding-DGCYAfvD.mjs").then((n) => n.s).then(({ createCodexAppServerBindingStore }) => createCodexAppServerBindingStore(state));
|
|
178
180
|
const managedThreads = managedThreadState ? createCodexManagedThreadStore(managedThreadState) : void 0;
|
|
179
181
|
return {
|
|
180
182
|
...managedThreads ? { managedThreads } : {},
|
|
@@ -182,6 +184,7 @@ function createLazyCodexAppServerBindingStore(state, managedThreadState) {
|
|
|
182
184
|
get readMany() {
|
|
183
185
|
return state.lookupMany ? (identities) => readCurrentCodexAppServerBindings(state, identities) : void 0;
|
|
184
186
|
},
|
|
187
|
+
readNativeSubagentAssignments: (identity, owner) => readCurrentNativePendingAssignments(state, identity, owner),
|
|
185
188
|
readNativeSubagentSubmissions: (identity, owner) => readCurrentCodexNativeSubagentSubmissions(state, identity, owner),
|
|
186
189
|
hasOtherThreadOwner: async (threadId, currentIdentity) => (await store()).hasOtherThreadOwner(threadId, currentIdentity),
|
|
187
190
|
mutate: async (identity, mutation, assertCurrent) => (await store()).mutate(identity, mutation, assertCurrent),
|
|
@@ -223,7 +226,7 @@ function createCodexCommand(options) {
|
|
|
223
226
|
...ctx,
|
|
224
227
|
gatewayClientScopes: ctx.gatewayClientScopes?.slice()
|
|
225
228
|
};
|
|
226
|
-
const { handleCodexCommand } = await import("./.setup/command-dispatch-
|
|
229
|
+
const { handleCodexCommand } = await import("./.setup/command-dispatch-BeAoaovI.mjs");
|
|
227
230
|
return handleCodexCommand(commandContext, options);
|
|
228
231
|
}
|
|
229
232
|
};
|
|
@@ -255,7 +258,7 @@ async function handleCodexConversationInboundClaim(event, ctx, options) {
|
|
|
255
258
|
return {
|
|
256
259
|
handled: true,
|
|
257
260
|
reply: (await getNodeConversationState().queue.enqueue(`${data.nodeId}:${data.sessionId}`, async () => {
|
|
258
|
-
const { resolveCodexNativeSandboxBlock } = await import("./.setup/sandbox-guard-
|
|
261
|
+
const { resolveCodexNativeSandboxBlock } = await import("./.setup/sandbox-guard-DjCz2eOw.mjs").then((n) => n.r);
|
|
259
262
|
const blocked = resolveCodexNativeSandboxBlock({
|
|
260
263
|
config: options.config,
|
|
261
264
|
sessionKey,
|
|
@@ -292,7 +295,7 @@ async function handleCodexConversationInboundClaim(event, ctx, options) {
|
|
|
292
295
|
return {
|
|
293
296
|
handled: true,
|
|
294
297
|
reply: (await withCodexConversationThreadActivity(data.bindingId, async () => {
|
|
295
|
-
const { resolveCodexNativeExecutionBlock } = await import("./.setup/sandbox-guard-
|
|
298
|
+
const { resolveCodexNativeExecutionBlock } = await import("./.setup/sandbox-guard-DjCz2eOw.mjs").then((n) => n.r);
|
|
296
299
|
const nativeExecutionBlock = resolveCodexNativeExecutionBlock({
|
|
297
300
|
config: options.config,
|
|
298
301
|
sessionKey,
|
|
@@ -301,7 +304,7 @@ async function handleCodexConversationInboundClaim(event, ctx, options) {
|
|
|
301
304
|
});
|
|
302
305
|
if (nativeExecutionBlock) return { reply: { text: nativeExecutionBlock } };
|
|
303
306
|
const { getSessionBindingService } = await import("openclaw/plugin-sdk/conversation-binding-runtime");
|
|
304
|
-
const { runBoundTurnWithMissingThreadRecovery } = await import("./.setup/conversation-binding-
|
|
307
|
+
const { runBoundTurnWithMissingThreadRecovery } = await import("./.setup/conversation-binding-3Min8qvP.mjs");
|
|
305
308
|
const current = options.bindingStore.read(identity);
|
|
306
309
|
if (!isCurrentPublicBinding(publicBinding, getSessionBindingService()) || expected && (!current || current.threadId !== expected.threadId || current.conversationStartId !== expected.conversationStartId) || !expected && current && data.start?.id && current.conversationStartId !== data.start.id) return { reply: { text: "This Codex conversation was detached or changed before its message could run." } };
|
|
307
310
|
return await runBoundTurnWithMissingThreadRecovery({
|
|
@@ -335,7 +338,7 @@ async function handleCodexConversationBindingResolved(event, options) {
|
|
|
335
338
|
const binding = options.bindingStore.read(identity);
|
|
336
339
|
assertCodexBindingMayBeReplaced(binding, "clearing a denied conversation binding");
|
|
337
340
|
if (binding && (!data.start?.id || binding.conversationStartId === data.start.id)) await withCodexConversationThreadActivity(identity.bindingId, async () => {
|
|
338
|
-
const { retireCodexConversationThreadBinding } = await import("./.setup/thread-ownership-
|
|
341
|
+
const { retireCodexConversationThreadBinding } = await import("./.setup/thread-ownership-roNP0l1c.mjs").then((n) => n.o);
|
|
339
342
|
return retireCodexConversationThreadBinding({
|
|
340
343
|
bindingStore: options.bindingStore,
|
|
341
344
|
identity,
|
|
@@ -370,7 +373,7 @@ function createCodexPluginsTool(options) {
|
|
|
370
373
|
const query = typeof params.query === "string" ? params.query : "";
|
|
371
374
|
const marketplace = typeof params.marketplace === "string" ? params.marketplace.trim() : void 0;
|
|
372
375
|
const limit = typeof params.limit === "number" && Number.isInteger(params.limit) ? Math.max(1, Math.min(params.limit, 20)) : 12;
|
|
373
|
-
const { codexBindingConnectionSelection, resolveCodexBindingAppServerConnection } = await import("./.setup/binding-connection-
|
|
376
|
+
const { codexBindingConnectionSelection, resolveCodexBindingAppServerConnection } = await import("./.setup/binding-connection-DTtN1KrX.mjs").then((n) => n.n);
|
|
374
377
|
const pluginConfig = options.getPluginConfig();
|
|
375
378
|
const config = runtimeConfig();
|
|
376
379
|
const identity = options.context.sessionId ? sessionBindingIdentity({
|
|
@@ -387,7 +390,7 @@ function createCodexPluginsTool(options) {
|
|
|
387
390
|
if (runtimeConfig() !== config || !isDeepStrictEqual(options.getPluginConfig(), pluginConfig) || !isDeepStrictEqual(codexBindingConnectionSelection(readBinding()), selection)) throw new Error("Codex plugin discovery ownership changed; retry the request.");
|
|
388
391
|
};
|
|
389
392
|
const workspaceDir = binding?.cwd?.trim() || options.context.workspaceDir?.trim() || resolveCodexDefaultWorkspaceDir(pluginConfig);
|
|
390
|
-
const request = options.request ?? (await import("./.setup/command-rpc-
|
|
393
|
+
const request = options.request ?? (await import("./.setup/command-rpc-CGJGUQ6Y.mjs").then((n) => n.n)).codexControlRequest;
|
|
391
394
|
const connection = await resolveCodexBindingAppServerConnection({
|
|
392
395
|
binding,
|
|
393
396
|
pluginConfig,
|
|
@@ -420,7 +423,7 @@ function createCodexPluginsTool(options) {
|
|
|
420
423
|
};
|
|
421
424
|
}
|
|
422
425
|
function projectAvailablePlugin(plugin) {
|
|
423
|
-
|
|
426
|
+
return {
|
|
424
427
|
id: plugin.id,
|
|
425
428
|
pluginName: plugin.pluginName,
|
|
426
429
|
marketplaceName: plugin.marketplaceName,
|
|
@@ -428,13 +431,12 @@ function projectAvailablePlugin(plugin) {
|
|
|
428
431
|
untrustedDeveloperName: plugin.developerName,
|
|
429
432
|
installed: plugin.installed,
|
|
430
433
|
enabled: plugin.enabled,
|
|
431
|
-
available: plugin.available
|
|
434
|
+
available: plugin.available,
|
|
435
|
+
...plugin.description ? { untrustedDescription: plugin.description } : {},
|
|
436
|
+
...plugin.installPolicy ? { installPolicy: plugin.installPolicy } : {},
|
|
437
|
+
...plugin.authPolicy ? { authPolicy: plugin.authPolicy } : {},
|
|
438
|
+
...plugin.mustShowInstallationInterstitial !== void 0 ? { mustShowInstallationInterstitial: plugin.mustShowInstallationInterstitial } : {}
|
|
432
439
|
};
|
|
433
|
-
if (plugin.description) projected.untrustedDescription = plugin.description;
|
|
434
|
-
if (plugin.installPolicy) projected.installPolicy = plugin.installPolicy;
|
|
435
|
-
if (plugin.authPolicy) projected.authPolicy = plugin.authPolicy;
|
|
436
|
-
if (plugin.mustShowInstallationInterstitial !== void 0) projected.mustShowInstallationInterstitial = plugin.mustShowInstallationInterstitial;
|
|
437
|
-
return projected;
|
|
438
440
|
}
|
|
439
441
|
//#endregion
|
|
440
442
|
//#region extensions/codex/src/native-thread-tool.ts
|
|
@@ -492,22 +494,12 @@ function readThreadId(params) {
|
|
|
492
494
|
label: "thread_id"
|
|
493
495
|
});
|
|
494
496
|
}
|
|
495
|
-
function
|
|
496
|
-
if (!isJsonObject(value) || !isJsonObject(value.thread) || !isJsonObject(value.thread.status)) return;
|
|
497
|
-
return typeof value.thread.status.type === "string" ? value.thread.status.type : void 0;
|
|
498
|
-
}
|
|
499
|
-
function assertThreadMayBeArchived(value, expectedThreadId) {
|
|
500
|
-
if (!isJsonObject(value) || !isJsonObject(value.thread)) throw new Error("Codex app-server returned an invalid thread/read response");
|
|
501
|
-
if (value.thread.id !== expectedThreadId) throw new Error("Codex app-server returned a different thread than requested");
|
|
502
|
-
const status = readThreadStatusType(value);
|
|
503
|
-
if (status === "active") throw new Error("cannot archive an active Codex thread; wait for its turn to finish");
|
|
504
|
-
if (status !== "idle" && status !== "notLoaded") throw new Error("cannot verify that the Codex thread is idle; refusing to archive");
|
|
505
|
-
}
|
|
506
|
-
function assertThreadMayBeForked(value, expectedThreadId) {
|
|
497
|
+
function assertThreadIdle(value, expectedThreadId, action) {
|
|
507
498
|
if (!isJsonObject(value) || !isJsonObject(value.thread)) throw new Error("Codex app-server returned an invalid thread/read response");
|
|
508
499
|
if (value.thread.id !== expectedThreadId) throw new Error("Codex app-server returned a different thread than requested");
|
|
509
|
-
const status =
|
|
510
|
-
if (
|
|
500
|
+
const status = isJsonObject(value.thread.status) ? value.thread.status.type : void 0;
|
|
501
|
+
if (action === "archive" && status === "active") throw new Error("cannot archive an active Codex thread; wait for its turn to finish");
|
|
502
|
+
if (status !== "idle" && status !== "notLoaded") throw new Error(action === "archive" ? "cannot verify that the Codex thread is idle; refusing to archive" : "cannot fork a Codex thread unless it is idle or not loaded");
|
|
511
503
|
}
|
|
512
504
|
function redactNativeThreadTranscriptFields(value) {
|
|
513
505
|
if (!isJsonObject(value)) return value;
|
|
@@ -575,11 +567,12 @@ function createCodexThreadsTool(options) {
|
|
|
575
567
|
const mayReadRawTranscripts = supervision?.enabled !== true || supervision.allowRawTranscripts === true;
|
|
576
568
|
if ((action === "fork" || action === "rename" || action === "archive" || action === "unarchive") && supervision?.enabled === true && supervision.allowWriteControls !== true) throw new Error("Codex native thread mutations are disabled for this codex plugin supervision config.");
|
|
577
569
|
const run = async (archiveAdmission) => {
|
|
578
|
-
const request = options.request ?? (await import("./.setup/command-rpc-
|
|
570
|
+
const request = options.request ?? (await import("./.setup/command-rpc-CGJGUQ6Y.mjs").then((n) => n.n)).codexControlRequest;
|
|
579
571
|
const { isModelSelectionLocked, ModelSelectionLockedError } = await import("openclaw/plugin-sdk/model-session-runtime");
|
|
580
|
-
const { codexBindingConnectionSelection, resolveCodexBindingAppServerConnection } = await import("./.setup/binding-connection-
|
|
581
|
-
const { resolveCodexSupervisionAppServerRuntimeOptions } = await import("./.setup/config-runtime-
|
|
582
|
-
const requestOptions = async (
|
|
572
|
+
const { codexBindingConnectionSelection, resolveCodexBindingAppServerConnection } = await import("./.setup/binding-connection-DTtN1KrX.mjs").then((n) => n.n);
|
|
573
|
+
const { resolveCodexSupervisionAppServerRuntimeOptions } = await import("./.setup/config-runtime-C0NbLms1.mjs").then((n) => n.t);
|
|
574
|
+
const requestOptions = async () => {
|
|
575
|
+
const pluginConfig = admissionConfig;
|
|
583
576
|
const plugin = readCodexPluginConfig(pluginConfig);
|
|
584
577
|
const base = baseRequestOptions();
|
|
585
578
|
const session = currentSession();
|
|
@@ -615,11 +608,12 @@ function createCodexThreadsTool(options) {
|
|
|
615
608
|
assertCurrent
|
|
616
609
|
};
|
|
617
610
|
};
|
|
611
|
+
const scopedRequest = async (method, requestParams) => request(admissionConfig, method, requestParams, await requestOptions());
|
|
618
612
|
if (action === "list") {
|
|
619
613
|
const cursor = readStringParam(params, "cursor");
|
|
620
614
|
const searchTerm = readStringParam(params, "search");
|
|
621
615
|
if (searchTerm && !mayReadRawTranscripts) throw new Error("Codex native thread search is disabled while raw transcript access is disabled.");
|
|
622
|
-
const response = await
|
|
616
|
+
const response = await scopedRequest(CODEX_CONTROL_METHODS.listThreads, {
|
|
623
617
|
archived: asBoolean(params.archived) ?? false,
|
|
624
618
|
limit: asSafeIntegerInRange(params.limit, {
|
|
625
619
|
min: 1,
|
|
@@ -631,17 +625,17 @@ function createCodexThreadsTool(options) {
|
|
|
631
625
|
sourceKinds: [...CODEX_INTERACTIVE_THREAD_SOURCE_KINDS],
|
|
632
626
|
...cursor ? { cursor } : {},
|
|
633
627
|
...searchTerm ? { searchTerm } : {}
|
|
634
|
-
}
|
|
628
|
+
});
|
|
635
629
|
return jsonResult(mayReadRawTranscripts ? response : redactNativeThreadResponse(response));
|
|
636
630
|
}
|
|
637
631
|
const threadId = archiveAdmission?.threadId ?? readThreadId(params);
|
|
638
632
|
if (action === "read") {
|
|
639
633
|
const includeTurns = asBoolean(params.include_turns) ?? false;
|
|
640
634
|
if (includeTurns && !mayReadRawTranscripts) throw new Error("Codex raw transcript reads are disabled for this codex plugin supervision config.");
|
|
641
|
-
const response = await
|
|
635
|
+
const response = await scopedRequest(CODEX_CONTROL_METHODS.readThread, {
|
|
642
636
|
threadId,
|
|
643
637
|
includeTurns
|
|
644
|
-
}
|
|
638
|
+
});
|
|
645
639
|
return jsonResult(mayReadRawTranscripts ? response : redactNativeThreadResponse(response));
|
|
646
640
|
}
|
|
647
641
|
if (action === "rename") {
|
|
@@ -649,10 +643,10 @@ function createCodexThreadsTool(options) {
|
|
|
649
643
|
required: true,
|
|
650
644
|
label: "name"
|
|
651
645
|
});
|
|
652
|
-
await
|
|
646
|
+
await scopedRequest(CODEX_CONTROL_METHODS.renameThread, {
|
|
653
647
|
threadId,
|
|
654
648
|
name
|
|
655
|
-
}
|
|
649
|
+
});
|
|
656
650
|
return jsonResult({
|
|
657
651
|
action,
|
|
658
652
|
threadId,
|
|
@@ -660,7 +654,7 @@ function createCodexThreadsTool(options) {
|
|
|
660
654
|
});
|
|
661
655
|
}
|
|
662
656
|
if (action === "unarchive") {
|
|
663
|
-
const response = await
|
|
657
|
+
const response = await scopedRequest(CODEX_CONTROL_METHODS.unarchiveThread, { threadId });
|
|
664
658
|
return jsonResult(mayReadRawTranscripts ? response : redactNativeThreadResponse(response));
|
|
665
659
|
}
|
|
666
660
|
const session = archiveAdmission?.session ?? currentSession();
|
|
@@ -672,23 +666,23 @@ function createCodexThreadsTool(options) {
|
|
|
672
666
|
if (isModelSelectionLocked(admittedSession.entry)) throw new ModelSelectionLockedError();
|
|
673
667
|
assertCodexBindingMayBeReplaced(archivedBinding, "archiving its bound native thread");
|
|
674
668
|
}
|
|
675
|
-
|
|
669
|
+
assertThreadIdle(await scopedRequest(CODEX_CONTROL_METHODS.readThread, {
|
|
676
670
|
threadId,
|
|
677
671
|
includeTurns: false
|
|
678
|
-
},
|
|
672
|
+
}), threadId, "archive");
|
|
679
673
|
if (await options.bindingStore.hasOtherThreadOwner(threadId, identity)) throw new Error("cannot archive a native Codex thread owned by another OpenClaw session");
|
|
680
674
|
await assertCodexArchiveDescendantsUnowned({
|
|
681
675
|
bindingStore: options.bindingStore,
|
|
682
676
|
threadId,
|
|
683
|
-
listPage: async (listParams) => await
|
|
677
|
+
listPage: async (listParams) => await scopedRequest(CODEX_CONTROL_METHODS.listThreads, listParams),
|
|
684
678
|
assertDescendantIdle: async (descendantThreadId) => {
|
|
685
|
-
|
|
679
|
+
assertThreadIdle(await scopedRequest(CODEX_CONTROL_METHODS.readThread, {
|
|
686
680
|
threadId: descendantThreadId,
|
|
687
681
|
includeTurns: false
|
|
688
|
-
},
|
|
682
|
+
}), descendantThreadId, "archive");
|
|
689
683
|
}
|
|
690
684
|
});
|
|
691
|
-
await
|
|
685
|
+
await scopedRequest(CODEX_CONTROL_METHODS.archiveThread, { threadId });
|
|
692
686
|
if (archivedBinding?.threadId === threadId) await options.bindingStore.mutate(identity, {
|
|
693
687
|
kind: "clear",
|
|
694
688
|
threadId
|
|
@@ -704,15 +698,15 @@ function createCodexThreadsTool(options) {
|
|
|
704
698
|
if (attach && isModelSelectionLocked(session?.entry)) throw new ModelSelectionLockedError();
|
|
705
699
|
const usesSupervisionConnection = binding?.connectionScope === "supervision" || admissionPlugin.appServer?.homeScope !== "user" && supervision?.enabled === true;
|
|
706
700
|
if (attach && usesSupervisionConnection) throw new Error("Supervised Codex forks must stay detached; set attach=false.");
|
|
707
|
-
const forkOptions = await requestOptions(
|
|
708
|
-
const { retainCodexAppServerBindingSubscription, rollbackCodexAppServerBindingSubscription } = await import("./.setup/thread-ownership-
|
|
709
|
-
const { closeCodexStartupClientBestEffort } = await import("./.setup/attempt-client-cleanup-
|
|
701
|
+
const forkOptions = await requestOptions();
|
|
702
|
+
const { retainCodexAppServerBindingSubscription, rollbackCodexAppServerBindingSubscription } = await import("./.setup/thread-ownership-roNP0l1c.mjs").then((n) => n.o);
|
|
703
|
+
const { closeCodexStartupClientBestEffort } = await import("./.setup/attempt-client-cleanup-DOP-cW5j.mjs").then((n) => n.a);
|
|
710
704
|
if (attach) {
|
|
711
705
|
assertCodexBindingMayBeReplaced(binding, "attaching a different native fork");
|
|
712
|
-
|
|
706
|
+
assertThreadIdle(await request(admissionConfig, CODEX_CONTROL_METHODS.readThread, {
|
|
713
707
|
threadId,
|
|
714
708
|
includeTurns: false
|
|
715
|
-
}, forkOptions), threadId);
|
|
709
|
+
}, forkOptions), threadId, "fork");
|
|
716
710
|
}
|
|
717
711
|
const response = await request(admissionConfig, CODEX_CONTROL_METHODS.forkThread, {
|
|
718
712
|
threadId,
|
|
@@ -823,19 +817,31 @@ function createCodexNodeExecServerCommand() {
|
|
|
823
817
|
}
|
|
824
818
|
if (!isRecord(request) || Object.keys(request).length !== 2 || request.authorization !== "human-approved" && request.authorization !== "session-full") throw new Error("Codex node exec-server requires an authorized managed placement workspace launch.");
|
|
825
819
|
const placement = parseCodexNodePlacementWorkspace(request.placement);
|
|
826
|
-
if (!context?.
|
|
820
|
+
if (!context?.acquireManagedWorkspaceAsync || context.sessionKey !== placement.sessionKey || io.signal.aborted) throw new Error("Codex node exec-server requires active managed placement authority.");
|
|
827
821
|
if (!context.prepareExecAuthorization) throw new Error("Codex node execution requires node-local exec policy support; update the node.");
|
|
822
|
+
const runtimeIo = context.signal ? {
|
|
823
|
+
...io,
|
|
824
|
+
signal: AbortSignal.any([io.signal, context.signal])
|
|
825
|
+
} : io;
|
|
828
826
|
const assertExecAuthorized = context.prepareExecAuthorization(request.authorization);
|
|
829
|
-
const { runCodexNodeExecServer } = await import("./.setup/node-exec-server.runtime-
|
|
827
|
+
const { runCodexNodeExecServer } = await import("./.setup/node-exec-server.runtime-BgBfWQqo.mjs");
|
|
828
|
+
runtimeIo.signal.throwIfAborted();
|
|
829
|
+
const workspace = await context.acquireManagedWorkspaceAsync({
|
|
830
|
+
workspaceDir: placement.cwd,
|
|
831
|
+
environmentId: placement.environmentId,
|
|
832
|
+
sessionId: placement.sessionId,
|
|
833
|
+
ownerEpoch: placement.ownerEpoch,
|
|
834
|
+
sessionKey: placement.sessionKey
|
|
835
|
+
});
|
|
836
|
+
try {
|
|
837
|
+
runtimeIo.signal.throwIfAborted();
|
|
838
|
+
} catch (error) {
|
|
839
|
+
workspace.release();
|
|
840
|
+
throw error;
|
|
841
|
+
}
|
|
830
842
|
return await runCodexNodeExecServer({
|
|
831
|
-
workspace
|
|
832
|
-
|
|
833
|
-
environmentId: placement.environmentId,
|
|
834
|
-
sessionId: placement.sessionId,
|
|
835
|
-
ownerEpoch: placement.ownerEpoch,
|
|
836
|
-
sessionKey: placement.sessionKey
|
|
837
|
-
}),
|
|
838
|
-
io,
|
|
843
|
+
workspace,
|
|
844
|
+
io: runtimeIo,
|
|
839
845
|
activeProcesses,
|
|
840
846
|
assertExecAuthorized
|
|
841
847
|
});
|
|
@@ -1031,9 +1037,6 @@ function readStoredThreads(data, maxEntries) {
|
|
|
1031
1037
|
return entry;
|
|
1032
1038
|
});
|
|
1033
1039
|
}
|
|
1034
|
-
function readBooleanParam(params, key) {
|
|
1035
|
-
return params[key] === true;
|
|
1036
|
-
}
|
|
1037
1040
|
function readIntegerParam(params, key) {
|
|
1038
1041
|
const value = params[key];
|
|
1039
1042
|
if (value === void 0) return;
|
|
@@ -1125,25 +1128,23 @@ function readLegacyEnvEndpoints(env) {
|
|
|
1125
1128
|
function resolveEndpoints(pluginConfig, env, runtimeConfig, resolveAuthProfileId, resolveRuntimeOptions) {
|
|
1126
1129
|
const configured = readCodexPluginConfig(pluginConfig).supervision?.endpoints;
|
|
1127
1130
|
const endpoints = configured?.length ? configured : readLegacyEnvEndpoints(env);
|
|
1128
|
-
|
|
1131
|
+
const normalized = endpoints ? requireUniqueEndpointIds(endpoints.map(normalizeConfiguredEndpoint)) : [{
|
|
1129
1132
|
id: "local",
|
|
1130
1133
|
label: "local Codex app-server"
|
|
1131
|
-
}]
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
}
|
|
1143
|
-
if (endpoint.label !== void 0) resolved.label = endpoint.label;
|
|
1144
|
-
if (endpoint.configured !== void 0) resolved.configured = endpoint.configured;
|
|
1145
|
-
return resolved;
|
|
1134
|
+
}];
|
|
1135
|
+
const resolved = [];
|
|
1136
|
+
for (const endpoint of normalized) resolved.push({
|
|
1137
|
+
...endpoint,
|
|
1138
|
+
connectionKey: supervisionEndpointConnectionKey({
|
|
1139
|
+
endpoint,
|
|
1140
|
+
pluginConfig,
|
|
1141
|
+
env,
|
|
1142
|
+
runtimeConfig,
|
|
1143
|
+
resolveAuthProfileId,
|
|
1144
|
+
resolveRuntimeOptions
|
|
1145
|
+
})
|
|
1146
1146
|
});
|
|
1147
|
+
return resolved;
|
|
1147
1148
|
}
|
|
1148
1149
|
function resolveEndpointStartOptions(params) {
|
|
1149
1150
|
const base = params.resolveRuntimeOptions({
|
|
@@ -1262,7 +1263,7 @@ function threadFromRead(value) {
|
|
|
1262
1263
|
return isRecord(value) && isRecord(value.thread) ? value.thread : void 0;
|
|
1263
1264
|
}
|
|
1264
1265
|
function isLoadedThreadReadMiss(error) {
|
|
1265
|
-
const message =
|
|
1266
|
+
const message = coerceErrorMessage(error);
|
|
1266
1267
|
return message.includes("thread not found") || message.includes("thread not loaded");
|
|
1267
1268
|
}
|
|
1268
1269
|
async function readThread(params) {
|
|
@@ -1283,86 +1284,63 @@ async function readThread(params) {
|
|
|
1283
1284
|
return thread;
|
|
1284
1285
|
}
|
|
1285
1286
|
}
|
|
1286
|
-
async function
|
|
1287
|
+
async function listSessions(request, endpoint, storedLimit) {
|
|
1288
|
+
const loaded = storedLimit === void 0;
|
|
1289
|
+
const method = loaded ? "thread/loaded/list" : "thread/list";
|
|
1290
|
+
const limit = storedLimit ?? Infinity;
|
|
1287
1291
|
const sessions = [];
|
|
1288
1292
|
const seenCursors = /* @__PURE__ */ new Set();
|
|
1289
1293
|
let cursor;
|
|
1290
1294
|
for (let pageIndex = 0; pageIndex < MAX_COMPAT_PAGINATION_PAGES; pageIndex += 1) {
|
|
1291
|
-
const
|
|
1292
|
-
|
|
1295
|
+
const remaining = limit - sessions.length;
|
|
1296
|
+
if (remaining <= 0) break;
|
|
1297
|
+
const pageLimit = Math.min(PAGE_LIMIT, remaining);
|
|
1298
|
+
const listed = await request(endpoint, method, {
|
|
1299
|
+
...loaded ? {} : {
|
|
1300
|
+
archived: false,
|
|
1301
|
+
sourceKinds: [...ALL_CODEX_THREAD_SOURCE_KINDS],
|
|
1302
|
+
modelProviders: [],
|
|
1303
|
+
sortKey: "recency_at",
|
|
1304
|
+
sortDirection: "desc",
|
|
1305
|
+
useStateDbOnly: true
|
|
1306
|
+
},
|
|
1307
|
+
limit: pageLimit,
|
|
1293
1308
|
...cursor ? { cursor } : {}
|
|
1294
1309
|
});
|
|
1295
|
-
if (!isRecord(listed) || !Array.isArray(listed.data)) throw new Error(
|
|
1296
|
-
const
|
|
1297
|
-
for (const
|
|
1298
|
-
if (sessions.some((
|
|
1310
|
+
if (!isRecord(listed) || !Array.isArray(listed.data)) throw new Error(`Codex ${method} returned an invalid response`);
|
|
1311
|
+
const entries = loaded ? readLoadedThreadIds(listed.data) : readStoredThreads(listed.data, pageLimit);
|
|
1312
|
+
for (const entry of entries) {
|
|
1313
|
+
if (typeof entry === "string" && sessions.some((session) => session.threadId === entry)) continue;
|
|
1299
1314
|
try {
|
|
1300
|
-
const thread = await readThread({
|
|
1315
|
+
const thread = typeof entry === "string" ? await readThread({
|
|
1301
1316
|
request,
|
|
1302
1317
|
endpoint,
|
|
1303
|
-
threadId,
|
|
1318
|
+
threadId: entry,
|
|
1304
1319
|
includeTurns: false
|
|
1305
|
-
});
|
|
1306
|
-
const session = toSession(endpoint.id, thread, true);
|
|
1307
|
-
if (session) sessions.push(session);
|
|
1320
|
+
}) : entry;
|
|
1321
|
+
const session = toSession(endpoint.id, thread, loaded ? true : void 0);
|
|
1322
|
+
if (session && (loaded || !sessions.some((existing) => existing.threadId === session.threadId))) sessions.push(session);
|
|
1308
1323
|
} catch (error) {
|
|
1309
|
-
if (!isLoadedThreadReadMiss(error)) throw error;
|
|
1324
|
+
if (!loaded || !isLoadedThreadReadMiss(error)) throw error;
|
|
1310
1325
|
}
|
|
1311
1326
|
}
|
|
1312
|
-
const nextCursor = readCompatNextCursor(listed.nextCursor,
|
|
1313
|
-
if (nextCursor && seenCursors.has(nextCursor)) throw new Error(`Codex
|
|
1314
|
-
if (nextCursor) seenCursors.add(nextCursor);
|
|
1315
|
-
cursor = nextCursor;
|
|
1316
|
-
if (!cursor) break;
|
|
1317
|
-
}
|
|
1318
|
-
if (cursor) throw new Error(`Codex thread/loaded/list exceeded ${MAX_COMPAT_PAGINATION_PAGES} pages with a continuation cursor`);
|
|
1319
|
-
return sessions;
|
|
1320
|
-
}
|
|
1321
|
-
async function listStoredSessions(params) {
|
|
1322
|
-
const sessions = [];
|
|
1323
|
-
const seenCursors = /* @__PURE__ */ new Set();
|
|
1324
|
-
let cursor;
|
|
1325
|
-
for (let pageIndex = 0; pageIndex < MAX_COMPAT_PAGINATION_PAGES; pageIndex += 1) {
|
|
1326
|
-
const remaining = params.limit - sessions.length;
|
|
1327
|
-
if (remaining <= 0) break;
|
|
1328
|
-
const pageLimit = Math.min(PAGE_LIMIT, remaining);
|
|
1329
|
-
const listed = await params.request(params.endpoint, "thread/list", {
|
|
1330
|
-
archived: false,
|
|
1331
|
-
limit: pageLimit,
|
|
1332
|
-
sourceKinds: [...ALL_CODEX_THREAD_SOURCE_KINDS],
|
|
1333
|
-
modelProviders: [],
|
|
1334
|
-
sortKey: "recency_at",
|
|
1335
|
-
sortDirection: "desc",
|
|
1336
|
-
useStateDbOnly: true,
|
|
1337
|
-
...cursor ? { cursor } : {}
|
|
1338
|
-
});
|
|
1339
|
-
if (!isRecord(listed) || !Array.isArray(listed.data)) throw new Error("Codex thread/list returned an invalid response");
|
|
1340
|
-
for (const thread of readStoredThreads(listed.data, pageLimit)) {
|
|
1341
|
-
if (sessions.length >= params.limit) break;
|
|
1342
|
-
const session = toSession(params.endpoint.id, thread);
|
|
1343
|
-
if (session && !sessions.some((entry) => entry.threadId === session.threadId)) sessions.push(session);
|
|
1344
|
-
}
|
|
1345
|
-
const nextCursor = readCompatNextCursor(listed.nextCursor, "thread/list");
|
|
1346
|
-
if (nextCursor && sessions.length < params.limit && seenCursors.has(nextCursor)) throw new Error(`Codex thread/list returned repeated cursor ${nextCursor}`);
|
|
1327
|
+
const nextCursor = readCompatNextCursor(listed.nextCursor, method);
|
|
1328
|
+
if (nextCursor && sessions.length < limit && seenCursors.has(nextCursor)) throw new Error(`Codex ${method} returned repeated cursor ${nextCursor}`);
|
|
1347
1329
|
if (nextCursor) seenCursors.add(nextCursor);
|
|
1348
1330
|
cursor = nextCursor;
|
|
1349
|
-
if (!cursor || sessions.length >=
|
|
1331
|
+
if (!cursor || sessions.length >= limit) break;
|
|
1350
1332
|
}
|
|
1351
|
-
if (cursor && sessions.length <
|
|
1333
|
+
if (cursor && sessions.length < limit) throw new Error(`Codex ${method} exceeded ${MAX_COMPAT_PAGINATION_PAGES} pages with a continuation cursor`);
|
|
1352
1334
|
return sessions;
|
|
1353
1335
|
}
|
|
1354
1336
|
async function listSessionSnapshot(params) {
|
|
1355
1337
|
const sessions = [];
|
|
1356
1338
|
const errors = [];
|
|
1357
1339
|
for (const endpoint of params.endpoints) try {
|
|
1358
|
-
const loaded = await
|
|
1340
|
+
const loaded = await listSessions(params.request, endpoint);
|
|
1359
1341
|
sessions.push(...loaded);
|
|
1360
1342
|
if (params.includeStored) {
|
|
1361
|
-
const stored = await
|
|
1362
|
-
request: params.request,
|
|
1363
|
-
endpoint,
|
|
1364
|
-
limit: params.maxStoredSessions ?? DEFAULT_MAX_STORED_SESSIONS
|
|
1365
|
-
});
|
|
1343
|
+
const stored = await listSessions(params.request, endpoint, params.maxStoredSessions ?? DEFAULT_MAX_STORED_SESSIONS);
|
|
1366
1344
|
for (const session of stored) if (!sessions.some((entry) => entry.endpointId === endpoint.id && entry.threadId === session.threadId)) sessions.push(session);
|
|
1367
1345
|
}
|
|
1368
1346
|
} catch (error) {
|
|
@@ -1370,7 +1348,7 @@ async function listSessionSnapshot(params) {
|
|
|
1370
1348
|
errors.push({
|
|
1371
1349
|
endpointId: endpoint.id,
|
|
1372
1350
|
ok: false,
|
|
1373
|
-
detail:
|
|
1351
|
+
detail: coerceErrorMessage(error)
|
|
1374
1352
|
});
|
|
1375
1353
|
}
|
|
1376
1354
|
return {
|
|
@@ -1394,7 +1372,6 @@ async function resolveEndpointForThread(params) {
|
|
|
1394
1372
|
})).id === params.threadId) matches.push(endpoint);
|
|
1395
1373
|
} catch (error) {
|
|
1396
1374
|
if (error instanceof CodexSupervisionPolicyError) throw error;
|
|
1397
|
-
if (!isLoadedThreadReadMiss(error)) continue;
|
|
1398
1375
|
}
|
|
1399
1376
|
if (matches.length === 1) return expectDefined(matches[0], "single matching Codex supervision endpoint");
|
|
1400
1377
|
if (matches.length > 1) throw new Error(`Codex thread id is ambiguous across endpoints: ${params.threadId}`);
|
|
@@ -1443,27 +1420,16 @@ function redactEndpointUrl(value) {
|
|
|
1443
1420
|
}
|
|
1444
1421
|
}
|
|
1445
1422
|
function endpointResult(endpoint, pluginConfig, env, resolveRuntimeOptions) {
|
|
1446
|
-
const
|
|
1447
|
-
if (configured && (configured.transport === "stdio-proxy" || configured.transport === void 0)) return {
|
|
1448
|
-
id: endpoint.id,
|
|
1449
|
-
transport: "stdio-proxy",
|
|
1450
|
-
...endpoint.label ? { label: endpoint.label } : {}
|
|
1451
|
-
};
|
|
1452
|
-
if (configured?.transport === "websocket") return {
|
|
1453
|
-
id: endpoint.id,
|
|
1454
|
-
transport: "websocket",
|
|
1455
|
-
...endpoint.label ? { label: endpoint.label } : {},
|
|
1456
|
-
url: redactEndpointUrl(configured.url)
|
|
1457
|
-
};
|
|
1458
|
-
const start = resolveRuntimeOptions({
|
|
1423
|
+
const start = endpoint.configured ?? resolveRuntimeOptions({
|
|
1459
1424
|
pluginConfig,
|
|
1460
1425
|
env
|
|
1461
1426
|
}).start;
|
|
1427
|
+
const remote = start.transport === "websocket" || start.transport === "unix" ? { url: redactEndpointUrl(start.url ?? (start.transport === "unix" ? "unix://" : "")) } : void 0;
|
|
1462
1428
|
return {
|
|
1463
1429
|
id: endpoint.id,
|
|
1464
|
-
transport:
|
|
1430
|
+
transport: remote ? "websocket" : "stdio-proxy",
|
|
1465
1431
|
...endpoint.label ? { label: endpoint.label } : {},
|
|
1466
|
-
...
|
|
1432
|
+
...remote
|
|
1467
1433
|
};
|
|
1468
1434
|
}
|
|
1469
1435
|
function sanitizeSessionListResult(result, includeTranscriptDerivedFields) {
|
|
@@ -1512,8 +1478,26 @@ function createCodexSupervisionTools(options) {
|
|
|
1512
1478
|
const request = createPolicyGuardedRequest(options, "enabled");
|
|
1513
1479
|
const rawTranscriptRequest = createPolicyGuardedRequest(options, "raw-transcripts");
|
|
1514
1480
|
const writeRequest = createPolicyGuardedRequest(options, "write-controls");
|
|
1515
|
-
const current = () =>
|
|
1516
|
-
|
|
1481
|
+
const current = () => requireLiveToolPolicy(options, "enabled");
|
|
1482
|
+
const readActiveThread = async (endpoints, params, threadId, idleError) => {
|
|
1483
|
+
const endpoint = await resolveEndpointForThread({
|
|
1484
|
+
endpoints,
|
|
1485
|
+
request: writeRequest,
|
|
1486
|
+
endpointId: readStringParam(params, "endpoint_id"),
|
|
1487
|
+
threadId
|
|
1488
|
+
});
|
|
1489
|
+
const thread = await readThread({
|
|
1490
|
+
request: writeRequest,
|
|
1491
|
+
endpoint,
|
|
1492
|
+
threadId,
|
|
1493
|
+
includeTurns: true
|
|
1494
|
+
});
|
|
1495
|
+
requireCurrentEndpoint(options, "write-controls", endpoint);
|
|
1496
|
+
if (statusType(thread) !== "active") throw idleError();
|
|
1497
|
+
return {
|
|
1498
|
+
endpoint,
|
|
1499
|
+
thread
|
|
1500
|
+
};
|
|
1517
1501
|
};
|
|
1518
1502
|
return [
|
|
1519
1503
|
{
|
|
@@ -1556,7 +1540,7 @@ function createCodexSupervisionTools(options) {
|
|
|
1556
1540
|
const result = await listSessionSnapshot({
|
|
1557
1541
|
endpoints,
|
|
1558
1542
|
request,
|
|
1559
|
-
includeStored:
|
|
1543
|
+
includeStored: params.include_stored === true,
|
|
1560
1544
|
maxStoredSessions: readIntegerParam(params, "max_stored_sessions")
|
|
1561
1545
|
});
|
|
1562
1546
|
const { pluginConfig } = requireCurrentEndpointSet(options, endpoints);
|
|
@@ -1586,7 +1570,7 @@ function createCodexSupervisionTools(options) {
|
|
|
1586
1570
|
request: rawTranscriptRequest,
|
|
1587
1571
|
endpoint,
|
|
1588
1572
|
threadId,
|
|
1589
|
-
includeTurns:
|
|
1573
|
+
includeTurns: params.include_turns === true
|
|
1590
1574
|
});
|
|
1591
1575
|
requireCurrentEndpoint(options, "raw-transcripts", endpoint);
|
|
1592
1576
|
return jsonResult({
|
|
@@ -1610,20 +1594,7 @@ function createCodexSupervisionTools(options) {
|
|
|
1610
1594
|
allowEmpty: false
|
|
1611
1595
|
});
|
|
1612
1596
|
if ((readModeParam(params) ?? "auto") === "start") throw idleContinuationError(threadId);
|
|
1613
|
-
const endpoint = await
|
|
1614
|
-
endpoints,
|
|
1615
|
-
request: writeRequest,
|
|
1616
|
-
endpointId: readStringParam(params, "endpoint_id"),
|
|
1617
|
-
threadId
|
|
1618
|
-
});
|
|
1619
|
-
const thread = await readThread({
|
|
1620
|
-
request: writeRequest,
|
|
1621
|
-
endpoint,
|
|
1622
|
-
threadId,
|
|
1623
|
-
includeTurns: true
|
|
1624
|
-
});
|
|
1625
|
-
requireCurrentEndpoint(options, "write-controls", endpoint);
|
|
1626
|
-
if (statusType(thread) !== "active") throw idleContinuationError(threadId);
|
|
1597
|
+
const { endpoint, thread } = await readActiveThread(endpoints, params, threadId, () => idleContinuationError(threadId));
|
|
1627
1598
|
const turnId = await resolveInProgressTurnId({
|
|
1628
1599
|
request: writeRequest,
|
|
1629
1600
|
endpoint,
|
|
@@ -1662,20 +1633,7 @@ function createCodexSupervisionTools(options) {
|
|
|
1662
1633
|
requireWriteAccess(pluginConfig);
|
|
1663
1634
|
const params = isRecord(rawParams) ? rawParams : {};
|
|
1664
1635
|
const threadId = readStringParam(params, "thread_id", { required: true });
|
|
1665
|
-
const endpoint = await
|
|
1666
|
-
endpoints,
|
|
1667
|
-
request: writeRequest,
|
|
1668
|
-
endpointId: readStringParam(params, "endpoint_id"),
|
|
1669
|
-
threadId
|
|
1670
|
-
});
|
|
1671
|
-
const thread = await readThread({
|
|
1672
|
-
request: writeRequest,
|
|
1673
|
-
endpoint,
|
|
1674
|
-
threadId,
|
|
1675
|
-
includeTurns: true
|
|
1676
|
-
});
|
|
1677
|
-
requireCurrentEndpoint(options, "write-controls", endpoint);
|
|
1678
|
-
if (statusType(thread) !== "active") throw new Error(`Codex thread ${threadId} has no active turn to interrupt`);
|
|
1636
|
+
const { endpoint, thread } = await readActiveThread(endpoints, params, threadId, () => /* @__PURE__ */ new Error(`Codex thread ${threadId} has no active turn to interrupt`));
|
|
1679
1637
|
const turnId = readStringParam(params, "turn_id") ?? await resolveInProgressTurnId({
|
|
1680
1638
|
request: writeRequest,
|
|
1681
1639
|
endpoint,
|
|
@@ -1702,7 +1660,7 @@ function createCodexSupervisionTools(options) {
|
|
|
1702
1660
|
}
|
|
1703
1661
|
//#endregion
|
|
1704
1662
|
//#region extensions/codex/src/web-search-provider.ts
|
|
1705
|
-
const loadCodexWebSearchRuntime = createLazyRuntimeModule(() => import("./.setup/web-search-provider.runtime-
|
|
1663
|
+
const loadCodexWebSearchRuntime = createLazyRuntimeModule(() => import("./.setup/web-search-provider.runtime-P77OUeoo.mjs"));
|
|
1706
1664
|
const CodexWebSearchSchema = {
|
|
1707
1665
|
type: "object",
|
|
1708
1666
|
properties: { query: {
|
|
@@ -1773,12 +1731,15 @@ var codex_default = definePluginEntry({
|
|
|
1773
1731
|
getRuntimeConfig: resolveCurrentConfig
|
|
1774
1732
|
}));
|
|
1775
1733
|
let bindingStateStore;
|
|
1734
|
+
let bindingMutationStore;
|
|
1776
1735
|
let managedThreadStateStore;
|
|
1777
|
-
const
|
|
1736
|
+
const bindingStateOptions = {
|
|
1778
1737
|
namespace: CODEX_APP_SERVER_BINDING_NAMESPACE,
|
|
1779
1738
|
maxEntries: CODEX_APP_SERVER_BINDING_MAX_ENTRIES,
|
|
1780
1739
|
overflowPolicy: "reject-new"
|
|
1781
|
-
}
|
|
1740
|
+
};
|
|
1741
|
+
const openBindingStateStore = () => bindingStateStore ??= api.runtime.state.openSyncKeyedStore(bindingStateOptions);
|
|
1742
|
+
const openBindingMutationStore = () => bindingMutationStore ??= api.runtime.state.openKeyedStore(bindingStateOptions);
|
|
1782
1743
|
const lazyBindingStateStore = {
|
|
1783
1744
|
deleteIf: (key, predicate) => openBindingStateStore().deleteIf(key, predicate),
|
|
1784
1745
|
entries: () => openBindingStateStore().entries(),
|
|
@@ -1788,9 +1749,10 @@ var codex_default = definePluginEntry({
|
|
|
1788
1749
|
return store.lookupMany?.bind(store);
|
|
1789
1750
|
},
|
|
1790
1751
|
registerIfAbsent: (key, value, options) => openBindingStateStore().registerIfAbsent(key, value, options),
|
|
1791
|
-
|
|
1792
|
-
const store =
|
|
1793
|
-
|
|
1752
|
+
withCurrent: (authority) => {
|
|
1753
|
+
const store = openBindingMutationStore();
|
|
1754
|
+
if (!store.withCurrent) throw new Error("Codex bindings require action-bound plugin-state mutations");
|
|
1755
|
+
return store.withCurrent(authority);
|
|
1794
1756
|
}
|
|
1795
1757
|
};
|
|
1796
1758
|
const openManagedThreadStateStore = () => managedThreadStateStore ??= api.runtime.state.openKeyedStore({
|
|
@@ -1918,21 +1880,13 @@ var codex_default = definePluginEntry({
|
|
|
1918
1880
|
}),
|
|
1919
1881
|
codexPluginsManagementIo: {
|
|
1920
1882
|
readConfig: () => {
|
|
1921
|
-
const
|
|
1922
|
-
if (!plugins || typeof plugins !== "object") return Promise.resolve({});
|
|
1923
|
-
const entries = plugins.entries;
|
|
1924
|
-
if (!entries || typeof entries !== "object") return Promise.resolve({});
|
|
1925
|
-
const codexEntry = entries.codex;
|
|
1926
|
-
if (!codexEntry || typeof codexEntry !== "object") return Promise.resolve({});
|
|
1927
|
-
const config = codexEntry.config;
|
|
1928
|
-
if (!config || typeof config !== "object") return Promise.resolve({});
|
|
1929
|
-
const codexPlugins = config.codexPlugins;
|
|
1883
|
+
const codexPlugins = resolveCurrentConfig()?.plugins?.entries?.codex?.config?.codexPlugins;
|
|
1930
1884
|
if (!codexPlugins || typeof codexPlugins !== "object") return Promise.resolve({});
|
|
1931
|
-
const
|
|
1932
|
-
|
|
1885
|
+
const enabled = "enabled" in codexPlugins && codexPlugins.enabled === true;
|
|
1886
|
+
const declared = "plugins" in codexPlugins ? codexPlugins.plugins : void 0;
|
|
1933
1887
|
return Promise.resolve({
|
|
1934
|
-
enabled
|
|
1935
|
-
plugins: declared
|
|
1888
|
+
enabled,
|
|
1889
|
+
...declared && typeof declared === "object" ? { plugins: declared } : {}
|
|
1936
1890
|
});
|
|
1937
1891
|
},
|
|
1938
1892
|
mutate: async (update, assertCurrent) => {
|
|
@@ -1940,18 +1894,12 @@ var codex_default = definePluginEntry({
|
|
|
1940
1894
|
await mutateConfigFile({
|
|
1941
1895
|
writeOptions: { assertCurrent },
|
|
1942
1896
|
mutate: (draft) => {
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
const
|
|
1946
|
-
|
|
1947
|
-
const
|
|
1948
|
-
|
|
1949
|
-
const codexEntry = entries.codex;
|
|
1950
|
-
codexEntry.config = codexEntry.config ?? {};
|
|
1951
|
-
const config = codexEntry.config;
|
|
1952
|
-
config.codexPlugins = config.codexPlugins ?? {};
|
|
1953
|
-
const codexPlugins = config.codexPlugins;
|
|
1954
|
-
codexPlugins.plugins = codexPlugins.plugins ?? {};
|
|
1897
|
+
draft.plugins ??= {};
|
|
1898
|
+
draft.plugins.entries ??= {};
|
|
1899
|
+
const entry = draft.plugins.entries.codex ??= {};
|
|
1900
|
+
const config = entry.config ??= {};
|
|
1901
|
+
const codexPlugins = config.codexPlugins ??= {};
|
|
1902
|
+
codexPlugins.plugins ??= {};
|
|
1955
1903
|
update(codexPlugins);
|
|
1956
1904
|
}
|
|
1957
1905
|
});
|
|
@@ -1977,7 +1925,7 @@ var codex_default = definePluginEntry({
|
|
|
1977
1925
|
if (endedSessionKey && nextSessionKey && nextSessionKey !== endedSessionKey) return;
|
|
1978
1926
|
if (event.nextSessionId?.trim() === event.sessionId.trim()) return;
|
|
1979
1927
|
const config = resolveCurrentConfig();
|
|
1980
|
-
const [{ sessionBindingIdentity }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("./.setup/session-binding-
|
|
1928
|
+
const [{ sessionBindingIdentity }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("./.setup/session-binding-DGCYAfvD.mjs").then((n) => n.s), import("./.setup/session-retirement-qMTxkNx2.mjs")]);
|
|
1981
1929
|
await retireCodexAppServerSessionGeneration({
|
|
1982
1930
|
bindingStore,
|
|
1983
1931
|
identity: sessionBindingIdentity({
|