@namzu/cli 34.1.1 → 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 (1306) hide show
  1. package/CHANGELOG.md +800 -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/mcp.d.ts +3 -0
  344. package/dist/commands/mcp.d.ts.map +1 -1
  345. package/dist/commands/pal.d.ts +5 -0
  346. package/dist/commands/pal.d.ts.map +1 -0
  347. package/dist/commands/permission-preview.d.ts +38 -0
  348. package/dist/commands/permission-preview.d.ts.map +1 -0
  349. package/dist/commands/registry.d.ts +10 -0
  350. package/dist/commands/registry.d.ts.map +1 -1
  351. package/dist/commands/serve.d.ts +1 -12
  352. package/dist/commands/serve.d.ts.map +1 -1
  353. package/dist/commands/stdin.d.ts.map +1 -1
  354. package/dist/commands/upgrade.d.ts +14 -0
  355. package/dist/commands/upgrade.d.ts.map +1 -1
  356. package/dist/compile-cache-enable.d.ts +2 -0
  357. package/dist/compile-cache-enable.d.ts.map +1 -0
  358. package/dist/compile-cache.d.ts +53 -0
  359. package/dist/compile-cache.d.ts.map +1 -0
  360. package/dist/computer/bundle.d.ts +18 -0
  361. package/dist/computer/bundle.d.ts.map +1 -0
  362. package/dist/computer/run.d.ts +26 -0
  363. package/dist/computer/run.d.ts.map +1 -0
  364. package/dist/computer/sentences.d.ts +30 -0
  365. package/dist/computer/sentences.d.ts.map +1 -0
  366. package/dist/config/load.d.ts +10 -1
  367. package/dist/config/load.d.ts.map +1 -1
  368. package/dist/context/capabilities.d.ts +25 -2
  369. package/dist/context/capabilities.d.ts.map +1 -1
  370. package/dist/context/runtime-message.d.ts.map +1 -1
  371. package/dist/crash-report.d.ts +22 -0
  372. package/dist/crash-report.d.ts.map +1 -0
  373. package/dist/debug-requested.d.ts +7 -0
  374. package/dist/debug-requested.d.ts.map +1 -0
  375. package/dist/doctor/checks/credentials.d.ts.map +1 -1
  376. package/dist/exit-codes.d.ts +9 -1
  377. package/dist/exit-codes.d.ts.map +1 -1
  378. package/dist/index.js +105 -17
  379. package/dist/index.js.map +6 -1
  380. package/dist/integrations/harness/claude-adapter.d.ts +20 -0
  381. package/dist/integrations/harness/claude-adapter.d.ts.map +1 -0
  382. package/dist/integrations/harness/claude-protocol.d.ts +67 -0
  383. package/dist/integrations/harness/claude-protocol.d.ts.map +1 -0
  384. package/dist/integrations/harness/codex-adapter.d.ts +80 -0
  385. package/dist/integrations/harness/codex-adapter.d.ts.map +1 -0
  386. package/dist/integrations/harness/codex-protocol.d.ts +22 -0
  387. package/dist/integrations/harness/codex-protocol.d.ts.map +1 -0
  388. package/dist/integrations/harness/model-cache.d.ts +16 -0
  389. package/dist/integrations/harness/model-cache.d.ts.map +1 -0
  390. package/dist/integrations/harness/native-executable.d.ts +8 -0
  391. package/dist/integrations/harness/native-executable.d.ts.map +1 -0
  392. package/dist/integrations/harness/process.d.ts +25 -0
  393. package/dist/integrations/harness/process.d.ts.map +1 -0
  394. package/dist/integrations/mcp/servers.d.ts.map +1 -1
  395. package/dist/integrations/peers/runtime.d.ts +64 -0
  396. package/dist/integrations/peers/runtime.d.ts.map +1 -0
  397. package/dist/integrations/plugins/inventory.d.ts +27 -0
  398. package/dist/integrations/plugins/inventory.d.ts.map +1 -0
  399. package/dist/integrations/providers/composer-settings.d.ts +33 -0
  400. package/dist/integrations/providers/composer-settings.d.ts.map +1 -0
  401. package/dist/integrations/providers/connections.d.ts +37 -0
  402. package/dist/integrations/providers/connections.d.ts.map +1 -0
  403. package/dist/integrations/providers/credential-store.d.ts +35 -0
  404. package/dist/integrations/providers/credential-store.d.ts.map +1 -1
  405. package/dist/integrations/providers/discover.d.ts +27 -1
  406. package/dist/integrations/providers/discover.d.ts.map +1 -1
  407. package/dist/integrations/providers/index.d.ts +2 -2
  408. package/dist/integrations/providers/index.d.ts.map +1 -1
  409. package/dist/integrations/providers/picker-operation.d.ts +6 -0
  410. package/dist/integrations/providers/picker-operation.d.ts.map +1 -0
  411. package/dist/integrations/providers/setup.d.ts +16 -1
  412. package/dist/integrations/providers/setup.d.ts.map +1 -1
  413. package/dist/integrations/resident/runner-worker.js +190 -161
  414. package/dist/integrations/resident/runner-worker.js.map +6 -1
  415. package/dist/integrations/resident/session-step.d.ts.map +1 -1
  416. package/dist/integrations/sessions/display-title.d.ts +8 -0
  417. package/dist/integrations/sessions/display-title.d.ts.map +1 -1
  418. package/dist/integrations/sessions/store.d.ts +23 -9
  419. package/dist/integrations/sessions/store.d.ts.map +1 -1
  420. package/dist/integrations/sessions/task-context.d.ts +1 -1
  421. package/dist/integrations/sessions/task-context.d.ts.map +1 -1
  422. package/dist/integrations/sessions/transcript-export.d.ts.map +1 -1
  423. package/dist/integrations/subagents/activity.d.ts +9 -6
  424. package/dist/integrations/subagents/activity.d.ts.map +1 -1
  425. package/dist/integrations/subagents/operator-journal.d.ts +20 -0
  426. package/dist/integrations/subagents/operator-journal.d.ts.map +1 -0
  427. package/dist/integrations/subagents/runtime.d.ts +11 -0
  428. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  429. package/dist/integrations/trust/store.d.ts +14 -0
  430. package/dist/integrations/trust/store.d.ts.map +1 -1
  431. package/dist/integrations/web/search.d.ts +1 -1
  432. package/dist/pals/actions.d.ts +57 -0
  433. package/dist/pals/actions.d.ts.map +1 -0
  434. package/dist/pals/activity-command.d.ts +3 -0
  435. package/dist/pals/activity-command.d.ts.map +1 -0
  436. package/dist/pals/activity.d.ts +18 -0
  437. package/dist/pals/activity.d.ts.map +1 -0
  438. package/dist/pals/agent-session.d.ts +19 -0
  439. package/dist/pals/agent-session.d.ts.map +1 -0
  440. package/dist/pals/channel-actions.d.ts +5 -0
  441. package/dist/pals/channel-actions.d.ts.map +1 -0
  442. package/dist/pals/channel-local.d.ts +7 -0
  443. package/dist/pals/channel-local.d.ts.map +1 -0
  444. package/dist/pals/channel.d.ts +20 -0
  445. package/dist/pals/channel.d.ts.map +1 -0
  446. package/dist/pals/chat.d.ts +6 -0
  447. package/dist/pals/chat.d.ts.map +1 -0
  448. package/dist/pals/communication.d.ts +47 -0
  449. package/dist/pals/communication.d.ts.map +1 -0
  450. package/dist/pals/conversations.d.ts +26 -0
  451. package/dist/pals/conversations.d.ts.map +1 -0
  452. package/dist/pals/desktop-communication.d.ts +111 -0
  453. package/dist/pals/desktop-communication.d.ts.map +1 -0
  454. package/dist/pals/dispatch.d.ts +13 -0
  455. package/dist/pals/dispatch.d.ts.map +1 -0
  456. package/dist/pals/environment.d.ts +103 -0
  457. package/dist/pals/environment.d.ts.map +1 -0
  458. package/dist/pals/guest-mcp-transport.d.ts +28 -0
  459. package/dist/pals/guest-mcp-transport.d.ts.map +1 -0
  460. package/dist/pals/guest-mcp.d.ts +22 -0
  461. package/dist/pals/guest-mcp.d.ts.map +1 -0
  462. package/dist/pals/inbox-start.d.ts +35 -0
  463. package/dist/pals/inbox-start.d.ts.map +1 -0
  464. package/dist/pals/message-command.d.ts +3 -0
  465. package/dist/pals/message-command.d.ts.map +1 -0
  466. package/dist/pals/operator-tools.d.ts +23 -0
  467. package/dist/pals/operator-tools.d.ts.map +1 -0
  468. package/dist/pals/public-transcript.d.ts +4 -0
  469. package/dist/pals/public-transcript.d.ts.map +1 -0
  470. package/dist/pals/review.d.ts +16 -0
  471. package/dist/pals/review.d.ts.map +1 -0
  472. package/dist/pals/store.d.ts +16 -0
  473. package/dist/pals/store.d.ts.map +1 -0
  474. package/dist/pals/tui-session.d.ts +11 -0
  475. package/dist/pals/tui-session.d.ts.map +1 -0
  476. package/dist/permissions/mode-names.d.ts +2 -0
  477. package/dist/permissions/mode-names.d.ts.map +1 -0
  478. package/dist/resume-invocation.d.ts +1 -1
  479. package/dist/resume-invocation.d.ts.map +1 -1
  480. package/dist/resume-shell.d.ts +8 -0
  481. package/dist/resume-shell.d.ts.map +1 -0
  482. package/dist/schedule/build.d.ts +12 -3
  483. package/dist/schedule/build.d.ts.map +1 -1
  484. package/dist/schedule/commands/add.d.ts +1 -1
  485. package/dist/schedule/commands/add.d.ts.map +1 -1
  486. package/dist/schedule/commands/lifecycle.d.ts.map +1 -1
  487. package/dist/schedule/commands/list.d.ts +3 -1
  488. package/dist/schedule/commands/list.d.ts.map +1 -1
  489. package/dist/schedule/daemon/daemon.d.ts +2 -0
  490. package/dist/schedule/daemon/daemon.d.ts.map +1 -1
  491. package/dist/schedule/delivery.d.ts +66 -0
  492. package/dist/schedule/delivery.d.ts.map +1 -0
  493. package/dist/schedule/fire/fire.d.ts +1 -1
  494. package/dist/schedule/fire/fire.d.ts.map +1 -1
  495. package/dist/schedule/fire/run-script.d.ts +2 -2
  496. package/dist/schedule/fire/run-script.d.ts.map +1 -1
  497. package/dist/schedule/fire/script-report.d.ts +31 -0
  498. package/dist/schedule/fire/script-report.d.ts.map +1 -0
  499. package/dist/schedule/floor.d.ts +1 -1
  500. package/dist/schedule/floor.d.ts.map +1 -1
  501. package/dist/schedule/folder.d.ts +6 -0
  502. package/dist/schedule/folder.d.ts.map +1 -1
  503. package/dist/schedule/resume-command.d.ts +3 -3
  504. package/dist/schedule/resume-command.d.ts.map +1 -1
  505. package/dist/schedule/store/history.d.ts.map +1 -1
  506. package/dist/schedule/store/jobs.d.ts +6 -6
  507. package/dist/schedule/store/jobs.d.ts.map +1 -1
  508. package/dist/schedule/store/script-state.d.ts +31 -0
  509. package/dist/schedule/store/script-state.d.ts.map +1 -0
  510. package/dist/schedule/store/state.d.ts +4 -2
  511. package/dist/schedule/store/state.d.ts.map +1 -1
  512. package/dist/schedule/types.d.ts +61 -16
  513. package/dist/schedule/types.d.ts.map +1 -1
  514. package/dist/skills/store.d.ts.map +1 -1
  515. package/dist/terminal/host.d.ts +22 -0
  516. package/dist/terminal/host.d.ts.map +1 -0
  517. package/dist/terminal/manager.d.ts +124 -0
  518. package/dist/terminal/manager.d.ts.map +1 -0
  519. package/dist/terminal/protocol.d.ts +162 -0
  520. package/dist/terminal/protocol.d.ts.map +1 -0
  521. package/dist/terminal/pty.d.ts +85 -0
  522. package/dist/terminal/pty.d.ts.map +1 -0
  523. package/dist/terminal/ring.d.ts +23 -0
  524. package/dist/terminal/ring.d.ts.map +1 -0
  525. package/dist/terminal/screen.d.ts +31 -0
  526. package/dist/terminal/screen.d.ts.map +1 -0
  527. package/dist/termination-state.d.ts +19 -0
  528. package/dist/termination-state.d.ts.map +1 -0
  529. package/dist/termination.d.ts +2 -9
  530. package/dist/termination.d.ts.map +1 -1
  531. package/dist/tui/AgentExplorer.d.ts +4 -1
  532. package/dist/tui/AgentExplorer.d.ts.map +1 -1
  533. package/dist/tui/App.d.ts.map +1 -1
  534. package/dist/tui/BackgroundJobsPanel.d.ts +26 -0
  535. package/dist/tui/BackgroundJobsPanel.d.ts.map +1 -0
  536. package/dist/tui/BrandHeader.d.ts.map +1 -1
  537. package/dist/tui/ChildComposer.d.ts +22 -0
  538. package/dist/tui/ChildComposer.d.ts.map +1 -0
  539. package/dist/tui/ChoicePicker.d.ts.map +1 -1
  540. package/dist/tui/Composer.d.ts +25 -4
  541. package/dist/tui/Composer.d.ts.map +1 -1
  542. package/dist/tui/ComposerFrame.d.ts.map +1 -1
  543. package/dist/tui/CopyPicker.d.ts.map +1 -1
  544. package/dist/tui/EditPromptPicker.d.ts.map +1 -1
  545. package/dist/tui/EffortSlider.d.ts.map +1 -1
  546. package/dist/tui/LiveActivity.d.ts +7 -1
  547. package/dist/tui/LiveActivity.d.ts.map +1 -1
  548. package/dist/tui/Markdown.d.ts.map +1 -1
  549. package/dist/tui/PendingInputPanel.d.ts +34 -0
  550. package/dist/tui/PendingInputPanel.d.ts.map +1 -0
  551. package/dist/tui/PermissionOverlay.d.ts.map +1 -1
  552. package/dist/tui/Picker.d.ts.map +1 -1
  553. package/dist/tui/ProviderSetup.d.ts.map +1 -1
  554. package/dist/tui/ResumePicker.d.ts.map +1 -1
  555. package/dist/tui/SaveSkillOverlay.d.ts.map +1 -1
  556. package/dist/tui/ScheduleReviewOverlay.d.ts +1 -1
  557. package/dist/tui/ScheduleReviewOverlay.d.ts.map +1 -1
  558. package/dist/tui/StatusBar.d.ts +7 -1
  559. package/dist/tui/StatusBar.d.ts.map +1 -1
  560. package/dist/tui/StatusPanel.d.ts.map +1 -1
  561. package/dist/tui/TextPrompt.d.ts.map +1 -1
  562. package/dist/tui/ToolOutputViewer.d.ts.map +1 -1
  563. package/dist/tui/Transcript.d.ts.map +1 -1
  564. package/dist/tui/TrustPrompt.d.ts +8 -0
  565. package/dist/tui/TrustPrompt.d.ts.map +1 -1
  566. package/dist/tui/agent.d.ts +135 -6
  567. package/dist/tui/agent.d.ts.map +1 -1
  568. package/dist/tui/browser-notices.d.ts.map +1 -1
  569. package/dist/tui/capability-notice.d.ts +38 -0
  570. package/dist/tui/capability-notice.d.ts.map +1 -0
  571. package/dist/tui/console-input.d.ts +31 -0
  572. package/dist/tui/console-input.d.ts.map +1 -0
  573. package/dist/tui/conversation-evidence-view.d.ts.map +1 -1
  574. package/dist/tui/credential-entry.d.ts.map +1 -1
  575. package/dist/tui/exit-summary.d.ts +9 -1
  576. package/dist/tui/exit-summary.d.ts.map +1 -1
  577. package/dist/tui/external-editor.d.ts.map +1 -1
  578. package/dist/tui/index.d.ts.map +1 -1
  579. package/dist/tui/key-hints.d.ts +51 -0
  580. package/dist/tui/key-hints.d.ts.map +1 -0
  581. package/dist/tui/launch-settings.d.ts +34 -0
  582. package/dist/tui/launch-settings.d.ts.map +1 -0
  583. package/dist/tui/log-pane.d.ts.map +1 -1
  584. package/dist/tui/model-choices.d.ts +39 -1
  585. package/dist/tui/model-choices.d.ts.map +1 -1
  586. package/dist/tui/model-search.d.ts +4 -1
  587. package/dist/tui/model-search.d.ts.map +1 -1
  588. package/dist/tui/output-size-watch.d.ts +32 -0
  589. package/dist/tui/output-size-watch.d.ts.map +1 -0
  590. package/dist/tui/permission-review.d.ts.map +1 -1
  591. package/dist/tui/person-terms.d.ts +58 -0
  592. package/dist/tui/person-terms.d.ts.map +1 -0
  593. package/dist/tui/plain-failure.d.ts +27 -0
  594. package/dist/tui/plain-failure.d.ts.map +1 -0
  595. package/dist/tui/plain-interruption.d.ts +46 -0
  596. package/dist/tui/plain-interruption.d.ts.map +1 -0
  597. package/dist/tui/provider-list.d.ts.map +1 -1
  598. package/dist/tui/render-mode.d.ts +19 -0
  599. package/dist/tui/render-mode.d.ts.map +1 -0
  600. package/dist/tui/schedule/host-commands.d.ts +2 -9
  601. package/dist/tui/schedule/host-commands.d.ts.map +1 -1
  602. package/dist/tui/schedule/integration.d.ts +8 -0
  603. package/dist/tui/schedule/integration.d.ts.map +1 -1
  604. package/dist/tui/schedule/source-deliveries.d.ts +37 -0
  605. package/dist/tui/schedule/source-deliveries.d.ts.map +1 -0
  606. package/dist/tui/schedule/startup.d.ts.map +1 -1
  607. package/dist/tui/schedule/tool-host.d.ts +3 -1
  608. package/dist/tui/schedule/tool-host.d.ts.map +1 -1
  609. package/dist/tui/setup-text.d.ts +14 -0
  610. package/dist/tui/setup-text.d.ts.map +1 -0
  611. package/dist/tui/shell-escape.d.ts.map +1 -1
  612. package/dist/tui/skills/suggest-setting.d.ts.map +1 -1
  613. package/dist/tui/slashCommands.d.ts +9 -2
  614. package/dist/tui/slashCommands.d.ts.map +1 -1
  615. package/dist/tui/terminal-choice-text.d.ts +7 -0
  616. package/dist/tui/terminal-choice-text.d.ts.map +1 -1
  617. package/dist/tui/tidy-tool-output.d.ts +83 -0
  618. package/dist/tui/tidy-tool-output.d.ts.map +1 -0
  619. package/dist/tui/tool-presentation.d.ts +6 -0
  620. package/dist/tui/tool-presentation.d.ts.map +1 -0
  621. package/dist/tui/triggers/copy.d.ts.map +1 -1
  622. package/dist/tui/triggers/setting.d.ts.map +1 -1
  623. package/dist/tui/turn-interruption.d.ts +1 -1
  624. package/dist/tui/turn-interruption.d.ts.map +1 -1
  625. package/dist/tui/turn-limits-settings.d.ts +4 -4
  626. package/dist/tui/turn-limits-settings.d.ts.map +1 -1
  627. package/dist/tui/types.d.ts +10 -0
  628. package/dist/tui/types.d.ts.map +1 -1
  629. package/dist/tui/web-activity.d.ts +3 -2
  630. package/dist/tui/web-activity.d.ts.map +1 -1
  631. package/dist/tui/zen-free-refusal.d.ts +17 -0
  632. package/dist/tui/zen-free-refusal.d.ts.map +1 -0
  633. package/dist/usage-error.d.ts +15 -0
  634. package/dist/usage-error.d.ts.map +1 -0
  635. package/dist/warning-filter.d.ts +30 -0
  636. package/dist/warning-filter.d.ts.map +1 -0
  637. package/package.json +22 -11
  638. package/skills/schedule-task/SKILL.md +74 -20
  639. package/dist/browser/commands.js +0 -365
  640. package/dist/browser/commands.js.map +0 -1
  641. package/dist/browser/control.js +0 -140
  642. package/dist/browser/control.js.map +0 -1
  643. package/dist/browser/describe.js +0 -27
  644. package/dist/browser/describe.js.map +0 -1
  645. package/dist/checkpoints/store.js +0 -192
  646. package/dist/checkpoints/store.js.map +0 -1
  647. package/dist/checkpoints/wrap.js +0 -37
  648. package/dist/checkpoints/wrap.js.map +0 -1
  649. package/dist/cli.js +0 -602
  650. package/dist/cli.js.map +0 -1
  651. package/dist/commands/acp.js +0 -388
  652. package/dist/commands/acp.js.map +0 -1
  653. package/dist/commands/archive.js +0 -65
  654. package/dist/commands/archive.js.map +0 -1
  655. package/dist/commands/browser.js +0 -16
  656. package/dist/commands/browser.js.map +0 -1
  657. package/dist/commands/doctor.js +0 -267
  658. package/dist/commands/doctor.js.map +0 -1
  659. package/dist/commands/drain.js +0 -498
  660. package/dist/commands/drain.js.map +0 -1
  661. package/dist/commands/eval.js +0 -237
  662. package/dist/commands/eval.js.map +0 -1
  663. package/dist/commands/exec-flags.js +0 -334
  664. package/dist/commands/exec-flags.js.map +0 -1
  665. package/dist/commands/exec-json.js +0 -497
  666. package/dist/commands/exec-json.js.map +0 -1
  667. package/dist/commands/exec.js +0 -688
  668. package/dist/commands/exec.js.map +0 -1
  669. package/dist/commands/host-queries.js +0 -156
  670. package/dist/commands/host-queries.js.map +0 -1
  671. package/dist/commands/login.js +0 -315
  672. package/dist/commands/login.js.map +0 -1
  673. package/dist/commands/mcp-oauth-login.js +0 -213
  674. package/dist/commands/mcp-oauth-login.js.map +0 -1
  675. package/dist/commands/mcp.js +0 -288
  676. package/dist/commands/mcp.js.map +0 -1
  677. package/dist/commands/prior-messages.js +0 -329
  678. package/dist/commands/prior-messages.js.map +0 -1
  679. package/dist/commands/provider-wait.js +0 -65
  680. package/dist/commands/provider-wait.js.map +0 -1
  681. package/dist/commands/registry.js +0 -40
  682. package/dist/commands/registry.js.map +0 -1
  683. package/dist/commands/resident-flags.js +0 -193
  684. package/dist/commands/resident-flags.js.map +0 -1
  685. package/dist/commands/resident-learning.js +0 -293
  686. package/dist/commands/resident-learning.js.map +0 -1
  687. package/dist/commands/resident.js +0 -419
  688. package/dist/commands/resident.js.map +0 -1
  689. package/dist/commands/resume.js +0 -109
  690. package/dist/commands/resume.js.map +0 -1
  691. package/dist/commands/schedule.js +0 -131
  692. package/dist/commands/schedule.js.map +0 -1
  693. package/dist/commands/serve.js +0 -21
  694. package/dist/commands/serve.js.map +0 -1
  695. package/dist/commands/skills.js +0 -178
  696. package/dist/commands/skills.js.map +0 -1
  697. package/dist/commands/state.js +0 -110
  698. package/dist/commands/state.js.map +0 -1
  699. package/dist/commands/stdin.js +0 -69
  700. package/dist/commands/stdin.js.map +0 -1
  701. package/dist/commands/types.js +0 -2
  702. package/dist/commands/types.js.map +0 -1
  703. package/dist/commands/upgrade-progress.js +0 -54
  704. package/dist/commands/upgrade-progress.js.map +0 -1
  705. package/dist/commands/upgrade.js +0 -232
  706. package/dist/commands/upgrade.js.map +0 -1
  707. package/dist/commands/worktree.js +0 -86
  708. package/dist/commands/worktree.js.map +0 -1
  709. package/dist/config/composer-triggers.js +0 -80
  710. package/dist/config/composer-triggers.js.map +0 -1
  711. package/dist/config/debug.js +0 -126
  712. package/dist/config/debug.js.map +0 -1
  713. package/dist/config/load.js +0 -1208
  714. package/dist/config/load.js.map +0 -1
  715. package/dist/config/schema.js +0 -13
  716. package/dist/config/schema.js.map +0 -1
  717. package/dist/config/tool-result-screens.js +0 -104
  718. package/dist/config/tool-result-screens.js.map +0 -1
  719. package/dist/config/trusted-project-context.js +0 -28
  720. package/dist/config/trusted-project-context.js.map +0 -1
  721. package/dist/config/turn-guards.js +0 -46
  722. package/dist/config/turn-guards.js.map +0 -1
  723. package/dist/config/user-config.js +0 -118
  724. package/dist/config/user-config.js.map +0 -1
  725. package/dist/context/capabilities.js +0 -164
  726. package/dist/context/capabilities.js.map +0 -1
  727. package/dist/context/directories.js +0 -69
  728. package/dist/context/directories.js.map +0 -1
  729. package/dist/context/doctrine.js +0 -24
  730. package/dist/context/doctrine.js.map +0 -1
  731. package/dist/context/environment.js +0 -255
  732. package/dist/context/environment.js.map +0 -1
  733. package/dist/context/project-path.js +0 -16
  734. package/dist/context/project-path.js.map +0 -1
  735. package/dist/context/project-tracker.js +0 -217
  736. package/dist/context/project-tracker.js.map +0 -1
  737. package/dist/context/project.js +0 -256
  738. package/dist/context/project.js.map +0 -1
  739. package/dist/context/runtime-message.js +0 -30
  740. package/dist/context/runtime-message.js.map +0 -1
  741. package/dist/context/sandbox.js +0 -114
  742. package/dist/context/sandbox.js.map +0 -1
  743. package/dist/context/turn-snapshot.js +0 -122
  744. package/dist/context/turn-snapshot.js.map +0 -1
  745. package/dist/doctor/checks/browser.js +0 -63
  746. package/dist/doctor/checks/browser.js.map +0 -1
  747. package/dist/doctor/checks/chain.js +0 -211
  748. package/dist/doctor/checks/chain.js.map +0 -1
  749. package/dist/doctor/checks/credentials.js +0 -98
  750. package/dist/doctor/checks/credentials.js.map +0 -1
  751. package/dist/doctor/checks/index.js +0 -72
  752. package/dist/doctor/checks/index.js.map +0 -1
  753. package/dist/doctor/checks/invariants.js +0 -79
  754. package/dist/doctor/checks/invariants.js.map +0 -1
  755. package/dist/doctor/checks/logging.js +0 -69
  756. package/dist/doctor/checks/logging.js.map +0 -1
  757. package/dist/doctor/checks/providers.js +0 -30
  758. package/dist/doctor/checks/providers.js.map +0 -1
  759. package/dist/doctor/checks/runtime.js +0 -40
  760. package/dist/doctor/checks/runtime.js.map +0 -1
  761. package/dist/doctor/checks/sandbox.js +0 -76
  762. package/dist/doctor/checks/sandbox.js.map +0 -1
  763. package/dist/doctor/checks/scheduler.js +0 -74
  764. package/dist/doctor/checks/scheduler.js.map +0 -1
  765. package/dist/doctor/checks/session-export.js +0 -62
  766. package/dist/doctor/checks/session-export.js.map +0 -1
  767. package/dist/doctor/checks/telemetry.js +0 -58
  768. package/dist/doctor/checks/telemetry.js.map +0 -1
  769. package/dist/doctor/checks/vault.js +0 -67
  770. package/dist/doctor/checks/vault.js.map +0 -1
  771. package/dist/doctor/index.js +0 -3
  772. package/dist/doctor/index.js.map +0 -1
  773. package/dist/doctor/registry.js +0 -230
  774. package/dist/doctor/registry.js.map +0 -1
  775. package/dist/exit-codes.js +0 -62
  776. package/dist/exit-codes.js.map +0 -1
  777. package/dist/installation.js +0 -48
  778. package/dist/installation.js.map +0 -1
  779. package/dist/integrations/clipboard/image.js +0 -119
  780. package/dist/integrations/clipboard/image.js.map +0 -1
  781. package/dist/integrations/clipboard/text.js +0 -43
  782. package/dist/integrations/clipboard/text.js.map +0 -1
  783. package/dist/integrations/files/attachment-store.js +0 -86
  784. package/dist/integrations/files/attachment-store.js.map +0 -1
  785. package/dist/integrations/mcp/oauth-store.js +0 -549
  786. package/dist/integrations/mcp/oauth-store.js.map +0 -1
  787. package/dist/integrations/mcp/servers.js +0 -519
  788. package/dist/integrations/mcp/servers.js.map +0 -1
  789. package/dist/integrations/mcp/user-config.js +0 -92
  790. package/dist/integrations/mcp/user-config.js.map +0 -1
  791. package/dist/integrations/notifications/desktop/freedesktop.js +0 -33
  792. package/dist/integrations/notifications/desktop/freedesktop.js.map +0 -1
  793. package/dist/integrations/notifications/desktop/macos.js +0 -17
  794. package/dist/integrations/notifications/desktop/macos.js.map +0 -1
  795. package/dist/integrations/notifications/desktop/sanitize.js +0 -49
  796. package/dist/integrations/notifications/desktop/sanitize.js.map +0 -1
  797. package/dist/integrations/notifications/desktop/throttle.js +0 -39
  798. package/dist/integrations/notifications/desktop/throttle.js.map +0 -1
  799. package/dist/integrations/notifications/desktop/windows-toast.js +0 -56
  800. package/dist/integrations/notifications/desktop/windows-toast.js.map +0 -1
  801. package/dist/integrations/notifications/desktop.js +0 -199
  802. package/dist/integrations/notifications/desktop.js.map +0 -1
  803. package/dist/integrations/notifications/terminal.js +0 -46
  804. package/dist/integrations/notifications/terminal.js.map +0 -1
  805. package/dist/integrations/npm-invocation.js +0 -23
  806. package/dist/integrations/npm-invocation.js.map +0 -1
  807. package/dist/integrations/plugins/runtime.js +0 -189
  808. package/dist/integrations/plugins/runtime.js.map +0 -1
  809. package/dist/integrations/plugins/settings.js +0 -106
  810. package/dist/integrations/plugins/settings.js.map +0 -1
  811. package/dist/integrations/providers/access.js +0 -23
  812. package/dist/integrations/providers/access.js.map +0 -1
  813. package/dist/integrations/providers/chain-capabilities.js +0 -211
  814. package/dist/integrations/providers/chain-capabilities.js.map +0 -1
  815. package/dist/integrations/providers/codex-device-login.js +0 -195
  816. package/dist/integrations/providers/codex-device-login.js.map +0 -1
  817. package/dist/integrations/providers/codex-oauth.js +0 -95
  818. package/dist/integrations/providers/codex-oauth.js.map +0 -1
  819. package/dist/integrations/providers/credential-provider.js +0 -74
  820. package/dist/integrations/providers/credential-provider.js.map +0 -1
  821. package/dist/integrations/providers/credential-store.js +0 -657
  822. package/dist/integrations/providers/credential-store.js.map +0 -1
  823. package/dist/integrations/providers/current-credential.js +0 -45
  824. package/dist/integrations/providers/current-credential.js.map +0 -1
  825. package/dist/integrations/providers/discover.js +0 -313
  826. package/dist/integrations/providers/discover.js.map +0 -1
  827. package/dist/integrations/providers/gemini-credentials.js +0 -148
  828. package/dist/integrations/providers/gemini-credentials.js.map +0 -1
  829. package/dist/integrations/providers/harness-credentials.js +0 -344
  830. package/dist/integrations/providers/harness-credentials.js.map +0 -1
  831. package/dist/integrations/providers/identity.js +0 -64
  832. package/dist/integrations/providers/identity.js.map +0 -1
  833. package/dist/integrations/providers/index.js +0 -14
  834. package/dist/integrations/providers/index.js.map +0 -1
  835. package/dist/integrations/providers/keychain.js +0 -78
  836. package/dist/integrations/providers/keychain.js.map +0 -1
  837. package/dist/integrations/providers/model-reasoning.js +0 -51
  838. package/dist/integrations/providers/model-reasoning.js.map +0 -1
  839. package/dist/integrations/providers/oauth.js +0 -302
  840. package/dist/integrations/providers/oauth.js.map +0 -1
  841. package/dist/integrations/providers/preferences.js +0 -287
  842. package/dist/integrations/providers/preferences.js.map +0 -1
  843. package/dist/integrations/providers/register.js +0 -154
  844. package/dist/integrations/providers/register.js.map +0 -1
  845. package/dist/integrations/providers/registry.js +0 -289
  846. package/dist/integrations/providers/registry.js.map +0 -1
  847. package/dist/integrations/providers/setup.js +0 -158
  848. package/dist/integrations/providers/setup.js.map +0 -1
  849. package/dist/integrations/providers/subscription-login.js +0 -328
  850. package/dist/integrations/providers/subscription-login.js.map +0 -1
  851. package/dist/integrations/providers/zen-catalogue.js +0 -196
  852. package/dist/integrations/providers/zen-catalogue.js.map +0 -1
  853. package/dist/integrations/resident/foreground.js +0 -95
  854. package/dist/integrations/resident/foreground.js.map +0 -1
  855. package/dist/integrations/resident/inspection.js +0 -282
  856. package/dist/integrations/resident/inspection.js.map +0 -1
  857. package/dist/integrations/resident/learning-sources.js +0 -79
  858. package/dist/integrations/resident/learning-sources.js.map +0 -1
  859. package/dist/integrations/resident/learning-storage.js +0 -55
  860. package/dist/integrations/resident/learning-storage.js.map +0 -1
  861. package/dist/integrations/resident/lifecycle-errors.js +0 -15
  862. package/dist/integrations/resident/lifecycle-errors.js.map +0 -1
  863. package/dist/integrations/resident/owned-runner.js +0 -91
  864. package/dist/integrations/resident/owned-runner.js.map +0 -1
  865. package/dist/integrations/resident/runner-control.js +0 -238
  866. package/dist/integrations/resident/runner-control.js.map +0 -1
  867. package/dist/integrations/resident/runner-launch.js +0 -142
  868. package/dist/integrations/resident/runner-launch.js.map +0 -1
  869. package/dist/integrations/resident/runner-store.js +0 -284
  870. package/dist/integrations/resident/runner-store.js.map +0 -1
  871. package/dist/integrations/resident/session-log-reads.js +0 -125
  872. package/dist/integrations/resident/session-log-reads.js.map +0 -1
  873. package/dist/integrations/resident/session-step.js +0 -471
  874. package/dist/integrations/resident/session-step.js.map +0 -1
  875. package/dist/integrations/resident/storage.js +0 -183
  876. package/dist/integrations/resident/storage.js.map +0 -1
  877. package/dist/integrations/resident/tool-evidence.js +0 -123
  878. package/dist/integrations/resident/tool-evidence.js.map +0 -1
  879. package/dist/integrations/resident/verification.js +0 -109
  880. package/dist/integrations/resident/verification.js.map +0 -1
  881. package/dist/integrations/sessions/checkpoint-view.js +0 -48
  882. package/dist/integrations/sessions/checkpoint-view.js.map +0 -1
  883. package/dist/integrations/sessions/context-inventory.js +0 -44
  884. package/dist/integrations/sessions/context-inventory.js.map +0 -1
  885. package/dist/integrations/sessions/conversation-search.js +0 -572
  886. package/dist/integrations/sessions/conversation-search.js.map +0 -1
  887. package/dist/integrations/sessions/display-title.js +0 -5
  888. package/dist/integrations/sessions/display-title.js.map +0 -1
  889. package/dist/integrations/sessions/evidence-page-validation.js +0 -74
  890. package/dist/integrations/sessions/evidence-page-validation.js.map +0 -1
  891. package/dist/integrations/sessions/evidence-recall.js +0 -117
  892. package/dist/integrations/sessions/evidence-recall.js.map +0 -1
  893. package/dist/integrations/sessions/store.js +0 -780
  894. package/dist/integrations/sessions/store.js.map +0 -1
  895. package/dist/integrations/sessions/task-context.js +0 -96
  896. package/dist/integrations/sessions/task-context.js.map +0 -1
  897. package/dist/integrations/sessions/transcript-export.js +0 -342
  898. package/dist/integrations/sessions/transcript-export.js.map +0 -1
  899. package/dist/integrations/state/home.js +0 -17
  900. package/dist/integrations/state/home.js.map +0 -1
  901. package/dist/integrations/state/identity.js +0 -49
  902. package/dist/integrations/state/identity.js.map +0 -1
  903. package/dist/integrations/state/immutable-json.js +0 -38
  904. package/dist/integrations/state/immutable-json.js.map +0 -1
  905. package/dist/integrations/state/private-directory.js +0 -43
  906. package/dist/integrations/state/private-directory.js.map +0 -1
  907. package/dist/integrations/state/project.js +0 -13
  908. package/dist/integrations/state/project.js.map +0 -1
  909. package/dist/integrations/state/report.js +0 -626
  910. package/dist/integrations/state/report.js.map +0 -1
  911. package/dist/integrations/state/retention.js +0 -18
  912. package/dist/integrations/state/retention.js.map +0 -1
  913. package/dist/integrations/subagents/NamzuCliAgent.js +0 -9
  914. package/dist/integrations/subagents/NamzuCliAgent.js.map +0 -1
  915. package/dist/integrations/subagents/activity.js +0 -759
  916. package/dist/integrations/subagents/activity.js.map +0 -1
  917. package/dist/integrations/subagents/batches.js +0 -172
  918. package/dist/integrations/subagents/batches.js.map +0 -1
  919. package/dist/integrations/subagents/definitions.js +0 -26
  920. package/dist/integrations/subagents/definitions.js.map +0 -1
  921. package/dist/integrations/subagents/model-effort.js +0 -12
  922. package/dist/integrations/subagents/model-effort.js.map +0 -1
  923. package/dist/integrations/subagents/parent.js +0 -47
  924. package/dist/integrations/subagents/parent.js.map +0 -1
  925. package/dist/integrations/subagents/policy.js +0 -3
  926. package/dist/integrations/subagents/policy.js.map +0 -1
  927. package/dist/integrations/subagents/replay.js +0 -295
  928. package/dist/integrations/subagents/replay.js.map +0 -1
  929. package/dist/integrations/subagents/runtime.js +0 -1317
  930. package/dist/integrations/subagents/runtime.js.map +0 -1
  931. package/dist/integrations/subagents/saved-agents.js +0 -102
  932. package/dist/integrations/subagents/saved-agents.js.map +0 -1
  933. package/dist/integrations/subagents/slash.js +0 -45
  934. package/dist/integrations/subagents/slash.js.map +0 -1
  935. package/dist/integrations/subagents/worktree-driver.js +0 -72
  936. package/dist/integrations/subagents/worktree-driver.js.map +0 -1
  937. package/dist/integrations/telemetry/session-export.js +0 -119
  938. package/dist/integrations/telemetry/session-export.js.map +0 -1
  939. package/dist/integrations/trust/store.js +0 -73
  940. package/dist/integrations/trust/store.js.map +0 -1
  941. package/dist/integrations/updates.js +0 -115
  942. package/dist/integrations/updates.js.map +0 -1
  943. package/dist/integrations/web/exa-search.js +0 -154
  944. package/dist/integrations/web/exa-search.js.map +0 -1
  945. package/dist/integrations/web/open-url.js +0 -73
  946. package/dist/integrations/web/open-url.js.map +0 -1
  947. package/dist/integrations/web/search.js +0 -68
  948. package/dist/integrations/web/search.js.map +0 -1
  949. package/dist/integrations/worktrees/managed.js +0 -231
  950. package/dist/integrations/worktrees/managed.js.map +0 -1
  951. package/dist/logging.js +0 -115
  952. package/dist/logging.js.map +0 -1
  953. package/dist/memory/io.js +0 -177
  954. package/dist/memory/io.js.map +0 -1
  955. package/dist/memory/presentation.js +0 -76
  956. package/dist/memory/presentation.js.map +0 -1
  957. package/dist/memory/store.js +0 -180
  958. package/dist/memory/store.js.map +0 -1
  959. package/dist/memory/typed.js +0 -336
  960. package/dist/memory/typed.js.map +0 -1
  961. package/dist/output/formatter.js +0 -16
  962. package/dist/output/formatter.js.map +0 -1
  963. package/dist/output/index.js +0 -22
  964. package/dist/output/index.js.map +0 -1
  965. package/dist/output/json.js +0 -51
  966. package/dist/output/json.js.map +0 -1
  967. package/dist/output/text.js +0 -50
  968. package/dist/output/text.js.map +0 -1
  969. package/dist/output/yaml.js +0 -26
  970. package/dist/output/yaml.js.map +0 -1
  971. package/dist/output-schema.js +0 -18
  972. package/dist/output-schema.js.map +0 -1
  973. package/dist/permissions/browser-sites.js +0 -270
  974. package/dist/permissions/browser-sites.js.map +0 -1
  975. package/dist/permissions/canonical-project.js +0 -13
  976. package/dist/permissions/canonical-project.js.map +0 -1
  977. package/dist/permissions/checks.js +0 -128
  978. package/dist/permissions/checks.js.map +0 -1
  979. package/dist/permissions/headless-trust.js +0 -86
  980. package/dist/permissions/headless-trust.js.map +0 -1
  981. package/dist/permissions/live-mode.js +0 -62
  982. package/dist/permissions/live-mode.js.map +0 -1
  983. package/dist/permissions/mode.js +0 -65
  984. package/dist/permissions/mode.js.map +0 -1
  985. package/dist/permissions/rules.js +0 -358
  986. package/dist/permissions/rules.js.map +0 -1
  987. package/dist/release-notes.js +0 -64
  988. package/dist/release-notes.js.map +0 -1
  989. package/dist/resume-invocation.js +0 -24
  990. package/dist/resume-invocation.js.map +0 -1
  991. package/dist/schedule/build.js +0 -374
  992. package/dist/schedule/build.js.map +0 -1
  993. package/dist/schedule/changes.js +0 -78
  994. package/dist/schedule/changes.js.map +0 -1
  995. package/dist/schedule/commands/add.js +0 -603
  996. package/dist/schedule/commands/add.js.map +0 -1
  997. package/dist/schedule/commands/args.js +0 -80
  998. package/dist/schedule/commands/args.js.map +0 -1
  999. package/dist/schedule/commands/confirm-prompt.js +0 -21
  1000. package/dist/schedule/commands/confirm-prompt.js.map +0 -1
  1001. package/dist/schedule/commands/lifecycle.js +0 -586
  1002. package/dist/schedule/commands/lifecycle.js.map +0 -1
  1003. package/dist/schedule/commands/list.js +0 -260
  1004. package/dist/schedule/commands/list.js.map +0 -1
  1005. package/dist/schedule/commands/logs.js +0 -106
  1006. package/dist/schedule/commands/logs.js.map +0 -1
  1007. package/dist/schedule/commands/service.js +0 -458
  1008. package/dist/schedule/commands/service.js.map +0 -1
  1009. package/dist/schedule/daemon/daemon.js +0 -1265
  1010. package/dist/schedule/daemon/daemon.js.map +0 -1
  1011. package/dist/schedule/daemon/endpoint.js +0 -158
  1012. package/dist/schedule/daemon/endpoint.js.map +0 -1
  1013. package/dist/schedule/daemon/exit.js +0 -8
  1014. package/dist/schedule/daemon/exit.js.map +0 -1
  1015. package/dist/schedule/daemon/log.js +0 -53
  1016. package/dist/schedule/daemon/log.js.map +0 -1
  1017. package/dist/schedule/daemon/notify.js +0 -158
  1018. package/dist/schedule/daemon/notify.js.map +0 -1
  1019. package/dist/schedule/daemon/retention.js +0 -46
  1020. package/dist/schedule/daemon/retention.js.map +0 -1
  1021. package/dist/schedule/daemon/sessions.js +0 -52
  1022. package/dist/schedule/daemon/sessions.js.map +0 -1
  1023. package/dist/schedule/env.js +0 -106
  1024. package/dist/schedule/env.js.map +0 -1
  1025. package/dist/schedule/fire/browser-preflight.js +0 -73
  1026. package/dist/schedule/fire/browser-preflight.js.map +0 -1
  1027. package/dist/schedule/fire/calls.js +0 -114
  1028. package/dist/schedule/fire/calls.js.map +0 -1
  1029. package/dist/schedule/fire/fire.js +0 -681
  1030. package/dist/schedule/fire/fire.js.map +0 -1
  1031. package/dist/schedule/fire/result.js +0 -19
  1032. package/dist/schedule/fire/result.js.map +0 -1
  1033. package/dist/schedule/fire/run-script.js +0 -81
  1034. package/dist/schedule/fire/run-script.js.map +0 -1
  1035. package/dist/schedule/fire/unattended-note.js +0 -51
  1036. package/dist/schedule/fire/unattended-note.js.map +0 -1
  1037. package/dist/schedule/fire/wake-gate.js +0 -90
  1038. package/dist/schedule/fire/wake-gate.js.map +0 -1
  1039. package/dist/schedule/floor.js +0 -1561
  1040. package/dist/schedule/floor.js.map +0 -1
  1041. package/dist/schedule/folder.js +0 -84
  1042. package/dist/schedule/folder.js.map +0 -1
  1043. package/dist/schedule/paths.js +0 -53
  1044. package/dist/schedule/paths.js.map +0 -1
  1045. package/dist/schedule/policy.js +0 -414
  1046. package/dist/schedule/policy.js.map +0 -1
  1047. package/dist/schedule/resume-command.js +0 -72
  1048. package/dist/schedule/resume-command.js.map +0 -1
  1049. package/dist/schedule/script-check.js +0 -146
  1050. package/dist/schedule/script-check.js.map +0 -1
  1051. package/dist/schedule/script-shell.js +0 -5
  1052. package/dist/schedule/script-shell.js.map +0 -1
  1053. package/dist/schedule/service/detect.js +0 -29
  1054. package/dist/schedule/service/detect.js.map +0 -1
  1055. package/dist/schedule/service/index.js +0 -361
  1056. package/dist/schedule/service/index.js.map +0 -1
  1057. package/dist/schedule/service/launchd.js +0 -84
  1058. package/dist/schedule/service/launchd.js.map +0 -1
  1059. package/dist/schedule/service/manifest.js +0 -16
  1060. package/dist/schedule/service/manifest.js.map +0 -1
  1061. package/dist/schedule/service/names.js +0 -22
  1062. package/dist/schedule/service/names.js.map +0 -1
  1063. package/dist/schedule/service/quote.js +0 -64
  1064. package/dist/schedule/service/quote.js.map +0 -1
  1065. package/dist/schedule/service/runner.js +0 -31
  1066. package/dist/schedule/service/runner.js.map +0 -1
  1067. package/dist/schedule/service/systemd.js +0 -96
  1068. package/dist/schedule/service/systemd.js.map +0 -1
  1069. package/dist/schedule/service/windows-task.js +0 -199
  1070. package/dist/schedule/service/windows-task.js.map +0 -1
  1071. package/dist/schedule/service/wsl.js +0 -121
  1072. package/dist/schedule/service/wsl.js.map +0 -1
  1073. package/dist/schedule/store/atomic.js +0 -138
  1074. package/dist/schedule/store/atomic.js.map +0 -1
  1075. package/dist/schedule/store/claims.js +0 -57
  1076. package/dist/schedule/store/claims.js.map +0 -1
  1077. package/dist/schedule/store/digest.js +0 -139
  1078. package/dist/schedule/store/digest.js.map +0 -1
  1079. package/dist/schedule/store/history.js +0 -117
  1080. package/dist/schedule/store/history.js.map +0 -1
  1081. package/dist/schedule/store/jobs.js +0 -277
  1082. package/dist/schedule/store/jobs.js.map +0 -1
  1083. package/dist/schedule/store/state.js +0 -38
  1084. package/dist/schedule/store/state.js.map +0 -1
  1085. package/dist/schedule/types.js +0 -33
  1086. package/dist/schedule/types.js.map +0 -1
  1087. package/dist/schedule/visible-source.js +0 -59
  1088. package/dist/schedule/visible-source.js.map +0 -1
  1089. package/dist/skills/audit.js +0 -75
  1090. package/dist/skills/audit.js.map +0 -1
  1091. package/dist/skills/catalog.js +0 -226
  1092. package/dist/skills/catalog.js.map +0 -1
  1093. package/dist/skills/directory.js +0 -51
  1094. package/dist/skills/directory.js.map +0 -1
  1095. package/dist/skills/save.js +0 -344
  1096. package/dist/skills/save.js.map +0 -1
  1097. package/dist/skills/store.js +0 -351
  1098. package/dist/skills/store.js.map +0 -1
  1099. package/dist/termination.js +0 -143
  1100. package/dist/termination.js.map +0 -1
  1101. package/dist/test-support/toolset.js +0 -27
  1102. package/dist/test-support/toolset.js.map +0 -1
  1103. package/dist/tui/AgentExplorer.js +0 -789
  1104. package/dist/tui/AgentExplorer.js.map +0 -1
  1105. package/dist/tui/App.js +0 -8209
  1106. package/dist/tui/App.js.map +0 -1
  1107. package/dist/tui/BrandHeader.js +0 -14
  1108. package/dist/tui/BrandHeader.js.map +0 -1
  1109. package/dist/tui/Checklist.js +0 -90
  1110. package/dist/tui/Checklist.js.map +0 -1
  1111. package/dist/tui/ChoicePicker.js +0 -64
  1112. package/dist/tui/ChoicePicker.js.map +0 -1
  1113. package/dist/tui/Composer.js +0 -908
  1114. package/dist/tui/Composer.js.map +0 -1
  1115. package/dist/tui/ComposerFrame.js +0 -79
  1116. package/dist/tui/ComposerFrame.js.map +0 -1
  1117. package/dist/tui/CopyPicker.js +0 -19
  1118. package/dist/tui/CopyPicker.js.map +0 -1
  1119. package/dist/tui/EditPromptPicker.js +0 -17
  1120. package/dist/tui/EditPromptPicker.js.map +0 -1
  1121. package/dist/tui/EffortSlider.js +0 -134
  1122. package/dist/tui/EffortSlider.js.map +0 -1
  1123. package/dist/tui/LiveActivity.js +0 -89
  1124. package/dist/tui/LiveActivity.js.map +0 -1
  1125. package/dist/tui/Markdown.js +0 -137
  1126. package/dist/tui/Markdown.js.map +0 -1
  1127. package/dist/tui/PermissionOverlay.js +0 -278
  1128. package/dist/tui/PermissionOverlay.js.map +0 -1
  1129. package/dist/tui/Picker.js +0 -1310
  1130. package/dist/tui/Picker.js.map +0 -1
  1131. package/dist/tui/ProviderSetup.js +0 -125
  1132. package/dist/tui/ProviderSetup.js.map +0 -1
  1133. package/dist/tui/ResumePicker.js +0 -34
  1134. package/dist/tui/ResumePicker.js.map +0 -1
  1135. package/dist/tui/SaveSkillOverlay.js +0 -118
  1136. package/dist/tui/SaveSkillOverlay.js.map +0 -1
  1137. package/dist/tui/ScheduleReviewOverlay.js +0 -166
  1138. package/dist/tui/ScheduleReviewOverlay.js.map +0 -1
  1139. package/dist/tui/StatusBar.js +0 -182
  1140. package/dist/tui/StatusBar.js.map +0 -1
  1141. package/dist/tui/StatusPanel.js +0 -11
  1142. package/dist/tui/StatusPanel.js.map +0 -1
  1143. package/dist/tui/TaskList.js +0 -43
  1144. package/dist/tui/TaskList.js.map +0 -1
  1145. package/dist/tui/TextPrompt.js +0 -185
  1146. package/dist/tui/TextPrompt.js.map +0 -1
  1147. package/dist/tui/ToolOutputViewer.js +0 -39
  1148. package/dist/tui/ToolOutputViewer.js.map +0 -1
  1149. package/dist/tui/Transcript.js +0 -235
  1150. package/dist/tui/Transcript.js.map +0 -1
  1151. package/dist/tui/TrustPrompt.js +0 -13
  1152. package/dist/tui/TrustPrompt.js.map +0 -1
  1153. package/dist/tui/ViewportBound.js +0 -55
  1154. package/dist/tui/ViewportBound.js.map +0 -1
  1155. package/dist/tui/agent-transcript-rows.js +0 -115
  1156. package/dist/tui/agent-transcript-rows.js.map +0 -1
  1157. package/dist/tui/agent.js +0 -4235
  1158. package/dist/tui/agent.js.map +0 -1
  1159. package/dist/tui/browser-notices.js +0 -107
  1160. package/dist/tui/browser-notices.js.map +0 -1
  1161. package/dist/tui/choice-selection.js +0 -38
  1162. package/dist/tui/choice-selection.js.map +0 -1
  1163. package/dist/tui/compact-transcript.js +0 -46
  1164. package/dist/tui/compact-transcript.js.map +0 -1
  1165. package/dist/tui/consent-timing.js +0 -48
  1166. package/dist/tui/consent-timing.js.map +0 -1
  1167. package/dist/tui/conversation-evidence-view.js +0 -96
  1168. package/dist/tui/conversation-evidence-view.js.map +0 -1
  1169. package/dist/tui/conversation-history.js +0 -33
  1170. package/dist/tui/conversation-history.js.map +0 -1
  1171. package/dist/tui/copy-targets.js +0 -189
  1172. package/dist/tui/copy-targets.js.map +0 -1
  1173. package/dist/tui/credential-entry.js +0 -134
  1174. package/dist/tui/credential-entry.js.map +0 -1
  1175. package/dist/tui/edit-prompts.js +0 -35
  1176. package/dist/tui/edit-prompts.js.map +0 -1
  1177. package/dist/tui/exit-summary.js +0 -30
  1178. package/dist/tui/exit-summary.js.map +0 -1
  1179. package/dist/tui/external-editor.js +0 -169
  1180. package/dist/tui/external-editor.js.map +0 -1
  1181. package/dist/tui/hypermode.js +0 -58
  1182. package/dist/tui/hypermode.js.map +0 -1
  1183. package/dist/tui/index.js +0 -81
  1184. package/dist/tui/index.js.map +0 -1
  1185. package/dist/tui/live-window.js +0 -281
  1186. package/dist/tui/live-window.js.map +0 -1
  1187. package/dist/tui/log-pane.js +0 -100
  1188. package/dist/tui/log-pane.js.map +0 -1
  1189. package/dist/tui/login-prompt.js +0 -105
  1190. package/dist/tui/login-prompt.js.map +0 -1
  1191. package/dist/tui/logo.js +0 -9
  1192. package/dist/tui/logo.js.map +0 -1
  1193. package/dist/tui/markdown-block-cache.js +0 -76
  1194. package/dist/tui/markdown-block-cache.js.map +0 -1
  1195. package/dist/tui/markdown-table.js +0 -175
  1196. package/dist/tui/markdown-table.js.map +0 -1
  1197. package/dist/tui/markdown-wrap.js +0 -189
  1198. package/dist/tui/markdown-wrap.js.map +0 -1
  1199. package/dist/tui/markdownParser.js +0 -237
  1200. package/dist/tui/markdownParser.js.map +0 -1
  1201. package/dist/tui/mentions.js +0 -150
  1202. package/dist/tui/mentions.js.map +0 -1
  1203. package/dist/tui/model-catalogue-view.js +0 -75
  1204. package/dist/tui/model-catalogue-view.js.map +0 -1
  1205. package/dist/tui/model-choices.js +0 -157
  1206. package/dist/tui/model-choices.js.map +0 -1
  1207. package/dist/tui/model-search.js +0 -28
  1208. package/dist/tui/model-search.js.map +0 -1
  1209. package/dist/tui/model-selection-intent.js +0 -96
  1210. package/dist/tui/model-selection-intent.js.map +0 -1
  1211. package/dist/tui/model-switch-tool.js +0 -74
  1212. package/dist/tui/model-switch-tool.js.map +0 -1
  1213. package/dist/tui/model-switch.js +0 -106
  1214. package/dist/tui/model-switch.js.map +0 -1
  1215. package/dist/tui/notices.js +0 -27
  1216. package/dist/tui/notices.js.map +0 -1
  1217. package/dist/tui/open-browser.js +0 -147
  1218. package/dist/tui/open-browser.js.map +0 -1
  1219. package/dist/tui/permission-review.js +0 -858
  1220. package/dist/tui/permission-review.js.map +0 -1
  1221. package/dist/tui/plugin-view.js +0 -59
  1222. package/dist/tui/plugin-view.js.map +0 -1
  1223. package/dist/tui/provider-list.js +0 -327
  1224. package/dist/tui/provider-list.js.map +0 -1
  1225. package/dist/tui/provider-selection.js +0 -16
  1226. package/dist/tui/provider-selection.js.map +0 -1
  1227. package/dist/tui/schedule/host-commands.js +0 -428
  1228. package/dist/tui/schedule/host-commands.js.map +0 -1
  1229. package/dist/tui/schedule/integration.js +0 -150
  1230. package/dist/tui/schedule/integration.js.map +0 -1
  1231. package/dist/tui/schedule/loop-host.js +0 -153
  1232. package/dist/tui/schedule/loop-host.js.map +0 -1
  1233. package/dist/tui/schedule/resume.js +0 -333
  1234. package/dist/tui/schedule/resume.js.map +0 -1
  1235. package/dist/tui/schedule/startup.js +0 -121
  1236. package/dist/tui/schedule/startup.js.map +0 -1
  1237. package/dist/tui/schedule/tool-host.js +0 -619
  1238. package/dist/tui/schedule/tool-host.js.map +0 -1
  1239. package/dist/tui/selection-window.js +0 -37
  1240. package/dist/tui/selection-window.js.map +0 -1
  1241. package/dist/tui/shell-escape.js +0 -110
  1242. package/dist/tui/shell-escape.js.map +0 -1
  1243. package/dist/tui/skills/learning.js +0 -131
  1244. package/dist/tui/skills/learning.js.map +0 -1
  1245. package/dist/tui/skills/suggest-setting.js +0 -55
  1246. package/dist/tui/skills/suggest-setting.js.map +0 -1
  1247. package/dist/tui/skills/suggestion-ledger.js +0 -52
  1248. package/dist/tui/skills/suggestion-ledger.js.map +0 -1
  1249. package/dist/tui/slashCommands.js +0 -1587
  1250. package/dist/tui/slashCommands.js.map +0 -1
  1251. package/dist/tui/status-card.js +0 -30
  1252. package/dist/tui/status-card.js.map +0 -1
  1253. package/dist/tui/status-panel-layout.js +0 -42
  1254. package/dist/tui/status-panel-layout.js.map +0 -1
  1255. package/dist/tui/stream-blocks.js +0 -187
  1256. package/dist/tui/stream-blocks.js.map +0 -1
  1257. package/dist/tui/task-activity.js +0 -157
  1258. package/dist/tui/task-activity.js.map +0 -1
  1259. package/dist/tui/terminal-choice-text.js +0 -118
  1260. package/dist/tui/terminal-choice-text.js.map +0 -1
  1261. package/dist/tui/terminal-display.js +0 -65
  1262. package/dist/tui/terminal-display.js.map +0 -1
  1263. package/dist/tui/terminal-hyperlinks.js +0 -70
  1264. package/dist/tui/terminal-hyperlinks.js.map +0 -1
  1265. package/dist/tui/theme.js +0 -34
  1266. package/dist/tui/theme.js.map +0 -1
  1267. package/dist/tui/triggers/analyze.js +0 -221
  1268. package/dist/tui/triggers/analyze.js.map +0 -1
  1269. package/dist/tui/triggers/context-text.js +0 -44
  1270. package/dist/tui/triggers/context-text.js.map +0 -1
  1271. package/dist/tui/triggers/copy.js +0 -163
  1272. package/dist/tui/triggers/copy.js.map +0 -1
  1273. package/dist/tui/triggers/detect.js +0 -295
  1274. package/dist/tui/triggers/detect.js.map +0 -1
  1275. package/dist/tui/triggers/fold.js +0 -44
  1276. package/dist/tui/triggers/fold.js.map +0 -1
  1277. package/dist/tui/triggers/pattern.js +0 -243
  1278. package/dist/tui/triggers/pattern.js.map +0 -1
  1279. package/dist/tui/triggers/provenance.js +0 -98
  1280. package/dist/tui/triggers/provenance.js.map +0 -1
  1281. package/dist/tui/triggers/registry.js +0 -164
  1282. package/dist/tui/triggers/registry.js.map +0 -1
  1283. package/dist/tui/triggers/setting.js +0 -61
  1284. package/dist/tui/triggers/setting.js.map +0 -1
  1285. package/dist/tui/triggers/verbs.js +0 -140
  1286. package/dist/tui/triggers/verbs.js.map +0 -1
  1287. package/dist/tui/turn-interruption.js +0 -160
  1288. package/dist/tui/turn-interruption.js.map +0 -1
  1289. package/dist/tui/turn-limits-settings.js +0 -88
  1290. package/dist/tui/turn-limits-settings.js.map +0 -1
  1291. package/dist/tui/types.js +0 -7
  1292. package/dist/tui/types.js.map +0 -1
  1293. package/dist/tui/units.js +0 -20
  1294. package/dist/tui/units.js.map +0 -1
  1295. package/dist/tui/use-selection-index.js +0 -13
  1296. package/dist/tui/use-selection-index.js.map +0 -1
  1297. package/dist/tui/web-activity.js +0 -105
  1298. package/dist/tui/web-activity.js.map +0 -1
  1299. package/dist/tui/workspace-diff.js +0 -101
  1300. package/dist/tui/workspace-diff.js.map +0 -1
  1301. package/dist/tui/workspace-review.js +0 -67
  1302. package/dist/tui/workspace-review.js.map +0 -1
  1303. package/dist/user-commands/store.js +0 -235
  1304. package/dist/user-commands/store.js.map +0 -1
  1305. package/dist/version.js +0 -23
  1306. package/dist/version.js.map +0 -1
@@ -0,0 +1,1479 @@
1
+ import { createRequire as __namzuCreateRequire } from 'node:module';
2
+ const require = __namzuCreateRequire(import.meta.url);
3
+ import {
4
+ isBrowserProfileName
5
+ } from "./chunk-WHODOMXA.js";
6
+ import {
7
+ canonicalBrowserSiteKey,
8
+ compileBrowserSites
9
+ } from "./chunk-YYQJIECC.js";
10
+ import {
11
+ compilePermissions,
12
+ isPermissionEffect
13
+ } from "./chunk-NIPHHZ5G.js";
14
+ import {
15
+ BROWSER_ACT_TOOL_NAME,
16
+ BROWSER_TOOL_NAME,
17
+ builtinCommandArguments,
18
+ commandArgumentOf,
19
+ lexShellCommandLine,
20
+ nestedShellCommand,
21
+ programPositions
22
+ } from "./chunk-K5HARZ7G.js";
23
+ import {
24
+ __name
25
+ } from "./chunk-76FLAFCG.js";
26
+
27
+ // src/schedule/policy.ts
28
+ import { homedir } from "node:os";
29
+
30
+ // src/schedule/floor.ts
31
+ var READ_ONLY_VERBS = ["list", "show", "status", "history", "logs"];
32
+ function floorRefusal(finding) {
33
+ return `the scheduled-run floor refused this call: ${finding.detail}. It holds for every scheduled run, so rewording the call will not help`;
34
+ }
35
+ __name(floorRefusal, "floorRefusal");
36
+ var DENY_ONLY = /* @__PURE__ */ new WeakSet();
37
+ function isFloorRule(rule) {
38
+ return DENY_ONLY.has(rule);
39
+ }
40
+ __name(isFloorRule, "isFloorRule");
41
+ function scheduledRunFloorRule(options) {
42
+ const floor = new Floor(options);
43
+ const rule = {
44
+ type: "predicate",
45
+ description: `the scheduled-run floor: a scheduled run may not stop, disable or remove the scheduler, run a \`namzu schedule\` subcommand other than ${READ_ONLY_VERBS.join(", ")}, or name NAMZU_HOME (${options.namzuHome}) or the Windows browser\u2019s profile folder (%LOCALAPPDATA%\\namzu) in any argument. It holds for every scheduled run, so rewording the call will not help`,
46
+ decide: /* @__PURE__ */ __name((call) => floor.find(call) === null ? null : "deny", "decide"),
47
+ // Asked only after `decide` denied, so the reading is done twice for a
48
+ // refused call and once for every other.
49
+ describe: /* @__PURE__ */ __name((call) => {
50
+ const finding = floor.find(call);
51
+ return finding ? floorRefusal(finding) : null;
52
+ }, "describe")
53
+ };
54
+ DENY_ONLY.add(rule);
55
+ return rule;
56
+ }
57
+ __name(scheduledRunFloorRule, "scheduledRunFloorRule");
58
+ var SYSTEMCTL_VERBS_WITH_UNIT = /* @__PURE__ */ new Set([
59
+ "stop",
60
+ "disable",
61
+ "mask",
62
+ "edit",
63
+ "kill",
64
+ "revert",
65
+ "freeze",
66
+ "set-property",
67
+ "clean"
68
+ ]);
69
+ var SYSTEMCTL_VERBS_ALONE = /* @__PURE__ */ new Set(["isolate", "exit"]);
70
+ var LAUNCHCTL_VERBS = /* @__PURE__ */ new Set(["bootout", "unload", "remove", "disable", "kill", "stop"]);
71
+ var SCHTASKS_SWITCH = /^[/-](?:delete|change|end)$/;
72
+ var DBUS_TOOLS = /* @__PURE__ */ new Set(["busctl", "dbus-send", "gdbus"]);
73
+ var JS_RUNTIMES = /* @__PURE__ */ new Set([
74
+ "node",
75
+ "nodejs",
76
+ "npx",
77
+ "pnpx",
78
+ "bunx",
79
+ "bun",
80
+ "deno",
81
+ "tsx",
82
+ "ts-node",
83
+ "npm",
84
+ "pnpm",
85
+ "yarn"
86
+ ]);
87
+ var CLI_ENTRY = /^bin(?:\.[cm]?js)?$/;
88
+ var SHELLS = /* @__PURE__ */ new Set([
89
+ "sh",
90
+ "bash",
91
+ "dash",
92
+ "zsh",
93
+ "ksh",
94
+ "ash",
95
+ "mksh",
96
+ "busybox",
97
+ "fish",
98
+ "csh",
99
+ "tcsh",
100
+ "pwsh",
101
+ "powershell",
102
+ "cmd",
103
+ "wsl"
104
+ ]);
105
+ var INTERPRETERS = /^(?:python[0-9.]*|pypy[0-9.]*|node|nodejs|deno|bun|perl[0-9.]*|ruby|php[0-9.]*|lua[0-9.]*|luajit|osascript|awk|gawk|mawk|nawk|sed|gsed|tclsh|wish|expect|eval|source|xargs|parallel|watch|su|runuser|ssh|script|flock|at|batch|crontab)$/;
106
+ var STRING_OPTIONS = {
107
+ sudo: /^-(?:[a-z]*[si][a-z]*|-shell|-login)$/,
108
+ env: /^-(?:[a-z]*s[a-z]*|-split-string(?:=.*)?)$/i
109
+ };
110
+ var POWERSHELL_NAMES = /* @__PURE__ */ new Set(["powershell", "pwsh"]);
111
+ var ENCODED_COMMAND_FLAG = /^-e(?:n(?:c(?:o(?:d(?:e(?:d(?:c(?:o(?:m(?:m(?:a(?:n(?:d)?)?)?)?)?)?)?)?)?)?)?)?)?$/i;
112
+ var NOT_READ_ONLY = `a \`namzu schedule\` subcommand other than ${READ_ONLY_VERBS.join(", ")}`;
113
+ var NAME_CHAR = /[a-z0-9._-]/;
114
+ function lower(text) {
115
+ return text.toLowerCase();
116
+ }
117
+ __name(lower, "lower");
118
+ function commandName(value) {
119
+ const cut = Math.max(value.lastIndexOf("/"), value.lastIndexOf("\\"));
120
+ const base = lower(cut < 0 ? value : value.slice(cut + 1));
121
+ return base.endsWith(".exe") ? base.slice(0, -4) : base;
122
+ }
123
+ __name(commandName, "commandName");
124
+ function shown(text, max = 80) {
125
+ const flat = text.replace(/\s*\n\s*/g, " \u23CE ");
126
+ const cut = [...flat].length > max ? `${[...flat].slice(0, max - 1).join("")}\u2026` : flat;
127
+ return cut.includes("`") ? `\`\` ${cut} \`\`` : `\`${cut}\``;
128
+ }
129
+ __name(shown, "shown");
130
+ function unlocale(value) {
131
+ return value.includes('$"') ? value.replace(
132
+ /\$"((?:[^"\\]|\\.)*)"/g,
133
+ (_, inner) => inner.replace(/\\([$`"\\\n])/g, "$1")
134
+ ) : value;
135
+ }
136
+ __name(unlocale, "unlocale");
137
+ function localeOnly(value, catalogue) {
138
+ return !catalogue && value.includes('$"') && !/[$`*?[{~]/.test(unlocale(value));
139
+ }
140
+ __name(localeOnly, "localeOnly");
141
+ function wordsOf(command, catalogue) {
142
+ return command.words.map((w) => {
143
+ const text = w.expands ? unlocale(w.value) : w.value;
144
+ return { text: lower(text), wild: w.expands && !localeOnly(w.value, catalogue) };
145
+ });
146
+ }
147
+ __name(wordsOf, "wordsOf");
148
+ function reachesScheduler(command, words, daemonCommandLine, dialect) {
149
+ const n = words.length;
150
+ const find = /* @__PURE__ */ __name((from, test) => {
151
+ for (let i = from; i < n; i++) if (test(words[i], i)) return i;
152
+ return -1;
153
+ }, "find");
154
+ const heads = /* @__PURE__ */ new Set();
155
+ for (const position of programPositions(command, dialect)) {
156
+ if (position.word === void 0) continue;
157
+ const idx = command.words.indexOf(position.word);
158
+ if (idx >= 0) heads.add(idx);
159
+ }
160
+ const named = /* @__PURE__ */ __name((name) => (w, i) => w.wild && heads.has(i) || commandName(w.text) === name, "named");
161
+ const namesNamzu = /* @__PURE__ */ __name((w) => w.wild || w.text.includes("namzu"), "namesNamzu");
162
+ const systemctl = find(0, named("systemctl"));
163
+ if (systemctl >= 0) {
164
+ if (find(systemctl + 1, (w) => !w.wild && SYSTEMCTL_VERBS_ALONE.has(w.text)) >= 0)
165
+ return "stops every service, the scheduler with them";
166
+ const verb = find(systemctl + 1, (w) => w.wild || SYSTEMCTL_VERBS_WITH_UNIT.has(w.text));
167
+ if (verb >= 0 && find(verb + 1, (u) => namesNamzu(u) || /[*?[]/.test(u.text)) >= 0)
168
+ return "stops or disables the scheduler\u2019s service";
169
+ }
170
+ const launchctl = find(0, named("launchctl"));
171
+ if (launchctl >= 0) {
172
+ const verb = find(launchctl + 1, (w) => w.wild || LAUNCHCTL_VERBS.has(w.text));
173
+ if (verb >= 0 && find(verb + 1, namesNamzu) >= 0) return "removes the scheduler\u2019s launchd agent";
174
+ }
175
+ const schtasks = find(0, named("schtasks"));
176
+ if (schtasks >= 0) {
177
+ const rest = words.slice(schtasks + 1);
178
+ if (rest.some((w) => w.wild || SCHTASKS_SWITCH.test(w.text)) && rest.some(namesNamzu))
179
+ return "deletes, changes or ends the scheduler\u2019s task";
180
+ }
181
+ const killer = find(0, (w, i) => named("pkill")(w, i) || named("killall")(w, i));
182
+ if (killer >= 0) {
183
+ const kills = "has a pattern that could match the scheduler\u2019s process";
184
+ const full = words.slice(killer + 1).some((w) => /^-[a-z]*f/.test(w.text) || w.text === "--full");
185
+ for (let i = killer + 1; i < n; i++) {
186
+ const w = words[i];
187
+ if (w.wild) return kills;
188
+ if (w.text.startsWith("-")) continue;
189
+ if (/[.*+?^$|()[\]{}\\]/.test(w.text)) return kills;
190
+ if (w.text.includes("namzu") || w.text.includes("schedul")) return kills;
191
+ if ("node".includes(w.text) || full && daemonCommandLine.includes(w.text)) return kills;
192
+ }
193
+ }
194
+ const dbus = find(0, (w, i) => w.wild && heads.has(i) || DBUS_TOOLS.has(commandName(w.text)));
195
+ if (dbus >= 0 && find(dbus + 1, namesNamzu) >= 0) return "calls systemd about a namzu unit";
196
+ const strong = find(0, (w) => commandName(w.text) === "namzu" || w.text.includes("@namzu/cli"));
197
+ const weak = find(
198
+ 0,
199
+ (w) => CLI_ENTRY.test(commandName(w.text)) || JS_RUNTIMES.has(commandName(w.text))
200
+ );
201
+ if (strong >= 0 && find(strong + 1, (w) => w.wild) >= 0)
202
+ return "passes the CLI a word that expands at runtime, which could be a `schedule` subcommand";
203
+ const cli = strong < 0 ? weak : weak < 0 ? strong : Math.min(strong, weak);
204
+ if (cli >= 0) {
205
+ for (let i = cli + 1; i < n; i++) {
206
+ if (words[i].text !== "schedule" || words[i].wild) continue;
207
+ const verb = words[i + 1];
208
+ if (verb === void 0) continue;
209
+ if (verb.wild) return "runs a `schedule` subcommand that expands at runtime";
210
+ if (!READ_ONLY_VERBS.includes(verb.text))
211
+ return `runs \`schedule ${verb.text}\`, ${NOT_READ_ONLY}`;
212
+ }
213
+ }
214
+ return null;
215
+ }
216
+ __name(reachesScheduler, "reachesScheduler");
217
+ function runsUnreadText(command) {
218
+ const words = command.words;
219
+ const head = command.assignments;
220
+ const names = words.map((w) => w.expands ? "" : commandName(w.value));
221
+ const nested = nestedShellCommand(words.slice(head));
222
+ const readTo = nested !== null && "payload" in nested ? head + (commandName(words[head].value) === "busybox" ? 1 : 0) : -1;
223
+ for (let i = 0; i < words.length; i++) {
224
+ const name = names[i];
225
+ if (name === "") continue;
226
+ const program = shown(words[i].value);
227
+ if (INTERPRETERS.test(name)) return `${program} runs text as code`;
228
+ if (i === head && name === ".") return "`.` runs a file as commands";
229
+ if (i === head && name === "trap") {
230
+ const action = words.slice(i + 1).find((w) => w.expands || w.value !== "-l" && w.value !== "-p" && w.value !== "--");
231
+ if (action !== void 0)
232
+ return `${program} runs its action as a command when the signal fires`;
233
+ }
234
+ if (SHELLS.has(name) && !(i >= head && i <= readTo))
235
+ return `${program} runs commands the floor does not read`;
236
+ }
237
+ for (const [program, option] of Object.entries(STRING_OPTIONS)) {
238
+ const flag = words.find((w) => !w.expands && option.test(w.value));
239
+ if (names.includes(program) && flag !== void 0)
240
+ return `\`${program} ${flag.value}\` runs a string as commands`;
241
+ }
242
+ return null;
243
+ }
244
+ __name(runsUnreadText, "runsUnreadText");
245
+ function encodedCommandCall(command) {
246
+ const words = command.words;
247
+ for (let i = command.assignments; i < words.length; i++) {
248
+ const word = words[i];
249
+ if (word.expands || !POWERSHELL_NAMES.has(commandName(word.value))) continue;
250
+ const flag = words.slice(i + 1).find((w) => !w.expands && ENCODED_COMMAND_FLAG.test(w.value));
251
+ if (flag !== void 0) return { program: word, flag };
252
+ }
253
+ return null;
254
+ }
255
+ __name(encodedCommandCall, "encodedCommandCall");
256
+ function normalize(text) {
257
+ const out = [];
258
+ const parts = text.replace(/\\/g, "/").split("/");
259
+ for (let i = 0; i < parts.length; i++) {
260
+ const part = parts[i];
261
+ if (part === "" && i > 0) continue;
262
+ if (part === ".") continue;
263
+ if (part === "..") {
264
+ const last = out.at(-1);
265
+ if (last === "") continue;
266
+ if (last !== void 0 && last !== "..") {
267
+ out.pop();
268
+ continue;
269
+ }
270
+ }
271
+ out.push(part);
272
+ }
273
+ if (out.length === 1 && out[0] === "") return "/";
274
+ return out.join("/");
275
+ }
276
+ __name(normalize, "normalize");
277
+ function isAbsolute(path) {
278
+ return path.startsWith("/") || path.startsWith("\\") || /^[a-z]:[\\/]/.test(path);
279
+ }
280
+ __name(isAbsolute, "isAbsolute");
281
+ function join(dir, rel) {
282
+ return normalize(`${dir}/${rel}`);
283
+ }
284
+ __name(join, "join");
285
+ function containsPath(text, home) {
286
+ let at = text.indexOf(home);
287
+ while (at >= 0) {
288
+ const before = at === 0 ? "" : text[at - 1];
289
+ const after = text[at + home.length] ?? "";
290
+ if (!NAME_CHAR.test(before) && !NAME_CHAR.test(after)) return true;
291
+ at = text.indexOf(home, at + 1);
292
+ }
293
+ return false;
294
+ }
295
+ __name(containsPath, "containsPath");
296
+ var NOWHERE = { dirs: [], unknown: true };
297
+ var UNKNOWN = { values: [], unknown: true };
298
+ var MAX_ALTERNATIVES = 64;
299
+ var TooMany = class extends Error {
300
+ static {
301
+ __name(this, "TooMany");
302
+ }
303
+ };
304
+ var PROFILE_SEGMENTS = ["appdata", "local", "namzu"];
305
+ var PROFILE_TAIL = PROFILE_SEGMENTS.join("/");
306
+ var LOCAL_APP_DATA = "c:/users/%username%/appdata/local";
307
+ function spellLocalAppData(text) {
308
+ return text.includes("localappdata") ? text.replace(/%localappdata%|\$\{?(?:env:)?localappdata(?![a-z0-9_])\}?/g, LOCAL_APP_DATA) : text;
309
+ }
310
+ __name(spellLocalAppData, "spellLocalAppData");
311
+ function namesProfile(text) {
312
+ return containsPath(text, PROFILE_TAIL);
313
+ }
314
+ __name(namesProfile, "namesProfile");
315
+ var WILD = /[*?[$`{]/;
316
+ var WILD_RUN = /\$\{[^}]*\}?|\$[a-z0-9_]*|`[^`]*`?|\[[^\]]*\]?|[*?{}]/;
317
+ function mayBe(segment, name) {
318
+ if (!WILD.test(segment)) return segment === name;
319
+ const pieces = segment.split(WILD_RUN);
320
+ const first = pieces[0];
321
+ const last = pieces.at(-1);
322
+ if (!name.startsWith(first) || !name.endsWith(last)) return false;
323
+ let at = first.length;
324
+ for (const piece of pieces.slice(1, -1)) {
325
+ const found = name.indexOf(piece, at);
326
+ if (found < 0) return false;
327
+ at = found + piece.length;
328
+ }
329
+ return at <= name.length - last.length;
330
+ }
331
+ __name(mayBe, "mayBe");
332
+ function mayNameProfile(text) {
333
+ const segments = text.split("/");
334
+ for (let i = 0; i + PROFILE_SEGMENTS.length <= segments.length; i++) {
335
+ const run = segments.slice(i, i + PROFILE_SEGMENTS.length);
336
+ if (!run.every((segment, k) => mayBe(segment, PROFILE_SEGMENTS[k]))) continue;
337
+ if (run.some((segment) => segment.split(WILD_RUN).some((piece) => piece !== ""))) return true;
338
+ }
339
+ return false;
340
+ }
341
+ __name(mayNameProfile, "mayNameProfile");
342
+ function endsShortOfProfile(path) {
343
+ const segments = path.split("/");
344
+ const n = segments.length;
345
+ const last = segments[n - 1];
346
+ return n >= 3 && segments[n - 3] === "appdata" && segments[n - 2] === "local" && last !== "" && last !== "namzu" && "namzu".startsWith(last);
347
+ }
348
+ __name(endsShortOfProfile, "endsShortOfProfile");
349
+ var SCHEDULE_WORD = /(?:^|[\s,;([{|&=])schedule(?=$|[\s,;)\]}|&])/g;
350
+ var CLI_IN_TEXT = /namzu|bin\.[cm]?js|(?:^|[^a-z0-9_-])(?:node|nodejs|npx|pnpx|bunx|bun|deno|tsx|ts-node|npm|pnpm|yarn)(?![a-z0-9_-])/;
351
+ var EXPANSION_IN_TEXT = /[$`]|%[a-z_][a-z0-9_]*%/;
352
+ var SERVICE_NAME_IN_TEXT = /namzu-scheduler[a-z0-9._-]*|com\.namzu\.[a-z0-9._-]*/;
353
+ var SERVICE_TOOL_IN_TEXT = /(?:^|[^a-z0-9_-])(systemctl|launchctl|schtasks|busctl|dbus-send|gdbus|(?:stop|disable|unregister|set)-scheduledtask|schedule\.service)(?![a-z0-9_-])/;
354
+ var PROCESS_KILLER_IN_TEXT = /(?:^|[^a-z0-9_-])(pkill|killall)(?![a-z0-9_-])/;
355
+ var HOME_VARIABLE_IN_TEXT = /(?:^|[^a-z0-9_])namzu_home(?![a-z0-9_])/;
356
+ var LOCAL_APP_DATA_IN_TEXT = /localappdata|localapplicationdata|(?:^|[^a-z0-9])appdata(?![a-z0-9])/;
357
+ var NAMZU_SEGMENT = /(?:^|[^a-z0-9_.-])namzu(?![a-z0-9_.-])/;
358
+ function escapeRegExp(text) {
359
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
360
+ }
361
+ __name(escapeRegExp, "escapeRegExp");
362
+ function scheduleSubcommand(text) {
363
+ for (const match of text.matchAll(SCHEDULE_WORD)) {
364
+ const after = text.slice((match.index ?? 0) + match[0].length);
365
+ const verb = /^[\s,]*([a-z0-9][a-z0-9_-]*)/.exec(after)?.[1];
366
+ if (verb !== void 0 && READ_ONLY_VERBS.includes(verb)) continue;
367
+ return verb === void 0 ? "schedule" : `schedule ${verb}`;
368
+ }
369
+ return null;
370
+ }
371
+ __name(scheduleSubcommand, "scheduleSubcommand");
372
+ var Floor = class {
373
+ static {
374
+ __name(this, "Floor");
375
+ }
376
+ home;
377
+ /** NAMZU_HOME as the operator wrote it, for a refusal. */
378
+ homeShown;
379
+ homeCore;
380
+ /** NAMZU_HOME's last segment, and the default's (`.namzu`), as path segments in text. */
381
+ homeSegments;
382
+ userHome;
383
+ folders;
384
+ daemonCommandLine;
385
+ builtinCommands;
386
+ constructor(options) {
387
+ this.home = normalize(lower(options.namzuHome));
388
+ this.homeShown = options.namzuHome;
389
+ this.userHome = normalize(lower(options.userHome));
390
+ this.folders = (options.folders ?? []).map((f) => normalize(lower(f)));
391
+ const last = this.home.split("/").at(-1) ?? "";
392
+ this.homeCore = last.replace(/^\.+/, "");
393
+ this.homeSegments = [.../* @__PURE__ */ new Set([".namzu", last])].filter((name) => name.replace(/^\.+/, "").length >= 3).map((name) => ({
394
+ name,
395
+ pattern: name.startsWith(".") ? new RegExp(`(?:^|[^a-z0-9_.-])${escapeRegExp(name)}(?![a-z0-9_.-])`) : new RegExp(`[/\\\\]${escapeRegExp(name)}(?![a-z0-9_.-])`)
396
+ }));
397
+ this.builtinCommands = builtinCommandArguments();
398
+ this.daemonCommandLine = lower(
399
+ options.daemonCommandLine ?? `${process.execPath} ${process.argv[1] ?? ""} schedule daemon`
400
+ );
401
+ }
402
+ /** What the floor protects, as a refusal names it. */
403
+ protectedWords(what) {
404
+ return what === "NAMZU_HOME" ? `NAMZU_HOME (${this.homeShown})` : "the Windows browser\u2019s profile folder (%LOCALAPPDATA%\\namzu)";
405
+ }
406
+ /** Why the floor denies the call and what matched, or null when it does not. */
407
+ find(call) {
408
+ const argument = call.toolDef ? commandArgumentOf(call.toolDef) : this.builtinCommands.get(call.toolName);
409
+ const input = call.toolInput;
410
+ let line;
411
+ if (argument !== void 0 && typeof input === "object" && input !== null) {
412
+ const value = input[argument];
413
+ if (typeof value === "string") line = value;
414
+ }
415
+ try {
416
+ const named = this.stringsName(input, line);
417
+ if (named !== null)
418
+ return {
419
+ reason: `names ${named.what}`,
420
+ detail: `${named.where} names ${this.protectedWords(named.what)}`
421
+ };
422
+ if (line !== void 0) return this.lineVerdict(line, call.commandDialect);
423
+ return null;
424
+ } catch (error) {
425
+ if (error instanceof TooMany)
426
+ return {
427
+ reason: "too many spellings",
428
+ detail: `a word in the command can be spelled more than ${MAX_ALTERNATIVES} ways once its variables are filled in, and the floor refuses rather than try them all`
429
+ };
430
+ throw error;
431
+ }
432
+ }
433
+ // ---- any tool -----------------------------------------------------------
434
+ /** Every string in the input but the command line, searched as text. */
435
+ stringsName(input, line) {
436
+ const stack = [
437
+ { value: input, at: "" }
438
+ ];
439
+ let skipped = false;
440
+ while (stack.length > 0) {
441
+ const { value, at, key } = stack.pop();
442
+ if (typeof value === "string") {
443
+ if (!skipped && value === line) {
444
+ skipped = true;
445
+ continue;
446
+ }
447
+ const where = key ? `the argument name ${shown(value)}` : at === "" ? "the input" : `the \`${at}\` argument`;
448
+ if (this.textNamesHome(value)) return { what: "NAMZU_HOME", where };
449
+ if (textNamesProfile(value)) return { what: "the browser profiles", where };
450
+ } else if (Array.isArray(value)) {
451
+ value.forEach((each, i) => stack.push({ value: each, at: `${at}[${i}]` }));
452
+ } else if (value !== null && typeof value === "object") {
453
+ for (const [name, each] of Object.entries(value)) {
454
+ const path = at === "" ? name : `${at}.${name}`;
455
+ stack.push({ value: name, at: path, key: true }, { value: each, at: path });
456
+ }
457
+ }
458
+ }
459
+ return null;
460
+ }
461
+ /**
462
+ * NAMZU_HOME in free text: as a path, through `~`, `$HOME`, `${HOME}` or
463
+ * `$NAMZU_HOME`, in any letter case; and again with quotes and
464
+ * backslashes dropped, as a shell would drop them.
465
+ */
466
+ textNamesHome(text) {
467
+ const plain = lower(text);
468
+ const unquoted = plain.replace(/\\\n/g, "").replace(/\$(?=["'])/g, "").replace(/["'\\]/g, "");
469
+ for (const variant of [plain, unquoted]) {
470
+ if (/\$\{?[!#]?namzu_home(?![a-z0-9_])/.test(variant)) return true;
471
+ const spelled = variant.replace(/\$\{home\}|\$home(?![a-z0-9_])/g, this.userHome).replace(/(^|[\s"'=:(<>|;&,`])~[a-z0-9._-]*(?=[/\\]|$|[\s"'])/g, `$1${this.userHome}`);
472
+ if (containsPath(normalize(spelled), this.home)) return true;
473
+ }
474
+ return false;
475
+ }
476
+ // ---- a command line -----------------------------------------------------
477
+ lineVerdict(line, dialect, depth = 0) {
478
+ if (dialect === "cmd")
479
+ return {
480
+ reason: "unsupported command dialect",
481
+ detail: "The scheduled-run floor cannot verify native CMD commands. Use an explicitly installed POSIX interpreter; unattended execution is refused."
482
+ };
483
+ const dialects = dialect === "bash" ? ["bash"] : ["sh", "bash"];
484
+ const readings = dialects.map((d) => lexShellCommandLine(line, { dialect: d }));
485
+ const catalogue = /textdomain/i.test(line);
486
+ const loops = /\b(?:while|until|for|select)\b/.test(line);
487
+ let unaccounted = null;
488
+ for (let i = 0; i < readings.length; i += 1) {
489
+ const reading = readings[i];
490
+ const finding = this.readingVerdict(reading, catalogue, loops, dialects[i]);
491
+ if (finding !== null) return finding;
492
+ if (reading.opaque) {
493
+ unaccounted ??= {
494
+ reason: "opaque line mentions a protected name",
495
+ why: `the floor cannot read the line (${reading.reasons[0] ?? "a construct it does not model"})`
496
+ };
497
+ continue;
498
+ }
499
+ for (const command of reading.commands) {
500
+ const unread = unreadCommand(command);
501
+ if (unread === null) continue;
502
+ unaccounted ??= { reason: "unread text mentions a protected name", why: unread };
503
+ break;
504
+ }
505
+ }
506
+ if (unaccounted === null) return null;
507
+ const trip = this.tripwire(line, readings);
508
+ if (trip !== null)
509
+ return {
510
+ reason: unaccounted.reason,
511
+ detail: `${unaccounted.why}, and it holds ${shown(trip.token)} (${trip.what})${whereIn(readings, trip.pattern ?? trip.token)}`
512
+ };
513
+ if (depth < MAX_TEXT_DEPTH)
514
+ for (const text of fedTexts(readings)) {
515
+ const inner = this.lineVerdict(text, "bash", depth + 1);
516
+ if (inner !== null)
517
+ return {
518
+ reason: unaccounted.reason,
519
+ detail: `${unaccounted.why}, and read as a command line, ${shown(text)}: ${inner.detail}`
520
+ };
521
+ }
522
+ return null;
523
+ }
524
+ /**
525
+ * The tripwire, for a line the lexer could not account for: something in
526
+ * its text that can reach what the floor protects, or null. Read in the
527
+ * line as written, with quotes and expansion marks dropped (and once more
528
+ * with backslashes dropped too), and in every word the lexer decoded:
529
+ *
530
+ * - `NAMZU_HOME` by name (`$NAMZU_HOME`, `%NAMZU_HOME%`,
531
+ * `os.environ['NAMZU_HOME']`), its last segment as a path segment
532
+ * (`.namzu`, always), or a path into it;
533
+ * - the Windows browser's profile folder, as a path, or `LOCALAPPDATA` (or
534
+ * `AppData`) with `namzu` as a segment or a string of its own;
535
+ * - the scheduler service's name (`namzu-scheduler…`, `com.namzu.…`);
536
+ * - a service tool (`systemctl`, `launchctl`, `schtasks`, the D-Bus tools,
537
+ * PowerShell's `*-ScheduledTask`) with `namzu` or a glob in the text,
538
+ * `systemctl isolate` or `exit`; `pkill` or `killall` anywhere, because
539
+ * a pattern can match the scheduler's `node` process without naming it;
540
+ * - `schedule` as a command word followed by anything but a read-only
541
+ * verb, when the text also names the CLI (`namzu`, `@namzu/cli`,
542
+ * `bin.js`, a JavaScript runtime) or holds an expansion that could.
543
+ *
544
+ * Nothing else: the product's name in a string (`MessageBox::Show('Namzu:
545
+ * scheduled job running')`) reaches none of them.
546
+ */
547
+ tripwire(line, readings) {
548
+ const plain = lower(line).replace(/\\\n/g, "");
549
+ const unquoted = plain.replace(/["'$`]/g, "");
550
+ const squashed = unquoted.replace(/\\/g, "");
551
+ const decoded = readings.flatMap((r) => r.commands.flatMap((c) => c.words.map((w) => lower(w.value)))).join(" ");
552
+ const texts = [squashed, unquoted, decoded];
553
+ const first = /* @__PURE__ */ __name((pattern) => {
554
+ for (const text of texts) {
555
+ const match = pattern.exec(text);
556
+ if (match) return match[1] ?? match[0].replace(/^[^a-z0-9%.]+/, "");
557
+ }
558
+ return null;
559
+ }, "first");
560
+ if (HOME_VARIABLE_IN_TEXT.test(plain) || first(HOME_VARIABLE_IN_TEXT) !== null)
561
+ return { token: "NAMZU_HOME", what: "the NAMZU_HOME variable" };
562
+ for (const { name, pattern } of this.homeSegments)
563
+ if (texts.some((text) => pattern.test(text)))
564
+ return { token: name, what: "NAMZU_HOME\u2019s folder name", pattern };
565
+ if (this.textNamesHome(line) || this.textNamesHome(decoded))
566
+ return { token: this.homeShown, what: "a path into NAMZU_HOME" };
567
+ if (textNamesProfile(line) || textNamesProfile(decoded))
568
+ return {
569
+ token: "%LOCALAPPDATA%\\namzu",
570
+ what: "a path into the Windows browser\u2019s profile folder"
571
+ };
572
+ const appData = first(LOCAL_APP_DATA_IN_TEXT);
573
+ if (appData !== null && texts.some((text) => NAMZU_SEGMENT.test(text)))
574
+ return {
575
+ token: `${appData} \u2026 namzu`,
576
+ what: "together, the Windows browser\u2019s profile folder"
577
+ };
578
+ const service = first(SERVICE_NAME_IN_TEXT);
579
+ if (service !== null) return { token: service, what: "the scheduler service\u2019s name" };
580
+ const tool = first(SERVICE_TOOL_IN_TEXT);
581
+ if (tool !== null) {
582
+ if (texts.some((text) => text.includes("namzu")))
583
+ return { token: `${tool} \u2026 namzu`, what: "a service tool with a namzu name" };
584
+ if (plain.includes("*"))
585
+ return { token: `${tool} \u2026 *`, what: "a service tool with a pattern that can match it" };
586
+ if (tool === "systemctl") {
587
+ const all = first(/(?:^|\s)(isolate|exit)(?![a-z0-9_-])/);
588
+ if (all !== null) return { token: `systemctl ${all}`, what: "which stops every service" };
589
+ }
590
+ }
591
+ const killer = first(PROCESS_KILLER_IN_TEXT);
592
+ if (killer !== null)
593
+ return {
594
+ token: killer,
595
+ what: "which kills by pattern, and the scheduler is a node process a pattern can match"
596
+ };
597
+ const cli = texts.some((text) => CLI_IN_TEXT.test(text)) || EXPANSION_IN_TEXT.test(plain.replace(/\$(?=['"])/g, ""));
598
+ if (cli)
599
+ for (const text of [squashed, decoded]) {
600
+ const subcommand = scheduleSubcommand(text);
601
+ if (subcommand !== null) return { token: subcommand, what: NOT_READ_ONLY };
602
+ }
603
+ return null;
604
+ }
605
+ readingVerdict(reading, catalogue, loops, dialect) {
606
+ for (const command of reading.commands) {
607
+ const encoded = encodedCommandCall(command);
608
+ if (encoded !== null)
609
+ return {
610
+ reason: "encoded command cannot be read at all",
611
+ detail: `${shown(encoded.program.value)} ${shown(encoded.flag.value)} runs a base64-encoded script the floor cannot read at all, so it is refused outright whatever it decodes to; use -Command '<literal text>' instead`
612
+ };
613
+ }
614
+ for (const command of reading.commands) {
615
+ const does = reachesScheduler(
616
+ command,
617
+ wordsOf(command, catalogue),
618
+ this.daemonCommandLine,
619
+ dialect
620
+ );
621
+ if (does !== null)
622
+ return {
623
+ reason: "scheduler command",
624
+ detail: `${shown(command.words.map((w) => w.text).join(" "))} ${does}`
625
+ };
626
+ }
627
+ const variables = this.assignments(reading);
628
+ const expanding = /* @__PURE__ */ __name((w) => w.expands && !localeOnly(w.value, catalogue), "expanding");
629
+ const expands = reading.commands.some((c) => c.words.some(expanding)) || reading.redirections.some((r) => expanding(r.target)) || reading.compoundWords.some(expanding);
630
+ const exported = reading.commands.some(
631
+ (c) => c.words.some((w) => !w.expands && EXPORTING.has(commandName(w.value)))
632
+ );
633
+ const names = /* @__PURE__ */ __name((what) => `names ${this.protectedWords(what)}`, "names");
634
+ const cwd = new Directories(this.folders);
635
+ if (loops)
636
+ for (const command of reading.commands)
637
+ cwd.after(command, (target) => this.spell(target, variables, cwd.current()), this.userHome);
638
+ const seen = /* @__PURE__ */ new Set();
639
+ const written = /* @__PURE__ */ new Set();
640
+ for (const command of reading.commands) {
641
+ const here = cwd.current();
642
+ const findExec = this.findExecFinding(command, variables, here, dialect);
643
+ if (findExec !== null) return findExec;
644
+ const executed = executedPath(command);
645
+ if (executed !== null && !executed.expands) {
646
+ for (const base of isAbsolute(executed.value) ? [""] : here.dirs) {
647
+ const path = base === "" ? normalize(executed.value) : join(base, executed.value);
648
+ if (written.has(path)) {
649
+ return {
650
+ reason: "runs a file the script wrote earlier",
651
+ detail: `${shown(command.text)} runs ${shown(executed.text)}, which an earlier command in this script wrote; its content cannot be verified, so it is refused rather than run unattended`
652
+ };
653
+ }
654
+ }
655
+ }
656
+ for (const target of writeTargets(command)) {
657
+ if (target.expands) continue;
658
+ for (const base of isAbsolute(target.value) ? [""] : here.dirs) {
659
+ written.add(base === "" ? normalize(target.value) : join(base, target.value));
660
+ }
661
+ }
662
+ const check2 = /* @__PURE__ */ __name((word) => this.wordNames(word, variables, here, expands), "check");
663
+ const standalone = command.words.length === command.assignments && !exported;
664
+ for (const [i, word] of command.words.entries()) {
665
+ if (standalone && i < command.assignments) continue;
666
+ const named = check2(word);
667
+ if (named !== null)
668
+ return {
669
+ reason: `word names ${named}`,
670
+ detail: `the argument ${shown(word.text)} ${names(named)}`
671
+ };
672
+ const assigned = assignedValue(word);
673
+ const value = assigned ? check2(assigned.word) : null;
674
+ if (value !== null)
675
+ return {
676
+ reason: `assigned value names ${value}`,
677
+ detail: `the value assigned in ${shown(word.text)} ${names(value)}`
678
+ };
679
+ }
680
+ for (const redirection of command.redirections) {
681
+ seen.add(redirection);
682
+ const named = redirectsTo(redirection) ? check2(redirection.target) : null;
683
+ if (named !== null)
684
+ return {
685
+ reason: `redirection names ${named}`,
686
+ detail: `the redirection ${shown(`${redirection.operator} ${redirection.target.text}`)} ${names(named)}`
687
+ };
688
+ }
689
+ cwd.after(command, (target) => this.spell(target, variables, cwd.current()), this.userHome);
690
+ }
691
+ const anywhere = cwd.current();
692
+ const check = /* @__PURE__ */ __name((word) => this.wordNames(word, variables, anywhere, expands), "check");
693
+ for (const redirection of reading.redirections) {
694
+ if (seen.has(redirection) || !redirectsTo(redirection)) continue;
695
+ const named = check(redirection.target);
696
+ if (named !== null)
697
+ return {
698
+ reason: `redirection names ${named}`,
699
+ detail: `the redirection ${shown(`${redirection.operator} ${redirection.target.text}`)} ${names(named)}`
700
+ };
701
+ }
702
+ for (const word of reading.compoundWords) {
703
+ const named = check(word);
704
+ if (named !== null)
705
+ return {
706
+ reason: `loop or case word names ${named}`,
707
+ detail: `the loop or case word ${shown(word.text)} ${names(named)}`
708
+ };
709
+ }
710
+ return null;
711
+ }
712
+ /** Literal values the line assigns to each variable (`X=…`, `export X=…`). */
713
+ assignments(reading) {
714
+ const found = /* @__PURE__ */ new Map();
715
+ const unknown = /* @__PURE__ */ new Set();
716
+ const record = /* @__PURE__ */ __name((word) => {
717
+ const value = assignedValue(word);
718
+ if (value === null) return;
719
+ const { name, append } = value;
720
+ const spellings = append ? [] : this.spell(value.word, /* @__PURE__ */ new Map(), NOWHERE);
721
+ if (spellings.length === 0 || spellings.some((s) => s.stop !== "end")) {
722
+ unknown.add(name);
723
+ return;
724
+ }
725
+ const values = found.get(name) ?? /* @__PURE__ */ new Set();
726
+ for (const s of spellings) values.add(s.known);
727
+ found.set(name, values);
728
+ }, "record");
729
+ for (const command of reading.commands) {
730
+ command.words.slice(0, command.assignments).forEach(record);
731
+ const head = command.words[command.assignments];
732
+ if (head && !head.expands && ["export", "declare", "typeset", "local", "readonly"].includes(head.value))
733
+ command.words.slice(command.assignments + 1).forEach(record);
734
+ }
735
+ const out = /* @__PURE__ */ new Map();
736
+ for (const [name, values] of found) {
737
+ if (values.size > 8) throw new TooMany();
738
+ out.set(name, { values: [...values], unknown: true });
739
+ }
740
+ for (const name of unknown) if (!out.has(name)) out.set(name, UNKNOWN);
741
+ return out;
742
+ }
743
+ /**
744
+ * A word's value with `~`, `$HOME`, `${HOME}`, `$NAMZU_HOME`, `$PWD` and
745
+ * the line's own literal assignments spelled out, one spelling per
746
+ * combination of the values each may hold.
747
+ */
748
+ spell(word, variables, cwd) {
749
+ if (!word.expands) return [{ known: lower(word.value), stop: "end", rest: "" }];
750
+ const value = unlocale(word.value.replace(/\\\n/g, ""));
751
+ const raw = word.text.replace(/\\\n/g, "");
752
+ const tildeFirst = /^~[A-Za-z0-9._-]*(?:\/|$)/.test(raw);
753
+ const tildeAssigned = /^[A-Za-z_][A-Za-z0-9_]*\+?=/.test(raw) && /[=:]~[A-Za-z0-9._-]*(?:[/:]|$)/.test(raw);
754
+ let open = [""];
755
+ const out = [];
756
+ const stopAll = /* @__PURE__ */ __name((stop, from) => {
757
+ const rest = lower(value.slice(from));
758
+ for (const known of open) out.push({ known: lower(known), stop, rest });
759
+ }, "stopAll");
760
+ let i = 0;
761
+ while (i < value.length && open.length > 0) {
762
+ const c = value[i];
763
+ if (c === "~" && (i === 0 && tildeFirst || (value[i - 1] === "=" || value[i - 1] === ":") && tildeAssigned)) {
764
+ let j = i + 1;
765
+ while (j < value.length && NAME_CHAR.test(lower(value[j]))) j++;
766
+ if (j === value.length || value[j] === "/") {
767
+ open = open.map((known) => known + this.userHome);
768
+ i = j;
769
+ continue;
770
+ }
771
+ }
772
+ if (c === "$") {
773
+ const simple = /^\$(?:([A-Za-z_][A-Za-z0-9_]*)|\{([A-Za-z_][A-Za-z0-9_]*)\})/.exec(
774
+ value.slice(i, i + 256)
775
+ );
776
+ if (simple) {
777
+ const name = simple[1] ?? simple[2];
778
+ const alternatives = name === "HOME" ? { values: [this.userHome], unknown: false } : name === "NAMZU_HOME" ? { values: [this.home], unknown: false } : name === "PWD" ? { values: cwd.dirs, unknown: cwd.unknown } : name === "LOCALAPPDATA" ? localAppData(variables.get(name)) : variables.get(name) ?? UNKNOWN;
779
+ i += simple[0].length;
780
+ if (alternatives.unknown) stopAll("unknown", i);
781
+ const next = [];
782
+ for (const known of open) for (const v of alternatives.values) next.push(known + v);
783
+ if (next.length + out.length > MAX_ALTERNATIVES) throw new TooMany();
784
+ open = next;
785
+ continue;
786
+ }
787
+ if (i + 1 < value.length) {
788
+ stopAll("unknown", i + 1);
789
+ return out;
790
+ }
791
+ }
792
+ if (c === "`" || c === "{") {
793
+ stopAll("unknown", i + 1);
794
+ return out;
795
+ }
796
+ if (c === "*" || c === "?" || c === "[") {
797
+ stopAll("glob", i);
798
+ return out;
799
+ }
800
+ open = open.map((known) => known + c);
801
+ i++;
802
+ }
803
+ stopAll("end", value.length);
804
+ return out;
805
+ }
806
+ inside(path) {
807
+ return path === this.home || path.startsWith(this.home === "/" ? "/" : `${this.home}/`);
808
+ }
809
+ /** The home segment right below `dir`, when `dir` is an ancestor of NAMZU_HOME. */
810
+ belowAncestor(dir) {
811
+ const prefix = dir === "/" ? "/" : `${dir}/`;
812
+ if (!this.home.startsWith(prefix)) return null;
813
+ return this.home.slice(prefix.length).split("/")[0] ?? "";
814
+ }
815
+ /** What a word names that the floor protects, or null. */
816
+ wordNames(word, variables, cwd, lineExpands) {
817
+ if (this.wordNamesHome(word, variables, cwd, lineExpands)) return "NAMZU_HOME";
818
+ if (this.wordNamesProfile(word, variables, cwd, lineExpands)) return "the browser profiles";
819
+ return null;
820
+ }
821
+ /**
822
+ * The Windows browser's profiles in a word, on the same spellings and
823
+ * directories as NAMZU_HOME. The root is known only by its last three
824
+ * segments, so a word with an unknown part is denied when its segments
825
+ * could still read `appdata/local/namzu` and one of them is spelled out,
826
+ * or when an unknown expansion is followed by a `namzu` segment.
827
+ */
828
+ wordNamesProfile(word, variables, cwd, lineExpands) {
829
+ for (const spelling of this.spell(word, variables, cwd)) {
830
+ const known = spellLocalAppData(spelling.known);
831
+ const rest = spellLocalAppData(spelling.rest);
832
+ const bases = isAbsolute(known) ? [""] : ["", ...cwd.dirs];
833
+ const inert = !/namzu|local|appdata|\.\.|[*?[$`{]/.test(known + rest);
834
+ for (const base of bases) {
835
+ if (inert && base !== "") {
836
+ if (namesProfile(base)) return true;
837
+ continue;
838
+ }
839
+ const at = /* @__PURE__ */ __name((text) => base === "" ? normalize(text) : join(base, text), "at");
840
+ if (spelling.stop === "end") {
841
+ const path = at(known);
842
+ if (namesProfile(path)) return true;
843
+ if (lineExpands && endsShortOfProfile(path)) return true;
844
+ continue;
845
+ }
846
+ if (mayNameProfile(at(`${known}*${rest}`))) return true;
847
+ }
848
+ if (spelling.stop === "unknown" && /(?:^|\/)namzu(?:\/|$)/.test(normalize(rest))) return true;
849
+ }
850
+ return false;
851
+ }
852
+ /** Whether text after an unknown expansion holds NAMZU_HOME's last segment as a path segment. */
853
+ restNamesHome(rest) {
854
+ let at = rest.indexOf(this.homeCore);
855
+ while (at >= 0) {
856
+ const before = at === 0 ? "" : rest[at - 1];
857
+ const after = rest[at + this.homeCore.length] ?? "";
858
+ if (/^[./\\]?$/.test(before) && !NAME_CHAR.test(after)) return true;
859
+ at = rest.indexOf(this.homeCore, at + 1);
860
+ }
861
+ return false;
862
+ }
863
+ wordNamesHome(word, variables, cwd, lineExpands) {
864
+ if (word.expands && /\$\{?[!#]?namzu_home(?![a-z0-9_])/i.test(word.value)) return true;
865
+ for (const spelling of this.spell(word, variables, cwd)) {
866
+ const { known } = spelling;
867
+ if (containsPath(normalize(known), this.home)) return true;
868
+ const bases = isAbsolute(known) ? [""] : cwd.dirs;
869
+ for (const base of bases) {
870
+ const path = base === "" ? normalize(known) : join(base, known);
871
+ if (spelling.stop === "end") {
872
+ if (this.inside(path)) return true;
873
+ if (lineExpands && path !== "/" && this.home.startsWith(path) && this.home[path.length] !== "/")
874
+ return true;
875
+ continue;
876
+ }
877
+ const slash = known.lastIndexOf("/");
878
+ const partial = known.slice(slash + 1);
879
+ const dir = slash < 0 ? base === "" ? null : base : base === "" ? normalize(known.slice(0, slash + 1) || "/") : join(base, known.slice(0, slash + 1));
880
+ if (dir === null) continue;
881
+ if (this.inside(dir)) return true;
882
+ const next = this.belowAncestor(dir);
883
+ if (next === null) continue;
884
+ if (partial === "") {
885
+ if (spelling.stop === "glob" && next.startsWith(".")) continue;
886
+ return true;
887
+ }
888
+ if (next.startsWith(partial)) return true;
889
+ }
890
+ if (spelling.stop !== "end" && this.homeCore.length >= 3 && this.restNamesHome(spelling.rest))
891
+ return true;
892
+ }
893
+ return false;
894
+ }
895
+ /**
896
+ * `find … -exec|-execdir|-ok|-okdir … ;|+`: the clause runs on every path
897
+ * `find` matches, substituted for `{}` — a placeholder no static reading
898
+ * can resolve. Refused when `{}` stands in that clause AND the search
899
+ * could plausibly reach a protected target: the root is unknown or is
900
+ * NAMZU_HOME itself or an ancestor of it (so `find` would recurse THROUGH
901
+ * it), a `-name`/`-iname`/`-path`/`-ipath` pattern could match NAMZU_HOME's
902
+ * own folder name, or the clause's own program is a tool that can stop or
903
+ * remove a service (`{}` there could name the scheduler's unit without
904
+ * ever spelling it in the line the floor can read).
905
+ */
906
+ findExecFinding(command, variables, cwd, dialect) {
907
+ const words = command.words;
908
+ const findAt = programPositions(command, dialect).map(
909
+ (position) => position.word && !position.word.expands && commandName(position.word.value) === "find" ? words.indexOf(position.word) : -1
910
+ ).find((index) => index >= 0);
911
+ if (findAt === void 0) return null;
912
+ const head = words[findAt];
913
+ const rootWords = [];
914
+ let i = findAt + 1;
915
+ while (i < words.length) {
916
+ const w = words[i];
917
+ if (!w.expands && (w.value.startsWith("-") || w.value === "(" || w.value === "!")) break;
918
+ rootWords.push(w);
919
+ i++;
920
+ }
921
+ const roots = rootWords.length > 0 ? rootWords : [{ text: ".", value: ".", expands: false, quoted: false, substitutes: false }];
922
+ const reachesHome = roots.some((root) => {
923
+ if (root.expands) return true;
924
+ for (const spelling of this.spell(root, variables, cwd)) {
925
+ if (spelling.stop !== "end") return true;
926
+ const bases = isAbsolute(spelling.known) ? [""] : cwd.dirs.length > 0 ? cwd.dirs : [""];
927
+ for (const base of bases) {
928
+ const path = base === "" ? normalize(spelling.known) : join(base, spelling.known);
929
+ if (this.inside(path) || this.belowAncestor(path) !== null) return true;
930
+ }
931
+ }
932
+ return false;
933
+ });
934
+ let filterMatchesHome = false;
935
+ for (let j = findAt; j < words.length; j++) {
936
+ const flag = words[j];
937
+ if (flag.expands || !/^-i?(?:name|path)$/.test(flag.value)) continue;
938
+ const pattern = words[j + 1];
939
+ if (!pattern || pattern.expands) continue;
940
+ if (this.homeSegments.some((seg) => mayBe(lower(pattern.value), seg.name))) {
941
+ filterMatchesHome = true;
942
+ break;
943
+ }
944
+ }
945
+ for (let j = findAt + 1; j < words.length; j++) {
946
+ const flag = words[j];
947
+ if (flag.expands || !/^-(?:exec|execdir|ok|okdir)$/.test(flag.value)) continue;
948
+ let k = j + 1;
949
+ let hasPlaceholder = false;
950
+ const clauseStart = k;
951
+ while (k < words.length) {
952
+ const w = words[k];
953
+ if (!w.expands && (w.value === ";" || w.value === "+")) break;
954
+ if (!w.expands) {
955
+ if (w.value.includes("{}")) hasPlaceholder = true;
956
+ }
957
+ k++;
958
+ }
959
+ const clauseCommand = {
960
+ ...command,
961
+ words: [head, flag, ...words.slice(clauseStart, k)],
962
+ assignments: 0
963
+ };
964
+ const toolIsSchedulerTool = programPositions(clauseCommand, dialect).slice(1).some(
965
+ (position) => position.unknown !== void 0 || position.word !== void 0 && SCHEDULER_EXEC_TOOLS.has(commandName(position.word.value))
966
+ );
967
+ if (hasPlaceholder && (reachesHome || filterMatchesHome || toolIsSchedulerTool)) {
968
+ const clauseText = words.slice(clauseStart, k).map((w) => w.text).join(" ");
969
+ const why = toolIsSchedulerTool ? "its clause\u2019s own program can stop or remove a service" : filterMatchesHome ? "a -name/-iname/-path/-ipath pattern could match NAMZU_HOME\u2019s own folder name" : "its search root is unknown, is NAMZU_HOME, or is an ancestor of it";
970
+ return {
971
+ reason: "find -exec reaches a protected target",
972
+ detail: `${shown(command.text)} runs \`${flag.value} ${clauseText}\` on whatever it finds, and ${why}; the floor cannot verify what {} will stand for`
973
+ };
974
+ }
975
+ j = k;
976
+ }
977
+ return null;
978
+ }
979
+ };
980
+ var SCHEDULER_EXEC_TOOLS = /* @__PURE__ */ new Set([
981
+ "systemctl",
982
+ "launchctl",
983
+ "schtasks",
984
+ "pkill",
985
+ "killall",
986
+ "busctl",
987
+ "dbus-send",
988
+ "gdbus"
989
+ ]);
990
+ function writeTargets(command) {
991
+ const targets = [];
992
+ for (const r of command.redirections) {
993
+ if (r.operator === ">" || r.operator === ">>") targets.push(r.target);
994
+ }
995
+ const words = command.words;
996
+ const head = words[command.assignments];
997
+ if (!head || head.expands) return targets;
998
+ const name = commandName(head.value);
999
+ const rest = words.slice(command.assignments + 1).filter((w) => w.expands || !w.value.startsWith("-"));
1000
+ if (name === "tee") targets.push(...rest);
1001
+ else if (name === "cp" || name === "mv") {
1002
+ const last = rest.at(-1);
1003
+ if (last) targets.push(last);
1004
+ }
1005
+ return targets;
1006
+ }
1007
+ __name(writeTargets, "writeTargets");
1008
+ function executedPath(command) {
1009
+ const words = command.words;
1010
+ const head = words[command.assignments];
1011
+ if (!head || head.expands) return null;
1012
+ const name = commandName(head.value);
1013
+ if (name === "sh" || name === "bash" || name === "." || name === "source") {
1014
+ const rest = words.slice(command.assignments + 1).filter((w) => w.expands || !w.value.startsWith("-"));
1015
+ return rest[0] ?? null;
1016
+ }
1017
+ if (!head.expands && head.value.includes("/")) return head;
1018
+ return null;
1019
+ }
1020
+ __name(executedPath, "executedPath");
1021
+ function assignedValue(word) {
1022
+ const text = word.text.replace(/\\\n/g, "");
1023
+ const match = /^([A-Za-z_][A-Za-z0-9_]*)(\+?)=/.exec(text);
1024
+ if (!match || !word.value.startsWith(match[0])) return null;
1025
+ return {
1026
+ name: match[1],
1027
+ append: match[2] === "+",
1028
+ word: {
1029
+ text: text.slice(match[0].length),
1030
+ value: word.value.slice(match[0].length),
1031
+ expands: word.expands,
1032
+ quoted: word.quoted,
1033
+ substitutes: word.substitutes
1034
+ }
1035
+ };
1036
+ }
1037
+ __name(assignedValue, "assignedValue");
1038
+ function localAppData(assigned) {
1039
+ return {
1040
+ values: [LOCAL_APP_DATA, ...assigned?.values ?? []],
1041
+ unknown: assigned?.unknown ?? false
1042
+ };
1043
+ }
1044
+ __name(localAppData, "localAppData");
1045
+ function textNamesProfile(text) {
1046
+ const plain = lower(text);
1047
+ const unquoted = plain.replace(/\\\n/g, "").replace(/\$(?=["'])/g, "").replace(/["']/g, "");
1048
+ for (const variant of [plain, unquoted])
1049
+ if (namesProfile(normalize(spellLocalAppData(variant)))) return true;
1050
+ return false;
1051
+ }
1052
+ __name(textNamesProfile, "textNamesProfile");
1053
+ var EXPORTING = /* @__PURE__ */ new Set([
1054
+ "export",
1055
+ "declare",
1056
+ "typeset",
1057
+ "local",
1058
+ "readonly",
1059
+ "set",
1060
+ "env",
1061
+ "printenv"
1062
+ ]);
1063
+ function redirectsTo(redirection) {
1064
+ return redirection.operator !== "<<" && redirection.operator !== "<<-";
1065
+ }
1066
+ __name(redirectsTo, "redirectsTo");
1067
+ var Directories = class {
1068
+ static {
1069
+ __name(this, "Directories");
1070
+ }
1071
+ dirs;
1072
+ unknown = false;
1073
+ constructor(folders) {
1074
+ this.dirs = new Set(folders);
1075
+ }
1076
+ /** Every directory known to be possible, and whether others are. */
1077
+ current() {
1078
+ return { dirs: [...this.dirs], unknown: this.unknown };
1079
+ }
1080
+ after(command, spell, userHome) {
1081
+ const words = command.words.slice(command.assignments);
1082
+ let at = 0;
1083
+ while (at < words.length && !words[at]?.expands && ["builtin", "command"].includes(words[at]?.value ?? ""))
1084
+ at++;
1085
+ const head = words[at];
1086
+ if (!head || head.expands) return;
1087
+ if (head.value === "popd") {
1088
+ this.unknown = true;
1089
+ return;
1090
+ }
1091
+ if (head.value !== "cd" && head.value !== "pushd") return;
1092
+ let target = words.slice(at + 1).find((w) => w.expands || !/^-[LPe@]+$/.test(w.value));
1093
+ if (target && !target.expands && target.value === "--")
1094
+ target = words[words.indexOf(target) + 1];
1095
+ if (!target) {
1096
+ this.dirs.add(userHome);
1097
+ return;
1098
+ }
1099
+ if (!target.expands && (target.value === "-" || /^[+-]\d+$/.test(target.value))) {
1100
+ this.unknown = true;
1101
+ return;
1102
+ }
1103
+ const from = [...this.dirs];
1104
+ for (const spelling of spell(target)) {
1105
+ if (spelling.stop !== "end") {
1106
+ this.unknown = true;
1107
+ continue;
1108
+ }
1109
+ for (const dir of isAbsolute(spelling.known) ? ["/"] : from) {
1110
+ if (this.dirs.size >= 16) {
1111
+ this.unknown = true;
1112
+ return;
1113
+ }
1114
+ this.dirs.add(join(dir, spelling.known));
1115
+ }
1116
+ }
1117
+ }
1118
+ };
1119
+ var MAX_TEXT_DEPTH = 3;
1120
+ function fedTexts(readings) {
1121
+ const out = /* @__PURE__ */ new Set();
1122
+ for (const reading of readings) {
1123
+ for (const command of reading.commands)
1124
+ for (const word of command.words) {
1125
+ const text = word.expands ? unlocale(word.value) : word.value;
1126
+ if (/\s|;|&|\|/.test(text)) out.add(text);
1127
+ }
1128
+ for (const redirection of reading.redirections) {
1129
+ if (redirection.body !== void 0) out.add(redirection.body);
1130
+ if (redirection.operator === "<<<") out.add(redirection.target.value);
1131
+ }
1132
+ }
1133
+ return [...out];
1134
+ }
1135
+ __name(fedTexts, "fedTexts");
1136
+ function unreadCommand(command) {
1137
+ const head = command.words[command.assignments];
1138
+ if (head?.expands) return `the command\u2019s name ${shown(head.text)} expands at runtime`;
1139
+ return runsUnreadText(command);
1140
+ }
1141
+ __name(unreadCommand, "unreadCommand");
1142
+ function whereIn(readings, token) {
1143
+ const holds = typeof token === "string" ? (text) => text.includes(lower(token)) : (text) => token.test(text);
1144
+ for (const reading of readings)
1145
+ for (const command of reading.commands)
1146
+ for (const word of command.words)
1147
+ if (holds(lower(word.value))) return `, in the argument ${shown(word.value)}`;
1148
+ return "";
1149
+ }
1150
+ __name(whereIn, "whereIn");
1151
+
1152
+ // src/schedule/policy.ts
1153
+ var NETWORK_TOOLS = ["web_fetch", "web_search"];
1154
+ var BROWSER_TOOLS = [BROWSER_TOOL_NAME, BROWSER_ACT_TOOL_NAME];
1155
+ var GRANT_LEVELS = ["read", "ask", "act"];
1156
+ var WRITE_TOOLS = ["write", "edit", "bash"];
1157
+ var READ_ONLY = {
1158
+ read: "allow",
1159
+ glob: "allow",
1160
+ grep: "allow",
1161
+ ls: "allow",
1162
+ write: "deny",
1163
+ edit: "deny",
1164
+ bash: "deny",
1165
+ web_fetch: "deny",
1166
+ web_search: "deny"
1167
+ };
1168
+ var PRESETS = {
1169
+ "read-only": { rules: READ_ONLY, unmatched: "deny" },
1170
+ "edit-in-folder": {
1171
+ rules: { ...READ_ONLY, write: "allow", edit: "allow", bash: "ask" },
1172
+ unmatched: "park"
1173
+ }
1174
+ };
1175
+ function isPresetName(value) {
1176
+ return value === "read-only" || value === "edit-in-folder";
1177
+ }
1178
+ __name(isPresetName, "isPresetName");
1179
+ function checkBrowserGrant(input, unmatched) {
1180
+ if (!isBrowserProfileName(input.profile)) {
1181
+ throw new Error(
1182
+ `"${input.profile}" is not a browser profile name: lowercase letters, digits and single hyphens.`
1183
+ );
1184
+ }
1185
+ const entries = Object.entries(input.sites);
1186
+ if (entries.length === 0) {
1187
+ throw new Error(
1188
+ "A browser grant needs at least one site, e.g. --browser-site https://github.com=read."
1189
+ );
1190
+ }
1191
+ const sites = {};
1192
+ for (const [raw, level] of entries) {
1193
+ if (raw.trim() === "*") {
1194
+ throw new Error(
1195
+ 'A scheduled job cannot grant every site ("*"); every site it does not list is denied. List each site.'
1196
+ );
1197
+ }
1198
+ if (!GRANT_LEVELS.includes(level)) {
1199
+ throw new Error(`browser site ${raw}: "${level}" is not read, ask or act.`);
1200
+ }
1201
+ const key = canonicalBrowserSiteKey(raw);
1202
+ if (!key.ok) throw new Error(`browser site ${raw}: ${key.reason}`);
1203
+ const existing = sites[key.key];
1204
+ if (existing !== void 0 && existing !== level) {
1205
+ throw new Error(`browser site ${key.key} is listed twice, as ${existing} and ${level}.`);
1206
+ }
1207
+ sites[key.key] = level;
1208
+ }
1209
+ if (unmatched !== "park" && Object.values(sites).includes("ask")) {
1210
+ throw new Error(
1211
+ `A browser site at "ask" waits for you, which needs unmatched: park; with ${unmatched} it would be ${unmatched === "deny" ? "refused every time" : "approved without asking"}. Use read or act, or --unmatched park.`
1212
+ );
1213
+ }
1214
+ return {
1215
+ profile: input.profile,
1216
+ sites,
1217
+ ...input.headed ? { headed: true } : {}
1218
+ };
1219
+ }
1220
+ __name(checkBrowserGrant, "checkBrowserGrant");
1221
+ function expandPermissions(input) {
1222
+ if (!input.preset && !input.rules && !input.browser) {
1223
+ throw new Error(
1224
+ "A permission set needs a preset (read-only, edit-in-folder), rules or a browser grant; there is no default."
1225
+ );
1226
+ }
1227
+ const named = BROWSER_TOOLS.filter((tool) => input.rules?.[tool] !== void 0);
1228
+ if (named.length > 0) {
1229
+ throw new Error(
1230
+ `The rules name ${named.join(" and ")}; a scheduled job reaches the browser only through a browser grant (--browser <profile> --browser-site <site>=read|ask|act).`
1231
+ );
1232
+ }
1233
+ const preset = input.preset ? PRESETS[input.preset] : void 0;
1234
+ const unmatched = input.unmatched ?? preset?.unmatched;
1235
+ if (!unmatched) {
1236
+ throw new Error("unmatched is required: park (wait for the operator), deny, or allow.");
1237
+ }
1238
+ const rules = { ...preset?.rules ?? {}, ...input.rules ?? {} };
1239
+ const compiled = compilePermissions(rules);
1240
+ if (compiled.diagnostics.length > 0) {
1241
+ throw new Error(
1242
+ `The permission rules do not compile: ${compiled.diagnostics.map(describeDiagnostic).join("; ")}`
1243
+ );
1244
+ }
1245
+ const browser = input.browser ? checkBrowserGrant(input.browser, unmatched) : void 0;
1246
+ return {
1247
+ unmatched,
1248
+ execution: input.execution ?? "host",
1249
+ rules,
1250
+ ...input.additionalDirectories && input.additionalDirectories.length > 0 ? { additionalDirectories: [...input.additionalDirectories] } : {},
1251
+ preset: input.preset && !input.rules ? input.preset : "custom",
1252
+ ...browser ? { browser } : {}
1253
+ };
1254
+ }
1255
+ __name(expandPermissions, "expandPermissions");
1256
+ function describeDiagnostic(d) {
1257
+ return `${d.pattern ? `${d.tool}."${d.pattern}"` : d.tool}: ${d.message}`;
1258
+ }
1259
+ __name(describeDiagnostic, "describeDiagnostic");
1260
+ function effectsOf(permission) {
1261
+ if (permission === void 0) return [];
1262
+ if (isPermissionEffect(permission)) return [permission];
1263
+ return Object.values(permission).filter(isPermissionEffect);
1264
+ }
1265
+ __name(effectsOf, "effectsOf");
1266
+ function allowsNetwork(set) {
1267
+ return set.browser !== void 0 || NETWORK_TOOLS.some((t) => effectsOf(set.rules[t]).some((e) => e !== "deny"));
1268
+ }
1269
+ __name(allowsNetwork, "allowsNetwork");
1270
+ function allowsCommands(set) {
1271
+ const effects = effectsOf(set.rules.bash);
1272
+ return effects.length > 0 ? effects.some((e) => e !== "deny") : set.unmatched !== "deny";
1273
+ }
1274
+ __name(allowsCommands, "allowsCommands");
1275
+ function allowsWrites(set) {
1276
+ if (set.unmatched !== "deny") return true;
1277
+ return WRITE_TOOLS.some((t) => effectsOf(set.rules[t]).some((e) => e !== "deny"));
1278
+ }
1279
+ __name(allowsWrites, "allowsWrites");
1280
+ function denialsOf(table) {
1281
+ const out = {};
1282
+ for (const [tool, permission] of Object.entries(table)) {
1283
+ if (permission === "deny") out[tool] = "deny";
1284
+ else if (permission && typeof permission === "object") {
1285
+ const denied = Object.fromEntries(
1286
+ Object.entries(permission).filter(([, effect]) => effect === "deny")
1287
+ );
1288
+ if (Object.keys(denied).length > 0) out[tool] = denied;
1289
+ }
1290
+ }
1291
+ return out;
1292
+ }
1293
+ __name(denialsOf, "denialsOf");
1294
+ function scheduledRunFloor(namzuHome, userHome = homedir(), folders = []) {
1295
+ return [scheduledRunFloorRule({ namzuHome, userHome, folders })];
1296
+ }
1297
+ __name(scheduledRunFloor, "scheduledRunFloor");
1298
+ function modeFor(unmatched) {
1299
+ return unmatched === "park" ? "prompt" : unmatched === "deny" ? "strict" : "auto";
1300
+ }
1301
+ __name(modeFor, "modeFor");
1302
+ function lineFor(tool, permission) {
1303
+ if (isPermissionEffect(permission)) return [`${tool}: ${permission}`];
1304
+ return Object.entries(permission).map(([pattern, effect]) => `${tool} "${pattern}": ${effect}`);
1305
+ }
1306
+ __name(lineFor, "lineFor");
1307
+ function compileJobPolicy(set, options) {
1308
+ const diagnostics = [];
1309
+ const configDenies = [];
1310
+ const denyLines = [];
1311
+ for (const layer of options.layers) {
1312
+ const denied = denialsOf(layer.permissions);
1313
+ const compiled = compilePermissions(denied);
1314
+ configDenies.push(...compiled.rules);
1315
+ for (const d of compiled.diagnostics)
1316
+ diagnostics.push(`${layer.path}: ${describeDiagnostic(d)}`);
1317
+ for (const [tool, permission] of Object.entries(denied))
1318
+ for (const line of lineFor(tool, permission)) denyLines.push(`${line} (from ${layer.path})`);
1319
+ }
1320
+ const own = compilePermissions(set.rules);
1321
+ for (const d of own.diagnostics) diagnostics.push(`job: ${describeDiagnostic(d)}`);
1322
+ const siteDenies = options.layers.flatMap(
1323
+ (layer) => (layer.browserDenies ?? []).map((site) => ({ site, path: layer.path }))
1324
+ );
1325
+ const browser = set.browser ? compileBrowserGrant(set.browser, siteDenies) : void 0;
1326
+ if (browser) diagnostics.push(...browser.diagnostics.map((d) => `job: ${d}`));
1327
+ const networkDenied = [
1328
+ ...NETWORK_TOOLS.filter((t) => set.rules[t] === void 0),
1329
+ ...BROWSER_TOOLS
1330
+ ];
1331
+ const rules = [
1332
+ ...scheduledRunFloor(
1333
+ options.namzuHome,
1334
+ homedir(),
1335
+ options.folder ? [options.folder.path, options.folder.canonical] : []
1336
+ ),
1337
+ ...configDenies,
1338
+ ...own.rules,
1339
+ ...browser?.rules ?? [],
1340
+ { type: "deny_by_name", toolNames: [...networkDenied] }
1341
+ ];
1342
+ const lines = [
1343
+ "dangerous commands (rm -rf /, mkfs, curl | sh, sudo \u2026): deny, always",
1344
+ `the scheduler\u2019s commands (but ${READ_ONLY_VERBS.join(", ")}), and anything naming NAMZU_HOME or the browser\u2019s profiles: deny`,
1345
+ ...denyLines,
1346
+ ...Object.entries(set.rules).flatMap(([tool, permission]) => lineFor(tool, permission)),
1347
+ ...set.browser ? browserGrantLines(set.browser, siteDenies) : [],
1348
+ `anything else: ${set.unmatched === "park" ? "wait for the operator" : set.unmatched === "deny" ? "deny" : "run without asking"}`
1349
+ ];
1350
+ return {
1351
+ rules,
1352
+ diagnostics,
1353
+ mode: modeFor(set.unmatched),
1354
+ network: allowsNetwork(set),
1355
+ writes: allowsWrites(set),
1356
+ lines
1357
+ };
1358
+ }
1359
+ __name(compileJobPolicy, "compileJobPolicy");
1360
+ function compileScriptCheckPolicy(set, options) {
1361
+ const diagnostics = [];
1362
+ const configDenies = [];
1363
+ for (const layer of options.layers) {
1364
+ const compiled = compilePermissions(denialsOf(layer.permissions));
1365
+ configDenies.push(...compiled.rules);
1366
+ for (const d of compiled.diagnostics)
1367
+ diagnostics.push(`${layer.path}: ${describeDiagnostic(d)}`);
1368
+ }
1369
+ const ownDenies = compilePermissions(denialsOf(set.rules));
1370
+ for (const d of ownDenies.diagnostics) diagnostics.push(`job: ${describeDiagnostic(d)}`);
1371
+ return {
1372
+ floorRules: scheduledRunFloor(
1373
+ options.namzuHome,
1374
+ homedir(),
1375
+ options.folder ? [options.folder.path, options.folder.canonical] : []
1376
+ ),
1377
+ denyRules: [...configDenies, ...ownDenies.rules],
1378
+ diagnostics
1379
+ };
1380
+ }
1381
+ __name(compileScriptCheckPolicy, "compileScriptCheckPolicy");
1382
+ var GRANT_WORDS = {
1383
+ read: "open and read, never change",
1384
+ ask: "open and read; each change waits for you",
1385
+ act: "open, read and change without asking"
1386
+ };
1387
+ function compileBrowserGrant(grant, denies = []) {
1388
+ const sites = {
1389
+ ...grant.sites,
1390
+ "*": "deny"
1391
+ };
1392
+ for (const { site } of denies) sites[site] = "deny";
1393
+ const compiled = compileBrowserSites(sites);
1394
+ return {
1395
+ rules: [
1396
+ ...compiled.rules,
1397
+ {
1398
+ type: "argument_pattern",
1399
+ toolNames: [BROWSER_TOOL_NAME],
1400
+ argument: "action",
1401
+ pattern: "^(?:back|forward|reload)$",
1402
+ decision: "allow"
1403
+ }
1404
+ ],
1405
+ diagnostics: compiled.diagnostics
1406
+ };
1407
+ }
1408
+ __name(compileBrowserGrant, "compileBrowserGrant");
1409
+ function browserGrantLines(grant, denies = []) {
1410
+ const denied = new Map(denies.map((d) => [d.site, d.path]));
1411
+ return [
1412
+ `browser: profile ${grant.profile}, ${grant.headed ? "in a visible window" : "no window"}`,
1413
+ ...Object.entries(grant.sites).map(
1414
+ ([site, level]) => denied.has(site) ? `browser ${site}: deny (from ${denied.get(site)})` : `browser ${site}: ${GRANT_WORDS[level]}`
1415
+ ),
1416
+ "browser any other site: deny",
1417
+ "browser sign-in, CAPTCHA or a code: the run stops and tells you"
1418
+ ];
1419
+ }
1420
+ __name(browserGrantLines, "browserGrantLines");
1421
+ var STRICT_UNREACHABLE = [
1422
+ "Agent",
1423
+ "send_message",
1424
+ "cancel_agent",
1425
+ "wait_for_task",
1426
+ "agent_task_list",
1427
+ "agent_models",
1428
+ "save_memory",
1429
+ "update_memory",
1430
+ "delete_memory"
1431
+ ];
1432
+ var JOB_TOOLS = ["job", "wait_for_job"];
1433
+ function mayReach(rule, tool) {
1434
+ switch (rule.type) {
1435
+ case "deny_by_name":
1436
+ case "deny_dangerous_patterns":
1437
+ return false;
1438
+ case "allow_by_name":
1439
+ return rule.toolNames.includes(tool);
1440
+ case "argument_pattern":
1441
+ return rule.decision !== "deny" && rule.toolNames.includes(tool);
1442
+ case "custom_pattern": {
1443
+ if (rule.decision === "deny") return false;
1444
+ const named = /^\^([A-Za-z0-9_-]+)(?![A-Za-z0-9_-])/.exec(rule.pattern);
1445
+ return named ? named[1] === tool : true;
1446
+ }
1447
+ case "predicate":
1448
+ return !isFloorRule(rule);
1449
+ default:
1450
+ return true;
1451
+ }
1452
+ }
1453
+ __name(mayReach, "mayReach");
1454
+ function withheldTools(set, policy) {
1455
+ const out = /* @__PURE__ */ new Set();
1456
+ policy.rules.forEach((rule, index) => {
1457
+ if (rule.type !== "deny_by_name") return;
1458
+ const earlier = policy.rules.slice(0, index);
1459
+ for (const tool of rule.toolNames) if (!earlier.some((r) => mayReach(r, tool))) out.add(tool);
1460
+ });
1461
+ if (set.unmatched === "deny") {
1462
+ for (const tool of STRICT_UNREACHABLE)
1463
+ if (!policy.rules.some((r) => mayReach(r, tool))) out.add(tool);
1464
+ }
1465
+ if (out.has("bash")) for (const tool of JOB_TOOLS) out.add(tool);
1466
+ return [...out].sort();
1467
+ }
1468
+ __name(withheldTools, "withheldTools");
1469
+
1470
+ export {
1471
+ isPresetName,
1472
+ expandPermissions,
1473
+ allowsCommands,
1474
+ allowsWrites,
1475
+ compileJobPolicy,
1476
+ compileScriptCheckPolicy,
1477
+ withheldTools
1478
+ };
1479
+ //# sourceMappingURL=chunk-MS3IYQ72.js.map