agent-yes 1.177.3 → 1.179.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-HqRiNZTN.js → SUPPORTED_CLIS-Lx4_UKX2.js} +2 -2
- package/dist/SUPPORTED_CLIS-f_pXE42d.js +8 -0
- package/dist/{agentShare-aGYbqc3C.js → agentShare-DYQgfwK-.js} +2 -2
- package/dist/cli.js +4 -4
- package/dist/index.js +2 -2
- package/dist/{notifyDaemon-CgvMP8jE.js → notifyDaemon-DUFWVXE_.js} +2 -2
- package/dist/{rustBinary-Debn0Aks.js → rustBinary-BZVl-irH.js} +2 -2
- package/dist/{schedule-gkLUdn9f.js → schedule-7TtW1VLI.js} +4 -4
- package/dist/{serve-DSxebHP8.js → serve-CJQoN_zp.js} +136 -10
- package/dist/{setup-6hzNooaJ.js → setup-CDhPQcZd.js} +2 -2
- package/dist/{subcommands-BpeOn_YE.js → subcommands-BfOS62aw.js} +1 -1
- package/dist/{subcommands-BwjcLKP-.js → subcommands-By_1Mwch.js} +6 -6
- package/dist/{ts-CMv9I9mN.js → ts-Dp71mzdg.js} +2 -2
- package/dist/{versionChecker-JwWyeRyM.js → versionChecker-CwY3UG2F.js} +2 -2
- package/package.json +1 -1
- package/ts/serve.ts +116 -0
- package/dist/SUPPORTED_CLIS-CQQOIxMn.js +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { t as CLIS_CONFIG } from "./ts-Dp71mzdg.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-Lx4_UKX2.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./ts-Dp71mzdg.js";
|
|
2
|
+
import "./logger-CDIsZ-Pp.js";
|
|
3
|
+
import "./versionChecker-CwY3UG2F.js";
|
|
4
|
+
import "./pidStore-BIvsBQ8X.js";
|
|
5
|
+
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-Lx4_UKX2.js";
|
|
7
|
+
|
|
8
|
+
export { SUPPORTED_CLIS };
|
|
@@ -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 { j as resolveOne } from "./subcommands-
|
|
4
|
+
import { j as resolveOne } from "./subcommands-By_1Mwch.js";
|
|
5
5
|
import "./e2e-BeKjLhmO.js";
|
|
6
6
|
import "./webrtcLink-BG0Xc4-W.js";
|
|
7
7
|
import "./remotes-DsTnQhyx.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-DYQgfwK-.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-CwY3UG2F.js";
|
|
5
|
+
import { n as getRustBinary } from "./rustBinary-BZVl-irH.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-BfOS62aw.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-f_pXE42d.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-Dp71mzdg.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-CwY3UG2F.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 { 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-
|
|
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-By_1Mwch.js";
|
|
5
5
|
import "./e2e-BeKjLhmO.js";
|
|
6
6
|
import "./webrtcLink-BG0Xc4-W.js";
|
|
7
7
|
import "./remotes-DsTnQhyx.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-DUFWVXE_.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
1
|
+
import { r as getInstalledPackage } from "./versionChecker-CwY3UG2F.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-BZVl-irH.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-Dp71mzdg.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-CwY3UG2F.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-Lx4_UKX2.js";
|
|
7
7
|
import { d as resolveSpawnCwd } from "./workspaceConfig-DKd6UvVm.js";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
|
|
@@ -141,4 +141,4 @@ async function cmdSchedule(rest) {
|
|
|
141
141
|
|
|
142
142
|
//#endregion
|
|
143
143
|
export { cmdSchedule };
|
|
144
|
-
//# sourceMappingURL=schedule-
|
|
144
|
+
//# sourceMappingURL=schedule-7TtW1VLI.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-Dp71mzdg.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-CwY3UG2F.js";
|
|
4
|
+
import { t as findSpawnHiddenLauncher } from "./rustBinary-BZVl-irH.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 { $ as TYPING_BADGE, D as recentReadEdges, E as readPtysize, H as writeToIpc, I as snapshotStatus, 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-
|
|
9
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-Lx4_UKX2.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-By_1Mwch.js";
|
|
11
11
|
import "./e2e-BeKjLhmO.js";
|
|
12
12
|
import "./webrtcLink-BG0Xc4-W.js";
|
|
13
13
|
import "./remotes-DsTnQhyx.js";
|
|
@@ -781,6 +781,26 @@ Options:
|
|
|
781
781
|
return null;
|
|
782
782
|
}
|
|
783
783
|
};
|
|
784
|
+
const previewCache = /* @__PURE__ */ new Map();
|
|
785
|
+
const SECRETISH = /(api[-_]?key|secret|token|password|passwd|bearer|authorization|private[-_]?key)\s*[=:]/i;
|
|
786
|
+
const logPreviewLines = async (logFile) => {
|
|
787
|
+
if (!logFile) return null;
|
|
788
|
+
try {
|
|
789
|
+
const { size, mtimeMs } = await stat(logFile);
|
|
790
|
+
const hit = previewCache.get(logFile);
|
|
791
|
+
if (hit && hit.size === size && hit.mtimeMs === mtimeMs) return hit.lines;
|
|
792
|
+
const lines = (await renderLogTailLines(logFile, 12))?.map((ln) => SECRETISH.test(ln) ? "···" : ln.replace(/[A-Za-z0-9+/_-]{40,}/g, "····").slice(0, 160)) ?? null;
|
|
793
|
+
while (lines?.length && !lines[lines.length - 1].trim()) lines.pop();
|
|
794
|
+
previewCache.set(logFile, {
|
|
795
|
+
size,
|
|
796
|
+
mtimeMs,
|
|
797
|
+
lines
|
|
798
|
+
});
|
|
799
|
+
return lines;
|
|
800
|
+
} catch {
|
|
801
|
+
return null;
|
|
802
|
+
}
|
|
803
|
+
};
|
|
784
804
|
const taskCache = /* @__PURE__ */ new Map();
|
|
785
805
|
const logTasks = async (logFile) => {
|
|
786
806
|
if (!logFile) return null;
|
|
@@ -1078,6 +1098,112 @@ Options:
|
|
|
1078
1098
|
} catch (e) {
|
|
1079
1099
|
return new Response(e.message, { status: 500 });
|
|
1080
1100
|
}
|
|
1101
|
+
if (req.method === "GET" && p === "/api/graph") try {
|
|
1102
|
+
const records = await listRecords(void 0, defaultOpts());
|
|
1103
|
+
const origin = hostname();
|
|
1104
|
+
const ns = `ay://${origin}`;
|
|
1105
|
+
const textIn = {
|
|
1106
|
+
id: "text-in",
|
|
1107
|
+
label: "text",
|
|
1108
|
+
kind: "text"
|
|
1109
|
+
};
|
|
1110
|
+
const textOut = {
|
|
1111
|
+
id: "text-out",
|
|
1112
|
+
label: "text",
|
|
1113
|
+
kind: "text"
|
|
1114
|
+
};
|
|
1115
|
+
const byWrapper = new Map(records.map((r) => [r.wrapper_pid ?? r.pid, r.pid]));
|
|
1116
|
+
const nid = (pid) => `${ns}/${pid}`;
|
|
1117
|
+
const previewOf = async (r) => {
|
|
1118
|
+
const lines = await logPreviewLines(r.log_file);
|
|
1119
|
+
if (!lines?.length) return void 0;
|
|
1120
|
+
return { preview: {
|
|
1121
|
+
kind: "terminal",
|
|
1122
|
+
title: await logTitle(r.log_file) ?? `${r.cli} #${r.pid}`,
|
|
1123
|
+
status: r.status,
|
|
1124
|
+
lines
|
|
1125
|
+
} };
|
|
1126
|
+
};
|
|
1127
|
+
const nodes = await Promise.all(records.map(async (r, i) => ({
|
|
1128
|
+
id: nid(r.pid),
|
|
1129
|
+
app: "agent-yes",
|
|
1130
|
+
type: `${r.cli}-agent`,
|
|
1131
|
+
title: `${r.cli} #${r.pid}`,
|
|
1132
|
+
category: "agent-yes",
|
|
1133
|
+
owner: `agent-yes:${origin}`,
|
|
1134
|
+
status: r.status,
|
|
1135
|
+
parent: r.parent_pid && byWrapper.has(r.parent_pid) ? nid(byWrapper.get(r.parent_pid)) : void 0,
|
|
1136
|
+
pos: {
|
|
1137
|
+
x: i % 8 * 320,
|
|
1138
|
+
y: Math.floor(i / 8) * 200
|
|
1139
|
+
},
|
|
1140
|
+
size: {
|
|
1141
|
+
w: 256,
|
|
1142
|
+
h: 128
|
|
1143
|
+
},
|
|
1144
|
+
inputs: [textIn],
|
|
1145
|
+
outputs: [textOut],
|
|
1146
|
+
renderHints: await previewOf(r)
|
|
1147
|
+
})));
|
|
1148
|
+
const codex = records.filter((r) => r.cli === "codex").sort((a, b) => (b.last_active_at ?? 0) - (a.last_active_at ?? 0))[0];
|
|
1149
|
+
nodes.push({
|
|
1150
|
+
id: "ay://agent-yes/codex-agent",
|
|
1151
|
+
app: "agent-yes",
|
|
1152
|
+
type: "codex-agent",
|
|
1153
|
+
title: "Codex Agent",
|
|
1154
|
+
category: "agent-yes",
|
|
1155
|
+
owner: `agent-yes:${origin}`,
|
|
1156
|
+
status: codex?.status ?? "offline",
|
|
1157
|
+
parent: void 0,
|
|
1158
|
+
pos: {
|
|
1159
|
+
x: 0,
|
|
1160
|
+
y: -240
|
|
1161
|
+
},
|
|
1162
|
+
size: {
|
|
1163
|
+
w: 256,
|
|
1164
|
+
h: 128
|
|
1165
|
+
},
|
|
1166
|
+
inputs: [textIn],
|
|
1167
|
+
outputs: [textOut],
|
|
1168
|
+
renderHints: codex ? await previewOf(codex) : void 0
|
|
1169
|
+
});
|
|
1170
|
+
const present = new Set(nodes.map((n) => n.id));
|
|
1171
|
+
const edges = (await recentReadEdges()).filter((e) => e.by !== e.target && present.has(nid(e.target)) && present.has(nid(e.by))).map((e) => ({
|
|
1172
|
+
source: {
|
|
1173
|
+
node: nid(e.target),
|
|
1174
|
+
port: "text-out",
|
|
1175
|
+
type: "text"
|
|
1176
|
+
},
|
|
1177
|
+
target: {
|
|
1178
|
+
node: nid(e.by),
|
|
1179
|
+
port: "text-in",
|
|
1180
|
+
type: "text"
|
|
1181
|
+
},
|
|
1182
|
+
status: "readonly",
|
|
1183
|
+
label: "reads"
|
|
1184
|
+
}));
|
|
1185
|
+
return Response.json({
|
|
1186
|
+
kind: "rgui-federated-graph",
|
|
1187
|
+
schema: "org.rgui.graph.v1",
|
|
1188
|
+
producer: {
|
|
1189
|
+
app: "agent-yes",
|
|
1190
|
+
origin,
|
|
1191
|
+
label: `agent-yes fleet @ ${origin}`
|
|
1192
|
+
},
|
|
1193
|
+
revision: Date.now(),
|
|
1194
|
+
ts: Date.now(),
|
|
1195
|
+
graph: {
|
|
1196
|
+
nodes,
|
|
1197
|
+
edges
|
|
1198
|
+
},
|
|
1199
|
+
capabilities: {
|
|
1200
|
+
nodeTypes: [...new Set(nodes.map((n) => n.type))],
|
|
1201
|
+
portTypes: ["text"]
|
|
1202
|
+
}
|
|
1203
|
+
}, { headers: { "Access-Control-Allow-Origin": "*" } });
|
|
1204
|
+
} catch (e) {
|
|
1205
|
+
return new Response(e.message, { status: 500 });
|
|
1206
|
+
}
|
|
1081
1207
|
if (req.method === "GET" && p === "/api/whoami") {
|
|
1082
1208
|
let user = "";
|
|
1083
1209
|
try {
|
|
@@ -1605,7 +1731,7 @@ Options:
|
|
|
1605
1731
|
const perm = body.perm ?? "r";
|
|
1606
1732
|
if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
|
|
1607
1733
|
try {
|
|
1608
|
-
const { createScopedShare } = await import("./agentShare-
|
|
1734
|
+
const { createScopedShare } = await import("./agentShare-DYQgfwK-.js");
|
|
1609
1735
|
const share = await createScopedShare({
|
|
1610
1736
|
agent: body.agent,
|
|
1611
1737
|
perm,
|
|
@@ -1620,12 +1746,12 @@ Options:
|
|
|
1620
1746
|
}
|
|
1621
1747
|
}
|
|
1622
1748
|
if (req.method === "GET" && p === "/api/shares") {
|
|
1623
|
-
const { listShares } = await import("./agentShare-
|
|
1749
|
+
const { listShares } = await import("./agentShare-DYQgfwK-.js");
|
|
1624
1750
|
return Response.json(listShares());
|
|
1625
1751
|
}
|
|
1626
1752
|
const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
|
|
1627
1753
|
if (req.method === "DELETE" && revokeM) {
|
|
1628
|
-
const { revokeShare } = await import("./agentShare-
|
|
1754
|
+
const { revokeShare } = await import("./agentShare-DYQgfwK-.js");
|
|
1629
1755
|
const ok = revokeShare(decodeURIComponent(revokeM[1]));
|
|
1630
1756
|
return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
|
|
1631
1757
|
}
|
|
@@ -1765,7 +1891,7 @@ Options:
|
|
|
1765
1891
|
const shutdown = (resolve) => {
|
|
1766
1892
|
if (heartbeat) clearInterval(heartbeat);
|
|
1767
1893
|
closeShare?.();
|
|
1768
|
-
import("./agentShare-
|
|
1894
|
+
import("./agentShare-DYQgfwK-.js").then((m) => m.revokeAllShares()).catch(() => {});
|
|
1769
1895
|
server?.stop();
|
|
1770
1896
|
resolve();
|
|
1771
1897
|
};
|
|
@@ -1778,4 +1904,4 @@ Options:
|
|
|
1778
1904
|
|
|
1779
1905
|
//#endregion
|
|
1780
1906
|
export { cmdServe };
|
|
1781
|
-
//# sourceMappingURL=serve-
|
|
1907
|
+
//# sourceMappingURL=serve-CJQoN_zp.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-CJQoN_zp.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-CDhPQcZd.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 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-
|
|
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-By_1Mwch.js";
|
|
5
5
|
import "./e2e-BeKjLhmO.js";
|
|
6
6
|
import "./webrtcLink-BG0Xc4-W.js";
|
|
7
7
|
import "./remotes-DsTnQhyx.js";
|
|
@@ -1145,15 +1145,15 @@ async function runSubcommand(argv) {
|
|
|
1145
1145
|
case "restart": return await cmdRestart(rest);
|
|
1146
1146
|
case "note": return await cmdNote(rest);
|
|
1147
1147
|
case "serve": {
|
|
1148
|
-
const { cmdServe } = await import("./serve-
|
|
1148
|
+
const { cmdServe } = await import("./serve-CJQoN_zp.js");
|
|
1149
1149
|
return cmdServe(rest);
|
|
1150
1150
|
}
|
|
1151
1151
|
case "setup": {
|
|
1152
|
-
const { cmdSetup } = await import("./setup-
|
|
1152
|
+
const { cmdSetup } = await import("./setup-CDhPQcZd.js");
|
|
1153
1153
|
return cmdSetup(rest);
|
|
1154
1154
|
}
|
|
1155
1155
|
case "schedule": {
|
|
1156
|
-
const { cmdSchedule } = await import("./schedule-
|
|
1156
|
+
const { cmdSchedule } = await import("./schedule-7TtW1VLI.js");
|
|
1157
1157
|
return cmdSchedule(rest);
|
|
1158
1158
|
}
|
|
1159
1159
|
case "remote": {
|
|
@@ -3991,7 +3991,7 @@ async function cmdNotify(rest) {
|
|
|
3991
3991
|
}
|
|
3992
3992
|
const ensure = async () => {
|
|
3993
3993
|
if (!argv["ensure-daemon"]) return;
|
|
3994
|
-
const { ensureDaemon } = await import("./notifyDaemon-
|
|
3994
|
+
const { ensureDaemon } = await import("./notifyDaemon-DUFWVXE_.js");
|
|
3995
3995
|
await ensureDaemon().catch(() => null);
|
|
3996
3996
|
};
|
|
3997
3997
|
await heartbeatWatcher(parent, selfStartedAt);
|
|
@@ -4065,7 +4065,7 @@ async function cmdNotifyCursor(args) {
|
|
|
4065
4065
|
}
|
|
4066
4066
|
async function cmdNotifyd(rest) {
|
|
4067
4067
|
const sub = rest[0] ?? "status";
|
|
4068
|
-
const daemon = await import("./notifyDaemon-
|
|
4068
|
+
const daemon = await import("./notifyDaemon-DUFWVXE_.js");
|
|
4069
4069
|
switch (sub) {
|
|
4070
4070
|
case "run": return daemon.runDaemon();
|
|
4071
4071
|
case "once": return daemon.runDaemon({ once: true });
|
|
@@ -4092,4 +4092,4 @@ async function cmdNotifyd(rest) {
|
|
|
4092
4092
|
|
|
4093
4093
|
//#endregion
|
|
4094
4094
|
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 };
|
|
4095
|
-
//# sourceMappingURL=subcommands-
|
|
4095
|
+
//# sourceMappingURL=subcommands-By_1Mwch.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-CwY3UG2F.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-Dp71mzdg.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.179.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-CwY3UG2F.js.map
|
package/package.json
CHANGED
package/ts/serve.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
readNotes,
|
|
18
18
|
readPtysize,
|
|
19
19
|
recentReadEdges,
|
|
20
|
+
renderLogTailLines,
|
|
20
21
|
renderRawLog,
|
|
21
22
|
resolveOne,
|
|
22
23
|
snapshotStatus,
|
|
@@ -1139,6 +1140,33 @@ export async function cmdServe(rest: string[]): Promise<number> {
|
|
|
1139
1140
|
}
|
|
1140
1141
|
};
|
|
1141
1142
|
|
|
1143
|
+
// Per-agent federated terminal preview: last ~12 rendered TUI lines for the
|
|
1144
|
+
// /api/graph feed's renderHints.preview (rgui draws them as a real TUI card —
|
|
1145
|
+
// see lib/rgui src/render/terminalPreview.ts). Cached per (size, mtime) like
|
|
1146
|
+
// logTitle so a 5s feed poll over a big fleet stays cheap. Coarse redaction at
|
|
1147
|
+
// the SOURCE: secret-shaped lines are dropped to "···" and long credential-ish
|
|
1148
|
+
// blobs masked — the feed is token-gated, but tails travel to other rgui hosts.
|
|
1149
|
+
const previewCache = new Map<string, { size: number; mtimeMs: number; lines: string[] | null }>();
|
|
1150
|
+
const SECRETISH = /(api[-_]?key|secret|token|password|passwd|bearer|authorization|private[-_]?key)\s*[=:]/i;
|
|
1151
|
+
const logPreviewLines = async (logFile: string | null | undefined): Promise<string[] | null> => {
|
|
1152
|
+
if (!logFile) return null;
|
|
1153
|
+
try {
|
|
1154
|
+
const { size, mtimeMs } = await stat(logFile);
|
|
1155
|
+
const hit = previewCache.get(logFile);
|
|
1156
|
+
if (hit && hit.size === size && hit.mtimeMs === mtimeMs) return hit.lines;
|
|
1157
|
+
const raw = await renderLogTailLines(logFile, 12);
|
|
1158
|
+
const lines =
|
|
1159
|
+
raw?.map((ln) =>
|
|
1160
|
+
SECRETISH.test(ln) ? "···" : ln.replace(/[A-Za-z0-9+/_-]{40,}/g, "····").slice(0, 160),
|
|
1161
|
+
) ?? null;
|
|
1162
|
+
while (lines?.length && !lines[lines.length - 1]!.trim()) lines.pop();
|
|
1163
|
+
previewCache.set(logFile, { size, mtimeMs, lines });
|
|
1164
|
+
return lines;
|
|
1165
|
+
} catch {
|
|
1166
|
+
return null;
|
|
1167
|
+
}
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1142
1170
|
// Per-agent task progress ({done,total}) parsed from the agent's rendered TUI
|
|
1143
1171
|
// screen (the durable raw log). Cached per (size, mtime) exactly like logTitle:
|
|
1144
1172
|
// re-parse only when the log grew, so the 1s tick stays cheap even though each
|
|
@@ -1600,6 +1628,94 @@ export async function cmdServe(rest: string[]): Promise<number> {
|
|
|
1600
1628
|
}
|
|
1601
1629
|
}
|
|
1602
1630
|
|
|
1631
|
+
// GET /api/graph — the fleet as a read-only federated rgui graph envelope
|
|
1632
|
+
// (org.rgui.graph.v1 — see lib/rgui src/core/federation.ts) so other rgui
|
|
1633
|
+
// hosts (otoji.org etc.) can mirror it. A REDACTED projection of /api/ls:
|
|
1634
|
+
// pid, cli type, status and the parent/subagent shape only — no cwd, prompt,
|
|
1635
|
+
// question, or terminal bytes ever leave through this route. CORS-open on
|
|
1636
|
+
// purpose: read-only + redacted, and the serve token still gates it like
|
|
1637
|
+
// every /api route (hand out the feed URL with ?token=). The newest codex
|
|
1638
|
+
// agent is ALSO exposed under the shared demo-chain id
|
|
1639
|
+
// ay://agent-yes/codex-agent so cross-system edges have a stable target.
|
|
1640
|
+
if (req.method === "GET" && p === "/api/graph") {
|
|
1641
|
+
try {
|
|
1642
|
+
const records = await listRecords(undefined, defaultOpts());
|
|
1643
|
+
const origin = hostname();
|
|
1644
|
+
const ns = `ay://${origin}`;
|
|
1645
|
+
const textIn = { id: "text-in", label: "text", kind: "text" };
|
|
1646
|
+
const textOut = { id: "text-out", label: "text", kind: "text" };
|
|
1647
|
+
const byWrapper = new Map(records.map((r) => [r.wrapper_pid ?? r.pid, r.pid]));
|
|
1648
|
+
const nid = (pid: number) => `${ns}/${pid}`;
|
|
1649
|
+
// renderHints.preview: the REAL agent TUI tail (redacted in
|
|
1650
|
+
// logPreviewLines), drawn by rgui's federatedTerminalPreview as a live
|
|
1651
|
+
// terminal card on the mirroring host
|
|
1652
|
+
const previewOf = async (r: (typeof records)[number]) => {
|
|
1653
|
+
const lines = await logPreviewLines(r.log_file);
|
|
1654
|
+
if (!lines?.length) return undefined;
|
|
1655
|
+
const title = (await logTitle(r.log_file)) ?? `${r.cli} #${r.pid}`;
|
|
1656
|
+
return { preview: { kind: "terminal", title, status: r.status, lines } };
|
|
1657
|
+
};
|
|
1658
|
+
const nodes = await Promise.all(
|
|
1659
|
+
records.map(async (r, i) => ({
|
|
1660
|
+
id: nid(r.pid),
|
|
1661
|
+
app: "agent-yes",
|
|
1662
|
+
type: `${r.cli}-agent`,
|
|
1663
|
+
title: `${r.cli} #${r.pid}`,
|
|
1664
|
+
category: "agent-yes",
|
|
1665
|
+
owner: `agent-yes:${origin}`,
|
|
1666
|
+
status: r.status,
|
|
1667
|
+
parent: r.parent_pid && byWrapper.has(r.parent_pid) ? nid(byWrapper.get(r.parent_pid)!) : undefined,
|
|
1668
|
+
pos: { x: (i % 8) * 320, y: Math.floor(i / 8) * 200 },
|
|
1669
|
+
size: { w: 256, h: 128 },
|
|
1670
|
+
inputs: [textIn],
|
|
1671
|
+
outputs: [textOut],
|
|
1672
|
+
renderHints: await previewOf(r),
|
|
1673
|
+
})),
|
|
1674
|
+
);
|
|
1675
|
+
const codex = records
|
|
1676
|
+
.filter((r) => r.cli === "codex")
|
|
1677
|
+
.sort((a, b) => (b.last_active_at ?? 0) - (a.last_active_at ?? 0))[0];
|
|
1678
|
+
nodes.push({
|
|
1679
|
+
id: "ay://agent-yes/codex-agent",
|
|
1680
|
+
app: "agent-yes",
|
|
1681
|
+
type: "codex-agent",
|
|
1682
|
+
title: "Codex Agent",
|
|
1683
|
+
category: "agent-yes",
|
|
1684
|
+
owner: `agent-yes:${origin}`,
|
|
1685
|
+
status: codex?.status ?? "offline",
|
|
1686
|
+
parent: undefined,
|
|
1687
|
+
pos: { x: 0, y: -240 },
|
|
1688
|
+
size: { w: 256, h: 128 },
|
|
1689
|
+
inputs: [textIn],
|
|
1690
|
+
outputs: [textOut],
|
|
1691
|
+
renderHints: codex ? await previewOf(codex) : undefined,
|
|
1692
|
+
});
|
|
1693
|
+
const present = new Set(nodes.map((n) => n.id));
|
|
1694
|
+
const edges = (await recentReadEdges())
|
|
1695
|
+
.filter((e) => e.by !== e.target && present.has(nid(e.target)) && present.has(nid(e.by)))
|
|
1696
|
+
.map((e) => ({
|
|
1697
|
+
source: { node: nid(e.target), port: "text-out", type: "text" },
|
|
1698
|
+
target: { node: nid(e.by), port: "text-in", type: "text" },
|
|
1699
|
+
status: "readonly",
|
|
1700
|
+
label: "reads",
|
|
1701
|
+
}));
|
|
1702
|
+
return Response.json(
|
|
1703
|
+
{
|
|
1704
|
+
kind: "rgui-federated-graph",
|
|
1705
|
+
schema: "org.rgui.graph.v1",
|
|
1706
|
+
producer: { app: "agent-yes", origin, label: `agent-yes fleet @ ${origin}` },
|
|
1707
|
+
revision: Date.now(),
|
|
1708
|
+
ts: Date.now(),
|
|
1709
|
+
graph: { nodes, edges },
|
|
1710
|
+
capabilities: { nodeTypes: [...new Set(nodes.map((n) => n.type))], portTypes: ["text"] },
|
|
1711
|
+
},
|
|
1712
|
+
{ headers: { "Access-Control-Allow-Origin": "*" } },
|
|
1713
|
+
);
|
|
1714
|
+
} catch (e) {
|
|
1715
|
+
return new Response((e as Error).message, { status: 500 });
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1603
1719
|
// GET /api/whoami — this host's device label (user@host), so a remote
|
|
1604
1720
|
// console can tag each agent with the machine it came from. Unlike codehost,
|
|
1605
1721
|
// `ay serve --share` carries no per-agent device id; the viewer fetches this
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import "./ts-CMv9I9mN.js";
|
|
2
|
-
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-JwWyeRyM.js";
|
|
4
|
-
import "./pidStore-BIvsBQ8X.js";
|
|
5
|
-
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-HqRiNZTN.js";
|
|
7
|
-
|
|
8
|
-
export { SUPPORTED_CLIS };
|