@openclaw/codex 2026.5.20 → 2026.5.22
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-Ab4Fw77C.js → client-D3SUwPFl.js} +14 -8
- package/dist/{client-factory-BbesECdh.js → client-factory-DdrIY1lw.js} +1 -1
- package/dist/{command-handlers-Gceg_rBZ.js → command-handlers-DsB0GYd2.js} +64 -7
- package/dist/{compact-BaSDurdH.js → compact-BwQn7jKq.js} +186 -40
- package/dist/{computer-use-B4iTog6z.js → computer-use-BMMwWwno.js} +2 -2
- package/dist/{config-DqIp6oTk.js → config-DDMrwfJl.js} +21 -2
- package/dist/dynamic-tools-DA42no4X.js +497 -0
- package/dist/harness.js +15 -5
- package/dist/index.js +10 -9
- package/dist/media-understanding-provider.js +6 -3
- package/dist/{models-C8MdOXGD.js → models-B_uo1pf5.js} +1 -1
- package/dist/{node-cli-sessions-T1olB1SH.js → node-cli-sessions-yVCifOyG.js} +23 -9
- package/dist/{command-formatters-BVBnEgyA.js → notification-correlation-qKY_sgga.js} +66 -15
- package/dist/provider.js +3 -3
- package/dist/{request-BePR77QD.js → request-NklFaHM4.js} +12 -3
- package/dist/{run-attempt-CRHVB240.js → run-attempt-DzlLXP5Y.js} +3750 -1409
- package/dist/sandbox-guard-CTnEWuor.js +233 -0
- package/dist/{session-binding-DEiYHgJ_.js → session-binding-Bw_mfIW2.js} +4 -2
- package/dist/{shared-client-DCxJx5QU.js → shared-client-C_RbGxW8.js} +2 -2
- package/dist/{side-question-DlJAUYst.js → side-question-DzP1wClA.js} +20 -15
- package/dist/test-api.js +3 -2
- package/dist/{thread-lifecycle-Cgi62SSl.js → thread-lifecycle-4Ul7RoW4.js} +606 -589
- package/dist/{vision-tools-B2wt6ecs.js → vision-tools-DOnxzH2y.js} +7 -3
- package/npm-shrinkwrap.json +1934 -0
- package/openclaw.plugin.json +29 -0
- package/package.json +8 -6
- package/dist/plugin-activation-BkQkPLOY.js +0 -452
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { a as isCodexFastServiceTier,
|
|
1
|
+
import { a as isCodexFastServiceTier, l as resolveCodexAppServerRuntimeOptions, r as codexSandboxPolicyForTurn } from "./config-DDMrwfJl.js";
|
|
2
2
|
import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
|
|
3
|
-
import { r as
|
|
4
|
-
import { r as
|
|
5
|
-
import { i as
|
|
6
|
-
import { i as
|
|
3
|
+
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, r as normalizeCodexAppServerBindingModelProvider, t as clearCodexAppServerBinding } from "./session-binding-Bw_mfIW2.js";
|
|
4
|
+
import { r as CODEX_CONTROL_METHODS } from "./request-NklFaHM4.js";
|
|
5
|
+
import { i as readCodexNotificationTurnId, r as readCodexNotificationThreadId, s as formatCodexDisplayText } from "./notification-correlation-qKY_sgga.js";
|
|
6
|
+
import { i as getSharedCodexAppServerClient, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-C_RbGxW8.js";
|
|
7
|
+
import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-CTnEWuor.js";
|
|
7
8
|
import os from "node:os";
|
|
9
|
+
import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
|
|
8
10
|
import { formatErrorMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
9
11
|
import { spawn } from "node:child_process";
|
|
10
|
-
import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
|
|
11
12
|
import fs from "node:fs/promises";
|
|
12
13
|
import path from "node:path";
|
|
13
14
|
import { fileURLToPath } from "node:url";
|
|
@@ -281,7 +282,7 @@ function createCodexConversationTurnCollector(threadId) {
|
|
|
281
282
|
};
|
|
282
283
|
const handleNotification = (notification) => {
|
|
283
284
|
const params = isJsonObject(notification.params) ? notification.params : void 0;
|
|
284
|
-
if (!params ||
|
|
285
|
+
if (!params || readCodexNotificationThreadId(params) !== threadId) return;
|
|
285
286
|
if (!turnId) {
|
|
286
287
|
const pendingTurnId = readNotificationTurnId(params);
|
|
287
288
|
if (pendingTurnId) {
|
|
@@ -354,14 +355,14 @@ function createCodexConversationTurnCollector(threadId) {
|
|
|
354
355
|
};
|
|
355
356
|
}
|
|
356
357
|
function isNotificationForTurn(params, threadId, turnId) {
|
|
357
|
-
if (
|
|
358
|
+
if (readCodexNotificationThreadId(params) !== threadId) return false;
|
|
358
359
|
if (!turnId) return true;
|
|
359
360
|
const directTurnId = readString(params, "turnId");
|
|
360
361
|
if (directTurnId) return directTurnId === turnId;
|
|
361
362
|
return readString(isJsonObject(params.turn) ? params.turn : void 0, "id") === turnId;
|
|
362
363
|
}
|
|
363
364
|
function readNotificationTurnId(params) {
|
|
364
|
-
return
|
|
365
|
+
return readCodexNotificationTurnId(params);
|
|
365
366
|
}
|
|
366
367
|
function readRecord(value) {
|
|
367
368
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -506,6 +507,19 @@ async function handleCodexConversationInboundClaim(event, ctx, options = {}) {
|
|
|
506
507
|
if (event.commandAuthorized !== true) return { handled: true };
|
|
507
508
|
const prompt = event.bodyForAgent?.trim() || event.content?.trim() || "";
|
|
508
509
|
if (!prompt) return { handled: true };
|
|
510
|
+
const nativeExecutionBlock = data.kind === "codex-cli-node-session" ? resolveCodexNativeSandboxBlock({
|
|
511
|
+
config: options.config,
|
|
512
|
+
sessionKey: event.sessionKey ?? ctx.sessionKey,
|
|
513
|
+
surface: "Codex CLI node conversation binding"
|
|
514
|
+
}) : resolveCodexNativeExecutionBlock({
|
|
515
|
+
config: options.config,
|
|
516
|
+
sessionKey: event.sessionKey ?? ctx.sessionKey,
|
|
517
|
+
surface: "Codex app-server conversation binding"
|
|
518
|
+
});
|
|
519
|
+
if (nativeExecutionBlock) return {
|
|
520
|
+
handled: true,
|
|
521
|
+
reply: { text: nativeExecutionBlock }
|
|
522
|
+
};
|
|
509
523
|
if (data.kind === "codex-cli-node-session") {
|
|
510
524
|
const resume = options.resumeCodexCliSessionOnNode;
|
|
511
525
|
if (!resume) return {
|
|
@@ -88,7 +88,7 @@ function summarizeRateLimitSnapshot(snapshot, nowMs) {
|
|
|
88
88
|
const window = readRateLimitWindow(snapshot, key);
|
|
89
89
|
return window ? [formatRateLimitWindow(key, window, nowMs)] : [];
|
|
90
90
|
});
|
|
91
|
-
const reachedType = readString$
|
|
91
|
+
const reachedType = readString$2(snapshot, "rateLimitReachedType") ?? readString$2(snapshot, "rate_limit_reached_type");
|
|
92
92
|
const suffix = reachedType ? ` (${formatReachedType(reachedType)})` : "";
|
|
93
93
|
if (windows.length > 0) return `${label}: ${windows.join(" · ")}${suffix}`;
|
|
94
94
|
if (reachedType) return `${label}: ${formatReachedType(reachedType)}`;
|
|
@@ -149,7 +149,7 @@ function readRateLimitWindow(snapshot, key) {
|
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
function snapshotHasDisplayableData(snapshot) {
|
|
152
|
-
if (readString$
|
|
152
|
+
if (readString$2(snapshot, "rateLimitReachedType") ?? readString$2(snapshot, "rate_limit_reached_type")) return true;
|
|
153
153
|
return readWindowEntries(snapshot).some((entry) => entry.window.usedPercent !== void 0 || entry.window.resetsAtMs > 0);
|
|
154
154
|
}
|
|
155
155
|
function readOptionalNumberField(record, ...keys) {
|
|
@@ -178,7 +178,7 @@ function formatAccountResetTime(resetsAtMs, nowMs) {
|
|
|
178
178
|
return `${formatCalendarResetTime(resetsAtMs, nowMs)} (in ${formatRelativeDuration(resetsAtMs - nowMs)})`;
|
|
179
179
|
}
|
|
180
180
|
function snapshotHasLimitBlock(snapshot) {
|
|
181
|
-
return Boolean(readString$
|
|
181
|
+
return Boolean(readString$2(snapshot, "rateLimitReachedType") ?? readString$2(snapshot, "rate_limit_reached_type") ?? readWindowEntries(snapshot).some((entry) => entry.window.usedPercent !== void 0 && entry.window.usedPercent >= 100));
|
|
182
182
|
}
|
|
183
183
|
function isCodexLimitSnapshot(snapshot) {
|
|
184
184
|
const id = readNullableString(snapshot, "limitId") ?? readNullableString(snapshot, "limit_id");
|
|
@@ -280,12 +280,12 @@ function extractCodexRetryHint(message) {
|
|
|
280
280
|
if (tryAgainAt?.[1]) return tryAgainAt[1].trim();
|
|
281
281
|
return /\btry again\s+((?:tomorrow|in\s+[^.!?\n]+)[^.!?\n]*)(?:[.!?]|$)/iu.exec(message)?.[1]?.trim();
|
|
282
282
|
}
|
|
283
|
-
function readString$
|
|
283
|
+
function readString$2(record, key) {
|
|
284
284
|
const value = record[key];
|
|
285
285
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
286
286
|
}
|
|
287
287
|
function readNullableString(record, key) {
|
|
288
|
-
return readString$
|
|
288
|
+
return readString$2(record, key) ?? void 0;
|
|
289
289
|
}
|
|
290
290
|
function readNumber(record, key) {
|
|
291
291
|
const value = record[key];
|
|
@@ -318,12 +318,12 @@ function formatThreads(response) {
|
|
|
318
318
|
if (threads.length === 0) return "No Codex threads returned.";
|
|
319
319
|
return ["Codex threads:", ...threads.slice(0, 10).map((thread) => {
|
|
320
320
|
const record = isJsonObject(thread) ? thread : {};
|
|
321
|
-
const id = readString(record, "threadId") ?? readString(record, "id") ?? "<unknown>";
|
|
322
|
-
const title = readString(record, "title") ?? readString(record, "name") ?? readString(record, "summary");
|
|
321
|
+
const id = readString$1(record, "threadId") ?? readString$1(record, "id") ?? "<unknown>";
|
|
322
|
+
const title = readString$1(record, "title") ?? readString$1(record, "name") ?? readString$1(record, "summary");
|
|
323
323
|
const details = [
|
|
324
|
-
readString(record, "model"),
|
|
325
|
-
readString(record, "cwd"),
|
|
326
|
-
readString(record, "updatedAt") ?? readString(record, "lastUpdatedAt")
|
|
324
|
+
readString$1(record, "model"),
|
|
325
|
+
readString$1(record, "cwd"),
|
|
326
|
+
readString$1(record, "updatedAt") ?? readString$1(record, "lastUpdatedAt")
|
|
327
327
|
].filter((value) => Boolean(value));
|
|
328
328
|
return `- ${formatCodexDisplayText(id)}${title ? ` - ${formatCodexDisplayText(title)}` : ""}${details.length > 0 ? ` (${details.map(formatCodexDisplayText).join(", ")})` : ""}\n Resume: ${formatCodexResumeHint(id)}`;
|
|
329
329
|
})].join("\n");
|
|
@@ -370,7 +370,7 @@ function formatList(response, label) {
|
|
|
370
370
|
if (entries.length === 0) return `${label}: none returned.`;
|
|
371
371
|
return [`${label}:`, ...entries.slice(0, 25).map((entry) => {
|
|
372
372
|
const record = isJsonObject(entry) ? entry : {};
|
|
373
|
-
return `- ${formatCodexDisplayText(readString(record, "name") ?? readString(record, "id") ?? JSON.stringify(entry))}`;
|
|
373
|
+
return `- ${formatCodexDisplayText(readString$1(record, "name") ?? readString$1(record, "id") ?? JSON.stringify(entry))}`;
|
|
374
374
|
})].join("\n");
|
|
375
375
|
}
|
|
376
376
|
const CODEX_RESUME_SAFE_THREAD_ID_PATTERN = /^[A-Za-z0-9._:-]+$/;
|
|
@@ -455,8 +455,8 @@ function buildHelp() {
|
|
|
455
455
|
function summarizeAccount(value) {
|
|
456
456
|
if (!isJsonObject(value)) return "unavailable";
|
|
457
457
|
const account = isJsonObject(value.account) ? value.account : value;
|
|
458
|
-
if (readString(account, "type") === "amazonBedrock") return "Amazon Bedrock";
|
|
459
|
-
return readString(account, "email") ?? readString(account, "accountEmail") ?? readString(account, "planType") ?? readString(account, "id") ?? "available";
|
|
458
|
+
if (readString$1(account, "type") === "amazonBedrock") return "Amazon Bedrock";
|
|
459
|
+
return readString$1(account, "email") ?? readString$1(account, "accountEmail") ?? readString$1(account, "planType") ?? readString$1(account, "id") ?? "available";
|
|
460
460
|
}
|
|
461
461
|
function summarizeArrayLike(value) {
|
|
462
462
|
const entries = extractArray(value);
|
|
@@ -489,7 +489,7 @@ function summarizeRateLimits(value) {
|
|
|
489
489
|
}
|
|
490
490
|
function isMeaningfulRateLimitSnapshot(value) {
|
|
491
491
|
if (!isJsonObject(value)) return false;
|
|
492
|
-
if (readString(value, "rateLimitReachedType") ?? readString(value, "rate_limit_reached_type")) return true;
|
|
492
|
+
if (readString$1(value, "rateLimitReachedType") ?? readString$1(value, "rate_limit_reached_type")) return true;
|
|
493
493
|
return ["primary", "secondary"].some((key) => {
|
|
494
494
|
const window = value[key];
|
|
495
495
|
return isJsonObject(window) && Object.values(window).some((entry) => entry != null);
|
|
@@ -512,9 +512,60 @@ function extractArray(value) {
|
|
|
512
512
|
}
|
|
513
513
|
return [];
|
|
514
514
|
}
|
|
515
|
+
function readString$1(record, key) {
|
|
516
|
+
const value = record[key];
|
|
517
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
518
|
+
}
|
|
519
|
+
//#endregion
|
|
520
|
+
//#region extensions/codex/src/app-server/notification-correlation.ts
|
|
521
|
+
function isCodexNotificationForTurn(value, threadId, turnId) {
|
|
522
|
+
if (!isJsonObject(value)) return false;
|
|
523
|
+
return readCodexNotificationThreadId(value) === threadId && readCodexNotificationTurnId(value) === turnId;
|
|
524
|
+
}
|
|
525
|
+
function readCodexNotificationThreadId(record) {
|
|
526
|
+
return readNestedTurnThreadId(record) ?? readString(record, "threadId");
|
|
527
|
+
}
|
|
528
|
+
function readCodexNotificationTurnId(record) {
|
|
529
|
+
return readNestedTurnId(record) ?? readString(record, "turnId");
|
|
530
|
+
}
|
|
531
|
+
function describeCodexNotificationCorrelation(notification, active) {
|
|
532
|
+
const params = isJsonObject(notification.params) ? notification.params : void 0;
|
|
533
|
+
const turn = params && isJsonObject(params.turn) ? params.turn : void 0;
|
|
534
|
+
const threadId = params ? readString(params, "threadId") : void 0;
|
|
535
|
+
const turnId = params ? readString(params, "turnId") : void 0;
|
|
536
|
+
const nestedTurnThreadId = turn ? readString(turn, "threadId") : void 0;
|
|
537
|
+
const nestedTurnId = turn ? readString(turn, "id") : void 0;
|
|
538
|
+
const resolvedThreadId = params ? readCodexNotificationThreadId(params) : void 0;
|
|
539
|
+
const resolvedTurnId = params ? readCodexNotificationTurnId(params) : void 0;
|
|
540
|
+
const matchesActiveThread = resolvedThreadId === active.threadId;
|
|
541
|
+
const matchesActiveTurn = active.turnId ? matchesActiveThread && resolvedTurnId === active.turnId : void 0;
|
|
542
|
+
const items = turn?.items;
|
|
543
|
+
return {
|
|
544
|
+
method: notification.method,
|
|
545
|
+
...params ? { paramsKeys: Object.keys(params).toSorted() } : {},
|
|
546
|
+
activeThreadId: active.threadId,
|
|
547
|
+
...active.turnId ? { activeTurnId: active.turnId } : {},
|
|
548
|
+
...threadId ? { threadId } : {},
|
|
549
|
+
...turnId ? { turnId } : {},
|
|
550
|
+
...nestedTurnThreadId ? { nestedTurnThreadId } : {},
|
|
551
|
+
...nestedTurnId ? { nestedTurnId } : {},
|
|
552
|
+
...turn ? { turnStatus: readString(turn, "status") } : {},
|
|
553
|
+
...Array.isArray(items) ? { turnItemCount: items.length } : {},
|
|
554
|
+
matchesActiveThread,
|
|
555
|
+
...matchesActiveTurn === void 0 ? {} : { matchesActiveTurn }
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
function readNestedTurnId(record) {
|
|
559
|
+
const turn = record.turn;
|
|
560
|
+
return isJsonObject(turn) ? readString(turn, "id") : void 0;
|
|
561
|
+
}
|
|
562
|
+
function readNestedTurnThreadId(record) {
|
|
563
|
+
const turn = record.turn;
|
|
564
|
+
return isJsonObject(turn) ? readString(turn, "threadId") : void 0;
|
|
565
|
+
}
|
|
515
566
|
function readString(record, key) {
|
|
516
567
|
const value = record[key];
|
|
517
568
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
518
569
|
}
|
|
519
570
|
//#endregion
|
|
520
|
-
export {
|
|
571
|
+
export { summarizeCodexAccountUsage as _, buildHelp as a, formatCodexStatus as c, formatModels as d, formatThreads as f, shouldRefreshCodexRateLimitsForUsageLimitMessage as g, resolveCodexUsageLimitResetAtMs as h, readCodexNotificationTurnId as i, formatComputerUseStatus as l, formatCodexUsageLimitErrorMessage as m, isCodexNotificationForTurn as n, formatAccount as o, readString$1 as p, readCodexNotificationThreadId as r, formatCodexDisplayText as s, describeCodexNotificationCorrelation as t, formatList as u };
|
package/dist/provider.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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
|
|
2
|
+
import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions } from "./config-DDMrwfJl.js";
|
|
3
3
|
import { resolveCodexSystemPromptContribution } from "./prompt-overlay.js";
|
|
4
4
|
import { resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
5
|
-
import { createSubsystemLogger } from "openclaw/plugin-sdk/core";
|
|
6
5
|
import { normalizeModelCompat } from "openclaw/plugin-sdk/provider-model-shared";
|
|
6
|
+
import { createSubsystemLogger } from "openclaw/plugin-sdk/core";
|
|
7
7
|
//#region extensions/codex/provider.ts
|
|
8
8
|
const DEFAULT_DISCOVERY_TIMEOUT_MS = 2500;
|
|
9
9
|
const LIVE_DISCOVERY_ENV = "OPENCLAW_CODEX_DISCOVERY_LIVE";
|
|
@@ -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-B_uo1pf5.js").then((n) => n.r);
|
|
127
127
|
return listCodexAppServerModels(options);
|
|
128
128
|
}
|
|
129
129
|
function normalizeTimeoutMs(value) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { n as CodexAppServerRpcError } from "./client-
|
|
2
|
-
import {
|
|
3
|
-
import { i as
|
|
1
|
+
import { n as CodexAppServerRpcError } from "./client-D3SUwPFl.js";
|
|
2
|
+
import { y as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-4Ul7RoW4.js";
|
|
3
|
+
import { f as resolveCodexAppServerHomeDir, i as getSharedCodexAppServerClient, o as withTimeout, r as createIsolatedCodexAppServerClient } from "./shared-client-C_RbGxW8.js";
|
|
4
|
+
import { t as resolveCodexAppServerDirectSandboxBypassBlock } from "./sandbox-guard-CTnEWuor.js";
|
|
4
5
|
import { createHash } from "node:crypto";
|
|
5
6
|
//#region extensions/codex/src/app-server/capabilities.ts
|
|
6
7
|
const CODEX_CONTROL_METHODS = {
|
|
@@ -66,6 +67,14 @@ function fingerprintCodexPluginAppCacheCredentials(startOptions) {
|
|
|
66
67
|
//#endregion
|
|
67
68
|
//#region extensions/codex/src/app-server/request.ts
|
|
68
69
|
async function requestCodexAppServerJson(params) {
|
|
70
|
+
const sandboxBlock = resolveCodexAppServerDirectSandboxBypassBlock({
|
|
71
|
+
method: params.method,
|
|
72
|
+
requestParams: params.requestParams,
|
|
73
|
+
config: params.config,
|
|
74
|
+
sessionKey: params.sessionKey,
|
|
75
|
+
sessionId: params.sessionId
|
|
76
|
+
});
|
|
77
|
+
if (sandboxBlock) throw new Error(sandboxBlock);
|
|
69
78
|
const timeoutMs = params.timeoutMs ?? 6e4;
|
|
70
79
|
return await withTimeout((async () => {
|
|
71
80
|
const client = await (params.isolated ? createIsolatedCodexAppServerClient : getSharedCodexAppServerClient)({
|