@openclaw/codex 2026.9.3 → 2026.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +26 -18
- package/dist/{apply-B6el6hdO.js → apply-CvT8tW5i.js} +11 -12
- package/dist/{attempt-client-cleanup-D6cR54TV.js → attempt-client-cleanup-DKHzbwt5.js} +8 -204
- package/dist/{attempt-context-AO4DSjE0.js → attempt-context-D44yeDII.js} +3 -3
- package/dist/{attempt-notifications--H8zXR5-.js → attempt-notifications-C9XufG6l.js} +1 -1
- package/dist/{auth-binding-Co2Vfcf_.js → auth-binding-CWlKVccJ.js} +1 -1
- package/dist/{auth-cache-key-Kq6oerr6.js → auth-cache-key-7orQae_j.js} +2 -2
- package/dist/{binding-connection-QqgcPCgk.js → binding-connection-D3udKbIE.js} +3 -3
- package/dist/{bounded-turn-lRpmZHFv.js → bounded-turn-C_Hneydj.js} +12 -12
- package/dist/{build-state-6RL6qohz.js → build-state-BCmg9-5p.js} +1 -1
- package/dist/{capabilities-BeqLPbtM.js → capabilities-8vx68WLH.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-BEKu4yDx.js → client-B57KWPQx.js} +27 -5
- package/dist/{command-dispatch-CisT9Jqq.js → command-dispatch-BpduNGVf.js} +3 -3
- package/dist/{command-formatters-DeTfrapr.js → command-formatters-lxlkNZgU.js} +4 -3
- package/dist/{command-handlers-BfIsJEuA.js → command-handlers-tiL9iWj7.js} +783 -140
- package/dist/{command-rpc-BMqRQOFX.js → command-rpc-CR5EOEZX.js} +26 -19
- package/dist/{compact-CGJZ2rlb.js → compact-B_H3AOd7.js} +14 -14
- package/dist/{config-JDfTI4VI.js → config-oIORaQ5T.js} +4 -4
- package/dist/{config-options-jnIFvwxD.js → config-options-CXMq1T-C.js} +5 -5
- package/dist/{config-runtime-BWf6JLWG.js → config-runtime-D0zGNIHu.js} +1 -1
- package/dist/{config-utils-C57JiJrU.js → config-utils-DujwEnhg.js} +2 -4
- package/dist/{conversation-binding-CxOlHiix.js → conversation-binding-DsB4-O7U.js} +53 -42
- package/dist/{conversation-control-CUCrSIQI.js → conversation-control-CtUu1b3m.js} +8 -8
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{dynamic-tools-D-JBoaLt.js → dynamic-tools-CmN5RAip.js} +76 -15
- package/dist/{effective-mcp-catalog-J_5Ep5Um.js → effective-mcp-catalog-Bd73bqA8.js} +3 -3
- package/dist/{ephemeral-turn-DSwzP8YY.js → ephemeral-turn-D78_VmzO.js} +5 -5
- package/dist/event-projector-items-5VhsECCO.js +200 -0
- package/dist/{event-projector-usage-CIyrYYid.js → event-projector-usage-BfXmpOec.js} +1 -1
- package/dist/{harness-FR6eQgyO.js → harness-C7rRa7bm.js} +33 -16
- package/dist/harness.js +1 -1
- package/dist/index.js +39 -84
- package/dist/inference-context-Dr_mzvk4.js +94 -0
- package/dist/inference-proxy-HGXKUIre.js +311 -0
- package/dist/{isolated-completion-DHBefrzg.js → isolated-completion-DWVb5U2J.js} +6 -6
- package/dist/{managed-binary-DrjjRRUD.js → managed-binary-D22rNEcR.js} +10 -1
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +2 -0
- package/dist/{model-catalog-B_6M04Wo.js → model-catalog-Dq2n8f_p.js} +6 -6
- package/dist/{models-P9k2qAof.js → models-PCKOim-h.js} +3 -3
- package/dist/native-subagent-history-DjtPloaU.js +140 -0
- package/dist/native-subagent-history-owner-Pcp7JuVF.js +34 -0
- package/dist/{native-subagent-monitor-BbCUKRwC.js → native-subagent-monitor-fQ7eIXEf.js} +52 -424
- package/dist/native-subagent-task-ids-BzTdT0Uw.js +387 -0
- package/dist/{node-cli-sessions-rj0ysJwM.js → node-cli-sessions-DKaOmVUh.js} +1 -1
- package/dist/{node-exec-server.runtime-BY_ctYnT.js → node-exec-server.runtime-Cl2vapEi.js} +3 -3
- package/dist/{plan-BMJdMOEF.js → plan-7uG-Fp36.js} +288 -52
- package/dist/{plugin-activation-BQK-f5sV.js → plugin-activation-BYQculil.js} +24 -19
- package/dist/{plugin-app-cache-key-CdSQzWyX.js → plugin-app-cache-key-d0eKxy7b.js} +1 -1
- package/dist/{plugin-approval-roundtrip-DeW95wB5.js → plugin-approval-roundtrip-Bz3FT8W5.js} +1 -1
- package/dist/{plugin-inventory-CoRCzWW4.js → plugin-inventory-oL4Na1ZG.js} +7 -4
- package/dist/{plugin-marketplace-discovery-3akBizzF.js → plugin-marketplace-discovery-P-Vndfqq.js} +18 -15
- package/dist/{plugin-metadata-cache-DgNfRAGA.js → plugin-metadata-cache-ClPJpRio.js} +13 -9
- package/dist/{protocol-CAAcVIKF.js → protocol-5bh1G-H7.js} +1 -1
- package/dist/provider-MQ8PVkuE.js +50 -0
- package/dist/{provider-capabilities-W4tfK5Y5.js → provider-capabilities-BvCUL69A.js} +2 -2
- package/dist/{rate-limits-Bqnx1N4z.js → rate-limits-CBMmWBr9.js} +1 -1
- package/dist/{request-CGvGOpeR.js → request-B7hEkBGq.js} +72 -58
- package/dist/rpc-error-ttN_QjEm.js +30 -0
- package/dist/{run-attempt-DwKds3DN.js → run-attempt-CvsAAGa0.js} +108 -37
- package/dist/{runtime-artifact-T-NwqeSH.js → runtime-artifact-BJ0rXBZ_.js} +1 -1
- package/dist/{sandbox-guard-BcT66fWy.js → sandbox-guard-BxgyoM8M.js} +2 -1
- package/dist/{session-binding-CKSepwIC.js → session-binding-CI8UuilT.js} +3 -3
- package/dist/{session-binding-record-CaZjYwNS.js → session-binding-record-Bcvslnhf.js} +1 -1
- package/dist/{session-catalog-adoption-BKLtSrwi.js → session-catalog-adoption-tcZi1IfX.js} +5 -5
- package/dist/{session-catalog-archive-D0i2pGj2.js → session-catalog-archive-CwKg8Xz2.js} +6 -6
- package/dist/{session-catalog-HaDcp7Sv.js → session-catalog-ct-AH01I.js} +31 -87
- package/dist/session-catalog-home-id-CwhLdC03.js +18 -0
- package/dist/{session-catalog-node-adoption-BUuDYY8R.js → session-catalog-node-adoption-B1tgDW-m.js} +2 -2
- package/dist/{session-catalog-node-continue-CBtc4wkI.js → session-catalog-node-continue-Ci-DXyJP.js} +4 -4
- package/dist/{session-catalog-provenance-DkJHo735.js → session-catalog-provenance-D-dIfRAH.js} +2 -30
- package/dist/{session-cli-CbgaHh0f.js → session-cli-DNN_jhGc.js} +2 -2
- package/dist/{session-history-import-DFN7sWRU.js → session-history-import-DwyijFI6.js} +4 -4
- package/dist/session-history-worker-runtime.js +1 -1
- package/dist/{session-history.worker-CNEvGaU5.js → session-history.worker-BeK1YOyT.js} +187 -83
- package/dist/session-history.worker.js +1 -1
- package/dist/{session-initialization-Jo86C60I.js → session-initialization-Ct0_Hzmg.js} +2 -2
- package/dist/{session-permission-policy-B22InTp_.js → session-permission-policy-BBmXA8Eg.js} +2 -2
- package/dist/{session-retirement-BSNG_mhf.js → session-retirement-B2YfbAAT.js} +5 -5
- package/dist/{settled-turn-finalizer-BuLUrZl2.js → settled-turn-finalizer-Dn91stmc.js} +5 -5
- package/dist/{shared-client-CVhez2Uo.js → shared-client-CscigXXL.js} +228 -30
- package/dist/{side-question-DLbr2vUU.js → side-question-BGMJQf4U.js} +18 -18
- package/dist/{source-Da-h6f7e.js → source-CElXU0Oy.js} +12 -12
- package/dist/{thread-archive-guard-D1bP04Tf.js → thread-archive-guard-DfpBr-Sz.js} +1 -1
- package/dist/{session-catalog-parsing-CdD3JhdM.js → thread-history-page-D0JIp48V.js} +83 -2
- package/dist/{thread-lifecycle-D1pzRwHB.js → thread-lifecycle-DXl1-I6b.js} +96 -44
- package/dist/{thread-ownership-D6oASVRu.js → thread-ownership-BsDRTsyp.js} +2 -2
- package/dist/{thread-policy-D8kI7yAO.js → thread-policy-BuEQfE0g.js} +3 -3
- package/dist/{thread-resume-T5cveyxA.js → thread-resume-DsDOZpFg.js} +5 -5
- package/dist/{session-catalog-home-id-D7-aLiNt.js → transcript-history-projection-v17wXgdK.js} +66 -18
- package/dist/{transcript-mirror-t5TOccct.js → transcript-mirror-C5CKgNy6.js} +1 -1
- package/dist/{upstream-session-fork-De-sLJ2r.js → upstream-session-fork-BZerMte_.js} +20 -20
- package/dist/{usage-CPPTmBvZ.js → usage-tCk-mg_x.js} +4 -4
- package/dist/{web-search-provider.runtime-CSVgQL0w.js → web-search-provider.runtime-B7bGbGWq.js} +3 -3
- package/openclaw.plugin.json +1 -0
- package/package.json +4 -4
|
@@ -1,42 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { c as
|
|
1
|
+
import { s as resolveRecoverableCodexPluginConfigKeys } from "./plugin-inventory-oL4Na1ZG.js";
|
|
2
|
+
import { l as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced } from "./session-binding-record-Bcvslnhf.js";
|
|
3
|
+
import { n as defineCodexBuildState } from "./build-state-BCmg9-5p.js";
|
|
4
|
+
import { b as readCodexRequirementsToml, c as hasCodexMcpToolApprovalOverrides, d as withMcpElicitationsApprovalPolicy, i as resolveCodexAppServerHomeScope, m as resolveCodexModelBackedReviewerPolicyContext, o as resolveCodexComputerUseConfig, u as shouldAutoApproveCodexAppServerApprovals } from "./config-options-CXMq1T-C.js";
|
|
5
|
+
import { S as resolveCodexPluginsPolicy, a as flattenCodexDynamicToolFunctions, b as isCodexSandboxExecServerEnabled, o as isJsonObject, s as resolveCodexAppServerHomeDir, v as isCodexPairedNodeRemoteExecPlacementSandbox, x as readCodexPluginConfig, y as isCodexRemoteExecPlacementSandbox } from "./protocol-5bh1G-H7.js";
|
|
6
|
+
import { A as isMatchingDynamicToolTerminalDiagnostic, D as handleDynamicToolCallWithTimeout, E as createCodexElicitationResponse, F as toCodexDynamicToolProgressResponse, I as toCodexDynamicToolProtocolResponse, L as resolveCodexToolAbortTerminalReason, M as resolveTerminalDynamicToolBatchAction, N as shouldBlockTerminalReleaseForNonTerminalDynamicToolResult, O as hasPendingDynamicToolTerminalDiagnostic, P as shouldReleaseTurnAfterTerminalDynamicTool, S as readCodexDynamicToolCallParams, T as readCodexTurnCompletedNotification, a as isCodexAppServerBrokenPipeError, c as isCodexAppServerIndeterminateTransportError, d as isCodexAppServerRequestTimeoutError, i as isCodexAppServerApprovalRequest, j as resolveDynamicToolCallTimeoutMs, k as isDynamicToolTerminalDiagnosticEvent, l as isCodexAppServerOverloadError, o as isCodexAppServerConnectionClosedError, p as resolveCodexAppServerClientInstanceId, r as getCodexAppServerClientInstanceId, s as isCodexAppServerIndeterminateRequestCancellationError, w as readCodexTurn, x as assertCodexTurnStartResponse } from "./client-B57KWPQx.js";
|
|
7
|
+
import { c as resolveCodexAppServerPreparedApiKeyCacheKey, m as retireSharedCodexAppServerClientIfCurrent, s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-7orQae_j.js";
|
|
7
8
|
import { t as isIncognitoSessionKey } from "./incognito-session-uhrBF6wJ.js";
|
|
8
|
-
import { a as shouldRefreshCodexRateLimitsForUsageLimitMessage, i as resolveCodexUsageLimitResetAtMs, n as formatCodexUsageLimitErrorMessage } from "./rate-limits-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as CODEX_CONTROL_METHODS } from "./capabilities-
|
|
9
|
+
import { a as shouldRefreshCodexRateLimitsForUsageLimitMessage, i as resolveCodexUsageLimitResetAtMs, n as formatCodexUsageLimitErrorMessage } from "./rate-limits-CBMmWBr9.js";
|
|
10
|
+
import { o as formatCodexDisplayText } from "./command-formatters-lxlkNZgU.js";
|
|
11
|
+
import { t as CodexAppServerRpcError } from "./rpc-error-ttN_QjEm.js";
|
|
12
|
+
import { t as CODEX_CONTROL_METHODS } from "./capabilities-8vx68WLH.js";
|
|
13
|
+
import { D as splitPlanText, E as readNullableString, S as readItemString, T as readNonNegativeInteger, d as matchesCodexSnapshotTurn, f as shouldClearTerminalPresentationForNativeItem, g as extractRawAssistantText, v as readCodexErrorNotificationMessage, x as readItem, y as readCodexProviderRefusal } from "./event-projector-items-5VhsECCO.js";
|
|
12
14
|
import { r as readMirrorIdentity, t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-LphB8slG.js";
|
|
13
|
-
import { n as buildCodexAppServerRuntimeFingerprint, r as buildCodexPluginAppCacheKey, s as defaultCodexAppInventoryCache } from "./plugin-app-cache-key-
|
|
15
|
+
import { n as buildCodexAppServerRuntimeFingerprint, r as buildCodexPluginAppCacheKey, s as defaultCodexAppInventoryCache } from "./plugin-app-cache-key-d0eKxy7b.js";
|
|
14
16
|
import { t as withAbortableTimeout } from "./timeout-BVw8aaM1.js";
|
|
15
|
-
import { n as resolveOpenClawExecPolicyForCodexAppServer, t as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-
|
|
17
|
+
import { n as resolveOpenClawExecPolicyForCodexAppServer, t as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-oIORaQ5T.js";
|
|
16
18
|
import { o as hasCodexMirrorOrigin, t as applyCodexTranscriptTaint } from "./transcript-mirror-attestation-DibE0krH.js";
|
|
17
|
-
import {
|
|
18
|
-
import { i as resolveCodexBindingAppServerConnection, t as assertCodexSessionRuntimeOwnership } from "./binding-connection-
|
|
19
|
+
import { r as prepareCodexAppServerAuthBinding } from "./auth-binding-CWlKVccJ.js";
|
|
20
|
+
import { i as resolveCodexBindingAppServerConnection, t as assertCodexSessionRuntimeOwnership } from "./binding-connection-D3udKbIE.js";
|
|
19
21
|
import { i as resolveCodexAppServerAuthProfileIdForAgent, r as resolveCodexAppServerAuthProfileId } from "./auth-profile-CwzO4_RG.js";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { a as isRawFunctionToolOutputCompletionNotification, c as readNotificationItemId, i as isPendingOpenClawDynamicToolCompletionNotification, l as readRawResponseToolCallId, o as isTerminalTurnStatus, r as isCodexTurnAbortMarkerNotification, s as readCodexNotificationItem, t as codexExecutionToolName, u as updateActiveTurnItemIds } from "./attempt-notifications
|
|
23
|
-
import { t as CodexUsageProjection } from "./event-projector-usage-
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { i as mirrorPromptAtTurnStartBestEffort, n as createCodexAppServerUserMessagePersistenceNotifier, o as buildCodexUserPromptMessage, s as promptSnapshot, t as codexTranscriptMirrorRuntime } from "./transcript-mirror-t5TOccct.js";
|
|
22
|
+
import { A as CodexAppServerStartupError, F as resolveCodexStartupTimeoutMs, G as protectCodexAppServerLiveThread, I as withCodexStartupTimeout, M as TURN_TERMINAL_SETTLEMENT_TIMEOUT_MS, N as isCodexAppServerStartupError, O as getCodexInferenceThread, Q as rememberCodexRateLimitsRead, W as prepareCodexWorkspaceReferences, X as readCodexRateLimitsRevision, Z as readRecentCodexRateLimits, a as clearSharedCodexAppServerClientIfCurrentAndUnclaimed, c as getLeasedSharedCodexAppServerClient, et as resolveCodexAppServerAuthAccountCacheKey, f as readCodexAppServerClientDesktopGenerationFingerprint, h as releaseLeasedSharedCodexAppServerClient, i as clearSharedCodexAppServerClientIfCurrent, j as TURN_FINALIZE_DRAIN_ABORT_GRACE_MS, l as getSharedCodexAppServerClient, s as createIsolatedCodexAppServerClient, tt as resolveCodexAppServerPreparedAuthHandoff, u as isCodexAppServerStartSelectionChangedError, v as retainSharedCodexAppServerClientIfCurrent, z as ensureCodexAppServerClientRuntime } from "./shared-client-CscigXXL.js";
|
|
23
|
+
import { a as closeCodexStartupClientBestEffort, d as unsubscribeCodexThreadBestEffort, f as CODEX_APP_SERVER_NATIVE_TURN_WAIT_TIMEOUT_MS, g as readCodexNotificationThreadId, h as isCodexNotificationForTurn, l as retireUnsafeCodexTurnClientBestEffort, m as CodexProjectionDiagnostics, o as interruptCodexTurnAndWaitBestEffort, p as getCodexAppServerTurnRouter, r as CodexAppServerUnsafeSubscriptionError, u as terminateCodexBackgroundTerminals } from "./attempt-client-cleanup-DKHzbwt5.js";
|
|
24
|
+
import { a as isRawFunctionToolOutputCompletionNotification, c as readNotificationItemId, i as isPendingOpenClawDynamicToolCompletionNotification, l as readRawResponseToolCallId, o as isTerminalTurnStatus, r as isCodexTurnAbortMarkerNotification, s as readCodexNotificationItem, t as codexExecutionToolName, u as updateActiveTurnItemIds } from "./attempt-notifications-C9XufG6l.js";
|
|
25
|
+
import { t as CodexUsageProjection } from "./event-projector-usage-BfXmpOec.js";
|
|
26
|
+
import { $ as codexDynamicToolsFingerprint, A as readCodexMcpToolConnectorId, B as createCodexNativeHookRelay, C as resolveCodexWebSearchPlan, Ct as buildCodexPluginThreadConfigInputFingerprint, Et as mergeCodexThreadConfigs, F as CODEX_NATIVE_HOOK_RELAY_TTL_GRACE_MS, H as resolveCodexNativeHookRelayEvents, J as loadCodexNativeToolCatalog, L as buildCodexNativeHookRelayConfig, N as isCodexAppServerProfilerEnabled, O as resolveCodexAppServerThreadModelSelection, Ot as shouldBuildCodexPluginThreadConfig, R as buildCodexNativeHookRelayDisabledConfig, St as buildCodexPluginThreadConfig, U as resolveCodexNativeHookRelayTtlMs, V as emitCodexNativePreToolUseFailureDiagnostic, W as scheduleCodexNativeHookRelayUnregister, _t as neutralizeCodexExplicitMentionSigils, a as buildCodexUserInput, bt as resolveCodexContextEngineProjectionReserveTokens, c as startOrResumeThread, d as buildScheduledCodexAppAuthorityInputFingerprint, dt as buildContextEngineBinding, et as codexLegacyDynamicToolsFingerprint, f as buildScheduledCodexAppServerConnectionIdentity, g as resolveScheduledCodexAppCreatorCaptureDecision, gt as isCodexDurableCustomMessage, h as readCurrentCodexScheduledAppPolicy$1, ht as fitCodexProjectedContextForTurnStart, i as buildTurnStartParams, j as readCodexMcpToolUiVisibility, l as assertScheduledCodexAppAuthorityRuntime, m as intersectCodexPluginThreadConfigWithScheduledAuthority, mt as buildCodexContinuityCalibration, p as captureScheduledCodexAppAuthority, pt as CodexContextAttachmentError, q as hasCodexNativeToolCatalog, r as buildTurnCollaborationMode, rt as filterCodexDynamicTools, st as isSystemAgentOnlyCodexDynamicToolAllowlist, t as buildCodexParentLocalInstructions, u as buildLegacyScheduledCodexAppRecoveryPrompt, ut as resolveCodexDynamicToolsLoadingForRuntime, vt as projectContextEngineAssemblyForCodex, w as buildDeveloperInstructions, wt as buildCodexPluginThreadConfigTimeoutFallback, xt as resolveCodexContinuityProjectionMaxChars, yt as resolveCodexContextEngineProjectionMaxChars } from "./thread-lifecycle-DXl1-I6b.js";
|
|
27
|
+
import { a as resolveCodexRunSessionBindingAuthority, n as createCodexSessionGenerationSupersededError, o as resolveCodexSessionBinding, s as scopeCodexRunBindingStore } from "./session-binding-CI8UuilT.js";
|
|
28
|
+
import { n as CodexThreadPolicyHandoffError } from "./thread-policy-BuEQfE0g.js";
|
|
29
|
+
import { r as retainCodexAppServerBindingSubscription } from "./thread-ownership-BsDRTsyp.js";
|
|
30
|
+
import { i as mirrorPromptAtTurnStartBestEffort, n as createCodexAppServerUserMessagePersistenceNotifier, o as buildCodexUserPromptMessage, s as promptSnapshot, t as codexTranscriptMirrorRuntime } from "./transcript-mirror-C5CKgNy6.js";
|
|
30
31
|
import { t as persistCodexContextCompactionActivity } from "./context-compaction-activity-CMla5FPJ.js";
|
|
32
|
+
import { t as CODEX_INFERENCE_GENERATION_KEY } from "./inference-context-Dr_mzvk4.js";
|
|
31
33
|
import { i as createAssistantReasoningMessage, n as createAssistantCommentaryMessage, r as createAssistantMessage, t as createAssistantAsyncMessage } from "./event-projector-assistant-message-BmBM4qBV.js";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import { a as
|
|
35
|
-
import {
|
|
36
|
-
import { a as
|
|
37
|
-
import { a as
|
|
34
|
+
import { _ as sanitizeCodexToolResponse, g as sanitizeCodexToolArguments, h as resolveCodexToolProgressDetailMode, m as isCodexCommandBearingToolCall, p as inferCodexDynamicToolMeta } from "./native-subagent-task-ids-BzTdT0Uw.js";
|
|
35
|
+
import { n as createCodexNativeSubagentHistoryOwner } from "./native-subagent-history-owner-Pcp7JuVF.js";
|
|
36
|
+
import { C as shouldRequireCodexSandboxExecServerEnvironment, S as shouldEnableCodexAppServerNativeToolSurface, _ as resolveCodexAppServerHookChannelId, a as emitDynamicToolStartedDiagnostic, c as ensureCodexSandboxExecServerEnvironment, d as CodexNativeToolLifecycleProjector, f as buildDynamicTools, g as resolveCodexAppServerExecutionCwd, h as formatCodexDynamicToolBuildStageSummary, i as emitDynamicToolErrorDiagnostic, l as releaseCodexSandboxExecServerEnvironment, m as disableCodexPluginThreadConfig, n as projectCodexExecutableDynamicTools, o as emitDynamicToolTerminalDiagnostic, p as createCodexDynamicToolBuildStageTracker, r as routeCodexAppServerElicitationRequest, s as handleCodexAppServerApprovalRequest, t as createCodexDynamicToolBridge, u as readBoundedCodexRemoteWorkspaceFile, v as resolveCodexExternalSandboxPolicyForOpenClawSandbox, w as shouldWarnCodexDynamicToolBuildStageSummary, x as resolveCodexSandboxEnvironmentSelection, y as resolveCodexMessageToolProvider } from "./dynamic-tools-CmN5RAip.js";
|
|
37
|
+
import { t as resolveCodexProviderWebSearchSupport } from "./provider-capabilities-BvCUL69A.js";
|
|
38
|
+
import { a as requestPluginApprovalOutcome } from "./plugin-approval-roundtrip-Bz3FT8W5.js";
|
|
39
|
+
import { a as CodexToolProgressProjection, i as CodexToolTranscriptProjection, n as CodexEventProjection, o as shouldEmitTranscriptToolProgress, r as emitCodexAgentEvent, t as codexNativeSubagentMonitorRuntime } from "./native-subagent-monitor-fQ7eIXEf.js";
|
|
40
|
+
import { a as resolveCodexAppServerForModelProvider, i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, r as resolveCodexEffectiveSessionPermissionPolicy } from "./session-permission-policy-BBmXA8Eg.js";
|
|
41
|
+
import { a as getCodexWorkspaceMemoryToolNames, c as readContextEngineThreadBootstrapProjection, d as resolveCodexDeliveryHintPreservedInputRange, f as resolveContextEngineBootstrapProjectionDecision, i as buildCodexWorkspaceBootstrapContext, l as readMirroredSessionHistoryMessages, n as buildCodexSystemPromptReport, r as buildCodexWatchedSessionsContext, s as prependCodexOpenClawPromptContext, t as buildCodexOpenClawPromptContext, u as renderCodexSkillsCollaborationInstructions } from "./attempt-context-D44yeDII.js";
|
|
38
42
|
import { n as captureCodexSettledTurnFinalizationContext } from "./settled-turn-context-Du6gdUDd.js";
|
|
39
|
-
import { a as runCodexComputerUseLiveTest, n as ensureCodexComputerUse, t as defaultCodexPluginMetadataCache } from "./plugin-metadata-cache-
|
|
43
|
+
import { a as runCodexComputerUseLiveTest, n as ensureCodexComputerUse, t as defaultCodexPluginMetadataCache } from "./plugin-metadata-cache-ClPJpRio.js";
|
|
40
44
|
import { asOptionalRecord, normalizeOptionalString, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
41
45
|
import { createHash } from "node:crypto";
|
|
42
46
|
import { resolveAgentConfig, resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
@@ -48,11 +52,11 @@ import { truncateUtf16Safe, truncateUtf8Prefix } from "openclaw/plugin-sdk/text-
|
|
|
48
52
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
49
53
|
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
50
54
|
import { isPathStrictlyInside, root } from "openclaw/plugin-sdk/file-access-runtime";
|
|
51
|
-
import { isDeepStrictEqual } from "node:util";
|
|
52
55
|
import { markAuthProfileBlockedUntil, resolveAgentDir as resolveAgentDir$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
53
56
|
import { AgentHarnessPreflightError, CODEX_APP_SERVER_CONTEXT_ENGINE_HOST, FAST_MODE_AUTO_PROGRESS_KIND, agentHarnessAttemptTerminal, agentHarnessStructuredInput, assembleHarnessContextEngine, assertContextEngineHostSupport, awaitAgentEndSideEffects, bootstrapHarnessContextEngine, buildAgentHookContextChannelFields, buildEmbeddedForegroundPromptContext, buildHarnessContextEngineRuntimeContext, cancelPendingAgentQuestionForSession, claimPendingAgentQuestionAnswer, classifyAgentHarnessTerminalOutcome, clearActiveEmbeddedRun, detectAndLoadAgentHarnessPromptImages, embeddedAgentLog, emitAgentEvent, emptyAgentHarnessUserInputAnswers, formatErrorMessage, formatFastModeAutoProgressText, getAgentHarnessHookRunner, hasBeforeToolCallPolicy, isActiveHarnessContextEngine, isHostScopedAgentToolActive, loadCodexBundleMcpThreadConfig, materializeRequesterScopedMcpToolsForHarnessRun, prepareHarnessNativeMcpAppPreview, projectAgentHarnessTranscriptMessageForDisplay, projectProgressCardChannelUpdate, resolveAgentDir as resolveAgentDir$2, resolveAgentHarnessBeforePromptBuildResult, resolveAgentRunAbortLifecycleFields, resolveAttemptFsWorkspaceOnly, resolveContextEngineOwnerPluginId, resolveFastModeForElapsed, resolveSandboxContext, resolveUserPath, runAgentCleanupStep, runAgentEndSideEffects, runAgentHarnessAfterCompactionHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, runHarnessContextEngineMaintenance, setActiveEmbeddedRun, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
54
57
|
import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
55
|
-
import {
|
|
58
|
+
import { isDeepStrictEqual } from "node:util";
|
|
59
|
+
import { getSessionEntry, parseSqliteSessionFileMarker } from "openclaw/plugin-sdk/session-store-runtime";
|
|
56
60
|
import { createDiagnosticTraceContextFromActiveScope, emitTrustedDiagnosticEvent, emitTrustedDiagnosticEventWithPrivateData, freezeDiagnosticTraceContext, onInternalDiagnosticEvent, resolveDiagnosticModelContentCapturePolicy } from "openclaw/plugin-sdk/diagnostic-runtime";
|
|
57
61
|
import { captureFinalCodexCronCreatorToolAllowlist, formatMcpCodexApprovalRemedy, materializeStaticMcpToolsForHarnessRun, resolveCodexMcpToolOverridesForAgent, resolveCodexTtsProvenanceTransfer } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
58
62
|
import { appendSessionYieldContext, hasPromptImageInput } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
@@ -2891,6 +2895,8 @@ async function cleanupCodexAttempt(resources, turnRuntime, lifecycle, requestRun
|
|
|
2891
2895
|
const { maybeEmitFastModeAutoResetBestEffort, emitLifecycleTerminal, buildLifecycleTerminalMeta } = lifecycle;
|
|
2892
2896
|
const { codexModelCallDiagnostics } = requestRuntime;
|
|
2893
2897
|
const { activeTurnId, abortListener, handle, freezeRunTerminalOutcome } = activeTurn;
|
|
2898
|
+
resourceState.releaseInferenceContext?.();
|
|
2899
|
+
resourceState.releaseInferenceContext = void 0;
|
|
2894
2900
|
prompt.context.attemptTools.scheduledAppAuthoritySourceRef.current = void 0;
|
|
2895
2901
|
freezeRunTerminalOutcome();
|
|
2896
2902
|
const projectionClose = state.projectionClosed ? void 0 : activeTurn.activeProjector.closeProjection();
|
|
@@ -3802,6 +3808,7 @@ async function prepareCodexAttemptContext(runtime, attemptTools) {
|
|
|
3802
3808
|
modelId: params.modelId
|
|
3803
3809
|
} : {},
|
|
3804
3810
|
trigger: params.trigger,
|
|
3811
|
+
inputProvenance: params.inputProvenance,
|
|
3805
3812
|
...buildAgentHookContextChannelFields({
|
|
3806
3813
|
sessionKey: contextSessionKey,
|
|
3807
3814
|
messageChannel: params.messageChannel,
|
|
@@ -4476,7 +4483,7 @@ async function finalizeCodexAttempt(resources, turnRuntime, lifecycle, notificat
|
|
|
4476
4483
|
hookRunner
|
|
4477
4484
|
});
|
|
4478
4485
|
state.shouldDelayNativeHookRelayUnregister = completedTurnStatus === "completed" && !effectiveTimedOut && !runAbortController.signal.aborted && !finalAborted && !finalPromptError;
|
|
4479
|
-
if (
|
|
4486
|
+
if (turnSucceeded && !runAbortController.signal.aborted) try {
|
|
4480
4487
|
const continuityCalibration = context.promptState.noEngineContinuityProjectionApplied ? buildCodexContinuityCalibration({
|
|
4481
4488
|
promptChars: prompt.turnState.codexTurnPromptText.length,
|
|
4482
4489
|
inputTokens: result.attemptUsage?.contextUsage?.state === "available" ? result.attemptUsage.contextUsage.promptTokens ?? 0 : 0
|
|
@@ -5092,11 +5099,13 @@ async function prepareCodexAttemptPrompt(context) {
|
|
|
5092
5099
|
promptBuild: firstPromptBuild,
|
|
5093
5100
|
codexTurnPromptText: decorateCodexTurnPromptText(firstPromptBuild)
|
|
5094
5101
|
};
|
|
5095
|
-
|
|
5102
|
+
let parentLocalEgress = false;
|
|
5103
|
+
const parentLocalContext = {
|
|
5096
5104
|
turnScopedDeveloperInstructions: workspaceBootstrapContext.turnScopedDeveloperInstructions,
|
|
5097
5105
|
skillsCollaborationInstructions,
|
|
5098
5106
|
memoryCollaborationInstructions: workspaceBootstrapContext.memoryCollaborationInstructions
|
|
5099
|
-
}
|
|
5107
|
+
};
|
|
5108
|
+
const buildRenderedCodexDeveloperInstructions = () => joinPresentSections(turnState.promptBuild.developerInstructions, (parentLocalEgress ? buildCodexParentLocalInstructions(params, parentLocalContext) : buildTurnCollaborationMode(params, parentLocalContext).settings.developer_instructions) ?? void 0);
|
|
5100
5109
|
const rebuildCodexPromptBuildFromCurrentProjection = async () => {
|
|
5101
5110
|
turnState.promptBuild = await buildPromptFromCurrentInputs();
|
|
5102
5111
|
turnState.codexTurnPromptText = decorateCodexTurnPromptText(turnState.promptBuild);
|
|
@@ -5225,6 +5234,10 @@ async function prepareCodexAttemptPrompt(context) {
|
|
|
5225
5234
|
workspaceReferencesIncluded = include;
|
|
5226
5235
|
}
|
|
5227
5236
|
},
|
|
5237
|
+
setParentLocalEgress: () => {
|
|
5238
|
+
parentLocalEgress = true;
|
|
5239
|
+
Object.assign(systemPromptReport, buildSystemPromptReport(!workspaceReferencesIncluded));
|
|
5240
|
+
},
|
|
5228
5241
|
buildRenderedCodexDeveloperInstructions,
|
|
5229
5242
|
rebuildCodexTurnPromptTextFromCurrentProjection,
|
|
5230
5243
|
applyNoContextEngineContinuityProjection,
|
|
@@ -5280,6 +5293,7 @@ function prepareCodexAttemptResources(prompt) {
|
|
|
5280
5293
|
sharedCodexClientRetiredForOneShotCleanup: false,
|
|
5281
5294
|
sandboxExecEnvironment: void 0,
|
|
5282
5295
|
executionDisconnectError: void 0,
|
|
5296
|
+
releaseInferenceContext: void 0,
|
|
5283
5297
|
codexEnvironmentSelection: void 0,
|
|
5284
5298
|
codexExecutionCwd: effectiveCwd,
|
|
5285
5299
|
codexSandboxPolicy: void 0,
|
|
@@ -5372,11 +5386,26 @@ function prepareCodexAttemptResources(prompt) {
|
|
|
5372
5386
|
};
|
|
5373
5387
|
const registerNativeSubagentMonitor = (parentThreadId) => {
|
|
5374
5388
|
unregisterNativeSubagentMonitor();
|
|
5389
|
+
const sessionKey = params.sessionKey;
|
|
5390
|
+
const storePath = params.sessionTarget?.storePath;
|
|
5391
|
+
const parentSession = sessionKey && storePath ? getSessionEntry({
|
|
5392
|
+
agentId: sessionAgentId,
|
|
5393
|
+
sessionKey,
|
|
5394
|
+
storePath,
|
|
5395
|
+
readConsistency: "latest",
|
|
5396
|
+
hydrateSkillPromptRefs: false
|
|
5397
|
+
}) : void 0;
|
|
5375
5398
|
state.nativeSubagentMonitor = codexNativeSubagentMonitorRuntime.register({
|
|
5376
5399
|
client: state.client,
|
|
5377
5400
|
parentThreadId,
|
|
5378
5401
|
requesterSessionKey: params.sessionKey,
|
|
5379
5402
|
taskRuntimeScope: params.agentHarnessTaskRuntimeScope,
|
|
5403
|
+
historyOwner: createCodexNativeSubagentHistoryOwner({
|
|
5404
|
+
parentThreadId,
|
|
5405
|
+
sessionId: params.sessionId,
|
|
5406
|
+
...parentSession?.sessionId === params.sessionId ? { lifecycleRevision: parentSession.lifecycleRevision } : {},
|
|
5407
|
+
binding: state.thread
|
|
5408
|
+
}),
|
|
5380
5409
|
agentId: sessionAgentId,
|
|
5381
5410
|
retainClient: () => retainSharedCodexAppServerClientIfCurrent(state.client),
|
|
5382
5411
|
retainParentThread: (protectedThreadId) => protectCodexAppServerLiveThread(state.client, protectedThreadId),
|
|
@@ -5388,6 +5417,8 @@ function prepareCodexAttemptResources(prompt) {
|
|
|
5388
5417
|
});
|
|
5389
5418
|
};
|
|
5390
5419
|
const releaseCurrentRoute = () => {
|
|
5420
|
+
state.releaseInferenceContext?.();
|
|
5421
|
+
state.releaseInferenceContext = void 0;
|
|
5391
5422
|
state.detachRouteAbort();
|
|
5392
5423
|
state.detachRouteAbort = () => void 0;
|
|
5393
5424
|
state.turnRoute?.release();
|
|
@@ -6100,7 +6131,7 @@ function createCodexAttemptServerRequestController(resources, turnRuntime, lifec
|
|
|
6100
6131
|
//#region extensions/codex/src/app-server/attempt-runtime-artifact.ts
|
|
6101
6132
|
async function verifyStartupArtifact(params) {
|
|
6102
6133
|
if (!params.request) return;
|
|
6103
|
-
const { readCodexAppServerClientRuntimeArtifact, validateCodexAppServerRuntimeArtifact } = await import("./runtime-artifact-
|
|
6134
|
+
const { readCodexAppServerClientRuntimeArtifact, validateCodexAppServerRuntimeArtifact } = await import("./runtime-artifact-BJ0rXBZ_.js");
|
|
6104
6135
|
const runtimeArtifact = readCodexAppServerClientRuntimeArtifact(params.client);
|
|
6105
6136
|
const expected = params.request.expected;
|
|
6106
6137
|
const matchesExpected = !expected || runtimeArtifact?.id === expected.id && runtimeArtifact.fingerprint === expected.fingerprint;
|
|
@@ -7332,6 +7363,7 @@ async function prepareCodexAttemptTurnRequest(resources, turnRuntime, ensureCurr
|
|
|
7332
7363
|
connection.mutable.pluginAppServer = turnAppServer;
|
|
7333
7364
|
const references = prepareWorkspaceReferences();
|
|
7334
7365
|
const referencesRetained = turnState.codexTurnPromptText.includes(workspaceBootstrapContext.promptContext ?? "");
|
|
7366
|
+
const inferenceRoute = usesSupervisionConnection ? void 0 : getCodexInferenceThread(resourceState.client, resourceState.thread.threadId);
|
|
7335
7367
|
const turnStartParams = buildTurnStartParams({
|
|
7336
7368
|
...runtimeParams,
|
|
7337
7369
|
images: [...prompt.contextImages, ...runtimeParams.images ?? []]
|
|
@@ -7352,10 +7384,49 @@ async function prepareCodexAttemptTurnRequest(resources, turnRuntime, ensureCurr
|
|
|
7352
7384
|
skillsCollaborationInstructions: context.skillsCollaborationInstructions,
|
|
7353
7385
|
memoryCollaborationInstructions: workspaceBootstrapContext.memoryCollaborationInstructions,
|
|
7354
7386
|
preserveNativeTurnSettings: usesSupervisionConnection,
|
|
7387
|
+
parentLocalEgress: inferenceRoute !== void 0,
|
|
7355
7388
|
messageToolAvailable: toolBridge.availableTools.some((tool) => tool.name === "message"),
|
|
7356
7389
|
requireExplicitMessageTarget: attemptTools.requireExplicitMessageTarget,
|
|
7357
7390
|
sessionStatusAvailable: toolBridge.availableTools.some((tool) => tool.name === "session_status")
|
|
7358
7391
|
});
|
|
7392
|
+
if (inferenceRoute) {
|
|
7393
|
+
prompt.setParentLocalEgress();
|
|
7394
|
+
resourceState.releaseInferenceContext?.();
|
|
7395
|
+
const inferenceThread = resourceState.thread;
|
|
7396
|
+
const registration = inferenceRoute.context.register({
|
|
7397
|
+
threadId: resourceState.thread.threadId,
|
|
7398
|
+
text: buildCodexParentLocalInstructions(runtimeParams, {
|
|
7399
|
+
turnScopedDeveloperInstructions: workspaceBootstrapContext.turnScopedDeveloperInstructions,
|
|
7400
|
+
skillsCollaborationInstructions: context.skillsCollaborationInstructions,
|
|
7401
|
+
memoryCollaborationInstructions: workspaceBootstrapContext.memoryCollaborationInstructions
|
|
7402
|
+
}) ?? "",
|
|
7403
|
+
signal: runAbortController.signal,
|
|
7404
|
+
assertCurrent: () => {
|
|
7405
|
+
params.hostCapabilities.assertActive();
|
|
7406
|
+
connection.assertCurrent();
|
|
7407
|
+
if (resourceState.thread !== inferenceThread || getCodexInferenceThread(resourceState.client, inferenceThread.threadId) !== inferenceRoute) throw new Error("Codex inference thread ownership changed");
|
|
7408
|
+
inferenceThread.liveThreadOwnership?.assertCurrent();
|
|
7409
|
+
}
|
|
7410
|
+
});
|
|
7411
|
+
resourceState.releaseInferenceContext = registration.release;
|
|
7412
|
+
turnStartParams.responsesapiClientMetadata = {
|
|
7413
|
+
...turnStartParams.responsesapiClientMetadata,
|
|
7414
|
+
[CODEX_INFERENCE_GENERATION_KEY]: registration.generation
|
|
7415
|
+
};
|
|
7416
|
+
} else if (!usesSupervisionConnection) {
|
|
7417
|
+
embeddedAgentLog.warn("Codex parent-local egress workaround is unavailable for this connection or native network profile; legacy collaboration delivery is not guaranteed.");
|
|
7418
|
+
prompt.systemPromptReport.source = "estimate";
|
|
7419
|
+
prompt.systemPromptReport.injectedWorkspaceFiles = prompt.systemPromptReport.injectedWorkspaceFiles.map((file) => [
|
|
7420
|
+
"SOUL.MD",
|
|
7421
|
+
"IDENTITY.MD",
|
|
7422
|
+
"USER.MD"
|
|
7423
|
+
].includes(file.name.toUpperCase()) ? {
|
|
7424
|
+
...file,
|
|
7425
|
+
injectionStatus: "native_unverified",
|
|
7426
|
+
injectedChars: null,
|
|
7427
|
+
truncated: null
|
|
7428
|
+
} : file);
|
|
7429
|
+
}
|
|
7359
7430
|
codexModelCallDiagnostics.setRequestPayloadBytes(utf8JsonByteLength(turnStartParams));
|
|
7360
7431
|
recordCodexTrajectoryContext(resources.trajectoryRecorder, {
|
|
7361
7432
|
attempt: params,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as resolvePackagedCodexNativeCommand } from "./managed-binary-D22rNEcR.js";
|
|
2
2
|
import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-BGjHoYLr.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { resolveWindowsExecutablePath, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { y as isCodexRemoteExecPlacementSandbox } from "./protocol-
|
|
2
|
+
import { y as isCodexRemoteExecPlacementSandbox } from "./protocol-5bh1G-H7.js";
|
|
3
3
|
import { n as resolveCodexNativeExecutionPolicy, t as formatCodexNativeNodeExecBlock } from "./native-execution-policy-umd0tgh4.js";
|
|
4
4
|
import { tryResolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
5
5
|
import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
@@ -25,6 +25,7 @@ const DIRECT_METHOD_POLICIES = /* @__PURE__ */ new Map([
|
|
|
25
25
|
["config/read", "allowed-control-plane"],
|
|
26
26
|
["config/value/write", "allowed-control-plane"],
|
|
27
27
|
["environment/add", "allowed-control-plane"],
|
|
28
|
+
["experimentalFeature/list", "allowed-control-plane"],
|
|
28
29
|
["experimentalFeature/enablement/set", "allowed-control-plane"],
|
|
29
30
|
["feedback/upload", "allowed-control-plane"],
|
|
30
31
|
["hooks/list", "allowed-control-plane"],
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as readCodexAppServerThreadBinding, c as readStoredCodexAppServerBinding, d as validateBindingForWrite, i as ownsStoredSessionGeneration, l as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as readCodexBindingTimestamp, r as bindingStoreKey, s as readCurrentCodexAppServerBinding, t as CodexSupervisionBindingReplacementError, u as stripUndefinedBinding } from "./session-binding-record-
|
|
2
|
+
import { m as CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN } from "./config-utils-DujwEnhg.js";
|
|
3
|
+
import { a as readCodexAppServerThreadBinding, c as readStoredCodexAppServerBinding, d as validateBindingForWrite, i as ownsStoredSessionGeneration, l as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as readCodexBindingTimestamp, r as bindingStoreKey, s as readCurrentCodexAppServerBinding, t as CodexSupervisionBindingReplacementError, u as stripUndefinedBinding } from "./session-binding-record-Bcvslnhf.js";
|
|
4
4
|
import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./session-binding-meta-B7aEMU7g.js";
|
|
5
5
|
import { n as normalizeCodexAppServerBindingModelProvider } from "./auth-profile-CwzO4_RG.js";
|
|
6
6
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { createHash, randomUUID } from "node:crypto";
|
|
8
|
-
import { isDeepStrictEqual } from "node:util";
|
|
9
8
|
import { AgentHarnessSessionSupersededError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
9
|
+
import { isDeepStrictEqual } from "node:util";
|
|
10
10
|
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
11
11
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
12
12
|
//#region extensions/codex/src/app-server/session-binding.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as normalizeCodexServiceTier, m as CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN } from "./config-utils-DujwEnhg.js";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { AgentHarnessPreflightError } from "openclaw/plugin-sdk/agent-harness-registration";
|
|
4
4
|
import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as sessionBindingIdentity } from "./session-binding-record-
|
|
2
|
-
import {
|
|
1
|
+
import { l as sessionBindingIdentity } from "./session-binding-record-Bcvslnhf.js";
|
|
2
|
+
import { c as CatalogParamsError, f as boundedCatalogString, w as requireBoundThread } from "./thread-history-page-D0JIp48V.js";
|
|
3
3
|
import { n as codexUpstreamBaseline, t as codexLastTerminalTurnId } from "./session-upstream-marker-D15C9NHp.js";
|
|
4
|
-
import { i as reclaimCurrentCodexSessionGeneration } from "./session-binding-
|
|
5
|
-
import { adoptionSessionKeyRest, continueOperations, runSessionActionExclusive } from "./session-catalog-node-adoption-
|
|
4
|
+
import { i as reclaimCurrentCodexSessionGeneration } from "./session-binding-CI8UuilT.js";
|
|
5
|
+
import { adoptionSessionKeyRest, continueOperations, runSessionActionExclusive } from "./session-catalog-node-adoption-B1tgDW-m.js";
|
|
6
6
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { listSessionCatalogEntries, sessionCatalogAdoptedSessionKey, sessionCatalogAdoptedSourceKey } from "openclaw/plugin-sdk/session-catalog";
|
|
8
8
|
//#region extensions/codex/src/session-catalog-adoption.ts
|
|
@@ -119,7 +119,7 @@ async function createOrReuseAdoptedSession(params) {
|
|
|
119
119
|
sourceThreadId: params.sourceThread.id,
|
|
120
120
|
...params.sourceHomeId ? { sourceHomeId: params.sourceHomeId } : {}
|
|
121
121
|
};
|
|
122
|
-
const { createImportedCodexSession } = await import("./session-history-import-
|
|
122
|
+
const { createImportedCodexSession } = await import("./session-history-import-DwyijFI6.js");
|
|
123
123
|
const created = await createImportedCodexSession({
|
|
124
124
|
runtime: params.api.runtime,
|
|
125
125
|
bindingStore: params.bindingStore,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { l as sessionBindingIdentity } from "./session-binding-record-
|
|
2
|
-
import { t as assertCodexArchiveDescendantsUnowned } from "./thread-archive-guard-
|
|
3
|
-
import {
|
|
4
|
-
import "./session-binding-
|
|
5
|
-
import { runSessionActionExclusive } from "./session-catalog-node-adoption-
|
|
6
|
-
import { isAdoptionSessionKeyForThread, requireIdleThread } from "./session-catalog-adoption-
|
|
1
|
+
import { l as sessionBindingIdentity } from "./session-binding-record-Bcvslnhf.js";
|
|
2
|
+
import { t as assertCodexArchiveDescendantsUnowned } from "./thread-archive-guard-DfpBr-Sz.js";
|
|
3
|
+
import { c as CatalogParamsError } from "./thread-history-page-D0JIp48V.js";
|
|
4
|
+
import "./session-binding-CI8UuilT.js";
|
|
5
|
+
import { runSessionActionExclusive } from "./session-catalog-node-adoption-B1tgDW-m.js";
|
|
6
|
+
import { isAdoptionSessionKeyForThread, requireIdleThread } from "./session-catalog-adoption-tcZi1IfX.js";
|
|
7
7
|
import { listAgentIds } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
8
8
|
import { sessionCatalogAdoptedSourceKey } from "openclaw/plugin-sdk/session-catalog";
|
|
9
9
|
//#region extensions/codex/src/session-catalog-archive.ts
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { l as sessionBindingIdentity } from "./session-binding-record-
|
|
2
|
-
import { c as resolveCodexAppServerLocalHomeDir, i as assertCodexThreadForkParams, l as resolveCodexAppServerUserHomeDir, s as resolveCodexAppServerHomeDir, x as readCodexPluginConfig } from "./protocol-
|
|
3
|
-
import {
|
|
4
|
-
import { t as CODEX_CONTROL_METHODS } from "./capabilities-
|
|
5
|
-
import { C as
|
|
6
|
-
import {
|
|
1
|
+
import { l as sessionBindingIdentity } from "./session-binding-record-Bcvslnhf.js";
|
|
2
|
+
import { c as resolveCodexAppServerLocalHomeDir, i as assertCodexThreadForkParams, l as resolveCodexAppServerUserHomeDir, s as resolveCodexAppServerHomeDir, x as readCodexPluginConfig } from "./protocol-5bh1G-H7.js";
|
|
3
|
+
import { n as isCodexThreadReadMissingError } from "./rpc-error-ttN_QjEm.js";
|
|
4
|
+
import { t as CODEX_CONTROL_METHODS } from "./capabilities-8vx68WLH.js";
|
|
5
|
+
import { C as readPageParams, D as unwrapNodeInvokePayload, E as toCatalogSession, S as readGatewayParams, T as requireOnlyKeys, _ as parseCatalogPage, a as CODEX_APP_SERVER_THREAD_TURNS_LIST_COMMAND, b as readBoundedOptionalString, c as CatalogParamsError, d as NODE_INVOKE_TIMEOUT_MS, g as normalizeLimit, h as isInteractiveThreadSource, i as CODEX_APP_SERVER_THREADS_LIST_COMMAND, l as MAX_CURSOR_LENGTH, m as filterCatalogPageByTitle, n as readLegacyCodexHistoryPage, o as CODEX_CATALOG_TRANSCRIPT_READ_COMMAND, p as catalogError, r as CODEX_APP_SERVER_THREADS_CAPABILITY, s as CODEX_LOCAL_SESSION_HOST_ID, t as readCodexThreadHistoryPage, u as MAX_TRANSCRIPT_PAGE_BYTES, v as parseJsonParams, x as readControlCursor, y as parseTranscriptPage } from "./thread-history-page-D0JIp48V.js";
|
|
6
|
+
import { i as projectCodexUserItemText } from "./transcript-history-projection-v17wXgdK.js";
|
|
7
7
|
import { r as codexUpstreamContinueResult } from "./session-upstream-marker-D15C9NHp.js";
|
|
8
|
-
import { i as replaceCodexCatalogConnectionHomes, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-
|
|
8
|
+
import { i as replaceCodexCatalogConnectionHomes, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-d0eKxy7b.js";
|
|
9
9
|
import { n as withTimeout } from "./timeout-BVw8aaM1.js";
|
|
10
|
+
import { n as codexCatalogHomeId, t as canonicalCodexCatalogHome } from "./session-catalog-home-id-CwhLdC03.js";
|
|
11
|
+
import { n as readCodexSessionMeta, t as isOpenClawManagedCodexThread } from "./session-catalog-provenance-D-dIfRAH.js";
|
|
10
12
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
13
|
import { resolveDefaultAgentDir } from "openclaw/plugin-sdk/agent-harness-registration";
|
|
12
14
|
import { listAgentIds, resolveAgentDir, resolveDefaultAgentId, resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
@@ -199,6 +201,7 @@ async function openCodexCatalogTerminal(params) {
|
|
|
199
201
|
kind: "node",
|
|
200
202
|
nodeId,
|
|
201
203
|
command: CODEX_TERMINAL_RESUME_COMMAND,
|
|
204
|
+
uploadPathStyle: "native",
|
|
202
205
|
paramsJSON: JSON.stringify({
|
|
203
206
|
agentId: params.agentId,
|
|
204
207
|
threadId: params.threadId
|
|
@@ -212,6 +215,7 @@ async function startCodexCatalogTerminal(params) {
|
|
|
212
215
|
kind: "node",
|
|
213
216
|
nodeId: params.nodeId,
|
|
214
217
|
command: CODEX_TERMINAL_START_COMMAND,
|
|
218
|
+
uploadPathStyle: "native",
|
|
215
219
|
paramsJSON: JSON.stringify({
|
|
216
220
|
cwd: params.cwd,
|
|
217
221
|
initialMessage: params.initialMessage
|
|
@@ -264,7 +268,6 @@ function toGenericTranscriptItem(item) {
|
|
|
264
268
|
}
|
|
265
269
|
//#endregion
|
|
266
270
|
//#region extensions/codex/src/session-catalog-transcript.ts
|
|
267
|
-
const TURN_ITEM_CURSOR_PREFIX = "turn-item:";
|
|
268
271
|
const transcriptPageSchema = z.strictObject({
|
|
269
272
|
items: z.array(z.strictObject({
|
|
270
273
|
id: z.string(),
|
|
@@ -285,23 +288,6 @@ const transcriptPageSchema = z.strictObject({
|
|
|
285
288
|
function parseCodexCatalogTranscriptPage(value) {
|
|
286
289
|
return transcriptPageSchema.parse(value);
|
|
287
290
|
}
|
|
288
|
-
function encodeTurnItemCursor(turnCursor, itemId) {
|
|
289
|
-
return TURN_ITEM_CURSOR_PREFIX + Buffer.from(JSON.stringify([turnCursor, itemId])).toString("base64url");
|
|
290
|
-
}
|
|
291
|
-
function decodeTurnItemCursor(cursor) {
|
|
292
|
-
if (!cursor?.startsWith(TURN_ITEM_CURSOR_PREFIX)) return { turnCursor: cursor };
|
|
293
|
-
let value;
|
|
294
|
-
try {
|
|
295
|
-
value = JSON.parse(Buffer.from(cursor.slice(10), "base64url").toString());
|
|
296
|
-
} catch {
|
|
297
|
-
throw new CatalogParamsError("invalid Codex transcript item cursor");
|
|
298
|
-
}
|
|
299
|
-
if (!Array.isArray(value) || value.length !== 2 || typeof value[0] !== "string" || !value[0] || typeof value[1] !== "string" || !value[1]) throw new CatalogParamsError("invalid Codex transcript item cursor");
|
|
300
|
-
return {
|
|
301
|
-
turnCursor: value[0],
|
|
302
|
-
itemId: value[1]
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
291
|
function projectTranscriptPage(items, limit) {
|
|
306
292
|
const projected = items.map(toGenericTranscriptItem);
|
|
307
293
|
const page = sessionCatalogPaging.boundTranscriptPage(projected.toReversed(), limit, 0).items;
|
|
@@ -313,60 +299,18 @@ function pageFitsNodeTransport(page) {
|
|
|
313
299
|
}
|
|
314
300
|
/** The legacy API can anchor a turn, but cannot continue within that turn. */
|
|
315
301
|
async function readLegacyCodexTranscriptPage(readTurns, request) {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
sortDirection: "desc",
|
|
321
|
-
itemsView: "full",
|
|
322
|
-
...turnCursor ? { cursor: turnCursor } : {}
|
|
323
|
-
}));
|
|
324
|
-
const source = page.data.flatMap((turn) => turn.items.toReversed());
|
|
325
|
-
const anchorIndex = itemId ? source.findIndex((item) => item.id === itemId) : -1;
|
|
326
|
-
if (itemId && anchorIndex < 0) throw new CatalogParamsError("Codex transcript changed; refresh the session before loading older items");
|
|
327
|
-
const remaining = source.slice(anchorIndex + 1);
|
|
328
|
-
const items = projectTranscriptPage(remaining, request.limit);
|
|
329
|
-
const result = () => {
|
|
330
|
-
const lastSource = remaining[items.length - 1];
|
|
331
|
-
const partial = lastSource !== void 0 && items.length < remaining.length;
|
|
332
|
-
const nativeCursor = partial ? page.backwardsCursor : page.nextCursor;
|
|
333
|
-
const cursor = nativeCursor ? partial ? encodeTurnItemCursor(nativeCursor, lastSource.id) : nativeCursor : void 0;
|
|
334
|
-
if (partial && !cursor) throw new Error("Codex app-server did not provide a transcript continuation anchor");
|
|
335
|
-
return {
|
|
336
|
-
items,
|
|
337
|
-
...cursor ? { nextCursor: cursor } : {}
|
|
338
|
-
};
|
|
339
|
-
};
|
|
340
|
-
let bounded = result();
|
|
341
|
-
while (!pageFitsNodeTransport(bounded)) {
|
|
342
|
-
if (items.length <= 1) throw new Error("Codex transcript item exceeds the safe response size");
|
|
343
|
-
items.pop();
|
|
344
|
-
bounded = result();
|
|
345
|
-
}
|
|
346
|
-
return bounded;
|
|
302
|
+
return readLegacyCodexHistoryPage(readTurns, request, {
|
|
303
|
+
project: (entries, limit) => projectTranscriptPage(entries.map(({ item }) => item), limit),
|
|
304
|
+
fits: pageFitsNodeTransport
|
|
305
|
+
});
|
|
347
306
|
}
|
|
348
307
|
/** Uses the native store's item cursor whenever that store supports item history. */
|
|
349
308
|
async function readCodexCatalogTranscriptPage(control, request) {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
limit,
|
|
356
|
-
sortDirection: "desc",
|
|
357
|
-
...request.cursor ? { cursor: request.cursor } : {}
|
|
358
|
-
});
|
|
359
|
-
const nextCursor = readControlCursor(page.nextCursor, "transcript next response");
|
|
360
|
-
const items = projectTranscriptPage(page.data.map(({ item }) => item), limit);
|
|
361
|
-
const result = {
|
|
362
|
-
items,
|
|
363
|
-
...nextCursor ? { nextCursor } : {}
|
|
364
|
-
};
|
|
365
|
-
const fittingCount = items.length - (pageFitsNodeTransport(result) ? 0 : 1);
|
|
366
|
-
if (fittingCount === page.data.length) return result;
|
|
367
|
-
if (fittingCount < 1) throw new Error("Codex transcript item exceeds the safe response size");
|
|
368
|
-
limit = fittingCount;
|
|
369
|
-
}
|
|
309
|
+
const thread = await control.requireEligibleThread(request.threadId);
|
|
310
|
+
return readCodexThreadHistoryPage(control, thread, request, {
|
|
311
|
+
project: (entries, limit) => projectTranscriptPage(entries.map(({ item }) => item), limit),
|
|
312
|
+
fits: pageFitsNodeTransport
|
|
313
|
+
});
|
|
370
314
|
}
|
|
371
315
|
//#endregion
|
|
372
316
|
//#region extensions/codex/src/session-catalog-listing.ts
|
|
@@ -430,7 +374,7 @@ async function listGatewayHost(params) {
|
|
|
430
374
|
signal: params.signal
|
|
431
375
|
});
|
|
432
376
|
params.signal?.throwIfAborted();
|
|
433
|
-
const { listAdoptedSessionEntries } = await import("./session-catalog-adoption-
|
|
377
|
+
const { listAdoptedSessionEntries } = await import("./session-catalog-adoption-tcZi1IfX.js");
|
|
434
378
|
const { sessionCatalogAdoptedSourceKey } = await import("openclaw/plugin-sdk/session-catalog");
|
|
435
379
|
params.signal?.throwIfAborted();
|
|
436
380
|
const adoptedSessions = await listAdoptedSessionEntries({
|
|
@@ -517,8 +461,8 @@ async function listCodexSessionCatalog(params) {
|
|
|
517
461
|
return { hosts: [...await Promise.all(localHosts), registryHost] };
|
|
518
462
|
}
|
|
519
463
|
params.signal?.throwIfAborted();
|
|
520
|
-
const { listNodeAdoptedSessionEntries } = await import("./session-catalog-node-adoption-
|
|
521
|
-
const { compareNodeLabels, listPairedNode } = await import("./session-catalog-node-continue-
|
|
464
|
+
const { listNodeAdoptedSessionEntries } = await import("./session-catalog-node-adoption-B1tgDW-m.js");
|
|
465
|
+
const { compareNodeLabels, listPairedNode } = await import("./session-catalog-node-continue-Ci-DXyJP.js");
|
|
522
466
|
params.signal?.throwIfAborted();
|
|
523
467
|
const adoptedNodeSessions = listNodeAdoptedSessionEntries({
|
|
524
468
|
agentId,
|
|
@@ -701,7 +645,7 @@ async function readCodexSessionTranscript(params) {
|
|
|
701
645
|
cursor,
|
|
702
646
|
limit
|
|
703
647
|
});
|
|
704
|
-
const { nodeLabel } = await import("./session-catalog-node-continue-
|
|
648
|
+
const { nodeLabel } = await import("./session-catalog-node-continue-Ci-DXyJP.js");
|
|
705
649
|
return {
|
|
706
650
|
hostId: params.hostId,
|
|
707
651
|
label: nodeLabel(node),
|
|
@@ -1153,7 +1097,7 @@ function createCodexSessionCatalogControl(params) {
|
|
|
1153
1097
|
const runtime = source?.appServer ?? params.resolveRuntimeOptions({ pluginConfig });
|
|
1154
1098
|
const requestOptions = resolveRequestOptions(runtime.start, agentId, source);
|
|
1155
1099
|
return createCodexCatalogRequestSnapshot(runtime.requestTimeoutMs, async (method, requestParams, timeoutMs, assertCurrent) => {
|
|
1156
|
-
const { codexControlRequest } = await import("./command-rpc-
|
|
1100
|
+
const { codexControlRequest } = await import("./command-rpc-CR5EOEZX.js").then((n) => n.n);
|
|
1157
1101
|
return await codexControlRequest(pluginConfig, method, requestParams, {
|
|
1158
1102
|
...requestOptions,
|
|
1159
1103
|
assertCurrent,
|
|
@@ -1166,9 +1110,9 @@ function createCodexSessionCatalogControl(params) {
|
|
|
1166
1110
|
const pluginConfig = getPluginConfig();
|
|
1167
1111
|
const runtime = source?.appServer ?? params.resolveRuntimeOptions({ pluginConfig });
|
|
1168
1112
|
const { agentDir, config: runtimeConfig, startOptions } = resolveRequestOptions(runtime.start, agentId, source);
|
|
1169
|
-
const { getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient, retireSharedCodexAppServerClientIfCurrent } = await import("./shared-client-
|
|
1170
|
-
const { resolveCodexAppServerClientInstanceId } = await import("./client-
|
|
1171
|
-
const { requestCodexAppServerClientJson } = await import("./request-
|
|
1113
|
+
const { getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient, retireSharedCodexAppServerClientIfCurrent } = await import("./shared-client-CscigXXL.js").then((n) => n.y);
|
|
1114
|
+
const { resolveCodexAppServerClientInstanceId } = await import("./client-B57KWPQx.js").then((n) => n.n);
|
|
1115
|
+
const { requestCodexAppServerClientJson } = await import("./request-B7hEkBGq.js").then((n) => n.a);
|
|
1172
1116
|
const client = await getLeasedSharedCodexAppServerClient({
|
|
1173
1117
|
agentDir,
|
|
1174
1118
|
config: runtimeConfig,
|
|
@@ -1518,15 +1462,15 @@ const codexSessionCatalogRuntime = {
|
|
|
1518
1462
|
archiveLocal: archiveLocalCodexSession
|
|
1519
1463
|
};
|
|
1520
1464
|
async function continueLocalCodexSession(...args) {
|
|
1521
|
-
const { continueLocalCodexSession: run } = await import("./session-catalog-adoption-
|
|
1465
|
+
const { continueLocalCodexSession: run } = await import("./session-catalog-adoption-tcZi1IfX.js");
|
|
1522
1466
|
return run(...args);
|
|
1523
1467
|
}
|
|
1524
1468
|
async function archiveLocalCodexSession(...args) {
|
|
1525
|
-
const { archiveLocalCodexSession: run } = await import("./session-catalog-archive-
|
|
1469
|
+
const { archiveLocalCodexSession: run } = await import("./session-catalog-archive-CwKg8Xz2.js");
|
|
1526
1470
|
return run(...args);
|
|
1527
1471
|
}
|
|
1528
1472
|
async function continueNodeCodexSession(...args) {
|
|
1529
|
-
const { continueNodeCodexSession: run } = await import("./session-catalog-node-continue-
|
|
1473
|
+
const { continueNodeCodexSession: run } = await import("./session-catalog-node-continue-Ci-DXyJP.js");
|
|
1530
1474
|
return run(...args);
|
|
1531
1475
|
}
|
|
1532
1476
|
//#endregion
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
//#region extensions/codex/src/session-catalog-home-id.ts
|
|
5
|
+
function canonicalCodexCatalogHome(value) {
|
|
6
|
+
const resolved = path.resolve(value);
|
|
7
|
+
try {
|
|
8
|
+
return fs.realpathSync.native(resolved);
|
|
9
|
+
} catch {
|
|
10
|
+
return resolved;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** One canonical identity for catalog discovery and durable ownership rows. */
|
|
14
|
+
function codexCatalogHomeId(codexHome) {
|
|
15
|
+
return createHash("sha256").update("openclaw:codex-session-catalog-home:v1\0").update(canonicalCodexCatalogHome(codexHome)).digest("hex");
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { codexCatalogHomeId as n, canonicalCodexCatalogHome as t };
|