agent-yes 1.190.0 → 1.192.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-BB7Br0fS.js → SUPPORTED_CLIS-C0fh_eJs.js} +2 -2
- package/dist/SUPPORTED_CLIS-DAzPSQ95.js +8 -0
- package/dist/{agentShare-BXfWzPJu.js → agentShare-Byzqbfk6.js} +2 -2
- package/dist/cli.js +4 -4
- package/dist/{expose-DUYH0tvh.js → expose-B3AGhVhM.js} +151 -68
- package/dist/index.js +2 -2
- package/dist/{notifyDaemon-APkkoCzC.js → notifyDaemon-DjuvLK7-.js} +2 -2
- package/dist/{rustBinary-C8YZUZGT.js → rustBinary-INWRomvk.js} +2 -2
- package/dist/{schedule-BYG6MGpH.js → schedule-CsNFNbbW.js} +4 -4
- package/dist/{serve-Df3wcUU-.js → serve-CfR-7uMU.js} +46 -10
- package/dist/{setup-C65eaHZ8.js → setup-0Oby3hYf.js} +2 -2
- package/dist/{subcommands-D6TbKFTF.js → subcommands-D_QHSUp-.js} +1 -1
- package/dist/{subcommands-Deaq1dOk.js → subcommands-IIDRpOa1.js} +17 -9
- package/dist/{ts-CeGEhsC9.js → ts-BdFKarex.js} +2 -2
- package/dist/{versionChecker-DXwf5ip7.js → versionChecker-DEJVuzWZ.js} +2 -2
- package/lab/ui/index.html +239 -3
- package/package.json +1 -1
- package/ts/expose.ts +204 -78
- package/ts/serve.ts +44 -0
- package/ts/subcommands.ts +15 -6
- package/dist/SUPPORTED_CLIS-B729E086.js +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { t as CLIS_CONFIG } from "./ts-BdFKarex.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-C0fh_eJs.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./ts-BdFKarex.js";
|
|
2
|
+
import "./logger-CDIsZ-Pp.js";
|
|
3
|
+
import "./versionChecker-DEJVuzWZ.js";
|
|
4
|
+
import "./pidStore-BIvsBQ8X.js";
|
|
5
|
+
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C0fh_eJs.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-IIDRpOa1.js";
|
|
5
5
|
import "./e2e-BeKjLhmO.js";
|
|
6
6
|
import "./webrtcLink-BG0Xc4-W.js";
|
|
7
7
|
import "./remotes-CgT91bMo.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-Byzqbfk6.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-DEJVuzWZ.js";
|
|
5
|
+
import { n as getRustBinary } from "./rustBinary-INWRomvk.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-D_QHSUp-.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-DAzPSQ95.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}`);
|
|
@@ -327,7 +327,7 @@ function exposuresPath() {
|
|
|
327
327
|
mkdirSync(home, { recursive: true });
|
|
328
328
|
return path.join(home, "exposures.json");
|
|
329
329
|
}
|
|
330
|
-
/** Stable id+key per (relay, port): re-
|
|
330
|
+
/** Stable id+key per (relay, port): re-exposing a port keeps its URL. */
|
|
331
331
|
function loadOrCreateExposure(relayHost, port) {
|
|
332
332
|
const file = exposuresPath();
|
|
333
333
|
let all = {};
|
|
@@ -369,6 +369,139 @@ function wsTransport(ws) {
|
|
|
369
369
|
onClose: (cb) => ws.addEventListener("close", () => cb())
|
|
370
370
|
};
|
|
371
371
|
}
|
|
372
|
+
/**
|
|
373
|
+
* Start (or fail) one exposure. Resolves once the relay has accepted the daemon
|
|
374
|
+
* and the tunnel is live; rejects if the relay refuses this exposure (bad key).
|
|
375
|
+
* Reconnects with backoff for the life of the handle.
|
|
376
|
+
*/
|
|
377
|
+
function startExposure(opts) {
|
|
378
|
+
const relay = opts.relay ?? DEFAULT_RELAY;
|
|
379
|
+
const port = opts.port;
|
|
380
|
+
const log = opts.log ?? (() => {});
|
|
381
|
+
const relayUrl = new URL(relay);
|
|
382
|
+
const rec = loadOrCreateExposure(relayUrl.host, port);
|
|
383
|
+
const tunnelUrl = `${relayUrl.protocol === "http:" ? "ws:" : "wss:"}//${relayUrl.host}/_ay/tunnel/${rec.id}`;
|
|
384
|
+
const publicHost = relayUrl.host === "agent-yes.com" ? `${rec.id}.agent-yes.com` : relayUrl.host;
|
|
385
|
+
const publicUrl = `https://${publicHost}/`;
|
|
386
|
+
let stopped = false;
|
|
387
|
+
let sock = null;
|
|
388
|
+
let ready = false;
|
|
389
|
+
let backoff = RECONNECT_MIN_MS;
|
|
390
|
+
const handle = {
|
|
391
|
+
id: rec.id,
|
|
392
|
+
port,
|
|
393
|
+
publicHost,
|
|
394
|
+
url: publicUrl,
|
|
395
|
+
relayHost: relayUrl.host,
|
|
396
|
+
createdAt: Date.now(),
|
|
397
|
+
mintClaim() {
|
|
398
|
+
const token = randomBytes(18).toString("base64url");
|
|
399
|
+
const hash = createHash("sha256").update(token).digest("hex");
|
|
400
|
+
if (sock && sock.readyState === WebSocket.OPEN) sock.send(JSON.stringify({
|
|
401
|
+
t: "claim",
|
|
402
|
+
claims: [hash]
|
|
403
|
+
}));
|
|
404
|
+
return `https://${publicHost}/_ay/claim?t=${token}`;
|
|
405
|
+
},
|
|
406
|
+
stop() {
|
|
407
|
+
stopped = true;
|
|
408
|
+
try {
|
|
409
|
+
sock?.close();
|
|
410
|
+
} catch {}
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
return new Promise((resolve, reject) => {
|
|
414
|
+
const connect = () => {
|
|
415
|
+
if (stopped) return;
|
|
416
|
+
sock = new WebSocket(tunnelUrl);
|
|
417
|
+
sock.binaryType = "arraybuffer";
|
|
418
|
+
const ws = sock;
|
|
419
|
+
let ping = null;
|
|
420
|
+
ws.addEventListener("open", () => {
|
|
421
|
+
ws.send(JSON.stringify({
|
|
422
|
+
t: "hello",
|
|
423
|
+
key: rec.key,
|
|
424
|
+
port,
|
|
425
|
+
v: 1
|
|
426
|
+
}));
|
|
427
|
+
});
|
|
428
|
+
ws.addEventListener("message", (ev) => {
|
|
429
|
+
if (typeof ev.data !== "string") return;
|
|
430
|
+
let msg;
|
|
431
|
+
try {
|
|
432
|
+
msg = JSON.parse(ev.data);
|
|
433
|
+
} catch {
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
if (msg.t === "ready") {
|
|
437
|
+
backoff = RECONNECT_MIN_MS;
|
|
438
|
+
new TunnelHost(wsTransport(ws), { port });
|
|
439
|
+
ping = setInterval(() => {
|
|
440
|
+
if (ws.readyState === WebSocket.OPEN) ws.send("ping");
|
|
441
|
+
}, PING_MS);
|
|
442
|
+
if (!ready) {
|
|
443
|
+
ready = true;
|
|
444
|
+
log(`sharing 127.0.0.1:${port} at ${publicUrl}`);
|
|
445
|
+
resolve(handle);
|
|
446
|
+
} else log(`reconnected`);
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
ws.addEventListener("close", (ev) => {
|
|
450
|
+
if (ping) clearInterval(ping);
|
|
451
|
+
if (stopped) return;
|
|
452
|
+
if (ev.code === 1008) {
|
|
453
|
+
const err = /* @__PURE__ */ new Error(`relay refused exposure (${ev.reason || "forbidden"})`);
|
|
454
|
+
if (!ready) return reject(err);
|
|
455
|
+
log(err.message);
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
log(`connection lost, retrying in ${Math.round(backoff / 1e3)}s…`);
|
|
459
|
+
setTimeout(connect, backoff);
|
|
460
|
+
backoff = Math.min(backoff * 2, RECONNECT_MAX_MS);
|
|
461
|
+
});
|
|
462
|
+
ws.addEventListener("error", () => {});
|
|
463
|
+
};
|
|
464
|
+
connect();
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
const active = /* @__PURE__ */ new Map();
|
|
468
|
+
/** In-flight starts, so concurrent POSTs for the same port share one dial. */
|
|
469
|
+
const starting = /* @__PURE__ */ new Map();
|
|
470
|
+
/** Start an exposure for `port` (or reuse a running one). Idempotent per port. */
|
|
471
|
+
async function ensureExposure(port, relay) {
|
|
472
|
+
const existing = active.get(port);
|
|
473
|
+
if (existing) return existing;
|
|
474
|
+
const inflight = starting.get(port);
|
|
475
|
+
if (inflight) return inflight;
|
|
476
|
+
const p = startExposure({
|
|
477
|
+
port,
|
|
478
|
+
relay
|
|
479
|
+
}).then((h) => {
|
|
480
|
+
active.set(port, h);
|
|
481
|
+
starting.delete(port);
|
|
482
|
+
return h;
|
|
483
|
+
}).catch((e) => {
|
|
484
|
+
starting.delete(port);
|
|
485
|
+
throw e;
|
|
486
|
+
});
|
|
487
|
+
starting.set(port, p);
|
|
488
|
+
return p;
|
|
489
|
+
}
|
|
490
|
+
function listExposures() {
|
|
491
|
+
return [...active.values()].sort((a, b) => b.createdAt - a.createdAt).map((h) => ({
|
|
492
|
+
id: h.id,
|
|
493
|
+
port: h.port,
|
|
494
|
+
url: h.url,
|
|
495
|
+
createdAt: h.createdAt
|
|
496
|
+
}));
|
|
497
|
+
}
|
|
498
|
+
function stopExposure(port) {
|
|
499
|
+
const h = active.get(port);
|
|
500
|
+
if (!h) return false;
|
|
501
|
+
h.stop();
|
|
502
|
+
active.delete(port);
|
|
503
|
+
return true;
|
|
504
|
+
}
|
|
372
505
|
async function cmdExpose(args) {
|
|
373
506
|
let relay = DEFAULT_RELAY;
|
|
374
507
|
let port = 0;
|
|
@@ -386,74 +519,24 @@ async function cmdExpose(args) {
|
|
|
386
519
|
console.error("usage: ay expose <port> [--relay https://…] (see ay expose --help)");
|
|
387
520
|
return 1;
|
|
388
521
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
let stopped = false;
|
|
396
|
-
let ws = null;
|
|
397
|
-
let backoff = RECONNECT_MIN_MS;
|
|
398
|
-
let announced = false;
|
|
399
|
-
const connect = () => {
|
|
400
|
-
if (stopped) return;
|
|
401
|
-
ws = new WebSocket(tunnelUrl);
|
|
402
|
-
ws.binaryType = "arraybuffer";
|
|
403
|
-
const sock = ws;
|
|
404
|
-
let ping = null;
|
|
405
|
-
sock.addEventListener("open", () => {
|
|
406
|
-
sock.send(JSON.stringify({
|
|
407
|
-
t: "hello",
|
|
408
|
-
key: rec.key,
|
|
409
|
-
port,
|
|
410
|
-
claims: [claimHash],
|
|
411
|
-
v: 1
|
|
412
|
-
}));
|
|
413
|
-
});
|
|
414
|
-
sock.addEventListener("message", (ev) => {
|
|
415
|
-
if (typeof ev.data !== "string") return;
|
|
416
|
-
let msg;
|
|
417
|
-
try {
|
|
418
|
-
msg = JSON.parse(ev.data);
|
|
419
|
-
} catch {
|
|
420
|
-
return;
|
|
421
|
-
}
|
|
422
|
-
if (msg.t === "ready") {
|
|
423
|
-
backoff = RECONNECT_MIN_MS;
|
|
424
|
-
new TunnelHost(wsTransport(sock), { port });
|
|
425
|
-
ping = setInterval(() => {
|
|
426
|
-
if (sock.readyState === WebSocket.OPEN) sock.send("ping");
|
|
427
|
-
}, PING_MS);
|
|
428
|
-
if (!announced) {
|
|
429
|
-
announced = true;
|
|
430
|
-
console.log(`[ay expose] sharing 127.0.0.1:${port}`);
|
|
431
|
-
console.log(` url: https://${publicHost}/`);
|
|
432
|
-
console.log(` claim: https://${publicHost}/_ay/claim?t=${claimToken}`);
|
|
433
|
-
console.log(` (one-time link — opens access for 8h in that browser)`);
|
|
434
|
-
} else console.log(`[ay expose] reconnected`);
|
|
435
|
-
}
|
|
436
|
-
});
|
|
437
|
-
sock.addEventListener("close", (ev) => {
|
|
438
|
-
if (ping) clearInterval(ping);
|
|
439
|
-
if (stopped) return;
|
|
440
|
-
if (ev.code === 1008) {
|
|
441
|
-
console.error(`[ay expose] relay refused this exposure (${ev.reason || "forbidden"}) — giving up`);
|
|
442
|
-
process.exit(1);
|
|
443
|
-
}
|
|
444
|
-
console.log(`[ay expose] connection lost, retrying in ${Math.round(backoff / 1e3)}s…`);
|
|
445
|
-
setTimeout(connect, backoff);
|
|
446
|
-
backoff = Math.min(backoff * 2, RECONNECT_MAX_MS);
|
|
522
|
+
let handle;
|
|
523
|
+
try {
|
|
524
|
+
handle = await startExposure({
|
|
525
|
+
port,
|
|
526
|
+
relay,
|
|
527
|
+
log: (m) => console.log(`[ay expose] ${m}`)
|
|
447
528
|
});
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
529
|
+
} catch (e) {
|
|
530
|
+
console.error(`[ay expose] ${e.message} — giving up`);
|
|
531
|
+
return 1;
|
|
532
|
+
}
|
|
533
|
+
const claimUrl = handle.mintClaim();
|
|
534
|
+
console.log(` url: ${handle.url}`);
|
|
535
|
+
console.log(` claim: ${claimUrl}`);
|
|
536
|
+
console.log(` (one-time link — opens access for 8h in that browser)`);
|
|
451
537
|
const shutdown = () => {
|
|
452
|
-
stopped = true;
|
|
453
538
|
console.log("\n[ay expose] stopped — the URL now answers 502 until you expose again");
|
|
454
|
-
|
|
455
|
-
ws?.close();
|
|
456
|
-
} catch {}
|
|
539
|
+
handle.stop();
|
|
457
540
|
process.exit(0);
|
|
458
541
|
};
|
|
459
542
|
process.on("SIGINT", shutdown);
|
|
@@ -462,5 +545,5 @@ async function cmdExpose(args) {
|
|
|
462
545
|
}
|
|
463
546
|
|
|
464
547
|
//#endregion
|
|
465
|
-
export { cmdExpose };
|
|
466
|
-
//# sourceMappingURL=expose-
|
|
548
|
+
export { cmdExpose, ensureExposure, listExposures, stopExposure };
|
|
549
|
+
//# sourceMappingURL=expose-B3AGhVhM.js.map
|
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-BdFKarex.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-DEJVuzWZ.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-IIDRpOa1.js";
|
|
5
5
|
import "./e2e-BeKjLhmO.js";
|
|
6
6
|
import "./webrtcLink-BG0Xc4-W.js";
|
|
7
7
|
import "./remotes-CgT91bMo.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-DjuvLK7-.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
1
|
+
import { r as getInstalledPackage } from "./versionChecker-DEJVuzWZ.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-INWRomvk.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-BdFKarex.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-DEJVuzWZ.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-C0fh_eJs.js";
|
|
7
7
|
import { d as resolveSpawnCwd } from "./workspaceConfig-_GtAZtsi.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-CsNFNbbW.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-BdFKarex.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-DEJVuzWZ.js";
|
|
4
|
+
import { t as findSpawnHiddenLauncher } from "./rustBinary-INWRomvk.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, 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-
|
|
9
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-C0fh_eJs.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-IIDRpOa1.js";
|
|
11
11
|
import "./e2e-BeKjLhmO.js";
|
|
12
12
|
import "./webrtcLink-BG0Xc4-W.js";
|
|
13
13
|
import "./remotes-CgT91bMo.js";
|
|
@@ -1851,7 +1851,7 @@ Options:
|
|
|
1851
1851
|
const perm = body.perm ?? "r";
|
|
1852
1852
|
if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
|
|
1853
1853
|
try {
|
|
1854
|
-
const { createScopedShare } = await import("./agentShare-
|
|
1854
|
+
const { createScopedShare } = await import("./agentShare-Byzqbfk6.js");
|
|
1855
1855
|
const share = await createScopedShare({
|
|
1856
1856
|
agent: body.agent,
|
|
1857
1857
|
perm,
|
|
@@ -1866,15 +1866,48 @@ Options:
|
|
|
1866
1866
|
}
|
|
1867
1867
|
}
|
|
1868
1868
|
if (req.method === "GET" && p === "/api/shares") {
|
|
1869
|
-
const { listShares } = await import("./agentShare-
|
|
1869
|
+
const { listShares } = await import("./agentShare-Byzqbfk6.js");
|
|
1870
1870
|
return Response.json(listShares());
|
|
1871
1871
|
}
|
|
1872
1872
|
const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
|
|
1873
1873
|
if (req.method === "DELETE" && revokeM) {
|
|
1874
|
-
const { revokeShare } = await import("./agentShare-
|
|
1874
|
+
const { revokeShare } = await import("./agentShare-Byzqbfk6.js");
|
|
1875
1875
|
const ok = revokeShare(decodeURIComponent(revokeM[1]));
|
|
1876
1876
|
return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
|
|
1877
1877
|
}
|
|
1878
|
+
if (req.method === "POST" && p === "/api/expose") {
|
|
1879
|
+
let body;
|
|
1880
|
+
try {
|
|
1881
|
+
body = await req.json();
|
|
1882
|
+
} catch {
|
|
1883
|
+
return new Response("invalid JSON body", { status: 400 });
|
|
1884
|
+
}
|
|
1885
|
+
const port = Number(body.port);
|
|
1886
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) return new Response("valid port required", { status: 400 });
|
|
1887
|
+
try {
|
|
1888
|
+
const { ensureExposure } = await import("./expose-B3AGhVhM.js");
|
|
1889
|
+
const h = await ensureExposure(port, body.relay);
|
|
1890
|
+
return Response.json({
|
|
1891
|
+
id: h.id,
|
|
1892
|
+
port: h.port,
|
|
1893
|
+
url: h.url,
|
|
1894
|
+
claim: h.mintClaim(),
|
|
1895
|
+
createdAt: h.createdAt
|
|
1896
|
+
});
|
|
1897
|
+
} catch (e) {
|
|
1898
|
+
return new Response(`expose failed: ${e.message}`, { status: 502 });
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
if (req.method === "GET" && p === "/api/exposes") {
|
|
1902
|
+
const { listExposures } = await import("./expose-B3AGhVhM.js");
|
|
1903
|
+
return Response.json(listExposures());
|
|
1904
|
+
}
|
|
1905
|
+
const unexposeM = /^\/api\/expose\/(\d+)$/.exec(p);
|
|
1906
|
+
if (req.method === "DELETE" && unexposeM) {
|
|
1907
|
+
const { stopExposure } = await import("./expose-B3AGhVhM.js");
|
|
1908
|
+
const ok = stopExposure(Number(unexposeM[1]));
|
|
1909
|
+
return new Response(ok ? "revoked" : "no such exposure", { status: ok ? 200 : 404 });
|
|
1910
|
+
}
|
|
1878
1911
|
return new Response("Not Found", { status: 404 });
|
|
1879
1912
|
};
|
|
1880
1913
|
const uiDir = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "lab", "ui");
|
|
@@ -1912,8 +1945,11 @@ Options:
|
|
|
1912
1945
|
if (req.method === "GET" && p === "/r/main.js.map") return serveUiFile("rgui/dist/main.js.map", "application/json");
|
|
1913
1946
|
if (req.method === "GET" && p === "/room-client.js") return serveUiFile("room-client.js", "text/javascript; charset=utf-8");
|
|
1914
1947
|
if (req.method === "GET" && p === "/console-logic.js") return serveUiFile("console-logic.js", "text/javascript; charset=utf-8");
|
|
1948
|
+
if (req.method === "GET" && p === "/rtc.js") return serveUiFile("rtc.js", "text/javascript; charset=utf-8");
|
|
1915
1949
|
if (req.method === "GET" && p === "/e2e.js") return serveUiFile("e2e.js", "text/javascript; charset=utf-8");
|
|
1916
1950
|
if (req.method === "GET" && p === "/qrcode.js") return serveUiFile("qrcode.js", "text/javascript; charset=utf-8");
|
|
1951
|
+
if (req.method === "GET" && p === "/manifest.webmanifest") return serveUiFile("manifest.webmanifest", "application/manifest+json");
|
|
1952
|
+
if (req.method === "GET" && p === "/icon.svg") return serveUiFile("icon.svg", "image/svg+xml");
|
|
1917
1953
|
if (req.method === "GET" && p === "/favicon.ico") return new Response(null, { status: 204 });
|
|
1918
1954
|
return apiFetch(req);
|
|
1919
1955
|
};
|
|
@@ -2016,7 +2052,7 @@ Options:
|
|
|
2016
2052
|
const shutdown = (resolve) => {
|
|
2017
2053
|
if (heartbeat) clearInterval(heartbeat);
|
|
2018
2054
|
closeShare?.();
|
|
2019
|
-
import("./agentShare-
|
|
2055
|
+
import("./agentShare-Byzqbfk6.js").then((m) => m.revokeAllShares()).catch(() => {});
|
|
2020
2056
|
server?.stop();
|
|
2021
2057
|
resolve();
|
|
2022
2058
|
};
|
|
@@ -2029,4 +2065,4 @@ Options:
|
|
|
2029
2065
|
|
|
2030
2066
|
//#endregion
|
|
2031
2067
|
export { cmdServe };
|
|
2032
|
-
//# sourceMappingURL=serve-
|
|
2068
|
+
//# sourceMappingURL=serve-CfR-7uMU.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-CfR-7uMU.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-0Oby3hYf.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-IIDRpOa1.js";
|
|
5
5
|
import "./e2e-BeKjLhmO.js";
|
|
6
6
|
import "./webrtcLink-BG0Xc4-W.js";
|
|
7
7
|
import "./remotes-CgT91bMo.js";
|
|
@@ -12,6 +12,7 @@ import { homedir } from "os";
|
|
|
12
12
|
import path from "path";
|
|
13
13
|
import { randomUUID } from "node:crypto";
|
|
14
14
|
import os from "node:os";
|
|
15
|
+
import { randomBytes as randomBytes$1 } from "crypto";
|
|
15
16
|
|
|
16
17
|
//#region ts/agentTree.ts
|
|
17
18
|
/**
|
|
@@ -1146,15 +1147,15 @@ async function runSubcommand(argv) {
|
|
|
1146
1147
|
case "restart": return await cmdRestart(rest);
|
|
1147
1148
|
case "note": return await cmdNote(rest);
|
|
1148
1149
|
case "serve": {
|
|
1149
|
-
const { cmdServe } = await import("./serve-
|
|
1150
|
+
const { cmdServe } = await import("./serve-CfR-7uMU.js");
|
|
1150
1151
|
return cmdServe(rest);
|
|
1151
1152
|
}
|
|
1152
1153
|
case "setup": {
|
|
1153
|
-
const { cmdSetup } = await import("./setup-
|
|
1154
|
+
const { cmdSetup } = await import("./setup-0Oby3hYf.js");
|
|
1154
1155
|
return cmdSetup(rest);
|
|
1155
1156
|
}
|
|
1156
1157
|
case "schedule": {
|
|
1157
|
-
const { cmdSchedule } = await import("./schedule-
|
|
1158
|
+
const { cmdSchedule } = await import("./schedule-CsNFNbbW.js");
|
|
1158
1159
|
return cmdSchedule(rest);
|
|
1159
1160
|
}
|
|
1160
1161
|
case "remote": {
|
|
@@ -1162,7 +1163,7 @@ async function runSubcommand(argv) {
|
|
|
1162
1163
|
return cmdRemote(rest);
|
|
1163
1164
|
}
|
|
1164
1165
|
case "expose": {
|
|
1165
|
-
const { cmdExpose } = await import("./expose-
|
|
1166
|
+
const { cmdExpose } = await import("./expose-B3AGhVhM.js");
|
|
1166
1167
|
return cmdExpose(rest);
|
|
1167
1168
|
}
|
|
1168
1169
|
case "reap":
|
|
@@ -2729,7 +2730,7 @@ async function cmdSpawn(rest) {
|
|
|
2729
2730
|
* (`send`, `key`, `select`): refuse a self-targeting loop, and require that THIS
|
|
2730
2731
|
* sender actually looked at THIS target recently — an agent is blocked, an
|
|
2731
2732
|
* interactive human is only warned — unless `force`. Returns the sender context
|
|
2732
|
-
* so a caller can reuse it (e.g. `send`'s `[
|
|
2733
|
+
* so a caller can reuse it (e.g. `send`'s `[ay-msg …]` header). Extracted from
|
|
2733
2734
|
* cmdSend so the action commands enforce the identical guard.
|
|
2734
2735
|
*/
|
|
2735
2736
|
async function enforceSendGuards(record, force) {
|
|
@@ -2926,7 +2927,14 @@ async function cmdSend(rest) {
|
|
|
2926
2927
|
return 0;
|
|
2927
2928
|
}
|
|
2928
2929
|
const replyTarget = sender.agent?.agent_id || sender.agent?.pid;
|
|
2929
|
-
|
|
2930
|
+
let prefix = "";
|
|
2931
|
+
let suffix = "";
|
|
2932
|
+
if (sender.agent && !isSlashCommand(body)) {
|
|
2933
|
+
const nonce = randomBytes$1(4).toString("hex");
|
|
2934
|
+
prefix = `[ay-msg ${nonce} from ${sender.agent.cli} #${sender.agent.pid} @ ${shortenPath(sender.agent.cwd)} — reply: ay send ${replyTarget} "..."]\n`;
|
|
2935
|
+
suffix = `\n[/ay-msg ${nonce}]`;
|
|
2936
|
+
}
|
|
2937
|
+
const fullBody = prefix + body + suffix;
|
|
2930
2938
|
const noWait = Boolean(argv.noWait) || process.env.AGENT_YES_SEND_NO_WAIT === "1";
|
|
2931
2939
|
if (fullBody && !noWait && !force) {
|
|
2932
2940
|
const { clear, waitedMs } = await backoffWhileTyping(record.pid, SEND_TYPING_MAX_WAIT_MS);
|
|
@@ -3996,7 +4004,7 @@ async function cmdNotify(rest) {
|
|
|
3996
4004
|
}
|
|
3997
4005
|
const ensure = async () => {
|
|
3998
4006
|
if (!argv["ensure-daemon"]) return;
|
|
3999
|
-
const { ensureDaemon } = await import("./notifyDaemon-
|
|
4007
|
+
const { ensureDaemon } = await import("./notifyDaemon-DjuvLK7-.js");
|
|
4000
4008
|
await ensureDaemon().catch(() => null);
|
|
4001
4009
|
};
|
|
4002
4010
|
await heartbeatWatcher(parent, selfStartedAt);
|
|
@@ -4070,7 +4078,7 @@ async function cmdNotifyCursor(args) {
|
|
|
4070
4078
|
}
|
|
4071
4079
|
async function cmdNotifyd(rest) {
|
|
4072
4080
|
const sub = rest[0] ?? "status";
|
|
4073
|
-
const daemon = await import("./notifyDaemon-
|
|
4081
|
+
const daemon = await import("./notifyDaemon-DjuvLK7-.js");
|
|
4074
4082
|
switch (sub) {
|
|
4075
4083
|
case "run": return daemon.runDaemon();
|
|
4076
4084
|
case "once": return daemon.runDaemon({ once: true });
|
|
@@ -4097,4 +4105,4 @@ async function cmdNotifyd(rest) {
|
|
|
4097
4105
|
|
|
4098
4106
|
//#endregion
|
|
4099
4107
|
export { TYPING_BADGE as $, renderRawLogLines as A, waitForLogQuiet as B, matchKeyword as C, recentReadEdges as D, readPtysize as E, runSubcommand as F, hostId as G, writeToIpc as H, snapshotStatus as I, readInbox as J, listInboxParents as K, stdinActivityPath as L, resolveReadWindow as M, resolveResumeArgs as N, renderLogTailLines as O, restartHintLines as P, notifyDir as Q, stopTipForCli as R, listRecords as S, readNotes as T, appendEvent as U, writeKeysPaced as V, gcInboxes as W, daemonLockDir as X, shouldStealLock as Y, daemonLockOwnerPath as Z, isPidAlive as _, cmdHelp as a, isUserTyping as b, deriveLiveState as c, extractMenu as d, extractNeedsInput as f, isExitRequest as g, isAgentStuck as h, backoffWhileTyping as i, resolveOne as j, renderRawLog as k, deriveLiveStatus as l, finalizedLines as m, READ_PAGE_DEFAULT as n, controlCodeFromName as o, extractTaskCounts as p, liveWatchers as q, TYPING_WINDOW_MS as r, cursorAbs as s, GRACEFUL_EXIT_COMMANDS as t, extractBadges as u, isSlashCommand as v, menuSelectKeys as w, lastStdinAt as x, isSubcommand as y, submitAndConfirm as z };
|
|
4100
|
-
//# sourceMappingURL=subcommands-
|
|
4108
|
+
//# sourceMappingURL=subcommands-IIDRpOa1.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-DEJVuzWZ.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-BdFKarex.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.192.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-DEJVuzWZ.js.map
|