agent-yes 1.221.3 → 1.222.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.
- package/dist/SUPPORTED_CLIS-DAtTonEf.js +9 -0
- package/dist/{SUPPORTED_CLIS-DS7dTLDz.js → SUPPORTED_CLIS-NO8CNV4I.js} +2 -2
- package/dist/{agentShare-C3w-AFs0.js → agentShare-BAZo8fhy.js} +2 -2
- package/dist/cli.js +4 -4
- package/dist/index.js +2 -2
- package/dist/{notifyDaemon-BH4pPa74.js → notifyDaemon-BWxrF51X.js} +2 -2
- package/dist/{rustBinary-D5e3WNaP.js → rustBinary-bjsIF5tk.js} +2 -2
- package/dist/{schedule-B3H8DmlI.js → schedule-B5mfMpfu.js} +4 -4
- package/dist/{serve-Bgg19iiw.js → serve-DpROr97O.js} +41 -13
- package/dist/{setup-DLTFFeYh.js → setup-CPfb71tO.js} +2 -2
- package/dist/{subcommands-DUQF8xI6.js → subcommands-B9HQUUSg.js} +7 -7
- package/dist/{subcommands-CJIYhLz3.js → subcommands-WdLz72ko.js} +1 -1
- package/dist/{ts-CRMqsIxi.js → ts-CkxkaoIt.js} +2 -2
- package/dist/{versionChecker-WlNdjNVs.js → versionChecker-jVH7G--O.js} +2 -2
- package/dist/{ws-PWBooeAN.js → ws-BpdOyhUQ.js} +2 -2
- package/lab/ui/index.html +57 -0
- package/package.json +1 -1
- package/ts/serve.ts +42 -1
- package/dist/SUPPORTED_CLIS-DXzymjvB.js +0 -9
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./ts-CkxkaoIt.js";
|
|
2
|
+
import "./logger-CDIsZ-Pp.js";
|
|
3
|
+
import "./versionChecker-jVH7G--O.js";
|
|
4
|
+
import "./pidStore-BIvsBQ8X.js";
|
|
5
|
+
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
|
+
import "./messageLog-CxrKJj77.js";
|
|
7
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-NO8CNV4I.js";
|
|
8
|
+
|
|
9
|
+
export { SUPPORTED_CLIS };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { t as CLIS_CONFIG } from "./ts-CkxkaoIt.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-NO8CNV4I.js.map
|
|
@@ -2,7 +2,7 @@ import "./logger-CDIsZ-Pp.js";
|
|
|
2
2
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
3
3
|
import "./messageLog-CxrKJj77.js";
|
|
4
4
|
import "./configShared-aKTg-sa5.js";
|
|
5
|
-
import { M as resolveOne } from "./subcommands-
|
|
5
|
+
import { M as resolveOne } from "./subcommands-B9HQUUSg.js";
|
|
6
6
|
import "./e2e-jb0Hp43q.js";
|
|
7
7
|
import "./webrtcLink-B7REGtK2.js";
|
|
8
8
|
import "./remotes-Cim0dBU7.js";
|
|
@@ -229,4 +229,4 @@ function transformEvent(rawEvent, agentId, forwarded) {
|
|
|
229
229
|
|
|
230
230
|
//#endregion
|
|
231
231
|
export { createScopedShare, listShares, revokeAllShares, revokeShare };
|
|
232
|
-
//# sourceMappingURL=agentShare-
|
|
232
|
+
//# sourceMappingURL=agentShare-BAZo8fhy.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-jVH7G--O.js";
|
|
5
|
+
import { n as getRustBinary } from "./rustBinary-bjsIF5tk.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-WdLz72ko.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-DAtTonEf.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-CkxkaoIt.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-jVH7G--O.js";
|
|
4
4
|
import "./pidStore-BIvsBQ8X.js";
|
|
5
5
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
6
|
import "./messageLog-CxrKJj77.js";
|
|
@@ -2,7 +2,7 @@ import { n as logger } from "./logger-CDIsZ-Pp.js";
|
|
|
2
2
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
3
3
|
import "./messageLog-CxrKJj77.js";
|
|
4
4
|
import "./configShared-aKTg-sa5.js";
|
|
5
|
-
import { $ as daemonLockOwnerPath, G as gcInboxes, J as listInboxParents, K as hostId, Q as daemonLockDir, S as listRecords, W as appendEvent, X as readInbox, Y as liveWatchers, Z as shouldStealLock, _ as isPidAlive, c as deriveLiveState, et as notifyDir, k as renderLogTailLines } from "./subcommands-
|
|
5
|
+
import { $ as daemonLockOwnerPath, G as gcInboxes, J as listInboxParents, K as hostId, Q as daemonLockDir, S as listRecords, W as appendEvent, X as readInbox, Y as liveWatchers, Z as shouldStealLock, _ as isPidAlive, c as deriveLiveState, et as notifyDir, k as renderLogTailLines } from "./subcommands-B9HQUUSg.js";
|
|
6
6
|
import "./e2e-jb0Hp43q.js";
|
|
7
7
|
import "./webrtcLink-B7REGtK2.js";
|
|
8
8
|
import "./remotes-Cim0dBU7.js";
|
|
@@ -589,4 +589,4 @@ async function ensureDaemon() {
|
|
|
589
589
|
|
|
590
590
|
//#endregion
|
|
591
591
|
export { daemonStatus, ensureDaemon, requestDaemonStop, runDaemon };
|
|
592
|
-
//# sourceMappingURL=notifyDaemon-
|
|
592
|
+
//# sourceMappingURL=notifyDaemon-BWxrF51X.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
1
|
+
import { r as getInstalledPackage } from "./versionChecker-jVH7G--O.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-bjsIF5tk.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-CkxkaoIt.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-jVH7G--O.js";
|
|
4
4
|
import "./pidStore-BIvsBQ8X.js";
|
|
5
5
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
6
|
import "./messageLog-CxrKJj77.js";
|
|
7
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-
|
|
7
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-NO8CNV4I.js";
|
|
8
8
|
import { d as resolveSpawnCwd } from "./workspaceConfig-CjaRvTjf.js";
|
|
9
9
|
import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-CwNJuwH5.js";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
@@ -151,4 +151,4 @@ async function cmdSchedule(rest) {
|
|
|
151
151
|
|
|
152
152
|
//#endregion
|
|
153
153
|
export { cmdSchedule };
|
|
154
|
-
//# sourceMappingURL=schedule-
|
|
154
|
+
//# sourceMappingURL=schedule-B5mfMpfu.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-CkxkaoIt.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-jVH7G--O.js";
|
|
4
|
+
import { t as findSpawnHiddenLauncher } from "./rustBinary-bjsIF5tk.js";
|
|
5
5
|
import { t as agentYesHome$1 } from "./agentYesHome-CtHb5b71.js";
|
|
6
6
|
import "./pidStore-BIvsBQ8X.js";
|
|
7
7
|
import { a as updateGlobalPidStatus } from "./globalPidIndex-CoNr7tS8.js";
|
|
8
8
|
import { r as recordInbox } from "./messageLog-CxrKJj77.js";
|
|
9
9
|
import { t as pgidForWrapper } from "./reaper-BUHCyxdF.js";
|
|
10
10
|
import "./configShared-aKTg-sa5.js";
|
|
11
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-
|
|
12
|
-
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, f as extractNeedsInput, j as renderRawLogLines, k as renderLogTailLines, l as deriveLiveStatus, o as controlCodeFromName, p as extractTaskCounts, q as isTransientLockMkdirError, tt as TYPING_BADGE, u as extractBadges } from "./subcommands-
|
|
11
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-NO8CNV4I.js";
|
|
12
|
+
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, f as extractNeedsInput, j as renderRawLogLines, k as renderLogTailLines, l as deriveLiveStatus, o as controlCodeFromName, p as extractTaskCounts, q as isTransientLockMkdirError, tt as TYPING_BADGE, u as extractBadges } from "./subcommands-B9HQUUSg.js";
|
|
13
13
|
import "./e2e-jb0Hp43q.js";
|
|
14
14
|
import "./webrtcLink-B7REGtK2.js";
|
|
15
15
|
import "./remotes-Cim0dBU7.js";
|
|
@@ -17,7 +17,7 @@ import { a as getSpawnHook, c as hasProvisionHook, d as resolveSpawnCwd, i as ge
|
|
|
17
17
|
import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-CwNJuwH5.js";
|
|
18
18
|
import { r as spawnRejectionReason } from "./spawnGate-CXjEz6Pf.js";
|
|
19
19
|
import yargs from "yargs";
|
|
20
|
-
import { mkdir, open, readFile, rename, rm, stat, unlink, writeFile } from "fs/promises";
|
|
20
|
+
import { appendFile, mkdir, open, readFile, rename, rm, stat, unlink, writeFile } from "fs/promises";
|
|
21
21
|
import { arch, cpus, freemem, homedir, hostname, loadavg, platform, totalmem, uptime, userInfo } from "os";
|
|
22
22
|
import path from "path";
|
|
23
23
|
import { execFileSync } from "node:child_process";
|
|
@@ -1987,7 +1987,7 @@ Options:
|
|
|
1987
1987
|
}
|
|
1988
1988
|
});
|
|
1989
1989
|
if (req.method === "GET" && p === "/api/ws") {
|
|
1990
|
-
const ws = await import("./ws-
|
|
1990
|
+
const ws = await import("./ws-BpdOyhUQ.js");
|
|
1991
1991
|
try {
|
|
1992
1992
|
await ws.loadProvision();
|
|
1993
1993
|
} catch (e) {
|
|
@@ -2007,7 +2007,7 @@ Options:
|
|
|
2007
2007
|
if (req.method === "GET" && p === "/api/ws/status") {
|
|
2008
2008
|
const dirRaw = url.searchParams.get("path");
|
|
2009
2009
|
if (!dirRaw) return new Response("missing ?path=<workspace dir>", { status: 400 });
|
|
2010
|
-
const ws = await import("./ws-
|
|
2010
|
+
const ws = await import("./ws-BpdOyhUQ.js");
|
|
2011
2011
|
let prov;
|
|
2012
2012
|
try {
|
|
2013
2013
|
prov = await ws.loadProvision();
|
|
@@ -2345,6 +2345,34 @@ Options:
|
|
|
2345
2345
|
return new Response(e.message, { status: 404 });
|
|
2346
2346
|
}
|
|
2347
2347
|
}
|
|
2348
|
+
if (req.method === "POST" && p === "/api/perf-beacon") {
|
|
2349
|
+
let b;
|
|
2350
|
+
try {
|
|
2351
|
+
b = await req.json();
|
|
2352
|
+
} catch {
|
|
2353
|
+
return new Response("invalid JSON body", { status: 400 });
|
|
2354
|
+
}
|
|
2355
|
+
try {
|
|
2356
|
+
const home = process.env.AGENT_YES_HOME ?? path.join(homedir(), ".agent-yes");
|
|
2357
|
+
const file = path.join(home, "perf-beacons.jsonl");
|
|
2358
|
+
const line = JSON.stringify({
|
|
2359
|
+
t: Date.now(),
|
|
2360
|
+
room: String(b.room ?? "").slice(0, 64),
|
|
2361
|
+
viewer: String(b.viewer ?? "").slice(0, 64),
|
|
2362
|
+
build: String(b.build ?? "").slice(0, 16),
|
|
2363
|
+
ua: String(b.ua ?? "").slice(0, 120),
|
|
2364
|
+
summary: b.summary ?? null
|
|
2365
|
+
});
|
|
2366
|
+
await mkdir(home, { recursive: true });
|
|
2367
|
+
await appendFile(file, line + "\n");
|
|
2368
|
+
const st = await stat(file).catch(() => null);
|
|
2369
|
+
if (st && st.size > 4 * 1024 * 1024) {
|
|
2370
|
+
const txt = await readFile(file, "utf-8");
|
|
2371
|
+
await writeFile(file, txt.slice(Math.floor(txt.length / 2)).replace(/^[^\n]*\n/, ""));
|
|
2372
|
+
}
|
|
2373
|
+
} catch {}
|
|
2374
|
+
return new Response(null, { status: 204 });
|
|
2375
|
+
}
|
|
2348
2376
|
if (req.method === "POST" && p === "/api/presence") {
|
|
2349
2377
|
let b;
|
|
2350
2378
|
try {
|
|
@@ -2568,7 +2596,7 @@ Options:
|
|
|
2568
2596
|
const perm = body.perm ?? "r";
|
|
2569
2597
|
if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
|
|
2570
2598
|
try {
|
|
2571
|
-
const { createScopedShare } = await import("./agentShare-
|
|
2599
|
+
const { createScopedShare } = await import("./agentShare-BAZo8fhy.js");
|
|
2572
2600
|
const share = await createScopedShare({
|
|
2573
2601
|
agent: body.agent,
|
|
2574
2602
|
perm,
|
|
@@ -2583,12 +2611,12 @@ Options:
|
|
|
2583
2611
|
}
|
|
2584
2612
|
}
|
|
2585
2613
|
if (req.method === "GET" && p === "/api/shares") {
|
|
2586
|
-
const { listShares } = await import("./agentShare-
|
|
2614
|
+
const { listShares } = await import("./agentShare-BAZo8fhy.js");
|
|
2587
2615
|
return Response.json(listShares());
|
|
2588
2616
|
}
|
|
2589
2617
|
const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
|
|
2590
2618
|
if (req.method === "DELETE" && revokeM) {
|
|
2591
|
-
const { revokeShare } = await import("./agentShare-
|
|
2619
|
+
const { revokeShare } = await import("./agentShare-BAZo8fhy.js");
|
|
2592
2620
|
const ok = revokeShare(decodeURIComponent(revokeM[1]));
|
|
2593
2621
|
return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
|
|
2594
2622
|
}
|
|
@@ -2821,7 +2849,7 @@ Options:
|
|
|
2821
2849
|
const shutdown = (resolve) => {
|
|
2822
2850
|
if (heartbeat) clearInterval(heartbeat);
|
|
2823
2851
|
closeShare?.();
|
|
2824
|
-
import("./agentShare-
|
|
2852
|
+
import("./agentShare-BAZo8fhy.js").then((m) => m.revokeAllShares()).catch(() => {});
|
|
2825
2853
|
server?.stop();
|
|
2826
2854
|
Promise.resolve(releaseHostLock?.()).catch(() => {}).then(resolve);
|
|
2827
2855
|
};
|
|
@@ -2834,4 +2862,4 @@ Options:
|
|
|
2834
2862
|
|
|
2835
2863
|
//#endregion
|
|
2836
2864
|
export { cmdServe };
|
|
2837
|
-
//# sourceMappingURL=serve-
|
|
2865
|
+
//# sourceMappingURL=serve-DpROr97O.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-DpROr97O.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-CPfb71tO.js.map
|
|
@@ -1237,19 +1237,19 @@ async function runSubcommand(argv) {
|
|
|
1237
1237
|
case "restart": return await cmdRestart(rest);
|
|
1238
1238
|
case "note": return await cmdNote(rest);
|
|
1239
1239
|
case "serve": {
|
|
1240
|
-
const { cmdServe } = await import("./serve-
|
|
1240
|
+
const { cmdServe } = await import("./serve-DpROr97O.js");
|
|
1241
1241
|
return cmdServe(rest);
|
|
1242
1242
|
}
|
|
1243
1243
|
case "setup": {
|
|
1244
|
-
const { cmdSetup } = await import("./setup-
|
|
1244
|
+
const { cmdSetup } = await import("./setup-CPfb71tO.js");
|
|
1245
1245
|
return cmdSetup(rest);
|
|
1246
1246
|
}
|
|
1247
1247
|
case "ws": {
|
|
1248
|
-
const { cmdWs } = await import("./ws-
|
|
1248
|
+
const { cmdWs } = await import("./ws-BpdOyhUQ.js");
|
|
1249
1249
|
return cmdWs(rest);
|
|
1250
1250
|
}
|
|
1251
1251
|
case "schedule": {
|
|
1252
|
-
const { cmdSchedule } = await import("./schedule-
|
|
1252
|
+
const { cmdSchedule } = await import("./schedule-B5mfMpfu.js");
|
|
1253
1253
|
return cmdSchedule(rest);
|
|
1254
1254
|
}
|
|
1255
1255
|
case "remote": {
|
|
@@ -4269,7 +4269,7 @@ async function cmdNotify(rest) {
|
|
|
4269
4269
|
}
|
|
4270
4270
|
const ensure = async () => {
|
|
4271
4271
|
if (!argv["ensure-daemon"]) return;
|
|
4272
|
-
const { ensureDaemon } = await import("./notifyDaemon-
|
|
4272
|
+
const { ensureDaemon } = await import("./notifyDaemon-BWxrF51X.js");
|
|
4273
4273
|
await ensureDaemon().catch(() => null);
|
|
4274
4274
|
};
|
|
4275
4275
|
await heartbeatWatcher(parent, selfStartedAt);
|
|
@@ -4343,7 +4343,7 @@ async function cmdNotifyCursor(args) {
|
|
|
4343
4343
|
}
|
|
4344
4344
|
async function cmdNotifyd(rest) {
|
|
4345
4345
|
const sub = rest[0] ?? "status";
|
|
4346
|
-
const daemon = await import("./notifyDaemon-
|
|
4346
|
+
const daemon = await import("./notifyDaemon-BWxrF51X.js");
|
|
4347
4347
|
switch (sub) {
|
|
4348
4348
|
case "run": return daemon.runDaemon();
|
|
4349
4349
|
case "once": return daemon.runDaemon({ once: true });
|
|
@@ -4370,4 +4370,4 @@ async function cmdNotifyd(rest) {
|
|
|
4370
4370
|
|
|
4371
4371
|
//#endregion
|
|
4372
4372
|
export { daemonLockOwnerPath 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, listInboxParents as J, hostId as K, snapshotStatus as L, resolveOne as M, resolveReadWindow as N, recentReadEdges as O, resolveResumeArgs as P, daemonLockDir as Q, stdinActivityPath as R, listRecords as S, readNotes as T, writeToIpc as U, waitForLogQuiet as V, appendEvent as W, readInbox as X, liveWatchers as Y, shouldStealLock as Z, isPidAlive as _, cmdHelp as a, isUserTyping as b, deriveLiveState as c, extractMenu as d, notifyDir 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, isTransientLockMkdirError as q, TYPING_WINDOW_MS as r, cursorAbs as s, GRACEFUL_EXIT_COMMANDS as t, TYPING_BADGE as tt, extractBadges as u, isSlashCommand as v, menuSelectKeys as w, lastStdinAt as x, isSubcommand as y, stopTipForCli as z };
|
|
4373
|
-
//# sourceMappingURL=subcommands-
|
|
4373
|
+
//# sourceMappingURL=subcommands-B9HQUUSg.js.map
|
|
@@ -2,7 +2,7 @@ import "./logger-CDIsZ-Pp.js";
|
|
|
2
2
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
3
3
|
import "./messageLog-CxrKJj77.js";
|
|
4
4
|
import "./configShared-aKTg-sa5.js";
|
|
5
|
-
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-
|
|
5
|
+
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-B9HQUUSg.js";
|
|
6
6
|
import "./e2e-jb0Hp43q.js";
|
|
7
7
|
import "./webrtcLink-B7REGtK2.js";
|
|
8
8
|
import "./remotes-Cim0dBU7.js";
|
|
@@ -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-jVH7G--O.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";
|
|
@@ -1901,4 +1901,4 @@ function sleep(ms) {
|
|
|
1901
1901
|
|
|
1902
1902
|
//#endregion
|
|
1903
1903
|
export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
|
|
1904
|
-
//# sourceMappingURL=ts-
|
|
1904
|
+
//# sourceMappingURL=ts-CkxkaoIt.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.
|
|
10
|
+
var version = "1.222.0";
|
|
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-jVH7G--O.js.map
|
|
@@ -2,7 +2,7 @@ import "./logger-CDIsZ-Pp.js";
|
|
|
2
2
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
3
3
|
import "./messageLog-CxrKJj77.js";
|
|
4
4
|
import "./configShared-aKTg-sa5.js";
|
|
5
|
-
import { S as listRecords } from "./subcommands-
|
|
5
|
+
import { S as listRecords } from "./subcommands-B9HQUUSg.js";
|
|
6
6
|
import "./e2e-jb0Hp43q.js";
|
|
7
7
|
import "./webrtcLink-B7REGtK2.js";
|
|
8
8
|
import "./remotes-Cim0dBU7.js";
|
|
@@ -418,4 +418,4 @@ async function cmdWs(args) {
|
|
|
418
418
|
|
|
419
419
|
//#endregion
|
|
420
420
|
export { WS_JSON_SCHEMA, cmdWs, collectWorkspaces, isPathInside, loadProvision, workspaceStatus };
|
|
421
|
-
//# sourceMappingURL=ws-
|
|
421
|
+
//# sourceMappingURL=ws-BpdOyhUQ.js.map
|
package/lab/ui/index.html
CHANGED
|
@@ -3224,6 +3224,63 @@
|
|
|
3224
3224
|
// and can change (relay fallback); a light poll keeps every pill honest.
|
|
3225
3225
|
setInterval(refreshConnKinds, 2500);
|
|
3226
3226
|
|
|
3227
|
+
// ---- perf beacon: measured slowness reports itself to the daemon -------
|
|
3228
|
+
// Counterpart of serve.ts /api/perf-beacon. Every minute, summarize the
|
|
3229
|
+
// perf ring rows newer than the last beacon per SOURCE (rtc rows carry
|
|
3230
|
+
// .room); a window with connect.fails or p95(req.end) at/over the slow
|
|
3231
|
+
// threshold POSTs its summary to that source over whatever transport is
|
|
3232
|
+
// already up (local fetch / mux / the room's WebRTC channel). The daemon
|
|
3233
|
+
// appends to ~/.agent-yes/perf-beacons.jsonl — purely local — so a
|
|
3234
|
+
// headless watcher (an agent tailing the file, a cron) learns about a
|
|
3235
|
+
// slow phone or tab WITHOUT driving any browser. Quiet windows send
|
|
3236
|
+
// nothing; older daemons 404 and are ignored.
|
|
3237
|
+
const PERF_BEACON_MS = 60_000;
|
|
3238
|
+
let perfBeaconCursor = Date.now();
|
|
3239
|
+
setInterval(() => {
|
|
3240
|
+
try {
|
|
3241
|
+
const rows = (window.__ayPerf || []).filter((r) => r.t > perfBeaconCursor);
|
|
3242
|
+
if (!rows.length) return;
|
|
3243
|
+
perfBeaconCursor = rows[rows.length - 1].t;
|
|
3244
|
+
const slowMs =
|
|
3245
|
+
(window.__ayPerfReport && window.__ayPerfReport().slowMs) || 300;
|
|
3246
|
+
const byRoom = new Map();
|
|
3247
|
+
for (const r of rows) {
|
|
3248
|
+
const k = r.room || "";
|
|
3249
|
+
if (!byRoom.has(k)) byRoom.set(k, []);
|
|
3250
|
+
byRoom.get(k).push(r);
|
|
3251
|
+
}
|
|
3252
|
+
for (const [room, rs] of byRoom) {
|
|
3253
|
+
const fails = rs.filter((r) => /fail/.test(r.event || "")).length;
|
|
3254
|
+
const ends = rs
|
|
3255
|
+
.filter((r) => r.event === "req.end" && typeof r.ms === "number")
|
|
3256
|
+
.map((r) => r.ms)
|
|
3257
|
+
.sort((a, b) => a - b);
|
|
3258
|
+
const pick = (q) => (ends.length ? ends[Math.floor((ends.length - 1) * q)] : 0);
|
|
3259
|
+
const p95 = pick(0.95);
|
|
3260
|
+
if (!fails && p95 < slowMs) continue; // healthy window — no beacon
|
|
3261
|
+
const s = sources.get(room) || sources.get(LOCAL);
|
|
3262
|
+
if (!s?.tx?.post || s.readonly) continue;
|
|
3263
|
+
s.tx
|
|
3264
|
+
.post("/api/perf-beacon", {
|
|
3265
|
+
room,
|
|
3266
|
+
viewer: myViewerId,
|
|
3267
|
+
build: window.AY_BUILD || "",
|
|
3268
|
+
ua: navigator.userAgent.slice(0, 120),
|
|
3269
|
+
summary: {
|
|
3270
|
+
windowMs: PERF_BEACON_MS,
|
|
3271
|
+
rows: rs.length,
|
|
3272
|
+
fails,
|
|
3273
|
+
reqEnd: { n: ends.length, p50: pick(0.5), p95, max: ends[ends.length - 1] || 0 },
|
|
3274
|
+
slowMs,
|
|
3275
|
+
},
|
|
3276
|
+
})
|
|
3277
|
+
.catch(() => {});
|
|
3278
|
+
}
|
|
3279
|
+
} catch {
|
|
3280
|
+
/* beaconing must never break the console */
|
|
3281
|
+
}
|
|
3282
|
+
}, PERF_BEACON_MS);
|
|
3283
|
+
|
|
3227
3284
|
// ---- live performance HUD (opt-in via the ⋯ menu, hidden by default) -----
|
|
3228
3285
|
// Surfaces the metrics that actually move when the console feels laggy: render
|
|
3229
3286
|
// fps, keystroke throughput (xterm onData), agent output rate (term.write),
|
package/package.json
CHANGED
package/ts/serve.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mkdir, open, readFile, stat, unlink, writeFile } from "fs/promises";
|
|
1
|
+
import { appendFile, mkdir, open, readFile, stat, unlink, writeFile } from "fs/promises";
|
|
2
2
|
import { existsSync, renameSync, watch, writeFileSync } from "node:fs";
|
|
3
3
|
import { execFileSync } from "node:child_process";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
@@ -2983,6 +2983,47 @@ export async function cmdServe(rest: string[]): Promise<number> {
|
|
|
2983
2983
|
|
|
2984
2984
|
// POST /api/presence body {viewer, agent, cols, rows, sel?} — a viewer
|
|
2985
2985
|
// self-reports which agent it's watching + its viewport (agent=null clears).
|
|
2986
|
+
// POST /api/perf-beacon — a viewer that MEASURED slowness reports it here.
|
|
2987
|
+
// The console beacons (60s cadence, only when its window saw connect.fail
|
|
2988
|
+
// or p95 ≥ its slow threshold) over whatever transport it already has —
|
|
2989
|
+
// local fetch, /api/mux, or the room's WebRTC channel — so a slow PHONE
|
|
2990
|
+
// lands in the same place as a slow same-PC tab. Rows append to
|
|
2991
|
+
// <AGENT_YES_HOME>/perf-beacons.jsonl: purely local (no cloud/telemetry
|
|
2992
|
+
// service), and anything headless — an agent tailing the file, a cron —
|
|
2993
|
+
// can watch for slowness without driving a browser. Size-capped by
|
|
2994
|
+
// truncate-to-recent so it can't grow unbounded.
|
|
2995
|
+
if (req.method === "POST" && p === "/api/perf-beacon") {
|
|
2996
|
+
let b: { summary?: unknown; build?: string; ua?: string; room?: string; viewer?: string };
|
|
2997
|
+
try {
|
|
2998
|
+
b = (await req.json()) as typeof b;
|
|
2999
|
+
} catch {
|
|
3000
|
+
return new Response("invalid JSON body", { status: 400 });
|
|
3001
|
+
}
|
|
3002
|
+
try {
|
|
3003
|
+
const home = process.env.AGENT_YES_HOME ?? path.join(homedir(), ".agent-yes");
|
|
3004
|
+
const file = path.join(home, "perf-beacons.jsonl");
|
|
3005
|
+
const line = JSON.stringify({
|
|
3006
|
+
t: Date.now(),
|
|
3007
|
+
room: String(b.room ?? "").slice(0, 64),
|
|
3008
|
+
viewer: String(b.viewer ?? "").slice(0, 64),
|
|
3009
|
+
build: String(b.build ?? "").slice(0, 16),
|
|
3010
|
+
ua: String(b.ua ?? "").slice(0, 120),
|
|
3011
|
+
summary: b.summary ?? null,
|
|
3012
|
+
});
|
|
3013
|
+
await mkdir(home, { recursive: true });
|
|
3014
|
+
await appendFile(file, line + "\n");
|
|
3015
|
+
// cap: keep the newest half once the file passes 4MB
|
|
3016
|
+
const st = await stat(file).catch(() => null);
|
|
3017
|
+
if (st && st.size > 4 * 1024 * 1024) {
|
|
3018
|
+
const txt = await readFile(file, "utf-8");
|
|
3019
|
+
await writeFile(file, txt.slice(Math.floor(txt.length / 2)).replace(/^[^\n]*\n/, ""));
|
|
3020
|
+
}
|
|
3021
|
+
} catch {
|
|
3022
|
+
/* best-effort — a failed beacon write must never error the viewer */
|
|
3023
|
+
}
|
|
3024
|
+
return new Response(null, { status: 204 });
|
|
3025
|
+
}
|
|
3026
|
+
|
|
2986
3027
|
if (req.method === "POST" && p === "/api/presence") {
|
|
2987
3028
|
let b: {
|
|
2988
3029
|
viewer?: string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "./ts-CRMqsIxi.js";
|
|
2
|
-
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-WlNdjNVs.js";
|
|
4
|
-
import "./pidStore-BIvsBQ8X.js";
|
|
5
|
-
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
|
-
import "./messageLog-CxrKJj77.js";
|
|
7
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DS7dTLDz.js";
|
|
8
|
-
|
|
9
|
-
export { SUPPORTED_CLIS };
|