agent-yes 1.196.0 → 1.196.2
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.
- package/dist/SUPPORTED_CLIS-BBTAJQVG.js +8 -0
- package/dist/{SUPPORTED_CLIS-CxLCQtAU.js → SUPPORTED_CLIS-BuiThZSF.js} +2 -2
- package/dist/{agentShare-Bi95Xy0S.js → agentShare-BMZVmm7c.js} +2 -2
- package/dist/cli.js +4 -4
- package/dist/index.js +2 -2
- package/dist/{notifyDaemon-BdOeFIVl.js → notifyDaemon-Cikn_qKr.js} +2 -2
- package/dist/{rustBinary-D_ifX2Vd.js → rustBinary-Uxkcz3zV.js} +2 -2
- package/dist/{schedule-rvMgc0tA.js → schedule-cvu-t8uo.js} +4 -4
- package/dist/{serve-D0-LoTfw.js → serve-Cp9XGHAg.js} +73 -43
- package/dist/{setup-BC1VjTOf.js → setup-onV23tOF.js} +2 -2
- package/dist/{subcommands-Cz8xpc5X.js → subcommands-BReg256R.js} +1 -1
- package/dist/{subcommands-s74ViJcI.js → subcommands-Dwzo0rx_.js} +6 -6
- package/dist/{ts-CP17kUI1.js → ts-ml_9eD1Y.js} +2 -2
- package/dist/{versionChecker-DTssk7cU.js → versionChecker-ufJXjxRK.js} +2 -2
- package/package.json +1 -1
- package/ts/serve.spec.ts +30 -2
- package/ts/serve.ts +72 -21
- package/dist/SUPPORTED_CLIS-Ca2ffDRy.js +0 -8
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./ts-ml_9eD1Y.js";
|
|
2
|
+
import "./logger-CDIsZ-Pp.js";
|
|
3
|
+
import "./versionChecker-ufJXjxRK.js";
|
|
4
|
+
import "./pidStore-BIvsBQ8X.js";
|
|
5
|
+
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BuiThZSF.js";
|
|
7
|
+
|
|
8
|
+
export { SUPPORTED_CLIS };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { t as CLIS_CONFIG } from "./ts-ml_9eD1Y.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-
|
|
8
|
+
//# sourceMappingURL=SUPPORTED_CLIS-BuiThZSF.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./logger-CDIsZ-Pp.js";
|
|
2
2
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
3
3
|
import "./configShared-0MnIQ652.js";
|
|
4
|
-
import { M as resolveOne } from "./subcommands-
|
|
4
|
+
import { M as resolveOne } from "./subcommands-Dwzo0rx_.js";
|
|
5
5
|
import "./e2e-BeKjLhmO.js";
|
|
6
6
|
import "./webrtcLink-BG0Xc4-W.js";
|
|
7
7
|
import "./remotes-oSmwSYaV.js";
|
|
@@ -228,4 +228,4 @@ function transformEvent(rawEvent, agentId, forwarded) {
|
|
|
228
228
|
|
|
229
229
|
//#endregion
|
|
230
230
|
export { createScopedShare, listShares, revokeAllShares, revokeShare };
|
|
231
|
-
//# sourceMappingURL=agentShare-
|
|
231
|
+
//# sourceMappingURL=agentShare-BMZVmm7c.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-
|
|
5
|
-
import { n as getRustBinary } from "./rustBinary-
|
|
4
|
+
import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-ufJXjxRK.js";
|
|
5
|
+
import { n as getRustBinary } from "./rustBinary-Uxkcz3zV.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-
|
|
288
|
+
const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-BReg256R.js");
|
|
289
289
|
if (isHelpFlag && process.argv.length === 3) {
|
|
290
290
|
await cmdHelp(managerCommands);
|
|
291
291
|
process.exit(0);
|
|
@@ -327,7 +327,7 @@ if (config.useRust) {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
if (rustBinary) {
|
|
330
|
-
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-
|
|
330
|
+
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-BBTAJQVG.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-
|
|
1
|
+
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-ml_9eD1Y.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-ufJXjxRK.js";
|
|
4
4
|
import "./pidStore-BIvsBQ8X.js";
|
|
5
5
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
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 { $ as notifyDir, G as gcInboxes, J as liveWatchers, K as hostId, Q as daemonLockOwnerPath, S as listRecords, W as appendEvent, X as shouldStealLock, Y as readInbox, Z as daemonLockDir, _ as isPidAlive, c as deriveLiveState, k as renderLogTailLines, q as listInboxParents } from "./subcommands-
|
|
4
|
+
import { $ as notifyDir, G as gcInboxes, J as liveWatchers, K as hostId, Q as daemonLockOwnerPath, S as listRecords, W as appendEvent, X as shouldStealLock, Y as readInbox, Z as daemonLockDir, _ as isPidAlive, c as deriveLiveState, k as renderLogTailLines, q as listInboxParents } from "./subcommands-Dwzo0rx_.js";
|
|
5
5
|
import "./e2e-BeKjLhmO.js";
|
|
6
6
|
import "./webrtcLink-BG0Xc4-W.js";
|
|
7
7
|
import "./remotes-oSmwSYaV.js";
|
|
@@ -588,4 +588,4 @@ async function ensureDaemon() {
|
|
|
588
588
|
|
|
589
589
|
//#endregion
|
|
590
590
|
export { daemonStatus, ensureDaemon, requestDaemonStop, runDaemon };
|
|
591
|
-
//# sourceMappingURL=notifyDaemon-
|
|
591
|
+
//# sourceMappingURL=notifyDaemon-Cikn_qKr.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
1
|
+
import { r as getInstalledPackage } from "./versionChecker-ufJXjxRK.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-
|
|
228
|
+
//# sourceMappingURL=rustBinary-Uxkcz3zV.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-ml_9eD1Y.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-ufJXjxRK.js";
|
|
4
4
|
import "./pidStore-BIvsBQ8X.js";
|
|
5
5
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-
|
|
6
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BuiThZSF.js";
|
|
7
7
|
import { d as resolveSpawnCwd } from "./workspaceConfig-_GtAZtsi.js";
|
|
8
8
|
import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-DZRjxpNp.js";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
@@ -150,4 +150,4 @@ async function cmdSchedule(rest) {
|
|
|
150
150
|
|
|
151
151
|
//#endregion
|
|
152
152
|
export { cmdSchedule };
|
|
153
|
-
//# sourceMappingURL=schedule-
|
|
153
|
+
//# sourceMappingURL=schedule-cvu-t8uo.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-ml_9eD1Y.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
4
|
-
import { t as findSpawnHiddenLauncher } from "./rustBinary-
|
|
3
|
+
import { r as getInstalledPackage } from "./versionChecker-ufJXjxRK.js";
|
|
4
|
+
import { t as findSpawnHiddenLauncher } from "./rustBinary-Uxkcz3zV.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-
|
|
10
|
-
import { A as renderRawLog, D as recentMessageEdges, E as readPtysize, L as snapshotStatus, M as resolveOne, O as recentReadEdges, S as listRecords, T as readNotes, U as writeToIpc, b as isUserTyping, et as TYPING_BADGE, f as extractNeedsInput, k as renderLogTailLines, l as deriveLiveStatus, o as controlCodeFromName, p as extractTaskCounts, tt as recordInbox, u as extractBadges } from "./subcommands-
|
|
9
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BuiThZSF.js";
|
|
10
|
+
import { A as renderRawLog, D as recentMessageEdges, E as readPtysize, L as snapshotStatus, M as resolveOne, O as recentReadEdges, S as listRecords, T as readNotes, U as writeToIpc, b as isUserTyping, et as TYPING_BADGE, f as extractNeedsInput, k as renderLogTailLines, l as deriveLiveStatus, o as controlCodeFromName, p as extractTaskCounts, tt as recordInbox, u as extractBadges } from "./subcommands-Dwzo0rx_.js";
|
|
11
11
|
import "./e2e-BeKjLhmO.js";
|
|
12
12
|
import "./webrtcLink-BG0Xc4-W.js";
|
|
13
13
|
import "./remotes-oSmwSYaV.js";
|
|
@@ -340,21 +340,26 @@ async function resolveActiveManager() {
|
|
|
340
340
|
}
|
|
341
341
|
return firstRunnable ?? resolveDaemonManager();
|
|
342
342
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
const npm = Bun.which("npm");
|
|
346
|
-
const installer = bun ? [
|
|
343
|
+
function installerArgv(pkg, bun, npm) {
|
|
344
|
+
if (bun) return [
|
|
347
345
|
bun,
|
|
348
346
|
"add",
|
|
349
347
|
"-g",
|
|
348
|
+
...pkg === "oxmgr" ? ["--trust"] : [],
|
|
350
349
|
pkg
|
|
351
|
-
]
|
|
350
|
+
];
|
|
351
|
+
if (npm) return [
|
|
352
352
|
npm,
|
|
353
353
|
"install",
|
|
354
354
|
"-g",
|
|
355
355
|
pkg
|
|
356
|
-
]
|
|
356
|
+
];
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
async function installAndVerify(pkg) {
|
|
360
|
+
const installer = installerArgv(pkg, Bun.which("bun"), Bun.which("npm"));
|
|
357
361
|
if (!installer) return null;
|
|
362
|
+
await ensureNodeRuntime();
|
|
358
363
|
process.stderr.write(`ay serve install: installing ${pkg}…\n`);
|
|
359
364
|
const code = await Bun.spawn(installer, {
|
|
360
365
|
stdio: [
|
|
@@ -520,6 +525,57 @@ async function fetchDaemonVersion(port, token) {
|
|
|
520
525
|
}
|
|
521
526
|
}
|
|
522
527
|
async function cmdServeDaemon(sub, args) {
|
|
528
|
+
if (sub === "uninstall") {
|
|
529
|
+
const present = [];
|
|
530
|
+
const oxmgrBin = Bun.which("oxmgr");
|
|
531
|
+
const pm2Bin = Bun.which("pm2");
|
|
532
|
+
if (oxmgrBin) present.push({
|
|
533
|
+
id: "oxmgr",
|
|
534
|
+
bin: oxmgrBin
|
|
535
|
+
});
|
|
536
|
+
if (pm2Bin) present.push({
|
|
537
|
+
id: "pm2",
|
|
538
|
+
bin: pm2Bin
|
|
539
|
+
});
|
|
540
|
+
let removed = 0;
|
|
541
|
+
let failed = 0;
|
|
542
|
+
for (const m of present) {
|
|
543
|
+
if (!await managerRunnable(m)) continue;
|
|
544
|
+
if (await readDaemonServeArgs(m) === null) continue;
|
|
545
|
+
const code = await Bun.spawn([
|
|
546
|
+
m.bin,
|
|
547
|
+
"delete",
|
|
548
|
+
DAEMON_NAME
|
|
549
|
+
], {
|
|
550
|
+
stdio: [
|
|
551
|
+
"ignore",
|
|
552
|
+
"inherit",
|
|
553
|
+
"inherit"
|
|
554
|
+
],
|
|
555
|
+
env: liveEnv()
|
|
556
|
+
}).exited ?? 1;
|
|
557
|
+
if (code !== 0) {
|
|
558
|
+
failed++;
|
|
559
|
+
process.stderr.write(`ay serve uninstall: ${m.id} delete failed (exit ${code})\n`);
|
|
560
|
+
continue;
|
|
561
|
+
}
|
|
562
|
+
removed++;
|
|
563
|
+
process.stdout.write(`removed '${DAEMON_NAME}' from ${m.id}\n`);
|
|
564
|
+
if (m.id === "pm2") {
|
|
565
|
+
await spawnExit([m.bin, "save"]);
|
|
566
|
+
if (process.platform === "win32") await spawnExit([
|
|
567
|
+
"reg",
|
|
568
|
+
"delete",
|
|
569
|
+
WIN_RUN_KEY,
|
|
570
|
+
"/v",
|
|
571
|
+
WIN_RUN_VALUE,
|
|
572
|
+
"/f"
|
|
573
|
+
]);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
if (removed === 0 && failed === 0) process.stdout.write(`no '${DAEMON_NAME}' daemon registered with any manager\n`);
|
|
577
|
+
return failed ? 1 : 0;
|
|
578
|
+
}
|
|
523
579
|
let mgr = resolveDaemonManager();
|
|
524
580
|
if (mgr && !await managerRunnable(mgr)) {
|
|
525
581
|
process.stderr.write(`ay serve install: ${mgr.id} is on PATH but can't exec here — bootstrapping a working manager…\n`);
|
|
@@ -624,7 +680,7 @@ async function cmdServeDaemon(sub, args) {
|
|
|
624
680
|
const httpish = effArgs.some((a) => a.startsWith("--http") || a.startsWith("--share")) || !effArgs.some((a) => a.startsWith("--webrtc"));
|
|
625
681
|
process.stdout.write(`\n${priorArgs !== null ? `rolled '${DAEMON_NAME}' forward to` : `installed '${DAEMON_NAME}' as a daemon via ${mgr.id} —`} v${current}\n`);
|
|
626
682
|
if (mgr.id === "oxmgr" && process.platform === "win32") process.stdout.write(onBoot ? `start-on-login: enabled (Task Scheduler ONLOGON runs \`oxmgr daemon run\`)\n` : `start-on-login: not registered — run \`oxmgr service install\` to enable\n`);
|
|
627
|
-
else 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`);
|
|
683
|
+
else if (mgr.id === "oxmgr") process.stdout.write(onBoot ? process.platform === "darwin" ? `start-on-boot: enabled (launchd user agent, starts at login)\n` : `start-on-boot: enabled (systemd --user + linger, starts at boot)\n` : process.platform === "darwin" ? `start-on-boot: not registered — run \`oxmgr service install\` to enable\n` : `start-on-boot: not registered — needs a user systemd session; run \`oxmgr service install\` to enable\n`);
|
|
628
684
|
else if (process.platform === "win32") process.stdout.write(onBoot ? `start-on-login: enabled (a HKCU Run entry runs \`pm2 resurrect\`)\n` : `start-on-login: not registered — \`pm2 save\` or the registry write failed\n`);
|
|
629
685
|
else process.stdout.write(onBoot ? `start-on-boot: enabled (pm2 startup registered with the system init)\n` : `start-on-boot: not registered — run \`pm2 startup\` (may need sudo) to enable\n`);
|
|
630
686
|
process.stdout.write(`token: ${token}\n\n`);
|
|
@@ -638,32 +694,6 @@ async function cmdServeDaemon(sub, args) {
|
|
|
638
694
|
}
|
|
639
695
|
return code ?? 1;
|
|
640
696
|
}
|
|
641
|
-
if (sub === "uninstall") {
|
|
642
|
-
const code = await Bun.spawn([
|
|
643
|
-
mgr.bin,
|
|
644
|
-
"delete",
|
|
645
|
-
DAEMON_NAME
|
|
646
|
-
], {
|
|
647
|
-
stdio: [
|
|
648
|
-
"ignore",
|
|
649
|
-
"inherit",
|
|
650
|
-
"inherit"
|
|
651
|
-
],
|
|
652
|
-
env: liveEnv()
|
|
653
|
-
}).exited ?? 1;
|
|
654
|
-
if (mgr.id === "pm2" && code === 0) {
|
|
655
|
-
await spawnExit([mgr.bin, "save"]);
|
|
656
|
-
if (process.platform === "win32") await spawnExit([
|
|
657
|
-
"reg",
|
|
658
|
-
"delete",
|
|
659
|
-
WIN_RUN_KEY,
|
|
660
|
-
"/v",
|
|
661
|
-
WIN_RUN_VALUE,
|
|
662
|
-
"/f"
|
|
663
|
-
]);
|
|
664
|
-
}
|
|
665
|
-
return code;
|
|
666
|
-
}
|
|
667
697
|
if (sub === "logs") return await Bun.spawn([
|
|
668
698
|
mgr.bin,
|
|
669
699
|
"logs",
|
|
@@ -1923,7 +1953,7 @@ Options:
|
|
|
1923
1953
|
const perm = body.perm ?? "r";
|
|
1924
1954
|
if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
|
|
1925
1955
|
try {
|
|
1926
|
-
const { createScopedShare } = await import("./agentShare-
|
|
1956
|
+
const { createScopedShare } = await import("./agentShare-BMZVmm7c.js");
|
|
1927
1957
|
const share = await createScopedShare({
|
|
1928
1958
|
agent: body.agent,
|
|
1929
1959
|
perm,
|
|
@@ -1938,12 +1968,12 @@ Options:
|
|
|
1938
1968
|
}
|
|
1939
1969
|
}
|
|
1940
1970
|
if (req.method === "GET" && p === "/api/shares") {
|
|
1941
|
-
const { listShares } = await import("./agentShare-
|
|
1971
|
+
const { listShares } = await import("./agentShare-BMZVmm7c.js");
|
|
1942
1972
|
return Response.json(listShares());
|
|
1943
1973
|
}
|
|
1944
1974
|
const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
|
|
1945
1975
|
if (req.method === "DELETE" && revokeM) {
|
|
1946
|
-
const { revokeShare } = await import("./agentShare-
|
|
1976
|
+
const { revokeShare } = await import("./agentShare-BMZVmm7c.js");
|
|
1947
1977
|
const ok = revokeShare(decodeURIComponent(revokeM[1]));
|
|
1948
1978
|
return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
|
|
1949
1979
|
}
|
|
@@ -2125,7 +2155,7 @@ Options:
|
|
|
2125
2155
|
const shutdown = (resolve) => {
|
|
2126
2156
|
if (heartbeat) clearInterval(heartbeat);
|
|
2127
2157
|
closeShare?.();
|
|
2128
|
-
import("./agentShare-
|
|
2158
|
+
import("./agentShare-BMZVmm7c.js").then((m) => m.revokeAllShares()).catch(() => {});
|
|
2129
2159
|
server?.stop();
|
|
2130
2160
|
resolve();
|
|
2131
2161
|
};
|
|
@@ -2138,4 +2168,4 @@ Options:
|
|
|
2138
2168
|
|
|
2139
2169
|
//#endregion
|
|
2140
2170
|
export { cmdServe };
|
|
2141
|
-
//# sourceMappingURL=serve-
|
|
2171
|
+
//# sourceMappingURL=serve-Cp9XGHAg.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-
|
|
35
|
+
const { cmdServe } = await import("./serve-Cp9XGHAg.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-
|
|
45
|
+
//# sourceMappingURL=setup-onV23tOF.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./logger-CDIsZ-Pp.js";
|
|
2
2
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
3
3
|
import "./configShared-0MnIQ652.js";
|
|
4
|
-
import { A as renderRawLog, B as submitAndConfirm, C as matchKeyword, D as recentMessageEdges, E as readPtysize, F as restartHintLines, H as writeKeysPaced, I as runSubcommand, L as snapshotStatus, M as resolveOne, N as resolveReadWindow, O as recentReadEdges, P as resolveResumeArgs, R as stdinActivityPath, S as listRecords, T as readNotes, U as writeToIpc, V as waitForLogQuiet, _ 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 renderRawLogLines, k as renderLogTailLines, 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 stopTipForCli } from "./subcommands-
|
|
4
|
+
import { A as renderRawLog, B as submitAndConfirm, C as matchKeyword, D as recentMessageEdges, E as readPtysize, F as restartHintLines, H as writeKeysPaced, I as runSubcommand, L as snapshotStatus, M as resolveOne, N as resolveReadWindow, O as recentReadEdges, P as resolveResumeArgs, R as stdinActivityPath, S as listRecords, T as readNotes, U as writeToIpc, V as waitForLogQuiet, _ 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 renderRawLogLines, k as renderLogTailLines, 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 stopTipForCli } from "./subcommands-Dwzo0rx_.js";
|
|
5
5
|
import "./e2e-BeKjLhmO.js";
|
|
6
6
|
import "./webrtcLink-BG0Xc4-W.js";
|
|
7
7
|
import "./remotes-oSmwSYaV.js";
|
|
@@ -1271,15 +1271,15 @@ async function runSubcommand(argv) {
|
|
|
1271
1271
|
case "restart": return await cmdRestart(rest);
|
|
1272
1272
|
case "note": return await cmdNote(rest);
|
|
1273
1273
|
case "serve": {
|
|
1274
|
-
const { cmdServe } = await import("./serve-
|
|
1274
|
+
const { cmdServe } = await import("./serve-Cp9XGHAg.js");
|
|
1275
1275
|
return cmdServe(rest);
|
|
1276
1276
|
}
|
|
1277
1277
|
case "setup": {
|
|
1278
|
-
const { cmdSetup } = await import("./setup-
|
|
1278
|
+
const { cmdSetup } = await import("./setup-onV23tOF.js");
|
|
1279
1279
|
return cmdSetup(rest);
|
|
1280
1280
|
}
|
|
1281
1281
|
case "schedule": {
|
|
1282
|
-
const { cmdSchedule } = await import("./schedule-
|
|
1282
|
+
const { cmdSchedule } = await import("./schedule-cvu-t8uo.js");
|
|
1283
1283
|
return cmdSchedule(rest);
|
|
1284
1284
|
}
|
|
1285
1285
|
case "remote": {
|
|
@@ -4297,7 +4297,7 @@ async function cmdNotify(rest) {
|
|
|
4297
4297
|
}
|
|
4298
4298
|
const ensure = async () => {
|
|
4299
4299
|
if (!argv["ensure-daemon"]) return;
|
|
4300
|
-
const { ensureDaemon } = await import("./notifyDaemon-
|
|
4300
|
+
const { ensureDaemon } = await import("./notifyDaemon-Cikn_qKr.js");
|
|
4301
4301
|
await ensureDaemon().catch(() => null);
|
|
4302
4302
|
};
|
|
4303
4303
|
await heartbeatWatcher(parent, selfStartedAt);
|
|
@@ -4371,7 +4371,7 @@ async function cmdNotifyCursor(args) {
|
|
|
4371
4371
|
}
|
|
4372
4372
|
async function cmdNotifyd(rest) {
|
|
4373
4373
|
const sub = rest[0] ?? "status";
|
|
4374
|
-
const daemon = await import("./notifyDaemon-
|
|
4374
|
+
const daemon = await import("./notifyDaemon-Cikn_qKr.js");
|
|
4375
4375
|
switch (sub) {
|
|
4376
4376
|
case "run": return daemon.runDaemon();
|
|
4377
4377
|
case "once": return daemon.runDaemon({ once: true });
|
|
@@ -4398,4 +4398,4 @@ async function cmdNotifyd(rest) {
|
|
|
4398
4398
|
|
|
4399
4399
|
//#endregion
|
|
4400
4400
|
export { notifyDir as $, renderRawLog as A, submitAndConfirm as B, matchKeyword as C, recentMessageEdges as D, readPtysize as E, restartHintLines as F, gcInboxes as G, writeKeysPaced as H, runSubcommand as I, liveWatchers as J, hostId as K, snapshotStatus as L, resolveOne as M, resolveReadWindow as N, recentReadEdges as O, resolveResumeArgs as P, daemonLockOwnerPath as Q, stdinActivityPath as R, listRecords as S, readNotes as T, writeToIpc as U, waitForLogQuiet as V, appendEvent as W, shouldStealLock as X, readInbox as Y, daemonLockDir as Z, isPidAlive as _, cmdHelp as a, isUserTyping as b, deriveLiveState as c, extractMenu as d, TYPING_BADGE as et, extractNeedsInput as f, isExitRequest as g, isAgentStuck as h, backoffWhileTyping as i, renderRawLogLines as j, renderLogTailLines as k, deriveLiveStatus as l, finalizedLines as m, READ_PAGE_DEFAULT as n, controlCodeFromName as o, extractTaskCounts as p, listInboxParents as q, TYPING_WINDOW_MS as r, cursorAbs as s, GRACEFUL_EXIT_COMMANDS as t, recordInbox as tt, extractBadges as u, isSlashCommand as v, menuSelectKeys as w, lastStdinAt as x, isSubcommand as y, stopTipForCli as z };
|
|
4401
|
-
//# sourceMappingURL=subcommands-
|
|
4401
|
+
//# sourceMappingURL=subcommands-Dwzo0rx_.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-
|
|
2
|
+
import { r as getInstalledPackage } from "./versionChecker-ufJXjxRK.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-
|
|
1827
|
+
//# sourceMappingURL=ts-ml_9eD1Y.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.196.
|
|
10
|
+
var version = "1.196.2";
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region ts/versionChecker.ts
|
|
@@ -215,4 +215,4 @@ async function displayVersion() {
|
|
|
215
215
|
|
|
216
216
|
//#endregion
|
|
217
217
|
export { versionString as i, displayVersion as n, getInstalledPackage as r, checkAndAutoUpdate as t };
|
|
218
|
-
//# sourceMappingURL=versionChecker-
|
|
218
|
+
//# sourceMappingURL=versionChecker-ufJXjxRK.js.map
|
package/package.json
CHANGED
package/ts/serve.spec.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFile } from "fs/promises";
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
|
-
import { isNoNodeExecError, oxmgrVersionHasWindowsFix } from "./serve.ts";
|
|
3
|
+
import { installerArgv, isNoNodeExecError, oxmgrVersionHasWindowsFix } from "./serve.ts";
|
|
4
4
|
|
|
5
5
|
// Guards the Windows daemon-manager selection: on Windows we only PREFER oxmgr
|
|
6
6
|
// when the installed build carries the daemon-socket-inheritance fix. Stock
|
|
@@ -78,7 +78,7 @@ describe("manager spawns pass a live env snapshot", () => {
|
|
|
78
78
|
// Grab each Bun.spawn(...) call whose argv mentions a manager binary.
|
|
79
79
|
// Capture from the call opening through the options object's closing `})`.
|
|
80
80
|
const calls = src.match(
|
|
81
|
-
/Bun\.spawn\((?:\[[^\]]
|
|
81
|
+
/Bun\.spawn\((?:\[[^\]]*\bm(?:gr)?\.bin[^\]]*\]|startArgv|installer),[\s\S]*?\}\)/g,
|
|
82
82
|
);
|
|
83
83
|
expect(calls?.length).toBeGreaterThanOrEqual(7);
|
|
84
84
|
for (const call of calls!) {
|
|
@@ -90,3 +90,31 @@ describe("manager spawns pass a live env snapshot", () => {
|
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
|
+
|
|
94
|
+
// Guards the oxmgr bootstrap: bun blocks untrusted postinstalls, and oxmgr's
|
|
95
|
+
// native binary only arrives via its postinstall — without --trust the install
|
|
96
|
+
// "succeeds" but leaves a launcher that dies with "oxmgr binary is missing"
|
|
97
|
+
// (the real reason bootstrap used to fall back to pm2 on fresh boxes).
|
|
98
|
+
describe("installerArgv", () => {
|
|
99
|
+
it("trusts oxmgr's postinstall under bun", () => {
|
|
100
|
+
expect(installerArgv("oxmgr", "/x/bun", null)).toEqual([
|
|
101
|
+
"/x/bun",
|
|
102
|
+
"add",
|
|
103
|
+
"-g",
|
|
104
|
+
"--trust",
|
|
105
|
+
"oxmgr",
|
|
106
|
+
]);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("keeps pm2 untrusted under bun (pure JS, no required scripts)", () => {
|
|
110
|
+
expect(installerArgv("pm2", "/x/bun", "/x/npm")).toEqual(["/x/bun", "add", "-g", "pm2"]);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("falls back to npm without a trust flag (npm runs scripts by default)", () => {
|
|
114
|
+
expect(installerArgv("oxmgr", null, "/x/npm")).toEqual(["/x/npm", "install", "-g", "oxmgr"]);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it("returns null with neither installer", () => {
|
|
118
|
+
expect(installerArgv("pm2", null, null)).toBeNull();
|
|
119
|
+
});
|
|
120
|
+
});
|
package/ts/serve.ts
CHANGED
|
@@ -471,16 +471,37 @@ async function resolveActiveManager(): Promise<DaemonManager | null> {
|
|
|
471
471
|
return firstRunnable ?? resolveDaemonManager();
|
|
472
472
|
}
|
|
473
473
|
|
|
474
|
+
// The install command for one PM package. oxmgr gets `--trust` under bun: its
|
|
475
|
+
// native binary arrives via the package's postinstall (scripts/install.js
|
|
476
|
+
// downloads the platform build), and bun BLOCKS lifecycle scripts of untrusted
|
|
477
|
+
// packages by default — which leaves a JS launcher that dies with "oxmgr binary
|
|
478
|
+
// is missing" and was the real reason bootstrap kept falling back to pm2 on
|
|
479
|
+
// fresh boxes. Re-adding with --trust also heals such a blocked install. pm2 is
|
|
480
|
+
// pure JS with no required scripts, so it stays untrusted. npm runs lifecycle
|
|
481
|
+
// scripts by default — no flag needed.
|
|
482
|
+
export function installerArgv(
|
|
483
|
+
pkg: "oxmgr" | "pm2",
|
|
484
|
+
bun: string | null,
|
|
485
|
+
npm: string | null,
|
|
486
|
+
): string[] | null {
|
|
487
|
+
if (bun) return [bun, "add", "-g", ...(pkg === "oxmgr" ? ["--trust"] : []), pkg];
|
|
488
|
+
if (npm) return [npm, "install", "-g", pkg];
|
|
489
|
+
return null;
|
|
490
|
+
}
|
|
491
|
+
|
|
474
492
|
// Install one PM package globally via the SAME JS package manager that installed
|
|
475
493
|
// `ay` (bun preferred, npm fallback — no Rust toolchain required, so a fresh
|
|
476
494
|
// Linux box with only bun from setup.sh works), then confirm the resulting
|
|
477
495
|
// binary actually execs. Returns a runnable manager, or null if the install
|
|
478
496
|
// failed or the binary can't run here (caller then tries the next candidate).
|
|
479
497
|
async function installAndVerify(pkg: "oxmgr" | "pm2"): Promise<DaemonManager | null> {
|
|
480
|
-
const
|
|
481
|
-
const npm = Bun.which("npm");
|
|
482
|
-
const installer = bun ? [bun, "add", "-g", pkg] : npm ? [npm, "install", "-g", pkg] : null;
|
|
498
|
+
const installer = installerArgv(pkg, Bun.which("bun"), Bun.which("npm"));
|
|
483
499
|
if (!installer) return null;
|
|
500
|
+
// The node→bun shim must exist BEFORE the install, not just before the probe:
|
|
501
|
+
// oxmgr's postinstall itself runs `node scripts/install.js` to fetch the
|
|
502
|
+
// native binary, so on a bun-only box a missing shim silently skips the
|
|
503
|
+
// download even when the script is trusted.
|
|
504
|
+
await ensureNodeRuntime();
|
|
484
505
|
process.stderr.write(`ay serve install: installing ${pkg}…\n`);
|
|
485
506
|
const code =
|
|
486
507
|
(await Bun.spawn(installer, {
|
|
@@ -711,6 +732,48 @@ async function fetchDaemonVersion(port: number, token: string): Promise<string |
|
|
|
711
732
|
}
|
|
712
733
|
|
|
713
734
|
async function cmdServeDaemon(sub: string, args: string[]): Promise<number> {
|
|
735
|
+
// Uninstall first, before any manager resolution/bootstrap: it must sweep
|
|
736
|
+
// EVERY present manager, not just the currently-preferred one. After a
|
|
737
|
+
// manager switch (pm2 → oxmgr via the --trust fix) the old manager still
|
|
738
|
+
// holds a live daemon, and asking only the new one leaves that orphan
|
|
739
|
+
// running — two processes then grab the same WebRTC room (seen on sym003).
|
|
740
|
+
// It also must never bootstrap-install a manager just to uninstall.
|
|
741
|
+
if (sub === "uninstall") {
|
|
742
|
+
const present: DaemonManager[] = [];
|
|
743
|
+
const oxmgrBin = Bun.which("oxmgr");
|
|
744
|
+
const pm2Bin = Bun.which("pm2");
|
|
745
|
+
if (oxmgrBin) present.push({ id: "oxmgr", bin: oxmgrBin });
|
|
746
|
+
if (pm2Bin) present.push({ id: "pm2", bin: pm2Bin });
|
|
747
|
+
let removed = 0;
|
|
748
|
+
let failed = 0;
|
|
749
|
+
for (const m of present) {
|
|
750
|
+
if (!(await managerRunnable(m))) continue;
|
|
751
|
+
if ((await readDaemonServeArgs(m)) === null) continue; // not registered here
|
|
752
|
+
const code =
|
|
753
|
+
(await Bun.spawn([m.bin, "delete", DAEMON_NAME], {
|
|
754
|
+
stdio: ["ignore", "inherit", "inherit"],
|
|
755
|
+
env: liveEnv(),
|
|
756
|
+
}).exited) ?? 1;
|
|
757
|
+
if (code !== 0) {
|
|
758
|
+
failed++;
|
|
759
|
+
process.stderr.write(`ay serve uninstall: ${m.id} delete failed (exit ${code})\n`);
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
removed++;
|
|
763
|
+
process.stdout.write(`removed '${DAEMON_NAME}' from ${m.id}\n`);
|
|
764
|
+
if (m.id === "pm2") {
|
|
765
|
+
// Drop it from the persisted pm2 list too, so `pm2 resurrect` won't revive it.
|
|
766
|
+
await spawnExit([m.bin, "save"]);
|
|
767
|
+
// Remove the Windows login auto-start entry we added at install time.
|
|
768
|
+
if (process.platform === "win32")
|
|
769
|
+
await spawnExit(["reg", "delete", WIN_RUN_KEY, "/v", WIN_RUN_VALUE, "/f"]);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
if (removed === 0 && failed === 0)
|
|
773
|
+
process.stdout.write(`no '${DAEMON_NAME}' daemon registered with any manager\n`);
|
|
774
|
+
return failed ? 1 : 0;
|
|
775
|
+
}
|
|
776
|
+
|
|
714
777
|
// Prefer an already-installed manager — but only if it actually execs. A
|
|
715
778
|
// glibc-incompatible oxmgr (Debian 12: GLIBC_2.39 not found) can sit on PATH
|
|
716
779
|
// yet be unusable; treat it as absent so we bootstrap a working one instead of
|
|
@@ -907,8 +970,12 @@ async function cmdServeDaemon(sub: string, args: string[]): Promise<number> {
|
|
|
907
970
|
else if (mgr.id === "oxmgr")
|
|
908
971
|
process.stdout.write(
|
|
909
972
|
onBoot
|
|
910
|
-
?
|
|
911
|
-
|
|
973
|
+
? process.platform === "darwin"
|
|
974
|
+
? `start-on-boot: enabled (launchd user agent, starts at login)\n`
|
|
975
|
+
: `start-on-boot: enabled (systemd --user + linger, starts at boot)\n`
|
|
976
|
+
: process.platform === "darwin"
|
|
977
|
+
? `start-on-boot: not registered — run \`oxmgr service install\` to enable\n`
|
|
978
|
+
: `start-on-boot: not registered — needs a user systemd session; run \`oxmgr service install\` to enable\n`,
|
|
912
979
|
);
|
|
913
980
|
else if (process.platform === "win32")
|
|
914
981
|
process.stdout.write(
|
|
@@ -934,22 +1001,6 @@ async function cmdServeDaemon(sub: string, args: string[]): Promise<number> {
|
|
|
934
1001
|
return code ?? 1;
|
|
935
1002
|
}
|
|
936
1003
|
|
|
937
|
-
if (sub === "uninstall") {
|
|
938
|
-
const proc = Bun.spawn([mgr.bin, "delete", DAEMON_NAME], {
|
|
939
|
-
stdio: ["ignore", "inherit", "inherit"],
|
|
940
|
-
env: liveEnv(),
|
|
941
|
-
});
|
|
942
|
-
const code = (await proc.exited) ?? 1;
|
|
943
|
-
if (mgr.id === "pm2" && code === 0) {
|
|
944
|
-
// Drop it from the persisted pm2 list too, so `pm2 resurrect` won't revive it.
|
|
945
|
-
await spawnExit([mgr.bin, "save"]);
|
|
946
|
-
// Remove the Windows login auto-start entry we added at install time.
|
|
947
|
-
if (process.platform === "win32")
|
|
948
|
-
await spawnExit(["reg", "delete", WIN_RUN_KEY, "/v", WIN_RUN_VALUE, "/f"]);
|
|
949
|
-
}
|
|
950
|
-
return code;
|
|
951
|
-
}
|
|
952
|
-
|
|
953
1004
|
if (sub === "logs") {
|
|
954
1005
|
const proc = Bun.spawn([mgr.bin, "logs", DAEMON_NAME, ...args], {
|
|
955
1006
|
stdio: ["ignore", "inherit", "inherit"],
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import "./ts-CP17kUI1.js";
|
|
2
|
-
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-DTssk7cU.js";
|
|
4
|
-
import "./pidStore-BIvsBQ8X.js";
|
|
5
|
-
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CxLCQtAU.js";
|
|
7
|
-
|
|
8
|
-
export { SUPPORTED_CLIS };
|