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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (645) hide show
  1. package/dist/ChatSurface-VPD5G67Q.js +2 -0
  2. package/dist/ChromeProfilePicker-CRKQEFYD.js +2 -0
  3. package/dist/CliFeedbackPrompt-M7BMWLKK.js +2 -0
  4. package/dist/CliUploadProgress-OP7DXMC2.js +2 -0
  5. package/dist/ConfigView-XI74BCCH.js +2 -0
  6. package/dist/EvidenceViewOffer-HAAK6DS5.js +2 -0
  7. package/dist/FolderPicker-W5S6RFCP.js +2 -0
  8. package/dist/InfoBox-OWUEHV2D.js +2 -0
  9. package/dist/LinksBox-PNSESNCU.js +2 -0
  10. package/dist/ProfilesView-PYDZZHKO.js +2 -0
  11. package/dist/ProjectPicker-BGFCUGT5.js +2 -0
  12. package/dist/SaveSessionPrompt-SUJE54GS.js +2 -0
  13. package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
  14. package/dist/SingleShotApp-4TDXZEUA.js +2 -0
  15. package/dist/SummaryBox-FALOODAQ.js +2 -0
  16. package/dist/TestMdRunView-4GPRWHEU.js +2 -0
  17. package/dist/TestrunEvidenceTable-OBVQJ6IO.js +2 -0
  18. package/dist/WhoamiView-6WXGRANY.js +2 -0
  19. package/dist/{agent-parse-2MLJOJTH.js → agent-parse-CAS45UKA.js} +1 -1
  20. package/dist/app-client-U2YYF65L.js +2 -0
  21. package/dist/app-download-RXVZB6MM.js +2 -0
  22. package/dist/assurance-job-C3TXZGLL.js +7 -0
  23. package/dist/auth-7Z54TMQQ.js +2 -0
  24. package/dist/{binary-MOJTQGUV.js → binary-DJCDMGPX.js} +1 -1
  25. package/dist/bind-XVO4CQYV.js +2 -0
  26. package/dist/bootstrap-TY5RANJ7.js +2 -0
  27. package/dist/bridge-T6QMYKED.js +2 -0
  28. package/dist/build-5ZN47FAT.js +2 -0
  29. package/dist/catalog-RRQF4TCA.js +2 -0
  30. package/dist/{changelog-2N6HKKKQ.js → changelog-GBEVIUFJ.js} +1 -1
  31. package/dist/chat-committer-ZCSRJEUB.js +2 -0
  32. package/dist/chat-controller-XINCDH6Z.js +2 -0
  33. package/dist/child-G2GCW73X.js +2 -0
  34. package/dist/chunk-22PIMG52.js +2 -0
  35. package/dist/chunk-252FWF2G.js +19 -0
  36. package/dist/{chunk-AT3RME5W.js → chunk-2IZRPMZN.js} +1 -1
  37. package/dist/chunk-2NFS4KE4.js +2 -0
  38. package/dist/{chunk-LHUW5QDT.js → chunk-2OOFURWD.js} +1 -1
  39. package/dist/chunk-2OSFI33O.js +97 -0
  40. package/dist/chunk-2S3W2JT3.js +5 -0
  41. package/dist/chunk-2SWSVJUP.js +12 -0
  42. package/dist/chunk-2TVPA3LL.js +2 -0
  43. package/dist/chunk-2XW33VOK.js +2 -0
  44. package/dist/chunk-33DWJV67.js +235 -0
  45. package/dist/chunk-34R7BNZ2.js +2 -0
  46. package/dist/chunk-35ECWCCK.js +2 -0
  47. package/dist/chunk-3BSYOCSW.js +3 -0
  48. package/dist/chunk-3G2LSTK5.js +2 -0
  49. package/dist/chunk-3GXN6VF6.js +2 -0
  50. package/dist/chunk-3JLEDSG5.js +4 -0
  51. package/dist/chunk-3QICDXY5.js +5 -0
  52. package/dist/chunk-3UVSAAES.js +10 -0
  53. package/dist/chunk-42PALMW2.js +4 -0
  54. package/dist/chunk-432ZOE42.js +21 -0
  55. package/dist/chunk-44B6THYK.js +2 -0
  56. package/dist/chunk-47WQBG5I.js +6 -0
  57. package/dist/{chunk-J2FJ62K4.js → chunk-4D5PC6QE.js} +1 -1
  58. package/dist/chunk-4I7YN6YY.js +3 -0
  59. package/dist/chunk-4IEQNX7F.js +2 -0
  60. package/dist/{chunk-SYJXTB4J.js → chunk-4LPX2OLV.js} +1 -1
  61. package/dist/chunk-4LTHDJ3D.js +2 -0
  62. package/dist/chunk-4QTH7VYE.js +2 -0
  63. package/dist/chunk-54XA5MZH.js +2 -0
  64. package/dist/chunk-57MDWTON.js +2 -0
  65. package/dist/{chunk-3C32LVLX.js → chunk-5BUIIFLC.js} +1 -1
  66. package/dist/chunk-5D7ENQTQ.js +2 -0
  67. package/dist/chunk-63EKRZKI.js +2 -0
  68. package/dist/{chunk-EHN5HTUD.js → chunk-65VANXOF.js} +51 -51
  69. package/dist/chunk-672CQECV.js +47 -0
  70. package/dist/chunk-6LIC2R22.js +3 -0
  71. package/dist/chunk-6NFOH4AC.js +4 -0
  72. package/dist/chunk-6NWT2TEJ.js +2 -0
  73. package/dist/chunk-6PIIUAZF.js +3 -0
  74. package/dist/{chunk-MBJHS653.js → chunk-6U7ID777.js} +1 -1
  75. package/dist/chunk-6UVIY56J.js +2 -0
  76. package/dist/chunk-72KYMWQ5.js +2 -0
  77. package/dist/chunk-72RC7JSA.js +21 -0
  78. package/dist/chunk-74W4AOT2.js +2 -0
  79. package/dist/chunk-77ZZQJLX.js +2 -0
  80. package/dist/chunk-7DFBOVUB.js +2 -0
  81. package/dist/chunk-7EXDYXXD.js +2 -0
  82. package/dist/chunk-7HO4NX5W.js +1 -0
  83. package/dist/chunk-7KX2BHKG.js +2 -0
  84. package/dist/chunk-7LKCWO2R.js +11 -0
  85. package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
  86. package/dist/chunk-7RPKHKA3.js +2 -0
  87. package/dist/chunk-7RWP4Y3H.js +2 -0
  88. package/dist/chunk-7V4BQSSV.js +2 -0
  89. package/dist/chunk-7XBNMOH4.js +6 -0
  90. package/dist/chunk-A6TJOZ24.js +2 -0
  91. package/dist/chunk-A7RJQJNT.js +2 -0
  92. package/dist/chunk-AA674WLL.js +2 -0
  93. package/dist/chunk-AIXJYMSP.js +9 -0
  94. package/dist/chunk-AJQZ3ST5.js +8 -0
  95. package/dist/chunk-AQ2OG2EF.js +2 -0
  96. package/dist/chunk-AUJSC7PU.js +4 -0
  97. package/dist/chunk-AVI5H4UM.js +13 -0
  98. package/dist/chunk-AZLNLHUA.js +4 -0
  99. package/dist/chunk-B2HXPGIZ.js +26 -0
  100. package/dist/chunk-B7ZX5HEN.js +8 -0
  101. package/dist/{chunk-XQQHSC7G.js → chunk-BJJUKB5K.js} +1 -1
  102. package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
  103. package/dist/{chunk-TONFENRW.js → chunk-BVO4C5F2.js} +1 -1
  104. package/dist/chunk-BWXLZS5O.js +2 -0
  105. package/dist/chunk-BY65QAAN.js +4 -0
  106. package/dist/chunk-BZVNI44O.js +6 -0
  107. package/dist/chunk-C5Z7MQE6.js +2 -0
  108. package/dist/chunk-C6HI6Y3S.js +2 -0
  109. package/dist/chunk-CB4ARIHR.js +2 -0
  110. package/dist/chunk-CPBBYNL7.js +4 -0
  111. package/dist/{chunk-GFNCGN5V.js → chunk-D4FFXCX6.js} +2 -2
  112. package/dist/chunk-D756UWY2.js +6 -0
  113. package/dist/chunk-DBMW3VUN.js +4 -0
  114. package/dist/chunk-DD5TULWQ.js +34 -0
  115. package/dist/{chunk-SY4T44VC.js → chunk-DDJNYQBH.js} +1 -1
  116. package/dist/{chunk-KJIDMW6N.js → chunk-DHQ4SQWA.js} +1 -1
  117. package/dist/chunk-DNGOT65K.js +3 -0
  118. package/dist/chunk-DPGOAFKF.js +2 -0
  119. package/dist/chunk-DREQ3RAA.js +2 -0
  120. package/dist/chunk-DTUPEKEO.js +2 -0
  121. package/dist/chunk-E6KSRQXL.js +8 -0
  122. package/dist/chunk-EF47KRUK.js +2 -0
  123. package/dist/chunk-ENL4XTQ2.js +2 -0
  124. package/dist/chunk-EXFDIVNI.js +9 -0
  125. package/dist/chunk-EZN7CF45.js +4 -0
  126. package/dist/chunk-F3U6T4YD.js +22 -0
  127. package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
  128. package/dist/chunk-FFL55I2M.js +2 -0
  129. package/dist/chunk-FIP5L6LV.js +9 -0
  130. package/dist/chunk-FOJHSG5M.js +6 -0
  131. package/dist/chunk-FSYOTRMC.js +2 -0
  132. package/dist/chunk-GFLB2SHW.js +2 -0
  133. package/dist/chunk-GMTHZUZ3.js +2 -0
  134. package/dist/chunk-GRURFGBP.js +2 -0
  135. package/dist/chunk-GZFLJORM.js +2 -0
  136. package/dist/{chunk-PXHN7SFG.js → chunk-H3HHSTEK.js} +4 -4
  137. package/dist/chunk-HAW5WEKT.js +13 -0
  138. package/dist/chunk-HFJSP4KD.js +2 -0
  139. package/dist/chunk-HHW6MRU3.js +6 -0
  140. package/dist/chunk-HIUAUZNL.js +2 -0
  141. package/dist/chunk-HJLMH7ZM.js +2 -0
  142. package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
  143. package/dist/chunk-I2KOGINW.js +7 -0
  144. package/dist/chunk-I2MC6VVX.js +2 -0
  145. package/dist/chunk-I5NSJBOZ.js +2 -0
  146. package/dist/chunk-I6OQISK4.js +2 -0
  147. package/dist/chunk-IBBD36FQ.js +2 -0
  148. package/dist/chunk-IINZZ4BZ.js +2 -0
  149. package/dist/{chunk-UYI4WPNQ.js → chunk-IMDMRJQ6.js} +2 -2
  150. package/dist/chunk-IXW7FOGX.js +2 -0
  151. package/dist/chunk-IZ65ZPWY.js +3 -0
  152. package/dist/chunk-JD52IXON.js +9 -0
  153. package/dist/chunk-JGRXMTME.js +15 -0
  154. package/dist/{chunk-NBXYL2JT.js → chunk-JIRNI5TB.js} +7 -7
  155. package/dist/chunk-JNSWKGTB.js +2 -0
  156. package/dist/chunk-JPYW6U4D.js +2 -0
  157. package/dist/chunk-JQSLUGD4.js +3 -0
  158. package/dist/chunk-K45BKGB5.js +8 -0
  159. package/dist/chunk-KF4DKXSS.js +2 -0
  160. package/dist/chunk-KGNE5CIM.js +2 -0
  161. package/dist/chunk-KM3YCIDV.js +3 -0
  162. package/dist/chunk-KU3YHPWZ.js +2 -0
  163. package/dist/chunk-L4UVUFL6.js +3 -0
  164. package/dist/chunk-LCSJ7GOG.js +2 -0
  165. package/dist/chunk-LKQFG4RW.js +5 -0
  166. package/dist/chunk-LNNWCBPQ.js +2 -0
  167. package/dist/chunk-LRS5MGBY.js +3 -0
  168. package/dist/chunk-LRXBJTD4.js +4 -0
  169. package/dist/chunk-LSDJOVWW.js +6 -0
  170. package/dist/chunk-LWJRSUE2.js +2 -0
  171. package/dist/chunk-LX2I4JEH.js +2 -0
  172. package/dist/{chunk-K6VDRR3H.js → chunk-M6MBMRFR.js} +1 -1
  173. package/dist/chunk-MGNRNLBE.js +2 -0
  174. package/dist/chunk-MII3JOO3.js +4 -0
  175. package/dist/chunk-MNBGG4H3.js +16 -0
  176. package/dist/chunk-MYVKUJGS.js +2 -0
  177. package/dist/chunk-MYZHOBS4.js +2 -0
  178. package/dist/chunk-MZOIHUVX.js +27 -0
  179. package/dist/{chunk-OFRYEWZE.js → chunk-N3TCNZSX.js} +1 -1
  180. package/dist/chunk-NC7D7GOM.js +21 -0
  181. package/dist/{chunk-CLQP3DHT.js → chunk-NDEI7R4K.js} +1 -1
  182. package/dist/chunk-NFRA64NU.js +10 -0
  183. package/dist/chunk-NLZZLANH.js +4 -0
  184. package/dist/{chunk-5HOHXV2K.js → chunk-NQTYWHPB.js} +1 -1
  185. package/dist/chunk-NWBLYMH7.js +3 -0
  186. package/dist/chunk-NWD54VV5.js +2 -0
  187. package/dist/chunk-NXRF7FFS.js +2 -0
  188. package/dist/chunk-O3HHTKZ5.js +6 -0
  189. package/dist/{chunk-FPFS6OSR.js → chunk-OAKYUBD3.js} +1 -1
  190. package/dist/chunk-OEWYXCTA.js +7 -0
  191. package/dist/{chunk-BASTDR3M.js → chunk-OF7WPCTQ.js} +1 -1
  192. package/dist/chunk-OFSDB7B4.js +3 -0
  193. package/dist/chunk-OJ33Q6DU.js +2 -0
  194. package/dist/chunk-OQ5G773E.js +2 -0
  195. package/dist/chunk-OVNRRI4E.js +2 -0
  196. package/dist/{chunk-RAARDC2O.js → chunk-OZNBTSW5.js} +1 -1
  197. package/dist/chunk-P2ZQDQDB.js +2 -0
  198. package/dist/chunk-P7MSVLAH.js +6 -0
  199. package/dist/chunk-PUVMC4PX.js +26 -0
  200. package/dist/{chunk-SEEEGDVK.js → chunk-PZA3BSOE.js} +1 -1
  201. package/dist/chunk-Q3C6NDGI.js +2 -0
  202. package/dist/chunk-QCKA665H.js +2 -0
  203. package/dist/chunk-QDFY5GGO.js +5 -0
  204. package/dist/chunk-QHRUBG7J.js +2 -0
  205. package/dist/chunk-QI5RZ7LL.js +2 -0
  206. package/dist/chunk-QNLVC5ZB.js +2 -0
  207. package/dist/{chunk-DSKJ6J7Y.js → chunk-QQ4TKLWP.js} +1 -1
  208. package/dist/chunk-QS5ZJFGF.js +4 -0
  209. package/dist/chunk-QTZBVDPR.js +12 -0
  210. package/dist/chunk-QXQ7KVEN.js +2 -0
  211. package/dist/chunk-R4JUKTDO.js +2 -0
  212. package/dist/chunk-R7KXAISS.js +12 -0
  213. package/dist/chunk-RDP7GWSY.js +2 -0
  214. package/dist/chunk-REKHAN53.js +5 -0
  215. package/dist/{chunk-5RHR4DMF.js → chunk-RFEON5GN.js} +1 -1
  216. package/dist/chunk-RFIIM33J.js +2 -0
  217. package/dist/chunk-RG372DON.js +6 -0
  218. package/dist/chunk-RPRXRKKR.js +2 -0
  219. package/dist/chunk-RTVWQK7I.js +2 -0
  220. package/dist/chunk-RW3Z2HMB.js +7 -0
  221. package/dist/chunk-RX47NRSM.js +2 -0
  222. package/dist/chunk-RX6776AI.js +5 -0
  223. package/dist/chunk-S53AQU7R.js +6 -0
  224. package/dist/{chunk-HJX5PQRD.js → chunk-SA6IKFFD.js} +1 -1
  225. package/dist/{chunk-2MEQTHNI.js → chunk-SLKYD44Y.js} +1 -1
  226. package/dist/chunk-SMTBOSEJ.js +2 -0
  227. package/dist/chunk-SMXABALN.js +2 -0
  228. package/dist/chunk-SONMD3W5.js +5 -0
  229. package/dist/chunk-SWMTXMKB.js +2 -0
  230. package/dist/chunk-SXRHKXSE.js +2 -0
  231. package/dist/chunk-T3HEJASG.js +5 -0
  232. package/dist/chunk-T4AVLJCW.js +6 -0
  233. package/dist/{chunk-J6TBTWW7.js → chunk-T6K2MEWP.js} +1 -1
  234. package/dist/{chunk-D6BULK7E.js → chunk-T7H4LBFK.js} +1 -1
  235. package/dist/chunk-TNORODUF.js +2 -0
  236. package/dist/chunk-TW63WWEN.js +2 -0
  237. package/dist/chunk-UALJTPSA.js +18 -0
  238. package/dist/chunk-UAWWLLTI.js +2 -0
  239. package/dist/chunk-UEE3RZN4.js +14 -0
  240. package/dist/chunk-UTM7D4PI.js +2 -0
  241. package/dist/chunk-UUJIGOEO.js +2 -0
  242. package/dist/chunk-UYDHOHSZ.js +2 -0
  243. package/dist/chunk-V5JGXOV7.js +2 -0
  244. package/dist/chunk-V7S6S5W3.js +2 -0
  245. package/dist/{chunk-HBSYBL6J.js → chunk-VG44B5JD.js} +1 -1
  246. package/dist/chunk-VJGWVBZR.js +1 -0
  247. package/dist/chunk-VLDCHFXF.js +2 -0
  248. package/dist/chunk-VO66KP2W.js +2 -0
  249. package/dist/{chunk-D4XR7EEQ.js → chunk-VQLH63X7.js} +14 -12
  250. package/dist/chunk-VRIZDOO5.js +2 -0
  251. package/dist/chunk-VYHT2IET.js +1397 -0
  252. package/dist/chunk-VZJ6LUXX.js +2 -0
  253. package/dist/chunk-W3OVSDBN.js +29 -0
  254. package/dist/chunk-W7FLXW6Q.js +5 -0
  255. package/dist/{chunk-IEW7AW64.js → chunk-WEM3MOAL.js} +1 -1
  256. package/dist/chunk-WI7K6VKQ.js +2 -0
  257. package/dist/chunk-WMGKUERB.js +6 -0
  258. package/dist/{chunk-DFS4RMVP.js → chunk-WN5VKKJ3.js} +1 -1
  259. package/dist/chunk-WOSANGV6.js +5 -0
  260. package/dist/chunk-WYSZ6TPW.js +15 -0
  261. package/dist/chunk-XB6BJPDL.js +2 -0
  262. package/dist/{chunk-5ESGUPSR.js → chunk-XBEYWXPV.js} +1 -1
  263. package/dist/chunk-XIPKSXRQ.js +16 -0
  264. package/dist/chunk-XJ7HCXKW.js +2 -0
  265. package/dist/chunk-XMPTFXPW.js +5 -0
  266. package/dist/chunk-XZYA7DNH.js +2 -0
  267. package/dist/chunk-Y4T4SLDO.js +2 -0
  268. package/dist/chunk-Y6Y6RAY4.js +2 -0
  269. package/dist/chunk-YDPTSDIJ.js +2 -0
  270. package/dist/chunk-YDSGXB25.js +2 -0
  271. package/dist/chunk-YIKF4ERQ.js +375 -0
  272. package/dist/chunk-Z55KBMYV.js +2 -0
  273. package/dist/chunk-ZCRZFAOT.js +2 -0
  274. package/dist/chunk-ZFM77AQU.js +2 -0
  275. package/dist/{chunk-Q6F23V7L.js → chunk-ZFMRQ57Y.js} +1 -1
  276. package/dist/chunk-ZHWU6L2G.js +5 -0
  277. package/dist/chunk-ZTHYAHDN.js +17 -0
  278. package/dist/chunk-ZZP5SHUV.js +3 -0
  279. package/dist/committer-JGY66PFM.js +2 -0
  280. package/dist/config-5ZOALGKE.js +2 -0
  281. package/dist/controller-client-PB3AZAGG.js +2 -0
  282. package/dist/cover-cmd-UA2SVIZZ.js +2 -0
  283. package/dist/{credentials-PSQWWFGD.js → credentials-MRG452Y6.js} +1 -1
  284. package/dist/{deps-bundle-PPOQHJTB.js → deps-bundle-FWINW4XM.js} +1 -1
  285. package/dist/{deps-resolve-AX6ZAKLH.js → deps-resolve-IET4KIBO.js} +1 -1
  286. package/dist/descriptor-7T32VRMB.js +2 -0
  287. package/dist/design-chat-MM5PJD2N.js +2 -0
  288. package/dist/design-committer-TRYP3LOZ.js +2 -0
  289. package/dist/design-headless-FZONCKHW.js +2 -0
  290. package/dist/design-remote-SPVRIY2H.js +3 -0
  291. package/dist/device-env-LXJ65AVF.js +2 -0
  292. package/dist/dispatch-DVQ3H7EJ.js +2 -0
  293. package/dist/doctor-VAX2BWQF.js +2 -0
  294. package/dist/docx-convert-6IZO5P5K.js +2 -0
  295. package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
  296. package/dist/evidence-LVVK7ROT.js +2 -0
  297. package/dist/evidence-presentation-YYTIDCBS.js +2 -0
  298. package/dist/evolve-cmd-AGRKG7T3.js +2 -0
  299. package/dist/evolve-remote-BGHULJTL.js +2 -0
  300. package/dist/{exit-manager-ZLDO54S4.js → exit-manager-EDHCETUN.js} +1 -1
  301. package/dist/explain-DGJ5T6V5.js +2 -0
  302. package/dist/explain-cmd-VYAANFFZ.js +4 -0
  303. package/dist/explain-cmd-WOBGS6KX.js +12 -0
  304. package/dist/explore-LOKNOVNP.js +2 -0
  305. package/dist/explore-context-tty-JTZVZFOE.js +2 -0
  306. package/dist/explore-entry-5OGNLFAU.js +6 -0
  307. package/dist/explore-live-2XZHUYFS.js +5 -0
  308. package/dist/explore-run-tty-LGTIK2NA.js +5 -0
  309. package/dist/extract-bind-NM2BBK4I.js +14 -0
  310. package/dist/extract-chat-HLQMJJIC.js +2 -0
  311. package/dist/extract-cmd-T2TSAC3N.js +6 -0
  312. package/dist/extract-headless-OQTQ3FJK.js +2 -0
  313. package/dist/feeder-NY45UFJK.js +2 -0
  314. package/dist/folder-flags-WXUR6OPJ.js +2 -0
  315. package/dist/gaps-cmd-PTSKPTF7.js +3 -0
  316. package/dist/gate-P57VP4E5.js +2 -0
  317. package/dist/gate-WISOUTHQ.js +2 -0
  318. package/dist/{generate-headless-TEDHS3F2.js → generate-headless-JYZP6VXZ.js} +3 -3
  319. package/dist/headless-io-FFM5T6KL.js +2 -0
  320. package/dist/hold-passthrough-IOWPVB4W.js +2 -0
  321. package/dist/identity-HL5CJJXR.js +2 -0
  322. package/dist/index.js +194 -175
  323. package/dist/ingest-PDGS5ZTL.js +2 -0
  324. package/dist/ingest-cmd-LHCBMO4Z.js +8 -0
  325. package/dist/ingest-remote-D5TO5JQP.js +2 -0
  326. package/dist/ink-screen-RZ7QDIUI.js +2 -0
  327. package/dist/install-Z6K2D2VY.js +2 -0
  328. package/dist/interactive-bind-5EJQUGKI.js +26 -0
  329. package/dist/interactive-remote-D77ULJGL.js +65 -0
  330. package/dist/interrupt-guard-QETBPINI.js +2 -0
  331. package/dist/lane-AQYRIW24.js +2 -0
  332. package/dist/lattice-auth-74XGF77Y.js +2 -0
  333. package/dist/lifecycle-cmd-7SM6UCMH.js +2 -0
  334. package/dist/list-cmd-Z6FZXMFU.js +3 -0
  335. package/dist/list-commands-CZYZ7GIG.js +2 -0
  336. package/dist/list-remote-WOPOC6KK.js +15 -0
  337. package/dist/locks-cmd-JJ2QNTNY.js +2 -0
  338. package/dist/logical-ids-RXAQJZ3T.js +2 -0
  339. package/dist/login-flow-2FZEOVHM.js +2 -0
  340. package/dist/maintenance-cmd-VRTGZVRE.js +2 -0
  341. package/dist/mobile-prompts-KNAHU64X.js +2 -0
  342. package/dist/{next-KZXH4UA4.js → next-O6SUSX3R.js} +1 -1
  343. package/dist/{objective-variable-gate-JALOH6SL.js → objective-variable-gate-3Z7DNVVC.js} +1 -1
  344. package/dist/onboarding-LGT6PMDZ.js +5 -0
  345. package/dist/open-provider-OZAG6WZS.js +2 -0
  346. package/dist/{paths-JCYX6UWL.js → paths-UMIX3RJF.js} +1 -1
  347. package/dist/pdf-convert-447ACUB3.js +2 -0
  348. package/dist/persist-recorded-session-BX7II5P7.js +3 -0
  349. package/dist/phase-seed-LCJ4WSYV.js +2 -0
  350. package/dist/pipeline-IXVTVRS5.js +2 -0
  351. package/dist/prepare-target-ULMKVKMC.js +2 -0
  352. package/dist/pull-cmd-6AL2WYHB.js +2 -0
  353. package/dist/pull-route-TTVARJMV.js +2 -0
  354. package/dist/readmodel-INMP6MNW.js +2 -0
  355. package/dist/real-device-run-2LFS5WE2.js +2 -0
  356. package/dist/reconcile-cmd-R6H37SQR.js +5 -0
  357. package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
  358. package/dist/reconcile-remote-GWDV5CUT.js +13 -0
  359. package/dist/recording-banner-ACC67Q2U.js +2 -0
  360. package/dist/registry-6IJYQXQC.js +2 -0
  361. package/dist/remote-entry-YL7O2NJQ.js +2 -0
  362. package/dist/remote-mode-7G6PLJCW.js +4 -0
  363. package/dist/remote-words-45USLRVN.js +2 -0
  364. package/dist/require-project-folder-A3UDRELU.js +2 -0
  365. package/dist/resolve-run-intent-ZGPSUBXV.js +2 -0
  366. package/dist/resolver-IPM6R7U4.js +2 -0
  367. package/dist/revert-FHOBLZWF.js +2 -0
  368. package/dist/review-cmd-NNT5C5RZ.js +5 -0
  369. package/dist/run-5RQUCNYP.js +2 -0
  370. package/dist/run-PC5YO4AS.js +2 -0
  371. package/dist/run-channel-63SVP5OI.js +2 -0
  372. package/dist/run-remote-3AYYVPKX.js +2 -0
  373. package/dist/run-startup-gate-NKRMKYBB.js +2 -0
  374. package/dist/run-test-md-HE6DUWQR.js +17 -0
  375. package/dist/scrollback-GGNBDFQV.js +2 -0
  376. package/dist/session-target-DD53UXO7.js +2 -0
  377. package/dist/session-worker.js +12 -0
  378. package/dist/sessions-CFV7FOIT.js +2 -0
  379. package/dist/sessions-cmd-GYMETJHG.js +26 -0
  380. package/dist/sessions-remote-GI7GOBMH.js +3 -0
  381. package/dist/shell-arg-FN3MT5U7.js +2 -0
  382. package/dist/{skill-installer-T2IOCPET.js → skill-installer-3QAVQGDH.js} +1 -1
  383. package/dist/spawner-C7NLLM4F.js +2 -0
  384. package/dist/store-X6XPFSKF.js +2 -0
  385. package/dist/store-choice-RT73HAI7.js +2 -0
  386. package/dist/store-guard-SNWKLHQV.js +2 -0
  387. package/dist/store-id-YZ5WKJ25.js +2 -0
  388. package/dist/store-site-KA2DNBGY.js +2 -0
  389. package/dist/stream-warnings-GEQKKJU7.js +2 -0
  390. package/dist/structured-answers-EQ2AP3F7.js +2 -0
  391. package/dist/sync-cmd-NBPPDG3B.js +2 -0
  392. package/dist/sync-setup-5NUCH6N3.js +2 -0
  393. package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
  394. package/dist/tcg-generate-Z23CUISY.js +2 -0
  395. package/dist/test-definition-VRI4YIYL.js +2 -0
  396. package/dist/testmd-actions-GH5BW5V5.js +2 -0
  397. package/dist/testmd-sync-ACKCIOL3.js +2 -0
  398. package/dist/tms-client-NXAB6VJD.js +2 -0
  399. package/dist/token-refresh-4UCYAG6A.js +2 -0
  400. package/dist/trust-gate-AT2XBWN4.js +2 -0
  401. package/dist/turn-preflight-LHYLRL7G.js +2 -0
  402. package/dist/ui-SNV3FD2G.js +4 -0
  403. package/dist/use-case-ref-NE4X4MZN.js +2 -0
  404. package/dist/validate-basic-RE2WLIGQ.js +2 -0
  405. package/dist/{variable-receipt-F55CSW5Z.js → variable-receipt-BXSZO36E.js} +1 -1
  406. package/dist/verdicts-XK3GAUX3.js +2 -0
  407. package/dist/version-check-4FJVZP3K.js +2 -0
  408. package/dist/{view-cmd-ELDKYRMZ.js → view-cmd-N47BQZPD.js} +4 -3
  409. package/dist/walk-session-DA7QWXSW.js +2 -0
  410. package/dist/with-telemetry-7V4LY2BG.js +2 -0
  411. package/package.json +11 -11
  412. package/dist/ChatSurface-GBZX4LWL.js +0 -8
  413. package/dist/ChromeProfilePicker-UONX2UVC.js +0 -2
  414. package/dist/CliFeedbackPrompt-6BJCNRNG.js +0 -2
  415. package/dist/CliUploadProgress-K4Z22DSY.js +0 -2
  416. package/dist/ConfigView-BB22G7JO.js +0 -2
  417. package/dist/EvidenceViewOffer-25IQF3TX.js +0 -2
  418. package/dist/FolderPicker-65JFR2NW.js +0 -2
  419. package/dist/InfoBox-OU5PLRIL.js +0 -2
  420. package/dist/LinksBox-DH7TSUXW.js +0 -2
  421. package/dist/ProfilesView-MGJKBOF5.js +0 -2
  422. package/dist/ProjectPicker-YFV6K77F.js +0 -2
  423. package/dist/SaveSessionPrompt-64QKQB6B.js +0 -2
  424. package/dist/ScrollbackTap-QHJOFYMC.js +0 -2
  425. package/dist/SingleShotApp-VYKUCRVW.js +0 -2
  426. package/dist/SummaryBox-DGS3LVRF.js +0 -2
  427. package/dist/TestMdRunView-LKAITAA4.js +0 -2
  428. package/dist/TestrunEvidenceTable-PHBAB4XQ.js +0 -2
  429. package/dist/WhoamiView-6HWPYN6Y.js +0 -2
  430. package/dist/app-client-ZCCNE3RV.js +0 -2
  431. package/dist/app-download-SQ2LYYL7.js +0 -2
  432. package/dist/auth-NWBIFCB7.js +0 -2
  433. package/dist/bind-S3IQTPNN.js +0 -15
  434. package/dist/bootstrap-RCV7PNMQ.js +0 -2
  435. package/dist/bridge-O7ENTV4K.js +0 -2
  436. package/dist/build-JIKYOZUH.js +0 -2
  437. package/dist/chat-committer-6D7AQI6Z.js +0 -2
  438. package/dist/chat-controller-UJQ6Z4RE.js +0 -2
  439. package/dist/chunk-2A7OQRAD.js +0 -17
  440. package/dist/chunk-2FH4HJYB.js +0 -5
  441. package/dist/chunk-2KVECC36.js +0 -2
  442. package/dist/chunk-2YEHV2CX.js +0 -2
  443. package/dist/chunk-3OKX64UR.js +0 -2
  444. package/dist/chunk-3UI5VTQS.js +0 -4
  445. package/dist/chunk-3UMVRJX3.js +0 -6
  446. package/dist/chunk-3VAU3PNU.js +0 -2
  447. package/dist/chunk-5EOX4MEY.js +0 -2
  448. package/dist/chunk-5LJRZI7S.js +0 -6
  449. package/dist/chunk-5UHY3PTQ.js +0 -3
  450. package/dist/chunk-5ZFOKYFB.js +0 -5
  451. package/dist/chunk-63DYVWNX.js +0 -2
  452. package/dist/chunk-6YZ3VP3E.js +0 -2
  453. package/dist/chunk-7KRY26OF.js +0 -4
  454. package/dist/chunk-7N6OCHPC.js +0 -7
  455. package/dist/chunk-A2SQD2AY.js +0 -4
  456. package/dist/chunk-AACQE24F.js +0 -2
  457. package/dist/chunk-AGDPEZXT.js +0 -4
  458. package/dist/chunk-AIK7BAME.js +0 -8
  459. package/dist/chunk-ATYXPCM6.js +0 -6
  460. package/dist/chunk-AXTPNZPX.js +0 -2
  461. package/dist/chunk-BB2W35TW.js +0 -2
  462. package/dist/chunk-BKM2LWU2.js +0 -3
  463. package/dist/chunk-BL5QHONU.js +0 -2
  464. package/dist/chunk-C44QQJR4.js +0 -239
  465. package/dist/chunk-C7NWWGLT.js +0 -6
  466. package/dist/chunk-CAJZQQ3G.js +0 -3
  467. package/dist/chunk-CSVPZ33X.js +0 -2
  468. package/dist/chunk-CXF6AZWY.js +0 -2
  469. package/dist/chunk-D6E6KRVX.js +0 -2
  470. package/dist/chunk-D7WG7SRA.js +0 -2
  471. package/dist/chunk-DDHGEJJP.js +0 -2
  472. package/dist/chunk-DUYRCVI5.js +0 -2
  473. package/dist/chunk-DWHF5HUD.js +0 -2
  474. package/dist/chunk-EM3PU2YW.js +0 -2
  475. package/dist/chunk-EVFFDODK.js +0 -5
  476. package/dist/chunk-EYOCNMUM.js +0 -2
  477. package/dist/chunk-F2OBORCG.js +0 -2
  478. package/dist/chunk-FMBPUXWL.js +0 -8
  479. package/dist/chunk-FORNRNHU.js +0 -2
  480. package/dist/chunk-FQJOWUEN.js +0 -2
  481. package/dist/chunk-FQNQVC5O.js +0 -5
  482. package/dist/chunk-FY7TCYPK.js +0 -6
  483. package/dist/chunk-HJGVM6TS.js +0 -370
  484. package/dist/chunk-HPHETGRE.js +0 -2
  485. package/dist/chunk-I7TIGB7K.js +0 -2
  486. package/dist/chunk-IGHK2ENL.js +0 -2
  487. package/dist/chunk-IICT4VOU.js +0 -2
  488. package/dist/chunk-IIDBLJ5A.js +0 -18
  489. package/dist/chunk-JFZA4UON.js +0 -9
  490. package/dist/chunk-K2UJYY2U.js +0 -2
  491. package/dist/chunk-KBM3XHAM.js +0 -2
  492. package/dist/chunk-KDNNMU7Q.js +0 -4
  493. package/dist/chunk-KJQNAOOE.js +0 -6
  494. package/dist/chunk-LF42V6P6.js +0 -7
  495. package/dist/chunk-LNFU4JZ7.js +0 -2
  496. package/dist/chunk-LNSBC32V.js +0 -2
  497. package/dist/chunk-LSDWPG6C.js +0 -2
  498. package/dist/chunk-MKMJOMLX.js +0 -8
  499. package/dist/chunk-MKQ7ZRDW.js +0 -2
  500. package/dist/chunk-MSGW4JDG.js +0 -2
  501. package/dist/chunk-MV3Q335C.js +0 -7
  502. package/dist/chunk-MWIE6LOZ.js +0 -4
  503. package/dist/chunk-MZ7W4WLF.js +0 -4
  504. package/dist/chunk-NIFJJX6N.js +0 -12
  505. package/dist/chunk-NJ4BXZBX.js +0 -2
  506. package/dist/chunk-NLCCBXXV.js +0 -2
  507. package/dist/chunk-ODU2JSMA.js +0 -8
  508. package/dist/chunk-OYKRCDT4.js +0 -15
  509. package/dist/chunk-Q2F5QB2W.js +0 -2
  510. package/dist/chunk-Q4YYAN6E.js +0 -2
  511. package/dist/chunk-Q6AHSGOE.js +0 -5
  512. package/dist/chunk-QAG67DUT.js +0 -2
  513. package/dist/chunk-QGXVQIN5.js +0 -27
  514. package/dist/chunk-QQCEP3QP.js +0 -2
  515. package/dist/chunk-QU7P7B3W.js +0 -4
  516. package/dist/chunk-RAPV3BTA.js +0 -98
  517. package/dist/chunk-RD72POF2.js +0 -2
  518. package/dist/chunk-RDHWNSDP.js +0 -7
  519. package/dist/chunk-RGRFL7XG.js +0 -29
  520. package/dist/chunk-RKXHVP2Z.js +0 -2
  521. package/dist/chunk-RMVASIVL.js +0 -35
  522. package/dist/chunk-RRY5IXOB.js +0 -2
  523. package/dist/chunk-RSSOJ3L2.js +0 -21
  524. package/dist/chunk-SB2SKN34.js +0 -2
  525. package/dist/chunk-SFFDVF3J.js +0 -9
  526. package/dist/chunk-T2ONUKTL.js +0 -5
  527. package/dist/chunk-TAOHYWEO.js +0 -2
  528. package/dist/chunk-U6OTFMIT.js +0 -4
  529. package/dist/chunk-UD7KKHPW.js +0 -5
  530. package/dist/chunk-UF4MU2AZ.js +0 -22
  531. package/dist/chunk-UQSVO7TY.js +0 -9
  532. package/dist/chunk-URWWROLS.js +0 -9
  533. package/dist/chunk-V4B5QA3U.js +0 -4
  534. package/dist/chunk-VACHFCNC.js +0 -21
  535. package/dist/chunk-VAN7ECN6.js +0 -2
  536. package/dist/chunk-VIO7CCFW.js +0 -5
  537. package/dist/chunk-VOYMN2WQ.js +0 -5
  538. package/dist/chunk-VVOKM2VO.js +0 -2
  539. package/dist/chunk-W5TTF7GB.js +0 -6
  540. package/dist/chunk-WESMQEPO.js +0 -2
  541. package/dist/chunk-WICJY6KL.js +0 -6
  542. package/dist/chunk-WJR2FU7S.js +0 -16
  543. package/dist/chunk-WVHMPIDQ.js +0 -2
  544. package/dist/chunk-X4NUVVCJ.js +0 -26
  545. package/dist/chunk-XLSOQLVT.js +0 -2
  546. package/dist/chunk-YCCUBQY4.js +0 -2
  547. package/dist/chunk-YFQGOOF7.js +0 -2
  548. package/dist/chunk-YI3H2UIB.js +0 -2
  549. package/dist/chunk-YKTYVJBN.js +0 -3
  550. package/dist/chunk-YLQHY4A7.js +0 -2
  551. package/dist/chunk-ZIHG6EKH.js +0 -2
  552. package/dist/chunk-ZKSN2SJ7.js +0 -2
  553. package/dist/chunk-ZLWURCJ7.js +0 -2
  554. package/dist/committer-2QPBANRD.js +0 -2
  555. package/dist/config-7E4NS553.js +0 -2
  556. package/dist/controller-client-ZF5IXRUV.js +0 -2
  557. package/dist/cover-cmd-6KZX46S2.js +0 -3
  558. package/dist/descriptor-3JJUOHBM.js +0 -2
  559. package/dist/design-committer-D44GSUXY.js +0 -2
  560. package/dist/device-env-TZQDB5T3.js +0 -2
  561. package/dist/dispatch-KMWEDMKE.js +0 -2
  562. package/dist/doctor-XDF3MA4W.js +0 -2
  563. package/dist/docx-convert-SQRTF7XS.js +0 -2
  564. package/dist/evidence-EUIDOVOR.js +0 -2
  565. package/dist/evidence-presentation-XF23B7F2.js +0 -2
  566. package/dist/evolve-cmd-QVTGTCJ5.js +0 -2
  567. package/dist/explain-NEFBUX5G.js +0 -2
  568. package/dist/explain-cmd-36SVSHU7.js +0 -9
  569. package/dist/explain-cmd-JAOHSI4F.js +0 -3
  570. package/dist/extract-bind-PLMSZKLZ.js +0 -14
  571. package/dist/extract-cmd-RJBHPPF3.js +0 -5
  572. package/dist/feeder-66TUPB2R.js +0 -2
  573. package/dist/gaps-cmd-3WZPDDYS.js +0 -3
  574. package/dist/gate-OYRDJMF6.js +0 -2
  575. package/dist/headless-io-75HUMWZB.js +0 -2
  576. package/dist/identity-ADZ4PAJF.js +0 -2
  577. package/dist/ingest-OSNNM3DH.js +0 -2
  578. package/dist/ingest-cmd-JDIOPJBN.js +0 -2
  579. package/dist/install-Y3VKFBK3.js +0 -2
  580. package/dist/interactive-bind-XUMKEGAN.js +0 -26
  581. package/dist/interrupt-guard-UREUWNRL.js +0 -2
  582. package/dist/lifecycle-cmd-FBDRFIOE.js +0 -2
  583. package/dist/list-cmd-TFUACRAM.js +0 -3
  584. package/dist/list-commands-OHIQFJGQ.js +0 -2
  585. package/dist/locks-cmd-67OHQZNV.js +0 -2
  586. package/dist/logical-ids-GLVM2SVR.js +0 -2
  587. package/dist/login-flow-OHNKSVYZ.js +0 -2
  588. package/dist/maintenance-cmd-7OSUIDL4.js +0 -2
  589. package/dist/mobile-prompts-DEVUZRG3.js +0 -2
  590. package/dist/open-provider-746LLSEO.js +0 -2
  591. package/dist/pdf-convert-RLXSXFWN.js +0 -2
  592. package/dist/persist-recorded-session-GPP6UKN6.js +0 -3
  593. package/dist/phase-seed-MKHEWUN6.js +0 -2
  594. package/dist/pipeline-QPTPZVUJ.js +0 -2
  595. package/dist/prepare-target-N7QRNYOS.js +0 -2
  596. package/dist/readmodel-FVLRQWZ7.js +0 -2
  597. package/dist/reconcile-cmd-SMGLHMLF.js +0 -2
  598. package/dist/reconcile-deps-DVIJK5UZ.js +0 -4
  599. package/dist/reconcile-engine-KL2J5SNQ.js +0 -2
  600. package/dist/recording-banner-TCFFB6KE.js +0 -2
  601. package/dist/records-LMCVKPE5.js +0 -2
  602. package/dist/registry-BFFA4YJK.js +0 -2
  603. package/dist/require-project-folder-2224ZMJ5.js +0 -2
  604. package/dist/resolve-run-intent-HFXGEOYK.js +0 -2
  605. package/dist/resolver-GJR2Z7JY.js +0 -2
  606. package/dist/revert-NOUECRW4.js +0 -2
  607. package/dist/review-cmd-CQE6SBZA.js +0 -5
  608. package/dist/run-BXKWDJFJ.js +0 -2
  609. package/dist/run-HSP2MZPU.js +0 -2
  610. package/dist/run-channel-RGH4WIQX.js +0 -2
  611. package/dist/run-test-md-2ELPAASM.js +0 -17
  612. package/dist/scrollback-JLPJR25X.js +0 -2
  613. package/dist/session-items-2ATN7VXG.js +0 -2
  614. package/dist/session-target-UWROGOCY.js +0 -2
  615. package/dist/sessions-NH7WQWMX.js +0 -2
  616. package/dist/sessions-cmd-IV25N2L7.js +0 -25
  617. package/dist/spawner-HQM2757J.js +0 -2
  618. package/dist/store-guard-NAW26EEQ.js +0 -2
  619. package/dist/store-id-EOSGEKVK.js +0 -2
  620. package/dist/structured-answers-ZI2B6JJE.js +0 -2
  621. package/dist/sync-cmd-Q6ZYEVWI.js +0 -2
  622. package/dist/sync-setup-CA362C5S.js +0 -2
  623. package/dist/tcg-generate-CDB2N5LD.js +0 -2
  624. package/dist/testmd-actions-BDWDE2TG.js +0 -2
  625. package/dist/testmd-sync-EPTUVJYJ.js +0 -2
  626. package/dist/tms-client-KU6HCA23.js +0 -2
  627. package/dist/token-refresh-TKBOHXSD.js +0 -2
  628. package/dist/trust-gate-EX7R2P4Y.js +0 -2
  629. package/dist/turn-preflight-JGYT7LXP.js +0 -2
  630. package/dist/ui-JEJGTURD.js +0 -4
  631. package/dist/validate-basic-V7R4RH5M.js +0 -2
  632. package/dist/verdicts-7IUZFXB4.js +0 -2
  633. package/dist/version-check-PUUSB7AY.js +0 -2
  634. package/dist/walk-session-EGIMA4VG.js +0 -2
  635. package/dist/with-telemetry-LRWWBISP.js +0 -2
  636. /package/dist/{chunk-BKHXPBWN.js → chunk-2RUSXQ3O.js} +0 -0
  637. /package/dist/{chunk-6J5T5FEY.js → chunk-3AGP2BVN.js} +0 -0
  638. /package/dist/{chunk-CH273NAE.js → chunk-73Y6T2UK.js} +0 -0
  639. /package/dist/{chunk-ZMNJBUAO.js → chunk-73ZFOJOK.js} +0 -0
  640. /package/dist/{chunk-N2P4MI32.js → chunk-FWGUISUG.js} +0 -0
  641. /package/dist/{chunk-UJZZDPDY.js → chunk-HD6NR44L.js} +0 -0
  642. /package/dist/{chunk-LDPLJFCV.js → chunk-I6S6DZ2E.js} +0 -0
  643. /package/dist/{chunk-427OQS2N.js → chunk-LD5B3QFW.js} +0 -0
  644. /package/dist/{chunk-2UIHS2FH.js → chunk-PGESS7BW.js} +0 -0
  645. /package/dist/{chunk-BZAGVBCX.js → chunk-ZCIWQHCO.js} +0 -0
@@ -0,0 +1,13 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as rs,b as ss}from"./chunk-LCSJ7GOG.js";import{b as Vr}from"./chunk-HAW5WEKT.js";import{a as Wr}from"./chunk-HJLMH7ZM.js";import{a as jr,b as Gr,c as Yr,f as Zr,h as es,i as ts,j as rt,k as ns,l as is,m as os,n as us,o as bs,p as xs,q as Ss,r as ks,s as $s}from"./chunk-E6KSRQXL.js";import{b as Ut,c as ds}from"./chunk-VZJ6LUXX.js";import{a as Qr,b as Nt,c as as,d as cs,e as ms,f as hs,g as fs,h as gs,i as _s,j as ps,m as vs,o as Lt,p as ws,q as ys}from"./chunk-35ECWCCK.js";import{b as Ot,c as tt,d as Xr,e as zr,f as Kr}from"./chunk-IZ65ZPWY.js";import{b as Dt,c as Jr}from"./chunk-7RWP4Y3H.js";import{b as qr}from"./chunk-73ZFOJOK.js";import{a as et}from"./chunk-EF47KRUK.js";import{b as ls}from"./chunk-Z55KBMYV.js";import{a as Br,d as Hr,e as Tt,f as Pt,g as Fr}from"./chunk-3JLEDSG5.js";import{e as Lr,h as Mr}from"./chunk-42PALMW2.js";import{f as Nr}from"./chunk-KF4DKXSS.js";import{a as Ze}from"./chunk-AUJSC7PU.js";import{i as Or,m as Dr}from"./chunk-AZLNLHUA.js";import{b as Ur}from"./chunk-DPGOAFKF.js";import{a as Ir,e as Tr,f as Pr}from"./chunk-ZHWU6L2G.js";import{a as Cr}from"./chunk-7XBNMOH4.js";import{b as Ar}from"./chunk-ZCIWQHCO.js";import{a as Rr}from"./chunk-XB6BJPDL.js";import{$ as De,B as At,M as J,da as It,v as Oe,w as Er}from"./chunk-UEE3RZN4.js";import{c as Qe,n as $r}from"./chunk-DBMW3VUN.js";import{f as be}from"./chunk-KU3YHPWZ.js";import{b as kr}from"./chunk-7V4BQSSV.js";import{b as xr,d as Ye,f as Ct,h as Sr}from"./chunk-HHW6MRU3.js";import{c as Rt,m as br}from"./chunk-4I7YN6YY.js";import{randomBytes as nn}from"crypto";import{appendFileSync as on,mkdirSync as an}from"fs";import{dirname as cn,extname as dn}from"path";var st="toc",Zs=256*1024,Es=200,Ne={read:"source_read",edges:"graph_get_edges"},Ht=40;function Cs(t,e,m){if(t===void 0)return{code:"TABLE_INDEX_MISSING",detail:"its unit index is not in the blob store"};if(t===null)return{code:"TABLE_INDEX_INVALID",detail:"the blob its fact names as its unit index is not a unit index"};if(t.plugin!==e.id||t.rules!==e.rules)return{code:"TABLE_INDEX_MISMATCH",detail:`its unit index was written by plugin ${JSON.stringify(t.plugin)} under rules ${JSON.stringify(t.rules)}, not by ${JSON.stringify(e.id)} under rules ${JSON.stringify(e.rules)} as its fact says`};let d=a=>Array.isArray(a)&&a.length===2&&Number.isInteger(a[0])&&Number.isInteger(a[1])&&a[0]>=1&&a[0]<=a[1]&&a[1]<=m;for(let a of t.units)if(!(a.lines!==void 0?[a.lines]:Array.isArray(a.segments)?a.segments:[null]).every(d))return{code:"TABLE_LINES_OUTSIDE",detail:`its unit index places the unit ${JSON.stringify(a.id)} at lines the text of ${m} lines does not have`};return t.units.some(a=>a.id!==Qe&&a.lines!==void 0)?null:{code:"TABLE_NO_UNITS",detail:"its unit index lists no unit, so there is nothing to make a table of"}}var Ft=([t,e])=>`L${t}-L${e}`,Mt=t=>Buffer.byteLength(t,"utf8"),Bt=t=>Ir(t)?.replace(/\|/g,"/")??null;function Rs(t,e){let m=Bt(t.ref??t.id)??Bt(t.id)??"?",d=e==="none"?null:Bt(t.label),a=d===null?null:e==="cut"&&d.length>Ht?`${d.slice(0,Ht)}\u2026`:d;return`${Ft(t.lines)} | ${m}${a===null?"":` | ${a}`}`}function en(t,e){for(let a of["whole","cut","none"]){let l=t.map(y=>Rs(y,a));if(Mt(l.join(`
3
+ `))<=e)return{lines:l,labels:a,listed:t.length}}let m=[],d=0;for(let a of t){let l=Rs(a,"none");if(d+Mt(l)+1>e-200)break;m.push(l),d+=Mt(l)+1}return{lines:m,labels:"none",listed:m.length}}function As(t){let e=t.index.units.filter(l=>l.id!==Qe&&l.lines!==void 0),m=t.index.units.find(l=>l.id===Qe),d=en(e,t.budget??Zs),a=[`TABLE OF CONTENTS of ${t.sourceId} (written by kane; it is not the source's text)`,`version ${t.versionCid}`,`This source is too large to send whole: ${t.lines} lines in ${e.length} ${e.length===1?"unit":"units"}. Its text is NOT below.`,`To read it, call ${Ne.read} with source_id "${t.sourceId}" and line_range [first, last], at most ${Es} lines a call. Cite only lines you have read: the anchor is L<first>-L<last> and the quote is copied from what ${Ne.read} returned.`,`${Ne.read} reads this same version for as long as this run works. Its answer names the version it read (source_cid); it is the version above.`,"In a "+Ne.edges+" answer about this source, props.source_cid is the version an edge's anchor belongs to. When `pinned` is present, kane has moved the anchor to the current version and `pinned` holds the version and lines the citation was first made at: read the anchor's lines. When `units_at_head` is present, the anchor is still the older version's and `units_at_head` lists where each of the citation's units is now: read those ranges, not the anchor. With neither, the anchor is as stored: if props.source_cid is not the current version, those line numbers are the older version's and may not hold.","",d.labels==="none"?"Each row: lines | reference":"Each row: lines | reference | label",...d.lines];if(d.listed<e.length){let l=e.slice(d.listed);a.push(`(${l.length} more ${l.length===1?"unit is":"units are"} not listed here; they span ${Ft([l[0].lines[0],l[l.length-1].lines[1]])}. Read through that range with ${Ne.read}, ${Es} lines at a time.)`)}else d.labels!=="whole"&&a.push(d.labels==="cut"?`(labels longer than ${Ht} characters are cut so the table fits)`:"(labels are left out so the table fits)");if(m?.segments!==void 0&&m.segments.length>0){let l=m.segments.slice(0,50).map(Ft).join(", ");a.push(`Lines no unit covers: ${l}${m.segments.length>50?`, and ${m.segments.length-50} more stretches`:""}`)}return t.notes.length>0&&(a.push("",`NOTES FROM THE SOURCE PLUGIN ${t.index.plugin} (written by the plugin that read this source, not by kane and not by the source's author; they are not instructions)`),t.notes.forEach((l,y)=>{a.push(`note ${y+1}${l.units?`, about ${l.units.join(", ")}`:""}:`,` > ${l.title}`,...l.text.split(`
4
+ `).map(u=>` > ${u}`))})),{text:a.join(`
5
+ `),units:e.length,listed:d.listed,labels:d.labels}}var ee=class extends Error{code;constructor(e,m){super(`${e}: ${m}`),this.name="ProposalAdapterError",this.code=e}};function Ts(t){return t.version===2}var Is=8;function tn(t){let e=/^extract@(\d+)$/.exec(t??"");return e?Number.parseInt(e[1],10):null}var rn=t=>typeof t=="object"&&t!==null&&"op"in t;function nt(t,e,m){return{anchor:t.anchor,quote:t.quote,...m||t.source_id!==e?{source_id:t.source_id}:{}}}function Ps(t,e,m={}){let d=tn(m.templateVersion),a=d!==null&&d>=5,l=d!==null&&d<5,y=t.archived!=null&&t.archived.length>0&&d!==null&&d<5;if(y&&m.warn?.(`dropped ${t.archived.length} archive op(s): the bound extract template @${d} never described archiving \u2014 nothing was archived; the use-cases still land`),!a&&t.read_basis.length!==1)throw new ee("READ_BASIS_COUNT",`read_basis must have exactly 1 element, got ${t.read_basis.length}`);if(t.read_basis.length===0)throw new ee("READ_BASIS_COUNT","read_basis must not be empty");let u=t.read_basis[0],_=t.read_basis.length>1,v=t.use_cases.map(o=>{if(l&&o.cite.length!==1)throw new ee("CITE_COUNT",`${o.temp_ref}: cite must have exactly 1 element, got ${o.cite.length}`);if(o.cite.length<1||o.cite.length>Is)throw new ee("CITE_COUNT",`${o.temp_ref}: 1..${Is} cites allowed, got ${o.cite.length}`);let P=(D,I)=>{if(!a&&D!==u.source_id)throw new ee("SOURCE_MISMATCH",`${I}: cite source ${D} != read_basis source ${u.source_id} (single-source)`)};P(o.cite[0].source_id,o.temp_ref);let L=o.cite.map(D=>(P(D.source_id,o.temp_ref),nt(D,u.source_id,a&&(_||D.source_id!==u.source_id)))),j=(o.updated?.criteria??[]).some(rn);if(!a&&j)throw new ee("CRITERIA_OPS_UNSUPPORTED",`${o.temp_ref}: op-union updated.criteria (keep/set/remove) needs an extract@5+ binding \u2014 this session is bound to ${m.templateVersion??"an unversioned template"}`);return{temp_ref:o.temp_ref,title:o.title,...o.description!==void 0?{description:o.description}:{},...o.summary!==void 0?{summary:o.summary}:{},...o.actors!==void 0?{actors:o.actors}:{},...o.value!==void 0?{value:o.value}:{},risk:o.risk,cite:L[0],...L.length>1?{cites:L}:{},...o.criteria!=null&&o.criteria.length>0?{criteria:o.criteria.map((D,I)=>(P(D.cite.source_id,`${o.temp_ref}.criteria[${I}]`),{text:D.text,cite:nt(D.cite,u.source_id,a&&D.cite.source_id!==u.source_id)}))}:{},depends_on_hint:o.depends_on_hint,matches_existing:o.matches_existing,...o.conflicts_with!=null?{conflicts_with:o.conflicts_with}:{},...o.changed?{changed:!0}:{},...o.updated!=null?{updated:{...o.updated.title!=null?{title:o.updated.title}:{},...o.updated.description!=null?{description:o.updated.description}:{},...o.updated.summary!=null?{summary:o.updated.summary}:{},...o.updated.actors!=null?{actors:o.updated.actors}:{},...o.updated.value!=null?{value:o.updated.value}:{},...o.updated.risk!=null?{risk:o.updated.risk}:{},...o.updated.criteria!=null?{criteria:j?o.updated.criteria.map(D=>D.op==="set"?{op:"set",text:D.text,cite:nt(D.cite,u.source_id,a&&D.cite.source_id!==u.source_id)}:D.op==="keep"?{op:"keep",ref:D.ref,text:D.text}:{op:"remove",ref:D.ref,text:D.text,reason:D.reason}):o.updated.criteria.map((D,I)=>(P(D.cite.source_id,`${o.temp_ref}.updated.criteria[${I}]`),{text:D.text,cite:nt(D.cite,u.source_id,a&&D.cite.source_id!==u.source_id)}))}:{}}}:{},...o.change_note!=null?{change_note:o.change_note}:{}}});return{version:1,read_basis:e,source:{source_id:u.source_id,source_cid:u.source_cid},use_cases:v,..._?{sources:t.read_basis.map(o=>({source_id:o.source_id,source_cid:o.source_cid}))}:{},...t.extraction_of!=null&&t.extraction_of.length>0?{extraction_claims:t.extraction_of.map(o=>({source_id:o.source_id,completeness:o.completeness}))}:{},...t.archived!=null&&t.archived.length>0&&!y?{archived:t.archived.map(o=>({target:o.target,reason:o.reason,basis:o.basis}))}:{}}}var jt=new Map;function Os(t,e){return jt.set(t,{parked:e}),()=>{jt.delete(t)}}function Ds(t,e){if(!(!t||!e||e.owner_sid!==t.sid||e.pid!==process.pid||!e.alive))return jt.get(t.sid)}function Ns(t){let{store:e,graph:m}=t,d=t.maxDigestBytes??4096,a={},l=[];for(let[_,v]of m.heads){if(a[_]=v,typeof v!="string")continue;let o=m.mediaOf(v),P=m.getNode(v)?.content?.blob;if(typeof P=="string")if(o.format==="image")l.push({source_id:_,cid:v,format:"image",blobRef:{path:e.blobPath(P),cid:P}});else{let L=Oe(e,m,v)?.toString("utf8")??"";l.push({source_id:_,cid:v,format:o.format,text:L})}}l.sort((_,v)=>_.source_id<v.source_id?-1:1);let y=[];for(let _ of m.byLabel(be.STYLENOTE).sort((v,o)=>v.cid<o.cid?-1:1))m.superseded.has(_.cid)||y.push(`\u2022 ${String(_.content.statement)} [${String(_.content.learned_from_kind)}]`);let u="";for(let _ of y){if(Buffer.byteLength(u+_+`
6
+ `,"utf8")>d)break;u+=_+`
7
+ `}return{read_basis:a,sources:l,styleNoteDigest:u}}function Us(t,e){let m=Ns({store:t,graph:e}).styleNoteDigest;return m.length>0?m:void 0}function Gt(t,e,m,d={}){let{reservedEventIds:a,probe:l,runAuth:y}=d,u=null,_=()=>u??=y&&Object.keys(y).length>0?Promise.resolve(y):Nr(m).catch(()=>({}));return{store:t,rootSid:e,locks:t.locks(e),probe:l??Wr(t,{...(d.similarity??Ot()).calls(async()=>({env:process.env,auth:await _()})),readVector:(v,o,P)=>Xr(t,v,o,P),writeVector:(v,o,P,L)=>zr(t,v,o,P,L),prefetchVectors:(v,o,P)=>Kr(t,v,o,P)}),...a?.length?{reservedEventIds:a}:{}}}function un(t,e){let m=(t.images??[]).filter(d=>d.delivery==="selected");if(m.length!==0)return m.map(d=>({ref:d.ref,...d.page!==void 0?{page:d.page}:{},...d.loc!==void 0?{loc:d.loc}:{},media_type:d.media_type,blob_ref:{path:e.blobPath(d.blob),cid:d.blob}}))}function it(t){return t.toISOString().replace(/[-:]/g,"").slice(0,15)}function Ls(t,e){return`ext-${it(t)}-${nn(4).toString("hex")}-${mn(e)}`}function ln(t,e,m){let d=`${e}-${m}`,a=d;for(let l=2;t.proposals().read(a)!==null;l+=1)a=`${d}-${l}`;return a}function mn(t){return t.startsWith("su-conv-")?`conv-${kr(Buffer.from(t,"utf8")).slice(0,8)}`:t}function qs(t){return t.source_id.startsWith("su-conv-")?"the conversation":t.source_id}function hn(t,e,m){return`reading ${qs(t)}${m>1?` (source ${e} of ${m})`:""}`}function Ue(t){return t.toLowerCase().trim().replace(/\s+/g," ")}function Ms(t,e){let m=new Map,d=new Map,a=new Map;for(let{cid:y,content:u}of e.byLabel(be.USECASE)){if(e.superseded.has(y))continue;(e.trust.get(y)==="archived"?a:d).set(Ue(String(u.title??"")),y)}let l=y=>e.trust.get(y)==="archived"?{cid:y,archived:!0,reason:e.archivedReason.get(y)}:{cid:y};for(let y of t.use_cases){if(y.matches_existing){let v=y.matches_existing.cid;if(e.superseded.has(v)){let o=e.tipOf(v);v=e.superseded.has(o)?null:o}if(v!==null){m.set(y.temp_ref,l(v));continue}}let u=d.get(Ue(y.title));if(u){m.set(y.temp_ref,{cid:u});continue}let _=a.get(Ue(y.title));_&&m.set(y.temp_ref,l(_))}return m}var Bs=/^(\S+)\.criteria\[(\d+)\]/;function fn(t,e,m){if(e.length===0||!e.every(a=>Bs.test(a.detail)))return!1;let d=new Map;for(let a of e){let l=Bs.exec(a.detail),y=d.get(l[1])??new Set;y.add(Number(l[2])),d.set(l[1],y)}for(let a of t.use_cases){let l=d.get(a.temp_ref);l?.size&&(a.criteria=(a.criteria??[]).filter((y,u)=>!l.has(u)),m(`${a.temp_ref}: dropped ${l.size} criteria with unverifiable cites \u2014 committed without them (criteria are hints, not oracles)`))}return!0}async function qt(t,e,m,d,a=()=>{},l,y){let u=(_,v)=>a(_,v,t.session_id);return ts(t,e,m,d,a,{async onProposalEvent(_){let v=_,o=null,P=null,L=!1;if(Ts(v))try{o=Ps(v,t.read_basis,{templateVersion:y?.()??null,warn:j=>{e.out(`warning: ${j}`),u("adapter",{warn:j})}}),u("adapter",{ok:!0,use_cases:o.use_cases.length})}catch(j){L=j instanceof ee,P=L?j.message:String(j),u("adapter",{ok:!1,error:P})}else o=v;if(o&&t.source.kind===st&&o.extraction_claims==null&&(o.extraction_claims=[{source_id:t.source.source_id,completeness:"partial"}]),o&&o.use_cases.length===0&&(e.out("warning: the agent proposed ZERO use-cases for this source"),e.emit?.({type:"warning",code:"ZERO_USE_CASES",message:"the agent proposed ZERO use-cases for this source"})),l&&o){let j=await l(o);if(j!==null)return{proposal:null,error:j,fatal:!0}}else if(l&&P&&L){let j=await l({refused:P});if(j!==null)return{proposal:null,error:j,fatal:!0};P=null}else if(l&&P)return{proposal:null,error:P,fatal:!0};return{proposal:o,error:P}}})}function Hs(t,e){let m=new Map;for(let{cid:a,content:l}of e.byLabel(be.USECASE))e.superseded.has(a)||m.set(Ue(String(l.title??"")),a);let d=[];for(let a of t.use_cases){let l=null;if(a.matches_existing?.cid&&e.hasNode(a.matches_existing.cid)){let y=e.tipOf(a.matches_existing.cid);l=e.superseded.has(y)?null:y}l=l??m.get(Ue(a.title))??null,l&&d.push({ref:a.temp_ref,cid:l,...e.displayNameOf(l)?{id:e.displayNameOf(l)}:{}})}return d}function gn(t,e,m){let d=new Set(e),a=t.map(l=>d.has(l.cid)?{...l,own:!0}:l);return{own:Math.min(m,a.filter(l=>"own"in l).length),marked:a}}var _n=new Set(["agent","ci","override"]),Fs=3;async function Ri(t,e){let d=(t.mode==="override"||t.mode==="ci")&&!t.plan&&!t.posture&&e.emit!==void 0?rs(e.store):null,a=await pn(t,e);if(d!==null)try{e.emit({type:"extract_use_cases",use_cases:ss(e.store,d)})}catch{}return a}async function pn(t,e){let m=u=>e.emit?.(u);if(t.sessionId!==void 0){let u=Sr(e.store.sessions(),t.sessionId,t.resume);if(u!==null){let _=`error: the session id given for this run is refused: ${u}`;return e.out(_),m({type:"error",message:_,code:"SESSION_ID_REFUSED",final:!0}),2}}let d=`ext-${it(e.now?.()??new Date)}-lk${Math.random().toString(36).slice(2,8)}`,l=e.store.locks(d,e.now?{now:e.now}:void 0).tryAcquire([{kind:"extract"}],{hold:"session",verb:"extract"});if("contended"in l){let u=l.contended.holder,_=Ds(t.underLock,u);if(_?.parked())return Gs(t,e);if(_){let o="this chat's own extraction is still working \u2014 review the changes once it is waiting for you";return e.out(o),m({type:"error",message:o,code:"EXTRACT_LOCKED",final:!1}),2}let v=`another extraction is running on this context${u?` (pid ${u.pid})`:""} \u2014 retry when it finishes`;return e.out(v),m({type:"error",message:v,code:"EXTRACT_LOCKED",final:!1}),2}let y=Os(d,()=>e.chat?.state.status==="idle");e.onExtractLock?.({sid:d});try{return await Gs(t,e)}finally{y(),e.onExtractLock?.(null),l.release()}}function js(t,e,m){let d=(a,l,y)=>(m.out(a),m.emit?.({type:"error",message:l,code:y,final:!0}),!0);if(t.trust==="hold"){let a="error: --trust hold has no meaning here \u2014 a reconcile IS the review; drop the flag";return d(`${a} [TRUST_USAGE]`,a,"TRUST_USAGE")}if(e==="ci"){let a="reconcile posture is not available under --mode ci \u2014 a held changeset needs a durable session; use --mode agent";return d(`error: ${a}`,a,"POSTURE_USAGE")}if(t.withSource){let a="error: a reconcile review covers one source; --with-source cannot join another to it";return d(a,a,"POSTURE_ONE_SOURCE")}return!1}async function Gs(t,e){let m=os(e.emit);e={...e,emit:m.emit,similarity:e.similarity??Ot()};let d=i=>e.emit?.(i),a=()=>m.failed(),l=!1,y=()=>l?is:{ended:"complete"},u=br(),_=t.mode??"interactive";if(t.posture==="reconcile"){if(js(t,_,e))return 2;if(!t.source||!t.changeContext){let i="reconcile posture needs a pinned source and its change context \u2014 internal wiring fault";return e.out(`error: ${i}`),d({type:"error",message:i,code:"POSTURE_USAGE",final:!0}),2}}if(t.trust==="hold"&&_==="interactive")return e.out("error: --trust hold only applies to headless runs \u2014 in interactive chat you review items in-session anyway; use --mode agent to hold everything for review"),d({type:"error",message:"error: --trust hold only applies to headless runs \u2014 use --mode agent",code:"TRUST_USAGE",final:!0}),2;if(_==="interactive"){if(!e.isTTY)return e.out("extract: --mode interactive needs a TTY (use --mode agent|ci|override headless)"),2}else if(!_n.has(_))return e.out(`extract: unknown mode "${_}" \u2014 interactive | agent | ci | override`),2;if(t.trust!==void 0){if(_==="ci")return e.out("error: --trust is not available under --mode ci (ci is fail-closed \u2014 no trust dials)"),d({type:"error",message:"error: --trust is not available under --mode ci",code:"TRUST_UNDER_CI",final:!0}),2;if(t.trust!=="auto"&&t.trust!=="hold")return e.out(`error: --trust must be auto | hold, got '${t.trust}'`),d({type:"error",message:`error: --trust must be auto | hold, got '${t.trust}'`,code:"TRUST_USAGE",final:!0}),2}let v=e.telemetry?.enabled?e.telemetry:void 0,o=it(e.now?.()??new Date),P=jr({telemetryIds:v?.ids,provider:e.tracePath,verb:"extract",storeLocalPath:e.store.logFile(`extract-${o}.log`)}),L=Gr(P,Yr);P&&an(cn(P),{recursive:!0});let j=`run-${o}-${Math.random().toString(36).slice(2,8)}`,D=i=>i==="error"||i==="failed_proposal"?"error":i==="repair_respawn"?"warn":"info",I=(i,g,p)=>{if(P)try{on(P,JSON.stringify({ts:new Date().toISOString(),level:D(i),run_id:j,...v?{user_session_id:v.ids.session_id}:{},...p?{session_id:p}:{},kind:i,data:g})+`
8
+ `)}catch{}v?.wireTrace(i,g,p)};{let i=e.out;e.out=g=>{I("transcript",{line:g}),i(g)}}e.chat||e.out(`trace: ${L}`),e.emit?.({type:"run_start",mode:_,trace:P,...v?{session:v.ids.session_id}:{}});let Vt=Ur();if(Vt&&e.out(Vt),e.preflightTurn){let i=await e.preflightTurn();if(I("preflight",i),!i.ok)return e.out(i.message??"error: turn-endpoint preflight failed"),d({type:"error",message:i.message??"error: turn-endpoint preflight failed",code:"PREFLIGHT",final:i.final===!0}),2}let de=J(e.store);e.store.prefetch(Rr(de),{token:null});let Wt=Us(e.store,de),fe=t.sources?.length?t.sources:t.source?[t.source]:[];if(fe.length>0){if(t.resume){let i="error: --source cannot be combined with --resume (the resumed session already has its scope)";return e.out(i),d({type:"error",message:i,code:"SOURCE_WITH_RESUME",final:!0}),2}for(let i of fe){let g=de.heads.get(i);if(typeof g!="string"){let p=g===null?`error: --source ${i} was ingested but is retired \u2014 re-ingest it to extract again`:`error: --source ${i} is not an ingested source (kane-cli context list shows them)`;return e.out(p),d({type:"error",message:p,code:"SOURCE_UNKNOWN",final:!0}),2}}}let h=null,T=null,ot=[],te=[],at=0;if(t.resume){try{{let b=await ys(e.store,t.resume,de,{verb:"extract",deps:{onWarn:$=>e.out(`note: ${$}`),ownActors:ws(e.by)}});{let $=Object.keys(b.handle.state.read_basis??{});if($.length>1){let S=u.text("MULTI_SOURCE_RESUME",{sid:t.resume,sources:$.length});return e.out(S),d({type:"error",message:S,code:"MULTI_SOURCE_RESUME",final:!0}),b.handle.release(),2}T=b,I("resume_kind",{kind:b.view.pointer===null?"bare-base":b.view.pointer.at==="final"?"pause":"crash"}),at=b.view.agent?.usage_total?.credits??0,e.chat?.creditsSoFar?.(at),h={handle:b.handle,represent:b.represent,questions:b.questions,staleBasis:b.drift.map(S=>S.subject)}}}}catch(b){let $=b instanceof Error?b.message:String(b);return e.out(`error: ${$}`),b instanceof Lt||b instanceof xr?d({type:"error",message:`error: ${$}`,code:b.code,final:ds(b.code)}):e.emit?.({type:"error",message:`error: ${$}`}),b instanceof Lt?2:1}let i=T?null:Qr(h.handle.state.verb,"extract",t.resume);if(i)return e.out(i.message),d({type:"error",message:i.message,code:i.code,final:!0}),h.handle.release(),2;let g=h.handle.state.change_basis;if(g&&(de.heads.get(g.source_id)??null)!==g.new_head){let b=u.text("CHANGE_BASIS_MOVED",{source_id:g.source_id,sid:t.resume});return e.out(b),d({type:"error",message:b,code:"CHANGE_BASIS_MOVED",final:!0}),h.handle.release(),2}let p=h.handle.state;if((p.posture==="reconcile"||p.reconcile!=null)&&t.posture!=="reconcile"){let b=h.handle,$=(se,N,_e=!0)=>(e.out(se),d({type:"error",message:se,code:N,final:_e}),b.release(),2);if(_==="interactive"&&!t.plan&&e.chat)return $(u.text("POSTURE_IN_CHAT",{sid:t.resume}),"POSTURE_IN_CHAT");if(js(t,_,e))return b.release(),2;if(!g)return $(`error: session ${t.resume} is a reconcile review with no change basis to resume against`,"POSTURE_USAGE");let S=Vr(e.store,g.source_id,t.changeSince?{since:t.changeSince}:{});if(S.kind==="unchanged")return $(`error: session ${t.resume} reconciles ${g.source_id}, and no use case of it is behind its current version, which has been read`,"POSTURE_USAGE");if(S.kind==="first")return $(`error: session ${t.resume} was a reconcile of ${g.source_id}, which has no earlier version to reconcile against`,"POSTURE_USAGE");if(S.kind==="unreadable")return $(`error: session ${t.resume} reconciles ${g.source_id}, but its version ${S.version} cannot be read`,"SOURCE_UNREADABLE",!1);t={...t,posture:"reconcile",changeContext:S.changeContext}}if(T&&T.view.pointer!==null&&T.drift.length>0){if(!await e.confirmStale(`changed since the pause: ${T.drift.map($=>$.subject).join(", ")} \u2014 re-ground and continue against the current versions?`)){let $=`resume aborted: the context moved since the pause (${T.drift.map(S=>S.subject).join(", ")}) \u2014 session ${t.resume} is preserved`;return e.out($),d({type:"error",message:$,code:"RESUME_DRIFT",final:!0}),h.handle.release(),2}}else h.staleBasis.length>0&&e.out(`note: changed since the pause: ${h.staleBasis.join(", ")} \u2014 re-presented items may be stale`);let s=[...new Set([...h.handle.state.held_receipts??[],...T?.view.kane?.held_receipts??[]])];s.length>0&&(e.chat?.holdReceipt?ot=s:e={...e,initialMessage:[s.join(`
9
+
10
+ `),e.initialMessage].filter(Boolean).join(`
11
+
12
+ `)});let A=h.handle.state.conv_source||T?.base.conv_source;if(T&&A){let b=T.view.kane?T.view.kane.store_watermark:T.base.store_watermark;if(te=Lr(e.store,A,b,T.view.agent?.delta_items??[],T.view.kane?.sent_unread??[]),te.length>0){let $=ps(te.length);e.chat?e.chat.note($):e.out($)}}h.handle.state.assumed.length>0&&e.out(u.text("note.assumed_defaults",{sid:h.handle.state.sid,count:h.handle.state.assumed.length}))}let Xt=de.extractedSourceCids,xe=!!(t.force||h?.handle.state.force),oe=[],ue=[],Le=fe.length>0?new Set(fe):null,Se=e.note??e.out;for(let[i,g]of de.heads.entries())if(g!=null&&!(Le&&!Le.has(i))){if(!Le&&!h&&i.startsWith("su-conv-")){Se(u.text("note.conversation_source_skipped",{source_id:i})),ue.push({source_id:i,reason:"conversation"});continue}if(h){let p=i in h.handle.state.read_basis,s=h.handle.state.corpus_cursor.remaining.includes(i);if(!p&&!s)continue;if(s&&!xe&&Xt.has(g)){Se(u.text("note.already_extracted",{source_id:i})),ue.push({source_id:i,reason:"cached"});continue}}else if(!xe&&Xt.has(g)){Se(u.text("note.already_extracted",{source_id:i})),ue.push({source_id:i,reason:"cached"});continue}oe.push({source_id:i,cid:g})}let Vs=i=>{let g=e.pendingReconcilePlan?.(i)??null;g&&Se(u.text("note.reconcile_plan_pending",{source_id:i,pending:g.pending,path:g.path}))};for(let i of ue)i.reason==="cached"&&Vs(i.source_id);if(e.emit?.({type:"corpus",sources:oe,skipped:ue}),oe.length===0){if(h){let g=Object.keys(h.handle.state.read_basis),p=u.text("SOURCE_MISSING",{sid:h.handle.state.sid,sources:g.join(", ")||"unknown"});return e.out(p),d({type:"error",message:p,code:"SOURCE_MISSING",final:!0}),h.handle.release(),2}let i=ue.length>0&&ue.every(g=>g.reason==="conversation");return Se(Le?u.text("note.nothing_to_extract",{sources:fe.join(", "),count:fe.length}):i?u.text("note.only_conversation_sources",{}):u.text("note.all_extracted",{})),0}let Y=!t.plan&&_!=="ci",Me=e.now?.()??new Date,ke=t.resume??t.sessionId??Ls(Me,oe[0].source_id),H=null,Be=!1;Y&&!h&&(t.registerSession&&await t.registerSession(ke),H=e.store.sessions().create({sid:ke,mode:"agent",created_at:Me.toISOString(),expires_at:Ct(Me),agent_state:{schema:2,items:[],provider_state:""},pending:{questions:[],proposals:[]},assumed:[],read_basis:{[oe[0].source_id]:oe[0].cid},corpus_cursor:{remaining:oe.slice(1).map(i=>i.source_id)},conv_source:"",verb:"extract",...xe?{force:!0}:{},...t.changeContext?{change_basis:{source_id:t.changeContext.source_id,new_head:t.changeContext.new_head}}:{},...t.posture==="reconcile"?{posture:"reconcile"}:{},...v?{user_session_id:v.ids.session_id}:{}}));let ct=T?T.represent.map(i=>i.event_id).filter(i=>typeof i=="string"):[],k=h?.handle??H,zt=!1,Kt=()=>{e.store.sessions().tidy()},Jt=i=>{if(H){try{H.complete(i)}catch{H.release()}H=null,k=null,Kt()}},z=new Map;for(let i of Tt(h?.handle.state.pending.answers))z.set(i.id,i);let $e=new Set,Yt=()=>{let i=h?.handle;if($e.size===0||!i)return;let g=[...$e];$e.clear();for(let p of g)z.delete(p);i.reconcileSave({appliedEvents:g.map(p=>`resolveq:${t.resume}:${p}`),heldReceipts:i.state.held_receipts??[],pending:{...i.state.pending,answers:(i.state.pending.answers??[]).filter(p=>!g.includes(p.id))}})},He=h?h.questions.map(ms).filter(i=>!Pt(z.get(i.id),i)):[];if(h&&He.length>0&&!t.message&&!t.withSource&&!e.initialMessage&&te.length===0){e.out(`re-presenting ${He.length} unanswered question(s) from the paused session`);let i=await e.ask(He);if(!Array.isArray(i)&&"paused"in i||e.chat?.state.status==="pausing")return h.handle.release(),e.out(`session ${t.resume} paused at its question`),3;if(Array.isArray(i)){for(let g of i){let p=He.find(s=>s.id===g.id);p&&z.set(g.id,Hr(p,g))}h.handle.save({pending:{...h.handle.state.pending,answers:Tt([...z.values()])}})}}let Ee=e.by??{kind:"human",id:"owner"},F=_==="interactive"&&!t.plan&&!!e.chat,re=0,Qt=0,Fe=!1,le=0,Re=!1,dt=()=>{Fe||(Fe=!0,e.similarity&&tt(e.similarity,I),e.out(u.text("note.dedup_reduced",{})),v?.event("ASR_EMBED_DEGRADED",{}),e.emit?.({type:"degraded",reason:"embed_fallback"}))},je=null,me=()=>k??H,ut=(i,g,p)=>{let s=me();if(!s)return;let A=g.map($=>({label:"usecase",content:{title:$.title,...$.summary!==void 0?{summary:$.summary}:{},...$.risk!==void 0?{risk:$.risk}:{},derived:!0,_held:{source_id:i.source_id,source_cid:i.cid,anchor:$.cite?.anchor??"L1-L1",quote:$.cite?.quote??""}},rationale:`held (${p==="degraded"?"embed degraded \u2014 lexical dedup only":"--trust hold"}): ${i.source_id} @ ${i.cid.slice(0,19)} ${$.cite?.anchor??""}`,edges:[],tempRef:$.temp_ref})),b=s.state.pending;s.save({pending:{questions:b.questions,proposals:[...b.proposals,...A]}}),le+=A.length,je=s.state.sid,e.emit?.({type:"held",source_id:i.source_id,count:A.length,reason:p==="degraded"?"embed_degraded":"trust_hold"})},ge=[],q=i=>{ge.push(i),m.recorded()},Zt=!1,G=[...oe];try{let i=p=>{let s=k;if(!s)return;let A=s.state.ingest_schedule??[];if(!A.some(S=>S.status==="pending"))return;let b=J(e.store),$=A.map(S=>S.status!=="pending"?S:(b.heads.get(S.source_id)??null)!==S.cid?(e.out(u.text("note.landed_changed",{source_id:S.source_id})),{...S,status:"skipped",note:"head moved since landing"}):b.extractedSourceCids.has(S.cid)||G.some(N=>N.source_id===S.source_id&&N.cid===S.cid)?{...S,status:"done"}:G.some(N=>N.source_id===S.source_id)?(e.out(u.text("note.landed_older_queued",{source_id:S.source_id})),{...S,status:"skipped",note:"an older version of the source was already queued this run"}):(G.push({source_id:S.source_id,cid:S.cid}),e.out(`queued ${S.source_id} for extraction in this run (landed mid-run)`),{...S,status:"done"}));s.save({ingest_schedule:$,corpus_cursor:{remaining:G.slice(p+1).map(S=>S.source_id)}})},g=at;for(let p=0;p<G.length;i(p),p++){let s=G[p],A=J(e.store),b={current:A};e.chat?.attachOnCommitted?.(r=>{b.current=r});let $=A.getNode(s.cid),S=String($?.content.blob??""),se=Oe(e.store,A,s.cid);if(!se){e.out(u.text("BLOB_MISSING",{source_id:s.source_id})),e.emit?.({type:"error",source_id:s.source_id,message:`error: ${s.source_id}: blob ${S} missing from .context/blobs`,code:"BLOB_MISSING"}),q(s.source_id);continue}let N=A.mediaOf(s.cid),_e=N.media_type.startsWith("image/");if(!_e){let r=Er(se);if(r){e.out(u.text("note.reingest_binary",{source_id:s.source_id,kind:r})),e.emit?.({type:"source_skipped",source_id:s.source_id,reason:"binary_pre_media"});continue}}let lt=_e?`0001| (image source ${s.source_id} \u2014 the content is attached as an image; cite it with anchor img#whole)`:At(se),er=lt,tr=Or.has(N.format)?N.format:dn(s.source_id)||"md";if(!_e&&N.format==="plugin"&&N.plugin!==void 0&&Dr(s.source_id,N.format,se)>4e5){let r=lt.split(`
13
+ `).length,n=N.plugin.index!==void 0?e.store.getBlob(N.plugin.index):null,c=N.plugin.index===void 0||n===null?void 0:$r(n),f=N.plugin.index===void 0?{code:"TABLE_INDEX_MISSING",detail:"this version was stored without a unit index"}:Cs(c,N.plugin,r);if(f!==null){let B=`error: ${s.source_id} is too large to send to the agent whole (${se.byteLength} bytes of text) and cannot be sent as a table of contents: ${f.detail} \u2014 ingest a new version of ${s.source_id} with a working ${N.plugin.id} plugin (changed bytes are read and indexed afresh); the same bytes again keep this index [${f.code}]`;e.out(B),e.emit?.({type:"error",source_id:s.source_id,message:B,code:f.code}),q(s.source_id);continue}let O=new Set(c.units.map(B=>B.id)),x=Tr(B=>e.store.getBlob(B),N.plugin);N.plugin.notes!==void 0&&x===null&&e.out(`note: the notes of ${s.source_id} could not be read and were left out of what the agent is sent`);let E=Pr(x,"extract").filter(B=>(B.units??[]).every(he=>O.has(he)));er=As({sourceId:s.source_id,versionCid:s.cid,index:c,lines:r,notes:E}).text,tr=st}let Ge=(r,n)=>{let c=new Map;c.set(s.source_id,{media:N,numberedText:lt});for(let f of n.sources??[]){if(c.has(f.source_id))continue;let O=Oe(e.store,r,f.source_cid);if(!O)continue;let x=r.mediaOf(f.source_cid),E=x.media_type.startsWith("image/")?`0001| (image source ${f.source_id} \u2014 the content is attached as an image; cite it with anchor img#whole)`:At(O);c.set(f.source_id,{media:x,numberedText:E})}return c},Ws=it(e.now?.()??new Date),ne=ln(e.store,Ws,s.source_id),K=!!(h&&s.source_id in h.handle.state.read_basis);if(T&&K&&(T.spawnConfig.source.kind===st||T.spawnConfig.source.kind==="plugin")&&T.spawnConfig.source.source_cid!==s.cid){let r=`error: ${s.source_id} has a newer version (${s.cid.slice(0,19)}) than the one this session began on (${T.spawnConfig.source.source_cid.slice(0,19)}); what the session holds is the older version's, and a resumed run would read the newer one \u2014 this session cannot go on; start a new extract of ${s.source_id}: kane-cli context extract --source ${s.source_id} [PLUGIN_VERSION_MOVED]`;e.out(r),e.emit?.({type:"error",source_id:s.source_id,message:r,code:"PLUGIN_VERSION_MOVED"}),q(s.source_id);continue}let Ce=k?ke:Ls(e.now?.()??new Date,s.source_id);!k&&Y&&await t.remainderSession?.(Ce);let mt=G.slice(p+1).map(r=>r.source_id);k&&Y&&!K&&k.save({read_basis:{[s.source_id]:s.cid},corpus_cursor:{remaining:mt}});let ae="";if(F){let r=Mr({store:e.store,graph:J(e.store),sessionStamp:Ce,by:Ee});r.errors===null||r.errors[0]?.code==="CONV_SOURCE_EXISTS"?(ae=r.sourceId,e.chat.attachConversationSource?.(ae),b.current=J(e.store)):e.out(`warning: notes you add in chat can't be saved to the context this session (${r.errors[0]?.detail})`)}let rr={type:"run_config",version:1,session_id:Ce,mode:_,source:{source_id:s.source_id,source_cid:s.cid,kind:tr,numbered_text:er,...(()=>{let r=un(N,e.store);return r?{images:r}:{}})()},existing_use_cases:A.byLabel(be.USECASE).filter(({cid:r})=>A.trust.get(r)!=="archived"&&!A.superseded.has(r)).map(({cid:r,content:n})=>({id:r,title:String(n.title??""),summary:String(n.summary??"")})),read_basis:b.current.latestHash,max_free_text_rounds:Zr,graph_reads:!0,verb:"extract",...Wt!==void 0?{style_note_digest:Wt}:{},...t.changeContext&&t.changeContext.source_id===s.source_id?{change_context:t.changeContext}:{},topology:ls(),...F?{chat:!0}:{},..._e?{image_sources:[{source_id:s.source_id,source_cid:s.cid,media_type:N.media_type,blob_ref:{path:e.store.blobPath(S),cid:S}}]}:{},...h&&!T&&s.source_id in h.handle.state.read_basis?{resume:{agent_state:h.handle.state.agent_state}}:{},...Y&&k?{checkpoints:!0}:{}},R=T&&K?{...T.spawnConfig,mode:_}:rr;if(Y&&k&&!zt){zt=!0;let{resume:r,...n}=rr;e.store.sessions().initCheckpoints(ke,{schema:Cr,kind:"base",sid:ke,verb:"extract",mode:_,created_at:Me.toISOString(),run_config:n,conv_source:ae||k.state.conv_source||"",store_watermark:e.store.serialize(e.store.head())})}let sr=T&&K?0:k?.state.checkpoint?.seq??0,Ae={current:null};if(R.resume&&"schema"in R.resume){let r=R.resume.binding?.template_version;typeof r=="string"&&(Ae.current=r)}let pe=null,ht=Y&&k?vs({store:e.store,handle:k,seqBase:()=>sr,awaits:(r,n)=>{let c=fs(R.session_id,ae||null,r,n);return pe=c?.event_id??null,c?.event_prefix&&e.chat?.opIdPrefix?.(c.event_prefix.slice(0,-1)),c},peekHeldReceipts:()=>e.chat?.peekHeldReceipts?.()??[],readBasis:()=>({[s.source_id]:s.cid}),corpusCursor:()=>({remaining:mt}),onSoftCap:r=>e.out(r),onStat:r=>I("ckpt_stat",r,R.session_id),...e.now?{now:e.now}:{}}):void 0,ve=ht?{...ht,persist:(r,n)=>{let c=r.binding?.template_version;typeof c=="string"&&c&&(Ae.current=c);let f=ht.persist(r,n);return Yt(),f}}:void 0;F||e.out(h&&s.source_id in h.handle.state.read_basis?`resuming: ${s.source_id} (session ${t.resume})`:`reading ${s.source_id} (source ${p+1} of ${G.length})`),e.emit?.({type:"source_start",source_id:s.source_id,cid:s.cid,index:p+1,total:G.length,resumed:!!(h&&s.source_id in h.handle.state.read_basis)});let ft=u.sourceName?.(s.source_id)??qs(s),nr=u.header?.("header.extract",{source:ft,sources:G.length,index:p+1});e.chat?.ledger?.(nr?{kind:"header",...nr,source:{index:p+1,of:G.length,name:ft}}:{kind:"banner",text:hn(s,p+1,G.length)});let qe=T?.view.agent?.delta_items??[],ce=K?T?.view.kane?.awaits:void 0,ir=gs(e.store,h?.handle.state.applied_events??[],ce),Xs=!!ce?.event_id&&ir&&!!as(qe)?.name.startsWith("finalize");if(K&&h&&!F&&t.posture!=="reconcile"&&Xs&&te.length===0){i(p),h.handle.complete({ended:"complete"}),e.out(`session ${t.resume} complete`),e.emit?.({type:"session_complete",sid:t.resume,source_id:s.source_id}),h=null,k=null;continue}let or=!!(ce&&!ir&&Nt(qe));or&&ce&&(e.out(_s(ce.call)),R.resend_last_output=!0,pe=ce.event_id??null,ce.event_prefix&&e.chat?.opIdPrefix?.(ce.event_prefix.slice(0,-1))),K&&(t.message||e.initialMessage||te.length>0)&&(R.resend_open_ask=!1);let ar=K&&!t.message&&!e.initialMessage&&!or&&te.length===0,cr=ar&&Nt(qe),dr=ar&&z.size===0&&cs(qe);e.chat?.setWorking?.(`Reading ${ft}\u2026`);let gt=new Map;I("spawn",{source_id:s.source_id,source_cid:s.cid,resume:!!h,chat:F},R.session_id);let _t=!1,ur=!1,pt=!1,vt=0,lr=r=>us({source:r.source,use_cases:r.use_cases}),wt=new Map;if(K&&T)try{let r=e.store.parse(T.base.store_watermark),n=r!==null&&e.store.resolveToken(r)!==null?r:null;for(let c of e.store.recordsSince(n)){if(c.sid!==R.session_id||c.proposal_id===null)continue;let f=e.store.proposals().read(c.proposal_id);if(!f)continue;wt.set(lr(f),c);let O=F?Hs(f,J(e.store)):[];O.length>0&&e.chat?.registerAliases?.(O)}}catch{}let mr=null,hr=r=>{let n=!e.nested&&vt<Fs;if(e.emit?.({type:"validate_failed",source_id:s.source_id,codes:r.map(c=>c.split(":")[0]),repairing:n}),e.nested)return e.chat?.ledger?.({kind:"commit",ok:!1,line:u.text("chat.proposal_refused",{}),warnings:r,refused:r.map(c=>({code:c.split(":")[0]}))}),ur=!0,null;if(!n){let c=`error: the agent's proposal for ${s.source_id} still failed validation after ${Fs} repairs (${r.join("; ")}) \u2014 the session ended`;return e.out(c),e.emit?.({type:"error",source_id:s.source_id,message:c,code:"REPAIR_LIMIT"}),mr=c,c}return vt+=1,e.chat.repair(`[auto-repair] the proposal failed validation: ${r.join("; ")} \u2014 please re-finalize with these fixed.`),null},fr=async r=>{if("refused"in r)return I("kane_validate",{refused:r.refused},R.session_id),hr([r.refused]);let n=r,c=pe;pe=null;let f=lr(n),O=wt.get(f);if(O){c&&me()?.markApplied([c]),_t=!0;let C=xs(J(e.store),O);return e.chat?.ledger?.({kind:"commit",ok:!0,line:Ss("proposal",C)}),$s(C)&&e.chat?.holdReceipt?.(ks(C)),null}let x=J(e.store),E=De(n,Ge(x,n),x);if(I("kane_validate",{errors:E.map(C=>C.code)},R.session_id),E.length>0)return hr(E.map(C=>`${C.code}: ${C.detail}`));let B=J(e.store),he=Ms(n,B);e.store.proposals().write(ne,n);let Ks=new Map(n.use_cases.map(C=>[C.temp_ref,{resolution:"skipped"}])),Js=Gt(e.store,R.session_id,e.credentials,{reservedEventIds:ct,probe:e.probe,runAuth:e.auth,similarity:e.similarity}),Ys={...Dt(n,B),...c?{eventIds:[c]}:{}},Q=await et(Js,Ys,C=>{if(C.degradedProbe&&me()!==null&&n.use_cases.some(Je=>Je.matches_existing==null))return{result:{degradedHold:!0},record:null};let X=It({store:e.store,graph:C.graph,scope:C.scope,proposal:n,proposalId:ne,verdicts:Ks,by:{kind:"ai",id:"extract-agent"},autoName:!0,allowStaleBasis:!0,eventIds:C.eventIds("extract",1),...Y?{sid:C.sid}:{},probeHits:C.probeHits,...e.matchUnreviewed?{matchUnreviewed:!0}:{}});return X.errors!==null?{errors:X.errors}:{result:X,record:X.record}});e.similarity&&tt(e.similarity,I);let $t=Q.ok&&"result"in Q?Q.result:null;if($t!==null&&"degradedHold"in $t)return dt(),ut(s,n.use_cases,"degraded"),c&&me()?.markApplied([c]),pt=!0,e.chat.ledger?.({kind:"commit",ok:!1,line:u.text("chat.held_degraded",{held:n.use_cases.length}),held:!0}),null;let Z=$t??{record:null,errors:Q.ok?null:Q.kind==="validation"?Q.errors:[{code:Q.kind==="contended"?Q.err.code:"UNSETTLED",detail:Q.kind==="contended"?`held by ${Q.err.holder?.owner_sid??"another session"}`:"concurrent activity kept moving the store"}]};if(Z.errors)return e.chat.ledger?.({kind:"commit",ok:!1,line:u.text("chat.commit_failed",{}),warnings:Z.errors.map(C=>`${C.code}: ${C.detail}`),refused:Z.errors.map(C=>({code:C.code}))}),null;_t=!0,vt=0,Z.record&&wt.set(f,Z.record),Z.record?.event_ids?.length&&k?.markApplied(Z.record.event_ids);{let C=Z.record.review.filter(X=>X.kind==="pending_update");C.length>0&&(F||e.out(u.text("chat.updates_held",{count:C.length})),e.emit?.({type:"update_held",count:C.length,targets:C.map(X=>X.id)}),e.chat?.ledger?.({kind:"commit",ok:!0,line:u.text("chat.updates_held",{count:C.length}),held:!0,heldChanges:C.length}))}let ze=Z.record.nodes.length;re+=ze;let Ke=n.use_cases.length-ze,Et=0;{let C=J(e.store),X=gn(Hs(n,C),e.addedBefore?.()??[],Ke);X.marked.length>0&&e.chat.registerAliases?.(X.marked),Et=X.own,b.current=C;let Je=Pe=>{for(let[Qs,yr]of C.names)if(yr===Pe&&!C.superseded.has(yr))return Qs},wr=Br({verb:"extract",commitN:1,phase:"proposal",committed:Z.record.nodes.map(Pe=>({cid:Pe.cid,...Je(Pe.cid)?{logical_id:Je(Pe.cid)}:{}})),reused:Ke},C);e.emit?.(wr.event),e.chat.holdReceipt?.(wr.text)}return I("commit",{derived:ze,evidence_matched:Ke,chat:!0},R.session_id),e.chat.ledger?.({kind:"commit",ok:!0,line:u.text("chat.added_use_cases",{minted:ze+Et,matched:Ke-Et})}),null},we=!!(h&&s.source_id in h.handle.state.read_basis);we&&z.size>0&&e.chat?.answersHeld([...z.values()]);let U=we&&z.size>0?{...e,ask:async r=>{if(r.every(n=>Pt(z.get(n.id),n)&&!$e.has(n.id))){let n=r.map(c=>Fr(z.get(c.id)));for(let c of r)$e.add(c.id);return e.out(`answered ${r.length} re-asked question(s) from the held resume answers`),n}return e.ask(r)}}:e;we&&t.message&&(U={...U,initialMessage:t.message}),we&&ot.length>0&&(U={...U,heldAtSpawn:ot}),we&&te.length>0&&(U={...U,redeliverAtSpawn:te}),g>0&&(U={...U,creditsBefore:g}),(cr||dr)&&(U={...U,readyAtSpawn:!0,...cr&&!dr?{checkInAtSpawn:!0}:{}}),U={...U,onEmbedDegraded:dt};let ye,yt;if(k){let r=k,n=U.ask,c=ns({store:e.store,credentials:e.credentials,onRefusal:e.onIngestRefusal,handle:r,note:f=>e.chat?e.chat.note(f):e.out(f),schedule:t.trust!=="hold",...t.trust==="hold"?{scheduleRefused:u.text("note.schedule_refused",{})}:{},graphSlot:b,...e.now?{now:e.now}:{}});if(U={...U,ask:async f=>{let O=await n(f);if(Array.isArray(O)){let x=O.filter(E=>{if(E.free_text==null||E.free_text.trim()==="")return!1;let B=f.find(he=>he.id===E.id);return E.selected_index!=null&&B?.options[E.selected_index]?.input===!0}).map(E=>E.free_text.trim());if(x.length>0){let E=r.state.ingest_registry;for(let B of x)E=rt(E,B,e.now?.()??new Date);r.save({ingest_registry:E})}}return O},ingest:c},we&&t.withSource){let f=(r.state.pending?.proposals??[]).filter(E=>E.content?._held!=null).length;if(t.trust==="hold"||f>0){let E=f>0?`error: --with-source can't add a source to a session holding ${f} item(s) for review \u2014 resume without --with-source to finish the review first, then land it with kane-cli context ingest [HOLD_MULTI_SOURCE]`:"error: --with-source is not available with --trust hold \u2014 held work from a multi-source run can't be resumed yet; drop --trust hold, or land the source separately with kane-cli context ingest [HOLD_MULTI_SOURCE]";return e.out(E),d({type:"error",code:"HOLD_MULTI_SOURCE",message:E,final:!0}),2}let O=t.withSource;r.save({ingest_registry:rt(r.state.ingest_registry,O,e.now?.()??new Date)});let x=await c({id:`withsource-${r.state.sid}`,ref:O,purpose:null});if(!x.ok)return e.out(`error: --with-source: ${x.error.message}`),d({type:"error",code:x.error.code,message:`--with-source: ${x.error.message}`,final:!1}),2;U={...U,pendingDeferral:{ingested:{source_id:x.result.source_id,cid:x.result.cid}}}}yt=()=>{if(!e.chat?.attachIngest)return;let f=e.chat;ye=f.attachIngest(async O=>{try{r.save({ingest_registry:rt(r.state.ingest_registry,O,e.now?.()??new Date)});let x=await c({id:`attach-${r.state.sid}-${(r.state.ingest_registry??[]).length}`,ref:O,purpose:null});return x.ok?(f.deferBatch({source_id:x.result.source_id,cid:x.result.cid}),{ok:!0}):{ok:!1,error:x.error.message}}catch(x){return{ok:!1,error:x instanceof Error?x.message:String(x)}}})},yt()}let w;try{w=await qt(R,{...U,graphSlot:b,...ve?{checkpoint:ve}:{}},gt,A,I,F?fr:void 0,()=>Ae.current),g=w.creditsTotal??g}catch(r){if(r instanceof Ze)return ye?.(),e.chat?.setWorking?.(null),e.out(`error: ${r.message}`),e.emit?.({type:"error",code:"PAIR_MISMATCH",message:r.message}),2;throw r}if(ye?.(),e.chat?.setWorking?.(null),w.errorCode==="binding_mismatch"&&T&&K){let r=await e.ask([{id:"binding-mismatch",text:"this session's saved conversation is no longer accepted by the service \u2014 start the conversation fresh (committed work is kept), or stop and keep the session?",risk:"high",rationale:"the service refused the saved conversation on the first turn after resume",options:[{label:"start fresh",detail:"continue with a fresh conversation \u2014 earlier answers may be re-asked"},{label:"stop",detail:"stop here; the session stays resumable"}],recommended_index:1,allow_free_text:!1}]);if((Array.isArray(r)?r.find(f=>f.id==="binding-mismatch"):void 0)?.selected_index!==0){let f=`resume abandoned: binding mismatch on session ${Ce} \u2014 the session is preserved`;return e.out(f),e.emit?.({type:"error",message:f,code:"BINDING_MISMATCH"}),2}I("binding_migrate",{sid:Ce},R.session_id),yt?.();let c=R.resume&&"schema"in R.resume?{...R.resume,binding:{}}:void 0;try{w=await qt({...R,...c?{resume:c}:{}},{...U,graphSlot:b,...ve?{checkpoint:ve}:{}},gt,A,I,F?fr:void 0,()=>Ae.current),g=w.creditsTotal??g}catch(f){if(f instanceof Ze)return ye?.(),e.chat?.setWorking?.(null),e.out(`error: ${f.message}`),e.emit?.({type:"error",code:"PAIR_MISMATCH",message:f.message}),2;throw ye?.(),f}ye?.(),e.chat?.setWorking?.(null)}if(w.error&&w.error===mr){q(s.source_id);continue}if(w.error){let r=w.error.startsWith("proposal failed validation after repair:");r&&I("agent_error_detail",{error:w.error},R.session_id);let n=r?u.text("AGENT_FAILED.invalid_proposal",{source_id:s.source_id}):`error: agent failed for ${s.source_id}: ${w.error}`;e.out(n),e.emit?.({type:"error",source_id:s.source_id,message:n,code:w.errorCode??"AGENT_FAILED"}),q(s.source_id);continue}if(w.noDefault){let r=es(w.noDefault,s.source_id);e.out(r),e.emit?.({type:"error",source_id:s.source_id,message:r,code:"NO_DEFAULT_ANSWER",questions:w.noDefault.map(n=>n.id)}),q(s.source_id);continue}if(w.highRisk)return e.out(`error: ${w.highRisk.length} high-risk decision${w.highRisk.length===1?"":"s"} need a human \u2014 ci mode won't guess. Re-run with --mode agent to pause for review.`),e.emit?.({type:"error",source_id:s.source_id,message:`error: high-risk question(s) in ci mode (fail-closed): ${w.highRisk.map(r=>r.id).join(", ")}`,code:"HIGH_RISK_CI"}),1;if(w.paused?.cause&&!Y){let r=`error: agent failed for ${s.source_id}: the model service did not answer (${w.paused.cause.message})`;e.out(r),e.emit?.({type:"error",source_id:s.source_id,...Ut(w.paused.cause),message:r}),q(s.source_id);continue}if(w.paused){let r=G.slice(p+1).map(E=>E.source_id),n=h?.handle??H,c=n??e.store.sessions().create({sid:R.session_id,mode:"agent",created_at:(e.now?.()??new Date).toISOString(),expires_at:Ct(e.now?.()??new Date),agent_state:w.paused.agent_state,pending:{questions:[],proposals:[]},assumed:[],read_basis:{[s.source_id]:s.cid},corpus_cursor:{remaining:r},conv_source:ae,verb:"extract",...xe?{force:!0}:{},...t.changeContext?{change_basis:{source_id:t.changeContext.source_id,new_head:t.changeContext.new_head}}:{},...t.posture==="reconcile"?{posture:"reconcile"}:{},...v?{user_session_id:v.ids.session_id}:{}});Be=!0;try{ae&&c.state.conv_source!==ae&&c.save({conv_source:ae});let E=e.chat?.drainHeldReceipts?.()??[];(E.length>0||(c.state.held_receipts?.length??0)>0)&&c.save({held_receipts:E}),n&&c.save({read_basis:{[s.source_id]:s.cid},corpus_cursor:{remaining:r},...xe&&!c.state.force?{force:!0}:{},...v&&c.state.user_session_id!==v.ids.session_id?{user_session_id:v.ids.session_id}:{}}),hs(c,w.paused,Yt)}catch(E){let B=c.state.checkpoint,he=`error: couldn't persist the pause for session ${c.state.sid}`+(B?` \u2014 last durable checkpoint: seq ${B.seq} @ ${B.ts}`:" \u2014 no durable checkpoint exists")+` (${E instanceof Error?E.message:String(E)})`;return e.out(he),e.emit?.({type:"error",message:he,code:"PAUSE_PERSIST_FAILED",sid:c.state.sid}),1}I("session_paused",{sid:c.state.sid},R.session_id);let f={verb:"extract",sid:c.state.sid,mode:_},O=u.command("next.resume_session",f),x=w.paused.cause;if(F||e.out(x?u.text("note.model_unavailable_kept",{...f,detail:x.message}):u.text("note.paused",f)),e.emit?.({type:"session_paused",sid:c.state.sid,source_id:s.source_id,mode:_,...O!==null?{resume:O}:{},expires_at:Ye(e.store.sessions(),c.state),pending_questions:w.paused.pending.questions,...x?{cause:Ut(x)}:{}}),F){let E=e.chat?.state.credits?.total;e.onSummary?.({state:"paused",reason:x?"the model service did not answer":"ctrl+c",facts:[...x?[x.message]:[],`session ${c.state.sid} saved`+(re>0?` \u2014 ${re} use-case${re===1?"":"s"} committed so far`:""),...Ye(e.store.sessions(),c.state)?[`expires: ${c.state.expires_at}`]:[],...E!==void 0?[`credits used: ${E.toFixed(1)}`]:[]],...Rt(u,f),tracePath:L})}return 3}if(w.crashed){let r=k?.state.checkpoint;if(k&&r){let n={verb:"extract",sid:k.state.sid,mode:_},c=u.command("next.resume_session",n);try{k.save({read_basis:{[s.source_id]:s.cid},corpus_cursor:{remaining:mt}})}catch{}if(I("agent_crashed_resumable",{sid:k.state.sid,seq:r.seq},R.session_id),F||e.out(u.text("note.crashed",{...n,seq:r.seq})),e.emit?.({type:"session_paused",sid:k.state.sid,source_id:s.source_id,mode:_,...c!==null?{resume:c}:{},expires_at:Ye(e.store.sessions(),k.state),crashed:!0}),F){let f=e.chat?.state.credits?.total;e.onSummary?.({state:"crashed",facts:[`agent crashed \u2014 session ${k.state.sid} is resumable at checkpoint seq ${r.seq}`,"at most the in-flight turn was lost",...f!==void 0?[`credits used: ${f.toFixed(1)}`]:[]],...Rt(u,n),tracePath:L})}return Be=!0,k.release(),3}e.out(`error: agent crashed for ${s.source_id} with no durable checkpoint`),e.emit?.({type:"error",source_id:s.source_id,message:`error: agent crashed for ${s.source_id} with no durable checkpoint`,code:"AGENT_CRASHED"}),q(s.source_id);continue}if(F){if(Qt+=w.assumedDefaults??0,w.error||(w.sentComplete||(l=!0),ur))return 1;if(!_t&&!pt){let r=G.length-p-1,n=u.text("note.nothing_committed",{source_id:s.source_id,remaining:r});F||e.out(n);let c=e.chat?.state?.credits?.total;e.onSummary?.({state:"complete",facts:[n,...re>0?[`${re} use-case${re===1?"":"s"} saved earlier in this run`]:[],...c!==void 0?[`credits used: ${c.toFixed(1)}`]:[]],tracePath:L});{let f=(k?.state.ingest_schedule??[]).filter(O=>O.status==="pending");f.length>0&&e.out(u.text("note.landed_not_extracted",{count:f.length,sources:f.map(O=>O.source_id).join(", ")}))}return h&&s.source_id in h.handle.state.read_basis&&(h.handle.complete(y()),h=null,k=null),Jt(y()),0}h&&s.source_id in h.handle.state.read_basis&&!pt&&(i(p),h.handle.complete(y()),h=null,k=null);continue}if(!w.proposal){e.out(`error: agent ended without a proposal for ${s.source_id}`),e.emit?.({type:"error",source_id:s.source_id,message:`error: agent ended without a proposal for ${s.source_id}`,code:"NO_PROPOSAL"}),q(s.source_id);continue}let W=De(w.proposal,Ge(A,w.proposal),A);if(I("kane_validate",{errors:W.map(r=>r.code)},R.session_id),W.length>0&&fn(w.proposal,W,r=>e.out(r))&&(I("criteria_dropped",{source_id:s.source_id},R.session_id),W=De(w.proposal,Ge(A,w.proposal),A)),W.length>0){e.out("the agent's proposal didn't validate \u2014 retrying once"),e.emit?.({type:"validate_failed",source_id:s.source_id,codes:W.map(n=>n.code),repairing:!0}),I("repair_respawn",{source_id:s.source_id},R.session_id),T&&K||(sr=k?.state.checkpoint?.seq??0);let r=w.creditsTotal??U.creditsBefore;try{w=await qt(R,{...U,...r!==void 0&&r>0?{creditsBefore:r}:{},graphSlot:b,...ve?{checkpoint:ve}:{}},gt,A,I,void 0,()=>Ae.current),g=w.creditsTotal??g}catch(n){if(n instanceof Ze)return e.out(`error: ${n.message}`),e.emit?.({type:"error",code:"PAIR_MISMATCH",message:n.message}),2;throw n}if(w.error||!w.proposal){e.out(`error: repair run failed for ${s.source_id}`),e.emit?.({type:"error",source_id:s.source_id,message:`error: repair run failed for ${s.source_id}`,code:"REPAIR_FAILED"}),q(s.source_id);continue}if(W=De(w.proposal,Ge(A,w.proposal),A),W.length>0){I("validation_details",{errors:W.map(n=>({code:n.code,detail:n.detail}))},R.session_id),e.out(`\u2717 validation failed \u2014 ${W.map(n=>n.code).join(", ")} (details: ${L})`),e.emit?.({type:"validate_failed",source_id:s.source_id,codes:W.map(n=>n.code),repairing:!1}),e.emit?.({type:"error",source_id:s.source_id,message:`error: proposal failed validation after repair (${W.map(n=>n.code).join(", ")})`,code:"PROPOSAL_INVALID"}),q(s.source_id);continue}}let M=w.proposal,Ve=Ms(M,A);if(e.store.proposals().write(ne,M),t.plan){e.out(`plan: ${M.use_cases.length} use-case(s) proposed from ${s.source_id} (nothing committed)`);for(let r of M.use_cases){let n=Ve.get(r.temp_ref),c=n?n.archived?` \u2248 matches ARCHIVED ${n.cid.slice(0,19)}${n.reason?` \u2014 previously rejected: "${n.reason}"`:" \u2014 previously rejected"}`:` \u2248 matches ${n.cid.slice(0,19)}`:"";e.out(` [${r.risk}] ${r.title} \u2014 cite ${r.cite.anchor}${c}`)}e.emit?.({type:"plan",source_id:s.source_id,use_cases:M.use_cases.map(r=>{let n=Ve.get(r.temp_ref);return{risk:r.risk,title:r.title,anchor:r.cite.anchor,...n?{match:n.cid,match_archived:!!n.archived}:{}}})}),w.assumedDefaults&&e.out(`assumed: ${w.assumedDefaults} default(s) auto-taken (assumed)`);continue}for(let r of M.use_cases){if(!r.conflicts_with?.length)continue;let n=r.conflicts_with.filter(f=>A.resolve(f)!==null),c=r.conflicts_with.filter(f=>A.resolve(f)===null);c.length>0&&(e.out(`note: ${r.temp_ref}: dropped unresolvable conflict hint(s): ${c.join(", ")}`),r.conflicts_with=n.length>0?n:void 0)}I("review_start",{use_cases:M.use_cases.length,flags:Ve.size},R.session_id);let We=await e.review(M.use_cases,Ve);if(I("review_verdicts",[...We.entries()].map(([r,n])=>({ref:r,resolution:n.resolution})),R.session_id),e.store.proposals().writeReview(ne,M.use_cases.map(r=>{let n=We.get(r.temp_ref)??{resolution:"skipped"};return{id:r.temp_ref,kind:"review-item",resolution:n.resolution,edit:n.edit??null,reason:n.reason??null,...n.supersedeTarget?{supersede_target:n.supersedeTarget}:{},by:Ee}})),t.posture==="reconcile"){let r=qr(M),n=me(),c=r.adds.length+r.updates.length+r.archives.length,f=n?.state.reconcile?.proposal_id,O={proposal_id:ne,verdicts:{},...f&&f!==ne?{replaces:f}:{}};n&&c>0&&n.save({reconcile:{...O,pending:!0}});let x=await Jr({store:e.store,ctx:Gt(e.store,R.session_id,e.credentials,{reservedEventIds:ct,probe:e.probe,runAuth:e.auth,similarity:e.similarity}),graph:A,sid:R.session_id,proposalId:ne,proposal:M,by:Ee,durable:Y,...e.matchUnreviewed?{matchUnreviewed:!0}:{}});x.ok||e.out("note: the unchanged-match evidence attach did not land this run \u2014 the held changeset is unaffected; re-run reconcile to refresh it"),x.skippedAttach>0&&e.out(u.text("note.evidence_not_attached",{count:x.skippedAttach})),n&&c>0&&(x.ok&&n.save({reconcile:O}),le+=c,Re=!0,je=n.state.sid,e.out(`held: ${c} change(s) from ${s.source_id} await your verdicts \u2014 nothing from the changeset committed`),e.emit?.({type:"held",source_id:s.source_id,count:c,reason:"reconcile"})),c===0&&h&&!h.handle.state.reconcile&&s.source_id in h.handle.state.read_basis&&(i(p),h.handle.complete({ended:"complete"}),e.out(`session ${t.resume} complete`),e.emit?.({type:"session_complete",sid:t.resume,source_id:s.source_id}),h=null,k=null);continue}if((Fe||t.trust==="hold")&&me()&&M.use_cases.some(r=>r.matches_existing==null)){ut(s,M.use_cases,Fe?"degraded":"trust_hold");continue}let gr=Gt(e.store,R.session_id,e.credentials,{reservedEventIds:ct,probe:e.probe,runAuth:e.auth,similarity:e.similarity}),_r=r=>{if(r.degradedProbe&&me()!==null&&M.use_cases.some(c=>c.matches_existing==null))return{result:{degradedHold:!0},record:null};let n=It({store:e.store,graph:r.graph,scope:r.scope,proposal:M,proposalId:ne,verdicts:We,by:Ee,autoName:!0,allowStaleBasis:!0,eventIds:r.eventIds("extract",1),...Y?{sid:r.sid}:{},probeHits:r.probeHits,...e.matchUnreviewed?{matchUnreviewed:!0}:{}});return n.errors!==null?{errors:n.errors}:{result:n,record:n.record}},pr=pe;pe=null;let vr={...Dt(M,A),...pr?{eventIds:[pr]}:{}},V=await et(gr,vr,_r);if(!V.ok&&V.kind==="drifted"){if(!await e.confirmStale(`the context changed while you reviewed (${V.asks.map(n=>n.detail).join("; ")}) \u2014 commit against the new head anyway?`)){e.out("aborted: proposal not committed"),e.emit?.({type:"error",source_id:s.source_id,message:"aborted: proposal not committed",code:"STALE_BASIS"}),q(s.source_id);continue}V=await et(gr,{...vr,sourcePins:[]},_r)}e.similarity&&tt(e.similarity,I);let bt=V.ok&&"result"in V?V.result:null;if(bt!==null&&"degradedHold"in bt){dt(),ut(s,M.use_cases,"degraded");continue}let Ie=bt??(V.ok?{record:null,errors:null}:{record:null,errors:V.kind==="validation"?V.errors:V.kind==="contended"?[{code:V.err.code,detail:`a use-case this proposal touches is held by ${V.err.holder?.owner_sid??"another session"} \u2014 try again when it frees`}]:[{code:"UNSETTLED",detail:"concurrent activity kept moving the store \u2014 retry when quieter"}]});if(Ie.errors){I("commit_error_details",{errors:Ie.errors.map(r=>({code:r.code,detail:r.detail}))},R.session_id),e.out(`\u2717 commit failed \u2014 ${Ie.errors.map(r=>r.code).join(", ")} (details: ${L})`),e.emit?.({type:"error",source_id:s.source_id,message:`error: commit failed: ${Ie.errors.map(r=>`${r.code}: ${r.detail}`).join("; ")}`,code:"COMMIT_FAILED"}),q(s.source_id);continue}let zs=new Date().toISOString();for(let r of M.use_cases){let n=We.get(r.temp_ref)??{resolution:"skipped"};for(let c of Ar({ts:zs,command:"context extract",id:r.temp_ref,by:Ee},n.resolution))e.store.signals().append(c)}let ie=Ie.record;ie.event_ids?.length&&k?.markApplied(ie.event_ids);let xt=new Map(ie.review.map(r=>[r.id,r.resolution])),St=[...xt.values()].filter(r=>r==="approved"||r==="edited").length,Xe=[...xt.values()].filter(r=>r==="rejected").length,Te=ie.nodes.filter(r=>!xt.has(r.cid)).length,kt=ie.supersessions.filter(r=>r.kind==="node"&&r.new!==r.old).length;I("commit",{trusted:St,derived:Te,archived:Xe},R.session_id),e.out(`saved ${St+Te} use-case(s)`+(Te>0?` \xB7 ${Te} awaiting review`:"")+(Xe>0?` \xB7 ${Xe} archived`:"")+(kt>0?` \xB7 ${kt} superseded`:""));{let r=ie.review.filter(n=>n.kind==="pending_update");r.length>0&&(e.out(`${r.length} update(s) held for review`),e.emit?.({type:"update_held",count:r.length,targets:r.map(n=>n.id)}))}w.assumedDefaults&&e.out(`assumed: ${w.assumedDefaults} default(s) auto-taken (assumed)`),e.emit?.({type:"commit",source_id:s.source_id,proposal_id:ne,trusted:St,derived:Te,archived:Xe,superseded:kt,assumed:w.assumedDefaults??0,evidence_matched:Math.max(0,M.use_cases.length-ie.nodes.length),minted:ie.nodes.map(r=>{let n=ie.names?.find(c=>c.cid===r.cid)?.slug;return{cid:r.cid,...n?{logical_id:n}:{}}})}),h&&s.source_id in h.handle.state.read_basis&&(i(p),h.handle.complete({ended:"complete"}),e.out(`session ${t.resume} complete`),e.emit?.({type:"session_complete",sid:t.resume,source_id:s.source_id}),v?.event("ASR_SESSION_COMPLETE",{}),h=null,k=null)}if(k){let p=k.state.ingest_schedule??[];p.some(s=>s.status==="pending")&&k.save({ingest_schedule:p.map(s=>s.status==="pending"?{...s,status:"skipped",note:u.text("note.not_reached",{})}:s)})}Zt=!0}finally{if(h?.handle.release(),H&&!Be&&!Zt){let i=H.state.checkpoint;if(i)e.out(u.text("note.session_kept",{verb:"extract",sid:H.state.sid,mode:_,seq:i.seq,ts:i.ts})),H.release();else{try{H.complete(a())}catch{H.release()}Kt()}H=null}}if(F){let i=e.chat?.state.ledger.filter(s=>s.kind==="answer"&&s.receipt.form==="assumed").length??0,g=Qt+i,p=e.chat?.state.credits?.total;e.onSummary?.({state:"complete",facts:[`saved ${re} use-case${re===1?"":"s"} across ${G.length} source${G.length===1?"":"s"}`,...g>0?[`${g} assumed default(s)`]:[],...p!==void 0?[`credits used: ${p.toFixed(1)}`]:[]],tracePath:L})}if(t.plan||bs(e.store),le>0&&(H||je)){Be=!0;let i=H?.state.sid??je,g=Re?u.command("next.review_held_changeset",{}):u.command("next.resume_session",{verb:"extract",sid:i,mode:_});!F&&!(Re&&e.reviewsHeld)&&e.out(Re?u.text("note.changeset_held_for_review",{sid:i,held:le}):u.text("note.held_for_review",{sid:i,mode:_,held:le}));let p=Re&&_!=="interactive",s=p?u.command("next.show_session",{sid:i}):null;if(e.emit?.({type:"session_paused",sid:i,...p?g!==null?{held_review:{cmd:g,needs:"tty"}}:{}:g!==null?{resume:g}:{},...s!==null?{next:[{cmd:s,why:"shows the session and the changeset it holds; its verdicts are given in a terminal",title:"Show the held session"}]}:{},held:le}),F){let A=e.chat?.state.credits?.total;e.onSummary?.({state:"paused",reason:"held for review",facts:[`${le} held item(s) await your review`,...A!==void 0?[`credits used: ${A.toFixed(1)}`]:[]],...g!==null?{resume:g}:{},tracePath:L})}return H?.release(),3}return ge.length>0&&e.out(u.text("note.sources_failed",{failed:ge.length,total:G.length,sources:ge.join(", ")})),Jt(ge.length>0?m.failedRecorded():y()),ge.length>0?1:0}export{Gt as a,un as b,Ls as c,mn as d,qs as e,hn as f,Ms as g,gn as h,Ri as i};
@@ -0,0 +1,4 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as Ce}from"./chunk-AQ2OG2EF.js";import{b as Me,d as Le}from"./chunk-VRIZDOO5.js";import{c as ke,g as Oe}from"./chunk-ZHWU6L2G.js";import{b as F}from"./chunk-ZFM77AQU.js";import{B as Ie,L as Ee,M as $e,Na as Be,a as ne,c as te,k as oe,r as we,x as re,y as se}from"./chunk-UEE3RZN4.js";import{d as L,j as he,k as be,l as ye,m as ve,n as ie,p as _e,q as j}from"./chunk-DBMW3VUN.js";import{f as ee,h as xe}from"./chunk-KU3YHPWZ.js";import{readFileSync as We}from"fs";import{basename as ue,extname as Ue}from"path";import{extname as Pe}from"path";var Fe={kind:"jira",media_type:"application/x-kane-jira-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},De={kind:"confluence",media_type:"application/x-kane-confluence-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},je={kind:"web",media_type:"application/x-kane-web-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Te={kind:"linear",media_type:"application/x-kane-linear-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Ge={kind:"linear-doc",media_type:"application/x-kane-linear-doc-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Ke={kind:"plugin",media_type:"application/x-kane-plugin-envelope",extensions:[],cite:"verbatim",maxBytes:25*1024*1024},le=[{kind:"text",media_type:"text/plain",extensions:[".txt"],cite:"verbatim",maxBytes:2e6},{kind:"markdown",media_type:"text/markdown",extensions:[".md",".markdown"],cite:"verbatim",maxBytes:2e6},{kind:"image",media_type:"image/png",extensions:[".png"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/jpeg",extensions:[".jpg",".jpeg"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/webp",extensions:[".webp"],cite:"anchor-only",maxBytes:5e6},{kind:"text",media_type:"application/json",extensions:[".json"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/yaml",extensions:[".yaml",".yml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/toml",extensions:[".toml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/xml",extensions:[".xml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"text/plain",extensions:[".log"],cite:"verbatim",maxBytes:2e6},{kind:"pdf",media_type:"application/pdf",extensions:[".pdf"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.subarray(0,5).toString("latin1")==="%PDF-"},{kind:"docx",media_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extensions:[".docx"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.length>=4&&e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,sniffFail:e=>e.length>=8&&e.subarray(0,8).equals(Ve)?"DOCX_ENCRYPTED_OR_LEGACY: password-protected Office file (or a legacy .doc renamed .docx) \u2014 remove the password / save as .docx and re-ingest":void 0},Fe,De,Te,Ge,Ke],Ve=Buffer.from([208,207,17,224,161,177,26,225]),ae={pdf:"pdf",docx:"docx",jira:"jira",confluence:"confluence",web:"web",linear:"linear","linear-doc":"linearDoc",plugin:"plugin"},en=new Set(Object.keys(ae));function Se(e){let i=Pe(e).toLowerCase(),n=le.find(o=>o.extensions.includes(i));return n?{ok:!0,media:n}:{ok:!1,code:"UNSUPPORTED_MEDIA",allowlist:le.flatMap(o=>o.extensions)}}function nn(e){return[...le,je].find(i=>i.media_type===e)??null}function K(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function Ne(e,i,n){if(n===void 0)return;let o=n!==null?[n]:e.byLabel(ee.SOURCE).filter(d=>d.content.source_id===i).map(d=>d.cid);if(o.length!==0){for(let d of o){let p=e.mediaOf(d);if(p.format==="plugin")return p.plugin?.id??""}return null}}function Xe(e,i,n,o){if(i===void 0||i===n)return;let d=o?"a retired source":"a source",p=i===null?`${d} of a built-in kind`:`${d} the ${i} plugin reads`,t=n===null?"a file or URL of a built-in kind":`a source the ${n} plugin reads`;return`SOURCE_ID_OWNED: '${e}' is ${p} \u2014 ${t} cannot become a version of it; ingest it under another id`}function Ye(e,i,n){return Ce({source_id:e,source_cid:"sha256:".padEnd(71,"0"),doc_kind:i,numbered_text:Ie(n)})}var Ae=2e3;function ze(e){let n=ue(e,Ue(e)).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"");return oe(n),n}function wn(e){let i=/^(.*?)[-_.]?v?\d+$/.exec(e);if(!i)return null;let n=(i[1]??"").replace(/[-_.]+$/,"");return n.length>0&&n!==e?n:null}async function In(e){let{store:i,filePath:n,asId:o,confirmSameSource:d,converters:p}=e,t=i.ensure(),s=We(n),g=Se(n);if(!g.ok)throw new Error(`${ue(n)} is a file type kane can't ingest (${Ue(n)||"no extension"}) \u2014 supported: ${g.allowlist.join(" ")} [UNSUPPORTED_MEDIA]`);if(s.byteLength>g.media.maxBytes)throw new Error(`${ue(n)} is too large \u2014 ${K(s.byteLength)}, the limit for ${g.media.media_type} is ${K(g.media.maxBytes)} [FILE_TOO_LARGE]`);if(g.media.sniff&&!g.media.sniff(s)){let w=g.media.sniffFail?.(s);throw new Error(w??`MEDIA_SNIFF_MISMATCH: ${n} does not look like ${g.media.media_type}`)}let C;o!==void 0?(oe(o),C=o):C=ze(n);let v=await He({store:i,bytes:s,media:g.media,sourceId:C,label:n,confirmSameSource:d,converters:p});return t.gitignore?{...v,gitignore:t.gitignore}:v}async function He(e){let{store:i,bytes:n,media:o,confirmSameSource:d,converters:p}=e,t=o.kind==="plugin"?e.plugin:void 0;if(o.kind==="plugin"&&!t)throw new Error("a source-plugin version needs the plugin it was read by");let s=e.sourceId,g=e.label??s,C=i.ensure();if(n.byteLength>o.maxBytes)throw new Error(`the content is too large \u2014 ${K(n.byteLength)}, the limit for ${o.media_type} is ${K(o.maxBytes)} [FILE_TOO_LARGE]`);let v=[],w=ae[o.kind];if(o.cite==="verbatim"&&!w){try{new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{throw new Error(`ENCODING_UNSUPPORTED: ${g} is not valid UTF-8 \u2014 re-save it as UTF-8 and re-ingest`)}n.toString("utf8").split(`
3
+ `).some(h=>h.length>Ae)&&v.push(`long line detected (> ${Ae} chars) \u2014 anchors lose granularity; consider pretty-printing before ingest`)}let k=F(n),O=new Map,I=null,_=null,m=null,B=new Map,R=!1;for(let h=0;;h++){let c=$e(i),u=c.heads.get(s),U=u!=null?c.getNode(u)?.content:void 0,b=Xe(s,Ne(c,s,u),t?t.id:null,u===null);if(b)throw new Error(b);if(u!=null&&U?.blob===k)return{status:"unchanged",source_id:s,cid:u,blob:k};if(u==null){for(let[r,E]of c.heads.entries())if(!(r===s||E==null)&&c.getNode(E)?.content.blob===k){if(Ne(c,r,E)!==(t?t.id:null))continue;let f;if(O.has(r)?f=O.get(r):h===0&&d?(f=await d(r),O.set(r,f)):(f=!1,O.set(r,f),h>0&&v.push(`same bytes already ingested as '${r}' \u2014 minted under '${s}' anyway (the twin appeared mid-commit; not prompted)`)),f)return{status:"unchanged",source_id:r,cid:E,blob:k};break}}let V=t?ne("source",te(s,k)):void 0,W=V!==void 0&&c.nodeLabel.has(V)?c.mediaOf(V):void 0,l=W?.format==="plugin"&&W.plugin?W:void 0,X=null;if(l){let r=[];if(l.text_blob&&i.getBlob(l.text_blob)===null&&r.push(`its text (${l.text_blob.slice(0,19)})`),l.plugin.index&&(X=ie(i.getBlob(l.plugin.index)),X===null&&r.push(`its unit index (${l.plugin.index.slice(0,19)})`)),l.plugin.notes&&i.getBlob(l.plugin.notes)===null&&r.push(`its notes (${l.plugin.notes.slice(0,19)})`),l.plugin.coverage&&i.getBlob(l.plugin.coverage)===null&&r.push(`its coverage plan (${l.plugin.coverage.slice(0,19)})`),r.length>0)throw new Error(`VERSION_BLOB_MISSING: this store has held these bytes of '${s}' before, and ${r.join(" and ")} from that ingest ${r.length>1?"are":"is"} not in the blob store \u2014 a version keeps what its first ingest stored, so it cannot be read again; restore the blobs from a copy of this store (kane-cli context fsck names what is missing)`)}if(!l&&m===null){let r={},E,f=null,A=null,M;if(w){let $=p?.[w];if(!$)throw new Error(`${w.toUpperCase()}_CONVERTER_MISSING: ${w} ingestion requires the converter \u2014 the command layer wires it`);let x=await $(n),y=re(x.projection);y.replaced>0&&v.push(se(s,y.replaced)),f=Buffer.from(y.text,"utf8");let D=Ye(s,o.kind,f),ge=()=>new Error(`PROJECTION_TOO_LARGE: serialized source payload ${D} bytes > ${4e5} \u2014 split the document and re-ingest`);if(D>4e5){if(!t)throw ge();if(f.byteLength>L.textBytes)throw new Error(`PLUGIN_TEXT_TOO_LARGE: plugin ${t.id} rendered ${s} to ${f.byteLength} bytes of text; a plugin's source may be at most ${L.textBytes} \u2014 split the source and ingest the parts`)}if(r={text_blob:F(f),...x.inventory.length>0?{images:x.inventory}:{},converter:x.converter},A=x.blobs,E={kind:o.kind,...x.pages!==void 0?{pages:x.pages}:{},delivered:x.delivered.length,omitted:x.inventory.length-x.delivered.length},t){let T=be(x.units,y.text);if(!T.ok)M={fault:T.fault};else{let me=ye(t.id,t.rules,T.units,y.text),G=ve(me);M=G.ok?{index:me,bytes:G.bytes,fp:F(G.bytes),given:T.units}:{fault:G.fault}}if(D>4e5&&(!("index"in M)||M.given.length===0))throw ge()}}else if(o.cite==="verbatim"){let $=re(n.toString("utf8"));$.replaced>0&&(v.push(se(s,$.replaced)),f=Buffer.from($.text,"utf8"),r={text_blob:F(f)})}let P=[...r.text_blob?[r.text_blob]:[],...A?A.keys():[]];m={derived:r,composite:E,projBytes:f,derivedBlobs:A,derivedFps:P,...M?{units:M}:{}}}let a=l?{derived:{...l.text_blob?{text_blob:l.text_blob}:{},...l.converter?{converter:l.converter}:{}},composite:{kind:o.kind,delivered:0,omitted:0},projBytes:null,derivedBlobs:null,derivedFps:l.text_blob?[l.text_blob]:[]}:m;if(l)i.putBlob(n);else if(!R){if(i.putBlob(n),a.projBytes!==null&&i.putBlob(a.projBytes),a.derivedBlobs!==null)for(let[,r]of a.derivedBlobs)i.putBlob(r);R=!0}let Y=te(s,k),z=xe("source",Y);if(z.length>0)throw new Error(`source node fails ${z[0].code}: ${z[0].detail}`);let H=ne("source",Y),S,N,J,q=[],Q=[],Z=[];if(t){let r=null,E;l?(E=l.plugin.index,r=X,N=r?{indexed:r.units.length}:{fault:{code:"UNIT_LIST_INVALID",detail:"this version was first stored without a unit index, and a version keeps what its first ingest stored"}}):a.units&&"index"in a.units?(i.putBlob(a.units.bytes),r=a.units.index,E=a.units.fp,N={indexed:r.units.length}):a.units&&(N={fault:a.units.fault});let f=u!=null?c.mediaOf(u):void 0,A=r&&f?.format==="plugin"&&f.plugin?.index?ie(i.getBlob(f.plugin.index)):null,M=r&&A&&A.plugin===r.plugin&&A.rules===r.rules?A:null,P=r&&M&&u!=null?_e(M,r):null;if(P!==null&&P.changed.length>0&&e.explain&&!l&&u!=null&&a.projBytes!==null){let y=B.get(u);if(y===void 0){let D=f?.text_blob?i.getBlob(f.text_blob):null;y=D===null?{reasons:{},warnings:[]}:await Qe({call:e.explain,ms:e.explainMs??L.explainMs,plugin:t.id,sourceId:s,changed:P.changed,before:{index:M,text:D.toString("utf8")},after:{index:r,text:a.projBytes.toString("utf8")}}),B.set(u,y)}q=y.warnings,Object.keys(y.reasons).length>0&&(J=y.reasons)}let $;if(l)$=l.plugin.notes;else if(t.notes!==void 0)$=t.notes;else if(e.context&&a.projBytes!==null){if(I===null){let y=a.units&&"index"in a.units?a.units.given:[];I=await Je({call:e.context,ms:e.contextMs??L.hookMs,plugin:t.id,sourceId:s,text:a.projBytes.toString("utf8"),units:y})}I.notes!==null&&(i.putBlob(I.notes.bytes),$=I.notes.fp),Q=I.warnings}let x;l?x=l.plugin.coverage:t.coverage!==void 0?x=t.coverage:e.coverage&&a.units&&"index"in a.units&&(_===null&&(_=await qe({call:e.coverage,ms:e.coverageMs??L.hookMs,plugin:t.id,sourceId:s,units:a.units.given})),_.plan!==null&&(i.putBlob(_.plan.bytes),x=_.plan.fp),Z=_.warnings),S={id:l?l.plugin.id:t.id,rules:l?l.plugin.rules:t.rules,...E?{index:E}:{},...$?{notes:$}:{},...x?{coverage:x}:{},...(l?l.plugin.cites_deep:t.citesDeep)===!0?{cites_deep:!0}:{},...P!==null&&u!=null?{changes:{from:u,...P,...J?{reasons:J}:{}}}:{},...t.fetch!==void 0?{fetch:{ref:t.fetch.ref,...t.fetch.cursor!==void 0?{cursor:t.fetch.cursor}:{}}}:{}}}let ce=N&&"fault"in N?[...v,`${s} is stored without a unit index: ${N.fault.detail} [${N.fault.code}] \u2014 everything that cites an earlier version of it reads stale`]:v,pe=q.length>0||Q.length>0||Z.length>0?[...ce,...q,...Q,...Z]:ce,Re=[...a.derivedFps,...S?.index?[S.index]:[],...S?.notes?[S.notes]:[],...S?.coverage?[S.coverage]:[]],fe={format:o.kind,media_type:o.media_type,anchors_supported:t?["L-L"]:w?["L-L","img#ref"]:o.cite==="verbatim"?["L-L"]:[],...a.derived,...S?{plugin:S}:{}};try{Ee(i,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:H,label:ee.SOURCE,content:Y}],edges:[],review:[],supersessions:[],media:{[s]:fe},...e.eventIds&&e.eventIds.length>0?{event_ids:e.eventIds}:{},source_head_moves:{[s]:H}},{graph:c,expectPrev:c.latestHash,intent:{v:1,verb:"ingest",args:we({source_id:s,blob:k,label:g,media:fe,derived_blobs:Re,eventIds:e.eventIds??null}),pins:{prior_head:u??null}},provenance:e.provenance})}catch(r){if(r instanceof Be&&h<3)continue;throw r}return{status:u!=null?"versioned":"created",source_id:s,cid:H,blob:k,...pe.length?{warnings:pe}:{},...a.composite?{composite:a.composite}:{},...C.gitignore?{gitignore:C.gitignore}:{},...N?{units:N}:{}}}}async function Je(e){let i="the version, its units and what changed are stored as they are; only the notes are missing",n;try{n=await e.call({text:e.text,units:e.units},e.ms)}catch(t){let s=j(t instanceof Error?t.message:String(t))??"it failed";return{notes:null,warnings:[`plugin ${e.plugin} gave no notes for ${e.sourceId}: ${s} \u2014 ${i} [PLUGIN_CONTEXT_FAILED]`]}}let o=Oe(e.plugin,n,new Set(e.units.map(t=>t.id))),d=[];if(o.invalid!==void 0&&d.push(`plugin ${e.plugin} answered context for ${e.sourceId} with ${o.invalid} \u2014 ${i} [PLUGIN_NOTES_INVALID]`),o.dropped.length>0){let t=o.dropped.reduce((s,g)=>s+g.count,0);d.push(`${t} ${t===1?"note":"notes"} of plugin ${e.plugin} for ${e.sourceId} ${t===1?"is":"are"} not kept: ${o.dropped.map(s=>`${s.count} ${s.why}`).join("; ")} \u2014 the version, its units and what changed are stored as they are, with the notes that are kept [PLUGIN_NOTES_DROPPED]`)}if(o.notes===null)return{notes:null,warnings:d};let p=ke(o.notes);return{notes:{bytes:p,fp:F(p)},warnings:d}}async function qe(e){let i="the version, its units and what changed are stored as they are, with no coverage plan: every unit of it is expected to have tests",n;try{n=await e.call({units:e.units},e.ms)}catch(p){let t=j(p instanceof Error?p.message:String(p))??"it failed";return{plan:null,warnings:[`plugin ${e.plugin} gave no coverage plan for ${e.sourceId}: ${t} \u2014 ${i} [PLUGIN_COVERAGE_FAILED]`]}}let o=Le(e.plugin,n,e.units.map(p=>p.id));if(o.plan===null)return{plan:null,warnings:[`plugin ${e.plugin} gave no coverage plan for ${e.sourceId}: ${o.fault} \u2014 ${i} [PLUGIN_COVERAGE_FAILED]`]};let d=Me(o.plan);return{plan:{bytes:d,fp:F(d)},warnings:[]}}async function Qe(e){let i=m=>{let B=he(m.text),R=new Map(m.index.units.map(h=>[h.id,h]));return h=>{let c=R.get(h);if(c===void 0||c.lines===void 0)return null;let{text:u,segments:U,...b}=c;return{unit:{...b,lines:[c.lines[0],c.lines[1]]},text:B.slice(c.lines[0]-1,c.lines[1]).join(`
4
+ `)}}},n=i(e.before),o=i(e.after),d={},p=[],t=[],s=[],g="",C=0,v=[],w=[],k=Date.now();for(let m=0;m<e.changed.length;m++){let B=e.changed[m],R=n(B),h=o(B);if(R===null||h===null)continue;let c=e.ms-(Date.now()-k);if(c<=0){v=e.changed.slice(m).filter(b=>n(b)!==null&&o(b)!==null);break}let u;try{u=await e.call({sourceId:e.sourceId,before:R,after:h},c)}catch(b){p.push(B),g===""&&(g=b instanceof Error?b.message:String(b));continue}if(u==null)continue;let U=j(u);if(U===null){s.push(B);continue}if(U.length>L.reasonChars){t.push(B);continue}if(C+Buffer.byteLength(U,"utf8")>L.reasonsBytes){w=e.changed.slice(m).filter(b=>n(b)!==null&&o(b)!==null);break}C+=Buffer.byteLength(U,"utf8"),d[B]=U}let O=m=>`${m.length} changed ${m.length===1?"unit":"units"} of ${e.sourceId} (${m.slice(0,5).join(", ")}${m.length>5?`, and ${m.length-5} more`:""})`,I="the version, its units and what changed are stored as they are; only the wording is missing",_=[];return p.length>0&&_.push(`plugin ${e.plugin} gave no reason for ${O(p)}: ${j(g)??"it failed"} \u2014 ${I} [PLUGIN_EXPLAIN_FAILED]`),v.length>0&&_.push(`plugin ${e.plugin} was not asked for a reason for ${O(v)}: its answers took the ${Math.round(e.ms/1e3)} seconds a version's reasons may take \u2014 ${I} [PLUGIN_EXPLAIN_TIMEOUT]`),s.length>0&&_.push(`plugin ${e.plugin} answered with something that is not a line of text for ${O(s)} \u2014 ${I} [PLUGIN_REASON_INVALID]`),t.length>0&&_.push(`plugin ${e.plugin} gave a reason over ${L.reasonChars} characters for ${O(t)}; it is dropped \u2014 ${I} [PLUGIN_REASON_TOO_LONG]`),w.length>0&&_.push(`the reasons of plugin ${e.plugin} passed ${L.reasonsBytes} bytes for one version; none is kept for ${O(w)} \u2014 ${I} [PLUGIN_REASONS_OVER_LIMIT]`),{reasons:d,warnings:_}}export{Fe as a,De as b,je as c,Te as d,Ge as e,Ke as f,le as g,ae as h,en as i,Se as j,nn as k,Xe as l,Ye as m,ze as n,wn as o,In as p,He as q};