agent-yes 1.192.1 → 1.192.3

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.
Files changed (30) hide show
  1. package/dist/{SUPPORTED_CLIS-5N015orJ.js → SUPPORTED_CLIS--9MiXfni.js} +2 -2
  2. package/dist/SUPPORTED_CLIS-CZnCl1OU.js +8 -0
  3. package/dist/{agentShare-C4LxU2xT.js → agentShare-B6znJtFD.js} +3 -3
  4. package/dist/cli.js +7 -7
  5. package/dist/index.js +2 -2
  6. package/dist/nodeRuntime-DZRjxpNp.js +56 -0
  7. package/dist/{notifyDaemon--OxBe8nG.js → notifyDaemon-RhUYKA0l.js} +3 -3
  8. package/dist/{remotes-WVJBNajZ.js → remotes-CW-yxSgW.js} +1 -1
  9. package/dist/{remotes-CgT91bMo.js → remotes-oSmwSYaV.js} +2 -2
  10. package/dist/{rustBinary-DFoLw-3W.js → rustBinary-DUEd_K1i.js} +2 -2
  11. package/dist/{schedule-AZACZY6R.js → schedule-Dx_x0HRj.js} +24 -15
  12. package/dist/{serve-CSijvUDO.js → serve-BAeHlY-f.js} +61 -62
  13. package/dist/{setup-ChMQrv6t.js → setup-C0Lc_Mui.js} +2 -2
  14. package/dist/{spawnGate-BejtWiMJ.js → spawnGate-CWbdnJ5K.js} +1 -1
  15. package/dist/{spawnGate-CA5QD7D4.js → spawnGate-DRWa_Fzj.js} +1 -1
  16. package/dist/{subcommands-czdlkI5W.js → subcommands-BM61pkrL.js} +2 -2
  17. package/dist/{subcommands-DMe0U83W.js → subcommands-CH7ZKLkx.js} +9 -9
  18. package/dist/{tray-PMOWFOfk.js → tray-BKTZ5gIf.js} +1 -1
  19. package/dist/{ts-7XqYx0eW.js → ts-9Wbluc4o.js} +2 -2
  20. package/dist/{versionChecker-CUMd5SWt.js → versionChecker-DzFI7V_S.js} +2 -2
  21. package/dist/{webrtcRemote-CD5EQ3uX.js → webrtcRemote-BmuVKcrx.js} +1 -1
  22. package/lab/ui/index.html +58 -6
  23. package/package.json +1 -1
  24. package/ts/nodeRuntime.spec.ts +99 -0
  25. package/ts/nodeRuntime.ts +58 -0
  26. package/ts/oxmgrService.ts +6 -0
  27. package/ts/schedule.ts +8 -0
  28. package/ts/serve.spec.ts +34 -81
  29. package/ts/serve.ts +21 -46
  30. package/dist/SUPPORTED_CLIS-W067Yn4T.js +0 -8
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-7XqYx0eW.js";
1
+ import { t as CLIS_CONFIG } from "./ts-9Wbluc4o.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-5N015orJ.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS--9MiXfni.js.map
@@ -0,0 +1,8 @@
1
+ import "./ts-9Wbluc4o.js";
2
+ import "./logger-CDIsZ-Pp.js";
3
+ import "./versionChecker-DzFI7V_S.js";
4
+ import "./pidStore-BIvsBQ8X.js";
5
+ import "./globalPidIndex-CoNr7tS8.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS--9MiXfni.js";
7
+
8
+ export { SUPPORTED_CLIS };
@@ -1,10 +1,10 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./configShared-0MnIQ652.js";
4
- import { j as resolveOne } from "./subcommands-DMe0U83W.js";
4
+ import { j as resolveOne } from "./subcommands-CH7ZKLkx.js";
5
5
  import "./e2e-BeKjLhmO.js";
6
6
  import "./webrtcLink-BG0Xc4-W.js";
7
- import "./remotes-CgT91bMo.js";
7
+ import "./remotes-oSmwSYaV.js";
8
8
  import { r as startShare } from "./share-29YbzpbU.js";
9
9
 
10
10
  //#region ts/agentShare.ts
@@ -228,4 +228,4 @@ function transformEvent(rawEvent, agentId, forwarded) {
228
228
 
229
229
  //#endregion
230
230
  export { createScopedShare, listShares, revokeAllShares, revokeShare };
231
- //# sourceMappingURL=agentShare-C4LxU2xT.js.map
231
+ //# sourceMappingURL=agentShare-B6znJtFD.js.map
package/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bun
2
2
  import { t as invokedCliName } from "./invokedCli-uqM2YYA7.js";
3
3
  import { n as logger } from "./logger-CDIsZ-Pp.js";
4
- import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-CUMd5SWt.js";
5
- import { n as getRustBinary } from "./rustBinary-DFoLw-3W.js";
4
+ import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-DzFI7V_S.js";
5
+ import { n as getRustBinary } from "./rustBinary-DUEd_K1i.js";
6
6
  import { argv } from "process";
7
7
  import { spawn } from "child_process";
8
8
  import ms from "ms";
@@ -285,7 +285,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
285
285
  const rawArg = process.argv[2];
286
286
  const managerCommands = !invokedCliName(process.argv);
287
287
  const isHelpFlag = rawArg === "-h" || rawArg === "--help";
288
- const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-czdlkI5W.js");
288
+ const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-BM61pkrL.js");
289
289
  if (isHelpFlag && process.argv.length === 3) {
290
290
  await cmdHelp(managerCommands);
291
291
  process.exit(0);
@@ -299,16 +299,16 @@ await checkAndAutoUpdate();
299
299
  logger.info(versionString());
300
300
  const config = parseCliArgs(process.argv);
301
301
  if (config.tray) {
302
- const { startTray } = await import("./tray-PMOWFOfk.js");
302
+ const { startTray } = await import("./tray-BKTZ5gIf.js");
303
303
  await startTray();
304
304
  await new Promise(() => {});
305
305
  }
306
306
  {
307
- const { ensureTray } = await import("./tray-PMOWFOfk.js");
307
+ const { ensureTray } = await import("./tray-BKTZ5gIf.js");
308
308
  ensureTray();
309
309
  }
310
310
  if (!config.showVersion && !config.appendPrompt && !config.tray) {
311
- const { waitForSpawnCapacity } = await import("./spawnGate-BejtWiMJ.js");
311
+ const { waitForSpawnCapacity } = await import("./spawnGate-CWbdnJ5K.js");
312
312
  await waitForSpawnCapacity({
313
313
  onWait: (reason, waitedMs) => {
314
314
  if (config.verbose || waitedMs === 0) console.error(`[agent-yes] spawn gate: ${reason} — waiting…`);
@@ -327,7 +327,7 @@ if (config.useRust) {
327
327
  }
328
328
  }
329
329
  if (rustBinary) {
330
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-W067Yn4T.js");
330
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-CZnCl1OU.js");
331
331
  const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
332
332
  if (config.verbose) {
333
333
  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-7XqYx0eW.js";
1
+ import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-9Wbluc4o.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-CUMd5SWt.js";
3
+ import "./versionChecker-DzFI7V_S.js";
4
4
  import "./pidStore-BIvsBQ8X.js";
5
5
  import "./globalPidIndex-CoNr7tS8.js";
6
6
 
@@ -0,0 +1,56 @@
1
+ import { t as agentYesHome } from "./agentYesHome-CtHb5b71.js";
2
+ import { chmod, mkdir, readFile, writeFile } from "fs/promises";
3
+ import path from "path";
4
+
5
+ //#region ts/nodeRuntime.ts
6
+ /**
7
+ * Snapshot of the CURRENT process.env for child spawns. Bun.spawn without an
8
+ * explicit `env` hands the child the environ captured at PROCESS STARTUP — not
9
+ * the live process.env — so post-startup mutations (ensureNodeRuntime's shim
10
+ * PATH prepend, installAndVerify's global-bin-dir prepend) silently never reach
11
+ * the child. That is exactly how `ay serve install` kept dying with
12
+ * `env: node: No such file or directory` at the `pm2 start` spawn on a bun-only
13
+ * box even though the probe (which passes env explicitly) had just succeeded.
14
+ * Every spawn of a process-manager binary must pass `env: liveEnv()`.
15
+ */
16
+ function liveEnv() {
17
+ return { ...process.env };
18
+ }
19
+ /**
20
+ * Both oxmgr's and pm2's global bins are `#!/usr/bin/env node` JS scripts, so on
21
+ * a bun-only box (setup.sh installs no node) exec dies with "env: node: No such
22
+ * file or directory" — even though pm2 is pure JS and runs perfectly under bun.
23
+ * When node is missing but bun exists, write a node→bun shim into ay's own bin
24
+ * dir and prepend it to PATH so `env node` resolves. NOT solvable with
25
+ * `bun add -g node`: that package (node-bin-gen) lands a broken arch-specific
26
+ * stub and `Bun.which("node")` still finds nothing. POSIX-only — on Windows the
27
+ * npm .cmd shims invoke node.exe directly and an sh script can't stand in.
28
+ * Read-only paths (`ay serve status`) also reach this via the manager probes:
29
+ * an up-to-date shim is left untouched there (a read, not a write), so only the
30
+ * very first run on a node-less box materializes the file.
31
+ * Returns the shim path when the shim is in effect, null when unneeded/impossible.
32
+ */
33
+ async function ensureNodeRuntime(which = Bun.which) {
34
+ if (process.platform === "win32") return null;
35
+ if (which("node")) return null;
36
+ const bun = which("bun");
37
+ if (!bun) return null;
38
+ const binDir = path.join(agentYesHome(), "bin");
39
+ const shim = path.join(binDir, "node");
40
+ const body = `#!/bin/sh\nexec '${bun.replace(/'/g, `'\\''`)}' "$@"\n`;
41
+ try {
42
+ if (await readFile(shim, "utf-8").catch(() => null) !== body) {
43
+ await mkdir(binDir, { recursive: true });
44
+ await writeFile(shim, body);
45
+ await chmod(shim, 493);
46
+ }
47
+ if (!(process.env.PATH ?? "").split(path.delimiter).includes(binDir)) process.env.PATH = `${binDir}${path.delimiter}${process.env.PATH ?? ""}`;
48
+ return shim;
49
+ } catch {
50
+ return null;
51
+ }
52
+ }
53
+
54
+ //#endregion
55
+ export { liveEnv as n, ensureNodeRuntime as t };
56
+ //# sourceMappingURL=nodeRuntime-DZRjxpNp.js.map
@@ -1,10 +1,10 @@
1
1
  import { n as logger } from "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./configShared-0MnIQ652.js";
4
- import { G as hostId, J as readInbox, K as listInboxParents, O as renderLogTailLines, Q as notifyDir, S as listRecords, U as appendEvent, W as gcInboxes, X as daemonLockDir, Y as shouldStealLock, Z as daemonLockOwnerPath, _ as isPidAlive, c as deriveLiveState, q as liveWatchers } from "./subcommands-DMe0U83W.js";
4
+ import { G as hostId, J as readInbox, K as listInboxParents, O as renderLogTailLines, Q as notifyDir, S as listRecords, U as appendEvent, W as gcInboxes, X as daemonLockDir, Y as shouldStealLock, Z as daemonLockOwnerPath, _ as isPidAlive, c as deriveLiveState, q as liveWatchers } from "./subcommands-CH7ZKLkx.js";
5
5
  import "./e2e-BeKjLhmO.js";
6
6
  import "./webrtcLink-BG0Xc4-W.js";
7
- import "./remotes-CgT91bMo.js";
7
+ import "./remotes-oSmwSYaV.js";
8
8
  import { mkdir, readFile, rename, rm, stat, writeFile } from "fs/promises";
9
9
  import { randomUUID } from "node:crypto";
10
10
  import { execFile } from "node:child_process";
@@ -588,4 +588,4 @@ async function ensureDaemon() {
588
588
 
589
589
  //#endregion
590
590
  export { daemonStatus, ensureDaemon, requestDaemonStop, runDaemon };
591
- //# sourceMappingURL=notifyDaemon--OxBe8nG.js.map
591
+ //# sourceMappingURL=notifyDaemon-RhUYKA0l.js.map
@@ -1,5 +1,5 @@
1
1
  import "./e2e-BeKjLhmO.js";
2
2
  import "./webrtcLink-BG0Xc4-W.js";
3
- import { a as resolveRemoteSpec, i as readRemotes, n as deleteRemoteAlias, o as writeRemoteAlias, r as parseDirectRemoteSpec, t as cmdRemote } from "./remotes-CgT91bMo.js";
3
+ import { a as resolveRemoteSpec, i as readRemotes, n as deleteRemoteAlias, o as writeRemoteAlias, r as parseDirectRemoteSpec, t as cmdRemote } from "./remotes-oSmwSYaV.js";
4
4
 
5
5
  export { cmdRemote };
@@ -86,7 +86,7 @@ async function resolveRemoteSpec(spec) {
86
86
  * The bridge lives for the rest of the process (torn down on `process.exit`).
87
87
  */
88
88
  async function resolveWebrtc(link, keyword) {
89
- const { startWebrtcBridge } = await import("./webrtcRemote-CD5EQ3uX.js");
89
+ const { startWebrtcBridge } = await import("./webrtcRemote-BmuVKcrx.js");
90
90
  const bridge = await startWebrtcBridge(link);
91
91
  return {
92
92
  url: bridge.baseUrl,
@@ -173,4 +173,4 @@ async function cmdRemote(rest) {
173
173
 
174
174
  //#endregion
175
175
  export { resolveRemoteSpec as a, readRemotes as i, deleteRemoteAlias as n, writeRemoteAlias as o, parseDirectRemoteSpec as r, cmdRemote as t };
176
- //# sourceMappingURL=remotes-CgT91bMo.js.map
176
+ //# sourceMappingURL=remotes-oSmwSYaV.js.map
@@ -1,4 +1,4 @@
1
- import { r as getInstalledPackage } from "./versionChecker-CUMd5SWt.js";
1
+ import { r as getInstalledPackage } from "./versionChecker-DzFI7V_S.js";
2
2
  import { execFileSync } from "child_process";
3
3
  import { existsSync, mkdirSync, unlinkSync } from "fs";
4
4
  import { chmod, copyFile } from "fs/promises";
@@ -225,4 +225,4 @@ async function getRustBinary(options = {}) {
225
225
 
226
226
  //#endregion
227
227
  export { getRustBinary as n, findSpawnHiddenLauncher as t };
228
- //# sourceMappingURL=rustBinary-DFoLw-3W.js.map
228
+ //# sourceMappingURL=rustBinary-DUEd_K1i.js.map
@@ -1,10 +1,11 @@
1
- import "./ts-7XqYx0eW.js";
1
+ import "./ts-9Wbluc4o.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-CUMd5SWt.js";
3
+ import "./versionChecker-DzFI7V_S.js";
4
4
  import "./pidStore-BIvsBQ8X.js";
5
5
  import "./globalPidIndex-CoNr7tS8.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-5N015orJ.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS--9MiXfni.js";
7
7
  import { d as resolveSpawnCwd } from "./workspaceConfig-_GtAZtsi.js";
8
+ import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-DZRjxpNp.js";
8
9
  import { createHash } from "node:crypto";
9
10
 
10
11
  //#region ts/oxmgrService.ts
@@ -14,20 +15,26 @@ async function ensureBootAutostart(oxmgrBin) {
14
15
  oxmgrBin,
15
16
  "service",
16
17
  "status"
17
- ], { stdio: [
18
- "ignore",
19
- "ignore",
20
- "ignore"
21
- ] }).exited === 0) return true;
18
+ ], {
19
+ stdio: [
20
+ "ignore",
21
+ "ignore",
22
+ "ignore"
23
+ ],
24
+ env: liveEnv()
25
+ }).exited === 0) return true;
22
26
  return await Bun.spawn([
23
27
  oxmgrBin,
24
28
  "service",
25
29
  "install"
26
- ], { stdio: [
27
- "ignore",
28
- "ignore",
29
- "ignore"
30
- ] }).exited === 0;
30
+ ], {
31
+ stdio: [
32
+ "ignore",
33
+ "ignore",
34
+ "ignore"
35
+ ],
36
+ env: liveEnv()
37
+ }).exited === 0;
31
38
  } catch {
32
39
  return false;
33
40
  }
@@ -58,7 +65,8 @@ async function run(cmd, capture = false) {
58
65
  const p = Bun.spawn(cmd, {
59
66
  stdin: "ignore",
60
67
  stdout: capture ? "pipe" : "inherit",
61
- stderr: capture ? "pipe" : "inherit"
68
+ stderr: capture ? "pipe" : "inherit",
69
+ env: liveEnv()
62
70
  });
63
71
  const out = capture ? await new Response(p.stdout).text() : "";
64
72
  return {
@@ -67,6 +75,7 @@ async function run(cmd, capture = false) {
67
75
  };
68
76
  }
69
77
  async function cmdSchedule(rest) {
78
+ await ensureNodeRuntime();
70
79
  const oxmgrBin = Bun.which("oxmgr");
71
80
  if (!oxmgrBin) {
72
81
  process.stderr.write("ay schedule: oxmgr not found\n install with: cargo install oxmgr\n or: bun add -g oxmgr\n");
@@ -141,4 +150,4 @@ async function cmdSchedule(rest) {
141
150
 
142
151
  //#endregion
143
152
  export { cmdSchedule };
144
- //# sourceMappingURL=schedule-AZACZY6R.js.map
153
+ //# sourceMappingURL=schedule-Dx_x0HRj.js.map
@@ -1,20 +1,21 @@
1
- import "./ts-7XqYx0eW.js";
1
+ import "./ts-9Wbluc4o.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import { r as getInstalledPackage } from "./versionChecker-CUMd5SWt.js";
4
- import { t as findSpawnHiddenLauncher } from "./rustBinary-DFoLw-3W.js";
3
+ import { r as getInstalledPackage } from "./versionChecker-DzFI7V_S.js";
4
+ import { t as findSpawnHiddenLauncher } from "./rustBinary-DUEd_K1i.js";
5
5
  import "./pidStore-BIvsBQ8X.js";
6
6
  import { a as updateGlobalPidStatus } from "./globalPidIndex-CoNr7tS8.js";
7
7
  import { t as pgidForWrapper } from "./reaper-CWF2_ATd.js";
8
8
  import "./configShared-0MnIQ652.js";
9
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-5N015orJ.js";
10
- import { $ as TYPING_BADGE, D as recentReadEdges, E as readPtysize, H as writeToIpc, I as snapshotStatus, O as renderLogTailLines, S as listRecords, T as readNotes, b as isUserTyping, f as extractNeedsInput, j as resolveOne, k as renderRawLog, l as deriveLiveStatus, o as controlCodeFromName, p as extractTaskCounts, u as extractBadges } from "./subcommands-DMe0U83W.js";
9
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS--9MiXfni.js";
10
+ import { $ as TYPING_BADGE, D as recentReadEdges, E as readPtysize, H as writeToIpc, I as snapshotStatus, O as renderLogTailLines, S as listRecords, T as readNotes, b as isUserTyping, f as extractNeedsInput, j as resolveOne, k as renderRawLog, l as deriveLiveStatus, o as controlCodeFromName, p as extractTaskCounts, u as extractBadges } from "./subcommands-CH7ZKLkx.js";
11
11
  import "./e2e-BeKjLhmO.js";
12
12
  import "./webrtcLink-BG0Xc4-W.js";
13
- import "./remotes-CgT91bMo.js";
13
+ import "./remotes-oSmwSYaV.js";
14
14
  import { a as getSpawnHook, c as hasProvisionHook, d as resolveSpawnCwd, i as getProvisionRoot, l as hasSpawnHook, r as getProvisionHook, u as isProvisionAllowed } from "./workspaceConfig-_GtAZtsi.js";
15
- import { r as spawnRejectionReason } from "./spawnGate-CA5QD7D4.js";
15
+ import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-DZRjxpNp.js";
16
+ import { r as spawnRejectionReason } from "./spawnGate-DRWa_Fzj.js";
16
17
  import yargs from "yargs";
17
- import { chmod, mkdir, open, readFile, stat, unlink, writeFile } from "fs/promises";
18
+ import { mkdir, open, readFile, stat, unlink, writeFile } from "fs/promises";
18
19
  import { arch, cpus, freemem, homedir, hostname, loadavg, platform, totalmem, uptime, userInfo } from "os";
19
20
  import path from "path";
20
21
  import { execFileSync } from "node:child_process";
@@ -239,7 +240,8 @@ function oxmgrHasWindowsFix(bin) {
239
240
  "ignore",
240
241
  "pipe",
241
242
  "ignore"
242
- ]
243
+ ],
244
+ env: { ...process.env }
243
245
  }));
244
246
  } catch {
245
247
  oxmgrWinFixCache = false;
@@ -289,26 +291,6 @@ async function globalBinDir(installer) {
289
291
  if (!out) return null;
290
292
  return isBun ? out : path.join(out, "bin");
291
293
  }
292
- async function ensureNodeRuntime(which = Bun.which) {
293
- if (process.platform === "win32") return null;
294
- if (which("node")) return null;
295
- const bun = which("bun");
296
- if (!bun) return null;
297
- const binDir = path.join(agentYesHome(), "bin");
298
- const shim = path.join(binDir, "node");
299
- const body = `#!/bin/sh\nexec '${bun.replace(/'/g, `'\\''`)}' "$@"\n`;
300
- try {
301
- if (await readFile(shim, "utf-8").catch(() => null) !== body) {
302
- await mkdir(binDir, { recursive: true });
303
- await writeFile(shim, body);
304
- await chmod(shim, 493);
305
- }
306
- if (!(process.env.PATH ?? "").split(path.delimiter).includes(binDir)) process.env.PATH = `${binDir}${path.delimiter}${process.env.PATH ?? ""}`;
307
- return shim;
308
- } catch {
309
- return null;
310
- }
311
- }
312
294
  function isNoNodeExecError(stderr) {
313
295
  return /env: '?node'?: No such file or directory/.test(stderr) || /'node' is not recognized/.test(stderr);
314
296
  }
@@ -318,7 +300,7 @@ async function managerProbe(mgr) {
318
300
  stdout: "ignore",
319
301
  stderr: "pipe",
320
302
  env: {
321
- ...process.env,
303
+ ...liveEnv(),
322
304
  LC_ALL: "C"
323
305
  }
324
306
  });
@@ -374,11 +356,14 @@ async function installAndVerify(pkg) {
374
356
  ] : null;
375
357
  if (!installer) return null;
376
358
  process.stderr.write(`ay serve install: installing ${pkg}…\n`);
377
- const code = await Bun.spawn(installer, { stdio: [
378
- "ignore",
379
- "inherit",
380
- "inherit"
381
- ] }).exited ?? 1;
359
+ const code = await Bun.spawn(installer, {
360
+ stdio: [
361
+ "ignore",
362
+ "inherit",
363
+ "inherit"
364
+ ],
365
+ env: liveEnv()
366
+ }).exited ?? 1;
382
367
  if (code !== 0) {
383
368
  process.stderr.write(`ay serve install: '${installer.join(" ")}' failed (exit ${code})\n`);
384
369
  return null;
@@ -460,11 +445,14 @@ async function ensureBootAutostart(mgr) {
460
445
  }
461
446
  async function spawnExit(cmd) {
462
447
  try {
463
- return await Bun.spawn(cmd, { stdio: [
464
- "ignore",
465
- "ignore",
466
- "ignore"
467
- ] }).exited ?? 1;
448
+ return await Bun.spawn(cmd, {
449
+ stdio: [
450
+ "ignore",
451
+ "ignore",
452
+ "ignore"
453
+ ],
454
+ env: liveEnv()
455
+ }).exited ?? 1;
468
456
  } catch {
469
457
  return 1;
470
458
  }
@@ -478,7 +466,8 @@ async function readDaemonServeArgs(mgr) {
478
466
  DAEMON_NAME
479
467
  ], {
480
468
  stdout: "pipe",
481
- stderr: "ignore"
469
+ stderr: "ignore",
470
+ env: liveEnv()
482
471
  });
483
472
  const out = await new Response(p.stdout).text();
484
473
  if (await p.exited !== 0) return null;
@@ -489,7 +478,8 @@ async function readDaemonServeArgs(mgr) {
489
478
  }
490
479
  const p = Bun.spawn([mgr.bin, "jlist"], {
491
480
  stdout: "pipe",
492
- stderr: "ignore"
481
+ stderr: "ignore",
482
+ env: liveEnv()
493
483
  });
494
484
  const out = await new Response(p.stdout).text();
495
485
  if (await p.exited !== 0) return null;
@@ -620,11 +610,14 @@ async function cmdServeDaemon(sub, args) {
620
610
  "--",
621
611
  ...managedArgv.slice(1)
622
612
  ];
623
- const code = await Bun.spawn(startArgv, { stdio: [
624
- "ignore",
625
- "inherit",
626
- "inherit"
627
- ] }).exited;
613
+ const code = await Bun.spawn(startArgv, {
614
+ stdio: [
615
+ "ignore",
616
+ "inherit",
617
+ "inherit"
618
+ ],
619
+ env: liveEnv()
620
+ }).exited;
628
621
  if (code === 0) {
629
622
  const onBoot = await ensureBootAutostart(mgr);
630
623
  const port = portFromArgs(effArgs);
@@ -650,11 +643,14 @@ async function cmdServeDaemon(sub, args) {
650
643
  mgr.bin,
651
644
  "delete",
652
645
  DAEMON_NAME
653
- ], { stdio: [
654
- "ignore",
655
- "inherit",
656
- "inherit"
657
- ] }).exited ?? 1;
646
+ ], {
647
+ stdio: [
648
+ "ignore",
649
+ "inherit",
650
+ "inherit"
651
+ ],
652
+ env: liveEnv()
653
+ }).exited ?? 1;
658
654
  if (mgr.id === "pm2" && code === 0) {
659
655
  await spawnExit([mgr.bin, "save"]);
660
656
  if (process.platform === "win32") await spawnExit([
@@ -673,11 +669,14 @@ async function cmdServeDaemon(sub, args) {
673
669
  "logs",
674
670
  DAEMON_NAME,
675
671
  ...args
676
- ], { stdio: [
677
- "ignore",
678
- "inherit",
679
- "inherit"
680
- ] }).exited ?? 1;
672
+ ], {
673
+ stdio: [
674
+ "ignore",
675
+ "inherit",
676
+ "inherit"
677
+ ],
678
+ env: liveEnv()
679
+ }).exited ?? 1;
681
680
  return 1;
682
681
  }
683
682
  async function cmdServeStatus(args) {
@@ -1894,7 +1893,7 @@ Options:
1894
1893
  const perm = body.perm ?? "r";
1895
1894
  if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
1896
1895
  try {
1897
- const { createScopedShare } = await import("./agentShare-C4LxU2xT.js");
1896
+ const { createScopedShare } = await import("./agentShare-B6znJtFD.js");
1898
1897
  const share = await createScopedShare({
1899
1898
  agent: body.agent,
1900
1899
  perm,
@@ -1909,12 +1908,12 @@ Options:
1909
1908
  }
1910
1909
  }
1911
1910
  if (req.method === "GET" && p === "/api/shares") {
1912
- const { listShares } = await import("./agentShare-C4LxU2xT.js");
1911
+ const { listShares } = await import("./agentShare-B6znJtFD.js");
1913
1912
  return Response.json(listShares());
1914
1913
  }
1915
1914
  const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
1916
1915
  if (req.method === "DELETE" && revokeM) {
1917
- const { revokeShare } = await import("./agentShare-C4LxU2xT.js");
1916
+ const { revokeShare } = await import("./agentShare-B6znJtFD.js");
1918
1917
  const ok = revokeShare(decodeURIComponent(revokeM[1]));
1919
1918
  return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
1920
1919
  }
@@ -2095,7 +2094,7 @@ Options:
2095
2094
  const shutdown = (resolve) => {
2096
2095
  if (heartbeat) clearInterval(heartbeat);
2097
2096
  closeShare?.();
2098
- import("./agentShare-C4LxU2xT.js").then((m) => m.revokeAllShares()).catch(() => {});
2097
+ import("./agentShare-B6znJtFD.js").then((m) => m.revokeAllShares()).catch(() => {});
2099
2098
  server?.stop();
2100
2099
  resolve();
2101
2100
  };
@@ -2108,4 +2107,4 @@ Options:
2108
2107
 
2109
2108
  //#endregion
2110
2109
  export { cmdServe };
2111
- //# sourceMappingURL=serve-CSijvUDO.js.map
2110
+ //# sourceMappingURL=serve-BAeHlY-f.js.map
@@ -32,7 +32,7 @@ async function cmdSetup(rest) {
32
32
  if (!existsSync(abs)) process.stderr.write(` note: that directory doesn't exist yet — create it, or agents spawned there will fail\n`);
33
33
  if (noShare) return 0;
34
34
  process.stdout.write(`\nsharing this machine to agent-yes.com…\n`);
35
- const { cmdServe } = await import("./serve-CSijvUDO.js");
35
+ const { cmdServe } = await import("./serve-BAeHlY-f.js");
36
36
  return cmdServe([
37
37
  "install",
38
38
  "--share",
@@ -42,4 +42,4 @@ async function cmdSetup(rest) {
42
42
 
43
43
  //#endregion
44
44
  export { cmdSetup };
45
- //# sourceMappingURL=setup-ChMQrv6t.js.map
45
+ //# sourceMappingURL=setup-C0Lc_Mui.js.map
@@ -1,5 +1,5 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
- import { i as waitForSpawnCapacity, n as spawnGateEnabled, r as spawnRejectionReason, t as memAvailableMb } from "./spawnGate-CA5QD7D4.js";
3
+ import { i as waitForSpawnCapacity, n as spawnGateEnabled, r as spawnRejectionReason, t as memAvailableMb } from "./spawnGate-DRWa_Fzj.js";
4
4
 
5
5
  export { waitForSpawnCapacity };
@@ -104,4 +104,4 @@ async function waitForSpawnCapacity(opts) {
104
104
 
105
105
  //#endregion
106
106
  export { waitForSpawnCapacity as i, spawnGateEnabled as n, spawnRejectionReason as r, memAvailableMb as t };
107
- //# sourceMappingURL=spawnGate-CA5QD7D4.js.map
107
+ //# sourceMappingURL=spawnGate-DRWa_Fzj.js.map
@@ -1,9 +1,9 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
2
  import "./globalPidIndex-CoNr7tS8.js";
3
3
  import "./configShared-0MnIQ652.js";
4
- import { A as renderRawLogLines, B as waitForLogQuiet, C as matchKeyword, D as recentReadEdges, E as readPtysize, F as runSubcommand, H as writeToIpc, I as snapshotStatus, L as stdinActivityPath, M as resolveReadWindow, N as resolveResumeArgs, O as renderLogTailLines, P as restartHintLines, R as stopTipForCli, S as listRecords, T as readNotes, V as writeKeysPaced, _ as isPidAlive, a as cmdHelp, b as isUserTyping, c as deriveLiveState, d as extractMenu, f as extractNeedsInput, g as isExitRequest, h as isAgentStuck, i as backoffWhileTyping, j as resolveOne, k as renderRawLog, l as deriveLiveStatus, m as finalizedLines, n as READ_PAGE_DEFAULT, o as controlCodeFromName, p as extractTaskCounts, r as TYPING_WINDOW_MS, s as cursorAbs, t as GRACEFUL_EXIT_COMMANDS, u as extractBadges, v as isSlashCommand, w as menuSelectKeys, x as lastStdinAt, y as isSubcommand, z as submitAndConfirm } from "./subcommands-DMe0U83W.js";
4
+ import { A as renderRawLogLines, B as waitForLogQuiet, C as matchKeyword, D as recentReadEdges, E as readPtysize, F as runSubcommand, H as writeToIpc, I as snapshotStatus, L as stdinActivityPath, M as resolveReadWindow, N as resolveResumeArgs, O as renderLogTailLines, P as restartHintLines, R as stopTipForCli, S as listRecords, T as readNotes, V as writeKeysPaced, _ as isPidAlive, a as cmdHelp, b as isUserTyping, c as deriveLiveState, d as extractMenu, f as extractNeedsInput, g as isExitRequest, h as isAgentStuck, i as backoffWhileTyping, j as resolveOne, k as renderRawLog, l as deriveLiveStatus, m as finalizedLines, n as READ_PAGE_DEFAULT, o as controlCodeFromName, p as extractTaskCounts, r as TYPING_WINDOW_MS, s as cursorAbs, t as GRACEFUL_EXIT_COMMANDS, u as extractBadges, v as isSlashCommand, w as menuSelectKeys, x as lastStdinAt, y as isSubcommand, z as submitAndConfirm } from "./subcommands-CH7ZKLkx.js";
5
5
  import "./e2e-BeKjLhmO.js";
6
6
  import "./webrtcLink-BG0Xc4-W.js";
7
- import "./remotes-CgT91bMo.js";
7
+ import "./remotes-oSmwSYaV.js";
8
8
 
9
9
  export { cmdHelp, isSubcommand, runSubcommand };
@@ -4,7 +4,7 @@ import { t as agentYesHome } from "./agentYesHome-CtHb5b71.js";
4
4
  import { a as updateGlobalPidStatus, i as readGlobalPids } from "./globalPidIndex-CoNr7tS8.js";
5
5
  import { t as loadSharedCliDefaults } from "./configShared-0MnIQ652.js";
6
6
  import { n as isWebrtcSpec } from "./webrtcLink-BG0Xc4-W.js";
7
- import { a as resolveRemoteSpec, i as readRemotes } from "./remotes-CgT91bMo.js";
7
+ import { a as resolveRemoteSpec, i as readRemotes } from "./remotes-oSmwSYaV.js";
8
8
  import ms from "ms";
9
9
  import yargs from "yargs";
10
10
  import { appendFile, mkdir, open, readFile, readdir, rename, rm, stat, writeFile } from "fs/promises";
@@ -1147,19 +1147,19 @@ async function runSubcommand(argv) {
1147
1147
  case "restart": return await cmdRestart(rest);
1148
1148
  case "note": return await cmdNote(rest);
1149
1149
  case "serve": {
1150
- const { cmdServe } = await import("./serve-CSijvUDO.js");
1150
+ const { cmdServe } = await import("./serve-BAeHlY-f.js");
1151
1151
  return cmdServe(rest);
1152
1152
  }
1153
1153
  case "setup": {
1154
- const { cmdSetup } = await import("./setup-ChMQrv6t.js");
1154
+ const { cmdSetup } = await import("./setup-C0Lc_Mui.js");
1155
1155
  return cmdSetup(rest);
1156
1156
  }
1157
1157
  case "schedule": {
1158
- const { cmdSchedule } = await import("./schedule-AZACZY6R.js");
1158
+ const { cmdSchedule } = await import("./schedule-Dx_x0HRj.js");
1159
1159
  return cmdSchedule(rest);
1160
1160
  }
1161
1161
  case "remote": {
1162
- const { cmdRemote } = await import("./remotes-WVJBNajZ.js");
1162
+ const { cmdRemote } = await import("./remotes-CW-yxSgW.js");
1163
1163
  return cmdRemote(rest);
1164
1164
  }
1165
1165
  case "expose": {
@@ -1556,7 +1556,7 @@ async function fetchRemoteRecordsRaw(url, token, opts) {
1556
1556
  let base = url;
1557
1557
  let bearer = token;
1558
1558
  if (isWebrtcSpec(url)) {
1559
- const { startWebrtcBridge } = await import("./webrtcRemote-CD5EQ3uX.js");
1559
+ const { startWebrtcBridge } = await import("./webrtcRemote-BmuVKcrx.js");
1560
1560
  bridge = await startWebrtcBridge(url);
1561
1561
  base = bridge.baseUrl;
1562
1562
  bearer = bridge.token;
@@ -4004,7 +4004,7 @@ async function cmdNotify(rest) {
4004
4004
  }
4005
4005
  const ensure = async () => {
4006
4006
  if (!argv["ensure-daemon"]) return;
4007
- const { ensureDaemon } = await import("./notifyDaemon--OxBe8nG.js");
4007
+ const { ensureDaemon } = await import("./notifyDaemon-RhUYKA0l.js");
4008
4008
  await ensureDaemon().catch(() => null);
4009
4009
  };
4010
4010
  await heartbeatWatcher(parent, selfStartedAt);
@@ -4078,7 +4078,7 @@ async function cmdNotifyCursor(args) {
4078
4078
  }
4079
4079
  async function cmdNotifyd(rest) {
4080
4080
  const sub = rest[0] ?? "status";
4081
- const daemon = await import("./notifyDaemon--OxBe8nG.js");
4081
+ const daemon = await import("./notifyDaemon-RhUYKA0l.js");
4082
4082
  switch (sub) {
4083
4083
  case "run": return daemon.runDaemon();
4084
4084
  case "once": return daemon.runDaemon({ once: true });
@@ -4105,4 +4105,4 @@ async function cmdNotifyd(rest) {
4105
4105
 
4106
4106
  //#endregion
4107
4107
  export { TYPING_BADGE as $, renderRawLogLines as A, waitForLogQuiet as B, matchKeyword as C, recentReadEdges as D, readPtysize as E, runSubcommand as F, hostId as G, writeToIpc as H, snapshotStatus as I, readInbox as J, listInboxParents as K, stdinActivityPath as L, resolveReadWindow as M, resolveResumeArgs as N, renderLogTailLines as O, restartHintLines as P, notifyDir as Q, stopTipForCli as R, listRecords as S, readNotes as T, appendEvent as U, writeKeysPaced as V, gcInboxes as W, daemonLockDir as X, shouldStealLock as Y, daemonLockOwnerPath as Z, isPidAlive as _, cmdHelp as a, isUserTyping as b, deriveLiveState as c, extractMenu as d, extractNeedsInput as f, isExitRequest as g, isAgentStuck as h, backoffWhileTyping as i, resolveOne as j, renderRawLog as k, deriveLiveStatus as l, finalizedLines as m, READ_PAGE_DEFAULT as n, controlCodeFromName as o, extractTaskCounts as p, liveWatchers as q, TYPING_WINDOW_MS as r, cursorAbs as s, GRACEFUL_EXIT_COMMANDS as t, extractBadges as u, isSlashCommand as v, menuSelectKeys as w, lastStdinAt as x, isSubcommand as y, submitAndConfirm as z };
4108
- //# sourceMappingURL=subcommands-DMe0U83W.js.map
4108
+ //# sourceMappingURL=subcommands-CH7ZKLkx.js.map
@@ -187,4 +187,4 @@ async function startTray() {
187
187
 
188
188
  //#endregion
189
189
  export { ensureTray, startTray };
190
- //# sourceMappingURL=tray-PMOWFOfk.js.map
190
+ //# sourceMappingURL=tray-BKTZ5gIf.js.map
@@ -1,5 +1,5 @@
1
1
  import { n as logger, t as addTransport } from "./logger-CDIsZ-Pp.js";
2
- import { r as getInstalledPackage } from "./versionChecker-CUMd5SWt.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-DzFI7V_S.js";
3
3
  import { t as agentYesHome } from "./agentYesHome-CtHb5b71.js";
4
4
  import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-CNMl13dC.js";
5
5
  import { t as PidStore } from "./pidStore-BIvsBQ8X.js";
@@ -1824,4 +1824,4 @@ function sleep(ms) {
1824
1824
 
1825
1825
  //#endregion
1826
1826
  export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
1827
- //# sourceMappingURL=ts-7XqYx0eW.js.map
1827
+ //# sourceMappingURL=ts-9Wbluc4o.js.map