@openclaw/codex 2026.9.4 → 2026.9.5
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/assets/activity.svg +30 -0
- package/assets/icon.png +0 -0
- package/dist/.setup/account-usage-runtime-C2MOIvfq.mjs +75 -0
- package/dist/{apply-CvT8tW5i.js → .setup/apply-CJ0ZfmBG.mjs} +11 -11
- package/dist/.setup/async-questions-DdhOCwGi.mjs +27 -0
- package/dist/{attempt-client-cleanup-DKHzbwt5.js → .setup/attempt-client-cleanup-BpYKdTA0.mjs} +29 -14
- package/dist/{attempt-context-D44yeDII.js → .setup/attempt-context-VXVwTCfS.mjs} +5 -5
- package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +5 -0
- package/dist/{auth-binding-CWlKVccJ.js → .setup/auth-binding-DhLWa_7K.mjs} +1 -1
- package/dist/{auth-cache-key-7orQae_j.js → .setup/auth-cache-key-QirmgiCo.mjs} +3 -3
- package/dist/{auth-profile-CwzO4_RG.js → .setup/auth-profile-WqZtZfXN.mjs} +1 -1
- package/dist/.setup/binding-connection-Bm38niE8.mjs +50 -0
- package/dist/.setup/binding-connection.runtime-CnRMC0ta.mjs +48 -0
- package/dist/{bounded-turn-C_Hneydj.js → .setup/bounded-turn-BtlZcivC.mjs} +16 -11
- package/dist/{build-state-BCmg9-5p.js → .setup/build-state-Xx9ybZqa.mjs} +1 -1
- package/dist/{capabilities-8vx68WLH.js → .setup/capabilities-_vXcZGSx.mjs} +1 -1
- package/dist/{client-B57KWPQx.js → .setup/client-vXs2929Q.mjs} +332 -163
- package/dist/{command-dispatch-BpduNGVf.js → .setup/command-dispatch-naHIZwwF.mjs} +3 -3
- package/dist/{command-formatters-lxlkNZgU.js → .setup/command-formatters-CGEkdawF.mjs} +2 -2
- package/dist/{command-handlers-tiL9iWj7.js → .setup/command-handlers-BtAJEW1X.mjs} +59 -42
- package/dist/{command-rpc-CR5EOEZX.js → .setup/command-rpc-DHFpn4le.mjs} +22 -13
- package/dist/{compact-B_H3AOd7.js → .setup/compact-C3i3qlzj.mjs} +28 -43
- package/dist/{config-oIORaQ5T.js → .setup/config-CedDWjM-.mjs} +5 -4
- package/dist/{config-options-CXMq1T-C.js → .setup/config-options-BsanJ8QG.mjs} +6 -418
- package/dist/{protocol-5bh1G-H7.js → .setup/config-parsing-CcB9iPoq.mjs} +9 -51
- package/dist/{config-runtime-D0zGNIHu.js → .setup/config-runtime-CeAhl_h4.mjs} +2 -2
- package/dist/.setup/config-security-BRQ2mgW9.mjs +465 -0
- package/dist/{conversation-binding-DsB4-O7U.js → .setup/conversation-binding-DhzrpTM6.mjs} +23 -21
- package/dist/{conversation-binding-data-BiodpIzq.js → .setup/conversation-binding-data-CrcyZk6O.mjs} +1 -1
- package/dist/{conversation-control-CtUu1b3m.js → .setup/conversation-control-DN53ns41.mjs} +17 -13
- package/dist/.setup/cyber-failover-DYwbmf1o.mjs +123 -0
- package/dist/.setup/cyber-failover-notice-e9G3J9-e.mjs +17 -0
- package/dist/{dynamic-tools-CmN5RAip.js → .setup/dynamic-tools-D16lOp67.mjs} +101 -55
- package/dist/{effective-mcp-catalog-Bd73bqA8.js → .setup/effective-mcp-catalog-K6kLCN8X.mjs} +3 -3
- package/dist/{ephemeral-turn-D78_VmzO.js → .setup/ephemeral-turn-R1gA8Sn6.mjs} +4 -5
- package/dist/{event-projector-assistant-message-BmBM4qBV.js → .setup/event-projector-assistant-message-DNUR1s0A.mjs} +6 -3
- package/dist/{event-projector-items-5VhsECCO.js → .setup/event-projector-items-DyTQ_XqL.mjs} +1 -1
- package/dist/{attempt-notifications-C9XufG6l.js → .setup/event-projector-usage-C7Ntzs-f.mjs} +102 -9
- package/dist/{harness-C7rRa7bm.js → .setup/harness-rxaaoN-o.mjs} +74 -20
- package/dist/{inference-context-Dr_mzvk4.js → .setup/inference-context-fulhZuz8.mjs} +1 -1
- package/dist/{inference-proxy-HGXKUIre.js → .setup/inference-proxy-CC15HuSi.mjs} +4 -4
- package/dist/{isolated-completion-DWVb5U2J.js → .setup/isolated-completion-B6srt48J.mjs} +7 -7
- package/dist/{launch-args-RXQwn8zV.js → .setup/launch-args-DnMak49W.mjs} +22 -1
- package/dist/{managed-binary-D22rNEcR.js → .setup/managed-binary-DP6Rib3P.mjs} +2 -2
- package/dist/{managed-thread-store-D1t5jh3G.js → .setup/managed-thread-store-BMqgThVL.mjs} +48 -14
- package/dist/{model-catalog-Dq2n8f_p.js → .setup/model-catalog-DkvUuBey.mjs} +35 -10
- package/dist/{models-PCKOim-h.js → .setup/models-BDFgm_G-.mjs} +3 -3
- package/dist/.setup/native-auth-BLZGqFjw.mjs +57 -0
- package/dist/{native-subagent-history-DjtPloaU.js → .setup/native-subagent-history-YXaL6dMd.mjs} +24 -29
- package/dist/.setup/native-subagent-monitor-B1hxzIOy.mjs +5031 -0
- package/dist/{native-subagent-task-ids-BzTdT0Uw.js → .setup/native-subagent-task-ids-DsuOonKv.mjs} +32 -8
- package/dist/{node-cli-sessions-DKaOmVUh.js → .setup/node-cli-sessions-Cl8b2ZF3.mjs} +1 -1
- package/dist/{node-exec-server.runtime-Cl2vapEi.js → .setup/node-exec-server.runtime-BaViBKNz.mjs} +3 -3
- package/dist/{plan-7uG-Fp36.js → .setup/plan-xD7WKYTM.mjs} +64 -48
- package/dist/{plugin-activation-BYQculil.js → .setup/plugin-activation-r8nq5Jzp.mjs} +3 -3
- package/dist/{plugin-app-cache-key-d0eKxy7b.js → .setup/plugin-app-cache-key-BOxKP7db.mjs} +29 -25
- package/dist/{plugin-approval-roundtrip-Bz3FT8W5.js → .setup/plugin-approval-roundtrip-CjfzafAZ.mjs} +1 -1
- package/dist/{plugin-inventory-oL4Na1ZG.js → .setup/plugin-inventory-DUle8DLz.mjs} +7 -6
- package/dist/{plugin-metadata-cache-ClPJpRio.js → .setup/plugin-metadata-cache-DsS5buNa.mjs} +29 -14
- package/dist/{provider-capabilities-BvCUL69A.js → .setup/provider-capabilities-B8J4Dy-O.mjs} +2 -2
- package/dist/{provider-MQ8PVkuE.js → .setup/provider-fFh_-VR3.mjs} +4 -4
- package/dist/{rate-limits-CBMmWBr9.js → .setup/rate-limits-DOEGYRNs.mjs} +90 -46
- package/dist/{request-B7hEkBGq.js → .setup/request-BioXJLYa.mjs} +113 -33
- package/dist/.setup/run-attempt-lifecycle-B7JbY4-F.mjs +71 -0
- package/dist/{run-attempt-CvsAAGa0.js → .setup/run-attempt-rlA07pUv.mjs} +580 -498
- package/dist/{runtime-artifact-BJ0rXBZ_.js → .setup/runtime-artifact-Dy38Z5iU.mjs} +2 -2
- package/dist/{sandbox-guard-BxgyoM8M.js → .setup/sandbox-guard-BBP-RbTf.mjs} +3 -3
- package/dist/{session-binding-CI8UuilT.js → .setup/session-binding-_0W_fHRr.mjs} +46 -64
- package/dist/{session-binding-record-Bcvslnhf.js → .setup/session-binding-record-TH3xA0zj.mjs} +181 -3
- package/dist/.setup/session-binding-sidecars-CKYEcfNn.mjs +543 -0
- package/dist/{session-catalog-adoption-tcZi1IfX.js → .setup/session-catalog-adoption-CR_whkEW.mjs} +6 -6
- package/dist/{session-catalog-archive-CwKg8Xz2.js → .setup/session-catalog-archive-CwZaPacf.mjs} +6 -6
- package/dist/.setup/session-catalog-events-jMcYfQyd.mjs +250 -0
- package/dist/.setup/session-catalog-fUdWDx-U.mjs +2464 -0
- package/dist/.setup/session-catalog-index-B141u15s.mjs +1070 -0
- package/dist/.setup/session-catalog-index-order-Cc5BzlQr.mjs +48 -0
- package/dist/.setup/session-catalog-index-state-BAuDztHN.mjs +180 -0
- package/dist/{thread-history-page-D0JIp48V.js → .setup/session-catalog-native-projection-ChV3cCtm.mjs} +206 -95
- package/dist/{session-catalog-node-adoption-B1tgDW-m.js → .setup/session-catalog-node-adoption-BVRsYOSh.mjs} +3 -3
- package/dist/{session-catalog-node-continue-Ci-DXyJP.js → .setup/session-catalog-node-continue-Dowv8osw.mjs} +7 -7
- package/dist/.setup/session-catalog-projection-C1Bj9Jl-.mjs +414 -0
- package/dist/{session-cli-DNN_jhGc.js → .setup/session-cli-DIj-IE-E.mjs} +4 -4
- package/dist/{session-history-Cz-tOOYj.js → .setup/session-history-C--SrLI8.mjs} +10 -5
- package/dist/{session-history-import-DwyijFI6.js → .setup/session-history-import-JHXT5Xfi.mjs} +4 -4
- package/dist/{session-history-read-cxPUxyVV.js → .setup/session-history-read-B3ZfSUbF.mjs} +2 -2
- package/dist/{session-history.worker-BeK1YOyT.js → .setup/session-history.worker-CpNj7H_P.mjs} +5 -6
- package/dist/{session-initialization-Ct0_Hzmg.js → .setup/session-initialization-DH1z6fXn.mjs} +2 -2
- package/dist/{session-permission-policy-BBmXA8Eg.js → .setup/session-permission-policy-DhurXY0l.mjs} +2 -2
- package/dist/{session-retirement-B2YfbAAT.js → .setup/session-retirement-CU87AOg9.mjs} +6 -6
- package/dist/{settled-turn-context-Du6gdUDd.js → .setup/settled-turn-context-fmwouT5I.mjs} +2 -2
- package/dist/{settled-turn-finalizer-Dn91stmc.js → .setup/settled-turn-finalizer-CiY2bLFK.mjs} +9 -9
- package/dist/{shared-client-CscigXXL.js → .setup/shared-client-BpTtuLQ5.mjs} +286 -145
- package/dist/{side-question-BGMJQf4U.js → .setup/side-question-DSCZyoBD.mjs} +64 -47
- package/dist/{source-CElXU0Oy.js → .setup/source-Bjp4UQij.mjs} +7 -6
- package/dist/{thread-archive-guard-DfpBr-Sz.js → .setup/thread-archive-guard-jmecf6OJ.mjs} +1 -1
- package/dist/.setup/thread-history-page-BTx-4xsg.mjs +83 -0
- package/dist/{thread-lifecycle-DXl1-I6b.js → .setup/thread-lifecycle-Cik28qWn.mjs} +256 -128
- package/dist/{thread-ownership-BsDRTsyp.js → .setup/thread-ownership-skomxnIt.mjs} +4 -4
- package/dist/{thread-policy-BuEQfE0g.js → .setup/thread-policy-Cjs4B8xf.mjs} +2 -2
- package/dist/{thread-resume-DsDOZpFg.js → .setup/thread-resume-BkNpj9Pz.mjs} +8 -5
- package/dist/.setup/timeout-DZF05XrR.mjs +63 -0
- package/dist/{transcript-history-projection-v17wXgdK.js → .setup/transcript-history-projection-DHNBDhCU.mjs} +8 -3
- package/dist/{transcript-mirror-C5CKgNy6.js → .setup/transcript-mirror-D4qp_leP.mjs} +15 -6
- package/dist/{transcript-mirror-attestation-DibE0krH.js → .setup/transcript-mirror-attestation-CzM-94NC.mjs} +4 -1
- package/dist/{transport-stdio-BGjHoYLr.js → .setup/transport-stdio-Cmx94Oiy.mjs} +149 -44
- package/dist/{upstream-session-fork-BZerMte_.js → .setup/upstream-session-fork-D3UKxgVD.mjs} +27 -26
- package/dist/{usage-tCk-mg_x.js → .setup/usage-BOgBEKso.mjs} +4 -4
- package/dist/.setup/usage-limit-error-C0ow7DOc.mjs +166 -0
- package/dist/{version-omm6IPI3.js → .setup/version-CoqzXPgK.mjs} +1 -1
- package/dist/{web-search-provider.runtime-B7bGbGWq.js → .setup/web-search-provider.runtime-CTGuJt6i.mjs} +3 -3
- package/dist/api.js +6 -6
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +8 -528
- package/dist/harness.js +1 -1
- package/dist/index.js +123 -83
- package/dist/media-understanding-provider.js +3 -3
- package/dist/migration-provider-api.js +1 -1
- package/dist/native-tool-policy.js +12 -0
- package/dist/provider-discovery.js +18 -0
- package/dist/session-history-worker-runtime.js +23 -5
- package/dist/session-history.worker.js +2 -2
- package/dist/web-search-contract-api.js +1 -1
- package/openclaw.plugin.json +354 -69
- package/package.json +11 -8
- package/dist/binding-connection-D3udKbIE.js +0 -60
- package/dist/event-projector-usage-BfXmpOec.js +0 -102
- package/dist/native-subagent-history-owner-Pcp7JuVF.js +0 -34
- package/dist/native-subagent-monitor-fQ7eIXEf.js +0 -2978
- package/dist/rpc-error-ttN_QjEm.js +0 -30
- package/dist/session-catalog-ct-AH01I.js +0 -1477
- package/dist/session-catalog-home-id-CwhLdC03.js +0 -18
- package/dist/session-catalog-provenance-D-dIfRAH.js +0 -96
- package/dist/timeout-BVw8aaM1.js +0 -33
- package/dist/{auth-profile-selection-DFu9e167.js → .setup/auth-profile-selection-DFu9e167.mjs} +0 -0
- package/dist/{config-utils-DujwEnhg.js → .setup/config-utils-DujwEnhg.mjs} +0 -0
- package/dist/{context-compaction-activity-CMla5FPJ.js → .setup/context-compaction-activity-CMla5FPJ.mjs} +0 -0
- package/dist/{elicitation-input-DPoK8F7w.js → .setup/elicitation-input-DPoK8F7w.mjs} +0 -0
- package/dist/{history-rejection-B4nOXNXF.js → .setup/history-rejection-B4nOXNXF.mjs} +0 -0
- package/dist/{image-payload-sanitizer-tupAr-2o.js → .setup/image-payload-sanitizer-tupAr-2o.mjs} +0 -0
- package/dist/{incognito-session-uhrBF6wJ.js → .setup/incognito-session-uhrBF6wJ.mjs} +0 -0
- package/dist/{local-runtime-attribution-B_2mnqhb.js → .setup/local-runtime-attribution-B_2mnqhb.mjs} +0 -0
- package/dist/{native-execution-policy-umd0tgh4.js → .setup/native-execution-policy-YBMHSzC4.mjs} +1 -1
- /package/dist/{plugin-marketplace-discovery-P-Vndfqq.js → .setup/plugin-marketplace-discovery-P-Vndfqq.mjs} +0 -0
- /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
- /package/dist/{session-binding-meta-B7aEMU7g.js → .setup/session-binding-meta-B7aEMU7g.mjs} +0 -0
- /package/dist/{session-upstream-marker-D15C9NHp.js → .setup/session-upstream-marker-D15C9NHp.mjs} +0 -0
- /package/dist/{upstream-prompt-provenance-LphB8slG.js → .setup/upstream-prompt-provenance-LphB8slG.mjs} +0 -0
- /package/dist/{web-search-provider.shared-BrZmlqyR.js → .setup/web-search-provider.shared-BrZmlqyR.mjs} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
import { registerCodexCliMetadata } from "./cli-metadata.js";
|
|
2
|
-
import { n as createCodexAppServerNativeCompaction, t as createCodexAppServerAgentHarness } from "
|
|
3
|
-
import { l as
|
|
4
|
-
import { n as defineCodexBuildState } from "
|
|
2
|
+
import { n as createCodexAppServerNativeCompaction, t as createCodexAppServerAgentHarness } from "./.setup/harness-rxaaoN-o.mjs";
|
|
3
|
+
import { l as readCurrentCodexAppServerBinding, n as assertCodexBindingMayBeReplaced, p as sessionBindingIdentity, u as readCurrentCodexNativeSubagentSubmissions } from "./.setup/session-binding-record-TH3xA0zj.mjs";
|
|
4
|
+
import { n as defineCodexBuildState } from "./.setup/build-state-Xx9ybZqa.mjs";
|
|
5
5
|
import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { r as
|
|
15
|
-
import { n as
|
|
16
|
-
import { o as
|
|
17
|
-
import {
|
|
18
|
-
import { t as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
6
|
+
import codexProviderDiscovery from "./provider-discovery.js";
|
|
7
|
+
import { n as createCodexAuthProfileSelection } from "./.setup/auth-profile-selection-DFu9e167.mjs";
|
|
8
|
+
import { m as isJsonObject, t as assertCodexAppServerConnectionSecurity } from "./.setup/config-security-BRQ2mgW9.mjs";
|
|
9
|
+
import { d as readCodexPluginConfig } from "./.setup/config-parsing-CcB9iPoq.mjs";
|
|
10
|
+
import { V as CODEX_CATALOG_MAX_ROWS, W as CODEX_INTERACTIVE_THREAD_SOURCE_KINDS } from "./.setup/session-catalog-native-projection-ChV3cCtm.mjs";
|
|
11
|
+
import { r as createCodexAppServerConfig, t as codexAppServerStartOptionsKey } from "./.setup/config-options-BsanJ8QG.mjs";
|
|
12
|
+
import { o as setManagedCodexPluginRoot } from "./.setup/managed-binary-DP6Rib3P.mjs";
|
|
13
|
+
import { g as createCodexDesktopGenerationService, h as retireSharedCodexAppServerClientsBeforeDesktopGeneration, s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./.setup/auth-cache-key-QirmgiCo.mjs";
|
|
14
|
+
import { n as CODEX_MANAGED_THREAD_NAMESPACE, r as createCodexManagedThreadStore, t as CODEX_MANAGED_THREAD_MAX_ENTRIES } from "./.setup/managed-thread-store-BMqgThVL.mjs";
|
|
15
|
+
import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./.setup/session-binding-meta-B7aEMU7g.mjs";
|
|
16
|
+
import { o as createCodexAppServerProcessReaperService } from "./.setup/transport-stdio-Cmx94Oiy.mjs";
|
|
17
|
+
import { r as withCodexConversationThreadActivity, t as isIncognitoSessionKey } from "./.setup/incognito-session-uhrBF6wJ.mjs";
|
|
18
|
+
import { n as filterCodexMarketplacePlugins, o as CODEX_NATIVE_EXECUTION_AUTH_ERROR, s as canMutateCodexHost, t as discoverCodexMarketplacePlugins } from "./.setup/plugin-marketplace-discovery-P-Vndfqq.mjs";
|
|
19
|
+
import { o as formatCodexDisplayText } from "./.setup/command-formatters-CGEkdawF.mjs";
|
|
20
|
+
import { a as readCodexConversationBindingDataRecord, i as readCodexConversationBindingData, o as resolveCodexDefaultWorkspaceDir } from "./.setup/conversation-binding-data-CrcyZk6O.mjs";
|
|
21
|
+
import { t as buildCodexMigrationProvider } from "./.setup/provider-fFh_-VR3.mjs";
|
|
22
|
+
import { t as CODEX_CONTROL_METHODS } from "./.setup/capabilities-_vXcZGSx.mjs";
|
|
23
|
+
import { t as assertCodexArchiveDescendantsUnowned } from "./.setup/thread-archive-guard-jmecf6OJ.mjs";
|
|
24
|
+
import { a as listCodexCliSessionsOnNode, n as createCodexCliSessionNodeHostCommands, o as resolveCodexCliSessionForBindingOnNode, r as createCodexCliSessionNodeInvokePolicies, s as resumeCodexCliSessionOnNode } from "./.setup/node-cli-sessions-Cl8b2ZF3.mjs";
|
|
25
|
+
import { t as CODEX_CATALOG_STATE_NAMESPACE } from "./.setup/session-catalog-index-state-BAuDztHN.mjs";
|
|
26
|
+
import { i as createCodexSessionCatalogNodeHostCommands, n as createCodexSessionCatalogNodeInvokePolicies, r as createCodexSessionCatalogControl, t as codexSessionCatalogRuntime } from "./.setup/session-catalog-fUdWDx-U.mjs";
|
|
27
|
+
import { i as requestCodexAppServerJson } from "./.setup/request-BioXJLYa.mjs";
|
|
28
|
+
import { t as createCodexWebSearchProviderBase } from "./.setup/web-search-provider.shared-BrZmlqyR.mjs";
|
|
25
29
|
import { normalizePluginsConfig, resolveEffectiveEnableState, resolveLivePluginConfigObject, resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
26
30
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
27
31
|
import { asBoolean, asOptionalRecord, asSafeIntegerInRange, isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
32
|
+
import { isDeepStrictEqual } from "node:util";
|
|
28
33
|
import { resolveDefaultAgentDir } from "openclaw/plugin-sdk/agent-harness-registration";
|
|
29
34
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
30
35
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -33,6 +38,14 @@ import { jsonResult } from "openclaw/plugin-sdk/tool-results";
|
|
|
33
38
|
import { Type } from "typebox";
|
|
34
39
|
import { readStringParam } from "openclaw/plugin-sdk/param-readers";
|
|
35
40
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
41
|
+
//#region extensions/codex/src/account-usage.ts
|
|
42
|
+
function registerCodexAccountUsage(api) {
|
|
43
|
+
api.registerGatewayMethod("codex.accountUsage", async (options) => {
|
|
44
|
+
const { handleCodexAccountUsage } = await import("./.setup/account-usage-runtime-C2MOIvfq.mjs");
|
|
45
|
+
await handleCodexAccountUsage(options);
|
|
46
|
+
}, { scope: "operator.admin" });
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
36
49
|
//#region extensions/codex/src/app-server/connection-health.ts
|
|
37
50
|
const INITIAL_RECONNECT_DELAY_MS = 1e3;
|
|
38
51
|
const MAX_RECONNECT_DELAY_MS = 3e4;
|
|
@@ -40,7 +53,7 @@ function createCodexAppServerConnectionHealthService(options) {
|
|
|
40
53
|
let abortController;
|
|
41
54
|
let monitor;
|
|
42
55
|
const run = async (ctx, signal) => {
|
|
43
|
-
const { resolveCodexAppServerRuntimeOptions } = await import("
|
|
56
|
+
const { resolveCodexAppServerRuntimeOptions } = await import("./.setup/config-runtime-CeAhl_h4.mjs").then((n) => n.t);
|
|
44
57
|
let consecutiveFailures = 0;
|
|
45
58
|
while (!signal.aborted) {
|
|
46
59
|
let pluginConfig;
|
|
@@ -56,8 +69,8 @@ function createCodexAppServerConnectionHealthService(options) {
|
|
|
56
69
|
return;
|
|
57
70
|
}
|
|
58
71
|
if (runtime.start.transport !== "websocket") return;
|
|
59
|
-
const { getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("
|
|
60
|
-
const { isUnsupportedCodexAppServerVersionError } = await import("
|
|
72
|
+
const { getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./.setup/shared-client-BpTtuLQ5.mjs").then((n) => n.y);
|
|
73
|
+
const { isUnsupportedCodexAppServerVersionError } = await import("./.setup/client-vXs2929Q.mjs").then((n) => n.n);
|
|
61
74
|
if (signal.aborted) return;
|
|
62
75
|
let leasedClient;
|
|
63
76
|
try {
|
|
@@ -158,11 +171,12 @@ function waitForReconnect(delayMs, signal) {
|
|
|
158
171
|
/** Keeps lifecycle/auth loading behind mutations while sharing the canonical read codec. */
|
|
159
172
|
function createLazyCodexAppServerBindingStore(state, managedThreadState) {
|
|
160
173
|
let resolved;
|
|
161
|
-
const store = () => resolved ??= import("
|
|
174
|
+
const store = () => resolved ??= import("./.setup/session-binding-_0W_fHRr.mjs").then((n) => n.c).then(({ createCodexAppServerBindingStore }) => createCodexAppServerBindingStore(state));
|
|
162
175
|
const managedThreads = managedThreadState ? createCodexManagedThreadStore(managedThreadState) : void 0;
|
|
163
176
|
return {
|
|
164
177
|
...managedThreads ? { managedThreads } : {},
|
|
165
178
|
read: (identity) => readCurrentCodexAppServerBinding(state, identity),
|
|
179
|
+
readNativeSubagentSubmissions: (identity, owner) => readCurrentCodexNativeSubagentSubmissions(state, identity, owner),
|
|
166
180
|
hasOtherThreadOwner: async (threadId, currentIdentity) => (await store()).hasOtherThreadOwner(threadId, currentIdentity),
|
|
167
181
|
mutate: async (identity, mutation, assertCurrent) => (await store()).mutate(identity, mutation, assertCurrent),
|
|
168
182
|
prepareSessionGenerationReclaim: async (identity) => (await store()).prepareSessionGenerationReclaim(identity),
|
|
@@ -199,7 +213,7 @@ function createCodexCommand(options) {
|
|
|
199
213
|
acceptsArgs: true,
|
|
200
214
|
requireAuth: true,
|
|
201
215
|
handler: async (ctx) => {
|
|
202
|
-
const { handleCodexCommand } = await import("
|
|
216
|
+
const { handleCodexCommand } = await import("./.setup/command-dispatch-naHIZwwF.mjs");
|
|
203
217
|
return handleCodexCommand(ctx, options);
|
|
204
218
|
}
|
|
205
219
|
};
|
|
@@ -223,7 +237,7 @@ async function handleCodexConversationInboundClaim(event, ctx, options) {
|
|
|
223
237
|
return {
|
|
224
238
|
handled: true,
|
|
225
239
|
reply: (await getNodeConversationState().queue.enqueue(`${data.nodeId}:${data.sessionId}`, async () => {
|
|
226
|
-
const { resolveCodexNativeSandboxBlock } = await import("
|
|
240
|
+
const { resolveCodexNativeSandboxBlock } = await import("./.setup/sandbox-guard-BBP-RbTf.mjs").then((n) => n.r);
|
|
227
241
|
const blocked = resolveCodexNativeSandboxBlock({
|
|
228
242
|
config: options.config,
|
|
229
243
|
sessionKey,
|
|
@@ -256,7 +270,7 @@ async function handleCodexConversationInboundClaim(event, ctx, options) {
|
|
|
256
270
|
return {
|
|
257
271
|
handled: true,
|
|
258
272
|
reply: (await withCodexConversationThreadActivity(data.bindingId, async () => {
|
|
259
|
-
const { resolveCodexNativeExecutionBlock } = await import("
|
|
273
|
+
const { resolveCodexNativeExecutionBlock } = await import("./.setup/sandbox-guard-BBP-RbTf.mjs").then((n) => n.r);
|
|
260
274
|
const nativeExecutionBlock = resolveCodexNativeExecutionBlock({
|
|
261
275
|
config: options.config,
|
|
262
276
|
sessionKey,
|
|
@@ -265,7 +279,7 @@ async function handleCodexConversationInboundClaim(event, ctx, options) {
|
|
|
265
279
|
});
|
|
266
280
|
if (nativeExecutionBlock) return { reply: { text: nativeExecutionBlock } };
|
|
267
281
|
const { getSessionBindingService } = await import("openclaw/plugin-sdk/conversation-binding-runtime");
|
|
268
|
-
const { runBoundTurnWithMissingThreadRecovery } = await import("
|
|
282
|
+
const { runBoundTurnWithMissingThreadRecovery } = await import("./.setup/conversation-binding-DhzrpTM6.mjs");
|
|
269
283
|
const currentPublicBinding = getSessionBindingService().resolveByConversation({
|
|
270
284
|
channel: publicBinding.channel,
|
|
271
285
|
accountId: publicBinding.accountId,
|
|
@@ -305,7 +319,7 @@ async function handleCodexConversationBindingResolved(event, options) {
|
|
|
305
319
|
const binding = options.bindingStore.read(identity);
|
|
306
320
|
assertCodexBindingMayBeReplaced(binding, "clearing a denied conversation binding");
|
|
307
321
|
if (binding && (!data.start?.id || binding.conversationStartId === data.start.id)) await withCodexConversationThreadActivity(identity.bindingId, async () => {
|
|
308
|
-
const { retireCodexConversationThreadBinding } = await import("
|
|
322
|
+
const { retireCodexConversationThreadBinding } = await import("./.setup/thread-ownership-skomxnIt.mjs").then((n) => n.o);
|
|
309
323
|
return retireCodexConversationThreadBinding({
|
|
310
324
|
bindingStore: options.bindingStore,
|
|
311
325
|
identity,
|
|
@@ -317,6 +331,7 @@ async function handleCodexConversationBindingResolved(event, options) {
|
|
|
317
331
|
}
|
|
318
332
|
//#endregion
|
|
319
333
|
//#region extensions/codex/src/native-plugin-tool.ts
|
|
334
|
+
/** Owner-scoped, read-only discovery of plugins already known to Codex. */
|
|
320
335
|
const CodexPluginsParamsSchema = Type.Object({
|
|
321
336
|
query: Type.Optional(Type.String({ maxLength: 100 })),
|
|
322
337
|
marketplace: Type.Optional(Type.String({ pattern: "^[A-Za-z0-9_-]+$" })),
|
|
@@ -339,25 +354,36 @@ function createCodexPluginsTool(options) {
|
|
|
339
354
|
const query = typeof params.query === "string" ? params.query : "";
|
|
340
355
|
const marketplace = typeof params.marketplace === "string" ? params.marketplace.trim() : void 0;
|
|
341
356
|
const limit = typeof params.limit === "number" && Number.isInteger(params.limit) ? Math.max(1, Math.min(params.limit, 20)) : 12;
|
|
357
|
+
const { codexBindingConnectionSelection, resolveCodexBindingAppServerConnection } = await import("./.setup/binding-connection-Bm38niE8.mjs").then((n) => n.n);
|
|
342
358
|
const pluginConfig = options.getPluginConfig();
|
|
343
|
-
const
|
|
359
|
+
const config = runtimeConfig();
|
|
360
|
+
const identity = options.context.sessionId ? sessionBindingIdentity({
|
|
344
361
|
sessionId: options.context.sessionId,
|
|
345
362
|
sessionKey: options.context.sessionKey,
|
|
346
363
|
agentId: options.context.agentId,
|
|
347
|
-
config
|
|
348
|
-
})
|
|
364
|
+
config
|
|
365
|
+
}) : void 0;
|
|
366
|
+
const readBinding = () => identity ? options.bindingStore.read(identity) : void 0;
|
|
367
|
+
const binding = readBinding();
|
|
368
|
+
const selection = codexBindingConnectionSelection(binding);
|
|
369
|
+
const assertCurrent = () => {
|
|
370
|
+
if (runtimeConfig() !== config || !isDeepStrictEqual(options.getPluginConfig(), pluginConfig) || !isDeepStrictEqual(codexBindingConnectionSelection(readBinding()), selection)) throw new Error("Codex plugin discovery ownership changed; retry the request.");
|
|
371
|
+
};
|
|
349
372
|
const workspaceDir = binding?.cwd?.trim() || options.context.workspaceDir?.trim() || resolveCodexDefaultWorkspaceDir(pluginConfig);
|
|
350
|
-
const request = options.request ?? (await import("
|
|
351
|
-
const
|
|
352
|
-
const connection = resolveCodexBindingAppServerConnection({
|
|
373
|
+
const request = options.request ?? (await import("./.setup/command-rpc-DHFpn4le.mjs").then((n) => n.n)).codexControlRequest;
|
|
374
|
+
const connection = await resolveCodexBindingAppServerConnection({
|
|
353
375
|
binding,
|
|
354
|
-
pluginConfig
|
|
376
|
+
pluginConfig,
|
|
377
|
+
config,
|
|
378
|
+
agentDir: options.context.agentDir,
|
|
379
|
+
assertCurrent
|
|
355
380
|
});
|
|
356
381
|
const discovered = await discoverCodexMarketplacePlugins({
|
|
357
382
|
workspaceDir,
|
|
358
383
|
request: async (requestParams) => await request(pluginConfig, CODEX_CONTROL_METHODS.listPlugins, requestParams, {
|
|
359
384
|
agentDir: options.context.agentDir,
|
|
360
|
-
config
|
|
385
|
+
config,
|
|
386
|
+
assertCurrent,
|
|
361
387
|
sessionId: options.context.sessionId,
|
|
362
388
|
sessionKey: options.context.sessionKey,
|
|
363
389
|
startOptions: connection.appServer.start,
|
|
@@ -395,6 +421,9 @@ function projectAvailablePlugin(plugin) {
|
|
|
395
421
|
}
|
|
396
422
|
//#endregion
|
|
397
423
|
//#region extensions/codex/src/native-thread-tool.ts
|
|
424
|
+
/**
|
|
425
|
+
* Owner-only access to native Codex threads stored in the user's Codex home.
|
|
426
|
+
*/
|
|
398
427
|
const ListParamsSchema = Type.Object({
|
|
399
428
|
action: Type.Literal("list"),
|
|
400
429
|
archived: Type.Optional(Type.Boolean()),
|
|
@@ -529,41 +558,43 @@ function createCodexThreadsTool(options) {
|
|
|
529
558
|
const mayReadRawTranscripts = supervision?.enabled !== true || supervision.allowRawTranscripts === true;
|
|
530
559
|
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.");
|
|
531
560
|
const run = async (archiveAdmission) => {
|
|
532
|
-
const request = options.request ?? (await import("
|
|
561
|
+
const request = options.request ?? (await import("./.setup/command-rpc-DHFpn4le.mjs").then((n) => n.n)).codexControlRequest;
|
|
533
562
|
const { isModelSelectionLocked, ModelSelectionLockedError } = await import("openclaw/plugin-sdk/model-session-runtime");
|
|
534
|
-
const { resolveCodexBindingAppServerConnection } = await import("
|
|
535
|
-
const { resolveCodexSupervisionAppServerRuntimeOptions } = await import("
|
|
536
|
-
const requestOptions = (pluginConfig) => {
|
|
563
|
+
const { codexBindingConnectionSelection, resolveCodexBindingAppServerConnection } = await import("./.setup/binding-connection-Bm38niE8.mjs").then((n) => n.n);
|
|
564
|
+
const { resolveCodexSupervisionAppServerRuntimeOptions } = await import("./.setup/config-runtime-CeAhl_h4.mjs").then((n) => n.t);
|
|
565
|
+
const requestOptions = async (pluginConfig) => {
|
|
537
566
|
const plugin = readCodexPluginConfig(pluginConfig);
|
|
567
|
+
const base = baseRequestOptions();
|
|
538
568
|
const session = currentSession();
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
if (plugin.appServer?.homeScope === "user") {
|
|
552
|
-
const connection = resolveCodexBindingAppServerConnection({
|
|
569
|
+
const identity = session ? currentIdentity(session.sessionId) : void 0;
|
|
570
|
+
const readBinding = () => identity ? options.bindingStore.read(identity) : void 0;
|
|
571
|
+
const binding = readBinding();
|
|
572
|
+
const selection = codexBindingConnectionSelection(binding);
|
|
573
|
+
const assertCurrent = () => {
|
|
574
|
+
const current = currentSession();
|
|
575
|
+
if (runtimeConfig() !== base.config || !isDeepStrictEqual(options.getPluginConfig(), pluginConfig) || current?.sessionId !== session?.sessionId || current?.entry?.sessionId !== session?.entry?.sessionId || isModelSelectionLocked(current?.entry) !== isModelSelectionLocked(session?.entry) || !isDeepStrictEqual(codexBindingConnectionSelection(readBinding()), selection)) throw new Error("Codex native thread ownership changed; retry the request.");
|
|
576
|
+
};
|
|
577
|
+
if (binding?.connectionScope === "supervision" || plugin.appServer?.homeScope === "user") {
|
|
578
|
+
const connection = await resolveCodexBindingAppServerConnection({
|
|
553
579
|
binding,
|
|
554
|
-
pluginConfig
|
|
580
|
+
pluginConfig,
|
|
581
|
+
config: base.config,
|
|
582
|
+
agentDir: base.agentDir,
|
|
583
|
+
assertCurrent
|
|
555
584
|
});
|
|
556
585
|
return {
|
|
557
|
-
...
|
|
586
|
+
...base,
|
|
558
587
|
startOptions: connection.appServer.start,
|
|
559
|
-
authProfileId: null
|
|
588
|
+
authProfileId: connection.usesSupervisionConnection ? connection.clientAuthProfileId : null,
|
|
589
|
+
assertCurrent
|
|
560
590
|
};
|
|
561
591
|
}
|
|
562
592
|
if (plugin.supervision?.enabled !== true) throw new Error("Codex native thread access is disabled for this run.");
|
|
563
593
|
return {
|
|
564
|
-
...
|
|
594
|
+
...base,
|
|
565
595
|
startOptions: resolveCodexSupervisionAppServerRuntimeOptions({ pluginConfig }).start,
|
|
566
|
-
authProfileId: null
|
|
596
|
+
authProfileId: null,
|
|
597
|
+
assertCurrent
|
|
567
598
|
};
|
|
568
599
|
};
|
|
569
600
|
if (action === "list") {
|
|
@@ -582,7 +613,7 @@ function createCodexThreadsTool(options) {
|
|
|
582
613
|
sourceKinds: [...CODEX_INTERACTIVE_THREAD_SOURCE_KINDS],
|
|
583
614
|
...cursor ? { cursor } : {},
|
|
584
615
|
...searchTerm ? { searchTerm } : {}
|
|
585
|
-
}, requestOptions(admissionConfig));
|
|
616
|
+
}, await requestOptions(admissionConfig));
|
|
586
617
|
return jsonResult(mayReadRawTranscripts ? response : redactNativeThreadResponse(response));
|
|
587
618
|
}
|
|
588
619
|
const threadId = archiveAdmission?.threadId ?? readThreadId(params);
|
|
@@ -592,7 +623,7 @@ function createCodexThreadsTool(options) {
|
|
|
592
623
|
const response = await request(admissionConfig, CODEX_CONTROL_METHODS.readThread, {
|
|
593
624
|
threadId,
|
|
594
625
|
includeTurns
|
|
595
|
-
}, requestOptions(admissionConfig));
|
|
626
|
+
}, await requestOptions(admissionConfig));
|
|
596
627
|
return jsonResult(mayReadRawTranscripts ? response : redactNativeThreadResponse(response));
|
|
597
628
|
}
|
|
598
629
|
if (action === "rename") {
|
|
@@ -603,7 +634,7 @@ function createCodexThreadsTool(options) {
|
|
|
603
634
|
await request(admissionConfig, CODEX_CONTROL_METHODS.renameThread, {
|
|
604
635
|
threadId,
|
|
605
636
|
name
|
|
606
|
-
}, requestOptions(admissionConfig));
|
|
637
|
+
}, await requestOptions(admissionConfig));
|
|
607
638
|
return jsonResult({
|
|
608
639
|
action,
|
|
609
640
|
threadId,
|
|
@@ -611,7 +642,7 @@ function createCodexThreadsTool(options) {
|
|
|
611
642
|
});
|
|
612
643
|
}
|
|
613
644
|
if (action === "unarchive") {
|
|
614
|
-
const response = await request(admissionConfig, CODEX_CONTROL_METHODS.unarchiveThread, { threadId }, requestOptions(admissionConfig));
|
|
645
|
+
const response = await request(admissionConfig, CODEX_CONTROL_METHODS.unarchiveThread, { threadId }, await requestOptions(admissionConfig));
|
|
615
646
|
return jsonResult(mayReadRawTranscripts ? response : redactNativeThreadResponse(response));
|
|
616
647
|
}
|
|
617
648
|
const session = archiveAdmission?.session ?? currentSession();
|
|
@@ -626,20 +657,20 @@ function createCodexThreadsTool(options) {
|
|
|
626
657
|
assertThreadMayBeArchived(await request(admissionConfig, CODEX_CONTROL_METHODS.readThread, {
|
|
627
658
|
threadId,
|
|
628
659
|
includeTurns: false
|
|
629
|
-
}, requestOptions(admissionConfig)), threadId);
|
|
660
|
+
}, await requestOptions(admissionConfig)), threadId);
|
|
630
661
|
if (await options.bindingStore.hasOtherThreadOwner(threadId, identity)) throw new Error("cannot archive a native Codex thread owned by another OpenClaw session");
|
|
631
662
|
await assertCodexArchiveDescendantsUnowned({
|
|
632
663
|
bindingStore: options.bindingStore,
|
|
633
664
|
threadId,
|
|
634
|
-
listPage: async (listParams) => await request(admissionConfig, CODEX_CONTROL_METHODS.listThreads, listParams, requestOptions(admissionConfig)),
|
|
665
|
+
listPage: async (listParams) => await request(admissionConfig, CODEX_CONTROL_METHODS.listThreads, listParams, await requestOptions(admissionConfig)),
|
|
635
666
|
assertDescendantIdle: async (descendantThreadId) => {
|
|
636
667
|
assertThreadMayBeArchived(await request(admissionConfig, CODEX_CONTROL_METHODS.readThread, {
|
|
637
668
|
threadId: descendantThreadId,
|
|
638
669
|
includeTurns: false
|
|
639
|
-
}, requestOptions(admissionConfig)), descendantThreadId);
|
|
670
|
+
}, await requestOptions(admissionConfig)), descendantThreadId);
|
|
640
671
|
}
|
|
641
672
|
});
|
|
642
|
-
await request(admissionConfig, CODEX_CONTROL_METHODS.archiveThread, { threadId }, requestOptions(admissionConfig));
|
|
673
|
+
await request(admissionConfig, CODEX_CONTROL_METHODS.archiveThread, { threadId }, await requestOptions(admissionConfig));
|
|
643
674
|
if (archivedBinding?.threadId === threadId) await options.bindingStore.mutate(identity, {
|
|
644
675
|
kind: "clear",
|
|
645
676
|
threadId
|
|
@@ -660,13 +691,13 @@ function createCodexThreadsTool(options) {
|
|
|
660
691
|
assertThreadMayBeForked(await request(admissionConfig, CODEX_CONTROL_METHODS.readThread, {
|
|
661
692
|
threadId,
|
|
662
693
|
includeTurns: false
|
|
663
|
-
}, requestOptions(admissionConfig)), threadId);
|
|
694
|
+
}, await requestOptions(admissionConfig)), threadId);
|
|
664
695
|
}
|
|
665
696
|
const response = await request(admissionConfig, CODEX_CONTROL_METHODS.forkThread, {
|
|
666
697
|
threadId,
|
|
667
698
|
threadSource: "user",
|
|
668
699
|
excludeTurns: true
|
|
669
|
-
}, requestOptions(admissionConfig));
|
|
700
|
+
}, await requestOptions(admissionConfig));
|
|
670
701
|
if (!isJsonObject(response) || !isJsonObject(response.thread)) throw new Error("Codex app-server returned an invalid thread/fork response");
|
|
671
702
|
const forkThreadId = typeof response.thread.id === "string" && response.thread.id.trim() ? response.thread.id : void 0;
|
|
672
703
|
if (!forkThreadId) throw new Error("Codex app-server thread/fork response did not include a thread id");
|
|
@@ -754,7 +785,7 @@ function createCodexNodeExecServerCommand() {
|
|
|
754
785
|
try {
|
|
755
786
|
if (!context.prepareExecAuthorization) throw new Error("Codex node execution requires node-local exec policy support; update the node.");
|
|
756
787
|
const assertExecAuthorized = context.prepareExecAuthorization(request.authorization);
|
|
757
|
-
const { runCodexNodeExecServer } = await import("
|
|
788
|
+
const { runCodexNodeExecServer } = await import("./.setup/node-exec-server.runtime-BaViBKNz.mjs");
|
|
758
789
|
return await runCodexNodeExecServer({
|
|
759
790
|
workspaceDir: workspace.workspaceDir,
|
|
760
791
|
homeDir: workspace.homeDir,
|
|
@@ -1638,7 +1669,7 @@ function createCodexSupervisionTools(options) {
|
|
|
1638
1669
|
}
|
|
1639
1670
|
//#endregion
|
|
1640
1671
|
//#region extensions/codex/src/web-search-provider.ts
|
|
1641
|
-
const loadCodexWebSearchRuntime = createLazyRuntimeModule(() => import("
|
|
1672
|
+
const loadCodexWebSearchRuntime = createLazyRuntimeModule(() => import("./.setup/web-search-provider.runtime-CTGuJt6i.mjs"));
|
|
1642
1673
|
const CodexWebSearchSchema = {
|
|
1643
1674
|
type: "object",
|
|
1644
1675
|
properties: { query: {
|
|
@@ -1682,7 +1713,9 @@ var codex_default = definePluginEntry({
|
|
|
1682
1713
|
description: "Codex app-server harness and native session supervision.",
|
|
1683
1714
|
reload: { noopPrefixes: ["plugins.entries.codex.config.codexPlugins"] },
|
|
1684
1715
|
register(api) {
|
|
1716
|
+
registerCodexAccountUsage(api);
|
|
1685
1717
|
setManagedCodexPluginRoot(api.rootDir);
|
|
1718
|
+
api.registerProvider(codexProviderDiscovery);
|
|
1686
1719
|
const resolveCurrentConfig = () => api.runtime.config?.current ? api.runtime.config.current() : void 0;
|
|
1687
1720
|
const resolvePluginConfig = (resolveConfig) => {
|
|
1688
1721
|
const liveConfig = resolveConfig();
|
|
@@ -1722,7 +1755,7 @@ var codex_default = definePluginEntry({
|
|
|
1722
1755
|
return store.update?.bind(store);
|
|
1723
1756
|
}
|
|
1724
1757
|
};
|
|
1725
|
-
const openManagedThreadStateStore = () => managedThreadStateStore ??= api.runtime.state.
|
|
1758
|
+
const openManagedThreadStateStore = () => managedThreadStateStore ??= api.runtime.state.openKeyedStore({
|
|
1726
1759
|
namespace: CODEX_MANAGED_THREAD_NAMESPACE,
|
|
1727
1760
|
maxEntries: CODEX_MANAGED_THREAD_MAX_ENTRIES,
|
|
1728
1761
|
overflowPolicy: "evict-oldest"
|
|
@@ -1739,9 +1772,20 @@ var codex_default = definePluginEntry({
|
|
|
1739
1772
|
managedThreads: bindingStore.managedThreads,
|
|
1740
1773
|
config: api.config,
|
|
1741
1774
|
getPluginConfig: resolveCurrentPluginConfig,
|
|
1742
|
-
getRuntimeConfig: resolveCurrentConfig
|
|
1775
|
+
getRuntimeConfig: resolveCurrentConfig,
|
|
1776
|
+
openResidentState: (homeId) => api.runtime.state.openKeyedStore({
|
|
1777
|
+
namespace: `${CODEX_CATALOG_STATE_NAMESPACE}.${homeId.replaceAll(":", "-")}`,
|
|
1778
|
+
maxEntries: CODEX_CATALOG_MAX_ROWS + 1,
|
|
1779
|
+
overflowPolicy: "reject-new"
|
|
1780
|
+
})
|
|
1743
1781
|
});
|
|
1744
|
-
|
|
1782
|
+
const sessionCatalogEnabled = readCodexPluginConfig(resolveCurrentPluginConfig()).sessionCatalog?.enabled !== false;
|
|
1783
|
+
api.registerService({
|
|
1784
|
+
id: "codex-session-catalog",
|
|
1785
|
+
start: () => sessionCatalogEnabled ? sessionCatalogControlFactory.start() : void 0,
|
|
1786
|
+
stop: () => sessionCatalogControlFactory.stop()
|
|
1787
|
+
});
|
|
1788
|
+
if (sessionCatalogEnabled) {
|
|
1745
1789
|
codexSessionCatalogRuntime.register({
|
|
1746
1790
|
api,
|
|
1747
1791
|
resolveRuntimeOptions: resolveCodexSupervisionAppServerRuntimeOptions,
|
|
@@ -1750,11 +1794,7 @@ var codex_default = definePluginEntry({
|
|
|
1750
1794
|
getPluginConfig: resolveCurrentPluginConfig,
|
|
1751
1795
|
getRuntimeConfig: resolveCurrentConfig
|
|
1752
1796
|
});
|
|
1753
|
-
for (const command of createCodexSessionCatalogNodeHostCommands(sessionCatalogControlFactory,
|
|
1754
|
-
getPluginConfig: resolveCurrentPluginConfig,
|
|
1755
|
-
getRuntimeConfig: () => resolveCurrentConfig() ?? api.config,
|
|
1756
|
-
resolveRuntimeOptions: resolveCodexSupervisionAppServerRuntimeOptions
|
|
1757
|
-
}, bindingStore)) api.registerNodeHostCommand(command);
|
|
1797
|
+
for (const command of createCodexSessionCatalogNodeHostCommands(sessionCatalogControlFactory, bindingStore)) api.registerNodeHostCommand(command);
|
|
1758
1798
|
}
|
|
1759
1799
|
for (const policy of createCodexSessionCatalogNodeInvokePolicies()) api.registerNodeInvokePolicy(policy);
|
|
1760
1800
|
if (readCodexPluginConfig(resolveCurrentPluginConfig()).supervision?.enabled === true) {
|
|
@@ -1886,7 +1926,7 @@ var codex_default = definePluginEntry({
|
|
|
1886
1926
|
if (endedSessionKey && nextSessionKey && nextSessionKey !== endedSessionKey) return;
|
|
1887
1927
|
if (event.nextSessionId?.trim() === event.sessionId.trim()) return;
|
|
1888
1928
|
const config = resolveCurrentConfig();
|
|
1889
|
-
const [{ sessionBindingIdentity }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("
|
|
1929
|
+
const [{ sessionBindingIdentity }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("./.setup/session-binding-_0W_fHRr.mjs").then((n) => n.c), import("./.setup/session-retirement-CU87AOg9.mjs")]);
|
|
1890
1930
|
await retireCodexAppServerSessionGeneration({
|
|
1891
1931
|
bindingStore,
|
|
1892
1932
|
identity: sessionBindingIdentity({
|
|
@@ -6,7 +6,7 @@ import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime
|
|
|
6
6
|
* structured extraction turns.
|
|
7
7
|
*/
|
|
8
8
|
const CODEX_MEDIA_PROVIDER_ID = "codex";
|
|
9
|
-
const DEFAULT_CODEX_IMAGE_MODEL = "gpt-
|
|
9
|
+
const DEFAULT_CODEX_IMAGE_MODEL = "gpt-6-astra";
|
|
10
10
|
const DEFAULT_CODEX_IMAGE_PROMPT = "Describe the image.";
|
|
11
11
|
/**
|
|
12
12
|
* Builds the media-understanding provider that delegates image tasks to an
|
|
@@ -43,7 +43,7 @@ async function describeCodexImages(req, options) {
|
|
|
43
43
|
const model = req.model.trim();
|
|
44
44
|
if (!model) throw new Error("Codex image understanding requires model id.");
|
|
45
45
|
req.signal?.throwIfAborted();
|
|
46
|
-
const { runBoundedCodexAppServerTurn } = await import("
|
|
46
|
+
const { runBoundedCodexAppServerTurn } = await import("./.setup/bounded-turn-BtlZcivC.mjs");
|
|
47
47
|
req.signal?.throwIfAborted();
|
|
48
48
|
const { text } = await runBoundedCodexAppServerTurn({
|
|
49
49
|
config: req.cfg,
|
|
@@ -83,7 +83,7 @@ async function extractCodexStructured(req, options) {
|
|
|
83
83
|
if (req.input.length === 0) throw new Error("Codex structured extraction requires at least one input.");
|
|
84
84
|
if (!req.input.some((entry) => entry.type === "image")) throw new Error("Codex structured extraction requires at least one image input.");
|
|
85
85
|
req.signal?.throwIfAborted();
|
|
86
|
-
const { runBoundedCodexAppServerTurn } = await import("
|
|
86
|
+
const { runBoundedCodexAppServerTurn } = await import("./.setup/bounded-turn-BtlZcivC.mjs");
|
|
87
87
|
req.signal?.throwIfAborted();
|
|
88
88
|
const { text } = await runBoundedCodexAppServerTurn({
|
|
89
89
|
config: req.cfg,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as buildCodexMigrationProvider } from "
|
|
1
|
+
import { t as buildCodexMigrationProvider } from "./.setup/provider-fFh_-VR3.mjs";
|
|
2
2
|
export { buildCodexMigrationProvider as buildMigrationProvider };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region extensions/codex/native-tool-policy.ts
|
|
2
|
+
/** Capabilities exposed together by Codex native code mode. */
|
|
3
|
+
const CODEX_NATIVE_TOOL_REQUIREMENTS = [
|
|
4
|
+
"exec",
|
|
5
|
+
"process",
|
|
6
|
+
"read",
|
|
7
|
+
"write",
|
|
8
|
+
"edit",
|
|
9
|
+
"apply_patch"
|
|
10
|
+
];
|
|
11
|
+
//#endregion
|
|
12
|
+
export { CODEX_NATIVE_TOOL_REQUIREMENTS };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region extensions/codex/provider-discovery.ts
|
|
2
|
+
const codexProviderDiscovery = {
|
|
3
|
+
id: "codex",
|
|
4
|
+
label: "Codex",
|
|
5
|
+
auth: [],
|
|
6
|
+
prepareSyntheticAuth: async ({ config, provider, env, signal, pluginRoot }) => {
|
|
7
|
+
if (provider !== "codex") return;
|
|
8
|
+
const { probeCodexNativeAuth } = await import("./.setup/native-auth-BLZGqFjw.mjs");
|
|
9
|
+
return await probeCodexNativeAuth({
|
|
10
|
+
config,
|
|
11
|
+
env,
|
|
12
|
+
signal,
|
|
13
|
+
pluginRoot
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { codexProviderDiscovery as default };
|
|
@@ -1,12 +1,30 @@
|
|
|
1
|
-
import { n as codexHistoryRejectionReason } from "
|
|
2
|
-
import {
|
|
3
|
-
import { n as resolveCodexHistoryTarget } from "
|
|
4
|
-
import { WorkerTaskPool } from "openclaw/plugin-sdk/process-runtime";
|
|
1
|
+
import { n as codexHistoryRejectionReason } from "./.setup/history-rejection-B4nOXNXF.mjs";
|
|
2
|
+
import { t as runCodexHistoryWorkerInput } from "./.setup/session-history.worker-CpNj7H_P.mjs";
|
|
3
|
+
import { n as resolveCodexHistoryTarget } from "./.setup/session-history-C--SrLI8.mjs";
|
|
4
|
+
import { WorkerTaskPool, resolveRuntimeWorkerArgv, resolveRuntimeWorkerUrl } from "openclaw/plugin-sdk/process-runtime";
|
|
5
5
|
import { isIncognitoSessionKey } from "openclaw/plugin-sdk/session-key-runtime";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
6
7
|
import { SessionTranscriptReadFenceError, captureCodexSessionTranscriptReadAdmission, validateCodexSessionTranscriptContextVersion, validateCodexSessionTranscriptReadAdmission } from "openclaw/plugin-sdk/codex-session-transcript-runtime";
|
|
7
8
|
//#region extensions/codex/session-history-worker-runtime.ts
|
|
9
|
+
const codexHistoryWorkerEntrypoint = {
|
|
10
|
+
currentModuleUrl: import.meta.url,
|
|
11
|
+
sourceWorkerName: "session-history.worker",
|
|
12
|
+
distWorkerPath: "extensions/codex/session-history.worker.js",
|
|
13
|
+
package: {
|
|
14
|
+
name: "@openclaw/codex",
|
|
15
|
+
distWorkerPath: "session-history.worker.js"
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function resolveCodexHistoryWorkerUrl() {
|
|
19
|
+
const sourceUrl = resolveRuntimeWorkerUrl(codexHistoryWorkerEntrypoint);
|
|
20
|
+
if (!(/\.[cm]?ts$/u.test(sourceUrl.pathname) && (typeof process.versions.bun === "string" || resolveRuntimeWorkerArgv(sourceUrl).length === 1))) return sourceUrl;
|
|
21
|
+
return resolveRuntimeWorkerUrl({
|
|
22
|
+
...codexHistoryWorkerEntrypoint,
|
|
23
|
+
root: fileURLToPath(new URL("../..", import.meta.url))
|
|
24
|
+
});
|
|
25
|
+
}
|
|
8
26
|
const historyReads = new WorkerTaskPool({
|
|
9
|
-
workerUrl:
|
|
27
|
+
workerUrl: resolveCodexHistoryWorkerUrl(),
|
|
10
28
|
maxWorkers: 1
|
|
11
29
|
});
|
|
12
30
|
async function readHistory(target, operation, admission, signal) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { t as runCodexHistoryWorkerInput } from "./.setup/session-history.worker-CpNj7H_P.mjs";
|
|
2
|
+
export { runCodexHistoryWorkerInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createCodexWebSearchProviderBase } from "
|
|
1
|
+
import { t as createCodexWebSearchProviderBase } from "./.setup/web-search-provider.shared-BrZmlqyR.mjs";
|
|
2
2
|
//#region extensions/codex/web-search-contract-api.ts
|
|
3
3
|
function createCodexWebSearchProvider() {
|
|
4
4
|
return {
|