agent-yes 1.98.0 → 1.100.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,8 @@
1
+ import "./ts-CUn393DD.js";
2
+ import "./logger-B9h0djqx.js";
3
+ import "./versionChecker-BWdncsn6.js";
4
+ import "./pidStore-DBjlqzo8.js";
5
+ import "./globalPidIndex-yVd3mbsV.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DIHMEdRx.js";
7
+
8
+ export { SUPPORTED_CLIS };
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-BuFWTNL9.js";
1
+ import { t as CLIS_CONFIG } from "./ts-CUn393DD.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-C0a9K6I5.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-DIHMEdRx.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-CpNUvHBx.js";
3
+ import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-BWdncsn6.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-fCkYXyTe.js");
485
+ const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-dnjUZ9nY.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-BtLklR5y.js");
518
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-C-cenkTG.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-BuFWTNL9.js";
1
+ import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-CUn393DD.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import "./versionChecker-CpNUvHBx.js";
3
+ import "./versionChecker-BWdncsn6.js";
4
4
  import "./pidStore-DBjlqzo8.js";
5
5
  import "./globalPidIndex-yVd3mbsV.js";
6
6
 
@@ -1,11 +1,11 @@
1
- import "./ts-BuFWTNL9.js";
1
+ import "./ts-CUn393DD.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import "./versionChecker-CpNUvHBx.js";
3
+ import "./versionChecker-BWdncsn6.js";
4
4
  import "./pidStore-DBjlqzo8.js";
5
5
  import "./globalPidIndex-yVd3mbsV.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C0a9K6I5.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DIHMEdRx.js";
7
7
  import "./remotes-C3xPRtfg.js";
8
- import { c as readNotes, f as snapshotStatus, l as renderRawLog, m as writeToIpc, o as listRecords, r as controlCodeFromName, u as resolveOne } from "./subcommands-D4Muugfr.js";
8
+ import { c as readNotes, f as snapshotStatus, l as renderRawLog, m as writeToIpc, o as listRecords, r as controlCodeFromName, u as resolveOne } from "./subcommands-BKY3nQV4.js";
9
9
  import yargs from "yargs";
10
10
  import { mkdir, open, readFile, writeFile } from "fs/promises";
11
11
  import { homedir } from "os";
@@ -60,8 +60,9 @@ async function cmdServeDaemon(sub, args) {
60
60
  }
61
61
  if (sub === "install") {
62
62
  const token = await loadOrCreateToken(void 0);
63
+ const ayBin = Bun.which("ay");
63
64
  const serveCmd = [
64
- "ay",
65
+ ...ayBin ? [process.execPath, ayBin] : ["ay"],
65
66
  "serve",
66
67
  ...args
67
68
  ].join(" ");
@@ -81,13 +82,17 @@ async function cmdServeDaemon(sub, args) {
81
82
  if (code === 0) {
82
83
  const portM = /--port[=\s](\d+)/.exec(args.join(" "));
83
84
  const port = portM ? Number(portM[1]) : DEFAULT_PORT;
85
+ const webrtcish = args.some((a) => a.startsWith("--webrtc") || a.startsWith("--share"));
86
+ const httpish = args.some((a) => a.startsWith("--http") || a.startsWith("--share")) || !args.some((a) => a.startsWith("--webrtc"));
84
87
  process.stdout.write(`\ninstalled '${DAEMON_NAME}' as a daemon via oxmgr\n`);
85
88
  process.stdout.write(`token: ${token}\n\n`);
86
- process.stdout.write(` ay ls ${token}@<host>:${port}\n`);
87
- process.stdout.write(` ay remote add <alias> http://${token}@<host>:${port}\n`);
89
+ if (httpish) {
90
+ process.stdout.write(` ay ls ${token}@<host>:${port}\n`);
91
+ process.stdout.write(` ay remote add <alias> http://${token}@<host>:${port}\n`);
92
+ }
88
93
  process.stdout.write(` ay serve logs # view server logs\n`);
89
94
  process.stdout.write(` ay serve uninstall # remove daemon\n`);
90
- if (args.some((a) => a.startsWith("--webrtc") || a.startsWith("--share"))) process.stdout.write(`\nthe WebRTC share link is printed by the daemon — see: ay serve logs\n`);
95
+ if (webrtcish) process.stdout.write("\nthe WebRTC share link is printed by the daemon — see: ay serve logs\n(the room persists in ~/.agent-yes/.share-room, so the link survives restarts)\n");
91
96
  }
92
97
  return code ?? 1;
93
98
  }
@@ -124,10 +129,12 @@ Modes (default: --http):
124
129
  --webrtc [URL] Share over WebRTC (bare flag mints a room+link on
125
130
  agent-yes.com, or pass webrtc://room:token@host).
126
131
  Alone it needs NO port — combine with --http for both.
132
+ The minted room persists in ~/.agent-yes/.share-room
133
+ (stable link across restarts; delete the file to rotate).
127
134
  --share [URL] Legacy alias for --http --webrtc
128
135
 
129
136
  Options:
130
- --port N Port to listen on (default: ${DEFAULT_PORT})\n --host HOST Interface to bind (default: 127.0.0.1; use 0.0.0.0 to expose)\n --token TOKEN Auth token (auto-generated and saved if omitted)\n --allow-spawn Deprecated no-op — the console can always spawn agents\n --tls-cert FILE TLS certificate PEM\n --tls-key FILE TLS private key PEM\n\nSubcommands:\n ay serve install install as background daemon via oxmgr\n ay serve uninstall remove daemon\n ay serve logs view daemon logs\n\nOnce running, connect from another machine:\n ay ls <token>@<host>:${DEFAULT_PORT}\n ay remote add <alias> http://<token>@<host>:${DEFAULT_PORT}\n`);
137
+ --port N Port to listen on (default: ${DEFAULT_PORT})\n --host HOST Interface to bind (default: 127.0.0.1; use 0.0.0.0 to expose)\n --token TOKEN Auth token (auto-generated and saved if omitted)\n -d, --daemon Install these flags as a background daemon via oxmgr\n (same as: ay serve install <flags>)\n --allow-spawn Deprecated no-op — the console can always spawn agents\n --tls-cert FILE TLS certificate PEM\n --tls-key FILE TLS private key PEM\n\nSubcommands:\n ay serve install install as background daemon via oxmgr\n ay serve uninstall remove daemon\n ay serve logs view daemon logs\n\nOnce running, connect from another machine:\n ay ls <token>@<host>:${DEFAULT_PORT}\n ay remote add <alias> http://<token>@<host>:${DEFAULT_PORT}\n`);
131
138
  return 0;
132
139
  }
133
140
  const sub = rest[0];
@@ -168,6 +175,7 @@ Options:
168
175
  default: false,
169
176
  description: "Deprecated no-op — the console can always spawn agents"
170
177
  }).help(false).version(false).exitProcess(false).parseAsync();
178
+ if (argv.daemon) return cmdServeDaemon("install", rest.filter((a) => a !== "--daemon" && a !== "-d"));
171
179
  const port = argv.port ?? DEFAULT_PORT;
172
180
  const host = argv.host ?? "127.0.0.1";
173
181
  const tokenFlag = typeof argv.token === "string" ? argv.token : void 0;
@@ -513,15 +521,15 @@ Options:
513
521
  }
514
522
  if (wantWebrtc) {
515
523
  const webrtcVal = argv.webrtc ?? argv.share;
516
- const shareUrl = typeof webrtcVal === "string" && webrtcVal.startsWith("webrtc://") ? webrtcVal : void 0;
524
+ const explicitUrl = typeof webrtcVal === "string" && webrtcVal.startsWith("webrtc://") ? webrtcVal : void 0;
517
525
  try {
518
- const { startShare } = await import("./share-D-r6y3xD.js");
526
+ const { startShare, loadOrCreateShareRoom } = await import("./share-BsCeIfQM.js");
519
527
  const { link } = await startShare({
520
- url: shareUrl,
528
+ url: explicitUrl ?? await loadOrCreateShareRoom(),
521
529
  localFetch: apiFetch,
522
530
  apiToken: token
523
531
  });
524
- process.stdout.write(`${wantHttp ? "\n" : ""}shared over WebRTC — open this link (the token is eaten from the URL on open):\n ${link}\n\n`);
532
+ process.stdout.write(`${wantHttp ? "\n" : ""}shared over WebRTC — open this link (the token is eaten from the URL on open):\n ${link}\n` + (explicitUrl ? "\n" : ` (persistent room — same link across restarts; delete ~/.agent-yes/.share-room to rotate)\n\n`));
525
533
  } catch (e) {
526
534
  process.stderr.write(`ay serve --webrtc failed: ${e.message}\n`);
527
535
  if (!wantHttp) return 1;
@@ -543,4 +551,4 @@ Options:
543
551
 
544
552
  //#endregion
545
553
  export { cmdServe };
546
- //# sourceMappingURL=serve-DPY37v0u.js.map
554
+ //# sourceMappingURL=serve-C4fZSjh9.js.map
@@ -1,3 +1,6 @@
1
+ import { mkdir, readFile, writeFile } from "fs/promises";
2
+ import { homedir } from "os";
3
+ import path from "path";
1
4
  import { randomBytes } from "crypto";
2
5
 
3
6
  //#region ts/share.ts
@@ -5,6 +8,20 @@ const SUB = "ay-signal-1";
5
8
  const ICE = [{ urls: "stun:stun.l.google.com:19302" }];
6
9
  const MAX_CHUNK = 15e3;
7
10
  const DEFAULT_SIGHOST = "s.agent-yes.com";
11
+ function shareRoomPath() {
12
+ const home = process.env.AGENT_YES_HOME ?? path.join(homedir(), ".agent-yes");
13
+ return path.join(home, ".share-room");
14
+ }
15
+ async function loadOrCreateShareRoom(sighost = DEFAULT_SIGHOST) {
16
+ try {
17
+ const url = (await readFile(shareRoomPath(), "utf-8")).trim();
18
+ if (url.startsWith("webrtc://")) return url;
19
+ } catch {}
20
+ const url = `webrtc://${"r" + randomBytes(3).toString("hex")}:${randomBytes(32).toString("hex")}@${sighost}`;
21
+ await mkdir(path.dirname(shareRoomPath()), { recursive: true });
22
+ await writeFile(shareRoomPath(), url, { mode: 384 });
23
+ return url;
24
+ }
8
25
  function parseShareUrl(s) {
9
26
  const m = /^webrtc:\/\/([^:@/]+):([^@/]+)@(.+)$/.exec(s);
10
27
  if (!m) throw new Error(`bad --share url: ${s} (want webrtc://room:token@host)`);
@@ -180,5 +197,5 @@ async function startShare(opts) {
180
197
  }
181
198
 
182
199
  //#endregion
183
- export { startShare };
184
- //# sourceMappingURL=share-D-r6y3xD.js.map
200
+ export { loadOrCreateShareRoom, startShare };
201
+ //# sourceMappingURL=share-BsCeIfQM.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-DPY37v0u.js");
166
+ const { cmdServe } = await import("./serve-C4fZSjh9.js");
167
167
  return cmdServe(rest);
168
168
  }
169
169
  case "setup": {
@@ -1452,4 +1452,4 @@ async function cmdStatus(rest) {
1452
1452
 
1453
1453
  //#endregion
1454
1454
  export { isSubcommand as a, readNotes as c, runSubcommand as d, snapshotStatus as f, isPidAlive as i, renderRawLog as l, writeToIpc as m, cmdHelp as n, listRecords as o, stopTipForCli as p, controlCodeFromName as r, matchKeyword as s, GRACEFUL_EXIT_COMMANDS as t, resolveOne as u };
1455
- //# sourceMappingURL=subcommands-D4Muugfr.js.map
1455
+ //# sourceMappingURL=subcommands-BKY3nQV4.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 isSubcommand, c as readNotes, d as runSubcommand, f as snapshotStatus, i as isPidAlive, l as renderRawLog, m as writeToIpc, n as cmdHelp, o as listRecords, p as stopTipForCli, r as controlCodeFromName, s as matchKeyword, t as GRACEFUL_EXIT_COMMANDS, u as resolveOne } from "./subcommands-D4Muugfr.js";
4
+ import { a as isSubcommand, c as readNotes, d as runSubcommand, f as snapshotStatus, i as isPidAlive, l as renderRawLog, m as writeToIpc, n as cmdHelp, o as listRecords, p as stopTipForCli, r as controlCodeFromName, s as matchKeyword, t as GRACEFUL_EXIT_COMMANDS, u as resolveOne } from "./subcommands-BKY3nQV4.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-CpNUvHBx.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-BWdncsn6.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-BuFWTNL9.js.map
1717
+ //# sourceMappingURL=ts-CUn393DD.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.98.0";
10
+ var version = "1.100.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-CpNUvHBx.js.map
224
+ //# sourceMappingURL=versionChecker-BWdncsn6.js.map