@openclaw/codex 2026.7.2-beta.3 → 2026.7.2-beta.5
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/{app-server-policy-DUMF2Xyr.js → app-server-policy-BmDgseo_.js} +1 -1
- package/dist/attempt-client-cleanup-Ia52yRWc.js +127 -0
- package/dist/{attempt-notifications-Ecjyzufe.js → attempt-notifications-CMR2_fmR.js} +1 -1
- package/dist/{media-understanding-provider-IPNNQre6.js → bounded-turn-FEbUXoYT.js} +71 -188
- package/dist/capabilities-BHRSI6Cn.js +36 -0
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-NCTL7A2q.js → command-formatters-ico4ZFnk.js} +3 -37
- package/dist/{command-handlers-DtFbZiba.js → command-handlers-CRmnwI2N.js} +1233 -1221
- package/dist/{compact-Kgy26gIM.js → compact-dEN49UH6.js} +8 -7
- package/dist/{computer-use-C7x4ZaqR.js → computer-use-BjGylO-E.js} +16 -6
- package/dist/{conversation-control-B0s3aIjT.js → conversation-control-DE7d9DOj.js} +6 -5
- package/dist/doctor-contract-api.js +24 -86
- package/dist/{dynamic-tools-D_vSVmv9.js → dynamic-tools-LIt9ojep.js} +135 -2696
- package/dist/event-projector-assistant-message-DTgnPPVF.js +101 -0
- package/dist/event-projector-usage-tvgb1NCX.js +69 -0
- package/dist/harness.js +31 -11
- package/dist/incognito-session-ET_ufDH-.js +2 -0
- package/dist/index.js +250 -275
- package/dist/media-understanding-provider.js +173 -1
- package/dist/{models-DD5zBdX5.js → models-BA01NEez.js} +2 -2
- package/dist/{notification-correlation-C8DVQ_Bq.js → notification-correlation-Bj_Ak_jI.js} +3 -3
- package/dist/{plugin-app-cache-key-DJbhLYSK.js → plugin-app-cache-key-DSXX-rXO.js} +5 -5
- package/dist/{transcript-mirror-D9rTxx2P.js → protocol-validators-Dm4eXZmt.js} +335 -595
- package/dist/{rate-limits-CqhWQ2R9.js → rate-limits-S_PXs0ul.js} +1 -1
- package/dist/realtime-voice-api-BPcA1uN9.js +494 -0
- package/dist/realtime-voice-api.js +2 -0
- package/dist/{request-9yf9pZjf.js → request-CXpPennK.js} +1 -1
- package/dist/{run-attempt-BIoO8ISr.js → run-attempt-C5GTPJOE.js} +3111 -387
- package/dist/{session-binding-Bmt20HfB.js → session-binding-DlVQ-Pxs.js} +957 -890
- package/dist/{session-catalog-CA7R-hX2.js → session-catalog-CP2oCcEb.js} +98 -87
- package/dist/{session-cli-Bxk3-Wqz.js → session-cli-CqZ0Fp2a.js} +2 -2
- package/dist/session-upstream-marker-QE-m5QFG.js +82 -0
- package/dist/settled-turn-finalizer-CA_2QXIE.js +303 -0
- package/dist/{shared-client-CSXLtCLE.js → shared-client-BVKE40c-.js} +1870 -1694
- package/dist/{side-question-DtzquMOb.js → side-question-CO12sHxo.js} +24 -16
- package/dist/{thread-lifecycle-CQ_9mAa1.js → thread-lifecycle-DRg_FdzC.js} +127 -153
- package/dist/transcript-mirror-uKA-A4tB.js +550 -0
- package/dist/upstream-session-fork-_Vrz4WJr.js +320 -0
- package/dist/{usage-CuPpFgTc.js → usage-UpVbdX5G.js} +3 -3
- package/dist/{web-search-provider.runtime-_x5XTeqh.js → web-search-provider.runtime-CaQMYDbp.js} +3 -3
- package/package.json +7 -8
- package/npm-shrinkwrap.json +0 -202
- package/dist/{auth-binding-C1czuHPA.js → auth-binding-B4FfbcCg.js} +1 -1
|
@@ -1,2 +1,174 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-FEbUXoYT.js";
|
|
2
|
+
import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
|
|
3
|
+
//#region extensions/codex/media-understanding-provider.ts
|
|
4
|
+
/**
|
|
5
|
+
* Codex-backed media understanding provider for bounded image description and
|
|
6
|
+
* structured extraction turns.
|
|
7
|
+
*/
|
|
8
|
+
const CODEX_MEDIA_PROVIDER_ID = "codex";
|
|
9
|
+
const DEFAULT_CODEX_IMAGE_MODEL = "gpt-5.6-sol";
|
|
10
|
+
const DEFAULT_CODEX_IMAGE_PROMPT = "Describe the image.";
|
|
11
|
+
/**
|
|
12
|
+
* Builds the media-understanding provider that delegates image tasks to an
|
|
13
|
+
* isolated Codex app-server session.
|
|
14
|
+
*/
|
|
15
|
+
function buildCodexMediaUnderstandingProvider(options = {}) {
|
|
16
|
+
return {
|
|
17
|
+
id: CODEX_MEDIA_PROVIDER_ID,
|
|
18
|
+
capabilities: ["image"],
|
|
19
|
+
defaultModels: { image: DEFAULT_CODEX_IMAGE_MODEL },
|
|
20
|
+
describeImage: async (req) => describeCodexImages({
|
|
21
|
+
images: [{
|
|
22
|
+
buffer: req.buffer,
|
|
23
|
+
fileName: req.fileName,
|
|
24
|
+
mime: req.mime
|
|
25
|
+
}],
|
|
26
|
+
provider: req.provider,
|
|
27
|
+
model: req.model,
|
|
28
|
+
prompt: req.prompt,
|
|
29
|
+
maxTokens: req.maxTokens,
|
|
30
|
+
timeoutMs: req.timeoutMs,
|
|
31
|
+
...req.signal ? { signal: req.signal } : {},
|
|
32
|
+
profile: req.profile,
|
|
33
|
+
preferredProfile: req.preferredProfile,
|
|
34
|
+
authStore: req.authStore,
|
|
35
|
+
agentDir: req.agentDir,
|
|
36
|
+
cfg: req.cfg
|
|
37
|
+
}, options),
|
|
38
|
+
describeImages: async (req) => describeCodexImages(req, options),
|
|
39
|
+
extractStructured: async (req) => extractCodexStructured(req, options)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
async function describeCodexImages(req, options) {
|
|
43
|
+
const model = req.model.trim();
|
|
44
|
+
if (!model) throw new Error("Codex image understanding requires model id.");
|
|
45
|
+
req.signal?.throwIfAborted();
|
|
46
|
+
const { text } = await runBoundedCodexAppServerTurn({
|
|
47
|
+
config: req.cfg,
|
|
48
|
+
model: {
|
|
49
|
+
mode: "required",
|
|
50
|
+
id: model
|
|
51
|
+
},
|
|
52
|
+
profile: req.profile,
|
|
53
|
+
timeoutMs: req.timeoutMs,
|
|
54
|
+
signal: req.signal,
|
|
55
|
+
agentDir: req.agentDir,
|
|
56
|
+
authProfileStore: req.authStore,
|
|
57
|
+
options,
|
|
58
|
+
taskLabel: "image understanding",
|
|
59
|
+
developerInstructions: "You are OpenClaw's bounded image-understanding worker. Describe only the provided image content. Do not call tools, edit files, or ask follow-up questions.",
|
|
60
|
+
input: [{
|
|
61
|
+
type: "text",
|
|
62
|
+
text: buildCodexImagePrompt(req),
|
|
63
|
+
text_elements: []
|
|
64
|
+
}, ...req.images.map((image) => ({
|
|
65
|
+
type: "image",
|
|
66
|
+
url: `data:${image.mime ?? "image/png"};base64,${image.buffer.toString("base64")}`
|
|
67
|
+
}))],
|
|
68
|
+
requiredModalities: ["text", "image"],
|
|
69
|
+
isolation: "configured-transport"
|
|
70
|
+
});
|
|
71
|
+
return {
|
|
72
|
+
text,
|
|
73
|
+
model
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
async function extractCodexStructured(req, options) {
|
|
77
|
+
const model = req.model.trim();
|
|
78
|
+
if (!model) throw new Error("Codex structured extraction requires model id.");
|
|
79
|
+
if (!req.instructions.trim()) throw new Error("Codex structured extraction requires instructions.");
|
|
80
|
+
if (req.input.length === 0) throw new Error("Codex structured extraction requires at least one input.");
|
|
81
|
+
if (!req.input.some((entry) => entry.type === "image")) throw new Error("Codex structured extraction requires at least one image input.");
|
|
82
|
+
req.signal?.throwIfAborted();
|
|
83
|
+
const { text } = await runBoundedCodexAppServerTurn({
|
|
84
|
+
config: req.cfg,
|
|
85
|
+
model: {
|
|
86
|
+
mode: "required",
|
|
87
|
+
id: model
|
|
88
|
+
},
|
|
89
|
+
profile: req.profile,
|
|
90
|
+
timeoutMs: req.timeoutMs,
|
|
91
|
+
signal: req.signal,
|
|
92
|
+
agentDir: req.agentDir,
|
|
93
|
+
authProfileStore: req.authStore,
|
|
94
|
+
options,
|
|
95
|
+
taskLabel: "structured extraction",
|
|
96
|
+
developerInstructions: "You are OpenClaw's bounded structured-extraction worker. Return only the requested extraction. Do not call tools, edit files, ask follow-up questions, or include secrets.",
|
|
97
|
+
input: buildCodexStructuredInput(req),
|
|
98
|
+
requiredModalities: requiredStructuredModalities(),
|
|
99
|
+
isolation: "configured-transport"
|
|
100
|
+
});
|
|
101
|
+
return normalizeStructuredExtractionResult({
|
|
102
|
+
text,
|
|
103
|
+
model,
|
|
104
|
+
provider: req.provider,
|
|
105
|
+
req
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function buildCodexImagePrompt(req) {
|
|
109
|
+
const prompt = req.prompt?.trim() || DEFAULT_CODEX_IMAGE_PROMPT;
|
|
110
|
+
if (req.images.length <= 1) return prompt;
|
|
111
|
+
return `${prompt}\n\nAnalyze all ${req.images.length} images together.`;
|
|
112
|
+
}
|
|
113
|
+
function requiredStructuredModalities() {
|
|
114
|
+
return ["text", "image"];
|
|
115
|
+
}
|
|
116
|
+
function buildCodexStructuredInput(req) {
|
|
117
|
+
return [{
|
|
118
|
+
type: "text",
|
|
119
|
+
text: buildStructuredExtractionPrompt(req),
|
|
120
|
+
text_elements: []
|
|
121
|
+
}, ...req.input.map((entry) => {
|
|
122
|
+
if (entry.type === "text") return {
|
|
123
|
+
type: "text",
|
|
124
|
+
text: entry.text,
|
|
125
|
+
text_elements: []
|
|
126
|
+
};
|
|
127
|
+
return {
|
|
128
|
+
type: "image",
|
|
129
|
+
url: `data:${entry.mime ?? "image/png"};base64,${entry.buffer.toString("base64")}`
|
|
130
|
+
};
|
|
131
|
+
})];
|
|
132
|
+
}
|
|
133
|
+
function buildStructuredExtractionPrompt(req) {
|
|
134
|
+
return [
|
|
135
|
+
req.instructions.trim(),
|
|
136
|
+
req.schemaName ? `Schema name: ${req.schemaName}` : void 0,
|
|
137
|
+
req.jsonSchema ? `JSON schema:\n${JSON.stringify(req.jsonSchema)}` : void 0,
|
|
138
|
+
req.jsonMode === false ? "Return the extraction as concise text." : "Return valid JSON only. Do not wrap the JSON in Markdown fences."
|
|
139
|
+
].filter((part) => Boolean(part)).join("\n\n");
|
|
140
|
+
}
|
|
141
|
+
function isJsonSchemaObject(value) {
|
|
142
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
143
|
+
}
|
|
144
|
+
function normalizeStructuredExtractionResult(params) {
|
|
145
|
+
const result = {
|
|
146
|
+
text: params.text,
|
|
147
|
+
model: params.model,
|
|
148
|
+
provider: params.provider,
|
|
149
|
+
contentType: params.req.jsonMode === false ? "text" : "json"
|
|
150
|
+
};
|
|
151
|
+
if (params.req.jsonMode !== false) {
|
|
152
|
+
try {
|
|
153
|
+
result.parsed = JSON.parse(params.text);
|
|
154
|
+
} catch {
|
|
155
|
+
throw new Error("Codex structured extraction returned invalid JSON.");
|
|
156
|
+
}
|
|
157
|
+
if (isJsonSchemaObject(params.req.jsonSchema)) {
|
|
158
|
+
const validation = validateJsonSchemaValue({
|
|
159
|
+
schema: params.req.jsonSchema,
|
|
160
|
+
cacheKey: "codex.media-understanding.extractStructured",
|
|
161
|
+
value: result.parsed,
|
|
162
|
+
cache: false
|
|
163
|
+
});
|
|
164
|
+
if (!validation.ok) {
|
|
165
|
+
const message = validation.errors.map((error) => error.text).join("; ") || "invalid";
|
|
166
|
+
throw new Error(`Codex structured extraction JSON did not match schema: ${message}`);
|
|
167
|
+
}
|
|
168
|
+
result.parsed = validation.value;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
//#endregion
|
|
2
174
|
export { buildCodexMediaUnderstandingProvider };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as readCodexModelListResponse } from "./protocol-validators-Dm4eXZmt.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-
|
|
43
|
+
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-BVKE40c-.js").then((n) => n.p);
|
|
44
44
|
const client = useSharedClient ? await getLeasedSharedCodexAppServerClient({
|
|
45
45
|
startOptions: options.startOptions,
|
|
46
46
|
timeoutMs,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-
|
|
1
|
+
import { V as isJsonObject } from "./shared-client-BVKE40c-.js";
|
|
2
|
+
import { T as readCodexPluginConfig, g as resolveCodexSupervisionAppServerRuntimeOptions, p as resolveCodexAppServerRuntimeOptions } from "./session-binding-DlVQ-Pxs.js";
|
|
3
|
+
import { t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-DSXX-rXO.js";
|
|
4
4
|
//#region extensions/codex/src/app-server/binding-connection.ts
|
|
5
5
|
/** Requires the native model pair after a supervised pending branch has materialized. */
|
|
6
6
|
function requireCodexSupervisionModelSelection(binding) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { U as resolveCodexAppServerHomeDir } from "./shared-client-BVKE40c-.js";
|
|
2
|
+
import { x as resolveCodexAppServerUserHomeDir } from "./session-binding-DlVQ-Pxs.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { isFutureDateTimestampMs, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
5
|
-
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
6
|
-
import { createHash } from "node:crypto";
|
|
7
|
-
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
5
|
import { OPENCLAW_VERSION, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
6
|
+
import { createHash } from "node:crypto";
|
|
9
7
|
import { readPluginPackageVersion } from "openclaw/plugin-sdk/extension-shared";
|
|
8
|
+
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
10
10
|
//#region extensions/codex/src/app-server/app-inventory-cache.ts
|
|
11
11
|
/**
|
|
12
12
|
* Process-local cache for Codex app-server app inventories, keyed by runtime
|