@testmuai/kane-cli 0.10.0 → 0.10.2

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 (397) hide show
  1. package/dist/ChatSurface-FIYDTZSI.js +2 -0
  2. package/dist/{ChromeProfilePicker-FWPUDKD6.js → ChromeProfilePicker-Q6FIGVYU.js} +1 -1
  3. package/dist/{CliFeedbackPrompt-D5L2DO6A.js → CliFeedbackPrompt-2NV2G65E.js} +1 -1
  4. package/dist/{CliUploadProgress-HQX57WE6.js → CliUploadProgress-JZ5FXODE.js} +1 -1
  5. package/dist/{ConfigView-DGQXKEON.js → ConfigView-TZ4YINOE.js} +1 -1
  6. package/dist/EvidenceViewOffer-LKPN5BHX.js +2 -0
  7. package/dist/FolderPicker-H5K74PCH.js +2 -0
  8. package/dist/InfoBox-DNSOAK5L.js +2 -0
  9. package/dist/{LinksBox-WZ4RAMSH.js → LinksBox-32TZOANP.js} +1 -1
  10. package/dist/{ProfilesView-AGRNPGSW.js → ProfilesView-UC4MPM54.js} +1 -1
  11. package/dist/ProjectPicker-ZJ5RW6XL.js +2 -0
  12. package/dist/SaveSessionPrompt-F327WC7A.js +2 -0
  13. package/dist/SingleShotApp-OMLRYOSI.js +2 -0
  14. package/dist/{SummaryBox-XQJUZBAN.js → SummaryBox-XGFO5X76.js} +1 -1
  15. package/dist/TestMdRunView-ZZ77QTAQ.js +2 -0
  16. package/dist/TestrunEvidenceTable-G7MPF55X.js +2 -0
  17. package/dist/{WhoamiView-JQCURK2M.js → WhoamiView-4XIJXMTU.js} +1 -1
  18. package/dist/{app-download-OU6AGH2X.js → app-download-XEDO3EMV.js} +1 -1
  19. package/dist/{assurance-job-ZI3L6I4F.js → assurance-job-MD65GQLC.js} +1 -1
  20. package/dist/{auth-7Z54TMQQ.js → auth-WBIEHHDS.js} +1 -1
  21. package/dist/{binary-S5YL5GJD.js → binary-NVYLR36K.js} +1 -1
  22. package/dist/{bind-LIV72SEZ.js → bind-H3ALI2NG.js} +1 -1
  23. package/dist/{bootstrap-3V6TOO6I.js → bootstrap-JEVSVPQ2.js} +1 -1
  24. package/dist/bridge-2UHJOVLX.js +2 -0
  25. package/dist/{catalog-I3PC6LT6.js → catalog-5UYBWA4W.js} +1 -1
  26. package/dist/{catalog-client-WKYG3JN6.js → catalog-client-VVKV4JKW.js} +1 -1
  27. package/dist/{changelog-IHNWFYWY.js → changelog-FPWJXERY.js} +1 -1
  28. package/dist/chat-committer-ZKEKJA2R.js +2 -0
  29. package/dist/chat-controller-FXRJXUG3.js +2 -0
  30. package/dist/child-JHYENXE7.js +2 -0
  31. package/dist/{chunk-URAYFJGM.js → chunk-226AGYHB.js} +1 -1
  32. package/dist/{chunk-ZTAZ2R5Z.js → chunk-23DKB2MT.js} +1 -1
  33. package/dist/{chunk-JGLADDRH.js → chunk-2COXO5LQ.js} +1 -1
  34. package/dist/{chunk-TZVPDGJD.js → chunk-2GEAKFAV.js} +1 -1
  35. package/dist/{chunk-45URQUAK.js → chunk-2QKBXRLI.js} +1 -1
  36. package/dist/{chunk-AG5XJWEV.js → chunk-2ULYGALF.js} +1 -1
  37. package/dist/{chunk-G3J4XY3Z.js → chunk-32HED7X2.js} +1 -1
  38. package/dist/{chunk-GRURFGBP.js → chunk-32MFECUA.js} +1 -1
  39. package/dist/{chunk-N3KTLWJL.js → chunk-35BG2EMW.js} +1 -1
  40. package/dist/{chunk-KDR662D2.js → chunk-3KY7HHQU.js} +1 -1
  41. package/dist/{chunk-ZGQM6KWN.js → chunk-3V4J65GN.js} +1 -1
  42. package/dist/{chunk-DBTMKBHU.js → chunk-3YIA3DSL.js} +1 -1
  43. package/dist/{chunk-VVCZRCRD.js → chunk-44SIFDNY.js} +1 -1
  44. package/dist/{chunk-Z5BFCTHI.js → chunk-45NM23EQ.js} +2 -2
  45. package/dist/{chunk-I2MC6VVX.js → chunk-4C7WVQOD.js} +1 -1
  46. package/dist/{chunk-3UHPVQLU.js → chunk-4HARMERK.js} +1 -1
  47. package/dist/{chunk-A3TCFSCK.js → chunk-4HYPMGDF.js} +1 -1
  48. package/dist/{chunk-7KX2BHKG.js → chunk-4KCYNP2K.js} +1 -1
  49. package/dist/{chunk-FVYIV36L.js → chunk-4LGQHTXM.js} +1 -1
  50. package/dist/{chunk-WKZLK57W.js → chunk-4NEPHIAO.js} +1 -1
  51. package/dist/{chunk-YYVBE6W2.js → chunk-54NJJVG5.js} +1 -1
  52. package/dist/{chunk-3OVFKUXV.js → chunk-5F44KH3R.js} +1 -1
  53. package/dist/{chunk-WERIGVOH.js → chunk-5F5IVART.js} +1 -1
  54. package/dist/{chunk-FBQ7PQJV.js → chunk-5KJU4MG4.js} +1 -1
  55. package/dist/{chunk-D6CS62O7.js → chunk-5MFPQYW3.js} +1 -1
  56. package/dist/{chunk-ZI3X7DI2.js → chunk-5WLXAQ4H.js} +1 -1
  57. package/dist/{chunk-RFEON5GN.js → chunk-5XVWT6UK.js} +1 -1
  58. package/dist/{chunk-5IO5ZC4S.js → chunk-6CS23F3E.js} +1 -1
  59. package/dist/{chunk-DTYT6KBO.js → chunk-6JUS2ULI.js} +1 -1
  60. package/dist/{chunk-HMQ5M4JJ.js → chunk-6LEHGRRG.js} +1 -1
  61. package/dist/{chunk-5R3ODQHH.js → chunk-6SD4XTYC.js} +1 -1
  62. package/dist/{chunk-Y3YULFCK.js → chunk-6SWHEBPR.js} +1 -1
  63. package/dist/{chunk-BY2B4YJN.js → chunk-6YBH3WUW.js} +1 -1
  64. package/dist/{chunk-X3J4CC27.js → chunk-73HMW2WA.js} +1 -1
  65. package/dist/{chunk-PQXYHI5W.js → chunk-75FF7J5R.js} +1 -1
  66. package/dist/{chunk-JTJ7IPNI.js → chunk-7DLDADQR.js} +1 -1
  67. package/dist/{chunk-J4LQAT5P.js → chunk-7LYLJ75Z.js} +1 -1
  68. package/dist/{chunk-XLQ4F6BI.js → chunk-7O2FIZB7.js} +2 -2
  69. package/dist/{chunk-UUWSULIM.js → chunk-7PCLHURF.js} +3 -3
  70. package/dist/{chunk-FLOQ5NZL.js → chunk-7XJNYLQW.js} +1 -1
  71. package/dist/{chunk-3ZPEQDXZ.js → chunk-7ZR5CQY3.js} +1 -1
  72. package/dist/{chunk-CJQUVHHS.js → chunk-A474TUCE.js} +1 -1
  73. package/dist/chunk-A4ZV2SHL.js +5 -0
  74. package/dist/{chunk-RDH3E25Q.js → chunk-A7IMHUFY.js} +2 -2
  75. package/dist/{chunk-EVZLINBN.js → chunk-ABMM37L2.js} +1 -1
  76. package/dist/{chunk-QECTIQAC.js → chunk-AUSLHNXQ.js} +1 -1
  77. package/dist/{chunk-4MNSP4EO.js → chunk-B226SFOV.js} +1 -1
  78. package/dist/{chunk-2L3A5NKZ.js → chunk-B57ZRHEQ.js} +1 -1
  79. package/dist/{chunk-2PZKMT3I.js → chunk-BHQIH2FE.js} +1 -1
  80. package/dist/{chunk-4SJAOAYY.js → chunk-BJT6PZXL.js} +1 -1
  81. package/dist/{chunk-YKOEABP2.js → chunk-C6P6YUCR.js} +1 -1
  82. package/dist/chunk-CB344EDO.js +2 -0
  83. package/dist/chunk-CCOD4GQJ.js +2 -0
  84. package/dist/{chunk-CJE7PKRV.js → chunk-CQDCNP7V.js} +1 -1
  85. package/dist/{chunk-EPJ5SJL2.js → chunk-D4QXYAYA.js} +2 -2
  86. package/dist/{chunk-CBVHP7JB.js → chunk-DLP5S3TO.js} +1 -1
  87. package/dist/{chunk-EH43VWVR.js → chunk-DXIQVBMI.js} +1 -1
  88. package/dist/chunk-DXLZCJH5.js +7 -0
  89. package/dist/{chunk-WZLDFEWR.js → chunk-E4GIGM5V.js} +1 -1
  90. package/dist/{chunk-JOCEZK2M.js → chunk-EAWU2TOG.js} +1 -1
  91. package/dist/{chunk-G3CYFCSR.js → chunk-EEOAU43D.js} +1 -1
  92. package/dist/{chunk-MYZHOBS4.js → chunk-EHB55V23.js} +1 -1
  93. package/dist/{chunk-OR2B6T3B.js → chunk-ENRFXGID.js} +1 -1
  94. package/dist/{chunk-JT6WLJSV.js → chunk-ET5EK2CM.js} +1 -1
  95. package/dist/{chunk-HGVM2OZU.js → chunk-EZMRWXRT.js} +1 -1
  96. package/dist/{chunk-QMOGBKJM.js → chunk-FAMQ4DHU.js} +1 -1
  97. package/dist/{chunk-GGV336P5.js → chunk-FI2DVNRT.js} +1 -1
  98. package/dist/{chunk-AUJSC7PU.js → chunk-FNUGDPTS.js} +1 -1
  99. package/dist/{chunk-MPEIMWQI.js → chunk-FOLUB336.js} +1 -1
  100. package/dist/{chunk-4JWJH6TB.js → chunk-FYPIF3BE.js} +1 -1
  101. package/dist/{chunk-HHW6MRU3.js → chunk-G4K3TP2I.js} +1 -1
  102. package/dist/{chunk-P2ZQDQDB.js → chunk-GAKBHNC4.js} +1 -1
  103. package/dist/{chunk-DPGOAFKF.js → chunk-GBQ4K25P.js} +1 -1
  104. package/dist/{chunk-PCDIEYV6.js → chunk-GEZVC4S3.js} +1 -1
  105. package/dist/{chunk-UX2CDUPE.js → chunk-GJ7MO2FW.js} +2 -2
  106. package/dist/{chunk-PL3SG3M2.js → chunk-GJXO6FF7.js} +1 -1
  107. package/dist/{chunk-252GEI3H.js → chunk-GLM5UGTF.js} +1 -1
  108. package/dist/{chunk-JCSVBD4F.js → chunk-GQARXS6F.js} +1 -1
  109. package/dist/{chunk-NTXFPNAP.js → chunk-GT3JDX5H.js} +1 -1
  110. package/dist/{chunk-RARD6TC6.js → chunk-GZQAETB2.js} +1 -1
  111. package/dist/{chunk-TLOYTGVT.js → chunk-H4TIVILC.js} +1 -1
  112. package/dist/{chunk-7C4IEL5V.js → chunk-HG2ILWCE.js} +1 -1
  113. package/dist/{chunk-2SY2NCOP.js → chunk-HHOVANJ7.js} +1 -1
  114. package/dist/{chunk-DHYGCHKB.js → chunk-HM6LZ2KM.js} +1 -1
  115. package/dist/{chunk-NJCN6LP5.js → chunk-HNF3PWF3.js} +6 -6
  116. package/dist/{chunk-P2LDAW3C.js → chunk-HVOXMCKE.js} +1 -1
  117. package/dist/{chunk-JSLKCCD2.js → chunk-HWPWCCEV.js} +1 -1
  118. package/dist/{chunk-XMALVGH7.js → chunk-HX5OLRKU.js} +2 -2
  119. package/dist/{chunk-4I7YN6YY.js → chunk-HYJVYYAZ.js} +2 -2
  120. package/dist/{chunk-2N75WO7Y.js → chunk-I52NWH4U.js} +1 -1
  121. package/dist/{chunk-3T2TYDPT.js → chunk-IB5WG5YY.js} +1 -1
  122. package/dist/{chunk-6DZ7LVOG.js → chunk-IH73ZCBB.js} +1 -1
  123. package/dist/{chunk-SBR6D6GS.js → chunk-IT5JVCZN.js} +1 -1
  124. package/dist/{chunk-GGS3ATPB.js → chunk-IZ66FKPC.js} +1 -1
  125. package/dist/{chunk-EX6ORR7P.js → chunk-JNPFEBUR.js} +1 -1
  126. package/dist/{chunk-AU26ZZTX.js → chunk-JTNEF5ZP.js} +1 -1
  127. package/dist/{chunk-K2PLULJD.js → chunk-JUVY6PHY.js} +1 -1
  128. package/dist/{chunk-JQ7ZZQXC.js → chunk-K4K2BGQC.js} +3 -3
  129. package/dist/{chunk-VZA7BPCK.js → chunk-K75WIRI5.js} +1 -1
  130. package/dist/{chunk-4R4YUOVY.js → chunk-KKLCXRW6.js} +1 -1
  131. package/dist/{chunk-YGMQXS2J.js → chunk-KN7GZWKK.js} +1 -1
  132. package/dist/{chunk-I2VU2DTS.js → chunk-L3BUPFAQ.js} +4 -4
  133. package/dist/{chunk-2GE5X2A5.js → chunk-LLQWEGXD.js} +1 -1
  134. package/dist/chunk-LTPOMMAB.js +2 -0
  135. package/dist/{chunk-AUBSLPJZ.js → chunk-LWCP4GLY.js} +1 -1
  136. package/dist/{chunk-VQZOKTJ2.js → chunk-LXCTV75T.js} +1 -1
  137. package/dist/{chunk-YH4VZVHJ.js → chunk-LZGAFKYH.js} +1 -1
  138. package/dist/{chunk-3QICDXY5.js → chunk-LZPYIFHZ.js} +1 -1
  139. package/dist/{chunk-WQR2GYP7.js → chunk-M3TFOFUQ.js} +1 -1
  140. package/dist/{chunk-MKPDF26Q.js → chunk-M7Y5GGVJ.js} +1 -1
  141. package/dist/{chunk-52VCA4K2.js → chunk-MEMXFTLD.js} +1 -1
  142. package/dist/{chunk-U7NRZBB5.js → chunk-MINDIQET.js} +1 -1
  143. package/dist/{chunk-JX5NVKTV.js → chunk-MP6NCJFE.js} +1 -1
  144. package/dist/{chunk-VA3BSIUQ.js → chunk-MSYRAPDK.js} +1 -1
  145. package/dist/{chunk-HJLMH7ZM.js → chunk-MUX2A37P.js} +1 -1
  146. package/dist/{chunk-EQWMOGLO.js → chunk-NCP54AIQ.js} +2 -2
  147. package/dist/{chunk-QQI6N3FO.js → chunk-NVD2MXHQ.js} +1 -1
  148. package/dist/{chunk-2EVP636F.js → chunk-O2Y46A3G.js} +3 -3
  149. package/dist/{chunk-ONZ2CSTZ.js → chunk-O3TXAMFW.js} +1 -1
  150. package/dist/{chunk-YI4ESDAX.js → chunk-O5KTMDTH.js} +1 -1
  151. package/dist/{chunk-HBVHIEPB.js → chunk-OK6NLITG.js} +1 -1
  152. package/dist/{chunk-JFBEHCJN.js → chunk-OKA6FPJM.js} +1 -1
  153. package/dist/{chunk-65BG6GAE.js → chunk-OVNTCBNS.js} +1 -1
  154. package/dist/{chunk-4523YDTG.js → chunk-P4VFC6HO.js} +1 -1
  155. package/dist/{chunk-ULGBK4NS.js → chunk-PC22QRIY.js} +1 -1
  156. package/dist/{chunk-B2WFW74J.js → chunk-PEUIHME2.js} +1 -1
  157. package/dist/{chunk-Z777GGHB.js → chunk-PI7OXS62.js} +1 -1
  158. package/dist/{chunk-MHB6DMKZ.js → chunk-POA336CU.js} +1 -1
  159. package/dist/{chunk-ZZNQIFFI.js → chunk-PR5EGLEI.js} +1 -1
  160. package/dist/{chunk-MW2WNYJO.js → chunk-PRBWZXFA.js} +2 -2
  161. package/dist/{chunk-4BUEOKFV.js → chunk-PWNYTIVA.js} +1 -1
  162. package/dist/{chunk-FYCD765R.js → chunk-Q4JV4U65.js} +58 -58
  163. package/dist/{chunk-BRVIK3BU.js → chunk-Q5AKIQIE.js} +1 -1
  164. package/dist/{chunk-EC5IP5HZ.js → chunk-QB77LRF4.js} +1 -1
  165. package/dist/{chunk-AGXAJ2II.js → chunk-QUNIY6NN.js} +1 -1
  166. package/dist/{chunk-LHQUCRCH.js → chunk-QVMXL675.js} +1 -1
  167. package/dist/{chunk-FPPVNF53.js → chunk-R6TFRAMZ.js} +1 -1
  168. package/dist/{chunk-567D5ZTO.js → chunk-RAVAJZV2.js} +7 -7
  169. package/dist/{chunk-7ZJWUWSN.js → chunk-RDAIOJCR.js} +1 -1
  170. package/dist/{chunk-PBWYQR5I.js → chunk-RRKYHUOD.js} +1 -1
  171. package/dist/{chunk-GXMD23XB.js → chunk-S7XCOBYD.js} +1 -1
  172. package/dist/{chunk-32Y6QVFG.js → chunk-SALZ6WSF.js} +1 -1
  173. package/dist/{chunk-4NUSW4A2.js → chunk-SIHX5FW5.js} +1 -1
  174. package/dist/{chunk-USJ3LUAL.js → chunk-SSOUYKVG.js} +1 -1
  175. package/dist/{chunk-2B75UL7Y.js → chunk-SVIIUKJ2.js} +1 -1
  176. package/dist/{chunk-QVP4FSKT.js → chunk-T77LTLAD.js} +1 -1
  177. package/dist/{chunk-KRRZCY7U.js → chunk-TAY7J5VS.js} +1 -1
  178. package/dist/chunk-TD6GCEIK.js +2 -0
  179. package/dist/{chunk-ZY65IZJR.js → chunk-TM6VLC6V.js} +1 -1
  180. package/dist/{chunk-YKL5H4K6.js → chunk-TMH4TPMB.js} +1 -1
  181. package/dist/{chunk-COJINPOK.js → chunk-TU2KPOW2.js} +2 -2
  182. package/dist/{chunk-3BSYOCSW.js → chunk-U2VYTVKV.js} +1 -1
  183. package/dist/{chunk-W3NWHWK2.js → chunk-UCVP7ZY4.js} +1 -1
  184. package/dist/{chunk-436FZ4KG.js → chunk-UICJ2KLJ.js} +1 -1
  185. package/dist/{chunk-QWZJ5QDO.js → chunk-UMNCM4RJ.js} +1 -1
  186. package/dist/{chunk-LNHBZEDC.js → chunk-UWPG5MWM.js} +1 -1
  187. package/dist/{chunk-MJKRJGER.js → chunk-V3OZJO7Y.js} +1 -1
  188. package/dist/{chunk-ZKPY3AXW.js → chunk-VE4HLIGA.js} +1 -1
  189. package/dist/{chunk-K3OSK6PB.js → chunk-W2HRX3DR.js} +1 -1
  190. package/dist/{chunk-B7JLM3IX.js → chunk-W54BX6HC.js} +1 -1
  191. package/dist/{chunk-IZ65ZPWY.js → chunk-W5HFUBXD.js} +1 -1
  192. package/dist/{chunk-GRO6DLN3.js → chunk-WEJR2V7R.js} +1 -1
  193. package/dist/{chunk-A4BB6GLN.js → chunk-X3A4QPA3.js} +1 -1
  194. package/dist/{chunk-G2KTWFMU.js → chunk-X52YIWGG.js} +1 -1
  195. package/dist/{chunk-UEPJ26X2.js → chunk-X6FCXBXU.js} +1 -1
  196. package/dist/{chunk-LXM7VHYN.js → chunk-X7S7IGCV.js} +1 -1
  197. package/dist/{chunk-UNWPBMVM.js → chunk-XCUF5AVM.js} +1 -1
  198. package/dist/{chunk-FPVGA6XT.js → chunk-XHFU5TGS.js} +1 -1
  199. package/dist/{chunk-ZRDX2ARO.js → chunk-XNXJXGVB.js} +2 -2
  200. package/dist/{chunk-JRSEAXFE.js → chunk-XZ6J3Y2W.js} +1 -1
  201. package/dist/{chunk-JGRXMTME.js → chunk-YDB72F4K.js} +1 -1
  202. package/dist/{chunk-7DFBOVUB.js → chunk-YJAQZMJT.js} +1 -1
  203. package/dist/{chunk-GYDJO32R.js → chunk-YO6SNXBJ.js} +1 -1
  204. package/dist/{chunk-RLOJH5O6.js → chunk-Z24SD2EJ.js} +1 -1
  205. package/dist/{chunk-ENG2UTMX.js → chunk-Z36KVIRR.js} +1 -1
  206. package/dist/{chunk-PTISAIZW.js → chunk-Z6SI7YNV.js} +1 -1
  207. package/dist/{chunk-6NFOH4AC.js → chunk-ZAQGIC33.js} +1 -1
  208. package/dist/{chunk-AIGQCMGY.js → chunk-ZCL7XIVS.js} +1 -1
  209. package/dist/{chunk-ORNVIEUA.js → chunk-ZDCXWEQG.js} +1 -1
  210. package/dist/{chunk-WX4VGH5Q.js → chunk-ZDQYGLCZ.js} +1 -1
  211. package/dist/{chunk-6TNLITJO.js → chunk-ZHAMVLQZ.js} +1 -1
  212. package/dist/{chunk-H4KPNGY4.js → chunk-ZMWTRXFH.js} +1 -1
  213. package/dist/{chunk-GET4DINR.js → chunk-ZO3ZAMUU.js} +1 -1
  214. package/dist/{chunk-GI2JPIX5.js → chunk-ZZZGTDYE.js} +1 -1
  215. package/dist/commands-R5AYK6XM.js +2 -0
  216. package/dist/{committer-26UZDYSA.js → committer-UO3B3S5Y.js} +1 -1
  217. package/dist/{config-B472DZSR.js → config-YMHI3H3Y.js} +1 -1
  218. package/dist/cover-cmd-DVQIGFDY.js +2 -0
  219. package/dist/{credentials-TLT3RQOO.js → credentials-BCR73VGS.js} +1 -1
  220. package/dist/{deps-bundle-CMTIWBS5.js → deps-bundle-6WLX44OA.js} +1 -1
  221. package/dist/{deps-resolve-XLFZK74A.js → deps-resolve-DSAKPZ3T.js} +1 -1
  222. package/dist/{design-chat-I7X3QDDY.js → design-chat-YUI2JPO6.js} +1 -1
  223. package/dist/design-committer-7YIPFKMO.js +2 -0
  224. package/dist/design-headless-KIP6R7UV.js +2 -0
  225. package/dist/{design-remote-UDC5FP45.js → design-remote-XMSHDDUX.js} +2 -2
  226. package/dist/device-env-K7J5NN66.js +2 -0
  227. package/dist/dispatch-BV6XMCN3.js +2 -0
  228. package/dist/{doctor-UHFCIM4B.js → doctor-PGTNOMSP.js} +1 -1
  229. package/dist/{docx-convert-N4KMLLKO.js → docx-convert-DO5AQYD3.js} +1 -1
  230. package/dist/{dossier-6KMKEIXV.js → dossier-5XKNAK6Q.js} +1 -1
  231. package/dist/evidence-RO3RDZXO.js +2 -0
  232. package/dist/evidence-presentation-LSFOZGLH.js +2 -0
  233. package/dist/evolve-cmd-U2ALVGMT.js +2 -0
  234. package/dist/evolve-remote-K2MCCVMM.js +2 -0
  235. package/dist/{explain-cmd-R67B4YR3.js → explain-cmd-KNDORU2D.js} +1 -1
  236. package/dist/{explain-cmd-235TY7QX.js → explain-cmd-UWK5YVXG.js} +1 -1
  237. package/dist/explore-S2BGQUIF.js +2 -0
  238. package/dist/{explore-context-tty-YXEFT32U.js → explore-context-tty-WJHUSP3A.js} +1 -1
  239. package/dist/{explore-entry-V6L5FSP4.js → explore-entry-3EX2T3NS.js} +4 -4
  240. package/dist/{explore-live-N5VBLBUI.js → explore-live-TRY5A2ME.js} +1 -1
  241. package/dist/{explore-run-tty-ZZQ33GNA.js → explore-run-tty-ZV5XFKZA.js} +2 -2
  242. package/dist/{extract-bind-BTINHHE5.js → extract-bind-TXUBMK3T.js} +3 -3
  243. package/dist/extract-chat-VPYDGQKO.js +2 -0
  244. package/dist/{extract-cmd-45OZETCM.js → extract-cmd-YUOYMVF5.js} +2 -2
  245. package/dist/extract-headless-UWTAPOET.js +2 -0
  246. package/dist/{feeder-L55TH2NC.js → feeder-NGWIPZ26.js} +1 -1
  247. package/dist/folder-flags-WV7UV3JG.js +2 -0
  248. package/dist/gaps-cmd-PFV3FZCM.js +3 -0
  249. package/dist/gate-7ALXLCNB.js +2 -0
  250. package/dist/gate-NB5CJMTN.js +2 -0
  251. package/dist/{generate-headless-DAH3HHRQ.js → generate-headless-KMBBZTLS.js} +2 -2
  252. package/dist/hold-passthrough-JGHWMYDM.js +2 -0
  253. package/dist/{impact-cmd-3VFJAKYK.js → impact-cmd-PW33L5RF.js} +2 -2
  254. package/dist/index.js +4154 -190
  255. package/dist/ingest-ZHHHBUXR.js +2 -0
  256. package/dist/{ingest-cmd-YSEH5EPU.js → ingest-cmd-MXYILQLV.js} +3 -3
  257. package/dist/ingest-remote-2EEJP6ML.js +2 -0
  258. package/dist/install-7J34AYB6.js +2 -0
  259. package/dist/{interactive-bind-P3GTFIZM.js → interactive-bind-FDWJUTI6.js} +4 -4
  260. package/dist/{interactive-remote-PBRQHTAF.js → interactive-remote-O2Q2FNOH.js} +1 -1
  261. package/dist/lane-CNGO7LH5.js +2 -0
  262. package/dist/lattice-auth-TXNDLHM6.js +2 -0
  263. package/dist/{lifecycle-cmd-PUNFWKV5.js → lifecycle-cmd-GFHDBRXX.js} +1 -1
  264. package/dist/{list-cmd-RD7YBF4S.js → list-cmd-RR75PMPE.js} +1 -1
  265. package/dist/{list-commands-UZELZAB3.js → list-commands-3QGZWJ5P.js} +1 -1
  266. package/dist/{list-remote-KGKXPCQA.js → list-remote-AA3VSWOI.js} +1 -1
  267. package/dist/{locks-cmd-LXZ6I4QG.js → locks-cmd-AZKCSGHI.js} +1 -1
  268. package/dist/{logical-ids-D5PFYY4C.js → logical-ids-74PLU3VR.js} +1 -1
  269. package/dist/login-flow-ZQ6UFTS2.js +2 -0
  270. package/dist/{maintenance-cmd-WRWBCP3R.js → maintenance-cmd-OHGVARQ2.js} +1 -1
  271. package/dist/{mobile-prompts-Z7NQHRGP.js → mobile-prompts-FZRKLLTN.js} +1 -1
  272. package/dist/{objective-variable-gate-3Z7DNVVC.js → objective-variable-gate-V5HHFOUS.js} +1 -1
  273. package/dist/{onboarding-ZP4XDYEO.js → onboarding-NXGMV3VG.js} +1 -1
  274. package/dist/open-provider-XDJKT3W3.js +2 -0
  275. package/dist/pdf-convert-YB6PJFMI.js +2 -0
  276. package/dist/persist-recorded-session-INFN4JZT.js +3 -0
  277. package/dist/phase-seed-ZZSJME7M.js +2 -0
  278. package/dist/pipeline-MVZRI6YZ.js +2 -0
  279. package/dist/{policy-commands-TY6WOR73.js → policy-commands-3YJ6YCDN.js} +1 -1
  280. package/dist/{prepare-target-EVL2QSXA.js → prepare-target-DII5WZCX.js} +1 -1
  281. package/dist/{pull-cmd-QJQANBAW.js → pull-cmd-XZN53XFZ.js} +1 -1
  282. package/dist/{pull-route-AIOTLA3D.js → pull-route-R33BVADE.js} +1 -1
  283. package/dist/readmodel-TRV4E3MW.js +2 -0
  284. package/dist/real-device-run-DGENHGUV.js +2 -0
  285. package/dist/{reconcile-cmd-IJTQAJZX.js → reconcile-cmd-KFPRCCJB.js} +4 -4
  286. package/dist/reconcile-deps-UDQBWSLE.js +2 -0
  287. package/dist/{reconcile-remote-23D6SXXT.js → reconcile-remote-6WISFGRG.js} +2 -2
  288. package/dist/{recording-banner-MNRMMEX4.js → recording-banner-XOX2CDCF.js} +1 -1
  289. package/dist/registry-NV3EMDMK.js +2 -0
  290. package/dist/remote-entry-BCTFT643.js +2 -0
  291. package/dist/{remote-mode-AFNCN6EE.js → remote-mode-4HN27MD4.js} +1 -1
  292. package/dist/{remote-words-RCNFI2TQ.js → remote-words-LFDYKIZ7.js} +1 -1
  293. package/dist/{require-project-folder-7UH43GHI.js → require-project-folder-ZK4JJCDB.js} +1 -1
  294. package/dist/{resolve-run-intent-XEWFYMGN.js → resolve-run-intent-LYLVNNDZ.js} +1 -1
  295. package/dist/{resolver-QMPX6RBR.js → resolver-RMHGGYRP.js} +1 -1
  296. package/dist/revert-QKHPCRT6.js +2 -0
  297. package/dist/{review-cmd-2OECKNL5.js → review-cmd-UGF2FC5Y.js} +1 -1
  298. package/dist/run-CSYGVV3D.js +2 -0
  299. package/dist/run-YUHHD54J.js +2 -0
  300. package/dist/{run-channel-63SVP5OI.js → run-channel-IIIYXOIW.js} +1 -1
  301. package/dist/run-remote-BGKQDAOA.js +2 -0
  302. package/dist/{run-startup-gate-USQFSW47.js → run-startup-gate-4XE73OON.js} +1 -1
  303. package/dist/run-test-md-G6U3RU2Q.js +19 -0
  304. package/dist/session-worker.js +2 -2
  305. package/dist/{sessions-CFV7FOIT.js → sessions-NH2EG7BP.js} +1 -1
  306. package/dist/{sessions-cmd-LQ2LZQOC.js → sessions-cmd-CABAX7BO.js} +2 -2
  307. package/dist/{sessions-remote-H7CQST42.js → sessions-remote-Y4FTZL7Y.js} +1 -1
  308. package/dist/{skill-installer-LKYY6XFJ.js → skill-installer-FS2AV7GX.js} +1 -1
  309. package/dist/spawner-MQ4XEHIX.js +2 -0
  310. package/dist/{store-KM5MG3XB.js → store-PLKJZTGC.js} +1 -1
  311. package/dist/store-choice-UAB6Z4AL.js +2 -0
  312. package/dist/{store-guard-34GG2TW2.js → store-guard-DUN2X3SR.js} +1 -1
  313. package/dist/{store-site-ZSFINU6C.js → store-site-K5NHLI7D.js} +1 -1
  314. package/dist/stream-warnings-GM7YEOVG.js +2 -0
  315. package/dist/sync-cmd-AGTOGPYM.js +2 -0
  316. package/dist/{sync-setup-QQXYO6R4.js → sync-setup-4KIY3PDO.js} +1 -1
  317. package/dist/tcg-generate-CUY4AZ2V.js +2 -0
  318. package/dist/testmd-actions-UD6PAWUX.js +2 -0
  319. package/dist/{testmd-sync-PQ4GFKHB.js → testmd-sync-EEJ7GPLR.js} +1 -1
  320. package/dist/token-refresh-K6PVBBFE.js +2 -0
  321. package/dist/{trust-gate-AT2XBWN4.js → trust-gate-674C2NZS.js} +1 -1
  322. package/dist/{turn-preflight-LHYLRL7G.js → turn-preflight-R4PU6NYY.js} +1 -1
  323. package/dist/{use-case-ref-NA3IXGQW.js → use-case-ref-44BPIP4N.js} +1 -1
  324. package/dist/{validate-basic-3DX3MMC7.js → validate-basic-3JZRZL45.js} +1 -1
  325. package/dist/{variable-receipt-BXSZO36E.js → variable-receipt-7PRKDTRJ.js} +1 -1
  326. package/dist/verdicts-PVB7TV5S.js +2 -0
  327. package/dist/{version-check-OV6AOVED.js → version-check-IY3YSQIP.js} +1 -1
  328. package/dist/{view-cmd-QDKBBNIU.js → view-cmd-WUIGTRFX.js} +1 -1
  329. package/dist/{walk-session-BAYYPIKN.js → walk-session-EH7227WR.js} +1 -1
  330. package/dist/with-telemetry-7JMZUBUZ.js +2 -0
  331. package/package.json +16 -16
  332. package/dist/ChatSurface-XUV3EQPZ.js +0 -2
  333. package/dist/EvidenceViewOffer-EIANIYN7.js +0 -2
  334. package/dist/FolderPicker-XOA7FTHF.js +0 -2
  335. package/dist/InfoBox-OBH7SUGC.js +0 -2
  336. package/dist/ProjectPicker-6KRLKV4U.js +0 -2
  337. package/dist/SaveSessionPrompt-J2OPDEOO.js +0 -2
  338. package/dist/SingleShotApp-QI4B2TSL.js +0 -2
  339. package/dist/TestMdRunView-I4MV54FB.js +0 -2
  340. package/dist/TestrunEvidenceTable-WEIUSW3E.js +0 -2
  341. package/dist/bridge-SDEP7Y33.js +0 -2
  342. package/dist/chat-committer-FM5NG46O.js +0 -2
  343. package/dist/chat-controller-FWFQVZTB.js +0 -2
  344. package/dist/child-H2YSDFCG.js +0 -2
  345. package/dist/chunk-34R7BNZ2.js +0 -2
  346. package/dist/chunk-5T6II7VN.js +0 -7
  347. package/dist/chunk-KF4DKXSS.js +0 -2
  348. package/dist/chunk-NOFJXCYP.js +0 -5
  349. package/dist/chunk-SB6P5EQH.js +0 -2
  350. package/dist/commands-QOORPTSI.js +0 -2
  351. package/dist/cover-cmd-3VO6QC5Y.js +0 -2
  352. package/dist/design-committer-Y7R56RFZ.js +0 -2
  353. package/dist/design-headless-HUQOXLZB.js +0 -2
  354. package/dist/device-env-MMGISNHN.js +0 -2
  355. package/dist/dispatch-P2445PUU.js +0 -2
  356. package/dist/evidence-M3JTOJNL.js +0 -2
  357. package/dist/evidence-presentation-DV3DRB4S.js +0 -2
  358. package/dist/evolve-cmd-K3JXACMN.js +0 -2
  359. package/dist/evolve-remote-CUDVV2O2.js +0 -2
  360. package/dist/explore-UDD5FHXW.js +0 -2
  361. package/dist/extract-chat-ABZ5S7UU.js +0 -2
  362. package/dist/extract-headless-ALEFAMVS.js +0 -2
  363. package/dist/folder-flags-HTKJCXKB.js +0 -2
  364. package/dist/gaps-cmd-ROGQWK5X.js +0 -3
  365. package/dist/gate-QA5J7UZA.js +0 -2
  366. package/dist/gate-XFFFX5ZF.js +0 -2
  367. package/dist/hold-passthrough-K5PP26CP.js +0 -2
  368. package/dist/ingest-S5R736ZV.js +0 -2
  369. package/dist/ingest-remote-C6AP2Q7E.js +0 -2
  370. package/dist/install-B26Y2NU4.js +0 -2
  371. package/dist/lane-7IEAE6AC.js +0 -2
  372. package/dist/lattice-auth-7EL4ET3P.js +0 -2
  373. package/dist/login-flow-CHLGQGHK.js +0 -2
  374. package/dist/open-provider-U26BBVUE.js +0 -2
  375. package/dist/pdf-convert-LMKOKLXT.js +0 -2
  376. package/dist/persist-recorded-session-4IRYG5CJ.js +0 -3
  377. package/dist/phase-seed-2H6OXZXT.js +0 -2
  378. package/dist/pipeline-U7D25NST.js +0 -2
  379. package/dist/readmodel-KXCFPL2M.js +0 -2
  380. package/dist/real-device-run-QODMDUXF.js +0 -2
  381. package/dist/reconcile-deps-2CTIFXDR.js +0 -2
  382. package/dist/registry-MZYBLEW2.js +0 -2
  383. package/dist/remote-entry-DW2J56N4.js +0 -2
  384. package/dist/revert-37346WLE.js +0 -2
  385. package/dist/run-JWOHNWA3.js +0 -2
  386. package/dist/run-QFJ6ZRVD.js +0 -2
  387. package/dist/run-remote-66QTUQ2M.js +0 -2
  388. package/dist/run-test-md-7DRWCSQE.js +0 -19
  389. package/dist/spawner-C7NLLM4F.js +0 -2
  390. package/dist/store-choice-4J2NN6OQ.js +0 -2
  391. package/dist/stream-warnings-N4KVVWXV.js +0 -2
  392. package/dist/sync-cmd-3CHSWWWW.js +0 -2
  393. package/dist/tcg-generate-IPD5FQUW.js +0 -2
  394. package/dist/testmd-actions-V7P7BMKE.js +0 -2
  395. package/dist/token-refresh-LR33BKAB.js +0 -2
  396. package/dist/verdicts-7GKZEDHV.js +0 -2
  397. package/dist/with-telemetry-62LW4VFI.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as d,g as B,k as re}from"./chunk-CB4ARIHR.js";import{a as te}from"./chunk-4IEQNX7F.js";import{fb as ee}from"./chunk-Z777GGHB.js";import{a as Z}from"./chunk-7DFBOVUB.js";import{g as A}from"./chunk-4I7YN6YY.js";import{createHash as ve,randomBytes as F}from"crypto";import{mkdirSync as ke,mkdtempSync as P,rmSync as $,existsSync as Oe,renameSync as Re}from"fs";import{tmpdir as j}from"os";import{join as _,dirname as de}from"path";import{spawn as ie}from"child_process";function N(n,e=process.env){let t=n.replace(/https?:\/\/[^\s/@]+:[^\s/@]+@/gi,"https://[redacted]@").replace(/(authorization\s*[:=])[^\r\n]+/gi,"$1 [redacted]"),r=e.KANE_SYNC_GIT_TOKEN;if(r)for(let i of[r,Buffer.from(`x-access-token:${r}`).toString("base64")])t=t.split(i).join("[redacted]");return t}function Ae(n,e){if(n.GIT_SSH_COMMAND)return ne(n.GIT_SSH_COMMAND);if(!n.GIT_SSH)return e?ne(e):"ssh -o BatchMode=yes"}function ne(n){return/(^|\s)-o\s*BatchMode=yes(\s|$)/.test(n)?n:`${n} -o BatchMode=yes`}var Ce=/^(?:ssh:\/\/|[^/\s@:]+@[^/\s:]+:)/i,se=new Map;function Ne(n,e){let t=[e??"",n.GIT_CONFIG_GLOBAL??"",n.HOME??""].join("\0"),r=se.get(t);return r===void 0&&(r=ae(["config","--get","core.sshCommand"],n,e,12e4).then(i=>i.code===0&&i.stdout.toString().trim()||void 0,()=>{}),se.set(t,r)),r}var oe=new Set(["fetch","push","clone","ls-remote"]);function xe(n,e,t){if(t!==void 0)return t;if(!n.some(i=>oe.has(i)))return 12e4;let r=e.KANE_SYNC_GIT_TRANSFER_TIMEOUT_SECONDS;if(r!==void 0){if(!/^\d+$/.test(r)||Number(r)<60||Number(r)>3600)throw new Error("KANE_SYNC_GIT_TRANSFER_TIMEOUT_SECONDS must be 60 to 3600");return Number(r)*1e3}return 9e5}function Ie(n){if(n.some(t=>/^(--force(?:-with-lease|-if-includes)?(?:=|$)|--mirror(?:=|$)|--delete(?:=|$)|-f$)/.test(t)))throw new Error("Git location cannot force, mirror or delete");let e=n.indexOf("push");if(e>=0){let t=n.slice(e+1);if(t.length!==3||t[0]!=="--porcelain"||!/^[0-9a-f]{40,64}:refs\/(heads|kane\/probe)\/[A-Za-z0-9._/-]+$/.test(t[2]))throw new Error("Git location requires an exact commit SHA and explicit ref")}}var H=async(n,e={})=>{Ie(n);let t={...process.env,...e.env};for(let h of["GIT_DIR","GIT_WORK_TREE","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_CONFIG_PARAMETERS"])delete t[h];e.env?.GIT_INDEX_FILE&&(t.GIT_INDEX_FILE=e.env.GIT_INDEX_FILE);let r=[["core.autocrlf","false"],["core.eol","lf"],["core.symlinks","false"],["core.hooksPath","/dev/null"],["gc.autoDetach","false"],["gc.pruneExpire","3.days.ago"],["maintenance.auto","false"],["push.followTags","false"],["push.gpgSign","false"],["commit.gpgSign","false"]],i=t.KANE_SYNC_GIT_HTTP_POST_BUFFER;if(i!==void 0){if(!/^\d+$/.test(i)||Number(i)<1048576||Number(i)>536870912)throw new Error("KANE_SYNC_GIT_HTTP_POST_BUFFER must be 1048576 to 536870912 bytes; use it only for a proxy that rejects chunked uploads");r.push(["http.postBuffer",i])}for(let h of Object.keys(t))h.startsWith("GIT_TRACE")&&delete t[h];let s=n.find(h=>h.startsWith("https://"));if(t.KANE_SYNC_GIT_TOKEN&&s){let h=new URL(s);r.push([`http.${h.origin}${h.pathname}.extraheader`,""],[`http.${h.origin}${h.pathname}.extraheader`,`AUTHORIZATION: basic ${Buffer.from(`x-access-token:${t.KANE_SYNC_GIT_TOKEN}`).toString("base64")}`],["credential.helper",""])}for(let h of Object.keys(t))/^GIT_CONFIG_(COUNT|KEY_\d+|VALUE_\d+)$/.test(h)&&delete t[h];let a=!t.GIT_SSH_COMMAND&&!t.GIT_SSH&&n.some(h=>oe.has(h))&&n.some(h=>Ce.test(h))?await Ne({...t},e.cwd):void 0;r.forEach(([h,u],g)=>{t[`GIT_CONFIG_KEY_${g}`]=h,t[`GIT_CONFIG_VALUE_${g}`]=u}),t.GIT_CONFIG_COUNT=String(r.length),t.GIT_TERMINAL_PROMPT="0",t.GCM_INTERACTIVE="never",t.GIT_ASKPASS="",t.SSH_ASKPASS="";let c=Ae(t,a);return c!==void 0&&(t.GIT_SSH_COMMAND=c),t.GIT_NO_REPLACE_OBJECTS="1",ae(n,t,e.cwd,xe(n,t,e.timeout),e.input)};function ae(n,e,t,r,i){return new Promise((s,o)=>{let a=ie("git",n,{cwd:t,env:e,windowsHide:!0,detached:process.platform!=="win32",stdio:["pipe","pipe","pipe"]}),c=[],h=0,u="",g=!1,w=()=>{if(process.platform==="win32"&&a.pid)ie("taskkill",["/pid",String(a.pid),"/t","/f"],{windowsHide:!0,stdio:"ignore"}).on("error",()=>a.kill("SIGKILL"));else try{a.pid&&process.kill(-a.pid,"SIGKILL")}catch{a.kill("SIGKILL")}},S=setTimeout(()=>{g=!0,w()},r);a.stdout.on("data",l=>{h+=l.length,h>128*1024*1024?w():c.push(l)}),a.stderr.on("data",l=>{u.length<64e3&&(u+=l.toString())}),a.stdin.on("error",()=>{}),a.on("error",l=>{clearTimeout(S),o(new d("SYNC_GIT_REQUIRED",`Git could not start: ${N(l.message,e)}`,"Install Git 2.31 or newer, then run the command again: https://git-scm.com/downloads"))}),a.on("close",l=>{clearTimeout(S),s({code:g||h>128*1024*1024?124:l??1,stdout:Buffer.concat(c),stderr:N(g?"Git operation timed out":u,e)})}),a.stdin.end(i)})}async function ce(n=H){let e=await n(["--version"],{timeout:1e4}),t=/git version (\d+)\.(\d+)/.exec(e.stdout.toString());if(e.code||!t||+t[1]<2||+t[1]==2&&+t[2]<31)throw new d("SYNC_GIT_REQUIRED","This location needs Git 2.31 or newer.","Install or update Git, then run setup again: https://git-scm.com/downloads")}function he(n){let e=/^([^/@:]+)@([^/:]+):/.exec(n);if(e)return{user:e[1],host:e[2]};try{let t=new URL(n);return{host:t.hostname||"the server",user:t.username||"git",port:t.port||void 0}}catch{return{host:"the server",user:"git"}}}function yt(n){let e=/^[^/@:]+@([^/:]+):/.exec(n);if(e)return e[1].toLowerCase();try{return new URL(n).hostname.toLowerCase()}catch{return""}}function Y(n,e){let{host:t,user:r,port:i}=he(e),s=N(n).trim().split(`
2
+ import{a as d,g as B,k as re}from"./chunk-CB4ARIHR.js";import{a as te}from"./chunk-4IEQNX7F.js";import{fb as ee}from"./chunk-PI7OXS62.js";import{a as Z}from"./chunk-YJAQZMJT.js";import{g as A}from"./chunk-HYJVYYAZ.js";import{createHash as ve,randomBytes as F}from"crypto";import{mkdirSync as ke,mkdtempSync as P,rmSync as $,existsSync as Oe,renameSync as Re}from"fs";import{tmpdir as j}from"os";import{join as _,dirname as de}from"path";import{spawn as ie}from"child_process";function N(n,e=process.env){let t=n.replace(/https?:\/\/[^\s/@]+:[^\s/@]+@/gi,"https://[redacted]@").replace(/(authorization\s*[:=])[^\r\n]+/gi,"$1 [redacted]"),r=e.KANE_SYNC_GIT_TOKEN;if(r)for(let i of[r,Buffer.from(`x-access-token:${r}`).toString("base64")])t=t.split(i).join("[redacted]");return t}function Ae(n,e){if(n.GIT_SSH_COMMAND)return ne(n.GIT_SSH_COMMAND);if(!n.GIT_SSH)return e?ne(e):"ssh -o BatchMode=yes"}function ne(n){return/(^|\s)-o\s*BatchMode=yes(\s|$)/.test(n)?n:`${n} -o BatchMode=yes`}var Ce=/^(?:ssh:\/\/|[^/\s@:]+@[^/\s:]+:)/i,se=new Map;function Ne(n,e){let t=[e??"",n.GIT_CONFIG_GLOBAL??"",n.HOME??""].join("\0"),r=se.get(t);return r===void 0&&(r=ae(["config","--get","core.sshCommand"],n,e,12e4).then(i=>i.code===0&&i.stdout.toString().trim()||void 0,()=>{}),se.set(t,r)),r}var oe=new Set(["fetch","push","clone","ls-remote"]);function xe(n,e,t){if(t!==void 0)return t;if(!n.some(i=>oe.has(i)))return 12e4;let r=e.KANE_SYNC_GIT_TRANSFER_TIMEOUT_SECONDS;if(r!==void 0){if(!/^\d+$/.test(r)||Number(r)<60||Number(r)>3600)throw new Error("KANE_SYNC_GIT_TRANSFER_TIMEOUT_SECONDS must be 60 to 3600");return Number(r)*1e3}return 9e5}function Ie(n){if(n.some(t=>/^(--force(?:-with-lease|-if-includes)?(?:=|$)|--mirror(?:=|$)|--delete(?:=|$)|-f$)/.test(t)))throw new Error("Git location cannot force, mirror or delete");let e=n.indexOf("push");if(e>=0){let t=n.slice(e+1);if(t.length!==3||t[0]!=="--porcelain"||!/^[0-9a-f]{40,64}:refs\/(heads|kane\/probe)\/[A-Za-z0-9._/-]+$/.test(t[2]))throw new Error("Git location requires an exact commit SHA and explicit ref")}}var H=async(n,e={})=>{Ie(n);let t={...process.env,...e.env};for(let h of["GIT_DIR","GIT_WORK_TREE","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_CONFIG_PARAMETERS"])delete t[h];e.env?.GIT_INDEX_FILE&&(t.GIT_INDEX_FILE=e.env.GIT_INDEX_FILE);let r=[["core.autocrlf","false"],["core.eol","lf"],["core.symlinks","false"],["core.hooksPath","/dev/null"],["gc.autoDetach","false"],["gc.pruneExpire","3.days.ago"],["maintenance.auto","false"],["push.followTags","false"],["push.gpgSign","false"],["commit.gpgSign","false"]],i=t.KANE_SYNC_GIT_HTTP_POST_BUFFER;if(i!==void 0){if(!/^\d+$/.test(i)||Number(i)<1048576||Number(i)>536870912)throw new Error("KANE_SYNC_GIT_HTTP_POST_BUFFER must be 1048576 to 536870912 bytes; use it only for a proxy that rejects chunked uploads");r.push(["http.postBuffer",i])}for(let h of Object.keys(t))h.startsWith("GIT_TRACE")&&delete t[h];let s=n.find(h=>h.startsWith("https://"));if(t.KANE_SYNC_GIT_TOKEN&&s){let h=new URL(s);r.push([`http.${h.origin}${h.pathname}.extraheader`,""],[`http.${h.origin}${h.pathname}.extraheader`,`AUTHORIZATION: basic ${Buffer.from(`x-access-token:${t.KANE_SYNC_GIT_TOKEN}`).toString("base64")}`],["credential.helper",""])}for(let h of Object.keys(t))/^GIT_CONFIG_(COUNT|KEY_\d+|VALUE_\d+)$/.test(h)&&delete t[h];let a=!t.GIT_SSH_COMMAND&&!t.GIT_SSH&&n.some(h=>oe.has(h))&&n.some(h=>Ce.test(h))?await Ne({...t},e.cwd):void 0;r.forEach(([h,u],g)=>{t[`GIT_CONFIG_KEY_${g}`]=h,t[`GIT_CONFIG_VALUE_${g}`]=u}),t.GIT_CONFIG_COUNT=String(r.length),t.GIT_TERMINAL_PROMPT="0",t.GCM_INTERACTIVE="never",t.GIT_ASKPASS="",t.SSH_ASKPASS="";let c=Ae(t,a);return c!==void 0&&(t.GIT_SSH_COMMAND=c),t.GIT_NO_REPLACE_OBJECTS="1",ae(n,t,e.cwd,xe(n,t,e.timeout),e.input)};function ae(n,e,t,r,i){return new Promise((s,o)=>{let a=ie("git",n,{cwd:t,env:e,windowsHide:!0,detached:process.platform!=="win32",stdio:["pipe","pipe","pipe"]}),c=[],h=0,u="",g=!1,w=()=>{if(process.platform==="win32"&&a.pid)ie("taskkill",["/pid",String(a.pid),"/t","/f"],{windowsHide:!0,stdio:"ignore"}).on("error",()=>a.kill("SIGKILL"));else try{a.pid&&process.kill(-a.pid,"SIGKILL")}catch{a.kill("SIGKILL")}},S=setTimeout(()=>{g=!0,w()},r);a.stdout.on("data",l=>{h+=l.length,h>128*1024*1024?w():c.push(l)}),a.stderr.on("data",l=>{u.length<64e3&&(u+=l.toString())}),a.stdin.on("error",()=>{}),a.on("error",l=>{clearTimeout(S),o(new d("SYNC_GIT_REQUIRED",`Git could not start: ${N(l.message,e)}`,"Install Git 2.31 or newer, then run the command again: https://git-scm.com/downloads"))}),a.on("close",l=>{clearTimeout(S),s({code:g||h>128*1024*1024?124:l??1,stdout:Buffer.concat(c),stderr:N(g?"Git operation timed out":u,e)})}),a.stdin.end(i)})}async function ce(n=H){let e=await n(["--version"],{timeout:1e4}),t=/git version (\d+)\.(\d+)/.exec(e.stdout.toString());if(e.code||!t||+t[1]<2||+t[1]==2&&+t[2]<31)throw new d("SYNC_GIT_REQUIRED","This location needs Git 2.31 or newer.","Install or update Git, then run setup again: https://git-scm.com/downloads")}function he(n){let e=/^([^/@:]+)@([^/:]+):/.exec(n);if(e)return{user:e[1],host:e[2]};try{let t=new URL(n);return{host:t.hostname||"the server",user:t.username||"git",port:t.port||void 0}}catch{return{host:"the server",user:"git"}}}function yt(n){let e=/^[^/@:]+@([^/:]+):/.exec(n);if(e)return e[1].toLowerCase();try{return new URL(n).hostname.toLowerCase()}catch{return""}}function Y(n,e){let{host:t,user:r,port:i}=he(e),s=N(n).trim().split(`
3
3
  `).slice(-2).join(" ").trim();return/Host key verification failed|REMOTE HOST IDENTIFICATION HAS CHANGED/i.test(n)?{code:"SYNC_LOCATION_DENIED",message:`this computer has not accepted ${t}'s SSH host key yet`,remedy:`in a terminal run: ssh -T ${i?`-p ${i} `:""}${r}@${t} and answer yes, then run the command again`,diagnostic:s}:/Permission denied \(publickey/i.test(n)?{code:"SYNC_LOCATION_DENIED",message:`${t} did not accept your SSH key`,remedy:"load it with ssh-add, or ask the repository owner to grant your account access",diagnostic:s}:/could not read Username|Authentication failed|Access denied|Invalid username or (password|token)|returned error: 401|returned error: 403/i.test(n)?{code:"SYNC_LOCATION_DENIED",message:`sign in is needed, or your account has no access to this repository on ${t}`,remedy:"sign in through Git, or ask the owner to grant your account access",diagnostic:s}:/Could not resolve host|Connection refused|Connection timed out|timed out|Network is unreachable|Failed to connect/i.test(n)?{code:"SYNC_LOCATION_UNREACHABLE",message:`${t} could not be reached`,remedy:"check the address and your network, then run the command again",diagnostic:s}:/not found|does not appear to be a git repository|Repository not found/i.test(n)?{code:"SYNC_LOCATION_UNREACHABLE",message:"no repository answered at that address, or your account cannot see it; a private repository looks missing until access is granted",remedy:"check the address, then run the command again",diagnostic:s}:{code:"SYNC_LOCATION_UNREACHABLE",message:`git could not read the repository on ${t}`,remedy:"check the address and your access, then run the command again",...s?{diagnostic:s}:{}}}function M(n,e){return(n.startsWith(e)?n:n.charAt(0).toUpperCase()+n.slice(1))+"."}function wt(n,e){let t=Y(n,e),{host:r}=he(e),i=t.remedy.replace(/,? ?(and )?then run the command again$/,"");return i?`${M(t.message,r)} ${M(i,r)}`:M(t.message,r)}var Pe=Buffer.from(`* -text -filter -ident -working-tree-encoding
4
4
  `),$e="refs/kane/tip",Ge=/unexpected disconnect|hung up unexpectedly|Connection reset|Connection timed out|timed out|Could not resolve host|Failed to connect|RPC failed|Broken pipe|early EOF/i,Ue={GIT_AUTHOR_NAME:"kane-cli context",GIT_AUTHOR_EMAIL:"context@kane-cli.invalid",GIT_COMMITTER_NAME:"kane-cli context",GIT_COMMITTER_EMAIL:"context@kane-cli.invalid"},G=class n{constructor(e){this.options=e;this.exec=e.exec??H,this.prefix=e.prefix?`${e.prefix}/`:"";let t=ve("sha256").update(JSON.stringify([e.url,e.branch,this.prefix])).digest("hex");if(this.repo=_(e.cacheDir??_(A().baseDir,"context-sync","mirrors"),`${t}.git`),this.ref=e.ref??`refs/heads/${e.branch}`,!/^refs\/(heads|kane\/probe)\/[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(this.ref)||this.ref.includes(".."))throw new Error("Invalid Git location ref")}kind="git";contractVersion=1;ceilingTier=1;exec;repo;ref;prefix;ready;tip=null;tree=new Map;async run(e,t={}){let r=await this.exec(["--git-dir",this.repo,...e],t);if(r.code)throw new Error(`Git ${e[0]} failed: ${r.stderr||"unable to read the location"}`);return r.stdout}async transfer(e){let t=await this.exec(["--git-dir",this.repo,...e]);if(t.code){let r=Y(t.stderr||"",this.options.url);throw new d(r.code,r.message,r.remedy,r.diagnostic)}return t.stdout}get name(){return this.options.name??"<name>"}takenRemedy(e){return e===1?`${this.name} holds a different history: to work on it, clone it with kane-cli context clone <descriptor of ${this.name}> <dir>; to share this store, add an empty location`:`kane-cli context pull ${this.name} --rebase`}init(){return this.ready??=(async()=>{if(await ce(this.exec),ke(de(this.repo),{recursive:!0}),!Oe(this.repo)){let e=P(_(de(this.repo),".init-"));try{let t=await this.exec(["init","--bare",e]);if(t.code)throw new Error(`Cannot open Git cache: ${t.stderr}`);try{Re(e,this.repo)}catch(r){if(!["EEXIST","ENOTEMPTY"].includes(r.code??""))throw r}}finally{$(e,{recursive:!0,force:!0})}}if((await this.run(["rev-parse","--is-bare-repository"])).toString().trim()!=="true")throw new Error("The Git cache must be a bare repository");await this.refresh()})()}async refresh(){let t=(await this.transfer(["ls-remote",this.options.url,this.ref])).toString().trim();if(!t){this.tip=null,this.tree=new Map;return}let r=t.split(/\s+/)[0];if(!/^[0-9a-f]{40,64}$/.test(r))throw new Error("Git returned an invalid ref");if(r===this.tip)return;let i=`refs/kane/snapshots/${F(16).toString("hex")}`;await this.transfer(["fetch","--no-tags","--no-write-fetch-head",this.options.url,`${this.ref}:${i}`]);let s=(await this.run(["rev-parse",i])).toString().trim();await this.run(["update-ref",$e,s]),await this.run(["update-ref","-d",i]);let o=await this.readTree(s);this.tip=s,this.tree=o}contextKeys(e){let t=new Map;for(let[r,i]of e)r.startsWith(`${this.prefix}kane-context/`)&&t.set(r,i);return t}async readTree(e){let t=await this.run(["ls-tree","-rz","--full-tree",e]),r=new Map;for(let i of t.toString().split("\0").filter(Boolean)){let s=/^(\d+) (\w+) ([0-9a-f]+)\t([\s\S]+)$/.exec(i);if(!s)throw new Error("Git returned an invalid tree entry");if(s[4].startsWith(`${this.prefix}kane-context/`)&&(s[1]!=="100644"||s[2]!=="blob"))throw new d("SYNC_OBJECT_CORRUPT","Context storage contains a link or non-file object.","Ask the repository owner to restore the original context files.");r.set(s[4],s[3])}return r}key(e){if(!/^[a-zA-Z0-9_~./-]+$/.test(e)||e.split("/").some(t=>!t||t==="."||t===".."||t.toLowerCase()===".git"))throw new Error("Invalid context storage key");return this.prefix+e}async head(e){return await this.init(),this.tree.has(this.key(e))}async get(e){await this.init();let t=this.tree.get(this.key(e));return t?this.run(["cat-file","blob",t]):null}async list(e){return await this.init(),e&&e.replace(/\/$/,"")&&this.key(e.replace(/\/$/,"")),[...this.tree.keys()].filter(t=>t.startsWith(this.prefix+e)).map(t=>t.slice(this.prefix.length)).sort()}async beginTransaction(){await this.init();let e=new Map(this.tree),t=this.tip,r=new Map,i=!1,s=()=>{if(i)throw new Error("Git transaction is closed")},o=async a=>{s();let c=this.key(a),h=r.get(c),u=e.get(c);return h?Buffer.from(h):u?this.run(["cat-file","blob",u]):null};return{get:o,head:async a=>await o(a)!==null,stageIfAbsent:async(a,c)=>{s();let h=this.key(a);if(e.has(h)||r.has(h))return"exists";if(c.length>1e8)throw new d("SYNC_LOCATION_REFUSED_WRITE","A context object is too large for this Git location.","Use an S3 location for this context.");return r.set(h,Buffer.from(c)),"staged"},abort:async()=>{i=!0,r.clear()},commit:async()=>{s();try{if(!r.size)return{created:[]};let a=this.prefix+"kane-context/.gitattributes";e.has(a)||r.set(a,Pe);let c=new Map;for(let[l,m]of r)c.set(l,(await this.run(["hash-object","-w","--no-filters","--stdin"],{input:m})).toString().trim());let h=this.contextKeys(e),u=()=>{this.assertUnchanged(h);for(let[l,m]of this.contextKeys(this.tree))h.set(l,m)},g=!1,w="",S=0;for(let l=0;l<4;l++){u();for(let f of this.tree.keys())if(!(!f.startsWith(this.prefix)||e.has(f)||c.has(f))&&B(f.slice(this.prefix.length))!==null)throw new d("SYNC_BEHIND","the location gained records after this batch was prepared; nothing was published","run kane-cli context pull, then push again");let m=new Map;for(let[f,b]of c){let C=this.tree.get(f);if(C&&C!==b){let R=B(f.slice(this.prefix.length));throw R?new d("SYNC_POSITION_TAKEN",g?`position ${R} on ${this.name} now holds different work; an earlier publication could not be confirmed`:`position ${R} on ${this.name} was published by another writer; this batch was not published`,this.takenRemedy(R)):new d("SYNC_OBJECT_CORRUPT",`existing context object ${f} differs from the intended bytes`,"the object needs a person to look; nothing was published")}C||m.set(f,b)}if(!m.size)return await this.verifyPublication(c),{created:[]};t=this.tip;let x=await this.build(t,m);await this.checkAttributes(x,[...r.keys()]),S++;let E=await this.exec(["--git-dir",this.repo,"push","--porcelain",this.options.url,`${x}:${this.ref}`]),y=N(E.stdout.toString()+`
5
5
  `+E.stderr);w=y.trim();let O=E.code!==0&&/\[rejected\]|\[remote rejected\]/.test(y),p=E.code!==0&&(E.code===124||Ge.test(y));g||=p;try{await this.refresh()}catch{throw new d("SYNC_PUBLICATION_UNKNOWN","we could not confirm whether your context was uploaded; your local work is safe","check the connection and retry; kane-cli compares the published data before writing again")}if(u(),[...c].every(([f,b])=>this.tree.get(f)===b)){await this.verifyPublication(c);let f=E.code===0&&!E.stdout.toString().split(`
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as vt}from"./chunk-2RUSXQ3O.js";import{a as Ot,b as Mt}from"./chunk-PGESS7BW.js";import{a as kt}from"./chunk-FWGUISUG.js";import{b as wt}from"./chunk-CJE7PKRV.js";import{a as Nt,b as Ft,c as St}from"./chunk-GMTHZUZ3.js";import{c as G,e as Rt}from"./chunk-UR6MHSHU.js";var Lt=G(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.CHAR=`
2
+ import{a as vt}from"./chunk-2RUSXQ3O.js";import{a as Ot,b as Mt}from"./chunk-PGESS7BW.js";import{a as kt}from"./chunk-FWGUISUG.js";import{b as wt}from"./chunk-CQDCNP7V.js";import{a as Nt,b as Ft,c as St}from"./chunk-GMTHZUZ3.js";import{c as G,e as Rt}from"./chunk-UR6MHSHU.js";var Lt=G(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.CHAR=`
3
3
  \r -\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}`;x.S=` \r
4
4
  `;x.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";x.NAME_CHAR="-"+x.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";x.CHAR_RE=new RegExp("^["+x.CHAR+"]$","u");x.S_RE=new RegExp("^["+x.S+"]+$","u");x.NAME_START_CHAR_RE=new RegExp("^["+x.NAME_START_CHAR+"]$","u");x.NAME_CHAR_RE=new RegExp("^["+x.NAME_CHAR+"]$","u");x.NAME_RE=new RegExp("^["+x.NAME_START_CHAR+"]["+x.NAME_CHAR+"]*$","u");x.NMTOKEN_RE=new RegExp("^["+x.NAME_CHAR+"]+$","u");var tt=9,et=10,st=13,it=32;x.S_LIST=[it,et,st,tt];function Ne(e){return e>=it&&e<=55295||e===et||e===st||e===tt||e>=57344&&e<=65533||e>=65536&&e<=1114111}x.isChar=Ne;function Fe(e){return e===it||e===et||e===st||e===tt}x.isS=Fe;function Pt(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}x.isNameStartChar=Pt;function Se(e){return Pt(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}x.isNameChar=Se});var Ht=G(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.CHAR="-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}";f.RESTRICTED_CHAR="-\b\v\f-\x7F-\x84\x86-\x9F";f.S=` \r
5
5
  `;f.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";f.NAME_CHAR="-"+f.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";f.CHAR_RE=new RegExp("^["+f.CHAR+"]$","u");f.RESTRICTED_CHAR_RE=new RegExp("^["+f.RESTRICTED_CHAR+"]$","u");f.S_RE=new RegExp("^["+f.S+"]+$","u");f.NAME_START_CHAR_RE=new RegExp("^["+f.NAME_START_CHAR+"]$","u");f.NAME_CHAR_RE=new RegExp("^["+f.NAME_CHAR+"]$","u");f.NAME_RE=new RegExp("^["+f.NAME_START_CHAR+"]["+f.NAME_CHAR+"]*$","u");f.NMTOKEN_RE=new RegExp("^["+f.NAME_CHAR+"]+$","u");var yt=9,It=10,Bt=13,Xt=32;f.S_LIST=[Xt,It,Bt,yt];function we(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}f.isChar=we;function ke(e){return e>=1&&e<=8||e===11||e===12||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159}f.isRestrictedChar=ke;function ve(e){return e===9||e===10||e===13||e>31&&e<127||e===133||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}f.isCharAndNotRestricted=ve;function Oe(e){return e===Xt||e===It||e===Bt||e===yt}f.isS=Oe;function $t(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}f.isNameStartChar=$t;function Me(e){return $t(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}f.isNameChar=Me});var Ut=G(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.NC_NAME_START_CHAR="A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";N.NC_NAME_CHAR="-"+N.NC_NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";N.NC_NAME_START_CHAR_RE=new RegExp("^["+N.NC_NAME_START_CHAR+"]$","u");N.NC_NAME_CHAR_RE=new RegExp("^["+N.NC_NAME_CHAR+"]$","u");N.NC_NAME_RE=new RegExp("^["+N.NC_NAME_START_CHAR+"]["+N.NC_NAME_CHAR+"]*$","u");function Wt(e){return e>=65&&e<=90||e===95||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}N.isNCNameStartChar=Wt;function Pe(e){return Wt(e)||e===45||e===46||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}N.isNCNameChar=Pe});var Ct=G(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.SaxesParser=B.EVENTS=void 0;var X=Lt(),Le=Ht(),xt=Ut(),F=X.isS,ye=X.isChar,W=X.isNameStartChar,Vt=X.isNameChar,ne=X.S_LIST,Ie=X.NAME_RE,Be=Le.isChar,Xe=xt.isNCNameStartChar,$e=xt.isNCNameChar,He=xt.NC_NAME_RE,K="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",We={__proto__:null,xml:K,xmlns:I},Ue={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},C=-1,k=-2,Gt=0,Ve=1,nt=2,Ge=3,P=4,qe=5,je=6,ze=7,rt=8,Ye=9,Qe=10,Ke=11,Ze=12,A=13,q=14,at=15,Je=16,ot=17,ts=18,es=19,ht=20,ss=21,is=22,ns=23,qt=24,lt=25,j=26,jt=27,rs=28,as=29,zt=30,os=31,hs=32,O=33,ls=34,ct=35,U=36,ut=37,cs=38,Yt=39,Qt=40,us=41,Kt=42,ds=43,fs=44,dt=9,w=10,ft=13,Zt=32,Jt=33,re=34,V=38,ae=39,z=45,Y=47,ps=59,v=60,L=61,D=62,T=63,oe=91,y=93,te=133,ee=8232,Q=e=>e===re||e===ae,he=[re,ae],ms=[...he,oe,D],gs=[...he,v,y],xs=[L,T,...ne],Cs=[...ne,D,V,v];function mt(e,t,s){switch(t){case"xml":s!==K&&e.fail(`xml prefix must be bound to ${K}.`);break;case"xmlns":s!==I&&e.fail(`xmlns prefix must be bound to ${I}.`);break;default:}switch(s){case I:e.fail(t===""?`the default namespace may not be set to ${s}.`:`may not assign a prefix (even "xmlns") to the URI ${I}.`);break;case K:switch(t){case"xml":break;case"":e.fail(`the default namespace may not be set to ${s}.`);break;default:e.fail("may not assign the xml namespace to another prefix.")}break;default:}}function _s(e,t){for(let s of Object.keys(t))mt(e,s,t[s])}var Es=e=>He.test(e),Ds=e=>Ie.test(e),M=0,se=1,pt=2;B.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var ie={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"},gt=class{constructor(t){this.opt=t??{},this.fragmentOpt=!!this.opt.fragment;let s=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,s){this.nameStartCheck=Xe,this.nameCheck=$e,this.isName=Es,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},We);let i=this.opt.additionalNamespaces;i!=null&&(_s(this,i),Object.assign(this.ns,i))}else this.nameStartCheck=W,this.nameCheck=Vt,this.isName=Ds,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){var t;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=M,this.attribList=[];let{fragmentOpt:s}=this;this.state=s?A:Gt,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=s,this.xmlDeclPossible=!s,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:i}=this.opt;if(i===void 0){if(this.opt.forceXMLVersion===!0)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");i="1.0"}this.setXMLVersion(i),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(Ue),(t=this.readyHandler)===null||t===void 0||t.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(t,s){this[ie[t]]=s}off(t){this[ie[t]]=void 0}makeError(t){var s;let i=(s=this.fileName)!==null&&s!==void 0?s:"";return this.trackPosition&&(i.length>0&&(i+=":"),i+=`${this.line}:${this.column}`),i.length>0&&(i+=": "),new Error(i+t)}fail(t){let s=this.makeError(t),i=this.errorHandler;if(i===void 0)throw s;return i(s),this}write(t){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let s=!1;t===null?(s=!0,t=""):typeof t=="object"&&(t=t.toString()),this.carriedFromPrevious!==void 0&&(t=`${this.carriedFromPrevious}${t}`,this.carriedFromPrevious=void 0);let i=t.length,n=t.charCodeAt(i-1);!s&&(n===ft||n>=55296&&n<=56319)&&(this.carriedFromPrevious=t[i-1],i--,t=t.slice(0,i));let{stateTable:r}=this;for(this.chunk=t,this.i=0;this.i<i;)r[this.state].call(this);return this.chunkPosition+=i,s?this.end():this}close(){return this.write(null)}getCode10(){let{chunk:t,i:s}=this;if(this.prevI=s,this.i=s+1,s>=t.length)return C;let i=t.charCodeAt(s);if(this.column++,i<55296){if(i>=Zt||i===dt)return i;switch(i){case w:return this.line++,this.column=0,this.positionAtNewLine=this.position,w;case ft:return t.charCodeAt(s+1)===w&&(this.i=s+2),this.line++,this.column=0,this.positionAtNewLine=this.position,k;default:return this.fail("disallowed character."),i}}if(i>56319)return i>=57344&&i<=65533||this.fail("disallowed character."),i;let n=65536+(i-55296)*1024+(t.charCodeAt(s+1)-56320);return this.i=s+2,n>1114111&&this.fail("disallowed character."),n}getCode11(){let{chunk:t,i:s}=this;if(this.prevI=s,this.i=s+1,s>=t.length)return C;let i=t.charCodeAt(s);if(this.column++,i<55296){if(i>31&&i<127||i>159&&i!==ee||i===dt)return i;switch(i){case w:return this.line++,this.column=0,this.positionAtNewLine=this.position,w;case ft:{let r=t.charCodeAt(s+1);(r===w||r===te)&&(this.i=s+2)}case te:case ee:return this.line++,this.column=0,this.positionAtNewLine=this.position,k;default:return this.fail("disallowed character."),i}}if(i>56319)return i>=57344&&i<=65533||this.fail("disallowed character."),i;let n=65536+(i-55296)*1024+(t.charCodeAt(s+1)-56320);return this.i=s+2,n>1114111&&this.fail("disallowed character."),n}getCodeNorm(){let t=this.getCode();return t===k?w:t}unget(){this.i=this.prevI,this.column--}captureTo(t){let{i:s}=this,{chunk:i}=this;for(;;){let n=this.getCode(),r=n===k,a=r?w:n;if(a===C||t.includes(a))return this.text+=i.slice(s,this.prevI),a;r&&(this.text+=`${i.slice(s,this.prevI)}
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as d,d as p,e as g}from"./chunk-2SY2NCOP.js";import{b as m}from"./chunk-QMOGBKJM.js";import{mkdirSync as y,writeFileSync as o,existsSync as u,readFileSync as M}from"fs";import{join as a}from"path";var E={name:"remote-execution",version:"0.5.0",backendId:"hyper",kaneCompat:">=0.4.0",defaults:{runson:"mac",concurrency:1}},f={runson:"mac",concurrency:1,timeoutMinutes:120,mobile:{runson:"mac26",queueTimeout:300,appiumPort:4739,androidHome:"$HOME/android-sdk-shim",globalTimeout:90,testSuiteTimeout:90,testSuiteStep:45,ios:{runson:{}},realDevice:{runson:"linux"}}},v=`version: "0.1"
2
+ import{c as d,d as p,e as g}from"./chunk-HHOVANJ7.js";import{b as m}from"./chunk-FAMQ4DHU.js";import{mkdirSync as y,writeFileSync as o,existsSync as u,readFileSync as M}from"fs";import{join as a}from"path";var E={name:"remote-execution",version:"0.5.0",backendId:"hyper",kaneCompat:">=0.4.0",defaults:{runson:"mac",concurrency:1}},f={runson:"mac",concurrency:1,timeoutMinutes:120,mobile:{runson:"mac26",queueTimeout:300,appiumPort:4739,androidHome:"$HOME/android-sdk-shim",globalTimeout:90,testSuiteTimeout:90,testSuiteStep:45,ios:{runson:{}},realDevice:{runson:"linux"}}},v=`version: "0.1"
3
3
  runson: {{runson}}
4
4
  autosplit: true
5
5
  concurrency: {{concurrency}}
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as u,b as x}from"./chunk-WQR2GYP7.js";import{a as f}from"./chunk-HCBYKLMW.js";import{a as r,b as m}from"./chunk-33DWJV67.js";import{z as i}from"./chunk-QMOGBKJM.js";import{e as n}from"./chunk-UR6MHSHU.js";var e=n(f(),1);function C({title:B,titleColor:c,borderColor:d,variant:p,rows:s,footer:t,labelWidth:l=14,marginBottom:b=1}){return(0,e.jsxs)(u,{title:B,titleColor:c,borderColor:d,variant:p,marginBottom:b,children:[s.map((o,a)=>typeof o.value=="string"?(0,e.jsx)(x,{label:o.label,value:o.value,valueColor:o.valueColor,labelWidth:l},`${o.label}-${a}`):(0,e.jsxs)(r,{children:[(0,e.jsx)(r,{width:l,children:(0,e.jsx)(m,{color:i.dim,children:o.label})}),o.value]},`${o.label}-${a}`)),t&&(0,e.jsx)(r,{marginTop:1,children:t})]})}export{C as a};
2
+ import{a as u,b as x}from"./chunk-M3TFOFUQ.js";import{a as f}from"./chunk-HCBYKLMW.js";import{a as r,b as m}from"./chunk-33DWJV67.js";import{z as i}from"./chunk-FAMQ4DHU.js";import{e as n}from"./chunk-UR6MHSHU.js";var e=n(f(),1);function C({title:B,titleColor:c,borderColor:d,variant:p,rows:s,footer:t,labelWidth:l=14,marginBottom:b=1}){return(0,e.jsxs)(u,{title:B,titleColor:c,borderColor:d,variant:p,marginBottom:b,children:[s.map((o,a)=>typeof o.value=="string"?(0,e.jsx)(x,{label:o.label,value:o.value,valueColor:o.valueColor,labelWidth:l},`${o.label}-${a}`):(0,e.jsxs)(r,{children:[(0,e.jsx)(r,{width:l,children:(0,e.jsx)(m,{color:i.dim,children:o.label})}),o.value]},`${o.label}-${a}`)),t&&(0,e.jsx)(r,{marginTop:1,children:t})]})}export{C as a};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{f as c}from"./chunk-YYVBE6W2.js";function m(o){if(o==null)return{ok:!0,url:void 0};if(typeof o!="string")return{ok:!1,message:`error: --override-start-url needs a URL (http:// or https://)
2
+ import{f as c}from"./chunk-54NJJVG5.js";function m(o){if(o==null)return{ok:!0,url:void 0};if(typeof o!="string")return{ok:!1,message:`error: --override-start-url needs a URL (http:// or https://)
3
3
  `};let t=o.trim(),i=a=>({ok:!1,message:`error: --override-start-url ${a}: ${JSON.stringify(o)} (expected an http:// or https:// URL, e.g. http://localhost:3000)
4
- `});if(!t)return i("is empty");let n;try{n=new URL(t)}catch{return i("is not a URL")}return n.protocol!=="http:"&&n.protocol!=="https:"?i("must be http or https"):n.hostname?{ok:!0,url:t}:i("has no host")}function f(o){let t;try{t=new URL(o).hostname.toLowerCase()}catch{return!1}return t=t.replace(/^\[|\]$/g,""),t==="localhost"||t.endsWith(".localhost")||t==="::1"||/^127\./.test(t)||t==="0.0.0.0"||t.endsWith(".local")}function y(o){let{isAgent:t,log:i}=o,n=o.stdout??process.stderr,a=o.stdin??process.stdin,d=e=>{t&&c(e)};return{async runSteps(e){let{default:r}=await import("./react-QWOAB3TB.js"),{render:s}=await import("./build-5ZN47FAT.js"),{TestMdRunView:l}=await import("./TestMdRunView-I4MV54FB.js"),{ScrollbackProvider:p}=await import("./scrollback-GGNBDFQV.js"),{waitUntilExit:u}=s(r.createElement(p,null,r.createElement(l,e)),{stdout:n,stdin:a,exitOnCtrlC:!1});await u()},async runUpload(e,r){let{renderUploadProgress:s}=await import("./CliUploadProgress-HQX57WE6.js");return await s(e,r)},async onSummary(e){try{let{default:r}=await import("./react-QWOAB3TB.js"),{render:s}=await import("./build-5ZN47FAT.js"),{AutoExitSummaryBox:l}=await import("./SummaryBox-XQJUZBAN.js"),{waitUntilExit:p}=s(r.createElement(l,{data:e}),{stdout:n,stdin:a});await p()}catch(r){i("warn","TEST_MD_SUMMARY_RENDER_FAILED","Summary box render failed",{error:String(r)})}},async onLinks(e){try{let{default:r}=await import("./react-QWOAB3TB.js"),{render:s}=await import("./build-5ZN47FAT.js"),{LinksBox:l}=await import("./LinksBox-WZ4RAMSH.js"),{waitUntilExit:p}=s(r.createElement(l,e),{stdout:n,stdin:a});await p()}catch(r){i("warn","TEST_MD_LINKS_RENDER_FAILED","LinksBox render failed",{error:String(r)})}},onLockState(e){d({type:"test_md_lock_state",...e})},onAdaptiveHeal(e){d({type:"test_md_adaptive_heal",...e})},onAgentEvent(e){d(e)}}}export{m as a,f as b,y as c};
4
+ `});if(!t)return i("is empty");let n;try{n=new URL(t)}catch{return i("is not a URL")}return n.protocol!=="http:"&&n.protocol!=="https:"?i("must be http or https"):n.hostname?{ok:!0,url:t}:i("has no host")}function f(o){let t;try{t=new URL(o).hostname.toLowerCase()}catch{return!1}return t=t.replace(/^\[|\]$/g,""),t==="localhost"||t.endsWith(".localhost")||t==="::1"||/^127\./.test(t)||t==="0.0.0.0"||t.endsWith(".local")}function y(o){let{isAgent:t,log:i}=o,n=o.stdout??process.stderr,a=o.stdin??process.stdin,d=e=>{t&&c(e)};return{async runSteps(e){let{default:r}=await import("./react-QWOAB3TB.js"),{render:s}=await import("./build-5ZN47FAT.js"),{TestMdRunView:l}=await import("./TestMdRunView-ZZ77QTAQ.js"),{ScrollbackProvider:p}=await import("./scrollback-GGNBDFQV.js"),{waitUntilExit:u}=s(r.createElement(p,null,r.createElement(l,e)),{stdout:n,stdin:a,exitOnCtrlC:!1});await u()},async runUpload(e,r){let{renderUploadProgress:s}=await import("./CliUploadProgress-JZ5FXODE.js");return await s(e,r)},async onSummary(e){try{let{default:r}=await import("./react-QWOAB3TB.js"),{render:s}=await import("./build-5ZN47FAT.js"),{AutoExitSummaryBox:l}=await import("./SummaryBox-XGFO5X76.js"),{waitUntilExit:p}=s(r.createElement(l,{data:e}),{stdout:n,stdin:a});await p()}catch(r){i("warn","TEST_MD_SUMMARY_RENDER_FAILED","Summary box render failed",{error:String(r)})}},async onLinks(e){try{let{default:r}=await import("./react-QWOAB3TB.js"),{render:s}=await import("./build-5ZN47FAT.js"),{LinksBox:l}=await import("./LinksBox-32TZOANP.js"),{waitUntilExit:p}=s(r.createElement(l,e),{stdout:n,stdin:a});await p()}catch(r){i("warn","TEST_MD_LINKS_RENDER_FAILED","LinksBox render failed",{error:String(r)})}},onLockState(e){d({type:"test_md_lock_state",...e})},onAdaptiveHeal(e){d({type:"test_md_adaptive_heal",...e})},onAgentEvent(e){d(e)}}}export{m as a,f as b,y as c};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as f}from"./chunk-W3NWHWK2.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a,b as n}from"./chunk-33DWJV67.js";import{a as R}from"./chunk-6YGTRKDT.js";import{z as t}from"./chunk-QMOGBKJM.js";import{e as c}from"./chunk-UR6MHSHU.js";var p=c(R(),1);var e=c(x(),1);function v(){return[{name:"convert",label:"Converting session data",status:"pending"},{name:"zip",label:"Compressing artifacts",status:"pending"},{name:"presign",label:"Requesting upload URLs",status:"pending"},{name:"upload",label:"Uploading to KaneAI",status:"pending"},{name:"atomic_replace",label:"Replacing local output",status:"pending"},{name:"commit_lock",label:"Committing to TMS",status:"pending"},{name:"finalize",label:"Finalizing test case",status:"pending"},{name:"code_export",label:"Downloading test code",status:"pending"}]}function U(s,o,d,i){return s.map(l=>l.name===o?{...l,status:d,detail:i}:l)}function D(s){let o=s/1e3;if(o<60)return`${o.toFixed(1)}s`;let d=Math.floor(o/60),i=Math.round(o%60);return`${d}m ${i}s`}function w(s){let[o,d]=(0,p.useState)(0),i=p.default.useRef(Date.now());return(0,p.useEffect)(()=>{if(!s)return;i.current=Date.now();let l=setInterval(()=>{d(Date.now()-i.current)},100);return()=>clearInterval(l)},[s]),o}function h({steps:s,status:o,testUrl:d,error:i}){let l=w(o==="uploading");return o==="uploading"?(0,e.jsxs)(a,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(n,{color:t.orange,children:"\u2601 "}),(0,e.jsx)(n,{color:t.orange,bold:!0,children:"Saving to KaneAI"}),(0,e.jsxs)(n,{color:t.dim,children:[" ",D(l)]})]}),(0,e.jsx)(a,{flexDirection:"column",marginTop:1,children:s.filter(r=>r.status!=="skipped"||r.detail).map((r,S,T)=>{let b=S===T.length-1?"\u2514\u2500":"\u251C\u2500",u=r.status==="done",m=r.status==="running",g=r.status==="failed",B=r.status==="skipped";return(0,e.jsxs)(a,{children:[(0,e.jsxs)(n,{color:t.dim,children:[" ",b," "]}),(0,e.jsx)(a,{width:3,children:m?(0,e.jsx)(f,{}):u?(0,e.jsx)(n,{color:t.green,children:"\u2713"}):g?(0,e.jsx)(n,{color:t.red,children:"\u2717"}):B?(0,e.jsx)(n,{color:t.muted,children:"\u2013"}):(0,e.jsx)(n,{color:t.muted,children:"\u25CB"})}),(0,e.jsx)(n,{color:u?t.dim:m?void 0:g?t.red:t.muted,children:r.label}),r.detail&&(0,e.jsxs)(n,{color:t.dim,children:[" ",r.detail]})]},r.name)})}),(0,e.jsx)(a,{marginTop:1,children:(0,e.jsx)(n,{color:t.muted,children:" press Ctrl+C twice to force exit"})})]}):o==="success"?(0,e.jsx)(e.Fragment,{}):(0,e.jsxs)(a,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(n,{color:t.red,children:"\u2601 "}),(0,e.jsx)(n,{color:t.red,bold:!0,children:"Save failed"})]}),i&&(0,e.jsxs)(a,{marginTop:0,children:[(0,e.jsx)(n,{color:t.dim,children:" "}),(0,e.jsx)(n,{color:t.dim,children:i})]})]})}export{v as a,U as b,h as c};
2
+ import{a as f}from"./chunk-UCVP7ZY4.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a,b as n}from"./chunk-33DWJV67.js";import{a as R}from"./chunk-6YGTRKDT.js";import{z as t}from"./chunk-FAMQ4DHU.js";import{e as c}from"./chunk-UR6MHSHU.js";var p=c(R(),1);var e=c(x(),1);function v(){return[{name:"convert",label:"Converting session data",status:"pending"},{name:"zip",label:"Compressing artifacts",status:"pending"},{name:"presign",label:"Requesting upload URLs",status:"pending"},{name:"upload",label:"Uploading to KaneAI",status:"pending"},{name:"atomic_replace",label:"Replacing local output",status:"pending"},{name:"commit_lock",label:"Committing to TMS",status:"pending"},{name:"finalize",label:"Finalizing test case",status:"pending"},{name:"code_export",label:"Downloading test code",status:"pending"}]}function U(s,o,d,i){return s.map(l=>l.name===o?{...l,status:d,detail:i}:l)}function D(s){let o=s/1e3;if(o<60)return`${o.toFixed(1)}s`;let d=Math.floor(o/60),i=Math.round(o%60);return`${d}m ${i}s`}function w(s){let[o,d]=(0,p.useState)(0),i=p.default.useRef(Date.now());return(0,p.useEffect)(()=>{if(!s)return;i.current=Date.now();let l=setInterval(()=>{d(Date.now()-i.current)},100);return()=>clearInterval(l)},[s]),o}function h({steps:s,status:o,testUrl:d,error:i}){let l=w(o==="uploading");return o==="uploading"?(0,e.jsxs)(a,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(n,{color:t.orange,children:"\u2601 "}),(0,e.jsx)(n,{color:t.orange,bold:!0,children:"Saving to KaneAI"}),(0,e.jsxs)(n,{color:t.dim,children:[" ",D(l)]})]}),(0,e.jsx)(a,{flexDirection:"column",marginTop:1,children:s.filter(r=>r.status!=="skipped"||r.detail).map((r,S,T)=>{let b=S===T.length-1?"\u2514\u2500":"\u251C\u2500",u=r.status==="done",m=r.status==="running",g=r.status==="failed",B=r.status==="skipped";return(0,e.jsxs)(a,{children:[(0,e.jsxs)(n,{color:t.dim,children:[" ",b," "]}),(0,e.jsx)(a,{width:3,children:m?(0,e.jsx)(f,{}):u?(0,e.jsx)(n,{color:t.green,children:"\u2713"}):g?(0,e.jsx)(n,{color:t.red,children:"\u2717"}):B?(0,e.jsx)(n,{color:t.muted,children:"\u2013"}):(0,e.jsx)(n,{color:t.muted,children:"\u25CB"})}),(0,e.jsx)(n,{color:u?t.dim:m?void 0:g?t.red:t.muted,children:r.label}),r.detail&&(0,e.jsxs)(n,{color:t.dim,children:[" ",r.detail]})]},r.name)})}),(0,e.jsx)(a,{marginTop:1,children:(0,e.jsx)(n,{color:t.muted,children:" press Ctrl+C twice to force exit"})})]}):o==="success"?(0,e.jsx)(e.Fragment,{}):(0,e.jsxs)(a,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(n,{color:t.red,children:"\u2601 "}),(0,e.jsx)(n,{color:t.red,bold:!0,children:"Save failed"})]}),i&&(0,e.jsxs)(a,{marginTop:0,children:[(0,e.jsx)(n,{color:t.dim,children:" "}),(0,e.jsx)(n,{color:t.dim,children:i})]})]})}export{v as a,U as b,h as c};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{e as _}from"./chunk-77ZZQJLX.js";import{e as j}from"./chunk-MYZHOBS4.js";import{a as k,c as I}from"./chunk-B7ZX5HEN.js";import{writeFileSync as G,mkdirSync as J,readFileSync as W}from"fs";import{dirname as S}from"path";function L(e){return typeof e=="string"&&e.trim()||void 0}function oe(e){return L(b(e)?.tc_id)}function se(e){let t=b(e)?.environment_id;return typeof t=="number"&&Number.isInteger(t)&&t>0?t:void 0}function b(e){try{return JSON.parse(W(_(e),"utf8"))}catch{return null}}function de(e){let t=_(e.sourcePath);try{J(S(t),{recursive:!0})}catch(r){return process.stderr.write(`
2
+ import{e as _}from"./chunk-77ZZQJLX.js";import{e as j}from"./chunk-EHB55V23.js";import{a as k,c as I}from"./chunk-B7ZX5HEN.js";import{writeFileSync as G,mkdirSync as J,readFileSync as W}from"fs";import{dirname as S}from"path";function L(e){return typeof e=="string"&&e.trim()||void 0}function oe(e){return L(b(e)?.tc_id)}function se(e){let t=b(e)?.environment_id;return typeof t=="number"&&Number.isInteger(t)&&t>0?t:void 0}function b(e){try{return JSON.parse(W(_(e),"utf8"))}catch{return null}}function de(e){let t=_(e.sourcePath);try{J(S(t),{recursive:!0})}catch(r){return process.stderr.write(`
3
3
  \u26A0 Failed to create output directory.
4
4
  ${r.message}
5
5
  Path: ${S(t)}
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{i as o}from"./chunk-4I7YN6YY.js";import{fsyncSync as i}from"fs";function n(f){o()&&i(f)}export{n as a};
2
+ import{i as o}from"./chunk-HYJVYYAZ.js";import{fsyncSync as i}from"fs";function n(f){o()&&i(f)}export{n as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as w,b as C}from"./chunk-KRRZCY7U.js";import{a as j,b as I,e as x}from"./chunk-QQI6N3FO.js";import{e as y}from"./chunk-ZKPY3AXW.js";import{i as k}from"./chunk-XMPTFXPW.js";import{o as g}from"./chunk-7V34ZMMS.js";import{Ha as i,f as h}from"./chunk-TLOYTGVT.js";import{a as l}from"./chunk-I2MC6VVX.js";import{c as m}from"./chunk-GGV336P5.js";import{readFileSync as A}from"fs";import{basename as T,dirname as p,join as N}from"path";var S=5e3,O=w("assurance-case");function _(e,t={}){let s=p(e);if(T(s)!=="tests"||T(p(s))!==".testmuai")return null;let n=p(p(s)),a;try{a=g(A(e,"utf8"))}catch{return null}if(!a?.id)return null;let r=(c,u,d)=>({root:n,latticeUrl:c,projectId:u,projectName:d,test:a.id,base:a.base??null});if(t.grid){let c=x(N(n,j));return c===null?null:r("",c.projectId,c.projectName)}let o=I(n,t.address??m());return o.kind==="remote"?r(o.latticeUrl,o.projectId,o.projectName):null}function K(e,t={}){let s={};for(let n of e){let a=_(n,t);a?.base&&(s[n]={test:a.test,definitionId:a.base})}return s}async function V(e){let t=_(e.testFile,{address:e.address,grid:e.gridCase!==void 0});if(t===null)return{kind:"unlinked"};let s=t.base===null?null:{test:t.test,definitionId:t.base},n=e.metaCaseId===null;if(e.gridCase)return R(t,s,e.metaCaseId,{caseId:e.gridCase.caseId,internalId:e.gridCase.tc,canAttach:!0});if(s===null)return{kind:"stop",stop:{why:"not_in_project",useCase:null},projectName:t.projectName};let a;try{let r=e.auth??await y(),o=e.lookup??((c,u,d)=>h({url:t.latticeUrl,basicAuth:r}).testCase(c,u,d));a=await L(o(t.projectId,t.test,s.definitionId),e.budgetMs??S)}catch(r){return r instanceof l&&r.code==="NO_CONTEXT"?{kind:"stop",stop:{why:"no_work"},projectName:t.projectName}:(O(`the test case of ${t.test} wasn't checked: ${r instanceof f?r.message:C(r)}`),n?{kind:"stop",stop:{why:"lookup",refusal:v(r,t.projectName)},projectName:t.projectName}:{kind:"run",projectId:t.projectId,tc:null,stamp:s})}return"refused"in a?{kind:"stop",stop:E(a.refused),projectName:t.projectName}:R(t,s,e.metaCaseId,a.linked)}function R(e,t,s,n){return s===n.caseId?{kind:"run",projectId:e.projectId,tc:n.internalId,stamp:t}:n.canAttach?{kind:"attach",projectId:e.projectId,caseId:n.caseId,tc:n.internalId,stamp:t,rehome:s!==null}:{kind:"stop",stop:{why:"outdated"},projectName:e.projectName}}function X(e,t){switch(e.why){case"missing":return{refusal:i.testCaseMissing(e.session),exit:2};case"gone":return{refusal:i.testCaseGone(e.session),exit:2};case"archived":return{refusal:i.testCaseArchived(),exit:2};case"not_in_project":return{refusal:i.testNotInProject(t,e.useCase),exit:2};case"no_work":return{refusal:i.testProjectHasNoWork(t),exit:2};case"outdated":return{refusal:i.testManagerOutdated(),exit:1};case"lookup":return{refusal:e.refusal,exit:2}}}function b(e){switch(e.why){case"missing":return e.session?{reason:"it isn't in Test Manager yet; save the session that designed it:",cmd:`kane-cli context sessions save ${e.session}`}:{reason:"it isn't in Test Manager yet; find its session, then save it:",cmd:"kane-cli context sessions"};case"gone":return e.session?{reason:"its test case was deleted or moved; saving its session makes a new one:",cmd:`kane-cli context sessions save ${e.session}`}:{reason:"its test case was deleted or moved; find its session, then save it:",cmd:"kane-cli context sessions"};case"archived":return{reason:"its test case is archived in Test Manager; restore it there"};case"not_in_project":return{reason:"the session that designed it can't be saved anymore; design it again:",cmd:`kane-cli design tests --use-case ${e.useCase??"<use-case>"}`}}}function q(e){if(e.some(r=>r.stop.why==="outdated"))return{pair:i.dispatchTestManagerOutdated()};let t=e.find(r=>r.stop.why==="lookup")?.stop;if(t?.why==="lookup")return{pair:t.refusal};let s=e.find(r=>r.stop.why==="no_work");if(s)return{pair:i.dispatchProjectHasNoWork(s.projectName)};let n=[{text:i.dispatchStopped(e.length)}],a=new Set;for(let{relPath:r,stop:o}of e){if(o.why==="outdated"||o.why==="lookup"||o.why==="no_work")continue;let{reason:c,cmd:u}=b(o),d=u!==void 0&&a.has(u);n.push({text:` ${r}`,dim:!0},{text:` ${d?`${c.replace(/:$/,"")}, as above`:c}`,dim:!0}),u&&!d&&(a.add(u),n.push({text:` ${u}`}))}return n.push({text:i.dispatchNext(e.length)}),{lines:n}}function z(e){return{refusal:e.reason==="outdated"?i.testManagerMadeItsOwn():i.testCaseAttachFailed(),exit:1}}function E(e){switch(e.code){case"NO_CASE":return{why:"missing",session:e.session};case"CASE_BROKEN":return{why:"gone",session:e.session};case"CASE_ARCHIVED":return{why:"archived",internalId:e.internalId};case"TEST_FILE_STALE":return{why:"not_in_project",useCase:e.useCase}}}function v(e,t){return e instanceof k?{code:e.code,message:e.message,...e.remedy?{remedy:e.remedy}:{}}:e instanceof l&&e.status===401?i.credentialsRejected():e instanceof l&&e.code==="NOT_FOUND"?i.noAccess(t):e instanceof l&&e.code==="PROJECT_NOT_MARKED"?i.assuranceOff(t):i.noConnection()}var f=class extends Error{};async function L(e,t){let s,n=new Promise((a,r)=>{s=setTimeout(()=>r(new f(`Lattice took over ${t} ms`)),t)});try{return await Promise.race([e,n])}finally{clearTimeout(s)}}export{S as a,_ as b,K as c,V as d,X as e,q as f,z as g,f as h,L as i};
2
+ import{a as w,b as C}from"./chunk-TAY7J5VS.js";import{a as j,b as I,e as x}from"./chunk-NVD2MXHQ.js";import{e as y}from"./chunk-VE4HLIGA.js";import{i as k}from"./chunk-XMPTFXPW.js";import{o as g}from"./chunk-7V34ZMMS.js";import{Ha as i,f as h}from"./chunk-H4TIVILC.js";import{a as l}from"./chunk-4C7WVQOD.js";import{c as m}from"./chunk-FI2DVNRT.js";import{readFileSync as A}from"fs";import{basename as T,dirname as p,join as N}from"path";var S=5e3,O=w("assurance-case");function _(e,t={}){let s=p(e);if(T(s)!=="tests"||T(p(s))!==".testmuai")return null;let n=p(p(s)),a;try{a=g(A(e,"utf8"))}catch{return null}if(!a?.id)return null;let r=(c,u,d)=>({root:n,latticeUrl:c,projectId:u,projectName:d,test:a.id,base:a.base??null});if(t.grid){let c=x(N(n,j));return c===null?null:r("",c.projectId,c.projectName)}let o=I(n,t.address??m());return o.kind==="remote"?r(o.latticeUrl,o.projectId,o.projectName):null}function K(e,t={}){let s={};for(let n of e){let a=_(n,t);a?.base&&(s[n]={test:a.test,definitionId:a.base})}return s}async function V(e){let t=_(e.testFile,{address:e.address,grid:e.gridCase!==void 0});if(t===null)return{kind:"unlinked"};let s=t.base===null?null:{test:t.test,definitionId:t.base},n=e.metaCaseId===null;if(e.gridCase)return R(t,s,e.metaCaseId,{caseId:e.gridCase.caseId,internalId:e.gridCase.tc,canAttach:!0});if(s===null)return{kind:"stop",stop:{why:"not_in_project",useCase:null},projectName:t.projectName};let a;try{let r=e.auth??await y(),o=e.lookup??((c,u,d)=>h({url:t.latticeUrl,basicAuth:r}).testCase(c,u,d));a=await L(o(t.projectId,t.test,s.definitionId),e.budgetMs??S)}catch(r){return r instanceof l&&r.code==="NO_CONTEXT"?{kind:"stop",stop:{why:"no_work"},projectName:t.projectName}:(O(`the test case of ${t.test} wasn't checked: ${r instanceof f?r.message:C(r)}`),n?{kind:"stop",stop:{why:"lookup",refusal:v(r,t.projectName)},projectName:t.projectName}:{kind:"run",projectId:t.projectId,tc:null,stamp:s})}return"refused"in a?{kind:"stop",stop:E(a.refused),projectName:t.projectName}:R(t,s,e.metaCaseId,a.linked)}function R(e,t,s,n){return s===n.caseId?{kind:"run",projectId:e.projectId,tc:n.internalId,stamp:t}:n.canAttach?{kind:"attach",projectId:e.projectId,caseId:n.caseId,tc:n.internalId,stamp:t,rehome:s!==null}:{kind:"stop",stop:{why:"outdated"},projectName:e.projectName}}function X(e,t){switch(e.why){case"missing":return{refusal:i.testCaseMissing(e.session),exit:2};case"gone":return{refusal:i.testCaseGone(e.session),exit:2};case"archived":return{refusal:i.testCaseArchived(),exit:2};case"not_in_project":return{refusal:i.testNotInProject(t,e.useCase),exit:2};case"no_work":return{refusal:i.testProjectHasNoWork(t),exit:2};case"outdated":return{refusal:i.testManagerOutdated(),exit:1};case"lookup":return{refusal:e.refusal,exit:2}}}function b(e){switch(e.why){case"missing":return e.session?{reason:"it isn't in Test Manager yet; save the session that designed it:",cmd:`kane-cli context sessions save ${e.session}`}:{reason:"it isn't in Test Manager yet; find its session, then save it:",cmd:"kane-cli context sessions"};case"gone":return e.session?{reason:"its test case was deleted or moved; saving its session makes a new one:",cmd:`kane-cli context sessions save ${e.session}`}:{reason:"its test case was deleted or moved; find its session, then save it:",cmd:"kane-cli context sessions"};case"archived":return{reason:"its test case is archived in Test Manager; restore it there"};case"not_in_project":return{reason:"the session that designed it can't be saved anymore; design it again:",cmd:`kane-cli design tests --use-case ${e.useCase??"<use-case>"}`}}}function q(e){if(e.some(r=>r.stop.why==="outdated"))return{pair:i.dispatchTestManagerOutdated()};let t=e.find(r=>r.stop.why==="lookup")?.stop;if(t?.why==="lookup")return{pair:t.refusal};let s=e.find(r=>r.stop.why==="no_work");if(s)return{pair:i.dispatchProjectHasNoWork(s.projectName)};let n=[{text:i.dispatchStopped(e.length)}],a=new Set;for(let{relPath:r,stop:o}of e){if(o.why==="outdated"||o.why==="lookup"||o.why==="no_work")continue;let{reason:c,cmd:u}=b(o),d=u!==void 0&&a.has(u);n.push({text:` ${r}`,dim:!0},{text:` ${d?`${c.replace(/:$/,"")}, as above`:c}`,dim:!0}),u&&!d&&(a.add(u),n.push({text:` ${u}`}))}return n.push({text:i.dispatchNext(e.length)}),{lines:n}}function z(e){return{refusal:e.reason==="outdated"?i.testManagerMadeItsOwn():i.testCaseAttachFailed(),exit:1}}function E(e){switch(e.code){case"NO_CASE":return{why:"missing",session:e.session};case"CASE_BROKEN":return{why:"gone",session:e.session};case"CASE_ARCHIVED":return{why:"archived",internalId:e.internalId};case"TEST_FILE_STALE":return{why:"not_in_project",useCase:e.useCase}}}function v(e,t){return e instanceof k?{code:e.code,message:e.message,...e.remedy?{remedy:e.remedy}:{}}:e instanceof l&&e.status===401?i.credentialsRejected():e instanceof l&&e.code==="NOT_FOUND"?i.noAccess(t):e instanceof l&&e.code==="PROJECT_NOT_MARKED"?i.assuranceOff(t):i.noConnection()}var f=class extends Error{};async function L(e,t){let s,n=new Promise((a,r)=>{s=setTimeout(()=>r(new f(`Lattice took over ${t} ms`)),t)});try{return await Promise.race([e,n])}finally{clearTimeout(s)}}export{S as a,_ as b,K as c,V as d,X as e,q as f,z as g,f as h,L as i};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as Ce}from"./chunk-AQ2OG2EF.js";import{b as Me,d as Le}from"./chunk-VRIZDOO5.js";import{c as ke,g as Oe}from"./chunk-ZHWU6L2G.js";import{b as F}from"./chunk-CJE7PKRV.js";import{B as Ie,L as Ee,M as $e,Na as Be,a as ne,c as te,k as oe,r as we,x as re,y as se}from"./chunk-Z777GGHB.js";import{d as L,j as he,k as be,l as ye,m as ve,n as ie,p as _e,q as j}from"./chunk-DBMW3VUN.js";import{f as ee,h as xe}from"./chunk-KU3YHPWZ.js";import{readFileSync as We}from"fs";import{basename as ue,extname as Ue}from"path";import{extname as Pe}from"path";var Fe={kind:"jira",media_type:"application/x-kane-jira-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},De={kind:"confluence",media_type:"application/x-kane-confluence-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},je={kind:"web",media_type:"application/x-kane-web-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Te={kind:"linear",media_type:"application/x-kane-linear-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Ge={kind:"linear-doc",media_type:"application/x-kane-linear-doc-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Ke={kind:"plugin",media_type:"application/x-kane-plugin-envelope",extensions:[],cite:"verbatim",maxBytes:25*1024*1024},le=[{kind:"text",media_type:"text/plain",extensions:[".txt"],cite:"verbatim",maxBytes:2e6},{kind:"markdown",media_type:"text/markdown",extensions:[".md",".markdown"],cite:"verbatim",maxBytes:2e6},{kind:"image",media_type:"image/png",extensions:[".png"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/jpeg",extensions:[".jpg",".jpeg"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/webp",extensions:[".webp"],cite:"anchor-only",maxBytes:5e6},{kind:"text",media_type:"application/json",extensions:[".json"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/yaml",extensions:[".yaml",".yml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/toml",extensions:[".toml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/xml",extensions:[".xml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"text/plain",extensions:[".log"],cite:"verbatim",maxBytes:2e6},{kind:"pdf",media_type:"application/pdf",extensions:[".pdf"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.subarray(0,5).toString("latin1")==="%PDF-"},{kind:"docx",media_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extensions:[".docx"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.length>=4&&e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,sniffFail:e=>e.length>=8&&e.subarray(0,8).equals(Ve)?"DOCX_ENCRYPTED_OR_LEGACY: password-protected Office file (or a legacy .doc renamed .docx) \u2014 remove the password / save as .docx and re-ingest":void 0},Fe,De,Te,Ge,Ke],Ve=Buffer.from([208,207,17,224,161,177,26,225]),ae={pdf:"pdf",docx:"docx",jira:"jira",confluence:"confluence",web:"web",linear:"linear","linear-doc":"linearDoc",plugin:"plugin"},en=new Set(Object.keys(ae));function Se(e){let i=Pe(e).toLowerCase(),n=le.find(o=>o.extensions.includes(i));return n?{ok:!0,media:n}:{ok:!1,code:"UNSUPPORTED_MEDIA",allowlist:le.flatMap(o=>o.extensions)}}function nn(e){return[...le,je].find(i=>i.media_type===e)??null}function K(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function Ne(e,i,n){if(n===void 0)return;let o=n!==null?[n]:e.byLabel(ee.SOURCE).filter(d=>d.content.source_id===i).map(d=>d.cid);if(o.length!==0){for(let d of o){let p=e.mediaOf(d);if(p.format==="plugin")return p.plugin?.id??""}return null}}function Xe(e,i,n,o){if(i===void 0||i===n)return;let d=o?"a retired source":"a source",p=i===null?`${d} of a built-in kind`:`${d} the ${i} plugin reads`,t=n===null?"a file or URL of a built-in kind":`a source the ${n} plugin reads`;return`SOURCE_ID_OWNED: '${e}' is ${p} \u2014 ${t} cannot become a version of it; ingest it under another id`}function Ye(e,i,n){return Ce({source_id:e,source_cid:"sha256:".padEnd(71,"0"),doc_kind:i,numbered_text:Ie(n)})}var Ae=2e3;function ze(e){let n=ue(e,Ue(e)).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"");return oe(n),n}function wn(e){let i=/^(.*?)[-_.]?v?\d+$/.exec(e);if(!i)return null;let n=(i[1]??"").replace(/[-_.]+$/,"");return n.length>0&&n!==e?n:null}async function In(e){let{store:i,filePath:n,asId:o,confirmSameSource:d,converters:p}=e,t=i.ensure(),s=We(n),g=Se(n);if(!g.ok)throw new Error(`${ue(n)} is a file type kane can't ingest (${Ue(n)||"no extension"}) \u2014 supported: ${g.allowlist.join(" ")} [UNSUPPORTED_MEDIA]`);if(s.byteLength>g.media.maxBytes)throw new Error(`${ue(n)} is too large \u2014 ${K(s.byteLength)}, the limit for ${g.media.media_type} is ${K(g.media.maxBytes)} [FILE_TOO_LARGE]`);if(g.media.sniff&&!g.media.sniff(s)){let w=g.media.sniffFail?.(s);throw new Error(w??`MEDIA_SNIFF_MISMATCH: ${n} does not look like ${g.media.media_type}`)}let C;o!==void 0?(oe(o),C=o):C=ze(n);let v=await He({store:i,bytes:s,media:g.media,sourceId:C,label:n,confirmSameSource:d,converters:p});return t.gitignore?{...v,gitignore:t.gitignore}:v}async function He(e){let{store:i,bytes:n,media:o,confirmSameSource:d,converters:p}=e,t=o.kind==="plugin"?e.plugin:void 0;if(o.kind==="plugin"&&!t)throw new Error("a source-plugin version needs the plugin it was read by");let s=e.sourceId,g=e.label??s,C=i.ensure();if(n.byteLength>o.maxBytes)throw new Error(`the content is too large \u2014 ${K(n.byteLength)}, the limit for ${o.media_type} is ${K(o.maxBytes)} [FILE_TOO_LARGE]`);let v=[],w=ae[o.kind];if(o.cite==="verbatim"&&!w){try{new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{throw new Error(`ENCODING_UNSUPPORTED: ${g} is not valid UTF-8 \u2014 re-save it as UTF-8 and re-ingest`)}n.toString("utf8").split(`
2
+ import{a as Ce}from"./chunk-AQ2OG2EF.js";import{b as Me,d as Le}from"./chunk-VRIZDOO5.js";import{c as ke,g as Oe}from"./chunk-ZHWU6L2G.js";import{b as F}from"./chunk-CQDCNP7V.js";import{B as Ie,L as Ee,M as $e,Na as Be,a as ne,c as te,k as oe,r as we,x as re,y as se}from"./chunk-PI7OXS62.js";import{d as L,j as he,k as be,l as ye,m as ve,n as ie,p as _e,q as j}from"./chunk-DBMW3VUN.js";import{f as ee,h as xe}from"./chunk-KU3YHPWZ.js";import{readFileSync as We}from"fs";import{basename as ue,extname as Ue}from"path";import{extname as Pe}from"path";var Fe={kind:"jira",media_type:"application/x-kane-jira-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},De={kind:"confluence",media_type:"application/x-kane-confluence-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},je={kind:"web",media_type:"application/x-kane-web-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Te={kind:"linear",media_type:"application/x-kane-linear-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Ge={kind:"linear-doc",media_type:"application/x-kane-linear-doc-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Ke={kind:"plugin",media_type:"application/x-kane-plugin-envelope",extensions:[],cite:"verbatim",maxBytes:25*1024*1024},le=[{kind:"text",media_type:"text/plain",extensions:[".txt"],cite:"verbatim",maxBytes:2e6},{kind:"markdown",media_type:"text/markdown",extensions:[".md",".markdown"],cite:"verbatim",maxBytes:2e6},{kind:"image",media_type:"image/png",extensions:[".png"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/jpeg",extensions:[".jpg",".jpeg"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/webp",extensions:[".webp"],cite:"anchor-only",maxBytes:5e6},{kind:"text",media_type:"application/json",extensions:[".json"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/yaml",extensions:[".yaml",".yml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/toml",extensions:[".toml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/xml",extensions:[".xml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"text/plain",extensions:[".log"],cite:"verbatim",maxBytes:2e6},{kind:"pdf",media_type:"application/pdf",extensions:[".pdf"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.subarray(0,5).toString("latin1")==="%PDF-"},{kind:"docx",media_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extensions:[".docx"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.length>=4&&e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,sniffFail:e=>e.length>=8&&e.subarray(0,8).equals(Ve)?"DOCX_ENCRYPTED_OR_LEGACY: password-protected Office file (or a legacy .doc renamed .docx) \u2014 remove the password / save as .docx and re-ingest":void 0},Fe,De,Te,Ge,Ke],Ve=Buffer.from([208,207,17,224,161,177,26,225]),ae={pdf:"pdf",docx:"docx",jira:"jira",confluence:"confluence",web:"web",linear:"linear","linear-doc":"linearDoc",plugin:"plugin"},en=new Set(Object.keys(ae));function Se(e){let i=Pe(e).toLowerCase(),n=le.find(o=>o.extensions.includes(i));return n?{ok:!0,media:n}:{ok:!1,code:"UNSUPPORTED_MEDIA",allowlist:le.flatMap(o=>o.extensions)}}function nn(e){return[...le,je].find(i=>i.media_type===e)??null}function K(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function Ne(e,i,n){if(n===void 0)return;let o=n!==null?[n]:e.byLabel(ee.SOURCE).filter(d=>d.content.source_id===i).map(d=>d.cid);if(o.length!==0){for(let d of o){let p=e.mediaOf(d);if(p.format==="plugin")return p.plugin?.id??""}return null}}function Xe(e,i,n,o){if(i===void 0||i===n)return;let d=o?"a retired source":"a source",p=i===null?`${d} of a built-in kind`:`${d} the ${i} plugin reads`,t=n===null?"a file or URL of a built-in kind":`a source the ${n} plugin reads`;return`SOURCE_ID_OWNED: '${e}' is ${p} \u2014 ${t} cannot become a version of it; ingest it under another id`}function Ye(e,i,n){return Ce({source_id:e,source_cid:"sha256:".padEnd(71,"0"),doc_kind:i,numbered_text:Ie(n)})}var Ae=2e3;function ze(e){let n=ue(e,Ue(e)).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"");return oe(n),n}function wn(e){let i=/^(.*?)[-_.]?v?\d+$/.exec(e);if(!i)return null;let n=(i[1]??"").replace(/[-_.]+$/,"");return n.length>0&&n!==e?n:null}async function In(e){let{store:i,filePath:n,asId:o,confirmSameSource:d,converters:p}=e,t=i.ensure(),s=We(n),g=Se(n);if(!g.ok)throw new Error(`${ue(n)} is a file type kane can't ingest (${Ue(n)||"no extension"}) \u2014 supported: ${g.allowlist.join(" ")} [UNSUPPORTED_MEDIA]`);if(s.byteLength>g.media.maxBytes)throw new Error(`${ue(n)} is too large \u2014 ${K(s.byteLength)}, the limit for ${g.media.media_type} is ${K(g.media.maxBytes)} [FILE_TOO_LARGE]`);if(g.media.sniff&&!g.media.sniff(s)){let w=g.media.sniffFail?.(s);throw new Error(w??`MEDIA_SNIFF_MISMATCH: ${n} does not look like ${g.media.media_type}`)}let C;o!==void 0?(oe(o),C=o):C=ze(n);let v=await He({store:i,bytes:s,media:g.media,sourceId:C,label:n,confirmSameSource:d,converters:p});return t.gitignore?{...v,gitignore:t.gitignore}:v}async function He(e){let{store:i,bytes:n,media:o,confirmSameSource:d,converters:p}=e,t=o.kind==="plugin"?e.plugin:void 0;if(o.kind==="plugin"&&!t)throw new Error("a source-plugin version needs the plugin it was read by");let s=e.sourceId,g=e.label??s,C=i.ensure();if(n.byteLength>o.maxBytes)throw new Error(`the content is too large \u2014 ${K(n.byteLength)}, the limit for ${o.media_type} is ${K(o.maxBytes)} [FILE_TOO_LARGE]`);let v=[],w=ae[o.kind];if(o.cite==="verbatim"&&!w){try{new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{throw new Error(`ENCODING_UNSUPPORTED: ${g} is not valid UTF-8 \u2014 re-save it as UTF-8 and re-ingest`)}n.toString("utf8").split(`
3
3
  `).some(h=>h.length>Ae)&&v.push(`long line detected (> ${Ae} chars) \u2014 anchors lose granularity; consider pretty-printing before ingest`)}let k=F(n),O=new Map,I=null,_=null,m=null,B=new Map,R=!1;for(let h=0;;h++){let c=$e(i),u=c.heads.get(s),U=u!=null?c.getNode(u)?.content:void 0,b=Xe(s,Ne(c,s,u),t?t.id:null,u===null);if(b)throw new Error(b);if(u!=null&&U?.blob===k)return{status:"unchanged",source_id:s,cid:u,blob:k};if(u==null){for(let[r,E]of c.heads.entries())if(!(r===s||E==null)&&c.getNode(E)?.content.blob===k){if(Ne(c,r,E)!==(t?t.id:null))continue;let f;if(O.has(r)?f=O.get(r):h===0&&d?(f=await d(r),O.set(r,f)):(f=!1,O.set(r,f),h>0&&v.push(`same bytes already ingested as '${r}' \u2014 minted under '${s}' anyway (the twin appeared mid-commit; not prompted)`)),f)return{status:"unchanged",source_id:r,cid:E,blob:k};break}}let V=t?ne("source",te(s,k)):void 0,W=V!==void 0&&c.nodeLabel.has(V)?c.mediaOf(V):void 0,l=W?.format==="plugin"&&W.plugin?W:void 0,X=null;if(l){let r=[];if(l.text_blob&&i.getBlob(l.text_blob)===null&&r.push(`its text (${l.text_blob.slice(0,19)})`),l.plugin.index&&(X=ie(i.getBlob(l.plugin.index)),X===null&&r.push(`its unit index (${l.plugin.index.slice(0,19)})`)),l.plugin.notes&&i.getBlob(l.plugin.notes)===null&&r.push(`its notes (${l.plugin.notes.slice(0,19)})`),l.plugin.coverage&&i.getBlob(l.plugin.coverage)===null&&r.push(`its coverage plan (${l.plugin.coverage.slice(0,19)})`),r.length>0)throw new Error(`VERSION_BLOB_MISSING: this store has held these bytes of '${s}' before, and ${r.join(" and ")} from that ingest ${r.length>1?"are":"is"} not in the blob store \u2014 a version keeps what its first ingest stored, so it cannot be read again; restore the blobs from a copy of this store (kane-cli context fsck names what is missing)`)}if(!l&&m===null){let r={},E,f=null,A=null,M;if(w){let $=p?.[w];if(!$)throw new Error(`${w.toUpperCase()}_CONVERTER_MISSING: ${w} ingestion requires the converter \u2014 the command layer wires it`);let x=await $(n),y=re(x.projection);y.replaced>0&&v.push(se(s,y.replaced)),f=Buffer.from(y.text,"utf8");let D=Ye(s,o.kind,f),ge=()=>new Error(`PROJECTION_TOO_LARGE: serialized source payload ${D} bytes > ${4e5} \u2014 split the document and re-ingest`);if(D>4e5){if(!t)throw ge();if(f.byteLength>L.textBytes)throw new Error(`PLUGIN_TEXT_TOO_LARGE: plugin ${t.id} rendered ${s} to ${f.byteLength} bytes of text; a plugin's source may be at most ${L.textBytes} \u2014 split the source and ingest the parts`)}if(r={text_blob:F(f),...x.inventory.length>0?{images:x.inventory}:{},converter:x.converter},A=x.blobs,E={kind:o.kind,...x.pages!==void 0?{pages:x.pages}:{},delivered:x.delivered.length,omitted:x.inventory.length-x.delivered.length},t){let T=be(x.units,y.text);if(!T.ok)M={fault:T.fault};else{let me=ye(t.id,t.rules,T.units,y.text),G=ve(me);M=G.ok?{index:me,bytes:G.bytes,fp:F(G.bytes),given:T.units}:{fault:G.fault}}if(D>4e5&&(!("index"in M)||M.given.length===0))throw ge()}}else if(o.cite==="verbatim"){let $=re(n.toString("utf8"));$.replaced>0&&(v.push(se(s,$.replaced)),f=Buffer.from($.text,"utf8"),r={text_blob:F(f)})}let P=[...r.text_blob?[r.text_blob]:[],...A?A.keys():[]];m={derived:r,composite:E,projBytes:f,derivedBlobs:A,derivedFps:P,...M?{units:M}:{}}}let a=l?{derived:{...l.text_blob?{text_blob:l.text_blob}:{},...l.converter?{converter:l.converter}:{}},composite:{kind:o.kind,delivered:0,omitted:0},projBytes:null,derivedBlobs:null,derivedFps:l.text_blob?[l.text_blob]:[]}:m;if(l)i.putBlob(n);else if(!R){if(i.putBlob(n),a.projBytes!==null&&i.putBlob(a.projBytes),a.derivedBlobs!==null)for(let[,r]of a.derivedBlobs)i.putBlob(r);R=!0}let Y=te(s,k),z=xe("source",Y);if(z.length>0)throw new Error(`source node fails ${z[0].code}: ${z[0].detail}`);let H=ne("source",Y),S,N,J,q=[],Q=[],Z=[];if(t){let r=null,E;l?(E=l.plugin.index,r=X,N=r?{indexed:r.units.length}:{fault:{code:"UNIT_LIST_INVALID",detail:"this version was first stored without a unit index, and a version keeps what its first ingest stored"}}):a.units&&"index"in a.units?(i.putBlob(a.units.bytes),r=a.units.index,E=a.units.fp,N={indexed:r.units.length}):a.units&&(N={fault:a.units.fault});let f=u!=null?c.mediaOf(u):void 0,A=r&&f?.format==="plugin"&&f.plugin?.index?ie(i.getBlob(f.plugin.index)):null,M=r&&A&&A.plugin===r.plugin&&A.rules===r.rules?A:null,P=r&&M&&u!=null?_e(M,r):null;if(P!==null&&P.changed.length>0&&e.explain&&!l&&u!=null&&a.projBytes!==null){let y=B.get(u);if(y===void 0){let D=f?.text_blob?i.getBlob(f.text_blob):null;y=D===null?{reasons:{},warnings:[]}:await Qe({call:e.explain,ms:e.explainMs??L.explainMs,plugin:t.id,sourceId:s,changed:P.changed,before:{index:M,text:D.toString("utf8")},after:{index:r,text:a.projBytes.toString("utf8")}}),B.set(u,y)}q=y.warnings,Object.keys(y.reasons).length>0&&(J=y.reasons)}let $;if(l)$=l.plugin.notes;else if(t.notes!==void 0)$=t.notes;else if(e.context&&a.projBytes!==null){if(I===null){let y=a.units&&"index"in a.units?a.units.given:[];I=await Je({call:e.context,ms:e.contextMs??L.hookMs,plugin:t.id,sourceId:s,text:a.projBytes.toString("utf8"),units:y})}I.notes!==null&&(i.putBlob(I.notes.bytes),$=I.notes.fp),Q=I.warnings}let x;l?x=l.plugin.coverage:t.coverage!==void 0?x=t.coverage:e.coverage&&a.units&&"index"in a.units&&(_===null&&(_=await qe({call:e.coverage,ms:e.coverageMs??L.hookMs,plugin:t.id,sourceId:s,units:a.units.given})),_.plan!==null&&(i.putBlob(_.plan.bytes),x=_.plan.fp),Z=_.warnings),S={id:l?l.plugin.id:t.id,rules:l?l.plugin.rules:t.rules,...E?{index:E}:{},...$?{notes:$}:{},...x?{coverage:x}:{},...(l?l.plugin.cites_deep:t.citesDeep)===!0?{cites_deep:!0}:{},...P!==null&&u!=null?{changes:{from:u,...P,...J?{reasons:J}:{}}}:{},...t.fetch!==void 0?{fetch:{ref:t.fetch.ref,...t.fetch.cursor!==void 0?{cursor:t.fetch.cursor}:{}}}:{}}}let ce=N&&"fault"in N?[...v,`${s} is stored without a unit index: ${N.fault.detail} [${N.fault.code}] \u2014 everything that cites an earlier version of it reads stale`]:v,pe=q.length>0||Q.length>0||Z.length>0?[...ce,...q,...Q,...Z]:ce,Re=[...a.derivedFps,...S?.index?[S.index]:[],...S?.notes?[S.notes]:[],...S?.coverage?[S.coverage]:[]],fe={format:o.kind,media_type:o.media_type,anchors_supported:t?["L-L"]:w?["L-L","img#ref"]:o.cite==="verbatim"?["L-L"]:[],...a.derived,...S?{plugin:S}:{}};try{Ee(i,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:H,label:ee.SOURCE,content:Y}],edges:[],review:[],supersessions:[],media:{[s]:fe},...e.eventIds&&e.eventIds.length>0?{event_ids:e.eventIds}:{},source_head_moves:{[s]:H}},{graph:c,expectPrev:c.latestHash,intent:{v:1,verb:"ingest",args:we({source_id:s,blob:k,label:g,media:fe,derived_blobs:Re,eventIds:e.eventIds??null}),pins:{prior_head:u??null}},provenance:e.provenance})}catch(r){if(r instanceof Be&&h<3)continue;throw r}return{status:u!=null?"versioned":"created",source_id:s,cid:H,blob:k,...pe.length?{warnings:pe}:{},...a.composite?{composite:a.composite}:{},...C.gitignore?{gitignore:C.gitignore}:{},...N?{units:N}:{}}}}async function Je(e){let i="the version, its units and what changed are stored as they are; only the notes are missing",n;try{n=await e.call({text:e.text,units:e.units},e.ms)}catch(t){let s=j(t instanceof Error?t.message:String(t))??"it failed";return{notes:null,warnings:[`plugin ${e.plugin} gave no notes for ${e.sourceId}: ${s} \u2014 ${i} [PLUGIN_CONTEXT_FAILED]`]}}let o=Oe(e.plugin,n,new Set(e.units.map(t=>t.id))),d=[];if(o.invalid!==void 0&&d.push(`plugin ${e.plugin} answered context for ${e.sourceId} with ${o.invalid} \u2014 ${i} [PLUGIN_NOTES_INVALID]`),o.dropped.length>0){let t=o.dropped.reduce((s,g)=>s+g.count,0);d.push(`${t} ${t===1?"note":"notes"} of plugin ${e.plugin} for ${e.sourceId} ${t===1?"is":"are"} not kept: ${o.dropped.map(s=>`${s.count} ${s.why}`).join("; ")} \u2014 the version, its units and what changed are stored as they are, with the notes that are kept [PLUGIN_NOTES_DROPPED]`)}if(o.notes===null)return{notes:null,warnings:d};let p=ke(o.notes);return{notes:{bytes:p,fp:F(p)},warnings:d}}async function qe(e){let i="the version, its units and what changed are stored as they are, with no coverage plan: every unit of it is expected to have tests",n;try{n=await e.call({units:e.units},e.ms)}catch(p){let t=j(p instanceof Error?p.message:String(p))??"it failed";return{plan:null,warnings:[`plugin ${e.plugin} gave no coverage plan for ${e.sourceId}: ${t} \u2014 ${i} [PLUGIN_COVERAGE_FAILED]`]}}let o=Le(e.plugin,n,e.units.map(p=>p.id));if(o.plan===null)return{plan:null,warnings:[`plugin ${e.plugin} gave no coverage plan for ${e.sourceId}: ${o.fault} \u2014 ${i} [PLUGIN_COVERAGE_FAILED]`]};let d=Me(o.plan);return{plan:{bytes:d,fp:F(d)},warnings:[]}}async function Qe(e){let i=m=>{let B=he(m.text),R=new Map(m.index.units.map(h=>[h.id,h]));return h=>{let c=R.get(h);if(c===void 0||c.lines===void 0)return null;let{text:u,segments:U,...b}=c;return{unit:{...b,lines:[c.lines[0],c.lines[1]]},text:B.slice(c.lines[0]-1,c.lines[1]).join(`
4
4
  `)}}},n=i(e.before),o=i(e.after),d={},p=[],t=[],s=[],g="",C=0,v=[],w=[],k=Date.now();for(let m=0;m<e.changed.length;m++){let B=e.changed[m],R=n(B),h=o(B);if(R===null||h===null)continue;let c=e.ms-(Date.now()-k);if(c<=0){v=e.changed.slice(m).filter(b=>n(b)!==null&&o(b)!==null);break}let u;try{u=await e.call({sourceId:e.sourceId,before:R,after:h},c)}catch(b){p.push(B),g===""&&(g=b instanceof Error?b.message:String(b));continue}if(u==null)continue;let U=j(u);if(U===null){s.push(B);continue}if(U.length>L.reasonChars){t.push(B);continue}if(C+Buffer.byteLength(U,"utf8")>L.reasonsBytes){w=e.changed.slice(m).filter(b=>n(b)!==null&&o(b)!==null);break}C+=Buffer.byteLength(U,"utf8"),d[B]=U}let O=m=>`${m.length} changed ${m.length===1?"unit":"units"} of ${e.sourceId} (${m.slice(0,5).join(", ")}${m.length>5?`, and ${m.length-5} more`:""})`,I="the version, its units and what changed are stored as they are; only the wording is missing",_=[];return p.length>0&&_.push(`plugin ${e.plugin} gave no reason for ${O(p)}: ${j(g)??"it failed"} \u2014 ${I} [PLUGIN_EXPLAIN_FAILED]`),v.length>0&&_.push(`plugin ${e.plugin} was not asked for a reason for ${O(v)}: its answers took the ${Math.round(e.ms/1e3)} seconds a version's reasons may take \u2014 ${I} [PLUGIN_EXPLAIN_TIMEOUT]`),s.length>0&&_.push(`plugin ${e.plugin} answered with something that is not a line of text for ${O(s)} \u2014 ${I} [PLUGIN_REASON_INVALID]`),t.length>0&&_.push(`plugin ${e.plugin} gave a reason over ${L.reasonChars} characters for ${O(t)}; it is dropped \u2014 ${I} [PLUGIN_REASON_TOO_LONG]`),w.length>0&&_.push(`the reasons of plugin ${e.plugin} passed ${L.reasonsBytes} bytes for one version; none is kept for ${O(w)} \u2014 ${I} [PLUGIN_REASONS_OVER_LIMIT]`),{reasons:d,warnings:_}}export{Fe as a,De as b,je as c,Te as d,Ge as e,Ke as f,le as g,ae as h,en as i,Se as j,nn as k,Xe as l,Ye as m,ze as n,wn as o,In as p,He as q};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as h}from"./chunk-FYCD765R.js";import{b as y,c as v}from"./chunk-VZ7KXRXB.js";import{randomUUID as k,randomBytes as D}from"crypto";import{promises as i}from"fs";import{join as c}from"path";function p(t=process.cwd()){return c(t,".testmuai","evidence")}function b(t,e=process.cwd()){return c(p(e),`${t}.evidence`)}function W(){return k()}var S=/\.evidence\.tmp-(\d+)-[0-9a-f]+$/;async function _(t,e,r=process.cwd()){let n=p(r);await i.mkdir(n,{recursive:!0});let o=b(e,r),a=c(n,`${e}.evidence.tmp-${process.pid}-${D(6).toString("hex")}`);return await i.copyFile(t,a),await i.rename(a,o),o}async function I(t=process.cwd()){let e=p(t),r;try{r=await i.readdir(e)}catch{return[]}return r.filter(n=>n.endsWith(".evidence")).sort().map(n=>c(e,n))}async function L(t,e=process.cwd()){if(await P(t))return t;let r=b(t,e);return await P(r)?r:null}async function P(t){try{return await i.stat(t),!0}catch{return!1}}function E(t){try{return process.kill(t,0),!0}catch(e){return e?.code==="EPERM"}}async function M(t=process.cwd(),e=E){let r=p(t);await h(r).catch(()=>({restored:[],removed:[]}));let n=[],o=[],a;try{a=await i.readdir(r,{withFileTypes:!0})}catch{return{aborted:n,removed:o}}for(let u of a){let d=u.name.match(S);if(d){let g=Number(d[1]);if(Number.isFinite(g)&&e(g))continue;let w=c(r,u.name);await i.rm(w,{force:!0}),o.push(w);continue}if(!u.isDirectory()||!u.name.endsWith(".evidence"))continue;let m=c(r,u.name),f=c(m,"run.yaml"),s;try{s=y(await i.readFile(f,"utf8"))}catch{continue}if(s?.status!=="running")continue;let l=s?.environment?.pid;if(typeof l=="number"&&e(l))continue;let x=s?.environment?.saved===!0;s?.environment?.origin==="inline"&&!x?(await i.rm(m,{recursive:!0,force:!0}),o.push(m)):(s.status="aborted",await i.writeFile(f,v(s,{lineWidth:-1})),n.push(m))}return{aborted:n,removed:o}}export{p as a,b,W as c,_ as d,I as e,L as f,M as g};
2
+ import{c as h}from"./chunk-Q4JV4U65.js";import{b as y,c as v}from"./chunk-VZ7KXRXB.js";import{randomUUID as k,randomBytes as D}from"crypto";import{promises as i}from"fs";import{join as c}from"path";function p(t=process.cwd()){return c(t,".testmuai","evidence")}function b(t,e=process.cwd()){return c(p(e),`${t}.evidence`)}function W(){return k()}var S=/\.evidence\.tmp-(\d+)-[0-9a-f]+$/;async function _(t,e,r=process.cwd()){let n=p(r);await i.mkdir(n,{recursive:!0});let o=b(e,r),a=c(n,`${e}.evidence.tmp-${process.pid}-${D(6).toString("hex")}`);return await i.copyFile(t,a),await i.rename(a,o),o}async function I(t=process.cwd()){let e=p(t),r;try{r=await i.readdir(e)}catch{return[]}return r.filter(n=>n.endsWith(".evidence")).sort().map(n=>c(e,n))}async function L(t,e=process.cwd()){if(await P(t))return t;let r=b(t,e);return await P(r)?r:null}async function P(t){try{return await i.stat(t),!0}catch{return!1}}function E(t){try{return process.kill(t,0),!0}catch(e){return e?.code==="EPERM"}}async function M(t=process.cwd(),e=E){let r=p(t);await h(r).catch(()=>({restored:[],removed:[]}));let n=[],o=[],a;try{a=await i.readdir(r,{withFileTypes:!0})}catch{return{aborted:n,removed:o}}for(let u of a){let d=u.name.match(S);if(d){let g=Number(d[1]);if(Number.isFinite(g)&&e(g))continue;let w=c(r,u.name);await i.rm(w,{force:!0}),o.push(w);continue}if(!u.isDirectory()||!u.name.endsWith(".evidence"))continue;let m=c(r,u.name),f=c(m,"run.yaml"),s;try{s=y(await i.readFile(f,"utf8"))}catch{continue}if(s?.status!=="running")continue;let l=s?.environment?.pid;if(typeof l=="number"&&e(l))continue;let x=s?.environment?.saved===!0;s?.environment?.origin==="inline"&&!x?(await i.rm(m,{recursive:!0,force:!0}),o.push(m)):(s.status="aborted",await i.writeFile(f,v(s,{lineWidth:-1})),n.push(m))}return{aborted:n,removed:o}}export{p as a,b,W as c,_ as d,I as e,L as f,M as g};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as A,l as E}from"./chunk-JCSVBD4F.js";import{e as _,f as v}from"./chunk-6K5BEEAJ.js";import{a as P}from"./chunk-4QTH7VYE.js";import{mkdtempSync as N,rmSync as B}from"fs";import{tmpdir as U}from"os";import{join as D}from"path";function T(e){let o=Promise.resolve(),i=new Map,r=s=>{try{B(s,{recursive:!0,force:!0})}catch{}};function a(s){let f=o.then(async()=>{if(i.has(s))throw new Error(`chrome slot ${s} already acquired (one acquire per worker index)`);let c=N(D(U(),"kane-testrun-chrome-")),g;try{g=await e.launch({userDataDir:c,width:e.width,height:e.height,headless:e.headless})}catch(u){throw r(c),u}return i.set(s,{chrome:g,dataDir:c}),{cdpEndpoint:g.cdpEndpoint,release(){let u=i.get(s);if(u){i.delete(s);try{u.chrome.kill()}catch{}r(u.dataDir)}}}});return o=f.catch(()=>{}),f}return{acquire:a,killAll(){for(let[,s]of i){try{s.chrome.kill()}catch{}r(s.dataDir)}i.clear()}}}var x=4;function Y(e){let o=T(e);return{kind:"local",maxParallel:x,async acquire(i){let r=await o.acquire(i);return{cdpEndpoint:r.cdpEndpoint,release:async()=>{r.release()}}},async releaseAll(){o.killAll()},releaseAllSync(){o.killAll()}}}function $(e){return e.replace(/([?&]capabilities=)[^&\s'"]*/g,"$1<redacted>")}function S(e){let o=new Set;for(let r of e)!r||r.length<4||(o.add(r),o.add(encodeURIComponent(r)),o.add(JSON.stringify(r).slice(1,-1)),o.add(encodeURIComponent(JSON.stringify(r).slice(1,-1))));let i=[...o].sort((r,a)=>a.length-r.length);return r=>{let a=$(r);for(let s of i)a=a.split(s).join("<redacted>");return a}}function Q(e){let o=S(e);return i=>JSON.parse(o(JSON.stringify(i)))}import{spawnSync as M}from"child_process";var h=20,ne=["us","eu","mumbai","oregon"],j={stage:"wss://stage-cdp.lambdatestinternal.com",prod:"wss://cdp.lambdatest.com"};function se(e,o){if(!o)return j[e];if(e!=="prod")throw new Error(`--hps-region ${o}: regional HPS hosts are prod only; stage has one host`);return`wss://cdp-${o}.lambdatest.com`}function K(e,o,i,r){let a={user:o.username,accessKey:o.access_key,browserName:"Chrome"};return r&&(a.tunnel=!0,r.name&&(a.tunnelName=r.name)),`${e.replace(/\/+$/,"")}/kane-cli?capabilities=${encodeURIComponent(JSON.stringify(a))}&testId=${encodeURIComponent(i)}`}function ae(e,o,i){let r=new _(e,o.username,o.access_key);return{create:(a,s)=>r.createBrowserSession({...i(),worker_index:a,source:"explore"},{signal:s}),release:(a,s)=>r.endBrowserSession(a,{signal:s})}}var G=`
2
+ import{c as A,l as E}from"./chunk-GQARXS6F.js";import{e as _,f as v}from"./chunk-6K5BEEAJ.js";import{a as P}from"./chunk-4QTH7VYE.js";import{mkdtempSync as N,rmSync as B}from"fs";import{tmpdir as U}from"os";import{join as D}from"path";function T(e){let o=Promise.resolve(),i=new Map,r=s=>{try{B(s,{recursive:!0,force:!0})}catch{}};function a(s){let f=o.then(async()=>{if(i.has(s))throw new Error(`chrome slot ${s} already acquired (one acquire per worker index)`);let c=N(D(U(),"kane-testrun-chrome-")),g;try{g=await e.launch({userDataDir:c,width:e.width,height:e.height,headless:e.headless})}catch(u){throw r(c),u}return i.set(s,{chrome:g,dataDir:c}),{cdpEndpoint:g.cdpEndpoint,release(){let u=i.get(s);if(u){i.delete(s);try{u.chrome.kill()}catch{}r(u.dataDir)}}}});return o=f.catch(()=>{}),f}return{acquire:a,killAll(){for(let[,s]of i){try{s.chrome.kill()}catch{}r(s.dataDir)}i.clear()}}}var x=4;function Y(e){let o=T(e);return{kind:"local",maxParallel:x,async acquire(i){let r=await o.acquire(i);return{cdpEndpoint:r.cdpEndpoint,release:async()=>{r.release()}}},async releaseAll(){o.killAll()},releaseAllSync(){o.killAll()}}}function $(e){return e.replace(/([?&]capabilities=)[^&\s'"]*/g,"$1<redacted>")}function S(e){let o=new Set;for(let r of e)!r||r.length<4||(o.add(r),o.add(encodeURIComponent(r)),o.add(JSON.stringify(r).slice(1,-1)),o.add(encodeURIComponent(JSON.stringify(r).slice(1,-1))));let i=[...o].sort((r,a)=>a.length-r.length);return r=>{let a=$(r);for(let s of i)a=a.split(s).join("<redacted>");return a}}function Q(e){let o=S(e);return i=>JSON.parse(o(JSON.stringify(i)))}import{spawnSync as M}from"child_process";var h=20,ne=["us","eu","mumbai","oregon"],j={stage:"wss://stage-cdp.lambdatestinternal.com",prod:"wss://cdp.lambdatest.com"};function se(e,o){if(!o)return j[e];if(e!=="prod")throw new Error(`--hps-region ${o}: regional HPS hosts are prod only; stage has one host`);return`wss://cdp-${o}.lambdatest.com`}function K(e,o,i,r){let a={user:o.username,accessKey:o.access_key,browserName:"Chrome"};return r&&(a.tunnel=!0,r.name&&(a.tunnelName=r.name)),`${e.replace(/\/+$/,"")}/kane-cli?capabilities=${encodeURIComponent(JSON.stringify(a))}&testId=${encodeURIComponent(i)}`}function ae(e,o,i){let r=new _(e,o.username,o.access_key);return{create:(a,s)=>r.createBrowserSession({...i(),worker_index:a,source:"explore"},{signal:s}),release:(a,s)=>r.endBrowserSession(a,{signal:s})}}var G=`
3
3
  const ids = JSON.parse(process.env.KANE_HPS_IDS || "[]");
4
4
  Promise.allSettled(ids.map((id) => fetch(process.env.KANE_HPS_FORGE + "/kane-cli/v1/browser-sessions/" + encodeURIComponent(id), {
5
5
  method: "DELETE", headers: { Authorization: process.env.KANE_HPS_AUTH, Accept: "application/json" },
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{j as s}from"./chunk-4I7YN6YY.js";import{AsyncLocalStorage as c}from"async_hooks";function a(n,t){let e=s();e?e(n,t):process.stderr.write(n+`
2
+ import{j as s}from"./chunk-HYJVYYAZ.js";import{AsyncLocalStorage as c}from"async_hooks";function a(n,t){let e=s();e?e(n,t):process.stderr.write(n+`
3
3
  `)}var i=new c;function l(n,t){let e=i.getStore(),o=n.attempt!==void 0,r=o?n.attempt:e?.attempt,p=!o&&e?e.appends:{made:0};return i.run({channel:n,...r!==void 0?{attempt:r}:{},appends:p},t)}function g(n){let t=i.getStore()?.channel.event;if(t){t(n);return}process.env.KANE_DEV_MODE==="1"&&a(JSON.stringify(n))}function v(){let n=i.getStore();return n?.attempt===void 0?null:(n.appends.made+=1,`${n.attempt}:${n.appends.made}`)}function h(n,t,e=""){let o=i.getStore()?.channel.event;if(o){o({type:"warning",message:n,...t?{code:t}:{}});return}let r=e+n;a(r.endsWith(`
4
4
  `)?r.slice(0,-1):r,t)}export{a,l as b,g as c,v as d,h as e};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as V}from"./chunk-RTVWQK7I.js";import{a as j,f as q}from"./chunk-MW2WNYJO.js";import{c as H,e as A,g as P}from"./chunk-7KX2BHKG.js";import{c as _}from"./chunk-EX6ORR7P.js";import{a as O}from"./chunk-VZJ6LUXX.js";import{n as L}from"./chunk-EH43VWVR.js";import{c as h}from"./chunk-BWXLZS5O.js";import{a as I}from"./chunk-GFLB2SHW.js";import{M as S}from"./chunk-Z777GGHB.js";import{m as D}from"./chunk-4I7YN6YY.js";function F(e,n){try{let s=e.sessions().peek(n);return!s||!L(s,e.sessions().hasBase(n))?!1:(e.sessions().resume(n).complete({ended:"failed",code:"SESSION_KEPT_NOTHING"}),!0)}catch{return!1}}var J=e=>e!==null?{fixCmd:e}:{};function Q(e,n){return e.recordsSince(null).flatMap(o=>{let r=o.design_phase?.phase;return o.sid===n&&typeof r=="string"&&_[r]?[_[r]]:[]}).at(-1)}function X(e,n,s){return e.recordsSince(s).some(o=>o.sid!==n||!o.design_of?!1:o.design_phase?.phase==="tests"||o.nodes.some(r=>r.label==="test"))}async function le(e,n,s){let o=n.enterNested?.("opening the design\u2026")??(()=>{});try{return await Z(e,n,s)}finally{o()}}async function Z(e,n,s){let{force:o=!1,verb:r="design",childSession:d}=e,i=e.resume===!0?d:void 0;if(e.resume===!0&&i===void 0)return n.note("design child not resumed \u2014 a resume needs the child's session"),n.endUnstartedTurn(),2;if(i!==void 0&&F(s.store,i.id))return n.note(`design child ${i.id} kept nothing to resume \u2014 its agent never started; its offer opens again`),n.endUnstartedTurn(),2;let f=(()=>{if(i===void 0)return e.ucRef;try{return s.store.sessions().peek(i.id)?.use_case??e.ucRef}catch{return e.ucRef}})(),y=!1;if(i===void 0)try{let t=H(S(s.store),f);if(!t.ok&&(t.code==="UC_UNREVIEWED"||t.code==="UC_ARCHIVED")){let l=e.confirmUnreviewed??(C=>P(m=>n.ask(m),C)),a=!A(t);if(a||!await l(t))return n.note(t.reviewCmd!==void 0?`design child refused \u2014 approve it first: ${t.reviewCmd}`:"design child refused \u2014 approve it first"),n.endUnstartedTurn(),e.onEnded?.(a?"refused":"declined",a?{code:t.code}:void 0),2;y=!0}}catch{y=!1}let p=(()=>{try{let t=S(s.store),l=t.resolve(f);return(l?t.getNode(l.tip)?.content?.title:void 0)??f}catch{return f}})(),c=d?.id??i?.id,E=i?null:s.store.head(),B=i&&c!==void 0?Q(s.store,c):void 0,W=h(n.state.turns).entries.length,R=()=>h(n.state.turns).entries.filter(t=>t.kind==="test").length,$=R(),T=n.state.credits?.total,K=Date.now();n.ledger({kind:"childOpen",verb:r,subject:p,...d?{sid:d.id}:{},...i?{resumed:!0}:{},...e.replaces?{replaces:e.replaces}:{},...B?{landed:B}:{},...e.evolution?{update:!0}:{},...e.evolution?.changed?{changed:!0}:{}});let M=t=>{let l=Math.max(1,Math.round((Date.now()-K)/1e3)),a=h(n.state.turns).entries.length-W,C=R()-$,m=n.state.credits?.total,w=m!==void 0&&T!==void 0?m-T:m,U=e.evolution!==void 0&&t===0&&c!==void 0&&!s.store.recordsSince(E).some(x=>x.sid===c),G=t===0&&c!==void 0&&!U&&!X(s.store,c,E);if(n.ledger(t===0?{kind:"childClose",verb:r,subject:p,ok:!0,durS:l,...e.evolution?{update:!0}:{},...U?{untouched:!0}:{},...G?{unfinished:!0}:{},...a>0?{results:`${a} item${a===1?"":"s"}`}:{},...C>0?{tests:C}:{},...e.evolution&&c!==void 0?{testsWritten:j(s.store.recordsSince(E).filter(x=>x.sid===c),S(s.store))}:{},...w!==void 0&&w>0?{credits:w}:{}}:{kind:"childClose",verb:r,subject:p,ok:!1,durS:l,exitCode:t,...e.evolution?{update:!0}:{},...J(i!==void 0?D().command("next.resume_child",{sid:i.id}):D().command("next.design_use_case",{use_case:f,force:o||r==="evolve"}))}),e.quietEnding)return;let z=h(n.state.turns).entries.length;n.ledger({kind:"childBack",parentVerb:"extract",context:D().text("chat.child_back",{drafts:z})})},b="",u=1,v=!1,k,g,N=d?.id,Y=(...t)=>(v=!0,s.agent(...t));try{u=await q(i?{resume:i.id,mode:"interactive"}:{useCase:f,force:o,mode:"interactive",...y?{allowUnreviewed:!0}:{},...e.statement?{agentStatement:e.statement}:{},...e.evolution?.because?{because:e.evolution.because}:{},...e.evolution?.changeDelta!==void 0?{changeDelta:e.evolution.changeDelta}:{},...e.evolution?.priorDesign!==void 0?{priorDesign:e.evolution.priorDesign}:{},...d?{sessionId:d.id,registerSession:t=>d.register(t)}:{}},{...s,emit:t=>{!v&&k===void 0&&(k=O(t)??void 0),s.emit?.(V(t,{verb:"design",...N!==void 0?{id:N}:{}}))},agent:Y,ask:t=>n.ask(t),chat:n,nested:!0,out:t=>{b=t},progress:()=>{},isTTY:!0})}catch(t){if(!(e.onHeld&&t instanceof I&&t.code==="SESSION_CLASH"))throw t;g={heldBy:t.extra?.heldBy??null},u=2}finally{let t=u===3&&n.state.status==="pausing";g?n.ledger({kind:"childClose",verb:r,subject:p,ok:!1,durS:0,held:!0}):t&&e.quietEnding||M(u),v||n.endUnstartedTurn(),v&&!t?e.onEnded?.("ran",{exit:u}):g?e.onEnded?.("refused",{code:"SESSION_CLASH"}):k?.final&&e.onEnded?.("refused",{code:k.code})}return g?(e.onHeld(g.heldBy),u):(u!==0&&b&&!e.quietEnding&&n.note(b),u)}export{Q as a,X as b,le as c};
2
+ import{a as V}from"./chunk-RTVWQK7I.js";import{a as j,f as q}from"./chunk-PRBWZXFA.js";import{c as H,e as A,g as P}from"./chunk-4KCYNP2K.js";import{c as _}from"./chunk-JNPFEBUR.js";import{a as O}from"./chunk-VZJ6LUXX.js";import{n as L}from"./chunk-DXIQVBMI.js";import{c as h}from"./chunk-BWXLZS5O.js";import{a as I}from"./chunk-GFLB2SHW.js";import{M as S}from"./chunk-PI7OXS62.js";import{o as D}from"./chunk-HYJVYYAZ.js";function F(e,n){try{let s=e.sessions().peek(n);return!s||!L(s,e.sessions().hasBase(n))?!1:(e.sessions().resume(n).complete({ended:"failed",code:"SESSION_KEPT_NOTHING"}),!0)}catch{return!1}}var J=e=>e!==null?{fixCmd:e}:{};function Q(e,n){return e.recordsSince(null).flatMap(o=>{let r=o.design_phase?.phase;return o.sid===n&&typeof r=="string"&&_[r]?[_[r]]:[]}).at(-1)}function X(e,n,s){return e.recordsSince(s).some(o=>o.sid!==n||!o.design_of?!1:o.design_phase?.phase==="tests"||o.nodes.some(r=>r.label==="test"))}async function le(e,n,s){let o=n.enterNested?.("opening the design\u2026")??(()=>{});try{return await Z(e,n,s)}finally{o()}}async function Z(e,n,s){let{force:o=!1,verb:r="design",childSession:d}=e,i=e.resume===!0?d:void 0;if(e.resume===!0&&i===void 0)return n.note("design child not resumed \u2014 a resume needs the child's session"),n.endUnstartedTurn(),2;if(i!==void 0&&F(s.store,i.id))return n.note(`design child ${i.id} kept nothing to resume \u2014 its agent never started; its offer opens again`),n.endUnstartedTurn(),2;let f=(()=>{if(i===void 0)return e.ucRef;try{return s.store.sessions().peek(i.id)?.use_case??e.ucRef}catch{return e.ucRef}})(),y=!1;if(i===void 0)try{let t=H(S(s.store),f);if(!t.ok&&(t.code==="UC_UNREVIEWED"||t.code==="UC_ARCHIVED")){let l=e.confirmUnreviewed??(C=>P(m=>n.ask(m),C)),a=!A(t);if(a||!await l(t))return n.note(t.reviewCmd!==void 0?`design child refused \u2014 approve it first: ${t.reviewCmd}`:"design child refused \u2014 approve it first"),n.endUnstartedTurn(),e.onEnded?.(a?"refused":"declined",a?{code:t.code}:void 0),2;y=!0}}catch{y=!1}let p=(()=>{try{let t=S(s.store),l=t.resolve(f);return(l?t.getNode(l.tip)?.content?.title:void 0)??f}catch{return f}})(),c=d?.id??i?.id,E=i?null:s.store.head(),B=i&&c!==void 0?Q(s.store,c):void 0,W=h(n.state.turns).entries.length,R=()=>h(n.state.turns).entries.filter(t=>t.kind==="test").length,$=R(),T=n.state.credits?.total,K=Date.now();n.ledger({kind:"childOpen",verb:r,subject:p,...d?{sid:d.id}:{},...i?{resumed:!0}:{},...e.replaces?{replaces:e.replaces}:{},...B?{landed:B}:{},...e.evolution?{update:!0}:{},...e.evolution?.changed?{changed:!0}:{}});let M=t=>{let l=Math.max(1,Math.round((Date.now()-K)/1e3)),a=h(n.state.turns).entries.length-W,C=R()-$,m=n.state.credits?.total,w=m!==void 0&&T!==void 0?m-T:m,U=e.evolution!==void 0&&t===0&&c!==void 0&&!s.store.recordsSince(E).some(x=>x.sid===c),G=t===0&&c!==void 0&&!U&&!X(s.store,c,E);if(n.ledger(t===0?{kind:"childClose",verb:r,subject:p,ok:!0,durS:l,...e.evolution?{update:!0}:{},...U?{untouched:!0}:{},...G?{unfinished:!0}:{},...a>0?{results:`${a} item${a===1?"":"s"}`}:{},...C>0?{tests:C}:{},...e.evolution&&c!==void 0?{testsWritten:j(s.store.recordsSince(E).filter(x=>x.sid===c),S(s.store))}:{},...w!==void 0&&w>0?{credits:w}:{}}:{kind:"childClose",verb:r,subject:p,ok:!1,durS:l,exitCode:t,...e.evolution?{update:!0}:{},...J(i!==void 0?D().command("next.resume_child",{sid:i.id}):D().command("next.design_use_case",{use_case:f,force:o||r==="evolve"}))}),e.quietEnding)return;let z=h(n.state.turns).entries.length;n.ledger({kind:"childBack",parentVerb:"extract",context:D().text("chat.child_back",{drafts:z})})},b="",u=1,v=!1,k,g,N=d?.id,Y=(...t)=>(v=!0,s.agent(...t));try{u=await q(i?{resume:i.id,mode:"interactive"}:{useCase:f,force:o,mode:"interactive",...y?{allowUnreviewed:!0}:{},...e.statement?{agentStatement:e.statement}:{},...e.evolution?.because?{because:e.evolution.because}:{},...e.evolution?.changeDelta!==void 0?{changeDelta:e.evolution.changeDelta}:{},...e.evolution?.priorDesign!==void 0?{priorDesign:e.evolution.priorDesign}:{},...d?{sessionId:d.id,registerSession:t=>d.register(t)}:{}},{...s,emit:t=>{!v&&k===void 0&&(k=O(t)??void 0),s.emit?.(V(t,{verb:"design",...N!==void 0?{id:N}:{}}))},agent:Y,ask:t=>n.ask(t),chat:n,nested:!0,out:t=>{b=t},progress:()=>{},isTTY:!0})}catch(t){if(!(e.onHeld&&t instanceof I&&t.code==="SESSION_CLASH"))throw t;g={heldBy:t.extra?.heldBy??null},u=2}finally{let t=u===3&&n.state.status==="pausing";g?n.ledger({kind:"childClose",verb:r,subject:p,ok:!1,durS:0,held:!0}):t&&e.quietEnding||M(u),v||n.endUnstartedTurn(),v&&!t?e.onEnded?.("ran",{exit:u}):g?e.onEnded?.("refused",{code:"SESSION_CLASH"}):k?.final&&e.onEnded?.("refused",{code:k.code})}return g?(e.onHeld(g.heldBy),u):(u!==0&&b&&!e.quietEnding&&n.note(b),u)}export{Q as a,X as b,le as c};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{i as U}from"./chunk-I2VU2DTS.js";import{g as S}from"./chunk-RLOJH5O6.js";import{a as E}from"./chunk-DBMW3VUN.js";var h=1,v=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;var L=["cites-deep"],C=["observe","events","refresh","check","tools","migrate"],d={remote:"fetch",explain:"explain",context:"context",coverage:"coverage"},x=class extends Error{remedy;constructor(a,p){super(a),this.name="SourcePluginRefusal",this.remedy=p}};var T=class extends Error{refusal;constructor(a){super(`${a.code}: ${a.message}${a.remedy?` \u2014 ${a.remedy}`:""}`),this.name="SourcePluginError",this.refusal=a}};function A(l){let a=l.manifest?.capabilities;return Array.isArray(a)?a:[]}var i=(l,a,p={})=>{throw new T({code:l,message:a,...p})},R="test-",O=new Set(["http","https","file"]),b=new Set(U.map(l=>l.name)),G=Object.values(d),$=/^([a-z][a-z0-9-]{1,31}):([\s\S]+)$/,_={plugins:[],byId:()=>{},route:()=>null},D=l=>/(\.[^./\\]+)$/.exec(l)?.[1]?.toLowerCase()??"";function Y(l,a={}){let p=new Set(S.flatMap(o=>o.extensions)),c=new Map,P=new Map,I=new Map;for(let o of l){let r=o?.manifest,e=typeof r?.id=="string"?r.id:"",t={plugin:e||"(no id)"};r?.contract!==h&&i("PLUGIN_CONTRACT_UNSUPPORTED",`plugin ${t.plugin} is written against contract ${String(r?.contract)}; this build has contract ${h}`,t),E.test(e)||i("PLUGIN_ID_INVALID",`${JSON.stringify(r.id)} is not a plugin id: lower-case letters, digits and hyphens, starting with a letter, 2 to 32 characters`,t),e.startsWith(R)&&a.allowTestPlugins!==!0&&i("PLUGIN_ID_RESERVED",`plugin ${e} is a test plugin: an id starting with ${R} is loaded by the conformance suite only`,t),O.has(e)&&i("PLUGIN_ID_TAKEN",`${e} cannot be a plugin id: it already means something at the start of an input`,t),b.has(e)&&i("PLUGIN_ID_TAKEN",`${e} cannot be a plugin id: it is the name of a built-in remote source kind`,t),(c.has(e)||I.has(e))&&i("PLUGIN_ID_TAKEN",`two loaded plugins use the name ${e}`,t),(typeof r.version!="string"||r.version==="")&&i("PLUGIN_ID_INVALID",`plugin ${e} names no version`,t),(typeof r.rules!="string"||r.rules==="")&&i("PLUGIN_RULES_MISSING",`plugin ${e} names no fingerprint-rules version`,t),r.capabilities!==void 0&&!Array.isArray(r.capabilities)&&i("PLUGIN_CAPABILITY_UNKNOWN",`plugin ${e}: capabilities must be a list of capability names`,t);let u=A(o);for(let n of u){if(L.includes(n))continue;if(!(n in d)){let N=C.includes(n);i("PLUGIN_CAPABILITY_UNKNOWN",`plugin ${e} lists the capability ${JSON.stringify(n)}, which ${N?"is reserved and not defined yet":"this contract does not define"}`,t)}let s=d[n];typeof o[s]!="function"&&i("PLUGIN_CAPABILITY_WITHOUT_HOOK",`plugin ${e} lists the capability ${n} and has no ${s} hook`,t)}u.includes("cites-deep")&&!(u.includes("context")&&typeof o.context=="function")&&i("PLUGIN_CITES_DEEP_WITHOUT_CONTEXT",`plugin ${e} lists the capability cites-deep without the capability context and its hook: the instruction to cite each criterion, scenario and test could never reach the design agent`,{...t,remedy:"list the context capability, with its hook, and say in its design note what each item should cite"});for(let n of G){let s=Object.entries(d).find(([,N])=>N===n)[0];o[n]!==void 0&&!u.includes(s)&&i("PLUGIN_HOOK_WITHOUT_CAPABILITY",`plugin ${e} has the hook ${n} and does not list the capability ${s}`,t)}for(let n of["claim","render","index"])typeof o[n]!="function"&&i("PLUGIN_CAPABILITY_WITHOUT_HOOK",`plugin ${e} has no ${n} hook, which every plugin needs`,t);let g=r.claims?.extensions??[];Array.isArray(g)||i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims its extensions as ${JSON.stringify(g)}, which is not a list`,t);for(let n of g){(typeof n!="string"||!/^\.[a-z0-9][a-z0-9._-]*$/.test(n))&&i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims ${JSON.stringify(n)}, which is not a file extension: lower-case, starting with a dot`,t);let s=n;s.lastIndexOf(".")!==0&&i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims ${s}, which holds a second dot: an input's extension is what follows its last dot, so no input would ever be routed to it`,t),p.has(s)&&i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims ${s}, which a built-in source kind already reads`,t),P.has(s)&&i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims ${s}, which plugin ${P.get(s).manifest.id} already claims`,t),P.set(s,o)}let y=r.claims?.schemes??[];Array.isArray(y)||i("PLUGIN_SCHEME_TAKEN",`plugin ${e} claims its schemes as ${JSON.stringify(y)}, which is not a list`,t);for(let n of y){(typeof n!="string"||!E.test(n)||O.has(n))&&i("PLUGIN_SCHEME_TAKEN",`plugin ${e} claims the scheme ${JSON.stringify(n)}, which is not one a plugin may have`,t);let s=n;b.has(s)&&i("PLUGIN_SCHEME_TAKEN",`plugin ${e} claims the scheme ${s}, which is the name of a built-in remote source kind`,t),(I.has(s)||c.has(s)&&s!==e)&&i("PLUGIN_SCHEME_TAKEN",`plugin ${e} claims the scheme ${s}, which another loaded plugin already uses`,t),I.set(s,o)}c.set(e,o)}for(let[o,r]of I)A(r).includes("remote")||i("PLUGIN_SCHEME_WITHOUT_REMOTE",`plugin ${r.manifest.id} claims the scheme ${o} but has no remote capability, so it can never read a ${o}:// input`,{plugin:r.manifest.id});return c.size===0?_:{plugins:[...c.values()],byId:o=>c.get(o),route(o,r){let e=$.exec(o);if(e&&!r(o)){let u=I.get(e[1]);if(u)return{plugin:u,ref:o,named:!1};let g=c.get(e[1]);if(g)return{plugin:g,ref:e[2],named:!0}}let t=P.get(D(o));return t&&!/^https?:\/\//i.test(o)?{plugin:t,ref:o,named:!1}:null}}}var f=_,m,J=()=>f,j=()=>m;function q(l,a){if(f!==_)throw new Error("a source-plugin registry is already installed: a host installs its registry once");return f=l,m=a,()=>{f===l&&(f=_,m=void 0)}}export{v as a,x as b,T as c,A as d,i as e,_ as f,Y as g,J as h,j as i,q as j};
2
+ import{i as U}from"./chunk-L3BUPFAQ.js";import{g as S}from"./chunk-Z24SD2EJ.js";import{a as E}from"./chunk-DBMW3VUN.js";var h=1,v=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;var L=["cites-deep"],C=["observe","events","refresh","check","tools","migrate"],d={remote:"fetch",explain:"explain",context:"context",coverage:"coverage"},x=class extends Error{remedy;constructor(a,p){super(a),this.name="SourcePluginRefusal",this.remedy=p}};var T=class extends Error{refusal;constructor(a){super(`${a.code}: ${a.message}${a.remedy?` \u2014 ${a.remedy}`:""}`),this.name="SourcePluginError",this.refusal=a}};function A(l){let a=l.manifest?.capabilities;return Array.isArray(a)?a:[]}var i=(l,a,p={})=>{throw new T({code:l,message:a,...p})},R="test-",O=new Set(["http","https","file"]),b=new Set(U.map(l=>l.name)),G=Object.values(d),$=/^([a-z][a-z0-9-]{1,31}):([\s\S]+)$/,_={plugins:[],byId:()=>{},route:()=>null},D=l=>/(\.[^./\\]+)$/.exec(l)?.[1]?.toLowerCase()??"";function Y(l,a={}){let p=new Set(S.flatMap(o=>o.extensions)),c=new Map,P=new Map,I=new Map;for(let o of l){let r=o?.manifest,e=typeof r?.id=="string"?r.id:"",t={plugin:e||"(no id)"};r?.contract!==h&&i("PLUGIN_CONTRACT_UNSUPPORTED",`plugin ${t.plugin} is written against contract ${String(r?.contract)}; this build has contract ${h}`,t),E.test(e)||i("PLUGIN_ID_INVALID",`${JSON.stringify(r.id)} is not a plugin id: lower-case letters, digits and hyphens, starting with a letter, 2 to 32 characters`,t),e.startsWith(R)&&a.allowTestPlugins!==!0&&i("PLUGIN_ID_RESERVED",`plugin ${e} is a test plugin: an id starting with ${R} is loaded by the conformance suite only`,t),O.has(e)&&i("PLUGIN_ID_TAKEN",`${e} cannot be a plugin id: it already means something at the start of an input`,t),b.has(e)&&i("PLUGIN_ID_TAKEN",`${e} cannot be a plugin id: it is the name of a built-in remote source kind`,t),(c.has(e)||I.has(e))&&i("PLUGIN_ID_TAKEN",`two loaded plugins use the name ${e}`,t),(typeof r.version!="string"||r.version==="")&&i("PLUGIN_ID_INVALID",`plugin ${e} names no version`,t),(typeof r.rules!="string"||r.rules==="")&&i("PLUGIN_RULES_MISSING",`plugin ${e} names no fingerprint-rules version`,t),r.capabilities!==void 0&&!Array.isArray(r.capabilities)&&i("PLUGIN_CAPABILITY_UNKNOWN",`plugin ${e}: capabilities must be a list of capability names`,t);let u=A(o);for(let n of u){if(L.includes(n))continue;if(!(n in d)){let N=C.includes(n);i("PLUGIN_CAPABILITY_UNKNOWN",`plugin ${e} lists the capability ${JSON.stringify(n)}, which ${N?"is reserved and not defined yet":"this contract does not define"}`,t)}let s=d[n];typeof o[s]!="function"&&i("PLUGIN_CAPABILITY_WITHOUT_HOOK",`plugin ${e} lists the capability ${n} and has no ${s} hook`,t)}u.includes("cites-deep")&&!(u.includes("context")&&typeof o.context=="function")&&i("PLUGIN_CITES_DEEP_WITHOUT_CONTEXT",`plugin ${e} lists the capability cites-deep without the capability context and its hook: the instruction to cite each criterion, scenario and test could never reach the design agent`,{...t,remedy:"list the context capability, with its hook, and say in its design note what each item should cite"});for(let n of G){let s=Object.entries(d).find(([,N])=>N===n)[0];o[n]!==void 0&&!u.includes(s)&&i("PLUGIN_HOOK_WITHOUT_CAPABILITY",`plugin ${e} has the hook ${n} and does not list the capability ${s}`,t)}for(let n of["claim","render","index"])typeof o[n]!="function"&&i("PLUGIN_CAPABILITY_WITHOUT_HOOK",`plugin ${e} has no ${n} hook, which every plugin needs`,t);let g=r.claims?.extensions??[];Array.isArray(g)||i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims its extensions as ${JSON.stringify(g)}, which is not a list`,t);for(let n of g){(typeof n!="string"||!/^\.[a-z0-9][a-z0-9._-]*$/.test(n))&&i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims ${JSON.stringify(n)}, which is not a file extension: lower-case, starting with a dot`,t);let s=n;s.lastIndexOf(".")!==0&&i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims ${s}, which holds a second dot: an input's extension is what follows its last dot, so no input would ever be routed to it`,t),p.has(s)&&i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims ${s}, which a built-in source kind already reads`,t),P.has(s)&&i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims ${s}, which plugin ${P.get(s).manifest.id} already claims`,t),P.set(s,o)}let y=r.claims?.schemes??[];Array.isArray(y)||i("PLUGIN_SCHEME_TAKEN",`plugin ${e} claims its schemes as ${JSON.stringify(y)}, which is not a list`,t);for(let n of y){(typeof n!="string"||!E.test(n)||O.has(n))&&i("PLUGIN_SCHEME_TAKEN",`plugin ${e} claims the scheme ${JSON.stringify(n)}, which is not one a plugin may have`,t);let s=n;b.has(s)&&i("PLUGIN_SCHEME_TAKEN",`plugin ${e} claims the scheme ${s}, which is the name of a built-in remote source kind`,t),(I.has(s)||c.has(s)&&s!==e)&&i("PLUGIN_SCHEME_TAKEN",`plugin ${e} claims the scheme ${s}, which another loaded plugin already uses`,t),I.set(s,o)}c.set(e,o)}for(let[o,r]of I)A(r).includes("remote")||i("PLUGIN_SCHEME_WITHOUT_REMOTE",`plugin ${r.manifest.id} claims the scheme ${o} but has no remote capability, so it can never read a ${o}:// input`,{plugin:r.manifest.id});return c.size===0?_:{plugins:[...c.values()],byId:o=>c.get(o),route(o,r){let e=$.exec(o);if(e&&!r(o)){let u=I.get(e[1]);if(u)return{plugin:u,ref:o,named:!1};let g=c.get(e[1]);if(g)return{plugin:g,ref:e[2],named:!0}}let t=P.get(D(o));return t&&!/^https?:\/\//i.test(o)?{plugin:t,ref:o,named:!1}:null}}}var f=_,m,J=()=>f,j=()=>m;function q(l,a){if(f!==_)throw new Error("a source-plugin registry is already installed: a host installs its registry once");return f=l,m=a,()=>{f===l&&(f=_,m=void 0)}}export{v as a,x as b,T as c,A as d,i as e,_ as f,Y as g,J as h,j as i,q as j};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as t}from"./chunk-TZVPDGJD.js";async function l(e){let o=e.credentials.expires_at,i=e.thresholdSeconds??300;if(o-Date.now()/1e3>=i)return null;let r=e.creds.loadClient(e.profile,e.env);if(!r)return null;let n=await new t(e.env).refreshToken(e.credentials.refresh_token,r.client_id),s=Math.floor(Date.now()/1e3)+n.expires_in;return e.creds.saveCredentials(e.profile,e.env,{access_token:n.access_token,refresh_token:n.refresh_token,expires_at:s,scope:n.scope}),{accessToken:n.access_token,refreshToken:n.refresh_token,expiresAt:s,scope:n.scope}}export{l as a};
2
+ import{a as t}from"./chunk-2GEAKFAV.js";async function l(e){let o=e.credentials.expires_at,i=e.thresholdSeconds??300;if(o-Date.now()/1e3>=i)return null;let r=e.creds.loadClient(e.profile,e.env);if(!r)return null;let n=await new t(e.env).refreshToken(e.credentials.refresh_token,r.client_id),s=Math.floor(Date.now()/1e3)+n.expires_in;return e.creds.saveCredentials(e.profile,e.env,{access_token:n.access_token,refresh_token:n.refresh_token,expires_at:s,scope:n.scope}),{accessToken:n.access_token,refreshToken:n.refresh_token,expiresAt:s,scope:n.scope}}export{l as a};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{L as _,a as b,c as x,r as S,x as k,y as O}from"./chunk-Z777GGHB.js";import{f as v,h as C}from"./chunk-KU3YHPWZ.js";var F=e=>`conv#turn=${e}`,$=(e,r)=>`${e}:turn:${r}`,N=/^(.+):turn:(\d+)$/,G=e=>N.test(e);function P(e){return e.flatMap(r=>{let t=r;return t.kind==="user_message"&&typeof t.data?.message_id=="string"?[t.data.message_id]:[]})}function L(e,r,t,n,o=[]){let a=e.parse(t);if(a!==null&&e.resolveToken(a)===null)return[];let m=new Set(P(n)),s=new Set;for(let i of e.recordsSince(a))i.conv?.source_id===r&&i.conv.turn>=1&&s.add(i.conv.turn);for(let i of o){let c=N.exec(i);c&&c[1]===r&&s.add(Number(c[2]))}if(s.size===0)return[];let d=e.headOf(r,{token:null}),l=typeof d=="string"?e.getNode(d,{token:null})?.content?.blob:void 0,f=typeof l=="string"?e.getBlob(l)?.toString("utf8")??"":"",p=[];for(let i of[...s].sort((c,u)=>c-u)){let c=$(r,i),u=m.has(c)?null:y(f,i);u?.speaker==="person"&&p.push({message_id:c,text:u.text})}return p}function y(e,r){for(let t of e.split(`
2
+ import{L as _,a as b,c as x,r as S,x as k,y as O}from"./chunk-PI7OXS62.js";import{f as v,h as C}from"./chunk-KU3YHPWZ.js";var F=e=>`conv#turn=${e}`,$=(e,r)=>`${e}:turn:${r}`,N=/^(.+):turn:(\d+)$/,G=e=>N.test(e);function P(e){return e.flatMap(r=>{let t=r;return t.kind==="user_message"&&typeof t.data?.message_id=="string"?[t.data.message_id]:[]})}function L(e,r,t,n,o=[]){let a=e.parse(t);if(a!==null&&e.resolveToken(a)===null)return[];let m=new Set(P(n)),s=new Set;for(let i of e.recordsSince(a))i.conv?.source_id===r&&i.conv.turn>=1&&s.add(i.conv.turn);for(let i of o){let c=N.exec(i);c&&c[1]===r&&s.add(Number(c[2]))}if(s.size===0)return[];let d=e.headOf(r,{token:null}),l=typeof d=="string"?e.getNode(d,{token:null})?.content?.blob:void 0,f=typeof l=="string"?e.getBlob(l)?.toString("utf8")??"":"",p=[];for(let i of[...s].sort((c,u)=>c-u)){let c=$(r,i),u=m.has(c)?null:y(f,i);u?.speaker==="person"&&p.push({message_id:c,text:u.text})}return p}function y(e,r){for(let t of e.split(`
3
3
  `))if(t.trim())try{let n=JSON.parse(t);if(n.turn===r){let o=n.speaker==="person"||n.speaker==="agent"||n.speaker==="kane"?n.speaker:null;return{text:k(n.text).text,speaker:o}}}catch{}return null}function H(e,r){return y(e,r)?.text??null}var E={format:"conversation",media_type:"text/x-conversation",anchors_supported:["#turn="]},V="su-conv-";function J(e){let{store:r,graph:t,sessionStamp:n}=e,o=`${V}${n}`,a=t.heads.get(o);if(typeof a=="string")return{record:null,errors:[{code:"CONV_SOURCE_EXISTS",detail:`${o} already exists \u2014 resume it`}],sourceId:o,cid:a};let m=r.putBlob(Buffer.from("","utf8")),s=x(o,m),d=C("source",s);if(d.length>0)return{record:null,errors:d.map(p=>({code:p.code,detail:p.detail})),sourceId:o,cid:""};let l=b("source",s);return{record:_(r,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:l,label:v.SOURCE,content:s}],edges:[],review:[],supersessions:[],source_head_moves:{[o]:l},media:{[o]:E},conv:{source_id:o,turn:0,append_of:null}},{graph:t,scope:{sourcePins:[{source_id:o}]},expectPrev:t.latestHash,intent:{v:1,verb:"conv-mint",args:S({sessionStamp:n,by:e.by}),pins:{}},provenance:e.provenance}).record,errors:null,sourceId:o,cid:l}}function X(e){let{store:r,graph:t,sourceId:n,force:o}=e,{text:a,replaced:m}=k(e.text),s=t.heads.get(n),d=t.convChains.get(n);if(typeof s!="string"||!d)return{record:null,errors:[{code:"CONV_SOURCE_MISSING",detail:`${n} is not a live conversation source`}]};let f=t.getNode(s)?.content?.blob;if(typeof f!="string")return{record:null,errors:[{code:"CONV_SOURCE_MISSING",detail:`${n} head node unreadable`}]};let p=r.getBlob(f)?.toString("utf8")??"",i=d.turns,c=i>0?y(p,i):null;if(!o&&c!==null&&c.text===a&&c.speaker===(e.speaker??null))return{record:null,errors:null,turn:i,cid:s,idempotent:!0};let u=i+1,I=e.speaker?{turn:u,text:a,speaker:e.speaker}:{turn:u,text:a},T=`${p}${JSON.stringify(I)}
4
4
  `,w=r.putBlob(Buffer.from(T,"utf8")),h=x(n,w),g=b("source",h),R=_(r,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:g,label:v.SOURCE,content:h}],edges:[],review:[],supersessions:[],source_head_moves:{[n]:g},media:{[n]:E},conv:{source_id:n,turn:u,append_of:s}},{graph:t,scope:{sourcePins:[{source_id:n}]},expectPrev:t.latestHash,intent:{v:1,verb:"conv-turn",args:S({sourceId:n,text:a,force:o??!1,by:e.by,...e.speaker?{speaker:e.speaker}:{}}),pins:{append_of:s}},provenance:e.provenance}),B=m>0?{warnings:[O(n,m)]}:{};return{record:R.record,errors:null,turn:u,cid:g,idempotent:!1,...B}}export{F as a,$ as b,G as c,P as d,L as e,H as f,V as g,J as h,X as i};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{h as N}from"./chunk-SB6P5EQH.js";import{C as k,M as C,O as R,R as v,sa as G,sb as D,ub as I,v as b}from"./chunk-Z777GGHB.js";import{f as w,g as _}from"./chunk-KU3YHPWZ.js";var l=(e,t,i=new Set)=>{let n=e.nameOf.get(t);if(n!==void 0)return n;if(i.has(t))return t;i.add(t);for(let[o,s]of e.superseded){if(s!==t||G(o,t,c=>e.nodeLabel.get(c)))continue;let u=l(e,o,i);if(u!==o)return u}return t};function F(e,t){let i=e.stale(t);if(i==="fresh")return;if(i==="orphaned")return"orphaned \u2014 no live source evidences this item";let n=[],o=new Map;for(let s of e.derivesInto(t))o.set(String(s.props.source_id),s);for(let[s,u]of o){let c=e.heads.get(s);if(c==null)continue;let g=D(e,t,s);if(g!==null){g.stale&&n.push(`DERIVES pin ${s} broke \u2014 ${I(s,g)}`);continue}if(c===u.props.source_cid)continue;let S=e.convChains.get(s)?.chain;S&&S.includes(String(u.props.source_cid))||n.push(`DERIVES pin ${s}@${String(u.props.source_cid).slice(0,19)} broke \u2014 the source head moved`)}for(let s of e.edgesFrom(t)){if(s.type===_.DERIVES||!e.superseded.has(s.dst))continue;let u=e.tipOf(s.dst);if(e.superseded.has(u)){n.push(`${s.type} pin \u2192 ${l(e,s.dst)} \u2014 target retired`);continue}let c=P(e,s.dst,u);n.push(c.length>0?`${l(e,s.dst)} updated: ${c.map(g=>g.field).join(", ")}`:`${s.type} pin \u2192 ${l(e,s.dst)} \u2014 target superseded`)}return n.length>0?n.join("; "):"stale \u2014 a pinned dependency moved"}function P(e,t,i){let n=e.getNode(t)?.content??{},o=e.getNode(i)?.content??{},s=c=>c===void 0?"":Array.isArray(c)?c.map(String).join(" \xB7 "):typeof c=="object"?JSON.stringify(c):String(c),u=[];for(let c of[...new Set([...Object.keys(n),...Object.keys(o)])].sort())JSON.stringify(n[c])!==JSON.stringify(o[c])&&u.push({field:c,old:s(n[c]),new:s(o[c])});return u}function L(e,t){let i=[];for(let{cid:n}of e.byLabel(w.SCENARIO))e.superseded.has(n)||e.edgesFrom(n).some(o=>o.type===_.BELONGS_TO&&e.tipOf(o.dst)===t)&&i.push(n);return i}function j(e,t){let i=[],n=[],o=[],s=[],u=[],c=[],g=L(e,t),S=new Set(g),p=(d,f)=>{let r=F(e,f);return r===void 0?d:{...d,stale:!0,stale_reason:r}};for(let d of g){let f=e.getNode(d)?.content??{};i.push(p({ref:l(e,d),title:String(f.title??""),case_type:String(f.case_type??""),intent:String(f.intent??"")},d));for(let r of e.edgesInto(d)){if(r.type!==_.AUTOMATES||e.superseded.has(r.src))continue;let a=e.getNode(r.src)?.content??{},y=e.edgesFrom(r.src).filter(m=>m.type===_.VERIFIES&&!e.superseded.has(m.dst)).map(m=>l(e,m.dst));n.push(p({ref:l(e,r.src),title:String(a.title??""),automates:l(e,d),check:a.check,verifies:y,...typeof a.target=="string"?{target:a.target}:{},...typeof a.app=="string"?{app:a.app}:{}},r.src)),u.push(r.src)}for(let r of e.edgesFrom(d))r.type!==_.EXERCISES||e.superseded.has(r.dst)||s.push({scenario:l(e,d),ac:l(e,r.dst)})}for(let{cid:d}of e.byLabel(w.AC)){if(e.superseded.has(d))continue;let f=e.edgesFrom(d).find(x=>x.type===_.SCOPED_TO);if(!f)continue;let r=e.tipOf(f.dst),a=e.superseded.has(r)&&e.nodeLabel.get(r)===w.SCENARIO&&e.edgesFrom(r).some(x=>x.type===_.BELONGS_TO&&e.tipOf(x.dst)===t);if(!(r===t||S.has(r)||a))continue;let m=e.getNode(d)?.content??{},O={ref:l(e,d),text:String(m.text??""),kind:String(m.kind??""),scope:r===t?"use-case":l(e,r)};o.push(a?{...O,stale:!0,stale_reason:`orphaned: its scenario ${l(e,r)} was retired \u2014 re-scope it (scoped_to_repoints) to a live scenario or the use case if it still holds; a redesign retires it with its scenario otherwise`}:p(O,d)),c.push(d)}let E=[],h=new Set;for(let d of[t,...g,...u,...c])for(let f of e.retractedEdgesTouching(d))h.has(f.ecid)||(h.add(f.ecid),E.push({type:f.type,src:l(e,f.src),dst:l(e,f.dst),at:f.retraction.at,...f.retraction.reason?{reason:f.retraction.reason}:{}}));return{scenarios:i,tests:n,acs:o,exercises:s,retracted_edges:E}}function $(e,t,i){let n=b(e,t,i);return n===null?null:n.toString("utf8")}function A(e,t){let i=t.split(`
2
+ import{h as N}from"./chunk-LTPOMMAB.js";import{C as k,M as C,O as R,R as v,sa as G,sb as D,ub as I,v as b}from"./chunk-PI7OXS62.js";import{f as w,g as _}from"./chunk-KU3YHPWZ.js";var l=(e,t,i=new Set)=>{let n=e.nameOf.get(t);if(n!==void 0)return n;if(i.has(t))return t;i.add(t);for(let[o,s]of e.superseded){if(s!==t||G(o,t,c=>e.nodeLabel.get(c)))continue;let u=l(e,o,i);if(u!==o)return u}return t};function F(e,t){let i=e.stale(t);if(i==="fresh")return;if(i==="orphaned")return"orphaned \u2014 no live source evidences this item";let n=[],o=new Map;for(let s of e.derivesInto(t))o.set(String(s.props.source_id),s);for(let[s,u]of o){let c=e.heads.get(s);if(c==null)continue;let g=D(e,t,s);if(g!==null){g.stale&&n.push(`DERIVES pin ${s} broke \u2014 ${I(s,g)}`);continue}if(c===u.props.source_cid)continue;let S=e.convChains.get(s)?.chain;S&&S.includes(String(u.props.source_cid))||n.push(`DERIVES pin ${s}@${String(u.props.source_cid).slice(0,19)} broke \u2014 the source head moved`)}for(let s of e.edgesFrom(t)){if(s.type===_.DERIVES||!e.superseded.has(s.dst))continue;let u=e.tipOf(s.dst);if(e.superseded.has(u)){n.push(`${s.type} pin \u2192 ${l(e,s.dst)} \u2014 target retired`);continue}let c=P(e,s.dst,u);n.push(c.length>0?`${l(e,s.dst)} updated: ${c.map(g=>g.field).join(", ")}`:`${s.type} pin \u2192 ${l(e,s.dst)} \u2014 target superseded`)}return n.length>0?n.join("; "):"stale \u2014 a pinned dependency moved"}function P(e,t,i){let n=e.getNode(t)?.content??{},o=e.getNode(i)?.content??{},s=c=>c===void 0?"":Array.isArray(c)?c.map(String).join(" \xB7 "):typeof c=="object"?JSON.stringify(c):String(c),u=[];for(let c of[...new Set([...Object.keys(n),...Object.keys(o)])].sort())JSON.stringify(n[c])!==JSON.stringify(o[c])&&u.push({field:c,old:s(n[c]),new:s(o[c])});return u}function L(e,t){let i=[];for(let{cid:n}of e.byLabel(w.SCENARIO))e.superseded.has(n)||e.edgesFrom(n).some(o=>o.type===_.BELONGS_TO&&e.tipOf(o.dst)===t)&&i.push(n);return i}function j(e,t){let i=[],n=[],o=[],s=[],u=[],c=[],g=L(e,t),S=new Set(g),p=(d,f)=>{let r=F(e,f);return r===void 0?d:{...d,stale:!0,stale_reason:r}};for(let d of g){let f=e.getNode(d)?.content??{};i.push(p({ref:l(e,d),title:String(f.title??""),case_type:String(f.case_type??""),intent:String(f.intent??"")},d));for(let r of e.edgesInto(d)){if(r.type!==_.AUTOMATES||e.superseded.has(r.src))continue;let a=e.getNode(r.src)?.content??{},y=e.edgesFrom(r.src).filter(m=>m.type===_.VERIFIES&&!e.superseded.has(m.dst)).map(m=>l(e,m.dst));n.push(p({ref:l(e,r.src),title:String(a.title??""),automates:l(e,d),check:a.check,verifies:y,...typeof a.target=="string"?{target:a.target}:{},...typeof a.app=="string"?{app:a.app}:{}},r.src)),u.push(r.src)}for(let r of e.edgesFrom(d))r.type!==_.EXERCISES||e.superseded.has(r.dst)||s.push({scenario:l(e,d),ac:l(e,r.dst)})}for(let{cid:d}of e.byLabel(w.AC)){if(e.superseded.has(d))continue;let f=e.edgesFrom(d).find(x=>x.type===_.SCOPED_TO);if(!f)continue;let r=e.tipOf(f.dst),a=e.superseded.has(r)&&e.nodeLabel.get(r)===w.SCENARIO&&e.edgesFrom(r).some(x=>x.type===_.BELONGS_TO&&e.tipOf(x.dst)===t);if(!(r===t||S.has(r)||a))continue;let m=e.getNode(d)?.content??{},O={ref:l(e,d),text:String(m.text??""),kind:String(m.kind??""),scope:r===t?"use-case":l(e,r)};o.push(a?{...O,stale:!0,stale_reason:`orphaned: its scenario ${l(e,r)} was retired \u2014 re-scope it (scoped_to_repoints) to a live scenario or the use case if it still holds; a redesign retires it with its scenario otherwise`}:p(O,d)),c.push(d)}let E=[],h=new Set;for(let d of[t,...g,...u,...c])for(let f of e.retractedEdgesTouching(d))h.has(f.ecid)||(h.add(f.ecid),E.push({type:f.type,src:l(e,f.src),dst:l(e,f.dst),at:f.retraction.at,...f.retraction.reason?{reason:f.retraction.reason}:{}}));return{scenarios:i,tests:n,acs:o,exercises:s,retracted_edges:E}}function $(e,t,i){let n=b(e,t,i);return n===null?null:n.toString("utf8")}function A(e,t){let i=t.split(`
3
3
  `).map(o=>o.replace(/^\d+\| /,"")),n=[];for(let o of e.split(`
4
4
  `)){let s=o.trim();if(s.length===0)continue;let u=i.find(c=>c.includes(s));u!==void 0&&!n.includes(u.trim())&&n.push(u.trim())}return n.length>0?n.join(`
5
5
  `):{removed:!0}}function T(e,t,i,n,o){let s=o?{requested:o}:{};if(n!==void 0&&n.trim().length>0)return{kind:"user-directive",text:n.trim(),...s};let u=[i,...j(t,i).acs.map(p=>t.resolve(p.ref)?.tip??"")].filter(Boolean),c=[],g=new Set;for(let p of u){let E=new Map;for(let d of R(t,p))for(let f of t.derivesInto(d))E.set(String(f.props.source_id),f);let h=(d,f,r)=>{let a=String(f.props.anchor),y=`${d}\0${a}`;if(g.has(y)||a==="img#whole")return;g.add(y);let m=$(e,t,String(f.props.source_cid)),O=m===null?null:k(m,a);if(O===null)return;let x=$(e,t,r);c.push({source_id:d,anchor:a,old_anchor_text:O,new_anchor_text:x===null?{removed:!0}:A(O,x)})};for(let[d,f]of E){let r=t.heads.get(d);if(r==null)continue;let a=D(t,p,d);if(a!==null){for(let y of a.failed)y.props.source_cid!==r&&h(d,y,r);continue}r!==f.props.source_cid&&h(d,f,r)}}let S;for(let[p,E]of t.superseded){if(E!==i||t.nodeLabel.get(p)!==w.USECASE)continue;let h=P(t,p,i);h.length>0&&(S=h);break}return{kind:"source-change",changes:c,...S?{uc_updated:S}:{},...s}}function U(e,t,i,n,o){let s=j(t,i);if(s.scenarios.length===0&&s.tests.length===0&&s.acs.length===0)return;let u=T(e,t,i,n,o);if(!(!o&&u.kind==="source-change"&&u.changes.length===0&&!u.uc_updated))return{prior_design:s,change_delta:u}}function K(e,t){if(!t.force||t.resume||!t.useCase||t.priorDesign!==void 0||t.changeDelta!==void 0)return t;let i=C(e),n=i.resolve(v(i,t.useCase));if(!n||i.nodeLabel.get(n.tip)!==w.USECASE||N(i,n.tip)===null)return t;let o=U(e,i,n.tip);return o?{...t,priorDesign:o.prior_design,changeDelta:o.change_delta}:t}export{F as a,j as b,U as c,K as d};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as f,c as j}from"./chunk-VE3SUJMA.js";import{e as g}from"./chunk-6K5BEEAJ.js";import{a as m}from"./chunk-GGV336P5.js";var _="KaneAI Generated",E="Untitled";async function p(e){let r=e.config.load(),d=new g(m(e.env).tmsBaseUrl,e.tmsCreds.username,e.tmsCreds.access_key),n=e.projectName??_,o=e.folderName??E,t=r.project_id??null,s=r.project_name??null;if(!t){let a=(await d.listProjects()).find(l=>l.name===n);if(a)t=a.project_id,s=a.name,e.log("info","ENSURE_PROJECT_FOUND","Found default project",{project_id:t,name:s});else{let l=await d.createProject(n);t=l.id,s=l.name,e.log("info","ENSURE_PROJECT_CREATED","Created default project",{project_id:t,name:s})}f(e.creds,e.config,e.profile,e.env,{projectId:t,projectName:s})}let c=r.folder_id??null,i=r.folder_name??null,u=!r.project_id;if(!c||u){let a=(await d.listFolders(t)).find(l=>l.name===o);if(a)c=a.id,i=a.name,e.log("info","ENSURE_FOLDER_FOUND","Found default folder",{folder_id:c,name:i});else{let l=await d.createFolder(t,o);c=l.id,i=l.name,e.log("info","ENSURE_FOLDER_CREATED","Created default folder",{folder_id:c,name:i})}f(e.creds,e.config,e.profile,e.env,{folderId:c,folderName:i})}return{projectId:t,projectName:s??n,folderId:c,folderName:i??o}}function A(e,r,d){let n=e.loadProfileConfig(r,d)??{};return{projectId:n.project_id??null,folderId:n.folder_id??null}}function N(e,r){return e.projectId===null||e.folderId===null||r===null?"needs-picker":r.project==="ok"&&r.folder==="ok"?"ok":r.project==="error"&&r.folder==="error"?"ok-tms-degraded":"needs-picker"}var k=(e,r)=>`error: profile "${e}" (${r}) has no project/folder configured AND no TMS credentials were available to auto-configure one.
2
+ import{b as f,c as j}from"./chunk-VE3SUJMA.js";import{e as g}from"./chunk-6K5BEEAJ.js";import{a as m}from"./chunk-FI2DVNRT.js";var _="KaneAI Generated",E="Untitled";async function p(e){let r=e.config.load(),d=new g(m(e.env).tmsBaseUrl,e.tmsCreds.username,e.tmsCreds.access_key),n=e.projectName??_,o=e.folderName??E,t=r.project_id??null,s=r.project_name??null;if(!t){let a=(await d.listProjects()).find(l=>l.name===n);if(a)t=a.project_id,s=a.name,e.log("info","ENSURE_PROJECT_FOUND","Found default project",{project_id:t,name:s});else{let l=await d.createProject(n);t=l.id,s=l.name,e.log("info","ENSURE_PROJECT_CREATED","Created default project",{project_id:t,name:s})}f(e.creds,e.config,e.profile,e.env,{projectId:t,projectName:s})}let c=r.folder_id??null,i=r.folder_name??null,u=!r.project_id;if(!c||u){let a=(await d.listFolders(t)).find(l=>l.name===o);if(a)c=a.id,i=a.name,e.log("info","ENSURE_FOLDER_FOUND","Found default folder",{folder_id:c,name:i});else{let l=await d.createFolder(t,o);c=l.id,i=l.name,e.log("info","ENSURE_FOLDER_CREATED","Created default folder",{folder_id:c,name:i})}f(e.creds,e.config,e.profile,e.env,{folderId:c,folderName:i})}return{projectId:t,projectName:s??n,folderId:c,folderName:i??o}}function A(e,r,d){let n=e.loadProfileConfig(r,d)??{};return{projectId:n.project_id??null,folderId:n.folder_id??null}}function N(e,r){return e.projectId===null||e.folderId===null||r===null?"needs-picker":r.project==="ok"&&r.folder==="ok"?"ok":r.project==="error"&&r.folder==="error"?"ok-tms-degraded":"needs-picker"}var k=(e,r)=>`error: profile "${e}" (${r}) has no project/folder configured AND no TMS credentials were available to auto-configure one.
3
3
 
4
4
  discover IDs:
5
5
  kane-cli projects list --search "<keyword>" --limit 10
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as h,b as x,c as O}from"./chunk-3AGP2BVN.js";import{oa as B}from"./chunk-Z777GGHB.js";import{a as S}from"./chunk-HCBYKLMW.js";import{b as i}from"./chunk-33DWJV67.js";import{a as w}from"./chunk-FOJHSG5M.js";import{z as s}from"./chunk-QMOGBKJM.js";import{e as L}from"./chunk-UR6MHSHU.js";var e=L(S(),1),W={high:0,med:1,low:2},E={high:s.red,med:"yellow",low:s.dim};function j(d){return d.map((n,o)=>({r:n,i:o})).sort((n,o)=>(W[n.r.risk??"zz"]??3)-(W[o.r.risk??"zz"]??3)||n.i-o.i).map(({r:n})=>n)}function z(d,n=120,o="risk"){if(d.length===0)return null;let a=j(d),l=t=>t.held?"(held)":t.staged||!t.id?"(staged)":B(t.id),p=Math.max(2,...a.map(t=>l(t).length)),g=o!==null,r=o!==null?Math.max(o.length,...a.map(t=>(t.badge??"").length)):0,m=n>=84&&a.some(t=>t.summary),c=2+(g?1:0)+(m?1:0),u=c+1+c*2,b=n-u-p-r,k=Math.max(...a.map(t=>Math.max(t.title.length,(t.marker??"").length)),5),f=Math.max(5,m?Math.min(k,Math.max(16,Math.floor(b*.5))):Math.min(k,b)),T=m?Math.max(7,b-f):0,R=(t,$,M,I)=>O(t,$,M,I.map(A=>A.length)),C=(t,$,M,I)=>[x(h(t,p),p),x(h($,f),f),...g?[x(h(M,r),r)]:[],...m?[x(h(I,T),T)]:[]],y=C("id","title",o??"","summary");return{showBadge:g,showSummary:m,headerCells:y,top:R("\u250C","\u252C","\u2510",y),middle:R("\u251C","\u253C","\u2524",y),bottom:R("\u2514","\u2534","\u2518",y),rows:a.map(t=>({cells:C(l(t),h(t.title,f),h(t.badge??"",r),h(t.summary??"",T)),badgeColor:t.badgeColor??E[t.badge??""]??s.dim,...t.marker?{markerCells:C("",h(t.marker,f),"","")}:{}}))}}function K(d,n){let o=z(d,n.width,n.badgeHeader===void 0?"risk":n.badgeHeader);if(o===null)return[];let a=(r,m)=>n.color?D(r,m):m,l=r=>a(s.dim,r),p=r=>n.color?w.bold(r):r,g=[l(o.top),`${l("\u2502 ")}${o.headerCells.map(p).join(l(" \u2502 "))}${l(" \u2502")}`,l(o.middle)];for(let r of o.rows){let[m,c,...u]=r.cells,b=o.showBadge?[a(r.badgeColor,u[0])]:[],k=o.showSummary?[u[o.showBadge?1:0]]:[];g.push(`${l("\u2502 ")}${a(s.assuranceAccent,m)}${l(" \u2502 ")}${[c,...b,...k].join(l(" \u2502 "))}${l(" \u2502")}`),r.markerCells&&g.push(l(`\u2502 ${r.markerCells.join(" \u2502 ")} \u2502`))}return g.push(l(o.bottom)),g}function D(d,n){if(d.startsWith("#"))return w.hex(d)(n);let o=w[d];return typeof o=="function"?o(n):n}function v({rows:d,width:n=120,badgeHeader:o="risk"}){let a=z(d,n,o);if(a===null)return null;let{showBadge:l,showSummary:p,headerCells:g}=a,r=[];r.push((0,e.jsx)(i,{color:s.dim,children:a.top},"t")),r.push((0,e.jsxs)(i,{children:[g.map((m,c)=>(0,e.jsxs)(i,{children:[(0,e.jsx)(i,{color:s.dim,children:c===0?"\u2502 ":" \u2502 "}),(0,e.jsx)(i,{bold:!0,children:m})]},c)),(0,e.jsx)(i,{color:s.dim,children:" \u2502"})]},"h")),r.push((0,e.jsx)(i,{color:s.dim,children:a.middle},"m"));for(let[m,c]of a.rows.entries()){let u=c.cells;r.push((0,e.jsxs)(i,{children:[(0,e.jsx)(i,{color:s.dim,children:"\u2502 "}),(0,e.jsx)(i,{color:s.assuranceAccent,children:u[0]}),(0,e.jsx)(i,{color:s.dim,children:" \u2502 "}),u[1],l?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i,{color:s.dim,children:" \u2502 "}),(0,e.jsx)(i,{color:c.badgeColor,children:u[2]})]}):null,p?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i,{color:s.dim,children:" \u2502 "}),u[l?3:2]]}):null,(0,e.jsx)(i,{color:s.dim,children:" \u2502"})]},`r-${m}`)),c.markerCells&&r.push((0,e.jsx)(i,{color:s.dim,children:`\u2502 ${c.markerCells.join(" \u2502 ")} \u2502`},`mk-${m}`))}return r.push((0,e.jsx)(i,{color:s.dim,children:a.bottom},"b")),(0,e.jsx)(e.Fragment,{children:r})}export{K as a,v as b};
2
+ import{a as h,b as x,c as O}from"./chunk-3AGP2BVN.js";import{oa as B}from"./chunk-PI7OXS62.js";import{a as S}from"./chunk-HCBYKLMW.js";import{b as i}from"./chunk-33DWJV67.js";import{a as w}from"./chunk-FOJHSG5M.js";import{z as s}from"./chunk-FAMQ4DHU.js";import{e as L}from"./chunk-UR6MHSHU.js";var e=L(S(),1),W={high:0,med:1,low:2},E={high:s.red,med:"yellow",low:s.dim};function j(d){return d.map((n,o)=>({r:n,i:o})).sort((n,o)=>(W[n.r.risk??"zz"]??3)-(W[o.r.risk??"zz"]??3)||n.i-o.i).map(({r:n})=>n)}function z(d,n=120,o="risk"){if(d.length===0)return null;let a=j(d),l=t=>t.held?"(held)":t.staged||!t.id?"(staged)":B(t.id),p=Math.max(2,...a.map(t=>l(t).length)),g=o!==null,r=o!==null?Math.max(o.length,...a.map(t=>(t.badge??"").length)):0,m=n>=84&&a.some(t=>t.summary),c=2+(g?1:0)+(m?1:0),u=c+1+c*2,b=n-u-p-r,k=Math.max(...a.map(t=>Math.max(t.title.length,(t.marker??"").length)),5),f=Math.max(5,m?Math.min(k,Math.max(16,Math.floor(b*.5))):Math.min(k,b)),T=m?Math.max(7,b-f):0,R=(t,$,M,I)=>O(t,$,M,I.map(A=>A.length)),C=(t,$,M,I)=>[x(h(t,p),p),x(h($,f),f),...g?[x(h(M,r),r)]:[],...m?[x(h(I,T),T)]:[]],y=C("id","title",o??"","summary");return{showBadge:g,showSummary:m,headerCells:y,top:R("\u250C","\u252C","\u2510",y),middle:R("\u251C","\u253C","\u2524",y),bottom:R("\u2514","\u2534","\u2518",y),rows:a.map(t=>({cells:C(l(t),h(t.title,f),h(t.badge??"",r),h(t.summary??"",T)),badgeColor:t.badgeColor??E[t.badge??""]??s.dim,...t.marker?{markerCells:C("",h(t.marker,f),"","")}:{}}))}}function K(d,n){let o=z(d,n.width,n.badgeHeader===void 0?"risk":n.badgeHeader);if(o===null)return[];let a=(r,m)=>n.color?D(r,m):m,l=r=>a(s.dim,r),p=r=>n.color?w.bold(r):r,g=[l(o.top),`${l("\u2502 ")}${o.headerCells.map(p).join(l(" \u2502 "))}${l(" \u2502")}`,l(o.middle)];for(let r of o.rows){let[m,c,...u]=r.cells,b=o.showBadge?[a(r.badgeColor,u[0])]:[],k=o.showSummary?[u[o.showBadge?1:0]]:[];g.push(`${l("\u2502 ")}${a(s.assuranceAccent,m)}${l(" \u2502 ")}${[c,...b,...k].join(l(" \u2502 "))}${l(" \u2502")}`),r.markerCells&&g.push(l(`\u2502 ${r.markerCells.join(" \u2502 ")} \u2502`))}return g.push(l(o.bottom)),g}function D(d,n){if(d.startsWith("#"))return w.hex(d)(n);let o=w[d];return typeof o=="function"?o(n):n}function v({rows:d,width:n=120,badgeHeader:o="risk"}){let a=z(d,n,o);if(a===null)return null;let{showBadge:l,showSummary:p,headerCells:g}=a,r=[];r.push((0,e.jsx)(i,{color:s.dim,children:a.top},"t")),r.push((0,e.jsxs)(i,{children:[g.map((m,c)=>(0,e.jsxs)(i,{children:[(0,e.jsx)(i,{color:s.dim,children:c===0?"\u2502 ":" \u2502 "}),(0,e.jsx)(i,{bold:!0,children:m})]},c)),(0,e.jsx)(i,{color:s.dim,children:" \u2502"})]},"h")),r.push((0,e.jsx)(i,{color:s.dim,children:a.middle},"m"));for(let[m,c]of a.rows.entries()){let u=c.cells;r.push((0,e.jsxs)(i,{children:[(0,e.jsx)(i,{color:s.dim,children:"\u2502 "}),(0,e.jsx)(i,{color:s.assuranceAccent,children:u[0]}),(0,e.jsx)(i,{color:s.dim,children:" \u2502 "}),u[1],l?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i,{color:s.dim,children:" \u2502 "}),(0,e.jsx)(i,{color:c.badgeColor,children:u[2]})]}):null,p?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i,{color:s.dim,children:" \u2502 "}),u[l?3:2]]}):null,(0,e.jsx)(i,{color:s.dim,children:" \u2502"})]},`r-${m}`)),c.markerCells&&r.push((0,e.jsx)(i,{color:s.dim,children:`\u2502 ${c.markerCells.join(" \u2502 ")} \u2502`},`mk-${m}`))}return r.push((0,e.jsx)(i,{color:s.dim,children:a.bottom},"b")),(0,e.jsx)(e.Fragment,{children:r})}export{K as a,v as b};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{l as a,m as b,n as c,o as d}from"./chunk-GJ7MO2FW.js";import"./chunk-Z36KVIRR.js";import"./chunk-Q4JV4U65.js";import"./chunk-226AGYHB.js";import"./chunk-6K5BEEAJ.js";import"./chunk-3G2LSTK5.js";import"./chunk-VZ7KXRXB.js";import"./chunk-FI2DVNRT.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-K75WIRI5.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";export{c as resolveVerdictTarget,b as runEvidenceLintPolicy,a as runEvidenceValidate,d as runEvidenceVerdict};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{$ as g,V as a,W as b,X as c,Y as d,Z as e,_ as f,_a as r,aa as h,ba as i,ca as j,da as k,ea as l,fa as m,ga as n,ha as o,ia as p,ja as q}from"./chunk-Z777GGHB.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-6NFOH4AC.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-UR6MHSHU.js";export{a as SLUG_RE,b as checkAcyclic,c as checkCardinality,d as citesOf,p as commitDeferGap,n as commitNames,m as commitPairMerge,k as commitProposal,o as commitRetire,l as commitReviewFacts,e as criteriaShape,h as mintEventId,i as nextEventIds,r as recordsSince,q as resolveDeferGaps,j as resolveLivingTip,f as validateCriterionOps,g as validateProposal};
2
+ import{$ as g,V as a,W as b,X as c,Y as d,Z as e,_ as f,_a as r,aa as h,ba as i,ca as j,da as k,ea as l,fa as m,ga as n,ha as o,ia as p,ja as q}from"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-UR6MHSHU.js";export{a as SLUG_RE,b as checkAcyclic,c as checkCardinality,d as citesOf,p as commitDeferGap,n as commitNames,m as commitPairMerge,k as commitProposal,o as commitRetire,l as commitReviewFacts,e as criteriaShape,h as mintEventId,i as nextEventIds,r as recordsSince,q as resolveDeferGaps,j as resolveLivingTip,f as validateCriterionOps,g as validateProposal};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-GGV336P5.js";import"./chunk-VZA7BPCK.js";import"./chunk-QMOGBKJM.js";import"./chunk-UR6MHSHU.js";export{a as getEnvironment,c as latticeAddress,b as targetEnv};
2
+ import{a,b,c}from"./chunk-FI2DVNRT.js";import"./chunk-K75WIRI5.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";export{a as getEnvironment,c as latticeAddress,b as targetEnv};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as X}from"./chunk-ZZZGTDYE.js";import"./chunk-3AGP2BVN.js";import{N as x,O as J,Q as z}from"./chunk-45NM23EQ.js";import"./chunk-6JUS2ULI.js";import"./chunk-HG2ILWCE.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{f as B,g as j}from"./chunk-LXCTV75T.js";import{g as E,h,i as k,k as P,l as L,m as M,n as C,o as F,r as H}from"./chunk-MEMXFTLD.js";import"./chunk-UWPG5MWM.js";import{b as q}from"./chunk-NVD2MXHQ.js";import"./chunk-73Y6T2UK.js";import{e as Y}from"./chunk-VE4HLIGA.js";import{i as K}from"./chunk-XMPTFXPW.js";import{a as D,f as T}from"./chunk-Z36KVIRR.js";import{f as U}from"./chunk-Q4JV4U65.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import{b as y,c as _}from"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-REKHAN53.js";import"./chunk-FOLUB336.js";import"./chunk-CQDCNP7V.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-W2HRX3DR.js";import"./chunk-PVN64537.js";import{Ha as v,f as W,x as R}from"./chunk-H4TIVILC.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-RQKMSNEU.js";import{a as G}from"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.js";import"./chunk-OKA6FPJM.js";import"./chunk-B57ZRHEQ.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import{oa as I,vb as A}from"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-VO66KP2W.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import{b as N}from"./chunk-VZ7KXRXB.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-FI2DVNRT.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-K75WIRI5.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import{a as S}from"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import{z as O}from"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";import{readdirSync as fe,statSync as ge}from"fs";import{join as ve}from"path";import{basename as Q,relative as ae}from"path";var ce={label:"to bring the project's tests into this folder, run:",cmd:"kane-cli context pull",agentCmd:"kane-cli context pull --mode agent",why:"brings the project's tests into this folder"},ie=["proven","partial","failing","not_run","not_designed","no_criteria"],b=e=>`${e} use-case${e===1?"":"s"}`,ue=e=>`${e} ${e===1?"criterion":"criteria"}`,V={high:0,med:1,low:2};function le(e,r){let n=new Map;for(let[t,c]of _(y(r)))c.length===1&&n.set(t,ae(r,c[0]));let{inScope:s}=L(e),o=M(e,new Set(s)),i=new Map(s.map(t=>[C(e,t),t]));return(t,c)=>{for(let l of o.get(i.get(t.id))??[])if(c(C(e,l)))for(let a of F(e,l)){let u=n.get(C(e,a));if(u)return u}}}function Z(e,r){let n=t=>({uc:t.id,title:t.title,cmd:`kane-cli design tests --use-case ${t.id}`,agentCmd:`kane-cli design tests --use-case ${t.id} --mode agent`,why:"designs its tests"}),s=(t,c,l)=>({uc:t.id,title:t.title,cmd:`kane-cli testmd run ${c}`,agentCmd:`kane-cli testmd run ${c} --agent`,why:l}),o=e.perUc.map((t,c)=>({u:t,i:c})).sort((t,c)=>(V[t.u.risk]??3)-(V[c.u.risk]??3)||t.i-c.i).map(({u:t})=>t);if(e.note==="nothing_run_yet"){let t=o.find(c=>c.state==="not_designed"||c.state==="no_criteria");return[{cmd:"kane-cli testrun run",agentCmd:"kane-cli testrun run --agent",why:"runs every test"},...t?[n(t)]:[]]}let i=[];for(let t of o)if(t.state==="not_designed"||t.state==="no_criteria")i.push(n(t));else if(t.state==="failing"){let c=r(t,l=>e.perAc[l]?.state==="failing");c&&i.push(s(t,c,"runs its failing test again"))}else if(t.state==="partial"||t.state==="not_run"){let c=r(t,l=>e.perAc[l]?.state!=="proven");c&&i.push(s(t,c,"runs its test"))}return i.slice(0,2)}function ee(e,r){let n=A(e),s=H({graph:n,runs:P(n)});return{source:"project",doc:s,next:Z(s,le(n,r)).map(({agentCmd:o,...i})=>i)}}function te(e,r){let n=Z(e,()=>{}),s=n.filter(o=>!/^kane-cli (testrun|testmd) run\b/.test(o.cmd));return k(e)===0&&s.length>0?{source:"project",doc:e,next:s}:r.testsHere||k(e)===0?{source:"project",doc:e,next:n}:{source:"project",doc:e,next:[ce,...s]}}async function re(e,r){let n=await T(e,r);if(!n)return{error:`no evidence pack at '${e}'`};let s=await U(n,"coverage/usecases.yaml");if(s==null)return{error:`${Q(n)} carries no coverage/usecases.yaml \u2014 the pack predates coverage or its project had no .context at seal time`};let o=N(s);if(!o||!Array.isArray(o.usecases))return{error:`${Q(n)}: coverage/usecases.yaml is not a usecases document`};if(o.coverage?.coverage_version===2)return{source:"pack",pack:n,doc:o.coverage};let i=o.rollup?.aspects??{},t=i.lenient??Object.values(i)[0];return{source:"pack",pack:n,sealed_rule:"earlier",pct:t?.summary?.coverage_pct??0,reached:o.usecases.length}}function de(e,r){if(e.state==="no_criteria")return"no criteria yet";let n=e.criteria>0&&e.proven===e.criteria?`${e.proven} of ${e.criteria} criteria proven`:`${e.proven} of ${e.criteria} proven`,s=Object.values(r.perAc).filter(o=>o.uc===e.id&&o.state==="failing").length;return[n,...s?[`${s} failing`]:[],...e.manual_runs?[`${e.manual_runs} run by hand`]:[],...e.stale?["its source changed"]:[]].join(" \xB7 ")}function me(e){let r=e.perUc.filter(s=>s.stale).length,n=e.flags.orphaned_usecases;return[...r===1?["1 use-case's source changed since; kane-cli context list --stale lists it"]:r>1?[`${r} use-cases' sources changed since; kane-cli context list --stale lists them`]:[],...e.flags.sources_not_fully_extracted.map(s=>`"${s}" isn't fully extracted yet, so more use-cases may count later`),...n===1?["1 use-case isn't counted: every source it came from was removed"]:n>1?[`${n} use-cases aren't counted: every source they came from was removed`]:[]]}var pe="a new run can take up to 5 minutes to count";function ne(e,r){let n=a=>r.color?S.hex(O.dim)(a):a,s=a=>X(a,{width:r.width-12,badgeHeader:"coverage",color:r.color}).map(u=>` ${u}`);if("sealed_rule"in e)return["sealed under the earlier rule, this pack counts only the use-cases it reached",` its own figure: ${Math.round(e.pct)}% across the ${e.reached===1?"1 use-case":`${e.reached} use-cases`} it reached`,"for coverage so far, run: kane-cli cover"];let{doc:o}=e;if(e.source==="pack"){let a=o.this_run??{usecases:[],criteria_passed:[],criteria_failed:[]},u=a.criteria_failed.length,$=o.perUc.map(d=>{if(!d.this_run)return{id:d.id,title:d.title,badge:"0% not reached",summary:"not run by this run"};let f=Object.values(o.perAc).filter(p=>p.uc===d.id),m=f.filter(p=>p.this_run==="passed").length,g=f.filter(p=>p.this_run==="failed").length;return{id:d.id,title:d.title,badge:`${Math.round(d.pct)}% ${h[d.state]}`,summary:`${m} of ${d.criteria} passed in this run${g?` \xB7 ${g} failed`:""}`}});return[`coverage from this pack's run: ${Math.round(o.pct)}% across its ${b(o.usecases.total)}`,` the run reached ${b(a.usecases.length)}: ${ue(a.criteria_passed.length)} passed${u?`, ${u} failed`:""}`,"",...s($),"for coverage so far, run: kane-cli cover"]}let i=r.project!==void 0?`"${r.project}"'s`:"this folder's",t=ie.filter(a=>o.usecases[a]>0).map(a=>`${o.usecases[a]} ${h[a]}`),c=me(o),l=o.perUc.map(a=>({id:a.id,title:a.title,badge:`${Math.round(a.pct)}% ${h[a.state]}`,summary:de(a,o)}));return[`coverage: ${Math.round(o.pct)}% across ${i} ${b(o.usecases.total)}${o.note==="nothing_run_yet"?" \xB7 nothing run yet":""}`,...t.length?[` ${t.join(" \xB7 ")}`]:[],...r.recentRun?[pe]:[],...l.length?["",...s(l)]:[],...c.map(a=>n(` ${a}`)),...c.length&&e.next.length?[""]:[],...e.next.flatMap(a=>[a.label!==void 0?`next: ${a.label}`:a.uc!==void 0?`next: for ${I(a.uc)} "${a.title}", run:`:"next: to run every test, run:",` ${a.cmd}`])]}var he=5*6e4;function Ce(e,r=Date.now()){let n=D(e);try{return fe(n).some(s=>s.endsWith(".evidence")&&r-ge(ve(n,s)).mtimeMs<he)}catch{return!1}}function w(e,r=!1){return e.source==="project"?{source:"project",...e.doc,...r?{recent_run:{may_not_count_yet:!0,up_to_minutes:5}}:{}}:"sealed_rule"in e?{source:"pack",pack:e.pack,sealed_rule:e.sealed_rule,pct:e.pct,usecases_reached:e.reached}:{source:"pack",pack:e.pack,...e.doc}}async function oe(e,r,n){if(e.from){let o=await re(e.from,n);return"error"in o?(x(r,o.error),null):o}let s=J(n,r);return s?ee(s,n):null}var ye={coverage_version:2,scope:"project",config:{rule:"newest_counted_verdict",weighting:"risk",weights:E},pct:0,note:"nothing_run_yet",usecases:{total:0,proven:0,partial:0,failing:0,not_run:0,not_designed:0,no_criteria:0},criteria:{total:0,proven:0},perUc:[],perAc:{},flags:{stale_sources:0,sources_not_fully_extracted:[],orphaned_usecases:0}};async function se(e,r,n,s){let o=e.projectName;try{let i=n.read??(async l=>W({url:e.latticeUrl,basicAuth:await(n.auth??Y)()}).projectCoverage(l)),{state:t,doc:c}=await i(e.projectId);return t==="computing"?"computing":t==="ready"&&c!==null?te(c,{testsHere:s}):R(null,j(v.coverReadFailed(o),"cover",r))}catch(i){return i instanceof K?B({code:i.code,message:i.message,...i.remedy?{remedy:i.remedy}:{}},"cover",r):i instanceof G&&i.code==="NO_CONTEXT"?{source:"project",doc:ye,next:[]}:R(i,j(v.assuranceOffOr(i,o,v.coverReadFailed(o)),"cover",r))}}async function Be(e,r=z(),n=process.cwd(),s={}){if(e.mode!==void 0&&e.mode!=="agent"&&e.mode!=="ci"&&e.mode!=="interactive")return x(r,`--mode must be interactive | agent | ci, got '${e.mode}'`),2;let o=e.mode==="agent"||e.mode==="ci",i=e.from===void 0?q(n):null,t=i?.kind==="remote"?i:null,c=t!==null&&Ce(n),l=t!==null&&_(y(n)).size>0;if(o){let{makeHeadlessIO:u,agentRefusal:$}=await import("./headless-io-FFM5T6KL.js"),d=u("ndjson","cover",{stdout:m=>r.out(m.replace(/\n$/,"")),stderr:m=>(r.err??r.out)(m.replace(/\n$/,""))}),f;if(t!==null){let m=await se(t,!0,s,l);if(typeof m=="number")return m;if(m==="computing")return d.event({type:"coverage",source:"project",state:"computing"}),d.done(0,void 0,[{cmd:"kane-cli cover --mode agent",why:"the shared project is still working it out"}]);f=m}else{let m=[],g=await oe(e,{out:()=>{},err:p=>m.push(p),confirm:async()=>!1,isTTY:!1},n);if(!g)return $(d,m.join("; ")||"cover refused");f=g}return d.event({type:"coverage",...w(f,c)}),d.done(0,void 0,f.source==="project"?f.next.map(({cmd:m,agentCmd:g,why:p})=>({cmd:g??m,why:p})):[])}let a;if(t!==null){let u=await se(t,!1,s,l);if(typeof u=="number")return u;if(e.json)return r.out(JSON.stringify(u==="computing"?{source:"project",state:"computing"}:w(u,c),null,2)),0;if(r.out(`using project "${t.projectName}", shared with your team`),r.out(""),u==="computing")return r.out(v.coverComputing(t.projectName)),0;a=u}else{let u=await oe(e,r,n);if(!u)return 2;if(a=u,e.json)return r.out(JSON.stringify(w(a),null,2)),0}for(let u of ne(a,{color:r.isTTY===!0,width:process.stdout.columns??120,...t!==null?{project:t.projectName}:{},...c?{recentRun:c}:{}}))r.out(u);return 0}export{Be as coverCommand};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-VZA7BPCK.js";import"./chunk-QMOGBKJM.js";import"./chunk-UR6MHSHU.js";export{a as CredentialsManager};
2
+ import{a}from"./chunk-K75WIRI5.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";export{a as CredentialsManager};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk-XMALVGH7.js";import"./chunk-4JOD47QI.js";import"./chunk-GMTHZUZ3.js";import"./chunk-QMOGBKJM.js";import"./chunk-UR6MHSHU.js";export{a as DEPS_INSTALL_SCHEMA_VERSION,i as DepsBundleResolver,c as DepsInstallRequiredError,h as NoPublishedBundleError,b as classOfTarget,g as downloadPayload,e as formatEta,d as formatRate,j as managedDeps,f as planRangeParts};
2
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-HX5OLRKU.js";import"./chunk-4JOD47QI.js";import"./chunk-GMTHZUZ3.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";export{a as DEPS_INSTALL_SCHEMA_VERSION,i as DepsBundleResolver,c as DepsInstallRequiredError,h as NoPublishedBundleError,b as classOfTarget,g as downloadPayload,e as formatEta,d as formatRate,j as managedDeps,f as planRangeParts};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import"./chunk-UR6MHSHU.js";var c="Mobile dependencies are resolved through your KaneAI account. Run `kane-cli login` first.";function d(l,o,e=process.env){return e.KANE_MOBILE_DEPS_BASE_URL||o(l)}async function u(){let[{CredentialsManager:l},{refreshOAuthToken:o},{getEnvironment:e},{ControllerClient:n}]=await Promise.all([import("./credentials-TLT3RQOO.js"),import("./token-refresh-LR33BKAB.js"),import("./config-B472DZSR.js"),import("./controller-client-PB3AZAGG.js")]),s=new l;return{creds:s,refresh:r=>o({creds:s,profile:r.profile,env:r.env,credentials:r.credentials}),controllerBaseUrlFor:r=>d(r,t=>e(t).controllerBaseUrl),makeClient:(r,t)=>new n(r,t)}}function p(l){return async o=>{let e=l??await u(),n=e.creds.getActiveProfile();if(!n)throw new Error(c);let s=e.creds.getDefaultEnv(),r=e.controllerBaseUrlFor(s),t=e.creds.loadBasicAuth(n,s);if(t)return e.makeClient(r,{username:t.username,accessKey:t.access_key}).resolveMobileDepsBundle(o);let i=e.creds.loadCredentials(n,s);if(!i)throw new Error(c);try{await e.refresh({creds:e.creds,profile:n,env:s,credentials:i})}catch{}let a=(e.creds.loadCredentials(n,s)??i).access_token;if(typeof a!="string"||!a)throw new Error(c);return e.makeClient(r,a).resolveMobileDepsBundle(o)}}export{p as controllerResolveBundle,d as depsControllerBaseUrl};
2
+ import"./chunk-UR6MHSHU.js";var c="Mobile dependencies are resolved through your KaneAI account. Run `kane-cli login` first.";function d(l,o,e=process.env){return e.KANE_MOBILE_DEPS_BASE_URL||o(l)}async function u(){let[{CredentialsManager:l},{refreshOAuthToken:o},{getEnvironment:e},{ControllerClient:n}]=await Promise.all([import("./credentials-BCR73VGS.js"),import("./token-refresh-K6PVBBFE.js"),import("./config-YMHI3H3Y.js"),import("./controller-client-PB3AZAGG.js")]),s=new l;return{creds:s,refresh:r=>o({creds:s,profile:r.profile,env:r.env,credentials:r.credentials}),controllerBaseUrlFor:r=>d(r,t=>e(t).controllerBaseUrl),makeClient:(r,t)=>new n(r,t)}}function p(l){return async o=>{let e=l??await u(),n=e.creds.getActiveProfile();if(!n)throw new Error(c);let s=e.creds.getDefaultEnv(),r=e.controllerBaseUrlFor(s),t=e.creds.loadBasicAuth(n,s);if(t)return e.makeClient(r,{username:t.username,accessKey:t.access_key}).resolveMobileDepsBundle(o);let i=e.creds.loadCredentials(n,s);if(!i)throw new Error(c);try{await e.refresh({creds:e.creds,profile:n,env:s,credentials:i})}catch{}let a=(e.creds.loadCredentials(n,s)??i).access_token;if(typeof a!="string"||!a)throw new Error(c);return e.makeClient(r,a).resolveMobileDepsBundle(o)}}export{p as controllerResolveBundle,d as depsControllerBaseUrl};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as c}from"./chunk-KM3YCIDV.js";import{a as l}from"./chunk-JGLADDRH.js";import"./chunk-2L3A5NKZ.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-QMOGBKJM.js";import"./chunk-UR6MHSHU.js";async function S(e){let{site:i,store:s}=e,[{makeChatController:p},{commitChatTurn:m},{topologyDescriptor:u},{explain:g},{buildDossier:h},{testDefinitionOf:d}]=await Promise.all([import("./chat-controller-FWFQVZTB.js"),import("./chat-committer-FM5NG46O.js"),import("./descriptor-7T32VRMB.js"),import("./explain-DGJ5T6V5.js"),import("./dossier-6KMKEIXV.js"),import("./test-definition-53XNBEDE.js")]),n={current:null},a={current:[]},o=p({commitChatTurn:t=>m({...t,store:s,definitionOf:d}),descriptor:u("design"),store:s,refreshGraph:()=>i.graph(),graph:i.graph(),explain:g,by:{kind:"human",id:"owner"},templateVersion:()=>n.current,pendingForceScope:()=>a.current,...e.useCase?{ucRef:e.useCase}:{}});return{controller:o,inspect:t=>{try{return h(i.graph(),t)}catch{return null}},runDeps:t=>({store:s,projectDir:process.cwd(),...e.testFilesAt?{testFilesAt:e.testFilesAt}:{},agent:e.agent,tracePath:l,credentials:e.credentials,onIngestRefusal:c,onTemplateVersion:r=>{n.current=r},onForceScope:r=>{a.current=r},preflightTurn:e.preflight,...t.onSummary?{onSummary:t.onSummary}:{},ask:r=>o.ask(r),out:r=>o.note(r),progress:()=>{},isTTY:t.isTTY,auth:e.auth,chat:o,...t.telemetry?{telemetry:t.telemetry}:{}})}}export{S as buildDesignChat};
2
+ import{a as c}from"./chunk-KM3YCIDV.js";import{a as l}from"./chunk-2COXO5LQ.js";import"./chunk-B57ZRHEQ.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import"./chunk-VO66KP2W.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";async function S(e){let{site:i,store:s}=e,[{makeChatController:p},{commitChatTurn:m},{topologyDescriptor:u},{explain:g},{buildDossier:h},{testDefinitionOf:d}]=await Promise.all([import("./chat-controller-FXRJXUG3.js"),import("./chat-committer-ZKEKJA2R.js"),import("./descriptor-7T32VRMB.js"),import("./explain-DGJ5T6V5.js"),import("./dossier-5XKNAK6Q.js"),import("./test-definition-53XNBEDE.js")]),n={current:null},a={current:[]},o=p({commitChatTurn:t=>m({...t,store:s,definitionOf:d}),descriptor:u("design"),store:s,refreshGraph:()=>i.graph(),graph:i.graph(),explain:g,by:{kind:"human",id:"owner"},templateVersion:()=>n.current,pendingForceScope:()=>a.current,...e.useCase?{ucRef:e.useCase}:{}});return{controller:o,inspect:t=>{try{return h(i.graph(),t)}catch{return null}},runDeps:t=>({store:s,projectDir:process.cwd(),...e.testFilesAt?{testFilesAt:e.testFilesAt}:{},agent:e.agent,tracePath:l,credentials:e.credentials,onIngestRefusal:c,onTemplateVersion:r=>{n.current=r},onForceScope:r=>{a.current=r},preflightTurn:e.preflight,...t.onSummary?{onSummary:t.onSummary}:{},ask:r=>o.ask(r),out:r=>o.note(r),progress:()=>{},isTTY:t.isTTY,auth:e.auth,chat:o,...t.telemetry?{telemetry:t.telemetry}:{}})}}export{S as buildDesignChat};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b,c,d,e,f,g}from"./chunk-MINDIQET.js";import"./chunk-LX2I4JEH.js";import"./chunk-GEZVC4S3.js";import"./chunk-3KY7HHQU.js";import"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-UR6MHSHU.js";export{a as blockerRefResolver,e as captureForceScope,f as commitDesign,g as designPhaseLadder,b as forceConsumedLabels,d as forceRemainderOf,c as splitForceScope};