@openclaw/codex 2026.7.1-beta.6 → 2026.7.2-beta.1

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 (46) hide show
  1. package/README.md +27 -3
  2. package/dist/app-server-policy-DVcxdse_.js +49 -0
  3. package/dist/{attempt-notifications-BGsEIIDI.js → attempt-notifications-DEv9h7iC.js} +1 -1
  4. package/dist/auth-binding-C1czuHPA.js +62 -0
  5. package/dist/capabilities-42Dfn2TV.js +33 -0
  6. package/dist/cli-metadata.js +20 -0
  7. package/dist/{app-server-policy-C968Kgin.js → command-formatters-D6ZlGNmb.js} +8 -51
  8. package/dist/{command-handlers-Dv-pzAmg.js → command-handlers-Cpl9fUWv.js} +163 -60
  9. package/dist/{compact-4mVBriKT.js → compact-FnJmiPNA.js} +40 -10
  10. package/dist/computer-use-DVzr8OP1.js +685 -0
  11. package/dist/{config-CYEDnLJ2.js → config-c48K5HP9.js} +200 -29
  12. package/dist/conversation-control-DtQ-E7mr.js +288 -0
  13. package/dist/doctor-contract-api.js +120 -81
  14. package/dist/{provider-capabilities-CDnHbmUZ.js → dynamic-tools-BMLoaTeG.js} +5246 -5140
  15. package/dist/harness.js +55 -15
  16. package/dist/index.js +1435 -265
  17. package/dist/{media-understanding-provider-BHOu9-Gg.js → media-understanding-provider-D580L0P8.js} +28 -10
  18. package/dist/media-understanding-provider.js +1 -1
  19. package/dist/{models-DDmO1zwd.js → models-DuKzZA6G.js} +1 -1
  20. package/dist/notification-correlation-DfaCm0mx.js +67 -0
  21. package/dist/plugin-app-cache-key-BKNjHMEs.js +315 -0
  22. package/dist/{protocol-2POPqAY4.js → protocol-BMifTfdW.js} +3 -1
  23. package/dist/provider-catalog.js +66 -27
  24. package/dist/provider.js +306 -1
  25. package/dist/{provider-zjPfx5Fs.js → rate-limits-Dhp04Rqo.js} +4 -261
  26. package/dist/request-DborTWgw.js +111 -0
  27. package/dist/{run-attempt-FUyOjGCV.js → run-attempt-VPVJoYDP.js} +7897 -7136
  28. package/dist/runtime-artifact-C2ITXdhM.js +488 -0
  29. package/dist/{sandbox-guard-DA2TQfZW.js → sandbox-guard-D1Wky__S.js} +10 -1
  30. package/dist/{session-binding-C1ZXdP-x.js → session-binding-BMfX1OX-.js} +247 -88
  31. package/dist/session-catalog-7H112Tr_.js +2396 -0
  32. package/dist/session-cli-B28RhCyp.js +175 -0
  33. package/dist/{shared-client-4ICy3U6d.js → shared-client-D4mFI9al.js} +1997 -1297
  34. package/dist/{side-question-N4OaDer2.js → side-question-CgJBz52s.js} +135 -67
  35. package/dist/{thread-lifecycle-qWE88Dn2.js → thread-lifecycle-BgLXzjvV.js} +747 -317
  36. package/dist/transcript-mirror-DhLwFIL4.js +485 -0
  37. package/dist/transport-stdio-DXgGZ7Ib.js +88 -0
  38. package/dist/{web-search-provider.runtime-BSlriav6.js → web-search-provider.runtime-Bs-eTn5U.js} +3 -3
  39. package/npm-shrinkwrap.json +56 -30
  40. package/openclaw.plugin.json +168 -10
  41. package/package.json +8 -6
  42. package/dist/command-rpc-eLM_mtC7.js +0 -784
  43. package/dist/computer-use-Bmaz333N.js +0 -377
  44. package/dist/notification-correlation-Bo7KB3ks.js +0 -35
  45. package/dist/plugin-app-cache-key-BrhVdeEf.js +0 -98
  46. package/dist/request-BcJyl8KL.js +0 -36
@@ -0,0 +1,175 @@
1
+ import { a as CODEX_LOCAL_SESSION_HOST_ID } from "./session-catalog-7H112Tr_.js";
2
+ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
3
+ import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
+ import { addGatewayClientOptions, callGatewayFromCli } from "openclaw/plugin-sdk/gateway-runtime";
5
+ import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
6
+ //#region extensions/codex/src/session-cli.ts
7
+ const CODEX_SESSION_CATALOG_CLI_TIMEOUT_MS = 75e3;
8
+ function writeLine(value = "") {
9
+ process.stdout.write(`${value}\n`);
10
+ }
11
+ function writeJson(value) {
12
+ process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
13
+ }
14
+ function gatewayOptions(options) {
15
+ return {
16
+ ...options.url ? { url: options.url } : {},
17
+ ...options.token ? { token: options.token } : {},
18
+ ...options.timeout !== void 0 ? { timeout: options.timeout } : {},
19
+ json: options.json === true
20
+ };
21
+ }
22
+ function parsePageLimit(value) {
23
+ if (value === void 0) return;
24
+ const trimmed = value.trim();
25
+ const parsed = Number(trimmed);
26
+ if (!/^\d+$/.test(trimmed) || !Number.isSafeInteger(parsed) || parsed < 1 || parsed > 100) throw new Error(`--limit must be an integer between 1 and 100`);
27
+ return parsed;
28
+ }
29
+ function normalizeTimestampMs(value) {
30
+ return Math.abs(value) < 0xe8d4a51000 ? value * 1e3 : value;
31
+ }
32
+ function formatTimestamp(session) {
33
+ const value = session.recencyAt ?? session.updatedAt ?? session.createdAt;
34
+ if (typeof value !== "number" || !Number.isFinite(value)) return "-";
35
+ const date = new Date(normalizeTimestampMs(value));
36
+ return Number.isNaN(date.getTime()) ? "-" : `${date.toISOString().replace("T", " ").slice(0, 16)}Z`;
37
+ }
38
+ function singleLineTerminalText(value) {
39
+ return sanitizeTerminalText(value).replace(/\s+/g, " ").trim();
40
+ }
41
+ function truncate(value, maxLength) {
42
+ return value.length <= maxLength ? value : `${truncateUtf16Safe(value, maxLength - 1)}\u2026`;
43
+ }
44
+ function sessionTitle(session) {
45
+ return truncate((typeof session.name === "string" ? singleLineTerminalText(session.name) : "") || singleLineTerminalText(session.threadId) || "(untitled)", 72);
46
+ }
47
+ function sessionStatus(session) {
48
+ return session.status === "notLoaded" ? "stored / activity unknown" : singleLineTerminalText(session.status) || "unknown";
49
+ }
50
+ function quoteShellArgument(value) {
51
+ return `'${singleLineTerminalText(value).replaceAll("'", `'"'"'`)}'`;
52
+ }
53
+ function formatHostIdentity(host) {
54
+ const identifiers = [host.kind, singleLineTerminalText(host.hostId)];
55
+ if (host.nodeId && host.nodeId !== host.hostId) identifiers.push(singleLineTerminalText(host.nodeId));
56
+ return identifiers.join(" · ");
57
+ }
58
+ function writeHost(host) {
59
+ const connection = host.connected ? "connected" : "offline";
60
+ const count = `${host.sessions.length} session${host.sessions.length === 1 ? "" : "s"}`;
61
+ writeLine(`${singleLineTerminalText(host.label)} (${formatHostIdentity(host)}) — ${connection} — ${count}`);
62
+ if (host.error) writeLine(` Error [${singleLineTerminalText(host.error.code)}]: ${singleLineTerminalText(host.error.message)}`);
63
+ if (host.sessions.length === 0 && !host.error) writeLine(" No sessions.");
64
+ for (const session of host.sessions) {
65
+ writeLine(` ${formatTimestamp(session)} ${sessionStatus(session)} ${singleLineTerminalText(session.threadId)} ${sessionTitle(session)}`);
66
+ const details = [
67
+ session.cwd ? singleLineTerminalText(session.cwd) : void 0,
68
+ session.gitBranch ? `branch ${singleLineTerminalText(session.gitBranch)}` : void 0,
69
+ session.source ? `source ${singleLineTerminalText(session.source)}` : void 0,
70
+ session.modelProvider ? `provider ${singleLineTerminalText(session.modelProvider)}` : void 0
71
+ ].filter((entry) => Boolean(entry));
72
+ if (details.length > 0) writeLine(` ${details.join(" · ")}`);
73
+ }
74
+ if (host.nextCursor) writeLine(` More sessions: repeat the same filters with --host ${quoteShellArgument(host.hostId)} --cursor ${quoteShellArgument(host.nextCursor)}`);
75
+ }
76
+ function filterHosts(result, selector) {
77
+ return selector ? {
78
+ ...result,
79
+ hosts: result.hosts.filter((host) => host.hostId === selector)
80
+ } : result;
81
+ }
82
+ async function listCodexSessions(options) {
83
+ const host = options.host?.trim() || void 0;
84
+ const cursor = options.cursor?.trim() || void 0;
85
+ if (cursor && !host) throw new Error("--cursor requires --host so the cursor is routed to one Codex host");
86
+ const search = options.search?.trim() || void 0;
87
+ const limitPerHost = parsePageLimit(options.limit);
88
+ const params = {
89
+ ...search ? { search } : {},
90
+ ...limitPerHost !== void 0 ? { limitPerHost } : {},
91
+ ...host ? { hostIds: [host] } : {},
92
+ ...cursor && host ? { cursors: { [host]: cursor } } : {}
93
+ };
94
+ const raw = await callGatewayFromCli("sessions.catalog.list", gatewayOptions(options), {
95
+ catalogId: "codex",
96
+ ...params
97
+ }, {
98
+ mode: "cli",
99
+ scopes: ["operator.write"]
100
+ });
101
+ if (!isRecord(raw) || !Array.isArray(raw.catalogs)) throw new Error("Codex session catalog returned an invalid result");
102
+ const catalog = raw.catalogs.find((candidate) => isRecord(candidate) && candidate.id === "codex" && Array.isArray(candidate.hosts));
103
+ if (!isRecord(catalog)) throw new Error("Codex session catalog is unavailable on this Gateway");
104
+ const result = filterHosts({ hosts: catalog.hosts }, host);
105
+ if (options.json) {
106
+ writeJson(result);
107
+ return;
108
+ }
109
+ if (result.hosts.length === 0) {
110
+ writeLine(host ? `No Codex session host matched "${singleLineTerminalText(host)}".` : "No Codex session hosts found.");
111
+ return;
112
+ }
113
+ result.hosts.forEach((catalogHost, index) => {
114
+ if (index > 0) writeLine();
115
+ writeHost(catalogHost);
116
+ });
117
+ }
118
+ function readThreadId(value) {
119
+ const threadId = value.trim();
120
+ if (!threadId) throw new Error("Codex thread id must not be empty");
121
+ return threadId;
122
+ }
123
+ async function continueCodexSession(threadIdValue, options) {
124
+ const threadId = readThreadId(threadIdValue);
125
+ const raw = await callGatewayFromCli("sessions.catalog.continue", gatewayOptions(options), {
126
+ catalogId: "codex",
127
+ hostId: CODEX_LOCAL_SESSION_HOST_ID,
128
+ threadId
129
+ }, {
130
+ mode: "cli",
131
+ scopes: ["operator.write"]
132
+ });
133
+ if (!isRecord(raw) || typeof raw.sessionKey !== "string" || !raw.sessionKey.trim()) throw new Error("Codex session continue returned an invalid session key");
134
+ const result = { sessionKey: raw.sessionKey };
135
+ if (options.json) {
136
+ writeJson(result);
137
+ return;
138
+ }
139
+ writeLine(`OpenClaw session: ${singleLineTerminalText(result.sessionKey)}`);
140
+ }
141
+ async function archiveCodexSession(threadIdValue, options) {
142
+ const threadId = readThreadId(threadIdValue);
143
+ if (options.confirmNoOtherRunner !== true) throw new Error("--confirm-no-other-runner is required because Codex client and runner activity is process-local");
144
+ const raw = await callGatewayFromCli("sessions.catalog.archive", gatewayOptions(options), {
145
+ catalogId: "codex",
146
+ hostId: CODEX_LOCAL_SESSION_HOST_ID,
147
+ threadId,
148
+ confirmNoOtherRunner: true
149
+ }, {
150
+ mode: "cli",
151
+ scopes: ["operator.write"]
152
+ });
153
+ if (!isRecord(raw) || raw.ok !== true) throw new Error("Codex session archive returned an invalid result");
154
+ const result = { ok: true };
155
+ if (options.json) {
156
+ writeJson(result);
157
+ return;
158
+ }
159
+ writeLine(`Archived Codex thread ${singleLineTerminalText(threadId)}.`);
160
+ }
161
+ /** Registers the plugin-owned Codex session supervision CLI. */
162
+ function registerCodexSessionCli(program) {
163
+ const codex = program.command("codex").description("Inspect and branch from Codex sessions through the Gateway");
164
+ addGatewayClientOptions(codex.command("sessions").description("List non-archived Codex app-server sessions across connected hosts").option("--search <text>", "Search session titles (case-insensitive)").option("--host <id>", "Filter by stable host id").option("--limit <count>", "Maximum sessions returned per host").option("--cursor <cursor>", "Continue one host page (requires --host)").option("--json", "Print the structured catalog response", false), { timeoutMs: CODEX_SESSION_CATALOG_CLI_TIMEOUT_MS }).action(async (options) => {
165
+ await listCodexSessions(options);
166
+ });
167
+ addGatewayClientOptions(codex.command("continue <thread-id>").description("Continue a Gateway-local Codex thread as an OpenClaw branch").option("--json", "Print the structured response", false)).action(async (threadId, options) => {
168
+ await continueCodexSession(threadId, options);
169
+ });
170
+ addGatewayClientOptions(codex.command("archive <thread-id>").description("Archive a stored or idle Gateway-local Codex thread").option("--confirm-no-other-runner", "Confirm no other Codex client or OpenClaw runner is using this thread", false).option("--json", "Print the structured response", false)).action(async (threadId, options) => {
171
+ await archiveCodexSession(threadId, options);
172
+ });
173
+ }
174
+ //#endregion
175
+ export { registerCodexSessionCli };