agent-yes 1.119.1 → 1.120.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-VrgyWwNH.js";
1
+ import { t as CLIS_CONFIG } from "./ts-C78N0K4F.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-BD8zWc7O.js.map
@@ -0,0 +1,8 @@
1
+ import "./ts-C78N0K4F.js";
2
+ import "./logger-B9h0djqx.js";
3
+ import "./versionChecker-CYZtJKMG.js";
4
+ import "./pidStore-B5vBu8Px.js";
5
+ import "./globalPidIndex-gZuTvTBs.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BD8zWc7O.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-BjZOppZJ.js";
3
+ import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-CYZtJKMG.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-BVcos4UW.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-CoYWGWbP.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-C78N0K4F.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import "./versionChecker-BjZOppZJ.js";
3
+ import "./versionChecker-CYZtJKMG.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-C78N0K4F.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import { r as getInstalledPackage } from "./versionChecker-BjZOppZJ.js";
3
+ import { r as getInstalledPackage } from "./versionChecker-CYZtJKMG.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-BD8zWc7O.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-CCgzXvQ-.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`);
@@ -851,4 +853,4 @@ Options:
851
853
 
852
854
  //#endregion
853
855
  export { cmdServe };
854
- //# sourceMappingURL=serve-Bd-6ZItj.js.map
856
+ //# sourceMappingURL=serve-6RqphTG0.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-6RqphTG0.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-B5TPF2MV.js.map
@@ -1,6 +1,6 @@
1
1
  import "./logger-B9h0djqx.js";
2
2
  import "./globalPidIndex-gZuTvTBs.js";
3
3
  import "./remotes-BufkGk0e.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-BC_0iPGS.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-CCgzXvQ-.js";
5
5
 
6
6
  export { cmdHelp, isSubcommand, runSubcommand };
@@ -231,11 +231,11 @@ async function runSubcommand(argv) {
231
231
  case "restart": return await cmdRestart(rest);
232
232
  case "note": return await cmdNote(rest);
233
233
  case "serve": {
234
- const { cmdServe } = await import("./serve-Bd-6ZItj.js");
234
+ const { cmdServe } = await import("./serve-6RqphTG0.js");
235
235
  return cmdServe(rest);
236
236
  }
237
237
  case "setup": {
238
- const { cmdSetup } = await import("./setup-DiRSdfeu.js");
238
+ const { cmdSetup } = await import("./setup-B5TPF2MV.js");
239
239
  return cmdSetup(rest);
240
240
  }
241
241
  case "remote": {
@@ -1680,4 +1680,4 @@ async function cmdStatus(rest) {
1680
1680
 
1681
1681
  //#endregion
1682
1682
  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 };
1683
- //# sourceMappingURL=subcommands-BC_0iPGS.js.map
1683
+ //# sourceMappingURL=subcommands-CCgzXvQ-.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-BjZOppZJ.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-CYZtJKMG.js";
3
3
  import { t as agentYesHome } from "./agentYesHome-BvaUOzCV.js";
4
4
  import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-CJxsoGdb.js";
5
5
  import { t as PidStore } from "./pidStore-B5vBu8Px.js";
@@ -1715,4 +1715,4 @@ function sleep(ms) {
1715
1715
 
1716
1716
  //#endregion
1717
1717
  export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
1718
- //# sourceMappingURL=ts-VrgyWwNH.js.map
1718
+ //# sourceMappingURL=ts-C78N0K4F.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.119.1";
10
+ var version = "1.120.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-BjZOppZJ.js.map
224
+ //# sourceMappingURL=versionChecker-CYZtJKMG.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.119.1",
3
+ "version": "1.120.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",
package/ts/serve.ts CHANGED
@@ -133,18 +133,32 @@ function ayServeArgv(args: string[]): string[] {
133
133
  return [...launcher, "serve", ...args];
134
134
  }
135
135
 
136
- // Register the daemon with the platform init system so it comes back after a
137
- // *reboot*, not just a crash. oxmgr wires launchd/systemd/Task Scheduler via
138
- // `oxmgr service install`; pm2 persists its process list with `pm2 save` (a
139
- // once-installed `pm2 startup` hook then resurrects it on boot). Idempotent and
140
- // best-effort: returns false on any failure without aborting the install — the
141
- // process is still crash-managed, just not guaranteed boot-persistent.
136
+ // Register the daemon to come up automatically. The *scope* is per-platform by
137
+ // design: Linux at system boot (before login); Windows → at user login.
138
+ // - Linux (oxmgr): `oxmgr service install` wires a systemd **--user** unit,
139
+ // which on its own only starts after the user logs in. To make it start at
140
+ // boot without requiring root (no system-scope unit, no sudo), we also
141
+ // `loginctl enable-linger`, which keeps the user's systemd instance — and
142
+ // thus our service — running from boot. Best-effort; linger failing just
143
+ // downgrades us to login-scope.
144
+ // - Windows (pm2): `pm2 save` persists the process list so the once-installed
145
+ // `pm2 startup` logon hook resurrects it at user login.
146
+ // Idempotent and best-effort: returns false on failure without aborting the
147
+ // install — the process is still crash-managed, just not boot/login-persistent.
142
148
  async function ensureBootAutostart(mgr: DaemonManager): Promise<boolean> {
143
149
  try {
150
+ if (mgr.id !== "oxmgr") {
151
+ // pm2 (Windows): logon-scoped resurrect via the saved process list.
152
+ return (await spawnExit([mgr.bin, "save"])) === 0;
153
+ }
144
154
  // oxmgr's --system defaults to "auto" (launchd/systemd/Task Scheduler); it's
145
155
  // a `service`-level flag, so it goes before the subcommand, not after.
146
- const cmd = mgr.id === "oxmgr" ? [mgr.bin, "service", "install"] : [mgr.bin, "save"];
147
- return (await Bun.spawn(cmd, { stdio: ["ignore", "ignore", "ignore"] }).exited) === 0;
156
+ const installed = (await spawnExit([mgr.bin, "service", "install"])) === 0;
157
+ if (installed && process.platform === "linux") {
158
+ // Upgrade login-scope → boot-scope: linger starts the user manager at boot.
159
+ await spawnExit(["loginctl", "enable-linger", userInfo().username]);
160
+ }
161
+ return installed;
148
162
  } catch {
149
163
  return false;
150
164
  }
@@ -281,14 +295,14 @@ async function cmdServeDaemon(sub: string, args: string[]): Promise<number> {
281
295
  if (mgr.id === "oxmgr")
282
296
  process.stdout.write(
283
297
  onBoot
284
- ? `start-on-boot: enabled (oxmgr registered with the system init)\n`
285
- : `start-on-boot: not registered — run \`oxmgr service install\` to enable\n`,
298
+ ? `start-on-boot: enabled (systemd --user + linger, starts at boot)\n`
299
+ : `start-on-boot: not registered — needs a user systemd session; run \`oxmgr service install\` to enable\n`,
286
300
  );
287
301
  else
288
302
  process.stdout.write(
289
303
  onBoot
290
- ? `start-on-boot: pm2 list saved (run \`pm2 startup\` once for boot resurrect)\n`
291
- : `start-on-boot: \`pm2 save\` failed — run it manually to persist across reboots\n`,
304
+ ? `start-on-login: enabled (pm2 list saved; run \`pm2 startup\` once if logon resurrect is not yet installed)\n`
305
+ : `start-on-login: \`pm2 save\` failed — run it manually to persist across logins\n`,
292
306
  );
293
307
  process.stdout.write(`token: ${token}\n\n`);
294
308
  if (httpish) {
@@ -1,8 +0,0 @@
1
- import "./ts-VrgyWwNH.js";
2
- import "./logger-B9h0djqx.js";
3
- import "./versionChecker-BjZOppZJ.js";
4
- import "./pidStore-B5vBu8Px.js";
5
- import "./globalPidIndex-gZuTvTBs.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DwPmzY8B.js";
7
-
8
- export { SUPPORTED_CLIS };