@testmuai/kane-cli 0.9.0 → 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 (634) hide show
  1. package/dist/ChatSurface-6NZGMNHL.js +2 -0
  2. package/dist/ChromeProfilePicker-M4WXOB5O.js +2 -0
  3. package/dist/CliFeedbackPrompt-6MJA7DF6.js +2 -0
  4. package/dist/CliUploadProgress-6NLS7XHH.js +2 -0
  5. package/dist/ConfigView-O4WKZ5PU.js +2 -0
  6. package/dist/EvidenceViewOffer-WIEWCZUP.js +2 -0
  7. package/dist/FolderPicker-AF7ZMV3M.js +2 -0
  8. package/dist/InfoBox-D7GGZJU4.js +2 -0
  9. package/dist/LinksBox-DXP66H3H.js +2 -0
  10. package/dist/ProfilesView-TWOY5PVC.js +2 -0
  11. package/dist/ProjectPicker-OBYHJJLU.js +2 -0
  12. package/dist/SaveSessionPrompt-7XSHS4NL.js +2 -0
  13. package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
  14. package/dist/SingleShotApp-XQUDR36R.js +2 -0
  15. package/dist/SummaryBox-IA2KS6GT.js +2 -0
  16. package/dist/TestMdRunView-LS2QUFWR.js +2 -0
  17. package/dist/TestrunEvidenceTable-HNDVJDIF.js +2 -0
  18. package/dist/WhoamiView-SNL75TEF.js +2 -0
  19. package/dist/{agent-parse-2MLJOJTH.js → agent-parse-CAS45UKA.js} +1 -1
  20. package/dist/app-client-U2YYF65L.js +2 -0
  21. package/dist/app-download-UI4ABEIX.js +2 -0
  22. package/dist/assurance-job-FFSSS4XV.js +7 -0
  23. package/dist/auth-7Z54TMQQ.js +2 -0
  24. package/dist/{binary-LVHXED3O.js → binary-THPLXCOD.js} +1 -1
  25. package/dist/bind-4XWK3DG2.js +2 -0
  26. package/dist/bootstrap-6ACT4ALI.js +2 -0
  27. package/dist/bridge-T6QMYKED.js +2 -0
  28. package/dist/build-5ZN47FAT.js +2 -0
  29. package/dist/catalog-MYPS2BXY.js +2 -0
  30. package/dist/{changelog-N5AZHXOS.js → changelog-SU674BVE.js} +1 -1
  31. package/dist/chat-committer-ZCSRJEUB.js +2 -0
  32. package/dist/chat-controller-XINCDH6Z.js +2 -0
  33. package/dist/child-G2GCW73X.js +2 -0
  34. package/dist/chunk-22PIMG52.js +2 -0
  35. package/dist/chunk-2DYHAP4E.js +2 -0
  36. package/dist/chunk-2TVPA3LL.js +2 -0
  37. package/dist/{chunk-FMUV6UCX.js → chunk-2XW33VOK.js} +1 -1
  38. package/dist/chunk-33DWJV67.js +235 -0
  39. package/dist/chunk-34R7BNZ2.js +2 -0
  40. package/dist/chunk-35ECWCCK.js +2 -0
  41. package/dist/{chunk-OHOJSADN.js → chunk-36N3EHW5.js} +1 -1
  42. package/dist/chunk-3BSYOCSW.js +3 -0
  43. package/dist/chunk-3E4ZO73O.js +6 -0
  44. package/dist/chunk-3F5FMH76.js +2 -0
  45. package/dist/chunk-3G2LSTK5.js +2 -0
  46. package/dist/chunk-3GXN6VF6.js +2 -0
  47. package/dist/chunk-3JLEDSG5.js +4 -0
  48. package/dist/chunk-3OQW2GTA.js +2 -0
  49. package/dist/chunk-3QICDXY5.js +5 -0
  50. package/dist/chunk-3RJHXOZH.js +3 -0
  51. package/dist/{chunk-Q5RDCSYM.js → chunk-3YTCKCBG.js} +1 -1
  52. package/dist/chunk-42PALMW2.js +4 -0
  53. package/dist/chunk-44B6THYK.js +2 -0
  54. package/dist/chunk-457Y5TEC.js +19 -0
  55. package/dist/chunk-47WQBG5I.js +6 -0
  56. package/dist/chunk-4I7YN6YY.js +3 -0
  57. package/dist/chunk-4IEQNX7F.js +2 -0
  58. package/dist/chunk-4LTHDJ3D.js +2 -0
  59. package/dist/chunk-4QFTHUJA.js +34 -0
  60. package/dist/chunk-4QTH7VYE.js +2 -0
  61. package/dist/chunk-4YW767UV.js +47 -0
  62. package/dist/chunk-54XA5MZH.js +2 -0
  63. package/dist/chunk-5AKJPYUW.js +11 -0
  64. package/dist/{chunk-AKE2CTV6.js → chunk-5D7ENQTQ.js} +1 -1
  65. package/dist/chunk-63EKRZKI.js +2 -0
  66. package/dist/{chunk-EHN5HTUD.js → chunk-65VANXOF.js} +51 -51
  67. package/dist/{chunk-J3BGYSMD.js → chunk-6DZX5HLZ.js} +8 -8
  68. package/dist/{chunk-YBAVDT3G.js → chunk-6EB5VRAN.js} +1 -1
  69. package/dist/chunk-6NFOH4AC.js +4 -0
  70. package/dist/chunk-6PIIUAZF.js +3 -0
  71. package/dist/chunk-6UVIY56J.js +2 -0
  72. package/dist/chunk-72KYMWQ5.js +2 -0
  73. package/dist/chunk-72RC7JSA.js +21 -0
  74. package/dist/chunk-734ORT6O.js +4 -0
  75. package/dist/chunk-77ZZQJLX.js +2 -0
  76. package/dist/chunk-7AET4JKQ.js +2 -0
  77. package/dist/chunk-7DFBOVUB.js +2 -0
  78. package/dist/chunk-7HMSMAUG.js +29 -0
  79. package/dist/chunk-7HO4NX5W.js +1 -0
  80. package/dist/chunk-7KX2BHKG.js +2 -0
  81. package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
  82. package/dist/chunk-7NPTL66J.js +2 -0
  83. package/dist/chunk-7RWP4Y3H.js +2 -0
  84. package/dist/{chunk-PCKIANML.js → chunk-7SY34IIL.js} +1 -1
  85. package/dist/chunk-7V4BQSSV.js +2 -0
  86. package/dist/chunk-7XBNMOH4.js +6 -0
  87. package/dist/{chunk-SOCHN2PY.js → chunk-7YT4TTKL.js} +1 -1
  88. package/dist/{chunk-C25M2J5Q.js → chunk-ACMBMZDQ.js} +1 -1
  89. package/dist/chunk-AEWNWAXW.js +18 -0
  90. package/dist/chunk-AQ2OG2EF.js +2 -0
  91. package/dist/chunk-AUJSC7PU.js +4 -0
  92. package/dist/chunk-AVI5H4UM.js +13 -0
  93. package/dist/chunk-AVSMXDTX.js +2 -0
  94. package/dist/chunk-AZLNLHUA.js +4 -0
  95. package/dist/{chunk-HGFWIBVF.js → chunk-B7ZX5HEN.js} +5 -5
  96. package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
  97. package/dist/chunk-BWXLZS5O.js +2 -0
  98. package/dist/chunk-BY65QAAN.js +4 -0
  99. package/dist/chunk-C2RUDJ46.js +2 -0
  100. package/dist/chunk-C5Z7MQE6.js +2 -0
  101. package/dist/{chunk-WDMUPK6I.js → chunk-C62QWG4B.js} +1 -1
  102. package/dist/chunk-C6HI6Y3S.js +2 -0
  103. package/dist/chunk-CB4ARIHR.js +2 -0
  104. package/dist/{chunk-7WXMV3O3.js → chunk-CCP4X75B.js} +1 -1
  105. package/dist/chunk-CGITGJ3I.js +4 -0
  106. package/dist/chunk-CM4CHYSN.js +2 -0
  107. package/dist/{chunk-ZXY4P76I.js → chunk-CUXY6KQ2.js} +1 -1
  108. package/dist/chunk-D36V5OX6.js +2 -0
  109. package/dist/chunk-D756UWY2.js +6 -0
  110. package/dist/chunk-D7TKE7LK.js +2 -0
  111. package/dist/{chunk-UWXDURAB.js → chunk-D7U2M26S.js} +1 -1
  112. package/dist/chunk-DBMW3VUN.js +4 -0
  113. package/dist/chunk-DDZLCAEO.js +5 -0
  114. package/dist/chunk-DJC7NTLA.js +3 -0
  115. package/dist/chunk-DPGOAFKF.js +2 -0
  116. package/dist/chunk-DREQ3RAA.js +2 -0
  117. package/dist/chunk-DTUPEKEO.js +2 -0
  118. package/dist/chunk-DZOYYWOW.js +2 -0
  119. package/dist/chunk-E6KSRQXL.js +8 -0
  120. package/dist/chunk-EBPRPNSA.js +2 -0
  121. package/dist/chunk-ECPFI75W.js +5 -0
  122. package/dist/chunk-EECDDDSB.js +3 -0
  123. package/dist/chunk-EF47KRUK.js +2 -0
  124. package/dist/chunk-ETZMFRD6.js +2 -0
  125. package/dist/chunk-EZN7CF45.js +4 -0
  126. package/dist/{chunk-CNUCP6DK.js → chunk-F22K3RRX.js} +1 -1
  127. package/dist/{chunk-WRSIKZ2V.js → chunk-F5NHG7VB.js} +1 -1
  128. package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
  129. package/dist/chunk-FIP5L6LV.js +9 -0
  130. package/dist/chunk-FOJHSG5M.js +6 -0
  131. package/dist/chunk-FSYOTRMC.js +2 -0
  132. package/dist/chunk-FWDUVFS6.js +26 -0
  133. package/dist/chunk-FWUPJORV.js +6 -0
  134. package/dist/chunk-GFLB2SHW.js +2 -0
  135. package/dist/chunk-GMTHZUZ3.js +2 -0
  136. package/dist/chunk-GQRU3B54.js +1397 -0
  137. package/dist/chunk-GRURFGBP.js +2 -0
  138. package/dist/chunk-GXKY5A46.js +9 -0
  139. package/dist/chunk-HAW5WEKT.js +13 -0
  140. package/dist/chunk-HCJ2N3XB.js +12 -0
  141. package/dist/chunk-HHW6MRU3.js +6 -0
  142. package/dist/chunk-HIUAUZNL.js +2 -0
  143. package/dist/chunk-HJLMH7ZM.js +2 -0
  144. package/dist/{chunk-YWYORBY3.js → chunk-HJMCXSUJ.js} +1 -1
  145. package/dist/chunk-HK62JVQM.js +3 -0
  146. package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
  147. package/dist/chunk-I2MC6VVX.js +2 -0
  148. package/dist/chunk-I4RVVBG3.js +10 -0
  149. package/dist/chunk-I4WXALQR.js +2 -0
  150. package/dist/chunk-ICLUC44J.js +2 -0
  151. package/dist/{chunk-6HU5M2DS.js → chunk-IGEAET7M.js} +1 -1
  152. package/dist/{chunk-GCISXCDU.js → chunk-IINZZ4BZ.js} +1 -1
  153. package/dist/chunk-IJ2AHSWW.js +2 -0
  154. package/dist/{chunk-CSNJPD2J.js → chunk-IUQOG7Z5.js} +3 -3
  155. package/dist/chunk-IZ65ZPWY.js +3 -0
  156. package/dist/chunk-JGRXMTME.js +15 -0
  157. package/dist/{chunk-NBXYL2JT.js → chunk-JIRNI5TB.js} +7 -7
  158. package/dist/chunk-JNSWKGTB.js +2 -0
  159. package/dist/chunk-JZP3Y4ZM.js +2 -0
  160. package/dist/chunk-KF4DKXSS.js +2 -0
  161. package/dist/chunk-KGNE5CIM.js +2 -0
  162. package/dist/chunk-KM3YCIDV.js +3 -0
  163. package/dist/{chunk-HAYV4D2I.js → chunk-KODJVOCN.js} +1 -1
  164. package/dist/chunk-KU3YHPWZ.js +2 -0
  165. package/dist/{chunk-M3UAZTDK.js → chunk-KXHJMAZU.js} +2 -2
  166. package/dist/chunk-L5DALV5N.js +2 -0
  167. package/dist/chunk-LAOTVZHV.js +6 -0
  168. package/dist/chunk-LCSJ7GOG.js +2 -0
  169. package/dist/{chunk-DWMESHFI.js → chunk-LIGTP3A3.js} +1 -1
  170. package/dist/chunk-LKQFG4RW.js +5 -0
  171. package/dist/{chunk-EBLXHOE3.js → chunk-LQQNPMOD.js} +1 -1
  172. package/dist/chunk-LSDJOVWW.js +6 -0
  173. package/dist/{chunk-C6S2RPZA.js → chunk-LUR7JFPP.js} +1 -1
  174. package/dist/chunk-LUZBGTYB.js +2 -0
  175. package/dist/chunk-LX2I4JEH.js +2 -0
  176. package/dist/{chunk-7GAHJZLH.js → chunk-M43WH5DQ.js} +1 -1
  177. package/dist/chunk-MEKPGQAM.js +21 -0
  178. package/dist/chunk-MNBGG4H3.js +16 -0
  179. package/dist/chunk-MYVKUJGS.js +2 -0
  180. package/dist/chunk-MYZHOBS4.js +2 -0
  181. package/dist/chunk-NC7D7GOM.js +21 -0
  182. package/dist/chunk-NIVFEACM.js +2 -0
  183. package/dist/chunk-NLZZLANH.js +4 -0
  184. package/dist/{chunk-XT7XA4DN.js → chunk-NXAJBSIF.js} +1 -1
  185. package/dist/chunk-NXRF7FFS.js +2 -0
  186. package/dist/chunk-NZ6AV2TA.js +4 -0
  187. package/dist/chunk-O3HHTKZ5.js +6 -0
  188. package/dist/chunk-OCDBTAYS.js +12 -0
  189. package/dist/chunk-OFSDB7B4.js +3 -0
  190. package/dist/{chunk-Q5CINJYL.js → chunk-OGFU4YY4.js} +1 -1
  191. package/dist/chunk-OJ33Q6DU.js +2 -0
  192. package/dist/chunk-P2ZQDQDB.js +2 -0
  193. package/dist/{chunk-KXEE6VCA.js → chunk-P3JXJ4BW.js} +1 -1
  194. package/dist/chunk-PAWQ4AKN.js +2 -0
  195. package/dist/chunk-PUVMC4PX.js +26 -0
  196. package/dist/{chunk-SEEEGDVK.js → chunk-PZA3BSOE.js} +1 -1
  197. package/dist/chunk-Q3C6NDGI.js +2 -0
  198. package/dist/chunk-QBYENBMB.js +2 -0
  199. package/dist/chunk-QDFY5GGO.js +5 -0
  200. package/dist/chunk-QDXKEOKI.js +16 -0
  201. package/dist/{chunk-6VY62QC2.js → chunk-QENCC2ZS.js} +1 -1
  202. package/dist/chunk-QI5RZ7LL.js +2 -0
  203. package/dist/chunk-QXQ7KVEN.js +2 -0
  204. package/dist/chunk-R4JUKTDO.js +2 -0
  205. package/dist/chunk-R7KXAISS.js +12 -0
  206. package/dist/chunk-RDP7GWSY.js +2 -0
  207. package/dist/chunk-REKHAN53.js +5 -0
  208. package/dist/chunk-RF37IJNN.js +2 -0
  209. package/dist/{chunk-KWEOLPBJ.js → chunk-RFEON5GN.js} +1 -1
  210. package/dist/chunk-RHGW7B5Q.js +2 -0
  211. package/dist/chunk-RPRXRKKR.js +2 -0
  212. package/dist/{chunk-EOA6YPES.js → chunk-RTVHJ23A.js} +4 -4
  213. package/dist/chunk-RTVWQK7I.js +2 -0
  214. package/dist/chunk-RX6776AI.js +5 -0
  215. package/dist/{chunk-F7NSSQYZ.js → chunk-SGPAM5DZ.js} +1 -1
  216. package/dist/chunk-SMTBOSEJ.js +2 -0
  217. package/dist/chunk-SMXABALN.js +2 -0
  218. package/dist/{chunk-TM7VRLWS.js → chunk-SXRHKXSE.js} +1 -1
  219. package/dist/chunk-TNORODUF.js +2 -0
  220. package/dist/chunk-TU42YZOJ.js +6 -0
  221. package/dist/chunk-TU7TVFBK.js +2 -0
  222. package/dist/chunk-TW5AA5A7.js +8 -0
  223. package/dist/chunk-UEE3RZN4.js +14 -0
  224. package/dist/chunk-URH4FX3H.js +2 -0
  225. package/dist/chunk-UTM7D4PI.js +2 -0
  226. package/dist/chunk-UUJIGOEO.js +2 -0
  227. package/dist/chunk-UYDHOHSZ.js +2 -0
  228. package/dist/{chunk-4BZOG6PE.js → chunk-V7USCQWO.js} +1 -1
  229. package/dist/chunk-VJGWVBZR.js +1 -0
  230. package/dist/chunk-VLDCHFXF.js +2 -0
  231. package/dist/chunk-VO66KP2W.js +2 -0
  232. package/dist/chunk-VRIZDOO5.js +2 -0
  233. package/dist/{chunk-DOOI2JBD.js → chunk-VSVWNRI2.js} +1 -1
  234. package/dist/chunk-VUFIL5VR.js +6 -0
  235. package/dist/chunk-VX657KIK.js +2 -0
  236. package/dist/chunk-VXGN3IV7.js +2 -0
  237. package/dist/chunk-VZ4A6WMK.js +97 -0
  238. package/dist/chunk-VZJ6LUXX.js +2 -0
  239. package/dist/{chunk-RWSOZPJQ.js → chunk-W4QSZNMB.js} +1 -1
  240. package/dist/chunk-W54OT2FU.js +9 -0
  241. package/dist/{chunk-BL3SJDCG.js → chunk-W6HZF56M.js} +1 -1
  242. package/dist/chunk-W72ACCFL.js +27 -0
  243. package/dist/chunk-W7FLXW6Q.js +5 -0
  244. package/dist/chunk-WAOUE7MP.js +9 -0
  245. package/dist/chunk-WEIPY3CI.js +16 -0
  246. package/dist/chunk-WMGKUERB.js +6 -0
  247. package/dist/{chunk-DFS4RMVP.js → chunk-WN5VKKJ3.js} +1 -1
  248. package/dist/chunk-WOSANGV6.js +5 -0
  249. package/dist/{chunk-K3IQEL7R.js → chunk-WXJCJL5L.js} +1 -1
  250. package/dist/chunk-WZXPF3BI.js +2 -0
  251. package/dist/chunk-XB6BJPDL.js +2 -0
  252. package/dist/{chunk-4FHK4LKQ.js → chunk-XLEGGC4Y.js} +1 -1
  253. package/dist/chunk-XMPTFXPW.js +5 -0
  254. package/dist/chunk-XQMWHPZI.js +3 -0
  255. package/dist/{chunk-75MMTNPB.js → chunk-XRNQSXOM.js} +2 -2
  256. package/dist/{chunk-2PKME4VT.js → chunk-XZGEN4NU.js} +4 -4
  257. package/dist/chunk-XZYA7DNH.js +2 -0
  258. package/dist/{chunk-OIUV3ISA.js → chunk-Y6Y6RAY4.js} +1 -1
  259. package/dist/chunk-Y7E5L42F.js +3 -0
  260. package/dist/{chunk-GFBAK7WQ.js → chunk-YAW6JW6D.js} +7 -7
  261. package/dist/chunk-YDPTSDIJ.js +2 -0
  262. package/dist/chunk-YDSGXB25.js +2 -0
  263. package/dist/chunk-YGRULEZY.js +2 -0
  264. package/dist/chunk-YHFZFV3A.js +22 -0
  265. package/dist/chunk-YIKF4ERQ.js +375 -0
  266. package/dist/chunk-YLXWAY7D.js +2 -0
  267. package/dist/{chunk-UA2QDAWT.js → chunk-YPFQ4UGF.js} +1 -1
  268. package/dist/{chunk-4CYBXJIA.js → chunk-YQ5C6UDG.js} +1 -1
  269. package/dist/chunk-Z55KBMYV.js +2 -0
  270. package/dist/chunk-ZAFJQ3SM.js +2 -0
  271. package/dist/chunk-ZCRZFAOT.js +2 -0
  272. package/dist/chunk-ZFM77AQU.js +2 -0
  273. package/dist/{chunk-Q6F23V7L.js → chunk-ZFMRQ57Y.js} +1 -1
  274. package/dist/chunk-ZHWU6L2G.js +5 -0
  275. package/dist/chunk-ZTHYAHDN.js +17 -0
  276. package/dist/{chunk-X2A6CC6B.js → chunk-ZTRRFG52.js} +1 -1
  277. package/dist/chunk-ZU4W2QGM.js +3 -0
  278. package/dist/committer-JGY66PFM.js +2 -0
  279. package/dist/config-754B73XK.js +2 -0
  280. package/dist/controller-client-PB3AZAGG.js +2 -0
  281. package/dist/cover-cmd-NBNZCR6C.js +2 -0
  282. package/dist/{credentials-QD32Y7K7.js → credentials-F7DYLVWY.js} +1 -1
  283. package/dist/{deps-bundle-OI7JJ22L.js → deps-bundle-PW3WEQJ7.js} +1 -1
  284. package/dist/{deps-resolve-ZOALDS6H.js → deps-resolve-SQYVN76L.js} +1 -1
  285. package/dist/descriptor-7T32VRMB.js +2 -0
  286. package/dist/design-chat-F3OEZPNJ.js +2 -0
  287. package/dist/design-committer-TRYP3LOZ.js +2 -0
  288. package/dist/design-headless-OTHYOX3E.js +2 -0
  289. package/dist/design-remote-2BEGCVCX.js +3 -0
  290. package/dist/device-env-CHFRRV6W.js +2 -0
  291. package/dist/dispatch-DVQ3H7EJ.js +2 -0
  292. package/dist/doctor-XY26Z35T.js +2 -0
  293. package/dist/docx-convert-6IZO5P5K.js +2 -0
  294. package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
  295. package/dist/evidence-P6FFKC7B.js +2 -0
  296. package/dist/evidence-presentation-YYTIDCBS.js +2 -0
  297. package/dist/evolve-cmd-WWOB3QJR.js +2 -0
  298. package/dist/evolve-remote-WLVY3QID.js +2 -0
  299. package/dist/{exit-manager-ZLDO54S4.js → exit-manager-EDHCETUN.js} +1 -1
  300. package/dist/explain-DGJ5T6V5.js +2 -0
  301. package/dist/explain-cmd-OP5I5W3O.js +12 -0
  302. package/dist/explain-cmd-VYAANFFZ.js +4 -0
  303. package/dist/explore-K5YBGHK6.js +2 -0
  304. package/dist/explore-context-tty-RZ7D2TBV.js +2 -0
  305. package/dist/explore-entry-EKXJ67BD.js +6 -0
  306. package/dist/explore-live-2YVRAQZO.js +5 -0
  307. package/dist/explore-run-tty-D47FGPX7.js +5 -0
  308. package/dist/extract-bind-W2NET364.js +14 -0
  309. package/dist/extract-chat-M65NWGUK.js +2 -0
  310. package/dist/extract-cmd-FTFLETOP.js +6 -0
  311. package/dist/extract-headless-G6W6JQ27.js +2 -0
  312. package/dist/feeder-NY45UFJK.js +2 -0
  313. package/dist/folder-flags-KKIH654K.js +2 -0
  314. package/dist/gaps-cmd-OIDDLRYL.js +3 -0
  315. package/dist/gate-7AKRPRMK.js +2 -0
  316. package/dist/gate-WISOUTHQ.js +2 -0
  317. package/dist/{generate-headless-6WMJYNI6.js → generate-headless-RURIEKVS.js} +3 -3
  318. package/dist/headless-io-FFM5T6KL.js +2 -0
  319. package/dist/hold-passthrough-IOWPVB4W.js +2 -0
  320. package/dist/identity-HL5CJJXR.js +2 -0
  321. package/dist/index.js +178 -160
  322. package/dist/ingest-PDGS5ZTL.js +2 -0
  323. package/dist/ingest-cmd-4G2AK4Y2.js +8 -0
  324. package/dist/ingest-remote-SSLUHQVG.js +2 -0
  325. package/dist/ink-screen-RZ7QDIUI.js +2 -0
  326. package/dist/install-ZVBHPXGP.js +2 -0
  327. package/dist/interactive-bind-SI2ZS55Q.js +26 -0
  328. package/dist/interactive-remote-J56EWJGA.js +65 -0
  329. package/dist/interrupt-guard-QETBPINI.js +2 -0
  330. package/dist/lane-AQYRIW24.js +2 -0
  331. package/dist/lattice-auth-6FEVSR7E.js +2 -0
  332. package/dist/lifecycle-cmd-HJ37LTXE.js +2 -0
  333. package/dist/list-cmd-6XL2FYLQ.js +3 -0
  334. package/dist/list-commands-5DCCKU3L.js +2 -0
  335. package/dist/list-remote-LXPQNXYN.js +15 -0
  336. package/dist/locks-cmd-JJ2QNTNY.js +2 -0
  337. package/dist/logical-ids-RXAQJZ3T.js +2 -0
  338. package/dist/login-flow-WEK3E476.js +2 -0
  339. package/dist/maintenance-cmd-BXXHP36K.js +2 -0
  340. package/dist/mobile-prompts-CECJ5UY2.js +2 -0
  341. package/dist/{next-KZXH4UA4.js → next-O6SUSX3R.js} +1 -1
  342. package/dist/{objective-variable-gate-CG2KK5UX.js → objective-variable-gate-3Z7DNVVC.js} +1 -1
  343. package/dist/onboarding-PDVYMTY5.js +5 -0
  344. package/dist/open-provider-OZAG6WZS.js +2 -0
  345. package/dist/{paths-JCYX6UWL.js → paths-UMIX3RJF.js} +1 -1
  346. package/dist/pdf-convert-447ACUB3.js +2 -0
  347. package/dist/persist-recorded-session-A3ID7JFA.js +3 -0
  348. package/dist/phase-seed-LCJ4WSYV.js +2 -0
  349. package/dist/pipeline-GX3LKPI5.js +2 -0
  350. package/dist/prepare-target-FMT6QFHZ.js +2 -0
  351. package/dist/pull-cmd-UPFQYUND.js +2 -0
  352. package/dist/pull-route-FWBXJMR7.js +2 -0
  353. package/dist/readmodel-INMP6MNW.js +2 -0
  354. package/dist/real-device-run-X7JJWOIK.js +2 -0
  355. package/dist/reconcile-cmd-JBH365JL.js +5 -0
  356. package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
  357. package/dist/reconcile-remote-BCX6SWFC.js +13 -0
  358. package/dist/recording-banner-YKBAL6UB.js +2 -0
  359. package/dist/registry-VQC757MJ.js +2 -0
  360. package/dist/remote-entry-X6JMPC2K.js +2 -0
  361. package/dist/remote-mode-FDPA7EWG.js +4 -0
  362. package/dist/remote-words-YVB66R3F.js +2 -0
  363. package/dist/require-project-folder-MLMEQJYP.js +2 -0
  364. package/dist/resolve-run-intent-PC7TQZUL.js +2 -0
  365. package/dist/resolver-EID34LQE.js +2 -0
  366. package/dist/revert-FHOBLZWF.js +2 -0
  367. package/dist/review-cmd-EUHFLFMY.js +5 -0
  368. package/dist/run-5RQUCNYP.js +2 -0
  369. package/dist/run-PC5YO4AS.js +2 -0
  370. package/dist/run-channel-63SVP5OI.js +2 -0
  371. package/dist/run-remote-SJCRTL7O.js +2 -0
  372. package/dist/run-startup-gate-YO66G6LS.js +2 -0
  373. package/dist/run-test-md-BLNBK4MH.js +17 -0
  374. package/dist/scrollback-GGNBDFQV.js +2 -0
  375. package/dist/session-target-DD53UXO7.js +2 -0
  376. package/dist/session-worker.js +12 -0
  377. package/dist/sessions-CFV7FOIT.js +2 -0
  378. package/dist/sessions-cmd-S7WZBUCN.js +26 -0
  379. package/dist/sessions-remote-IWHWIQ2T.js +3 -0
  380. package/dist/shell-arg-FN3MT5U7.js +2 -0
  381. package/dist/{skill-installer-32YYMM4N.js → skill-installer-MAVQY6GW.js} +1 -1
  382. package/dist/spawner-C7NLLM4F.js +2 -0
  383. package/dist/store-MSA7KASS.js +2 -0
  384. package/dist/store-choice-3OJCV26J.js +2 -0
  385. package/dist/store-guard-OOSDLMEC.js +2 -0
  386. package/dist/store-id-YZ5WKJ25.js +2 -0
  387. package/dist/store-site-KA2DNBGY.js +2 -0
  388. package/dist/stream-warnings-GEQKKJU7.js +2 -0
  389. package/dist/structured-answers-EQ2AP3F7.js +2 -0
  390. package/dist/sync-cmd-RDFDMVKQ.js +2 -0
  391. package/dist/sync-setup-RBRDUV7Q.js +2 -0
  392. package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
  393. package/dist/tcg-generate-KIECTZ2C.js +2 -0
  394. package/dist/test-definition-VRI4YIYL.js +2 -0
  395. package/dist/testmd-actions-CMAG6HWI.js +2 -0
  396. package/dist/testmd-sync-UPAA5UMD.js +2 -0
  397. package/dist/tms-client-NXAB6VJD.js +2 -0
  398. package/dist/token-refresh-KP3AYMYK.js +2 -0
  399. package/dist/trust-gate-AT2XBWN4.js +2 -0
  400. package/dist/turn-preflight-LHYLRL7G.js +2 -0
  401. package/dist/ui-SNV3FD2G.js +4 -0
  402. package/dist/use-case-ref-NE4X4MZN.js +2 -0
  403. package/dist/validate-basic-M5JHHNZA.js +2 -0
  404. package/dist/{variable-receipt-YWNS24TH.js → variable-receipt-BXSZO36E.js} +1 -1
  405. package/dist/verdicts-XK3GAUX3.js +2 -0
  406. package/dist/version-check-Q737BE65.js +2 -0
  407. package/dist/{view-cmd-3WHG6MVB.js → view-cmd-XSNL5DGI.js} +4 -3
  408. package/dist/walk-session-SHGYLFRB.js +2 -0
  409. package/dist/with-telemetry-PM2HVN2B.js +2 -0
  410. package/package.json +11 -11
  411. package/dist/ChatSurface-FJPK3XEJ.js +0 -8
  412. package/dist/ChromeProfilePicker-7DUDJTE2.js +0 -2
  413. package/dist/CliFeedbackPrompt-ZZPYC6OS.js +0 -2
  414. package/dist/CliUploadProgress-WQYKIBAR.js +0 -2
  415. package/dist/ConfigView-KXNOODDW.js +0 -2
  416. package/dist/EvidenceViewOffer-BTBVPBZX.js +0 -2
  417. package/dist/FolderPicker-H4YEX5LV.js +0 -2
  418. package/dist/InfoBox-DTM7X24Z.js +0 -2
  419. package/dist/LinksBox-KFG3FVOT.js +0 -2
  420. package/dist/ProfilesView-KBZHT4KL.js +0 -2
  421. package/dist/ProjectPicker-OARWULNN.js +0 -2
  422. package/dist/SaveSessionPrompt-37SMU5MC.js +0 -2
  423. package/dist/ScrollbackTap-QHJOFYMC.js +0 -2
  424. package/dist/SingleShotApp-UYCAW65Y.js +0 -2
  425. package/dist/SummaryBox-6RB5DSAH.js +0 -2
  426. package/dist/TestMdRunView-ZMOII3PL.js +0 -2
  427. package/dist/TestrunEvidenceTable-3UP2EYIV.js +0 -2
  428. package/dist/WhoamiView-MC62GERR.js +0 -2
  429. package/dist/app-client-PQFJAB63.js +0 -2
  430. package/dist/app-download-P6YXWSVQ.js +0 -2
  431. package/dist/auth-LXW4OFKF.js +0 -2
  432. package/dist/bind-ZYESQSCJ.js +0 -15
  433. package/dist/bootstrap-DI4UGMH3.js +0 -2
  434. package/dist/bridge-7J3JE3JS.js +0 -2
  435. package/dist/build-JIKYOZUH.js +0 -2
  436. package/dist/catalog-LLME3744.js +0 -2
  437. package/dist/chat-committer-6D7AQI6Z.js +0 -2
  438. package/dist/chat-controller-UJQ6Z4RE.js +0 -2
  439. package/dist/chunk-243ZJHT6.js +0 -4
  440. package/dist/chunk-2KVECC36.js +0 -2
  441. package/dist/chunk-2YEHV2CX.js +0 -2
  442. package/dist/chunk-3MCPTVJX.js +0 -2
  443. package/dist/chunk-3UI5VTQS.js +0 -4
  444. package/dist/chunk-3VAU3PNU.js +0 -2
  445. package/dist/chunk-3YIZG7WZ.js +0 -3
  446. package/dist/chunk-4Y2WH77W.js +0 -2
  447. package/dist/chunk-5EOX4MEY.js +0 -2
  448. package/dist/chunk-5HMN74RZ.js +0 -9
  449. package/dist/chunk-5LJRZI7S.js +0 -6
  450. package/dist/chunk-5RCS2LIQ.js +0 -26
  451. package/dist/chunk-5TQFOPJV.js +0 -2
  452. package/dist/chunk-5ZFOKYFB.js +0 -5
  453. package/dist/chunk-63DYVWNX.js +0 -2
  454. package/dist/chunk-6MD7SR7D.js +0 -9
  455. package/dist/chunk-7N6OCHPC.js +0 -7
  456. package/dist/chunk-A2SQD2AY.js +0 -4
  457. package/dist/chunk-AACQE24F.js +0 -2
  458. package/dist/chunk-AHFIRHSP.js +0 -18
  459. package/dist/chunk-AJT34ESA.js +0 -38
  460. package/dist/chunk-AUMJ4RVA.js +0 -21
  461. package/dist/chunk-AXTPNZPX.js +0 -2
  462. package/dist/chunk-BB2W35TW.js +0 -2
  463. package/dist/chunk-BKM2LWU2.js +0 -3
  464. package/dist/chunk-BUPRL2TE.js +0 -2
  465. package/dist/chunk-C44QQJR4.js +0 -239
  466. package/dist/chunk-CW3RHKLA.js +0 -5
  467. package/dist/chunk-D6E6KRVX.js +0 -2
  468. package/dist/chunk-DTRKTBCE.js +0 -17
  469. package/dist/chunk-DTRSYWZE.js +0 -2
  470. package/dist/chunk-EVFFDODK.js +0 -5
  471. package/dist/chunk-F2OBORCG.js +0 -2
  472. package/dist/chunk-FQNQVC5O.js +0 -5
  473. package/dist/chunk-FY7TCYPK.js +0 -6
  474. package/dist/chunk-GTVQYT3D.js +0 -35
  475. package/dist/chunk-HG5LLZBU.js +0 -2
  476. package/dist/chunk-I7TIGB7K.js +0 -2
  477. package/dist/chunk-IICT4VOU.js +0 -2
  478. package/dist/chunk-ILDHE4P4.js +0 -6
  479. package/dist/chunk-IPXKUYUK.js +0 -2
  480. package/dist/chunk-JQY5HRZ4.js +0 -15
  481. package/dist/chunk-JX6BFEDO.js +0 -4
  482. package/dist/chunk-K2UJYY2U.js +0 -2
  483. package/dist/chunk-KBM3XHAM.js +0 -2
  484. package/dist/chunk-KDNNMU7Q.js +0 -4
  485. package/dist/chunk-KJQNAOOE.js +0 -6
  486. package/dist/chunk-LH4IPANP.js +0 -2
  487. package/dist/chunk-LLG7NEGX.js +0 -6
  488. package/dist/chunk-LSDWPG6C.js +0 -2
  489. package/dist/chunk-MSGW4JDG.js +0 -2
  490. package/dist/chunk-NJ4BXZBX.js +0 -2
  491. package/dist/chunk-NLCCBXXV.js +0 -2
  492. package/dist/chunk-NMSZ7G6P.js +0 -2
  493. package/dist/chunk-OC6H6BYI.js +0 -6
  494. package/dist/chunk-OJAXOOZ5.js +0 -8
  495. package/dist/chunk-OMNLAGQC.js +0 -29
  496. package/dist/chunk-OOCCUUR2.js +0 -2
  497. package/dist/chunk-OXC6O5O7.js +0 -2
  498. package/dist/chunk-OZQDD2EX.js +0 -94
  499. package/dist/chunk-PEDINHVU.js +0 -2
  500. package/dist/chunk-PNUAP3RY.js +0 -8
  501. package/dist/chunk-Q2F5QB2W.js +0 -2
  502. package/dist/chunk-Q4YYAN6E.js +0 -2
  503. package/dist/chunk-Q6AHSGOE.js +0 -5
  504. package/dist/chunk-QAB3Y5FQ.js +0 -4
  505. package/dist/chunk-RDHWNSDP.js +0 -7
  506. package/dist/chunk-RKXHVP2Z.js +0 -2
  507. package/dist/chunk-RRY5IXOB.js +0 -2
  508. package/dist/chunk-RSSOJ3L2.js +0 -21
  509. package/dist/chunk-RTSBKCZY.js +0 -16
  510. package/dist/chunk-SID4X77D.js +0 -370
  511. package/dist/chunk-SRTKRHYI.js +0 -12
  512. package/dist/chunk-T2ONUKTL.js +0 -5
  513. package/dist/chunk-U6OTFMIT.js +0 -4
  514. package/dist/chunk-UD7KKHPW.js +0 -5
  515. package/dist/chunk-USOYXCZ4.js +0 -2
  516. package/dist/chunk-USY7VAO6.js +0 -2
  517. package/dist/chunk-V4B5QA3U.js +0 -4
  518. package/dist/chunk-VBS33P2C.js +0 -2
  519. package/dist/chunk-VHW7BMZQ.js +0 -2
  520. package/dist/chunk-VIO7CCFW.js +0 -5
  521. package/dist/chunk-VORWZLS3.js +0 -9
  522. package/dist/chunk-VVOKM2VO.js +0 -2
  523. package/dist/chunk-W5TTF7GB.js +0 -6
  524. package/dist/chunk-WESMQEPO.js +0 -2
  525. package/dist/chunk-WMI4P76K.js +0 -27
  526. package/dist/chunk-WNOC6MQC.js +0 -2
  527. package/dist/chunk-WVHMPIDQ.js +0 -2
  528. package/dist/chunk-XBX643ZD.js +0 -2
  529. package/dist/chunk-XKHWWKJZ.js +0 -3
  530. package/dist/chunk-XLSOQLVT.js +0 -2
  531. package/dist/chunk-Y3ZYN6AK.js +0 -4
  532. package/dist/chunk-YCCUBQY4.js +0 -2
  533. package/dist/chunk-YKTYVJBN.js +0 -3
  534. package/dist/chunk-YLQHY4A7.js +0 -2
  535. package/dist/chunk-Z7IGTVJW.js +0 -2
  536. package/dist/chunk-ZC2CKWLB.js +0 -2
  537. package/dist/chunk-ZER3FZSZ.js +0 -22
  538. package/dist/chunk-ZJYT72BA.js +0 -9
  539. package/dist/chunk-ZKSN2SJ7.js +0 -2
  540. package/dist/chunk-ZLWURCJ7.js +0 -2
  541. package/dist/committer-2QPBANRD.js +0 -2
  542. package/dist/config-YGTHSGQN.js +0 -2
  543. package/dist/controller-client-ZF5IXRUV.js +0 -2
  544. package/dist/cover-cmd-6RO366CC.js +0 -3
  545. package/dist/descriptor-3JJUOHBM.js +0 -2
  546. package/dist/design-committer-D44GSUXY.js +0 -2
  547. package/dist/device-env-DXDJJMTL.js +0 -2
  548. package/dist/dispatch-7EWWQRQ5.js +0 -2
  549. package/dist/doctor-TPYPEEUL.js +0 -2
  550. package/dist/docx-convert-SQRTF7XS.js +0 -2
  551. package/dist/evidence-NPFTBGDF.js +0 -2
  552. package/dist/evidence-presentation-XF23B7F2.js +0 -2
  553. package/dist/evolve-cmd-VGVXV6XW.js +0 -2
  554. package/dist/explain-NEFBUX5G.js +0 -2
  555. package/dist/explain-cmd-GOP5TE63.js +0 -9
  556. package/dist/explain-cmd-M7IX2YNB.js +0 -3
  557. package/dist/extract-bind-CKIRLXAJ.js +0 -14
  558. package/dist/extract-cmd-3EWLSPGS.js +0 -5
  559. package/dist/feeder-66TUPB2R.js +0 -2
  560. package/dist/gaps-cmd-WVC5GXQC.js +0 -3
  561. package/dist/gate-OYRDJMF6.js +0 -2
  562. package/dist/headless-io-75HUMWZB.js +0 -2
  563. package/dist/identity-ADZ4PAJF.js +0 -2
  564. package/dist/ingest-OSNNM3DH.js +0 -2
  565. package/dist/ingest-cmd-AECK5T4H.js +0 -2
  566. package/dist/install-ZV3KJZV4.js +0 -2
  567. package/dist/interactive-bind-IYS6KDOH.js +0 -26
  568. package/dist/interrupt-guard-UREUWNRL.js +0 -2
  569. package/dist/lifecycle-cmd-XCSBELFQ.js +0 -2
  570. package/dist/list-cmd-S4DSN2ET.js +0 -3
  571. package/dist/list-commands-GLNGHPDU.js +0 -2
  572. package/dist/locks-cmd-67OHQZNV.js +0 -2
  573. package/dist/logical-ids-GLVM2SVR.js +0 -2
  574. package/dist/login-flow-ASUUU7SO.js +0 -2
  575. package/dist/maintenance-cmd-K5KXRIFL.js +0 -2
  576. package/dist/mobile-prompts-ZUZTA3RV.js +0 -2
  577. package/dist/open-provider-YIBB77FE.js +0 -2
  578. package/dist/pdf-convert-RLXSXFWN.js +0 -2
  579. package/dist/persist-recorded-session-EWV56TSZ.js +0 -3
  580. package/dist/phase-seed-MKHEWUN6.js +0 -2
  581. package/dist/pipeline-LAWACB2O.js +0 -2
  582. package/dist/prepare-target-WGPCZKLE.js +0 -2
  583. package/dist/readmodel-FVLRQWZ7.js +0 -2
  584. package/dist/real-device-run-MDLFKFVQ.js +0 -2
  585. package/dist/reconcile-cmd-XFM2ZXUJ.js +0 -2
  586. package/dist/reconcile-deps-V5VLDPYT.js +0 -4
  587. package/dist/reconcile-engine-VZBTMPUK.js +0 -2
  588. package/dist/recording-banner-CJHRPHHF.js +0 -2
  589. package/dist/records-LMCVKPE5.js +0 -2
  590. package/dist/registry-3JXQFZEG.js +0 -2
  591. package/dist/require-project-folder-SE5GVCYJ.js +0 -2
  592. package/dist/resolve-run-intent-DD4MB6UD.js +0 -2
  593. package/dist/resolver-TLO4SRWV.js +0 -2
  594. package/dist/revert-NOUECRW4.js +0 -2
  595. package/dist/review-cmd-7EOYQMPE.js +0 -5
  596. package/dist/run-EHUNJPW6.js +0 -2
  597. package/dist/run-OTMPUQSH.js +0 -2
  598. package/dist/run-channel-RGH4WIQX.js +0 -2
  599. package/dist/run-test-md-KBDEHGXJ.js +0 -17
  600. package/dist/scrollback-JLPJR25X.js +0 -2
  601. package/dist/session-items-2ATN7VXG.js +0 -2
  602. package/dist/session-target-UMNASXI7.js +0 -2
  603. package/dist/sessions-NH7WQWMX.js +0 -2
  604. package/dist/sessions-cmd-M3SECFKQ.js +0 -25
  605. package/dist/spawner-DPT2RLAO.js +0 -2
  606. package/dist/store-guard-U32JE6JJ.js +0 -2
  607. package/dist/store-id-EOSGEKVK.js +0 -2
  608. package/dist/structured-answers-ZI2B6JJE.js +0 -2
  609. package/dist/sync-cmd-3EP7LZGL.js +0 -2
  610. package/dist/sync-setup-SWTBVQEV.js +0 -2
  611. package/dist/tcg-generate-KXU7E2GF.js +0 -2
  612. package/dist/testmd-actions-PEWCPQ5R.js +0 -2
  613. package/dist/testmd-sync-ZWFQWZ2X.js +0 -2
  614. package/dist/tms-client-KU6HCA23.js +0 -2
  615. package/dist/token-refresh-QD3OCGJJ.js +0 -2
  616. package/dist/trust-gate-EX7R2P4Y.js +0 -2
  617. package/dist/turn-preflight-JGYT7LXP.js +0 -2
  618. package/dist/ui-JEJGTURD.js +0 -4
  619. package/dist/validate-basic-AAIXSAWH.js +0 -2
  620. package/dist/verdicts-LAB5BGCC.js +0 -2
  621. package/dist/version-check-EHOLX3YH.js +0 -2
  622. package/dist/walk-session-XP4KYFKO.js +0 -2
  623. package/dist/with-telemetry-FJMJQDCM.js +0 -2
  624. /package/dist/{chunk-BKHXPBWN.js → chunk-2RUSXQ3O.js} +0 -0
  625. /package/dist/{chunk-6J5T5FEY.js → chunk-3AGP2BVN.js} +0 -0
  626. /package/dist/{chunk-CH273NAE.js → chunk-73Y6T2UK.js} +0 -0
  627. /package/dist/{chunk-ZMNJBUAO.js → chunk-73ZFOJOK.js} +0 -0
  628. /package/dist/{chunk-NOL7MNZH.js → chunk-A7RJQJNT.js} +0 -0
  629. /package/dist/{chunk-N2P4MI32.js → chunk-FWGUISUG.js} +0 -0
  630. /package/dist/{chunk-UJZZDPDY.js → chunk-HD6NR44L.js} +0 -0
  631. /package/dist/{chunk-LDPLJFCV.js → chunk-I6S6DZ2E.js} +0 -0
  632. /package/dist/{chunk-427OQS2N.js → chunk-LD5B3QFW.js} +0 -0
  633. /package/dist/{chunk-2UIHS2FH.js → chunk-PGESS7BW.js} +0 -0
  634. /package/dist/{chunk-BZAGVBCX.js → chunk-ZCIWQHCO.js} +0 -0
@@ -1,21 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as d,g as B,k as ee}from"./chunk-YLQHY4A7.js";import{P as Z}from"./chunk-RDHWNSDP.js";import{b as A}from"./chunk-5TQFOPJV.js";import{createHash as Ie,randomBytes as F}from"crypto";import{mkdirSync as xe,mkdtempSync as P,rmSync as $,existsSync as ve,renameSync as ke}from"fs";import{tmpdir as j}from"os";import{join as _,dirname as ce}from"path";import{spawn as te}from"child_process";function N(n,e=process.env){let t=n.replace(/https?:\/\/[^\s/@]+:[^\s/@]+@/gi,"https://[redacted]@").replace(/(authorization\s*[:=])[^\r\n]+/gi,"$1 [redacted]"),r=e.KANE_SYNC_GIT_TOKEN;if(r)for(let i of[r,Buffer.from(`x-access-token:${r}`).toString("base64")])t=t.split(i).join("[redacted]");return t}function be(n,e){if(n.GIT_SSH_COMMAND)return re(n.GIT_SSH_COMMAND);if(!n.GIT_SSH)return e?re(e):"ssh -o BatchMode=yes"}function re(n){return/(^|\s)-o\s*BatchMode=yes(\s|$)/.test(n)?n:`${n} -o BatchMode=yes`}var _e=/^(?:ssh:\/\/|[^/\s@:]+@[^/\s:]+:)/i,ie=new Map;function Ae(n,e){let t=[e??"",n.GIT_CONFIG_GLOBAL??"",n.HOME??""].join("\0"),r=ie.get(t);return r===void 0&&(r=se(["config","--get","core.sshCommand"],n,e,12e4).then(i=>i.code===0&&i.stdout.toString().trim()||void 0,()=>{}),ie.set(t,r)),r}var ne=new Set(["fetch","push","clone","ls-remote"]);function Ce(n,e,t){if(t!==void 0)return t;if(!n.some(i=>ne.has(i)))return 12e4;let r=e.KANE_SYNC_GIT_TRANSFER_TIMEOUT_SECONDS;if(r!==void 0){if(!/^\d+$/.test(r)||Number(r)<60||Number(r)>3600)throw new Error("KANE_SYNC_GIT_TRANSFER_TIMEOUT_SECONDS must be 60 to 3600");return Number(r)*1e3}return 9e5}function Ne(n){if(n.some(t=>/^(--force(?:-with-lease|-if-includes)?(?:=|$)|--mirror(?:=|$)|--delete(?:=|$)|-f$)/.test(t)))throw new Error("Git location cannot force, mirror or delete");let e=n.indexOf("push");if(e>=0){let t=n.slice(e+1);if(t.length!==3||t[0]!=="--porcelain"||!/^[0-9a-f]{40,64}:refs\/(heads|kane\/probe)\/[A-Za-z0-9._/-]+$/.test(t[2]))throw new Error("Git location requires an exact commit SHA and explicit ref")}}var H=async(n,e={})=>{Ne(n);let t={...process.env,...e.env};for(let h of["GIT_DIR","GIT_WORK_TREE","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_CONFIG_PARAMETERS"])delete t[h];e.env?.GIT_INDEX_FILE&&(t.GIT_INDEX_FILE=e.env.GIT_INDEX_FILE);let r=[["core.autocrlf","false"],["core.eol","lf"],["core.symlinks","false"],["core.hooksPath","/dev/null"],["gc.autoDetach","false"],["gc.pruneExpire","3.days.ago"],["maintenance.auto","false"],["push.followTags","false"],["push.gpgSign","false"],["commit.gpgSign","false"]],i=t.KANE_SYNC_GIT_HTTP_POST_BUFFER;if(i!==void 0){if(!/^\d+$/.test(i)||Number(i)<1048576||Number(i)>536870912)throw new Error("KANE_SYNC_GIT_HTTP_POST_BUFFER must be 1048576 to 536870912 bytes; use it only for a proxy that rejects chunked uploads");r.push(["http.postBuffer",i])}for(let h of Object.keys(t))h.startsWith("GIT_TRACE")&&delete t[h];let s=n.find(h=>h.startsWith("https://"));if(t.KANE_SYNC_GIT_TOKEN&&s){let h=new URL(s);r.push([`http.${h.origin}${h.pathname}.extraheader`,""],[`http.${h.origin}${h.pathname}.extraheader`,`AUTHORIZATION: basic ${Buffer.from(`x-access-token:${t.KANE_SYNC_GIT_TOKEN}`).toString("base64")}`],["credential.helper",""])}for(let h of Object.keys(t))/^GIT_CONFIG_(COUNT|KEY_\d+|VALUE_\d+)$/.test(h)&&delete t[h];let a=!t.GIT_SSH_COMMAND&&!t.GIT_SSH&&n.some(h=>ne.has(h))&&n.some(h=>_e.test(h))?await Ae({...t},e.cwd):void 0;r.forEach(([h,u],g)=>{t[`GIT_CONFIG_KEY_${g}`]=h,t[`GIT_CONFIG_VALUE_${g}`]=u}),t.GIT_CONFIG_COUNT=String(r.length),t.GIT_TERMINAL_PROMPT="0",t.GCM_INTERACTIVE="never",t.GIT_ASKPASS="",t.SSH_ASKPASS="";let c=be(t,a);return c!==void 0&&(t.GIT_SSH_COMMAND=c),t.GIT_NO_REPLACE_OBJECTS="1",se(n,t,e.cwd,Ce(n,t,e.timeout),e.input)};function se(n,e,t,r,i){return new Promise((s,o)=>{let a=te("git",n,{cwd:t,env:e,windowsHide:!0,detached:process.platform!=="win32",stdio:["pipe","pipe","pipe"]}),c=[],h=0,u="",g=!1,w=()=>{if(process.platform==="win32"&&a.pid)te("taskkill",["/pid",String(a.pid),"/t","/f"],{windowsHide:!0,stdio:"ignore"}).on("error",()=>a.kill("SIGKILL"));else try{a.pid&&process.kill(-a.pid,"SIGKILL")}catch{a.kill("SIGKILL")}},S=setTimeout(()=>{g=!0,w()},r);a.stdout.on("data",l=>{h+=l.length,h>128*1024*1024?w():c.push(l)}),a.stderr.on("data",l=>{u.length<64e3&&(u+=l.toString())}),a.stdin.on("error",()=>{}),a.on("error",l=>{clearTimeout(S),o(new d("SYNC_GIT_REQUIRED",`Git could not start: ${N(l.message,e)}`,"Install Git 2.31 or newer, then run the command again: https://git-scm.com/downloads"))}),a.on("close",l=>{clearTimeout(S),s({code:g||h>128*1024*1024?124:l??1,stdout:Buffer.concat(c),stderr:N(g?"Git operation timed out":u,e)})}),a.stdin.end(i)})}async function oe(n=H){let e=await n(["--version"],{timeout:1e4}),t=/git version (\d+)\.(\d+)/.exec(e.stdout.toString());if(e.code||!t||+t[1]<2||+t[1]==2&&+t[2]<31)throw new d("SYNC_GIT_REQUIRED","This location needs Git 2.31 or newer.","Install or update Git, then run setup again: https://git-scm.com/downloads")}function ae(n){let e=/^([^/@:]+)@([^/:]+):/.exec(n);if(e)return{user:e[1],host:e[2]};try{let t=new URL(n);return{host:t.hostname||"the server",user:t.username||"git",port:t.port||void 0}}catch{return{host:"the server",user:"git"}}}function gt(n){let e=/^[^/@:]+@([^/:]+):/.exec(n);if(e)return e[1].toLowerCase();try{return new URL(n).hostname.toLowerCase()}catch{return""}}function Y(n,e){let{host:t,user:r,port:i}=ae(e),s=N(n).trim().split(`
3
- `).slice(-2).join(" ").trim();return/Host key verification failed|REMOTE HOST IDENTIFICATION HAS CHANGED/i.test(n)?{code:"SYNC_LOCATION_DENIED",message:`this computer has not accepted ${t}'s SSH host key yet`,remedy:`in a terminal run: ssh -T ${i?`-p ${i} `:""}${r}@${t} and answer yes, then run the command again`,diagnostic:s}:/Permission denied \(publickey/i.test(n)?{code:"SYNC_LOCATION_DENIED",message:`${t} did not accept your SSH key`,remedy:"load it with ssh-add, or ask the repository owner to grant your account access",diagnostic:s}:/could not read Username|Authentication failed|Access denied|Invalid username or (password|token)|returned error: 401|returned error: 403/i.test(n)?{code:"SYNC_LOCATION_DENIED",message:`sign in is needed, or your account has no access to this repository on ${t}`,remedy:"sign in through Git, or ask the owner to grant your account access",diagnostic:s}:/Could not resolve host|Connection refused|Connection timed out|timed out|Network is unreachable|Failed to connect/i.test(n)?{code:"SYNC_LOCATION_UNREACHABLE",message:`${t} could not be reached`,remedy:"check the address and your network, then run the command again",diagnostic:s}:/not found|does not appear to be a git repository|Repository not found/i.test(n)?{code:"SYNC_LOCATION_UNREACHABLE",message:"no repository answered at that address, or your account cannot see it; a private repository looks missing until access is granted",remedy:"check the address, then run the command again",diagnostic:s}:{code:"SYNC_LOCATION_UNREACHABLE",message:`git could not read the repository on ${t}`,remedy:"check the address and your access, then run the command again",...s?{diagnostic:s}:{}}}function M(n,e){return(n.startsWith(e)?n:n.charAt(0).toUpperCase()+n.slice(1))+"."}function yt(n,e){let t=Y(n,e),{host:r}=ae(e),i=t.remedy.replace(/,? ?(and )?then run the command again$/,"");return i?`${M(t.message,r)} ${M(i,r)}`:M(t.message,r)}var Oe=Buffer.from(`* -text -filter -ident -working-tree-encoding
4
- `),Re="refs/kane/tip",Pe=/unexpected disconnect|hung up unexpectedly|Connection reset|Connection timed out|timed out|Could not resolve host|Failed to connect|RPC failed|Broken pipe|early EOF/i,$e={GIT_AUTHOR_NAME:"kane-cli context",GIT_AUTHOR_EMAIL:"context@kane-cli.invalid",GIT_COMMITTER_NAME:"kane-cli context",GIT_COMMITTER_EMAIL:"context@kane-cli.invalid"},G=class n{constructor(e){this.options=e;this.exec=e.exec??H,this.prefix=e.prefix?`${e.prefix}/`:"";let t=Ie("sha256").update(JSON.stringify([e.url,e.branch,this.prefix])).digest("hex");if(this.repo=_(e.cacheDir??_(A,"context-sync","mirrors"),`${t}.git`),this.ref=e.ref??`refs/heads/${e.branch}`,!/^refs\/(heads|kane\/probe)\/[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(this.ref)||this.ref.includes(".."))throw new Error("Invalid Git location ref")}kind="git";contractVersion=1;ceilingTier=1;exec;repo;ref;prefix;ready;tip=null;tree=new Map;async run(e,t={}){let r=await this.exec(["--git-dir",this.repo,...e],t);if(r.code)throw new Error(`Git ${e[0]} failed: ${r.stderr||"unable to read the location"}`);return r.stdout}async transfer(e){let t=await this.exec(["--git-dir",this.repo,...e]);if(t.code){let r=Y(t.stderr||"",this.options.url);throw new d(r.code,r.message,r.remedy,r.diagnostic)}return t.stdout}get name(){return this.options.name??"<name>"}takenRemedy(e){return e===1?`${this.name} holds a different history: to work on it, clone it with kane-cli context clone <descriptor of ${this.name}> <dir>; to share this store, add an empty location`:`kane-cli context pull ${this.name} --rebase`}init(){return this.ready??=(async()=>{if(await oe(this.exec),xe(ce(this.repo),{recursive:!0}),!ve(this.repo)){let e=P(_(ce(this.repo),".init-"));try{let t=await this.exec(["init","--bare",e]);if(t.code)throw new Error(`Cannot open Git cache: ${t.stderr}`);try{ke(e,this.repo)}catch(r){if(!["EEXIST","ENOTEMPTY"].includes(r.code??""))throw r}}finally{$(e,{recursive:!0,force:!0})}}if((await this.run(["rev-parse","--is-bare-repository"])).toString().trim()!=="true")throw new Error("The Git cache must be a bare repository");await this.refresh()})()}async refresh(){let t=(await this.transfer(["ls-remote",this.options.url,this.ref])).toString().trim();if(!t){this.tip=null,this.tree=new Map;return}let r=t.split(/\s+/)[0];if(!/^[0-9a-f]{40,64}$/.test(r))throw new Error("Git returned an invalid ref");if(r===this.tip)return;let i=`refs/kane/snapshots/${F(16).toString("hex")}`;await this.transfer(["fetch","--no-tags","--no-write-fetch-head",this.options.url,`${this.ref}:${i}`]);let s=(await this.run(["rev-parse",i])).toString().trim();await this.run(["update-ref",Re,s]),await this.run(["update-ref","-d",i]);let o=await this.readTree(s);this.tip=s,this.tree=o}contextKeys(e){let t=new Map;for(let[r,i]of e)r.startsWith(`${this.prefix}kane-context/`)&&t.set(r,i);return t}async readTree(e){let t=await this.run(["ls-tree","-rz","--full-tree",e]),r=new Map;for(let i of t.toString().split("\0").filter(Boolean)){let s=/^(\d+) (\w+) ([0-9a-f]+)\t([\s\S]+)$/.exec(i);if(!s)throw new Error("Git returned an invalid tree entry");if(s[4].startsWith(`${this.prefix}kane-context/`)&&(s[1]!=="100644"||s[2]!=="blob"))throw new d("SYNC_OBJECT_CORRUPT","Context storage contains a link or non-file object.","Ask the repository owner to restore the original context files.");r.set(s[4],s[3])}return r}key(e){if(!/^[a-zA-Z0-9_~./-]+$/.test(e)||e.split("/").some(t=>!t||t==="."||t===".."||t.toLowerCase()===".git"))throw new Error("Invalid context storage key");return this.prefix+e}async head(e){return await this.init(),this.tree.has(this.key(e))}async get(e){await this.init();let t=this.tree.get(this.key(e));return t?this.run(["cat-file","blob",t]):null}async list(e){return await this.init(),e&&e.replace(/\/$/,"")&&this.key(e.replace(/\/$/,"")),[...this.tree.keys()].filter(t=>t.startsWith(this.prefix+e)).map(t=>t.slice(this.prefix.length)).sort()}async beginTransaction(){await this.init();let e=new Map(this.tree),t=this.tip,r=new Map,i=!1,s=()=>{if(i)throw new Error("Git transaction is closed")},o=async a=>{s();let c=this.key(a),h=r.get(c),u=e.get(c);return h?Buffer.from(h):u?this.run(["cat-file","blob",u]):null};return{get:o,head:async a=>await o(a)!==null,stageIfAbsent:async(a,c)=>{s();let h=this.key(a);if(e.has(h)||r.has(h))return"exists";if(c.length>1e8)throw new d("SYNC_LOCATION_REFUSED_WRITE","A context object is too large for this Git location.","Use an S3 location for this context.");return r.set(h,Buffer.from(c)),"staged"},abort:async()=>{i=!0,r.clear()},commit:async()=>{s();try{if(!r.size)return{created:[]};let a=this.prefix+"kane-context/.gitattributes";e.has(a)||r.set(a,Oe);let c=new Map;for(let[l,m]of r)c.set(l,(await this.run(["hash-object","-w","--no-filters","--stdin"],{input:m})).toString().trim());let h=this.contextKeys(e),u=()=>{this.assertUnchanged(h);for(let[l,m]of this.contextKeys(this.tree))h.set(l,m)},g=!1,w="",S=0;for(let l=0;l<4;l++){u();for(let f of this.tree.keys())if(!(!f.startsWith(this.prefix)||e.has(f)||c.has(f))&&B(f.slice(this.prefix.length))!==null)throw new d("SYNC_BEHIND","the location gained records after this batch was prepared; nothing was published","run kane-cli context pull, then push again");let m=new Map;for(let[f,T]of c){let C=this.tree.get(f);if(C&&C!==T){let R=B(f.slice(this.prefix.length));throw R?new d("SYNC_POSITION_TAKEN",g?`position ${R} on ${this.name} now holds different work; an earlier publication could not be confirmed`:`position ${R} on ${this.name} was published by another writer; this batch was not published`,this.takenRemedy(R)):new d("SYNC_OBJECT_CORRUPT",`existing context object ${f} differs from the intended bytes`,"the object needs a person to look; nothing was published")}C||m.set(f,T)}if(!m.size)return await this.verifyPublication(c),{created:[]};t=this.tip;let I=await this.build(t,m);await this.checkAttributes(I,[...r.keys()]),S++;let E=await this.exec(["--git-dir",this.repo,"push","--porcelain",this.options.url,`${I}:${this.ref}`]),y=N(E.stdout.toString()+`
5
- `+E.stderr);w=y.trim();let O=E.code!==0&&/\[rejected\]|\[remote rejected\]/.test(y),p=E.code!==0&&(E.code===124||Pe.test(y));g||=p;try{await this.refresh()}catch{throw new d("SYNC_PUBLICATION_UNKNOWN","we could not confirm whether your context was uploaded; your local work is safe","check the connection and retry; kane-cli compares the published data before writing again")}if(u(),[...c].every(([f,T])=>this.tree.get(f)===T)){await this.verifyPublication(c);let f=E.code===0&&!E.stdout.toString().split(`
6
- `).some(T=>T.startsWith("= "));return f&&await this.maintain(),{created:f?[...m.keys()].map(T=>T.slice(this.prefix.length)):[]}}if(E.code===0)throw new d("SYNC_PUBLICATION_UNKNOWN","the server accepted publication, but a fresh read did not confirm all context objects","retry after checking the location; do not discard local context");if(this.tip===t&&!g)throw new d("SYNC_LOCATION_REFUSED_WRITE",`${this.name} refused publication`,"check repository write access and branch rules, then retry",y.trim());if(this.tip===t&&!O&&g){await new Promise(f=>setTimeout(f,200*(l+1)+Math.random()*200));continue}await new Promise(f=>setTimeout(f,50*(l+1)+Math.random()*100))}throw new d("SYNC_PUBLICATION_UNKNOWN",`publication could not be confirmed after ${S} attempts; your local work is safe`,"run kane-cli context sync status, then retry",w||void 0)}finally{i=!0,r.clear()}}}}async maintain(){try{await this.exec(["--git-dir",this.repo,"gc","--auto","--quiet"],{timeout:3e5})}catch{}}assertUnchanged(e){for(let[t,r]of e)if(t.startsWith(`${this.prefix}kane-context/`)&&this.tree.get(t)!==r)throw new d("SYNC_REMOTE_ROLLED_BACK","The location changed or removed previously observed context data.","Ask the repository owner to restore the published context; keep your local copy.")}async verifyPublication(e){try{await this.verify(e)}catch{throw new d("SYNC_PUBLICATION_UNKNOWN","Publication was observed, but its bytes could not be fully verified. Your local work is safe.","Check the connection and retry before discarding local context.")}}async verify(e){for(let[t,r]of e){if(this.tree.get(t)!==r)throw new Error("Published context verification failed");let i=await this.run(["cat-file","blob",r]);if((await this.run(["hash-object","--no-filters","--stdin"],{input:i})).toString().trim()!==r)throw new Error("Published bytes do not match their Git object")}}async checkAttributes(e,t=[]){if(!e)return;let r=P(_(j(),"kane-git-attributes-"));try{let i={GIT_INDEX_FILE:_(r,"index")};await this.run(["read-tree",e],{env:i});let s=["commits/000000/000000001.json","blobs/ab/1234","proposals/sample/1234.json"].map(u=>`${this.prefix}kane-context/v1/${u}`),o=t.filter(u=>u.startsWith(`${this.prefix}kane-context/`)&&!u.endsWith("/.gitattributes")),a=Buffer.from([...new Set([...s,...o])].join("\0")+"\0"),h=(await this.run(["check-attr","--cached","-z","--stdin","text","filter","ident","working-tree-encoding"],{env:i,input:a})).toString().split("\0");for(let u=0;u+2<h.length;u+=3)if(!["unset","unspecified"].includes(h[u+2]))throw new d("SYNC_LOCATION_REFUSED_WRITE",`Git attributes transform context bytes (${h[u+1]}).`,"Use a dedicated context repository with no text, filter, ident or encoding conversions.")}finally{$(r,{recursive:!0,force:!0})}}async build(e,t){let r=P(_(j(),"kane-git-index-"));try{let i={GIT_INDEX_FILE:_(r,"index")};await this.run(e?["read-tree",e]:["read-tree","--empty"],{env:i});let s=Buffer.from([...t].map(([l,m])=>`100644 ${m} ${l}\0`).join(""));await this.run(["update-index","-z","--index-info"],{env:i,input:s});let a=["commit-tree",(await this.run(["write-tree"],{env:i})).toString().trim(),...e?["-p",e]:[],"-m",`Append context objects
7
-
8
- Kane-Context: v1`],c=await this.exec(["--git-dir",this.repo,...a]),h=(c.code===0?c.stdout:await this.run(a,{env:$e})).toString().trim(),u=(await this.run(["rev-list","--parents","-n","1",h])).toString().trim().split(" ");if(u.length!==(e?2:1)||e&&u[1]!==e)throw new Error("Unsafe Git commit parent");let g=(await this.run(["diff-tree","--no-commit-id","--name-status","--no-renames","-r","-z",...e?[e,h]:["--root",h]])).toString().split("\0").filter(Boolean);if(g.length!==t.size*2||g.some((l,m)=>m%2===0?l!=="A":!t.has(l)))throw new Error("Unsafe Git commit: unexpected changed path or file mode");let w=await this.readTree(h),S=e?await this.readTree(e):new Map;if(w.size!==S.size+t.size||[...S].some(([l,m])=>w.get(l)!==m)||[...t].some(([l,m])=>S.has(l)||w.get(l)!==m))throw new Error("Unsafe Git commit: only intended new keys may be added");return h}finally{$(r,{recursive:!0,force:!0})}}async putIfAbsent(e,t){let r=await this.beginTransaction();try{if(await r.stageIfAbsent(e,t)==="exists")return"exists";try{return(await r.commit()).created.includes(e)?"created":"exists"}catch(i){if(i instanceof d&&["SYNC_POSITION_TAKEN","SYNC_OBJECT_CORRUPT"].includes(i.code)&&await this.head(e))return"exists";throw i}}finally{await r.abort()}}async probe(){await this.init();let e=ee(F(16).toString("hex"));try{await this.putIfAbsent(e,Buffer.from("connection check"))}catch(c){if(c instanceof d&&c.code==="SYNC_LOCATION_REFUSED_WRITE")return await this.refresh(),{tier:3,detail:"This location can be downloaded, but publication was refused."};throw c}if(await this.putIfAbsent(e,Buffer.from("must not replace"))!=="exists")throw new d("SYNC_PROBE_INCONCLUSIVE","Exclusive create could not be verified.","Retry the connection check.");let t=P(_(j(),"kane-git-reader-"));try{let c=new n({...this.options,cacheDir:t});if(!Buffer.from(await c.get(e)??[]).equals(Buffer.from("connection check"))||!await c.head(e)||!(await c.list(e)).includes(e))throw new Error("Independent reader could not confirm published bytes")}finally{$(t,{recursive:!0,force:!0})}let r=`refs/kane/probe/${F(16).toString("hex")}`,i=Array.from({length:8},()=>new n({...this.options,ref:r}));if((await Promise.allSettled(i.map(c=>c.head(e)))).some(c=>c.status==="rejected"))throw new d("SYNC_PROBE_INCONCLUSIVE","The concurrent connection check could not initialize its independent clients.","Retry the connection check.");let o=await Promise.allSettled(i.map((c,h)=>c.putIfAbsent(e,Buffer.from(`contender ${h}`))));if(o.some(c=>c.status==="rejected"))throw new d("SYNC_PROBE_INCONCLUSIVE","The server did not complete the concurrent connection check. Its scratch-ref policy may differ from the storage branch.","Ask the repository owner to allow the connection-check ref, then retry.");if(o.filter(c=>c.status==="fulfilled"&&c.value==="created").length!==1)throw new d("SYNC_PROBE_INCONCLUSIVE","The concurrent connection check did not produce exactly one winner.","Do not publish to this location until its connection check passes.");return{tier:1,detail:"Can download and publish; independent reads and concurrent writes verified."}}};import{closeSync as Ge,existsSync as Ue,fsyncSync as De,linkSync as Le,lstatSync as Ke,mkdirSync as Be,openSync as He,readFileSync as Me,readdirSync as Ye,realpathSync as q,rmSync as he,statSync as z,writeFileSync as Fe}from"fs";import{randomBytes as je}from"crypto";import{dirname as de,join as ue,resolve as le,sep as U}from"path";var ze=[/^Dropbox( \(.*\))?$/,/^Mobile Documents$/,/^OneDrive(-.*)?$/,/^Google ?Drive(-.*)?$/,/^My Drive$/,/^CloudStorage$/,/^iCloud Drive/],We="a folder synced by Dropbox, OneDrive, Google Drive or iCloud cannot be a location: these keep both sides of a conflict as duplicate files instead of refusing the second write \u2014 use a directory outside the sync client, a git-tracked folder, or an s3:// bucket";function fe(n){return n.split(U).some(e=>ze.some(t=>t.test(e)))}function qe(n){try{return q(n)}catch{return n}}var pe=".tmp-";function Xe(n){try{return Ke(n),!0}catch{return!1}}var b=n=>n.code??"",x=new Set(["ENOENT","ENOTDIR"]),W=new Set(["EACCES","EPERM"]),D=class{kind="dir";contractVersion=1;ceilingTier;root;createRoot;constructor(e,t={}){if(this.root=le(e),fe(this.root)||fe(qe(this.root)))throw new Error(We);this.ceilingTier=1,this.createRoot=t.createRoot??!0}requireRoot(){if(!this.createRoot){try{if(z(this.root).isDirectory())return}catch(e){if(W.has(b(e)))throw this.denied();if(!x.has(b(e)))throw e}throw this.unreachable()}}unreachable(){return new d("SYNC_LOCATION_UNREACHABLE",`nothing answered at ${this.root}: that folder does not exist and cannot be created`,"check the path, then run the command again")}denied(){return new d("SYNC_LOCATION_DENIED",`${this.root} cannot be read by this account`,"ask the owner of the folder for access")}readFault(e){return W.has(b(e))?this.denied():e}writeFault(e){return x.has(b(e))||b(e)==="EROFS"?this.rootExists()?this.refusedWrite("its filesystem is read-only"):this.unreachable():W.has(b(e))?this.refusedWrite("this account has no write access"):e}refusedWrite(e){return new d("SYNC_LOCATION_REFUSED_WRITE",`${this.root} cannot be written: ${e}`,"ask the owner of the folder for write access, or pull from it without pushing")}rootExists(){try{return z(this.root).isDirectory()}catch{return!1}}path(e){let t=e.split("/"),r=e!==""&&!e.startsWith("/")&&!e.includes("\\")&&t.every(s=>s!==""&&s!=="."&&s!==".."),i=r?le(this.root,...t):"";if(!r||!i.startsWith(this.root+U)||!this.contained(i))throw new Error(`bad key ${e}`);return i}contained(e){let t=e;for(;!Xe(t);)t=de(t);if(t===this.root||!t.startsWith(this.root+U))return!0;try{let r=q(this.root),i=q(t);return i===r||i.startsWith(r+U)}catch{return!1}}async head(e){this.requireRoot();try{return z(this.path(e)).isFile()}catch(t){if(x.has(b(t)))return!1;throw this.readFault(t)}}async get(e){this.requireRoot();try{return new Uint8Array(Me(this.path(e)))}catch(t){if(x.has(b(t)))return null;throw this.readFault(t)}}async list(e){this.requireRoot();let t=e.lastIndexOf("/"),r=t===-1?"":e.slice(0,t),i=r===""?this.root:this.path(r),s=[],o=(a,c)=>{for(let h of Ye(a,{withFileTypes:!0})){let u=c+h.name;h.isDirectory()?o(ue(a,h.name),`${u}/`):!h.name.startsWith(pe)&&u.startsWith(e)&&s.push(u)}};try{o(i,r===""?"":`${r}/`)}catch(a){if(x.has(b(a))&&!Ue(i))return[];throw this.readFault(a)}return s.sort()}async putIfAbsent(e,t){this.requireRoot();let r=this.path(e),i=de(r),s=ue(i,`${pe}${process.pid}-${je(6).toString("hex")}`),o;try{Be(i,{recursive:!0}),o=He(s,"wx")}catch(c){throw this.writeFault(c)}try{Fe(o,t),De(o)}finally{Ge(o)}let a="created";try{Le(s,r)}catch(c){if(c.code!=="EEXIST")throw he(s,{force:!0}),c;a="exists"}return he(s,{force:!0}),Z(i),a}};var J=new TextEncoder,Je={appstream2:"appstream",cloudhsmv2:"cloudhsm",email:"ses",marketplace:"aws-marketplace",mobile:"AWSMobileHubService",pinpoint:"mobiletargeting",queue:"sqs","git-codecommit":"codecommit","mturk-requester-sandbox":"mturk-requester","personalize-runtime":"personalize"},Ve=new Set(["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id","range","connection"]),L=class{constructor({accessKeyId:e,secretAccessKey:t,sessionToken:r,service:i,region:s,cache:o,retries:a,initRetryMs:c}){if(e==null)throw new TypeError("accessKeyId is a required option");if(t==null)throw new TypeError("secretAccessKey is a required option");this.accessKeyId=e,this.secretAccessKey=t,this.sessionToken=r,this.service=i,this.region=s,this.cache=o||new Map,this.retries=a??10,this.initRetryMs=c||50}async sign(e,t){if(e instanceof Request){let{method:s,url:o,headers:a,body:c}=e;t=Object.assign({method:s,url:o,headers:a},t),t.body==null&&a.has("Content-Type")&&(t.body=c!=null&&a.has("X-Amz-Content-Sha256")?c:await e.clone().arrayBuffer()),e=o}let r=new V(Object.assign({url:e.toString()},t,this,t&&t.aws)),i=Object.assign({},t,await r.sign());delete i.aws;try{return new Request(i.url.toString(),i)}catch(s){if(s instanceof TypeError)return new Request(i.url.toString(),Object.assign({duplex:"half"},i));throw s}}async fetch(e,t){for(let r=0;r<=this.retries;r++){let i=fetch(await this.sign(e,t));if(r===this.retries)return i;let s=await i;if(s.status<500&&s.status!==429)return s;await new Promise(o=>setTimeout(o,Math.random()*this.initRetryMs*Math.pow(2,r)))}throw new Error("An unknown error occurred, ensure retries is not negative")}},V=class{constructor({method:e,url:t,headers:r,body:i,accessKeyId:s,secretAccessKey:o,sessionToken:a,service:c,region:h,cache:u,datetime:g,signQuery:w,appendSessionToken:S,allHeaders:l,singleEncode:m}){if(t==null)throw new TypeError("url is a required option");if(s==null)throw new TypeError("accessKeyId is a required option");if(o==null)throw new TypeError("secretAccessKey is a required option");this.method=e||(i?"POST":"GET"),this.url=new URL(t),this.headers=new Headers(r||{}),this.body=i,this.accessKeyId=s,this.secretAccessKey=o,this.sessionToken=a;let I,E;(!c||!h)&&([I,E]=Qe(this.url,this.headers)),this.service=c||I||"",this.region=h||E||"us-east-1",this.cache=u||new Map,this.datetime=g||new Date().toISOString().replace(/[:-]|\.\d{3}/g,""),this.signQuery=w,this.appendSessionToken=S||this.service==="iotdevicegateway",this.headers.delete("Host"),this.service==="s3"&&!this.signQuery&&!this.headers.has("X-Amz-Content-Sha256")&&this.headers.set("X-Amz-Content-Sha256","UNSIGNED-PAYLOAD");let y=this.signQuery?this.url.searchParams:this.headers;if(y.set("X-Amz-Date",this.datetime),this.sessionToken&&!this.appendSessionToken&&y.set("X-Amz-Security-Token",this.sessionToken),this.signableHeaders=["host",...this.headers.keys()].filter(p=>l||!Ve.has(p)).sort(),this.signedHeaders=this.signableHeaders.join(";"),this.canonicalHeaders=this.signableHeaders.map(p=>p+":"+(p==="host"?this.url.host:(this.headers.get(p)||"").replace(/\s+/g," "))).join(`
9
- `),this.credentialString=[this.datetime.slice(0,8),this.region,this.service,"aws4_request"].join("/"),this.signQuery&&(this.service==="s3"&&!y.has("X-Amz-Expires")&&y.set("X-Amz-Expires","86400"),y.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),y.set("X-Amz-Credential",this.accessKeyId+"/"+this.credentialString),y.set("X-Amz-SignedHeaders",this.signedHeaders)),this.service==="s3")try{this.encodedPath=decodeURIComponent(this.url.pathname.replace(/\+/g," "))}catch{this.encodedPath=this.url.pathname}else this.encodedPath=this.url.pathname.replace(/\/+/g,"/");m||(this.encodedPath=encodeURIComponent(this.encodedPath).replace(/%2F/g,"/")),this.encodedPath=ye(this.encodedPath);let O=new Set;this.encodedSearch=[...this.url.searchParams].filter(([p])=>{if(!p)return!1;if(this.service==="s3"){if(O.has(p))return!1;O.add(p)}return!0}).map(p=>p.map(f=>ye(encodeURIComponent(f)))).sort(([p,f],[T,C])=>p<T?-1:p>T?1:f<C?-1:f>C?1:0).map(p=>p.join("=")).join("&")}async sign(){return this.signQuery?(this.url.searchParams.set("X-Amz-Signature",await this.signature()),this.sessionToken&&this.appendSessionToken&&this.url.searchParams.set("X-Amz-Security-Token",this.sessionToken)):this.headers.set("Authorization",await this.authHeader()),{method:this.method,url:this.url,headers:this.headers,body:this.body}}async authHeader(){return["AWS4-HMAC-SHA256 Credential="+this.accessKeyId+"/"+this.credentialString,"SignedHeaders="+this.signedHeaders,"Signature="+await this.signature()].join(", ")}async signature(){let e=this.datetime.slice(0,8),t=[this.secretAccessKey,e,this.region,this.service].join(),r=this.cache.get(t);if(!r){let i=await v("AWS4"+this.secretAccessKey,e),s=await v(i,this.region),o=await v(s,this.service);r=await v(o,"aws4_request"),this.cache.set(t,r)}return X(await v(r,await this.stringToSign()))}async stringToSign(){return["AWS4-HMAC-SHA256",this.datetime,this.credentialString,X(await me(await this.canonicalString()))].join(`
10
- `)}async canonicalString(){return[this.method.toUpperCase(),this.encodedPath,this.encodedSearch,this.canonicalHeaders+`
11
- `,this.signedHeaders,await this.hexBodyHash()].join(`
12
- `)}async hexBodyHash(){let e=this.headers.get("X-Amz-Content-Sha256")||(this.service==="s3"&&this.signQuery?"UNSIGNED-PAYLOAD":null);if(e==null){if(this.body&&typeof this.body!="string"&&!("byteLength"in this.body))throw new Error("body must be a string, ArrayBuffer or ArrayBufferView, unless you include the X-Amz-Content-Sha256 header");e=X(await me(this.body||""))}return e}};async function v(n,e){let t=await crypto.subtle.importKey("raw",typeof n=="string"?J.encode(n):n,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return crypto.subtle.sign("HMAC",t,J.encode(e))}async function me(n){return crypto.subtle.digest("SHA-256",typeof n=="string"?J.encode(n):n)}var ge=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function X(n){let e=new Uint8Array(n),t="";for(let r=0;r<e.length;r++){let i=e[r];t+=ge[i>>>4&15],t+=ge[i&15]}return t}function ye(n){return n.replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())}function Qe(n,e){let{hostname:t,pathname:r}=n;if(t.endsWith(".on.aws")){let a=t.match(/^[^.]{1,63}\.lambda-url\.([^.]{1,63})\.on\.aws$/);return a!=null?["lambda",a[1]||""]:["",""]}if(t.endsWith(".r2.cloudflarestorage.com"))return["s3","auto"];if(t.endsWith(".backblazeb2.com")){let a=t.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);return a!=null?["s3",a[1]||""]:["",""]}let i=t.replace("dualstack.","").match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/),s=i&&i[1]||"",o=i&&i[2];if(o==="us-gov")o="us-gov-west-1";else if(o==="s3"||o==="s3-accelerate")o="us-east-1",s="s3";else if(s==="iot")t.startsWith("iot.")?s="execute-api":t.startsWith("data.jobs.iot.")?s="iot-jobs-data":s=r==="/mqtt"?"iotdevicegateway":"iotdata";else if(s==="autoscaling"){let a=(e.get("X-Amz-Target")||"").split(".")[0];a==="AnyScaleFrontendService"?s="application-autoscaling":a==="AnyScaleScalingPlannerFrontendService"&&(s="autoscaling-plans")}else o==null&&s.startsWith("s3-")?(o=s.slice(3).replace(/^fips-|^external-1/,""),s="s3"):s.endsWith("-fips")?s=s.slice(0,-5):o&&/-\d$/.test(s)&&!/-\d$/.test(o)&&([s,o]=[o,s]);return[Je[s]||s,o||""]}var Q=3,Ze=[300,900],et=200,tt=15e3,rt=/<Key>([^<]*)<\/Key>/g,it=/<NextContinuationToken>([^<]*)<\/NextContinuationToken>/,we=n=>new Promise(e=>setTimeout(e,n));function nt(n){let e=n instanceof Error?n.name:"";return e==="TimeoutError"||e==="AbortError"?"timeout":"network"}async function st(n){try{return await n.text()}catch{return""}}var K=class n{kind="s3";contractVersion=1;ceilingTier=1;client;base;prefix;pageSize;name;constructor(e){this.client=new L({accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,service:"s3",region:e.region}),this.base=e.endpoint?`${e.endpoint.replace(/\/+$/,"")}/${e.bucket}`:`https://${e.bucket}.s3.${e.region}.amazonaws.com`,this.prefix=e.prefix,this.pageSize=e.pageSize??1e3,this.name=e.name??"this location"}url(e){return`${this.base}/${this.prefix}${e}`}static line(e,t,r){return`${e} ${new URL(t).pathname} -> ${r}`}answer(e,t,r){let i=n.line(e,t,r);return r===404?new d("SYNC_LOCATION_UNREACHABLE",`nothing answered at ${this.base}: no bucket there`,"check the bucket name and the endpoint, then run the command again",i):r===401||r===403?new d("SYNC_LOCATION_DENIED",`the bucket at ${this.base} did not accept ${this.name}'s access keys, even for reading`,`ask the owner of the bucket for access, or bind it again with the right keys: kane-cli context sync add ${this.name} <descriptor> --credential-env <VAR>`,i):r>=500||r===429?this.unreachable(i):r===301||r===307||r===308?new d("SYNC_LOCATION_UNREACHABLE",`the bucket at ${this.base} answered with a redirect: it lives in another region or behind another endpoint`,`set region=<its region> (or endpoint=<its endpoint>) in the descriptor, then bind ${this.name} again`,i):new Error(i)}unreachable(e){return new d("SYNC_LOCATION_UNREACHABLE",`nothing answered at ${this.base}`,"check the endpoint and your network, then run the command again",e)}async request(e,t,r={}){let i="";for(let s=0;s<Q;s++){s>0&&await we(Ze[s-1]);let o;try{o=await fetch(await this.client.sign(t,{method:e,headers:r.headers,body:r.body&&new Uint8Array(r.body),signal:AbortSignal.timeout(tt)}))}catch(a){i=nt(a);continue}if((o.status>=500||o.status===429)&&s<Q-1){i=String(o.status);continue}return o}throw this.unreachable(`${n.line(e,t,i)} after ${Q} attempts`)}async head(e){let t=await this.request("HEAD",this.url(e));if(t.status===200)return!0;if(t.status===404)return!1;throw this.answer("HEAD",this.url(e),t.status)}async bodyOf(e,t,r,i){try{return await i(e)}catch{throw this.unreachable(n.line(t,r,"body read failed"))}}async get(e){let t=await this.request("GET",this.url(e));if(t.status===200)return new Uint8Array(await this.bodyOf(t,"GET",this.url(e),r=>r.arrayBuffer()));if(t.status===404)return null;throw this.answer("GET",this.url(e),t.status)}async list(e){let t=[],r=null;do{let i=new URLSearchParams({"list-type":"2",prefix:this.prefix+e,"max-keys":String(this.pageSize)});r&&i.set("continuation-token",r);let s=`${this.base}?${i.toString()}`,o=await this.request("GET",s);if(o.status!==200)throw this.answer("GET",s,o.status);let a=await this.bodyOf(o,"GET",s,c=>c.text());for(let c of a.matchAll(rt))t.push(c[1].slice(this.prefix.length));r=it.exec(a)?.[1]??null}while(r);return t.sort()}async putIfAbsent(e,t){let r=await this.create(e,t);if(r!=="conflict")return r;if(await we(et),await this.head(e))return"exists";let i=await this.create(e,t);if(i!=="conflict")return i;throw new Error(`${n.line("PUT",this.url(e),409)} twice (ConditionalRequestConflict) and the key is still absent`)}async create(e,t){let r=this.url(e),i=await this.request("PUT",r,{headers:{"If-None-Match":"*","Content-Type":"application/octet-stream"},body:t});if(i.status===200||i.status===201)return"created";if(i.status===412)return"exists";if(i.status===409&&(await st(i)).includes("ConditionalRequestConflict"))return"conflict";throw i.status===401||i.status===403?new d("SYNC_LOCATION_REFUSED_WRITE",`${this.name}'s access keys cannot write to ${this.base}`,"ask the owner of the bucket for write access, or pull from it without pushing",n.line("PUT",r,i.status)):this.answer("PUT",r,i.status)}};import{chmodSync as ot,mkdirSync as at,readFileSync as ct,rmSync as ht,writeFileSync as dt}from"fs";import{join as Se}from"path";var Ee="context-sync",ut=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function k(n,e=A){if(!ut.test(n))throw new Error(`bad location name ${JSON.stringify(n)} \u2014 letters, digits, dot, dash and underscore only`);return Se(e,Ee,`${n}.json`)}function Te(n,e=A){let t=process.env.KANE_SYNC_S3_ACCESS_KEY_ID,r=process.env.KANE_SYNC_S3_SECRET_ACCESS_KEY;if(t&&r)return{accessKeyId:t,secretAccessKey:r};let i=k(n,e),s;try{s=ct(i,"utf-8")}catch{return null}let o;try{o=JSON.parse(s)}catch(a){throw new Error(`${i} is not readable JSON: ${a instanceof Error?a.message:String(a)}`)}if(typeof o!="object"||o===null||!("accessKeyId"in o)||!("secretAccessKey"in o)||typeof o.accessKeyId!="string"||typeof o.secretAccessKey!="string")throw new Error(`${i} does not hold an access key and a secret \u2014 re-add the location to replace it`);return{accessKeyId:o.accessKeyId,secretAccessKey:o.secretAccessKey}}function Mt(n,e,t=A){let r=k(n,t);at(Se(t,Ee),{recursive:!0,mode:448}),dt(r,JSON.stringify(e)+`
13
- `,{mode:384}),ot(r,384)}function Yt(n,e=A){ht(k(n,e),{force:!0})}function Xt(n,e,t,r={}){switch(n.kind){case"fake":{let i=t?.get(n.location.slice(7));if(!i)throw new Error(`${n.location} is a test-only location and no test registered it`);return i}case"git":return new G({url:n.gitUrl,branch:n.branch,prefix:n.prefix,name:e});case"dir":return new D(n.path,{createRoot:r.createRoot});case"s3":{let i=Te(e);if(!i)throw new Error(`no credentials for ${e} \u2014 re-add it with --credential-env <VAR> or --credential-file <path> (kane-cli context sync add), set KANE_SYNC_S3_ACCESS_KEY_ID and KANE_SYNC_S3_SECRET_ACCESS_KEY, or write {"accessKeyId", "secretAccessKey"} to ${k(e)} with mode 0600`);return new K({endpoint:n.endpoint,region:n.region,bucket:n.bucket,prefix:n.prefix,name:e,...i})}}}export{H as a,oe as b,gt as c,yt as d,k as e,Mt as f,Yt as g,Xt as h};
14
- /*! Bundled license information:
15
-
16
- aws4fetch/dist/aws4fetch.esm.mjs:
17
- (**
18
- * @license MIT <https://opensource.org/licenses/MIT>
19
- * @copyright Michael Hart 2024
20
- *)
21
- */
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- var g={graph_search_similar:"search graph",graph_get_node:"read node",graph_get_edges:"read edges",graph_match_by_type:"match by type",graph_find_by_provenance:"trace provenance",graph_stale_nodes:"check stale",ask_user:"ask",finalize_proposal:"propose use-cases",chat_turn:"apply changes",read_image:"read image",source_read:"read source",source_grep:"search source",finalize_design:"propose design",expand_bva:"expand boundaries",covering_array:"combine classes",dedupe_candidates:"dedupe",budget_cut:"trim to budget",source_list:"list sources",graph_search_similar_batch:"search graph",graph_history:"read history"};function d(t){let e=g[t.name],n=t.status==="error"||t.status==="aborted"?" \u2717":"",a=t.detail?` \u2014 ${t.detail}`:"";return e?`\u2692 ${e}${a}${n}`:`\u2692 working\u2026${a}${n}`}function l(t){return d(t).replace(/^\S+ /,"")}function h(t){let e=Math.floor(t/60);return e>0?`${e}m ${String(t%60).padStart(2,"0")}s`:`${t}s`}function k(t,e,n){let a=h(t),o=new Map;for(let i of n){let r=g[i.name]??"working\u2026";o.set(r,(o.get(r)??0)+i.n)}let s=[...o.entries()],p=s.slice(0,4).map(([i,r])=>r>1?`${i} \xD7${r}`:i),c=s.length-4,u=[...p,...c>0?[`+${c} more`]:[]].join(" \xB7 ");return`worked ${a} \u2014 ${e} tool call${e===1?"":"s"}${u?` \xB7 ${u}`:""}`}function T(){return{currentAttempt:null,liveThinking:"",thinkingLog:[],activity:[]}}var m={dedup_candidate:"checking a possible duplicate",ambiguity:"asking to resolve an ambiguity",validation_repair:"repairing a validation failure",finalize:"finalizing the proposal",terminal_call:"putting the result together",validation_failed:"fixing a validation issue",no_tool_calls:"nudging a stalled turn",evidence_readback:"reading the evidence back",evidence_search:"searching the evidence",provenance_check:"checking provenance"};function _(t){return m[t.reason_code]??t.reason_code.replace(/_/g," ")}function v(t){let e=l({name:t.name});return t.status==="started"?`\u2192 ${e}\u2026`:t.status==="error"||t.status==="aborted"?`\u2717 ${e}`:`\u2713 ${e}`}function f(t,e){return e.turn_id!==t.turn_id?e.turn_id<t.turn_id:e.attempt<t.attempt}function $(t,e){let n=t.currentAttempt;if(n===null||n.turn_id!==e.turn_id||n.attempt!==e.attempt){if(n!==null&&f(n,e))return t;t={...t,currentAttempt:{turn_id:e.turn_id,attempt:e.attempt},liveThinking:""}}switch(e.type){case"reasoning_delta":return{...t,liveThinking:t.liveThinking+e.text};case"reasoning_done":return e.present?{...t,thinkingLog:[...t.thinkingLog,{text:t.liveThinking,tookMs:e.took_ms}],liveThinking:""}:{...t,liveThinking:""};case"tool_activity":return{...t,activity:[...t.activity,{name:e.name,status:e.status,label:v(e)}]};case"decision_activity":return{...t,activity:[...t.activity,{name:e.action,status:"decision",label:_(e)}]}}}export{l as a,h as b,k as c,T as d,$ as e};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- function c(e,r){let n=new Map;for(let[o,s]of e.superseded)typeof s=="string"&&n.set(s,o);let t=r,i=new Set;for(;n.has(t)&&!i.has(t);)i.add(t),t=n.get(t);return t}function a(e,r){let n=e.resolve(r);if(n===null)return null;let t=e.designGenerationOf.get(c(e,n.cid));if(t===void 0)return null;let i=e.tipOf(n.cid),o=!e.superseded.has(i);return{gen:t.gen,live:o,minted_at_seq:t.seq}}function u(e,r,n){let t=e.resolve(r);if(t===null)return{error:{code:"UNKNOWN_REF",detail:`'${r}' names no use-case in this context`}};let i=c(e,t.cid),o=e.designGenerationOf.get(i);if(o===void 0)return{uc_root:i,next_gen:1,expected_prev_gen:null,...n.because?{because:n.because}:{}};let s=a(e,r);return s!==null&&s.live&&!n.force?{error:{code:"GENERATION_LIVE",detail:`${r} already has a live design generation (gen ${o.gen}) \u2014 pass --force with --because to supersede it`}}:s!==null&&s.live&&n.force&&!n.because?{error:{code:"MISSING_BECAUSE",detail:`superseding the live generation of ${r} requires --because <reason>`}}:{uc_root:i,next_gen:o.gen+1,expected_prev_gen:o.gen,...n.because?{because:n.because}:{}}}function d(e,r){let n=e.designGenerationOf.get(r.uc_root)?.gen??null;return n!==r.expected_prev_gen?{code:"GENERATION_MOVED",detail:`design generation of ${r.uc_root.slice(0,12)} moved (expected ${String(r.expected_prev_gen)}, found ${String(n)}) \u2014 another session finalized; re-open and re-ground`}:null}function l(e,r,n){return{uc_root:e.uc_root,uc_cid:r,generation:e.next_gen,supersedes_generation:e.expected_prev_gen,...e.because?{because:e.because}:{},by:n}}export{c as a,a as b,u as c,d,l as e};
@@ -1,3 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{e as c}from"./chunk-5EOX4MEY.js";import{createHash as f,randomBytes as p}from"crypto";import r from"fs";import u from"os";import s from"path";function l(e){return s.join(e,"store.json")}function a(){return`ctx-${p(6).toString("hex")}`}function m(e){return f("sha256").update(`${u.hostname()}|${s.resolve(e)}`).digest("hex").slice(0,32)}function S(e){try{let t=JSON.parse(r.readFileSync(l(e),"utf8"));if(typeof t.context_lineage_id=="string"&&typeof t.context_instance_id=="string")return t}catch{}return null}function _(){try{return JSON.parse(r.readFileSync(c(),"utf8"))}catch{return{}}}function y(e){let t=c();r.mkdirSync(s.dirname(t),{recursive:!0});let n=`${t}.tmp-${process.pid}`;r.writeFileSync(n,JSON.stringify(e,null,2),{mode:384}),r.renameSync(n,t)}function g(e,t){let n=l(e),i=`${n}.tmp-${process.pid}`;r.writeFileSync(i,JSON.stringify(t,null,2)+`
3
- `,{mode:420}),r.renameSync(i,n)}function $(e){let t=S(e);if(!t){t={context_lineage_id:a(),context_instance_id:a(),created_at:new Date().toISOString(),schema:1};try{g(e,t)}catch{return{ids:t,cloned:!1}}}let n=!1;try{let i=_(),d=m(e),o=i[t.context_lineage_id];o&&o.fingerprint!==d&&r.existsSync(s.join(o.store_path,"store.json"))&&(n=!0,t={...t,context_instance_id:a()},g(e,t)),i[t.context_lineage_id]={fingerprint:d,store_path:s.resolve(e),last_seen:new Date().toISOString()},y(i)}catch{}return{ids:t,cloned:n}}export{S as a,$ as b};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as J,c as Y,d as Z,e as ce,f as ue}from"./chunk-HAYV4D2I.js";import{a as fe}from"./chunk-X2A6CC6B.js";import{e as ie}from"./chunk-AHFIRHSP.js";import{a as se}from"./chunk-QAB3Y5FQ.js";import{a as ae}from"./chunk-4BZOG6PE.js";import{d as ne}from"./chunk-OIUV3ISA.js";import{a as O}from"./chunk-HG5LLZBU.js";import{b as oe}from"./chunk-USOYXCZ4.js";import{b as re}from"./chunk-PEDINHVU.js";import{a as M}from"./chunk-2KVECC36.js";import{a as T,b as j,d as le}from"./chunk-VE3SUJMA.js";import{b as te}from"./chunk-TZXXJWHA.js";import{r as y}from"./chunk-RSSOJ3L2.js";import{i as ee}from"./chunk-Z7S3IWUX.js";import{a as B}from"./chunk-NMSZ7G6P.js";import{a as D,c as H,e as I}from"./chunk-FMUV6UCX.js";import{f as q,g as z}from"./chunk-NOL7MNZH.js";import{a as Q}from"./chunk-YWYORBY3.js";import{a as W}from"./chunk-HCBYKLMW.js";import{a as c,b as u,i as F,j as V}from"./chunk-C44QQJR4.js";import{a as we}from"./chunk-6YGTRKDT.js";import{e as L}from"./chunk-UR6MHSHU.js";var s=L(we(),1);var r=L(W(),1);function ze({resultRef:x,mode:g="singleshot",loginCompleteRef:d}){let{exit:m}=V(),A=(0,s.useRef)(new Q),k=(0,s.useRef)(new se),v=(0,s.useRef)(new ie),n=A.current,l=k.current,N=v.current,de=J(),[h,f]=(0,s.useState)(g==="login"?"login":"gate"),[X,ge]=(0,s.useState)(null),[be,R]=(0,s.useState)(null),[ye,$]=(0,s.useState)(null),[U,pe]=(0,s.useState)(null),[G,E]=(0,s.useState)([]),P=(0,s.useCallback)((e,t,i,o)=>N.log(e,t,i,o),[N]),je=(0,s.useCallback)((e,t)=>{e?T(n,l,e,t):l.save({project_id:null,project_name:null,folder_id:null,folder_name:null})},[n,l]),b=(0,s.useCallback)(()=>{if(g==="login")d&&(d.current=!0),m();else{let e=l.load().mobile,t=D(e?.tui_target,e?.default_target?.kind),i=t.kind==="unset"||t.kind==="choose-mobile"&&te();f(i?"target":"input")}},[g,m,d,l]),S=(0,s.useCallback)((e,t)=>{let i=T(n,l,e,t);if(g==="login"){f("ensure-project");return}le(i)?b():i.projectId?f("ensure-folder"):f("ensure-project")},[n,l,b,g]);F((e,t)=>{t.ctrl&&e==="c"&&y(0,"Ctrl+C exit")});let K=(0,s.useRef)(!1);s.default.useEffect(()=>{K.current||(K.current=!0,g!=="login"&&ue(n,P).then(e=>{ge(e),e.status==="authenticated"?S(e.result.profile,e.result.env):e.status==="needs_pick"?f("pick"):(R(e.profile??null),$(e.env??null),f("login"))}).catch(e=>{pe(`Auth check failed: ${e instanceof Error?e.message:String(e)}`)}))},[n,P]);let me=(0,s.useCallback)(e=>{x.current={objective:e},m()},[x,m]),ve=(0,s.useCallback)(async(e,t)=>{n.setActiveProfile(e),n.setDefaultEnv(t),(await ce(n,e,t,P)).status==="authenticated"?S(e,t):(R(e),$(t),f("login"))},[n,P,S]),w=(0,s.useCallback)(()=>{let e=n.getActiveProfile(),t=n.getDefaultEnv();if(!e)return null;let i=B(t),o=n.loadBasicAuth(e,t);return new ae(i.controllerBaseUrl,async()=>n.loadCredentials(e,t)?.access_token??null,o,P)},[n,P]),he=(0,s.useCallback)(async()=>{let e=w();if(!e)return null;let t=e.cached??await e.resolve();if(!t)return null;let i=B(n.getDefaultEnv()),o=new M(i.tmsBaseUrl,t.username,t.access_key);try{let p=(await o.listProjects()).find(_=>_.name==="KaneAI Generated");if(p)return{id:p.project_id,name:p.name};let C=await o.createProject("KaneAI Generated");return{id:C.id,name:C.name}}catch{return null}},[w,n]),xe=(0,s.useCallback)(async e=>{let t=w();if(!t)return null;let i=t.cached??await t.resolve();if(!i)return null;let o=B(n.getDefaultEnv()),a=new M(o.tmsBaseUrl,i.username,i.access_key);try{let C=(await a.listFolders(e)).find(Pe=>Pe.name==="Untitled");if(C)return{id:C.id,name:C.name};let _=await a.createFolder(e,"Untitled");return{id:_.id,name:_.name}}catch{return null}},[w,n]);if(h==="gate")return(0,r.jsx)(c,{paddingX:1,children:(0,r.jsx)(u,{color:"yellow",children:"Checking authentication..."})});if(U)return(0,r.jsxs)(c,{flexDirection:"column",paddingX:1,children:[(0,r.jsx)(u,{color:"red",children:U}),(0,r.jsx)(u,{color:"gray",children:"Press Ctrl+C to exit."})]});if(h==="pick"&&X?.status==="needs_pick")return(0,r.jsx)(Ce,{profiles:X.profiles,onSelect:ve});if(h==="login")return(0,r.jsx)(Z,{devMode:process.env.KANE_DEV_MODE==="1",profiles:n.listProfiles(),onBasicLogin:async(e,t,i,o)=>{let{validateBasicAuth:a}=await import("./validate-basic-AAIXSAWH.js");await a(t,i,o),n.saveBasicAuth(e,t,{username:i,access_key:o}),n.setActiveProfile(e),n.setDefaultEnv(t)},onOAuthLogin:async(e,t)=>{let{LoginFlow:i}=await import("./login-flow-ASUUU7SO.js");n.setDefaultEnv(t),n.setActiveProfile(e),await new i(e,t,n).login()},onComplete:(e,t)=>{R(e),$(t),n.setActiveProfile(e),n.setDefaultEnv(t),S(e,t)},onCancel:()=>{y(0,"Login cancelled")}});if(h==="ensure-project"){let e=n.getActiveProfile()??"default",t=n.getDefaultEnv(),i=()=>{if(g==="login"){f("ensure-folder");return}T(n,l,e,t).folderId?b():f("ensure-folder")};return(0,r.jsxs)(c,{flexDirection:"column",children:[(0,r.jsx)(c,{paddingX:1,marginBottom:1,children:(0,r.jsx)(u,{color:"yellow",children:"Project & folder are required to save tests \xB7 Esc to use defaults \xB7 Ctrl+C to exit"})}),(0,r.jsx)(oe,{resolver:w(),currentProjectId:l.load().project_id,env:t,onSelect:(o,a)=>{j(n,l,e,t,{projectId:o,projectName:a}),E(p=>[...p,`\u2713 Project: ${a} (${o})`]),i()},onCancel:async()=>{let o=await he();o&&(j(n,l,e,t,{projectId:o.id,projectName:o.name}),E(a=>[...a,`\u2713 Default project: ${o.name} (${o.id})`]),i())}})]})}if(h==="ensure-folder"){let e=n.getActiveProfile()??"default",t=n.getDefaultEnv(),i=n.loadProfileConfig(e,t);return(0,r.jsxs)(c,{flexDirection:"column",children:[(0,r.jsx)(c,{paddingX:1,marginBottom:1,children:(0,r.jsx)(u,{color:"yellow",children:"Project & folder are required to save tests \xB7 Esc to use defaults \xB7 Ctrl+C to exit"})}),(0,r.jsx)(re,{resolver:w(),projectId:i?.project_id??"",currentFolderId:l.load().folder_id,env:t,onSelect:(o,a)=>{j(n,l,e,t,{folderId:o,folderName:a}),E(p=>[...p,`\u2713 Folder: ${a} (${o})`]),b()},onCancel:async()=>{if(!i?.project_id)return;let o=await xe(i.project_id);o&&(j(n,l,e,t,{folderId:o.id,folderName:o.name}),E(a=>[...a,`\u2713 Default folder: ${o.name} (${o.id})`]),b())}})]})}if(h==="target"){let e=D(l.load().mobile?.tui_target,l.load().mobile?.default_target?.kind).kind==="choose-mobile";return(0,r.jsx)(c,{paddingX:1,children:(0,r.jsx)(fe,{mode:e?"legacy-mobile":"all",onSelect:t=>{l.setMobile({tui_target:t}),f("input")},onCancel:()=>f("input")})})}if(h==="input"){let e=l.load().mobile,t=D(e?.tui_target,e?.default_target?.kind),i=(()=>{if(z(t.kind)){let o=ee(e?.default_target)??"(no device)",a=O(e?.default_app)??"(no app)";return`Config: ${I(t.kind)} \xB7 ${o} \xB7 ${a}`}if(q(t.kind)){let o=H(e,t.kind),a=O(o.app)??"(no app)";return`Config: ${I(t.kind)} \xB7 ${ne(o)} \xB7 ${a}`}return"Config: Desktop \xB7 Chrome"})();return(0,r.jsxs)(c,{flexDirection:"column",children:[G.length>0&&(0,r.jsx)(c,{flexDirection:"column",paddingX:1,marginBottom:1,children:G.map((o,a)=>(0,r.jsx)(u,{color:"green",children:o},a))}),(0,r.jsx)(c,{paddingX:1,children:(0,r.jsx)(u,{color:"gray",children:i})}),(0,r.jsx)(Y,{onSubmit:me,onEscape:()=>y(0,"User pressed Escape"),history:de,placeholder:"Type an objective..."})]})}return(0,r.jsx)(r.Fragment,{})}function Ce({profiles:x,onSelect:g}){let[d,m]=(0,s.useState)(0),[A,k]=(0,s.useState)(!1);return F((v,n)=>{if(!A){if(n.escape){y(0,"Profile picker cancelled");return}if(n.upArrow&&d>0&&m(l=>l-1),n.downArrow&&d<x.length-1&&m(l=>l+1),n.return){k(!0);let l=x[d];g(l.profile,l.env).catch(()=>k(!1))}}}),(0,r.jsxs)(c,{flexDirection:"column",paddingX:1,children:[(0,r.jsx)(u,{color:"#ff9500",bold:!0,children:"Select a profile:"}),(0,r.jsx)(c,{marginTop:1,flexDirection:"column",children:x.map((v,n)=>(0,r.jsxs)(u,{children:[n===d?"\u276F ":" ",(0,r.jsx)(u,{color:n===d?"#ff9500":"white",bold:n===d,children:v.profile}),(0,r.jsxs)(u,{color:"gray",children:[" [",v.env,"]"]})]},`${v.profile}-${v.env}`))}),A&&(0,r.jsx)(c,{marginTop:1,children:(0,r.jsx)(u,{color:"yellow",children:"Validating credentials..."})})]})}export{ze as a};