@testmuai/kane-cli 0.7.1 → 0.8.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 (308) hide show
  1. package/dist/ChatSurface-U37VZDCW.js +8 -0
  2. package/dist/{ChromeProfilePicker-4CDSPBWL.js → ChromeProfilePicker-AUU7JF6F.js} +1 -1
  3. package/dist/{CliFeedbackPrompt-TLRVBA4E.js → CliFeedbackPrompt-4W74Y3UF.js} +1 -1
  4. package/dist/{CliUploadProgress-WGGFLUSF.js → CliUploadProgress-6HL7WTEX.js} +1 -1
  5. package/dist/ConfigView-6BSCZP5Y.js +2 -0
  6. package/dist/EvidenceViewOffer-62XHEEGW.js +2 -0
  7. package/dist/FolderPicker-S7U2EN2M.js +2 -0
  8. package/dist/{HelpView-FBCX32U7.js → HelpView-TU7ED43J.js} +1 -1
  9. package/dist/{InfoBox-KK2ICVS4.js → InfoBox-JLTMKVDE.js} +1 -1
  10. package/dist/{LinksBox-KKRANMR3.js → LinksBox-LREUUJDV.js} +1 -1
  11. package/dist/{ProfilesView-DGPXSAQN.js → ProfilesView-W3GX2N2E.js} +1 -1
  12. package/dist/{ProjectPicker-ESQSL4TT.js → ProjectPicker-SYQUJK2J.js} +1 -1
  13. package/dist/{SaveSessionPrompt-AQGP5W6E.js → SaveSessionPrompt-MR5NJMRP.js} +1 -1
  14. package/dist/SingleShotApp-XOKVOM7C.js +2 -0
  15. package/dist/{SummaryBox-BFZJW2KK.js → SummaryBox-UAYSVFB7.js} +1 -1
  16. package/dist/TestMdRunView-7UVSDAF4.js +2 -0
  17. package/dist/{WhoamiView-JABY3I5Q.js → WhoamiView-2YU76ASQ.js} +1 -1
  18. package/dist/adbkit-apkreader-ORZBGCJQ.js +184 -0
  19. package/dist/app-client-OEXESV4U.js +2 -0
  20. package/dist/app-download-AEEFQ63M.js +2 -0
  21. package/dist/{auth-76LVI6B5.js → auth-HET3TBRI.js} +1 -1
  22. package/dist/bind-STKXOUYI.js +12 -0
  23. package/dist/bootstrap-44YKVWWE.js +2 -0
  24. package/dist/bridge-5Z3BIB77.js +2 -0
  25. package/dist/{changelog-PSWPPOAF.js → changelog-7OWRHFHZ.js} +1 -1
  26. package/dist/chat-committer-ZWWCLJFD.js +2 -0
  27. package/dist/chat-controller-T2FAI55V.js +2 -0
  28. package/dist/{chunk-C4G7RVJ6.js → chunk-27U4PLPX.js} +1 -1
  29. package/dist/{chunk-V36ATG7A.js → chunk-2BGUUWNF.js} +2 -2
  30. package/dist/chunk-2KDGIZED.js +4 -0
  31. package/dist/chunk-2UIHS2FH.js +2 -0
  32. package/dist/chunk-2YEHV2CX.js +2 -0
  33. package/dist/{chunk-NRTHYROA.js → chunk-3LJWYRAA.js} +1 -1
  34. package/dist/chunk-3PECJD6S.js +11 -0
  35. package/dist/chunk-3POR47RC.js +8 -0
  36. package/dist/{chunk-KVQOBPAZ.js → chunk-3Q6WAK6P.js} +1 -1
  37. package/dist/chunk-4JOD47QI.js +2 -0
  38. package/dist/chunk-56PAQAX5.js +19 -0
  39. package/dist/{chunk-FCMLIK7P.js → chunk-5DBK6QNS.js} +1 -1
  40. package/dist/chunk-5DT7PIGB.js +5 -0
  41. package/dist/chunk-65ZTD5SJ.js +7 -0
  42. package/dist/chunk-6IA6QMPH.js +2 -0
  43. package/dist/{chunk-5KFS3GAZ.js → chunk-6KPPGMO2.js} +1 -1
  44. package/dist/{chunk-F6ZOJXYU.js → chunk-6O3DDOP2.js} +1 -1
  45. package/dist/chunk-6XX4LEVJ.js +2 -0
  46. package/dist/{chunk-KT6G7AF2.js → chunk-766WGMBU.js} +1 -1
  47. package/dist/chunk-7BZSCUPP.js +10 -0
  48. package/dist/{chunk-UBFKZEX3.js → chunk-7JWKHKFU.js} +2 -2
  49. package/dist/{chunk-PMHJRT3A.js → chunk-7KORP5FF.js} +1 -1
  50. package/dist/chunk-7Q6M6P4X.js +26 -0
  51. package/dist/{chunk-AM5S4KG4.js → chunk-AFPHLUQ5.js} +1 -1
  52. package/dist/chunk-AW2XUHH4.js +2 -0
  53. package/dist/chunk-BKHXPBWN.js +2 -0
  54. package/dist/chunk-BRHNRCEZ.js +3 -0
  55. package/dist/chunk-BRIEBB2U.js +2 -0
  56. package/dist/{chunk-NJPTOKW5.js → chunk-C7HSWZP6.js} +1 -1
  57. package/dist/{chunk-JEUA4UWK.js → chunk-CLGC7VEO.js} +1 -1
  58. package/dist/chunk-CTW2VQKS.js +6 -0
  59. package/dist/{chunk-L4JIMNKW.js → chunk-CUM23TLF.js} +1 -1
  60. package/dist/chunk-DBIBROYW.js +5 -0
  61. package/dist/{chunk-L7VREJTG.js → chunk-DCY6R5DP.js} +1 -1
  62. package/dist/{chunk-X3ICV5M5.js → chunk-DO5HAO3H.js} +1 -1
  63. package/dist/chunk-DPUV6OSP.js +2 -0
  64. package/dist/{chunk-M7WQM4UA.js → chunk-DUAXZYAD.js} +1 -1
  65. package/dist/{chunk-HPMS5KO6.js → chunk-DZGCXKKI.js} +3 -3
  66. package/dist/chunk-EDSZJZFG.js +4 -0
  67. package/dist/{chunk-OIYGGEUL.js → chunk-ELM6MXGJ.js} +1 -1
  68. package/dist/{chunk-R2RGSO4B.js → chunk-EWCAFKLX.js} +1 -1
  69. package/dist/chunk-EYOCNMUM.js +2 -0
  70. package/dist/{chunk-73C4PRYU.js → chunk-FEJXWJ3L.js} +1 -1
  71. package/dist/{chunk-BAL64WSI.js → chunk-FMRSMN34.js} +1 -1
  72. package/dist/chunk-FNH55WSR.js +19 -0
  73. package/dist/chunk-FQLIW3LM.js +2 -0
  74. package/dist/{chunk-JRMDGLLT.js → chunk-G7VQCS4J.js} +1 -1
  75. package/dist/chunk-GCBKDX2J.js +2 -0
  76. package/dist/{chunk-AAONIIQV.js → chunk-GFKCTYCA.js} +1 -1
  77. package/dist/chunk-GKYPNSQP.js +26 -0
  78. package/dist/chunk-GPG3FIN3.js +21 -0
  79. package/dist/chunk-GZPK6FRP.js +7 -0
  80. package/dist/{chunk-NOCIMJSN.js → chunk-HCKH44I2.js} +1 -1
  81. package/dist/chunk-HEAIJCGZ.js +2 -0
  82. package/dist/{chunk-3FN5VJMV.js → chunk-HMYMSRA4.js} +1 -1
  83. package/dist/chunk-I7TIGB7K.js +2 -0
  84. package/dist/chunk-IDX3TOPY.js +6 -0
  85. package/dist/{chunk-CVOGP253.js → chunk-IMR64OCZ.js} +1 -1
  86. package/dist/{chunk-IBNC444G.js → chunk-IOD3HQVW.js} +1 -1
  87. package/dist/chunk-IOFZSQAA.js +2 -0
  88. package/dist/chunk-IP2O264K.js +3 -0
  89. package/dist/{chunk-CSQ46PJ7.js → chunk-JJHG3BWO.js} +1 -1
  90. package/dist/{chunk-5JTUL6XL.js → chunk-JZ26R6UL.js} +1 -1
  91. package/dist/chunk-KBM3XHAM.js +2 -0
  92. package/dist/{chunk-SY3HLQMV.js → chunk-KCCSWEGA.js} +1 -1
  93. package/dist/chunk-KFSUPQAG.js +66 -0
  94. package/dist/chunk-KRKGZ2ZW.js +47 -0
  95. package/dist/chunk-KU6IXFGZ.js +9 -0
  96. package/dist/chunk-L7MXYCD7.js +2 -0
  97. package/dist/chunk-MA34UWKX.js +4 -0
  98. package/dist/chunk-MBF3FP5P.js +5 -0
  99. package/dist/chunk-MSGW4JDG.js +2 -0
  100. package/dist/chunk-MXHHMIO2.js +349 -0
  101. package/dist/chunk-N2P4MI32.js +2 -0
  102. package/dist/{chunk-CDQX6HGJ.js → chunk-NX7TM662.js} +1 -1
  103. package/dist/chunk-OMQCD3KR.js +2 -0
  104. package/dist/{chunk-QROUKGKU.js → chunk-OS4VSIHT.js} +1 -1
  105. package/dist/chunk-OTTGS2TE.js +2 -0
  106. package/dist/chunk-QGKPLOUI.js +2 -0
  107. package/dist/{chunk-JKTFTF24.js → chunk-QRZRSAZH.js} +1 -1
  108. package/dist/{chunk-WJ5HDEVH.js → chunk-QSDH5P7C.js} +1 -1
  109. package/dist/{chunk-322JEJEH.js → chunk-QW6EZC53.js} +1 -1
  110. package/dist/{chunk-2XMJ6YAE.js → chunk-R5T4RLF5.js} +1 -1
  111. package/dist/chunk-R7QAS6LZ.js +4 -0
  112. package/dist/{chunk-LR5XO2KD.js → chunk-RC52N7PC.js} +1 -1
  113. package/dist/{chunk-33QXD75Y.js → chunk-RFR4ZKIC.js} +3 -3
  114. package/dist/{chunk-3LWTUMDG.js → chunk-RLRNLIRS.js} +1 -1
  115. package/dist/{chunk-XDHZMCTA.js → chunk-SDPRO2LE.js} +2 -2
  116. package/dist/chunk-T5Y6MOLM.js +4 -0
  117. package/dist/{chunk-4OPQJ7PE.js → chunk-TFPPEOAK.js} +1 -1
  118. package/dist/chunk-TH47OOBV.js +4 -0
  119. package/dist/{chunk-XVDJ423L.js → chunk-TKGUT425.js} +1 -1
  120. package/dist/{chunk-OHRS3H7Z.js → chunk-TRJUD3XJ.js} +1 -1
  121. package/dist/chunk-TYLYFERW.js +10 -0
  122. package/dist/chunk-TZXXJWHA.js +2 -0
  123. package/dist/chunk-UD7KKHPW.js +5 -0
  124. package/dist/{chunk-APAIWBIH.js → chunk-UDIQOJEL.js} +1 -1
  125. package/dist/chunk-UV462FZR.js +2 -0
  126. package/dist/{chunk-323MLBYA.js → chunk-UXDL4XDL.js} +1 -1
  127. package/dist/chunk-V2R3LCA3.js +12 -0
  128. package/dist/chunk-VAYBKR76.js +4 -0
  129. package/dist/{chunk-AH7ZZIZY.js → chunk-VRVFPMCR.js} +1 -1
  130. package/dist/chunk-W2JFDDIB.js +2 -0
  131. package/dist/chunk-W4B5LOEX.js +4 -0
  132. package/dist/{chunk-36OC3TFE.js → chunk-W5TTF7GB.js} +2 -2
  133. package/dist/chunk-WXHQYYD5.js +2 -0
  134. package/dist/{chunk-6HEGD6H2.js → chunk-XO5ZH3ZR.js} +1 -1
  135. package/dist/chunk-XWKUZJCP.js +2 -0
  136. package/dist/{chunk-2KBD6JZX.js → chunk-YFYCCTSL.js} +1 -1
  137. package/dist/{chunk-ZM5PVRJK.js → chunk-YJELGSKJ.js} +1 -1
  138. package/dist/chunk-YRFMPIU2.js +4 -0
  139. package/dist/{chunk-2XGDWUJ5.js → chunk-ZGBSGZZM.js} +1 -1
  140. package/dist/{chunk-NBKQT7LJ.js → chunk-ZIUAOEUC.js} +1 -1
  141. package/dist/chunk-ZMNJBUAO.js +2 -0
  142. package/dist/chunk-ZVHCQMJ6.js +13 -0
  143. package/dist/committer-SWEWEYNX.js +2 -0
  144. package/dist/{config-R3GF2FZA.js → config-RS47F5SC.js} +1 -1
  145. package/dist/{controller-client-RD2YEMAH.js → controller-client-OB4WD2C4.js} +1 -1
  146. package/dist/{cover-cmd-TXICWHUU.js → cover-cmd-HDZZWJXG.js} +1 -1
  147. package/dist/{credentials-XN4ROCQ3.js → credentials-OH6AVI6N.js} +1 -1
  148. package/dist/deps-resolve-XC5S53DG.js +2 -0
  149. package/dist/descriptor-OEUZZCOK.js +2 -0
  150. package/dist/design-committer-VYT6NU3T.js +2 -0
  151. package/dist/dispatch-SE5GY3Z2.js +2 -0
  152. package/dist/doctor-FSECFZUU.js +2 -0
  153. package/dist/docx-convert-JMUMT5C4.js +2 -0
  154. package/dist/{dossier-QZV74XOS.js → dossier-KTLTGT2X.js} +1 -1
  155. package/dist/evidence-OYPHZUKI.js +2 -0
  156. package/dist/evolve-cmd-BCPNXAMV.js +2 -0
  157. package/dist/exec-P2IKJRRR.js +2 -0
  158. package/dist/exit-manager-3FVBTNYR.js +2 -0
  159. package/dist/explain-UAAQWHYR.js +2 -0
  160. package/dist/{explain-cmd-X7JZLSZZ.js → explain-cmd-3GEKR7O5.js} +1 -1
  161. package/dist/{explain-cmd-RZW6QJYM.js → explain-cmd-EX24XKD6.js} +1 -1
  162. package/dist/extract-bind-LLEASZAK.js +10 -0
  163. package/dist/extract-cmd-UZMEZMGP.js +5 -0
  164. package/dist/feeder-C3TOJPKK.js +2 -0
  165. package/dist/{gaps-cmd-BWCRLLBK.js → gaps-cmd-IVXFPFAQ.js} +1 -1
  166. package/dist/{gate-YHBPWEM5.js → gate-54BRAE7N.js} +1 -1
  167. package/dist/{generate-headless-BSTDLZZY.js → generate-headless-D3SVQ2AI.js} +3 -3
  168. package/dist/{headless-io-BL3TEAX5.js → headless-io-66RG5NN5.js} +1 -1
  169. package/dist/host-7GZPBA74.js +2 -0
  170. package/dist/identity-ADZ4PAJF.js +2 -0
  171. package/dist/index.js +85 -69
  172. package/dist/ingest-EX72IEQT.js +2 -0
  173. package/dist/ingest-cmd-EAE7N5RC.js +2 -0
  174. package/dist/{interactive-bind-43HGDF5K.js → interactive-bind-ORMN2REX.js} +7 -6
  175. package/dist/{lifecycle-cmd-D6TVTYRK.js → lifecycle-cmd-O2324GN6.js} +1 -1
  176. package/dist/{list-cmd-XCAV2FKA.js → list-cmd-N4KMA34H.js} +1 -1
  177. package/dist/list-commands-MRXL5HGS.js +2 -0
  178. package/dist/locks-cmd-CSVSWY2Y.js +2 -0
  179. package/dist/logical-ids-TEBCQJGO.js +2 -0
  180. package/dist/login-flow-QJQM3RHT.js +2 -0
  181. package/dist/maintenance-cmd-6XSVO6FO.js +2 -0
  182. package/dist/mobile-prompts-TOX35ER6.js +2 -0
  183. package/dist/pdf-convert-OZIRUADA.js +2 -0
  184. package/dist/persist-recorded-session-TLDQ5HKP.js +3 -0
  185. package/dist/phase-seed-VFHIH6FL.js +2 -0
  186. package/dist/pipeline-UOM4LNAI.js +2 -0
  187. package/dist/prepare-target-QYWIJIVQ.js +2 -0
  188. package/dist/readmodel-XOYGGQ3S.js +2 -0
  189. package/dist/reconcile-cmd-3H34KVVD.js +2 -0
  190. package/dist/reconcile-deps-XIH75ZLY.js +4 -0
  191. package/dist/reconcile-engine-UKWPG2LV.js +2 -0
  192. package/dist/{recording-banner-TALO7PUR.js → recording-banner-4M7XHVGI.js} +1 -1
  193. package/dist/records-IOZTZUZV.js +2 -0
  194. package/dist/registry-PYOTKZYZ.js +2 -0
  195. package/dist/{require-project-folder-R347LFDQ.js → require-project-folder-4UPQNEBJ.js} +1 -1
  196. package/dist/resolve-run-intent-X72V3KJA.js +7 -0
  197. package/dist/{resolver-IDCGRPFJ.js → resolver-UBOZLFFE.js} +1 -1
  198. package/dist/revert-NQ7GEVSE.js +2 -0
  199. package/dist/review-cmd-DQRKQUMG.js +4 -0
  200. package/dist/run-2COODVX2.js +2 -0
  201. package/dist/run-URPGHOQM.js +2 -0
  202. package/dist/run-channel-RGH4WIQX.js +2 -0
  203. package/dist/{run-test-md-DFNIGYB7.js → run-test-md-76ZPKXO6.js} +3 -3
  204. package/dist/session-target-UWROGOCY.js +2 -0
  205. package/dist/sessions-GIEXOCE4.js +2 -0
  206. package/dist/{sessions-cmd-AQWLL5ZN.js → sessions-cmd-ZZIZN2VB.js} +4 -4
  207. package/dist/{skill-installer-ANXTCXQV.js → skill-installer-CIS6GAYF.js} +1 -1
  208. package/dist/spawner-J67QR4QP.js +2 -0
  209. package/dist/structured-answers-5EY2AZN7.js +5 -0
  210. package/dist/tcg-generate-BDTRKY2A.js +2 -0
  211. package/dist/testmd-actions-77ELR5UU.js +2 -0
  212. package/dist/token-refresh-4BPAPXKK.js +2 -0
  213. package/dist/types-6E2HTDKJ.js +2 -0
  214. package/dist/{validate-basic-O2DP2XJL.js → validate-basic-2GVSQ2R5.js} +1 -1
  215. package/dist/verdicts-TRSTJLCL.js +2 -0
  216. package/dist/{version-check-RNR3JCQ5.js → version-check-O6PYTI4T.js} +1 -1
  217. package/dist/{view-cmd-YSEGA5PI.js → view-cmd-KPJTP4DI.js} +1 -1
  218. package/dist/walk-session-CHJXHZMO.js +2 -0
  219. package/dist/with-telemetry-CQCWLVOC.js +2 -0
  220. package/package.json +12 -6
  221. package/dist/ChatSurface-D66CACLX.js +0 -8
  222. package/dist/ConfigView-DBANTBXC.js +0 -2
  223. package/dist/EvidenceViewOffer-DNCQ3A6R.js +0 -2
  224. package/dist/FolderPicker-W7RCIFEL.js +0 -2
  225. package/dist/SingleShotApp-SMCAIKCE.js +0 -2
  226. package/dist/TestMdRunView-FMKZJ3A3.js +0 -2
  227. package/dist/bind-AACBTSAA.js +0 -12
  228. package/dist/bootstrap-CNOZ5VRB.js +0 -2
  229. package/dist/bridge-T4HL4TG7.js +0 -2
  230. package/dist/chat-committer-4BQBOKI4.js +0 -2
  231. package/dist/chat-controller-NNTMKEPG.js +0 -2
  232. package/dist/chunk-2SREGETM.js +0 -4
  233. package/dist/chunk-3STZLM5J.js +0 -4
  234. package/dist/chunk-5YPBPZUR.js +0 -2
  235. package/dist/chunk-6UJDOAYR.js +0 -26
  236. package/dist/chunk-BQHKBOSF.js +0 -11
  237. package/dist/chunk-DQ54MH7F.js +0 -13
  238. package/dist/chunk-DXV6MBTD.js +0 -8
  239. package/dist/chunk-EV3EHXEI.js +0 -4
  240. package/dist/chunk-F7WKDMX7.js +0 -47
  241. package/dist/chunk-FPFOW6BS.js +0 -2
  242. package/dist/chunk-GVIPTX6T.js +0 -6
  243. package/dist/chunk-GW5DWAXY.js +0 -2
  244. package/dist/chunk-HJERKSBK.js +0 -349
  245. package/dist/chunk-IQDWBTRJ.js +0 -3
  246. package/dist/chunk-IXVOXJP6.js +0 -6
  247. package/dist/chunk-KNDSQ4PS.js +0 -2
  248. package/dist/chunk-KRXSXQBU.js +0 -12
  249. package/dist/chunk-LQZ2BU7Q.js +0 -2
  250. package/dist/chunk-NAC7SFBE.js +0 -5
  251. package/dist/chunk-NAE7MBR2.js +0 -23
  252. package/dist/chunk-NRC2G4Y5.js +0 -5
  253. package/dist/chunk-O56PUUNL.js +0 -9
  254. package/dist/chunk-QM4S2APK.js +0 -2
  255. package/dist/chunk-RKWJG3WW.js +0 -19
  256. package/dist/chunk-RNSSM2BK.js +0 -11
  257. package/dist/chunk-SE6WNCYU.js +0 -4
  258. package/dist/chunk-SRDHPKJT.js +0 -2
  259. package/dist/chunk-SWESH2J7.js +0 -10
  260. package/dist/chunk-T63R6QT4.js +0 -4
  261. package/dist/chunk-UI7KULSI.js +0 -7
  262. package/dist/chunk-UPPEOQJQ.js +0 -3
  263. package/dist/chunk-URQUQWGW.js +0 -62
  264. package/dist/chunk-UX2B7L6K.js +0 -2
  265. package/dist/chunk-VOHQA2SP.js +0 -2
  266. package/dist/chunk-W5DOU2DV.js +0 -2
  267. package/dist/chunk-W6VD2XFO.js +0 -19
  268. package/dist/chunk-WAOCHXJ5.js +0 -2
  269. package/dist/chunk-WWNSD6FA.js +0 -6
  270. package/dist/chunk-ZLCZDAEX.js +0 -6
  271. package/dist/committer-2EJPVVCQ.js +0 -2
  272. package/dist/descriptor-KXDJ4XYD.js +0 -2
  273. package/dist/design-committer-BQUWD6AC.js +0 -2
  274. package/dist/docx-convert-ZBVQO2LG.js +0 -2
  275. package/dist/evidence-V23FPVXQ.js +0 -2
  276. package/dist/evolve-cmd-PZCPXDMR.js +0 -2
  277. package/dist/exit-manager-HNFATGSM.js +0 -2
  278. package/dist/explain-UE4IACQH.js +0 -2
  279. package/dist/extract-bind-BFY7IRL4.js +0 -10
  280. package/dist/extract-cmd-U3MGK2LP.js +0 -6
  281. package/dist/feeder-XGTFV7TZ.js +0 -2
  282. package/dist/ingest-AL6CABJT.js +0 -2
  283. package/dist/ingest-cmd-O6OWWZT4.js +0 -2
  284. package/dist/list-commands-747UTUSS.js +0 -2
  285. package/dist/locks-cmd-QAULI5LV.js +0 -2
  286. package/dist/logical-ids-4G4FAHNJ.js +0 -2
  287. package/dist/login-flow-CV76ENHV.js +0 -2
  288. package/dist/maintenance-cmd-ZRB4NTGG.js +0 -2
  289. package/dist/pdf-convert-S7VYE6AV.js +0 -2
  290. package/dist/persist-recorded-session-MDPWWUA7.js +0 -3
  291. package/dist/phase-seed-52LRE3LH.js +0 -2
  292. package/dist/pipeline-LM5JAK7F.js +0 -2
  293. package/dist/readmodel-X7L7W2BA.js +0 -2
  294. package/dist/reconcile-cmd-DGCSDML6.js +0 -2
  295. package/dist/records-5SVUXJBW.js +0 -2
  296. package/dist/revert-DXXYXJGN.js +0 -2
  297. package/dist/review-cmd-2QF5HTI7.js +0 -4
  298. package/dist/run-52UIBPXD.js +0 -2
  299. package/dist/run-VRVH4VO3.js +0 -2
  300. package/dist/sessions-BLXZVK5U.js +0 -2
  301. package/dist/spawner-AH5FTUYU.js +0 -2
  302. package/dist/structured-answers-QHFGZPSS.js +0 -5
  303. package/dist/tcg-generate-WKCBBKI5.js +0 -2
  304. package/dist/testmd-actions-RPYG6TJG.js +0 -2
  305. package/dist/token-refresh-NIDUOTRM.js +0 -2
  306. package/dist/verdicts-TJH3O5UW.js +0 -2
  307. package/dist/walk-session-HXW4OSA2.js +0 -2
  308. package/dist/with-telemetry-PNP6CAVM.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as g}from"./chunk-C4G7RVJ6.js";import{readFileSync as o,writeFileSync as h,mkdirSync as u,readdirSync as a,unlinkSync as s,existsSync as l,chmodSync as f}from"fs";import{join as n,dirname as P}from"path";var d=class{baseDir;profilesDir;configFile;constructor(t=g){this.baseDir=t,this.profilesDir=n(t,"profiles"),this.configFile=n(t,"config.json")}readConfig(){try{return JSON.parse(o(this.configFile,"utf-8"))}catch{return{}}}writeConfig(t){u(this.baseDir,{recursive:!0,mode:448}),h(this.configFile,JSON.stringify(t,null,2)+`
2
+ import{c as g}from"./chunk-27U4PLPX.js";import{readFileSync as o,writeFileSync as h,mkdirSync as u,readdirSync as a,unlinkSync as s,existsSync as l,chmodSync as f}from"fs";import{join as n,dirname as P}from"path";var d=class{baseDir;profilesDir;configFile;constructor(t=g){this.baseDir=t,this.profilesDir=n(t,"profiles"),this.configFile=n(t,"config.json")}readConfig(){try{return JSON.parse(o(this.configFile,"utf-8"))}catch{return{}}}writeConfig(t){u(this.baseDir,{recursive:!0,mode:448}),h(this.configFile,JSON.stringify(t,null,2)+`
3
3
  `),f(this.configFile,384)}getActiveProfile(){return this.readConfig().active_profile??null}setActiveProfile(t){let i=this.readConfig();i.active_profile=t,this.writeConfig(i)}getDefaultEnv(){return this.readConfig().default_env??"prod"}setDefaultEnv(t){let i=this.readConfig();i.default_env=t,this.writeConfig(i)}credentialsPath(t,i){return n(this.profilesDir,t,i,"credentials")}clientPath(t,i){return n(this.profilesDir,t,i,"client.json")}basicAuthPath(t,i){return n(this.profilesDir,t,i,"basic-auth")}profileConfigPath(t,i){return n(this.profilesDir,t,i,"profile-config.json")}saveProfileConfig(t,i,r){let e=this.loadProfileConfig(t,i)??{};this.writeSecure(this.profileConfigPath(t,i),{...e,...r})}loadProfileConfig(t,i){try{return JSON.parse(o(this.profileConfigPath(t,i),"utf-8"))}catch{return null}}writeSecure(t,i){try{u(P(t),{recursive:!0,mode:448}),h(t,JSON.stringify(i,null,2)+`
4
4
  `),f(t,384)}catch(r){let e=r instanceof Error?r.message:String(r);process.stderr.write(`[auth] Failed to save credentials: ${e}
5
5
  `)}}saveCredentials(t,i,r){this.writeSecure(this.credentialsPath(t,i),r)}loadCredentials(t,i){try{return JSON.parse(o(this.credentialsPath(t,i),"utf-8"))}catch{return null}}saveClient(t,i,r){this.writeSecure(this.clientPath(t,i),r)}loadClient(t,i){try{return JSON.parse(o(this.clientPath(t,i),"utf-8"))}catch{return null}}getActiveCredentials(){let t=this.getActiveProfile();if(!t)return{credentials:null,profile:null,env:null};let i=this.getDefaultEnv();return{credentials:this.loadCredentials(t,i),profile:t,env:i}}saveBasicAuth(t,i,r){this.writeSecure(this.basicAuthPath(t,i),r)}loadBasicAuth(t,i){try{return JSON.parse(o(this.basicAuthPath(t,i),"utf-8"))}catch{return null}}deleteBasicAuth(t,i){try{s(this.basicAuthPath(t,i))}catch{}}resolveAuth(){let t=this.getActiveProfile();if(!t)return null;let i=this.getDefaultEnv(),r=this.loadBasicAuth(t,i);return r?{method:"basic",...r,profile:t,env:i}:this.loadCredentials(t,i)?{method:"oauth",profile:t,env:i}:null}listProfiles(){let t=[];try{for(let i of a(this.profilesDir)){let r=n(this.profilesDir,i);try{for(let e of a(r)){let c=n(r,e),v=l(n(c,"credentials")),p=l(n(c,"client.json")),y=l(n(c,"basic-auth"));(v||p||y)&&t.push({profile:i,env:e})}}catch{}}}catch{}return t}deleteProfile(t,i){try{s(this.credentialsPath(t,i))}catch{}if(this.getActiveProfile()===t){let r=this.readConfig();delete r.active_profile,this.writeConfig(r)}}deleteProfileFull(t,i){if(i){try{s(this.credentialsPath(t,i))}catch{}try{s(this.clientPath(t,i))}catch{}try{s(this.basicAuthPath(t,i))}catch{}try{s(this.profileConfigPath(t,i))}catch{}}else try{let r=n(this.profilesDir,t);for(let e of a(r)){try{s(n(r,e,"credentials"))}catch{}try{s(n(r,e,"client.json"))}catch{}try{s(n(r,e,"basic-auth"))}catch{}try{s(n(r,e,"profile-config.json"))}catch{}}}catch{}}};export{d as a};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as C}from"./chunk-EWCAFKLX.js";import{a as D}from"./chunk-YCCUBQY4.js";import{a as O}from"./chunk-L7MXYCD7.js";import{f as Z}from"./chunk-QGKPLOUI.js";import{a as M}from"./chunk-FNH55WSR.js";import{b as W}from"./chunk-AW2XUHH4.js";import{a as B}from"./chunk-TFPPEOAK.js";import{y as o}from"./chunk-27U4PLPX.js";import{a as v}from"./chunk-HCBYKLMW.js";import{a as n,b as t,i as N}from"./chunk-C44QQJR4.js";import{a as L}from"./chunk-6YGTRKDT.js";import{e as g}from"./chunk-UR6MHSHU.js";var h=g(v(),1);function oe(e){let i=e.kind==="simulator";switch(e.state){case"ready":return i?"Booted":"Running";case"stopped":return i?"Shutdown":"Stopped";case"unauthorized":return"UNAUTHORIZED";case"offline":return"Offline"}}function te(e){switch(e.state){case"unauthorized":return"accept the authorisation prompt on the device, then reopen this list";case"offline":return e.kind==="simulator"?"not responding \u2014 open Simulator.app to inspect it":"not responding \u2014 reconnect it, or restart the emulator";default:return}}function re(e,i){let c=M(i.id);return e.platform===i.platform&&e.kind===i.kind&&(M(e.id)===c||e.virtualName!==void 0&&M(e.virtualName)===c)}function ne(e,i){let c=e.state==="ready"||e.state==="stopped",m=te(e);return{id:e.id,label:`${e.displayName} \xB7 ${oe(e)}`,...i&&re(e,i)?{isActive:!0}:{},...c?{}:{disabled:!0},...!c&&m?{disabledHint:m}:{}}}function ie(e){return e==="emulator"?"No Android emulator found. Make sure an emulator exists on this machine (Android Studio \u2192 Device Manager), then reopen this list.":e==="simulator"?"No iOS simulator found. Make sure a simulator exists on this machine (Xcode \u2192 Windows \u2192 Devices and Simulators), then reopen this list.":"No emulator or simulator found. Make sure one exists on this machine, then reopen this list."}function ge({targets:e,preselectedTarget:i,preselectedId:c,busyMessage:m,onSelect:S,onCancel:f,kind:l}){if(m)return(0,h.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,h.jsx)(t,{color:o.orange,bold:!0,children:"Device"}),(0,h.jsxs)(n,{marginTop:1,children:[(0,h.jsx)(C,{}),(0,h.jsxs)(t,{color:o.secondary,children:[" ",m]})]})]});if(e.length===0)return(0,h.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,h.jsx)(t,{color:o.orange,bold:!0,children:"Device"}),(0,h.jsx)(n,{marginTop:1,children:(0,h.jsx)(t,{color:o.dim,children:ie(l)})})]});let d=e.map(r=>ne(r,i)),p=i?d.find(r=>r.isActive)?.id??null:c?e.find(r=>r.id===c||r.virtualName===c)?.id??null:null,a=new Map(e.map(r=>[r.id,r]));return(0,h.jsx)(O,{title:"Device",items:d,itemNoun:"devices",defaultActiveId:p,preserveSelectionById:!0,onSelect:r=>{let y=a.get(r.id);y&&S(y)},onCancel:f})}var b=g(L(),1);var u=g(v(),1),q=50,G=500;function ae(e){return`${e.name} (${e.appId})`}function ve({kind:e,listApps:i,onSelect:c,onManualEntry:m,onCancel:S,busyMessage:f}){let[l,d]=(0,b.useState)([]),[p,a]=(0,b.useState)(!0),[r,y]=(0,b.useState)(!1),[Q,E]=(0,b.useState)(!1),[w,H]=(0,b.useState)(null),[$,V]=(0,b.useState)(""),[J,U]=(0,b.useState)(!1),X=(0,b.useRef)(!0),R=(0,b.useRef)(0);if((0,b.useEffect)(()=>{let x=++R.current,k=$.trim();X.current?a(!0):k&&E(!0),y(!0),H(null),U(!1),(async()=>{let I=[];try{for(let P=0;;P+=q){let z=await i({limit:q,offset:P,search:k});if(x!==R.current)return;if(I.push(...z.apps),d([...I]),X.current&&(a(!1),X.current=!1),E(!1),z.apps.length===0||I.length>=z.total)break;if(I.length>=G){U(!0);break}}}catch(P){if(x!==R.current)return;H(P instanceof Error?P.message:String(P)),a(!1),E(!1)}finally{x===R.current&&y(!1)}})()},[$,i]),N((x,k)=>{if(k.tab){m();return}k.escape&&S()},{isActive:!!w&&!f}),f)return(0,u.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,u.jsx)(t,{color:o.orange,bold:!0,children:"App under test"}),(0,u.jsxs)(n,{marginTop:1,children:[(0,u.jsx)(C,{}),(0,u.jsxs)(t,{color:o.secondary,children:[" ",f]})]})]});if(w)return(0,u.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.red,paddingX:2,paddingY:1,children:[(0,u.jsx)(t,{color:o.red,bold:!0,children:"App under test"}),(0,u.jsx)(n,{marginTop:1,children:(0,u.jsx)(t,{color:o.red,children:"Could not load your uploads."})}),(0,u.jsx)(n,{marginTop:1,children:(0,u.jsx)(t,{color:o.dim,children:w})}),(0,u.jsx)(B,{bindings:[{keys:"tab",label:"tab to enter an app id"}],escBackLabel:"back to chat"})]});let j=new Map(l.map(x=>[x.appId,x])),ee=l.map(x=>({id:x.appId,label:ae(x)})),_=!p&&!r&&l.length===0&&!$.trim()?e==="simulator"?"No simulator builds uploaded to this account yet \u2014 press Tab to enter an app id.":"No emulator builds uploaded to this account yet \u2014 press Tab to enter an app id.":null;return(0,u.jsx)(O,{title:"App under test",items:ee,loading:p,loadingText:"Loading your uploads\u2026",loadingMore:r,searching:Q,itemNoun:"uploads",preserveSelectionById:!0,onSearch:V,onTab:m,extraHint:"tab to enter an id",footer:_?(0,u.jsx)(t,{color:o.dim,children:_}):J?(0,u.jsx)(t,{color:o.dim,children:`Showing the first ${G} \u2014 type to search the rest.`}):void 0,onSelect:x=>{let k=j.get(x.id);k&&c({appId:k.appId,name:k.name})},onCancel:S})}var Y=g(L(),1);var T=g(v(),1),le={emulator:["apk"],simulator:["zip"]};function pe(e){return Z(e.trim())}function Ne({kind:e,onBack:i,onSelect:c,onCancel:m}){let[S,f]=(0,Y.useState)(""),[l,d]=(0,Y.useState)(null),p=e==="emulator"?".apk":".zip";return(0,T.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,T.jsx)(t,{color:o.orange,bold:!0,children:"App under test"}),(0,T.jsx)(n,{marginTop:1,children:(0,T.jsx)(t,{color:o.dim,children:`Path to a build (${p}): `})}),(0,T.jsxs)(n,{marginTop:1,children:[(0,T.jsx)(t,{color:o.dim,children:" "}),(0,T.jsx)(D,{value:S,onChange:a=>{f(a),l&&d(null)},onSubmit:a=>{let r=pe(a);if(!r){d(a.trim()?`Not a build \u2014 expected ${p}.`:"Enter the path to a build.");return}if(!le[e].includes(r.kind)){d(`${r.kind} builds don't run on a ${e} \u2014 expected ${p}.`);return}d(null),c(r).then(y=>{!y.ok&&y.error&&d(y.error)})},onCancel:i,placeholder:e==="emulator"?"/path/to/app-debug.apk":"/path/to/MyApp.zip"})]}),l&&(0,T.jsx)(n,{marginTop:1,children:(0,T.jsx)(t,{color:o.red,children:l})}),(0,T.jsx)(B,{bindings:[{keys:"\u21B5",label:"use this build"}],escBackLabel:"back"})]})}var F=g(L(),1);var A=g(v(),1);function se(e){return[{value:"local",label:"Local build",hint:e==="emulator"?".apk":".zip",available:!0},{value:"uploaded",label:"Uploaded app",hint:"an app id from your cloud uploads",available:!0}]}function $e({kind:e,onSelect:i,onCancel:c}){let m=se(e),[S,f]=(0,F.useState)(0),[l,d]=(0,F.useState)(null);return N((p,a)=>{if(a.escape){c();return}if(a.upArrow&&f(r=>Math.max(0,r-1)),a.downArrow&&f(r=>Math.min(m.length-1,r+1)),a.return){let r=m[S];if(!r.available){d("That source isn't available \u2014 choose a local build for now.");return}d(null),i(r.value)}}),(0,A.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,A.jsx)(t,{color:o.orange,bold:!0,children:"App under test"}),(0,A.jsx)(n,{marginTop:1,flexDirection:"column",children:m.map((p,a)=>{let r=a===S,y=p.available?r?o.orange:void 0:o.muted;return(0,A.jsxs)(n,{children:[(0,A.jsxs)(t,{color:y,children:[r?"\u276F ":" ",p.label]}),(0,A.jsxs)(t,{color:o.dim,children:[" ",p.hint]})]},p.value)})}),l&&(0,A.jsx)(n,{marginTop:1,children:(0,A.jsx)(t,{color:o.red,children:l})}),(0,A.jsx)(B,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],escBackLabel:"back"})]})}var K=g(L(),1);var s=g(v(),1);function We({busyMessage:e,onSubmit:i,onBack:c}){let[m,S]=(0,K.useState)(""),[f,l]=(0,K.useState)(null);return e?(0,s.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,s.jsx)(t,{color:o.orange,bold:!0,children:"App under test"}),(0,s.jsxs)(n,{marginTop:1,children:[(0,s.jsx)(C,{}),(0,s.jsxs)(t,{color:o.secondary,children:[" ",e]})]})]}):(0,s.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,s.jsx)(t,{color:o.orange,bold:!0,children:"App under test"}),(0,s.jsx)(n,{marginTop:1,children:(0,s.jsx)(t,{color:o.dim,children:"App id from your cloud uploads:"})}),(0,s.jsxs)(n,{marginTop:1,children:[(0,s.jsx)(t,{color:o.dim,children:" "}),(0,s.jsx)(D,{value:m,onChange:d=>{S(d),f&&l(null)},onSubmit:d=>{let p=d.trim();if(!p){l("Enter an app id.");return}if(!W(p)){l("That doesn't look like an app id \u2014 they start with APP.");return}l(null),i(p).then(a=>{!a.ok&&a.error&&l(a.error)})},onCancel:c,placeholder:"APP1016032231178585590501450"})]}),f&&(0,s.jsxs)(n,{marginTop:1,flexDirection:"column",children:[(0,s.jsx)(t,{color:o.red,children:f}),(0,s.jsx)(t,{color:o.dim,children:"Enter a valid app id \u2014 copy it from your cloud uploads."})]}),(0,s.jsx)(B,{bindings:[{keys:"\u21B5",label:"use this app"}],escBackLabel:"back"})]})}export{ge as a,ve as b,Ne as c,$e as d,We as e};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as n}from"./chunk-RZ4F3BHX.js";import{a as c}from"./chunk-JRMDGLLT.js";import{v as s,w as a}from"./chunk-C4G7RVJ6.js";import{createHash as h,randomBytes as g}from"crypto";var l=class{authBaseUrl;consentUrl;constructor(t="prod"){let e=c(t);this.authBaseUrl=e.authBaseUrl,this.consentUrl=e.consentUrl}static generatePkce(){let t=g(96).toString("base64url").slice(0,128),e=h("sha256").update(t).digest("base64url");return[t,e]}buildAuthorizationUrl(t,e,r,o){let i=new URLSearchParams({response_type:"code",client_id:t,redirect_uri:o,scope:a,code_challenge:e,code_challenge_method:"S256",state:r});return`${this.consentUrl}/oauth2?${i.toString()}`}async registerClient(t){let e=await n(`${this.authBaseUrl}/oauth2/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:s,redirect_uris:[t],grant_types:["authorization_code"],response_types:["code"],client_type:"public",application_type:"native"})});if(!e.ok)throw new Error(`DCR failed: ${e.status} ${await e.text()}`);return e.json()}async exchangeCode(t,e,r,o){let i=await n(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:t,redirect_uri:o,client_id:e,code_verifier:r})});if(!i.ok)throw new Error(`Token exchange failed: ${i.status}`);return i.json()}async refreshToken(t,e){let r=await n(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:t,client_id:e})});if(!r.ok)throw new Error(`Token refresh failed: ${r.status}`);return r.json()}async revokeToken(t,e,r="access_token"){await n(`${this.authBaseUrl}/oauth2/revoke`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,token_type_hint:r,client_id:e})})}async validateToken(t){let e=new AbortController,r=setTimeout(()=>e.abort(),1e4);try{let o=await n(`${this.authBaseUrl}/api/user`,{headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},signal:e.signal});return clearTimeout(r),o.ok}catch{return clearTimeout(r),!1}}};export{l as a};
2
+ import{a as c}from"./chunk-G7VQCS4J.js";import{a as n}from"./chunk-RZ4F3BHX.js";import{v as s,w as a}from"./chunk-27U4PLPX.js";import{createHash as h,randomBytes as g}from"crypto";var l=class{authBaseUrl;consentUrl;constructor(t="prod"){let e=c(t);this.authBaseUrl=e.authBaseUrl,this.consentUrl=e.consentUrl}static generatePkce(){let t=g(96).toString("base64url").slice(0,128),e=h("sha256").update(t).digest("base64url");return[t,e]}buildAuthorizationUrl(t,e,r,o){let i=new URLSearchParams({response_type:"code",client_id:t,redirect_uri:o,scope:a,code_challenge:e,code_challenge_method:"S256",state:r});return`${this.consentUrl}/oauth2?${i.toString()}`}async registerClient(t){let e=await n(`${this.authBaseUrl}/oauth2/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:s,redirect_uris:[t],grant_types:["authorization_code"],response_types:["code"],client_type:"public",application_type:"native"})});if(!e.ok)throw new Error(`DCR failed: ${e.status} ${await e.text()}`);return e.json()}async exchangeCode(t,e,r,o){let i=await n(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:t,redirect_uri:o,client_id:e,code_verifier:r})});if(!i.ok)throw new Error(`Token exchange failed: ${i.status}`);return i.json()}async refreshToken(t,e){let r=await n(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:t,client_id:e})});if(!r.ok)throw new Error(`Token refresh failed: ${r.status}`);return r.json()}async revokeToken(t,e,r="access_token"){await n(`${this.authBaseUrl}/oauth2/revoke`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,token_type_hint:r,client_id:e})})}async validateToken(t){let e=new AbortController,r=setTimeout(()=>e.abort(),1e4);try{let o=await n(`${this.authBaseUrl}/api/user`,{headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},signal:e.signal});return clearTimeout(r),o.ok}catch{return clearTimeout(r),!1}}};export{l as a};
@@ -0,0 +1,10 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as U,b as te,c as ne,j as x}from"./chunk-W4B5LOEX.js";import{a as M,b as J}from"./chunk-2UIHS2FH.js";import{a as B}from"./chunk-N2P4MI32.js";import{b as j,d as ee}from"./chunk-NVGBE2DR.js";import{A as Q}from"./chunk-TH47OOBV.js";import{x as q}from"./chunk-27U4PLPX.js";var w="https://integrations.lambdatest.com",g=class extends Error{constructor(e,r){super(r);this.code=e;this.name="LisError"}};function he(t){let n=t.TESTMUAI_ENV==="stage"?"stage":"prod";return`${q[n].shareApiBaseUrl}/lis/api/v1`}function ye(t){let n=t.env??process.env,e=t.auth?.TESTMUAI_BASIC_AUTH||n.TESTMUAI_BASIC_AUTH;if(e)return{authorization:`Basic ${e}`};let r=t.auth?.TESTMUAI_API_KEY||n.TESTMUAI_API_KEY;return r?{authorization:`Bearer ${r}`}:{}}function $(t){let n=t.split(`
3
+ `,1)[0].replace(/[\u0000-\u001f\u007f-\u009f]/g,"");return n.length>200?`${n.slice(0,200)}\u2026`:n}function Ee(t,n,e="the issue"){return t===401||t===403?new g("LIS_AUTH","credentials rejected \u2014 run `kane-cli login` and retry"):t>=500?new g("LIS_UNAVAILABLE",`the integrations service returned an error (HTTP ${t}) \u2014 retry later`):new g("JIRA_ISSUE_UNAVAILABLE",`could not fetch ${e}: ${$(n)||`HTTP ${t}`}`)}function P(t){try{return JSON.parse(t.bytes.toString("utf8"))}catch{throw new g("LIS_UNAVAILABLE","the integrations service returned a malformed response \u2014 retry later")}}function Z(t){try{return JSON.parse(t.bytes.toString("utf8"))}catch{return{}}}function re(t){return Z(t).code}function C(t,n="the issue"){let e=Z(t);switch(e.code){case"TOKEN_EXPIRED":return new g("LIS_SETUP",`your Atlassian connection needs a resync \u2014 reconnect at ${w} and retry`);case"NOT_INSTALLED":return new g("LIS_SETUP",`no Atlassian connection for this account \u2014 create one at ${w} and retry`);case"SCOPE_MISSING":return new g("LIS_SETUP",`the connection has no Confluence access \u2014 reconnect with Confluence at ${w} and retry`);case"FORBIDDEN":return new g("LIS_FORBIDDEN",`you don't have access to ${n}`);case"NOT_FOUND":return new g("JIRA_ISSUE_UNAVAILABLE",`could not fetch ${n}: ${$(e.message??"")||"not found"}`);case"PAYLOAD_TOO_LARGE":return new g("ATTACHMENT_TOO_LARGE","the attachment exceeds the integrations service's size cap");case"INVALID_PAYLOAD":return new g("LIS_UNAVAILABLE",`the integrations service rejected the request (${$(e.message??"")||"invalid payload"}) \u2014 retry later`);case"NOT_SUPPORTED":return new g("LIS_UNAVAILABLE","the integrations service does not support this operation yet");case"UPSTREAM_ERROR":case"UPSTREAM_TIMEOUT":return new g("LIS_UNAVAILABLE","Atlassian is not responding through the integrations service \u2014 retry later");default:return Ee(t.status,e.message??"",n)}}var be=3e4,_e=5;async function N(t,n,e){let r=e.env??process.env,d=e.fetchImpl??fetch;for(let o=0;;o++){let h=new AbortController,E=setTimeout(()=>h.abort(),be);try{let s=await d(`${he(r)}${t}`,{...n,headers:{"content-type":"application/json",...ye(e),...n.headers??{}},signal:h.signal}),u=await Promise.race([s.arrayBuffer(),new Promise((c,l)=>{h.signal.addEventListener("abort",()=>l(new DOMException("aborted","AbortError")),{once:!0})})]),a={status:s.status,ok:s.ok,headers:s.headers,bytes:Buffer.from(u)};if(a.status===429){if(o>0)throw new g("LIS_RATE_LIMITED","the integrations service is busy \u2014 try again in a moment");let c=Z(a).data?.retry_after_sec,l=Math.min(Math.max(typeof c=="number"&&Number.isFinite(c)?c:1,0),_e);clearTimeout(E),await new Promise(y=>setTimeout(y,l*1e3));continue}return a}catch(s){throw s instanceof g?s:h.signal.aborted?new g("LIS_UNAVAILABLE","the integrations service did not respond within 30 seconds \u2014 retry later"):new g("LIS_UNAVAILABLE",`could not reach the integrations service (${$(s instanceof Error?s.message:String(s))}) \u2014 check your connection and retry`)}finally{clearTimeout(E)}}}function D(t){let n=t.headers.get("content-type")??"application/octet-stream";if(n.includes("json"))try{let e=JSON.parse(t.bytes.toString("utf8")),r=e.content??e.data?.content;if(typeof r=="string")return{bytes:Buffer.from(r,"base64"),mediaType:e.mime_type??e.data?.mime_type??"application/octet-stream"}}catch{}return{bytes:t.bytes,mediaType:n}}async function k(t={}){let n=await N("/jira/info",{method:"GET"},t);if(!n.ok)throw C(n);let e=P(n),r=(e.data?.SELECTED_PROJECTS??[]).map(d=>d?.key).filter(d=>typeof d=="string"&&d.length>0);return{installed:e.data?.INSTALLED==="YES",selectAll:e.data?.SELECT_ALL===!0,selectedProjects:r,capabilities:{document:e.data?.capabilities?.document===!0,comments:e.data?.capabilities?.comments===!0}}}async function F(t,n={}){let e=await N("/jira/issue?details=true",{method:"POST",body:JSON.stringify({plugin_code:"jira",issueKey:t})},n);if(!e.ok)throw C(e);let r=P(e);if(r.type==="error"||!r.data)throw new g("JIRA_ISSUE_UNAVAILABLE",`could not fetch the issue: ${$(r.message??"")||"issue not found or not accessible"}`);return r.data}var se=100,Ae=5e3,Ie=60;async function V(t,n={}){let e=[],r=new Set,d=null,o=0;for(let h=0;;h++){if(h>=Ie)throw new g("LIS_UNAVAILABLE","the integrations service kept returning comment pages without finishing \u2014 retry later");let E=await N("/jira/issue/comments",{method:"POST",body:JSON.stringify({resource_id:t,max_results:se,cursor:d,start_at:o,order_by:"created",fetch_all:!1})},n);if(!E.ok)throw C(E,"the issue's comments");let s=P(E);if(s.type==="error"||!s.data)throw new g("JIRA_ISSUE_UNAVAILABLE",`could not fetch the issue's comments: ${$(s.message??"")||"unavailable"}`);for(let R of s.data.comments??[]){let m=String(R.id);r.has(m)||(r.add(m),e.push(R))}let u=s.data.pagination;if(!u?.has_more)return e;if(e.length>=Ae)throw new g("JIRA_ISSUE_UNAVAILABLE","the issue has more comments than can be ingested \u2014 cannot build a complete identity");let a=u.next_cursor??null,c=u.next_start_at!=null,l=c?u.next_start_at:o+se;if(!(a!=null&&a!==d||a==null&&c&&l!==o))throw new g("LIS_UNAVAILABLE","the integrations service returned a non-advancing comments page \u2014 retry later");d=a,o=l}}async function G(t,n={}){let e=await N("/jira/attachment",{method:"POST",body:JSON.stringify({attachment_id:t})},n);if(!e.ok){if(re(e)===void 0){if(e.status===413)throw new g("ATTACHMENT_TOO_LARGE","the attachment exceeds the integrations service's size cap");if(e.status===404)throw new g("JIRA_NOT_CONNECTED",`Jira is not connected for this account \u2014 connect it at ${w} and retry`)}throw C(e,`attachment ${t}`)}return D(e)}var K="kane.source.jira/2";function oe(t){if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t)){let n=t.map(oe).filter(e=>e!==null);return n.length===0?null:n.join(", ")}if(t!==null&&typeof t=="object"){let n=t;for(let e of["name","value","displayName"])if(typeof n[e]=="string")return n[e];return null}return null}function ie(t,n,e){let r=[],d={},o=t.additional_fields??{};for(let a of Object.keys(o).sort()){let c=oe(o[a]);if(c===null){r.push(`field "${a}" has no stable text form \u2014 dropped from the envelope`);continue}d[a]=c}let h=[...t.attachments??[]].map(a=>({id:String(a.id),filename:a.filename??"",media_type:a.mime_type??"application/octet-stream",size:a.size??0})).sort((a,c)=>{let l=Number(a.id),y=Number(c.id);return Number.isFinite(l)&&Number.isFinite(y)?l-y:a.id<c.id?-1:a.id>c.id?1:0}),E=e.map(a=>({id:String(a.id),author:a.author?.display_name??"",body:a.body??"",created:a.created??""})).sort((a,c)=>{if(a.created!==c.created)return a.created<c.created?-1:1;let l=Number(a.id),y=Number(c.id);return Number.isFinite(l)&&Number.isFinite(y)&&l!==y?l-y:a.id<c.id?-1:a.id>c.id?1:0}),s=t.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 u={schema:K,site:n,project:s.slice(0,s.lastIndexOf("-")),issue:{id:t.id,key:s},content:{summary:t.summary??"",description:t.description??"",fields:d},attachments:h,comments:E};return{bytes:Buffer.from(JSON.stringify(u),"utf8"),envelope:u,warnings:r}}var ae=64,Le=16,we=6e6,Se=5e7,Re=12e6,ve={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"},$e=new Set(["png","jpeg","webp"]);function ce(t){return async n=>{let e;try{e=JSON.parse(n.toString("utf8"))}catch{throw new Error("JIRA_ENVELOPE_SCHEMA: source bytes are not a kane jira envelope")}if(e.schema!==K)throw new Error(`JIRA_ENVELOPE_SCHEMA: unknown envelope schema "${e.schema}" \u2014 this CLI understands ${K}`);let r=[],d=new Map,o=[],h=0,E=new Map,s=[];for(let c=0;c<e.attachments.length;c++){let l=e.attachments[c],y=`i${c+1}`,R=`attachment:${l.filename}`,m=I=>`[img#${y}] ${l.filename} (${l.media_type}, ${l.size} bytes${I?"":" \u2014 not delivered"})`,p=(I,L,T)=>{r.push({ref:y,loc:R,media_type:I,...T?.blob?{blob:T.blob}:{},...T?.appearance?{appearance:T.appearance}:{},delivery:L,...T?.duplicate_of?{duplicate_of:T.duplicate_of}:{}})};if(!l.media_type.startsWith("image/")){p(l.media_type,"unsupported-vision-media-type"),s.push(m(!1));continue}let S;try{S=await t.fetchAttachment(l.id)}catch{p(l.media_type,"external-image-not-fetched"),s.push(m(!1));continue}let f=S.bytes,i=M(f),b=ve[i.format],_=j(f);if(d.set(_,f),!$e.has(i.format)){let I=i.format==="gif"||i.format==="bmp"||i.format==="tiff"?"unsupported-vision-media-type":"unsupported-image-kind";p(b,I,{blob:_}),s.push(m(!1));continue}if(i.width===void 0||i.height===void 0||i.width*i.height>Se){p(b,"undecodable",{blob:_}),s.push(m(!1));continue}let A;if(i.format==="png"||i.format==="jpeg"){let I=J(f,i.format);if(I===null){p(b,"undecodable",{blob:_}),s.push(m(!1));continue}A=B(I.data,{width:I.width,height:I.height,channels:I.channels})}if(i.width<ae||i.height<ae){p(b,"below-dimension-floor",{blob:_,appearance:A}),s.push(m(!1));continue}let v=E.get(_);if(v!==void 0){p(b,"duplicate",{blob:_,appearance:A,duplicate_of:v}),s.push(m(!1));continue}if(f.byteLength>we){p(b,"image-too-large",{blob:_,appearance:A}),s.push(m(!1));continue}if(h+f.byteLength>Re){p(b,"vision-byte-budget-reached",{blob:_,appearance:A}),s.push(m(!1));continue}if(o.length>=Le){p(b,"image-cap-reached",{blob:_,appearance:A}),s.push(m(!1));continue}E.set(_,y),h+=f.byteLength,o.push(y),p(b,"selected",{blob:_,appearance:A}),s.push(m(!0))}let u=[];u.push(`${e.issue.key} \xB7 ${e.site}/${e.project}`,`Summary: ${e.content.summary}`),e.content.description!==""&&u.push("",...e.content.description.split(`
4
+ `));let a=Object.keys(e.content.fields);return a.length>0&&u.push("","--- fields ---",...a.map(c=>`${c}: ${e.content.fields[c]}`)),s.length>0&&u.push("","--- attachments ---",...s),e.comments.length>0&&(u.push("","--- comments ---"),e.comments.forEach((c,l)=>{l>0&&u.push(""),u.push(`[${l+1}] ${c.author} \xB7 ${c.created}`,...c.body.split(`
5
+ `))})),{projection:u.join(`
6
+ `)+`
7
+ `,inventory:r,blobs:d,delivered:o,converter:{name:"jira-convert",version:"2",policy:"v1"}}}}var Te=/^[A-Za-z][A-Za-z0-9_]*-\d+$/;function Y(t){if(!/^https?:\/\/.+/i.test(t))return null;let n;try{n=new URL(t)}catch{return null}let e=n.pathname.split("/").filter(Boolean),r=e.lastIndexOf("browse");if(r===-1||r+1>=e.length)return null;let d=e[r+1];return Te.test(d)?{site:n.hostname,issueKey:d.toUpperCase()}:null}function H(t,n){let e=Q(t),r=e.heads.get(n);if(r==null)return null;let d=e.getNode(r)?.content?.blob;if(typeof d!="string")return null;let o=ee(t,d);if(o===null)return null;try{let h=JSON.parse(o.toString("utf8"));return typeof h.site=="string"&&h.site.length>0?h.site:null}catch{return null}}async function Ce(t,n,e,r,d){let o=Y(t);if(o===null)return(e.err??e.out)(`error: ${t}: unsupported remote URL \u2014 expected a Jira issue URL (https://<site>/browse/KEY-123)`),{code:1};let h=d?.lis??{jiraInfo:k,jiraIssue:F,jiraAttachment:G,jiraComments:V};try{let s={auth:await(d?.authEnv??(await import("./auth-HET3TBRI.js")).resolveLisAuthEnv)(),env:process.env},u=await h.jiraInfo(s);if(!u.installed)return(e.err??e.out)(`error: ${t}: no Atlassian connection for this account \u2014 create one at ${w} and retry`),{code:1};if(u.capabilities.comments===!1)return(e.err??e.out)(`error: ${t}: the connection cannot read issue comments yet \u2014 resync it at ${w} and retry`),{code:1};let a=o.issueKey.slice(0,o.issueKey.lastIndexOf("-"));if(!u.selectAll&&u.selectedProjects.length>0&&!u.selectedProjects.includes(a))return(e.err??e.out)(`error: ${t}: project ${a} is not in the integration's selected projects (${u.selectedProjects.join(", ")}) \u2014 add it at ${w}`),{code:1};let c=await h.jiraIssue(o.issueKey,s),l=await h.jiraComments(o.issueKey,s),y=o.site;if(c.host)try{y=new URL(c.host).hostname}catch{y=c.host.replace(/^https?:\/\//,"").replace(/[/:].*$/,"")}let{bytes:R,warnings:m}=ie(c,y,l),p=n??o.issueKey.toLowerCase();U(p);let S=H(r,p);if(S!==null&&S!==y)return(e.err??e.out)(`error: ${t}: source '${p}' was ingested from ${S}, but this read serves ${y} \u2014 retire it first (kane-cli context retire ${p}) or ingest under a different id with --as`),{code:1};let f=await x({contextDir:r,bytes:R,media:te,sourceId:p,label:t,confirmSameSource:e.isTTY?i=>e.confirm(`identical content already ingested as ${i} \u2014 treat as the same source?`):void 0,converters:{jira:ce({fetchAttachment:i=>h.jiraAttachment(i,s)})}});e.out(z(e.isTTY,f,o.issueKey));for(let i of m)e.out(`warning: ${i}`);for(let i of f.warnings??[])e.out(`warning: ${i}`);if(f.composite){let i=f.composite.delivered+f.composite.omitted;e.out(`${f.source_id}: jira, ${i} attachments, ${f.composite.delivered} images delivered (${f.composite.omitted} omitted)`)}return{code:0,result:{status:f.status,source_id:f.source_id,source_cid:f.cid}}}catch(E){return E instanceof g?((e.err??e.out)(`error: ${t}: ${E.message}`),{code:1}):((e.err??e.out)(`error: ${t}: ${Ne(E instanceof Error?E.message:String(E))}`),{code:1})}}function Ne(t){let n=t.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`:t.startsWith("PROJECTION_TOO_LARGE:")?"the issue's text is too large to ingest \u2014 trim the description in Jira and retry":t}var ue={name:"jira",hint:"Jira issue URLs (https://<site>/browse/KEY-123)",match:t=>Y(t)!==null,ingest:Ce,sourceIdFor:t=>{let n=Y(t);return n?n.issueKey.toLowerCase():null}};async function le(t,n={}){let e=await N("/jira/document",{method:"POST",body:JSON.stringify({resource_id:t,format:"markdown"})},n);if(!e.ok)throw C(e,"the page");let r=P(e);if(r.type==="error"||!r.data)throw new g("JIRA_ISSUE_UNAVAILABLE",`could not fetch the page: ${$(r.message??"")||"page not found or not accessible"}`);return r.data}async function de(t,n={}){let e=await N("/jira/attachment",{method:"POST",body:JSON.stringify({source:"confluence",download:t})},n);if(!e.ok)throw C(e,"the page's attachment");return{bytes:D(e).bytes}}var W="kane.source.confluence/1";function me(t,n){if(typeof t.id!="string"||t.id==="")throw new Error("cannot build a stable identity for this page \u2014 the integrations service returned no page id");let e=[...t.labels??[]].filter(o=>typeof o=="string").sort(),r=[...t.attachments??[]].map(o=>({id:String(o.id),filename:o.filename??"",media_type:o.mime_type??"application/octet-stream",size:o.size??0})).sort((o,h)=>o.id<h.id?-1:o.id>h.id?1:0),d={schema:W,site:n,page:{id:t.id},space:{key:t.space?.key??""},title:t.title??"",labels:e,content:{body:t.body??""},attachments:r};return{bytes:Buffer.from(JSON.stringify(d),"utf8"),envelope:d,warnings:[]}}var pe=64,Oe=16,Pe=6e6,je=5e7,Ue=12e6,xe={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"},Be=new Set(["png","jpeg","webp"]);function fe(t){let n=new Map(Object.entries(t.downloads));return async e=>{let r;try{r=JSON.parse(e.toString("utf8"))}catch{throw new Error("CONFLUENCE_ENVELOPE_SCHEMA: source bytes are not a kane confluence envelope")}if(r.schema!==W)throw new Error(`CONFLUENCE_ENVELOPE_SCHEMA: unknown envelope schema "${r.schema}" \u2014 this CLI understands ${W}`);let d=[],o=new Map,h=[],E=0,s=new Map,u=[];for(let c=0;c<r.attachments.length;c++){let l=r.attachments[c],y=`i${c+1}`,R=`attachment:${l.filename}`,m=L=>`[img#${y}] ${l.filename} (${l.media_type}, ${l.size} bytes${L?"":" \u2014 not delivered"})`,p=(L,T,O)=>{d.push({ref:y,loc:R,media_type:L,...O?.blob?{blob:O.blob}:{},...O?.appearance?{appearance:O.appearance}:{},delivery:T,...O?.duplicate_of?{duplicate_of:O.duplicate_of}:{}})};if(!l.media_type.startsWith("image/")){p(l.media_type,"unsupported-vision-media-type"),u.push(m(!1));continue}let S=n.get(l.id);if(!S){p(l.media_type,"external-image-not-fetched"),u.push(m(!1));continue}let f;try{f=await t.fetchAttachment({id:l.id,download:S})}catch{p(l.media_type,"external-image-not-fetched"),u.push(m(!1));continue}let i=f.bytes,b=M(i),_=xe[b.format],A=j(i);if(o.set(A,i),!Be.has(b.format)){let L=b.format==="gif"||b.format==="bmp"||b.format==="tiff"?"unsupported-vision-media-type":"unsupported-image-kind";p(_,L,{blob:A}),u.push(m(!1));continue}if(b.width===void 0||b.height===void 0||b.width*b.height>je){p(_,"undecodable",{blob:A}),u.push(m(!1));continue}let v;if(b.format==="png"||b.format==="jpeg"){let L=J(i,b.format);if(L===null){p(_,"undecodable",{blob:A}),u.push(m(!1));continue}v=B(L.data,{width:L.width,height:L.height,channels:L.channels})}if(b.width<pe||b.height<pe){p(_,"below-dimension-floor",{blob:A,appearance:v}),u.push(m(!1));continue}let I=s.get(A);if(I!==void 0){p(_,"duplicate",{blob:A,appearance:v,duplicate_of:I}),u.push(m(!1));continue}if(i.byteLength>Pe){p(_,"image-too-large",{blob:A,appearance:v}),u.push(m(!1));continue}if(E+i.byteLength>Ue){p(_,"vision-byte-budget-reached",{blob:A,appearance:v}),u.push(m(!1));continue}if(h.length>=Oe){p(_,"image-cap-reached",{blob:A,appearance:v}),u.push(m(!1));continue}s.set(A,y),E+=i.byteLength,h.push(y),p(_,"selected",{blob:A,appearance:v}),u.push(m(!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
+ `)),u.length>0&&a.push("","--- attachments ---",...u),{projection:a.join(`
9
+ `)+`
10
+ `,inventory:d,blobs:o,delivered:h,converter:{name:"confluence-convert",version:"1",policy:"v1"}}}}var Me=/^[A-Za-z0-9~][A-Za-z0-9._~-]*$/;function X(t){if(!/^https?:\/\/.+/i.test(t))return null;let n;try{n=new URL(t)}catch{return null}let e=n.pathname.split("/").filter(Boolean),r=e.indexOf("wiki");if(r===-1||e[r+1]!=="spaces"||e[r+3]!=="pages")return null;let d=e[r+2],o=e[r+4];return d===void 0||o===void 0||!Me.test(d)||!/^\d+$/.test(o)?null:{site:n.hostname,spaceKey:d,pageId:o}}async function Je(t,n,e,r,d){let o=X(t);if(o===null)return(e.err??e.out)(`error: ${t}: unsupported remote URL \u2014 expected a Confluence page URL (https://<site>/wiki/spaces/<KEY>/pages/<id>/\u2026)`),{code:1};let h=d?.lis??{jiraInfo:k,jiraIssue:F,jiraAttachment:G,jiraComments:V},E=d?.confluence??{confluenceDocument:le,confluenceAttachment:de};try{let u={auth:await(d?.authEnv??(await import("./auth-HET3TBRI.js")).resolveLisAuthEnv)(),env:process.env},a=await h.jiraInfo(u);if(!a.installed)return(e.err??e.out)(`error: ${t}: no Atlassian connection for this account \u2014 create one at ${w} and retry`),{code:1};if(a.capabilities.document===!1)return(e.err??e.out)(`error: ${t}: the connection has no Confluence access \u2014 reconnect with Confluence at ${w} and retry`),{code:1};let c=await E.confluenceDocument(o.pageId,u),l=o.site;if(c.url)try{l=new URL(c.url).hostname}catch{}let{bytes:y,warnings:R}=me(c,l),m=n??`page-${o.pageId}`;U(m);let p=H(r,m);if(p!==null&&p!==l)return(e.err??e.out)(`error: ${t}: source '${m}' was ingested from ${p}, but this read serves ${l} \u2014 retire it first (kane-cli context retire ${m}) or ingest under a different id with --as`),{code:1};let S=Object.fromEntries((c.attachments??[]).filter(i=>typeof i.download=="string"&&i.download.length>0).map(i=>[String(i.id),i.download])),f=await x({contextDir:r,bytes:y,media:ne,sourceId:m,label:t,confirmSameSource:e.isTTY?i=>e.confirm(`identical content already ingested as ${i} \u2014 treat as the same source?`):void 0,converters:{confluence:fe({downloads:S,fetchAttachment:i=>E.confluenceAttachment(i.download,u)})}});e.out(z(e.isTTY,f,`${o.spaceKey}/${o.pageId}`));for(let i of R)e.out(`warning: ${i}`);for(let i of f.warnings??[])e.out(`warning: ${i}`);if(f.composite){let i=f.composite.delivered+f.composite.omitted;e.out(`${f.source_id}: confluence, ${i} attachments, ${f.composite.delivered} images delivered (${f.composite.omitted} omitted)`)}return{code:0,result:{status:f.status,source_id:f.source_id,source_cid:f.cid}}}catch(s){return s instanceof g?((e.err??e.out)(`error: ${t}: ${s.message}`),{code:1}):((e.err??e.out)(`error: ${t}: ${De(s instanceof Error?s.message:String(s))}`),{code:1})}}function De(t){let n=t.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`:t.startsWith("PROJECTION_TOO_LARGE:")?"the page's text is too large to ingest \u2014 trim the page in Confluence and retry":t}var ge={name:"confluence",hint:"Confluence page URLs (https://<site>/wiki/spaces/<KEY>/pages/<id>/\u2026)",match:t=>X(t)!==null,ingest:Je,sourceIdFor:t=>{let n=X(t);return n?`page-${n.pageId}`:null}};function z(t,n,e){return t?n.status==="created"?`landed ${n.source_id} (${e}) \u2014 new source`:n.status==="versioned"?`landed ${n.source_id} (${e}) \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 ke=[ue,ge];function xt(t){return/^https?:\/\/.+/i.test(t)}function Bt(t){return ke.find(n=>n.match(t))??null}export{z as a,ke as b,xt as c,Bt as d};
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as $}from"./chunk-3FN5VJMV.js";import{e as D}from"./chunk-UI7KULSI.js";import{a as E}from"./chunk-NLCCBXXV.js";function U(e){return["completed","failed","ended","stopped"].includes(e.trim().toLowerCase())}function je(e){return["ended","stopped"].includes(e.trim().toLowerCase())}function q(e){return{requestId:e.requestId,objective:e.objective,status:"",turnActive:!1,scenarios:[],thinking:"",thinkingLog:[],chatLog:[],progress:0}}function Re(e){return e.pendingClarification===void 0?e:{...e,pendingClarification:void 0}}function Ce(e){return{...e,turnActive:!0,error:void 0,thinking:"",thinkingLog:[]}}function P(e,t){switch(t.type){case"thinking":return{...e,status:"thinking",thinking:e.thinking+t.delta};case"thinking_done":return{...e,thinkingLog:[...e.thinkingLog,{text:e.thinking,tookMs:t.tookMs}],thinking:""};case"progress":return{...e,progress:t.pct};case"snapshot":return{...e,scenarios:t.data.scenarios,status:t.data.status,headline:t.data.headline??e.headline};case"chat":return{...e,turnActive:!1,chatLog:[...e.chatLog,{role:"model",text:t.text}]};case"clarification":return{...e,turnActive:!1,chatLog:[...e.chatLog,{role:"model",text:t.text}],pendingClarification:t.text};case"limit":return{...e,limits:{scenarioLimit:t.scenarioLimit,perScenarioLimit:t.perScenarioLimit}};case"error":return{...e,error:t.message};case"done":return{...e,status:t.status,turnActive:!1,error:t.status==="failed"&&!e.error?"generation failed":e.error}}}function H(e,t){let n=[],i=e.type??"",d=e.status??"";if(i==="ping")return n;switch(i){case"thinking_token":typeof e.data=="string"&&n.push({type:"thinking",delta:e.data});break;case"thinking_stopped":{let r=e.data??{},o=se(r.time_taken);n.push({type:"thinking_done",text:typeof e.data=="string"?e.data:r.message??"",tookMs:o});break}case"progress":{let r=e.data??{};typeof r.progress=="number"&&n.push({type:"progress",pct:r.progress});break}case"clarification":{let r=e.data??{};typeof r.message=="string"&&n.push({type:"clarification",text:r.message});break}case"chatting_stopped":{let r=e.data??{};typeof r.message=="string"&&r.message.length>0&&n.push({type:"chat",text:r.message});break}case"limit_update":{let r=e.data??{},o=r.test_cases_limit??e.test_cases_limit,p=r.per_scenario_test_cases_limit??e.per_scenario_test_cases_limit;n.push({type:"limit",scenarioLimit:o,perScenarioLimit:p});break}case"error":{let r=typeof e.data=="string"?e.data:e.data?.message??"generation error";n.push({type:"error",message:r});break}case"request_cancelled":return n.push({type:"done",status:"stopped"}),n;case"session_ended":return n.push({type:"done",status:"ended"}),n;default:break}if(Array.isArray(e.scenarios)&&n.push({type:"snapshot",data:{requestId:t,status:d,headline:e.headline,scenarios:e.scenarios}}),d&&U(d)){let r=d.trim().toLowerCase();n.push({type:"done",status:r})}return n}function se(e){if(!e)return;let t=/^([\d.]+)(ms|s)?$/.exec(e.trim());if(!t)return;let n=Number(t[1]);if(Number.isFinite(n))return t[2]==="ms"?Math.round(n):Math.round(n*1e3)}var v=class extends Error{constructor(t){super(t),this.name="AuthError"}},M=class extends Error{constructor(t){super(t),this.name="ForbiddenError"}},I=class extends Error{constructor(t){super(t),this.name="InsufficientCreditsError"}},k=class extends Error{constructor(n,i){super(n);this.cause=i;this.name="TransportError"}};function x(e,t){let n=t?.message??t?.error??`HTTP ${e}`;return e===401?new v(n):e===403?t?.key==="insufficient_credits"?new I(n):new M(n):new k(n)}async function*J(e){let t=e.fetchImpl??fetch,n=e.maxRetries??5,i=e.maxBackoffMs??3e4,d=e.connectTimeoutMs??1e4,r=0,o=!1;for(;;){if(e.signal.aborted)return;let p=new AbortController,a=()=>p.abort();e.signal.addEventListener("abort",a,{once:!0});let c=setTimeout(()=>p.abort(),d),g;try{g=await t(e.url,{method:"GET",headers:{Authorization:await e.authHeader(),Accept:"text/event-stream"},signal:p.signal})}catch(w){if(clearTimeout(c),e.signal.removeEventListener("abort",a),e.signal.aborted)return;if(++r>n)throw new k("SSE connect failed",w);await O(F(r,i));continue}if(clearTimeout(c),!g.ok){e.signal.removeEventListener("abort",a);let w=await oe(g);if(g.status===401&&o){if(++r>n)throw x(401,w);await O(F(r,i));continue}throw x(g.status,w)}if(!g.body)throw e.signal.removeEventListener("abort",a),new k("SSE response had no body");o=!0,r=0;let m=g.body.getReader(),h=new TextDecoder("utf-8"),b="";try{for(;;){if(e.signal.aborted){await m.cancel().catch(()=>{});return}let{done:w,value:s}=await m.read();if(w)break;b+=h.decode(s,{stream:!0});let f;for(;(f=b.indexOf(`
2
+ import{a as $}from"./chunk-HMYMSRA4.js";import{f as D}from"./chunk-GZPK6FRP.js";import{a as E}from"./chunk-NLCCBXXV.js";function U(e){return["completed","failed","ended","stopped"].includes(e.trim().toLowerCase())}function je(e){return["ended","stopped"].includes(e.trim().toLowerCase())}function q(e){return{requestId:e.requestId,objective:e.objective,status:"",turnActive:!1,scenarios:[],thinking:"",thinkingLog:[],chatLog:[],progress:0}}function Re(e){return e.pendingClarification===void 0?e:{...e,pendingClarification:void 0}}function Ce(e){return{...e,turnActive:!0,error:void 0,thinking:"",thinkingLog:[]}}function P(e,t){switch(t.type){case"thinking":return{...e,status:"thinking",thinking:e.thinking+t.delta};case"thinking_done":return{...e,thinkingLog:[...e.thinkingLog,{text:e.thinking,tookMs:t.tookMs}],thinking:""};case"progress":return{...e,progress:t.pct};case"snapshot":return{...e,scenarios:t.data.scenarios,status:t.data.status,headline:t.data.headline??e.headline};case"chat":return{...e,turnActive:!1,chatLog:[...e.chatLog,{role:"model",text:t.text}]};case"clarification":return{...e,turnActive:!1,chatLog:[...e.chatLog,{role:"model",text:t.text}],pendingClarification:t.text};case"limit":return{...e,limits:{scenarioLimit:t.scenarioLimit,perScenarioLimit:t.perScenarioLimit}};case"error":return{...e,error:t.message};case"done":return{...e,status:t.status,turnActive:!1,error:t.status==="failed"&&!e.error?"generation failed":e.error}}}function H(e,t){let n=[],i=e.type??"",d=e.status??"";if(i==="ping")return n;switch(i){case"thinking_token":typeof e.data=="string"&&n.push({type:"thinking",delta:e.data});break;case"thinking_stopped":{let r=e.data??{},o=se(r.time_taken);n.push({type:"thinking_done",text:typeof e.data=="string"?e.data:r.message??"",tookMs:o});break}case"progress":{let r=e.data??{};typeof r.progress=="number"&&n.push({type:"progress",pct:r.progress});break}case"clarification":{let r=e.data??{};typeof r.message=="string"&&n.push({type:"clarification",text:r.message});break}case"chatting_stopped":{let r=e.data??{};typeof r.message=="string"&&r.message.length>0&&n.push({type:"chat",text:r.message});break}case"limit_update":{let r=e.data??{},o=r.test_cases_limit??e.test_cases_limit,p=r.per_scenario_test_cases_limit??e.per_scenario_test_cases_limit;n.push({type:"limit",scenarioLimit:o,perScenarioLimit:p});break}case"error":{let r=typeof e.data=="string"?e.data:e.data?.message??"generation error";n.push({type:"error",message:r});break}case"request_cancelled":return n.push({type:"done",status:"stopped"}),n;case"session_ended":return n.push({type:"done",status:"ended"}),n;default:break}if(Array.isArray(e.scenarios)&&n.push({type:"snapshot",data:{requestId:t,status:d,headline:e.headline,scenarios:e.scenarios}}),d&&U(d)){let r=d.trim().toLowerCase();n.push({type:"done",status:r})}return n}function se(e){if(!e)return;let t=/^([\d.]+)(ms|s)?$/.exec(e.trim());if(!t)return;let n=Number(t[1]);if(Number.isFinite(n))return t[2]==="ms"?Math.round(n):Math.round(n*1e3)}var v=class extends Error{constructor(t){super(t),this.name="AuthError"}},M=class extends Error{constructor(t){super(t),this.name="ForbiddenError"}},I=class extends Error{constructor(t){super(t),this.name="InsufficientCreditsError"}},k=class extends Error{constructor(n,i){super(n);this.cause=i;this.name="TransportError"}};function x(e,t){let n=t?.message??t?.error??`HTTP ${e}`;return e===401?new v(n):e===403?t?.key==="insufficient_credits"?new I(n):new M(n):new k(n)}async function*J(e){let t=e.fetchImpl??fetch,n=e.maxRetries??5,i=e.maxBackoffMs??3e4,d=e.connectTimeoutMs??1e4,r=0,o=!1;for(;;){if(e.signal.aborted)return;let p=new AbortController,a=()=>p.abort();e.signal.addEventListener("abort",a,{once:!0});let c=setTimeout(()=>p.abort(),d),g;try{g=await t(e.url,{method:"GET",headers:{Authorization:await e.authHeader(),Accept:"text/event-stream"},signal:p.signal})}catch(w){if(clearTimeout(c),e.signal.removeEventListener("abort",a),e.signal.aborted)return;if(++r>n)throw new k("SSE connect failed",w);await O(F(r,i));continue}if(clearTimeout(c),!g.ok){e.signal.removeEventListener("abort",a);let w=await oe(g);if(g.status===401&&o){if(++r>n)throw x(401,w);await O(F(r,i));continue}throw x(g.status,w)}if(!g.body)throw e.signal.removeEventListener("abort",a),new k("SSE response had no body");o=!0,r=0;let m=g.body.getReader(),h=new TextDecoder("utf-8"),b="";try{for(;;){if(e.signal.aborted){await m.cancel().catch(()=>{});return}let{done:w,value:s}=await m.read();if(w)break;b+=h.decode(s,{stream:!0});let f;for(;(f=b.indexOf(`
3
3
 
4
4
  `))>=0;){let u=b.slice(0,f);b=b.slice(f+2);let l=ie(u);l&&(yield l)}}}catch(w){if(e.signal.aborted)return;if(++r>n)throw new k("SSE stream dropped",w);await O(F(r,i));continue}finally{e.signal.removeEventListener("abort",a)}return}}function ie(e){let t="message",n="";for(let i of e.split(`
5
5
  `))i.startsWith("event:")?t=i.slice(6).trim():i.startsWith("data:")&&(n+=i.slice(5).trim());if(t!=="message"||!n)return null;try{let i=Buffer.from(n,"base64").toString("utf-8");return JSON.parse(i)}catch{return null}}function F(e,t){return Math.min(t,1e3*2**(e-1))}function O(e){return new Promise(t=>setTimeout(t,e))}async function oe(e){try{return await e.clone().json()}catch{return}}function W(e,t){t?.length&&(e.append("files",t.map(n=>n.fileKey).join(",")),e.append("gemini_metadata",JSON.stringify(t.map(n=>({fileData:{fileUri:n.geminiUri,mimeType:n.mimeType}})))))}function Ue(e,t={}){let n=t.fetchImpl??fetch,i=new Map,d=!0;async function r(){let s=await e.authResolver.resolve();if(!s)throw new v("unauthorized; run `kane-cli login`");return E(s.username,s.access_key)}function o(s){return`${e.baseUrl}${s}`}async function p(s){if(!s.ok){let f;try{f=await s.clone().json()}catch{f=void 0}throw x(s.status,f)}return s.json()}function a(s){let f=s?.data??s;return{request_id:f.request_id??f.id,status:f.status??""}}function c(s,f,u,l){let y=q({requestId:s,objective:f});l&&(y=P(y,{type:"snapshot",data:l}),l.status==="cleaned_up"&&(y={...y,error:"session was reaped (cleaned_up) \u2014 continuing will destructively regenerate"}));let S=new AbortController;u&&(u.aborted?S.abort():u.addEventListener("abort",()=>S.abort(),{once:!0})),i.set(s,S);let A={requestId:s,state:y,events:void 0};return A.events=(async function*(){try{let C=J({url:o(`/requests/${s}/sse`),authHeader:r,signal:S.signal,log:e.log,fetchImpl:n});for await(let L of C)for(let z of H(L,s))A.state=P(A.state,z),yield z}finally{i.delete(s)}})(),A}async function g(s,f){let u=new FormData;u.append("prompt",s.prompt),d=s.memoryEnhancement??!0,u.append("memory_enhancement",String(d)),s.scenarioLimit!==void 0&&u.append("test_scenario_limit",String(s.scenarioLimit)),s.perScenarioLimit!==void 0&&u.append("per_scenario_test_cases_limit",String(s.perScenarioLimit));let l=s.projectId??e.projectId,y=s.folderId??e.folderId;l&&u.append("project_id",l),y&&u.append("folder_id",y),W(u,s.attachments);let S=await n(o("/requests"),{method:"POST",headers:{Authorization:await r()},body:u}),A=await p(S),{request_id:C}=a(A),L=String(C);return c(L,s.prompt,f)}async function m(s,f){let u=await n(o(`/requests/${s}`),{method:"GET",headers:{Authorization:await r()}}),l=await p(u),y=l?.data??l,S={requestId:s,status:y.status??"",headline:y.headline,scenarios:Array.isArray(y.scenarios)?y.scenarios:[]};return c(s,"",f,S)}async function h(s,f,u){let l=new FormData;l.append("prompt",f),l.append("chat_enabled","true"),l.append("memory_enhancement",String(d)),u?.mappings&&l.append("mappings",JSON.stringify(u.mappings)),W(l,u?.attachments);let y=await n(o(`/requests/${s}`),{method:"PUT",headers:{Authorization:await r()},body:l});if(!y.ok){let S;try{S=await y.clone().json()}catch{}throw x(y.status,S)}}async function b(s){i.get(s)?.abort();let u=await n(o(`/requests/${s}/stop`),{method:"DELETE",headers:{Authorization:await r()}});if(!u.ok&&u.status!==404){let l;try{l=await u.clone().json()}catch{}throw x(u.status,l)}}async function w(s){i.get(s)?.abort();let u=await n(o(`/requests/${s}/end`),{method:"DELETE",headers:{Authorization:await r()}});if(!u.ok&&u.status!==404){let l;try{l=await u.clone().json()}catch{}throw x(u.status,l)}}return{start:g,attach:m,chat:h,cancel:b,end:w}}import{statSync as ae,realpathSync as G,existsSync as ce}from"fs";import{extname as ue,resolve as j,isAbsolute as pe}from"path";import{homedir as V}from"os";var de=new Set([".txt",".md",".json",".xml",".jpg",".jpeg",".png",".gif",".bmp",".webp",".pdf",".docx",".csv",".xlsx",".mp3",".wav",".m4a",".webm",".mpeg",".mpga",".mp4",".mov"]),le=50*1024*1024,X=10;function fe(e){return e==="~"?V():e.startsWith("~/")?j(V(),e.slice(2)):e}function Ge(e,t){let n=[],i=[],d=new Set,r=[],o=(()=>{try{return G(j(t))}catch{return j(t)}})(),p=o.endsWith("/")?o:o+"/";for(let a of e){let c=fe(a),g=pe(c)?c:j(t,c);if(!ce(g)){n.push(`Not found: ${a}`);continue}let m;try{m=G(g)}catch{n.push(`Cannot resolve: ${a}`);continue}if(d.has(m))continue;let h;try{h=ae(m)}catch{n.push(`Cannot read: ${a}`);continue}if(!h.isFile()){n.push(`Not a file: ${a}`);continue}if(h.size===0){n.push(`Empty file: ${a}`);continue}let b=ue(m).toLowerCase();if(!de.has(b)){n.push(`Unsupported type ${b||"(none)"}: ${a}`);continue}if(h.size>le){n.push(`Too large (>50MB): ${a}`);continue}m!==o&&!m.startsWith(p)&&i.push(`Outside working dir: ${a}`),d.add(m),r.push(m)}return r.length>X&&n.push(`Too many files: ${r.length} (max ${X})`),{ok:n.length?[]:r,errors:n,warnings:i}}var B=class extends Error{constructor(n){super(n.join("; "));this.errors=n;this.name="AttachmentValidationError"}};async function Xe(e){let{promptText:t,filePaths:n,cwd:i,scenarios:d,isRefine:r,conn:o,deps:p}=e,{ok:a,errors:c,warnings:g}=p.validate(n,i);if(c.length)throw new B(c);e.onValidated?.();let m=a.length?await p.upload(o,a,p.onUpload):[],h=r?p.buildMappings(t,d):void 0;return{promptText:t,mappings:h,attachments:m,warnings:g}}import{readFile as me}from"fs/promises";import{basename as K}from"path";async function ge(e){let t=await e.authResolver.resolve();if(!t)throw new v("unauthorized; run `kane-cli login`");return E(t.username,t.access_key)}async function he(e,t,n={}){let i=n.fetchImpl??fetch,d=await me(t),r=K(t),o=new FormData;o.append("file",new Blob([d]),r),o.append("source","omniBox"),o.append("geminiFileUpload","true");let p=await i(`${e.tmsBaseUrl}/v1/attachment`,{method:"POST",headers:{Authorization:await ge(e)},body:o,signal:n.signal});if(!p.ok){let h;try{h=await p.clone().json()}catch{}throw x(p.status,h)}let a=await p.json(),c=a?.data??a,g=c?.gemini_response?.uri,m=c?.gemini_response?.mimeType;if(!c?.file_key||!g){let h=c&&typeof c=="object"?Object.keys(c).join(","):typeof c,b=(()=>{try{return JSON.stringify(c).slice(0,500)}catch{return"<unserializable>"}})();throw new Error(`attachment upload for ${r} returned no file_key/gemini uri \u2014 status ${p.status}, body keys: [${h}], raw: ${b}`)}return{fileName:c.file_name??r,fileKey:c.file_key,geminiUri:g,mimeType:m??"application/octet-stream"}}async function tt(e,t,n,i={}){let d=[];for(let r=0;r<t.length;r++){if(i.signal?.aborted)throw Object.assign(new Error("upload aborted"),{name:"AbortError"});let o=K(t[r]);n?.({file:o,index:r+1,total:t.length,status:"uploading"});try{d.push(await he(e,t[r],i)),n?.({file:o,index:r+1,total:t.length,status:"done"})}catch(p){throw n?.({file:o,index:r+1,total:t.length,status:"failed"}),p}}return d}var ye=/@([sS])(\d+)\.([cC])(\d+)/g,be=/@([sS])(\d+)(?!\d)(?!\.[cC]\d)/g;function rt(e,t){let n={},i={};for(let d of e.matchAll(ye)){let r=Number(d[2]),o=Number(d[4]),p=t[r-1];if(!p)continue;n[`s${r}`]=String(p.id);let a=p.test_cases??[];if(a[o-1])for(let c=0;c<o;c++){let g=a[c];g&&(i[`s${r}.c${c+1}`]=String(g.id))}}for(let d of e.matchAll(be)){let r=Number(d[2]),o=t[r-1];o&&(n[`s${r}`]=String(o.id))}if(!(Object.keys(n).length===0&&Object.keys(i).length===0))return{scenario:n,testcase:i}}function R(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(n==null||typeof n!="object")return[];let i=n;if(typeof i.step!="string")return[];let d=typeof i.expected_result=="string"?i.expected_result:typeof i.outcome=="string"?i.outcome:"";t.push({step:i.step,expected:d})}return t}var we=30,Se=300;function Z(){return{mode:"testing",max_steps:we,timeout:Se,variables:{}}}function Q(e){return e.title??`Test case ${e.id}`}function ct(e,t){return $({frontmatter:Z(),heading:Q(t),steps:e.sub_objectives.map(n=>n.objective)})}function Y(e){let t=R(e.manual_steps).map(n=>n.step);return $({frontmatter:Z(),heading:Q(e),steps:t})}import{mkdtempSync as xe,mkdirSync as N,writeFileSync as ee,rmSync as te,renameSync as _e,existsSync as ne,readFileSync as ve}from"fs";import{join as _,resolve as ke}from"path";async function ft(e,t,n,i=Y){(n.redirectBareCwd??!0)&&ke(t)===process.cwd()&&(t=_(t,".testmuai","tests"));let d=T(e.objective)??e.headline,r=T(n.suiteName)??`${T(re(d,4))??"tcg"}-${e.requestId}`,o=r,p=_(t,r);ne(p)&&!Te(p,e.requestId)&&(o=`${r}-${e.requestId}`);let a=_(t,o),c=[],g=new Map;for(let h of e.scenarios){let b=(h.test_cases??[]).filter(Ae);if(b.length===0)continue;let w=T(Ee(h.scode))??T(h.sid)??`s${h.id}`,s=g.get(w)??new Set;g.set(w,s);for(let f of b){let u=T(re(f.title,5))??"case",l=`${u}_test.md`;for(let y=2;s.has(l);y++)l=`${u}-${y}_test.md`;s.add(l),c.push({dir:w,file:l,tc:f})}}if(c.length===0)return{suiteDir:a,paths:[],warning:"no functional test cases generated"};N(t,{recursive:!0});let m=xe(_(t,".tcg-tmp-"));try{N(_(m,"helpers"),{recursive:!0}),ee(_(m,".tcg-suite.json"),JSON.stringify({requestId:e.requestId,suiteName:o}));let h=[],b=new Set;for(let s of c){let f=_(m,s.dir);b.has(f)||(N(f,{recursive:!0}),b.add(f));let u=_(f,s.file);ee(u,i(s.tc)),h.push(u)}ne(a)&&te(a,{recursive:!0,force:!0}),_e(m,a);let w=h.map(s=>s.replace(m,a));return{suiteDir:a,paths:w}}catch(h){try{te(m,{recursive:!0,force:!0})}catch{}throw h}}function Ae(e){return(e.category??"").trim().toLowerCase()==="functional"}function Te(e,t){try{return JSON.parse(ve(_(e,".tcg-suite.json"),"utf-8"))?.requestId===t}catch{return!1}}function T(e){return e&&e.length>0?e:void 0}function re(e,t){return e?e.toLowerCase().replace(/[^a-z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).slice(0,t).join("-"):""}function Ee(e){return e?e.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,""):""}function ht(e){let t=[];e.title&&t.push(e.title),e.description&&t.push("",e.description);let n=R(e.manual_steps);return n.length>0&&(t.push("","Steps:"),n.forEach((i,d)=>{t.push(`${d+1}. ${i.step}`)})),t.join(`
6
- `).trim()}function wt(e){return{mode:"bifurcate",objective:e.objective,model:e.model,session_id:e.sessionId,run_index:0,width:0,height:0,variables:e.variables,...e.auth}}async function St(e,t,n){let i=D(e,t),d=()=>i.cancel();n?.addEventListener("abort",d);let r=null,o=null;try{for await(let p of i.events)if(p.type==="bifurcation_result"){let a=p,c=(a.sub_objectives??[]).map((g,m)=>({...g,sequence_index:m}));r={sub_objectives:c,extracted_variables:a.extracted_variables??{},total_flows:c.length,is_single_flow:c.length<=1,credits_consumed:a.credits_consumed??0}}else p.type==="error"&&(o=p.message??"bifurcation error")}finally{n?.removeEventListener("abort",d),i.cancel()}if(r)return r;throw new Error(o??"bifurcation produced no result")}export{U as a,je as b,q as c,Re as d,Ce as e,P as f,v as g,Ue as h,R as i,ct as j,Y as k,ft as l,Ae as m,ht as n,wt as o,St as p,de as q,Ge as r,B as s,Xe as t,tt as u,rt as v};
6
+ `).trim()}function wt(e){return{mode:"bifurcate",objective:e.objective,model:e.model,session_id:e.sessionId,run_index:0,width:0,height:0,variables:e.variables,...e.auth}}async function St(e,t,n){let i=await D(e,t),d=()=>i.cancel();n?.addEventListener("abort",d);let r=null,o=null;try{for await(let p of i.events)if(p.type==="bifurcation_result"){let a=p,c=(a.sub_objectives??[]).map((g,m)=>({...g,sequence_index:m}));r={sub_objectives:c,extracted_variables:a.extracted_variables??{},total_flows:c.length,is_single_flow:c.length<=1,credits_consumed:a.credits_consumed??0}}else p.type==="error"&&(o=p.message??"bifurcation error")}finally{n?.removeEventListener("abort",d),i.cancel()}if(r)return r;throw new Error(o??"bifurcation produced no result")}export{U as a,je as b,q as c,Re as d,Ce as e,P as f,v as g,Ue as h,R as i,ct as j,Y as k,ft as l,Ae as m,ht as n,wt as o,St as p,de as q,Ge as r,B as s,Xe as t,tt as u,rt as v};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{d as c}from"./chunk-M7WQM4UA.js";import{d as l}from"./chunk-5YPBPZUR.js";function h(f,o,u){let n=o.resolve(u);if(!n)return{target:null,entries:[]};let t=new Set([n.cid]),r=n.cid;for(;o.superseded.has(r);){let s=o.superseded.get(r);if(typeof s!="string"||t.has(s))break;t.add(s),r=s}let d=o.nodeLabel.get(n.cid)??"(unknown)",{records:p}=c(f),i=[];for(let s of p){for(let e of s.nodes)t.has(e.cid)&&i.push({seq:s.seq,ts:s.ts,kind:"minted",detail:`minted ${e.label} ${e.cid}`});for(let e of s.judgements??[])t.has(e.about)&&i.push({seq:s.seq,ts:s.ts,kind:"judgement",rationale:e.rationale,detail:`judgement on ${e.about}`,by:e.by});for(let e of s.review)t.has(e.id)&&i.push({seq:s.seq,ts:s.ts,kind:"review",detail:`${e.resolution}${e.reason?` \u2014 ${e.reason}`:""}`,by:e.by});for(let e of s.supersessions)e.kind==="node"&&(t.has(e.old)||e.new!==null&&t.has(e.new))&&i.push({seq:s.seq,ts:s.ts,kind:"supersession",detail:`${e.old} \u2192 ${String(e.new)} \u2014 ${e.reason}`,by:e.by});for(let e of s.names??[])t.has(e.cid)&&i.push({seq:s.seq,ts:s.ts,kind:"name",detail:`named ${e.slug}`,by:e.by});if(d===l.SOURCE)for(let[e,a]of Object.entries(s.source_head_moves))(t.has(a??"")||o.heads.get(e)!==void 0&&t.has(n.cid)&&e===o.getNode(n.cid)?.content?.source_id)&&i.push({seq:s.seq,ts:s.ts,kind:"head_move",detail:`${e} head \u2192 ${String(a)}`})}return i.sort((s,e)=>e.seq-s.seq),{target:{cid:n.cid,tip:n.tip,label:d,slug:o.nameOf.get(n.cid)},entries:i}}export{h as a};
2
+ import{d as c}from"./chunk-DUAXZYAD.js";import{d as l}from"./chunk-WXHQYYD5.js";function h(f,o,u){let n=o.resolve(u);if(!n)return{target:null,entries:[]};let t=new Set([n.cid]),r=n.cid;for(;o.superseded.has(r);){let s=o.superseded.get(r);if(typeof s!="string"||t.has(s))break;t.add(s),r=s}let d=o.nodeLabel.get(n.cid)??"(unknown)",{records:p}=c(f),i=[];for(let s of p){for(let e of s.nodes)t.has(e.cid)&&i.push({seq:s.seq,ts:s.ts,kind:"minted",detail:`minted ${e.label} ${e.cid}`});for(let e of s.judgements??[])t.has(e.about)&&i.push({seq:s.seq,ts:s.ts,kind:"judgement",rationale:e.rationale,detail:`judgement on ${e.about}`,by:e.by});for(let e of s.review)t.has(e.id)&&i.push({seq:s.seq,ts:s.ts,kind:"review",detail:`${e.resolution}${e.reason?` \u2014 ${e.reason}`:""}`,by:e.by});for(let e of s.supersessions)e.kind==="node"&&(t.has(e.old)||e.new!==null&&t.has(e.new))&&i.push({seq:s.seq,ts:s.ts,kind:"supersession",detail:`${e.old} \u2192 ${String(e.new)} \u2014 ${e.reason}`,by:e.by});for(let e of s.names??[])t.has(e.cid)&&i.push({seq:s.seq,ts:s.ts,kind:"name",detail:`named ${e.slug}`,by:e.by});if(d===l.SOURCE)for(let[e,a]of Object.entries(s.source_head_moves))(t.has(a??"")||o.heads.get(e)!==void 0&&t.has(n.cid)&&e===o.getNode(n.cid)?.content?.source_id)&&i.push({seq:s.seq,ts:s.ts,kind:"head_move",detail:`${e} head \u2192 ${String(a)}`})}return i.sort((s,e)=>e.seq-s.seq),{target:{cid:n.cid,tip:n.tip,label:d,slug:o.nameOf.get(n.cid)},entries:i}}export{h as a};