@agimon-ai/po-computer-use 0.0.0-alpha.55 → 0.0.0-alpha.57

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.
@@ -0,0 +1,1145 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ let node_path = require("node:path");
24
+ node_path = __toESM(node_path, 1);
25
+ let node_child_process = require("node:child_process");
26
+ let node_fs_promises = require("node:fs/promises");
27
+ let node_module = require("node:module");
28
+ let node_crypto = require("node:crypto");
29
+ let _agimon_ai_po_core_packageApi = require("@agimon-ai/po-core/packageApi");
30
+ //#region src/constants/computerUse.ts
31
+ const COMPUTER_USE_GUIDANCE = `[COMPUTER USE ACTIVE]
32
+ Use computer_state before acting and after any action that may change the interface. Use only element refs and snapshot ids returned by computer_state. Use computer_action for one semantic press, focus, set_value, or scroll at a time. Use computer_exec only for a trusted, explicitly allowed local TypeScript script. Never infer coordinates, inspect another application, bypass secure elements, or retry an uncertain outcome. Stop computer use when the task is complete.`;
33
+ const COMMAND_NAME = "computer-use";
34
+ const COMMAND_DESCRIPTION = "Inspect or manage the session computer use mode";
35
+ const COMPUTER_USE_TOOL_NAMES = [
36
+ "computer_state",
37
+ "computer_action",
38
+ "computer_exec"
39
+ ];
40
+ /** The session artifact storage service and the folder computer-use evidence lands in. */
41
+ const COMPUTER_USE_ARTIFACTS_SERVICE = "po/artifacts";
42
+ const COMPUTER_USE_ARTIFACT_DIRECTORY = "computer-use";
43
+ /** The host recording store's own bounds: its largest recording and its range size. */
44
+ const COMPUTER_USE_RECORDING_MAX_BYTES = 134217728;
45
+ const COMPUTER_USE_RECORDING_CHUNK_BYTES = 1048576;
46
+ const COMPUTER_USE_CODEMODE_GUIDANCE = "[COMPUTER USE ACTIVE]\nUse computer.state() in exec before acting and after any action that may change the interface. Use only element refs and snapshot ids returned by computer.state(). Never infer coordinates or bypass secure elements. Call computer.stop() when the task is complete. Load codemode-how-to-computer-use for details.";
47
+ //#endregion
48
+ //#region src/services/computerScriptWorker/index.ts
49
+ /** Source for an isolated child process. Restricted modules execute in QuickJS, not in Node's realm. */
50
+ const COMPUTER_SCRIPT_WORKER_SOURCE = String.raw`
51
+ import { readFileSync, realpathSync, statSync } from 'node:fs';
52
+ import path from 'node:path';
53
+ import { stripTypeScriptTypes } from 'node:module';
54
+ import { pathToFileURL } from 'node:url';
55
+
56
+ let nextRequestId = 0;
57
+ let started = false;
58
+ const pending = new Map();
59
+ const controller = new AbortController();
60
+ process.once('SIGTERM', () => controller.abort());
61
+ const send = (message) => {
62
+ if (process.connected) process.send(message, () => {});
63
+ };
64
+ const call = (operation, payload) => new Promise((resolve, reject) => {
65
+ if (controller.signal.aborted) return reject(new Error('Computer script was cancelled.'));
66
+ if (pending.size >= 64) return reject(new Error('Too many outstanding program operations.'));
67
+ const id = String(++nextRequestId);
68
+ pending.set(id, { resolve, reject });
69
+ send({ type: 'program', id, operation, payload });
70
+ });
71
+
72
+ async function restricted(message) {
73
+ const { getQuickJS } = await import(pathToFileURL(message.quickjsPath).href);
74
+ const QuickJS = await getQuickJS();
75
+ const runtime = QuickJS.newRuntime();
76
+ runtime.setMemoryLimit(32 * 1024 * 1024);
77
+ runtime.setMaxStackSize(512 * 1024);
78
+ const deadline = Date.now() + message.timeoutMs;
79
+ runtime.setInterruptHandler(() => controller.signal.aborted || Date.now() >= deadline);
80
+ const { realpath } = await import('node:fs/promises');
81
+ const root = await realpath(message.scriptRoot);
82
+ const sources = new Map();
83
+ let sourceBytes = 0;
84
+ let moduleFailure;
85
+ // sync: QuickJS invokes module normalization and loading synchronously and cannot await filesystem reads.
86
+ const modulePath = (candidate) => {
87
+ const filename = realpathSync(candidate);
88
+ const relative = path.relative(root, filename);
89
+ if (relative === '..' || relative.startsWith('..' + path.sep) || path.isAbsolute(relative)) {
90
+ throw new Error('Computer helper escapes the admitted script root.');
91
+ }
92
+ if (!/\.(ts|js|mjs)$/.test(filename)) throw new Error('Computer helpers must be JavaScript or erasable TypeScript.');
93
+ return filename;
94
+ };
95
+ const entry = modulePath(message.scriptPath);
96
+ runtime.setModuleLoader((filename) => {
97
+ // Preserve a rejected normalization even if the engine subsequently asks to load an empty name.
98
+ if (moduleFailure) throw moduleFailure;
99
+ if (sources.has(filename)) return sources.get(filename);
100
+ if (sources.size >= 32 || statSync(filename).size > 256 * 1024) throw new Error('Computer script module limit exceeded.');
101
+ const source = readFileSync(filename, 'utf8');
102
+ sourceBytes += Buffer.byteLength(source);
103
+ if (sourceBytes > 512 * 1024) throw new Error('Computer script source limit exceeded.');
104
+ const compiled = filename.endsWith('.ts') ? stripTypeScriptTypes(source, { mode: 'strip' }) : source;
105
+ sources.set(filename, compiled);
106
+ return compiled;
107
+ }, (base, name) => {
108
+ try {
109
+ if (name === '__entry__') return entry;
110
+ if (!name.startsWith('./') && !name.startsWith('../')) {
111
+ throw new Error('Restricted computer functions cannot import host or package modules.');
112
+ }
113
+ return modulePath(path.resolve(path.dirname(base), name));
114
+ } catch (error) {
115
+ moduleFailure = error;
116
+ throw error;
117
+ }
118
+ });
119
+ const vm = runtime.newContext();
120
+ let disposed = false;
121
+ const deferreds = new Set();
122
+ const pump = () => {
123
+ if (disposed) return;
124
+ const jobs = runtime.executePendingJobs();
125
+ if (jobs.error) {
126
+ const detail = vm.dump(jobs.error);
127
+ jobs.error.dispose();
128
+ throw new Error(detail?.message ?? String(detail));
129
+ }
130
+ };
131
+ const set = (name, value) => {
132
+ vm.setProp(vm.global, name, value);
133
+ value.dispose();
134
+ };
135
+ set('__input', vm.newString(JSON.stringify(message.input)));
136
+ set('__aborted', vm.newFunction('__aborted', () => controller.signal.aborted ? vm.true : vm.false));
137
+ set('__log', vm.newFunction('__log', (level, text) => {
138
+ send({ type: 'log', level: vm.getString(level), message: vm.getString(text) });
139
+ }));
140
+ set('__call', vm.newFunction('__call', (operationHandle, payloadHandle) => {
141
+ const operation = vm.getString(operationHandle);
142
+ const serialized = vm.getString(payloadHandle);
143
+ if (serialized.length > message.maxOutputBytes) throw new Error('Computer action exceeds the size limit.');
144
+ if (operation !== 'observe' && operation !== 'act') throw new Error('Unsupported program operation.');
145
+ const deferred = vm.newPromise();
146
+ deferreds.add(deferred);
147
+ call(operation, JSON.parse(serialized)).then((value) => {
148
+ if (disposed) return;
149
+ const handle = vm.newString(JSON.stringify(value));
150
+ deferred.resolve(handle);
151
+ handle.dispose();
152
+ }, (error) => {
153
+ if (disposed) return;
154
+ const handle = vm.newError(error.message);
155
+ deferred.reject(handle);
156
+ handle.dispose();
157
+ }).then(() => {
158
+ if (disposed) return;
159
+ deferred.dispose();
160
+ deferreds.delete(deferred);
161
+ pump();
162
+ }).catch((error) => send({ type: 'failed', error: error.message }));
163
+ return deferred.handle.dup();
164
+ }));
165
+ let evaluation;
166
+ try {
167
+ evaluation = vm.unwrapResult(vm.evalCode(
168
+ 'import { run } from "__entry__";\n' +
169
+ 'const invoke = __call; const log = __log; const isAborted = __aborted;\n' +
170
+ 'const program = Object.freeze({\n' +
171
+ ' observe: async (options = {}) => JSON.parse(await invoke("observe", JSON.stringify(options))),\n' +
172
+ ' act: async (action) => JSON.parse(await invoke("act", JSON.stringify(action)))\n' +
173
+ '});\n' +
174
+ 'const logger = Object.freeze(Object.fromEntries(["debug","info","warn","error"].map(level => [level, value => log(level, String(value))])));\n' +
175
+ 'const signal = Object.freeze({ get aborted() { return isAborted(); }, throwIfAborted() { if (isAborted()) throw new Error("Computer script was cancelled."); } });\n' +
176
+ 'const result = await run({ context: { program }, input: JSON.parse(__input), logger, signal });\n' +
177
+ 'globalThis.__result = result === undefined ? undefined : JSON.stringify(result);',
178
+ path.join(root, '__computer_entry__.mjs'), { type: 'module' },
179
+ ));
180
+ const completion = vm.resolvePromise(evaluation);
181
+ pump();
182
+ const completed = vm.unwrapResult(await completion);
183
+ completed.dispose();
184
+ const result = vm.getProp(vm.global, '__result');
185
+ const resultJson = vm.dump(result);
186
+ result.dispose();
187
+ return resultJson;
188
+ } finally {
189
+ disposed = true;
190
+ for (const deferred of deferreds) deferred.dispose();
191
+ evaluation?.dispose();
192
+ vm.dispose();
193
+ runtime.dispose();
194
+ }
195
+ }
196
+
197
+ process.on('message', async (message) => {
198
+ if (message?.type === 'response') {
199
+ const request = pending.get(message.id);
200
+ if (!request) return;
201
+ pending.delete(message.id);
202
+ if (message.error) request.reject(new Error(message.error));
203
+ else request.resolve(message.value);
204
+ return;
205
+ }
206
+ if (message?.type !== 'start' || started) return;
207
+ started = true;
208
+ try {
209
+ let resultJson;
210
+ if (message.trusted) {
211
+ const loaded = await import(pathToFileURL(message.scriptPath).href);
212
+ if (typeof loaded.run !== 'function') throw new Error('Computer script must export a named run function.');
213
+ const program = {
214
+ observe: (options = {}) => call('observe', options),
215
+ act: (action) => call('act', action),
216
+ };
217
+ const logger = Object.fromEntries(['debug','info','warn','error'].map(level => [level, value => {
218
+ send({ type: 'log', level, message: String(value) });
219
+ }]));
220
+ const result = await loaded.run({ context: { program }, input: message.input, logger, signal: controller.signal });
221
+ resultJson = result === undefined ? undefined : JSON.stringify(result);
222
+ } else {
223
+ resultJson = await restricted(message);
224
+ }
225
+ if (typeof resultJson === 'string' && Buffer.byteLength(resultJson) > message.maxOutputBytes) {
226
+ throw new Error('Computer script result exceeded the size limit.');
227
+ }
228
+ send({ type: 'complete', resultJson });
229
+ } catch (error) {
230
+ send({ type: 'failed', error: String(error?.message ?? error).slice(0, 1024) });
231
+ }
232
+ });
233
+ `;
234
+ //#endregion
235
+ //#region src/types/computerUseApi.ts
236
+ const API_BASE_PATH = "computer-use";
237
+ const computerUseChannelType = "computer_use_state";
238
+ const COMPUTER_USE_MODE_ID = "computer-use";
239
+ const COMPUTER_USE_STATUS_KEY = "po-computer-use";
240
+ const COMPUTER_USE_CONFIRMATION_WINDOW_MS = 12e4;
241
+ /**
242
+ * Every path this API answers on, below its mount.
243
+ *
244
+ * The typed route table in `./apiRoutes` is built from this, the dispatcher
245
+ * reads that table, and the hub channel addresses the broker with these same
246
+ * strings, so a route cannot move on one side alone.
247
+ */
248
+ const COMPUTER_USE_ROUTES = {
249
+ activate: "/activate",
250
+ artifact: "/artifact",
251
+ agentState: "/agent/state",
252
+ agentObserve: "/agent/observe",
253
+ agentAction: "/agent/action",
254
+ agentStop: "/agent/stop",
255
+ hubState: "/hub/state",
256
+ hubActivation: "/hub/activation",
257
+ hubAuthorization: "/hub/authorization",
258
+ hubNext: "/hub/next",
259
+ hubComplete: "/hub/complete",
260
+ hubStop: "/hub/stop"
261
+ };
262
+ const COMPUTER_USE_WAKE_LIMIT = 1e6;
263
+ //#endregion
264
+ //#region src/types/desktopPermissions.ts
265
+ /** The macOS privacy permissions Desktop reports, in the order the settings page shows them. */
266
+ const DESKTOP_PERMISSIONS = [
267
+ "accessibility",
268
+ "screen-recording",
269
+ "microphone",
270
+ "automation",
271
+ "full-disk-access"
272
+ ];
273
+ function isDesktopPermission(value) {
274
+ return typeof value === "string" && DESKTOP_PERMISSIONS.includes(value);
275
+ }
276
+ //#endregion
277
+ //#region src/types/apiRoutes.ts
278
+ /**
279
+ * This package's routes, as data.
280
+ *
281
+ * No scope and no base path: the build reads both off
282
+ * `src/extensions/workspaces/sessions/(backend)/api/computer-use/`, so the
283
+ * mount is stated once, by the folder that creates it.
284
+ *
285
+ * The paths come from `COMPUTER_USE_ROUTES` rather than being written out
286
+ * again. That table already addressed the broker from the hub channel and from
287
+ * the broker's own dispatcher, and a second copy here is exactly the
288
+ * disagreement this file exists to prevent. The dispatcher now reads this
289
+ * table, so the page, the broker and the hub all resolve one set of strings.
290
+ *
291
+ * Activation, status, cancellation and recording reads are reachable from a browser. The `/agent/` and `/hub/` routes
292
+ * each demand a host-issued bearer token and answer 404 without one; they are
293
+ * declared here because they are this API's surface, not because a page calls
294
+ * them.
295
+ */
296
+ const routes = {
297
+ artifact: {
298
+ method: "GET",
299
+ path: COMPUTER_USE_ROUTES.artifact,
300
+ query: ["artifactId", "offset"],
301
+ raw: true
302
+ },
303
+ activationState: {
304
+ method: "GET",
305
+ path: COMPUTER_USE_ROUTES.activate,
306
+ response: void 0
307
+ },
308
+ cancelActivation: {
309
+ method: "DELETE",
310
+ path: COMPUTER_USE_ROUTES.activate,
311
+ response: void 0
312
+ },
313
+ activate: {
314
+ method: "POST",
315
+ path: COMPUTER_USE_ROUTES.activate,
316
+ response: void 0
317
+ },
318
+ agentState: {
319
+ method: "GET",
320
+ path: COMPUTER_USE_ROUTES.agentState,
321
+ response: void 0
322
+ },
323
+ /** Answers whatever the admitted Desktop provider returned, which is runtime-defined JSON. */
324
+ agentObserve: {
325
+ method: "POST",
326
+ path: COMPUTER_USE_ROUTES.agentObserve,
327
+ response: void 0
328
+ },
329
+ agentAction: {
330
+ method: "POST",
331
+ path: COMPUTER_USE_ROUTES.agentAction,
332
+ response: void 0
333
+ },
334
+ agentStop: {
335
+ method: "POST",
336
+ path: COMPUTER_USE_ROUTES.agentStop,
337
+ response: void 0
338
+ },
339
+ hubState: {
340
+ method: "GET",
341
+ path: COMPUTER_USE_ROUTES.hubState,
342
+ response: void 0
343
+ },
344
+ /** Null until a reader has confirmed one; reading it moves the session to `activating`. */
345
+ hubActivation: {
346
+ method: "GET",
347
+ path: COMPUTER_USE_ROUTES.hubActivation,
348
+ response: void 0
349
+ },
350
+ hubAuthorization: {
351
+ method: "GET",
352
+ path: COMPUTER_USE_ROUTES.hubAuthorization,
353
+ response: void 0
354
+ },
355
+ hubNext: {
356
+ method: "GET",
357
+ path: COMPUTER_USE_ROUTES.hubNext,
358
+ response: void 0
359
+ },
360
+ hubComplete: {
361
+ method: "POST",
362
+ path: COMPUTER_USE_ROUTES.hubComplete,
363
+ response: void 0
364
+ },
365
+ hubStop: {
366
+ method: "POST",
367
+ path: COMPUTER_USE_ROUTES.hubStop,
368
+ response: void 0
369
+ },
370
+ /** Desktop's macOS permission states, served by the hub's `desktop-permissions` mount. */
371
+ desktopPermissions: {
372
+ method: "GET",
373
+ path: "/",
374
+ response: void 0
375
+ },
376
+ /** Asks macOS for the body's permission on the Mac running Desktop; answers the states after. */
377
+ requestDesktopPermission: {
378
+ method: "POST",
379
+ path: "/",
380
+ response: void 0
381
+ }
382
+ };
383
+ //#endregion
384
+ //#region src/services/computerUseApi/index.ts
385
+ function jsonError(message, status) {
386
+ return Response.json({ error: message }, { status });
387
+ }
388
+ function record(value) {
389
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
390
+ }
391
+ async function body(request) {
392
+ try {
393
+ return record(await request.json()) ?? {};
394
+ } catch {
395
+ return {};
396
+ }
397
+ }
398
+ function semanticAction(value) {
399
+ const allowed = (keys) => Object.keys(value).every((key) => keys.includes(key));
400
+ if (value.kind === "launch") return typeof value.app === "string" && value.app.length > 0 && allowed(["kind", "app"]);
401
+ if (!(typeof value.snapshotId === "string" && value.snapshotId.length > 0 && typeof value.elementRef === "string" && value.elementRef.length > 0)) return false;
402
+ if (value.kind === "press" || value.kind === "focus") return allowed([
403
+ "kind",
404
+ "snapshotId",
405
+ "elementRef"
406
+ ]);
407
+ if (value.kind === "set_value") return typeof value.value === "string" && allowed([
408
+ "kind",
409
+ "snapshotId",
410
+ "elementRef",
411
+ "value"
412
+ ]);
413
+ if (value.kind === "scroll") return [
414
+ "up",
415
+ "down",
416
+ "left",
417
+ "right"
418
+ ].includes(value.direction) && (value.amount === "line" || value.amount === "page") && allowed([
419
+ "kind",
420
+ "snapshotId",
421
+ "elementRef",
422
+ "direction",
423
+ "amount"
424
+ ]);
425
+ if (value.kind === "perform") return typeof value.action === "string" && /^AX[A-Za-z]{1,62}$/u.test(value.action) && allowed([
426
+ "kind",
427
+ "snapshotId",
428
+ "elementRef",
429
+ "action"
430
+ ]);
431
+ return false;
432
+ }
433
+ /** Throws on anything but the documented observation options, so every caller shares one check. */
434
+ function observationOptions(value) {
435
+ const options = record(value);
436
+ if (options === void 0) throw new TypeError("Observation options must be an object.");
437
+ for (const [key, entry] of Object.entries(options)) if (!(key === "includeScreenshot" ? typeof entry === "boolean" : key === "root" || key === "label" || key === "role" ? typeof entry === "string" && entry.length > 0 && entry.length <= 256 : key === "offset" ? Number.isInteger(entry) && entry >= 0 && entry <= 2e3 : key === "limit" && Number.isInteger(entry) && entry >= 1 && entry <= 500)) throw new TypeError(`Invalid observation option "${key}".`);
438
+ return options;
439
+ }
440
+ function artifactView(value) {
441
+ const input = record(value);
442
+ if (typeof input?.artifactId !== "string" || input.status !== "ready" && input.status !== "failed") return void 0;
443
+ const safeUrl = (candidate) => typeof candidate === "string" && candidate.startsWith("/api/") ? candidate : void 0;
444
+ const downloadUrl = safeUrl(input.downloadUrl);
445
+ const previewUrl = safeUrl(input.previewUrl);
446
+ const artifactFailure = record(input.failure);
447
+ const safeFailure = typeof artifactFailure?.code === "string" && typeof artifactFailure.message === "string" ? {
448
+ code: artifactFailure.code.slice(0, 128),
449
+ message: artifactFailure.message.slice(0, 512)
450
+ } : void 0;
451
+ return {
452
+ artifactId: input.artifactId,
453
+ status: input.status,
454
+ ...typeof input.sizeBytes === "number" && Number.isSafeInteger(input.sizeBytes) && input.sizeBytes > 0 ? { sizeBytes: input.sizeBytes } : {},
455
+ ...downloadUrl === void 0 ? {} : { downloadUrl },
456
+ ...previewUrl === void 0 ? {} : { previewUrl },
457
+ ...typeof input.actionCount === "number" ? { actionCount: input.actionCount } : {},
458
+ ...typeof input.completedAt === "string" ? { completedAt: input.completedAt } : {},
459
+ ...safeFailure === void 0 ? {} : { failure: safeFailure }
460
+ };
461
+ }
462
+ var ComputerUseRequestBroker = class ComputerUseRequestBroker {
463
+ sessionId;
464
+ internalToken;
465
+ hubToken;
466
+ directEvents;
467
+ requestTimeoutMs;
468
+ revision = 0;
469
+ wake = 0;
470
+ phase = "inactive";
471
+ activation;
472
+ grantId;
473
+ expiresAt;
474
+ actionSequence = 0;
475
+ expiryTimer;
476
+ failure;
477
+ artifact;
478
+ pending;
479
+ closed = false;
480
+ desktop;
481
+ beforeActivate;
482
+ listeners = /* @__PURE__ */ new Set();
483
+ unsubscribeDesktop;
484
+ static DEFAULT_REQUEST_TIMEOUT_MS = 3e4;
485
+ constructor(options) {
486
+ this.sessionId = options.sessionId ?? "unknown";
487
+ this.internalToken = options.internalToken;
488
+ this.hubToken = options.hubToken;
489
+ this.directEvents = options.directEvents;
490
+ this.requestTimeoutMs = options.requestTimeoutMs ?? ComputerUseRequestBroker.DEFAULT_REQUEST_TIMEOUT_MS;
491
+ this.desktop = options.desktop;
492
+ this.beforeActivate = options.beforeActivate;
493
+ this.unsubscribeDesktop = options.desktop?.subscribe(() => {
494
+ clearTimeout(this.expiryTimer);
495
+ if (!options.desktop?.available) {
496
+ this.rejectPending("Desktop disconnected.");
497
+ this.phase = "failed";
498
+ this.grantId = void 0;
499
+ this.failure = {
500
+ code: "desktop_unavailable",
501
+ message: "Desktop disconnected."
502
+ };
503
+ } else if (this.phase !== "inactive" && this.phase !== "failed") {
504
+ this.phase = "stopping";
505
+ this.rejectPending("Control was stopped by Desktop.");
506
+ }
507
+ this.changed();
508
+ });
509
+ }
510
+ state() {
511
+ return Object.freeze({
512
+ sessionId: this.sessionId,
513
+ revision: this.revision,
514
+ wake: this.wake,
515
+ phase: this.phase,
516
+ ...this.activation === void 0 ? {} : {
517
+ requestId: this.activation.requestId,
518
+ target: this.activation.target,
519
+ durationMs: this.activation.durationSeconds * 1e3
520
+ },
521
+ ...this.expiresAt === void 0 ? {} : { expiresAt: this.expiresAt },
522
+ ...this.failure === void 0 ? {} : { failure: this.failure },
523
+ ...this.artifact === void 0 ? {} : { artifact: this.artifact }
524
+ });
525
+ }
526
+ /** Tools and the API share this broker. No socket, credential discovery, or second state store. */
527
+ sessionClient() {
528
+ const result = async (response) => {
529
+ const value = await response.json();
530
+ if (!response.ok) throw new Error(value.error ?? `Computer-use request failed (${response.status}).`);
531
+ return value;
532
+ };
533
+ const requireDesktop = () => {
534
+ if (this.closed || !this.desktop?.available || this.desktop.enabled === false) throw new Error("Desktop computer use is unavailable.");
535
+ };
536
+ return {
537
+ state: async () => this.state(),
538
+ subscribeStatus: (listener) => {
539
+ this.listeners.add(listener);
540
+ return () => {
541
+ this.listeners.delete(listener);
542
+ };
543
+ },
544
+ observe: async (signal, options = {}) => {
545
+ requireDesktop();
546
+ return result(await this.enqueue("observe", observationOptions(options), signal));
547
+ },
548
+ act: async (action, signal) => {
549
+ requireDesktop();
550
+ if (!semanticAction(action)) throw new Error("A valid semantic action is required.");
551
+ return result(await this.enqueue("act", action, signal));
552
+ },
553
+ stop: async (signal) => {
554
+ signal?.throwIfAborted();
555
+ if (this.phase !== "inactive" && this.phase !== "failed") {
556
+ this.phase = "stopping";
557
+ this.rejectPending("Computer use was stopped.");
558
+ this.changed();
559
+ }
560
+ return this.state();
561
+ }
562
+ };
563
+ }
564
+ changed() {
565
+ this.revision += 1;
566
+ this.wake = (this.wake + 1) % COMPUTER_USE_WAKE_LIMIT;
567
+ const state = this.state();
568
+ for (const listener of this.listeners) listener(state);
569
+ this.directEvents.publish(computerUseChannelType, this.sessionId, state);
570
+ }
571
+ authorized(request, token) {
572
+ return token !== void 0 && request.headers.get("authorization") === `Bearer ${token}`;
573
+ }
574
+ async requestActivation(request) {
575
+ if (!this.desktop?.available || !(this.desktop.authorizeActivation?.(request.headers) ?? this.desktop.authorize(request.headers))) return jsonError("Not found.", 404);
576
+ if (this.desktop.enabled === false) return jsonError("Enable computer use in global Desktop settings first.", 409);
577
+ const stamped = (0, _agimon_ai_po_core_packageApi.poApiCallerFrom)(request.headers);
578
+ const caller = stamped?.locality === "remote" ? stamped : {
579
+ locality: "local",
580
+ stepUp: "not-required"
581
+ };
582
+ if (this.phase !== "inactive" && this.phase !== "failed") return jsonError("Computer use is already busy.", 409);
583
+ const input = await body(request);
584
+ const target = record(input.target);
585
+ const durationMs = input.durationMs;
586
+ const desktopTarget = target?.scope === "desktop" && Object.keys(target).length === 1;
587
+ if (target === void 0 && (input.target !== void 0 || caller.locality !== "remote") || target !== void 0 && !desktopTarget && (typeof target.windowId !== "string" || typeof target.bundleId !== "string")) return jsonError("A Desktop window or the whole desktop is required, or a remote request must leave selection to the Mac.", 400);
588
+ if (typeof durationMs !== "number" || !Number.isInteger(durationMs) || durationMs < 1e3 || durationMs > 18e5) return jsonError("The requested duration is invalid.", 400);
589
+ try {
590
+ this.desktop.claim(request.headers);
591
+ await this.beforeActivate?.();
592
+ } catch (error) {
593
+ return jsonError(error instanceof Error ? error.message : String(error), 409);
594
+ }
595
+ if (this.closed || !this.desktop.available || this.phase !== "inactive" && this.phase !== "failed") return jsonError("Computer use is unavailable or already busy.", 409);
596
+ const createdAt = Date.now();
597
+ this.activation = Object.freeze({
598
+ requestId: (0, node_crypto.randomUUID)(),
599
+ ...target === void 0 ? {} : { target: Object.freeze({ ...target }) },
600
+ durationSeconds: durationMs / 1e3,
601
+ createdAt,
602
+ confirmationExpiresAt: createdAt + COMPUTER_USE_CONFIRMATION_WINDOW_MS,
603
+ caller: Object.freeze({ ...caller })
604
+ });
605
+ this.phase = "awaiting_confirmation";
606
+ this.failure = void 0;
607
+ this.artifact = void 0;
608
+ this.changed();
609
+ return Response.json(this.state(), { status: 202 });
610
+ }
611
+ rejectPending(message) {
612
+ const pending = this.pending;
613
+ if (pending === void 0) return;
614
+ this.pending = void 0;
615
+ pending.dispose();
616
+ pending.reject(new Error(message));
617
+ }
618
+ stopAfterUncertainRequest(message) {
619
+ if (this.phase === "active") {
620
+ this.phase = "stopping";
621
+ this.changed();
622
+ }
623
+ this.rejectPending(message);
624
+ }
625
+ async enqueue(operation, payload, signal) {
626
+ if (this.phase !== "active" || this.grantId === void 0) return jsonError("Computer use is not active.", 409);
627
+ if (this.pending !== void 0) return jsonError("Another computer-use request is live.", 409);
628
+ if (signal?.aborted === true) return jsonError("The computer-use request was cancelled.", 499);
629
+ const sequence = operation === "act" ? ++this.actionSequence : void 0;
630
+ const request = {
631
+ id: (0, node_crypto.randomUUID)(),
632
+ operation,
633
+ grantId: this.grantId,
634
+ ...sequence === void 0 ? {} : { sequence },
635
+ ...payload === void 0 ? {} : { payload }
636
+ };
637
+ const completion = new Promise((resolve, reject) => {
638
+ const onAbort = () => this.stopAfterUncertainRequest("The computer-use request was cancelled.");
639
+ const timer = setTimeout(() => this.stopAfterUncertainRequest("The computer-use request timed out."), this.requestTimeoutMs);
640
+ timer.unref?.();
641
+ signal?.addEventListener("abort", onAbort, { once: true });
642
+ this.pending = {
643
+ request,
644
+ resolve,
645
+ reject,
646
+ dispose: () => {
647
+ clearTimeout(timer);
648
+ signal?.removeEventListener("abort", onAbort);
649
+ }
650
+ };
651
+ });
652
+ this.changed();
653
+ try {
654
+ return Response.json(await completion);
655
+ } catch (error) {
656
+ return jsonError(error instanceof Error ? error.message : String(error), 502);
657
+ }
658
+ }
659
+ async fetch(request) {
660
+ if (this.closed) return jsonError("Computer-use broker is closed.", 503);
661
+ const url = new URL(request.url);
662
+ const path = url.pathname;
663
+ if (request.method === "GET" && path === routes.artifact.path) {
664
+ if (!(this.desktop?.authorizeRecording?.(request.headers) ?? this.desktop?.authorize(request.headers)) || !this.desktop?.fetchRecording) return jsonError("Not found.", 404);
665
+ const artifactId = url.searchParams.get("artifactId") ?? "";
666
+ const offsetText = url.searchParams.get("offset") ?? "";
667
+ const offset = Number(offsetText);
668
+ if (!/^[0-9]+$/u.test(offsetText) || !Number.isSafeInteger(offset) || offset < 0 || offset > 134217728) return jsonError("Invalid recording offset.", 400);
669
+ return this.desktop.fetchRecording(artifactId, `bytes=${offset}-${offset + 1048576 - 1}`);
670
+ }
671
+ if (path === routes.activate.path && request.method === "GET") {
672
+ if (!this.desktop?.authorizePending?.(request.headers) && !(this.desktop?.authorizeRecording?.(request.headers) ?? this.desktop?.authorize(request.headers))) return jsonError("Not found.", 404);
673
+ return Response.json(this.state());
674
+ }
675
+ if (path === routes.activate.path && request.method === "DELETE") {
676
+ if (!this.desktop?.authorizePending?.(request.headers)) return jsonError("Not found.", 404);
677
+ if (this.phase !== "awaiting_confirmation" && this.phase !== "activating") return jsonError("No activation is pending.", 409);
678
+ this.phase = "stopping";
679
+ this.rejectPending("The activation was cancelled.");
680
+ this.changed();
681
+ return Response.json(this.state(), { status: 202 });
682
+ }
683
+ if (request.method === "POST" && path === routes.activate.path) return this.requestActivation(request);
684
+ const agent = path.startsWith("/agent/");
685
+ const hub = path.startsWith("/hub/");
686
+ if (agent && !this.authorized(request, this.internalToken) || hub && !this.authorized(request, this.hubToken)) return jsonError("Not found.", 404);
687
+ if (request.method === "GET" && (path === routes.agentState.path || path === routes.hubState.path)) return Response.json(this.state());
688
+ if (request.method === "POST" && path === routes.agentObserve.path) return this.enqueue("observe", void 0, request.signal);
689
+ if (request.method === "POST" && path === routes.agentAction.path) {
690
+ const action = await body(request);
691
+ if (!semanticAction(action)) return jsonError("A valid semantic action is required.", 400);
692
+ return this.enqueue("act", action, request.signal);
693
+ }
694
+ if (request.method === "POST" && path === routes.agentStop.path) {
695
+ if (this.phase !== "active") return jsonError("Computer use is not active.", 409);
696
+ this.phase = "stopping";
697
+ this.rejectPending("The computer-use request was stopped.");
698
+ this.changed();
699
+ return Response.json(this.state(), { status: 202 });
700
+ }
701
+ if (request.method === "GET" && path === routes.hubActivation.path) {
702
+ if (this.activation === void 0 || this.phase !== "awaiting_confirmation") return Response.json(null);
703
+ this.phase = "activating";
704
+ this.changed();
705
+ return Response.json(this.activation);
706
+ }
707
+ if (request.method === "GET" && path === routes.hubAuthorization.path) return Response.json(this.grantId === void 0 ? null : {
708
+ grantId: this.grantId,
709
+ expiresAt: this.expiresAt
710
+ });
711
+ if (request.method === "GET" && path === routes.hubNext.path) return Response.json(this.pending?.request ?? null);
712
+ if (request.method === "POST" && path === routes.hubComplete.path) {
713
+ const input = await body(request);
714
+ const id = typeof input.id === "string" ? input.id : void 0;
715
+ if (this.pending === void 0 || this.pending.request.id !== id) return jsonError("The request is stale.", 409);
716
+ const pending = this.pending;
717
+ this.pending = void 0;
718
+ pending.dispose();
719
+ if (typeof input.error === "string") {
720
+ this.phase = "stopping";
721
+ pending.reject(new Error(input.error));
722
+ } else pending.resolve(input.result);
723
+ this.changed();
724
+ return Response.json(this.state());
725
+ }
726
+ if (request.method === "POST" && path === routes.hubStop.path) {
727
+ const input = await body(request);
728
+ if (this.phase === "activating") {
729
+ if (typeof input.error === "string") {
730
+ this.phase = "failed";
731
+ this.failure = {
732
+ code: "desktop_unavailable",
733
+ message: input.error.slice(0, 512)
734
+ };
735
+ this.activation = void 0;
736
+ } else {
737
+ const host = record(input.host);
738
+ if (typeof host?.grantId !== "string" || !Number.isFinite(host.expiresAt) || host.expiresAt <= Date.now()) return jsonError("Desktop did not issue a complete grant.", 502);
739
+ const selectedTarget = record(host.target);
740
+ if (this.activation !== void 0 && selectedTarget !== void 0) this.activation = Object.freeze({
741
+ ...this.activation,
742
+ target: Object.freeze({ ...selectedTarget })
743
+ });
744
+ this.grantId = host.grantId;
745
+ this.expiresAt = host.expiresAt;
746
+ this.actionSequence = 0;
747
+ this.phase = "active";
748
+ clearTimeout(this.expiryTimer);
749
+ this.expiryTimer = setTimeout(() => {
750
+ if (this.closed || this.phase !== "active") return;
751
+ this.phase = "stopping";
752
+ this.rejectPending("The computer-use grant expired.");
753
+ this.changed();
754
+ }, Math.max(0, this.expiresAt - Date.now()));
755
+ this.expiryTimer.unref?.();
756
+ }
757
+ } else {
758
+ clearTimeout(this.expiryTimer);
759
+ this.rejectPending("The computer-use session stopped.");
760
+ this.phase = "inactive";
761
+ this.grantId = void 0;
762
+ this.expiresAt = void 0;
763
+ this.activation = void 0;
764
+ this.artifact = artifactView(input.artifact) ?? this.artifact;
765
+ }
766
+ this.changed();
767
+ return Response.json(this.state());
768
+ }
769
+ return jsonError("Not found.", 404);
770
+ }
771
+ close() {
772
+ if (this.closed) return;
773
+ this.closed = true;
774
+ clearTimeout(this.expiryTimer);
775
+ this.unsubscribeDesktop?.();
776
+ this.listeners.clear();
777
+ this.rejectPending("Computer-use broker closed.");
778
+ this.grantId = void 0;
779
+ this.expiresAt = void 0;
780
+ }
781
+ };
782
+ function createComputerUseApi(options) {
783
+ return new ComputerUseRequestBroker(options);
784
+ }
785
+ //#endregion
786
+ //#region src/services/computerScriptRunner/index.ts
787
+ const DEFAULT_TIMEOUT_MS = 3e4;
788
+ const DEFAULT_MAX_OUTPUT_BYTES = 262144;
789
+ const MAX_IMAGE_BYTES = 6291456;
790
+ const MAX_PENDING_OPERATIONS = 64;
791
+ var ComputerScriptExecutionError = class extends Error {
792
+ completedActions;
793
+ outcomeUncertain;
794
+ constructor(message, completedActions, outcomeUncertain) {
795
+ super(message);
796
+ this.completedActions = completedActions;
797
+ this.outcomeUncertain = outcomeUncertain;
798
+ this.name = "ComputerScriptExecutionError";
799
+ }
800
+ };
801
+ var ComputerScriptRunner = class {
802
+ client;
803
+ allowedScriptPaths;
804
+ scriptRoot;
805
+ timeoutMs;
806
+ maxOutputBytes;
807
+ constructor(options) {
808
+ this.client = options.client;
809
+ this.allowedScriptPaths = options.allowedScriptPaths;
810
+ this.scriptRoot = options.scriptRoot;
811
+ this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
812
+ this.maxOutputBytes = options.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES;
813
+ }
814
+ async execute(scriptPath, input, signal, options = {}, cwd) {
815
+ signal?.throwIfAborted();
816
+ const resolvedPath = await (0, node_fs_promises.realpath)(node_path.default.resolve(this.scriptRoot ?? cwd ?? process.cwd(), scriptPath));
817
+ const allowedPaths = await Promise.all(this.allowedScriptPaths.map(async (candidate) => (0, node_fs_promises.realpath)(candidate).catch(() => "")));
818
+ const trusted = options.trusted === true;
819
+ if ((trusted || this.scriptRoot === void 0) && !allowedPaths.includes(resolvedPath)) throw new Error("Computer script path is not explicitly allowed.");
820
+ if (!/\.(ts|js|mjs)$/u.test(resolvedPath)) throw new Error("Computer scripts must be JavaScript or erasable TypeScript files.");
821
+ const root = await (0, node_fs_promises.realpath)(this.scriptRoot ?? node_path.default.dirname(resolvedPath));
822
+ const relative = node_path.default.relative(root, resolvedPath);
823
+ if (!trusted && (relative === ".." || relative.startsWith(`..${node_path.default.sep}`) || node_path.default.isAbsolute(relative))) throw new Error("Computer script escapes the admitted script root.");
824
+ const serializedInput = JSON.stringify(input);
825
+ if (serializedInput === void 0) throw new Error("Computer script input must be JSON serializable.");
826
+ if (Buffer.byteLength(serializedInput) > this.maxOutputBytes) throw new Error("Computer script input exceeds the size limit.");
827
+ const quickjsPath = trusted ? void 0 : (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href).resolve("quickjs-emscripten");
828
+ signal?.throwIfAborted();
829
+ const started = performance.now();
830
+ return new Promise((resolve, reject) => {
831
+ const child = (0, node_child_process.spawn)(process.execPath, [
832
+ "--input-type=module",
833
+ "--eval",
834
+ COMPUTER_SCRIPT_WORKER_SOURCE
835
+ ], {
836
+ stdio: [
837
+ "ignore",
838
+ "pipe",
839
+ "pipe",
840
+ "ipc"
841
+ ],
842
+ env: trusted ? process.env : { ELECTRON_RUN_AS_NODE: "1" }
843
+ });
844
+ const controller = new AbortController();
845
+ const logs = [];
846
+ let outputBytes = 0;
847
+ let completedActions = 0;
848
+ let observations = 0;
849
+ let actionInFlight = false;
850
+ let settled = false;
851
+ let completing = false;
852
+ let outstanding = 0;
853
+ let operation = Promise.resolve();
854
+ const finish = (error, value) => {
855
+ if (settled) return;
856
+ settled = true;
857
+ clearTimeout(timeout);
858
+ signal?.removeEventListener("abort", onAbort);
859
+ controller.abort();
860
+ child.kill("SIGTERM");
861
+ setTimeout(() => child.kill("SIGKILL"), 250).unref();
862
+ if (error) reject(new ComputerScriptExecutionError(error.message, completedActions, actionInFlight));
863
+ else resolve(value);
864
+ };
865
+ const addOutput = (value) => {
866
+ outputBytes += Buffer.byteLength(value);
867
+ if (outputBytes <= this.maxOutputBytes) return true;
868
+ finish(/* @__PURE__ */ new Error("Computer script output exceeded the size limit."));
869
+ return false;
870
+ };
871
+ const send = (value) => {
872
+ if (settled || !child.connected) return;
873
+ child.send(value, (error) => {
874
+ if (error && !settled) finish(error);
875
+ });
876
+ };
877
+ const onAbort = () => finish(/* @__PURE__ */ new Error("Computer script execution was cancelled."));
878
+ const timeout = setTimeout(() => finish(/* @__PURE__ */ new Error("Computer script execution timed out.")), this.timeoutMs);
879
+ timeout.unref();
880
+ signal?.addEventListener("abort", onAbort, { once: true });
881
+ if (signal?.aborted) return onAbort();
882
+ child.stdout?.on("data", (chunk) => addOutput(chunk.toString("utf8")));
883
+ child.stderr?.on("data", (chunk) => addOutput(chunk.toString("utf8")));
884
+ child.on("error", (error) => finish(error));
885
+ child.on("exit", (code, exitSignal) => {
886
+ if (!settled) finish(/* @__PURE__ */ new Error(`Computer script worker exited before completion (${exitSignal ?? code ?? "unknown"}).`));
887
+ });
888
+ const observe = async (options) => {
889
+ const includeScreenshot = options.includeScreenshot === true;
890
+ const value = await this.client.observe(controller.signal, {
891
+ ...options,
892
+ includeScreenshot
893
+ });
894
+ observations += 1;
895
+ const { screenshot, ...semantic } = value;
896
+ if (Buffer.byteLength(JSON.stringify(semantic)) > this.maxOutputBytes) throw new Error("Computer observation exceeds the size limit.");
897
+ if (includeScreenshot && screenshot) {
898
+ if (screenshot.mimeType !== "image/png" || screenshot.data.length > Math.ceil(MAX_IMAGE_BYTES / 3) * 4) throw new Error("Computer screenshot exceeds the image limit.");
899
+ return {
900
+ ...semantic,
901
+ screenshot
902
+ };
903
+ }
904
+ return semantic;
905
+ };
906
+ child.on("message", (raw) => {
907
+ if (settled) return;
908
+ if (!raw || typeof raw !== "object" || Buffer.byteLength(JSON.stringify(raw)) > this.maxOutputBytes + 4096) {
909
+ finish(/* @__PURE__ */ new Error("Computer worker message exceeds the size limit."));
910
+ return;
911
+ }
912
+ if (raw.type === "log" && typeof raw.message === "string") {
913
+ const line = `[${String(raw.level)}] ${raw.message}`;
914
+ if (addOutput(line)) logs.push(line);
915
+ return;
916
+ }
917
+ if (raw.type === "program") {
918
+ if (completing || typeof raw.id !== "string" || raw.id.length > 128 || raw.operation !== "observe" && raw.operation !== "act" || outstanding >= MAX_PENDING_OPERATIONS) {
919
+ finish(/* @__PURE__ */ new Error("Invalid or excessive computer program operations."));
920
+ return;
921
+ }
922
+ outstanding += 1;
923
+ operation = operation.then(async () => {
924
+ if (settled || controller.signal.aborted) return;
925
+ try {
926
+ let value;
927
+ if (raw.operation === "observe") value = await observe(observationOptions(raw.payload));
928
+ else {
929
+ actionInFlight = true;
930
+ value = await this.client.act(raw.payload, controller.signal);
931
+ completedActions += 1;
932
+ actionInFlight = false;
933
+ }
934
+ send({
935
+ type: "response",
936
+ id: raw.id,
937
+ value
938
+ });
939
+ } catch (error) {
940
+ if (actionInFlight) finish(error instanceof Error ? error : new Error(String(error)));
941
+ else send({
942
+ type: "response",
943
+ id: raw.id,
944
+ error: error instanceof Error ? error.message : String(error)
945
+ });
946
+ } finally {
947
+ outstanding -= 1;
948
+ }
949
+ }).catch((error) => finish(error instanceof Error ? error : new Error(String(error))));
950
+ return;
951
+ }
952
+ if (raw.type === "failed" && typeof raw.error === "string") {
953
+ finish(new Error(raw.error));
954
+ return;
955
+ }
956
+ if (raw.type === "complete") {
957
+ if (completing) {
958
+ finish(/* @__PURE__ */ new Error("Computer worker completed twice."));
959
+ return;
960
+ }
961
+ completing = true;
962
+ operation = operation.then(async () => {
963
+ if (settled) return;
964
+ const resultJson = raw.resultJson;
965
+ if (resultJson !== void 0 && typeof resultJson !== "string") throw new Error("Computer script returned an invalid result.");
966
+ if (typeof resultJson === "string" && !addOutput(resultJson)) return;
967
+ const observation = await observe({ includeScreenshot: options.includeScreenshot === true });
968
+ if (settled || !addOutput(JSON.stringify({
969
+ ...observation,
970
+ screenshot: void 0
971
+ }))) return;
972
+ finish(void 0, {
973
+ ...typeof resultJson === "string" ? { result: JSON.parse(resultJson) } : {},
974
+ observation,
975
+ logs,
976
+ metrics: {
977
+ actions: completedActions,
978
+ observations,
979
+ durationMs: Math.round(performance.now() - started),
980
+ outputBytes
981
+ }
982
+ });
983
+ }).catch((error) => finish(error instanceof Error ? error : new Error(String(error))));
984
+ }
985
+ });
986
+ send({
987
+ type: "start",
988
+ scriptPath: resolvedPath,
989
+ scriptRoot: root,
990
+ input: JSON.parse(serializedInput),
991
+ trusted,
992
+ quickjsPath,
993
+ timeoutMs: this.timeoutMs,
994
+ maxOutputBytes: this.maxOutputBytes
995
+ });
996
+ });
997
+ }
998
+ };
999
+ //#endregion
1000
+ //#region src/services/extensionService/index.ts
1001
+ var DefaultComputerUseExtensionService = class {
1002
+ client;
1003
+ constructor(client) {
1004
+ this.client = client;
1005
+ }
1006
+ async execute() {
1007
+ if (this.client === void 0) return {
1008
+ message: "Computer use requires a Po Desktop session.",
1009
+ level: "error"
1010
+ };
1011
+ return {
1012
+ message: `Computer use is ${(await this.client.state()).phase.replaceAll("_", " ")}.`,
1013
+ level: "info"
1014
+ };
1015
+ }
1016
+ };
1017
+ //#endregion
1018
+ Object.defineProperty(exports, "API_BASE_PATH", {
1019
+ enumerable: true,
1020
+ get: function() {
1021
+ return API_BASE_PATH;
1022
+ }
1023
+ });
1024
+ Object.defineProperty(exports, "COMMAND_DESCRIPTION", {
1025
+ enumerable: true,
1026
+ get: function() {
1027
+ return COMMAND_DESCRIPTION;
1028
+ }
1029
+ });
1030
+ Object.defineProperty(exports, "COMMAND_NAME", {
1031
+ enumerable: true,
1032
+ get: function() {
1033
+ return COMMAND_NAME;
1034
+ }
1035
+ });
1036
+ Object.defineProperty(exports, "COMPUTER_USE_ARTIFACTS_SERVICE", {
1037
+ enumerable: true,
1038
+ get: function() {
1039
+ return COMPUTER_USE_ARTIFACTS_SERVICE;
1040
+ }
1041
+ });
1042
+ Object.defineProperty(exports, "COMPUTER_USE_ARTIFACT_DIRECTORY", {
1043
+ enumerable: true,
1044
+ get: function() {
1045
+ return COMPUTER_USE_ARTIFACT_DIRECTORY;
1046
+ }
1047
+ });
1048
+ Object.defineProperty(exports, "COMPUTER_USE_CODEMODE_GUIDANCE", {
1049
+ enumerable: true,
1050
+ get: function() {
1051
+ return COMPUTER_USE_CODEMODE_GUIDANCE;
1052
+ }
1053
+ });
1054
+ Object.defineProperty(exports, "COMPUTER_USE_GUIDANCE", {
1055
+ enumerable: true,
1056
+ get: function() {
1057
+ return COMPUTER_USE_GUIDANCE;
1058
+ }
1059
+ });
1060
+ Object.defineProperty(exports, "COMPUTER_USE_MODE_ID", {
1061
+ enumerable: true,
1062
+ get: function() {
1063
+ return COMPUTER_USE_MODE_ID;
1064
+ }
1065
+ });
1066
+ Object.defineProperty(exports, "COMPUTER_USE_RECORDING_CHUNK_BYTES", {
1067
+ enumerable: true,
1068
+ get: function() {
1069
+ return COMPUTER_USE_RECORDING_CHUNK_BYTES;
1070
+ }
1071
+ });
1072
+ Object.defineProperty(exports, "COMPUTER_USE_RECORDING_MAX_BYTES", {
1073
+ enumerable: true,
1074
+ get: function() {
1075
+ return COMPUTER_USE_RECORDING_MAX_BYTES;
1076
+ }
1077
+ });
1078
+ Object.defineProperty(exports, "COMPUTER_USE_ROUTES", {
1079
+ enumerable: true,
1080
+ get: function() {
1081
+ return COMPUTER_USE_ROUTES;
1082
+ }
1083
+ });
1084
+ Object.defineProperty(exports, "COMPUTER_USE_STATUS_KEY", {
1085
+ enumerable: true,
1086
+ get: function() {
1087
+ return COMPUTER_USE_STATUS_KEY;
1088
+ }
1089
+ });
1090
+ Object.defineProperty(exports, "COMPUTER_USE_TOOL_NAMES", {
1091
+ enumerable: true,
1092
+ get: function() {
1093
+ return COMPUTER_USE_TOOL_NAMES;
1094
+ }
1095
+ });
1096
+ Object.defineProperty(exports, "ComputerScriptExecutionError", {
1097
+ enumerable: true,
1098
+ get: function() {
1099
+ return ComputerScriptExecutionError;
1100
+ }
1101
+ });
1102
+ Object.defineProperty(exports, "ComputerScriptRunner", {
1103
+ enumerable: true,
1104
+ get: function() {
1105
+ return ComputerScriptRunner;
1106
+ }
1107
+ });
1108
+ Object.defineProperty(exports, "DefaultComputerUseExtensionService", {
1109
+ enumerable: true,
1110
+ get: function() {
1111
+ return DefaultComputerUseExtensionService;
1112
+ }
1113
+ });
1114
+ Object.defineProperty(exports, "__toESM", {
1115
+ enumerable: true,
1116
+ get: function() {
1117
+ return __toESM;
1118
+ }
1119
+ });
1120
+ Object.defineProperty(exports, "computerUseChannelType", {
1121
+ enumerable: true,
1122
+ get: function() {
1123
+ return computerUseChannelType;
1124
+ }
1125
+ });
1126
+ Object.defineProperty(exports, "createComputerUseApi", {
1127
+ enumerable: true,
1128
+ get: function() {
1129
+ return createComputerUseApi;
1130
+ }
1131
+ });
1132
+ Object.defineProperty(exports, "isDesktopPermission", {
1133
+ enumerable: true,
1134
+ get: function() {
1135
+ return isDesktopPermission;
1136
+ }
1137
+ });
1138
+ Object.defineProperty(exports, "routes", {
1139
+ enumerable: true,
1140
+ get: function() {
1141
+ return routes;
1142
+ }
1143
+ });
1144
+
1145
+ //# sourceMappingURL=extensionService-CC9-p-Av.cjs.map