@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.
- package/README.md +27 -3
- package/dist/app-server-policy-DVcxdse_.js +49 -0
- package/dist/{attempt-notifications-BGsEIIDI.js → attempt-notifications-DEv9h7iC.js} +1 -1
- package/dist/auth-binding-C1czuHPA.js +62 -0
- package/dist/capabilities-42Dfn2TV.js +33 -0
- package/dist/cli-metadata.js +20 -0
- package/dist/{app-server-policy-C968Kgin.js → command-formatters-D6ZlGNmb.js} +8 -51
- package/dist/{command-handlers-Dv-pzAmg.js → command-handlers-Cpl9fUWv.js} +163 -60
- package/dist/{compact-4mVBriKT.js → compact-FnJmiPNA.js} +40 -10
- package/dist/computer-use-DVzr8OP1.js +685 -0
- package/dist/{config-CYEDnLJ2.js → config-c48K5HP9.js} +200 -29
- package/dist/conversation-control-DtQ-E7mr.js +288 -0
- package/dist/doctor-contract-api.js +120 -81
- package/dist/{provider-capabilities-CDnHbmUZ.js → dynamic-tools-BMLoaTeG.js} +5246 -5140
- package/dist/harness.js +55 -15
- package/dist/index.js +1435 -265
- package/dist/{media-understanding-provider-BHOu9-Gg.js → media-understanding-provider-D580L0P8.js} +28 -10
- package/dist/media-understanding-provider.js +1 -1
- package/dist/{models-DDmO1zwd.js → models-DuKzZA6G.js} +1 -1
- package/dist/notification-correlation-DfaCm0mx.js +67 -0
- package/dist/plugin-app-cache-key-BKNjHMEs.js +315 -0
- package/dist/{protocol-2POPqAY4.js → protocol-BMifTfdW.js} +3 -1
- package/dist/provider-catalog.js +66 -27
- package/dist/provider.js +306 -1
- package/dist/{provider-zjPfx5Fs.js → rate-limits-Dhp04Rqo.js} +4 -261
- package/dist/request-DborTWgw.js +111 -0
- package/dist/{run-attempt-FUyOjGCV.js → run-attempt-VPVJoYDP.js} +7897 -7136
- package/dist/runtime-artifact-C2ITXdhM.js +488 -0
- package/dist/{sandbox-guard-DA2TQfZW.js → sandbox-guard-D1Wky__S.js} +10 -1
- package/dist/{session-binding-C1ZXdP-x.js → session-binding-BMfX1OX-.js} +247 -88
- package/dist/session-catalog-7H112Tr_.js +2396 -0
- package/dist/session-cli-B28RhCyp.js +175 -0
- package/dist/{shared-client-4ICy3U6d.js → shared-client-D4mFI9al.js} +1997 -1297
- package/dist/{side-question-N4OaDer2.js → side-question-CgJBz52s.js} +135 -67
- package/dist/{thread-lifecycle-qWE88Dn2.js → thread-lifecycle-BgLXzjvV.js} +747 -317
- package/dist/transcript-mirror-DhLwFIL4.js +485 -0
- package/dist/transport-stdio-DXgGZ7Ib.js +88 -0
- package/dist/{web-search-provider.runtime-BSlriav6.js → web-search-provider.runtime-Bs-eTn5U.js} +3 -3
- package/npm-shrinkwrap.json +56 -30
- package/openclaw.plugin.json +168 -10
- package/package.json +8 -6
- package/dist/command-rpc-eLM_mtC7.js +0 -784
- package/dist/computer-use-Bmaz333N.js +0 -377
- package/dist/notification-correlation-Bo7KB3ks.js +0 -35
- package/dist/plugin-app-cache-key-BrhVdeEf.js +0 -98
- package/dist/request-BcJyl8KL.js +0 -36
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
import { d as resolveCodexAppServerRuntimeOptions, p as resolveCodexComputerUseConfig } from "./config-CYEDnLJ2.js";
|
|
2
|
-
import { i as describeControlFailure } from "./plugin-app-cache-key-BrhVdeEf.js";
|
|
3
|
-
import { t as requestCodexAppServerJson } from "./request-BcJyl8KL.js";
|
|
4
|
-
import { existsSync } from "node:fs";
|
|
5
|
-
//#region extensions/codex/src/app-server/computer-use.ts
|
|
6
|
-
/**
|
|
7
|
-
* Computer Use plugin/MCP readiness checks and optional install flow for Codex
|
|
8
|
-
* app-server sessions.
|
|
9
|
-
*/
|
|
10
|
-
var CodexComputerUseSetupError = class extends Error {
|
|
11
|
-
constructor(status) {
|
|
12
|
-
super(status.message);
|
|
13
|
-
this.name = "CodexComputerUseSetupError";
|
|
14
|
-
this.status = status;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
const CURATED_MARKETPLACE_POLL_INTERVAL_MS = 2e3;
|
|
18
|
-
const COMPUTER_USE_MARKETPLACE_NAME_PRIORITY = [
|
|
19
|
-
"openai-bundled",
|
|
20
|
-
"openai-curated",
|
|
21
|
-
"local"
|
|
22
|
-
];
|
|
23
|
-
const DEFAULT_CODEX_BUNDLED_MARKETPLACE_PATH = "/Applications/Codex.app/Contents/Resources/plugins/openai-bundled";
|
|
24
|
-
/** Reads Computer Use readiness without installing or mutating app-server state. */
|
|
25
|
-
async function readCodexComputerUseStatus(params = {}) {
|
|
26
|
-
const config = resolveComputerUseConfig(params);
|
|
27
|
-
if (!config.enabled) return disabledStatus(config);
|
|
28
|
-
try {
|
|
29
|
-
return await inspectCodexComputerUse({
|
|
30
|
-
...params,
|
|
31
|
-
config,
|
|
32
|
-
installPlugin: false
|
|
33
|
-
});
|
|
34
|
-
} catch (error) {
|
|
35
|
-
return unavailableStatus(config, "check_failed", `Computer Use check failed: ${describeControlFailure(error)}`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Ensures Computer Use is ready when enabled, optionally installing when config
|
|
40
|
-
* allows safe auto-install.
|
|
41
|
-
*/
|
|
42
|
-
async function ensureCodexComputerUse(params = {}) {
|
|
43
|
-
const config = resolveComputerUseConfig(params);
|
|
44
|
-
if (!config.enabled) return disabledStatus(config);
|
|
45
|
-
const status = await inspectCodexComputerUse({
|
|
46
|
-
...params,
|
|
47
|
-
config,
|
|
48
|
-
installPlugin: false
|
|
49
|
-
});
|
|
50
|
-
if (status.ready) return status;
|
|
51
|
-
if (config.autoInstall) {
|
|
52
|
-
const blockedAutoInstallStatus = blockUnsafeAutoInstallStatus(config);
|
|
53
|
-
if (blockedAutoInstallStatus) throw new CodexComputerUseSetupError(blockedAutoInstallStatus);
|
|
54
|
-
const installedStatus = await inspectCodexComputerUse({
|
|
55
|
-
...params,
|
|
56
|
-
config,
|
|
57
|
-
installPlugin: true
|
|
58
|
-
});
|
|
59
|
-
if (!installedStatus.ready) throw new CodexComputerUseSetupError(installedStatus);
|
|
60
|
-
return installedStatus;
|
|
61
|
-
}
|
|
62
|
-
if (!status.ready) throw new CodexComputerUseSetupError(status);
|
|
63
|
-
return status;
|
|
64
|
-
}
|
|
65
|
-
/** Forces Computer Use plugin installation and returns the ready status. */
|
|
66
|
-
async function installCodexComputerUse(params = {}) {
|
|
67
|
-
const config = resolveComputerUseConfig({
|
|
68
|
-
...params,
|
|
69
|
-
forceEnable: true,
|
|
70
|
-
overrides: {
|
|
71
|
-
...params.overrides,
|
|
72
|
-
enabled: true,
|
|
73
|
-
autoInstall: true
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
const status = await inspectCodexComputerUse({
|
|
77
|
-
...params,
|
|
78
|
-
config,
|
|
79
|
-
installPlugin: true
|
|
80
|
-
});
|
|
81
|
-
if (!status.ready) throw new CodexComputerUseSetupError(status);
|
|
82
|
-
return status;
|
|
83
|
-
}
|
|
84
|
-
async function inspectCodexComputerUse(params) {
|
|
85
|
-
const request = createComputerUseRequest(params);
|
|
86
|
-
if (params.installPlugin) await request("experimentalFeature/enablement/set", { enablement: { plugins: true } });
|
|
87
|
-
const marketplace = await resolveMarketplaceRef({
|
|
88
|
-
request,
|
|
89
|
-
config: params.config,
|
|
90
|
-
allowAdd: params.installPlugin,
|
|
91
|
-
signal: params.signal,
|
|
92
|
-
defaultBundledMarketplacePath: params.defaultBundledMarketplacePath
|
|
93
|
-
});
|
|
94
|
-
if (!marketplace.marketplace) return unavailableStatus(params.config, "marketplace_missing", marketplace.message ?? `No Codex marketplace containing ${params.config.pluginName} is registered. Configure computerUse.marketplaceSource or computerUse.marketplacePath, then run /codex computer-use install.`);
|
|
95
|
-
const pluginInspection = await ensureComputerUsePlugin({
|
|
96
|
-
request,
|
|
97
|
-
config: params.config,
|
|
98
|
-
marketplace: marketplace.marketplace,
|
|
99
|
-
installPlugin: params.installPlugin
|
|
100
|
-
});
|
|
101
|
-
if (!pluginInspection.ok) return pluginInspection.status;
|
|
102
|
-
return await readComputerUseTools({
|
|
103
|
-
request,
|
|
104
|
-
config: params.config,
|
|
105
|
-
plugin: pluginInspection.plugin,
|
|
106
|
-
installPlugin: params.installPlugin
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
async function ensureComputerUsePlugin(params) {
|
|
110
|
-
let plugin = await readComputerUsePlugin(params.request, params.marketplace, params.config.pluginName);
|
|
111
|
-
if (!plugin.summary.installed || !plugin.summary.enabled) {
|
|
112
|
-
if (!params.installPlugin) return {
|
|
113
|
-
ok: false,
|
|
114
|
-
status: statusFromPlugin({
|
|
115
|
-
config: params.config,
|
|
116
|
-
plugin,
|
|
117
|
-
tools: [],
|
|
118
|
-
reason: pluginSetupReason(plugin, params.marketplace),
|
|
119
|
-
message: pluginSetupMessage(params.config, plugin, params.marketplace)
|
|
120
|
-
})
|
|
121
|
-
};
|
|
122
|
-
if (params.marketplace.kind === "remote") return {
|
|
123
|
-
ok: false,
|
|
124
|
-
status: statusFromPlugin({
|
|
125
|
-
config: params.config,
|
|
126
|
-
plugin,
|
|
127
|
-
tools: [],
|
|
128
|
-
reason: "remote_install_unsupported",
|
|
129
|
-
message: remoteInstallUnsupportedMessage(plugin, params.marketplace)
|
|
130
|
-
})
|
|
131
|
-
};
|
|
132
|
-
await params.request("plugin/install", pluginRequestParams(params.marketplace, params.config.pluginName));
|
|
133
|
-
await reloadMcpServers(params.request);
|
|
134
|
-
plugin = await readComputerUsePlugin(params.request, params.marketplace, params.config.pluginName);
|
|
135
|
-
}
|
|
136
|
-
if (!plugin.summary.installed || !plugin.summary.enabled) return {
|
|
137
|
-
ok: false,
|
|
138
|
-
status: statusFromPlugin({
|
|
139
|
-
config: params.config,
|
|
140
|
-
plugin,
|
|
141
|
-
tools: [],
|
|
142
|
-
reason: pluginSetupReason(plugin, params.marketplace),
|
|
143
|
-
message: pluginSetupMessage(params.config, plugin, params.marketplace)
|
|
144
|
-
})
|
|
145
|
-
};
|
|
146
|
-
return {
|
|
147
|
-
ok: true,
|
|
148
|
-
plugin
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
async function readComputerUseTools(params) {
|
|
152
|
-
let server = await readMcpServerStatus(params.request, params.config.mcpServerName);
|
|
153
|
-
if (!server && params.installPlugin) {
|
|
154
|
-
await reloadMcpServers(params.request);
|
|
155
|
-
server = await readMcpServerStatus(params.request, params.config.mcpServerName);
|
|
156
|
-
}
|
|
157
|
-
if (!server) return statusFromPlugin({
|
|
158
|
-
config: params.config,
|
|
159
|
-
plugin: params.plugin,
|
|
160
|
-
tools: [],
|
|
161
|
-
reason: "mcp_missing",
|
|
162
|
-
message: `Computer Use is installed, but the ${params.config.mcpServerName} MCP server is not available.`
|
|
163
|
-
});
|
|
164
|
-
return statusFromPlugin({
|
|
165
|
-
config: params.config,
|
|
166
|
-
plugin: params.plugin,
|
|
167
|
-
tools: Object.keys(server.tools).toSorted(),
|
|
168
|
-
reason: "ready",
|
|
169
|
-
message: "Computer Use is ready."
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
async function resolveMarketplaceRef(params) {
|
|
173
|
-
let preferredMarketplaceName = params.config.marketplaceName;
|
|
174
|
-
if (params.config.marketplaceSource && params.allowAdd) {
|
|
175
|
-
const added = await params.request("marketplace/add", { source: params.config.marketplaceSource });
|
|
176
|
-
preferredMarketplaceName ??= added.marketplaceName;
|
|
177
|
-
}
|
|
178
|
-
if (params.config.marketplacePath) return { marketplace: preferredMarketplaceName ? {
|
|
179
|
-
kind: "local",
|
|
180
|
-
name: preferredMarketplaceName,
|
|
181
|
-
path: params.config.marketplacePath
|
|
182
|
-
} : {
|
|
183
|
-
kind: "local",
|
|
184
|
-
path: params.config.marketplacePath
|
|
185
|
-
} };
|
|
186
|
-
let candidates = await listComputerUseMarketplaceCandidates(params.request, params.config);
|
|
187
|
-
if (candidates.length === 0 && shouldAddBundledComputerUseMarketplace(params)) {
|
|
188
|
-
const bundledMarketplacePath = params.defaultBundledMarketplacePath ?? DEFAULT_CODEX_BUNDLED_MARKETPLACE_PATH;
|
|
189
|
-
const added = await params.request("marketplace/add", { source: bundledMarketplacePath });
|
|
190
|
-
preferredMarketplaceName ??= added.marketplaceName;
|
|
191
|
-
candidates = await listComputerUseMarketplaceCandidates(params.request, params.config);
|
|
192
|
-
}
|
|
193
|
-
const waitUntil = marketplaceDiscoveryWaitUntil(params);
|
|
194
|
-
while (candidates.length === 0) {
|
|
195
|
-
if (Date.now() >= waitUntil) break;
|
|
196
|
-
await delay(Math.min(CURATED_MARKETPLACE_POLL_INTERVAL_MS, waitUntil - Date.now()), params.signal);
|
|
197
|
-
candidates = await listComputerUseMarketplaceCandidates(params.request, params.config);
|
|
198
|
-
}
|
|
199
|
-
if (preferredMarketplaceName) {
|
|
200
|
-
const preferred = candidates.find((candidate) => candidate.name === preferredMarketplaceName);
|
|
201
|
-
if (preferred) return { marketplace: preferred };
|
|
202
|
-
return { message: `Configured Codex marketplace ${preferredMarketplaceName} was not found or does not contain ${params.config.pluginName}. Run /codex computer-use install with a source or path to install from a new marketplace.` };
|
|
203
|
-
}
|
|
204
|
-
if (candidates.length > 1) {
|
|
205
|
-
const preferred = chooseKnownComputerUseMarketplace(candidates);
|
|
206
|
-
if (preferred) return { marketplace: preferred };
|
|
207
|
-
return { message: `Multiple Codex marketplaces contain ${params.config.pluginName}. Configure computerUse.marketplaceName or computerUse.marketplacePath to choose one.` };
|
|
208
|
-
}
|
|
209
|
-
if (params.config.marketplaceSource && !params.allowAdd && candidates.length === 0) return { message: "Computer Use marketplace source is configured but has not been registered. Run /codex computer-use install to register it." };
|
|
210
|
-
const marketplace = candidates[0];
|
|
211
|
-
return marketplace ? { marketplace } : {};
|
|
212
|
-
}
|
|
213
|
-
async function listComputerUseMarketplaceCandidates(request, config) {
|
|
214
|
-
return findComputerUseMarketplaces(await request("plugin/list", { cwds: [] }), config.pluginName);
|
|
215
|
-
}
|
|
216
|
-
function blockUnsafeAutoInstallStatus(config) {
|
|
217
|
-
if (!config.marketplaceSource) return;
|
|
218
|
-
return unavailableStatus(config, "auto_install_blocked", "Computer Use auto-install only uses marketplaces Codex app-server has already discovered. Run /codex computer-use install to install from a configured marketplace source.");
|
|
219
|
-
}
|
|
220
|
-
function shouldAddBundledComputerUseMarketplace(params) {
|
|
221
|
-
const bundledMarketplacePath = params.defaultBundledMarketplacePath ?? DEFAULT_CODEX_BUNDLED_MARKETPLACE_PATH;
|
|
222
|
-
return params.allowAdd && !params.config.marketplaceSource && !params.config.marketplacePath && !params.config.marketplaceName && existsSync(bundledMarketplacePath);
|
|
223
|
-
}
|
|
224
|
-
function findComputerUseMarketplaces(listed, pluginName) {
|
|
225
|
-
return listed.marketplaces.filter((marketplace) => marketplace.plugins.some((plugin) => plugin.name === pluginName || plugin.id === pluginName || plugin.id === `${pluginName}@${marketplace.name}`)).map((marketplace) => {
|
|
226
|
-
if (marketplace.path) return {
|
|
227
|
-
kind: "local",
|
|
228
|
-
name: marketplace.name,
|
|
229
|
-
path: marketplace.path
|
|
230
|
-
};
|
|
231
|
-
return {
|
|
232
|
-
kind: "remote",
|
|
233
|
-
name: marketplace.name,
|
|
234
|
-
remoteMarketplaceName: marketplace.name
|
|
235
|
-
};
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
function chooseKnownComputerUseMarketplace(candidates) {
|
|
239
|
-
for (const marketplaceName of COMPUTER_USE_MARKETPLACE_NAME_PRIORITY) {
|
|
240
|
-
const candidate = candidates.find((marketplace) => marketplace.name === marketplaceName);
|
|
241
|
-
if (candidate) return candidate;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
function marketplaceDiscoveryWaitUntil(params) {
|
|
245
|
-
if (params.allowAdd && !params.config.marketplaceSource && !params.config.marketplacePath && !params.config.marketplaceName) return Date.now() + params.config.marketplaceDiscoveryTimeoutMs;
|
|
246
|
-
return 0;
|
|
247
|
-
}
|
|
248
|
-
async function delay(ms, signal) {
|
|
249
|
-
if (signal?.aborted) throw abortError(signal);
|
|
250
|
-
await new Promise((resolve, reject) => {
|
|
251
|
-
const onAbort = () => {
|
|
252
|
-
clearTimeout(timer);
|
|
253
|
-
signal?.removeEventListener("abort", onAbort);
|
|
254
|
-
reject(abortError(signal));
|
|
255
|
-
};
|
|
256
|
-
const timer = setTimeout(() => {
|
|
257
|
-
signal?.removeEventListener("abort", onAbort);
|
|
258
|
-
resolve();
|
|
259
|
-
}, ms);
|
|
260
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
function abortError(signal) {
|
|
264
|
-
const reason = signal?.reason;
|
|
265
|
-
return reason instanceof Error ? reason : /* @__PURE__ */ new Error("Computer Use setup was aborted.");
|
|
266
|
-
}
|
|
267
|
-
async function readComputerUsePlugin(request, marketplace, pluginName) {
|
|
268
|
-
return (await request("plugin/read", pluginRequestParams(marketplace, pluginName))).plugin;
|
|
269
|
-
}
|
|
270
|
-
async function readMcpServerStatus(request, serverName) {
|
|
271
|
-
let cursor;
|
|
272
|
-
do {
|
|
273
|
-
const response = await request("mcpServerStatus/list", {
|
|
274
|
-
cursor,
|
|
275
|
-
limit: 100,
|
|
276
|
-
detail: "toolsAndAuthOnly"
|
|
277
|
-
});
|
|
278
|
-
const found = response.data.find((server) => server.name === serverName);
|
|
279
|
-
if (found) return found;
|
|
280
|
-
cursor = response.nextCursor;
|
|
281
|
-
} while (cursor);
|
|
282
|
-
}
|
|
283
|
-
async function reloadMcpServers(request) {
|
|
284
|
-
await request("config/mcpServer/reload", void 0);
|
|
285
|
-
}
|
|
286
|
-
function pluginRequestParams(marketplace, pluginName) {
|
|
287
|
-
return {
|
|
288
|
-
...marketplace.kind === "local" ? { marketplacePath: marketplace.path } : {},
|
|
289
|
-
...marketplace.kind === "remote" ? { remoteMarketplaceName: marketplace.remoteMarketplaceName } : {},
|
|
290
|
-
pluginName
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
function pluginSetupReason(plugin, marketplace) {
|
|
294
|
-
if (marketplace.kind === "remote") return "remote_install_unsupported";
|
|
295
|
-
return plugin.summary.installed ? "plugin_disabled" : "plugin_not_installed";
|
|
296
|
-
}
|
|
297
|
-
function pluginSetupMessage(config, plugin, marketplace) {
|
|
298
|
-
if (marketplace.kind === "remote") return remoteInstallUnsupportedMessage(plugin, marketplace);
|
|
299
|
-
if (!plugin.summary.installed) return "Computer Use is available but not installed. Run /codex computer-use install or enable computerUse.autoInstall.";
|
|
300
|
-
return `Computer Use is installed, but the ${config.pluginName} plugin is disabled. Run /codex computer-use install or enable computerUse.autoInstall to re-enable it.`;
|
|
301
|
-
}
|
|
302
|
-
function remoteInstallUnsupportedMessage(plugin, marketplace) {
|
|
303
|
-
const marketplaceName = marketplace.name ?? plugin.marketplaceName;
|
|
304
|
-
return `Computer Use is ${plugin.summary.installed ? "installed but disabled" : "available"} in remote Codex marketplace ${marketplaceName}, but Codex app-server does not support remote plugin install yet. Configure computerUse.marketplaceSource or computerUse.marketplacePath for a local marketplace, then run /codex computer-use install.`;
|
|
305
|
-
}
|
|
306
|
-
function statusFromPlugin(params) {
|
|
307
|
-
return {
|
|
308
|
-
enabled: true,
|
|
309
|
-
ready: params.plugin.summary.installed && params.plugin.summary.enabled && params.tools.length > 0,
|
|
310
|
-
reason: params.reason,
|
|
311
|
-
installed: params.plugin.summary.installed,
|
|
312
|
-
pluginEnabled: params.plugin.summary.enabled,
|
|
313
|
-
mcpServerAvailable: params.tools.length > 0,
|
|
314
|
-
pluginName: params.config.pluginName,
|
|
315
|
-
mcpServerName: params.config.mcpServerName,
|
|
316
|
-
marketplaceName: params.plugin.marketplaceName,
|
|
317
|
-
...params.plugin.marketplacePath ? { marketplacePath: params.plugin.marketplacePath } : {},
|
|
318
|
-
tools: params.tools,
|
|
319
|
-
message: params.message
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
function disabledStatus(config) {
|
|
323
|
-
return {
|
|
324
|
-
enabled: false,
|
|
325
|
-
ready: false,
|
|
326
|
-
reason: "disabled",
|
|
327
|
-
installed: false,
|
|
328
|
-
pluginEnabled: false,
|
|
329
|
-
mcpServerAvailable: false,
|
|
330
|
-
pluginName: config.pluginName,
|
|
331
|
-
mcpServerName: config.mcpServerName,
|
|
332
|
-
tools: [],
|
|
333
|
-
message: "Computer Use is disabled."
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
function unavailableStatus(config, reason, message) {
|
|
337
|
-
return {
|
|
338
|
-
enabled: true,
|
|
339
|
-
ready: false,
|
|
340
|
-
reason,
|
|
341
|
-
installed: false,
|
|
342
|
-
pluginEnabled: false,
|
|
343
|
-
mcpServerAvailable: false,
|
|
344
|
-
pluginName: config.pluginName,
|
|
345
|
-
mcpServerName: config.mcpServerName,
|
|
346
|
-
...config.marketplaceName ? { marketplaceName: config.marketplaceName } : {},
|
|
347
|
-
...config.marketplacePath ? { marketplacePath: config.marketplacePath } : {},
|
|
348
|
-
tools: [],
|
|
349
|
-
message
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
function createComputerUseRequest(params) {
|
|
353
|
-
if (params.request) return params.request;
|
|
354
|
-
if (params.client) return async (method, requestParams) => await params.client.request(method, requestParams, {
|
|
355
|
-
timeoutMs: params.timeoutMs,
|
|
356
|
-
signal: params.signal
|
|
357
|
-
});
|
|
358
|
-
const runtime = resolveCodexAppServerRuntimeOptions({ pluginConfig: params.pluginConfig });
|
|
359
|
-
return async (method, requestParams) => await requestCodexAppServerJson({
|
|
360
|
-
method,
|
|
361
|
-
requestParams,
|
|
362
|
-
timeoutMs: params.timeoutMs ?? runtime.requestTimeoutMs,
|
|
363
|
-
startOptions: runtime.start
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
function resolveComputerUseConfig(params) {
|
|
367
|
-
const overrides = params.forceEnable ? {
|
|
368
|
-
...params.overrides,
|
|
369
|
-
enabled: true
|
|
370
|
-
} : params.overrides;
|
|
371
|
-
return resolveCodexComputerUseConfig({
|
|
372
|
-
pluginConfig: params.pluginConfig,
|
|
373
|
-
overrides
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
//#endregion
|
|
377
|
-
export { installCodexComputerUse as n, readCodexComputerUseStatus as r, ensureCodexComputerUse as t };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { r as isJsonObject } from "./protocol-2POPqAY4.js";
|
|
2
|
-
//#region extensions/codex/src/app-server/notification-correlation.ts
|
|
3
|
-
/**
|
|
4
|
-
* Correlates Codex app-server notifications with the active thread/turn so
|
|
5
|
-
* projectors can ignore global or stale events without losing diagnostics.
|
|
6
|
-
*/
|
|
7
|
-
/** Returns true when a notification payload belongs to the exact active thread and turn. */
|
|
8
|
-
function isCodexNotificationForTurn(value, threadId, turnId) {
|
|
9
|
-
if (!isJsonObject(value)) return false;
|
|
10
|
-
return readCodexNotificationThreadId(value) === threadId && readCodexNotificationTurnId(value) === turnId;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Reads a thread id from canonical top-level or nested thread payloads.
|
|
14
|
-
* The generated v2 schemas require top-level `threadId` on turn/item-scoped
|
|
15
|
-
* notifications and define `Turn` without one, so `turn.threadId` is not a
|
|
16
|
-
* wire shape and is deliberately not read here.
|
|
17
|
-
*/
|
|
18
|
-
function readCodexNotificationThreadId(record) {
|
|
19
|
-
const thread = isJsonObject(record.thread) ? record.thread : void 0;
|
|
20
|
-
return readString(record, "threadId") ?? (thread ? readString(thread, "id") : void 0);
|
|
21
|
-
}
|
|
22
|
-
/** Reads a turn id from either top-level notification params or nested turn payloads. */
|
|
23
|
-
function readCodexNotificationTurnId(record) {
|
|
24
|
-
return readNestedTurnId(record) ?? readString(record, "turnId");
|
|
25
|
-
}
|
|
26
|
-
function readNestedTurnId(record) {
|
|
27
|
-
const turn = record.turn;
|
|
28
|
-
return isJsonObject(turn) ? readString(turn, "id") : void 0;
|
|
29
|
-
}
|
|
30
|
-
function readString(record, key) {
|
|
31
|
-
const value = record[key];
|
|
32
|
-
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { readCodexNotificationThreadId as n, readCodexNotificationTurnId as r, isCodexNotificationForTurn as t };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { K as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-qWE88Dn2.js";
|
|
2
|
-
import { u as CodexAppServerRpcError, x as resolveCodexAppServerHomeDir } from "./shared-client-4ICy3U6d.js";
|
|
3
|
-
import { createRequire } from "node:module";
|
|
4
|
-
import { createHash } from "node:crypto";
|
|
5
|
-
import { OPENCLAW_VERSION } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
6
|
-
import { readPluginPackageVersion } from "openclaw/plugin-sdk/extension-shared";
|
|
7
|
-
//#region extensions/codex/src/app-server/capabilities.ts
|
|
8
|
-
/**
|
|
9
|
-
* Capability helpers for optional Codex app-server control-plane methods.
|
|
10
|
-
*/
|
|
11
|
-
/** Known app-server methods used by OpenClaw control surfaces. */
|
|
12
|
-
const CODEX_CONTROL_METHODS = {
|
|
13
|
-
account: "account/read",
|
|
14
|
-
compact: "thread/compact/start",
|
|
15
|
-
feedback: "feedback/upload",
|
|
16
|
-
forkThread: "thread/fork",
|
|
17
|
-
listMcpServers: "mcpServerStatus/list",
|
|
18
|
-
listSkills: "skills/list",
|
|
19
|
-
listThreads: "thread/list",
|
|
20
|
-
readThread: "thread/read",
|
|
21
|
-
rateLimits: "account/rateLimits/read",
|
|
22
|
-
archiveThread: "thread/archive",
|
|
23
|
-
renameThread: "thread/name/set",
|
|
24
|
-
resumeThread: "thread/resume",
|
|
25
|
-
review: "review/start",
|
|
26
|
-
unarchiveThread: "thread/unarchive"
|
|
27
|
-
};
|
|
28
|
-
/** Formats unsupported control calls differently from ordinary RPC failures. */
|
|
29
|
-
function describeControlFailure(error) {
|
|
30
|
-
if (isUnsupportedControlError(error)) return "unsupported by this Codex app-server";
|
|
31
|
-
return error instanceof Error ? error.message : String(error);
|
|
32
|
-
}
|
|
33
|
-
function isUnsupportedControlError(error) {
|
|
34
|
-
return error instanceof CodexAppServerRpcError && error.code === -32601;
|
|
35
|
-
}
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region extensions/codex/src/app-server/plugin-app-cache-key.ts
|
|
38
|
-
/**
|
|
39
|
-
* Builds stable Codex plugin/app inventory cache keys from app-server startup,
|
|
40
|
-
* auth, account, and version inputs without storing secret material.
|
|
41
|
-
*/
|
|
42
|
-
const CODEX_PLUGIN_VERSION = readPluginPackageVersion({ require: createRequire(import.meta.url) });
|
|
43
|
-
/** Builds the full app inventory cache key for Codex plugin/app discovery. */
|
|
44
|
-
function buildCodexPluginAppCacheKey(params) {
|
|
45
|
-
return buildCodexAppInventoryCacheKey({
|
|
46
|
-
codexHome: params.runtimeIdentity?.codexHome ?? resolveCodexPluginAppCacheCodexHome(params.appServer, params.agentDir),
|
|
47
|
-
endpoint: resolveCodexPluginAppCacheEndpoint(params.appServer),
|
|
48
|
-
authProfileId: params.authProfileId,
|
|
49
|
-
accountId: params.accountId,
|
|
50
|
-
envApiKeyFingerprint: params.envApiKeyFingerprint,
|
|
51
|
-
appServerVersion: params.appServerVersion ?? params.runtimeIdentity?.serverVersion,
|
|
52
|
-
runtimeIdentity: params.runtimeIdentity
|
|
53
|
-
}, OPENCLAW_VERSION, CODEX_PLUGIN_VERSION);
|
|
54
|
-
}
|
|
55
|
-
/** Builds a durable thread-binding fingerprint for one initialized app-server runtime. */
|
|
56
|
-
function buildCodexAppServerRuntimeFingerprint(params) {
|
|
57
|
-
return JSON.stringify({
|
|
58
|
-
endpoint: resolveCodexPluginAppCacheEndpoint(params.appServer),
|
|
59
|
-
connectionClass: params.appServer.connectionClass,
|
|
60
|
-
remoteWorkspaceRoot: params.appServer.remoteWorkspaceRoot ?? null,
|
|
61
|
-
appServerVersion: params.appServerVersion ?? params.runtimeIdentity?.serverVersion ?? null,
|
|
62
|
-
runtimeIdentity: params.runtimeIdentity ?? null
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
/** Serializes app-server endpoint identity, including credential fingerprints. */
|
|
66
|
-
function resolveCodexPluginAppCacheEndpoint(appServer) {
|
|
67
|
-
return JSON.stringify({
|
|
68
|
-
transport: appServer.start.transport,
|
|
69
|
-
command: appServer.start.command,
|
|
70
|
-
args: appServer.start.args,
|
|
71
|
-
url: appServer.start.url ?? null,
|
|
72
|
-
credentialFingerprint: fingerprintCodexPluginAppCacheCredentials(appServer.start)
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
/** Resolves the CODEX_HOME value that scopes local app-server inventory. */
|
|
76
|
-
function resolveCodexPluginAppCacheCodexHome(appServer, agentDir) {
|
|
77
|
-
const configuredCodexHome = appServer.start.env?.CODEX_HOME?.trim();
|
|
78
|
-
if (configuredCodexHome) return configuredCodexHome;
|
|
79
|
-
return appServer.start.transport === "stdio" && agentDir ? resolveCodexAppServerHomeDir(agentDir) : void 0;
|
|
80
|
-
}
|
|
81
|
-
function fingerprintCodexPluginAppCacheCredentials(startOptions) {
|
|
82
|
-
const authToken = startOptions.authToken ?? "";
|
|
83
|
-
const headers = Object.entries(startOptions.headers).map(([key, value]) => [key.toLowerCase(), value]).toSorted(([left], [right]) => left.localeCompare(right));
|
|
84
|
-
if (!authToken && headers.length === 0) return null;
|
|
85
|
-
const hash = createHash("sha256");
|
|
86
|
-
hash.update("openclaw:codex:plugin-app-cache-credentials:v1");
|
|
87
|
-
hash.update("\0");
|
|
88
|
-
hash.update(authToken);
|
|
89
|
-
for (const [key, value] of headers) {
|
|
90
|
-
hash.update("\0");
|
|
91
|
-
hash.update(key);
|
|
92
|
-
hash.update("\0");
|
|
93
|
-
hash.update(value);
|
|
94
|
-
}
|
|
95
|
-
return `sha256:${hash.digest("hex")}`;
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
export { describeControlFailure as i, buildCodexPluginAppCacheKey as n, CODEX_CONTROL_METHODS as r, buildCodexAppServerRuntimeFingerprint as t };
|
package/dist/request-BcJyl8KL.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { a as getLeasedSharedCodexAppServerClient, i as createIsolatedCodexAppServerClient, l as withTimeout, o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-4ICy3U6d.js";
|
|
3
|
-
import { t as resolveCodexAppServerDirectSandboxBypassBlock } from "./sandbox-guard-DA2TQfZW.js";
|
|
4
|
-
//#region extensions/codex/src/app-server/request.ts
|
|
5
|
-
var request_exports = /* @__PURE__ */ __exportAll({ requestCodexAppServerJson: () => requestCodexAppServerJson });
|
|
6
|
-
async function requestCodexAppServerJson(params) {
|
|
7
|
-
const sandboxBlock = resolveCodexAppServerDirectSandboxBypassBlock({
|
|
8
|
-
method: params.method,
|
|
9
|
-
requestParams: params.requestParams,
|
|
10
|
-
config: params.config,
|
|
11
|
-
sessionKey: params.sessionKey,
|
|
12
|
-
sessionId: params.sessionId
|
|
13
|
-
});
|
|
14
|
-
if (sandboxBlock) throw new Error(sandboxBlock);
|
|
15
|
-
const timeoutMs = params.timeoutMs ?? 6e4;
|
|
16
|
-
return await withTimeout((async () => {
|
|
17
|
-
const client = await (params.isolated ? createIsolatedCodexAppServerClient : getLeasedSharedCodexAppServerClient)({
|
|
18
|
-
startOptions: params.startOptions,
|
|
19
|
-
timeoutMs,
|
|
20
|
-
authProfileId: params.authProfileId,
|
|
21
|
-
agentDir: params.agentDir,
|
|
22
|
-
config: params.config
|
|
23
|
-
});
|
|
24
|
-
try {
|
|
25
|
-
return await client.request(params.method, params.requestParams, { timeoutMs });
|
|
26
|
-
} finally {
|
|
27
|
-
if (params.isolated) await client.closeAndWait({
|
|
28
|
-
exitTimeoutMs: 2e3,
|
|
29
|
-
forceKillDelayMs: 250
|
|
30
|
-
});
|
|
31
|
-
else releaseLeasedSharedCodexAppServerClient(client);
|
|
32
|
-
}
|
|
33
|
-
})(), timeoutMs, `codex app-server ${params.method} timed out`);
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { request_exports as n, requestCodexAppServerJson as t };
|