@openclaw/codex 2026.7.2-beta.7 → 2026.7.34

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 (64) hide show
  1. package/README.md +3 -27
  2. package/dist/{command-formatters-C336eRVS.js → .setup/app-server-policy-C_qTMEMy.mjs} +51 -9
  3. package/dist/{attempt-notifications-AP-a-Q5k.js → .setup/attempt-notifications-F8krwWL4.mjs} +6 -3
  4. package/dist/{command-handlers-DAHUSry9.js → .setup/command-handlers-DSRFfor4.mjs} +1156 -1319
  5. package/dist/.setup/command-rpc-BvYsfQ7G.mjs +786 -0
  6. package/dist/{compact-D_uvHurS.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-D2ZAgZVz.js → .setup/media-understanding-provider-EbJCyDqe.mjs} +203 -109
  11. package/dist/{models-BBMKU4jA.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/{transcript-mirror-DzsdNCf5.js → .setup/protocol-validators-dZQ-UTOa.mjs} +112 -922
  16. package/dist/{rate-limits-CU-gVCCS.js → .setup/provider-DGxDs6g8.mjs} +269 -13
  17. package/dist/{dynamic-tools-D2gYkSBO.js → .setup/provider-capabilities-DS2N_zc1.mjs} +5632 -3953
  18. package/dist/.setup/request-DFR0JyoV.mjs +36 -0
  19. package/dist/.setup/run-attempt-C7xEKFVB.mjs +8180 -0
  20. package/dist/{sandbox-guard-NuhpXmPB.js → .setup/sandbox-guard-DA2TQfZW.mjs} +1 -14
  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-_ulBk1AL.js → .setup/side-question-Cv6JXWCS.mjs} +84 -159
  24. package/dist/.setup/thread-lifecycle-u6CZdOOH.mjs +2593 -0
  25. package/dist/{web-search-provider.runtime-CCFhg2z5.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 -89
  28. package/dist/index.js +436 -1615
  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 -9
  37. package/dist/app-server-policy-BSaO2JIT.js +0 -49
  38. package/dist/auth-binding-B4FfbcCg.js +0 -62
  39. package/dist/capabilities-BFDTVYr4.js +0 -36
  40. package/dist/cli-metadata.js +0 -20
  41. package/dist/computer-use-CYEc8U3w.js +0 -693
  42. package/dist/conversation-control-xsIeXbo4.js +0 -287
  43. package/dist/effective-mcp-catalog-Bbd98Inw.js +0 -114
  44. package/dist/event-projector-assistant-message-DTgnPPVF.js +0 -101
  45. package/dist/event-projector-usage-Xp4AlR2k.js +0 -86
  46. package/dist/incognito-session-ET_ufDH-.js +0 -2
  47. package/dist/notification-correlation-CU6_AnOb.js +0 -67
  48. package/dist/plugin-app-cache-key-DztPafOA.js +0 -408
  49. package/dist/request-qKh331yu.js +0 -157
  50. package/dist/run-attempt-CY9WlDLc.js +0 -12413
  51. package/dist/runtime-artifact-CmtG_t1L.js +0 -554
  52. package/dist/session-binding-BXpo9ymA.js +0 -2214
  53. package/dist/session-catalog-DyOgR4WH.js +0 -2668
  54. package/dist/session-cli-2PZaFLRh.js +0 -175
  55. package/dist/session-upstream-marker-B6U7tLw5.js +0 -82
  56. package/dist/settled-turn-finalizer-CXY2Z9dT.js +0 -316
  57. package/dist/shared-client-DTbvH-XV.js +0 -3069
  58. package/dist/thread-lifecycle-DF53ogiA.js +0 -3987
  59. package/dist/transport-stdio-DXgGZ7Ib.js +0 -88
  60. package/dist/upstream-session-fork-Dy4Xvuoj.js +0 -320
  61. package/dist/usage-CQ6GhD5-.js +0 -25
  62. /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
  63. /package/dist/{session-binding-meta-B7aEMU7g.js → .setup/session-binding-meta-B7aEMU7g.mjs} +0 -0
  64. /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-D2ZAgZVz.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 {