@testmuai/kane-cli 0.8.23 → 0.10.0-rc.1

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 (645) hide show
  1. package/dist/ChatSurface-VPD5G67Q.js +2 -0
  2. package/dist/ChromeProfilePicker-CRKQEFYD.js +2 -0
  3. package/dist/CliFeedbackPrompt-M7BMWLKK.js +2 -0
  4. package/dist/CliUploadProgress-OP7DXMC2.js +2 -0
  5. package/dist/ConfigView-XI74BCCH.js +2 -0
  6. package/dist/EvidenceViewOffer-HAAK6DS5.js +2 -0
  7. package/dist/FolderPicker-W5S6RFCP.js +2 -0
  8. package/dist/InfoBox-OWUEHV2D.js +2 -0
  9. package/dist/LinksBox-PNSESNCU.js +2 -0
  10. package/dist/ProfilesView-PYDZZHKO.js +2 -0
  11. package/dist/ProjectPicker-BGFCUGT5.js +2 -0
  12. package/dist/SaveSessionPrompt-SUJE54GS.js +2 -0
  13. package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
  14. package/dist/SingleShotApp-4TDXZEUA.js +2 -0
  15. package/dist/SummaryBox-FALOODAQ.js +2 -0
  16. package/dist/TestMdRunView-4GPRWHEU.js +2 -0
  17. package/dist/TestrunEvidenceTable-OBVQJ6IO.js +2 -0
  18. package/dist/WhoamiView-6WXGRANY.js +2 -0
  19. package/dist/{agent-parse-2MLJOJTH.js → agent-parse-CAS45UKA.js} +1 -1
  20. package/dist/app-client-U2YYF65L.js +2 -0
  21. package/dist/app-download-RXVZB6MM.js +2 -0
  22. package/dist/assurance-job-C3TXZGLL.js +7 -0
  23. package/dist/auth-7Z54TMQQ.js +2 -0
  24. package/dist/{binary-MOJTQGUV.js → binary-DJCDMGPX.js} +1 -1
  25. package/dist/bind-XVO4CQYV.js +2 -0
  26. package/dist/bootstrap-TY5RANJ7.js +2 -0
  27. package/dist/bridge-T6QMYKED.js +2 -0
  28. package/dist/build-5ZN47FAT.js +2 -0
  29. package/dist/catalog-RRQF4TCA.js +2 -0
  30. package/dist/{changelog-2N6HKKKQ.js → changelog-GBEVIUFJ.js} +1 -1
  31. package/dist/chat-committer-ZCSRJEUB.js +2 -0
  32. package/dist/chat-controller-XINCDH6Z.js +2 -0
  33. package/dist/child-G2GCW73X.js +2 -0
  34. package/dist/chunk-22PIMG52.js +2 -0
  35. package/dist/chunk-252FWF2G.js +19 -0
  36. package/dist/{chunk-AT3RME5W.js → chunk-2IZRPMZN.js} +1 -1
  37. package/dist/chunk-2NFS4KE4.js +2 -0
  38. package/dist/{chunk-LHUW5QDT.js → chunk-2OOFURWD.js} +1 -1
  39. package/dist/chunk-2OSFI33O.js +97 -0
  40. package/dist/chunk-2S3W2JT3.js +5 -0
  41. package/dist/chunk-2SWSVJUP.js +12 -0
  42. package/dist/chunk-2TVPA3LL.js +2 -0
  43. package/dist/chunk-2XW33VOK.js +2 -0
  44. package/dist/chunk-33DWJV67.js +235 -0
  45. package/dist/chunk-34R7BNZ2.js +2 -0
  46. package/dist/chunk-35ECWCCK.js +2 -0
  47. package/dist/chunk-3BSYOCSW.js +3 -0
  48. package/dist/chunk-3G2LSTK5.js +2 -0
  49. package/dist/chunk-3GXN6VF6.js +2 -0
  50. package/dist/chunk-3JLEDSG5.js +4 -0
  51. package/dist/chunk-3QICDXY5.js +5 -0
  52. package/dist/chunk-3UVSAAES.js +10 -0
  53. package/dist/chunk-42PALMW2.js +4 -0
  54. package/dist/chunk-432ZOE42.js +21 -0
  55. package/dist/chunk-44B6THYK.js +2 -0
  56. package/dist/chunk-47WQBG5I.js +6 -0
  57. package/dist/{chunk-J2FJ62K4.js → chunk-4D5PC6QE.js} +1 -1
  58. package/dist/chunk-4I7YN6YY.js +3 -0
  59. package/dist/chunk-4IEQNX7F.js +2 -0
  60. package/dist/{chunk-SYJXTB4J.js → chunk-4LPX2OLV.js} +1 -1
  61. package/dist/chunk-4LTHDJ3D.js +2 -0
  62. package/dist/chunk-4QTH7VYE.js +2 -0
  63. package/dist/chunk-54XA5MZH.js +2 -0
  64. package/dist/chunk-57MDWTON.js +2 -0
  65. package/dist/{chunk-3C32LVLX.js → chunk-5BUIIFLC.js} +1 -1
  66. package/dist/chunk-5D7ENQTQ.js +2 -0
  67. package/dist/chunk-63EKRZKI.js +2 -0
  68. package/dist/{chunk-EHN5HTUD.js → chunk-65VANXOF.js} +51 -51
  69. package/dist/chunk-672CQECV.js +47 -0
  70. package/dist/chunk-6LIC2R22.js +3 -0
  71. package/dist/chunk-6NFOH4AC.js +4 -0
  72. package/dist/chunk-6NWT2TEJ.js +2 -0
  73. package/dist/chunk-6PIIUAZF.js +3 -0
  74. package/dist/{chunk-MBJHS653.js → chunk-6U7ID777.js} +1 -1
  75. package/dist/chunk-6UVIY56J.js +2 -0
  76. package/dist/chunk-72KYMWQ5.js +2 -0
  77. package/dist/chunk-72RC7JSA.js +21 -0
  78. package/dist/chunk-74W4AOT2.js +2 -0
  79. package/dist/chunk-77ZZQJLX.js +2 -0
  80. package/dist/chunk-7DFBOVUB.js +2 -0
  81. package/dist/chunk-7EXDYXXD.js +2 -0
  82. package/dist/chunk-7HO4NX5W.js +1 -0
  83. package/dist/chunk-7KX2BHKG.js +2 -0
  84. package/dist/chunk-7LKCWO2R.js +11 -0
  85. package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
  86. package/dist/chunk-7RPKHKA3.js +2 -0
  87. package/dist/chunk-7RWP4Y3H.js +2 -0
  88. package/dist/chunk-7V4BQSSV.js +2 -0
  89. package/dist/chunk-7XBNMOH4.js +6 -0
  90. package/dist/chunk-A6TJOZ24.js +2 -0
  91. package/dist/chunk-A7RJQJNT.js +2 -0
  92. package/dist/chunk-AA674WLL.js +2 -0
  93. package/dist/chunk-AIXJYMSP.js +9 -0
  94. package/dist/chunk-AJQZ3ST5.js +8 -0
  95. package/dist/chunk-AQ2OG2EF.js +2 -0
  96. package/dist/chunk-AUJSC7PU.js +4 -0
  97. package/dist/chunk-AVI5H4UM.js +13 -0
  98. package/dist/chunk-AZLNLHUA.js +4 -0
  99. package/dist/chunk-B2HXPGIZ.js +26 -0
  100. package/dist/chunk-B7ZX5HEN.js +8 -0
  101. package/dist/{chunk-XQQHSC7G.js → chunk-BJJUKB5K.js} +1 -1
  102. package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
  103. package/dist/{chunk-TONFENRW.js → chunk-BVO4C5F2.js} +1 -1
  104. package/dist/chunk-BWXLZS5O.js +2 -0
  105. package/dist/chunk-BY65QAAN.js +4 -0
  106. package/dist/chunk-BZVNI44O.js +6 -0
  107. package/dist/chunk-C5Z7MQE6.js +2 -0
  108. package/dist/chunk-C6HI6Y3S.js +2 -0
  109. package/dist/chunk-CB4ARIHR.js +2 -0
  110. package/dist/chunk-CPBBYNL7.js +4 -0
  111. package/dist/{chunk-GFNCGN5V.js → chunk-D4FFXCX6.js} +2 -2
  112. package/dist/chunk-D756UWY2.js +6 -0
  113. package/dist/chunk-DBMW3VUN.js +4 -0
  114. package/dist/chunk-DD5TULWQ.js +34 -0
  115. package/dist/{chunk-SY4T44VC.js → chunk-DDJNYQBH.js} +1 -1
  116. package/dist/{chunk-KJIDMW6N.js → chunk-DHQ4SQWA.js} +1 -1
  117. package/dist/chunk-DNGOT65K.js +3 -0
  118. package/dist/chunk-DPGOAFKF.js +2 -0
  119. package/dist/chunk-DREQ3RAA.js +2 -0
  120. package/dist/chunk-DTUPEKEO.js +2 -0
  121. package/dist/chunk-E6KSRQXL.js +8 -0
  122. package/dist/chunk-EF47KRUK.js +2 -0
  123. package/dist/chunk-ENL4XTQ2.js +2 -0
  124. package/dist/chunk-EXFDIVNI.js +9 -0
  125. package/dist/chunk-EZN7CF45.js +4 -0
  126. package/dist/chunk-F3U6T4YD.js +22 -0
  127. package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
  128. package/dist/chunk-FFL55I2M.js +2 -0
  129. package/dist/chunk-FIP5L6LV.js +9 -0
  130. package/dist/chunk-FOJHSG5M.js +6 -0
  131. package/dist/chunk-FSYOTRMC.js +2 -0
  132. package/dist/chunk-GFLB2SHW.js +2 -0
  133. package/dist/chunk-GMTHZUZ3.js +2 -0
  134. package/dist/chunk-GRURFGBP.js +2 -0
  135. package/dist/chunk-GZFLJORM.js +2 -0
  136. package/dist/{chunk-PXHN7SFG.js → chunk-H3HHSTEK.js} +4 -4
  137. package/dist/chunk-HAW5WEKT.js +13 -0
  138. package/dist/chunk-HFJSP4KD.js +2 -0
  139. package/dist/chunk-HHW6MRU3.js +6 -0
  140. package/dist/chunk-HIUAUZNL.js +2 -0
  141. package/dist/chunk-HJLMH7ZM.js +2 -0
  142. package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
  143. package/dist/chunk-I2KOGINW.js +7 -0
  144. package/dist/chunk-I2MC6VVX.js +2 -0
  145. package/dist/chunk-I5NSJBOZ.js +2 -0
  146. package/dist/chunk-I6OQISK4.js +2 -0
  147. package/dist/chunk-IBBD36FQ.js +2 -0
  148. package/dist/chunk-IINZZ4BZ.js +2 -0
  149. package/dist/{chunk-UYI4WPNQ.js → chunk-IMDMRJQ6.js} +2 -2
  150. package/dist/chunk-IXW7FOGX.js +2 -0
  151. package/dist/chunk-IZ65ZPWY.js +3 -0
  152. package/dist/chunk-JD52IXON.js +9 -0
  153. package/dist/chunk-JGRXMTME.js +15 -0
  154. package/dist/{chunk-NBXYL2JT.js → chunk-JIRNI5TB.js} +7 -7
  155. package/dist/chunk-JNSWKGTB.js +2 -0
  156. package/dist/chunk-JPYW6U4D.js +2 -0
  157. package/dist/chunk-JQSLUGD4.js +3 -0
  158. package/dist/chunk-K45BKGB5.js +8 -0
  159. package/dist/chunk-KF4DKXSS.js +2 -0
  160. package/dist/chunk-KGNE5CIM.js +2 -0
  161. package/dist/chunk-KM3YCIDV.js +3 -0
  162. package/dist/chunk-KU3YHPWZ.js +2 -0
  163. package/dist/chunk-L4UVUFL6.js +3 -0
  164. package/dist/chunk-LCSJ7GOG.js +2 -0
  165. package/dist/chunk-LKQFG4RW.js +5 -0
  166. package/dist/chunk-LNNWCBPQ.js +2 -0
  167. package/dist/chunk-LRS5MGBY.js +3 -0
  168. package/dist/chunk-LRXBJTD4.js +4 -0
  169. package/dist/chunk-LSDJOVWW.js +6 -0
  170. package/dist/chunk-LWJRSUE2.js +2 -0
  171. package/dist/chunk-LX2I4JEH.js +2 -0
  172. package/dist/{chunk-K6VDRR3H.js → chunk-M6MBMRFR.js} +1 -1
  173. package/dist/chunk-MGNRNLBE.js +2 -0
  174. package/dist/chunk-MII3JOO3.js +4 -0
  175. package/dist/chunk-MNBGG4H3.js +16 -0
  176. package/dist/chunk-MYVKUJGS.js +2 -0
  177. package/dist/chunk-MYZHOBS4.js +2 -0
  178. package/dist/chunk-MZOIHUVX.js +27 -0
  179. package/dist/{chunk-OFRYEWZE.js → chunk-N3TCNZSX.js} +1 -1
  180. package/dist/chunk-NC7D7GOM.js +21 -0
  181. package/dist/{chunk-CLQP3DHT.js → chunk-NDEI7R4K.js} +1 -1
  182. package/dist/chunk-NFRA64NU.js +10 -0
  183. package/dist/chunk-NLZZLANH.js +4 -0
  184. package/dist/{chunk-5HOHXV2K.js → chunk-NQTYWHPB.js} +1 -1
  185. package/dist/chunk-NWBLYMH7.js +3 -0
  186. package/dist/chunk-NWD54VV5.js +2 -0
  187. package/dist/chunk-NXRF7FFS.js +2 -0
  188. package/dist/chunk-O3HHTKZ5.js +6 -0
  189. package/dist/{chunk-FPFS6OSR.js → chunk-OAKYUBD3.js} +1 -1
  190. package/dist/chunk-OEWYXCTA.js +7 -0
  191. package/dist/{chunk-BASTDR3M.js → chunk-OF7WPCTQ.js} +1 -1
  192. package/dist/chunk-OFSDB7B4.js +3 -0
  193. package/dist/chunk-OJ33Q6DU.js +2 -0
  194. package/dist/chunk-OQ5G773E.js +2 -0
  195. package/dist/chunk-OVNRRI4E.js +2 -0
  196. package/dist/{chunk-RAARDC2O.js → chunk-OZNBTSW5.js} +1 -1
  197. package/dist/chunk-P2ZQDQDB.js +2 -0
  198. package/dist/chunk-P7MSVLAH.js +6 -0
  199. package/dist/chunk-PUVMC4PX.js +26 -0
  200. package/dist/{chunk-SEEEGDVK.js → chunk-PZA3BSOE.js} +1 -1
  201. package/dist/chunk-Q3C6NDGI.js +2 -0
  202. package/dist/chunk-QCKA665H.js +2 -0
  203. package/dist/chunk-QDFY5GGO.js +5 -0
  204. package/dist/chunk-QHRUBG7J.js +2 -0
  205. package/dist/chunk-QI5RZ7LL.js +2 -0
  206. package/dist/chunk-QNLVC5ZB.js +2 -0
  207. package/dist/{chunk-DSKJ6J7Y.js → chunk-QQ4TKLWP.js} +1 -1
  208. package/dist/chunk-QS5ZJFGF.js +4 -0
  209. package/dist/chunk-QTZBVDPR.js +12 -0
  210. package/dist/chunk-QXQ7KVEN.js +2 -0
  211. package/dist/chunk-R4JUKTDO.js +2 -0
  212. package/dist/chunk-R7KXAISS.js +12 -0
  213. package/dist/chunk-RDP7GWSY.js +2 -0
  214. package/dist/chunk-REKHAN53.js +5 -0
  215. package/dist/{chunk-5RHR4DMF.js → chunk-RFEON5GN.js} +1 -1
  216. package/dist/chunk-RFIIM33J.js +2 -0
  217. package/dist/chunk-RG372DON.js +6 -0
  218. package/dist/chunk-RPRXRKKR.js +2 -0
  219. package/dist/chunk-RTVWQK7I.js +2 -0
  220. package/dist/chunk-RW3Z2HMB.js +7 -0
  221. package/dist/chunk-RX47NRSM.js +2 -0
  222. package/dist/chunk-RX6776AI.js +5 -0
  223. package/dist/chunk-S53AQU7R.js +6 -0
  224. package/dist/{chunk-HJX5PQRD.js → chunk-SA6IKFFD.js} +1 -1
  225. package/dist/{chunk-2MEQTHNI.js → chunk-SLKYD44Y.js} +1 -1
  226. package/dist/chunk-SMTBOSEJ.js +2 -0
  227. package/dist/chunk-SMXABALN.js +2 -0
  228. package/dist/chunk-SONMD3W5.js +5 -0
  229. package/dist/chunk-SWMTXMKB.js +2 -0
  230. package/dist/chunk-SXRHKXSE.js +2 -0
  231. package/dist/chunk-T3HEJASG.js +5 -0
  232. package/dist/chunk-T4AVLJCW.js +6 -0
  233. package/dist/{chunk-J6TBTWW7.js → chunk-T6K2MEWP.js} +1 -1
  234. package/dist/{chunk-D6BULK7E.js → chunk-T7H4LBFK.js} +1 -1
  235. package/dist/chunk-TNORODUF.js +2 -0
  236. package/dist/chunk-TW63WWEN.js +2 -0
  237. package/dist/chunk-UALJTPSA.js +18 -0
  238. package/dist/chunk-UAWWLLTI.js +2 -0
  239. package/dist/chunk-UEE3RZN4.js +14 -0
  240. package/dist/chunk-UTM7D4PI.js +2 -0
  241. package/dist/chunk-UUJIGOEO.js +2 -0
  242. package/dist/chunk-UYDHOHSZ.js +2 -0
  243. package/dist/chunk-V5JGXOV7.js +2 -0
  244. package/dist/chunk-V7S6S5W3.js +2 -0
  245. package/dist/{chunk-HBSYBL6J.js → chunk-VG44B5JD.js} +1 -1
  246. package/dist/chunk-VJGWVBZR.js +1 -0
  247. package/dist/chunk-VLDCHFXF.js +2 -0
  248. package/dist/chunk-VO66KP2W.js +2 -0
  249. package/dist/{chunk-D4XR7EEQ.js → chunk-VQLH63X7.js} +14 -12
  250. package/dist/chunk-VRIZDOO5.js +2 -0
  251. package/dist/chunk-VYHT2IET.js +1397 -0
  252. package/dist/chunk-VZJ6LUXX.js +2 -0
  253. package/dist/chunk-W3OVSDBN.js +29 -0
  254. package/dist/chunk-W7FLXW6Q.js +5 -0
  255. package/dist/{chunk-IEW7AW64.js → chunk-WEM3MOAL.js} +1 -1
  256. package/dist/chunk-WI7K6VKQ.js +2 -0
  257. package/dist/chunk-WMGKUERB.js +6 -0
  258. package/dist/{chunk-DFS4RMVP.js → chunk-WN5VKKJ3.js} +1 -1
  259. package/dist/chunk-WOSANGV6.js +5 -0
  260. package/dist/chunk-WYSZ6TPW.js +15 -0
  261. package/dist/chunk-XB6BJPDL.js +2 -0
  262. package/dist/{chunk-5ESGUPSR.js → chunk-XBEYWXPV.js} +1 -1
  263. package/dist/chunk-XIPKSXRQ.js +16 -0
  264. package/dist/chunk-XJ7HCXKW.js +2 -0
  265. package/dist/chunk-XMPTFXPW.js +5 -0
  266. package/dist/chunk-XZYA7DNH.js +2 -0
  267. package/dist/chunk-Y4T4SLDO.js +2 -0
  268. package/dist/chunk-Y6Y6RAY4.js +2 -0
  269. package/dist/chunk-YDPTSDIJ.js +2 -0
  270. package/dist/chunk-YDSGXB25.js +2 -0
  271. package/dist/chunk-YIKF4ERQ.js +375 -0
  272. package/dist/chunk-Z55KBMYV.js +2 -0
  273. package/dist/chunk-ZCRZFAOT.js +2 -0
  274. package/dist/chunk-ZFM77AQU.js +2 -0
  275. package/dist/{chunk-Q6F23V7L.js → chunk-ZFMRQ57Y.js} +1 -1
  276. package/dist/chunk-ZHWU6L2G.js +5 -0
  277. package/dist/chunk-ZTHYAHDN.js +17 -0
  278. package/dist/chunk-ZZP5SHUV.js +3 -0
  279. package/dist/committer-JGY66PFM.js +2 -0
  280. package/dist/config-5ZOALGKE.js +2 -0
  281. package/dist/controller-client-PB3AZAGG.js +2 -0
  282. package/dist/cover-cmd-UA2SVIZZ.js +2 -0
  283. package/dist/{credentials-PSQWWFGD.js → credentials-MRG452Y6.js} +1 -1
  284. package/dist/{deps-bundle-PPOQHJTB.js → deps-bundle-FWINW4XM.js} +1 -1
  285. package/dist/{deps-resolve-AX6ZAKLH.js → deps-resolve-IET4KIBO.js} +1 -1
  286. package/dist/descriptor-7T32VRMB.js +2 -0
  287. package/dist/design-chat-MM5PJD2N.js +2 -0
  288. package/dist/design-committer-TRYP3LOZ.js +2 -0
  289. package/dist/design-headless-FZONCKHW.js +2 -0
  290. package/dist/design-remote-SPVRIY2H.js +3 -0
  291. package/dist/device-env-LXJ65AVF.js +2 -0
  292. package/dist/dispatch-DVQ3H7EJ.js +2 -0
  293. package/dist/doctor-VAX2BWQF.js +2 -0
  294. package/dist/docx-convert-6IZO5P5K.js +2 -0
  295. package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
  296. package/dist/evidence-LVVK7ROT.js +2 -0
  297. package/dist/evidence-presentation-YYTIDCBS.js +2 -0
  298. package/dist/evolve-cmd-AGRKG7T3.js +2 -0
  299. package/dist/evolve-remote-BGHULJTL.js +2 -0
  300. package/dist/{exit-manager-ZLDO54S4.js → exit-manager-EDHCETUN.js} +1 -1
  301. package/dist/explain-DGJ5T6V5.js +2 -0
  302. package/dist/explain-cmd-VYAANFFZ.js +4 -0
  303. package/dist/explain-cmd-WOBGS6KX.js +12 -0
  304. package/dist/explore-LOKNOVNP.js +2 -0
  305. package/dist/explore-context-tty-JTZVZFOE.js +2 -0
  306. package/dist/explore-entry-5OGNLFAU.js +6 -0
  307. package/dist/explore-live-2XZHUYFS.js +5 -0
  308. package/dist/explore-run-tty-LGTIK2NA.js +5 -0
  309. package/dist/extract-bind-NM2BBK4I.js +14 -0
  310. package/dist/extract-chat-HLQMJJIC.js +2 -0
  311. package/dist/extract-cmd-T2TSAC3N.js +6 -0
  312. package/dist/extract-headless-OQTQ3FJK.js +2 -0
  313. package/dist/feeder-NY45UFJK.js +2 -0
  314. package/dist/folder-flags-WXUR6OPJ.js +2 -0
  315. package/dist/gaps-cmd-PTSKPTF7.js +3 -0
  316. package/dist/gate-P57VP4E5.js +2 -0
  317. package/dist/gate-WISOUTHQ.js +2 -0
  318. package/dist/{generate-headless-TEDHS3F2.js → generate-headless-JYZP6VXZ.js} +3 -3
  319. package/dist/headless-io-FFM5T6KL.js +2 -0
  320. package/dist/hold-passthrough-IOWPVB4W.js +2 -0
  321. package/dist/identity-HL5CJJXR.js +2 -0
  322. package/dist/index.js +194 -175
  323. package/dist/ingest-PDGS5ZTL.js +2 -0
  324. package/dist/ingest-cmd-LHCBMO4Z.js +8 -0
  325. package/dist/ingest-remote-D5TO5JQP.js +2 -0
  326. package/dist/ink-screen-RZ7QDIUI.js +2 -0
  327. package/dist/install-Z6K2D2VY.js +2 -0
  328. package/dist/interactive-bind-5EJQUGKI.js +26 -0
  329. package/dist/interactive-remote-D77ULJGL.js +65 -0
  330. package/dist/interrupt-guard-QETBPINI.js +2 -0
  331. package/dist/lane-AQYRIW24.js +2 -0
  332. package/dist/lattice-auth-74XGF77Y.js +2 -0
  333. package/dist/lifecycle-cmd-7SM6UCMH.js +2 -0
  334. package/dist/list-cmd-Z6FZXMFU.js +3 -0
  335. package/dist/list-commands-CZYZ7GIG.js +2 -0
  336. package/dist/list-remote-WOPOC6KK.js +15 -0
  337. package/dist/locks-cmd-JJ2QNTNY.js +2 -0
  338. package/dist/logical-ids-RXAQJZ3T.js +2 -0
  339. package/dist/login-flow-2FZEOVHM.js +2 -0
  340. package/dist/maintenance-cmd-VRTGZVRE.js +2 -0
  341. package/dist/mobile-prompts-KNAHU64X.js +2 -0
  342. package/dist/{next-KZXH4UA4.js → next-O6SUSX3R.js} +1 -1
  343. package/dist/{objective-variable-gate-JALOH6SL.js → objective-variable-gate-3Z7DNVVC.js} +1 -1
  344. package/dist/onboarding-LGT6PMDZ.js +5 -0
  345. package/dist/open-provider-OZAG6WZS.js +2 -0
  346. package/dist/{paths-JCYX6UWL.js → paths-UMIX3RJF.js} +1 -1
  347. package/dist/pdf-convert-447ACUB3.js +2 -0
  348. package/dist/persist-recorded-session-BX7II5P7.js +3 -0
  349. package/dist/phase-seed-LCJ4WSYV.js +2 -0
  350. package/dist/pipeline-IXVTVRS5.js +2 -0
  351. package/dist/prepare-target-ULMKVKMC.js +2 -0
  352. package/dist/pull-cmd-6AL2WYHB.js +2 -0
  353. package/dist/pull-route-TTVARJMV.js +2 -0
  354. package/dist/readmodel-INMP6MNW.js +2 -0
  355. package/dist/real-device-run-2LFS5WE2.js +2 -0
  356. package/dist/reconcile-cmd-R6H37SQR.js +5 -0
  357. package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
  358. package/dist/reconcile-remote-GWDV5CUT.js +13 -0
  359. package/dist/recording-banner-ACC67Q2U.js +2 -0
  360. package/dist/registry-6IJYQXQC.js +2 -0
  361. package/dist/remote-entry-YL7O2NJQ.js +2 -0
  362. package/dist/remote-mode-7G6PLJCW.js +4 -0
  363. package/dist/remote-words-45USLRVN.js +2 -0
  364. package/dist/require-project-folder-A3UDRELU.js +2 -0
  365. package/dist/resolve-run-intent-ZGPSUBXV.js +2 -0
  366. package/dist/resolver-IPM6R7U4.js +2 -0
  367. package/dist/revert-FHOBLZWF.js +2 -0
  368. package/dist/review-cmd-NNT5C5RZ.js +5 -0
  369. package/dist/run-5RQUCNYP.js +2 -0
  370. package/dist/run-PC5YO4AS.js +2 -0
  371. package/dist/run-channel-63SVP5OI.js +2 -0
  372. package/dist/run-remote-3AYYVPKX.js +2 -0
  373. package/dist/run-startup-gate-NKRMKYBB.js +2 -0
  374. package/dist/run-test-md-HE6DUWQR.js +17 -0
  375. package/dist/scrollback-GGNBDFQV.js +2 -0
  376. package/dist/session-target-DD53UXO7.js +2 -0
  377. package/dist/session-worker.js +12 -0
  378. package/dist/sessions-CFV7FOIT.js +2 -0
  379. package/dist/sessions-cmd-GYMETJHG.js +26 -0
  380. package/dist/sessions-remote-GI7GOBMH.js +3 -0
  381. package/dist/shell-arg-FN3MT5U7.js +2 -0
  382. package/dist/{skill-installer-T2IOCPET.js → skill-installer-3QAVQGDH.js} +1 -1
  383. package/dist/spawner-C7NLLM4F.js +2 -0
  384. package/dist/store-X6XPFSKF.js +2 -0
  385. package/dist/store-choice-RT73HAI7.js +2 -0
  386. package/dist/store-guard-SNWKLHQV.js +2 -0
  387. package/dist/store-id-YZ5WKJ25.js +2 -0
  388. package/dist/store-site-KA2DNBGY.js +2 -0
  389. package/dist/stream-warnings-GEQKKJU7.js +2 -0
  390. package/dist/structured-answers-EQ2AP3F7.js +2 -0
  391. package/dist/sync-cmd-NBPPDG3B.js +2 -0
  392. package/dist/sync-setup-5NUCH6N3.js +2 -0
  393. package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
  394. package/dist/tcg-generate-Z23CUISY.js +2 -0
  395. package/dist/test-definition-VRI4YIYL.js +2 -0
  396. package/dist/testmd-actions-GH5BW5V5.js +2 -0
  397. package/dist/testmd-sync-ACKCIOL3.js +2 -0
  398. package/dist/tms-client-NXAB6VJD.js +2 -0
  399. package/dist/token-refresh-4UCYAG6A.js +2 -0
  400. package/dist/trust-gate-AT2XBWN4.js +2 -0
  401. package/dist/turn-preflight-LHYLRL7G.js +2 -0
  402. package/dist/ui-SNV3FD2G.js +4 -0
  403. package/dist/use-case-ref-NE4X4MZN.js +2 -0
  404. package/dist/validate-basic-RE2WLIGQ.js +2 -0
  405. package/dist/{variable-receipt-F55CSW5Z.js → variable-receipt-BXSZO36E.js} +1 -1
  406. package/dist/verdicts-XK3GAUX3.js +2 -0
  407. package/dist/version-check-4FJVZP3K.js +2 -0
  408. package/dist/{view-cmd-ELDKYRMZ.js → view-cmd-N47BQZPD.js} +4 -3
  409. package/dist/walk-session-DA7QWXSW.js +2 -0
  410. package/dist/with-telemetry-7V4LY2BG.js +2 -0
  411. package/package.json +11 -11
  412. package/dist/ChatSurface-GBZX4LWL.js +0 -8
  413. package/dist/ChromeProfilePicker-UONX2UVC.js +0 -2
  414. package/dist/CliFeedbackPrompt-6BJCNRNG.js +0 -2
  415. package/dist/CliUploadProgress-K4Z22DSY.js +0 -2
  416. package/dist/ConfigView-BB22G7JO.js +0 -2
  417. package/dist/EvidenceViewOffer-25IQF3TX.js +0 -2
  418. package/dist/FolderPicker-65JFR2NW.js +0 -2
  419. package/dist/InfoBox-OU5PLRIL.js +0 -2
  420. package/dist/LinksBox-DH7TSUXW.js +0 -2
  421. package/dist/ProfilesView-MGJKBOF5.js +0 -2
  422. package/dist/ProjectPicker-YFV6K77F.js +0 -2
  423. package/dist/SaveSessionPrompt-64QKQB6B.js +0 -2
  424. package/dist/ScrollbackTap-QHJOFYMC.js +0 -2
  425. package/dist/SingleShotApp-VYKUCRVW.js +0 -2
  426. package/dist/SummaryBox-DGS3LVRF.js +0 -2
  427. package/dist/TestMdRunView-LKAITAA4.js +0 -2
  428. package/dist/TestrunEvidenceTable-PHBAB4XQ.js +0 -2
  429. package/dist/WhoamiView-6HWPYN6Y.js +0 -2
  430. package/dist/app-client-ZCCNE3RV.js +0 -2
  431. package/dist/app-download-SQ2LYYL7.js +0 -2
  432. package/dist/auth-NWBIFCB7.js +0 -2
  433. package/dist/bind-S3IQTPNN.js +0 -15
  434. package/dist/bootstrap-RCV7PNMQ.js +0 -2
  435. package/dist/bridge-O7ENTV4K.js +0 -2
  436. package/dist/build-JIKYOZUH.js +0 -2
  437. package/dist/chat-committer-6D7AQI6Z.js +0 -2
  438. package/dist/chat-controller-UJQ6Z4RE.js +0 -2
  439. package/dist/chunk-2A7OQRAD.js +0 -17
  440. package/dist/chunk-2FH4HJYB.js +0 -5
  441. package/dist/chunk-2KVECC36.js +0 -2
  442. package/dist/chunk-2YEHV2CX.js +0 -2
  443. package/dist/chunk-3OKX64UR.js +0 -2
  444. package/dist/chunk-3UI5VTQS.js +0 -4
  445. package/dist/chunk-3UMVRJX3.js +0 -6
  446. package/dist/chunk-3VAU3PNU.js +0 -2
  447. package/dist/chunk-5EOX4MEY.js +0 -2
  448. package/dist/chunk-5LJRZI7S.js +0 -6
  449. package/dist/chunk-5UHY3PTQ.js +0 -3
  450. package/dist/chunk-5ZFOKYFB.js +0 -5
  451. package/dist/chunk-63DYVWNX.js +0 -2
  452. package/dist/chunk-6YZ3VP3E.js +0 -2
  453. package/dist/chunk-7KRY26OF.js +0 -4
  454. package/dist/chunk-7N6OCHPC.js +0 -7
  455. package/dist/chunk-A2SQD2AY.js +0 -4
  456. package/dist/chunk-AACQE24F.js +0 -2
  457. package/dist/chunk-AGDPEZXT.js +0 -4
  458. package/dist/chunk-AIK7BAME.js +0 -8
  459. package/dist/chunk-ATYXPCM6.js +0 -6
  460. package/dist/chunk-AXTPNZPX.js +0 -2
  461. package/dist/chunk-BB2W35TW.js +0 -2
  462. package/dist/chunk-BKM2LWU2.js +0 -3
  463. package/dist/chunk-BL5QHONU.js +0 -2
  464. package/dist/chunk-C44QQJR4.js +0 -239
  465. package/dist/chunk-C7NWWGLT.js +0 -6
  466. package/dist/chunk-CAJZQQ3G.js +0 -3
  467. package/dist/chunk-CSVPZ33X.js +0 -2
  468. package/dist/chunk-CXF6AZWY.js +0 -2
  469. package/dist/chunk-D6E6KRVX.js +0 -2
  470. package/dist/chunk-D7WG7SRA.js +0 -2
  471. package/dist/chunk-DDHGEJJP.js +0 -2
  472. package/dist/chunk-DUYRCVI5.js +0 -2
  473. package/dist/chunk-DWHF5HUD.js +0 -2
  474. package/dist/chunk-EM3PU2YW.js +0 -2
  475. package/dist/chunk-EVFFDODK.js +0 -5
  476. package/dist/chunk-EYOCNMUM.js +0 -2
  477. package/dist/chunk-F2OBORCG.js +0 -2
  478. package/dist/chunk-FMBPUXWL.js +0 -8
  479. package/dist/chunk-FORNRNHU.js +0 -2
  480. package/dist/chunk-FQJOWUEN.js +0 -2
  481. package/dist/chunk-FQNQVC5O.js +0 -5
  482. package/dist/chunk-FY7TCYPK.js +0 -6
  483. package/dist/chunk-HJGVM6TS.js +0 -370
  484. package/dist/chunk-HPHETGRE.js +0 -2
  485. package/dist/chunk-I7TIGB7K.js +0 -2
  486. package/dist/chunk-IGHK2ENL.js +0 -2
  487. package/dist/chunk-IICT4VOU.js +0 -2
  488. package/dist/chunk-IIDBLJ5A.js +0 -18
  489. package/dist/chunk-JFZA4UON.js +0 -9
  490. package/dist/chunk-K2UJYY2U.js +0 -2
  491. package/dist/chunk-KBM3XHAM.js +0 -2
  492. package/dist/chunk-KDNNMU7Q.js +0 -4
  493. package/dist/chunk-KJQNAOOE.js +0 -6
  494. package/dist/chunk-LF42V6P6.js +0 -7
  495. package/dist/chunk-LNFU4JZ7.js +0 -2
  496. package/dist/chunk-LNSBC32V.js +0 -2
  497. package/dist/chunk-LSDWPG6C.js +0 -2
  498. package/dist/chunk-MKMJOMLX.js +0 -8
  499. package/dist/chunk-MKQ7ZRDW.js +0 -2
  500. package/dist/chunk-MSGW4JDG.js +0 -2
  501. package/dist/chunk-MV3Q335C.js +0 -7
  502. package/dist/chunk-MWIE6LOZ.js +0 -4
  503. package/dist/chunk-MZ7W4WLF.js +0 -4
  504. package/dist/chunk-NIFJJX6N.js +0 -12
  505. package/dist/chunk-NJ4BXZBX.js +0 -2
  506. package/dist/chunk-NLCCBXXV.js +0 -2
  507. package/dist/chunk-ODU2JSMA.js +0 -8
  508. package/dist/chunk-OYKRCDT4.js +0 -15
  509. package/dist/chunk-Q2F5QB2W.js +0 -2
  510. package/dist/chunk-Q4YYAN6E.js +0 -2
  511. package/dist/chunk-Q6AHSGOE.js +0 -5
  512. package/dist/chunk-QAG67DUT.js +0 -2
  513. package/dist/chunk-QGXVQIN5.js +0 -27
  514. package/dist/chunk-QQCEP3QP.js +0 -2
  515. package/dist/chunk-QU7P7B3W.js +0 -4
  516. package/dist/chunk-RAPV3BTA.js +0 -98
  517. package/dist/chunk-RD72POF2.js +0 -2
  518. package/dist/chunk-RDHWNSDP.js +0 -7
  519. package/dist/chunk-RGRFL7XG.js +0 -29
  520. package/dist/chunk-RKXHVP2Z.js +0 -2
  521. package/dist/chunk-RMVASIVL.js +0 -35
  522. package/dist/chunk-RRY5IXOB.js +0 -2
  523. package/dist/chunk-RSSOJ3L2.js +0 -21
  524. package/dist/chunk-SB2SKN34.js +0 -2
  525. package/dist/chunk-SFFDVF3J.js +0 -9
  526. package/dist/chunk-T2ONUKTL.js +0 -5
  527. package/dist/chunk-TAOHYWEO.js +0 -2
  528. package/dist/chunk-U6OTFMIT.js +0 -4
  529. package/dist/chunk-UD7KKHPW.js +0 -5
  530. package/dist/chunk-UF4MU2AZ.js +0 -22
  531. package/dist/chunk-UQSVO7TY.js +0 -9
  532. package/dist/chunk-URWWROLS.js +0 -9
  533. package/dist/chunk-V4B5QA3U.js +0 -4
  534. package/dist/chunk-VACHFCNC.js +0 -21
  535. package/dist/chunk-VAN7ECN6.js +0 -2
  536. package/dist/chunk-VIO7CCFW.js +0 -5
  537. package/dist/chunk-VOYMN2WQ.js +0 -5
  538. package/dist/chunk-VVOKM2VO.js +0 -2
  539. package/dist/chunk-W5TTF7GB.js +0 -6
  540. package/dist/chunk-WESMQEPO.js +0 -2
  541. package/dist/chunk-WICJY6KL.js +0 -6
  542. package/dist/chunk-WJR2FU7S.js +0 -16
  543. package/dist/chunk-WVHMPIDQ.js +0 -2
  544. package/dist/chunk-X4NUVVCJ.js +0 -26
  545. package/dist/chunk-XLSOQLVT.js +0 -2
  546. package/dist/chunk-YCCUBQY4.js +0 -2
  547. package/dist/chunk-YFQGOOF7.js +0 -2
  548. package/dist/chunk-YI3H2UIB.js +0 -2
  549. package/dist/chunk-YKTYVJBN.js +0 -3
  550. package/dist/chunk-YLQHY4A7.js +0 -2
  551. package/dist/chunk-ZIHG6EKH.js +0 -2
  552. package/dist/chunk-ZKSN2SJ7.js +0 -2
  553. package/dist/chunk-ZLWURCJ7.js +0 -2
  554. package/dist/committer-2QPBANRD.js +0 -2
  555. package/dist/config-7E4NS553.js +0 -2
  556. package/dist/controller-client-ZF5IXRUV.js +0 -2
  557. package/dist/cover-cmd-6KZX46S2.js +0 -3
  558. package/dist/descriptor-3JJUOHBM.js +0 -2
  559. package/dist/design-committer-D44GSUXY.js +0 -2
  560. package/dist/device-env-TZQDB5T3.js +0 -2
  561. package/dist/dispatch-KMWEDMKE.js +0 -2
  562. package/dist/doctor-XDF3MA4W.js +0 -2
  563. package/dist/docx-convert-SQRTF7XS.js +0 -2
  564. package/dist/evidence-EUIDOVOR.js +0 -2
  565. package/dist/evidence-presentation-XF23B7F2.js +0 -2
  566. package/dist/evolve-cmd-QVTGTCJ5.js +0 -2
  567. package/dist/explain-NEFBUX5G.js +0 -2
  568. package/dist/explain-cmd-36SVSHU7.js +0 -9
  569. package/dist/explain-cmd-JAOHSI4F.js +0 -3
  570. package/dist/extract-bind-PLMSZKLZ.js +0 -14
  571. package/dist/extract-cmd-RJBHPPF3.js +0 -5
  572. package/dist/feeder-66TUPB2R.js +0 -2
  573. package/dist/gaps-cmd-3WZPDDYS.js +0 -3
  574. package/dist/gate-OYRDJMF6.js +0 -2
  575. package/dist/headless-io-75HUMWZB.js +0 -2
  576. package/dist/identity-ADZ4PAJF.js +0 -2
  577. package/dist/ingest-OSNNM3DH.js +0 -2
  578. package/dist/ingest-cmd-JDIOPJBN.js +0 -2
  579. package/dist/install-Y3VKFBK3.js +0 -2
  580. package/dist/interactive-bind-XUMKEGAN.js +0 -26
  581. package/dist/interrupt-guard-UREUWNRL.js +0 -2
  582. package/dist/lifecycle-cmd-FBDRFIOE.js +0 -2
  583. package/dist/list-cmd-TFUACRAM.js +0 -3
  584. package/dist/list-commands-OHIQFJGQ.js +0 -2
  585. package/dist/locks-cmd-67OHQZNV.js +0 -2
  586. package/dist/logical-ids-GLVM2SVR.js +0 -2
  587. package/dist/login-flow-OHNKSVYZ.js +0 -2
  588. package/dist/maintenance-cmd-7OSUIDL4.js +0 -2
  589. package/dist/mobile-prompts-DEVUZRG3.js +0 -2
  590. package/dist/open-provider-746LLSEO.js +0 -2
  591. package/dist/pdf-convert-RLXSXFWN.js +0 -2
  592. package/dist/persist-recorded-session-GPP6UKN6.js +0 -3
  593. package/dist/phase-seed-MKHEWUN6.js +0 -2
  594. package/dist/pipeline-QPTPZVUJ.js +0 -2
  595. package/dist/prepare-target-N7QRNYOS.js +0 -2
  596. package/dist/readmodel-FVLRQWZ7.js +0 -2
  597. package/dist/reconcile-cmd-SMGLHMLF.js +0 -2
  598. package/dist/reconcile-deps-DVIJK5UZ.js +0 -4
  599. package/dist/reconcile-engine-KL2J5SNQ.js +0 -2
  600. package/dist/recording-banner-TCFFB6KE.js +0 -2
  601. package/dist/records-LMCVKPE5.js +0 -2
  602. package/dist/registry-BFFA4YJK.js +0 -2
  603. package/dist/require-project-folder-2224ZMJ5.js +0 -2
  604. package/dist/resolve-run-intent-HFXGEOYK.js +0 -2
  605. package/dist/resolver-GJR2Z7JY.js +0 -2
  606. package/dist/revert-NOUECRW4.js +0 -2
  607. package/dist/review-cmd-CQE6SBZA.js +0 -5
  608. package/dist/run-BXKWDJFJ.js +0 -2
  609. package/dist/run-HSP2MZPU.js +0 -2
  610. package/dist/run-channel-RGH4WIQX.js +0 -2
  611. package/dist/run-test-md-2ELPAASM.js +0 -17
  612. package/dist/scrollback-JLPJR25X.js +0 -2
  613. package/dist/session-items-2ATN7VXG.js +0 -2
  614. package/dist/session-target-UWROGOCY.js +0 -2
  615. package/dist/sessions-NH7WQWMX.js +0 -2
  616. package/dist/sessions-cmd-IV25N2L7.js +0 -25
  617. package/dist/spawner-HQM2757J.js +0 -2
  618. package/dist/store-guard-NAW26EEQ.js +0 -2
  619. package/dist/store-id-EOSGEKVK.js +0 -2
  620. package/dist/structured-answers-ZI2B6JJE.js +0 -2
  621. package/dist/sync-cmd-Q6ZYEVWI.js +0 -2
  622. package/dist/sync-setup-CA362C5S.js +0 -2
  623. package/dist/tcg-generate-CDB2N5LD.js +0 -2
  624. package/dist/testmd-actions-BDWDE2TG.js +0 -2
  625. package/dist/testmd-sync-EPTUVJYJ.js +0 -2
  626. package/dist/tms-client-KU6HCA23.js +0 -2
  627. package/dist/token-refresh-TKBOHXSD.js +0 -2
  628. package/dist/trust-gate-EX7R2P4Y.js +0 -2
  629. package/dist/turn-preflight-JGYT7LXP.js +0 -2
  630. package/dist/ui-JEJGTURD.js +0 -4
  631. package/dist/validate-basic-V7R4RH5M.js +0 -2
  632. package/dist/verdicts-7IUZFXB4.js +0 -2
  633. package/dist/version-check-PUUSB7AY.js +0 -2
  634. package/dist/walk-session-EGIMA4VG.js +0 -2
  635. package/dist/with-telemetry-LRWWBISP.js +0 -2
  636. /package/dist/{chunk-BKHXPBWN.js → chunk-2RUSXQ3O.js} +0 -0
  637. /package/dist/{chunk-6J5T5FEY.js → chunk-3AGP2BVN.js} +0 -0
  638. /package/dist/{chunk-CH273NAE.js → chunk-73Y6T2UK.js} +0 -0
  639. /package/dist/{chunk-ZMNJBUAO.js → chunk-73ZFOJOK.js} +0 -0
  640. /package/dist/{chunk-N2P4MI32.js → chunk-FWGUISUG.js} +0 -0
  641. /package/dist/{chunk-UJZZDPDY.js → chunk-HD6NR44L.js} +0 -0
  642. /package/dist/{chunk-LDPLJFCV.js → chunk-I6S6DZ2E.js} +0 -0
  643. /package/dist/{chunk-427OQS2N.js → chunk-LD5B3QFW.js} +0 -0
  644. /package/dist/{chunk-2UIHS2FH.js → chunk-PGESS7BW.js} +0 -0
  645. /package/dist/{chunk-BZAGVBCX.js → chunk-ZCIWQHCO.js} +0 -0
@@ -1,3 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as w}from"./chunk-ZLWURCJ7.js";import{a as O}from"./chunk-QSCXXNC2.js";import{a as I}from"./chunk-KBM3XHAM.js";import{f as L}from"./chunk-5LJRZI7S.js";import{a as N,b as k}from"./chunk-BKM2LWU2.js";import{a as R,b as y,c as T,d as m,e as A,g as b,h as r}from"./chunk-RSSOJ3L2.js";import{b as x}from"./chunk-5EOX4MEY.js";import{a as E}from"./chunk-RZ4F3BHX.js";import{a as g,i as v}from"./chunk-CXF6AZWY.js";import{platform as X,arch as Y}from"os";import P from"fs";import M from"fs";import D from"path";var V=1e3,d=0,j=new Set([130,3]),a=class t{ids;logger;opts;ended=!1;createdAt=Date.now();errorState;constructor(e,n={emitted:!1}){this.ids=e.envelope,this.logger=e.logger,this.opts=e,this.errorState=n}get enabled(){return this.logger!==null}event(e,n={}){if(!this.logger)return;e==="ASR_ERROR"&&(this.errorState.emitted=!0);let i=m(this.ids,e,n);this.logger.log(R[e],e,e,C(i))}error(e,n={}){this.logger&&(this.logger.escalate(d),this.event("ASR_ERROR",{...n,error_code:e}))}child(e,n){return new t({...this.opts,envelope:{...this.ids,operation_id:n,parent_operation_id:this.ids.operation_id,verb:"design"}},this.errorState)}async lateBindContext(e){if(!(!this.logger||this.ids.context_instance_id))try{let{ensureStoreIds:n}=await import("./store-id-EOSGEKVK.js"),{ids:i,cloned:s}=n(e);this.ids.context_lineage_id=i.context_lineage_id,this.ids.context_instance_id=i.context_instance_id,s&&this.event("ASR_CONTEXT_CLONED")}catch{}}agentSession(e){this.ids.agent_session_id=e}spawnEnv(){if(!this.opts.telemetryEnabled)return{};let e={TESTMUAI_USER_SESSION_ID:this.ids.session_id,TESTMUAI_OPERATION_ID:this.ids.operation_id,TESTMUAI_CLIENT_VERSION:this.opts.clientVersion,TESTMUAI_TELEMETRY_PROXY_URL:this.opts.proxyUrl};return this.ids.context_instance_id&&(e.TESTMUAI_CONTEXT_INSTANCE_ID=this.ids.context_instance_id),e}traceTee(){return e=>{if(!this.logger)return;let n=typeof e.kind=="string"?e.kind.slice(0,64):"trace",i={...C(m(this.ids,"ASR_CMD_START",{})),trace_kind:n};typeof e.code=="string"&&(i.trace_code=e.code.slice(0,64)),delete i.event,this.logger.logStep(d,`trace_${n}`,n,i)}}wireTrace(e,n,i){if(!this.logger)return;i&&this.agentSession(i);let s=n&&typeof n=="object"?n:{};switch(e){case"spawn":this.event("ASR_AGENT_SPAWN",{tier:s.tier});break;case"session_paused":this.event("ASR_SESSION_PAUSED",s);break;case"commit":this.event("ASR_COMMIT",s);break;default:this.traceTee()({kind:e,code:typeof s.code=="string"?s.code:void 0})}}banner(){return`session: ${this.ids.session_id}`}supportFooter(){return`if this keeps failing, share this id with support: ${this.ids.session_id}`}async end(e){if(!this.ended){if(this.ended=!0,e.duration_ms===void 0&&(e={...e,duration_ms:Date.now()-this.createdAt}),this.logger)if(e.exit_code===0?this.logger.discardSteps(d):this.logger.escalate(d),e.exit_code>0&&!j.has(e.exit_code)&&!this.errorState.emitted&&this.event("ASR_ERROR",{error_code:e.exit_code===2?"usage_exit_unattributed":`exit_${e.exit_code}_unattributed`,exit_code:e.exit_code}),this.event("ASR_CMD_END",e),this.opts.longSession)await this.logger.shutdown();else{let n=await this.logger.flushOnce(V);(n==="failed"||n==="timeout")&&A(this.logger.drainBuffer())}this.logger&&this.writeManifestLine(e.exit_code),r(null)}}writeManifestLine(e){try{let n=x(this.ids.context_instance_id??null);M.mkdirSync(D.dirname(n),{recursive:!0});let i={ts:new Date().toISOString(),session_id:this.ids.session_id,operation_id:this.ids.operation_id,agent_session_id:this.ids.agent_session_id,verb:this.ids.verb,mode:this.ids.mode,exit_code:e};M.appendFileSync(n,JSON.stringify(i)+`
3
- `,{flag:"a",mode:384})}catch{}}};function C(t){let e={event:t.event,session_id:t.session_id,operation_id:t.operation_id,verb:t.verb,mode:t.mode,component:t.component,seq:t.seq,context_lineage_id:t.context_lineage_id,context_instance_id:t.context_instance_id};t.parent_operation_id&&(e.parent_operation_id=t.parent_operation_id),t.agent_session_id&&(e.agent_session_id=t.agent_session_id);for(let[n,i]of Object.entries(t.context))e[n]=i;return e}var u=process.env.KANE_TELEMETRY_URL||v;function B(){return process.env.TESTMUAI_BASE_URL?"custom":process.env.TESTMUAI_ENV==="stage"?"stage":"prod"}function _e(t){let e=process.env.KANE_TELEMETRY!=="0"&&(!process.env.VITEST||process.env.KANE_TELEMETRY==="1"),n=t.env??B(),i=null;if(t.resumeSid&&t.contextRoot)try{let o=L(t.contextRoot,t.resumeSid);o?.user_session_id&&(i=o.user_session_id)}catch{}if(!i&&t.applyPlanPath)try{let o=JSON.parse(P.readFileSync(t.applyPlanPath,"utf8"));o.telemetry?.user_session_id&&(i=o.telemetry.user_session_id)}catch{}let s=i!==null;i||(i=y());let l=null,c=null,f=!1;if(t.contextRoot&&P.existsSync(t.contextRoot))if(t.write&&e){let o=k(t.contextRoot);l=o.ids.context_lineage_id,c=o.ids.context_instance_id,f=o.cloned}else{let o=N(t.contextRoot);l=o?.context_lineage_id??null,c=o?.context_instance_id??null}let h={session_id:i,operation_id:T(),context_lineage_id:l,context_instance_id:c,verb:t.verb,mode:t.mode,component:"kane-cli"},_=null;if(e){let o=I(n),S={org_id:o.org_id??"",user_id:o.user_id??"",machine_id:o.machine_id,email:null,email_domain:"",user_type:o.user_type??"unknown",env:o.env,plan:o.plan??"unknown"},U=t.mode==="interactive"||t.mode==="cli"?"cli":"agent";_=new w({proxyUrl:u,sessionId:i,identity:S,device:{cli_version:g,platform:X(),arch:Y(),host_agent:O(),invocation_mode:U},getToken:async()=>null}),t.longSession&&_.start()}let p=new a({envelope:h,logger:_,longSession:!!t.longSession,proxyUrl:u,clientVersion:`kane-cli/${g}`,telemetryEnabled:e});return e&&(r(h),p.event("ASR_CMD_START",{resumed:s,applied_plan:!!t.applyPlanPath}),f&&p.event("ASR_CONTEXT_CLONED"),b(async o=>{try{return(await E(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})).ok}catch{return!1}}).catch(()=>{})),p}export{B as a,_e as b};
@@ -1,5 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as m,g as k}from"./chunk-FY7TCYPK.js";import{f as g}from"./chunk-5LJRZI7S.js";import{join as w}from"path";import{existsSync as y}from"fs";function x(e){return(e.answer?.length??0)>0||(e.approve?.length??0)>0||(e.skip?.length??0)>0||(e.defer?.length??0)>0}function h(e){if(!x(e))return{ok:!0,value:null};let t=[],r=new Set;for(let o of e.answer??[]){let u=o.indexOf("="),c=u>0?o.slice(0,u).trim():"",n=u>0?o.slice(u+1):"";if(!c||!n)return{ok:!1,error:`--answer needs <id>=<option-number-or-text>, got '${o}'`};if(r.has(c))return{ok:!1,error:`--answer target '${c}' given twice \u2014 one answer per id`};if(r.add(c),/^\d+$/.test(n.trim())){let p=Number(n.trim());if(p<1)return{ok:!1,error:`--answer option numbers are 1-based (got '${c}=${n.trim()}')`};t.push({target:c,optionIndex:p-1})}else t.push({target:c,freeText:n})}let i=o=>[...new Set((o??[]).map(u=>u.trim()).filter(Boolean))],s=i(e.approve),a=i(e.skip),d=i(e.defer);for(let[o,u]of[s,a,d].entries())for(let c of u)if([s,a,d].some((p,f)=>f!==o&&p.includes(c)))return{ok:!1,error:`handle '${c}' appears in more than one of --approve/--skip/--defer`};return{ok:!0,value:{answers:t,approve:s,skip:a,defer:d}}}function E(e,t){if(!x(e))return null;let r=t==="extract"?"extract":"design",i=h(e);return i.ok?e.resume?e.mode!=="agent"?`${r}: --answer/--approve/--skip/--defer are the structured agent-mode resume surface \u2014 add --mode agent (interactively, just answer in the session)`:null:`${r}: --answer/--approve/--skip/--defer address a paused session's pending panels \u2014 pair them with --resume <sid>`:`${r}: ${i.error}`}function P(e,t){if(e.archetype==="pause-card")return null;if(e.archetype==="walk-card"){let s=e.body.card??{},a=new Set([e.id]);for(let d of["temp_ref","ref","cid"]){let o=s[d];typeof o=="string"&&o&&a.add(o)}for(let[d,o]of[["approve",t.approve],["skip",t.skip],["defer",t.defer]]){let u=o.find(c=>a.has(c));if(u)return{kind:"verdict",panelId:e.id,ref:u,v:d}}return null}if(e.archetype==="ask"){let s=e.body.questions??[];for(let a=0;a<s.length;a++){let d=t.answers.find(o=>o.target===s[a].id||o.target===e.id);if(d)return d.optionIndex!==void 0?d.optionIndex<0||d.optionIndex>=(s[a].options?.length??0)?null:{kind:"answer",panelId:e.id,qIndex:a,optionIndex:d.optionIndex}:{kind:"answer",panelId:e.id,qIndex:a,freeText:d.freeText??""}}return null}let r=t.answers.find(s=>s.target===e.id);if(!r)return null;let i=e.body.options;return r.optionIndex!==void 0?!Array.isArray(i)||r.optionIndex<0||r.optionIndex>=i.length?null:{kind:"answer",panelId:e.id,qIndex:0,optionIndex:r.optionIndex}:{kind:"answer",panelId:e.id,qIndex:0,freeText:r.freeText??""}}function v(e,t){let r=g(e,t);if(!r)return null;let i=r.pending.questions;try{if(y(w(e,"sessions",t,m))){let a=k(e,t).kane?.pending.questions??[];a.length>0&&(i=a)}}catch{}return{questions:i,panels:[],appliedEvents:r.applied_events??[]}}function I(e){let t=e.questions.map(o=>o.id),r=[],i=[],s=[];for(let o of e.panels){if(s.push(o.id),o.archetype==="ask")for(let u of o.body.questions??[])r.push(u.id);if(o.archetype==="walk-card"){let u=o.body.card??{};for(let c of["temp_ref","ref","cid"]){let n=u[c];typeof n=="string"&&n&&i.push(n)}}}let a=(o,u)=>u.length>0?`${o}: ${u.join(", ")}`:null,d=[a("questions",[...new Set([...t,...r])]),a("panels",s),a("verdict handles",i)].filter(o=>o!==null);return d.length>0?`addressable pending ids \u2014 ${d.join(" \xB7 ")}`:"this session has NO pending panels or questions"}function $(e,t,r,i){let s=[],a=new Map(t.questions.map(n=>[n.id,n])),d=new Map(t.panels.map(n=>[n.id,n])),o=new Map,u=new Set;for(let n of t.panels){if(n.archetype==="ask")for(let p of n.body.questions??[])o.set(p.id,p);if(n.archetype==="walk-card"){let p=n.body.card??{};u.add(n.id);for(let f of["temp_ref","ref","cid"]){let l=p[f];typeof l=="string"&&l&&u.add(l)}}}let c=()=>{let n=t.questions[0],p=n?` --answer ${n.id}=${n.recommendedOptionIndex+1}`:"";return`try: ${i}${p}`};for(let n of e.answers){let p=a.get(n.target)??o.get(n.target);if(p){let l=p.options?.length??0;if(n.optionIndex!==void 0&&(n.optionIndex<0||n.optionIndex>=l))return{ok:!1,error:`error: --answer ${n.target}=${n.optionIndex+1} is out of range \u2014 '${n.target}' has ${l} option(s) (numbers are 1-based)`};continue}let f=d.get(n.target);if(f){let l=f.body.options;if(n.optionIndex!==void 0&&Array.isArray(l)&&(n.optionIndex<0||n.optionIndex>=l.length))return{ok:!1,error:`error: --answer ${n.target}=${n.optionIndex+1} is out of range \u2014 the panel has ${l.length} option(s) (numbers are 1-based)`};continue}if(t.appliedEvents.includes(`resolveq:${r}:${n.target}`)||t.appliedEvents.includes(`assumed:${r}:${n.target}`)){s.push(`note: '${n.target}' was already answered \u2014 --answer ${n.target}=\u2026 is a no-op`);continue}return{ok:!1,error:`error: unknown --answer target '${n.target}' \u2014 ${I(t)}
3
- ${c()}`}}for(let[n,p]of[["--approve",e.approve],["--skip",e.skip],["--defer",e.defer]])for(let f of p){if(u.has(f))continue;let l=u.size>0?`addressable verdict handles: ${[...u].join(", ")}`:"this session has NO pending walk/review cards";return{ok:!1,error:`error: unknown ${n} handle '${f}' \u2014 ${l}
4
- ${c()}`}}return{ok:!0,notes:s}}function S(e,t){let r=[],i=[];for(let s of e){let a=t.answers.find(o=>o.target===s.id);if(!a)continue;i.push(s.id);let d=a.optionIndex!==void 0?s.options[a.optionIndex]?.label??`option ${a.optionIndex+1}`:a.freeText??"";r.push(`- ${s.question} [${s.id}] \u2192 ${d}`)}return r.length===0?{statement:null,matchedQids:[]}:{statement:["Structured resume answers (applied via --answer flags \u2014 these ARE the human's decisions; do not re-ask them):",...r].join(`
5
- `),matchedQids:i}}var b=/^kane-cli (context extract|design tests) --resume [A-Za-z0-9][A-Za-z0-9._-]*( --mode (agent|interactive|ci|override))?( --answer \S+=\d+)*$/;function A(e){try{let t=typeof e.resume=="string"?e.resume:null;if(!t)return[];let r=[{cmd:t,why:"resume the paused session",title:"Resume the session"}],i=Array.isArray(e.pending_questions)?e.pending_questions.filter(s=>s&&typeof s.id=="string"&&!/\s/.test(s.id)):[];if(i.length>0){let s=i.map(d=>{let o=typeof d.recommended_index=="number"&&d.recommended_index>=0?d.recommended_index:0;return` --answer ${d.id}=${o+1}`}).join(""),a=`${t}${s}`;b.test(a)&&r.push({cmd:a,why:`answer the ${i.length} pending question(s) non-interactively \u2014 --answer <question-id>=<option number (1-based) or free text>, repeatable; shown with each question's recommended option`,title:"Answer via structured flags"})}return r}catch{return[]}}function O(e){let t=null;return{encoding:e.encoding,out:e.out,progress:e.progress,event:r=>{if(r.type==="session_paused"&&!("next"in r)&&typeof r.resume=="string"){let i=A(r);if(i.length>0){t=i,e.event({...r,next:i});return}}e.event(r)},done:(r,i,s)=>e.done(r,i,s??(r===3&&t?t:void 0))}}function R(e,t){return e==="design"?`kane-cli design tests --resume ${t} --mode agent`:`kane-cli context extract --resume ${t} --mode agent`}function Q(e){let t=h(e.opts);if(!t.ok)return{kind:"refuse",error:`error: ${t.error}`,code:"STRUCTURED_FLAGS_USAGE"};if(!t.value)return{kind:"none"};let r=e.opts.resume;if(!r)return{kind:"refuse",error:"error: structured resume flags need --resume <sid>",code:"STRUCTURED_FLAGS_USAGE"};let i=v(e.contextDir,r);if(!i)return{kind:"none"};let s=$(t.value,i,r,R(e.verb,r));if(!s.ok)return{kind:"refuse",error:s.error,code:"STRUCTURED_TARGET_UNKNOWN"};let{statement:a,matchedQids:d}=S(i.questions,t.value);return{kind:"apply",answers:t.value,statement:a,matchedQids:d,notes:s.notes}}export{x as a,h as b,E as c,P as d,v as e,$ as f,S as g,b as h,A as i,O as j,R as k,Q as l};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as t}from"./chunk-427OQS2N.js";import{a,b as s,c as n}from"./chunk-XLSOQLVT.js";function y(o="extract"){let i=new Set(t(o)),c=Object.fromEntries(Object.keys(s).map(r=>{let e=s[r];return[r,{hashed:[...e.hashed],unhashed:[...e.unhashed??[]],required:[...e.required],enums:Object.fromEntries(Object.entries(e.enums).map(([p,g])=>[p,[...g]])),mintable:i.has(r)}]})),d=Object.fromEntries(Object.keys(n).map(r=>{let e=n[r];return[r,{src:[...e.src],dst:[...e.dst],salient:[...e.salient],props:[...e.props],cardinality:e.cardinality,acyclic:e.acyclic,direction:"dependent->dependency"}]}));return{schema_version:a,nodes:c,edges:d,mint_gate:t(o),blob_fingerprint:{algo:"sha256",domain:"assurance.blob\0",prefix:"sha256:"}}}export{y as a};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as s}from"./chunk-HJX5PQRD.js";import{promises as o}from"fs";import{basename as d,join as a}from"path";function l(t){let e=(t??"").trim().replace(/^lt:\/\//i,"").trim();if(e)return(s(e)?e:d(e))||void 0}function g(t){return t.replace(/\([^)]*\)/g," ").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||void 0}async function w(t){try{let e=a(t,"steps"),u=(await o.readdir(e,{withFileTypes:!0})).filter(n=>n.isDirectory()).map(n=>n.name).sort((n,i)=>(parseInt(n,10)||0)-(parseInt(i,10)||0));for(let n of u)try{let i=await o.readFile(a(e,n,"step.json"),"utf8"),r=JSON.parse(i).basis?.window;if(Array.isArray(r)&&r.length===2&&Number.isFinite(Number(r[0]))&&Number.isFinite(Number(r[1]))&&Number(r[0])>0&&Number(r[1])>0)return`${Math.round(Number(r[0]))}x${Math.round(Number(r[1]))}`}catch{}return}catch{return}}export{l as a,g as b,w as c};
@@ -1,4 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{e as $e}from"./chunk-ATYXPCM6.js";import{a as te}from"./chunk-5HOHXV2K.js";import{a as K}from"./chunk-5Y2G4NC7.js";import{a as Be}from"./chunk-3C32LVLX.js";import{a as ve}from"./chunk-IGHK2ENL.js";import{y as i}from"./chunk-CXF6AZWY.js";import{b as ye}from"./chunk-DFS4RMVP.js";import{a as k}from"./chunk-HCBYKLMW.js";import{a as s,b as o,i as Se,j as Te,k as ee}from"./chunk-C44QQJR4.js";import{a as V}from"./chunk-6YGTRKDT.js";import{e as R}from"./chunk-UR6MHSHU.js";var A=R(V(),1);var C=R(V(),1);function de(e){let t=e.flatMap(u=>[u,...u.children??[]]),n=t.filter(u=>u.status==="passed").length,l=t.filter(u=>u.status==="failed").length,a=t.filter(u=>u.status==="passed"||u.status==="failed").length;return{passed:n,failed:l,total:a}}function we(e){let t=$e(e.screenshotDispatcher,e.stepLogger,e.onReasoning,e.onStepComplete),[n,l]=(0,C.useState)(0),[a,u]=(0,C.useState)("idle"),c=(0,C.useRef)("idle"),v=(0,C.useRef)(0),S=(0,C.useRef)(!1),T=(0,C.useRef)(null),d=(0,C.useRef)(null),L=(0,C.useCallback)(h=>{c.current=h,u(h)},[]),O=(0,C.useCallback)(async h=>{let b=await e.getNextConfig(h);if(!b){L("done"),e.onAllComplete?.();return}let B=h?v.current+1:0;v.current=B,l(B),e.onStepStart?.(b,B),T.current=null,d.current=null,L("running"),await t.startRun(b,e.spawnOpts)},[t,e,L]);(0,C.useEffect)(()=>{S.current||(S.current=!0,O(null))},[]),(0,C.useEffect)(()=>{if(!t.lastRunEnd||t.lastRunEnd===T.current||c.current!=="running")return;T.current=t.lastRunEnd,c.current="transitioning",u("transitioning");let h=t.lastRunEnd,b=de(t.steps),B=t.bifurcationInfo,F={status:h.status==="passed"?"passed":"failed",duration_s:h.duration??0,reason:h.reason,runEnd:h,hadError:!1,stepsPassed:b.passed,stepsFailed:b.failed,stepsTotal:b.total,bifurcationFlows:B&&!B.isSingleFlow?B.flows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(F,v.current)??!0)){L("done"),e.onAllComplete?.();return}O(F)},[t.lastRunEnd]),(0,C.useEffect)(()=>{if(!t.runError||t.runError===d.current||t.lastRunEnd||c.current!=="running")return;d.current=t.runError,c.current="transitioning",u("transitioning");let h=de(t.steps),b={status:"failed",duration_s:0,reason:t.runError,runEnd:null,hadError:!0,stepsPassed:h.passed,stepsFailed:h.failed,stepsTotal:h.total,bifurcationFlows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(b,v.current)??!0)){L("done"),e.onAllComplete?.();return}O(b)},[t.runError,t.lastRunEnd]);let y=(0,C.useCallback)(()=>{t.cancelRun()},[t]);return{runner:t,currentStepIndex:n,phase:a,cancel:y}}var pe=R(V(),1);var ne=R(k(),1),Ee=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function ke({label:e,hasBifurcation:t=!1}){let[n,l]=(0,pe.useState)(0),[a,u]=(0,pe.useState)(0);K(()=>{l(v=>(v+1)%Ee.length)},80),K(()=>{u(v=>(v+1)%4)},400);let c=e??(t?"Planning approach":"Analyzing objective");return(0,ne.jsxs)(s,{marginLeft:1,children:[(0,ne.jsxs)(o,{color:i.orange,children:[Ee[n]," "]}),(0,ne.jsxs)(o,{color:i.dim,children:[c,".".repeat(a+1)]})]})}function Ie(e){if(!e.isRunning||e.replayInfo)return null;let t=e.bifurcationInfo;if(t&&!t.isSingleFlow){let n=e.steps.findIndex(a=>a.status==="running");return(n===-1?e.cmInitCounts.length===0:n>=e.cmInitCounts.length)?{label:n>0?`Planning flow ${n+1}`:void 0,hasBifurcation:!0}:null}return e.cmInitCounts.length>0||e.steps.some(n=>n.children?.length)?null:{hasBifurcation:!!t}}var I=R(V(),1);var Ce=R(V(),1);var re=R(k(),1),He="#ffc580",Ue="#ffd9a8",Le="#ffffff";function oe({text:e,active:t=!0}){let[n,l]=(0,Ce.useState)(0),a=4;if(K(()=>{l(c=>(c+1)%(e.length+a*2))},t?80:null),!t)return(0,re.jsx)(o,{color:Le,children:e});let u=e.split("").map((c,v)=>{let S=n-a,T=Math.abs(v-S-a/2),d;return T<=a/2?d=He:T<=a?d=Ue:d=Le,(0,re.jsx)(o,{color:d,children:c},v)});return(0,re.jsx)(o,{children:u})}var _=R(k(),1),We={starting:i.orange,running:i.orange,passed:i.green,failed:i.red,cancelled:i.dim,timed_out:i.orange};function ie({currentStep:e,maxSteps:t,elapsed:n,status:l}){let a=We[l]??i.orange,u=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`;return(0,_.jsxs)(s,{marginLeft:3,children:[(0,_.jsx)(o,{color:i.dim,children:"Steps "}),(0,_.jsx)(o,{bold:!0,children:e}),(0,_.jsxs)(o,{color:i.dim,children:["/",t]}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Elapsed "}),(0,_.jsx)(o,{bold:!0,children:u}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Status "}),(0,_.jsx)(o,{bold:!0,color:a,children:l})]})}var Ve={click:"\u25CF",type:"\u229E",scroll:"\u2195",navigate:"\u2192",analyze:"\u25CE",assert:"\u25C8","if-else":"\u2442",select:"\u25BC",press_key:"\u21B5",wait:"\u2026",tool_call:"\u2299"};function Oe(e){return Ve[e]??"\u25CF"}var q=R(k(),1);function fe({steps:e,flows:t,cmInitCounts:n,renderStep:l}){return(0,q.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[(0,q.jsxs)(o,{color:i.dim,children:["\u2501\u2501 Bifurcated into ",t?.length??e.length," flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"]}),e.map((a,u)=>(0,q.jsxs)(s,{flexDirection:"column",marginTop:u>0?1:0,children:[(0,q.jsxs)(o,{color:i.orange,children:["Flow ",u+1,": ",t?.[u]??a.objective]}),n&&n[u]!=null&&(0,q.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",n[u]," checkpoints"]}),a.children&&a.children.length>0?a.children.map(c=>{let v=!!c.branchObjective,S=`f${u}-${c.childId??"p"}-${c.index}`;return v?(0,q.jsxs)(s,{flexDirection:"column",children:[l({...c,children:void 0},S),(c.children??[]).map(T=>(0,q.jsx)(s,{marginLeft:2,children:l(T,`${S}-${T.childId??"p"}-${T.index}`)},`${S}-${T.childId??"p"}-${T.index}`))]},`${S}-host`):l(c,S)}):a.status==="pending"&&(0,q.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})]},u))]})}var H=R(k(),1);function Pe({label:e,shimmer:t=!1}){return(0,H.jsxs)(s,{marginLeft:6,children:[(0,H.jsx)(te,{}),(0,H.jsx)(o,{children:" "}),t?(0,H.jsx)(oe,{text:e,active:!0}):(0,H.jsx)(o,{color:i.dim,children:e})]})}var De=R(V(),1);var me=R(k(),1);function ze(e,t){let n=[];for(let l of e.split(`
3
- `)){if(l===""){n.push("");continue}let a="";for(let u of l.split(" ")){let c=u;for(;c.length>t;)a&&(n.push(a),a=""),n.push(c.slice(0,t)),c=c.slice(t);a===""?a=c:a.length+1+c.length<=t?a+=" "+c:(n.push(a),a=c)}n.push(a)}return n}function je({text:e,maxLines:t=3}){let{stdout:n}=ee(),l=Math.max(20,(n?.columns??80)-7),a=!e.trim(),[u,c]=(0,De.useState)(!0);K(()=>c(T=>!T),500);let v=(a?"Thinking\u2026":e)+(u?"\u258C":" "),S=ze(v,l).slice(-t);for(;S.length<t;)S.push("");return(0,me.jsx)(s,{borderStyle:"round",borderColor:i.muted,paddingX:1,marginLeft:3,flexDirection:"column",children:S.map((T,d)=>(0,me.jsx)(o,{color:a?i.dim:i.secondary,wrap:"truncate-end",children:T.length?T:" "},d))})}var U=R(k(),1);function se({activity:e,describe:t,describeVisible:n}){return(0,U.jsxs)(U.Fragment,{children:[e?(0,U.jsx)(Pe,{label:e.label,shimmer:e.shimmer}):null,n?(0,U.jsx)(je,{text:t??""}):null]})}var r=R(k(),1);function le(e){for(let t of e){if(t.children&&t.children.length>0){let n=le(t.children);if(n)return n}if(t.status==="running")return t}}function z(e){return e.status==="running"&&!e.branchObjective&&(!e.children||e.children.length===0)}function Fe(e){let t=[];for(let n of e)z(n)||(n.children&&n.children.length>0?t.push({...n,children:Fe(n.children)}):t.push(n));return t}function ge(e,t){if(!e)return null;let n=e.objective??"";return n.length>0&&!/^Step \d+$/.test(n)?{label:n+"\u2026",shimmer:!1}:{label:t?"Looking at the screen\u2026":"Deciding next action\u2026",shimmer:!0}}function P({step:e,indent:t=2}){let n=e.actionType?Oe(e.actionType):null,l=e.status==="running",a=e.status==="passed",u=e.status==="failed",c=e.status==="pending"||e.status==="stopped",{stdout:v}=ee(),S=v?.columns??80,T=Math.max(20,S-t-21),d=e.objective??"",L=d.length>T?d.slice(0,T-1)+"\u2026":d,O=(e.duration??0)*1e3,y=e.duration!=null?O<1e3?`${Math.round(O)}ms`:`${(O/1e3).toFixed(1)}s`:"";return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsxs)(s,{marginLeft:t,children:[(0,r.jsx)(s,{width:4,children:(0,r.jsxs)(o,{color:i.muted,children:[String(e.index).padStart(2," ")," "]})}),(0,r.jsx)(s,{width:3,children:l?(0,r.jsx)(te,{}):a?(0,r.jsx)(o,{color:i.green,bold:!0,children:"\u2713"}):u?(0,r.jsx)(o,{color:i.red,bold:!0,children:"\u2717"}):(0,r.jsx)(o,{color:i.muted,children:"\u25CB"})}),(0,r.jsx)(s,{flexGrow:1,children:l?(0,r.jsx)(oe,{text:L,active:!0}):u?(0,r.jsx)(o,{color:i.red,children:L}):c?(0,r.jsx)(o,{color:i.dim,children:L}):(0,r.jsx)(o,{color:i.dim,children:L})}),(a||u)&&n?(0,r.jsx)(s,{width:3,marginLeft:1,children:(0,r.jsx)(o,{color:i.muted,children:n})}):(0,r.jsx)(s,{width:3,marginLeft:1}),(0,r.jsx)(s,{width:7,justifyContent:"flex-end",children:(0,r.jsx)(o,{color:i.dim,children:y})})]}),e.children&&e.children.length>0&&(0,r.jsx)(s,{flexDirection:"column",children:e.children.map((h,b)=>(0,r.jsx)(P,{step:h,indent:t+2},`child-${b}`))})]})}function Xe(e){return e.type==="cm_init"?(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",e.count," checkpoints"]})}):(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsx)(P,{step:e.step})})}function _e({steps:e,bifurcated:t,flows:n,cmInitCounts:l,maxSteps:a=50,staticSteps:u=!1,onStepCommit:c,describe:v,describeVisible:S,describeRevealing:T}){let d=(0,I.useRef)(new Set),L=(0,I.useRef)(!1),O=(0,I.useRef)(new Set),y=(0,I.useRef)(!1),h=(0,I.useRef)(new Set),b=(0,I.useRef)(0);(0,I.useEffect)(()=>{e.length===0&&b.current>0&&(d.current.clear(),L.current=!1,O.current.clear(),y.current=!1,h.current.clear()),b.current=e.length},[e.length]);let B=e.flatMap(p=>[p,...p.children??[]]),F=B.some(p=>p.status==="running"),M=B.some(p=>p.status==="failed"),X=B.length===0||B.every(p=>p.status==="pending"),Y=B.filter(p=>p.status==="passed"||p.status==="failed").length,N;X?N="starting":F?N="running":M?N="failed":N="passed";let J=(0,I.useRef)(null),[ce,he]=(0,I.useState)(0);(0,I.useEffect)(()=>{B.length===0||X?(J.current=null,he(0)):F&&J.current==null&&(J.current=Date.now())},[F,X,B.length]),(0,I.useEffect)(()=>{if(!F)return;let p=setInterval(()=>{J.current!=null&&he((Date.now()-J.current)/1e3)},500);return()=>clearInterval(p)},[F]);let ae=(0,I.useRef)(new Set),[,xe]=(0,I.useState)(0),be=(0,I.useRef)(!1);(0,I.useEffect)(()=>{if(!c||!u||t)return;let p=[];!be.current&&l&&l[0]!=null&&(be.current=!0,l[0]>0&&p.push({key:"cm_init_0",type:"cm_init",count:l[0]}));for(let g of e)(g.status==="passed"||g.status==="failed")&&!ae.current.has(g.index)&&(ae.current.add(g.index),p.push({key:`step_${g.index}`,type:"step",step:{...g,children:g.children?[...g.children]:void 0}}));if(p.length>0){for(let g of p)c(Xe(g));xe(g=>g+1)}},[e,t,l,u,c]),(0,I.useEffect)(()=>{if(!c||u)return;let p=d.current.size;if(!t&&!y.current&&l&&l[0]!=null&&(y.current=!0,l[0]>0&&c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25A0 Generated task with ",l[0]," checkpoints"]})}))),t&&n&&!L.current&&(L.current=!0,c((0,r.jsx)(o,{color:i.purple,children:"\u2501\u2501 Bifurcated into "+n.length+" flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"}))),t){let g=e.flatMap((x,f)=>{let m=x.children??[];return!O.current.has(f)&&m.length>0&&(O.current.add(f),c((0,r.jsx)(o,{color:i.purple,children:" Flow "+(f+1)+": "+(n?.[f]??"")})),l?.[f]!=null&&l[f]>0&&!h.current.has(f)&&(h.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})})))),l?.[f]!=null&&l[f]>0&&O.current.has(f)&&!h.current.has(f)&&(h.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})}))),m});for(let x of g){let f=`${x.childId??"p"}-${x.index}-${x.objective}`;if(!!x.branchObjective){d.current.has(f)||(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...x,children:void 0}})})));for(let $ of x.children??[]){let w=`child-${x.childId??"p"}-${x.index}-${$.childId??"p"}-${$.index}-${$.objective}`;d.current.has(w)||($.status==="passed"||$.status==="failed"||$.status==="stopped")&&(d.current.add(w),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(P,{step:$})})))}continue}d.current.has(f)||(x.status==="passed"||x.status==="failed"||x.status==="stopped")&&(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:x})})))}}else for(let g of e){let x=`${g.index}-${g.objective}`,f=!!g.branchObjective;f&&!d.current.has(x)&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...g,children:void 0}})})));for(let m of g.children??[]){let $=`child-${g.index}-${m.childId??"p"}-${m.index}-${m.objective}`;d.current.has($)||(m.status==="passed"||m.status==="failed"||m.status==="stopped")&&(d.current.add($),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(P,{step:m})})))}!f&&!d.current.has(x)&&(g.status==="passed"||g.status==="failed"||g.status==="stopped")&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...g,children:void 0}})})))}d.current.size>p&&xe(g=>g+1)},[e,c,t,n,l]);let G=[];if(u&&!t)for(let p of e)ae.current.has(p.index)||G.push(p);else if(c&&!u)if(t)for(let p of e){let g=p.children??[],x=[];for(let f of g){let m=`${f.childId??"p"}-${f.index}-${f.objective}`,$=d.current.has(m);if(f.branchObjective){let w=(f.children??[]).filter(Q=>{let ue=`child-${f.childId??"p"}-${f.index}-${Q.childId??"p"}-${Q.index}-${Q.objective}`;return!d.current.has(ue)});(!$||w.length>0)&&x.push({...f,children:w})}else $||x.push(f)}x.length>0&&G.push({...p,children:x})}else for(let p of e){let g=`${p.index}-${p.objective}`,x=d.current.has(g),f=(p.children??[]).filter(m=>{let $=`child-${p.index}-${m.childId??"p"}-${m.index}-${m.objective}`;return!d.current.has($)});x?f.length>0&&G.push({...p,children:f}):G.push({...p,children:f})}if(!u){let p=c?G:e,g=le(p),x=ge(g,T);return(0,r.jsxs)(s,{flexDirection:"column",children:[t?c?p.length>0?(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:p.map((m,$)=>(0,r.jsx)(s,{flexDirection:"column",marginTop:$>0?1:0,children:m.children&&m.children.length>0?m.children.map(w=>{if(z(w))return null;let Q=!!w.branchObjective,ue=`${w.childId??"p"}-${w.index}-${w.objective}`,Ke=d.current.has(ue);return Q?(0,r.jsxs)(s,{flexDirection:"column",children:[!Ke&&(0,r.jsx)(P,{step:{...w,children:void 0}}),(w.children??[]).filter(Z=>!z(Z)).map(Z=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:Z})},`f${$}-${w.index}-${Z.childId??"p"}-${Z.index}`))]},`f${$}-host-${w.childId??"p"}-${w.index}`):(0,r.jsx)(P,{step:w},`f${$}-${w.childId??"p"}-${w.index}`)}):m.status==="pending"&&(0,r.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})},$))}):null:(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(m,$)=>z(m)?null:(0,r.jsx)(P,{step:m},$)}):(0,r.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[!c&&l&&l[0]!=null&&(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",l[0]," checkpoints"]}),p.filter(m=>!(m.status==="running"&&(!m.children||m.children.length===0))).map(m=>{let $=`${m.index}-${m.objective}`;return c&&d.current.has($)?(0,r.jsx)(s,{flexDirection:"column",children:(m.children??[]).filter(w=>!z(w)).map(w=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:w})},`${w.childId??"p"}-${w.index}`))},`branch-children-${m.index}`):(0,r.jsx)(P,{step:m},m.index)})]}),(0,r.jsx)(se,{activity:x,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}if(t){let p=le(e),g=ge(p,T);return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(x,f)=>z(x)?null:(0,r.jsx)(P,{step:x},f)}),(0,r.jsx)(se,{activity:g,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}let Ne=le(G),Ge=ge(Ne,T),Re=Fe(G);return(0,r.jsxs)(s,{flexDirection:"column",children:[Re.length>0&&(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:Re.map(p=>(0,r.jsx)(P,{step:p},p.index))}),(0,r.jsx)(se,{activity:Ge,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}var W=R(k(),1);function Ae({runner:e,runKey:t,onStepCommit:n}){let l=Ie({isRunning:e.isRunning,bifurcationInfo:e.bifurcationInfo,steps:e.steps,cmInitCounts:e.cmInitCounts,replayInfo:e.replayInfo});return(0,W.jsxs)(W.Fragment,{children:[l&&(0,W.jsx)(ke,{label:l.label,hasBifurcation:l.hasBifurcation}),e.isRunning&&e.steps.length>0&&(0,W.jsx)(_e,{steps:e.steps,bifurcated:!!e.bifurcationInfo&&!e.bifurcationInfo.isSingleFlow,flows:e.bifurcationInfo?.flows,cmInitCounts:e.cmInitCounts,maxSteps:e.maxSteps,onStepCommit:n},`run-${t}`)]})}var D=R(k(),1),Ye=64;function Je(e){return e.split(`
4
- `).map(t=>t.replace(/^[-–•]\s*/,"").trim()).filter(t=>t.length>0)}function qe({status:e,summary:t,duration:n,steps:l,stepsPassed:a,stepsFailed:u,reason:c,creditsConsumed:v}){let S=e==="passed",T=S?i.green:i.red,d=S?"\u2713":"\u2717",L=e.toUpperCase(),O=a??(S?l:Math.max(0,l-1)),y=u??(S?0:1),h=y>0?`${l} steps (${O} passed, ${y} failed)`:`${l} steps`,b=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`,B=Je(t);return(0,D.jsx)(s,{flexDirection:"column",marginTop:1,children:(0,D.jsxs)(s,{borderStyle:"round",borderColor:T,flexDirection:"column",paddingX:2,paddingY:1,width:Ye+6,children:[(0,D.jsxs)(s,{flexDirection:"column",children:[(0,D.jsxs)(o,{bold:!0,color:T,children:[d," ",L]}),(0,D.jsxs)(o,{color:i.dim,wrap:"wrap",children:[h," \xB7 ",b,typeof v=="number"&&v>0?` \xB7 ${parseFloat(v.toFixed(4))} credits`:""]})]}),B.length>0&&(0,D.jsx)(s,{flexDirection:"column",marginTop:1,marginLeft:1,children:B.map((F,M)=>(0,D.jsxs)(s,{marginBottom:M<B.length-1?1:0,children:[(0,D.jsx)(o,{color:i.orange,children:"\u25CF "}),(0,D.jsx)(s,{flexShrink:1,children:(0,D.jsx)(o,{wrap:"wrap",children:F})})]},M))}),c&&!S&&(0,D.jsx)(s,{marginTop:1,children:(0,D.jsxs)(o,{color:i.red,wrap:"wrap",children:["Reason: ",c]})})]})})}var j=R(k(),1);function Me({message:e,code:t,remediation:n,docsUrl:l}){return(0,j.jsx)(ve,{title:"Error",variant:"error",children:(0,j.jsxs)(s,{flexDirection:"column",paddingY:1,children:[(0,j.jsxs)(o,{color:i.red,bold:!0,children:[" \u2717 ",e]}),t&&(0,j.jsxs)(s,{marginTop:0,marginLeft:5,children:[(0,j.jsx)(o,{color:i.muted,children:"Code: "}),(0,j.jsx)(o,{color:i.dim,children:t})]}),n&&(0,j.jsxs)(s,{flexDirection:"column",marginTop:1,marginLeft:5,children:[(0,j.jsx)(o,{color:i.green,bold:!0,children:"Fix:"}),(0,j.jsxs)(o,{color:i.orange,children:["$ ",n]})]}),l&&(0,j.jsxs)(s,{marginTop:1,marginLeft:5,children:[(0,j.jsx)(o,{color:i.muted,children:"Docs: "}),(0,j.jsx)(o,{color:i.orange,underline:!0,children:l})]})]})})}var E=R(k(),1);function un(e){let{exit:t}=Te(),{append:n}=ye(),l=(0,A.useRef)(!1);(0,A.useEffect)(()=>{l.current||(l.current=!0,n((0,E.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,E.jsxs)(s,{borderStyle:"round",borderColor:"#dc4e08",paddingX:2,children:[(0,E.jsx)(o,{color:"#ff9500",bold:!0,children:"KaneAI CLI"}),(0,E.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,E.jsx)(o,{color:i.orange,children:e.topBanner.model}),(0,E.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,E.jsx)(o,{color:i.dim,children:e.topBanner.auth})]})})),n((0,E.jsx)(Qe,{data:e.globalConfig})),e.priorAttemptRollup&&n((0,E.jsx)(o,{color:i.dim,children:` \u21B3 replayed ${e.priorAttemptRollup.startIdx}..${e.priorAttemptRollup.endIdx-1} (${e.priorAttemptRollup.count} steps, from prior attempt)`})))},[]);let a=(0,A.useRef)(null),u=(0,A.useCallback)(async y=>{let h=await e.getNextStep(y);return h?(a.current=h,h.config):(a.current=null,null)},[e]),c=(0,A.useCallback)((y,h)=>{let b=a.current;if(!b)return;let B=b.mode==="replay"?"cyan":"#dc4e08",F=b.modeReason?` (${b.modeReason})`:"",M=b.perStepOverrides?Object.entries(b.perStepOverrides):[];n((0,E.jsxs)(s,{flexDirection:"column",marginBottom:0,children:[(0,E.jsxs)(o,{children:[(0,E.jsxs)(o,{color:i.dim,children:[b.banner.stepLabel," "]}),(0,E.jsxs)(o,{color:B,children:["[",b.mode,"]"]}),(0,E.jsx)(o,{color:i.dim,children:F})]}),(0,E.jsx)(o,{color:i.dim,children:b.banner.objective}),M.length>0&&(0,E.jsxs)(o,{color:i.dim,children:["overrides: ",M.map(([X,Y])=>`${X}=${Y}`).join(", ")]})]}))},[n]),v=(0,A.useRef)(0),S=(0,A.useRef)(!1),T=(0,A.useCallback)((y,h)=>(y.hadError?n((0,E.jsx)(Me,{message:y.reason??"Runner error",code:"RUNNER_ERROR"})):n((0,E.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,E.jsx)(qe,{status:y.status,summary:y.runEnd?.summary??"",duration:y.runEnd?.duration??0,steps:y.stepsTotal,stepsPassed:y.stepsPassed,stepsFailed:y.stepsFailed,reason:y.runEnd?.reason,creditsConsumed:y.runEnd?.credits_consumed})})),e.onStepEnd?.(y,h)??!0),[n,e]),d=we({getNextConfig:u,onStepStart:c,onStepEnd:T,onAllComplete:()=>{e.onAllComplete(),e.exitOnComplete!==!1&&setImmediate(()=>t())},screenshotDispatcher:e.screenshotDispatcher,stepLogger:e.stepLogger,onReasoning:e.onReasoning,onStepComplete:e.onStepComplete,spawnOpts:e.spawnOpts}),L=250,O=5e3;return Se((y,h)=>{if(h.ctrl&&y==="c"){let b=Date.now(),B=b-v.current;if(B<L)return;S.current&&B<O?(d.cancel(),e.onCancel?.(),e.exitOnComplete!==!1&&setImmediate(()=>t())):(S.current=!0,n((0,E.jsx)(o,{color:"yellow",children:"press Ctrl+C again to cancel run"}))),v.current=b}}),(0,E.jsx)(s,{flexDirection:"column",children:d.phase!=="done"&&(0,E.jsx)(Ae,{runner:d.runner,runKey:d.currentStepIndex,onStepCommit:n})})}function Qe({data:e}){return(0,E.jsx)(Be,{title:"test.md run",titleColor:"#ff9500",borderColor:i.dim,rows:[{label:"source",value:e.source},{label:"steps",value:`${e.steps.total} (${e.steps.replay} replay, ${e.steps.author} author per walker)`},{label:"model",value:e.model},{label:"viewport",value:`${e.viewport.width} x ${e.viewport.height}`},{label:"chrome",value:e.chrome},{label:"session",value:e.session},{label:"variables",value:`${e.variables.count} (${e.variables.secrets} secret)`},{label:"flags",value:e.flags.length>0?e.flags.join(" "):"(none)"}]})}export{_e as a,ke as b,Ie as c,de as d,qe as e,Me as f,un as g};
@@ -1,7 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as V}from"./chunk-KDNNMU7Q.js";import{a as Y}from"./chunk-Q2F5QB2W.js";import{b as C,c as E}from"./chunk-VVOKM2VO.js";import{z as J}from"./chunk-IICT4VOU.js";import{M as K,c as $,e as G,g as B,m as j,x as U}from"./chunk-RDHWNSDP.js";import{a as L,f as P,h as T}from"./chunk-XLSOQLVT.js";import{existsSync as ve,mkdirSync as he,readFileSync as Ee,writeFileSync as we}from"fs";import{basename as A,dirname as Ie,extname as ee,join as ke}from"path";import{spawnSync as oe}from"child_process";import{appendFileSync as re,existsSync as O,readFileSync as z}from"fs";import{dirname as se,join as H}from"path";var ae="# kane-cli context store: shared through a location, never merged with git",ce=".context/",de=new Set([".context",".context/","/.context","/.context/"]);function X(e,n={}){let t=n.env??process.env;if(t.KANE_CONTEXT_GITIGNORE==="0")return{outcome:"skipped"};try{if(!le(e))return{outcome:"not-a-repo"};let i=H(e,".gitignore");if(me(i))return{outcome:"already",path:i};if((n.checkIgnore??(o=>pe(o,t)))(e)===!0)return{outcome:"already"};let g="";if(O(i)){let o=z(i);o.length>0&&o[o.length-1]!==10&&(g=`
3
- `)}return re(i,`${g}${ae}
4
- ${ce}
5
- `),{outcome:"added",path:i}}catch(i){return{outcome:"failed",reason:i instanceof Error?i.message:String(i)}}}function le(e){let n=e;for(;;){if(O(H(n,".git")))return!0;let t=se(n);if(t===n)return!1;n=t}}function me(e){return O(e)?z(e,"utf8").split(/\r?\n/).some(n=>de.has(n.trim())):!1}function pe(e,n){let t=oe("git",["-C",e,"check-ignore","-q",".context"],{env:{...n,GIT_TERMINAL_PROMPT:"0"},stdio:"ignore",timeout:5e3});return t.error||t.status===null?null:t.status===0?!0:t.status===1?!1:null}import{extname as ue}from"path";var fe={kind:"jira",media_type:"application/x-kane-jira-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},ge={kind:"confluence",media_type:"application/x-kane-confluence-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},De={kind:"web",media_type:"application/x-kane-web-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},xe={kind:"linear",media_type:"application/x-kane-linear-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},_e={kind:"linear-doc",media_type:"application/x-kane-linear-doc-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},q=[{kind:"text",media_type:"text/plain",extensions:[".txt"],cite:"verbatim",maxBytes:2e6},{kind:"markdown",media_type:"text/markdown",extensions:[".md",".markdown"],cite:"verbatim",maxBytes:2e6},{kind:"image",media_type:"image/png",extensions:[".png"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/jpeg",extensions:[".jpg",".jpeg"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/webp",extensions:[".webp"],cite:"anchor-only",maxBytes:5e6},{kind:"text",media_type:"application/json",extensions:[".json"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/yaml",extensions:[".yaml",".yml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/toml",extensions:[".toml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/xml",extensions:[".xml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"text/plain",extensions:[".log"],cite:"verbatim",maxBytes:2e6},{kind:"pdf",media_type:"application/pdf",extensions:[".pdf"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.subarray(0,5).toString("latin1")==="%PDF-"},{kind:"docx",media_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extensions:[".docx"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.length>=4&&e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,sniffFail:e=>e.length>=8&&e.subarray(0,8).equals(ye)?"DOCX_ENCRYPTED_OR_LEGACY: password-protected Office file (or a legacy .doc renamed .docx) \u2014 remove the password / save as .docx and re-ingest":void 0},fe,ge,xe,_e],ye=Buffer.from([208,207,17,224,161,177,26,225]),S={pdf:"pdf",docx:"docx",jira:"jira",confluence:"confluence",web:"web",linear:"linear","linear-doc":"linearDoc"},Fe=new Set(Object.keys(S));function W(e){let n=ue(e).toLowerCase(),t=q.find(i=>i.extensions.includes(n));return t?{ok:!0,media:t}:{ok:!1,code:"UNSUPPORTED_MEDIA",allowlist:q.flatMap(i=>i.extensions)}}function w(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function Me(e,n,t){return Y({source_id:e,source_cid:"sha256:".padEnd(71,"0"),doc_kind:n,numbered_text:V(t)})}var Q=2e3;function Be(e){let t=A(e,ee(e)).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"");return B(t),t}function qe(e){let n=/^(.*?)[-_.]?v?\d+$/.exec(e);if(!n)return null;let t=(n[1]??"").replace(/[-_.]+$/,"");return t.length>0&&t!==e?t:null}function te(e){let n=ke(e,"meta.json");return ve(n)?{created:!1}:(he(e,{recursive:!0}),we(n,JSON.stringify({schema:L,canonicalizer:"v1"},null,2)+`
6
- `),{created:!0,gitignore:X(Ie(e))})}async function We(e){let{contextDir:n,filePath:t,asId:i,confirmSameSource:y,converters:g}=e,o=te(n),p=Ee(t),s=W(t);if(!s.ok)throw new Error(`${A(t)} is a file type kane can't ingest (${ee(t)||"no extension"}) \u2014 supported: ${s.allowlist.join(" ")} [UNSUPPORTED_MEDIA]`);if(p.byteLength>s.media.maxBytes)throw new Error(`${A(t)} is too large \u2014 ${w(p.byteLength)}, the limit for ${s.media.media_type} is ${w(s.media.maxBytes)} [FILE_TOO_LARGE]`);if(s.media.sniff&&!s.media.sniff(p)){let m=s.media.sniffFail?.(p);throw new Error(m??`MEDIA_SNIFF_MISMATCH: ${t} does not look like ${s.media.media_type}`)}let u;i!==void 0?(B(i),u=i):u=Be(t);let l=await Ce({contextDir:n,bytes:p,media:s.media,sourceId:u,label:t,confirmSameSource:y,converters:g});return o.gitignore?{...l,gitignore:o.gitignore}:l}async function Ce(e){let{contextDir:n,bytes:t,media:i,confirmSameSource:y,converters:g}=e,o=e.sourceId,p=e.label??o,s=te(n);if(t.byteLength>i.maxBytes)throw new Error(`the content is too large \u2014 ${w(t.byteLength)}, the limit for ${i.media_type} is ${w(i.maxBytes)} [FILE_TOO_LARGE]`);let u=[],l=S[i.kind];if(i.cite==="verbatim"&&!l){try{new TextDecoder("utf-8",{fatal:!0}).decode(t)}catch{throw new Error(`ENCODING_UNSUPPORTED: ${p} is not valid UTF-8 \u2014 re-save it as UTF-8 and re-ingest`)}t.toString("utf8").split(`
7
- `).some(x=>x.length>Q)&&u.push(`long line detected (> ${Q} chars) \u2014 anchors lose granularity; consider pretty-printing before ingest`)}let m=C(t),v=new Map,c=null,N=!1;for(let x=0;;x++){let b=J(n),f=b.heads.get(o),ne=f!=null?b.getNode(f)?.content:void 0;if(f!=null&&ne?.blob===m)return{status:"unchanged",source_id:o,cid:f,blob:m};if(f==null){for(let[r,_]of b.heads.entries())if(!(r===o||_==null)&&b.getNode(_)?.content.blob===m){let a;if(v.has(r)?a=v.get(r):x===0&&y?(a=await y(r),v.set(r,a)):(a=!1,v.set(r,a),x>0&&u.push(`same bytes already ingested as '${r}' \u2014 minted under '${o}' anyway (the twin appeared mid-commit; not prompted)`)),a)return{status:"unchanged",source_id:r,cid:_,blob:m};break}}if(c===null){let r={},_,a=null,h=null;if(l){let D=g?.[l];if(!D)throw new Error(`${l.toUpperCase()}_CONVERTER_MISSING: ${l} ingestion requires the converter \u2014 the command layer wires it`);let d=await D(t);a=Buffer.from(d.projection,"utf8");let F=Me(o,i.kind,a);if(F>4e5)throw new Error(`PROJECTION_TOO_LARGE: serialized source payload ${F} bytes > ${4e5} \u2014 split the document and re-ingest`);r={text_blob:C(a),...d.inventory.length>0?{images:d.inventory}:{},converter:d.converter},h=d.blobs,_={kind:i.kind,...d.pages!==void 0?{pages:d.pages}:{},delivered:d.delivered.length,omitted:d.inventory.length-d.delivered.length}}let ie=[...r.text_blob?[r.text_blob]:[],...h?h.keys():[]];c={derived:r,composite:_,projBytes:a,derivedBlobs:h,derivedFps:ie}}if(!N){if(E(n,t),c.projBytes!==null&&E(n,c.projBytes),c.derivedBlobs!==null)for(let[,r]of c.derivedBlobs)E(n,r);N=!0}let I=G(o,m),k=T("source",I);if(k.length>0)throw new Error(`source node fails ${k[0].code}: ${k[0].detail}`);let M=$("source",I),R={format:i.kind,media_type:i.media_type,anchors_supported:l?["L-L","img#ref"]:i.cite==="verbatim"?["L-L"]:[],...c.derived};try{K(n,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:M,label:P.SOURCE,content:I}],edges:[],review:[],supersessions:[],media:{[o]:R},...e.eventIds&&e.eventIds.length>0?{event_ids:e.eventIds}:{},source_head_moves:{[o]:M}},{expectPrev:b.latestHash,intent:{v:1,verb:"ingest",args:j({source_id:o,blob:m,label:p,media:R,derived_blobs:c.derivedFps,eventIds:e.eventIds??null}),pins:{prior_head:f??null}},provenance:e.provenance})}catch(r){if(r instanceof U&&x<3)continue;throw r}return{status:f!=null?"versioned":"created",source_id:o,cid:M,blob:m,...u.length?{warnings:u}:{},...c.composite?{composite:c.composite}:{},...s.gitignore?{gitignore:s.gitignore}:{}}}}export{X as a,fe as b,ge as c,De as d,xe as e,_e as f,q as g,S as h,Fe as i,W as j,Me as k,Be as l,qe as m,te as n,We as o,Ce as p};
@@ -1,4 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- var r={complete:"complete",paused:"paused",interrupted:"interrupted",crashed:"crashed","walk-paused":"walk paused"};function t(e){return[`session summary \u2014 ${r[e.state]}${e.reason?` (${e.reason})`:""}`,...e.facts.map(s=>` ${s}`),...e.resume?[` resume: ${e.resume}`]:[],...e.resumeMessage?[` or with a message: ${e.resumeMessage}`]:[],...e.tracePath?[` trace: ${e.tracePath}`]:[]]}function n(e){process.stdout.write(t(e).join(`
3
- `)+`
4
- `)}export{n as a};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as C,b as F,c as B}from"./chunk-WESMQEPO.js";import{f as w,g as h}from"./chunk-XLSOQLVT.js";var z={window:10,latest_only:!1,stale_at_run_weight:.5,counted_verdicts:["passed","failed"],accepted_oracle_modes:["authored","inferred","runtime-derived"],verified_threshold:.5,min_passes:1,risk_weights:{high:3}},Y={window:10,latest_only:!0,stale_at_run_weight:0,counted_verdicts:["passed","failed"],accepted_oracle_modes:["authored","inferred"],verified_threshold:1,min_passes:1,risk_weights:{high:3}},K={lenient:z,strict:Y};function Q(e,t){let s=e.slice(-t.window),o=new Map;for(let d of s)o.set(d.execution_id,d);let c=[...o.values()].sort((d,a)=>d.ts<a.ts?-1:d.ts>a.ts?1:d.execution_id<a.execution_id?-1:1).filter(d=>t.counted_verdicts.includes(d.verdict)&&t.accepted_oracle_modes.includes(d.oracle_mode));return t.latest_only&&c.length>1?[c[c.length-1]]:c}function Z(e,t){let s=Q(e,t),o=0,c=0,d=0;for(let l of s){let b=l.stale_at_run?t.stale_at_run_weight:1;o+=b,l.verdict==="passed"&&(c+=b,d++)}let a=o>0?Math.round(c/o*100)/100:0;return{score:a,verified:a>=t.verified_threshold&&d>=t.min_passes,passes:d,counted:s.length}}function U(e,t){let s=0,o=0;for(let c of e){let d=t[c.risk]??1;s+=d,c.verified&&(o+=d)}return s>0?Math.round(o/s*100):0}function ee(e,t){let s={},o={},c=[],d=0;for(let a of e.usecases){let l=[];for(let i of a.acceptance_criteria){let _=Z(i.executions??[],t);s[i.id]=_;let m={risk:i.risk,verified:_.verified};l.push(m),c.push(m)}let b=l.filter(i=>i.verified).length,n=l.length>0&&b===l.length?"covered":b>0?"partial":"uncovered";n==="covered"&&d++,o[a.id]={status:n,pct:U(l,t.risk_weights)}}return{config:t,acs:s,usecases:o,summary:{coverage_pct:U(c,t.risk_weights),acs_verified:`${c.filter(a=>a.verified).length}/${c.length}`,usecases_covered:`${d}/${e.usecases.length}`,uncovered:Object.values(o).filter(a=>a.status==="uncovered").length}}}function pe(e,t=K){return{rollup_version:1,stale_sources:new Set(e.usecases.flatMap(s=>s.stale_sources??[])).size,high_risk_gaps:(e.gaps??[]).filter(s=>s.risk==="high").length,aspects:Object.fromEntries(Object.entries(t).map(([s,o])=>[s,ee(e,o)]))}}var P={high:3};function ge(e){let t=e.byLabel(w.USECASE).filter(({cid:n})=>C(e,n)),s=new Map(t.map(({cid:n})=>[n,[]]));for(let{cid:n,content:i}of e.byLabel(w.AC)){if(!C(e,n))continue;let _=B(e,n),m=_?s.get(_):void 0;m&&m.push({risk:String(i.risk??""),designed:F(e,n),stale:e.stale(n)!=="fresh"})}let o={},c=[],d=0,a=0,l=0,b=0;for(let{cid:n}of t){let i=s.get(n),_=i.map(v=>({risk:v.risk,verified:v.designed}));c.push(..._),a+=i.length;let m=i.filter(v=>v.designed).length;d+=m;let x=i.filter(v=>v.stale).length,A=e.edgesInto(n).some(v=>v.type===h.BELONGS_TO&&C(e,v.src));A||b++;let k=i.length===0||m===0?"undesigned":m===i.length&&x===0&&A?"complete":"partial";k==="complete"&&l++,o[e.displayNameOf(n)??n]={pct:U(_,P),status:k,staleAcs:x}}return{pct:U(c,P),acs_designed:`${d}/${a}`,usecases_complete:`${l}/${t.length}`,ucs_needing_scenarios:b,perUc:o,config:{criterion:"live_verifies_edge",risk_weights:{high:3},freshness:"not_discounted"}}}var y=(e,t)=>e.nameOf.get(t)??t,R=(e,t)=>!e.superseded.has(t);function te(e,t){return e.byLabel(w.SCENARIO).filter(({cid:s})=>R(e,s)).filter(({cid:s})=>e.edgesFrom(s).some(o=>o.type===h.BELONGS_TO&&e.tipOf(o.dst)===t)).map(({cid:s})=>s)}function se(e,t,s){let o=[];for(let{cid:c}of e.byLabel(w.AC)){if(!R(e,c))continue;let d=e.edgesFrom(c).find(l=>l.type===h.SCOPED_TO);if(!d)continue;let a=e.tipOf(d.dst);a===t?o.push({cid:c,scope:{type:"usecase",ref:y(e,t)}}):s.has(a)&&o.push({cid:c,scope:{type:"scenario",ref:y(e,a)}})}return o}function ne(e){let t=e.filter(s=>s!==void 0).map(s=>s.execution);return t.includes("failed")?"failed":t.includes("blocked")?"blocked":t.includes("passed")?"passed":"not-run"}var ie={passed:"passed",failed:"failed",broken:"blocked",skipped:"not-run"};function re(e,t,s,o){return t?.find(c=>c.ac_cid&&s?e.tipOf(c.ac_cid)===e.tipOf(s):c.ac_ref===o)?.verdict}function oe(e,t){let s=t.flatMap(o=>o?.acs??[]).filter(o=>o.ref===e).map(o=>ie[o.verdict]??"not-run");return s.length===0?ne(t):s.includes("failed")?"failed":s.includes("blocked")?"blocked":s.includes("passed")?"passed":"not-run"}function be(e){return ce(e,new Map)}function ce(e,t,s){let o=s?.scope==="run",c=[],d=new Set,a=new Map;for(let[n,i]of e.nameOf)a.set(e.tipOf(n)??n,i);let l=n=>a.get(n)??y(e,n);for(let{cid:n,content:i}of e.byLabel(w.USECASE)){if(!R(e,n)||e.trust.get(n)==="archived")continue;let _=e.tipOf(n),m=e.derivesInto(_).filter(r=>!e.superseded.has(r.ecid)),x=[...new Set(m.map(r=>String(r.props?.source_id??"")).filter(Boolean))].sort(),A=x.map(r=>{let p=e.heads.get(r);if(typeof p!="string")return{id:r};let f=e.getNode(p)?.content.blob;return{id:r,media_type:e.mediaOf(p).media_type,...typeof f=="string"?{cid:f}:{}}}),k=m[0],v=new Map;for(let r of m)r.props?.source_id&&r.props?.source_cid&&v.set(String(r.props.source_id),String(r.props.source_cid));let M=x.filter(r=>{let p=e.heads.get(r),f=v.get(r);return p!=null&&f!==void 0&&p!==f}).sort(),T=e.edgesFrom(n).filter(r=>r.type===h.DEPENDS_ON&&!e.superseded.has(r.ecid)).map(r=>ue(e,r.dst)).filter(r=>r!==null).sort(),D=te(e,_),W=new Set(D),q=D.map(r=>{let p=e.getNode(r)?.content??{},f=e.edgesFrom(r).filter(S=>S.type===h.EXERCISES&&!e.superseded.has(S.ecid)&&R(e,e.tipOf(S.dst))).map(S=>y(e,e.tipOf(S.dst))).sort();return{id:y(e,r),case_type:String(p.case_type??""),intent:String(p.intent??""),exercises:f}}).sort((r,p)=>r.id<p.id?-1:1),L=!1,E=new Set([_]);for(let r of D)E.add(r);let H=se(e,_,W).map(({cid:r,scope:p})=>{let f=e.getNode(r)?.content??{},S=[...new Set(e.edgesInto(r).filter(u=>u.type===h.VERIFIES&&!e.superseded.has(u.ecid)).map(u=>e.tipOf(u.src)).filter(u=>!!u&&R(e,u)))].sort((u,g)=>l(u)<l(g)?-1:1),G=S.length>0,N=S.map(u=>t.get(`id:${l(u)}`)??t.get(`def:${String(e.getNode(u)?.content.definitionId??"")}`)),$=N.some(u=>u!==void 0);$&&(L=!0),E.add(r);for(let u of S)E.add(u);let J=G&&!$?"unknown":e.stale(r)==="fresh"?"fresh":"stale",O=f.expected_answer??{},I=y(e,r),j=S.flatMap(u=>(e.execHistory?.(l(u))??[]).map(g=>({execution_id:String(g.execution_id),ts:String(g.started_at),verdict:String(re(e,g.per_ac,r,I)??g.verdict),stale_at_run:!!g.stale_at_run,oracle_mode:String(g.oracle_mode),...g.via_parent?{via_parent:String(g.via_parent)}:{}}))).sort((u,g)=>u.ts<g.ts?-1:1).slice(-10);return{id:I,text:String(f.text??""),risk:String(f.risk??""),scope:p,covered_by:S.map(u=>l(u)),...G?{link_type:"verifies"}:{},execution:oe(I,N),fresh:J,derived:!!f.derived,...f.kind||f.expected_answer?{expected_answer:{...f.kind?{kind:String(f.kind)}:{},statement:String(f.text??""),...O.operator!==void 0?{operator:O.operator}:{},...O.operand!==void 0?{operand:O.operand}:{}}}:{},...G?{satisfied_by:S.map((u,g)=>{let X=e.getNode(u)?.content.check??{},V=N[g]?.steps?.checkStepId??X.verified_against;return{test:l(u),...V?{step:V}:{}}})}:{},...j.length?{executions:j}:{}}}).sort((r,p)=>r.id<p.id?-1:1);if(!(o&&!L)){for(let r of E)d.add(r);c.push({id:y(e,n),title:String(i.title??""),...i.description||i.summary?{description:String(i.description??i.summary)}:{},...Array.isArray(i.actors)&&i.actors.length?{actors:i.actors.map(String)}:{},...i.value?{value:String(i.value)}:{},risk:String(i.risk??""),status:e.trust.get(n)==="trusted"?"approved":"draft",sources:A,...M.length?{stale_sources:M}:{},...T.length?{depends_on:T}:{},...k?{provenance:{derived_from:`${String(k.props?.source_id??"")}#${String(k.props?.anchor??"")}`}}:{},scenarios:q,acceptance_criteria:H})}}c.sort((n,i)=>n.id<i.id?-1:1);let b=e.byLabel(w.GAP).filter(({cid:n})=>R(e,n)&&e.trust.get(n)!=="archived").filter(({content:n})=>{if(!o||typeof n.uc=="string"&&d.has(e.tipOf(n.uc)))return!0;let i=typeof n.ref=="string"?e.resolve(n.ref):null;return i!==null&&d.has(e.tipOf(i.cid))}).map(({cid:n,content:i})=>({ref:y(e,n),kind:String(i.kind??""),...i.risk?{risk:String(i.risk)}:{},...i.question?{question:de(i.question)}:{}})).sort((n,i)=>n.ref<i.ref?-1:1);return{usecases:c,...b.length?{gaps:b}:{},...o?{scope:"run"}:{}}}function de(e){if(typeof e=="string")return e;let t=e?.header;return typeof t=="string"?t:""}function ue(e,t){let s=e.tipOf(t);return e.nodeLabel.get(s)!==w.USECASE||!R(e,s)?null:y(e,s)}export{K as a,Q as b,Z as c,pe as d,ge as e,re as f,be as g,ce as h};
@@ -1,4 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as N,c as O,e as S,f as D,j as T,q as y,s as z,u as U}from"./chunk-OYKRCDT4.js";import{a as Y,b as M}from"./chunk-NBXYL2JT.js";import{a as F}from"./chunk-ODU2JSMA.js";import{a as R}from"./chunk-DHJSM5DT.js";import{a as A}from"./chunk-CXF6AZWY.js";import{e as $}from"./chunk-UR6MHSHU.js";var C=$(Y(),1);import{existsSync as k,readFileSync as I,readdirSync as J,statSync as K}from"fs";import{dirname as H,isAbsolute as V,join as h,relative as P,resolve as Z,sep as _}from"path";import{createHash as q}from"crypto";var b="testmd-bundle.json",u=class extends Error{constructor(t){super(t),this.name="BundleUsageError"}},B=e=>e.split(_).join("/");function v(e){if(!k(e))return[];let t=[];for(let s of J(e).sort()){let r=h(e,s);K(r).isDirectory()?t.push(...v(r)):t.push(r)}return t}function G(e){let t=e.map(r=>H(r).split(_)),s=t[0];for(let r of t.slice(1)){let i=0;for(;i<s.length&&i<r.length&&s[i]===r[i];)i++;s=s.slice(0,i)}return s.join(_)||_}function Q(e){for(let t of e){let s=F(t,I(t,"utf8"));for(let r of s.steps)if(r.body.kind==="import_ref"&&V(r.body.path))throw new u(`bundle sync: absolute @import is not portable after unzip: ${t} step ${r.index} (@import ${r.body.path})`)}}function j(e,t={}){let s=Z(e),r=S(s),i=y(s);if(!i?.commit_id||!i?.test_id)throw new u(`bundle sync: ${s} is not authored \u2014 run \`kane-cli testmd run\` first (output-<stem>/.internal/meta.json needs commit_id + test_id)`);let l;try{l=U(s)}catch(n){throw n instanceof z?new u(`bundle sync: ${n.message}`):n}let c=[s];for(let n of l.steps)for(let a of n.trace.slice(1))c.includes(a.file)||c.push(a.file);Q(c);let o=[],d=[];for(let n of l.unitFiles){if(n.file===s)continue;let a=N(n.file);o.includes(a)||o.push(a),n.kind==="module"&&d.push(S(n.file))}let m=[...c],p=n=>{k(n)&&m.push(n)};p(O(s)),m.push(r),p(D(s)),m.push(...v(T(s)));for(let n of o)p(h(n,"Result.md")),m.push(...v(h(n,".internal","steps")));for(let n of d)p(n);let f=G(m);if(k(h(f,b)))throw new u(`bundle sync: a real file named ${b} exists at the zip root (${f}) \u2014 it would collide with the generated manifest`);let w=m.map(n=>{let a=n===r&&t.identityOverride?Buffer.from(JSON.stringify({...JSON.parse(I(n,"utf8")),commit_id:t.identityOverride.commit_id},null,2)+`
3
- `):void 0,E=a??I(n);return{abs:n,rel:B(P(f,n)),sha256:q("sha256").update(E).digest("hex"),bytes:E.length,...a?{contents:a}:{}}}).sort((n,a)=>n.rel<a.rel?-1:1),x=B(P(f,s)),L={schema_version:2,entry:x,commit_id:t.identityOverride?.commit_id??i.commit_id,test_id:i.test_id,testcase_id:i.testcase_id??null,project_id:i.project_id??null,folder_id:i.folder_id??null,org_id:i.org_id??null,created_at:new Date().toISOString(),producer:{name:"kane-cli",version:A},files:w.map(n=>({path:n.rel,sha256:n.sha256,bytes:n.bytes})),units:l.unitFiles.filter(n=>n.file!==s).map(n=>({path:B(P(f,n.file)),kind:n.kind}))};return{zipRoot:f,entry:x,files:w,manifest:L}}var g=e=>e instanceof Error?e.message:String(e);function W(e){return new Promise((t,s)=>{let r=(0,C.default)("zip",{zlib:{level:6}}),i=[];r.on("data",l=>i.push(l)),r.on("error",s),r.on("end",()=>t(Buffer.concat(i))),r.append(JSON.stringify(e.manifest,null,2)+`
4
- `,{name:b});for(let l of e.files)l.contents?r.append(l.contents,{name:l.rel}):r.file(l.abs,{name:l.rel});r.finalize()})}async function X(e){let{plan:t,controller:s,testId:r,sessionId:i,commitId:l}=e,c;try{c=await W(t)}catch(d){return{ok:!1,stage:"zip",error:g(d)}}let o;try{let d={key:"testmd",content_type:"application/zip",filename:`${l}-testmd.zip`},p=(await s.getPresignedUrls(r,i,[d])).urls?.testmd?.upload_url;if(!p)return{ok:!1,stage:"presign",error:"presign response missing testmd upload_url"};o=p}catch(d){return{ok:!1,stage:"presign",error:g(d)}}try{await M(o,c,"application/zip")}catch(d){return{ok:!1,stage:"upload",error:g(d)}}return{ok:!0,bytes:c.length}}async function ee(e){let t;try{t=j(e.sourcePath,{identityOverride:e.identityOverride})}catch(s){return s instanceof u?{ok:!1,stage:"collect",error:s.message}:{ok:!1,stage:"collect",error:g(s)}}return X({...e,plan:t})}function ge(e){return e.shouldUploadPipeline&&e.uploadSucceeded&&!!e.metaCommitId&&!!e.metaTestId}function te(e){return e.persisted?e.uploadSucceeded?e.local?"local":e.hasBasicAuth?!e.metaCommitId||!e.metaTestId?"not_authored":null:"no_auth":"upload_failed":"not_persisted"}async function ye(e){let t=e.recordedTestPath??null,s=t?y(t):null,r=te({persisted:!!t,uploadSucceeded:e.uploadSucceeded,local:e.local,hasBasicAuth:!!e.basicAuth,metaCommitId:s?.commit_id,metaTestId:s?.test_id});if(r)return e.log("info","BUNDLE_SYNC_SKIPPED","testmd bundle sync skipped",{reason:r,...t?{path:t}:{}}),{skipped:r};let i=s.commit_id,l=s.test_id,c=o=>{try{e.onAgentEvent?.(o)}catch{}};try{let o=await(e.syncFn??ee)({sourcePath:t,testId:l,sessionId:e.sessionId,commitId:i,controller:new R(e.controllerBaseUrl,{username:e.basicAuth.username,accessKey:e.basicAuth.access_key})});return o.ok?(e.log("info","BUNDLE_SYNC_OK","testmd bundle pushed",{commit_id:i,path:t,bytes:o.bytes}),c({type:"test_md_bundle_sync",status:"ok",commit_id:i,path:t,bytes:o.bytes})):(e.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync failed",{commit_id:i,path:t,stage:o.stage,error:o.error}),c({type:"test_md_bundle_sync",status:"failed",commit_id:i,path:t,stage:o.stage})),o}catch(o){let d=g(o);return e.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync threw",{commit_id:i,path:t,error:d}),c({type:"test_md_bundle_sync",status:"failed",commit_id:i,path:t,stage:"upload"}),{ok:!1,stage:"upload",error:d}}}export{j as a,W as b,X as c,ee as d,ge as e,te as f,ye as g};
@@ -1,8 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as N,c as V}from"./chunk-Q6AHSGOE.js";import{b as Y}from"./chunk-LDPLJFCV.js";import{a as M,b as U}from"./chunk-UJZZDPDY.js";import{b as B}from"./chunk-5ZFOKYFB.js";import{a as K}from"./chunk-BZAGVBCX.js";import{a as k}from"./chunk-LSDWPG6C.js";import{P as E,Q as F,S as L}from"./chunk-RMVASIVL.js";import{B as I,z as A}from"./chunk-IICT4VOU.js";import{f as p,g as $}from"./chunk-XLSOQLVT.js";var q=new Set([p.USECASE,p.SCENARIO,p.AC,p.TEST]);function w(t,e){return!t.superseded.has(e)&&t.trust.get(e)!=="archived"}function T(t,e,n){let r=t.edgesFrom(e).find(s=>s.type===n);return r?t.tipOf(r.dst):null}function _(t,e,n){if(n===p.USECASE)return e;if(n===p.SCENARIO)return T(t,e,$.BELONGS_TO);if(n===p.AC){let r=T(t,e,$.SCOPED_TO);return r?t.nodeLabel.get(r)===p.USECASE?r:T(t,r,$.BELONGS_TO):null}if(n===p.TEST){let r=T(t,e,$.AUTOMATES);return r?T(t,r,$.BELONGS_TO):null}return null}function G(t,e){let n=t.nameOf.get(e);if(n)return n;for(let[r,s]of t.names)if(t.tipOf(s)===e)return r;return e}function J(t,e){return{ucTip:e,display:G(t,e),seamRef:t.nameOf.get(e)??e}}function se(t,e){let n=t.resolve(e);if(!n)return{ok:!1,message:`unknown ref '${e}' \u2014 no test/scenario/ac/use-case by that id or cid`};let r=n.tip,s=t.nodeLabel.get(r);if(!s||!q.has(s))return{ok:!1,message:`'${e}' is a ${s??"missing node"} \u2014 evolve takes a test, scenario, acceptance criterion, or use-case`};let o=_(t,r,s);return!o||t.nodeLabel.get(o)!==p.USECASE?{ok:!1,message:`cannot resolve '${e}' to a parent use-case \u2014 its ${s} chain is broken`}:t.superseded.has(o)?{ok:!1,message:`use-case ${G(t,o)} was removed \u2014 nothing to evolve`}:t.trust.get(o)==="archived"?{ok:!1,message:`use-case ${G(t,o)} was archived \u2014 nothing to evolve`}:{ok:!0,target:J(t,o)}}function Ie(t,e){return R(t,e)}function R(t,e){let n=[];for(let{cid:s}of t.byLabel(p.SCENARIO)){if(!w(t,s)||!t.edgesFrom(s).some(i=>i.type===$.BELONGS_TO&&t.tipOf(i.dst)===e))continue;let o=t.edgesInto(s).filter(i=>i.type===$.AUTOMATES&&w(t,i.src));if(o.length===0)n.push({scenario:s,test:null});else for(let i of o)n.push({scenario:s,test:i.src})}let r=new Map;for(let{cid:s}of t.byLabel(p.AC)){if(!w(t,s)||_(t,s,p.AC)!==e)continue;let o=t.edgesInto(s).filter(i=>i.type===$.VERIFIES&&w(t,i.src)).map(i=>i.src).sort();r.set(s,o)}return{pairs:n,verifies:r}}function re(t,e){let n=i=>`${i.scenario}\0${i.test??""}`,r=new Set(t.pairs.map(n)),s=new Set(e.pairs.map(n)),o=[];for(let[i,c]of t.verifies){let d=e.verifies.get(i);d&&(c.length===d.length&&c.every((f,u)=>f===d[u])||o.push({ac:i,before:c,after:d}))}return{superseded:t.pairs.filter(i=>!s.has(n(i))),minted:e.pairs.filter(i=>!r.has(n(i))),retained:e.pairs.filter(i=>r.has(n(i))),moves:o}}function ie(t,e,n,r,s){let o=c=>e.nameOf.get(c)??c,i=c=>` - ${o(c.scenario)} \xB7 ${c.test?o(c.test):"(no test)"}`;t.out(`evolved: use-case ${n} \u2014 design record ${r.before} \u2192 ${r.after}`),t.out(` superseded ${s.superseded.length} pair(s)`);for(let c of s.superseded)t.out(i(c));t.out(` minted ${s.minted.length} pair(s)`);for(let c of s.minted)t.out(i(c));t.out(` retained ${s.retained.length} pair(s)`);for(let c of s.retained)t.out(i(c));if(s.moves.length===0)t.out(" verifies none moved");else{t.out(" verifies moved:");for(let c of s.moves){let d=f=>f.length>0?f.map(o).join(" + "):"(none)";t.out(` - ${o(c.ac)}: ${d(c.before)} \u2192 ${d(c.after)}`)}}}async function j(t,e,n,r,s,o,i,c){let d=A(t),f=k(d,e.ucTip);if(!f)return o==="batch"?(r.out(`note: ${e.display} has no design output \u2014 nothing to evolve; run kane-cli design tests --use-case ${e.display} first`),c?.({type:"evolve_skipped",use_case:e.display,reason:"no-design"}),{code:0,outcome:"no-design"}):(E(r,`nothing to evolve \u2014 run kane-cli design tests --use-case ${e.display} first (no design output)`),{code:2,outcome:"no-design"});let u=R(d,e.ucTip),g=[`evolve ${e.display}`,` re-designs use-case ${e.display}`,` affects ${u.pairs.length} pair(s)`,...n.because?[` because ${n.because}`]:[]];if(n.yes)for(let S of g)r.out(S);else{for(let b of g)r.out(b);if(!await r.confirm(`proceed with the re-design of ${e.display}?`))return r.out(o==="batch"?`skipped ${e.display}`:"declined \u2014 nothing evolved"),{code:0,outcome:"declined"}}let h=e.named?de(e.named):void 0,m=V(t,d,e.ucTip,n.because,h),v=e.named?fe(d,e.named,e.display,n.because,e.ucTip):void 0,l=await M(i,{verb:"evolve",subject:e.display},()=>s(e.seamRef,{yes:!!n.yes,...n.mode?{mode:n.mode}:{},...n.because?{because:n.because}:{},...m!==void 0?{changeDelta:m.change_delta,priorDesign:m.prior_design}:{},...c?{onChildEvent:c}:{},...v?{statement:v}:{}}),S=>({ok:S===0,exitCode:S}));if(l===3)return r.out(`design session for ${e.display} paused \u2014 resume with \`kane-cli design tests --resume\`, then re-run evolve for the diff`),{code:l,outcome:"paused"};if(l!==0)return E(r,`design run for ${e.display} ended with exit code ${l} \u2014 no diff to report`),{code:l,outcome:"failed"};let a=A(t),y=a.tipOf(e.ucTip),O=k(a,y)?.seq,C={before:f.seq,after:O??"?"},x=re(u,R(a,y));return ie(r,a,e.display,C,x),c?.(me(a,e.display,C,x)),{code:0,outcome:"evolved"}}function oe(t){let e=new Map,n=0;for(let{cid:s,state:o}of t.staleList()){if(o==="superseded")continue;let i=t.nodeLabel.get(s);if(!i||!q.has(i)||!w(t,s)||!I(t,s))continue;let c=_(t,s,i);!c||t.nodeLabel.get(c)!==p.USECASE||!w(t,c)||(n++,e.has(c)||e.set(c,J(t,c)))}return{targets:[...e.values()].sort((s,o)=>s.display<o.display?-1:s.display>o.display?1:0),staleCount:n}}function ae(t,e){for(let{cid:n,state:r}of t.staleList()){if(r==="superseded")continue;let s=t.nodeLabel.get(n);if(!(!s||!q.has(s)||!w(t,n))&&I(t,n)&&_(t,n,s)===e)return!0}return!1}async function Q(t,e,n,r={},s=process.cwd()){let o=e.mode==="agent";if(t&&e.fromStale)return E(n,"pass a <ref> OR --from-stale, not both"),2;if(!t&&!e.fromStale)return E(n,"evolve needs a <ref> or --from-stale"),2;if(!o&&(e.answer?.length??0)>0)return E(n,"--answer rides --mode agent: the blast-radius question is asked on the stream and answered on the next call. In a terminal, answer the prompt instead"),2;let i=F(s,n);if(!i)return 2;let c=r.runDesignForUc??we,d=r.emitEvent,f=r.onChild??(d?be(d):n.isTTY?$e(n):void 0);n.out(`evolving ${t??"stale use-cases"}: reading the graph\u2026`);let u=A(i),g,h=null,m;if(t){let l=se(u,t);if(!l.ok)return E(n,l.message),2;if(!e.because&&k(u,l.target.ucTip)&&!ae(u,l.target.ucTip))return E(n,`nothing changed underneath ${t} \u2014 its sources and requirements are current; use --because "<reason>" to re-design anyway`),2;let a=ce(u,t);g=[{...l.target,ref:t,...a?{named:a}:{}}]}else{let{targets:l,staleCount:a}=oe(u);if(l.length===0){if(o&&(e.answer?.length??0)>0){let y=ee(e.answer,[]);if("error"in y)return te(n,y.error)}return d?.({type:"evolve_batch",stale_nodes:a,use_cases:0}),n.out("nothing stale \u2014 nothing to evolve"),0}h=`from-stale: ${a} stale node(s) \u2192 ${l.length} use-case(s)`,m={stale_nodes:a,use_cases:l.length},g=l}if(!e.yes&&!n.isTTY&&!o)return E(n,"evolve needs a TTY \u2014 the blast-radius confirm is the point; headless, run with --mode agent (the question rides the stream and is answered with --answer on the next call) or let kane-cli maintain reconcile drive it"),2;if(h&&n.out(h),o)return Ee({ref:t,opts:e,io:n,dir:i,graph:u,targets:g,batch:m,runDesign:c,onChild:f,emit:d??(()=>{})});if(t){let l=await j(i,g[0],e,n,c,"single",f);return l.outcome==="evolved"&&e.because&&P(i,t,e.because),l.code}let v=[];for(let l of g){let a=await j(i,l,e,n,c,"batch",f);a.outcome==="evolved"&&e.because&&P(i,l.display,e.because),v.push(a.code)}return X(v)}function X(t){let e=t.find(n=>n!==0&&n!==3);return e!==void 0?e:t.includes(3)?3:0}function P(t,e,n){K(t,{ts:new Date().toISOString(),command:"evolve",id:e,verdict:"gap-resolved-evolve",polarity:"preference",by:{kind:"human",id:process.env.USER??"operator"},target:e,reason:n})}var z={[p.TEST]:"test",[p.SCENARIO]:"scenario",[p.AC]:"ac",[p.USECASE]:"usecase"},Z={test:"test",scenario:"scenario",ac:"acceptance criterion",usecase:"use-case"},W=120;function ce(t,e){let n=t.resolve(e);if(!n)return null;let r=z[t.nodeLabel.get(n.tip)??""];if(!r)return null;let s=t.getNode(n.tip)?.content??{},o=r==="ac"?s.text:s.title,i=typeof o=="string"?o.replace(/[\u0000-\u001f\u007f]+/g," ").trim():"",c=Array.from(i),d=c.length===0?void 0:c.length>W?`${c.slice(0,W-1).join("")}\u2026`:i,f=t.superseded.has(n.tip)?"removed":t.trust.get(n.tip)==="archived"?"archived":void 0;return{ref:t.nameOf.get(n.tip)??t.displayNameOf(n.tip)??e,label:r,...d?{title:d}:{},cid:n.tip,...f?{dead:f}:{}}}function de(t){if(!t.dead)return{ref:t.ref,label:t.label,...t.title?{title:t.title}:{}}}function ue(t,e,n){let r=[];for(let{cid:s,state:o}of t.staleList()){if(o==="superseded"||s===n)continue;let i=t.nodeLabel.get(s),c=z[i??""];if(!i||!c||!w(t,s)||!I(t,s)||_(t,s,i)!==e)continue;let d=N(t,s);if(!d)continue;let f=t.nameOf.get(s)??t.displayNameOf(s)??s;r.push({display:f,text:`${Z[c]} ${f} \u2014 ${d}`})}return r.sort((s,o)=>s.display<o.display?-1:s.display>o.display?1:0),r[0]?.text??null}var le=`Judge the scope yourself: change what this genuinely affects and leave the rest as designed.
3
- If it is ambiguous what should change, ask before changing anything.`;function fe(t,e,n,r,s){let o=e.label==="usecase"?"":` in use-case ${n}`,i=[e.title?`"${e.title}"`:"",e.dead?`${e.dead} earlier`:""].filter(Boolean).join(", "),c=`[kane] evolve started on ${Z[e.label]} ${e.ref}${i?` (${i})`:""}${o}.`,d=r?.trim(),f=d||e.dead?void 0:N(t,e.cid),u=d?void 0:f??(s?ue(t,s,e.cid):null),g=d?`Because: ${d}`:u?`Stale: ${u}`:null;return[c,g,le].filter(h=>h!==null).join(`
4
- `)}function D(t){return`evolve:${t.display}`}function ge(t,e,n){return{type:"evolve_target",...t.ref!==void 0?{ref:t.ref}:{},use_case:t.display,pairs:e,...n?{because:n}:{}}}function pe(t,e,n){return{id:D(t),header:"Re-design?",text:`Re-design use-case ${t.display}? ${e} scenario/test pair(s) are affected${n?` \u2014 because: ${n}`:""}.`,risk:"med",rationale:"evolve re-designs the whole parent use-case: what the change touches is superseded, the rest is re-emitted verbatim; the run spends design credits",options:[{label:"proceed",detail:`re-design use-case ${t.display} now (${e} pair(s) affected)`},{label:"decline",detail:"leave the current design as it is"}],recommended_index:0,allow_free_text:!1}}function me(t,e,n,r){let s=i=>t.nameOf.get(i)??i,o=i=>({scenario:s(i.scenario),test:i.test?s(i.test):null});return{type:"evolve_diff",use_case:e,generation:n,superseded:r.superseded.map(o),minted:r.minted.map(o),retained:r.retained.map(o),moves:r.moves.map(i=>({ac:s(i.ac),before:i.before.map(s),after:i.after.map(s)}))}}function ve(t){return`'${t.replace(/'/g,"'\\''")}'`}function he(t,e,n){return`kane-cli maintain evolve ${t??"--from-stale"}${e?` --because ${ve(e)}`:""} --mode agent`+[...n.entries()].map(([s,o])=>` --answer ${s}=${o==="proceed"?1:2}`).join("")}function ye(t){if(t.optionIndex===0)return"proceed";if(t.optionIndex===1)return"decline";if(t.optionIndex!==void 0)return null;let e=(t.freeText??"").trim().toLowerCase();return e==="proceed"||e==="yes"||e==="y"?"proceed":e==="decline"||e==="no"||e==="n"?"decline":null}function ee(t,e){let n=new Map;if(!t||t.length===0)return n;let r=B({answer:t});if(!r.ok)return{error:r.error};for(let s of r.value?.answers??[]){if(!e.includes(s.target))return{error:`${s.target} is not a question this run asks \u2014 addressable: ${e.length>0?e.join(", "):"(none)"}`};let o=ye(s);if(o===null)return{error:`'${s.optionIndex!==void 0?String(s.optionIndex+1):s.freeText??""}' is not a choice for ${s.target} \u2014 use 1 or proceed, 2 or decline`};n.set(s.target,o)}return n}function te(t,e){return t.err?t.err(`error: ${e}`,"ANSWER_USAGE"):t.out(`error: ${e}`),2}function be(t){return e=>{e.kind==="start"?t({type:"child_start",child:"design",subject:e.subject}):e.kind==="end"&&t({type:"child_end",ok:e.ok,dur_s:e.durS,...e.exitCode!==void 0?{exit_code:e.exitCode}:{}})}}async function Ee(t){let{ref:e,opts:n,io:r,dir:s,graph:o,targets:i,batch:c,runDesign:d,onChild:f,emit:u}=t,g=[],h=[];for(let a of i){if(!k(o,a.ucTip)){if(e)return E(r,`nothing to evolve \u2014 run kane-cli design tests --use-case ${a.display} first (no design output)`),2;h.push(a);continue}g.push({target:a,pairs:R(o,a.ucTip).pairs.length})}let m=ee(n.answer,g.map(a=>D(a.target)));if("error"in m)return te(r,m.error);c&&u({type:"evolve_batch",...c});for(let a of h)r.out(`note: ${a.display} has no design output \u2014 nothing to evolve; run kane-cli design tests --use-case ${a.display} first`),u({type:"evolve_skipped",use_case:a.display,reason:"no-design"});for(let a of g)u(ge(a.target,a.pairs,n.because));let v=g.filter(a=>!m.has(D(a.target)));if(v.length>0){let a=he(e,n.because,m),y=b=>a+v.map(ne=>` --answer ${D(ne.target)}=${b==="proceed"?1:2}`).join(""),O=v.length===1?`use-case ${v[0].target.display}`:`${v.length} use-cases`,C=[...m.values()].filter(b=>b==="proceed").length,x=C>0?`; the ${C} use-case(s) already answered proceed still re-design`:"",S=[{cmd:y("proceed"),why:`re-design ${O} now \u2014 supersedes what the change touches, spends design credits${x}`,title:C>0?"Proceed with the remaining re-design":"Proceed with the re-design"},{cmd:y("decline"),why:`leave ${O} as designed${x}`,title:C>0?"Decline the remaining question(s)":"Decline"}].filter(b=>Y(b.cmd));return u({type:"evolve_paused",pending_questions:v.map(b=>pe(b.target,b.pairs,n.because)),resume:a,next:S}),3}let l=[];for(let{target:a}of g){if(m.get(D(a))==="decline"){r.out(e?"declined \u2014 nothing evolved":`skipped ${a.display}`),u({type:"evolve_skipped",use_case:a.display,reason:"declined"});continue}let O=await j(s,a,{...n,yes:!0},r,d,e?"single":"batch",f,u);O.outcome==="evolved"&&n.because&&P(s,e??a.display,n.because),l.push(O.code)}return X(l)}function $e(t){let e="",n="evolve";return r=>{r.kind==="start"?(e=r.subject,n=r.verb,t.out(`\u25CF ${U(r.verb).ing} ${r.subject}`)):r.kind==="end"&&t.out(r.ok?`\u25CF ${U(n).ed} ${e} \u2014 ${r.durS}s`:`\u25CF ${n} failed \u2014 ${r.exitCode!=null?`exited ${r.exitCode}`:"error"}${r.fixCmd?` \xB7 ${r.fixCmd}`:""}`)}}var we=async(t,e)=>{let{designTestsCommand:n}=await import("./bind-S3IQTPNN.js"),r=()=>n({useCase:t,force:!0,...e.mode?{mode:e.mode}:e.yes?{mode:"override"}:{},...e.because?{because:e.because}:{},...e.changeDelta!==void 0?{changeDelta:e.changeDelta}:{},...e.priorDesign!==void 0?{priorDesign:e.priorDesign}:{},...e.statement?{statement:e.statement}:{}});if(e.mode!=="agent")return r();let s=e.onChildEvent,o=process.stdout.write,i="";process.stdout.write=((c,d,f)=>{if(s){i+=typeof c=="string"?c:Buffer.isBuffer(c)?c.toString("utf8"):String(c);let g=i.indexOf(`
5
- `);for(;g>=0;)H(i.slice(0,g),s),i=i.slice(g+1),g=i.indexOf(`
6
- `)}let u=typeof d=="function"?d:f;return typeof u=="function"&&queueMicrotask(()=>u(null)),!0});try{return await r()}finally{process.stdout.write=o,s&&i.length>0&&H(i,s)}};function H(t,e){let n=t.trim();if(!n.startsWith("{"))return;let r;try{r=JSON.parse(n)}catch{return}if(!r||typeof r!="object"||typeof r.type!="string")return;let s=r;s.type!=="done"&&e(s)}async function Re(t,e,n={},r,s=process.cwd()){let{makeHeadlessIO:o,agentRefusal:i}=await import("./headless-io-75HUMWZB.js");if(e.mode!==void 0&&e.mode!=="interactive"&&e.mode!=="agent")return i(o("ndjson","evolve",r),`--mode must be interactive | agent, got '${e.mode}'`,"MODE_USAGE");if(e.mode==="agent"){let d=process.stdout.write.bind(process.stdout),f=process.stderr.write.bind(process.stderr),u=o("ndjson","evolve",r??{stdout:a=>{d(a)},stderr:a=>{f(a)}}),g=[],h=a=>{(a.type==="evolve_paused"||a.type==="session_paused")&&Array.isArray(a.next)&&g.push(...a.next),u.event(a)},m={out:u.out,err:(a,y)=>u.event({type:"error",message:a,...y?{code:y}:{}}),isTTY:!1,confirm:async()=>!1,ask:async()=>""},{runWithChannel:v}=await import("./run-channel-RGH4WIQX.js"),l=2;try{l=await v({event:a=>u.event(a)},()=>Q(t,e,m,{...n,emitEvent:h},s))}catch(a){l=1,u.event({type:"error",message:a instanceof Error?a.message:String(a)})}return u.done(l,void 0,g.length>0?g:void 0)}let c=r?{...L(),out:d=>r.stdout(`${d}
7
- `),err:d=>r.stderr(`${d}
8
- `),isTTY:!1}:L();return Q(t,e,c,n,s)}export{se as a,Ie as b,j as c,oe as d,Q as e,ce as f,le as g,fe as h,we as i,H as j,Re as k};
@@ -1,6 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as Y,b as Z,c as ee,d as ne,e as te}from"./chunk-MV3Q335C.js";import{b as ie,c as re}from"./chunk-YFQGOOF7.js";import{n as X,p as P}from"./chunk-RSSOJ3L2.js";import{a as Pe}from"./chunk-6YGTRKDT.js";import{e as Ce}from"./chunk-UR6MHSHU.js";function se(i){return{command:"start",...i}}function oe(i,n,s){return{command:"run",run_id:i,kind:n,...s}}function ae(i){return{command:"cancel",...i?{run_id:i}:{}}}function ue(i){return{command:"ask_user_response",answer:i}}function de(i={}){return{command:"shutdown",...i.testStatus?{test_status:i.testStatus,remark:i.remark??""}:{}}}var z=Symbol("run-queue-end"),G=class{items=[];waiting=null;ended=!1;error=null;push(n){if(this.waiting){let{resolve:s}=this.waiting;this.waiting=null,s(n)}else this.items.push(n)}end(){if(this.ended=!0,this.waiting){let{resolve:n}=this.waiting;this.waiting=null,n(z)}}fail(n){if(this.error=n,this.waiting){let{reject:s}=this.waiting;this.waiting=null,s(n)}}next(){return this.items.length>0?Promise.resolve(this.items.shift()):this.error?Promise.reject(this.error):this.ended?Promise.resolve(z):new Promise((n,s)=>{this.waiting={resolve:n,reject:s}})}},D=class{env;runner;log;sessionId;spawnFn;proc=null;activeRun=null;pendingReady=null;shuttingDown=!1;finalized=!1;exitInfo=null;exitedUnexpectedly=!1;exitResolve;exited;constructor(n){this.env=n.env,this.runner=n.runner,this.log=n.log,this.sessionId=n.sessionId,this.spawnFn=n.spawn??Z;let s;this.exited=new Promise(l=>{s=l}),this.exitResolve=s}async start(n){if(this.proc)throw new Error("PersistentRunner.start called twice");this.proc=this.spawnFn({env:this.env,runner:this.runner,log:this.log,sessionId:this.sessionId}),this.consume();let s=new Promise((l,g)=>{this.pendingReady={resolve:l,reject:g}});this.writeCommand(se(n)),await s}async*run(n,s,l){if(!this.proc)throw new Error("PersistentRunner.run called before start");if(this.finalized)throw new Error(`v16-runner is not running (exited code=${this.exitInfo?.code??"null"}, signal=${this.exitInfo?.signal??"none"}) \u2014 cannot start run '${n}'`);if(this.activeRun)throw new Error(`PersistentRunner.run overlap: '${this.activeRun.runId}' still in flight`);let g=new G,w={runId:n,queue:g};this.activeRun=w,this.writeCommand(oe(n,s,l));try{for(;;){let v=await g.next();if(v===z||(yield v,v.type==="run_end"&&(v.run_id===void 0||v.run_id===n)))break}}finally{this.activeRun===w&&(this.activeRun=null)}}sendUserResponse(n){this.writeCommand(ue(n))}cancel(n){this.writeCommand(ae(n))}kill(){this.proc?.child.kill("SIGTERM")}async shutdown(n={}){this.shuttingDown=!0,this.proc&&(this.writeCommand(de(n)),await this.exited)}get stderr(){return this.proc?.getStderr()??""}get diedUnexpectedly(){return this.exitedUnexpectedly}writeCommand(n){let s=JSON.stringify(n)+`
3
- `;try{this.proc?.child.stdin?.write(s)}catch{}}async consume(){if(!this.proc)return;try{for await(let l of this.proc.events){if(l.type==="ready"){this.onReady();continue}if(l.type==="error"&&this.pendingReady){this.onStartError(l.message);continue}this.routeEvent(l)}}catch(l){this.log?.("error","PERSISTENT_RUNNER_STREAM_ERROR","Runner stdout stream errored",{error:l instanceof Error?l.message:String(l)})}let{code:n,signal:s}=await this.proc.exited;this.onExit(n,s)}onReady(){if(this.pendingReady){let{resolve:n}=this.pendingReady;this.pendingReady=null,n()}}onStartError(n){if(!this.pendingReady)return;let{reject:s}=this.pendingReady;this.pendingReady=null,s(new Error(`failed to start: ${n??"unknown error"}`))}routeEvent(n){let s=this.activeRun;if(!s){this.log?.("warn","PERSISTENT_RUNNER_ORPHAN_EVENT","Runner event with no active run",{event_type:n.type});return}s.queue.push(n)}onExit(n,s){if(!this.finalized){if(this.finalized=!0,this.exitInfo={code:n,signal:s},this.shuttingDown||(this.exitedUnexpectedly=!0),this.exitResolve({code:n,signal:s}),this.pendingReady){let{reject:l}=this.pendingReady;this.pendingReady=null,l(new Error(`v16-runner exited before ready (code=${n}, signal=${s??"none"})`))}if(this.activeRun){let{queue:l}=this.activeRun;if(this.activeRun=null,this.shuttingDown)l.end();else{let g=this.proc?.getStderr()?.slice(-500)??"";l.fail(new Error(`v16-runner exited unexpectedly mid-run (code=${n}, signal=${s??"none"})${g?`
4
- ${g}`:""}`))}}}}};var p=Ce(Pe(),1);function le(i){let n={cdp_endpoint:i.cdp_endpoint,ws_endpoint:i.ws_endpoint,width:i.width,height:i.height,headless:i.headless,model:i.model,max_steps:i.max_steps,network_ws:i.network_ws,network_sse:i.network_sse,session_id:i.session_id};return i.device&&(n.device=i.device),i.auth&&(n.auth=i.auth),i.project_id&&(n.project_id=i.project_id),i.disable_ask_user&&(n.disable_ask_user=!0),i.username&&(n.username=i.username),i.access_key&&(n.access_key=i.access_key),n}function j(i,n){let s=null,l=(g,w)=>{for(let v=0;v<g.length;v++){let _=g[v],h=[...w,v];n(_)&&(s===null||h.length>s.length)&&(s=h),_.children&&_.children.length>0&&l(_.children,h)}};return l(i,[]),s}function N(i,n,s){if(n.length===0)return[...i];let l=n[0],g=[...i],w=g[l];if(n.length===1)g[l]=s(w);else{let v=n.slice(1),_=N(w.children??[],v,s);g[l]={...w,children:_}}return g}function ce(){return{steps:[],maxOrdinal:0}}function je(i,n){if(n.type==="run_start"&&n.child_id)return n.environment?.resolution?{...i,resolution:n.environment.resolution}:i;if(n.type==="run_start"){let s=re(i.runnerEnvironment,ie(n.environment));if(s)return{...i,runnerEnvironment:s,...s.resolution?{resolution:s.resolution}:{}}}if(n.type==="step_end"&&typeof n.ordinal=="number"&&n.id){let s={id:n.id,ordinal:n.ordinal,status:n.status,...n.kind?{kind:n.kind}:{},...typeof n.duration=="number"?{duration_ms:Math.round(n.duration*1e3)}:{},...typeof n.action_id=="string"&&n.action_id?{action_id:n.action_id}:{}};return{...i,steps:[...i.steps,s],maxOrdinal:Math.max(i.maxOrdinal,n.ordinal)}}return i}function K(i){let n=i.indexOf(": ");return n>0&&n<15?i.slice(n+2):i}function V(i){return i.map(n=>{let s=n.children?V(n.children):n.children;return n.status==="running"?{...n,status:"stopped",phase:void 0,children:s}:s!==n.children?{...n,children:s}:n})}function ze(i,n,s,l,g){let[w,v]=(0,p.useState)(!1),[_,h]=(0,p.useState)([]),[pe,T]=(0,p.useState)(null),[he,B]=(0,p.useState)(null),[fe,k]=(0,p.useState)(null),[me,W]=(0,p.useState)(null),[ve,J]=(0,p.useState)([]),[ge,H]=(0,p.useState)(null),[Re,Se]=(0,p.useState)(void 0),[ye,$]=(0,p.useState)(0),y=(0,p.useRef)(null),E=(0,p.useRef)(null),S=(0,p.useRef)(null),b=(0,p.useRef)(0),F=(0,p.useRef)(!1),U=(0,p.useRef)(ce()),O=(0,p.useRef)(null),we=(0,p.useCallback)(async(m,x)=>{let Q=O.current;if(Q)try{await Q}catch{}h([]),T(null),B(null),k(null),W(null),J([]),H(null),Se(m.max_steps),v(!0),S.current=null,b.current=0,U.current=ce();let I=y.current;if(I&&E.current!==m.session_id){try{I.kill()}catch{}y.current=null,E.current=null,$(e=>e+1),I=null}if(!I){let e=Y();if(!e){k("v16-runner not found. Build the binary with `cd v16-runner && python build.py` or ensure Python is available."),v(!1);return}let d=ne({environment:x?.environment,mode:x?.mode,assertionMode:x?.assertionMode,finalValidation:x?.finalValidation,username:m.username,accessKey:m.access_key,sessionId:m.session_id});m.device?.platform&&await ee(d,m.device);let u=new D({env:d,runner:e,log:x?.log,sessionId:m.session_id});y.current=u,E.current=m.session_id,I=u,X("runner",()=>{try{u.kill()}catch{}});let o=le(m);try{await u.start(o)}catch(a){k(a instanceof Error?a.message:String(a)),v(!1),P("runner","Runner start failed"),y.current=null,E.current=null,$(t=>t+1);return}}let M={...m};delete M.run_id,te(M,{environment:x?.environment});let ke=`run-${m.run_index}`,Ie=m.mode==="replay"?"replay":"author",L=I,q=(async()=>{F.current=!1;for await(let e of L.run(ke,Ie,M)){if(F.current)break;switch(U.current=je(U.current,e),e.type){case"run_start":if(e.child_id)break;if(S.current&&!S.current.isSingleFlow){let d=b.current;b.current++,h(u=>u.map((o,a)=>a===d?{...o,status:"running"}:o.status==="running"&&!o.children?.some(t=>t.status==="running")?{...o,status:o.children?.some(t=>t.status==="failed")?"failed":"passed"}:o))}break;case"bifurcation":{let d=e.flows??[],u=e.count??d.length,o={flows:d,isSingleFlow:e.is_single_flow??u<=1};W(o),S.current=o,b.current=0,h(d.map((a,t)=>({index:t+1,objective:a??`Flow ${t+1}`,status:"pending"})));break}case"step_start":{n?.("STEP_START",`Step ${e.index} started`,{index:e.index,objective:e.objective,child_id:e.child_id});let d=e.index,u=e.objective??`Step ${d}`,o=e.child_id,a=S.current&&!S.current.isSingleFlow;if(o)h(t=>{let r=j(t,c=>c.branchChildId===o)??j(t,c=>c.status==="running");return r?N(t,r,c=>{let f=(c.children??[]).map(R=>R.status==="running"&&R.childId===o?{...R,status:"stopped",phase:void 0}:R);return f.push({index:d,objective:u,status:"running",childId:o}),{...c,children:f}}):t});else if(a){let t=Math.max(0,b.current-1);h(r=>{let c=[...r];if(t>=c.length)return r;let f={...c[t]},C=[...f.children??[]].map(A=>A.status==="running"&&A.childId===void 0?{...A,status:"stopped",phase:void 0}:A);return C.push({index:d,objective:u,status:"running"}),f.children=C,f.status="running",c[t]=f,c})}else h(t=>{let r=V(t);return r.some(f=>f.index===d)?r.map(f=>f.index===d?{...f,status:"running",objective:u}:f):[...r,{index:d,objective:u,status:"running"}]});break}case"step_event":{n?.("STEP_EVENT",`Step ${e.index} ${e.event}`,{index:e.index,phase:e.event,action_type:e.action_type,detail:e.detail,child_id:e.child_id});let d=e.child_id,u=S.current&&!S.current.isSingleFlow;if(e.event==="cm_init"&&e.checkpoint_count!=null){J(o=>[...o,e.checkpoint_count]);break}if(e.event==="replay_started"){H({recordingLength:e.recording_length??0});break}if(e.event==="reasoning"&&e.detail&&e.detail!=="reasoning"&&s?.(e.detail),d){let o=t=>{if(t.index!==e.index||t.childId!==d)return t;let r={phase:e.event};return e.event==="reasoning"&&e.detail&&e.detail!=="reasoning"&&(r.objective=e.detail),e.action_type&&(r.actionType=e.action_type),{...t,...r}},a=t=>t.map(r=>{let c=o(r);return c!==r?c:r.children&&r.children.length>0?{...r,children:a(r.children)}:r});h(t=>t.map(r=>r.children?{...r,children:a(r.children)}:r))}else if(u){let o=Math.max(0,b.current-1);h(a=>{let t=[...a];if(o>=t.length)return a;let r={...t[o]},c=[...r.children??[]];if(!c.some(R=>R.index===e.index&&R.childId===void 0))c.push({index:e.index,objective:`Step ${e.index}`,status:"running",phase:e.event,actionType:e.action_type});else for(let R=0;R<c.length;R++){if(c[R].index!==e.index||c[R].childId!==void 0)continue;let C={phase:e.event};e.event==="reasoning"&&e.detail&&e.detail!=="reasoning"&&(C.objective=e.detail),e.action_type&&(C.actionType=e.action_type),c[R]={...c[R],...C}}return r.children=c,t[o]=r,t})}else h(o=>o.some(t=>t.index===e.index)?o.map(t=>{if(t.index!==e.index)return t;let r={phase:e.event};return e.event==="reasoning"&&e.detail&&e.detail!=="reasoning"&&(r.objective=e.detail),e.action_type&&(r.actionType=e.action_type),{...t,...r}}):[...V(o),{index:e.index,objective:`Step ${e.index}`,status:"running",phase:e.event,actionType:e.action_type}]);break}case"step_end":{n?.("STEP_END",`Step ${e.index} ${e.status}`,{index:e.index,status:e.status,duration:e.duration,summary:e.summary,child_id:e.child_id}),l?.();let d=e.child_id,u=S.current&&!S.current.isSingleFlow;if(d){let o=t=>t.index===e.index&&t.childId===d?{...t,status:e.status,duration:e.duration,phase:void 0,objective:t.objective.startsWith("Step ")?K(e.summary||t.objective):t.objective}:t,a=t=>t.map(r=>{let c=o(r);return c!==r?c:r.children&&r.children.length>0?{...r,children:a(r.children)}:r});h(t=>t.map(r=>r.children?{...r,children:a(r.children)}:r))}else if(u){let o=Math.max(0,b.current-1);h(a=>{let t=[...a];if(o>=t.length)return a;let r={...t[o]},c=(r.children??[]).map(f=>f.index===e.index&&f.childId===void 0?{...f,status:e.status,duration:e.duration,phase:void 0,objective:f.objective.startsWith("Step ")?K(e.summary||f.objective):f.objective}:f);return r.children=c,t[o]=r,t})}else h(o=>o.map(a=>a.index===e.index?{...a,status:e.status,duration:e.duration,phase:void 0,objective:a.objective.startsWith("Step ")?K(e.summary||a.objective):a.objective}:a));{let a=S.current&&!S.current.isSingleFlow?Math.max(0,b.current-1):0,t=typeof e.ordinal=="number"&&e.id?{ordinal:e.ordinal,id:e.id}:void 0;i?.(e.index,a,e.child_id,t)}break}case"child_agent_start":{let d=e.objective??"",u=e.child_id;h(o=>{let a=j(o,t=>t.status==="running");return a?N(o,a,t=>({...t,objective:`${d} (branch)`,phase:`child: ${d.slice(0,50)}`,branchObjective:d,branchChildId:u})):o});break}case"child_agent_end":{let d=e.child_id,u=`child ${e.success?"done":"failed"}`;h(o=>{let a=j(o,t=>t.branchChildId===d);return a?N(o,a,t=>({...t,phase:u})):o.map(t=>t.phase?.startsWith("child:")?{...t,phase:u}:t)});break}case"describe_trigger":g?.(e);break;case"ask_user":T(e.question??"");break;case"run_end":h(d=>d.map(u=>u.status==="running"?{...u,status:e.status,phase:void 0}:u)),v(!1),B(e);break;case"error":v(!1),k(e.message??"Runner error"),h(d=>d.map(u=>u.status==="running"?{...u,status:"failed",phase:void 0}:u));break}}})().catch(e=>{if(y.current!==L)return;let u=[e instanceof Error?e.message:String(e)],o=L.stderr;o&&!u.join(`
5
- `).includes(o)&&u.push(o),k(u.join(`
6
- `)),v(!1),h(a=>a.map(t=>t.status==="running"?{...t,status:"failed",phase:void 0}:t)),P("runner","Runner died mid-run"),y.current=null,E.current=null,$(a=>a+1)});O.current=q,q.finally(()=>{O.current===q&&(O.current=null)})},[i,n,s,l,g]),xe=(0,p.useCallback)(m=>{y.current?.sendUserResponse(m),T(null)},[]),_e=(0,p.useCallback)(()=>{let m=y.current;m&&(m.cancel(),v(!1),T(null))},[]),be=(0,p.useCallback)(async()=>{let m=y.current;if(m){try{await Promise.race([m.shutdown(),new Promise(x=>setTimeout(x,5e3))])}catch{}P("runner","Runner shut down"),y.current=null,E.current=null,$(x=>x+1)}},[]),Ee=(0,p.useCallback)(()=>{h([]),B(null),k(null)},[]);return(0,p.useEffect)(()=>()=>{F.current=!0,P("runner","Component unmounted"),y.current=null,E.current=null},[]),{isRunning:w,steps:_,askingUser:pe,lastRunEnd:he,runError:fe,bifurcationInfo:me,cmInitCounts:ve,replayInfo:ge,maxSteps:Re,sessionGen:ye,startRun:we,sendAnswer:xe,cancelRun:_e,shutdownRunner:be,clearLastRun:Ee,getEvidenceState:()=>U.current}}export{D as a,le as b,ce as c,je as d,ze as e};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- var g={graph_search_similar:"search graph",graph_get_node:"read node",graph_get_edges:"read edges",graph_match_by_type:"match by type",graph_find_by_provenance:"trace provenance",graph_stale_nodes:"check stale",ask_user:"ask",finalize_proposal:"propose use-cases",chat_turn:"apply changes",read_image:"read image",source_read:"read source",source_grep:"search source",finalize_design:"propose design",expand_bva:"expand boundaries",covering_array:"combine classes",dedupe_candidates:"dedupe",budget_cut:"trim to budget",source_list:"list sources",graph_search_similar_batch:"search graph",graph_history:"read history"};function d(t){let e=g[t.name],n=t.status==="error"||t.status==="aborted"?" \u2717":"",a=t.detail?` \u2014 ${t.detail}`:"";return e?`\u2692 ${e}${a}${n}`:`\u2692 working\u2026${a}${n}`}function l(t){return d(t).replace(/^\S+ /,"")}function h(t){let e=Math.floor(t/60);return e>0?`${e}m ${String(t%60).padStart(2,"0")}s`:`${t}s`}function k(t,e,n){let a=h(t),o=new Map;for(let i of n){let r=g[i.name]??"working\u2026";o.set(r,(o.get(r)??0)+i.n)}let s=[...o.entries()],p=s.slice(0,4).map(([i,r])=>r>1?`${i} \xD7${r}`:i),c=s.length-4,u=[...p,...c>0?[`+${c} more`]:[]].join(" \xB7 ");return`worked ${a} \u2014 ${e} tool call${e===1?"":"s"}${u?` \xB7 ${u}`:""}`}function T(){return{currentAttempt:null,liveThinking:"",thinkingLog:[],activity:[]}}var m={dedup_candidate:"checking a possible duplicate",ambiguity:"asking to resolve an ambiguity",validation_repair:"repairing a validation failure",finalize:"finalizing the proposal",terminal_call:"putting the result together",validation_failed:"fixing a validation issue",no_tool_calls:"nudging a stalled turn",evidence_readback:"reading the evidence back",evidence_search:"searching the evidence",provenance_check:"checking provenance"};function _(t){return m[t.reason_code]??t.reason_code.replace(/_/g," ")}function v(t){let e=l({name:t.name});return t.status==="started"?`\u2192 ${e}\u2026`:t.status==="error"||t.status==="aborted"?`\u2717 ${e}`:`\u2713 ${e}`}function f(t,e){return e.turn_id!==t.turn_id?e.turn_id<t.turn_id:e.attempt<t.attempt}function $(t,e){let n=t.currentAttempt;if(n===null||n.turn_id!==e.turn_id||n.attempt!==e.attempt){if(n!==null&&f(n,e))return t;t={...t,currentAttempt:{turn_id:e.turn_id,attempt:e.attempt},liveThinking:""}}switch(e.type){case"reasoning_delta":return{...t,liveThinking:t.liveThinking+e.text};case"reasoning_done":return e.present?{...t,thinkingLog:[...t.thinkingLog,{text:t.liveThinking,tookMs:e.took_ms}],liveThinking:""}:{...t,liveThinking:""};case"tool_activity":return{...t,activity:[...t.activity,{name:e.name,status:e.status,label:v(e)}]};case"decision_activity":return{...t,activity:[...t.activity,{name:e.action,status:"decision",label:_(e)}]}}}export{l as a,h as b,k as c,T as d,$ as e};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- function c(e,r){let n=new Map;for(let[o,s]of e.superseded)typeof s=="string"&&n.set(s,o);let t=r,i=new Set;for(;n.has(t)&&!i.has(t);)i.add(t),t=n.get(t);return t}function a(e,r){let n=e.resolve(r);if(n===null)return null;let t=e.designGenerationOf.get(c(e,n.cid));if(t===void 0)return null;let i=e.tipOf(n.cid),o=!e.superseded.has(i);return{gen:t.gen,live:o,minted_at_seq:t.seq}}function u(e,r,n){let t=e.resolve(r);if(t===null)return{error:{code:"UNKNOWN_REF",detail:`'${r}' names no use-case in this context`}};let i=c(e,t.cid),o=e.designGenerationOf.get(i);if(o===void 0)return{uc_root:i,next_gen:1,expected_prev_gen:null,...n.because?{because:n.because}:{}};let s=a(e,r);return s!==null&&s.live&&!n.force?{error:{code:"GENERATION_LIVE",detail:`${r} already has a live design generation (gen ${o.gen}) \u2014 pass --force with --because to supersede it`}}:s!==null&&s.live&&n.force&&!n.because?{error:{code:"MISSING_BECAUSE",detail:`superseding the live generation of ${r} requires --because <reason>`}}:{uc_root:i,next_gen:o.gen+1,expected_prev_gen:o.gen,...n.because?{because:n.because}:{}}}function d(e,r){let n=e.designGenerationOf.get(r.uc_root)?.gen??null;return n!==r.expected_prev_gen?{code:"GENERATION_MOVED",detail:`design generation of ${r.uc_root.slice(0,12)} moved (expected ${String(r.expected_prev_gen)}, found ${String(n)}) \u2014 another session finalized; re-open and re-ground`}:null}function l(e,r,n){return{uc_root:e.uc_root,uc_cid:r,generation:e.next_gen,supersedes_generation:e.expected_prev_gen,...e.because?{because:e.because}:{},by:n}}export{c as a,a as b,u as c,d,l as e};
@@ -1,3 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{e as c}from"./chunk-5EOX4MEY.js";import{createHash as f,randomBytes as p}from"crypto";import r from"fs";import u from"os";import s from"path";function l(e){return s.join(e,"store.json")}function a(){return`ctx-${p(6).toString("hex")}`}function m(e){return f("sha256").update(`${u.hostname()}|${s.resolve(e)}`).digest("hex").slice(0,32)}function S(e){try{let t=JSON.parse(r.readFileSync(l(e),"utf8"));if(typeof t.context_lineage_id=="string"&&typeof t.context_instance_id=="string")return t}catch{}return null}function _(){try{return JSON.parse(r.readFileSync(c(),"utf8"))}catch{return{}}}function y(e){let t=c();r.mkdirSync(s.dirname(t),{recursive:!0});let n=`${t}.tmp-${process.pid}`;r.writeFileSync(n,JSON.stringify(e,null,2),{mode:384}),r.renameSync(n,t)}function g(e,t){let n=l(e),i=`${n}.tmp-${process.pid}`;r.writeFileSync(i,JSON.stringify(t,null,2)+`
3
- `,{mode:420}),r.renameSync(i,n)}function $(e){let t=S(e);if(!t){t={context_lineage_id:a(),context_instance_id:a(),created_at:new Date().toISOString(),schema:1};try{g(e,t)}catch{return{ids:t,cloned:!1}}}let n=!1;try{let i=_(),d=m(e),o=i[t.context_lineage_id];o&&o.fingerprint!==d&&r.existsSync(s.join(o.store_path,"store.json"))&&(n=!0,t={...t,context_instance_id:a()},g(e,t)),i[t.context_lineage_id]={fingerprint:d,store_path:s.resolve(e),last_seen:new Date().toISOString()},y(i)}catch{}return{ids:t,cloned:n}}export{S as a,$ as b};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- var i=["emulator","simulator","android","ios"];function r(e){return i.includes(e)?e:void 0}function n(e){return e==="android"||e==="ios"}export{r as a,n as b};