@testmuai/kane-cli 0.8.15 → 0.8.17

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 (295) hide show
  1. package/dist/{ChatSurface-2GPR4S7I.js → ChatSurface-X2HLVN2I.js} +1 -1
  2. package/dist/{ChromeProfilePicker-XAZGCJKR.js → ChromeProfilePicker-YU7HL6Z5.js} +1 -1
  3. package/dist/{CliFeedbackPrompt-4SILDU7S.js → CliFeedbackPrompt-7FEEVGCU.js} +1 -1
  4. package/dist/{CliUploadProgress-OAQBY55Y.js → CliUploadProgress-OTVPBGW4.js} +1 -1
  5. package/dist/{ConfigView-FDBMJC26.js → ConfigView-UKHUASHL.js} +1 -1
  6. package/dist/EvidenceViewOffer-LIPGXO23.js +2 -0
  7. package/dist/FolderPicker-OTQYRAYC.js +2 -0
  8. package/dist/{InfoBox-ZPUBB7J4.js → InfoBox-2TYT2ROK.js} +1 -1
  9. package/dist/{LinksBox-MNNNOH23.js → LinksBox-7AS6D7MX.js} +1 -1
  10. package/dist/{ProfilesView-GY5QCIT3.js → ProfilesView-F4MFHZ7Y.js} +1 -1
  11. package/dist/{ProjectPicker-UCHMCNFV.js → ProjectPicker-QLGZM35L.js} +1 -1
  12. package/dist/{SaveSessionPrompt-ATVHKAHN.js → SaveSessionPrompt-T4MS76FY.js} +1 -1
  13. package/dist/SingleShotApp-4CDTAF3H.js +2 -0
  14. package/dist/{SummaryBox-2DTNE25L.js → SummaryBox-IX32QPWM.js} +1 -1
  15. package/dist/TestMdRunView-MRMY3RW5.js +2 -0
  16. package/dist/{TestrunEvidenceTable-6UE5EMON.js → TestrunEvidenceTable-OK2HAENB.js} +1 -1
  17. package/dist/{WhoamiView-TFCHIOW5.js → WhoamiView-AHMNIIXZ.js} +1 -1
  18. package/dist/{app-download-N7MLJQ42.js → app-download-CF4JLXWV.js} +1 -1
  19. package/dist/{auth-IQPCVCZK.js → auth-D4BDPJPR.js} +1 -1
  20. package/dist/{binary-VML7EGV4.js → binary-NWVJK542.js} +1 -1
  21. package/dist/{bind-YV6V5AI6.js → bind-LWN72YES.js} +4 -4
  22. package/dist/bootstrap-63FBDEEU.js +2 -0
  23. package/dist/bridge-UMXGHAJF.js +2 -0
  24. package/dist/{changelog-CJFWGRIL.js → changelog-GIZLIFMN.js} +1 -1
  25. package/dist/chat-committer-6D7AQI6Z.js +2 -0
  26. package/dist/chat-controller-UJQ6Z4RE.js +2 -0
  27. package/dist/{chunk-ZCSEBT2W.js → chunk-233MYVFS.js} +1 -1
  28. package/dist/{chunk-JGAMMOUC.js → chunk-2LCWGWYC.js} +1 -1
  29. package/dist/{chunk-D6GBOFK5.js → chunk-2LKNUXRN.js} +1 -1
  30. package/dist/{chunk-LJGAXIDU.js → chunk-2STKZSVF.js} +1 -1
  31. package/dist/chunk-3UI5VTQS.js +4 -0
  32. package/dist/{chunk-3D5MKSG3.js → chunk-3UIZVDOF.js} +1 -1
  33. package/dist/chunk-3VAU3PNU.js +2 -0
  34. package/dist/{chunk-A557OSRS.js → chunk-3YBT4UGQ.js} +1 -1
  35. package/dist/{chunk-FXO7JKMZ.js → chunk-47QKRIPY.js} +3 -3
  36. package/dist/{chunk-EJXBKCNF.js → chunk-4ASBXR6Q.js} +1 -1
  37. package/dist/{chunk-5HTSKF5K.js → chunk-4OQ7GEIA.js} +1 -1
  38. package/dist/{chunk-OWGFFJKK.js → chunk-4PWAODKJ.js} +1 -1
  39. package/dist/{chunk-MLYNVJNH.js → chunk-5HDM7GDO.js} +1 -1
  40. package/dist/{chunk-M36MOFJW.js → chunk-5LSPHA3P.js} +5 -5
  41. package/dist/chunk-5MKY3WMF.js +3 -0
  42. package/dist/{chunk-IAHOLH5W.js → chunk-5UHM7CKR.js} +1 -1
  43. package/dist/{chunk-XXE7W5AV.js → chunk-5X7JIGG7.js} +1 -1
  44. package/dist/{chunk-KALEPJAV.js → chunk-5ZU7S4E7.js} +2 -2
  45. package/dist/{chunk-RQILLYSP.js → chunk-637S3COE.js} +1 -1
  46. package/dist/{chunk-GX3FPJUG.js → chunk-63DYVWNX.js} +1 -1
  47. package/dist/chunk-64TO3MD7.js +93 -0
  48. package/dist/{chunk-UHSNUUX3.js → chunk-6CYF7Q5W.js} +2 -2
  49. package/dist/{chunk-4TMQTSIO.js → chunk-6OKOMKYR.js} +1 -1
  50. package/dist/{chunk-NLEA6NPU.js → chunk-75SSVUGS.js} +1 -1
  51. package/dist/{chunk-AHXOKBVE.js → chunk-7N6OCHPC.js} +1 -1
  52. package/dist/chunk-7U7HOEZO.js +2 -0
  53. package/dist/{chunk-7O54QURK.js → chunk-AACQE24F.js} +1 -1
  54. package/dist/{chunk-DMT3W26F.js → chunk-AG2MVCNK.js} +1 -1
  55. package/dist/chunk-AH4QWIYU.js +7 -0
  56. package/dist/{chunk-GZ65ZA4C.js → chunk-AIR2WVXM.js} +1 -1
  57. package/dist/{chunk-OGDAWNFY.js → chunk-AW34ZNNO.js} +1 -1
  58. package/dist/chunk-B6NU3SNG.js +368 -0
  59. package/dist/{chunk-Z3YYMZHT.js → chunk-BNZQKQOE.js} +1 -1
  60. package/dist/{chunk-T4R26WER.js → chunk-CCNPXTC6.js} +2 -2
  61. package/dist/{chunk-YAAQER2L.js → chunk-CCW3VQIY.js} +1 -1
  62. package/dist/{chunk-GSDXZS4U.js → chunk-D2F5T3NX.js} +1 -1
  63. package/dist/{chunk-JQW2QFSX.js → chunk-D6E6KRVX.js} +1 -1
  64. package/dist/chunk-D7WG7SRA.js +2 -0
  65. package/dist/{chunk-HLCETZ73.js → chunk-DFK5QYB5.js} +1 -1
  66. package/dist/{chunk-WFBJNVMQ.js → chunk-DQRVB5EU.js} +1 -1
  67. package/dist/{chunk-Z73ZYROU.js → chunk-DT2LIX5S.js} +1 -1
  68. package/dist/{chunk-AYJ2YZP5.js → chunk-E6X5BVXC.js} +1 -1
  69. package/dist/{chunk-SHSXOYKT.js → chunk-EIMHIZKF.js} +1 -1
  70. package/dist/chunk-EVFFDODK.js +5 -0
  71. package/dist/{chunk-3IXEARDX.js → chunk-F2OBORCG.js} +1 -1
  72. package/dist/chunk-FY7TCYPK.js +6 -0
  73. package/dist/{chunk-QXRT6HSV.js → chunk-GBXF4JE6.js} +1 -1
  74. package/dist/{chunk-YKYKOV6U.js → chunk-GIC56KI3.js} +1 -1
  75. package/dist/{chunk-OFWJBOGT.js → chunk-GT6Y2SEY.js} +2 -2
  76. package/dist/{chunk-XUJXGE42.js → chunk-HLUOLWEJ.js} +1 -1
  77. package/dist/{chunk-O3XBIURC.js → chunk-HS7OIRGU.js} +1 -1
  78. package/dist/{chunk-JCMHB4KH.js → chunk-I6RTGDZ7.js} +1 -1
  79. package/dist/{chunk-YZVR7ESF.js → chunk-ICFJVEEA.js} +1 -1
  80. package/dist/{chunk-JVEZBJJ7.js → chunk-IDLJHKJX.js} +1 -1
  81. package/dist/{chunk-N3CVR4Z2.js → chunk-IGI4T3VC.js} +1 -1
  82. package/dist/{chunk-TEHZUSUY.js → chunk-IHD2WXKT.js} +1 -1
  83. package/dist/{chunk-NUJVYAI4.js → chunk-IHUF6UP4.js} +1 -1
  84. package/dist/chunk-IICT4VOU.js +2 -0
  85. package/dist/{chunk-TVELOH5A.js → chunk-IKB2JKMA.js} +1 -1
  86. package/dist/{chunk-SWTJMTBY.js → chunk-IPQAKIJO.js} +1 -1
  87. package/dist/{chunk-7X4R6464.js → chunk-IZ3PYWUL.js} +1 -1
  88. package/dist/{chunk-CNPIJFZM.js → chunk-JGCB4OUP.js} +1 -1
  89. package/dist/chunk-JPOYZCTX.js +2 -0
  90. package/dist/chunk-JQ64X2TO.js +2 -0
  91. package/dist/{chunk-NWNG5UWD.js → chunk-JWOPRJIO.js} +1 -1
  92. package/dist/{chunk-R7QMZBBH.js → chunk-JWPBLVPW.js} +1 -1
  93. package/dist/chunk-K2UJYY2U.js +2 -0
  94. package/dist/{chunk-ALCE5RLK.js → chunk-KDNNMU7Q.js} +1 -1
  95. package/dist/chunk-KJQNAOOE.js +6 -0
  96. package/dist/{chunk-6DHEOPXX.js → chunk-KMF2PPJ5.js} +1 -1
  97. package/dist/{chunk-XSUJJB7Z.js → chunk-KQCGBDPM.js} +1 -1
  98. package/dist/{chunk-EFTRH35G.js → chunk-KRI5NSGQ.js} +1 -1
  99. package/dist/{chunk-EDQZIEPJ.js → chunk-KWANVHJX.js} +1 -1
  100. package/dist/{chunk-JFUFWICY.js → chunk-KX5IV5FL.js} +2 -2
  101. package/dist/{chunk-UZIMYV5U.js → chunk-L2SJRAK4.js} +1 -1
  102. package/dist/chunk-L45HDSJ7.js +15 -0
  103. package/dist/{chunk-Q77QO3PC.js → chunk-LO47W2DO.js} +4 -4
  104. package/dist/chunk-LSDWPG6C.js +2 -0
  105. package/dist/{chunk-74FHTDEE.js → chunk-MDM2LJFN.js} +1 -1
  106. package/dist/{chunk-QVLYK5JL.js → chunk-MTCLFYNH.js} +1 -1
  107. package/dist/{chunk-BMVE73M7.js → chunk-N55U4S4W.js} +1 -1
  108. package/dist/chunk-NFLQWKFR.js +8 -0
  109. package/dist/{chunk-OPL2MIQG.js → chunk-NJ4BXZBX.js} +1 -1
  110. package/dist/{chunk-3GELV4IN.js → chunk-OCWS5YVO.js} +14 -14
  111. package/dist/{chunk-HYTBEPC2.js → chunk-PHR2OSWD.js} +1 -1
  112. package/dist/{chunk-TU6IMGWO.js → chunk-Q4YYAN6E.js} +1 -1
  113. package/dist/{chunk-55YDTPB7.js → chunk-Q6F23V7L.js} +1 -1
  114. package/dist/chunk-QSCXXNC2.js +2 -0
  115. package/dist/{chunk-YGMUNNKH.js → chunk-RBFCGUR3.js} +1 -1
  116. package/dist/{chunk-3N6IAVD5.js → chunk-RDHWNSDP.js} +1 -1
  117. package/dist/{chunk-JL3L6KOG.js → chunk-RGJIGNB3.js} +1 -1
  118. package/dist/{chunk-TCAHDVII.js → chunk-RRY5IXOB.js} +1 -1
  119. package/dist/{chunk-6L5RV62W.js → chunk-RSXCS474.js} +1 -1
  120. package/dist/{chunk-DMCEGMGB.js → chunk-SDJNWR4D.js} +1 -1
  121. package/dist/{chunk-YCH7H7JX.js → chunk-SEEEGDVK.js} +1 -1
  122. package/dist/{chunk-7EGIX6Y4.js → chunk-TISVRTL7.js} +3 -3
  123. package/dist/{chunk-6GLFQHSW.js → chunk-TMOSERKN.js} +2 -2
  124. package/dist/{chunk-VOTIGXQ4.js → chunk-U2LDPUDZ.js} +1 -1
  125. package/dist/chunk-U6OTFMIT.js +4 -0
  126. package/dist/{chunk-2WRBCTNM.js → chunk-UQNRUAES.js} +1 -1
  127. package/dist/{chunk-ZEVU2OT3.js → chunk-UTIP6SMW.js} +1 -1
  128. package/dist/chunk-UUYYTJG2.js +6 -0
  129. package/dist/{chunk-ZKCCG3GK.js → chunk-UXJZUGKL.js} +1 -1
  130. package/dist/{chunk-52WM3XYO.js → chunk-V4B5QA3U.js} +1 -1
  131. package/dist/chunk-VIO7CCFW.js +5 -0
  132. package/dist/{chunk-EPE2ELDH.js → chunk-VIYV6NIW.js} +1 -1
  133. package/dist/{chunk-IE3OO5GI.js → chunk-VVOKM2VO.js} +1 -1
  134. package/dist/chunk-WC54SZUO.js +5 -0
  135. package/dist/{chunk-7WDPU33M.js → chunk-WDK5ETMA.js} +1 -1
  136. package/dist/chunk-WESMQEPO.js +2 -0
  137. package/dist/{chunk-RI4ILZZC.js → chunk-WKIYI6MB.js} +1 -1
  138. package/dist/{chunk-KZG4E5RM.js → chunk-WVHMPIDQ.js} +1 -1
  139. package/dist/chunk-XLSOQLVT.js +2 -0
  140. package/dist/chunk-YOVKKZVZ.js +2 -0
  141. package/dist/chunk-ZLWURCJ7.js +2 -0
  142. package/dist/{chunk-WNB2IYHY.js → chunk-ZQ6KWTJ2.js} +1 -1
  143. package/dist/chunk-ZRRBZUDJ.js +18 -0
  144. package/dist/committer-2QPBANRD.js +2 -0
  145. package/dist/{config-UGCWZGH5.js → config-WKLEWUPU.js} +1 -1
  146. package/dist/cover-cmd-7TSQJFGM.js +3 -0
  147. package/dist/{credentials-GWLYYRTL.js → credentials-FLY3ZXVX.js} +1 -1
  148. package/dist/{deps-bundle-VNGC2UG6.js → deps-bundle-CAKK3EO5.js} +1 -1
  149. package/dist/{deps-resolve-YLCEU6I7.js → deps-resolve-MSLEFPVD.js} +1 -1
  150. package/dist/descriptor-3JJUOHBM.js +2 -0
  151. package/dist/design-committer-D44GSUXY.js +2 -0
  152. package/dist/dispatch-SXS276ZT.js +2 -0
  153. package/dist/{doctor-B4Z6RPKQ.js → doctor-EZPQTFJM.js} +1 -1
  154. package/dist/{docx-convert-WPZS6OIC.js → docx-convert-SQRTF7XS.js} +1 -1
  155. package/dist/{dossier-UGJMYYAB.js → dossier-7HVC6BNK.js} +1 -1
  156. package/dist/evidence-GUOURW6F.js +2 -0
  157. package/dist/evolve-cmd-LJJFOXXP.js +2 -0
  158. package/dist/{explain-H5HJEDEF.js → explain-NEFBUX5G.js} +1 -1
  159. package/dist/{explain-cmd-XVE6Z67Q.js → explain-cmd-5LLIJKM2.js} +1 -1
  160. package/dist/{explain-cmd-R45I5MT7.js → explain-cmd-ENSJNQK7.js} +1 -1
  161. package/dist/{extract-bind-7IDQS4QP.js → extract-bind-CGU6WVS7.js} +3 -3
  162. package/dist/{extract-cmd-KIEOBRIT.js → extract-cmd-7N7CCGN6.js} +2 -2
  163. package/dist/feeder-66TUPB2R.js +2 -0
  164. package/dist/gaps-cmd-BNUGDF5N.js +3 -0
  165. package/dist/{gate-E3BLIUEA.js → gate-OYRDJMF6.js} +1 -1
  166. package/dist/{generate-headless-XGRIDD6O.js → generate-headless-7TJYESUU.js} +2 -2
  167. package/dist/index.js +162 -165
  168. package/dist/ingest-OSNNM3DH.js +2 -0
  169. package/dist/ingest-cmd-B4T5CW5R.js +2 -0
  170. package/dist/install-6KJ2MZX3.js +2 -0
  171. package/dist/interactive-bind-HUZDSGFX.js +26 -0
  172. package/dist/lifecycle-cmd-GIVLSUPE.js +2 -0
  173. package/dist/list-cmd-KEKKQDUF.js +3 -0
  174. package/dist/{list-commands-VRRCVWKO.js → list-commands-SMBBT5CY.js} +1 -1
  175. package/dist/logical-ids-GLVM2SVR.js +2 -0
  176. package/dist/login-flow-5ZIG7JXT.js +2 -0
  177. package/dist/maintenance-cmd-MLQ3IRFV.js +2 -0
  178. package/dist/{mobile-prompts-CMIVWDHQ.js → mobile-prompts-EEPPPA6S.js} +1 -1
  179. package/dist/{objective-variable-gate-EEYJ6B3X.js → objective-variable-gate-AEBWIGH7.js} +1 -1
  180. package/dist/open-provider-OTZ37JB6.js +2 -0
  181. package/dist/{pdf-convert-5H4HQNN3.js → pdf-convert-RLXSXFWN.js} +1 -1
  182. package/dist/{persist-recorded-session-JXL5E53A.js → persist-recorded-session-IRWGMXGI.js} +1 -1
  183. package/dist/phase-seed-H7KXNQO6.js +2 -0
  184. package/dist/pipeline-OV3TWKSZ.js +2 -0
  185. package/dist/prepare-target-35OI7XBL.js +2 -0
  186. package/dist/readmodel-FVLRQWZ7.js +2 -0
  187. package/dist/reconcile-cmd-NBBDE7DJ.js +2 -0
  188. package/dist/reconcile-deps-DJNIY7TP.js +4 -0
  189. package/dist/reconcile-engine-Z2XKUCQ7.js +2 -0
  190. package/dist/recording-banner-GCR6A46M.js +2 -0
  191. package/dist/{records-TJJJWBUD.js → records-LMCVKPE5.js} +1 -1
  192. package/dist/registry-V3ULHPLM.js +2 -0
  193. package/dist/{require-project-folder-SKEZMSN7.js → require-project-folder-YBB5T3OE.js} +1 -1
  194. package/dist/{resolve-run-intent-THC3EPAX.js → resolve-run-intent-XGZN6OQ6.js} +1 -1
  195. package/dist/{resolver-2NUNLK7N.js → resolver-WNV53IOL.js} +1 -1
  196. package/dist/revert-NOUECRW4.js +2 -0
  197. package/dist/review-cmd-ZXTLZ4GE.js +5 -0
  198. package/dist/run-YWKZGZVL.js +2 -0
  199. package/dist/run-YZP2PTNW.js +2 -0
  200. package/dist/run-test-md-N43FRXB6.js +17 -0
  201. package/dist/{sessions-cmd-DV442ZCY.js → sessions-cmd-IV25N2L7.js} +1 -1
  202. package/dist/skill-installer-G7Z5ZDAQ.js +3 -0
  203. package/dist/{spawner-7FUA3JXA.js → spawner-ABB7B5CQ.js} +1 -1
  204. package/dist/store-guard-YIQQF4LC.js +2 -0
  205. package/dist/{structured-answers-NADW6D44.js → structured-answers-3C2DCFFF.js} +1 -1
  206. package/dist/sync-cmd-4AKHO5EG.js +2 -0
  207. package/dist/sync-setup-E7UV25KK.js +2 -0
  208. package/dist/tcg-generate-XJN5OMIJ.js +2 -0
  209. package/dist/testmd-actions-WFDWYEAU.js +2 -0
  210. package/dist/{testmd-sync-HYZI6NRM.js → testmd-sync-I2E6W6JL.js} +1 -1
  211. package/dist/token-refresh-NADDXLYM.js +2 -0
  212. package/dist/{validate-basic-OKLJLDML.js → validate-basic-WZY6A3KD.js} +1 -1
  213. package/dist/{variable-receipt-CMCDUJI2.js → variable-receipt-JONRYHCY.js} +1 -1
  214. package/dist/verdicts-JMVS6HNJ.js +2 -0
  215. package/dist/{version-check-4DQJBSXW.js → version-check-CD7DHZI2.js} +1 -1
  216. package/dist/{view-cmd-P3XRFORJ.js → view-cmd-ASH2UFUW.js} +1 -1
  217. package/dist/walk-session-ZPXR7ASG.js +2 -0
  218. package/dist/with-telemetry-QXCHDKPW.js +2 -0
  219. package/package.json +11 -11
  220. package/dist/EvidenceViewOffer-YSNRKKPC.js +0 -2
  221. package/dist/FolderPicker-XCTJ5447.js +0 -2
  222. package/dist/SingleShotApp-IPNZBFXB.js +0 -2
  223. package/dist/TestMdRunView-2FQIEI5W.js +0 -2
  224. package/dist/bootstrap-KCPWDBLX.js +0 -2
  225. package/dist/bridge-5UKX7YIO.js +0 -2
  226. package/dist/chat-committer-HDE3TP5I.js +0 -2
  227. package/dist/chat-controller-3EPK7UZG.js +0 -2
  228. package/dist/chunk-27ERHOW3.js +0 -2
  229. package/dist/chunk-4PMZ5FCD.js +0 -2
  230. package/dist/chunk-6K4FDYMH.js +0 -89
  231. package/dist/chunk-AKX4VRRR.js +0 -2
  232. package/dist/chunk-CRZUBDJ3.js +0 -6
  233. package/dist/chunk-FFVNISYH.js +0 -2
  234. package/dist/chunk-GP7WD4UY.js +0 -4
  235. package/dist/chunk-HOA4VWSD.js +0 -5
  236. package/dist/chunk-JQCOKL6U.js +0 -15
  237. package/dist/chunk-JSS22MFY.js +0 -17
  238. package/dist/chunk-JUJ4SAGH.js +0 -2
  239. package/dist/chunk-KUS324VE.js +0 -3
  240. package/dist/chunk-L2TV4G56.js +0 -4
  241. package/dist/chunk-O25AL4B7.js +0 -5
  242. package/dist/chunk-O66WXOOC.js +0 -5
  243. package/dist/chunk-ORQGQSWG.js +0 -8
  244. package/dist/chunk-PGXJ275T.js +0 -2
  245. package/dist/chunk-S4JUCBCT.js +0 -7
  246. package/dist/chunk-SIYSKT6I.js +0 -3
  247. package/dist/chunk-TNBF5OMZ.js +0 -2
  248. package/dist/chunk-UHT5SVP5.js +0 -2
  249. package/dist/chunk-VZDLRJ5N.js +0 -368
  250. package/dist/chunk-W77SZLFC.js +0 -2
  251. package/dist/chunk-YMLC55J4.js +0 -2
  252. package/dist/chunk-YYYQ5MVD.js +0 -6
  253. package/dist/committer-IYQPXG6C.js +0 -2
  254. package/dist/cover-cmd-SWJ2NZUZ.js +0 -3
  255. package/dist/descriptor-PWUUNYV7.js +0 -2
  256. package/dist/design-committer-J57IAAA5.js +0 -2
  257. package/dist/dispatch-OMQCT7WO.js +0 -2
  258. package/dist/evidence-XJGXVLO5.js +0 -2
  259. package/dist/evolve-cmd-QQQPPGL3.js +0 -2
  260. package/dist/feeder-RSHMGW6B.js +0 -2
  261. package/dist/gaps-cmd-RGIPUSIR.js +0 -3
  262. package/dist/ingest-QGLVY7ND.js +0 -2
  263. package/dist/ingest-cmd-R5H5SF5K.js +0 -2
  264. package/dist/install-W3VPVPAQ.js +0 -2
  265. package/dist/interactive-bind-X5DVLRRW.js +0 -26
  266. package/dist/lifecycle-cmd-6R2PR2HM.js +0 -2
  267. package/dist/list-cmd-QCIYKWYQ.js +0 -3
  268. package/dist/logical-ids-DN6IZSUM.js +0 -2
  269. package/dist/login-flow-5HL2QYEL.js +0 -2
  270. package/dist/maintenance-cmd-GZ4EMT3V.js +0 -2
  271. package/dist/open-provider-UFSCTIQQ.js +0 -2
  272. package/dist/phase-seed-HKJ2EF7R.js +0 -2
  273. package/dist/pipeline-RSCRNNPW.js +0 -2
  274. package/dist/prepare-target-XZ3FTVBW.js +0 -2
  275. package/dist/readmodel-IBFRM6EO.js +0 -2
  276. package/dist/reconcile-cmd-4VRTUM2D.js +0 -2
  277. package/dist/reconcile-deps-ZCJ2QCK5.js +0 -4
  278. package/dist/reconcile-engine-IVLZCYZB.js +0 -2
  279. package/dist/recording-banner-SRLPSTFP.js +0 -3
  280. package/dist/registry-CPQHW2L2.js +0 -2
  281. package/dist/revert-6BBBK3I4.js +0 -2
  282. package/dist/review-cmd-BMJQZ6XJ.js +0 -5
  283. package/dist/run-TURFDLC6.js +0 -2
  284. package/dist/run-UDP5VPYS.js +0 -2
  285. package/dist/run-test-md-MRYNFNPO.js +0 -17
  286. package/dist/skill-installer-CVJ5VTEJ.js +0 -3
  287. package/dist/store-guard-XQ5MSUB2.js +0 -2
  288. package/dist/sync-cmd-5INKTZN2.js +0 -2
  289. package/dist/sync-setup-4R54VRAO.js +0 -2
  290. package/dist/tcg-generate-2BOPGRM6.js +0 -2
  291. package/dist/testmd-actions-2CPJZAC2.js +0 -2
  292. package/dist/token-refresh-NTE4LQRN.js +0 -2
  293. package/dist/verdicts-EMCYGQWM.js +0 -2
  294. package/dist/walk-session-MUGS6CZY.js +0 -2
  295. package/dist/with-telemetry-3T53GIQC.js +0 -2
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as f}from"./chunk-5HTSKF5K.js";import{y as t}from"./chunk-HYTBEPC2.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a,b as n}from"./chunk-C44QQJR4.js";import{a as R}from"./chunk-6YGTRKDT.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-4OQ7GEIA.js";import{y as t}from"./chunk-PHR2OSWD.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a,b as n}from"./chunk-C44QQJR4.js";import{a as R}from"./chunk-6YGTRKDT.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,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as h}from"./chunk-YKYKOV6U.js";import{y as l}from"./chunk-HYTBEPC2.js";import{a as A}from"./chunk-HCBYKLMW.js";import{a as c,b as f,i as P}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as x}from"./chunk-UR6MHSHU.js";var L=x(B(),1);var n=x(A(),1);function S(r,d,s,u,m){let p=s==="basic"&&u?`basic (${u})`:s,i=20,a=`${r} [${d}]`,g="\xB7".repeat(Math.max(2,i-a.length+3));return{label:`${a} ${g} ${p}`,profile:r,env:d,isActive:m}}function M({creds:r,onSwitch:d,onCancel:s}){let u=r.listProfiles(),m=r.getActiveProfile(),p=r.getDefaultEnv(),i=u.map(e=>{let o=r.loadBasicAuth(e.profile,e.env),t=r.loadCredentials(e.profile,e.env)!==null,v=o?"basic":t?"oauth":"none",b=o?o.username:null,w=e.profile===m&&e.env===p;return S(e.profile,e.env,v,b,w)}),[a,g]=(0,L.useState)(()=>{let e=i.findIndex(o=>o.isActive);return e>=0?e:0});return P((e,o)=>{if(o.escape){s();return}if(o.upArrow){g(t=>Math.max(0,t-1));return}if(o.downArrow){g(t=>Math.min(i.length-1,t+1));return}if(o.return&&i[a]){let t=i[a];t.isActive||d(t.profile,t.env),s();return}}),i.length===0?(0,n.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:l.orange,paddingX:2,paddingY:1,children:[(0,n.jsx)(f,{color:l.orange,bold:!0,children:"Profiles"}),(0,n.jsx)(c,{marginTop:1,children:(0,n.jsx)(f,{color:l.dim,children:"No profiles \u2014 use Login to create one"})}),(0,n.jsx)(h,{bindings:[],escBackLabel:"back"})]}):(0,n.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:l.orange,paddingX:2,paddingY:1,children:[(0,n.jsx)(f,{color:l.orange,bold:!0,children:"Profiles"}),(0,n.jsx)(c,{flexDirection:"column",marginTop:1,children:i.map((e,o)=>{let t=o===a,v=t?"\u276F ":" ",b=e.isActive?l.green:t?l.orange:void 0;return(0,n.jsxs)(f,{color:b,children:[v,e.label,e.isActive?" \u25CF active":""]},`${e.profile}-${e.env}`)})}),(0,n.jsx)(h,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"switch"}],escBackLabel:"back"})]})}export{S as a,M as b};
2
+ import{a as h}from"./chunk-GIC56KI3.js";import{y as l}from"./chunk-PHR2OSWD.js";import{a as A}from"./chunk-HCBYKLMW.js";import{a as c,b as f,i as P}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as x}from"./chunk-UR6MHSHU.js";var L=x(B(),1);var n=x(A(),1);function S(r,d,s,u,m){let p=s==="basic"&&u?`basic (${u})`:s,i=20,a=`${r} [${d}]`,g="\xB7".repeat(Math.max(2,i-a.length+3));return{label:`${a} ${g} ${p}`,profile:r,env:d,isActive:m}}function M({creds:r,onSwitch:d,onCancel:s}){let u=r.listProfiles(),m=r.getActiveProfile(),p=r.getDefaultEnv(),i=u.map(e=>{let o=r.loadBasicAuth(e.profile,e.env),t=r.loadCredentials(e.profile,e.env)!==null,v=o?"basic":t?"oauth":"none",b=o?o.username:null,w=e.profile===m&&e.env===p;return S(e.profile,e.env,v,b,w)}),[a,g]=(0,L.useState)(()=>{let e=i.findIndex(o=>o.isActive);return e>=0?e:0});return P((e,o)=>{if(o.escape){s();return}if(o.upArrow){g(t=>Math.max(0,t-1));return}if(o.downArrow){g(t=>Math.min(i.length-1,t+1));return}if(o.return&&i[a]){let t=i[a];t.isActive||d(t.profile,t.env),s();return}}),i.length===0?(0,n.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:l.orange,paddingX:2,paddingY:1,children:[(0,n.jsx)(f,{color:l.orange,bold:!0,children:"Profiles"}),(0,n.jsx)(c,{marginTop:1,children:(0,n.jsx)(f,{color:l.dim,children:"No profiles \u2014 use Login to create one"})}),(0,n.jsx)(h,{bindings:[],escBackLabel:"back"})]}):(0,n.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:l.orange,paddingX:2,paddingY:1,children:[(0,n.jsx)(f,{color:l.orange,bold:!0,children:"Profiles"}),(0,n.jsx)(c,{flexDirection:"column",marginTop:1,children:i.map((e,o)=>{let t=o===a,v=t?"\u276F ":" ",b=e.isActive?l.green:t?l.orange:void 0;return(0,n.jsxs)(f,{color:b,children:[v,e.label,e.isActive?" \u25CF active":""]},`${e.profile}-${e.env}`)})}),(0,n.jsx)(h,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"switch"}],escBackLabel:"back"})]})}export{S as a,M as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as $}from"./chunk-YCCUBQY4.js";import{a as U}from"./chunk-TVELOH5A.js";import{a as k}from"./chunk-BPMSNGXQ.js";import{a as _}from"./chunk-YKYKOV6U.js";import{a as T}from"./chunk-EPE2ELDH.js";import{y as i}from"./chunk-HYTBEPC2.js";import{a as O}from"./chunk-HCBYKLMW.js";import{a as u,b as s}from"./chunk-C44QQJR4.js";import{a as K}from"./chunk-6YGTRKDT.js";import{e as S}from"./chunk-UR6MHSHU.js";var e=S(K(),1);var r=S(O(),1);function V(n,x,c){return{id:n,label:`${x} (${n})`,isActive:n===c}}function se({resolver:n,currentProjectId:x,env:c,onSelect:w,onCancel:C}){let[q,B]=(0,e.useState)([]),[D,l]=(0,e.useState)(!0),[H,m]=(0,e.useState)(!1),[J,g]=(0,e.useState)(!1),[Q,P]=(0,e.useState)(null),[d,p]=(0,e.useState)("list"),[v,R]=(0,e.useState)(""),[E,h]=(0,e.useState)(null),[I,X]=(0,e.useState)(""),b=(0,e.useRef)(!1),A=(0,e.useRef)(!0);(0,e.useEffect)(()=>{if(!n){P("Login first to browse projects"),l(!1);return}let o=new AbortController,a=I.trim();return A.current?l(!0):a&&g(!0),m(!0),P(null),(async()=>{try{let t=n.cached??await n.resolve();if(!t){P("Login first to browse projects"),l(!1),m(!1),g(!1);return}let L=T(c),F=new k(L.tmsBaseUrl,t.username,t.access_key),f=!0,N=0,G=a?{signal:o.signal,name:a,perPage:10}:{signal:o.signal,perPage:10};for await(let y of F.listProjectsStream(G)){if(f&&(l(!1),g(!1),A.current=!1,f=!1),y.totalLoaded===0&&y.done&&N===0&&!a){b.current=!0,p("naming"),m(!1);return}let M=y.projects.map(j=>V(j.project_id,j.name,x));B(N===0?M:j=>[...j,...M]),N+=y.projects.length,y.done&&m(!1)}f&&(l(!1),m(!1),g(!1))}catch(t){if(t?.name==="AbortError")return;P(t instanceof Error?t.message:String(t)),l(!1),m(!1),g(!1)}})(),()=>o.abort()},[n,x,c,I]);let Y=(0,e.useCallback)(o=>{let a=o.trim();if(!a){h("Name cannot be empty");return}h(null),p("creating"),(async()=>{try{if(!n)throw new Error("Not authenticated");let t=n.cached??await n.resolve();if(!t)throw new Error("Not authenticated");let L=T(c),f=await new k(L.tmsBaseUrl,t.username,t.access_key).createProject(a);w(f.id,f.name)}catch(t){h(t instanceof Error?t.message:String(t)),p("naming")}})()},[n,c,w]),z=(0,e.useCallback)(()=>{R(""),h(null),b.current?C():p("list")},[C]);return d==="naming"||d==="creating"?(0,r.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:i.orange,paddingX:2,paddingY:1,children:[(0,r.jsx)(s,{color:i.orange,bold:!0,children:"Create new project"}),b.current&&(0,r.jsx)(u,{marginTop:1,children:(0,r.jsx)(s,{color:i.dim,children:"No projects yet \u2014 let's create one."})}),(0,r.jsxs)(u,{marginTop:1,children:[(0,r.jsx)(s,{color:i.dim,children:"Name: "}),d==="naming"?(0,r.jsx)($,{value:v,onChange:o=>{R(o),E&&h(null)},onSubmit:Y,onCancel:z}):(0,r.jsx)(s,{children:v})]}),E&&(0,r.jsx)(u,{marginTop:1,children:(0,r.jsx)(s,{color:i.red,children:E})}),d==="creating"&&(0,r.jsx)(u,{marginTop:1,children:(0,r.jsx)(s,{color:i.dim,children:"Creating..."})}),d==="naming"&&(0,r.jsx)(_,{bindings:[{keys:"\u21B5",label:"create"}],escBackLabel:b.current?"cancel":"back"})]}):(0,r.jsx)(U,{title:"Projects",items:q,loading:D,loadingMore:H,searching:J,preserveSelectionById:!0,onSearch:X,error:Q,itemNoun:"projects",onTab:()=>{b.current=!1,p("naming")},extraHint:"tab to create new",onSelect:o=>{let a=o.label.replace(` (${o.id})`,"");w(o.id,a)},onCancel:C})}export{V as a,se as b};
2
+ import{a as $}from"./chunk-YCCUBQY4.js";import{a as U}from"./chunk-IKB2JKMA.js";import{a as k}from"./chunk-BPMSNGXQ.js";import{a as _}from"./chunk-GIC56KI3.js";import{a as T}from"./chunk-VIYV6NIW.js";import{y as i}from"./chunk-PHR2OSWD.js";import{a as O}from"./chunk-HCBYKLMW.js";import{a as u,b as s}from"./chunk-C44QQJR4.js";import{a as K}from"./chunk-6YGTRKDT.js";import{e as S}from"./chunk-UR6MHSHU.js";var e=S(K(),1);var r=S(O(),1);function V(n,x,c){return{id:n,label:`${x} (${n})`,isActive:n===c}}function se({resolver:n,currentProjectId:x,env:c,onSelect:w,onCancel:C}){let[q,B]=(0,e.useState)([]),[D,l]=(0,e.useState)(!0),[H,m]=(0,e.useState)(!1),[J,g]=(0,e.useState)(!1),[Q,P]=(0,e.useState)(null),[d,p]=(0,e.useState)("list"),[v,R]=(0,e.useState)(""),[E,h]=(0,e.useState)(null),[I,X]=(0,e.useState)(""),b=(0,e.useRef)(!1),A=(0,e.useRef)(!0);(0,e.useEffect)(()=>{if(!n){P("Login first to browse projects"),l(!1);return}let o=new AbortController,a=I.trim();return A.current?l(!0):a&&g(!0),m(!0),P(null),(async()=>{try{let t=n.cached??await n.resolve();if(!t){P("Login first to browse projects"),l(!1),m(!1),g(!1);return}let L=T(c),F=new k(L.tmsBaseUrl,t.username,t.access_key),f=!0,N=0,G=a?{signal:o.signal,name:a,perPage:10}:{signal:o.signal,perPage:10};for await(let y of F.listProjectsStream(G)){if(f&&(l(!1),g(!1),A.current=!1,f=!1),y.totalLoaded===0&&y.done&&N===0&&!a){b.current=!0,p("naming"),m(!1);return}let M=y.projects.map(j=>V(j.project_id,j.name,x));B(N===0?M:j=>[...j,...M]),N+=y.projects.length,y.done&&m(!1)}f&&(l(!1),m(!1),g(!1))}catch(t){if(t?.name==="AbortError")return;P(t instanceof Error?t.message:String(t)),l(!1),m(!1),g(!1)}})(),()=>o.abort()},[n,x,c,I]);let Y=(0,e.useCallback)(o=>{let a=o.trim();if(!a){h("Name cannot be empty");return}h(null),p("creating"),(async()=>{try{if(!n)throw new Error("Not authenticated");let t=n.cached??await n.resolve();if(!t)throw new Error("Not authenticated");let L=T(c),f=await new k(L.tmsBaseUrl,t.username,t.access_key).createProject(a);w(f.id,f.name)}catch(t){h(t instanceof Error?t.message:String(t)),p("naming")}})()},[n,c,w]),z=(0,e.useCallback)(()=>{R(""),h(null),b.current?C():p("list")},[C]);return d==="naming"||d==="creating"?(0,r.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:i.orange,paddingX:2,paddingY:1,children:[(0,r.jsx)(s,{color:i.orange,bold:!0,children:"Create new project"}),b.current&&(0,r.jsx)(u,{marginTop:1,children:(0,r.jsx)(s,{color:i.dim,children:"No projects yet \u2014 let's create one."})}),(0,r.jsxs)(u,{marginTop:1,children:[(0,r.jsx)(s,{color:i.dim,children:"Name: "}),d==="naming"?(0,r.jsx)($,{value:v,onChange:o=>{R(o),E&&h(null)},onSubmit:Y,onCancel:z}):(0,r.jsx)(s,{children:v})]}),E&&(0,r.jsx)(u,{marginTop:1,children:(0,r.jsx)(s,{color:i.red,children:E})}),d==="creating"&&(0,r.jsx)(u,{marginTop:1,children:(0,r.jsx)(s,{color:i.dim,children:"Creating..."})}),d==="naming"&&(0,r.jsx)(_,{bindings:[{keys:"\u21B5",label:"create"}],escBackLabel:b.current?"cancel":"back"})]}):(0,r.jsx)(U,{title:"Projects",items:q,loading:D,loadingMore:H,searching:J,preserveSelectionById:!0,onSearch:X,error:Q,itemNoun:"projects",onTab:()=>{b.current=!1,p("naming")},extraHint:"tab to create new",onSelect:o=>{let a=o.label.replace(` (${o.id})`,"");w(o.id,a)},onCancel:C})}export{V as a,se as b};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as Ve}from"./chunk-MLYNVJNH.js";import{a as Ye}from"./chunk-SHSXOYKT.js";import{a as We}from"./chunk-YCCUBQY4.js";import{a as qe}from"./chunk-VE3SUJMA.js";import{a as be}from"./chunk-YKYKOV6U.js";import{a as Ge}from"./chunk-TEHZUSUY.js";import{a as He}from"./chunk-EPE2ELDH.js";import{b as Le,y as u}from"./chunk-HYTBEPC2.js";import{a as re}from"./chunk-HCBYKLMW.js";import{a as h,b as f,h as Fe,i as Se,k as Ne}from"./chunk-C44QQJR4.js";import{a as we}from"./chunk-6YGTRKDT.js";import{e as $}from"./chunk-UR6MHSHU.js";var je=$(we(),1);import{readFileSync as ct,writeFileSync as ut,mkdirSync as ft}from"fs";import{dirname as dt,join as ze}from"path";var mt=ze(Le,"command-history.json"),Dt=ze(Le,"generate-history.json"),ht=200,De=class{entries;filePath;max;constructor(t=mt,e=ht){this.filePath=t,this.max=e,this.entries=this._load()}push(t){this.entries.length>0&&this.entries[this.entries.length-1]===t||(this.entries.push(t),this.entries.length>this.max&&(this.entries=this.entries.slice(this.entries.length-this.max)),this._save())}getAll(){return[...this.entries]}search(t){let e=t.toLowerCase(),o=[];for(let s=this.entries.length-1;s>=0;s--)this.entries[s].toLowerCase().includes(e)&&o.push(this.entries[s]);return o}_load(){if(this.filePath===null)return[];try{let t=ct(this.filePath,"utf-8"),e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}_save(){if(this.filePath!==null)try{ft(dt(this.filePath),{recursive:!0}),ut(this.filePath,JSON.stringify(this.entries)+`
2
+ import{a as Ve}from"./chunk-5HDM7GDO.js";import{a as Ye}from"./chunk-EIMHIZKF.js";import{a as We}from"./chunk-YCCUBQY4.js";import{a as qe}from"./chunk-VE3SUJMA.js";import{a as be}from"./chunk-GIC56KI3.js";import{a as Ge}from"./chunk-IHD2WXKT.js";import{a as He}from"./chunk-VIYV6NIW.js";import{b as Le,y as u}from"./chunk-PHR2OSWD.js";import{a as re}from"./chunk-HCBYKLMW.js";import{a as h,b as f,h as Fe,i as Se,k as Ne}from"./chunk-C44QQJR4.js";import{a as we}from"./chunk-6YGTRKDT.js";import{e as $}from"./chunk-UR6MHSHU.js";var je=$(we(),1);import{readFileSync as ct,writeFileSync as ut,mkdirSync as ft}from"fs";import{dirname as dt,join as ze}from"path";var mt=ze(Le,"command-history.json"),Dt=ze(Le,"generate-history.json"),ht=200,De=class{entries;filePath;max;constructor(t=mt,e=ht){this.filePath=t,this.max=e,this.entries=this._load()}push(t){this.entries.length>0&&this.entries[this.entries.length-1]===t||(this.entries.push(t),this.entries.length>this.max&&(this.entries=this.entries.slice(this.entries.length-this.max)),this._save())}getAll(){return[...this.entries]}search(t){let e=t.toLowerCase(),o=[];for(let s=this.entries.length-1;s>=0;s--)this.entries[s].toLowerCase().includes(e)&&o.push(this.entries[s]);return o}_load(){if(this.filePath===null)return[];try{let t=ct(this.filePath,"utf-8"),e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}_save(){if(this.filePath!==null)try{ft(dt(this.filePath),{recursive:!0}),ut(this.filePath,JSON.stringify(this.entries)+`
3
3
  `)}catch{}}};function kt(n){let t=(0,je.useRef)(null);return t.current||(t.current=new De(n)),t.current}var D=$(we(),1);var ke=$(we(),1);var Z=$(re(),1);function Xe({history:n,onSelect:t,onClose:e}){let[o,s]=(0,ke.useState)(""),[l,m]=(0,ke.useState)(0),v=o?n.search(o).slice(0,8):[];return Se((b,d)=>{if(d.escape){e();return}if(d.return){v.length>0&&v[l]?t(v[l]):e();return}if(d.upArrow){m(S=>Math.max(0,S-1));return}if(d.downArrow){m(S=>Math.min(v.length-1,S+1));return}if(d.backspace||d.delete){s(S=>S.slice(0,-1)),m(0);return}b&&!d.ctrl&&!d.meta&&(s(S=>S+b),m(0))}),(0,Z.jsxs)(h,{flexDirection:"column",marginLeft:2,borderStyle:"single",paddingX:1,children:[(0,Z.jsx)(f,{color:u.muted,bold:!0,children:"reverse search"}),(0,Z.jsxs)(h,{gap:1,children:[(0,Z.jsx)(f,{color:u.dim,children:"search:"}),(0,Z.jsx)(f,{children:o}),(0,Z.jsx)(f,{color:u.orange,children:"\u2588"})]}),v.length>0&&(0,Z.jsx)(f,{children:" "}),v.map((b,d)=>(0,Z.jsx)(h,{marginLeft:2,children:(0,Z.jsxs)(f,{color:d===l?u.orange:u.dim,bold:d===l,children:[d===l?"\u25B8 ":" ",b]})},`${d}-${b}`))]})}var X=$(re(),1);function Je({commands:n,selectedIndex:t}){return n.length===0?null:(0,X.jsx)(h,{flexDirection:"column",marginBottom:0,children:n.map((e,o)=>{let s=o===t;return e.disabled?(0,X.jsxs)(h,{children:[(0,X.jsx)(f,{color:u.dim,children:s?"\u276F ":" "}),(0,X.jsxs)(f,{color:u.dim,children:["/",e.name]}),(0,X.jsxs)(f,{color:u.dim,children:[" ",e.disabledReason??e.description]})]},e.name):(0,X.jsxs)(h,{children:[(0,X.jsx)(f,{color:s?u.orange:u.dim,children:s?"\u276F ":" "}),(0,X.jsxs)(f,{color:s?u.orange:void 0,bold:s,children:["/",e.name]}),e.args&&(0,X.jsxs)(f,{color:u.dim,children:[" ",e.args]}),(0,X.jsxs)(f,{color:u.dim,children:[" ",e.description]})]},e.name)})})}var Ze=$(we(),1);var q=$(re(),1),et={scenario:"Scenarios",case:"Test Cases",file:"Files",artifact:"Artifact candidates",installed:"Installed on device"};function Qe(n){let t={scenario:0,case:0,file:0,artifact:0,installed:0};for(let e of n)t[e.kind]++;return["scenario","case","file","artifact","installed"].filter(e=>t[e]>0).map(e=>`${t[e]} ${et[e]}`).join(" \xB7 ")}var Pe=7;function tt({items:n,selectedIndex:t,accent:e=u.orange}){let o=n.length;if(o===0)return null;let s=Math.floor(Pe/2),l=o<=Pe?0:Math.max(0,Math.min(t-s,o-Pe)),m=Math.min(o,l+Pe),v=l,b=o-m;return(0,q.jsxs)(h,{flexDirection:"column",marginBottom:0,children:[v>0&&(0,q.jsx)(h,{children:(0,q.jsx)(f,{color:u.dim,children:` \u22EF ${v} above \u2014 ${Qe(n.slice(0,l))}`})}),n.slice(l,m).map((d,S)=>{let U=l+S,F=d.selectable!==!1,E=U===t&&F,R=S===0||n[U-1].kind!==d.kind;return(0,q.jsxs)(Ze.default.Fragment,{children:[R&&(0,q.jsx)(h,{children:(0,q.jsx)(f,{color:u.dim,children:et[d.kind]})}),(0,q.jsxs)(h,{children:[(0,q.jsx)(f,{color:E?e:u.dim,children:E?"\u276F ":" "}),(0,q.jsxs)(f,{color:E?e:F?void 0:u.dim,bold:E,children:[d.label,d.reason?` \u2014 ${d.reason}`:""]})]})]},`${d.kind}:${d.value}:${U}`)}),b>0&&(0,q.jsx)(h,{children:(0,q.jsx)(f,{color:u.dim,children:` \u22EF ${b} more \u2014 ${Qe(n.slice(m))}`})})]})}var Be=$(we(),1);var gt=27,pt=127,xt=11;function bt(n){return n>=64&&n<=126}function Tt(n,t){n===xt&&t({killToEnd:!0,ctrl:!0,raw:String.fromCharCode(n)})}function vt(n,t){n===pt&&t({backspace:!0,meta:!0,raw:"\x1B\x7F"})}function wt(n,t){let e=n.map(s=>String.fromCharCode(s)).join(""),o=/^\[1;([0-9]+)([A-D])$/.exec(e);if(o){let s=parseInt(o[1],10),l=o[2],m={raw:"\x1B"+e};if(s===2)m.shift=!0;else if(s===3)m.meta=!0;else if(s===5)m.ctrl=!0;else return;l==="A"?m.arrowUp=!0:l==="B"?m.arrowDown=!0:l==="C"?m.arrowRight=!0:l==="D"&&(m.arrowLeft=!0),t(m);return}if(e==="[H"||e==="[1~"||e==="[7~"){t({home:!0,raw:"\x1B"+e});return}if(e==="[F"||e==="[4~"||e==="[8~"){t({end:!0,raw:"\x1B"+e});return}if(e==="[3;5~"){t({delete:!0,ctrl:!0,raw:"\x1B"+e});return}if(e==="[3;3~"){t({delete:!0,meta:!0,raw:"\x1B"+e});return}}function St(n,t){n===72?t({home:!0,raw:"\x1BO"+String.fromCharCode(n)}):n===70&&t({end:!0,raw:"\x1BO"+String.fromCharCode(n)})}function Et(){let n="IDLE",t=[];function e(){n="IDLE",t=[]}return{feed(o,s){for(let l of o)n==="IDLE"?l===gt?(n="ESC",t=[]):Tt(l,s):n==="ESC"?l===91?(n="CSI",t=[]):l===79?(n="SS3",t=[]):(vt(l,s),e()):n==="CSI"?(t.push(l),bt(l)&&(wt([91,...t],s),e())):n==="SS3"&&(St(l,s),e())},flushIdle(o){n==="ESC"&&t.length===0&&o({raw:"\x1B"}),e()}}}function nt(n,t={}){let e=(0,Be.useRef)(n);e.current=n;let{stdin:o}=Fe();(0,Be.useEffect)(()=>{if(t.isActive===!1||!o)return;let s=Et(),l=null,m=v=>{l&&(clearTimeout(l),l=null);let b=Buffer.isBuffer(v)?v:Buffer.from(v,"binary");s.feed(b,d=>e.current(d)),l=setTimeout(()=>{s.flushIdle(d=>e.current(d)),l=null},50)};return o.on("data",m),()=>{o.removeListener("data",m),l&&clearTimeout(l)}},[t.isActive,o])}var w=$(re(),1);function yt(n,t){let e=t-1;for(;e>=0&&n[e]!=="@"&&n[e]!==" "&&n[e]!==`
4
4
  `;)e--;return e<0||n[e]!=="@"||e>0&&n[e-1]!==" "&&n[e-1]!==`
5
5
  `?null:{at:e,query:n.slice(e+1,t).join("")}}function rt(n,t,e){for(let o=t+e;o>=0&&o<n.length;o+=e)if(n[o]?.selectable!==!1)return o;return t}function At(n){let t=n.findIndex(e=>e.selectable!==!1);return t===-1?0:t}var Oe=10;function Rt(n){return n.replace(/\x1b?\[200~/g,"").replace(/\x1b?\[201~/g,"").replace(/\r\n/g,`
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as l}from"./chunk-DHJSM5DT.js";import{a as c}from"./chunk-NLCCBXXV.js";import{a}from"./chunk-RZ4F3BHX.js";var h=class{constructor(e,t,r,s){this.controllerBaseUrl=e;this.getOAuthToken=t;this.directBasicAuth=r;this.log=s}_cached=null;_revoked=!1;_lastError=null;revoke(){this._revoked=!0,this._cached=null}prime(e){this._revoked||(this._cached=e)}get revoked(){return this._revoked}get cached(){return this._cached}get lastError(){return this._lastError}async resolve(e=!1){if(this._cached&&!e)return this._cached;try{let t;if(this.directBasicAuth)t=new l(this.controllerBaseUrl,{username:this.directBasicAuth.username,accessKey:this.directBasicAuth.access_key});else{let s=await this.getOAuthToken();if(!s)return null;t=new l(this.controllerBaseUrl,s)}let r=await t.getTmsCredentials();this.directBasicAuth&&!r.access_key&&(r.access_key=this.directBasicAuth.access_key),this._cached=r,this._lastError=null;try{let[{refreshIdentitySnapshot:s},{telemetryEnvName:n}]=await Promise.all([import("./identity-ADZ4PAJF.js"),import("./bootstrap-KCPWDBLX.js")]);await s(n(),r)}catch{}return this.log?.("info","AUTH_RESOLVE_OK","Auth resolved",{username:r.username,org_id:r.org_id,user_id:r.user_id}),r}catch(t){return this._lastError=t instanceof Error?t:new Error(String(t)),this.log?.("warn","AUTH_RESOLVE_FAILED","Auth resolve failed",{error:this._lastError.message}),null}}async fetch(e,t={}){if(this._revoked)throw new Error("Resolver has been revoked \u2014 identity changed");let r=await this.resolve();if(!r)throw new Error("Not authenticated \u2014 no credentials resolved");let s=i=>({...t,headers:{...t.headers,Authorization:c(i.username,i.access_key)}}),n=await a(e,s(r));if(n.status===401){if(this._revoked)throw new Error("Resolver has been revoked \u2014 identity changed");this.log?.("warn","AUTH_RESOLVE_401","Got 401, re-resolving",{url:e});let i=await this.resolve(!0);if(!i)throw new Error("Re-authentication failed after 401");return a(e,s(i))}return n}};function _(o){if(!o)return"network";let e=/failed:\s*(\d{3})\b/.exec(o.message)?.[1];return e==="401"||e==="403"?"auth":e?"server":"network"}export{h as a,_ as b};
2
+ import{a as l}from"./chunk-DHJSM5DT.js";import{a as c}from"./chunk-NLCCBXXV.js";import{a}from"./chunk-RZ4F3BHX.js";var h=class{constructor(e,t,r,s){this.controllerBaseUrl=e;this.getOAuthToken=t;this.directBasicAuth=r;this.log=s}_cached=null;_revoked=!1;_lastError=null;revoke(){this._revoked=!0,this._cached=null}prime(e){this._revoked||(this._cached=e)}get revoked(){return this._revoked}get cached(){return this._cached}get lastError(){return this._lastError}async resolve(e=!1){if(this._cached&&!e)return this._cached;try{let t;if(this.directBasicAuth)t=new l(this.controllerBaseUrl,{username:this.directBasicAuth.username,accessKey:this.directBasicAuth.access_key});else{let s=await this.getOAuthToken();if(!s)return null;t=new l(this.controllerBaseUrl,s)}let r=await t.getTmsCredentials();this.directBasicAuth&&!r.access_key&&(r.access_key=this.directBasicAuth.access_key),this._cached=r,this._lastError=null;try{let[{refreshIdentitySnapshot:s},{telemetryEnvName:n}]=await Promise.all([import("./identity-ADZ4PAJF.js"),import("./bootstrap-63FBDEEU.js")]);await s(n(),r)}catch{}return this.log?.("info","AUTH_RESOLVE_OK","Auth resolved",{username:r.username,org_id:r.org_id,user_id:r.user_id}),r}catch(t){return this._lastError=t instanceof Error?t:new Error(String(t)),this.log?.("warn","AUTH_RESOLVE_FAILED","Auth resolve failed",{error:this._lastError.message}),null}}async fetch(e,t={}){if(this._revoked)throw new Error("Resolver has been revoked \u2014 identity changed");let r=await this.resolve();if(!r)throw new Error("Not authenticated \u2014 no credentials resolved");let s=i=>({...t,headers:{...t.headers,Authorization:c(i.username,i.access_key)}}),n=await a(e,s(r));if(n.status===401){if(this._revoked)throw new Error("Resolver has been revoked \u2014 identity changed");this.log?.("warn","AUTH_RESOLVE_401","Got 401, re-resolving",{url:e});let i=await this.resolve(!0);if(!i)throw new Error("Re-authentication failed after 401");return a(e,s(i))}return n}};function _(o){if(!o)return"network";let e=/failed:\s*(\d{3})\b/.exec(o.message)?.[1];return e==="401"||e==="403"?"auth":e?"server":"network"}export{h as a,_ as b};
@@ -0,0 +1,5 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as xe}from"./chunk-KJQNAOOE.js";import{a as Ce,b as Ie,d as Ae,e as Ne}from"./chunk-BB2W35TW.js";import{a as Te}from"./chunk-KDNNMU7Q.js";import{e as Oe,l as ke,y as Re}from"./chunk-IICT4VOU.js";import{a as ye}from"./chunk-D6E6KRVX.js";import{e as ve}from"./chunk-3UI5VTQS.js";import{H as Ee,M as $e,c as be,d as ne,m as Se}from"./chunk-RDHWNSDP.js";import{d as le,e as K,f as g,g as l,h as me,i as he,j as _e}from"./chunk-XLSOQLVT.js";var Be=/\s@verifies\s+(ac-[\w.:\/-]+(?:\s*,\s*ac-[\w.:\/-]+)*)\s*$/,D=i=>({record:null,errors:i,minted:{},logicalIds:{},superseded:[],warnings:[],finalizedTests:{}});function q(i){return i.toLowerCase().trim().replace(/\s+/g," ")}function Ge(i,k,s={}){let p=i.resolve(k);if(!p||i.nodeLabel.get(p.cid)!==g.USECASE||p.superseded)return[];let a=new Set,v=new Set;for(let{cid:m}of i.byLabel(g.SCENARIO))if(!i.superseded.has(m)&&i.edgesFrom(m).some(b=>b.type===l.BELONGS_TO&&i.tipOf(b.dst)===p.cid)){a.add(m),v.add(m),v.add(i.tipOf(m));for(let b of i.edgesInto(m))b.type!==l.AUTOMATES||i.superseded.has(b.src)||a.add(b.src)}if(s.blockerGaps){let m=new Set([p.cid,i.tipOf(p.cid)]);for(let{cid:b,content:S}of i.byLabel(g.GAP)){if(i.superseded.has(b)||i.trust.get(b)==="archived"||!K.has(String(S.kind??"")))continue;let $=typeof S.uc=="string"?S.uc:"";if(!m.has($)&&!m.has(i.tipOf($)))continue;let h=S.ref,L=typeof h=="string"&&h?i.resolve(h):null;L&&(v.has(L.cid)||v.has(i.tipOf(L.cid)))&&a.add(b)}}return[...a]}function et(i){let{contextDir:k,graph:s,sections:p,by:a}=i,v=i.engine??"design@1",m=Ee(k);if(s.latestHash!==m)return D([{code:"STALE_BASIS",detail:`graph opened at ${String(s.latestHash)} but chain head is ${String(m)} \u2014 re-open and retry`}]);let b=s.resolve(i.ucRef);if(!b||s.nodeLabel.get(b.cid)!==g.USECASE||b.superseded)return D([{code:"UNKNOWN_UC",detail:`${i.ucRef} is not a live use-case`}]);let S=b.cid,$={ucRef:S,automates:{},verifies:{},reuses:{},scope:{},depends_on:{},exercises:[],scoped_to_repoints:[],judgements:[],body_tags:{},forceScope:[]},h=[],L=/^design@(\d+)$/.exec(i.templateVersion??""),P=le(i.templateVersion)>=8,ie=e=>{if(!P||!K.has(String(e.kind))||!(e.kind==="unmeasurable"||i.phase==="tests")||e.ref&&(p.scenarios??[]).some(n=>n.temp_ref===e.ref))return!0;let t=e.ref?s.resolve(e.ref):null;return!!(t&&s.nodeLabel.get(t.cid)===g.SCENARIO&&!s.superseded.has(s.tipOf(t.cid))&&s.edgesFrom(s.tipOf(t.cid)).some(n=>n.type===l.BELONGS_TO&&s.tipOf(n.dst)===S))},Y=(p.gaps??[]).filter(ie),we=L!==null&&Number.parseInt(L[1],10)>=3,oe=new Map,De=(e,t)=>{let n=oe.get(e.source_cid);if(n===void 0){let r=Te(i.contextDir,s,e.source_cid);n=r?xe(r.toString("utf8")):null,oe.set(e.source_cid,n)}if(n===null)return h.push({code:"CITE_UNVERIFIED",detail:`${t}: source ${e.source_id} (${e.source_cid.slice(0,19)}) has no citable text to verify against`}),!1;let d=ve(s.mediaOf(e.source_cid),e,n);if(d.length>0){for(let r of d)h.push({code:"CITE_UNVERIFIED",detail:`${t}: ${r.code}: ${r.detail}`});return!1}return!0},N=[],j=[],C=[],J=[],U=[],y={},B={},W={},R=[],M=[],re=new Set,Q=[],V=new Set,x=new Set,X=[];{let e=i.forceScope??(i.force?Ge(s,i.ucRef,{blockerGaps:P}):[]);$.forceScope=[...e];let t=new Set;i.sections.scenarios?.length&&t.add(g.SCENARIO),i.sections.tests?.length&&t.add(g.TEST),P&&(i.sections.tests?.length||i.phase==="tests"&&Y.some(n=>K.has(String(n.kind))))&&(t.add(g.TEST),t.add(g.GAP));for(let n of e)s.superseded.has(n)||(t.has(s.nodeLabel.get(n)??"")?x.add(n):X.push(n))}let F=new Set,Z=e=>!s.superseded.has(e)&&(!x.has(e)||F.has(e)),I=(e,t,n)=>{if(y[e])return y[e];let d=s.resolve(e),r=d?Z(d.cid)?d.cid:s.tipOf(d.cid):null;return!d||!r||!Z(r)?(h.push({code:"UNKNOWN_REF",detail:`${t}: '${e}' is neither in this payload nor a live committed node`}),null):n&&s.nodeLabel.get(r)!==n?(h.push({code:"ILLEGAL_EDGE",detail:`${t}: '${e}' is a ${s.nodeLabel.get(r)}, expected ${n}`}),null):r},Le=(e,t,n,d)=>{if(s.nameOf.has(t)){B[d]=s.nameOf.get(t);return}let r=Re(e,E=>re.has(E),s.names.keys());r!==null&&(re.add(r),J.push({cid:t,slug:r,by:a}),B[d]=r)},z=(e,t,n,d)=>{for(let E of me(e,n))h.push({code:E.code,detail:`${t}: ${E.detail}`});let r=be(e,n);return s.hasNode(r)&&!s.superseded.has(r)?(x.has(r)&&F.add(r),y[t]=r,r):(N.push({cid:r,label:e,content:n}),y[t]=r,Le(e,r,d,t),r)},T=(e,t,n,d,r)=>{let E=ne(e,t,n,d);if(s.edgesFrom(t).some(o=>o.ecid===E&&!s.superseded.has(o.ecid))){e===l.AUTOMATES&&V.add(n);return}if(s.superseded.has(E)){h.push({code:"EDGE_RETRACTED",detail:`${r}: this ${e} edge was retracted (${E}) \u2014 retraction is terminal for commits. Add a NEW relationship (different endpoint or props), redesign, or revert the retracting record`});return}let A=s.nodeLabel.get(t)??N.find(o=>o.cid===t)?.label??"(unknown)",H=s.nodeLabel.get(n)??N.find(o=>o.cid===n)?.label??"(unknown)";for(let o of _e(e,A,H,d))h.push({code:o.code,detail:`${r}: ${o.detail}`});let f=Oe(s,e,t,n,Q);if(f){h.push({code:f.code,detail:`${r}: ${f.detail}`});return}if(e===l.BELONGS_TO||e===l.SCOPED_TO){let o=ye(s,{type:e,src:t,dst:n},{pending:Q,retracted:new Set(C.flatMap(c=>c.kind==="edge"?[c.ecid]:[])),freed:new Set([...x].filter(c=>!F.has(c)))},r);if(o){h.push(o);return}}if(e===l.AUTOMATES){if(V.has(n)){h.push({code:"CARDINALITY_VIOLATION",detail:`${r}: two automates onto ${n} in one record (strict 1:1)`});return}if(V.add(n),!x.has(n)||F.has(n)){let o=_=>x.has(_)&&!F.has(_);if(s.edgesFrom(t).some(_=>_.type===l.AUTOMATES&&_.dst!==n&&!s.superseded.has(_.dst)&&!o(_.dst))&&s.hasNode(t)){h.push({code:"CARDINALITY_VIOLATION",detail:`${r}: automates from ${t} already has a live edge \u2014 supersede it first`});return}if(s.edgesInto(n).some(_=>_.type===l.AUTOMATES&&_.src!==t&&!s.superseded.has(_.src)&&!o(_.src))){h.push({code:"CARDINALITY_VIOLATION",detail:`${r}: automates onto ${n} already has a live edge \u2014 strict 1:1, supersede it first`});return}}}j.push({ecid:ne(e,t,n,d),type:e,src:t,dst:n,props:d}),Q.push({src:t,dst:n,type:e})},ee=new Set;for(let e of Y)e.kind==="budget-evicted"&&e.ref&&ee.add(e.ref);let w=[];for(let[e,t]of(p.gaps??[]).entries()){if(ie(t))continue;let n=t.temp_ref??t.ref??"gap";w.push(e),R.push(`${n} not committed: a ${t.kind} gap stands in for a scenario's test \u2014 ref must be that scenario's committed id (sc-N) or its temp_ref in this payload; got ${t.ref?`'${t.ref}'`:"no ref"}`)}let ce=()=>{for(let e of Y){let t=e.temp_ref??e.ref??"gap",n=e.question;if(!n||typeof n!="object"||!n.header||!Array.isArray(n.options)||n.options.length===0||!Number.isInteger(n.recommended_index)){h.push({code:"GAP_QUESTION_INCOMPLETE",detail:`${t}: design gaps carry a full ranked question object (header/options/recommended_index)`});continue}let d=e.ref?P?y[e.ref]??e.ref:e.ref:void 0,r={kind:e.kind,question:n,derived:!0,uc:S,...e.risk?{risk:e.risk}:{},...e.risk_rationale?{risk_rationale:e.risk_rationale}:{},...e.text?{text:e.text}:{},...d?{ref:d}:{}};z(g.GAP,t,r,String(n.header))}};P||ce();let de=new Map;for(let{cid:e,content:t}of s.byLabel(g.SCENARIO))Z(e)&&s.edgesFrom(e).some(n=>n.type===l.BELONGS_TO&&s.tipOf(n.dst)===S)&&de.set(q(String(t.title??"")),e);for(let e of p.scenarios??[]){let t=de.get(q(e.title));if(t){h.push({code:"DUPLICATE_SCENARIO",detail:`${e.temp_ref}: '${e.title}' duplicates live scenario ${s.nameOf.get(t)??t} \u2014 exercise/link it instead (reuse before minting)`});continue}let n={title:e.title,intent:e.intent,case_type:e.case_type,derived:!0,...e.technique_notes?{technique_notes:e.technique_notes}:{},...e.description?{description:e.description}:{},...e.parameters?{parameters:e.parameters}:{},...e.tags?{tags:e.tags}:{}};z(g.SCENARIO,e.temp_ref,n,e.title)}for(let e of p.scenarios??[]){let t=y[e.temp_ref];if(t){T(l.BELONGS_TO,t,S,{},e.temp_ref);for(let n of e.depends_on??[]){let d=I(n,`${e.temp_ref}.depends_on`,g.SCENARIO);d&&(($.depends_on[e.temp_ref]??=[]).push(d),T(l.DEPENDS_ON,t,d,{},`${e.temp_ref}.depends_on`))}}}for(let e of p.acs??[]){let t={text:e.text,kind:e.kind,risk:e.risk,derived:!0,...e.expected_answer?{expected_answer:e.expected_answer}:{},...e.measurable!==void 0?{measurable:e.measurable}:{}},n=z(g.AC,e.temp_ref,t,e.text);if(!n)continue;let d=e.scope?.type==="scenario"&&e.scope.ref?I(e.scope.ref,`${e.temp_ref}.scope`,g.SCENARIO):S;d&&d!==S&&($.scope[e.temp_ref]=d),d&&!s.edgesFrom(n).some(r=>r.type===l.SCOPED_TO&&!s.superseded.has(r.ecid))&&T(l.SCOPED_TO,n,d,{},`${e.temp_ref}.scope`);for(let r of e.cites??[]){if(we&&!De(r,`${e.temp_ref}.cite`))continue;let E={source_id:r.source_id,source_cid:r.source_cid,anchor:r.anchor,...r.quote?{quote:r.quote}:{}};T(l.DERIVES,r.source_cid,n,E,`${e.temp_ref}.cite`)}}for(let e of p.exercises??[]){let t=I(e.scenario,"exercises.scenario",g.SCENARIO),n=I(e.ac,"exercises.ac",g.AC);!t||!n||($.exercises.push({scenario:t,ac:n}),T(l.EXERCISES,t,n,{},`exercises ${e.scenario}\u2192${e.ac}`))}let ae=0;for(let e of p.scoped_to_repoints??[]){let t=I(e.ac,"scoped_to_repoints.ac",g.AC),n=I(e.to,"scoped_to_repoints.to");if(!t||!n)continue;$.scoped_to_repoints.push({ac:t,to:n});let d=s.edgesFrom(t).find(r=>r.type===l.SCOPED_TO&&!s.superseded.has(r.ecid));if(d&&d.dst===n){ae+=1,R.push(`scoped_to_repoints ${e.ac}: already scoped to ${e.to} \u2014 no-op`);continue}d&&C.push({kind:"edge",ecid:d.ecid,reason:`re-scoped to ${e.to} by ${a.id}`,by:a}),T(l.SCOPED_TO,t,n,{},`scoped_to_repoints ${e.ac}`)}let fe=new Map;if(i.finalizeTestBody)for(let[e,t]of s.nameOf)fe.set(s.tipOf(e),t);let ue=e=>s.nameOf.get(e)??fe.get(s.tipOf(e))??null,pe=e=>{if(y[e])return y[e];let t=s.resolve(e);return t?s.names.has(e)&&!s.superseded.has(t.cid)?t.cid:s.tipOf(t.cid):null},Pe=e=>{let t=pe(e);if(!t&&i.strict)throw new Error(`UNMAPPED_REF: '${e}' resolves to nothing on this graph`);return t?y[e]?B[e]??ue(t):s.names.has(e)?e:ue(t):null};P&&ce();for(let e of p.tests??[]){for(let f of e.reuses??[])ee.has(f)&&h.push({code:"REUSES_EVICTED",detail:`${e.temp_ref}: reuses '${f}' which was budget-evicted \u2014 drop the edge; the dependent gap names the missing @import`});{let f=c=>c==="emulator"||c==="simulator"?c:"web",o=c=>{let u=(p.tests??[]).find(Fe=>Fe.temp_ref===c);if(u)return f(u.target);let _=s.resolve(c),O=_?s.getNode(s.tipOf(_.cid)??_.cid)?.content:void 0;if(typeof O?.target=="string")return f(String(O.target));let ge=/^\s*\[mobile:\s*(emulator|simulator)\]/m.exec(String(O?.test_md_blob??""));return ge?ge[1]:"web"};for(let c of e.reuses??[]){let u=f(e.target),_=o(c);u!==_&&h.push({code:"REUSES_CROSS_SURFACE",detail:`${e.temp_ref}: reuses '${c}' which runs on ${_} while this test runs on ${u} \u2014 a test imports only same-surface units`})}}let t=e.test_md_blob,n=e.definitionId,d=e.objectives_blob;if(i.finalizeTestBody){let f;try{f=i.finalizeTestBody({temp_ref:e.temp_ref,test_md_blob:e.test_md_blob,verifies:e.verifies,reuses:e.reuses??[]},Pe)}catch(o){return D([{code:"FINALIZE_BODY",detail:`${e.temp_ref}: ${o instanceof Error?o.message:String(o)}`}])}f&&(t=f.test_md_blob,n=f.definitionId,d=f.objectives_blob??d,W[e.temp_ref]=n)}let r={title:e.title,check:e.check,definitionId:n,derived:!0,...e.config?{config:e.config}:{},...t?{test_md_blob:t}:{},...d?{objectives_blob:d}:{},...e.surface_required!==void 0?{surface_required:e.surface_required}:{},...e.target?{target:e.target}:{},...e.app&&e.target?{app:e.app}:{}},E=z(g.TEST,e.temp_ref,r,e.title);if(!E)continue;let A=I(e.automates,`${e.temp_ref}.automates`,g.SCENARIO);A&&($.automates[e.temp_ref]=A,T(l.AUTOMATES,E,A,{},`${e.temp_ref}.automates`)),$.verifies[e.temp_ref]=[];for(let f of e.verifies){let o=I(f,`${e.temp_ref}.verifies`,g.AC);o&&($.verifies[e.temp_ref].push(o),T(l.VERIFIES,E,o,{},`${e.temp_ref}.verifies`))}$.reuses[e.temp_ref]=[];for(let f of e.reuses??[]){if(ee.has(f))continue;let o=I(f,`${e.temp_ref}.reuses`,g.TEST);o&&($.reuses[e.temp_ref].push(o),T(l.REUSES,E,o,{},`${e.temp_ref}.reuses`))}for(let f of e.verifies){let o=y[f]??s.resolve(f)?.cid;o&&(s.trust.get(o)??"derived")==="derived"&&!N.some(c=>c.cid===o)?R.push(`${e.temp_ref}: verifies ${f} which is still DERIVED (unapproved) \u2014 committed anyway; approve it in chat or via review`):o&&y[f]===o&&(p.acs??[]).some(c=>c.temp_ref===f)&&R.push(`${e.temp_ref}: verifies ${f} minted in this same record (unapproved) \u2014 committed anyway; approve it in chat`)}if(!String(e.test_md_blob??"").split(`
3
+ `).some(f=>/^##\s/.test(f)&&!/—\s?assert/.test(f)&&Be.test(f))&&e.verifies.length>1){let f=e.check?.verified_against;R.push(`${e.temp_ref}: verifies ${e.verifies.length} ACs but machine-asserts only 1 (check.verified_against=${f!=null?String(f):"?"}) \u2014 the rest ride prose only`)}}let G=[];for(let e of p.tests??[]){let t={};for(let n of je(e.test_md_blob,e.objectives_blob)){let d=pe(n);d?t[n]=d:G.push(`${e.temp_ref}: body tag '${n}' resolves to nothing`)}$.body_tags[e.temp_ref]=t,G.push(...qe(e.temp_ref,t,[...$.verifies[e.temp_ref]??[],...$.reuses[e.temp_ref]??[]]))}if(G.length>0){if(i.strict)return D(G.map(e=>({code:"BODY_EDGE_MISMATCH",detail:e})));R.push(...G.map(e=>`integrity: ${e}`))}let te=[];{let e=(o,c)=>`${o??""}\0${q(String(c??""))}`,t=(o,c)=>i.reason?`${i.reason} \u2014 evolve by ${a.id}${c?` (${c})`:""}`:o,n=new Map;for(let o of N){if(o.label!==g.SCENARIO&&o.label!==g.TEST)continue;let c=e(o.label,o.content.title);n.set(c,[...n.get(c)??[],o.cid])}let d=new Map;for(let o of x){if(F.has(o))continue;let c=e(s.nodeLabel.get(o),s.getNode(o)?.content.title);d.set(c,[...d.get(c)??[],o])}for(let[o,c]of d){let u=n.get(o)??[],_=c.length===1&&u.length===1;for(let O of c)_?(C.push({kind:"node",old:O,new:u[0],reason:t(`--force redesign of ${i.ucRef} by ${a.id} (title-matched successor)`,"title-matched successor"),by:a}),te.push({old:O,next:u[0]})):C.push({kind:"node",old:O,new:null,reason:t(`--force redesign of ${i.ucRef} by ${a.id}`),by:a}),M.push(O)}let r=o=>s.edgesFrom(o).some(c=>c.type!==l.SCOPED_TO?!1:c.dst===S||s.tipOf(c.dst)===S?!0:s.nodeLabel.get(c.dst)===g.SCENARIO&&s.edgesFrom(c.dst).some(u=>u.type===l.BELONGS_TO&&s.tipOf(u.dst)===S)),E=new Map;for(let{cid:o,content:c}of s.byLabel(g.AC)){if(s.superseded.has(o)||!r(o))continue;let u=q(String(c.text??""));E.set(u,[...E.get(u)??[],o])}let A=new Map;for(let o of N){if(o.label!==g.AC)continue;let c=q(String(o.content.text??""));A.set(c,[...A.get(c)??[],o.cid])}for(let[o,c]of E){let u=A.get(o)??[];c.length!==1||u.length!==1||(C.push({kind:"node",old:c[0],new:u[0],reason:t(`AC re-emitted with changed content by ${a.id} (text-matched successor)`,"AC text-matched successor"),by:a}),te.push({old:c[0],next:u[0]}),M.push(c[0]))}let H=new Set(M),f=new Set;for(let o of C)o.kind==="edge"&&f.add(o.ecid);for(let{old:o,next:c}of te)for(let u of s.edgesInto(o))he(u.type)?.pin?.comparesTo!=="dst_tip"||s.superseded.has(u.src)||H.has(u.src)||f.has(u.ecid)||(C.push({kind:"edge",ecid:u.ecid,reason:`re-blessed onto ${c} (redirect successor of ${o}) by ${a.id}`,by:a}),f.add(u.ecid),j.some(O=>O.type===u.type&&O.src===u.src&&O.dst===c)||s.edgesFrom(u.src).some(O=>O.type===u.type&&O.dst===c))||u.type===l.AUTOMATES&&V.has(c)||T(u.type,u.src,c,u.props,`rebless ${u.type} from ${s.nameOf.get(u.src)??u.src}`)}if(h.length>0)return D(h);if(N.length===0&&j.length===0&&C.length===0&&U.length===0)return Object.keys(y).length>0||ae>0?(R.push("everything in this phase is already current \u2014 nothing re-committed"),{record:null,errors:null,minted:y,logicalIds:B,superseded:[],warnings:R,finalizedTests:W,...w.length?{droppedBlockers:w}:{},...i.force||i.forceScope?{forceScopeRemaining:X}:{}}):{...D([{code:"EMPTY_DESIGN",detail:"finalize_design produced nothing to commit"}]),warnings:R,...w.length?{droppedBlockers:w}:{}};if(i.generationTicket){let e=Ae(s,i.generationTicket);if(e!==null)return D([e])}let se=i.eventIds&&i.eventIds.length>0?i.eventIds:i.sid?ke(s,i.sid,"design",1):null;return{record:$e(k,{ts:new Date().toISOString(),proposal_id:null,nodes:N,edges:j,review:[],supersessions:C,source_head_moves:{},...J.length>0?{names:J}:{},...(()=>{for(let e of p.judgements??[]){let t=e.target?y[e.target]??s.resolve(e.target)?.cid??S:S;$.judgements.push(t),U.push({about:t,rationale:`[${e.kind}] ${e.rationale}`,by:a})}return U.length>0?{judgements:U}:{}})(),design_of:{uc_cid:S,engine:v},...i.generationTicket?{design_generation:Ne(i.generationTicket,S,a)}:{},...se?{event_ids:se}:{},...i.sid?{sid:i.sid}:{},...i.phase?{design_phase:{uc_root:Ce(s,S),generation:i.generationTicket?.next_gen??Ie(s,i.ucRef)?.gen??1,phase:i.phase,completeness:i.phaseCompleteness??"complete"}}:{}},{expectPrev:s.latestHash,intent:{v:1,verb:"design",args:Se({ucRef:i.ucRef,sections:p,by:a,engine:v,force:i.force??!1,forceScope:i.forceScope??null,reason:i.reason??null,generationTicket:i.generationTicket??null,templateVersion:i.templateVersion??null,phase:i.phase??null,phaseCompleteness:i.phaseCompleteness??null,eventIds:se,sid:i.sid??null}),pins:$},provenance:i.provenance}).record,errors:null,minted:y,logicalIds:B,superseded:M,warnings:R,finalizedTests:W,...w.length?{droppedBlockers:w}:{},...i.force||i.forceScope?{forceScopeRemaining:X}:{}}}function qe(i,k,s){let p=new Set(Object.values(k));if(p.size===0)return[];let a=new Set(s),v=[];for(let[m,b]of Object.entries(k))a.has(b)||v.push(`${i}: body tag '${m}' has no verifies or reuses edge`);for(let m of a)p.has(m)||v.push(`${i}: edge to ${m} has no body tag`);return v}function je(i,k){let s=[];for(let a of(i??"").split(`
4
+ `)){let v=/^##\s.*?\s@verifies\s+(.+?)\s*$/.exec(a);v&&s.push(...v[1].split(",").map(b=>b.trim()).filter(Boolean));let m=/^@import\s+(\S+)\s*$/.exec(a.trim())??/^## Import: (\S+)\s*$/.exec(a);m&&s.push(m[1])}let p=!1;for(let a of(k??"").split(`
5
+ `)){let v=/^\s*verifies:\s*\[(.*)\]\s*$/.exec(a);if(v){s.push(...v[1].split(",").map(b=>b.trim()).filter(Boolean));continue}if(/^\s*verifies:\s*$/.test(a)){p=!0;continue}let m=p?/^\s*-\s+(\S+)\s*$/.exec(a):null;m?s.push(m[1]):p=!1}return s}function tt(i,k){let s=[];for(let p of i){let a=p.design_phase;!a||typeof a!="object"||a.uc_root===k&&(typeof a.phase!="string"||typeof a.generation!="number"||s.push({phase:a.phase,generation:a.generation,seq:p.seq,completeness:a.completeness==="partial"?"partial":"complete"}))}return s.sort((p,a)=>p.seq-a.seq)}export{Ge as a,et as b,tt as c};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{F as c}from"./chunk-3N6IAVD5.js";import{d as l}from"./chunk-AKX4VRRR.js";function h(f,o,u){let n=o.resolve(u);if(!n)return{target:null,entries:[]};let t=new Set([n.cid]),r=n.cid;for(;o.superseded.has(r);){let s=o.superseded.get(r);if(typeof s!="string"||t.has(s))break;t.add(s),r=s}let d=o.nodeLabel.get(n.cid)??"(unknown)",{records:p}=c(f),i=[];for(let s of p){for(let e of s.nodes)t.has(e.cid)&&i.push({seq:s.seq,ts:s.ts,kind:"minted",detail:`minted ${e.label} ${e.cid}`});for(let e of s.judgements??[])t.has(e.about)&&i.push({seq:s.seq,ts:s.ts,kind:"judgement",rationale:e.rationale,detail:`judgement on ${e.about}`,by:e.by});for(let e of s.review)t.has(e.id)&&i.push({seq:s.seq,ts:s.ts,kind:"review",detail:`${e.resolution}${e.reason?` \u2014 ${e.reason}`:""}`,by:e.by});for(let e of s.supersessions)e.kind==="node"&&(t.has(e.old)||e.new!==null&&t.has(e.new))&&i.push({seq:s.seq,ts:s.ts,kind:"supersession",detail:`${e.old} \u2192 ${String(e.new)} \u2014 ${e.reason}`,by:e.by});for(let e of s.names??[])t.has(e.cid)&&i.push({seq:s.seq,ts:s.ts,kind:"name",detail:`named ${e.slug}`,by:e.by});if(d===l.SOURCE)for(let[e,a]of Object.entries(s.source_head_moves))(t.has(a??"")||o.heads.get(e)!==void 0&&t.has(n.cid)&&e===o.getNode(n.cid)?.content?.source_id)&&i.push({seq:s.seq,ts:s.ts,kind:"head_move",detail:`${e} head \u2192 ${String(a)}`})}return i.sort((s,e)=>e.seq-s.seq),{target:{cid:n.cid,tip:n.tip,label:d,slug:o.nameOf.get(n.cid)},entries:i}}export{h as a};
2
+ import{F as c}from"./chunk-RDHWNSDP.js";import{f as l}from"./chunk-XLSOQLVT.js";function h(f,o,u){let n=o.resolve(u);if(!n)return{target:null,entries:[]};let t=new Set([n.cid]),r=n.cid;for(;o.superseded.has(r);){let s=o.superseded.get(r);if(typeof s!="string"||t.has(s))break;t.add(s),r=s}let d=o.nodeLabel.get(n.cid)??"(unknown)",{records:p}=c(f),i=[];for(let s of p){for(let e of s.nodes)t.has(e.cid)&&i.push({seq:s.seq,ts:s.ts,kind:"minted",detail:`minted ${e.label} ${e.cid}`});for(let e of s.judgements??[])t.has(e.about)&&i.push({seq:s.seq,ts:s.ts,kind:"judgement",rationale:e.rationale,detail:`judgement on ${e.about}`,by:e.by});for(let e of s.review)t.has(e.id)&&i.push({seq:s.seq,ts:s.ts,kind:"review",detail:`${e.resolution}${e.reason?` \u2014 ${e.reason}`:""}`,by:e.by});for(let e of s.supersessions)e.kind==="node"&&(t.has(e.old)||e.new!==null&&t.has(e.new))&&i.push({seq:s.seq,ts:s.ts,kind:"supersession",detail:`${e.old} \u2192 ${String(e.new)} \u2014 ${e.reason}`,by:e.by});for(let e of s.names??[])t.has(e.cid)&&i.push({seq:s.seq,ts:s.ts,kind:"name",detail:`named ${e.slug}`,by:e.by});if(d===l.SOURCE)for(let[e,a]of Object.entries(s.source_head_moves))(t.has(a??"")||o.heads.get(e)!==void 0&&t.has(n.cid)&&e===o.getNode(n.cid)?.content?.source_id)&&i.push({seq:s.seq,ts:s.ts,kind:"head_move",detail:`${e} head \u2192 ${String(a)}`})}return i.sort((s,e)=>e.seq-s.seq),{target:{cid:n.cid,tip:n.tip,label:d,slug:o.nameOf.get(n.cid)},entries:i}}export{h as a};
@@ -0,0 +1,6 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{F as I,L,p as V}from"./chunk-RDHWNSDP.js";var N="ckpt/1";var B="checkpoints",P="base.json",y=t=>`delta-${t}.json`,w=t=>`full-${t}.json`,oe=["turn","ask","final"],ae=["extract","design","walk"];function _(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function x(t){return Array.isArray(t)&&t.every(n=>typeof n=="string")}function H(t){let n=[],e=(r,a)=>{r||n.push(a)};if(!_(t))return{ok:!1,errors:["record: not an object"]};e(t.schema===N,`schema: expected "${N}"`);let s=t.kind;if(s==="base")e(typeof t.sid=="string"&&t.sid.length>0,"base.sid: non-empty string"),e(typeof t.verb=="string"&&ae.includes(t.verb),"base.verb: extract|design|walk"),e(typeof t.mode=="string","base.mode: string"),e(typeof t.created_at=="string","base.created_at: string"),e(_(t.run_config),"base.run_config: object"),_(t.run_config)&&e(!("resume"in t.run_config),"base.run_config: must not carry `resume`"),e(typeof t.conv_source=="string",'base.conv_source: string ("" when absent)'),e(typeof t.store_watermark=="string"||t.store_watermark===null,"base.store_watermark: string | null (null = genesis)");else if(s==="delta"||s==="full"){e(typeof t.sid=="string"&&t.sid.length>0,"delta.sid: non-empty string"),e(Number.isInteger(t.seq)&&t.seq>=1,"delta.seq: integer \u2265 1"),e(Number.isInteger(t.turn_id),"delta.turn_id: integer"),e(typeof t.at=="string"&&oe.includes(t.at),"delta.at: turn|ask|final"),e(typeof t.ts=="string","delta.ts: string");let r=t.agent;if(_(r)){e(Number.isInteger(r.agent_state_schema),"agent.agent_state_schema: integer"),e(Array.isArray(r.delta_items),"agent.delta_items: array"),e(_(r.binding),"agent.binding: object");let o=r.usage_total;e(_(o)&&typeof o.input_tokens=="number"&&typeof o.output_tokens=="number"&&typeof o.credits=="number","agent.usage_total: {input_tokens, output_tokens, credits} numbers"),r.base_fingerprint!==void 0&&e(typeof r.base_fingerprint=="string","agent.base_fingerprint: string when present"),s==="full"&&e(typeof r.base_fingerprint=="string","full: agent.base_fingerprint required")}else n.push("delta.agent: object");let a=t.kane;if(_(a)){e(x(a.applied_events),"kane.applied_events: string[]"),e(x(a.held_receipts),"kane.held_receipts: string[]");let o=a.pending;e(_(o)&&Array.isArray(o.questions)&&Array.isArray(o.proposals),"kane.pending: {questions[], proposals[]}"),e(Array.isArray(a.parent_asks),"kane.parent_asks: array"),e(_(a.read_basis),"kane.read_basis: object");let p=a.corpus_cursor;e(_(p)&&x(p.remaining),"kane.corpus_cursor: {remaining: string[]}"),e(typeof a.store_watermark=="string"||a.store_watermark===null,"kane.store_watermark: string | null (null = genesis)"),a.ingest_registry!==void 0&&e(Array.isArray(a.ingest_registry)&&a.ingest_registry.every(i=>_(i)&&typeof i.ref=="string"&&typeof i.entered_at=="string"),"kane.ingest_registry: [{ref, entered_at, consumed?}]"),a.ingest_schedule!==void 0&&e(Array.isArray(a.ingest_schedule)&&a.ingest_schedule.every(i=>_(i)&&typeof i.source_id=="string"&&typeof i.cid=="string"&&["pending","done","skipped"].includes(String(i.status))),"kane.ingest_schedule: [{source_id, cid, status}]")}else n.push("delta.kane: object")}else n.push('kind: expected "base" | "delta" | "full"');return{ok:n.length===0,errors:n}}import{closeSync as U,existsSync as Z,fsyncSync as Y,mkdirSync as ee,openSync as G,readFileSync as te,readdirSync as ne,renameSync as ce,rmSync as K,statSync as pe,writeFileSync as de}from"fs";import{join as k}from"path";var le=3,we=600*1e3,A=class extends Error{constructor(e,s){super(`${e}: ${s}`);this.code=e}},S=class extends Error{constructor(n){super(`CHECKPOINT_WRITE: ${n}`)}},j=class extends S{},E=(t,n)=>k(t,"sessions",n,B),ue=(t,n)=>k(t,"sessions",n,"state.json");function F(t,n,e){let s=`${t}.tmp-${process.pid}`,r=G(s,"w");try{de(r,n,{mode:384}),Y(r)}finally{U(r)}ce(s,t);try{let a=G(e,"r");Y(a),U(a)}catch{}}var ge=new Set,W=new Set;function J(t){let n=0;try{for(let e of ne(t))try{n+=pe(k(t,e)).size}catch{}}catch{return 0}return n}function z(t,n,e){for(let s of ge)try{s(t,n,e)}catch{}}var fe=new Set;function Se(t,n=new Date){for(let e of fe)try{e(t,n)}catch{}}function Ae(t,n,e){let s=E(t,n);ee(s,{recursive:!0});let r=k(s,P);Z(r)||F(r,JSON.stringify(e)+`
3
+ `,s)}function _e(t,n){let e;try{e=JSON.parse(n)}catch(r){throw new A("CHECKPOINT_CORRUPT",`${t}: ${r.message}`)}let s=H(e);if(!s.ok)throw new A("CHECKPOINT_CORRUPT",`${t}: ${s.errors.join("; ")}`);return e}function M(t,n,e){let s=k(E(t,n),e);return _e(e,te(s,"utf8"))}function re(t,n){let e=[],s=[],r=[];try{r=ne(E(t,n))}catch{return{deltas:e,fulls:s}}for(let a of r){let o=/^delta-(\d+)\.json$/.exec(a);o&&e.push(Number(o[1]));let p=/^full-(\d+)\.json$/.exec(a);p&&s.push(Number(p[1]))}return e.sort((a,o)=>a-o),s.sort((a,o)=>a-o),{deltas:e,fulls:s}}function ke(t,n){try{return JSON.parse(te(ue(t,n),"utf8")).checkpoint??null}catch{return null}}function se(t,n,e){let s=[],r,a=0;if(e.full_seq!==null){let i=M(t,n,w(e.full_seq));s.push(i),r=i.agent.base_fingerprint,a=e.full_seq}let o;for(let i=a+1;i<=e.seq;i++)try{let d=M(t,n,y(i));s.push(d),!r&&d.agent.base_fingerprint&&(r=d.agent.base_fingerprint)}catch(d){if(d instanceof A&&d.code==="CHECKPOINT_CORRUPT"){o={resumableAt:i-1,turnsLost:e.seq-(i-1)};break}throw d}if(s.length===0)throw new A("CHECKPOINT_CORRUPT",`${n}: pointer names seq ${e.seq} but no chain records exist`);return{items:s.flatMap(i=>i.agent.delta_items),last:s[s.length-1],base_fingerprint:r,fallback:o}}function Re(t,n,e,s,r){let a=performance.now(),o=n.state.sid,p=n.state.checkpoint;if(p){if(e.seq<p.seq)throw new S(`seq regression: got ${e.seq}, pointer at ${p.seq} (${o})`);if(e.seq===p.seq){if(e.turn_id===p.turn_id&&e.at===p.at)return p;throw new S(`seq regression: seq ${e.seq} re-used with different metadata (turn ${e.turn_id}/${p.turn_id}, at ${e.at}/${p.at}) (${o})`)}}let i=E(t,o);ee(i,{recursive:!0});let d=(r?.now??(()=>new Date))(),b=d.toISOString(),u={schema:N,kind:"delta",sid:o,seq:e.seq,turn_id:e.turn_id,at:e.at,ts:b,agent:{agent_state_schema:e.agent_state_schema,delta_items:e.delta_items,binding:e.binding,usage_total:e.usage_total,...e.base_fingerprint!==void 0?{base_fingerprint:e.base_fingerprint}:{}},kane:s},m=Math.max(1,r?.retries??le),g=JSON.stringify(u)+`
4
+ `,O=!1;Buffer.byteLength(g)>524288&&!W.has(o)&&(W.add(o),O=!0,r?.onSoftCap?.("note: this session's checkpoints are getting large \u2014 long pasted inputs are kept verbatim; consider ingesting big documents as sources instead"));let R=!1,v;for(let c=0;c<m&&!R;c++)try{F(k(i,y(e.seq)),g,i),R=!0}catch(l){v=l}if(!R)throw new S(`delta-${e.seq} write failed after ${m} attempts: ${v?.message??"unknown"} (${o})`);let h=p?.full_seq??null,$=J(i)>67108864;if(e.seq%25===0||$){let c=[],l=e.base_fingerprint;if(p){let C=se(t,o,p);c=C.items,l=l??C.base_fingerprint}if(c=[...c,...e.delta_items],!l)throw new S(`compaction at seq ${e.seq}: no base_fingerprint anywhere in the chain (${o})`);let f={...u,kind:"full",agent:{...u.agent,delta_items:c,base_fingerprint:l}};F(k(i,w(e.seq)),JSON.stringify(f)+`
5
+ `,i),h=e.seq}let q={seq:e.seq,turn_id:e.turn_id,at:e.at,ts:b,full_seq:h};if(n.save({checkpoint:q}),h===e.seq){let{deltas:c,fulls:l}=re(t,o);for(let f of c)f<=h&&K(k(i,y(f)),{force:!0});for(let f of l)f<h&&K(k(i,w(f)),{force:!0})}let T=J(i);if($&&T>67108864)throw z(o,q,d),new j(`session ${o} checkpoint dir is ${Math.round(T/(1024*1024))}MB (cap ${Math.round(67108864/(1024*1024))}MB) even after compaction \u2014 pausing; resume in a fresh session or trim the conversation`);return z(o,q,d),r?.onStat?.({sid:o,seq:e.seq,persist_ms:performance.now()-a,bytes:Buffer.byteLength(g),dir_bytes:T,compacted:h===e.seq,soft_warned:O}),q}function Pe(t,n,e){let s=e?._readPointer??(()=>ke(t,n)),r=k(E(t,n),P);if(!Z(r))throw new A("CHECKPOINT_MISSING",`${n}: no ${P} \u2014 not a checkpoint session`);let a=M(t,n,P),o=i=>{let{deltas:d,fulls:b}=re(t,n);if(!i){let g=[...d.map(y),...b.map(w)];return{base:a,agent:null,kane:null,pointer:null,orphans:g}}let u=se(t,n,i),m=[...d.filter(g=>g>i.seq).map(y),...b.filter(g=>g>i.seq).map(w)];return{base:a,agent:{delta_items:u.items,binding:u.last.agent.binding,base_fingerprint:u.base_fingerprint,agent_state_schema:u.last.agent.agent_state_schema},kane:u.last.kane,pointer:i,orphans:m,...u.fallback?{fallback:u.fallback}:{}}},p=s();try{return o(p)}catch(i){if(!(i.code==="ENOENT"))throw i;return o(s())}}function Ee(t,n){let e=[];for(let s of I(t).records)if(s.sid===n)for(let r of s.event_ids??[])e.push(r);return e}function ve(t,n,e,s,r){let a=r.verb??"extract",o=I(t),p=0;if(e.store_watermark!==null){let c=o.hashes.indexOf(e.store_watermark);if(c===-1)throw new V(`watermark not in chain: ${e.store_watermark} names no record in this store (rebuilt or foreign?) \u2014 re-ground the session or abandon it`);p=c+1}let i=L(t,{seq:p,hash:e.store_watermark}).records,d=o.records.filter(c=>c.sid===n).map(c=>c.seq),b=c=>d.filter(l=>l<=c.seq).length,u=new Set(e.applied_events),m=0,g=[];for(let c of i){if(typeof c.sid!="string"){m+=1;continue}if(c.sid===n){if((c.event_ids??[]).length===0){m+=1;continue}g.push(c)}}m>0&&r.onNote?.(`reconcile: skipped ${m} store record(s) not attributable to this session (pre-sid grace)`);let O=r.ownActors??["extract-agent","design-agent","owner"],R=[],v=[];for(let c of g){let l=(c.event_ids??[]).filter(ie=>!u.has(ie));if(l.length===0)continue;v.push(...l);let f;try{f=r.composeReceipt(c,s,{verb:a,commitN:b(c),...r.ucRef?{ucRef:r.ucRef}:{},...r.typedBlockers?{typedBlockers:!0}:{},...r.ignoreGaps?.size?{ignoreGaps:r.ignoreGaps}:{}}).text}catch{f=`commit ${l[0]} at ${c.ts} \u2014 details unavailable (graph moved since)`}let C=c.review?.[0]?.by;C?.id&&!O.includes(C.id)&&(f+=`
6
+ (committed by ${C.kind}:${C.id} while this session was suspended)`),R.push(f)}let h=e.pending.proposals??[],$=h.filter(c=>typeof c.event_id=="string"&&s.appliedEvents.has(c.event_id)),T=h.filter(c=>!(typeof c.event_id=="string"&&s.appliedEvents.has(c.event_id))).filter(c=>c.state==="accepted-pending-commit");return{redeliverReceipts:R,recommit:T,prunedPending:$,newlyApplied:v,skippedNoSid:m}}function qe(t,n,e){let s=E(t,n);for(let r of e)/^(?:delta|full)-\d+\.json$/.test(r)&&K(k(s,r),{force:!0})}export{N as a,B as b,P as c,Se as d,Ae as e,Re as f,Pe as g,Ee as h,ve as i,qe as j};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{g as o,h as a}from"./chunk-EDQZIEPJ.js";import{mkdirSync as p,writeFileSync as f,chmodSync as d,existsSync as m}from"fs";var y={darwin:"https://downloads.lambdatest.com/hyperexecute/darwin/hyperexecute",linux:"https://downloads.lambdatest.com/hyperexecute/linux/hyperexecute",win32:"https://downloads.lambdatest.com/hyperexecute/windows/hyperexecute.exe"};function h(s){let t=y[s];if(!t)throw new Error(`unsupported platform for hyperexecute: ${s}`);return t}async function g(s,t={}){let i=t.platform??process.platform,u=t.existsImpl??m,c=t.fetchImpl??(r=>fetch(r)),e=a(s);if(u(e))return{status:"present",path:e};try{let r=h(i),n=await c(r);if(!n.ok)return{status:"failed",path:e,error:`download failed: HTTP ${n.status}`};let l=Buffer.from(await n.arrayBuffer());return p(o(s),{recursive:!0}),f(e,l),d(e,493),{status:"downloaded",path:e}}catch(r){return{status:"failed",path:e,error:r instanceof Error?r.message:String(r)}}}export{h as a,g as b};
2
+ import{g as o,h as a}from"./chunk-KWANVHJX.js";import{mkdirSync as p,writeFileSync as f,chmodSync as d,existsSync as m}from"fs";var y={darwin:"https://downloads.lambdatest.com/hyperexecute/darwin/hyperexecute",linux:"https://downloads.lambdatest.com/hyperexecute/linux/hyperexecute",win32:"https://downloads.lambdatest.com/hyperexecute/windows/hyperexecute.exe"};function h(s){let t=y[s];if(!t)throw new Error(`unsupported platform for hyperexecute: ${s}`);return t}async function g(s,t={}){let i=t.platform??process.platform,u=t.existsImpl??m,c=t.fetchImpl??(r=>fetch(r)),e=a(s);if(u(e))return{status:"present",path:e};try{let r=h(i),n=await c(r);if(!n.ok)return{status:"failed",path:e,error:`download failed: HTTP ${n.status}`};let l=Buffer.from(await n.arrayBuffer());return p(o(s),{recursive:!0}),f(e,l),d(e,493),{status:"downloaded",path:e}}catch(r){return{status:"failed",path:e,error:r instanceof Error?r.message:String(r)}}}export{h as a,g as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{y as n}from"./chunk-HYTBEPC2.js";import{a as s}from"./chunk-HCBYKLMW.js";import{a,b as i}from"./chunk-C44QQJR4.js";import{e as r}from"./chunk-UR6MHSHU.js";var o=r(s(),1);function g({bindings:c,suppressEscBack:p=!1,escBackLabel:m="back to chat"}){let e=c.map(t=>`${t.keys} ${t.label}`);return p||e.push(`esc \xB7 ${m}`),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(i,{color:n.dim,children:e.join(" \xB7 ")})})}export{g as a};
2
+ import{y as n}from"./chunk-PHR2OSWD.js";import{a as s}from"./chunk-HCBYKLMW.js";import{a,b as i}from"./chunk-C44QQJR4.js";import{e as r}from"./chunk-UR6MHSHU.js";var o=r(s(),1);function g({bindings:c,suppressEscBack:p=!1,escBackLabel:m="back to chat"}){let e=c.map(t=>`${t.keys} ${t.label}`);return p||e.push(`esc \xB7 ${m}`),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(i,{color:n.dim,children:e.join(" \xB7 ")})})}export{g as a};
@@ -1,10 +1,10 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as j,b as H}from"./chunk-KALEPJAV.js";import{a as B,b as N}from"./chunk-7X4R6464.js";import{a as se,b as ie,c as ae}from"./chunk-PDXZROJM.js";import{d as ce}from"./chunk-R7QMZBBH.js";import{a as $,b as q,e as M,g as oe}from"./chunk-JQCOKL6U.js";import{a as re,b as ne}from"./chunk-CAOZKSQ3.js";import{a as L}from"./chunk-MLYNVJNH.js";import{a as te}from"./chunk-TVELOH5A.js";import{a as X}from"./chunk-EPE2ELDH.js";import{a as ee}from"./chunk-DHJSM5DT.js";import{a as A}from"./chunk-RZ4F3BHX.js";import{a as O}from"./chunk-NWNG5UWD.js";import{y}from"./chunk-HYTBEPC2.js";import{a as F}from"./chunk-HCBYKLMW.js";import{a as k,b as p,i as Z}from"./chunk-C44QQJR4.js";import{a as K}from"./chunk-6YGTRKDT.js";import{e as v}from"./chunk-UR6MHSHU.js";var D=v(K(),1);import{existsSync as P,readFileSync as He,rmSync as ye,unlinkSync as Ve}from"fs";import{resolve as Q}from"path";import{promises as le,realpathSync as Ee}from"fs";import{homedir as Se}from"os";import{join as V,parse as ve,relative as ue,resolve as de}from"path";var fe=new Set(["node_modules",".git","dist","build",".next",".venv","venv","target","__pycache__"]),R=class extends Error{constructor(s){super(`refusing to scan '${s}'. Run from your project root, or pass --root <dir>.`);this.cwd=s;this.name="HomeRefusedError"}};function me(e){try{return Ee(de(e))}catch{return de(e)}}function Re(e){let r=me(e),s=me(Se()),n=ve(r).root;if(process.platform==="win32"){let o=t=>t.toLowerCase();return o(r)===o(s)||o(r)===o(n)}return r===s||r===n}async function U(e){if(Re(e.root))throw new R(e.root);let r=e.maxEntries??5e4,s=e.maxResults??5e3,n=new Set(e.ignore??[]),o=[],t=0,i=0,a=!1,u,c=[e.root];for(;c.length>0&&!a;){let l=c.shift(),g;try{g=await le.readdir(l,{withFileTypes:!0})}catch{continue}i++;for(let _ of g){if(t++,t>r){a=!0,u="max_entries";break}let m=_.name,T=V(l,m);if(_.isDirectory()){if(fe.has(m)||m.startsWith(".")||m.startsWith("output-")||n.has(m))continue;c.push(T)}else if(_.isFile()&&m.endsWith("_test.md")&&(o.push({path:T,relPath:ue(e.root,T),source:"cwd"}),o.length>=s)){a=!0,u="max_results";break}}e.onProgress?.(i,o.length)}if(!a){let g=[{dir:V(e.root,".testmuai","tests"),depth:0}];for(;g.length>0&&!a;){let{dir:_,depth:m}=g.shift(),T;try{T=await le.readdir(_,{withFileTypes:!0})}catch{continue}i++;for(let d of T){if(t++,t>r){a=!0,u="max_entries";break}let b=d.name,w=V(_,b);if(d.isDirectory()){if(m>=20||b.startsWith(".")||b.startsWith("output-")||fe.has(b))continue;g.push({dir:w,depth:m+1})}else if(d.isFile()&&b.endsWith("_test.md")&&(o.push({path:w,relPath:ue(e.root,w),source:"tests-dir"}),o.length>=s)){a=!0,u="max_results";break}}}}return{results:o,aborted:a,abortReason:u,dirsScanned:i}}import{readFileSync as Pe}from"fs";function Y(e){let r;try{r=Pe(e,"utf8")}catch{return{tags:[]}}try{let{global:s}=re(e,r),n=ne(s);return{tags:s.tags??[],...n?{mobileTarget:n}:{}}}catch{return{tags:[],...De(r)?{mobileTarget:Me}:{}}}}var Me={platform:"",app:""};function De(e){let r=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);if(!r)return!1;let s=r[1].split(/\r?\n/);if(s.some(o=>/^target:\s*['"]?(emulator|simulator)['"]?\s*$/.test(o)))return!0;let n=s.findIndex(o=>/^target:\s*$/.test(o));return n<0?!1:s.slice(n+1).some(o=>/^\s+\S/.test(o))}function W(e){return Y(e).tags}import{mkdirSync as Ce,writeFileSync as $e}from"fs";import{join as Ie}from"path";function ge(e,r){return`Basic ${Buffer.from(`${e}:${r}`).toString("base64")}`}async function Fe(e){let r=ie({tmsBaseUrl:e.tmsBaseUrl,testcaseId:e.testcaseId,codeExport:{enabled:!0,language:e.language,skipValidation:e.skipValidation},mobile:e.framework==="appium"}),s=await A(r.url,{method:"POST",headers:{"content-type":"application/json",authorization:ge(e.auth.username,e.auth.access_key)},body:JSON.stringify(r.body)});if(!s.ok)throw new Error(`code-export trigger failed: ${s.status} ${await s.text()}`);e.log("info","CODE_EXPORT_TRIGGERED","Code export triggered",{testcase_id:e.testcaseId})}async function Oe(e){let r=ae({tmsBaseUrl:e.tmsBaseUrl,testcaseId:e.testcaseId}),s=e.pollIntervalMs??5e3,n=e.timeoutMs??3e5,o=Date.now()+n;for(;Date.now()<o;){let t=await A(r,{headers:{authorization:ge(e.auth.username,e.auth.access_key),accept:"application/json"}});if(!t.ok){await new Promise(c=>setTimeout(c,s));continue}let a=(await t.json()).data?.find(c=>c.code_name==="kane-cli-trigger");if(!a){await new Promise(c=>setTimeout(c,s));continue}let u=(a.status??"").toLowerCase();if(u==="in progress"||u==="in_progress"||u==="pending"){await new Promise(c=>setTimeout(c,s));continue}if(!a.url||a.url.length===0)throw new Error(`code-export status=${a.status} but no files returned`);Ce(e.outDir,{recursive:!0});for(let c of a.url){let l=Ie(e.outDir,c.file_name),g=await A(c.file_url);if(!g.ok){e.log("warn","CODE_EXPORT_FILE_FAILED","Failed to download file",{file_name:c.file_name,status:g.status});continue}let _=await g.text();$e(l,_,"utf-8")}return e.log("info","CODE_EXPORT_DOWNLOADED","Code export saved",{out_dir:e.outDir,file_count:a.url.length}),e.outDir}throw new Error("code-export polling timed out")}async function pe(e){return await Fe(e),await Oe(e)}var E=v(K(),1);import{existsSync as Ae,readFileSync as Le}from"fs";var h=v(F(),1);function je(e){j(e);let r=M(e);if(!Ae(r))return null;try{return JSON.parse(Le(r,"utf8"))}catch{return{}}}function Be(e){return e===null?"never_run":e.testcase_id?"synced":"local_only"}function Ne(e){return e==="synced"?"\u2601":e==="local_only"?"\u25A3":"\u25CB"}function Ue(e){return e==="tests-dir"?"\u2726":" "}function We(e,r){return r==="all"?!0:r==="synced"?e.status==="synced":r==="local"?e.status==="local_only":r==="never_run"?e.status==="never_run":r==="cli"?e.source==="tests-dir":r==="hand"?e.source==="cwd":!0}var z=["all","synced","local","never_run","cli","hand"];function Je(e){let r=z.indexOf(e);return z[(r+1)%z.length]}function he({root:e,currentOrgId:r,onSelect:s,onCancel:n}){let[o,t]=(0,E.useState)([]),[i,a]=(0,E.useState)(null),[u,c]=(0,E.useState)(!0),[l,g]=(0,E.useState)("all");(0,E.useEffect)(()=>{(async()=>{try{let d=await U({root:e}),b=[];for(let w of d.results){let G=je(w.path);G?.org_id!==void 0&&G.org_id!==r||b.push({path:w.path,relPath:w.relPath,name:$(w.path),status:Be(G),source:w.source,tags:W(w.path)})}t(b),c(!1)}catch(d){d instanceof R,a(d.message),c(!1)}})()},[e,r]);let _=(0,E.useMemo)(()=>o.filter(d=>We(d,l)).map(d=>({id:d.path,label:`${Ne(d.status)} ${Ue(d.source)} ${d.relPath}${d.tags.length>0?` [${d.tags.join(", ")}]`:""}`})),[o,l]),m=(0,E.useMemo)(()=>Ke(l,o),[l,o]);if(i)return(0,h.jsxs)(k,{flexDirection:"column",borderStyle:"round",borderColor:y.red,paddingX:2,paddingY:1,children:[(0,h.jsx)(p,{color:y.red,bold:!0,children:"testmd"}),(0,h.jsx)(k,{marginTop:1,children:(0,h.jsx)(p,{color:y.red,children:i})})]});let T=l==="all"?"all":Ge(l);return(0,h.jsx)(te,{title:`testmd \xB7 filter: ${T}`,items:_,loading:u,itemNoun:"tests",onSelect:d=>{let b=o.find(w=>w.path===d.id);b&&s(b)},onCancel:n,onTab:()=>g(d=>Je(d)),extraHint:"cycle filter",footer:m})}function Ge(e){return e==="synced"?"synced (\u2601)":e==="local"?"local (\u25A3)":e==="never_run"?"never run (\u25CB)":e==="cli"?"cli-generated (\u2726)":e==="hand"?"hand-written":"all"}function Ke(e,r){let s={synced:r.filter(o=>o.status==="synced").length,local:r.filter(o=>o.status==="local_only").length,never:r.filter(o=>o.status==="never_run").length,cli:r.filter(o=>o.source==="tests-dir").length,hand:r.filter(o=>o.source==="cwd").length},n=o=>o?y.orange:y.dim;return(0,h.jsxs)(k,{flexDirection:"column",children:[(0,h.jsx)(p,{color:y.dim,children:"legend:"}),(0,h.jsxs)(k,{children:[(0,h.jsx)(p,{color:n(e==="synced"),children:` \u2601 synced (${s.synced}) `}),(0,h.jsx)(p,{color:n(e==="local"),children:`\u25A3 local (${s.local}) `}),(0,h.jsx)(p,{color:n(e==="never_run"),children:`\u25CB never run (${s.never})`})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(p,{color:n(e==="cli"),children:` \u2726 cli-generated (${s.cli}) `}),(0,h.jsx)(p,{color:n(e==="hand"),children:` hand-written (${s.hand})`})]})]})}var I=v(K(),1);import{existsSync as Xe,readFileSync as qe}from"fs";var f=v(F(),1);function _e({path:e,relPath:r,onAction:s,onBack:n,onView:o}){let[t,i]=(0,I.useState)(null),[a,u]=(0,I.useState)(!1);(0,I.useEffect)(()=>{let l=M(e);if(Xe(l))try{i(JSON.parse(qe(l,"utf8")))}catch{i(null)}},[e]),Z((l,g)=>{if(g.escape){if(a){u(!1);return}n();return}if(a){l==="y"||l==="Y"?(u(!1),s("delete")):(l==="n"||l==="N")&&u(!1);return}l==="r"&&s("run"),l==="e"&&t?.testcase_id&&s("export"),l==="d"&&u(!0),l==="v"&&o&&o()});let c=({k:l,v:g})=>g?(0,f.jsxs)(p,{children:[(0,f.jsx)(p,{color:y.dim,children:l.padEnd(14)}),g]}):null;return(0,f.jsxs)(k,{flexDirection:"column",borderStyle:"round",borderColor:y.orange,paddingX:2,paddingY:1,children:[(0,f.jsx)(p,{color:y.orange,bold:!0,children:r}),(0,f.jsx)(k,{marginTop:1,flexDirection:"column",children:t?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(c,{k:"test_id",v:t.test_id}),(0,f.jsx)(c,{k:"testcase_id",v:t.testcase_id}),(0,f.jsx)(c,{k:"project_id",v:t.project_id}),(0,f.jsx)(c,{k:"folder_id",v:t.folder_id}),(0,f.jsx)(c,{k:"org_id",v:t.org_id}),(0,f.jsx)(c,{k:"session_name",v:t.session_name}),(0,f.jsx)(c,{k:"commit_id",v:t.commit_id})]}):(0,f.jsx)(p,{color:y.dim,children:"(never run \u2014 no meta.json)"})}),a?(0,f.jsx)(k,{marginTop:1,children:(0,f.jsxs)(p,{color:y.red,bold:!0,children:["Delete ",r," and its output dir? [y/n]"]})}):(0,f.jsx)(k,{marginTop:1,children:(0,f.jsxs)(p,{color:y.dim,children:["[r] run [e] export",t?.testcase_id?"":" (need testcase_id)"," [d] delete",o?" [v] view":""," [Esc] back"]})})]})}function C(e){j(e);let r=M(e);if(!P(r))return null;try{return JSON.parse(He(r,"utf8"))}catch{return null}}function xe(e,r){return!e||e.org_id===void 0?!0:e.org_id===r}function J(e,r){return xe(e,r)?null:(process.stderr.write(`error: this test belongs to org ${e.org_id}; you are logged in as org ${r}.
2
+ import{a as j,b as H}from"./chunk-5ZU7S4E7.js";import{a as B,b as N}from"./chunk-IZ3PYWUL.js";import{a as se,b as ie,c as ae}from"./chunk-PDXZROJM.js";import{d as ce}from"./chunk-JWPBLVPW.js";import{a as $,b as q,e as M,g as oe}from"./chunk-L45HDSJ7.js";import{a as re,b as ne}from"./chunk-CAOZKSQ3.js";import{a as L}from"./chunk-5HDM7GDO.js";import{a as te}from"./chunk-IKB2JKMA.js";import{a as X}from"./chunk-VIYV6NIW.js";import{a as ee}from"./chunk-DHJSM5DT.js";import{a as A}from"./chunk-RZ4F3BHX.js";import{a as O}from"./chunk-JWOPRJIO.js";import{y}from"./chunk-PHR2OSWD.js";import{a as F}from"./chunk-HCBYKLMW.js";import{a as k,b as p,i as Z}from"./chunk-C44QQJR4.js";import{a as K}from"./chunk-6YGTRKDT.js";import{e as v}from"./chunk-UR6MHSHU.js";var D=v(K(),1);import{existsSync as P,readFileSync as He,rmSync as ye,unlinkSync as Ve}from"fs";import{resolve as Q}from"path";import{promises as le,realpathSync as Ee}from"fs";import{homedir as Se}from"os";import{join as V,parse as ve,relative as ue,resolve as de}from"path";var fe=new Set(["node_modules",".git","dist","build",".next",".venv","venv","target","__pycache__"]),R=class extends Error{constructor(s){super(`refusing to scan '${s}'. Run from your project root, or pass --root <dir>.`);this.cwd=s;this.name="HomeRefusedError"}};function me(e){try{return Ee(de(e))}catch{return de(e)}}function Re(e){let r=me(e),s=me(Se()),n=ve(r).root;if(process.platform==="win32"){let o=t=>t.toLowerCase();return o(r)===o(s)||o(r)===o(n)}return r===s||r===n}async function U(e){if(Re(e.root))throw new R(e.root);let r=e.maxEntries??5e4,s=e.maxResults??5e3,n=new Set(e.ignore??[]),o=[],t=0,i=0,a=!1,u,c=[e.root];for(;c.length>0&&!a;){let l=c.shift(),g;try{g=await le.readdir(l,{withFileTypes:!0})}catch{continue}i++;for(let _ of g){if(t++,t>r){a=!0,u="max_entries";break}let m=_.name,T=V(l,m);if(_.isDirectory()){if(fe.has(m)||m.startsWith(".")||m.startsWith("output-")||n.has(m))continue;c.push(T)}else if(_.isFile()&&m.endsWith("_test.md")&&(o.push({path:T,relPath:ue(e.root,T),source:"cwd"}),o.length>=s)){a=!0,u="max_results";break}}e.onProgress?.(i,o.length)}if(!a){let g=[{dir:V(e.root,".testmuai","tests"),depth:0}];for(;g.length>0&&!a;){let{dir:_,depth:m}=g.shift(),T;try{T=await le.readdir(_,{withFileTypes:!0})}catch{continue}i++;for(let d of T){if(t++,t>r){a=!0,u="max_entries";break}let b=d.name,w=V(_,b);if(d.isDirectory()){if(m>=20||b.startsWith(".")||b.startsWith("output-")||fe.has(b))continue;g.push({dir:w,depth:m+1})}else if(d.isFile()&&b.endsWith("_test.md")&&(o.push({path:w,relPath:ue(e.root,w),source:"tests-dir"}),o.length>=s)){a=!0,u="max_results";break}}}}return{results:o,aborted:a,abortReason:u,dirsScanned:i}}import{readFileSync as Pe}from"fs";function Y(e){let r;try{r=Pe(e,"utf8")}catch{return{tags:[]}}try{let{global:s}=re(e,r),n=ne(s);return{tags:s.tags??[],...n?{mobileTarget:n}:{}}}catch{return{tags:[],...De(r)?{mobileTarget:Me}:{}}}}var Me={platform:"",app:""};function De(e){let r=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);if(!r)return!1;let s=r[1].split(/\r?\n/);if(s.some(o=>/^target:\s*['"]?(emulator|simulator)['"]?\s*$/.test(o)))return!0;let n=s.findIndex(o=>/^target:\s*$/.test(o));return n<0?!1:s.slice(n+1).some(o=>/^\s+\S/.test(o))}function W(e){return Y(e).tags}import{mkdirSync as Ce,writeFileSync as $e}from"fs";import{join as Ie}from"path";function ge(e,r){return`Basic ${Buffer.from(`${e}:${r}`).toString("base64")}`}async function Fe(e){let r=ie({tmsBaseUrl:e.tmsBaseUrl,testcaseId:e.testcaseId,codeExport:{enabled:!0,language:e.language,skipValidation:e.skipValidation},mobile:e.framework==="appium"}),s=await A(r.url,{method:"POST",headers:{"content-type":"application/json",authorization:ge(e.auth.username,e.auth.access_key)},body:JSON.stringify(r.body)});if(!s.ok)throw new Error(`code-export trigger failed: ${s.status} ${await s.text()}`);e.log("info","CODE_EXPORT_TRIGGERED","Code export triggered",{testcase_id:e.testcaseId})}async function Oe(e){let r=ae({tmsBaseUrl:e.tmsBaseUrl,testcaseId:e.testcaseId}),s=e.pollIntervalMs??5e3,n=e.timeoutMs??3e5,o=Date.now()+n;for(;Date.now()<o;){let t=await A(r,{headers:{authorization:ge(e.auth.username,e.auth.access_key),accept:"application/json"}});if(!t.ok){await new Promise(c=>setTimeout(c,s));continue}let a=(await t.json()).data?.find(c=>c.code_name==="kane-cli-trigger");if(!a){await new Promise(c=>setTimeout(c,s));continue}let u=(a.status??"").toLowerCase();if(u==="in progress"||u==="in_progress"||u==="pending"){await new Promise(c=>setTimeout(c,s));continue}if(!a.url||a.url.length===0)throw new Error(`code-export status=${a.status} but no files returned`);Ce(e.outDir,{recursive:!0});for(let c of a.url){let l=Ie(e.outDir,c.file_name),g=await A(c.file_url);if(!g.ok){e.log("warn","CODE_EXPORT_FILE_FAILED","Failed to download file",{file_name:c.file_name,status:g.status});continue}let _=await g.text();$e(l,_,"utf-8")}return e.log("info","CODE_EXPORT_DOWNLOADED","Code export saved",{out_dir:e.outDir,file_count:a.url.length}),e.outDir}throw new Error("code-export polling timed out")}async function pe(e){return await Fe(e),await Oe(e)}var E=v(K(),1);import{existsSync as Ae,readFileSync as Le}from"fs";var h=v(F(),1);function je(e){j(e);let r=M(e);if(!Ae(r))return null;try{return JSON.parse(Le(r,"utf8"))}catch{return{}}}function Be(e){return e===null?"never_run":e.testcase_id?"synced":"local_only"}function Ne(e){return e==="synced"?"\u2601":e==="local_only"?"\u25A3":"\u25CB"}function Ue(e){return e==="tests-dir"?"\u2726":" "}function We(e,r){return r==="all"?!0:r==="synced"?e.status==="synced":r==="local"?e.status==="local_only":r==="never_run"?e.status==="never_run":r==="cli"?e.source==="tests-dir":r==="hand"?e.source==="cwd":!0}var z=["all","synced","local","never_run","cli","hand"];function Je(e){let r=z.indexOf(e);return z[(r+1)%z.length]}function he({root:e,currentOrgId:r,onSelect:s,onCancel:n}){let[o,t]=(0,E.useState)([]),[i,a]=(0,E.useState)(null),[u,c]=(0,E.useState)(!0),[l,g]=(0,E.useState)("all");(0,E.useEffect)(()=>{(async()=>{try{let d=await U({root:e}),b=[];for(let w of d.results){let G=je(w.path);G?.org_id!==void 0&&G.org_id!==r||b.push({path:w.path,relPath:w.relPath,name:$(w.path),status:Be(G),source:w.source,tags:W(w.path)})}t(b),c(!1)}catch(d){d instanceof R,a(d.message),c(!1)}})()},[e,r]);let _=(0,E.useMemo)(()=>o.filter(d=>We(d,l)).map(d=>({id:d.path,label:`${Ne(d.status)} ${Ue(d.source)} ${d.relPath}${d.tags.length>0?` [${d.tags.join(", ")}]`:""}`})),[o,l]),m=(0,E.useMemo)(()=>Ke(l,o),[l,o]);if(i)return(0,h.jsxs)(k,{flexDirection:"column",borderStyle:"round",borderColor:y.red,paddingX:2,paddingY:1,children:[(0,h.jsx)(p,{color:y.red,bold:!0,children:"testmd"}),(0,h.jsx)(k,{marginTop:1,children:(0,h.jsx)(p,{color:y.red,children:i})})]});let T=l==="all"?"all":Ge(l);return(0,h.jsx)(te,{title:`testmd \xB7 filter: ${T}`,items:_,loading:u,itemNoun:"tests",onSelect:d=>{let b=o.find(w=>w.path===d.id);b&&s(b)},onCancel:n,onTab:()=>g(d=>Je(d)),extraHint:"cycle filter",footer:m})}function Ge(e){return e==="synced"?"synced (\u2601)":e==="local"?"local (\u25A3)":e==="never_run"?"never run (\u25CB)":e==="cli"?"cli-generated (\u2726)":e==="hand"?"hand-written":"all"}function Ke(e,r){let s={synced:r.filter(o=>o.status==="synced").length,local:r.filter(o=>o.status==="local_only").length,never:r.filter(o=>o.status==="never_run").length,cli:r.filter(o=>o.source==="tests-dir").length,hand:r.filter(o=>o.source==="cwd").length},n=o=>o?y.orange:y.dim;return(0,h.jsxs)(k,{flexDirection:"column",children:[(0,h.jsx)(p,{color:y.dim,children:"legend:"}),(0,h.jsxs)(k,{children:[(0,h.jsx)(p,{color:n(e==="synced"),children:` \u2601 synced (${s.synced}) `}),(0,h.jsx)(p,{color:n(e==="local"),children:`\u25A3 local (${s.local}) `}),(0,h.jsx)(p,{color:n(e==="never_run"),children:`\u25CB never run (${s.never})`})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(p,{color:n(e==="cli"),children:` \u2726 cli-generated (${s.cli}) `}),(0,h.jsx)(p,{color:n(e==="hand"),children:` hand-written (${s.hand})`})]})]})}var I=v(K(),1);import{existsSync as Xe,readFileSync as qe}from"fs";var f=v(F(),1);function _e({path:e,relPath:r,onAction:s,onBack:n,onView:o}){let[t,i]=(0,I.useState)(null),[a,u]=(0,I.useState)(!1);(0,I.useEffect)(()=>{let l=M(e);if(Xe(l))try{i(JSON.parse(qe(l,"utf8")))}catch{i(null)}},[e]),Z((l,g)=>{if(g.escape){if(a){u(!1);return}n();return}if(a){l==="y"||l==="Y"?(u(!1),s("delete")):(l==="n"||l==="N")&&u(!1);return}l==="r"&&s("run"),l==="e"&&t?.testcase_id&&s("export"),l==="d"&&u(!0),l==="v"&&o&&o()});let c=({k:l,v:g})=>g?(0,f.jsxs)(p,{children:[(0,f.jsx)(p,{color:y.dim,children:l.padEnd(14)}),g]}):null;return(0,f.jsxs)(k,{flexDirection:"column",borderStyle:"round",borderColor:y.orange,paddingX:2,paddingY:1,children:[(0,f.jsx)(p,{color:y.orange,bold:!0,children:r}),(0,f.jsx)(k,{marginTop:1,flexDirection:"column",children:t?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(c,{k:"test_id",v:t.test_id}),(0,f.jsx)(c,{k:"testcase_id",v:t.testcase_id}),(0,f.jsx)(c,{k:"project_id",v:t.project_id}),(0,f.jsx)(c,{k:"folder_id",v:t.folder_id}),(0,f.jsx)(c,{k:"org_id",v:t.org_id}),(0,f.jsx)(c,{k:"session_name",v:t.session_name}),(0,f.jsx)(c,{k:"commit_id",v:t.commit_id})]}):(0,f.jsx)(p,{color:y.dim,children:"(never run \u2014 no meta.json)"})}),a?(0,f.jsx)(k,{marginTop:1,children:(0,f.jsxs)(p,{color:y.red,bold:!0,children:["Delete ",r," and its output dir? [y/n]"]})}):(0,f.jsx)(k,{marginTop:1,children:(0,f.jsxs)(p,{color:y.dim,children:["[r] run [e] export",t?.testcase_id?"":" (need testcase_id)"," [d] delete",o?" [v] view":""," [Esc] back"]})})]})}function C(e){j(e);let r=M(e);if(!P(r))return null;try{return JSON.parse(He(r,"utf8"))}catch{return null}}function xe(e,r){return!e||e.org_id===void 0?!0:e.org_id===r}function J(e,r){return xe(e,r)?null:(process.stderr.write(`error: this test belongs to org ${e.org_id}; you are logged in as org ${r}.
3
3
  Switch profiles with \`kane-cli profiles switch\` to act on it.
4
4
  `),2)}async function Ht(e={}){let r=!!process.stdin.isTTY&&!e.json,s=new O,n=new L;await H({isInteractive:r,creds:s,config:n});let o=s.getDefaultEnv()??"prod";try{let t=await N({creds:s,env:o,log:()=>{}});return t.resolvedCreds?.org_id===void 0?(process.stderr.write("error: TMS did not return an org_id. Run `kane-cli login` again.\n"),{ok:!1,code:2}):{ok:!0,orgId:String(t.resolvedCreds.org_id)}}catch(t){if(t instanceof B)return process.stderr.write("error: not authenticated. Run `kane-cli login` first.\n"),{ok:!1,code:2};throw t}}async function Vt(e,r){if(process.stdin.isTTY&&!e.json)return await Qe(r,e.root);let s=e.root??process.cwd(),n;try{n=await U({root:s,ignore:e.ignore})}catch(o){if(o instanceof R)return process.stderr.write(`error: ${o.message}
5
5
  `),2;throw o}for(let o of n.results){let t=C(o.path);if(!xe(t,r))continue;let i={path:o.relPath.startsWith(".")?o.relPath:`./${o.relPath}`,name:$(o.path),has_meta:t!==null,source:o.source,synced:!!t?.testcase_id,tags:W(o.path)};t&&(t.test_id&&(i.test_id=t.test_id),t.testcase_id&&(i.testcase_id=t.testcase_id),t.org_id&&(i.org_id=t.org_id),t.project_id&&(i.project_id=t.project_id),t.folder_id&&(i.folder_id=t.folder_id)),process.stdout.write(JSON.stringify(i)+`
6
6
  `)}return n.aborted&&process.stderr.write(`warn: walk aborted (${n.abortReason}). Pass --root or --ignore to narrow.
7
- `),0}var we=-1001,be=-1002,ke=-1003,x={action:null,path:null};function Ye(e,r){return x.action=e,x.path=r,e==="run"?we:e==="export"?be:ke}function ze({root:e,currentOrgId:r,onComplete:s}){let[n,o]=D.default.useState({kind:"list"});return D.default.useEffect(()=>{n.kind==="exiting"&&s(n.code)},[n,s]),n.kind==="list"?D.default.createElement(he,{root:e,currentOrgId:r,onSelect:t=>o({kind:"inspect",path:t.path,relPath:t.relPath}),onCancel:()=>o({kind:"exiting",code:0})}):n.kind==="inspect"?D.default.createElement(_e,{path:n.path,relPath:n.relPath,onAction:async t=>{o({kind:"exiting",code:Ye(t,n.path)})},onBack:()=>o({kind:"list"})}):null}async function Qe(e,r){let s=r??process.cwd(),{render:n}=await import("./build-JIKYOZUH.js"),o=await new Promise(t=>{let{unmount:i,waitUntilExit:a}=n(D.default.createElement(ze,{root:s,currentOrgId:e,onComplete:u=>{i(),t(u)}}),{stdout:process.stderr,exitOnCtrlC:!0});a().then(()=>t(0)).catch(()=>t(0))});if(o===we&&x.path){let{runTestMdFile:t}=await import("./run-test-md-MRYNFNPO.js"),i=await t(x.path,{});return x.action=null,x.path=null,i}if(o===be&&x.path){let t=await et(x.path,{},e);return x.action=null,x.path=null,t}if(o===ke&&x.path){let t=await Ze(x.path,!0,e);return x.action=null,x.path=null,t}return o}async function Yt(e,r){let s=Q(e);if(!P(s))return process.stderr.write(`error: file not found: ${s}
7
+ `),0}var we=-1001,be=-1002,ke=-1003,x={action:null,path:null};function Ye(e,r){return x.action=e,x.path=r,e==="run"?we:e==="export"?be:ke}function ze({root:e,currentOrgId:r,onComplete:s}){let[n,o]=D.default.useState({kind:"list"});return D.default.useEffect(()=>{n.kind==="exiting"&&s(n.code)},[n,s]),n.kind==="list"?D.default.createElement(he,{root:e,currentOrgId:r,onSelect:t=>o({kind:"inspect",path:t.path,relPath:t.relPath}),onCancel:()=>o({kind:"exiting",code:0})}):n.kind==="inspect"?D.default.createElement(_e,{path:n.path,relPath:n.relPath,onAction:async t=>{o({kind:"exiting",code:Ye(t,n.path)})},onBack:()=>o({kind:"list"})}):null}async function Qe(e,r){let s=r??process.cwd(),{render:n}=await import("./build-JIKYOZUH.js"),o=await new Promise(t=>{let{unmount:i,waitUntilExit:a}=n(D.default.createElement(ze,{root:s,currentOrgId:e,onComplete:u=>{i(),t(u)}}),{stdout:process.stderr,exitOnCtrlC:!0});a().then(()=>t(0)).catch(()=>t(0))});if(o===we&&x.path){let{runTestMdFile:t}=await import("./run-test-md-N43FRXB6.js"),i=await t(x.path,{});return x.action=null,x.path=null,i}if(o===be&&x.path){let t=await et(x.path,{},e);return x.action=null,x.path=null,t}if(o===ke&&x.path){let t=await Ze(x.path,!0,e);return x.action=null,x.path=null,t}return o}async function Yt(e,r){let s=Q(e);if(!P(s))return process.stderr.write(`error: file not found: ${s}
8
8
  `),2;let n=C(s),o=J(n,r);if(o!==null)return o;let t={path:s,name:$(s),has_meta:n!==null};return n&&(n.commit_id&&(t.commit_id=n.commit_id),n.test_id&&(t.test_id=n.test_id),n.testcase_id&&(t.testcase_id=n.testcase_id),n.project_id&&(t.project_id=n.project_id),n.folder_id&&(t.folder_id=n.folder_id),n.org_id&&(t.org_id=n.org_id),n.session_name&&(t.session_name=n.session_name)),process.stdout.write(JSON.stringify(t)+`
9
9
  `),0}async function Ze(e,r,s){let n=Q(e);if(!P(n))return process.stderr.write(`error: file not found: ${n}
10
10
  `),2;let o=C(n),t=J(o,s);if(t!==null)return t;if(!r)return process.stderr.write(`error: refusing to delete without --yes.
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as k}from"./chunk-XXE7W5AV.js";import{y as u}from"./chunk-HYTBEPC2.js";import{a as f}from"./chunk-HCBYKLMW.js";import{a as m,b as s,k as b}from"./chunk-C44QQJR4.js";import{e as p}from"./chunk-UR6MHSHU.js";function B(t){let e=t;return e=e.replace(/@TS\{([^}]+)\}/g,"@S{$1}"),e=e.replace(/@TS-(\d+)/g,(o,i)=>`@S${parseInt(i,10)}.C1`),e=e.replace(/@TS(\d+)/g,(o,i)=>`@S${parseInt(i,10)}`),e=e.replace(/\\n/g,`
2
+ import{a as k}from"./chunk-5X7JIGG7.js";import{y as u}from"./chunk-PHR2OSWD.js";import{a as f}from"./chunk-HCBYKLMW.js";import{a as m,b as s,k as b}from"./chunk-C44QQJR4.js";import{e as p}from"./chunk-UR6MHSHU.js";function B(t){let e=t;return e=e.replace(/@TS\{([^}]+)\}/g,"@S{$1}"),e=e.replace(/@TS-(\d+)/g,(o,i)=>`@S${parseInt(i,10)}.C1`),e=e.replace(/@TS(\d+)/g,(o,i)=>`@S${parseInt(i,10)}`),e=e.replace(/\\n/g,`
3
3
  `),e}var c=p(f(),1),S=t=>t!==void 0&&/[A-Za-z0-9]/.test(t);function x(t){let e=[],o="",i=()=>{o&&(e.push({text:o}),o="")},d=(a,l,r)=>(a===0||!S(t[a-1]))&&(l+r>=t.length||!S(t[l+r])),n=0;for(;n<t.length;){let a=t.slice(n,n+2),l=t[n];if(a==="**"||a==="__"){let r=t.indexOf(a,n+2);if(r!==-1&&r>n+2&&(a==="**"||d(n,r,2))){i(),e.push({text:t.slice(n+2,r),bold:!0}),n=r+2;continue}}if(l==="`"){let r=t.indexOf("`",n+1);if(r!==-1&&r>n+1){i(),e.push({text:t.slice(n+1,r),code:!0}),n=r+1;continue}}if(l==="*"||l==="_"){let r=t.indexOf(l,n+1);if(r!==-1&&r>n+1&&(l==="*"||d(n,r,1))){i(),e.push({text:t.slice(n+1,r),italic:!0}),n=r+1;continue}}o+=l,n+=1}return i(),e.length===0&&e.push({text:""}),e}function h(t){return t.map((e,o)=>(0,c.jsx)(s,{bold:e.bold,italic:e.italic,color:e.code?u.dim:void 0,children:e.text},o))}function T(t){return t.split(`
4
4
  `).map(e=>{if(e.trim()==="")return{kind:"blank"};let o=e.match(/^\s*[-*+]\s+(.*)$/);if(o)return{kind:"bullet",segs:x(o[1])};let i=e.match(/^\s*(\d+)\.\s+(.*)$/);if(i)return{kind:"numbered",n:i[1],segs:x(i[2])};let d=e.match(/^#{1,6}\s+(.*)$/);return d?{kind:"heading",segs:x(d[1])}:{kind:"para",segs:x(e)}})}function R(t,e,o=""){switch(t.kind){case"blank":return(0,c.jsx)(s,{children:o||" "},e);case"heading":return(0,c.jsxs)(s,{bold:!0,children:[o,h(t.segs)]},e);case"bullet":return(0,c.jsx)(m,{marginLeft:1,children:(0,c.jsxs)(s,{children:[o,"\u2022 ",h(t.segs)]})},e);case"numbered":return(0,c.jsx)(m,{marginLeft:1,children:(0,c.jsxs)(s,{children:[o,`${t.n}. `,h(t.segs)]})},e);default:return(0,c.jsxs)(s,{children:[o,h(t.segs)]},e)}}function $({text:t,accent:e=u.generateAccent}){let o=T(B(t)),{stdout:i}=b(),d=i?.columns??80;return(0,c.jsxs)(m,{marginBottom:1,children:[(0,c.jsx)(m,{width:2,flexShrink:0,children:(0,c.jsx)(s,{color:e,children:"\u2503"})}),(0,c.jsx)(m,{flexDirection:"column",width:d-2,children:o.map((n,a)=>R(n,a))})]})}var g=p(f(),1),I=5;function C({thinking:t,expanded:e,thinkingDone:o,maxLines:i=I}){if(!e)return(0,g.jsxs)(m,{paddingX:1,children:[(0,g.jsx)(s,{color:u.dim,children:o?"\u2237 thinking complete ":"\u2237 thinking\u2026 "}),(0,g.jsx)(s,{color:u.muted,children:o?"(ctrl+t to view)":"(ctrl+t to show)"})]});let d=t.split(`
5
5
  `),n=Math.max(0,d.length-i),a=n>0?d.slice(-i).join(`
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as k}from"./chunk-ALCE5RLK.js";import{b as w}from"./chunk-GP7WD4UY.js";import{d as E,e as h}from"./chunk-AKX4VRRR.js";var g=(e,t,r=new Set)=>{let s=e.nameOf.get(t);if(s!==void 0)return s;if(r.has(t))return t;r.add(t);for(let[o,n]of e.superseded){if(n!==t)continue;let d=g(e,o,r);if(d!==o)return d}return t};function b(e,t){let r=e.stale(t);if(r==="fresh")return;if(r==="orphaned")return"orphaned \u2014 no live source evidences this item";let s=[],o=new Map;for(let n of e.derivesInto(t))o.set(String(n.props.source_id),n);for(let[n,d]of o){let i=e.heads.get(n);if(i==null||i===d.props.source_cid)continue;let a=e.convChains.get(n)?.chain;a&&a.includes(String(d.props.source_cid))||s.push(`DERIVES pin ${n}@${String(d.props.source_cid).slice(0,19)} broke \u2014 the source head moved`)}for(let n of e.edgesFrom(t)){if(n.type===h.DERIVES||!e.superseded.has(n.dst))continue;let d=e.tipOf(n.dst);if(e.superseded.has(d)){s.push(`${n.type} pin \u2192 ${g(e,n.dst)} \u2014 target retired`);continue}let i=C(e,n.dst,d);s.push(i.length>0?`${g(e,n.dst)} updated: ${i.map(a=>a.field).join(", ")}`:`${n.type} pin \u2192 ${g(e,n.dst)} \u2014 target superseded`)}return s.length>0?s.join("; "):"stale \u2014 a pinned dependency moved"}function C(e,t,r){let s=e.getNode(t)?.content??{},o=e.getNode(r)?.content??{},n=i=>i===void 0?"":Array.isArray(i)?i.map(String).join(" \xB7 "):typeof i=="object"?JSON.stringify(i):String(i),d=[];for(let i of[...new Set([...Object.keys(s),...Object.keys(o)])].sort())JSON.stringify(s[i])!==JSON.stringify(o[i])&&d.push({field:i,old:n(s[i]),new:n(o[i])});return d}function P(e,t){let r=[];for(let{cid:s}of e.byLabel(E.SCENARIO))e.superseded.has(s)||e.edgesFrom(s).some(o=>o.type===h.BELONGS_TO&&e.tipOf(o.dst)===t)&&r.push(s);return r}function O(e,t){let r=[],s=[],o=[],n=[],d=[],i=[],a=P(e,t),y=new Set(a),l=(c,f)=>{let u=b(e,f);return u===void 0?c:{...c,stale:!0,stale_reason:u}};for(let c of a){let f=e.getNode(c)?.content??{};r.push(l({ref:g(e,c),title:String(f.title??""),case_type:String(f.case_type??""),intent:String(f.intent??"")},c));for(let u of e.edgesInto(c)){if(u.type!==h.AUTOMATES||e.superseded.has(u.src))continue;let p=e.getNode(u.src)?.content??{},S=e.edgesFrom(u.src).filter(x=>x.type===h.VERIFIES&&!e.superseded.has(x.dst)).map(x=>g(e,x.dst));s.push(l({ref:g(e,u.src),title:String(p.title??""),automates:g(e,c),check:p.check,verifies:S,...typeof p.target=="string"?{target:p.target}:{},...typeof p.app=="string"?{app:p.app}:{}},u.src)),d.push(u.src)}for(let u of e.edgesFrom(c))u.type!==h.EXERCISES||e.superseded.has(u.dst)||n.push({scenario:g(e,c),ac:g(e,u.dst)})}for(let{cid:c}of e.byLabel(E.AC)){if(e.superseded.has(c))continue;let f=e.edgesFrom(c).find(x=>x.type===h.SCOPED_TO);if(!f)continue;let u=e.tipOf(f.dst);if(!(u===t||y.has(u)))continue;let S=e.getNode(c)?.content??{};o.push(l({ref:g(e,c),text:String(S.text??""),kind:String(S.kind??""),scope:u===t?"use-case":g(e,u)},c)),i.push(c)}let _=[],m=new Set;for(let c of[t,...a,...d,...i])for(let f of e.retractedEdgesTouching(c))m.has(f.ecid)||(m.add(f.ecid),_.push({type:f.type,src:g(e,f.src),dst:g(e,f.dst),at:f.retraction.at,...f.retraction.reason?{reason:f.retraction.reason}:{}}));return{scenarios:r,tests:s,acs:o,exercises:n,retracted_edges:_}}function D(e,t,r){let s=k(e,t,r);return s===null?null:s.toString("utf8")}function v(e,t){let r=t.split(`
2
+ import{a as k}from"./chunk-KDNNMU7Q.js";import{b as w}from"./chunk-3UI5VTQS.js";import{f as E,g as h}from"./chunk-XLSOQLVT.js";var g=(e,t,r=new Set)=>{let s=e.nameOf.get(t);if(s!==void 0)return s;if(r.has(t))return t;r.add(t);for(let[o,n]of e.superseded){if(n!==t)continue;let d=g(e,o,r);if(d!==o)return d}return t};function b(e,t){let r=e.stale(t);if(r==="fresh")return;if(r==="orphaned")return"orphaned \u2014 no live source evidences this item";let s=[],o=new Map;for(let n of e.derivesInto(t))o.set(String(n.props.source_id),n);for(let[n,d]of o){let i=e.heads.get(n);if(i==null||i===d.props.source_cid)continue;let a=e.convChains.get(n)?.chain;a&&a.includes(String(d.props.source_cid))||s.push(`DERIVES pin ${n}@${String(d.props.source_cid).slice(0,19)} broke \u2014 the source head moved`)}for(let n of e.edgesFrom(t)){if(n.type===h.DERIVES||!e.superseded.has(n.dst))continue;let d=e.tipOf(n.dst);if(e.superseded.has(d)){s.push(`${n.type} pin \u2192 ${g(e,n.dst)} \u2014 target retired`);continue}let i=C(e,n.dst,d);s.push(i.length>0?`${g(e,n.dst)} updated: ${i.map(a=>a.field).join(", ")}`:`${n.type} pin \u2192 ${g(e,n.dst)} \u2014 target superseded`)}return s.length>0?s.join("; "):"stale \u2014 a pinned dependency moved"}function C(e,t,r){let s=e.getNode(t)?.content??{},o=e.getNode(r)?.content??{},n=i=>i===void 0?"":Array.isArray(i)?i.map(String).join(" \xB7 "):typeof i=="object"?JSON.stringify(i):String(i),d=[];for(let i of[...new Set([...Object.keys(s),...Object.keys(o)])].sort())JSON.stringify(s[i])!==JSON.stringify(o[i])&&d.push({field:i,old:n(s[i]),new:n(o[i])});return d}function P(e,t){let r=[];for(let{cid:s}of e.byLabel(E.SCENARIO))e.superseded.has(s)||e.edgesFrom(s).some(o=>o.type===h.BELONGS_TO&&e.tipOf(o.dst)===t)&&r.push(s);return r}function O(e,t){let r=[],s=[],o=[],n=[],d=[],i=[],a=P(e,t),y=new Set(a),l=(c,f)=>{let u=b(e,f);return u===void 0?c:{...c,stale:!0,stale_reason:u}};for(let c of a){let f=e.getNode(c)?.content??{};r.push(l({ref:g(e,c),title:String(f.title??""),case_type:String(f.case_type??""),intent:String(f.intent??"")},c));for(let u of e.edgesInto(c)){if(u.type!==h.AUTOMATES||e.superseded.has(u.src))continue;let p=e.getNode(u.src)?.content??{},S=e.edgesFrom(u.src).filter(x=>x.type===h.VERIFIES&&!e.superseded.has(x.dst)).map(x=>g(e,x.dst));s.push(l({ref:g(e,u.src),title:String(p.title??""),automates:g(e,c),check:p.check,verifies:S,...typeof p.target=="string"?{target:p.target}:{},...typeof p.app=="string"?{app:p.app}:{}},u.src)),d.push(u.src)}for(let u of e.edgesFrom(c))u.type!==h.EXERCISES||e.superseded.has(u.dst)||n.push({scenario:g(e,c),ac:g(e,u.dst)})}for(let{cid:c}of e.byLabel(E.AC)){if(e.superseded.has(c))continue;let f=e.edgesFrom(c).find(x=>x.type===h.SCOPED_TO);if(!f)continue;let u=e.tipOf(f.dst);if(!(u===t||y.has(u)))continue;let S=e.getNode(c)?.content??{};o.push(l({ref:g(e,c),text:String(S.text??""),kind:String(S.kind??""),scope:u===t?"use-case":g(e,u)},c)),i.push(c)}let _=[],m=new Set;for(let c of[t,...a,...d,...i])for(let f of e.retractedEdgesTouching(c))m.has(f.ecid)||(m.add(f.ecid),_.push({type:f.type,src:g(e,f.src),dst:g(e,f.dst),at:f.retraction.at,...f.retraction.reason?{reason:f.retraction.reason}:{}}));return{scenarios:r,tests:s,acs:o,exercises:n,retracted_edges:_}}function D(e,t,r){let s=k(e,t,r);return s===null?null:s.toString("utf8")}function v(e,t){let r=t.split(`
3
3
  `).map(o=>o.replace(/^\d+\| /,"")),s=[];for(let o of e.split(`
4
4
  `)){let n=o.trim();if(n.length===0)continue;let d=r.find(i=>i.includes(n));d!==void 0&&!s.includes(d.trim())&&s.push(d.trim())}return s.length>0?s.join(`
5
5
  `):{removed:!0}}function G(e,t,r,s){if(s!==void 0&&s.trim().length>0)return{kind:"user-directive",text:s.trim()};let o=[r,...O(t,r).acs.map(a=>t.resolve(a.ref)?.cid??"")].filter(Boolean),n=[],d=new Set;for(let a of o){let y=new Map;for(let l of t.derivesInto(a))y.set(String(l.props.source_id),l);for(let[l,_]of y){let m=t.heads.get(l);if(m==null||m===_.props.source_cid)continue;let c=String(_.props.anchor),f=`${l}\0${c}`;if(d.has(f)||c==="img#whole")continue;d.add(f);let u=D(e,t,String(_.props.source_cid)),p=u===null?null:w(u,c);if(p===null)continue;let S=D(e,t,m);n.push({source_id:l,anchor:c,old_anchor_text:p,new_anchor_text:S===null?{removed:!0}:v(p,S)})}}let i;for(let[a,y]of t.superseded){if(y!==r||t.nodeLabel.get(a)!==E.USECASE)continue;let l=C(t,a,r);l.length>0&&(i=l);break}return{kind:"source-change",changes:n,...i?{uc_updated:i}:{}}}function $(e,t,r,s){let o=O(t,r);if(o.scenarios.length===0&&o.tests.length===0&&o.acs.length===0)return;let n=G(e,t,r,s);if(!(n.kind==="source-change"&&n.changes.length===0&&!n.uc_updated))return{prior_design:o,change_delta:n}}export{O as a,$ as b};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{e as $e}from"./chunk-Z3YYMZHT.js";import{a as te}from"./chunk-5HTSKF5K.js";import{a as K}from"./chunk-5Y2G4NC7.js";import{a as Be}from"./chunk-YGMUNNKH.js";import{a as ve}from"./chunk-XXE7W5AV.js";import{y as i}from"./chunk-HYTBEPC2.js";import{b as ye}from"./chunk-DFS4RMVP.js";import{a as k}from"./chunk-HCBYKLMW.js";import{a as s,b as o,i as Se,j as Te,k as ee}from"./chunk-C44QQJR4.js";import{a as V}from"./chunk-6YGTRKDT.js";import{e as R}from"./chunk-UR6MHSHU.js";var A=R(V(),1);var C=R(V(),1);function de(e){let t=e.flatMap(u=>[u,...u.children??[]]),n=t.filter(u=>u.status==="passed").length,l=t.filter(u=>u.status==="failed").length,a=t.filter(u=>u.status==="passed"||u.status==="failed").length;return{passed:n,failed:l,total:a}}function we(e){let t=$e(e.screenshotDispatcher,e.stepLogger,e.onReasoning,e.onStepComplete),[n,l]=(0,C.useState)(0),[a,u]=(0,C.useState)("idle"),c=(0,C.useRef)("idle"),v=(0,C.useRef)(0),S=(0,C.useRef)(!1),T=(0,C.useRef)(null),d=(0,C.useRef)(null),L=(0,C.useCallback)(h=>{c.current=h,u(h)},[]),O=(0,C.useCallback)(async h=>{let b=await e.getNextConfig(h);if(!b){L("done"),e.onAllComplete?.();return}let B=h?v.current+1:0;v.current=B,l(B),e.onStepStart?.(b,B),T.current=null,d.current=null,L("running"),await t.startRun(b,e.spawnOpts)},[t,e,L]);(0,C.useEffect)(()=>{S.current||(S.current=!0,O(null))},[]),(0,C.useEffect)(()=>{if(!t.lastRunEnd||t.lastRunEnd===T.current||c.current!=="running")return;T.current=t.lastRunEnd,c.current="transitioning",u("transitioning");let h=t.lastRunEnd,b=de(t.steps),B=t.bifurcationInfo,F={status:h.status==="passed"?"passed":"failed",duration_s:h.duration??0,reason:h.reason,runEnd:h,hadError:!1,stepsPassed:b.passed,stepsFailed:b.failed,stepsTotal:b.total,bifurcationFlows:B&&!B.isSingleFlow?B.flows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(F,v.current)??!0)){L("done"),e.onAllComplete?.();return}O(F)},[t.lastRunEnd]),(0,C.useEffect)(()=>{if(!t.runError||t.runError===d.current||t.lastRunEnd||c.current!=="running")return;d.current=t.runError,c.current="transitioning",u("transitioning");let h=de(t.steps),b={status:"failed",duration_s:0,reason:t.runError,runEnd:null,hadError:!0,stepsPassed:h.passed,stepsFailed:h.failed,stepsTotal:h.total,bifurcationFlows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(b,v.current)??!0)){L("done"),e.onAllComplete?.();return}O(b)},[t.runError,t.lastRunEnd]);let y=(0,C.useCallback)(()=>{t.cancelRun()},[t]);return{runner:t,currentStepIndex:n,phase:a,cancel:y}}var pe=R(V(),1);var ne=R(k(),1),Ee=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function ke({label:e,hasBifurcation:t=!1}){let[n,l]=(0,pe.useState)(0),[a,u]=(0,pe.useState)(0);K(()=>{l(v=>(v+1)%Ee.length)},80),K(()=>{u(v=>(v+1)%4)},400);let c=e??(t?"Planning approach":"Analyzing objective");return(0,ne.jsxs)(s,{marginLeft:1,children:[(0,ne.jsxs)(o,{color:i.orange,children:[Ee[n]," "]}),(0,ne.jsxs)(o,{color:i.dim,children:[c,".".repeat(a+1)]})]})}function Ie(e){if(!e.isRunning||e.replayInfo)return null;let t=e.bifurcationInfo;if(t&&!t.isSingleFlow){let n=e.steps.findIndex(a=>a.status==="running");return(n===-1?e.cmInitCounts.length===0:n>=e.cmInitCounts.length)?{label:n>0?`Planning flow ${n+1}`:void 0,hasBifurcation:!0}:null}return e.cmInitCounts.length>0||e.steps.some(n=>n.children?.length)?null:{hasBifurcation:!!t}}var I=R(V(),1);var Ce=R(V(),1);var re=R(k(),1),He="#ffc580",Ue="#ffd9a8",Le="#ffffff";function oe({text:e,active:t=!0}){let[n,l]=(0,Ce.useState)(0),a=4;if(K(()=>{l(c=>(c+1)%(e.length+a*2))},t?80:null),!t)return(0,re.jsx)(o,{color:Le,children:e});let u=e.split("").map((c,v)=>{let S=n-a,T=Math.abs(v-S-a/2),d;return T<=a/2?d=He:T<=a?d=Ue:d=Le,(0,re.jsx)(o,{color:d,children:c},v)});return(0,re.jsx)(o,{children:u})}var _=R(k(),1),We={starting:i.orange,running:i.orange,passed:i.green,failed:i.red,cancelled:i.dim,timed_out:i.orange};function ie({currentStep:e,maxSteps:t,elapsed:n,status:l}){let a=We[l]??i.orange,u=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`;return(0,_.jsxs)(s,{marginLeft:3,children:[(0,_.jsx)(o,{color:i.dim,children:"Steps "}),(0,_.jsx)(o,{bold:!0,children:e}),(0,_.jsxs)(o,{color:i.dim,children:["/",t]}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Elapsed "}),(0,_.jsx)(o,{bold:!0,children:u}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Status "}),(0,_.jsx)(o,{bold:!0,color:a,children:l})]})}var Ve={click:"\u25CF",type:"\u229E",scroll:"\u2195",navigate:"\u2192",analyze:"\u25CE",assert:"\u25C8","if-else":"\u2442",select:"\u25BC",press_key:"\u21B5",wait:"\u2026",tool_call:"\u2299"};function Oe(e){return Ve[e]??"\u25CF"}var q=R(k(),1);function fe({steps:e,flows:t,cmInitCounts:n,renderStep:l}){return(0,q.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[(0,q.jsxs)(o,{color:i.dim,children:["\u2501\u2501 Bifurcated into ",t?.length??e.length," flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"]}),e.map((a,u)=>(0,q.jsxs)(s,{flexDirection:"column",marginTop:u>0?1:0,children:[(0,q.jsxs)(o,{color:i.orange,children:["Flow ",u+1,": ",t?.[u]??a.objective]}),n&&n[u]!=null&&(0,q.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",n[u]," checkpoints"]}),a.children&&a.children.length>0?a.children.map(c=>{let v=!!c.branchObjective,S=`f${u}-${c.childId??"p"}-${c.index}`;return v?(0,q.jsxs)(s,{flexDirection:"column",children:[l({...c,children:void 0},S),(c.children??[]).map(T=>(0,q.jsx)(s,{marginLeft:2,children:l(T,`${S}-${T.childId??"p"}-${T.index}`)},`${S}-${T.childId??"p"}-${T.index}`))]},`${S}-host`):l(c,S)}):a.status==="pending"&&(0,q.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})]},u))]})}var H=R(k(),1);function Pe({label:e,shimmer:t=!1}){return(0,H.jsxs)(s,{marginLeft:6,children:[(0,H.jsx)(te,{}),(0,H.jsx)(o,{children:" "}),t?(0,H.jsx)(oe,{text:e,active:!0}):(0,H.jsx)(o,{color:i.dim,children:e})]})}var De=R(V(),1);var me=R(k(),1);function ze(e,t){let n=[];for(let l of e.split(`
2
+ import{e as $e}from"./chunk-BNZQKQOE.js";import{a as te}from"./chunk-4OQ7GEIA.js";import{a as K}from"./chunk-5Y2G4NC7.js";import{a as Be}from"./chunk-RBFCGUR3.js";import{a as ve}from"./chunk-5X7JIGG7.js";import{y as i}from"./chunk-PHR2OSWD.js";import{b as ye}from"./chunk-DFS4RMVP.js";import{a as k}from"./chunk-HCBYKLMW.js";import{a as s,b as o,i as Se,j as Te,k as ee}from"./chunk-C44QQJR4.js";import{a as V}from"./chunk-6YGTRKDT.js";import{e as R}from"./chunk-UR6MHSHU.js";var A=R(V(),1);var C=R(V(),1);function de(e){let t=e.flatMap(u=>[u,...u.children??[]]),n=t.filter(u=>u.status==="passed").length,l=t.filter(u=>u.status==="failed").length,a=t.filter(u=>u.status==="passed"||u.status==="failed").length;return{passed:n,failed:l,total:a}}function we(e){let t=$e(e.screenshotDispatcher,e.stepLogger,e.onReasoning,e.onStepComplete),[n,l]=(0,C.useState)(0),[a,u]=(0,C.useState)("idle"),c=(0,C.useRef)("idle"),v=(0,C.useRef)(0),S=(0,C.useRef)(!1),T=(0,C.useRef)(null),d=(0,C.useRef)(null),L=(0,C.useCallback)(h=>{c.current=h,u(h)},[]),O=(0,C.useCallback)(async h=>{let b=await e.getNextConfig(h);if(!b){L("done"),e.onAllComplete?.();return}let B=h?v.current+1:0;v.current=B,l(B),e.onStepStart?.(b,B),T.current=null,d.current=null,L("running"),await t.startRun(b,e.spawnOpts)},[t,e,L]);(0,C.useEffect)(()=>{S.current||(S.current=!0,O(null))},[]),(0,C.useEffect)(()=>{if(!t.lastRunEnd||t.lastRunEnd===T.current||c.current!=="running")return;T.current=t.lastRunEnd,c.current="transitioning",u("transitioning");let h=t.lastRunEnd,b=de(t.steps),B=t.bifurcationInfo,F={status:h.status==="passed"?"passed":"failed",duration_s:h.duration??0,reason:h.reason,runEnd:h,hadError:!1,stepsPassed:b.passed,stepsFailed:b.failed,stepsTotal:b.total,bifurcationFlows:B&&!B.isSingleFlow?B.flows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(F,v.current)??!0)){L("done"),e.onAllComplete?.();return}O(F)},[t.lastRunEnd]),(0,C.useEffect)(()=>{if(!t.runError||t.runError===d.current||t.lastRunEnd||c.current!=="running")return;d.current=t.runError,c.current="transitioning",u("transitioning");let h=de(t.steps),b={status:"failed",duration_s:0,reason:t.runError,runEnd:null,hadError:!0,stepsPassed:h.passed,stepsFailed:h.failed,stepsTotal:h.total,bifurcationFlows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(b,v.current)??!0)){L("done"),e.onAllComplete?.();return}O(b)},[t.runError,t.lastRunEnd]);let y=(0,C.useCallback)(()=>{t.cancelRun()},[t]);return{runner:t,currentStepIndex:n,phase:a,cancel:y}}var pe=R(V(),1);var ne=R(k(),1),Ee=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function ke({label:e,hasBifurcation:t=!1}){let[n,l]=(0,pe.useState)(0),[a,u]=(0,pe.useState)(0);K(()=>{l(v=>(v+1)%Ee.length)},80),K(()=>{u(v=>(v+1)%4)},400);let c=e??(t?"Planning approach":"Analyzing objective");return(0,ne.jsxs)(s,{marginLeft:1,children:[(0,ne.jsxs)(o,{color:i.orange,children:[Ee[n]," "]}),(0,ne.jsxs)(o,{color:i.dim,children:[c,".".repeat(a+1)]})]})}function Ie(e){if(!e.isRunning||e.replayInfo)return null;let t=e.bifurcationInfo;if(t&&!t.isSingleFlow){let n=e.steps.findIndex(a=>a.status==="running");return(n===-1?e.cmInitCounts.length===0:n>=e.cmInitCounts.length)?{label:n>0?`Planning flow ${n+1}`:void 0,hasBifurcation:!0}:null}return e.cmInitCounts.length>0||e.steps.some(n=>n.children?.length)?null:{hasBifurcation:!!t}}var I=R(V(),1);var Ce=R(V(),1);var re=R(k(),1),He="#ffc580",Ue="#ffd9a8",Le="#ffffff";function oe({text:e,active:t=!0}){let[n,l]=(0,Ce.useState)(0),a=4;if(K(()=>{l(c=>(c+1)%(e.length+a*2))},t?80:null),!t)return(0,re.jsx)(o,{color:Le,children:e});let u=e.split("").map((c,v)=>{let S=n-a,T=Math.abs(v-S-a/2),d;return T<=a/2?d=He:T<=a?d=Ue:d=Le,(0,re.jsx)(o,{color:d,children:c},v)});return(0,re.jsx)(o,{children:u})}var _=R(k(),1),We={starting:i.orange,running:i.orange,passed:i.green,failed:i.red,cancelled:i.dim,timed_out:i.orange};function ie({currentStep:e,maxSteps:t,elapsed:n,status:l}){let a=We[l]??i.orange,u=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`;return(0,_.jsxs)(s,{marginLeft:3,children:[(0,_.jsx)(o,{color:i.dim,children:"Steps "}),(0,_.jsx)(o,{bold:!0,children:e}),(0,_.jsxs)(o,{color:i.dim,children:["/",t]}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Elapsed "}),(0,_.jsx)(o,{bold:!0,children:u}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Status "}),(0,_.jsx)(o,{bold:!0,color:a,children:l})]})}var Ve={click:"\u25CF",type:"\u229E",scroll:"\u2195",navigate:"\u2192",analyze:"\u25CE",assert:"\u25C8","if-else":"\u2442",select:"\u25BC",press_key:"\u21B5",wait:"\u2026",tool_call:"\u2299"};function Oe(e){return Ve[e]??"\u25CF"}var q=R(k(),1);function fe({steps:e,flows:t,cmInitCounts:n,renderStep:l}){return(0,q.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[(0,q.jsxs)(o,{color:i.dim,children:["\u2501\u2501 Bifurcated into ",t?.length??e.length," flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"]}),e.map((a,u)=>(0,q.jsxs)(s,{flexDirection:"column",marginTop:u>0?1:0,children:[(0,q.jsxs)(o,{color:i.orange,children:["Flow ",u+1,": ",t?.[u]??a.objective]}),n&&n[u]!=null&&(0,q.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",n[u]," checkpoints"]}),a.children&&a.children.length>0?a.children.map(c=>{let v=!!c.branchObjective,S=`f${u}-${c.childId??"p"}-${c.index}`;return v?(0,q.jsxs)(s,{flexDirection:"column",children:[l({...c,children:void 0},S),(c.children??[]).map(T=>(0,q.jsx)(s,{marginLeft:2,children:l(T,`${S}-${T.childId??"p"}-${T.index}`)},`${S}-${T.childId??"p"}-${T.index}`))]},`${S}-host`):l(c,S)}):a.status==="pending"&&(0,q.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})]},u))]})}var H=R(k(),1);function Pe({label:e,shimmer:t=!1}){return(0,H.jsxs)(s,{marginLeft:6,children:[(0,H.jsx)(te,{}),(0,H.jsx)(o,{children:" "}),t?(0,H.jsx)(oe,{text:e,active:!0}):(0,H.jsx)(o,{color:i.dim,children:e})]})}var De=R(V(),1);var me=R(k(),1);function ze(e,t){let n=[];for(let l of e.split(`
3
3
  `)){if(l===""){n.push("");continue}let a="";for(let u of l.split(" ")){let c=u;for(;c.length>t;)a&&(n.push(a),a=""),n.push(c.slice(0,t)),c=c.slice(t);a===""?a=c:a.length+1+c.length<=t?a+=" "+c:(n.push(a),a=c)}n.push(a)}return n}function je({text:e,maxLines:t=3}){let{stdout:n}=ee(),l=Math.max(20,(n?.columns??80)-7),a=!e.trim(),[u,c]=(0,De.useState)(!0);K(()=>c(T=>!T),500);let v=(a?"Thinking\u2026":e)+(u?"\u258C":" "),S=ze(v,l).slice(-t);for(;S.length<t;)S.push("");return(0,me.jsx)(s,{borderStyle:"round",borderColor:i.muted,paddingX:1,marginLeft:3,flexDirection:"column",children:S.map((T,d)=>(0,me.jsx)(o,{color:a?i.dim:i.secondary,wrap:"truncate-end",children:T.length?T:" "},d))})}var U=R(k(),1);function se({activity:e,describe:t,describeVisible:n}){return(0,U.jsxs)(U.Fragment,{children:[e?(0,U.jsx)(Pe,{label:e.label,shimmer:e.shimmer}):null,n?(0,U.jsx)(je,{text:t??""}):null]})}var r=R(k(),1);function le(e){for(let t of e){if(t.children&&t.children.length>0){let n=le(t.children);if(n)return n}if(t.status==="running")return t}}function z(e){return e.status==="running"&&!e.branchObjective&&(!e.children||e.children.length===0)}function Fe(e){let t=[];for(let n of e)z(n)||(n.children&&n.children.length>0?t.push({...n,children:Fe(n.children)}):t.push(n));return t}function ge(e,t){if(!e)return null;let n=e.objective??"";return n.length>0&&!/^Step \d+$/.test(n)?{label:n+"\u2026",shimmer:!1}:{label:t?"Looking at the screen\u2026":"Deciding next action\u2026",shimmer:!0}}function P({step:e,indent:t=2}){let n=e.actionType?Oe(e.actionType):null,l=e.status==="running",a=e.status==="passed",u=e.status==="failed",c=e.status==="pending"||e.status==="stopped",{stdout:v}=ee(),S=v?.columns??80,T=Math.max(20,S-t-21),d=e.objective??"",L=d.length>T?d.slice(0,T-1)+"\u2026":d,O=(e.duration??0)*1e3,y=e.duration!=null?O<1e3?`${Math.round(O)}ms`:`${(O/1e3).toFixed(1)}s`:"";return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsxs)(s,{marginLeft:t,children:[(0,r.jsx)(s,{width:4,children:(0,r.jsxs)(o,{color:i.muted,children:[String(e.index).padStart(2," ")," "]})}),(0,r.jsx)(s,{width:3,children:l?(0,r.jsx)(te,{}):a?(0,r.jsx)(o,{color:i.green,bold:!0,children:"\u2713"}):u?(0,r.jsx)(o,{color:i.red,bold:!0,children:"\u2717"}):(0,r.jsx)(o,{color:i.muted,children:"\u25CB"})}),(0,r.jsx)(s,{flexGrow:1,children:l?(0,r.jsx)(oe,{text:L,active:!0}):u?(0,r.jsx)(o,{color:i.red,children:L}):c?(0,r.jsx)(o,{color:i.dim,children:L}):(0,r.jsx)(o,{color:i.dim,children:L})}),(a||u)&&n?(0,r.jsx)(s,{width:3,marginLeft:1,children:(0,r.jsx)(o,{color:i.muted,children:n})}):(0,r.jsx)(s,{width:3,marginLeft:1}),(0,r.jsx)(s,{width:7,justifyContent:"flex-end",children:(0,r.jsx)(o,{color:i.dim,children:y})})]}),e.children&&e.children.length>0&&(0,r.jsx)(s,{flexDirection:"column",children:e.children.map((h,b)=>(0,r.jsx)(P,{step:h,indent:t+2},`child-${b}`))})]})}function Xe(e){return e.type==="cm_init"?(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",e.count," checkpoints"]})}):(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsx)(P,{step:e.step})})}function _e({steps:e,bifurcated:t,flows:n,cmInitCounts:l,maxSteps:a=50,staticSteps:u=!1,onStepCommit:c,describe:v,describeVisible:S,describeRevealing:T}){let d=(0,I.useRef)(new Set),L=(0,I.useRef)(!1),O=(0,I.useRef)(new Set),y=(0,I.useRef)(!1),h=(0,I.useRef)(new Set),b=(0,I.useRef)(0);(0,I.useEffect)(()=>{e.length===0&&b.current>0&&(d.current.clear(),L.current=!1,O.current.clear(),y.current=!1,h.current.clear()),b.current=e.length},[e.length]);let B=e.flatMap(p=>[p,...p.children??[]]),F=B.some(p=>p.status==="running"),M=B.some(p=>p.status==="failed"),X=B.length===0||B.every(p=>p.status==="pending"),Y=B.filter(p=>p.status==="passed"||p.status==="failed").length,N;X?N="starting":F?N="running":M?N="failed":N="passed";let J=(0,I.useRef)(null),[ce,he]=(0,I.useState)(0);(0,I.useEffect)(()=>{B.length===0||X?(J.current=null,he(0)):F&&J.current==null&&(J.current=Date.now())},[F,X,B.length]),(0,I.useEffect)(()=>{if(!F)return;let p=setInterval(()=>{J.current!=null&&he((Date.now()-J.current)/1e3)},500);return()=>clearInterval(p)},[F]);let ae=(0,I.useRef)(new Set),[,xe]=(0,I.useState)(0),be=(0,I.useRef)(!1);(0,I.useEffect)(()=>{if(!c||!u||t)return;let p=[];!be.current&&l&&l[0]!=null&&(be.current=!0,l[0]>0&&p.push({key:"cm_init_0",type:"cm_init",count:l[0]}));for(let g of e)(g.status==="passed"||g.status==="failed")&&!ae.current.has(g.index)&&(ae.current.add(g.index),p.push({key:`step_${g.index}`,type:"step",step:{...g,children:g.children?[...g.children]:void 0}}));if(p.length>0){for(let g of p)c(Xe(g));xe(g=>g+1)}},[e,t,l,u,c]),(0,I.useEffect)(()=>{if(!c||u)return;let p=d.current.size;if(!t&&!y.current&&l&&l[0]!=null&&(y.current=!0,l[0]>0&&c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25A0 Generated task with ",l[0]," checkpoints"]})}))),t&&n&&!L.current&&(L.current=!0,c((0,r.jsx)(o,{color:i.purple,children:"\u2501\u2501 Bifurcated into "+n.length+" flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"}))),t){let g=e.flatMap((x,f)=>{let m=x.children??[];return!O.current.has(f)&&m.length>0&&(O.current.add(f),c((0,r.jsx)(o,{color:i.purple,children:" Flow "+(f+1)+": "+(n?.[f]??"")})),l?.[f]!=null&&l[f]>0&&!h.current.has(f)&&(h.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})})))),l?.[f]!=null&&l[f]>0&&O.current.has(f)&&!h.current.has(f)&&(h.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})}))),m});for(let x of g){let f=`${x.childId??"p"}-${x.index}-${x.objective}`;if(!!x.branchObjective){d.current.has(f)||(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...x,children:void 0}})})));for(let $ of x.children??[]){let w=`child-${x.childId??"p"}-${x.index}-${$.childId??"p"}-${$.index}-${$.objective}`;d.current.has(w)||($.status==="passed"||$.status==="failed"||$.status==="stopped")&&(d.current.add(w),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(P,{step:$})})))}continue}d.current.has(f)||(x.status==="passed"||x.status==="failed"||x.status==="stopped")&&(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:x})})))}}else for(let g of e){let x=`${g.index}-${g.objective}`,f=!!g.branchObjective;f&&!d.current.has(x)&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...g,children:void 0}})})));for(let m of g.children??[]){let $=`child-${g.index}-${m.childId??"p"}-${m.index}-${m.objective}`;d.current.has($)||(m.status==="passed"||m.status==="failed"||m.status==="stopped")&&(d.current.add($),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(P,{step:m})})))}!f&&!d.current.has(x)&&(g.status==="passed"||g.status==="failed"||g.status==="stopped")&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...g,children:void 0}})})))}d.current.size>p&&xe(g=>g+1)},[e,c,t,n,l]);let G=[];if(u&&!t)for(let p of e)ae.current.has(p.index)||G.push(p);else if(c&&!u)if(t)for(let p of e){let g=p.children??[],x=[];for(let f of g){let m=`${f.childId??"p"}-${f.index}-${f.objective}`,$=d.current.has(m);if(f.branchObjective){let w=(f.children??[]).filter(Q=>{let ue=`child-${f.childId??"p"}-${f.index}-${Q.childId??"p"}-${Q.index}-${Q.objective}`;return!d.current.has(ue)});(!$||w.length>0)&&x.push({...f,children:w})}else $||x.push(f)}x.length>0&&G.push({...p,children:x})}else for(let p of e){let g=`${p.index}-${p.objective}`,x=d.current.has(g),f=(p.children??[]).filter(m=>{let $=`child-${p.index}-${m.childId??"p"}-${m.index}-${m.objective}`;return!d.current.has($)});x?f.length>0&&G.push({...p,children:f}):G.push({...p,children:f})}if(!u){let p=c?G:e,g=le(p),x=ge(g,T);return(0,r.jsxs)(s,{flexDirection:"column",children:[t?c?p.length>0?(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:p.map((m,$)=>(0,r.jsx)(s,{flexDirection:"column",marginTop:$>0?1:0,children:m.children&&m.children.length>0?m.children.map(w=>{if(z(w))return null;let Q=!!w.branchObjective,ue=`${w.childId??"p"}-${w.index}-${w.objective}`,Ke=d.current.has(ue);return Q?(0,r.jsxs)(s,{flexDirection:"column",children:[!Ke&&(0,r.jsx)(P,{step:{...w,children:void 0}}),(w.children??[]).filter(Z=>!z(Z)).map(Z=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:Z})},`f${$}-${w.index}-${Z.childId??"p"}-${Z.index}`))]},`f${$}-host-${w.childId??"p"}-${w.index}`):(0,r.jsx)(P,{step:w},`f${$}-${w.childId??"p"}-${w.index}`)}):m.status==="pending"&&(0,r.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})},$))}):null:(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(m,$)=>z(m)?null:(0,r.jsx)(P,{step:m},$)}):(0,r.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[!c&&l&&l[0]!=null&&(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",l[0]," checkpoints"]}),p.filter(m=>!(m.status==="running"&&(!m.children||m.children.length===0))).map(m=>{let $=`${m.index}-${m.objective}`;return c&&d.current.has($)?(0,r.jsx)(s,{flexDirection:"column",children:(m.children??[]).filter(w=>!z(w)).map(w=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:w})},`${w.childId??"p"}-${w.index}`))},`branch-children-${m.index}`):(0,r.jsx)(P,{step:m},m.index)})]}),(0,r.jsx)(se,{activity:x,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}if(t){let p=le(e),g=ge(p,T);return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(x,f)=>z(x)?null:(0,r.jsx)(P,{step:x},f)}),(0,r.jsx)(se,{activity:g,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}let Ne=le(G),Ge=ge(Ne,T),Re=Fe(G);return(0,r.jsxs)(s,{flexDirection:"column",children:[Re.length>0&&(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:Re.map(p=>(0,r.jsx)(P,{step:p},p.index))}),(0,r.jsx)(se,{activity:Ge,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}var W=R(k(),1);function Ae({runner:e,runKey:t,onStepCommit:n}){let l=Ie({isRunning:e.isRunning,bifurcationInfo:e.bifurcationInfo,steps:e.steps,cmInitCounts:e.cmInitCounts,replayInfo:e.replayInfo});return(0,W.jsxs)(W.Fragment,{children:[l&&(0,W.jsx)(ke,{label:l.label,hasBifurcation:l.hasBifurcation}),e.isRunning&&e.steps.length>0&&(0,W.jsx)(_e,{steps:e.steps,bifurcated:!!e.bifurcationInfo&&!e.bifurcationInfo.isSingleFlow,flows:e.bifurcationInfo?.flows,cmInitCounts:e.cmInitCounts,maxSteps:e.maxSteps,onStepCommit:n},`run-${t}`)]})}var D=R(k(),1),Ye=64;function Je(e){return e.split(`
4
4
  `).map(t=>t.replace(/^[-–•]\s*/,"").trim()).filter(t=>t.length>0)}function qe({status:e,summary:t,duration:n,steps:l,stepsPassed:a,stepsFailed:u,reason:c,creditsConsumed:v}){let S=e==="passed",T=S?i.green:i.red,d=S?"\u2713":"\u2717",L=e.toUpperCase(),O=a??(S?l:Math.max(0,l-1)),y=u??(S?0:1),h=y>0?`${l} steps (${O} passed, ${y} failed)`:`${l} steps`,b=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`,B=Je(t);return(0,D.jsx)(s,{flexDirection:"column",marginTop:1,children:(0,D.jsxs)(s,{borderStyle:"round",borderColor:T,flexDirection:"column",paddingX:2,paddingY:1,width:Ye+6,children:[(0,D.jsxs)(s,{flexDirection:"column",children:[(0,D.jsxs)(o,{bold:!0,color:T,children:[d," ",L]}),(0,D.jsxs)(o,{color:i.dim,wrap:"wrap",children:[h," \xB7 ",b,typeof v=="number"&&v>0?` \xB7 ${parseFloat(v.toFixed(4))} credits`:""]})]}),B.length>0&&(0,D.jsx)(s,{flexDirection:"column",marginTop:1,marginLeft:1,children:B.map((F,M)=>(0,D.jsxs)(s,{marginBottom:M<B.length-1?1:0,children:[(0,D.jsx)(o,{color:i.orange,children:"\u25CF "}),(0,D.jsx)(s,{flexShrink:1,children:(0,D.jsx)(o,{wrap:"wrap",children:F})})]},M))}),c&&!S&&(0,D.jsx)(s,{marginTop:1,children:(0,D.jsxs)(o,{color:i.red,wrap:"wrap",children:["Reason: ",c]})})]})})}var j=R(k(),1);function Me({message:e,code:t,remediation:n,docsUrl:l}){return(0,j.jsx)(ve,{title:"Error",variant:"error",children:(0,j.jsxs)(s,{flexDirection:"column",paddingY:1,children:[(0,j.jsxs)(o,{color:i.red,bold:!0,children:[" \u2717 ",e]}),t&&(0,j.jsxs)(s,{marginTop:0,marginLeft:5,children:[(0,j.jsx)(o,{color:i.muted,children:"Code: "}),(0,j.jsx)(o,{color:i.dim,children:t})]}),n&&(0,j.jsxs)(s,{flexDirection:"column",marginTop:1,marginLeft:5,children:[(0,j.jsx)(o,{color:i.green,bold:!0,children:"Fix:"}),(0,j.jsxs)(o,{color:i.orange,children:["$ ",n]})]}),l&&(0,j.jsxs)(s,{marginTop:1,marginLeft:5,children:[(0,j.jsx)(o,{color:i.muted,children:"Docs: "}),(0,j.jsx)(o,{color:i.orange,underline:!0,children:l})]})]})})}var E=R(k(),1);function un(e){let{exit:t}=Te(),{append:n}=ye(),l=(0,A.useRef)(!1);(0,A.useEffect)(()=>{l.current||(l.current=!0,n((0,E.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,E.jsxs)(s,{borderStyle:"round",borderColor:"#dc4e08",paddingX:2,children:[(0,E.jsx)(o,{color:"#ff9500",bold:!0,children:"KaneAI CLI"}),(0,E.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,E.jsx)(o,{color:i.orange,children:e.topBanner.model}),(0,E.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,E.jsx)(o,{color:i.dim,children:e.topBanner.auth})]})})),n((0,E.jsx)(Qe,{data:e.globalConfig})),e.priorAttemptRollup&&n((0,E.jsx)(o,{color:i.dim,children:` \u21B3 replayed ${e.priorAttemptRollup.startIdx}..${e.priorAttemptRollup.endIdx-1} (${e.priorAttemptRollup.count} steps, from prior attempt)`})))},[]);let a=(0,A.useRef)(null),u=(0,A.useCallback)(async y=>{let h=await e.getNextStep(y);return h?(a.current=h,h.config):(a.current=null,null)},[e]),c=(0,A.useCallback)((y,h)=>{let b=a.current;if(!b)return;let B=b.mode==="replay"?"cyan":"#dc4e08",F=b.modeReason?` (${b.modeReason})`:"",M=b.perStepOverrides?Object.entries(b.perStepOverrides):[];n((0,E.jsxs)(s,{flexDirection:"column",marginBottom:0,children:[(0,E.jsxs)(o,{children:[(0,E.jsxs)(o,{color:i.dim,children:[b.banner.stepLabel," "]}),(0,E.jsxs)(o,{color:B,children:["[",b.mode,"]"]}),(0,E.jsx)(o,{color:i.dim,children:F})]}),(0,E.jsx)(o,{color:i.dim,children:b.banner.objective}),M.length>0&&(0,E.jsxs)(o,{color:i.dim,children:["overrides: ",M.map(([X,Y])=>`${X}=${Y}`).join(", ")]})]}))},[n]),v=(0,A.useRef)(0),S=(0,A.useRef)(!1),T=(0,A.useCallback)((y,h)=>(y.hadError?n((0,E.jsx)(Me,{message:y.reason??"Runner error",code:"RUNNER_ERROR"})):n((0,E.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,E.jsx)(qe,{status:y.status,summary:y.runEnd?.summary??"",duration:y.runEnd?.duration??0,steps:y.stepsTotal,stepsPassed:y.stepsPassed,stepsFailed:y.stepsFailed,reason:y.runEnd?.reason,creditsConsumed:y.runEnd?.credits_consumed})})),e.onStepEnd?.(y,h)??!0),[n,e]),d=we({getNextConfig:u,onStepStart:c,onStepEnd:T,onAllComplete:()=>{e.onAllComplete(),e.exitOnComplete!==!1&&setImmediate(()=>t())},screenshotDispatcher:e.screenshotDispatcher,stepLogger:e.stepLogger,onReasoning:e.onReasoning,onStepComplete:e.onStepComplete,spawnOpts:e.spawnOpts}),L=250,O=5e3;return Se((y,h)=>{if(h.ctrl&&y==="c"){let b=Date.now(),B=b-v.current;if(B<L)return;S.current&&B<O?(d.cancel(),e.onCancel?.(),e.exitOnComplete!==!1&&setImmediate(()=>t())):(S.current=!0,n((0,E.jsx)(o,{color:"yellow",children:"press Ctrl+C again to cancel run"}))),v.current=b}}),(0,E.jsx)(s,{flexDirection:"column",children:d.phase!=="done"&&(0,E.jsx)(Ae,{runner:d.runner,runKey:d.currentStepIndex,onStepCommit:n})})}function Qe({data:e}){return(0,E.jsx)(Be,{title:"test.md run",titleColor:"#ff9500",borderColor:i.dim,rows:[{label:"source",value:e.source},{label:"steps",value:`${e.steps.total} (${e.steps.replay} replay, ${e.steps.author} author per walker)`},{label:"model",value:e.model},{label:"viewport",value:`${e.viewport.width} x ${e.viewport.height}`},{label:"chrome",value:e.chrome},{label:"session",value:e.session},{label:"variables",value:`${e.variables.count} (${e.variables.secrets} secret)`},{label:"flags",value:e.flags.length>0?e.flags.join(" "):"(none)"}]})}export{_e as a,ke as b,Ie as c,de as d,qe as e,Me as f,un as g};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as y}from"./chunk-YCCUBQY4.js";import{y as t}from"./chunk-HYTBEPC2.js";import{a as O}from"./chunk-HCBYKLMW.js";import{a as c,b as n,k as w}from"./chunk-C44QQJR4.js";import{e as k}from"./chunk-UR6MHSHU.js";var e=k(O(),1);function D(i){let a=i.findIndex(s=>s.free);return a>=0?a:null}var P=60,C=100;function F({headline:i,ask:a=!1,rows:s,sel:u,focused:m,freeText:l=null,freeTextNote:x,sublines:$=[]}){let{stdout:h}=w(),p=h?.columns??80,A=p<P,B=Math.min(p-1,C),d=o=>m&&u===o?(0,e.jsx)(n,{color:t.assuranceAccent,children:"\u276F"}):" ",b=a?`? ${i}`:i,f=Math.max(4,B-3),T=$.map((o,r)=>(0,e.jsx)(n,{color:t.dim,children:` ${o.length>f?`${o.slice(0,f-1)}\u2026`:o}`},`sub-${r}`)),g=0,R=s.map((o,r)=>o.free?l?(0,e.jsxs)(c,{flexDirection:"column",children:[(0,e.jsxs)(c,{children:[(0,e.jsxs)(n,{children:[(0,e.jsx)(n,{color:t.assuranceAccent,children:"\u276F"})," ",(0,e.jsx)(n,{color:t.dim,children:"\u270E "})]}),(0,e.jsx)(y,{value:l.value,onChange:l.onChange,onSubmit:l.onSubmit,onCancel:l.onCancel,placeholder:o.label})]}),x?(0,e.jsx)(n,{color:t.muted,children:` ${x}`}):null]},o.key):(0,e.jsxs)(n,{children:[d(r)," ",(0,e.jsx)(n,{color:t.dim,children:`\u270E ${o.label}`})]},o.key):(g+=1,(0,e.jsxs)(n,{bold:m&&u===r,children:[d(r),` ${g}. ${o.label}`,o.detail?(0,e.jsx)(n,{color:t.dim,bold:!1,children:` \u2014 ${o.detail}`}):null]},o.key)));return A?(0,e.jsxs)(c,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,e.jsx)(n,{bold:!0,color:t.assuranceAccent,children:b}),T,R]}):(0,e.jsxs)(c,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,e.jsx)(n,{bold:!0,color:t.assuranceAccent,children:b}),T,(0,e.jsx)(n,{children:" "}),R]})}export{D as a,F as b};
2
+ import{a as y}from"./chunk-YCCUBQY4.js";import{y as t}from"./chunk-PHR2OSWD.js";import{a as O}from"./chunk-HCBYKLMW.js";import{a as c,b as n,k as w}from"./chunk-C44QQJR4.js";import{e as k}from"./chunk-UR6MHSHU.js";var e=k(O(),1);function D(i){let a=i.findIndex(s=>s.free);return a>=0?a:null}var P=60,C=100;function F({headline:i,ask:a=!1,rows:s,sel:u,focused:m,freeText:l=null,freeTextNote:x,sublines:$=[]}){let{stdout:h}=w(),p=h?.columns??80,A=p<P,B=Math.min(p-1,C),d=o=>m&&u===o?(0,e.jsx)(n,{color:t.assuranceAccent,children:"\u276F"}):" ",b=a?`? ${i}`:i,f=Math.max(4,B-3),T=$.map((o,r)=>(0,e.jsx)(n,{color:t.dim,children:` ${o.length>f?`${o.slice(0,f-1)}\u2026`:o}`},`sub-${r}`)),g=0,R=s.map((o,r)=>o.free?l?(0,e.jsxs)(c,{flexDirection:"column",children:[(0,e.jsxs)(c,{children:[(0,e.jsxs)(n,{children:[(0,e.jsx)(n,{color:t.assuranceAccent,children:"\u276F"})," ",(0,e.jsx)(n,{color:t.dim,children:"\u270E "})]}),(0,e.jsx)(y,{value:l.value,onChange:l.onChange,onSubmit:l.onSubmit,onCancel:l.onCancel,placeholder:o.label})]}),x?(0,e.jsx)(n,{color:t.muted,children:` ${x}`}):null]},o.key):(0,e.jsxs)(n,{children:[d(r)," ",(0,e.jsx)(n,{color:t.dim,children:`\u270E ${o.label}`})]},o.key):(g+=1,(0,e.jsxs)(n,{bold:m&&u===r,children:[d(r),` ${g}. ${o.label}`,o.detail?(0,e.jsx)(n,{color:t.dim,bold:!1,children:` \u2014 ${o.detail}`}):null]},o.key)));return A?(0,e.jsxs)(c,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,e.jsx)(n,{bold:!0,color:t.assuranceAccent,children:b}),T,R]}):(0,e.jsxs)(c,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,e.jsx)(n,{bold:!0,color:t.assuranceAccent,children:b}),T,(0,e.jsx)(n,{children:" "}),R]})}export{D as a,F as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as V}from"./chunk-HYTBEPC2.js";import{existsSync as R,readdirSync as D,readFileSync as S}from"fs";import{join as b}from"path";var T="--variables",E=["global","smart","environment","secrets","totp"],F=/^[a-z][a-z0-9_]*$/;function M(e){return typeof e=="string"?e.trim().length>0:typeof e=="number"&&Number.isFinite(e)}function p(e,t,n){let r=JSON.parse(e);if(!(!r||typeof r!="object")){for(let[o,i]of Object.entries(r))if(i&&typeof i=="object"&&"value"in i){let c={has_value:M(i.value),source:t};n.set(u(o),c)}}}function w(e,t){if(!R(e))return;let n;try{n=D(e).filter(r=>r.endsWith(".json")).sort()}catch{return}for(let r of n){let o=b(e,r);try{p(S(o,"utf-8"),o,t)}catch{}}}function W(e){return{globalDir:b(V,"variables"),localDir:b(e,".testmuai","variables")}}function q(e){let t=new Map;if(w(e.globalDir,t),w(e.localDir,t),e.file&&R(e.file))try{p(S(e.file,"utf-8"),e.file,t)}catch{}if(e.inline)try{p(e.inline,T,t)}catch{}return t}function m(e){let t=e.trim();if(!t)return null;let n=t.split(/[.[]/).map(r=>r.trim()).filter(Boolean);return n.length===0||E.includes(n[0])?null:n[0]}function u(e){let t=/^(?:global|secrets\.user|environment)\.(.+)$/.exec(e);return t?t[1]:e}function H(e){if(!e||!e.trim())return"variable name is empty";let t=e.split(".")[0];return E.includes(t)?`'${e}' starts with a runtime namespace (global/secrets/smart/environment/totp) \u2014 declare the bare name`:F.test(e)?null:`'${e}' is not lower_snake_case (letters, digits, underscores; starts with a letter)`}import{basename as z}from"path";var ee="objective",C=/(\\?)\{\{\s*([^{}]+?)\s*\}\}/g;function v(e){let t=[];if(!e)return t;for(let n of e.matchAll(C)){if(n[1])continue;let r=m(n[2]??"");r&&!t.includes(r)&&t.push(r)}return t}var $=/(\\?)\$\{\s*([^{}]+?)\s*\}/g;function B(e){let t=[];if(!e)return t;for(let n of e.matchAll($)){if(n[1])continue;let r=(n[2]??"").split(/[.[]/)[0]?.trim()??"";r&&!t.includes(r)&&t.push(r)}return t}function te(e,t,n){return U(e.map(({text:r,usedBy:o})=>B(r).filter(i=>!t.has(i)).map(i=>({name:i,reason:"not_a_dataset_column",dataset:n,used_by:[o]}))))}var P=/\b(?:store|save|extract|remember|capture)\b/i,Z=/\bas\s+(?:['"`]([A-Za-z_][A-Za-z0-9_]*)['"`]|([A-Za-z_][A-Za-z0-9_]*)(?=\s*(?:,|$)))/gi,J=new Set(["a","an","the"]);function I(e){let t=[];if(!e)return t;for(let n of e.split(/[.;\n]/))if(P.test(n))for(let r of n.matchAll(Z)){let o=r[1]??r[2];!o||J.has(o.toLowerCase())||t.includes(o)||t.push(o)}return t}function A(e,t,n){let r=t.get(e);return r?r.has_value?null:{name:e,reason:"value_missing",file:r.source,used_by:[n]}:{name:e,reason:"not_declared",used_by:[n]}}function re(e,t,n,r=[]){let o=new Set([...r,...I(e)]),i=[];for(let c of v(e)){if(o.has(c))continue;let l=A(c,t,n);l&&i.push(l)}return i}function ne(e,t,n={}){let r=e.rootGlobal.variables??{},o=new Set(n.produced??[]),i=n.authorFrom??0,c=[];for(let l of e.steps){let k=l.flatIndex-1>=i,f=I(l.objective);if(!k){for(let s of f)o.add(s);continue}let j={file:z(l.sourceFile),step:l.flatIndex},N=l.config.variables??{},d=new Map,_=s=>m(u(s))??u(s);for(let[s,a]of Object.entries(r))d.set(_(s),a.value);for(let[s,a]of Object.entries(N))d.set(_(s),a.value);let g=new Set,y=(s,a)=>{if(o.has(s)||f.includes(s))return;let h=d.get(s);if(h===void 0){g.add(s);return}if(a.has(s)){g.add(s);return}a.add(s);for(let O of v(h))y(O,a);a.delete(s)};for(let s of v(l.objective))y(s,new Set);let x=[];for(let s of g){let a=A(s,t,j);a&&x.push(a)}c.push(x);for(let s of f)o.add(s)}return U(c)}function se(e){let t=new Set,n=e&&typeof e=="object"?e:null;for(let r of n?.prior_runs??[])for(let o of Object.keys(r.variables??{}))t.add(o);return[...t]}function U(e){let t=new Map;for(let n of e)for(let r of n){let o=t.get(r.name);o?o.used_by.push(...r.used_by):t.set(r.name,{...r,used_by:[...r.used_by]})}return[...t.values()].sort((n,r)=>n.name<r.name?-1:1)}export{T as a,W as b,q as c,H as d,ee as e,v as f,te as g,re as h,ne as i,se as j,U as k};
2
+ import{b as V}from"./chunk-PHR2OSWD.js";import{existsSync as R,readdirSync as D,readFileSync as S}from"fs";import{join as b}from"path";var T="--variables",E=["global","smart","environment","secrets","totp"],F=/^[a-z][a-z0-9_]*$/;function M(e){return typeof e=="string"?e.trim().length>0:typeof e=="number"&&Number.isFinite(e)}function p(e,t,n){let r=JSON.parse(e);if(!(!r||typeof r!="object")){for(let[o,i]of Object.entries(r))if(i&&typeof i=="object"&&"value"in i){let c={has_value:M(i.value),source:t};n.set(u(o),c)}}}function w(e,t){if(!R(e))return;let n;try{n=D(e).filter(r=>r.endsWith(".json")).sort()}catch{return}for(let r of n){let o=b(e,r);try{p(S(o,"utf-8"),o,t)}catch{}}}function W(e){return{globalDir:b(V,"variables"),localDir:b(e,".testmuai","variables")}}function q(e){let t=new Map;if(w(e.globalDir,t),w(e.localDir,t),e.file&&R(e.file))try{p(S(e.file,"utf-8"),e.file,t)}catch{}if(e.inline)try{p(e.inline,T,t)}catch{}return t}function m(e){let t=e.trim();if(!t)return null;let n=t.split(/[.[]/).map(r=>r.trim()).filter(Boolean);return n.length===0||E.includes(n[0])?null:n[0]}function u(e){let t=/^(?:global|secrets\.user|environment)\.(.+)$/.exec(e);return t?t[1]:e}function H(e){if(!e||!e.trim())return"variable name is empty";let t=e.split(".")[0];return E.includes(t)?`'${e}' starts with a runtime namespace (global/secrets/smart/environment/totp) \u2014 declare the bare name`:F.test(e)?null:`'${e}' is not lower_snake_case (letters, digits, underscores; starts with a letter)`}import{basename as z}from"path";var ee="objective",C=/(\\?)\{\{\s*([^{}]+?)\s*\}\}/g;function v(e){let t=[];if(!e)return t;for(let n of e.matchAll(C)){if(n[1])continue;let r=m(n[2]??"");r&&!t.includes(r)&&t.push(r)}return t}var $=/(\\?)\$\{\s*([^{}]+?)\s*\}/g;function B(e){let t=[];if(!e)return t;for(let n of e.matchAll($)){if(n[1])continue;let r=(n[2]??"").split(/[.[]/)[0]?.trim()??"";r&&!t.includes(r)&&t.push(r)}return t}function te(e,t,n){return U(e.map(({text:r,usedBy:o})=>B(r).filter(i=>!t.has(i)).map(i=>({name:i,reason:"not_a_dataset_column",dataset:n,used_by:[o]}))))}var P=/\b(?:store|save|extract|remember|capture)\b/i,Z=/\bas\s+(?:['"`]([A-Za-z_][A-Za-z0-9_]*)['"`]|([A-Za-z_][A-Za-z0-9_]*)(?=\s*(?:,|$)))/gi,J=new Set(["a","an","the"]);function I(e){let t=[];if(!e)return t;for(let n of e.split(/[.;\n]/))if(P.test(n))for(let r of n.matchAll(Z)){let o=r[1]??r[2];!o||J.has(o.toLowerCase())||t.includes(o)||t.push(o)}return t}function A(e,t,n){let r=t.get(e);return r?r.has_value?null:{name:e,reason:"value_missing",file:r.source,used_by:[n]}:{name:e,reason:"not_declared",used_by:[n]}}function re(e,t,n,r=[]){let o=new Set([...r,...I(e)]),i=[];for(let c of v(e)){if(o.has(c))continue;let l=A(c,t,n);l&&i.push(l)}return i}function ne(e,t,n={}){let r=e.rootGlobal.variables??{},o=new Set(n.produced??[]),i=n.authorFrom??0,c=[];for(let l of e.steps){let k=l.flatIndex-1>=i,f=I(l.objective);if(!k){for(let s of f)o.add(s);continue}let j={file:z(l.sourceFile),step:l.flatIndex},N=l.config.variables??{},d=new Map,_=s=>m(u(s))??u(s);for(let[s,a]of Object.entries(r))d.set(_(s),a.value);for(let[s,a]of Object.entries(N))d.set(_(s),a.value);let g=new Set,y=(s,a)=>{if(o.has(s)||f.includes(s))return;let h=d.get(s);if(h===void 0){g.add(s);return}if(a.has(s)){g.add(s);return}a.add(s);for(let O of v(h))y(O,a);a.delete(s)};for(let s of v(l.objective))y(s,new Set);let x=[];for(let s of g){let a=A(s,t,j);a&&x.push(a)}c.push(x);for(let s of f)o.add(s)}return U(c)}function se(e){let t=new Set,n=e&&typeof e=="object"?e:null;for(let r of n?.prior_runs??[])for(let o of Object.keys(r.variables??{}))t.add(o);return[...t]}function U(e){let t=new Map;for(let n of e)for(let r of n){let o=t.get(r.name);o?o.used_by.push(...r.used_by):t.set(r.name,{...r,used_by:[...r.used_by]})}return[...t.values()].sort((n,r)=>n.name<r.name?-1:1)}export{T as a,W as b,q as c,H as d,ee as e,v as f,te as g,re as h,ne as i,se as j,U as k};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as B,c as S,d as T}from"./chunk-GSDXZS4U.js";import{c as g}from"./chunk-RFHMDQXZ.js";import{a as E}from"./chunk-XXE7W5AV.js";import{y as n}from"./chunk-HYTBEPC2.js";import{a as h}from"./chunk-HCBYKLMW.js";import{a as i,b as c,c as w,i as x}from"./chunk-C44QQJR4.js";import{a as L}from"./chunk-6YGTRKDT.js";import{e as u}from"./chunk-UR6MHSHU.js";var l=u(L(),1);var r=u(h(),1);function y(e){return new Map(e.map((o,s)=>[`${s}-${o.label}`,o.packPath]))}async function H(e){let o=e.deps?.viewerBase??S(e.env),s=e.deps?.startServer??B,a=e.deps?.openUrl??(m=>g(m).then(()=>{})),t=y(e.rows),d;try{d=await s({packs:t,allowedOrigins:[new URL(o).origin]});let m=d,D=async p=>{let v=[...t.keys()][p];await a(T(m.urlFor(v),o))};if(e.deps?.hold){await e.deps.hold();return}await new Promise(p=>{let v=w(l.default.createElement(P,{rows:e.rows,onOpen:D,onDone:()=>{v.unmount(),p()}}),{stdout:process.stderr,exitOnCtrlC:!1})})}finally{await d?.close()}}function I(e){return e==="passed"?n.green:e==="failed"||e==="broken"||e==="cancelled"?n.red:n.dim}var b=40,R=9,k=20;function f(e,o){return e.length>o?e.slice(0,o-1)+"\u2026":e.padEnd(o)}function O({row:e,selected:o}){let s=e.testId??e.commitId??"";return(0,r.jsxs)(i,{children:[(0,r.jsx)(i,{width:2,flexShrink:0,children:(0,r.jsx)(c,{color:n.orange,children:o?"\u25B8":" "})}),(0,r.jsx)(i,{width:2,flexShrink:0,children:(0,r.jsx)(c,{color:e.kind==="execution"?n.orange:n.muted,children:e.kind==="execution"?"\u25CF":"\u25CB"})}),(0,r.jsx)(i,{width:b,flexShrink:0,children:(0,r.jsx)(c,{color:o?n.orange:void 0,bold:o,wrap:"truncate-end",children:f(e.label,b)})}),(0,r.jsx)(i,{width:R,flexShrink:0,children:(0,r.jsx)(c,{color:I(e.status),bold:o,wrap:"truncate-end",children:f(e.status,R)})}),(0,r.jsx)(i,{width:k,flexShrink:0,children:(0,r.jsx)(c,{color:n.dim,wrap:"truncate-end",children:f(s,k)})})]})}function P(e){let[o,s]=(0,l.useState)(0);return x((a,t)=>{t.upArrow?s(d=>Math.max(0,d-1)):t.downArrow?s(d=>Math.min(e.rows.length-1,d+1)):t.return||a==="o"?e.onOpen(o):(a==="q"||t.escape)&&e.onDone()}),(0,r.jsx)(E,{title:"Evidence",borderColor:n.muted,children:(0,r.jsxs)(i,{flexDirection:"column",children:[e.rows.map((a,t)=>(0,r.jsx)(O,{row:a,selected:t===o},t)),(0,r.jsx)(i,{marginTop:1,children:(0,r.jsx)(c,{color:n.dim,children:"\u2191/\u2193 move \xB7 enter/o open \xB7 q quit"})})]})})}export{y as a,H as b};
2
+ import{b as B,c as S,d as T}from"./chunk-D2F5T3NX.js";import{c as g}from"./chunk-RFHMDQXZ.js";import{a as E}from"./chunk-5X7JIGG7.js";import{y as n}from"./chunk-PHR2OSWD.js";import{a as h}from"./chunk-HCBYKLMW.js";import{a as i,b as c,c as w,i as x}from"./chunk-C44QQJR4.js";import{a as L}from"./chunk-6YGTRKDT.js";import{e as u}from"./chunk-UR6MHSHU.js";var l=u(L(),1);var r=u(h(),1);function y(e){return new Map(e.map((o,s)=>[`${s}-${o.label}`,o.packPath]))}async function H(e){let o=e.deps?.viewerBase??S(e.env),s=e.deps?.startServer??B,a=e.deps?.openUrl??(m=>g(m).then(()=>{})),t=y(e.rows),d;try{d=await s({packs:t,allowedOrigins:[new URL(o).origin]});let m=d,D=async p=>{let v=[...t.keys()][p];await a(T(m.urlFor(v),o))};if(e.deps?.hold){await e.deps.hold();return}await new Promise(p=>{let v=w(l.default.createElement(P,{rows:e.rows,onOpen:D,onDone:()=>{v.unmount(),p()}}),{stdout:process.stderr,exitOnCtrlC:!1})})}finally{await d?.close()}}function I(e){return e==="passed"?n.green:e==="failed"||e==="broken"||e==="cancelled"?n.red:n.dim}var b=40,R=9,k=20;function f(e,o){return e.length>o?e.slice(0,o-1)+"\u2026":e.padEnd(o)}function O({row:e,selected:o}){let s=e.testId??e.commitId??"";return(0,r.jsxs)(i,{children:[(0,r.jsx)(i,{width:2,flexShrink:0,children:(0,r.jsx)(c,{color:n.orange,children:o?"\u25B8":" "})}),(0,r.jsx)(i,{width:2,flexShrink:0,children:(0,r.jsx)(c,{color:e.kind==="execution"?n.orange:n.muted,children:e.kind==="execution"?"\u25CF":"\u25CB"})}),(0,r.jsx)(i,{width:b,flexShrink:0,children:(0,r.jsx)(c,{color:o?n.orange:void 0,bold:o,wrap:"truncate-end",children:f(e.label,b)})}),(0,r.jsx)(i,{width:R,flexShrink:0,children:(0,r.jsx)(c,{color:I(e.status),bold:o,wrap:"truncate-end",children:f(e.status,R)})}),(0,r.jsx)(i,{width:k,flexShrink:0,children:(0,r.jsx)(c,{color:n.dim,wrap:"truncate-end",children:f(s,k)})})]})}function P(e){let[o,s]=(0,l.useState)(0);return x((a,t)=>{t.upArrow?s(d=>Math.max(0,d-1)):t.downArrow?s(d=>Math.min(e.rows.length-1,d+1)):t.return||a==="o"?e.onOpen(o):(a==="q"||t.escape)&&e.onDone()}),(0,r.jsx)(E,{title:"Evidence",borderColor:n.muted,children:(0,r.jsxs)(i,{flexDirection:"column",children:[e.rows.map((a,t)=>(0,r.jsx)(O,{row:a,selected:t===o},t)),(0,r.jsx)(i,{marginTop:1,children:(0,r.jsx)(c,{color:n.dim,children:"\u2191/\u2193 move \xB7 enter/o open \xB7 q quit"})})]})})}export{y as a,H as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as c}from"./chunk-EPE2ELDH.js";import{a as n}from"./chunk-RZ4F3BHX.js";import{v as s,w as a}from"./chunk-HYTBEPC2.js";import{createHash as h,randomBytes as g}from"crypto";var l=class{authBaseUrl;consentUrl;constructor(t="prod"){let e=c(t);this.authBaseUrl=e.authBaseUrl,this.consentUrl=e.consentUrl}static generatePkce(){let t=g(96).toString("base64url").slice(0,128),e=h("sha256").update(t).digest("base64url");return[t,e]}buildAuthorizationUrl(t,e,r,o){let i=new URLSearchParams({response_type:"code",client_id:t,redirect_uri:o,scope:a,code_challenge:e,code_challenge_method:"S256",state:r});return`${this.consentUrl}/oauth2?${i.toString()}`}async registerClient(t){let e=await n(`${this.authBaseUrl}/oauth2/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:s,redirect_uris:[t],grant_types:["authorization_code"],response_types:["code"],client_type:"public",application_type:"native"})});if(!e.ok)throw new Error(`DCR failed: ${e.status} ${await e.text()}`);return e.json()}async exchangeCode(t,e,r,o){let i=await n(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:t,redirect_uri:o,client_id:e,code_verifier:r})});if(!i.ok)throw new Error(`Token exchange failed: ${i.status}`);return i.json()}async refreshToken(t,e){let r=await n(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:t,client_id:e})});if(!r.ok)throw new Error(`Token refresh failed: ${r.status}`);return r.json()}async revokeToken(t,e,r="access_token"){await n(`${this.authBaseUrl}/oauth2/revoke`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,token_type_hint:r,client_id:e})})}async validateToken(t){let e=new AbortController,r=setTimeout(()=>e.abort(),1e4);try{let o=await n(`${this.authBaseUrl}/api/user`,{headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},signal:e.signal});return clearTimeout(r),o.ok}catch{return clearTimeout(r),!1}}};export{l as a};
2
+ import{a as c}from"./chunk-VIYV6NIW.js";import{a as n}from"./chunk-RZ4F3BHX.js";import{v as s,w as a}from"./chunk-PHR2OSWD.js";import{createHash as h,randomBytes as g}from"crypto";var l=class{authBaseUrl;consentUrl;constructor(t="prod"){let e=c(t);this.authBaseUrl=e.authBaseUrl,this.consentUrl=e.consentUrl}static generatePkce(){let t=g(96).toString("base64url").slice(0,128),e=h("sha256").update(t).digest("base64url");return[t,e]}buildAuthorizationUrl(t,e,r,o){let i=new URLSearchParams({response_type:"code",client_id:t,redirect_uri:o,scope:a,code_challenge:e,code_challenge_method:"S256",state:r});return`${this.consentUrl}/oauth2?${i.toString()}`}async registerClient(t){let e=await n(`${this.authBaseUrl}/oauth2/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:s,redirect_uris:[t],grant_types:["authorization_code"],response_types:["code"],client_type:"public",application_type:"native"})});if(!e.ok)throw new Error(`DCR failed: ${e.status} ${await e.text()}`);return e.json()}async exchangeCode(t,e,r,o){let i=await n(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:t,redirect_uri:o,client_id:e,code_verifier:r})});if(!i.ok)throw new Error(`Token exchange failed: ${i.status}`);return i.json()}async refreshToken(t,e){let r=await n(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:t,client_id:e})});if(!r.ok)throw new Error(`Token refresh failed: ${r.status}`);return r.json()}async revokeToken(t,e,r="access_token"){await n(`${this.authBaseUrl}/oauth2/revoke`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,token_type_hint:r,client_id:e})})}async validateToken(t){let e=new AbortController,r=setTimeout(()=>e.abort(),1e4);try{let o=await n(`${this.authBaseUrl}/api/user`,{headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},signal:e.signal});return clearTimeout(r),o.ok}catch{return clearTimeout(r),!1}}};export{l as a};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as g}from"./chunk-BPMSNGXQ.js";import{b as f,c as j}from"./chunk-VE3SUJMA.js";import{a as m}from"./chunk-EPE2ELDH.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{a as g}from"./chunk-BPMSNGXQ.js";import{b as f,c as j}from"./chunk-VE3SUJMA.js";import{a as m}from"./chunk-VIYV6NIW.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