agent-yes 1.219.1 → 1.220.0

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,9 @@
1
+ import "./ts-f4Ma0Z5W.js";
2
+ import "./logger-CDIsZ-Pp.js";
3
+ import "./versionChecker-37_Q3yKY.js";
4
+ import "./pidStore-BIvsBQ8X.js";
5
+ import "./globalPidIndex-CoNr7tS8.js";
6
+ import "./messageLog-CxrKJj77.js";
7
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-Caf2VGdD.js";
8
+
9
+ export { SUPPORTED_CLIS };
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-yjitcNTb.js";
1
+ import { t as CLIS_CONFIG } from "./ts-f4Ma0Z5W.js";
2
2
 
3
3
  //#region ts/SUPPORTED_CLIS.ts
4
4
  const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
5
5
 
6
6
  //#endregion
7
7
  export { SUPPORTED_CLIS as t };
8
- //# sourceMappingURL=SUPPORTED_CLIS-CV3omK_N.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-Caf2VGdD.js.map
@@ -2,7 +2,7 @@ import "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./messageLog-CxrKJj77.js";
4
4
  import "./configShared-aKTg-sa5.js";
5
- import { M as resolveOne } from "./subcommands-R179vF7O.js";
5
+ import { M as resolveOne } from "./subcommands-DUXM40pT.js";
6
6
  import "./e2e-jb0Hp43q.js";
7
7
  import "./webrtcLink-B7REGtK2.js";
8
8
  import "./remotes-Cim0dBU7.js";
@@ -229,4 +229,4 @@ function transformEvent(rawEvent, agentId, forwarded) {
229
229
 
230
230
  //#endregion
231
231
  export { createScopedShare, listShares, revokeAllShares, revokeShare };
232
- //# sourceMappingURL=agentShare-Cg2edRkP.js.map
232
+ //# sourceMappingURL=agentShare-D3rB5mPN.js.map
package/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bun
2
2
  import { t as invokedCliName } from "./invokedCli-uqM2YYA7.js";
3
3
  import { n as logger } from "./logger-CDIsZ-Pp.js";
4
- import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-DzUZNdOl.js";
5
- import { n as getRustBinary } from "./rustBinary-CbueDFf-.js";
4
+ import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-37_Q3yKY.js";
5
+ import { n as getRustBinary } from "./rustBinary-DHtHddAg.js";
6
6
  import { argv } from "process";
7
7
  import { spawn } from "child_process";
8
8
  import ms from "ms";
@@ -285,7 +285,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
285
285
  const rawArg = process.argv[2];
286
286
  const managerCommands = !invokedCliName(process.argv);
287
287
  const isHelpFlag = rawArg === "-h" || rawArg === "--help";
288
- const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-6ZQjIc3U.js");
288
+ const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-DnBuCOK9.js");
289
289
  if (isHelpFlag && process.argv.length === 3) {
290
290
  await cmdHelp(managerCommands);
291
291
  process.exit(0);
@@ -327,7 +327,7 @@ if (config.useRust) {
327
327
  }
328
328
  }
329
329
  if (rustBinary) {
330
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-Xm8NN_Xz.js");
330
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-BLJ7sQCy.js");
331
331
  const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
332
332
  if (config.verbose) {
333
333
  console.log(`[rust] Using binary: ${rustBinary}`);
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-yjitcNTb.js";
1
+ import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-f4Ma0Z5W.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-DzUZNdOl.js";
3
+ import "./versionChecker-37_Q3yKY.js";
4
4
  import "./pidStore-BIvsBQ8X.js";
5
5
  import "./globalPidIndex-CoNr7tS8.js";
6
6
  import "./messageLog-CxrKJj77.js";
@@ -2,7 +2,7 @@ import { n as logger } from "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./messageLog-CxrKJj77.js";
4
4
  import "./configShared-aKTg-sa5.js";
5
- import { $ as daemonLockOwnerPath, G as gcInboxes, J as listInboxParents, K as hostId, Q as daemonLockDir, S as listRecords, W as appendEvent, X as readInbox, Y as liveWatchers, Z as shouldStealLock, _ as isPidAlive, c as deriveLiveState, et as notifyDir, k as renderLogTailLines } from "./subcommands-R179vF7O.js";
5
+ import { $ as daemonLockOwnerPath, G as gcInboxes, J as listInboxParents, K as hostId, Q as daemonLockDir, S as listRecords, W as appendEvent, X as readInbox, Y as liveWatchers, Z as shouldStealLock, _ as isPidAlive, c as deriveLiveState, et as notifyDir, k as renderLogTailLines } from "./subcommands-DUXM40pT.js";
6
6
  import "./e2e-jb0Hp43q.js";
7
7
  import "./webrtcLink-B7REGtK2.js";
8
8
  import "./remotes-Cim0dBU7.js";
@@ -589,4 +589,4 @@ async function ensureDaemon() {
589
589
 
590
590
  //#endregion
591
591
  export { daemonStatus, ensureDaemon, requestDaemonStop, runDaemon };
592
- //# sourceMappingURL=notifyDaemon-DqO8vEUX.js.map
592
+ //# sourceMappingURL=notifyDaemon-CRjiUotr.js.map
@@ -1,4 +1,4 @@
1
- import { r as getInstalledPackage } from "./versionChecker-DzUZNdOl.js";
1
+ import { r as getInstalledPackage } from "./versionChecker-37_Q3yKY.js";
2
2
  import { execFileSync } from "child_process";
3
3
  import { existsSync, mkdirSync, unlinkSync } from "fs";
4
4
  import { chmod, copyFile } from "fs/promises";
@@ -225,4 +225,4 @@ async function getRustBinary(options = {}) {
225
225
 
226
226
  //#endregion
227
227
  export { getRustBinary as n, findSpawnHiddenLauncher as t };
228
- //# sourceMappingURL=rustBinary-CbueDFf-.js.map
228
+ //# sourceMappingURL=rustBinary-DHtHddAg.js.map
@@ -1,10 +1,10 @@
1
- import "./ts-yjitcNTb.js";
1
+ import "./ts-f4Ma0Z5W.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-DzUZNdOl.js";
3
+ import "./versionChecker-37_Q3yKY.js";
4
4
  import "./pidStore-BIvsBQ8X.js";
5
5
  import "./globalPidIndex-CoNr7tS8.js";
6
6
  import "./messageLog-CxrKJj77.js";
7
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CV3omK_N.js";
7
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-Caf2VGdD.js";
8
8
  import { d as resolveSpawnCwd } from "./workspaceConfig-CjaRvTjf.js";
9
9
  import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-CwNJuwH5.js";
10
10
  import { createHash } from "node:crypto";
@@ -151,4 +151,4 @@ async function cmdSchedule(rest) {
151
151
 
152
152
  //#endregion
153
153
  export { cmdSchedule };
154
- //# sourceMappingURL=schedule-CE9QiSR9.js.map
154
+ //# sourceMappingURL=schedule-DawiFWf_.js.map
@@ -1,15 +1,15 @@
1
- import "./ts-yjitcNTb.js";
1
+ import "./ts-f4Ma0Z5W.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import { r as getInstalledPackage } from "./versionChecker-DzUZNdOl.js";
4
- import { t as findSpawnHiddenLauncher } from "./rustBinary-CbueDFf-.js";
3
+ import { r as getInstalledPackage } from "./versionChecker-37_Q3yKY.js";
4
+ import { t as findSpawnHiddenLauncher } from "./rustBinary-DHtHddAg.js";
5
5
  import { t as agentYesHome$1 } from "./agentYesHome-CtHb5b71.js";
6
6
  import "./pidStore-BIvsBQ8X.js";
7
7
  import { a as updateGlobalPidStatus } from "./globalPidIndex-CoNr7tS8.js";
8
8
  import { r as recordInbox } from "./messageLog-CxrKJj77.js";
9
9
  import { t as pgidForWrapper } from "./reaper-BUHCyxdF.js";
10
10
  import "./configShared-aKTg-sa5.js";
11
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CV3omK_N.js";
12
- import { A as renderRawLog, D as recentMessageEdges, E as readPtysize, L as snapshotStatus, M as resolveOne, O as recentReadEdges, S as listRecords, T as readNotes, U as writeToIpc, b as isUserTyping, f as extractNeedsInput, k as renderLogTailLines, l as deriveLiveStatus, o as controlCodeFromName, p as extractTaskCounts, q as isTransientLockMkdirError, tt as TYPING_BADGE, u as extractBadges } from "./subcommands-R179vF7O.js";
11
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-Caf2VGdD.js";
12
+ import { A as renderRawLog, D as recentMessageEdges, E as readPtysize, L as snapshotStatus, M as resolveOne, O as recentReadEdges, S as listRecords, T as readNotes, U as writeToIpc, b as isUserTyping, f as extractNeedsInput, k as renderLogTailLines, l as deriveLiveStatus, o as controlCodeFromName, p as extractTaskCounts, q as isTransientLockMkdirError, tt as TYPING_BADGE, u as extractBadges } from "./subcommands-DUXM40pT.js";
13
13
  import "./e2e-jb0Hp43q.js";
14
14
  import "./webrtcLink-B7REGtK2.js";
15
15
  import "./remotes-Cim0dBU7.js";
@@ -1893,7 +1893,7 @@ Options:
1893
1893
  }
1894
1894
  });
1895
1895
  if (req.method === "GET" && p === "/api/ws") {
1896
- const ws = await import("./ws-BYuI0EAT.js");
1896
+ const ws = await import("./ws-CH6Uyznd.js");
1897
1897
  try {
1898
1898
  await ws.loadProvision();
1899
1899
  } catch (e) {
@@ -1913,7 +1913,7 @@ Options:
1913
1913
  if (req.method === "GET" && p === "/api/ws/status") {
1914
1914
  const dirRaw = url.searchParams.get("path");
1915
1915
  if (!dirRaw) return new Response("missing ?path=<workspace dir>", { status: 400 });
1916
- const ws = await import("./ws-BYuI0EAT.js");
1916
+ const ws = await import("./ws-CH6Uyznd.js");
1917
1917
  let prov;
1918
1918
  try {
1919
1919
  prov = await ws.loadProvision();
@@ -2474,7 +2474,7 @@ Options:
2474
2474
  const perm = body.perm ?? "r";
2475
2475
  if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
2476
2476
  try {
2477
- const { createScopedShare } = await import("./agentShare-Cg2edRkP.js");
2477
+ const { createScopedShare } = await import("./agentShare-D3rB5mPN.js");
2478
2478
  const share = await createScopedShare({
2479
2479
  agent: body.agent,
2480
2480
  perm,
@@ -2489,12 +2489,12 @@ Options:
2489
2489
  }
2490
2490
  }
2491
2491
  if (req.method === "GET" && p === "/api/shares") {
2492
- const { listShares } = await import("./agentShare-Cg2edRkP.js");
2492
+ const { listShares } = await import("./agentShare-D3rB5mPN.js");
2493
2493
  return Response.json(listShares());
2494
2494
  }
2495
2495
  const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
2496
2496
  if (req.method === "DELETE" && revokeM) {
2497
- const { revokeShare } = await import("./agentShare-Cg2edRkP.js");
2497
+ const { revokeShare } = await import("./agentShare-D3rB5mPN.js");
2498
2498
  const ok = revokeShare(decodeURIComponent(revokeM[1]));
2499
2499
  return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
2500
2500
  }
@@ -2680,7 +2680,7 @@ Options:
2680
2680
  const shutdown = (resolve) => {
2681
2681
  if (heartbeat) clearInterval(heartbeat);
2682
2682
  closeShare?.();
2683
- import("./agentShare-Cg2edRkP.js").then((m) => m.revokeAllShares()).catch(() => {});
2683
+ import("./agentShare-D3rB5mPN.js").then((m) => m.revokeAllShares()).catch(() => {});
2684
2684
  server?.stop();
2685
2685
  Promise.resolve(releaseHostLock?.()).catch(() => {}).then(resolve);
2686
2686
  };
@@ -2693,4 +2693,4 @@ Options:
2693
2693
 
2694
2694
  //#endregion
2695
2695
  export { cmdServe };
2696
- //# sourceMappingURL=serve-CRa6Dr7G.js.map
2696
+ //# sourceMappingURL=serve-lLwcOP5g.js.map
@@ -32,7 +32,7 @@ async function cmdSetup(rest) {
32
32
  if (!existsSync(abs)) process.stderr.write(` note: that directory doesn't exist yet — create it, or agents spawned there will fail\n`);
33
33
  if (noShare) return 0;
34
34
  process.stdout.write(`\nsharing this machine to agent-yes.com…\n`);
35
- const { cmdServe } = await import("./serve-CRa6Dr7G.js");
35
+ const { cmdServe } = await import("./serve-lLwcOP5g.js");
36
36
  return cmdServe([
37
37
  "install",
38
38
  "--share",
@@ -42,4 +42,4 @@ async function cmdSetup(rest) {
42
42
 
43
43
  //#endregion
44
44
  export { cmdSetup };
45
- //# sourceMappingURL=setup-Be-GWGkQ.js.map
45
+ //# sourceMappingURL=setup-KYLU9Llc.js.map
@@ -1237,19 +1237,19 @@ async function runSubcommand(argv) {
1237
1237
  case "restart": return await cmdRestart(rest);
1238
1238
  case "note": return await cmdNote(rest);
1239
1239
  case "serve": {
1240
- const { cmdServe } = await import("./serve-CRa6Dr7G.js");
1240
+ const { cmdServe } = await import("./serve-lLwcOP5g.js");
1241
1241
  return cmdServe(rest);
1242
1242
  }
1243
1243
  case "setup": {
1244
- const { cmdSetup } = await import("./setup-Be-GWGkQ.js");
1244
+ const { cmdSetup } = await import("./setup-KYLU9Llc.js");
1245
1245
  return cmdSetup(rest);
1246
1246
  }
1247
1247
  case "ws": {
1248
- const { cmdWs } = await import("./ws-BYuI0EAT.js");
1248
+ const { cmdWs } = await import("./ws-CH6Uyznd.js");
1249
1249
  return cmdWs(rest);
1250
1250
  }
1251
1251
  case "schedule": {
1252
- const { cmdSchedule } = await import("./schedule-CE9QiSR9.js");
1252
+ const { cmdSchedule } = await import("./schedule-DawiFWf_.js");
1253
1253
  return cmdSchedule(rest);
1254
1254
  }
1255
1255
  case "remote": {
@@ -4269,7 +4269,7 @@ async function cmdNotify(rest) {
4269
4269
  }
4270
4270
  const ensure = async () => {
4271
4271
  if (!argv["ensure-daemon"]) return;
4272
- const { ensureDaemon } = await import("./notifyDaemon-DqO8vEUX.js");
4272
+ const { ensureDaemon } = await import("./notifyDaemon-CRjiUotr.js");
4273
4273
  await ensureDaemon().catch(() => null);
4274
4274
  };
4275
4275
  await heartbeatWatcher(parent, selfStartedAt);
@@ -4343,7 +4343,7 @@ async function cmdNotifyCursor(args) {
4343
4343
  }
4344
4344
  async function cmdNotifyd(rest) {
4345
4345
  const sub = rest[0] ?? "status";
4346
- const daemon = await import("./notifyDaemon-DqO8vEUX.js");
4346
+ const daemon = await import("./notifyDaemon-CRjiUotr.js");
4347
4347
  switch (sub) {
4348
4348
  case "run": return daemon.runDaemon();
4349
4349
  case "once": return daemon.runDaemon({ once: true });
@@ -4370,4 +4370,4 @@ async function cmdNotifyd(rest) {
4370
4370
 
4371
4371
  //#endregion
4372
4372
  export { daemonLockOwnerPath as $, renderRawLog as A, submitAndConfirm as B, matchKeyword as C, recentMessageEdges as D, readPtysize as E, restartHintLines as F, gcInboxes as G, writeKeysPaced as H, runSubcommand as I, listInboxParents as J, hostId as K, snapshotStatus as L, resolveOne as M, resolveReadWindow as N, recentReadEdges as O, resolveResumeArgs as P, daemonLockDir as Q, stdinActivityPath as R, listRecords as S, readNotes as T, writeToIpc as U, waitForLogQuiet as V, appendEvent as W, readInbox as X, liveWatchers as Y, shouldStealLock as Z, isPidAlive as _, cmdHelp as a, isUserTyping as b, deriveLiveState as c, extractMenu as d, notifyDir as et, extractNeedsInput as f, isExitRequest as g, isAgentStuck as h, backoffWhileTyping as i, renderRawLogLines as j, renderLogTailLines as k, deriveLiveStatus as l, finalizedLines as m, READ_PAGE_DEFAULT as n, controlCodeFromName as o, extractTaskCounts as p, isTransientLockMkdirError as q, TYPING_WINDOW_MS as r, cursorAbs as s, GRACEFUL_EXIT_COMMANDS as t, TYPING_BADGE as tt, extractBadges as u, isSlashCommand as v, menuSelectKeys as w, lastStdinAt as x, isSubcommand as y, stopTipForCli as z };
4373
- //# sourceMappingURL=subcommands-R179vF7O.js.map
4373
+ //# sourceMappingURL=subcommands-DUXM40pT.js.map
@@ -2,7 +2,7 @@ import "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./messageLog-CxrKJj77.js";
4
4
  import "./configShared-aKTg-sa5.js";
5
- import { A as renderRawLog, B as submitAndConfirm, C as matchKeyword, D as recentMessageEdges, E as readPtysize, F as restartHintLines, H as writeKeysPaced, I as runSubcommand, L as snapshotStatus, M as resolveOne, N as resolveReadWindow, O as recentReadEdges, P as resolveResumeArgs, R as stdinActivityPath, S as listRecords, T as readNotes, U as writeToIpc, V as waitForLogQuiet, _ as isPidAlive, a as cmdHelp, b as isUserTyping, c as deriveLiveState, d as extractMenu, f as extractNeedsInput, g as isExitRequest, h as isAgentStuck, i as backoffWhileTyping, j as renderRawLogLines, k as renderLogTailLines, l as deriveLiveStatus, m as finalizedLines, n as READ_PAGE_DEFAULT, o as controlCodeFromName, p as extractTaskCounts, r as TYPING_WINDOW_MS, s as cursorAbs, t as GRACEFUL_EXIT_COMMANDS, u as extractBadges, v as isSlashCommand, w as menuSelectKeys, x as lastStdinAt, y as isSubcommand, z as stopTipForCli } from "./subcommands-R179vF7O.js";
5
+ import { A as renderRawLog, B as submitAndConfirm, C as matchKeyword, D as recentMessageEdges, E as readPtysize, F as restartHintLines, H as writeKeysPaced, I as runSubcommand, L as snapshotStatus, M as resolveOne, N as resolveReadWindow, O as recentReadEdges, P as resolveResumeArgs, R as stdinActivityPath, S as listRecords, T as readNotes, U as writeToIpc, V as waitForLogQuiet, _ as isPidAlive, a as cmdHelp, b as isUserTyping, c as deriveLiveState, d as extractMenu, f as extractNeedsInput, g as isExitRequest, h as isAgentStuck, i as backoffWhileTyping, j as renderRawLogLines, k as renderLogTailLines, l as deriveLiveStatus, m as finalizedLines, n as READ_PAGE_DEFAULT, o as controlCodeFromName, p as extractTaskCounts, r as TYPING_WINDOW_MS, s as cursorAbs, t as GRACEFUL_EXIT_COMMANDS, u as extractBadges, v as isSlashCommand, w as menuSelectKeys, x as lastStdinAt, y as isSubcommand, z as stopTipForCli } from "./subcommands-DUXM40pT.js";
6
6
  import "./e2e-jb0Hp43q.js";
7
7
  import "./webrtcLink-B7REGtK2.js";
8
8
  import "./remotes-Cim0dBU7.js";
@@ -1,5 +1,5 @@
1
1
  import { n as logger, t as addTransport } from "./logger-CDIsZ-Pp.js";
2
- import { r as getInstalledPackage } from "./versionChecker-DzUZNdOl.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-37_Q3yKY.js";
3
3
  import { t as agentYesHome } from "./agentYesHome-CtHb5b71.js";
4
4
  import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-CNMl13dC.js";
5
5
  import { t as PidStore } from "./pidStore-BIvsBQ8X.js";
@@ -1901,4 +1901,4 @@ function sleep(ms) {
1901
1901
 
1902
1902
  //#endregion
1903
1903
  export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
1904
- //# sourceMappingURL=ts-yjitcNTb.js.map
1904
+ //# sourceMappingURL=ts-f4Ma0Z5W.js.map
@@ -7,7 +7,7 @@ import { fileURLToPath } from "url";
7
7
 
8
8
  //#region package.json
9
9
  var name = "agent-yes";
10
- var version = "1.219.1";
10
+ var version = "1.220.0";
11
11
 
12
12
  //#endregion
13
13
  //#region ts/versionChecker.ts
@@ -215,4 +215,4 @@ async function displayVersion() {
215
215
 
216
216
  //#endregion
217
217
  export { versionString as i, displayVersion as n, getInstalledPackage as r, checkAndAutoUpdate as t };
218
- //# sourceMappingURL=versionChecker-DzUZNdOl.js.map
218
+ //# sourceMappingURL=versionChecker-37_Q3yKY.js.map
@@ -2,7 +2,7 @@ import "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./messageLog-CxrKJj77.js";
4
4
  import "./configShared-aKTg-sa5.js";
5
- import { S as listRecords } from "./subcommands-R179vF7O.js";
5
+ import { S as listRecords } from "./subcommands-DUXM40pT.js";
6
6
  import "./e2e-jb0Hp43q.js";
7
7
  import "./webrtcLink-B7REGtK2.js";
8
8
  import "./remotes-Cim0dBU7.js";
@@ -418,4 +418,4 @@ async function cmdWs(args) {
418
418
 
419
419
  //#endregion
420
420
  export { WS_JSON_SCHEMA, cmdWs, collectWorkspaces, isPathInside, loadProvision, workspaceStatus };
421
- //# sourceMappingURL=ws-BYuI0EAT.js.map
421
+ //# sourceMappingURL=ws-CH6Uyznd.js.map
package/lab/ui/index.html CHANGED
@@ -4382,55 +4382,70 @@
4382
4382
  const QUICKCMD_KEY = "ay.quickCmds";
4383
4383
  // Two command flavors share the template field:
4384
4384
  // plain — text sent to the agent's stdin ([selection] filled in)
4385
- // js:… — a pure-frontend JS function body, run with (text, ay) where
4386
- // text = the selection and ay = the helper surface below.
4387
- // The translate entries are the demo: duplicate a line in the
4388
- // editor, change the language code, done — all localStorage.
4385
+ // js:… — a pure-frontend JS function body, run as (text, ay, my):
4386
+ // text = the selection, ay = the tiny built-in surface below,
4387
+ // my = YOUR function library from the user-scripts editor.
4389
4388
  const DEFAULT_QUICKCMDS = [
4390
4389
  { label: "Fork with selection", template: "/fork [selection]" },
4391
- { label: "Translate English", template: 'js: return ay.translate(text, "en")' },
4392
- { label: "Translate 中文", template: 'js: return ay.translate(text, "zh")' },
4390
+ // selection when there is one, else the visible screen so a bare
4391
+ // right-click Translate reads the terminal you're looking at.
4392
+ {
4393
+ label: "Translate → English",
4394
+ template: 'js: return my.translate(text.trim() || viewport, "en")',
4395
+ },
4396
+ {
4397
+ label: "Translate → 中文",
4398
+ template: 'js: return my.translate(text.trim() || viewport, "zh")',
4399
+ },
4393
4400
  ];
4394
- // Helper surface handed to `js:` quick commands as `ay`.
4401
+ // Helper surface handed to `js:` quick commands as `ay` — deliberately
4402
+ // tiny (console plumbing only); everything else is the open web platform.
4395
4403
  const quickCmdApi = {
4396
- // Chrome's built-in Translator API (138+, on-device model) when
4397
- // available; otherwise fall back to a Google Translate tab. Returns ""
4398
- // when the fallback tab was opened (nothing to show inline).
4399
- translate: async (text, lang) => {
4400
- // Never end silently: every path returns something the result
4401
- // overlay will show — an empty selection, the translation, or what
4402
- // the fallback did. (The first ship ended silently on mobile, where
4403
- // Android Chrome has NO Translator API and the fallback tab could be
4404
- // popup-blocked after the awaits consumed the tap's activation.)
4405
- if (!String(text || "").trim()) return "nothing selected — drag-select some text first";
4406
- try {
4407
- if (window.Translator && window.LanguageDetector) {
4408
- const det = await LanguageDetector.create();
4409
- const d = await det.detect(String(text).slice(0, 1000));
4410
- const src = (d && d[0] && d[0].detectedLanguage) || "en";
4411
- if (src === lang) return text;
4412
- const tr = await Translator.create({ sourceLanguage: src, targetLanguage: lang });
4413
- return await tr.translate(text);
4414
- }
4415
- } catch {
4416
- /* model unavailable / language pair unsupported → tab fallback */
4417
- }
4418
- const url =
4419
- "https://translate.google.com/?sl=auto&tl=" +
4420
- encodeURIComponent(lang) +
4421
- "&op=translate&text=" +
4422
- encodeURIComponent(String(text).slice(0, 5000));
4423
- const win = quickCmdApi.open(url);
4424
- // Popup blocked (window.open after an await has no activation left):
4425
- // surface the URL itself — the overlay text is selectable/copyable.
4426
- if (!win) return "on-device Translator unavailable and the popup was blocked — open manually:\n" + url;
4427
- return "no on-device Translator here — opened Google Translate in a new tab";
4428
- },
4429
4404
  copy: (t) => copyText(String(t)),
4430
4405
  open: (u) => window.open(u, "_blank", "noopener,noreferrer"),
4431
4406
  send: (t) => sendToSelected(String(t)),
4432
4407
  show: (t) => showQuickCmdResult(String(t)),
4433
4408
  };
4409
+ // ---- user scripts: the `my.*` library ---------------------------------
4410
+ // A single user-editable JS source ("Edit user scripts…" in the terminal
4411
+ // menu) that populates `my` — the personal function library every js:
4412
+ // quick command receives. The default ships my.translate as the demo,
4413
+ // calling the browser's Translator / LanguageDetector APIs directly
4414
+ // (https://developer.mozilla.org/docs/Web/API/Translator) — plain web
4415
+ // platform, no console magic — so duplicating and editing it teaches the
4416
+ // real API. Cached per source text; recompiled after a save.
4417
+ const USER_SCRIPTS_KEY = "ay.userScripts";
4418
+ const DEFAULT_USER_SCRIPTS = `// User scripts — define helpers on \`my\`; every js: quick command runs as
4419
+ // (text, ay, my). Plain web platform: await works, and ay = {copy, open,
4420
+ // send, show} is the only console-provided surface.
4421
+
4422
+ my.translate = async (text, lang) => {
4423
+ if (!text.trim()) return "nothing selected — drag-select some text first";
4424
+ if (!window.Translator || !window.LanguageDetector)
4425
+ return "Translator API unavailable in this browser (needs Chrome 138+ desktop)";
4426
+ const [d] = await (await LanguageDetector.create()).detect(text);
4427
+ const tr = await Translator.create({
4428
+ sourceLanguage: d?.detectedLanguage || "en",
4429
+ targetLanguage: lang,
4430
+ });
4431
+ return await tr.translate(text);
4432
+ };
4433
+ `;
4434
+ const loadUserScripts = () => {
4435
+ const v = localStorage.getItem(USER_SCRIPTS_KEY);
4436
+ return typeof v === "string" && v.trim() ? v : DEFAULT_USER_SCRIPTS;
4437
+ };
4438
+ let myApiCache = null; // { src, my }
4439
+ // Compile the user scripts into the `my` object. Throws on a source
4440
+ // error — callers surface it in the result overlay / save dialog.
4441
+ function buildMyApi() {
4442
+ const src = loadUserScripts();
4443
+ if (myApiCache && myApiCache.src === src) return myApiCache.my;
4444
+ const my = {};
4445
+ new Function("my", "ay", '"use strict";\n' + src)(my, quickCmdApi);
4446
+ myApiCache = { src, my };
4447
+ return my;
4448
+ }
4434
4449
  // Result overlay for js: commands — monospace text + Copy, Esc/backdrop
4435
4450
  // closes. Kept dumb on purpose: a command that wants richer output can
4436
4451
  // ay.open() its own tab.
@@ -4476,17 +4491,35 @@
4476
4491
  overlay.focus();
4477
4492
  }
4478
4493
  // Compile-and-run a `js:` command body. Async-wrapped so bodies can await
4479
- // (ay.translate is async); a returned non-empty string is shown in the
4494
+ // (the Translator demo awaits); a returned non-empty string is shown in the
4480
4495
  // result overlay. Requires 'unsafe-eval' in the CSP — granted for exactly
4481
4496
  // this: user-authored, user-stored commands running in their own browser.
4497
+ // Plain text of what the terminal currently SHOWS (the viewport rows) —
4498
+ // the js-command fallback input when nothing is selected.
4499
+ function termViewportText(t) {
4500
+ try {
4501
+ const b = t.buffer.active;
4502
+ const out = [];
4503
+ for (let i = 0; i < t.rows; i++) {
4504
+ const line = b.getLine(b.viewportY + i);
4505
+ out.push(line ? line.translateToString(false).trimEnd() : "");
4506
+ }
4507
+ return out.join("\n").trim();
4508
+ } catch {
4509
+ return "";
4510
+ }
4511
+ }
4482
4512
  async function runJsQuickCmd(body, selText, term) {
4483
4513
  try {
4514
+ const my = buildMyApi(); // user scripts — may throw on a source error
4484
4515
  const fn = new Function(
4485
4516
  "text",
4486
4517
  "ay",
4518
+ "my",
4519
+ "viewport",
4487
4520
  '"use strict"; return (async () => { ' + body + " })()",
4488
4521
  );
4489
- const out = await fn(selText, quickCmdApi);
4522
+ const out = await fn(selText, quickCmdApi, my, term ? termViewportText(term) : "");
4490
4523
  if (typeof out === "string" && out) showQuickCmdResult(out);
4491
4524
  } catch (err) {
4492
4525
  showQuickCmdResult("quick command error: " + (err && err.message ? err.message : err));
@@ -4671,6 +4704,7 @@
4671
4704
  }
4672
4705
  addSep();
4673
4706
  addItem("Edit quick commands…", {}, editQuickCmds);
4707
+ addItem("Edit user scripts…", { hint: "my.*" }, editUserScripts);
4674
4708
 
4675
4709
  openCtxMenu(menu, ev);
4676
4710
  }
@@ -4701,9 +4735,12 @@
4701
4735
  box.innerHTML =
4702
4736
  '<div style="color:var(--fg);font-size:14px;margin-bottom:6px">Quick commands</div>' +
4703
4737
  '<div style="color:var(--muted);font-size:12px;margin-bottom:10px">One per line: <code>Label | template</code>. Use <code>[selection]</code> for the highlighted text, e.g. <code>/fork [selection]</code>.<br>' +
4704
- "A template starting with <code>js:</code> runs as a frontend function body with <code>(text, ay)</code> — " +
4705
- "<code>text</code> is the selection, <code>ay</code> = {translate(text, lang), copy(t), open(url), send(t), show(t)}. " +
4706
- 'Duplicate the translate line and change the language code to make your own, e.g. <code>Translate 日本語 | js: return ay.translate(text, "ja")</code>.</div>';
4738
+ "A template starting with <code>js:</code> runs as a frontend function body with <code>(text, ay, my, viewport)</code> — " +
4739
+ "<code>text</code> = the selection, <code>viewport</code> = the visible screen text, " +
4740
+ "<code>ay</code> = {copy(t), open(url), send(t), show(t)}, and " +
4741
+ "<code>my.*</code> is your own function library from “Edit user scripts…” " +
4742
+ "(the default defines <code>my.translate(text, lang)</code> on the browser's Translator API — " +
4743
+ 'duplicate a Translate line and change the language code, e.g. <code>js: return my.translate(text.trim() || viewport, "ja")</code>).</div>';
4707
4744
  const ta = document.createElement("textarea");
4708
4745
  ta.value = quickCmdsToText(loadQuickCmds());
4709
4746
  ta.spellcheck = false;
@@ -4744,6 +4781,74 @@
4744
4781
  document.body.appendChild(overlay);
4745
4782
  ta.focus();
4746
4783
  }
4784
+ // Editor for the `my.*` user-script library (see USER_SCRIPTS_KEY). Save
4785
+ // COMPILES the source first — a syntax/runtime error in the top-level
4786
+ // definitions stays in the dialog instead of breaking every js: command.
4787
+ function editUserScripts() {
4788
+ hideTermMenu();
4789
+ const overlay = document.createElement("div");
4790
+ overlay.className = "launchoverlay";
4791
+ overlay.style.zIndex = "41";
4792
+ const box = document.createElement("div");
4793
+ box.className = "omnibox";
4794
+ box.style.padding = "16px";
4795
+ box.style.width = "min(680px, 94vw)";
4796
+ box.innerHTML =
4797
+ '<div style="color:var(--fg);font-size:14px;margin-bottom:6px">User scripts — <code>my.*</code></div>' +
4798
+ '<div style="color:var(--muted);font-size:12px;margin-bottom:10px">Define functions on <code>my</code>; every <code>js:</code> quick command runs as <code>(text, ay, my, viewport)</code>. ' +
4799
+ "Plain web platform — <code>await</code> works, <code>ay</code> = {copy, open, send, show}. " +
4800
+ "Stored in this browser (localStorage) only.</div>";
4801
+ const ta = document.createElement("textarea");
4802
+ ta.value = loadUserScripts();
4803
+ ta.spellcheck = false;
4804
+ ta.style.cssText =
4805
+ "width:100%;box-sizing:border-box;height:300px;resize:vertical;background:var(--bg);color:var(--fg);border:1px solid var(--line);border-radius:6px;padding:10px;font:13px var(--mono);outline:none";
4806
+ box.appendChild(ta);
4807
+ const err = document.createElement("div");
4808
+ err.style.cssText = "color:var(--red);font:12px var(--mono);margin-top:8px;white-space:pre-wrap";
4809
+ box.appendChild(err);
4810
+ const row = document.createElement("div");
4811
+ row.style.cssText = "display:flex;gap:8px;justify-content:flex-end;margin-top:12px";
4812
+ const mkBtn = (label, primary) => {
4813
+ const b = document.createElement("button");
4814
+ b.type = "button";
4815
+ b.textContent = label;
4816
+ b.style.cssText =
4817
+ "padding:7px 14px;border-radius:6px;font:13px var(--mono);cursor:pointer;border:1px solid var(--line);" +
4818
+ (primary
4819
+ ? "background:var(--accent);color:#fff;border-color:var(--accent)"
4820
+ : "background:var(--panel2);color:var(--fg)");
4821
+ row.appendChild(b);
4822
+ return b;
4823
+ };
4824
+ const close = () => overlay.remove();
4825
+ mkBtn("Reset", false).addEventListener("click", () => {
4826
+ ta.value = DEFAULT_USER_SCRIPTS;
4827
+ err.textContent = "";
4828
+ });
4829
+ mkBtn("Cancel", false).addEventListener("click", close);
4830
+ mkBtn("Save", true).addEventListener("click", () => {
4831
+ try {
4832
+ new Function("my", "ay", '"use strict";\n' + ta.value)({}, quickCmdApi);
4833
+ } catch (e) {
4834
+ err.textContent = "won't save — script error: " + (e && e.message ? e.message : e);
4835
+ return;
4836
+ }
4837
+ localStorage.setItem(USER_SCRIPTS_KEY, ta.value);
4838
+ myApiCache = null; // recompile on next use
4839
+ close();
4840
+ });
4841
+ box.appendChild(row);
4842
+ overlay.appendChild(box);
4843
+ overlay.addEventListener("pointerdown", (ev) => {
4844
+ if (ev.target === overlay) close();
4845
+ });
4846
+ overlay.addEventListener("keydown", (ev) => {
4847
+ if (ev.key === "Escape") close();
4848
+ });
4849
+ document.body.appendChild(overlay);
4850
+ ta.focus();
4851
+ }
4747
4852
 
4748
4853
  // ---- On-screen key bar (mobile) -------------------------------------
4749
4854
  // A phone keyboard has no Esc/Tab/Ctrl/arrows, so agent TUIs (claude,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.219.1",
3
+ "version": "1.220.0",
4
4
  "description": "A wrapper tool that automates interactions with various AI CLI tools by automatically handling common prompts and responses.",
5
5
  "keywords": [
6
6
  "ai",
@@ -1,9 +0,0 @@
1
- import "./ts-yjitcNTb.js";
2
- import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-DzUZNdOl.js";
4
- import "./pidStore-BIvsBQ8X.js";
5
- import "./globalPidIndex-CoNr7tS8.js";
6
- import "./messageLog-CxrKJj77.js";
7
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CV3omK_N.js";
8
-
9
- export { SUPPORTED_CLIS };