@openclaw/codex 2026.7.2-beta.5 → 2026.7.33

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 (66) hide show
  1. package/README.md +3 -27
  2. package/dist/{command-formatters-ico4ZFnk.js → .setup/app-server-policy-C_qTMEMy.mjs} +51 -9
  3. package/dist/{attempt-notifications-CMR2_fmR.js → .setup/attempt-notifications-F8krwWL4.mjs} +6 -3
  4. package/dist/{command-handlers-CRmnwI2N.js → .setup/command-handlers-DSRFfor4.mjs} +1156 -1319
  5. package/dist/.setup/command-rpc-BvYsfQ7G.mjs +786 -0
  6. package/dist/{compact-dEN49UH6.js → .setup/compact-BNgh7I4t.mjs} +10 -40
  7. package/dist/.setup/computer-use-C3QkmSO3.mjs +377 -0
  8. package/dist/.setup/config-CYEDnLJ2.mjs +1138 -0
  9. package/dist/{conversation-binding-data-BHRpYbX3.js → .setup/conversation-binding-data-CrRxtDBu.mjs} +1 -1
  10. package/dist/{bounded-turn-FEbUXoYT.js → .setup/media-understanding-provider-EbJCyDqe.mjs} +193 -92
  11. package/dist/{models-BA01NEez.js → .setup/models-C_aZk03A.mjs} +11 -6
  12. package/dist/.setup/notification-correlation-iYs4WieS.mjs +35 -0
  13. package/dist/.setup/plugin-app-cache-key-DR8jV9oS.mjs +99 -0
  14. package/dist/.setup/protocol-2POPqAY4.mjs +13 -0
  15. package/dist/{protocol-validators-Dm4eXZmt.js → .setup/protocol-validators-dZQ-UTOa.mjs} +111 -334
  16. package/dist/{rate-limits-S_PXs0ul.js → .setup/provider-DGxDs6g8.mjs} +269 -13
  17. package/dist/{dynamic-tools-LIt9ojep.js → .setup/provider-capabilities-DS2N_zc1.mjs} +5465 -3399
  18. package/dist/.setup/request-DFR0JyoV.mjs +36 -0
  19. package/dist/.setup/run-attempt-C7xEKFVB.mjs +8180 -0
  20. package/dist/{sandbox-guard-D1Wky__S.js → .setup/sandbox-guard-DA2TQfZW.mjs} +1 -10
  21. package/dist/.setup/session-binding-DuihlMJc.mjs +628 -0
  22. package/dist/.setup/shared-client-B2KmLPRw.mjs +1854 -0
  23. package/dist/{side-question-CO12sHxo.js → .setup/side-question-Cv6JXWCS.mjs} +84 -159
  24. package/dist/{thread-lifecycle-DRg_FdzC.js → .setup/thread-lifecycle-u6CZdOOH.mjs} +1159 -1799
  25. package/dist/{web-search-provider.runtime-CaQMYDbp.js → .setup/web-search-provider.runtime-Ce2zOHxW.mjs} +3 -3
  26. package/dist/doctor-contract-api.js +122 -88
  27. package/dist/harness.js +20 -85
  28. package/dist/index.js +381 -1537
  29. package/dist/media-understanding-provider.js +1 -173
  30. package/dist/prompt-overlay.js +15 -0
  31. package/dist/provider-catalog.js +79 -0
  32. package/dist/provider-discovery.js +34 -0
  33. package/dist/provider.js +2 -0
  34. package/dist/web-search-contract-api.js +1 -1
  35. package/openclaw.plugin.json +178 -221
  36. package/package.json +8 -10
  37. package/dist/app-server-policy-BmDgseo_.js +0 -49
  38. package/dist/attempt-client-cleanup-Ia52yRWc.js +0 -127
  39. package/dist/auth-binding-B4FfbcCg.js +0 -62
  40. package/dist/capabilities-BHRSI6Cn.js +0 -36
  41. package/dist/cli-metadata.js +0 -20
  42. package/dist/computer-use-BjGylO-E.js +0 -695
  43. package/dist/conversation-control-DE7d9DOj.js +0 -287
  44. package/dist/event-projector-assistant-message-DTgnPPVF.js +0 -101
  45. package/dist/event-projector-usage-tvgb1NCX.js +0 -69
  46. package/dist/incognito-session-ET_ufDH-.js +0 -2
  47. package/dist/notification-correlation-Bj_Ak_jI.js +0 -67
  48. package/dist/plugin-app-cache-key-DSXX-rXO.js +0 -315
  49. package/dist/realtime-voice-api-BPcA1uN9.js +0 -494
  50. package/dist/realtime-voice-api.js +0 -2
  51. package/dist/request-CXpPennK.js +0 -157
  52. package/dist/run-attempt-C5GTPJOE.js +0 -11935
  53. package/dist/runtime-artifact-C2ITXdhM.js +0 -488
  54. package/dist/session-binding-DlVQ-Pxs.js +0 -2161
  55. package/dist/session-catalog-CP2oCcEb.js +0 -2444
  56. package/dist/session-cli-CqZ0Fp2a.js +0 -175
  57. package/dist/session-upstream-marker-QE-m5QFG.js +0 -82
  58. package/dist/settled-turn-finalizer-CA_2QXIE.js +0 -303
  59. package/dist/shared-client-BVKE40c-.js +0 -2952
  60. package/dist/transcript-mirror-uKA-A4tB.js +0 -550
  61. package/dist/transport-stdio-DXgGZ7Ib.js +0 -88
  62. package/dist/upstream-session-fork-_Vrz4WJr.js +0 -320
  63. package/dist/usage-UpVbdX5G.js +0 -25
  64. /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
  65. /package/dist/{session-binding-meta-B7aEMU7g.js → .setup/session-binding-meta-B7aEMU7g.mjs} +0 -0
  66. /package/dist/{web-search-provider.shared-BrZmlqyR.js → .setup/web-search-provider.shared-BrZmlqyR.mjs} +0 -0
@@ -1,174 +1,2 @@
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
1
+ import { t as buildCodexMediaUnderstandingProvider } from "./.setup/media-understanding-provider-EbJCyDqe.mjs";
174
2
  export { buildCodexMediaUnderstandingProvider };
@@ -0,0 +1,15 @@
1
+ import { GPT5_BEHAVIOR_CONTRACT, GPT5_HEARTBEAT_PROMPT_OVERLAY, resolveGpt5SystemPromptContribution } from "openclaw/plugin-sdk/provider-model-shared";
2
+ //#region extensions/codex/prompt-overlay.ts
3
+ /**
4
+ * Codex prompt-overlay facade for GPT-5 behavior and heartbeat guidance.
5
+ */
6
+ /** GPT-5 behavior contract re-exported under the Codex provider namespace. */
7
+ const CODEX_GPT5_BEHAVIOR_CONTRACT = GPT5_BEHAVIOR_CONTRACT;
8
+ /** Heartbeat prompt overlay re-exported under the Codex provider namespace. */
9
+ const CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY = GPT5_HEARTBEAT_PROMPT_OVERLAY;
10
+ /** Resolves the Codex system-prompt contribution for GPT-5-family models. */
11
+ function resolveCodexSystemPromptContribution(params) {
12
+ return resolveGpt5SystemPromptContribution(params);
13
+ }
14
+ //#endregion
15
+ export { CODEX_GPT5_BEHAVIOR_CONTRACT, CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY, resolveCodexSystemPromptContribution };
@@ -0,0 +1,79 @@
1
+ //#region extensions/codex/provider-catalog.ts
2
+ /** Provider id used by Codex model refs. */
3
+ const CODEX_PROVIDER_ID = "codex";
4
+ /** Synthetic base URL used to route Codex app-server model requests. */
5
+ const CODEX_BASE_URL = "https://chatgpt.com/backend-api";
6
+ /** Synthetic auth marker understood by Codex app-server runtime paths. */
7
+ const CODEX_APP_SERVER_AUTH_MARKER = "codex-app-server";
8
+ const DEFAULT_CONTEXT_WINDOW = 272e3;
9
+ const DEFAULT_MAX_TOKENS = 128e3;
10
+ /** Offline fallback catalog used when live app-server discovery is unavailable. */
11
+ const FALLBACK_CODEX_MODELS = [{
12
+ id: "gpt-5.5",
13
+ model: "gpt-5.5",
14
+ displayName: "gpt-5.5",
15
+ description: "Latest frontier agentic coding model.",
16
+ isDefault: true,
17
+ inputModalities: ["text", "image"],
18
+ supportedReasoningEfforts: [
19
+ "low",
20
+ "medium",
21
+ "high",
22
+ "xhigh"
23
+ ]
24
+ }, {
25
+ id: "gpt-5.4-mini",
26
+ model: "gpt-5.4-mini",
27
+ displayName: "GPT-5.4-Mini",
28
+ description: "Smaller frontier agentic coding model.",
29
+ inputModalities: ["text", "image"],
30
+ supportedReasoningEfforts: [
31
+ "low",
32
+ "medium",
33
+ "high",
34
+ "xhigh"
35
+ ]
36
+ }];
37
+ /**
38
+ * Converts a Codex app-server model record into OpenClaw provider model config.
39
+ */
40
+ function buildCodexModelDefinition(model) {
41
+ const id = model.id.trim() || model.model.trim();
42
+ const supportedReasoningEfforts = model.supportedReasoningEfforts;
43
+ return {
44
+ id,
45
+ name: model.displayName?.trim() || id,
46
+ api: "openai-chatgpt-responses",
47
+ reasoning: supportedReasoningEfforts !== void 0 ? supportedReasoningEfforts.length > 0 : shouldDefaultToReasoningModel(id),
48
+ input: model.inputModalities.includes("image") ? ["text", "image"] : ["text"],
49
+ cost: {
50
+ input: 0,
51
+ output: 0,
52
+ cacheRead: 0,
53
+ cacheWrite: 0
54
+ },
55
+ contextWindow: DEFAULT_CONTEXT_WINDOW,
56
+ maxTokens: DEFAULT_MAX_TOKENS,
57
+ compat: {
58
+ ...supportedReasoningEfforts !== void 0 ? { supportsReasoningEffort: supportedReasoningEfforts.length > 0 } : {},
59
+ ...supportedReasoningEfforts && supportedReasoningEfforts.length > 0 ? { supportedReasoningEfforts: [...supportedReasoningEfforts] } : {},
60
+ supportsUsageInStreaming: true
61
+ }
62
+ };
63
+ }
64
+ /** Builds the synthetic Codex provider config for a model list. */
65
+ function buildCodexProviderConfig(models) {
66
+ return {
67
+ baseUrl: CODEX_BASE_URL,
68
+ apiKey: CODEX_APP_SERVER_AUTH_MARKER,
69
+ auth: "token",
70
+ api: "openai-chatgpt-responses",
71
+ models: models.map(buildCodexModelDefinition)
72
+ };
73
+ }
74
+ function shouldDefaultToReasoningModel(modelId) {
75
+ const lower = modelId.toLowerCase();
76
+ return lower.startsWith("gpt-5") || lower.startsWith("o1") || lower.startsWith("o3") || lower.startsWith("o4");
77
+ }
78
+ //#endregion
79
+ export { CODEX_APP_SERVER_AUTH_MARKER, CODEX_BASE_URL, CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS, buildCodexModelDefinition, buildCodexProviderConfig };
@@ -0,0 +1,34 @@
1
+ import { CODEX_APP_SERVER_AUTH_MARKER, CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS, buildCodexProviderConfig } from "./provider-catalog.js";
2
+ //#region extensions/codex/provider-discovery.ts
3
+ function resolveCodexPluginConfig(ctx) {
4
+ return (ctx.config.plugins?.entries)?.codex?.config;
5
+ }
6
+ async function runCodexCatalog(ctx) {
7
+ const { buildCodexProviderCatalog } = await import("./provider.js");
8
+ return await buildCodexProviderCatalog({
9
+ env: ctx.env,
10
+ pluginConfig: resolveCodexPluginConfig(ctx)
11
+ });
12
+ }
13
+ /** Provider discovery descriptor with static fallback and synthetic auth. */
14
+ const codexProviderDiscovery = {
15
+ id: CODEX_PROVIDER_ID,
16
+ label: "Codex",
17
+ docsPath: "/providers/models",
18
+ auth: [],
19
+ catalog: {
20
+ order: "late",
21
+ run: runCodexCatalog
22
+ },
23
+ staticCatalog: {
24
+ order: "late",
25
+ run: async () => ({ provider: buildCodexProviderConfig(FALLBACK_CODEX_MODELS) })
26
+ },
27
+ resolveSyntheticAuth: () => ({
28
+ apiKey: CODEX_APP_SERVER_AUTH_MARKER,
29
+ source: "codex-app-server",
30
+ mode: "token"
31
+ })
32
+ };
33
+ //#endregion
34
+ export { codexProviderDiscovery, codexProviderDiscovery as default };
@@ -0,0 +1,2 @@
1
+ import { a as readCodexSupportedReasoningEfforts, i as isModernCodexModel, n as buildCodexProviderCatalog, o as resolveCodexFallbackReasoningEfforts, r as isMaxReasoningCodexModel, s as resolveCodexSupportedReasoningEffort, t as buildCodexProvider } from "./.setup/provider-DGxDs6g8.mjs";
2
+ export { buildCodexProvider, buildCodexProviderCatalog, isMaxReasoningCodexModel, isModernCodexModel, readCodexSupportedReasoningEfforts, resolveCodexFallbackReasoningEfforts, resolveCodexSupportedReasoningEffort };
@@ -1,4 +1,4 @@
1
- import { t as createCodexWebSearchProviderBase } from "./web-search-provider.shared-BrZmlqyR.js";
1
+ import { t as createCodexWebSearchProviderBase } from "./.setup/web-search-provider.shared-BrZmlqyR.mjs";
2
2
  //#region extensions/codex/web-search-contract-api.ts
3
3
  function createCodexWebSearchProvider() {
4
4
  return {