agent-yes 1.175.1 → 1.177.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/agent-yes.config.schema.json +2 -2
- package/default.config.yaml +45 -0
- package/dist/SUPPORTED_CLIS-CqxJj_q5.js +8 -0
- package/dist/{SUPPORTED_CLIS-DH7pORiR.js → SUPPORTED_CLIS-D7WMaGvg.js} +2 -2
- package/dist/agentShare-BDRVkUS5.js +231 -0
- package/dist/bash-yes.js +10 -0
- package/dist/cli.js +8 -8
- package/dist/cmd-yes.js +10 -0
- package/dist/{e2e-jb0Hp43q.js → e2e-BeKjLhmO.js} +1 -1
- package/dist/{forkNested-DhJxa4q4.js → forkNested-C8q7E6mp.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{notifyDaemon-CLRNmdHy.js → notifyDaemon-CibpOxkN.js} +5 -5
- package/dist/{openBrowser-ChR4llYa.js → openBrowser-BO5RVYwL.js} +1 -1
- package/dist/powershell-yes.js +10 -0
- package/dist/{remotes-BQMr4_En.js → remotes-BIHNxn1a.js} +3 -3
- package/dist/{remotes-CC-4GuJb.js → remotes-DsTnQhyx.js} +3 -3
- package/dist/{rustBinary-DSN5ekb5.js → rustBinary-BPF24JLj.js} +2 -2
- package/dist/{schedule-DXGDI0Uo.js → schedule-mhFoLlO_.js} +5 -5
- package/dist/{serve-DgQjFYQC.js → serve-Jq_kF9Ik.js} +143 -76
- package/dist/{setup-DHVydU-j.js → setup-dmAF9LVD.js} +3 -3
- package/dist/{share-QregR8a_.js → share-29YbzpbU.js} +6 -6
- package/dist/share-nvqy64A2.js +4 -0
- package/dist/{spawnGate-BFhva-2F.js → spawnGate-C5nBiUZQ.js} +1 -1
- package/dist/{spawnGate-IJDByl2U.js → spawnGate-Clp9xBPX.js} +2 -2
- package/dist/{subcommands-DjA3FgJk.js → subcommands-BrV8B9hG.js} +736 -714
- package/dist/subcommands-HIlFVQrW.js +9 -0
- package/dist/{tray-DXr7iK3E.js → tray-DKwVRBwr.js} +1 -1
- package/dist/{ts-PerHq0yJ.js → ts-CObUr3JC.js} +3 -3
- package/dist/{versionChecker-CfZx87hW.js → versionChecker-DlNr6KFg.js} +2 -2
- package/dist/{webrtcLink-B7REGtK2.js → webrtcLink-BG0Xc4-W.js} +2 -2
- package/dist/{webrtcRemote-Bx-eD_0I.js → webrtcRemote-BLEbZnbY.js} +3 -3
- package/dist/{workspaceConfig-BgqK-31W.js → workspaceConfig-DKd6UvVm.js} +1 -1
- package/lab/ui/index.html +900 -532
- package/lab/ui/qrcode.js +2297 -0
- package/lab/ui/sw.js +2 -1
- package/package.json +8 -2
- package/scripts/build-rgui.ts +78 -0
- package/ts/agentShare.lifecycle.spec.ts +139 -0
- package/ts/agentShare.spec.ts +238 -0
- package/ts/agentShare.ts +330 -0
- package/ts/forkNested.spec.ts +39 -2
- package/ts/index.ts +5 -1
- package/ts/serve.ts +119 -5
- package/ts/share.ts +10 -3
- package/ts/subcommands.ts +29 -0
- package/dist/SUPPORTED_CLIS-COSdc1BZ.js +0 -8
- package/dist/subcommands-C9u1em-X.js +0 -9
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-CObUr3JC.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-DlNr6KFg.js";
|
|
4
|
+
import { t as findSpawnHiddenLauncher } from "./rustBinary-BPF24JLj.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 {
|
|
11
|
-
import "./e2e-
|
|
12
|
-
import "./webrtcLink-
|
|
13
|
-
import "./remotes-
|
|
14
|
-
import { a as getSpawnHook, c as hasProvisionHook, d as resolveSpawnCwd, i as getProvisionRoot, l as hasSpawnHook, r as getProvisionHook, u as isProvisionAllowed } from "./workspaceConfig-
|
|
15
|
-
import { r as spawnRejectionReason } from "./spawnGate-
|
|
9
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-D7WMaGvg.js";
|
|
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-BrV8B9hG.js";
|
|
11
|
+
import "./e2e-BeKjLhmO.js";
|
|
12
|
+
import "./webrtcLink-BG0Xc4-W.js";
|
|
13
|
+
import "./remotes-DsTnQhyx.js";
|
|
14
|
+
import { a as getSpawnHook, c as hasProvisionHook, d as resolveSpawnCwd, i as getProvisionRoot, l as hasSpawnHook, r as getProvisionHook, u as isProvisionAllowed } from "./workspaceConfig-DKd6UvVm.js";
|
|
15
|
+
import { r as spawnRejectionReason } from "./spawnGate-Clp9xBPX.js";
|
|
16
16
|
import yargs from "yargs";
|
|
17
17
|
import { mkdir, open, readFile, stat, unlink, writeFile } from "fs/promises";
|
|
18
18
|
import { homedir, hostname, userInfo } from "os";
|
|
19
19
|
import path from "path";
|
|
20
20
|
import { execFileSync } from "node:child_process";
|
|
21
21
|
import { fileURLToPath } from "node:url";
|
|
22
|
-
import { renameSync, watch, writeFileSync } from "node:fs";
|
|
23
22
|
import { randomBytes, timingSafeEqual } from "crypto";
|
|
23
|
+
import { renameSync, watch, writeFileSync } from "node:fs";
|
|
24
24
|
|
|
25
25
|
//#region ts/serve.ts
|
|
26
26
|
const DEFAULT_PORT = 7432;
|
|
@@ -478,7 +478,7 @@ async function cmdServeDaemon(sub, args) {
|
|
|
478
478
|
let shareLink = null;
|
|
479
479
|
let shareLinkMinted = false;
|
|
480
480
|
if (webrtcDaemon) try {
|
|
481
|
-
const { loadOrCreateShareRoom, shareLinkFromRoomUrl } = await import("./share-
|
|
481
|
+
const { loadOrCreateShareRoom, shareLinkFromRoomUrl } = await import("./share-nvqy64A2.js");
|
|
482
482
|
const explicit = explicitWebrtcUrl(effArgs);
|
|
483
483
|
shareLink = shareLinkFromRoomUrl(explicit ?? await loadOrCreateShareRoom());
|
|
484
484
|
shareLinkMinted = !explicit;
|
|
@@ -487,7 +487,7 @@ async function cmdServeDaemon(sub, args) {
|
|
|
487
487
|
if (!webrtcDaemon) return;
|
|
488
488
|
if (shareLink) {
|
|
489
489
|
process.stdout.write(`\nshared over WebRTC — open this link (the token is eaten from the URL on open):\n ${shareLink}\n` + (shareLinkMinted ? ` (persistent room — same link across restarts; delete ~/.agent-yes/.share-room to rotate)\n` : ``));
|
|
490
|
-
const { offerOpenInBrowser } = await import("./openBrowser-
|
|
490
|
+
const { offerOpenInBrowser } = await import("./openBrowser-BO5RVYwL.js");
|
|
491
491
|
await offerOpenInBrowser(shareLink);
|
|
492
492
|
} else process.stdout.write("\nthe WebRTC share link carries a secret, so the daemon does NOT log it —\nread it from ~/.agent-yes/.share-link (mode 0600). The room persists in\n~/.agent-yes/.share-room, so the link survives restarts.\n");
|
|
493
493
|
};
|
|
@@ -767,6 +767,7 @@ Options:
|
|
|
767
767
|
const oscTitleRe = /\x1b\][02];([^\x07\x1b]*)(?:\x07|\x1b\\)/g;
|
|
768
768
|
let title = null;
|
|
769
769
|
for (let m; m = oscTitleRe.exec(text);) if (m[1].trim()) title = m[1].trim();
|
|
770
|
+
if (title) title = title.replace(/[\x00-\x1f\x7f-\x9f]/g, "").slice(0, 256).trim() || null;
|
|
770
771
|
titleCache.set(logFile, {
|
|
771
772
|
size,
|
|
772
773
|
mtimeMs,
|
|
@@ -1072,6 +1073,11 @@ Options:
|
|
|
1072
1073
|
Connection: "keep-alive"
|
|
1073
1074
|
} });
|
|
1074
1075
|
}
|
|
1076
|
+
if (req.method === "GET" && p === "/api/edges") try {
|
|
1077
|
+
return Response.json({ reads: await recentReadEdges() });
|
|
1078
|
+
} catch (e) {
|
|
1079
|
+
return new Response(e.message, { status: 500 });
|
|
1080
|
+
}
|
|
1075
1081
|
if (req.method === "GET" && p === "/api/whoami") {
|
|
1076
1082
|
let user = "";
|
|
1077
1083
|
try {
|
|
@@ -1148,69 +1154,77 @@ Options:
|
|
|
1148
1154
|
const record = await resolveOne(keyword, defaultOpts());
|
|
1149
1155
|
if (!record.log_file) return new Response(`pid ${record.pid}: no log_file`, { status: 404 });
|
|
1150
1156
|
const logPath = record.log_file;
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1157
|
+
let cleanup = () => {};
|
|
1158
|
+
const stream = new ReadableStream({
|
|
1159
|
+
async start(ctrl) {
|
|
1160
|
+
const enc = new TextEncoder();
|
|
1161
|
+
const send = (text) => ctrl.enqueue(enc.encode(`data: ${JSON.stringify(text)}\n\n`));
|
|
1162
|
+
const ping = () => ctrl.enqueue(enc.encode(": ping\n\n"));
|
|
1163
|
+
const initBuf = await readFile(logPath).catch(() => Buffer.alloc(0));
|
|
1164
|
+
if (raw) send(new TextDecoder().decode(initBuf.slice(Math.max(0, initBuf.length - 65536))));
|
|
1165
|
+
else send(await renderRawLog(initBuf, {
|
|
1166
|
+
mode: "tail",
|
|
1167
|
+
n: 96
|
|
1168
|
+
}));
|
|
1169
|
+
let offset = initBuf.length;
|
|
1170
|
+
let closed = false;
|
|
1171
|
+
const heartbeat = setInterval(() => {
|
|
1172
|
+
if (closed) {
|
|
1173
|
+
clearInterval(heartbeat);
|
|
1174
|
+
return;
|
|
1175
|
+
}
|
|
1176
|
+
ping();
|
|
1177
|
+
}, 15e3);
|
|
1178
|
+
const ansiRe = /\x1b\[[0-?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[@-Z\\-_]/g;
|
|
1179
|
+
const ctrlRe = /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;
|
|
1180
|
+
const fh = await open(logPath, "r").catch(() => null);
|
|
1181
|
+
let reading = false;
|
|
1182
|
+
const flush = async () => {
|
|
1183
|
+
if (closed || reading || !fh) return;
|
|
1184
|
+
reading = true;
|
|
1185
|
+
try {
|
|
1186
|
+
const { size } = await fh.stat();
|
|
1187
|
+
if (size < offset) offset = size;
|
|
1188
|
+
if (size > offset) {
|
|
1189
|
+
const len = size - offset;
|
|
1190
|
+
const buf = Buffer.allocUnsafe(len);
|
|
1191
|
+
const { bytesRead } = await fh.read(buf, 0, len, offset);
|
|
1192
|
+
offset += bytesRead;
|
|
1193
|
+
const chunk = buf.subarray(0, bytesRead);
|
|
1194
|
+
if (raw) send(new TextDecoder().decode(chunk));
|
|
1195
|
+
else {
|
|
1196
|
+
const text = new TextDecoder().decode(chunk).replace(ansiRe, "").replace(ctrlRe, "");
|
|
1197
|
+
if (text.trim()) send(text.trimStart());
|
|
1198
|
+
}
|
|
1190
1199
|
}
|
|
1200
|
+
} catch {} finally {
|
|
1201
|
+
reading = false;
|
|
1191
1202
|
}
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
}
|
|
1195
|
-
};
|
|
1196
|
-
let watcher = null;
|
|
1197
|
-
try {
|
|
1198
|
-
watcher = watch(logPath, () => void flush());
|
|
1199
|
-
} catch {}
|
|
1200
|
-
const poller = setInterval(() => void flush(), 60);
|
|
1201
|
-
req.signal.addEventListener("abort", () => {
|
|
1202
|
-
closed = true;
|
|
1203
|
-
clearInterval(heartbeat);
|
|
1204
|
-
clearInterval(poller);
|
|
1205
|
-
try {
|
|
1206
|
-
watcher?.close();
|
|
1207
|
-
} catch {}
|
|
1208
|
-
fh?.close().catch(() => {});
|
|
1203
|
+
};
|
|
1204
|
+
let watcher = null;
|
|
1209
1205
|
try {
|
|
1210
|
-
|
|
1206
|
+
watcher = watch(logPath, () => void flush());
|
|
1211
1207
|
} catch {}
|
|
1212
|
-
|
|
1213
|
-
|
|
1208
|
+
const poller = setInterval(() => void flush(), watcher ? 500 : 60);
|
|
1209
|
+
cleanup = () => {
|
|
1210
|
+
if (closed) return;
|
|
1211
|
+
closed = true;
|
|
1212
|
+
clearInterval(heartbeat);
|
|
1213
|
+
clearInterval(poller);
|
|
1214
|
+
try {
|
|
1215
|
+
watcher?.close();
|
|
1216
|
+
} catch {}
|
|
1217
|
+
fh?.close().catch(() => {});
|
|
1218
|
+
try {
|
|
1219
|
+
ctrl.close();
|
|
1220
|
+
} catch {}
|
|
1221
|
+
};
|
|
1222
|
+
req.signal.addEventListener("abort", cleanup);
|
|
1223
|
+
},
|
|
1224
|
+
cancel() {
|
|
1225
|
+
cleanup();
|
|
1226
|
+
}
|
|
1227
|
+
});
|
|
1214
1228
|
return new Response(stream, { headers: {
|
|
1215
1229
|
"Content-Type": "text/event-stream",
|
|
1216
1230
|
"Cache-Control": "no-cache",
|
|
@@ -1558,13 +1572,64 @@ Options:
|
|
|
1558
1572
|
return new Response(e.message, { status: 500 });
|
|
1559
1573
|
}
|
|
1560
1574
|
}
|
|
1575
|
+
if (req.method === "POST" && p === "/api/share") {
|
|
1576
|
+
let body;
|
|
1577
|
+
try {
|
|
1578
|
+
body = await req.json();
|
|
1579
|
+
} catch {
|
|
1580
|
+
return new Response("invalid JSON body", { status: 400 });
|
|
1581
|
+
}
|
|
1582
|
+
if (!body.agent) return new Response("agent required", { status: 400 });
|
|
1583
|
+
const perm = body.perm ?? "r";
|
|
1584
|
+
if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
|
|
1585
|
+
try {
|
|
1586
|
+
const { createScopedShare } = await import("./agentShare-BDRVkUS5.js");
|
|
1587
|
+
const share = await createScopedShare({
|
|
1588
|
+
agent: body.agent,
|
|
1589
|
+
perm,
|
|
1590
|
+
localFetch: apiFetch,
|
|
1591
|
+
apiToken: token
|
|
1592
|
+
});
|
|
1593
|
+
return Response.json(share);
|
|
1594
|
+
} catch (e) {
|
|
1595
|
+
const msg = e.message;
|
|
1596
|
+
const status = /too many active shares/.test(msg) ? 409 : /no agent matched|no stable/.test(msg) ? 404 : 500;
|
|
1597
|
+
return new Response(msg, { status });
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
if (req.method === "GET" && p === "/api/shares") {
|
|
1601
|
+
const { listShares } = await import("./agentShare-BDRVkUS5.js");
|
|
1602
|
+
return Response.json(listShares());
|
|
1603
|
+
}
|
|
1604
|
+
const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
|
|
1605
|
+
if (req.method === "DELETE" && revokeM) {
|
|
1606
|
+
const { revokeShare } = await import("./agentShare-BDRVkUS5.js");
|
|
1607
|
+
const ok = revokeShare(decodeURIComponent(revokeM[1]));
|
|
1608
|
+
return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
|
|
1609
|
+
}
|
|
1561
1610
|
return new Response("Not Found", { status: 404 });
|
|
1562
1611
|
};
|
|
1563
1612
|
const uiDir = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "lab", "ui");
|
|
1613
|
+
const CONSOLE_CSP = [
|
|
1614
|
+
"default-src 'self'",
|
|
1615
|
+
"base-uri 'none'",
|
|
1616
|
+
"object-src 'none'",
|
|
1617
|
+
"frame-ancestors 'none'",
|
|
1618
|
+
"form-action 'self'",
|
|
1619
|
+
"img-src 'self' data:",
|
|
1620
|
+
"font-src 'self' data:",
|
|
1621
|
+
"style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net",
|
|
1622
|
+
"script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net",
|
|
1623
|
+
"connect-src 'self' https://s.agent-yes.com https://agent-yes.com wss:",
|
|
1624
|
+
"worker-src 'self'",
|
|
1625
|
+
"manifest-src 'self'"
|
|
1626
|
+
].join("; ");
|
|
1564
1627
|
const serveUiFile = async (name, type) => {
|
|
1565
1628
|
try {
|
|
1566
1629
|
const buf = await readFile(path.join(uiDir, name));
|
|
1567
|
-
|
|
1630
|
+
const headers = { "Content-Type": type };
|
|
1631
|
+
if (type.includes("text/html")) headers["Content-Security-Policy"] = CONSOLE_CSP;
|
|
1632
|
+
return new Response(buf, { headers });
|
|
1568
1633
|
} catch {
|
|
1569
1634
|
return new Response("UI assets not found in this install — use the /api endpoints", { status: 404 });
|
|
1570
1635
|
}
|
|
@@ -1575,6 +1640,7 @@ Options:
|
|
|
1575
1640
|
if (req.method === "GET" && p === "/room-client.js") return serveUiFile("room-client.js", "text/javascript; charset=utf-8");
|
|
1576
1641
|
if (req.method === "GET" && p === "/console-logic.js") return serveUiFile("console-logic.js", "text/javascript; charset=utf-8");
|
|
1577
1642
|
if (req.method === "GET" && p === "/e2e.js") return serveUiFile("e2e.js", "text/javascript; charset=utf-8");
|
|
1643
|
+
if (req.method === "GET" && p === "/qrcode.js") return serveUiFile("qrcode.js", "text/javascript; charset=utf-8");
|
|
1578
1644
|
if (req.method === "GET" && p === "/favicon.ico") return new Response(null, { status: 204 });
|
|
1579
1645
|
return apiFetch(req);
|
|
1580
1646
|
};
|
|
@@ -1630,7 +1696,7 @@ Options:
|
|
|
1630
1696
|
const webrtcVal = argv.webrtc ?? argv.share;
|
|
1631
1697
|
const explicitUrl = typeof webrtcVal === "string" && webrtcVal.startsWith("webrtc://") ? webrtcVal : void 0;
|
|
1632
1698
|
try {
|
|
1633
|
-
const { startShare, loadOrCreateShareRoom } = await import("./share-
|
|
1699
|
+
const { startShare, loadOrCreateShareRoom } = await import("./share-nvqy64A2.js");
|
|
1634
1700
|
const linkFile = path.join(process.env.AGENT_YES_HOME ?? path.join(homedir(), ".agent-yes"), ".share-link");
|
|
1635
1701
|
const announce = async (room, link, rotated) => {
|
|
1636
1702
|
const lead = rotated ? "the room was rejected by signaling (stale generation) — rotated to a fresh link" : "shared over WebRTC — open this link (the token is eaten from the URL on open)";
|
|
@@ -1638,7 +1704,7 @@ Options:
|
|
|
1638
1704
|
const persistNote = explicitUrl ? "\n" : ` (persistent room — same link across restarts; delete ~/.agent-yes/.share-room to rotate)\n\n`;
|
|
1639
1705
|
process.stdout.write(`${wantHttp ? "\n" : ""}${lead}:\n ${link}\n` + persistNote);
|
|
1640
1706
|
if (!rotated) {
|
|
1641
|
-
const { offerOpenInBrowser } = await import("./openBrowser-
|
|
1707
|
+
const { offerOpenInBrowser } = await import("./openBrowser-BO5RVYwL.js");
|
|
1642
1708
|
await offerOpenInBrowser(link);
|
|
1643
1709
|
}
|
|
1644
1710
|
} else {
|
|
@@ -1677,6 +1743,7 @@ Options:
|
|
|
1677
1743
|
const shutdown = (resolve) => {
|
|
1678
1744
|
if (heartbeat) clearInterval(heartbeat);
|
|
1679
1745
|
closeShare?.();
|
|
1746
|
+
import("./agentShare-BDRVkUS5.js").then((m) => m.revokeAllShares()).catch(() => {});
|
|
1680
1747
|
server?.stop();
|
|
1681
1748
|
resolve();
|
|
1682
1749
|
};
|
|
@@ -1689,4 +1756,4 @@ Options:
|
|
|
1689
1756
|
|
|
1690
1757
|
//#endregion
|
|
1691
1758
|
export { cmdServe };
|
|
1692
|
-
//# sourceMappingURL=serve-
|
|
1759
|
+
//# sourceMappingURL=serve-Jq_kF9Ik.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as setWorkspaceRoot, s as getWorkspaceRoot } from "./workspaceConfig-
|
|
1
|
+
import { f as setWorkspaceRoot, s as getWorkspaceRoot } from "./workspaceConfig-DKd6UvVm.js";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { stdin, stdout } from "node:process";
|
|
4
4
|
import { createInterface } from "node:readline/promises";
|
|
@@ -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-Jq_kF9Ik.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-dmAF9LVD.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as computeTranscriptHash, c as open$1, d as randomHex, f as seal, i as MAX_CHUNK, l as packEnvelope, n as FLAG_CONFIRM, o as deriveAuthToken, p as unpackEnvelope, r as MARKER, s as deriveDirKeys, t as CONFIRM_TIMEOUT_MS, u as parseSecret } from "./e2e-
|
|
1
|
+
import { a as computeTranscriptHash, c as open$1, d as randomHex, f as seal, i as MAX_CHUNK, l as packEnvelope, n as FLAG_CONFIRM, o as deriveAuthToken, p as unpackEnvelope, r as MARKER, s as deriveDirKeys, t as CONFIRM_TIMEOUT_MS, u as parseSecret } from "./e2e-BeKjLhmO.js";
|
|
2
2
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
3
3
|
import { homedir } from "os";
|
|
4
4
|
import path from "path";
|
|
@@ -58,7 +58,7 @@ async function loadOrCreateShareRoom(sighost = DEFAULT_SIGHOST) {
|
|
|
58
58
|
if (parseShareUrl(url).token.startsWith(MARKER)) return url;
|
|
59
59
|
}
|
|
60
60
|
} catch {}
|
|
61
|
-
const url = `webrtc://${"r" + randomBytes(
|
|
61
|
+
const url = `webrtc://${"r" + randomBytes(6).toString("hex")}:${MARKER}${randomBytes(32).toString("hex")}@${sighost}`;
|
|
62
62
|
await mkdir(path.dirname(shareRoomPath()), { recursive: true });
|
|
63
63
|
await writeFile(shareRoomPath(), url, { mode: 384 });
|
|
64
64
|
return url;
|
|
@@ -146,7 +146,7 @@ async function startShare(opts) {
|
|
|
146
146
|
opts.url;
|
|
147
147
|
const sighost = opts.sighost ?? DEFAULT_SIGHOST;
|
|
148
148
|
const initial = opts.url ? parseShareUrl(opts.url) : {
|
|
149
|
-
room: "r" + randomBytes(
|
|
149
|
+
room: "r" + randomBytes(6).toString("hex"),
|
|
150
150
|
token: `${MARKER}${randomBytes(32).toString("hex")}`,
|
|
151
151
|
host: sighost
|
|
152
152
|
};
|
|
@@ -165,7 +165,7 @@ async function startShare(opts) {
|
|
|
165
165
|
const rotate = async () => {
|
|
166
166
|
if (!opts.onRotate || closed || rotateCount >= 5) return false;
|
|
167
167
|
rotateCount++;
|
|
168
|
-
room = "r" + randomBytes(
|
|
168
|
+
room = "r" + randomBytes(6).toString("hex");
|
|
169
169
|
token = `${MARKER}${randomBytes(32).toString("hex")}`;
|
|
170
170
|
S = parseSecret(token).s;
|
|
171
171
|
authToken = await deriveAuthToken(S, room, host);
|
|
@@ -533,5 +533,5 @@ async function startShare(opts) {
|
|
|
533
533
|
}
|
|
534
534
|
|
|
535
535
|
//#endregion
|
|
536
|
-
export {
|
|
537
|
-
//# sourceMappingURL=share-
|
|
536
|
+
export { shareLinkFromRoomUrl as n, startShare as r, loadOrCreateShareRoom as t };
|
|
537
|
+
//# sourceMappingURL=share-29YbzpbU.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./logger-CDIsZ-Pp.js";
|
|
2
2
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
3
|
-
import { i as waitForSpawnCapacity, n as spawnGateEnabled, r as spawnRejectionReason, t as memAvailableMb } from "./spawnGate-
|
|
3
|
+
import { i as waitForSpawnCapacity, n as spawnGateEnabled, r as spawnRejectionReason, t as memAvailableMb } from "./spawnGate-Clp9xBPX.js";
|
|
4
4
|
|
|
5
5
|
export { waitForSpawnCapacity };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as readGlobalPids } from "./globalPidIndex-CoNr7tS8.js";
|
|
2
|
-
import { n as getMinFreeMb, o as getSpawnWaitMs, t as getMaxAgents } from "./workspaceConfig-
|
|
2
|
+
import { n as getMinFreeMb, o as getSpawnWaitMs, t as getMaxAgents } from "./workspaceConfig-DKd6UvVm.js";
|
|
3
3
|
import { readFile } from "fs/promises";
|
|
4
4
|
|
|
5
5
|
//#region ts/spawnGate.ts
|
|
@@ -104,4 +104,4 @@ async function waitForSpawnCapacity(opts) {
|
|
|
104
104
|
|
|
105
105
|
//#endregion
|
|
106
106
|
export { waitForSpawnCapacity as i, spawnGateEnabled as n, spawnRejectionReason as r, memAvailableMb as t };
|
|
107
|
-
//# sourceMappingURL=spawnGate-
|
|
107
|
+
//# sourceMappingURL=spawnGate-Clp9xBPX.js.map
|