@openclaw/codex 2026.5.25-beta.1 → 2026.5.26-beta.1
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/{client-SrtuTTVa.js → client-BVK_jmHW.js} +1 -1
- package/dist/{client-factory-A7DQkSLq.js → client-factory-CaOpX89B.js} +1 -1
- package/dist/{command-handlers-CLtPT37L.js → command-handlers-D4C2y46B.js} +8 -8
- package/dist/{compact-acCua7zr.js → compact-CRI0BEc_.js} +3 -3
- package/dist/{computer-use-CVfE2Vfb.js → computer-use-CDDlIBhY.js} +2 -2
- package/dist/{config-D6TUuyo2.js → config-0-UN67Qg.js} +2 -1
- package/dist/{conversation-binding-B-GevkEb.js → conversation-binding-BnnjOmgs.js} +7 -7
- package/dist/{dynamic-tools-BXAE1U1-.js → dynamic-tools-BG9ICyU4.js} +1 -1
- package/dist/harness.js +5 -5
- package/dist/index.js +8 -8
- package/dist/media-understanding-provider.js +7 -7
- package/dist/{models-CC2IusQs.js → models-ASKu9eOY.js} +2 -2
- package/dist/{notification-correlation-D7tJW3FW.js → notification-correlation-YINts3PA.js} +1 -1
- package/dist/{protocol-validators-_gKDcd0x.js → protocol-validators-CSuFMLvY.js} +138 -29
- package/dist/provider.js +2 -2
- package/dist/{request-BO0z3vA8.js → request-DmBkYLPy.js} +3 -3
- package/dist/{run-attempt-BjoI3hUJ.js → run-attempt-CFBsGx1T.js} +221 -62
- package/dist/{session-binding-CwNOIDP2.js → session-binding-UFjjws4k.js} +1 -1
- package/dist/{shared-client-CZP1DjaN.js → shared-client-Fou5nAyt.js} +65 -9
- package/dist/{side-question-Cb4COOQ9.js → side-question-fq_T2d_x.js} +9 -9
- package/dist/test-api.js +3 -3
- package/dist/{thread-lifecycle-CXMd9UgJ.js → thread-lifecycle-BapIT9Qs.js} +107 -20
- package/dist/{vision-tools-CETeQgze.js → vision-tools-B30YCKRK.js} +2 -2
- package/npm-shrinkwrap.json +7 -77
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
1
|
+
import { l as resolveCodexAppServerRuntimeOptions } from "./config-0-UN67Qg.js";
|
|
2
2
|
import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
|
|
3
3
|
import { OPENCLAW_VERSION, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
4
4
|
import { createInterface } from "node:readline";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region extensions/codex/src/app-server/client-factory.ts
|
|
2
|
-
const defaultCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config) => import("./shared-client-
|
|
2
|
+
const defaultCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config) => import("./shared-client-Fou5nAyt.js").then((n) => n.a).then(({ getSharedCodexAppServerClient }) => getSharedCodexAppServerClient({
|
|
3
3
|
startOptions,
|
|
4
4
|
authProfileId,
|
|
5
5
|
agentDir,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as isCodexFastServiceTier, l as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
-
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-
|
|
3
|
-
import { l as isJsonObject } from "./client-
|
|
4
|
-
import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
5
|
-
import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-
|
|
6
|
-
import { _ as summarizeCodexAccountUsage, a as buildHelp, c as formatCodexStatus, d as formatModels, f as formatThreads, l as formatComputerUseStatus, o as formatAccount, p as readString$1, s as formatCodexDisplayText, u as formatList } from "./notification-correlation-
|
|
1
|
+
import { a as isCodexFastServiceTier, l as resolveCodexAppServerRuntimeOptions } from "./config-0-UN67Qg.js";
|
|
2
|
+
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-ASKu9eOY.js";
|
|
3
|
+
import { l as isJsonObject } from "./client-BVK_jmHW.js";
|
|
4
|
+
import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-UFjjws4k.js";
|
|
5
|
+
import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-DmBkYLPy.js";
|
|
6
|
+
import { _ as summarizeCodexAccountUsage, a as buildHelp, c as formatCodexStatus, d as formatModels, f as formatThreads, l as formatComputerUseStatus, o as formatAccount, p as readString$1, s as formatCodexDisplayText, u as formatList } from "./notification-correlation-YINts3PA.js";
|
|
7
7
|
import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-CTnEWuor.js";
|
|
8
|
-
import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, m as setCodexConversationFastMode, o as formatCodexCliSessions, p as readCodexConversationActiveTurn, r as startCodexConversationThread, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./conversation-binding-
|
|
9
|
-
import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-
|
|
8
|
+
import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, m as setCodexConversationFastMode, o as formatCodexCliSessions, p as readCodexConversationActiveTurn, r as startCodexConversationThread, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./conversation-binding-BnnjOmgs.js";
|
|
9
|
+
import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-CDDlIBhY.js";
|
|
10
10
|
import { n as rememberCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
|
|
11
11
|
import crypto from "node:crypto";
|
|
12
12
|
import { normalizeOptionalString, normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as defaultCodexAppServerClientFactory } from "./client-factory-
|
|
2
|
-
import { l as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
3
|
-
import { i as readCodexAppServerBinding } from "./session-binding-
|
|
1
|
+
import { t as defaultCodexAppServerClientFactory } from "./client-factory-CaOpX89B.js";
|
|
2
|
+
import { l as resolveCodexAppServerRuntimeOptions } from "./config-0-UN67Qg.js";
|
|
3
|
+
import { i as readCodexAppServerBinding } from "./session-binding-UFjjws4k.js";
|
|
4
4
|
import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-CTnEWuor.js";
|
|
5
5
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as resolveCodexAppServerRuntimeOptions, u as resolveCodexComputerUseConfig } from "./config-
|
|
2
|
-
import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-
|
|
1
|
+
import { l as resolveCodexAppServerRuntimeOptions, u as resolveCodexComputerUseConfig } from "./config-0-UN67Qg.js";
|
|
2
|
+
import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-DmBkYLPy.js";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
//#region extensions/codex/src/app-server/computer-use.ts
|
|
5
5
|
var CodexComputerUseSetupError = class extends Error {
|
|
@@ -221,7 +221,8 @@ function codexAppServerStartOptionsKey(options, params = {}) {
|
|
|
221
221
|
env: Object.entries(options.env ?? {}).toSorted(([left], [right]) => left.localeCompare(right)).map(([key, value]) => [key, hashSecretForKey(value, `env:${key}`)]),
|
|
222
222
|
clearEnv: [...options.clearEnv ?? []].toSorted(),
|
|
223
223
|
authProfileId: params.authProfileId ?? null,
|
|
224
|
-
agentDir: params.agentDir ?? null
|
|
224
|
+
agentDir: params.agentDir ?? null,
|
|
225
|
+
fallbackApiKeyCacheKey: params.fallbackApiKeyCacheKey ?? null
|
|
225
226
|
});
|
|
226
227
|
}
|
|
227
228
|
function codexSandboxPolicyForTurn(mode, cwd) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as isCodexFastServiceTier, l as resolveCodexAppServerRuntimeOptions, r as codexSandboxPolicyForTurn } from "./config-
|
|
2
|
-
import { l as isJsonObject } from "./client-
|
|
3
|
-
import { t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-
|
|
4
|
-
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, r as normalizeCodexAppServerBindingModelProvider, t as clearCodexAppServerBinding } from "./session-binding-
|
|
5
|
-
import { r as CODEX_CONTROL_METHODS } from "./request-
|
|
6
|
-
import { i as readCodexNotificationTurnId, r as readCodexNotificationThreadId, s as formatCodexDisplayText } from "./notification-correlation-
|
|
7
|
-
import { i as getSharedCodexAppServerClient, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-
|
|
1
|
+
import { a as isCodexFastServiceTier, l as resolveCodexAppServerRuntimeOptions, r as codexSandboxPolicyForTurn } from "./config-0-UN67Qg.js";
|
|
2
|
+
import { l as isJsonObject } from "./client-BVK_jmHW.js";
|
|
3
|
+
import { t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-BapIT9Qs.js";
|
|
4
|
+
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, r as normalizeCodexAppServerBindingModelProvider, t as clearCodexAppServerBinding } from "./session-binding-UFjjws4k.js";
|
|
5
|
+
import { r as CODEX_CONTROL_METHODS } from "./request-DmBkYLPy.js";
|
|
6
|
+
import { i as readCodexNotificationTurnId, r as readCodexNotificationThreadId, s as formatCodexDisplayText } from "./notification-correlation-YINts3PA.js";
|
|
7
|
+
import { i as getSharedCodexAppServerClient, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-Fou5nAyt.js";
|
|
8
8
|
import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-CTnEWuor.js";
|
|
9
9
|
import os from "node:os";
|
|
10
10
|
import { asOptionalRecord, isRecord, normalizeSingleOrTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as sanitizeInlineImageDataUrl, w as invalidInlineImageText } from "./thread-lifecycle-BapIT9Qs.js";
|
|
2
2
|
import { asOptionalRecord, isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { HEARTBEAT_RESPONSE_TOOL_NAME, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, extractToolResultMediaArtifact, filterToolResultMediaUrls, isMessagingTool, isMessagingToolSendAction, isToolWrappedWithBeforeToolCallHook, normalizeHeartbeatToolResponse, runAgentHarnessAfterToolCallHook, setBeforeToolCallDiagnosticsEnabled, wrapToolWithBeforeToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
4
4
|
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
package/dist/harness.js
CHANGED
|
@@ -28,31 +28,31 @@ function createCodexAppServerAgentHarness(options) {
|
|
|
28
28
|
};
|
|
29
29
|
},
|
|
30
30
|
runAttempt: async (params) => {
|
|
31
|
-
const { runCodexAppServerAttempt } = await import("./run-attempt-
|
|
31
|
+
const { runCodexAppServerAttempt } = await import("./run-attempt-CFBsGx1T.js");
|
|
32
32
|
return runCodexAppServerAttempt(params, {
|
|
33
33
|
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
34
34
|
nativeHookRelay: { enabled: true }
|
|
35
35
|
});
|
|
36
36
|
},
|
|
37
37
|
runSideQuestion: async (params) => {
|
|
38
|
-
const { runCodexAppServerSideQuestion } = await import("./side-question-
|
|
38
|
+
const { runCodexAppServerSideQuestion } = await import("./side-question-fq_T2d_x.js");
|
|
39
39
|
return runCodexAppServerSideQuestion(params, {
|
|
40
40
|
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
41
41
|
nativeHookRelay: { enabled: true }
|
|
42
42
|
});
|
|
43
43
|
},
|
|
44
44
|
compact: async (params) => {
|
|
45
|
-
const { maybeCompactCodexAppServerSession } = await import("./compact-
|
|
45
|
+
const { maybeCompactCodexAppServerSession } = await import("./compact-CRI0BEc_.js");
|
|
46
46
|
return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
|
|
47
47
|
},
|
|
48
48
|
reset: async (params) => {
|
|
49
49
|
if (params.sessionFile) {
|
|
50
|
-
const { clearCodexAppServerBinding } = await import("./session-binding-
|
|
50
|
+
const { clearCodexAppServerBinding } = await import("./session-binding-UFjjws4k.js").then((n) => n.a);
|
|
51
51
|
await clearCodexAppServerBinding(params.sessionFile);
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
dispose: async () => {
|
|
55
|
-
const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-
|
|
55
|
+
const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-Fou5nAyt.js").then((n) => n.a);
|
|
56
56
|
await clearSharedCodexAppServerClientAndWait();
|
|
57
57
|
}
|
|
58
58
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createCodexAppServerAgentHarness } from "./harness.js";
|
|
2
|
-
import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-
|
|
2
|
+
import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-0-UN67Qg.js";
|
|
3
3
|
import { buildCodexProvider } from "./provider.js";
|
|
4
|
-
import {
|
|
4
|
+
import { C as defaultCodexAppInventoryCache, b as ensureCodexPluginActivation, x as pluginReadParams } from "./thread-lifecycle-BapIT9Qs.js";
|
|
5
5
|
import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
6
|
-
import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-
|
|
7
|
-
import { s as formatCodexDisplayText } from "./notification-correlation-
|
|
8
|
-
import { c as resolveCodexAppServerAuthAccountCacheKey, d as
|
|
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-
|
|
6
|
+
import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-DmBkYLPy.js";
|
|
7
|
+
import { s as formatCodexDisplayText } from "./notification-correlation-YINts3PA.js";
|
|
8
|
+
import { c as resolveCodexAppServerAuthAccountCacheKey, d as resolveCodexAppServerFallbackApiKeyCacheKey, i as getSharedCodexAppServerClient, n as clearSharedCodexAppServerClientIfCurrentAndWait, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-Fou5nAyt.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-BnnjOmgs.js";
|
|
10
10
|
import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
|
|
11
11
|
import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
12
12
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
@@ -47,7 +47,7 @@ async function handleCodexCommand(ctx, options = {}) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
async function loadDefaultCodexSubcommandHandler() {
|
|
50
|
-
const { handleCodexSubcommand } = await import("./command-handlers-
|
|
50
|
+
const { handleCodexSubcommand } = await import("./command-handlers-D4C2y46B.js");
|
|
51
51
|
return handleCodexSubcommand;
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
@@ -1404,7 +1404,7 @@ async function buildTargetCodexPluginAppCacheKey(ctx) {
|
|
|
1404
1404
|
agentDir: targets.agentDir,
|
|
1405
1405
|
config: ctx.config
|
|
1406
1406
|
});
|
|
1407
|
-
const envApiKeyFingerprint = authProfileId ? void 0 :
|
|
1407
|
+
const envApiKeyFingerprint = authProfileId ? void 0 : resolveCodexAppServerFallbackApiKeyCacheKey({ startOptions: appServer.start });
|
|
1408
1408
|
return buildCodexPluginAppCacheKey({
|
|
1409
1409
|
appServer,
|
|
1410
1410
|
agentDir: targets.agentDir,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
|
|
2
|
-
import "./client-factory-
|
|
3
|
-
import { l as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
4
|
-
import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-
|
|
5
|
-
import { i as readModelListResult } from "./models-
|
|
6
|
-
import { l as isJsonObject } from "./client-
|
|
7
|
-
import { r as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-
|
|
2
|
+
import "./client-factory-CaOpX89B.js";
|
|
3
|
+
import { l as resolveCodexAppServerRuntimeOptions } from "./config-0-UN67Qg.js";
|
|
4
|
+
import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-CSuFMLvY.js";
|
|
5
|
+
import { i as readModelListResult } from "./models-ASKu9eOY.js";
|
|
6
|
+
import { l as isJsonObject } from "./client-BVK_jmHW.js";
|
|
7
|
+
import { r as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-BapIT9Qs.js";
|
|
8
8
|
import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
|
|
9
9
|
import "openclaw/plugin-sdk/media-understanding";
|
|
10
10
|
//#region extensions/codex/media-understanding-provider.ts
|
|
@@ -65,7 +65,7 @@ async function runBoundedCodexVisionTurn(params) {
|
|
|
65
65
|
const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: params.options.pluginConfig });
|
|
66
66
|
const timeoutMs = Math.max(100, params.timeoutMs);
|
|
67
67
|
const ownsClient = !params.options.clientFactory;
|
|
68
|
-
const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-
|
|
68
|
+
const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-Fou5nAyt.js").then((n) => n.a).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
|
|
69
69
|
startOptions: appServer.start,
|
|
70
70
|
timeoutMs,
|
|
71
71
|
authProfileId: params.profile
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { s as readCodexModelListResponse } from "./protocol-validators-
|
|
2
|
+
import { s as readCodexModelListResponse } from "./protocol-validators-CSuFMLvY.js";
|
|
3
3
|
import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
//#region extensions/codex/src/app-server/models.ts
|
|
5
5
|
var models_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -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, getSharedCodexAppServerClient } = await import("./shared-client-
|
|
43
|
+
const { createIsolatedCodexAppServerClient, getSharedCodexAppServerClient } = await import("./shared-client-Fou5nAyt.js").then((n) => n.a);
|
|
44
44
|
const client = useSharedClient ? await getSharedCodexAppServerClient({
|
|
45
45
|
startOptions: options.startOptions,
|
|
46
46
|
timeoutMs,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as isJsonObject } from "./client-
|
|
1
|
+
import { l as isJsonObject } from "./client-BVK_jmHW.js";
|
|
2
2
|
import { asFiniteNumber } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/codex/src/app-server/rate-limits.ts
|
|
4
4
|
const CODEX_LIMIT_ID = "codex";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Compile } from "typebox/compile";
|
|
2
2
|
//#region extensions/codex/src/app-server/protocol-generated/json/DynamicToolCallParams.json
|
|
3
3
|
var DynamicToolCallParams_default = {
|
|
4
4
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
@@ -5856,52 +5856,158 @@ var TurnStartResponse_default = {
|
|
|
5856
5856
|
};
|
|
5857
5857
|
//#endregion
|
|
5858
5858
|
//#region extensions/codex/src/app-server/protocol-validators.ts
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
}
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
const
|
|
5870
|
-
|
|
5871
|
-
|
|
5859
|
+
function compileCodexSchema(schema) {
|
|
5860
|
+
const validator = Compile(normalizeJsonSchemaNode(schema));
|
|
5861
|
+
return {
|
|
5862
|
+
check: (value) => validator.Check(value),
|
|
5863
|
+
errors: (value) => [...validator.Errors(value)]
|
|
5864
|
+
};
|
|
5865
|
+
}
|
|
5866
|
+
function isRecord(value) {
|
|
5867
|
+
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
5868
|
+
}
|
|
5869
|
+
const schemaMapKeywords = new Set([
|
|
5870
|
+
"$defs",
|
|
5871
|
+
"definitions",
|
|
5872
|
+
"dependentSchemas",
|
|
5873
|
+
"patternProperties",
|
|
5874
|
+
"properties"
|
|
5875
|
+
]);
|
|
5876
|
+
const schemaValueKeywords = new Set([
|
|
5877
|
+
"additionalItems",
|
|
5878
|
+
"additionalProperties",
|
|
5879
|
+
"contains",
|
|
5880
|
+
"else",
|
|
5881
|
+
"if",
|
|
5882
|
+
"items",
|
|
5883
|
+
"not",
|
|
5884
|
+
"propertyNames",
|
|
5885
|
+
"then",
|
|
5886
|
+
"unevaluatedItems",
|
|
5887
|
+
"unevaluatedProperties"
|
|
5888
|
+
]);
|
|
5889
|
+
const schemaArrayKeywords = new Set([
|
|
5890
|
+
"allOf",
|
|
5891
|
+
"anyOf",
|
|
5892
|
+
"oneOf",
|
|
5893
|
+
"prefixItems"
|
|
5894
|
+
]);
|
|
5895
|
+
function schemaTypeIncludes(schema, type) {
|
|
5896
|
+
return schema.type === type || Array.isArray(schema.type) && schema.type.includes(type);
|
|
5897
|
+
}
|
|
5898
|
+
function normalizeSchemaMap(value) {
|
|
5899
|
+
if (!isRecord(value)) return value;
|
|
5900
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, normalizeJsonSchemaNode(entry)]));
|
|
5901
|
+
}
|
|
5902
|
+
function expandJsonSchemaTypeArray(schema) {
|
|
5903
|
+
const { type, ...rest } = schema;
|
|
5904
|
+
if (!Array.isArray(type)) return schema;
|
|
5905
|
+
return { anyOf: type.map((entry) => Object.assign({}, rest, { type: entry })) };
|
|
5906
|
+
}
|
|
5907
|
+
function normalizeJsonSchemaNode(schema) {
|
|
5908
|
+
if (Array.isArray(schema)) return schema.map((entry) => normalizeJsonSchemaNode(entry));
|
|
5909
|
+
if (!isRecord(schema)) return schema;
|
|
5910
|
+
const normalizedSchema = expandJsonSchemaTypeArray(schema);
|
|
5911
|
+
return Object.fromEntries(Object.entries(normalizedSchema).map(([key, value]) => {
|
|
5912
|
+
if (schemaMapKeywords.has(key)) return [key, normalizeSchemaMap(value)];
|
|
5913
|
+
if (schemaValueKeywords.has(key) || schemaArrayKeywords.has(key)) return [key, normalizeJsonSchemaNode(value)];
|
|
5914
|
+
return [key, value];
|
|
5915
|
+
}));
|
|
5916
|
+
}
|
|
5917
|
+
function readDefault(schema) {
|
|
5918
|
+
if (!isRecord(schema) || !Object.prototype.hasOwnProperty.call(schema, "default")) return;
|
|
5919
|
+
return structuredClone(schema.default);
|
|
5920
|
+
}
|
|
5921
|
+
function decodePointerSegment(segment) {
|
|
5922
|
+
return segment.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
5923
|
+
}
|
|
5924
|
+
function resolveLocalRef(root, ref) {
|
|
5925
|
+
if (ref === "#") return root;
|
|
5926
|
+
if (!ref.startsWith("#/")) return;
|
|
5927
|
+
let current = root;
|
|
5928
|
+
for (const segment of ref.slice(2).split("/").map(decodePointerSegment)) {
|
|
5929
|
+
if (!isRecord(current)) return;
|
|
5930
|
+
current = current[segment];
|
|
5931
|
+
}
|
|
5932
|
+
return current;
|
|
5933
|
+
}
|
|
5934
|
+
function applySchemaDefaults(schema, value, root = schema, resolvingRefs = /* @__PURE__ */ new Set()) {
|
|
5935
|
+
if (value === void 0) {
|
|
5936
|
+
const defaultValue = readDefault(schema);
|
|
5937
|
+
if (defaultValue !== void 0) return defaultValue;
|
|
5938
|
+
}
|
|
5939
|
+
if (!isRecord(schema)) return value;
|
|
5940
|
+
let nextValue = value;
|
|
5941
|
+
if (typeof schema.$ref === "string" && !resolvingRefs.has(schema.$ref)) {
|
|
5942
|
+
const target = resolveLocalRef(root, schema.$ref);
|
|
5943
|
+
if (target !== void 0) {
|
|
5944
|
+
resolvingRefs.add(schema.$ref);
|
|
5945
|
+
nextValue = applySchemaDefaults(target, nextValue, root, resolvingRefs);
|
|
5946
|
+
resolvingRefs.delete(schema.$ref);
|
|
5947
|
+
}
|
|
5948
|
+
}
|
|
5949
|
+
for (const key of ["allOf"]) {
|
|
5950
|
+
const branches = schema[key];
|
|
5951
|
+
if (Array.isArray(branches)) for (const branch of branches) nextValue = applySchemaDefaults(branch, nextValue, root, resolvingRefs);
|
|
5952
|
+
}
|
|
5953
|
+
if (schemaTypeIncludes(schema, "object") && isRecord(nextValue) && isRecord(schema.properties)) {
|
|
5954
|
+
for (const [key, propertySchema] of Object.entries(schema.properties)) {
|
|
5955
|
+
const currentValue = nextValue[key];
|
|
5956
|
+
const defaultedValue = applySchemaDefaults(propertySchema, currentValue, root, resolvingRefs);
|
|
5957
|
+
if (defaultedValue !== void 0 && defaultedValue !== currentValue) nextValue[key] = defaultedValue;
|
|
5958
|
+
}
|
|
5959
|
+
if (isRecord(schema.additionalProperties)) for (const key of Object.keys(nextValue)) {
|
|
5960
|
+
if (Object.prototype.hasOwnProperty.call(schema.properties, key)) continue;
|
|
5961
|
+
nextValue[key] = applySchemaDefaults(schema.additionalProperties, nextValue[key], root, resolvingRefs);
|
|
5962
|
+
}
|
|
5963
|
+
}
|
|
5964
|
+
if (schemaTypeIncludes(schema, "array") && Array.isArray(nextValue) && isRecord(schema.items)) return nextValue.map((entry) => applySchemaDefaults(schema.items, entry, root, resolvingRefs));
|
|
5965
|
+
return nextValue;
|
|
5966
|
+
}
|
|
5967
|
+
function normalizeWithDefaults(schema, value) {
|
|
5968
|
+
if (value === void 0 || value === null) return value;
|
|
5969
|
+
return applySchemaDefaults(schema, structuredClone(value));
|
|
5970
|
+
}
|
|
5971
|
+
const validateDynamicToolCallParams = compileCodexSchema(DynamicToolCallParams_default);
|
|
5972
|
+
const validateErrorNotification = compileCodexSchema(ErrorNotification_default);
|
|
5973
|
+
const validateModelListResponse = compileCodexSchema(ModelListResponse_default);
|
|
5974
|
+
const validateThreadResumeResponse = compileCodexSchema(ThreadResumeResponse_default);
|
|
5975
|
+
const validateThreadStartResponse = compileCodexSchema(ThreadStartResponse_default);
|
|
5976
|
+
const validateTurnCompletedNotification = compileCodexSchema(TurnCompletedNotification_default);
|
|
5977
|
+
const validateTurnStartResponse = compileCodexSchema(TurnStartResponse_default);
|
|
5872
5978
|
function assertCodexThreadStartResponse(value) {
|
|
5873
|
-
return assertCodexShape(validateThreadStartResponse, normalizeThreadResponse(value), "thread/start response");
|
|
5979
|
+
return assertCodexShape(validateThreadStartResponse, normalizeWithDefaults(ThreadStartResponse_default, normalizeThreadResponse(value)), "thread/start response");
|
|
5874
5980
|
}
|
|
5875
5981
|
function assertCodexThreadForkResponse(value) {
|
|
5876
|
-
return assertCodexShape(validateThreadStartResponse, normalizeThreadResponse(value), "thread/fork response");
|
|
5982
|
+
return assertCodexShape(validateThreadStartResponse, normalizeWithDefaults(ThreadStartResponse_default, normalizeThreadResponse(value)), "thread/fork response");
|
|
5877
5983
|
}
|
|
5878
5984
|
function assertCodexThreadResumeResponse(value) {
|
|
5879
|
-
return assertCodexShape(validateThreadResumeResponse, normalizeThreadResponse(value), "thread/resume response");
|
|
5985
|
+
return assertCodexShape(validateThreadResumeResponse, normalizeWithDefaults(ThreadResumeResponse_default, normalizeThreadResponse(value)), "thread/resume response");
|
|
5880
5986
|
}
|
|
5881
5987
|
function assertCodexTurnStartResponse(value) {
|
|
5882
|
-
return assertCodexShape(validateTurnStartResponse, normalizeTurnStartResponse(value), "turn/start response");
|
|
5988
|
+
return assertCodexShape(validateTurnStartResponse, normalizeWithDefaults(TurnStartResponse_default, normalizeTurnStartResponse(value)), "turn/start response");
|
|
5883
5989
|
}
|
|
5884
5990
|
function readCodexDynamicToolCallParams(value) {
|
|
5885
|
-
return readCodexShape(validateDynamicToolCallParams, value);
|
|
5991
|
+
return readCodexShape(validateDynamicToolCallParams, normalizeWithDefaults(DynamicToolCallParams_default, value));
|
|
5886
5992
|
}
|
|
5887
5993
|
function readCodexErrorNotification(value) {
|
|
5888
|
-
return readCodexShape(validateErrorNotification, value);
|
|
5994
|
+
return readCodexShape(validateErrorNotification, normalizeWithDefaults(ErrorNotification_default, value));
|
|
5889
5995
|
}
|
|
5890
5996
|
function readCodexModelListResponse(value) {
|
|
5891
|
-
return readCodexShape(validateModelListResponse, value);
|
|
5997
|
+
return readCodexShape(validateModelListResponse, normalizeWithDefaults(ModelListResponse_default, value));
|
|
5892
5998
|
}
|
|
5893
5999
|
function readCodexTurn(value) {
|
|
5894
|
-
return readCodexShape(validateTurnStartResponse, { turn: normalizeTurn(value) })?.turn;
|
|
6000
|
+
return readCodexShape(validateTurnStartResponse, normalizeWithDefaults(TurnStartResponse_default, { turn: normalizeTurn(value) }))?.turn;
|
|
5895
6001
|
}
|
|
5896
6002
|
function readCodexTurnCompletedNotification(value) {
|
|
5897
|
-
return readCodexShape(validateTurnCompletedNotification, normalizeTurnCompletedNotification(value));
|
|
6003
|
+
return readCodexShape(validateTurnCompletedNotification, normalizeWithDefaults(TurnCompletedNotification_default, normalizeTurnCompletedNotification(value)));
|
|
5898
6004
|
}
|
|
5899
6005
|
function assertCodexShape(validate, value, label) {
|
|
5900
|
-
if (validate(value)) return value;
|
|
5901
|
-
throw new Error(`Invalid Codex app-server ${label}: ${
|
|
6006
|
+
if (validate.check(value)) return value;
|
|
6007
|
+
throw new Error(`Invalid Codex app-server ${label}: ${formatValidationErrors(validate, value)}`);
|
|
5902
6008
|
}
|
|
5903
6009
|
function readCodexShape(validate, value) {
|
|
5904
|
-
return validate(value) ? value : void 0;
|
|
6010
|
+
return validate.check(value) ? value : void 0;
|
|
5905
6011
|
}
|
|
5906
6012
|
function normalizeTurn(value) {
|
|
5907
6013
|
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
|
|
@@ -5979,10 +6085,13 @@ function normalizeTurnCompletedNotification(value) {
|
|
|
5979
6085
|
turn: normalizeTurn(value.turn)
|
|
5980
6086
|
};
|
|
5981
6087
|
}
|
|
5982
|
-
function
|
|
5983
|
-
const errors = validate.errors;
|
|
6088
|
+
function formatValidationErrors(validate, value) {
|
|
6089
|
+
const errors = validate.errors(value);
|
|
5984
6090
|
if (!errors || errors.length === 0) return "schema validation failed";
|
|
5985
|
-
return
|
|
6091
|
+
return errors.map((error) => {
|
|
6092
|
+
const message = error.message?.trim() || "schema validation failed";
|
|
6093
|
+
return error.instancePath ? `${error.instancePath} ${message}` : message;
|
|
6094
|
+
}).join("; ");
|
|
5986
6095
|
}
|
|
5987
6096
|
//#endregion
|
|
5988
6097
|
export { readCodexDynamicToolCallParams as a, readCodexTurn as c, assertCodexTurnStartResponse as i, readCodexTurnCompletedNotification as l, assertCodexThreadResumeResponse as n, readCodexErrorNotification as o, assertCodexThreadStartResponse as r, readCodexModelListResponse as s, assertCodexThreadForkResponse as t };
|
package/dist/provider.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CODEX_APP_SERVER_AUTH_MARKER, CODEX_BASE_URL, CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS, buildCodexModelDefinition, buildCodexProviderConfig } from "./provider-catalog.js";
|
|
2
|
-
import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
+
import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions } from "./config-0-UN67Qg.js";
|
|
3
3
|
import { resolveCodexSystemPromptContribution } from "./prompt-overlay.js";
|
|
4
4
|
import { resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
5
5
|
import { normalizeModelCompat } from "openclaw/plugin-sdk/provider-model-shared";
|
|
@@ -123,7 +123,7 @@ async function listModelsBestEffort(params) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
async function listCodexAppServerModelsLazy(options) {
|
|
126
|
-
const { listCodexAppServerModels } = await import("./models-
|
|
126
|
+
const { listCodexAppServerModels } = await import("./models-ASKu9eOY.js").then((n) => n.r);
|
|
127
127
|
return listCodexAppServerModels(options);
|
|
128
128
|
}
|
|
129
129
|
function normalizeTimeoutMs(value) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as CodexAppServerRpcError } from "./client-
|
|
2
|
-
import {
|
|
3
|
-
import { f as resolveCodexAppServerHomeDir, i as getSharedCodexAppServerClient, o as withTimeout, r as createIsolatedCodexAppServerClient } from "./shared-client-
|
|
1
|
+
import { n as CodexAppServerRpcError } from "./client-BVK_jmHW.js";
|
|
2
|
+
import { S as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-BapIT9Qs.js";
|
|
3
|
+
import { f as resolveCodexAppServerHomeDir, i as getSharedCodexAppServerClient, o as withTimeout, r as createIsolatedCodexAppServerClient } from "./shared-client-Fou5nAyt.js";
|
|
4
4
|
import { t as resolveCodexAppServerDirectSandboxBypassBlock } from "./sandbox-guard-CTnEWuor.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
//#region extensions/codex/src/app-server/capabilities.ts
|