@openclaw/codex 2026.7.2-beta.5 → 2026.7.2-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/{app-server-policy-BmDgseo_.js → app-server-policy-BSaO2JIT.js} +1 -1
  2. package/dist/{attempt-notifications-CMR2_fmR.js → attempt-notifications-AP-a-Q5k.js} +1 -1
  3. package/dist/{bounded-turn-FEbUXoYT.js → bounded-turn-D2ZAgZVz.js} +29 -22
  4. package/dist/{capabilities-BHRSI6Cn.js → capabilities-BFDTVYr4.js} +1 -1
  5. package/dist/cli-metadata.js +1 -1
  6. package/dist/{command-formatters-ico4ZFnk.js → command-formatters-C336eRVS.js} +2 -2
  7. package/dist/{command-handlers-CRmnwI2N.js → command-handlers-DAHUSry9.js} +12 -12
  8. package/dist/{compact-dEN49UH6.js → compact-D_uvHurS.js} +5 -5
  9. package/dist/{computer-use-BjGylO-E.js → computer-use-CYEc8U3w.js} +111 -113
  10. package/dist/{conversation-control-DE7d9DOj.js → conversation-control-xsIeXbo4.js} +6 -6
  11. package/dist/doctor-contract-api.js +1 -1
  12. package/dist/{dynamic-tools-LIt9ojep.js → dynamic-tools-D2gYkSBO.js} +438 -51
  13. package/dist/effective-mcp-catalog-Bbd98Inw.js +114 -0
  14. package/dist/{event-projector-usage-tvgb1NCX.js → event-projector-usage-Xp4AlR2k.js} +20 -3
  15. package/dist/harness.js +13 -9
  16. package/dist/index.js +131 -108
  17. package/dist/media-understanding-provider.js +1 -1
  18. package/dist/{models-BA01NEez.js → models-BBMKU4jA.js} +2 -2
  19. package/dist/{notification-correlation-Bj_Ak_jI.js → notification-correlation-CU6_AnOb.js} +3 -3
  20. package/dist/{plugin-app-cache-key-DSXX-rXO.js → plugin-app-cache-key-DztPafOA.js} +132 -39
  21. package/dist/{rate-limits-S_PXs0ul.js → rate-limits-CU-gVCCS.js} +1 -1
  22. package/dist/{request-CXpPennK.js → request-qKh331yu.js} +3 -3
  23. package/dist/{run-attempt-C5GTPJOE.js → run-attempt-CY9WlDLc.js} +677 -199
  24. package/dist/{runtime-artifact-C2ITXdhM.js → runtime-artifact-CmtG_t1L.js} +90 -24
  25. package/dist/{sandbox-guard-D1Wky__S.js → sandbox-guard-NuhpXmPB.js} +4 -0
  26. package/dist/{session-binding-DlVQ-Pxs.js → session-binding-BXpo9ymA.js} +60 -7
  27. package/dist/{session-catalog-CP2oCcEb.js → session-catalog-DyOgR4WH.js} +268 -44
  28. package/dist/{session-cli-CqZ0Fp2a.js → session-cli-2PZaFLRh.js} +1 -1
  29. package/dist/{session-upstream-marker-QE-m5QFG.js → session-upstream-marker-B6U7tLw5.js} +1 -1
  30. package/dist/{settled-turn-finalizer-CA_2QXIE.js → settled-turn-finalizer-CXY2Z9dT.js} +19 -6
  31. package/dist/{shared-client-BVKE40c-.js → shared-client-DTbvH-XV.js} +166 -49
  32. package/dist/{side-question-CO12sHxo.js → side-question-_ulBk1AL.js} +10 -10
  33. package/dist/{thread-lifecycle-DRg_FdzC.js → thread-lifecycle-DF53ogiA.js} +968 -214
  34. package/dist/{protocol-validators-Dm4eXZmt.js → transcript-mirror-DzsdNCf5.js} +589 -2
  35. package/dist/{upstream-session-fork-_Vrz4WJr.js → upstream-session-fork-Dy4Xvuoj.js} +3 -3
  36. package/dist/{usage-UpVbdX5G.js → usage-CQ6GhD5-.js} +3 -3
  37. package/dist/{web-search-provider.runtime-CaQMYDbp.js → web-search-provider.runtime-CCFhg2z5.js} +3 -3
  38. package/package.json +6 -7
  39. package/dist/attempt-client-cleanup-Ia52yRWc.js +0 -127
  40. package/dist/realtime-voice-api-BPcA1uN9.js +0 -494
  41. package/dist/realtime-voice-api.js +0 -2
  42. package/dist/transcript-mirror-uKA-A4tB.js +0 -550
@@ -0,0 +1,114 @@
1
+ import { d as retainSharedCodexAppServerClientByInstanceId } from "./shared-client-DTbvH-XV.js";
2
+ import { d as sessionBindingIdentity } from "./session-binding-BXpo9ymA.js";
3
+ import { assignMcpCatalogSafeServerNames } from "openclaw/plugin-sdk/agent-harness-runtime";
4
+ //#region extensions/codex/src/app-server/effective-mcp-catalog.ts
5
+ const MCP_STATUS_PAGE_SIZE = 100;
6
+ const MCP_STATUS_MAX_PAGES = 100;
7
+ function asRecord(value) {
8
+ return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
9
+ }
10
+ function readString(value) {
11
+ return typeof value === "string" && value.trim() ? value.trim() : void 0;
12
+ }
13
+ function catalogTool(params) {
14
+ const raw = asRecord(params.raw);
15
+ const description = readString(raw?.description);
16
+ return {
17
+ serverName: params.serverName,
18
+ safeServerName: params.safeServerName,
19
+ toolName: params.toolName,
20
+ ...readString(raw?.title) ? { title: readString(raw?.title) } : {},
21
+ ...description ? { description } : {},
22
+ inputSchema: asRecord(raw?.inputSchema) ?? { type: "object" },
23
+ fallbackDescription: description ?? params.toolName,
24
+ ...params.deniedBySession ? { deniedBySession: true } : {}
25
+ };
26
+ }
27
+ /** Converts Codex's thread-scoped status response into OpenClaw's MCP catalog shape. */
28
+ function buildCodexEffectiveMcpCatalog(statuses, toolOverrides) {
29
+ const orderedStatuses = [...new Map(statuses.map((status) => [status.name, status])).values()].toSorted((left, right) => left.name.localeCompare(right.name));
30
+ const safeNames = assignMcpCatalogSafeServerNames(orderedStatuses.map((status) => status.name));
31
+ const serverEntries = [];
32
+ const tools = [];
33
+ const sessionDeniedTools = [];
34
+ for (const status of orderedStatuses) {
35
+ const safeServerName = safeNames.get(status.name) ?? status.name;
36
+ const denialMap = toolOverrides?.mcpToolsDeny;
37
+ const deniedNames = new Set(denialMap && Object.hasOwn(denialMap, status.name) ? denialMap[status.name] : []);
38
+ const observedNames = /* @__PURE__ */ new Set();
39
+ for (const [toolName, raw] of Object.entries(status.tools).toSorted(([left], [right]) => left.localeCompare(right))) {
40
+ observedNames.add(toolName);
41
+ const deniedBySession = deniedNames.has(toolName) ? true : void 0;
42
+ const tool = catalogTool({
43
+ serverName: status.name,
44
+ safeServerName,
45
+ toolName,
46
+ raw,
47
+ ...deniedBySession ? { deniedBySession } : {}
48
+ });
49
+ if (deniedBySession) sessionDeniedTools.push(tool);
50
+ else tools.push(tool);
51
+ }
52
+ for (const toolName of [...deniedNames].toSorted()) {
53
+ if (observedNames.has(toolName)) continue;
54
+ sessionDeniedTools.push(catalogTool({
55
+ serverName: status.name,
56
+ safeServerName,
57
+ toolName,
58
+ deniedBySession: true
59
+ }));
60
+ }
61
+ serverEntries.push([status.name, {
62
+ serverName: status.name,
63
+ safeServerName,
64
+ launchSummary: "Codex native MCP connection",
65
+ toolCount: observedNames.size + [...deniedNames].filter((name) => !observedNames.has(name)).length
66
+ }]);
67
+ }
68
+ return {
69
+ version: 1,
70
+ generatedAt: Date.now(),
71
+ servers: Object.fromEntries(serverEntries),
72
+ tools,
73
+ ...sessionDeniedTools.length > 0 ? { sessionDeniedTools } : {}
74
+ };
75
+ }
76
+ async function listCodexMcpServerStatuses(client, threadId) {
77
+ const statuses = [];
78
+ const seenCursors = /* @__PURE__ */ new Set();
79
+ let cursor;
80
+ for (let page = 0; page < MCP_STATUS_MAX_PAGES; page += 1) {
81
+ const response = await client.request("mcpServerStatus/list", {
82
+ threadId,
83
+ detail: "toolsAndAuthOnly",
84
+ limit: MCP_STATUS_PAGE_SIZE,
85
+ ...cursor ? { cursor } : {}
86
+ });
87
+ statuses.push(...response.data);
88
+ cursor = response.nextCursor;
89
+ if (!cursor) return statuses;
90
+ if (seenCursors.has(cursor)) throw new Error("Codex mcpServerStatus/list repeated its pagination cursor");
91
+ seenCursors.add(cursor);
92
+ }
93
+ throw new Error("Codex mcpServerStatus/list exceeded the bounded page limit");
94
+ }
95
+ /** Loads MCP inventory only from the already-bound Codex process and thread. */
96
+ async function loadCodexEffectiveMcpCatalog(params, options) {
97
+ const binding = await options.bindingStore.read(sessionBindingIdentity({
98
+ agentId: params.agentId,
99
+ sessionId: params.sessionId,
100
+ sessionKey: params.sessionKey,
101
+ config: params.config
102
+ }));
103
+ if (!binding?.clientId) return;
104
+ const retained = retainSharedCodexAppServerClientByInstanceId(binding.clientId);
105
+ if (!retained) return;
106
+ try {
107
+ const allowedServerNames = new Set(params.mcpServerNames);
108
+ return buildCodexEffectiveMcpCatalog((await listCodexMcpServerStatuses(retained.client, binding.threadId)).filter((status) => allowedServerNames.has(status.name)), params.toolOverrides);
109
+ } finally {
110
+ retained.release();
111
+ }
112
+ }
113
+ //#endregion
114
+ export { loadCodexEffectiveMcpCatalog };
@@ -1,5 +1,5 @@
1
- import { V as isJsonObject } from "./shared-client-BVKE40c-.js";
2
- import { it as readNonNegativeInteger, ot as readNumber } from "./thread-lifecycle-DRg_FdzC.js";
1
+ import { W as isJsonObject } from "./shared-client-DTbvH-XV.js";
2
+ import { at as readNonNegativeInteger, ct as readString, st as readNumber } from "./thread-lifecycle-DF53ogiA.js";
3
3
  import { normalizeUsage } from "openclaw/plugin-sdk/agent-harness-runtime";
4
4
  //#region extensions/codex/src/app-server/event-projector-usage.ts
5
5
  function readTokenCount(record, key) {
@@ -65,5 +65,22 @@ function normalizeCodexResponseTokenUsage(record) {
65
65
  }
66
66
  };
67
67
  }
68
+ var CodexResponseCompletionProjection = class {
69
+ constructor() {
70
+ this.responseIds = /* @__PURE__ */ new Set();
71
+ }
72
+ get modelIterations() {
73
+ return this.responseIds.size;
74
+ }
75
+ clear() {
76
+ this.usage = void 0;
77
+ }
78
+ record(params) {
79
+ const responseId = readString(params, "responseId");
80
+ if (responseId) this.responseIds.add(responseId);
81
+ const usage = isJsonObject(params.usage) ? params.usage : void 0;
82
+ this.usage = usage ? normalizeCodexResponseTokenUsage(usage) : void 0;
83
+ }
84
+ };
68
85
  //#endregion
69
- export { projectCodexThreadUsageUpdate as n, normalizeCodexResponseTokenUsage as t };
86
+ export { normalizeCodexResponseTokenUsage as n, projectCodexThreadUsageUpdate as r, CodexResponseCompletionProjection as t };
package/dist/harness.js CHANGED
@@ -35,7 +35,7 @@ function createCodexAppServerAgentHarness(options) {
35
35
  ...sessionCatalogControl && sessionRuntime ? { sessionFork: {
36
36
  upstreamKinds: ["codex-app-server"],
37
37
  fork: async (params) => {
38
- const { forkCodexUpstreamSession } = await import("./upstream-session-fork-_Vrz4WJr.js");
38
+ const { forkCodexUpstreamSession } = await import("./upstream-session-fork-Dy4Xvuoj.js");
39
39
  return await forkCodexUpstreamSession(params, {
40
40
  bindingStore: options.bindingStore,
41
41
  control: sessionCatalogControl,
@@ -50,13 +50,17 @@ function createCodexAppServerAgentHarness(options) {
50
50
  return fingerprintCodexAppServerAuthBinding(params);
51
51
  } },
52
52
  runtimeArtifact: { validate: async (binding) => {
53
- const { validateCodexAppServerRuntimeArtifact } = await import("./runtime-artifact-C2ITXdhM.js");
53
+ const { validateCodexAppServerRuntimeArtifact } = await import("./runtime-artifact-CmtG_t1L.js");
54
54
  return validateCodexAppServerRuntimeArtifact(binding);
55
55
  } },
56
56
  fetchUsageSnapshot: async (ctx) => {
57
- const { fetchCodexAppServerUsageSnapshot } = await import("./usage-UpVbdX5G.js");
57
+ const { fetchCodexAppServerUsageSnapshot } = await import("./usage-CQ6GhD5-.js");
58
58
  return await fetchCodexAppServerUsageSnapshot(ctx, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
59
59
  },
60
+ loadMcpToolCatalog: async (params) => {
61
+ const { loadCodexEffectiveMcpCatalog } = await import("./effective-mcp-catalog-Bbd98Inw.js");
62
+ return await loadCodexEffectiveMcpCatalog(params, { bindingStore: options.bindingStore });
63
+ },
60
64
  supports: (ctx) => {
61
65
  const provider = ctx.provider.trim().toLowerCase();
62
66
  if (!providerIds.has(provider)) return {
@@ -95,7 +99,7 @@ function createCodexAppServerAgentHarness(options) {
95
99
  };
96
100
  },
97
101
  runAttempt: async (params) => {
98
- const { runCodexAppServerAttempt } = await import("./run-attempt-C5GTPJOE.js");
102
+ const { runCodexAppServerAttempt } = await import("./run-attempt-CY9WlDLc.js");
99
103
  return runCodexAppServerAttempt(params, {
100
104
  bindingStore: options.bindingStore,
101
105
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
@@ -103,11 +107,11 @@ function createCodexAppServerAgentHarness(options) {
103
107
  });
104
108
  },
105
109
  finalizeSettledTurn: async (params) => {
106
- const { runCodexSettledTurnFinalization } = await import("./settled-turn-finalizer-CA_2QXIE.js");
110
+ const { runCodexSettledTurnFinalization } = await import("./settled-turn-finalizer-CXY2Z9dT.js");
107
111
  return runCodexSettledTurnFinalization(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
108
112
  },
109
113
  runSideQuestion: async (params) => {
110
- const { runCodexAppServerSideQuestion } = await import("./side-question-CO12sHxo.js");
114
+ const { runCodexAppServerSideQuestion } = await import("./side-question-_ulBk1AL.js");
111
115
  return runCodexAppServerSideQuestion(params, {
112
116
  bindingStore: options.bindingStore,
113
117
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
@@ -115,14 +119,14 @@ function createCodexAppServerAgentHarness(options) {
115
119
  });
116
120
  },
117
121
  compact: async (params) => {
118
- const { maybeCompactCodexAppServerSession } = await import("./compact-dEN49UH6.js");
122
+ const { maybeCompactCodexAppServerSession } = await import("./compact-D_uvHurS.js");
119
123
  return maybeCompactCodexAppServerSession(params, {
120
124
  bindingStore: options.bindingStore,
121
125
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig
122
126
  });
123
127
  },
124
128
  compactAfterContextEngine: async (params) => {
125
- const { maybeCompactCodexAppServerSession } = await import("./compact-dEN49UH6.js");
129
+ const { maybeCompactCodexAppServerSession } = await import("./compact-D_uvHurS.js");
126
130
  return maybeCompactCodexAppServerSession(params, {
127
131
  bindingStore: options.bindingStore,
128
132
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
@@ -131,7 +135,7 @@ function createCodexAppServerAgentHarness(options) {
131
135
  },
132
136
  reset: async (params) => {
133
137
  if (params.sessionId) {
134
- const { reclaimCurrentCodexSessionGeneration, sessionBindingIdentity } = await import("./session-binding-DlVQ-Pxs.js").then((n) => n.u);
138
+ const { reclaimCurrentCodexSessionGeneration, sessionBindingIdentity } = await import("./session-binding-BXpo9ymA.js").then((n) => n.f);
135
139
  const identity = sessionBindingIdentity({
136
140
  agentId: params.agentId,
137
141
  sessionId: params.sessionId,
package/dist/index.js CHANGED
@@ -1,24 +1,22 @@
1
1
  import { registerCodexCliMetadata } from "./cli-metadata.js";
2
2
  import { createCodexAppServerAgentHarness } from "./harness.js";
3
- import { N as resolveCodexAppServerAuthProfileIdForAgent, P as resolveCodexAppServerFallbackApiKeyCacheKey, R as CODEX_INTERACTIVE_THREAD_SOURCE_KINDS, V as isJsonObject, a as getLeasedSharedCodexAppServerClient, c as releaseCodexAppServerClientLease, j as resolveCodexAppServerAuthAccountCacheKey, l as releaseLeasedSharedCodexAppServerClient, m as withLeasedCodexAppServerClientStartSelectionRetry, r as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-BVKE40c-.js";
4
- import { D as resolveOpenClawExecPolicyForCodexAppServer, T as readCodexPluginConfig, _ as assertCodexAppServerConnectionSecurity, b as canUseCodexModelBackedApprovalsReviewerForModel, d as codexAppServerStartOptionsKey, f as codexSandboxPolicyForTurn, g as resolveCodexSupervisionAppServerRuntimeOptions, k as CODEX_PLUGINS_MARKETPLACE_NAME, l as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as isCodexAppServerNativeAuthProfile, p as resolveCodexAppServerRuntimeOptions, s as normalizeCodexAppServerBindingModelProvider } from "./session-binding-DlVQ-Pxs.js";
3
+ import { I as resolveCodexAppServerAuthProfileIdForAgent, L as resolveCodexAppServerFallbackApiKeyCacheKey, P as resolveCodexAppServerAuthAccountCacheKey, V as CODEX_INTERACTIVE_THREAD_SOURCE_KINDS, W as isJsonObject, a as getLeasedSharedCodexAppServerClient, c as releaseCodexAppServerClientLease, h as withLeasedCodexAppServerClientStartSelectionRetry, l as releaseLeasedSharedCodexAppServerClient, r as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-DTbvH-XV.js";
4
+ import { A as resolveOpenClawExecPolicyForCodexAppServer, C as canUseCodexModelBackedApprovalsReviewerForModel, M as CODEX_PLUGINS_MARKETPLACE_NAME, O as readCodexPluginConfig, b as assertCodexAppServerConnectionSecurity, d as sessionBindingIdentity, g as resolveCodexAppServerRuntimeOptions, m as codexSandboxPolicyForTurn, n as assertCodexBindingMayBeReplaced, o as isCodexAppServerNativeAuthProfile, p as codexAppServerStartOptionsKey, s as normalizeCodexAppServerBindingModelProvider, y as resolveCodexSupervisionAppServerRuntimeOptions } from "./session-binding-BXpo9ymA.js";
5
5
  import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./session-binding-meta-B7aEMU7g.js";
6
- import { n as CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS, u as unsubscribeCodexThreadBestEffort } from "./attempt-client-cleanup-Ia52yRWc.js";
7
- import { J as pluginReadParams, _ as CODEX_NATIVE_PERSONALITY_NONE, c as resumeCodexAppServerThread, q as ensureCodexPluginActivation, y as resolveCodexAppServerRequestModelSelection } from "./thread-lifecycle-DRg_FdzC.js";
8
- import { i as assertCodexThreadStartResponse } from "./protocol-validators-Dm4eXZmt.js";
9
- import { i as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-DSXX-rXO.js";
6
+ import { J as isOpenAiCuratedMarketplace, Y as pluginReadParams, _t as unsubscribeCodexThreadBestEffort, b as resolveCodexAppServerRequestModelSelection, dt as CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS, l as resumeCodexAppServerThread, q as ensureCodexPluginActivation, v as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-DF53ogiA.js";
7
+ import { _ as assertCodexThreadStartResponse } from "./transcript-mirror-DzsdNCf5.js";
8
+ import { i as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-DztPafOA.js";
10
9
  import { t as isIncognitoSessionKey } from "./incognito-session-ET_ufDH-.js";
11
10
  import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
12
- import { n as CODEX_REALTIME_OFFER_PATH, t as configureCodexRealtimeBrowserSession } from "./realtime-voice-api-BPcA1uN9.js";
13
- import { n as describeControlFailure, t as CODEX_CONTROL_METHODS } from "./capabilities-BHRSI6Cn.js";
14
- import { r as formatCodexDisplayText } from "./command-formatters-ico4ZFnk.js";
15
- import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-BmDgseo_.js";
16
- import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-D1Wky__S.js";
17
- import { d as CODEX_NATIVE_EXECUTION_AUTH_ERROR, f as canMutateCodexHost, u as trackCodexConversationActiveTurn } from "./conversation-control-DE7d9DOj.js";
11
+ import { n as describeControlFailure, t as CODEX_CONTROL_METHODS } from "./capabilities-BFDTVYr4.js";
12
+ import { r as formatCodexDisplayText } from "./command-formatters-C336eRVS.js";
13
+ import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-BSaO2JIT.js";
14
+ import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-NuhpXmPB.js";
15
+ import { d as CODEX_NATIVE_EXECUTION_AUTH_ERROR, f as canMutateCodexHost, u as trackCodexConversationActiveTurn } from "./conversation-control-xsIeXbo4.js";
18
16
  import { a as readCodexConversationBindingDataRecord, i as readCodexConversationBindingData, o as resolveCodexDefaultWorkspaceDir, r as createCodexConversationBindingData } from "./conversation-binding-data-BHRpYbX3.js";
19
- import { a as resolveCodexBindingAppServerConnection, n as readCodexNotificationThreadId, r as readCodexNotificationTurnId } from "./notification-correlation-Bj_Ak_jI.js";
20
- import { d as createCodexCliSessionNodeHostCommands, f as createCodexCliSessionNodeInvokePolicies, g as resumeCodexCliSessionOnNode, h as resolveCodexCliSessionForBindingOnNode, i as createCodexSessionCatalogNodeInvokePolicies, m as listCodexCliSessionsOnNode, n as createCodexSessionCatalogControl, o as codexControlRequest, r as createCodexSessionCatalogNodeHostCommands, t as codexSessionCatalogRuntime, u as assertCodexArchiveDescendantsUnowned } from "./session-catalog-CP2oCcEb.js";
21
- import { r as requestCodexAppServerJson } from "./request-CXpPennK.js";
17
+ import { a as resolveCodexBindingAppServerConnection, n as readCodexNotificationThreadId, r as readCodexNotificationTurnId } from "./notification-correlation-CU6_AnOb.js";
18
+ import { d as createCodexCliSessionNodeHostCommands, f as createCodexCliSessionNodeInvokePolicies, g as resumeCodexCliSessionOnNode, h as resolveCodexCliSessionForBindingOnNode, i as createCodexSessionCatalogNodeInvokePolicies, m as listCodexCliSessionsOnNode, n as createCodexSessionCatalogControl, o as codexControlRequest, r as createCodexSessionCatalogNodeHostCommands, t as codexSessionCatalogRuntime, u as assertCodexArchiveDescendantsUnowned } from "./session-catalog-DyOgR4WH.js";
19
+ import { i as withCodexAppServerJsonClient, r as requestCodexAppServerJson } from "./request-qKh331yu.js";
22
20
  import { t as createCodexWebSearchProviderBase } from "./web-search-provider.shared-BrZmlqyR.js";
23
21
  import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
24
22
  import { normalizePluginsConfig, resolveEffectiveEnableState, resolveLivePluginConfigObject, resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
@@ -49,7 +47,7 @@ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
49
47
  /** Defers schema compilation and auth loading until the first binding operation. */
50
48
  function createLazyCodexAppServerBindingStore(state) {
51
49
  let resolved;
52
- const store = () => resolved ??= import("./session-binding-DlVQ-Pxs.js").then((n) => n.u).then(({ createCodexAppServerBindingStore }) => createCodexAppServerBindingStore(state));
50
+ const store = () => resolved ??= import("./session-binding-BXpo9ymA.js").then((n) => n.f).then(({ createCodexAppServerBindingStore }) => createCodexAppServerBindingStore(state));
53
51
  return {
54
52
  read: async (identity) => (await store()).read(identity),
55
53
  hasOtherThreadOwner: async (threadId, currentIdentity) => (await store()).hasOtherThreadOwner(threadId, currentIdentity),
@@ -77,7 +75,7 @@ async function handleCodexCommand(ctx, options) {
77
75
  }
78
76
  }
79
77
  async function loadDefaultCodexSubcommandHandler() {
80
- const { handleCodexSubcommand } = await import("./command-handlers-CRmnwI2N.js");
78
+ const { handleCodexSubcommand } = await import("./command-handlers-DAHUSry9.js");
81
79
  return handleCodexSubcommand;
82
80
  }
83
81
  //#endregion
@@ -1085,7 +1083,7 @@ function sanitizeAppsNeedingAuth(apps) {
1085
1083
  return apps.map((app) => ({
1086
1084
  id: app.id,
1087
1085
  name: app.name,
1088
- needsAuth: app.needsAuth
1086
+ needsAuth: true
1089
1087
  }));
1090
1088
  }
1091
1089
  //#endregion
@@ -1525,23 +1523,35 @@ function personalAgentsSkillsDir() {
1525
1523
  return path.join(resolveUserHomeDir(), ".agents", "skills");
1526
1524
  }
1527
1525
  async function discoverInstalledCuratedPlugins(codexHome, options = {}) {
1528
- const requestOptions = { startOptions: sourceCodexAppServerStartOptions(codexHome) };
1526
+ const startOptions = sourceCodexAppServerStartOptions(codexHome);
1529
1527
  try {
1530
- const marketplace = (await requestSourceCodexAppServerJson(requestOptions, {
1531
- method: "plugin/list",
1532
- requestParams: { cwds: [] }
1533
- })).marketplaces.find((entry) => entry.name === CODEX_PLUGINS_MARKETPLACE_NAME);
1534
- if (!marketplace) return {
1535
- plugins: [],
1536
- error: `Codex marketplace ${CODEX_PLUGINS_MARKETPLACE_NAME} was not found in source plugin inventory.`
1537
- };
1538
- const plugins = marketplace.plugins.filter((plugin) => plugin.installed).map((plugin) => buildInstalledPluginSource(plugin)).filter((plugin) => plugin !== void 0);
1539
- return { plugins: (options.evaluatePluginMigrationEligibility === true ? await withPluginMigrationEligibility({
1540
- plugins,
1541
- marketplace: marketplaceRef(marketplace),
1542
- requestOptions,
1543
- verifyPluginApps: options.verifyPluginApps === true
1544
- }) : plugins).toSorted((a, b) => (a.pluginName ?? a.name).localeCompare(b.pluginName ?? b.name)) };
1528
+ return await withCodexAppServerJsonClient({
1529
+ timeoutMs: 6e4,
1530
+ startOptions,
1531
+ authProfileId: null,
1532
+ isolated: true
1533
+ }, async (request) => {
1534
+ const requestOptions = {
1535
+ startOptions,
1536
+ request
1537
+ };
1538
+ const response = await request({
1539
+ method: "plugin/installed",
1540
+ requestParams: { cwds: [] }
1541
+ });
1542
+ const curatedSyncRoot = path.join(codexHome, ".tmp", "plugins");
1543
+ const curatedMarketplaceErrors = response.marketplaceLoadErrors.filter((error) => isPathInside(curatedSyncRoot, error.marketplacePath));
1544
+ if (curatedMarketplaceErrors.length > 0) return {
1545
+ plugins: [],
1546
+ error: curatedMarketplaceErrors.map((error) => error.message).join("; ")
1547
+ };
1548
+ const installed = discoverInstalledCuratedPluginSources(response);
1549
+ return { plugins: (options.evaluatePluginMigrationEligibility === true ? await withPluginMigrationEligibility({
1550
+ plugins: installed,
1551
+ requestOptions,
1552
+ verifyPluginApps: options.verifyPluginApps === true
1553
+ }) : installed.map(({ plugin }) => plugin)).toSorted((left, right) => (left.pluginName ?? left.name).localeCompare(right.pluginName ?? right.name)) };
1554
+ });
1545
1555
  } catch (error) {
1546
1556
  return {
1547
1557
  plugins: [],
@@ -1567,16 +1577,6 @@ function sourceCodexAppServerStartOptions(codexHome) {
1567
1577
  }
1568
1578
  };
1569
1579
  }
1570
- async function requestSourceCodexAppServerJson(options, params) {
1571
- return await requestCodexAppServerJson({
1572
- method: params.method,
1573
- requestParams: params.requestParams,
1574
- timeoutMs: 6e4,
1575
- startOptions: options.startOptions,
1576
- authProfileId: null,
1577
- isolated: true
1578
- });
1579
- }
1580
1580
  function buildInstalledPluginSource(plugin) {
1581
1581
  const pluginName = pluginNameFromSummary(plugin);
1582
1582
  if (!pluginName) return;
@@ -1590,6 +1590,27 @@ function buildInstalledPluginSource(plugin) {
1590
1590
  enabled: plugin.enabled
1591
1591
  };
1592
1592
  }
1593
+ function discoverInstalledCuratedPluginSources(response) {
1594
+ const installedByName = /* @__PURE__ */ new Map();
1595
+ for (const marketplace of response.marketplaces) {
1596
+ if (!isOpenAiCuratedMarketplace(marketplace)) continue;
1597
+ const remote = !marketplace.path;
1598
+ for (const summary of marketplace.plugins) {
1599
+ if (!summary.installed) continue;
1600
+ const plugin = buildInstalledPluginSource(summary);
1601
+ if (!plugin?.pluginName) continue;
1602
+ const existing = installedByName.get(plugin.pluginName);
1603
+ if (existing && (!remote || existing.remote)) continue;
1604
+ installedByName.set(plugin.pluginName, {
1605
+ plugin,
1606
+ marketplace: marketplaceRef(marketplace),
1607
+ ...remote ? { readPluginName: summary.remotePluginId?.trim() || void 0 } : { readPluginName: plugin.pluginName },
1608
+ remote
1609
+ });
1610
+ }
1611
+ }
1612
+ return Array.from(installedByName.values());
1613
+ }
1593
1614
  function marketplaceRef(marketplace) {
1594
1615
  return {
1595
1616
  name: CODEX_PLUGINS_MARKETPLACE_NAME,
@@ -1600,7 +1621,7 @@ function marketplaceRef(marketplace) {
1600
1621
  async function withPluginMigrationEligibility(params) {
1601
1622
  const pending = [];
1602
1623
  const evaluated = [];
1603
- for (const plugin of params.plugins) {
1624
+ for (const { plugin, marketplace, readPluginName } of params.plugins) {
1604
1625
  if (plugin.enabled !== true) {
1605
1626
  evaluated.push({
1606
1627
  ...plugin,
@@ -1610,7 +1631,7 @@ async function withPluginMigrationEligibility(params) {
1610
1631
  });
1611
1632
  continue;
1612
1633
  }
1613
- const detail = await readPluginDetail(params.requestOptions, params.marketplace, plugin);
1634
+ const detail = await readPluginDetail(params.requestOptions, marketplace, plugin, readPluginName);
1614
1635
  if (!detail.ok) {
1615
1636
  evaluated.push({
1616
1637
  ...plugin,
@@ -1638,25 +1659,27 @@ async function withPluginMigrationEligibility(params) {
1638
1659
  }
1639
1660
  if (pending.length === 0) return evaluated;
1640
1661
  let sourceAccount;
1662
+ let sourceAccountError;
1641
1663
  try {
1642
1664
  sourceAccount = await readSourceCodexAccount(params.requestOptions);
1665
+ if (sourceAccount === "missing") sourceAccountError = "Codex app-server did not report an authenticated source account.";
1643
1666
  } catch (error) {
1644
- if (!params.verifyPluginApps) {
1645
- const message = error instanceof Error ? error.message : String(error);
1646
- for (const { plugin, apps } of pending) evaluated.push({
1647
- ...plugin,
1648
- migratable: false,
1649
- migrationBlock: {
1650
- code: "codex_account_unavailable",
1651
- apps,
1652
- error: message
1653
- },
1654
- message: `Codex plugin "${plugin.pluginName ?? plugin.name}" owns apps, but the source Codex app-server account could not be read: ${message}`
1655
- });
1656
- return evaluated;
1657
- }
1667
+ sourceAccountError = error instanceof Error ? error.message : String(error);
1658
1668
  }
1659
- if (sourceAccount && sourceAccount !== "chatgpt") {
1669
+ if (sourceAccountError && !params.verifyPluginApps) {
1670
+ for (const { plugin, apps } of pending) evaluated.push({
1671
+ ...plugin,
1672
+ migratable: false,
1673
+ migrationBlock: {
1674
+ code: "codex_account_unavailable",
1675
+ apps,
1676
+ error: sourceAccountError
1677
+ },
1678
+ message: `Codex plugin "${plugin.pluginName ?? plugin.name}" owns apps, but the source Codex app-server account could not be read: ${sourceAccountError}`
1679
+ });
1680
+ return evaluated;
1681
+ }
1682
+ if (sourceAccount === "non_chatgpt") {
1660
1683
  for (const { plugin, apps } of pending) evaluated.push({
1661
1684
  ...plugin,
1662
1685
  migratable: false,
@@ -1691,8 +1714,9 @@ async function withPluginMigrationEligibility(params) {
1691
1714
  });
1692
1715
  if (!snapshot) return evaluated;
1693
1716
  const appInfoById = new Map(snapshot.apps.map((app) => [app.id, app]));
1717
+ const installedAppsById = new Map(snapshot.installedApps.map((app) => [app.id, app]));
1694
1718
  for (const { plugin, apps: declaredApps } of pending) {
1695
- const apps = declaredApps.map((app) => sourcePluginAppFactWithInventory(app, appInfoById.get(app.id))).toSorted((left, right) => left.id.localeCompare(right.id));
1719
+ const apps = declaredApps.map((app) => sourcePluginAppFactWithInventory(app, appInfoById.get(app.id), installedAppsById.get(app.id))).toSorted((left, right) => left.id.localeCompare(right.id));
1696
1720
  const blockCode = migrationBlockCodeForApps(apps);
1697
1721
  if (!blockCode) {
1698
1722
  evaluated.push({
@@ -1715,20 +1739,29 @@ async function withPluginMigrationEligibility(params) {
1715
1739
  return evaluated;
1716
1740
  }
1717
1741
  async function readSourceCodexAccount(options) {
1718
- const response = await requestSourceCodexAppServerJson(options, {
1742
+ const response = await options.request({
1719
1743
  method: "account/read",
1720
1744
  requestParams: { refreshToken: false }
1721
1745
  });
1722
1746
  if (!response.account || typeof response.account !== "object" || Array.isArray(response.account)) return "missing";
1723
- return response.account.type === "chatgpt" ? "chatgpt" : "non_chatgpt";
1747
+ switch (response.account.type) {
1748
+ case "chatgpt": return "chatgpt";
1749
+ case "apiKey":
1750
+ case "amazonBedrock": return "non_chatgpt";
1751
+ default: return "missing";
1752
+ }
1724
1753
  }
1725
- async function readPluginDetail(options, marketplace, plugin) {
1754
+ async function readPluginDetail(options, marketplace, plugin, readPluginName) {
1755
+ if (!readPluginName) return {
1756
+ ok: false,
1757
+ error: `Codex remote plugin "${plugin.pluginName ?? plugin.name}" has no readable remote plugin id.`
1758
+ };
1726
1759
  try {
1727
1760
  return {
1728
1761
  ok: true,
1729
- detail: (await requestSourceCodexAppServerJson(options, {
1762
+ detail: (await options.request({
1730
1763
  method: "plugin/read",
1731
- requestParams: pluginReadParams(marketplace, plugin.pluginName ?? plugin.name)
1764
+ requestParams: pluginReadParams(marketplace, readPluginName)
1732
1765
  })).plugin
1733
1766
  };
1734
1767
  } catch (error) {
@@ -1740,7 +1773,7 @@ async function readPluginDetail(options, marketplace, plugin) {
1740
1773
  }
1741
1774
  async function refreshSourceAppInventory(options) {
1742
1775
  const key = buildCodexPluginAppCacheKey({ appServer: { start: options.startOptions } });
1743
- const request = async (method, requestParams) => await requestSourceCodexAppServerJson(options, {
1776
+ const request = async (method, requestParams) => await options.request({
1744
1777
  method,
1745
1778
  requestParams
1746
1779
  });
@@ -1753,16 +1786,29 @@ async function refreshSourceAppInventory(options) {
1753
1786
  function sourcePluginAppFact(app) {
1754
1787
  return {
1755
1788
  id: app.id,
1756
- name: app.name,
1757
- needsAuth: app.needsAuth
1789
+ name: app.name
1758
1790
  };
1759
1791
  }
1760
- function sourcePluginAppFactWithInventory(app, info) {
1761
- if (!info) return app;
1762
- return {
1792
+ function sourcePluginAppFactWithInventory(app, info, installedApp) {
1793
+ if (!installedApp) return app;
1794
+ if (!info) return installedApp.enabled ? {
1795
+ ...app,
1796
+ isAccessible: false,
1797
+ isEnabled: true
1798
+ } : {
1799
+ ...app,
1800
+ isEnabled: false
1801
+ };
1802
+ if (!installedApp.enabled) return {
1763
1803
  ...app,
1764
1804
  isAccessible: info.isAccessible,
1765
- isEnabled: info.isEnabled
1805
+ isEnabled: false
1806
+ };
1807
+ return {
1808
+ ...app,
1809
+ isAccessible: info.isAccessible && installedApp.callable,
1810
+ isEnabled: info.isEnabled,
1811
+ ...!installedApp.callable ? { isCallable: false } : {}
1766
1812
  };
1767
1813
  }
1768
1814
  function migrationBlockCodeForApps(apps) {
@@ -1771,7 +1817,7 @@ function migrationBlockCodeForApps(apps) {
1771
1817
  if (apps.some((app) => app.isAccessible === void 0 || app.isEnabled === void 0)) return "app_missing";
1772
1818
  }
1773
1819
  function appInventoryBlockMessage(plugin, apps, code) {
1774
- const status = code === "app_inaccessible" ? "inaccessible" : code === "app_disabled" ? "disabled" : "missing";
1820
+ const status = code === "app_inaccessible" ? apps.some((app) => app.isCallable === false) ? "not callable" : "inaccessible" : code === "app_disabled" ? "disabled" : "missing";
1775
1821
  const blocking = apps.find((app) => code === "app_inaccessible" ? app.isAccessible === false : code === "app_disabled" ? app.isEnabled === false : app.isAccessible === void 0 || app.isEnabled === void 0) ?? apps[0];
1776
1822
  const appLabel = blocking ? ` app "${blocking.name}"` : " an owned app";
1777
1823
  return `Codex plugin "${plugin.pluginName ?? plugin.name}" owns${appLabel} but the source app inventory reports it is ${status}; authenticate or enable the app in Codex before migrating it to OpenClaw.`;
@@ -1783,11 +1829,16 @@ function codexSubscriptionRequiredMessage(plugin) {
1783
1829
  return `Codex plugin "${plugin.pluginName ?? plugin.name}" owns apps, but ${codexPluginMigrationSubscriptionWarning()}`;
1784
1830
  }
1785
1831
  function pluginNameFromSummary(summary) {
1786
- const candidates = [summary.id, summary.name];
1832
+ const candidates = [summary.name, summary.id];
1787
1833
  for (const candidate of candidates) {
1788
1834
  const trimmed = candidate.trim();
1789
1835
  if (!trimmed) continue;
1790
- const normalized = ((trimmed.endsWith(`@openai-curated`) ? trimmed.slice(0, -`@${CODEX_PLUGINS_MARKETPLACE_NAME}`.length) : trimmed).split("/").at(-1)?.trim())?.toLowerCase().replaceAll(/\s+/gu, "-");
1836
+ const marketplaceSuffix = [
1837
+ `@${CODEX_PLUGINS_MARKETPLACE_NAME}-remote`,
1838
+ `@openai-api-curated`,
1839
+ `@${CODEX_PLUGINS_MARKETPLACE_NAME}`
1840
+ ].find((suffix) => trimmed.endsWith(suffix));
1841
+ const normalized = ((marketplaceSuffix ? trimmed.slice(0, -marketplaceSuffix.length) : trimmed).split("/").at(-1)?.trim())?.toLowerCase().replaceAll(/\s+/gu, "-");
1791
1842
  if (normalized) return normalized;
1792
1843
  }
1793
1844
  }
@@ -3670,7 +3721,7 @@ function createCodexSupervisionTools(options) {
3670
3721
  }
3671
3722
  //#endregion
3672
3723
  //#region extensions/codex/src/web-search-provider.ts
3673
- const loadCodexWebSearchRuntime = createLazyRuntimeModule(() => import("./web-search-provider.runtime-CaQMYDbp.js"));
3724
+ const loadCodexWebSearchRuntime = createLazyRuntimeModule(() => import("./web-search-provider.runtime-CCFhg2z5.js"));
3674
3725
  const CodexWebSearchSchema = {
3675
3726
  type: "object",
3676
3727
  properties: { query: {
@@ -3729,34 +3780,6 @@ var codex_default = definePluginEntry({
3729
3780
  return livePluginConfig;
3730
3781
  };
3731
3782
  const resolveCurrentPluginConfig = () => resolvePluginConfig(resolveCurrentConfig);
3732
- if (api.registrationMode === "full") {
3733
- const realtimeBrowserSession = configureCodexRealtimeBrowserSession({
3734
- getConfig: resolveCurrentConfig,
3735
- getPluginConfig: resolveCurrentPluginConfig
3736
- });
3737
- api.registerHttpRoute({
3738
- path: CODEX_REALTIME_OFFER_PATH,
3739
- auth: "plugin",
3740
- match: "exact",
3741
- handler: realtimeBrowserSession.handler
3742
- });
3743
- api.registerService({
3744
- id: "codex-oauth-realtime-browser-session-warmup",
3745
- start: () => {
3746
- realtimeBrowserSession.warmup().catch((error) => {
3747
- api.logger.debug?.(`Codex OAuth realtime warmup unavailable: ${error instanceof Error ? error.message : String(error)}`);
3748
- });
3749
- }
3750
- });
3751
- api.lifecycle.registerRuntimeLifecycle({
3752
- id: "codex-oauth-realtime-browser-session",
3753
- description: "Release Codex OAuth realtime browser sessions when the plugin stops",
3754
- cleanup: async ({ reason }) => {
3755
- if (reason === "reset" || reason === "delete") return;
3756
- await realtimeBrowserSession.cleanup();
3757
- }
3758
- });
3759
- }
3760
3783
  let bindingStateStore;
3761
3784
  const openBindingStateStore = () => bindingStateStore ??= api.runtime.state.openSyncKeyedStore({
3762
3785
  namespace: CODEX_APP_SERVER_BINDING_NAMESPACE,
@@ -3888,7 +3911,7 @@ var codex_default = definePluginEntry({
3888
3911
  if (!previousSessionId || !sessionId || previousSessionId === sessionId) return;
3889
3912
  const config = resolveCurrentConfig();
3890
3913
  const sessionKey = ctx.sessionKey?.trim();
3891
- const { sessionBindingIdentity } = await import("./session-binding-DlVQ-Pxs.js").then((n) => n.u);
3914
+ const { sessionBindingIdentity } = await import("./session-binding-BXpo9ymA.js").then((n) => n.f);
3892
3915
  const identity = sessionBindingIdentity({
3893
3916
  sessionId,
3894
3917
  ...sessionKey ? { sessionKey } : {},
@@ -3906,7 +3929,7 @@ var codex_default = definePluginEntry({
3906
3929
  if (endedSessionKey && nextSessionKey && nextSessionKey !== endedSessionKey) return;
3907
3930
  if (event.nextSessionId?.trim() === event.sessionId.trim()) return;
3908
3931
  const config = resolveCurrentConfig();
3909
- const { sessionBindingIdentity } = await import("./session-binding-DlVQ-Pxs.js").then((n) => n.u);
3932
+ const { sessionBindingIdentity } = await import("./session-binding-BXpo9ymA.js").then((n) => n.f);
3910
3933
  await bindingStore.retireSessionGeneration(sessionBindingIdentity({
3911
3934
  sessionId: event.sessionId,
3912
3935
  ...sessionKey ? { sessionKey } : {},
@@ -1,4 +1,4 @@
1
- import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-FEbUXoYT.js";
1
+ import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-D2ZAgZVz.js";
2
2
  import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
3
3
  //#region extensions/codex/media-understanding-provider.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { c as readCodexModelListResponse } from "./protocol-validators-Dm4eXZmt.js";
1
+ import { x as readCodexModelListResponse } from "./transcript-mirror-DzsdNCf5.js";
2
2
  import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  //#region extensions/codex/src/app-server/models.ts
4
4
  /**
@@ -40,7 +40,7 @@ async function listAllCodexAppServerModels(options = {}) {
40
40
  async function withCodexAppServerModelClient(options, run) {
41
41
  const timeoutMs = options.timeoutMs ?? 2500;
42
42
  const useSharedClient = options.sharedClient !== false;
43
- const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-BVKE40c-.js").then((n) => n.p);
43
+ const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-DTbvH-XV.js").then((n) => n.m);
44
44
  const client = useSharedClient ? await getLeasedSharedCodexAppServerClient({
45
45
  startOptions: options.startOptions,
46
46
  timeoutMs,