agent-yes 1.219.0 → 1.219.1-beta.540.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ import "./ts-DPuUreXi.js";
2
+ import "./logger-CDIsZ-Pp.js";
3
+ import "./versionChecker-C8KpWtJq.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-sz1kVaEr.js";
8
+
9
+ export { SUPPORTED_CLIS };
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-9rlqbNtF.js";
1
+ import { t as CLIS_CONFIG } from "./ts-DPuUreXi.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-DI93BLWl.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-sz1kVaEr.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-DXgmsfKU.js";
5
+ import { M as resolveOne } from "./subcommands-CZ_wuhTS.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-CqiCrJyf.js.map
232
+ //# sourceMappingURL=agentShare-Pt6P1lED.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-B78dfAU-.js";
5
- import { n as getRustBinary } from "./rustBinary-OWCHGsmW.js";
4
+ import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-C8KpWtJq.js";
5
+ import { n as getRustBinary } from "./rustBinary-JzqE6uAG.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-BGBFDtlC.js");
288
+ const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-BDjEmJ_1.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-0YwAoI4f.js");
330
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-P_PS76vR.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-9rlqbNtF.js";
1
+ import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-DPuUreXi.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-B78dfAU-.js";
3
+ import "./versionChecker-C8KpWtJq.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-DXgmsfKU.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-CZ_wuhTS.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-CL_wTWvx.js.map
592
+ //# sourceMappingURL=notifyDaemon-B0dfZGzC.js.map
@@ -1,4 +1,4 @@
1
- import { r as getInstalledPackage } from "./versionChecker-B78dfAU-.js";
1
+ import { r as getInstalledPackage } from "./versionChecker-C8KpWtJq.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-OWCHGsmW.js.map
228
+ //# sourceMappingURL=rustBinary-JzqE6uAG.js.map
@@ -1,10 +1,10 @@
1
- import "./ts-9rlqbNtF.js";
1
+ import "./ts-DPuUreXi.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-B78dfAU-.js";
3
+ import "./versionChecker-C8KpWtJq.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-DI93BLWl.js";
7
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-sz1kVaEr.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-C-WVevG3.js.map
154
+ //# sourceMappingURL=schedule-C802EC-3.js.map
@@ -1,15 +1,15 @@
1
- import "./ts-9rlqbNtF.js";
1
+ import "./ts-DPuUreXi.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import { r as getInstalledPackage } from "./versionChecker-B78dfAU-.js";
4
- import { t as findSpawnHiddenLauncher } from "./rustBinary-OWCHGsmW.js";
3
+ import { r as getInstalledPackage } from "./versionChecker-C8KpWtJq.js";
4
+ import { t as findSpawnHiddenLauncher } from "./rustBinary-JzqE6uAG.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-DI93BLWl.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-DXgmsfKU.js";
11
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-sz1kVaEr.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-CZ_wuhTS.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-BKVTLm1h.js");
1896
+ const ws = await import("./ws-DfLv3RQZ.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-BKVTLm1h.js");
1916
+ const ws = await import("./ws-DfLv3RQZ.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-CqiCrJyf.js");
2477
+ const { createScopedShare } = await import("./agentShare-Pt6P1lED.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-CqiCrJyf.js");
2492
+ const { listShares } = await import("./agentShare-Pt6P1lED.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-CqiCrJyf.js");
2497
+ const { revokeShare } = await import("./agentShare-Pt6P1lED.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-CqiCrJyf.js").then((m) => m.revokeAllShares()).catch(() => {});
2683
+ import("./agentShare-Pt6P1lED.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-DcFckLSb.js.map
2696
+ //# sourceMappingURL=serve-CPy7hTzZ.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-DcFckLSb.js");
35
+ const { cmdServe } = await import("./serve-CPy7hTzZ.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-9bDkT64C.js.map
45
+ //# sourceMappingURL=setup-DePD7zpu.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-DXgmsfKU.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-CZ_wuhTS.js";
6
6
  import "./e2e-jb0Hp43q.js";
7
7
  import "./webrtcLink-B7REGtK2.js";
8
8
  import "./remotes-Cim0dBU7.js";
@@ -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-DcFckLSb.js");
1240
+ const { cmdServe } = await import("./serve-CPy7hTzZ.js");
1241
1241
  return cmdServe(rest);
1242
1242
  }
1243
1243
  case "setup": {
1244
- const { cmdSetup } = await import("./setup-9bDkT64C.js");
1244
+ const { cmdSetup } = await import("./setup-DePD7zpu.js");
1245
1245
  return cmdSetup(rest);
1246
1246
  }
1247
1247
  case "ws": {
1248
- const { cmdWs } = await import("./ws-BKVTLm1h.js");
1248
+ const { cmdWs } = await import("./ws-DfLv3RQZ.js");
1249
1249
  return cmdWs(rest);
1250
1250
  }
1251
1251
  case "schedule": {
1252
- const { cmdSchedule } = await import("./schedule-C-WVevG3.js");
1252
+ const { cmdSchedule } = await import("./schedule-C802EC-3.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-CL_wTWvx.js");
4272
+ const { ensureDaemon } = await import("./notifyDaemon-B0dfZGzC.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-CL_wTWvx.js");
4346
+ const daemon = await import("./notifyDaemon-B0dfZGzC.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-DXgmsfKU.js.map
4373
+ //# sourceMappingURL=subcommands-CZ_wuhTS.js.map
@@ -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-B78dfAU-.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-C8KpWtJq.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-9rlqbNtF.js.map
1904
+ //# sourceMappingURL=ts-DPuUreXi.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.0";
10
+ var version = "1.219.1-beta.540.1";
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-B78dfAU-.js.map
218
+ //# sourceMappingURL=versionChecker-C8KpWtJq.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-DXgmsfKU.js";
5
+ import { S as listRecords } from "./subcommands-CZ_wuhTS.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-BKVTLm1h.js.map
421
+ //# sourceMappingURL=ws-DfLv3RQZ.js.map
package/lab/ui/index.html CHANGED
@@ -4382,46 +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
- try {
4401
- if (window.Translator && window.LanguageDetector) {
4402
- const det = await LanguageDetector.create();
4403
- const d = await det.detect(String(text).slice(0, 1000));
4404
- const src = (d && d[0] && d[0].detectedLanguage) || "en";
4405
- if (src === lang) return text;
4406
- const tr = await Translator.create({ sourceLanguage: src, targetLanguage: lang });
4407
- return await tr.translate(text);
4408
- }
4409
- } catch {
4410
- /* model unavailable / language pair unsupported → tab fallback */
4411
- }
4412
- quickCmdApi.open(
4413
- "https://translate.google.com/?sl=auto&tl=" +
4414
- encodeURIComponent(lang) +
4415
- "&op=translate&text=" +
4416
- encodeURIComponent(String(text).slice(0, 5000)),
4417
- );
4418
- return "";
4419
- },
4420
4404
  copy: (t) => copyText(String(t)),
4421
4405
  open: (u) => window.open(u, "_blank", "noopener,noreferrer"),
4422
4406
  send: (t) => sendToSelected(String(t)),
4423
4407
  show: (t) => showQuickCmdResult(String(t)),
4424
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
+ }
4425
4449
  // Result overlay for js: commands — monospace text + Copy, Esc/backdrop
4426
4450
  // closes. Kept dumb on purpose: a command that wants richer output can
4427
4451
  // ay.open() its own tab.
@@ -4467,17 +4491,35 @@
4467
4491
  overlay.focus();
4468
4492
  }
4469
4493
  // Compile-and-run a `js:` command body. Async-wrapped so bodies can await
4470
- // (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
4471
4495
  // result overlay. Requires 'unsafe-eval' in the CSP — granted for exactly
4472
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
+ }
4473
4512
  async function runJsQuickCmd(body, selText, term) {
4474
4513
  try {
4514
+ const my = buildMyApi(); // user scripts — may throw on a source error
4475
4515
  const fn = new Function(
4476
4516
  "text",
4477
4517
  "ay",
4518
+ "my",
4519
+ "viewport",
4478
4520
  '"use strict"; return (async () => { ' + body + " })()",
4479
4521
  );
4480
- const out = await fn(selText, quickCmdApi);
4522
+ const out = await fn(selText, quickCmdApi, my, term ? termViewportText(term) : "");
4481
4523
  if (typeof out === "string" && out) showQuickCmdResult(out);
4482
4524
  } catch (err) {
4483
4525
  showQuickCmdResult("quick command error: " + (err && err.message ? err.message : err));
@@ -4521,6 +4563,9 @@
4521
4563
  }
4522
4564
 
4523
4565
  let ctxMenuEl = null;
4566
+ // Last touch-drag selection ({text, at}) — the menu's fallback when the
4567
+ // live xterm selection got collapsed by mobile tap emulation.
4568
+ let recentTouchSel = null;
4524
4569
  function hideTermMenu() {
4525
4570
  if (!ctxMenuEl) return;
4526
4571
  ctxMenuEl.remove();
@@ -4617,7 +4662,15 @@
4617
4662
  function showTermMenu(ev, term) {
4618
4663
  ev.preventDefault();
4619
4664
  hideTermMenu();
4620
- const selText = term && term.hasSelection && term.hasSelection() ? term.getSelection() : "";
4665
+ // Live xterm selection first; else fall back to the last touch-drag
4666
+ // selection if it's fresh (≤20s) — mobile tap emulation can collapse
4667
+ // the live selection between the drag and the long-press menu.
4668
+ const selText =
4669
+ term && term.hasSelection && term.hasSelection()
4670
+ ? term.getSelection()
4671
+ : recentTouchSel && Date.now() - recentTouchSel.at < 20_000
4672
+ ? recentTouchSel.text
4673
+ : "";
4621
4674
  const { menu, addItem, addSep } = ctxMenuShell();
4622
4675
 
4623
4676
  // Copy: disabled with nothing selected (mirrors the old behavior, minus
@@ -4651,6 +4704,7 @@
4651
4704
  }
4652
4705
  addSep();
4653
4706
  addItem("Edit quick commands…", {}, editQuickCmds);
4707
+ addItem("Edit user scripts…", { hint: "my.*" }, editUserScripts);
4654
4708
 
4655
4709
  openCtxMenu(menu, ev);
4656
4710
  }
@@ -4681,9 +4735,12 @@
4681
4735
  box.innerHTML =
4682
4736
  '<div style="color:var(--fg);font-size:14px;margin-bottom:6px">Quick commands</div>' +
4683
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>' +
4684
- "A template starting with <code>js:</code> runs as a frontend function body with <code>(text, ay)</code> — " +
4685
- "<code>text</code> is the selection, <code>ay</code> = {translate(text, lang), copy(t), open(url), send(t), show(t)}. " +
4686
- '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>';
4687
4744
  const ta = document.createElement("textarea");
4688
4745
  ta.value = quickCmdsToText(loadQuickCmds());
4689
4746
  ta.spellcheck = false;
@@ -4724,6 +4781,74 @@
4724
4781
  document.body.appendChild(overlay);
4725
4782
  ta.focus();
4726
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
+ }
4727
4852
 
4728
4853
  // ---- On-screen key bar (mobile) -------------------------------------
4729
4854
  // A phone keyboard has no Esc/Tab/Ctrl/arrows, so agent TUIs (claude,
@@ -5670,7 +5795,14 @@
5670
5795
  const mt = t.modes && t.modes.mouseTrackingMode;
5671
5796
  if (mt && mt !== "none") return; // the TUI owns selection + OSC 52 copy
5672
5797
  if (t.hasSelection()) {
5673
- copyText(t.getSelection());
5798
+ // Remember the selection for the long-press menu: on mobile the
5799
+ // browser's tap/long-press emulation can collapse the xterm
5800
+ // selection BEFORE the menu opens, which made selection-fed
5801
+ // commands (Translate, [selection]) run against empty text.
5802
+ const selTxt = t.getSelection();
5803
+ // whitespace-only cell selections aren't worth remembering
5804
+ if (selTxt.trim()) recentTouchSel = { text: selTxt, at: Date.now() };
5805
+ copyText(selTxt);
5674
5806
  const pill = document.createElement("div");
5675
5807
  pill.className = "updatebar";
5676
5808
  pill.textContent = "copied";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.219.0",
3
+ "version": "1.219.1-beta.540.1",
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-9rlqbNtF.js";
2
- import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-B78dfAU-.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-DI93BLWl.js";
8
-
9
- export { SUPPORTED_CLIS };