agent-yes 1.222.0 → 1.223.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.
Files changed (37) hide show
  1. package/dist/SUPPORTED_CLIS-6VyrMWG_.js +9 -0
  2. package/dist/{SUPPORTED_CLIS-NO8CNV4I.js → SUPPORTED_CLIS-91SHco8n.js} +2 -2
  3. package/dist/{agentShare-BAZo8fhy.js → agentShare-CXksKQvX.js} +3 -3
  4. package/dist/callback-8taXMdxt.js +12 -0
  5. package/dist/callback-C1ICxY94.js +190 -0
  6. package/dist/callbackCore-BbAMbeUp.js +3 -0
  7. package/dist/callbackCore-Cm_yYhep.js +143 -0
  8. package/dist/cli.js +8 -8
  9. package/dist/{expose-k9l6ZJDA.js → expose-BiFqNtOa.js} +1 -1
  10. package/dist/{forkNested-DOyDAHnC.js → forkNested-BCxO485A.js} +1 -1
  11. package/dist/index.js +2 -2
  12. package/dist/{nodeRuntime-CwNJuwH5.js → nodeRuntime-DttG711L.js} +1 -1
  13. package/dist/{notifyDaemon-BWxrF51X.js → notifyDaemon-C4Z9gxKe.js} +3 -3
  14. package/dist/{openBrowser-CSj21pZE.js → openBrowser-C2xmaYpe.js} +1 -1
  15. package/dist/{remotes-CXqYR0p8.js → remotes-B4R8KvWI.js} +1 -1
  16. package/dist/{remotes-Cim0dBU7.js → remotes-CZGDxzIP.js} +2 -2
  17. package/dist/{rustBinary-bjsIF5tk.js → rustBinary-CODJm5nX.js} +2 -2
  18. package/dist/{schedule-B5mfMpfu.js → schedule-CmbUKK0u.js} +6 -6
  19. package/dist/{serve-DpROr97O.js → serve-D1GP9e62.js} +101 -22
  20. package/dist/{setup-CPfb71tO.js → setup-p9dIsEH2.js} +3 -3
  21. package/dist/{spawnGate-CXjEz6Pf.js → spawnGate-SmqvtNIZ.js} +2 -2
  22. package/dist/{spawnGate-BkjeS4tg.js → spawnGate-vT9DJbq0.js} +1 -1
  23. package/dist/{subcommands-WdLz72ko.js → subcommands-CvmstmY_.js} +2 -2
  24. package/dist/{subcommands-B9HQUUSg.js → subcommands-D2llN6dR.js} +17 -12
  25. package/dist/{tray-BSFi35Qg.js → tray-xmaEYe1N.js} +1 -1
  26. package/dist/{ts-CkxkaoIt.js → ts-74aVYJYj.js} +2 -2
  27. package/dist/{versionChecker-jVH7G--O.js → versionChecker-QP6QKiG-.js} +2 -2
  28. package/dist/{webrtcRemote-CvIEfWX8.js → webrtcRemote-CMWelyTZ.js} +1 -1
  29. package/dist/{workspaceConfig-CjaRvTjf.js → workspaceConfig-Dcbe4y77.js} +1 -1
  30. package/dist/{ws-BpdOyhUQ.js → ws-93eeiNKB.js} +4 -4
  31. package/package.json +1 -1
  32. package/ts/callback.ts +239 -0
  33. package/ts/callbackCore.spec.ts +139 -0
  34. package/ts/callbackCore.ts +180 -0
  35. package/ts/serve.ts +95 -0
  36. package/ts/subcommands.ts +6 -0
  37. package/dist/SUPPORTED_CLIS-DAtTonEf.js +0 -9
@@ -1,21 +1,23 @@
1
- import "./ts-CkxkaoIt.js";
1
+ import "./ts-74aVYJYj.js";
2
2
  import "./logger-CDIsZ-Pp.js";
3
- import { r as getInstalledPackage } from "./versionChecker-jVH7G--O.js";
4
- import { t as findSpawnHiddenLauncher } from "./rustBinary-bjsIF5tk.js";
3
+ import { r as getInstalledPackage } from "./versionChecker-QP6QKiG-.js";
4
+ import { t as findSpawnHiddenLauncher } from "./rustBinary-CODJm5nX.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-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";
11
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-91SHco8n.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-D2llN6dR.js";
13
13
  import "./e2e-jb0Hp43q.js";
14
14
  import "./webrtcLink-B7REGtK2.js";
15
- import "./remotes-Cim0dBU7.js";
16
- import { a as getSpawnHook, c as hasProvisionHook, d as resolveSpawnCwd, i as getProvisionRoot, l as hasSpawnHook, r as getProvisionHook, u as isProvisionAllowed } from "./workspaceConfig-CjaRvTjf.js";
17
- import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-CwNJuwH5.js";
18
- import { r as spawnRejectionReason } from "./spawnGate-CXjEz6Pf.js";
15
+ import "./remotes-CZGDxzIP.js";
16
+ import { i as frameVisitorMessage, s as verifyCapability, t as MAX_CALLBACK_MSG_BYTES } from "./callbackCore-Cm_yYhep.js";
17
+ import { n as isCallbackRevoked, r as loadCallbackSecretReadOnly } from "./callback-C1ICxY94.js";
18
+ import { a as getSpawnHook, c as hasProvisionHook, d as resolveSpawnCwd, i as getProvisionRoot, l as hasSpawnHook, r as getProvisionHook, u as isProvisionAllowed } from "./workspaceConfig-Dcbe4y77.js";
19
+ import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-DttG711L.js";
20
+ import { r as spawnRejectionReason } from "./spawnGate-SmqvtNIZ.js";
19
21
  import yargs from "yargs";
20
22
  import { appendFile, mkdir, open, readFile, rename, rm, stat, unlink, writeFile } from "fs/promises";
21
23
  import { arch, cpus, freemem, homedir, hostname, loadavg, platform, totalmem, uptime, userInfo } from "os";
@@ -831,6 +833,14 @@ async function portlessAppPort() {
831
833
  return null;
832
834
  }
833
835
  }
836
+ async function resolveLocalServeUrl() {
837
+ const mgr = await resolveActiveManager();
838
+ const daemonArgs = mgr ? await readDaemonServeArgs(mgr) : null;
839
+ if (daemonArgs === null) return null;
840
+ if (argsUsePortless(daemonArgs)) return (await resolvedPortlessConsoleUrl()).replace(/\/+$/, "");
841
+ const port = portFromArgs(daemonArgs);
842
+ return port ? `http://127.0.0.1:${port}` : null;
843
+ }
834
844
  async function warnStrayServeProcesses() {
835
845
  const stray = await listStrayServeProcesses();
836
846
  if (stray.length === 0) return;
@@ -947,7 +957,7 @@ async function cmdServeDaemon(sub, args) {
947
957
  if (!webrtcDaemon) return;
948
958
  if (shareLink) {
949
959
  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` : ``));
950
- const { offerOpenInBrowser } = await import("./openBrowser-CSj21pZE.js");
960
+ const { offerOpenInBrowser } = await import("./openBrowser-C2xmaYpe.js");
951
961
  await offerOpenInBrowser(shareLink);
952
962
  } 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");
953
963
  };
@@ -1987,7 +1997,7 @@ Options:
1987
1997
  }
1988
1998
  });
1989
1999
  if (req.method === "GET" && p === "/api/ws") {
1990
- const ws = await import("./ws-BpdOyhUQ.js");
2000
+ const ws = await import("./ws-93eeiNKB.js");
1991
2001
  try {
1992
2002
  await ws.loadProvision();
1993
2003
  } catch (e) {
@@ -2007,7 +2017,7 @@ Options:
2007
2017
  if (req.method === "GET" && p === "/api/ws/status") {
2008
2018
  const dirRaw = url.searchParams.get("path");
2009
2019
  if (!dirRaw) return new Response("missing ?path=<workspace dir>", { status: 400 });
2010
- const ws = await import("./ws-BpdOyhUQ.js");
2020
+ const ws = await import("./ws-93eeiNKB.js");
2011
2021
  let prov;
2012
2022
  try {
2013
2023
  prov = await ws.loadProvision();
@@ -2596,7 +2606,7 @@ Options:
2596
2606
  const perm = body.perm ?? "r";
2597
2607
  if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
2598
2608
  try {
2599
- const { createScopedShare } = await import("./agentShare-BAZo8fhy.js");
2609
+ const { createScopedShare } = await import("./agentShare-CXksKQvX.js");
2600
2610
  const share = await createScopedShare({
2601
2611
  agent: body.agent,
2602
2612
  perm,
@@ -2611,12 +2621,12 @@ Options:
2611
2621
  }
2612
2622
  }
2613
2623
  if (req.method === "GET" && p === "/api/shares") {
2614
- const { listShares } = await import("./agentShare-BAZo8fhy.js");
2624
+ const { listShares } = await import("./agentShare-CXksKQvX.js");
2615
2625
  return Response.json(listShares());
2616
2626
  }
2617
2627
  const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
2618
2628
  if (req.method === "DELETE" && revokeM) {
2619
- const { revokeShare } = await import("./agentShare-BAZo8fhy.js");
2629
+ const { revokeShare } = await import("./agentShare-CXksKQvX.js");
2620
2630
  const ok = revokeShare(decodeURIComponent(revokeM[1]));
2621
2631
  return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
2622
2632
  }
@@ -2630,7 +2640,7 @@ Options:
2630
2640
  const port = Number(body.port);
2631
2641
  if (!Number.isInteger(port) || port < 1 || port > 65535) return new Response("valid port required", { status: 400 });
2632
2642
  try {
2633
- const { ensureExposure } = await import("./expose-k9l6ZJDA.js");
2643
+ const { ensureExposure } = await import("./expose-BiFqNtOa.js");
2634
2644
  const h = await ensureExposure(port, body.relay);
2635
2645
  return Response.json({
2636
2646
  id: h.id,
@@ -2644,12 +2654,12 @@ Options:
2644
2654
  }
2645
2655
  }
2646
2656
  if (req.method === "GET" && p === "/api/exposes") {
2647
- const { listExposures } = await import("./expose-k9l6ZJDA.js");
2657
+ const { listExposures } = await import("./expose-BiFqNtOa.js");
2648
2658
  return Response.json(listExposures());
2649
2659
  }
2650
2660
  const unexposeM = /^\/api\/expose\/(\d+)$/.exec(p);
2651
2661
  if (req.method === "DELETE" && unexposeM) {
2652
- const { stopExposure } = await import("./expose-k9l6ZJDA.js");
2662
+ const { stopExposure } = await import("./expose-BiFqNtOa.js");
2653
2663
  const ok = stopExposure(Number(unexposeM[1]));
2654
2664
  return new Response(ok ? "revoked" : "no such exposure", { status: ok ? 200 : 404 });
2655
2665
  }
@@ -2681,6 +2691,74 @@ Options:
2681
2691
  return new Response("UI assets not found in this install — use the /api endpoints", { status: 404 });
2682
2692
  }
2683
2693
  };
2694
+ const CB_CORS = {
2695
+ "Access-Control-Allow-Origin": "*",
2696
+ "Access-Control-Allow-Methods": "POST, OPTIONS",
2697
+ "Access-Control-Allow-Headers": "Content-Type"
2698
+ };
2699
+ const cbJson = (status, body) => Response.json(body, {
2700
+ status,
2701
+ headers: CB_CORS
2702
+ });
2703
+ const CB_RATE_MAX = 6;
2704
+ const CB_RATE_WINDOW_MS = 6e4;
2705
+ const cbRecent = /* @__PURE__ */ new Map();
2706
+ const handleCallback = async (req, p) => {
2707
+ if (req.method === "OPTIONS") return new Response(null, {
2708
+ status: 204,
2709
+ headers: CB_CORS
2710
+ });
2711
+ if (req.method !== "POST") return cbJson(405, { error: "POST only" });
2712
+ const cap = p.slice(4);
2713
+ const secret = loadCallbackSecretReadOnly();
2714
+ if (!secret) return cbJson(404, { error: "unknown" });
2715
+ const v = verifyCapability(secret, cap, Date.now());
2716
+ if (!v.ok) {
2717
+ if (v.reason === "expired") return cbJson(410, { expired: true });
2718
+ return cbJson(404, { error: "unknown" });
2719
+ }
2720
+ if (isCallbackRevoked(v.payload.id)) return cbJson(410, { expired: true });
2721
+ const now = Date.now();
2722
+ const recent = (cbRecent.get(v.payload.id) ?? []).filter((t) => now - t < CB_RATE_WINDOW_MS);
2723
+ if (recent.length >= CB_RATE_MAX) return cbJson(429, { error: "rate limited" });
2724
+ recent.push(now);
2725
+ cbRecent.set(v.payload.id, recent);
2726
+ let msg;
2727
+ try {
2728
+ const body = await req.json();
2729
+ msg = String(body?.msg ?? "").trim();
2730
+ } catch {
2731
+ return cbJson(400, { error: "invalid JSON body" });
2732
+ }
2733
+ if (!msg) return cbJson(400, { error: "empty message" });
2734
+ if (Buffer.byteLength(msg, "utf8") > MAX_CALLBACK_MSG_BYTES) return cbJson(413, { error: "message too large" });
2735
+ try {
2736
+ const record = await resolveOne(v.payload.agent, defaultOpts());
2737
+ if (record.agent_id !== v.payload.agent || !record.fifo_file) return cbJson(409, { error: "agent unavailable" });
2738
+ const framed = frameVisitorMessage(v.payload.id, msg);
2739
+ await writeToIpc(record.fifo_file, framed);
2740
+ await new Promise((r) => setTimeout(r, 200));
2741
+ await writeToIpc(record.fifo_file, controlCodeFromName("enter"));
2742
+ await noteStdinWrite(record.pid, record.fifo_file, true);
2743
+ await recordInbox({
2744
+ at: Date.now(),
2745
+ from: null,
2746
+ to: {
2747
+ pid: record.pid,
2748
+ cli: record.cli,
2749
+ cwd: record.cwd,
2750
+ agent_id: record.agent_id
2751
+ },
2752
+ body: framed,
2753
+ confirmed: true,
2754
+ wrapped: true,
2755
+ remote: "wire"
2756
+ });
2757
+ return cbJson(200, { ok: true });
2758
+ } catch {
2759
+ return cbJson(409, { error: "agent unavailable" });
2760
+ }
2761
+ };
2684
2762
  const httpFetch = async (req, srv) => {
2685
2763
  const p = new URL(req.url).pathname;
2686
2764
  if (req.method === "GET" && (p === "/" || p === "/index.html")) return serveUiFile("index.html", "text/html; charset=utf-8");
@@ -2697,6 +2775,7 @@ Options:
2697
2775
  if (req.method === "GET" && p === "/manifest.webmanifest") return serveUiFile("manifest.webmanifest", "application/manifest+json");
2698
2776
  if (req.method === "GET" && p === "/icon.svg") return serveUiFile("icon.svg", "image/svg+xml");
2699
2777
  if (req.method === "GET" && p === "/favicon.ico") return new Response(null, { status: 204 });
2778
+ if (p.startsWith("/cb/")) return handleCallback(req, p);
2700
2779
  return apiFetch(req, srv);
2701
2780
  };
2702
2781
  const serverOpts = {
@@ -2807,7 +2886,7 @@ Options:
2807
2886
  const persistNote = explicitUrl ? "\n" : ` (persistent room — same link across restarts; delete ~/.agent-yes/.share-room to rotate)\n\n`;
2808
2887
  process.stdout.write(`${wantHttp ? "\n" : ""}${lead}:\n ${link}\n` + persistNote);
2809
2888
  if (!rotated) {
2810
- const { offerOpenInBrowser } = await import("./openBrowser-CSj21pZE.js");
2889
+ const { offerOpenInBrowser } = await import("./openBrowser-C2xmaYpe.js");
2811
2890
  await offerOpenInBrowser(link);
2812
2891
  }
2813
2892
  } else {
@@ -2849,7 +2928,7 @@ Options:
2849
2928
  const shutdown = (resolve) => {
2850
2929
  if (heartbeat) clearInterval(heartbeat);
2851
2930
  closeShare?.();
2852
- import("./agentShare-BAZo8fhy.js").then((m) => m.revokeAllShares()).catch(() => {});
2931
+ import("./agentShare-CXksKQvX.js").then((m) => m.revokeAllShares()).catch(() => {});
2853
2932
  server?.stop();
2854
2933
  Promise.resolve(releaseHostLock?.()).catch(() => {}).then(resolve);
2855
2934
  };
@@ -2861,5 +2940,5 @@ Options:
2861
2940
  }
2862
2941
 
2863
2942
  //#endregion
2864
- export { cmdServe };
2865
- //# sourceMappingURL=serve-DpROr97O.js.map
2943
+ export { cmdServe, resolveLocalServeUrl };
2944
+ //# sourceMappingURL=serve-D1GP9e62.js.map
@@ -1,4 +1,4 @@
1
- import { f as setWorkspaceRoot, s as getWorkspaceRoot } from "./workspaceConfig-CjaRvTjf.js";
1
+ import { f as setWorkspaceRoot, s as getWorkspaceRoot } from "./workspaceConfig-Dcbe4y77.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-DpROr97O.js");
35
+ const { cmdServe } = await import("./serve-D1GP9e62.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-CPfb71tO.js.map
45
+ //# sourceMappingURL=setup-p9dIsEH2.js.map
@@ -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-CjaRvTjf.js";
2
+ import { n as getMinFreeMb, o as getSpawnWaitMs, t as getMaxAgents } from "./workspaceConfig-Dcbe4y77.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-CXjEz6Pf.js.map
107
+ //# sourceMappingURL=spawnGate-SmqvtNIZ.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-CXjEz6Pf.js";
3
+ import { i as waitForSpawnCapacity, n as spawnGateEnabled, r as spawnRejectionReason, t as memAvailableMb } from "./spawnGate-SmqvtNIZ.js";
4
4
 
5
5
  export { waitForSpawnCapacity };
@@ -2,9 +2,9 @@ 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-B9HQUUSg.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-D2llN6dR.js";
6
6
  import "./e2e-jb0Hp43q.js";
7
7
  import "./webrtcLink-B7REGtK2.js";
8
- import "./remotes-Cim0dBU7.js";
8
+ import "./remotes-CZGDxzIP.js";
9
9
 
10
10
  export { cmdHelp, isSubcommand, runSubcommand };
@@ -5,7 +5,7 @@ import { a as updateGlobalPidStatus, i as readGlobalPids } from "./globalPidInde
5
5
  import { a as recordOutbox, i as recordMessage, n as readMailbox, t as partyMatches } from "./messageLog-CxrKJj77.js";
6
6
  import { t as loadSharedCliDefaults } from "./configShared-aKTg-sa5.js";
7
7
  import { n as isWebrtcSpec } from "./webrtcLink-B7REGtK2.js";
8
- import { a as resolveRemoteSpec, i as readRemotes } from "./remotes-Cim0dBU7.js";
8
+ import { a as resolveRemoteSpec, i as readRemotes } from "./remotes-CZGDxzIP.js";
9
9
  import ms from "ms";
10
10
  import yargs from "yargs";
11
11
  import { appendFile, mkdir, open, readFile, readdir, rename, rm, stat, writeFile } from "fs/promises";
@@ -1177,6 +1177,7 @@ const SUBCOMMANDS = new Set([
1177
1177
  "schedule",
1178
1178
  "remote",
1179
1179
  "expose",
1180
+ "callback",
1180
1181
  "reap",
1181
1182
  "help"
1182
1183
  ]);
@@ -1237,29 +1238,33 @@ async function runSubcommand(argv) {
1237
1238
  case "restart": return await cmdRestart(rest);
1238
1239
  case "note": return await cmdNote(rest);
1239
1240
  case "serve": {
1240
- const { cmdServe } = await import("./serve-DpROr97O.js");
1241
+ const { cmdServe } = await import("./serve-D1GP9e62.js");
1241
1242
  return cmdServe(rest);
1242
1243
  }
1243
1244
  case "setup": {
1244
- const { cmdSetup } = await import("./setup-CPfb71tO.js");
1245
+ const { cmdSetup } = await import("./setup-p9dIsEH2.js");
1245
1246
  return cmdSetup(rest);
1246
1247
  }
1247
1248
  case "ws": {
1248
- const { cmdWs } = await import("./ws-BpdOyhUQ.js");
1249
+ const { cmdWs } = await import("./ws-93eeiNKB.js");
1249
1250
  return cmdWs(rest);
1250
1251
  }
1251
1252
  case "schedule": {
1252
- const { cmdSchedule } = await import("./schedule-B5mfMpfu.js");
1253
+ const { cmdSchedule } = await import("./schedule-CmbUKK0u.js");
1253
1254
  return cmdSchedule(rest);
1254
1255
  }
1255
1256
  case "remote": {
1256
- const { cmdRemote } = await import("./remotes-CXqYR0p8.js");
1257
+ const { cmdRemote } = await import("./remotes-B4R8KvWI.js");
1257
1258
  return cmdRemote(rest);
1258
1259
  }
1259
1260
  case "expose": {
1260
- const { cmdExpose } = await import("./expose-k9l6ZJDA.js");
1261
+ const { cmdExpose } = await import("./expose-BiFqNtOa.js");
1261
1262
  return cmdExpose(rest);
1262
1263
  }
1264
+ case "callback": {
1265
+ const { cmdCallback } = await import("./callback-8taXMdxt.js");
1266
+ return cmdCallback(rest);
1267
+ }
1263
1268
  case "reap":
1264
1269
  await (await import("./reaper-CJSu8UVZ.js")).sweep();
1265
1270
  return 0;
@@ -1295,7 +1300,7 @@ async function cmdHelp(managerCommands = true) {
1295
1300
  const wsLines = managerCommands ? " ay ws ls [--status] list <owner>/<repo>/tree/<branch> workspaces\n ay ws new <owner>/<repo>[@branch] clone/refresh a workspace (ay ws help for more)\n" : ``;
1296
1301
  const self = process.env.AGENT_YES_PID ? await resolveSender() : null;
1297
1302
  const agentSection = self ? await buildAgentContextSection(self) : "";
1298
- process.stdout.write(agentSection + "ay - agent-yes CLI\n\nManagement:\n ay ls [keyword] list running agents\n ay tail [-f] [-n N] <keyword> last N lines (96), -f to follow\n ay read <keyword> [page opts] paginate: --last/--head N, --range A:B,\n --before-line L [--limit N]\n ay cat <keyword> full log\n ay head <keyword> first N lines\n ay send <keyword> <msg> send a message\n ay msgs [keyword] [--in|--out] inter-agent message log (sent + received)\n ay key <keyword> <key...> send raw keystrokes (down/up/enter/esc/…) — drives menus\n ay select <keyword> <N> pick option N of a needs_input selection menu\n ay attach <keyword> interactive attach (detach: Ctrl-\\)\n ay stop <keyword> graceful shutdown (/exit for claude/codex)\n ay exit <keyword> [reason] graceful shutdown, recording who/why (= 'ay send <kw> exit')\n ay restart <keyword> [--fresh] stop (if live) + relaunch resuming the session; --fresh replays the prompt\n ay status <keyword> agent status snapshot\n ay result <keyword> [--wait] pull an agent's structured result envelope\n ay result set '<json>' (inside an agent) deposit your result envelope\n ay reap kill process groups leaked by dead agents\n" + wsLines + "\nRemote:\n" + setupLine + " ay schedule <when> <cli> -- <msg> run an agent on a schedule (HH:MM or cron)\n ay serve [--port N] start HTTP API server (prints token)\n ay serve status show serve daemon/server status\n ay remote add <alias> http://<token>@<host>:<port>\n ay remote ls / rm <alias> manage saved remotes\n ay expose <port> share localhost:<port> at https://<id>.agent-yes.com (private link)\n ay ls <token>@<host>:<port> connect inline (no alias needed)\n ay send <token>@<host>:<port>:<kw> <msg>\n\nRun an agent:\n ay [claude|codex|gemini|...] [options] -- [prompt]\n ay claude -- \"fix the bug in auth.ts\"\n ay claude --help full agent-runner options\n\nLabs (examples at https://github.com/snomiao/agent-yes/tree/main/lab):\n local-role-play/ designer + builder on one machine\n http-remote/ ay serve remote access demo\n p2p-pairing/ libp2p P2P (needs: cargo build --features swarm)\n");
1303
+ process.stdout.write(agentSection + "ay - agent-yes CLI\n\nManagement:\n ay ls [keyword] list running agents\n ay tail [-f] [-n N] <keyword> last N lines (96), -f to follow\n ay read <keyword> [page opts] paginate: --last/--head N, --range A:B,\n --before-line L [--limit N]\n ay cat <keyword> full log\n ay head <keyword> first N lines\n ay send <keyword> <msg> send a message\n ay msgs [keyword] [--in|--out] inter-agent message log (sent + received)\n ay key <keyword> <key...> send raw keystrokes (down/up/enter/esc/…) — drives menus\n ay select <keyword> <N> pick option N of a needs_input selection menu\n ay attach <keyword> interactive attach (detach: Ctrl-\\)\n ay stop <keyword> graceful shutdown (/exit for claude/codex)\n ay exit <keyword> [reason] graceful shutdown, recording who/why (= 'ay send <kw> exit')\n ay restart <keyword> [--fresh] stop (if live) + relaunch resuming the session; --fresh replays the prompt\n ay status <keyword> agent status snapshot\n ay result <keyword> [--wait] pull an agent's structured result envelope\n ay result set '<json>' (inside an agent) deposit your result envelope\n ay reap kill process groups leaked by dead agents\n" + wsLines + "\nRemote:\n" + setupLine + " ay schedule <when> <cli> -- <msg> run an agent on a schedule (HH:MM or cron)\n ay serve [--port N] start HTTP API server (prints token)\n ay serve status show serve daemon/server status\n ay remote add <alias> http://<token>@<host>:<port>\n ay remote ls / rm <alias> manage saved remotes\n ay expose <port> share localhost:<port> at https://<id>.agent-yes.com (private link)\n ay callback --expires 7d mint an embeddable message-me widget for one agent\n ay ls <token>@<host>:<port> connect inline (no alias needed)\n ay send <token>@<host>:<port>:<kw> <msg>\n\nRun an agent:\n ay [claude|codex|gemini|...] [options] -- [prompt]\n ay claude -- \"fix the bug in auth.ts\"\n ay claude --help full agent-runner options\n\nLabs (examples at https://github.com/snomiao/agent-yes/tree/main/lab):\n local-role-play/ designer + builder on one machine\n http-remote/ ay serve remote access demo\n p2p-pairing/ libp2p P2P (needs: cargo build --features swarm)\n");
1299
1304
  return 0;
1300
1305
  }
1301
1306
  function matchKeyword(record, keyword) {
@@ -1674,7 +1679,7 @@ async function fetchRemoteRecordsRaw(url, token, opts) {
1674
1679
  let base = url;
1675
1680
  let bearer = token;
1676
1681
  if (isWebrtcSpec(url)) {
1677
- const { startWebrtcBridge } = await import("./webrtcRemote-CvIEfWX8.js");
1682
+ const { startWebrtcBridge } = await import("./webrtcRemote-CMWelyTZ.js");
1678
1683
  bridge = await startWebrtcBridge(url);
1679
1684
  base = bridge.baseUrl;
1680
1685
  bearer = bridge.token;
@@ -4269,7 +4274,7 @@ async function cmdNotify(rest) {
4269
4274
  }
4270
4275
  const ensure = async () => {
4271
4276
  if (!argv["ensure-daemon"]) return;
4272
- const { ensureDaemon } = await import("./notifyDaemon-BWxrF51X.js");
4277
+ const { ensureDaemon } = await import("./notifyDaemon-C4Z9gxKe.js");
4273
4278
  await ensureDaemon().catch(() => null);
4274
4279
  };
4275
4280
  await heartbeatWatcher(parent, selfStartedAt);
@@ -4343,7 +4348,7 @@ async function cmdNotifyCursor(args) {
4343
4348
  }
4344
4349
  async function cmdNotifyd(rest) {
4345
4350
  const sub = rest[0] ?? "status";
4346
- const daemon = await import("./notifyDaemon-BWxrF51X.js");
4351
+ const daemon = await import("./notifyDaemon-C4Z9gxKe.js");
4347
4352
  switch (sub) {
4348
4353
  case "run": return daemon.runDaemon();
4349
4354
  case "once": return daemon.runDaemon({ once: true });
@@ -4370,4 +4375,4 @@ async function cmdNotifyd(rest) {
4370
4375
 
4371
4376
  //#endregion
4372
4377
  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-B9HQUUSg.js.map
4378
+ //# sourceMappingURL=subcommands-D2llN6dR.js.map
@@ -187,4 +187,4 @@ async function startTray() {
187
187
 
188
188
  //#endregion
189
189
  export { ensureTray, startTray };
190
- //# sourceMappingURL=tray-BSFi35Qg.js.map
190
+ //# sourceMappingURL=tray-xmaEYe1N.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-jVH7G--O.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-QP6QKiG-.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-CkxkaoIt.js.map
1904
+ //# sourceMappingURL=ts-74aVYJYj.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.222.0";
10
+ var version = "1.223.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-jVH7G--O.js.map
218
+ //# sourceMappingURL=versionChecker-QP6QKiG-.js.map
@@ -256,4 +256,4 @@ async function startWebrtcBridge(link) {
256
256
 
257
257
  //#endregion
258
258
  export { startWebrtcBridge };
259
- //# sourceMappingURL=webrtcRemote-CvIEfWX8.js.map
259
+ //# sourceMappingURL=webrtcRemote-CMWelyTZ.js.map
@@ -193,4 +193,4 @@ function resolveSpawnCwd(input) {
193
193
 
194
194
  //#endregion
195
195
  export { getSpawnHook as a, hasProvisionHook as c, resolveSpawnCwd as d, setWorkspaceRoot as f, getProvisionRoot as i, hasSpawnHook as l, getMinFreeMb as n, getSpawnWaitMs as o, getProvisionHook as r, getWorkspaceRoot as s, getMaxAgents as t, isProvisionAllowed as u };
196
- //# sourceMappingURL=workspaceConfig-CjaRvTjf.js.map
196
+ //# sourceMappingURL=workspaceConfig-Dcbe4y77.js.map
@@ -2,11 +2,11 @@ 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-B9HQUUSg.js";
5
+ import { S as listRecords } from "./subcommands-D2llN6dR.js";
6
6
  import "./e2e-jb0Hp43q.js";
7
7
  import "./webrtcLink-B7REGtK2.js";
8
- import "./remotes-Cim0dBU7.js";
9
- import { i as getProvisionRoot } from "./workspaceConfig-CjaRvTjf.js";
8
+ import "./remotes-CZGDxzIP.js";
9
+ import { i as getProvisionRoot } from "./workspaceConfig-Dcbe4y77.js";
10
10
  import { existsSync } from "fs";
11
11
  import { lstat, opendir } from "fs/promises";
12
12
  import path from "path";
@@ -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-BpdOyhUQ.js.map
421
+ //# sourceMappingURL=ws-93eeiNKB.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.222.0",
3
+ "version": "1.223.0",
4
4
  "description": "A wrapper tool that automates interactions with various AI CLI tools by automatically handling common prompts and responses.",
5
5
  "keywords": [
6
6
  "ai",