@openclaw/codex 2026.6.8 → 2026.6.9
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/{notification-correlation-BGoG0N90.js → app-server-policy-BPTiVNsW.js} +15 -74
- package/dist/attempt-notifications-7oZeRa71.js +249 -0
- package/dist/{client-DovmVtbr.js → client-CLrtWgrD.js} +24 -2
- package/dist/{client-factory-C71Xdb6z.js → client-factory-Bm6HsGob.js} +3 -2
- package/dist/{command-handlers-DHecBkuc.js → command-handlers-BaqM9s9b.js} +17 -13
- package/dist/{compact-GEKusemL.js → compact-aQJ0ZKhe.js} +5 -5
- package/dist/{computer-use-D1qxvTE_.js → computer-use-BmuwYrW6.js} +3 -3
- package/dist/{config-DJXpBkGf.js → config-CszD0vP3.js} +176 -25
- package/dist/{conversation-binding-CbnMilVW.js → conversation-binding-DbG2ZJQY.js} +166 -58
- package/dist/doctor-contract-api.js +37 -3
- package/dist/harness.js +6 -6
- package/dist/index.js +108 -27
- package/dist/media-understanding-provider-Dmfg4tH_.js +463 -0
- package/dist/media-understanding-provider.js +1 -355
- package/dist/{models-DRKnOpzF.js → models-CAmfBWRl.js} +2 -2
- package/dist/{plugin-app-cache-key-kIqpGTQj.js → plugin-app-cache-key-vaZ_8Usz.js} +17 -6
- package/dist/prompt-overlay.js +2 -6
- package/dist/{protocol-oeJQu4rs.js → protocol-dh-ETiNd.js} +4 -1
- package/dist/{protocol-validators-B48C6S9O.js → protocol-validators-B19q5BIX.js} +210 -16
- package/dist/{provider-C5P6352f.js → provider-B-OHpbD3.js} +4 -4
- package/dist/{native-hook-relay-C3i3FYtc.js → provider-capabilities-ByR82ytL.js} +803 -78
- package/dist/provider.js +1 -1
- package/dist/{request-BxZ40QKY.js → request-Dcd452Nk.js} +2 -2
- package/dist/{run-attempt-D_q-VrpR.js → run-attempt-DYt00Jxz.js} +519 -789
- package/dist/{sandbox-guard-C-Yv9uwY.js → sandbox-guard-3tnjhjFb.js} +37 -10
- package/dist/{session-binding-ElbcSq2o.js → session-binding-HOuPt-E0.js} +27 -8
- package/dist/{shared-client-jFMumCOe.js → shared-client-Dtx5i7Ez.js} +4 -4
- package/dist/{side-question-DqKLfWMB.js → side-question-h01W1aCe.js} +106 -42
- package/dist/{thread-lifecycle-cban34w3.js → thread-lifecycle-DQyii5vp.js} +948 -616
- package/dist/web-search-contract-api.js +10 -0
- package/dist/web-search-provider.runtime-BWG_oqLf.js +74 -0
- package/dist/web-search-provider.shared-BrZmlqyR.js +32 -0
- package/npm-shrinkwrap.json +2 -2
- package/openclaw.plugin.json +140 -6
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { createCodexAppServerAgentHarness } from "./harness.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { a as getLeasedSharedCodexAppServerClient, d as resolveCodexAppServerAuthAccountCacheKey, m as resolveCodexAppServerFallbackApiKeyCacheKey, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, r as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-
|
|
9
|
-
import { a as createCodexCliSessionNodeInvokePolicies, c as resolveCodexCliSessionForBindingOnNode, i as createCodexCliSessionNodeHostCommands, l as resumeCodexCliSessionOnNode, n as handleCodexConversationInboundClaim, s as listCodexCliSessionsOnNode, t as handleCodexConversationBindingResolved } from "./conversation-binding-
|
|
10
|
-
import { t as requestCodexAppServerJson } from "./request-
|
|
2
|
+
import { F as ensureCodexPluginActivation, I as pluginReadParams, R as defaultCodexAppInventoryCache } from "./thread-lifecycle-DQyii5vp.js";
|
|
3
|
+
import { d as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME, u as readCodexPluginConfig } from "./config-CszD0vP3.js";
|
|
4
|
+
import { t as buildCodexProvider } from "./provider-B-OHpbD3.js";
|
|
5
|
+
import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-Dmfg4tH_.js";
|
|
6
|
+
import { i as describeControlFailure, n as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-vaZ_8Usz.js";
|
|
7
|
+
import { a as formatCodexDisplayText } from "./app-server-policy-BPTiVNsW.js";
|
|
8
|
+
import { a as getLeasedSharedCodexAppServerClient, d as resolveCodexAppServerAuthAccountCacheKey, m as resolveCodexAppServerFallbackApiKeyCacheKey, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, r as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-Dtx5i7Ez.js";
|
|
9
|
+
import { a as createCodexCliSessionNodeInvokePolicies, c as resolveCodexCliSessionForBindingOnNode, i as createCodexCliSessionNodeHostCommands, l as resumeCodexCliSessionOnNode, n as handleCodexConversationInboundClaim, s as listCodexCliSessionsOnNode, t as handleCodexConversationBindingResolved } from "./conversation-binding-DbG2ZJQY.js";
|
|
10
|
+
import { t as requestCodexAppServerJson } from "./request-Dcd452Nk.js";
|
|
11
|
+
import { t as createCodexWebSearchProviderBase } from "./web-search-provider.shared-BrZmlqyR.js";
|
|
11
12
|
import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
|
|
12
|
-
import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
13
|
+
import { resolveLivePluginConfigObject, resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
13
14
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
15
|
+
import fs from "node:fs/promises";
|
|
16
|
+
import path from "node:path";
|
|
14
17
|
import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
18
|
+
import { asBoolean, isRecord, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
15
19
|
import os from "node:os";
|
|
16
|
-
import path from "node:path";
|
|
17
20
|
import { loadAuthProfileStoreWithoutExternalProfiles, resolveAgentConfig, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-runtime";
|
|
18
|
-
import { asBoolean, isRecord, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
19
|
-
import fs from "node:fs/promises";
|
|
20
21
|
import { applyAuthProfileConfig, buildApiKeyCredential, buildOauthProviderAuthResult, buildOpenAICodexCredentialExtra, readCodexCliCredentialsCached, resolveOpenAICodexAuthIdentity, resolveOpenAICodexImportProfileName, updateAuthProfileStoreWithLock } from "openclaw/plugin-sdk/provider-auth";
|
|
21
22
|
import { pathExists } from "openclaw/plugin-sdk/security-runtime";
|
|
22
23
|
import { MIGRATION_REASON_TARGET_EXISTS, applyMigrationManualItem, createMigrationItem, createMigrationManualItem, hasMigrationConfigPatchConflict, markMigrationItemConflict, markMigrationItemError, markMigrationItemSkipped, readMigrationConfigPath, summarizeMigrationItems, writeMigrationConfigPath } from "openclaw/plugin-sdk/migration";
|
|
@@ -51,7 +52,7 @@ async function handleCodexCommand(ctx, options = {}) {
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
async function loadDefaultCodexSubcommandHandler() {
|
|
54
|
-
const { handleCodexSubcommand } = await import("./command-handlers-
|
|
55
|
+
const { handleCodexSubcommand } = await import("./command-handlers-BaqM9s9b.js");
|
|
55
56
|
return handleCodexSubcommand;
|
|
56
57
|
}
|
|
57
58
|
//#endregion
|
|
@@ -931,13 +932,28 @@ function readExistingCodexPluginEntries(config) {
|
|
|
931
932
|
const entries = readMigrationConfigPath(config, [...CODEX_PLUGIN_NATIVE_CONFIG_PATH, "plugins"]);
|
|
932
933
|
return isRecord(entries) ? entries : {};
|
|
933
934
|
}
|
|
934
|
-
function hasExistingCodexPluginEntry(existingEntries, configKey, pluginName) {
|
|
935
|
-
|
|
935
|
+
function hasExistingCodexPluginEntry(existingEntries, configKey, pluginName, nextEntry) {
|
|
936
|
+
const existingEntry = existingEntries[configKey];
|
|
937
|
+
if (existingEntry !== void 0) return !isLegacyDestructivePolicyRepair(existingEntry, nextEntry);
|
|
936
938
|
return Object.values(existingEntries).some((entry) => {
|
|
937
939
|
if (!isRecord(entry)) return false;
|
|
938
940
|
return entry.pluginName === pluginName;
|
|
939
941
|
});
|
|
940
942
|
}
|
|
943
|
+
function isLegacyDestructivePolicyRepair(existing, nextEntry) {
|
|
944
|
+
const existingEntry = isRecord(existing) ? existing : void 0;
|
|
945
|
+
if (existingEntry?.allow_destructive_actions !== "on-request" || nextEntry.allow_destructive_actions !== "auto") return false;
|
|
946
|
+
const normalizedExisting = {
|
|
947
|
+
...existingEntry,
|
|
948
|
+
allow_destructive_actions: "auto"
|
|
949
|
+
};
|
|
950
|
+
const normalizedEntries = Object.entries(normalizedExisting);
|
|
951
|
+
return normalizedEntries.length === Object.keys(nextEntry).length && normalizedEntries.every(([key, value]) => nextEntry[key] === value);
|
|
952
|
+
}
|
|
953
|
+
function isLegacyDestructivePolicyConfigEntryRepair(existing, pluginName) {
|
|
954
|
+
const existingEntry = isRecord(existing) ? existing : void 0;
|
|
955
|
+
return existingEntry?.allow_destructive_actions === "on-request" && existingEntry.pluginName === pluginName;
|
|
956
|
+
}
|
|
941
957
|
function buildPluginItems(ctx, plugins) {
|
|
942
958
|
const baseCounts = /* @__PURE__ */ new Map();
|
|
943
959
|
for (const plugin of plugins.filter((entry) => entry.migratable)) {
|
|
@@ -951,7 +967,13 @@ function buildPluginItems(ctx, plugins) {
|
|
|
951
967
|
for (const plugin of plugins) {
|
|
952
968
|
if (plugin.migratable && plugin.marketplaceName === "openai-curated" && plugin.pluginName) {
|
|
953
969
|
const configKey = uniquePluginConfigKey(plugin, baseCounts, usedCounts);
|
|
954
|
-
const
|
|
970
|
+
const plannedEntry = {
|
|
971
|
+
enabled: true,
|
|
972
|
+
marketplaceName: CODEX_PLUGINS_MARKETPLACE_NAME,
|
|
973
|
+
pluginName: plugin.pluginName,
|
|
974
|
+
...isLegacyDestructivePolicyConfigEntryRepair(existingPluginEntries[configKey], plugin.pluginName) ? { allow_destructive_actions: "auto" } : {}
|
|
975
|
+
};
|
|
976
|
+
const conflict = !ctx.overwrite && hasExistingCodexPluginEntry(existingPluginEntries, configKey, plugin.pluginName, plannedEntry);
|
|
955
977
|
items.push(createMigrationItem({
|
|
956
978
|
id: `plugin:${configKey}`,
|
|
957
979
|
kind: "plugin",
|
|
@@ -967,6 +989,7 @@ function buildPluginItems(ctx, plugins) {
|
|
|
967
989
|
pluginName: plugin.pluginName,
|
|
968
990
|
sourceInstalled: plugin.installed === true,
|
|
969
991
|
sourceEnabled: plugin.enabled === true,
|
|
992
|
+
...plannedEntry.allow_destructive_actions === "auto" ? { allowDestructiveActions: "auto" } : {},
|
|
970
993
|
...plugin.apps && plugin.apps.length > 0 && !shouldVerifyPluginApps(ctx) ? { sourceAppVerification: CODEX_PLUGIN_SOURCE_APP_VERIFICATION_UNVERIFIED } : {}
|
|
971
994
|
}
|
|
972
995
|
}));
|
|
@@ -1012,18 +1035,37 @@ function readCodexPluginMigrationConfigEntry(item, enabled) {
|
|
|
1012
1035
|
return {
|
|
1013
1036
|
configKey,
|
|
1014
1037
|
pluginName,
|
|
1015
|
-
enabled
|
|
1038
|
+
enabled,
|
|
1039
|
+
...item.details?.allowDestructiveActions === "auto" ? { allowDestructiveActions: "auto" } : {}
|
|
1016
1040
|
};
|
|
1017
1041
|
}
|
|
1018
1042
|
function readExistingAllowDestructiveActions(config) {
|
|
1019
|
-
return
|
|
1043
|
+
return normalizeExistingAllowDestructiveActions(readMigrationConfigPath(config, [...CODEX_PLUGIN_NATIVE_CONFIG_PATH, "allow_destructive_actions"]));
|
|
1044
|
+
}
|
|
1045
|
+
function normalizeExistingAllowDestructiveActions(value) {
|
|
1046
|
+
return value === "auto" || value === "on-request" ? "auto" : asBoolean(value);
|
|
1047
|
+
}
|
|
1048
|
+
function readExistingPluginPolicyRepairs(config) {
|
|
1049
|
+
if (config === void 0) return {};
|
|
1050
|
+
return Object.fromEntries(Object.entries(readExistingCodexPluginEntries(config)).flatMap(([configKey, entry]) => {
|
|
1051
|
+
const pluginEntry = isRecord(entry) ? entry : void 0;
|
|
1052
|
+
if (pluginEntry?.allow_destructive_actions !== "on-request") return [];
|
|
1053
|
+
return [[configKey, {
|
|
1054
|
+
...pluginEntry,
|
|
1055
|
+
allow_destructive_actions: "auto"
|
|
1056
|
+
}]];
|
|
1057
|
+
}));
|
|
1020
1058
|
}
|
|
1021
1059
|
function buildCodexPluginsConfigValue(entries, params = {}) {
|
|
1022
|
-
const plugins =
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1060
|
+
const plugins = {
|
|
1061
|
+
...readExistingPluginPolicyRepairs(params.config),
|
|
1062
|
+
...Object.fromEntries(entries.toSorted((a, b) => a.configKey.localeCompare(b.configKey)).map((entry) => [entry.configKey, {
|
|
1063
|
+
enabled: entry.enabled,
|
|
1064
|
+
marketplaceName: CODEX_PLUGINS_MARKETPLACE_NAME,
|
|
1065
|
+
pluginName: entry.pluginName,
|
|
1066
|
+
...entry.allowDestructiveActions ? { allow_destructive_actions: entry.allowDestructiveActions } : {}
|
|
1067
|
+
}]))
|
|
1068
|
+
};
|
|
1027
1069
|
return {
|
|
1028
1070
|
enabled: true,
|
|
1029
1071
|
config: { codexPlugins: {
|
|
@@ -1043,12 +1085,13 @@ function hasCodexPluginConfigConflict(config, value) {
|
|
|
1043
1085
|
if (!isRecord(existingNativeConfig)) return true;
|
|
1044
1086
|
if (existingNativeConfig.enabled !== void 0 && existingNativeConfig.enabled !== true) return true;
|
|
1045
1087
|
const allowDestructiveActions = nativeConfig.allow_destructive_actions;
|
|
1046
|
-
|
|
1088
|
+
const existingAllowDestructiveActions = normalizeExistingAllowDestructiveActions(existingNativeConfig.allow_destructive_actions);
|
|
1089
|
+
if (existingNativeConfig.allow_destructive_actions !== void 0 && existingAllowDestructiveActions !== allowDestructiveActions) return true;
|
|
1047
1090
|
const plugins = nativeConfig.plugins;
|
|
1048
1091
|
if (!isRecord(plugins)) return false;
|
|
1049
1092
|
return Object.entries(plugins).some(([configKey, plugin]) => {
|
|
1050
1093
|
if (!isRecord(plugin)) return existingNativeConfig[configKey] !== void 0;
|
|
1051
|
-
return hasExistingCodexPluginEntry(readExistingCodexPluginEntries(config), configKey, typeof plugin.pluginName === "string" ? plugin.pluginName : configKey);
|
|
1094
|
+
return hasExistingCodexPluginEntry(readExistingCodexPluginEntries(config), configKey, typeof plugin.pluginName === "string" ? plugin.pluginName : configKey, plugin);
|
|
1052
1095
|
});
|
|
1053
1096
|
}
|
|
1054
1097
|
function buildPluginConfigItem(ctx, pluginItems) {
|
|
@@ -1429,7 +1472,8 @@ function readCodexPluginPolicy(item) {
|
|
|
1429
1472
|
marketplaceName: CODEX_PLUGINS_MARKETPLACE_NAME,
|
|
1430
1473
|
pluginName,
|
|
1431
1474
|
enabled: true,
|
|
1432
|
-
allowDestructiveActions: true
|
|
1475
|
+
allowDestructiveActions: true,
|
|
1476
|
+
destructiveApprovalMode: "allow"
|
|
1433
1477
|
};
|
|
1434
1478
|
}
|
|
1435
1479
|
function codexPluginActivationReportState(result) {
|
|
@@ -1495,6 +1539,42 @@ function buildCodexMigrationProvider(params = {}) {
|
|
|
1495
1539
|
};
|
|
1496
1540
|
}
|
|
1497
1541
|
//#endregion
|
|
1542
|
+
//#region extensions/codex/src/web-search-provider.ts
|
|
1543
|
+
let codexWebSearchRuntimePromise;
|
|
1544
|
+
function loadCodexWebSearchRuntime() {
|
|
1545
|
+
codexWebSearchRuntimePromise ??= import("./web-search-provider.runtime-BWG_oqLf.js");
|
|
1546
|
+
return codexWebSearchRuntimePromise;
|
|
1547
|
+
}
|
|
1548
|
+
const CodexWebSearchSchema = {
|
|
1549
|
+
type: "object",
|
|
1550
|
+
properties: { query: {
|
|
1551
|
+
type: "string",
|
|
1552
|
+
description: "Search query. Include the desired region, time range, and constraints."
|
|
1553
|
+
} },
|
|
1554
|
+
required: ["query"],
|
|
1555
|
+
additionalProperties: false
|
|
1556
|
+
};
|
|
1557
|
+
function createCodexWebSearchProvider(options = {}) {
|
|
1558
|
+
return {
|
|
1559
|
+
...createCodexWebSearchProviderBase(),
|
|
1560
|
+
createTool: (ctx) => {
|
|
1561
|
+
const nativeConfig = ctx.searchConfig?.openaiCodex;
|
|
1562
|
+
if (nativeConfig && typeof nativeConfig === "object" && !Array.isArray(nativeConfig) && nativeConfig.enabled === false) return null;
|
|
1563
|
+
return {
|
|
1564
|
+
description: "Search the current web through Codex hosted search and return a grounded answer with source URLs.",
|
|
1565
|
+
parameters: CodexWebSearchSchema,
|
|
1566
|
+
execute: async (args, executionContext) => {
|
|
1567
|
+
const { executeCodexWebSearchProviderTool } = await loadCodexWebSearchRuntime();
|
|
1568
|
+
return await executeCodexWebSearchProviderTool(ctx, args, executionContext, {
|
|
1569
|
+
pluginConfig: options.resolvePluginConfig?.() ?? resolvePluginConfigObject(ctx.config, "codex"),
|
|
1570
|
+
clientFactory: options.clientFactory
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
};
|
|
1574
|
+
}
|
|
1575
|
+
};
|
|
1576
|
+
}
|
|
1577
|
+
//#endregion
|
|
1498
1578
|
//#region extensions/codex/index.ts
|
|
1499
1579
|
var codex_default = definePluginEntry({
|
|
1500
1580
|
id: "codex",
|
|
@@ -1506,6 +1586,7 @@ var codex_default = definePluginEntry({
|
|
|
1506
1586
|
api.registerAgentHarness(createCodexAppServerAgentHarness({ resolvePluginConfig: resolveCurrentPluginConfig }));
|
|
1507
1587
|
api.registerProvider(buildCodexProvider({ pluginConfig: api.pluginConfig }));
|
|
1508
1588
|
api.registerMediaUnderstandingProvider(buildCodexMediaUnderstandingProvider({ pluginConfig: api.pluginConfig }));
|
|
1589
|
+
api.registerWebSearchProvider(createCodexWebSearchProvider({ resolvePluginConfig: resolveCurrentPluginConfig }));
|
|
1509
1590
|
api.registerMigrationProvider(buildCodexMigrationProvider({ runtime: api.runtime }));
|
|
1510
1591
|
for (const command of createCodexCliSessionNodeHostCommands()) api.registerNodeHostCommand(command);
|
|
1511
1592
|
for (const policy of createCodexCliSessionNodeInvokePolicies()) api.registerNodeInvokePolicy(policy);
|