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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/dist/{ChatSurface-VPD5G67Q.js → ChatSurface-6NZGMNHL.js} +1 -1
  2. package/dist/{ChromeProfilePicker-CRKQEFYD.js → ChromeProfilePicker-M4WXOB5O.js} +1 -1
  3. package/dist/{CliFeedbackPrompt-M7BMWLKK.js → CliFeedbackPrompt-6MJA7DF6.js} +1 -1
  4. package/dist/{CliUploadProgress-OP7DXMC2.js → CliUploadProgress-6NLS7XHH.js} +1 -1
  5. package/dist/{ConfigView-XI74BCCH.js → ConfigView-O4WKZ5PU.js} +1 -1
  6. package/dist/{EvidenceViewOffer-HAAK6DS5.js → EvidenceViewOffer-WIEWCZUP.js} +1 -1
  7. package/dist/FolderPicker-AF7ZMV3M.js +2 -0
  8. package/dist/InfoBox-D7GGZJU4.js +2 -0
  9. package/dist/{LinksBox-PNSESNCU.js → LinksBox-DXP66H3H.js} +1 -1
  10. package/dist/{ProfilesView-PYDZZHKO.js → ProfilesView-TWOY5PVC.js} +1 -1
  11. package/dist/ProjectPicker-OBYHJJLU.js +2 -0
  12. package/dist/SaveSessionPrompt-7XSHS4NL.js +2 -0
  13. package/dist/SingleShotApp-XQUDR36R.js +2 -0
  14. package/dist/{SummaryBox-FALOODAQ.js → SummaryBox-IA2KS6GT.js} +1 -1
  15. package/dist/TestMdRunView-LS2QUFWR.js +2 -0
  16. package/dist/TestrunEvidenceTable-HNDVJDIF.js +2 -0
  17. package/dist/{WhoamiView-6WXGRANY.js → WhoamiView-SNL75TEF.js} +1 -1
  18. package/dist/{app-download-RXVZB6MM.js → app-download-UI4ABEIX.js} +1 -1
  19. package/dist/{assurance-job-C3TXZGLL.js → assurance-job-FFSSS4XV.js} +1 -1
  20. package/dist/{binary-DJCDMGPX.js → binary-THPLXCOD.js} +1 -1
  21. package/dist/{bind-XVO4CQYV.js → bind-4XWK3DG2.js} +1 -1
  22. package/dist/{bootstrap-TY5RANJ7.js → bootstrap-6ACT4ALI.js} +1 -1
  23. package/dist/{catalog-RRQF4TCA.js → catalog-MYPS2BXY.js} +1 -1
  24. package/dist/{changelog-GBEVIUFJ.js → changelog-SU674BVE.js} +1 -1
  25. package/dist/{chunk-AA674WLL.js → chunk-2DYHAP4E.js} +1 -1
  26. package/dist/{chunk-VG44B5JD.js → chunk-36N3EHW5.js} +1 -1
  27. package/dist/{chunk-P7MSVLAH.js → chunk-3E4ZO73O.js} +1 -1
  28. package/dist/{chunk-NWD54VV5.js → chunk-3F5FMH76.js} +1 -1
  29. package/dist/{chunk-I5NSJBOZ.js → chunk-3OQW2GTA.js} +1 -1
  30. package/dist/{chunk-LRS5MGBY.js → chunk-3RJHXOZH.js} +1 -1
  31. package/dist/{chunk-DDJNYQBH.js → chunk-3YTCKCBG.js} +1 -1
  32. package/dist/{chunk-252FWF2G.js → chunk-457Y5TEC.js} +1 -1
  33. package/dist/{chunk-DD5TULWQ.js → chunk-4QFTHUJA.js} +1 -1
  34. package/dist/{chunk-672CQECV.js → chunk-4YW767UV.js} +7 -7
  35. package/dist/{chunk-7LKCWO2R.js → chunk-5AKJPYUW.js} +3 -3
  36. package/dist/{chunk-VQLH63X7.js → chunk-6DZX5HLZ.js} +1 -1
  37. package/dist/{chunk-QHRUBG7J.js → chunk-6EB5VRAN.js} +1 -1
  38. package/dist/{chunk-QS5ZJFGF.js → chunk-734ORT6O.js} +1 -1
  39. package/dist/{chunk-57MDWTON.js → chunk-7AET4JKQ.js} +1 -1
  40. package/dist/{chunk-W3OVSDBN.js → chunk-7HMSMAUG.js} +1 -1
  41. package/dist/{chunk-FFL55I2M.js → chunk-7NPTL66J.js} +1 -1
  42. package/dist/{chunk-T7H4LBFK.js → chunk-7SY34IIL.js} +1 -1
  43. package/dist/{chunk-RFIIM33J.js → chunk-7YT4TTKL.js} +1 -1
  44. package/dist/{chunk-CPBBYNL7.js → chunk-ACMBMZDQ.js} +1 -1
  45. package/dist/{chunk-UALJTPSA.js → chunk-AEWNWAXW.js} +1 -1
  46. package/dist/{chunk-V7S6S5W3.js → chunk-AVSMXDTX.js} +1 -1
  47. package/dist/{chunk-MGNRNLBE.js → chunk-C2RUDJ46.js} +1 -1
  48. package/dist/{chunk-QQ4TKLWP.js → chunk-C62QWG4B.js} +1 -1
  49. package/dist/{chunk-OEWYXCTA.js → chunk-CCP4X75B.js} +1 -1
  50. package/dist/{chunk-LRXBJTD4.js → chunk-CGITGJ3I.js} +1 -1
  51. package/dist/{chunk-QCKA665H.js → chunk-CM4CHYSN.js} +1 -1
  52. package/dist/{chunk-2OOFURWD.js → chunk-CUXY6KQ2.js} +1 -1
  53. package/dist/{chunk-I6OQISK4.js → chunk-D36V5OX6.js} +1 -1
  54. package/dist/{chunk-LNNWCBPQ.js → chunk-D7TKE7LK.js} +1 -1
  55. package/dist/{chunk-2IZRPMZN.js → chunk-D7U2M26S.js} +1 -1
  56. package/dist/{chunk-SONMD3W5.js → chunk-DDZLCAEO.js} +1 -1
  57. package/dist/{chunk-NWBLYMH7.js → chunk-DJC7NTLA.js} +1 -1
  58. package/dist/{chunk-TW63WWEN.js → chunk-DZOYYWOW.js} +1 -1
  59. package/dist/{chunk-UAWWLLTI.js → chunk-EBPRPNSA.js} +1 -1
  60. package/dist/{chunk-T3HEJASG.js → chunk-ECPFI75W.js} +1 -1
  61. package/dist/{chunk-JQSLUGD4.js → chunk-EECDDDSB.js} +1 -1
  62. package/dist/{chunk-7EXDYXXD.js → chunk-ETZMFRD6.js} +1 -1
  63. package/dist/{chunk-5BUIIFLC.js → chunk-F22K3RRX.js} +1 -1
  64. package/dist/{chunk-BJJUKB5K.js → chunk-F5NHG7VB.js} +1 -1
  65. package/dist/{chunk-B2HXPGIZ.js → chunk-FWDUVFS6.js} +3 -3
  66. package/dist/{chunk-T4AVLJCW.js → chunk-FWUPJORV.js} +1 -1
  67. package/dist/{chunk-VYHT2IET.js → chunk-GQRU3B54.js} +1 -1
  68. package/dist/{chunk-AIXJYMSP.js → chunk-GXKY5A46.js} +1 -1
  69. package/dist/{chunk-QTZBVDPR.js → chunk-HCJ2N3XB.js} +1 -1
  70. package/dist/{chunk-XBEYWXPV.js → chunk-HJMCXSUJ.js} +1 -1
  71. package/dist/{chunk-ZZP5SHUV.js → chunk-HK62JVQM.js} +1 -1
  72. package/dist/{chunk-3UVSAAES.js → chunk-I4RVVBG3.js} +1 -1
  73. package/dist/{chunk-JPYW6U4D.js → chunk-I4WXALQR.js} +1 -1
  74. package/dist/{chunk-OVNRRI4E.js → chunk-ICLUC44J.js} +1 -1
  75. package/dist/{chunk-DHQ4SQWA.js → chunk-IGEAET7M.js} +1 -1
  76. package/dist/{chunk-IXW7FOGX.js → chunk-IJ2AHSWW.js} +1 -1
  77. package/dist/{chunk-2S3W2JT3.js → chunk-IUQOG7Z5.js} +1 -1
  78. package/dist/{chunk-IBBD36FQ.js → chunk-JZP3Y4ZM.js} +1 -1
  79. package/dist/{chunk-NDEI7R4K.js → chunk-KODJVOCN.js} +1 -1
  80. package/dist/{chunk-IMDMRJQ6.js → chunk-KXHJMAZU.js} +1 -1
  81. package/dist/{chunk-OQ5G773E.js → chunk-L5DALV5N.js} +1 -1
  82. package/dist/{chunk-S53AQU7R.js → chunk-LAOTVZHV.js} +1 -1
  83. package/dist/{chunk-NQTYWHPB.js → chunk-LIGTP3A3.js} +1 -1
  84. package/dist/{chunk-7RPKHKA3.js → chunk-LQQNPMOD.js} +1 -1
  85. package/dist/{chunk-OZNBTSW5.js → chunk-LUR7JFPP.js} +1 -1
  86. package/dist/{chunk-QNLVC5ZB.js → chunk-LUZBGTYB.js} +1 -1
  87. package/dist/{chunk-N3TCNZSX.js → chunk-M43WH5DQ.js} +1 -1
  88. package/dist/{chunk-432ZOE42.js → chunk-MEKPGQAM.js} +1 -1
  89. package/dist/{chunk-GZFLJORM.js → chunk-NIVFEACM.js} +1 -1
  90. package/dist/{chunk-SA6IKFFD.js → chunk-NXAJBSIF.js} +1 -1
  91. package/dist/{chunk-MII3JOO3.js → chunk-NZ6AV2TA.js} +1 -1
  92. package/dist/{chunk-2SWSVJUP.js → chunk-OCDBTAYS.js} +1 -1
  93. package/dist/{chunk-SLKYD44Y.js → chunk-OGFU4YY4.js} +1 -1
  94. package/dist/{chunk-4LPX2OLV.js → chunk-P3JXJ4BW.js} +1 -1
  95. package/dist/{chunk-Y4T4SLDO.js → chunk-PAWQ4AKN.js} +1 -1
  96. package/dist/{chunk-6NWT2TEJ.js → chunk-QBYENBMB.js} +1 -1
  97. package/dist/{chunk-XIPKSXRQ.js → chunk-QDXKEOKI.js} +3 -3
  98. package/dist/{chunk-T6K2MEWP.js → chunk-QENCC2ZS.js} +1 -1
  99. package/dist/{chunk-SWMTXMKB.js → chunk-RF37IJNN.js} +1 -1
  100. package/dist/{chunk-XJ7HCXKW.js → chunk-RHGW7B5Q.js} +1 -1
  101. package/dist/{chunk-H3HHSTEK.js → chunk-RTVHJ23A.js} +1 -1
  102. package/dist/{chunk-OAKYUBD3.js → chunk-SGPAM5DZ.js} +1 -1
  103. package/dist/{chunk-RG372DON.js → chunk-TU42YZOJ.js} +1 -1
  104. package/dist/{chunk-V5JGXOV7.js → chunk-TU7TVFBK.js} +1 -1
  105. package/dist/{chunk-AJQZ3ST5.js → chunk-TW5AA5A7.js} +1 -1
  106. package/dist/{chunk-WI7K6VKQ.js → chunk-URH4FX3H.js} +1 -1
  107. package/dist/{chunk-BVO4C5F2.js → chunk-V7USCQWO.js} +1 -1
  108. package/dist/{chunk-4D5PC6QE.js → chunk-VSVWNRI2.js} +1 -1
  109. package/dist/{chunk-BZVNI44O.js → chunk-VUFIL5VR.js} +2 -2
  110. package/dist/{chunk-74W4AOT2.js → chunk-VX657KIK.js} +1 -1
  111. package/dist/{chunk-A6TJOZ24.js → chunk-VXGN3IV7.js} +1 -1
  112. package/dist/{chunk-2OSFI33O.js → chunk-VZ4A6WMK.js} +3 -3
  113. package/dist/{chunk-M6MBMRFR.js → chunk-W4QSZNMB.js} +1 -1
  114. package/dist/{chunk-EXFDIVNI.js → chunk-W54OT2FU.js} +2 -2
  115. package/dist/{chunk-NFRA64NU.js → chunk-W6HZF56M.js} +1 -1
  116. package/dist/{chunk-MZOIHUVX.js → chunk-W72ACCFL.js} +2 -2
  117. package/dist/{chunk-JD52IXON.js → chunk-WAOUE7MP.js} +1 -1
  118. package/dist/{chunk-WYSZ6TPW.js → chunk-WEIPY3CI.js} +10 -9
  119. package/dist/{chunk-I2KOGINW.js → chunk-WXJCJL5L.js} +1 -1
  120. package/dist/{chunk-LWJRSUE2.js → chunk-WZXPF3BI.js} +1 -1
  121. package/dist/{chunk-OF7WPCTQ.js → chunk-XLEGGC4Y.js} +1 -1
  122. package/dist/{chunk-6LIC2R22.js → chunk-XQMWHPZI.js} +1 -1
  123. package/dist/{chunk-D4FFXCX6.js → chunk-XRNQSXOM.js} +2 -2
  124. package/dist/{chunk-RW3Z2HMB.js → chunk-XZGEN4NU.js} +1 -1
  125. package/dist/{chunk-DNGOT65K.js → chunk-Y7E5L42F.js} +1 -1
  126. package/dist/{chunk-K45BKGB5.js → chunk-YAW6JW6D.js} +1 -1
  127. package/dist/{chunk-ENL4XTQ2.js → chunk-YGRULEZY.js} +1 -1
  128. package/dist/{chunk-F3U6T4YD.js → chunk-YHFZFV3A.js} +2 -2
  129. package/dist/{chunk-RX47NRSM.js → chunk-YLXWAY7D.js} +1 -1
  130. package/dist/{chunk-WEM3MOAL.js → chunk-YPFQ4UGF.js} +1 -1
  131. package/dist/{chunk-6U7ID777.js → chunk-YQ5C6UDG.js} +1 -1
  132. package/dist/{chunk-HFJSP4KD.js → chunk-ZAFJQ3SM.js} +1 -1
  133. package/dist/{chunk-2NFS4KE4.js → chunk-ZTRRFG52.js} +1 -1
  134. package/dist/{chunk-L4UVUFL6.js → chunk-ZU4W2QGM.js} +1 -1
  135. package/dist/{config-5ZOALGKE.js → config-754B73XK.js} +1 -1
  136. package/dist/{cover-cmd-UA2SVIZZ.js → cover-cmd-NBNZCR6C.js} +1 -1
  137. package/dist/{credentials-MRG452Y6.js → credentials-F7DYLVWY.js} +1 -1
  138. package/dist/{deps-bundle-FWINW4XM.js → deps-bundle-PW3WEQJ7.js} +1 -1
  139. package/dist/{deps-resolve-IET4KIBO.js → deps-resolve-SQYVN76L.js} +1 -1
  140. package/dist/{design-chat-MM5PJD2N.js → design-chat-F3OEZPNJ.js} +1 -1
  141. package/dist/{design-headless-FZONCKHW.js → design-headless-OTHYOX3E.js} +1 -1
  142. package/dist/{design-remote-SPVRIY2H.js → design-remote-2BEGCVCX.js} +2 -2
  143. package/dist/device-env-CHFRRV6W.js +2 -0
  144. package/dist/{doctor-VAX2BWQF.js → doctor-XY26Z35T.js} +1 -1
  145. package/dist/{evidence-LVVK7ROT.js → evidence-P6FFKC7B.js} +1 -1
  146. package/dist/{evolve-cmd-AGRKG7T3.js → evolve-cmd-WWOB3QJR.js} +1 -1
  147. package/dist/{evolve-remote-BGHULJTL.js → evolve-remote-WLVY3QID.js} +1 -1
  148. package/dist/{explain-cmd-WOBGS6KX.js → explain-cmd-OP5I5W3O.js} +1 -1
  149. package/dist/explore-K5YBGHK6.js +2 -0
  150. package/dist/{explore-context-tty-JTZVZFOE.js → explore-context-tty-RZ7D2TBV.js} +1 -1
  151. package/dist/{explore-entry-5OGNLFAU.js → explore-entry-EKXJ67BD.js} +4 -4
  152. package/dist/{explore-live-2XZHUYFS.js → explore-live-2YVRAQZO.js} +1 -1
  153. package/dist/{explore-run-tty-LGTIK2NA.js → explore-run-tty-D47FGPX7.js} +2 -2
  154. package/dist/{extract-bind-NM2BBK4I.js → extract-bind-W2NET364.js} +3 -3
  155. package/dist/{extract-chat-HLQMJJIC.js → extract-chat-M65NWGUK.js} +1 -1
  156. package/dist/{extract-cmd-T2TSAC3N.js → extract-cmd-FTFLETOP.js} +2 -2
  157. package/dist/{extract-headless-OQTQ3FJK.js → extract-headless-G6W6JQ27.js} +1 -1
  158. package/dist/{folder-flags-WXUR6OPJ.js → folder-flags-KKIH654K.js} +1 -1
  159. package/dist/{gaps-cmd-PTSKPTF7.js → gaps-cmd-OIDDLRYL.js} +1 -1
  160. package/dist/{gate-P57VP4E5.js → gate-7AKRPRMK.js} +1 -1
  161. package/dist/{generate-headless-JYZP6VXZ.js → generate-headless-RURIEKVS.js} +2 -2
  162. package/dist/index.js +19 -19
  163. package/dist/{ingest-cmd-LHCBMO4Z.js → ingest-cmd-4G2AK4Y2.js} +3 -3
  164. package/dist/{ingest-remote-D5TO5JQP.js → ingest-remote-SSLUHQVG.js} +1 -1
  165. package/dist/install-ZVBHPXGP.js +2 -0
  166. package/dist/{interactive-bind-5EJQUGKI.js → interactive-bind-SI2ZS55Q.js} +2 -2
  167. package/dist/{interactive-remote-D77ULJGL.js → interactive-remote-J56EWJGA.js} +1 -1
  168. package/dist/{lattice-auth-74XGF77Y.js → lattice-auth-6FEVSR7E.js} +1 -1
  169. package/dist/{lifecycle-cmd-7SM6UCMH.js → lifecycle-cmd-HJ37LTXE.js} +1 -1
  170. package/dist/{list-cmd-Z6FZXMFU.js → list-cmd-6XL2FYLQ.js} +1 -1
  171. package/dist/{list-commands-CZYZ7GIG.js → list-commands-5DCCKU3L.js} +1 -1
  172. package/dist/{list-remote-WOPOC6KK.js → list-remote-LXPQNXYN.js} +1 -1
  173. package/dist/login-flow-WEK3E476.js +2 -0
  174. package/dist/{maintenance-cmd-VRTGZVRE.js → maintenance-cmd-BXXHP36K.js} +1 -1
  175. package/dist/{mobile-prompts-KNAHU64X.js → mobile-prompts-CECJ5UY2.js} +1 -1
  176. package/dist/{onboarding-LGT6PMDZ.js → onboarding-PDVYMTY5.js} +1 -1
  177. package/dist/{persist-recorded-session-BX7II5P7.js → persist-recorded-session-A3ID7JFA.js} +1 -1
  178. package/dist/{pipeline-IXVTVRS5.js → pipeline-GX3LKPI5.js} +1 -1
  179. package/dist/{prepare-target-ULMKVKMC.js → prepare-target-FMT6QFHZ.js} +1 -1
  180. package/dist/{pull-cmd-6AL2WYHB.js → pull-cmd-UPFQYUND.js} +1 -1
  181. package/dist/{pull-route-TTVARJMV.js → pull-route-FWBXJMR7.js} +1 -1
  182. package/dist/real-device-run-X7JJWOIK.js +2 -0
  183. package/dist/{reconcile-cmd-R6H37SQR.js → reconcile-cmd-JBH365JL.js} +4 -4
  184. package/dist/{reconcile-remote-GWDV5CUT.js → reconcile-remote-BCX6SWFC.js} +2 -2
  185. package/dist/{recording-banner-ACC67Q2U.js → recording-banner-YKBAL6UB.js} +1 -1
  186. package/dist/registry-VQC757MJ.js +2 -0
  187. package/dist/remote-entry-X6JMPC2K.js +2 -0
  188. package/dist/{remote-mode-7G6PLJCW.js → remote-mode-FDPA7EWG.js} +1 -1
  189. package/dist/{remote-words-45USLRVN.js → remote-words-YVB66R3F.js} +1 -1
  190. package/dist/{require-project-folder-A3UDRELU.js → require-project-folder-MLMEQJYP.js} +1 -1
  191. package/dist/{resolve-run-intent-ZGPSUBXV.js → resolve-run-intent-PC7TQZUL.js} +1 -1
  192. package/dist/{resolver-IPM6R7U4.js → resolver-EID34LQE.js} +1 -1
  193. package/dist/{review-cmd-NNT5C5RZ.js → review-cmd-EUHFLFMY.js} +1 -1
  194. package/dist/{run-remote-3AYYVPKX.js → run-remote-SJCRTL7O.js} +1 -1
  195. package/dist/{run-startup-gate-NKRMKYBB.js → run-startup-gate-YO66G6LS.js} +1 -1
  196. package/dist/{run-test-md-HE6DUWQR.js → run-test-md-BLNBK4MH.js} +2 -2
  197. package/dist/session-worker.js +2 -2
  198. package/dist/{sessions-cmd-GYMETJHG.js → sessions-cmd-S7WZBUCN.js} +1 -1
  199. package/dist/{sessions-remote-GI7GOBMH.js → sessions-remote-IWHWIQ2T.js} +1 -1
  200. package/dist/{skill-installer-3QAVQGDH.js → skill-installer-MAVQY6GW.js} +1 -1
  201. package/dist/{store-X6XPFSKF.js → store-MSA7KASS.js} +1 -1
  202. package/dist/{store-choice-RT73HAI7.js → store-choice-3OJCV26J.js} +1 -1
  203. package/dist/{store-guard-SNWKLHQV.js → store-guard-OOSDLMEC.js} +1 -1
  204. package/dist/{sync-cmd-NBPPDG3B.js → sync-cmd-RDFDMVKQ.js} +1 -1
  205. package/dist/{sync-setup-5NUCH6N3.js → sync-setup-RBRDUV7Q.js} +1 -1
  206. package/dist/tcg-generate-KIECTZ2C.js +2 -0
  207. package/dist/{testmd-actions-GH5BW5V5.js → testmd-actions-CMAG6HWI.js} +1 -1
  208. package/dist/{testmd-sync-ACKCIOL3.js → testmd-sync-UPAA5UMD.js} +1 -1
  209. package/dist/token-refresh-KP3AYMYK.js +2 -0
  210. package/dist/{validate-basic-RE2WLIGQ.js → validate-basic-M5JHHNZA.js} +1 -1
  211. package/dist/{version-check-4FJVZP3K.js → version-check-Q737BE65.js} +1 -1
  212. package/dist/{view-cmd-N47BQZPD.js → view-cmd-XSNL5DGI.js} +1 -1
  213. package/dist/{walk-session-DA7QWXSW.js → walk-session-SHGYLFRB.js} +1 -1
  214. package/dist/{with-telemetry-7V4LY2BG.js → with-telemetry-PM2HVN2B.js} +1 -1
  215. package/package.json +11 -11
  216. package/dist/FolderPicker-W5S6RFCP.js +0 -2
  217. package/dist/InfoBox-OWUEHV2D.js +0 -2
  218. package/dist/ProjectPicker-BGFCUGT5.js +0 -2
  219. package/dist/SaveSessionPrompt-SUJE54GS.js +0 -2
  220. package/dist/SingleShotApp-4TDXZEUA.js +0 -2
  221. package/dist/TestMdRunView-4GPRWHEU.js +0 -2
  222. package/dist/TestrunEvidenceTable-OBVQJ6IO.js +0 -2
  223. package/dist/device-env-LXJ65AVF.js +0 -2
  224. package/dist/explore-LOKNOVNP.js +0 -2
  225. package/dist/install-Z6K2D2VY.js +0 -2
  226. package/dist/login-flow-2FZEOVHM.js +0 -2
  227. package/dist/real-device-run-2LFS5WE2.js +0 -2
  228. package/dist/registry-6IJYQXQC.js +0 -2
  229. package/dist/remote-entry-YL7O2NJQ.js +0 -2
  230. package/dist/tcg-generate-Z23CUISY.js +0 -2
  231. package/dist/token-refresh-4UCYAG6A.js +0 -2
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-AJQZ3ST5.js";import"./chunk-OQ5G773E.js";import"./chunk-IXW7FOGX.js";import"./chunk-RX47NRSM.js";import"./chunk-RX6776AI.js";import"./chunk-H3HHSTEK.js";import"./chunk-3AGP2BVN.js";import"./chunk-A6TJOZ24.js";import"./chunk-5Y2G4NC7.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-HD6NR44L.js";import"./chunk-FFL55I2M.js";import"./chunk-BWXLZS5O.js";import"./chunk-63EKRZKI.js";import"./chunk-3JLEDSG5.js";import"./chunk-42PALMW2.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-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-I5NSJBOZ.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{c as ChatSurface,b as reviewReadLine,a as tailVisualRows};
2
+ import{a,b,c}from"./chunk-TW5AA5A7.js";import"./chunk-L5DALV5N.js";import"./chunk-IJ2AHSWW.js";import"./chunk-YLXWAY7D.js";import"./chunk-RX6776AI.js";import"./chunk-RTVHJ23A.js";import"./chunk-3AGP2BVN.js";import"./chunk-VXGN3IV7.js";import"./chunk-5Y2G4NC7.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-HD6NR44L.js";import"./chunk-7NPTL66J.js";import"./chunk-BWXLZS5O.js";import"./chunk-63EKRZKI.js";import"./chunk-3JLEDSG5.js";import"./chunk-42PALMW2.js";import"./chunk-7HMSMAUG.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-7AET4JKQ.js";import"./chunk-DJC7NTLA.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-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-3OQW2GTA.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{c as ChatSurface,b as reviewReadLine,a as tailVisualRows};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-T7H4LBFK.js";import"./chunk-OVNRRI4E.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{c as ChromeProfilePicker,b as formatChromeProfileLine,a as listChromeProfiles};
2
+ import{a,b,c}from"./chunk-7SY34IIL.js";import"./chunk-ICLUC44J.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{c as ChromeProfilePicker,b as formatChromeProfileLine,a as listChromeProfiles};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as r}from"./chunk-4D5PC6QE.js";import"./chunk-OVNRRI4E.js";import"./chunk-HCBYKLMW.js";import{c as e}from"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import{a as i}from"./chunk-6YGTRKDT.js";import"./chunk-I6OQISK4.js";import{e as m}from"./chunk-UR6MHSHU.js";var t=m(i(),1);async function d(){return new Promise(o=>{let c=e(t.default.createElement(r,{onSubmit:n=>{c.unmount(),o(n)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{d as renderFeedbackPrompt};
2
+ import{a as r}from"./chunk-VSVWNRI2.js";import"./chunk-ICLUC44J.js";import"./chunk-HCBYKLMW.js";import{c as e}from"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import{a as i}from"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import{e as m}from"./chunk-UR6MHSHU.js";var t=m(i(),1);async function d(){return new Promise(o=>{let c=e(t.default.createElement(r,{onSubmit:n=>{c.unmount(),o(n)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{d as renderFeedbackPrompt};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as P,b as g,c as f}from"./chunk-QQ4TKLWP.js";import"./chunk-NQTYWHPB.js";import"./chunk-5Y2G4NC7.js";import{a as c}from"./chunk-HCBYKLMW.js";import{c as d}from"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import{a as h}from"./chunk-6YGTRKDT.js";import"./chunk-I6OQISK4.js";import{e as p}from"./chunk-UR6MHSHU.js";var e=p(h(),1);var m=p(c(),1);function w({pipeline:t,buildShareUrl:r,onDone:o}){let[n,i]=(0,e.useState)(P()),[S,l]=(0,e.useState)("uploading"),[U,R]=(0,e.useState)(),[C,E]=(0,e.useState)();return(0,e.useEffect)(()=>{let x=t.config.onProgress;t.config.onProgress=(s,u,a)=>{x(s,u,a),i(y=>g(y,s,u,a))},t.execute().then(s=>{s.success?(R(r?.(s)),l("success")):(E(s.error),l("failed")),setTimeout(()=>o(s),1500)})},[]),(0,m.jsx)(f,{steps:n,status:S,testUrl:U,error:C})}async function O(t,r){return new Promise(o=>{let n=d(e.default.createElement(w,{pipeline:t,buildShareUrl:r,onDone:i=>{n.unmount(),o(i)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{O as renderUploadProgress};
2
+ import{a as P,b as g,c as f}from"./chunk-C62QWG4B.js";import"./chunk-LIGTP3A3.js";import"./chunk-5Y2G4NC7.js";import{a as c}from"./chunk-HCBYKLMW.js";import{c as d}from"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import{a as h}from"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import{e as p}from"./chunk-UR6MHSHU.js";var e=p(h(),1);var m=p(c(),1);function w({pipeline:t,buildShareUrl:r,onDone:o}){let[n,i]=(0,e.useState)(P()),[S,l]=(0,e.useState)("uploading"),[U,R]=(0,e.useState)(),[C,E]=(0,e.useState)();return(0,e.useEffect)(()=>{let x=t.config.onProgress;t.config.onProgress=(s,u,a)=>{x(s,u,a),i(y=>g(y,s,u,a))},t.execute().then(s=>{s.success?(R(r?.(s)),l("success")):(E(s.error),l("failed")),setTimeout(()=>o(s),1500)})},[]),(0,m.jsx)(f,{steps:n,status:S,testUrl:U,error:C})}async function O(t,r){return new Promise(o=>{let n=d(e.default.createElement(w,{pipeline:t,buildShareUrl:r,onDone:i=>{n.unmount(),o(i)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{O as renderUploadProgress};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as h,b as l,c as i}from"./chunk-I5NSJBOZ.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a as s,j as C}from"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import{a as S}from"./chunk-6YGTRKDT.js";import{y as n}from"./chunk-I6OQISK4.js";import{e as u}from"./chunk-UR6MHSHU.js";var B=u(S(),1);var e=u(x(),1);function T({model:D,authLabel:w,profile:$,env:y,defaultUrl:d,projectId:a,projectName:v,folderId:t,folderName:g,windowSize:P,chromeProfile:R,target:r,deviceName:m,osVersion:f,appLabel:b,deviceSettings:c=[]}){let V=a?v?`${v} (${a})`:a:"(none)",A=t?g?`${g} (${t})`:t:"(none)",{exit:p}=C();return(0,B.useEffect)(()=>{let o=setTimeout(()=>p(),50);return()=>clearTimeout(o)},[p]),(0,e.jsx)(s,{flexDirection:"column",children:(0,e.jsx)(h,{title:"Configuration",children:(0,e.jsxs)(s,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(i,{label:"Auth"}),(0,e.jsx)(l,{label:" method",value:w}),(0,e.jsx)(l,{label:" profile",value:$}),(0,e.jsx)(l,{label:" env",value:y}),(0,e.jsx)(i,{label:"Defaults"}),(0,e.jsx)(l,{label:" url",value:d??"(none)",valueColor:d?n.orange:n.dim}),(0,e.jsx)(l,{label:" model",value:D}),(0,e.jsx)(l,{label:" window",value:P}),(0,e.jsx)(l,{label:" project",value:V}),(0,e.jsx)(l,{label:" folder",value:A}),r!==void 0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{label:" target",value:r}),r!=="desktop"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{label:" device_name",value:m??"(not set)",valueColor:m?void 0:n.dim}),(0,e.jsx)(l,{label:" os_version",value:f??"(not set)",valueColor:f?void 0:n.dim}),(0,e.jsx)(l,{label:" app",value:b??"(not set)",valueColor:b?void 0:n.dim})]})]}),c.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i,{label:"Device settings"}),c.map(o=>(0,e.jsx)(l,{label:` ${o.label}`,value:o.value},o.label))]}),(0,e.jsx)(i,{label:"Paths"}),(0,e.jsx)(l,{label:" chrome",value:R,valueColor:n.dim})]})})})}export{T as ConfigView};
2
+ import{a as h,b as l,c as i}from"./chunk-3OQW2GTA.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a as s,j as C}from"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import{a as S}from"./chunk-6YGTRKDT.js";import{y as n}from"./chunk-D36V5OX6.js";import{e as u}from"./chunk-UR6MHSHU.js";var B=u(S(),1);var e=u(x(),1);function T({model:D,authLabel:w,profile:$,env:y,defaultUrl:d,projectId:a,projectName:v,folderId:t,folderName:g,windowSize:P,chromeProfile:R,target:r,deviceName:m,osVersion:f,appLabel:b,deviceSettings:c=[]}){let V=a?v?`${v} (${a})`:a:"(none)",A=t?g?`${g} (${t})`:t:"(none)",{exit:p}=C();return(0,B.useEffect)(()=>{let o=setTimeout(()=>p(),50);return()=>clearTimeout(o)},[p]),(0,e.jsx)(s,{flexDirection:"column",children:(0,e.jsx)(h,{title:"Configuration",children:(0,e.jsxs)(s,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(i,{label:"Auth"}),(0,e.jsx)(l,{label:" method",value:w}),(0,e.jsx)(l,{label:" profile",value:$}),(0,e.jsx)(l,{label:" env",value:y}),(0,e.jsx)(i,{label:"Defaults"}),(0,e.jsx)(l,{label:" url",value:d??"(none)",valueColor:d?n.orange:n.dim}),(0,e.jsx)(l,{label:" model",value:D}),(0,e.jsx)(l,{label:" window",value:P}),(0,e.jsx)(l,{label:" project",value:V}),(0,e.jsx)(l,{label:" folder",value:A}),r!==void 0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{label:" target",value:r}),r!=="desktop"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{label:" device_name",value:m??"(not set)",valueColor:m?void 0:n.dim}),(0,e.jsx)(l,{label:" os_version",value:f??"(not set)",valueColor:f?void 0:n.dim}),(0,e.jsx)(l,{label:" app",value:b??"(not set)",valueColor:b?void 0:n.dim})]})]}),c.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i,{label:"Device settings"}),c.map(o=>(0,e.jsx)(l,{label:` ${o.label}`,value:o.value},o.label))]}),(0,e.jsx)(i,{label:"Paths"}),(0,e.jsx)(l,{label:" chrome",value:R,valueColor:n.dim})]})})})}export{T as ConfigView};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-2IZRPMZN.js";import"./chunk-EXFDIVNI.js";import"./chunk-6U7ID777.js";import"./chunk-DREQ3RAA.js";import"./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"./chunk-65VANXOF.js";import"./chunk-34R7BNZ2.js";import"./chunk-IINZZ4BZ.js";import"./chunk-NWD54VV5.js";import"./chunk-XMPTFXPW.js";import"./chunk-L4UVUFL6.js";import"./chunk-73Y6T2UK.js";import"./chunk-RFHMDQXZ.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-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 EvidenceViewOffer};
2
+ import{a}from"./chunk-D7U2M26S.js";import"./chunk-W54OT2FU.js";import"./chunk-YQ5C6UDG.js";import"./chunk-DREQ3RAA.js";import"./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"./chunk-65VANXOF.js";import"./chunk-34R7BNZ2.js";import"./chunk-IINZZ4BZ.js";import"./chunk-3F5FMH76.js";import"./chunk-XMPTFXPW.js";import"./chunk-ZU4W2QGM.js";import"./chunk-73Y6T2UK.js";import"./chunk-RFHMDQXZ.js";import"./chunk-36N3EHW5.js";import"./chunk-EBPRPNSA.js";import"./chunk-Y6Y6RAY4.js";import"./chunk-NXAJBSIF.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-XRNQSXOM.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-RF37IJNN.js";import"./chunk-XZYA7DNH.js";import"./chunk-7HMSMAUG.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-7AET4JKQ.js";import"./chunk-DJC7NTLA.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-C2RUDJ46.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-HJMCXSUJ.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{a as EvidenceViewOffer};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-JZP3Y4ZM.js";import"./chunk-SMXABALN.js";import"./chunk-ZAFJQ3SM.js";import"./chunk-C6HI6Y3S.js";import"./chunk-ICLUC44J.js";import"./chunk-3G2LSTK5.js";import"./chunk-C2RUDJ46.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-HJMCXSUJ.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{b as FolderPicker,a as formatFolderLine};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a}from"./chunk-F22K3RRX.js";import"./chunk-3OQW2GTA.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{a as InfoBox};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-V7S6S5W3.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 LinksBox};
2
+ import{a}from"./chunk-AVSMXDTX.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{a as LinksBox};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-T6K2MEWP.js";import"./chunk-OVNRRI4E.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{b as ProfilesView,a as formatProfileLine};
2
+ import{a,b}from"./chunk-QENCC2ZS.js";import"./chunk-ICLUC44J.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{b as ProfilesView,a as formatProfileLine};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b,c}from"./chunk-YGRULEZY.js";import"./chunk-SMXABALN.js";import"./chunk-ZAFJQ3SM.js";import"./chunk-C6HI6Y3S.js";import"./chunk-ICLUC44J.js";import"./chunk-3G2LSTK5.js";import"./chunk-C2RUDJ46.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-HJMCXSUJ.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{c as ProjectPicker,b as RUN_GATE_PICKER,a as formatProjectLine};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b,c}from"./chunk-3YTCKCBG.js";import"./chunk-S3DAAAE5.js";import"./chunk-F22K3RRX.js";import"./chunk-3OQW2GTA.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{a as SaveSessionPrompt,b as defaultSessionTimestamp,c as renderSavePrompt};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-WZXPF3BI.js";import"./chunk-KODJVOCN.js";import"./chunk-ZTRRFG52.js";import"./chunk-AEWNWAXW.js";import"./chunk-72KYMWQ5.js";import"./chunk-JQ64X2TO.js";import"./chunk-TDPWFYTJ.js";import"./chunk-34R7BNZ2.js";import"./chunk-V7USCQWO.js";import"./chunk-CGITGJ3I.js";import"./chunk-VE3SUJMA.js";import"./chunk-5D7ENQTQ.js";import"./chunk-EBPRPNSA.js";import"./chunk-Y6Y6RAY4.js";import"./chunk-NXAJBSIF.js";import"./chunk-YGRULEZY.js";import"./chunk-JZP3Y4ZM.js";import"./chunk-SMXABALN.js";import"./chunk-ZAFJQ3SM.js";import"./chunk-C6HI6Y3S.js";import"./chunk-TZXXJWHA.js";import"./chunk-SXRHKXSE.js";import"./chunk-ICLUC44J.js";import"./chunk-Z7S3IWUX.js";import"./chunk-LUR7JFPP.js";import"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-VZ7KXRXB.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-C2RUDJ46.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-HJMCXSUJ.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{b as SingleShotApp,a as phaseAfterAuth};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d}from"./chunk-6NWT2TEJ.js";import"./chunk-5BUIIFLC.js";import"./chunk-I5NSJBOZ.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{d as AutoExitSummaryBox,c as SummaryBox,b as buildSummaryEvent,a as buildSummaryRendered};
2
+ import{a,b,c,d}from"./chunk-QBYENBMB.js";import"./chunk-F22K3RRX.js";import"./chunk-3OQW2GTA.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{d as AutoExitSummaryBox,c as SummaryBox,b as buildSummaryEvent,a as buildSummaryRendered};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{g as a}from"./chunk-ACMBMZDQ.js";import"./chunk-CCP4X75B.js";import"./chunk-WXJCJL5L.js";import"./chunk-TDPWFYTJ.js";import"./chunk-LIGTP3A3.js";import"./chunk-5Y2G4NC7.js";import"./chunk-IINZZ4BZ.js";import"./chunk-CGITGJ3I.js";import"./chunk-5D7ENQTQ.js";import"./chunk-CUXY6KQ2.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-XRNQSXOM.js";import"./chunk-WN5VKKJ3.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-GMTHZUZ3.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-C2RUDJ46.js";import"./chunk-RZ4F3BHX.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-HJMCXSUJ.js";import"./chunk-F22K3RRX.js";import"./chunk-3OQW2GTA.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{a as TestMdRunView};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-YPFQ4UGF.js";import"./chunk-YQ5C6UDG.js";import"./chunk-RFHMDQXZ.js";import"./chunk-C2RUDJ46.js";import"./chunk-HJMCXSUJ.js";import"./chunk-3OQW2GTA.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{a as buildServeMap,b as renderTestrunEvidenceTable};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as f,b as r}from"./chunk-I5NSJBOZ.js";import{a as s}from"./chunk-HCBYKLMW.js";import{a as i,b as l,j as x}from"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import{a as B}from"./chunk-6YGTRKDT.js";import{y as o}from"./chunk-I6OQISK4.js";import{e as a}from"./chunk-UR6MHSHU.js";var p=a(B(),1);var e=a(s(),1);function V({profile:b,env:g,authenticated:n,authMethod:v,username:c,tokenStatus:t,serverStatus:d,detail:u}){let{exit:m}=x();return(0,p.useEffect)(()=>{let h=setTimeout(()=>m(),50);return()=>clearTimeout(h)},[m]),(0,e.jsx)(i,{flexDirection:"column",children:(0,e.jsx)(f,{title:"Identity",variant:n?"success":"warning",children:(0,e.jsxs)(i,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(i,{children:d==="rejected"?(0,e.jsx)(l,{color:o.red,bold:!0,children:"\u2717 Not authenticated"}):d==="unreachable"?(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Couldn't verify"}):n?(0,e.jsx)(l,{color:o.green,bold:!0,children:"\u2713 Authenticated"}):(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Not logged in"})}),(0,e.jsxs)(i,{flexDirection:"column",marginTop:1,children:[(0,e.jsx)(r,{label:"Profile",value:b}),(0,e.jsx)(r,{label:"Environment",value:g}),(0,e.jsx)(r,{label:"Method",value:v}),c&&(0,e.jsx)(r,{label:"User",value:c}),t&&(0,e.jsx)(r,{label:"Token",value:t,valueColor:t==="valid"?o.green:t==="expired"?o.red:o.dim}),u&&(0,e.jsx)(r,{label:"Detail",value:u})]})]})})})}export{V as WhoamiView};
2
+ import{a as f,b as r}from"./chunk-3OQW2GTA.js";import{a as s}from"./chunk-HCBYKLMW.js";import{a as i,b as l,j as x}from"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import{a as B}from"./chunk-6YGTRKDT.js";import{y as o}from"./chunk-D36V5OX6.js";import{e as a}from"./chunk-UR6MHSHU.js";var p=a(B(),1);var e=a(s(),1);function V({profile:b,env:g,authenticated:n,authMethod:v,username:c,tokenStatus:t,serverStatus:d,detail:u}){let{exit:m}=x();return(0,p.useEffect)(()=>{let h=setTimeout(()=>m(),50);return()=>clearTimeout(h)},[m]),(0,e.jsx)(i,{flexDirection:"column",children:(0,e.jsx)(f,{title:"Identity",variant:n?"success":"warning",children:(0,e.jsxs)(i,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(i,{children:d==="rejected"?(0,e.jsx)(l,{color:o.red,bold:!0,children:"\u2717 Not authenticated"}):d==="unreachable"?(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Couldn't verify"}):n?(0,e.jsx)(l,{color:o.green,bold:!0,children:"\u2713 Authenticated"}):(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Not logged in"})}),(0,e.jsxs)(i,{flexDirection:"column",marginTop:1,children:[(0,e.jsx)(r,{label:"Profile",value:b}),(0,e.jsx)(r,{label:"Environment",value:g}),(0,e.jsx)(r,{label:"Method",value:v}),c&&(0,e.jsx)(r,{label:"User",value:c}),t&&(0,e.jsx)(r,{label:"Token",value:t,valueColor:t==="valid"?o.green:t==="expired"?o.red:o.dim}),u&&(0,e.jsx)(r,{label:"Detail",value:u})]})]})})})}export{V as WhoamiView};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as a,c as b}from"./chunk-SA6IKFFD.js";import"./chunk-SXRHKXSE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";export{a as isAppId,b as resolveCloudApp};
2
+ import{b as a,c as b}from"./chunk-NXAJBSIF.js";import"./chunk-SXRHKXSE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{a as isAppId,b as resolveCloudApp};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as q,b as Ne}from"./chunk-GZFLJORM.js";import{c as Ae,e as Ie,f as ve}from"./chunk-7LKCWO2R.js";import{d as $e}from"./chunk-QS5ZJFGF.js";import"./chunk-6LIC2R22.js";import{f as Ee,k as ye}from"./chunk-LRS5MGBY.js";import"./chunk-SONMD3W5.js";import"./chunk-QCKA665H.js";import"./chunk-XJ7HCXKW.js";import"./chunk-QTZBVDPR.js";import"./chunk-NLZZLANH.js";import"./chunk-NWD54VV5.js";import{e as ue}from"./chunk-XMPTFXPW.js";import{g as le}from"./chunk-L4UVUFL6.js";import"./chunk-73Y6T2UK.js";import"./chunk-P2ZQDQDB.js";import"./chunk-3BSYOCSW.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{a as pe}from"./chunk-JNSWKGTB.js";import{a as H,b as j,d as ge,e as me,f as he,g as _e,i as we}from"./chunk-3UVSAAES.js";import"./chunk-3QICDXY5.js";import{h as fe}from"./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-REKHAN53.js";import"./chunk-GRURFGBP.js";import"./chunk-MYZHOBS4.js";import"./chunk-ZFM77AQU.js";import{c as B}from"./chunk-SWMTXMKB.js";import"./chunk-XZYA7DNH.js";import{a as V,ba as de,c as G,e as ie,f as ae,fa as ce}from"./chunk-W3OVSDBN.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import{a as I}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"./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{a as ne,c as re}from"./chunk-MGNRNLBE.js";import{a as oe}from"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-XBEYWXPV.js";import"./chunk-FOJHSG5M.js";import{a as x}from"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";import{mkdtempSync as We}from"fs";import{tmpdir as Xe}from"os";import{join as Ye}from"path";function W(e){if(e<1e3)return`${Math.max(0,Math.round(e))}ms`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m${String(t%60).padStart(2,"0")}s`:`${Math.floor(n/60)}h${String(n%60).padStart(2,"0")}m`}var be=e=>e===null?"none":`${e.run}@v${e.run_version}+${e.deltas}${e.cut!==void 0?` cut ${String(e.cut)}`:""}`;function Te(e,t){return[`assurance-job: job ${e.jobId} \xB7 attempt ${e.attempt} \xB7 trigger ${e.trigger} \xB7 kane-cli ${t} \xB7 ${e.env}`,`assurance-job: exploration ${e.explorationId} \xB7 run ${e.runId} \xB7 cut ${String(e.cut)} \xB7 project ${e.projectId}`,`assurance-job: cursor ${be(e.cursorFrom)} \u2192 ${be(e.cursorTo)}${e.cursorFromUnreadable?" (KANE_AJ_CURSOR_FROM unreadable: ignored)":""}`]}function Be(e){return e==null?null:typeof e=="string"?e.length>120?`${JSON.stringify(e.slice(0,117))}\u2026`:/[\s"]/.test(e)?JSON.stringify(e):e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?`[${e.length}]`:typeof e=="object"?"{\u2026}":null}var He=new Set(["type","v","ts","kind","verb"]);function O(e,t){if(typeof t=="string")return`${e} ${t.length>400?`${t.slice(0,397)}\u2026`:t}`;let n=typeof t.type=="string"?t.type:typeof t.kind=="string"?t.kind:"line",o=[];for(let[s,r]of Object.entries(t)){if(He.has(s))continue;let u=Be(r);if(u!==null&&(o.push(`${s}=${u}`),o.length===8))break}return`${e} ${n}${o.length?` ${o.join(" ")}`:""}`}function Re(e){if(e.length===0)return["assurance-job: summary: no session ran"];let t=e.map(r=>[r.verb,r.target,r.status,r.tests===null?"-":String(r.tests),r.ms===null?"-":`${Math.round(r.ms/100)/10}s`]),n=["verb","target","status","tests","seconds"],o=n.map((r,u)=>Math.max(r.length,...t.map(a=>a[u].length))),s=r=>`assurance-job: ${r.map((u,a)=>u.padEnd(o[a])).join(" ").trimEnd()}`;return["assurance-job: summary",s(n),...t.map(s)]}var je="assurance-job-outcome/1",Se=["run_end","checkpoint","manual","catch_up"],X=e=>typeof e=="number"&&Number.isInteger(e)&&e>=0,U=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;function J(e){let t;try{t=JSON.parse(e)}catch{return null}if(Array.isArray(t)){let[s,r,u,a,i,c]=t;t={export_version:s,run:r,run_version:u,deltas:a,...t.length>=6?{cut:i,provisional:c}:{}}}if(typeof t!="object"||t===null)return null;let n=t;if(typeof n.export_version!="string"||n.export_version===""||typeof n.run!="string"||n.run===""||!X(n.run_version)||!X(n.deltas))return null;let o={export_version:n.export_version,run:n.run,run_version:n.run_version,deltas:n.deltas};if(n.cut!==void 0||n.provisional!==void 0){if(n.cut!=="end"&&!X(n.cut)||typeof n.provisional!="boolean")return null;o.cut=n.cut,o.provisional=n.provisional}return o}var xe=new Set(["exploration-export/1","exploration-export/2"]);function v(e,t){return!xe.has(e.export_version)||!xe.has(t.export_version)?"unordered":e.run_version<t.run_version?"older":e.run_version>t.run_version?"at-or-past":e.deltas<t.deltas?"older":e.deltas>t.deltas?"at-or-past":!Oe(e)&&Oe(t)?"older":"at-or-past"}var Oe=e=>e.cut===void 0||e.cut==="end";function Je(e,t){let n=[],o={KANE_AJ_JOB_ID:e.KANE_AJ_JOB_ID,KANE_AJ_ATTEMPT:e.KANE_AJ_ATTEMPT,KANE_AJ_TRIGGER:e.KANE_AJ_TRIGGER,KANE_AJ_EXPLORATION_ID:e.KANE_AJ_EXPLORATION_ID,KANE_AJ_RUN_ID:e.KANE_AJ_RUN_ID,KANE_AJ_CUT:e.KANE_AJ_CUT,KANE_AJ_PROJECT_ID:e.KANE_AJ_PROJECT_ID,KANE_AJ_CURSOR_FROM:e.KANE_AJ_CURSOR_FROM,KANE_AJ_CURSOR_TO:e.KANE_AJ_CURSOR_TO,KANE_AJ_REPORT_URL:e.KANE_AJ_REPORT_URL,TESTMUAI_ENV:e.TESTMUAI_ENV,LT_USERNAME:e.LT_USERNAME,LT_ACCESS_KEY:e.LT_ACCESS_KEY},s=$=>{let S=o[$];return S===void 0||S.trim()===""?(n.push(`${$} is not set`),null):S.trim()},r={},u=s("KANE_AJ_JOB_ID");u!==null&&(U.test(u)?r.jobId=u:n.push("KANE_AJ_JOB_ID is not an id"));let a=s("KANE_AJ_ATTEMPT");a!==null&&(a==="1"||a==="2"?r.attempt=Number(a):n.push("KANE_AJ_ATTEMPT is not 1 or 2"));let i=s("KANE_AJ_TRIGGER");i!==null&&(Se.includes(i)?r.trigger=i:n.push(`KANE_AJ_TRIGGER is not one of ${Se.join(" | ")}`));let c=s("KANE_AJ_EXPLORATION_ID");c!==null&&(U.test(c)?r.explorationId=c:n.push("KANE_AJ_EXPLORATION_ID is not an id"));let f=s("KANE_AJ_RUN_ID");f!==null&&(U.test(f)?r.runId=f:n.push("KANE_AJ_RUN_ID is not an id"));let g=s("KANE_AJ_CUT");g!==null&&(g==="end"?r.cut="end":/^\d{1,9}$/.test(g)?r.cut=Number(g):n.push('KANE_AJ_CUT is not a whole number or "end"'));let h=s("KANE_AJ_PROJECT_ID");h!==null&&!U.test(h)&&n.push("KANE_AJ_PROJECT_ID is not an id");let d=o.KANE_AJ_CURSOR_FROM?.trim()??"",_=d===""?null:J(d),l=s("KANE_AJ_CURSOR_TO"),m=l===null?null:J(l);l!==null&&m===null&&n.push("KANE_AJ_CURSOR_TO is not a cursor"),m!==null&&r.runId!==void 0&&m.run!==r.runId&&n.push("KANE_AJ_CURSOR_TO names another run than KANE_AJ_RUN_ID");let p=s("TESTMUAI_ENV"),y=p==="prod"||p==="stage";p!==null&&!y&&n.push("TESTMUAI_ENV is not prod or stage");let w=s("KANE_AJ_REPORT_URL"),R=!1;if(w!==null){let $=null;try{$=new URL(w)}catch{$=null}let S=M=>M==="localhost"||M==="127.0.0.1"||M==="[::1]",P=null;if(y)try{P=t(p)}catch{P=null}$===null||!($.protocol==="https:"||$.protocol==="http:"&&S($.hostname))?n.push("KANE_AJ_REPORT_URL is not an https address"):y?P===null?n.push("TESTMUAI_BASE_URL is not a URL, so KANE_AJ_REPORT_URL can't be checked"):$.origin!==P?n.push("KANE_AJ_REPORT_URL is not on the controller's origin"):R=!0:n.push("KANE_AJ_REPORT_URL can't be checked without a valid TESTMUAI_ENV")}let N=s("LT_USERNAME"),A=s("LT_ACCESS_KEY");if(n.length>0){let $=r.jobId!==void 0&&R&&N!==null&&A!==null?{url:w,login:{username:N,accessKey:A}}:null;return{ok:!1,identity:r,message:n.join("; "),report:$}}return{ok:!0,input:{jobId:r.jobId,attempt:r.attempt,trigger:r.trigger,explorationId:r.explorationId,runId:r.runId,cut:r.cut,projectId:h,cursorFrom:_,cursorFromUnreadable:d!==""&&_===null,cursorTo:m,reportUrl:w,env:p,login:{username:N,accessKey:A}}}}function Y(e,t){return{v:je,job_id:e.jobId??null,attempt:e.attempt??null,trigger:e.trigger??null,exploration_id:e.explorationId??null,run_id:e.runId??null,cut:e.cut??null,cursor:{from:null,to:null},status:"failed",use_cases:{added:[],modified:[]},tests:{designed:0,saved:0,updated:0,failed:[],saved_cases:[]},held:[],sessions:[],credits:null,duration_s:0,kane_cli_version:t,error:null,errors:[]}}function z(e){if(e===null||e.accessKey==="")return n=>n;let t=[e.accessKey,Buffer.from(`${e.username}:${e.accessKey}`,"utf8").toString("base64")].filter(n=>n.length>=4);return n=>t.reduce((o,s)=>o.split(s).join("[redacted]"),n)}var Q=(e,t)=>t(JSON.stringify(e));async function Z(e,t,n,o={}){let s=o.fetch??fetch,r=o.backoffMs??[1e3,2e3,4e3],u=o.sleep??(i=>new Promise(c=>setTimeout(c,i))),a=`Basic ${Buffer.from(`${n.username}:${n.accessKey}`,"utf8").toString("base64")}`;for(let i=0;i<=r.length;i++){i>0&&await u(r[i-1]);try{let c=await s(e,{method:"POST",headers:{authorization:a,"content-type":"application/json"},body:t,signal:AbortSignal.timeout(3e4)});if(c.ok)return!0;if(c.status!==429&&c.status<500)return!1}catch{}}return!1}var b=class extends Error{constructor(n,o,s){super(s);this.status=n;this.code=o}},E=(e,t)=>{throw new b("failed",e,t)};async function Ce(e,t,n,o){let s;try{s=await e.sources(t)}catch(i){if(i instanceof I&&(i.code==="NO_CONTEXT"||i.code==="NOT_FOUND"))return{source:null,cursor:null};throw i}let r=s.find(i=>i.sourceId===n&&i.head!==null)??null,u=r?.media?.format==="plugin"&&r.media.plugin?.id==="explore"?r.media.plugin.fetch:void 0,a=u?.ref===o&&typeof u.cursor=="string"?J(u.cursor):null;return{source:r,cursor:a}}async function ze(e,t,n){return n.head===null||n.completeness?.sourceCid===n.head?!1:!(await e.mainNode(t,n.head)).edgesOut.some(s=>s.type==="DERIVES"&&s.other?.label==="usecase")}async function De(e,t){let n=j("explore",t?{fetchImpl:t}:{});if(n===void 0)return E("INTERNAL","this build has no connection for the explore plugin");let o=`${H().replace(/\/+$/,"")}/exploration/${encodeURIComponent(e.explorationId)}/assurance/head?cut=${e.cut}&run=${encodeURIComponent(e.runId)}`,s;try{s=await n.request({url:o,headers:{accept:"application/json"}})}catch(a){return E("INGEST_FAILED",`the controller could not be read for exploration ${e.explorationId}: ${a instanceof Error?a.message:String(a)}`)}finally{n.close()}let r={};try{r=JSON.parse(new TextDecoder().decode(s.body))}catch{r={}}if((s.status===401||s.status===403)&&E("AUTH_FAILED",`the controller refused the job's credentials (${s.status})`),s.status===409&&r.code==="RUN_ACTIVE"&&E("RUN_ACTIVE",`a run of exploration ${e.explorationId} is in progress${typeof r.active_run=="string"?` (run ${r.active_run})`:""}: its export is read once it ends`),s.status===404&&r.code==="NO_ENDED_RUN"&&E("NO_ENDED_RUN",`exploration ${e.explorationId} has no ended run yet`),s.status===409&&r.code==="CUT_SUPERSEDED")throw new b("noop",null,"");s.status===404&&r.code==="CUT_NOT_FOUND"&&E("CUT_NOT_FOUND",`cut ${e.cut} of run ${e.runId} of exploration ${e.explorationId} was never taken`),s.status!==200&&E("INGEST_FAILED",`the controller answered ${s.status} for the head of exploration ${e.explorationId}`);let u=J(JSON.stringify(r.cursor??null));return u===null?E("INGEST_FAILED",`the controller's head of exploration ${e.explorationId} carries no cursor`):u}async function Qe(e,t){let n=j("explore",t?{fetchImpl:t}:{});if(n===void 0)return!1;try{let o={exploration:e.explorationId,run:e.runId,cut:e.cut},s=await n.request({url:he(H(),o,"export"),headers:{accept:"application/json"}});return s.status!==200?!1:me(_e(s,o)).units.length===0}catch{return!1}finally{n.close()}}function L(e){return e==="MARK_REFUSED"||e==="PERMISSION_REQUIRED"?"MARK_REFUSED":e==="PROJECT_NOT_MARKED"||e==="ASSURANCE_OFF"?"PROJECT_NOT_MARKED":null}function Pe(e){return/\(CUT_NOT_FOUND\)/.test(e)?"CUT_NOT_FOUND":/is in progress/.test(e)?"RUN_ACTIVE":/no ended run/.test(e)?"NO_ENDED_RUN":/refused (kane-cli's credentials|the credential)/.test(e)?"AUTH_FAILED":"INGEST_FAILED"}async function D(e,t){let n=e.deps.now??Date.now,o=n(),s=`[${t.verb} ${t.log.target}]`,r=t.verb==="extract"||t.verb==="reconcile"?`source ${t.log.target}`:`use case ${t.log.target}`;e.diag(`[${t.log.step}] ${t.verb} starting (${r})${t.resume!==void 0?`: resuming session ${t.resume}`:""}`);let u=[],a=m=>{for(let p of m.split(`
2
+ import{a as q,b as Ne}from"./chunk-NIVFEACM.js";import{c as Ae,e as Ie,f as ve}from"./chunk-5AKJPYUW.js";import{d as $e}from"./chunk-734ORT6O.js";import"./chunk-XQMWHPZI.js";import{f as Ee,k as ye}from"./chunk-3RJHXOZH.js";import"./chunk-DDZLCAEO.js";import"./chunk-CM4CHYSN.js";import"./chunk-RHGW7B5Q.js";import"./chunk-HCJ2N3XB.js";import"./chunk-NLZZLANH.js";import"./chunk-3F5FMH76.js";import{e as ue}from"./chunk-XMPTFXPW.js";import{g as le}from"./chunk-ZU4W2QGM.js";import"./chunk-73Y6T2UK.js";import"./chunk-P2ZQDQDB.js";import"./chunk-3BSYOCSW.js";import"./chunk-HIUAUZNL.js";import"./chunk-457Y5TEC.js";import"./chunk-EECDDDSB.js";import"./chunk-7NPTL66J.js";import"./chunk-42PALMW2.js";import"./chunk-KF4DKXSS.js";import"./chunk-AUJSC7PU.js";import{a as pe}from"./chunk-JNSWKGTB.js";import{a as H,b as j,d as ge,e as me,f as he,g as _e,i as we}from"./chunk-I4RVVBG3.js";import"./chunk-3QICDXY5.js";import{h as fe}from"./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-REKHAN53.js";import"./chunk-GRURFGBP.js";import"./chunk-MYZHOBS4.js";import"./chunk-ZFM77AQU.js";import{c as B}from"./chunk-RF37IJNN.js";import"./chunk-XZYA7DNH.js";import{a as V,ba as de,c as G,e as ie,f as ae,fa as ce}from"./chunk-7HMSMAUG.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import{a as I}from"./chunk-I2MC6VVX.js";import"./chunk-RPRXRKKR.js";import"./chunk-QXQ7KVEN.js";import"./chunk-7AET4JKQ.js";import"./chunk-DJC7NTLA.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-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import{a as ne,c as re}from"./chunk-C2RUDJ46.js";import{a as oe}from"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-HJMCXSUJ.js";import"./chunk-FOJHSG5M.js";import{a as x}from"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";import{mkdtempSync as We}from"fs";import{tmpdir as Xe}from"os";import{join as Ye}from"path";function W(e){if(e<1e3)return`${Math.max(0,Math.round(e))}ms`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m${String(t%60).padStart(2,"0")}s`:`${Math.floor(n/60)}h${String(n%60).padStart(2,"0")}m`}var be=e=>e===null?"none":`${e.run}@v${e.run_version}+${e.deltas}${e.cut!==void 0?` cut ${String(e.cut)}`:""}`;function Te(e,t){return[`assurance-job: job ${e.jobId} \xB7 attempt ${e.attempt} \xB7 trigger ${e.trigger} \xB7 kane-cli ${t} \xB7 ${e.env}`,`assurance-job: exploration ${e.explorationId} \xB7 run ${e.runId} \xB7 cut ${String(e.cut)} \xB7 project ${e.projectId}`,`assurance-job: cursor ${be(e.cursorFrom)} \u2192 ${be(e.cursorTo)}${e.cursorFromUnreadable?" (KANE_AJ_CURSOR_FROM unreadable: ignored)":""}`]}function Be(e){return e==null?null:typeof e=="string"?e.length>120?`${JSON.stringify(e.slice(0,117))}\u2026`:/[\s"]/.test(e)?JSON.stringify(e):e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?`[${e.length}]`:typeof e=="object"?"{\u2026}":null}var He=new Set(["type","v","ts","kind","verb"]);function O(e,t){if(typeof t=="string")return`${e} ${t.length>400?`${t.slice(0,397)}\u2026`:t}`;let n=typeof t.type=="string"?t.type:typeof t.kind=="string"?t.kind:"line",o=[];for(let[s,r]of Object.entries(t)){if(He.has(s))continue;let u=Be(r);if(u!==null&&(o.push(`${s}=${u}`),o.length===8))break}return`${e} ${n}${o.length?` ${o.join(" ")}`:""}`}function Re(e){if(e.length===0)return["assurance-job: summary: no session ran"];let t=e.map(r=>[r.verb,r.target,r.status,r.tests===null?"-":String(r.tests),r.ms===null?"-":`${Math.round(r.ms/100)/10}s`]),n=["verb","target","status","tests","seconds"],o=n.map((r,u)=>Math.max(r.length,...t.map(a=>a[u].length))),s=r=>`assurance-job: ${r.map((u,a)=>u.padEnd(o[a])).join(" ").trimEnd()}`;return["assurance-job: summary",s(n),...t.map(s)]}var je="assurance-job-outcome/1",Se=["run_end","checkpoint","manual","catch_up"],X=e=>typeof e=="number"&&Number.isInteger(e)&&e>=0,U=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;function J(e){let t;try{t=JSON.parse(e)}catch{return null}if(Array.isArray(t)){let[s,r,u,a,i,c]=t;t={export_version:s,run:r,run_version:u,deltas:a,...t.length>=6?{cut:i,provisional:c}:{}}}if(typeof t!="object"||t===null)return null;let n=t;if(typeof n.export_version!="string"||n.export_version===""||typeof n.run!="string"||n.run===""||!X(n.run_version)||!X(n.deltas))return null;let o={export_version:n.export_version,run:n.run,run_version:n.run_version,deltas:n.deltas};if(n.cut!==void 0||n.provisional!==void 0){if(n.cut!=="end"&&!X(n.cut)||typeof n.provisional!="boolean")return null;o.cut=n.cut,o.provisional=n.provisional}return o}var xe=new Set(["exploration-export/1","exploration-export/2"]);function v(e,t){return!xe.has(e.export_version)||!xe.has(t.export_version)?"unordered":e.run_version<t.run_version?"older":e.run_version>t.run_version?"at-or-past":e.deltas<t.deltas?"older":e.deltas>t.deltas?"at-or-past":!Oe(e)&&Oe(t)?"older":"at-or-past"}var Oe=e=>e.cut===void 0||e.cut==="end";function Je(e,t){let n=[],o={KANE_AJ_JOB_ID:e.KANE_AJ_JOB_ID,KANE_AJ_ATTEMPT:e.KANE_AJ_ATTEMPT,KANE_AJ_TRIGGER:e.KANE_AJ_TRIGGER,KANE_AJ_EXPLORATION_ID:e.KANE_AJ_EXPLORATION_ID,KANE_AJ_RUN_ID:e.KANE_AJ_RUN_ID,KANE_AJ_CUT:e.KANE_AJ_CUT,KANE_AJ_PROJECT_ID:e.KANE_AJ_PROJECT_ID,KANE_AJ_CURSOR_FROM:e.KANE_AJ_CURSOR_FROM,KANE_AJ_CURSOR_TO:e.KANE_AJ_CURSOR_TO,KANE_AJ_REPORT_URL:e.KANE_AJ_REPORT_URL,TESTMUAI_ENV:e.TESTMUAI_ENV,LT_USERNAME:e.LT_USERNAME,LT_ACCESS_KEY:e.LT_ACCESS_KEY},s=$=>{let S=o[$];return S===void 0||S.trim()===""?(n.push(`${$} is not set`),null):S.trim()},r={},u=s("KANE_AJ_JOB_ID");u!==null&&(U.test(u)?r.jobId=u:n.push("KANE_AJ_JOB_ID is not an id"));let a=s("KANE_AJ_ATTEMPT");a!==null&&(a==="1"||a==="2"?r.attempt=Number(a):n.push("KANE_AJ_ATTEMPT is not 1 or 2"));let i=s("KANE_AJ_TRIGGER");i!==null&&(Se.includes(i)?r.trigger=i:n.push(`KANE_AJ_TRIGGER is not one of ${Se.join(" | ")}`));let c=s("KANE_AJ_EXPLORATION_ID");c!==null&&(U.test(c)?r.explorationId=c:n.push("KANE_AJ_EXPLORATION_ID is not an id"));let f=s("KANE_AJ_RUN_ID");f!==null&&(U.test(f)?r.runId=f:n.push("KANE_AJ_RUN_ID is not an id"));let g=s("KANE_AJ_CUT");g!==null&&(g==="end"?r.cut="end":/^\d{1,9}$/.test(g)?r.cut=Number(g):n.push('KANE_AJ_CUT is not a whole number or "end"'));let h=s("KANE_AJ_PROJECT_ID");h!==null&&!U.test(h)&&n.push("KANE_AJ_PROJECT_ID is not an id");let d=o.KANE_AJ_CURSOR_FROM?.trim()??"",_=d===""?null:J(d),l=s("KANE_AJ_CURSOR_TO"),m=l===null?null:J(l);l!==null&&m===null&&n.push("KANE_AJ_CURSOR_TO is not a cursor"),m!==null&&r.runId!==void 0&&m.run!==r.runId&&n.push("KANE_AJ_CURSOR_TO names another run than KANE_AJ_RUN_ID");let p=s("TESTMUAI_ENV"),y=p==="prod"||p==="stage";p!==null&&!y&&n.push("TESTMUAI_ENV is not prod or stage");let w=s("KANE_AJ_REPORT_URL"),R=!1;if(w!==null){let $=null;try{$=new URL(w)}catch{$=null}let S=M=>M==="localhost"||M==="127.0.0.1"||M==="[::1]",P=null;if(y)try{P=t(p)}catch{P=null}$===null||!($.protocol==="https:"||$.protocol==="http:"&&S($.hostname))?n.push("KANE_AJ_REPORT_URL is not an https address"):y?P===null?n.push("TESTMUAI_BASE_URL is not a URL, so KANE_AJ_REPORT_URL can't be checked"):$.origin!==P?n.push("KANE_AJ_REPORT_URL is not on the controller's origin"):R=!0:n.push("KANE_AJ_REPORT_URL can't be checked without a valid TESTMUAI_ENV")}let N=s("LT_USERNAME"),A=s("LT_ACCESS_KEY");if(n.length>0){let $=r.jobId!==void 0&&R&&N!==null&&A!==null?{url:w,login:{username:N,accessKey:A}}:null;return{ok:!1,identity:r,message:n.join("; "),report:$}}return{ok:!0,input:{jobId:r.jobId,attempt:r.attempt,trigger:r.trigger,explorationId:r.explorationId,runId:r.runId,cut:r.cut,projectId:h,cursorFrom:_,cursorFromUnreadable:d!==""&&_===null,cursorTo:m,reportUrl:w,env:p,login:{username:N,accessKey:A}}}}function Y(e,t){return{v:je,job_id:e.jobId??null,attempt:e.attempt??null,trigger:e.trigger??null,exploration_id:e.explorationId??null,run_id:e.runId??null,cut:e.cut??null,cursor:{from:null,to:null},status:"failed",use_cases:{added:[],modified:[]},tests:{designed:0,saved:0,updated:0,failed:[],saved_cases:[]},held:[],sessions:[],credits:null,duration_s:0,kane_cli_version:t,error:null,errors:[]}}function z(e){if(e===null||e.accessKey==="")return n=>n;let t=[e.accessKey,Buffer.from(`${e.username}:${e.accessKey}`,"utf8").toString("base64")].filter(n=>n.length>=4);return n=>t.reduce((o,s)=>o.split(s).join("[redacted]"),n)}var Q=(e,t)=>t(JSON.stringify(e));async function Z(e,t,n,o={}){let s=o.fetch??fetch,r=o.backoffMs??[1e3,2e3,4e3],u=o.sleep??(i=>new Promise(c=>setTimeout(c,i))),a=`Basic ${Buffer.from(`${n.username}:${n.accessKey}`,"utf8").toString("base64")}`;for(let i=0;i<=r.length;i++){i>0&&await u(r[i-1]);try{let c=await s(e,{method:"POST",headers:{authorization:a,"content-type":"application/json"},body:t,signal:AbortSignal.timeout(3e4)});if(c.ok)return!0;if(c.status!==429&&c.status<500)return!1}catch{}}return!1}var b=class extends Error{constructor(n,o,s){super(s);this.status=n;this.code=o}},E=(e,t)=>{throw new b("failed",e,t)};async function Ce(e,t,n,o){let s;try{s=await e.sources(t)}catch(i){if(i instanceof I&&(i.code==="NO_CONTEXT"||i.code==="NOT_FOUND"))return{source:null,cursor:null};throw i}let r=s.find(i=>i.sourceId===n&&i.head!==null)??null,u=r?.media?.format==="plugin"&&r.media.plugin?.id==="explore"?r.media.plugin.fetch:void 0,a=u?.ref===o&&typeof u.cursor=="string"?J(u.cursor):null;return{source:r,cursor:a}}async function ze(e,t,n){return n.head===null||n.completeness?.sourceCid===n.head?!1:!(await e.mainNode(t,n.head)).edgesOut.some(s=>s.type==="DERIVES"&&s.other?.label==="usecase")}async function De(e,t){let n=j("explore",t?{fetchImpl:t}:{});if(n===void 0)return E("INTERNAL","this build has no connection for the explore plugin");let o=`${H().replace(/\/+$/,"")}/exploration/${encodeURIComponent(e.explorationId)}/assurance/head?cut=${e.cut}&run=${encodeURIComponent(e.runId)}`,s;try{s=await n.request({url:o,headers:{accept:"application/json"}})}catch(a){return E("INGEST_FAILED",`the controller could not be read for exploration ${e.explorationId}: ${a instanceof Error?a.message:String(a)}`)}finally{n.close()}let r={};try{r=JSON.parse(new TextDecoder().decode(s.body))}catch{r={}}if((s.status===401||s.status===403)&&E("AUTH_FAILED",`the controller refused the job's credentials (${s.status})`),s.status===409&&r.code==="RUN_ACTIVE"&&E("RUN_ACTIVE",`a run of exploration ${e.explorationId} is in progress${typeof r.active_run=="string"?` (run ${r.active_run})`:""}: its export is read once it ends`),s.status===404&&r.code==="NO_ENDED_RUN"&&E("NO_ENDED_RUN",`exploration ${e.explorationId} has no ended run yet`),s.status===409&&r.code==="CUT_SUPERSEDED")throw new b("noop",null,"");s.status===404&&r.code==="CUT_NOT_FOUND"&&E("CUT_NOT_FOUND",`cut ${e.cut} of run ${e.runId} of exploration ${e.explorationId} was never taken`),s.status!==200&&E("INGEST_FAILED",`the controller answered ${s.status} for the head of exploration ${e.explorationId}`);let u=J(JSON.stringify(r.cursor??null));return u===null?E("INGEST_FAILED",`the controller's head of exploration ${e.explorationId} carries no cursor`):u}async function Qe(e,t){let n=j("explore",t?{fetchImpl:t}:{});if(n===void 0)return!1;try{let o={exploration:e.explorationId,run:e.runId,cut:e.cut},s=await n.request({url:he(H(),o,"export"),headers:{accept:"application/json"}});return s.status!==200?!1:me(_e(s,o)).units.length===0}catch{return!1}finally{n.close()}}function L(e){return e==="MARK_REFUSED"||e==="PERMISSION_REQUIRED"?"MARK_REFUSED":e==="PROJECT_NOT_MARKED"||e==="ASSURANCE_OFF"?"PROJECT_NOT_MARKED":null}function Pe(e){return/\(CUT_NOT_FOUND\)/.test(e)?"CUT_NOT_FOUND":/is in progress/.test(e)?"RUN_ACTIVE":/no ended run/.test(e)?"NO_ENDED_RUN":/refused (kane-cli's credentials|the credential)/.test(e)?"AUTH_FAILED":"INGEST_FAILED"}async function D(e,t){let n=e.deps.now??Date.now,o=n(),s=`[${t.verb} ${t.log.target}]`,r=t.verb==="extract"||t.verb==="reconcile"?`source ${t.log.target}`:`use case ${t.log.target}`;e.diag(`[${t.log.step}] ${t.verb} starting (${r})${t.resume!==void 0?`: resuming session ${t.resume}`:""}`);let u=[],a=m=>{for(let p of m.split(`
3
3
  `)){if(p.trim()==="")continue;let y;try{y=JSON.parse(p)}catch{e.diag(O(s,e.redact(p)));continue}u.push(y);let w;try{w=JSON.parse(e.redact(p))}catch{w=e.redact(p)}e.diag(O(s,w))}},i=m=>{for(let p of m.split(`
4
4
  `))p.trim()!==""&&e.diag(O(`${s} stderr:`,e.redact(p)))},c=ue("ndjson",t.verb,{stdout:a,stderr:i}),f=null,g=await ye({verb:t.verb,mode:"agent",choice:e.choice,basicAuth:e.basicAuth,start:t.resume!==void 0?{kind:"resume",sessionId:t.resume}:{kind:"new",body:{projectId:e.input.projectId,verb:t.verb,mode:"agent",...t.body}},run:t.run,io:c,check:e.deps.check??Ee,onProgress:()=>{},onOpened:m=>{f=m.sessionId,e.diag(`[${t.log.step}] ${t.verb} started: session ${m.sessionId} (${r})`)},...t.step?{ingest:[t.step.step]}:{},signals:!1,onRefusal:m=>{u.push({type:"error",code:m.code??null,message:m.message}),e.diag(O(s,{type:"refused",code:m.code??null,message:e.redact(m.message)}))},...e.deps.run?{testing:e.deps.run}:{}}),h=t.step?t.step.ended():null;f??=h?.sid??null,f!==null&&!e.outcome.sessions.includes(f)&&e.outcome.sessions.push(f);let d=null;for(let m of u){let p=m.credits_consumed??m.credits;typeof p=="number"&&Number.isFinite(p)&&(d=(d??0)+p)}d!==null&&(e.credits=(e.credits??0)+d);let _=n()-o;e.diag(`[${t.log.step}] ${t.verb} ended exit ${g} \xB7 ${W(_)}${d!==null?` \xB7 ${d} credits`:""}${f!==null?` \xB7 session ${f}`:" \xB7 no session opened"}`);let l={verb:t.verb,target:t.log.target,status:g===0?"ran":g===3?"paused":`exit ${g}`,tests:null,ms:_};return e.summary.push(l),{code:g,sid:f,lines:u,end:h,row:l}}function Ke(e,t,n,o,s,r){s.tests=r.tests,r.ok?s.status=s.status==="ran"?"saved":`saved (${s.status})`:s.status="save failed",e.diag(r.ok?`[${t}] ${n} saved: session ${o} \xB7 ${r.tests} test(s)`:`[${t}] ${n} NOT saved: session ${o} \xB7 ${r.message}`)}async function Me(e,t){let n=0,o="",s=null,r=new Proxy(e.person,{get(a,i,c){let f=Reflect.get(a,i,c);return i!=="land"||typeof f!="function"?f:async(...g)=>(s=await f.apply(a,g),s)}}),u=await $e({person:r,projectId:e.input.projectId,projectName:e.choice.projectName,sid:t,mode:"agent",yes:!0,confirm:async()=>!0,onProgress:a=>{let i=a;i.kind==="save"&&i.phase==="check"&&(n=i.counts?.tests??0)},emit:a=>{let i=a;i.type==="error"&&typeof i.message=="string"&&(o=i.message)},print:()=>{}});return u===0&&s!==null&&await et(e,t,s,n),u===0?{ok:!0,tests:n,message:o}:{ok:!1,tests:n,message:o||`the save of session ${t} ended with exit ${u}`}}async function F(e,t,n){let o=new Array(e.length),s=0,r=async()=>{for(;s<e.length;){let u=s++;o[u]=await n(e[u])}};return await Promise.all(Array.from({length:Math.min(t,e.length)},r)),o}function Ze(e,t){for(let n of t){let o=new Map;for(let s of ie(n)){let r=e.get(s.old);r!==void 0&&e.delete(s.old),s.new!==null&&o.set(s.new,r?.change??"updated")}for(let s of G(n)){if(s.label!=="test")continue;let r=typeof s.content.definitionId=="string"?s.content.definitionId:null;e.set(s.cid,{change:o.get(s.cid)??"added",definitionId:r})}}}async function et(e,t,n,o){let s=Array.from({length:Math.max(0,n.position-n.basePosition)},(u,a)=>n.basePosition+1+a),r;try{r=await F(s,8,u=>e.person.mainRecord(e.input.projectId,u))}catch(u){e.savedUnlisted+=o,e.diag(`assurance-job: session ${t}'s landed records couldn't be read (${u instanceof Error?u.message:String(u)}): its ${o} test(s) counted, not listed`);return}Ze(e.savedTests,r.map(u=>u.record))}async function tt(e,t,n){let{person:o}=e,s=Date.now(),r=(await o.project(t))?.mainPosition??0,u=[];for(let a=1;a<=r;a+=1){let{record:i}=await o.mainRecord(t,a);for(let c of G(i))c.label==="source"&&c.content.source_id===n&&!u.includes(c.cid)&&u.push(c.cid)}return e.diag(`assurance-job: scope walk read ${r} main position(s) in ${Date.now()-s}ms, ${u.length} version(s) of ${n}`),u}async function se(e,t,n){let o=new Set;for(let s of await tt(e,t,n)){let r=await e.person.mainNode(t,s);for(let u of r.edgesOut)u.type==="DERIVES"&&u.other?.label==="usecase"&&u.other.name&&o.add(u.other.name)}return o}async function st(e,t,n){return(await e.stale(t)).some(o=>o.label==="usecase"&&o.name!==null&&n.has(o.name))}function te(e,t){let n=null;for(let o of t){if(o.type==="extract_use_cases"&&Array.isArray(o.use_cases))for(let s of o.use_cases)typeof s.id=="string"&&!e.outcome.use_cases.added.includes(s.id)&&e.outcome.use_cases.added.push(s.id);if(o.type==="reconcile_use_cases"&&Array.isArray(o.use_cases))for(let s of o.use_cases)s.state==="new"&&typeof s.id=="string"&&!e.outcome.use_cases.added.includes(s.id)&&e.outcome.use_cases.added.push(s.id);if(o.type==="reconcile_held"&&Array.isArray(o.held))for(let s of o.held)typeof s.ref=="string"&&!e.outcome.held.some(r=>r.ref===s.ref)&&e.outcome.held.push({ref:s.ref,why:typeof s.why=="string"?s.why:""});o.type==="error"&&n===null&&(n={code:typeof o.code=="string"?o.code:"",message:typeof o.message=="string"?o.message:""})}return{error:n}}var nt=e=>`resume it with \`kane-cli design tests --resume ${e} --mode override\``,rt={connection_lost:{why:"it lost its connection to the project",resumable:!0},not_accepted:{why:"the project didn't accept a save",resumable:!0},computer_slept:{why:"its hold on the session lapsed",resumable:!0},resumed_elsewhere:{why:"the session was resumed elsewhere",resumable:!1}};function ot(e){let t=e.filter(a=>a.type==="session_paused");if(t.length===0)return null;let n=Math.max(...t.map(a=>Array.isArray(a.pending_questions)?a.pending_questions.length:0)),o=t.map(a=>typeof a.reason=="string"?rt[a.reason]:void 0).find(a=>a!==void 0);if(o!==void 0)return{questions:n,...o};let s=t.some(a=>a.crashed===!0),r=t.map(a=>a.cause?.message).find(a=>typeof a=="string"),u=s?"its agent stopped mid-turn":r!==void 0?`the model service did not answer: ${String(r)}`:"its checkpoint wasn't acknowledged in time";return{questions:n,why:u,resumable:!0}}var T=(e,t,n)=>{e.failure??={code:t,message:n},e.errors.push({code:t,message:n})},Ve=(e,t)=>e==="design"?nt(t):e==="evolve"?"resume or discard it from the project's sessions (`kane-cli context sessions`)":`resume it with \`kane-cli context extract --resume ${t} --mode override\``;function it(e,t,n,o,s){let r=e==="extract"||e==="reconcile"?"the next job reviews the source again":e==="design"?"the next job designs it again":"the next job evolves it again";switch(s){case"paused":case"running":return`${n}; session ${o} is left ${s==="paused"?"paused":"open"}: ${Ve(e,o)}`;case"discarded":return`whose run discarded session ${o}, which held nothing: ${r}`;case"saved":return`${n}; session ${o} was saved already, with nothing of this run in it`;case"failed":return`${n}; session ${o} ended failed: ${r}`;case"ready_to_save":return`${n}; session ${o} is left unsaved, ready to save with nothing in it: ${r}`;default:return`${n}; session ${o}'s state couldn't be read after it, so it is left as it is`}}var at=e=>e.scope?.position??e.basePosition;async function Ge(e,t,n){let o=t.resumeVerb??t.verb,s=n;for(let r=!1;;r=!0){let u=s.code===3&&s.sid!==null?ot(s.lines):null;if(u===null)return{go:s};let a=s.sid,i=await e.person.getSession(a).catch(()=>null),c=i===null?null:V(i),f=`[${t.step}] ${t.verb} ${t.target} paused (${u.why}; ${u.questions} question(s) pending)`;if(c==="ready_to_save"||c==="saved")return e.diag(`${f}: decision save, its session finished`),s.row.status=r?"paused, resumed, finished":"paused, finished",{go:{...s,code:0}};if(c==="failed"||c==="discarded"||c===null){e.diag(`${f}: decision fail, its session ${c===null?"unread":c}`),s.row.status="failed (paused)";let h=c==="failed"?"ended failed":c==="discarded"?"was discarded":"couldn't be read";return{failed:`${t.target}: its ${t.verb} paused (${u.why}) and its session ${a} ${h}`}}if(!r&&u.questions===0&&u.resumable){e.diag(`${f}: decision resume once`),e.diag(`assurance-job: ${t.target}: its ${t.verb} paused with no question pending (${u.why}); resumed once`),s.row.status="paused, resumed";let h=await t.resume(a);if(s={...h,sid:h.sid??a,end:h.end??s.end},s.code!==0){if(s.code===3)continue;return{go:s}}let d=await e.person.getSession(a).catch(()=>null),_=d===null?!1:ce(await de(e.person,t.projectId,a).catch(()=>({})),at(d)>d.basePosition),l=t.verb==="design"||t.verb==="evolve"||s.lines.some(y=>y.type==="session_complete"||y.type==="done");if(_&&l)return{go:s};let m=l?"which left nothing to save":"which never reached its end",p=d===null?"unread":V(d);return e.diag(`[${t.step}] ${t.verb} ${t.target} resumed once through ${o}, ${m}: decision fail, nothing saved`),s.row.status="failed (resumed, nothing to save)",{failed:`${t.target}: its ${t.verb} paused (${u.why}); resumed once through ${o}, ${it(t.verb,o,m,a,p)}`}}let g=r?u.questions>0?"paused again, with a question pending":`paused twice with no question pending (${u.why})`:u.questions>0?"paused with a question pending":`paused and was not resumed here (${u.why})`;return e.diag(`${f}: decision fail, session left paused`),s.row.status=r?"failed (paused twice)":"failed (paused)",{failed:`${t.target}: its ${t.verb} ${g}; session ${a} is left paused: ${Ve(t.verb,a)}`}}}async function Ue(e,t,n){let{input:o,person:s}=e,r=`explore://${o.explorationId}?run=${o.runId}&cut=${o.cut}`,u=fe().route(r,pe);if(u===null||u.plugin.manifest.id!=="explore")return E("INTERNAL","this build routes explore:// to no explore plugin");let a=await Ae(r,u,void 0);if("refusal"in a)return E("INGEST_FAILED",a.refusal.message);let i=a.item,c=t.source===null,f=Ie({person:s,choice:e.choice,item:i,first:c,then:c?"extract":"review",supported:"",retryMs:e.deps.run?.retryDeadlineMs??12e4,remoteDeps:ve(e.deps.run?.remoteDeps)}),g=c?"extract":"reconcile",h=c?null:await ke(s,o.projectId),d=await D(e,{verb:g,body:{sourceId:i.sourceId},run:{source:i.sourceId,override:!0},step:f,log:{step:5,target:n}}),_=te(e,d.lines),l=p=>p!==void 0&&/\(CUT_SUPERSEDED\)/.test(p);if(l(d.end?.refused?.refusal.message)||l(_.error?.message))throw d.row.status="superseded",e.diag(`[5] the cut was superseded by a later one: nothing to do here${d.sid!==null?`; session ${d.sid} discarded`:""}`),d.sid!==null&&(await s.discard(d.sid).catch(()=>{}),e.outcome.sessions=e.outcome.sessions.filter(p=>p!==d.sid)),new b("noop",null,"");if(d.end?.refused&&E(L(d.end.refused.refusal.code)??Pe(d.end.refused.refusal.message),d.end.refused.refusal.message),!c&&d.end?.added==="unchanged"&&d.end.behind===0&&!d.end.unread)return d.row.status="nothing to read",e.diag(`assurance-job: the review of ${n} found nothing to read (unchanged, no use case behind, its head read)${d.sid!==null?`; session ${d.sid} discarded`:""}`),d.sid!==null&&(await s.discard(d.sid).catch(()=>{}),e.outcome.sessions=e.outcome.sessions.filter(p=>p!==d.sid)),"unchanged";if(d.sid===null&&E(_.error?L(_.error.code)??Pe(_.error.message):"INGEST_FAILED",_.error?.message??`the ${g} opened no session (exit ${d.code})`),d.code===3){let p=await Ge(e,{verb:g,target:n,step:5,projectId:o.projectId,resumeVerb:"extract",resume:y=>D(e,{verb:"extract",body:{},run:{source:i.sourceId,override:!0},resume:y,log:{step:5,target:n}})},d);"failed"in p?E("INGEST_FAILED",p.failed):p.go!==d&&(d=p.go,_=te(e,d.lines))}d.code===3&&e.diag(`[5] ${g} ended exit 3 with no pause said: decision fail, nothing saved; session ${d.sid} left as it is`),d.code===3&&E("INGEST_FAILED",`the ${g} session ${d.sid} paused before it ended`);for(let p of d.lines)p.type!=="error"||p.code!=="DESIGN_CHILD_FAILED"||typeof p.use_case!="string"||(e.outcome.tests.failed.includes(p.use_case)||e.outcome.tests.failed.push(p.use_case),T(e,"DESIGN_FAILED",`${p.use_case}: ${typeof p.message=="string"?p.message:"its redesign failed"}`));d.code!==0&&T(e,"INGEST_FAILED",_.error?.message??`the ${g} session ${d.sid} ended with exit ${d.code}`);let m=await Me(e,d.sid);if(Ke(e,5,g,d.sid,d.row,m),!m.ok&&d.code!==0&&E("INGEST_FAILED",`the ${g} session ${d.sid} ended with exit ${d.code} before it finished: ${_.error?.message??m.message}`),m.ok||E("SAVE_FAILED",`the ${g} session ${d.sid} was not saved: ${m.message}`),e.outcome.tests.designed+=m.tests,h!==null){let p=await se(e,o.projectId,n);for(let[y,w]of await ke(s,o.projectId))p.has(y)&&h.has(y)&&h.get(y)!==w&&!e.outcome.use_cases.modified.includes(y)&&e.outcome.use_cases.modified.push(y)}return d.end?.added??null}async function ke(e,t){let n=new Map,o=[];try{o=await e.nodes(t,"usecase")}catch(s){if(s instanceof I&&(s.code==="NO_CONTEXT"||s.code==="NOT_FOUND"))return n;throw s}for(let s of o)s.name!==null&&s.trust!=="archived"&&n.set(s.name,s.cid);return n}var C=e=>`run ${e.run} (run_version ${e.run_version}, deltas ${e.deltas}${e.cut!==void 0?`, cut ${String(e.cut)}`:""})`;function ut(e,t){return v(e,t)==="unordered"?"unordered":v(e,t)==="at-or-past"&&v(t,e)==="at-or-past"}function Le(e,t,n=new Set,o=new Set){let s=r=>t.has(r.id)&&r.upToDate==="tests_out_of_date"||r.upToDate==="yes"&&n.has(r.id);return[...e.filter(r=>!t.has(r.id)&&r.upToDate==="yes"&&!n.has(r.id)).map(r=>({id:r.id,verb:o.has(r.id)?"hold":"design"})),...e.filter(s).map(r=>({id:r.id,verb:"evolve"}))]}var ee="designed, no testable scenario";async function dt(e,t){let{person:n,input:o}=e,s=new Set;if(t.length===0)return s;let r=new Set(t),u=[];try{u=await n.edges(o.projectId,"belongs_to")}catch(i){if(!(i instanceof I&&(i.code==="NO_CONTEXT"||i.code==="NOT_FOUND")))throw i}if(u.length>0){let i=new Map((await n.nodes(o.projectId,"usecase")).flatMap(f=>f.name!==null?[[f.cid,f.name]]:[])),c=[...new Set(u.map(f=>f.dst).filter(f=>!i.has(f)))];for(let[f,g]of await F(c,8,async h=>[h,await n.mainNode(o.projectId,h).catch(()=>null)]))g?.label==="usecase"&&g.name!==null&&i.set(f,g.name);for(let f of u){let g=i.get(f.dst);g!==void 0&&r.has(g)&&s.add(g)}}let a=t.filter(i=>!s.has(i));for(let[i,c]of await F(a,8,async f=>[f,await n.listSessions(o.projectId,{useCase:f})]))c.some(f=>f.verb==="design"&&f.useCase===i&&f.scope?.state==="finalized")&&s.add(i);return s}async function Fe(e,t){let n=new Set,o=async r=>(await e.mainNode(t,r)).edgesOut.find(i=>i.type==="belongs_to"&&i.other?.label==="usecase")?.other?.name??null,s;try{s=await e.stale(t)}catch(r){if(r instanceof I&&(r.code==="NO_CONTEXT"||r.code==="NOT_FOUND"))return n;throw r}for(let r of s){if(r.freshness!=="stale"||!["ac","scenario","test"].includes(r.label))continue;let u=await e.mainNode(t,r.cid),a=null;if(r.label==="scenario")a=u.edgesOut.find(i=>i.type==="belongs_to"&&i.other?.label==="usecase")?.other?.name??null;else if(r.label==="ac"){let i=u.edgesOut.find(c=>c.type==="scoped_to");i?.other?.label==="usecase"?a=i.other.name??null:i?.other?.label==="scenario"&&(a=await o(i.dst))}else if(r.label==="test"){let i=u.edgesOut.find(c=>c.type==="automates"&&c.other?.label==="scenario");i&&(a=await o(i.dst))}a!==null&&n.add(a)}return n}async function ct(e,t,n,o,s){let r=(await e.listSessions(t,{useCase:n})).filter(p=>p.verb==="evolve"&&p.useCase===n&&p.scope?.state==="finalized");if(r.length===0)return null;let u=Math.max(...r.map(p=>p.scope.position)),[a,i]=await Promise.all([e.nodes(t,"usecase"),e.nodes(t,"source")]);if((a.find(p=>p.name===n)?.position??Number.POSITIVE_INFINITY)>u)return null;let f=i.filter(p=>p.title===o).map(p=>p.position);if(f.length===0)return null;let g=Math.max(...f),h=`its last evolve landed at position ${u}`;if(g<=u)return{landedAt:u,why:`${h}; nothing it rests on has moved since; still out of date (upstream); not retried until the source moves`};if(s.cut==="end")return null;let d=f.filter(p=>p<=u);if(d.length===0)return null;let l=(await e.mainRecord(t,Math.max(...d))).record.media?.[o]?.plugin?.fetch?.cursor,m=typeof l=="string"?ge(l)?.run:void 0;return m===void 0||m!==s.runId?null:{landedAt:u,why:`${h}, while the source was of run ${m}; this run's cuts don't retry it; still out of date (upstream); retried at the run's end or in a new run`}}async function lt(e,t){let{person:n,input:o,outcome:s}=e,r=await se(e,o.projectId,t);for(let l of s.use_cases.added)r.add(l);let u=(await q(n,o.projectId,["usecase"])).filter(l=>r.has(l.id)&&l.upToDate!=="archived"),a=await Ne(n,o.projectId),i=await Fe(n,o.projectId),c=Le(u,a,i).filter(l=>l.verb==="design").map(l=>l.id),f=await dt(e,c),g=Le(u,a,i,f),h=new Map;for(let{id:l,verb:m}of g){let p=m==="evolve"?await ct(n,o.projectId,l,t,{cut:o.cut,runId:o.runId}):null;p!==null&&h.set(l,p)}let d=l=>g.filter(m=>m.verb===l&&!h.has(m.id)).map(m=>m.id).join(", ")||"none",_=[...g.filter(l=>l.verb==="hold").map(l=>`${l.id} (${ee})`),...[...h].map(([l,m])=>`${l} (${m.why})`)].join("; ")||"none";e.diag(`[6] targets: design ${d("design")} \xB7 evolve ${d("evolve")} \xB7 held ${_}`);for(let{id:l,verb:m}of g){if(m==="hold"){s.held.some(A=>A.ref===l)||s.held.push({ref:l,why:ee}),e.summary.push({verb:"design",target:l,status:"held",tests:null,ms:null}),e.diag(`[6] design ${l} held: ${ee}; no session`);continue}let p=h.get(l)??null;if(p!==null){let A=p.why;s.held.some($=>$.ref===l)||s.held.push({ref:l,why:A}),e.summary.push({verb:m,target:l,status:"held",tests:null,ms:null}),T(e,"DESIGN_FAILED",`${l}: ${A}`);continue}let y={ref:l,useCase:l,override:!0},w=m==="design"?await D(e,{verb:"design",body:{useCase:l},run:{useCase:l,allowUnreviewed:!0,override:!0},log:{step:6,target:l}}):await D(e,{verb:"evolve",body:{useCase:l},run:{ref:l,useCase:l,override:!0,answer:[`evolve:${l}=proceed`]},log:{step:6,target:l}});if(w.code===3){let A=await Ge(e,{verb:m,target:l,step:6,projectId:o.projectId,resume:$=>D(e,{verb:m,body:{},run:m==="design"?{allowUnreviewed:!0,override:!0}:y,resume:$,log:{step:6,target:l}})},w);if("failed"in A){s.tests.failed.push(l),T(e,"DESIGN_FAILED",A.failed);continue}w=A.go}let R=te(e,w.lines);if(m==="evolve"&&R.error?.code==="NOTHING_CHANGED"){w.row.status="nothing changed",e.diag(`assurance-job: ${l}: its evolve found nothing changed in its design; left as it is`),w.sid!==null&&(s.sessions=s.sessions.filter(A=>A!==w.sid));continue}if(w.code!==0||w.sid===null){w.row.status=`failed (exit ${w.code})`,s.tests.failed.push(l),T(e,"DESIGN_FAILED",`${l}: ${R.error?.message??`the ${m} ended with exit ${w.code}`}`);continue}let N=await Me(e,w.sid);if(Ke(e,6,m,w.sid,w.row,N),s.tests.designed+=N.tests,!N.ok){s.tests.failed.push(l),T(e,"SAVE_FAILED",`${l}: ${N.message}`);continue}if(m==="evolve"){let A=(await q(n,o.projectId,["usecase"])).find($=>$.id===l);A?.upToDate==="tests_out_of_date"||(await Fe(n,o.projectId)).has(l)?(w.row.status="saved, still out of date",s.tests.failed.push(l),T(e,"DESIGN_FAILED",`${l}: its evolve was saved, and its ${A?.upToDate==="tests_out_of_date"?"tests are":"design is"} still out of date`)):s.use_cases.modified.includes(l)||s.use_cases.modified.push(l)}}await pt(e)}async function ft(e,t){try{return await e.nodes(t,"test")}catch(n){if(n instanceof I&&(n.code==="NO_CONTEXT"||n.code==="NOT_FOUND"))return[];throw n}}async function pt(e){let{person:t,input:n,outcome:o}=e;if(e.savedTests.size===0)return;let s=new Map((await ft(t,n.projectId)).map(a=>[a.cid,a])),r=[...e.savedTests].flatMap(([a,i])=>{let c=s.get(a)?.name??null;return c!==null?[{cid:a,name:c,...i}]:[]}),u=await F(r,8,async a=>{try{let i=a.definitionId??String((await t.mainNode(n.projectId,a.cid)).content.definitionId??""),c=await t.testCase(n.projectId,a.name,i);return"linked"in c?{test:a.name,change:a.change,case_id:c.linked.caseId,tc:c.linked.internalId,refused:null}:{test:a.name,change:a.change,case_id:null,tc:null,refused:c.refused.code??"REFUSED"}}catch(i){return{test:a.name,change:a.change,case_id:null,tc:null,refused:i instanceof I?i.code:"UNREAD"}}});o.tests.saved_cases.push(...u)}function gt(e,t){return new URL(ne(e,t).controllerBaseUrl).origin}async function Wt(e={}){let t=e.env??process.env,n=e.out??(d=>{process.stdout.write(`${d}
5
5
  `)}),o=e.now??Date.now,s=o(),r=Je(t,d=>gt(d,t));if(!r.ok){let d=Y(r.identity,x);d.status="failed",d.error={code:"INPUT_INVALID",message:r.message},d.errors=[d.error];let _=typeof t.LT_ACCESS_KEY=="string"&&t.LT_ACCESS_KEY!==""?{username:t.LT_USERNAME??"",accessKey:t.LT_ACCESS_KEY}:null,l=Q(d,z(_));return r.report!==null&&(await Z(r.report.url,l,r.report.login,e.post)||(e.diag??(p=>{process.stderr.write(`${p}
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-M6MBMRFR.js";import"./chunk-N3TCNZSX.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";export{b as ensureHyperexecuteBinary,a as hyperexecuteDownloadUrl};
2
+ import{a,b}from"./chunk-W4QSZNMB.js";import"./chunk-M43WH5DQ.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{b as ensureHyperexecuteBinary,a as hyperexecuteDownloadUrl};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b}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"./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-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{b as designTestsCommand,a as normalizeOpts};
2
+ import{a,b}from"./chunk-QDXKEOKI.js";import"./chunk-MEKPGQAM.js";import"./chunk-DZOYYWOW.js";import"./chunk-VXGN3IV7.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-MNBGG4H3.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.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-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{b as designTestsCommand,a as normalizeOpts};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as a,d as b,e as c,f as d}from"./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";export{d as telemetryBootstrap,c as telemetryEnabled,b as telemetryEnvName,a as telemetryProxyUrl};
2
+ import{c as a,d as b,e as c,f as d}from"./chunk-DJC7NTLA.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-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{d as telemetryBootstrap,c as telemetryEnabled,b as telemetryEnvName,a as telemetryProxyUrl};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{f as a,g as b,h as c,i as d,j as e,k as f,l as g}from"./chunk-NFRA64NU.js";import"./chunk-MGNRNLBE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-XBEYWXPV.js";import"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";export{a as ANY_REAL_DEVICE,g as checkRealDevice,c as fetchRealDeviceCatalog,e as isAnyRealDevice,f as matchRealDevice,d as osMajorOf,b as parseRealDeviceCatalog};
2
+ import{f as a,g as b,h as c,i as d,j as e,k as f,l as g}from"./chunk-W6HZF56M.js";import"./chunk-C2RUDJ46.js";import"./chunk-RZ4F3BHX.js";import"./chunk-HJMCXSUJ.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{a as ANY_REAL_DEVICE,g as checkRealDevice,c as fetchRealDeviceCatalog,e as isAnyRealDevice,f as matchRealDevice,d as osMajorOf,b as parseRealDeviceCatalog};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as l}from"./chunk-RZ4F3BHX.js";import{b as i,f as c}from"./chunk-I6OQISK4.js";import"./chunk-UR6MHSHU.js";import{readFileSync as u,writeFileSync as g,mkdirSync as d}from"fs";import{join as f}from"path";var h=f(i,"changelog-cache.json"),p=3600*1e3;function y(){try{let e=JSON.parse(u(h,"utf-8"));if(Date.now()-e.cachedAt<p)return e}catch{}return null}function m(e){try{d(i,{recursive:!0}),g(h,JSON.stringify({entries:e,cachedAt:Date.now()}))}catch{}}async function A(e){try{let t=y();if(t){let r=t.entries;return e?.all?r:r.slice(0,5)}let n=new AbortController,o=setTimeout(()=>n.abort(),5e3),a=await l(`${c}?per_page=30`,{headers:{Accept:"application/vnd.github+json"},signal:n.signal});if(clearTimeout(o),!a.ok)return[];let s=(await a.json()).map(r=>({version:r.tag_name.replace(/^v/,""),date:r.published_at?r.published_at.slice(0,10):"",body:r.body??""}));return m(s),e?.all?s:s.slice(0,5)}catch{return[]}}function v(e){if(e.length===0)return"Could not fetch changelog. Visit https://github.com/LambdaTest/kane-cli/releases";let t=["kane-cli Changelog","\u2500".repeat(40),""];for(let n of e){if(t.push(`v${n.version} (${n.date})`),n.body){let o=n.body.split(`
2
+ import{a as l}from"./chunk-RZ4F3BHX.js";import{b as i,f as c}from"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";import{readFileSync as u,writeFileSync as g,mkdirSync as d}from"fs";import{join as f}from"path";var h=f(i,"changelog-cache.json"),p=3600*1e3;function y(){try{let e=JSON.parse(u(h,"utf-8"));if(Date.now()-e.cachedAt<p)return e}catch{}return null}function m(e){try{d(i,{recursive:!0}),g(h,JSON.stringify({entries:e,cachedAt:Date.now()}))}catch{}}async function A(e){try{let t=y();if(t){let r=t.entries;return e?.all?r:r.slice(0,5)}let n=new AbortController,o=setTimeout(()=>n.abort(),5e3),a=await l(`${c}?per_page=30`,{headers:{Accept:"application/vnd.github+json"},signal:n.signal});if(clearTimeout(o),!a.ok)return[];let s=(await a.json()).map(r=>({version:r.tag_name.replace(/^v/,""),date:r.published_at?r.published_at.slice(0,10):"",body:r.body??""}));return m(s),e?.all?s:s.slice(0,5)}catch{return[]}}function v(e){if(e.length===0)return"Could not fetch changelog. Visit https://github.com/LambdaTest/kane-cli/releases";let t=["kane-cli Changelog","\u2500".repeat(40),""];for(let n of e){if(t.push(`v${n.version} (${n.date})`),n.body){let o=n.body.split(`
3
3
  `).filter(a=>a.trim());for(let a of o)t.push(` ${a}`)}t.push("")}return t.join(`
4
4
  `)}export{A as fetchChangelog,v as formatChangelog};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as _}from"./chunk-BVO4C5F2.js";import{a as A}from"./chunk-OAKYUBD3.js";import{a as i}from"./chunk-XZYA7DNH.js";import{a as h}from"./chunk-MGNRNLBE.js";async function w(d){let{creds:a,env:l,usernameFlag:c,accessKeyFlag:u,log:r}=d,e=null,o=null;if(c&&u)e={username:c,access_key:u},r("info","AUTH_RESOLVE_FLAGS","Auth resolved via CLI flags",{username:c});else{let s=a.resolveAuth();s?.method==="basic"&&(e={username:s.username,access_key:s.access_key},r("info","AUTH_RESOLVE_CONFIG","Auth resolved via config",{username:s.username}))}if(!e){let{credentials:s,profile:k}=a.getActiveCredentials();if(!s)throw new i("Not authenticated \u2014 no credentials found","not_authenticated");if(o=s.access_token,s.expires_at-Date.now()/1e3<300)try{let n=await A({creds:a,profile:k,env:l,credentials:s});n&&(o=n.accessToken,r("info","AUTH_TOKEN_REFRESHED","OAuth token refreshed"))}catch(n){let m=n instanceof Error?n.message:String(n);throw r("error","TOKEN_REFRESH_FAILED","Token refresh failed",{error:m}),new i(`Token refresh failed: ${m}`,"refresh_failed")}}let v=h(l),E=async()=>o,g=e?{username:e.username,access_key:e.access_key}:null,f=new _(v.controllerBaseUrl,E,g,r),t=await f.resolve();return t&&!e&&(e={username:t.username,access_key:t.access_key},r("info","AUTH_RESOLVE_CONTROLLER","Auth resolved via controller",{username:t.username})),{basicAuth:e,token:o,resolver:f,resolvedCreds:t}}export{w as a};
2
+ import{a as _}from"./chunk-V7USCQWO.js";import{a as A}from"./chunk-SGPAM5DZ.js";import{a as i}from"./chunk-XZYA7DNH.js";import{a as h}from"./chunk-C2RUDJ46.js";async function w(d){let{creds:a,env:l,usernameFlag:c,accessKeyFlag:u,log:r}=d,e=null,o=null;if(c&&u)e={username:c,access_key:u},r("info","AUTH_RESOLVE_FLAGS","Auth resolved via CLI flags",{username:c});else{let s=a.resolveAuth();s?.method==="basic"&&(e={username:s.username,access_key:s.access_key},r("info","AUTH_RESOLVE_CONFIG","Auth resolved via config",{username:s.username}))}if(!e){let{credentials:s,profile:k}=a.getActiveCredentials();if(!s)throw new i("Not authenticated \u2014 no credentials found","not_authenticated");if(o=s.access_token,s.expires_at-Date.now()/1e3<300)try{let n=await A({creds:a,profile:k,env:l,credentials:s});n&&(o=n.accessToken,r("info","AUTH_TOKEN_REFRESHED","OAuth token refreshed"))}catch(n){let m=n instanceof Error?n.message:String(n);throw r("error","TOKEN_REFRESH_FAILED","Token refresh failed",{error:m}),new i(`Token refresh failed: ${m}`,"refresh_failed")}}let v=h(l),E=async()=>o,g=e?{username:e.username,access_key:e.access_key}:null,f=new _(v.controllerBaseUrl,E,g,r),t=await f.resolve();return t&&!e&&(e={username:t.username,access_key:t.access_key},r("info","AUTH_RESOLVE_CONTROLLER","Auth resolved via controller",{username:t.username})),{basicAuth:e,token:o,resolver:f,resolvedCreds:t}}export{w as a};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as $}from"./chunk-MMBBQ4OZ.js";import{j as h}from"./chunk-D4FFXCX6.js";import{a as w}from"./chunk-RZ4F3BHX.js";import{b as v}from"./chunk-I6OQISK4.js";import{spawn as V,spawnSync as _}from"child_process";import{createServer as K}from"net";import{mkdirSync as g,openSync as W,readFileSync as I,renameSync as j,rmSync as x,statSync as Y,writeFileSync as M}from"fs";import{readFile as q}from"fs/promises";import{dirname as l,join as y}from"path";var G=[4723,4724,4725,4726,4727,4728,4729,4730],X={emulator:4750,simulator:4790},z=40,E=2e3,D=3e4,T=500,Ce=["emulator","simulator"];function Q(e){return y(v,"mobile",`appium-server-${e}.log`)}function m(){return y(v,"mobile","appium-servers.json")}function Z(){return y(v,"mobile","appium-servers.lock")}var ee=1e4,re=50;function C(e){let r=Z();try{g(l(r),{recursive:!0})}catch{return e()}let n=!1;for(let o=0;o<re;o++)try{g(r),n=!0;break}catch{try{Date.now()-Y(r).mtimeMs>ee&&x(r,{recursive:!0,force:!0})}catch{}ne(10)}try{return e()}finally{if(n)try{x(r,{recursive:!0,force:!0})}catch{}}}function ne(e){try{Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)}catch{}}function te(){try{let e=JSON.parse(I(m(),"utf8"));return Array.isArray(e)?e:[]}catch{return[]}}function oe(e){let r=m();g(l(r),{recursive:!0});let n=`${r}.tmp`;M(n,JSON.stringify(e,null,2)),j(n,r)}function se(e,r,n){return`Another mobile session is already running${n?` on ${n}`:""}. Wait for it to finish, or close the terminal running it.`}var A=class extends Error{constructor(n,o){super(n);this.port=o;this.name="DeviceBusyError"}};function ie(e){return w(e,{signal:AbortSignal.timeout(E)}).then(r=>r.ok,()=>!1)}async function ae(e,r){try{return(await w(`http://127.0.0.1:${e}/session/${r}`,{method:"DELETE",signal:AbortSignal.timeout(E)})).ok}catch{return!1}}function R(e){let r=e?.value;return Array.isArray(r)?r.map(n=>{let o=n??{},t=o.capabilities??o;return{...typeof o.id=="string"?{id:o.id}:{},caps:t}}):[]}async function ue(e){try{let r=await w(`http://127.0.0.1:${e}/sessions`,{signal:AbortSignal.timeout(E)});return r.ok?R(await r.json()):[]}catch{return[]}}var ce=["udid","appium:udid","deviceUDID","appium:deviceUDID","deviceName","appium:deviceName"];function L(){let e=r=>{try{let n=_("curl",["-s","--noproxy","*","--max-time","2",...r],{encoding:"utf8",timeout:5e3});return{ok:n.status===0,stdout:n.stdout??""}}catch{return{ok:!1,stdout:""}}};return{readState:()=>{try{let r=JSON.parse(I(m(),"utf8"));return Array.isArray(r)?r:[]}catch{return[]}},alive:b,getJson:r=>{let n=e([r]);if(n.ok)try{return JSON.parse(n.stdout)}catch{return}},del:r=>{let n=e(["-o","/dev/null","-w","%{http_code}","-X","DELETE",r]);return n.ok&&/^2\d\d$/.test(n.stdout.trim())}}}function Le(e,r={}){let n={...L(),...r},o=0;try{for(let t of n.readState()){if(!n.alive(t.pid))continue;let i=R(n.getJson(`http://127.0.0.1:${t.port}/sessions`));for(let s of i)s.id&&de(s.caps,e.udid,e.displayName)&&n.del(`http://127.0.0.1:${t.port}/session/${s.id}`)&&(o+=1)}}catch{}return o}function de(e,r,n){let o=[r,n].filter(t=>!!t).map(t=>t.toLowerCase());for(let t of ce){let i=e[t];if(typeof i=="string"&&o.includes(i.toLowerCase()))return!0}return!1}function pe(e,r,n){let o=W(n.logPath,"a"),t=V(e,r,{stdio:["ignore",o,o],detached:!0,env:{...process.env,...n.env}});return t.unref(),t.pid}async function le(e,r){for(let n=e;n<e+r;n++)if(await new Promise(t=>{let i=K();i.once("error",()=>t(!1)),i.once("listening",()=>i.close(()=>t(!0))),i.listen(n)}))return n;throw new Error(`No free port for the managed Appium server in ${e}-${e+r-1}.`)}function b(e){try{return process.kill(e,0),!0}catch{return!1}}function P(e){try{let r=_("ps",["-o","comm=","-p",String(e)],{encoding:"utf8",timeout:2e3});if(r.status!==0)return!1;let n=r.stdout.trim().toLowerCase();return n===""?!0:n.includes("node")||n.includes("kane")}catch{return!0}}function k(e){try{process.kill(e)}catch{}}async function me(){try{let e=JSON.parse(await q(m(),"utf8"));return Array.isArray(e)?e:[]}catch{return[]}}async function fe(e){let r=process.pid,n=e.filter(o=>o.owner===r);C(()=>{let o=[];for(let t of te())t.owner!==r&&(Se(t)?o.push(t):b(t.pid)&&k(t.pid));oe([...o,...n])})}function Se(e){return e.owner===void 0?!1:b(e.owner)&&P(e.owner)}function ve(){return{probe:ie,sessions:ue,deleteSession:ae,spawn:pe,freePort:le,alive:b,kill:k,readState:me,writeState:fe,owner:process.pid,depsEnv:e=>h().environment(e),bundleVersion:async e=>(await h().status(e)).version,nodeBinary:process.execPath,env:process.env,os:process.platform,now:()=>Date.now(),sleep:e=>new Promise(r=>setTimeout(r,e))}}function we(e,r,n){if(!e.platformToolsDir)return{};let o=n==="win32"?";":":",t=$(r),i=t?.root??l(e.platformToolsDir),s=t?.platformToolsDir??e.platformToolsDir;return{ANDROID_HOME:i,ANDROID_SDK_ROOT:i,PATH:r.PATH?`${s}${o}${r.PATH}`:s}}async function ge(e){let r=await e.readState(),n=[],o=[];for(let t of r)t.owner!==void 0&&e.alive(t.owner)&&(e.ownerIsOurs??P)(t.owner)?n.push(t):o.push(t);for(let t of o){let i=e.ownerIsOurs??P;e.alive(t.pid)&&i(t.pid)&&e.kill(t.pid)}return o.length>0&&await e.writeState(n),n}async function Je(e,r={}){if(r.appiumUrl)return{result:"external",url:r.appiumUrl};let n={...ve(),...r.deps},o=await ge(n),t=o.filter(a=>a.owner===n.owner),i=new Set(t.map(a=>a.port)),s=new Set(o.map(a=>a.port));if(r.device){let a=await ye(n,s,i,e);if(a!==null)throw new A(se(r.device,a.port,a.device),a.port)}let c=await n.bundleVersion(e),u=t.find(a=>a.deviceClass===e&&(a.bundleVersion??c)===c);if(u&&await n.probe(`http://127.0.0.1:${u.port}/status`))return{result:"reused",url:`http://127.0.0.1:${u.port}`};for(let a of t.filter(S=>S.deviceClass===e&&S!==u))n.kill(a.pid);u&&n.kill(u.pid);let d=await n.depsEnv(e);if(!d.appiumHome)throw new Error(`The managed dependencies for the ${e} class are not installed.
2
+ import{a as $}from"./chunk-MMBBQ4OZ.js";import{j as h}from"./chunk-XRNQSXOM.js";import{a as w}from"./chunk-RZ4F3BHX.js";import{b as v}from"./chunk-D36V5OX6.js";import{spawn as V,spawnSync as _}from"child_process";import{createServer as K}from"net";import{mkdirSync as g,openSync as W,readFileSync as I,renameSync as j,rmSync as x,statSync as Y,writeFileSync as M}from"fs";import{readFile as q}from"fs/promises";import{dirname as l,join as y}from"path";var G=[4723,4724,4725,4726,4727,4728,4729,4730],X={emulator:4750,simulator:4790},z=40,E=2e3,D=3e4,T=500,Ce=["emulator","simulator"];function Q(e){return y(v,"mobile",`appium-server-${e}.log`)}function m(){return y(v,"mobile","appium-servers.json")}function Z(){return y(v,"mobile","appium-servers.lock")}var ee=1e4,re=50;function C(e){let r=Z();try{g(l(r),{recursive:!0})}catch{return e()}let n=!1;for(let o=0;o<re;o++)try{g(r),n=!0;break}catch{try{Date.now()-Y(r).mtimeMs>ee&&x(r,{recursive:!0,force:!0})}catch{}ne(10)}try{return e()}finally{if(n)try{x(r,{recursive:!0,force:!0})}catch{}}}function ne(e){try{Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)}catch{}}function te(){try{let e=JSON.parse(I(m(),"utf8"));return Array.isArray(e)?e:[]}catch{return[]}}function oe(e){let r=m();g(l(r),{recursive:!0});let n=`${r}.tmp`;M(n,JSON.stringify(e,null,2)),j(n,r)}function se(e,r,n){return`Another mobile session is already running${n?` on ${n}`:""}. Wait for it to finish, or close the terminal running it.`}var A=class extends Error{constructor(n,o){super(n);this.port=o;this.name="DeviceBusyError"}};function ie(e){return w(e,{signal:AbortSignal.timeout(E)}).then(r=>r.ok,()=>!1)}async function ae(e,r){try{return(await w(`http://127.0.0.1:${e}/session/${r}`,{method:"DELETE",signal:AbortSignal.timeout(E)})).ok}catch{return!1}}function R(e){let r=e?.value;return Array.isArray(r)?r.map(n=>{let o=n??{},t=o.capabilities??o;return{...typeof o.id=="string"?{id:o.id}:{},caps:t}}):[]}async function ue(e){try{let r=await w(`http://127.0.0.1:${e}/sessions`,{signal:AbortSignal.timeout(E)});return r.ok?R(await r.json()):[]}catch{return[]}}var ce=["udid","appium:udid","deviceUDID","appium:deviceUDID","deviceName","appium:deviceName"];function L(){let e=r=>{try{let n=_("curl",["-s","--noproxy","*","--max-time","2",...r],{encoding:"utf8",timeout:5e3});return{ok:n.status===0,stdout:n.stdout??""}}catch{return{ok:!1,stdout:""}}};return{readState:()=>{try{let r=JSON.parse(I(m(),"utf8"));return Array.isArray(r)?r:[]}catch{return[]}},alive:b,getJson:r=>{let n=e([r]);if(n.ok)try{return JSON.parse(n.stdout)}catch{return}},del:r=>{let n=e(["-o","/dev/null","-w","%{http_code}","-X","DELETE",r]);return n.ok&&/^2\d\d$/.test(n.stdout.trim())}}}function Le(e,r={}){let n={...L(),...r},o=0;try{for(let t of n.readState()){if(!n.alive(t.pid))continue;let i=R(n.getJson(`http://127.0.0.1:${t.port}/sessions`));for(let s of i)s.id&&de(s.caps,e.udid,e.displayName)&&n.del(`http://127.0.0.1:${t.port}/session/${s.id}`)&&(o+=1)}}catch{}return o}function de(e,r,n){let o=[r,n].filter(t=>!!t).map(t=>t.toLowerCase());for(let t of ce){let i=e[t];if(typeof i=="string"&&o.includes(i.toLowerCase()))return!0}return!1}function pe(e,r,n){let o=W(n.logPath,"a"),t=V(e,r,{stdio:["ignore",o,o],detached:!0,env:{...process.env,...n.env}});return t.unref(),t.pid}async function le(e,r){for(let n=e;n<e+r;n++)if(await new Promise(t=>{let i=K();i.once("error",()=>t(!1)),i.once("listening",()=>i.close(()=>t(!0))),i.listen(n)}))return n;throw new Error(`No free port for the managed Appium server in ${e}-${e+r-1}.`)}function b(e){try{return process.kill(e,0),!0}catch{return!1}}function P(e){try{let r=_("ps",["-o","comm=","-p",String(e)],{encoding:"utf8",timeout:2e3});if(r.status!==0)return!1;let n=r.stdout.trim().toLowerCase();return n===""?!0:n.includes("node")||n.includes("kane")}catch{return!0}}function k(e){try{process.kill(e)}catch{}}async function me(){try{let e=JSON.parse(await q(m(),"utf8"));return Array.isArray(e)?e:[]}catch{return[]}}async function fe(e){let r=process.pid,n=e.filter(o=>o.owner===r);C(()=>{let o=[];for(let t of te())t.owner!==r&&(Se(t)?o.push(t):b(t.pid)&&k(t.pid));oe([...o,...n])})}function Se(e){return e.owner===void 0?!1:b(e.owner)&&P(e.owner)}function ve(){return{probe:ie,sessions:ue,deleteSession:ae,spawn:pe,freePort:le,alive:b,kill:k,readState:me,writeState:fe,owner:process.pid,depsEnv:e=>h().environment(e),bundleVersion:async e=>(await h().status(e)).version,nodeBinary:process.execPath,env:process.env,os:process.platform,now:()=>Date.now(),sleep:e=>new Promise(r=>setTimeout(r,e))}}function we(e,r,n){if(!e.platformToolsDir)return{};let o=n==="win32"?";":":",t=$(r),i=t?.root??l(e.platformToolsDir),s=t?.platformToolsDir??e.platformToolsDir;return{ANDROID_HOME:i,ANDROID_SDK_ROOT:i,PATH:r.PATH?`${s}${o}${r.PATH}`:s}}async function ge(e){let r=await e.readState(),n=[],o=[];for(let t of r)t.owner!==void 0&&e.alive(t.owner)&&(e.ownerIsOurs??P)(t.owner)?n.push(t):o.push(t);for(let t of o){let i=e.ownerIsOurs??P;e.alive(t.pid)&&i(t.pid)&&e.kill(t.pid)}return o.length>0&&await e.writeState(n),n}async function Je(e,r={}){if(r.appiumUrl)return{result:"external",url:r.appiumUrl};let n={...ve(),...r.deps},o=await ge(n),t=o.filter(a=>a.owner===n.owner),i=new Set(t.map(a=>a.port)),s=new Set(o.map(a=>a.port));if(r.device){let a=await ye(n,s,i,e);if(a!==null)throw new A(se(r.device,a.port,a.device),a.port)}let c=await n.bundleVersion(e),u=t.find(a=>a.deviceClass===e&&(a.bundleVersion??c)===c);if(u&&await n.probe(`http://127.0.0.1:${u.port}/status`))return{result:"reused",url:`http://127.0.0.1:${u.port}`};for(let a of t.filter(S=>S.deviceClass===e&&S!==u))n.kill(a.pid);u&&n.kill(u.pid);let d=await n.depsEnv(e);if(!d.appiumHome)throw new Error(`The managed dependencies for the ${e} class are not installed.
3
3
  Run \`kane-cli doctor --target ${e} --install\` to install them, or pass --appium-url for an external server.`);let p=await n.freePort(X[e],z),O=`http://127.0.0.1:${p}`,J=l(d.appiumHome),U=y(J,"appium","node_modules","appium","index.js"),N=Q(e);r.onProgress?.(`starting the managed Appium server (${e}, port ${p})\u2026`);let f=n.spawn(n.nodeBinary,[U,"--port",String(p),"--allow-insecure=uiautomator2:adb_shell"],{env:{APPIUM_HOME:d.appiumHome,...we(d,n.env,n.os)},logPath:N}),B=n.now()+D,F=Math.ceil(D/T)+1;for(let a=0;a<F&&n.now()<B;a++)if(await n.sleep(T),await n.probe(`${O}/status`)){if(f!==void 0){let S=t.filter(H=>H.deviceClass!==e);await n.writeState([...S,{port:p,pid:f,owner:n.owner,deviceClass:e,...c?{bundleVersion:c}:{},startedAt:new Date(n.now()).toISOString()}])}return r.onProgress?.("Appium server ready"),{result:"started",url:O}}throw f!==void 0&&n.kill(f),new Error(`The managed Appium server (${e}) did not answer on ${p} within ${D/1e3}s.
4
4
  Check its log: ${N}`)}async function ye(e,r=[],n=[],o){let t=new Set(n),i=new Set([...G,...r]);for(let s of i)if(!t.has(s))for(let c of await e.sessions(s)){if(!c.id)continue;if(o){let d=be(c.caps);if(d&&d!==o)continue}let u=De(c.caps);return{port:s,...u?{device:u}:{}}}return null}function be(e){let r=t=>{let i=e[t];return typeof i=="string"?i.toLowerCase():""},n=r("platformName")||r("appium:platformName");if(n.includes("ios"))return"simulator";if(n.includes("android"))return"emulator";let o=r("appium:automationName")||r("automationName");if(o.includes("xcuitest"))return"simulator";if(o.includes("uiautomator"))return"emulator"}var he=["appium:deviceName","deviceName","appium:udid","udid","appium:deviceUDID","deviceUDID"];function De(e){for(let r of he){let n=e[r];if(typeof n=="string"&&n.trim())return n}}function Ue(e={}){let r={...L(),kill:k,writeState:Ae,...e.deps};try{let n=r.readState(),o=e.owner??process.pid,t=n.filter(s=>s.owner===o&&(!e.deviceClass||s.deviceClass===e.deviceClass));for(let s of t){if(!r.alive(s.pid))continue;let c=R(r.getJson(`http://127.0.0.1:${s.port}/sessions`));for(let u of c)u.id&&r.del(`http://127.0.0.1:${s.port}/session/${u.id}`);r.kill(s.pid)}let i=new Set(t.map(s=>`${s.port}:${s.pid}`));C(()=>{r.writeState(r.readState().filter(s=>!i.has(`${s.port}:${s.pid}`)))})}catch{}}function Ae(e){try{let r=m();g(l(r),{recursive:!0}),M(r,JSON.stringify(e,null,2))}catch{}}export{Ce as a,Q as b,se as c,Le as d,ve as e,Je as f,ye as g,Ue as h};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as v}from"./chunk-34R7BNZ2.js";import{a as S}from"./chunk-QSCXXNC2.js";import{n as g}from"./chunk-NC7D7GOM.js";import{a as u,b as d}from"./chunk-I6OQISK4.js";import{existsSync as P}from"fs";import{join as T}from"path";import{mkdirSync as b,rmSync as h,writeFileSync as k}from"fs";import{join as E,resolve as A}from"path";import{join as w}from"path";function m(){return process.env.KANE_CLI_WIRE_BASE_DIR||d}function J(e){return w(m(),"sessions",`testrun-${e}`)}function y(e=m()){return E(e,"sessions","active")}function _(e,r){return E(y(r),`${e}.json`)}function x(e){let r=e.pid??process.pid,n=_(r,e.baseDir);try{b(y(e.baseDir),{recursive:!0}),k(n,JSON.stringify({pid:r,cwd:process.cwd(),surface:e.surface,session_dir:A(e.sessionDir),started:new Date().toISOString(),cli_version:u,host_agent:S()},null,2)+`
2
+ import{b as v}from"./chunk-34R7BNZ2.js";import{a as S}from"./chunk-QSCXXNC2.js";import{n as g}from"./chunk-NC7D7GOM.js";import{a as u,b as d}from"./chunk-D36V5OX6.js";import{existsSync as P}from"fs";import{join as T}from"path";import{mkdirSync as b,rmSync as h,writeFileSync as k}from"fs";import{join as E,resolve as A}from"path";import{join as w}from"path";function m(){return process.env.KANE_CLI_WIRE_BASE_DIR||d}function J(e){return w(m(),"sessions",`testrun-${e}`)}function y(e=m()){return E(e,"sessions","active")}function _(e,r){return E(y(r),`${e}.json`)}function x(e){let r=e.pid??process.pid,n=_(r,e.baseDir);try{b(y(e.baseDir),{recursive:!0}),k(n,JSON.stringify({pid:r,cwd:process.cwd(),surface:e.surface,session_dir:A(e.sessionDir),started:new Date().toISOString(),cli_version:u,host_agent:S()},null,2)+`
3
3
  `)}catch{}return n}function f(e=process.pid,r){try{h(_(e,r),{force:!0})}catch{}}var R={run:"run_end",testmd:"test_md_done",testrun:"testrun_done",explore:"done"};import{appendFileSync as I,mkdirSync as N}from"fs";import{dirname as O}from"path";function D(e){let r=!1;return{path:e,append(n){try{r||(N(O(e),{recursive:!0}),r=!0),I(e,n+`
4
4
  `)}catch{}}}}function W(e,r=()=>new Date){let{v:n,ts:c,...i}=e;return{...i,v:1,ts:typeof c=="string"?c:r().toISOString()}}function V(e){let r=e.stdout??(t=>{process.stdout.write(t)}),n=R[e.surface],c=!1,i=null,o=null,p=[],l=()=>{if(!(o||!i||!P(i))){o=D(T(i,"events.ndjson"));for(let t of p)o.append(t);p=[];try{e.onAttach?.(i)}catch{}}};return{emit(t){if(c)return;let a=v(JSON.stringify(W(t,e.now)));r(a+`
5
5
  `),l(),o?o.append(a):p.push(a),t.type===n&&(c=!0,p=[])},attachSessionDir(t){i=t,l()},setTerminal(t){n=t},get logPath(){return o?o.path:null}}}var s=null;function j(e){return r=>{x({surface:e,sessionDir:r}),g("wire-active-run",()=>f()),process.once("exit",()=>f())}}function se(e,r){return s=V({surface:e,cliVersion:u,onAttach:r??j(e)}),s.emit({type:"stream_start",cli_version:u,surface:e,pid:process.pid}),s}function ce(){return s}function ue(e){if(s){s.emit(e);return}process.stdout.write(JSON.stringify(W(e))+`
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{i as n}from"./chunk-XMPTFXPW.js";import{a,b as l}from"./chunk-SWMTXMKB.js";import{a as s}from"./chunk-XZYA7DNH.js";import{Ha as t,f as o}from"./chunk-W3OVSDBN.js";import{a as i}from"./chunk-4QTH7VYE.js";var d=null;function m(){return d??=a()}function w(){d=null}var x={...l,controller:m},c=e=>new n("CREDENTIALS_MISSING",e.message,e.remedy);async function u(){let e;try{e=await m()}catch(r){throw r instanceof s?c(t.credentialsMissing()):r}if(!e.basic)throw c(e.token?t.loginUnconfirmed():t.credentialsMissing());return e.basic}async function f(){let e=await u();return i(e.username,e.accessKey)}function R(e){return{project:async r=>o({url:e,basicAuth:await f()}).project(r)}}export{m as a,w as b,x as c,u as d,f as e,R as f};
2
+ import{i as n}from"./chunk-XMPTFXPW.js";import{a,b as l}from"./chunk-RF37IJNN.js";import{a as s}from"./chunk-XZYA7DNH.js";import{Ha as t,f as o}from"./chunk-7HMSMAUG.js";import{a as i}from"./chunk-4QTH7VYE.js";var d=null;function m(){return d??=a()}function w(){d=null}var x={...l,controller:m},c=e=>new n("CREDENTIALS_MISSING",e.message,e.remedy);async function u(){let e;try{e=await m()}catch(r){throw r instanceof s?c(t.credentialsMissing()):r}if(!e.basic)throw c(e.token?t.loginUnconfirmed():t.credentialsMissing());return e.basic}async function f(){let e=await u();return i(e.username,e.accessKey)}function R(e){return{project:async r=>o({url:e,basicAuth:await f()}).project(r)}}export{m as a,w as b,x as c,u as d,f as e,R as f};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as m}from"./chunk-HCBYKLMW.js";import{a as o,b as i}from"./chunk-33DWJV67.js";import{y as e}from"./chunk-I6OQISK4.js";import{e as d}from"./chunk-UR6MHSHU.js";var r=d(m(),1),s={default:e.muted,error:e.red,success:e.green,info:e.orange,warning:e.orange};function h({title:t,titleColor:a,borderColor:l,variant:n="default",children:c,width:u,paddingX:x=2,paddingY:g=0,marginBottom:f=0}){let p=l??s[n],B=a??(n==="default"?e.orange:s[n]);return(0,r.jsxs)(o,{flexDirection:"column",marginBottom:f,children:[t&&(0,r.jsx)(o,{marginBottom:0,children:(0,r.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,r.jsx)(o,{borderStyle:"round",borderColor:p,flexDirection:"column",paddingX:x,paddingY:g,width:u,children:c})]})}function k({label:t,value:a,labelColor:l=e.dim,valueColor:n,labelWidth:c=14}){return(0,r.jsxs)(o,{children:[(0,r.jsx)(o,{width:c,flexShrink:0,children:(0,r.jsx)(i,{color:l,children:t})}),(0,r.jsx)(o,{flexShrink:1,children:(0,r.jsx)(i,{color:n,wrap:"wrap",children:a})})]})}function I({label:t}){return(0,r.jsx)(o,{marginTop:1,marginBottom:0,children:(0,r.jsx)(i,{bold:!0,children:t})})}export{h as a,k as b,I as c};
2
+ import{a as m}from"./chunk-HCBYKLMW.js";import{a as o,b as i}from"./chunk-33DWJV67.js";import{y as e}from"./chunk-D36V5OX6.js";import{e as d}from"./chunk-UR6MHSHU.js";var r=d(m(),1),s={default:e.muted,error:e.red,success:e.green,info:e.orange,warning:e.orange};function h({title:t,titleColor:a,borderColor:l,variant:n="default",children:c,width:u,paddingX:x=2,paddingY:g=0,marginBottom:f=0}){let p=l??s[n],B=a??(n==="default"?e.orange:s[n]);return(0,r.jsxs)(o,{flexDirection:"column",marginBottom:f,children:[t&&(0,r.jsx)(o,{marginBottom:0,children:(0,r.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,r.jsx)(o,{borderStyle:"round",borderColor:p,flexDirection:"column",paddingX:x,paddingY:g,width:u,children:c})]})}function k({label:t,value:a,labelColor:l=e.dim,valueColor:n,labelWidth:c=14}){return(0,r.jsxs)(o,{children:[(0,r.jsx)(o,{width:c,flexShrink:0,children:(0,r.jsx)(i,{color:l,children:t})}),(0,r.jsx)(o,{flexShrink:1,children:(0,r.jsx)(i,{color:n,wrap:"wrap",children:a})})]})}function I({label:t}){return(0,r.jsx)(o,{marginTop:1,marginBottom:0,children:(0,r.jsx)(i,{bold:!0,children:t})})}export{h as a,k as b,I as c};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as At,b as Ct,d as Ot,f as Tt,t as Mt,u as jt}from"./chunk-SONMD3W5.js";import{b as It}from"./chunk-QCKA665H.js";import{b as _t,d as Rt}from"./chunk-XJ7HCXKW.js";import{k as yt}from"./chunk-QTZBVDPR.js";import{a as ht,b as U}from"./chunk-NLZZLANH.js";import{c as gt}from"./chunk-NWD54VV5.js";import{c as vt,h as wt}from"./chunk-L4UVUFL6.js";import{a as Wt}from"./chunk-HIUAUZNL.js";import{g as Pt,h as Re,j as Et}from"./chunk-252FWF2G.js";import{c as Dt,d as $t,e as Ut}from"./chunk-JQSLUGD4.js";import{d as xt}from"./chunk-FFL55I2M.js";import{g as Nt}from"./chunk-42PALMW2.js";import{f as bt}from"./chunk-KF4DKXSS.js";import{k as St}from"./chunk-ZTHYAHDN.js";import{c as kt}from"./chunk-DPGOAFKF.js";import{B as ct,D as ut,Da as mt,Ha as P,W as _e,ba as pt,f as re,fa as ft,h as rt,i as st,n as k,o as dt,pa as ie,r as Se,t as z,u as se,v as oe,w as lt}from"./chunk-W3OVSDBN.js";import{a as ot,b as it,d as at}from"./chunk-GFLB2SHW.js";import{a as ne}from"./chunk-I2MC6VVX.js";import{a as ke}from"./chunk-RPRXRKKR.js";import{d as et}from"./chunk-NWBLYMH7.js";import{oa as nt}from"./chunk-UEE3RZN4.js";import{b as tt}from"./chunk-6NFOH4AC.js";import{c as Ze}from"./chunk-ZCRZFAOT.js";import{a as Ye}from"./chunk-I6OQISK4.js";import{appendFileSync as tn,mkdirSync as nn,mkdtempSync as rn,rmSync as sn}from"fs";import{tmpdir as on}from"os";import{dirname as an,join as dn}from"path";import{MessageChannel as ln,Worker as cn}from"worker_threads";var Ft=["submit","submitAnswer","submitFreeText","submitAnswerWithText","toggleOption","confirmMulti","goWithRecommendations","ingestAttach","continueParked","completeSession","requestPause","finalizeForExit","note","ledger"],xn=[...Ft,"state","subscribe","multiSelection","canIngest","senderAlive","aliasOf","explainLines","ask","approveAdded"];function Lt(e,s){let n=s.state,o=s.view,i=new Set,l=[];e.on("message",m=>{if(m.type==="approved")return void l.shift()?.(m.go);if(m.type==="mirror"){n=m.state,o=m.view;for(let g of[...i])g()}});let f=(m,g)=>e.postMessage({type:"controller",member:m,args:g});return{...Object.fromEntries(Ft.map(m=>[m,(...g)=>{f(m,g)}])),get state(){return n},subscribe(m){return i.add(m),()=>i.delete(m)},goWithRecommendations(){return f("goWithRecommendations",[]),{picks:""}},async ingestAttach(m){f("ingestAttach",[m])},approveAdded(){return new Promise(m=>{l.push(m),f("approveAdded",[])})},multiSelection:m=>o.multi[m]??[],canIngest:()=>o.canIngest,senderAlive:()=>o.senderAlive,aliasOf:m=>o.aliases[m],explainLines:()=>null,ask:async()=>{throw new Error("a remote session's questions are asked on its session thread")}}}var Xt=e=>e.added===0?"":e.verb==="design"?`${e.added} added`:`${e.added} ${e.added===1?"use-case":"use-cases"} added`;function On(e,s,n){let o=e.length,i=s.title?`"${s.title}"`:nt(s.id);return[{text:` ${o} other ${o===1?"session is":"sessions are"} open on ${i} \u2014 you can still go ahead`},...Ie(e,n,4)]}function Ie(e,s,n){let o=" ".repeat(n),i=[];for(let l of e){let f=l.owner===null?"":(l.owner==="you"?"yours":"someone else").padEnd(15),j=[Mt[l.state]??l.state,jt(l.lastActivityAt,s),Xt(l)].filter(Boolean);i.push({text:`${o}${f}${j.join(" \xB7 ")}`,dim:!0}),l.owner!=="someone_else"&&(l.state==="ready_to_save"?i.push({text:`${o} save: kane-cli context sessions save ${l.sid}`,dim:!0}):l.state==="paused"&&i.push({text:`${o} resume: ${ie(l.verb==="design"||l.verb==="evolve"?"design":"extract",l.sid,!1)}`,dim:!0}))}return i}var ae=2e3,qt=2*ae,Yt=16;async function $n(e){let s=await xe(e);return s===null?null:s.length===0?P.nothingNewRead.map(n=>({text:n})):[{text:P.nothingNewInSession},...Ie(s,e.now,2)]}function Bt(e){if(e.length===0)return{type:"nothing_new",reason:"every_source_read",next:[{cmd:"kane-cli context ingest <files> --mode agent",why:"add more sources"}]};let s=e.filter(n=>n.owner!=="someone_else").flatMap(n=>n.state==="paused"?[{cmd:`kane-cli context extract --resume ${n.sid} --mode agent`,why:"resume your session"}]:n.state==="ready_to_save"?[{cmd:`kane-cli context sessions save ${n.sid} --yes --mode agent`,why:"save your session"}]:[]);return{type:"nothing_new",reason:"sources_in_a_session",open_sessions:e.map(({sid:n,owner:o,state:i,added:l})=>({sid:n,owner:o,state:i,added:l})),...s.length>0?{next:s}:{}}}async function xe(e){let s,n=new Promise(o=>{s=setTimeout(()=>{e.log?.(`the sources weren't read within ${e.budgetMs??qt} ms; the extract goes on`),o(null)},e.budgetMs??qt)});try{return await Promise.race([Zt(e),n])}catch(o){return e.log?.(`the sources weren't read: ${U(o)}; the extract goes on`),null}finally{clearTimeout(s)}}async function Zt(e){let[s,n]=await Promise.all([e.person.sources(e.projectId),e.person.listSessions(e.projectId)]),o=s.filter(l=>l.head!==null&&!l.sourceId.startsWith(Nt));if(o.length===0||o.some(l=>l.completeness?.sourceCid!==l.head))return null;let i=n.filter(l=>l.verb==="extract");return Rt(e.person,e.projectId,i,e.me,Math.min(Yt,Math.max(1,i.length)))}var Pe=class extends Error{constructor(){super("stopped while the file went up")}},de=class extends Error{constructor(n,o,i){super(n.message);this.refusal=n;this.exit=o;this.detail=i}};async function Sr(){let e=await bt(gt);return{auth:e,preflight:await kt(e)}}var un=500,le=5e3,Ht=6e4,pn=250;function fn(e){let s=e.now-e.pressedAt;if(s>=Ht)return"force";let n=e.saving>0?0:e.now-Math.max(e.quietSince,e.pressedAt);return n>=le?"force":{wait:Math.min(le-n,Ht-s)}}var mn=new Set([k.appendDraft,k.vectorsWrite,k.putBlob,k.chainWrite,k.chainWriteIfAbsent,k.chainRemove,k.filesWrite,k.statePut,k.acknowledge,k.registerChild,k.sideSave]);function gn(){return import.meta.url.endsWith(".ts")?new URL("./session-worker.boot.mjs",import.meta.url):new URL("./session-worker.js",import.meta.url)}function hn(e,s){if(e!=="ingested"||s===null||typeof s!="object")return{kind:e};let n=s,o={kind:e};for(let i of["source_id","status","behind","unread","cursor"])n[i]!==void 0&&(o[i]=n[i]);return o}function vn(e,s){let n=Ze(`remote-${e}`,s);return o=>{try{nn(an(n),{recursive:!0}),tn(n,`${new Date().toISOString()} ${o}
2
+ import{a as At,b as Ct,d as Ot,f as Tt,t as Mt,u as jt}from"./chunk-DDZLCAEO.js";import{b as It}from"./chunk-CM4CHYSN.js";import{b as _t,d as Rt}from"./chunk-RHGW7B5Q.js";import{k as yt}from"./chunk-HCJ2N3XB.js";import{a as ht,b as U}from"./chunk-NLZZLANH.js";import{c as gt}from"./chunk-3F5FMH76.js";import{c as vt,h as wt}from"./chunk-ZU4W2QGM.js";import{a as Wt}from"./chunk-HIUAUZNL.js";import{g as Pt,h as Re,j as Et}from"./chunk-457Y5TEC.js";import{c as Dt,d as $t,e as Ut}from"./chunk-EECDDDSB.js";import{d as xt}from"./chunk-7NPTL66J.js";import{g as Nt}from"./chunk-42PALMW2.js";import{f as bt}from"./chunk-KF4DKXSS.js";import{k as St}from"./chunk-ZTHYAHDN.js";import{c as kt}from"./chunk-DPGOAFKF.js";import{B as ct,D as ut,Da as mt,Ha as P,W as _e,ba as pt,f as re,fa as ft,h as rt,i as st,n as k,o as dt,pa as ie,r as Se,t as z,u as se,v as oe,w as lt}from"./chunk-7HMSMAUG.js";import{a as ot,b as it,d as at}from"./chunk-GFLB2SHW.js";import{a as ne}from"./chunk-I2MC6VVX.js";import{a as ke}from"./chunk-RPRXRKKR.js";import{d as et}from"./chunk-DJC7NTLA.js";import{oa as nt}from"./chunk-UEE3RZN4.js";import{b as tt}from"./chunk-6NFOH4AC.js";import{c as Ze}from"./chunk-ZCRZFAOT.js";import{a as Ye}from"./chunk-D36V5OX6.js";import{appendFileSync as tn,mkdirSync as nn,mkdtempSync as rn,rmSync as sn}from"fs";import{tmpdir as on}from"os";import{dirname as an,join as dn}from"path";import{MessageChannel as ln,Worker as cn}from"worker_threads";var Ft=["submit","submitAnswer","submitFreeText","submitAnswerWithText","toggleOption","confirmMulti","goWithRecommendations","ingestAttach","continueParked","completeSession","requestPause","finalizeForExit","note","ledger"],xn=[...Ft,"state","subscribe","multiSelection","canIngest","senderAlive","aliasOf","explainLines","ask","approveAdded"];function Lt(e,s){let n=s.state,o=s.view,i=new Set,l=[];e.on("message",m=>{if(m.type==="approved")return void l.shift()?.(m.go);if(m.type==="mirror"){n=m.state,o=m.view;for(let g of[...i])g()}});let f=(m,g)=>e.postMessage({type:"controller",member:m,args:g});return{...Object.fromEntries(Ft.map(m=>[m,(...g)=>{f(m,g)}])),get state(){return n},subscribe(m){return i.add(m),()=>i.delete(m)},goWithRecommendations(){return f("goWithRecommendations",[]),{picks:""}},async ingestAttach(m){f("ingestAttach",[m])},approveAdded(){return new Promise(m=>{l.push(m),f("approveAdded",[])})},multiSelection:m=>o.multi[m]??[],canIngest:()=>o.canIngest,senderAlive:()=>o.senderAlive,aliasOf:m=>o.aliases[m],explainLines:()=>null,ask:async()=>{throw new Error("a remote session's questions are asked on its session thread")}}}var Xt=e=>e.added===0?"":e.verb==="design"?`${e.added} added`:`${e.added} ${e.added===1?"use-case":"use-cases"} added`;function On(e,s,n){let o=e.length,i=s.title?`"${s.title}"`:nt(s.id);return[{text:` ${o} other ${o===1?"session is":"sessions are"} open on ${i} \u2014 you can still go ahead`},...Ie(e,n,4)]}function Ie(e,s,n){let o=" ".repeat(n),i=[];for(let l of e){let f=l.owner===null?"":(l.owner==="you"?"yours":"someone else").padEnd(15),j=[Mt[l.state]??l.state,jt(l.lastActivityAt,s),Xt(l)].filter(Boolean);i.push({text:`${o}${f}${j.join(" \xB7 ")}`,dim:!0}),l.owner!=="someone_else"&&(l.state==="ready_to_save"?i.push({text:`${o} save: kane-cli context sessions save ${l.sid}`,dim:!0}):l.state==="paused"&&i.push({text:`${o} resume: ${ie(l.verb==="design"||l.verb==="evolve"?"design":"extract",l.sid,!1)}`,dim:!0}))}return i}var ae=2e3,qt=2*ae,Yt=16;async function $n(e){let s=await xe(e);return s===null?null:s.length===0?P.nothingNewRead.map(n=>({text:n})):[{text:P.nothingNewInSession},...Ie(s,e.now,2)]}function Bt(e){if(e.length===0)return{type:"nothing_new",reason:"every_source_read",next:[{cmd:"kane-cli context ingest <files> --mode agent",why:"add more sources"}]};let s=e.filter(n=>n.owner!=="someone_else").flatMap(n=>n.state==="paused"?[{cmd:`kane-cli context extract --resume ${n.sid} --mode agent`,why:"resume your session"}]:n.state==="ready_to_save"?[{cmd:`kane-cli context sessions save ${n.sid} --yes --mode agent`,why:"save your session"}]:[]);return{type:"nothing_new",reason:"sources_in_a_session",open_sessions:e.map(({sid:n,owner:o,state:i,added:l})=>({sid:n,owner:o,state:i,added:l})),...s.length>0?{next:s}:{}}}async function xe(e){let s,n=new Promise(o=>{s=setTimeout(()=>{e.log?.(`the sources weren't read within ${e.budgetMs??qt} ms; the extract goes on`),o(null)},e.budgetMs??qt)});try{return await Promise.race([Zt(e),n])}catch(o){return e.log?.(`the sources weren't read: ${U(o)}; the extract goes on`),null}finally{clearTimeout(s)}}async function Zt(e){let[s,n]=await Promise.all([e.person.sources(e.projectId),e.person.listSessions(e.projectId)]),o=s.filter(l=>l.head!==null&&!l.sourceId.startsWith(Nt));if(o.length===0||o.some(l=>l.completeness?.sourceCid!==l.head))return null;let i=n.filter(l=>l.verb==="extract");return Rt(e.person,e.projectId,i,e.me,Math.min(Yt,Math.max(1,i.length)))}var Pe=class extends Error{constructor(){super("stopped while the file went up")}},de=class extends Error{constructor(n,o,i){super(n.message);this.refusal=n;this.exit=o;this.detail=i}};async function Sr(){let e=await bt(gt);return{auth:e,preflight:await kt(e)}}var un=500,le=5e3,Ht=6e4,pn=250;function fn(e){let s=e.now-e.pressedAt;if(s>=Ht)return"force";let n=e.saving>0?0:e.now-Math.max(e.quietSince,e.pressedAt);return n>=le?"force":{wait:Math.min(le-n,Ht-s)}}var mn=new Set([k.appendDraft,k.vectorsWrite,k.putBlob,k.chainWrite,k.chainWriteIfAbsent,k.chainRemove,k.filesWrite,k.statePut,k.acknowledge,k.registerChild,k.sideSave]);function gn(){return import.meta.url.endsWith(".ts")?new URL("./session-worker.boot.mjs",import.meta.url):new URL("./session-worker.js",import.meta.url)}function hn(e,s){if(e!=="ingested"||s===null||typeof s!="object")return{kind:e};let n=s,o={kind:e};for(let i of["source_id","status","behind","unread","cursor"])n[i]!==void 0&&(o[i]=n[i]);return o}function vn(e,s){let n=Ze(`remote-${e}`,s);return o=>{try{nn(an(n),{recursive:!0}),tn(n,`${new Date().toISOString()} ${o}
3
3
  `)}catch{}}}var w=U;async function wn(e,s,n,o){let i,l;try{[i,l]=await Promise.all([pt(e.person,s,n),e.person.getSession(n)])}catch(f){return o(`the session that added nothing was not discarded: ${w(f)}`),!0}if(ft(i,(l.scope?.position??l.basePosition)>l.basePosition))return!0;try{await e.person.discard(n,e.claim.generation)}catch(f){o(`the session that added nothing was not discarded: ${w(f)}`)}return!1}function yn(e,s){return e===0&&s>0?1:e}async function _r(e){let s={trace:Dt(null,"")},n=1;Se({projectId:e.choice.projectId});try{return n=await bn(e,s),n}finally{s.trace.line("run_end",{code:n}),await lt()}}async function bn(e,s){let n=e.testing??{},o=null,i=new Set,l=r=>{if(r.type!=="session_paused"||e.verb!=="extract"||i.size<2)return r;let{resume:a,held_review:y,next:Y,...$}=r,Z=Ot(e.ingest?.map(ee=>ee.path??ee.file),A?.record??null),G=A?.record.sessionId??String(r.sid);return{...$,sid:G,...Tt(G,Z)}},f=r=>{let a=e.io?At(r,Date.now(),{sourceId:A?.record.sourceId??null,mode:e.mode}):null;a&&e.io.event(l(a)),e.onProgress(o!==null&&r.kind==="load"?{kind:"reading",file:o}:r)},j=e.start.kind==="resume"?e.start.sessionId:null,N=null,m=null,g=null,Ee=!1,ce=null,Ae=[],W=!1,ue=!1,pe=null,fe=!1,A=null,u=n.diagnostics??(()=>{}),C=(r,a={})=>{e.io?e.io.event({type:"error",code:r.code,message:r.message,...ct(r),...r.heldBy?{held_by:ut(r.heldBy)}:{},...r.notAdded?{not_added:r.notAdded}:{},...a}):e.onRefusal?e.onRefusal(r):yt(r)},Gt=r=>{if(!g){if(g=r,e.onEnding?.(),u(`the session's writer was stopped: ${U(r)}`),z(se(r),oe(r)),m?.close(P.stepRefused),r.code==="PROJECT_NOT_MARKED")Ee=!0;else if(r.code==="SESSION_ENDED"||r.code==="SCOPE_NOT_OPEN")pe=r;else{let a=r.code===rt?"resumed_elsewhere":r.code===st?"computer_slept":"connection_lost";W&&a==="connection_lost"?ue=!0:f({kind:"paused",reason:a,sid:A?.record.sessionId??j??""})}setTimeout(()=>{N?.terminate()},le).unref()}},E=!1,S=!1,me=0,ge=new Set,D=0,Ce=!1,J=!1,Oe=()=>{},Kt=new Promise(r=>Oe=r),Te=()=>{E=!0,N?.postMessage({type:"stop"})},Me=()=>{},je=new Promise(r=>Me=r),he=()=>{s.trace.line("run_forced",{}),S=!0,Me(),J&&Oe();let r=N;r?.postMessage({type:"kill"}),setTimeout(()=>{r?.terminate()},pn).unref()},ve=0,Ne=r=>{let a=()=>{if(S||Ce)return;let y=fn({now:Date.now(),pressedAt:r,saving:me+ge.size,quietSince:D});if(y==="force")return he();setTimeout(a,Math.max(50,y.wait)).unref()};setTimeout(a,le).unref()},We=()=>{if(ve+=1,s.trace.line("stop_asked",{by:"ctrl_c",press:ve}),J||ve>1)return he();Te(),Ne(Date.now())};e.onControls?.({pause:()=>{s.trace.line("stop_asked",{by:"pause"}),E=!0,Ne(Date.now())},force:he});let _=!1,De=null,$e=0;if(e.mode==="agent"&&e.io&&e.verb==="extract"&&e.start.kind==="new"&&!e.start.body.sourceId&&!e.run.force&&!e.ingest){let r=await xe({person:re({url:e.choice.latticeUrl,basicAuth:e.basicAuth,requestDeadlineMs:ae,...n.fetch?{fetch:n.fetch}:{}}),projectId:e.choice.projectId,me:vt(process.cwd()),now:Date.now(),log:n.diagnostics??ht("nothing-new")});if(r!==null)return e.io.event(Bt(r)),0}let F=e.io?await tt({event:r=>e.io.event(r)},e.check):await e.check();if(!F.preflight.ok){let{cause:r,final:a}=F.preflight;return u(`the controller's check refused the run: ${F.preflight.message}`),C(P.preflight(r??(a?"rejected":"unreachable")),{final:a}),2}if(S)return 130;let Vt=e.signals?process.listeners("SIGINT"):[],Q=!1,Ue=()=>{!e.signals||Q||(Q=!0,process.removeAllListeners("SIGINT"),process.on("SIGINT",We))},L=()=>{if(Q){Q=!1,process.removeListener("SIGINT",We);for(let r of Vt)process.on("SIGINT",r)}},q=null,X=[];if(e.ingest){Ue();try{for(let a of e.ingest){if(!a.fetch)continue;if(await Promise.race([a.fetch(f).then(()=>!0),je.then(()=>null)])===null||S||E)return L(),130}let r=[];for(let a of e.ingest){if(a.deferred){r.push(null);continue}let y=await Promise.race([a.upload(f,()=>E||S),je.then(()=>null)]);if(y===null||S)return L(),130;r.push(y)}q=r}catch(r){if(L(),r instanceof Pe)return 130;if(!(r instanceof de))throw r;return u(`the upload was refused: ${r.detail??r.message}`),C(r.refusal),r.exit}}try{A=await _t({url:e.choice.latticeUrl,basicAuth:e.basicAuth,start:e.start,...e.choice.projectName?{projectName:e.choice.projectName}:{},onProgress:f,onStopped:Gt,log:r=>u(r),testing:{...n.fetch?{fetch:n.fetch}:{},...n.leaseRenewMs!==void 0?{leaseRenewMs:n.leaseRenewMs}:{},...n.retryDeadlineMs!==void 0?{retryDeadlineMs:n.retryDeadlineMs}:{}}})}catch(r){L(),e.choice.onboarded&&r instanceof ne&&(r.code==="MARK_REFUSED"||r.code==="PROJECT_NOT_MARKED")&&wt(process.cwd());let a=await Rn(r,{latticeUrl:e.choice.latticeUrl,projectId:e.choice.projectId,basicAuth:e.basicAuth,sessionId:j,useCase:e.run.useCase,log:$=>u($),...n.fetch?{fetch:n.fetch}:{}}),{exit:y,...Y}=It(r,e.choice,j,e.verb==="reconcile"?void 0:{verb:e.verb,...(e.verb==="design"||e.verb==="evolve")&&e.run.useCase?{useCase:e.run.useCase}:{},...a!==void 0?{title:a}:{},...e.mode==="agent"?{agent:!0}:{}});return u(`the session could not be opened: ${w(r)}`),r instanceof ne&&z(se(r),oe(r)),C(Y),y}let c=A,p=c.record.sessionId;Se({latticeSessionId:p,projectId:e.choice.projectId});let Fe=e.start.kind==="resume"&&c.record.verb==="reconcile"&&c.record.sourceId!==null,B=Fe?_n({...c.record,sourceId:c.record.sourceId}):null;Fe&&e.io?.retag?.("reconcile");let H=e.start.kind==="resume"&&c.record.verb==="evolve";H&&e.io?.retag?.("evolve");let Le=H?Sn(c.log.since(0)):void 0;if(H)for(let[r,a]of _e(c.log.since(0)))e.onRepinned?.(r,a);n.diagnostics||(u=vn(e.verb,p)),s.trace=$t(e.traceVerb??e.verb,ke()),s.trace.path&&Ut(p,s.trace.path),s.trace.line("run_open",{sid:p,verb:e.verb,start:e.start.kind,mode:e.mode??"interactive",cli_version:Ye,env:et(),project_id:e.choice.projectId});{let r=u;u=a=>{r(a),s.trace.line("diag",{line:a})}}let qe=rn(dn(on(),"kane-remote-session-")),we=[],Be=!1;Ue();let He=async()=>{if(!(!e.ingest||q===null))for(let[r,a]of e.ingest.entries())X[r]||(X[r]=!0,await a.cancel(p).catch(y=>u(`the upload's cancel was not posted: ${w(y)}`)))},ye=()=>(e.start.kind==="new"?c.person.discard(p,c.claim.generation):c.person.setStatus(p,"paused")).then(()=>{},r=>u(`the unstarted session was not put away: ${w(r)}`)),Ge=async()=>(await c.person.setStatus(p,"paused").catch(r=>u(`the pause was not recorded: ${w(r)}`)),f({kind:"not_ended",sid:p,project:e.choice.projectName}),1),Ke=async()=>{let r=await c.person.getSession(p).then(y=>y.scope?.state,()=>null);return f({kind:"ended",reason:r==="finalized"?"saved_elsewhere":r==="discarded"?"discarded_elsewhere":"ended_elsewhere",sid:p}),0},zt=async()=>{let r=await c.client.sessionState().catch(a=>(u(`the session's state couldn't be read: ${w(a)}`),null));return r===null||typeof r.completed_at!="string"?null:r.ended?.ended==="failed"?"failed":"complete"};try{if(S)return await He(),await ye(),130;try{e.onOpened?.(c.record,d=>u(d))}catch(d){u(`the folder's project link could not be updated: ${w(d)}`)}let r=e.start.kind==="resume"?await zt():null;if(r!==null){J=!0,W=!0;try{await c.state.end(p,{state:r,panel:null,error:null,checkIn:!1,phase:null,child:null,pausing:!1})}catch(d){return u(`the ending was not recorded: ${w(d)}`),pe?await Ke():g&&!ue?3:await Ge()}return r==="failed"?(C(P.sessionFailed(p)),2):(f({kind:"finished_before",sid:p}),0)}let a=0,y=async(d,b)=>{let T=mn.has(d),v=String(b?.childId??"");d===k.chainWrite&&/^(delta|full)-\d+\.json$/.test(String(b?.name))&&ge.add(v),T&&(me+=1,D=Date.now());let R=d===k.appendDraft,K;R&&(a+=1,e.onWrites?.(a),K=setTimeout(()=>f({kind:"write",pending:a}),300));try{return await c.storeCalls(d,b)}catch(I){throw u(`${d} was refused: ${w(I)}`),I instanceof ot?I:(z(se(I),oe(I)),I instanceof dt&&!g&&(fe=!0,e.onEnding?.()),it(new Error(P.stepRefused),I))}finally{d===k.acknowledge&&ge.delete(v),T&&(me-=1,D=Date.now()),R&&(clearTimeout(K),a-=1,e.onWrites?.(a),a===0&&f({kind:"write",pending:0}))}},{port1:Y,port2:$}=new ln,Z=new SharedArrayBuffer(4);m=at({port:Y,signal:Z},y);let G=H||e.verb==="evolve"?await kn(re({url:e.choice.latticeUrl,basicAuth:e.basicAuth,requestDeadlineMs:ae,...n.fetch?{fetch:n.fetch}:{}}),e.choice.projectId,u):void 0,ee={verb:B?"reconcile":H?"evolve":e.verb,traceVerb:e.traceVerb??e.verb,mode:e.mode,sessionId:p,fresh:e.start.kind==="new",generation:c.claim.generation,projectDir:process.cwd(),projectName:e.choice.projectName,projectId:e.choice.projectId,sideDir:qe,bridge:{port:$,signal:Z},lastEventSeq:c.log.lastSeq(),run:e.start.kind==="resume"?{...e.run,resume:p,...Le!==void 0?{kept:Le,...c.record.useCase?{useCase:c.record.useCase}:{}}:{}}:e.run,...e.start.kind==="resume"&&e.verb==="extract"?{landed:[...new Set((c.record.uploads??[]).filter(d=>d.outcome!=="refused").map(d=>d.sourceId))]}:{},auth:F.auth,preflight:F.preflight,supportId:ke(),...n.agent||n.remoteDeps||n.sourcePlugins||n.refuseCard?{testing:{...n.agent?{agent:n.agent}:{},...n.remoteDeps?{remoteDeps:n.remoteDeps}:{},...n.sourcePlugins?{sourcePlugins:n.sourcePlugins}:{},...n.refuseCard?{refuseCard:n.refuseCard}:{}}}:{},...e.ingest&&q?{ingest:e.ingest.map((d,b)=>({bytes:new Uint8Array(d.bytes),file:d.file,sourceId:d.sourceId,fingerprint:q[b]?.fingerprint??"",then:d.then,...d.remote?{remote:d.remote}:{},...d.plugin?{plugin:d.plugin}:{}}))}:{},...B?{review:B}:{},...G?{origins:G}:{}},Ve=()=>e.io?.event({type:"error",message:P.runStopped(e.verb)}),O=await new Promise(d=>{let b=!1,T=t=>{b||(b=!0,d(t))},v;try{v=new cn(n.workerUrl??gn(),{workerData:ee,transferList:[$]})}catch(t){return u(`the session thread could not start: ${w(t)}`),Ve(),T(1)}N=v,E&&v.postMessage({type:"stop"});let R=e.ingest?.[0],K=R?.remote?Pt({...R.remote,address:R.remote.origin.url},Re(R.remote.provider,R.remote.origin.url,R.sourceId)):void 0,I=B??(e.verb==="reconcile"&&R?{sourceId:R.sourceId,file:R.path??R.file,...K?{page:K}:{}}:null);if(e.onReview&&I){let t=Wt(v),x={source:I.sourceId,file:I.file,...I.page?{page:I.page}:{}};e.onReview(t,x);let h=!1;v.on("message",V=>{if(h||V.type!=="reviewMirror"||!V.review.named)return;h=!0;let M=xt(x,V.review.named);M&&e.onReview(t,M)})}e.ingest&&(o=e.ingest[0].file,f({kind:"reading",file:o})),n.terminateOnHold?.then(()=>v.terminate());let Qe=!0,Xe=!1;v.on("message",t=>{if(t.type==="mirror"&&E&&t.state.nestedAgent===!0&&(D=Date.now()),t.type==="mirror"&&!Xe)Xe=!0,e.onController?.(Lt(v,{state:t.state,view:t.view}));else if(t.type==="event"){if(E&&t.event.child_id!==void 0&&(D=Date.now()),(fe||g)&&t.event.type==="error")return u(`after the run paused: ${String(t.event.message??"")}`);if(e.start.kind==="resume"&&t.event.type==="error"&&mt.has(String(t.event.code??"")))return ce=String(t.event.code),u(`the resume was refused: ${String(t.event.message??"")}`);if(t.event.type==="held"&&e.onHeld?.(Number(t.event.count)||0),t.event.type==="session_complete"&&e.mode==="agent"||(t.event.type==="source_start"&&i.add(String(t.event.source_id)),t.event.type==="child_start"?we.push({child:t.event.child,at:Date.now()}):t.event.type==="child_end"?we.pop():t.event.type==="session_paused"&&t.event.child_id===void 0&&(Be=!0),t.event.type==="run_start"&&t.event.child_id!==void 0))return;e.io?.event(l(t.event.type==="run_start"?{type:"run_start",session:p}:t.event.type==="session_paused"&&t.event.held!==void 0?{...t.event,reason:"held_back"}:t.event.type==="held"&&t.event.reason==="embed_degraded"?{...t.event,reason:"duplicate_check_reduced"}:t.event.type==="held"&&t.event.reason==="reconcile"?{...t.event,reason:"review"}:t.event)),(Qe&&n.stopAfterFirstEvent||!E&&t.event.type===n.stopAtEvent)&&Te(),Qe=!1}else if(t.type==="summary")e.onSummary?.(t.facts);else if(t.type==="notUpdated")e.onNotUpdated?.(t.useCases,t.titles,t.stillStale);else if(t.type==="unstarted")_=!0;else if(t.type==="needed")Ae=t.needed.noStartPage.map(({test:x})=>({test:x})),e.onNeeded?.({needed:t.needed,tests:t.tests});else if(t.type==="preMount")(e.onPreMount?e.onPreMount(t.question):Promise.resolve({go:!1,code:2})).then(x=>{!x.go&&t.question.kind!=="evolve-entry"&&t.question.kind!=="lines"&&(_=!0),v.postMessage({type:"preMountAnswer",answer:x})});else if(t.type==="ingestFetched"){let x=e.ingest[t.index];x.bytes=Buffer.from(t.bytes),x.upload(f,()=>E||S).then(h=>{q[t.index]=h,v.postMessage({type:"ingestUploaded",index:t.index,ok:!0,fingerprint:h.fingerprint})},h=>{h instanceof de?(u(`the upload was refused: ${h.detail??h.message}`),C(h.refusal),De=h.exit):u(`the fetched item's upload failed: ${w(h)}`),X[t.index]=!0,_=!0,v.postMessage({type:"ingestUploaded",index:t.index,ok:!1})})}else if(t.type==="ingestOutcome"){let{type:x,index:h,...V}=t;X[h]=!0,e.ingest[h].result(V,p,u).then(M=>{M?e.ingest[h+1]&&(o=e.ingest[h+1].file,f({kind:"reading",file:o})):(_=!0,o=null),v.postMessage({type:"ingestGo",index:h,go:M})},M=>{u(`the upload's result was not posted: ${w(M)}`),_=!0,v.postMessage({type:"ingestGo",index:h,go:!1})})}else if(t.type==="ingested")o=null,e.verb==="reconcile"&&t.status==="unchanged"&&!t.behind&&!t.unread&&(_=!0),e.ingest?.[t.index]?.onAdded?.(t.status,p,{...t.duplicateOf?{duplicateOf:t.duplicateOf}:{},...t.attachments?{attachments:t.attachments}:{},...t.behind?{behind:t.behind}:{},...t.unread?{unread:!0}:{}});else if(t.type==="ingestUnwritten")o=null,_=!0,e.ingest?.[t.index]?.onUnwritten?.(p);else if(t.type==="sessionEvent"){E&&t.payload.child_id!==void 0&&(D=Date.now()),c.log.append(t.kind,t.payload),s.trace.line("session_event",hn(t.kind,t.payload));for(let[x,h]of _e([t]))e.onRepinned?.(x,h)}else t.type==="itemsFailed"?$e+=t.count:t.type==="out"?e.io?.out(t.line):t.type==="log"?u(t.line):t.type==="done"&&T(De??t.code)}),v.on("error",t=>{u(`the session thread failed: ${t instanceof Error&&t.stack?t.stack:w(t)}`),z("thread_crash"),Ve(),T(1)}),v.on("exit",()=>{s.trace.line("thread_exit",{stopped:g!==null,forced:S}),T(g?3:S?130:1)})});J=!0;let ze=e.ingest?.[0]?.then==="pause";W=O===0&&!_&&!ze;let te=O!==0||_,Jt=fe&&!g&&!S&&O!==0&&!_,be=!1,Qt=async()=>{await He(),_?(await c.log.flush().catch(()=>{}),await ye()):O!==0&&!g&&await c.person.setStatus(p,"paused").catch(d=>u(`the pause was not recorded: ${w(d)}`)),await c.log.flush(),!g&&O===0&&!_&&(ze?await c.person.setStatus(p,"paused"):await c.state.end(p,{state:"complete",panel:null,error:null,checkIn:!1,phase:null,child:null,pausing:!1}),te=!0),be=!0};await Promise.race([Qt().catch(d=>u(`the run's ending was not recorded: ${w(d)}`)),Kt]);let Je=!0;if(e.mode==="agent"&&be&&W&&te&&!g&&!S&&(Je=await wn(c,e.choice.projectId,p,u)),S&&!be&&!g){let d=_?ye():c.person.setStatus(p,"paused").catch(b=>u(`the pause was not recorded: ${w(b)}`));await Promise.race([d,new Promise(b=>setTimeout(b,un).unref())])}if(Ee)return C(P.assuranceOff(e.choice.projectName)),2;if(ce!==null)return C(P.resumeUnreadable(ce,p,e.verb==="design"?"design":"extract",c.record.useCase)),2;if(pe)return await Ke();if(S){if(e.mode!=="agent"||g||_)return 130;if(Be)return 3;for(let b of we.splice(0).reverse())e.io?.event({type:"child_end",child:b.child,ok:!1,dur_s:Math.max(1,Math.round((Date.now()-b.at)/1e3)),exit_code:3});let d=ie(e.verb==="design"&&!B?"design":"extract",p,!0);return e.io?.event(l({type:"session_paused",sid:p,...c.record.sourceId?{source_id:c.record.sourceId}:{},mode:"agent",resume:d,expires_at:null,pending_questions:[],next:[{cmd:d,why:"resume"}]})),3}return ue||W&&!te&&!g?await Ge():g?3:Jt?(f({kind:"paused",reason:"not_accepted",sid:p}),3):te?(e.mode==="agent"&&W&&O===0&&e.io?.event(Ct(p,Je,{sourceId:A?.record.sourceId??null,noStartPage:Ae})),yn(O,$e)):(f({kind:"paused",reason:"connection_lost",sid:p}),3)}finally{Ce=!0,L(),c.release(),m?.close("the session ended"),await N?.terminate(),sn(qe,{recursive:!0,force:!0})}}async function kn(e,s,n){try{return Object.fromEntries((await e.sources(s)).map(o=>[o.sourceId,o.origin?.url??null]))}catch(o){return n(`the project's sources were not read: ${w(o)}`),{}}}function Sn(e){let s=e.filter(i=>i.kind==="evolve_answers").at(-1)?.payload,n=s?.request;if(!n||!Array.isArray(s?.answers))return"unread";let o=s.answers.flatMap(i=>typeof i.id=="string"&&(i.choice==="proceed"||i.choice==="decline")?[{id:i.id,choice:i.choice}]:[]);return{request:{...typeof n.ref=="string"?{ref:n.ref}:{},fromStale:n.fromStale===!0,...typeof n.because=="string"?{because:n.because}:{}},answers:o}}function _n(e){let s=[...e.uploads??[]].reverse().find(n=>n.sourceId===e.sourceId&&n.outcome!=="refused"&&(n.filename||n.originUrl));if(s&&!s.filename&&s.originUrl){let n=s.originUrl,o=St(n)?.name??"web";return{sourceId:e.sourceId,file:n,page:Et(o,n,void 0,Re(o,n,e.sourceId))}}return{sourceId:e.sourceId,file:s?.filename??"<file>"}}async function Rn(e,s){if(!(e instanceof ne)||e.code!=="SESSION_CLASH")return;let n=e.extra.heldBy;if(n?.verb!=="design"&&n?.verb!=="evolve")return;let o=re({url:s.latticeUrl,basicAuth:s.basicAuth,...s.fetch?{fetch:s.fetch}:{}});try{if(s.sessionId!==null)return(await o.getSession(s.sessionId)).useCaseTitle??null;if(!s.useCase)return null;let i=(await o.mainNode(s.projectId,s.useCase)).content.title;return typeof i=="string"&&i!==""?i:null}catch(i){return s.log(`the use case's title couldn't be read for the lock's words, so they name its id: ${U(i)}`),null}}export{On as a,ae as b,$n as c,Pe as d,de as e,Sr as f,fn as g,mn as h,hn as i,yn as j,_r as k};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as B}from"./chunk-S3DAAAE5.js";import{a as g}from"./chunk-5BUIIFLC.js";import{a as w}from"./chunk-HCBYKLMW.js";import{a as x,b as t,c as h,i as P,j as S}from"./chunk-33DWJV67.js";import{a as C}from"./chunk-6YGTRKDT.js";import{y as s}from"./chunk-I6OQISK4.js";import{e as T}from"./chunk-UR6MHSHU.js";var o=T(C(),1);var e=T(w(),1);function D({defaultName:i,onSubmit:c}){let[d,p]=(0,o.useState)("confirm"),[f,a]=(0,o.useState)(""),[m,u]=(0,o.useState)(null),l=(0,o.useMemo)(()=>f.trim()||i,[f,i]);return P((n,r)=>{if(d==="confirm"){if(n==="y"||n==="Y"){a(i),p("name");return}if(n==="n"||n==="N"||r.escape||r.ctrl&&n==="c"){c(null);return}if(r.return){c(i);return}return}if(r.return){if(!B(l)){u(`name "${l}" is invalid; allowed: letters, digits, underscore, hyphen`);return}c(l);return}if(r.escape||r.ctrl&&n==="c"){c(null);return}if(r.backspace||r.delete){a(v=>v.slice(0,-1)),u(null);return}n&&!r.ctrl&&!r.meta&&(a(v=>v+n),u(null))}),d==="confirm"?(0,e.jsx)(g,{title:"Save session?",titleColor:"#ff9500",rows:[{label:"name",value:(0,e.jsx)(t,{color:s.orange,children:i})}],footer:(0,e.jsxs)(x,{flexDirection:"column",children:[(0,e.jsx)(t,{color:s.dim,children:"enter \u2014 save with this name"}),(0,e.jsx)(t,{color:s.dim,children:"Y \u2014 edit name"}),(0,e.jsx)(t,{color:s.dim,children:"N/esc \u2014 discard session"})]})}):(0,e.jsx)(g,{title:"Save session?",titleColor:"#ff9500",rows:[{label:"name",value:(0,e.jsxs)(x,{children:[(0,e.jsx)(t,{color:s.orange,children:f}),(0,e.jsx)(t,{inverse:!0,children:" "})]})}],footer:(0,e.jsxs)(x,{flexDirection:"column",children:[m&&(0,e.jsx)(t,{color:s.red,children:m}),(0,e.jsx)(t,{color:s.dim,children:"enter \u2014 save \xB7 esc \u2014 discard"})]})})}function V(){return new Date().toISOString().slice(0,19).replace(/:/g,"-")}async function Y(i){return new Promise(c=>{function d(){let{exit:a}=S(),[m,u]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{if(m){let l=setTimeout(()=>a(),50);return()=>clearTimeout(l)}},[m,a]),(0,e.jsx)(D,{defaultName:i,onSubmit:l=>{c(l),u(!0)}})}let{waitUntilExit:p,unmount:f}=h((0,e.jsx)(d,{}),{stdout:process.stderr,exitOnCtrlC:!1});p().then(()=>{try{f()}catch{}})})}export{D as a,V as b,Y as c};
2
+ import{b as B}from"./chunk-S3DAAAE5.js";import{a as g}from"./chunk-F22K3RRX.js";import{a as w}from"./chunk-HCBYKLMW.js";import{a as x,b as t,c as h,i as P,j as S}from"./chunk-33DWJV67.js";import{a as C}from"./chunk-6YGTRKDT.js";import{y as s}from"./chunk-D36V5OX6.js";import{e as T}from"./chunk-UR6MHSHU.js";var o=T(C(),1);var e=T(w(),1);function D({defaultName:i,onSubmit:c}){let[d,p]=(0,o.useState)("confirm"),[f,a]=(0,o.useState)(""),[m,u]=(0,o.useState)(null),l=(0,o.useMemo)(()=>f.trim()||i,[f,i]);return P((n,r)=>{if(d==="confirm"){if(n==="y"||n==="Y"){a(i),p("name");return}if(n==="n"||n==="N"||r.escape||r.ctrl&&n==="c"){c(null);return}if(r.return){c(i);return}return}if(r.return){if(!B(l)){u(`name "${l}" is invalid; allowed: letters, digits, underscore, hyphen`);return}c(l);return}if(r.escape||r.ctrl&&n==="c"){c(null);return}if(r.backspace||r.delete){a(v=>v.slice(0,-1)),u(null);return}n&&!r.ctrl&&!r.meta&&(a(v=>v+n),u(null))}),d==="confirm"?(0,e.jsx)(g,{title:"Save session?",titleColor:"#ff9500",rows:[{label:"name",value:(0,e.jsx)(t,{color:s.orange,children:i})}],footer:(0,e.jsxs)(x,{flexDirection:"column",children:[(0,e.jsx)(t,{color:s.dim,children:"enter \u2014 save with this name"}),(0,e.jsx)(t,{color:s.dim,children:"Y \u2014 edit name"}),(0,e.jsx)(t,{color:s.dim,children:"N/esc \u2014 discard session"})]})}):(0,e.jsx)(g,{title:"Save session?",titleColor:"#ff9500",rows:[{label:"name",value:(0,e.jsxs)(x,{children:[(0,e.jsx)(t,{color:s.orange,children:f}),(0,e.jsx)(t,{inverse:!0,children:" "})]})}],footer:(0,e.jsxs)(x,{flexDirection:"column",children:[m&&(0,e.jsx)(t,{color:s.red,children:m}),(0,e.jsx)(t,{color:s.dim,children:"enter \u2014 save \xB7 esc \u2014 discard"})]})})}function V(){return new Date().toISOString().slice(0,19).replace(/:/g,"-")}async function Y(i){return new Promise(c=>{function d(){let{exit:a}=S(),[m,u]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{if(m){let l=setTimeout(()=>a(),50);return()=>clearTimeout(l)}},[m,a]),(0,e.jsx)(D,{defaultName:i,onSubmit:l=>{c(l),u(!0)}})}let{waitUntilExit:p,unmount:f}=h((0,e.jsx)(d,{}),{stdout:process.stderr,exitOnCtrlC:!1});p().then(()=>{try{f()}catch{}})})}export{D as a,V as b,Y as c};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as E}from"./chunk-FFL55I2M.js";import{a as A,b as I,c as L,d as p,e as N,f as O,g as R,m as T}from"./chunk-ZTHYAHDN.js";import{Fa as f,ka as c}from"./chunk-W3OVSDBN.js";var h="https://integrations.lambdatest.com",m=" kane-cli context ingest <file>";function $(e){try{let n=new URL(e);return`${n.hostname}${n.pathname==="/"?"":n.pathname}`}catch{return e}}function D(e){switch(e.provider){case"web":return`the page ${e.display}`;case"jira":return`Jira issue ${e.display}`;case"confluence":return e.title?`Confluence page "${e.title}"`:`Confluence page ${e.display.split("/").at(-1)}`;case"linear":return`Linear issue ${e.display}`;case"linear-doc":return e.display.startsWith("document ")?`Linear ${e.display}`:`Linear document "${e.display}"`;default:return e.display}}function U(e,n){let t=C(e,n),i={jira:"Jira issue",confluence:"Confluence page",linear:"Linear issue","linear-doc":"Linear document"}[e];return i&&t!==n?`${i} ${t}`:t}function C(e,n){return e==="jira"?A(n)?.issueKey??n:e==="confluence"?L(n)?.pageId??n:e==="linear"?p(n)?.key??n:e==="linear-doc"?N(n)?.slugId??n:$(n)}var k=(e,n)=>e==="web"?`the page ${$(n)}`:U(e,n);function z(e){if(!e?.url)return null;let n=e.kind==="url"?"web":e.kind==="linear"?p(e.url)?"linear":"linear-doc":e.kind;return["web","jira","confluence","linear","linear-doc"].includes(n)?k(n,e.url):null}var x=e=>e.provider==="confluence"?e.title??e.display.split("/").at(-1):e.display;function P(e,n){let t={reading:e.provider==="web"?e.display:D(e),address:e.address,...n?{as:n}:{}};return e.provider==="confluence"&&!e.title?{...t,shown:`Confluence page ${e.display.split("/").at(-1)}`,bare:!0}:e.provider==="linear-doc"&&e.display.startsWith("document ")?{...t,shown:`Linear ${e.display}`,bare:!0}:{...t,shown:x(e)}}function q(e,n,t){return T(e)?.sourceIdFor(n)===t?void 0:t}function Q(e,n){try{let t=I(e,n)?.title;return typeof t=="string"&&t.length>0?t:void 0}catch{return}}function X(e,n,t,i){let s=C(e,n),d=e==="linear-doc"?t??`document ${s}`:s;return P({provider:e,display:d,...t?{title:t}:{},address:n},i)}var Z=e=>`with ${e.delivered+e.omitted} attachments: ${e.delivered} of its images added, ${e.omitted} left out`,ee=(e,n,t=!1)=>`the same ${t?"file":"text"} as "${e}", already in "${n}"`;function y(e,n){return e==="jira"?A(n)?.issueKey??n:e==="confluence"?`the Confluence page ${L(n)?.pageId??n}`:e==="linear"?p(n)?.key??n:e==="linear-doc"?`the Linear document ${N(n)?.slugId??n}`:`the page ${$(n)}`}var w=e=>e==="jira"?"Jira":e==="confluence"?"Confluence":e.startsWith("linear")?"Linear":"the web",S=e=>e.startsWith("linear")?"Linear":"Atlassian",b=e=>O(e)?.workspace??R(e)?.workspace??"<workspace>",G={invalid_url:"INVALID_URL",target_disallowed:"ADDRESS_NOT_ALLOWED",page_not_found:"PAGE_NOT_FOUND",page_access_blocked:"PAGE_BLOCKED",page_paywalled:"PAGE_PAYWALLED",unsupported_content_type:"NOT_A_PAGE",page_too_large:"PAGE_TOO_LARGE",page_timeout:"PAGE_TIMEOUT",scrape_unavailable:"PAGES_UNAVAILABLE",scrape_rate_limited:"PAGES_UNAVAILABLE",internal_error:"PAGES_UNAVAILABLE",malformed_response:"PAGES_UNAVAILABLE",credit_denied:"OUT_OF_CREDITS",auth_rejected:"CREDENTIALS_REJECTED",route_missing:"PAGES_NOT_AVAILABLE",transport_unreachable:"CONNECTION_FAILED",LIS_AUTH:"CREDENTIALS_REJECTED",JIRA_NOT_CONNECTED:"NO_CONNECTION",JIRA_ISSUE_UNAVAILABLE:"ITEM_UNAVAILABLE",LIS_UNAVAILABLE:"INTEGRATION_UNAVAILABLE",LIS_SETUP:"INTEGRATION_SETUP",LIS_FORBIDDEN:"NO_ACCESS",LIS_RATE_LIMITED:"INTEGRATION_BUSY"};function ne(e,n,t){let i=G[t.code]??t.code,s=y(e,n),d=w(e),a=(u,o,g=!1)=>({code:i,message:u,remedy:o,...g?{support:!0}:{}});switch(i){case"INVALID_URL":return a(`${n} isn't a valid public web address, so nothing was added`,"check the address, then run the command again");case"ADDRESS_NOT_ALLOWED":return a(`${n} can't be fetched: it isn't an allowed public web page, so nothing was added`,`use a public page's address, or save the page as a file and add the file:
2
+ import{b as E}from"./chunk-7NPTL66J.js";import{a as A,b as I,c as L,d as p,e as N,f as O,g as R,m as T}from"./chunk-ZTHYAHDN.js";import{Fa as f,ka as c}from"./chunk-7HMSMAUG.js";var h="https://integrations.lambdatest.com",m=" kane-cli context ingest <file>";function $(e){try{let n=new URL(e);return`${n.hostname}${n.pathname==="/"?"":n.pathname}`}catch{return e}}function D(e){switch(e.provider){case"web":return`the page ${e.display}`;case"jira":return`Jira issue ${e.display}`;case"confluence":return e.title?`Confluence page "${e.title}"`:`Confluence page ${e.display.split("/").at(-1)}`;case"linear":return`Linear issue ${e.display}`;case"linear-doc":return e.display.startsWith("document ")?`Linear ${e.display}`:`Linear document "${e.display}"`;default:return e.display}}function U(e,n){let t=C(e,n),i={jira:"Jira issue",confluence:"Confluence page",linear:"Linear issue","linear-doc":"Linear document"}[e];return i&&t!==n?`${i} ${t}`:t}function C(e,n){return e==="jira"?A(n)?.issueKey??n:e==="confluence"?L(n)?.pageId??n:e==="linear"?p(n)?.key??n:e==="linear-doc"?N(n)?.slugId??n:$(n)}var k=(e,n)=>e==="web"?`the page ${$(n)}`:U(e,n);function z(e){if(!e?.url)return null;let n=e.kind==="url"?"web":e.kind==="linear"?p(e.url)?"linear":"linear-doc":e.kind;return["web","jira","confluence","linear","linear-doc"].includes(n)?k(n,e.url):null}var x=e=>e.provider==="confluence"?e.title??e.display.split("/").at(-1):e.display;function P(e,n){let t={reading:e.provider==="web"?e.display:D(e),address:e.address,...n?{as:n}:{}};return e.provider==="confluence"&&!e.title?{...t,shown:`Confluence page ${e.display.split("/").at(-1)}`,bare:!0}:e.provider==="linear-doc"&&e.display.startsWith("document ")?{...t,shown:`Linear ${e.display}`,bare:!0}:{...t,shown:x(e)}}function q(e,n,t){return T(e)?.sourceIdFor(n)===t?void 0:t}function Q(e,n){try{let t=I(e,n)?.title;return typeof t=="string"&&t.length>0?t:void 0}catch{return}}function X(e,n,t,i){let s=C(e,n),d=e==="linear-doc"?t??`document ${s}`:s;return P({provider:e,display:d,...t?{title:t}:{},address:n},i)}var Z=e=>`with ${e.delivered+e.omitted} attachments: ${e.delivered} of its images added, ${e.omitted} left out`,ee=(e,n,t=!1)=>`the same ${t?"file":"text"} as "${e}", already in "${n}"`;function y(e,n){return e==="jira"?A(n)?.issueKey??n:e==="confluence"?`the Confluence page ${L(n)?.pageId??n}`:e==="linear"?p(n)?.key??n:e==="linear-doc"?`the Linear document ${N(n)?.slugId??n}`:`the page ${$(n)}`}var w=e=>e==="jira"?"Jira":e==="confluence"?"Confluence":e.startsWith("linear")?"Linear":"the web",S=e=>e.startsWith("linear")?"Linear":"Atlassian",b=e=>O(e)?.workspace??R(e)?.workspace??"<workspace>",G={invalid_url:"INVALID_URL",target_disallowed:"ADDRESS_NOT_ALLOWED",page_not_found:"PAGE_NOT_FOUND",page_access_blocked:"PAGE_BLOCKED",page_paywalled:"PAGE_PAYWALLED",unsupported_content_type:"NOT_A_PAGE",page_too_large:"PAGE_TOO_LARGE",page_timeout:"PAGE_TIMEOUT",scrape_unavailable:"PAGES_UNAVAILABLE",scrape_rate_limited:"PAGES_UNAVAILABLE",internal_error:"PAGES_UNAVAILABLE",malformed_response:"PAGES_UNAVAILABLE",credit_denied:"OUT_OF_CREDITS",auth_rejected:"CREDENTIALS_REJECTED",route_missing:"PAGES_NOT_AVAILABLE",transport_unreachable:"CONNECTION_FAILED",LIS_AUTH:"CREDENTIALS_REJECTED",JIRA_NOT_CONNECTED:"NO_CONNECTION",JIRA_ISSUE_UNAVAILABLE:"ITEM_UNAVAILABLE",LIS_UNAVAILABLE:"INTEGRATION_UNAVAILABLE",LIS_SETUP:"INTEGRATION_SETUP",LIS_FORBIDDEN:"NO_ACCESS",LIS_RATE_LIMITED:"INTEGRATION_BUSY"};function ne(e,n,t){let i=G[t.code]??t.code,s=y(e,n),d=w(e),a=(u,o,g=!1)=>({code:i,message:u,remedy:o,...g?{support:!0}:{}});switch(i){case"INVALID_URL":return a(`${n} isn't a valid public web address, so nothing was added`,"check the address, then run the command again");case"ADDRESS_NOT_ALLOWED":return a(`${n} can't be fetched: it isn't an allowed public web page, so nothing was added`,`use a public page's address, or save the page as a file and add the file:
3
3
  ${m}`);case"PAGE_NOT_FOUND":return a(`${s} couldn't be found, so nothing was added`,"check that the address is right and the page still exists, then run the command again");case"PAGE_BLOCKED":return a(`${s} refused automated access, so nothing was added`,`use a version of the page anyone can open, or save it as a file and add the file:
4
4
  ${m}`);case"PAGE_PAYWALLED":return a(`${s} is behind a paywall or a sign-in, so nothing was added`,`use a copy anyone can open, or save it as a file and add the file:
5
5
  ${m}`);case"NOT_A_PAGE":return a(`${$(n)} isn't a web page, so nothing was added`,`download the document, then add the file: