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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (645) hide show
  1. package/dist/ChatSurface-VPD5G67Q.js +2 -0
  2. package/dist/ChromeProfilePicker-CRKQEFYD.js +2 -0
  3. package/dist/CliFeedbackPrompt-M7BMWLKK.js +2 -0
  4. package/dist/CliUploadProgress-OP7DXMC2.js +2 -0
  5. package/dist/ConfigView-XI74BCCH.js +2 -0
  6. package/dist/EvidenceViewOffer-HAAK6DS5.js +2 -0
  7. package/dist/FolderPicker-W5S6RFCP.js +2 -0
  8. package/dist/InfoBox-OWUEHV2D.js +2 -0
  9. package/dist/LinksBox-PNSESNCU.js +2 -0
  10. package/dist/ProfilesView-PYDZZHKO.js +2 -0
  11. package/dist/ProjectPicker-BGFCUGT5.js +2 -0
  12. package/dist/SaveSessionPrompt-SUJE54GS.js +2 -0
  13. package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
  14. package/dist/SingleShotApp-4TDXZEUA.js +2 -0
  15. package/dist/SummaryBox-FALOODAQ.js +2 -0
  16. package/dist/TestMdRunView-4GPRWHEU.js +2 -0
  17. package/dist/TestrunEvidenceTable-OBVQJ6IO.js +2 -0
  18. package/dist/WhoamiView-6WXGRANY.js +2 -0
  19. package/dist/{agent-parse-2MLJOJTH.js → agent-parse-CAS45UKA.js} +1 -1
  20. package/dist/app-client-U2YYF65L.js +2 -0
  21. package/dist/app-download-RXVZB6MM.js +2 -0
  22. package/dist/assurance-job-C3TXZGLL.js +7 -0
  23. package/dist/auth-7Z54TMQQ.js +2 -0
  24. package/dist/{binary-MOJTQGUV.js → binary-DJCDMGPX.js} +1 -1
  25. package/dist/bind-XVO4CQYV.js +2 -0
  26. package/dist/bootstrap-TY5RANJ7.js +2 -0
  27. package/dist/bridge-T6QMYKED.js +2 -0
  28. package/dist/build-5ZN47FAT.js +2 -0
  29. package/dist/catalog-RRQF4TCA.js +2 -0
  30. package/dist/{changelog-2N6HKKKQ.js → changelog-GBEVIUFJ.js} +1 -1
  31. package/dist/chat-committer-ZCSRJEUB.js +2 -0
  32. package/dist/chat-controller-XINCDH6Z.js +2 -0
  33. package/dist/child-G2GCW73X.js +2 -0
  34. package/dist/chunk-22PIMG52.js +2 -0
  35. package/dist/chunk-252FWF2G.js +19 -0
  36. package/dist/{chunk-AT3RME5W.js → chunk-2IZRPMZN.js} +1 -1
  37. package/dist/chunk-2NFS4KE4.js +2 -0
  38. package/dist/{chunk-LHUW5QDT.js → chunk-2OOFURWD.js} +1 -1
  39. package/dist/chunk-2OSFI33O.js +97 -0
  40. package/dist/chunk-2S3W2JT3.js +5 -0
  41. package/dist/chunk-2SWSVJUP.js +12 -0
  42. package/dist/chunk-2TVPA3LL.js +2 -0
  43. package/dist/chunk-2XW33VOK.js +2 -0
  44. package/dist/chunk-33DWJV67.js +235 -0
  45. package/dist/chunk-34R7BNZ2.js +2 -0
  46. package/dist/chunk-35ECWCCK.js +2 -0
  47. package/dist/chunk-3BSYOCSW.js +3 -0
  48. package/dist/chunk-3G2LSTK5.js +2 -0
  49. package/dist/chunk-3GXN6VF6.js +2 -0
  50. package/dist/chunk-3JLEDSG5.js +4 -0
  51. package/dist/chunk-3QICDXY5.js +5 -0
  52. package/dist/chunk-3UVSAAES.js +10 -0
  53. package/dist/chunk-42PALMW2.js +4 -0
  54. package/dist/chunk-432ZOE42.js +21 -0
  55. package/dist/chunk-44B6THYK.js +2 -0
  56. package/dist/chunk-47WQBG5I.js +6 -0
  57. package/dist/{chunk-J2FJ62K4.js → chunk-4D5PC6QE.js} +1 -1
  58. package/dist/chunk-4I7YN6YY.js +3 -0
  59. package/dist/chunk-4IEQNX7F.js +2 -0
  60. package/dist/{chunk-SYJXTB4J.js → chunk-4LPX2OLV.js} +1 -1
  61. package/dist/chunk-4LTHDJ3D.js +2 -0
  62. package/dist/chunk-4QTH7VYE.js +2 -0
  63. package/dist/chunk-54XA5MZH.js +2 -0
  64. package/dist/chunk-57MDWTON.js +2 -0
  65. package/dist/{chunk-3C32LVLX.js → chunk-5BUIIFLC.js} +1 -1
  66. package/dist/chunk-5D7ENQTQ.js +2 -0
  67. package/dist/chunk-63EKRZKI.js +2 -0
  68. package/dist/{chunk-EHN5HTUD.js → chunk-65VANXOF.js} +51 -51
  69. package/dist/chunk-672CQECV.js +47 -0
  70. package/dist/chunk-6LIC2R22.js +3 -0
  71. package/dist/chunk-6NFOH4AC.js +4 -0
  72. package/dist/chunk-6NWT2TEJ.js +2 -0
  73. package/dist/chunk-6PIIUAZF.js +3 -0
  74. package/dist/{chunk-MBJHS653.js → chunk-6U7ID777.js} +1 -1
  75. package/dist/chunk-6UVIY56J.js +2 -0
  76. package/dist/chunk-72KYMWQ5.js +2 -0
  77. package/dist/chunk-72RC7JSA.js +21 -0
  78. package/dist/chunk-74W4AOT2.js +2 -0
  79. package/dist/chunk-77ZZQJLX.js +2 -0
  80. package/dist/chunk-7DFBOVUB.js +2 -0
  81. package/dist/chunk-7EXDYXXD.js +2 -0
  82. package/dist/chunk-7HO4NX5W.js +1 -0
  83. package/dist/chunk-7KX2BHKG.js +2 -0
  84. package/dist/chunk-7LKCWO2R.js +11 -0
  85. package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
  86. package/dist/chunk-7RPKHKA3.js +2 -0
  87. package/dist/chunk-7RWP4Y3H.js +2 -0
  88. package/dist/chunk-7V4BQSSV.js +2 -0
  89. package/dist/chunk-7XBNMOH4.js +6 -0
  90. package/dist/chunk-A6TJOZ24.js +2 -0
  91. package/dist/chunk-A7RJQJNT.js +2 -0
  92. package/dist/chunk-AA674WLL.js +2 -0
  93. package/dist/chunk-AIXJYMSP.js +9 -0
  94. package/dist/chunk-AJQZ3ST5.js +8 -0
  95. package/dist/chunk-AQ2OG2EF.js +2 -0
  96. package/dist/chunk-AUJSC7PU.js +4 -0
  97. package/dist/chunk-AVI5H4UM.js +13 -0
  98. package/dist/chunk-AZLNLHUA.js +4 -0
  99. package/dist/chunk-B2HXPGIZ.js +26 -0
  100. package/dist/chunk-B7ZX5HEN.js +8 -0
  101. package/dist/{chunk-XQQHSC7G.js → chunk-BJJUKB5K.js} +1 -1
  102. package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
  103. package/dist/{chunk-TONFENRW.js → chunk-BVO4C5F2.js} +1 -1
  104. package/dist/chunk-BWXLZS5O.js +2 -0
  105. package/dist/chunk-BY65QAAN.js +4 -0
  106. package/dist/chunk-BZVNI44O.js +6 -0
  107. package/dist/chunk-C5Z7MQE6.js +2 -0
  108. package/dist/chunk-C6HI6Y3S.js +2 -0
  109. package/dist/chunk-CB4ARIHR.js +2 -0
  110. package/dist/chunk-CPBBYNL7.js +4 -0
  111. package/dist/{chunk-GFNCGN5V.js → chunk-D4FFXCX6.js} +2 -2
  112. package/dist/chunk-D756UWY2.js +6 -0
  113. package/dist/chunk-DBMW3VUN.js +4 -0
  114. package/dist/chunk-DD5TULWQ.js +34 -0
  115. package/dist/{chunk-SY4T44VC.js → chunk-DDJNYQBH.js} +1 -1
  116. package/dist/{chunk-KJIDMW6N.js → chunk-DHQ4SQWA.js} +1 -1
  117. package/dist/chunk-DNGOT65K.js +3 -0
  118. package/dist/chunk-DPGOAFKF.js +2 -0
  119. package/dist/chunk-DREQ3RAA.js +2 -0
  120. package/dist/chunk-DTUPEKEO.js +2 -0
  121. package/dist/chunk-E6KSRQXL.js +8 -0
  122. package/dist/chunk-EF47KRUK.js +2 -0
  123. package/dist/chunk-ENL4XTQ2.js +2 -0
  124. package/dist/chunk-EXFDIVNI.js +9 -0
  125. package/dist/chunk-EZN7CF45.js +4 -0
  126. package/dist/chunk-F3U6T4YD.js +22 -0
  127. package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
  128. package/dist/chunk-FFL55I2M.js +2 -0
  129. package/dist/chunk-FIP5L6LV.js +9 -0
  130. package/dist/chunk-FOJHSG5M.js +6 -0
  131. package/dist/chunk-FSYOTRMC.js +2 -0
  132. package/dist/chunk-GFLB2SHW.js +2 -0
  133. package/dist/chunk-GMTHZUZ3.js +2 -0
  134. package/dist/chunk-GRURFGBP.js +2 -0
  135. package/dist/chunk-GZFLJORM.js +2 -0
  136. package/dist/{chunk-PXHN7SFG.js → chunk-H3HHSTEK.js} +4 -4
  137. package/dist/chunk-HAW5WEKT.js +13 -0
  138. package/dist/chunk-HFJSP4KD.js +2 -0
  139. package/dist/chunk-HHW6MRU3.js +6 -0
  140. package/dist/chunk-HIUAUZNL.js +2 -0
  141. package/dist/chunk-HJLMH7ZM.js +2 -0
  142. package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
  143. package/dist/chunk-I2KOGINW.js +7 -0
  144. package/dist/chunk-I2MC6VVX.js +2 -0
  145. package/dist/chunk-I5NSJBOZ.js +2 -0
  146. package/dist/chunk-I6OQISK4.js +2 -0
  147. package/dist/chunk-IBBD36FQ.js +2 -0
  148. package/dist/chunk-IINZZ4BZ.js +2 -0
  149. package/dist/{chunk-UYI4WPNQ.js → chunk-IMDMRJQ6.js} +2 -2
  150. package/dist/chunk-IXW7FOGX.js +2 -0
  151. package/dist/chunk-IZ65ZPWY.js +3 -0
  152. package/dist/chunk-JD52IXON.js +9 -0
  153. package/dist/chunk-JGRXMTME.js +15 -0
  154. package/dist/{chunk-NBXYL2JT.js → chunk-JIRNI5TB.js} +7 -7
  155. package/dist/chunk-JNSWKGTB.js +2 -0
  156. package/dist/chunk-JPYW6U4D.js +2 -0
  157. package/dist/chunk-JQSLUGD4.js +3 -0
  158. package/dist/chunk-K45BKGB5.js +8 -0
  159. package/dist/chunk-KF4DKXSS.js +2 -0
  160. package/dist/chunk-KGNE5CIM.js +2 -0
  161. package/dist/chunk-KM3YCIDV.js +3 -0
  162. package/dist/chunk-KU3YHPWZ.js +2 -0
  163. package/dist/chunk-L4UVUFL6.js +3 -0
  164. package/dist/chunk-LCSJ7GOG.js +2 -0
  165. package/dist/chunk-LKQFG4RW.js +5 -0
  166. package/dist/chunk-LNNWCBPQ.js +2 -0
  167. package/dist/chunk-LRS5MGBY.js +3 -0
  168. package/dist/chunk-LRXBJTD4.js +4 -0
  169. package/dist/chunk-LSDJOVWW.js +6 -0
  170. package/dist/chunk-LWJRSUE2.js +2 -0
  171. package/dist/chunk-LX2I4JEH.js +2 -0
  172. package/dist/{chunk-K6VDRR3H.js → chunk-M6MBMRFR.js} +1 -1
  173. package/dist/chunk-MGNRNLBE.js +2 -0
  174. package/dist/chunk-MII3JOO3.js +4 -0
  175. package/dist/chunk-MNBGG4H3.js +16 -0
  176. package/dist/chunk-MYVKUJGS.js +2 -0
  177. package/dist/chunk-MYZHOBS4.js +2 -0
  178. package/dist/chunk-MZOIHUVX.js +27 -0
  179. package/dist/{chunk-OFRYEWZE.js → chunk-N3TCNZSX.js} +1 -1
  180. package/dist/chunk-NC7D7GOM.js +21 -0
  181. package/dist/{chunk-CLQP3DHT.js → chunk-NDEI7R4K.js} +1 -1
  182. package/dist/chunk-NFRA64NU.js +10 -0
  183. package/dist/chunk-NLZZLANH.js +4 -0
  184. package/dist/{chunk-5HOHXV2K.js → chunk-NQTYWHPB.js} +1 -1
  185. package/dist/chunk-NWBLYMH7.js +3 -0
  186. package/dist/chunk-NWD54VV5.js +2 -0
  187. package/dist/chunk-NXRF7FFS.js +2 -0
  188. package/dist/chunk-O3HHTKZ5.js +6 -0
  189. package/dist/{chunk-FPFS6OSR.js → chunk-OAKYUBD3.js} +1 -1
  190. package/dist/chunk-OEWYXCTA.js +7 -0
  191. package/dist/{chunk-BASTDR3M.js → chunk-OF7WPCTQ.js} +1 -1
  192. package/dist/chunk-OFSDB7B4.js +3 -0
  193. package/dist/chunk-OJ33Q6DU.js +2 -0
  194. package/dist/chunk-OQ5G773E.js +2 -0
  195. package/dist/chunk-OVNRRI4E.js +2 -0
  196. package/dist/{chunk-RAARDC2O.js → chunk-OZNBTSW5.js} +1 -1
  197. package/dist/chunk-P2ZQDQDB.js +2 -0
  198. package/dist/chunk-P7MSVLAH.js +6 -0
  199. package/dist/chunk-PUVMC4PX.js +26 -0
  200. package/dist/{chunk-SEEEGDVK.js → chunk-PZA3BSOE.js} +1 -1
  201. package/dist/chunk-Q3C6NDGI.js +2 -0
  202. package/dist/chunk-QCKA665H.js +2 -0
  203. package/dist/chunk-QDFY5GGO.js +5 -0
  204. package/dist/chunk-QHRUBG7J.js +2 -0
  205. package/dist/chunk-QI5RZ7LL.js +2 -0
  206. package/dist/chunk-QNLVC5ZB.js +2 -0
  207. package/dist/{chunk-DSKJ6J7Y.js → chunk-QQ4TKLWP.js} +1 -1
  208. package/dist/chunk-QS5ZJFGF.js +4 -0
  209. package/dist/chunk-QTZBVDPR.js +12 -0
  210. package/dist/chunk-QXQ7KVEN.js +2 -0
  211. package/dist/chunk-R4JUKTDO.js +2 -0
  212. package/dist/chunk-R7KXAISS.js +12 -0
  213. package/dist/chunk-RDP7GWSY.js +2 -0
  214. package/dist/chunk-REKHAN53.js +5 -0
  215. package/dist/{chunk-5RHR4DMF.js → chunk-RFEON5GN.js} +1 -1
  216. package/dist/chunk-RFIIM33J.js +2 -0
  217. package/dist/chunk-RG372DON.js +6 -0
  218. package/dist/chunk-RPRXRKKR.js +2 -0
  219. package/dist/chunk-RTVWQK7I.js +2 -0
  220. package/dist/chunk-RW3Z2HMB.js +7 -0
  221. package/dist/chunk-RX47NRSM.js +2 -0
  222. package/dist/chunk-RX6776AI.js +5 -0
  223. package/dist/chunk-S53AQU7R.js +6 -0
  224. package/dist/{chunk-HJX5PQRD.js → chunk-SA6IKFFD.js} +1 -1
  225. package/dist/{chunk-2MEQTHNI.js → chunk-SLKYD44Y.js} +1 -1
  226. package/dist/chunk-SMTBOSEJ.js +2 -0
  227. package/dist/chunk-SMXABALN.js +2 -0
  228. package/dist/chunk-SONMD3W5.js +5 -0
  229. package/dist/chunk-SWMTXMKB.js +2 -0
  230. package/dist/chunk-SXRHKXSE.js +2 -0
  231. package/dist/chunk-T3HEJASG.js +5 -0
  232. package/dist/chunk-T4AVLJCW.js +6 -0
  233. package/dist/{chunk-J6TBTWW7.js → chunk-T6K2MEWP.js} +1 -1
  234. package/dist/{chunk-D6BULK7E.js → chunk-T7H4LBFK.js} +1 -1
  235. package/dist/chunk-TNORODUF.js +2 -0
  236. package/dist/chunk-TW63WWEN.js +2 -0
  237. package/dist/chunk-UALJTPSA.js +18 -0
  238. package/dist/chunk-UAWWLLTI.js +2 -0
  239. package/dist/chunk-UEE3RZN4.js +14 -0
  240. package/dist/chunk-UTM7D4PI.js +2 -0
  241. package/dist/chunk-UUJIGOEO.js +2 -0
  242. package/dist/chunk-UYDHOHSZ.js +2 -0
  243. package/dist/chunk-V5JGXOV7.js +2 -0
  244. package/dist/chunk-V7S6S5W3.js +2 -0
  245. package/dist/{chunk-HBSYBL6J.js → chunk-VG44B5JD.js} +1 -1
  246. package/dist/chunk-VJGWVBZR.js +1 -0
  247. package/dist/chunk-VLDCHFXF.js +2 -0
  248. package/dist/chunk-VO66KP2W.js +2 -0
  249. package/dist/{chunk-D4XR7EEQ.js → chunk-VQLH63X7.js} +14 -12
  250. package/dist/chunk-VRIZDOO5.js +2 -0
  251. package/dist/chunk-VYHT2IET.js +1397 -0
  252. package/dist/chunk-VZJ6LUXX.js +2 -0
  253. package/dist/chunk-W3OVSDBN.js +29 -0
  254. package/dist/chunk-W7FLXW6Q.js +5 -0
  255. package/dist/{chunk-IEW7AW64.js → chunk-WEM3MOAL.js} +1 -1
  256. package/dist/chunk-WI7K6VKQ.js +2 -0
  257. package/dist/chunk-WMGKUERB.js +6 -0
  258. package/dist/{chunk-DFS4RMVP.js → chunk-WN5VKKJ3.js} +1 -1
  259. package/dist/chunk-WOSANGV6.js +5 -0
  260. package/dist/chunk-WYSZ6TPW.js +15 -0
  261. package/dist/chunk-XB6BJPDL.js +2 -0
  262. package/dist/{chunk-5ESGUPSR.js → chunk-XBEYWXPV.js} +1 -1
  263. package/dist/chunk-XIPKSXRQ.js +16 -0
  264. package/dist/chunk-XJ7HCXKW.js +2 -0
  265. package/dist/chunk-XMPTFXPW.js +5 -0
  266. package/dist/chunk-XZYA7DNH.js +2 -0
  267. package/dist/chunk-Y4T4SLDO.js +2 -0
  268. package/dist/chunk-Y6Y6RAY4.js +2 -0
  269. package/dist/chunk-YDPTSDIJ.js +2 -0
  270. package/dist/chunk-YDSGXB25.js +2 -0
  271. package/dist/chunk-YIKF4ERQ.js +375 -0
  272. package/dist/chunk-Z55KBMYV.js +2 -0
  273. package/dist/chunk-ZCRZFAOT.js +2 -0
  274. package/dist/chunk-ZFM77AQU.js +2 -0
  275. package/dist/{chunk-Q6F23V7L.js → chunk-ZFMRQ57Y.js} +1 -1
  276. package/dist/chunk-ZHWU6L2G.js +5 -0
  277. package/dist/chunk-ZTHYAHDN.js +17 -0
  278. package/dist/chunk-ZZP5SHUV.js +3 -0
  279. package/dist/committer-JGY66PFM.js +2 -0
  280. package/dist/config-5ZOALGKE.js +2 -0
  281. package/dist/controller-client-PB3AZAGG.js +2 -0
  282. package/dist/cover-cmd-UA2SVIZZ.js +2 -0
  283. package/dist/{credentials-PSQWWFGD.js → credentials-MRG452Y6.js} +1 -1
  284. package/dist/{deps-bundle-PPOQHJTB.js → deps-bundle-FWINW4XM.js} +1 -1
  285. package/dist/{deps-resolve-AX6ZAKLH.js → deps-resolve-IET4KIBO.js} +1 -1
  286. package/dist/descriptor-7T32VRMB.js +2 -0
  287. package/dist/design-chat-MM5PJD2N.js +2 -0
  288. package/dist/design-committer-TRYP3LOZ.js +2 -0
  289. package/dist/design-headless-FZONCKHW.js +2 -0
  290. package/dist/design-remote-SPVRIY2H.js +3 -0
  291. package/dist/device-env-LXJ65AVF.js +2 -0
  292. package/dist/dispatch-DVQ3H7EJ.js +2 -0
  293. package/dist/doctor-VAX2BWQF.js +2 -0
  294. package/dist/docx-convert-6IZO5P5K.js +2 -0
  295. package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
  296. package/dist/evidence-LVVK7ROT.js +2 -0
  297. package/dist/evidence-presentation-YYTIDCBS.js +2 -0
  298. package/dist/evolve-cmd-AGRKG7T3.js +2 -0
  299. package/dist/evolve-remote-BGHULJTL.js +2 -0
  300. package/dist/{exit-manager-ZLDO54S4.js → exit-manager-EDHCETUN.js} +1 -1
  301. package/dist/explain-DGJ5T6V5.js +2 -0
  302. package/dist/explain-cmd-VYAANFFZ.js +4 -0
  303. package/dist/explain-cmd-WOBGS6KX.js +12 -0
  304. package/dist/explore-LOKNOVNP.js +2 -0
  305. package/dist/explore-context-tty-JTZVZFOE.js +2 -0
  306. package/dist/explore-entry-5OGNLFAU.js +6 -0
  307. package/dist/explore-live-2XZHUYFS.js +5 -0
  308. package/dist/explore-run-tty-LGTIK2NA.js +5 -0
  309. package/dist/extract-bind-NM2BBK4I.js +14 -0
  310. package/dist/extract-chat-HLQMJJIC.js +2 -0
  311. package/dist/extract-cmd-T2TSAC3N.js +6 -0
  312. package/dist/extract-headless-OQTQ3FJK.js +2 -0
  313. package/dist/feeder-NY45UFJK.js +2 -0
  314. package/dist/folder-flags-WXUR6OPJ.js +2 -0
  315. package/dist/gaps-cmd-PTSKPTF7.js +3 -0
  316. package/dist/gate-P57VP4E5.js +2 -0
  317. package/dist/gate-WISOUTHQ.js +2 -0
  318. package/dist/{generate-headless-TEDHS3F2.js → generate-headless-JYZP6VXZ.js} +3 -3
  319. package/dist/headless-io-FFM5T6KL.js +2 -0
  320. package/dist/hold-passthrough-IOWPVB4W.js +2 -0
  321. package/dist/identity-HL5CJJXR.js +2 -0
  322. package/dist/index.js +194 -175
  323. package/dist/ingest-PDGS5ZTL.js +2 -0
  324. package/dist/ingest-cmd-LHCBMO4Z.js +8 -0
  325. package/dist/ingest-remote-D5TO5JQP.js +2 -0
  326. package/dist/ink-screen-RZ7QDIUI.js +2 -0
  327. package/dist/install-Z6K2D2VY.js +2 -0
  328. package/dist/interactive-bind-5EJQUGKI.js +26 -0
  329. package/dist/interactive-remote-D77ULJGL.js +65 -0
  330. package/dist/interrupt-guard-QETBPINI.js +2 -0
  331. package/dist/lane-AQYRIW24.js +2 -0
  332. package/dist/lattice-auth-74XGF77Y.js +2 -0
  333. package/dist/lifecycle-cmd-7SM6UCMH.js +2 -0
  334. package/dist/list-cmd-Z6FZXMFU.js +3 -0
  335. package/dist/list-commands-CZYZ7GIG.js +2 -0
  336. package/dist/list-remote-WOPOC6KK.js +15 -0
  337. package/dist/locks-cmd-JJ2QNTNY.js +2 -0
  338. package/dist/logical-ids-RXAQJZ3T.js +2 -0
  339. package/dist/login-flow-2FZEOVHM.js +2 -0
  340. package/dist/maintenance-cmd-VRTGZVRE.js +2 -0
  341. package/dist/mobile-prompts-KNAHU64X.js +2 -0
  342. package/dist/{next-KZXH4UA4.js → next-O6SUSX3R.js} +1 -1
  343. package/dist/{objective-variable-gate-JALOH6SL.js → objective-variable-gate-3Z7DNVVC.js} +1 -1
  344. package/dist/onboarding-LGT6PMDZ.js +5 -0
  345. package/dist/open-provider-OZAG6WZS.js +2 -0
  346. package/dist/{paths-JCYX6UWL.js → paths-UMIX3RJF.js} +1 -1
  347. package/dist/pdf-convert-447ACUB3.js +2 -0
  348. package/dist/persist-recorded-session-BX7II5P7.js +3 -0
  349. package/dist/phase-seed-LCJ4WSYV.js +2 -0
  350. package/dist/pipeline-IXVTVRS5.js +2 -0
  351. package/dist/prepare-target-ULMKVKMC.js +2 -0
  352. package/dist/pull-cmd-6AL2WYHB.js +2 -0
  353. package/dist/pull-route-TTVARJMV.js +2 -0
  354. package/dist/readmodel-INMP6MNW.js +2 -0
  355. package/dist/real-device-run-2LFS5WE2.js +2 -0
  356. package/dist/reconcile-cmd-R6H37SQR.js +5 -0
  357. package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
  358. package/dist/reconcile-remote-GWDV5CUT.js +13 -0
  359. package/dist/recording-banner-ACC67Q2U.js +2 -0
  360. package/dist/registry-6IJYQXQC.js +2 -0
  361. package/dist/remote-entry-YL7O2NJQ.js +2 -0
  362. package/dist/remote-mode-7G6PLJCW.js +4 -0
  363. package/dist/remote-words-45USLRVN.js +2 -0
  364. package/dist/require-project-folder-A3UDRELU.js +2 -0
  365. package/dist/resolve-run-intent-ZGPSUBXV.js +2 -0
  366. package/dist/resolver-IPM6R7U4.js +2 -0
  367. package/dist/revert-FHOBLZWF.js +2 -0
  368. package/dist/review-cmd-NNT5C5RZ.js +5 -0
  369. package/dist/run-5RQUCNYP.js +2 -0
  370. package/dist/run-PC5YO4AS.js +2 -0
  371. package/dist/run-channel-63SVP5OI.js +2 -0
  372. package/dist/run-remote-3AYYVPKX.js +2 -0
  373. package/dist/run-startup-gate-NKRMKYBB.js +2 -0
  374. package/dist/run-test-md-HE6DUWQR.js +17 -0
  375. package/dist/scrollback-GGNBDFQV.js +2 -0
  376. package/dist/session-target-DD53UXO7.js +2 -0
  377. package/dist/session-worker.js +12 -0
  378. package/dist/sessions-CFV7FOIT.js +2 -0
  379. package/dist/sessions-cmd-GYMETJHG.js +26 -0
  380. package/dist/sessions-remote-GI7GOBMH.js +3 -0
  381. package/dist/shell-arg-FN3MT5U7.js +2 -0
  382. package/dist/{skill-installer-T2IOCPET.js → skill-installer-3QAVQGDH.js} +1 -1
  383. package/dist/spawner-C7NLLM4F.js +2 -0
  384. package/dist/store-X6XPFSKF.js +2 -0
  385. package/dist/store-choice-RT73HAI7.js +2 -0
  386. package/dist/store-guard-SNWKLHQV.js +2 -0
  387. package/dist/store-id-YZ5WKJ25.js +2 -0
  388. package/dist/store-site-KA2DNBGY.js +2 -0
  389. package/dist/stream-warnings-GEQKKJU7.js +2 -0
  390. package/dist/structured-answers-EQ2AP3F7.js +2 -0
  391. package/dist/sync-cmd-NBPPDG3B.js +2 -0
  392. package/dist/sync-setup-5NUCH6N3.js +2 -0
  393. package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
  394. package/dist/tcg-generate-Z23CUISY.js +2 -0
  395. package/dist/test-definition-VRI4YIYL.js +2 -0
  396. package/dist/testmd-actions-GH5BW5V5.js +2 -0
  397. package/dist/testmd-sync-ACKCIOL3.js +2 -0
  398. package/dist/tms-client-NXAB6VJD.js +2 -0
  399. package/dist/token-refresh-4UCYAG6A.js +2 -0
  400. package/dist/trust-gate-AT2XBWN4.js +2 -0
  401. package/dist/turn-preflight-LHYLRL7G.js +2 -0
  402. package/dist/ui-SNV3FD2G.js +4 -0
  403. package/dist/use-case-ref-NE4X4MZN.js +2 -0
  404. package/dist/validate-basic-RE2WLIGQ.js +2 -0
  405. package/dist/{variable-receipt-F55CSW5Z.js → variable-receipt-BXSZO36E.js} +1 -1
  406. package/dist/verdicts-XK3GAUX3.js +2 -0
  407. package/dist/version-check-4FJVZP3K.js +2 -0
  408. package/dist/{view-cmd-ELDKYRMZ.js → view-cmd-N47BQZPD.js} +4 -3
  409. package/dist/walk-session-DA7QWXSW.js +2 -0
  410. package/dist/with-telemetry-7V4LY2BG.js +2 -0
  411. package/package.json +11 -11
  412. package/dist/ChatSurface-GBZX4LWL.js +0 -8
  413. package/dist/ChromeProfilePicker-UONX2UVC.js +0 -2
  414. package/dist/CliFeedbackPrompt-6BJCNRNG.js +0 -2
  415. package/dist/CliUploadProgress-K4Z22DSY.js +0 -2
  416. package/dist/ConfigView-BB22G7JO.js +0 -2
  417. package/dist/EvidenceViewOffer-25IQF3TX.js +0 -2
  418. package/dist/FolderPicker-65JFR2NW.js +0 -2
  419. package/dist/InfoBox-OU5PLRIL.js +0 -2
  420. package/dist/LinksBox-DH7TSUXW.js +0 -2
  421. package/dist/ProfilesView-MGJKBOF5.js +0 -2
  422. package/dist/ProjectPicker-YFV6K77F.js +0 -2
  423. package/dist/SaveSessionPrompt-64QKQB6B.js +0 -2
  424. package/dist/ScrollbackTap-QHJOFYMC.js +0 -2
  425. package/dist/SingleShotApp-VYKUCRVW.js +0 -2
  426. package/dist/SummaryBox-DGS3LVRF.js +0 -2
  427. package/dist/TestMdRunView-LKAITAA4.js +0 -2
  428. package/dist/TestrunEvidenceTable-PHBAB4XQ.js +0 -2
  429. package/dist/WhoamiView-6HWPYN6Y.js +0 -2
  430. package/dist/app-client-ZCCNE3RV.js +0 -2
  431. package/dist/app-download-SQ2LYYL7.js +0 -2
  432. package/dist/auth-NWBIFCB7.js +0 -2
  433. package/dist/bind-S3IQTPNN.js +0 -15
  434. package/dist/bootstrap-RCV7PNMQ.js +0 -2
  435. package/dist/bridge-O7ENTV4K.js +0 -2
  436. package/dist/build-JIKYOZUH.js +0 -2
  437. package/dist/chat-committer-6D7AQI6Z.js +0 -2
  438. package/dist/chat-controller-UJQ6Z4RE.js +0 -2
  439. package/dist/chunk-2A7OQRAD.js +0 -17
  440. package/dist/chunk-2FH4HJYB.js +0 -5
  441. package/dist/chunk-2KVECC36.js +0 -2
  442. package/dist/chunk-2YEHV2CX.js +0 -2
  443. package/dist/chunk-3OKX64UR.js +0 -2
  444. package/dist/chunk-3UI5VTQS.js +0 -4
  445. package/dist/chunk-3UMVRJX3.js +0 -6
  446. package/dist/chunk-3VAU3PNU.js +0 -2
  447. package/dist/chunk-5EOX4MEY.js +0 -2
  448. package/dist/chunk-5LJRZI7S.js +0 -6
  449. package/dist/chunk-5UHY3PTQ.js +0 -3
  450. package/dist/chunk-5ZFOKYFB.js +0 -5
  451. package/dist/chunk-63DYVWNX.js +0 -2
  452. package/dist/chunk-6YZ3VP3E.js +0 -2
  453. package/dist/chunk-7KRY26OF.js +0 -4
  454. package/dist/chunk-7N6OCHPC.js +0 -7
  455. package/dist/chunk-A2SQD2AY.js +0 -4
  456. package/dist/chunk-AACQE24F.js +0 -2
  457. package/dist/chunk-AGDPEZXT.js +0 -4
  458. package/dist/chunk-AIK7BAME.js +0 -8
  459. package/dist/chunk-ATYXPCM6.js +0 -6
  460. package/dist/chunk-AXTPNZPX.js +0 -2
  461. package/dist/chunk-BB2W35TW.js +0 -2
  462. package/dist/chunk-BKM2LWU2.js +0 -3
  463. package/dist/chunk-BL5QHONU.js +0 -2
  464. package/dist/chunk-C44QQJR4.js +0 -239
  465. package/dist/chunk-C7NWWGLT.js +0 -6
  466. package/dist/chunk-CAJZQQ3G.js +0 -3
  467. package/dist/chunk-CSVPZ33X.js +0 -2
  468. package/dist/chunk-CXF6AZWY.js +0 -2
  469. package/dist/chunk-D6E6KRVX.js +0 -2
  470. package/dist/chunk-D7WG7SRA.js +0 -2
  471. package/dist/chunk-DDHGEJJP.js +0 -2
  472. package/dist/chunk-DUYRCVI5.js +0 -2
  473. package/dist/chunk-DWHF5HUD.js +0 -2
  474. package/dist/chunk-EM3PU2YW.js +0 -2
  475. package/dist/chunk-EVFFDODK.js +0 -5
  476. package/dist/chunk-EYOCNMUM.js +0 -2
  477. package/dist/chunk-F2OBORCG.js +0 -2
  478. package/dist/chunk-FMBPUXWL.js +0 -8
  479. package/dist/chunk-FORNRNHU.js +0 -2
  480. package/dist/chunk-FQJOWUEN.js +0 -2
  481. package/dist/chunk-FQNQVC5O.js +0 -5
  482. package/dist/chunk-FY7TCYPK.js +0 -6
  483. package/dist/chunk-HJGVM6TS.js +0 -370
  484. package/dist/chunk-HPHETGRE.js +0 -2
  485. package/dist/chunk-I7TIGB7K.js +0 -2
  486. package/dist/chunk-IGHK2ENL.js +0 -2
  487. package/dist/chunk-IICT4VOU.js +0 -2
  488. package/dist/chunk-IIDBLJ5A.js +0 -18
  489. package/dist/chunk-JFZA4UON.js +0 -9
  490. package/dist/chunk-K2UJYY2U.js +0 -2
  491. package/dist/chunk-KBM3XHAM.js +0 -2
  492. package/dist/chunk-KDNNMU7Q.js +0 -4
  493. package/dist/chunk-KJQNAOOE.js +0 -6
  494. package/dist/chunk-LF42V6P6.js +0 -7
  495. package/dist/chunk-LNFU4JZ7.js +0 -2
  496. package/dist/chunk-LNSBC32V.js +0 -2
  497. package/dist/chunk-LSDWPG6C.js +0 -2
  498. package/dist/chunk-MKMJOMLX.js +0 -8
  499. package/dist/chunk-MKQ7ZRDW.js +0 -2
  500. package/dist/chunk-MSGW4JDG.js +0 -2
  501. package/dist/chunk-MV3Q335C.js +0 -7
  502. package/dist/chunk-MWIE6LOZ.js +0 -4
  503. package/dist/chunk-MZ7W4WLF.js +0 -4
  504. package/dist/chunk-NIFJJX6N.js +0 -12
  505. package/dist/chunk-NJ4BXZBX.js +0 -2
  506. package/dist/chunk-NLCCBXXV.js +0 -2
  507. package/dist/chunk-ODU2JSMA.js +0 -8
  508. package/dist/chunk-OYKRCDT4.js +0 -15
  509. package/dist/chunk-Q2F5QB2W.js +0 -2
  510. package/dist/chunk-Q4YYAN6E.js +0 -2
  511. package/dist/chunk-Q6AHSGOE.js +0 -5
  512. package/dist/chunk-QAG67DUT.js +0 -2
  513. package/dist/chunk-QGXVQIN5.js +0 -27
  514. package/dist/chunk-QQCEP3QP.js +0 -2
  515. package/dist/chunk-QU7P7B3W.js +0 -4
  516. package/dist/chunk-RAPV3BTA.js +0 -98
  517. package/dist/chunk-RD72POF2.js +0 -2
  518. package/dist/chunk-RDHWNSDP.js +0 -7
  519. package/dist/chunk-RGRFL7XG.js +0 -29
  520. package/dist/chunk-RKXHVP2Z.js +0 -2
  521. package/dist/chunk-RMVASIVL.js +0 -35
  522. package/dist/chunk-RRY5IXOB.js +0 -2
  523. package/dist/chunk-RSSOJ3L2.js +0 -21
  524. package/dist/chunk-SB2SKN34.js +0 -2
  525. package/dist/chunk-SFFDVF3J.js +0 -9
  526. package/dist/chunk-T2ONUKTL.js +0 -5
  527. package/dist/chunk-TAOHYWEO.js +0 -2
  528. package/dist/chunk-U6OTFMIT.js +0 -4
  529. package/dist/chunk-UD7KKHPW.js +0 -5
  530. package/dist/chunk-UF4MU2AZ.js +0 -22
  531. package/dist/chunk-UQSVO7TY.js +0 -9
  532. package/dist/chunk-URWWROLS.js +0 -9
  533. package/dist/chunk-V4B5QA3U.js +0 -4
  534. package/dist/chunk-VACHFCNC.js +0 -21
  535. package/dist/chunk-VAN7ECN6.js +0 -2
  536. package/dist/chunk-VIO7CCFW.js +0 -5
  537. package/dist/chunk-VOYMN2WQ.js +0 -5
  538. package/dist/chunk-VVOKM2VO.js +0 -2
  539. package/dist/chunk-W5TTF7GB.js +0 -6
  540. package/dist/chunk-WESMQEPO.js +0 -2
  541. package/dist/chunk-WICJY6KL.js +0 -6
  542. package/dist/chunk-WJR2FU7S.js +0 -16
  543. package/dist/chunk-WVHMPIDQ.js +0 -2
  544. package/dist/chunk-X4NUVVCJ.js +0 -26
  545. package/dist/chunk-XLSOQLVT.js +0 -2
  546. package/dist/chunk-YCCUBQY4.js +0 -2
  547. package/dist/chunk-YFQGOOF7.js +0 -2
  548. package/dist/chunk-YI3H2UIB.js +0 -2
  549. package/dist/chunk-YKTYVJBN.js +0 -3
  550. package/dist/chunk-YLQHY4A7.js +0 -2
  551. package/dist/chunk-ZIHG6EKH.js +0 -2
  552. package/dist/chunk-ZKSN2SJ7.js +0 -2
  553. package/dist/chunk-ZLWURCJ7.js +0 -2
  554. package/dist/committer-2QPBANRD.js +0 -2
  555. package/dist/config-7E4NS553.js +0 -2
  556. package/dist/controller-client-ZF5IXRUV.js +0 -2
  557. package/dist/cover-cmd-6KZX46S2.js +0 -3
  558. package/dist/descriptor-3JJUOHBM.js +0 -2
  559. package/dist/design-committer-D44GSUXY.js +0 -2
  560. package/dist/device-env-TZQDB5T3.js +0 -2
  561. package/dist/dispatch-KMWEDMKE.js +0 -2
  562. package/dist/doctor-XDF3MA4W.js +0 -2
  563. package/dist/docx-convert-SQRTF7XS.js +0 -2
  564. package/dist/evidence-EUIDOVOR.js +0 -2
  565. package/dist/evidence-presentation-XF23B7F2.js +0 -2
  566. package/dist/evolve-cmd-QVTGTCJ5.js +0 -2
  567. package/dist/explain-NEFBUX5G.js +0 -2
  568. package/dist/explain-cmd-36SVSHU7.js +0 -9
  569. package/dist/explain-cmd-JAOHSI4F.js +0 -3
  570. package/dist/extract-bind-PLMSZKLZ.js +0 -14
  571. package/dist/extract-cmd-RJBHPPF3.js +0 -5
  572. package/dist/feeder-66TUPB2R.js +0 -2
  573. package/dist/gaps-cmd-3WZPDDYS.js +0 -3
  574. package/dist/gate-OYRDJMF6.js +0 -2
  575. package/dist/headless-io-75HUMWZB.js +0 -2
  576. package/dist/identity-ADZ4PAJF.js +0 -2
  577. package/dist/ingest-OSNNM3DH.js +0 -2
  578. package/dist/ingest-cmd-JDIOPJBN.js +0 -2
  579. package/dist/install-Y3VKFBK3.js +0 -2
  580. package/dist/interactive-bind-XUMKEGAN.js +0 -26
  581. package/dist/interrupt-guard-UREUWNRL.js +0 -2
  582. package/dist/lifecycle-cmd-FBDRFIOE.js +0 -2
  583. package/dist/list-cmd-TFUACRAM.js +0 -3
  584. package/dist/list-commands-OHIQFJGQ.js +0 -2
  585. package/dist/locks-cmd-67OHQZNV.js +0 -2
  586. package/dist/logical-ids-GLVM2SVR.js +0 -2
  587. package/dist/login-flow-OHNKSVYZ.js +0 -2
  588. package/dist/maintenance-cmd-7OSUIDL4.js +0 -2
  589. package/dist/mobile-prompts-DEVUZRG3.js +0 -2
  590. package/dist/open-provider-746LLSEO.js +0 -2
  591. package/dist/pdf-convert-RLXSXFWN.js +0 -2
  592. package/dist/persist-recorded-session-GPP6UKN6.js +0 -3
  593. package/dist/phase-seed-MKHEWUN6.js +0 -2
  594. package/dist/pipeline-QPTPZVUJ.js +0 -2
  595. package/dist/prepare-target-N7QRNYOS.js +0 -2
  596. package/dist/readmodel-FVLRQWZ7.js +0 -2
  597. package/dist/reconcile-cmd-SMGLHMLF.js +0 -2
  598. package/dist/reconcile-deps-DVIJK5UZ.js +0 -4
  599. package/dist/reconcile-engine-KL2J5SNQ.js +0 -2
  600. package/dist/recording-banner-TCFFB6KE.js +0 -2
  601. package/dist/records-LMCVKPE5.js +0 -2
  602. package/dist/registry-BFFA4YJK.js +0 -2
  603. package/dist/require-project-folder-2224ZMJ5.js +0 -2
  604. package/dist/resolve-run-intent-HFXGEOYK.js +0 -2
  605. package/dist/resolver-GJR2Z7JY.js +0 -2
  606. package/dist/revert-NOUECRW4.js +0 -2
  607. package/dist/review-cmd-CQE6SBZA.js +0 -5
  608. package/dist/run-BXKWDJFJ.js +0 -2
  609. package/dist/run-HSP2MZPU.js +0 -2
  610. package/dist/run-channel-RGH4WIQX.js +0 -2
  611. package/dist/run-test-md-2ELPAASM.js +0 -17
  612. package/dist/scrollback-JLPJR25X.js +0 -2
  613. package/dist/session-items-2ATN7VXG.js +0 -2
  614. package/dist/session-target-UWROGOCY.js +0 -2
  615. package/dist/sessions-NH7WQWMX.js +0 -2
  616. package/dist/sessions-cmd-IV25N2L7.js +0 -25
  617. package/dist/spawner-HQM2757J.js +0 -2
  618. package/dist/store-guard-NAW26EEQ.js +0 -2
  619. package/dist/store-id-EOSGEKVK.js +0 -2
  620. package/dist/structured-answers-ZI2B6JJE.js +0 -2
  621. package/dist/sync-cmd-Q6ZYEVWI.js +0 -2
  622. package/dist/sync-setup-CA362C5S.js +0 -2
  623. package/dist/tcg-generate-CDB2N5LD.js +0 -2
  624. package/dist/testmd-actions-BDWDE2TG.js +0 -2
  625. package/dist/testmd-sync-EPTUVJYJ.js +0 -2
  626. package/dist/tms-client-KU6HCA23.js +0 -2
  627. package/dist/token-refresh-TKBOHXSD.js +0 -2
  628. package/dist/trust-gate-EX7R2P4Y.js +0 -2
  629. package/dist/turn-preflight-JGYT7LXP.js +0 -2
  630. package/dist/ui-JEJGTURD.js +0 -4
  631. package/dist/validate-basic-V7R4RH5M.js +0 -2
  632. package/dist/verdicts-7IUZFXB4.js +0 -2
  633. package/dist/version-check-PUUSB7AY.js +0 -2
  634. package/dist/walk-session-EGIMA4VG.js +0 -2
  635. package/dist/with-telemetry-LRWWBISP.js +0 -2
  636. /package/dist/{chunk-BKHXPBWN.js → chunk-2RUSXQ3O.js} +0 -0
  637. /package/dist/{chunk-6J5T5FEY.js → chunk-3AGP2BVN.js} +0 -0
  638. /package/dist/{chunk-CH273NAE.js → chunk-73Y6T2UK.js} +0 -0
  639. /package/dist/{chunk-ZMNJBUAO.js → chunk-73ZFOJOK.js} +0 -0
  640. /package/dist/{chunk-N2P4MI32.js → chunk-FWGUISUG.js} +0 -0
  641. /package/dist/{chunk-UJZZDPDY.js → chunk-HD6NR44L.js} +0 -0
  642. /package/dist/{chunk-LDPLJFCV.js → chunk-I6S6DZ2E.js} +0 -0
  643. /package/dist/{chunk-427OQS2N.js → chunk-LD5B3QFW.js} +0 -0
  644. /package/dist/{chunk-2UIHS2FH.js → chunk-PGESS7BW.js} +0 -0
  645. /package/dist/{chunk-BZAGVBCX.js → chunk-ZCIWQHCO.js} +0 -0
@@ -0,0 +1,17 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as W,b as H}from"./chunk-PGESS7BW.js";import{a as G}from"./chunk-FWGUISUG.js";import{a as se,b as ae,c as ce,d as ue,e as le,q as U}from"./chunk-AZLNLHUA.js";import{a as xe}from"./chunk-DPGOAFKF.js";import{b as V}from"./chunk-ZFM77AQU.js";import{M as F,j as D,k as N}from"./chunk-UEE3RZN4.js";import{g as Ue,m as v}from"./chunk-4I7YN6YY.js";var A="https://integrations.lambdatest.com",y=class extends Error{constructor(t,r){super(r);this.code=t;this.name="LisError"}};function Nt(e){let n=e.TESTMUAI_ENV==="stage"?"stage":"prod";return`${Ue().authEnvironments[n].shareApiBaseUrl}/lis/api/v1`}function Pt(e){let n=e.env??process.env,t=e.auth?.TESTMUAI_BASIC_AUTH||n.TESTMUAI_BASIC_AUTH;if(t)return{authorization:`Basic ${t}`};let r=e.auth?.TESTMUAI_API_KEY||n.TESTMUAI_API_KEY;return r?{authorization:`Bearer ${r}`}:{}}function C(e){let n=e.split(`
3
+ `,1)[0].replace(/[\u0000-\u001f\u007f-\u009f]/g,"");return n.length>200?`${n.slice(0,200)}\u2026`:n}function Tt(e,n,t="the issue"){return e===401||e===403?new y("LIS_AUTH",v().text("LIS_AUTH",{})):e>=500?new y("LIS_UNAVAILABLE",`the integrations service returned an error (HTTP ${e}) \u2014 retry later`):new y("JIRA_ISSUE_UNAVAILABLE",`could not fetch ${t}: ${C(n)||`HTTP ${e}`}`)}function P(e){try{return JSON.parse(e.bytes.toString("utf8"))}catch{throw new y("LIS_UNAVAILABLE","the integrations service returned a malformed response \u2014 retry later")}}function be(e){try{return JSON.parse(e.bytes.toString("utf8"))}catch{return{}}}function Be(e){return be(e).code}function R(e,n="the issue",t="Atlassian"){let r=be(e),i=t==="Atlassian"?"Confluence":t;switch(r.code){case"TOKEN_EXPIRED":return new y("LIS_SETUP",`your ${t} connection needs a resync \u2014 reconnect at ${A} and retry`);case"NOT_INSTALLED":return new y("LIS_SETUP",`no ${t} connection for this account \u2014 create one at ${A} and retry`);case"SCOPE_MISSING":return new y("LIS_SETUP",`the connection has no ${i} access \u2014 reconnect with ${i} at ${A} and retry`);case"FORBIDDEN":return new y("LIS_FORBIDDEN",`you don't have access to ${n}`);case"NOT_FOUND":return new y("JIRA_ISSUE_UNAVAILABLE",`could not fetch ${n}: ${C(r.message??"")||"not found"}`);case"PAYLOAD_TOO_LARGE":return new y("ATTACHMENT_TOO_LARGE","the attachment exceeds the integrations service's size cap");case"INVALID_PAYLOAD":return new y("LIS_UNAVAILABLE",`the integrations service rejected the request (${C(r.message??"")||"invalid payload"}) \u2014 retry later`);case"NOT_SUPPORTED":return new y("LIS_UNAVAILABLE","the integrations service does not support this operation yet");case"UPSTREAM_ERROR":case"UPSTREAM_TIMEOUT":return new y("LIS_UNAVAILABLE",`${t} is not responding through the integrations service \u2014 retry later`);default:return Tt(e.status,r.message??"",n)}}var Dt=3e4,Ut=5;async function k(e,n,t){let r=t.env??process.env,i=t.fetchImpl??fetch;for(let o=0;;o++){let u=new AbortController,l=setTimeout(()=>u.abort(),Dt);try{let s=await i(`${Nt(r)}${e}`,{...n,headers:{"content-type":"application/json",...Pt(t),...n.headers??{}},signal:u.signal}),c=await Promise.race([s.arrayBuffer(),new Promise((f,p)=>{u.signal.addEventListener("abort",()=>p(new DOMException("aborted","AbortError")),{once:!0})})]),a={status:s.status,ok:s.ok,headers:s.headers,bytes:Buffer.from(c)};if(a.status===429){if(o>0)throw new y("LIS_RATE_LIMITED","the integrations service is busy \u2014 try again in a moment");let f=be(a).data?.retry_after_sec,p=Math.min(Math.max(typeof f=="number"&&Number.isFinite(f)?f:1,0),Ut);clearTimeout(l),await new Promise(h=>setTimeout(h,p*1e3));continue}return a}catch(s){throw s instanceof y?s:u.signal.aborted?new y("LIS_UNAVAILABLE","the integrations service did not respond within 30 seconds \u2014 retry later"):new y("LIS_UNAVAILABLE",`could not reach the integrations service (${C(s instanceof Error?s.message:String(s))}) \u2014 check your connection and retry`)}finally{clearTimeout(l)}}}function Y(e){let n=e.headers.get("content-type")??"application/octet-stream";if(n.includes("json"))try{let t=JSON.parse(e.bytes.toString("utf8")),r=t.content??t.data?.content;if(typeof r=="string")return{bytes:Buffer.from(r,"base64"),mediaType:t.mime_type??t.data?.mime_type??"application/octet-stream"}}catch{}return{bytes:e.bytes,mediaType:n}}async function q(e={}){let n=await k("/jira/info",{method:"GET"},e);if(!n.ok)throw R(n);let t=P(n),r=(t.data?.SELECTED_PROJECTS??[]).map(i=>i?.key).filter(i=>typeof i=="string"&&i.length>0);return{installed:t.data?.INSTALLED==="YES",selectAll:t.data?.SELECT_ALL===!0,selectedProjects:r,capabilities:{document:t.data?.capabilities?.document===!0,comments:t.data?.capabilities?.comments===!0}}}async function Q(e,n={}){let t=await k("/jira/issue?details=true",{method:"POST",body:JSON.stringify({plugin_code:"jira",issueKey:e})},n);if(!t.ok)throw R(t);let r=P(t);if(r.type==="error"||!r.data)throw new y("JIRA_ISSUE_UNAVAILABLE",`could not fetch the issue: ${C(r.message??"")||"issue not found or not accessible"}`);return r.data}var je=100,xt=5e3,Bt=60;async function ee(e,n={}){let t=[],r=new Set,i=null,o=0;for(let u=0;;u++){if(u>=Bt)throw new y("LIS_UNAVAILABLE","the integrations service kept returning comment pages without finishing \u2014 retry later");let l=await k("/jira/issue/comments",{method:"POST",body:JSON.stringify({resource_id:e,max_results:je,cursor:i,start_at:o,order_by:"created",fetch_all:!1})},n);if(!l.ok)throw R(l,"the issue's comments");let s=P(l);if(s.type==="error"||!s.data)throw new y("JIRA_ISSUE_UNAVAILABLE",`could not fetch the issue's comments: ${C(s.message??"")||"unavailable"}`);for(let g of s.data.comments??[]){let d=String(g.id);r.has(d)||(r.add(d),t.push(g))}let c=s.data.pagination;if(!c?.has_more)return t;if(t.length>=xt)throw new y("JIRA_ISSUE_UNAVAILABLE","the issue has more comments than can be ingested \u2014 cannot build a complete identity");let a=c.next_cursor??null,f=c.next_start_at!=null,p=f?c.next_start_at:o+je;if(!(a!=null&&a!==i||a==null&&f&&p!==o))throw new y("LIS_UNAVAILABLE","the integrations service returned a non-advancing comments page \u2014 retry later");i=a,o=p}}async function te(e,n={}){let t=await k("/jira/attachment",{method:"POST",body:JSON.stringify({attachment_id:e})},n);if(!t.ok){if(Be(t)===void 0){if(t.status===413)throw new y("ATTACHMENT_TOO_LARGE","the attachment exceeds the integrations service's size cap");if(t.status===404)throw new y("JIRA_NOT_CONNECTED",`Jira is not connected for this account \u2014 connect it at ${A} and retry`)}throw R(t,`attachment ${e}`)}return Y(t)}var de="kane.source.jira/2";function Me(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){let n=e.map(Me).filter(t=>t!==null);return n.length===0?null:n.join(", ")}if(e!==null&&typeof e=="object"){let n=e;for(let t of["name","value","displayName"])if(typeof n[t]=="string")return n[t];return null}return null}function Fe(e,n,t){let r=[],i={},o=e.additional_fields??{};for(let a of Object.keys(o).sort()){let f=Me(o[a]);if(f===null){r.push(`field "${a}" has no stable text form \u2014 dropped from the envelope`);continue}i[a]=f}let u=[...e.attachments??[]].map(a=>({id:String(a.id),filename:a.filename??"",media_type:a.mime_type??"application/octet-stream",size:a.size??0})).sort((a,f)=>{let p=Number(a.id),h=Number(f.id);return Number.isFinite(p)&&Number.isFinite(h)?p-h:a.id<f.id?-1:a.id>f.id?1:0}),l=t.map(a=>({id:String(a.id),author:a.author?.display_name??"",body:a.body??"",created:a.created??""})).sort((a,f)=>{if(a.created!==f.created)return a.created<f.created?-1:1;let p=Number(a.id),h=Number(f.id);return Number.isFinite(p)&&Number.isFinite(h)&&p!==h?p-h:a.id<f.id?-1:a.id>f.id?1:0}),s=e.key;if(!/^[A-Za-z][A-Za-z0-9_]*-\d+$/.test(s))throw new Error(`cannot build a stable identity for issue key "${s}" \u2014 expected a PROJECT-NUMBER key`);let c={schema:de,site:n,project:s.slice(0,s.lastIndexOf("-")),issue:{id:e.id,key:s},content:{summary:e.summary??"",description:e.description??"",fields:i},attachments:u,comments:l};return{bytes:Buffer.from(JSON.stringify(c),"utf8"),envelope:c,warnings:r}}var Je=64,jt=16,Mt=6e6,Ft=5e7,Jt=12e6,Kt={png:"image/png",jpeg:"image/jpeg",webp:"image/webp",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",emf:"image/emf",wmf:"image/wmf",unknown:"application/octet-stream"},Vt=new Set(["png","jpeg","webp"]);function _e(e){return async n=>{let t;try{t=JSON.parse(n.toString("utf8"))}catch{throw new Error("JIRA_ENVELOPE_SCHEMA: source bytes are not a kane jira envelope")}if(t.schema!==de)throw new Error(`JIRA_ENVELOPE_SCHEMA: unknown envelope schema "${t.schema}" \u2014 this CLI understands ${de}`);let r=[],i=new Map,o=[],u=0,l=new Map,s=[];for(let f=0;f<t.attachments.length;f++){let p=t.attachments[f],h=`i${f+1}`,g=`attachment:${p.filename}`,d=S=>`[img#${h}] ${p.filename} (${p.media_type}, ${p.size} bytes${S?"":" \u2014 not delivered"})`,m=(S,O,M)=>{r.push({ref:h,loc:g,media_type:S,...M?.blob?{blob:M.blob}:{},...M?.appearance?{appearance:M.appearance}:{},delivery:O,...M?.duplicate_of?{duplicate_of:M.duplicate_of}:{}})};if(!p.media_type.startsWith("image/")){m(p.media_type,"unsupported-vision-media-type"),s.push(d(!1));continue}let E;try{E=await e.fetchAttachment(p.id)}catch{m(p.media_type,"external-image-not-fetched"),s.push(d(!1));continue}let I=E.bytes,w=W(I),b=Kt[w.format],L=V(I);if(i.set(L,I),!Vt.has(w.format)){let S=w.format==="gif"||w.format==="bmp"||w.format==="tiff"?"unsupported-vision-media-type":"unsupported-image-kind";m(b,S,{blob:L}),s.push(d(!1));continue}if(w.width===void 0||w.height===void 0||w.width*w.height>Ft){m(b,"undecodable",{blob:L}),s.push(d(!1));continue}let _;if(w.format==="png"||w.format==="jpeg"){let S=H(I,w.format);if(S===null){m(b,"undecodable",{blob:L}),s.push(d(!1));continue}_=G(S.data,{width:S.width,height:S.height,channels:S.channels})}if(w.width<Je||w.height<Je){m(b,"below-dimension-floor",{blob:L,appearance:_}),s.push(d(!1));continue}let T=l.get(L);if(T!==void 0){m(b,"duplicate",{blob:L,appearance:_,duplicate_of:T}),s.push(d(!1));continue}if(I.byteLength>Mt){m(b,"image-too-large",{blob:L,appearance:_}),s.push(d(!1));continue}if(u+I.byteLength>Jt){m(b,"vision-byte-budget-reached",{blob:L,appearance:_}),s.push(d(!1));continue}if(o.length>=jt){m(b,"image-cap-reached",{blob:L,appearance:_}),s.push(d(!1));continue}l.set(L,h),u+=I.byteLength,o.push(h),m(b,"selected",{blob:L,appearance:_}),s.push(d(!0))}let c=[];c.push(`${t.issue.key} \xB7 ${t.site}/${t.project}`,`Summary: ${t.content.summary}`),t.content.description!==""&&c.push("",...t.content.description.split(`
4
+ `));let a=Object.keys(t.content.fields);return a.length>0&&c.push("","--- fields ---",...a.map(f=>`${f}: ${t.content.fields[f]}`)),s.length>0&&c.push("","--- attachments ---",...s),t.comments.length>0&&(c.push("","--- comments ---"),t.comments.forEach((f,p)=>{p>0&&c.push(""),c.push(`[${p+1}] ${f.author} \xB7 ${f.created}`,...f.body.split(`
5
+ `))})),{projection:c.join(`
6
+ `)+`
7
+ `,inventory:r,blobs:i,delivered:o,converter:{name:"jira-convert",version:"2",policy:"v1"}}}}var Gt=/^[A-Za-z][A-Za-z0-9_]*-\d+$/;function ne(e){if(!/^https?:\/\/.+/i.test(e))return null;let n;try{n=new URL(e)}catch{return null}let t=n.pathname.split("/").filter(Boolean),r=t.lastIndexOf("browse");if(r===-1||r+1>=t.length)return null;let i=t[r+1];return Gt.test(i)?{site:n.hostname,issueKey:i.toUpperCase()}:null}function pe(e,n){let t=F(e),r=t.heads.get(n);return r==null?null:Ve(e,t,r)}function fe(e,n){let r=pe(e,n)?.site;return typeof r=="string"&&r.length>0?r:null}function we(e,n,t,r){let i=F(e);for(let[o,u]of i.heads){if(u==null||i.mediaOf(u).format!==n)continue;let l=Ve(e,i,u);if(l===null)continue;let s=l;for(let c of t){if(s===null||typeof s!="object"){s=void 0;break}s=s[c]}if(s===r)return o}return null}function Ve(e,n,t){let r=n.getNode(t)?.content?.blob;if(typeof r!="string")return null;let i=e.getBlob(r);if(i===null)return null;try{let o=JSON.parse(i.toString("utf8"));return o!==null&&typeof o=="object"?o:null}catch{return null}}var Ke={jira:"a jira issue source",confluence:"a confluence page source",linear:"a linear issue source","linear-doc":"a linear document source",web:"a web page source"};function x(e,n,t){let r=F(e),i=r.heads.get(n);if(i==null)return null;let o=r.mediaOf(i).format;if(o===t)return null;let u=Ke[o]??`${o} content`;return v().text("note.kind_taken",{source_id:n,backing:u,kind:Ke[t]??t})}function $(e,n){let t=F(e);for(let r=2;;r++)if(!t.heads.has(`${n}-${r}`))return`${n}-${r}`}function J(e,n){let t=F(e),r=t.heads.get(n);return r==null?null:t.mediaOf(r).format}async function Ge(e,n,t){let r=t.lis??{jiraInfo:q,jiraIssue:Q,jiraAttachment:te,jiraComments:ee};try{let o={auth:await(t.authEnv??(async()=>(await import("./auth-7Z54TMQQ.js")).resolveLisAuthEnv({credentials:t.credentials})))(),env:process.env},u=await r.jiraInfo(o);if(!u.installed)return{ok:!1,failure:{code:"NO_CONNECTION",message:`no Atlassian connection for this account \u2014 create one at ${A} and retry`}};if(u.capabilities.comments===!1)return{ok:!1,failure:{code:"NO_COMMENTS_ACCESS",message:`the connection cannot read issue comments yet \u2014 resync it at ${A} and retry`}};let l=e.issueKey.slice(0,e.issueKey.lastIndexOf("-"));if(!u.selectAll&&u.selectedProjects.length>0&&!u.selectedProjects.includes(l))return{ok:!1,failure:{code:"PROJECT_NOT_SELECTED",message:`project ${l} is not in the integration's selected projects (${u.selectedProjects.join(", ")}) \u2014 add it at ${A}`,facts:{project:l}}};let s=await r.jiraIssue(e.issueKey,o),c=await r.jiraComments(e.issueKey,o),a=e.site;if(s.host)try{a=new URL(s.host).hostname}catch{a=s.host.replace(/^https?:\/\//,"").replace(/[/:].*$/,"")}let{bytes:f,warnings:p}=Fe(s,a,c),h=n??e.issueKey.toLowerCase();try{N(h)}catch(g){return{ok:!1,failure:{code:"BAD_SOURCE_ID",message:g instanceof Error?g.message:String(g)}}}return{ok:!0,bytes:f,site:a,sourceId:h,warnings:p,lis:r,lisDeps:o}}catch(i){return i instanceof y?{ok:!1,failure:{code:i.code,message:i.message}}:{ok:!1,failure:{code:"FETCH_FAILED",message:He(i instanceof Error?i.message:String(i))}}}}function We(e,n,t){let r=x(e,n,"jira");if(r!==null)return{code:"KIND_MISMATCH",message:r,facts:{id:n,heldKind:J(e,n)??"",freeId:$(e,n)}};let i=fe(e,n);return i!==null&&i!==t?{code:"SITE_MOVED",message:v().text("note.site_moved",{source_id:n,previous:i,site:t}),facts:{id:n,freeId:$(e,n)}}:null}async function Wt(e,n,t,r,i){let o=ne(e);if(o===null)return(t.err??t.out)(`error: ${e}: unsupported remote URL \u2014 expected a Jira issue URL (https://<site>/browse/KEY-123)`),{code:1};let u=await Ge(o,n,i);if(!u.ok)return(t.err??t.out)(`error: ${e}: ${u.failure.message}`),{code:1};let{bytes:l,site:s,sourceId:c,warnings:a,lis:f,lisDeps:p}=u;try{let h=We(r,c,s);if(h!==null)return(t.err??t.out)(`error: ${e}: ${h.message}`),{code:1};let g=await U({store:r,bytes:l,media:se,sourceId:c,label:e,confirmSameSource:t.isTTY?d=>t.confirm(`identical content already ingested as ${d} \u2014 treat as the same source?`):void 0,converters:{jira:_e({fetchAttachment:d=>f.jiraAttachment(d,p)})}});t.out(B(t.isTTY,g,o.issueKey));for(let d of a)t.out(`warning: ${d}`);for(let d of g.warnings??[])t.out(`warning: ${d}`);if(g.composite){let d=g.composite.delivered+g.composite.omitted;t.out(`${g.source_id}: jira, ${d} attachments, ${g.composite.delivered} images delivered (${g.composite.omitted} omitted)`)}return{code:0,result:{status:g.status,source_id:g.source_id,source_cid:g.cid,...g.gitignore?{gitignore:g.gitignore}:{}}}}catch(h){return h instanceof y?((t.err??t.out)(`error: ${e}: ${h.message}`),{code:1}):((t.err??t.out)(`error: ${e}: ${He(h instanceof Error?h.message:String(h))}`),{code:1})}}async function Ht(e,n,t){let r=ne(e);if(r===null)return{ok:!1,failure:{code:"UNSUPPORTED_URL",message:"unsupported remote URL \u2014 expected a Jira issue URL (https://<site>/browse/KEY-123)"}};if(n!==void 0&&!D(n))return{ok:!1,failure:{code:"BAD_SOURCE_ID",message:j(n)}};let i=await Ge(r,n,t);return i.ok?{ok:!0,fetched:{provider:"jira",sourceId:i.sourceId,bytes:i.bytes,media:se,label:e,display:r.issueKey,origin:{kind:"jira",url:e},identity:{site:i.site},warnings:i.warnings}}:i}async function Yt(e,n,t){let r=We(n,e.sourceId,e.identity.site??"");if(r!==null)return{ok:!1,failure:r};let i=t.lis??{jiraInfo:q,jiraIssue:Q,jiraAttachment:te,jiraComments:ee},u={auth:await(t.authEnv??(async()=>(await import("./auth-7Z54TMQQ.js")).resolveLisAuthEnv({credentials:t.credentials})))(),env:process.env};return{ok:!0,media:se,label:e.label,converters:{jira:_e({fetchAttachment:l=>i.jiraAttachment(l,u)})}}}function He(e){let n=e.match(/too large — ([\d.]+ [KM]B), the limit for .+ is ([\d.]+ [KM]B) \[FILE_TOO_LARGE\]/);return n?`the issue's content is too large to ingest (${n[1]}; the limit is ${n[2]}) \u2014 trim the description or attachments in Jira and retry`:e.startsWith("PROJECTION_TOO_LARGE:")?"the issue's text is too large to ingest \u2014 trim the description in Jira and retry":e}var Ye={name:"jira",hint:"Jira issue URLs (https://<site>/browse/KEY-123)",match:e=>ne(e)!==null,ingest:Wt,sourceIdFor:e=>{let n=ne(e);return n?n.issueKey.toLowerCase():null},fetch:Ht,prepare:Yt};async function Le(e,n={}){let t=await k("/jira/document",{method:"POST",body:JSON.stringify({resource_id:e,format:"markdown"})},n);if(!t.ok)throw R(t,"the page");let r=P(t);if(r.type==="error"||!r.data)throw new y("JIRA_ISSUE_UNAVAILABLE",`could not fetch the page: ${C(r.message??"")||"page not found or not accessible"}`);return r.data}async function Ie(e,n={}){let t=await k("/jira/attachment",{method:"POST",body:JSON.stringify({source:"confluence",download:e})},n);if(!t.ok)throw R(t,"the page's attachment");return{bytes:Y(t).bytes}}var me="kane.source.confluence/1";function ze(e,n){if(typeof e.id!="string"||e.id==="")throw new Error("cannot build a stable identity for this page \u2014 the integrations service returned no page id");let t=[...e.labels??[]].filter(o=>typeof o=="string").sort(),r=[...e.attachments??[]].map(o=>({id:String(o.id),filename:o.filename??"",media_type:o.mime_type??"application/octet-stream",size:o.size??0})).sort((o,u)=>o.id<u.id?-1:o.id>u.id?1:0),i={schema:me,site:n,page:{id:e.id},space:{key:e.space?.key??""},title:e.title??"",labels:t,content:{body:e.body??""},attachments:r};return{bytes:Buffer.from(JSON.stringify(i),"utf8"),envelope:i,warnings:[]}}var Xe=64,zt=16,Xt=6e6,Zt=5e7,qt=12e6,Qt={png:"image/png",jpeg:"image/jpeg",webp:"image/webp",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",emf:"image/emf",wmf:"image/wmf",unknown:"application/octet-stream"},en=new Set(["png","jpeg","webp"]);function Ze(e){let n=new Map(Object.entries(e.downloads));return async t=>{let r;try{r=JSON.parse(t.toString("utf8"))}catch{throw new Error("CONFLUENCE_ENVELOPE_SCHEMA: source bytes are not a kane confluence envelope")}if(r.schema!==me)throw new Error(`CONFLUENCE_ENVELOPE_SCHEMA: unknown envelope schema "${r.schema}" \u2014 this CLI understands ${me}`);let i=[],o=new Map,u=[],l=0,s=new Map,c=[];for(let f=0;f<r.attachments.length;f++){let p=r.attachments[f],h=`i${f+1}`,g=`attachment:${p.filename}`,d=O=>`[img#${h}] ${p.filename} (${p.media_type}, ${p.size} bytes${O?"":" \u2014 not delivered"})`,m=(O,M,K)=>{i.push({ref:h,loc:g,media_type:O,...K?.blob?{blob:K.blob}:{},...K?.appearance?{appearance:K.appearance}:{},delivery:M,...K?.duplicate_of?{duplicate_of:K.duplicate_of}:{}})};if(!p.media_type.startsWith("image/")){m(p.media_type,"unsupported-vision-media-type"),c.push(d(!1));continue}let E=n.get(p.id);if(!E){m(p.media_type,"external-image-not-fetched"),c.push(d(!1));continue}let I;try{I=await e.fetchAttachment({id:p.id,download:E})}catch{m(p.media_type,"external-image-not-fetched"),c.push(d(!1));continue}let w=I.bytes,b=W(w),L=Qt[b.format],_=V(w);if(o.set(_,w),!en.has(b.format)){let O=b.format==="gif"||b.format==="bmp"||b.format==="tiff"?"unsupported-vision-media-type":"unsupported-image-kind";m(L,O,{blob:_}),c.push(d(!1));continue}if(b.width===void 0||b.height===void 0||b.width*b.height>Zt){m(L,"undecodable",{blob:_}),c.push(d(!1));continue}let T;if(b.format==="png"||b.format==="jpeg"){let O=H(w,b.format);if(O===null){m(L,"undecodable",{blob:_}),c.push(d(!1));continue}T=G(O.data,{width:O.width,height:O.height,channels:O.channels})}if(b.width<Xe||b.height<Xe){m(L,"below-dimension-floor",{blob:_,appearance:T}),c.push(d(!1));continue}let S=s.get(_);if(S!==void 0){m(L,"duplicate",{blob:_,appearance:T,duplicate_of:S}),c.push(d(!1));continue}if(w.byteLength>Xt){m(L,"image-too-large",{blob:_,appearance:T}),c.push(d(!1));continue}if(l+w.byteLength>qt){m(L,"vision-byte-budget-reached",{blob:_,appearance:T}),c.push(d(!1));continue}if(u.length>=zt){m(L,"image-cap-reached",{blob:_,appearance:T}),c.push(d(!1));continue}s.set(_,h),l+=w.byteLength,u.push(h),m(L,"selected",{blob:_,appearance:T}),c.push(d(!0))}let a=[];return a.push(`${r.title} \xB7 ${r.site} \xB7 ${r.space.key}`),r.labels.length>0&&a.push(`labels: ${r.labels.join(", ")}`),r.content.body!==""&&a.push("",...r.content.body.split(`
8
+ `)),c.length>0&&a.push("","--- attachments ---",...c),{projection:a.join(`
9
+ `)+`
10
+ `,inventory:i,blobs:o,delivered:u,converter:{name:"confluence-convert",version:"1",policy:"v1"}}}}var tn=/^[A-Za-z0-9~][A-Za-z0-9._~-]*$/;function re(e){if(!/^https?:\/\/.+/i.test(e))return null;let n;try{n=new URL(e)}catch{return null}let t=n.pathname.split("/").filter(Boolean),r=t.indexOf("wiki");if(r===-1||t[r+1]!=="spaces"||t[r+3]!=="pages")return null;let i=t[r+2],o=t[r+4];return i===void 0||o===void 0||!tn.test(i)||!/^\d+$/.test(o)?null:{site:n.hostname,spaceKey:i,pageId:o}}async function qe(e,n,t){let r=t.lis??{jiraInfo:q,jiraIssue:Q,jiraAttachment:te,jiraComments:ee},i=t.confluence??{confluenceDocument:Le,confluenceAttachment:Ie};try{let u={auth:await(t.authEnv??(async()=>(await import("./auth-7Z54TMQQ.js")).resolveLisAuthEnv({credentials:t.credentials})))(),env:process.env},l=await r.jiraInfo(u);if(!l.installed)return{ok:!1,failure:{code:"NO_CONNECTION",message:`no Atlassian connection for this account \u2014 create one at ${A} and retry`}};if(l.capabilities.document===!1)return{ok:!1,failure:{code:"NO_CONFLUENCE_ACCESS",message:`the connection has no Confluence access \u2014 reconnect with Confluence at ${A} and retry`}};let s=await i.confluenceDocument(e.pageId,u),c=e.site;if(s.url)try{c=new URL(s.url).hostname}catch{}let{bytes:a,warnings:f}=ze(s,c),p=n??`page-${e.pageId}`;try{N(p)}catch(g){return{ok:!1,failure:{code:"BAD_SOURCE_ID",message:g instanceof Error?g.message:String(g)}}}let h=Object.fromEntries((s.attachments??[]).filter(g=>typeof g.download=="string"&&g.download.length>0).map(g=>[String(g.id),g.download]));return{ok:!0,bytes:a,site:c,sourceId:p,...s.title?{title:s.title}:{},warnings:f,downloads:h,remote:i,lisDeps:u}}catch(o){return o instanceof y?{ok:!1,failure:{code:o.code,message:o.message}}:{ok:!1,failure:{code:"FETCH_FAILED",message:tt(o instanceof Error?o.message:String(o))}}}}function Qe(e,n,t){let r=x(e,n,"confluence");if(r!==null)return{code:"KIND_MISMATCH",message:r,facts:{id:n,heldKind:J(e,n)??"",freeId:$(e,n)}};let i=fe(e,n);return i!==null&&i!==t?{code:"SITE_MOVED",message:v().text("note.site_moved",{source_id:n,previous:i,site:t}),facts:{id:n,freeId:$(e,n)}}:null}var et=(e,n,t)=>({confluence:Ze({downloads:e,fetchAttachment:r=>n.confluenceAttachment(r.download,t)})});async function nn(e,n,t,r,i){let o=re(e);if(o===null)return(t.err??t.out)(`error: ${e}: unsupported remote URL \u2014 expected a Confluence page URL (https://<site>/wiki/spaces/<KEY>/pages/<id>/\u2026)`),{code:1};let u=await qe(o,n,i);if(!u.ok)return(t.err??t.out)(`error: ${e}: ${u.failure.message}`),{code:1};let{bytes:l,site:s,sourceId:c,warnings:a,downloads:f,remote:p,lisDeps:h}=u;try{let g=Qe(r,c,s);if(g!==null)return(t.err??t.out)(`error: ${e}: ${g.message}`),{code:1};let d=await U({store:r,bytes:l,media:ae,sourceId:c,label:e,confirmSameSource:t.isTTY?m=>t.confirm(`identical content already ingested as ${m} \u2014 treat as the same source?`):void 0,converters:et(f,p,h)});t.out(B(t.isTTY,d,`${o.spaceKey}/${o.pageId}`));for(let m of a)t.out(`warning: ${m}`);for(let m of d.warnings??[])t.out(`warning: ${m}`);if(d.composite){let m=d.composite.delivered+d.composite.omitted;t.out(`${d.source_id}: confluence, ${m} attachments, ${d.composite.delivered} images delivered (${d.composite.omitted} omitted)`)}return{code:0,result:{status:d.status,source_id:d.source_id,source_cid:d.cid,...d.gitignore?{gitignore:d.gitignore}:{}}}}catch(g){return g instanceof y?((t.err??t.out)(`error: ${e}: ${g.message}`),{code:1}):((t.err??t.out)(`error: ${e}: ${tt(g instanceof Error?g.message:String(g))}`),{code:1})}}async function rn(e,n,t){let r=re(e);if(r===null)return{ok:!1,failure:{code:"UNSUPPORTED_URL",message:"unsupported remote URL \u2014 expected a Confluence page URL (https://<site>/wiki/spaces/<KEY>/pages/<id>/\u2026)"}};if(n!==void 0&&!D(n))return{ok:!1,failure:{code:"BAD_SOURCE_ID",message:j(n)}};let i=await qe(r,n,t);return i.ok?{ok:!0,fetched:{provider:"confluence",sourceId:i.sourceId,bytes:i.bytes,media:ae,label:e,display:`${r.spaceKey}/${r.pageId}`,...i.title?{title:i.title}:{},origin:{kind:"confluence",url:e},identity:{site:i.site},warnings:i.warnings,downloads:i.downloads}}:i}async function on(e,n,t){let r=Qe(n,e.sourceId,e.identity.site??"");if(r!==null)return{ok:!1,failure:r};let i=t.confluence??{confluenceDocument:Le,confluenceAttachment:Ie},u={auth:await(t.authEnv??(async()=>(await import("./auth-7Z54TMQQ.js")).resolveLisAuthEnv({credentials:t.credentials})))(),env:process.env};return{ok:!0,media:ae,label:e.label,converters:et(e.downloads??{},i,u)}}function tt(e){let n=e.match(/too large — ([\d.]+ [KM]B), the limit for .+ is ([\d.]+ [KM]B) \[FILE_TOO_LARGE\]/);return n?`the page's content is too large to ingest (${n[1]}; the limit is ${n[2]}) \u2014 trim the page in Confluence and retry`:e.startsWith("PROJECTION_TOO_LARGE:")?"the page's text is too large to ingest \u2014 trim the page in Confluence and retry":e}var nt={name:"confluence",hint:"Confluence page URLs (https://<site>/wiki/spaces/<KEY>/pages/<id>/\u2026)",match:e=>re(e)!==null,ingest:nn,sourceIdFor:e=>{let n=re(e);return n?`page-${n.pageId}`:null},fetch:rn,prepare:on};async function rt(e={}){let n=await k("/linear-app/info",{method:"GET"},e);if(!n.ok)throw R(n,"the connection","Linear");let t=P(n);return{installed:t.data?.INSTALLED==="YES",capabilities:{issue:t.data?.capabilities?.issue===!0,comments:t.data?.capabilities?.comments===!0,document:t.data?.capabilities?.document===!0}}}async function it(e,n={}){let t=await k("/linear-app/issue?details=true",{method:"POST",body:JSON.stringify({plugin_code:"linear-app",issueKey:e})},n);if(!t.ok)throw R(t,"the issue","Linear");let r=P(t);if(r.type==="error"||!r.data)throw new y("JIRA_ISSUE_UNAVAILABLE",`could not fetch the issue: ${C(r.message??"")||"issue not found or not accessible"}`);return r.data}var sn=100,an=5e3,cn=60;async function ot(e,n={}){let t=[],r=new Set,i=null;for(let o=0;;o++){if(o>=cn)throw new y("LIS_UNAVAILABLE","the integrations service kept returning comment pages without finishing \u2014 retry later");let u=await k("/linear-app/issue/comments",{method:"POST",body:JSON.stringify({resource_id:e,max_results:sn,...i===null?{}:{cursor:i},fetch_all:!1})},n);if(!u.ok)throw R(u,"the issue's comments","Linear");let l=P(u);if(l.type==="error"||!l.data)throw new y("JIRA_ISSUE_UNAVAILABLE",`could not fetch the issue's comments: ${C(l.message??"")||"unavailable"}`);if(l.data.partial)throw new y("JIRA_ISSUE_UNAVAILABLE","the integrations service returned an incomplete comment set \u2014 retry later");for(let a of l.data.comments??[]){if(typeof a.id!="string"||a.id==="")throw new y("JIRA_ISSUE_UNAVAILABLE","the integrations service returned an incomplete comment set \u2014 a comment row has no comment id");r.has(a.id)||(r.add(a.id),t.push(a))}let s=l.data.pagination;if(!s?.has_more)return t;if(t.length>=an)throw new y("JIRA_ISSUE_UNAVAILABLE","the issue has more comments than can be ingested \u2014 cannot build a complete identity");let c=s.next_cursor??null;if(c==null||c===i)throw new y("LIS_UNAVAILABLE","the integrations service returned a non-advancing comments page \u2014 retry later");i=c}}async function st(e,n={}){let t=await k("/linear-app/document",{method:"POST",body:JSON.stringify({resource_id:e,format:"markdown"})},n);if(!t.ok)throw R(t,"the document","Linear");let r=P(t);if(r.type==="error"||!r.data)throw new y("JIRA_ISSUE_UNAVAILABLE",`could not fetch the document: ${C(r.message??"")||"document not found or not accessible"}`);return r.data}async function at(e,n={}){let t=await k("/linear-app/attachment",{method:"POST",body:JSON.stringify({attachment_id:e})},n);if(!t.ok)throw R(t,"the attachment","Linear");return{bytes:Y(t).bytes}}var ge="kane.source.linear/1",he="kane.source.linear-doc/1",un=/https:\/\/uploads\.linear\.app\/[^\s)"'`]+/g;function z(e){return e.replace(un,n=>{let t=n.indexOf("?");return t===-1?n:n.slice(0,t)})}function ct(e,n){return e.id<n.id?-1:e.id>n.id?1:0}function ln(e,n){return ct(e,n)||(e.filename<n.filename?-1:e.filename>n.filename?1:0)||(e.url<n.url?-1:e.url>n.url?1:0)}function ut(e,n,t){if(typeof e.id!="string"||e.id==="")throw new Error("cannot build a stable identity for this issue \u2014 the integrations service returned no issue id");let r=e.key;if(!/^[A-Za-z][A-Za-z0-9]*-\d+$/.test(r)){let c=String(r).replace(/[\u0000-\u001f\u007f-\u009f]/g,"").slice(0,80);throw new Error(`cannot build a stable identity for issue key "${c}" \u2014 expected a TEAM-NUMBER key`)}let i={},o=[...e.labels??[]].filter(c=>typeof c=="string").sort();o.length>0&&(i.labels=o.join(", ")),typeof e.priority=="string"&&e.priority!==""&&(i.priority=e.priority),typeof e.project=="string"&&e.project!==""&&(i.project=e.project),typeof e.status=="string"&&e.status!==""&&(i.status=e.status);let u=(e.attachments??[]).map(c=>({id:c.id!=null&&String(c.id)!==""?String(c.id):z(c.download??""),filename:c.filename??"",url:z(c.download??"")})).sort(ln),l=n.map(c=>({id:String(c.id),author:c.author?.display_name??"",body:z(c.body??""),created:c.created??""})).sort((c,a)=>c.created!==a.created?c.created<a.created?-1:1:ct(c,a)),s={schema:ge,site:t,team:r.slice(0,r.lastIndexOf("-")),issue:{uuid:e.id,key:r},content:{title:e.summary??"",description:z(e.description??""),fields:i},attachments:u,comments:l};return{bytes:Buffer.from(JSON.stringify(s),"utf8"),envelope:s,warnings:[]}}function lt(e,n,t){if(typeof e.id!="string"||e.id==="")throw new Error("cannot build a stable identity for this document \u2014 the integrations service returned no document id");let r=(e.attachments??[]).map(o=>({url:z(o.download??String(o.id??"")),filename:o.filename??""})).sort((o,u)=>o.url<u.url?-1:o.url>u.url?1:0),i={schema:he,site:n,document:{uuid:e.id,slug_id:t},project:{id:e.space?.key??""},title:e.title??"",content:{body:z(e.body??"")},attachments:r};return{bytes:Buffer.from(JSON.stringify(i),"utf8"),envelope:i,warnings:[]}}var dt=64,dn=16,pn=6e6,fn=5e7,mn=12e6,ye=64,pt="https://uploads.linear.app/",gn=/https:\/\/uploads\.linear\.app\/[^\s)"'`]+/g,hn={png:"image/png",jpeg:"image/jpeg",webp:"image/webp",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",emf:"image/emf",wmf:"image/wmf",unknown:"application/octet-stream"},yn=new Set(["png","jpeg","webp"]);async function ft(e,n){let t=[],r=new Map,i=[],o=0,u=new Map,l=[];for(let s=0;s<e.length;s++){let c=e[s],a=`i${s+1}`,f=b=>`[img#${a}] ${c.label}${b?"":" \u2014 not delivered"}`,p=(b,L,_)=>{t.push({ref:a,loc:c.loc,media_type:b,..._?.blob?{blob:_.blob}:{},..._?.appearance?{appearance:_.appearance}:{},delivery:L,..._?.duplicate_of?{duplicate_of:_.duplicate_of}:{}})},h;try{h=await n(c.url)}catch{p("application/octet-stream","external-image-not-fetched"),l.push(f(!1));continue}let g=h.bytes,d=W(g),m=hn[d.format],E=V(g);if(r.set(E,g),!yn.has(d.format)){let b=d.format==="gif"||d.format==="bmp"||d.format==="tiff"?"unsupported-vision-media-type":"unsupported-image-kind";p(m,b,{blob:E}),l.push(f(!1));continue}if(d.width===void 0||d.height===void 0||d.width*d.height>fn){p(m,"undecodable",{blob:E}),l.push(f(!1));continue}let I;if(d.format==="png"||d.format==="jpeg"){let b=H(g,d.format);if(b===null){p(m,"undecodable",{blob:E}),l.push(f(!1));continue}I=G(b.data,{width:b.width,height:b.height,channels:b.channels})}if(d.width<dt||d.height<dt){p(m,"below-dimension-floor",{blob:E,appearance:I}),l.push(f(!1));continue}let w=u.get(E);if(w!==void 0){p(m,"duplicate",{blob:E,appearance:I,duplicate_of:w}),l.push(f(!1));continue}if(g.byteLength>pn){p(m,"image-too-large",{blob:E,appearance:I}),l.push(f(!1));continue}if(o+g.byteLength>mn){p(m,"vision-byte-budget-reached",{blob:E,appearance:I}),l.push(f(!1));continue}if(i.length>=dn){p(m,"image-cap-reached",{blob:E,appearance:I}),l.push(f(!1));continue}u.set(E,a),o+=g.byteLength,i.push(a),p(m,"selected",{blob:E,appearance:I}),l.push(f(!0))}return{inventory:t,blobs:r,delivered:i,lines:l}}function En(e){let n=new Set,t=[];for(let r of e.match(gn)??[])n.has(r)||(n.add(r),t.push(r));return t}function ve(e){return async n=>{let t;try{t=JSON.parse(n.toString("utf8"))}catch{throw new Error("LINEAR_ENVELOPE_SCHEMA: source bytes are not a kane linear envelope")}if(t.schema!==ge)throw new Error(`LINEAR_ENVELOPE_SCHEMA: unknown envelope schema "${t.schema}" \u2014 this CLI understands ${ge}`);let r=[],i=new Set;for(let a of En(t.content.description))i.add(a),r.push({url:a,label:a,loc:`body:${a}`});let o=[];for(let a of t.attachments)if(a.url.startsWith(pt)){if(i.has(a.url)){if(a.filename!==""){let f=r.find(p=>p.url===a.url);f!==void 0&&f.label===f.url&&(f.label=a.filename)}continue}i.add(a.url),r.push({url:a.url,label:a.filename||a.url,loc:`attachment:${a.filename||a.url}`})}else a.url!==""&&o.push(`[${o.length+1}] ${a.filename||a.url} \u2014 ${a.url}`);let u=Math.max(0,r.length-ye),l=await ft(r.slice(0,ye),e.fetchAttachment);u>0&&l.lines.push(`${u} more upload links not examined`);let s=[];s.push(`${t.issue.key} \xB7 ${t.site}`,`Title: ${t.content.title}`),t.content.description!==""&&s.push("",...t.content.description.split(`
11
+ `));let c=Object.keys(t.content.fields);return c.length>0&&s.push("","--- fields ---",...c.map(a=>`${a}: ${t.content.fields[a]}`)),l.lines.length>0&&s.push("","--- images ---",...l.lines),o.length>0&&s.push("","--- links ---",...o),t.comments.length>0&&(s.push("","--- comments ---"),t.comments.forEach((a,f)=>{f>0&&s.push(""),s.push(`[${f+1}] ${a.author} \xB7 ${a.created}`,...a.body.split(`
12
+ `))})),{projection:s.join(`
13
+ `)+`
14
+ `,inventory:l.inventory,blobs:l.blobs,delivered:l.delivered,converter:{name:"linear-convert",version:"1",policy:"v1"}}}}function Ae(e){return async n=>{let t;try{t=JSON.parse(n.toString("utf8"))}catch{throw new Error("LINEAR_DOC_ENVELOPE_SCHEMA: source bytes are not a kane linear document envelope")}if(t.schema!==he)throw new Error(`LINEAR_DOC_ENVELOPE_SCHEMA: unknown envelope schema "${t.schema}" \u2014 this CLI understands ${he}`);let r=new Set,i=[];for(let s of t.attachments)!s.url.startsWith(pt)||r.has(s.url)||(r.add(s.url),i.push({url:s.url,label:s.filename||s.url,loc:`body:${s.url}`}));let o=Math.max(0,i.length-ye),u=await ft(i.slice(0,ye),e.fetchAttachment);o>0&&u.lines.push(`${o} more upload links not examined`);let l=[];return l.push(`${t.title} \xB7 ${t.site}`),t.content.body!==""&&l.push("",...t.content.body.split(`
15
+ `)),u.lines.length>0&&l.push("","--- images ---",...u.lines),{projection:l.join(`
16
+ `)+`
17
+ `,inventory:u.inventory,blobs:u.blobs,delivered:u.delivered,converter:{name:"linear-doc-convert",version:"1",policy:"v1"}}}}var bn=/^[A-Za-z][A-Za-z0-9]*-\d+$/,_n=/-([0-9a-f]{12})$/;function Se(e){if(!/^https?:\/\/.+/i.test(e))return null;let n;try{n=new URL(e)}catch{return null}return n.hostname.toLowerCase()!=="linear.app"?null:n.pathname.split("/").filter(Boolean)}function mt(e){let n=Se(e);return n===null||n.length<3?null:{workspace:n[0],segs:n}}function X(e){let n=mt(e);if(n===null||n.segs[1]!=="issue")return null;let t=n.segs[2];return bn.test(t)?{workspace:n.workspace,key:t}:null}function Z(e){let n=mt(e);if(n===null||n.segs[1]!=="document")return null;let t=n.segs[2].match(_n);return t===null?null:{workspace:n.workspace,slugId:t[1]}}var wn=new Set(["project","team","view","initiative","cycle","roadmap","inbox","triage","my-issues"]),gt=new Set(["docs","features","method","blog","customers","pricing","integrations","developers","changelog","about","careers","security","download","contact","now","switch","homepage"]);function Re(e){let n=Se(e);return n===null||n.length<2||!wn.has(n[1])||gt.has(n[0].toLowerCase())?null:{workspace:n[0],section:n[1]}}function ke(e){let n=Se(e);return n===null||n.length<2||n[1]!=="issue"&&n[1]!=="document"||gt.has(n[0].toLowerCase())||X(e)!==null||Z(e)!==null?null:{workspace:n[0],section:n[1]}}function ht(e){let n=X(e);return n?n.key.toLowerCase():null}function yt(e){let n=Z(e);return n?`doc-${n.slugId}`:null}var Oe={linearInfo:rt,linearIssue:it,linearComments:ot,linearDocument:st,linearAttachment:at};function bt(e,n){if(e)try{let t=new URL(e).pathname.split("/").filter(Boolean)[0];if(t)return`linear.app/${t.toLowerCase()}`}catch{}return`linear.app/${n.toLowerCase()}`}function Ln(e,n,t,r,i,o){let u=pe(e,r);if(u!==null&&typeof u.schema=="string"&&u.schema.startsWith(`kane.source.${n}/`)){let s=u;for(let c of t)s=s!==null&&typeof s=="object"?s[c]:void 0;if(typeof s=="string"&&s!==""&&s!==i)return v().text("note.key_recycled",{source_id:r,what:o})}let l=we(e,n,t,i);return l!==null&&l!==r?`this ${o} is already ingested as '${l}' (its key changed) \u2014 reconcile that source, or retire it to re-ingest under the new key`:null}function In(e,n,t,r){let i=pe(e,t);if(i===null||typeof i.schema!="string"||!i.schema.startsWith(`kane.source.${n}/`))return null;let o=i.site;return typeof o!="string"||o.length===0||o===r?null:v().text("note.site_moved",{source_id:t,previous:o,site:r})}function Ce(e,n,t,r,i,o,u){let l=Ln(e,n,t,r,i,o);if(l!==null){let a=we(e,n,t,i);return{code:"UUID_MOVED",message:l,facts:a!==null&&a!==r?{holder:a}:{id:r,freeId:$(e,r)}}}let s=x(e,r,n);if(s!==null)return{code:"KIND_MISMATCH",message:s,facts:{id:r,heldKind:J(e,r)??"",freeId:$(e,r)}};let c=In(e,n,r,u);return c!==null?{code:"SITE_MOVED",message:c,facts:{id:r,freeId:$(e,r)}}:null}var _t=(e,n)=>e instanceof y?{code:e.code,message:e.message}:{code:"FETCH_FAILED",message:$e(e instanceof Error?e.message:String(e),n,"Linear")};async function wt(e,n,t){let r=t.linear??Oe;try{let o={auth:await(t.authEnv??(async()=>(await import("./auth-7Z54TMQQ.js")).resolveLisAuthEnv({credentials:t.credentials})))(),env:process.env},u=await r.linearInfo(o);if(!u.installed)return{ok:!1,failure:{code:"NO_CONNECTION",message:`no Linear connection for this account \u2014 create one at ${A} and retry`}};if(u.capabilities.issue===!1||u.capabilities.comments===!1)return{ok:!1,failure:{code:"NO_ISSUE_ACCESS",message:`the connection cannot read issues or their comments yet \u2014 resync it at ${A} and retry`}};let l=await r.linearIssue(e.key,o),s=await r.linearComments(e.key,o),c=bt(l.host,e.workspace),{bytes:a,envelope:f,warnings:p}=ut(l,s,c),h=n??e.key.toLowerCase();try{N(h)}catch(g){return{ok:!1,failure:{code:"BAD_SOURCE_ID",message:g instanceof Error?g.message:String(g)}}}return{ok:!0,bytes:a,key:f.issue.key,uuid:f.issue.uuid,site:c,sourceId:h,warnings:p,lis:r,lisDeps:o}}catch(i){return{ok:!1,failure:_t(i,"issue")}}}async function Lt(e,n,t){let r=t.linear??Oe;try{let o={auth:await(t.authEnv??(async()=>(await import("./auth-7Z54TMQQ.js")).resolveLisAuthEnv({credentials:t.credentials})))(),env:process.env},u=await r.linearInfo(o);if(!u.installed)return{ok:!1,failure:{code:"NO_CONNECTION",message:`no Linear connection for this account \u2014 create one at ${A} and retry`}};if(u.capabilities.document===!1)return{ok:!1,failure:{code:"NO_DOCUMENT_ACCESS",message:`the connection cannot read documents yet \u2014 resync it at ${A} and retry`}};let l=await r.linearDocument(e.slugId,o),s=bt(l.url,e.workspace),{bytes:c,envelope:a,warnings:f}=lt(l,s,e.slugId),p=n??`doc-${e.slugId}`;try{N(p)}catch(h){return{ok:!1,failure:{code:"BAD_SOURCE_ID",message:h instanceof Error?h.message:String(h)}}}return{ok:!0,bytes:c,title:a.title||`document ${e.slugId}`,uuid:a.document.uuid,site:s,sourceId:p,warnings:f,lis:r,lisDeps:o}}catch(i){return{ok:!1,failure:_t(i,"document")}}}async function vn(e,n,t,r,i){let o=X(e);if(o===null)return(t.err??t.out)(`error: ${e}: unsupported remote URL \u2014 expected a Linear issue URL (https://linear.app/<workspace>/issue/KEY-123)`),{code:1};let u=await wt(o,n,i);if(!u.ok)return(t.err??t.out)(`error: ${e}: ${u.failure.message}`),{code:1};let{bytes:l,key:s,uuid:c,site:a,sourceId:f,warnings:p,lis:h,lisDeps:g}=u;try{let d=Ce(r,"linear",["issue","uuid"],f,c,"issue",a);if(d!==null)return(t.err??t.out)(`error: ${e}: ${d.message}`),{code:1};let m=await U({store:r,bytes:l,media:ue,sourceId:f,label:e,confirmSameSource:t.isTTY?E=>t.confirm(`identical content already ingested as ${E} \u2014 treat as the same source?`):void 0,converters:{linear:ve({fetchAttachment:E=>h.linearAttachment(E,g)})}});t.out(B(t.isTTY,m,s));for(let E of p)t.out(`warning: ${E}`);for(let E of m.warnings??[])t.out(`warning: ${E}`);if(m.composite){let E=m.composite.delivered+m.composite.omitted;t.out(`${m.source_id}: linear, ${E} images, ${m.composite.delivered} delivered (${m.composite.omitted} omitted)`)}return{code:0,result:{status:m.status,source_id:m.source_id,source_cid:m.cid,...m.gitignore?{gitignore:m.gitignore}:{}}}}catch(d){return d instanceof y?((t.err??t.out)(`error: ${e}: ${d.message}`),{code:1}):((t.err??t.out)(`error: ${e}: ${$e(d instanceof Error?d.message:String(d),"issue","Linear")}`),{code:1})}}async function An(e,n,t,r,i){let o=Z(e);if(o===null)return(t.err??t.out)(`error: ${e}: unsupported remote URL \u2014 expected a Linear document URL (https://linear.app/<workspace>/document/<slug>)`),{code:1};let u=await Lt(o,n,i);if(!u.ok)return(t.err??t.out)(`error: ${e}: ${u.failure.message}`),{code:1};let{bytes:l,title:s,uuid:c,site:a,sourceId:f,warnings:p,lis:h,lisDeps:g}=u;try{let d=Ce(r,"linear-doc",["document","uuid"],f,c,"document",a);if(d!==null)return(t.err??t.out)(`error: ${e}: ${d.message}`),{code:1};let m=await U({store:r,bytes:l,media:le,sourceId:f,label:e,confirmSameSource:t.isTTY?E=>t.confirm(`identical content already ingested as ${E} \u2014 treat as the same source?`):void 0,converters:{linearDoc:Ae({fetchAttachment:E=>h.linearAttachment(E,g)})}});t.out(B(t.isTTY,m,s));for(let E of p)t.out(`warning: ${E}`);for(let E of m.warnings??[])t.out(`warning: ${E}`);if(m.composite){let E=m.composite.delivered+m.composite.omitted;t.out(`${m.source_id}: linear document, ${E} images, ${m.composite.delivered} delivered (${m.composite.omitted} omitted)`)}return{code:0,result:{status:m.status,source_id:m.source_id,source_cid:m.cid,...m.gitignore?{gitignore:m.gitignore}:{}}}}catch(d){return d instanceof y?((t.err??t.out)(`error: ${e}: ${d.message}`),{code:1}):((t.err??t.out)(`error: ${e}: ${$e(d instanceof Error?d.message:String(d),"document","Linear")}`),{code:1})}}async function Sn(e,n,t){let r=X(e);if(r===null)return{ok:!1,failure:{code:"UNSUPPORTED_URL",message:"unsupported remote URL \u2014 expected a Linear issue URL (https://linear.app/<workspace>/issue/KEY-123)"}};if(n!==void 0&&!D(n))return{ok:!1,failure:{code:"BAD_SOURCE_ID",message:j(n)}};let i=await wt(r,n,t);return i.ok?{ok:!0,fetched:{provider:"linear",sourceId:i.sourceId,bytes:i.bytes,media:ue,label:e,display:i.key,origin:{kind:"linear",url:e},identity:{site:i.site,uuid:i.uuid},warnings:i.warnings}}:i}async function Rn(e,n,t){let r=Z(e);if(r===null)return{ok:!1,failure:{code:"UNSUPPORTED_URL",message:"unsupported remote URL \u2014 expected a Linear document URL (https://linear.app/<workspace>/document/<slug>)"}};if(n!==void 0&&!D(n))return{ok:!1,failure:{code:"BAD_SOURCE_ID",message:j(n)}};let i=await Lt(r,n,t);return i.ok?{ok:!0,fetched:{provider:"linear-doc",sourceId:i.sourceId,bytes:i.bytes,media:le,label:e,display:i.title,origin:{kind:"linear-doc",url:e},identity:{site:i.site,uuid:i.uuid},warnings:i.warnings}}:i}function It(e){return async(n,t,r)=>{let i=e==="linear",o=Ce(t,e,i?["issue","uuid"]:["document","uuid"],n.sourceId,n.identity.uuid??"",i?"issue":"document",n.identity.site??"");if(o!==null)return{ok:!1,failure:o};let u=r.linear??Oe,s={auth:await(r.authEnv??(async()=>(await import("./auth-7Z54TMQQ.js")).resolveLisAuthEnv({credentials:r.credentials})))(),env:process.env},c=a=>u.linearAttachment(a,s);return i?{ok:!0,media:ue,label:n.label,converters:{linear:ve({fetchAttachment:c})}}:{ok:!0,media:le,label:n.label,converters:{linearDoc:Ae({fetchAttachment:c})}}}}function $e(e,n,t){let r=e.match(/too large — ([\d.]+ [KM]B), the limit for .+ is ([\d.]+ [KM]B) \[FILE_TOO_LARGE\]/);return r?`the ${n}'s content is too large to ingest (${r[1]}; the limit is ${r[2]}) \u2014 trim the ${n} in ${t} and retry`:e.startsWith("PROJECTION_TOO_LARGE:")?`the ${n}'s text is too large to ingest \u2014 trim the ${n} in ${t} and retry`:e}var vt={name:"linear",hint:"Linear issue URLs (https://linear.app/<workspace>/issue/KEY-123)",match:e=>X(e)!==null,ingest:vn,sourceIdFor:ht,fetch:Sn,prepare:It("linear")},At={name:"linear-doc",hint:"Linear document URLs (https://linear.app/<workspace>/document/<slug>)",match:e=>Z(e)!==null,ingest:An,sourceIdFor:yt,fetch:Rn,prepare:It("linear-doc")};function Et(e){let n=Re(e);if(n===null){let t=ke(e);return t!==null?{code:"LINEAR_LINK_MALFORMED",message:`this Linear ${t.section} link is incomplete or malformed \u2014 use the full form (https://linear.app/${t.workspace}/issue/KEY-123 or https://linear.app/${t.workspace}/document/<slug>-<id>)`}:{code:"UNSUPPORTED_URL",message:"unsupported remote URL \u2014 expected a Linear workspace page"}}return{code:"LINEAR_PAGE",message:`this Linear page can't be ingested \u2014 only issue and document URLs are supported; ingest the project's issues or documents individually (https://linear.app/${n.workspace}/issue/KEY-123)`}}var St={name:"linear-page",hint:"Linear issue or document URLs (other linear.app pages are not ingestable)",match:e=>Re(e)!==null||ke(e)!==null,ingest:async(e,n,t)=>((t.err??t.out)(`error: ${e}: ${Et(e).message}`),{code:1}),sourceIdFor:()=>null,fetch:async e=>({ok:!1,failure:Et(e)})};var kn=new Set(["invalid_url","target_disallowed","page_not_found","page_access_blocked","page_paywalled","unsupported_content_type","page_too_large","page_timeout","scrape_unavailable","scrape_rate_limited","internal_error","credit_denied"]);async function Ne(e,n){let t=n.env??process.env,r=n.fetchImpl??fetch,i=xe(t),o={"Content-Type":"application/json"},u=await n.authEnv(),l=u.TESTMUAI_BASIC_AUTH??t.TESTMUAI_BASIC_AUTH,s=u.TESTMUAI_API_KEY??t.TESTMUAI_API_KEY;l?o.Authorization=`Basic ${l}`:s&&(o.Authorization=`Bearer ${s}`);let c;try{c=await r(`${i}/assurance/web/scrape`,{method:"POST",headers:o,body:JSON.stringify({url:e}),signal:AbortSignal.timeout(n.timeoutMs??55e3)})}catch{return{ok:!1,kind:"transport_unreachable"}}if(c.status===401)return{ok:!1,kind:"auth_rejected"};let a;try{a=await c.json()}catch{return{ok:!1,kind:c.status===404?"route_missing":"malformed_response"}}if(c.ok){let p=a.page;return p===void 0||typeof p.markdown!="string"||p.markdown===""||typeof p.final_url!="string"||p.final_url===""||typeof p.projection?.kind!="string"||typeof p.projection?.version!="string"?{ok:!1,kind:"malformed_response"}:{ok:!0,page:p}}let f=a.code;return typeof f=="string"&&kn.has(f)?{ok:!1,kind:f}:c.status===404?{ok:!1,kind:"route_missing"}:c.status===403?{ok:!1,kind:"auth_rejected"}:{ok:!1,kind:"malformed_response"}}var Pe="kane.source.web/1";function Te(e,n,t){if(t==="")throw new Error("cannot build a web source from an empty page projection");if(n.kind===""||n.version==="")throw new Error("cannot build a stable identity without a server-reported projection kind/version");let r={schema:Pe,url:e,projection:{kind:n.kind,version:n.version},content:{markdown:t}};return{bytes:Buffer.from(JSON.stringify(r),"utf8"),envelope:r}}var On=new Set(["markdown"]);function De(){return async e=>{let n;try{n=JSON.parse(e.toString("utf8"))}catch{throw new Error("this web source's stored envelope is not readable \u2014 re-ingest the page")}if(n.schema!==Pe)throw new Error(`unknown web envelope schema '${String(n.schema)}' \u2014 re-ingest the page with this CLI version`);if(!On.has(n.projection?.kind??""))throw new Error(v().text("note.web_projection_unknown",{kind:String(n.projection?.kind)}));if(typeof n.content?.markdown!="string"||n.content.markdown==="")throw new Error("this web source's stored envelope carries no content \u2014 re-ingest the page");return{projection:n.content.markdown,inventory:[],blobs:new Map,delivered:[],converter:{name:"web-convert",version:"1",policy:"markdown-passthrough"}}}}import{createHash as Cn}from"crypto";function Rt(e){return ie(e)!==null}function ie(e){if(!/^https?:\/\//i.test(e))return null;let n;try{n=new URL(e)}catch{return null}return n.hostname===""?null:(n.hash="",n.username="",n.password="",n.toString())}function Ee(e){let n=ie(e);if(n===null)return null;let t=new URL(n),r=(t.hostname+t.pathname).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40).replace(/-+$/,""),i=Cn("sha256").update(n,"utf8").digest("hex").slice(0,8);return`${r||"page"}-${i}`}function kt(e,n){let t=F(e),r=t.heads.get(n);if(r==null)return null;let i=t.getNode(r)?.content?.blob;if(typeof i!="string")return null;let o=e.getBlob(i);if(o===null)return null;try{let u=JSON.parse(o.toString("utf8"));return u.schema!=="kane.source.web/1"?null:typeof u.url=="string"&&u.url.length>0?u.url:null}catch{return null}}function oe(e){switch(e){case"invalid_url":return"this is not a valid public HTTP or HTTPS page URL \u2014 check the address and try again";case"target_disallowed":return"that address cannot be fetched because it does not point to an allowed public web page";case"page_not_found":return"the page could not be found \u2014 check that the URL is correct and that the page still exists";case"page_access_blocked":return"the page refused automated access, so its contents could not be ingested \u2014 use a publicly accessible version of the page";case"page_paywalled":return"the page is behind a paywall or sign-in screen, so its full contents could not be ingested \u2014 use a publicly accessible copy";case"unsupported_content_type":return"the URL does not point to an HTML web page \u2014 download the document and ingest the supported file instead";case"page_too_large":return"the page contains too much text to ingest as a single source \u2014 use a narrower page or trim the content first";case"page_timeout":return"the page took too long to load \u2014 try again later";case"scrape_unavailable":case"scrape_rate_limited":case"internal_error":return"the page ingest service is temporarily unavailable \u2014 try again later";case"credit_denied":return"the page could not be ingested \u2014 your organization is out of credits";case"auth_rejected":return v().text("note.web_login",{});case"route_missing":return"ingesting web pages is not available in your environment yet \u2014 nothing is wrong with the URL; try again later";case"transport_unreachable":return"the page ingest service could not be reached \u2014 check your connection and try again";case"malformed_response":return"the page ingest service returned a response that could not be read safely \u2014 try again later"}}function Ot(e){let n=e.match(/too large — ([\d.]+ [KM]B), the limit for .+ is ([\d.]+ [KM]B) \[FILE_TOO_LARGE\]/);return n?`the page contains too much text to ingest as a single source (${n[1]}; the limit is ${n[2]}) \u2014 use a narrower page or trim the content first`:e.startsWith("PROJECTION_TOO_LARGE:")?"the page contains too much text to ingest as a single source \u2014 use a narrower page or trim the content first":e}async function $n(e,n,t,r,i){let o=ie(e);if(o===null)return(t.err??t.out)(`error: ${e}: ${oe("invalid_url")}`),{code:1};let u=Ee(e),l=n??u;if(l===null)return(t.err??t.out)(`error: ${e}: ${oe("invalid_url")}`),{code:1};try{N(l)}catch(h){return(t.err??t.out)(`error: ${e}: ${h instanceof Error?h.message:String(h)}`),{code:1}}let s=x(r,l,"web");if(s!==null)return(t.err??t.out)(`error: ${e}: ${s}`),{code:1};let c=kt(r,l);if(c!==null&&c!==o){if(!t.isTTY)return(t.err??t.out)(`error: ${e}: ${v().text("note.web_url_changed",{source_id:l,previous:c})}`),{code:1};if(!await t.confirm(`source '${l}' was ingested from ${c} \u2014 treat ${o} as its new version (replaces the current version; items built on it go stale)?`))return t.out(v().text("note.web_id_taken",{url:e})),{code:1}}let a=i.web?.scrape??Ne,f=i.authEnv??(async()=>(await import("./spawner-C7NLLM4F.js")).resolveAgentAuthEnv(i.credentials)),p=await a(o,{authEnv:f});if(!p.ok)return(t.err??t.out)(`error: ${e}: ${oe(p.kind)}`),{code:1};try{let{bytes:h}=Te(o,p.page.projection,p.page.markdown),g=await U({store:r,bytes:h,media:ce,sourceId:l,label:o,confirmSameSource:t.isTTY?m=>t.confirm(`identical content already ingested as ${m} \u2014 treat as the same source?`):void 0,converters:{web:De()}}),d=new URL(o).hostname+new URL(o).pathname;t.out(B(t.isTTY,g,d));for(let m of g.warnings??[])t.out(`warning: ${m}`);return t.isTTY&&p.page.title&&t.out(` title: ${p.page.title}`),{code:0,result:{status:g.status,source_id:g.source_id,source_cid:g.cid,...g.gitignore?{gitignore:g.gitignore}:{}}}}catch(h){return(t.err??t.out)(`error: ${e}: ${Ot(h instanceof Error?h.message:String(h))}`),{code:1}}}async function Nn(e,n,t){let r=ie(e),i=r===null?null:n??Ee(e);if(r===null||i===null)return{ok:!1,failure:{code:"invalid_url",message:oe("invalid_url")}};if(!D(i))return{ok:!1,failure:{code:"BAD_SOURCE_ID",message:j(i)}};let o=t.web?.scrape??Ne,u=t.authEnv??(async()=>(await import("./spawner-C7NLLM4F.js")).resolveAgentAuthEnv(t.credentials)),l=await o(r,{authEnv:u});if(!l.ok)return{ok:!1,failure:{code:l.kind,message:oe(l.kind)}};try{let{bytes:s}=Te(r,l.page.projection,l.page.markdown),c=new URL(r);return{ok:!0,fetched:{provider:"web",sourceId:i,bytes:s,media:ce,label:r,display:c.hostname+c.pathname,origin:{kind:"web",url:r},identity:{url:r},warnings:[]}}}catch(s){return{ok:!1,failure:{code:"FETCH_FAILED",message:Ot(s instanceof Error?s.message:String(s))}}}}async function Pn(e,n){let t=x(n,e.sourceId,"web");if(t!==null)return{ok:!1,failure:{code:"KIND_MISMATCH",message:t,facts:{id:e.sourceId,heldKind:J(n,e.sourceId)??"",freeId:$(n,e.sourceId)}}};let r=kt(n,e.sourceId);return r!==null&&r!==e.identity.url?{ok:!1,failure:{code:"WEB_URL_CHANGED",message:v().text("note.web_url_changed",{source_id:e.sourceId,previous:r}),facts:{id:e.sourceId,previous:r,freeId:$(n,e.sourceId)}}}:{ok:!0,media:ce,label:e.label,converters:{web:De()}}}var Ct={name:"web",hint:"any public web page URL (https://\u2026)",match:Rt,ingest:$n,sourceIdFor:Ee,fetch:Nn,prepare:Pn};function B(e,n,t){return e?n.status==="created"?`landed ${n.source_id} (${t}) \u2014 new source`:n.status==="versioned"?`landed ${n.source_id} (${t}) \u2014 new version; dependents go stale`:`${n.source_id} unchanged \u2014 already landed`:`${n.status} ${n.source_id} source ${n.cid} blob ${n.blob}`}var $t=[Ye,nt,vt,At,St,Ct];function wi(e){return/^https?:\/\/.+/i.test(e)}function Li(e){return $t.find(n=>n.match(e))??null}function j(e){try{return N(e),""}catch(n){return n instanceof Error?n.message:String(n)}}function Ii(e){return $t.find(n=>n.name===e)??null}export{ne as a,pe as b,re as c,X as d,Z as e,Re as f,ke as g,B as h,$t as i,wi as j,Li as k,j as l,Ii as m};
@@ -0,0 +1,3 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{b as l}from"./chunk-LRXBJTD4.js";var m="12.0";function Z(t,r=m){let n=u=>{let[g,_]=u.split(".");return[Number(g)||0,Number(_)||0]},s=`; this kane-cli needs >= ${r}. Upgrade the controller first`;if(!t)return`the controller speaks a wire older than ${r} (it reports none)${s}`;let[i,p]=n(t),[a,c]=n(r);return i>a||i===a&&p>=c?null:`the controller speaks wire ${t}${s}`}var f=["explore_start","lease_start","lease_end","map_delta","progress","skill_updated","browser_request","browser_release","explore_end","lease_step","session_held","session_released","explore_frame"],b=["browser_ready","browser_failed","delta_ack","commit_refused","targets_added","stop","frames_start","frames_stop","frames_ack"],S=["recon","verify","explore","target","land","session","end","recheck"],x=["completed","unreachable","blocked","unsettled","budget","aborted","cancelled"],o=["read_only","mutating"],y=["queued","running","stopped"],E=["completed","budget","user_stop","stopped_before_start","timeout","heartbeat_lost"],k=["secrets_missing","no_browsers","commit_refused","commit_failed","runner_error","recon_failed","setup_failed","unexpected_event","focus_unknown","focus_unreachable","controller_outdated","vm_never_started"];function ee(t,r){return{code:`failed:${t}`,...r?{message:r}:{}}}var R=["unverified","verified","stale","changed","broken","gone","superseded","verified_to_edge"],w=["direct","flow","instance","held"],F=["toggle","revert","could_not_revert","storage_restored","gating","pagination","chrome","confirm","slow","how_it_works"],A=["console","network","flow_break","ux","policy","screen_changed","session","coverage","app_error","broken_link","slow","accessibility"],T=["reproduced","not_reproduced","inconclusive"],L=["subject","screen"],N=["broken","ux","coverage","changed","safety","performance","accessibility"];var h=["needs_sign_in","needs_value","read_only","state","off_site","path_broken","budget"],I=["telemetry_blocked","post_allowed"],q=["target","blocker","field","write"],v=["seeding","replay","walking","settling","verifying"],D=["open","bug","discarded","resolving","resolved"],K=["opened","promoted","discarded","marked_resolving","resolved_verified","recheck_inconclusive","resolved_by_person","reopened_seen","resolved_reached","restored"],C=["info","low","medium","high"],O=["verified","verified_healed","assert_failed","diverged","blocked","unsettled","partial","unreachable","verified_to_edge","start_failed","end_failed","verified_adapted","adapted"],P=["adapted","exit_moved"],B=["jump","replay","continued"],V=["session","one_shot","pending"],U=["start","end"],M=["session","one_shot","read","pending"],j=["judge","deps"],H=["version","state","different"],W=["navigate","replay"],G=["finding","flow","junction","candidate","junction_note","skill_area","skill_journey"],Y=["label","note","verdict","do_not_touch","resolve"],$=["correct","incorrect"],J=["user","agent"],X=["finding","flow","junction"],te={ExploreEventName:f,ControlMessageName:b,LeaseKind:S,LeaseResult:x,LeasePolicy:o,RunState:y,RemarkCode:E,FailedReason:k,FlowStatus:R,ReachKind:w,JunctionNoteKind:F,FindingKind:A,FindingStatus:D,StatusTransition:K,FindingCategory:N,RecheckResult:T,SimilarBy:L,BlockedBy:h,AuditKind:I,AnnotationKind:q,LeaseStepPhase:v,StatefulVerdictKind:M,StatefulVerdictSource:j,PathSegmentKind:W,FeedbackTargetKind:G,FeedbackType:Y,FeedbackVerdict:$,FeedbackAuthorKind:J,LabelAppliesTo:X,Severity:C,ObservationOutcome:O,FlowChangeKind:P,ReachedVia:B,StatefulType:V,StatefulRole:U,VerdictRelation:H};function re(t,r){return JSON.stringify({command:t,...r})+`
3
+ `}var e=t=>t,ne={FlowStateful:e({type:"req StatefulType",role:"opt StatefulRole",kind:"opt string",pairs_with:"opt string|null",end_control:"opt string|null"}),StatefulVerdict:e({key:"req string",verdict:"req StatefulVerdictKind",confidence:"opt number",reason:"opt string",end_control:"opt string|null",source:"opt StatefulVerdictSource",run_id:"opt string"}),Budget:e({actions:"opt integer",wall_clock_s:"opt integer",model_calls:"opt integer",max_leases:"opt integer|null"}),FlowDef:e({id:"req string",name:"req string",entry:"req string",description:"opt string",parent_id:"opt string|null",exit:"opt string|null",origin:"opt FlowOrigin",priority:"opt integer",assertions:"opt Assertion[]",annotations:"opt map<string>",owners:"opt map<Ownership>",current_observation:"opt string|null",status:"opt FlowStatus",steps_key:"opt string|null",supersedes:"opt string|null",superseded_by:"opt string|null",after_flow:"opt string|null",state:"opt boolean",in_state:"opt string|null",pending_landing:"opt PendingLanding|null",stateful:"opt FlowStateful|null",plan:"opt FlowPlanRevision|null",finding_ids:"opt string[]",feedback:"opt FeedbackRecord[]",changes:"opt FlowChange[]"}),FlowChange:e({run_id:"req string",observation_id:"req string",kind:"req FlowChangeKind",adapted_at:"req integer",from_exit:"opt string|null",to_exit:"opt string|null"}),Delta:e({seq:"req integer",attempt:"req integer",run_id:"req string",lease_id:"req string",junctions:"opt Junction[]",flows:"opt FlowDef[]",candidates:"opt Candidate[]",observations:"opt Observation[]",findings:"opt Finding[]",suggestions:"opt Suggestion[]",lease:"opt Lease|null",evidence:"opt EvidenceRef[]",aliases:"opt map<string>",entry:"opt string|null",verdicts:"opt MatchVerdict[]",stateful_verdicts:"opt StatefulVerdict[]",feedback:"opt FeedbackRecord[]",feedback_applied:"opt FeedbackApplied[]"}),Parallelism:e({max_parallel:"opt integer",peak:"opt integer",average:"opt number",opened:"opt integer"}),Focus:e({junction_id:"req string",name:"opt string",path_len:"opt integer|null"}),Remark:e({code:"req string",message:"opt string"}),CreditReport:e({total:"opt number",calls:"opt integer",by_node:"opt map<number>",by_phase:"opt map<number>",request_ids:"opt string[]"}),AuditNote:e({kind:"req AuditKind",text:"req string",count:"opt integer",first_lease:"opt string"}),RunRecord:e({run_id:"req string",locale:"opt string",complete:"opt boolean",started_at:"opt string",credits:"opt CreditReport|null",focus:"opt string|null",audit_notes:"opt AuditNote[]"}),Projection:e({exploration_id:"req string",project_id:"opt string|null",entry:"opt string|null",junctions:"opt Junction[]",flows:"opt FlowDef[]",candidates:"opt Candidate[]",observations:"opt Observation[]",findings:"opt Finding[]",aliases:"opt map<string>",rejected_pairs:"opt string[][]",runs:"opt RunRecord[]",last_seq:"opt integer",verdicts:"opt MatchVerdict[]",stateful_verdicts:"opt StatefulVerdict[]",labels:"opt ExplorationLabel[]",skill:"opt string|null",skill_run_id:"opt string|null"}),ExploreStart:e({run_id:"req string",exploration_id:"req string",attempt:"req integer",sessions:"req integer",policy:"req LeasePolicy",locale:"opt string",timezone:"opt string",accept_language:"opt string",focus:"opt Focus|null"}),LeaseStart:e({lease_id:"req string",kind:"req LeaseKind",worker_index:"req integer",target:"opt string|null",budget:"opt Budget",reach:"opt LeaseReach|null"}),ReachHop:e({kind:"req PathSegmentKind",flow_id:"opt string|null",to:"opt string|null",url_pattern:"opt string|null"}),LeaseReach:e({target:"opt string|null",path:"opt ReachHop[]"}),LeaseStep:e({lease_id:"req string",worker_index:"req integer",ordinal:"req integer",phase:"req LeaseStepPhase",junction_id:"opt string|null",known:"opt boolean",url_pattern:"opt string|null",flow_id:"opt string|null",intent:"opt string|null",navigated:"opt boolean",step_ordinal:"opt integer|null"}),SessionHeld:e({worker_index:"req integer",kind:"req string",start_flow:"opt string|null",junction_id:"opt string|null",url_pattern:"opt string|null"}),SessionReleased:e({worker_index:"req integer",reason:"opt string|null"}),LeaseEnd:e({lease_id:"req string",result:"req LeaseResult",reason:"opt string|null"}),MapDelta:e({delta:"req Delta"}),Progress:e({frontier:"req integer",visited:"req integer",active_workers:"req integer",elapsed_s:"req number",unacked:"req integer"}),SkillUpdated:e({version:"req integer",run_id:"req string",summary:"opt string",received:"opt string",dropped:"opt string[]"}),BrowserRequest:e({worker_index:"req integer"}),BrowserRelease:e({worker_index:"req integer"}),ExploreEnd:e({totals:"req map<integer>",stop_reason:"req string",unacked:"req integer",complete:"req boolean",remark:"req Remark",credits:"opt CreditReport",focus:"opt Focus|null",refused:"opt string|null",parallelism:"opt Parallelism|null",audit_notes:"opt AuditNote[]"}),BrowserReady:e({worker_index:"req integer",cdp_endpoint:"opt string|null",ws_endpoint:"opt string|null"}),BrowserFailed:e({worker_index:"req integer",reason:"req string"}),DeltaAck:e({seq:"req integer",committed:"req boolean"}),CommitRefused:e({seq:"req integer",reason:"req string"}),TargetsAdded:e({flows:"opt FlowDef[]"}),Stop:e({browsers_released:"opt boolean"}),FramesStart:e({worker_index:"req integer"}),FramesStop:e({worker_index:"req integer"}),FramesAck:e({worker_index:"req integer"}),ExploreFrame:e({worker_index:"req integer",data:"req string",at_ms:"req integer"})};var d="mutating";function z(t){return typeof t=="string"&&o.includes(t)}function ae(t){let r=t.policy;if(r==null||r==="")return{policy:d};let n=String(r).trim();return z(n)?{policy:n}:{error:`--policy ${JSON.stringify(n)}: one of ${o.join(", ")}`,next:`pass --policy read_only (only reads) or --policy mutating (may change data); the default is ${d}`}}function le(t){return t==="mutating"?"mutating":"read-only"}function de(t){return t==="mutating"?"mutating":"read_only"}var pe="--allow-post has no effect under --policy mutating";function Q(t){try{return new URL(t).host||t}catch{return t}}function ce(t){return`This run may change data on ${Q(t)} and any site it reaches (policy mutating). Nothing is blocked except controls named in --deny. Use --policy read_only to only read.`}function ue(t=new l){return{confirmed:r=>(t.load().explore_mutating_confirmed??[]).includes(r),remember:r=>{let n=t.load().explore_mutating_confirmed??[];n.includes(r)||t.set("explore_mutating_confirmed",[...n,r])}}}export{m as a,Z as b,o as c,k as d,ee as e,G as f,Y as g,$ as h,X as i,te as j,re as k,d as l,z as m,ae as n,le as o,de as p,pe as q,Q as r,ce as s,ue as t};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{$ as g,V as a,W as b,X as c,Y as d,Z as e,_ as f,_a as r,aa as h,ba as i,ca as j,da as k,ea as l,fa as m,ga as n,ha as o,ia as p,ja as q}from"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-7V4BQSSV.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-UR6MHSHU.js";export{a as SLUG_RE,b as checkAcyclic,c as checkCardinality,d as citesOf,p as commitDeferGap,n as commitNames,m as commitPairMerge,k as commitProposal,o as commitRetire,l as commitReviewFacts,e as criteriaShape,h as mintEventId,i as nextEventIds,r as recordsSince,q as resolveDeferGaps,j as resolveLivingTip,f as validateCriterionOps,g as validateProposal};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b,c}from"./chunk-MGNRNLBE.js";import"./chunk-XBEYWXPV.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";export{a as getEnvironment,c as latticeAddress,b as targetEnv};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a}from"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-UR6MHSHU.js";export{a as ControllerClient};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as X}from"./chunk-OQ5G773E.js";import"./chunk-3AGP2BVN.js";import{N as x,O as J,Q as z}from"./chunk-432ZOE42.js";import"./chunk-TW63WWEN.js";import"./chunk-A6TJOZ24.js";import"./chunk-CB4ARIHR.js";import{f as B,g as j}from"./chunk-QTZBVDPR.js";import"./chunk-BSRSXYDZ.js";import{a as D,f as T}from"./chunk-HQ2E2XCU.js";import{g as E,h,i as k,k as P,l as L,m as M,n as C,o as F,r as H}from"./chunk-SMTBOSEJ.js";import"./chunk-WOSANGV6.js";import{e as U}from"./chunk-65VANXOF.js";import"./chunk-34R7BNZ2.js";import{e as Y}from"./chunk-NWD54VV5.js";import{i as K}from"./chunk-XMPTFXPW.js";import{b as q}from"./chunk-L4UVUFL6.js";import"./chunk-73Y6T2UK.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import{b as y,c as _}from"./chunk-MNBGG4H3.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-REKHAN53.js";import"./chunk-VLDCHFXF.js";import"./chunk-ZFM77AQU.js";import"./chunk-SWMTXMKB.js";import"./chunk-XZYA7DNH.js";import{Ha as v,f as W,x as R}from"./chunk-W3OVSDBN.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import{a as G}from"./chunk-I2MC6VVX.js";import"./chunk-RPRXRKKR.js";import"./chunk-QXQ7KVEN.js";import"./chunk-57MDWTON.js";import"./chunk-NWBLYMH7.js";import"./chunk-QSCXXNC2.js";import{oa as I,vb as A}from"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-PUVMC4PX.js";import"./chunk-B7ZX5HEN.js";import{b as N}from"./chunk-VZ7KXRXB.js";import"./chunk-7V4BQSSV.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-MGNRNLBE.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-XBEYWXPV.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import{a as S}from"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import{y as O}from"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";import{readdirSync as fe,statSync as ge}from"fs";import{join as ve}from"path";import{basename as Q,relative as ae}from"path";var ce={label:"to bring the project's tests into this folder, run:",cmd:"kane-cli context pull",agentCmd:"kane-cli context pull --mode agent",why:"brings the project's tests into this folder"},ie=["proven","partial","failing","not_run","not_designed","no_criteria"],b=e=>`${e} use-case${e===1?"":"s"}`,ue=e=>`${e} ${e===1?"criterion":"criteria"}`,V={high:0,med:1,low:2};function le(e,r){let n=new Map;for(let[t,c]of _(y(r)))c.length===1&&n.set(t,ae(r,c[0]));let{inScope:s}=L(e),o=M(e,new Set(s)),i=new Map(s.map(t=>[C(e,t),t]));return(t,c)=>{for(let l of o.get(i.get(t.id))??[])if(c(C(e,l)))for(let a of F(e,l)){let u=n.get(C(e,a));if(u)return u}}}function Z(e,r){let n=t=>({uc:t.id,title:t.title,cmd:`kane-cli design tests --use-case ${t.id}`,agentCmd:`kane-cli design tests --use-case ${t.id} --mode agent`,why:"designs its tests"}),s=(t,c,l)=>({uc:t.id,title:t.title,cmd:`kane-cli testmd run ${c}`,agentCmd:`kane-cli testmd run ${c} --agent`,why:l}),o=e.perUc.map((t,c)=>({u:t,i:c})).sort((t,c)=>(V[t.u.risk]??3)-(V[c.u.risk]??3)||t.i-c.i).map(({u:t})=>t);if(e.note==="nothing_run_yet"){let t=o.find(c=>c.state==="not_designed"||c.state==="no_criteria");return[{cmd:"kane-cli testrun run",agentCmd:"kane-cli testrun run --agent",why:"runs every test"},...t?[n(t)]:[]]}let i=[];for(let t of o)if(t.state==="not_designed"||t.state==="no_criteria")i.push(n(t));else if(t.state==="failing"){let c=r(t,l=>e.perAc[l]?.state==="failing");c&&i.push(s(t,c,"runs its failing test again"))}else if(t.state==="partial"||t.state==="not_run"){let c=r(t,l=>e.perAc[l]?.state!=="proven");c&&i.push(s(t,c,"runs its test"))}return i.slice(0,2)}function ee(e,r){let n=A(e),s=H({graph:n,runs:P(n)});return{source:"project",doc:s,next:Z(s,le(n,r)).map(({agentCmd:o,...i})=>i)}}function te(e,r){let n=Z(e,()=>{}),s=n.filter(o=>!/^kane-cli (testrun|testmd) run\b/.test(o.cmd));return k(e)===0&&s.length>0?{source:"project",doc:e,next:s}:r.testsHere||k(e)===0?{source:"project",doc:e,next:n}:{source:"project",doc:e,next:[ce,...s]}}async function re(e,r){let n=await T(e,r);if(!n)return{error:`no evidence pack at '${e}'`};let s=await U(n,"coverage/usecases.yaml");if(s==null)return{error:`${Q(n)} carries no coverage/usecases.yaml \u2014 the pack predates coverage or its project had no .context at seal time`};let o=N(s);if(!o||!Array.isArray(o.usecases))return{error:`${Q(n)}: coverage/usecases.yaml is not a usecases document`};if(o.coverage?.coverage_version===2)return{source:"pack",pack:n,doc:o.coverage};let i=o.rollup?.aspects??{},t=i.lenient??Object.values(i)[0];return{source:"pack",pack:n,sealed_rule:"earlier",pct:t?.summary?.coverage_pct??0,reached:o.usecases.length}}function de(e,r){if(e.state==="no_criteria")return"no criteria yet";let n=e.criteria>0&&e.proven===e.criteria?`${e.proven} of ${e.criteria} criteria proven`:`${e.proven} of ${e.criteria} proven`,s=Object.values(r.perAc).filter(o=>o.uc===e.id&&o.state==="failing").length;return[n,...s?[`${s} failing`]:[],...e.manual_runs?[`${e.manual_runs} run by hand`]:[],...e.stale?["its source changed"]:[]].join(" \xB7 ")}function me(e){let r=e.perUc.filter(s=>s.stale).length,n=e.flags.orphaned_usecases;return[...r===1?["1 use-case's source changed since; kane-cli context list --stale lists it"]:r>1?[`${r} use-cases' sources changed since; kane-cli context list --stale lists them`]:[],...e.flags.sources_not_fully_extracted.map(s=>`"${s}" isn't fully extracted yet, so more use-cases may count later`),...n===1?["1 use-case isn't counted: every source it came from was removed"]:n>1?[`${n} use-cases aren't counted: every source they came from was removed`]:[]]}var pe="a new run can take up to 5 minutes to count";function ne(e,r){let n=a=>r.color?S.hex(O.dim)(a):a,s=a=>X(a,{width:r.width-12,badgeHeader:"coverage",color:r.color}).map(u=>` ${u}`);if("sealed_rule"in e)return["sealed under the earlier rule, this pack counts only the use-cases it reached",` its own figure: ${Math.round(e.pct)}% across the ${e.reached===1?"1 use-case":`${e.reached} use-cases`} it reached`,"for coverage so far, run: kane-cli cover"];let{doc:o}=e;if(e.source==="pack"){let a=o.this_run??{usecases:[],criteria_passed:[],criteria_failed:[]},u=a.criteria_failed.length,$=o.perUc.map(d=>{if(!d.this_run)return{id:d.id,title:d.title,badge:"0% not reached",summary:"not run by this run"};let f=Object.values(o.perAc).filter(p=>p.uc===d.id),m=f.filter(p=>p.this_run==="passed").length,g=f.filter(p=>p.this_run==="failed").length;return{id:d.id,title:d.title,badge:`${Math.round(d.pct)}% ${h[d.state]}`,summary:`${m} of ${d.criteria} passed in this run${g?` \xB7 ${g} failed`:""}`}});return[`coverage from this pack's run: ${Math.round(o.pct)}% across its ${b(o.usecases.total)}`,` the run reached ${b(a.usecases.length)}: ${ue(a.criteria_passed.length)} passed${u?`, ${u} failed`:""}`,"",...s($),"for coverage so far, run: kane-cli cover"]}let i=r.project!==void 0?`"${r.project}"'s`:"this folder's",t=ie.filter(a=>o.usecases[a]>0).map(a=>`${o.usecases[a]} ${h[a]}`),c=me(o),l=o.perUc.map(a=>({id:a.id,title:a.title,badge:`${Math.round(a.pct)}% ${h[a.state]}`,summary:de(a,o)}));return[`coverage: ${Math.round(o.pct)}% across ${i} ${b(o.usecases.total)}${o.note==="nothing_run_yet"?" \xB7 nothing run yet":""}`,...t.length?[` ${t.join(" \xB7 ")}`]:[],...r.recentRun?[pe]:[],...l.length?["",...s(l)]:[],...c.map(a=>n(` ${a}`)),...c.length&&e.next.length?[""]:[],...e.next.flatMap(a=>[a.label!==void 0?`next: ${a.label}`:a.uc!==void 0?`next: for ${I(a.uc)} "${a.title}", run:`:"next: to run every test, run:",` ${a.cmd}`])]}var he=5*6e4;function Ce(e,r=Date.now()){let n=D(e);try{return fe(n).some(s=>s.endsWith(".evidence")&&r-ge(ve(n,s)).mtimeMs<he)}catch{return!1}}function w(e,r=!1){return e.source==="project"?{source:"project",...e.doc,...r?{recent_run:{may_not_count_yet:!0,up_to_minutes:5}}:{}}:"sealed_rule"in e?{source:"pack",pack:e.pack,sealed_rule:e.sealed_rule,pct:e.pct,usecases_reached:e.reached}:{source:"pack",pack:e.pack,...e.doc}}async function oe(e,r,n){if(e.from){let o=await re(e.from,n);return"error"in o?(x(r,o.error),null):o}let s=J(n,r);return s?ee(s,n):null}var ye={coverage_version:2,scope:"project",config:{rule:"newest_counted_verdict",weighting:"risk",weights:E},pct:0,note:"nothing_run_yet",usecases:{total:0,proven:0,partial:0,failing:0,not_run:0,not_designed:0,no_criteria:0},criteria:{total:0,proven:0},perUc:[],perAc:{},flags:{stale_sources:0,sources_not_fully_extracted:[],orphaned_usecases:0}};async function se(e,r,n,s){let o=e.projectName;try{let i=n.read??(async l=>W({url:e.latticeUrl,basicAuth:await(n.auth??Y)()}).projectCoverage(l)),{state:t,doc:c}=await i(e.projectId);return t==="computing"?"computing":t==="ready"&&c!==null?te(c,{testsHere:s}):R(null,j(v.coverReadFailed(o),"cover",r))}catch(i){return i instanceof K?B({code:i.code,message:i.message,...i.remedy?{remedy:i.remedy}:{}},"cover",r):i instanceof G&&i.code==="NO_CONTEXT"?{source:"project",doc:ye,next:[]}:R(i,j(v.assuranceOffOr(i,o,v.coverReadFailed(o)),"cover",r))}}async function Be(e,r=z(),n=process.cwd(),s={}){if(e.mode!==void 0&&e.mode!=="agent"&&e.mode!=="ci"&&e.mode!=="interactive")return x(r,`--mode must be interactive | agent | ci, got '${e.mode}'`),2;let o=e.mode==="agent"||e.mode==="ci",i=e.from===void 0?q(n):null,t=i?.kind==="remote"?i:null,c=t!==null&&Ce(n),l=t!==null&&_(y(n)).size>0;if(o){let{makeHeadlessIO:u,agentRefusal:$}=await import("./headless-io-FFM5T6KL.js"),d=u("ndjson","cover",{stdout:m=>r.out(m.replace(/\n$/,"")),stderr:m=>(r.err??r.out)(m.replace(/\n$/,""))}),f;if(t!==null){let m=await se(t,!0,s,l);if(typeof m=="number")return m;if(m==="computing")return d.event({type:"coverage",source:"project",state:"computing"}),d.done(0,void 0,[{cmd:"kane-cli cover --mode agent",why:"the shared project is still working it out"}]);f=m}else{let m=[],g=await oe(e,{out:()=>{},err:p=>m.push(p),confirm:async()=>!1,isTTY:!1},n);if(!g)return $(d,m.join("; ")||"cover refused");f=g}return d.event({type:"coverage",...w(f,c)}),d.done(0,void 0,f.source==="project"?f.next.map(({cmd:m,agentCmd:g,why:p})=>({cmd:g??m,why:p})):[])}let a;if(t!==null){let u=await se(t,!1,s,l);if(typeof u=="number")return u;if(e.json)return r.out(JSON.stringify(u==="computing"?{source:"project",state:"computing"}:w(u,c),null,2)),0;if(r.out(`using project "${t.projectName}", shared with your team`),r.out(""),u==="computing")return r.out(v.coverComputing(t.projectName)),0;a=u}else{let u=await oe(e,r,n);if(!u)return 2;if(a=u,e.json)return r.out(JSON.stringify(w(a),null,2)),0}for(let u of ne(a,{color:r.isTTY===!0,width:process.stdout.columns??120,...t!==null?{project:t.projectName}:{},...c?{recentRun:c}:{}}))r.out(u);return 0}export{Be as coverCommand};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-5ESGUPSR.js";import"./chunk-CXF6AZWY.js";import"./chunk-UR6MHSHU.js";export{a as CredentialsManager};
2
+ import{a}from"./chunk-XBEYWXPV.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";export{a as CredentialsManager};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk-GFNCGN5V.js";import"./chunk-MSGW4JDG.js";import"./chunk-4JOD47QI.js";import"./chunk-CXF6AZWY.js";import"./chunk-UR6MHSHU.js";export{a as DEPS_INSTALL_SCHEMA_VERSION,i as DepsBundleResolver,c as DepsInstallRequiredError,h as NoPublishedBundleError,b as classOfTarget,g as downloadPayload,e as formatEta,d as formatRate,j as managedDeps,f as planRangeParts};
2
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-D4FFXCX6.js";import"./chunk-4JOD47QI.js";import"./chunk-GMTHZUZ3.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";export{a as DEPS_INSTALL_SCHEMA_VERSION,i as DepsBundleResolver,c as DepsInstallRequiredError,h as NoPublishedBundleError,b as classOfTarget,g as downloadPayload,e as formatEta,d as formatRate,j as managedDeps,f as planRangeParts};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import"./chunk-UR6MHSHU.js";var c="Mobile dependencies are resolved through your KaneAI account. Run `kane-cli login` first.";function d(l,o,e=process.env){return e.KANE_MOBILE_DEPS_BASE_URL||o(l)}async function u(){let[{CredentialsManager:l},{refreshOAuthToken:o},{getEnvironment:e},{ControllerClient:n}]=await Promise.all([import("./credentials-PSQWWFGD.js"),import("./token-refresh-TKBOHXSD.js"),import("./config-7E4NS553.js"),import("./controller-client-ZF5IXRUV.js")]),s=new l;return{creds:s,refresh:r=>o({creds:s,profile:r.profile,env:r.env,credentials:r.credentials}),controllerBaseUrlFor:r=>d(r,t=>e(t).controllerBaseUrl),makeClient:(r,t)=>new n(r,t)}}function p(l){return async o=>{let e=l??await u(),n=e.creds.getActiveProfile();if(!n)throw new Error(c);let s=e.creds.getDefaultEnv(),r=e.controllerBaseUrlFor(s),t=e.creds.loadBasicAuth(n,s);if(t)return e.makeClient(r,{username:t.username,accessKey:t.access_key}).resolveMobileDepsBundle(o);let i=e.creds.loadCredentials(n,s);if(!i)throw new Error(c);try{await e.refresh({creds:e.creds,profile:n,env:s,credentials:i})}catch{}let a=(e.creds.loadCredentials(n,s)??i).access_token;if(typeof a!="string"||!a)throw new Error(c);return e.makeClient(r,a).resolveMobileDepsBundle(o)}}export{p as controllerResolveBundle,d as depsControllerBaseUrl};
2
+ import"./chunk-UR6MHSHU.js";var c="Mobile dependencies are resolved through your KaneAI account. Run `kane-cli login` first.";function d(l,o,e=process.env){return e.KANE_MOBILE_DEPS_BASE_URL||o(l)}async function u(){let[{CredentialsManager:l},{refreshOAuthToken:o},{getEnvironment:e},{ControllerClient:n}]=await Promise.all([import("./credentials-MRG452Y6.js"),import("./token-refresh-4UCYAG6A.js"),import("./config-5ZOALGKE.js"),import("./controller-client-PB3AZAGG.js")]),s=new l;return{creds:s,refresh:r=>o({creds:s,profile:r.profile,env:r.env,credentials:r.credentials}),controllerBaseUrlFor:r=>d(r,t=>e(t).controllerBaseUrl),makeClient:(r,t)=>new n(r,t)}}function p(l){return async o=>{let e=l??await u(),n=e.creds.getActiveProfile();if(!n)throw new Error(c);let s=e.creds.getDefaultEnv(),r=e.controllerBaseUrlFor(s),t=e.creds.loadBasicAuth(n,s);if(t)return e.makeClient(r,{username:t.username,accessKey:t.access_key}).resolveMobileDepsBundle(o);let i=e.creds.loadCredentials(n,s);if(!i)throw new Error(c);try{await e.refresh({creds:e.creds,profile:n,env:s,credentials:i})}catch{}let a=(e.creds.loadCredentials(n,s)??i).access_token;if(typeof a!="string"||!a)throw new Error(c);return e.makeClient(r,a).resolveMobileDepsBundle(o)}}export{p as controllerResolveBundle,d as depsControllerBaseUrl};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-Z55KBMYV.js";import"./chunk-LD5B3QFW.js";import"./chunk-KU3YHPWZ.js";import"./chunk-UR6MHSHU.js";export{a as CORE_COMPUTED_EDGE_PROPS,b as topologyDescriptor};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as c}from"./chunk-KM3YCIDV.js";import{a as l}from"./chunk-JQSLUGD4.js";import"./chunk-NWBLYMH7.js";import"./chunk-QSCXXNC2.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";async function S(e){let{site:i,store:s}=e,[{makeChatController:p},{commitChatTurn:m},{topologyDescriptor:u},{explain:g},{buildDossier:h},{testDefinitionOf:d}]=await Promise.all([import("./chat-controller-XINCDH6Z.js"),import("./chat-committer-ZCSRJEUB.js"),import("./descriptor-7T32VRMB.js"),import("./explain-DGJ5T6V5.js"),import("./dossier-NROC2MCY.js"),import("./test-definition-VRI4YIYL.js")]),n={current:null},a={current:[]},o=p({commitChatTurn:t=>m({...t,store:s,definitionOf:d}),descriptor:u("design"),store:s,refreshGraph:()=>i.graph(),graph:i.graph(),explain:g,by:{kind:"human",id:"owner"},templateVersion:()=>n.current,pendingForceScope:()=>a.current,...e.useCase?{ucRef:e.useCase}:{}});return{controller:o,inspect:t=>{try{return h(i.graph(),t)}catch{return null}},runDeps:t=>({store:s,projectDir:process.cwd(),...e.testFilesAt?{testFilesAt:e.testFilesAt}:{},agent:e.agent,tracePath:l,credentials:e.credentials,onIngestRefusal:c,onTemplateVersion:r=>{n.current=r},onForceScope:r=>{a.current=r},preflightTurn:e.preflight,...t.onSummary?{onSummary:t.onSummary}:{},ask:r=>o.ask(r),out:r=>o.note(r),progress:()=>{},isTTY:t.isTTY,auth:e.auth,chat:o,...t.telemetry?{telemetry:t.telemetry}:{}})}}export{S as buildDesignChat};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b,c,d,e,f,g}from"./chunk-D756UWY2.js";import"./chunk-LX2I4JEH.js";import"./chunk-O3HHTKZ5.js";import"./chunk-3GXN6VF6.js";import"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-7V4BQSSV.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-UR6MHSHU.js";export{a as blockerRefResolver,e as captureForceScope,f as commitDesign,g as designPhaseLadder,b as forceConsumedLabels,d as forceRemainderOf,c as splitForceScope};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a}from"./chunk-QNLVC5ZB.js";import"./chunk-YIKF4ERQ.js";import"./chunk-QI5RZ7LL.js";import"./chunk-44B6THYK.js";import"./chunk-W7FLXW6Q.js";import"./chunk-KM3YCIDV.js";import"./chunk-R4JUKTDO.js";import"./chunk-OJ33Q6DU.js";import"./chunk-7KX2BHKG.js";import"./chunk-D756UWY2.js";import"./chunk-LX2I4JEH.js";import"./chunk-O3HHTKZ5.js";import"./chunk-NXRF7FFS.js";import"./chunk-E6KSRQXL.js";import"./chunk-54XA5MZH.js";import"./chunk-QDFY5GGO.js";import"./chunk-VZJ6LUXX.js";import"./chunk-35ECWCCK.js";import"./chunk-IZ65ZPWY.js";import"./chunk-EF47KRUK.js";import"./chunk-3GXN6VF6.js";import"./chunk-Z55KBMYV.js";import"./chunk-LD5B3QFW.js";import"./chunk-3BSYOCSW.js";import"./chunk-JQSLUGD4.js";import"./chunk-63EKRZKI.js";import"./chunk-3JLEDSG5.js";import"./chunk-42PALMW2.js";import"./chunk-ZFMRQ57Y.js";import"./chunk-PZA3BSOE.js";import"./chunk-2RUSXQ3O.js";import"./chunk-KF4DKXSS.js";import"./chunk-AUJSC7PU.js";import"./chunk-JNSWKGTB.js";import"./chunk-UUJIGOEO.js";import"./chunk-ZTHYAHDN.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-AZLNLHUA.js";import"./chunk-AQ2OG2EF.js";import"./chunk-DPGOAFKF.js";import"./chunk-4IEQNX7F.js";import"./chunk-MNBGG4H3.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-GRURFGBP.js";import"./chunk-MYZHOBS4.js";import"./chunk-7XBNMOH4.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-ZFM77AQU.js";import"./chunk-SWMTXMKB.js";import"./chunk-XZYA7DNH.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-I2MC6VVX.js";import"./chunk-QXQ7KVEN.js";import"./chunk-NWBLYMH7.js";import"./chunk-QSCXXNC2.js";import"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-PUVMC4PX.js";import"./chunk-B7ZX5HEN.js";import"./chunk-VZ7KXRXB.js";import"./chunk-7V4BQSSV.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-GMTHZUZ3.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-MGNRNLBE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-XBEYWXPV.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";export{a as headlessDesign};
@@ -0,0 +1,3 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as m}from"./chunk-XIPKSXRQ.js";import"./chunk-432ZOE42.js";import"./chunk-TW63WWEN.js";import"./chunk-A6TJOZ24.js";import"./chunk-CB4ARIHR.js";import"./chunk-BSRSXYDZ.js";import"./chunk-R7KXAISS.js";import"./chunk-WMGKUERB.js";import"./chunk-WOSANGV6.js";import{e as C}from"./chunk-NWD54VV5.js";import{b as p,e as g,h as u,i as w}from"./chunk-XMPTFXPW.js";import{d as h}from"./chunk-L4UVUFL6.js";import"./chunk-73Y6T2UK.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-MNBGG4H3.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import{j as v}from"./chunk-REKHAN53.js";import"./chunk-EZN7CF45.js";import"./chunk-7XBNMOH4.js";import"./chunk-ZCIWQHCO.js";import"./chunk-ZFM77AQU.js";import"./chunk-SWMTXMKB.js";import"./chunk-XZYA7DNH.js";import"./chunk-W3OVSDBN.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-I2MC6VVX.js";import"./chunk-RPRXRKKR.js";import"./chunk-QXQ7KVEN.js";import"./chunk-57MDWTON.js";import"./chunk-NWBLYMH7.js";import"./chunk-QSCXXNC2.js";import{na as f,oa as l}from"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-PUVMC4PX.js";import"./chunk-B7ZX5HEN.js";import"./chunk-VZ7KXRXB.js";import"./chunk-7V4BQSSV.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-MGNRNLBE.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-XBEYWXPV.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";function b(n){return n.useCase!==void 0&&f.test(n.useCase)?{...n,useCase:n.useCase.toLowerCase()}:n}async function E(n,a,e="agent"){let s=b(n),r=v(g(p(e,s.json===!0),"design"),{atQuestionsOnly:!0}),o=m(s);if("error"in o)return u(r,o.error,"USAGE");let{answerGate:d}=await import("./gate-P57VP4E5.js"),i=d({...s,mode:e},"design tests");if(i!==null)return u(r,i.message,i.code,i.remedy);let c;try{c=await C()}catch(t){if(t instanceof w)return u(r,t.message,t.code,t.remedy);throw t}let{runRemote:x,controllerCheck:y}=await import("./run-remote-3AYYVPKX.js"),I=await x({verb:"design",mode:"agent",choice:a,basicAuth:c,start:s.resume?{kind:"resume",sessionId:s.resume}:{kind:"new",body:{projectId:a.projectId,verb:"design",mode:"agent",useCase:s.useCase}},run:{...s.useCase!==void 0?{useCase:s.useCase}:{},...s.message!==void 0?{message:s.message}:{},...s.force!==void 0?{force:s.force}:{},...s.allowUnreviewed!==void 0?{allowUnreviewed:s.allowUnreviewed}:{},...s.phase!==void 0?{phase:s.phase}:{},...s.plan!==void 0?{plan:s.plan}:{},...s.max!==void 0?{max:s.max}:{},...s.strength!==void 0?{strength:s.strength}:{},...s.answer?.length?{answer:s.answer}:{},...e==="override"?{override:!0}:{}},io:r,check:y,onProgress:()=>{},onOpened:t=>h(process.cwd(),t.userId),signals:!0});return r.done(I)}async function T(n,a){let e=b(n),{answerGate:s,printPair:r}=await import("./gate-P57VP4E5.js"),o=m(e);if("error"in o)return process.stderr.write(`${o.error}
3
+ `),2;let d=s(e,"design tests");if(d!==null)return r(d),2;let{runInteractiveRemote:i}=await import("./interactive-remote-D77ULJGL.js");return i({verb:"design",choice:a,start:e.resume?{kind:"resume",sessionId:e.resume}:{kind:"new",body:{projectId:a.projectId,verb:"design",mode:"interactive",useCase:e.useCase}},run:{...e.useCase!==void 0?{useCase:e.useCase}:{},...e.message!==void 0?{message:e.message}:{},...e.force!==void 0?{force:e.force}:{},...e.allowUnreviewed!==void 0?{allowUnreviewed:e.allowUnreviewed}:{},...e.phase!==void 0?{phase:e.phase}:{},...e.plan!==void 0?{plan:e.plan}:{},...e.max!==void 0?{max:e.max}:{},...e.strength!==void 0?{strength:e.strength}:{}},...e.useCase?{subject:l(e.useCase)}:{}})}export{E as bindDesignRemote,T as bindDesignRemoteInteractive};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{c as a,d as b,e as c}from"./chunk-UAWWLLTI.js";import"./chunk-Y6Y6RAY4.js";import"./chunk-SA6IKFFD.js";import"./chunk-SXRHKXSE.js";import"./chunk-MGNRNLBE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-XBEYWXPV.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";export{a as evidenceAppName,b as readFirstStepPixelWindow,c as withDeviceSkin};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{h as a,i as b,j as c,k as d,l as e,m as f}from"./chunk-ZTHYAHDN.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-AZLNLHUA.js";import"./chunk-AQ2OG2EF.js";import"./chunk-DPGOAFKF.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-ZFM77AQU.js";import"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-7V4BQSSV.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-UR6MHSHU.js";export{b as REMOTE_PROVIDERS,e as badIdMessage,d as findProvider,f as findProviderByName,a as landingReceipt,c as looksLikeUrl};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b,c,d}from"./chunk-DHQ4SQWA.js";import"./chunk-2OOFURWD.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-D4FFXCX6.js";import"./chunk-TZXXJWHA.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-GMTHZUZ3.js";import"./chunk-RZ4F3BHX.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";export{d as doctorExitCode,c as doctorPreflightBlocked,b as renderDoctorText,a as runDoctor};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-PZA3BSOE.js";import"./chunk-2RUSXQ3O.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-AQ2OG2EF.js";import"./chunk-ZFM77AQU.js";import"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-7V4BQSSV.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-GMTHZUZ3.js";import"./chunk-UR6MHSHU.js";export{a as DOCX_CONVERTER_POLICY,b as DOCX_CONVERTER_VERSION,d as DOCX_IMAGE_CAP,c as DOCX_IMAGE_DIMENSION_FLOOR,f as DOCX_IMAGE_MAX_BYTES,g as DOCX_IMAGE_MAX_PIXELS,e as DOCX_VISION_BYTE_BUDGET,i as convertDocx,h as renderTokens};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as d}from"./chunk-RRY5IXOB.js";import"./chunk-IICT4VOU.js";import"./chunk-D6E6KRVX.js";import"./chunk-3UI5VTQS.js";import"./chunk-RDHWNSDP.js";import"./chunk-FQNQVC5O.js";import"./chunk-XLSOQLVT.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";var q=s=>`cite ${s.source_id??"?"} ${s.anchor??""}${s.quote?` \u2014 "${s.quote}"`:""}`;function E(s,_){let f=s.resolve(_);if(!f)return null;let c=f.tip,y=s.nodeLabel.get(c);if(!y)return null;let h=s.getNode(c);if(!h)return null;let r=h.content,p=s.displayNameOf(c)??_,a=[],o=(t,e,n=!1)=>{a.push({text:`${t.padEnd(12)} ${e}`,dim:n})},L=s.trust.get(c)??"derived";o("status",`${L}${s.superseded.has(c)?" \xB7 superseded":""}`,!0);let k=typeof r.risk=="string"?r.risk:null;k&&o("risk",k);for(let[t,e]of[["title",null],["description","description"],["value","value"],["summary","summary"],["statement","statement"],["text","text"],["intent","intent"],["case_type","case type"],["technique_notes","technique"],["kind","kind"],["change_note","change"]]){if(!e)continue;let n=r[t];typeof n=="string"&&n&&o(e,n)}let u=[];{let t=f.cid,e=new Set;for(;!e.has(t);){e.add(t),u.push(t);let n=s.superseded.get(t);if(typeof n!="string")break;t=n}}let g=u.flatMap(t=>s.edgesInto(t)).filter(t=>t.type==="DERIVES"),x=t=>{if(!t.source_cid||!t.anchor)return;let e=/^L(\d+)-L(\d+)$/.exec(t.anchor);if(!e)return;let n=s.getNode(t.source_cid)?.content?.text_blob;if(typeof n!="string")return;let i=n.split(`
2
+ import"./chunk-VJGWVBZR.js";import{oa as d}from"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-7V4BQSSV.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-UR6MHSHU.js";var q=s=>`cite ${s.source_id??"?"} ${s.anchor??""}${s.quote?` \u2014 "${s.quote}"`:""}`;function E(s,_){let f=s.resolve(_);if(!f)return null;let c=f.tip,y=s.nodeLabel.get(c);if(!y)return null;let h=s.getNode(c);if(!h)return null;let r=h.content,p=s.displayNameOf(c)??_,a=[],o=(t,e,n=!1)=>{a.push({text:`${t.padEnd(12)} ${e}`,dim:n})},L=s.trust.get(c)??"derived";o("status",`${L}${s.superseded.has(c)?" \xB7 superseded":""}`,!0);let k=typeof r.risk=="string"?r.risk:null;k&&o("risk",k);for(let[t,e]of[["title",null],["description","description"],["value","value"],["summary","summary"],["statement","statement"],["text","text"],["intent","intent"],["case_type","case type"],["technique_notes","technique"],["kind","kind"],["change_note","change"]]){if(!e)continue;let n=r[t];typeof n=="string"&&n&&o(e,n)}let u=[];{let t=f.cid,e=new Set;for(;!e.has(t);){e.add(t),u.push(t);let n=s.superseded.get(t);if(typeof n!="string")break;t=n}}let g=u.flatMap(t=>s.edgesInto(t)).filter(t=>t.type==="DERIVES"),x=t=>{if(!t.source_cid||!t.anchor)return;let e=/^L(\d+)-L(\d+)$/.exec(t.anchor);if(!e)return;let n=s.getNode(t.source_cid)?.content?.text_blob;if(typeof n!="string")return;let i=n.split(`
3
3
  `).slice(Number(e[1])-1,Number(e[2])).join(" ").trim();return i?i.length>120?`${i.slice(0,119)}\u2026`:i:void 0},$=new Map,b=new Set;for(let t of g){let e=t.props;if(!e.claim)continue;let n=`${e.claim}|${e.source_id??"?"}|${e.source_cid??"?"}|${e.anchor??"?"}`;if(b.has(n))continue;b.add(n);let i=$.get(e.claim)??[];i.push({source_id:e.source_id,anchor:e.anchor,quote:x(e)}),$.set(e.claim,i)}let N=Array.isArray(r.criteria)?r.criteria:[];for(let[t,e]of N.entries()){o(t===0?"criteria":"",`${t+1}. ${e}`);for(let n of $.get(e)??[])a.push({text:` ${q(n)}`,dim:!0})}let v=g.find(t=>!t.props.claim);if(v){let t=v.props;a.push({text:` ${q({...t,quote:x(t)})}`,dim:!0})}let l=r.check;l?.kind&&o("check",`${l.kind}${l.verified_against?` vs ${d(String(l.verified_against))}`:""}`);let m=r.expected_answer;m?.operator&&o("expects",`${m.operator} \xB7 ${String(m.operand??"")}`);let w=new Set,S=!0;for(let t of g){let e=t.props,n=`${e.source_id??"?"}@${e.source_cid??t.src}`;w.has(n)||(w.add(n),o(S?"provenance":"",`${e.source_id??"?"} @ ${String(e.source_cid??t.src).slice(7,15)}`,!0),S=!1)}let D=u.flatMap(t=>s.edgesFrom(t)).filter(t=>t.type==="depends_on");for(let[t,e]of D.entries()){let n=String(s.getNode(s.tipOf(e.dst))?.content?.title??""),i=s.displayNameOf(e.dst);o(t===0?"depends on":"",`${i?d(i):e.dst.slice(0,12)}${n?` ${n}`:""}`)}for(let[t,e]of s.retractedEdgesTouching(c).entries()){let n=u.includes(e.src),i=s.displayNameOf(n?e.dst:e.src)??(n?e.dst:e.src).slice(0,12),C=n?`${e.type} \u2192 ${d(i)}`:`${e.type} \u2190 ${d(i)}`,I=e.retraction.at.slice(0,10);o(t===0?"retracted":"",`${C} \u2014 ${I}${e.retraction.reason?` (${e.retraction.reason})`:""}`,!0)}return{id:d(p),rawId:p,title:String(r.title??r.text??r.statement??p),label:y,lines:a}}export{E as buildDossier};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{$ as fa,A as L,B as M,C as N,D as O,E as P,F as Q,O as R,P as S,Q as T,R as U,S as _,U as $,V as aa,W as ba,X as ca,Z as da,_ as ea,a as c,aa as ga,b as d,ba as ha,c as e,ca as ia,d as f,da as ja,e as g,f as h,g as i,h as j,i as t,j as u,k as v,l as w,m as x,n as y,o as z,p as A,q as B,r as C,s as D,t as E,u as F,v as G,w as H,x as I,y as J,z as K}from"./chunk-EXFDIVNI.js";import{a as V,b as W,c as X,d as Y,e as Z}from"./chunk-6U7ID777.js";import"./chunk-DREQ3RAA.js";import{a as n,b as o,c as p,e as q,f as r,g as s}from"./chunk-HQ2E2XCU.js";import"./chunk-SMTBOSEJ.js";import"./chunk-FIP5L6LV.js";import"./chunk-R7KXAISS.js";import"./chunk-WMGKUERB.js";import"./chunk-NLZZLANH.js";import"./chunk-WOSANGV6.js";import{a as k,b as l,c as m}from"./chunk-65VANXOF.js";import"./chunk-34R7BNZ2.js";import{a,f as b}from"./chunk-IINZZ4BZ.js";import"./chunk-NWD54VV5.js";import"./chunk-XMPTFXPW.js";import"./chunk-L4UVUFL6.js";import"./chunk-73Y6T2UK.js";import"./chunk-VG44B5JD.js";import"./chunk-UAWWLLTI.js";import"./chunk-Y6Y6RAY4.js";import"./chunk-SA6IKFFD.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-D4FFXCX6.js";import"./chunk-SXRHKXSE.js";import"./chunk-4JOD47QI.js";import"./chunk-VLDCHFXF.js";import"./chunk-EZN7CF45.js";import"./chunk-7XBNMOH4.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-ZFM77AQU.js";import"./chunk-SWMTXMKB.js";import"./chunk-XZYA7DNH.js";import"./chunk-W3OVSDBN.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-I2MC6VVX.js";import"./chunk-RPRXRKKR.js";import"./chunk-QXQ7KVEN.js";import"./chunk-57MDWTON.js";import"./chunk-NWBLYMH7.js";import"./chunk-QSCXXNC2.js";import"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-PUVMC4PX.js";import"./chunk-B7ZX5HEN.js";import"./chunk-VZ7KXRXB.js";import"./chunk-7V4BQSSV.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-GMTHZUZ3.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-MGNRNLBE.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-XBEYWXPV.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";export{P as EvidenceSession,C as appendExecutionPointer,M as assembleExecutionEnv,b as buildEnvironment,j as buildEvidenceRunConfig,i as buildExternalId,z as buildLogsMetaYaml,y as buildResultYaml,t as buildRunYaml,O as createCdpBrowserCapture,u as createRunningPack,v as createRunningPackRoot,H as declareLogsFromDir,J as diagnostics,x as discardPack,ba as ensureAuteurExecution,N as fetchCdpBrowserString,L as finalizeEvidencePack,U as finalizeInlineEvidence,K as finalizeMemberTestLogs,ea as flattenAuteurLeafIds,da as flattenAuteurLeaves,T as inlineEvidenceBlock,q as listPacks,p as newExecutionId,a as normalizeOs,S as noteInlineSpawn,$ as offerEvidenceView,o as packPath,I as packTestLogsDir,V as parseRange,D as readExecutionPointers,ja as readPackLeafIds,ia as readPackLeaves,s as recoverStore,ga as remapReplayActionIds,r as resolvePack,ha as resolveReplayResultSteps,F as rollupTestStatus,aa as runEvidenceMerge,_ as runEvidenceServe,E as runEvidenceValidate,Q as runStartupRecovery,l as sealPack,w as sealPackById,Z as serveHint,f as shortHash,e as slugify,W as startEvidenceLocalServer,R as startInlineEvidence,n as storeDir,m as sweepStore,fa as synthesizeSkippedTail,h as testIdForInline,g as testIdForTestmd,k as validatePack,c as verdictFromResultCode,X as viewerBaseFor,Y as viewerUrlFor,d as worstOf,G as worstResultCode,ca as writeAuteurDataset,B as writeLogsMeta,A as writeResult};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-7NCJMWFX.js";import"./chunk-HQ2E2XCU.js";import"./chunk-65VANXOF.js";import"./chunk-34R7BNZ2.js";import"./chunk-VZ7KXRXB.js";import"./chunk-UR6MHSHU.js";export{a as collectEvidenceRows,b as serveCommands};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as h,b as i,c as j,d as k}from"./chunk-BZVNI44O.js";import"./chunk-432ZOE42.js";import"./chunk-TW63WWEN.js";import"./chunk-A6TJOZ24.js";import"./chunk-CB4ARIHR.js";import"./chunk-BSRSXYDZ.js";import"./chunk-R7KXAISS.js";import"./chunk-WMGKUERB.js";import"./chunk-WOSANGV6.js";import"./chunk-XMPTFXPW.js";import"./chunk-73Y6T2UK.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-YDSGXB25.js";import{a,b,c,d,f as e,g as f,h as g}from"./chunk-LKQFG4RW.js";import"./chunk-I6S6DZ2E.js";import"./chunk-W7FLXW6Q.js";import"./chunk-R4JUKTDO.js";import"./chunk-OJ33Q6DU.js";import"./chunk-LD5B3QFW.js";import"./chunk-HD6NR44L.js";import"./chunk-42PALMW2.js";import"./chunk-MNBGG4H3.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-REKHAN53.js";import"./chunk-EZN7CF45.js";import"./chunk-7XBNMOH4.js";import"./chunk-ZCIWQHCO.js";import"./chunk-ZFM77AQU.js";import"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-PUVMC4PX.js";import"./chunk-B7ZX5HEN.js";import"./chunk-VZ7KXRXB.js";import"./chunk-7V4BQSSV.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";export{f as EVOLVE_SCOPE_ADVICE,g as composeEvolveStatement,b as designStateOf,k as evolveCommand,c as evolveOneUc,j as forwardChildLine,i as liveRunDesignForUc,e as namedEntityOf,a as resolveParentUc,h as runEvolveCommand,d as staleTargets};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{f as E,k as O}from"./chunk-LRS5MGBY.js";import"./chunk-SONMD3W5.js";import"./chunk-QCKA665H.js";import"./chunk-XJ7HCXKW.js";import{k as S}from"./chunk-QTZBVDPR.js";import"./chunk-NLZZLANH.js";import{e as w}from"./chunk-NWD54VV5.js";import{d as v,e as l,h as f,i as b}from"./chunk-XMPTFXPW.js";import{d as R}from"./chunk-L4UVUFL6.js";import"./chunk-73Y6T2UK.js";import"./chunk-HIUAUZNL.js";import"./chunk-252FWF2G.js";import"./chunk-JQSLUGD4.js";import"./chunk-FFL55I2M.js";import"./chunk-42PALMW2.js";import"./chunk-KF4DKXSS.js";import"./chunk-AUJSC7PU.js";import"./chunk-3QICDXY5.js";import"./chunk-ZTHYAHDN.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-AZLNLHUA.js";import"./chunk-AQ2OG2EF.js";import"./chunk-DPGOAFKF.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import{j as y}from"./chunk-REKHAN53.js";import"./chunk-ZFM77AQU.js";import"./chunk-SWMTXMKB.js";import"./chunk-XZYA7DNH.js";import"./chunk-W3OVSDBN.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-I2MC6VVX.js";import"./chunk-RPRXRKKR.js";import"./chunk-QXQ7KVEN.js";import"./chunk-57MDWTON.js";import"./chunk-NWBLYMH7.js";import"./chunk-QSCXXNC2.js";import{na as p}from"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-7V4BQSSV.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-MGNRNLBE.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-XBEYWXPV.js";import"./chunk-FOJHSG5M.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";var k=t=>t!==void 0&&p.test(t)&&/^uc-/i.test(t)?t.toLowerCase():void 0;async function _(t){let{opts:n,ref:s}=t,r=n.mode==="agent",g=t.testing?.agentLines?{stdout:t.testing.agentLines,stderr:()=>{}}:void 0;if(n.mode!==void 0&&n.mode!=="interactive"&&n.mode!=="agent")return f(l("ndjson","evolve",g),`--mode must be interactive | agent, got '${n.mode}'`,"MODE_USAGE");let i=r?y(l("ndjson","evolve",g),{atQuestionsOnly:!0}):null,I=!r&&(t.testing?.terminal??v()),a=(e,o=2)=>i?f(i,e.message,e.code,e.remedy):(S(e),o);if(s&&n.fromStale)return a({code:"USAGE",message:"pass a <ref> OR --from-stale, not both"});if(!s&&!n.fromStale)return a({code:"USAGE",message:"evolve needs a <ref> or --from-stale"});if(!r&&(n.answer?.length??0)>0)return a({code:"USAGE",message:"--answer rides --mode agent: the blast-radius question is asked on the stream and answered on the next call. In a terminal, answer the prompt instead"});if(!r&&!I)return a({code:"USAGE",message:"evolve needs a TTY \u2014 the blast-radius confirm is the point; headless, run with --mode agent (the question rides the stream and is answered with --answer on the next call)"});if(!r){let{runInteractiveRemote:e}=await import("./interactive-remote-D77ULJGL.js"),o=k(s);return e({verb:"evolve",choice:t.choice,start:{kind:"new",body:{projectId:t.choice.projectId,verb:"evolve",mode:"interactive",...o?{useCase:o}:{}}},run:{...s!==void 0?{ref:s}:{},...n.fromStale?{fromStale:!0}:{},...n.because?{because:n.because}:{},...o?{useCase:o}:{}},...o?{subject:o}:{}})}let h;try{h=t.testing?.basicAuth??await w()}catch(e){if(e instanceof b)return a({code:e.code,message:e.message,...e.remedy?{remedy:e.remedy}:{}});throw e}let d=k(s),m=[],u=null,c=await O({verb:"evolve",mode:"agent",choice:t.choice,basicAuth:h,start:{kind:"new",body:{projectId:t.choice.projectId,verb:"evolve",mode:"agent",...d?{useCase:d}:{}}},run:{...s!==void 0?{ref:s}:{},...n.fromStale?{fromStale:!0}:{},...n.because?{because:n.because}:{},...n.answer?.length?{answer:n.answer}:{},...d?{useCase:d}:{}},io:i,check:t.testing?.check??E,onProgress:()=>{},onNotUpdated:e=>{e.length>0&&(m=e)},onOpened:e=>{u=e.sessionId,R(process.cwd(),e.userId)},signals:!0,...t.testing?.run?{testing:t.testing.run}:{}});if(m.length===0)return i.done(c);let A=[...c===0&&u!==null?[{cmd:`kane-cli context sessions save ${u} --mode agent --yes`,why:"save the updates that finished"}]:[],...m.map(e=>({cmd:`kane-cli maintain evolve ${e} --mode agent`,why:"update its tests"}))];return i.done(c===0?1:c,void 0,A,{not_updated:m})}export{_ as remoteEvolve};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{h as a,i as b,j as c,k as d,l as e,m as f,n as g,o as h,p as i,q as j,r as k,s as l,t as m,u as n,v as o,w as p}from"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-UR6MHSHU.js";export{p as _reset,i as cleanup,m as clearInkExit,h as deregister,j as fatalRemoteFlush,e as getRemoteLogger,b as getSupportContext,o as installHandlers,f as isShuttingDown,d as logOrBufferRemote,g as register,l as setInkExit,c as setRemoteLogger,a as setSupportContext,n as setTerminalRestore,k as shutdown};
2
+ import{h as a,i as b,j as c,k as d,l as e,m as f,n as g,o as h,p as i,q as j,r as k,s as l,t as m,u as n,v as o,w as p}from"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-UR6MHSHU.js";export{p as _reset,i as cleanup,m as clearInkExit,h as deregister,j as fatalRemoteFlush,e as getRemoteLogger,b as getSupportContext,o as installHandlers,f as isShuttingDown,d as logOrBufferRemote,g as register,l as setInkExit,c as setRemoteLogger,a as setSupportContext,n as setTerminalRestore,k as shutdown};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a}from"./chunk-DTUPEKEO.js";import"./chunk-4LTHDJ3D.js";import"./chunk-ZHWU6L2G.js";import"./chunk-XB6BJPDL.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-UR6MHSHU.js";export{a as explain};
@@ -0,0 +1,4 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as A}from"./chunk-DTUPEKEO.js";import"./chunk-4LTHDJ3D.js";import{a as O}from"./chunk-R7KXAISS.js";import"./chunk-WMGKUERB.js";import"./chunk-WOSANGV6.js";import{a as w}from"./chunk-73Y6T2UK.js";import{b as I}from"./chunk-QI5RZ7LL.js";import"./chunk-ZHWU6L2G.js";import"./chunk-EZN7CF45.js";import"./chunk-7XBNMOH4.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-ZFM77AQU.js";import{R as E,S as b,vb as y}from"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import{f as o,g}from"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-VZ7KXRXB.js";import"./chunk-7V4BQSSV.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-UR6MHSHU.js";import{existsSync as v}from"fs";async function q(f,m={}){let u=m.contextDir??w(process.cwd());if(!v(u))return(m.err??(c=>process.stderr.write(c+`
3
+ `)))("error: no context store here (run `kane-cli context ingest <files>` first)"),2;let S=O(u),e=m.out??(c=>process.stdout.write(c+`
4
+ `)),n=y(u),h=[o.TEST,o.SCENARIO,o.AC,o.GAP],x=b(n,f,h);if(x!==null)return e(x),1;let p=n.resolve(E(n,f,h));if(!p){let c=[...n.names.keys()].filter(r=>/^(t|sc|ac|gap)-/.test(r)).sort();return e(`no design rationale recorded for ${f} (exists: ${c.slice(0,12).join(", ")||"(no designed items)"})`),1}let a=p.tip,d=n.nodeLabel.get(a),s=n.getNode(a),l=n.nameOf.get(a)??a.slice(0,19);if(d===o.TEST){let c=String(s?.content.definitionId??""),r=c?I(S,c):null;if(!r){let i=null;for(let k of n.edgesFrom(a))if(k.type===g.VERIFIES){for(let $ of n.edgesFrom(k.dst))if($.type===g.SCOPED_TO){i=n.nameOf.get($.dst)??$.dst.slice(0,19);break}if(i)break}return e(`no design rationale recorded for ${f} (exists: test ${l}, but its sidecar is missing \u2014 re-run: kane-cli design tests${i?` --use-case ${i}`:""} --force)`),1}e(`${l} \u2014 ${String(s?.content.title??"")}`),e(`technique: ${r.technique}`),e(`profile family: ${r.profile_family}`),e(`anchored to: ${r.anchor}`),e(`expected how: ${r.expected_how}`),e(`combinatorial: strength ${r.combinatorial.strength} \u2014 ${r.combinatorial.reason}`),e(`surface: ${r.surface_state} \xB7 deferred bindings: ${r.deferred_bindings}`);let t=s?.content.check;t&&e(`check: ${String(t.kind)} ${String(t.operator)} ${String(t.operand??t.within??"")} \u2014 verified against ${String(t.verified_against)}`);for(let i of n.edgesFrom(a))i.type===g.AUTOMATES&&e(`automates: ${n.nameOf.get(i.dst)??i.dst.slice(0,19)}`),i.type===g.VERIFIES&&e(`verifies: ${n.nameOf.get(i.dst)??i.dst.slice(0,19)}`),i.type===g.REUSES&&e(`imports: ${n.nameOf.get(i.dst)??i.dst.slice(0,19)}`);return 0}if(d===o.SCENARIO||d===o.AC||d===o.GAP){let r=A(S,n,p.cid).entries.filter(t=>t.kind==="judgement"||t.kind==="review");if(e(`${l} \u2014 ${String(s?.content.title??s?.content.text??"")}`),d===o.SCENARIO&&(e(`case type: ${String(s?.content.case_type??"")} \xB7 intent: ${String(s?.content.intent??"")}`),e(`technique: ${String(s?.content.technique_notes??"")}`)),d===o.AC){let t=s?.content.expected_answer;e(`kind: ${String(s?.content.kind??"")}${t?` \xB7 oracle: ${String(t.operator)} ${String(t.operand??"")}`:""}`)}r.length===0&&e("(no recorded judgements yet \u2014 approvals and design-time judgements land here)");for(let t of r)e(t.kind==="judgement"?`judgement: ${t.rationale??t.detail}`:`review: ${t.detail}`);return 0}return e(`no design rationale recorded for ${f} (exists: ${d??"nothing"} ${l} \u2014 design explains tests, scenarios, ACs, and gaps)`),1}export{q as designExplainCommand};
@@ -0,0 +1,12 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as l}from"./chunk-DTUPEKEO.js";import{b as f}from"./chunk-4LTHDJ3D.js";import{O as d}from"./chunk-432ZOE42.js";import"./chunk-TW63WWEN.js";import"./chunk-A6TJOZ24.js";import"./chunk-CB4ARIHR.js";import"./chunk-BSRSXYDZ.js";import{a as m}from"./chunk-R7KXAISS.js";import"./chunk-WMGKUERB.js";import"./chunk-WOSANGV6.js";import"./chunk-XMPTFXPW.js";import"./chunk-73Y6T2UK.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-MNBGG4H3.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-EZN7CF45.js";import"./chunk-7XBNMOH4.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-ZFM77AQU.js";import{R as p,S as a,vb as u}from"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-PUVMC4PX.js";import"./chunk-B7ZX5HEN.js";import"./chunk-VZ7KXRXB.js";import"./chunk-7V4BQSSV.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";async function y(e,c){let s=d(process.cwd(),{out:r=>process.stdout.write(r+`
3
+ `),err:r=>process.stderr.write(r+`
4
+ `),confirm:async()=>!1,isTTY:!!process.stdout.isTTY});if(!s)return 2;let g=m(s),n=u(s),i=a(n,e);if(i!==null)return process.stdout.write(c.json?JSON.stringify({target:null,error:i})+`
5
+ `:`error: ${i}
6
+ `),1;let t=l(g,n,p(n,e));if(c.json)return process.stdout.write(JSON.stringify(t)+`
7
+ `),t.target?0:1;if(!t.target)return process.stdout.write(`error: ${e} names nothing in the graph
8
+ `),1;let o=t.target;process.stdout.write(`${o.slug??o.cid} ${o.label} tip ${o.tip}
9
+ `);for(let r of t.cites??[])process.stdout.write(` cites ${f(r)}
10
+ `);for(let r of t.entries)process.stdout.write(` #${r.seq} ${r.ts} ${r.kind} ${r.detail}${r.rationale?`
11
+ why: ${r.rationale}`:""}
12
+ `);return 0}export{y as explainCommand};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p}from"./chunk-672CQECV.js";import"./chunk-74W4AOT2.js";import"./chunk-S53AQU7R.js";import"./chunk-WYSZ6TPW.js";import"./chunk-VYHT2IET.js";import"./chunk-2SWSVJUP.js";import"./chunk-ZUZ6QJRA.js";import"./chunk-7EXDYXXD.js";import{b as a,f as b}from"./chunk-JD52IXON.js";import"./chunk-YDPTSDIJ.js";import"./chunk-KGNE5CIM.js";import"./chunk-ZZP5SHUV.js";import"./chunk-3AGP2BVN.js";import"./chunk-DNGOT65K.js";import"./chunk-P7MSVLAH.js";import"./chunk-TW63WWEN.js";import"./chunk-AA674WLL.js";import"./chunk-QTZBVDPR.js";import"./chunk-72KYMWQ5.js";import"./chunk-JQ64X2TO.js";import"./chunk-UTM7D4PI.js";import"./chunk-I2KOGINW.js";import"./chunk-TDPWFYTJ.js";import"./chunk-NQTYWHPB.js";import"./chunk-5Y2G4NC7.js";import"./chunk-DREQ3RAA.js";import"./chunk-34R7BNZ2.js";import"./chunk-XMPTFXPW.js";import"./chunk-L4UVUFL6.js";import"./chunk-BVO4C5F2.js";import"./chunk-73Y6T2UK.js";import"./chunk-LRXBJTD4.js";import"./chunk-T4AVLJCW.js";import"./chunk-5D7ENQTQ.js";import"./chunk-C6HI6Y3S.js";import"./chunk-2OOFURWD.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-D4FFXCX6.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-OAKYUBD3.js";import"./chunk-OZNBTSW5.js";import"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-4IEQNX7F.js";import"./chunk-REKHAN53.js";import"./chunk-XZYA7DNH.js";import"./chunk-W3OVSDBN.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-I2MC6VVX.js";import"./chunk-RPRXRKKR.js";import"./chunk-QXQ7KVEN.js";import"./chunk-57MDWTON.js";import"./chunk-NWBLYMH7.js";import"./chunk-QSCXXNC2.js";import"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-7V4BQSSV.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-GMTHZUZ3.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-MGNRNLBE.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-XBEYWXPV.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";export{a as MAX_LOCAL_PARALLEL,b as MAX_REMOTE_PARALLEL,c as RETIRED_SETUP_ERROR,d as RUN_HELP_AFTER,l as TUNNEL_REMOTE_WARNING,n as VIEW_CONTEXT_TIMEOUT_MS,j as contextOption,g as normalizeAllowPosts,f as normalizeDomains,h as parseDepthCaps,i as parseSlowBudgets,e as registerExplore,m as runExploreAction,o as runExploreViewAction,p as takeSigint,k as tunnelOption};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as H}from"./chunk-V5JGXOV7.js";import{b as D}from"./chunk-RX47NRSM.js";import{a as S,b as J}from"./chunk-74W4AOT2.js";import{a as y,b as F,d as h,h as K,i as q,j as z}from"./chunk-2SWSVJUP.js";import"./chunk-ZUZ6QJRA.js";import"./chunk-7EXDYXXD.js";import"./chunk-JD52IXON.js";import{a as G}from"./chunk-YDPTSDIJ.js";import"./chunk-KGNE5CIM.js";import"./chunk-ZZP5SHUV.js";import"./chunk-3AGP2BVN.js";import"./chunk-P7MSVLAH.js";import"./chunk-TW63WWEN.js";import{b as Y}from"./chunk-A6TJOZ24.js";import"./chunk-AA674WLL.js";import"./chunk-NQTYWHPB.js";import"./chunk-5Y2G4NC7.js";import"./chunk-34R7BNZ2.js";import"./chunk-BVO4C5F2.js";import"./chunk-LRXBJTD4.js";import"./chunk-5D7ENQTQ.js";import"./chunk-SMXABALN.js";import"./chunk-C6HI6Y3S.js";import"./chunk-OAKYUBD3.js";import"./chunk-OZNBTSW5.js";import"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-XZYA7DNH.js";import"./chunk-QSCXXNC2.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-MGNRNLBE.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-XBEYWXPV.js";import{a as V}from"./chunk-HCBYKLMW.js";import{a as $,b as E,i as L}from"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import{a as I}from"./chunk-6YGTRKDT.js";import{y as a}from"./chunk-I6OQISK4.js";import{e as _}from"./chunk-UR6MHSHU.js";var s=_(I(),1);var i=_(V(),1);function ee(n){let t=n.last_job,l=t?.use_cases?.added?.length??0,f=t?.use_cases?.modified?.length??0,g=t?.tests?.failed??[],c=t?t.status==="ok"||t.status==="noop"?a.green:t.status==="partial"?a.amber:a.red:void 0;return{title:"Assurance context",state:{text:F(n),color:n.enabled?n.off_reason?a.amber:a.green:a.dim},rows:[{label:"last job",text:t?[t.status,y(t.cut),l||f?`${l} use case${l===1?"":"s"} added, ${f} modified`:""].filter(Boolean).join(" \xB7 "):"none yet",...c?{color:c}:{}},{label:"behind",text:g.length?g.map(r=>`${r} (design failed)`).join(", "):""},{label:"held",text:t?.held?.length?`${t.held.length} \xB7 ${t.held.map(r=>`${r.ref} ${r.why}`).join("; ")}`:""},{label:"running job",text:n.running_job?`${n.running_job.trigger==="run_end"?"run end":n.running_job.trigger} \xB7 ${y(n.running_job.cut)}`:""},{label:"pending cut",text:n.pending_cut?`${y(n.pending_cut.cut)} (${n.pending_cut.trigger==="run_end"?"run end":n.pending_cut.trigger})`:"none"},...(t?.attempt??1)>1?[{label:"",text:"retry of a failed attempt; counts cover this attempt only",color:a.dim}]:[]]}}var M=["\u2191\u2193 select","\u23CE confirm","esc back","ctrl+c exit"];function te({client:n,explorationId:t,env:l,done:f,cols:g,compact:c,subject:v}){let[r,Q]=(0,s.useState)(null),[B,A]=(0,s.useState)(null),[O,C]=(0,s.useState)([]),[p,k]=(0,s.useState)("reading the assurance context"),[d,x]=(0,s.useState)(!1),[T,m]=(0,s.useState)(0),U=(e,o)=>h(S(e,o,t).message),w=(0,s.useCallback)(async()=>{try{Q(await n.getContext(t)),A(null)}catch(e){A(S(e,"status",t).message)}},[n,t]);(0,s.useEffect)(()=>{w().finally(()=>k(null))},[w]);let R=async e=>{k(e==="sync"?"asking for an assurance job":`turning assurance context ${e}`);try{if(e==="sync"){let o=await n.syncContext(t);C(o.state==="failed"?h(J(t,o)):q(t,o))}else C(z(t,await n.setContext(t,e==="on"),e))}catch(o){C(U(o,e))}await w(),m(0),k(null)},N=r?.enabled??!0,u=d?[{key:"no",label:"No",detail:"keep it on"},{key:"yes",label:"Yes, turn off",detail:"the next cut is skipped; nothing is deleted"}]:[{key:"sync",label:"Sync now",detail:"a job on the newest cut"},N?{key:"off",label:"Turn off",detail:"the next cut is skipped; nothing is deleted"}:{key:"on",label:"Turn on",detail:"catches up from the newest ended run"},{key:"back",label:"Back"}],b=e=>{if(e==="back")return f("back");if(e==="off"){x(!0),m(0);return}if(e==="no"){x(!1),m(0);return}if(e==="yes"){x(!1),R("off");return}R(e)};L((e,o)=>{if(o.ctrl&&e==="c")return f("exit");if(o.escape){if(d){x(!1),m(0);return}return f("back")}if(p)return;if(o.upArrow)return m(P=>(P+u.length-1)%u.length);if(o.downArrow)return m(P=>(P+1)%u.length);if(d&&(e==="y"||e==="Y"))return b("yes");if(d&&(e==="n"||e==="N"))return b("no");let j=Number.parseInt(e,10);if(j>=1&&j<=u.length)return b(u[j-1].key);if(o.return)return b(u[T].key)});let W=p?{kind:"working",step:p}:{kind:"waiting"},X=r?[`context ${N?"on":"off"}`,...r.last_job?[`last job ${r.last_job.status}`]:[]]:[],Z=r?c?[]:K(r):B?h(B):[];return(0,i.jsxs)($,{flexDirection:"column",children:[c&&r?(0,i.jsx)(H,{...ee(r)}):null,Z.map((e,o)=>(0,i.jsx)(E,{children:e||" "},`s${o}`)),O.length>0&&(0,i.jsx)($,{flexDirection:"column",marginTop:1,children:O.map((e,o)=>(0,i.jsx)(E,{children:e||" "},`o${o}`))}),!p&&(0,i.jsx)(Y,{headline:d?"Turn assurance context off? (y/N)":"Context",ask:d,rows:u,sel:T,focused:!0,accent:a.orange}),(0,i.jsx)(D,{status:W,meta:{verb:"explore",sid:c?t.slice(0,8):t,env:l,subject:v??"assurance context"},tallies:{items:X},keys:c?M.map(e=>e==="esc back"?"esc card":e):M,remote:!0,gapAbove:!0,accent:a.orange,...g!==void 0?{cols:g}:{}})]})}async function de(n){return await G(l=>(0,i.jsx)(te,{client:n.client,explorationId:n.explorationId,env:n.env,compact:n.compact,subject:n.subject,done:l}))??"exit"}export{te as ContextPanel,M as PANEL_KEYS,ee as compactCard,de as runContextPanel};
@@ -0,0 +1,6 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as xe}from"./chunk-V5JGXOV7.js";import{b as le}from"./chunk-RX47NRSM.js";import{a as ae,e as ce}from"./chunk-VYHT2IET.js";import{a as W,b as q,d as I,e as ue,n as pe,q as V,s as T,t as H}from"./chunk-2SWSVJUP.js";import"./chunk-ZUZ6QJRA.js";import"./chunk-7EXDYXXD.js";import"./chunk-JD52IXON.js";import{a as de}from"./chunk-YDPTSDIJ.js";import"./chunk-KGNE5CIM.js";import"./chunk-ZZP5SHUV.js";import"./chunk-3AGP2BVN.js";import"./chunk-P7MSVLAH.js";import"./chunk-TW63WWEN.js";import{b as F}from"./chunk-A6TJOZ24.js";import"./chunk-AA674WLL.js";import"./chunk-NQTYWHPB.js";import"./chunk-5Y2G4NC7.js";import"./chunk-34R7BNZ2.js";import"./chunk-BVO4C5F2.js";import"./chunk-LRXBJTD4.js";import"./chunk-5D7ENQTQ.js";import"./chunk-SMXABALN.js";import{a as ie}from"./chunk-HFJSP4KD.js";import{d as se}from"./chunk-C6HI6Y3S.js";import"./chunk-OVNRRI4E.js";import"./chunk-OAKYUBD3.js";import"./chunk-OZNBTSW5.js";import"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-XZYA7DNH.js";import"./chunk-QSCXXNC2.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import{a as oe}from"./chunk-MGNRNLBE.js";import{a as re}from"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import{a as ne}from"./chunk-XBEYWXPV.js";import{a as te}from"./chunk-HCBYKLMW.js";import{a as O,b as M,i as ee}from"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import{a as ye}from"./chunk-6YGTRKDT.js";import{y as d}from"./chunk-I6OQISK4.js";import{e as z}from"./chunk-UR6MHSHU.js";var v=z(ye(),1);function A(e,n,t=`${n}s`){return`${e} ${e===1?n:t}`}function ve(e,n){if(!e)return"";let t=new Date(e).getTime();if(Number.isNaN(t))return"";let r=Math.max(0,Math.floor((n-t)/1e3));return r<60?"just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}function Ee(e,n){if(!e)return"";let t=new Date(e).getTime();if(Number.isNaN(t))return"";let r=Math.max(0,Math.floor((n-t)/6e4));return r<60?`${r}m`:`${Math.floor(r/60)}h ${r%60}m`}var N=e=>e.slice(0,8);function _e(e){if(!e)return"";try{return new URL(e).host}catch{return e}}function me(e){return!!e&&(e.running||!!e.current_session)}function Re(e){return e?e.current_session?`exploration \xB7 \u25CF ${e.current_session.state}`:e.running?"exploration \xB7 \u25CF running":"exploration \xB7 idle":"no exploration yet"}function fe(e,n){let t=Math.min(30,Math.max(0,...e.map(i=>i.name.length)))+4,r=i=>{let a=n.get(i.id);return me(a)?0:a?1:2};return[...e].map((i,a)=>({p:i,i:a})).sort((i,a)=>r(i.p)-r(a.p)||i.i-a.i).map(({p:i})=>{let a=i.name.length>30?`${i.name.slice(0,29)}\u2026`:i.name;return{id:i.id,label:`${a.padEnd(t)}${Re(n.get(i.id))}`}})}function ge(e){let n=new Map;for(let t of e)t.project_id&&!n.has(t.project_id)&&n.set(t.project_id,t);return n}function $e(e,n){if(e){if(e.enabled&&e.off_reason)return{text:`on \xB7 blocked: ${q(e).replace(/^on, blocked: /,"").replace(/^(.*?): (.*)$/,"$1 ($2)")}`,color:d.amber,tally:"context blocked"};if(!e.enabled)return{text:q(e),color:d.dim,tally:"context off"};if(e.running_job)return{text:`on \xB7 job running on ${W(e.running_job.cut)}`,color:d.green,tally:"context on"};let r=e.last_job;if(!r)return{text:"on",color:d.green,tally:"context on"};let i=r.use_cases?.added?.length??0,a=r.use_cases?.modified?.length??0,w=i||a?` \xB7 ${i} use case${i===1?"":"s"} added, ${a} modified`:"";return{text:`on \xB7 last job ${r.status} \xB7 ${W(r.cut)}${w}`,color:d.green,tally:"context on"}}let t=n?.context;return t?t.enabled?t.running?{text:"on \xB7 job running",color:d.green,tally:"context on"}:{text:t.last_job_status?`on \xB7 last job ${t.last_job_status}`:"on",color:d.green,tally:"context on"}:{text:"off",color:d.dim,tally:"context off"}:{text:"",tally:""}}function Se(e,n){let t=[e.remark?.code||e.stop_reason||"stopped",ve(e.ended_at??e.started_at,n)];return typeof e.leases=="number"&&t.push(A(e.leases,"lease")),e.credits&&typeof e.credits.total=="number"&&t.push(`${Math.round(e.credits.total).toLocaleString("en-US")} credits`),t.filter(Boolean).join(" \xB7 ")}function Ce(e){return`${A(e.junctions,"screen")} \xB7 ${A(e.flows,"flow")} \xB7 ${A(e.findings,"finding")}`}function K(e,n,t,r,i){if(!n)return{mode:"new",title:`"${e.name}"`,state:{text:"no exploration yet",color:d.dim},rows:[{label:"one project",text:"one exploration: its map grows with every run"},{label:"assurance context",text:"on by default \xB7 builds the project's assurance context as it explores",color:d.green}],headline:"Start exploring?",ask:!0,menu:[{action:"run",label:"Set up the first run"},{action:"back",label:"Back"}],sel:0,tallies:[],sid:"",subject:e.name,working:null};let a=`"${e.name}" \xB7 exploration ${N(n.exploration_id)}`,w=$e(r,n),E=w.text?[{label:"assurance context",text:w.text,color:w.color}]:[],R=_e(n.target_url)||e.name,s=n.current_session;if(me(n)){let u=s?.state??"running",o=[...s?[{label:"run",text:[N(s.run_id),Ee(s.claimed_at??s.started_at,i)].filter(Boolean).join(" \xB7 ")}]:[],...s?[{label:"runs on",text:s.mode==="remote"?`HyperExecute${s.hx_job_id?` \xB7 job ${N(s.hx_job_id)}`:""}`:"this machine"}]:[],...s?.started_by_user_id?[{label:"started by",text:`user ${s.started_by_user_id}`}]:[],...s&&typeof s.leases=="number"?[{label:"leases",text:String(s.leases)}]:[],...E];return{mode:"running",title:a,state:{text:u,color:d.orange},rows:o,headline:"A run is going",ask:!1,menu:[{action:"watch",label:"Watch",detail:"live browsers and flows"},{action:"stop",label:"Stop the run",detail:"its leases finish, every delta is sent"},{action:"view",label:"Open the map"},{action:"back",label:"Back"}],sel:0,tallies:[...s&&typeof s.leases=="number"?[`leases ${s.leases}`]:[],...t?[`screens ${t.junctions}`,`flows ${t.flows}`]:[]],sid:N(s?s.run_id:n.exploration_id),subject:R,working:`${u}`}}let C=!!r&&r.enabled&&!!r.off_reason,$=n.last_session,y=[...n.target_url?[{label:"url",text:n.target_url}]:[],...t?[{label:"map",text:Ce(t)}]:[],{label:"last run",text:$?Se($,i):"never run"},...E],h=C?[{action:"run",label:"Run again"},{action:"context",label:"Assurance context",detail:"why it is blocked, turn off"},{action:"view",label:"Open the map"},{action:"sessions",label:"Sessions"},{action:"delete",label:"Delete the exploration"}]:[{action:"run",label:$?"Run again":"Run",detail:"continues from the map"},{action:"view",label:"Open the map",detail:"explore view, in your browser"},{action:"sessions",label:"Sessions",detail:"every run, newest first"},{action:"context",label:"Assurance context",detail:"status, sync, turn off"},{action:"delete",label:"Delete the exploration"}];return{mode:"idle",title:a,state:{text:"idle",color:d.dim},rows:y,headline:"What next?",ask:!0,menu:h,sel:C?1:0,tallies:[...t?[A(t.junctions,"screen"),A(t.flows,"flow"),A(t.findings,"finding")]:[],...w.tally?[w.tally]:[]],sid:N(n.exploration_id),subject:R,working:null}}var p=z(te(),1),G=d.orange,Pe=["\u2191\u2193 select","\u23CE confirm","esc projects","ctrl+c exit"];function Me(e,n){return ae(e,n,()=>{throw new Error("timed out")})}function Ie({deps:e,initial:n,done:t}){let[r,i]=(0,v.useState)(null),[a,w]=(0,v.useState)(new Map),[E,R]=(0,v.useState)(null),[s,C]=(0,v.useState)(null),[$,y]=(0,v.useState)(0),[h,u]=(0,v.useState)({kind:"none"}),[o,x]=(0,v.useState)(null),[b,_]=(0,v.useState)(null),P=async()=>{try{let[c,l]=await Promise.all([e.listProjects(),e.listExplorations()]),m=ge(l);return i(c),w(m),m}catch(c){return R(T(c)),i([]),new Map}},Y=(c,l,m)=>{x(c.id),u({kind:"none"}),C({project:c,row:l,counts:null,ctx:null,loading:!!l});let f=K(c,l,null,null,e.now()),g=m?f.menu.findIndex(S=>S.action===m):-1;if(g>=0&&(f.sel=g),y(f.sel),!l)return;let k=l.exploration_id;Promise.allSettled([e.viewSummary(k),Me(e.getContext(k),3e3)]).then(([S,L])=>{let Q=S.status==="fulfilled"?S.value:null,X=L.status==="fulfilled"?L.value:null;C(U=>U&&U.row?.exploration_id===k?{...U,counts:Q,ctx:X,loading:!1}:U);let Z=K(c,l,Q,X,e.now()).sel;g<0&&Z!==f.sel&&y(Z)})};(0,v.useEffect)(()=>{n?Y(n.project,n.row,n.at):P()},[]);let J=()=>{C(null),u({kind:"none"}),D.current.projects||P()},j=s?K(s.project,s.row,s.counts,s.ctx,e.now()):null,ke=c=>{let{card:l,model:m}=D.current;if(!l||!m)return;let f=l.row,g=f?.exploration_id??"";switch(c){case"back":return J();case"run":return t({kind:"run",projectId:l.project.id,projectName:l.project.name,explorationId:f?.exploration_id??null,url:f?.target_url??null});case"view":if(!e.openMap)return t({kind:"view",explorationId:g});_("opening the map\u2026"),e.openMap(g).then(k=>_(`map open at ${k.url} \xB7 serving until you leave explore`),k=>{_(null),u({kind:"error",text:`could not open the map: ${T(k)}`})});return;case"context":return t({kind:"context",explorationId:g,subject:m.subject});case"watch":{let k=f?.current_session;return t({kind:"watch",explorationId:g,runId:k?.run_id??"",mode:k?.mode??"remote"})}case"sessions":u({kind:"sessions",lines:["loading sessions\u2026"]}),e.listSessions(g).then(k=>u({kind:"sessions",lines:ue(g,k,{nextCursor:null})}),k=>u({kind:"sessions",lines:I(`could not list sessions: ${T(k)}`)}));return;case"delete":return u({kind:"delete"});case"stop":return u({kind:"stop",sel:1})}},he=async()=>{let{card:c}=D.current;if(!c)return;let l=await P();Y(c.project,l.get(c.project.id)??null)},D=(0,v.useRef)({card:s,model:j,sub:h,sel:$,projects:r});if(D.current={card:s,model:j,sub:h,sel:$,projects:r},ee((c,l)=>{let{card:m,model:f,sub:g,sel:k}=D.current;if(!(!m||!f)&&g.kind!=="delete"){if(g.kind==="sessions"||g.kind==="error"){(l.escape||l.return)&&u({kind:"none"});return}if(g.kind==="stop"){if(l.upArrow||l.downArrow)u({kind:"stop",sel:g.sel===0?1:0});else if(l.escape)u({kind:"none"});else if(l.return){if(g.sel===1)return u({kind:"none"});let S=m.row.exploration_id;u({kind:"none"}),e.stopExploration(S).then(()=>he(),L=>u({kind:"error",text:`could not stop: ${T(L)}`}))}return}if(l.escape)return J();l.upArrow?y(S=>(S-1+f.menu.length)%f.menu.length):l.downArrow?y(S=>(S+1)%f.menu.length):l.return&&ke(f.menu[k].action)}},{isActive:!!s}),!s||!j){let c=r?fe(r,a).map(l=>({...l,isActive:l.id===o})):[];return(0,p.jsx)(O,{flexDirection:"column",children:(0,p.jsx)(ie,{title:"Projects",items:c,itemNoun:"projects",loading:!r,loadingText:"loading projects\u2026",error:E,defaultActiveId:o,escLabel:"exit",onSelect:l=>{let m=r?.find(f=>f.id===l.id);m&&Y(m,a.get(m.id)??null)},onCancel:()=>t({kind:"exit",code:0})})})}let je=j.working?{kind:"working",step:j.working}:{kind:"waiting"},B;if(h.kind==="sessions")B=(0,p.jsxs)(O,{flexDirection:"column",marginTop:1,children:[h.lines.map((c,l)=>(0,p.jsx)(M,{children:c},l)),(0,p.jsx)(M,{color:d.dim,children:"esc back to the card"})]});else if(h.kind==="error")B=(0,p.jsxs)(O,{flexDirection:"column",marginTop:1,children:[I(h.text).map((c,l)=>(0,p.jsx)(M,{children:c},l)),(0,p.jsx)(M,{color:d.dim,children:"esc back to the card"})]});else if(h.kind==="delete"){let c=s.row.exploration_id;B=(0,p.jsx)(pe,{explorationId:c,facts:{project:s.project.name,...s.counts?{map:`${s.counts.junctions} screens \xB7 ${s.counts.flows} flows \xB7 ${s.counts.findings} findings`}:{}},done:l=>{if(!l)return void setTimeout(()=>u({kind:"none"}),0);e.deleteExploration(c).then(()=>{C(null),u({kind:"none"}),P()},m=>u({kind:"error",text:`could not delete: ${T(m)}`}))}})}else h.kind==="stop"?B=(0,p.jsx)(F,{headline:"Stop this run?",ask:!0,accent:G,sel:h.sel,focused:!0,rows:[{key:"yes",label:"Yes, stop it",detail:"its leases finish, every delta is sent"},{key:"no",label:"No"}]}):B=(0,p.jsx)(F,{headline:j.headline,ask:j.ask,accent:G,sel:$,focused:!0,rows:j.menu.map(c=>({key:c.action,label:c.label,detail:c.detail}))});return(0,p.jsxs)(O,{flexDirection:"column",children:[(0,p.jsx)(M,{color:d.dim,children:`project "${s.project.name}"`}),(0,p.jsx)(xe,{title:j.title,state:j.state,rows:j.rows}),s.loading?(0,p.jsx)(M,{color:d.dim,children:" reading the map\u2026"}):null,b?(0,p.jsx)(M,{color:d.dim,children:` ${b}`}):null,B,(0,p.jsx)(le,{status:je,meta:{verb:"explore",sid:j.sid,env:e.env,subject:j.subject},tallies:{items:j.tallies},keys:h.kind==="none"?Pe:["esc card","ctrl+c exit"],accent:G,remote:!0})]})}function be(e){return e.env??new ne().getDefaultEnv()??"prod"}async function we(e,n){let t=o=>{process.stderr.write(o+`
3
+ `)},r=await V(e,"explore");if(!r.ok){for(let o of I(r.error,"kane-cli login"))t(o);return 2}let i=be(e),a=H(r),w=new se(oe(i).tmsBaseUrl,r.basic.username,r.basic.access_key),E=async()=>{let o=[],x;for(let b=0;b<10;b++){let _=await a.listExplorations({state:"all",limit:100,cursor:x});if(o.push(..._.explorations),!_.next_cursor)break;x=_.next_cursor}return o},R=new Map,s=async o=>{try{await(await import("./open-MQLQKFAW.js")).default(o)}catch{}},C={env:i,listProjects:async()=>(await w.listProjects()).map(o=>({id:String(o.project_id),name:o.name})),listExplorations:E,viewSummary:async o=>{let x=(await a.viewSummary(o))?.counts;if(!x)throw new Error("the map's summary could not be read");return{junctions:x.junctions??0,flows:x.flows??0,findings:x.findings??0}},getContext:o=>a.getContext(o),listSessions:async o=>(await a.listSessions(o)).sessions,deleteExploration:async o=>{await a.deleteExploration(o)},stopExploration:async o=>{await a.stopExploration(o,!1)},openMap:async o=>{let x=R.get(o);if(x)return s(x.url),x;let b=re(r.basic.username,r.basic.access_key),_=r.controllerBaseUrl,P=await ce({controllerBaseUrl:_,authHeader:b,explorationId:o,live:{controller:{baseUrl:_,authHeader:b}}});return R.set(o,P),s(P.url),P},now:()=>Date.now()},$=null,y=String(e.explorationId??"").trim();if(y){let o;try{o=(await E()).find(b=>b.exploration_id===y)}catch(b){for(let _ of I(`could not list explorations: ${T(b)}`))t(_);return 1}if(!o){for(let b of I(`no exploration ${y} in your org`,"kane-cli explore list --all"))t(b);return 2}let x=o.name??o.project_id??y.slice(0,8);if(o.project_id)try{x=(await w.listProjects()).find(b=>String(b.project_id)===o.project_id)?.name??x}catch{}$={project:{id:o.project_id??"",name:x},row:o,...n?{at:n}:{}}}let h=await de(o=>(0,p.jsx)(Ie,{deps:C,initial:$,done:o}));h||(t(""),t("session summary \u2014 exited (ctrl+c)"),R.size&&t(` stopped serving the map${R.size===1?"":"s"} it opened`),t(` back: kane-cli explore${y?` --exploration-id ${y}`:""} --env ${i}`),t(""));let u=h??{kind:"exit",code:130};try{return await Te(u,e)}finally{await Promise.allSettled([...R.values()].map(o=>o.close()))}}async function Te(e,n){let t=be(n),r=i=>{process.stdout.write(i+`
4
+ `)};switch(e.kind){case"exit":return e.code;case"run":{let{explorationId:i,...a}=n,{runExploreSetupFlow:w}=await import("./explore-run-tty-LGTIK2NA.js");return w({projectId:e.projectId,projectName:e.projectName??null,explorationId:e.explorationId,url:e.url,opts:a,back:()=>we({...n,...e.explorationId?{explorationId:e.explorationId}:{}},"run")})}case"watch":{let i=await V(n,"explore");if(!i.ok){for(let E of I(i.error))process.stderr.write(E+`
5
+ `);return 2}let{runLiveView:a}=await import("./explore-live-2XZHUYFS.js");return(await a({client:H(i),explorationId:e.explorationId,runId:e.runId,mode:e.mode,env:t})).exitCode}case"context":{let i=await V(n,"explore");if(!i.ok){for(let E of I(i.error))process.stderr.write(E+`
6
+ `);return 2}let{runContextPanel:a}=await import("./explore-context-tty-JTZVZFOE.js");return await a({client:H(i),explorationId:e.explorationId,env:t,compact:!0,...e.subject?{subject:e.subject}:{}})==="back"?we({...n,explorationId:e.explorationId},"context"):130}case"view":{let{runExploreViewAction:i}=await import("./explore-LOKNOVNP.js");return i({...n,explorationId:e.explorationId})}}}export{Ie as EntryApp,Te as dispatchEntryOutcome,we as runExploreEntryAction};
@@ -0,0 +1,5 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{b as W}from"./chunk-RX47NRSM.js";import{a as J}from"./chunk-WYSZ6TPW.js";import"./chunk-KGNE5CIM.js";import{m as F,o as _}from"./chunk-ZZP5SHUV.js";import"./chunk-5Y2G4NC7.js";import"./chunk-LRXBJTD4.js";import"./chunk-5D7ENQTQ.js";import{a as q,b as N}from"./chunk-WN5VKKJ3.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import{a as j}from"./chunk-HCBYKLMW.js";import{b as O,h as A,i as T}from"./chunk-33DWJV67.js";import{a as g}from"./chunk-FOJHSG5M.js";import{a as ee}from"./chunk-6YGTRKDT.js";import{y as v}from"./chunk-I6OQISK4.js";import{e as $}from"./chunk-UR6MHSHU.js";var f=$(ee(),1);function G(e,t){return{mode:e.mode,explorationId:e.explorationId,runId:e.runId,env:e.env,phase:e.mode==="remote"?"queued":"running",openedAt:t,...e.policy?{policy:e.policy}:{}}}var y=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0;function K(e,t){let n=e.phase;return t.state==="stopped"?n="stopped":e.phase!=="stopping"&&(t.state==="queued"||t.state==="running")&&(n=t.state),{...e,phase:n,leases:y(t.leases)??e.leases,findings:y(t.findings)??e.findings,credits:y(t.credits?.total)??e.credits,remark:t.remark??e.remark,pollError:void 0,...e.policy?{}:F(t.requested?.policy)?{policy:t.requested.policy}:{}}}function U(e,t){if(!t)return e;let n=t.counts??{},i=y(n.flows)??e.flows,s=y(n.junctions)??e.screens,o=e.base??(i!==void 0&&s!==void 0?{flows:i,screens:s}:void 0);return{...e,flows:i,screens:s,...o?{base:o}:{}}}function k(e,t){return{...e,pollError:t}}function V(e){return e.phase==="stopped"?e:{...e,phase:"stopping"}}function I(e,t){let n=Math.max(0,Math.round((t-e.openedAt)/1e3)),i=e.phase==="queued"?"waiting for the VM":e.phase==="stopping"?"stopping":e.phase==="stopped"?"ended":"running";return{kind:"working",step:e.policy?`${i} \xB7 ${_(e.policy)}`:i,elapsedS:n}}var L=e=>Math.round(e).toLocaleString("en-US"),M=(e,t)=>e===void 0?null:`${t} ${L(e)}`,x=(e,t,n=`${t}s`)=>`${L(e)} ${Math.round(e)===1?t:n}`,D=(e,t,n)=>e===void 0?null:`${n} +${Math.max(0,e-(t??e))} (${L(e)})`;function z(e){return[e.phase==="queued"?"queued":null,M(e.leases,"leases"),D(e.screens,e.base?.screens,"screens"),D(e.flows,e.base?.flows,"flows"),M(e.findings,"findings"),M(e.credits,"credits"),e.pollError?`not refreshed: ${e.pollError}`:null].filter(n=>n!==null)}function Q(e){return e.phase==="stopping"?["stopping: the leases finish and every delta is sent"]:[e.mode==="local"&&e.owned!==!1?"ctrl+c stop":"ctrl+c detach"]}function H(e){return`kane-cli explore view --exploration-id ${e.explorationId} --env ${e.env}`}function te(e){return`kane-cli explore stop ${e.explorationId} --env ${e.env}`}function B(e){let t=[e.leases===void 0?null:x(e.leases,"lease"),e.screens===void 0?null:`${x(Math.max(0,e.screens-(e.base?.screens??e.screens)),"new screen")} (${L(e.screens)} on the map)`,e.flows===void 0?null:`${x(Math.max(0,e.flows-(e.base?.flows??e.flows)),"new flow")} (${L(e.flows)})`,e.findings===void 0?null:x(e.findings,"finding"),e.credits===void 0?null:x(e.credits,"credit")].filter(n=>n!==null);return t.length?t.join(" \xB7 "):"nothing reported yet"}function ne(e){if(e<60)return`${e}s`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60);return t?`${t}h ${n}m`:`${n}m ${e%60}s`}function X(e,t,n){let i=m=>m.padEnd(9);if(t==="detached")return[{text:""},{text:`session summary \u2014 detached (the run keeps going${e.mode==="remote"?" on HyperExecute":""})`,tone:"bold"},{text:` ${i("run")}${e.runId}`},{text:` ${i("so far")}${B(e)}`},{text:` ${i("watch:")}kane-cli explore --exploration-id ${e.explorationId} --env ${e.env}`},{text:` ${i("map:")}${H(e)}`},{text:` ${i("stop:")}${te(e)}`},{text:""}];let s=e.remark?.code??"",o=s.startsWith("failed:"),d=e.remark?e.remark.message||s:t==="stopped"?"stopped":"ended",l=o?s.slice(7)||"failed":s||d,u=t==="stopped"||s==="user_stop"?e.remark?`stopped (${l})`:"stopped":o?`failed (${l})`:`complete (${l})`;return[{text:`\u25CF run ended \u2014 ${d} \xB7 ${ne(I(e,n).elapsedS)}`,tone:o?"dot-failed":"dot-done"},{text:""},{text:`session summary \u2014 ${u}`,tone:"bold"},{text:` ${i("run")}${e.runId}`},{text:` ${i("made")}${B(e)}`},{text:` ${i("map:")}${H(e)}`},{text:""}]}var c=$(j(),1),oe=3e3,Y=e=>e.split("-")[0]??e;function re(e){return{verb:"explore",sid:Y(e.runId),env:e.env,subject:`exploration ${Y(e.explorationId)}`}}function ie({model:e,now:t,cols:n}){return(0,c.jsx)(W,{status:I(e,t),meta:re(e),tallies:{items:z(e)},keys:Q(e),remote:!0,accent:v.orange,cols:n})}var C=class{constructor(t){this.model=t}listeners=new Set;logs=[];onLog=null;flush=async()=>{};log(t){this.onLog?this.onLog(t):this.logs.push(t)}takeLogs(t){for(let n of this.logs.splice(0))t(n);return this.onLog=t,()=>{this.onLog=null}}set(t){this.model=t;for(let n of this.listeners)n()}subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));get=()=>this.model};function se({store:e,now:t,onCtrlC:n}){let i=(0,f.useSyncExternalStore)(e.subscribe,e.get),[s,o]=(0,f.useState)(t());(0,f.useEffect)(()=>{let l=setInterval(()=>o(t()),1e3);return()=>clearInterval(l)},[t]);let{isRawModeSupported:d}=A();return T((l,a)=>{a.ctrl&&l==="c"&&n()},{isActive:d===!0}),(0,c.jsx)(ie,{model:i,now:s})}function le({store:e}){let t=N();return(0,f.useEffect)(()=>(e.flush=t.flush,e.takeLogs(n=>t.append((0,c.jsx)(O,{children:n})))),[e,t]),null}function de(e){return e.tone==="bold"?g.bold(e.text):e.tone==="dim"?g.hex(v.dim)(e.text):e.tone==="dot-done"?g.hex(v.green)(e.text):e.tone==="dot-failed"?g.hex(v.red)(e.text):e.text}async function be(e,t={}){let n=t.now??Date.now,i=t.print??(r=>process.stderr.write(`${r}
3
+ `)),s=e.mode==="local"&&e.ended!==void 0,o=new C({...G(e,n()),owned:s}),d,l=new Promise(r=>{d=r}),a=!1,u=(r,S)=>{a||(a=!0,d({outcome:r,exitCode:S}))},m=async()=>{try{let r=await e.client.getSession(e.explorationId,e.runId);o.set(K(o.model,r))}catch(r){o.set(k(o.model,r instanceof Error?r.message.slice(0,80):String(r)))}try{o.set(U(o.model,await e.client.viewSummary(e.explorationId)))}catch{}!s&&o.model.phase==="stopped"&&u("ended",o.model.remark?J(o.model.remark):0)},p=!1,b=()=>{if(!a){if(!s){u("detached",0);return}p||(p=!0,o.set(V(o.model)),e.client.stopExploration(e.explorationId,!1).catch(r=>{o.set(k(o.model,`stop: ${r instanceof Error?r.message.slice(0,80):String(r)}`))}))}};e.mode==="local"&&e.ended&&e.ended.then(async r=>{await m(),u(p?"stopped":"ended",r)},()=>u(p?"stopped":"ended",1));let P=()=>b();process.on("SIGINT",P);let E=()=>{},w,R,h;try{let r=t.stdout;r||({out:r,restore:E}=ae(Z=>o.log(Z)));let{render:S}=await import("./build-5ZN47FAT.js");R=S((0,c.jsxs)(q,{children:[(0,c.jsx)(le,{store:o}),(0,c.jsx)(se,{store:o,now:n,onCtrlC:b})]}),{stdout:r,stdin:t.stdin??process.stdin,exitOnCtrlC:!1,patchConsole:!1}),t.onReady?.({ctrlC:b}),m(),w=setInterval(()=>{m()},t.pollMs??oe),h=await l,await o.flush()}finally{w&&clearInterval(w),process.off("SIGINT",P),R?.unmount(),E()}for(let r of X(o.model,h.outcome,n()))i(de(r));return h}function ae(e){let t=process.stderr,n=t.write,i=n.bind(t),s=Object.create(t,{write:{value:(l,...a)=>i(l,...a)}}),o="";t.write=((l,...a)=>{o+=typeof l=="string"?l:Buffer.from(l).toString("utf8");let u=o.split(`
4
+ `);o=u.pop()??"";for(let p of u)e(p);return a.find(p=>typeof p=="function")?.(),!0});let d=!1;return{out:s,restore:()=>{d||(d=!0,t.write=n,o&&i(o+`
5
+ `))}}}export{ie as LiveScreen,ae as captureStderr,re as liveMeta,be as runLiveView};