@sideboard-ai/core 0.1.351 → 0.1.352
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/dist/{abletime-TX7BTTR2.js → abletime-5LEOMLQE.js} +4 -4
- package/dist/{abletime-URSRZW7P.js → abletime-VUPUERE4.js} +4 -4
- package/dist/{abletime-oauth-QS3WPSCC.js → abletime-oauth-65LHLQ7P.js} +3 -3
- package/dist/{abletime-oauth-SL3NMNEC.js → abletime-oauth-JAINJBNY.js} +3 -3
- package/dist/{abletime-rest-JZU6JJCV.js → abletime-rest-4TCWPN7E.js} +3 -3
- package/dist/{abletime-rest-GGQLUO55.js → abletime-rest-HBIK234Y.js} +3 -3
- package/dist/agents/claude-runner.cjs +46 -19
- package/dist/agents/claude-runner.js +16 -1
- package/dist/agents/cursor-runner.cjs +50 -12
- package/dist/agents/cursor-runner.js +2 -2
- package/dist/{agents-INTH7J3F.js → agents-4DQDWMSX.js} +9 -9
- package/dist/{agents-D5CL4CR4.js → agents-IV454BNN.js} +8 -8
- package/dist/{app-settings-IA7ZZKWQ.js → app-settings-GM4MJD2E.js} +3 -1
- package/dist/{app-settings-XILTSD6L.js → app-settings-X3UFWRAF.js} +3 -1
- package/dist/{chunk-BZK62VPT.js → chunk-2S7EAUDI.js} +2 -2
- package/dist/{chunk-CCWQ65VD.js → chunk-2SFKLWU5.js} +2 -2
- package/dist/{chunk-WB3G2LQO.js → chunk-BCNPZ7H2.js} +1 -1
- package/dist/{chunk-BDWVBEKN.js → chunk-CQDJ4RX4.js} +149 -127
- package/dist/{chunk-SMSD6U3N.js → chunk-GA5MLYVG.js} +1 -1
- package/dist/{chunk-HISSQICH.js → chunk-HBRP2SHA.js} +3 -3
- package/dist/{chunk-DL4OHDBV.js → chunk-I6BKWSCT.js} +3 -3
- package/dist/{chunk-WJURGCBR.js → chunk-KSBJOWVO.js} +1 -1
- package/dist/{chunk-J4EA5SHF.js → chunk-LZ3TAKNJ.js} +3 -3
- package/dist/{chunk-F4RFFE2H.js → chunk-M426EW7O.js} +3 -3
- package/dist/{chunk-C3E2DGDF.js → chunk-MBQU6RE2.js} +6 -6
- package/dist/{chunk-TCEUNSLX.js → chunk-NRGT7RMO.js} +1 -1
- package/dist/{chunk-M45WGODR.js → chunk-OCCUD5CK.js} +2 -2
- package/dist/{chunk-UXAKH4AW.js → chunk-PR5TOSRD.js} +324 -70
- package/dist/{chunk-SUZOPJZC.js → chunk-PS6TD5MQ.js} +260 -2
- package/dist/{chunk-YE7Z5WH3.js → chunk-QKNOKO2P.js} +1 -1
- package/dist/{chunk-VL6F2KRE.js → chunk-RMJXFABA.js} +8 -6
- package/dist/{chunk-FQ3JYUKI.js → chunk-SBUR2WCP.js} +2 -2
- package/dist/{chunk-AEEOYLVK.js → chunk-SWU5C3HQ.js} +6 -6
- package/dist/{chunk-UFUAIVNV.js → chunk-TB7SYXXS.js} +8 -6
- package/dist/{chunk-7ZD4OK6G.js → chunk-TDWE7INS.js} +1 -1
- package/dist/{chunk-WFX4ZVSZ.js → chunk-TRUNDXCE.js} +1 -1
- package/dist/{chunk-AAKQU4UZ.js → chunk-UDTFOKVX.js} +28 -10
- package/dist/{chunk-PXSWVZIL.js → chunk-UPJB6TFI.js} +2 -2
- package/dist/{chunk-7WPQAVS5.js → chunk-US2PGV3X.js} +146 -126
- package/dist/{chunk-YVN7L4KG.js → chunk-V2G6AGWM.js} +6 -1
- package/dist/{chunk-37ZBEBP6.js → chunk-VZAICZHU.js} +3 -3
- package/dist/{chunk-FCKTBE26.js → chunk-WJQFWDGH.js} +1 -1
- package/dist/{chunk-SZY23KGS.js → chunk-WTT525MC.js} +3 -3
- package/dist/{chunk-BF6INES4.js → chunk-X52SO3DM.js} +1 -1
- package/dist/{chunk-B4EFQTMP.js → chunk-XB6NCBZK.js} +5 -5
- package/dist/{chunk-5TCMXEYL.js → chunk-YGXUIBIT.js} +3 -3
- package/dist/{chunk-VHQ6OG3U.js → chunk-ZHYFRRPN.js} +2 -2
- package/dist/{chunk-5WF54R3B.js → chunk-ZLPP66IP.js} +5 -5
- package/dist/{conductor-FWYWIHEW.js → conductor-2UOW2XBE.js} +6 -6
- package/dist/{conductor-W2X7QUKZ.js → conductor-6NYG2SZA.js} +6 -6
- package/dist/{coordinator-prompt-J57Q4Z4W.js → coordinator-prompt-K3WT5UVS.js} +4 -4
- package/dist/{coordinator-prompt-KIHNLENN.js → coordinator-prompt-ZP6AEETR.js} +4 -4
- package/dist/{global-workspace-WXDWFZAN.js → global-workspace-EFPSYP4N.js} +4 -4
- package/dist/{global-workspace-CGB5CY4U.js → global-workspace-EPVNFQVC.js} +4 -4
- package/dist/index.cjs +1192 -865
- package/dist/index.d.cts +8 -10
- package/dist/index.d.ts +8 -10
- package/dist/index.js +361 -315
- package/dist/{linear-WG23LBCX.js → linear-4ACCQCWM.js} +2 -2
- package/dist/{linear-E3BX5PX5.js → linear-Q2E6LKJW.js} +2 -2
- package/dist/{linear-list-VU47BNUV.js → linear-list-5A3BAWRZ.js} +1 -1
- package/dist/{linear-list-OINZWVV5.js → linear-list-V3A57XBR.js} +1 -1
- package/dist/mcp/run-stdio.cjs +1116 -802
- package/dist/mcp/run-stdio.js +342 -308
- package/dist/{optional-cli-K6HX2X5O.js → optional-cli-CKQPLY4Q.js} +4 -4
- package/dist/{optional-cli-SA3EQYML.js → optional-cli-WE3ULLFV.js} +5 -5
- package/dist/{orchestrator-DMEE7CEW.js → orchestrator-5BCHUAFG.js} +11 -11
- package/dist/{orchestrator-MUD4FY7Q.js → orchestrator-EY6GCYQG.js} +12 -12
- package/dist/{thread-store-4YTOV2HL.js → thread-store-CDFHHRXB.js} +2 -2
- package/dist/{thread-store-LME2ICZP.js → thread-store-TDGZEGS6.js} +2 -2
- package/dist/{workspaces-ZCTF4ECL.js → workspaces-KL4SZMJE.js} +4 -4
- package/dist/{workspaces-7DPHDXNY.js → workspaces-SQRR67HD.js} +4 -4
- package/dist/{worktree-4ATMCYIE.js → worktree-7KG5N2XL.js} +3 -3
- package/dist/{worktree-DA6SKIU5.js → worktree-IDX7LMBC.js} +3 -3
- package/package.json +1 -1
|
@@ -129,6 +129,236 @@ function agentRuntimeLooksLive(meta = readAgentRuntimeMetadata()) {
|
|
|
129
129
|
return pidAlive(meta.pid);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
// src/computer-use/computer-use.ts
|
|
133
|
+
import { execFile } from "child_process";
|
|
134
|
+
import { mkdirSync, readFileSync as readFileSync2 } from "fs";
|
|
135
|
+
import { tmpdir } from "os";
|
|
136
|
+
import { isAbsolute, join as join2 } from "path";
|
|
137
|
+
import { promisify } from "util";
|
|
138
|
+
var execFileAsync = promisify(execFile);
|
|
139
|
+
var COMPUTER_USE_OFF = "Computer use is off. Turn it on in Settings \u2192 Advanced.";
|
|
140
|
+
var COMPUTER_USE_DESCRIPTION = "Drive this Mac to test an app you started. Off unless Settings \u2192 Advanced \u2192 Computer use is on. action is screenshot, click, type, key, or scroll. screenshot writes a PNG of the main display under the worktree .context/cli/ and returns that path plus point width, height, and scale. Read the image. x and y are screen points from the top-left of that image, not PNG pixels: divide a pixel by scale. click and scroll use those points. scroll posts a wheel event at the point (positive dx is right, positive dy is down). type sends text. key is one key (return, tab, escape, arrows, delete, or one character) with optional modifiers command, shift, option, control. Use it to check behavior and visual design (hierarchy, alignment, spacing, type, contrast, fit with the surrounding surface). preview=window means the Electron window, not a browser tab. Sideboard needs Accessibility and Screen Recording permission. Do not drive an app you did not start for this test.";
|
|
141
|
+
var KEY_CODES = {
|
|
142
|
+
return: 36,
|
|
143
|
+
enter: 36,
|
|
144
|
+
tab: 48,
|
|
145
|
+
escape: 53,
|
|
146
|
+
esc: 53,
|
|
147
|
+
delete: 51,
|
|
148
|
+
backspace: 51,
|
|
149
|
+
forwarddelete: 117,
|
|
150
|
+
left: 123,
|
|
151
|
+
right: 124,
|
|
152
|
+
down: 125,
|
|
153
|
+
up: 126
|
|
154
|
+
};
|
|
155
|
+
var MODIFIERS = /* @__PURE__ */ new Set(["command", "cmd", "shift", "option", "alt", "control", "ctrl"]);
|
|
156
|
+
var PNG_SIG = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);
|
|
157
|
+
function appleScriptString(text) {
|
|
158
|
+
return `"${text.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
159
|
+
}
|
|
160
|
+
function typeScripts(text) {
|
|
161
|
+
const parts = text.split(/\r\n|\n|\r/);
|
|
162
|
+
const scripts = [];
|
|
163
|
+
for (let i = 0; i < parts.length; i += 1) {
|
|
164
|
+
if (parts[i]) {
|
|
165
|
+
scripts.push(`tell application "System Events" to keystroke ${appleScriptString(parts[i])}`);
|
|
166
|
+
}
|
|
167
|
+
if (i < parts.length - 1) {
|
|
168
|
+
scripts.push('tell application "System Events" to key code 36');
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return scripts;
|
|
172
|
+
}
|
|
173
|
+
function modifierClause(modifiers) {
|
|
174
|
+
const downs = modifiers.map((name) => {
|
|
175
|
+
if (name === "cmd" || name === "command") return "command down";
|
|
176
|
+
if (name === "alt" || name === "option") return "option down";
|
|
177
|
+
if (name === "ctrl" || name === "control") return "control down";
|
|
178
|
+
return "shift down";
|
|
179
|
+
});
|
|
180
|
+
if (!downs.length) return "";
|
|
181
|
+
return ` using {${downs.join(", ")}}`;
|
|
182
|
+
}
|
|
183
|
+
function pngPointSize(bytes) {
|
|
184
|
+
if (bytes.length < 24 || !bytes.subarray(0, 8).equals(PNG_SIG)) {
|
|
185
|
+
throw new Error("screenshot is not a PNG");
|
|
186
|
+
}
|
|
187
|
+
let pixelWidth = 0;
|
|
188
|
+
let pixelHeight = 0;
|
|
189
|
+
let scale = 1;
|
|
190
|
+
let offset = 8;
|
|
191
|
+
while (offset + 8 <= bytes.length) {
|
|
192
|
+
const length = bytes.readUInt32BE(offset);
|
|
193
|
+
const type = bytes.toString("ascii", offset + 4, offset + 8);
|
|
194
|
+
const data = offset + 8;
|
|
195
|
+
if (data + length > bytes.length) break;
|
|
196
|
+
if (type === "IHDR" && length >= 8) {
|
|
197
|
+
pixelWidth = bytes.readUInt32BE(data);
|
|
198
|
+
pixelHeight = bytes.readUInt32BE(data + 4);
|
|
199
|
+
} else if (type === "pHYs" && length >= 9 && bytes[data + 8] === 1) {
|
|
200
|
+
const ppm = bytes.readUInt32BE(data);
|
|
201
|
+
if (ppm > 0) scale = ppm * 0.0254 / 72;
|
|
202
|
+
} else if (type === "IEND") {
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
offset = data + length + 4;
|
|
206
|
+
}
|
|
207
|
+
if (pixelWidth <= 0 || pixelHeight <= 0) throw new Error("screenshot PNG has no size");
|
|
208
|
+
return { pixelWidth, pixelHeight, scale };
|
|
209
|
+
}
|
|
210
|
+
function pointGeometry(info) {
|
|
211
|
+
const raw = info.scale > 0 && Number.isFinite(info.scale) ? info.scale : 1;
|
|
212
|
+
const scale = Math.round(raw * 100) / 100;
|
|
213
|
+
return {
|
|
214
|
+
width: Math.round(info.pixelWidth / scale),
|
|
215
|
+
height: Math.round(info.pixelHeight / scale),
|
|
216
|
+
scale
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function scrollWheelSwift(x, y, dx, dy) {
|
|
220
|
+
for (const n of [x, y, dx, dy]) {
|
|
221
|
+
if (!Number.isInteger(n)) throw new Error("scroll coordinates must be integers");
|
|
222
|
+
}
|
|
223
|
+
const wheel1 = -dy;
|
|
224
|
+
const wheel2 = -dx;
|
|
225
|
+
return `import CoreGraphics
|
|
226
|
+
let src = CGEventSource(stateID: .hidSystemState)
|
|
227
|
+
let p = CGPoint(x: ${x}, y: ${y})
|
|
228
|
+
if let move = CGEvent(mouseEventSource: src, mouseType: .mouseMoved, mouseCursorPosition: p, mouseButton: .left) {
|
|
229
|
+
move.post(tap: .cghidEventTap)
|
|
230
|
+
}
|
|
231
|
+
if let ev = CGEvent(scrollWheelEvent2Source: src, units: .pixel, wheelCount: 2, wheel1: ${wheel1}, wheel2: ${wheel2}, wheel3: 0) {
|
|
232
|
+
ev.location = p
|
|
233
|
+
ev.post(tap: .cghidEventTap)
|
|
234
|
+
}
|
|
235
|
+
`;
|
|
236
|
+
}
|
|
237
|
+
function asRecord(value) {
|
|
238
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
239
|
+
return value;
|
|
240
|
+
}
|
|
241
|
+
function finite(value) {
|
|
242
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
243
|
+
}
|
|
244
|
+
function point(value) {
|
|
245
|
+
const n = Math.round(value);
|
|
246
|
+
if (n < -8e3 || n > 2e4) return null;
|
|
247
|
+
return n;
|
|
248
|
+
}
|
|
249
|
+
function scrollDelta(value) {
|
|
250
|
+
const n = Math.round(value);
|
|
251
|
+
if (n < -4e3 || n > 4e3) return null;
|
|
252
|
+
return n;
|
|
253
|
+
}
|
|
254
|
+
function screenshotFile(cwd, now) {
|
|
255
|
+
const root = isAbsolute(cwd) ? cwd : tmpdir();
|
|
256
|
+
const dir = join2(root, ".context", "cli");
|
|
257
|
+
mkdirSync(dir, { recursive: true });
|
|
258
|
+
return join2(dir, `computer-use-${now}.png`);
|
|
259
|
+
}
|
|
260
|
+
function screenshotMessage(width, height, scale) {
|
|
261
|
+
return `Screenshot saved (main display). Read that PNG. x and y are screen points from the top-left of this image, not PNG pixels. Divide a pixel by scale ${scale}. Point size is ${width}\xD7${height}. Judge behavior and visual design: hierarchy, alignment, spacing, type, contrast, and fit with the surrounding surface.`;
|
|
262
|
+
}
|
|
263
|
+
async function performComputerUse(opts) {
|
|
264
|
+
if (!opts.enabled) return { ok: false, error: COMPUTER_USE_OFF };
|
|
265
|
+
const rec = asRecord(opts.input);
|
|
266
|
+
const action = typeof rec.action === "string" ? rec.action : "";
|
|
267
|
+
try {
|
|
268
|
+
if (action === "screenshot") {
|
|
269
|
+
const file = screenshotFile(opts.cwd, opts.now ?? Date.now());
|
|
270
|
+
const captured = await opts.runner.screenshot(file);
|
|
271
|
+
const geo = pointGeometry(captured);
|
|
272
|
+
return {
|
|
273
|
+
ok: true,
|
|
274
|
+
action,
|
|
275
|
+
path: file,
|
|
276
|
+
width: geo.width,
|
|
277
|
+
height: geo.height,
|
|
278
|
+
scale: geo.scale,
|
|
279
|
+
message: screenshotMessage(geo.width, geo.height, geo.scale)
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
if (action === "click") {
|
|
283
|
+
const x = finite(rec.x);
|
|
284
|
+
const y = finite(rec.y);
|
|
285
|
+
if (x === null || y === null) return { ok: false, error: "click requires finite x and y" };
|
|
286
|
+
const px = point(x);
|
|
287
|
+
const py = point(y);
|
|
288
|
+
if (px === null || py === null) return { ok: false, error: "click point is out of range" };
|
|
289
|
+
await opts.runner.runAppleScript(
|
|
290
|
+
`tell application "System Events" to click at {${px}, ${py}}`
|
|
291
|
+
);
|
|
292
|
+
return { ok: true, action, message: `Clicked ${px}, ${py}.` };
|
|
293
|
+
}
|
|
294
|
+
if (action === "type") {
|
|
295
|
+
const text = typeof rec.text === "string" ? rec.text : "";
|
|
296
|
+
if (!text) return { ok: false, error: "type requires text" };
|
|
297
|
+
if (text.length > 2e3) return { ok: false, error: "type text is longer than 2000 characters" };
|
|
298
|
+
for (const script of typeScripts(text)) {
|
|
299
|
+
await opts.runner.runAppleScript(script);
|
|
300
|
+
}
|
|
301
|
+
return { ok: true, action, message: `Typed ${text.length} characters.` };
|
|
302
|
+
}
|
|
303
|
+
if (action === "key") {
|
|
304
|
+
const key = typeof rec.key === "string" ? rec.key.trim().toLowerCase() : "";
|
|
305
|
+
const modifiers = Array.isArray(rec.modifiers) ? rec.modifiers.filter((item) => typeof item === "string") : [];
|
|
306
|
+
if (!key) return { ok: false, error: "key requires key" };
|
|
307
|
+
if (modifiers.some((name) => !MODIFIERS.has(name.toLowerCase()))) {
|
|
308
|
+
return { ok: false, error: "key modifiers are command, shift, option, and control" };
|
|
309
|
+
}
|
|
310
|
+
const using = modifierClause(modifiers.map((name) => name.toLowerCase()));
|
|
311
|
+
const code = KEY_CODES[key];
|
|
312
|
+
const script = code !== void 0 ? `tell application "System Events" to key code ${code}${using}` : key.length === 1 ? `tell application "System Events" to keystroke ${appleScriptString(key)}${using}` : "";
|
|
313
|
+
if (!script) return { ok: false, error: `unsupported key ${key}` };
|
|
314
|
+
await opts.runner.runAppleScript(script);
|
|
315
|
+
return { ok: true, action, message: `Pressed ${key}.` };
|
|
316
|
+
}
|
|
317
|
+
if (action === "scroll") {
|
|
318
|
+
const x = finite(rec.x);
|
|
319
|
+
const y = finite(rec.y);
|
|
320
|
+
if (x === null || y === null) return { ok: false, error: "scroll requires finite x and y" };
|
|
321
|
+
const px = point(x);
|
|
322
|
+
const py = point(y);
|
|
323
|
+
if (px === null || py === null) return { ok: false, error: "scroll point is out of range" };
|
|
324
|
+
const dx = finite(rec.dx) ?? 0;
|
|
325
|
+
const dy = finite(rec.dy) ?? 0;
|
|
326
|
+
const sdx = scrollDelta(dx);
|
|
327
|
+
const sdy = scrollDelta(dy);
|
|
328
|
+
if (sdx === null || sdy === null) return { ok: false, error: "scroll delta is out of range" };
|
|
329
|
+
if (sdx === 0 && sdy === 0) return { ok: false, error: "scroll requires dx or dy" };
|
|
330
|
+
await opts.runner.scroll(px, py, sdx, sdy);
|
|
331
|
+
return {
|
|
332
|
+
ok: true,
|
|
333
|
+
action,
|
|
334
|
+
message: `Scrolled at ${px}, ${py} by ${sdx}, ${sdy}. Positive dx is right, positive dy is down.`
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
return { ok: false, error: "action must be screenshot, click, type, key, or scroll" };
|
|
338
|
+
} catch (err) {
|
|
339
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
340
|
+
return { ok: false, error: message };
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function formatComputerUseHint(enabled) {
|
|
344
|
+
if (!enabled) {
|
|
345
|
+
return "Computer use is off (Settings \u2192 Advanced). Say the visual pass was not seen.";
|
|
346
|
+
}
|
|
347
|
+
return "Computer use is on. Screenshot returns scale; x and y are screen points (divide a PNG pixel by scale). Scroll is a wheel event at that point.";
|
|
348
|
+
}
|
|
349
|
+
var macosComputerUseRunner = {
|
|
350
|
+
async screenshot(file) {
|
|
351
|
+
await execFileAsync("screencapture", ["-x", "-m", file]);
|
|
352
|
+
return pngPointSize(readFileSync2(file));
|
|
353
|
+
},
|
|
354
|
+
async runAppleScript(script) {
|
|
355
|
+
await execFileAsync("osascript", ["-e", script]);
|
|
356
|
+
},
|
|
357
|
+
async scroll(x, y, dx, dy) {
|
|
358
|
+
await execFileAsync("swift", ["-e", scrollWheelSwift(x, y, dx, dy)]);
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
|
|
132
362
|
// src/agent-rpc/client.ts
|
|
133
363
|
import { WebSocket } from "ws";
|
|
134
364
|
var AgentRpcClient = class {
|
|
@@ -272,12 +502,14 @@ var AgentRpcClient = class {
|
|
|
272
502
|
var PILOT_TOOL_NAMES = [
|
|
273
503
|
"present_artifact",
|
|
274
504
|
"wait_for_job",
|
|
275
|
-
"stop_job"
|
|
505
|
+
"stop_job",
|
|
506
|
+
"computer_use"
|
|
276
507
|
];
|
|
277
508
|
var PILOT_TOOL_DESCRIPTIONS = {
|
|
278
509
|
present_artifact: "Show a document or live log in Sideboard\u2019s side column. For html/svg/markdown/react, pass the FULL document and do not also fence that same body in chat. For type=log, pass only NEW lines (same artifact_id appends). Prefer type=log for long-running job output \u2014 do not resend HTML. type=react is a single default-export component (JSX/TSX); only react/react-dom imports.",
|
|
279
510
|
wait_for_job: "Wait until a detached long job (tests, pack, deploy, connector CLI) finishes. This call stays open for up to ~2 minutes. stillRunning true means the runtime hit the max hold; call wait_for_job again immediately. If the job is hanging, producing no useful output, or doing the wrong thing, call stop_job instead. Do not end the turn or tell the user you will let them know later.",
|
|
280
|
-
stop_job: "Stop a detached job you started with detached-job.cjs when it is hanging, producing no useful output, buffering forever, or doing the wrong thing (wrong project, infinite watch, huge dump). Do not stop a pack/test/deploy that is clearly making progress."
|
|
511
|
+
stop_job: "Stop a detached job you started with detached-job.cjs when it is hanging, producing no useful output, buffering forever, or doing the wrong thing (wrong project, infinite watch, huge dump). Do not stop a pack/test/deploy that is clearly making progress.",
|
|
512
|
+
computer_use: COMPUTER_USE_DESCRIPTION
|
|
281
513
|
};
|
|
282
514
|
var WAIT_FOR_TURN_DESCRIPTION = "Wait until the chat finishes its current/queued turn, or return early with a live progress snapshot. This call stays open for up to ~2 minutes. taskState is the A2A-style lifecycle: submitted (queued, not started), working, input-required (ask_user), completed, failed, canceled. stillRunning is true only for submitted/working. If stillRunning, text and usage are empty (they would be the previous turn) \u2014 read progress and call wait_for_turn again. Do not send_to_chat a check-in (that steers / interrupts). On failed, lastError/text is the failure. On canceled, the child did not finish \u2014 resume with send_to_chat or tell the user. On input-required, wait for the user in that chat. When finished, text is this turn\u2019s assistant reply and usage is that turn\u2019s tokens + costUsd (this turn, not the Claude session total; sessionCostUsd is the provider session total when present). lastActivityAt is the latest transcript/live stamp \u2014 present after the turn completes, not only while it is running.";
|
|
283
515
|
var WAIT_FOR_TURN_SCHEMA = {
|
|
@@ -334,6 +566,27 @@ var PILOT_TOOL_SCHEMAS = {
|
|
|
334
566
|
},
|
|
335
567
|
required: ["id"]
|
|
336
568
|
},
|
|
569
|
+
computer_use: {
|
|
570
|
+
type: "object",
|
|
571
|
+
properties: {
|
|
572
|
+
action: {
|
|
573
|
+
type: "string",
|
|
574
|
+
enum: ["screenshot", "click", "type", "key", "scroll"]
|
|
575
|
+
},
|
|
576
|
+
x: { type: "number", description: "Screen x in points, not PNG pixels" },
|
|
577
|
+
y: { type: "number", description: "Screen y in points, not PNG pixels" },
|
|
578
|
+
text: { type: "string" },
|
|
579
|
+
key: { type: "string" },
|
|
580
|
+
modifiers: {
|
|
581
|
+
type: "array",
|
|
582
|
+
items: { type: "string" },
|
|
583
|
+
description: "command, shift, option, control"
|
|
584
|
+
},
|
|
585
|
+
dx: { type: "number", description: "Horizontal scroll in points. Positive is right" },
|
|
586
|
+
dy: { type: "number", description: "Vertical scroll in points. Positive is down" }
|
|
587
|
+
},
|
|
588
|
+
required: ["action"]
|
|
589
|
+
},
|
|
337
590
|
stop_job: {
|
|
338
591
|
type: "object",
|
|
339
592
|
properties: {
|
|
@@ -382,6 +635,7 @@ function createPilotRpcExecutors(opts) {
|
|
|
382
635
|
}
|
|
383
636
|
},
|
|
384
637
|
stop_job: (args) => callJob("job.stop", args),
|
|
638
|
+
computer_use: (args) => callJob("computer.act", args),
|
|
385
639
|
wait_for_turn: async (args, context) => {
|
|
386
640
|
const prev = waitToolCallId;
|
|
387
641
|
waitToolCallId = typeof context?.toolCallId === "string" ? context.toolCallId : void 0;
|
|
@@ -420,6 +674,10 @@ export {
|
|
|
420
674
|
readAgentRuntimeMetadata,
|
|
421
675
|
agentRpcConnectFromMetadata,
|
|
422
676
|
clearAgentRuntimeMetadataIfOwned,
|
|
677
|
+
COMPUTER_USE_DESCRIPTION,
|
|
678
|
+
performComputerUse,
|
|
679
|
+
formatComputerUseHint,
|
|
680
|
+
macosComputerUseRunner,
|
|
423
681
|
AgentRpcClient,
|
|
424
682
|
PILOT_TOOL_NAMES,
|
|
425
683
|
PILOT_TOOL_DESCRIPTIONS,
|
|
@@ -1278,9 +1278,8 @@ function normalizeAdvanced(raw) {
|
|
|
1278
1278
|
if (typeof source.wakeOrchestratorOnGithubEdges === "boolean") {
|
|
1279
1279
|
out.wakeOrchestratorOnGithubEdges = source.wakeOrchestratorOnGithubEdges;
|
|
1280
1280
|
}
|
|
1281
|
-
if (typeof source.showCost === "boolean")
|
|
1282
|
-
|
|
1283
|
-
}
|
|
1281
|
+
if (typeof source.showCost === "boolean") out.showCost = source.showCost;
|
|
1282
|
+
if (typeof source.computerUse === "boolean") out.computerUse = source.computerUse;
|
|
1284
1283
|
if (isChatTextScale(source.chatTextScale)) {
|
|
1285
1284
|
out.chatTextScale = source.chatTextScale;
|
|
1286
1285
|
}
|
|
@@ -2206,9 +2205,8 @@ function updateAdvancedSettings(patch) {
|
|
|
2206
2205
|
if (typeof patch.wakeOrchestratorOnGithubEdges === "boolean") {
|
|
2207
2206
|
advanced.wakeOrchestratorOnGithubEdges = patch.wakeOrchestratorOnGithubEdges;
|
|
2208
2207
|
}
|
|
2209
|
-
if (typeof patch.showCost === "boolean")
|
|
2210
|
-
|
|
2211
|
-
}
|
|
2208
|
+
if (typeof patch.showCost === "boolean") advanced.showCost = patch.showCost;
|
|
2209
|
+
if (typeof patch.computerUse === "boolean") advanced.computerUse = patch.computerUse;
|
|
2212
2210
|
if (isChatTextScale(patch.chatTextScale)) {
|
|
2213
2211
|
advanced.chatTextScale = patch.chatTextScale;
|
|
2214
2212
|
}
|
|
@@ -2320,6 +2318,9 @@ function wakeOrchestratorOnGithubEdgesEnabled(settings = loadAppSettings()) {
|
|
|
2320
2318
|
function showCostEnabled(settings = loadAppSettings()) {
|
|
2321
2319
|
return Boolean(settings.advanced.showCost);
|
|
2322
2320
|
}
|
|
2321
|
+
function computerUseEnabled(settings = loadAppSettings()) {
|
|
2322
|
+
return Boolean(settings.advanced.computerUse);
|
|
2323
|
+
}
|
|
2323
2324
|
function chatTextScale(settings = loadAppSettings()) {
|
|
2324
2325
|
return isChatTextScale(settings.advanced.chatTextScale) ? settings.advanced.chatTextScale : CHAT_TEXT_SCALE_DEFAULT;
|
|
2325
2326
|
}
|
|
@@ -2574,6 +2575,7 @@ export {
|
|
|
2574
2575
|
cowboyModeEnabled,
|
|
2575
2576
|
wakeOrchestratorOnGithubEdgesEnabled,
|
|
2576
2577
|
showCostEnabled,
|
|
2578
|
+
computerUseEnabled,
|
|
2577
2579
|
chatTextScale,
|
|
2578
2580
|
confirmClaudeUsageOverLimitEnabled,
|
|
2579
2581
|
autoArchiveOnMergeEnabled,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
normalizeTakenSlug,
|
|
5
5
|
normalizeWorktreePath,
|
|
6
6
|
takenSlugsFromThread
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NRGT7RMO.js";
|
|
8
8
|
import {
|
|
9
9
|
ensureWorktreeSideboardIgnored
|
|
10
10
|
} from "./chunk-BMRJNRQK.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
import {
|
|
26
26
|
getGithubGitAuthMode,
|
|
27
27
|
getGithubPat
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-TB7SYXXS.js";
|
|
29
29
|
import {
|
|
30
30
|
worktreesRoot
|
|
31
31
|
} from "./chunk-H4UEFJRI.js";
|
|
@@ -11,17 +11,17 @@ import {
|
|
|
11
11
|
} from "./chunk-LESWJ7L4.js";
|
|
12
12
|
import {
|
|
13
13
|
defaultAcpHarness
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-X52SO3DM.js";
|
|
15
15
|
import {
|
|
16
16
|
isCloudCoordinatorThread,
|
|
17
17
|
isGlobalThread,
|
|
18
18
|
isOrchestratorThread,
|
|
19
19
|
isSlackCoordinatorThread
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-WTT525MC.js";
|
|
21
21
|
import {
|
|
22
22
|
mergeAgentGitAuthEnv,
|
|
23
23
|
resolveAgentGitAuthEnv
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-ZHYFRRPN.js";
|
|
25
25
|
import {
|
|
26
26
|
ATTACHMENTS_DIR,
|
|
27
27
|
DETACHED_JOBS_DIR,
|
|
@@ -46,11 +46,11 @@ import {
|
|
|
46
46
|
updateThread,
|
|
47
47
|
worktreeNameFromPath,
|
|
48
48
|
writeThread
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-GA5MLYVG.js";
|
|
50
50
|
import {
|
|
51
51
|
assertOrchestratorCapableAgent,
|
|
52
52
|
contextTokens
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-RMJXFABA.js";
|
|
54
54
|
import {
|
|
55
55
|
stripNestedElectronEnv
|
|
56
56
|
} from "./chunk-WWUABK6B.js";
|
|
@@ -1781,7 +1781,7 @@ var PORT_RANGE_SIZE = 10;
|
|
|
1781
1781
|
var RECLAIM_RETRY_DELAY_MS = 40;
|
|
1782
1782
|
var RECLAIM_TRIES = 8;
|
|
1783
1783
|
async function killReclaimable(ports, worktreePath, signal) {
|
|
1784
|
-
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-
|
|
1784
|
+
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-6NYG2SZA.js");
|
|
1785
1785
|
if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
|
|
1786
1786
|
else killListenersOnPorts2(ports);
|
|
1787
1787
|
}
|
|
@@ -1533,9 +1533,8 @@ function normalizeAdvanced(raw) {
|
|
|
1533
1533
|
if (typeof source.wakeOrchestratorOnGithubEdges === "boolean") {
|
|
1534
1534
|
out.wakeOrchestratorOnGithubEdges = source.wakeOrchestratorOnGithubEdges;
|
|
1535
1535
|
}
|
|
1536
|
-
if (typeof source.showCost === "boolean")
|
|
1537
|
-
|
|
1538
|
-
}
|
|
1536
|
+
if (typeof source.showCost === "boolean") out.showCost = source.showCost;
|
|
1537
|
+
if (typeof source.computerUse === "boolean") out.computerUse = source.computerUse;
|
|
1539
1538
|
if (isChatTextScale(source.chatTextScale)) {
|
|
1540
1539
|
out.chatTextScale = source.chatTextScale;
|
|
1541
1540
|
}
|
|
@@ -2461,9 +2460,8 @@ function updateAdvancedSettings(patch) {
|
|
|
2461
2460
|
if (typeof patch.wakeOrchestratorOnGithubEdges === "boolean") {
|
|
2462
2461
|
advanced.wakeOrchestratorOnGithubEdges = patch.wakeOrchestratorOnGithubEdges;
|
|
2463
2462
|
}
|
|
2464
|
-
if (typeof patch.showCost === "boolean")
|
|
2465
|
-
|
|
2466
|
-
}
|
|
2463
|
+
if (typeof patch.showCost === "boolean") advanced.showCost = patch.showCost;
|
|
2464
|
+
if (typeof patch.computerUse === "boolean") advanced.computerUse = patch.computerUse;
|
|
2467
2465
|
if (isChatTextScale(patch.chatTextScale)) {
|
|
2468
2466
|
advanced.chatTextScale = patch.chatTextScale;
|
|
2469
2467
|
}
|
|
@@ -2575,6 +2573,9 @@ function wakeOrchestratorOnGithubEdgesEnabled(settings = loadAppSettings()) {
|
|
|
2575
2573
|
function showCostEnabled(settings = loadAppSettings()) {
|
|
2576
2574
|
return Boolean(settings.advanced.showCost);
|
|
2577
2575
|
}
|
|
2576
|
+
function computerUseEnabled(settings = loadAppSettings()) {
|
|
2577
|
+
return Boolean(settings.advanced.computerUse);
|
|
2578
|
+
}
|
|
2578
2579
|
function chatTextScale(settings = loadAppSettings()) {
|
|
2579
2580
|
return isChatTextScale(settings.advanced.chatTextScale) ? settings.advanced.chatTextScale : CHAT_TEXT_SCALE_DEFAULT;
|
|
2580
2581
|
}
|
|
@@ -2873,6 +2874,7 @@ export {
|
|
|
2873
2874
|
cowboyModeEnabled,
|
|
2874
2875
|
wakeOrchestratorOnGithubEdgesEnabled,
|
|
2875
2876
|
showCostEnabled,
|
|
2877
|
+
computerUseEnabled,
|
|
2876
2878
|
chatTextScale,
|
|
2877
2879
|
confirmClaudeUsageOverLimitEnabled,
|
|
2878
2880
|
autoArchiveOnMergeEnabled,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
var LIST_TIMEOUT_MS = 15e3;
|
|
6
6
|
async function listAssignedLinearIssues(opts) {
|
|
7
7
|
try {
|
|
8
|
-
const { listLinearIssuesDirect } = await import("./linear-
|
|
8
|
+
const { listLinearIssuesDirect } = await import("./linear-Q2E6LKJW.js");
|
|
9
9
|
const listed = listLinearIssuesDirect({ limit: 50 }).catch(() => []);
|
|
10
10
|
let timer;
|
|
11
11
|
try {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-RSA47QYR.js";
|
|
10
10
|
import {
|
|
11
11
|
listAssignedLinearIssues
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BCNPZ7H2.js";
|
|
13
13
|
import {
|
|
14
14
|
looksLikeConversationSummary,
|
|
15
15
|
looksLikeSkillBody,
|
|
@@ -22,19 +22,19 @@ import {
|
|
|
22
22
|
detectAcpHarness,
|
|
23
23
|
isAcpHarnessId,
|
|
24
24
|
resolveAcpHarnessCommand
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-QKNOKO2P.js";
|
|
26
26
|
import {
|
|
27
27
|
httpFetch
|
|
28
28
|
} from "./chunk-JAT3JFOS.js";
|
|
29
29
|
import {
|
|
30
30
|
isOrchestratorThread
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-HBRP2SHA.js";
|
|
32
32
|
import {
|
|
33
33
|
codexUnattendedGitConfigArgs,
|
|
34
34
|
mergeAgentGitAuthEnv,
|
|
35
35
|
resolveAgentGitAuthEnv,
|
|
36
36
|
resolveCodexGitWritableRoots
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-SBUR2WCP.js";
|
|
38
38
|
import {
|
|
39
39
|
acpPriorTranscript,
|
|
40
40
|
acpUserStdioServers,
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
PILOT_TOOL_DESCRIPTIONS,
|
|
83
83
|
PILOT_TOOL_NAMES,
|
|
84
84
|
agentRpcConnectFromMetadata
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-PS6TD5MQ.js";
|
|
86
86
|
import {
|
|
87
87
|
claudeChromeEnabled,
|
|
88
88
|
fromInclusiveInputUsage,
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
requestOccupancy,
|
|
94
94
|
resolveAgentExecutable,
|
|
95
95
|
resolveClaudeExecutable
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-TB7SYXXS.js";
|
|
97
97
|
import {
|
|
98
98
|
isElectronLikeCommand,
|
|
99
99
|
unwrapStrippedElectronLaunch
|
|
@@ -501,7 +501,8 @@ function injectedSideboardMcpEnv(opts) {
|
|
|
501
501
|
var AGENT_RPC_PILOT_MCP_TOOLS = [
|
|
502
502
|
"present_artifact",
|
|
503
503
|
"wait_for_job",
|
|
504
|
-
"stop_job"
|
|
504
|
+
"stop_job",
|
|
505
|
+
"computer_use"
|
|
505
506
|
];
|
|
506
507
|
function shouldRegisterMcpWaitForTurn(env = process.env) {
|
|
507
508
|
return !agentRpcOwnsPilotTools(env);
|
|
@@ -523,6 +524,7 @@ var WORKTREE_MCP_TOOLS = [
|
|
|
523
524
|
"run_dev_script",
|
|
524
525
|
"stop_dev_script",
|
|
525
526
|
"get_run_log",
|
|
527
|
+
"computer_use",
|
|
526
528
|
"get_orchestrator",
|
|
527
529
|
"notify_orchestrator",
|
|
528
530
|
"set_workspace_tags",
|
|
@@ -3261,7 +3263,7 @@ var claudeAdapter = {
|
|
|
3261
3263
|
);
|
|
3262
3264
|
}
|
|
3263
3265
|
const mode = permissionMode(thread);
|
|
3264
|
-
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-
|
|
3266
|
+
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-EFPSYP4N.js");
|
|
3265
3267
|
const isOrchestrator = isOrchestratorThread2(thread);
|
|
3266
3268
|
const rpc = worktreeAgentRpc(isOrchestrator);
|
|
3267
3269
|
const injectedServers = await buildInjectedMcpServers({
|
|
@@ -3498,7 +3500,7 @@ ${hint}` : hint;
|
|
|
3498
3500
|
return { file: claude, args, cwd: thread.worktreePath };
|
|
3499
3501
|
},
|
|
3500
3502
|
async listLinearIssues(_repoPath) {
|
|
3501
|
-
const { listAssignedLinearIssues: listAssignedLinearIssues2 } = await import("./linear-list-
|
|
3503
|
+
const { listAssignedLinearIssues: listAssignedLinearIssues2 } = await import("./linear-list-5A3BAWRZ.js");
|
|
3502
3504
|
return listAssignedLinearIssues2();
|
|
3503
3505
|
}
|
|
3504
3506
|
};
|
|
@@ -4194,6 +4196,22 @@ export const SideboardRpc = async (ctx) => {
|
|
|
4194
4196
|
return job("job.stop", args)
|
|
4195
4197
|
},
|
|
4196
4198
|
}),
|
|
4199
|
+
computer_use: tool({
|
|
4200
|
+
description: ${JSON.stringify(PILOT_TOOL_DESCRIPTIONS.computer_use)},
|
|
4201
|
+
args: {
|
|
4202
|
+
action: tool.schema.enum(["screenshot", "click", "type", "key", "scroll"]),
|
|
4203
|
+
x: tool.schema.number().optional().describe("Screen x in points, not PNG pixels"),
|
|
4204
|
+
y: tool.schema.number().optional().describe("Screen y in points, not PNG pixels"),
|
|
4205
|
+
text: opt("Text to type"),
|
|
4206
|
+
key: opt("One key: return, tab, escape, arrows, delete, or one character"),
|
|
4207
|
+
modifiers: tool.schema.array(tool.schema.string()).optional().describe("command, shift, option, control"),
|
|
4208
|
+
dx: tool.schema.number().optional().describe("Horizontal scroll in points. Positive is right"),
|
|
4209
|
+
dy: tool.schema.number().optional().describe("Vertical scroll in points. Positive is down"),
|
|
4210
|
+
},
|
|
4211
|
+
async execute(args) {
|
|
4212
|
+
return job("computer.act", args)
|
|
4213
|
+
},
|
|
4214
|
+
}),
|
|
4197
4215
|
},
|
|
4198
4216
|
}
|
|
4199
4217
|
}
|
|
@@ -4589,7 +4607,7 @@ var opencodeAdapter = {
|
|
|
4589
4607
|
};
|
|
4590
4608
|
},
|
|
4591
4609
|
async listLinearIssues(_repoPath) {
|
|
4592
|
-
const { listAssignedLinearIssues: listAssignedLinearIssues2 } = await import("./linear-list-
|
|
4610
|
+
const { listAssignedLinearIssues: listAssignedLinearIssues2 } = await import("./linear-list-5A3BAWRZ.js");
|
|
4593
4611
|
return listAssignedLinearIssues2();
|
|
4594
4612
|
}
|
|
4595
4613
|
};
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
OPTIONAL_SERVICES,
|
|
3
3
|
isOptionalServiceId,
|
|
4
4
|
optionalServiceSpec
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2S7EAUDI.js";
|
|
6
6
|
import {
|
|
7
7
|
installNpmGlobalPackage,
|
|
8
8
|
whichOnPath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-M426EW7O.js";
|
|
10
10
|
import {
|
|
11
11
|
enrichPathWithNpmGlobalBin
|
|
12
12
|
} from "./chunk-R4W4VQJZ.js";
|