@openclaw/codex 2026.9.2 → 2026.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/api.js +14 -19
- package/dist/apply-B6el6hdO.js +357 -0
- package/dist/{attempt-client-cleanup-Bp1ZOnk2.js → attempt-client-cleanup-D6cR54TV.js} +39 -19
- package/dist/{attempt-context-CSazkWns.js → attempt-context-AO4DSjE0.js} +8 -6
- package/dist/{event-projector-usage-ZqEVbAEY.js → attempt-notifications--H8zXR5-.js} +3 -106
- package/dist/auth-cache-key-Kq6oerr6.js +498 -0
- package/dist/auth-profile-CwzO4_RG.js +43 -0
- package/dist/auth-profile-selection-DFu9e167.js +45 -0
- package/dist/binding-connection-QqgcPCgk.js +60 -0
- package/dist/{bounded-turn-DxGJRYbY.js → bounded-turn-lRpmZHFv.js} +25 -122
- package/dist/build-state-6RL6qohz.js +19 -0
- package/dist/{capabilities-B1mgvpP8.js → capabilities-BeqLPbtM.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/client-BEKu4yDx.js +3983 -0
- package/dist/command-dispatch-CisT9Jqq.js +21 -0
- package/dist/{command-formatters-DSbGMXA0.js → command-formatters-DeTfrapr.js} +2 -2
- package/dist/{command-handlers-DOJvGv6-.js → command-handlers-BfIsJEuA.js} +31 -21
- package/dist/command-rpc-BMqRQOFX.js +226 -0
- package/dist/{compact-Y_xBqrHN.js → compact-CGJZ2rlb.js} +19 -14
- package/dist/config-JDfTI4VI.js +106 -0
- package/dist/{config-CyapYSji.js → config-options-jnIFvwxD.js} +204 -592
- package/dist/config-runtime-BWf6JLWG.js +11 -0
- package/dist/conversation-binding-CxOlHiix.js +889 -0
- package/dist/{plugin-marketplace-discovery-B7gHXJ3d.js → conversation-control-CUCrSIQI.js} +10 -142
- package/dist/doctor-contract-api.js +5 -5
- package/dist/{dynamic-tools-BwpvTxaX.js → dynamic-tools-D-JBoaLt.js} +66 -70
- package/dist/{effective-mcp-catalog-CY9Jn4bA.js → effective-mcp-catalog-J_5Ep5Um.js} +3 -3
- package/dist/{elicitation-input-DMkeki8d.js → elicitation-input-DPoK8F7w.js} +8 -22
- package/dist/ephemeral-turn-DSwzP8YY.js +101 -0
- package/dist/{event-projector-assistant-message-B9kp6iGC.js → event-projector-assistant-message-BmBM4qBV.js} +12 -25
- package/dist/event-projector-usage-CIyrYYid.js +102 -0
- package/dist/{harness-Czh2Sdoc.js → harness-FR6eQgyO.js} +31 -24
- package/dist/harness.js +1 -1
- package/dist/history-rejection-B4nOXNXF.js +13 -0
- package/dist/incognito-session-uhrBF6wJ.js +15 -0
- package/dist/index.js +411 -2875
- package/dist/{isolated-completion-CRh-51AK.js → isolated-completion-DHBefrzg.js} +7 -4
- package/dist/launch-args-RXQwn8zV.js +90 -0
- package/dist/{managed-binary-DcpnJF9x.js → managed-binary-DrjjRRUD.js} +4 -103
- package/dist/managed-thread-store-D1t5jh3G.js +66 -0
- package/dist/media-understanding-provider.js +4 -1
- package/dist/{model-catalog-DT5vo6qo.js → model-catalog-B_6M04Wo.js} +6 -5
- package/dist/{models-CcrgSMQR.js → models-P9k2qAof.js} +3 -3
- package/dist/native-execution-policy-umd0tgh4.js +128 -0
- package/dist/{native-subagent-monitor-B3bvQGcg.js → native-subagent-monitor-BbCUKRwC.js} +69 -42
- package/dist/node-cli-sessions-rj0ysJwM.js +527 -0
- package/dist/{node-exec-server.runtime-nfbUOtUB.js → node-exec-server.runtime-BY_ctYnT.js} +53 -22
- package/dist/plan-BMJdMOEF.js +711 -0
- package/dist/plugin-activation-BQK-f5sV.js +133 -0
- package/dist/{thread-resume-BLgqkUc1.js → plugin-app-cache-key-CdSQzWyX.js} +4 -52
- package/dist/{plugin-approval-roundtrip-aQVdyL5g.js → plugin-approval-roundtrip-DeW95wB5.js} +1 -1
- package/dist/plugin-inventory-CoRCzWW4.js +325 -0
- package/dist/plugin-marketplace-discovery-3akBizzF.js +134 -0
- package/dist/{plugin-metadata-cache-BwCLTY_U.js → plugin-metadata-cache-DgNfRAGA.js} +13 -9
- package/dist/protocol-CAAcVIKF.js +275 -0
- package/dist/{provider-capabilities-BpG9Ltc5.js → provider-capabilities-W4tfK5Y5.js} +2 -2
- package/dist/{rate-limits-Fx_l4eNa.js → rate-limits-Bqnx1N4z.js} +1 -1
- package/dist/request-CGvGOpeR.js +198 -0
- package/dist/{run-attempt-BzthFQSM.js → run-attempt-DwKds3DN.js} +589 -373
- package/dist/{runtime-artifact-Bh_gf6-t.js → runtime-artifact-T-NwqeSH.js} +27 -27
- package/dist/sandbox-guard-BcT66fWy.js +165 -0
- package/dist/{session-binding-4Ki04sW-.js → session-binding-CKSepwIC.js} +29 -47
- package/dist/{session-binding-record-CyaXZvTe.js → session-binding-record-CaZjYwNS.js} +11 -25
- package/dist/session-catalog-HaDcp7Sv.js +1533 -0
- package/dist/session-catalog-adoption-BKLtSrwi.js +251 -0
- package/dist/session-catalog-archive-D0i2pGj2.js +56 -0
- package/dist/session-catalog-home-id-D7-aLiNt.js +190 -0
- package/dist/session-catalog-node-adoption-BUuDYY8R.js +182 -0
- package/dist/session-catalog-node-continue-CBtc4wkI.js +238 -0
- package/dist/session-catalog-parsing-CdD3JhdM.js +280 -0
- package/dist/session-catalog-provenance-DkJHo735.js +124 -0
- package/dist/{session-cli-BjLhpmS1.js → session-cli-CbgaHh0f.js} +3 -2
- package/dist/{session-history-DWmMqiqW.js → session-history-Cz-tOOYj.js} +6 -3
- package/dist/{session-upstream-marker-DReTpGz6.js → session-history-import-DFN7sWRU.js} +5 -50
- package/dist/{session-history-read-LHldwvyh.js → session-history-read-cxPUxyVV.js} +21 -7
- package/dist/session-history-worker-runtime.js +18 -6
- package/dist/{session-history.worker-zZVcx0ME.js → session-history.worker-CNEvGaU5.js} +58 -51
- package/dist/session-history.worker.js +1 -1
- package/dist/{session-initialization-BCFVnLL4.js → session-initialization-Jo86C60I.js} +2 -2
- package/dist/{session-permission-policy-BaueHmSj.js → session-permission-policy-B22InTp_.js} +4 -7
- package/dist/{session-retirement-DNdmYdFc.js → session-retirement-BSNG_mhf.js} +6 -5
- package/dist/session-upstream-marker-D15C9NHp.js +46 -0
- package/dist/{settled-turn-context-BOM3Y1pl.js → settled-turn-context-Du6gdUDd.js} +9 -9
- package/dist/{settled-turn-finalizer-BI-b1sry.js → settled-turn-finalizer-BuLUrZl2.js} +7 -6
- package/dist/shared-client-CVhez2Uo.js +2911 -0
- package/dist/{side-question-B6DWAw1A.js → side-question-DLbr2vUU.js} +64 -169
- package/dist/source-Da-h6f7e.js +518 -0
- package/dist/thread-archive-guard-D1bP04Tf.js +53 -0
- package/dist/{thread-lifecycle-DPK30jad.js → thread-lifecycle-D1pzRwHB.js} +112 -616
- package/dist/{thread-ownership-CbucAmmp.js → thread-ownership-D6oASVRu.js} +13 -15
- package/dist/thread-policy-D8kI7yAO.js +54 -0
- package/dist/thread-resume-T5cveyxA.js +52 -0
- package/dist/timeout-BVw8aaM1.js +33 -0
- package/dist/{transcript-mirror-attestation-Byl34PC-.js → transcript-mirror-attestation-DibE0krH.js} +17 -4
- package/dist/{transcript-mirror-_njEB84z.js → transcript-mirror-t5TOccct.js} +50 -260
- package/dist/{transport-stdio-CzTngV0j.js → transport-stdio-BGjHoYLr.js} +73 -43
- package/dist/{upstream-session-fork-1fwbNKzQ.js → upstream-session-fork-De-sLJ2r.js} +26 -18
- package/dist/{usage-i9fv5-4m.js → usage-CPPTmBvZ.js} +4 -3
- package/dist/version-omm6IPI3.js +12 -0
- package/dist/{web-search-provider.runtime-DKQn67A7.js → web-search-provider.runtime-CSVgQL0w.js} +3 -3
- package/openclaw.plugin.json +22 -1
- package/package.json +4 -4
- package/dist/request-C8H22rPi.js +0 -475
- package/dist/session-catalog-B47uwekb.js +0 -3272
- package/dist/shared-client-CKhX2kFt.js +0 -7505
- package/dist/thread-policy-CTalhWFy.js +0 -105
- package/dist/{auth-binding-Ds_QVm-X.js → auth-binding-Co2Vfcf_.js} +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { a as formatCodexDisplayText } from "./command-formatters-DeTfrapr.js";
|
|
2
|
+
import { n as describeControlFailure } from "./capabilities-BeqLPbtM.js";
|
|
3
|
+
//#region extensions/codex/src/command-dispatch.ts
|
|
4
|
+
/** Dispatches a `/codex` command to the lazily loaded handler. */
|
|
5
|
+
async function handleCodexCommand(ctx, options) {
|
|
6
|
+
const { loadSubcommandHandler, resolvePluginConfig, ...subcommandOptions } = options;
|
|
7
|
+
try {
|
|
8
|
+
return await (loadSubcommandHandler ? await loadSubcommandHandler() : await loadDefaultCodexSubcommandHandler())(ctx, {
|
|
9
|
+
...subcommandOptions,
|
|
10
|
+
pluginConfig: resolvePluginConfig?.() ?? subcommandOptions.pluginConfig
|
|
11
|
+
});
|
|
12
|
+
} catch (error) {
|
|
13
|
+
return { text: `Codex command failed: ${formatCodexDisplayText(describeControlFailure(error))}` };
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function loadDefaultCodexSubcommandHandler() {
|
|
17
|
+
const { handleCodexSubcommand } = await import("./command-handlers-BfIsJEuA.js");
|
|
18
|
+
return handleCodexSubcommand;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { handleCodexCommand };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as summarizeCodexRateLimits, o as summarizeCodexAccountRateLimits, r as hasCodexRateLimitSnapshots } from "./rate-limits-
|
|
1
|
+
import { o as isJsonObject } from "./protocol-CAAcVIKF.js";
|
|
2
|
+
import { c as summarizeCodexRateLimits, o as summarizeCodexAccountRateLimits, r as hasCodexRateLimitSnapshots } from "./rate-limits-Bqnx1N4z.js";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
//#region extensions/codex/src/command-formatters.ts
|
|
5
5
|
/**
|
|
@@ -1,33 +1,43 @@
|
|
|
1
1
|
import { m as CODEX_PLUGINS_MARKETPLACE_NAME, n as isCodexFastServiceTier } from "./config-utils-C57JiJrU.js";
|
|
2
|
-
import { l as sessionBindingIdentity,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { a as rollbackCodexAppServerBindingSubscription, c as withExclusiveCodexAppServerThread, i as retireCodexConversationThreadBinding, l as isIncognitoSessionKey, n as releaseCodexAppServerBindingSubscription, r as retainCodexAppServerBindingSubscription, s as withCodexConversationThreadActivity, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-CbucAmmp.js";
|
|
11
|
-
import { r as assertCodexSupervisionThreadLineage, s as resolveCodexBindingAppServerConnection } from "./thread-policy-CTalhWFy.js";
|
|
12
|
-
import { c as resolveCodexNativeSandboxBlock, s as resolveCodexNativeExecutionBlock } from "./request-C8H22rPi.js";
|
|
13
|
-
import { t as CODEX_CONTROL_METHODS } from "./capabilities-B1mgvpP8.js";
|
|
14
|
-
import { s as summarizeCodexAccountUsage } from "./rate-limits-Fx_l4eNa.js";
|
|
15
|
-
import { a as formatCodexDisplayText, c as formatComputerUseStatus, d as formatSkills, f as formatThreads, i as formatAccount, l as formatList, n as buildHelp, o as formatCodexStatus, r as escapeCodexChatText, s as formatCodexTextForDisplay, t as CODEX_RESUME_SAFE_THREAD_ID_PATTERN, u as formatModels } from "./command-formatters-DSbGMXA0.js";
|
|
16
|
-
import { _ as hasCodexAdminScope, a as parseCodexPermissionsModeArg, c as setCodexConversationModel, d as stopCodexConversationTurn, g as canMutateCodexHost, h as CODEX_NATIVE_EXECUTION_AUTH_ERROR, i as parseCodexFastModeArg, l as setCodexConversationPermissions, m as CODEX_HOST_INSPECTION_AUTH_ERROR, n as parseCodexPluginMarketplaceId, o as readCodexConversationActiveTurn, p as CODEX_FULL_PERMISSIONS_AUTH_ERROR, r as formatPermissionsMode, s as setCodexConversationFastMode, t as discoverCodexMarketplacePlugins, u as steerCodexConversationTurn } from "./plugin-marketplace-discovery-B7gHXJ3d.js";
|
|
2
|
+
import { l as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, r as bindingStoreKey } from "./session-binding-record-CaZjYwNS.js";
|
|
3
|
+
import { o as isJsonObject } from "./protocol-CAAcVIKF.js";
|
|
4
|
+
import { _ as assertCodexThreadAcceptsDirectInput, y as assertCodexThreadResumeResponse } from "./client-BEKu4yDx.js";
|
|
5
|
+
import { s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-Kq6oerr6.js";
|
|
6
|
+
import { r as withCodexConversationThreadActivity, t as isIncognitoSessionKey } from "./incognito-session-uhrBF6wJ.js";
|
|
7
|
+
import { a as CODEX_NATIVE_EXECUTION_AUTH_ERROR, i as CODEX_HOST_INSPECTION_AUTH_ERROR, n as parseCodexPluginMarketplaceId, o as canMutateCodexHost, r as CODEX_FULL_PERMISSIONS_AUTH_ERROR, s as hasCodexAdminScope, t as discoverCodexMarketplacePlugins } from "./plugin-marketplace-discovery-3akBizzF.js";
|
|
8
|
+
import { s as summarizeCodexAccountUsage } from "./rate-limits-Bqnx1N4z.js";
|
|
9
|
+
import { a as formatCodexDisplayText, c as formatComputerUseStatus, d as formatSkills, f as formatThreads, i as formatAccount, l as formatList, n as buildHelp, o as formatCodexStatus, r as escapeCodexChatText, s as formatCodexTextForDisplay, t as CODEX_RESUME_SAFE_THREAD_ID_PATTERN, u as formatModels } from "./command-formatters-DeTfrapr.js";
|
|
17
10
|
import { i as readCodexConversationBindingData, n as createCodexCliNodeConversationBindingData, o as resolveCodexDefaultWorkspaceDir, r as createCodexConversationBindingData } from "./conversation-binding-data-BiodpIzq.js";
|
|
18
|
-
import {
|
|
19
|
-
import { i as
|
|
11
|
+
import { t as CODEX_CONTROL_METHODS } from "./capabilities-BeqLPbtM.js";
|
|
12
|
+
import { i as formatCodexCliSessions } from "./node-cli-sessions-rj0ysJwM.js";
|
|
13
|
+
import { r as buildCodexPluginAppCacheKey, s as defaultCodexAppInventoryCache } from "./plugin-app-cache-key-CdSQzWyX.js";
|
|
14
|
+
import "./config-JDfTI4VI.js";
|
|
15
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-BWf6JLWG.js";
|
|
16
|
+
import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-QqgcPCgk.js";
|
|
17
|
+
import { i as resolveCodexAppServerAuthProfileIdForAgent, n as normalizeCodexAppServerBindingModelProvider } from "./auth-profile-CwzO4_RG.js";
|
|
18
|
+
import { L as hasCodexAppServerLiveThread, P as consumeCodexAppServerLiveThread, X as resolveCodexAppServerAuthAccountCacheKey, c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-CVhez2Uo.js";
|
|
19
|
+
import { a as closeCodexStartupClientBestEffort } from "./attempt-client-cleanup-D6cR54TV.js";
|
|
20
|
+
import { t as listAllCodexAppServerModels } from "./models-P9k2qAof.js";
|
|
21
|
+
import { r as isOpenAiCuratedMarketplaceName } from "./plugin-inventory-CoRCzWW4.js";
|
|
22
|
+
import { n as refreshCodexPluginRuntimeState } from "./plugin-activation-BQK-f5sV.js";
|
|
23
|
+
import { n as createCodexSessionGenerationSupersededError, o as resolveCodexSessionBinding } from "./session-binding-CKSepwIC.js";
|
|
24
|
+
import { r as assertCodexSupervisionThreadLineage } from "./thread-policy-D8kI7yAO.js";
|
|
25
|
+
import { a as rollbackCodexAppServerBindingSubscription, i as retireCodexConversationThreadBinding, n as releaseCodexAppServerBindingSubscription, r as retainCodexAppServerBindingSubscription, s as withExclusiveCodexAppServerThread, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-D6oASVRu.js";
|
|
26
|
+
import { n as resolveCodexNativeSandboxBlock, t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-BcT66fWy.js";
|
|
27
|
+
import { i as readCodexComputerUseStatus, r as installCodexComputerUse, t as defaultCodexPluginMetadataCache } from "./plugin-metadata-cache-DgNfRAGA.js";
|
|
28
|
+
import { a as safeCodexControlRequest, i as requestOptions, r as readCodexStatusProbes, t as codexControlRequest } from "./command-rpc-BMqRQOFX.js";
|
|
29
|
+
import { a as setCodexConversationFastMode, c as steerCodexConversationTurn, i as readCodexConversationActiveTurn, l as stopCodexConversationTurn, n as parseCodexFastModeArg, o as setCodexConversationModel, r as parseCodexPermissionsModeArg, s as setCodexConversationPermissions, t as formatPermissionsMode } from "./conversation-control-CUCrSIQI.js";
|
|
20
30
|
import { normalizeOptionalString, normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
21
31
|
import crypto from "node:crypto";
|
|
22
32
|
import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
23
|
-
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
24
33
|
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
34
|
+
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
35
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
25
36
|
import { isDeepStrictEqual } from "node:util";
|
|
26
37
|
import { ensureAuthProfileStore, resolveAgentDir as resolveAgentDir$1, resolveAuthProfileEligibility, resolveProfileUnusableUntilForDisplay } from "openclaw/plugin-sdk/agent-runtime";
|
|
27
|
-
import { findNormalizedProviderValue, resolveAuthProfileOrder } from "openclaw/plugin-sdk/provider-auth";
|
|
28
|
-
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
29
|
-
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
30
38
|
import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
39
|
+
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
40
|
+
import { findNormalizedProviderValue, resolveAuthProfileOrder } from "openclaw/plugin-sdk/provider-auth";
|
|
31
41
|
import { MODEL_SELECTION_LOCKED_MESSAGE, isModelSelectionLocked, resolvePersistedSessionRuntimeId } from "openclaw/plugin-sdk/model-session-runtime";
|
|
32
42
|
//#region extensions/codex/src/command-account.ts
|
|
33
43
|
const OPENAI_PROVIDER_ID = "openai";
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
+
import { o as isJsonObject } from "./protocol-CAAcVIKF.js";
|
|
3
|
+
import { n as describeControlFailure, t as CODEX_CONTROL_METHODS } from "./capabilities-BeqLPbtM.js";
|
|
4
|
+
import { i as requestCodexAppServerJson, o as withCodexAppServerJsonClient } from "./request-CGvGOpeR.js";
|
|
5
|
+
import "./config-JDfTI4VI.js";
|
|
6
|
+
import { n as resolveCodexAppServerRuntimeOptions, r as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-runtime-BWf6JLWG.js";
|
|
7
|
+
import { n as prepareCodexAppServerAuthBinding } from "./auth-binding-Co2Vfcf_.js";
|
|
8
|
+
import { a as resolveCodexAppServerAuthProfileStore, r as resolveCodexAppServerAuthProfileId } from "./auth-profile-CwzO4_RG.js";
|
|
9
|
+
import { Z as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-CVhez2Uo.js";
|
|
10
|
+
import { a as closeCodexStartupClientBestEffort } from "./attempt-client-cleanup-D6cR54TV.js";
|
|
11
|
+
import { n as listCodexAppServerModels } from "./models-P9k2qAof.js";
|
|
12
|
+
import { n as createCodexSessionGenerationSupersededError } from "./session-binding-CKSepwIC.js";
|
|
13
|
+
import { t as resumeCodexAppServerThread } from "./thread-resume-T5cveyxA.js";
|
|
14
|
+
import { resolveAgentDir, resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
15
|
+
import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
16
|
+
import { prepareAgentRuntimeAuth } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
17
|
+
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
18
|
+
import { resolveSessionModelRef } from "openclaw/plugin-sdk/model-session-runtime";
|
|
19
|
+
import { resolveApiKeyForProvider } from "openclaw/plugin-sdk/provider-auth-runtime";
|
|
20
|
+
//#region extensions/codex/src/command-rpc.ts
|
|
21
|
+
var command_rpc_exports = /* @__PURE__ */ __exportAll({
|
|
22
|
+
codexControlRequest: () => codexControlRequest,
|
|
23
|
+
readCodexStatusProbes: () => readCodexStatusProbes,
|
|
24
|
+
requestOptions: () => requestOptions,
|
|
25
|
+
safeCodexControlRequest: () => safeCodexControlRequest
|
|
26
|
+
});
|
|
27
|
+
async function prepareControlAuth(options, startOptions) {
|
|
28
|
+
if (!options.onResponse) return {
|
|
29
|
+
authProfileId: options.authProfileId ?? void 0,
|
|
30
|
+
clientOptions: { authProfileId: options.authProfileId }
|
|
31
|
+
};
|
|
32
|
+
if (!options.config || !options.sessionKey || !options.sessionId) throw new Error("Codex control subscription requires admitted session authority.");
|
|
33
|
+
const config = options.config;
|
|
34
|
+
const { sessionAgentId } = resolveSessionAgentIdsStrict({
|
|
35
|
+
config,
|
|
36
|
+
sessionKey: options.sessionKey,
|
|
37
|
+
agentId: options.agentId
|
|
38
|
+
});
|
|
39
|
+
const agentDir = options.agentDir ?? resolveAgentDir(config, sessionAgentId);
|
|
40
|
+
const workspaceDir = resolveAgentWorkspaceDir(config, sessionAgentId);
|
|
41
|
+
const entry = getSessionEntry({
|
|
42
|
+
agentId: sessionAgentId,
|
|
43
|
+
storePath: options.storePath?.trim() || resolveStorePath(config.session?.store, { agentId: sessionAgentId }),
|
|
44
|
+
sessionKey: options.sessionKey,
|
|
45
|
+
hydrateSkillPromptRefs: false,
|
|
46
|
+
readConsistency: "latest"
|
|
47
|
+
});
|
|
48
|
+
if (entry?.sessionId !== options.sessionId) throw createCodexSessionGenerationSupersededError(options.sessionId);
|
|
49
|
+
if (options.authProfileId === null || startOptions.homeScope === "user") return {
|
|
50
|
+
authProfileId: options.authProfileId ?? void 0,
|
|
51
|
+
clientOptions: { authProfileId: options.authProfileId }
|
|
52
|
+
};
|
|
53
|
+
const model = resolveSessionModelRef(config, entry, sessionAgentId);
|
|
54
|
+
const authProfileId = entry?.authProfileOverride ?? options.authProfileId;
|
|
55
|
+
const store = resolveCodexAppServerAuthProfileStore({
|
|
56
|
+
agentDir,
|
|
57
|
+
config,
|
|
58
|
+
authProfileId
|
|
59
|
+
});
|
|
60
|
+
const { plan, attempts } = prepareAgentRuntimeAuth({
|
|
61
|
+
provider: model.provider,
|
|
62
|
+
modelId: model.model,
|
|
63
|
+
config,
|
|
64
|
+
agentDir,
|
|
65
|
+
workspaceDir,
|
|
66
|
+
authProfileStore: store,
|
|
67
|
+
sessionAuthProfileId: authProfileId,
|
|
68
|
+
sessionAuthProfileSource: entry?.authProfileOverrideSource,
|
|
69
|
+
harnessId: "codex",
|
|
70
|
+
harnessAuthBootstrap: "harness"
|
|
71
|
+
});
|
|
72
|
+
const route = plan.modelRoute;
|
|
73
|
+
const resolvedAuth = route ? await resolveApiKeyForProvider({
|
|
74
|
+
provider: route.provider,
|
|
75
|
+
modelId: route.modelId,
|
|
76
|
+
modelApi: route.api,
|
|
77
|
+
cfg: config,
|
|
78
|
+
agentDir,
|
|
79
|
+
workspaceDir,
|
|
80
|
+
store,
|
|
81
|
+
profileId: attempts[0]?.profileId,
|
|
82
|
+
lockedProfile: plan.forwardedAuthProfileSource === "user",
|
|
83
|
+
allowAuthProfileFallback: attempts[0]?.allowAuthProfileFallback,
|
|
84
|
+
skipSetupProviderFallback: true
|
|
85
|
+
}) : void 0;
|
|
86
|
+
const handoff = await resolveCodexAppServerPreparedAuthHandoff({
|
|
87
|
+
authRequirement: route?.authRequirement,
|
|
88
|
+
resolvedApiKey: resolvedAuth?.apiKey,
|
|
89
|
+
authProfileId: route ? plan.forwardedAuthProfileId : resolveCodexAppServerAuthProfileId({
|
|
90
|
+
authProfileId: plan.forwardedAuthProfileId,
|
|
91
|
+
store,
|
|
92
|
+
config
|
|
93
|
+
}),
|
|
94
|
+
authProfileStore: store,
|
|
95
|
+
agentDir,
|
|
96
|
+
homeScope: startOptions.homeScope ?? "agent",
|
|
97
|
+
config,
|
|
98
|
+
subscriptionProfileRequiredError: "Prepared Codex subscription route requires a forwarded OpenAI OAuth or token profile.",
|
|
99
|
+
subscriptionProfileUnusableError: "Prepared Codex subscription auth profile is unusable."
|
|
100
|
+
});
|
|
101
|
+
const binding = handoff.authProfileId ? await prepareCodexAppServerAuthBinding({
|
|
102
|
+
authProfileId: handoff.authProfileId,
|
|
103
|
+
authProfileStore: store,
|
|
104
|
+
agentDir,
|
|
105
|
+
config
|
|
106
|
+
}) : void 0;
|
|
107
|
+
return {
|
|
108
|
+
authProfileId: handoff.authProfileId,
|
|
109
|
+
clientOptions: {
|
|
110
|
+
...handoff.preparedAuth ? { preparedAuth: handoff.preparedAuth } : { authProfileId: handoff.authProfileId },
|
|
111
|
+
authRequirement: route?.authRequirement,
|
|
112
|
+
authProfileStore: binding?.authProfileStore ?? store,
|
|
113
|
+
authBindingFingerprint: binding?.fingerprint,
|
|
114
|
+
agentDir
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function requestOptions(pluginConfig, limit, config, agentDir) {
|
|
119
|
+
const runtime = resolveCodexAppServerRuntimeOptions({ pluginConfig });
|
|
120
|
+
return {
|
|
121
|
+
limit,
|
|
122
|
+
timeoutMs: runtime.requestTimeoutMs,
|
|
123
|
+
startOptions: runtime.start,
|
|
124
|
+
config,
|
|
125
|
+
agentDir
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
async function codexControlRequest(pluginConfig, method, requestParams, options = {}) {
|
|
129
|
+
const runtime = options.startOptions ? resolveCodexSupervisionAppServerRuntimeOptions({ pluginConfig }) : resolveCodexAppServerRuntimeOptions({ pluginConfig });
|
|
130
|
+
const startOptions = options.startOptions ?? runtime.start;
|
|
131
|
+
const auth = await prepareControlAuth(options, startOptions);
|
|
132
|
+
const controlRequestOptions = {
|
|
133
|
+
timeoutMs: options.timeoutMs ?? runtime.requestTimeoutMs,
|
|
134
|
+
assertCurrent: options.assertCurrent,
|
|
135
|
+
startOptions,
|
|
136
|
+
config: options.config,
|
|
137
|
+
sessionKey: options.sessionKey,
|
|
138
|
+
sessionId: options.sessionId,
|
|
139
|
+
agentDir: options.agentDir,
|
|
140
|
+
isolated: options.isolated,
|
|
141
|
+
...auth.clientOptions
|
|
142
|
+
};
|
|
143
|
+
if (options.onResponse || options.beforeRequest) return await withCodexAppServerJsonClient(controlRequestOptions, async (request, client, scope) => {
|
|
144
|
+
await options.beforeRequest?.(request, client, scope);
|
|
145
|
+
scope.assertCurrent();
|
|
146
|
+
let response;
|
|
147
|
+
if (method === "thread/resume") {
|
|
148
|
+
if (!isJsonObject(requestParams) || typeof requestParams.threadId !== "string") throw new Error("Codex thread/resume requires a thread id.");
|
|
149
|
+
response = await resumeCodexAppServerThread({
|
|
150
|
+
client,
|
|
151
|
+
request: {
|
|
152
|
+
...requestParams,
|
|
153
|
+
threadId: requestParams.threadId
|
|
154
|
+
},
|
|
155
|
+
requestResume: () => request({
|
|
156
|
+
method,
|
|
157
|
+
requestParams
|
|
158
|
+
}),
|
|
159
|
+
abandonClient: () => closeCodexStartupClientBestEffort(client)
|
|
160
|
+
});
|
|
161
|
+
} else response = await request({
|
|
162
|
+
method,
|
|
163
|
+
requestParams
|
|
164
|
+
});
|
|
165
|
+
await options.onResponse?.(response, client, {
|
|
166
|
+
authProfileId: auth.authProfileId,
|
|
167
|
+
assertCurrent: scope.assertCurrent
|
|
168
|
+
});
|
|
169
|
+
scope.assertCurrent();
|
|
170
|
+
return response;
|
|
171
|
+
});
|
|
172
|
+
return await requestCodexAppServerJson({
|
|
173
|
+
method,
|
|
174
|
+
requestParams,
|
|
175
|
+
...controlRequestOptions
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
async function safeCodexControlRequest(pluginConfig, method, requestParams, options = {}) {
|
|
179
|
+
return await safeValue(async () => await codexControlRequest(pluginConfig, method, requestParams, options));
|
|
180
|
+
}
|
|
181
|
+
async function safeCodexModelList(pluginConfig, limit, config, agentDir) {
|
|
182
|
+
return await safeValue(async () => await listCodexAppServerModels(requestOptions(pluginConfig, limit, config, agentDir)));
|
|
183
|
+
}
|
|
184
|
+
async function readCodexStatusProbes(pluginConfig, config, agentDir) {
|
|
185
|
+
const [models, account, limits, mcps, skills] = await Promise.all([
|
|
186
|
+
safeCodexModelList(pluginConfig, 20, config, agentDir),
|
|
187
|
+
safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.account, { refreshToken: false }, {
|
|
188
|
+
config,
|
|
189
|
+
agentDir
|
|
190
|
+
}),
|
|
191
|
+
safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.rateLimits, void 0, {
|
|
192
|
+
config,
|
|
193
|
+
agentDir
|
|
194
|
+
}),
|
|
195
|
+
safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.listMcpServers, { limit: 100 }, {
|
|
196
|
+
config,
|
|
197
|
+
agentDir
|
|
198
|
+
}),
|
|
199
|
+
safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.listSkills, {}, {
|
|
200
|
+
config,
|
|
201
|
+
agentDir
|
|
202
|
+
})
|
|
203
|
+
]);
|
|
204
|
+
return {
|
|
205
|
+
models,
|
|
206
|
+
account,
|
|
207
|
+
limits,
|
|
208
|
+
mcps,
|
|
209
|
+
skills
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
async function safeValue(read) {
|
|
213
|
+
try {
|
|
214
|
+
return {
|
|
215
|
+
ok: true,
|
|
216
|
+
value: await read()
|
|
217
|
+
};
|
|
218
|
+
} catch (error) {
|
|
219
|
+
return {
|
|
220
|
+
ok: false,
|
|
221
|
+
error: describeControlFailure(error)
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
//#endregion
|
|
226
|
+
export { safeCodexControlRequest as a, requestOptions as i, command_rpc_exports as n, readCodexStatusProbes as r, codexControlRequest as t };
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { l as sessionBindingIdentity } from "./session-binding-record-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { l as sessionBindingIdentity } from "./session-binding-record-CaZjYwNS.js";
|
|
2
|
+
import { o as isJsonObject } from "./protocol-CAAcVIKF.js";
|
|
3
|
+
import { u as isCodexAppServerPrewriteRequestCancellationError } from "./client-BEKu4yDx.js";
|
|
4
|
+
import { n as withCodexAppServerThreadMutation, t as isIncognitoSessionKey } from "./incognito-session-uhrBF6wJ.js";
|
|
5
|
+
import { r as CodexAppServerRpcError } from "./session-catalog-provenance-DkJHo735.js";
|
|
6
|
+
import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-QqgcPCgk.js";
|
|
7
|
+
import { P as consumeCodexAppServerLiveThread, W as retainCodexAppServerLiveThread, c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-CVhez2Uo.js";
|
|
8
|
+
import { _ as readCodexNotificationTurnId, a as closeCodexStartupClientBestEffort, c as isCodexNoActiveTurnInterruptError, d as unsubscribeCodexThreadBestEffort, g as readCodexNotificationThreadId, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-D6cR54TV.js";
|
|
9
|
+
import { s as readCodexNotificationItem } from "./attempt-notifications--H8zXR5-.js";
|
|
10
|
+
import { n as readCodexThreadContextSnapshot } from "./event-projector-usage-CIyrYYid.js";
|
|
11
|
+
import { o as resolveCodexSessionBinding, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-CKSepwIC.js";
|
|
12
|
+
import { r as assertCodexSupervisionThreadLineage } from "./thread-policy-D8kI7yAO.js";
|
|
13
|
+
import { t as resumeCodexAppServerThread } from "./thread-resume-T5cveyxA.js";
|
|
14
|
+
import { t as isSameCodexAppServerThreadOwner } from "./thread-ownership-D6oASVRu.js";
|
|
11
15
|
import { t as persistCodexContextCompactionActivity } from "./context-compaction-activity-CMla5FPJ.js";
|
|
16
|
+
import { t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-BcT66fWy.js";
|
|
12
17
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
13
18
|
import { resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
19
|
+
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
14
20
|
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
21
|
+
import { resolveAgentDir as resolveAgentDir$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
15
22
|
import { embeddedAgentLog, resolveCompactionTimeoutMs } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
16
|
-
import { resolveAgentDir as resolveAgentDir$2 } from "openclaw/plugin-sdk/agent-runtime";
|
|
17
23
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
18
|
-
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
19
24
|
import { createDedupeCache } from "openclaw/plugin-sdk/dedupe-runtime";
|
|
20
25
|
//#region extensions/codex/src/app-server/compact.ts
|
|
21
26
|
const warnedIgnoredCompactionOverrides = createDedupeCache({
|
|
@@ -345,7 +350,7 @@ async function compactCodexNativeThread(params, options) {
|
|
|
345
350
|
authProfileId: requestedAuthProfileId ?? binding.authProfileId,
|
|
346
351
|
pluginConfig: options.pluginConfig,
|
|
347
352
|
config,
|
|
348
|
-
agentDir: resolveAgentDir$
|
|
353
|
+
agentDir: resolveAgentDir$1(config, agentId)
|
|
349
354
|
});
|
|
350
355
|
} catch (error) {
|
|
351
356
|
return {
|
|
@@ -409,7 +414,7 @@ async function compactCodexNativeThread(params, options) {
|
|
|
409
414
|
forceKillDelayMs: 250
|
|
410
415
|
});
|
|
411
416
|
if (appServer.start.transport === "stdio") {
|
|
412
|
-
if (transportStopped) return;
|
|
417
|
+
if (transportStopped.exited) return;
|
|
413
418
|
throw new Error("failed to stop unconfirmed codex app-server process");
|
|
414
419
|
}
|
|
415
420
|
if (usesSupervisionConnection) throw new Error("cannot detach an unconfirmed supervised codex thread");
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { c as readExecAsk, f as readRecord, l as readExecSecurity } from "./config-utils-C57JiJrU.js";
|
|
2
|
+
import { p as canUseCodexModelBackedApprovalsReviewerForModel$1 } from "./config-options-jnIFvwxD.js";
|
|
3
|
+
import "./protocol-CAAcVIKF.js";
|
|
4
|
+
import "./config-runtime-BWf6JLWG.js";
|
|
5
|
+
import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
6
|
+
import { execPolicy } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
7
|
+
import { resolveExecApprovalsFromFile } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
8
|
+
import { resolveProviderIdForAuth } from "openclaw/plugin-sdk/provider-auth-aliases";
|
|
9
|
+
//#region extensions/codex/src/app-server/config-exec-approvals.ts
|
|
10
|
+
function resolveOpenClawExecPolicyFromConfig(params) {
|
|
11
|
+
const globalExec = readRecord(params.config?.tools?.exec);
|
|
12
|
+
const globalPolicy = applyOpenClawExecPolicyLayer(createDefaultOpenClawExecPolicy(), globalExec);
|
|
13
|
+
const agentId = params.agentId?.trim();
|
|
14
|
+
return applyOpenClawExecPolicyLayer(globalPolicy, agentId ? readRecord(resolveAgentConfig(params.config ?? {}, agentId)?.tools?.exec) : void 0);
|
|
15
|
+
}
|
|
16
|
+
function resolveOpenClawExecPolicyForCodexAppServer(params) {
|
|
17
|
+
if (params.permissionMode === "full") return {
|
|
18
|
+
...resolveOpenClawExecPolicyForMode("full"),
|
|
19
|
+
touched: true
|
|
20
|
+
};
|
|
21
|
+
const overridePolicy = applyOpenClawExecPolicyLayer(resolveOpenClawExecPolicyFromConfig({
|
|
22
|
+
config: params.config,
|
|
23
|
+
agentId: params.agentId
|
|
24
|
+
}), params.execOverrides);
|
|
25
|
+
return applyOpenClawExecApprovalFloors(overridePolicy, resolveOpenClawExecApprovalFloorsForCodexAppServer({
|
|
26
|
+
approvals: params.approvals,
|
|
27
|
+
agentId: params.agentId,
|
|
28
|
+
policy: overridePolicy
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
function createDefaultOpenClawExecPolicy() {
|
|
32
|
+
return {
|
|
33
|
+
...resolveOpenClawExecPolicyForMode("full"),
|
|
34
|
+
touched: false
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function applyOpenClawExecPolicyLayer(base, exec) {
|
|
38
|
+
if (!exec) return base;
|
|
39
|
+
const mode = readExecMode(exec.mode);
|
|
40
|
+
if (mode !== void 0) return {
|
|
41
|
+
...resolveOpenClawExecPolicyForMode(mode),
|
|
42
|
+
touched: true
|
|
43
|
+
};
|
|
44
|
+
const security = readExecSecurity(exec.security);
|
|
45
|
+
const ask = readExecAsk(exec.ask);
|
|
46
|
+
if (security === void 0 && ask === void 0) return base;
|
|
47
|
+
const nextSecurity = security ?? base.security;
|
|
48
|
+
const nextAsk = ask ?? base.ask;
|
|
49
|
+
return {
|
|
50
|
+
mode: execPolicy.resolveExecModePolicy({
|
|
51
|
+
security: nextSecurity,
|
|
52
|
+
ask: nextAsk
|
|
53
|
+
}).mode,
|
|
54
|
+
security: nextSecurity,
|
|
55
|
+
ask: nextAsk,
|
|
56
|
+
touched: true
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function resolveOpenClawExecApprovalFloorsForCodexAppServer(params) {
|
|
60
|
+
if (!params.approvals) return;
|
|
61
|
+
return resolveExecApprovalsFromFile({
|
|
62
|
+
file: params.approvals,
|
|
63
|
+
agentId: params.agentId,
|
|
64
|
+
overrides: {
|
|
65
|
+
security: params.policy.security,
|
|
66
|
+
ask: params.policy.ask
|
|
67
|
+
}
|
|
68
|
+
}).agent;
|
|
69
|
+
}
|
|
70
|
+
function applyOpenClawExecApprovalFloors(base, approvalFloors) {
|
|
71
|
+
if (!approvalFloors) return base;
|
|
72
|
+
const nextSecurity = approvalFloors.security ? execPolicy.minSecurity(base.security, approvalFloors.security) : base.security;
|
|
73
|
+
const nextAsk = approvalFloors.ask ? execPolicy.maxAsk(base.ask, approvalFloors.ask) : base.ask;
|
|
74
|
+
if (nextSecurity === base.security && nextAsk === base.ask) return base;
|
|
75
|
+
return {
|
|
76
|
+
mode: execPolicy.resolveExecModePolicy({
|
|
77
|
+
security: nextSecurity,
|
|
78
|
+
ask: nextAsk
|
|
79
|
+
}).mode,
|
|
80
|
+
security: nextSecurity,
|
|
81
|
+
ask: nextAsk,
|
|
82
|
+
touched: true
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function resolveOpenClawExecPolicyForMode(mode) {
|
|
86
|
+
const { security, ask } = execPolicy.resolveExecModePolicy({
|
|
87
|
+
mode,
|
|
88
|
+
security: "full",
|
|
89
|
+
ask: "off"
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
mode,
|
|
93
|
+
security,
|
|
94
|
+
ask
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function readExecMode(value) {
|
|
98
|
+
return value === "deny" || value === "allowlist" || value === "ask" || value === "auto" || value === "full" ? value : void 0;
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region extensions/codex/src/app-server/config-reviewer.ts
|
|
102
|
+
function canUseCodexModelBackedApprovalsReviewerForModel(params) {
|
|
103
|
+
return canUseCodexModelBackedApprovalsReviewerForModel$1(params, resolveProviderIdForAuth);
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { resolveOpenClawExecPolicyForCodexAppServer as n, canUseCodexModelBackedApprovalsReviewerForModel as t };
|