openpond 0.2.54 → 0.2.56

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 (432) hide show
  1. package/dist/app-server.d.ts +10823 -9118
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/actions-command-QU4H53OG.js +2 -0
  4. package/dist/chunks/{app-layer-I7MZYVLL.js → app-layer-NSTE5HIT.js} +1 -1
  5. package/dist/chunks/app-server-connected-apps-JHGWLBXT.js +2 -0
  6. package/dist/chunks/app-server-evaluations-GJPFWIDA.js +2 -0
  7. package/dist/chunks/app-server-harness-services-IH4G6POY.js +2 -0
  8. package/dist/chunks/app-server-runtime-DVKOZ5B6.js +2 -0
  9. package/dist/chunks/apps-BKTOR4F7.js +2 -0
  10. package/dist/chunks/chunk-25MBPJVY.js +2 -0
  11. package/dist/chunks/chunk-2D4Y3HNW.js +2 -0
  12. package/dist/chunks/chunk-2IHO4GDJ.js +2 -0
  13. package/dist/chunks/chunk-2QUCCP6Z.js +2 -0
  14. package/dist/chunks/chunk-3K4VVB7S.js +6 -0
  15. package/dist/chunks/chunk-3QIB5FXI.js +10 -0
  16. package/dist/chunks/chunk-3RCRSMWZ.js +17 -0
  17. package/dist/chunks/chunk-3VUATFZD.js +2 -0
  18. package/dist/chunks/chunk-3Z47M3YY.js +2 -0
  19. package/dist/chunks/{chunk-GXSTZBM6.js → chunk-4D7HWVWD.js} +1 -1
  20. package/dist/chunks/chunk-4EPSHPZL.js +2 -0
  21. package/dist/chunks/chunk-4NESNOK5.js +2 -0
  22. package/dist/chunks/chunk-523TE4BI.js +2 -0
  23. package/dist/chunks/chunk-5MCNZCVQ.js +2 -0
  24. package/dist/chunks/chunk-6QSSIT62.js +2 -0
  25. package/dist/chunks/chunk-6ZFPQYHG.js +2 -0
  26. package/dist/chunks/chunk-74IIXVAE.js +2 -0
  27. package/dist/chunks/chunk-74ZXXBGN.js +6 -0
  28. package/dist/chunks/chunk-773TH7FN.js +2 -0
  29. package/dist/chunks/chunk-7E6T7GP5.js +2 -0
  30. package/dist/chunks/chunk-7ED24PP6.js +2 -0
  31. package/dist/chunks/chunk-7HPDGZOR.js +86 -0
  32. package/dist/chunks/chunk-7KWD2I6W.js +2 -0
  33. package/dist/chunks/chunk-7PXZ4X4P.js +2 -0
  34. package/dist/chunks/chunk-A6USMRWK.js +2 -0
  35. package/dist/chunks/chunk-ABD5M2D2.js +2 -0
  36. package/dist/chunks/chunk-ACYFMLWG.js +10 -0
  37. package/dist/chunks/chunk-AN525SPP.js +6 -0
  38. package/dist/chunks/chunk-APB2STJK.js +2 -0
  39. package/dist/chunks/chunk-AY64VY4E.js +2 -0
  40. package/dist/chunks/{chunk-UJ5EFSEC.js → chunk-B7RFL4N2.js} +1 -1
  41. package/dist/chunks/chunk-BFKYRQMA.js +2 -0
  42. package/dist/chunks/chunk-BLXEAZCQ.js +12 -0
  43. package/dist/chunks/chunk-D74JEERO.js +5 -0
  44. package/dist/chunks/{chunk-PA7XP42P.js → chunk-DARVPBZ4.js} +1 -1
  45. package/dist/chunks/chunk-DBK66CJP.js +8 -0
  46. package/dist/chunks/chunk-DDMZSZFL.js +1 -0
  47. package/dist/chunks/chunk-DIO5CB6U.js +2 -0
  48. package/dist/chunks/chunk-DMFUEUAZ.js +5 -0
  49. package/dist/chunks/chunk-DMVD2RFZ.js +2 -0
  50. package/dist/chunks/chunk-DUURYZOI.js +2 -0
  51. package/dist/chunks/chunk-DZUAT3TP.js +1 -0
  52. package/dist/chunks/chunk-EIEZHFIW.js +6 -0
  53. package/dist/chunks/chunk-EIRYMSEG.js +19 -0
  54. package/dist/chunks/{chunk-JDLAHVAJ.js → chunk-EKM2D7JU.js} +1 -1
  55. package/dist/chunks/chunk-EQFGBL3O.js +2 -0
  56. package/dist/chunks/chunk-EYPCBBMS.js +2 -0
  57. package/dist/chunks/chunk-F4KOGISR.js +10 -0
  58. package/dist/chunks/chunk-F74GBN6K.js +2 -0
  59. package/dist/chunks/chunk-FEAKTSRS.js +2 -0
  60. package/dist/chunks/chunk-FFRFSDBM.js +2 -0
  61. package/dist/chunks/chunk-FTEOCCPB.js +23 -0
  62. package/dist/chunks/chunk-FUOEIDMA.js +8 -0
  63. package/dist/chunks/{chunk-AH22RHPS.js → chunk-FV2R5RUN.js} +2 -2
  64. package/dist/chunks/chunk-FWIPHEVA.js +12 -0
  65. package/dist/chunks/chunk-FY5KHLMW.js +2 -0
  66. package/dist/chunks/chunk-G3RXYI2L.js +6 -0
  67. package/dist/chunks/chunk-GJ2ZJFDD.js +2 -0
  68. package/dist/chunks/chunk-GLDYJM7O.js +1 -0
  69. package/dist/chunks/chunk-GPVCOEUH.js +2 -0
  70. package/dist/chunks/chunk-GW766ZSO.js +5 -0
  71. package/dist/chunks/chunk-GWCHDF2C.js +4 -0
  72. package/dist/chunks/chunk-GZ7M5XBP.js +2 -0
  73. package/dist/chunks/chunk-H6IW2R22.js +140 -0
  74. package/dist/chunks/chunk-HCYX6RHP.js +2 -0
  75. package/dist/chunks/chunk-HDL5YSAA.js +2 -0
  76. package/dist/chunks/chunk-HIOKCIL7.js +2 -0
  77. package/dist/chunks/chunk-HY3GOBFJ.js +58 -0
  78. package/dist/chunks/chunk-HZEIRHEB.js +2 -0
  79. package/dist/chunks/chunk-I2NXNMRZ.js +2 -0
  80. package/dist/chunks/chunk-I7AQMAQI.js +33 -0
  81. package/dist/chunks/chunk-IZ6DLEVY.js +2 -0
  82. package/dist/chunks/chunk-J2TWKFML.js +1871 -0
  83. package/dist/chunks/chunk-JDEEWOD7.js +2 -0
  84. package/dist/chunks/chunk-JFXWI3EN.js +6 -0
  85. package/dist/chunks/chunk-JYKRR7E5.js +5 -0
  86. package/dist/chunks/chunk-KCJVFLBB.js +2 -0
  87. package/dist/chunks/{chunk-5CMKGD43.js → chunk-KG325WTN.js} +1 -1
  88. package/dist/chunks/chunk-KGNCKIFP.js +3 -0
  89. package/dist/chunks/chunk-KUERKVEU.js +3 -0
  90. package/dist/chunks/chunk-KVTBX2UP.js +2 -0
  91. package/dist/chunks/chunk-L6K7ERG5.js +2 -0
  92. package/dist/chunks/{chunk-N5QNXMIS.js → chunk-LQQNBVEB.js} +1 -1
  93. package/dist/chunks/{chunk-YJ4PNAST.js → chunk-M4JWQSV7.js} +1 -1
  94. package/dist/chunks/chunk-MQULU465.js +2 -0
  95. package/dist/chunks/chunk-N4FFQPLR.js +2 -0
  96. package/dist/chunks/chunk-N73MU2C3.js +2 -0
  97. package/dist/chunks/chunk-NHQ36THU.js +3 -0
  98. package/dist/chunks/{chunk-4SHKI3BH.js → chunk-O6ULLQJ6.js} +1 -1
  99. package/dist/chunks/chunk-O72BSKSO.js +2 -0
  100. package/dist/chunks/chunk-OGDADQGH.js +143 -0
  101. package/dist/chunks/chunk-OIUTWU6K.js +2 -0
  102. package/dist/chunks/chunk-OLLLZVHF.js +2 -0
  103. package/dist/chunks/{chunk-XM26DGML.js → chunk-OPNRWESL.js} +1 -1
  104. package/dist/chunks/chunk-OQKJGTTO.js +4 -0
  105. package/dist/chunks/chunk-OQPJ7FJF.js +9 -0
  106. package/dist/chunks/{chunk-R3XFY7VL.js → chunk-OS3LO5J3.js} +1 -1
  107. package/dist/chunks/{chunk-T5LE6R5S.js → chunk-OSIO7PLX.js} +1 -1
  108. package/dist/chunks/chunk-OUVIWDL2.js +2 -0
  109. package/dist/chunks/chunk-PCSIOUHF.js +7 -0
  110. package/dist/chunks/chunk-PF5R6CMP.js +21 -0
  111. package/dist/chunks/chunk-PPAPVGJP.js +3 -0
  112. package/dist/chunks/chunk-PRGBLQVH.js +2 -0
  113. package/dist/chunks/chunk-PSGGOZFM.js +2 -0
  114. package/dist/chunks/chunk-PUZQU66L.js +2 -0
  115. package/dist/chunks/{chunk-WITSXYEW.js → chunk-Q2QL6UWN.js} +1 -1
  116. package/dist/chunks/chunk-Q4TBTRIG.js +2 -0
  117. package/dist/chunks/chunk-Q5LEXXJG.js +16 -0
  118. package/dist/chunks/{chunk-YL6VFJ4P.js → chunk-QDC4OW3S.js} +1 -1
  119. package/dist/chunks/chunk-QEFHOJFE.js +7 -0
  120. package/dist/chunks/chunk-QHWGQ3A4.js +5 -0
  121. package/dist/chunks/chunk-QIKWJ2AA.js +11 -0
  122. package/dist/chunks/chunk-QNG27G3T.js +6 -0
  123. package/dist/chunks/chunk-QOGJAQDO.js +3 -0
  124. package/dist/chunks/chunk-QOTVNQDI.js +4 -0
  125. package/dist/chunks/{chunk-N3DEA6PG.js → chunk-RAXOSUSW.js} +1 -1
  126. package/dist/chunks/chunk-RNIAFXMB.js +50 -0
  127. package/dist/chunks/chunk-S5ESN275.js +42 -0
  128. package/dist/chunks/chunk-SDAUS5PY.js +2 -0
  129. package/dist/chunks/chunk-SDXFLO7J.js +5 -0
  130. package/dist/chunks/chunk-SH5CBAFC.js +2 -0
  131. package/dist/chunks/chunk-SWUEFLOH.js +2 -0
  132. package/dist/chunks/chunk-SYUKES6H.js +3 -0
  133. package/dist/chunks/chunk-T5AACNJI.js +2 -0
  134. package/dist/chunks/chunk-TRQQNFMO.js +4 -0
  135. package/dist/chunks/chunk-TVQAPBLZ.js +2 -0
  136. package/dist/chunks/chunk-UCPGRPWY.js +2 -0
  137. package/dist/chunks/chunk-UGL7WF3W.js +2 -0
  138. package/dist/chunks/chunk-UHFZHBGW.js +2 -0
  139. package/dist/chunks/chunk-UKMA4R6X.js +6 -0
  140. package/dist/chunks/{chunk-7ZG3IT7C.js → chunk-VRIEKBBH.js} +6 -6
  141. package/dist/chunks/chunk-VYLGI3IH.js +13 -0
  142. package/dist/chunks/chunk-W45RKGM6.js +1 -0
  143. package/dist/chunks/chunk-WJ43MJ3F.js +2 -0
  144. package/dist/chunks/chunk-WMKYHXVM.js +3 -0
  145. package/dist/chunks/chunk-WN3V6KDN.js +3 -0
  146. package/dist/chunks/chunk-X4OSOOSU.js +3 -0
  147. package/dist/chunks/chunk-XDQMGUWL.js +2 -0
  148. package/dist/chunks/chunk-XTFPDQMH.js +3 -0
  149. package/dist/chunks/chunk-XVDFJ3ZF.js +2 -0
  150. package/dist/chunks/chunk-XW6HGSIT.js +8 -0
  151. package/dist/chunks/chunk-XXYGGNVM.js +2 -0
  152. package/dist/chunks/chunk-Y4OWBBDD.js +184 -0
  153. package/dist/chunks/chunk-YBT2NB32.js +2 -0
  154. package/dist/chunks/chunk-YCJO3YVD.js +10 -0
  155. package/dist/chunks/{chunk-YD55Z5H3.js → chunk-YOBN7KTF.js} +11 -11
  156. package/dist/chunks/chunk-YOQRYNLP.js +2 -0
  157. package/dist/chunks/chunk-YR5ID2SS.js +2 -0
  158. package/dist/chunks/chunk-YY7LEQGP.js +2 -0
  159. package/dist/chunks/chunk-Z4Z5UOZM.js +22 -0
  160. package/dist/chunks/chunk-Z54O534A.js +3 -0
  161. package/dist/chunks/chunk-ZCHXGRRU.js +2 -0
  162. package/dist/chunks/chunk-ZFSHBFG5.js +40 -0
  163. package/dist/chunks/chunk-ZGTOK7ZK.js +12 -0
  164. package/dist/chunks/{chunk-NAZ26IZL.js → chunk-ZRDGQDZL.js} +1 -1
  165. package/dist/chunks/chunk-ZUJ3XUCP.js +2 -0
  166. package/dist/chunks/chunk-ZZWAQBA2.js +2 -0
  167. package/dist/chunks/cli-X25RSO2X.js +2 -0
  168. package/dist/chunks/configuration-command-6C5UO7GE.js +2 -0
  169. package/dist/chunks/connected-app-executor-IVLGQP65.js +2 -0
  170. package/dist/chunks/connected-evidence-GH2ATNEX.js +2 -0
  171. package/dist/chunks/connection-HTF6CC7M.js +2 -0
  172. package/dist/chunks/{continual-PKK2BOTB.js → continual-6CQAMTTR.js} +3 -3
  173. package/dist/chunks/core-commands-A2DGGIPS.js +2 -0
  174. package/dist/chunks/datasets-7BNMVJOY.js +2 -0
  175. package/dist/chunks/desktop-test-3CUHVLXV.js +3 -0
  176. package/dist/chunks/dist-OMGUJYPD.js +2 -0
  177. package/dist/chunks/{chunk-6VF3Q6QJ.js → dist-SKYG5LZO.js} +2 -4
  178. package/dist/chunks/dist-VYC5VMQB.js +2 -0
  179. package/dist/chunks/dist-ZVJPJLXR.js +2 -0
  180. package/dist/chunks/enclave-QS4BUNDU.js +2 -0
  181. package/dist/chunks/evaluation-coordination-XEF5L7KZ.js +2 -0
  182. package/dist/chunks/experiment-improvements-KRX2DP27.js +2 -0
  183. package/dist/chunks/experiments-DFGQYA4O.js +2 -0
  184. package/dist/chunks/experiments-VFQGE4HC.js +2 -0
  185. package/dist/chunks/extension-XKXXOP5N.js +4 -0
  186. package/dist/chunks/{help-WLKSACLZ.js → help-S7THC6IE.js} +1 -1
  187. package/dist/chunks/host-profile-evaluation-tools-JJQWJUBT.js +2 -0
  188. package/dist/chunks/host-profile-external-dataset-K3ICDHIP.js +2 -0
  189. package/dist/chunks/hosted-app-server-composition-BCOO5ANF.js +2 -0
  190. package/dist/chunks/hosted-experiment-improvement-NFSVS5TU.js +3 -0
  191. package/dist/chunks/hosted-harness-runtime-723S5ZSH.js +2 -0
  192. package/dist/chunks/hosted-profile-candidate-2S5LFUWD.js +3 -0
  193. package/dist/chunks/hosted-profile-compiler-2DQIFSXW.js +2 -0
  194. package/dist/chunks/hosted-profile-evaluation-control-76BTRTYD.js +2 -0
  195. package/dist/chunks/hosted-profile-evaluation-inspection-V6Z3A5XJ.js +3 -0
  196. package/dist/chunks/hosted-profile-evaluation-preparation-IDJYREW3.js +3 -0
  197. package/dist/chunks/hosted-tasksets-ANAE2PIW.js +2 -0
  198. package/dist/chunks/human-review-WR777ODH.js +2 -0
  199. package/dist/chunks/import-MLZUHITH.js +4 -0
  200. package/dist/chunks/javascript-isolate-process-source-ZPQKKLR4.js +2 -0
  201. package/dist/chunks/javascript-verifier-worker-source-F3LSGPOY.js +2 -0
  202. package/dist/chunks/learning-ACEVFL5M.js +2 -0
  203. package/dist/chunks/local-harness-improvement-runtime-JIQ6ZVDW.js +2 -0
  204. package/dist/chunks/local-harness-taskset-review-XVYTGAGK.js +2 -0
  205. package/dist/chunks/local-scope-HVF2GZ5W.js +2 -0
  206. package/dist/chunks/model-projects-QPO22JPA.js +2 -0
  207. package/dist/chunks/opchat-T4QTNEIY.js +3 -0
  208. package/dist/chunks/organizations-75L5DZDV.js +2 -0
  209. package/dist/chunks/profile-TFZMUEDR.js +3 -0
  210. package/dist/chunks/profile-training-source-6GOT7AHM.js +2 -0
  211. package/dist/chunks/project-action-payload-7VGL7OER.js +2 -0
  212. package/dist/chunks/project-agent-6RRO233B.js +2 -0
  213. package/dist/chunks/published-experiment-source-DZFENAQA.js +2 -0
  214. package/dist/chunks/refiner-profile-service-UUIWFJVT.js +2 -0
  215. package/dist/chunks/runtime-A7OZXM43.js +6 -0
  216. package/dist/chunks/sandbox-command-IU5XFTJP.js +2 -0
  217. package/dist/chunks/{sandbox-template-BBGGPJMI.js → sandbox-template-C4V6T36U.js} +1 -1
  218. package/dist/chunks/saved-work-6BMBFP43.js +2 -0
  219. package/dist/chunks/send-turn-XTAIS2JN.js +2 -0
  220. package/dist/chunks/sql-execution-process-source-B4HQM6ZV.js +2 -0
  221. package/dist/chunks/src-CJM6HY5Y.js +326 -0
  222. package/dist/chunks/{src-CR6UZYTX.js → src-LMC3K6LH.js} +1 -1
  223. package/dist/chunks/standalone-experiment-turn-owner-JCY5LL5R.js +2 -0
  224. package/dist/chunks/store-chat-workflows-S72HZXQR.js +18 -0
  225. package/dist/chunks/store-continual-support-reviews-HHA6NX7K.js +7 -0
  226. package/dist/chunks/store-conversation-serving-KPC62UEY.js +2 -0
  227. package/dist/chunks/store-create-improve-QV54XIZW.js +40 -0
  228. package/dist/chunks/store-datasets-RXJ33SUN.js +86 -0
  229. package/dist/chunks/store-evaluation-results-3F3P527G.js +7 -0
  230. package/dist/chunks/store-harness-evaluation-review-settings-I2R3HPO3.js +29 -0
  231. package/dist/chunks/store-harness-memory-VINCZ4GK.js +17 -0
  232. package/dist/chunks/store-harness-refinement-candidates-EA5KFQPH.js +21 -0
  233. package/dist/chunks/store-harness-workspaces-XUM4Z66X.js +2 -0
  234. package/dist/chunks/store-human-review-RAH7WMIP.js +7 -0
  235. package/dist/chunks/store-learned-preference-migration-validation-4CI2IRUF.js +2 -0
  236. package/dist/chunks/store-learning-WLG6KFIO.js +2 -0
  237. package/dist/chunks/store-learning-credentials-WZQJ4HPJ.js +2 -0
  238. package/dist/chunks/store-local-experiments-5LUJR7GI.js +97 -0
  239. package/dist/chunks/store-model-batch-review-YEGX327M.js +2 -0
  240. package/dist/chunks/store-model-configuration-5ZURQATB.js +3 -0
  241. package/dist/chunks/store-preference-comparison-LV32MHVL.js +6 -0
  242. package/dist/chunks/store-schedules-VGTEQVKH.js +53 -0
  243. package/dist/chunks/store-sidebar-file-bookmarks-VB5GTLFY.js +18 -0
  244. package/dist/chunks/store-sidebar-preferences-GWIOG2NH.js +16 -0
  245. package/dist/chunks/store-subagents-T7R2Z6TB.js +67 -0
  246. package/dist/chunks/store-task-inbox-JJTBW76C.js +33 -0
  247. package/dist/chunks/store-task-inventory-OB3F2APC.js +10 -0
  248. package/dist/chunks/store-taskset-drafts-EKQWWFYQ.js +9 -0
  249. package/dist/chunks/store-training-G6YLFSIR.js +70 -0
  250. package/dist/chunks/store-training-jobs-RC46YBF6.js +19 -0
  251. package/dist/chunks/store-training-models-6BA43IPP.js +49 -0
  252. package/dist/chunks/store-usage-IE2U2FD3.js +63 -0
  253. package/dist/chunks/store-work-evidence-QQDKM5AQ.js +8 -0
  254. package/dist/chunks/taskset-EQRFQBYM.js +2 -0
  255. package/dist/chunks/taskset-packages-XC6HEE3K.js +2 -0
  256. package/dist/chunks/{teams-bot-7I4BAUVO.js → teams-bot-EAPGPTHZ.js} +1 -1
  257. package/dist/chunks/training-UF6RPI4T.js +2 -0
  258. package/dist/chunks/web-search-CZ3NCLPY.js +2 -0
  259. package/dist/chunks/workspaces-EKKE5NAC.js +2 -0
  260. package/dist/cli.js +1 -1
  261. package/dist/index.js +1 -1
  262. package/dist/web/assets/App-CaRMZoxo.css +1 -0
  263. package/dist/web/assets/App-s-CJswyt.js +154 -0
  264. package/dist/web/assets/{AppDialog-BdusXgU0.js → AppDialog-t2Fx5tK3.js} +1 -1
  265. package/dist/web/assets/{AppTerminalPanel-C4uRpnBz.js → AppTerminalPanel-Dj1Y32oI.js} +2 -2
  266. package/dist/web/assets/AppsView-BYE5EBDJ.js +1 -0
  267. package/dist/web/assets/{BrowserSidebar-Bl7V6YO2.js → BrowserSidebar-jhWi4rVm.js} +1 -1
  268. package/dist/web/assets/{CartesianChart-BstFbsdn.js → CartesianChart-C1DIx0Ia.js} +1 -1
  269. package/dist/web/assets/{CollaborationTabs-B8YAf0c1.js → CollaborationTabs-Bdr-HmOL.js} +1 -1
  270. package/dist/web/assets/{CommandMenu-DZct7zUJ.js → CommandMenu-Ux2yOHAc.js} +1 -1
  271. package/dist/web/assets/{CommunityView-CR0-W-uG.js → CommunityView-DPEeVKFn.js} +1 -1
  272. package/dist/web/assets/{ComposerCreateImproveStrip-DR-Qo7b4.js → ComposerCreateImproveStrip-CEgh4OtN.js} +1 -1
  273. package/dist/web/assets/{GetStartedView-xqQoMMei.js → GetStartedView-CFHP0AaI.js} +1 -1
  274. package/dist/web/assets/HostedModelLearningReview-D8BGTPVN.js +1 -0
  275. package/dist/web/assets/{HostedModelLearningSettings-De3i9wF4.js → HostedModelLearningSettings-JS1S7vNO.js} +1 -1
  276. package/dist/web/assets/{LabModelVersionDetailPage-DAY1MmqP.js → LabModelVersionDetailPage-Dx5Q3xV2.js} +1 -1
  277. package/dist/web/assets/{LabSkillSidebar-DLnIgnry.js → LabSkillSidebar-BxffN-pN.js} +1 -1
  278. package/dist/web/assets/LabsRoute-CyYF8-dw.js +99 -0
  279. package/dist/web/assets/MainChatThread-DZpcFRFl.js +2 -0
  280. package/dist/web/assets/MainPane-5DTtwVCk.js +65 -0
  281. package/dist/web/assets/MainPane-BIM_UJ3q.css +1 -0
  282. package/dist/web/assets/{MarkdownText-gJMuefaJ.js → MarkdownText-BR4V6lNO.js} +24 -24
  283. package/dist/web/assets/{NativeSkillSidebar-Dlxb8iOC.js → NativeSkillSidebar-DU9IEgIO.js} +1 -1
  284. package/dist/web/assets/{NewExperienceSwitcher-DM-cqJ-K.js → NewExperienceSwitcher-mIy6FzCj.js} +1 -1
  285. package/dist/web/assets/{NewProjectDialog-Cu1q75gq.js → NewProjectDialog-RfTZTHxl.js} +1 -1
  286. package/dist/web/assets/{OutputsPage-DiXMkasl.js → OutputsPage-Cr1Spf7S.js} +1 -1
  287. package/dist/web/assets/{ProjectsPage-DqiBHiCB.js → ProjectsPage-CE6QUB-b.js} +1 -1
  288. package/dist/web/assets/RightChatPanelStack-T6VRWuHo.js +1 -0
  289. package/dist/web/assets/RightSidebarHomePanel-CK0rP3WT.js +1 -0
  290. package/dist/web/assets/ScheduledWorkPage-vOrYv8pp.js +1 -0
  291. package/dist/web/assets/SettingsView-DCKVrfjj.js +5 -0
  292. package/dist/web/assets/SettingsView-Dulr_xlq.css +1 -0
  293. package/dist/web/assets/{TeamChatView-DM0adMtj.js → TeamChatView-Bwrjr-vk.js} +2 -2
  294. package/dist/web/assets/{TerminalOverlay-CFlH51DD.js → TerminalOverlay-DhPoKZAq.js} +1 -1
  295. package/dist/web/assets/TrainingCreationPanel-BXHfohNm.js +1 -0
  296. package/dist/web/assets/{TrainingDraftPanel-Bbo3RRie.js → TrainingDraftPanel-C9cRX5qf.js} +1 -1
  297. package/dist/web/assets/{UsageSettingsSection-CSRjJUSa.js → UsageSettingsSection-CrdcSGeW.js} +1 -1
  298. package/dist/web/assets/{WorkSidebarPanel-DwlEMEoG.js → WorkSidebarPanel-DSSikNFQ.js} +1 -1
  299. package/dist/web/assets/WorkspaceDiffPanel-BAFo0CPN.js +14 -0
  300. package/dist/web/assets/WorkspaceEnvironmentMenu-BVHAhwnJ.js +63 -0
  301. package/dist/web/assets/WorkspaceGitDialogs-CwVoiDQ2.js +1 -0
  302. package/dist/web/assets/{WorkspaceMonacoEditor-BR4qxMgU.js → WorkspaceMonacoEditor-TxLyhzNp.js} +3 -3
  303. package/dist/web/assets/arrow-up-right-C9aE8Mfz.js +1 -0
  304. package/dist/web/assets/chunk-P3BRSSRD-DUGfuKA8.js +1 -0
  305. package/dist/web/assets/{clipboard-BZzZ82Bk.js → clipboard-Dk158Qp4.js} +1 -1
  306. package/dist/web/assets/{cloud-upload-CJPYPVl8.js → cloud-upload-k9eqBsHr.js} +1 -1
  307. package/dist/web/assets/{cssMode-WC4Rg1l-.js → cssMode-CO35ARZp.js} +1 -1
  308. package/dist/web/assets/{folder-open-sLZJxLQy.js → folder-open-sYgceW_f.js} +1 -1
  309. package/dist/web/assets/folder-plus-CS0R49m9.js +1 -0
  310. package/dist/web/assets/{git-commit-horizontal-Cotm7KEC.js → git-commit-horizontal-DrGxH2h4.js} +1 -1
  311. package/dist/web/assets/{htmlMode-C6oZGeaB.js → htmlMode-REMmzdfq.js} +1 -1
  312. package/dist/web/assets/index-3iPNbbER.css +1 -0
  313. package/dist/web/assets/{index-BxWTVKtn.js → index-C8aCGagb.js} +2 -2
  314. package/dist/web/assets/info-DLdbiUrh.js +1 -0
  315. package/dist/web/assets/{jsonMode-BET4LQIn.js → jsonMode-KEdMfkIf.js} +1 -1
  316. package/dist/web/assets/{lspLanguageFeatures-BPxA_-Kg.js → lspLanguageFeatures-5KZwEoxW.js} +1 -1
  317. package/dist/web/assets/minimize-2-CqcI4zcM.js +1 -0
  318. package/dist/web/assets/{monaco.contribution-DFzEyaHi.js → monaco.contribution-BJGj65F9.js} +2 -2
  319. package/dist/web/assets/{monaco.contribution-DXzyQfVi.js → monaco.contribution-Cly9Wt7L.js} +2 -2
  320. package/dist/web/assets/{monaco.contribution-BH6kkO4b.js → monaco.contribution-DO10L0zW.js} +2 -2
  321. package/dist/web/assets/{monaco.contribution-7AUuf2NS.js → monaco.contribution-omszXBEj.js} +2 -2
  322. package/dist/web/assets/monitor-BFVCcbxp.js +1 -0
  323. package/dist/web/assets/play-C469pVZq.js +1 -0
  324. package/dist/web/assets/{python-PzBkTjWx.js → python-Dw0YcVy9.js} +1 -1
  325. package/dist/web/assets/{save-DpezrtH2.js → save-CtSjPydi.js} +1 -1
  326. package/dist/web/assets/square-BuImvLhT.js +1 -0
  327. package/dist/web/assets/{toggleHighContrast-Cto-fOXm.js → toggleHighContrast-DjCO9lIP.js} +1 -1
  328. package/dist/web/assets/{tsMode-BYA4LNc6.js → tsMode-BAOnxKd6.js} +1 -1
  329. package/dist/web/assets/{upload-C5YFNgtS.js → upload-2JkFZo3h.js} +1 -1
  330. package/dist/web/assets/{useLocalAgentSchedules-CnyTsqlf.js → useLocalAgentSchedules-BNqAisfS.js} +1 -1
  331. package/dist/web/assets/useProviderSettings-C4L4wDoh.js +5 -0
  332. package/dist/web/assets/{useProviderSettings-Bw-csWbH.css → useProviderSettings-CmL_BaxP.css} +1 -1
  333. package/dist/web/assets/{useSessionTurnCache-DICuJSJW.js → useSessionTurnCache-BHU2-Jmz.js} +1 -1
  334. package/dist/web/assets/{wifi-off-nzHj7JXp.js → wifi-off-CpOAH62M.js} +1 -1
  335. package/dist/web/assets/{workers-Dboaw6f_.js → workers-0QvlA2T5.js} +1 -1
  336. package/dist/web/assets/{yaml-uuY5JmO8.js → yaml-BK3qxo7D.js} +1 -1
  337. package/dist/web/index.html +2 -2
  338. package/package.json +3 -3
  339. package/dist/chunks/actions-command-DSO6YOEE.js +0 -2
  340. package/dist/chunks/app-server-runtime-7AXV6JZI.js +0 -2
  341. package/dist/chunks/apps-TM74FFQB.js +0 -2
  342. package/dist/chunks/chunk-2JO2KWT3.js +0 -5
  343. package/dist/chunks/chunk-2SPZYBDN.js +0 -16
  344. package/dist/chunks/chunk-37DXASQL.js +0 -191
  345. package/dist/chunks/chunk-4EEH7MEC.js +0 -2
  346. package/dist/chunks/chunk-4TZHH5FC.js +0 -2409
  347. package/dist/chunks/chunk-5TNDPNS3.js +0 -2
  348. package/dist/chunks/chunk-6JAN4RMN.js +0 -42
  349. package/dist/chunks/chunk-7QEE4PBI.js +0 -8
  350. package/dist/chunks/chunk-BX4J2VDU.js +0 -2
  351. package/dist/chunks/chunk-DALJMSJG.js +0 -33
  352. package/dist/chunks/chunk-EMKZVP7Z.js +0 -2
  353. package/dist/chunks/chunk-FPUUZQUP.js +0 -6
  354. package/dist/chunks/chunk-GCOUYYHG.js +0 -5
  355. package/dist/chunks/chunk-GS2NKNKG.js +0 -4
  356. package/dist/chunks/chunk-H2VT22JK.js +0 -2
  357. package/dist/chunks/chunk-HA7EFTPF.js +0 -23
  358. package/dist/chunks/chunk-IKWDL3RB.js +0 -17
  359. package/dist/chunks/chunk-NHFGEVVH.js +0 -518
  360. package/dist/chunks/chunk-NNF6KCHD.js +0 -3
  361. package/dist/chunks/chunk-PJM2G7SG.js +0 -21
  362. package/dist/chunks/chunk-PQHTZ5CP.js +0 -2
  363. package/dist/chunks/chunk-PYABBF53.js +0 -53
  364. package/dist/chunks/chunk-QRWPEW3Z.js +0 -24
  365. package/dist/chunks/chunk-QXVIIM4T.js +0 -2
  366. package/dist/chunks/chunk-SDEDAHV6.js +0 -160
  367. package/dist/chunks/chunk-TGIB24K4.js +0 -22
  368. package/dist/chunks/chunk-UE3DMPGM.js +0 -3
  369. package/dist/chunks/chunk-USKE34VR.js +0 -9
  370. package/dist/chunks/chunk-USMZT5FZ.js +0 -18
  371. package/dist/chunks/chunk-WV2APYWG.js +0 -2
  372. package/dist/chunks/chunk-YIB3J4RC.js +0 -2
  373. package/dist/chunks/chunk-Z3D4C7BG.js +0 -12
  374. package/dist/chunks/cli-JVB345H2.js +0 -2
  375. package/dist/chunks/configuration-command-MATM4XR5.js +0 -2
  376. package/dist/chunks/connected-evidence-YDPGNHLP.js +0 -2
  377. package/dist/chunks/core-commands-MTV4EKXY.js +0 -2
  378. package/dist/chunks/datasets-CP3IT47T.js +0 -2
  379. package/dist/chunks/desktop-test-IAZC5MAH.js +0 -3
  380. package/dist/chunks/dist-4HV2W6V4.js +0 -2
  381. package/dist/chunks/dist-SAABJU5F.js +0 -2
  382. package/dist/chunks/evaluation-coordination-EPHLZXYM.js +0 -2
  383. package/dist/chunks/experiment-improvements-6JTOPA74.js +0 -2
  384. package/dist/chunks/experiments-XHPFGECH.js +0 -2
  385. package/dist/chunks/extension-GX7DLW2X.js +0 -4
  386. package/dist/chunks/hosted-experiment-improvement-HAB3UE6A.js +0 -3
  387. package/dist/chunks/hosted-harness-runtime-YM23QNDK.js +0 -2
  388. package/dist/chunks/hosted-profile-candidate-EOBGKQAS.js +0 -3
  389. package/dist/chunks/hosted-profile-compiler-SCVJI2CP.js +0 -2
  390. package/dist/chunks/hosted-profile-evaluation-control-RJ6XJZCS.js +0 -2
  391. package/dist/chunks/hosted-profile-evaluation-inspection-OC4XNGL2.js +0 -3
  392. package/dist/chunks/hosted-profile-evaluation-preparation-ZD4FM3FD.js +0 -3
  393. package/dist/chunks/human-review-AAVMISBF.js +0 -2
  394. package/dist/chunks/import-V3HUGRHR.js +0 -4
  395. package/dist/chunks/learning-FNBEIAY6.js +0 -2
  396. package/dist/chunks/opchat-QK43DXTY.js +0 -3
  397. package/dist/chunks/organizations-SRPAWKC7.js +0 -2
  398. package/dist/chunks/profile-C6CQNVYE.js +0 -3
  399. package/dist/chunks/project-agent-GZV5HNYI.js +0 -2
  400. package/dist/chunks/sandbox-command-4TJXQTKT.js +0 -2
  401. package/dist/chunks/src-NE6R4XC6.js +0 -329
  402. package/dist/chunks/taskset-LUG3ZU6J.js +0 -2
  403. package/dist/chunks/training-XHE6FVII.js +0 -2
  404. package/dist/chunks/workspaces-MFZ3OO6O.js +0 -2
  405. package/dist/web/assets/App-CO2F717V.css +0 -1
  406. package/dist/web/assets/App-CuhaCsfb.js +0 -235
  407. package/dist/web/assets/AppsView-BS1czXUP.js +0 -1
  408. package/dist/web/assets/HostedModelLearningReview-CHxxf_Lu.js +0 -1
  409. package/dist/web/assets/LabsRoute-CXJRJMhr.js +0 -99
  410. package/dist/web/assets/MainChatThread-BwAla81W.js +0 -2
  411. package/dist/web/assets/MainPane-CakOBCHw.js +0 -19
  412. package/dist/web/assets/MainPane-DOWsSew1.css +0 -1
  413. package/dist/web/assets/RightChatPanelStack-VaOOmxwd.js +0 -1
  414. package/dist/web/assets/RightSidebarHomePanel-CeSFJM5s.js +0 -1
  415. package/dist/web/assets/ScheduledWorkPage-D1jRQxFs.js +0 -1
  416. package/dist/web/assets/SettingsView-BnANbPLS.css +0 -1
  417. package/dist/web/assets/SettingsView-RA9OXgcu.js +0 -5
  418. package/dist/web/assets/TrainingCreationPanel-CgIBVGha.js +0 -1
  419. package/dist/web/assets/WorkspaceDiffPanel-pGVezNMw.js +0 -14
  420. package/dist/web/assets/WorkspaceEnvironmentMenu-Byjngd9V.js +0 -32
  421. package/dist/web/assets/WorkspaceGitDialogs-Dgmg-6XG.js +0 -1
  422. package/dist/web/assets/arrow-up-right-H0pvnH2s.js +0 -1
  423. package/dist/web/assets/chunk-UHVJOMWN-BqXRe639.js +0 -1
  424. package/dist/web/assets/folder-plus-C84wrpt_.js +0 -1
  425. package/dist/web/assets/index-dSmk3FLJ.css +0 -1
  426. package/dist/web/assets/info-Dc81lEfw.js +0 -1
  427. package/dist/web/assets/minimize-2-Bs7MVN3C.js +0 -1
  428. package/dist/web/assets/monitor-DXL019Wf.js +0 -1
  429. package/dist/web/assets/play-CXkxUZeU.js +0 -1
  430. package/dist/web/assets/square-oy7f5Ce6.js +0 -1
  431. package/dist/web/assets/useProviderSettings-B_KeQjE5.js +0 -5
  432. /package/dist/chunks/{chunk-OGPHXXCD.js → chunk-BT5YNE5U.js} +0 -0
@@ -0,0 +1,58 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as Ne,b as V,c as D,g as Ae,h as de}from"./chunk-APB2STJK.js";import{a as Te,m as S}from"./chunk-KGNCKIFP.js";import{a as u}from"./chunk-FTQLQJQV.js";var Re={codex:"Codex",claude_code:"Claude Code",hermes:"Hermes",openclaw:"OpenClaw",opencode:"OpenCode",grok_build:"Grok Build",pi:"Pi",oh_my_pi:"Oh My Pi"},T=32*1024*1024;import{homedir as Rt}from"node:os";import{realpath as Ue,stat as me,readdir as xt,readFile as Ct}from"node:fs/promises";import{resolve as he,join as U,isAbsolute as Lt}from"node:path";function xe(t,e){let n=0;for(let o of e){if(!Number.isSafeInteger(o)||o<n||o>t.length)throw new RangeError("Canonical array prefix lengths must be ascending and within the array");n=o}let s=new Te().update("["),i=0;return e.map(o=>{for(;i<o;){let a=JSON.stringify([pe(t[i])],null,2).slice(2,-2);s.update(i?`,
3
+ `:`
4
+ `).update(a),i++}return s.clone().update(i?`
5
+ ]
6
+ `:`]
7
+ `).digestHex()})}u(xe,"contentHashArrayPrefixes");function pe(t){if(t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string")return t;if(Array.isArray(t))return Array.from({length:t.length},(n,s)=>{let i=Object.getOwnPropertyDescriptor(t,s);if(!i||i.get||i.set)throw new TypeError("Canonical array prefixes require plain JSON values");return pe(i.value)});let e=t&&typeof t=="object"?Object.getPrototypeOf(t):void 0;if(t&&typeof t=="object"&&(e===Object.prototype||e===null))return Object.fromEntries(Object.keys(t).sort((n,s)=>n.localeCompare(s)).map(n=>{let s=Object.getOwnPropertyDescriptor(t,n);if(s.get||s.set)throw new TypeError("Canonical array prefixes require plain JSON values");return[n,pe(s.value)]}));throw new TypeError("Canonical array prefixes require plain JSON values")}u(pe,"sortJsonValue");import{opendir as Ot,readFile as Tt,stat as te}from"node:fs/promises";import{basename as Nt,dirname as At,join as N,resolve as ue}from"node:path";function ke(t,e){let n=e.HERMES_HOME?.trim();if(n){let i=n.replace(/\$(\w+)|\$\{([^}]+)\}/gu,(o,a,r)=>e[a||r]??o);return ue(i==="~"?t:i.startsWith("~/")?N(t,i.slice(2)):i)}let s=e.HERMES_DATA_DIR_SUFFIX||"";return process.platform==="win32"?N(e.LOCALAPPDATA?.trim()||N(t,"AppData","Local"),`hermes${s}`):N(t,`.hermes${s}`)}u(ke,"hermesHome");var Ce=u(t=>te(t).then(e=>e.isDirectory()).catch(()=>!1),"isDirectory"),Le=u(t=>te(t).then(e=>e.isFile()).catch(()=>!1),"isFile");async function fe(t,e){let n=[],s=await Ot(t).catch(()=>null);if(!s)return n;let i=0;for await(let o of s){if(++i>100)throw new Error("More than 100 profile entries. Select the exact --source-path.");o.isDirectory()&&!o.isSymbolicLink()&&e(o.name)&&n.push(o.name)}return n.sort()}u(fe,"profileNames");async function De(t){if(Nt(At(t))==="profiles")return[{root:t}];let e=N(t,"profiles");try{let n=await fe(e,a=>/^[a-z0-9][a-z0-9_-]{0,63}$/u.test(a)),s=[];for(let a of n)await te(N(e,".deleted",a)).then(()=>!0).catch(()=>!1)||await Le(N(e,a,"state.db"))&&s.push({root:N(e,a)});let i="",o=N(t,"active_profile");if(await te(o).then(a=>a.isFile()&&a.size<=1024).catch(()=>!1)&&(i=(await Tt(o,"utf8")).replace(/^\uFEFF/u,"").trim().toLowerCase()),i&&i!=="default"){if(!/^[a-z0-9][a-z0-9_-]{0,63}$/u.test(i))return[{root:t,reason:"Hermes active profile is invalid. Select the exact --source-path."}];let a=s.findIndex(r=>r.root===N(e,i));a<0?s.unshift({root:N(e,i),reason:"Hermes active profile has no retained live state database. Select a profile explicitly."}):s.unshift(...s.splice(a,1))}return(await Le(N(t,"state.db"))||!s.length)&&s.push({root:t}),s}catch(n){return[{root:t,reason:n instanceof Error?n.message:"Cannot inventory Hermes profiles. Select the exact --source-path."}]}}u(De,"hermesLocations");function ee(t){return/^[a-z0-9][a-z0-9._-]{0,63}$/u.test(t)&&!t.endsWith(".")&&!/^(?:con|prn|aux|nul|com[0-9]|lpt[0-9])(?:\.|$)/iu.test(t)}u(ee,"validOmpProfile");async function Me(t,e){let n=N(t,e.PI_CONFIG_DIR||".omp"),s=(e.OMP_PROFILE!==void 0?e.OMP_PROFILE:e.PI_PROFILE)?.trim();if(s&&s!=="default"&&!ee(s))return[{root:n,reason:"Oh My Pi profile is invalid. Select the exact --source-path."}];if(e.PI_CODING_AGENT_SESSION_DIR)return[{root:ue(e.PI_CODING_AGENT_SESSION_DIR)}];let i=(process.platform==="linux"||process.platform==="darwin")&&e.XDG_DATA_HOME?N(e.XDG_DATA_HOME,"omp"):void 0;async function o(a){let r=a?N(n,"profiles",a,"agent"):N(n,"agent"),l=e.PI_PROFILE?.trim(),c=l&&ee(l)?N(n,"profiles",l,"agent"):void 0,d=!a&&e.PI_CODING_AGENT_DIR&&e.PI_CODING_AGENT_DIR!==c?ue(e.PI_CODING_AGENT_DIR):void 0,p=i&&(a?N(i,"profiles",a):i);return{root:(!d||d===r)&&p&&await Ce(p)?p:d||r}}if(u(o,"location"),s||e.OMP_PROFILE!==void 0||e.PI_PROFILE!==void 0||e.PI_CODING_AGENT_DIR)return[await o(s&&s!=="default"?s:void 0)];try{let a=new Set(await fe(N(n,"profiles"),ee));if(i)for(let l of await fe(N(i,"profiles"),ee))a.add(l);let r=[await o()];for(let l of[...a].sort()){let c=await o(l);await Ce(N(c.root,"sessions"))&&r.push(c)}return r}catch(a){return[{root:n,reason:a instanceof Error?a.message:"Cannot inventory Oh My Pi profiles. Select the exact --source-path."}]}}u(Me,"ompLocations");async function jn(t){let e=t.home??Rt(),n=t.environment??process.env,s={codex:n.CODEX_HOME||U(e,".codex"),claude_code:n.CLAUDE_CONFIG_DIR||U(e,".claude"),hermes:ke(e,n),openclaw:n.OPENCLAW_STATE_DIR||U(e,".openclaw"),opencode:U(n.XDG_DATA_HOME||U(e,".local/share"),"opencode"),grok_build:n.GROK_HOME||U(e,".grok"),pi:n.PI_CODING_AGENT_DIR||U(e,".pi/agent"),oh_my_pi:U(e,".omp/agent")},i=s.pi,o=!1;if(n.PI_CODING_AGENT_SESSION_DIR)s.pi=he(n.PI_CODING_AGENT_SESSION_DIR);else if(!t.locations?.pi)try{let r=U(i,"settings.json");if((await me(r)).size<=1024*1024){let l=JSON.parse(await Ct(r,"utf8"));typeof l.sessionDir=="string"&&l.sessionDir.trim()&&(Lt(l.sessionDir)?s.pi=l.sessionDir:o=!0)}}catch{}let a=[];for(let r of Object.keys(Re)){let l=t.locations?.[r]?[{root:t.locations[r]}]:r==="hermes"?await De(he(s.hermes)):r==="oh_my_pi"?await Me(e,n):[{root:s[r]}];for(let c of l){let d=he(c.root),p=!1,g=!1;try{d=await Ue(d);let f=await me(d);g=f.isFile(),p=f.isDirectory()||g}catch{}if(c.reason&&(p=!1),r==="openclaw"&&p&&!g){let f=U(d,"agents"),b=await xt(f,{withFileTypes:!0}).catch(()=>[]),y=[];for(let m of b.slice(0,100)){if(!m.isDirectory()||m.isSymbolicLink())continue;let h=U(f,m.name,"agent","openclaw-agent.sqlite");await me(h).then(_=>_.isFile()).catch(()=>!1)&&y.push(await Ue(h))}if(y.length){for(let m of y)a.push({source:r,root:m,machineId:t.machineId,instanceId:`native-${S([t.machineId,r,m]).slice(0,40)}`,acquisition:"sqlite",available:!0,capabilities:{history:!0,live:!0,nativeResume:!1}});continue}}if(r==="pi"&&o&&!t.locations?.pi){a.push({source:r,root:d,machineId:t.machineId,instanceId:`native-${S([t.machineId,r,d]).slice(0,40)}`,acquisition:"files",available:!1,capabilities:{history:!1,live:!1,nativeResume:!1},reason:"Pi config uses a working-directory-relative sessionDir. Select its resolved directory with --source-path."});continue}a.push({source:r,root:d,machineId:t.machineId,instanceId:`native-${S([t.machineId,r,d]).slice(0,40)}`,acquisition:g&&!/\.(?:db|sqlite)$/u.test(d)?"files":r==="hermes"||r==="opencode"||r==="openclaw"&&g?"sqlite":r==="openclaw"?"bundle":"files",available:p,capabilities:{history:p,live:p&&(r!=="openclaw"||g),nativeResume:!1},...p?{}:{reason:c.reason??"Source location is missing or unreadable. Select a custom location."}})}}return a.filter((r,l)=>a.findIndex(c=>c.instanceId===r.instanceId)===l)}u(jn,"discoverSources");import{open as Gt,lstat as zt,readdir as Xt,readFile as Jt,realpath as at,stat as lt}from"node:fs/promises";import{basename as G,dirname as Vt,isAbsolute as Ee,join as ie,relative as Yt,resolve as Kt,sep as Zt}from"node:path";import{zstdDecompressSync as Qt}from"node:zlib";var Y=class extends Error{static{u(this,"ConnectedSessionWithoutUserRequestError")}constructor(){super("The session has no retained user request.")}};function x(t,e="milliseconds"){if(typeof t!="number"&&typeof t!="string")return null;let n=new Date(typeof t=="number"&&e==="seconds"?t*1e3:t);return Number.isFinite(n.getTime())?n.toISOString():null}u(x,"connectedTimestamp");function kt(t){return{path:t.path,contentHash:S(t.text),sizeBytes:new TextEncoder().encode(t.text).length}}u(kt,"connectedFileIdentity");function C(t){if(t.events.length+(t.unmappedEvents?.length??0)>D.events)throw new Error("connected_event_limit");let e=t.events.map((c,d)=>({...c,sequence:d}));if(new Set(e.map(c=>c.id)).size!==e.length)throw new Error("connected_duplicate_event");let n=e.flatMap((c,d)=>c.kind==="message"&&c.role==="user"?[d]:[]);if(!n.length)throw new Y;if(n.length+(t.includeConversation===!1?0:1)>D.boundaries)throw new Error("connected_boundary_limit");let s=`family-${S([t.origin,...t.acquisition?[t.acquisition.sourceInstanceId]:[],t.parentSessionId??t.sessionId]).slice(0,32)}`,i=xe(e,n.map(c=>c+1)),o=e.findIndex(c=>c.kind==="compaction"),a=n.map((c,d)=>{let p=n[d+1]??e.length,g=e.slice(c+1,p),f=g.filter(de).at(-1),b=g.filter(v=>v.kind==="tool_call"||v.kind==="tool_result"),y=new Set(b.filter(v=>v.kind==="tool_call").map(v=>v.callId)),m=new Set(b.filter(v=>v.kind==="tool_result").map(v=>v.callId)),h=b.some(v=>!v.callId)||[...y].some(v=>!m.has(v))||[...m].some(v=>!y.has(v)),_=[...g].reverse().find(v=>v.kind==="terminal"),A=_&&typeof _.content=="object"&&_.content!==null&&!Array.isArray(_.content)?_.content.status:null,O=o>=0&&o<=c,R=g.some(v=>v.kind==="unknown");return{id:`case-${S([t.origin,...t.acquisition?[t.acquisition.sourceInstanceId]:[],t.sessionId,t.branchId??null,e[c].id]).slice(0,40)}`,familyKey:s,projection:"turn",requestEventId:e[c].id,start:c,end:p,inputHash:i[d],outputHash:f?S(f.content):null,revisionHash:S(g),terminal:A==="completed"||A==="failed"||A==="cancelled"?A:"unknown",coverage:{answer:!!f,context:t.contextComplete===!1?"unknown":O?"compacted":"retained",process:b.length?h||R?"partial":"retained":R?"partial":"absent",artifacts:g.some(v=>v.kind==="artifact")?"references_only":"absent",replay:"unavailable",gaps:[...f?[]:["No recorded assistant answer."],...t.contextComplete===!1?["The source omits preceding context."]:[],...O?["Earlier context was compacted by the source."]:[],...h?["Tool call/result correlation is incomplete."]:[],...R?["Some source events have no supported process mapping."]:[],..._?[]:["No terminal receipt was recorded."],"No resettable execution environment was admitted."]}}});if(t.includeConversation!==!1){let c=a[0],d=a.at(-1),p=e.slice(c.start+1),g=p.filter(de);a.push({...c,id:`conversation-${S([t.origin,...t.acquisition?[t.acquisition.sourceInstanceId]:[],t.sessionId,t.branchId??null]).slice(0,40)}`,projection:"conversation",end:e.length,outputHash:g.length?S(g.map(f=>f.content)):null,revisionHash:S(p),terminal:d.terminal,coverage:{...c.coverage,answer:g.length>0,process:a.some(f=>f.coverage.process==="partial")?"partial":a.some(f=>f.coverage.process==="retained")?"retained":"absent",context:a.some(f=>f.coverage.context==="unknown")?"unknown":a.some(f=>f.coverage.context==="compacted")?"compacted":"retained",artifacts:a.some(f=>f.coverage.artifacts==="references_only")?"references_only":"absent",gaps:[...new Set(a.flatMap(f=>f.coverage.gaps))].slice(0,100)}})}let r={schemaVersion:Ne,normalizerVersion:V,origin:t.origin,sessionId:t.sessionId,branchId:t.branchId??null,parentSessionId:t.parentSessionId??null,exporterVersion:t.exporterVersion??null,sourceFiles:t.files.map(kt).sort((c,d)=>c.path.localeCompare(d.path)),...t.acquisition?{acquisition:t.acquisition}:{},events:e,unmappedEvents:(t.unmappedEvents??[]).map((c,d)=>({...c,sequence:d})),boundaries:a,warnings:t.warnings??[]},l=Ae.parse({...r,contentHash:S(r)});if(new TextEncoder().encode(JSON.stringify(l)).length>D.decodedBytes)throw new Error("connected_normalized_size_limit");return l}u(C,"normalizeConnectedSession");function H(t){if(new TextEncoder().encode(t.text).length>D.decodedBytes)throw new Error("Decoded source files exceed 64 MiB.");let e=t.text.replace(/^\uFEFF/u,"").split(/\r?\n/u);if(e.length>D.events+1)throw new Error("connected_event_limit");return e.flatMap((n,s)=>{if(!n.trim())return[];if(new TextEncoder().encode(n).length>D.lineBytes)throw new Error(`Source line ${s+1} exceeds the limit.`);let i;try{i=JSON.parse(n)}catch{throw new Error(`Invalid JSON on line ${s+1}.`)}if(!i||typeof i!="object"||Array.isArray(i))throw new Error(`Unsupported record on line ${s+1}.`);return[i]})}u(H,"connectedJsonLines");function E(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:{}}u(E,"object");function w(t){return{sequence:0,occurredAt:null,role:null,callId:null,parentId:null,usage:null,...t}}u(w,"event");function I(t){return JSON.parse(JSON.stringify(t??null))}u(I,"json");function M(t,e,n="reported_invocation"){let s=E(t),i=u((...c)=>{let d=c.find(p=>typeof p=="number"&&Number.isSafeInteger(p)&&p>=0);return typeof d=="number"?d:null},"number"),o=i(s.input_tokens,s.prompt_tokens),a=i(s.output_tokens,s.completion_tokens),r=i(s.cache_read_input_tokens,s.cached_input_tokens,E(s.input_tokens_details).cached_tokens),l=i(s.total_tokens);return o===null&&a===null&&r===null&&l===null?null:{invocationId:e,inputTokens:o,outputTokens:a,cachedInputTokens:r,totalTokens:l,provenance:n}}u(M,"sourceUsage");function $e(t,e){let n=new Set(e.map(c=>E(c.params).sessionId).filter(c=>typeof c=="string"));if(n.size!==1)throw new Error("Grok Build updates must identify exactly one retained session.");let s=[],i=new Set,o=new Map,a=null,r=null,l=!0;for(let c of e){let d=E(c.params),p=E(d.update),g=E(d._meta),f=p.sessionUpdate;if(typeof g.eventId!="string"||i.has(g.eventId))throw new Error("Grok Build updates require unique native event IDs.");i.add(g.eventId);let b=g.eventId,y=x(g.agentTimestampMs??(typeof c.timestamp=="number"?c.timestamp*1e3:null)),m=E(p.content);if(f==="user_message_chunk"){if(m.type!=="text"||typeof m.text!="string")throw new Error("Grok user content type requires a qualified adapter.");!a||l?(a=w({id:b,kind:"message",role:"user",occurredAt:y,content:m.text}),s.push(a),r=null,l=!1):a.content=String(a.content)+m.text}else if(f==="agent_message_chunk"){if(m.type!=="text"||typeof m.text!="string"){s.push(w({id:b,kind:"unknown",occurredAt:y,content:I(p)}));continue}r?r.content=String(r.content)+m.text:(r=w({id:b,kind:"message",role:"assistant",occurredAt:y,content:m.text}),s.push(r))}else if(f==="tool_call"||f==="tool_call_update"){let h=typeof p.toolCallId=="string"?p.toolCallId:null;if(!h){s.push(w({id:b,kind:"unknown",occurredAt:y,content:I(p)}));continue}let _=o.get(h);_?p.rawInput!==void 0&&(_.content=I({title:p.title,input:p.rawInput})):(_=w({id:`${b}:call`,kind:"tool_call",callId:h,occurredAt:y,content:I({title:p.title,input:p.rawInput})}),o.set(h,_),s.push(_)),(p.status==="completed"||p.status==="failed")&&s.push(w({id:`${b}:result`,kind:"tool_result",role:"tool",callId:h,occurredAt:y,content:I({status:p.status,output:p.rawOutput,content:p.content})}))}else if(f==="turn_completed"){let h=E(p.usage),_=typeof p.prompt_id=="string"?p.prompt_id:b;s.push(w({id:b,kind:"terminal",occurredAt:y,content:{status:p.stop_reason==="end_turn"?"completed":p.stop_reason==="cancelled"?"cancelled":"failed"},usage:M({input_tokens:h.inputTokens,output_tokens:h.outputTokens,cached_input_tokens:h.cachedReadTokens,total_tokens:h.totalTokens},_)})),l=!0,r=null,a=null}else f!=="agent_thought_chunk"&&s.push(w({id:b,kind:"unknown",occurredAt:y,content:I(p)}))}return C({origin:"grok_build",sessionId:String([...n][0]),files:[t],events:s,contextComplete:!1,warnings:["Grok retained ACP updates omit system context and encrypted reasoning. Tool coverage reflects only logged updates."]})}u($e,"parseGrokBuildSession");function Fe(t,e,n,s){let i=e.filter(h=>h.type==="session"),o=i[0];if(i.length!==1||!o||!(n==="openclaw"?[3,4].includes(Number(o.version)):o.version===3)||typeof o.id!="string")throw new Error("Unsupported native session tree version.");let a,l=(n!=="openclaw"?e:e.map(h=>{if(h.type==="session")return h;if(h.type==="leaf"){if(typeof h.targetId!="string")throw new Error("OpenClaw leaf control does not select a retained entry.");return a=h.targetId,h}if(typeof h.id!="string")throw new Error("OpenClaw transcript entry is missing its native identity.");let _=h.parentId===void 0?a??null:h.parentId;return h.appendMode!=="side"&&(a=h.id),{...h,parentId:_}})).filter(h=>h.type!=="session"&&h.type!=="title"&&h.type!=="leaf"),c=new Map,d=new Set;for(let h of l){if(typeof h.id!="string"||c.has(h.id))throw new Error("Session tree has missing or duplicate entry identities.");c.set(h.id,h),typeof h.parentId=="string"&&d.add(h.parentId)}s??=a;let p=[...c.keys()].filter(h=>!d.has(h));if(!s&&p.length!==1)throw new Error("Select a branch leaf for this branched session.");let g=s??p[0];if(!g||!c.has(g))throw new Error("The selected session branch is unavailable.");let f=[],b=new Set,y=g;for(;y;){if(b.has(y))throw new Error("Session branch contains a cycle.");b.add(y);let h=c.get(y);if(!h)throw new Error("Session branch has a missing ancestor.");f.push(h),y=typeof h.parentId=="string"?h.parentId:null}f.reverse();let m=[];for(let h of f){let _=String(h.id),A={occurredAt:x(h.timestamp),parentId:typeof h.parentId=="string"?h.parentId:null};if(h.type==="compaction"||h.type==="branch_summary"){m.push(w({...A,id:_,kind:"compaction",content:I({summary:h.summary,firstKeptEntryId:h.firstKeptEntryId})}));continue}if(h.type!=="message")continue;let O=E(h.message),R=O.role;if(R==="toolResult"){m.push(w({...A,id:_,kind:"tool_result",role:"tool",callId:typeof O.toolCallId=="string"?O.toolCallId:null,content:I({content:O.content,isError:O.isError===!0})}));continue}if(R!=="user"&&R!=="assistant"&&R!=="system"){m.push(w({...A,id:_,kind:"unknown",content:I({role:R,content:O.content})}));continue}let v=Array.isArray(O.content)?O.content.map(E):[],J=typeof O.content=="string"?O.content:v.filter(F=>F.type==="text").map(F=>String(F.text??"")).join(`
8
+ `),L=E(O.usage),W=M({input_tokens:L.input,output_tokens:L.output,cached_input_tokens:L.cacheRead,total_tokens:L.totalTokens},_);J||R!=="assistant"?m.push(w({...A,id:_,kind:"message",role:R,content:R==="system"&&!J&&O.sections?I(O.sections):J,usage:W})):W&&m.push(w({...A,id:`${_}:usage`,kind:"usage",content:null,usage:W}));for(let[F,P]of v.entries())P.type==="toolCall"?m.push(w({...A,id:`${_}:call:${F}`,kind:"tool_call",callId:typeof P.id=="string"?P.id:null,content:I({name:P.name,arguments:P.arguments})})):P.type!=="text"&&P.type!=="thinking"&&m.push(w({...A,id:`${_}:block:${F}`,kind:"unknown",content:I(P)}));R==="assistant"&&["stop","error","aborted"].includes(String(O.stopReason))&&m.push(w({...A,id:`${_}:terminal`,kind:"terminal",content:{status:O.stopReason==="stop"?"completed":O.stopReason==="aborted"?"cancelled":"failed"}}))}return C({origin:n,sessionId:o.id,branchId:null,...n==="openclaw"?{contextComplete:!1}:{},files:[t],events:m,exporterVersion:`session-v${o.version}`,warnings:["Only the selected branch is included. Private provider payloads and credential metadata are excluded."]})}u(Fe,"parsePiSession");function Pe(t,e){let n=E(e),s=E(n.info);if(typeof s.id!="string"||!Array.isArray(n.messages))throw new Error("OpenCode requires its native JSON session export (info and messages).");let i=[];for(let o of n.messages){let a=E(o),r=E(a.info),l=E(r.time);if(typeof r.id!="string"||r.sessionID!==s.id||!Array.isArray(a.parts))throw new Error("OpenCode message identity does not match its session.");let c=r.role;if(c!=="user"&&c!=="assistant")throw new Error("Unsupported OpenCode message role.");let d={occurredAt:x(l.created),parentId:typeof r.parentID=="string"?r.parentID:null},p=a.parts.map(E);if(p.some(m=>m.sessionID!==s.id||m.messageID!==r.id||typeof m.id!="string"))throw new Error("OpenCode part identity does not match its message.");let g=p.filter(m=>m.type==="text").map(m=>String(m.text??"")).join(`
9
+ `),f=E(r.tokens),b=E(f.cache),y=M({input_tokens:f.input,output_tokens:f.output,cached_input_tokens:b.read,total_tokens:f.total},r.id);g||c==="user"?i.push(w({...d,id:r.id,kind:"message",role:c,content:g,usage:y})):y&&i.push(w({...d,id:`${r.id}:usage`,kind:"usage",content:null,usage:y}));for(let m of p){let h=String(m.id);if(m.type==="tool"){let _=E(m.state),A=typeof m.callID=="string"?m.callID:null;i.push(w({...d,id:`${h}:call`,kind:"tool_call",callId:A,content:I({name:m.tool,arguments:_.input})})),(_.status==="completed"||_.status==="error")&&i.push(w({...d,id:`${h}:result`,kind:"tool_result",role:"tool",callId:A,content:I({output:_.output,error:_.error,status:_.status})}))}else m.type==="compaction"?i.push(w({...d,id:h,kind:"compaction",content:I(m)})):["text","reasoning","step-start","step-finish"].includes(String(m.type))||i.push(w({...d,id:h,kind:"unknown",content:I(m)}))}c==="assistant"&&(r.finish==="stop"||r.error)&&i.push(w({...d,id:`${r.id}:terminal`,kind:"terminal",content:{status:r.error?"failed":"completed"}}))}return C({origin:"opencode",sessionId:s.id,parentSessionId:typeof s.parentID=="string"?s.parentID:null,exporterVersion:typeof s.version=="string"?s.version:null,files:[t],events:i,warnings:["Source-reported usage is not an OpenPond billing receipt."]})}u(Pe,"parseOpenCodeSession");var ge="codex-native-authorization-v1",Dt=ge;function He(t){let e=[],n=u((o,a,r)=>{let l={policy:Dt,sourcePath:o,sourceHash:S(a),entries:r};return e.push(l),l},"omit"),s=u((o,a)=>o.replace(/<permissions instructions>[\s\S]*?<\/permissions instructions>/gu,r=>r.replace(/^## Approved command prefixes\r?\n[\s\S]*?(?=^## |<\/permissions instructions>)/gmu,l=>{let c=n(a,l,null);return`## Approved command prefixes
10
+ [Native authorization rules omitted; policy ${c.policy}; source hash ${c.sourceHash}]
11
+ `})),"permissionsText"),i=E(t.payload);if(t.type==="response_item"&&i.type==="message"&&["system","developer"].includes(String(i.role))){let o=typeof i.content=="string"?s(i.content,"/payload/content"):Array.isArray(i.content)?i.content.map((a,r)=>{let l=E(a);return typeof l.text=="string"?{...l,text:s(l.text,`/payload/content/${r}/text`)}:a}):i.content;return{row:{...t,payload:{...i,content:o}},omissions:e}}if(t.type==="world_state"){let o=E(i.state),a=E(o.permissions);if(Array.isArray(a.approved_command_prefixes)){let r=n("/payload/state/permissions/approved_command_prefixes",a.approved_command_prefixes,a.approved_command_prefixes.length);return{row:{...t,payload:{...i,state:{...o,permissions:{...a,approved_command_prefixes:{omitted:"native_authorization_state",...r}}}}},omissions:e}}}return{row:t,omissions:e}}u(He,"projectCodexAuthorization");function je(t,e){let n=E(e.find(a=>a.type==="session_meta")?.payload);if(typeof n.id!="string")throw new Error("This is not a supported Codex rollout: session_meta.id is missing.");let s=[],i=null,o=0;for(let[a,r]of e.entries()){let l=He(r);o+=l.omissions.length;let c=E(l.row.payload);if(r.type==="session_meta")continue;if(r.type==="turn_context"){i=typeof c.turn_id=="string"?c.turn_id:i;continue}let p={id:typeof c.id=="string"?c.id:`codex-event-${S([a,r]).slice(0,32)}`,occurredAt:x(r.timestamp),parentId:i};if(r.type==="response_item")c.type==="message"&&["user","assistant","system","developer"].includes(String(c.role))?s.push(w({...p,kind:"message",role:c.role==="developer"?"system":c.role,content:I(c.content)})):c.type==="function_call"||c.type==="custom_tool_call"?s.push(w({...p,kind:"tool_call",callId:typeof c.call_id=="string"?c.call_id:null,content:I(c)})):c.type==="function_call_output"||c.type==="custom_tool_call_output"?s.push(w({...p,kind:"tool_result",role:"tool",callId:typeof c.call_id=="string"?c.call_id:null,content:I(c.output)})):s.push(w({...p,kind:"unknown",content:I(c)}));else if(r.type==="compacted")s.push(w({...p,kind:"compaction",content:I(c)}));else if(r.type==="event_msg"){if(["user_message","agent_message","agent_reasoning","task_started"].includes(String(c.type)))continue;if(c.type==="task_complete"||c.type==="turn_aborted")s.push(w({...p,kind:"terminal",content:{status:c.type==="task_complete"?"completed":"cancelled",source:I(c)}}));else if(c.type==="token_count"){let g=E(c.info),f=M(g.total_token_usage,`codex-cumulative:${n.id}:${a}`,"reported_cumulative");s.push(w({...p,kind:"usage",usage:f,content:I(c)}))}else s.push(w({...p,kind:"unknown",content:I(c)}))}else s.push(w({...p,kind:"unknown",content:I(l.row)}))}return C({origin:"codex",sessionId:n.id,parentSessionId:typeof n.forked_from_id=="string"?n.forked_from_id:null,exporterVersion:typeof n.cli_version=="string"?n.cli_version:null,files:[t],events:s,warnings:["Codex cumulative usage is retained as reported totals and is not summed as billed invocations.","Referenced files are unavailable unless separately admitted.",...o?[`Codex native authorization state excluded by codex-native-authorization-v1 from ${o} locations. Omission markers retain source-section hashes; sourceFiles retains original byte hashes. Other conversation evidence is unchanged and still requires privacy admission.`]:[]]})}u(je,"parseCodexSession");function K(t){let e=t.filter(d=>(d.type==="user"||d.type==="assistant")&&typeof d.uuid=="string"),n=new Set(e.flatMap(d=>typeof d.sessionId=="string"?[d.sessionId]:[]));if(n.size!==1||!e.length)throw new Error("A supported Claude Code transcript must identify one session with UUID messages.");let s=[...n][0],i=t.filter(d=>typeof d.uuid=="string"&&d.sessionId===s),o=new Map(i.map(d=>[d.uuid,d]));if(o.size!==i.length)throw new Error("Claude Code transcript contains duplicate message UUIDs.");let a=new Set(i.flatMap(d=>typeof d.parentUuid=="string"?[d.parentUuid]:[])),r=i.filter(d=>!a.has(d.uuid));if(!r.length)throw new Error("Claude Code transcript has no selectable branch leaf.");function l(d){let p=o.get(d);if(!p)throw new Error("The selected Claude Code branch leaf is missing.");let g=[],f=new Set,b=!1;for(;p;){let y=p.uuid;if(f.has(y))throw new Error("Claude Code branch contains a parent cycle.");f.add(y),g.unshift(p);let m=p.parentUuid;if(typeof m!="string")break;p=o.get(m),p||(b=!0)}return{chain:g,missingParent:b,chainHash:S(g)}}u(l,"select");function c(){if(r.length>256)throw new Error("This transcript exceeds the 256-branch inspection limit.");return r.map(d=>{let p=l(d.uuid),g=p.chain.filter(m=>m.type==="user"||m.type==="assistant"),f=g.at(-1),b=E(f?.message).content,y=typeof b=="string"?b:Array.isArray(b)?b.flatMap(m=>typeof E(m).text=="string"?[E(m).text]:[]).join(" "):"";return{leafId:d.uuid,chainHash:p.chainHash,title:y.slice(0,180),updatedAt:x(f?.timestamp),messages:g.length}})}return u(c,"branches"),{sessionId:s,leaves:r,select:l,branches:c}}u(K,"claudeGraph");function Be(t,e,n){let s=K(e);if(!n&&s.leaves.length!==1)throw new Error("This transcript has multiple branches. Select a branch leaf UUID before importing.");let{chain:i,missingParent:o}=s.select(n??s.leaves[0].uuid),a=[];for(let r of i){if(r.type!=="user"&&r.type!=="assistant")continue;let l=E(r.message),c=l.content,d={occurredAt:x(r.timestamp),parentId:typeof r.parentUuid=="string"?r.parentUuid:null},p=r.type==="user"?"user":"assistant",g=Array.isArray(c)?c:[{type:"text",text:c}],f=g.filter(b=>E(b).type==="text");f.length&&a.push(w({...d,id:r.uuid,kind:"message",role:p,content:I(f)})),p==="assistant"&&l.usage&&a.push(w({...d,id:`${r.uuid}:usage`,kind:"usage",content:I(l.usage),usage:M(l.usage,typeof l.id=="string"?l.id:r.uuid)}));for(let[b,y]of g.entries()){let m=E(y);if(m.type==="text"||m.type==="thinking"||m.type==="redacted_thinking")continue;let h=`${r.uuid}:${b}`;m.type==="tool_use"?a.push(w({...d,id:h,kind:"tool_call",callId:typeof m.id=="string"?m.id:null,content:I(m)})):m.type==="tool_result"?a.push(w({...d,id:h,kind:"tool_result",role:"tool",callId:typeof m.tool_use_id=="string"?m.tool_use_id:null,content:I(m)})):a.push(w({...d,id:h,kind:"unknown",content:I(m)}))}l.stop_reason==="end_turn"&&a.push(w({...d,id:`${r.uuid}:terminal`,kind:"terminal",content:{status:"completed"}}))}return e.some(r=>r.type==="system"&&r.subtype==="compact_boundary")&&a.unshift(w({id:`compaction-${S(e.filter(r=>r.subtype==="compact_boundary")).slice(0,32)}`,kind:"compaction",content:{source:"claude_compact_boundary"}})),C({origin:"claude_code",sessionId:s.sessionId,branchId:null,parentSessionId:typeof i[0]?.parentSessionId=="string"?i[0].parentSessionId:null,exporterVersion:typeof i.at(-1)?.version=="string"?i.at(-1).version:null,files:[t],events:a,contextComplete:!o,warnings:[...o?["The transcript omits an ancestor; complete context is unavailable."]:[],...i.some(r=>r.isSidechain)?["This is a subagent/sidechain transcript; parent context is not implicitly imported."]:[],"Claude Code transcript schema is internal; only the declared message shapes are normalized."]})}u(Be,"parseClaudeSession");function qe(t,e){let n=[];for(let[s,i]of t.entries()){let o=E(i),a=typeof o.entryId=="string"?o.entryId:typeof o.id=="string"?o.id:typeof o.id=="number"&&Number.isSafeInteger(o.id)?String(o.id):typeof o.message_id=="string"?o.message_id:`${e}-${S([s,o]).slice(0,32)}`,r={occurredAt:x(o.timestamp,e==="hermes"?"seconds":"milliseconds"),parentId:typeof o.parentId=="string"?o.parentId:null};if(o.role==="tool"){n.push(w({...r,id:a,kind:"tool_result",role:"tool",callId:typeof o.tool_call_id=="string"?o.tool_call_id:null,content:I(o.content)}));continue}if(!["user","assistant","system"].includes(String(o.role))){n.push(w({...r,id:a,kind:"unknown",content:I(o)}));continue}if(n.push(w({...r,id:a,kind:"message",role:o.role,content:I(o.content),usage:M(o.usage,a)})),Array.isArray(o.tool_calls))for(let[l,c]of o.tool_calls.entries()){let d=E(c);n.push(w({...r,id:`${a}:call:${l}`,kind:"tool_call",callId:typeof d.id=="string"?d.id:null,content:I(d)}))}(o.finish_reason==="stop"||o.stop_reason==="end_turn")&&n.push(w({...r,id:`${a}:terminal`,kind:"terminal",content:{status:"completed"}}))}return n}u(qe,"historyEvents");function We(t,e){let n=typeof e.id=="string"?e.id:typeof e.session_id=="string"?e.session_id:null;if(!n||!Array.isArray(e.messages))throw new Error("Hermes requires a full-session export with id or session_id and messages.");if(e.message_count!==void 0&&e.message_count!==e.messages.length)throw new Error("Hermes full-session message count differs from the retained messages.");let s=Array.isArray(e.lineage_session_ids)?e.lineage_session_ids.find(o=>typeof o=="string"&&o):null,i=qe(e.messages,"hermes");return typeof e.system_prompt=="string"&&e.system_prompt.trim()&&i.unshift(w({id:`hermes-system-${S(e.system_prompt).slice(0,32)}`,kind:"message",role:"system",content:e.system_prompt})),C({origin:"hermes",sessionId:n,parentSessionId:typeof s=="string"?s:typeof e.parent_session_id=="string"?e.parent_session_id:null,exporterVersion:typeof e.version=="string"?e.version:null,files:[t],events:i,warnings:["Reported usage is not an OpenPond billing receipt.","Exporter redaction and missing tools/artifacts remain evidence gaps.",...e.session_id&&!e.id?["This is a Hermes session backup. Exporter version and terminal receipts may be unavailable."]:[]]})}u(We,"parseHermesEvidence");function Ge(t){let e=u(p=>{let g=t.find(f=>f.path===p);if(!g)throw new Error(`OpenClaw bundle is missing ${p}.`);return g},"read"),n=E(JSON.parse(e("manifest.json").text)),s=E(JSON.parse(e("session-branch.json").text)),i=e("events.jsonl"),o=H(i);if(n.traceSchema!=="openclaw-trajectory"||n.schemaVersion!==1||typeof n.sessionId!="string"||typeof n.traceId!="string")throw new Error("Unsupported OpenClaw trajectory manifest.");if(n.leafId!==s.leafId||n.eventCount!==o.length||o.some(p=>p.traceSchema!==n.traceSchema||p.schemaVersion!==1||p.sessionId!==n.sessionId||p.traceId!==n.traceId))throw new Error("OpenClaw bundle identity/count does not match its manifest.");if(!Array.isArray(s.entries))throw new Error("OpenClaw active branch entries are missing.");if(s.header&&E(s.header).id!==n.sessionId)throw new Error("OpenClaw branch header differs from the manifest session.");let a=new Set,r=[];for(let[p,g]of s.entries.entries()){let f=E(g);if(typeof f.id!="string"||a.has(f.id)||p>0&&f.parentId!==E(s.entries[p-1]).id)throw new Error("OpenClaw active branch is duplicate, incomplete or unordered.");a.add(f.id),f.type==="message"&&r.push({...E(f.message),entryId:f.id,parentId:f.parentId??null,timestamp:f.timestamp??E(f.message).timestamp})}if(s.entries.length&&E(s.entries.at(-1)).id!==s.leafId)throw new Error("OpenClaw branch does not reach its leaf.");let l=qe(r,"openclaw"),c=[],d=new Set;for(let[p,g]of o.entries()){if(!Number.isSafeInteger(g.seq)||g.seq<0||d.has(g.seq)||p>0&&Number(o[p-1].seq)>=Number(g.seq))throw new Error("OpenClaw events have invalid/duplicate/unordered sequences.");d.add(g.seq),c.push(w({id:`trajectory:${n.traceId}:${g.seq}`,kind:"unknown",occurredAt:x(g.ts),content:I(g)}))}return C({origin:"openclaw",sessionId:n.sessionId,files:t,events:l,unmappedEvents:c,exporterVersion:typeof n.openclawVersion=="string"?n.openclawVersion:null,warnings:["Raw trajectory events are retained; unqualified event types are not advertised as complete process grading.",...Array.isArray(n.warnings)?n.warnings.map(p=>typeof E(p).message=="string"?String(E(p).message).slice(0,500):"The source exporter reports incomplete evidence."):[]].slice(0,100)})}u(Ge,"parseOpenClawEvidence");function Ws(t){return t==="codex"?`${V}/${ge}`:V}u(Ws,"agentImportNormalizerRevision");function ze(t){if(!t.files.length||t.files.length>D.files)throw new Error("Choose between 1 and 100 source files.");let e=new Set,n=0;for(let r of t.files){if(r.path.length>500||r.path.startsWith("/")||r.path.includes("\\")||r.path.split("/").some(l=>!l||l==="."||l==="..")||e.has(r.path))throw new Error("Unsafe or duplicate source file path.");e.add(r.path),n+=new TextEncoder().encode(r.text).length}if(n>D.decodedBytes)throw new Error("Decoded source files exceed 64 MiB.");let s=[],i=[],o=u((r,l)=>{try{s.push(...l().map(c=>t.acquisition?C({origin:c.origin,sessionId:c.sessionId,branchId:c.branchId,parentSessionId:c.parentSessionId,exporterVersion:c.exporterVersion,files:t.files.filter(d=>c.sourceFiles.some(p=>p.path===d.path)),events:c.events,unmappedEvents:c.unmappedEvents,warnings:c.warnings,contextComplete:!c.boundaries.some(d=>d.coverage.context==="unknown"),acquisition:t.acquisition}):c))}catch(c){i.push({file:r,...c instanceof Y?{code:"no_user_request"}:{},message:c instanceof Error?c.message:"Unsupported session."})}},"attempt");if(t.source==="openclaw"&&t.files.some(r=>r.path.endsWith("manifest.json")))o("manifest.json",()=>{let r=t.files[0].path.split("/")[0],l=!t.files.some(c=>c.path==="manifest.json")&&t.files.every(c=>c.path.startsWith(`${r}/`))?t.files.map(c=>({...c,path:c.path.slice(r.length+1)})):t.files;return[Ge(l)]});else for(let r of t.files)o(r.path,()=>{if(t.source==="opencode")return[Pe(r,JSON.parse(r.text))];let l;if(t.source==="hermes"&&r.path.endsWith(".json")){let c=JSON.parse(r.text.replace(/^\uFEFF/u,""));if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Hermes session backup must be one JSON object.");l=[c]}else l=H(r);if(t.source==="grok_build")return[$e(r,l)];if(t.source==="pi"||t.source==="oh_my_pi"||t.source==="openclaw")return[Fe(r,l,t.source,t.branchLeafId)];if(t.source==="codex")return[je(r,l)];if(t.source==="claude_code")return[Be(r,l,t.branchLeafId)];if(t.source==="hermes")return l.map(c=>We(r,c));throw new Error("Unsupported source adapter.")});if(s.length>D.sessions||s.reduce((r,l)=>r+l.events.length+l.unmappedEvents.length,0)>D.events||s.reduce((r,l)=>r+l.boundaries.length,0)>D.boundaries)throw new Error("Import exceeds the session/event/boundary limit.");let a=new Map;for(let r of s){let l=JSON.stringify([r.origin,r.sessionId,r.branchId]),c=a.get(l);if(c&&c!==r.contentHash)throw new Error("The same session has different contents in this selection. Choose one export.");a.set(l,r.contentHash)}return{schemaVersion:"openpond.agentImportPreview.v1",source:t.source,sourceHash:S({source:t.source,files:[...t.files].sort((r,l)=>r.path.localeCompare(l.path)),branchLeafId:t.branchLeafId??null}),sessions:s.filter((r,l)=>s.findIndex(c=>c.contentHash===r.contentHash)===l),issues:i}}u(ze,"previewAgentImport");import{DatabaseSync as qt}from"node:sqlite";import{join as Wt}from"node:path";import{DatabaseSync as jt}from"node:sqlite";import{zstdDecompressSync as Ze}from"node:zlib";import{createHash as Bt}from"node:crypto";import{createHash as Mt}from"node:crypto";import{readFileSync as Ut,realpathSync as Xe,statSync as $t}from"node:fs";import{basename as Ft,dirname as Je,join as Ve,relative as Pt,sep as Ye}from"node:path";import{zstdDecompressSync as Ht}from"node:zlib";function Ke(t,e,n){let s=t.prepare("SELECT generation,archive_name,archive_sha256,event_count,raw_bytes,archive_bytes,last_seq,storage,length(archive_blob) AS blob_bytes FROM session_transcript_cold_archives WHERE session_id=?").get(n);if(!s)return null;if(Number(s.archive_bytes)>T||Number(s.raw_bytes)>T||Number(s.event_count)>1e5)throw new Error("OpenClaw cold archive exceeds the retained size limit.");let i;if(s.storage==="sqlite"){if(Number(s.blob_bytes)!==Number(s.archive_bytes))throw new Error("OpenClaw cold archive size differs from its receipt.");let g=t.prepare("SELECT archive_blob FROM session_transcript_cold_archives WHERE session_id=?").get(n);if(!(g.archive_blob instanceof Uint8Array))throw new Error("OpenClaw cold archive is unavailable.");i=g.archive_blob}else if(s.storage==="file"){let g=String(s.archive_name);if(!/^[a-f0-9]{64}\.jsonl\.zst$/.test(g))throw new Error("Invalid OpenClaw cold archive name.");let f=Je(e.root),b=Ft(f)==="agent"?Ve(Je(f),"sessions"):f,y=Xe(b),m=Xe(Ve(b,"cold",g)),h=Pt(y,m);if(h===".."||h.startsWith(`..${Ye}`)||h.startsWith(Ye))throw new Error("OpenClaw cold archive leaves the selected agent directory.");let _=$t(m);if(!_.isFile()||_.size!==Number(s.archive_bytes))throw new Error("OpenClaw cold archive size differs from its receipt.");i=Ut(m)}else throw new Error("Unsupported OpenClaw cold archive storage.");if(i.length!==Number(s.archive_bytes)||Mt("sha256").update(i).digest("hex")!==s.archive_sha256)throw new Error("OpenClaw cold archive checksum differs from its receipt.");let o=Ht(i,{maxOutputLength:T}),a=new TextDecoder("utf8",{fatal:!0}).decode(o).trimEnd().split(`
12
+ `),r=JSON.parse(a.shift()??"null");if(r?.kind!=="header"||r.version!==1||r.sessionId!==n||r.generation!==s.generation)throw new Error("OpenClaw cold archive identity differs from its receipt.");let l=[],c=-1,d=0;for(let g of a){let f=JSON.parse(g);if(!["event","identity","active","index","fts"].includes(f?.kind))throw new Error("Unsupported OpenClaw cold archive record.");if(f.kind==="event"){if(!Number.isSafeInteger(f.row?.seq)||f.row.seq<=c||typeof f.row.event_json!="string")throw new Error("Invalid OpenClaw cold archive event sequence.");c=f.row.seq,d+=Buffer.byteLength(f.row.event_json),l.push(f.row.event_json)}}if(l.length!==Number(s.event_count)||c!==Number(s.last_seq)||d+l.length-1!==Number(s.raw_bytes))throw new Error("OpenClaw cold archive contents differ from its receipt.");let p=JSON.parse(l[0]??"null");if(p?.type!=="session"||p.id!==n)throw new Error("OpenClaw transcript identity differs from selected session.");return{path:`${n}.jsonl`,text:l.join(`
13
+ `)+`
14
+ `}}u(Ke,"readOpenClawColdArchive");function Qe(t){let e=new jt(t.root,{readOnly:!0,allowExtension:!1,enableDoubleQuotedStringLiterals:!1});return e.exec("PRAGMA query_only=ON; PRAGMA busy_timeout=1000; BEGIN"),e}u(Qe,"open");function ne(t,e){return!!t.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?").get(e)}u(ne,"has");function et(t,e){let n=Qe(t);try{let s=ne(n,"session_transcript_archives")?"UNION ALL SELECT session_id AS id,created_at AS updated,archive_sha256 AS revision FROM session_transcript_archives":"",i=ne(n,"session_transcript_cold_archives")?"UNION ALL SELECT session_id AS id,archived_at AS updated,archive_sha256 AS revision FROM session_transcript_cold_archives":"",o=n.prepare(`SELECT id,MAX(updated) AS updated,MAX(revision) AS revision FROM (
15
+ SELECT session_id AS id,MAX(created_at) AS updated,CAST(MAX(seq) AS TEXT) AS revision FROM transcript_events GROUP BY session_id
16
+ ${s} ${i}) WHERE id > ? GROUP BY id ORDER BY id LIMIT ?`).all(e.cursor??"",e.limit+1),a=o.slice(0,e.limit).map(r=>({nativeSessionId:String(r.id),sourceInstanceId:t.instanceId,path:String(r.id),title:String(r.id),cwd:null,updatedAt:new Date(Number(r.updated)||0).toISOString()}));return{items:a,nextCursor:o.length>e.limit?a.at(-1).nativeSessionId:null}}finally{n.close()}}u(et,"listOpenClawSessions");function tt(t,e){let n=Qe(t);try{if(ne(n,"session_transcript_cold_archives")){let c=Ke(n,t,e);if(c)return c}if(!n.prepare("SELECT 1 FROM transcript_events WHERE session_id=? LIMIT 1").get(e)){if(!ne(n,"session_transcript_archives"))throw new Error("OpenClaw archive is unavailable.");let c=n.prepare("SELECT archive_name,length(archive_blob) AS bytes FROM session_transcript_archives WHERE session_id=? ORDER BY created_at DESC LIMIT 1").get(e);if(!c||Number(c.bytes)>T)throw new Error("OpenClaw archive is missing or exceeds the retained byte limit.");let d=n.prepare("SELECT archive_blob,archive_sha256,encoding FROM session_transcript_archives WHERE archive_name=? AND session_id=?").get(String(c.archive_name),e);if(!(d.archive_blob instanceof Uint8Array)||Bt("sha256").update(d.archive_blob).digest("hex")!==d.archive_sha256)throw new Error("OpenClaw archive checksum differs from its retained receipt.");if(d.encoding!=="zstd"&&d.encoding!=="identity")throw new Error("Unsupported OpenClaw archive encoding.");let p=d.encoding==="zstd"?Ze(d.archive_blob,{maxOutputLength:T}):d.archive_blob,g=new TextDecoder("utf8",{fatal:!0}).decode(p),f=JSON.parse(g.split(`
17
+ `,1)[0]);if(f.type!=="session"||f.id!==e)throw new Error("OpenClaw archive identity differs from selected session.");return{path:`${e}.jsonl`,text:g}}let i=n.prepare("SELECT COUNT(*) AS n,SUM(COALESCE(event_utf8_bytes,length(CAST(event_json AS BLOB)),0)) AS bytes FROM transcript_events WHERE session_id=?").get(e);if(Number(i.n)>1e5||Number(i.bytes)>T)throw new Error("OpenClaw transcript exceeds the retained size limit.");let o=n.prepare("SELECT seq,event_json,event_zstd,event_utf8_bytes FROM transcript_events WHERE session_id=? ORDER BY seq LIMIT 100001").all(e),a=0,r=o.map(c=>{let d;if(typeof c.event_json=="string")d=c.event_json;else{if(!(c.event_zstd instanceof Uint8Array)||Number(c.event_utf8_bytes)>T)throw new Error("Unsupported OpenClaw compressed transcript record.");let p=Ze(c.event_zstd,{maxOutputLength:T});if(p.length!==Number(c.event_utf8_bytes))throw new Error("OpenClaw compressed transcript size differs from its receipt.");d=new TextDecoder("utf8",{fatal:!0}).decode(p)}if(a+=Buffer.byteLength(d),a>T)throw new Error("OpenClaw transcript exceeds retained size limit.");return d});if(!r.length)throw new Error("OpenClaw transcript is unavailable.");let l=JSON.parse(r[0]);if(l.type!=="session"||l.id!==e)throw new Error("OpenClaw transcript identity differs from selected session.");return{path:`${e}.jsonl`,text:r.join(`
18
+ `)+`
19
+ `}}finally{n.close()}}u(tt,"readOpenClawSession");function nt(t){let e=t.root.endsWith(".db")?t.root:Wt(t.root,t.source==="opencode"?"opencode.db":"state.db"),n=new qt(e,{readOnly:!0,allowExtension:!1,enableDoubleQuotedStringLiterals:!1});return n.exec("PRAGMA query_only=ON; PRAGMA busy_timeout=1000; BEGIN"),n}u(nt,"open");function st(t,e){if(t.source==="openclaw")return et(t,e);let n=nt(t);try{let s=e.since?Date.parse(e.since):0,i=t.source==="opencode"?n.prepare("SELECT id,title,directory AS cwd,time_updated AS updated, time_updated || ':' || COALESCE((SELECT MAX(time_updated) FROM message WHERE session_id=session.id),0) || ':' || COALESCE((SELECT MAX(time_updated) FROM part WHERE session_id=session.id),0) || ':' || (SELECT COUNT(*) FROM part WHERE session_id=session.id) AS revision FROM session WHERE id > ? AND time_updated >= ? ORDER BY id LIMIT ?").all(e.cursor??"",s,e.limit+1):n.prepare("SELECT id,title,cwd,MAX(COALESCE(last_activity_at,0),started_at) * 1000 AS updated FROM sessions WHERE id > ? AND MAX(COALESCE(last_activity_at,0),started_at) * 1000 >= ? ORDER BY id LIMIT ?").all(e.cursor??"",s,e.limit+1),o=i.slice(0,e.limit).map(a=>({nativeSessionId:String(a.id),sourceInstanceId:t.instanceId,path:String(a.id),title:typeof a.title=="string"?a.title:String(a.id),cwd:typeof a.cwd=="string"?a.cwd:null,updatedAt:new Date(Number(a.updated)).toISOString(),storageRevision:t.source==="opencode"?String(a.revision):void 0}));return{items:o,nextCursor:i.length>e.limit?o.at(-1).nativeSessionId:null}}finally{n.close()}}u(st,"listDatabaseSessions");function rt(t,e){if(t.source==="openclaw")return tt(t,e);let n=nt(t);try{let s;if(t.source==="opencode"){let o=n.prepare("SELECT id,title,directory,parent_id,version,time_created,time_updated FROM session WHERE id = ?").get(e);if(!o)throw new Error("Native session is unavailable.");let a=n.prepare("SELECT (SELECT COALESCE(SUM(length(CAST(data AS BLOB))),0) FROM message WHERE session_id=?) + (SELECT COALESCE(SUM(length(CAST(data AS BLOB))),0) FROM part WHERE session_id=?) AS bytes").get(e,e);if(Number(a?.bytes)>T)throw new Error("Native session exceeds the retained byte limit.");let r=n.prepare("SELECT id,data FROM message WHERE session_id = ? ORDER BY time_created,id LIMIT 100001").all(e);if(r.length>1e5)throw new Error("Native session exceeds the event limit.");let l=0,c=r.map(d=>{if(l+=Buffer.byteLength(String(d.data)),l>T)throw new Error("Native session exceeds the retained byte limit.");let p=n.prepare("SELECT id,data FROM part WHERE session_id = ? AND message_id = ? ORDER BY time_created,id LIMIT 100001").all(e,String(d.id));if(p.length>1e5)throw new Error("Native parts exceed the event limit.");return{info:{...JSON.parse(String(d.data)),id:d.id,sessionID:e},parts:p.map(g=>{if(l+=Buffer.byteLength(String(g.data)),l>T)throw new Error("Native session exceeds the retained byte limit.");return{...JSON.parse(String(g.data)),id:g.id,sessionID:e,messageID:d.id}})}});s={info:{...o,parentID:o.parent_id,time:{created:o.time_created,updated:o.time_updated}},messages:c}}else{let o=n.prepare("SELECT id,title,parent_session_id,system_prompt FROM sessions WHERE id = ?").get(e);if(!o)throw new Error("Native session is unavailable.");let a=n.prepare("SELECT COALESCE(SUM(length(CAST(COALESCE(content,'') AS BLOB))+length(CAST(COALESCE(tool_calls,'') AS BLOB))),0) AS bytes FROM messages WHERE session_id=? AND active=1").get(e);if(Number(a?.bytes)>T)throw new Error("Native session exceeds the retained byte limit.");let r=n.prepare("SELECT id,role,content,tool_call_id,tool_calls,timestamp,finish_reason,compacted FROM messages WHERE session_id = ? AND active = 1 ORDER BY id LIMIT 100001").all(e);if(r.length>1e5)throw new Error("Native session exceeds the event limit.");let l=0;s={...o,messages:r.map(c=>{if(l+=Buffer.byteLength(JSON.stringify(c)),l>T)throw new Error("Native session exceeds the retained byte limit.");return{...c,tool_calls:typeof c.tool_calls=="string"?JSON.parse(c.tool_calls):null}}),message_count:r.length}}let i=JSON.stringify(s);if(Buffer.byteLength(i)>T)throw new Error("Native session exceeds the retained byte limit.");return{path:`${e}.json`,text:i}}finally{n.close()}}u(rt,"readDatabaseSession");function se(t){return typeof t!="string"?null:t.replace(/\s+/gu," ").trim().slice(0,160)||null}u(se,"titleText");function it(t,e){let n=t.filter(s=>s.sessionId===void 0||s.sessionId===e);for(let s of[...n].reverse())if(s.type==="custom-title"){let i=se(s.customTitle);if(i)return i}for(let s of[...n].reverse())if(s.type==="summary"){let i=se(s.summary);if(i)return i}for(let s of n){if(s.type!=="user"||s.sessionId!==e||s.isMeta||s.isSidechain)continue;let i=E(s.message).content,o=se(Array.isArray(i)?i.filter(a=>E(a).type==="text").map(a=>E(a).text).filter(a=>typeof a=="string").join(" "):i);if(o)return o}return e}u(it,"claudeConversationTitle");function ot(t,e){return se(t)??e}u(ot,"retainedConversationTitle");var re=class extends Error{static{u(this,"NativeSessionNotReadyError")}constructor(){super("This session has no retained user request yet.")}};async function dt(t,e,n=!0){let s=await at(t.root),i=await at(Kt(s,e)),o=Yt(s,i);if(o.startsWith(`..${Zt}`)||o===".."||Ee(o))throw new Error("History path is outside the selected source.");if(n&&(await lt(i)).size>T)throw new Error("Source file exceeds 32 MiB.");return i}u(dt,"selectedPath");async function Z(t,e){let n=await dt(t,e),s=await Jt(n);if(s.byteLength>T)throw new Error("Source changed beyond the retained limit.");let i=n.endsWith(".zst")?Qt(s,{maxOutputLength:64*1024*1024}):s,o=new TextDecoder("utf-8",{fatal:!0}).decode(i);if(n.endsWith(".jsonl")&&o&&!o.endsWith(`
20
+ `)){let a=o.lastIndexOf(`
21
+ `);try{JSON.parse(o.slice(a+1))}catch{return o.slice(0,a+1)}}return o}u(Z,"readSelectedFile");async function en(t){if((await zt(t.root)).isFile())return[""];let e=t.source==="codex"?["sessions","archived_sessions"]:t.source==="grok_build"?["sessions"]:t.source==="claude_code"?["projects"]:t.source==="pi"||t.source==="oh_my_pi"?["sessions"]:[""],n=[];async function s(i,o){if(o>12)throw new Error("Selected history exceeds directory depth limit.");let a;try{a=await Xt(ie(t.root,i),{withFileTypes:!0})}catch(r){if(r.code==="ENOENT")return;throw r}for(let r of a){let l=ie(i,r.name);if(!r.isSymbolicLink()&&(r.isDirectory()?await s(l,o+1):r.isFile()&&(t.source==="openclaw"?r.name==="manifest.json":t.source==="grok_build"?r.name==="updates.jsonl":/\.jsonl(?:\.zst)?$/u.test(r.name))&&n.push(l),n.length>1e4))throw new Error("Select a narrower source directory (more than 10,000 history files).")}}u(s,"walk");for(let i of e)await s(i,0);return!n.length&&e[0]!==""&&await s("",0),n.sort()}u(en,"pathsBelow");function ct(t,e){return(e||t.root).endsWith(".json")}u(ct,"sessionFileJson");async function Rr(t,e={}){if(!t.available||!t.capabilities.history)throw new Error(t.reason??"Native history is unavailable.");let n=e.limit??50;if(!Number.isInteger(n)||n<1||n>100||e.since&&!Number.isFinite(Date.parse(e.since)))throw new Error("Invalid history page or date range.");if(t.acquisition==="sqlite")return st(t,{...e,limit:n});let s=await en(t),i=[];for(let o of s)if(!(e.cursor&&o<=e.cursor)){try{let a=await lt(ie(t.root,o));if(e.since&&a.mtimeMs<Date.parse(e.since))continue;let r;if(t.acquisition!=="bundle"&&!ct(t,o)&&t.source!=="hermes"&&!(o||t.root).endsWith(".zst")){let y=await Gt(await dt(t,o,!1),"r");try{let m=Buffer.alloc(262144),h=await y.read(m,0,m.length,0),_=m.subarray(0,h.bytesRead).toString("utf8"),A=_.lastIndexOf(`
22
+ `);if(r=_,!_.endsWith(`
23
+ `))try{JSON.parse(_.slice(A+1))}catch{r=_.slice(0,A+1)}let O=(await y.stat()).size;if(t.source==="claude_code"&&O>h.bytesRead){let R=Math.max(h.bytesRead,O-m.length),v=Buffer.alloc(m.length+1),J=await y.read(v,0,v.length,R-1),L=v.subarray(0,J.bytesRead).toString("utf8"),W=L.indexOf(`
24
+ `);if(L=W<0?"":L.slice(W+1),!L.endsWith(`
25
+ `)){let F=L.lastIndexOf(`
26
+ `);try{JSON.parse(L.slice(F+1))}catch{L=L.slice(0,F+1)}}r+=`
27
+ ${L}`}}finally{await y.close()}}else r=await Z(t,o);let l=t.acquisition==="bundle"||ct(t,o)?[E(JSON.parse(r))]:r.split(/\r?\n/u).filter(Boolean).slice(0,t.source==="claude_code"?void 0:12).map(y=>E(JSON.parse(y))),c=l.find(y=>y.type==="session"||y.type==="session_meta")??l[0]??{},d=c.type==="session_meta"?E(c.payload):t.source==="grok_build"?E(c.params):t.source==="opencode"?E(c.info):c,p=t.source==="claude_code"?G(o||t.root).replace(/\.jsonl(?:\.zst)?$/u,""):typeof d.id=="string"?d.id:typeof d.sessionId=="string"?d.sessionId:G(o).replace(/\.jsonl(?:\.zst)?$/u,""),f=(t.source==="claude_code"?l.find(y=>y.sessionId===p&&y.type==="user"&&typeof y.cwd=="string"&&Ee(y.cwd)):void 0)?.cwd??d.cwd,b=t.source==="claude_code"?it(l,p):ot(d.title,p);if(t.source==="grok_build"&&o.endsWith("updates.jsonl"))try{let y=E(JSON.parse(await Z(t,ie(Vt(o),"summary.json")))),m=E(y.info);m.id===p&&(f=m.cwd,typeof y.generated_title=="string"&&(b=y.generated_title.slice(0,500)))}catch{}i.push({nativeSessionId:p,sourceInstanceId:t.instanceId,path:o,title:b,cwd:typeof f=="string"&&Ee(f)?f:null,updatedAt:a.mtime.toISOString(),storageRevision:[a.dev,a.ino,a.size,a.mtimeMs,a.ctimeMs].join(":")})}catch(a){if(a.code==="ENOENT")continue;i.push({nativeSessionId:G(o||t.root),sourceInstanceId:t.instanceId,path:o,title:G(o||t.root),cwd:null,updatedAt:new Date(0).toISOString(),issue:a instanceof Error?a.message:"Unable to inspect native session"})}if(i.length>n)break}return{items:i.slice(0,n),nextCursor:i.length>n?i[n-1].path:null}}u(Rr,"listSessions");async function xr(t,e){if(t.source!=="claude_code")return{revision:"",branches:[]};if(e.issue)throw new Error(e.issue);if(e.sourceInstanceId!==t.instanceId)throw new Error("Native session belongs to another selected source.");let n=await Z(t,e.path),s=K(H({path:G(e.path),text:n}));if(s.sessionId!==e.nativeSessionId)throw new Error("Native session changed identity.");return{revision:S(n),branches:s.branches()}}u(xr,"inspectSessionBranches");async function Cr(t,e,n={}){if(e.issue)throw new Error(e.issue);if(e.sourceInstanceId!==t.instanceId)throw new Error("Native session belongs to another selected source.");let s;if(t.acquisition==="sqlite")s=[rt(t,e.nativeSessionId)];else if(t.acquisition==="bundle"){let o=e.path.slice(0,-13);s=await Promise.all(["manifest.json","events.jsonl","session-branch.json"].map(async a=>({path:a,text:await Z(t,`${o}${a}`)})))}else s=[{path:G(e.path||t.root).replace(/\.zst$/u,""),text:await Z(t,e.path)}];if(n.expectedBranchRevision&&!n.branchLeafId)throw new Error("Choose a branch before supplying its revision.");if(t.source==="claude_code"){let o=s[0],a=K(H(o));if(a.sessionId!==e.nativeSessionId)throw new Error("Native session changed identity.");if(n.branchAnchor){if(n.branchLeafId||n.expectedBranchRevision)throw new Error("Choose either a frozen branch snapshot or a followed branch anchor.");if(a.select(n.branchAnchor.leafId).chainHash!==n.branchAnchor.chainHash)throw new Error("The selected branch history changed. Review and select it again before syncing.");let l=a.leaves.filter(c=>a.select(c.uuid).chain.some(d=>d.uuid===n.branchAnchor.leafId));if(l.length!==1)throw new Error("The selected branch diverged. Pause this connection and choose its branch again.");n={...n,branchLeafId:l[0].uuid}}if(n.expectedBranchRevision&&S(o.text)!==n.expectedBranchRevision)throw new Error("This conversation changed. Refresh its branches and choose again.");if(n.branchLeafId){if(!a.leaves.some(r=>r.uuid===n.branchLeafId))throw new Error("The selected Claude branch is no longer a leaf. Refresh and choose again.");s=[{...o,text:a.select(n.branchLeafId).chain.map(r=>JSON.stringify(r)).join(`
28
+ `)+`
29
+ `}]}}else if(n.expectedBranchRevision||n.branchAnchor)throw new Error("Branch revision selection is only supported for Claude Code.");let i=ze({source:t.source,files:s,acquisition:{machineId:t.machineId,sourceInstanceId:t.instanceId},...n});if(i.issues.length&&i.issues.every(o=>o.code==="no_user_request"))throw new re;if(i.issues.length)throw new Error(i.issues.map(o=>o.message).join("; "));if(t.acquisition==="sqlite"&&i.sessions.some(o=>o.sessionId!==e.nativeSessionId))throw new Error("Native session changed identity.");return{files:s,preview:i,branchLeafId:n.branchLeafId}}u(Cr,"readSession");import{DatabaseSync as tn}from"node:sqlite";import{mkdir as nn,chmod as ut}from"node:fs/promises";import{join as sn}from"node:path";var oe={reconcileMs:3e4,heartbeatMs:1e4,staleMs:6e4,maxPending:1e4,maxBytes:1073741824,batchCases:20,batchBytes:1048576};function Mr(t,e){if(e.id!==t.id||e.teamId!==t.teamId||e.projectId!==t.projectId||e.machineId!==t.source.machineId||e.sourceInstanceId!==t.source.instanceId||e.sourceRoot!==t.source.root||e.source!==t.source.source)throw new Error("The hosted destination belongs to another source or workspace.");return{taskDatasetId:e.taskDatasetId,conversationDatasetId:e.conversationDatasetId}}u(Mr,"collectorDestinations");function pt(t){let e={tasks:null,conversations:null};if(!t.accountBaseUrl||!t.destinations)return e;let n;try{n=new URL(t.accountBaseUrl)}catch{return e}if(n.protocol!=="https:"&&!(n.protocol==="http:"&&["localhost","127.0.0.1"].includes(n.hostname))||n.username||n.password||n.search||n.hash||n.pathname!=="/")return e;let s=u(i=>i?`${n.origin}/console/datasets/${encodeURIComponent(i)}/tasks?project=${encodeURIComponent(t.projectId)}&connection=${encodeURIComponent(t.id)}`:null,"link");return{tasks:s(t.destinations.taskDatasetId),conversations:s(t.destinations.conversationDatasetId)}}u(pt,"collectorDestinationLinks");var ae=class{static{u(this,"CollectorProgress")}database;constructor(e){this.database=e,e.exec(`
30
+ CREATE TABLE IF NOT EXISTS backfills(connection_id TEXT PRIMARY KEY,discovered INTEGER NOT NULL DEFAULT 0);
31
+ CREATE TABLE IF NOT EXISTS backfill_units(connection_id TEXT NOT NULL,session_key TEXT NOT NULL,state TEXT NOT NULL,error TEXT,PRIMARY KEY(connection_id,session_key));
32
+ CREATE TABLE IF NOT EXISTS backfill_operations(operation_id TEXT PRIMARY KEY,connection_id TEXT NOT NULL,session_key TEXT NOT NULL,admitted INTEGER NOT NULL DEFAULT 0);
33
+ `)}reset(e){for(let n of["backfill_operations","backfill_units","backfills"])this.database.prepare(`DELETE FROM ${n} WHERE connection_id=?`).run(e)}select(e,n){this.database.prepare("INSERT OR IGNORE INTO backfills(connection_id) VALUES(?)").run(e),this.database.prepare("SELECT discovered FROM backfills WHERE connection_id=?").get(e)?.discovered||this.database.prepare("INSERT OR IGNORE INTO backfill_units VALUES(?,?,'reading',NULL)").run(e,n)}tracks(e,n){let s=this.database.prepare("SELECT state FROM backfill_units WHERE connection_id=? AND session_key=?").get(e,n);return s?.state==="reading"||s?.state==="error"}queued(e,n,s){this.tracks(n,s)&&this.database.prepare("INSERT OR IGNORE INTO backfill_operations VALUES(?,?,?,0)").run(e,n,s)}retained(e,n,s){if(!this.tracks(e,n))return;let i=this.database.prepare("SELECT id FROM pending WHERE connection_id=? AND json_extract(payload,'$.sessionKey')=?").all(e,s);for(let o of i)this.queued(String(o.id),e,n)}read(e,n,s){if(!this.tracks(e,n))return;let i=this.database.prepare("SELECT COUNT(*) AS n FROM backfill_operations WHERE connection_id=? AND session_key=? AND admitted=0").get(e,n);this.database.prepare("UPDATE backfill_units SET state=?,error=NULL WHERE connection_id=? AND session_key=?").run(Number(i?.n)?"queued":s?"complete":"skipped",e,n)}failed(e,n,s){this.tracks(e,n)&&this.database.prepare("UPDATE backfill_units SET state='error',error=? WHERE connection_id=? AND session_key=?").run(s.slice(0,500),e,n)}discovered(e){this.database.prepare("INSERT INTO backfills VALUES(?,1) ON CONFLICT(connection_id) DO UPDATE SET discovered=1").run(e)}acknowledge(e){let n=this.database.prepare("SELECT connection_id,session_key FROM backfill_operations WHERE operation_id=?").get(e);if(!n)return;this.database.prepare("UPDATE backfill_operations SET admitted=1 WHERE operation_id=?").run(e);let s=this.database.prepare("SELECT COUNT(*) AS n FROM backfill_operations WHERE connection_id=? AND session_key=? AND admitted=0").get(n.connection_id,n.session_key);Number(s?.n)||this.database.prepare("UPDATE backfill_units SET state='complete' WHERE connection_id=? AND session_key=? AND state='queued'").run(n.connection_id,n.session_key)}status(e){let n=this.database.prepare("SELECT discovered FROM backfills WHERE connection_id=?").get(e),s=this.database.prepare("SELECT state,COUNT(*) AS n FROM backfill_units WHERE connection_id=? GROUP BY state").all(e),i=u(a=>Number(s.find(r=>r.state===a)?.n??0),"count"),o=s.reduce((a,r)=>a+Number(r.n),0);return{stage:n?.discovered?i("error")?"attention":i("reading")?"reading":i("queued")?"uploading":"complete":"discovering",total:o,admitted:i("complete"),skipped:i("skipped"),failed:i("error")}}};var z=class t{static{u(this,"CollectorStore")}database;progress;constructor(e){this.database=e,this.progress=new ae(e)}static async open(e){await nn(e,{recursive:!0,mode:448}),await ut(e,448);let n=sn(e,"collector.sqlite"),s=new tn(n);return await ut(n,384),s.exec(`PRAGMA journal_mode=WAL; PRAGMA synchronous=FULL; PRAGMA busy_timeout=1000;
34
+ CREATE TABLE IF NOT EXISTS settings(key TEXT PRIMARY KEY,value TEXT NOT NULL);
35
+ CREATE TABLE IF NOT EXISTS connections(id TEXT PRIMARY KEY,config TEXT NOT NULL,admitted INTEGER NOT NULL DEFAULT 0,error TEXT);
36
+ CREATE TABLE IF NOT EXISTS admitted_boundaries(connection_id TEXT NOT NULL,boundary_id TEXT NOT NULL,PRIMARY KEY(connection_id,boundary_id));
37
+ CREATE TABLE IF NOT EXISTS source_scans(connection_id TEXT NOT NULL,session_key TEXT NOT NULL,revision TEXT NOT NULL,PRIMARY KEY(connection_id,session_key));
38
+ CREATE TABLE IF NOT EXISTS checkpoints(connection_id TEXT NOT NULL,session_key TEXT NOT NULL,boundary_id TEXT NOT NULL,revision TEXT NOT NULL,PRIMARY KEY(connection_id,session_key,boundary_id));
39
+ CREATE TABLE IF NOT EXISTS pending(id TEXT PRIMARY KEY,connection_id TEXT NOT NULL,payload TEXT NOT NULL,bytes INTEGER NOT NULL,attempts INTEGER NOT NULL DEFAULT 0,retry_at INTEGER NOT NULL DEFAULT 0,created_at INTEGER NOT NULL);
40
+ INSERT OR IGNORE INTO settings VALUES('desiredState','stopped');`),new t(s)}close(){this.database.close()}setting(e){let n=this.database.prepare("SELECT value FROM settings WHERE key=?").get(e);return typeof n?.value=="string"?n.value:null}set(e,n){this.database.prepare("INSERT INTO settings VALUES(?,?) ON CONFLICT(key) DO UPDATE SET value=excluded.value").run(e,n)}connections(){return this.database.prepare("SELECT config FROM connections ORDER BY id").all().map(e=>JSON.parse(String(e.config)))}put(e){this.database.exec("BEGIN IMMEDIATE");try{let n=this.connections().find(i=>i.id===e.id);if(n&&n.revision>e.revision){this.database.exec("COMMIT");return}let s=!!n&&(n.source.instanceId!==e.source.instanceId||n.projectId!==e.projectId||n.teamId!==e.teamId||n.apiBaseUrl!==e.apiBaseUrl||n.account!==e.account);if(s&&(e={...e,destinations:void 0}),n&&(s||n.since!==e.since)){this.progress.reset(e.id),this.database.prepare("DELETE FROM settings WHERE key=?").run(`errors:${e.id}`),this.database.prepare("DELETE FROM settings WHERE key=?").run(`syncAcknowledged:${e.id}`),e={...e,completedSyncRevision:0},this.error(e.id,null);for(let i of["source_scans","checkpoints","pending"])this.database.prepare(`DELETE FROM ${i} WHERE connection_id=?`).run(e.id);s&&(this.database.prepare("DELETE FROM admitted_boundaries WHERE connection_id=?").run(e.id),this.database.prepare("UPDATE connections SET admitted=0 WHERE id=?").run(e.id),this.database.prepare("DELETE FROM settings WHERE key=?").run(`lastAdmission:${e.id}`))}else n&&(e={...e,requestedSyncRevision:Math.max(n.requestedSyncRevision??0,e.requestedSyncRevision??0),completedSyncRevision:Math.max(n.completedSyncRevision??0,e.completedSyncRevision??0)});this.database.prepare("INSERT INTO connections(id,config) VALUES(?,?) ON CONFLICT(id) DO UPDATE SET config=excluded.config").run(e.id,JSON.stringify(e)),this.database.exec("COMMIT")}catch(n){throw this.database.exec("ROLLBACK"),n}}error(e,n){this.database.prepare("UPDATE connections SET error=? WHERE id=?").run(n?.slice(0,500)??null,e)}queued(e){return Number((e?this.database.prepare("SELECT COUNT(*) AS n FROM pending WHERE connection_id=?").get(e):this.database.prepare("SELECT COUNT(*) AS n FROM pending").get())?.n??0)}sourceChanged(e,n,s){return this.database.prepare("SELECT revision FROM source_scans WHERE connection_id=? AND session_key=?").get(e,n)?.revision!==s}scanned(e,n,s){this.database.prepare("INSERT INTO source_scans VALUES(?,?,?) ON CONFLICT(connection_id,session_key) DO UPDATE SET revision=excluded.revision").run(e,n,s)}changed(e,n,s,i){return this.database.prepare("SELECT revision FROM checkpoints WHERE connection_id=? AND session_key=? AND boundary_id=?").get(e,n,s)?.revision!==i}enqueue(e,n,s){let i=JSON.stringify(e),o=Buffer.byteLength(i);this.database.exec("BEGIN IMMEDIATE");try{let a=this.database.prepare("SELECT COUNT(*) AS count,COALESCE(SUM(bytes),0) AS bytes FROM pending").get();if(Number(a.count)>=oe.maxPending||Number(a.bytes)+o>oe.maxBytes)throw new Error("Buffer full. Restore connectivity before acquiring more history.");this.database.prepare("INSERT OR IGNORE INTO pending(id,connection_id,payload,bytes,created_at) VALUES(?,?,?,?,?)").run(e.operationId,e.connectionId,i,o,Date.now());let r=this.database.prepare("INSERT INTO checkpoints VALUES(?,?,?,?) ON CONFLICT(connection_id,session_key,boundary_id) DO UPDATE SET revision=excluded.revision");for(let l of n)r.run(e.connectionId,e.sessionKey,l.id,l.revision);s&&this.progress.queued(e.operationId,e.connectionId,s),this.database.exec("COMMIT")}catch(a){throw this.database.exec("ROLLBACK"),a}}next(e){let n=this.database.prepare("SELECT payload,attempts FROM pending WHERE connection_id=? AND retry_at <= ? ORDER BY created_at,id LIMIT 1").get(e,Date.now());return n?{entry:JSON.parse(String(n.payload)),attempts:Number(n.attempts)}:null}acknowledge(e){this.database.exec("BEGIN IMMEDIATE");try{let n=this.database.prepare("DELETE FROM pending WHERE id=?").run(e.operationId);if(Number(n.changes)>0){this.progress.acknowledge(e.operationId),this.set(`lastAdmission:${e.connectionId}`,new Date().toISOString());let s=0,i=this.database.prepare("INSERT OR IGNORE INTO admitted_boundaries VALUES(?,?)");for(let o of e.boundaryIds)s+=Number(i.run(e.connectionId,o).changes);this.database.prepare("UPDATE connections SET admitted=admitted+? WHERE id=?").run(s,e.connectionId)}this.database.exec("COMMIT")}catch(n){throw this.database.exec("ROLLBACK"),n}}retry(e,n){let s=Math.min(6e4,1e3*2**Math.min(n,6));this.database.prepare("UPDATE pending SET attempts=?,retry_at=? WHERE id=?").run(n+1,Date.now()+s+Math.floor(Math.random()*Math.max(1,s/5)),e)}status(){let e=this.setting("heartbeatAt"),n=Number(this.setting("pid"))||null,s=!1;try{n&&(process.kill(n,0),s=!0)}catch{}return{schemaVersion:1,running:s&&!!e&&Date.now()-Date.parse(e)<oe.staleMs,desiredState:this.setting("desiredState")==="running"?"running":"stopped",pid:n,heartbeatAt:e,connections:this.database.prepare("SELECT id,config,admitted,error FROM connections ORDER BY id").all().map(i=>{let o=JSON.parse(String(i.config));return{id:String(i.id),state:o.state,projectId:o.projectId,teamId:o.teamId,accountBaseUrl:o.accountBaseUrl??null,sourceInstanceId:o.source.instanceId,sourceRoot:o.source.root,source:o.source.source,queued:this.queued(String(i.id)),admitted:Number(i.admitted),error:typeof i.error=="string"?i.error:null,backfill:this.progress.status(String(i.id)),pendingBytes:Number(this.database.prepare("SELECT COALESCE(SUM(bytes),0) AS bytes FROM pending WHERE connection_id=?").get(String(i.id))?.bytes??0),lastAdmissionAt:this.setting(`lastAdmission:${i.id}`),requestedSyncRevision:o.requestedSyncRevision??0,completedSyncRevision:o.completedSyncRevision??0,acknowledgedSyncRevision:Number(this.setting(`syncAcknowledged:${i.id}`))||0,destinationLinks:pt(o)}})}}};import{randomUUID as hn}from"node:crypto";import{createHash as rn}from"node:crypto";import{constants as B}from"node:fs";import{chmod as ht,copyFile as on,lstat as q,mkdir as an,mkdtemp as cn,open as be,realpath as ce,rename as ln,rm as gt}from"node:fs/promises";import{dirname as ft,isAbsolute as dn,join as j,relative as pn,resolve as un,sep as fn}from"node:path";var Et="appimage-runtime",mn='const p=require("node:path");const u=require("node:url");const entry=p.join(process.env.APPDIR,"resources","cli","cli.js");process.argv.splice(1,0,entry);import(u.pathToFileURL(entry).href);';async function we(t){let e=un(t);for(let s=e;;s=ft(s)){let i=await q(s).catch(o=>{if(o.code==="ENOENT")return null;throw o});if(i&&(!i.isDirectory()||i.isSymbolicLink()))throw new Error("Collector runtime storage must use real directories.");if(ft(s)===s)break}await an(e,{recursive:!0,mode:448});let n=await q(e);if(!n.isDirectory()||n.isSymbolicLink()||n.uid!==process.getuid())throw new Error("Collector runtime storage must belong to the current user.");await ht(e,448)}u(we,"privateDirectory");async function _e(t){let e=rn("sha256"),n=await be(t,B.O_RDONLY|B.O_NOFOLLOW);try{for await(let s of n.createReadStream({autoClose:!1}))e.update(s)}finally{await n.close()}return e.digest("hex")}u(_e,"digest");async function ye(t){let e=await be(t,B.O_RDONLY|B.O_NOFOLLOW);try{await e.sync()}finally{await e.close()}}u(ye,"sync");async function mt(t,e){let n=await q(t);if(!n.isFile()||n.isSymbolicLink()||n.uid!==process.getuid()||(n.mode&511)!==320||await _e(t)!==e)throw new Error("Retained AppImage runtime failed its ownership or integrity check.")}u(mt,"verify");async function yt(t,e=process.env){if(process.platform!=="linux"||!e.APPIMAGE||!e.APPDIR)return null;let n=await ce(e.APPDIR),s=await ce(t.executable),i=pn(n,s);if(dn(i)||i===".."||i.startsWith(`..${fn}`))return null;let o=t.args[0];if(!o||await ce(o)!==j(n,"resources","cli","cli.js"))throw new Error("AppImage collection requires its bundled CLI entrypoint.");let a=await ce(e.APPIMAGE),r=await q(a);if(!r.isFile()||r.size>1024*1024*1024)throw new Error("AppImage runtime is unavailable or exceeds the retained size limit.");let l=Buffer.alloc(11),c=await be(a,B.O_RDONLY|B.O_NOFOLLOW);try{await c.read(l,0,l.length,0)}finally{await c.close()}if(!l.subarray(0,4).equals(Buffer.from([127,69,76,70]))||!l.subarray(8,11).equals(Buffer.from([65,73,2])))throw new Error("Collector runtime must be a type-2 AppImage.");let d=await _e(a);await we(t.directory);let p=j(t.directory,Et);await we(p);let g=j(p,d),f=j(g,"openpond.AppImage"),b=await q(g).catch(y=>{if(y.code==="ENOENT")return null;throw y});if(b){if(!b.isDirectory()||b.isSymbolicLink()||b.uid!==process.getuid()||(b.mode&511)!==448)throw new Error("Retained runtime directory is not private.");await mt(f,d)}else{let y=await cn(j(p,".stage-"));try{let m=j(y,"openpond.AppImage");await on(a,m,B.COPYFILE_EXCL),await ht(m,320);let h=await q(a);if(r.dev!==h.dev||r.ino!==h.ino||r.size!==h.size||r.mtimeMs!==h.mtimeMs||await _e(m)!==d)throw new Error("AppImage changed while preparing the collector runtime; retry installation.");await ye(m),await ye(y);try{await ln(y,g)}catch(_){if(!["EEXIST","ENOTEMPTY"].includes(_.code??""))throw _}await mt(f,d),await ye(p)}finally{await gt(y,{recursive:!0,force:!0})}}return{executable:f,args:["-e",mn,"--",...t.args.slice(1)]}}u(yt,"retainAppImageRuntime");async function wt(t){let e=j(t,Et),n=await q(e).catch(s=>{if(s.code==="ENOENT")return null;throw s});if(n){if(await we(t),!n.isDirectory()||n.isSymbolicLink()||n.uid!==process.getuid())throw new Error("Refusing to remove unowned collector runtime storage.");await gt(e,{recursive:!0})}}u(wt,"removeAppImageRuntimes");import{execFile as gn}from"node:child_process";import{promisify as En}from"node:util";import{mkdir as Ie,writeFile as le,rm as Q,rename as yn}from"node:fs/promises";import{homedir as It}from"node:os";import{isAbsolute as _t,join as $}from"node:path";var St=En(gn),k=u(async(t,e)=>{await St(t,e,{timeout:15e3,maxBuffer:16384,windowsHide:!0})},"command"),X=u(t=>t.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;"),"xml"),bt=u(t=>`"${t.replace(/\\/gu,"\\\\").replace(/"/gu,'\\"').replace(/%/gu,"%%").replace(/\$/gu,"$$")}"`,"systemd");function ve(t){return`openpond-import-${S(t).slice(0,16)}`}u(ve,"identity");async function li(t,e){let n=await z.open(t);try{n.put(e)}finally{n.close()}}u(li,"configureCollector");async function Oe(t){let e=await z.open(t);try{return e.status()}finally{e.close()}}u(Oe,"collectorStatus");async function Se(t,e,n){let s=await z.open(t);try{if(e==="start"||e==="stop")s.set("desiredState",e==="start"?"running":"stopped");else if(e==="sync")s.set("syncNow","yes");else{let i=s.connections().find(o=>o.id===n);if(!i)throw new Error("Select a retained connection.");s.put({...i,state:e==="pause"?"paused":e==="resume"?"active":"disconnected"})}return s.status()}finally{s.close()}}u(Se,"controlCollector");async function di(t){if(!_t(t.directory)||!_t(t.executable)||[t.directory,t.executable,...t.args].some(a=>/[\r\n\0]/u.test(a)))throw new Error("Collector service requires absolute paths and single-line arguments.");let e=await yt(t);e&&(t={...t,...e,environment:{...t.environment,ELECTRON_RUN_AS_NODE:"1",APPIMAGE_EXTRACT_AND_RUN:"1"}});let n=Object.entries(t.environment??{});if(n.some(([a,r])=>!["OPENPOND_HOME","ELECTRON_RUN_AS_NODE","APPIMAGE_EXTRACT_AND_RUN"].includes(a)||typeof r!="string"||/[\r\n\0]/u.test(r)))throw new Error("Unsupported service environment setting.");let s=t.home??It(),i=ve(t.directory),o=[...t.args,"import","service","run","--collector-dir",t.directory];if(process.platform==="linux"){let a=$(s,".config/systemd/user");await Ie(a,{recursive:!0,mode:448}),await wn($(a,`${i}.service`),`[Unit]
41
+ Description=OpenPond conversation importer
42
+ After=network-online.target
43
+ [Service]
44
+ Type=simple
45
+ ${n.map(([r,l])=>`Environment=${bt(`${r}=${l}`)}`).join(`
46
+ `)}
47
+ ExecStart=${[t.executable,...o].map(bt).join(" ")}
48
+ Restart=on-failure
49
+ RestartSec=5
50
+ UMask=0077
51
+ NoNewPrivileges=true
52
+ [Install]
53
+ WantedBy=default.target
54
+ `,{mode:384}),await k("systemctl",["--user","daemon-reload"]),await k("systemctl",["--user","enable",`${i}.service`])}else if(process.platform==="darwin"){let a=$(s,"Library/LaunchAgents");await Ie(a,{recursive:!0,mode:448});let r=$(a,`${i}.plist`),l=!1;try{await k("launchctl",["print",`gui/${process.getuid()}/${i}`]),l=!0}catch{}l&&await k("launchctl",["bootout",`gui/${process.getuid()}/${i}`]),await le(r,`<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>Label</key><string>${i}</string><key>ProgramArguments</key><array>${[t.executable,...o].map(c=>`<string>${X(c)}</string>`).join("")}</array><key>EnvironmentVariables</key><dict>${n.map(([c,d])=>`<key>${X(c)}</key><string>${X(d)}</string>`).join("")}</dict><key>RunAtLoad</key><true/><key>KeepAlive</key><dict><key>SuccessfulExit</key><false/></dict><key>ThrottleInterval</key><integer>5</integer></dict></plist>`,{mode:384}),await k("launchctl",["bootstrap",`gui/${process.getuid()}`,r])}else if(process.platform==="win32"){let a=(await St("whoami",[],{timeout:5e3,maxBuffer:1024})).stdout.trim(),r=$(t.directory,"scheduled-task.xml");await Ie(t.directory,{recursive:!0});let l=u(p=>`"${p.replace(/(\\*)"/gu,'$1$1\\"').replace(/(\\+)$/u,"$1$1")}"`,"quoted"),c=$(t.directory,"start-collector.ps1"),d=u(p=>`'${p.replace(/'/gu,"''")}'`,"ps");await le(c,`${n.map(([p,g])=>`$env:${p} = ${d(g)}`).join(`
55
+ `)}
56
+ & ${[t.executable,...o].map(d).join(" ")}
57
+ exit $LASTEXITCODE
58
+ `,{mode:384}),await le(r,`<?xml version="1.0"?><Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"><Triggers><LogonTrigger><Enabled>true</Enabled><UserId>${X(a)}</UserId></LogonTrigger></Triggers><Principals><Principal id="Owner"><UserId>${X(a)}</UserId><LogonType>InteractiveToken</LogonType><RunLevel>LeastPrivilege</RunLevel></Principal></Principals><Settings><MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy><DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries><StopIfGoingOnBatteries>false</StopIfGoingOnBatteries><ExecutionTimeLimit>PT0S</ExecutionTimeLimit><RestartOnFailure><Interval>PT1M</Interval><Count>999</Count></RestartOnFailure></Settings><Actions Context="Owner"><Exec><Command>powershell.exe</Command><Arguments>${X(["-NoProfile","-NonInteractive","-File",c].map(l).join(" "))}</Arguments></Exec></Actions></Task>`,{mode:384}),await k("schtasks",["/Create","/TN",i,"/XML",r,"/F"])}else throw new Error("This OS has no qualified per-user supervisor. Run the collector in the foreground.");return{name:i,platform:process.platform,status:await Oe(t.directory)}}u(di,"installCollectorService");async function pi(t,e=It()){await Se(t,"stop");let n=ve(t);if(process.platform==="linux")await k("systemctl",["--user","disable","--now",`${n}.service`]),await Q($(e,".config/systemd/user",`${n}.service`),{force:!0}),await k("systemctl",["--user","daemon-reload"]);else if(process.platform==="darwin")await k("launchctl",["bootout",`gui/${process.getuid()}/${n}`]),await Q($(e,"Library/LaunchAgents",`${n}.plist`),{force:!0});else if(process.platform==="win32")await k("schtasks",["/End","/TN",n]),await k("schtasks",["/Delete","/TN",n,"/F"]),await Q($(t,"scheduled-task.xml"),{force:!0}),await Q($(t,"start-collector.ps1"),{force:!0});else throw new Error("No per-user supervisor is available.");return process.platform==="linux"&&await wt(t),Oe(t)}u(pi,"uninstallCollectorService");async function ui(t){await Se(t,"start");let e=ve(t);try{if(process.platform==="linux")await k("systemctl",["--user","restart",`${e}.service`]);else if(process.platform==="darwin")await k("launchctl",["kickstart","-k",`gui/${process.getuid()}/${e}`]);else if(process.platform==="win32")await k("schtasks",["/Run","/TN",e]);else throw new Error("No per-user supervisor is available.")}catch(n){throw await Se(t,"stop"),n}return Oe(t)}u(ui,"startCollectorService");async function wn(t,e,n){let s=`${t}.${hn()}.tmp`;try{await le(s,e,{...n,flag:"wx"}),await yn(s,t)}finally{await Q(s,{force:!0})}}u(wn,"atomicServiceFile");import{homedir as _n}from"node:os";import{join as vt,resolve as bn}from"node:path";import{randomUUID as In}from"node:crypto";import{mkdir as Sn,open as vn,readFile as On}from"node:fs/promises";function Tn(t=process.env.OPENPOND_HOME||vt(_n(),".openpond")){return bn(t,"conversation-importer")}u(Tn,"collectorDirectory");async function wi(t=Tn()){await Sn(t,{recursive:!0,mode:448});let e=vt(t,"machine-id");try{let s=await vn(e,"wx",384);try{await s.writeFile(In()),await s.sync()}finally{await s.close()}}catch(s){if(s.code!=="EEXIST")throw s}let n=(await On(e,"utf8")).trim();if(!/^[a-f0-9-]{36}$/u.test(n))throw new Error("Collector machine identity is invalid; restore its retained state.");return n}u(wi,"collectorMachineId");export{Re as a,jn as b,Ws as c,re as d,Rr as e,xr as f,Cr as g,oe as h,Mr as i,z as j,li as k,Oe as l,Se as m,di as n,pi as o,ui as p,Tn as q,wi as r};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{e as H,j as R}from"./chunk-QNG27G3T.js";import{v as I,z as C}from"./chunk-EIRYMSEG.js";import{l as k,m as b}from"./chunk-KGNCKIFP.js";import{a as h}from"./chunk-FTQLQJQV.js";import{promises as s}from"node:fs";import n from"node:path";import{execFile as O}from"node:child_process";import{promisify as A}from"node:util";var T=A(O);async function v(e,i,a={}){return(await T("git",["-C",e,...i],{encoding:"utf8",timeout:3e4,maxBuffer:8388608,env:{...process.env,...a}})).stdout.trim()}h(v,"candidateGit");async function j(e,i=I,a=!1){if(e.profileRef.source!=="local"&&!a)throw new Error("This Git adapter requires the actual installed local Profile owner; hosted adoption needs its published-source owner.");let r=await i(e.profileRef);if(r.error||r.mode!=="local"||r.activeProfile!==e.profileRef.profileId||!r.repoPath||!r.sourcePath)throw new Error("The original Profile owner is unavailable.");let l=await s.realpath(r.repoPath),p=await s.realpath(r.sourcePath),f=n.relative(l,p);if(f.startsWith("..")||n.isAbsolute(f))throw new Error("Profile source escapes its actual Git owner.");return{profile:r,repo:l,source:p,sourceRelative:f}}h(j,"originalCandidateProfile");async function ce(e,i,a=!0){if(!/^[a-f0-9]{40}$/.test(i)||await v(e,["rev-parse","HEAD"])!==i)throw new Error("The original Profile Git revision changed.");if(a&&await v(e,["status","--porcelain","--untracked-files=all"]))throw new Error("Commit or reconcile changes in the original Profile before this operation.")}h(ce,"assertCandidateGitHead");async function me(e,i){let a=await j(e.state,e.loadProfile,e.allowRemoteSnapshot),r=n.join(e.storeDir,"library","harnesses","profile-candidate-staging");await s.mkdir(r,{recursive:!0,mode:448});let l=await s.mkdtemp(n.join(r,"source-"));await s.rmdir(l),await v(a.repo,["worktree","add","--detach",l,e.commit]);try{let p=await C({repoPath:l,profileId:e.state.profileRef.profileId});if(p.error||!p.sourcePath)throw new Error("The staged original Profile cannot be loaded.");return await i({root:l,profile:p,repo:a.repo,source:p.sourcePath})}finally{await v(a.repo,["worktree","remove","--force",l]).catch(()=>{}),await s.rm(l,{recursive:!0,force:!0})}}h(me,"withCandidateProfileWorktree");function y(e){if(!e||n.isAbsolute(e)||e.includes("\\")||e.split("/").some(i=>!i||i==="."||i===".."))throw new Error("Original Profile patch path is not contained.");return e}h(y,"portable");async function pe(e){let i=e.base.manifest.metadata.profileSourceBindings;if(!Array.isArray(i))throw new Error("The original release needs compiler source bindings before candidate adoption.");let a=e.state.component.path,r=e.state.component,l=new Map(i.map(t=>{if(!t||typeof t!="object"||typeof t.releasedPath!="string"||typeof t.profileRelativePath!="string")throw new Error("Original Profile source binding is invalid.");return[y(t.releasedPath),y(t.profileRelativePath)]})),p=r.kind==="instruction"&&a==="instructions/system.md"&&e.base.manifest.metadata.profileInstructionSourcePath==="instructions/system.md"&&!l.has(a),f=l.get(a)??(p?"instructions/system.md":void 0),S=r.kind==="workflow"?`workflows/${r.workflowId}/`:r.kind==="agent"?a.split("/").slice(0,2).join("/")+"/":n.posix.dirname(a)+"/",w=f?n.posix.dirname(f)+"/":null;if(r.kind==="workflow"&&!f&&(w=S),r.kind==="agent"){let t=e.profile.agents.find(o=>a.startsWith(`agents/${o.id}/`));if(!t)throw new Error("The selected Agent original source is unavailable.");let c=y(t.path);w=((await s.lstat(n.join(e.source,c))).isDirectory()?c:n.posix.dirname(c))+"/"}let E=new Map(e.base.sourceFiles.map(t=>[t.path,t])),x=new Map(e.candidate.sourceFiles.map(t=>[t.path,t])),g=new Map;for(let t of new Set([...E.keys(),...x.keys()])){let c=E.get(t),m=x.get(t);if(c?.asset.contentHash===m?.asset.contentHash)continue;if(c&&c.asset.visibility!=="policy"||m&&m.asset.visibility!=="policy")throw new Error("A candidate cannot change protected Profile source.");let o=l.get(t)??(p&&t===a?f:void 0);if(!o&&t.startsWith(S)&&w&&(o=w+t.slice(S.length)),!o&&t==="workflows/catalog.json"&&[...l.keys()].some(P=>/^workflows\/[^/]+\/(PROMPT\.md|ACTION\.json)$/.test(P))||!o&&t==="dependency-lock/profile-import.json")continue;if(!o)throw new Error(`The selected component has no original Profile source mapping: ${t}`);if(o=y(o),o!==f&&!(r.kind!=="instruction"&&w&&o.startsWith(w)))throw new Error("Candidate patch changes a different original Profile component.");if(H(o))throw new Error("Candidate patch crosses the protected Profile evaluation closure.");let u=g.get(o),d=m?.bytes??null;if(u&&(u.before!==(c?.asset.contentHash??null)||b(u.bytes===null?null:Array.from(u.bytes))!==b(d===null?null:Array.from(d))))throw new Error("Public component aliases disagree on the original source edit.");g.set(o,{before:p&&t===a?null:c?.asset.contentHash??null,bytes:d})}for(let[t,c]of g){let m=n.join(e.source,...t.split("/")),o=n.dirname(m);for(;!await s.stat(o).catch(()=>null);)o=n.dirname(o);let u=n.relative(await s.realpath(e.source),await s.realpath(o));if(u.startsWith("..")||n.isAbsolute(u))throw new Error("Candidate patch escapes the staged Profile source.");let d=await s.lstat(m).catch(()=>null);if(d?.isSymbolicLink()||d&&!d.isFile())throw new Error("Original source patch needs a regular file.");let P=d?await s.readFile(m):null;if((P?k(P):null)!==c.before)throw new Error("Original source bytes differ from the exact candidate baseline.");c.bytes===null?await s.rm(m):(await s.mkdir(n.dirname(m),{recursive:!0}),await s.writeFile(m,c.bytes,{mode:d?.mode??384}))}return[...g.keys()]}h(pe,"applyCandidateProfileSource");function fe(e){let i=e.base.manifest.metadata.profileRepositoryId;return R({storeDir:e.storeDir,workspaceId:e.state.ownerWorkspaceId,name:e.base.manifest.name,profile:e.profile,sourceRevision:e.sourceRevision,...typeof i=="string"?{repositoryId:i}:{}})}h(fe,"compileOriginalCandidateProfile");export{v as a,j as b,ce as c,me as d,pe as e,fe as f};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as r}from"./chunk-FTQLQJQV.js";import i from"node:path";function o(t){let n=t.environment.metadata.runtimeSourceTasksetId,e=n===void 0?t.id:n;if(typeof e!="string"||!e||e==="."||e===".."||i.basename(e)!==e||e.includes("\\"))throw new Error(`Taskset ${t.id} has an invalid package directory identity.`);return e}r(o,"tasksetPackageDirectoryId");export{o as a};