@namzu/cli 35.0.0 → 36.0.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 (1304) hide show
  1. package/CHANGELOG.md +756 -0
  2. package/README.md +160 -394
  3. package/assets/pal-blender-mcp.py +123 -0
  4. package/assets/pal-godot-mcp-pin.json +135 -0
  5. package/assets/pal-godot-mcp.cjs +418 -0
  6. package/dist/bin-main.d.ts +3 -0
  7. package/dist/bin-main.d.ts.map +1 -0
  8. package/dist/bin.d.ts +2 -1
  9. package/dist/bin.d.ts.map +1 -1
  10. package/dist/bin.js +85 -23
  11. package/dist/bin.js.map +6 -1
  12. package/dist/boot-narrative.d.ts +16 -0
  13. package/dist/boot-narrative.d.ts.map +1 -0
  14. package/dist/checkpoints/manifest.d.ts +107 -0
  15. package/dist/checkpoints/manifest.d.ts.map +1 -0
  16. package/dist/checkpoints/store.d.ts +280 -40
  17. package/dist/checkpoints/store.d.ts.map +1 -1
  18. package/dist/checkpoints/undo-plan.d.ts +83 -0
  19. package/dist/checkpoints/undo-plan.d.ts.map +1 -0
  20. package/dist/checkpoints/wrap.d.ts +4 -0
  21. package/dist/checkpoints/wrap.d.ts.map +1 -1
  22. package/dist/chunks/acp-BOSEA4R3.js +13448 -0
  23. package/dist/chunks/acp-BOSEA4R3.js.map +6 -0
  24. package/dist/chunks/activity-command-ACS7KL3C.js +262 -0
  25. package/dist/chunks/activity-command-ACS7KL3C.js.map +6 -0
  26. package/dist/chunks/add-DLS54YKS.js +712 -0
  27. package/dist/chunks/add-DLS54YKS.js.map +6 -0
  28. package/dist/chunks/agent-GV3DWYQC.js +87 -0
  29. package/dist/chunks/agent-GV3DWYQC.js.map +6 -0
  30. package/dist/chunks/agent-session-7VE6GJJH.js +46 -0
  31. package/dist/chunks/agent-session-7VE6GJJH.js.map +6 -0
  32. package/dist/chunks/archive-6ZENIEBP.js +84 -0
  33. package/dist/chunks/archive-6ZENIEBP.js.map +6 -0
  34. package/dist/chunks/bin-main-NFFT5ZIU.js +126 -0
  35. package/dist/chunks/bin-main-NFFT5ZIU.js.map +6 -0
  36. package/dist/chunks/browser-VT2U6NG2.js +31 -0
  37. package/dist/chunks/browser-VT2U6NG2.js.map +6 -0
  38. package/dist/chunks/chat-UNYVLDFL.js +101 -0
  39. package/dist/chunks/chat-UNYVLDFL.js.map +6 -0
  40. package/dist/chunks/chunk-2IL6OG3X.js +311 -0
  41. package/dist/chunks/chunk-2IL6OG3X.js.map +6 -0
  42. package/dist/chunks/chunk-2RBYHHLM.js +319 -0
  43. package/dist/chunks/chunk-2RBYHHLM.js.map +6 -0
  44. package/dist/chunks/chunk-42ZK2AH4.js +71 -0
  45. package/dist/chunks/chunk-42ZK2AH4.js.map +6 -0
  46. package/dist/chunks/chunk-5PQVJBIO.js +168 -0
  47. package/dist/chunks/chunk-5PQVJBIO.js.map +6 -0
  48. package/dist/chunks/chunk-6CPT2ZBS.js +75 -0
  49. package/dist/chunks/chunk-6CPT2ZBS.js.map +6 -0
  50. package/dist/chunks/chunk-6LLJQ3KY.js +225 -0
  51. package/dist/chunks/chunk-6LLJQ3KY.js.map +6 -0
  52. package/dist/chunks/chunk-6YFJDVGA.js +161 -0
  53. package/dist/chunks/chunk-6YFJDVGA.js.map +6 -0
  54. package/dist/chunks/chunk-6YG7D7U4.js +159 -0
  55. package/dist/chunks/chunk-6YG7D7U4.js.map +6 -0
  56. package/dist/chunks/chunk-6ZPODOJN.js +828 -0
  57. package/dist/chunks/chunk-6ZPODOJN.js.map +6 -0
  58. package/dist/chunks/chunk-76FLAFCG.js +51 -0
  59. package/dist/chunks/chunk-76FLAFCG.js.map +6 -0
  60. package/dist/chunks/chunk-7HCPD673.js +25326 -0
  61. package/dist/chunks/chunk-7HCPD673.js.map +6 -0
  62. package/dist/chunks/chunk-7KWGR2YA.js +257 -0
  63. package/dist/chunks/chunk-7KWGR2YA.js.map +6 -0
  64. package/dist/chunks/chunk-A22MBIYU.js +42 -0
  65. package/dist/chunks/chunk-A22MBIYU.js.map +6 -0
  66. package/dist/chunks/chunk-AHIDYIRB.js +329 -0
  67. package/dist/chunks/chunk-AHIDYIRB.js.map +6 -0
  68. package/dist/chunks/chunk-AK2U3N2A.js +31 -0
  69. package/dist/chunks/chunk-AK2U3N2A.js.map +6 -0
  70. package/dist/chunks/chunk-AKKRZTPB.js +283 -0
  71. package/dist/chunks/chunk-AKKRZTPB.js.map +6 -0
  72. package/dist/chunks/chunk-BCZR2B3Y.js +97 -0
  73. package/dist/chunks/chunk-BCZR2B3Y.js.map +6 -0
  74. package/dist/chunks/chunk-CHIEVVQ2.js +32 -0
  75. package/dist/chunks/chunk-CHIEVVQ2.js.map +6 -0
  76. package/dist/chunks/chunk-D67YBUO3.js +110 -0
  77. package/dist/chunks/chunk-D67YBUO3.js.map +6 -0
  78. package/dist/chunks/chunk-DIHEHK7K.js +765 -0
  79. package/dist/chunks/chunk-DIHEHK7K.js.map +6 -0
  80. package/dist/chunks/chunk-E5VLANCO.js +101 -0
  81. package/dist/chunks/chunk-E5VLANCO.js.map +6 -0
  82. package/dist/chunks/chunk-EEDZOGV4.js +47 -0
  83. package/dist/chunks/chunk-EEDZOGV4.js.map +6 -0
  84. package/dist/chunks/chunk-ENGNEELC.js +271 -0
  85. package/dist/chunks/chunk-ENGNEELC.js.map +6 -0
  86. package/dist/chunks/chunk-EVY4MVRE.js +74 -0
  87. package/dist/chunks/chunk-EVY4MVRE.js.map +6 -0
  88. package/dist/chunks/chunk-FJNDNNNQ.js +115 -0
  89. package/dist/chunks/chunk-FJNDNNNQ.js.map +6 -0
  90. package/dist/chunks/chunk-FOFGMP7O.js +20 -0
  91. package/dist/chunks/chunk-FOFGMP7O.js.map +6 -0
  92. package/dist/chunks/chunk-FTMTO72X.js +95 -0
  93. package/dist/chunks/chunk-FTMTO72X.js.map +6 -0
  94. package/dist/chunks/chunk-GIXSS6KW.js +2228 -0
  95. package/dist/chunks/chunk-GIXSS6KW.js.map +6 -0
  96. package/dist/chunks/chunk-GNBMKISG.js +19 -0
  97. package/dist/chunks/chunk-GNBMKISG.js.map +6 -0
  98. package/dist/chunks/chunk-GWQEMJFS.js +28 -0
  99. package/dist/chunks/chunk-GWQEMJFS.js.map +6 -0
  100. package/dist/chunks/chunk-H6B6AROX.js +151 -0
  101. package/dist/chunks/chunk-H6B6AROX.js.map +6 -0
  102. package/dist/chunks/chunk-HE7WUOX2.js +26 -0
  103. package/dist/chunks/chunk-HE7WUOX2.js.map +6 -0
  104. package/dist/chunks/chunk-HZBKWL42.js +303 -0
  105. package/dist/chunks/chunk-HZBKWL42.js.map +6 -0
  106. package/dist/chunks/chunk-I7HQR6ET.js +75 -0
  107. package/dist/chunks/chunk-I7HQR6ET.js.map +6 -0
  108. package/dist/chunks/chunk-IJEB77SH.js +648 -0
  109. package/dist/chunks/chunk-IJEB77SH.js.map +6 -0
  110. package/dist/chunks/chunk-JNPDWME5.js +675 -0
  111. package/dist/chunks/chunk-JNPDWME5.js.map +6 -0
  112. package/dist/chunks/chunk-JORONMD3.js +18 -0
  113. package/dist/chunks/chunk-JORONMD3.js.map +6 -0
  114. package/dist/chunks/chunk-JV3LONAU.js +76 -0
  115. package/dist/chunks/chunk-JV3LONAU.js.map +6 -0
  116. package/dist/chunks/chunk-K5HARZ7G.js +82516 -0
  117. package/dist/chunks/chunk-K5HARZ7G.js.map +6 -0
  118. package/dist/chunks/chunk-KONYGNG6.js +7661 -0
  119. package/dist/chunks/chunk-KONYGNG6.js.map +6 -0
  120. package/dist/chunks/chunk-LXB3S4IC.js +19 -0
  121. package/dist/chunks/chunk-LXB3S4IC.js.map +6 -0
  122. package/dist/chunks/chunk-M3IAMIBJ.js +661 -0
  123. package/dist/chunks/chunk-M3IAMIBJ.js.map +6 -0
  124. package/dist/chunks/chunk-MH6KUKVV.js +1142 -0
  125. package/dist/chunks/chunk-MH6KUKVV.js.map +6 -0
  126. package/dist/chunks/chunk-MS3IYQ72.js +1479 -0
  127. package/dist/chunks/chunk-MS3IYQ72.js.map +6 -0
  128. package/dist/chunks/chunk-MZP6SH3M.js +3497 -0
  129. package/dist/chunks/chunk-MZP6SH3M.js.map +6 -0
  130. package/dist/chunks/chunk-N3ZEXVSS.js +76 -0
  131. package/dist/chunks/chunk-N3ZEXVSS.js.map +6 -0
  132. package/dist/chunks/chunk-N6SR54VC.js +207 -0
  133. package/dist/chunks/chunk-N6SR54VC.js.map +6 -0
  134. package/dist/chunks/chunk-NADQQMMG.js +46 -0
  135. package/dist/chunks/chunk-NADQQMMG.js.map +6 -0
  136. package/dist/chunks/chunk-NBH52WHS.js +247 -0
  137. package/dist/chunks/chunk-NBH52WHS.js.map +6 -0
  138. package/dist/chunks/chunk-NICLKFBG.js +109 -0
  139. package/dist/chunks/chunk-NICLKFBG.js.map +6 -0
  140. package/dist/chunks/chunk-NIPHHZ5G.js +283 -0
  141. package/dist/chunks/chunk-NIPHHZ5G.js.map +6 -0
  142. package/dist/chunks/chunk-NQT244I2.js +517 -0
  143. package/dist/chunks/chunk-NQT244I2.js.map +6 -0
  144. package/dist/chunks/chunk-NUGPLXVK.js +228 -0
  145. package/dist/chunks/chunk-NUGPLXVK.js.map +6 -0
  146. package/dist/chunks/chunk-OEW7CJKK.js +140 -0
  147. package/dist/chunks/chunk-OEW7CJKK.js.map +6 -0
  148. package/dist/chunks/chunk-OH6TB27S.js +111 -0
  149. package/dist/chunks/chunk-OH6TB27S.js.map +6 -0
  150. package/dist/chunks/chunk-OWH6QQY2.js +1858 -0
  151. package/dist/chunks/chunk-OWH6QQY2.js.map +6 -0
  152. package/dist/chunks/chunk-OWXJOD4H.js +773 -0
  153. package/dist/chunks/chunk-OWXJOD4H.js.map +6 -0
  154. package/dist/chunks/chunk-PT537V7B.js +787 -0
  155. package/dist/chunks/chunk-PT537V7B.js.map +6 -0
  156. package/dist/chunks/chunk-QEQZFG2X.js +106 -0
  157. package/dist/chunks/chunk-QEQZFG2X.js.map +6 -0
  158. package/dist/chunks/chunk-QL4O4UGZ.js +245 -0
  159. package/dist/chunks/chunk-QL4O4UGZ.js.map +6 -0
  160. package/dist/chunks/chunk-QL54XCF4.js +73 -0
  161. package/dist/chunks/chunk-QL54XCF4.js.map +6 -0
  162. package/dist/chunks/chunk-SB6UD3ED.js +1355 -0
  163. package/dist/chunks/chunk-SB6UD3ED.js.map +6 -0
  164. package/dist/chunks/chunk-SGGRGKGV.js +34 -0
  165. package/dist/chunks/chunk-SGGRGKGV.js.map +6 -0
  166. package/dist/chunks/chunk-SKKWMMFP.js +474 -0
  167. package/dist/chunks/chunk-SKKWMMFP.js.map +6 -0
  168. package/dist/chunks/chunk-SMIDV4KH.js +171 -0
  169. package/dist/chunks/chunk-SMIDV4KH.js.map +6 -0
  170. package/dist/chunks/chunk-T2VUTAHB.js +46 -0
  171. package/dist/chunks/chunk-T2VUTAHB.js.map +6 -0
  172. package/dist/chunks/chunk-T4SB6AAF.js +134 -0
  173. package/dist/chunks/chunk-T4SB6AAF.js.map +6 -0
  174. package/dist/chunks/chunk-TBIX6JRE.js +24 -0
  175. package/dist/chunks/chunk-TBIX6JRE.js.map +6 -0
  176. package/dist/chunks/chunk-THNCQJ33.js +11265 -0
  177. package/dist/chunks/chunk-THNCQJ33.js.map +6 -0
  178. package/dist/chunks/chunk-U56QFYGA.js +818 -0
  179. package/dist/chunks/chunk-U56QFYGA.js.map +6 -0
  180. package/dist/chunks/chunk-U6GZ7EW4.js +106 -0
  181. package/dist/chunks/chunk-U6GZ7EW4.js.map +6 -0
  182. package/dist/chunks/chunk-UDDSFIMB.js +1373 -0
  183. package/dist/chunks/chunk-UDDSFIMB.js.map +6 -0
  184. package/dist/chunks/chunk-UFHNXZL2.js +399 -0
  185. package/dist/chunks/chunk-UFHNXZL2.js.map +6 -0
  186. package/dist/chunks/chunk-US5ZFPAU.js +400 -0
  187. package/dist/chunks/chunk-US5ZFPAU.js.map +6 -0
  188. package/dist/chunks/chunk-VRL2WNQN.js +7534 -0
  189. package/dist/chunks/chunk-VRL2WNQN.js.map +6 -0
  190. package/dist/chunks/chunk-W3UQMRYA.js +380 -0
  191. package/dist/chunks/chunk-W3UQMRYA.js.map +6 -0
  192. package/dist/chunks/chunk-W5KGCUP3.js +11111 -0
  193. package/dist/chunks/chunk-W5KGCUP3.js.map +6 -0
  194. package/dist/chunks/chunk-WHODOMXA.js +132 -0
  195. package/dist/chunks/chunk-WHODOMXA.js.map +6 -0
  196. package/dist/chunks/chunk-WT6TFCPV.js +154 -0
  197. package/dist/chunks/chunk-WT6TFCPV.js.map +6 -0
  198. package/dist/chunks/chunk-WY2WUTFR.js +164 -0
  199. package/dist/chunks/chunk-WY2WUTFR.js.map +6 -0
  200. package/dist/chunks/chunk-XEUQN4JC.js +54 -0
  201. package/dist/chunks/chunk-XEUQN4JC.js.map +6 -0
  202. package/dist/chunks/chunk-Y7B67G22.js +26 -0
  203. package/dist/chunks/chunk-Y7B67G22.js.map +6 -0
  204. package/dist/chunks/chunk-YEMJX2DS.js +69 -0
  205. package/dist/chunks/chunk-YEMJX2DS.js.map +6 -0
  206. package/dist/chunks/chunk-YKLKHDZU.js +2953 -0
  207. package/dist/chunks/chunk-YKLKHDZU.js.map +6 -0
  208. package/dist/chunks/chunk-YQEWD2EN.js +127 -0
  209. package/dist/chunks/chunk-YQEWD2EN.js.map +6 -0
  210. package/dist/chunks/chunk-YYQJIECC.js +1439 -0
  211. package/dist/chunks/chunk-YYQJIECC.js.map +6 -0
  212. package/dist/chunks/chunk-ZKVZNOUS.js +106 -0
  213. package/dist/chunks/chunk-ZKVZNOUS.js.map +6 -0
  214. package/dist/chunks/chunk-ZPR4IMRT.js +36 -0
  215. package/dist/chunks/chunk-ZPR4IMRT.js.map +6 -0
  216. package/dist/chunks/chunk-ZWA2JRJV.js +45 -0
  217. package/dist/chunks/chunk-ZWA2JRJV.js.map +6 -0
  218. package/dist/chunks/cli-runtime-F4MBZ2UQ.js +129 -0
  219. package/dist/chunks/cli-runtime-F4MBZ2UQ.js.map +6 -0
  220. package/dist/chunks/commands-GMQGFTIY.js +21 -0
  221. package/dist/chunks/commands-GMQGFTIY.js.map +6 -0
  222. package/dist/chunks/computer-GXDY4H35.js +493 -0
  223. package/dist/chunks/computer-GXDY4H35.js.map +6 -0
  224. package/dist/chunks/crash-report-STOHSORG.js +21 -0
  225. package/dist/chunks/crash-report-STOHSORG.js.map +6 -0
  226. package/dist/chunks/devtools-LBE4PAQN.js +3851 -0
  227. package/dist/chunks/devtools-LBE4PAQN.js.map +6 -0
  228. package/dist/chunks/dist-3AF2X4S5.js +1339 -0
  229. package/dist/chunks/dist-3AF2X4S5.js.map +6 -0
  230. package/dist/chunks/dist-AZIMHV2B.js +514 -0
  231. package/dist/chunks/dist-AZIMHV2B.js.map +6 -0
  232. package/dist/chunks/dist-BGYRQ5BC.js +555 -0
  233. package/dist/chunks/dist-BGYRQ5BC.js.map +6 -0
  234. package/dist/chunks/dist-OTTZ7WVD.js +1415 -0
  235. package/dist/chunks/dist-OTTZ7WVD.js.map +6 -0
  236. package/dist/chunks/dist-R3I3ATSG.js +1018 -0
  237. package/dist/chunks/dist-R3I3ATSG.js.map +6 -0
  238. package/dist/chunks/dist-TXEKDBQO.js +40642 -0
  239. package/dist/chunks/dist-TXEKDBQO.js.map +6 -0
  240. package/dist/chunks/dist-XTWYQHHN.js +520 -0
  241. package/dist/chunks/dist-XTWYQHHN.js.map +6 -0
  242. package/dist/chunks/doctor-VXSB4Y4P.js +28 -0
  243. package/dist/chunks/doctor-VXSB4Y4P.js.map +6 -0
  244. package/dist/chunks/drain-DXVICQBR.js +471 -0
  245. package/dist/chunks/drain-DXVICQBR.js.map +6 -0
  246. package/dist/chunks/endpoint-M2DDENPP.js +15 -0
  247. package/dist/chunks/endpoint-M2DDENPP.js.map +6 -0
  248. package/dist/chunks/eval-BMJQXDKA.js +187 -0
  249. package/dist/chunks/eval-BMJQXDKA.js.map +6 -0
  250. package/dist/chunks/exec-3T5ESZPH.js +1284 -0
  251. package/dist/chunks/exec-3T5ESZPH.js.map +6 -0
  252. package/dist/chunks/home-ILHA7B6Z.js +16 -0
  253. package/dist/chunks/home-ILHA7B6Z.js.map +6 -0
  254. package/dist/chunks/host-queries-QCMWDZGS.js +152 -0
  255. package/dist/chunks/host-queries-QCMWDZGS.js.map +6 -0
  256. package/dist/chunks/lib-KXZZJJG2.js +2657 -0
  257. package/dist/chunks/lib-KXZZJJG2.js.map +6 -0
  258. package/dist/chunks/lifecycle-CB23VJI7.js +63 -0
  259. package/dist/chunks/lifecycle-CB23VJI7.js.map +6 -0
  260. package/dist/chunks/list-N6WXZBMD.js +293 -0
  261. package/dist/chunks/list-N6WXZBMD.js.map +6 -0
  262. package/dist/chunks/login-26NCG6EQ.js +29 -0
  263. package/dist/chunks/login-26NCG6EQ.js.map +6 -0
  264. package/dist/chunks/logs-V7SNM7LA.js +116 -0
  265. package/dist/chunks/logs-V7SNM7LA.js.map +6 -0
  266. package/dist/chunks/mcp-BTHCU5ZC.js +763 -0
  267. package/dist/chunks/mcp-BTHCU5ZC.js.map +6 -0
  268. package/dist/chunks/message-command-HMIOR52C.js +170 -0
  269. package/dist/chunks/message-command-HMIOR52C.js.map +6 -0
  270. package/dist/chunks/node-QB2FA2ZB.js +916 -0
  271. package/dist/chunks/node-QB2FA2ZB.js.map +6 -0
  272. package/dist/chunks/operator-tools-7LMWOHSN.js +115 -0
  273. package/dist/chunks/operator-tools-7LMWOHSN.js.map +6 -0
  274. package/dist/chunks/output-schema-XCONYVZ7.js +11 -0
  275. package/dist/chunks/output-schema-XCONYVZ7.js.map +6 -0
  276. package/dist/chunks/pal-YEUKHA6F.js +200 -0
  277. package/dist/chunks/pal-YEUKHA6F.js.map +6 -0
  278. package/dist/chunks/paths-DXYFKIJU.js +10 -0
  279. package/dist/chunks/paths-DXYFKIJU.js.map +6 -0
  280. package/dist/chunks/pica-WNHDDIFX.js +1736 -0
  281. package/dist/chunks/pica-WNHDDIFX.js.map +6 -0
  282. package/dist/chunks/providers-EI3FAKYB.js +160 -0
  283. package/dist/chunks/providers-EI3FAKYB.js.map +6 -0
  284. package/dist/chunks/resident-5ZY6OG6B.js +1314 -0
  285. package/dist/chunks/resident-5ZY6OG6B.js.map +6 -0
  286. package/dist/chunks/resume-command-ONYRZIIA.js +22 -0
  287. package/dist/chunks/resume-command-ONYRZIIA.js.map +6 -0
  288. package/dist/chunks/schedule-6JPEO4NR.js +143 -0
  289. package/dist/chunks/schedule-6JPEO4NR.js.map +6 -0
  290. package/dist/chunks/serve-S7UWNIR3.js +21 -0
  291. package/dist/chunks/serve-S7UWNIR3.js.map +6 -0
  292. package/dist/chunks/service-WSW3M6K5.js +1633 -0
  293. package/dist/chunks/service-WSW3M6K5.js.map +6 -0
  294. package/dist/chunks/session-step-2VZM3CCA.js +26 -0
  295. package/dist/chunks/session-step-2VZM3CCA.js.map +6 -0
  296. package/dist/chunks/skills-KAZJYGX5.js +282 -0
  297. package/dist/chunks/skills-KAZJYGX5.js.map +6 -0
  298. package/dist/chunks/state-263OUKQA.js +717 -0
  299. package/dist/chunks/state-263OUKQA.js.map +6 -0
  300. package/dist/chunks/store-3XLCJ7EL.js +42 -0
  301. package/dist/chunks/store-3XLCJ7EL.js.map +6 -0
  302. package/dist/chunks/store-KN65QI2M.js +82 -0
  303. package/dist/chunks/store-KN65QI2M.js.map +6 -0
  304. package/dist/chunks/store-X3TESBIN.js +34 -0
  305. package/dist/chunks/store-X3TESBIN.js.map +6 -0
  306. package/dist/chunks/tui-5MU7JBXX.js +56703 -0
  307. package/dist/chunks/tui-5MU7JBXX.js.map +6 -0
  308. package/dist/chunks/upgrade-BYM4MWBC.js +315 -0
  309. package/dist/chunks/upgrade-BYM4MWBC.js.map +6 -0
  310. package/dist/chunks/webapi-6HUHZUAH.js +2715 -0
  311. package/dist/chunks/webapi-6HUHZUAH.js.map +6 -0
  312. package/dist/chunks/worktree-K3ZIPXRM.js +116 -0
  313. package/dist/chunks/worktree-K3ZIPXRM.js.map +6 -0
  314. package/dist/cli-runtime.d.ts +19 -0
  315. package/dist/cli-runtime.d.ts.map +1 -0
  316. package/dist/cli.d.ts +0 -15
  317. package/dist/cli.d.ts.map +1 -1
  318. package/dist/commands/acp-harness.d.ts +64 -0
  319. package/dist/commands/acp-harness.d.ts.map +1 -0
  320. package/dist/commands/acp-provider-retry.d.ts +27 -0
  321. package/dist/commands/acp-provider-retry.d.ts.map +1 -0
  322. package/dist/commands/acp.d.ts +134 -3
  323. package/dist/commands/acp.d.ts.map +1 -1
  324. package/dist/commands/computer.d.ts +3 -0
  325. package/dist/commands/computer.d.ts.map +1 -0
  326. package/dist/commands/desktop-host-changes.d.ts +65 -0
  327. package/dist/commands/desktop-host-changes.d.ts.map +1 -0
  328. package/dist/commands/desktop-host-header.d.ts +30 -0
  329. package/dist/commands/desktop-host-header.d.ts.map +1 -0
  330. package/dist/commands/desktop-host.d.ts +354 -0
  331. package/dist/commands/desktop-host.d.ts.map +1 -0
  332. package/dist/commands/desktop-model-catalogue.d.ts +25 -0
  333. package/dist/commands/desktop-model-catalogue.d.ts.map +1 -0
  334. package/dist/commands/effort-levels.d.ts +3 -0
  335. package/dist/commands/effort-levels.d.ts.map +1 -0
  336. package/dist/commands/exec-flags.d.ts +4 -0
  337. package/dist/commands/exec-flags.d.ts.map +1 -1
  338. package/dist/commands/exec.d.ts.map +1 -1
  339. package/dist/commands/lazy.d.ts +20 -0
  340. package/dist/commands/lazy.d.ts.map +1 -0
  341. package/dist/commands/manifest.d.ts +33 -0
  342. package/dist/commands/manifest.d.ts.map +1 -0
  343. package/dist/commands/pal.d.ts +5 -0
  344. package/dist/commands/pal.d.ts.map +1 -0
  345. package/dist/commands/permission-preview.d.ts +38 -0
  346. package/dist/commands/permission-preview.d.ts.map +1 -0
  347. package/dist/commands/registry.d.ts +10 -0
  348. package/dist/commands/registry.d.ts.map +1 -1
  349. package/dist/commands/serve.d.ts +1 -12
  350. package/dist/commands/serve.d.ts.map +1 -1
  351. package/dist/commands/stdin.d.ts.map +1 -1
  352. package/dist/commands/upgrade.d.ts +14 -0
  353. package/dist/commands/upgrade.d.ts.map +1 -1
  354. package/dist/compile-cache-enable.d.ts +2 -0
  355. package/dist/compile-cache-enable.d.ts.map +1 -0
  356. package/dist/compile-cache.d.ts +53 -0
  357. package/dist/compile-cache.d.ts.map +1 -0
  358. package/dist/computer/bundle.d.ts +18 -0
  359. package/dist/computer/bundle.d.ts.map +1 -0
  360. package/dist/computer/run.d.ts +26 -0
  361. package/dist/computer/run.d.ts.map +1 -0
  362. package/dist/computer/sentences.d.ts +30 -0
  363. package/dist/computer/sentences.d.ts.map +1 -0
  364. package/dist/config/load.d.ts +10 -1
  365. package/dist/config/load.d.ts.map +1 -1
  366. package/dist/context/capabilities.d.ts +25 -2
  367. package/dist/context/capabilities.d.ts.map +1 -1
  368. package/dist/context/runtime-message.d.ts.map +1 -1
  369. package/dist/crash-report.d.ts +22 -0
  370. package/dist/crash-report.d.ts.map +1 -0
  371. package/dist/debug-requested.d.ts +7 -0
  372. package/dist/debug-requested.d.ts.map +1 -0
  373. package/dist/doctor/checks/credentials.d.ts.map +1 -1
  374. package/dist/exit-codes.d.ts +9 -1
  375. package/dist/exit-codes.d.ts.map +1 -1
  376. package/dist/index.js +105 -17
  377. package/dist/index.js.map +6 -1
  378. package/dist/integrations/harness/claude-adapter.d.ts +20 -0
  379. package/dist/integrations/harness/claude-adapter.d.ts.map +1 -0
  380. package/dist/integrations/harness/claude-protocol.d.ts +67 -0
  381. package/dist/integrations/harness/claude-protocol.d.ts.map +1 -0
  382. package/dist/integrations/harness/codex-adapter.d.ts +80 -0
  383. package/dist/integrations/harness/codex-adapter.d.ts.map +1 -0
  384. package/dist/integrations/harness/codex-protocol.d.ts +22 -0
  385. package/dist/integrations/harness/codex-protocol.d.ts.map +1 -0
  386. package/dist/integrations/harness/model-cache.d.ts +16 -0
  387. package/dist/integrations/harness/model-cache.d.ts.map +1 -0
  388. package/dist/integrations/harness/native-executable.d.ts +8 -0
  389. package/dist/integrations/harness/native-executable.d.ts.map +1 -0
  390. package/dist/integrations/harness/process.d.ts +25 -0
  391. package/dist/integrations/harness/process.d.ts.map +1 -0
  392. package/dist/integrations/peers/runtime.d.ts +64 -0
  393. package/dist/integrations/peers/runtime.d.ts.map +1 -0
  394. package/dist/integrations/plugins/inventory.d.ts +27 -0
  395. package/dist/integrations/plugins/inventory.d.ts.map +1 -0
  396. package/dist/integrations/providers/composer-settings.d.ts +33 -0
  397. package/dist/integrations/providers/composer-settings.d.ts.map +1 -0
  398. package/dist/integrations/providers/connections.d.ts +37 -0
  399. package/dist/integrations/providers/connections.d.ts.map +1 -0
  400. package/dist/integrations/providers/credential-store.d.ts +35 -0
  401. package/dist/integrations/providers/credential-store.d.ts.map +1 -1
  402. package/dist/integrations/providers/discover.d.ts +27 -1
  403. package/dist/integrations/providers/discover.d.ts.map +1 -1
  404. package/dist/integrations/providers/index.d.ts +2 -2
  405. package/dist/integrations/providers/index.d.ts.map +1 -1
  406. package/dist/integrations/providers/picker-operation.d.ts +6 -0
  407. package/dist/integrations/providers/picker-operation.d.ts.map +1 -0
  408. package/dist/integrations/providers/setup.d.ts +16 -1
  409. package/dist/integrations/providers/setup.d.ts.map +1 -1
  410. package/dist/integrations/resident/runner-worker.js +190 -161
  411. package/dist/integrations/resident/runner-worker.js.map +6 -1
  412. package/dist/integrations/sessions/display-title.d.ts +8 -0
  413. package/dist/integrations/sessions/display-title.d.ts.map +1 -1
  414. package/dist/integrations/sessions/store.d.ts +23 -9
  415. package/dist/integrations/sessions/store.d.ts.map +1 -1
  416. package/dist/integrations/sessions/task-context.d.ts +1 -1
  417. package/dist/integrations/sessions/task-context.d.ts.map +1 -1
  418. package/dist/integrations/sessions/transcript-export.d.ts.map +1 -1
  419. package/dist/integrations/subagents/activity.d.ts +9 -6
  420. package/dist/integrations/subagents/activity.d.ts.map +1 -1
  421. package/dist/integrations/subagents/operator-journal.d.ts +20 -0
  422. package/dist/integrations/subagents/operator-journal.d.ts.map +1 -0
  423. package/dist/integrations/subagents/runtime.d.ts +11 -0
  424. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  425. package/dist/integrations/trust/store.d.ts +14 -0
  426. package/dist/integrations/trust/store.d.ts.map +1 -1
  427. package/dist/integrations/web/search.d.ts +1 -1
  428. package/dist/pals/actions.d.ts +57 -0
  429. package/dist/pals/actions.d.ts.map +1 -0
  430. package/dist/pals/activity-command.d.ts +3 -0
  431. package/dist/pals/activity-command.d.ts.map +1 -0
  432. package/dist/pals/activity.d.ts +18 -0
  433. package/dist/pals/activity.d.ts.map +1 -0
  434. package/dist/pals/agent-session.d.ts +19 -0
  435. package/dist/pals/agent-session.d.ts.map +1 -0
  436. package/dist/pals/channel-actions.d.ts +5 -0
  437. package/dist/pals/channel-actions.d.ts.map +1 -0
  438. package/dist/pals/channel-local.d.ts +7 -0
  439. package/dist/pals/channel-local.d.ts.map +1 -0
  440. package/dist/pals/channel.d.ts +20 -0
  441. package/dist/pals/channel.d.ts.map +1 -0
  442. package/dist/pals/chat.d.ts +6 -0
  443. package/dist/pals/chat.d.ts.map +1 -0
  444. package/dist/pals/communication.d.ts +47 -0
  445. package/dist/pals/communication.d.ts.map +1 -0
  446. package/dist/pals/conversations.d.ts +26 -0
  447. package/dist/pals/conversations.d.ts.map +1 -0
  448. package/dist/pals/desktop-communication.d.ts +111 -0
  449. package/dist/pals/desktop-communication.d.ts.map +1 -0
  450. package/dist/pals/dispatch.d.ts +13 -0
  451. package/dist/pals/dispatch.d.ts.map +1 -0
  452. package/dist/pals/environment.d.ts +103 -0
  453. package/dist/pals/environment.d.ts.map +1 -0
  454. package/dist/pals/guest-mcp-transport.d.ts +28 -0
  455. package/dist/pals/guest-mcp-transport.d.ts.map +1 -0
  456. package/dist/pals/guest-mcp.d.ts +22 -0
  457. package/dist/pals/guest-mcp.d.ts.map +1 -0
  458. package/dist/pals/inbox-start.d.ts +35 -0
  459. package/dist/pals/inbox-start.d.ts.map +1 -0
  460. package/dist/pals/message-command.d.ts +3 -0
  461. package/dist/pals/message-command.d.ts.map +1 -0
  462. package/dist/pals/operator-tools.d.ts +23 -0
  463. package/dist/pals/operator-tools.d.ts.map +1 -0
  464. package/dist/pals/public-transcript.d.ts +4 -0
  465. package/dist/pals/public-transcript.d.ts.map +1 -0
  466. package/dist/pals/review.d.ts +16 -0
  467. package/dist/pals/review.d.ts.map +1 -0
  468. package/dist/pals/store.d.ts +16 -0
  469. package/dist/pals/store.d.ts.map +1 -0
  470. package/dist/pals/tui-session.d.ts +11 -0
  471. package/dist/pals/tui-session.d.ts.map +1 -0
  472. package/dist/permissions/mode-names.d.ts +2 -0
  473. package/dist/permissions/mode-names.d.ts.map +1 -0
  474. package/dist/resume-invocation.d.ts +1 -1
  475. package/dist/resume-invocation.d.ts.map +1 -1
  476. package/dist/resume-shell.d.ts +8 -0
  477. package/dist/resume-shell.d.ts.map +1 -0
  478. package/dist/schedule/build.d.ts +12 -3
  479. package/dist/schedule/build.d.ts.map +1 -1
  480. package/dist/schedule/commands/add.d.ts +1 -1
  481. package/dist/schedule/commands/add.d.ts.map +1 -1
  482. package/dist/schedule/commands/lifecycle.d.ts.map +1 -1
  483. package/dist/schedule/commands/list.d.ts +3 -1
  484. package/dist/schedule/commands/list.d.ts.map +1 -1
  485. package/dist/schedule/daemon/daemon.d.ts +2 -0
  486. package/dist/schedule/daemon/daemon.d.ts.map +1 -1
  487. package/dist/schedule/delivery.d.ts +66 -0
  488. package/dist/schedule/delivery.d.ts.map +1 -0
  489. package/dist/schedule/fire/fire.d.ts +1 -1
  490. package/dist/schedule/fire/fire.d.ts.map +1 -1
  491. package/dist/schedule/fire/run-script.d.ts +2 -2
  492. package/dist/schedule/fire/run-script.d.ts.map +1 -1
  493. package/dist/schedule/fire/script-report.d.ts +31 -0
  494. package/dist/schedule/fire/script-report.d.ts.map +1 -0
  495. package/dist/schedule/floor.d.ts +1 -1
  496. package/dist/schedule/floor.d.ts.map +1 -1
  497. package/dist/schedule/folder.d.ts +6 -0
  498. package/dist/schedule/folder.d.ts.map +1 -1
  499. package/dist/schedule/resume-command.d.ts +3 -3
  500. package/dist/schedule/resume-command.d.ts.map +1 -1
  501. package/dist/schedule/store/history.d.ts.map +1 -1
  502. package/dist/schedule/store/jobs.d.ts +6 -6
  503. package/dist/schedule/store/jobs.d.ts.map +1 -1
  504. package/dist/schedule/store/script-state.d.ts +31 -0
  505. package/dist/schedule/store/script-state.d.ts.map +1 -0
  506. package/dist/schedule/store/state.d.ts +4 -2
  507. package/dist/schedule/store/state.d.ts.map +1 -1
  508. package/dist/schedule/types.d.ts +61 -16
  509. package/dist/schedule/types.d.ts.map +1 -1
  510. package/dist/skills/store.d.ts.map +1 -1
  511. package/dist/terminal/host.d.ts +22 -0
  512. package/dist/terminal/host.d.ts.map +1 -0
  513. package/dist/terminal/manager.d.ts +124 -0
  514. package/dist/terminal/manager.d.ts.map +1 -0
  515. package/dist/terminal/protocol.d.ts +162 -0
  516. package/dist/terminal/protocol.d.ts.map +1 -0
  517. package/dist/terminal/pty.d.ts +85 -0
  518. package/dist/terminal/pty.d.ts.map +1 -0
  519. package/dist/terminal/ring.d.ts +23 -0
  520. package/dist/terminal/ring.d.ts.map +1 -0
  521. package/dist/terminal/screen.d.ts +31 -0
  522. package/dist/terminal/screen.d.ts.map +1 -0
  523. package/dist/termination-state.d.ts +19 -0
  524. package/dist/termination-state.d.ts.map +1 -0
  525. package/dist/termination.d.ts +2 -9
  526. package/dist/termination.d.ts.map +1 -1
  527. package/dist/tui/AgentExplorer.d.ts +4 -1
  528. package/dist/tui/AgentExplorer.d.ts.map +1 -1
  529. package/dist/tui/App.d.ts.map +1 -1
  530. package/dist/tui/BackgroundJobsPanel.d.ts.map +1 -1
  531. package/dist/tui/BrandHeader.d.ts.map +1 -1
  532. package/dist/tui/ChildComposer.d.ts +22 -0
  533. package/dist/tui/ChildComposer.d.ts.map +1 -0
  534. package/dist/tui/ChoicePicker.d.ts.map +1 -1
  535. package/dist/tui/Composer.d.ts +19 -3
  536. package/dist/tui/Composer.d.ts.map +1 -1
  537. package/dist/tui/ComposerFrame.d.ts.map +1 -1
  538. package/dist/tui/CopyPicker.d.ts.map +1 -1
  539. package/dist/tui/EditPromptPicker.d.ts.map +1 -1
  540. package/dist/tui/EffortSlider.d.ts.map +1 -1
  541. package/dist/tui/LiveActivity.d.ts +7 -1
  542. package/dist/tui/LiveActivity.d.ts.map +1 -1
  543. package/dist/tui/Markdown.d.ts.map +1 -1
  544. package/dist/tui/PendingInputPanel.d.ts.map +1 -1
  545. package/dist/tui/PermissionOverlay.d.ts.map +1 -1
  546. package/dist/tui/Picker.d.ts.map +1 -1
  547. package/dist/tui/ProviderSetup.d.ts.map +1 -1
  548. package/dist/tui/ResumePicker.d.ts.map +1 -1
  549. package/dist/tui/SaveSkillOverlay.d.ts.map +1 -1
  550. package/dist/tui/ScheduleReviewOverlay.d.ts +1 -1
  551. package/dist/tui/ScheduleReviewOverlay.d.ts.map +1 -1
  552. package/dist/tui/StatusBar.d.ts +7 -1
  553. package/dist/tui/StatusBar.d.ts.map +1 -1
  554. package/dist/tui/StatusPanel.d.ts.map +1 -1
  555. package/dist/tui/TextPrompt.d.ts.map +1 -1
  556. package/dist/tui/ToolOutputViewer.d.ts.map +1 -1
  557. package/dist/tui/Transcript.d.ts.map +1 -1
  558. package/dist/tui/TrustPrompt.d.ts +8 -0
  559. package/dist/tui/TrustPrompt.d.ts.map +1 -1
  560. package/dist/tui/agent.d.ts +125 -3
  561. package/dist/tui/agent.d.ts.map +1 -1
  562. package/dist/tui/browser-notices.d.ts.map +1 -1
  563. package/dist/tui/capability-notice.d.ts +38 -0
  564. package/dist/tui/capability-notice.d.ts.map +1 -0
  565. package/dist/tui/console-input.d.ts +31 -0
  566. package/dist/tui/console-input.d.ts.map +1 -0
  567. package/dist/tui/conversation-evidence-view.d.ts.map +1 -1
  568. package/dist/tui/credential-entry.d.ts.map +1 -1
  569. package/dist/tui/exit-summary.d.ts +9 -1
  570. package/dist/tui/exit-summary.d.ts.map +1 -1
  571. package/dist/tui/external-editor.d.ts.map +1 -1
  572. package/dist/tui/index.d.ts.map +1 -1
  573. package/dist/tui/key-hints.d.ts +51 -0
  574. package/dist/tui/key-hints.d.ts.map +1 -0
  575. package/dist/tui/launch-settings.d.ts +34 -0
  576. package/dist/tui/launch-settings.d.ts.map +1 -0
  577. package/dist/tui/log-pane.d.ts.map +1 -1
  578. package/dist/tui/model-choices.d.ts +39 -1
  579. package/dist/tui/model-choices.d.ts.map +1 -1
  580. package/dist/tui/model-search.d.ts +4 -1
  581. package/dist/tui/model-search.d.ts.map +1 -1
  582. package/dist/tui/output-size-watch.d.ts +32 -0
  583. package/dist/tui/output-size-watch.d.ts.map +1 -0
  584. package/dist/tui/permission-review.d.ts.map +1 -1
  585. package/dist/tui/person-terms.d.ts +58 -0
  586. package/dist/tui/person-terms.d.ts.map +1 -0
  587. package/dist/tui/plain-failure.d.ts +27 -0
  588. package/dist/tui/plain-failure.d.ts.map +1 -0
  589. package/dist/tui/plain-interruption.d.ts +46 -0
  590. package/dist/tui/plain-interruption.d.ts.map +1 -0
  591. package/dist/tui/provider-list.d.ts.map +1 -1
  592. package/dist/tui/render-mode.d.ts +19 -0
  593. package/dist/tui/render-mode.d.ts.map +1 -0
  594. package/dist/tui/schedule/host-commands.d.ts +2 -9
  595. package/dist/tui/schedule/host-commands.d.ts.map +1 -1
  596. package/dist/tui/schedule/integration.d.ts +8 -0
  597. package/dist/tui/schedule/integration.d.ts.map +1 -1
  598. package/dist/tui/schedule/source-deliveries.d.ts +37 -0
  599. package/dist/tui/schedule/source-deliveries.d.ts.map +1 -0
  600. package/dist/tui/schedule/startup.d.ts.map +1 -1
  601. package/dist/tui/schedule/tool-host.d.ts +3 -1
  602. package/dist/tui/schedule/tool-host.d.ts.map +1 -1
  603. package/dist/tui/setup-text.d.ts +14 -0
  604. package/dist/tui/setup-text.d.ts.map +1 -0
  605. package/dist/tui/shell-escape.d.ts.map +1 -1
  606. package/dist/tui/skills/suggest-setting.d.ts.map +1 -1
  607. package/dist/tui/slashCommands.d.ts +4 -1
  608. package/dist/tui/slashCommands.d.ts.map +1 -1
  609. package/dist/tui/terminal-choice-text.d.ts +7 -0
  610. package/dist/tui/terminal-choice-text.d.ts.map +1 -1
  611. package/dist/tui/tidy-tool-output.d.ts +83 -0
  612. package/dist/tui/tidy-tool-output.d.ts.map +1 -0
  613. package/dist/tui/tool-presentation.d.ts +6 -0
  614. package/dist/tui/tool-presentation.d.ts.map +1 -0
  615. package/dist/tui/triggers/copy.d.ts.map +1 -1
  616. package/dist/tui/triggers/setting.d.ts.map +1 -1
  617. package/dist/tui/turn-interruption.d.ts +1 -1
  618. package/dist/tui/turn-interruption.d.ts.map +1 -1
  619. package/dist/tui/turn-limits-settings.d.ts +4 -4
  620. package/dist/tui/turn-limits-settings.d.ts.map +1 -1
  621. package/dist/tui/types.d.ts +10 -0
  622. package/dist/tui/types.d.ts.map +1 -1
  623. package/dist/tui/web-activity.d.ts +3 -2
  624. package/dist/tui/web-activity.d.ts.map +1 -1
  625. package/dist/tui/zen-free-refusal.d.ts +17 -0
  626. package/dist/tui/zen-free-refusal.d.ts.map +1 -0
  627. package/dist/usage-error.d.ts +15 -0
  628. package/dist/usage-error.d.ts.map +1 -0
  629. package/dist/warning-filter.d.ts +30 -0
  630. package/dist/warning-filter.d.ts.map +1 -0
  631. package/package.json +21 -10
  632. package/skills/schedule-task/SKILL.md +74 -20
  633. package/dist/browser/commands.js +0 -365
  634. package/dist/browser/commands.js.map +0 -1
  635. package/dist/browser/control.js +0 -140
  636. package/dist/browser/control.js.map +0 -1
  637. package/dist/browser/describe.js +0 -27
  638. package/dist/browser/describe.js.map +0 -1
  639. package/dist/checkpoints/store.js +0 -192
  640. package/dist/checkpoints/store.js.map +0 -1
  641. package/dist/checkpoints/wrap.js +0 -37
  642. package/dist/checkpoints/wrap.js.map +0 -1
  643. package/dist/cli.js +0 -602
  644. package/dist/cli.js.map +0 -1
  645. package/dist/commands/acp.js +0 -388
  646. package/dist/commands/acp.js.map +0 -1
  647. package/dist/commands/archive.js +0 -65
  648. package/dist/commands/archive.js.map +0 -1
  649. package/dist/commands/browser.js +0 -16
  650. package/dist/commands/browser.js.map +0 -1
  651. package/dist/commands/doctor.js +0 -267
  652. package/dist/commands/doctor.js.map +0 -1
  653. package/dist/commands/drain.js +0 -498
  654. package/dist/commands/drain.js.map +0 -1
  655. package/dist/commands/eval.js +0 -237
  656. package/dist/commands/eval.js.map +0 -1
  657. package/dist/commands/exec-flags.js +0 -334
  658. package/dist/commands/exec-flags.js.map +0 -1
  659. package/dist/commands/exec-json.js +0 -497
  660. package/dist/commands/exec-json.js.map +0 -1
  661. package/dist/commands/exec.js +0 -688
  662. package/dist/commands/exec.js.map +0 -1
  663. package/dist/commands/host-queries.js +0 -156
  664. package/dist/commands/host-queries.js.map +0 -1
  665. package/dist/commands/login.js +0 -315
  666. package/dist/commands/login.js.map +0 -1
  667. package/dist/commands/mcp-oauth-login.js +0 -213
  668. package/dist/commands/mcp-oauth-login.js.map +0 -1
  669. package/dist/commands/mcp.js +0 -461
  670. package/dist/commands/mcp.js.map +0 -1
  671. package/dist/commands/prior-messages.js +0 -329
  672. package/dist/commands/prior-messages.js.map +0 -1
  673. package/dist/commands/provider-wait.js +0 -65
  674. package/dist/commands/provider-wait.js.map +0 -1
  675. package/dist/commands/registry.js +0 -40
  676. package/dist/commands/registry.js.map +0 -1
  677. package/dist/commands/resident-flags.js +0 -193
  678. package/dist/commands/resident-flags.js.map +0 -1
  679. package/dist/commands/resident-learning.js +0 -293
  680. package/dist/commands/resident-learning.js.map +0 -1
  681. package/dist/commands/resident.js +0 -419
  682. package/dist/commands/resident.js.map +0 -1
  683. package/dist/commands/resume.js +0 -109
  684. package/dist/commands/resume.js.map +0 -1
  685. package/dist/commands/schedule.js +0 -131
  686. package/dist/commands/schedule.js.map +0 -1
  687. package/dist/commands/serve.js +0 -21
  688. package/dist/commands/serve.js.map +0 -1
  689. package/dist/commands/skills.js +0 -178
  690. package/dist/commands/skills.js.map +0 -1
  691. package/dist/commands/state.js +0 -110
  692. package/dist/commands/state.js.map +0 -1
  693. package/dist/commands/stdin.js +0 -69
  694. package/dist/commands/stdin.js.map +0 -1
  695. package/dist/commands/types.js +0 -2
  696. package/dist/commands/types.js.map +0 -1
  697. package/dist/commands/upgrade-progress.js +0 -54
  698. package/dist/commands/upgrade-progress.js.map +0 -1
  699. package/dist/commands/upgrade.js +0 -232
  700. package/dist/commands/upgrade.js.map +0 -1
  701. package/dist/commands/worktree.js +0 -86
  702. package/dist/commands/worktree.js.map +0 -1
  703. package/dist/config/composer-triggers.js +0 -80
  704. package/dist/config/composer-triggers.js.map +0 -1
  705. package/dist/config/debug.js +0 -126
  706. package/dist/config/debug.js.map +0 -1
  707. package/dist/config/load.js +0 -1208
  708. package/dist/config/load.js.map +0 -1
  709. package/dist/config/schema.js +0 -13
  710. package/dist/config/schema.js.map +0 -1
  711. package/dist/config/tool-result-screens.js +0 -104
  712. package/dist/config/tool-result-screens.js.map +0 -1
  713. package/dist/config/trusted-project-context.js +0 -28
  714. package/dist/config/trusted-project-context.js.map +0 -1
  715. package/dist/config/turn-guards.js +0 -46
  716. package/dist/config/turn-guards.js.map +0 -1
  717. package/dist/config/user-config.js +0 -118
  718. package/dist/config/user-config.js.map +0 -1
  719. package/dist/context/capabilities.js +0 -164
  720. package/dist/context/capabilities.js.map +0 -1
  721. package/dist/context/directories.js +0 -69
  722. package/dist/context/directories.js.map +0 -1
  723. package/dist/context/doctrine.js +0 -24
  724. package/dist/context/doctrine.js.map +0 -1
  725. package/dist/context/environment.js +0 -255
  726. package/dist/context/environment.js.map +0 -1
  727. package/dist/context/project-path.js +0 -16
  728. package/dist/context/project-path.js.map +0 -1
  729. package/dist/context/project-tracker.js +0 -217
  730. package/dist/context/project-tracker.js.map +0 -1
  731. package/dist/context/project.js +0 -256
  732. package/dist/context/project.js.map +0 -1
  733. package/dist/context/runtime-message.js +0 -30
  734. package/dist/context/runtime-message.js.map +0 -1
  735. package/dist/context/sandbox.js +0 -114
  736. package/dist/context/sandbox.js.map +0 -1
  737. package/dist/context/turn-snapshot.js +0 -122
  738. package/dist/context/turn-snapshot.js.map +0 -1
  739. package/dist/doctor/checks/browser.js +0 -63
  740. package/dist/doctor/checks/browser.js.map +0 -1
  741. package/dist/doctor/checks/chain.js +0 -211
  742. package/dist/doctor/checks/chain.js.map +0 -1
  743. package/dist/doctor/checks/credentials.js +0 -98
  744. package/dist/doctor/checks/credentials.js.map +0 -1
  745. package/dist/doctor/checks/index.js +0 -72
  746. package/dist/doctor/checks/index.js.map +0 -1
  747. package/dist/doctor/checks/invariants.js +0 -79
  748. package/dist/doctor/checks/invariants.js.map +0 -1
  749. package/dist/doctor/checks/logging.js +0 -69
  750. package/dist/doctor/checks/logging.js.map +0 -1
  751. package/dist/doctor/checks/providers.js +0 -30
  752. package/dist/doctor/checks/providers.js.map +0 -1
  753. package/dist/doctor/checks/runtime.js +0 -40
  754. package/dist/doctor/checks/runtime.js.map +0 -1
  755. package/dist/doctor/checks/sandbox.js +0 -76
  756. package/dist/doctor/checks/sandbox.js.map +0 -1
  757. package/dist/doctor/checks/scheduler.js +0 -74
  758. package/dist/doctor/checks/scheduler.js.map +0 -1
  759. package/dist/doctor/checks/session-export.js +0 -62
  760. package/dist/doctor/checks/session-export.js.map +0 -1
  761. package/dist/doctor/checks/telemetry.js +0 -58
  762. package/dist/doctor/checks/telemetry.js.map +0 -1
  763. package/dist/doctor/checks/vault.js +0 -67
  764. package/dist/doctor/checks/vault.js.map +0 -1
  765. package/dist/doctor/index.js +0 -3
  766. package/dist/doctor/index.js.map +0 -1
  767. package/dist/doctor/registry.js +0 -230
  768. package/dist/doctor/registry.js.map +0 -1
  769. package/dist/exit-codes.js +0 -62
  770. package/dist/exit-codes.js.map +0 -1
  771. package/dist/installation.js +0 -48
  772. package/dist/installation.js.map +0 -1
  773. package/dist/integrations/clipboard/image.js +0 -119
  774. package/dist/integrations/clipboard/image.js.map +0 -1
  775. package/dist/integrations/clipboard/text.js +0 -43
  776. package/dist/integrations/clipboard/text.js.map +0 -1
  777. package/dist/integrations/files/attachment-store.js +0 -86
  778. package/dist/integrations/files/attachment-store.js.map +0 -1
  779. package/dist/integrations/mcp/oauth-store.js +0 -549
  780. package/dist/integrations/mcp/oauth-store.js.map +0 -1
  781. package/dist/integrations/mcp/servers.js +0 -611
  782. package/dist/integrations/mcp/servers.js.map +0 -1
  783. package/dist/integrations/mcp/user-config.js +0 -92
  784. package/dist/integrations/mcp/user-config.js.map +0 -1
  785. package/dist/integrations/notifications/desktop/freedesktop.js +0 -33
  786. package/dist/integrations/notifications/desktop/freedesktop.js.map +0 -1
  787. package/dist/integrations/notifications/desktop/macos.js +0 -17
  788. package/dist/integrations/notifications/desktop/macos.js.map +0 -1
  789. package/dist/integrations/notifications/desktop/sanitize.js +0 -49
  790. package/dist/integrations/notifications/desktop/sanitize.js.map +0 -1
  791. package/dist/integrations/notifications/desktop/throttle.js +0 -39
  792. package/dist/integrations/notifications/desktop/throttle.js.map +0 -1
  793. package/dist/integrations/notifications/desktop/windows-toast.js +0 -56
  794. package/dist/integrations/notifications/desktop/windows-toast.js.map +0 -1
  795. package/dist/integrations/notifications/desktop.js +0 -199
  796. package/dist/integrations/notifications/desktop.js.map +0 -1
  797. package/dist/integrations/notifications/terminal.js +0 -46
  798. package/dist/integrations/notifications/terminal.js.map +0 -1
  799. package/dist/integrations/npm-invocation.js +0 -23
  800. package/dist/integrations/npm-invocation.js.map +0 -1
  801. package/dist/integrations/plugins/runtime.js +0 -189
  802. package/dist/integrations/plugins/runtime.js.map +0 -1
  803. package/dist/integrations/plugins/settings.js +0 -106
  804. package/dist/integrations/plugins/settings.js.map +0 -1
  805. package/dist/integrations/providers/access.js +0 -23
  806. package/dist/integrations/providers/access.js.map +0 -1
  807. package/dist/integrations/providers/chain-capabilities.js +0 -211
  808. package/dist/integrations/providers/chain-capabilities.js.map +0 -1
  809. package/dist/integrations/providers/codex-device-login.js +0 -195
  810. package/dist/integrations/providers/codex-device-login.js.map +0 -1
  811. package/dist/integrations/providers/codex-oauth.js +0 -95
  812. package/dist/integrations/providers/codex-oauth.js.map +0 -1
  813. package/dist/integrations/providers/credential-provider.js +0 -74
  814. package/dist/integrations/providers/credential-provider.js.map +0 -1
  815. package/dist/integrations/providers/credential-store.js +0 -657
  816. package/dist/integrations/providers/credential-store.js.map +0 -1
  817. package/dist/integrations/providers/current-credential.js +0 -45
  818. package/dist/integrations/providers/current-credential.js.map +0 -1
  819. package/dist/integrations/providers/discover.js +0 -313
  820. package/dist/integrations/providers/discover.js.map +0 -1
  821. package/dist/integrations/providers/gemini-credentials.js +0 -148
  822. package/dist/integrations/providers/gemini-credentials.js.map +0 -1
  823. package/dist/integrations/providers/harness-credentials.js +0 -344
  824. package/dist/integrations/providers/harness-credentials.js.map +0 -1
  825. package/dist/integrations/providers/identity.js +0 -64
  826. package/dist/integrations/providers/identity.js.map +0 -1
  827. package/dist/integrations/providers/index.js +0 -14
  828. package/dist/integrations/providers/index.js.map +0 -1
  829. package/dist/integrations/providers/keychain.js +0 -78
  830. package/dist/integrations/providers/keychain.js.map +0 -1
  831. package/dist/integrations/providers/model-reasoning.js +0 -51
  832. package/dist/integrations/providers/model-reasoning.js.map +0 -1
  833. package/dist/integrations/providers/oauth.js +0 -302
  834. package/dist/integrations/providers/oauth.js.map +0 -1
  835. package/dist/integrations/providers/preferences.js +0 -287
  836. package/dist/integrations/providers/preferences.js.map +0 -1
  837. package/dist/integrations/providers/register.js +0 -154
  838. package/dist/integrations/providers/register.js.map +0 -1
  839. package/dist/integrations/providers/registry.js +0 -289
  840. package/dist/integrations/providers/registry.js.map +0 -1
  841. package/dist/integrations/providers/setup.js +0 -158
  842. package/dist/integrations/providers/setup.js.map +0 -1
  843. package/dist/integrations/providers/subscription-login.js +0 -328
  844. package/dist/integrations/providers/subscription-login.js.map +0 -1
  845. package/dist/integrations/providers/zen-catalogue.js +0 -196
  846. package/dist/integrations/providers/zen-catalogue.js.map +0 -1
  847. package/dist/integrations/resident/foreground.js +0 -95
  848. package/dist/integrations/resident/foreground.js.map +0 -1
  849. package/dist/integrations/resident/inspection.js +0 -282
  850. package/dist/integrations/resident/inspection.js.map +0 -1
  851. package/dist/integrations/resident/learning-sources.js +0 -79
  852. package/dist/integrations/resident/learning-sources.js.map +0 -1
  853. package/dist/integrations/resident/learning-storage.js +0 -55
  854. package/dist/integrations/resident/learning-storage.js.map +0 -1
  855. package/dist/integrations/resident/lifecycle-errors.js +0 -15
  856. package/dist/integrations/resident/lifecycle-errors.js.map +0 -1
  857. package/dist/integrations/resident/owned-runner.js +0 -91
  858. package/dist/integrations/resident/owned-runner.js.map +0 -1
  859. package/dist/integrations/resident/runner-control.js +0 -238
  860. package/dist/integrations/resident/runner-control.js.map +0 -1
  861. package/dist/integrations/resident/runner-launch.js +0 -142
  862. package/dist/integrations/resident/runner-launch.js.map +0 -1
  863. package/dist/integrations/resident/runner-store.js +0 -284
  864. package/dist/integrations/resident/runner-store.js.map +0 -1
  865. package/dist/integrations/resident/session-log-reads.js +0 -125
  866. package/dist/integrations/resident/session-log-reads.js.map +0 -1
  867. package/dist/integrations/resident/session-step.js +0 -476
  868. package/dist/integrations/resident/session-step.js.map +0 -1
  869. package/dist/integrations/resident/storage.js +0 -183
  870. package/dist/integrations/resident/storage.js.map +0 -1
  871. package/dist/integrations/resident/tool-evidence.js +0 -123
  872. package/dist/integrations/resident/tool-evidence.js.map +0 -1
  873. package/dist/integrations/resident/verification.js +0 -109
  874. package/dist/integrations/resident/verification.js.map +0 -1
  875. package/dist/integrations/sessions/checkpoint-view.js +0 -48
  876. package/dist/integrations/sessions/checkpoint-view.js.map +0 -1
  877. package/dist/integrations/sessions/context-inventory.js +0 -44
  878. package/dist/integrations/sessions/context-inventory.js.map +0 -1
  879. package/dist/integrations/sessions/conversation-search.js +0 -572
  880. package/dist/integrations/sessions/conversation-search.js.map +0 -1
  881. package/dist/integrations/sessions/display-title.js +0 -5
  882. package/dist/integrations/sessions/display-title.js.map +0 -1
  883. package/dist/integrations/sessions/evidence-page-validation.js +0 -74
  884. package/dist/integrations/sessions/evidence-page-validation.js.map +0 -1
  885. package/dist/integrations/sessions/evidence-recall.js +0 -117
  886. package/dist/integrations/sessions/evidence-recall.js.map +0 -1
  887. package/dist/integrations/sessions/store.js +0 -780
  888. package/dist/integrations/sessions/store.js.map +0 -1
  889. package/dist/integrations/sessions/task-context.js +0 -96
  890. package/dist/integrations/sessions/task-context.js.map +0 -1
  891. package/dist/integrations/sessions/transcript-export.js +0 -342
  892. package/dist/integrations/sessions/transcript-export.js.map +0 -1
  893. package/dist/integrations/state/home.js +0 -17
  894. package/dist/integrations/state/home.js.map +0 -1
  895. package/dist/integrations/state/identity.js +0 -49
  896. package/dist/integrations/state/identity.js.map +0 -1
  897. package/dist/integrations/state/immutable-json.js +0 -38
  898. package/dist/integrations/state/immutable-json.js.map +0 -1
  899. package/dist/integrations/state/private-directory.js +0 -43
  900. package/dist/integrations/state/private-directory.js.map +0 -1
  901. package/dist/integrations/state/project.js +0 -13
  902. package/dist/integrations/state/project.js.map +0 -1
  903. package/dist/integrations/state/report.js +0 -626
  904. package/dist/integrations/state/report.js.map +0 -1
  905. package/dist/integrations/state/retention.js +0 -18
  906. package/dist/integrations/state/retention.js.map +0 -1
  907. package/dist/integrations/subagents/NamzuCliAgent.js +0 -9
  908. package/dist/integrations/subagents/NamzuCliAgent.js.map +0 -1
  909. package/dist/integrations/subagents/activity.js +0 -759
  910. package/dist/integrations/subagents/activity.js.map +0 -1
  911. package/dist/integrations/subagents/batches.js +0 -172
  912. package/dist/integrations/subagents/batches.js.map +0 -1
  913. package/dist/integrations/subagents/definitions.js +0 -26
  914. package/dist/integrations/subagents/definitions.js.map +0 -1
  915. package/dist/integrations/subagents/model-effort.js +0 -12
  916. package/dist/integrations/subagents/model-effort.js.map +0 -1
  917. package/dist/integrations/subagents/parent.js +0 -47
  918. package/dist/integrations/subagents/parent.js.map +0 -1
  919. package/dist/integrations/subagents/policy.js +0 -3
  920. package/dist/integrations/subagents/policy.js.map +0 -1
  921. package/dist/integrations/subagents/replay.js +0 -295
  922. package/dist/integrations/subagents/replay.js.map +0 -1
  923. package/dist/integrations/subagents/runtime.js +0 -1317
  924. package/dist/integrations/subagents/runtime.js.map +0 -1
  925. package/dist/integrations/subagents/saved-agents.js +0 -102
  926. package/dist/integrations/subagents/saved-agents.js.map +0 -1
  927. package/dist/integrations/subagents/slash.js +0 -45
  928. package/dist/integrations/subagents/slash.js.map +0 -1
  929. package/dist/integrations/subagents/worktree-driver.js +0 -72
  930. package/dist/integrations/subagents/worktree-driver.js.map +0 -1
  931. package/dist/integrations/telemetry/session-export.js +0 -119
  932. package/dist/integrations/telemetry/session-export.js.map +0 -1
  933. package/dist/integrations/trust/store.js +0 -73
  934. package/dist/integrations/trust/store.js.map +0 -1
  935. package/dist/integrations/updates.js +0 -115
  936. package/dist/integrations/updates.js.map +0 -1
  937. package/dist/integrations/web/exa-search.js +0 -154
  938. package/dist/integrations/web/exa-search.js.map +0 -1
  939. package/dist/integrations/web/open-url.js +0 -73
  940. package/dist/integrations/web/open-url.js.map +0 -1
  941. package/dist/integrations/web/search.js +0 -68
  942. package/dist/integrations/web/search.js.map +0 -1
  943. package/dist/integrations/worktrees/managed.js +0 -231
  944. package/dist/integrations/worktrees/managed.js.map +0 -1
  945. package/dist/logging.js +0 -115
  946. package/dist/logging.js.map +0 -1
  947. package/dist/memory/io.js +0 -177
  948. package/dist/memory/io.js.map +0 -1
  949. package/dist/memory/presentation.js +0 -76
  950. package/dist/memory/presentation.js.map +0 -1
  951. package/dist/memory/store.js +0 -180
  952. package/dist/memory/store.js.map +0 -1
  953. package/dist/memory/typed.js +0 -336
  954. package/dist/memory/typed.js.map +0 -1
  955. package/dist/output/formatter.js +0 -16
  956. package/dist/output/formatter.js.map +0 -1
  957. package/dist/output/index.js +0 -22
  958. package/dist/output/index.js.map +0 -1
  959. package/dist/output/json.js +0 -51
  960. package/dist/output/json.js.map +0 -1
  961. package/dist/output/text.js +0 -50
  962. package/dist/output/text.js.map +0 -1
  963. package/dist/output/yaml.js +0 -26
  964. package/dist/output/yaml.js.map +0 -1
  965. package/dist/output-schema.js +0 -18
  966. package/dist/output-schema.js.map +0 -1
  967. package/dist/permissions/browser-sites.js +0 -270
  968. package/dist/permissions/browser-sites.js.map +0 -1
  969. package/dist/permissions/canonical-project.js +0 -13
  970. package/dist/permissions/canonical-project.js.map +0 -1
  971. package/dist/permissions/checks.js +0 -128
  972. package/dist/permissions/checks.js.map +0 -1
  973. package/dist/permissions/headless-trust.js +0 -86
  974. package/dist/permissions/headless-trust.js.map +0 -1
  975. package/dist/permissions/live-mode.js +0 -62
  976. package/dist/permissions/live-mode.js.map +0 -1
  977. package/dist/permissions/mode.js +0 -65
  978. package/dist/permissions/mode.js.map +0 -1
  979. package/dist/permissions/rules.js +0 -358
  980. package/dist/permissions/rules.js.map +0 -1
  981. package/dist/release-notes.js +0 -64
  982. package/dist/release-notes.js.map +0 -1
  983. package/dist/resume-invocation.js +0 -24
  984. package/dist/resume-invocation.js.map +0 -1
  985. package/dist/schedule/build.js +0 -374
  986. package/dist/schedule/build.js.map +0 -1
  987. package/dist/schedule/changes.js +0 -78
  988. package/dist/schedule/changes.js.map +0 -1
  989. package/dist/schedule/commands/add.js +0 -603
  990. package/dist/schedule/commands/add.js.map +0 -1
  991. package/dist/schedule/commands/args.js +0 -80
  992. package/dist/schedule/commands/args.js.map +0 -1
  993. package/dist/schedule/commands/confirm-prompt.js +0 -21
  994. package/dist/schedule/commands/confirm-prompt.js.map +0 -1
  995. package/dist/schedule/commands/lifecycle.js +0 -586
  996. package/dist/schedule/commands/lifecycle.js.map +0 -1
  997. package/dist/schedule/commands/list.js +0 -260
  998. package/dist/schedule/commands/list.js.map +0 -1
  999. package/dist/schedule/commands/logs.js +0 -106
  1000. package/dist/schedule/commands/logs.js.map +0 -1
  1001. package/dist/schedule/commands/service.js +0 -458
  1002. package/dist/schedule/commands/service.js.map +0 -1
  1003. package/dist/schedule/daemon/daemon.js +0 -1265
  1004. package/dist/schedule/daemon/daemon.js.map +0 -1
  1005. package/dist/schedule/daemon/endpoint.js +0 -158
  1006. package/dist/schedule/daemon/endpoint.js.map +0 -1
  1007. package/dist/schedule/daemon/exit.js +0 -8
  1008. package/dist/schedule/daemon/exit.js.map +0 -1
  1009. package/dist/schedule/daemon/log.js +0 -53
  1010. package/dist/schedule/daemon/log.js.map +0 -1
  1011. package/dist/schedule/daemon/notify.js +0 -158
  1012. package/dist/schedule/daemon/notify.js.map +0 -1
  1013. package/dist/schedule/daemon/retention.js +0 -46
  1014. package/dist/schedule/daemon/retention.js.map +0 -1
  1015. package/dist/schedule/daemon/sessions.js +0 -52
  1016. package/dist/schedule/daemon/sessions.js.map +0 -1
  1017. package/dist/schedule/env.js +0 -106
  1018. package/dist/schedule/env.js.map +0 -1
  1019. package/dist/schedule/fire/browser-preflight.js +0 -73
  1020. package/dist/schedule/fire/browser-preflight.js.map +0 -1
  1021. package/dist/schedule/fire/calls.js +0 -114
  1022. package/dist/schedule/fire/calls.js.map +0 -1
  1023. package/dist/schedule/fire/fire.js +0 -681
  1024. package/dist/schedule/fire/fire.js.map +0 -1
  1025. package/dist/schedule/fire/result.js +0 -19
  1026. package/dist/schedule/fire/result.js.map +0 -1
  1027. package/dist/schedule/fire/run-script.js +0 -81
  1028. package/dist/schedule/fire/run-script.js.map +0 -1
  1029. package/dist/schedule/fire/unattended-note.js +0 -51
  1030. package/dist/schedule/fire/unattended-note.js.map +0 -1
  1031. package/dist/schedule/fire/wake-gate.js +0 -90
  1032. package/dist/schedule/fire/wake-gate.js.map +0 -1
  1033. package/dist/schedule/floor.js +0 -1561
  1034. package/dist/schedule/floor.js.map +0 -1
  1035. package/dist/schedule/folder.js +0 -84
  1036. package/dist/schedule/folder.js.map +0 -1
  1037. package/dist/schedule/paths.js +0 -53
  1038. package/dist/schedule/paths.js.map +0 -1
  1039. package/dist/schedule/policy.js +0 -414
  1040. package/dist/schedule/policy.js.map +0 -1
  1041. package/dist/schedule/resume-command.js +0 -72
  1042. package/dist/schedule/resume-command.js.map +0 -1
  1043. package/dist/schedule/script-check.js +0 -146
  1044. package/dist/schedule/script-check.js.map +0 -1
  1045. package/dist/schedule/script-shell.js +0 -5
  1046. package/dist/schedule/script-shell.js.map +0 -1
  1047. package/dist/schedule/service/detect.js +0 -29
  1048. package/dist/schedule/service/detect.js.map +0 -1
  1049. package/dist/schedule/service/index.js +0 -361
  1050. package/dist/schedule/service/index.js.map +0 -1
  1051. package/dist/schedule/service/launchd.js +0 -84
  1052. package/dist/schedule/service/launchd.js.map +0 -1
  1053. package/dist/schedule/service/manifest.js +0 -16
  1054. package/dist/schedule/service/manifest.js.map +0 -1
  1055. package/dist/schedule/service/names.js +0 -22
  1056. package/dist/schedule/service/names.js.map +0 -1
  1057. package/dist/schedule/service/quote.js +0 -64
  1058. package/dist/schedule/service/quote.js.map +0 -1
  1059. package/dist/schedule/service/runner.js +0 -31
  1060. package/dist/schedule/service/runner.js.map +0 -1
  1061. package/dist/schedule/service/systemd.js +0 -96
  1062. package/dist/schedule/service/systemd.js.map +0 -1
  1063. package/dist/schedule/service/windows-task.js +0 -199
  1064. package/dist/schedule/service/windows-task.js.map +0 -1
  1065. package/dist/schedule/service/wsl.js +0 -121
  1066. package/dist/schedule/service/wsl.js.map +0 -1
  1067. package/dist/schedule/store/atomic.js +0 -138
  1068. package/dist/schedule/store/atomic.js.map +0 -1
  1069. package/dist/schedule/store/claims.js +0 -57
  1070. package/dist/schedule/store/claims.js.map +0 -1
  1071. package/dist/schedule/store/digest.js +0 -139
  1072. package/dist/schedule/store/digest.js.map +0 -1
  1073. package/dist/schedule/store/history.js +0 -117
  1074. package/dist/schedule/store/history.js.map +0 -1
  1075. package/dist/schedule/store/jobs.js +0 -277
  1076. package/dist/schedule/store/jobs.js.map +0 -1
  1077. package/dist/schedule/store/state.js +0 -38
  1078. package/dist/schedule/store/state.js.map +0 -1
  1079. package/dist/schedule/types.js +0 -33
  1080. package/dist/schedule/types.js.map +0 -1
  1081. package/dist/schedule/visible-source.js +0 -59
  1082. package/dist/schedule/visible-source.js.map +0 -1
  1083. package/dist/skills/audit.js +0 -75
  1084. package/dist/skills/audit.js.map +0 -1
  1085. package/dist/skills/catalog.js +0 -226
  1086. package/dist/skills/catalog.js.map +0 -1
  1087. package/dist/skills/directory.js +0 -51
  1088. package/dist/skills/directory.js.map +0 -1
  1089. package/dist/skills/save.js +0 -344
  1090. package/dist/skills/save.js.map +0 -1
  1091. package/dist/skills/store.js +0 -351
  1092. package/dist/skills/store.js.map +0 -1
  1093. package/dist/termination.js +0 -143
  1094. package/dist/termination.js.map +0 -1
  1095. package/dist/test-support/toolset.js +0 -27
  1096. package/dist/test-support/toolset.js.map +0 -1
  1097. package/dist/tui/AgentExplorer.js +0 -789
  1098. package/dist/tui/AgentExplorer.js.map +0 -1
  1099. package/dist/tui/App.js +0 -8499
  1100. package/dist/tui/App.js.map +0 -1
  1101. package/dist/tui/BackgroundJobsPanel.js +0 -129
  1102. package/dist/tui/BackgroundJobsPanel.js.map +0 -1
  1103. package/dist/tui/BrandHeader.js +0 -14
  1104. package/dist/tui/BrandHeader.js.map +0 -1
  1105. package/dist/tui/Checklist.js +0 -90
  1106. package/dist/tui/Checklist.js.map +0 -1
  1107. package/dist/tui/ChoicePicker.js +0 -64
  1108. package/dist/tui/ChoicePicker.js.map +0 -1
  1109. package/dist/tui/Composer.js +0 -939
  1110. package/dist/tui/Composer.js.map +0 -1
  1111. package/dist/tui/ComposerFrame.js +0 -79
  1112. package/dist/tui/ComposerFrame.js.map +0 -1
  1113. package/dist/tui/CopyPicker.js +0 -19
  1114. package/dist/tui/CopyPicker.js.map +0 -1
  1115. package/dist/tui/EditPromptPicker.js +0 -17
  1116. package/dist/tui/EditPromptPicker.js.map +0 -1
  1117. package/dist/tui/EffortSlider.js +0 -134
  1118. package/dist/tui/EffortSlider.js.map +0 -1
  1119. package/dist/tui/LiveActivity.js +0 -89
  1120. package/dist/tui/LiveActivity.js.map +0 -1
  1121. package/dist/tui/Markdown.js +0 -137
  1122. package/dist/tui/Markdown.js.map +0 -1
  1123. package/dist/tui/PendingInputPanel.js +0 -108
  1124. package/dist/tui/PendingInputPanel.js.map +0 -1
  1125. package/dist/tui/PermissionOverlay.js +0 -278
  1126. package/dist/tui/PermissionOverlay.js.map +0 -1
  1127. package/dist/tui/Picker.js +0 -1310
  1128. package/dist/tui/Picker.js.map +0 -1
  1129. package/dist/tui/ProviderSetup.js +0 -125
  1130. package/dist/tui/ProviderSetup.js.map +0 -1
  1131. package/dist/tui/ResumePicker.js +0 -34
  1132. package/dist/tui/ResumePicker.js.map +0 -1
  1133. package/dist/tui/SaveSkillOverlay.js +0 -118
  1134. package/dist/tui/SaveSkillOverlay.js.map +0 -1
  1135. package/dist/tui/ScheduleReviewOverlay.js +0 -166
  1136. package/dist/tui/ScheduleReviewOverlay.js.map +0 -1
  1137. package/dist/tui/StatusBar.js +0 -182
  1138. package/dist/tui/StatusBar.js.map +0 -1
  1139. package/dist/tui/StatusPanel.js +0 -11
  1140. package/dist/tui/StatusPanel.js.map +0 -1
  1141. package/dist/tui/TaskList.js +0 -43
  1142. package/dist/tui/TaskList.js.map +0 -1
  1143. package/dist/tui/TextPrompt.js +0 -185
  1144. package/dist/tui/TextPrompt.js.map +0 -1
  1145. package/dist/tui/ToolOutputViewer.js +0 -39
  1146. package/dist/tui/ToolOutputViewer.js.map +0 -1
  1147. package/dist/tui/Transcript.js +0 -235
  1148. package/dist/tui/Transcript.js.map +0 -1
  1149. package/dist/tui/TrustPrompt.js +0 -13
  1150. package/dist/tui/TrustPrompt.js.map +0 -1
  1151. package/dist/tui/ViewportBound.js +0 -55
  1152. package/dist/tui/ViewportBound.js.map +0 -1
  1153. package/dist/tui/agent-transcript-rows.js +0 -115
  1154. package/dist/tui/agent-transcript-rows.js.map +0 -1
  1155. package/dist/tui/agent.js +0 -4301
  1156. package/dist/tui/agent.js.map +0 -1
  1157. package/dist/tui/browser-notices.js +0 -107
  1158. package/dist/tui/browser-notices.js.map +0 -1
  1159. package/dist/tui/choice-selection.js +0 -38
  1160. package/dist/tui/choice-selection.js.map +0 -1
  1161. package/dist/tui/compact-transcript.js +0 -46
  1162. package/dist/tui/compact-transcript.js.map +0 -1
  1163. package/dist/tui/consent-timing.js +0 -48
  1164. package/dist/tui/consent-timing.js.map +0 -1
  1165. package/dist/tui/conversation-evidence-view.js +0 -96
  1166. package/dist/tui/conversation-evidence-view.js.map +0 -1
  1167. package/dist/tui/conversation-history.js +0 -33
  1168. package/dist/tui/conversation-history.js.map +0 -1
  1169. package/dist/tui/copy-targets.js +0 -189
  1170. package/dist/tui/copy-targets.js.map +0 -1
  1171. package/dist/tui/credential-entry.js +0 -134
  1172. package/dist/tui/credential-entry.js.map +0 -1
  1173. package/dist/tui/edit-prompts.js +0 -35
  1174. package/dist/tui/edit-prompts.js.map +0 -1
  1175. package/dist/tui/exit-summary.js +0 -30
  1176. package/dist/tui/exit-summary.js.map +0 -1
  1177. package/dist/tui/external-editor.js +0 -169
  1178. package/dist/tui/external-editor.js.map +0 -1
  1179. package/dist/tui/hypermode.js +0 -58
  1180. package/dist/tui/hypermode.js.map +0 -1
  1181. package/dist/tui/index.js +0 -81
  1182. package/dist/tui/index.js.map +0 -1
  1183. package/dist/tui/live-window.js +0 -281
  1184. package/dist/tui/live-window.js.map +0 -1
  1185. package/dist/tui/log-pane.js +0 -100
  1186. package/dist/tui/log-pane.js.map +0 -1
  1187. package/dist/tui/login-prompt.js +0 -105
  1188. package/dist/tui/login-prompt.js.map +0 -1
  1189. package/dist/tui/logo.js +0 -9
  1190. package/dist/tui/logo.js.map +0 -1
  1191. package/dist/tui/markdown-block-cache.js +0 -76
  1192. package/dist/tui/markdown-block-cache.js.map +0 -1
  1193. package/dist/tui/markdown-table.js +0 -175
  1194. package/dist/tui/markdown-table.js.map +0 -1
  1195. package/dist/tui/markdown-wrap.js +0 -189
  1196. package/dist/tui/markdown-wrap.js.map +0 -1
  1197. package/dist/tui/markdownParser.js +0 -237
  1198. package/dist/tui/markdownParser.js.map +0 -1
  1199. package/dist/tui/mentions.js +0 -150
  1200. package/dist/tui/mentions.js.map +0 -1
  1201. package/dist/tui/model-catalogue-view.js +0 -75
  1202. package/dist/tui/model-catalogue-view.js.map +0 -1
  1203. package/dist/tui/model-choices.js +0 -157
  1204. package/dist/tui/model-choices.js.map +0 -1
  1205. package/dist/tui/model-search.js +0 -28
  1206. package/dist/tui/model-search.js.map +0 -1
  1207. package/dist/tui/model-selection-intent.js +0 -96
  1208. package/dist/tui/model-selection-intent.js.map +0 -1
  1209. package/dist/tui/model-switch-tool.js +0 -74
  1210. package/dist/tui/model-switch-tool.js.map +0 -1
  1211. package/dist/tui/model-switch.js +0 -106
  1212. package/dist/tui/model-switch.js.map +0 -1
  1213. package/dist/tui/notices.js +0 -27
  1214. package/dist/tui/notices.js.map +0 -1
  1215. package/dist/tui/open-browser.js +0 -147
  1216. package/dist/tui/open-browser.js.map +0 -1
  1217. package/dist/tui/permission-review.js +0 -858
  1218. package/dist/tui/permission-review.js.map +0 -1
  1219. package/dist/tui/plugin-view.js +0 -59
  1220. package/dist/tui/plugin-view.js.map +0 -1
  1221. package/dist/tui/provider-list.js +0 -327
  1222. package/dist/tui/provider-list.js.map +0 -1
  1223. package/dist/tui/provider-selection.js +0 -16
  1224. package/dist/tui/provider-selection.js.map +0 -1
  1225. package/dist/tui/schedule/host-commands.js +0 -428
  1226. package/dist/tui/schedule/host-commands.js.map +0 -1
  1227. package/dist/tui/schedule/integration.js +0 -150
  1228. package/dist/tui/schedule/integration.js.map +0 -1
  1229. package/dist/tui/schedule/loop-host.js +0 -153
  1230. package/dist/tui/schedule/loop-host.js.map +0 -1
  1231. package/dist/tui/schedule/resume.js +0 -333
  1232. package/dist/tui/schedule/resume.js.map +0 -1
  1233. package/dist/tui/schedule/startup.js +0 -121
  1234. package/dist/tui/schedule/startup.js.map +0 -1
  1235. package/dist/tui/schedule/tool-host.js +0 -619
  1236. package/dist/tui/schedule/tool-host.js.map +0 -1
  1237. package/dist/tui/selection-window.js +0 -37
  1238. package/dist/tui/selection-window.js.map +0 -1
  1239. package/dist/tui/shell-escape.js +0 -110
  1240. package/dist/tui/shell-escape.js.map +0 -1
  1241. package/dist/tui/skills/learning.js +0 -131
  1242. package/dist/tui/skills/learning.js.map +0 -1
  1243. package/dist/tui/skills/suggest-setting.js +0 -55
  1244. package/dist/tui/skills/suggest-setting.js.map +0 -1
  1245. package/dist/tui/skills/suggestion-ledger.js +0 -52
  1246. package/dist/tui/skills/suggestion-ledger.js.map +0 -1
  1247. package/dist/tui/slashCommands.js +0 -1588
  1248. package/dist/tui/slashCommands.js.map +0 -1
  1249. package/dist/tui/status-card.js +0 -30
  1250. package/dist/tui/status-card.js.map +0 -1
  1251. package/dist/tui/status-panel-layout.js +0 -42
  1252. package/dist/tui/status-panel-layout.js.map +0 -1
  1253. package/dist/tui/stream-blocks.js +0 -187
  1254. package/dist/tui/stream-blocks.js.map +0 -1
  1255. package/dist/tui/task-activity.js +0 -157
  1256. package/dist/tui/task-activity.js.map +0 -1
  1257. package/dist/tui/terminal-choice-text.js +0 -118
  1258. package/dist/tui/terminal-choice-text.js.map +0 -1
  1259. package/dist/tui/terminal-display.js +0 -65
  1260. package/dist/tui/terminal-display.js.map +0 -1
  1261. package/dist/tui/terminal-hyperlinks.js +0 -70
  1262. package/dist/tui/terminal-hyperlinks.js.map +0 -1
  1263. package/dist/tui/theme.js +0 -34
  1264. package/dist/tui/theme.js.map +0 -1
  1265. package/dist/tui/triggers/analyze.js +0 -221
  1266. package/dist/tui/triggers/analyze.js.map +0 -1
  1267. package/dist/tui/triggers/context-text.js +0 -44
  1268. package/dist/tui/triggers/context-text.js.map +0 -1
  1269. package/dist/tui/triggers/copy.js +0 -163
  1270. package/dist/tui/triggers/copy.js.map +0 -1
  1271. package/dist/tui/triggers/detect.js +0 -295
  1272. package/dist/tui/triggers/detect.js.map +0 -1
  1273. package/dist/tui/triggers/fold.js +0 -44
  1274. package/dist/tui/triggers/fold.js.map +0 -1
  1275. package/dist/tui/triggers/pattern.js +0 -243
  1276. package/dist/tui/triggers/pattern.js.map +0 -1
  1277. package/dist/tui/triggers/provenance.js +0 -98
  1278. package/dist/tui/triggers/provenance.js.map +0 -1
  1279. package/dist/tui/triggers/registry.js +0 -164
  1280. package/dist/tui/triggers/registry.js.map +0 -1
  1281. package/dist/tui/triggers/setting.js +0 -61
  1282. package/dist/tui/triggers/setting.js.map +0 -1
  1283. package/dist/tui/triggers/verbs.js +0 -140
  1284. package/dist/tui/triggers/verbs.js.map +0 -1
  1285. package/dist/tui/turn-interruption.js +0 -160
  1286. package/dist/tui/turn-interruption.js.map +0 -1
  1287. package/dist/tui/turn-limits-settings.js +0 -88
  1288. package/dist/tui/turn-limits-settings.js.map +0 -1
  1289. package/dist/tui/types.js +0 -7
  1290. package/dist/tui/types.js.map +0 -1
  1291. package/dist/tui/units.js +0 -20
  1292. package/dist/tui/units.js.map +0 -1
  1293. package/dist/tui/use-selection-index.js +0 -13
  1294. package/dist/tui/use-selection-index.js.map +0 -1
  1295. package/dist/tui/web-activity.js +0 -105
  1296. package/dist/tui/web-activity.js.map +0 -1
  1297. package/dist/tui/workspace-diff.js +0 -101
  1298. package/dist/tui/workspace-diff.js.map +0 -1
  1299. package/dist/tui/workspace-review.js +0 -67
  1300. package/dist/tui/workspace-review.js.map +0 -1
  1301. package/dist/user-commands/store.js +0 -235
  1302. package/dist/user-commands/store.js.map +0 -1
  1303. package/dist/version.js +0 -23
  1304. package/dist/version.js.map +0 -1
@@ -0,0 +1,1314 @@
1
+ import { createRequire as __namzuCreateRequire } from 'node:module';
2
+ const require = __namzuCreateRequire(import.meta.url);
3
+ import {
4
+ decideHeadlessTrust
5
+ } from "./chunk-T2VUTAHB.js";
6
+ import {
7
+ ConfigLoadError,
8
+ ConfigValueError
9
+ } from "./chunk-YYQJIECC.js";
10
+ import "./chunk-KONYGNG6.js";
11
+ import {
12
+ Command
13
+ } from "./chunk-MZP6SH3M.js";
14
+ import "./chunk-NICLKFBG.js";
15
+ import {
16
+ resolveTrustedProjectContext
17
+ } from "./chunk-CHIEVVQ2.js";
18
+ import "./chunk-42ZK2AH4.js";
19
+ import "./chunk-US5ZFPAU.js";
20
+ import "./chunk-6LLJQ3KY.js";
21
+ import {
22
+ EXIT_BAD_CONFIG,
23
+ EXIT_UNTRUSTED,
24
+ EXIT_USAGE
25
+ } from "./chunk-Y7B67G22.js";
26
+ import {
27
+ createResident,
28
+ finishRunner,
29
+ lookupResident,
30
+ publicRunner,
31
+ queryRunner,
32
+ readRunner,
33
+ readRunnerInstance,
34
+ releaseRunner,
35
+ reserveRunner,
36
+ residentDirectoryFor,
37
+ runOwnedResident
38
+ } from "./chunk-U56QFYGA.js";
39
+ import {
40
+ isResidentUuid,
41
+ loadResidentVerification,
42
+ readResidentAttemptReceipt
43
+ } from "./chunk-7KWGR2YA.js";
44
+ import {
45
+ SESSION_LOG_READ_BYTES,
46
+ readSessionStart,
47
+ readTurnSettlement
48
+ } from "./chunk-D67YBUO3.js";
49
+ import {
50
+ parseExecFlags,
51
+ resolveWorkingDirectory
52
+ } from "./chunk-HZBKWL42.js";
53
+ import "./chunk-XEUQN4JC.js";
54
+ import {
55
+ isPermissionMode
56
+ } from "./chunk-YEMJX2DS.js";
57
+ import "./chunk-LXB3S4IC.js";
58
+ import {
59
+ openSessions
60
+ } from "./chunk-DIHEHK7K.js";
61
+ import "./chunk-H6B6AROX.js";
62
+ import {
63
+ ensurePrivateStateDirectory
64
+ } from "./chunk-N3ZEXVSS.js";
65
+ import "./chunk-YQEWD2EN.js";
66
+ import "./chunk-FJNDNNNQ.js";
67
+ import "./chunk-JORONMD3.js";
68
+ import "./chunk-M3IAMIBJ.js";
69
+ import "./chunk-FOFGMP7O.js";
70
+ import {
71
+ ResidentConflictError,
72
+ SessionPaths,
73
+ SqliteResidentLearningStore,
74
+ inspectResidentConsumption,
75
+ isEntityId,
76
+ runStoredResidentLearningCycle,
77
+ runStoredResidentLearningFromObservations
78
+ } from "./chunk-K5HARZ7G.js";
79
+ import {
80
+ __name
81
+ } from "./chunk-76FLAFCG.js";
82
+
83
+ // src/commands/resident.ts
84
+ import { stripVTControlCharacters as stripVTControlCharacters3 } from "node:util";
85
+
86
+ // src/integrations/resident/inspection.ts
87
+ import { join } from "node:path";
88
+ import { isDeepStrictEqual, stripVTControlCharacters } from "node:util";
89
+ function object(value) {
90
+ if (!value || typeof value !== "object" || Array.isArray(value))
91
+ throw new Error("Invalid resident receipt object.");
92
+ return value;
93
+ }
94
+ __name(object, "object");
95
+ function count(value) {
96
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0)
97
+ throw new Error("Invalid receipt count.");
98
+ return value;
99
+ }
100
+ __name(count, "count");
101
+ function text(value) {
102
+ if (typeof value !== "string") throw new Error("Invalid receipt text.");
103
+ return value;
104
+ }
105
+ __name(text, "text");
106
+ function id(value) {
107
+ if (!isResidentUuid(value)) throw new Error("Invalid receipt identity.");
108
+ return value;
109
+ }
110
+ __name(id, "id");
111
+ function turnId(value) {
112
+ if (!isEntityId(value, "turn")) throw new Error("Invalid receipt identity.");
113
+ return value;
114
+ }
115
+ __name(turnId, "turnId");
116
+ function identity(value) {
117
+ const v = object(value);
118
+ if (v.version !== 1) throw new Error("Unknown attempt receipt version.");
119
+ if (!isEntityId(v.sessionId, "session")) throw new Error("Invalid receipt identity.");
120
+ return {
121
+ version: 1,
122
+ pursuitId: id(v.pursuitId),
123
+ claimId: id(v.claimId),
124
+ sessionId: v.sessionId,
125
+ turnId: turnId(v.turnId)
126
+ };
127
+ }
128
+ __name(identity, "identity");
129
+ function parseBudget(value) {
130
+ if (value === void 0) return null;
131
+ const b = object(value);
132
+ if (typeof b.poisoned !== "boolean") throw new Error("Invalid budget state.");
133
+ return {
134
+ ownTokens: count(b.ownTokens),
135
+ treeTokens: count(b.treeTokens),
136
+ inFlightRequests: count(b.inFlightRequests),
137
+ unsettledChildren: count(b.unsettledChildren),
138
+ poisoned: b.poisoned,
139
+ unresolvedRequests: b.unresolvedRequests === void 0 ? null : count(b.unresolvedRequests)
140
+ };
141
+ }
142
+ __name(parseBudget, "parseBudget");
143
+ function parseFinish(value) {
144
+ const f = object(value);
145
+ if (f.cleanup !== "confirmed" && f.cleanup !== "unconfirmed")
146
+ throw new Error("Unknown cleanup state.");
147
+ if (f.error !== null) text(f.error);
148
+ if (f.stopReason !== null) text(f.stopReason);
149
+ const decision = f.decision === null ? null : object(f.decision);
150
+ if (decision && !["wait", "complete", "blocked"].includes(text(decision.kind)))
151
+ throw new Error("Invalid attempt outcome.");
152
+ const u = f.usage === null ? null : object(f.usage);
153
+ const cost = u ? object(u.cost) : null;
154
+ if (cost && (typeof cost.totalCost !== "number" || !Number.isFinite(cost.totalCost) || cost.totalCost < 0))
155
+ throw new Error("Invalid cost.");
156
+ return {
157
+ ...identity(f),
158
+ finishedAt: count(f.finishedAt),
159
+ cleanup: f.cleanup,
160
+ error: f.error,
161
+ decision,
162
+ budget: parseBudget(f.budget),
163
+ verificationPolicy: f.verificationPolicy,
164
+ verification: f.verification ? object(f.verification) : null,
165
+ usage: u && cost ? {
166
+ totalTokens: count(u.totalTokens),
167
+ cost: {
168
+ totalCost: cost.totalCost,
169
+ unpricedTokens: count(cost.unpricedTokens)
170
+ }
171
+ } : null
172
+ };
173
+ }
174
+ __name(parseFinish, "parseFinish");
175
+ function residentConsumptionResolver(resident) {
176
+ const read = /* @__PURE__ */ __name(async (path, signal) => {
177
+ try {
178
+ return await readResidentAttemptReceipt(resident.root, path, signal);
179
+ } catch (error) {
180
+ if (error.code === "ENOENT") return null;
181
+ throw error;
182
+ }
183
+ }, "read");
184
+ return {
185
+ maxReadBytes: 2 * 65536 + SESSION_LOG_READ_BYTES,
186
+ async resolve(admission, signal) {
187
+ id(admission.claimId);
188
+ const dir = join(resident.artifactsRoot, admission.claimId);
189
+ const rawStart = await read(join(dir, "start.json"), signal);
190
+ if (!rawStart) return null;
191
+ const start = { ...identity(rawStart), startedAt: count(object(rawStart).startedAt) };
192
+ if (start.claimId !== admission.claimId || start.pursuitId !== admission.pursuitId)
193
+ throw new Error("Attempt does not match the admitted claim.");
194
+ const logPath = new SessionPaths({ home: resident.root, slug: resident.slug }).sessionLog({
195
+ sessionId: start.sessionId
196
+ });
197
+ const opened = await readSessionStart(resident.root, logPath, signal);
198
+ if (!opened) return null;
199
+ if (opened.sessionId !== start.sessionId || opened.projectId !== resident.projectId || opened.tenantId !== void 0 && opened.tenantId !== resident.tenantId)
200
+ throw new Error("Attempt session is outside this resident project.");
201
+ const settled = await readTurnSettlement(resident.root, logPath, start.turnId, signal);
202
+ if (settled && settled.sessionId !== start.sessionId)
203
+ throw new Error("Attempt turn is outside this resident project.");
204
+ const turn = settled ? {
205
+ tokenUsage: { totalTokens: count(settled.settlement.usage.totalTokens) },
206
+ budget: parseBudget(settled.budget)
207
+ } : null;
208
+ const rawFinish = await read(join(dir, "finish.json"), signal);
209
+ const finish = rawFinish === null ? null : parseFinish(rawFinish);
210
+ if (finish && (!isDeepStrictEqual(identity(start), identity(finish)) || finish.finishedAt < start.startedAt))
211
+ throw new Error("Attempt receipts disagree.");
212
+ if (turn && finish?.usage && finish.usage.totalTokens !== turn.tokenUsage.totalTokens)
213
+ throw new Error("Finish usage disagrees with the settled turn.");
214
+ const tree = finish?.budget ?? turn?.budget ?? null;
215
+ const ownTokens = turn?.tokenUsage.totalTokens ?? finish?.usage?.totalTokens ?? null;
216
+ if (tree && ownTokens !== null && tree.ownTokens !== ownTokens)
217
+ throw new Error("Tree ledger disagrees with own usage.");
218
+ let verification = !finish || finish.verificationPolicy ? "unconfirmed" : "unconfigured";
219
+ if (finish?.verification) {
220
+ const receipt = object(finish.verification.receipt);
221
+ if (!/^[a-f0-9]{64}$/.test(text(finish.verification.answerSha256)) || !Array.isArray(receipt.observations) || receipt.observations.length < 1 || receipt.observations.length > 32)
222
+ throw new Error("Invalid verification receipt.");
223
+ const expectedScope = {
224
+ tenantId: resident.tenantId,
225
+ projectId: resident.projectId,
226
+ pursuitId: admission.pursuitId,
227
+ claimId: admission.claimId,
228
+ sessionId: start.sessionId,
229
+ turnId: start.turnId,
230
+ revision: admission.pursuitRevision
231
+ };
232
+ if (!isDeepStrictEqual(JSON.parse(text(receipt.scope)), expectedScope) || receipt.turnId !== start.turnId || finish.decision?.kind !== "complete" || finish.error !== null || finish.cleanup !== "confirmed" || receipt.observations.some((item) => {
233
+ const o = object(item);
234
+ const at = count(o.observedAt);
235
+ count(o.bytes);
236
+ text(o.source);
237
+ return !/^[a-f0-9]{64}$/.test(text(o.sha256)) || at < start.startedAt || at > finish.finishedAt;
238
+ }))
239
+ throw new Error("Verification receipt does not match this attempt.");
240
+ const policy = object(finish.verificationPolicy);
241
+ const claims = object(receipt.claims);
242
+ if (policy.version !== 1 || !Array.isArray(policy.claims) || policy.claims.length < 1 || policy.claims.length > 32 || Object.keys(claims).length !== policy.claims.length)
243
+ throw new Error("Invalid verification policy.");
244
+ const requirements = policy.claims.map(object);
245
+ const sources = new Set(requirements.map((r) => text(r.source)));
246
+ if (new Set(requirements.map((r) => text(r.id))).size !== requirements.length || requirements.some((r) => {
247
+ const key = text(r.id);
248
+ const value = claims[key];
249
+ return !Object.hasOwn(claims, key) || !(value === null || typeof value === "boolean" || typeof value === "string" && value.length <= 2e3 || typeof value === "number" && Number.isSafeInteger(value)) || Object.hasOwn(r, "expected") && !isDeepStrictEqual(value, r.expected);
250
+ }) || receipt.observations.length !== sources.size || new Set(receipt.observations.map((o) => text(object(o).source))).size !== sources.size || receipt.observations.some((o) => !sources.has(text(object(o).source))))
251
+ throw new Error("Incomplete verification evidence.");
252
+ verification = "recorded";
253
+ }
254
+ return {
255
+ sessionId: start.sessionId,
256
+ turnId: start.turnId,
257
+ ownTokens: finish?.usage?.totalTokens ?? ownTokens,
258
+ treeTokens: tree?.treeTokens ?? null,
259
+ ownCostUsd: finish?.usage?.cost.totalCost ?? null,
260
+ unpricedOwnTokens: finish?.usage?.cost.unpricedTokens ?? null,
261
+ usageFinal: !!turn && !!finish?.usage && finish.error === null && finish.cleanup === "confirmed" && !!tree && tree.inFlightRequests === 0 && tree.unsettledChildren === 0 && !tree.poisoned && tree.unresolvedRequests === 0,
262
+ cleanup: finish?.cleanup ?? "unknown",
263
+ verification
264
+ };
265
+ }
266
+ };
267
+ }
268
+ __name(residentConsumptionResolver, "residentConsumptionResolver");
269
+ var line = /* @__PURE__ */ __name((value) => stripVTControlCharacters(value).replace(/[\p{Cc}\p{Cf}]/gu, " "), "line");
270
+ function residentInspectionText(report) {
271
+ const { recorded, unknown } = report;
272
+ const deferred = report.attempts.filter((a) => a.receiptStatus === "deferred");
273
+ const missing = report.attempts.filter((a) => a.receiptStatus === "missing").length;
274
+ const invalid = report.attempts.filter(
275
+ (a) => a.receiptStatus === "invalid" || a.receiptStatus === "duplicate-turn"
276
+ ).length;
277
+ const settled = report.attempts.filter((a) => a.settlement).length;
278
+ const verified = report.attempts.filter(
279
+ (a) => a.settlement?.outcome === "complete" && a.receipt?.verification === "recorded"
280
+ ).length;
281
+ return [
282
+ `Resident ${line(report.scope.agentKey)} \xB7 ${report.historyComplete ? "lifetime history" : "partial history"}`,
283
+ `Revisions ${report.fromRevision}\u2013${report.throughRevision} of ${report.scope.throughRevision}${report.nextCursor === null ? "" : ` \xB7 next cursor ${report.nextCursor}`}`,
284
+ `${report.attempts.length} admitted \xB7 ${settled} settled \xB7 ${verified} ${verified === 1 ? "completion" : "completions"} with recorded verification \xB7 ${report.archivedPursuits.length} archived pursuits`,
285
+ `Recorded tokens: ${recorded.ownTokens} own \xB7 ${recorded.treeTokens} including descendants (separate totals)`,
286
+ `Known own cost: $${recorded.ownCostUsd.toFixed(6)}${unknown.ownPriceAttempts ? " (partial)" : ""} \xB7 ${recorded.unpricedOwnTokens} unpriced own tokens \xB7 descendant prices not included`,
287
+ `Incomplete attempts: ${unknown.ownUsageAttempts} own usage \xB7 ${unknown.treeUsageAttempts} tree usage \xB7 ${unknown.ownPriceAttempts} own price`,
288
+ ...report.unavailableRevisions.length ? [`Unavailable history revisions: ${report.unavailableRevisions.join(", ")}`] : [],
289
+ ...missing || invalid || deferred.length ? [
290
+ `Receipts: ${missing} missing \xB7 ${invalid} invalid \xB7 ${deferred.length} deferred by read allowance`
291
+ ] : [],
292
+ ...deferred[0] ? [
293
+ `Continue deferred receipts: resident inspect --cursor ${deferred[0].revision} --through-revision ${report.scope.throughRevision}`
294
+ ] : [],
295
+ "Accounting only; existing limits apply per step. Verification is historical, not a current-source check.",
296
+ "",
297
+ ...report.attempts.slice(-20).map((a) => {
298
+ const state = a.settlement?.outcome ?? (report.historyComplete ? "unsettled" : "settlement outside this view or unresolved");
299
+ return `${a.claimId} \xB7 step ${a.step} \xB7 ${state} \xB7 ${a.receipt?.ownTokens ?? "?"} own tokens${a.receipt?.usageFinal ? "" : " (partial/unknown)"}
300
+ ${line(a.objective).slice(0, 180)}`;
301
+ }),
302
+ ...report.attempts.length > 20 ? [`Showing latest 20 of ${report.attempts.length} inspected attempts; JSON includes all.`] : []
303
+ ].join("\n");
304
+ }
305
+ __name(residentInspectionText, "residentInspectionText");
306
+ async function inspectCliResident(resident, throughRevision, options, signal) {
307
+ const inspection = await inspectResidentConsumption(
308
+ resident.agenda.activity(throughRevision),
309
+ residentConsumptionResolver(resident),
310
+ options,
311
+ signal
312
+ );
313
+ return { inspection, text: residentInspectionText(inspection) };
314
+ }
315
+ __name(inspectCliResident, "inspectCliResident");
316
+
317
+ // src/integrations/resident/runner-launch.ts
318
+ import { fork } from "node:child_process";
319
+ import { createRequire } from "node:module";
320
+ import { setTimeout as sleep } from "node:timers/promises";
321
+ async function startResidentRunner(options) {
322
+ const { resident } = options;
323
+ const existing = readRunner(resident);
324
+ if (existing && (existing.phase === "reserved" || existing.phase === "running"))
325
+ throw new Error(
326
+ `Runner ${existing.instanceId} already owns this resident. Use resident status or stop; a second start cannot reset its limit.`
327
+ );
328
+ const agenda = await resident.agenda.read();
329
+ if (!agenda || agenda.paused || agenda.pursuits.some((p) => p.state.phase === "running"))
330
+ throw new Error("Starting requires open admission and no unresolved pursuit claims.");
331
+ const owner = reserveRunner(resident, {
332
+ mode: "background",
333
+ maxSteps: options.maxSteps,
334
+ pauseGeneration: agenda.pauseGeneration ?? 0
335
+ });
336
+ const source = (new URL("../", import.meta.url).href + "integrations/resident/runner-launch.js").endsWith(".ts");
337
+ const worker = new URL(`./runner-worker.${source ? "ts" : "js"}`, new URL("../", import.meta.url).href + "integrations/resident/runner-launch.js");
338
+ const launch = {
339
+ version: 1,
340
+ cwd: resident.cwd,
341
+ agentKey: resident.agentKey,
342
+ instanceId: owner.instanceId,
343
+ config: options.ctx.config,
344
+ flags: options.flags,
345
+ toolLoading: options.toolLoading,
346
+ contextProfile: options.contextProfile,
347
+ learningDisclosure: options.learningDisclosure,
348
+ verification: options.verification,
349
+ maxIdleMs: options.maxIdleMs
350
+ };
351
+ let child;
352
+ try {
353
+ child = fork(worker, [], {
354
+ cwd: resident.cwd,
355
+ env: { ...process.env, NAMZU_HOME: resident.root },
356
+ detached: true,
357
+ stdio: ["ignore", "ignore", "ignore", "ipc"],
358
+ execArgv: source ? ["--import", createRequire(new URL("../", import.meta.url).href + "integrations/resident/runner-launch.js").resolve("tsx")] : []
359
+ });
360
+ } catch (error) {
361
+ finishRunner(resident, owner, "launch_failed");
362
+ throw error;
363
+ }
364
+ return await new Promise((resolve2, reject) => {
365
+ let settled = false;
366
+ const finish = /* @__PURE__ */ __name((error) => {
367
+ if (settled) return;
368
+ settled = true;
369
+ clearTimeout(timer);
370
+ child.removeListener("message", message);
371
+ child.removeListener("exit", exited);
372
+ if (child.connected) child.disconnect();
373
+ child.unref();
374
+ if (error) reject(error);
375
+ else {
376
+ try {
377
+ const current = readRunnerInstance(resident, owner.instanceId);
378
+ if (!current) throw new Error("Runner startup receipt disappeared.");
379
+ resolve2(publicRunner(current));
380
+ } catch (readError) {
381
+ reject(readError);
382
+ }
383
+ }
384
+ }, "finish");
385
+ const message = /* @__PURE__ */ __name((raw) => {
386
+ if (!raw || typeof raw !== "object") return;
387
+ const value = raw;
388
+ if (value.instanceId !== owner.instanceId) return;
389
+ if (value.kind === "error") {
390
+ finish(
391
+ new Error(typeof value.message === "string" ? value.message : "Runner startup failed.")
392
+ );
393
+ } else if (value.kind === "ready") {
394
+ child.send(
395
+ { kind: "go", instanceId: owner.instanceId },
396
+ (error) => finish(error ?? void 0)
397
+ );
398
+ }
399
+ }, "message");
400
+ const exited = /* @__PURE__ */ __name(() => finish(
401
+ new Error(
402
+ "Resident worker exited before startup was acknowledged. Inspect resident status."
403
+ )
404
+ ), "exited");
405
+ const timer = setTimeout(
406
+ () => finish(
407
+ new Error(
408
+ "Resident startup was not acknowledged. Ownership is retained; inspect resident status before retrying."
409
+ )
410
+ ),
411
+ 15e3
412
+ );
413
+ child.on("message", message);
414
+ child.once("exit", exited);
415
+ child.on("error", (error) => {
416
+ if (!child.pid) {
417
+ try {
418
+ finishRunner(resident, owner, "launch_failed");
419
+ } catch {
420
+ }
421
+ }
422
+ finish(error);
423
+ });
424
+ child.send(launch, (error) => {
425
+ if (error) finish(error);
426
+ });
427
+ });
428
+ }
429
+ __name(startResidentRunner, "startResidentRunner");
430
+ async function residentRunnerStatus(resident) {
431
+ const record = readRunner(resident);
432
+ if (!record) return { owner: null, live: null };
433
+ return {
434
+ owner: publicRunner(record),
435
+ live: record.phase === "running" ? await queryRunner(record, "status") : null
436
+ };
437
+ }
438
+ __name(residentRunnerStatus, "residentRunnerStatus");
439
+ async function stopResidentRunner(resident, options) {
440
+ const record = options.owner;
441
+ const waitMs = options.waitMs ?? 5e3;
442
+ if (!record) return { status: "absent", owner: null };
443
+ if (record.phase === "stopped") return { status: "drained", owner: publicRunner(record) };
444
+ if (record.phase === "released")
445
+ return { status: "unconfirmed", owner: publicRunner(record) };
446
+ if (record.phase === "running") await queryRunner(record, "stop");
447
+ const deadline = Date.now() + waitMs;
448
+ while (true) {
449
+ const current = readRunnerInstance(resident, record.instanceId);
450
+ if (current?.phase === "stopped")
451
+ return { status: "drained", owner: publicRunner(current) };
452
+ if (!current || current.phase === "released" || Date.now() >= deadline)
453
+ return { status: "unconfirmed", owner: current ? publicRunner(current) : null };
454
+ await sleep(Math.min(50, Math.max(1, deadline - Date.now())));
455
+ }
456
+ }
457
+ __name(stopResidentRunner, "stopResidentRunner");
458
+
459
+ // src/commands/resident-flags.ts
460
+ var actions = [
461
+ "add",
462
+ "status",
463
+ "inspect",
464
+ "run",
465
+ "start",
466
+ "stop",
467
+ "release",
468
+ "pause",
469
+ "resume",
470
+ "wake",
471
+ "reconcile",
472
+ "archive"
473
+ ];
474
+ function integer(value, flag, zero = false) {
475
+ const parsed = Number(value);
476
+ if (!/^\d+$/.test(value) || !Number.isSafeInteger(parsed) || parsed < (zero ? 0 : 1))
477
+ throw new Error(`${flag} requires a ${zero ? "nonnegative" : "positive"} whole number.`);
478
+ return parsed;
479
+ }
480
+ __name(integer, "integer");
481
+ function parseResidentFlags(raw) {
482
+ const implicit = raw[0] === void 0 || raw[0].startsWith("-");
483
+ const action = implicit ? "status" : raw[0];
484
+ const execution = action === "run" || action === "start";
485
+ if (!actions.includes(action))
486
+ throw new Error(`Unknown resident action ${action}. Use: ${actions.join(", ")}.`);
487
+ const own = /* @__PURE__ */ new Map();
488
+ const forwarded = [];
489
+ let executorStopped = false;
490
+ for (let i = implicit ? 0 : 1; i < raw.length; i++) {
491
+ const item = raw[i];
492
+ if (item === "--") {
493
+ forwarded.push(...raw.slice(i));
494
+ break;
495
+ }
496
+ if (item === "--executor-stopped") {
497
+ if (executorStopped) throw new Error("Duplicate --executor-stopped.");
498
+ executorStopped = true;
499
+ continue;
500
+ }
501
+ const [name, ...suffix] = item.split("=");
502
+ if ([
503
+ "--cursor",
504
+ "--through-revision",
505
+ "--max-revisions",
506
+ "--agent",
507
+ "--max-steps",
508
+ "--max-idle-ms",
509
+ "--tool-loading",
510
+ "--context-profile",
511
+ "--learning-disclosure",
512
+ "--verify",
513
+ "--claim",
514
+ "--revision",
515
+ "--outcome"
516
+ ].includes(name)) {
517
+ if (own.has(name)) throw new Error(`Duplicate ${name}.`);
518
+ const value = suffix.length ? suffix.join("=") : raw[++i];
519
+ if (!value || value.startsWith("--")) throw new Error(`${name} requires a value.`);
520
+ own.set(name, value);
521
+ } else forwarded.push(item);
522
+ }
523
+ const inspectionThroughRevision = own.has("--through-revision") ? integer(own.get("--through-revision") ?? "", "--through-revision") : void 0;
524
+ const inspectionCursor = own.has("--cursor") ? integer(own.get("--cursor") ?? "", "--cursor") : void 0;
525
+ const inspectionMaxRevisions = own.has("--max-revisions") ? integer(own.get("--max-revisions") ?? "", "--max-revisions") : void 0;
526
+ if (action !== "inspect" && (inspectionCursor !== void 0 || inspectionMaxRevisions !== void 0 || inspectionThroughRevision !== void 0))
527
+ throw new Error("--cursor, --through-revision and --max-revisions apply to resident inspect.");
528
+ if (inspectionMaxRevisions !== void 0 && inspectionMaxRevisions > 4096)
529
+ throw new Error("--max-revisions must not exceed 4096.");
530
+ const run = parseExecFlags(forwarded);
531
+ if (run.unknown.length) throw new Error(`Unknown option(s): ${run.unknown.join(", ")}.`);
532
+ if (run.permissionMode && !isPermissionMode(run.permissionMode))
533
+ throw new Error("Invalid --permission-mode; use prompt, accept-edits, auto, strict or plan.");
534
+ if (run.gateRetries !== null && (!run.gates.length || !Number.isSafeInteger(run.gateRetries) || run.gateRetries < 1))
535
+ throw new Error("--gate-retries requires --gate and a whole number above zero.");
536
+ for (const [flag, value] of [
537
+ ["--max-iterations", run.maxIterations],
538
+ ["--token-budget", run.tokenBudget]
539
+ ])
540
+ if (value !== null && !Number.isSafeInteger(value))
541
+ throw new Error(`${flag} exceeds the supported integer range.`);
542
+ const agent = own.get("--agent") ?? "default";
543
+ if (!/^[a-z0-9][a-z0-9_-]{0,63}$/.test(agent))
544
+ throw new Error(
545
+ "--agent requires a lowercase name of 1\u201364 letters, digits, underscores or hyphens."
546
+ );
547
+ const rawSteps = own.get("--max-steps");
548
+ const rawIdle = own.get("--max-idle-ms");
549
+ const rawRevision = own.get("--revision");
550
+ const toolLoading = own.get("--tool-loading") ?? "eager";
551
+ const verification = own.get("--verify") ?? null;
552
+ if (!execution && verification) throw new Error("--verify applies to resident run or start.");
553
+ const learningDisclosure = own.get("--learning-disclosure") ?? "on-demand";
554
+ if (learningDisclosure !== "eager" && learningDisclosure !== "on-demand")
555
+ throw new Error("--learning-disclosure must be eager or on-demand.");
556
+ if (!execution && own.has("--learning-disclosure"))
557
+ throw new Error("--learning-disclosure applies to resident run or start.");
558
+ const contextProfile = own.get("--context-profile") ?? "resident";
559
+ if (contextProfile !== "resident" && contextProfile !== "interactive")
560
+ throw new Error("--context-profile must be resident or interactive.");
561
+ if (!execution && own.has("--context-profile"))
562
+ throw new Error("--context-profile applies to resident run or start.");
563
+ if (contextProfile === "interactive" && own.has("--learning-disclosure"))
564
+ throw new Error("--learning-disclosure requires the resident context profile.");
565
+ if (toolLoading !== "eager" && toolLoading !== "deferred")
566
+ throw new Error("--tool-loading must be eager or deferred.");
567
+ if (!execution && own.has("--tool-loading"))
568
+ throw new Error("--tool-loading applies to resident run or start.");
569
+ const maxSteps = rawSteps !== void 0 ? integer(rawSteps, "--max-steps") : null;
570
+ const maxIdleMs = rawIdle !== void 0 ? integer(rawIdle, "--max-idle-ms", true) : 6e4;
571
+ if (maxIdleMs > 2147483647) throw new Error("--max-idle-ms exceeds the supported timer range.");
572
+ const revision = rawRevision !== void 0 ? integer(rawRevision, "--revision") : null;
573
+ const claim = own.get("--claim") ?? null;
574
+ const outcome = own.get("--outcome") ?? null;
575
+ if (outcome !== null && !["wait", "complete", "blocked"].includes(outcome))
576
+ throw new Error("--outcome must be wait, complete or blocked.");
577
+ if (run.session || run.resume || run.continueLast || run.waitForProviderMs !== null)
578
+ throw new Error("Resident work cannot use conversation resume or provider-retry flags.");
579
+ if (run.json || run.outputSchema !== null)
580
+ throw new Error(
581
+ "--json and --output-schema are exec options; resident work does not take them."
582
+ );
583
+ if (!execution && (maxSteps !== null || own.has("--max-idle-ms")))
584
+ throw new Error("--max-steps and --max-idle-ms apply to resident run or start.");
585
+ if (action === "start" && maxIdleMs === 0)
586
+ throw new Error("resident start requires --max-idle-ms above zero.");
587
+ if (!execution && (run.provider || run.model || run.effort || run.permissionMode || run.skipPermissions || run.skills.length || run.gates.length || run.gateRetries !== null || run.maxIterations !== null || run.tokenBudget !== null))
588
+ throw new Error(
589
+ "Provider, tool and budget options apply to resident run or start; add does not save execution permissions."
590
+ );
591
+ if (action !== "reconcile" && (claim || revision !== null || outcome || executorStopped && action !== "release"))
592
+ throw new Error("Claim, revision, outcome and executor confirmation apply to reconcile.");
593
+ if (execution && maxSteps === null)
594
+ throw new Error(`resident ${action} requires --max-steps <n>.`);
595
+ if (["status", "inspect", "run", "start", "stop", "pause", "resume"].includes(action) && run.rest.length)
596
+ throw new Error(`resident ${action} does not take a prompt or pursuit ID.`);
597
+ if (action === "add" && !run.rest.join(" ").trim())
598
+ throw new Error("resident add requires an objective.");
599
+ if (action === "wake" && run.rest.length < 2)
600
+ throw new Error("resident wake requires a pursuit ID and new evidence.");
601
+ if (action === "archive" && run.rest.length !== 1)
602
+ throw new Error("resident archive requires one pursuit ID.");
603
+ if (action === "release" && (run.rest.length !== 1 || !executorStopped))
604
+ throw new Error(
605
+ "resident release requires <runner-id> and --executor-stopped. Stop all prior executors and inspect effects first; pause the resident before release."
606
+ );
607
+ if (action === "reconcile" && (run.rest.length < 2 || !claim || revision === null || !outcome || !executorStopped))
608
+ throw new Error(
609
+ "reconcile requires <pursuit-id> <inspection-summary>, --claim, --revision, --outcome and --executor-stopped. Stop all prior executors and inspect effects first."
610
+ );
611
+ return {
612
+ action,
613
+ inspectionCursor,
614
+ inspectionThroughRevision,
615
+ inspectionMaxRevisions,
616
+ agent,
617
+ maxSteps,
618
+ maxIdleMs,
619
+ toolLoading,
620
+ contextProfile,
621
+ learningDisclosure,
622
+ verification,
623
+ claim,
624
+ revision,
625
+ outcome,
626
+ executorStopped,
627
+ run
628
+ };
629
+ }
630
+ __name(parseResidentFlags, "parseResidentFlags");
631
+
632
+ // src/commands/resident-learning.ts
633
+ import { lstatSync as lstatSync2 } from "node:fs";
634
+ import { resolve } from "node:path";
635
+ import { pathToFileURL } from "node:url";
636
+ import { stripVTControlCharacters as stripVTControlCharacters2 } from "node:util";
637
+
638
+ // src/integrations/resident/learning-storage.ts
639
+ import { existsSync, lstatSync } from "node:fs";
640
+ import { join as join2 } from "node:path";
641
+ function residentLearningStore(resident, readOnly = false) {
642
+ const agentRoot = residentDirectoryFor(resident.root, resident.slug, resident.agentKey);
643
+ const databasePath = join2(agentRoot, "learning.sqlite");
644
+ const artifactsPath = join2(agentRoot, "artifacts");
645
+ if (readOnly) {
646
+ for (const directory of [agentRoot, artifactsPath]) {
647
+ if (!existsSync(directory)) continue;
648
+ const entry = lstatSync(directory);
649
+ if (!entry.isDirectory() || entry.isSymbolicLink())
650
+ throw new Error(`Learning state requires a real directory: ${directory}`);
651
+ }
652
+ if (!existsSync(databasePath)) return null;
653
+ } else {
654
+ ensurePrivateStateDirectory(agentRoot, "artifacts");
655
+ }
656
+ for (const file of [
657
+ databasePath,
658
+ `${databasePath}-journal`,
659
+ `${databasePath}-wal`,
660
+ `${databasePath}-shm`
661
+ ]) {
662
+ let entry;
663
+ try {
664
+ entry = lstatSync(file);
665
+ } catch (error) {
666
+ if (error.code === "ENOENT") continue;
667
+ throw error;
668
+ }
669
+ if (!entry.isFile() || entry.isSymbolicLink() || entry.nlink !== 1)
670
+ throw new Error(`Learning database requires a private regular file: ${file}`);
671
+ }
672
+ return new SqliteResidentLearningStore({
673
+ databasePath,
674
+ artifactsPath,
675
+ scope: resident,
676
+ readOnly
677
+ });
678
+ }
679
+ __name(residentLearningStore, "residentLearningStore");
680
+
681
+ // src/commands/resident-learning.ts
682
+ var line2 = /* @__PURE__ */ __name((value) => stripVTControlCharacters2(value).replace(/[\p{Cc}\p{Cf}]/gu, " "), "line");
683
+ var preview = /* @__PURE__ */ __name((value) => {
684
+ const chars = Array.from(line2(value));
685
+ return chars.length > 240 ? `${chars.slice(0, 240).join("")}\u2026 (full text: --format json)` : chars.join("");
686
+ }, "preview");
687
+ var integer2 = /* @__PURE__ */ __name((value) => {
688
+ if (!/^\d+$/.test(value) || !Number.isSafeInteger(Number(value)))
689
+ throw new Error("Expected a nonnegative safe integer.");
690
+ return Number(value);
691
+ }, "integer");
692
+ function learningSummary(row) {
693
+ const usage = row.result?.consumption ?? {
694
+ ...row.recordedUsage,
695
+ unfinishedStages: 1
696
+ };
697
+ const review = row.result?.review;
698
+ const comparisons = [
699
+ ["Verification", review?.verification],
700
+ ["Confirmation", review?.confirmation]
701
+ ].flatMap(([label, round]) => {
702
+ if (!round?.tasks.length) return [];
703
+ const total = round.tasks.reduce((n, t) => n + t.trials, 0);
704
+ const baseline = round.tasks.reduce((n, t) => n + t.baselinePasses, 0);
705
+ const candidate = round.tasks.reduce((n, t) => n + t.candidatePasses, 0);
706
+ const protection = review?.protection?.[label === "Verification" ? "verification" : "confirmation"];
707
+ return [
708
+ ` ${label}: baseline ${baseline}/${total} \u2192 candidate ${candidate}/${total}`,
709
+ ...protection ? [
710
+ ` Protected tasks: ${protection.status}${protection.missingTasks.length ? ` \xB7 ${protection.missingTasks.length} missing` : ""}${protection.unprovenTasks.length ? ` \xB7 ${protection.unprovenTasks.length} unproven` : ""}${protection.regressedTasks.length ? ` \xB7 ${protection.regressedTasks.length} regressed` : ""}`
711
+ ] : []
712
+ ];
713
+ });
714
+ return [
715
+ `${row.cycleId} \xB7 ${row.status} \xB7 ${line2(row.skillName ?? "preflight")}`,
716
+ ` ${usage.tokens} recorded tokens${usage.unknownTokens || usage.unfinishedStages ? " \xB7 incomplete" : ""} \xB7 ${usage.unknownCosts || usage.unfinishedStages ? "price incomplete or unknown" : `$${usage.costUsd.toFixed(4)}`}`,
717
+ ...!row.result ? [" No final receipt; recorded state does not establish a live executor."] : [],
718
+ ...row.result ? [` ${line2(row.result.reason)}`] : [],
719
+ ...comparisons
720
+ ].join("\n");
721
+ }
722
+ __name(learningSummary, "learningSummary");
723
+ async function residentLearningCommand({
724
+ ctx,
725
+ rawArgs
726
+ }) {
727
+ const execute = rawArgs[0] === "learn";
728
+ const parser = new Command().exitOverride().configureOutput({ writeOut: /* @__PURE__ */ __name(() => {
729
+ }, "writeOut"), writeErr: /* @__PURE__ */ __name(() => {
730
+ }, "writeErr") }).allowExcessArguments(false).argument(execute ? "<experiment.learning.js>" : "[cycle-id]").option("--cwd <path>").option("--agent <name>", "Resident name", "default");
731
+ if (execute) parser.option("--trust");
732
+ else
733
+ parser.option("--events").option("--observations", "Inspect host-scored learning observations").option("--after <sequence>", "", integer2).option("--before <ordinal>", "", integer2).option("--limit <count>", "", integer2);
734
+ try {
735
+ parser.parse(rawArgs.slice(1), { from: "user" });
736
+ } catch (error) {
737
+ ctx.formatter.error({ message: String(error) });
738
+ return EXIT_USAGE;
739
+ }
740
+ const flags = parser.opts();
741
+ const target = resolveWorkingDirectory(flags.cwd ?? null);
742
+ if ("error" in target) {
743
+ ctx.formatter.error({ message: target.error });
744
+ return EXIT_USAGE;
745
+ }
746
+ const controller = new AbortController();
747
+ const interrupt = /* @__PURE__ */ __name(() => controller.abort(new Error("Learning experiment interrupted by the operator.")), "interrupt");
748
+ try {
749
+ const resident = await lookupResident(target.cwd, flags.agent);
750
+ if (!resident) {
751
+ ctx.formatter.print({
752
+ text: "No resident exists here. Use namzu resident add <objective> first.",
753
+ cycles: []
754
+ });
755
+ return execute ? EXIT_USAGE : 0;
756
+ }
757
+ if (!execute) {
758
+ const id2 = parser.args[0];
759
+ if (flags.observations) {
760
+ if (id2 || flags.events || flags.before !== void 0)
761
+ throw new Error(
762
+ "--observations uses --after and --limit, without a cycle ID, --events or --before."
763
+ );
764
+ const store3 = residentLearningStore(resident, true);
765
+ const observations = store3 ? await store3.observations({ after: flags.after, limit: flags.limit }) : [];
766
+ ctx.formatter.print({
767
+ text: observations.length ? observations.map(
768
+ (o) => [
769
+ `${o.ordinal} \xB7 ${line2(o.skillName)} \xB7 ${o.outcome}${o.usageComplete ? "" : " \xB7 usage unresolved"}`,
770
+ ` ${line2(o.taskKey)} \xB7 ${line2(o.evaluatorRevision)}`,
771
+ ` ${preview(o.evidence.reason)}`,
772
+ ` ${o.attemptedCycleId ? `Experiment: ${o.attemptedCycleId}` : "No experiment claimed"}`
773
+ ].join("\n")
774
+ ).join("\n\n") : "No learning observations recorded.",
775
+ observations,
776
+ nextAfter: observations.at(-1)?.ordinal ?? flags.after ?? 0
777
+ });
778
+ return 0;
779
+ }
780
+ if ((flags.events || flags.after !== void 0) && !id2)
781
+ throw new Error("--events and --after require a cycle ID.");
782
+ if (flags.after !== void 0 && !flags.events) throw new Error("--after requires --events.");
783
+ if (id2 && flags.before !== void 0) throw new Error("--before applies to the cycle list.");
784
+ const store2 = residentLearningStore(resident, true);
785
+ if (!store2) {
786
+ ctx.formatter.print({
787
+ text: "No learning experiments recorded.",
788
+ cycles: []
789
+ });
790
+ return 0;
791
+ }
792
+ if (id2) {
793
+ const cycle = await store2.get(id2);
794
+ if (!cycle) throw new Error("Learning cycle is not retained here.");
795
+ const artifacts = await store2.artifacts(id2);
796
+ const events = flags.events ? await store2.events(id2, { after: flags.after, limit: flags.limit }) : void 0;
797
+ ctx.formatter.print({
798
+ text: [
799
+ learningSummary(cycle),
800
+ ...artifacts.map((a) => ` ${line2(a.name)} \xB7 ${a.bytes} bytes \xB7 ${a.hash}`),
801
+ ...events?.map(
802
+ (e) => ` ${e.sequence} \xB7 ${e.kind}${e.stage ? ` \xB7 ${e.stage}` : ""}`
803
+ ) ?? []
804
+ ].join("\n"),
805
+ cycle,
806
+ artifacts,
807
+ ...events ? { events, nextAfter: events.at(-1)?.sequence ?? flags.after ?? 0 } : {}
808
+ });
809
+ } else {
810
+ const cycles = await store2.list({
811
+ before: flags.before,
812
+ limit: flags.limit
813
+ });
814
+ ctx.formatter.print({
815
+ text: cycles.length ? cycles.map(learningSummary).join("\n\n") : "No learning experiments recorded.",
816
+ cycles,
817
+ nextBefore: cycles.at(-1)?.ordinal ?? null
818
+ });
819
+ }
820
+ return 0;
821
+ }
822
+ const trust = decideHeadlessTrust({
823
+ cwd: resident.cwd,
824
+ trustFlag: flags.trust === true
825
+ });
826
+ if (!trust.allowed) {
827
+ ctx.formatter.error({
828
+ message: trust.message ?? "Resident directory is not trusted."
829
+ });
830
+ return EXIT_UNTRUSTED;
831
+ }
832
+ if (trust.cwd !== resident.cwd)
833
+ throw new Error("Resident execution directory changed its canonical path.");
834
+ const agenda = await resident.agenda.read();
835
+ if (!agenda || agenda.paused || agenda.pursuits.some((p) => p.state.phase === "running"))
836
+ throw new Error("Learning requires an unpaused resident with no running pursuits.");
837
+ const file = resolve(target.cwd, parser.args[0]);
838
+ if (!file.endsWith(".learning.js") && !file.endsWith(".learning.mjs"))
839
+ throw new Error("Choose an explicit .learning.js or .learning.mjs host module.");
840
+ const entry = lstatSync2(file);
841
+ if (!entry.isFile() || entry.isSymbolicLink())
842
+ throw new Error("Learning experiment must be a regular host module, without a symbolic link.");
843
+ process.on("SIGINT", interrupt);
844
+ process.on("SIGTERM", interrupt);
845
+ controller.signal.throwIfAborted();
846
+ ctx.formatter.info(`Learning experiment: ${line2(file)}`);
847
+ const module = await import(pathToFileURL(file).href);
848
+ if (typeof module.default !== "function")
849
+ throw new Error("Learning module must default-export a host factory.");
850
+ const store = residentLearningStore(resident);
851
+ if (!store) throw new Error("Learning storage is unavailable.");
852
+ const options = await module.default({
853
+ cwd: resident.cwd,
854
+ tenantId: resident.tenantId,
855
+ projectId: resident.projectId,
856
+ agentKey: resident.agentKey,
857
+ signal: controller.signal,
858
+ store
859
+ });
860
+ controller.signal.throwIfAborted();
861
+ const explore = options.explore;
862
+ const execution = {
863
+ ...options,
864
+ agenda: resident.agenda,
865
+ signal: controller.signal,
866
+ ...explore ? {
867
+ explore: /* @__PURE__ */ __name(async (context) => {
868
+ ctx.formatter.info(`Learning \xB7 ${line2(context.skillName)} \xB7 exploring environment`);
869
+ return explore(context);
870
+ }, "explore")
871
+ } : {},
872
+ generate: /* @__PURE__ */ __name(async (context) => {
873
+ ctx.formatter.info(`Learning \xB7 ${line2(context.skillName)} \xB7 generating guidance`);
874
+ return options.generate(context);
875
+ }, "generate"),
876
+ evaluate: /* @__PURE__ */ __name(async (context) => {
877
+ ctx.formatter.info(`Learning \xB7 ${context.stage}`);
878
+ return options.evaluate(context);
879
+ }, "evaluate")
880
+ };
881
+ const discovery = "evaluators" in execution ? await runStoredResidentLearningFromObservations(store, execution) : null;
882
+ const result = "evaluators" in execution ? discovery?.cycle : await runStoredResidentLearningCycle(store, execution);
883
+ if (!result) {
884
+ ctx.formatter.print({
885
+ text: "No eligible unattempted learning observation for the current skills and evaluators.",
886
+ result: null
887
+ });
888
+ return 0;
889
+ }
890
+ let saved = null;
891
+ try {
892
+ saved = await store.get(result.cycleId);
893
+ } catch (error) {
894
+ ctx.formatter.error({
895
+ message: `Result received; journal inspection failed: ${String(error)}`
896
+ });
897
+ }
898
+ ctx.formatter.print({
899
+ text: [
900
+ saved ? learningSummary({ ...saved, status: result.status, result }) : `${result.cycleId} \xB7 ${result.status}: ${line2(result.reason)}`,
901
+ ...!result.auditComplete ? [
902
+ "The journal is incomplete. Inspect the exact skill evidence before retrying; do not replay the experiment automatically."
903
+ ] : []
904
+ ].join("\n"),
905
+ result,
906
+ journal: saved,
907
+ databasePath: store.databasePath
908
+ });
909
+ return result.status === "activated" && result.auditComplete ? 0 : result.status === "cancelled" ? 130 : ["rejected", "inconclusive"].includes(result.status) ? 2 : 1;
910
+ } catch (error) {
911
+ ctx.formatter.error({
912
+ message: error instanceof Error ? error.message : String(error)
913
+ });
914
+ return controller.signal.aborted ? 130 : 1;
915
+ } finally {
916
+ process.off("SIGINT", interrupt);
917
+ process.off("SIGTERM", interrupt);
918
+ }
919
+ }
920
+ __name(residentLearningCommand, "residentLearningCommand");
921
+
922
+ // src/commands/resident.ts
923
+ var line3 = /* @__PURE__ */ __name((value) => stripVTControlCharacters3(value).replace(/[\p{Cc}\p{Cf}]/gu, " "), "line");
924
+ function residentStatus(resident, state, message, runner) {
925
+ const unresolved = state.pursuits.filter((p) => p.state.phase === "running");
926
+ const live = runner?.live?.kind === "responsive" ? runner.live : null;
927
+ const responsive = live !== null;
928
+ const text2 = [
929
+ `Resident \xB7 ${resident.agentKey}`,
930
+ `Directory: ${line3(resident.cwd)}`,
931
+ `Admission: ${state.paused ? "paused" : "open"}${unresolved.length ? responsive ? " \xB7 a pursuit is admitted" : " \xB7 retained work needs inspection" : ""}`,
932
+ ...runner?.owner ? [
933
+ `Runner: ${live ? live.phase : runner.owner.phase === "running" ? "unresponsive; state retained" : runner.owner.phase} \xB7 ${runner.owner.mode}`,
934
+ ` ${runner.owner.instanceId} \xB7 ${runner.owner.maxSteps} step(s) authorized${runner.owner.pid ? ` \xB7 PID ${runner.owner.pid}` : ""}`,
935
+ ...live ? [` ${live.stepsStarted} step(s) started in this invocation`] : [],
936
+ ...runner.owner.outcome ? [` Last outcome: ${line3(runner.owner.outcome)}`] : []
937
+ ] : [],
938
+ ...message ? ["", message] : [],
939
+ "",
940
+ ...state.pursuits.flatMap((p) => [
941
+ `${p.state.phase} \xB7 ${line3(p.state.objective)}`,
942
+ ` ${p.id} \xB7 ${p.state.stepsAdmitted} step(s) admitted`,
943
+ ...p.state.summary ? [` ${line3(p.state.summary)}`] : [],
944
+ ...p.state.wakeEvidence ? [` Pending evidence: ${p.state.wakeEvidence.length} input(s) retained until settlement.`] : [],
945
+ ...p.state.phase === "waiting" ? [
946
+ ` ${p.state.wakeAt === null ? "Waiting for evidence; use resident wake." : p.state.wakeAt <= Date.now() ? responsive ? "Ready for the active runner." : "Ready for the next authorized run." : `Next step: ${new Date(p.state.wakeAt).toISOString()}`}`
947
+ ] : [],
948
+ ...p.state.claimId ? [
949
+ ` Claim: ${p.state.claimId} \xB7 revision ${p.state.revision}`,
950
+ ` Inspect attempt records: ${line3(resident.artifactsRoot)}/${p.state.claimId}`
951
+ ] : []
952
+ ]),
953
+ ...state.pursuits.length ? [] : ["No active pursuits."],
954
+ ...unresolved.length && !responsive ? [
955
+ "",
956
+ "A retained claim does not establish whether its executor is still alive.",
957
+ "Stop prior executors and inspect effects before resident reconcile."
958
+ ] : []
959
+ ].join("\n");
960
+ return {
961
+ text: text2,
962
+ agent: resident.agentKey,
963
+ cwd: resident.cwd,
964
+ agenda: state,
965
+ ...runner ? { runner } : {},
966
+ ...message ? { message } : {}
967
+ };
968
+ }
969
+ __name(residentStatus, "residentStatus");
970
+ function pursuit(state, id2) {
971
+ const found = state.pursuits.find((p) => p.id === id2);
972
+ if (!found) throw new Error(`Unknown active pursuit: ${id2}`);
973
+ return found;
974
+ }
975
+ __name(pursuit, "pursuit");
976
+ async function readAgenda(resident) {
977
+ const state = await resident.agenda.read();
978
+ if (!state) throw new Error("Resident agenda is missing; no saved result can be reported.");
979
+ return state;
980
+ }
981
+ __name(readAgenda, "readAgenda");
982
+ async function closeAdmission(resident, initial) {
983
+ let state = initial;
984
+ for (let attempt = 0; ; attempt++) {
985
+ try {
986
+ await resident.agenda.setPaused(state, true);
987
+ return;
988
+ } catch (error) {
989
+ if (!(error instanceof ResidentConflictError) || attempt >= 7) throw error;
990
+ state = await readAgenda(resident);
991
+ }
992
+ }
993
+ }
994
+ __name(closeAdmission, "closeAdmission");
995
+ var residentCommand = {
996
+ name: "resident",
997
+ description: "Manage persistent work and explicitly authorized resident runners (experimental)",
998
+ passThrough: true,
999
+ help: [
1000
+ "Usage: namzu resident <action> [options]",
1001
+ "",
1002
+ " add <objective> Save work without starting a model",
1003
+ " inspect Inspect lifetime usage and evidence (--cursor, --through-revision, --max-revisions)",
1004
+ " learn <file.learning.js> Run one explicitly selected executable learning experiment (--trust, --cwd, --agent)",
1005
+ " learning [cycle-id] Inspect experiments or --observations (--events, --after, --before, --limit)",
1006
+ " status Show saved work and unresolved claims (default action)",
1007
+ " run --max-steps <n> Continue due work in this foreground process",
1008
+ " run/start --verify <file> Require configured JSON claims before completion (host file reads)",
1009
+ " start --max-steps <n> Start a managed background runner; retain its limit while idle",
1010
+ " stop Close admission and wait briefly for runner drainage",
1011
+ " release <runner-id> Release inspected stale ownership; requires --executor-stopped",
1012
+ " pause Close admission and request interruption of active runners",
1013
+ " resume Reopen admission; does not start work or clear claims",
1014
+ " wake <id> <evidence> Make a waiting pursuit due using new evidence",
1015
+ " archive <id> Retire a terminal pursuit, preserving its history",
1016
+ " reconcile <id> <summary> Record inspected effects for an exact interrupted claim",
1017
+ "",
1018
+ "Common: --cwd <path>, --agent <name> (default: default).",
1019
+ "The first add binds the execution directory; later launches keep that directory.",
1020
+ "Add, run and start require folder trust, or --trust for this invocation.",
1021
+ "",
1022
+ "Run options: --provider <id>, --model <id>, --effort <level>,",
1023
+ " --permission-mode <mode> (default: plan, read-only), --skills <a,b>,",
1024
+ " --max-iterations <n>, --token-budget <n> (limits apply per SDK step),",
1025
+ " --tool-loading eager|deferred (default: eager; defer optional schemas per step),",
1026
+ " --learning-disclosure on-demand|eager (default: on-demand; evaluated skills),",
1027
+ " --context-profile resident|interactive (default: resident; bounded-step guidance),",
1028
+ " --gate <command>, --gate-retries <n>, --max-idle-ms <n> (default: 60000).",
1029
+ "Run and start require a finite --max-steps. No OS service is installed.",
1030
+ "Start survives the launching terminal; it stops at that limit, pause, failure or stop.",
1031
+ "For start, --max-idle-ms is a positive local idle check interval; idle does not exit.",
1032
+ "Status contacts the exact runner locally; no recorded PID is blindly signalled.",
1033
+ "Idle waits use local storage checks and spend no model calls.",
1034
+ "",
1035
+ "Reconcile also requires --claim <uuid> --revision <n> --outcome wait|complete|blocked",
1036
+ " --executor-stopped. This confirms all old executors stopped and effects were",
1037
+ " inspected; put the evidence in <summary>. Pause the resident first.",
1038
+ " A wait outcome rests indefinitely; use wake to supply new evidence.",
1039
+ "Release requires prior pause and confirmation all previous executors stopped.",
1040
+ "An unreachable runner is not proof it stopped. Release never reconciles a pursuit.",
1041
+ "",
1042
+ "Pause acknowledges durable admission closure, not completed tool cancellation.",
1043
+ "Interrupted, failed or unfinished steps keep their claim and are never replayed automatically.",
1044
+ "Continuation uses the saved summary and approved learning, not a restored chat transcript.",
1045
+ "Exit: 0 for an operation/clean bounded run, 1 for unresolved or failed work,",
1046
+ " 64 for invalid arguments, 77 for untrusted execution, 78 for invalid run config,",
1047
+ " 130 for cancellation. A clean run does not mean every pursuit is complete."
1048
+ ].join("\n"),
1049
+ handler: /* @__PURE__ */ __name(async ({ ctx: bootstrap, rawArgs }) => {
1050
+ if (rawArgs[0] === "learn" || rawArgs[0] === "learning")
1051
+ return residentLearningCommand({ ctx: bootstrap, rawArgs });
1052
+ let flags;
1053
+ try {
1054
+ flags = parseResidentFlags(rawArgs);
1055
+ } catch (error) {
1056
+ bootstrap.formatter.error({
1057
+ message: String(error instanceof Error ? error.message : error)
1058
+ });
1059
+ return EXIT_USAGE;
1060
+ }
1061
+ const resolved = resolveWorkingDirectory(flags.run.cwd);
1062
+ if ("error" in resolved) {
1063
+ bootstrap.formatter.error({ message: resolved.error });
1064
+ return EXIT_USAGE;
1065
+ }
1066
+ let resident = null;
1067
+ try {
1068
+ resident = await lookupResident(resolved.cwd, flags.agent);
1069
+ if (["status", "inspect"].includes(flags.action) && !resident) {
1070
+ bootstrap.formatter.print({
1071
+ text: `No resident named ${flags.agent} in this project. Use namzu resident add <objective>.`,
1072
+ agent: flags.agent,
1073
+ agenda: null
1074
+ });
1075
+ return 0;
1076
+ }
1077
+ if (flags.action === "add" || flags.action === "run" || flags.action === "start") {
1078
+ const target = resolveWorkingDirectory(resident?.cwd ?? resolved.cwd);
1079
+ if ("error" in target) throw new Error(target.error);
1080
+ const trust = decideHeadlessTrust({
1081
+ cwd: target.cwd,
1082
+ trustFlag: flags.run.trust
1083
+ });
1084
+ if (!trust.allowed) {
1085
+ bootstrap.formatter.error({
1086
+ message: trust.message ?? "Resident directory is not trusted."
1087
+ });
1088
+ return EXIT_UNTRUSTED;
1089
+ }
1090
+ if (resident && trust.cwd !== resident.cwd)
1091
+ throw new Error(
1092
+ "Resident execution directory no longer resolves to its saved canonical path. Restore the original directory before running this resident."
1093
+ );
1094
+ if (flags.action === "add") resident = await createResident(trust.cwd, flags.agent);
1095
+ }
1096
+ if (!resident) throw new Error(`No resident named ${flags.agent}. Add a pursuit first.`);
1097
+ let state = await resident.agenda.read();
1098
+ if (!state)
1099
+ throw new Error(
1100
+ "Resident binding exists but its agenda is missing; repeat add to initialize it."
1101
+ );
1102
+ let message;
1103
+ switch (flags.action) {
1104
+ case "add": {
1105
+ const added = await resident.agenda.add(state, flags.run.rest.join(" "));
1106
+ message = `Saved ${added.id}.`;
1107
+ break;
1108
+ }
1109
+ case "status":
1110
+ break;
1111
+ case "inspect": {
1112
+ const throughRevision = flags.inspectionThroughRevision ?? state.revision;
1113
+ if (throughRevision > state.revision)
1114
+ throw new Error("Inspection boundary is ahead of saved history.");
1115
+ bootstrap.formatter.print(
1116
+ await inspectCliResident(resident, throughRevision, {
1117
+ cursor: flags.inspectionCursor,
1118
+ maxRevisions: flags.inspectionMaxRevisions
1119
+ })
1120
+ );
1121
+ return 0;
1122
+ }
1123
+ case "stop": {
1124
+ const owner = readRunner(resident);
1125
+ await closeAdmission(resident, state);
1126
+ const stopped = await stopResidentRunner(resident, { owner });
1127
+ state = await readAgenda(resident);
1128
+ const text2 = stopped.status === "drained" ? "The observed runner drained. Inspect current admission and any retained pursuit claim below." : stopped.status === "absent" ? "Admission closed. No managed runner is recorded; other executors are not certified stopped." : "Interruption requested; runner drainage is not confirmed. Inspect status before recovery.";
1129
+ bootstrap.formatter.print({
1130
+ ...residentStatus(resident, state, text2, await residentRunnerStatus(resident)),
1131
+ stop: stopped
1132
+ });
1133
+ return stopped.status === "unconfirmed" ? 1 : 0;
1134
+ }
1135
+ case "release": {
1136
+ if (!state.paused)
1137
+ throw new Error("Pause the resident before releasing inspected runner ownership.");
1138
+ const owner = readRunner(resident);
1139
+ if (!owner || owner.instanceId !== flags.run.rest[0])
1140
+ throw new Error("Runner ID does not match current ownership. Inspect status again.");
1141
+ if (owner.phase === "running" && (await queryRunner(owner, "status")).kind === "responsive")
1142
+ throw new Error(
1143
+ "This runner still responds. Use resident stop and wait for drainage before recovery."
1144
+ );
1145
+ releaseRunner(resident, owner);
1146
+ message = "Inspected runner ownership released. Pursuit claims and admission are unchanged; reconcile interrupted work separately.";
1147
+ break;
1148
+ }
1149
+ case "pause":
1150
+ await closeAdmission(resident, state);
1151
+ message = "Admission closed; interruption requested. Active tools may still be stopping.";
1152
+ break;
1153
+ case "resume":
1154
+ if (state.pursuits.some((p) => p.state.phase === "running"))
1155
+ throw new Error("Inspect and reconcile unresolved claims before reopening admission.");
1156
+ await resident.agenda.setPaused(state, false);
1157
+ message = "Admission reopened. No work started; invoke resident run or start explicitly.";
1158
+ break;
1159
+ case "wake": {
1160
+ const selected = pursuit(state, flags.run.rest[0]);
1161
+ await resident.agenda.wake(
1162
+ selected.id,
1163
+ selected.state,
1164
+ flags.run.rest.slice(1).join(" "),
1165
+ Date.now()
1166
+ );
1167
+ message = "New evidence saved; pursuit is due on the next authorized run.";
1168
+ break;
1169
+ }
1170
+ case "archive":
1171
+ await resident.agenda.archive(state, {
1172
+ pursuitIds: [pursuit(state, flags.run.rest[0]).id]
1173
+ });
1174
+ message = "Terminal pursuit archived; immutable history retained.";
1175
+ break;
1176
+ case "reconcile": {
1177
+ if (!state.paused)
1178
+ throw new Error("Pause the resident before reconciling inspected effects.");
1179
+ const selected = pursuit(state, flags.run.rest[0]);
1180
+ if (selected.state.phase !== "running" || selected.state.claimId !== flags.claim || selected.state.revision !== flags.revision)
1181
+ throw new Error(
1182
+ "Claim or revision does not match the current unresolved pursuit; inspect status again."
1183
+ );
1184
+ const summary = flags.run.rest.slice(1).join(" ");
1185
+ const decision = flags.outcome === "wait" ? { kind: "wait", summary, wakeAt: null } : { kind: flags.outcome, summary };
1186
+ await resident.agenda.execution(selected.id).settle(selected.state, decision, Date.now());
1187
+ message = "Inspection recorded against the exact claim. Resident remains paused.";
1188
+ break;
1189
+ }
1190
+ case "run":
1191
+ case "start": {
1192
+ if (flags.maxSteps === null) throw new Error("Resident execution requires --max-steps.");
1193
+ const ctx = resolveTrustedProjectContext(bootstrap, resident.cwd);
1194
+ const sessions = await openSessions(resident.cwd);
1195
+ if (sessions.projectId !== resident.projectId || sessions.tenantId !== resident.tenantId)
1196
+ throw new Error(
1197
+ "Resident execution directory no longer belongs to its bound project and tenant."
1198
+ );
1199
+ const { createResidentSessionStep } = await import("./session-step-2VZM3CCA.js");
1200
+ const verification = flags.verification ? await loadResidentVerification(flags.verification, resident.cwd) : void 0;
1201
+ const step = createResidentSessionStep({
1202
+ agenda: resident.agenda,
1203
+ ctx,
1204
+ cwd: resident.cwd,
1205
+ sessions,
1206
+ flags: flags.run,
1207
+ toolLoading: flags.toolLoading,
1208
+ contextProfile: flags.contextProfile,
1209
+ learningDisclosure: flags.learningDisclosure,
1210
+ verification,
1211
+ artifactsRoot: resident.artifactsRoot,
1212
+ projectSlug: resident.slug
1213
+ });
1214
+ if (flags.action === "start") {
1215
+ const owner = await startResidentRunner({
1216
+ resident,
1217
+ ctx,
1218
+ flags: flags.run,
1219
+ toolLoading: flags.toolLoading,
1220
+ contextProfile: flags.contextProfile,
1221
+ learningDisclosure: flags.learningDisclosure,
1222
+ verification,
1223
+ maxSteps: flags.maxSteps,
1224
+ maxIdleMs: flags.maxIdleMs
1225
+ });
1226
+ state = await readAgenda(resident);
1227
+ ctx.formatter.print({
1228
+ ...residentStatus(
1229
+ resident,
1230
+ state,
1231
+ "Background runner started. Use resident status to inspect it and resident stop to drain it.",
1232
+ await residentRunnerStatus(resident)
1233
+ ),
1234
+ started: owner
1235
+ });
1236
+ return 0;
1237
+ }
1238
+ const existing = readRunner(resident);
1239
+ if (existing && ["reserved", "running"].includes(existing.phase))
1240
+ throw new Error(
1241
+ "A resident runner already owns this agenda. Inspect status and stop it before another turn."
1242
+ );
1243
+ const controller = new AbortController();
1244
+ const interrupt = /* @__PURE__ */ __name(() => controller.abort(new Error("Resident foreground invocation interrupted.")), "interrupt");
1245
+ process.once("SIGINT", interrupt);
1246
+ process.once("SIGTERM", interrupt);
1247
+ try {
1248
+ const result = state.paused || state.pursuits.some((p) => p.state.phase === "running") ? {
1249
+ status: state.paused ? "paused" : "unresolved",
1250
+ stepsSettled: 0,
1251
+ nextWakeAt: null
1252
+ } : await runOwnedResident({
1253
+ resident,
1254
+ owner: reserveRunner(resident, {
1255
+ mode: "foreground",
1256
+ maxSteps: flags.maxSteps,
1257
+ pauseGeneration: state.pauseGeneration ?? 0
1258
+ }),
1259
+ step,
1260
+ signal: controller.signal,
1261
+ keepAlive: false,
1262
+ maxIdleMs: flags.maxIdleMs
1263
+ });
1264
+ state = await readAgenda(resident);
1265
+ const status = residentStatus(
1266
+ resident,
1267
+ state,
1268
+ void 0,
1269
+ await residentRunnerStatus(resident)
1270
+ );
1271
+ ctx.formatter.print({
1272
+ ...status,
1273
+ execution: result,
1274
+ text: `${status.text}
1275
+
1276
+ Run: ${result.status} \xB7 ${result.stepsSettled} step(s) settled`
1277
+ });
1278
+ return result.status === "cancelled" ? 130 : ["unresolved", "contended"].includes(result.status) || state.pursuits.some((p) => p.state.phase === "running") ? 1 : 0;
1279
+ } finally {
1280
+ process.removeListener("SIGINT", interrupt);
1281
+ process.removeListener("SIGTERM", interrupt);
1282
+ }
1283
+ }
1284
+ }
1285
+ state = await readAgenda(resident);
1286
+ const runner = await residentRunnerStatus(resident);
1287
+ if (flags.action === "add") {
1288
+ message += runner.live?.kind === "responsive" ? " Due work is available to the current runner within its remaining authorization." : runner.owner && ["running", "reserved"].includes(runner.owner.phase) ? " Runner ownership is retained; inspect resident status before execution." : " Continue with namzu resident run --max-steps <n> or resident start --max-steps <n>.";
1289
+ }
1290
+ bootstrap.formatter.print(residentStatus(resident, state, message, runner));
1291
+ return 0;
1292
+ } catch (error) {
1293
+ bootstrap.formatter.error({
1294
+ message: error instanceof Error ? error.message : String(error)
1295
+ });
1296
+ if (resident) {
1297
+ try {
1298
+ const state = await resident.agenda.read();
1299
+ if (state)
1300
+ bootstrap.formatter.print(
1301
+ residentStatus(resident, state, void 0, await residentRunnerStatus(resident))
1302
+ );
1303
+ } catch {
1304
+ }
1305
+ }
1306
+ return error instanceof ConfigLoadError || error instanceof ConfigValueError ? EXIT_BAD_CONFIG : 1;
1307
+ }
1308
+ }, "handler")
1309
+ };
1310
+ export {
1311
+ residentCommand,
1312
+ residentStatus
1313
+ };
1314
+ //# sourceMappingURL=resident-5ZY6OG6B.js.map