agent-yes 1.110.0 → 1.111.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,8 @@
1
+ import "./ts-D6xbOkQ2.js";
2
+ import "./logger-B9h0djqx.js";
3
+ import "./versionChecker-B4JUR3Fm.js";
4
+ import "./pidStore-DBjlqzo8.js";
5
+ import "./globalPidIndex-yVd3mbsV.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-pUfsXbBb.js";
7
+
8
+ export { SUPPORTED_CLIS };
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts--IvDnRaR.js";
1
+ import { t as CLIS_CONFIG } from "./ts-D6xbOkQ2.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-Dh1CAhi9.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-pUfsXbBb.js.map
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
  import { n as logger } from "./logger-B9h0djqx.js";
3
- import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-DSdFfx6l.js";
3
+ import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-B4JUR3Fm.js";
4
4
  import { argv } from "process";
5
5
  import { execFileSync, spawn } from "child_process";
6
6
  import ms from "ms";
@@ -482,7 +482,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
482
482
  {
483
483
  const rawArg = process.argv[2];
484
484
  const isHelpFlag = rawArg === "-h" || rawArg === "--help";
485
- const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-D4eVn3eY.js");
485
+ const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-C1pH8so2.js");
486
486
  if (isHelpFlag && process.argv.length === 3) {
487
487
  cmdHelp();
488
488
  process.exit(0);
@@ -515,7 +515,7 @@ if (config.useRust) {
515
515
  }
516
516
  }
517
517
  if (rustBinary) {
518
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-CGb1oNZd.js");
518
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-B9-lhOir.js");
519
519
  const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
520
520
  if (config.verbose) {
521
521
  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--IvDnRaR.js";
1
+ import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-D6xbOkQ2.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import "./versionChecker-DSdFfx6l.js";
3
+ import "./versionChecker-B4JUR3Fm.js";
4
4
  import "./pidStore-DBjlqzo8.js";
5
5
  import "./globalPidIndex-yVd3mbsV.js";
6
6
 
@@ -1,14 +1,14 @@
1
- import "./ts--IvDnRaR.js";
1
+ import "./ts-D6xbOkQ2.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import "./versionChecker-DSdFfx6l.js";
3
+ import "./versionChecker-B4JUR3Fm.js";
4
4
  import "./pidStore-DBjlqzo8.js";
5
5
  import "./globalPidIndex-yVd3mbsV.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-Dh1CAhi9.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-pUfsXbBb.js";
7
7
  import "./remotes-C3xPRtfg.js";
8
- import { c as listRecords, d as renderRawLog, f as resolveOne, g as writeToIpc, m as snapshotStatus, r as controlCodeFromName, u as readNotes } from "./subcommands-D3b7vKgY.js";
8
+ import { c as listRecords, d as renderRawLog, f as resolveOne, g as writeToIpc, m as snapshotStatus, r as controlCodeFromName, u as readNotes } from "./subcommands-CuujGkMd.js";
9
9
  import yargs from "yargs";
10
10
  import { mkdir, open, readFile, writeFile } from "fs/promises";
11
- import { homedir } from "os";
11
+ import { homedir, hostname, userInfo } from "os";
12
12
  import path from "path";
13
13
  import { fileURLToPath } from "node:url";
14
14
  import { watch } from "node:fs";
@@ -241,6 +241,14 @@ Options:
241
241
  return new Response(e.message, { status: 500 });
242
242
  }
243
243
  }
244
+ if (req.method === "GET" && p === "/api/whoami") {
245
+ let user = "";
246
+ try {
247
+ user = userInfo().username;
248
+ } catch {}
249
+ const host = hostname();
250
+ return Response.json({ host: user ? `${user}@${host}` : host });
251
+ }
244
252
  if (req.method === "GET" && p === "/api/notes") {
245
253
  const notes = await readNotes();
246
254
  return Response.json(Object.fromEntries(notes));
@@ -552,4 +560,4 @@ Options:
552
560
 
553
561
  //#endregion
554
562
  export { cmdServe };
555
- //# sourceMappingURL=serve-BmM1r9No.js.map
563
+ //# sourceMappingURL=serve-_OcRc4Fq.js.map
@@ -1,6 +1,6 @@
1
1
  import "./logger-B9h0djqx.js";
2
2
  import "./globalPidIndex-yVd3mbsV.js";
3
3
  import "./remotes-C3xPRtfg.js";
4
- import { a as finalizedLines, c as listRecords, d as renderRawLog, f as resolveOne, g as writeToIpc, h as stopTipForCli, i as cursorAbs, l as matchKeyword, m as snapshotStatus, n as cmdHelp, o as isPidAlive, p as runSubcommand, r as controlCodeFromName, s as isSubcommand, t as GRACEFUL_EXIT_COMMANDS, u as readNotes } from "./subcommands-D3b7vKgY.js";
4
+ import { a as finalizedLines, c as listRecords, d as renderRawLog, f as resolveOne, g as writeToIpc, h as stopTipForCli, i as cursorAbs, l as matchKeyword, m as snapshotStatus, n as cmdHelp, o as isPidAlive, p as runSubcommand, r as controlCodeFromName, s as isSubcommand, t as GRACEFUL_EXIT_COMMANDS, u as readNotes } from "./subcommands-CuujGkMd.js";
5
5
 
6
6
  export { cmdHelp, isSubcommand, runSubcommand };
@@ -163,7 +163,7 @@ async function runSubcommand(argv) {
163
163
  case "restart": return await cmdRestart(rest);
164
164
  case "note": return await cmdNote(rest);
165
165
  case "serve": {
166
- const { cmdServe } = await import("./serve-BmM1r9No.js");
166
+ const { cmdServe } = await import("./serve-_OcRc4Fq.js");
167
167
  return cmdServe(rest);
168
168
  }
169
169
  case "setup": {
@@ -1595,4 +1595,4 @@ async function cmdStatus(rest) {
1595
1595
 
1596
1596
  //#endregion
1597
1597
  export { finalizedLines as a, listRecords as c, renderRawLog as d, resolveOne as f, writeToIpc as g, stopTipForCli as h, cursorAbs as i, matchKeyword as l, snapshotStatus as m, cmdHelp as n, isPidAlive as o, runSubcommand as p, controlCodeFromName as r, isSubcommand as s, GRACEFUL_EXIT_COMMANDS as t, readNotes as u };
1598
- //# sourceMappingURL=subcommands-D3b7vKgY.js.map
1598
+ //# sourceMappingURL=subcommands-CuujGkMd.js.map
@@ -1,5 +1,5 @@
1
1
  import { n as logger, t as addTransport } from "./logger-B9h0djqx.js";
2
- import { r as getInstalledPackage } from "./versionChecker-DSdFfx6l.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-B4JUR3Fm.js";
3
3
  import { n as agentYesHome, t as PidStore } from "./pidStore-DBjlqzo8.js";
4
4
  import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-CJxsoGdb.js";
5
5
  import { i as readGlobalPids } from "./globalPidIndex-yVd3mbsV.js";
@@ -1714,4 +1714,4 @@ function sleep(ms) {
1714
1714
 
1715
1715
  //#endregion
1716
1716
  export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
1717
- //# sourceMappingURL=ts--IvDnRaR.js.map
1717
+ //# sourceMappingURL=ts-D6xbOkQ2.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.110.0";
10
+ var version = "1.111.1";
11
11
 
12
12
  //#endregion
13
13
  //#region ts/versionChecker.ts
@@ -221,4 +221,4 @@ async function displayVersion() {
221
221
 
222
222
  //#endregion
223
223
  export { versionString as i, displayVersion as n, getInstalledPackage as r, checkAndAutoUpdate as t };
224
- //# sourceMappingURL=versionChecker-DSdFfx6l.js.map
224
+ //# sourceMappingURL=versionChecker-B4JUR3Fm.js.map
package/lab/ui/index.html CHANGED
@@ -1252,7 +1252,11 @@
1252
1252
  s.live = true;
1253
1253
  s.devices = new Set();
1254
1254
  const out = (Array.isArray(arr) ? arr : []).map((e) => {
1255
- const host = e._host || "";
1255
+ // codehost stamps _host per agent; agent-yes share rooms fall back to
1256
+ // the room's device label (from /api/whoami). Local stays unlabelled
1257
+ // (no deviceLabel) so a single-machine view keeps its clean path-only
1258
+ // identity instead of a blank "@:" prefix.
1259
+ const host = e._host || s.deviceLabel || "";
1256
1260
  if (host) s.devices.add(host);
1257
1261
  return { ...e, _room: s.id, _key: s.id + "#" + e.pid, _host: host };
1258
1262
  });
@@ -1465,9 +1469,12 @@
1465
1469
  // tracking — click / drag-motion / wheel as SGR mouse reports. onBinary
1466
1470
  // covers the UTF-8 mouse encoding (DECSET 1005). Verified end-to-end:
1467
1471
  // a drag emits \x1b[<0;..M / \x1b[<32;..M / \x1b[<0;..m, wheel \x1b[<64/65..M.
1472
+ // keyword MUST be a string — ay serve's POST /api/send rejects a numeric
1473
+ // keyword with 400 (pid arrives as a number from /api/ls JSON).
1474
+ const kw = String(pid);
1468
1475
  const fwd = (d) => {
1469
1476
  if (sel === e._key)
1470
- tx.post("/api/send", { keyword: pid, msg: d, code: "none" }).catch(() => {});
1477
+ tx.post("/api/send", { keyword: kw, msg: d, code: "none" }).catch(() => {});
1471
1478
  };
1472
1479
  term.onData(fwd);
1473
1480
  term.onBinary(fwd);
@@ -1661,6 +1668,15 @@
1661
1668
  await c.connect();
1662
1669
  s.client = c;
1663
1670
  s.tx = rtcTx(c);
1671
+ // agent-yes share (unlike codehost) sends no per-agent device id, so
1672
+ // every machine's rows would be unlabelled. Ask the host who it is
1673
+ // once and tag this room's agents with it in listSource. Best-effort:
1674
+ // an older host with no /api/whoami just leaves rows device-less.
1675
+ try {
1676
+ s.deviceLabel = (await s.tx.fetchJSON("/api/whoami"))?.host || "";
1677
+ } catch {
1678
+ s.deviceLabel = "";
1679
+ }
1664
1680
  }
1665
1681
  s.live = true;
1666
1682
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.110.0",
3
+ "version": "1.111.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",
package/ts/serve.ts CHANGED
@@ -2,7 +2,7 @@ import { mkdir, open, readFile, writeFile } from "fs/promises";
2
2
  import { watch } from "node:fs";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { createHash, randomBytes, timingSafeEqual } from "crypto";
5
- import { homedir } from "os";
5
+ import { homedir, hostname, userInfo } from "os";
6
6
  import path from "path";
7
7
  import yargs from "yargs";
8
8
  import {
@@ -320,6 +320,22 @@ export async function cmdServe(rest: string[]): Promise<number> {
320
320
  }
321
321
  }
322
322
 
323
+ // GET /api/whoami — this host's device label (user@host), so a remote
324
+ // console can tag each agent with the machine it came from. Unlike codehost,
325
+ // `ay serve --share` carries no per-agent device id; the viewer fetches this
326
+ // once per room and stamps it. os.userInfo()/hostname() are cross-platform
327
+ // (Windows included), so every machine reports a name, not just Unix ones.
328
+ if (req.method === "GET" && p === "/api/whoami") {
329
+ let user = "";
330
+ try {
331
+ user = userInfo().username;
332
+ } catch {
333
+ /* userInfo throws if there's no passwd entry (some containers) */
334
+ }
335
+ const host = hostname();
336
+ return Response.json({ host: user ? `${user}@${host}` : host });
337
+ }
338
+
323
339
  // GET /api/notes
324
340
  if (req.method === "GET" && p === "/api/notes") {
325
341
  const notes = await readNotes();
@@ -1,8 +0,0 @@
1
- import "./ts--IvDnRaR.js";
2
- import "./logger-B9h0djqx.js";
3
- import "./versionChecker-DSdFfx6l.js";
4
- import "./pidStore-DBjlqzo8.js";
5
- import "./globalPidIndex-yVd3mbsV.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-Dh1CAhi9.js";
7
-
8
- export { SUPPORTED_CLIS };