@namzu/cli 36.3.1 → 36.4.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 (236) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/chunks/{acp-CJ2TTGJD.js → acp-ERY7R2OY.js} +31 -31
  4. package/dist/chunks/{activity-command-MCYEK4Z4.js → activity-command-KJXWOIHO.js} +10 -10
  5. package/dist/chunks/{add-ZQ3YWP4F.js → add-OQ2SSEQT.js} +16 -16
  6. package/dist/chunks/{agent-UO62HZPI.js → agent-RZNIDLRL.js} +22 -22
  7. package/dist/chunks/agent-session-NATAL4BA.js +46 -0
  8. package/dist/chunks/{archive-VPREZOGC.js → archive-LUOLQEUE.js} +8 -8
  9. package/dist/chunks/{bin-main-J5ULRXXN.js → bin-main-AYEHZYZV.js} +3 -3
  10. package/dist/chunks/{browser-FZWYOIIJ.js → browser-3POB2OSK.js} +6 -6
  11. package/dist/chunks/{chat-BGWKKQTT.js → chat-65V4NXAF.js} +13 -13
  12. package/dist/chunks/{chunk-E7HLYLD7.js → chunk-2DECDD7E.js} +3 -3
  13. package/dist/chunks/{chunk-5URT3ZM2.js → chunk-3N3CDMDI.js} +4 -4
  14. package/dist/chunks/{chunk-AHYHR5DY.js → chunk-4BCW647F.js} +3 -3
  15. package/dist/chunks/{chunk-F3YQ2CSZ.js → chunk-4JPJV4QO.js} +4 -4
  16. package/dist/chunks/{chunk-MJO6CH5F.js → chunk-4TZPG75O.js} +3 -3
  17. package/dist/chunks/{chunk-UFTNEQFN.js → chunk-5EDECUGH.js} +10 -10
  18. package/dist/chunks/{chunk-VUOS5SQ3.js → chunk-5VB3X4UB.js} +2 -2
  19. package/dist/chunks/{chunk-V3ZLK3XQ.js → chunk-5YWWQUJ5.js} +3 -1
  20. package/dist/chunks/{chunk-KHF4IAIH.js → chunk-5ZRZZKPU.js} +7 -6
  21. package/dist/chunks/{chunk-GQN64E36.js → chunk-6RJSJGZF.js} +3 -3
  22. package/dist/chunks/{chunk-LNQ6SCBF.js → chunk-6T4UA6AV.js} +7 -7
  23. package/dist/chunks/{chunk-XCWZZZOW.js → chunk-6ZEROVY4.js} +3 -3
  24. package/dist/chunks/{chunk-RM6HTBJK.js → chunk-BPWCZOTB.js} +2 -2
  25. package/dist/chunks/{chunk-AEPAIDAA.js → chunk-BXWH4UAN.js} +5 -5
  26. package/dist/chunks/{chunk-GSHSAMZJ.js → chunk-COPHNRLH.js} +12 -12
  27. package/dist/chunks/{chunk-ZG6NVROB.js → chunk-CYYGWTKF.js} +2 -2
  28. package/dist/chunks/{chunk-LBH5WVXU.js → chunk-DHXMHWOW.js} +2 -2
  29. package/dist/chunks/{chunk-ZHBHRMCI.js → chunk-EX7TQFIQ.js} +4 -4
  30. package/dist/chunks/{chunk-6TDJXZ5W.js → chunk-FAPXHMTL.js} +4 -4
  31. package/dist/chunks/{chunk-NATYSTPM.js → chunk-GTJVK5TJ.js} +2 -2
  32. package/dist/chunks/{chunk-YYVDLVUM.js → chunk-HZ5AGRNO.js} +2 -2
  33. package/dist/chunks/{chunk-AP5KD43Y.js → chunk-IGHTIUKD.js} +2 -2
  34. package/dist/chunks/{chunk-QRT3N2K3.js → chunk-II72PLUA.js} +2 -2
  35. package/dist/chunks/{chunk-HKDPP2JF.js → chunk-IQKT222K.js} +2 -2
  36. package/dist/chunks/{chunk-CXSUA2PF.js → chunk-JHPCQLRT.js} +3 -3
  37. package/dist/chunks/{chunk-AS7UWXMN.js → chunk-JRVKQITY.js} +4 -4
  38. package/dist/chunks/{chunk-QXDKRJZ5.js → chunk-K5JGJIJV.js} +3 -3
  39. package/dist/chunks/{chunk-I6CDUPVR.js → chunk-KDOMBH7Q.js} +2 -2
  40. package/dist/chunks/{chunk-FU4GQ7K2.js → chunk-KZJUG4HN.js} +2 -2
  41. package/dist/chunks/{chunk-56OUKG5W.js → chunk-LH4NC5YB.js} +3 -3
  42. package/dist/chunks/{chunk-YYQFUKI7.js → chunk-MEWIPARY.js} +3 -3
  43. package/dist/chunks/{chunk-2BZOT2CT.js → chunk-MGFWBSDV.js} +2 -2
  44. package/dist/chunks/{chunk-KMHLON54.js → chunk-MH3JD7CF.js} +2 -2
  45. package/dist/chunks/{chunk-MBBFX64S.js → chunk-MUUBLY7G.js} +2 -2
  46. package/dist/chunks/{chunk-BUCICQWG.js → chunk-NS7TSLQK.js} +2 -2
  47. package/dist/chunks/{chunk-BOV53LZO.js → chunk-O5FRXERG.js} +2 -2
  48. package/dist/chunks/{chunk-S6MZK4LD.js → chunk-PAE4DIXR.js} +2 -2
  49. package/dist/chunks/{chunk-ZB5ETOVE.js → chunk-Q4AASGFT.js} +3 -3
  50. package/dist/chunks/{chunk-DYUOXP5Q.js → chunk-QZSP4UWJ.js} +13 -13
  51. package/dist/chunks/{chunk-H6MWKPHM.js → chunk-RAKBF6PY.js} +383 -55
  52. package/dist/chunks/chunk-RAKBF6PY.js.map +6 -0
  53. package/dist/chunks/{chunk-HSEJGSXE.js → chunk-RDFZIPD5.js} +2 -2
  54. package/dist/chunks/{chunk-LYDXPWAZ.js → chunk-RSRL3R7C.js} +4 -4
  55. package/dist/chunks/{chunk-JCDTR2ZU.js → chunk-TCHEQRJE.js} +4 -4
  56. package/dist/chunks/{chunk-KOG2WB66.js → chunk-UEDWEOYF.js} +4 -4
  57. package/dist/chunks/{chunk-UXGI3FE5.js → chunk-UH5LZDKB.js} +8 -8
  58. package/dist/chunks/{chunk-S6DK2YOB.js → chunk-VSZX76G4.js} +9 -9
  59. package/dist/chunks/{chunk-46B7KRXY.js → chunk-WDIIFX5X.js} +6 -6
  60. package/dist/chunks/{chunk-52OVP5BG.js → chunk-WIPSZYIM.js} +4 -4
  61. package/dist/chunks/{chunk-IQBR45AU.js → chunk-WWTZUAII.js} +2 -2
  62. package/dist/chunks/{chunk-M32YRERZ.js → chunk-XC2EJGYI.js} +26 -26
  63. package/dist/chunks/{chunk-74KMYYM2.js → chunk-ZJXRPK5W.js} +3 -3
  64. package/dist/chunks/{chunk-3F5DGROG.js → chunk-ZORZAWSH.js} +2 -2
  65. package/dist/chunks/{chunk-RBX6RVYO.js → chunk-ZPCQBKVG.js} +6 -6
  66. package/dist/chunks/{chunk-EKUJUPFA.js → chunk-ZSPSXPRH.js} +4 -4
  67. package/dist/chunks/{cli-runtime-NG23IVRM.js → cli-runtime-Q2NCEXXY.js} +8 -8
  68. package/dist/chunks/{commands-LQISMOPF.js → commands-QY4JZ2D5.js} +5 -5
  69. package/dist/chunks/{crash-report-EYK56MJJ.js → crash-report-HIJHT4UR.js} +6 -6
  70. package/dist/chunks/{dist-DWB5AYXB.js → dist-AEKRLZ3M.js} +2 -2
  71. package/dist/chunks/{dist-XT4V74YL.js → dist-BT2HNR4P.js} +2 -2
  72. package/dist/chunks/{dist-EDKLCZY4.js → dist-M4QJEZ6W.js} +2 -2
  73. package/dist/chunks/{dist-PZXF5NU3.js → dist-WVLCXQIR.js} +2 -2
  74. package/dist/chunks/{dist-AZJ56DQJ.js → dist-X5AY7IYY.js} +2 -2
  75. package/dist/chunks/{dist-AUDNCB3F.js → dist-YGBNYJXU.js} +2 -2
  76. package/dist/chunks/{dist-3AMBKAG4.js → dist-YW5SKAUO.js} +2 -2
  77. package/dist/chunks/{doctor-3EOUWDYB.js → doctor-NSYFMZUT.js} +6 -6
  78. package/dist/chunks/{drain-VKGTCFXC.js → drain-KYJSJS32.js} +10 -10
  79. package/dist/chunks/{eval-VHWEJ4GG.js → eval-TH3WQFI2.js} +2 -2
  80. package/dist/chunks/{exec-TBNI5CDH.js → exec-VOZ3VAVV.js} +22 -22
  81. package/dist/chunks/{home-H4GTIYO5.js → home-RAOAISVY.js} +3 -3
  82. package/dist/chunks/{host-queries-AIZVYFDQ.js → host-queries-U4CWSBUK.js} +13 -13
  83. package/dist/chunks/{lifecycle-UF7VDCOQ.js → lifecycle-PXCABRZ5.js} +23 -23
  84. package/dist/chunks/{list-JJZ7I5OF.js → list-TIF25QTK.js} +12 -12
  85. package/dist/chunks/{login-T2RKNHK2.js → login-J42GU7EB.js} +8 -8
  86. package/dist/chunks/{logs-J6D4SEDY.js → logs-BGBHTVT3.js} +4 -4
  87. package/dist/chunks/{mcp-WONRVJ26.js → mcp-WLA36KLN.js} +15 -15
  88. package/dist/chunks/{message-command-BGQB2TFW.js → message-command-KQ2ENU5G.js} +29 -29
  89. package/dist/chunks/{operator-tools-H4MYC5PE.js → operator-tools-4NS32VMF.js} +11 -11
  90. package/dist/chunks/{output-schema-RFJUTQ2N.js → output-schema-VUNV5PSI.js} +3 -3
  91. package/dist/chunks/{pal-AV7AD5MG.js → pal-JLYSYJZ4.js} +11 -11
  92. package/dist/chunks/{providers-BHF65IUG.js → providers-6S2OD65T.js} +6 -6
  93. package/dist/chunks/{resident-YF3MIILM.js → resident-FWCWLKM2.js} +18 -18
  94. package/dist/chunks/{resume-command-Y3NYDSI4.js → resume-command-R22OK5SL.js} +4 -4
  95. package/dist/chunks/{schedule-6T2MNPKK.js → schedule-JP3VSIXA.js} +8 -8
  96. package/dist/chunks/{service-2VASPD2V.js → service-R7SRZ22P.js} +22 -22
  97. package/dist/chunks/session-step-L4HQYX5J.js +26 -0
  98. package/dist/chunks/{skills-K3JRZ3IR.js → skills-MOVGIR6S.js} +8 -8
  99. package/dist/chunks/{state-QPSQI7U7.js → state-GVVLT2YD.js} +2 -2
  100. package/dist/chunks/{store-PSQKDEPY.js → store-IAAJ4GWU.js} +8 -8
  101. package/dist/chunks/{store-7WZWQXKX.js → store-VVOUETR5.js} +6 -6
  102. package/dist/chunks/{store-Z3PS6LUZ.js → store-WQ5PM4Z2.js} +4 -4
  103. package/dist/chunks/{tui-GNG3YLGE.js → tui-23RXXZL2.js} +1888 -1478
  104. package/dist/chunks/tui-23RXXZL2.js.map +6 -0
  105. package/dist/chunks/{upgrade-C6QUXRLB.js → upgrade-2FXGSXCP.js} +2 -2
  106. package/dist/chunks/{worktree-KLD2PAMU.js → worktree-FOHNJC3S.js} +10 -10
  107. package/dist/index.js +9 -9
  108. package/dist/integrations/resident/runner-worker.js +16 -16
  109. package/dist/integrations/subagents/activity-label.d.ts +40 -0
  110. package/dist/integrations/subagents/activity-label.d.ts.map +1 -0
  111. package/dist/integrations/subagents/activity.d.ts +45 -1
  112. package/dist/integrations/subagents/activity.d.ts.map +1 -1
  113. package/dist/integrations/subagents/label-ledger.d.ts +45 -0
  114. package/dist/integrations/subagents/label-ledger.d.ts.map +1 -0
  115. package/dist/integrations/subagents/runtime.d.ts +23 -1
  116. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  117. package/dist/tui/AgentExplorer.d.ts +83 -15
  118. package/dist/tui/AgentExplorer.d.ts.map +1 -1
  119. package/dist/tui/App.d.ts.map +1 -1
  120. package/dist/tui/StatusBar.d.ts +7 -1
  121. package/dist/tui/StatusBar.d.ts.map +1 -1
  122. package/dist/tui/Transcript.d.ts +6 -0
  123. package/dist/tui/Transcript.d.ts.map +1 -1
  124. package/dist/tui/agent-transcript-rows.d.ts +66 -5
  125. package/dist/tui/agent-transcript-rows.d.ts.map +1 -1
  126. package/dist/tui/agent-view-commands.d.ts +35 -0
  127. package/dist/tui/agent-view-commands.d.ts.map +1 -0
  128. package/dist/tui/agent.d.ts +7 -1
  129. package/dist/tui/agent.d.ts.map +1 -1
  130. package/package.json +7 -7
  131. package/dist/chunks/agent-session-DU55LD4P.js +0 -46
  132. package/dist/chunks/chunk-H6MWKPHM.js.map +0 -6
  133. package/dist/chunks/session-step-LJ24HVLF.js +0 -26
  134. package/dist/chunks/tui-GNG3YLGE.js.map +0 -6
  135. package/dist/tui/ChildComposer.d.ts +0 -22
  136. package/dist/tui/ChildComposer.d.ts.map +0 -1
  137. /package/dist/chunks/{acp-CJ2TTGJD.js.map → acp-ERY7R2OY.js.map} +0 -0
  138. /package/dist/chunks/{activity-command-MCYEK4Z4.js.map → activity-command-KJXWOIHO.js.map} +0 -0
  139. /package/dist/chunks/{add-ZQ3YWP4F.js.map → add-OQ2SSEQT.js.map} +0 -0
  140. /package/dist/chunks/{agent-UO62HZPI.js.map → agent-RZNIDLRL.js.map} +0 -0
  141. /package/dist/chunks/{agent-session-DU55LD4P.js.map → agent-session-NATAL4BA.js.map} +0 -0
  142. /package/dist/chunks/{archive-VPREZOGC.js.map → archive-LUOLQEUE.js.map} +0 -0
  143. /package/dist/chunks/{bin-main-J5ULRXXN.js.map → bin-main-AYEHZYZV.js.map} +0 -0
  144. /package/dist/chunks/{browser-FZWYOIIJ.js.map → browser-3POB2OSK.js.map} +0 -0
  145. /package/dist/chunks/{chat-BGWKKQTT.js.map → chat-65V4NXAF.js.map} +0 -0
  146. /package/dist/chunks/{chunk-E7HLYLD7.js.map → chunk-2DECDD7E.js.map} +0 -0
  147. /package/dist/chunks/{chunk-5URT3ZM2.js.map → chunk-3N3CDMDI.js.map} +0 -0
  148. /package/dist/chunks/{chunk-AHYHR5DY.js.map → chunk-4BCW647F.js.map} +0 -0
  149. /package/dist/chunks/{chunk-F3YQ2CSZ.js.map → chunk-4JPJV4QO.js.map} +0 -0
  150. /package/dist/chunks/{chunk-MJO6CH5F.js.map → chunk-4TZPG75O.js.map} +0 -0
  151. /package/dist/chunks/{chunk-UFTNEQFN.js.map → chunk-5EDECUGH.js.map} +0 -0
  152. /package/dist/chunks/{chunk-VUOS5SQ3.js.map → chunk-5VB3X4UB.js.map} +0 -0
  153. /package/dist/chunks/{chunk-V3ZLK3XQ.js.map → chunk-5YWWQUJ5.js.map} +0 -0
  154. /package/dist/chunks/{chunk-KHF4IAIH.js.map → chunk-5ZRZZKPU.js.map} +0 -0
  155. /package/dist/chunks/{chunk-GQN64E36.js.map → chunk-6RJSJGZF.js.map} +0 -0
  156. /package/dist/chunks/{chunk-LNQ6SCBF.js.map → chunk-6T4UA6AV.js.map} +0 -0
  157. /package/dist/chunks/{chunk-XCWZZZOW.js.map → chunk-6ZEROVY4.js.map} +0 -0
  158. /package/dist/chunks/{chunk-RM6HTBJK.js.map → chunk-BPWCZOTB.js.map} +0 -0
  159. /package/dist/chunks/{chunk-AEPAIDAA.js.map → chunk-BXWH4UAN.js.map} +0 -0
  160. /package/dist/chunks/{chunk-GSHSAMZJ.js.map → chunk-COPHNRLH.js.map} +0 -0
  161. /package/dist/chunks/{chunk-ZG6NVROB.js.map → chunk-CYYGWTKF.js.map} +0 -0
  162. /package/dist/chunks/{chunk-LBH5WVXU.js.map → chunk-DHXMHWOW.js.map} +0 -0
  163. /package/dist/chunks/{chunk-ZHBHRMCI.js.map → chunk-EX7TQFIQ.js.map} +0 -0
  164. /package/dist/chunks/{chunk-6TDJXZ5W.js.map → chunk-FAPXHMTL.js.map} +0 -0
  165. /package/dist/chunks/{chunk-NATYSTPM.js.map → chunk-GTJVK5TJ.js.map} +0 -0
  166. /package/dist/chunks/{chunk-YYVDLVUM.js.map → chunk-HZ5AGRNO.js.map} +0 -0
  167. /package/dist/chunks/{chunk-AP5KD43Y.js.map → chunk-IGHTIUKD.js.map} +0 -0
  168. /package/dist/chunks/{chunk-QRT3N2K3.js.map → chunk-II72PLUA.js.map} +0 -0
  169. /package/dist/chunks/{chunk-HKDPP2JF.js.map → chunk-IQKT222K.js.map} +0 -0
  170. /package/dist/chunks/{chunk-CXSUA2PF.js.map → chunk-JHPCQLRT.js.map} +0 -0
  171. /package/dist/chunks/{chunk-AS7UWXMN.js.map → chunk-JRVKQITY.js.map} +0 -0
  172. /package/dist/chunks/{chunk-QXDKRJZ5.js.map → chunk-K5JGJIJV.js.map} +0 -0
  173. /package/dist/chunks/{chunk-I6CDUPVR.js.map → chunk-KDOMBH7Q.js.map} +0 -0
  174. /package/dist/chunks/{chunk-FU4GQ7K2.js.map → chunk-KZJUG4HN.js.map} +0 -0
  175. /package/dist/chunks/{chunk-56OUKG5W.js.map → chunk-LH4NC5YB.js.map} +0 -0
  176. /package/dist/chunks/{chunk-YYQFUKI7.js.map → chunk-MEWIPARY.js.map} +0 -0
  177. /package/dist/chunks/{chunk-2BZOT2CT.js.map → chunk-MGFWBSDV.js.map} +0 -0
  178. /package/dist/chunks/{chunk-KMHLON54.js.map → chunk-MH3JD7CF.js.map} +0 -0
  179. /package/dist/chunks/{chunk-MBBFX64S.js.map → chunk-MUUBLY7G.js.map} +0 -0
  180. /package/dist/chunks/{chunk-BUCICQWG.js.map → chunk-NS7TSLQK.js.map} +0 -0
  181. /package/dist/chunks/{chunk-BOV53LZO.js.map → chunk-O5FRXERG.js.map} +0 -0
  182. /package/dist/chunks/{chunk-S6MZK4LD.js.map → chunk-PAE4DIXR.js.map} +0 -0
  183. /package/dist/chunks/{chunk-ZB5ETOVE.js.map → chunk-Q4AASGFT.js.map} +0 -0
  184. /package/dist/chunks/{chunk-DYUOXP5Q.js.map → chunk-QZSP4UWJ.js.map} +0 -0
  185. /package/dist/chunks/{chunk-HSEJGSXE.js.map → chunk-RDFZIPD5.js.map} +0 -0
  186. /package/dist/chunks/{chunk-LYDXPWAZ.js.map → chunk-RSRL3R7C.js.map} +0 -0
  187. /package/dist/chunks/{chunk-JCDTR2ZU.js.map → chunk-TCHEQRJE.js.map} +0 -0
  188. /package/dist/chunks/{chunk-KOG2WB66.js.map → chunk-UEDWEOYF.js.map} +0 -0
  189. /package/dist/chunks/{chunk-UXGI3FE5.js.map → chunk-UH5LZDKB.js.map} +0 -0
  190. /package/dist/chunks/{chunk-S6DK2YOB.js.map → chunk-VSZX76G4.js.map} +0 -0
  191. /package/dist/chunks/{chunk-46B7KRXY.js.map → chunk-WDIIFX5X.js.map} +0 -0
  192. /package/dist/chunks/{chunk-52OVP5BG.js.map → chunk-WIPSZYIM.js.map} +0 -0
  193. /package/dist/chunks/{chunk-IQBR45AU.js.map → chunk-WWTZUAII.js.map} +0 -0
  194. /package/dist/chunks/{chunk-M32YRERZ.js.map → chunk-XC2EJGYI.js.map} +0 -0
  195. /package/dist/chunks/{chunk-74KMYYM2.js.map → chunk-ZJXRPK5W.js.map} +0 -0
  196. /package/dist/chunks/{chunk-3F5DGROG.js.map → chunk-ZORZAWSH.js.map} +0 -0
  197. /package/dist/chunks/{chunk-RBX6RVYO.js.map → chunk-ZPCQBKVG.js.map} +0 -0
  198. /package/dist/chunks/{chunk-EKUJUPFA.js.map → chunk-ZSPSXPRH.js.map} +0 -0
  199. /package/dist/chunks/{cli-runtime-NG23IVRM.js.map → cli-runtime-Q2NCEXXY.js.map} +0 -0
  200. /package/dist/chunks/{commands-LQISMOPF.js.map → commands-QY4JZ2D5.js.map} +0 -0
  201. /package/dist/chunks/{crash-report-EYK56MJJ.js.map → crash-report-HIJHT4UR.js.map} +0 -0
  202. /package/dist/chunks/{dist-DWB5AYXB.js.map → dist-AEKRLZ3M.js.map} +0 -0
  203. /package/dist/chunks/{dist-XT4V74YL.js.map → dist-BT2HNR4P.js.map} +0 -0
  204. /package/dist/chunks/{dist-EDKLCZY4.js.map → dist-M4QJEZ6W.js.map} +0 -0
  205. /package/dist/chunks/{dist-PZXF5NU3.js.map → dist-WVLCXQIR.js.map} +0 -0
  206. /package/dist/chunks/{dist-AZJ56DQJ.js.map → dist-X5AY7IYY.js.map} +0 -0
  207. /package/dist/chunks/{dist-AUDNCB3F.js.map → dist-YGBNYJXU.js.map} +0 -0
  208. /package/dist/chunks/{dist-3AMBKAG4.js.map → dist-YW5SKAUO.js.map} +0 -0
  209. /package/dist/chunks/{doctor-3EOUWDYB.js.map → doctor-NSYFMZUT.js.map} +0 -0
  210. /package/dist/chunks/{drain-VKGTCFXC.js.map → drain-KYJSJS32.js.map} +0 -0
  211. /package/dist/chunks/{eval-VHWEJ4GG.js.map → eval-TH3WQFI2.js.map} +0 -0
  212. /package/dist/chunks/{exec-TBNI5CDH.js.map → exec-VOZ3VAVV.js.map} +0 -0
  213. /package/dist/chunks/{home-H4GTIYO5.js.map → home-RAOAISVY.js.map} +0 -0
  214. /package/dist/chunks/{host-queries-AIZVYFDQ.js.map → host-queries-U4CWSBUK.js.map} +0 -0
  215. /package/dist/chunks/{lifecycle-UF7VDCOQ.js.map → lifecycle-PXCABRZ5.js.map} +0 -0
  216. /package/dist/chunks/{list-JJZ7I5OF.js.map → list-TIF25QTK.js.map} +0 -0
  217. /package/dist/chunks/{login-T2RKNHK2.js.map → login-J42GU7EB.js.map} +0 -0
  218. /package/dist/chunks/{logs-J6D4SEDY.js.map → logs-BGBHTVT3.js.map} +0 -0
  219. /package/dist/chunks/{mcp-WONRVJ26.js.map → mcp-WLA36KLN.js.map} +0 -0
  220. /package/dist/chunks/{message-command-BGQB2TFW.js.map → message-command-KQ2ENU5G.js.map} +0 -0
  221. /package/dist/chunks/{operator-tools-H4MYC5PE.js.map → operator-tools-4NS32VMF.js.map} +0 -0
  222. /package/dist/chunks/{output-schema-RFJUTQ2N.js.map → output-schema-VUNV5PSI.js.map} +0 -0
  223. /package/dist/chunks/{pal-AV7AD5MG.js.map → pal-JLYSYJZ4.js.map} +0 -0
  224. /package/dist/chunks/{providers-BHF65IUG.js.map → providers-6S2OD65T.js.map} +0 -0
  225. /package/dist/chunks/{resident-YF3MIILM.js.map → resident-FWCWLKM2.js.map} +0 -0
  226. /package/dist/chunks/{resume-command-Y3NYDSI4.js.map → resume-command-R22OK5SL.js.map} +0 -0
  227. /package/dist/chunks/{schedule-6T2MNPKK.js.map → schedule-JP3VSIXA.js.map} +0 -0
  228. /package/dist/chunks/{service-2VASPD2V.js.map → service-R7SRZ22P.js.map} +0 -0
  229. /package/dist/chunks/{session-step-LJ24HVLF.js.map → session-step-L4HQYX5J.js.map} +0 -0
  230. /package/dist/chunks/{skills-K3JRZ3IR.js.map → skills-MOVGIR6S.js.map} +0 -0
  231. /package/dist/chunks/{state-QPSQI7U7.js.map → state-GVVLT2YD.js.map} +0 -0
  232. /package/dist/chunks/{store-7WZWQXKX.js.map → store-IAAJ4GWU.js.map} +0 -0
  233. /package/dist/chunks/{store-PSQKDEPY.js.map → store-VVOUETR5.js.map} +0 -0
  234. /package/dist/chunks/{store-Z3PS6LUZ.js.map → store-WQ5PM4Z2.js.map} +0 -0
  235. /package/dist/chunks/{upgrade-C6QUXRLB.js.map → upgrade-2FXGSXCP.js.map} +0 -0
  236. /package/dist/chunks/{worktree-KLD2PAMU.js.map → worktree-FOHNJC3S.js.map} +0 -0
@@ -2,16 +2,16 @@ import { createRequire as __namzuCreateRequire } from 'node:module';
2
2
  const require = __namzuCreateRequire(import.meta.url);
3
3
  import {
4
4
  openManagedWorktrees
5
- } from "./chunk-52OVP5BG.js";
5
+ } from "./chunk-WIPSZYIM.js";
6
6
  import {
7
7
  createBrowserControl
8
8
  } from "./chunk-WHODOMXA.js";
9
9
  import {
10
10
  connectMcpServers
11
- } from "./chunk-JCDTR2ZU.js";
11
+ } from "./chunk-TCHEQRJE.js";
12
12
  import {
13
13
  createSessionSkillCatalog
14
- } from "./chunk-XCWZZZOW.js";
14
+ } from "./chunk-6ZEROVY4.js";
15
15
  import {
16
16
  SAVE_SKILL_TOOL_NAME,
17
17
  WORKFLOW_TOOL_DESCRIPTION,
@@ -27,10 +27,10 @@ import {
27
27
  viewFromJournal,
28
28
  workflowOffered,
29
29
  workflowRefusal
30
- } from "./chunk-74KMYYM2.js";
30
+ } from "./chunk-ZJXRPK5W.js";
31
31
  import {
32
32
  openInBrowser
33
- } from "./chunk-AP5KD43Y.js";
33
+ } from "./chunk-IGHTIUKD.js";
34
34
  import {
35
35
  CredentialRefreshRejectedError,
36
36
  CredentialWithdrawnError,
@@ -38,7 +38,7 @@ import {
38
38
  ensureFreshStoredCodexCredential,
39
39
  readSubscriptionCredential,
40
40
  sameOAuthCredential
41
- } from "./chunk-5URT3ZM2.js";
41
+ } from "./chunk-3N3CDMDI.js";
42
42
  import {
43
43
  debugRequested
44
44
  } from "./chunk-GNBMKISG.js";
@@ -46,7 +46,7 @@ import {
46
46
  configuredPassthroughTools,
47
47
  resolveToolResultScreens,
48
48
  unmatchedPassthroughTools
49
- } from "./chunk-MBBFX64S.js";
49
+ } from "./chunk-MUUBLY7G.js";
50
50
  import {
51
51
  formatSize,
52
52
  homePath,
@@ -74,7 +74,7 @@ import {
74
74
  requiresCredentialForModel,
75
75
  resolveChainCapabilities,
76
76
  unresolvedMembers
77
- } from "./chunk-DYUOXP5Q.js";
77
+ } from "./chunk-QZSP4UWJ.js";
78
78
  import {
79
79
  PROVIDER_REGISTRY,
80
80
  missingCredentialMessage,
@@ -82,11 +82,11 @@ import {
82
82
  } from "./chunk-6LLJQ3KY.js";
83
83
  import {
84
84
  cliLogger
85
- } from "./chunk-FU4GQ7K2.js";
85
+ } from "./chunk-KZJUG4HN.js";
86
86
  import {
87
87
  isPermissionMode,
88
88
  permissionModeLabel
89
- } from "./chunk-LBH5WVXU.js";
89
+ } from "./chunk-DHXMHWOW.js";
90
90
  import {
91
91
  probeCapabilities
92
92
  } from "./chunk-OH6TB27S.js";
@@ -97,7 +97,7 @@ import {
97
97
  import {
98
98
  conversationLogPath,
99
99
  ensureSessionStarted
100
- } from "./chunk-EKUJUPFA.js";
100
+ } from "./chunk-ZSPSXPRH.js";
101
101
  import {
102
102
  INSTRUCTIONS_FILENAME,
103
103
  MAX_CHARS_PER_FILE,
@@ -107,13 +107,13 @@ import {
107
107
  } from "./chunk-H6B6AROX.js";
108
108
  import {
109
109
  ensurePrivateStateDirectory
110
- } from "./chunk-S6MZK4LD.js";
110
+ } from "./chunk-PAE4DIXR.js";
111
111
  import {
112
112
  restrictToOwner
113
- } from "./chunk-BOV53LZO.js";
113
+ } from "./chunk-O5FRXERG.js";
114
114
  import {
115
115
  namzuHomePath
116
- } from "./chunk-HKDPP2JF.js";
116
+ } from "./chunk-IQKT222K.js";
117
117
  import {
118
118
  AgentManager,
119
119
  AgentRegistry,
@@ -184,6 +184,7 @@ import {
184
184
  buildResidentToolEvidenceTools,
185
185
  buildSessionGoalTools,
186
186
  classifyEvidenceSource,
187
+ collectChatCompletion,
187
188
  compactNow,
188
189
  compactSession,
189
190
  computerUseUnavailableReason,
@@ -199,7 +200,9 @@ import {
199
200
  createReviewHandler,
200
201
  createSessionTextEvidenceSource,
201
202
  createSkillTool,
203
+ createSystemMessage,
202
204
  createToolPresenter,
205
+ createUserMessage,
203
206
  deferred,
204
207
  defineTool,
205
208
  discoverAgentDefinitions,
@@ -248,7 +251,7 @@ import {
248
251
  windowsShellNotice,
249
252
  withProviderFallback,
250
253
  wrapUntrusted
251
- } from "./chunk-V3ZLK3XQ.js";
254
+ } from "./chunk-5YWWQUJ5.js";
252
255
  import {
253
256
  __name
254
257
  } from "./chunk-76FLAFCG.js";
@@ -4493,6 +4496,7 @@ var SubagentActivityMonitor = class {
4493
4496
  if (!prior || !prior.closed || this.options.replay)
4494
4497
  throw new Error("This child conversation is not available for continuation.");
4495
4498
  const opened = this.open(input, viewId);
4499
+ opened.record.resumed = true;
4496
4500
  opened.record.rows = [...prior.rows];
4497
4501
  opened.record.sessionId = prior.sessionId;
4498
4502
  pushRow(opened.record, {
@@ -4521,6 +4525,7 @@ var SubagentActivityMonitor = class {
4521
4525
  model: bounded(input.model.trim(), MAX_AGENT_ACTIVITY_LABEL_CODE_UNITS)
4522
4526
  } : {},
4523
4527
  description: bounded(input.description, MAX_AGENT_ACTIVITY_LABEL_CODE_UNITS),
4528
+ ...input.background ? { background: true } : {},
4524
4529
  prompt: bounded(input.prompt, MAX_PROMPT_CODE_UNITS),
4525
4530
  batchId,
4526
4531
  ...input.toolUseId ? { toolUseId: bounded(input.toolUseId, MAX_IDENTITY_LABEL_CODE_UNITS) } : {},
@@ -4561,6 +4566,7 @@ var SubagentActivityMonitor = class {
4561
4566
  return;
4562
4567
  }
4563
4568
  owned.completedAt = handle.completedAt ?? Date.now();
4569
+ owned.queued = 0;
4564
4570
  owned.latestActivity = handle.result?.stopReason && handle.result.stopReason !== "end_turn" ? `Stopped \xB7 ${handle.result.stopReason}` : terminalLabel(owned.status);
4565
4571
  if (owned.rows.length === 0) {
4566
4572
  pushRow(owned, {
@@ -4655,7 +4661,7 @@ var SubagentActivityMonitor = class {
4655
4661
  * matching record (already pruned, or never tracked) is a silent no-op:
4656
4662
  * there is no row left to explain what was sent.
4657
4663
  */
4658
- recordMessage(taskId, text, direction) {
4664
+ recordMessage(taskId, text, direction, kind = "queued") {
4659
4665
  if (this.closed) return;
4660
4666
  const record = [...this.records.values()].find((entry) => entry.taskId === taskId);
4661
4667
  if (!record) return;
@@ -4665,8 +4671,36 @@ var SubagentActivityMonitor = class {
4665
4671
  text: bounded(text, MAX_ROW_CODE_UNITS),
4666
4672
  direction
4667
4673
  });
4674
+ if (kind === "queued" && !isTerminal(record.status)) record.queued = (record.queued ?? 0) + 1;
4668
4675
  this.notifyNow();
4669
4676
  }
4677
+ /**
4678
+ * Records who is stopping a running agent, so the line that closes it can
4679
+ * say. The first answer stands; an agent that has ended is left alone.
4680
+ */
4681
+ markStopped(viewId, by) {
4682
+ const record = this.records.get(viewId);
4683
+ if (!record || this.closed || isTerminal(record.status) || record.stoppedBy) return;
4684
+ record.stoppedBy = by;
4685
+ this.scheduleNotify();
4686
+ }
4687
+ /** The parent's wait on this agent ended before it did; see {@link SubagentActivity.released}. */
4688
+ markReleased(viewId) {
4689
+ const record = this.records.get(viewId);
4690
+ if (!record || this.closed || isTerminal(record.status) || record.released) return;
4691
+ record.released = true;
4692
+ this.scheduleNotify();
4693
+ }
4694
+ /**
4695
+ * Sets the live label of a running agent (see `activity-label.ts`). Ignored
4696
+ * once the agent has ended, and for an unknown row.
4697
+ */
4698
+ setSummary(viewId, label) {
4699
+ const record = this.records.get(viewId);
4700
+ if (!record || this.closed || isTerminal(record.status)) return;
4701
+ record.summary = bounded(label, MAX_AGENT_ACTIVITY_LABEL_CODE_UNITS);
4702
+ this.scheduleNotify();
4703
+ }
4670
4704
  /**
4671
4705
  * Retains one line of PARENT-authored commentary for the rail to show.
4672
4706
  *
@@ -4737,6 +4771,12 @@ var SubagentActivityMonitor = class {
4737
4771
  ...record.tokens !== void 0 ? { tokens: record.tokens } : {},
4738
4772
  ...record.toolCalls !== void 0 ? { toolCalls: record.toolCalls } : {},
4739
4773
  description: record.description,
4774
+ ...record.summary && !isTerminal(record.status) ? { summary: record.summary } : {},
4775
+ ...record.queued ? { queued: record.queued } : {},
4776
+ ...record.resumed ? { resumed: true } : {},
4777
+ ...record.background ? { background: true } : {},
4778
+ ...record.released ? { released: true } : {},
4779
+ ...record.stoppedBy ? { stoppedBy: record.stoppedBy } : {},
4740
4780
  prompt: record.prompt,
4741
4781
  batchId: record.batchId,
4742
4782
  ...record.toolUseId ? { toolUseId: record.toolUseId } : {},
@@ -5004,6 +5044,7 @@ function projectEvent(record, event) {
5004
5044
  };
5005
5045
  }
5006
5046
  }
5047
+ record.queued = 0;
5007
5048
  record.latestActivity = event.isError ? `${event.toolName} failed` : `${event.toolName} done`;
5008
5049
  return;
5009
5050
  }
@@ -5634,6 +5675,147 @@ var NamzuCliAgent = class extends QueryAgent {
5634
5675
  }
5635
5676
  };
5636
5677
 
5678
+ // src/integrations/subagents/activity-label.ts
5679
+ var LABEL_INTERVAL_MS = 3e4;
5680
+ var LABEL_MIN_MESSAGES = 3;
5681
+ var LABEL_MAX_CHARS = 100;
5682
+ var LABEL_CONTEXT_ROWS = 40;
5683
+ var LABEL_ROW_CHARS = 600;
5684
+ var LABEL_INSTRUCTION = [
5685
+ "Say what this agent is doing right now, as a short status label for a list.",
5686
+ 'Rules: three to five words; present tense (for example "Reading config loader"); name the file or function it is working on rather than a branch or a goal; one line, no quotes, no punctuation at the end, no markdown.',
5687
+ "Write the label in the predominant language of the notes below. A stray word or code token in another language does not change it, and neither does the language of these instructions.",
5688
+ "If a previous label is shown and the agent is still doing that, repeat it; otherwise say what is new.",
5689
+ "Use no tools. Reply with the label only."
5690
+ ].join("\n");
5691
+ function validateLabel(reply) {
5692
+ const trimmed = reply.trim();
5693
+ if (trimmed.length === 0 || trimmed.length > LABEL_MAX_CHARS) return void 0;
5694
+ if (/[\r\n]/u.test(trimmed)) return void 0;
5695
+ if (trimmed.startsWith("#") || trimmed.includes("```")) return void 0;
5696
+ return trimmed;
5697
+ }
5698
+ __name(validateLabel, "validateLabel");
5699
+ function labelPrompt(agent) {
5700
+ const rows = agent.transcript.slice(-LABEL_CONTEXT_ROWS).map((row) => {
5701
+ const who = row.kind === "assistant" ? "agent" : row.kind === "tool" ? "tool" : row.direction ? "message" : "note";
5702
+ const text = row.kind === "tool" && row.detail ? `${row.text} -> ${row.detail}` : row.text;
5703
+ return `${who}: ${text.replace(/\s+/gu, " ").slice(0, LABEL_ROW_CHARS)}`;
5704
+ }).join("\n");
5705
+ return [
5706
+ `Task given to the agent:
5707
+ ${agent.prompt.slice(0, 1500)}`,
5708
+ `What it has done so far (oldest first):
5709
+ ${rows}`,
5710
+ agent.summary ? `Previous label: ${agent.summary}` : "No previous label."
5711
+ ].join("\n\n");
5712
+ }
5713
+ __name(labelPrompt, "labelPrompt");
5714
+ function messageCount(agent) {
5715
+ return 1 + agent.transcript.length;
5716
+ }
5717
+ __name(messageCount, "messageCount");
5718
+ function signature(agent) {
5719
+ const last = agent.transcript.at(-1);
5720
+ return `${agent.transcript.length}:${last?.id ?? ""}:${last && "text" in last ? last.text.length : 0}`;
5721
+ }
5722
+ __name(signature, "signature");
5723
+ function startActivityLabeler(options) {
5724
+ const seen = /* @__PURE__ */ new Map();
5725
+ const inFlight = /* @__PURE__ */ new Map();
5726
+ const tick = /* @__PURE__ */ __name(() => {
5727
+ const live = /* @__PURE__ */ new Set();
5728
+ for (const agent of options.activity.getSnapshot()) {
5729
+ const running = agent.status === "working" || agent.status === "queued";
5730
+ if (!running) continue;
5731
+ live.add(agent.viewId);
5732
+ if (agent.background !== true || agent.replayed === true) continue;
5733
+ if (agent.workflowRunId !== void 0) continue;
5734
+ if (messageCount(agent) < LABEL_MIN_MESSAGES) continue;
5735
+ if (inFlight.has(agent.viewId)) continue;
5736
+ const sig = signature(agent);
5737
+ if (seen.get(agent.viewId) === sig) continue;
5738
+ seen.set(agent.viewId, sig);
5739
+ const controller = new AbortController();
5740
+ inFlight.set(agent.viewId, controller);
5741
+ void options.ask(agent, LABEL_INSTRUCTION, labelPrompt(agent), controller.signal).then((reply) => {
5742
+ if (!reply || controller.signal.aborted) return;
5743
+ const label = validateLabel(reply.text);
5744
+ if (label) options.activity.setSummary(agent.viewId, label);
5745
+ }).catch(() => void 0).finally(() => {
5746
+ inFlight.delete(agent.viewId);
5747
+ });
5748
+ }
5749
+ for (const [id, controller] of inFlight) {
5750
+ if (!live.has(id)) controller.abort();
5751
+ }
5752
+ for (const id of seen.keys()) if (!live.has(id)) seen.delete(id);
5753
+ }, "tick");
5754
+ const timer = setInterval(tick, options.intervalMs ?? LABEL_INTERVAL_MS);
5755
+ timer.unref?.();
5756
+ return {
5757
+ stop() {
5758
+ clearInterval(timer);
5759
+ for (const controller of inFlight.values()) controller.abort();
5760
+ inFlight.clear();
5761
+ }
5762
+ };
5763
+ }
5764
+ __name(startActivityLabeler, "startActivityLabeler");
5765
+
5766
+ // src/integrations/subagents/label-ledger.ts
5767
+ var LABEL_REQUEST_ALLOWANCE_TOKENS = 8e3;
5768
+ var NOTHING = {
5769
+ promptTokens: 0,
5770
+ completionTokens: 0,
5771
+ totalTokens: 0,
5772
+ cachedTokens: 0,
5773
+ cacheWriteTokens: 0
5774
+ };
5775
+ async function chargeLabelRequest(input) {
5776
+ const { budget, sessionId, signal } = input;
5777
+ let account;
5778
+ try {
5779
+ const remaining = budget.remaining;
5780
+ const limited = Number.isFinite(remaining);
5781
+ const allowance = limited ? Math.min(remaining, LABEL_REQUEST_ALLOWANCE_TOKENS) : 0;
5782
+ if (limited && allowance < input.estimatedPromptTokens) return void 0;
5783
+ account = budget.reserve(allowance);
5784
+ try {
5785
+ account.bindTurn(sessionId, generateTurnId());
5786
+ } catch (error) {
5787
+ account.settle();
5788
+ throw error;
5789
+ }
5790
+ } catch {
5791
+ return void 0;
5792
+ }
5793
+ let requestId;
5794
+ try {
5795
+ requestId = await account.beginRequest();
5796
+ } catch {
5797
+ account.settle();
5798
+ return void 0;
5799
+ }
5800
+ try {
5801
+ const result = await input.request();
5802
+ await account.finishRequest(requestId, result.usage);
5803
+ return result.value;
5804
+ } catch (error) {
5805
+ const cancelled2 = signal.aborted;
5806
+ const prompt = cancelled2 ? Math.max(0, Math.ceil(input.estimatedPromptTokens)) : 0;
5807
+ await account.finishRequest(requestId, {
5808
+ ...NOTHING,
5809
+ promptTokens: prompt,
5810
+ totalTokens: prompt
5811
+ }).catch(() => void 0);
5812
+ throw error;
5813
+ } finally {
5814
+ account.settle();
5815
+ }
5816
+ }
5817
+ __name(chargeLabelRequest, "chargeLabelRequest");
5818
+
5637
5819
  // src/integrations/subagents/policy.ts
5638
5820
  var CLI_INTERACTIVE_TURN_TIMEOUT_MS = 0;
5639
5821
 
@@ -5852,7 +6034,12 @@ var refuseUnownedChildReview = /* @__PURE__ */ __name(async () => ({
5852
6034
  action: "abort",
5853
6035
  reason: "The parent turn no longer owns an interactive review channel for this sub-agent."
5854
6036
  }), "refuseUnownedChildReview");
5855
- async function createSubagentRuntime(opts) {
6037
+ async function createSubagentRuntime(input) {
6038
+ const childMessageListeners = /* @__PURE__ */ new Set();
6039
+ const opts = {
6040
+ ...input,
6041
+ childExtraTools: /* @__PURE__ */ __name(() => childMessageListeners.size > 0 ? [toolset("agents:message-main", [messageMainTool])] : [], "childExtraTools")
6042
+ };
5856
6043
  const registry = new AgentRegistry();
5857
6044
  registry.register(
5858
6045
  buildDefinition(
@@ -6057,6 +6244,7 @@ async function createSubagentRuntime(opts) {
6057
6244
  const runtime = {
6058
6245
  gateway,
6059
6246
  completionInbox,
6247
+ budget,
6060
6248
  close() {
6061
6249
  if (released) return;
6062
6250
  released = true;
@@ -6102,8 +6290,38 @@ async function createSubagentRuntime(opts) {
6102
6290
  return (await pending).completionInbox;
6103
6291
  }, "completionInboxForTurn");
6104
6292
  const activity = new SubagentActivityMonitor();
6293
+ const labeler = startActivityLabeler({
6294
+ activity,
6295
+ ask: /* @__PURE__ */ __name(async (agent, instruction, body, signal) => {
6296
+ const owned = conversations.get(agent.viewId);
6297
+ if (!owned || closed || owned.config.model !== void 0) return void 0;
6298
+ const parent = await resolveParent(owned.turnId);
6299
+ const turn = await parents.get(owned.turnId)?.catch(() => void 0);
6300
+ if (!turn) return void 0;
6301
+ const provider = await opts.buildProvider(parent.sessionId);
6302
+ const model = owned.seed.model ?? opts.model;
6303
+ const text = await chargeLabelRequest({
6304
+ budget: turn.budget,
6305
+ sessionId: parent.sessionId,
6306
+ estimatedPromptTokens: Math.ceil((instruction.length + body.length) / 4),
6307
+ signal,
6308
+ request: /* @__PURE__ */ __name(async () => {
6309
+ const response = await collectChatCompletion(
6310
+ provider.chatStream({
6311
+ model,
6312
+ messages: [createSystemMessage(instruction), createUserMessage(body)],
6313
+ maxTokens: 60,
6314
+ signal
6315
+ })
6316
+ );
6317
+ return { value: response.message.content ?? "", usage: response.usage };
6318
+ }, "request")
6319
+ });
6320
+ return text === void 0 ? void 0 : { text };
6321
+ }, "ask")
6322
+ });
6105
6323
  let dynCounter = 0;
6106
- const launchChild = /* @__PURE__ */ __name(async (input, context, hooks = {}) => {
6324
+ const launchChild = /* @__PURE__ */ __name(async (input2, context, hooks = {}) => {
6107
6325
  const {
6108
6326
  description,
6109
6327
  prompt,
@@ -6118,7 +6336,7 @@ async function createSubagentRuntime(opts) {
6118
6336
  model: requestedModel,
6119
6337
  provider: requestedProvider,
6120
6338
  effort: requestedEffort
6121
- } = input;
6339
+ } = input2;
6122
6340
  if (!requestedModel && (requestedProvider || requestedEffort))
6123
6341
  throw new Error("Supply model when selecting a child provider or effort.");
6124
6342
  const explore = subagent_type === EXPLORE_SUBAGENT;
@@ -6168,6 +6386,7 @@ ${persona}` : persona || (explore ? EXPLORE_PROMPT : SUBAGENT_PROMPT),
6168
6386
  agentId,
6169
6387
  model: selection?.model ?? fileAgent?.model ?? parentModel,
6170
6388
  description,
6389
+ ...run_in_background === true ? { background: true } : {},
6171
6390
  prompt,
6172
6391
  batchId: context.toolBatchId,
6173
6392
  toolUseId: context.toolUseId,
@@ -6283,6 +6502,8 @@ ${persona}` : persona || (explore ? EXPLORE_PROMPT : SUBAGENT_PROMPT),
6283
6502
  } : tracker.onEvent
6284
6503
  }
6285
6504
  });
6505
+ if (outcome.kind === "yielded" && run_in_background !== true)
6506
+ activity.markReleased(tracker.viewId);
6286
6507
  return { outcome, agentId };
6287
6508
  } catch (error) {
6288
6509
  tracker.fail(error);
@@ -6313,7 +6534,7 @@ ${persona}` : persona || (explore ? EXPLORE_PROMPT : SUBAGENT_PROMPT),
6313
6534
  properties: {
6314
6535
  description: {
6315
6536
  type: "string",
6316
- description: "Short label for tracking (shown to the user)."
6537
+ description: "A short (3-5 word) description of the task."
6317
6538
  },
6318
6539
  prompt: {
6319
6540
  type: "string",
@@ -6387,9 +6608,9 @@ ${persona}` : persona || (explore ? EXPLORE_PROMPT : SUBAGENT_PROMPT),
6387
6608
  destructive: false,
6388
6609
  concurrencySafe: true,
6389
6610
  timeoutMs: opts.resolveLimits ? 0 : opts.timeoutMs ?? CLI_INTERACTIVE_TURN_TIMEOUT_MS,
6390
- async execute(input, context) {
6391
- const { description, run_in_background } = input;
6392
- const { outcome, agentId } = await launchChild(input, context);
6611
+ async execute(input2, context) {
6612
+ const { description, run_in_background } = input2;
6613
+ const { outcome, agentId } = await launchChild(input2, context);
6393
6614
  if (outcome.kind === "yielded") {
6394
6615
  const progress = outcome.handle.state === "pending" ? "queued for an available slot" : "still running";
6395
6616
  return {
@@ -6514,8 +6735,8 @@ ${JSON.stringify(launch.schema)}`;
6514
6735
  readOnly: true,
6515
6736
  destructive: false,
6516
6737
  concurrencySafe: true,
6517
- async execute(input, context) {
6518
- const request = input;
6738
+ async execute(input2, context) {
6739
+ const request = input2;
6519
6740
  if (request.history || request.session_id) {
6520
6741
  if (!opts.savedAgents)
6521
6742
  return {
@@ -6536,9 +6757,8 @@ ${JSON.stringify(launch.schema)}`;
6536
6757
  }
6537
6758
  const gateway = await gatewayForTurn(context.turnId);
6538
6759
  const tasks = gateway.listTasks();
6539
- const labels = new Map(
6540
- activity.getSnapshot().map((entry) => [entry.taskId, entry.description])
6541
- );
6760
+ const snapshot = activity.getSnapshot();
6761
+ const labels = new Map(snapshot.map((entry) => [entry.taskId, entry.description]));
6542
6762
  const shown = tasks.slice(-40).map((task) => ({
6543
6763
  description: labels.get(task.taskId) ?? task.agentId,
6544
6764
  task_id: task.taskId,
@@ -6582,10 +6802,10 @@ ${JSON.stringify(launch.schema)}`;
6582
6802
  destructive: false,
6583
6803
  concurrencySafe: true,
6584
6804
  timeoutMs: opts.resolveLimits ? 0 : opts.timeoutMs ?? CLI_INTERACTIVE_TURN_TIMEOUT_MS,
6585
- async execute(input, context) {
6805
+ async execute(input2, context) {
6586
6806
  const gateway = await gatewayForTurn(context.turnId);
6587
6807
  let taskId;
6588
- const asked = input.task_id;
6808
+ const asked = input2.task_id;
6589
6809
  if (typeof asked === "string" && /^w[0-9a-z]{8}$/.test(asked.trim())) {
6590
6810
  return {
6591
6811
  success: true,
@@ -6640,7 +6860,7 @@ ${JSON.stringify(launch.schema)}`;
6640
6860
  });
6641
6861
  const sendMessageTool = defineTool({
6642
6862
  name: "send_message",
6643
- description: "Queue a correction or additional context for a running or queued sub-agent task owned by this turn. The child receives it at its next request boundary; acceptance is not delivery. This does not start new work or restart finished tasks.",
6863
+ description: "Send a correction or additional context to a sub-agent owned by this turn, addressed by its task id. A running or queued agent receives it at its next tool round; acceptance is not delivery. A finished agent is resumed from its own transcript with the message. An agent the user stopped is not resumed.",
6644
6864
  inputSchema: mcpJsonSchemaToZod({
6645
6865
  type: "object",
6646
6866
  properties: {
@@ -6663,9 +6883,9 @@ ${JSON.stringify(launch.schema)}`;
6663
6883
  readOnly: false,
6664
6884
  destructive: false,
6665
6885
  concurrencySafe: false,
6666
- async execute(input, context) {
6886
+ async execute(input2, context) {
6667
6887
  context.abortSignal.throwIfAborted();
6668
- const { task_id, message: message2 } = input;
6888
+ const { task_id, message: message2 } = input2;
6669
6889
  if (!message2.trim())
6670
6890
  return {
6671
6891
  success: false,
@@ -6681,18 +6901,36 @@ ${JSON.stringify(launch.schema)}`;
6681
6901
  output: "",
6682
6902
  error: `Task ${taskId} does not belong to this parent turn.`
6683
6903
  };
6684
- if (isTerminalAgentTaskState(task.state))
6904
+ if (isTerminalAgentTaskState(task.state)) {
6905
+ const shown = activity.getSnapshot().find((entry) => entry.taskId === String(taskId));
6906
+ const label = shown?.agentId ?? String(taskId);
6907
+ if (!shown)
6908
+ return {
6909
+ success: false,
6910
+ output: "",
6911
+ error: `Task ${taskId} has finished and cannot be resumed from here.`
6912
+ };
6913
+ try {
6914
+ await messageChild(shown.viewId, message2, context.turnId, context.abortSignal, "parent");
6915
+ } catch (error) {
6916
+ return {
6917
+ success: false,
6918
+ output: "",
6919
+ error: error instanceof Error ? error.message : String(error)
6920
+ };
6921
+ }
6685
6922
  return {
6686
- success: false,
6687
- output: "",
6688
- error: "This task has finished; send_message cannot restart it."
6923
+ success: true,
6924
+ output: `Resuming agent ${label}. It will notify you again when it finishes.`,
6925
+ data: { task_id: taskId, status: "resumed" }
6689
6926
  };
6927
+ }
6690
6928
  context.abortSignal.throwIfAborted();
6691
6929
  await gateway.continueTask(taskId, message2);
6692
6930
  activity.recordMessage(String(taskId), message2, "to-child");
6693
6931
  return {
6694
6932
  success: true,
6695
- output: `Message queued for task ${taskId}; it will be available at the child's next request boundary.`,
6933
+ output: `Message queued for delivery to task ${taskId} at its next tool round. If it finishes first, it is resumed with the message and notifies again, so wait for that notification before resending.`,
6696
6934
  data: { task_id: taskId, status: "queued" }
6697
6935
  };
6698
6936
  }
@@ -6716,9 +6954,9 @@ ${JSON.stringify(launch.schema)}`;
6716
6954
  readOnly: false,
6717
6955
  destructive: false,
6718
6956
  concurrencySafe: false,
6719
- async execute(input, context) {
6957
+ async execute(input2, context) {
6720
6958
  context.abortSignal.throwIfAborted();
6721
- const taskId = asTaskId(input.task_id);
6959
+ const taskId = asTaskId(input2.task_id);
6722
6960
  const gateway = await gatewayForTurn(context.turnId);
6723
6961
  const task = gateway.getTask(taskId);
6724
6962
  if (!task)
@@ -6733,6 +6971,9 @@ ${JSON.stringify(launch.schema)}`;
6733
6971
  output: `Task ${taskId} already ended: ${agentTaskOutcome(task)}. No cancellation sent.`
6734
6972
  };
6735
6973
  context.abortSignal.throwIfAborted();
6974
+ for (const [shownId, owned] of conversations) {
6975
+ if (owned.task.taskId === taskId) activity.markStopped(shownId, "parent");
6976
+ }
6736
6977
  gateway.cancelTask(taskId, "user");
6737
6978
  return {
6738
6979
  success: true,
@@ -6741,6 +6982,72 @@ ${JSON.stringify(launch.schema)}`;
6741
6982
  };
6742
6983
  }
6743
6984
  });
6985
+ const messageMainTool = defineTool({
6986
+ name: "send_message",
6987
+ description: 'Send a message to the main conversation while you keep working. Your plain text output is not visible to the main conversation; to tell it something before you finish, you must call this tool with to "main". It is delivered with its next turn. Your final response goes to whoever launched you without this. Do not send routine progress: send what the main conversation needs to know or decide now.',
6988
+ inputSchema: mcpJsonSchemaToZod({
6989
+ type: "object",
6990
+ properties: {
6991
+ to: {
6992
+ type: "string",
6993
+ description: 'Recipient: "main", the main conversation.'
6994
+ },
6995
+ message: {
6996
+ type: "string",
6997
+ minLength: 1,
6998
+ maxLength: 16e3,
6999
+ description: "What to tell the main conversation."
7000
+ }
7001
+ },
7002
+ required: ["to", "message"],
7003
+ additionalProperties: false
7004
+ }),
7005
+ category: "custom",
7006
+ permissions: [],
7007
+ // Reads and writes nothing in the world; the text lands in the main
7008
+ // conversation's context, framed as the child's own words.
7009
+ readOnly: true,
7010
+ destructive: false,
7011
+ concurrencySafe: true,
7012
+ async execute(input2, context) {
7013
+ context.abortSignal.throwIfAborted();
7014
+ const { to, message: message2 } = input2;
7015
+ if (to !== "main")
7016
+ return {
7017
+ success: false,
7018
+ output: "",
7019
+ error: `No agent named '${to}' is currently addressable. Only "main" can be messaged from here.`
7020
+ };
7021
+ if (!message2.trim())
7022
+ return { success: false, output: "", error: "Message must not be blank." };
7023
+ const shown = activity.getSnapshot().find((entry) => entry.sessionId === String(context.sessionId));
7024
+ const owned = shown ? conversations.get(shown.viewId) : void 0;
7025
+ if (!shown || !owned || closed || childMessageListeners.size === 0 || shown.stoppedBy !== void 0)
7026
+ return {
7027
+ success: false,
7028
+ output: "",
7029
+ error: "Not sent. You cannot use send_message in this session: it is switched off for sub-agents, or you were stopped. Put what you need to pass on in your final response, which goes to whoever launched or resumed you."
7030
+ };
7031
+ const parent = await resolveParent(owned.turnId);
7032
+ for (const listener of [...childMessageListeners]) {
7033
+ try {
7034
+ listener({
7035
+ parentSessionId: String(parent.sessionId),
7036
+ viewId: shown.viewId,
7037
+ agentId: shown.agentId,
7038
+ description: shown.description,
7039
+ ...shown.taskId ? { taskId: shown.taskId } : {},
7040
+ text: message2
7041
+ });
7042
+ } catch {
7043
+ }
7044
+ }
7045
+ return {
7046
+ success: true,
7047
+ output: "Message queued for the main conversation's next turn."
7048
+ };
7049
+ }
7050
+ });
6744
7051
  const narrationTool = defineTool({
6745
7052
  name: NARRATION_TOOL_NAME,
6746
7053
  description: [
@@ -6796,9 +7103,9 @@ ${JSON.stringify(launch.schema)}`;
6796
7103
  label: "Narrating",
6797
7104
  presentation: "activity"
6798
7105
  }), "presentCall"),
6799
- async execute(input, context) {
7106
+ async execute(input2, context) {
6800
7107
  context.abortSignal.throwIfAborted();
6801
- const { line } = input;
7108
+ const { line } = input2;
6802
7109
  const outcome = activity.narrate(line);
6803
7110
  if (outcome.kind === "empty")
6804
7111
  return {
@@ -6819,7 +7126,7 @@ ${JSON.stringify(launch.schema)}`;
6819
7126
  };
6820
7127
  }
6821
7128
  });
6822
- const messageChild = /* @__PURE__ */ __name(async (viewId, message2, turnId, signal) => {
7129
+ const messageChild = /* @__PURE__ */ __name(async (viewId, message2, turnId, signal, source = "operator") => {
6823
7130
  if (closed) throw new Error("Sub-agent runtime is closed.");
6824
7131
  if (!message2.trim() || message2.length > 16e3)
6825
7132
  throw new Error("A child message must contain 1\u201316000 characters.");
@@ -6827,6 +7134,10 @@ ${JSON.stringify(launch.schema)}`;
6827
7134
  const shown = activity.getSnapshot().find((value) => value.viewId === viewId);
6828
7135
  if (!owned || !shown || shown.replayed)
6829
7136
  throw new Error("This child is saved evidence or is no longer owned by this host.");
7137
+ if (shown.status === "cancelled")
7138
+ throw new Error(
7139
+ source === "operator" ? `${shown.agentId} was stopped, so it cannot take a message. Start a new agent for that work.` : `Agent "${shown.agentId}" was stopped by the user and was not resumed. Treat its work as cancelled; only start a new agent for it if the user explicitly asks.`
7140
+ );
6830
7141
  if (owned.busy) throw new Error("A message to this child is already being admitted.");
6831
7142
  owned.busy = true;
6832
7143
  const id = randomUUID4();
@@ -6857,7 +7168,7 @@ ${JSON.stringify(launch.schema)}`;
6857
7168
  const parent = await resolveParent(turnId);
6858
7169
  if (owned.parentKey !== sessionKey(parent))
6859
7170
  throw new Error("This child belongs to a different parent conversation.");
6860
- if (opts.paths) {
7171
+ if (opts.paths && source === "operator") {
6861
7172
  const directory = opts.paths.sessionDir({
6862
7173
  sessionId: parent.sessionId
6863
7174
  });
@@ -6918,7 +7229,12 @@ ${JSON.stringify(launch.schema)}`;
6918
7229
  kind = "started";
6919
7230
  }
6920
7231
  admitted = true;
6921
- activity.recordMessage(String(task.taskId), message2, "operator-to-child");
7232
+ activity.recordMessage(
7233
+ String(task.taskId),
7234
+ message2,
7235
+ source === "operator" ? "operator-to-child" : "to-child",
7236
+ kind === "started" ? "started" : "queued"
7237
+ );
6922
7238
  let auditWarning;
6923
7239
  try {
6924
7240
  await audit("accepted", String(task.taskId));
@@ -6951,6 +7267,7 @@ ${JSON.stringify(launch.schema)}`;
6951
7267
  if (closePromise) return closePromise;
6952
7268
  closed = true;
6953
7269
  closePromise = (async () => {
7270
+ labeler.stop();
6954
7271
  await Promise.all([...parents.keys()].map(releaseTurn));
6955
7272
  await Promise.all(
6956
7273
  [...sessions.values()].map(async (entry) => (await entry.ready).manager.dispose())
@@ -6982,11 +7299,11 @@ ${JSON.stringify(launch.schema)}`;
6982
7299
  readOnly: true,
6983
7300
  destructive: false,
6984
7301
  concurrencySafe: true,
6985
- async execute(input, context) {
7302
+ async execute(input2, context) {
6986
7303
  return {
6987
7304
  success: true,
6988
7305
  output: await listModels(
6989
- input.query ?? "",
7306
+ input2.query ?? "",
6990
7307
  context.abortSignal
6991
7308
  )
6992
7309
  };
@@ -6999,10 +7316,17 @@ ${JSON.stringify(launch.schema)}`;
6999
7316
  if (!owned || !shown || shown.replayed) return false;
7000
7317
  const current = owned.gateway.getTask(owned.task.taskId) ?? owned.task;
7001
7318
  if (isTerminalAgentTaskState(current.state)) return false;
7319
+ activity.markStopped(viewId, "user");
7002
7320
  owned.gateway.cancelTask(owned.task.taskId, "user");
7003
7321
  return true;
7004
7322
  }, "stopChild");
7005
7323
  return {
7324
+ onChildMessage(listener) {
7325
+ childMessageListeners.add(listener);
7326
+ return () => {
7327
+ childMessageListeners.delete(listener);
7328
+ };
7329
+ },
7006
7330
  cancelAgentTool,
7007
7331
  modelCatalogueTool,
7008
7332
  messageChild,
@@ -7016,9 +7340,9 @@ ${JSON.stringify(launch.schema)}`;
7016
7340
  sendMessageTool,
7017
7341
  narrationTool,
7018
7342
  allowedAgentIds: agentTypeIds,
7019
- launchesReadOnlyAgent(input) {
7020
- if (typeof input !== "object" || input === null) return false;
7021
- const fields = input;
7343
+ launchesReadOnlyAgent(input2) {
7344
+ if (typeof input2 !== "object" || input2 === null) return false;
7345
+ const fields = input2;
7022
7346
  if (fields.workspace === "worktree") return false;
7023
7347
  if (fields.provider !== void 0 || fields.effort !== void 0) return false;
7024
7348
  const inherits = /* @__PURE__ */ __name((model) => model === void 0 || model === opts.model, "inherits");
@@ -7214,7 +7538,9 @@ ${SUBAGENT_PROMPT}`;
7214
7538
  const environment = opts.readEnvironment ? await opts.readEnvironment(childCwd) : null;
7215
7539
  const parent = options.parentTurnId ? await opts.resolveParent(asTurnId(options.parentTurnId)) : void 0;
7216
7540
  const provider = await opts.buildProvider(parent?.sessionId, selection);
7217
- const toolsets = tools();
7541
+ const roster = tools();
7542
+ const extra = opts.childExtraTools?.() ?? [];
7543
+ const toolsets = extra.length > 0 ? [...roster, ...extra] : roster;
7218
7544
  const webSearch = opts.configureWebSearch?.(provider, options.model ?? model, toolsets);
7219
7545
  const resolvedToolsets = webSearch ? toolsets.map((ts) => filtered(ts, (tool) => tool.name !== "web_search")) : toolsets;
7220
7546
  return {
@@ -9001,10 +9327,10 @@ function clipRequestContext(prompt, limit, kind) {
9001
9327
  __name(clipRequestContext, "clipRequestContext");
9002
9328
  async function createAgentSession(prefs, detected, options = {}) {
9003
9329
  if (options.palEnvironment) {
9004
- const { createPalAgentSession } = await import("./agent-session-DU55LD4P.js");
9330
+ const { createPalAgentSession } = await import("./agent-session-NATAL4BA.js");
9005
9331
  return createPalAgentSession(prefs, detected, options);
9006
9332
  }
9007
- const { palAtWorkspace } = await import("./store-7WZWQXKX.js");
9333
+ const { palAtWorkspace } = await import("./store-VVOUETR5.js");
9008
9334
  if (palAtWorkspace(options.cwd ?? process.cwd()))
9009
9335
  throw new Error("This Pal requires its owned virtual computer. Open it with namzu pal chat.");
9010
9336
  const fileObservations = /* @__PURE__ */ new Map();
@@ -9934,7 +10260,7 @@ async function createAgentSession(prefs, detected, options = {}) {
9934
10260
  if (options.openUrl) toolsets.push(toolset("open-url", [createOpenUrlTool()]));
9935
10261
  const decisionTool = maybeCreateDecisionTool(options.decision, process.env);
9936
10262
  if (decisionTool) toolsets.push(toolset("decide", [decisionTool]));
9937
- const operatorPals = await import("./operator-tools-H4MYC5PE.js");
10263
+ const operatorPals = await import("./operator-tools-4NS32VMF.js");
9938
10264
  toolsets.push(
9939
10265
  readyWhen(
9940
10266
  toolset(
@@ -10574,6 +10900,8 @@ async function createAgentSession(prefs, detected, options = {}) {
10574
10900
  directChildReports.delete(listener);
10575
10901
  };
10576
10902
  }, "onSubagentReport"),
10903
+ onSubagentMessage: /* @__PURE__ */ __name((listener) => subagentRuntime?.onChildMessage(listener) ?? (() => {
10904
+ }), "onSubagentMessage"),
10577
10905
  stopSubagent: /* @__PURE__ */ __name((viewId) => subagentRuntime?.stopChild(viewId) ?? false, "stopSubagent"),
10578
10906
  messageSubagent: /* @__PURE__ */ __name((viewId, message2, opts) => operations.promise(opts?.signal, async (signal) => {
10579
10907
  const runtime = subagentRuntime;
@@ -12446,4 +12774,4 @@ export {
12446
12774
  RESULT_SUMMARY_WHOLE_MAX,
12447
12775
  resultSummaryLine
12448
12776
  };
12449
- //# sourceMappingURL=chunk-H6MWKPHM.js.map
12777
+ //# sourceMappingURL=chunk-RAKBF6PY.js.map