@testmuai/kane-cli 0.9.0 → 0.10.0-rc.3

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 (634) hide show
  1. package/dist/ChatSurface-6NZGMNHL.js +2 -0
  2. package/dist/ChromeProfilePicker-M4WXOB5O.js +2 -0
  3. package/dist/CliFeedbackPrompt-6MJA7DF6.js +2 -0
  4. package/dist/CliUploadProgress-6NLS7XHH.js +2 -0
  5. package/dist/ConfigView-O4WKZ5PU.js +2 -0
  6. package/dist/EvidenceViewOffer-WIEWCZUP.js +2 -0
  7. package/dist/FolderPicker-AF7ZMV3M.js +2 -0
  8. package/dist/InfoBox-D7GGZJU4.js +2 -0
  9. package/dist/LinksBox-DXP66H3H.js +2 -0
  10. package/dist/ProfilesView-TWOY5PVC.js +2 -0
  11. package/dist/ProjectPicker-OBYHJJLU.js +2 -0
  12. package/dist/SaveSessionPrompt-7XSHS4NL.js +2 -0
  13. package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
  14. package/dist/SingleShotApp-XQUDR36R.js +2 -0
  15. package/dist/SummaryBox-IA2KS6GT.js +2 -0
  16. package/dist/TestMdRunView-LS2QUFWR.js +2 -0
  17. package/dist/TestrunEvidenceTable-HNDVJDIF.js +2 -0
  18. package/dist/WhoamiView-SNL75TEF.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-UI4ABEIX.js +2 -0
  22. package/dist/assurance-job-FFSSS4XV.js +7 -0
  23. package/dist/auth-7Z54TMQQ.js +2 -0
  24. package/dist/{binary-LVHXED3O.js → binary-THPLXCOD.js} +1 -1
  25. package/dist/bind-4XWK3DG2.js +2 -0
  26. package/dist/bootstrap-6ACT4ALI.js +2 -0
  27. package/dist/bridge-T6QMYKED.js +2 -0
  28. package/dist/build-5ZN47FAT.js +2 -0
  29. package/dist/catalog-MYPS2BXY.js +2 -0
  30. package/dist/{changelog-N5AZHXOS.js → changelog-SU674BVE.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-2DYHAP4E.js +2 -0
  36. package/dist/chunk-2TVPA3LL.js +2 -0
  37. package/dist/{chunk-FMUV6UCX.js → chunk-2XW33VOK.js} +1 -1
  38. package/dist/chunk-33DWJV67.js +235 -0
  39. package/dist/chunk-34R7BNZ2.js +2 -0
  40. package/dist/chunk-35ECWCCK.js +2 -0
  41. package/dist/{chunk-OHOJSADN.js → chunk-36N3EHW5.js} +1 -1
  42. package/dist/chunk-3BSYOCSW.js +3 -0
  43. package/dist/chunk-3E4ZO73O.js +6 -0
  44. package/dist/chunk-3F5FMH76.js +2 -0
  45. package/dist/chunk-3G2LSTK5.js +2 -0
  46. package/dist/chunk-3GXN6VF6.js +2 -0
  47. package/dist/chunk-3JLEDSG5.js +4 -0
  48. package/dist/chunk-3OQW2GTA.js +2 -0
  49. package/dist/chunk-3QICDXY5.js +5 -0
  50. package/dist/chunk-3RJHXOZH.js +3 -0
  51. package/dist/{chunk-Q5RDCSYM.js → chunk-3YTCKCBG.js} +1 -1
  52. package/dist/chunk-42PALMW2.js +4 -0
  53. package/dist/chunk-44B6THYK.js +2 -0
  54. package/dist/chunk-457Y5TEC.js +19 -0
  55. package/dist/chunk-47WQBG5I.js +6 -0
  56. package/dist/chunk-4I7YN6YY.js +3 -0
  57. package/dist/chunk-4IEQNX7F.js +2 -0
  58. package/dist/chunk-4LTHDJ3D.js +2 -0
  59. package/dist/chunk-4QFTHUJA.js +34 -0
  60. package/dist/chunk-4QTH7VYE.js +2 -0
  61. package/dist/chunk-4YW767UV.js +47 -0
  62. package/dist/chunk-54XA5MZH.js +2 -0
  63. package/dist/chunk-5AKJPYUW.js +11 -0
  64. package/dist/{chunk-AKE2CTV6.js → chunk-5D7ENQTQ.js} +1 -1
  65. package/dist/chunk-63EKRZKI.js +2 -0
  66. package/dist/{chunk-EHN5HTUD.js → chunk-65VANXOF.js} +51 -51
  67. package/dist/{chunk-J3BGYSMD.js → chunk-6DZX5HLZ.js} +8 -8
  68. package/dist/{chunk-YBAVDT3G.js → chunk-6EB5VRAN.js} +1 -1
  69. package/dist/chunk-6NFOH4AC.js +4 -0
  70. package/dist/chunk-6PIIUAZF.js +3 -0
  71. package/dist/chunk-6UVIY56J.js +2 -0
  72. package/dist/chunk-72KYMWQ5.js +2 -0
  73. package/dist/chunk-72RC7JSA.js +21 -0
  74. package/dist/chunk-734ORT6O.js +4 -0
  75. package/dist/chunk-77ZZQJLX.js +2 -0
  76. package/dist/chunk-7AET4JKQ.js +2 -0
  77. package/dist/chunk-7DFBOVUB.js +2 -0
  78. package/dist/chunk-7HMSMAUG.js +29 -0
  79. package/dist/chunk-7HO4NX5W.js +1 -0
  80. package/dist/chunk-7KX2BHKG.js +2 -0
  81. package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
  82. package/dist/chunk-7NPTL66J.js +2 -0
  83. package/dist/chunk-7RWP4Y3H.js +2 -0
  84. package/dist/{chunk-PCKIANML.js → chunk-7SY34IIL.js} +1 -1
  85. package/dist/chunk-7V4BQSSV.js +2 -0
  86. package/dist/chunk-7XBNMOH4.js +6 -0
  87. package/dist/{chunk-SOCHN2PY.js → chunk-7YT4TTKL.js} +1 -1
  88. package/dist/{chunk-C25M2J5Q.js → chunk-ACMBMZDQ.js} +1 -1
  89. package/dist/chunk-AEWNWAXW.js +18 -0
  90. package/dist/chunk-AQ2OG2EF.js +2 -0
  91. package/dist/chunk-AUJSC7PU.js +4 -0
  92. package/dist/chunk-AVI5H4UM.js +13 -0
  93. package/dist/chunk-AVSMXDTX.js +2 -0
  94. package/dist/chunk-AZLNLHUA.js +4 -0
  95. package/dist/{chunk-HGFWIBVF.js → chunk-B7ZX5HEN.js} +5 -5
  96. package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
  97. package/dist/chunk-BWXLZS5O.js +2 -0
  98. package/dist/chunk-BY65QAAN.js +4 -0
  99. package/dist/chunk-C2RUDJ46.js +2 -0
  100. package/dist/chunk-C5Z7MQE6.js +2 -0
  101. package/dist/{chunk-WDMUPK6I.js → chunk-C62QWG4B.js} +1 -1
  102. package/dist/chunk-C6HI6Y3S.js +2 -0
  103. package/dist/chunk-CB4ARIHR.js +2 -0
  104. package/dist/{chunk-7WXMV3O3.js → chunk-CCP4X75B.js} +1 -1
  105. package/dist/chunk-CGITGJ3I.js +4 -0
  106. package/dist/chunk-CM4CHYSN.js +2 -0
  107. package/dist/{chunk-ZXY4P76I.js → chunk-CUXY6KQ2.js} +1 -1
  108. package/dist/chunk-D36V5OX6.js +2 -0
  109. package/dist/chunk-D756UWY2.js +6 -0
  110. package/dist/chunk-D7TKE7LK.js +2 -0
  111. package/dist/{chunk-UWXDURAB.js → chunk-D7U2M26S.js} +1 -1
  112. package/dist/chunk-DBMW3VUN.js +4 -0
  113. package/dist/chunk-DDZLCAEO.js +5 -0
  114. package/dist/chunk-DJC7NTLA.js +3 -0
  115. package/dist/chunk-DPGOAFKF.js +2 -0
  116. package/dist/chunk-DREQ3RAA.js +2 -0
  117. package/dist/chunk-DTUPEKEO.js +2 -0
  118. package/dist/chunk-DZOYYWOW.js +2 -0
  119. package/dist/chunk-E6KSRQXL.js +8 -0
  120. package/dist/chunk-EBPRPNSA.js +2 -0
  121. package/dist/chunk-ECPFI75W.js +5 -0
  122. package/dist/chunk-EECDDDSB.js +3 -0
  123. package/dist/chunk-EF47KRUK.js +2 -0
  124. package/dist/chunk-ETZMFRD6.js +2 -0
  125. package/dist/chunk-EZN7CF45.js +4 -0
  126. package/dist/{chunk-CNUCP6DK.js → chunk-F22K3RRX.js} +1 -1
  127. package/dist/{chunk-WRSIKZ2V.js → chunk-F5NHG7VB.js} +1 -1
  128. package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
  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-FWDUVFS6.js +26 -0
  133. package/dist/chunk-FWUPJORV.js +6 -0
  134. package/dist/chunk-GFLB2SHW.js +2 -0
  135. package/dist/chunk-GMTHZUZ3.js +2 -0
  136. package/dist/chunk-GQRU3B54.js +1397 -0
  137. package/dist/chunk-GRURFGBP.js +2 -0
  138. package/dist/chunk-GXKY5A46.js +9 -0
  139. package/dist/chunk-HAW5WEKT.js +13 -0
  140. package/dist/chunk-HCJ2N3XB.js +12 -0
  141. package/dist/chunk-HHW6MRU3.js +6 -0
  142. package/dist/chunk-HIUAUZNL.js +2 -0
  143. package/dist/chunk-HJLMH7ZM.js +2 -0
  144. package/dist/{chunk-YWYORBY3.js → chunk-HJMCXSUJ.js} +1 -1
  145. package/dist/chunk-HK62JVQM.js +3 -0
  146. package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
  147. package/dist/chunk-I2MC6VVX.js +2 -0
  148. package/dist/chunk-I4RVVBG3.js +10 -0
  149. package/dist/chunk-I4WXALQR.js +2 -0
  150. package/dist/chunk-ICLUC44J.js +2 -0
  151. package/dist/{chunk-6HU5M2DS.js → chunk-IGEAET7M.js} +1 -1
  152. package/dist/{chunk-GCISXCDU.js → chunk-IINZZ4BZ.js} +1 -1
  153. package/dist/chunk-IJ2AHSWW.js +2 -0
  154. package/dist/{chunk-CSNJPD2J.js → chunk-IUQOG7Z5.js} +3 -3
  155. package/dist/chunk-IZ65ZPWY.js +3 -0
  156. package/dist/chunk-JGRXMTME.js +15 -0
  157. package/dist/{chunk-NBXYL2JT.js → chunk-JIRNI5TB.js} +7 -7
  158. package/dist/chunk-JNSWKGTB.js +2 -0
  159. package/dist/chunk-JZP3Y4ZM.js +2 -0
  160. package/dist/chunk-KF4DKXSS.js +2 -0
  161. package/dist/chunk-KGNE5CIM.js +2 -0
  162. package/dist/chunk-KM3YCIDV.js +3 -0
  163. package/dist/{chunk-HAYV4D2I.js → chunk-KODJVOCN.js} +1 -1
  164. package/dist/chunk-KU3YHPWZ.js +2 -0
  165. package/dist/{chunk-M3UAZTDK.js → chunk-KXHJMAZU.js} +2 -2
  166. package/dist/chunk-L5DALV5N.js +2 -0
  167. package/dist/chunk-LAOTVZHV.js +6 -0
  168. package/dist/chunk-LCSJ7GOG.js +2 -0
  169. package/dist/{chunk-DWMESHFI.js → chunk-LIGTP3A3.js} +1 -1
  170. package/dist/chunk-LKQFG4RW.js +5 -0
  171. package/dist/{chunk-EBLXHOE3.js → chunk-LQQNPMOD.js} +1 -1
  172. package/dist/chunk-LSDJOVWW.js +6 -0
  173. package/dist/{chunk-C6S2RPZA.js → chunk-LUR7JFPP.js} +1 -1
  174. package/dist/chunk-LUZBGTYB.js +2 -0
  175. package/dist/chunk-LX2I4JEH.js +2 -0
  176. package/dist/{chunk-7GAHJZLH.js → chunk-M43WH5DQ.js} +1 -1
  177. package/dist/chunk-MEKPGQAM.js +21 -0
  178. package/dist/chunk-MNBGG4H3.js +16 -0
  179. package/dist/chunk-MYVKUJGS.js +2 -0
  180. package/dist/chunk-MYZHOBS4.js +2 -0
  181. package/dist/chunk-NC7D7GOM.js +21 -0
  182. package/dist/chunk-NIVFEACM.js +2 -0
  183. package/dist/chunk-NLZZLANH.js +4 -0
  184. package/dist/{chunk-XT7XA4DN.js → chunk-NXAJBSIF.js} +1 -1
  185. package/dist/chunk-NXRF7FFS.js +2 -0
  186. package/dist/chunk-NZ6AV2TA.js +4 -0
  187. package/dist/chunk-O3HHTKZ5.js +6 -0
  188. package/dist/chunk-OCDBTAYS.js +12 -0
  189. package/dist/chunk-OFSDB7B4.js +3 -0
  190. package/dist/{chunk-Q5CINJYL.js → chunk-OGFU4YY4.js} +1 -1
  191. package/dist/chunk-OJ33Q6DU.js +2 -0
  192. package/dist/chunk-P2ZQDQDB.js +2 -0
  193. package/dist/{chunk-KXEE6VCA.js → chunk-P3JXJ4BW.js} +1 -1
  194. package/dist/chunk-PAWQ4AKN.js +2 -0
  195. package/dist/chunk-PUVMC4PX.js +26 -0
  196. package/dist/{chunk-SEEEGDVK.js → chunk-PZA3BSOE.js} +1 -1
  197. package/dist/chunk-Q3C6NDGI.js +2 -0
  198. package/dist/chunk-QBYENBMB.js +2 -0
  199. package/dist/chunk-QDFY5GGO.js +5 -0
  200. package/dist/chunk-QDXKEOKI.js +16 -0
  201. package/dist/{chunk-6VY62QC2.js → chunk-QENCC2ZS.js} +1 -1
  202. package/dist/chunk-QI5RZ7LL.js +2 -0
  203. package/dist/chunk-QXQ7KVEN.js +2 -0
  204. package/dist/chunk-R4JUKTDO.js +2 -0
  205. package/dist/chunk-R7KXAISS.js +12 -0
  206. package/dist/chunk-RDP7GWSY.js +2 -0
  207. package/dist/chunk-REKHAN53.js +5 -0
  208. package/dist/chunk-RF37IJNN.js +2 -0
  209. package/dist/{chunk-KWEOLPBJ.js → chunk-RFEON5GN.js} +1 -1
  210. package/dist/chunk-RHGW7B5Q.js +2 -0
  211. package/dist/chunk-RPRXRKKR.js +2 -0
  212. package/dist/{chunk-EOA6YPES.js → chunk-RTVHJ23A.js} +4 -4
  213. package/dist/chunk-RTVWQK7I.js +2 -0
  214. package/dist/chunk-RX6776AI.js +5 -0
  215. package/dist/{chunk-F7NSSQYZ.js → chunk-SGPAM5DZ.js} +1 -1
  216. package/dist/chunk-SMTBOSEJ.js +2 -0
  217. package/dist/chunk-SMXABALN.js +2 -0
  218. package/dist/{chunk-TM7VRLWS.js → chunk-SXRHKXSE.js} +1 -1
  219. package/dist/chunk-TNORODUF.js +2 -0
  220. package/dist/chunk-TU42YZOJ.js +6 -0
  221. package/dist/chunk-TU7TVFBK.js +2 -0
  222. package/dist/chunk-TW5AA5A7.js +8 -0
  223. package/dist/chunk-UEE3RZN4.js +14 -0
  224. package/dist/chunk-URH4FX3H.js +2 -0
  225. package/dist/chunk-UTM7D4PI.js +2 -0
  226. package/dist/chunk-UUJIGOEO.js +2 -0
  227. package/dist/chunk-UYDHOHSZ.js +2 -0
  228. package/dist/{chunk-4BZOG6PE.js → chunk-V7USCQWO.js} +1 -1
  229. package/dist/chunk-VJGWVBZR.js +1 -0
  230. package/dist/chunk-VLDCHFXF.js +2 -0
  231. package/dist/chunk-VO66KP2W.js +2 -0
  232. package/dist/chunk-VRIZDOO5.js +2 -0
  233. package/dist/{chunk-DOOI2JBD.js → chunk-VSVWNRI2.js} +1 -1
  234. package/dist/chunk-VUFIL5VR.js +6 -0
  235. package/dist/chunk-VX657KIK.js +2 -0
  236. package/dist/chunk-VXGN3IV7.js +2 -0
  237. package/dist/chunk-VZ4A6WMK.js +97 -0
  238. package/dist/chunk-VZJ6LUXX.js +2 -0
  239. package/dist/{chunk-RWSOZPJQ.js → chunk-W4QSZNMB.js} +1 -1
  240. package/dist/chunk-W54OT2FU.js +9 -0
  241. package/dist/{chunk-BL3SJDCG.js → chunk-W6HZF56M.js} +1 -1
  242. package/dist/chunk-W72ACCFL.js +27 -0
  243. package/dist/chunk-W7FLXW6Q.js +5 -0
  244. package/dist/chunk-WAOUE7MP.js +9 -0
  245. package/dist/chunk-WEIPY3CI.js +16 -0
  246. package/dist/chunk-WMGKUERB.js +6 -0
  247. package/dist/{chunk-DFS4RMVP.js → chunk-WN5VKKJ3.js} +1 -1
  248. package/dist/chunk-WOSANGV6.js +5 -0
  249. package/dist/{chunk-K3IQEL7R.js → chunk-WXJCJL5L.js} +1 -1
  250. package/dist/chunk-WZXPF3BI.js +2 -0
  251. package/dist/chunk-XB6BJPDL.js +2 -0
  252. package/dist/{chunk-4FHK4LKQ.js → chunk-XLEGGC4Y.js} +1 -1
  253. package/dist/chunk-XMPTFXPW.js +5 -0
  254. package/dist/chunk-XQMWHPZI.js +3 -0
  255. package/dist/{chunk-75MMTNPB.js → chunk-XRNQSXOM.js} +2 -2
  256. package/dist/{chunk-2PKME4VT.js → chunk-XZGEN4NU.js} +4 -4
  257. package/dist/chunk-XZYA7DNH.js +2 -0
  258. package/dist/{chunk-OIUV3ISA.js → chunk-Y6Y6RAY4.js} +1 -1
  259. package/dist/chunk-Y7E5L42F.js +3 -0
  260. package/dist/{chunk-GFBAK7WQ.js → chunk-YAW6JW6D.js} +7 -7
  261. package/dist/chunk-YDPTSDIJ.js +2 -0
  262. package/dist/chunk-YDSGXB25.js +2 -0
  263. package/dist/chunk-YGRULEZY.js +2 -0
  264. package/dist/chunk-YHFZFV3A.js +22 -0
  265. package/dist/chunk-YIKF4ERQ.js +375 -0
  266. package/dist/chunk-YLXWAY7D.js +2 -0
  267. package/dist/{chunk-UA2QDAWT.js → chunk-YPFQ4UGF.js} +1 -1
  268. package/dist/{chunk-4CYBXJIA.js → chunk-YQ5C6UDG.js} +1 -1
  269. package/dist/chunk-Z55KBMYV.js +2 -0
  270. package/dist/chunk-ZAFJQ3SM.js +2 -0
  271. package/dist/chunk-ZCRZFAOT.js +2 -0
  272. package/dist/chunk-ZFM77AQU.js +2 -0
  273. package/dist/{chunk-Q6F23V7L.js → chunk-ZFMRQ57Y.js} +1 -1
  274. package/dist/chunk-ZHWU6L2G.js +5 -0
  275. package/dist/chunk-ZTHYAHDN.js +17 -0
  276. package/dist/{chunk-X2A6CC6B.js → chunk-ZTRRFG52.js} +1 -1
  277. package/dist/chunk-ZU4W2QGM.js +3 -0
  278. package/dist/committer-JGY66PFM.js +2 -0
  279. package/dist/config-754B73XK.js +2 -0
  280. package/dist/controller-client-PB3AZAGG.js +2 -0
  281. package/dist/cover-cmd-NBNZCR6C.js +2 -0
  282. package/dist/{credentials-QD32Y7K7.js → credentials-F7DYLVWY.js} +1 -1
  283. package/dist/{deps-bundle-OI7JJ22L.js → deps-bundle-PW3WEQJ7.js} +1 -1
  284. package/dist/{deps-resolve-ZOALDS6H.js → deps-resolve-SQYVN76L.js} +1 -1
  285. package/dist/descriptor-7T32VRMB.js +2 -0
  286. package/dist/design-chat-F3OEZPNJ.js +2 -0
  287. package/dist/design-committer-TRYP3LOZ.js +2 -0
  288. package/dist/design-headless-OTHYOX3E.js +2 -0
  289. package/dist/design-remote-2BEGCVCX.js +3 -0
  290. package/dist/device-env-CHFRRV6W.js +2 -0
  291. package/dist/dispatch-DVQ3H7EJ.js +2 -0
  292. package/dist/doctor-XY26Z35T.js +2 -0
  293. package/dist/docx-convert-6IZO5P5K.js +2 -0
  294. package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
  295. package/dist/evidence-P6FFKC7B.js +2 -0
  296. package/dist/evidence-presentation-YYTIDCBS.js +2 -0
  297. package/dist/evolve-cmd-WWOB3QJR.js +2 -0
  298. package/dist/evolve-remote-WLVY3QID.js +2 -0
  299. package/dist/{exit-manager-ZLDO54S4.js → exit-manager-EDHCETUN.js} +1 -1
  300. package/dist/explain-DGJ5T6V5.js +2 -0
  301. package/dist/explain-cmd-OP5I5W3O.js +12 -0
  302. package/dist/explain-cmd-VYAANFFZ.js +4 -0
  303. package/dist/explore-K5YBGHK6.js +2 -0
  304. package/dist/explore-context-tty-RZ7D2TBV.js +2 -0
  305. package/dist/explore-entry-EKXJ67BD.js +6 -0
  306. package/dist/explore-live-2YVRAQZO.js +5 -0
  307. package/dist/explore-run-tty-D47FGPX7.js +5 -0
  308. package/dist/extract-bind-W2NET364.js +14 -0
  309. package/dist/extract-chat-M65NWGUK.js +2 -0
  310. package/dist/extract-cmd-FTFLETOP.js +6 -0
  311. package/dist/extract-headless-G6W6JQ27.js +2 -0
  312. package/dist/feeder-NY45UFJK.js +2 -0
  313. package/dist/folder-flags-KKIH654K.js +2 -0
  314. package/dist/gaps-cmd-OIDDLRYL.js +3 -0
  315. package/dist/gate-7AKRPRMK.js +2 -0
  316. package/dist/gate-WISOUTHQ.js +2 -0
  317. package/dist/{generate-headless-6WMJYNI6.js → generate-headless-RURIEKVS.js} +3 -3
  318. package/dist/headless-io-FFM5T6KL.js +2 -0
  319. package/dist/hold-passthrough-IOWPVB4W.js +2 -0
  320. package/dist/identity-HL5CJJXR.js +2 -0
  321. package/dist/index.js +178 -160
  322. package/dist/ingest-PDGS5ZTL.js +2 -0
  323. package/dist/ingest-cmd-4G2AK4Y2.js +8 -0
  324. package/dist/ingest-remote-SSLUHQVG.js +2 -0
  325. package/dist/ink-screen-RZ7QDIUI.js +2 -0
  326. package/dist/install-ZVBHPXGP.js +2 -0
  327. package/dist/interactive-bind-SI2ZS55Q.js +26 -0
  328. package/dist/interactive-remote-J56EWJGA.js +65 -0
  329. package/dist/interrupt-guard-QETBPINI.js +2 -0
  330. package/dist/lane-AQYRIW24.js +2 -0
  331. package/dist/lattice-auth-6FEVSR7E.js +2 -0
  332. package/dist/lifecycle-cmd-HJ37LTXE.js +2 -0
  333. package/dist/list-cmd-6XL2FYLQ.js +3 -0
  334. package/dist/list-commands-5DCCKU3L.js +2 -0
  335. package/dist/list-remote-LXPQNXYN.js +15 -0
  336. package/dist/locks-cmd-JJ2QNTNY.js +2 -0
  337. package/dist/logical-ids-RXAQJZ3T.js +2 -0
  338. package/dist/login-flow-WEK3E476.js +2 -0
  339. package/dist/maintenance-cmd-BXXHP36K.js +2 -0
  340. package/dist/mobile-prompts-CECJ5UY2.js +2 -0
  341. package/dist/{next-KZXH4UA4.js → next-O6SUSX3R.js} +1 -1
  342. package/dist/{objective-variable-gate-CG2KK5UX.js → objective-variable-gate-3Z7DNVVC.js} +1 -1
  343. package/dist/onboarding-PDVYMTY5.js +5 -0
  344. package/dist/open-provider-OZAG6WZS.js +2 -0
  345. package/dist/{paths-JCYX6UWL.js → paths-UMIX3RJF.js} +1 -1
  346. package/dist/pdf-convert-447ACUB3.js +2 -0
  347. package/dist/persist-recorded-session-A3ID7JFA.js +3 -0
  348. package/dist/phase-seed-LCJ4WSYV.js +2 -0
  349. package/dist/pipeline-GX3LKPI5.js +2 -0
  350. package/dist/prepare-target-FMT6QFHZ.js +2 -0
  351. package/dist/pull-cmd-UPFQYUND.js +2 -0
  352. package/dist/pull-route-FWBXJMR7.js +2 -0
  353. package/dist/readmodel-INMP6MNW.js +2 -0
  354. package/dist/real-device-run-X7JJWOIK.js +2 -0
  355. package/dist/reconcile-cmd-JBH365JL.js +5 -0
  356. package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
  357. package/dist/reconcile-remote-BCX6SWFC.js +13 -0
  358. package/dist/recording-banner-YKBAL6UB.js +2 -0
  359. package/dist/registry-VQC757MJ.js +2 -0
  360. package/dist/remote-entry-X6JMPC2K.js +2 -0
  361. package/dist/remote-mode-FDPA7EWG.js +4 -0
  362. package/dist/remote-words-YVB66R3F.js +2 -0
  363. package/dist/require-project-folder-MLMEQJYP.js +2 -0
  364. package/dist/resolve-run-intent-PC7TQZUL.js +2 -0
  365. package/dist/resolver-EID34LQE.js +2 -0
  366. package/dist/revert-FHOBLZWF.js +2 -0
  367. package/dist/review-cmd-EUHFLFMY.js +5 -0
  368. package/dist/run-5RQUCNYP.js +2 -0
  369. package/dist/run-PC5YO4AS.js +2 -0
  370. package/dist/run-channel-63SVP5OI.js +2 -0
  371. package/dist/run-remote-SJCRTL7O.js +2 -0
  372. package/dist/run-startup-gate-YO66G6LS.js +2 -0
  373. package/dist/run-test-md-BLNBK4MH.js +17 -0
  374. package/dist/scrollback-GGNBDFQV.js +2 -0
  375. package/dist/session-target-DD53UXO7.js +2 -0
  376. package/dist/session-worker.js +12 -0
  377. package/dist/sessions-CFV7FOIT.js +2 -0
  378. package/dist/sessions-cmd-S7WZBUCN.js +26 -0
  379. package/dist/sessions-remote-IWHWIQ2T.js +3 -0
  380. package/dist/shell-arg-FN3MT5U7.js +2 -0
  381. package/dist/{skill-installer-32YYMM4N.js → skill-installer-MAVQY6GW.js} +1 -1
  382. package/dist/spawner-C7NLLM4F.js +2 -0
  383. package/dist/store-MSA7KASS.js +2 -0
  384. package/dist/store-choice-3OJCV26J.js +2 -0
  385. package/dist/store-guard-OOSDLMEC.js +2 -0
  386. package/dist/store-id-YZ5WKJ25.js +2 -0
  387. package/dist/store-site-KA2DNBGY.js +2 -0
  388. package/dist/stream-warnings-GEQKKJU7.js +2 -0
  389. package/dist/structured-answers-EQ2AP3F7.js +2 -0
  390. package/dist/sync-cmd-RDFDMVKQ.js +2 -0
  391. package/dist/sync-setup-RBRDUV7Q.js +2 -0
  392. package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
  393. package/dist/tcg-generate-KIECTZ2C.js +2 -0
  394. package/dist/test-definition-VRI4YIYL.js +2 -0
  395. package/dist/testmd-actions-CMAG6HWI.js +2 -0
  396. package/dist/testmd-sync-UPAA5UMD.js +2 -0
  397. package/dist/tms-client-NXAB6VJD.js +2 -0
  398. package/dist/token-refresh-KP3AYMYK.js +2 -0
  399. package/dist/trust-gate-AT2XBWN4.js +2 -0
  400. package/dist/turn-preflight-LHYLRL7G.js +2 -0
  401. package/dist/ui-SNV3FD2G.js +4 -0
  402. package/dist/use-case-ref-NE4X4MZN.js +2 -0
  403. package/dist/validate-basic-M5JHHNZA.js +2 -0
  404. package/dist/{variable-receipt-YWNS24TH.js → variable-receipt-BXSZO36E.js} +1 -1
  405. package/dist/verdicts-XK3GAUX3.js +2 -0
  406. package/dist/version-check-Q737BE65.js +2 -0
  407. package/dist/{view-cmd-3WHG6MVB.js → view-cmd-XSNL5DGI.js} +4 -3
  408. package/dist/walk-session-SHGYLFRB.js +2 -0
  409. package/dist/with-telemetry-PM2HVN2B.js +2 -0
  410. package/package.json +11 -11
  411. package/dist/ChatSurface-FJPK3XEJ.js +0 -8
  412. package/dist/ChromeProfilePicker-7DUDJTE2.js +0 -2
  413. package/dist/CliFeedbackPrompt-ZZPYC6OS.js +0 -2
  414. package/dist/CliUploadProgress-WQYKIBAR.js +0 -2
  415. package/dist/ConfigView-KXNOODDW.js +0 -2
  416. package/dist/EvidenceViewOffer-BTBVPBZX.js +0 -2
  417. package/dist/FolderPicker-H4YEX5LV.js +0 -2
  418. package/dist/InfoBox-DTM7X24Z.js +0 -2
  419. package/dist/LinksBox-KFG3FVOT.js +0 -2
  420. package/dist/ProfilesView-KBZHT4KL.js +0 -2
  421. package/dist/ProjectPicker-OARWULNN.js +0 -2
  422. package/dist/SaveSessionPrompt-37SMU5MC.js +0 -2
  423. package/dist/ScrollbackTap-QHJOFYMC.js +0 -2
  424. package/dist/SingleShotApp-UYCAW65Y.js +0 -2
  425. package/dist/SummaryBox-6RB5DSAH.js +0 -2
  426. package/dist/TestMdRunView-ZMOII3PL.js +0 -2
  427. package/dist/TestrunEvidenceTable-3UP2EYIV.js +0 -2
  428. package/dist/WhoamiView-MC62GERR.js +0 -2
  429. package/dist/app-client-PQFJAB63.js +0 -2
  430. package/dist/app-download-P6YXWSVQ.js +0 -2
  431. package/dist/auth-LXW4OFKF.js +0 -2
  432. package/dist/bind-ZYESQSCJ.js +0 -15
  433. package/dist/bootstrap-DI4UGMH3.js +0 -2
  434. package/dist/bridge-7J3JE3JS.js +0 -2
  435. package/dist/build-JIKYOZUH.js +0 -2
  436. package/dist/catalog-LLME3744.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-243ZJHT6.js +0 -4
  440. package/dist/chunk-2KVECC36.js +0 -2
  441. package/dist/chunk-2YEHV2CX.js +0 -2
  442. package/dist/chunk-3MCPTVJX.js +0 -2
  443. package/dist/chunk-3UI5VTQS.js +0 -4
  444. package/dist/chunk-3VAU3PNU.js +0 -2
  445. package/dist/chunk-3YIZG7WZ.js +0 -3
  446. package/dist/chunk-4Y2WH77W.js +0 -2
  447. package/dist/chunk-5EOX4MEY.js +0 -2
  448. package/dist/chunk-5HMN74RZ.js +0 -9
  449. package/dist/chunk-5LJRZI7S.js +0 -6
  450. package/dist/chunk-5RCS2LIQ.js +0 -26
  451. package/dist/chunk-5TQFOPJV.js +0 -2
  452. package/dist/chunk-5ZFOKYFB.js +0 -5
  453. package/dist/chunk-63DYVWNX.js +0 -2
  454. package/dist/chunk-6MD7SR7D.js +0 -9
  455. package/dist/chunk-7N6OCHPC.js +0 -7
  456. package/dist/chunk-A2SQD2AY.js +0 -4
  457. package/dist/chunk-AACQE24F.js +0 -2
  458. package/dist/chunk-AHFIRHSP.js +0 -18
  459. package/dist/chunk-AJT34ESA.js +0 -38
  460. package/dist/chunk-AUMJ4RVA.js +0 -21
  461. package/dist/chunk-AXTPNZPX.js +0 -2
  462. package/dist/chunk-BB2W35TW.js +0 -2
  463. package/dist/chunk-BKM2LWU2.js +0 -3
  464. package/dist/chunk-BUPRL2TE.js +0 -2
  465. package/dist/chunk-C44QQJR4.js +0 -239
  466. package/dist/chunk-CW3RHKLA.js +0 -5
  467. package/dist/chunk-D6E6KRVX.js +0 -2
  468. package/dist/chunk-DTRKTBCE.js +0 -17
  469. package/dist/chunk-DTRSYWZE.js +0 -2
  470. package/dist/chunk-EVFFDODK.js +0 -5
  471. package/dist/chunk-F2OBORCG.js +0 -2
  472. package/dist/chunk-FQNQVC5O.js +0 -5
  473. package/dist/chunk-FY7TCYPK.js +0 -6
  474. package/dist/chunk-GTVQYT3D.js +0 -35
  475. package/dist/chunk-HG5LLZBU.js +0 -2
  476. package/dist/chunk-I7TIGB7K.js +0 -2
  477. package/dist/chunk-IICT4VOU.js +0 -2
  478. package/dist/chunk-ILDHE4P4.js +0 -6
  479. package/dist/chunk-IPXKUYUK.js +0 -2
  480. package/dist/chunk-JQY5HRZ4.js +0 -15
  481. package/dist/chunk-JX6BFEDO.js +0 -4
  482. package/dist/chunk-K2UJYY2U.js +0 -2
  483. package/dist/chunk-KBM3XHAM.js +0 -2
  484. package/dist/chunk-KDNNMU7Q.js +0 -4
  485. package/dist/chunk-KJQNAOOE.js +0 -6
  486. package/dist/chunk-LH4IPANP.js +0 -2
  487. package/dist/chunk-LLG7NEGX.js +0 -6
  488. package/dist/chunk-LSDWPG6C.js +0 -2
  489. package/dist/chunk-MSGW4JDG.js +0 -2
  490. package/dist/chunk-NJ4BXZBX.js +0 -2
  491. package/dist/chunk-NLCCBXXV.js +0 -2
  492. package/dist/chunk-NMSZ7G6P.js +0 -2
  493. package/dist/chunk-OC6H6BYI.js +0 -6
  494. package/dist/chunk-OJAXOOZ5.js +0 -8
  495. package/dist/chunk-OMNLAGQC.js +0 -29
  496. package/dist/chunk-OOCCUUR2.js +0 -2
  497. package/dist/chunk-OXC6O5O7.js +0 -2
  498. package/dist/chunk-OZQDD2EX.js +0 -94
  499. package/dist/chunk-PEDINHVU.js +0 -2
  500. package/dist/chunk-PNUAP3RY.js +0 -8
  501. package/dist/chunk-Q2F5QB2W.js +0 -2
  502. package/dist/chunk-Q4YYAN6E.js +0 -2
  503. package/dist/chunk-Q6AHSGOE.js +0 -5
  504. package/dist/chunk-QAB3Y5FQ.js +0 -4
  505. package/dist/chunk-RDHWNSDP.js +0 -7
  506. package/dist/chunk-RKXHVP2Z.js +0 -2
  507. package/dist/chunk-RRY5IXOB.js +0 -2
  508. package/dist/chunk-RSSOJ3L2.js +0 -21
  509. package/dist/chunk-RTSBKCZY.js +0 -16
  510. package/dist/chunk-SID4X77D.js +0 -370
  511. package/dist/chunk-SRTKRHYI.js +0 -12
  512. package/dist/chunk-T2ONUKTL.js +0 -5
  513. package/dist/chunk-U6OTFMIT.js +0 -4
  514. package/dist/chunk-UD7KKHPW.js +0 -5
  515. package/dist/chunk-USOYXCZ4.js +0 -2
  516. package/dist/chunk-USY7VAO6.js +0 -2
  517. package/dist/chunk-V4B5QA3U.js +0 -4
  518. package/dist/chunk-VBS33P2C.js +0 -2
  519. package/dist/chunk-VHW7BMZQ.js +0 -2
  520. package/dist/chunk-VIO7CCFW.js +0 -5
  521. package/dist/chunk-VORWZLS3.js +0 -9
  522. package/dist/chunk-VVOKM2VO.js +0 -2
  523. package/dist/chunk-W5TTF7GB.js +0 -6
  524. package/dist/chunk-WESMQEPO.js +0 -2
  525. package/dist/chunk-WMI4P76K.js +0 -27
  526. package/dist/chunk-WNOC6MQC.js +0 -2
  527. package/dist/chunk-WVHMPIDQ.js +0 -2
  528. package/dist/chunk-XBX643ZD.js +0 -2
  529. package/dist/chunk-XKHWWKJZ.js +0 -3
  530. package/dist/chunk-XLSOQLVT.js +0 -2
  531. package/dist/chunk-Y3ZYN6AK.js +0 -4
  532. package/dist/chunk-YCCUBQY4.js +0 -2
  533. package/dist/chunk-YKTYVJBN.js +0 -3
  534. package/dist/chunk-YLQHY4A7.js +0 -2
  535. package/dist/chunk-Z7IGTVJW.js +0 -2
  536. package/dist/chunk-ZC2CKWLB.js +0 -2
  537. package/dist/chunk-ZER3FZSZ.js +0 -22
  538. package/dist/chunk-ZJYT72BA.js +0 -9
  539. package/dist/chunk-ZKSN2SJ7.js +0 -2
  540. package/dist/chunk-ZLWURCJ7.js +0 -2
  541. package/dist/committer-2QPBANRD.js +0 -2
  542. package/dist/config-YGTHSGQN.js +0 -2
  543. package/dist/controller-client-ZF5IXRUV.js +0 -2
  544. package/dist/cover-cmd-6RO366CC.js +0 -3
  545. package/dist/descriptor-3JJUOHBM.js +0 -2
  546. package/dist/design-committer-D44GSUXY.js +0 -2
  547. package/dist/device-env-DXDJJMTL.js +0 -2
  548. package/dist/dispatch-7EWWQRQ5.js +0 -2
  549. package/dist/doctor-TPYPEEUL.js +0 -2
  550. package/dist/docx-convert-SQRTF7XS.js +0 -2
  551. package/dist/evidence-NPFTBGDF.js +0 -2
  552. package/dist/evidence-presentation-XF23B7F2.js +0 -2
  553. package/dist/evolve-cmd-VGVXV6XW.js +0 -2
  554. package/dist/explain-NEFBUX5G.js +0 -2
  555. package/dist/explain-cmd-GOP5TE63.js +0 -9
  556. package/dist/explain-cmd-M7IX2YNB.js +0 -3
  557. package/dist/extract-bind-CKIRLXAJ.js +0 -14
  558. package/dist/extract-cmd-3EWLSPGS.js +0 -5
  559. package/dist/feeder-66TUPB2R.js +0 -2
  560. package/dist/gaps-cmd-WVC5GXQC.js +0 -3
  561. package/dist/gate-OYRDJMF6.js +0 -2
  562. package/dist/headless-io-75HUMWZB.js +0 -2
  563. package/dist/identity-ADZ4PAJF.js +0 -2
  564. package/dist/ingest-OSNNM3DH.js +0 -2
  565. package/dist/ingest-cmd-AECK5T4H.js +0 -2
  566. package/dist/install-ZV3KJZV4.js +0 -2
  567. package/dist/interactive-bind-IYS6KDOH.js +0 -26
  568. package/dist/interrupt-guard-UREUWNRL.js +0 -2
  569. package/dist/lifecycle-cmd-XCSBELFQ.js +0 -2
  570. package/dist/list-cmd-S4DSN2ET.js +0 -3
  571. package/dist/list-commands-GLNGHPDU.js +0 -2
  572. package/dist/locks-cmd-67OHQZNV.js +0 -2
  573. package/dist/logical-ids-GLVM2SVR.js +0 -2
  574. package/dist/login-flow-ASUUU7SO.js +0 -2
  575. package/dist/maintenance-cmd-K5KXRIFL.js +0 -2
  576. package/dist/mobile-prompts-ZUZTA3RV.js +0 -2
  577. package/dist/open-provider-YIBB77FE.js +0 -2
  578. package/dist/pdf-convert-RLXSXFWN.js +0 -2
  579. package/dist/persist-recorded-session-EWV56TSZ.js +0 -3
  580. package/dist/phase-seed-MKHEWUN6.js +0 -2
  581. package/dist/pipeline-LAWACB2O.js +0 -2
  582. package/dist/prepare-target-WGPCZKLE.js +0 -2
  583. package/dist/readmodel-FVLRQWZ7.js +0 -2
  584. package/dist/real-device-run-MDLFKFVQ.js +0 -2
  585. package/dist/reconcile-cmd-XFM2ZXUJ.js +0 -2
  586. package/dist/reconcile-deps-V5VLDPYT.js +0 -4
  587. package/dist/reconcile-engine-VZBTMPUK.js +0 -2
  588. package/dist/recording-banner-CJHRPHHF.js +0 -2
  589. package/dist/records-LMCVKPE5.js +0 -2
  590. package/dist/registry-3JXQFZEG.js +0 -2
  591. package/dist/require-project-folder-SE5GVCYJ.js +0 -2
  592. package/dist/resolve-run-intent-DD4MB6UD.js +0 -2
  593. package/dist/resolver-TLO4SRWV.js +0 -2
  594. package/dist/revert-NOUECRW4.js +0 -2
  595. package/dist/review-cmd-7EOYQMPE.js +0 -5
  596. package/dist/run-EHUNJPW6.js +0 -2
  597. package/dist/run-OTMPUQSH.js +0 -2
  598. package/dist/run-channel-RGH4WIQX.js +0 -2
  599. package/dist/run-test-md-KBDEHGXJ.js +0 -17
  600. package/dist/scrollback-JLPJR25X.js +0 -2
  601. package/dist/session-items-2ATN7VXG.js +0 -2
  602. package/dist/session-target-UMNASXI7.js +0 -2
  603. package/dist/sessions-NH7WQWMX.js +0 -2
  604. package/dist/sessions-cmd-M3SECFKQ.js +0 -25
  605. package/dist/spawner-DPT2RLAO.js +0 -2
  606. package/dist/store-guard-U32JE6JJ.js +0 -2
  607. package/dist/store-id-EOSGEKVK.js +0 -2
  608. package/dist/structured-answers-ZI2B6JJE.js +0 -2
  609. package/dist/sync-cmd-3EP7LZGL.js +0 -2
  610. package/dist/sync-setup-SWTBVQEV.js +0 -2
  611. package/dist/tcg-generate-KXU7E2GF.js +0 -2
  612. package/dist/testmd-actions-PEWCPQ5R.js +0 -2
  613. package/dist/testmd-sync-ZWFQWZ2X.js +0 -2
  614. package/dist/tms-client-KU6HCA23.js +0 -2
  615. package/dist/token-refresh-QD3OCGJJ.js +0 -2
  616. package/dist/trust-gate-EX7R2P4Y.js +0 -2
  617. package/dist/turn-preflight-JGYT7LXP.js +0 -2
  618. package/dist/ui-JEJGTURD.js +0 -4
  619. package/dist/validate-basic-AAIXSAWH.js +0 -2
  620. package/dist/verdicts-LAB5BGCC.js +0 -2
  621. package/dist/version-check-EHOLX3YH.js +0 -2
  622. package/dist/walk-session-XP4KYFKO.js +0 -2
  623. package/dist/with-telemetry-FJMJQDCM.js +0 -2
  624. /package/dist/{chunk-BKHXPBWN.js → chunk-2RUSXQ3O.js} +0 -0
  625. /package/dist/{chunk-6J5T5FEY.js → chunk-3AGP2BVN.js} +0 -0
  626. /package/dist/{chunk-CH273NAE.js → chunk-73Y6T2UK.js} +0 -0
  627. /package/dist/{chunk-ZMNJBUAO.js → chunk-73ZFOJOK.js} +0 -0
  628. /package/dist/{chunk-NOL7MNZH.js → chunk-A7RJQJNT.js} +0 -0
  629. /package/dist/{chunk-N2P4MI32.js → chunk-FWGUISUG.js} +0 -0
  630. /package/dist/{chunk-UJZZDPDY.js → chunk-HD6NR44L.js} +0 -0
  631. /package/dist/{chunk-LDPLJFCV.js → chunk-I6S6DZ2E.js} +0 -0
  632. /package/dist/{chunk-427OQS2N.js → chunk-LD5B3QFW.js} +0 -0
  633. /package/dist/{chunk-2UIHS2FH.js → chunk-PGESS7BW.js} +0 -0
  634. /package/dist/{chunk-BZAGVBCX.js → chunk-ZCIWQHCO.js} +0 -0
@@ -1,21 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as m}from"./chunk-5EOX4MEY.js";import{a as O}from"./chunk-RZ4F3BHX.js";var C={ASR_CMD_START:"info",ASR_CMD_END:"info",ASR_AGENT_SPAWN:"info",ASR_WORK_ITEM_START:"info",ASR_WORK_ITEM_END:"info",ASR_PROPOSAL:"info",ASR_VALIDATE_FAILED:"warn",ASR_COMMIT:"info",ASR_SESSION_PAUSED:"info",ASR_SESSION_RESUMED:"info",ASR_SESSION_COMPLETE:"info",ASR_AGENT_EXIT:"warn",ASR_RECONCILE_PLAN:"info",ASR_RECONCILE_ROW_END:"info",ASR_HIGH_RISK_CI:"warn",ASR_INGEST:"info",ASR_EMBED_DEGRADED:"warn",ASR_CONTEXT_CLONED:"warn",ASR_ERROR:"error",ASR_CRASH:"error",ASR_FSCK_REPORT:"warn"},L={ASR_CMD_START:["source_count","resumed","applied_plan"],ASR_CMD_END:["exit_code","duration_ms","credits_total","work_items_total","work_items_failed"],ASR_AGENT_SPAWN:["tier","duration_ms"],ASR_WORK_ITEM_START:["work_item_index","work_item_count","source_kind"],ASR_WORK_ITEM_END:["work_item_index","work_item_count","outcome","duration_ms","error_domain","error_code"],ASR_PROPOSAL:["item_count","turn_index"],ASR_VALIDATE_FAILED:["error_code","count","turn_index"],ASR_COMMIT:["trusted","derived","archived","items","items_dropped","record_seq"],ASR_SESSION_PAUSED:["pending_questions","pending_proposals"],ASR_SESSION_RESUMED:["resume_count","expired_session_id"],ASR_SESSION_COMPLETE:["duration_ms","credits_total"],ASR_AGENT_EXIT:["exit_code","signal"],ASR_RECONCILE_PLAN:["row_count","add_count","modify_count","archive_count"],ASR_RECONCILE_ROW_END:["row_index","kind","outcome","duration_ms"],ASR_HIGH_RISK_CI:["count"],ASR_INGEST:["work_item_index","work_item_count","format","bytes","media_facts"],ASR_EMBED_DEGRADED:["held"],ASR_CONTEXT_CLONED:[],ASR_ERROR:["error_domain","error_code","exit_code","turn_index"],ASR_CRASH:["error_domain","error_code","error_name"],ASR_FSCK_REPORT:["issue_count","records","pending","codes","issues","issues_truncated"]},$=[[/^(auth_expired|401|preflight_auth|AUTH)/i,"auth"],[/^(credit_denied|402|CREDIT)/i,"credit"],[/^(stream_drop|read_timeout|connect_failed|dns|E(CONN|AI_AGAIN|TIMEDOUT)|network)/i,"network"],[/^(frame_parse|post_terminal_data|eof_without_terminal|turn_id_mismatch|binding_mismatch|schema_invalid|frame_too_large|protocol)/i,"protocol"],[/^(provider_error|http_5\d\d|turn_exhausted|adapter_integrity)/i,"provider"],[/^(STALE_BASIS|R\d+|validation|criteria)/i,"validation"],[/^(CHAIN_ERROR|DERIVED_(MISSING|DRIFT)|NODE_FILE_(MISSING|MISMATCH|CORRUPT)|CARDINALITY_VIOLATION|SUPERSEDE_(UNKNOWN_(OLD|NEW|ECID)|CYCLE)|DOUBLE_SUPERSEDE|NAME_UNKNOWN_TARGET|EDGE_CYCLE|UNKNOWN_(LABEL|FIELD|EDGE_TYPE|EDGE_PROP)|BAD_(CHECK|ENUM)|MISSING_(FIELD|SALIENT)|ILLEGAL_EDGE)$/,"graph"],[/^(BLOB_MISSING|SOURCE_UNKNOWN|SESSION_(LOCKED|EXPIRED|MISSING|LOCK_LOST)|NO_STORE|fsck|store)/i,"store"],[/^(usage|EX2|SOURCE_WITH_RESUME|HIGH_RISK_CI|bad_flag|no_tty)/i,"usage"],[/^exit_\d+_unattributed$/,"unattributed"],[/^agent_(crash|exit)/i,"agent_crash"]];function v(e){let t=(e||"unknown").slice(0,64);for(let[n,r]of $)if(n.test(t))return{error_domain:r,error_code:t};return{error_domain:"cli_crash",error_code:t}}import{randomBytes as w}from"crypto";var b=/^(uc|sc|ac|t|gap|sty)-\d+$/,P="0123456789abcdefghijklmnopqrstuvwxyz";function F(e){let t="",n=w(e);for(let r=0;r<e;r++)t+=P[n[r]%36];return t}function ne(e=new Date){let t=(r,o)=>String(r).padStart(o,"0");return`as-${`${e.getUTCFullYear()}${t(e.getUTCMonth()+1,2)}${t(e.getUTCDate(),2)}T${t(e.getUTCHours(),2)}${t(e.getUTCMinutes(),2)}`}-${F(8)}`}var M=-1,p=0;function re(e=new Date){let t=e.getTime(),n=w(10);t===M?p=p+1&4095:(M=t,p=(n[0]<<8|n[1])&4095);let r=Buffer.alloc(16);r.writeUIntBE(t,0,6),r[6]=112|p>>8,r[7]=p&255,r[8]=128|n[2]&63,n.copy(r,9,3,10);let o=r.toString("hex");return`${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20)}`}var G=64,U=128,K=/^[A-Za-z0-9._:@\/-]+$/,W={codes:512},B={ASR_FSCK_REPORT:["issues"]},H=20480,j=0;function X(e,t){if(typeof t=="number"&&Number.isFinite(t)||typeof t=="boolean")return t;if(typeof t!="string")return;let n=e.endsWith("_id")||e==="signal"?U:W[e]??G;if(!(t.length===0||t.length>n)&&K.test(t))return t}function k(e,t,n={}){let r=L[t],o={};for(let s of r){let i=n[s];if(i==null)continue;if(B[t]?.includes(s)){if(typeof i!="string"||i.length===0)continue;let _=i.replace(/[\u0000-\u001F\u007F]/g,"");if(Buffer.byteLength(_,"utf8")>H)continue;o[s]=_;continue}if(s==="items"){let _=Array.isArray(i)?i.filter(f=>typeof f=="string"):[],u=_.filter(f=>b.test(f));u.length>0&&(o.items=u.slice(0,50).join(","));let S=_.length-u.length;S>0&&(o.items_dropped=S);continue}let a=X(s,i);a!==void 0&&(o[s]=a)}if(typeof n.error_code=="string"&&r.includes("error_code")){let{error_domain:s,error_code:i}=v(n.error_code);o.error_code=i,r.includes("error_domain")&&(o.error_domain=s)}return{level:C[t],event:t,message:t,session_id:e.session_id,operation_id:e.operation_id,...e.parent_operation_id?{parent_operation_id:e.parent_operation_id}:{},...e.agent_session_id?{agent_session_id:e.agent_session_id}:{},context_lineage_id:e.context_lineage_id??null,context_instance_id:e.context_instance_id??null,verb:e.verb,mode:e.mode,component:"kane-cli",seq:j++,event_time:new Date().toISOString(),context:o}}import c from"fs";import A from"path";var V=500,q=7,z=512*1024,Y=15*6e4;function y(e){if(e.length!==0)try{let t=m();c.mkdirSync(A.dirname(t),{recursive:!0});let n=e.map(o=>JSON.stringify(o)).join(`
3
- `)+`
4
- `;c.appendFileSync(t,n,{flag:"a",mode:384});let r=0;try{r=c.statSync(t).size}catch{r=0}r>z&&Q()}catch{}}function J(e){try{let t=A.dirname(e),n=A.basename(e);for(let r of c.readdirSync(t)){if(!r.startsWith(`${n}.claim-`)&&!r.startsWith(`${n}.prune-`))continue;let o=A.join(t,r),s=Number(r.slice(r.lastIndexOf("-")+1));if(s===process.pid)continue;let i=!1;if(Number.isFinite(s)&&s>0)try{process.kill(s,0),i=!0}catch{i=!1}let a=!i;if(i)try{a=Date.now()-c.statSync(o).mtimeMs>Y}catch{a=!1}if(a)try{let _=c.readFileSync(o,"utf8");_.trim()&&c.appendFileSync(e,_.endsWith(`
5
- `)?_:_+`
6
- `,{flag:"a",mode:384}),c.unlinkSync(o)}catch{}}}catch{}}function ue(e){Z(async t=>{try{return(await O(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok}catch{return!1}}).catch(()=>{})}async function Z(e){let t=m();J(t);let n=`${t}.claim-${process.pid}`,r;try{c.renameSync(t,n),r=c.readFileSync(n,"utf8")}catch{return}let o=[];for(let s of r.split(`
7
- `))if(s.trim())try{o.push(JSON.parse(s))}catch{}try{(o.length===0?!0:await e(o))?c.unlinkSync(n):(c.appendFileSync(t,r,{flag:"a",mode:384}),c.unlinkSync(n))}catch{try{c.appendFileSync(t,r,{flag:"a",mode:384}),c.unlinkSync(n)}catch{}}}function Q(e=V,t=q){try{let n=m(),r=`${n}.prune-${process.pid}`;c.renameSync(n,r);let s=c.readFileSync(r,"utf8").split(`
8
- `).filter(u=>u.trim()),i=Date.now()-t*24*3600*1e3,_=s.filter(u=>{try{let S=JSON.parse(u),f=Date.parse(S.event_time??S.timestamp??"");return Number.isNaN(f)||f>=i}catch{return!1}}).slice(-e);_.length>0&&c.appendFileSync(n,_.join(`
9
- `)+`
10
- `,{flag:"a",mode:384}),c.unlinkSync(r)}catch{}}var E=null;function pe(e){E=e}function Re(){return E}var D=()=>!!process.env.KANE_DEV_MODE,d=[],N=!1,h=null,g=null,T=null,l=null,R=[];function ge(e){if(l=e,e&&R.length>0){let t=R;R=[];for(let n of t)try{e.log(n.level,n.event,n.message,n.context)}catch{}}}function me(e,t,n,r){if(l){try{l.log(e,t,n,r)}catch{}return}R.push({level:e,event:t,message:n,context:r})}function Ae(){return l}function ye(){return N}function Ie(e,t){d=d.filter(n=>n.name!==e),d.push({name:e,fn:t})}function Ne(e){d=d.filter(t=>t.name!==e)}function Te(e,t){let n=d.find(o=>o.name===e);if(!n)return;d=d.filter(o=>o.name!==e);let r=!0;try{n.fn()}catch(o){r=!1,process.stderr.write(`[exit-manager] cleanup(${e}) failed: ${o instanceof Error?o.message:String(o)}
11
- `)}t&&r&&D()&&process.stderr.write(`[exit-manager] cleanup(${e}): ${t}
12
- `)}async function De(e=1e3){let t=l;if(!(!t?.stopAndFlushOnce||!t.drainBuffer))try{let n=await t.stopAndFlushOnce(e);if(n!=="sent"&&n!=="empty"){let r=t.drainBuffer();r.length>0&&y(r)}}catch{}}function I(e,t,n=!1,r){if(N){process.exit(h??e);return}if(N=!0,h=e,n&&l)try{l.log("error","CRASH",t);let i=l.drainBuffer?.()??[];i.length>0&&y(i),l.shutdownSync()}catch{}if(n&&E&&e!==130&&e!==143)try{let i=/Uncaught exception:\s*([A-Za-z0-9_$]+)/.exec(t)?.[1]??"crash";y([k(E,"ASR_CRASH",{error_code:"cli_crash",error_name:i})])}catch{}let o=[...d].reverse(),s=[];for(let i of o)try{i.fn(),s.push(i.name)}catch(a){process.stderr.write(`[exit-manager] cleanup(${i.name}) failed: ${a instanceof Error?a.message:String(a)}
13
- `)}if(d=[],D()&&(process.stderr.write(`[exit-manager] shutdown(${e}): ${t}
14
- `),s.length>0&&process.stderr.write(`[exit-manager] cleaned up: ${s.join(", ")}
15
- `)),n){if(T)try{T()}catch{}e===130||e===143||(process.stderr.write(`
16
- kane-cli crashed: ${t}
17
- `+(s.length>0?`Resources cleaned up (${s.join(", ")}).
18
- `:"")),E&&process.stderr.write(`session: ${E.session_id} \u2014 share this id with support
19
- `),r&&D()?process.stderr.write(`${r}
20
- `):process.stderr.write(`(re-run with KANE_DEV_MODE=1 for the full stack)
21
- `)),process.exit(e);return}if(g&&!n){g();return}process.exit(e)}function he(e){g=e}function xe(){g=null}function Oe(e){T=e}var x=!1;function Ce(){x||(x=!0,process.on("SIGINT",()=>{I(130,"Received SIGINT",!0)}),process.on("SIGTERM",()=>{I(143,"Received SIGTERM",!0)}),process.on("uncaughtException",e=>{I(1,`Uncaught exception: ${e.name}: ${e.message}`,!0,e.stack)}),process.on("unhandledRejection",e=>{I(1,`Unhandled rejection: ${String(e)}`,!0,e instanceof Error?e.stack:void 0)}))}function Le(){d=[],N=!1,h=null,g=null,T=null,l=null,R=[],x=!1,E=null}export{C as a,ne as b,re as c,k as d,y as e,ue as f,Z as g,pe as h,Re as i,ge as j,me as k,Ae as l,ye as m,Ie as n,Ne as o,Te as p,De as q,I as r,he as s,xe as t,Oe as u,Ce as v,Le as w};
@@ -1,16 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as ee,d as te,h as D,i as ne,j as re,k as U,l as ie,m as se,n as oe,o as R,p as ae,q as H,r as he,s as ge,t as _e}from"./chunk-OMNLAGQC.js";import{d as V}from"./chunk-HGFWIBVF.js";import{b as pe,c as fe,z as $}from"./chunk-IICT4VOU.js";import{H as M,M as T,P as le,X as O,c as de,m as L,u as ue,x as I,z as P}from"./chunk-RDHWNSDP.js";import{f as x,h as ce}from"./chunk-XLSOQLVT.js";import{a as me}from"./chunk-CH273NAE.js";import{appendFileSync as Ie,closeSync as Oe,existsSync as S,fsyncSync as Ce,openSync as Ne,readdirSync as je,readFileSync as k,renameSync as Fe,writeFileSync as J}from"fs";import{dirname as Q,isAbsolute as G,join as F,resolve as q}from"path";var Re=new Set(["inline","testmd","testrun"]),Le=new Set(["inferred","authored","runtime-derived"]),B=new Set(["passed","failed","broken","skipped"]);function ye(t,e,n){if(n.facts.length===0)return{record:null,errors:[{code:"EMPTY_EXECUTIONS",detail:"a run with no designed units attaches no facts \u2014 skip the call"}]};let o=e;for(let a=0;;a++){let c=M(t);if(o.latestHash!==c){if(a>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:`graph opened at ${String(o.latestHash)} but chain head is ${String(c)} \u2014 retry budget exhausted`}]};o=$(t);continue}let d=Te(t,o,n);if(d!=="cas")return d;if(a>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:"concurrent appends kept moving the head \u2014 retry budget exhausted"}]};o=$(t)}}function ve(t,e){return Re.has(t.mode)?B.has(t.verdict)?Le.has(t.oracle_mode)?typeof t.drift_flag!="boolean"||typeof t.stale_at_run!="boolean"?[{code:"MISSING_FIELD",detail:`${e}: drift_flag and stale_at_run are required booleans`}]:!t.execution_id||!t.started_at||!t.definition_id_at_run?[{code:"MISSING_FIELD",detail:`${e}: execution_id, started_at and definition_id_at_run are required`}]:[]:[{code:"BAD_ORACLE_MODE",detail:`${e}: oracle_mode '${t.oracle_mode}' not in inferred|authored|runtime-derived`}]:[{code:"BAD_VERDICT",detail:`${e}: verdict '${t.verdict}' not in ${[...B].join("|")}`}]:[{code:"BAD_MODE",detail:`${e}: mode '${t.mode}' not in inline|testmd|testrun`}]}function be(t,e,n,o){return{about:e,definition_id_at_run:t.definition_id_at_run,verdict:t.verdict,...n&&n.length?{per_ac:n}:{},drift_flag:t.drift_flag,oracle_mode:t.oracle_mode,stale_at_run:t.stale_at_run,...o.length?{unresolved_acs:o}:{},execution_id:t.execution_id,...t.evidence_id?{evidence_id:t.evidence_id}:{},...t.duration_ms!==void 0?{duration_ms:t.duration_ms}:{},started_at:t.started_at,mode:t.mode,local:t.local,...t.via_parent?{via_parent:t.via_parent}:{}}}function Ee(t,e,n={}){if(!Array.isArray(e.facts)||e.facts.length===0)return{record:null,errors:[{code:"EMPTY_EXECUTIONS",detail:"parked line carries no facts"}]};for(let o=0;;o++){let a=$(t),c=e.facts.filter(s=>a.appliedEvents.has(s.event_id)).map(s=>s.event_id),d=e.facts.filter(s=>!a.appliedEvents.has(s.event_id));if(d.length===0)return{record:null,errors:null,applied:[],skipped:c,rejected:[]};let l=[],i=[],g=[],m=[];for(let s of d){let r=`executions[${s.ref}]`,u=[];if(!s.about_cid||!a.hasNode(s.about_cid))u.push({code:"UNKNOWN_REF",detail:`${r}: about_cid '${String(s.about_cid)}' is not in the graph \u2014 the pinned run-time target is gone`});else if(a.nodeLabel.get(s.about_cid)!==x.TEST)u.push({code:"ILLEGAL_TARGET",detail:`${r}: execution facts attach to tests \u2014 '${s.about_cid}' is a ${a.nodeLabel.get(s.about_cid)}`});else if(!s.event_id)u.push({code:"MISSING_FIELD",detail:`${r}: parked facts require event_id`});else{u.push(...ve(s,r));for(let h of s.per_ac??[])B.has(h.verdict)||u.push({code:"BAD_VERDICT",detail:`${r}.per_ac['${h.ac_ref}']: verdict '${h.verdict}'`})}if(u.length>0){l.push({event_id:s.event_id??"",errors:u});continue}let p=[],f=[],_=[...s.unresolved_acs??[]];for(let h of s.per_ac??[]){let b=h.ac_cid&&a.hasNode(h.ac_cid)&&a.nodeLabel.get(h.ac_cid)===x.AC?h.ac_cid:null,y=b?null:a.resolve(h.ac_ref),E=b??(y?a.tipOf(y.cid):null);if(!E||!b&&(a.superseded.has(E)||a.nodeLabel.get(E)!==x.AC)){_.push(h.ac_ref);continue}p.push({ac_ref:a.nameOf.get(E)??h.ac_ref,ac_cid:E,verdict:h.verdict}),f.push(E)}i.push(be(s,s.about_cid,p,_)),m.push({about_cid:s.about_cid,per_ac:f}),g.push(s.event_id)}if(i.length===0)return{record:null,errors:null,applied:[],skipped:c,rejected:l};try{let s=T(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],executions:i,event_ids:[...g].sort(),source_head_moves:{}},{expectPrev:a.latestHash,intent:{v:1,verb:"parked",args:L({line:e}),pins:{facts:m}},busyRetry:{deadlineMs:5e3},provenance:n.provenance}),r;try{O(t)}catch(u){r=`parked facts committed, but the projection refresh failed (${u instanceof Error?u.message:String(u)}) \u2014 read state rebuilds on the next open`}return{record:s.record,errors:null,applied:g,skipped:c,rejected:l,...r?{warnings:[r]}:{}}}catch(s){if(!(s instanceof I))throw s;if(o>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:"concurrent appends kept moving the head \u2014 parked replay retry budget exhausted (line stays queued)"}]}}}}function Te(t,e,n){let o=[],a=[],c=[];for(let i of n.facts){let g=`executions[${i.ref}]`,m=n.pinned?null:e.resolve(i.ref),s=n.pinned?i.about_cid&&e.hasNode(i.about_cid)?i.about_cid:null:m?e.tipOf(m.cid):null;if(!s||!n.pinned&&e.superseded.has(s)){o.push({code:"UNKNOWN_REF",detail:`${g}: '${n.pinned?String(i.about_cid):i.ref}' is not a ${n.pinned?"":"live "}committed node`});continue}if(e.nodeLabel.get(s)!==x.TEST){o.push({code:"ILLEGAL_TARGET",detail:`${g}: execution facts attach to tests \u2014 '${i.ref}' is a ${e.nodeLabel.get(s)}`});continue}let r=ve(i,g);if(r.length>0){o.push(...r);continue}let u=[],p=[];for(let f of i.per_ac??[]){let _=n.pinned?null:e.resolve(f.ac_ref),h=n.pinned?f.ac_cid&&e.hasNode(f.ac_cid)?f.ac_cid:null:_?e.tipOf(_.cid):null;if(!h||!n.pinned&&e.superseded.has(h)||e.nodeLabel.get(h)!==x.AC){o.push({code:"UNKNOWN_REF",detail:`${g}.per_ac: '${n.pinned?String(f.ac_cid):f.ac_ref}' is not a${n.pinned?"n":" live"} AC`});continue}if(!B.has(f.verdict)){o.push({code:"BAD_VERDICT",detail:`${g}.per_ac['${f.ac_ref}']: verdict '${f.verdict}'`});continue}u.push({ac_ref:e.nameOf.get(h)??h,ac_cid:h,verdict:f.verdict}),p.push(h)}a.push(be(i,s,u,i.unresolved_acs??[])),c.push({about_cid:s,per_ac:p})}if(o.length>0)return{record:null,errors:o};let d;try{d=T(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],executions:a,...n.eventIds&&n.eventIds.length>0?{event_ids:n.eventIds}:{},source_head_moves:{}},{expectPrev:e.latestHash,intent:{v:1,verb:"execution",args:L({facts:n.facts,by:n.by,eventIds:n.eventIds??null}),pins:{facts:c}},busyRetry:{deadlineMs:n.lockDeadlineMs??5e3},provenance:n.provenance})}catch(i){if(i instanceof I)return"cas";throw i}let l;try{O(t)}catch(i){l=`facts committed, but the projection refresh failed (${i instanceof Error?i.message:String(i)}) \u2014 read state rebuilds on the next open`}return{record:d.record,errors:null,...l?{warnings:[l]}:{}}}function pt(t){let e={failed:3,broken:2,skipped:1,passed:0},n=new Map;for(let o of t)for(let a of o.verifies??[]){let c=n.get(a);(c===void 0||(e[o.status]??0)>(e[c]??0))&&n.set(a,o.status)}return[...n.entries()].map(([o,a])=>({ref:o,verdict:a}))}function ft(t){let e=[],n=me(t.cwd);if(!S(n))return{synced:0,superseded:0,skipped:"no-context",warnings:e};let o=t.by??{kind:"ai",id:"exec-sync"},a=t.lockDeadlineMs;try{Pe(n,e,a)}catch(r){e.push(`sync: parked-facts replay failed (${r instanceof Error?r.message:String(r)}) \u2014 queue intact, retrying next sync`)}let c=$(n),d=[],l=0,i=new Set,g=new Set(t.members.map(r=>G(r.path)?r.path:q(t.cwd,r.path))),m=new Map;for(let r of t.members){let u=G(r.path)?r.path:q(t.cwd,r.path);if(!S(u)){e.push(`sync: member file missing: ${u} \u2014 skipped, no fact attached`);continue}for(let p of Me(u,e))if(!i.has(p.path))try{let f=p.path===u,_=!f&&g.has(p.path),h=f?void 0:R(k(u,"utf8"))?.id,b=k(p.path,"utf8"),y=R(b);if(!y?.id){i.add(p.path);continue}let E=c.resolve(y.id),w=E?c.tipOf(E.cid):null;if(!E||!w||c.superseded.has(w)){i.add(p.path),e.push(`sync: ${y.id} does not resolve to a live test \u2014 skipped (foreign store?)`);continue}let C=D(U(b,se(Q(p.path),c))),Ae=String(c.getNode(w)?.content.test_md_blob??""),N=D(U(Ae,ie(c))),A=!1,j=w;if(C===N)y.base!==N&&xe(p.path,b,N,e);else if(y.base===N){let v=Ge(n,c,w,b,C,Q(p.path),o);v.error?(e.push(`sync: could not supersede ${y.id}: ${v.error}`),A=!0):(l++,j=v.newCid,A=v.oracleTier,xe(p.path,k(p.path,"utf8"),C,e),c=$(n))}else A=!0,e.push(y.base?`sync: ${y.id} was edited from an older version \u2014 graph kept; reconcile via a redesign or maintain`:`sync: ${y.id} carries no base pin (hand-copied file?) \u2014 fact attached with drift flag`);if(_){A&&m.set(p.path,!0);continue}i.add(p.path);let K=c.getNode(j)?.content.check,z=f?r.acs??[]:[],X=z.filter(v=>Se(c,v.ref)),Y=z.filter(v=>!Se(c,v.ref)).map(v=>v.ref);d.push({ref:y.id,about_cid:j,definition_id_at_run:C,verdict:r.verdict,...X.length?{per_ac:X.map(v=>{let Z=we(c,v.ref);return{ac_ref:v.ref,...Z?{ac_cid:Z}:{},verdict:v.verdict}})}:{},drift_flag:A||m.get(p.path)===!0||f&&r.driftFlag===!0,oracle_mode:K?.expected_mode??(ee(K?.operand)?"runtime-derived":"inferred"),stale_at_run:c.stale(j)!=="fresh",...Y.length?{unresolved_acs:Y}:{},execution_id:r.executionId,...r.evidenceId?{evidence_id:r.evidenceId}:{},...r.durationMs!==void 0?{duration_ms:r.durationMs}:{},started_at:r.startedAt,mode:r.mode,local:r.local,...h?{via_parent:h}:{}})}catch(f){p.path!==u&&g.has(p.path)||i.add(p.path),e.push(`sync: ${p.path} failed to sync (${f instanceof Error?f.message:String(f)}) \u2014 skipped; other members unaffected`)}}if(d.length===0)return{synced:0,superseded:l,warnings:e};let s;try{s=ye(n,$(n),{facts:d,by:o,eventIds:d.map(r=>`exec-fact:${r.execution_id}:${r.ref}`),lockDeadlineMs:a})}catch(r){return e.push(`sync facts: commit threw: ${r instanceof Error?r.message:String(r)}`),$e(n,d,o,e,a),{synced:0,superseded:l,warnings:e}}return s.errors?($e(n,d,o,e,a),e.push(...s.errors.map(r=>`sync facts: ${r.code}: ${r.detail}`)),{synced:0,superseded:l,warnings:e}):(s.warnings&&e.push(...s.warnings.map(r=>`sync facts: ${r}`)),{synced:d.length,superseded:l,warnings:e})}var W=".pending-facts.bad";function $e(t,e,n,o,a){try{let c={by:n,ts:new Date().toISOString(),facts:e.map(i=>({...i,about_cid:i.about_cid??"",event_id:`exec-fact:${i.execution_id}:${i.ref}`}))},d=null;try{d=P(t,{deadlineMs:a??5e3})}catch{d=null}let l=F(t,H);try{if(d)Ie(l,JSON.stringify(c)+`
3
- `);else{l=F(t,ge());let i=Ne(l,"wx");try{J(i,JSON.stringify(c)+`
4
- `),Ce(i)}finally{Oe(i)}le(t),o.push(`sync facts: store lock busy \u2014 parked to ${l}; it drains on the next sync`)}}finally{d?.()}o.push(`sync facts: commit failed \u2014 ${e.length} fact(s) parked to ${l}; they replay on the next sync`)}catch(c){o.push(`sync facts: could not park the failed batch (${c instanceof Error?c.message:String(c)}) \u2014 this run's facts are LOST`)}}function Pe(t,e,n){let o=F(t,H);if(!S(o)&&!je(t).some(m=>he.test(m)))return;let a=ue(t);if(a){e.push(`sync: parked facts stay queued while rebase ${a.id} is open \u2014 they drain on the first sync after it is finished`);return}let c;{let m=P(t,{deadlineMs:n??5e3});try{_e(t),c=S(o)?k(o,"utf8"):""}finally{m()}}let d=c.split(`
5
- `).filter(m=>m.trim()!=="");if(d.length===0)return;let l=new Set,i=[],g=[];for(let m of d){let s=null;try{let u=JSON.parse(m);u&&Array.isArray(u.facts)&&(s=u)}catch{}if(!s){i.push(m),l.add(m);continue}let r=Ee(t,s);if(r.errors){if(r.errors.some(u=>u.code==="STALE_BASIS")){e.push(`sync: parked facts replay deferred (${r.errors[0].detail}) \u2014 retrying next sync`);continue}i.push(m),l.add(m),e.push(`sync: parked facts line quarantined to ${F(t,W)} (${r.errors.map(u=>`${u.code}: ${u.detail}`).join("; ")})`);continue}for(let u of r.rejected){let p=s.facts.find(f=>f.event_id===u.event_id);g.push({parent:m,line:JSON.stringify({...p??{event_id:u.event_id},_reason:u.errors})})}r.rejected.length>0&&e.push(`sync: ${r.rejected.length} parked fact(s) quarantined to ${F(t,W)} (${r.rejected.map(u=>u.errors.map(p=>`${p.code}: ${p.detail}`).join("; ")).join(" | ")})`),l.add(m),r.warnings&&e.push(...r.warnings.map(u=>`sync: ${u}`)),r.applied.length>0&&e.push(`sync: replayed ${r.applied.length} parked fact(s) from a previous run`)}if(l.size!==0)try{let m=P(t,{deadlineMs:n??5e3});try{let r=(S(o)?k(o,"utf8"):"").split(`
6
- `).filter(_=>_.trim()!==""),u=[...i.filter(_=>r.includes(_)),...g.filter(_=>r.includes(_.parent)).map(_=>_.line)];u.length>0&&Ie(F(t,W),u.map(_=>_+`
7
- `).join(""));let p=r.filter(_=>!l.has(_)),f=`${o}.tmp.${process.pid}`;J(f,p.length>0?p.join(`
8
- `)+`
9
- `:""),Fe(f,o)}finally{m()}}catch(m){e.push(`sync: queue rewrite failed (${m instanceof Error?m.message:String(m)}) \u2014 already-applied lines dedupe next sync; bad lines re-quarantine then`)}}function Me(t,e){let n=[],o=new Set,a=c=>{if(o.has(c)||!S(c))return;o.add(c);let d;try{d=k(c,"utf8")}catch(l){e.push(`sync: unreadable unit ${c} (${l instanceof Error?l.message:String(l)}) \u2014 skipped`);return}for(let l of d.split(`
10
- `)){let i=/^@import\s+(\S+)\s*$/.exec(l.trim());if(!i)continue;let g=G(i[1])?i[1]:q(Q(c),i[1]);if(!S(g))continue;let m;try{m=k(g,"utf8")}catch(s){e.push(`sync: unreadable import ${g} (${s instanceof Error?s.message:String(s)}) \u2014 skipped; importer continues`);continue}R(m)?.id&&a(g)}n.push({path:c})};return a(t),n}function Se(t,e){return we(t,e)!==null}function we(t,e){let n=t.resolve(e),o=n?t.tipOf(n.cid):null;return n&&o&&!t.superseded.has(o)&&t.nodeLabel.get(o)==="ac"?o:null}function Be(t,e,n,o){let a=t.split(`
11
- `),c=re(a),d={};return{blob:a.map((i,g)=>{let m=ne.exec(i.trim());if(!m||c.has(g))return i;let s=m[1];if(o&&s in o){let _=n.tipOf(o[s]);d[s]=_;let h=n.displayNameOf(_);return h?`@import ${h}`:i}let r=n.resolve(s);if(r)return d[s]=r.tip,i;let u=G(s)?s:q(e,s);if(!S(u))return i;let p=R(k(u,"utf8"))?.id,f=p?n.resolve(p):null;return!p||!f?i:(d[s]=f.tip,`@import ${p}`)}).join(`
12
- `),imports:d}}function Ge(t,e,n,o,a,c,d,l={}){let i=e.getNode(n);if(!i)return{oracleTier:!1,error:"tip unreadable"};let{blob:g,imports:m}=Be(ae(o),c,e,l.imports),s=String(i.content.test_md_blob??""),r=/^#\s+(.+?)\s*$/m.exec(g)?.[1]??String(i.content.title??""),u={...i.content,test_md_blob:g,definitionId:a,title:r};{let y=qe(g);y.target!==void 0?u.target=y.target:delete u.target,y.app!==void 0?u.app=y.app:delete u.app}let p=ce("test",u);if(p.length>0)return{oracleTier:!1,error:p.map(y=>y.detail).join("; ")};let f=de("test",u);if(f===n)return{newCid:n,oracleTier:!1};let _=ke(s)!==ke(g);if(pe(e,n,f))return{oracleTier:_,error:"file content reproduces an already-superseded version (supersession cycle guard) \u2014 graph kept; re-edit forward or redesign"};let h=fe({graph:e,oldTip:n,newCid:f,newLabel:"test",by:d,reason:`re-blessed onto ${f} (edited on disk, run sync)`});if(h.errors.length>0)return{oracleTier:_,error:`edge re-bless refused: ${h.errors.join("; ")}`};let b=M(t);if(e.latestHash!==b){if(l.throwTransient)throw new I(`store advanced under the sync (basis ${String(e.latestHash)} vs head ${String(b)})`);return{oracleTier:_,error:`store advanced under the sync (basis ${String(e.latestHash)} vs head ${String(b)}) \u2014 re-run to retry`}}try{T(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:f,label:"test",content:u}],edges:h.edges,review:[{id:f,kind:"review-item",resolution:"edited",edit:null,reason:"edited on disk (run sync)",by:d}],supersessions:[{kind:"node",old:n,new:f,reason:"edited on disk (run sync)",by:d},...h.supersessions],source_head_moves:{}},{expectPrev:b,intent:{v:1,verb:"exec-supersede",args:L({tip:n,raw:o,fileId:a,by:d}),pins:{tip:n,imports:m}},provenance:l.provenance})}catch(y){if(l.throwTransient&&y instanceof I)throw y;return{oracleTier:_,error:y instanceof Error?y.message:String(y)}}return O(t),{newCid:f,oracleTier:_}}function qe(t){let e=te(t);return{...typeof e.target=="string"?{target:e.target}:{},...typeof e.app=="string"?{app:e.app}:{}}}function ke(t){let e=[],n=t.split(`
13
- `),o=n.some(c=>/^##\s/.test(c)&&V.test(c)),a=!1;for(let c of n){if(/^##\s/.test(c)){let d=V.exec(c);a=o?d!==null:/\bassert\b/i.test(c),d&&e.push(`v:${d[1].trim()}`);continue}a&&c.trim()!==""&&e.push(c.trim())}return e.join(`
14
- `)}var Ve=0;function xe(t,e,n,o){try{let a=e.split(`
15
- `),c=-1;if(a[0]?.trim()==="---"){for(let i=1;i<a.length;i++)if(a[i].trim()==="---"){c=i;break}}if(c<0)return;let d=oe(a,c);if(!d)return;if(d.baseLine!==void 0){let i=a[d.baseLine].endsWith("\r")?"\r":"";a[d.baseLine]=`${d.childIndent}base: ${n}${d.baseComment?` ${d.baseComment}`:""}${i}`}else if(d.strayBase){o.push(`sync: ${t} has a base: line this scanner cannot confidently rewrite (unexpected indentation or key quoting) \u2014 pin refresh skipped (stale pin until the shape is fixed)`);return}else{let g=a[d.idLine??d.start].endsWith("\r")?"\r":"";a.splice((d.idLine??d.start)+1,0,`${d.childIndent??" "}base: ${n}${g}`)}let l=`${t}.tmp-sync.${process.pid}-${Ve++}`;J(l,a.join(`
16
- `)),Fe(l,t)}catch(a){o.push(`sync: pin refresh failed for ${t} (${a instanceof Error?a.message:String(a)}) \u2014 next run self-heals`)}}export{ye as a,Ee as b,pt as c,ft as d,Ge as e};
@@ -1,370 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as ot}from"./chunk-ZKSN2SJ7.js";import{a as at,b as _e}from"./chunk-EVFFDODK.js";import{a as it,b as rt}from"./chunk-LSDWPG6C.js";import{a as X,b as Je,e as fe,f as he,g as Xe,h as nt}from"./chunk-5HMN74RZ.js";import{a as Ye,c as et,d as tt,e as be,f as st}from"./chunk-VBS33P2C.js";import{a as ze,b as We,c as Ke}from"./chunk-XKHWWKJZ.js";import{a as Ve,b as Ue,c as He}from"./chunk-BB2W35TW.js";import{a as ge}from"./chunk-U6OTFMIT.js";import{c as Qe}from"./chunk-V4B5QA3U.js";import{a as Ge,e as Fe}from"./chunk-FY7TCYPK.js";import{a as Ze}from"./chunk-63DYVWNX.js";import{a as qe}from"./chunk-Q2F5QB2W.js";import{b as je}from"./chunk-USY7VAO6.js";import{q as Le}from"./chunk-GTVQYT3D.js";import{b as Me,c as Be,f as oe}from"./chunk-VHW7BMZQ.js";import{b as $e,c as Ee,e as Re,f as Ce,g as Ae,h as me,k as ue,l as pe}from"./chunk-OMNLAGQC.js";import{d as De}from"./chunk-HGFWIBVF.js";import{b as le}from"./chunk-VZ7KXRXB.js";import{z as V}from"./chunk-IICT4VOU.js";import{H as Ne}from"./chunk-RDHWNSDP.js";import{a as Ie,f as Oe,g as Pe}from"./chunk-FQNQVC5O.js";import{d as ae,e as Te,f as U,g as W}from"./chunk-XLSOQLVT.js";import{a as xe,c as de}from"./chunk-5LJRZI7S.js";import{a as Se}from"./chunk-5EOX4MEY.js";import{mkdirSync as Wt,appendFileSync as Kt,rmdirSync as Et}from"fs";import{randomBytes as Qt}from"crypto";import{dirname as ce,join as ke,relative as Yt}from"path";function ct(t,e){let i=[];for(let n of e??[]){let c=t.resolve(n.ref)?.tip??null;c!==n.cid&&i.push({ref:n.ref,pinned:n.cid,now:c})}return i}import{existsSync as ye,readFileSync as ve,readdirSync as Tt}from"fs";import{join as se}from"path";var lt=`
3
- version: 1
4
- techniques:
5
- - id: eqp
6
- name: "Equivalence partitioning"
7
- applies_hint: "any constrained input"
8
- emits: [absolute, forbidden-presence]
9
- - id: bva
10
- name: "Boundary value analysis"
11
- applies_hint: "input has an ordered range or length"
12
- emits: [absolute, forbidden-presence]
13
- - id: negative
14
- name: "Negative / error"
15
- applies_hint: "any input or action that can fail"
16
- emits: [forbidden-presence]
17
- - id: state_flow
18
- name: "State / flow"
19
- applies_hint: "the AC sits in a multi-step flow"
20
- emits: [state-transition]
21
- - id: crud
22
- name: "CRUD round-trip"
23
- applies_hint: "AC touches a persisted resource"
24
- emits: [delta, presence, forbidden-presence]
25
- - id: auth
26
- name: "Auth / permission"
27
- applies_hint: "AC is behind a gate or role"
28
- emits: [forbidden-presence, presence]
29
- - id: api_contract
30
- name: "API-contract"
31
- applies_hint: "surface is REST/GraphQL"
32
- emits: [absolute]
33
- - id: concurrency
34
- name: "Concurrency / race"
35
- applies_hint: "high-risk (money / data-loss) or shared-resource AC"
36
- emits: [state-transition, forbidden-presence]
37
- - id: idempotency
38
- name: "Idempotency / retry"
39
- applies_hint: "money or write operations"
40
- emits: [delta]
41
- - id: i18n
42
- name: "i18n / l10n"
43
- applies_hint: "AC renders user text or formats numbers/dates/currency"
44
- emits: [presence, absolute]
45
- - id: a11y
46
- name: "a11y"
47
- applies_hint: "any rendered surface"
48
- emits: [presence, absolute]
49
- - id: responsiveness
50
- name: "Responsiveness / layout"
51
- applies_hint: "rendered surface"
52
- emits: [presence, forbidden-presence]
53
- - id: empty_state
54
- name: "Empty / null / zero state"
55
- applies_hint: "list / search / collection AC"
56
- emits: [presence]
57
- - id: overflow_underflow
58
- name: "Overflow / underflow"
59
- applies_hint: "numeric or quantity AC (R9: explicit underflow/overflow)"
60
- emits: [forbidden-presence]
61
- - id: persistence
62
- name: "Persistence / refresh"
63
- applies_hint: "AC asserts durable state"
64
- emits: [absolute]
65
- - id: temporal
66
- name: "Time / timezone / expiry"
67
- applies_hint: "AC involves dates, TTLs, schedules"
68
- emits: [state-transition, forbidden-presence]
69
- - id: currency
70
- name: "Currency / rounding"
71
- applies_hint: "money AC"
72
- emits: [absolute]
73
- - id: pagination
74
- name: "Pagination / sort / filter"
75
- applies_hint: "list / search AC"
76
- emits: [absolute, presence]
77
- - id: file_media
78
- name: "File / media"
79
- applies_hint: "upload surface"
80
- emits: [forbidden-presence]
81
- - id: notification
82
- name: "Notification / async-effect"
83
- applies_hint: "AC produces an out-of-band effect (email/SMS/push)"
84
- emits: [presence, delta]
85
- `;var dt={"web-form":`
86
- id: web-form
87
- name: "Web form"
88
- version: 1
89
- applies_when: >
90
- The AC concerns a data-entry form: input fields, required fields, submit,
91
- validation messages.
92
- candidate_checks:
93
- - id: field-validation
94
- family: negative
95
- measurable_example: "Enter 'abc' in a numeric quantity field \u2192 inline error 'must be a number', value not accepted"
96
- emits: forbidden-presence
97
- - id: required-fields
98
- family: negative
99
- measurable_example: "Submit with a required field empty \u2192 submit blocked, field flagged"
100
- emits: forbidden-presence
101
- - id: formats
102
- family: negative
103
- measurable_example: "Email without @ rejected; valid accepted"
104
- emits: forbidden-presence
105
- - id: empty-state
106
- family: empty_state
107
- measurable_example: "First load: no stale values, placeholders shown"
108
- emits: presence
109
- - id: error-messages
110
- family: negative
111
- measurable_example: "Each error is specific and tied to its field"
112
- emits: presence
113
- - id: a11y
114
- family: a11y
115
- measurable_example: "Every input has a programmatic label; keyboard-only submit works"
116
- emits: presence
117
- - id: responsiveness
118
- family: responsiveness
119
- measurable_example: "No field overlap at 1280/768/375 px"
120
- emits: forbidden-presence
121
- `,"rest-graphql-api":`
122
- id: rest-graphql-api
123
- name: "REST / GraphQL API"
124
- version: 1
125
- applies_when: >
126
- The surface is an HTTP/GraphQL endpoint.
127
- candidate_checks:
128
- - id: response-shape
129
- family: api_contract
130
- measurable_example: "Body validates against the declared schema"
131
- emits: absolute
132
- - id: status-codes
133
- family: api_contract
134
- measurable_example: "GET 200, POST 201, missing 404, bad 400, unauth 401"
135
- emits: absolute
136
- - id: verbs
137
- family: idempotency
138
- measurable_example: "PUT is idempotent, POST is not"
139
- emits: delta
140
- - id: bad-payloads
141
- family: negative
142
- measurable_example: "Malformed JSON \u2192 400, never 500"
143
- emits: absolute
144
- - id: idempotency
145
- family: idempotency
146
- measurable_example: "Same POST with idempotency-key twice \u2192 one effect"
147
- emits: delta
148
- - id: pagination
149
- family: pagination
150
- measurable_example: "Page beyond last \u2192 empty list, not error; cursor stable"
151
- emits: absolute
152
- - id: versioning
153
- family: api_contract
154
- measurable_example: "v1 contract unchanged after v2 ships"
155
- emits: absolute
156
- - id: rate-limits
157
- family: api_contract
158
- measurable_example: "Over the limit \u2192 429 with retry-after"
159
- emits: absolute
160
- `,"mobile-native":`
161
- id: mobile-native
162
- name: "Mobile native"
163
- version: 2
164
- applies_when: >
165
- iOS/Android native surface.
166
- candidate_checks:
167
- - id: interruptions
168
- family: state_flow
169
- measurable_example: "Incoming call mid-flow \u2192 state preserved on return \u2014 no device control: promises here become gaps, not tests"
170
- emits: state-transition
171
- - id: network-transitions
172
- family: state_flow
173
- measurable_example: "wifi\u2192cellular\u21924G drop: no data loss, graceful retry \u2014 no connectivity control: promises here become gaps, not tests"
174
- emits: state-transition
175
- - id: permissions
176
- family: negative
177
- measurable_example: "Deny camera \u2192 feature degrades, no crash \u2014 the OS dialog is tappable UI (exercise Allow/Deny on screen); only programmatic grant/deny or pre-seeded permission state has no control"
178
- emits: forbidden-presence
179
- - id: orientation
180
- family: persistence
181
- measurable_example: "Rotate mid-form \u2192 input preserved"
182
- emits: absolute
183
- - id: deep-links
184
- family: state_flow
185
- measurable_example: "Cold-start deep link lands on the right screen with auth \u2014 legal when the test states the exact link target"
186
- emits: state-transition
187
- - id: state-persistence
188
- family: persistence
189
- measurable_example: "Kill + relaunch \u2192 resume where left off"
190
- emits: absolute
191
- - id: localization
192
- family: i18n
193
- measurable_example: "Device locale switch reformats and re-translates \u2014 no device control: promises here become gaps, not tests"
194
- emits: presence
195
- `,"stateful-flow":`
196
- id: stateful-flow
197
- name: "Stateful flow"
198
- version: 1
199
- applies_when: >
200
- Multi-step wizard / checkout / onboarding.
201
- candidate_checks:
202
- - id: valid-transitions
203
- family: state_flow
204
- measurable_example: "Each step advances only when its precondition is met"
205
- emits: state-transition
206
- - id: invalid-transitions
207
- family: state_flow
208
- measurable_example: "Can't jump to step 3 with step 2 incomplete"
209
- emits: forbidden-presence
210
- - id: back-and-abandon
211
- family: state_flow
212
- measurable_example: "Back from step 3, then abandon \u2192 no partial commit"
213
- emits: forbidden-presence
214
- - id: refresh-persistence
215
- family: persistence
216
- measurable_example: "Reload at step 2 \u2192 still at step 2 with data"
217
- emits: absolute
218
- - id: resume
219
- family: persistence
220
- measurable_example: "Return later \u2192 resume the saved flow"
221
- emits: absolute
222
- - id: double-submission
223
- family: idempotency
224
- measurable_example: "Double-click submit \u2192 exactly one submission"
225
- emits: delta
226
- `,"data-crud":`
227
- id: data-crud
228
- name: "Data CRUD"
229
- version: 1
230
- applies_when: >
231
- A persisted record.
232
- candidate_checks:
233
- - id: crud-round-trip
234
- family: crud
235
- measurable_example: "Create \u2192 read shows it \u2192 update \u2192 read shows the change \u2192 delete \u2192 read 404"
236
- emits: state-transition
237
- - id: retry-safety
238
- family: idempotency
239
- measurable_example: "Retried create with same key \u2192 one row"
240
- emits: delta
241
- - id: concurrency-lost-update
242
- family: concurrency
243
- measurable_example: "Two writers, last must not silently clobber \u2192 conflict surfaced"
244
- emits: forbidden-presence
245
- - id: delete-cascade
246
- family: crud
247
- measurable_example: "Delete parent \u2192 children handled per rule"
248
- emits: state-transition
249
- - id: referential-consistency
250
- family: crud
251
- measurable_example: "Can't create a child for a missing parent"
252
- emits: forbidden-presence
253
- `,"auth-gated":`
254
- id: auth-gated
255
- name: "Auth gated"
256
- version: 1
257
- applies_when: >
258
- Behind login/role.
259
- candidate_checks:
260
- - id: login-gate
261
- family: auth
262
- measurable_example: "Anonymous \u2192 redirected to login, not the resource"
263
- emits: forbidden-presence
264
- - id: role-permission-matrix
265
- family: auth
266
- measurable_example: "For each role \xD7 action: allowed/denied as specified"
267
- emits: absolute
268
- - id: cross-user-record
269
- family: auth
270
- measurable_example: "User A cannot read/edit user B's record by id"
271
- emits: forbidden-presence
272
- - id: token-session-expiry
273
- family: auth
274
- measurable_example: "Expired token \u2192 401/redirect, no stale access"
275
- emits: forbidden-presence
276
- - id: privilege-escalation
277
- family: auth
278
- measurable_example: "Non-admin cannot reach an admin action by direct URL/API"
279
- emits: forbidden-presence
280
- `,"search-list":`
281
- id: search-list
282
- name: "Search / list"
283
- version: 1
284
- applies_when: >
285
- Search results / list views.
286
- candidate_checks:
287
- - id: pagination
288
- family: pagination
289
- measurable_example: "First/last/empty page correct; total accurate"
290
- emits: absolute
291
- - id: sorting
292
- family: pagination
293
- measurable_example: "Sort asc/desc actually orders; ties stable"
294
- emits: absolute
295
- - id: filtering
296
- family: pagination
297
- measurable_example: "Each filter narrows correctly; combined filters AND"
298
- emits: absolute
299
- - id: empty-state
300
- family: empty_state
301
- measurable_example: "No results \u2192 friendly empty state, not blank/error"
302
- emits: presence
303
- - id: invalid-input
304
- family: negative
305
- measurable_example: "Garbage query \u2192 no crash, sane result"
306
- emits: forbidden-presence
307
- - id: length-limits
308
- family: bva
309
- measurable_example: "Max-length query handled"
310
- emits: absolute
311
- - id: locale
312
- family: i18n
313
- measurable_example: "Locale-correct collation/casing"
314
- emits: presence
315
- `};var mt=`
316
- version: 3
317
- principles:
318
- - "Each step is one complete OBJECTIVE the executing agent achieves autonomously \u2014 state the goal and the path, never low-level actions (the agent emits its own actions)."
319
- - "One objective (or tightly-related items of one goal) per step; unrelated goals split."
320
- - "Verbose path: name site or app, page or screen, section, panel, control, state \u2014 'On the search results page for Noida, in the filter panel's Budget section, set min to 50L and max to 1Cr'."
321
- - "Self-contained: concrete values inline; never 'as defined in the scenario' \u2014 the agent cannot see the graph."
322
- - "Two surfaces: WEB tests run in the kane-cli browser agent; MOBILE tests run in the kane-cli mobile agent on a local Android emulator / iOS simulator (native app). One surface per test; imports/reuse only same-surface units."
323
- - "In scope: web-browser behavior, mobile emulator/simulator native-app behavior, and direct API calls. NOT in scope: out-of-band email/SMS, backend state with no web, app-screen, or API surface."
324
- verification:
325
- - "Phrase checks against what the test's own surface can observe:"
326
- - "WEB Visual \u2014 visible text, labels, counts, prices ('verify the price is 29.99', 'the Sold out label is shown')."
327
- - "WEB Textual/DOM \u2014 element states/attributes ('the Add button is disabled', 'the placeholder of the search box is \u2026')."
328
- - "WEB URL \u2014 'URL contains /checkout'. Title \u2014 'page title contains \u2026'."
329
- - "WEB DevTools/Network \u2014 'no API calls returned 5xx', 'the POST /api/login returned 200'. Console \u2014 'no console errors'. Performance \u2014 'LCP under 2500ms'. Cookies/localStorage \u2014 'a cookie named session_id exists'."
330
- - "MOBILE Visual \u2014 on-screen text, labels, counts, states ('the Upcoming list shows 2 reservations', 'a Booking cancelled toast is shown')."
331
- - "MOBILE Element \u2014 native accessibility-tree states ('the Pay button is disabled', 'the Remember me switch is on')."
332
- - "MOBILE Network (environment-dependent) \u2014 the app's own captured traffic ('the POST /api/login returned 200') and direct API calls ('call GET /api/bookings and verify the cancelled booking is absent') need a capture/API-wired run environment; when the promise is observable on-screen, prefer the screen."
333
- - "MOBILE Lifecycle \u2014 background/foreground, terminate/relaunch (only when the objective closes the app), orientation, deep links with a stated target ('background the app and return; the draft is preserved'). OS permission dialogs are tappable UI \u2014 exercising Allow/Deny on screen is legal."
334
- - "MOBILE ILLEGAL \u2014 URL, page Title, browser console, page-performance: none exist on a native app. Cookies/localStorage: WebView-only AND write-only \u2014 never a read check. Keyboard-visibility: illegal on Android (default sessions suppress the soft keyboard); iOS renders it as ordinary elements. No control exists \u2192 gap, never a test: incoming call/SMS, posting notifications, wifi/airplane switches, locale/timezone, clipboard reads, on-device DB/file reads (the db-query tool reads a configured backend DB, never the device), geolocation, biometrics, programmatic permission pre-seeding. Platform-conditional: notification-shade observation and tab handling are Android-only \u2014 gap iOS notification promises."
335
- - "Assertions are the CLOSING CLAUSE of the step that performed the action \u2014 '\u2026swipe the row left, then assert a Cancel action is shown'. Say assert, not verify. Never a standalone assertion step, never a restated summary check at the end."
336
- - "Setup steps stay clean: a step with no verifies tags states its goal plainly and carries NO assert clause \u2014 failing to reach the goal is signal enough."
337
- - "Tag the proof: a step whose assert clause proves acceptance criteria lists them in its verifies field \u2014 every AC is proven by the step that observes it."
338
- - "Assert the outcome, never the trigger: 'Verify the Submit button is visible' fails exactly when the action worked \u2014 assert what the action changed."
339
- - "A UI-commit confirm is an action, not a check: 'confirm the dialog' presses a control; the check is the resulting state ('\u2026 then assert the banner reads Order placed')."
340
- - "Intent for the actions, literal for the data: goals for verbs ('Log in with {{user}}'), literal or {{variable}} for values."
341
- - "Extractions: 'Store \u2026 as name' \u2014 vague verbs (read/tell/report) do NOT persist values."
342
- - "Baselines/deltas are EXTRACTIONS on both surfaces: 'store the result count as baseline_count' BEFORE the action; compare after. Never an abstract 'capture the state'."
343
- variables:
344
- - "Credentials and environment values are {{name}} variables; concrete domain values from the source stay literal."
345
- - "A value no evidence supplies (start URL, test account, seed data) is ASKED for \u2014 actual value or a variable name \u2014 never invented."
346
- pitfalls:
347
- - "A WEB test without a starting URL cannot run \u2014 its first step names it."
348
- - "A MOBILE test declares its platform as the typed target field; kane writes target:/app: frontmatter into the minted file and the run dispatches on it. Its first step launches the app \u2014 never a URL, never a [mobile:] marker. App data PERSISTS between runs (no reset): never assume first-install or signed-out state."
349
- - "'Test the checkout flow' has no end state \u2014 state what done looks like."
350
- - "Do not cram many unrelated operations into one step; do not reference data outside the step."
351
- - "A step whose only content is an assertion is a smell \u2014 fold it into the action step before it."
352
- `;var It=["presence","forbidden-presence","count","delta","state-transition","absolute","bound","propagation","latency","graded"];function gt(t,e){for(let i of t)if(!It.includes(i))throw new Error(`${e}: emits '${i}' is not an oracle kind`)}function ut(t,e){let i=le(t);if(!i||!Array.isArray(i.techniques))throw new Error(`${e}: expected { techniques: [...] }`);for(let n of i.techniques){if(!n.id||!n.name||!n.applies_hint||!Array.isArray(n.emits))throw new Error(`${e}: technique '${n?.id??"?"}' missing id/name/applies_hint/emits`);gt(n.emits,`${e}: technique '${n.id}'`)}return i.techniques}function pt(t,e){let i=le(t);if(!i||!i.id||!i.name||!i.applies_when||!Array.isArray(i.candidate_checks))throw new Error(`${e}: profile missing id/name/applies_when/candidate_checks`);for(let n of i.candidate_checks){if(!n.id||!n.family||!n.measurable_example||!n.emits)throw new Error(`${e}: candidate_check '${n?.id??"?"}' missing id/family/measurable_example/emits`);gt([n.emits],`${e}: check '${n.id}'`)}return i}function ft(t){let e=new Map(ut(lt,"packaged techniques").map(n=>[n.id,n])),i=se(t,"design","techniques.yaml");if(ye(i))for(let n of ut(ve(i,"utf8"),i))e.set(n.id,n);return[...e.values()]}function ht(t){let e=new Map(Object.entries(dt).map(([n,c])=>[n,pt(c,`packaged profile '${n}'`)])),i=se(t,"design","profiles");if(ye(i))for(let n of Tt(i).filter(c=>c.endsWith(".yaml")||c.endsWith(".yml")).sort()){let c=pt(ve(se(i,n),"utf8"),se(i,n));e.set(c.id,c)}return[...e.values()]}function bt(t){let e=se(t,"design","runner-grammar.yaml");return ye(e)?ve(e,"utf8"):mt}function ne(t,e){return!t.superseded.has(e)}function we(t,e,i){return{cid:e,logical_id:t.nameOf.get(e)??null,content:i}}async function _t(t,e,i,n,c){let a=await Je(t,"search_similar",{text:e,label:i,k:n},c);return a.ok&&Array.isArray(a.result)?a.result:[]}async function yt(t,e,i={}){let n=V(t),c=n.resolve(e);if(!c)throw new Error(`assembleDesignContext: unknown use-case '${e}' (run designGate first)`);let a=c.tip,k=n.getNode(a);if(!k||k.label!==U.USECASE)throw new Error(`assembleDesignContext: '${e}' is not a use-case (run designGate first)`);let M=n.derivesInto(a).map(g=>({source_id:g.props.source_id??null,anchor:g.props.anchor??null})),w=[],I=new Set;for(let{cid:g,content:d}of n.byLabel(U.SCENARIO))ne(n,g)&&n.edgesFrom(g).some(v=>v.type===W.BELONGS_TO&&v.dst===a)&&(w.push(we(n,g,d)),I.add(g));let $=[];for(let{cid:g,content:d}of n.byLabel(U.AC)){if(!ne(n,g))continue;let v=n.edgesFrom(g).find(S=>S.type===W.SCOPED_TO);!v||v.dst!==a&&!I.has(v.dst)||$.push({...we(n,g,d),scoped_to:v.dst})}let D=Array.isArray(k.content.criteria)?k.content.criteria:[],A=[k.content.title,k.content.description,...D].filter(Boolean).join(`
353
- `),q=(await _t(n,A,U.SCENARIO,10,i.embedSearch)).filter(g=>!I.has(g.cid)),C=[],P=new Set,K=[],E=[a],B=new Set([a]);for(;E.length>0;){let g=E.shift();for(let d of n.edgesFrom(g)){if(d.type!==W.DEPENDS_ON||n.nodeLabel.get(d.dst)!==U.USECASE)continue;let v=n.tipOf(d.dst);B.has(v)||(B.add(v),K.push(v),E.push(v))}}for(let g of K){let d=`depends_on ${n.nameOf.get(g)??g.slice(0,19)}`;for(let{cid:v}of n.byLabel(U.SCENARIO))if(ne(n,v)&&n.edgesFrom(v).some(S=>S.type===W.BELONGS_TO&&S.dst===g))for(let S of n.edgesInto(v)){if(S.type!==W.AUTOMATES||!ne(n,S.src)||P.has(S.src))continue;P.add(S.src);let F=String(n.getNode(S.src)?.content.title??"");C.push({cid:S.src,logical_id:n.nameOf.get(S.src)??null,title:F,via:d})}}for(let g of await _t(n,A,U.TEST,5,i.embedSearch)){let{cid:d,title:v}=g;P.has(d)||(P.add(d),C.push({cid:d,logical_id:n.nameOf.get(d)??null,title:v??"",via:"similar"}))}let f=n.byLabel(U.STYLENOTE).filter(g=>ne(n,g.cid)).sort((g,d)=>g.cid<d.cid?-1:1).slice(0,5).map(g=>`${String(g.content.statement)} [${String(g.content.learned_from_kind)}]`);return{usecase:we(n,a,k.content),cites:M,committed_acs:$,existing:{scenarios:w,reuse_candidates:q},import_candidates:C,style_notes:f,techniques:ft(t),profiles:ht(t),runner_grammar:bt(t),variables:[...(i.variablesIndex??new Map).entries()].map(([g,d])=>({name:g,has_value:d.has_value})).sort((g,d)=>g.name<d.name?-1:1),budget:{...i.max!=null?{max_pairs:i.max}:{},...i.strength!=null?{strength_override:i.strength}:{}},design_of:(()=>{let g=it(n,a);return g?{engine:g.engine,seq:g.seq}:null})()}}function vt(t){let e=i=>{if(Array.isArray(i))return i.map(e);if(i!==null&&typeof i=="object"){let n={};for(let c of Object.keys(i).sort())n[c]=e(i[c]);return n}return i};return JSON.stringify(e(t),null,1)}import{basename as Gt,dirname as St,resolve as xt}from"path";import{existsSync as Ot,mkdirSync as Pt,readFileSync as Nt,renameSync as Mt,writeFileSync as Bt}from"fs";import{dirname as jt,join as Lt}from"path";function wt(t){return Lt(t,".testmuai","variables","assurance.json")}function kt(t){for(let c of t.declarations){let a=oe(c.name);if(a)throw new Error(`variable declaration refused: ${a}`)}let e={};if(Ot(t.file)){let c=JSON.parse(Nt(t.file,"utf8"));c&&typeof c=="object"&&!Array.isArray(c)&&(e=c)}let i=[],n=[];for(let c of t.declarations){if(Object.hasOwn(e,c.name)||t.known?.has(c.name)){n.push(c.name);continue}e[c.name]={value:"",secret:!!c.secret,description:c.description},i.push(c.name)}if(i.length>0){Pt(jt(t.file),{recursive:!0});let c=`${t.file}.tmp-${process.pid}-${Date.now()}`;Bt(c,JSON.stringify(e,null,2)+`
354
- `),Mt(c,t.file)}return{written:i,skipped:n}}var qt=ue,Ft=new Set(["narrative","acs","scenarios","tests","exercises","gaps","scoped_to_repoints","judgements","variables","phase"]);function Vt(t){let e=/strength=(\d+)\s*(?:—|-)?\s*(.*)/.exec(t??"");return e?{strength:Number(e[1]),reason:e[2]||t||""}:{strength:2,reason:t??""}}function Ut(t,e,i=new Set,n=0){return qt(e,pe(t),i,n)}function Ht(t,e,i,n){let c=e.scenarios?.find(D=>D.temp_ref===i.automates)??(()=>{let D=t.resolve(i.automates),A=D?t.getNode(D.tip)?.content:void 0;return A?{title:String(A.title??""),intent:String(A.intent??""),technique_notes:String(A.technique_notes??"")}:{}})(),a=[...(e.acs??[]).map(D=>({ref:D.temp_ref,text:D.text})),...i.verifies.filter(D=>!(e.acs??[]).some(A=>A.temp_ref===D)).map(D=>{let A=t.resolve(D);return{ref:D,text:A?String(t.getNode(A.tip)?.content.text??""):""}})],{test_md:k,objectives_yaml:M}=Ae({title:i.title,steps:i.steps,check:i.check,check_prose:i.check_prose,reuses:i.reuses,...i.target?{target:i.target,...i.app?{app:i.app}:{}}:{}},{title:c.title,intent:c.intent},a),w=me(Ut(t,k)),I=i.check,$={technique:c.technique_notes??"",profile_family:e.judgements?.find(D=>D.kind==="profile_family"&&(D.target===i.temp_ref||D.target===i.automates))?.rationale??"unspecified",anchor:I.verified_against,expected_how:e.judgements?.find(D=>D.kind==="expected_how"&&D.target===I.verified_against)?.rationale??`expected_mode: ${I.expected_mode??"inferred"}`,combinatorial:Vt(c.technique_notes),surface_state:"absent",deferred_bindings:I.expected_mode==="runtime-derived"?1:0};return n.push({definitionId:w,rationale:$,anchorRef:I.verified_against,tempRef:i.temp_ref}),{temp_ref:i.temp_ref,title:i.title,automates:i.automates,verifies:i.verifies,check:i.check,definitionId:w,test_md_blob:k,objectives_blob:M,...i.reuses?.length?{reuses:i.reuses}:{},...i.surface_required!==void 0?{surface_required:i.surface_required}:{},...i.target?{target:i.target}:{},...i.target&&i.app?{app:i.app}:{}}}function zt(t,e){try{let i=t.resolve(e.automates);if(!i)return!1;let n=t.tipOf(i.cid)??i.cid;for(let c of t.edgesInto(n)){if(c.type!==W.AUTOMATES)continue;let a=t.getNode(t.tipOf(c.src)??c.src)?.content,k=typeof a?.test_md_blob=="string"?a.test_md_blob:"";if(!k)continue;if(!k.split(`
355
- `).some(w=>/^##\s/.test(w)&&!/—\s?assert/.test(w)&&De.test(w)))return!0}return!1}catch{return!1}}function Dt(t){let e=0,i=t.forceScope??null;return{terminalEventType:"design",async onProposalEvent(n){let c=r=>t.steer?(t.steer(`[auto-repair] ${r} \u2014 please re-finalize with this fixed.`),{proposal:null,error:null}):{proposal:null,error:r};if(n==null||typeof n!="object")return c("finalize_design payload is not an object");let a=n,k=Object.keys(a).filter(r=>!Ft.has(r));if(k.length>0)return c(`finalize_design carries ungated/unknown section(s): ${k.join(", ")} \u2014 mintable here: acs, scenarios, tests (+gaps)`);let M=new Map;for(let r of a.tests??[]){let u=M.get(r.automates);if(u)return c(`strict 1:1 violated in-payload: ${u} and ${r.temp_ref} both automate ${r.automates}`);if(M.set(r.automates,r.temp_ref),typeof r.app=="string"&&!/^APP/.test(r.app)&&!/[\/]/.test(r.app)&&!/\.(apk|zip|app)$/i.test(r.app))return c(`${r.temp_ref}: app '${r.app}' is neither a build path (.apk / .zip of an .app) nor an APP\u2026 upload id \u2014 omit the field when only a bundle id exists`)}let w=V(t.contextDir),I=/^design@(\d+)$/.exec(t.templateVersion?.()??"");if(I&&Number.parseInt(I[1],10)>=6)for(let r of a.tests??[]){if(!Array.isArray(r.steps??[]))return c(`${r.temp_ref}: steps must be an array of objective strings or {text, verifies} objects`);let u=new Set;for(let x of Array.isArray(r.steps)?r.steps:[])if(typeof x=="object"&&x.verifies)for(let b of x.verifies)u.add(b);let _=new Set(r.verifies??[]),h=[..._].filter(x=>!u.has(x)),T=[...u].filter(x=>!_.has(x));if(!(u.size===0&&zt(w,r))&&(u.size===0||h.length>0||T.length>0))return c(`${r.temp_ref}: every AC must be claimed by the step that proves it \u2014 `+(u.size===0?"no step carries verifies tags":`not claimed by any step: [${h.join(", ")}]; tagged but not in the test's verifies: [${T.join(", ")}]`))}if(a.variables!==void 0&&!Array.isArray(a.variables))return c("variables must be an array of {name, description, secret}");let $=!!I&&Number.parseInt(I[1],10)>=7;if((a.variables??[]).length>0&&!$)return c("variables[] needs design@7 \u2014 this session is bound to an older template; drop the section");let D=new Set;for(let r of a.variables??[]){if(!r||typeof r!="object"||typeof r.name!="string"||typeof r.description!="string"||typeof r.secret!="boolean")return c(`variables[]: every entry is {name, description, secret} \u2014 got ${JSON.stringify(r)}`);let u=Object.keys(r).filter(h=>!["name","description","secret"].includes(h));if(u.length>0)return c(`variables[]: '${r.name}' carries ${u.join(", ")} \u2014 a declaration has no value and no other fields`);let _=oe(r.name);if(_)return c(`variables[]: ${_}`);if(!r.description.trim()||/[\r\n]/.test(r.description))return c(`variables[]: '${r.name}' needs a one-line, non-empty description`);if(D.has(r.name))return c(`variables[]: '${r.name}' is declared twice`);D.add(r.name)}if($){let r=t.variablesIndex?.()??new Map;for(let u of a.tests??[]){let _=[...(Array.isArray(u.steps)?u.steps:[]).map(h=>typeof h=="string"?h:h.text),u.check_prose??""];for(let h of _)for(let T of je(h))if(!(r.has(T)||D.has(T)))return c(`${u.temp_ref}: step references {{${T}}} but no variable named '${T}' exists in the pool and this payload does not declare it \u2014 reuse a name from the variables block, or declare it in \`variables\` ({name, description, secret})`)}}t.force&&!t.resuming&&e===0&&i===null&&(i=at(w,t.ucRef,{blockerGaps:ae(t.templateVersion?.()??null)>=8}));let A=w.resolve(t.ucRef),q=A?String(w.getNode(A.tip)?.content.risk??"med"):"med",C=[],P=new Set([t.ucRef,A?.cid,A?.tip].filter(Boolean)),K=r=>{if(P.has(r))return!0;let u=w.resolve(r);return u!=null&&(P.has(u.cid)||P.has(u.tip))},E;try{E={...a.acs?.length?{acs:a.acs.map(r=>({temp_ref:r.temp_ref,text:r.text,kind:r.kind,risk:r.risk??q,...r.expected_answer?{expected_answer:r.expected_answer}:{},...r.scoped_to&&!K(r.scoped_to)?{scope:{type:"scenario",ref:r.scoped_to}}:{}}))}:{},...a.scenarios?.length?{scenarios:a.scenarios}:{},...a.tests?.length?{tests:a.tests.map(r=>Ht(w,a,r,C))}:{},...a.exercises?.length?{exercises:a.exercises}:{},...a.gaps?.length?{gaps:a.gaps}:{},...a.scoped_to_repoints?.length?{scoped_to_repoints:a.scoped_to_repoints}:{},...a.judgements?.length?{judgements:a.judgements}:{}}}catch(r){return c(r instanceof Error?r.message:String(r))}let B=ae(t.templateVersion?.()??null)>=8,f=a.phase??(a.tests?.length?"tests":a.scenarios?.length?"scenarios":a.acs?.length?"acs":"design"),g=(r,u={})=>({contextDir:t.contextDir,graph:r,ucRef:t.ucRef,sections:E,by:t.by,phase:f,...u,...t.templateVersion?{templateVersion:t.templateVersion()}:{},...t.engine?{engine:t.engine}:{},...i?.length?{forceScope:i}:{},...t.because?{reason:t.because}:{},finalizeTestBody:(()=>{let _=new Map((E.tests??[]).map(x=>[x.temp_ref,x])),h=new Map,T=(x,b,j)=>{let s=_.get(x);if(!s?.test_md_blob)return null;let l=h.get(x);if(l!==void 0)return l;if(j.has(x))return s.test_md_blob;j.add(x);let m=new Map;for(let O of s.reuses??[]){T(O,b,j);let J=b(O);J!==null&&J!==O&&m.set(O,J)}let o=s.verifies.map(b).filter(O=>O!==null),p=Ce(s.test_md_blob,m),{md:y,tagged:R}=$e(p,b),N=R?y:Re(p,o);return Ee(N,o),h.set(x,N),N};return(x,b)=>{if(!x.test_md_blob)return null;let j=T(x.temp_ref,b,new Set)??x.test_md_blob;if(j===x.test_md_blob)return null;let s=l=>{for(let m of _.keys())if(b(m)===l){let o=T(m,b,new Set);if(o!==null)return{body:o,cycleKey:`batch:${l}`,next:s}}return pe(w)(l)};return{test_md_blob:j,definitionId:me(ue(j,s))}}})()}),d,v=[],S=[];if(t.protocol){let r=t.generationTicket,u=await ze(t.protocol,{verb:"design",ucTargets:[{ref:t.ucRef}],newBuCandidates:[],sourcePins:[],readBasis:w.latestHash,...r?{generationTicket:r}:{}},_=>{let h=_e(g(_.graph,{eventIds:_.eventIds("design",1),sid:_.sid,...r&&!t.generationStamped?{generationTicket:r}:{}}));return h.errors!==null?(v=h.warnings,S=h.droppedBlockers??[],{errors:h.errors}):{result:h,record:h.record}});u.ok&&"result"in u?(d=u.result,r&&!t.generationStamped&&(t.generationStamped=!0,t.generationTicket={...r,expected_prev_gen:r.next_gen})):u.ok?d={record:null,errors:null,minted:{},logicalIds:{},superseded:[],warnings:["commit already applied (recommit)"],finalizedTests:{}}:d={record:null,errors:u.kind==="validation"?u.errors:u.kind==="contended"?[{code:u.err.code,detail:`${t.ucRef} is held by ${u.err.holder?.owner_sid??"another session"}${u.err.holder?.alive?" (live)":" (stale)"} \u2014 try another use-case or wait for it to free`}]:u.kind==="drifted"?u.asks.map(h=>({code:"DRIFTED",detail:h.detail})):[{code:"UNSETTLED",detail:`concurrent activity kept moving the store (${u.attempts} attempts) \u2014 retry when the store is quieter`}],minted:{},logicalIds:{},superseded:[],finalizedTests:{},warnings:u.kind==="validation"?v:[],...u.kind==="validation"&&S.length?{droppedBlockers:S}:{}}}else d=_e(g(w));if(d.errors){if((d.droppedBlockers?.length??0)>0&&d.errors.every(r=>r.code==="EMPTY_DESIGN")){for(let _ of d.warnings)t.note(`warning: ${_}`);e+=1;let r=new Set((i??[]).filter(_=>w.nodeLabel.get(_)==="gap"));return{proposal:null,error:null,receipt:ge({verb:"design",commitN:e,ucRef:t.ucRef,typedBlockers:B,phase:f,committed:[],warnings:d.warnings,...r.size?{ignoreGaps:r}:{}},w)}}return c("design commit failed: "+d.errors.map(r=>`${r.code}: ${r.detail}`).join("; "))}let F=d.warnings.filter(r=>r.includes("\u2014 committed anyway; approve"));for(let r of d.warnings)(!F.includes(r)||F.length===1)&&t.note(`warning: ${r}`);F.length>1&&t.note(`warning: ${F.length} test link(s) refer to items still awaiting approval \u2014 saved anyway; review and approve those items in chat or via kane-cli context review`);let L=(r,u)=>r?`${r} ${u}${r>1?"s":""}`:null,Z=[L(a.acs?.length,"AC"),L(a.scenarios?.length,"scenario"),L(a.tests?.length,"test"),L(a.gaps?.length,"gap")].filter(Boolean);t.aliases?.(Object.entries(d.minted).map(([r,u])=>({ref:r,cid:u,...d.logicalIds[r]?{id:d.logicalIds[r]}:{}})));{let r=`saved ${Z.join(" \xB7 ")||"judgements/wiring"} as drafts`;(t.commitLine??t.note)(r)}let H=V(t.contextDir);t.onCommitted?.(H);for(let r of C){let u=d.logicalIds[r.anchorRef]??d.minted[r.anchorRef];ot(t.contextDir,d.finalizedTests[r.tempRef]??r.definitionId,{...r.rationale,anchor:u??r.rationale.anchor})}try{let r=Object.values(d.minted).filter(u=>H.getNode(u)?.label==="test");if(r.length>0){let u=St(xt(t.contextDir)),_=Le({graph:H,cids:r,cwd:u});_.wrote.length>0&&t.note(`\u2692 wrote ${_.wrote.map(h=>Gt(h.path)).join(" \xB7 ")}`);for(let h of _.refused)t.note(`warning: could not create the test file for ${h.id} \u2014 ${h.reason}`)}}catch(r){t.note(`warning: the design was saved, but its test file could not be created (${r instanceof Error?r.message:String(r)})`)}try{if((a.variables??[]).length>0){let r=St(xt(t.contextDir)),u=wt(r),{written:_}=kt({file:u,declarations:a.variables,known:t.variablesIndex?.()});if(_.sort(),_.length>0){let h=_.map(T=>({...a.variables.find(x=>x.name===T),file:u}));t.note(`\u2692 declared ${_.length} new variable${_.length===1?"":"s"} \u2014 ${_.join(" \xB7 ")} (values needed)`),t.event?.({type:"variables_declared",file:u,variables:h.map(({name:T,description:x,secret:b})=>({name:T,description:x,secret:b}))}),t.onVariablesDeclared?.(h)}}}catch(r){t.note(`warning: the design was saved, but its variable stubs could not be written (${r instanceof Error?r.message:String(r)})`)}t.event?.({type:"commit",acs:a.acs?.length??0,scenarios:a.scenarios?.length??0,tests:a.tests?.length??0,gaps:a.gaps?.length??0,warnings:d.warnings.length,minted:Object.entries(d.minted).map(([r,u])=>({temp_ref:r,cid:u,...d.logicalIds[r]?{logical_id:d.logicalIds[r]}:{}}))}),e+=1,i!==null&&(i=d.forceScopeRemaining??i,t.onForceScope?.(i));let ee=new Set((i??[]).filter(r=>H.nodeLabel.get(r)==="gap")),G=ge({verb:"design",commitN:e,ucRef:t.ucRef,typedBlockers:B,...ee.size?{ignoreGaps:ee}:{},phase:f,committed:Object.entries(d.minted).map(([r,u])=>({temp_ref:r,cid:u,...d.logicalIds[r]?{logical_id:d.logicalIds[r]}:{}})),warnings:d.warnings},H),z=G.event.parity,Q=z?.missing??[],te=!!a.tests?.length,ie=new Set(d.droppedBlockers??[]),Y=f==="tests"&&(a.gaps??[]).some((r,u)=>Te.has(String(r.kind))&&!ie.has(u)),re=B?(te||Y)&&Q.length===0&&(z?.live_scenarios??0)>0:te&&Q.length===0;return{proposal:d,error:null,receipt:G,...re?{sessionComplete:re}:{}}}}}function $t(t,e){return{type:"run_config",version:1,session_id:e.session_id,mode:e.mode,source:{source_id:`design:${t.usecase.logical_id??e.ucCid.slice(0,19)}`,source_cid:e.ucCid,kind:"design_context",numbered_text:vt({...t,session_mode:e.mode})},existing_use_cases:[],read_basis:e.readBasis,max_free_text_rounds:2,graph_reads:!0,verb:"design",chat:!0,design_budget:t.budget,topology:e.topology}}var Rt=Symbol("design-out-tee");function Jt(t,e,i,n){return{terminalEventType:"design",async onProposalEvent(c){let a=c??{},k=["acs","scenarios","tests","gaps"].map(M=>a[M]?.length?`${a[M].length} ${M}`:null).filter(Boolean).join(" \xB7 ");return i?.("plan_payload",{payload:a}),t(`plan: finalize_design \u2014 ${k||"wiring/judgements only"} (nothing committed${n?`; full payload: ${X(n)}`:""})`),e?.({type:"plan",payload:a}),{proposal:a,error:null}}}}var Ct=8*1024;function Xt(t,e){let i=qe({message_id:`msg-${e}-ffffff`,text:t});return i<=Ct?null:`error: the opening statement is ${i} bytes and the agent takes at most ${Ct} per message (it would drop it silently) \u2014 pass a shorter --because (it replaces the generated stale reason)`}function Zt(t,e,i){if(!t.statement||t.resume)return{initialMessage:e};let n=[e,t.statement].filter(Boolean).join(`
356
-
357
- `),c=Xt(n,i);return c?{initialMessage:e,error:c}:{initialMessage:n}}async function un(t,e){let i=V(e.contextDir),n=null,c=null,a=t.useCase;if(t.resume){try{{let p=await st(e.contextDir,t.resume,i,{deps:{onWarn:y=>e.out(`note: ${y}`)}});c=p,n=p.handle,p.drift.length>0&&(e.out(`note: sources changed since the pause: ${p.drift.map(y=>y.subject).join(", ")} \u2014 the design continues against the current versions`),e.emit?.({type:"stale_basis",sources:p.drift.map(y=>y.subject)}))}}catch(p){if(p instanceof xe||p instanceof be)return e.out(`error: ${p.message}`),e.emit?.({type:"error",message:`error: ${p.message}`}),p instanceof be||p.code==="SESSION_MISSING"||p.code==="SESSION_EXPIRED"?2:1;throw p}let s=n.state,l=Ye(s.verb,"design",t.resume);if(l)return e.out(l.message),e.emit?.({type:"error",message:l.message,code:l.code}),n.release(),2;if(a&&s.use_case&&a!==s.use_case){let p=`session ${t.resume} was designing ${s.use_case}; --use-case ${a} RETARGETS it`;if(!(t.confirmRetarget?await t.confirmRetarget(`${p} \u2014 continue with the new target?`):!1))return e.out(`error: ${p} \u2014 resume without --use-case to continue ${s.use_case}, or start a fresh session on ${a}`),e.emit?.({type:"error",code:"RETARGET_MISMATCH",message:p}),n.release(),2}if(a=a??s.use_case,s.uc_tip&&a){let p=i.resolve(a)?.tip;if(p&&p!==s.uc_tip){let y=`the use-case changed since the pause (${s.uc_tip.slice(0,19)}\u2026 \u2192 ${p.slice(0,19)}\u2026)`;if(!(t.confirmRetarget?await t.confirmRetarget(`${y} \u2014 re-ground and continue against the new version?`):!1))return e.out(`error: ${y} \u2014 resume interactively to re-ground, or abandon this session`),e.emit?.({type:"error",code:"UC_TIP_MOVED",message:y}),n.release(),2;e.emit?.({type:"stale_basis",usecase:a})}}let m=ct(i,s.target_pins);if(m.length>0){let p=`items this session pinned have changed since it paused: ${m.map(R=>`${R.ref}${R.now===null?" (now gone)":""}`).join(", ")}`;if(!(t.confirmRetarget?await t.confirmRetarget(`${p} \u2014 re-ground and continue?`):!1))return e.out(`error: ${p} \u2014 resume interactively to re-ground, or abandon`),e.emit?.({type:"error",code:"TARGET_PIN_MOVED",message:p}),n.release(),2;n.save({target_pins:(s.target_pins??[]).map(R=>({ref:R.ref,cid:i.resolve(R.ref)?.tip??R.cid}))})}let o=[...new Set([...n.state.held_receipts??[],...c?.view.kane?.held_receipts??[]])];if(o.length>0)if(e.chat?.holdReceipt)for(let p of o)e.chat.holdReceipt(p);else e={...e,initialMessage:[o.join(`
358
-
359
- `),e.initialMessage].filter(Boolean).join(`
360
-
361
- `)};if(!a)return e.out(`error: session ${t.resume} predates use-case persistence \u2014 re-supply --use-case <ref>`),e.emit?.({type:"error",message:`error: session ${t.resume} predates use-case persistence \u2014 re-supply --use-case <ref>`}),n.release(),2}let k=t.resume?void 0:t.phase,M=!1;if(k!==void 0){let{checkPhaseEntry:s,phaseEntryCmd:l,phaseLadderFor:m}=await import("./phase-seed-MKHEWUN6.js");M=m(e.contextDir,i,a).length>0;let o=s(e.contextDir,i,a,k);if(!o.ok&&o.code==="UNKNOWN_PHASE")return e.out(`error: ${o.message}`),e.emit?.({type:"error",code:"UNKNOWN_PHASE",message:o.message}),n?.release(),2;if(!o.ok&&o.code==="PHASE_ORDER"){let p=t.askPhaseEntry?await t.askPhaseEntry({message:o.message,earliest:o.earliest}):"cancel";if(p==="earliest")e.out(`starting at ${o.earliest} instead (${o.missing.join(", ")} not committed yet)`),k=o.earliest;else if(p==="proceed")e.out(`note: entering at ${k} with ${o.missing.join(", ")} uncommitted \u2014 proceeding on your say-so`),e.emit?.({type:"phase_entry_override",phase:k,missing:o.missing});else{let y=(t.mode??"interactive")==="agent",R=l(a,o.earliest,y);return e.out(`error: ${o.message}`),e.emit?.({type:"error",code:"PHASE_ORDER",message:o.message,next:[{cmd:R,why:`${o.earliest} is the earliest uncommitted phase for ${a}`,title:`Start at ${o.earliest}`}]}),n?.release(),2}}}let w=!!(t.force||n?.state.force),I=!!(t.resume&&n),$=rt(i,a,w||I||M);if(!$.ok){let s=(t.mode??"interactive")==="interactive";if($.wall&&s&&t.askDesignEntry){let{captureForceScope:l}=await import("./design-committer-D44GSUXY.js"),m=l(i,a).length,o=await t.askDesignEntry({wall:$.wall.kind,message:$.message,display:$.wall.display,impactPairs:m});if(o.pick==="redesign"||o.pick==="proceed"){if(!o.because.trim())return e.out("a redesign needs a reason (--because) \u2014 nothing executed"),n?.release(),2;e.out(o.pick==="redesign"?`redesigning ${$.wall.display} (${m} pair(s) superseded, with any typed blocker gaps standing in for their tests) \u2014 because: ${o.because.trim()}`:`proceeding against the stale design (noted) \u2014 because: ${o.because.trim()}`),t={...t,force:!0,because:t.because??o.because.trim()},w=!0}else return o.pick==="view"?(e.out(`view the existing design: kane-cli context view ${$.wall.display}`),n?.release(),0):o.pick==="refresh"?(e.out(`refresh it first: kane-cli maintain evolve ${$.wall.display}`),n?.release(),0):(e.out("nothing executed \u2014 list use-cases: kane-cli context list"),n?.release(),0)}else{e.out(`design: ${$.message}`);let l=$.wall&&t.mode==="agent"?[{cmd:`kane-cli context view ${$.wall.display}`,why:"view the existing design",title:"View the design"},...$.wall.kind==="designed-stale"?[{cmd:`kane-cli maintain evolve ${$.wall.display}`,why:"the use-case moved since the design \u2014 evolve refreshes it",title:"Evolve the design"}]:[],{cmd:`kane-cli design tests --use-case ${$.wall.display} --force --mode agent`,why:"redesign \u2014 supersedes the live scenario+test pairs",title:"Redesign"}]:void 0;return e.emit?.({type:"gate_refused",message:$.message,...l?{next:l}:{}}),n?.release(),$.code}}if(e.preflightTurn){let s=await e.preflightTurn();if(!s.ok)return e.out(s.message??"error: turn-endpoint preflight failed"),e.emit?.({type:"error",message:s.message??"error: turn-endpoint preflight failed",code:"PREFLIGHT"}),n?.release(),2}let D={contextDir:e.contextDir,resolveAlias:s=>We(s,{env:process.env,auth:e.auth}),embed:(s,l)=>Ke(s,l,{env:process.env,auth:e.auth})};e.chat?.setWorking?.("assembling context\u2026");let A=Be(Me(ce(e.contextDir))),q=[],C=await yt(e.contextDir,a,{max:t.max,strength:t.strength,embedSearch:D,variablesIndex:A});if(t.priorDesign!==void 0&&(C.prior_design=t.priorDesign),t.changeDelta!==void 0&&(C.change_delta=t.changeDelta),t.because&&(C.because=t.because),k!==void 0){let{buildPhaseSeed:s}=await import("./phase-seed-MKHEWUN6.js"),l=s(e.contextDir,i,a,k);C.prior_design===void 0&&l.priorDesign!==void 0&&(C.prior_design=l.priorDesign),C.entry_phase=k,l.phaseLadder.length>0&&(C.phase_ladder=l.phaseLadder)}let P=e.now?.()??new Date,K=`${P.toISOString().replace(/[-:]/g,"").slice(0,15)}-${Qt(2).toString("hex")}`,E=t.mode??"interactive",B=E==="interactive"&&!!e.chat&&!e.nested,f=c?{...c.spawnConfig,mode:E}:$t(C,{session_id:t.resume??`design-${K}`,mode:E,ucCid:C.usecase.cid,readBasis:i.latestHash,topology:Ze("design")}),g={current:null};if(f.resume&&"schema"in f.resume){let s=f.resume.binding?.template_version;typeof s=="string"&&(g.current=s,e.onTemplateVersion?.(s))}t.plan?f.chat=!1:f.chat=!0;let d=e.telemetry?.enabled?e.telemetry:void 0,v=d?Se(d.ids.context_instance_id??null,"design",d.ids.session_id):ke(e.contextDir,"logs",`design-${K}.log`);Wt(ce(v),{recursive:!0}),B||e.out(`trace: ${X(v)}`),e.emit?.({type:"run_start",mode:E,trace:v,use_case:a,...d?{session:d.ids.session_id}:{}});let S=(s,l,m)=>{try{Kt(v,JSON.stringify({ts:new Date().toISOString(),level:s==="error"?"error":"info",run_id:d?.ids.operation_id,...d?{user_session_id:d.ids.session_id}:{},kind:s,session_id:m,data:l})+`
362
- `)}catch{}d?.wireTrace(s,l,m)};{let s=e.out;if(s[Rt]!==!0){let l=m=>{S("transcript",{line:m}),s(m)};l[Rt]=!0,e.out=l}}if(t.resume&&n){c||(f.resume={agent_state:n.state.agent_state}),e.out(`resuming design session ${t.resume}`),n.state.assumed.length>0&&e.out(`note: ${n.state.assumed.length} default(s) were assumed while you were away \u2014 kane-cli context sessions show ${t.resume} lists them`);try{let{readRecords:s}=await import("./records-LMCVKPE5.js"),l=s(e.contextDir).records.filter(m=>m.sid===t.resume).map(m=>m.design_phase).filter(m=>m!=null&&typeof m.phase=="string");if(l.length>0){let m=l.map(p=>`${p.phase}${p.completeness==="partial"?" (partial)":""}`).join(" \u2192 "),o=`[kane] durable record for this session (${t.resume}) on ${a}: design phases already COMMITTED \u2014 ${m}. Those finalizes landed; do not re-send them. Continue from the next uncommitted phase, or finish if the design is complete.`;e={...e,initialMessage:[e.initialMessage,o].filter(Boolean).join(`
363
-
364
- `)}}}catch{}t.message&&(e={...e,initialMessage:[e.initialMessage,t.message].filter(Boolean).join(`
365
-
366
- `)})}{let s=Zt(t,e.initialMessage,f.session_id);if(s.error)return e.out(s.error),e.emit?.({type:"error",message:s.error,code:"MESSAGE_TOO_LARGE"}),n?.release(),2;s.initialMessage!==e.initialMessage&&(e={...e,initialMessage:s.initialMessage})}let F=null,L={current:i},Z={detach:null},H=()=>{let s=Z.detach;Z.detach=null,s&&s()},ee=(s,l)=>{let m=n;if(!m)return{};let o=s.ask,p=Xe({contextDir:s.contextDir,cwd:ce(s.contextDir),handle:m,note:y=>s.chat?s.chat.note(y):s.out(y),graphSlot:l,...s.now?{now:s.now}:{}});if(s.chat?.attachIngest){let y=s.chat;Z.detach=y.attachIngest(async R=>{try{m.save({ingest_registry:he(m.state.ingest_registry,R,s.now?.()??new Date)});let N=await p({id:`attach-${m.state.sid}-${(m.state.ingest_registry??[]).length}`,ref:R,purpose:null});return N.ok?(y.deferBatch({source_id:N.result.source_id,cid:N.result.cid}),{ok:!0}):{ok:!1,error:N.error.message}}catch(N){return{ok:!1,error:N instanceof Error?N.message:String(N)}}})}return{ask:async y=>{let R=await o(y);if(Array.isArray(R)){let N=R.filter(O=>{if(O.free_text==null||O.free_text.trim()==="")return!1;let J=y.find(At=>At.id===O.id);return O.selected_index!=null&&J?.options[O.selected_index]?.input===!0}).map(O=>O.free_text.trim());if(N.length>0){let O=m.state.ingest_registry;for(let J of N)O=he(O,J,s.now?.()??new Date);m.save({ingest_registry:O})}}return R},ingest:p}};e.nested||e.chat?.attachOnCommitted?.(s=>{L.current=s});let G="";if(e.chat&&!t.plan&&!e.nested){let s=Qe({contextDir:e.contextDir,graph:V(e.contextDir),sessionStamp:f.session_id,by:e.by??{kind:"human",id:"owner"}});s.errors===null||s.errors[0]?.code==="CONV_SOURCE_EXISTS"?(G=s.sourceId,e.chat.attachConversationSource?.(G),L.current=V(e.contextDir)):e.out(`warning: notes you add in chat can't be saved to the context this session (${s.errors[0]?.detail})`)}let z=V(e.contextDir),Q;if(!t.plan){let s=Ue(z,a);if(I&&s!==null&&s.live){let l=z.resolve(a);Q={uc_root:Ve(z,l.cid),next_gen:s.gen,expected_prev_gen:s.gen}}else{let l=He(z,a,{...w?{force:!0}:{},because:t.because??(w?"forced redesign (--force)":void 0)});if("error"in l)return e.out(`design: ${l.error.detail}`),e.emit?.({type:"gate_refused",message:l.error.detail,code:l.error.code}),n?.release(),2;Q=l}}let te=Oe(e.contextDir,f.session_id),ie=null,Y=()=>{try{ie?.release()}catch{}};if(!t.plan)try{ie=te.acquire([Pe(z,a).key],{hold:"session",verb:"design"})}catch(s){if(s instanceof Ie&&s.code==="UC_HELD"){let l=s.holder,m=`design: ${a} is being designed by another session${l?.alive===!1?` \u2014 that session looks stopped; resume it with kane-cli design tests --resume ${l?.owner_sid??"<session>"}`:""} \u2014 pick another use-case (kane-cli design tests) or wait for it to finish`;return e.out(m),e.emit?.({type:"error",code:"UC_HELD",message:m}),n?.release(),2}throw s}let re={contextDir:e.contextDir,rootSid:f.session_id,locks:te,probe:{batchSimilar:async()=>({hits:[],degraded:!1,probeBasis:null}),recheckLocal:()=>({hits:[],uncachedNewNodes:[]})}},r=!t.plan&&E!=="ci",u=()=>Object.fromEntries((i.resolve(a)?i.edgesInto(i.resolve(a).tip):[]).filter(s=>s.type==="DERIVES"&&typeof s.props.source_id=="string").map(s=>[String(s.props.source_id),i.heads.get(String(s.props.source_id))??null])),_=!1;r&&!n&&(_=!0,n=de(e.contextDir,{sid:f.session_id,mode:"agent",created_at:P.toISOString(),expires_at:new Date(P.getTime()+1440*60*1e3).toISOString(),agent_state:{schema:2,items:[],provider_state:""},pending:{questions:[],proposals:[]},read_basis:u(),assumed:[],corpus_cursor:{remaining:[]},conv_source:G,target_pins:i.resolve(a)?[{ref:a,cid:i.resolve(a).tip}]:[],verb:"design",use_case:a,...i.resolve(a)?.tip?{uc_tip:i.resolve(a).tip}:{},...w?{force:!0}:{},...d?{user_session_id:d.ids.session_id}:{}}));let h;if(r&&n){let{resume:s,...l}=f;Fe(e.contextDir,f.session_id,{schema:Ge,kind:"base",sid:f.session_id,verb:"design",mode:E,created_at:P.toISOString(),run_config:l,conv_source:G||n.state.conv_source||"",...a?{use_case:a}:{},...i.resolve(a)?.tip?{uc_tip:i.resolve(a).tip}:{},store_watermark:Ne(e.contextDir)}),f.checkpoints=!0,t.resume&&S("resume_kind",{kind:c?c.view.pointer===null?"bare-base":c.view.pointer.at==="final"?"pause":"crash":"v1-shim"},f.session_id);let m=c?0:n.state.checkpoint?.seq??0,o=n;h=tt({contextDir:e.contextDir,handle:o,seqBase:()=>m,peekHeldReceipts:()=>e.chat?.peekHeldReceipts?.()??[],readBasis:()=>u(),corpusCursor:()=>({remaining:[]}),onSoftCap:y=>e.out(y),onStat:y=>S("ckpt_stat",y,f.session_id),...e.now?{now:e.now}:{}});let p=h;h={...p,persist:y=>{let R=y.binding?.template_version;return typeof R=="string"&&R&&(g.current=R,e.onTemplateVersion?.(R)),p.persist(y)}}}!r&&!t.plan&&(f.checkpoints=!0,h={persist:s=>{let l=s.binding?.template_version;return typeof l=="string"&&l&&(g.current=l,e.onTemplateVersion?.(l)),{seq:s.seq,turn_id:s.turn_id,at:s.at,ts:new Date().toISOString(),full_seq:null}}});let T=()=>{if(!n)return;let s=n.state.checkpoint;if(s){let l=E!=="interactive"?` --mode ${E}`:"";e.out(`session ${n.state.sid} kept its last checkpoint (seq ${s.seq}, ${s.ts}) \u2014 resume with: kane-cli design tests --resume ${n.state.sid}${l}`),n.release()}else if(_){try{n.complete()}catch{n.release()}try{Et(ke(e.contextDir,"sessions"))}catch{}}else n.release();n=null};n?.state.force_scope?.length&&e.onForceScope?.(n.state.force_scope);let x=t.plan?Jt(e.out,e.emit,S,v):Dt({templateVersion:()=>g.current,contextDir:e.contextDir,ucRef:a,by:{kind:"ai",id:"design-agent"},force:w,engine:"design@1",note:s=>e.chat?e.chat.note(s):e.out(s),commitLine:s=>e.chat?e.chat.ledger({kind:"commit",ok:!0,line:s}):e.out(s),steer:e.chat?s=>e.chat.submit(s):void 0,event:e.emit,variablesIndex:()=>A,onVariablesDeclared:s=>{q.push(...s);for(let l of s)A.set(l.name,{has_value:!1,source:l.file})},resuming:I,...n?.state.force_scope?.length?{forceScope:n.state.force_scope}:{},onForceScope:s=>{F=s,e.onForceScope?.(s)},...t.because?{because:t.because}:{},aliases:e.chat?s=>e.chat.registerAliases?.(s):void 0,onCommitted:s=>{L.current=s},protocol:re,...Q?{generationTicket:Q}:{},...I?{generationStamped:!0}:{}});e.chat||(S("design_budget",{max_pairs:C.budget.max_pairs??null,strength:C.budget.strength_override??null}),e.out(`designing: ${C.usecase.logical_id??a}`)),e.chat?.setWorking?.(`designing ${C.usecase.logical_id??a}\u2026`);let b;try{b=await fe(f,{...e,graphSlot:L,...ee(e,L),...h?{checkpoint:h}:{}},new Map,i,S,x)}catch(s){throw S("error",{message:s instanceof Error?s.message:String(s),stack:s instanceof Error?s.stack:void 0},f.session_id),T(),s}finally{e.chat?.setWorking?.(null),H()}if(b.errorCode==="binding_mismatch"&&c){let s=await e.ask([{id:"binding-mismatch",text:"this session's saved conversation is no longer accepted by the service \u2014 start the conversation fresh (committed work is kept), or stop and keep the session?",risk:"high",rationale:"the service refused the saved conversation on the first turn after resume",options:[{label:"start fresh",detail:"continue with a fresh conversation \u2014 earlier answers may be re-asked"},{label:"stop",detail:"stop here; the session stays resumable"}],recommended_index:1,allow_free_text:!1}]);if((Array.isArray(s)?s.find(o=>o.id==="binding-mismatch"):void 0)?.selected_index!==0){let o=`resume abandoned: binding mismatch on session ${f.session_id} \u2014 the session is preserved`;return e.out(o),e.emit?.({type:"error",message:o,code:"BINDING_MISMATCH"}),n?.release(),2}S("binding_migrate",{sid:f.session_id},f.session_id);let m=f.resume&&"schema"in f.resume?{...f.resume,binding:{}}:void 0;try{b=await fe({...f,...m?{resume:m}:{}},{...e,graphSlot:L,...ee(e,L),...h?{checkpoint:h}:{}},new Map,i,S,x)}catch(o){throw S("error",{message:o instanceof Error?o.message:String(o),stack:o instanceof Error?o.stack:void 0},f.session_id),T(),o}finally{e.chat?.setWorking?.(null),H()}}if(b.highRisk)return e.out(`error: ${b.highRisk.length} high-risk decision${b.highRisk.length===1?"":"s"} need a human \u2014 ci mode won't guess. Re-run with --mode agent to pause for review.`),e.emit?.({type:"error",message:`error: high-risk question(s) in ci mode (fail-closed): ${b.highRisk.map(s=>s.id).join(", ")}`,code:"HIGH_RISK_CI"}),T(),Y(),1;if(b.paused){let s=n;s||(s=de(e.contextDir,{sid:f.session_id,mode:"agent",created_at:P.toISOString(),expires_at:new Date(P.getTime()+1440*60*1e3).toISOString(),agent_state:b.paused.agent_state,pending:{questions:[],proposals:[]},read_basis:Object.fromEntries((i.resolve(a)?i.edgesInto(i.resolve(a).tip):[]).filter(o=>o.type==="DERIVES"&&typeof o.props.source_id=="string").map(o=>[String(o.props.source_id),i.heads.get(String(o.props.source_id))??null])),assumed:[],corpus_cursor:{remaining:[]},conv_source:G,target_pins:i.resolve(a)?[{ref:a,cid:i.resolve(a).tip}]:[],verb:"design",use_case:a,...i.resolve(a)?.tip?{uc_tip:i.resolve(a).tip}:{},...w?{force:!0}:{},...d?{user_session_id:d.ids.session_id}:{}}));try{w&&!s.state.force&&s.save({force:!0}),d&&s.state.user_session_id!==d.ids.session_id&&s.save({user_session_id:d.ids.session_id}),G&&s.state.conv_source!==G&&s.save({conv_source:G});let o=e.chat?.drainHeldReceipts?.()??[];(o.length>0||(s.state.held_receipts?.length??0)>0)&&s.save({held_receipts:o}),F!==null&&s.save({force_scope:F}),et(s,b.paused)}catch(o){let p=s.state.checkpoint,y=`error: couldn't persist the pause for session ${s.state.sid}`+(p?` \u2014 last durable checkpoint: seq ${p.seq} @ ${p.ts}`:" \u2014 no durable checkpoint exists")+` (${o instanceof Error?o.message:String(o)})`;return e.out(y),e.emit?.({type:"error",message:y,code:"PAUSE_PERSIST_FAILED",sid:s.state.sid}),1}S("session_paused",{sid:s.state.sid},f.session_id);let l=E!=="interactive"?` --mode ${E}`:"",m=`kane-cli design tests --resume ${s.state.sid}${l}`;if(B||e.out(`paused \u2014 resume with: ${m}`),e.emit?.({type:"session_paused",sid:s.state.sid,mode:E,resume:m,expires_at:s.state.expires_at,pending_questions:b.paused.pending.questions}),B){let o=e.chat?.state.credits?.total;e.onSummary?.({state:"paused",reason:"ctrl+c",facts:[`session ${s.state.sid} saved \u2014 designing ${C.usecase.logical_id??a}`,...s.state.expires_at?[`expires: ${s.state.expires_at}`]:[],...o!==void 0?[`credits used: ${o.toFixed(1)}`]:[]],resume:m,resumeMessage:`${m} --message "<your words>"`,tracePath:X(v)})}return Y(),3}if(b.crashed&&n?.state.checkpoint){let s=n.state.checkpoint,l=E!=="interactive"?` --mode ${E}`:"",m=`kane-cli design tests --resume ${n.state.sid}${l}`;if(S("agent_crashed_resumable",{sid:n.state.sid,seq:s.seq},f.session_id),B||e.out(`agent crashed \u2014 session ${n.state.sid} is resumable at checkpoint seq ${s.seq} (at most the in-flight turn lost); resume with: ${m}`),e.emit?.({type:"session_paused",sid:n.state.sid,mode:E,resume:m,expires_at:n.state.expires_at,crashed:!0}),B){let o=e.chat?.state.credits?.total;e.onSummary?.({state:"crashed",facts:[`agent crashed \u2014 session ${n.state.sid} is resumable at checkpoint seq ${s.seq}`,"at most the in-flight turn was lost",...o!==void 0?[`credits used: ${o.toFixed(1)}`]:[]],resume:m,resumeMessage:`${m} --message "<your words>"`,tracePath:X(v)})}return n.release(),n=null,3}if(b.error)return e.out(`error: design agent failed: ${b.error}`),e.emit?.({type:"error",message:`error: design agent failed: ${b.error}`}),T(),Y(),1;if(b.proposal==null&&E!=="interactive")return e.out(`error: the design session stopped before saving anything \u2014 nothing committed (trace: ${v})`),e.emit?.({type:"error",message:`error: the design session stopped before saving anything \u2014 nothing committed (trace: ${v})`}),T(),Y(),1;let j=0;if(b.proposal==null)try{let{readRecords:s}=await import("./records-LMCVKPE5.js"),l=t.resume??f.session_id;j=s(e.contextDir).records.filter(m=>m.sid===l).reduce((m,o)=>m+o.nodes.filter(p=>p.label!=="source").length,0)}catch{}if(b.proposal==null&&e.out(j>0?`done \u2014 ${j} item(s) committed in this session (earlier legs included); nothing new since the resume`:"done \u2014 nothing designed this session (no finalize before the session ended)"),b.assumedDefaults&&e.out(`assumed: ${b.assumedDefaults} default(s) taken while unattended`),n&&e.emit?.({type:"session_complete",sid:t.resume??f.session_id}),d?.event("ASR_SESSION_COMPLETE",{}),n?.complete(),_)try{Et(ke(e.contextDir,"sessions"))}catch{}if(q.length>0){let s=es(q,ce(e.contextDir));e.chat?e.chat.note(s):e.out(s),e.emit?.({type:"variables_summary",file:q[0].file,variables:q.map(({name:l,description:m,secret:o})=>({name:l,description:m,secret:o}))})}if(B){let s=e.chat.state.ledger.filter(o=>o.kind==="answer"&&o.receipt.form==="assumed").length??0,l=(b.assumedDefaults??0)+s,m=e.chat.state.credits?.total??b.creditsTotal;e.onSummary?.({state:"complete",facts:[`designed: ${C.usecase.logical_id??a}${b.proposal==null?j>0?` (${j} item(s) committed across this session)`:" (nothing committed this session)":""}`,...q.length>0?[`${q.length} variable(s) need values \u2014 see .testmuai/variables/assurance.json`]:[],...l>0?[`${l} assumed default(s)`]:[],...m!==void 0?[`credits used: ${m.toFixed(1)}`]:[]],tracePath:X(v)})}return t.plan||nt(e.contextDir),Y(),0}function es(t,e){if(t.length===0)return"";let i=Yt(e,t[0].file)||t[0].file,n=Math.max(...t.map(a=>a.name.length))+3,c=t.slice().sort((a,k)=>a.name<k.name?-1:1).map(a=>` ${a.name.padEnd(n)}${a.description}${a.secret?" (secret)":""}`);return`variables declared this session \u2014 fill their values before running:
367
- ${i}
368
- ${c.join(`
369
- `)}
370
- `}export{Ct as a,Xt as b,Zt as c,un as d,es as e};