agent-yes 1.307.0 → 1.308.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 (123) hide show
  1. package/README.md +53 -0
  2. package/dist/{JsonlStore-CB_0sfdT.js → JsonlStore-fEAVg5aY.js} +1 -1
  3. package/dist/SUPPORTED_CLIS-Ce_7n97m.js +12 -0
  4. package/dist/{SUPPORTED_CLIS-qL9_2DZ8.js → SUPPORTED_CLIS-DFpjQ2Ke.js} +2 -2
  5. package/dist/agent-yes.config-ByXwI-t3.js +47 -0
  6. package/dist/agentPermissions-CgM1bl6m.js +62 -0
  7. package/dist/{agentShare-C2oXrGvf.js → agentShare-Dz_T6b5v.js} +14 -14
  8. package/dist/{askCli-D4czi-_j.js → askCli-BjQOqpvv.js} +6 -6
  9. package/dist/{browser-BW90gl2w.js → browser-BzjhscIR.js} +5 -5
  10. package/dist/{browser-BAFPmEvN.js → browser-CU933aYj.js} +1 -1
  11. package/dist/{callback-ie8yyKma.js → callback-CAWItwdn.js} +5 -5
  12. package/dist/callback-oTjpUn2G.js +17 -0
  13. package/dist/{callbackCore-Deve5pv3.js → callbackCore-DoPrLOFY.js} +1 -1
  14. package/dist/{callbackCore-BZ_10zyc.js → callbackCore-TE7HjQm9.js} +1 -1
  15. package/dist/{channels-jIa5fNjY.js → channels-BGSdyeQs.js} +2 -2
  16. package/dist/{channels-Y36S0ccW.js → channels-bw-b9z0l.js} +6 -6
  17. package/dist/channels.js +5 -5
  18. package/dist/claude-DLN2dvVD.js +180 -0
  19. package/dist/cli.js +60 -15
  20. package/dist/{cmdDsh-DZ8bLsH7.js → cmdDsh-h7V2ThH5.js} +1 -1
  21. package/dist/{cmdKill-DUyZ7Dch.js → cmdKill-b5I7H8wx.js} +5 -5
  22. package/dist/{cmdPs-CfR5qCiO.js → cmdPs-RZU-tTd4.js} +14 -14
  23. package/dist/{agent-yes.config-CRfpdp3A.js → configLoader-CLSX_LND.js} +4 -42
  24. package/dist/configLoader-D9O9zwKR.js +5 -0
  25. package/dist/{configShared-De4bR5hH.js → configShared-B9gyn11R.js} +1 -1
  26. package/dist/{cwdConflictWarn-ml6Qs3Qu.js → cwdConflictWarn-BQ8vH915.js} +2 -2
  27. package/dist/{cwdPassthroughHint-CzWh0hrw.js → cwdPassthroughHint-h4dQQCLO.js} +1 -1
  28. package/dist/detach-B_n7xRl2.js +58 -0
  29. package/dist/{e2e-BdLf8DvY.js → e2e-C34A1uYu.js} +1 -1
  30. package/dist/{expose-Bhsn5yUz.js → expose-BKxcKYt-.js} +1 -1
  31. package/dist/{forceKill-BDqxx4uQ.js → forceKill-BAqKNR_f.js} +2 -2
  32. package/dist/{forkNested-DHuYbpaf.js → forkNested-CVSWfZT6.js} +3 -3
  33. package/dist/{globalPidIndex-DmDCB_X7.js → globalPidIndex-B5c_g_yJ.js} +1 -1
  34. package/dist/{globalPidIndex-C6p_AY4D.js → globalPidIndex-D9fxq9Ad.js} +10 -2
  35. package/dist/{hist-DY16wm7g.js → hist-OSUKO8sb.js} +1 -1
  36. package/dist/{html2canvas-pro.esm-Dp-JZojz.js → html2canvas-pro.esm-BW1GOcB-.js} +1 -1
  37. package/dist/{identity-D3hr59eC.js → identity-BVHHqtvP.js} +1 -1
  38. package/dist/{identity-puvd7hVQ.js → identity-CtwRW1nD.js} +1 -1
  39. package/dist/index.js +8 -8
  40. package/dist/{initMsg-GPU52N-j.js → initMsg-C1tgHfYP.js} +1 -1
  41. package/dist/{initMsg-BEVDWYnv.js → initMsg-CkrZjsX-.js} +1 -1
  42. package/dist/launch-BlKMU2ZA.js +74 -0
  43. package/dist/launch-CMran68t.js +3 -0
  44. package/dist/{messageLog-CEqe4Hk1.js → messageLog-BrXNxItW.js} +1 -1
  45. package/dist/{needsInput-hRiWFjGy.js → needsInput-B3aPVSqs.js} +1 -1
  46. package/dist/{nodeRuntime-DGMQRTGT.js → nodeRuntime-B1nCglgu.js} +1 -1
  47. package/dist/{notifyDaemon-DcAbvP43.js → notifyDaemon-Dh4cLfBU.js} +13 -13
  48. package/dist/{notifyStore-C4pH_-zJ.js → notifyStore-B7DLD83Q.js} +1 -1
  49. package/dist/{notifyStore-DIfkfKB2.js → notifyStore-CNdHlJyW.js} +1 -1
  50. package/dist/{openBrowser-CQAOIrD6.js → openBrowser-CwhGNBhv.js} +1 -1
  51. package/dist/oxmgrService-C0nYf9CD.js +3 -0
  52. package/dist/{oxmgrService-DlYHmqyI.js → oxmgrService-CBlFJ_-C.js} +2 -2
  53. package/dist/{parentLink-UiM6WoKm.js → parentLink-C2gocHk9.js} +2 -2
  54. package/dist/{parentLink-B7_kEM1v.js → parentLink-EVI_0cLu.js} +2 -2
  55. package/dist/{parentPingLoop-BYT4XgfN.js → parentPingLoop-B9QDw20l.js} +7 -7
  56. package/dist/peer-BSZQbKB7.js +4 -0
  57. package/dist/{peer-L-prov9t.js → peer-DI_xxui8.js} +3 -3
  58. package/dist/pidStore-BRU1Q0uN.js +6 -0
  59. package/dist/{pidStore-DUXifdBr.js → pidStore-DXEbQrh-.js} +3 -3
  60. package/dist/{procStats-DwTxj3rs.js → procStats-CkzFrwx7.js} +1 -1
  61. package/dist/{reaper-DsZhX5FH.js → reaper-A_eEjMxS.js} +1 -1
  62. package/dist/{reaper-C2cuougX.js → reaper-BTfq0-5j.js} +1 -1
  63. package/dist/{remotes-CAZymHd7.js → remotes-B0vw-dsd.js} +3 -3
  64. package/dist/{remotes-W6NhMDfP.js → remotes-TKXkCV76.js} +3 -3
  65. package/dist/roomReplyAlias-0xfUQlda.js +6 -0
  66. package/dist/{roomReplyAlias-B1EJft2d.js → roomReplyAlias-CkfEtW2v.js} +3 -3
  67. package/dist/runner-B1vocYOj.js +371 -0
  68. package/dist/{runningLock-DMznYh45.js → runningLock-DaVbNt4d.js} +1 -1
  69. package/dist/{rustBinary-BjsZbiv5.js → rustBinary-B603fLUa.js} +2 -2
  70. package/dist/{rustBinary-CXQGcJEm.js → rustBinary-CTEd2FnZ.js} +2 -2
  71. package/dist/{schedule-zacFV53l.js → schedule-DncJhp1d.js} +15 -15
  72. package/dist/{schedules-BvwTGXU2.js → schedules-D6hZ7VpJ.js} +1 -1
  73. package/dist/{schedulesCli-Donh0LS2.js → schedulesCli-DSBZwREE.js} +3 -3
  74. package/dist/{senderAncestry-KhAUPCQs.js → senderAncestry-Brb-cYni.js} +1 -1
  75. package/dist/{senderAncestry-CVHeKk1Y.js → senderAncestry-DqbNIecg.js} +1 -1
  76. package/dist/{serve-C38WYmzz.js → serve-BJEDb5Az.js} +52 -51
  77. package/dist/{serveRust-76_apYb8.js → serveRust-B50JWdfK.js} +3 -3
  78. package/dist/{setup-CeAisuhv.js → setup-CxQJtnmp.js} +4 -4
  79. package/dist/{share-_TPYAGWC.js → share-CPtJgXt2.js} +2 -2
  80. package/dist/{share-CbFetL5H.js → share-zVt71n2g.js} +2 -2
  81. package/dist/{shareCmd-foO5MbJp.js → shareCmd-96G551OE.js} +10 -10
  82. package/dist/{spawnGate-nUrmf4dd.js → spawnGate-BkkT7GF2.js} +3 -3
  83. package/dist/spawnGate-Ky21E51l.js +5 -0
  84. package/dist/{store-xmBpqPUq.js → store-MjCqeJDI.js} +1 -1
  85. package/dist/{subcommands-DE31Tfv_.js → subcommands-BJezWaHi.js} +455 -124
  86. package/dist/{subcommands-DLQEC24N.js → subcommands-DbdxjvFI.js} +12 -12
  87. package/dist/{systemPathLink-DI9WdoqQ.js → systemPathLink-BQE53HED.js} +1 -1
  88. package/dist/{terminal-CBbp6PfB.js → terminal-CLjXOXI7.js} +2 -2
  89. package/dist/terminal.js +1 -1
  90. package/dist/{todoAutomation-CKlrxuZv.js → todoAutomation-KgmnTAsD.js} +2 -2
  91. package/dist/{todoCli-BllShFnc.js → todoCli-ammnk6Wv.js} +6 -6
  92. package/dist/{todoIdentity-DeDp7LKl.js → todoIdentity-DzjduXlF.js} +2 -2
  93. package/dist/{todoStore-msRCEUi1.js → todoStore-Dre3Yhwt.js} +2 -2
  94. package/dist/{tray-RIjHSw7z.js → tray-C4sCiT8B.js} +2 -2
  95. package/dist/{trayApp-C9SZOPpw.js → trayApp-CZwRPF62.js} +2 -2
  96. package/dist/trayApp-UWX_Bfay.js +5 -0
  97. package/dist/{ts-CO1H1P2R.js → ts-J77_edCv.js} +20 -79
  98. package/dist/{versionChecker-CG--tQsV.js → versionChecker-DcrK7m4z.js} +2 -2
  99. package/dist/{webrtcLink-WxS1nTIs.js → webrtcLink-CGCXjlQJ.js} +2 -2
  100. package/dist/{webrtcLink-DcvacEci.js → webrtcLink-D4pMhyvY.js} +2 -2
  101. package/dist/{webrtcRemote-B4pwES4i.js → webrtcRemote-DdCC3aZC.js} +3 -3
  102. package/dist/{widget-CI7BtN94.js → widget-DU-iJOPF.js} +3 -3
  103. package/dist/widget.js +1 -1
  104. package/dist/widgets.js +5 -5
  105. package/dist/{workspaceConfig-DjEklzxf.js → workspaceConfig-BmK6COFt.js} +1 -1
  106. package/dist/{ws-DLJSBws6.js → ws-AZ6QSr2M.js} +3 -3
  107. package/dist/ws-CNd9TMOE.js +16 -0
  108. package/package.json +1 -1
  109. package/ts/cli.ts +40 -1
  110. package/ts/globalPidIndex.ts +19 -2
  111. package/ts/parseCliArgs.spec.ts +10 -0
  112. package/ts/parseCliArgs.ts +22 -0
  113. package/ts/subcommands.spec.ts +2 -2
  114. package/ts/subcommands.ts +186 -13
  115. package/dist/SUPPORTED_CLIS-BOGmmIrH.js +0 -12
  116. package/dist/callback-CNL-PGwh.js +0 -17
  117. package/dist/oxmgrService-o9L3I6FX.js +0 -3
  118. package/dist/peer-3F7owPWt.js +0 -4
  119. package/dist/pidStore-B89BOF_T.js +0 -6
  120. package/dist/roomReplyAlias-BeGVkAlc.js +0 -6
  121. package/dist/spawnGate-DhPgMs0Y.js +0 -5
  122. package/dist/trayApp-BSOmax2E.js +0 -5
  123. package/dist/ws-W5nWHjDt.js +0 -16
@@ -76,4 +76,4 @@ function isWorkingScreen(lines, working) {
76
76
 
77
77
  //#endregion
78
78
  export { isWorkingScreen as n, parseMenu as r, classifyNeedsInput as t };
79
- //# sourceMappingURL=needsInput-hRiWFjGy.js.map
79
+ //# sourceMappingURL=needsInput-B3aPVSqs.js.map
@@ -53,4 +53,4 @@ async function ensureNodeRuntime(which = Bun.which) {
53
53
 
54
54
  //#endregion
55
55
  export { liveEnv as n, ensureNodeRuntime as t };
56
- //# sourceMappingURL=nodeRuntime-DGMQRTGT.js.map
56
+ //# sourceMappingURL=nodeRuntime-B1nCglgu.js.map
@@ -1,16 +1,16 @@
1
1
  import { n as logger } from "./logger-CDIsZ-Pp.js";
2
- import "./JsonlStore-CB_0sfdT.js";
3
- import "./globalPidIndex-C6p_AY4D.js";
4
- import "./pidStore-DUXifdBr.js";
5
- import "./messageLog-CEqe4Hk1.js";
6
- import "./e2e-BdLf8DvY.js";
7
- import "./configShared-De4bR5hH.js";
8
- import { G as listRecords, I as isPidAlive, rt as renderLogTailLines, y as deriveLiveState } from "./subcommands-DE31Tfv_.js";
9
- import "./webrtcLink-DcvacEci.js";
10
- import "./remotes-CAZymHd7.js";
11
- import "./roomReplyAlias-B1EJft2d.js";
12
- import { f as readInbox, g as daemonLockOwnerPath, h as daemonLockDir, i as gcInboxes, l as listInboxParents, m as shouldStealLock, n as appendEvent, s as hostId, u as liveWatchers, x as notifyDir } from "./notifyStore-DIfkfKB2.js";
13
- import "./senderAncestry-CVHeKk1Y.js";
2
+ import "./JsonlStore-fEAVg5aY.js";
3
+ import "./globalPidIndex-D9fxq9Ad.js";
4
+ import "./pidStore-DXEbQrh-.js";
5
+ import "./messageLog-BrXNxItW.js";
6
+ import "./e2e-C34A1uYu.js";
7
+ import "./configShared-B9gyn11R.js";
8
+ import { G as listRecords, I as isPidAlive, rt as renderLogTailLines, y as deriveLiveState } from "./subcommands-BJezWaHi.js";
9
+ import "./webrtcLink-D4pMhyvY.js";
10
+ import "./remotes-B0vw-dsd.js";
11
+ import "./roomReplyAlias-CkfEtW2v.js";
12
+ import { f as readInbox, g as daemonLockOwnerPath, h as daemonLockDir, i as gcInboxes, l as listInboxParents, m as shouldStealLock, n as appendEvent, s as hostId, u as liveWatchers, x as notifyDir } from "./notifyStore-CNdHlJyW.js";
13
+ import "./senderAncestry-DqbNIecg.js";
14
14
  import { readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
15
15
  import { mkdir, readFile, rename, rm, stat, writeFile } from "fs/promises";
16
16
  import { randomUUID } from "node:crypto";
@@ -881,4 +881,4 @@ async function ensureDaemon() {
881
881
 
882
882
  //#endregion
883
883
  export { daemonStatus, ensureDaemon, requestDaemonStop, runDaemon };
884
- //# sourceMappingURL=notifyDaemon-DcAbvP43.js.map
884
+ //# sourceMappingURL=notifyDaemon-Dh4cLfBU.js.map
@@ -1,4 +1,4 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import { a as getCursor, c as isTransientLockMkdirError, d as minConsumerCursor, f as readInbox, i as gcInboxes, l as listInboxParents, m as shouldStealLock, n as appendEvent, o as heartbeatWatcher, p as setCursor, r as clearWatcher, s as hostId, t as acquireLock, u as liveWatchers } from "./notifyStore-DIfkfKB2.js";
2
+ import { a as getCursor, c as isTransientLockMkdirError, d as minConsumerCursor, f as readInbox, i as gcInboxes, l as listInboxParents, m as shouldStealLock, n as appendEvent, o as heartbeatWatcher, p as setCursor, r as clearWatcher, s as hostId, t as acquireLock, u as liveWatchers } from "./notifyStore-CNdHlJyW.js";
3
3
 
4
4
  export { liveWatchers };
@@ -556,4 +556,4 @@ async function liveWatchers(now = Date.now()) {
556
556
 
557
557
  //#endregion
558
558
  export { postmortemStartedAt as S, filterSinceSeq as _, getCursor as a, maxSeq as b, isTransientLockMkdirError as c, minConsumerCursor as d, readInbox as f, daemonLockOwnerPath as g, daemonLockDir as h, gcInboxes as i, listInboxParents as l, shouldStealLock as m, appendEvent as n, heartbeatWatcher as o, setCursor as p, clearWatcher as r, hostId as s, acquireLock as t, liveWatchers as u, filterSinceTs as v, notifyDir as x, filterUnread as y };
559
- //# sourceMappingURL=notifyStore-DIfkfKB2.js.map
559
+ //# sourceMappingURL=notifyStore-CNdHlJyW.js.map
@@ -68,4 +68,4 @@ async function offerOpenInBrowser(url, prompt = "Open in browser now? [Y/n] ") {
68
68
 
69
69
  //#endregion
70
70
  export { offerOpenInBrowser };
71
- //# sourceMappingURL=openBrowser-CQAOIrD6.js.map
71
+ //# sourceMappingURL=openBrowser-CwhGNBhv.js.map
@@ -0,0 +1,3 @@
1
+ import { t as ensureBootAutostart } from "./oxmgrService-CBlFJ_-C.js";
2
+
3
+ export { ensureBootAutostart };
@@ -1,4 +1,4 @@
1
- import { n as liveEnv } from "./nodeRuntime-DGMQRTGT.js";
1
+ import { n as liveEnv } from "./nodeRuntime-B1nCglgu.js";
2
2
 
3
3
  //#region ts/oxmgrService.ts
4
4
  async function ensureBootAutostart(oxmgrBin) {
@@ -34,4 +34,4 @@ async function ensureBootAutostart(oxmgrBin) {
34
34
 
35
35
  //#endregion
36
36
  export { ensureBootAutostart as t };
37
- //# sourceMappingURL=oxmgrService-DlYHmqyI.js.map
37
+ //# sourceMappingURL=oxmgrService-CBlFJ_-C.js.map
@@ -1,4 +1,4 @@
1
- import { o as readGlobalPids } from "./globalPidIndex-C6p_AY4D.js";
1
+ import { o as readGlobalPids } from "./globalPidIndex-D9fxq9Ad.js";
2
2
 
3
3
  //#region ts/parentLink.ts
4
4
  /**
@@ -50,4 +50,4 @@ function spawnerFromRecords(records, parentPid) {
50
50
 
51
51
  //#endregion
52
52
  export { spawnerFromRecords as n, resolveSpawner as t };
53
- //# sourceMappingURL=parentLink-UiM6WoKm.js.map
53
+ //# sourceMappingURL=parentLink-C2gocHk9.js.map
@@ -1,5 +1,5 @@
1
1
  import "./logger-CDIsZ-Pp.js";
2
- import "./globalPidIndex-C6p_AY4D.js";
3
- import { n as spawnerFromRecords, t as resolveSpawner } from "./parentLink-UiM6WoKm.js";
2
+ import "./globalPidIndex-D9fxq9Ad.js";
3
+ import { n as spawnerFromRecords, t as resolveSpawner } from "./parentLink-C2gocHk9.js";
4
4
 
5
5
  export { resolveSpawner };
@@ -1,8 +1,8 @@
1
1
  import { n as logger } from "./logger-CDIsZ-Pp.js";
2
- import "./globalPidIndex-C6p_AY4D.js";
3
- import { t as classifyNeedsInput } from "./needsInput-hRiWFjGy.js";
4
- import { n as replyTargetOf, r as shortenHome } from "./initMsg-BEVDWYnv.js";
5
- import { t as resolveSpawner } from "./parentLink-UiM6WoKm.js";
2
+ import "./globalPidIndex-D9fxq9Ad.js";
3
+ import { t as classifyNeedsInput } from "./needsInput-B3aPVSqs.js";
4
+ import { n as replyTargetOf, r as shortenHome } from "./initMsg-CkrZjsX-.js";
5
+ import { t as resolveSpawner } from "./parentLink-C2gocHk9.js";
6
6
  import { spawn } from "node:child_process";
7
7
 
8
8
  //#region ts/parentPing.ts
@@ -332,13 +332,13 @@ function shouldDeliverReport(opts) {
332
332
  */
333
333
  async function isParentWatching(parentWrapperPid, parentAgentPid, selfAgentPid, now = Date.now()) {
334
334
  try {
335
- const { liveWatchers } = await import("./notifyStore-C4pH_-zJ.js");
335
+ const { liveWatchers } = await import("./notifyStore-B7DLD83Q.js");
336
336
  if ((await liveWatchers(now)).has(parentWrapperPid)) return true;
337
337
  } catch (error) {
338
338
  logger.debug("[parent-ping] watcher lookup failed:", error);
339
339
  }
340
340
  try {
341
- const { lastReadAt, READ_WINDOW_MS } = await import("./subcommands-DLQEC24N.js");
341
+ const { lastReadAt, READ_WINDOW_MS } = await import("./subcommands-DbdxjvFI.js");
342
342
  const last = await lastReadAt(`agent:${parentAgentPid}`, selfAgentPid);
343
343
  if (last !== null && now - last <= READ_WINDOW_MS) return true;
344
344
  } catch (error) {
@@ -466,4 +466,4 @@ function startParentPingLoop(opts) {
466
466
 
467
467
  //#endregion
468
468
  export { startParentPingLoop };
469
- //# sourceMappingURL=parentPingLoop-BYT4XgfN.js.map
469
+ //# sourceMappingURL=parentPingLoop-B9QDw20l.js.map
@@ -0,0 +1,4 @@
1
+ import "./e2e-C34A1uYu.js";
2
+ import { t as ChannelPeer } from "./peer-DI_xxui8.js";
3
+
4
+ export { ChannelPeer };
@@ -1,5 +1,5 @@
1
- import { a as computeTranscriptHash, c as open, d as randomHex, f as seal, l as packEnvelope, n as FLAG_CONFIRM, o as deriveAuthToken, p as unpackEnvelope, s as deriveDirKeys, t as CONFIRM_TIMEOUT_MS } from "./e2e-BdLf8DvY.js";
2
- import { i as opsMissing, s as isValidOp, t as haveVector } from "./store-xmBpqPUq.js";
1
+ import { a as computeTranscriptHash, c as open, d as randomHex, f as seal, l as packEnvelope, n as FLAG_CONFIRM, o as deriveAuthToken, p as unpackEnvelope, s as deriveDirKeys, t as CONFIRM_TIMEOUT_MS } from "./e2e-C34A1uYu.js";
2
+ import { i as opsMissing, s as isValidOp, t as haveVector } from "./store-MjCqeJDI.js";
3
3
 
4
4
  //#region ts/channels/peer.ts
5
5
  const SIGNAL_SUBPROTOCOL = "ay-signal-1";
@@ -363,4 +363,4 @@ var ChannelPeer = class {
363
363
 
364
364
  //#endregion
365
365
  export { ChannelPeer as t };
366
- //# sourceMappingURL=peer-L-prov9t.js.map
366
+ //# sourceMappingURL=peer-DI_xxui8.js.map
@@ -0,0 +1,6 @@
1
+ import "./logger-CDIsZ-Pp.js";
2
+ import "./JsonlStore-fEAVg5aY.js";
3
+ import "./globalPidIndex-D9fxq9Ad.js";
4
+ import { t as PidStore } from "./pidStore-DXEbQrh-.js";
5
+
6
+ export { PidStore };
@@ -1,7 +1,7 @@
1
1
  import { n as logger } from "./logger-CDIsZ-Pp.js";
2
2
  import { t as agentYesHome } from "./agentYesHome-JmJC28YX.js";
3
- import { t as JsonlStore } from "./JsonlStore-CB_0sfdT.js";
4
- import { a as pruneOldLogs, c as updateGlobalPidStatus, i as maybeCompactGlobalPids, t as appendGlobalPid } from "./globalPidIndex-C6p_AY4D.js";
3
+ import { t as JsonlStore } from "./JsonlStore-fEAVg5aY.js";
4
+ import { a as pruneOldLogs, c as updateGlobalPidStatus, i as maybeCompactGlobalPids, t as appendGlobalPid } from "./globalPidIndex-D9fxq9Ad.js";
5
5
  import { mkdir, writeFile } from "fs/promises";
6
6
  import path from "path";
7
7
  import { randomBytes } from "node:crypto";
@@ -197,4 +197,4 @@ pid-db/
197
197
 
198
198
  //#endregion
199
199
  export { PidStore as t };
200
- //# sourceMappingURL=pidStore-DUXifdBr.js.map
200
+ //# sourceMappingURL=pidStore-DXEbQrh-.js.map
@@ -360,4 +360,4 @@ function humanBytes(bytes) {
360
360
 
361
361
  //#endregion
362
362
  export { systemStats as i, sampleTrees as n, snapshotProcs as r, humanBytes as t };
363
- //# sourceMappingURL=procStats-DwTxj3rs.js.map
363
+ //# sourceMappingURL=procStats-CkzFrwx7.js.map
@@ -1,3 +1,3 @@
1
- import { n as register, r as sweep, t as pgidForWrapper } from "./reaper-C2cuougX.js";
1
+ import { n as register, r as sweep, t as pgidForWrapper } from "./reaper-BTfq0-5j.js";
2
2
 
3
3
  export { sweep };
@@ -107,4 +107,4 @@ async function pruneStaleActivityMarkers() {
107
107
 
108
108
  //#endregion
109
109
  export { register as n, sweep as r, pgidForWrapper as t };
110
- //# sourceMappingURL=reaper-C2cuougX.js.map
110
+ //# sourceMappingURL=reaper-BTfq0-5j.js.map
@@ -1,4 +1,4 @@
1
- import { a as parseWebrtcLink, i as isWebrtcSpec, o as toWebrtcUrl, r as hasJoinSecret } from "./webrtcLink-DcvacEci.js";
1
+ import { a as parseWebrtcLink, i as isWebrtcSpec, o as toWebrtcUrl, r as hasJoinSecret } from "./webrtcLink-D4pMhyvY.js";
2
2
  import { mkdir, readFile, writeFile } from "fs/promises";
3
3
  import { homedir } from "os";
4
4
  import path from "path";
@@ -136,7 +136,7 @@ async function resolveRemoteSpec(spec) {
136
136
  * The bridge lives for the rest of the process (torn down on `process.exit`).
137
137
  */
138
138
  async function resolveWebrtc(link, keyword, label) {
139
- const { startWebrtcBridge } = await import("./webrtcRemote-B4pwES4i.js");
139
+ const { startWebrtcBridge } = await import("./webrtcRemote-DdCC3aZC.js");
140
140
  const bridge = await startWebrtcBridge(link, { keyword });
141
141
  return {
142
142
  url: bridge.baseUrl,
@@ -322,4 +322,4 @@ async function cmdConnect(rest) {
322
322
 
323
323
  //#endregion
324
324
  export { deleteRemoteAlias as a, parseShareUrl as c, writeRemoteAlias as d, defaultConnectAlias as i, readRemotes as l, cmdConnect as n, maskRemoteUrl as o, cmdRemote as r, parseDirectRemoteSpec as s, MASK as t, resolveRemoteSpec as u };
325
- //# sourceMappingURL=remotes-CAZymHd7.js.map
325
+ //# sourceMappingURL=remotes-B0vw-dsd.js.map
@@ -1,5 +1,5 @@
1
- import "./e2e-BdLf8DvY.js";
2
- import "./webrtcLink-DcvacEci.js";
3
- import { a as deleteRemoteAlias, c as parseShareUrl, d as writeRemoteAlias, i as defaultConnectAlias, l as readRemotes, n as cmdConnect, o as maskRemoteUrl, r as cmdRemote, s as parseDirectRemoteSpec, t as MASK, u as resolveRemoteSpec } from "./remotes-CAZymHd7.js";
1
+ import "./e2e-C34A1uYu.js";
2
+ import "./webrtcLink-D4pMhyvY.js";
3
+ import { a as deleteRemoteAlias, c as parseShareUrl, d as writeRemoteAlias, i as defaultConnectAlias, l as readRemotes, n as cmdConnect, o as maskRemoteUrl, r as cmdRemote, s as parseDirectRemoteSpec, t as MASK, u as resolveRemoteSpec } from "./remotes-B0vw-dsd.js";
4
4
 
5
5
  export { cmdConnect, cmdRemote };
@@ -0,0 +1,6 @@
1
+ import "./e2e-C34A1uYu.js";
2
+ import "./webrtcLink-D4pMhyvY.js";
3
+ import "./remotes-B0vw-dsd.js";
4
+ import { i as roomAliases, n as hostedRoomMember, r as roomAliasPlaceholder, t as fillRoomAlias } from "./roomReplyAlias-CkfEtW2v.js";
5
+
6
+ export { fillRoomAlias, roomAliases };
@@ -1,6 +1,6 @@
1
1
  import { t as agentYesHome } from "./agentYesHome-JmJC28YX.js";
2
- import { a as parseWebrtcLink } from "./webrtcLink-DcvacEci.js";
3
- import { l as readRemotes } from "./remotes-CAZymHd7.js";
2
+ import { a as parseWebrtcLink } from "./webrtcLink-D4pMhyvY.js";
3
+ import { l as readRemotes } from "./remotes-B0vw-dsd.js";
4
4
  import { readFile } from "fs/promises";
5
5
  import { hostname } from "os";
6
6
  import path from "path";
@@ -55,4 +55,4 @@ async function hostedRoomMember(room) {
55
55
 
56
56
  //#endregion
57
57
  export { roomAliases as i, hostedRoomMember as n, roomAliasPlaceholder as r, fillRoomAlias as t };
58
- //# sourceMappingURL=roomReplyAlias-B1EJft2d.js.map
58
+ //# sourceMappingURL=roomReplyAlias-CkfEtW2v.js.map
@@ -0,0 +1,371 @@
1
+ import "./logger-CDIsZ-Pp.js";
2
+ import { t as agentYesHome } from "./agentYesHome-JmJC28YX.js";
3
+ import { i as stripClaudeSessionPin, t as derivePermissions } from "./agentPermissions-CgM1bl6m.js";
4
+ import { c as updateGlobalPidStatus, t as appendGlobalPid } from "./globalPidIndex-D9fxq9Ad.js";
5
+ import { n as register } from "./reaper-BTfq0-5j.js";
6
+ import { t as ClaudeAdapter } from "./claude-DLN2dvVD.js";
7
+ import { n as nativeFlagValue } from "./launch-BlKMU2ZA.js";
8
+ import { closeSync, constants, createWriteStream, mkdirSync, openSync, readSync, unlinkSync } from "node:fs";
9
+ import path from "node:path";
10
+ import { randomUUID } from "node:crypto";
11
+ import { spawnSync } from "node:child_process";
12
+ import { once } from "node:events";
13
+ import { finished } from "node:stream/promises";
14
+ import { StringDecoder } from "node:string_decoder";
15
+ import { Readable } from "node:stream";
16
+
17
+ //#region ts/stream/output.ts
18
+ /** Observe EOF immediately, while allowing file backpressure to resume the readers. */
19
+ function captureOutput(stdout, stderr, logs, onError) {
20
+ const outputDone = Promise.all([finished(stdout, { cleanup: true }), finished(stderr, { cleanup: true })]).then(() => void 0, (error) => error);
21
+ for (const log of logs) {
22
+ log.on("error", onError);
23
+ log.on("drain", () => {
24
+ if (logs.every((stream) => !stream.writableNeedDrain)) {
25
+ stdout.resume();
26
+ stderr.resume();
27
+ }
28
+ });
29
+ }
30
+ return {
31
+ write(log, text) {
32
+ if (!log.write(text)) {
33
+ stdout.pause();
34
+ stderr.pause();
35
+ }
36
+ },
37
+ async drain(killed, timeoutMs) {
38
+ if (killed) return;
39
+ let timeout;
40
+ const error = await Promise.race([outputDone, new Promise((resolve) => {
41
+ timeout = setTimeout(() => resolve(/* @__PURE__ */ new Error("Timed out draining stream output after process-group cleanup")), timeoutMs);
42
+ })]);
43
+ if (timeout) clearTimeout(timeout);
44
+ return error;
45
+ }
46
+ };
47
+ }
48
+ /** Decode complete native records, including UTF-8 split across chunks and a final EOF record. */
49
+ function readNativeLines(source, onLine) {
50
+ let pending = "";
51
+ const decoder = new StringDecoder("utf8");
52
+ source.on("data", (chunk) => {
53
+ pending += decoder.write(chunk);
54
+ let end;
55
+ while ((end = pending.indexOf("\n")) !== -1) {
56
+ const line = pending.slice(0, end);
57
+ pending = pending.slice(end + 1);
58
+ if (line.trim()) onLine(line);
59
+ }
60
+ });
61
+ source.on("end", () => {
62
+ pending += decoder.end();
63
+ if (pending.trim()) onLine(pending);
64
+ pending = "";
65
+ });
66
+ }
67
+
68
+ //#endregion
69
+ //#region ts/stream/jsonInput.ts
70
+ /** Keep caller records atomic with FIFO writes, without changing the native JSON payload. */
71
+ function forwardJsonInput(source, target, keepOpen, onError) {
72
+ const decoder = new StringDecoder("utf8");
73
+ let pending = "", ended = false, blocked = false, released = false, closed = false;
74
+ const pump = () => {
75
+ if (released) return;
76
+ while (!blocked) {
77
+ const end = pending.indexOf("\n");
78
+ if (end === -1 && (!ended || !pending)) break;
79
+ const line = end === -1 ? pending : pending.slice(0, end);
80
+ pending = end === -1 ? "" : pending.slice(end + 1);
81
+ if (line.trim() && !target.write(line + "\n")) {
82
+ blocked = true;
83
+ source.pause();
84
+ }
85
+ }
86
+ if (ended && !blocked && !pending && !keepOpen && !closed) {
87
+ closed = true;
88
+ target.end();
89
+ }
90
+ };
91
+ const data = (chunk) => {
92
+ pending += decoder.write(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
93
+ pump();
94
+ };
95
+ const end = () => {
96
+ ended = true;
97
+ pending += decoder.end();
98
+ pump();
99
+ };
100
+ const drain = () => {
101
+ blocked = false;
102
+ pump();
103
+ if (!blocked && !ended && !released) source.resume();
104
+ };
105
+ source.on("data", data);
106
+ source.on("end", end);
107
+ source.on("error", onError);
108
+ target.on("drain", drain);
109
+ return () => {
110
+ released = true;
111
+ source.off("data", data);
112
+ source.off("end", end);
113
+ source.off("error", onError);
114
+ target.off("drain", drain);
115
+ source.pause();
116
+ };
117
+ }
118
+
119
+ //#endregion
120
+ //#region ts/stream/input.ts
121
+ /** Forward native text stdin with backpressure; release the caller-owned source on exit. */
122
+ function forwardInput(source, target, onError) {
123
+ const input = source ?? Readable.from([]);
124
+ input.on("error", onError);
125
+ input.pipe(target);
126
+ return () => {
127
+ input.unpipe(target);
128
+ input.pause();
129
+ input.off("error", onError);
130
+ };
131
+ }
132
+
133
+ //#endregion
134
+ //#region ts/stream/transcript.ts
135
+ function renderEvent(event) {
136
+ switch (event.type) {
137
+ case "turn_start": return `── turn ${event.turn} ──\n`;
138
+ case "user": return `user: ${event.text}\n`;
139
+ case "text": return `assistant: ${event.text}\n`;
140
+ case "tool_call": return `● ${event.name}(${JSON.stringify(event.input)})\n`;
141
+ case "tool_result": return ` ${event.ok ? "✓" : "✗"} ${event.summary}\n`;
142
+ case "needs_permission": return `permission: ${event.tool}(${JSON.stringify(event.input)})\n`;
143
+ case "needs_input": return `question: ${event.question}\n`;
144
+ case "turn_end": return `── end${event.costUsd === void 0 ? "" : ` · $${event.costUsd.toFixed(4)}`}${event.usage ? ` · ${event.usage.inputTokens} in / ${event.usage.outputTokens} out` : ""} ──\n`;
145
+ case "error": return `error: ${event.message}\n`;
146
+ case "session": return `session: ${event.sessionId}${event.model ? ` (${event.model})` : ""}\n`;
147
+ }
148
+ }
149
+
150
+ //#endregion
151
+ //#region ts/stream/runner.ts
152
+ /** A pipe-backed session, with the same discovery/FIFO paths as PTY sessions. */
153
+ async function runStream(options) {
154
+ if (options.cli !== "claude") throw new Error("--stream currently supports claude only");
155
+ if (process.platform === "win32") throw new Error("--stream currently requires a POSIX FIFO");
156
+ const jsonInput = nativeFlagValue(options.cliArgs, "--input-format") === "stream-json";
157
+ const replay = options.cliArgs.includes("--replay-user-messages");
158
+ const args = [...options.cliArgs];
159
+ if (!jsonInput && options.prompt) args.push(options.prompt);
160
+ const adapter = new ClaudeAdapter();
161
+ const child = adapter.spawn({
162
+ cwd: options.cwd,
163
+ args,
164
+ binary: options.binary,
165
+ env: stripClaudeSessionPin({
166
+ ...process.env,
167
+ ...options.env,
168
+ AGENT_YES_PID: String(process.pid)
169
+ })
170
+ });
171
+ const exited = new Promise((resolve, reject) => {
172
+ child.once("error", reject);
173
+ child.once("exit", (code, signal) => resolve(code ?? (signal ? 128 : 1)));
174
+ });
175
+ exited.catch(() => {});
176
+ const pid = child.pid;
177
+ if (!pid) return exited;
178
+ const dir = path.join(options.cwd, ".agent-yes");
179
+ const base = path.join(dir, String(pid));
180
+ const fifo = path.join(agentYesHome(), "fifo", `${pid}.stdin`);
181
+ let fd;
182
+ let timer;
183
+ const logs = [];
184
+ let releaseInput = () => {};
185
+ let groupReaped = false;
186
+ let captureError;
187
+ const reapGroup = () => {
188
+ if (groupReaped) return;
189
+ groupReaped = true;
190
+ try {
191
+ process.kill(-pid, "SIGKILL");
192
+ } catch {
193
+ if (child.exitCode === null && child.signalCode === null) child.kill("SIGKILL");
194
+ }
195
+ };
196
+ let liveStatus = "active";
197
+ let registered = false;
198
+ let pidUpdates = Promise.resolve();
199
+ const mirrorStatus = () => {
200
+ const status = liveStatus;
201
+ pidUpdates = pidUpdates.then(() => updateGlobalPidStatus(pid, {
202
+ mode: "stream",
203
+ status
204
+ }));
205
+ };
206
+ const stop = () => {
207
+ if (groupReaped) return;
208
+ try {
209
+ process.kill(-pid, "SIGTERM");
210
+ } catch {
211
+ child.kill("SIGTERM");
212
+ }
213
+ };
214
+ try {
215
+ mkdirSync(dir, { recursive: true });
216
+ mkdirSync(path.dirname(fifo), { recursive: true });
217
+ const mkfifo = spawnSync("mkfifo", [
218
+ "-m",
219
+ "600",
220
+ fifo
221
+ ]);
222
+ if (mkfifo.status !== 0) throw new Error(`Cannot create stream FIFO: ${mkfifo.stderr?.toString()}`);
223
+ fd = openSync(fifo, constants.O_RDWR | constants.O_NONBLOCK);
224
+ const events = createWriteStream(`${base}.events.jsonl`, { mode: 384 });
225
+ const native = createWriteStream(`${base}.native.jsonl`, { mode: 384 });
226
+ const raw = createWriteStream(`${base}.raw.log`, { mode: 384 });
227
+ logs.push(events, native, raw);
228
+ const { write: writeLog, drain: drainOutput } = captureOutput(child.stdout, child.stderr, logs, (error) => {
229
+ captureError = error;
230
+ stop();
231
+ });
232
+ const emit = (event) => {
233
+ const nextStatus = event.type === "turn_end" ? "idle" : event.type === "turn_start" ? "active" : liveStatus;
234
+ if (nextStatus !== liveStatus) {
235
+ liveStatus = nextStatus;
236
+ if (registered) mirrorStatus();
237
+ }
238
+ writeLog(events, JSON.stringify(event) + "\n");
239
+ const text = renderEvent(event);
240
+ writeLog(raw, text);
241
+ process.stdout.write(text);
242
+ };
243
+ readNativeLines(child.stdout, (line) => {
244
+ writeLog(native, line + "\n");
245
+ for (const event of adapter.parse(line)) emit(event);
246
+ });
247
+ child.stderr.on("data", (chunk) => {
248
+ writeLog(raw, chunk);
249
+ process.stderr.write(chunk);
250
+ });
251
+ child.stdin.on("error", stop);
252
+ let input = "";
253
+ const inputDecoder = new StringDecoder("utf8");
254
+ const buffer = Buffer.alloc(65536);
255
+ timer = setInterval(() => {
256
+ try {
257
+ let count;
258
+ while ((count = readSync(fd, buffer, 0, buffer.length, null)) > 0) {
259
+ input += inputDecoder.write(buffer.subarray(0, count));
260
+ let end;
261
+ while ((end = input.indexOf("\n")) !== -1) {
262
+ const line = input.slice(0, end);
263
+ input = input.slice(end + 1);
264
+ try {
265
+ const d = JSON.parse(line);
266
+ if (d.type === "user" && typeof d.message?.content === "string") adapter.send(d.message.content, d.uuid);
267
+ else if (d.type === "control_request" && d.request?.subtype === "interrupt") child.stdin.write(line + "\n");
268
+ else emit({
269
+ type: "error",
270
+ message: "Unsupported stream input",
271
+ fatal: false
272
+ });
273
+ } catch {
274
+ emit({
275
+ type: "error",
276
+ message: "Invalid stream input JSON",
277
+ fatal: false
278
+ });
279
+ }
280
+ }
281
+ if (input.length > 1024 * 1024) {
282
+ input = "";
283
+ emit({
284
+ type: "error",
285
+ message: "Stream input exceeds limit",
286
+ fatal: false
287
+ });
288
+ }
289
+ }
290
+ } catch (error) {
291
+ if (error.code !== "EAGAIN" && error.code !== "EWOULDBLOCK") stop();
292
+ }
293
+ }, 20);
294
+ await register(process.pid, pid);
295
+ await appendGlobalPid({
296
+ pid,
297
+ cli: options.cli,
298
+ mode: "stream",
299
+ permissions: derivePermissions({
300
+ cliArgs: options.cliArgs,
301
+ robust: false
302
+ }),
303
+ prompt: options.prompt ?? null,
304
+ cwd: options.cwd,
305
+ log_file: `${base}.raw.log`,
306
+ fifo_file: jsonInput && replay ? fifo : null,
307
+ status: liveStatus,
308
+ exit_code: null,
309
+ exit_reason: null,
310
+ started_at: Date.now(),
311
+ wrapper_pid: process.pid,
312
+ parent_pid: Number(process.env.AGENT_YES_PID) || null,
313
+ agent_id: randomUUID().replaceAll("-", "").slice(0, 12)
314
+ });
315
+ registered = true;
316
+ mirrorStatus();
317
+ process.on("SIGINT", stop);
318
+ process.on("SIGTERM", stop);
319
+ if (jsonInput && options.prompt) adapter.send(options.prompt);
320
+ if (jsonInput && options.input) releaseInput = forwardJsonInput(options.input, child.stdin, replay, stop);
321
+ if (!jsonInput) releaseInput = forwardInput(options.input, child.stdin, stop);
322
+ let code = await exited;
323
+ reapGroup();
324
+ const outputError = await drainOutput(child.signalCode !== null, options.outputDrainTimeoutMs ?? 5e3);
325
+ captureError ??= outputError;
326
+ if (captureError) {
327
+ code ||= 1;
328
+ emit({
329
+ type: "error",
330
+ message: captureError.message,
331
+ fatal: true
332
+ });
333
+ }
334
+ if (code) emit({
335
+ type: "error",
336
+ message: `Claude exited (${code})`,
337
+ fatal: true
338
+ });
339
+ await pidUpdates;
340
+ await updateGlobalPidStatus(pid, {
341
+ mode: "stream",
342
+ status: "exited",
343
+ exit_code: code,
344
+ exit_reason: captureError ? "stream-output-error" : "stream-exit"
345
+ });
346
+ return code;
347
+ } finally {
348
+ if (timer) clearInterval(timer);
349
+ releaseInput();
350
+ process.off("SIGINT", stop);
351
+ process.off("SIGTERM", stop);
352
+ if (fd !== void 0) {
353
+ closeSync(fd);
354
+ try {
355
+ unlinkSync(fifo);
356
+ } catch {}
357
+ }
358
+ reapGroup();
359
+ child.stdout.destroy();
360
+ child.stderr.destroy();
361
+ child.stdin.destroy();
362
+ await Promise.all(logs.map(async (log) => {
363
+ log.end();
364
+ if (!log.closed) await once(log, "close").catch(() => {});
365
+ }));
366
+ }
367
+ }
368
+
369
+ //#endregion
370
+ export { runStream };
371
+ //# sourceMappingURL=runner-B1vocYOj.js.map
@@ -277,4 +277,4 @@ function shouldUseLock(_cwd) {
277
277
 
278
278
  //#endregion
279
279
  export { shouldUseLock as i, getRunningAgentCount as n, releaseLock as r, acquireLock as t };
280
- //# sourceMappingURL=runningLock-DMznYh45.js.map
280
+ //# sourceMappingURL=runningLock-DaVbNt4d.js.map
@@ -1,4 +1,4 @@
1
- import "./versionChecker-CG--tQsV.js";
2
- import { a as ensureExecutable, c as findRustBinary, d as gcOldBinaryDirs, f as getBinDir, g as hasValidMacSignature, h as getRustBinary, i as ensureAyrsBinary, l as findSpawnHiddenLauncher, m as getDownloadUrl, n as devBuildInfo, o as extractZipWindows, p as getBinaryName, r as downloadBinary, s as findAyrsBinary, t as chmodExtractedBinaries, u as findTrayLauncher } from "./rustBinary-CXQGcJEm.js";
1
+ import "./versionChecker-DcrK7m4z.js";
2
+ import { a as ensureExecutable, c as findRustBinary, d as gcOldBinaryDirs, f as getBinDir, g as hasValidMacSignature, h as getRustBinary, i as ensureAyrsBinary, l as findSpawnHiddenLauncher, m as getDownloadUrl, n as devBuildInfo, o as extractZipWindows, p as getBinaryName, r as downloadBinary, s as findAyrsBinary, t as chmodExtractedBinaries, u as findTrayLauncher } from "./rustBinary-CTEd2FnZ.js";
3
3
 
4
4
  export { ensureAyrsBinary, findAyrsBinary, gcOldBinaryDirs };