agent-yes 1.119.1 → 1.121.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-D91dm1E0.js";
2
+ import "./logger-B9h0djqx.js";
3
+ import "./versionChecker-CAtpgnoQ.js";
4
+ import "./pidStore-B5vBu8Px.js";
5
+ import "./globalPidIndex-gZuTvTBs.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-O57LGUEG.js";
7
+
8
+ export { SUPPORTED_CLIS };
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-VrgyWwNH.js";
1
+ import { t as CLIS_CONFIG } from "./ts-D91dm1E0.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-DwPmzY8B.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-O57LGUEG.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-BjZOppZJ.js";
3
+ import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-CAtpgnoQ.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-BFHJ2AUQ.js");
485
+ const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-DobVXouH.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-CwM5JV4y.js");
518
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-CegJgoEf.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-VrgyWwNH.js";
1
+ import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-D91dm1E0.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import "./versionChecker-BjZOppZJ.js";
3
+ import "./versionChecker-CAtpgnoQ.js";
4
4
  import "./pidStore-B5vBu8Px.js";
5
5
  import "./globalPidIndex-gZuTvTBs.js";
6
6
 
@@ -1,11 +1,11 @@
1
- import "./ts-VrgyWwNH.js";
1
+ import "./ts-D91dm1E0.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import { r as getInstalledPackage } from "./versionChecker-BjZOppZJ.js";
3
+ import { r as getInstalledPackage } from "./versionChecker-CAtpgnoQ.js";
4
4
  import "./pidStore-B5vBu8Px.js";
5
5
  import "./globalPidIndex-gZuTvTBs.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DwPmzY8B.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-O57LGUEG.js";
7
7
  import "./remotes-BufkGk0e.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-BC_0iPGS.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-CzpZQHO6.js";
9
9
  import yargs from "yargs";
10
10
  import { mkdir, open, readFile, writeFile } from "fs/promises";
11
11
  import { homedir, hostname, userInfo } from "os";
@@ -103,16 +103,18 @@ function ayServeArgv(args) {
103
103
  }
104
104
  async function ensureBootAutostart(mgr) {
105
105
  try {
106
- const cmd = mgr.id === "oxmgr" ? [
106
+ if (mgr.id !== "oxmgr") return await spawnExit([mgr.bin, "save"]) === 0;
107
+ const installed = await spawnExit([
107
108
  mgr.bin,
108
109
  "service",
109
110
  "install"
110
- ] : [mgr.bin, "save"];
111
- return await Bun.spawn(cmd, { stdio: [
112
- "ignore",
113
- "ignore",
114
- "ignore"
115
- ] }).exited === 0;
111
+ ]) === 0;
112
+ if (installed && process.platform === "linux") await spawnExit([
113
+ "loginctl",
114
+ "enable-linger",
115
+ userInfo().username
116
+ ]);
117
+ return installed;
116
118
  } catch {
117
119
  return false;
118
120
  }
@@ -237,8 +239,8 @@ async function cmdServeDaemon(sub, args) {
237
239
  const webrtcish = effArgs.some((a) => a.startsWith("--webrtc") || a.startsWith("--share"));
238
240
  const httpish = effArgs.some((a) => a.startsWith("--http") || a.startsWith("--share")) || !effArgs.some((a) => a.startsWith("--webrtc"));
239
241
  process.stdout.write(`\n${priorArgs !== null ? `rolled '${DAEMON_NAME}' forward to` : `installed '${DAEMON_NAME}' as a daemon via ${mgr.id} —`} v${current}\n`);
240
- if (mgr.id === "oxmgr") process.stdout.write(onBoot ? `start-on-boot: enabled (oxmgr registered with the system init)\n` : `start-on-boot: not registered — run \`oxmgr service install\` to enable\n`);
241
- else process.stdout.write(onBoot ? `start-on-boot: pm2 list saved (run \`pm2 startup\` once for boot resurrect)\n` : `start-on-boot: \`pm2 save\` failed — run it manually to persist across reboots\n`);
242
+ if (mgr.id === "oxmgr") process.stdout.write(onBoot ? `start-on-boot: enabled (systemd --user + linger, starts at boot)\n` : `start-on-boot: not registered — needs a user systemd session; run \`oxmgr service install\` to enable\n`);
243
+ else process.stdout.write(onBoot ? `start-on-login: enabled (pm2 list saved; run \`pm2 startup\` once if logon resurrect is not yet installed)\n` : `start-on-login: \`pm2 save\` failed — run it manually to persist across logins\n`);
242
244
  process.stdout.write(`token: ${token}\n\n`);
243
245
  if (httpish) {
244
246
  process.stdout.write(` ay ls ${token}@<host>:${port}\n`);
@@ -246,7 +248,7 @@ async function cmdServeDaemon(sub, args) {
246
248
  }
247
249
  process.stdout.write(` ay serve logs # view server logs\n`);
248
250
  process.stdout.write(` ay serve uninstall # remove daemon\n`);
249
- 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");
251
+ if (webrtcish) process.stdout.write("\nthe WebRTC share link carries a secret, so the daemon does NOT log it —\nread it from ~/.agent-yes/.share-link (mode 0600). The room persists in\n~/.agent-yes/.share-room, so the link survives restarts.\n");
250
252
  }
251
253
  return code ?? 1;
252
254
  }
@@ -778,6 +780,7 @@ Options:
778
780
  if (req.method === "GET" && (p === "/" || p === "/index.html")) return serveUiFile("index.html", "text/html; charset=utf-8");
779
781
  if (req.method === "GET" && p === "/room-client.js") return serveUiFile("room-client.js", "text/javascript; charset=utf-8");
780
782
  if (req.method === "GET" && p === "/console-logic.js") return serveUiFile("console-logic.js", "text/javascript; charset=utf-8");
783
+ if (req.method === "GET" && p === "/e2e.js") return serveUiFile("e2e.js", "text/javascript; charset=utf-8");
781
784
  if (req.method === "GET" && p === "/favicon.ico") return new Response(null, { status: 204 });
782
785
  return apiFetch(req);
783
786
  };
@@ -820,14 +823,22 @@ Options:
820
823
  const webrtcVal = argv.webrtc ?? argv.share;
821
824
  const explicitUrl = typeof webrtcVal === "string" && webrtcVal.startsWith("webrtc://") ? webrtcVal : void 0;
822
825
  try {
823
- const { startShare, loadOrCreateShareRoom } = await import("./share-B7J79Wq9.js");
824
- const { link, close } = await startShare({
826
+ const { startShare, loadOrCreateShareRoom } = await import("./share-B6QVr5D1.js");
827
+ const { room, link, close } = await startShare({
825
828
  url: explicitUrl ?? await loadOrCreateShareRoom(),
826
829
  localFetch: apiFetch,
827
830
  apiToken: token
828
831
  });
829
832
  closeShare = close;
830
- 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`));
833
+ const persistNote = explicitUrl ? "\n" : ` (persistent room — same link across restarts; delete ~/.agent-yes/.share-room to rotate)\n\n`;
834
+ if (process.stdout.isTTY) process.stdout.write(`${wantHttp ? "\n" : ""}shared over WebRTC — open this link (the token is eaten from the URL on open):\n ${link}\n` + persistNote);
835
+ else {
836
+ const linkFile = path.join(process.env.AGENT_YES_HOME ?? path.join(homedir(), ".agent-yes"), ".share-link");
837
+ try {
838
+ await writeFile(linkFile, link + "\n", { mode: 384 });
839
+ } catch {}
840
+ process.stdout.write(`${wantHttp ? "\n" : ""}shared over WebRTC · room ${room} — the link carries a secret, so it is NOT logged.\n read it from ${linkFile} (mode 0600); delete ~/.agent-yes/.share-room to rotate\n\n`);
841
+ }
831
842
  } catch (e) {
832
843
  process.stderr.write(`ay serve --webrtc failed: ${e.message}\n`);
833
844
  if (!wantHttp) return 1;
@@ -851,4 +862,4 @@ Options:
851
862
 
852
863
  //#endregion
853
864
  export { cmdServe };
854
- //# sourceMappingURL=serve-Bd-6ZItj.js.map
865
+ //# sourceMappingURL=serve-D2czcYNC.js.map
@@ -69,7 +69,7 @@ async function cmdSetup(rest) {
69
69
  if (!existsSync$1(abs)) process.stderr.write(` note: that directory doesn't exist yet — create it, or agents spawned there will fail\n`);
70
70
  if (noShare) return 0;
71
71
  process.stdout.write(`\nsharing this machine to agent-yes.com…\n`);
72
- const { cmdServe } = await import("./serve-Bd-6ZItj.js");
72
+ const { cmdServe } = await import("./serve-D2czcYNC.js");
73
73
  return cmdServe([
74
74
  "install",
75
75
  "--share",
@@ -79,4 +79,4 @@ async function cmdSetup(rest) {
79
79
 
80
80
  //#endregion
81
81
  export { cmdSetup };
82
- //# sourceMappingURL=setup-DiRSdfeu.js.map
82
+ //# sourceMappingURL=setup-f1FIFcZm.js.map