@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,49 +0,0 @@
1
- import { b as canUseCodexModelBackedApprovalsReviewerForModel } from "./session-binding-DlVQ-Pxs.js";
2
- //#region extensions/codex/src/app-server/app-server-policy.ts
3
- /**
4
- * Policy promotion for Codex app-server runs that can safely use OpenClaw tool
5
- * approvals.
6
- */
7
- /**
8
- * Promotes implicit `never` approval policy to `untrusted` only when runtime
9
- * requirements allow OpenClaw to handle tool approvals.
10
- */
11
- function resolveCodexAppServerForOpenClawToolPolicy(params) {
12
- if (!params.shouldPromote || !params.canUseUntrustedApprovalPolicy || params.appServer.approvalPolicy !== "never") return params.appServer;
13
- const explicitMode = params.execPolicy?.mode === "full" || params.pluginConfig.appServer?.mode !== void 0 || isCodexAppServerPolicyMode(params.env.OPENCLAW_CODEX_APP_SERVER_MODE);
14
- const explicitApprovalPolicy = params.pluginConfig.appServer?.approvalPolicy !== void 0 || isConfiguredCodexAppServerApprovalPolicy(params.env.OPENCLAW_CODEX_APP_SERVER_APPROVAL_POLICY) || params.appServer.approvalPolicySource === "requirements";
15
- if (explicitMode || explicitApprovalPolicy) return params.appServer;
16
- return {
17
- ...params.appServer,
18
- approvalPolicy: "untrusted"
19
- };
20
- }
21
- function resolveCodexAppServerForModelProvider(params) {
22
- const explicitProvider = normalizeModelBackedReviewerProvider(params.provider);
23
- if (!isCodexModelBackedApprovalsReviewer(params.appServer.approvalsReviewer) || canUseCodexModelBackedApprovalsReviewerForModel({
24
- modelProvider: explicitProvider,
25
- model: params.model,
26
- config: params.config,
27
- env: params.env,
28
- agentDir: params.agentDir,
29
- codexConfigToml: params.codexConfigToml
30
- })) return params.appServer;
31
- return {
32
- ...params.appServer,
33
- approvalsReviewer: "user"
34
- };
35
- }
36
- function isCodexAppServerPolicyMode(value) {
37
- return value === "guardian" || value === "yolo";
38
- }
39
- function isConfiguredCodexAppServerApprovalPolicy(value) {
40
- return value === "never" || value === "on-request" || value === "on-failure" || value === "untrusted";
41
- }
42
- function isCodexModelBackedApprovalsReviewer(value) {
43
- return value === "auto_review" || value === "guardian_subagent";
44
- }
45
- function normalizeModelBackedReviewerProvider(provider) {
46
- return provider?.trim().toLowerCase() || void 0;
47
- }
48
- //#endregion
49
- export { resolveCodexAppServerForOpenClawToolPolicy as n, resolveCodexAppServerForModelProvider as t };
@@ -1,127 +0,0 @@
1
- import { f as retireSharedCodexAppServerClientIfCurrent, n as clearSharedCodexAppServerClientIfCurrentAndUnclaimed, t as clearSharedCodexAppServerClientIfCurrent } from "./shared-client-BVKE40c-.js";
2
- import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
3
- //#region extensions/codex/src/app-server/attempt-client-cleanup.ts
4
- /**
5
- * Best-effort cleanup helpers for Codex app-server startup attempts and turns.
6
- */
7
- /** Timeout for best-effort app-server turn interruption during cleanup. */
8
- const CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS = 5e3;
9
- /** Timeout for best-effort thread unsubscribe during cleanup. */
10
- const CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS = 5e3;
11
- /** Raised when a thread subscription may be live on a client OpenClaw no longer controls. */
12
- var CodexAppServerUnsafeSubscriptionError = class extends Error {
13
- constructor(message, options) {
14
- super(message, options);
15
- this.name = "CodexAppServerUnsafeSubscriptionError";
16
- }
17
- };
18
- function isCodexAppServerUnsafeSubscriptionError(error) {
19
- return error instanceof CodexAppServerUnsafeSubscriptionError;
20
- }
21
- /** Asserts Codex resumed the exact thread this attempt subscribed to. */
22
- function assertCodexThreadResumeSubscription(requestedThreadId, returnedThreadId) {
23
- if (returnedThreadId !== requestedThreadId) throw new CodexAppServerUnsafeSubscriptionError(`Codex thread/resume returned ${returnedThreadId} for ${requestedThreadId}`);
24
- }
25
- async function closeClientAndWaitIfAvailable(client) {
26
- const closeable = client;
27
- if (typeof closeable.closeAndWait === "function") {
28
- await closeable.closeAndWait();
29
- return;
30
- }
31
- closeable.close?.();
32
- }
33
- async function closeCodexStartupClientBestEffort(client) {
34
- if (!client) return;
35
- const unclaimedSharedClient = clearSharedCodexAppServerClientIfCurrentAndUnclaimed(client);
36
- if (unclaimedSharedClient.closed) {
37
- await closeClientAndWaitIfAvailable(client);
38
- return;
39
- }
40
- if (unclaimedSharedClient.found) {
41
- if (retireSharedCodexAppServerClientIfCurrent(client)?.closed) await closeClientAndWaitIfAvailable(client);
42
- return;
43
- }
44
- const retiredSharedClient = retireSharedCodexAppServerClientIfCurrent(client);
45
- if (retiredSharedClient) {
46
- if (retiredSharedClient.closed) await closeClientAndWaitIfAvailable(client);
47
- return;
48
- }
49
- if (clearSharedCodexAppServerClientIfCurrent(client)) {
50
- await closeClientAndWaitIfAvailable(client);
51
- return;
52
- }
53
- await closeClientAndWaitIfAvailable(client);
54
- }
55
- /** Sends a turn interrupt without blocking abort cleanup on app-server errors. */
56
- function interruptCodexTurnBestEffort(client, params) {
57
- interruptCodexTurnAndWaitBestEffort(client, params);
58
- }
59
- /** Sends a bounded turn interrupt and waits for Codex to confirm terminal abort handling. */
60
- async function interruptCodexTurnAndWaitBestEffort(client, params) {
61
- const requestOptions = params.timeoutMs && Number.isFinite(params.timeoutMs) && params.timeoutMs > 0 ? { timeoutMs: params.timeoutMs } : void 0;
62
- const requestParams = {
63
- threadId: params.threadId,
64
- turnId: params.turnId
65
- };
66
- try {
67
- await (requestOptions ? client.request("turn/interrupt", requestParams, requestOptions) : client.request("turn/interrupt", requestParams));
68
- } catch (error) {
69
- embeddedAgentLog.debug("codex app-server turn interrupt failed during abort", { error });
70
- }
71
- }
72
- /** Unsubscribes from a thread while swallowing cleanup-only failures. */
73
- async function unsubscribeCodexThreadBestEffort(client, params) {
74
- try {
75
- await client.request("thread/unsubscribe", { threadId: params.threadId }, { timeoutMs: params.timeoutMs });
76
- return true;
77
- } catch (error) {
78
- embeddedAgentLog.debug("codex app-server thread unsubscribe cleanup failed", {
79
- threadId: params.threadId,
80
- error
81
- });
82
- return false;
83
- }
84
- }
85
- /**
86
- * Retires the shared client after a timed-out turn so later runs do not reuse a
87
- * potentially wedged app-server connection.
88
- */
89
- async function retireCodexAppServerClientAfterTimedOutTurn(client, params) {
90
- const retiredSharedClient = retireSharedCodexAppServerClientIfCurrent(client, { failActiveLeases: params.suspectPhysicalClient });
91
- const detachedSharedClient = Boolean(retiredSharedClient);
92
- if (!(params.suspectPhysicalClient && (retiredSharedClient?.closed ?? false))) {
93
- interruptCodexTurnBestEffort(client, {
94
- threadId: params.threadId,
95
- turnId: params.turnId,
96
- timeoutMs: CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS
97
- });
98
- await unsubscribeCodexThreadBestEffort(client, {
99
- threadId: params.threadId,
100
- timeoutMs: CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS
101
- });
102
- }
103
- let closedClient = retiredSharedClient?.closed ?? false;
104
- if (!detachedSharedClient) {
105
- const close = client.close;
106
- if (typeof close === "function") try {
107
- close.call(client);
108
- closedClient = true;
109
- } catch (error) {
110
- embeddedAgentLog.debug("codex app-server client close failed during timeout cleanup", {
111
- threadId: params.threadId,
112
- turnId: params.turnId,
113
- error
114
- });
115
- }
116
- }
117
- embeddedAgentLog.warn("codex app-server client retired after timed-out turn", {
118
- threadId: params.threadId,
119
- turnId: params.turnId,
120
- reason: params.reason,
121
- detachedSharedClient,
122
- closedClient,
123
- activeSharedClientLeases: retiredSharedClient?.activeLeases ?? 0
124
- });
125
- }
126
- //#endregion
127
- export { closeCodexStartupClientBestEffort as a, isCodexAppServerUnsafeSubscriptionError as c, assertCodexThreadResumeSubscription as i, retireCodexAppServerClientAfterTimedOutTurn as l, CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS as n, interruptCodexTurnAndWaitBestEffort as o, CodexAppServerUnsafeSubscriptionError as r, interruptCodexTurnBestEffort as s, CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS as t, unsubscribeCodexThreadBestEffort as u };
@@ -1,62 +0,0 @@
1
- import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { fingerprintResolvedAuthProfileCredential } from "openclaw/plugin-sdk/agent-harness-runtime";
3
- import { resolveApiKeyForProfile } from "openclaw/plugin-sdk/agent-runtime";
4
- //#region extensions/codex/src/app-server/auth-binding.ts
5
- var auth_binding_exports = /* @__PURE__ */ __exportAll({
6
- fingerprintCodexAppServerAuthBinding: () => fingerprintCodexAppServerAuthBinding,
7
- prepareCodexAppServerAuthBinding: () => prepareCodexAppServerAuthBinding
8
- });
9
- function withMaterializedCredential(params) {
10
- const store = structuredClone(params.store);
11
- if (params.credential.type === "api_key") {
12
- const { keyRef: _keyRef, ...credential } = params.credential;
13
- store.profiles[params.profileId] = {
14
- ...credential,
15
- key: params.value
16
- };
17
- } else if (params.credential.type === "token") {
18
- const { tokenRef: _tokenRef, ...credential } = params.credential;
19
- store.profiles[params.profileId] = {
20
- ...credential,
21
- token: params.value
22
- };
23
- }
24
- return store;
25
- }
26
- /** Resolves one forwarded profile once so attestation and execution share exact material. */
27
- async function prepareCodexAppServerAuthBinding(params) {
28
- const credential = params.authProfileStore.profiles[params.authProfileId];
29
- if (!credential || credential.type === "oauth") return;
30
- const resolved = await resolveApiKeyForProfile({
31
- cfg: params.config,
32
- store: params.authProfileStore,
33
- profileId: params.authProfileId,
34
- agentDir: params.agentDir
35
- });
36
- if (!resolved?.apiKey) throw new Error(`Codex could not resolve auth profile "${params.authProfileId}".`);
37
- const fingerprint = fingerprintResolvedAuthProfileCredential({
38
- profileId: params.authProfileId,
39
- credential,
40
- resolvedAuth: {
41
- apiKey: resolved.apiKey,
42
- profileId: params.authProfileId,
43
- source: `profile:${params.authProfileId}`,
44
- mode: credential.type === "api_key" ? "api-key" : "token"
45
- }
46
- });
47
- if (!fingerprint) throw new Error(`Codex could not attest auth profile "${params.authProfileId}".`);
48
- return {
49
- fingerprint,
50
- authProfileStore: withMaterializedCredential({
51
- store: params.authProfileStore,
52
- profileId: params.authProfileId,
53
- credential,
54
- value: resolved.apiKey
55
- })
56
- };
57
- }
58
- async function fingerprintCodexAppServerAuthBinding(params) {
59
- return (await prepareCodexAppServerAuthBinding(params))?.fingerprint;
60
- }
61
- //#endregion
62
- export { prepareCodexAppServerAuthBinding as n, auth_binding_exports as t };
@@ -1,36 +0,0 @@
1
- import { _ as CodexAppServerRpcError } from "./shared-client-BVKE40c-.js";
2
- //#region extensions/codex/src/app-server/capabilities.ts
3
- /**
4
- * Capability helpers for optional Codex app-server control-plane methods.
5
- */
6
- /** Known app-server methods used by OpenClaw control surfaces. */
7
- const CODEX_CONTROL_METHODS = {
8
- account: "account/read",
9
- compact: "thread/compact/start",
10
- feedback: "feedback/upload",
11
- forkThread: "thread/fork",
12
- listMcpServers: "mcpServerStatus/list",
13
- listSkills: "skills/list",
14
- listThreads: "thread/list",
15
- listThreadTurns: "thread/turns/list",
16
- readThread: "thread/read",
17
- rateLimits: "account/rateLimits/read",
18
- archiveThread: "thread/archive",
19
- renameThread: "thread/name/set",
20
- resumeThread: "thread/resume",
21
- review: "review/start",
22
- unarchiveThread: "thread/unarchive",
23
- getThreadGoal: "thread/goal/get",
24
- setThreadGoal: "thread/goal/set",
25
- clearThreadGoal: "thread/goal/clear"
26
- };
27
- /** Formats unsupported control calls differently from ordinary RPC failures. */
28
- function describeControlFailure(error) {
29
- if (isUnsupportedControlError(error)) return "unsupported by this Codex app-server";
30
- return error instanceof Error ? error.message : String(error);
31
- }
32
- function isUnsupportedControlError(error) {
33
- return error instanceof CodexAppServerRpcError && error.code === -32601;
34
- }
35
- //#endregion
36
- export { describeControlFailure as n, CODEX_CONTROL_METHODS as t };
@@ -1,20 +0,0 @@
1
- import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
2
- //#region extensions/codex/cli-metadata.ts
3
- function registerCodexCliMetadata(api) {
4
- api.registerCli(async ({ program }) => {
5
- const { registerCodexSessionCli } = await import("./session-cli-CqZ0Fp2a.js");
6
- registerCodexSessionCli(program);
7
- }, { descriptors: [{
8
- name: "codex",
9
- description: "Inspect and branch from Codex sessions through the Gateway",
10
- hasSubcommands: true
11
- }] });
12
- }
13
- var cli_metadata_default = definePluginEntry({
14
- id: "codex",
15
- name: "Codex",
16
- description: "Codex app-server harness and native session supervision.",
17
- register: registerCodexCliMetadata
18
- });
19
- //#endregion
20
- export { cli_metadata_default as default, registerCodexCliMetadata };