agent-yes 1.109.0 → 1.111.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.
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-BJvj36Z3.js";
1
+ import { t as CLIS_CONFIG } from "./ts-PSRJy-Q0.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-C0AwpO1R.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-C81Qxc4I.js.map
@@ -0,0 +1,8 @@
1
+ import "./ts-PSRJy-Q0.js";
2
+ import "./logger-B9h0djqx.js";
3
+ import "./versionChecker-DeSKN0_s.js";
4
+ import "./pidStore-DBjlqzo8.js";
5
+ import "./globalPidIndex-yVd3mbsV.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C81Qxc4I.js";
7
+
8
+ export { SUPPORTED_CLIS };
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-DGSlVqgt.js";
3
+ import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-DeSKN0_s.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-B-1ABS7S.js");
485
+ const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-CuJU_Pu1.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-BlZnNglM.js");
518
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-CyyetE45.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-BJvj36Z3.js";
1
+ import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-PSRJy-Q0.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import "./versionChecker-DGSlVqgt.js";
3
+ import "./versionChecker-DeSKN0_s.js";
4
4
  import "./pidStore-DBjlqzo8.js";
5
5
  import "./globalPidIndex-yVd3mbsV.js";
6
6
 
@@ -1,14 +1,14 @@
1
- import "./ts-BJvj36Z3.js";
1
+ import "./ts-PSRJy-Q0.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import "./versionChecker-DGSlVqgt.js";
3
+ import "./versionChecker-DeSKN0_s.js";
4
4
  import "./pidStore-DBjlqzo8.js";
5
5
  import "./globalPidIndex-yVd3mbsV.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C0AwpO1R.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C81Qxc4I.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-CPJDMI84.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-Bh5nxq2S.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-AjtjceCu.js.map
563
+ //# sourceMappingURL=serve-DuW7ZOfs.js.map
@@ -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-AjtjceCu.js");
166
+ const { cmdServe } = await import("./serve-DuW7ZOfs.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-CPJDMI84.js.map
1598
+ //# sourceMappingURL=subcommands-Bh5nxq2S.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-CPJDMI84.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-Bh5nxq2S.js";
5
5
 
6
6
  export { cmdHelp, isSubcommand, runSubcommand };
@@ -1,5 +1,5 @@
1
1
  import { n as logger, t as addTransport } from "./logger-B9h0djqx.js";
2
- import { r as getInstalledPackage } from "./versionChecker-DGSlVqgt.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-DeSKN0_s.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-BJvj36Z3.js.map
1717
+ //# sourceMappingURL=ts-PSRJy-Q0.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.109.0";
10
+ var version = "1.111.0";
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-DGSlVqgt.js.map
224
+ //# sourceMappingURL=versionChecker-DeSKN0_s.js.map
package/lab/ui/index.html CHANGED
@@ -7,6 +7,8 @@
7
7
  <style>
8
8
  /* Palette borrowed from codehost (GitHub-dark) so the two feel like one system. */
9
9
  :root {
10
+ /* Adapt native form controls / scrollbars to the OS theme too. */
11
+ color-scheme: light dark;
10
12
  --bg: #0d1117;
11
13
  --panel: #161b22;
12
14
  --panel2: #1c2430;
@@ -22,6 +24,28 @@
22
24
  --red: #f85149;
23
25
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
24
26
  }
27
+ /* Light theme — GitHub-light, the daylight counterpart of the dark palette
28
+ above. prefers-color-scheme is re-evaluated by the browser the moment the
29
+ OS flips, so every var() consumer recolors in real time, no JS, no reload.
30
+ (The xterm canvas is the one exception — it's repainted from JS, see
31
+ termTheme() below.) */
32
+ @media (prefers-color-scheme: light) {
33
+ :root {
34
+ --bg: #ffffff;
35
+ --panel: #f6f8fa;
36
+ --panel2: #eaeef2;
37
+ --line: #d1d9e0;
38
+ --line2: #d8dee4;
39
+ --fg: #1f2328;
40
+ --muted: #59636e;
41
+ --accent: #0969da;
42
+ --green: #1a7f37;
43
+ --amber: #9a6700;
44
+ --purple: #8250df;
45
+ --pink: #bf3989;
46
+ --red: #cf222e;
47
+ }
48
+ }
25
49
  * {
26
50
  box-sizing: border-box;
27
51
  }
@@ -617,7 +641,7 @@
617
641
  min-height: 0;
618
642
  overflow: hidden;
619
643
  padding: 8px 10px;
620
- background: #0d1117;
644
+ background: var(--bg);
621
645
  }
622
646
  .log .xterm {
623
647
  height: 100%;
@@ -813,6 +837,48 @@
813
837
  let term = null; // xterm.js Terminal rendering the raw PTY stream
814
838
  let fit = null;
815
839
 
840
+ // xterm paints to a <canvas>, so unlike the CSS var() consumers it can't
841
+ // ride prefers-color-scheme on its own — its theme is a JS object. Mirror
842
+ // the OS preference here and re-apply it live when the system flips, so the
843
+ // terminal recolors in lockstep with the rest of the UI.
844
+ const prefersLight = window.matchMedia("(prefers-color-scheme: light)");
845
+ const termTheme = () =>
846
+ prefersLight.matches
847
+ ? {
848
+ // GitHub-light terminal palette. xterm's default ANSI slots are
849
+ // tuned for a dark background, so setting only bg/fg/cursor leaves
850
+ // white & bright-white SGR text (37/97) — common in CLI output —
851
+ // near-invisible on #ffffff. Remap the white slots to dark grays
852
+ // and darken the rest so every ANSI color stays legible on light.
853
+ background: "#ffffff",
854
+ foreground: "#1f2328",
855
+ cursor: "#1f2328",
856
+ selectionBackground: "#b6d6ff",
857
+ black: "#24292e",
858
+ red: "#cf222e",
859
+ green: "#116329",
860
+ yellow: "#4d2d00",
861
+ blue: "#0969da",
862
+ magenta: "#8250df",
863
+ cyan: "#1b7c83",
864
+ white: "#6e7781",
865
+ brightBlack: "#57606a",
866
+ brightRed: "#a40e26",
867
+ brightGreen: "#1a7f37",
868
+ brightYellow: "#633c01",
869
+ brightBlue: "#218bff",
870
+ brightMagenta: "#a475f9",
871
+ brightCyan: "#3192aa",
872
+ brightWhite: "#1f2328",
873
+ }
874
+ : { background: "#0d1117", foreground: "#c9d1d9", cursor: "#0d1117" };
875
+ // Exposed so the headless theme e2e can assert the light ANSI palette
876
+ // keeps the white slots dark (legible on a white terminal background).
877
+ window.__termTheme = termTheme;
878
+ prefersLight.addEventListener("change", () => {
879
+ if (term) term.options.theme = termTheme();
880
+ });
881
+
816
882
  const $ = (id) => document.getElementById(id);
817
883
  const esc = (s) =>
818
884
  String(s ?? "").replace(/[&<>]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;" })[c]);
@@ -1186,7 +1252,11 @@
1186
1252
  s.live = true;
1187
1253
  s.devices = new Set();
1188
1254
  const out = (Array.isArray(arr) ? arr : []).map((e) => {
1189
- 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 || "";
1190
1260
  if (host) s.devices.add(host);
1191
1261
  return { ...e, _room: s.id, _key: s.id + "#" + e.pid, _host: host };
1192
1262
  });
@@ -1366,7 +1436,7 @@
1366
1436
  scrollback: 5000,
1367
1437
  fontSize: 12,
1368
1438
  fontFamily: 'ui-monospace, "SF Mono", Menlo, monospace',
1369
- theme: { background: "#0d1117", foreground: "#c9d1d9", cursor: "#0d1117" },
1439
+ theme: termTheme(),
1370
1440
  });
1371
1441
  fit = new FitAddon.FitAddon();
1372
1442
  term.loadAddon(fit);
@@ -1595,6 +1665,15 @@
1595
1665
  await c.connect();
1596
1666
  s.client = c;
1597
1667
  s.tx = rtcTx(c);
1668
+ // agent-yes share (unlike codehost) sends no per-agent device id, so
1669
+ // every machine's rows would be unlabelled. Ask the host who it is
1670
+ // once and tag this room's agents with it in listSource. Best-effort:
1671
+ // an older host with no /api/whoami just leaves rows device-less.
1672
+ try {
1673
+ s.deviceLabel = (await s.tx.fetchJSON("/api/whoami"))?.host || "";
1674
+ } catch {
1675
+ s.deviceLabel = "";
1676
+ }
1598
1677
  }
1599
1678
  s.live = true;
1600
1679
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.109.0",
3
+ "version": "1.111.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",
@@ -88,7 +88,8 @@
88
88
  "test": "vitest run",
89
89
  "test:coverage": "vitest run --coverage",
90
90
  "test:ui": "vitest run --config tests/ui-test/vitest.config.ts",
91
- "test:ui-dom": "vitest run --config tests/ui-dom/vitest.config.ts"
91
+ "test:ui-dom": "vitest run --config tests/ui-dom/vitest.config.ts",
92
+ "test:theme": "node tests/ui-test/theme.e2e.mjs"
92
93
  },
93
94
  "dependencies": {
94
95
  "@snomiao/bun-pty": "^0.3.4",
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-BJvj36Z3.js";
2
- import "./logger-B9h0djqx.js";
3
- import "./versionChecker-DGSlVqgt.js";
4
- import "./pidStore-DBjlqzo8.js";
5
- import "./globalPidIndex-yVd3mbsV.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C0AwpO1R.js";
7
-
8
- export { SUPPORTED_CLIS };