openpond 0.2.71 → 0.2.72

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 (274) hide show
  1. package/dist/app-server.js +1 -1
  2. package/dist/chunks/{acp-VWPJ2EL4.js → acp-7A2UPCG5.js} +1 -1
  3. package/dist/chunks/{acp-agent-OZHZMQ6R.js → acp-agent-AGALGR6V.js} +1 -1
  4. package/dist/chunks/{app-layer-OHPIYEOJ.js → app-layer-DUCNCJ2X.js} +1 -1
  5. package/dist/chunks/{app-server-evaluations-Y5UEF2Y7.js → app-server-evaluations-SNWXULKD.js} +1 -1
  6. package/dist/chunks/{app-server-harness-services-GUHAIIPS.js → app-server-harness-services-YNMGMKPK.js} +1 -1
  7. package/dist/chunks/{app-server-runtime-CH5STRJP.js → app-server-runtime-BKJ7L6JZ.js} +1 -1
  8. package/dist/chunks/{apps-DNLT6P4J.js → apps-2OWE23BH.js} +1 -1
  9. package/dist/chunks/chunk-2Q2AWPP2.js +2 -0
  10. package/dist/chunks/{chunk-WXG3G2O6.js → chunk-2THZ6GZY.js} +1 -1
  11. package/dist/chunks/{chunk-3JYPUOK4.js → chunk-4JKWCLTQ.js} +1 -1
  12. package/dist/chunks/{chunk-D2V2Y3FB.js → chunk-5TPJ5ECJ.js} +1 -1
  13. package/dist/chunks/{chunk-O5ZOW474.js → chunk-5TTQCT3G.js} +1 -1
  14. package/dist/chunks/{chunk-AVEHWUML.js → chunk-5WFKBZCU.js} +1 -1
  15. package/dist/chunks/{chunk-VJYOKU3C.js → chunk-6OD2FKUS.js} +1 -1
  16. package/dist/chunks/{chunk-SSHE6B7Z.js → chunk-AITV76GO.js} +1 -1
  17. package/dist/chunks/{chunk-PLROXHG2.js → chunk-ATI52WMB.js} +1 -1
  18. package/dist/chunks/{chunk-XJU47QS2.js → chunk-AWD72O3G.js} +1 -1
  19. package/dist/chunks/{chunk-HUMNLSCV.js → chunk-BUMCJHQP.js} +1 -1
  20. package/dist/chunks/{chunk-OTG77H7U.js → chunk-CAYKEJJY.js} +1 -1
  21. package/dist/chunks/{chunk-WAUFXZ5B.js → chunk-CHRED2FK.js} +1 -1
  22. package/dist/chunks/{chunk-USTDWGR4.js → chunk-CQRA5TXF.js} +1 -1
  23. package/dist/chunks/{chunk-ESOIZG2G.js → chunk-CX4U32VO.js} +4 -4
  24. package/dist/chunks/{chunk-PXQZOVSV.js → chunk-DFSQ5HZ7.js} +1 -1
  25. package/dist/chunks/{chunk-GUWNSMGH.js → chunk-EHMA5XS7.js} +1 -1
  26. package/dist/chunks/{chunk-5LKEVB2P.js → chunk-ENY24ZBB.js} +1 -1
  27. package/dist/chunks/{chunk-PJJSQ4ZI.js → chunk-F3IEAU7O.js} +1 -1
  28. package/dist/chunks/{chunk-B7SCVTE6.js → chunk-FOAM3YZQ.js} +1 -1
  29. package/dist/chunks/{chunk-VV4K5YPD.js → chunk-GPGXBKXU.js} +1 -1
  30. package/dist/chunks/{chunk-LMLGEOKV.js → chunk-HA762QYM.js} +1 -1
  31. package/dist/chunks/{chunk-XNPTLJ5Z.js → chunk-HBGTHOOB.js} +1 -1
  32. package/dist/chunks/{chunk-ER2VONWQ.js → chunk-IA6CTX7A.js} +1 -1
  33. package/dist/chunks/{chunk-23YW5PAQ.js → chunk-JALL5NPH.js} +1 -1
  34. package/dist/chunks/{chunk-OQ4RWCYI.js → chunk-JSDGOQ5U.js} +1 -1
  35. package/dist/chunks/{chunk-F2EUZG2W.js → chunk-KOIXRLZZ.js} +1 -1
  36. package/dist/chunks/{chunk-ZG3DBXQG.js → chunk-KRJZ5CW3.js} +1 -1
  37. package/dist/chunks/{chunk-OKPV6MBX.js → chunk-KTQWWCP2.js} +6 -6
  38. package/dist/chunks/{chunk-VND53FAU.js → chunk-KUEVP7WM.js} +1 -1
  39. package/dist/chunks/{chunk-U7D6Q744.js → chunk-L5L3H6CI.js} +1 -1
  40. package/dist/chunks/{chunk-TWLPZHH7.js → chunk-LHTRQAPZ.js} +1 -1
  41. package/dist/chunks/{chunk-SNBFWBJI.js → chunk-MLLMLXKG.js} +1 -1
  42. package/dist/chunks/{chunk-KASHK2U5.js → chunk-MPXOPL7R.js} +1 -1
  43. package/dist/chunks/{chunk-PHZZBXDO.js → chunk-MQMMJKOZ.js} +1 -1
  44. package/dist/chunks/{chunk-USKCFST5.js → chunk-MWPMYCYB.js} +1 -1
  45. package/dist/chunks/{chunk-DNNWMOMG.js → chunk-N5FT6PTI.js} +1 -1
  46. package/dist/chunks/{chunk-RJY4EI46.js → chunk-PYPXP5R3.js} +1 -1
  47. package/dist/chunks/{chunk-SRJTQS2D.js → chunk-QKBMXL4D.js} +3 -3
  48. package/dist/chunks/{chunk-7PDF2UX2.js → chunk-RIFWD5XM.js} +1 -1
  49. package/dist/chunks/{chunk-IFMWAOBR.js → chunk-RWBP2H4M.js} +1 -1
  50. package/dist/chunks/{chunk-7SOHV5BH.js → chunk-S5ACNR5Y.js} +1 -1
  51. package/dist/chunks/{chunk-3JVZ7OCQ.js → chunk-SRK4WX7D.js} +1 -1
  52. package/dist/chunks/{chunk-33UVQ7DU.js → chunk-T6ML5SCD.js} +1 -1
  53. package/dist/chunks/{chunk-UMRQKE3W.js → chunk-TD5YYA5Z.js} +1 -1
  54. package/dist/chunks/{chunk-OEAKX5TS.js → chunk-TR5UC5AF.js} +1 -1
  55. package/dist/chunks/{chunk-UKTPX2EE.js → chunk-UCPD526R.js} +1 -1
  56. package/dist/chunks/{chunk-RP4DPUN2.js → chunk-UZE3C2SF.js} +1 -1
  57. package/dist/chunks/{chunk-XBAB3HMA.js → chunk-V4VM2R6D.js} +1 -1
  58. package/dist/chunks/{chunk-ASMQTMQB.js → chunk-VMBWCIGG.js} +1 -1
  59. package/dist/chunks/{chunk-OFV26C2U.js → chunk-VXFGSFIE.js} +2 -2
  60. package/dist/chunks/{chunk-IJJ7FYZE.js → chunk-W4JBPYGW.js} +1 -1
  61. package/dist/chunks/{chunk-E57PUTV2.js → chunk-WMJEQK4G.js} +1 -1
  62. package/dist/chunks/{chunk-AT3ZYNX4.js → chunk-X2MJFTLS.js} +1 -1
  63. package/dist/chunks/{chunk-QN4CFJQC.js → chunk-X7ZMUWJO.js} +1 -1
  64. package/dist/chunks/{chunk-6BTX66SV.js → chunk-ZSWATWK2.js} +1 -1
  65. package/dist/chunks/{cli-5JARGJOD.js → cli-KXU5DNVV.js} +1 -1
  66. package/dist/chunks/{command-AI3SMEAH.js → command-X35I53H3.js} +3 -3
  67. package/dist/chunks/{configuration-command-NPA46ZOT.js → configuration-command-VJUK34UQ.js} +1 -1
  68. package/dist/chunks/{connected-app-executor-DLC23O43.js → connected-app-executor-JBFJF2H5.js} +1 -1
  69. package/dist/chunks/{connected-evidence-TVORI55Q.js → connected-evidence-CQ533AML.js} +1 -1
  70. package/dist/chunks/{connected-starting-assets-WGGBWH4K.js → connected-starting-assets-RL5X6LZ7.js} +1 -1
  71. package/dist/chunks/{continual-UHQI2EQD.js → continual-PHGIZFF6.js} +1 -1
  72. package/dist/chunks/{core-commands-QNZUBKOC.js → core-commands-5DYMDWXY.js} +1 -1
  73. package/dist/chunks/{dataset-preparation-authoring-OBMJLGA4.js → dataset-preparation-authoring-UDSX33YK.js} +1 -1
  74. package/dist/chunks/{datasets-USJLJOEQ.js → datasets-BW4JFUUU.js} +1 -1
  75. package/dist/chunks/{desktop-test-IYHAOR47.js → desktop-test-RIG4CB2Z.js} +1 -1
  76. package/dist/chunks/{evaluation-coordination-UJENK4WQ.js → evaluation-coordination-6QJ6XTUX.js} +1 -1
  77. package/dist/chunks/{experiment-improvements-6GJMKIER.js → experiment-improvements-2XF63AQ4.js} +1 -1
  78. package/dist/chunks/{experiments-FZHILSC6.js → experiments-3S2BVNK6.js} +1 -1
  79. package/dist/chunks/{experiments-signal-E32CWBS4.js → experiments-signal-IRBHGGW5.js} +1 -1
  80. package/dist/chunks/{help-32DLAPJR.js → help-Q2VMJVTR.js} +1 -1
  81. package/dist/chunks/{host-profile-evaluation-tools-QAV2UGSB.js → host-profile-evaluation-tools-5LZQHA32.js} +1 -1
  82. package/dist/chunks/{hosted-app-server-composition-5DVBKNV3.js → hosted-app-server-composition-AYZM2HY6.js} +1 -1
  83. package/dist/chunks/{hosted-experiment-improvement-YQ24C54D.js → hosted-experiment-improvement-SMZJYRJ7.js} +1 -1
  84. package/dist/chunks/{hosted-harness-runtime-KLIORGWV.js → hosted-harness-runtime-QWIFAITG.js} +1 -1
  85. package/dist/chunks/{hosted-profile-candidate-RCWFLOVJ.js → hosted-profile-candidate-WOMWAE5N.js} +1 -1
  86. package/dist/chunks/{hosted-profile-compiler-UDG4BCEW.js → hosted-profile-compiler-NZ2BXN32.js} +1 -1
  87. package/dist/chunks/{hosted-profile-evaluation-control-4R3L4FTK.js → hosted-profile-evaluation-control-3ECFFM7E.js} +1 -1
  88. package/dist/chunks/{hosted-profile-evaluation-inspection-NA4SSY7N.js → hosted-profile-evaluation-inspection-TM7RKONG.js} +1 -1
  89. package/dist/chunks/{hosted-profile-evaluation-preparation-B4BW6JTB.js → hosted-profile-evaluation-preparation-2MZIRT75.js} +1 -1
  90. package/dist/chunks/{human-review-D6QCZLYN.js → human-review-PG4WWVWV.js} +1 -1
  91. package/dist/chunks/{import-UCG75PN5.js → import-FAZAVZBF.js} +1 -1
  92. package/dist/chunks/{local-harness-improvement-runtime-GZBMBZB2.js → local-harness-improvement-runtime-OYLTKMJU.js} +1 -1
  93. package/dist/chunks/{local-harness-taskset-review-YVP2ZQJG.js → local-harness-taskset-review-I7YU4RZI.js} +1 -1
  94. package/dist/chunks/{opchat-APJUUTT7.js → opchat-TCZA6373.js} +1 -1
  95. package/dist/chunks/{opchat-bounded-chat-PBUSUAY2.js → opchat-bounded-chat-GMYDXLWB.js} +1 -1
  96. package/dist/chunks/{organizations-WK6EZ6L3.js → organizations-PYKGA2P2.js} +1 -1
  97. package/dist/chunks/{profile-BQMS7ALQ.js → profile-GYYI555I.js} +1 -1
  98. package/dist/chunks/{project-action-payload-CGV77JSA.js → project-action-payload-FE6M2OXJ.js} +1 -1
  99. package/dist/chunks/{project-agent-XVFYTEUQ.js → project-agent-4ISJFMJD.js} +1 -1
  100. package/dist/chunks/{published-experiment-source-2CYFIRBL.js → published-experiment-source-E2YAJCLM.js} +1 -1
  101. package/dist/chunks/{refiner-profile-service-OLJHA4DI.js → refiner-profile-service-LKGXD5WJ.js} +1 -1
  102. package/dist/chunks/{runtime-32KYSVZR.js → runtime-UDLOZD4Y.js} +2 -2
  103. package/dist/chunks/{sandbox-command-OY3VZXGG.js → sandbox-command-4J6DAY7T.js} +1 -1
  104. package/dist/chunks/{sandbox-template-YOOSJ4FK.js → sandbox-template-TSXWJMWG.js} +1 -1
  105. package/dist/chunks/{saved-work-L4KNWLZB.js → saved-work-QTEBKVUB.js} +1 -1
  106. package/dist/chunks/{send-turn-YLY3YNEQ.js → send-turn-4MH4WMLW.js} +1 -1
  107. package/dist/chunks/{setup-EU6CMRXQ.js → setup-IVT2FQSE.js} +1 -1
  108. package/dist/chunks/{src-HYOTHMRX.js → src-DC7N2H7A.js} +2 -2
  109. package/dist/chunks/{src-3DJR7OAH.js → src-TOSQX36I.js} +1 -1
  110. package/dist/chunks/{store-chat-resources-HISLEZZM.js → store-chat-resources-QLXKKYYC.js} +1 -1
  111. package/dist/chunks/{store-continual-support-reviews-ORWHS57V.js → store-continual-support-reviews-4F2BOG3H.js} +1 -1
  112. package/dist/chunks/{store-conversation-serving-5UGYKEGJ.js → store-conversation-serving-EUD47W6X.js} +1 -1
  113. package/dist/chunks/{store-create-improve-APLPTVYQ.js → store-create-improve-QUOTNNIM.js} +1 -1
  114. package/dist/chunks/{store-datasets-HDW6IYBL.js → store-datasets-ZUC7CNVO.js} +1 -1
  115. package/dist/chunks/{store-evaluation-results-KB2UDCF3.js → store-evaluation-results-LHHPHESK.js} +1 -1
  116. package/dist/chunks/{store-human-review-IURNTX3C.js → store-human-review-7WZWRJ6X.js} +1 -1
  117. package/dist/chunks/{store-learned-preference-migration-validation-TH2LKQWV.js → store-learned-preference-migration-validation-MVNKBR4X.js} +1 -1
  118. package/dist/chunks/{store-local-experiments-M4V5RLHJ.js → store-local-experiments-HB53QFLL.js} +1 -1
  119. package/dist/chunks/{store-model-batch-review-DDZLWVTG.js → store-model-batch-review-O3I6GIAA.js} +1 -1
  120. package/dist/chunks/{store-model-configuration-ATOFA5OH.js → store-model-configuration-CDIGNU6Q.js} +1 -1
  121. package/dist/chunks/{store-model-project-preparation-ZRSCQEQR.js → store-model-project-preparation-QMQ2HMJV.js} +1 -1
  122. package/dist/chunks/{store-modification-recordings-YJIDUPVJ.js → store-modification-recordings-W4VEZKKQ.js} +1 -1
  123. package/dist/chunks/{store-sidebar-file-bookmarks-WLMYDA4E.js → store-sidebar-file-bookmarks-KAEDHVVF.js} +1 -1
  124. package/dist/chunks/{store-sidebar-preferences-AFMYIDWT.js → store-sidebar-preferences-QPBLTHY6.js} +1 -1
  125. package/dist/chunks/{store-subagents-KFPVSTRO.js → store-subagents-ZELQP3MX.js} +1 -1
  126. package/dist/chunks/{store-task-inbox-L53OT6ZC.js → store-task-inbox-4ZDQR2E7.js} +1 -1
  127. package/dist/chunks/{store-task-inventory-R2JJGAHW.js → store-task-inventory-CTIJDLYE.js} +1 -1
  128. package/dist/chunks/{store-taskset-drafts-FPNJPFPO.js → store-taskset-drafts-FRPBYLTW.js} +1 -1
  129. package/dist/chunks/{store-training-DIBW7OMP.js → store-training-WQAYUT7B.js} +1 -1
  130. package/dist/chunks/{store-training-jobs-K7I4SXWW.js → store-training-jobs-O5EHGTH7.js} +1 -1
  131. package/dist/chunks/{store-training-models-LCSB37YY.js → store-training-models-YSZMC66T.js} +1 -1
  132. package/dist/chunks/{taskset-XI5SJBJL.js → taskset-OVYM4QMS.js} +1 -1
  133. package/dist/chunks/{teams-bot-CYC5TR64.js → teams-bot-U2M3ORWR.js} +1 -1
  134. package/dist/chunks/{tool-learning-52QZIJIR.js → tool-learning-NXVR4YPA.js} +1 -1
  135. package/dist/chunks/{training-GDLLLXSV.js → training-EQ7G5FDY.js} +1 -1
  136. package/dist/chunks/{training-RL7UUBER.js → training-LQUAL4Y4.js} +1 -1
  137. package/dist/chunks/{training-UJ62NOJJ.js → training-PEZYJ2SN.js} +1 -1
  138. package/dist/chunks/{training-hosted-V5CHG3M3.js → training-hosted-XKSUTMLQ.js} +1 -1
  139. package/dist/chunks/{training-hosted-alphaedit-R5PVATV4.js → training-hosted-alphaedit-VCOEYLKK.js} +1 -1
  140. package/dist/chunks/{training-hosted-decision-WNK5DE3M.js → training-hosted-decision-IKWWXA56.js} +1 -1
  141. package/dist/chunks/{training-hosted-engram-ZQDOKXAV.js → training-hosted-engram-3TOPPVSW.js} +1 -1
  142. package/dist/chunks/{training-hosted-modification-comparison-KKI5CKOH.js → training-hosted-modification-comparison-C6S4JFHW.js} +1 -1
  143. package/dist/chunks/{training-hosted-neuron-training-CFWEDRSR.js → training-hosted-neuron-training-EP2U4PHG.js} +1 -1
  144. package/dist/chunks/{training-hosted-serving-report-N4NF5AVW.js → training-hosted-serving-report-KJMRZJLQ.js} +1 -1
  145. package/dist/chunks/{training-hosted-steering-4MDUQ2YV.js → training-hosted-steering-I27DV6A2.js} +1 -1
  146. package/dist/chunks/{training-model-start-NOA6TYQK.js → training-model-start-NWXNGRDC.js} +1 -1
  147. package/dist/chunks/{workspaces-EK62ANTB.js → workspaces-FVQYJPOS.js} +1 -1
  148. package/dist/cli.js +1 -1
  149. package/dist/skills/manifest.json +1 -1
  150. package/dist/web/assets/{App-L7RV4D0A.js → App-QM6Y2Eod.js} +4 -4
  151. package/dist/web/assets/{AppDialog-B2V84J7f.js → AppDialog-C8um481a.js} +1 -1
  152. package/dist/web/assets/{AppTerminalPanel-DfYpUDKT.js → AppTerminalPanel-OwNr-bp6.js} +2 -2
  153. package/dist/web/assets/{AppToastContext-DuiPouLz.js → AppToastContext-BQ4iRFif.js} +1 -1
  154. package/dist/web/assets/{AppsView-B20RHDCy.js → AppsView-mk8m_Cra.js} +1 -1
  155. package/dist/web/assets/{AttachmentTypeIcon-l-GRNxaz.js → AttachmentTypeIcon-SITPqTtF.js} +1 -1
  156. package/dist/web/assets/{BrowserSidebar-Ce0ToS2O.js → BrowserSidebar-BghdIKTB.js} +1 -1
  157. package/dist/web/assets/{CartesianChart-CtfMRAfp.js → CartesianChart-BdRx7q_O.js} +1 -1
  158. package/dist/web/assets/{ChatTimelineEntry-DzcucW20.js → ChatTimelineEntry-BBOnAzJB.js} +1 -1
  159. package/dist/web/assets/{CollaborationTabs-BpmKjNAC.js → CollaborationTabs-Beja-9s5.js} +1 -1
  160. package/dist/web/assets/{CommandMenu-JXsoxijv.js → CommandMenu-CQtrSUpu.js} +1 -1
  161. package/dist/web/assets/{CommunityView-ggdn8pcH.js → CommunityView-LPTAakS-.js} +1 -1
  162. package/dist/web/assets/{ComposerAttachments-BMmALUs_.js → ComposerAttachments-DI-Gr7Zw.js} +1 -1
  163. package/dist/web/assets/{ComposerCreateImproveStrip-DcM1bkfu.js → ComposerCreateImproveStrip-CY5Uw1yc.js} +1 -1
  164. package/dist/web/assets/{ConversationImportsSettings-BKNeARHI.js → ConversationImportsSettings-DFwhKERw.js} +1 -1
  165. package/dist/web/assets/{DatasetReviewImport-DyFOE0Q0.js → DatasetReviewImport-C9xraQk7.js} +1 -1
  166. package/dist/web/assets/{ExperimentTrainingDataWorkspace-CfOyoMrq.js → ExperimentTrainingDataWorkspace-Cx58S6R_.js} +2 -2
  167. package/dist/web/assets/{FilePagePreview-B7bWObJN.js → FilePagePreview-dlbmR8s8.js} +2 -2
  168. package/dist/web/assets/{GetStartedView-BYbFl93M.js → GetStartedView-BkTV_shK.js} +1 -1
  169. package/dist/web/assets/{GettingStartedDialog-UgreDozV.js → GettingStartedDialog-DulDLYnr.js} +1 -1
  170. package/dist/web/assets/{HostedModelLearningReview-C_kng2U_.js → HostedModelLearningReview--fXJEOfI.js} +1 -1
  171. package/dist/web/assets/{HostedModelLearningSettings-aesD_ifF.js → HostedModelLearningSettings-BEb7B_PC.js} +1 -1
  172. package/dist/web/assets/{HtmlVisual-nvl1x-jh.js → HtmlVisual-BS61T2qR.js} +1 -1
  173. package/dist/web/assets/{LabModelVersionDetailPage-DrdoNvI-.js → LabModelVersionDetailPage-CmzUIDbR.js} +1 -1
  174. package/dist/web/assets/{LabModelWorkspace-CHlhzG3q.js → LabModelWorkspace-DoAnQKWk.js} +1 -1
  175. package/dist/web/assets/{LabSkillSidebar-CqHeZzoj.js → LabSkillSidebar-DJTm7ZQs.js} +1 -1
  176. package/dist/web/assets/{LabsRoute-DzEbPpMK.js → LabsRoute-DNtBot4a.js} +4 -4
  177. package/dist/web/assets/{LearningBatchesPage-A2dFQW2j.js → LearningBatchesPage-C_oQjciE.js} +1 -1
  178. package/dist/web/assets/{MainChatThread-BSvKu4e5.js → MainChatThread-D9e-to8e.js} +2 -2
  179. package/dist/web/assets/{MainPane-DiWIAxMj.js → MainPane-mWeD0M-f.js} +6 -6
  180. package/dist/web/assets/{ModelProjectPageHeader-lu6iRXHK.js → ModelProjectPageHeader-BecKU_2p.js} +1 -1
  181. package/dist/web/assets/{NativeSetupTerminal-kZ-nFPE8.js → NativeSetupTerminal-DO0DN4fH.js} +2 -2
  182. package/dist/web/assets/{NativeSkillSidebar-DkkD1uH2.js → NativeSkillSidebar-jnxgQASC.js} +1 -1
  183. package/dist/web/assets/{NewProjectDialog-Dg8dMEpc.js → NewProjectDialog-ByHR4vMf.js} +1 -1
  184. package/dist/web/assets/{OutputsPage-Dz190U9t.js → OutputsPage-DZY4BUCy.js} +1 -1
  185. package/dist/web/assets/{PageChrome-Bncv-ps0.js → PageChrome-DjPuwWsn.js} +1 -1
  186. package/dist/web/assets/{ProjectsPage-DVkYvLtd.js → ProjectsPage-DKbwhIM4.js} +1 -1
  187. package/dist/web/assets/{RightChatPanelStack-CP4leenI.js → RightChatPanelStack-BARH0XuL.js} +1 -1
  188. package/dist/web/assets/RightSidebarHomePanel-qKL8dZrN.js +1 -0
  189. package/dist/web/assets/{ScheduledWorkPage-DI0mgt82.js → ScheduledWorkPage-CElrmRz9.js} +1 -1
  190. package/dist/web/assets/{SettingsView-cCtkr089.js → SettingsView-CsFSjE9s.js} +3 -3
  191. package/dist/web/assets/{TasksetDraftEditorPrimitives-DCQTuswJ.js → TasksetDraftEditorPrimitives-DJoYkvWq.js} +1 -1
  192. package/dist/web/assets/{TeamChatView-BBEomfQ7.js → TeamChatView-D9Y4e98Y.js} +1 -1
  193. package/dist/web/assets/{TerminalOverlay-Dj5NUDMp.js → TerminalOverlay-CUO8yZjy.js} +1 -1
  194. package/dist/web/assets/{TrainingCreationPanel-Ds4PLfsd.js → TrainingCreationPanel-_mnLQ1HA.js} +1 -1
  195. package/dist/web/assets/{TrainingDraftPanel-BAuh_BF3.js → TrainingDraftPanel-CCqQTHo5.js} +1 -1
  196. package/dist/web/assets/{UsageSettingsSection-DbzeatcW.js → UsageSettingsSection-CdWq5oYC.js} +1 -1
  197. package/dist/web/assets/WorkSidebarPanel-DRXaK-E6.js +1 -0
  198. package/dist/web/assets/{WorkspaceDiffPanel-xk-ve1MO.js → WorkspaceDiffPanel-CdHr8bX6.js} +3 -3
  199. package/dist/web/assets/{WorkspaceEnvironmentMenu-D8GSuoYz.js → WorkspaceEnvironmentMenu-BnUh4dg9.js} +1 -1
  200. package/dist/web/assets/{WorkspaceFileLocation-Dl8M2ZKN.js → WorkspaceFileLocation-VzrSq_Ki.js} +1 -1
  201. package/dist/web/assets/{WorkspaceGitDialogs-9BhLjYx4.js → WorkspaceGitDialogs-nwvQOm9r.js} +1 -1
  202. package/dist/web/assets/{WorkspaceMonacoEditor-DYPuC7pj.js → WorkspaceMonacoEditor-m3bCIpZe.js} +3 -3
  203. package/dist/web/assets/{WorkspacePdfPreview-B7BI9tLR.js → WorkspacePdfPreview-u6Iv0qr0.js} +2 -2
  204. package/dist/web/assets/{WorkspacePresentationPreview-sP7JUT7m.js → WorkspacePresentationPreview-CjvTjhUO.js} +1 -1
  205. package/dist/web/assets/{bot-D7M8ZtE6.js → bot-DiDSZBLn.js} +1 -1
  206. package/dist/web/assets/{chat-resources-DhKAnljP.js → chat-resources-CmBtWC5V.js} +1 -1
  207. package/dist/web/assets/chevron-down-CqxKXYPf.js +1 -0
  208. package/dist/web/assets/chevron-right-ClP6ukIq.js +1 -0
  209. package/dist/web/assets/chevron-up-DY7wpdJ1.js +1 -0
  210. package/dist/web/assets/{chunk-C3TS766N-DENE60SE.js → chunk-C3TS766N-DSA4vs-Y.js} +1 -1
  211. package/dist/web/assets/{client-gy7zrd7a.js → client-_uDCFdg5.js} +1 -1
  212. package/dist/web/assets/{client-choice-storage-DYZsrVr9.js → client-choice-storage-CRKZpilL.js} +1 -1
  213. package/dist/web/assets/{cloud-upload-De-XSMUr.js → cloud-upload-CWamjPts.js} +1 -1
  214. package/dist/web/assets/{copy-DEK20zbZ.js → copy-B56YjDkW.js} +1 -1
  215. package/dist/web/assets/{cssMode-Dau-Fhqf.js → cssMode-BuC9qQvo.js} +1 -1
  216. package/dist/web/assets/{external-link-DwDry0Fb.js → external-link-BSn21e-y.js} +1 -1
  217. package/dist/web/assets/{folder-open-DOb4AjV6.js → folder-open-CaJGWSr2.js} +1 -1
  218. package/dist/web/assets/{folder-plus-BAouDaXv.js → folder-plus-eTUep-az.js} +1 -1
  219. package/dist/web/assets/{git-commit-horizontal-DZbHXcai.js → git-commit-horizontal-Buk_hy6T.js} +1 -1
  220. package/dist/web/assets/{htmlMode-DlNEe6hu.js → htmlMode-D7kF2kDL.js} +1 -1
  221. package/dist/web/assets/{icons-OQhKVrDc.js → icons-B4B5eUyR.js} +1 -1
  222. package/dist/web/assets/{image-BkYJDChH.js → image--4h1aK2l.js} +1 -1
  223. package/dist/web/assets/{index-M_h2Ok4V.js → index-CCaTs7xt.js} +2 -2
  224. package/dist/web/assets/{info-Mj5lp4Ic.js → info-DjMTH4sJ.js} +1 -1
  225. package/dist/web/assets/{jsonMode-CyOEyonV.js → jsonMode-BVX_7KjE.js} +1 -1
  226. package/dist/web/assets/loader-circle-DNHvEoaP.js +1 -0
  227. package/dist/web/assets/{lspLanguageFeatures-DAYPzatg.js → lspLanguageFeatures-RBOb-3wX.js} +1 -1
  228. package/dist/web/assets/{maximize-2-BwFXSX6b.js → maximize-2-Cjg-f1xT.js} +1 -1
  229. package/dist/web/assets/{message-square-C2nqfNLn.js → message-square-oIMQDMc3.js} +1 -1
  230. package/dist/web/assets/{monaco.contribution-BZcNCJER.js → monaco.contribution-CIbGU5-C.js} +2 -2
  231. package/dist/web/assets/{monaco.contribution-KyLdVay7.js → monaco.contribution-CIwt2mTE.js} +2 -2
  232. package/dist/web/assets/{monaco.contribution-BZkfRhss.js → monaco.contribution-Dd1cPdSS.js} +2 -2
  233. package/dist/web/assets/{monaco.contribution-D7_X8TXe.js → monaco.contribution-KRLNg324.js} +2 -2
  234. package/dist/web/assets/{monitor-B0Qj5Wea.js → monitor-BWaitd6I.js} +1 -1
  235. package/dist/web/assets/{paperclip-CmrRruxi.js → paperclip-FYK6OySO.js} +1 -1
  236. package/dist/web/assets/{pdf-BM-9_48p.js → pdf-DbwlsqZP.js} +1 -1
  237. package/dist/web/assets/play-DieChKfF.js +1 -0
  238. package/dist/web/assets/plus-DkfcQyma.js +1 -0
  239. package/dist/web/assets/{presentation-BYxhoSIo.js → presentation-B6MaAPC7.js} +1 -1
  240. package/dist/web/assets/{python-B3Mj03I5.js → python-DRYJxjiM.js} +1 -1
  241. package/dist/web/assets/{refresh-cw-CwEmO71D.js → refresh-cw-DOVpqCfJ.js} +1 -1
  242. package/dist/web/assets/{save-S--FOuce.js → save-BuyyyR4Q.js} +1 -1
  243. package/dist/web/assets/{settings-lists-ChqDppMP.js → settings-lists-BeAdxSjx.js} +1 -1
  244. package/dist/web/assets/square-D0YnIVh6.js +1 -0
  245. package/dist/web/assets/{square-terminal-CawpQtCi.js → square-terminal-DTOIZy6_.js} +1 -1
  246. package/dist/web/assets/{submit-issue-command-CFitxxmO.js → submit-issue-command-V--K9lVQ.js} +1 -1
  247. package/dist/web/assets/{toggleHighContrast-D-cMCvXx.js → toggleHighContrast-nNzCoE0h.js} +1 -1
  248. package/dist/web/assets/training-DZgfVcI-.js +1 -0
  249. package/dist/web/assets/{training-model-data-G-D64935.js → training-model-data-CWoTokkb.js} +1 -1
  250. package/dist/web/assets/{tsMode-9kzS1ijG.js → tsMode-BfVi5_FZ.js} +1 -1
  251. package/dist/web/assets/{upload-CtYsSYrM.js → upload-C2MnlWjj.js} +1 -1
  252. package/dist/web/assets/{useAccountSettings-DYYa6puz.js → useAccountSettings-QwRbZIKu.js} +1 -1
  253. package/dist/web/assets/{useAgentInventory-c5B_Tszj.js → useAgentInventory-B7xEgMCA.js} +1 -1
  254. package/dist/web/assets/{useChatContextSelection-DOISZpTz.js → useChatContextSelection-O6wo4EqD.js} +1 -1
  255. package/dist/web/assets/{useLocalAgentSchedules-QJ8RsMKm.js → useLocalAgentSchedules-DpHnOGoV.js} +1 -1
  256. package/dist/web/assets/{useQuery-DuTGOe2b.js → useQuery-CvZ8bzdW.js} +1 -1
  257. package/dist/web/assets/{wifi-off-BOfP4Vmg.js → wifi-off-B8d12Alh.js} +1 -1
  258. package/dist/web/assets/{workers-BwGpyrdj.js → workers-sIVKxb8c.js} +1 -1
  259. package/dist/web/assets/x-BvVvVB-j.js +1 -0
  260. package/dist/web/assets/{yaml-BU4IWV_7.js → yaml-8-aLM3zj.js} +1 -1
  261. package/dist/web/index.html +1 -1
  262. package/package.json +1 -1
  263. package/dist/chunks/chunk-NK2L5HA2.js +0 -2
  264. package/dist/web/assets/RightSidebarHomePanel-C0etQXpt.js +0 -1
  265. package/dist/web/assets/WorkSidebarPanel-BaNuXoZc.js +0 -1
  266. package/dist/web/assets/chevron-down-BAEcJitl.js +0 -1
  267. package/dist/web/assets/chevron-right-3G9s2cQ9.js +0 -1
  268. package/dist/web/assets/chevron-up-DTYF52H1.js +0 -1
  269. package/dist/web/assets/loader-circle-DXVtGvuV.js +0 -1
  270. package/dist/web/assets/play-CkACZ6Zo.js +0 -1
  271. package/dist/web/assets/plus-CB258e62.js +0 -1
  272. package/dist/web/assets/square-BmPfHjGU.js +0 -1
  273. package/dist/web/assets/training-CzbWtx75.js +0 -1
  274. package/dist/web/assets/x-5_iy6IDd.js +0 -1
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
3
- import{q as wt,s as Tt}from"./chunk-2ACX7IW5.js";import{z as St}from"./chunk-WXG3G2O6.js";import{i as ge,j as vt,l as he}from"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-EJOV6Z6F.js";import"./chunk-GY7YSD6J.js";import"./chunk-KUE46HTH.js";import"./chunk-MZKCW6CB.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import{D as Je,E as re,G as ft,I as gt,L as ht,O as yt}from"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import{f as pt,h as mt}from"./chunk-UGOK7VTC.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as i}from"./chunk-FTQLQJQV.js";import{createInterface as oo}from"node:readline/promises";import{stdin as He,stdout as R}from"node:process";import{pathToFileURL as io}from"node:url";function ve(){return{text:"",cursor:0,history:[],historyIndex:null}}i(ve,"createComposer");function bt(e,t){let r=e.text.slice(0,e.cursor),n=e.text.slice(e.cursor);return{...e,text:`${r}${t}${n}`,cursor:e.cursor+t.length,historyIndex:null}}i(bt,"insertText");function ye(e,t){return{...e,text:t,cursor:t.length}}i(ye,"replaceComposerText");function Rr(e){let t=e.text.trim();return t?{state:{text:"",cursor:0,history:[...e.history.filter(r=>r!==t),t].slice(-100),historyIndex:null},action:{type:"submit",text:t}}:{state:{...e,text:"",cursor:0,historyIndex:null},action:{type:"none"}}}i(Rr,"submitComposer");function Pt(e,t){if(t==="ctrl+c")return{state:e,action:{type:"cancel-or-exit"}};if(t==="ctrl+d")return{state:e,action:e.text?{type:"none"}:{type:"exit"}};if(t==="ctrl+l")return{state:e,action:{type:"rerender"}};if(t==="enter")return Rr(e);if(t==="alt+enter")return{state:bt(e,`
3
+ import{q as wt,s as Tt}from"./chunk-2ACX7IW5.js";import{z as St}from"./chunk-2THZ6GZY.js";import{i as ge,j as vt,l as he}from"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-EJOV6Z6F.js";import"./chunk-GY7YSD6J.js";import"./chunk-KUE46HTH.js";import"./chunk-MZKCW6CB.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import{D as Je,E as re,G as ft,I as gt,L as ht,O as yt}from"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import{f as pt,h as mt}from"./chunk-UGOK7VTC.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as i}from"./chunk-FTQLQJQV.js";import{createInterface as oo}from"node:readline/promises";import{stdin as He,stdout as R}from"node:process";import{pathToFileURL as io}from"node:url";function ve(){return{text:"",cursor:0,history:[],historyIndex:null}}i(ve,"createComposer");function bt(e,t){let r=e.text.slice(0,e.cursor),n=e.text.slice(e.cursor);return{...e,text:`${r}${t}${n}`,cursor:e.cursor+t.length,historyIndex:null}}i(bt,"insertText");function ye(e,t){return{...e,text:t,cursor:t.length}}i(ye,"replaceComposerText");function Rr(e){let t=e.text.trim();return t?{state:{text:"",cursor:0,history:[...e.history.filter(r=>r!==t),t].slice(-100),historyIndex:null},action:{type:"submit",text:t}}:{state:{...e,text:"",cursor:0,historyIndex:null},action:{type:"none"}}}i(Rr,"submitComposer");function Pt(e,t){if(t==="ctrl+c")return{state:e,action:{type:"cancel-or-exit"}};if(t==="ctrl+d")return{state:e,action:e.text?{type:"none"}:{type:"exit"}};if(t==="ctrl+l")return{state:e,action:{type:"rerender"}};if(t==="enter")return Rr(e);if(t==="alt+enter")return{state:bt(e,`
4
4
  `),action:{type:"none"}};if(t==="backspace")return e.cursor<=0?{state:e,action:{type:"none"}}:{state:{...e,text:`${e.text.slice(0,e.cursor-1)}${e.text.slice(e.cursor)}`,cursor:e.cursor-1},action:{type:"none"}};if(t==="delete")return e.cursor>=e.text.length?{state:e,action:{type:"none"}}:{state:{...e,text:`${e.text.slice(0,e.cursor)}${e.text.slice(e.cursor+1)}`},action:{type:"none"}};if(t==="left")return{state:{...e,cursor:Math.max(0,e.cursor-1)},action:{type:"none"}};if(t==="right")return{state:{...e,cursor:Math.min(e.text.length,e.cursor+1)},action:{type:"none"}};if(t==="home"||t==="ctrl+a")return{state:{...e,cursor:0},action:{type:"none"}};if(t==="end"||t==="ctrl+e")return{state:{...e,cursor:e.text.length},action:{type:"none"}};if(t==="ctrl+u")return{state:{...e,text:e.text.slice(e.cursor),cursor:0},action:{type:"none"}};if(t==="ctrl+k")return{state:{...e,text:e.text.slice(0,e.cursor)},action:{type:"none"}};if(t==="up"){if(e.history.length===0)return{state:e,action:{type:"none"}};let r=e.historyIndex===null?e.history.length-1:Math.max(0,e.historyIndex-1);return{state:ye({...e,historyIndex:r},e.history[r]??""),action:{type:"none"}}}if(t==="down"){if(e.historyIndex===null)return{state:e,action:{type:"none"}};let r=e.historyIndex+1;return r>=e.history.length?{state:{...e,text:"",cursor:0,historyIndex:null},action:{type:"none"}}:{state:ye({...e,historyIndex:r},e.history[r]??""),action:{type:"none"}}}return t.length>0?{state:bt(e,t),action:{type:"none"}}:{state:e,action:{type:"none"}}}i(Pt,"handleComposerKey");var xt="A turn is already running. Wait for it to finish before sending another line.";function Mr(){let e=!1;return{isRunning(){return e},tryStartSubmission(){return e?!1:(e=!0,!0)},failSubmission(){e=!1},applyRuntimeEvent(t){t.name==="turn.started"&&(e=!0),(t.name==="turn.completed"||t.name==="turn.failed"||t.name==="turn.interrupted")&&(e=!1)}}}i(Mr,"createTerminalTurnSubmissionGuard");function Ct(){return Mr()}i(Ct,"createLineModeTurnGuard");var Se=[{name:"help",usage:"/help",description:"show this help"},{name:"providers",usage:"/providers",description:"list providers"},{name:"provider",usage:"/provider [id]",description:"switch provider",requiresArgument:!0},{name:"model",usage:"/model [id]",description:"list or switch model"},{name:"apps",usage:"/apps",description:"list connectable apps"},{name:"install",usage:"/install <app>",description:"open app details",requiresArgument:!0},{name:"projects",usage:"/projects",description:"list projects"},{name:"project",usage:"/project <id>",description:"switch project",requiresArgument:!0},{name:"permissions",usage:"/permissions [ask|full-access]",description:"show or change command access"},{name:"profile",usage:"/profile [status|diff|catalog|check|push]",description:"show or sync profile"},{name:"agents",usage:"/agents",description:"list agents"},{name:"agent",usage:"/agent <id>",description:"select agent",requiresArgument:!0},{name:"run",usage:"/run <action> [json]",description:"run profile action",requiresArgument:!0},{name:"settings",usage:"/settings",description:"show settings"},{name:"logs",usage:"/logs",description:"show recent events"},{name:"compact",usage:"/compact",description:"compact current session"},{name:"clear",usage:"/clear",description:"clear terminal transcript"},{name:"exit",usage:"/exit",description:"exit"},{name:"hooks",usage:"/hooks",description:"show hook status"},{name:"start",usage:"/start",description:"start a new session"}];function Ke(e){if(!e.startsWith("/"))return null;let[t="",...r]=e.slice(1).trim().split(/\s+/),n=t.toLowerCase();if(!n)return null;if(n==="exit"||n==="quit")return{type:"exit"};if(n==="help")return{type:"help"};if(n==="clear")return{type:"clear"};if(n==="agents")return{type:"agents"};if(n==="apps")return{type:"apps"};if(n==="agent")return{type:"agent",id:r.join(" ").trim()};if(n==="install")return{type:"install",id:r.join(" ").trim()};if(n==="projects")return{type:"projects"};if(n==="project")return{type:"project",id:r.join(" ").trim()};if(n==="model")return{type:"model",id:r.join(" ").trim()||null};if(n==="permissions")return{type:"permissions",args:r};if(n==="profile")return{type:"profile",args:r};if(n==="logs")return{type:"logs"};if(n==="providers")return{type:"providers"};if(n==="provider")return{type:"provider",id:r.join(" ").trim()||null};if(n==="compact")return{type:"compact"};if(n==="hooks")return{type:"hooks"};if(n==="start")return{type:"start"};if(n==="run"){let o=r[0]??"",s=r.slice(1).join(" ").trim();return s?{type:"run",action:o,input:JSON.parse(s)}:{type:"run",action:o,input:void 0}}return n==="settings"?{type:"settings",args:r}:{type:"unknown",command:n}}i(Ke,"parseSlashCommand");function It(e){let t=e.trim();if(!t.startsWith("!"))return null;let r=t.slice(1).trim();return r?{command:r}:null}i(It,"parseDirectCommandPrompt");function At(){let e=Math.max(...Se.map(t=>t.usage.length));return["Commands:",...Se.map(t=>`${t.usage.padEnd(e+2)}${t.description}`)].join(`
5
5
  `)}i(At,"helpText");var we=class{static{i(this,"RawInput")}input;onKey;previousRawMode=!1;dataHandler=null;constructor(t,r){this.input=t,this.onKey=r}start(){this.previousRawMode=this.input.isRaw??!1,this.input.setRawMode(!0),this.input.resume(),this.dataHandler=t=>{for(let r of Or(t))this.onKey(r)},this.input.on("data",this.dataHandler)}stop(){this.dataHandler&&this.input.off("data",this.dataHandler),this.dataHandler=null,this.input.setRawMode(this.previousRawMode),this.input.pause()}};function Or(e){let t=e.toString("utf8"),r=[];for(let n=0;n<t.length;n+=1){let o=t[n],s=t[n+1];if(o==="\x1B"){let a=jr(t,n);r.push(a.key),n=a.end;continue}o===""?r.push("ctrl+c"):o===""?r.push("ctrl+d"):o==="\f"?r.push("ctrl+l"):o===""?r.push("ctrl+a"):o===""?r.push("ctrl+e"):o==="\v"?r.push("ctrl+k"):o===""?r.push("ctrl+u"):o==="\x7F"||o==="\b"?r.push("backspace"):o==="\r"||o===`
6
6
  `?r.push("enter"):(o>=" "||o&&s)&&r.push(o)}return r}i(Or,"decodeKeys");function jr(e,t){let r=e.slice(t);return r.startsWith("\x1B\r")||r.startsWith(`\x1B
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as O,b as D}from"./chunk-BTEBZYK3.js";import{b as _,c as R,d as l,e as d}from"./chunk-7SOHV5BH.js";import{a as L}from"./chunk-KCJVFLBB.js";import{mc as c,nc as w}from"./chunk-WXG3G2O6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import{p as m,s as f}from"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as y}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as g}from"./chunk-FTQLQJQV.js";import{randomUUID as H}from"node:crypto";var E=c.omit({workspace:!0}).extend({workspace:c.shape.workspace.omit({files:!0})}),k=class extends L{static{g(this,"SqliteChatResourceStore")}datasetListings=new Map;datasetListingDataVersion=null;async listChatHostedExperiments(){return await this.ready,await this.writeQueue,this.database.all("SELECT payload FROM chat_hosted_experiments ORDER BY id",[]).map(e=>JSON.parse(e.payload))}async readChatHostedExperiment(e){await this.ready,await this.writeQueue;let a=this.database.get("SELECT payload FROM chat_hosted_experiments WHERE id=?",[e]);return a?JSON.parse(a.payload):null}async retainChatHostedExperiment(e,a,s,t){await this.ready;let r=this.writeQueue.then(()=>{let i=this.database.get("SELECT owner_hash,configuration_hash FROM chat_hosted_experiments WHERE id=?",[e]);if(i&&(i.owner_hash!==a||i.configuration_hash!==s))throw new Error("The retained hosted Experiment changed owner or configuration.");this.database.run("INSERT INTO chat_hosted_experiments(id,owner_hash,configuration_hash,payload) VALUES(?,?,?,?) ON CONFLICT(id) DO UPDATE SET payload=excluded.payload",[e,a,s,JSON.stringify(t)])});return this.writeQueue=r.then(()=>{},()=>{}),r}async readChatExperimentGroup(e,a){await this.ready,await this.writeQueue;let s=this.database.get("SELECT request_hash,payload FROM chat_experiment_groups WHERE operation_id=?",[e]);if(!s)return null;if(a&&s.request_hash!==a)throw new Error("Experiment operation ID was reused with different inputs.");return JSON.parse(s.payload)}async prepareChatExperimentGroup(e,a,s){await this.ready;let t=this.writeQueue.then(()=>{this.database.run("INSERT OR IGNORE INTO chat_experiment_groups(operation_id,request_hash,payload) VALUES(?,?,?)",[e,a,JSON.stringify(s)]);let r=this.database.get("SELECT request_hash,payload FROM chat_experiment_groups WHERE operation_id=?",[e]);if(r.request_hash!==a)throw new Error("Experiment operation ID was reused with different inputs.");return JSON.parse(r.payload)});return this.writeQueue=t.then(()=>{},()=>{}),t}async localResourceOwnerId(){await this.ready;let e=this.writeQueue.then(()=>(this.database.run("INSERT OR IGNORE INTO local_resource_owner(singleton,id) VALUES(1,?)",[`local-owner-${H()}`]),this.database.get("SELECT id FROM local_resource_owner WHERE singleton=1",[]).id));return this.writeQueue=e.then(()=>{},()=>{}),e}async readLocalDataset(e,a){await this.ready,await this.writeQueue;let s=this.database.get(a===void 0?"SELECT r.payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?":"SELECT r.payload FROM local_dataset_versions w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=? AND w.revision=?",a===void 0?[e]:[e,a]);return s?d(this.database,s.payload):null}async readLocalDatasetByWorkspaceHash(e,a){await this.ready,await this.writeQueue;let s=this.database.get("SELECT r.payload FROM local_dataset_versions w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=? AND json_extract(r.payload,'$.workspace.contentHash')=?",[e,a]);return s?d(this.database,s.payload):null}async listLocalDatasets(e=!1){if(e){let a=(await this.listLocalDatasetListings()).filter(t=>t.sync);return(await Promise.all(a.map(t=>this.readLocalDataset(t.workspace.draft.id)))).filter(t=>t!==null)}return await this.ready,await this.writeQueue,this.database.all("SELECT r.payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash ORDER BY w.updated_at DESC",[]).map(a=>d(this.database,a.payload))}async listLocalDatasetListings(){await this.ready,await this.writeQueue;let e=this.database.get("PRAGMA data_version",[]).data_version;this.datasetListingDataVersion!==e&&this.datasetListings.clear(),this.datasetListingDataVersion=e;let a=this.database.all("SELECT id,revision,updated_at FROM local_dataset_workspaces ORDER BY updated_at DESC",[]),s=new Set(a.map(t=>t.id));for(let t of this.datasetListings.keys())s.has(t)||this.datasetListings.delete(t);return a.map(t=>{let r=`${t.revision}:${t.updated_at}`,i=this.datasetListings.get(t.id);if(i?.stamp===r)return structuredClone(i.value);let o=this.database.get("SELECT json_remove(r.payload,'$.workspace.files') AS payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?",[t.id]).payload,n=E.parse(l(this.database,o));return this.datasetListings.set(t.id,{stamp:r,value:n}),structuredClone(n)})}async readLocalDatasetListing(e,a){await this.ready,await this.writeQueue;let s=a===void 0?"local_dataset_workspaces":"local_dataset_versions",t=this.database.get(`SELECT json_remove(r.payload,'$.workspace.files') AS payload FROM ${s} w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?${a===void 0?"":" AND w.revision=?"}`,a===void 0?[e]:[e,a]);return t?E.parse(l(this.database,t.payload)):null}async readLocalDatasetProjection(e,a,s){await this.ready,await this.writeQueue;let t=s.workspaceHash?"w.id=? AND json_extract(r.payload,'$.workspace.contentHash')=?":s.revision===void 0?"w.id=?":"w.id=? AND w.revision=?",r=s.workspaceHash||s.revision!==void 0?"local_dataset_versions":"local_dataset_workspaces",i=s.workspaceHash?[e,s.workspaceHash]:s.revision===void 0?[e]:[e,s.revision],o=`${r} w JOIN local_dataset_records r ON r.record_hash=w.record_hash`,n=this.database.get(`SELECT json_remove(r.payload,'$.workspace.files') AS payload FROM ${o} WHERE ${t}`,i);if(!n)return null;let h=E.parse(l(this.database,n.payload)),{paths:I,policyPaths:N}=D(h.workspace.draft,a),p=[...N],u=[...I],S=p.length?`json_extract(file.value,'$.path') NOT IN (${p.map(()=>"?").join(",")})`:"1",b=u.length?` OR json_extract(file.value,'$.path') IN (${u.map(()=>"?").join(",")})`:"",v=this.database.all(`SELECT file.value AS payload FROM ${o},json_each(r.payload,'$.workspace.files') file WHERE ${t} AND (${S}${b})`,[...i,...p,...u]).map(x=>m.parse(R(this.database,JSON.parse(x.payload)))),T=h.workspace.contentHash,C=O({...h.workspace,files:v},a);return{record:c.parse({...h,workspace:C}),sourceWorkspaceHash:T}}async recoverLocalDatasetOperation(e,a){await this.ready,await this.writeQueue;let s=this.database.get("SELECT w.request_hash,r.payload FROM local_dataset_operations w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.operation_id=?",[e]);if(!s)return null;if(s.request_hash!==a)throw new Error("Dataset operation ID was reused with different input.");return d(this.database,s.payload)}async saveLocalDataset(e){let a=c.parse(e.record);if(f(a.workspace,Number.POSITIVE_INFINITY),a.workspace.draft.profileId!==a.ownerId||a.workspace.draft.modelScope!==null)throw new Error("Independent local Dataset ownership cannot change.");await this.ready;let s=this.writeQueue.then(()=>{this.database.exec("BEGIN IMMEDIATE");try{let t=this.database.get("SELECT w.request_hash,r.payload FROM local_dataset_operations w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.operation_id=?",[e.operationId]);if(t){if(t.request_hash!==e.requestHash)throw new Error("Dataset operation ID was reused with different input.");let n=d(this.database,t.payload);return this.database.exec("COMMIT"),n}let r=a.workspace.draft.id,i=this.database.get("SELECT w.revision,r.payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?",[r]);if((i?.revision??0)!==e.expectedRevision)throw new Error("Dataset changed. Reload its saved revision before editing.");if(a.workspace.draft.revision!==e.expectedRevision+1)throw new Error("Dataset revisions must advance once per saved edit.");if(i){let n=d(this.database,i.payload);if(n.ownerId!==a.ownerId||n.projectId!==a.projectId||n.workspace.draft.createdAt!==a.workspace.draft.createdAt)throw new Error("Dataset ownership and origin cannot change.");a.sync=n.sync}let o=_(this.database,a);return this.database.run("INSERT INTO local_dataset_workspaces(id,revision,record_hash,updated_at) VALUES(?,?,?,?) ON CONFLICT(id) DO UPDATE SET revision=excluded.revision,record_hash=excluded.record_hash,updated_at=excluded.updated_at",[r,a.workspace.draft.revision,o,a.workspace.draft.updatedAt]),this.database.run("INSERT INTO local_dataset_versions(id,revision,record_hash) VALUES(?,?,?)",[r,a.workspace.draft.revision,o]),this.database.run("INSERT INTO local_dataset_operations(operation_id,request_hash,record_hash) VALUES(?,?,?)",[e.operationId,e.requestHash,o]),this.database.exec("COMMIT"),this.datasetListings.delete(r),a}catch(t){throw this.database.exec("ROLLBACK"),t}});return this.writeQueue=s.then(()=>{},()=>{}),s}async updateLocalDatasetMetadata(e,a,s){await this.ready;let t=this.writeQueue.then(()=>{this.database.exec("BEGIN IMMEDIATE");try{let r=this.database.get("SELECT r.payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?",[e]);if(!r)throw new Error("Local Dataset was not found.");let i=d(this.database,r.payload);if(y(i)!==a)throw new Error("Dataset state changed. Retry against its latest saved state.");let o=c.parse(s(i));if(o.ownerId!==i.ownerId||o.projectId!==i.projectId||o.workspace.contentHash!==i.workspace.contentHash)throw new Error("Metadata updates cannot edit Dataset bytes or ownership.");let n=_(this.database,o);return this.database.run("UPDATE local_dataset_workspaces SET record_hash=? WHERE id=?",[n,e]),this.database.run("UPDATE local_dataset_versions SET record_hash=? WHERE id=? AND revision=?",[n,e,o.workspace.draft.revision]),this.database.exec("COMMIT"),this.datasetListings.delete(e),o}catch(r){throw this.database.exec("ROLLBACK"),r}});return this.writeQueue=t.then(()=>{},()=>{}),t}async linkChatResource(e,a,s){let t=w.parse(s);await this.upsertPayload("INSERT INTO chat_resource_links(session_id,turn_id,kind,resource_id,revision,payload) VALUES(?,?,?,?,?,?) ON CONFLICT(session_id,turn_id,kind,resource_id) DO UPDATE SET revision=excluded.revision,payload=excluded.payload WHERE excluded.revision>=chat_resource_links.revision",[e,a,t.kind,t.id,t.revision,JSON.stringify(t)])}async chatResourceLinks(e){await this.ready,await this.writeQueue;let a=[],s=[];return e.sessionId&&(a.push("session_id=?"),s.push(e.sessionId)),e.kind&&(a.push("kind=?"),s.push(e.kind)),e.id&&(a.push("resource_id=?"),s.push(e.id)),this.database.all(`SELECT session_id,turn_id,payload FROM chat_resource_links${a.length?` WHERE ${a.join(" AND ")}`:""}`,s).map(t=>({sessionId:t.session_id,turnId:t.turn_id,summary:w.parse(JSON.parse(t.payload))}))}};export{k as SqliteChatResourceStore};
2
+ import{a as O,b as D}from"./chunk-BTEBZYK3.js";import{b as _,c as R,d as l,e as d}from"./chunk-S5ACNR5Y.js";import{a as L}from"./chunk-KCJVFLBB.js";import{mc as c,nc as w}from"./chunk-2THZ6GZY.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import{p as m,s as f}from"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as y}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as g}from"./chunk-FTQLQJQV.js";import{randomUUID as H}from"node:crypto";var E=c.omit({workspace:!0}).extend({workspace:c.shape.workspace.omit({files:!0})}),k=class extends L{static{g(this,"SqliteChatResourceStore")}datasetListings=new Map;datasetListingDataVersion=null;async listChatHostedExperiments(){return await this.ready,await this.writeQueue,this.database.all("SELECT payload FROM chat_hosted_experiments ORDER BY id",[]).map(e=>JSON.parse(e.payload))}async readChatHostedExperiment(e){await this.ready,await this.writeQueue;let a=this.database.get("SELECT payload FROM chat_hosted_experiments WHERE id=?",[e]);return a?JSON.parse(a.payload):null}async retainChatHostedExperiment(e,a,s,t){await this.ready;let r=this.writeQueue.then(()=>{let i=this.database.get("SELECT owner_hash,configuration_hash FROM chat_hosted_experiments WHERE id=?",[e]);if(i&&(i.owner_hash!==a||i.configuration_hash!==s))throw new Error("The retained hosted Experiment changed owner or configuration.");this.database.run("INSERT INTO chat_hosted_experiments(id,owner_hash,configuration_hash,payload) VALUES(?,?,?,?) ON CONFLICT(id) DO UPDATE SET payload=excluded.payload",[e,a,s,JSON.stringify(t)])});return this.writeQueue=r.then(()=>{},()=>{}),r}async readChatExperimentGroup(e,a){await this.ready,await this.writeQueue;let s=this.database.get("SELECT request_hash,payload FROM chat_experiment_groups WHERE operation_id=?",[e]);if(!s)return null;if(a&&s.request_hash!==a)throw new Error("Experiment operation ID was reused with different inputs.");return JSON.parse(s.payload)}async prepareChatExperimentGroup(e,a,s){await this.ready;let t=this.writeQueue.then(()=>{this.database.run("INSERT OR IGNORE INTO chat_experiment_groups(operation_id,request_hash,payload) VALUES(?,?,?)",[e,a,JSON.stringify(s)]);let r=this.database.get("SELECT request_hash,payload FROM chat_experiment_groups WHERE operation_id=?",[e]);if(r.request_hash!==a)throw new Error("Experiment operation ID was reused with different inputs.");return JSON.parse(r.payload)});return this.writeQueue=t.then(()=>{},()=>{}),t}async localResourceOwnerId(){await this.ready;let e=this.writeQueue.then(()=>(this.database.run("INSERT OR IGNORE INTO local_resource_owner(singleton,id) VALUES(1,?)",[`local-owner-${H()}`]),this.database.get("SELECT id FROM local_resource_owner WHERE singleton=1",[]).id));return this.writeQueue=e.then(()=>{},()=>{}),e}async readLocalDataset(e,a){await this.ready,await this.writeQueue;let s=this.database.get(a===void 0?"SELECT r.payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?":"SELECT r.payload FROM local_dataset_versions w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=? AND w.revision=?",a===void 0?[e]:[e,a]);return s?d(this.database,s.payload):null}async readLocalDatasetByWorkspaceHash(e,a){await this.ready,await this.writeQueue;let s=this.database.get("SELECT r.payload FROM local_dataset_versions w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=? AND json_extract(r.payload,'$.workspace.contentHash')=?",[e,a]);return s?d(this.database,s.payload):null}async listLocalDatasets(e=!1){if(e){let a=(await this.listLocalDatasetListings()).filter(t=>t.sync);return(await Promise.all(a.map(t=>this.readLocalDataset(t.workspace.draft.id)))).filter(t=>t!==null)}return await this.ready,await this.writeQueue,this.database.all("SELECT r.payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash ORDER BY w.updated_at DESC",[]).map(a=>d(this.database,a.payload))}async listLocalDatasetListings(){await this.ready,await this.writeQueue;let e=this.database.get("PRAGMA data_version",[]).data_version;this.datasetListingDataVersion!==e&&this.datasetListings.clear(),this.datasetListingDataVersion=e;let a=this.database.all("SELECT id,revision,updated_at FROM local_dataset_workspaces ORDER BY updated_at DESC",[]),s=new Set(a.map(t=>t.id));for(let t of this.datasetListings.keys())s.has(t)||this.datasetListings.delete(t);return a.map(t=>{let r=`${t.revision}:${t.updated_at}`,i=this.datasetListings.get(t.id);if(i?.stamp===r)return structuredClone(i.value);let o=this.database.get("SELECT json_remove(r.payload,'$.workspace.files') AS payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?",[t.id]).payload,n=E.parse(l(this.database,o));return this.datasetListings.set(t.id,{stamp:r,value:n}),structuredClone(n)})}async readLocalDatasetListing(e,a){await this.ready,await this.writeQueue;let s=a===void 0?"local_dataset_workspaces":"local_dataset_versions",t=this.database.get(`SELECT json_remove(r.payload,'$.workspace.files') AS payload FROM ${s} w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?${a===void 0?"":" AND w.revision=?"}`,a===void 0?[e]:[e,a]);return t?E.parse(l(this.database,t.payload)):null}async readLocalDatasetProjection(e,a,s){await this.ready,await this.writeQueue;let t=s.workspaceHash?"w.id=? AND json_extract(r.payload,'$.workspace.contentHash')=?":s.revision===void 0?"w.id=?":"w.id=? AND w.revision=?",r=s.workspaceHash||s.revision!==void 0?"local_dataset_versions":"local_dataset_workspaces",i=s.workspaceHash?[e,s.workspaceHash]:s.revision===void 0?[e]:[e,s.revision],o=`${r} w JOIN local_dataset_records r ON r.record_hash=w.record_hash`,n=this.database.get(`SELECT json_remove(r.payload,'$.workspace.files') AS payload FROM ${o} WHERE ${t}`,i);if(!n)return null;let h=E.parse(l(this.database,n.payload)),{paths:I,policyPaths:N}=D(h.workspace.draft,a),p=[...N],u=[...I],S=p.length?`json_extract(file.value,'$.path') NOT IN (${p.map(()=>"?").join(",")})`:"1",b=u.length?` OR json_extract(file.value,'$.path') IN (${u.map(()=>"?").join(",")})`:"",v=this.database.all(`SELECT file.value AS payload FROM ${o},json_each(r.payload,'$.workspace.files') file WHERE ${t} AND (${S}${b})`,[...i,...p,...u]).map(x=>m.parse(R(this.database,JSON.parse(x.payload)))),T=h.workspace.contentHash,C=O({...h.workspace,files:v},a);return{record:c.parse({...h,workspace:C}),sourceWorkspaceHash:T}}async recoverLocalDatasetOperation(e,a){await this.ready,await this.writeQueue;let s=this.database.get("SELECT w.request_hash,r.payload FROM local_dataset_operations w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.operation_id=?",[e]);if(!s)return null;if(s.request_hash!==a)throw new Error("Dataset operation ID was reused with different input.");return d(this.database,s.payload)}async saveLocalDataset(e){let a=c.parse(e.record);if(f(a.workspace,Number.POSITIVE_INFINITY),a.workspace.draft.profileId!==a.ownerId||a.workspace.draft.modelScope!==null)throw new Error("Independent local Dataset ownership cannot change.");await this.ready;let s=this.writeQueue.then(()=>{this.database.exec("BEGIN IMMEDIATE");try{let t=this.database.get("SELECT w.request_hash,r.payload FROM local_dataset_operations w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.operation_id=?",[e.operationId]);if(t){if(t.request_hash!==e.requestHash)throw new Error("Dataset operation ID was reused with different input.");let n=d(this.database,t.payload);return this.database.exec("COMMIT"),n}let r=a.workspace.draft.id,i=this.database.get("SELECT w.revision,r.payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?",[r]);if((i?.revision??0)!==e.expectedRevision)throw new Error("Dataset changed. Reload its saved revision before editing.");if(a.workspace.draft.revision!==e.expectedRevision+1)throw new Error("Dataset revisions must advance once per saved edit.");if(i){let n=d(this.database,i.payload);if(n.ownerId!==a.ownerId||n.projectId!==a.projectId||n.workspace.draft.createdAt!==a.workspace.draft.createdAt)throw new Error("Dataset ownership and origin cannot change.");a.sync=n.sync}let o=_(this.database,a);return this.database.run("INSERT INTO local_dataset_workspaces(id,revision,record_hash,updated_at) VALUES(?,?,?,?) ON CONFLICT(id) DO UPDATE SET revision=excluded.revision,record_hash=excluded.record_hash,updated_at=excluded.updated_at",[r,a.workspace.draft.revision,o,a.workspace.draft.updatedAt]),this.database.run("INSERT INTO local_dataset_versions(id,revision,record_hash) VALUES(?,?,?)",[r,a.workspace.draft.revision,o]),this.database.run("INSERT INTO local_dataset_operations(operation_id,request_hash,record_hash) VALUES(?,?,?)",[e.operationId,e.requestHash,o]),this.database.exec("COMMIT"),this.datasetListings.delete(r),a}catch(t){throw this.database.exec("ROLLBACK"),t}});return this.writeQueue=s.then(()=>{},()=>{}),s}async updateLocalDatasetMetadata(e,a,s){await this.ready;let t=this.writeQueue.then(()=>{this.database.exec("BEGIN IMMEDIATE");try{let r=this.database.get("SELECT r.payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?",[e]);if(!r)throw new Error("Local Dataset was not found.");let i=d(this.database,r.payload);if(y(i)!==a)throw new Error("Dataset state changed. Retry against its latest saved state.");let o=c.parse(s(i));if(o.ownerId!==i.ownerId||o.projectId!==i.projectId||o.workspace.contentHash!==i.workspace.contentHash)throw new Error("Metadata updates cannot edit Dataset bytes or ownership.");let n=_(this.database,o);return this.database.run("UPDATE local_dataset_workspaces SET record_hash=? WHERE id=?",[n,e]),this.database.run("UPDATE local_dataset_versions SET record_hash=? WHERE id=? AND revision=?",[n,e,o.workspace.draft.revision]),this.database.exec("COMMIT"),this.datasetListings.delete(e),o}catch(r){throw this.database.exec("ROLLBACK"),r}});return this.writeQueue=t.then(()=>{},()=>{}),t}async linkChatResource(e,a,s){let t=w.parse(s);await this.upsertPayload("INSERT INTO chat_resource_links(session_id,turn_id,kind,resource_id,revision,payload) VALUES(?,?,?,?,?,?) ON CONFLICT(session_id,turn_id,kind,resource_id) DO UPDATE SET revision=excluded.revision,payload=excluded.payload WHERE excluded.revision>=chat_resource_links.revision",[e,a,t.kind,t.id,t.revision,JSON.stringify(t)])}async chatResourceLinks(e){await this.ready,await this.writeQueue;let a=[],s=[];return e.sessionId&&(a.push("session_id=?"),s.push(e.sessionId)),e.kind&&(a.push("kind=?"),s.push(e.kind)),e.id&&(a.push("resource_id=?"),s.push(e.id)),this.database.all(`SELECT session_id,turn_id,payload FROM chat_resource_links${a.length?` WHERE ${a.join(" AND ")}`:""}`,s).map(t=>({sessionId:t.session_id,turnId:t.turn_id,summary:w.parse(JSON.parse(t.payload))}))}};export{k as SqliteChatResourceStore};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as r}from"./chunk-KCJVFLBB.js";import"./chunk-WXG3G2O6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import{F as s,G as t}from"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as n}from"./chunk-FTQLQJQV.js";var d=class extends r{static{n(this,"SqliteContinualBenchReviewStore")}async saveContinualLearningDailyBatch(i){let e=s.parse(i),a=await this.getContinualLearningDailyBatch(e.id);if(a&&(a.seriesId!==e.seriesId||a.scheduleEntryId!==e.scheduleEntryId||a.dayOrdinal!==e.dayOrdinal||JSON.stringify(a.sourceTaskset)!==JSON.stringify(e.sourceTaskset)||e.revision!==a.revision+1)){if(JSON.stringify(a)===JSON.stringify(e))return a;throw new Error("A daily learning batch update must preserve its intake identity and use the next revision.")}return await this.upsertPayload(`INSERT INTO continual_learning_daily_batches
2
+ import{a as r}from"./chunk-KCJVFLBB.js";import"./chunk-2THZ6GZY.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import{F as s,G as t}from"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as n}from"./chunk-FTQLQJQV.js";var d=class extends r{static{n(this,"SqliteContinualBenchReviewStore")}async saveContinualLearningDailyBatch(i){let e=s.parse(i),a=await this.getContinualLearningDailyBatch(e.id);if(a&&(a.seriesId!==e.seriesId||a.scheduleEntryId!==e.scheduleEntryId||a.dayOrdinal!==e.dayOrdinal||JSON.stringify(a.sourceTaskset)!==JSON.stringify(e.sourceTaskset)||e.revision!==a.revision+1)){if(JSON.stringify(a)===JSON.stringify(e))return a;throw new Error("A daily learning batch update must preserve its intake identity and use the next revision.")}return await this.upsertPayload(`INSERT INTO continual_learning_daily_batches
3
3
  (id, series_id, schedule_entry_id, day_ordinal, status, revision, payload, created_at, updated_at)
4
4
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
5
5
  ON CONFLICT(id) DO UPDATE SET status = excluded.status, revision = excluded.revision, payload = excluded.payload, updated_at = excluded.updated_at`,[e.id,e.seriesId,e.scheduleEntryId,e.dayOrdinal,e.status,e.revision,JSON.stringify(e),e.createdAt,e.updatedAt]),e}async getContinualLearningDailyBatch(i){return this.getParsedPayload("SELECT payload FROM continual_learning_daily_batches WHERE id = ?",[i],s.parse)}async listContinualLearningDailyBatches(i={}){return i.seriesId?this.listParsedPayloads("SELECT payload FROM continual_learning_daily_batches WHERE series_id = ? ORDER BY day_ordinal ASC",[i.seriesId],s.parse):this.listParsedPayloads("SELECT payload FROM continual_learning_daily_batches ORDER BY series_id, day_ordinal ASC",[],s.parse)}async saveContinualBenchIssueReview(i){let e=t.parse(i),a=await this.getContinualBenchIssueReview(e.id);if(a&&(a.seriesId!==e.seriesId||a.passLabel!==e.passLabel||a.packet.contentHash!==e.packet.contentHash||e.revision!==a.revision+1)){if(JSON.stringify(a)===JSON.stringify(e))return a;throw new Error("A Continual Support review update must preserve its sealed packet and use the next revision.")}return await this.upsertPayload(`INSERT INTO continual_bench_issue_reviews (id, series_id, pass_label, status, revision, payload, created_at, updated_at)
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as s,b as o}from"./chunk-CBD554GZ.js";import{a as u}from"./chunk-KCJVFLBB.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-UGDBMRCT.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as l}from"./chunk-FTQLQJQV.js";var T=class extends u{static{l(this,"SqliteConversationServingStore")}conversationTables=null;async ensureConversationTables(){if(await this.ready,!this.conversationTables){let e=this.writeQueue.then(async()=>{await this.exec("CREATE TABLE IF NOT EXISTS conversation_serving_grants (id TEXT PRIMARY KEY, revision INTEGER NOT NULL, payload TEXT NOT NULL)"),await this.exec("CREATE TABLE IF NOT EXISTS conversation_serving_executions (id TEXT PRIMARY KEY, grant_id TEXT NOT NULL, revision INTEGER NOT NULL, payload TEXT NOT NULL)")});this.writeQueue=e.catch(()=>{}),this.conversationTables=e}await this.conversationTables}async listConversationServingGrants(){return await this.ensureConversationTables(),await this.writeQueue,(await this.all("SELECT payload FROM conversation_serving_grants ORDER BY id",[])).map(e=>s.parse(JSON.parse(e.payload)))}async listConversationServingExecutions(e){return await this.ensureConversationTables(),await this.writeQueue,(await this.all("SELECT payload FROM conversation_serving_executions WHERE grant_id = ? ORDER BY id",[e])).map(i=>o.parse(JSON.parse(i.payload)))}async saveConversationServingGrant(e,i){let n=s.parse(e);return await this.saveConversationServingRow("conversation_serving_grants",n.id,n.revision,n,i),n}async saveConversationServingExecution(e,i){let n=o.parse(e);return await this.saveConversationServingRow("conversation_serving_executions",n.id,n.revision,n,i,n.grantId),n}async saveConversationServingRow(e,i,n,t,v,c){if(n!==v+1)throw new Error("Conversation serving revision is invalid.");await this.ensureConversationTables();let d=this.writeQueue.then(async()=>{await this.exec("BEGIN IMMEDIATE");try{let r=await this.get(`SELECT revision, payload FROM ${e} WHERE id = ?`,[i]);if((r?.revision??0)!==v)throw new Error("Conversation serving authority changed.");if(r){let a=JSON.parse(r.payload),g=t;if((e==="conversation_serving_grants"?["id","ownerInstanceId","teamId","profileId","projectId","hostedModelId","role","roleTargetId"]:["id","grantId","jobId","artifactHash","priorBindingId","leaseId","canarySeconds","createdAt"]).some(E=>a[E]!==g[E]))throw new Error("The retained serving identity cannot be replaced.")}if(e==="conversation_serving_grants"){let a=s.parse(t);if(a.enabled&&await this.get("SELECT id FROM conversation_serving_grants WHERE id != ? AND json_extract(payload, '$.enabled') = 1 AND json_extract(payload, '$.profileId') = ? AND json_extract(payload, '$.role') = ? AND json_extract(payload, '$.roleTargetId') = ? LIMIT 1",[i,a.profileId,a.role,a.roleTargetId]))throw new Error("This native serving target already has an enabled owner grant. Revoke it before registering another.")}r?await this.run(`UPDATE ${e} SET revision = ?, payload = ? WHERE id = ?`,[n,JSON.stringify(t),i]):c?await this.run(`INSERT INTO ${e} (id, grant_id, revision, payload) VALUES (?, ?, ?, ?)`,[i,c,n,JSON.stringify(t)]):await this.run(`INSERT INTO ${e} (id, revision, payload) VALUES (?, ?, ?)`,[i,n,JSON.stringify(t)]),await this.exec("COMMIT")}catch(r){throw await this.exec("ROLLBACK").catch(()=>{}),r}});this.writeQueue=d.catch(()=>{}),await d}};export{T as SqliteConversationServingStore};
2
+ import{a as s,b as o}from"./chunk-CBD554GZ.js";import{a as u}from"./chunk-KCJVFLBB.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-UGDBMRCT.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as l}from"./chunk-FTQLQJQV.js";var T=class extends u{static{l(this,"SqliteConversationServingStore")}conversationTables=null;async ensureConversationTables(){if(await this.ready,!this.conversationTables){let e=this.writeQueue.then(async()=>{await this.exec("CREATE TABLE IF NOT EXISTS conversation_serving_grants (id TEXT PRIMARY KEY, revision INTEGER NOT NULL, payload TEXT NOT NULL)"),await this.exec("CREATE TABLE IF NOT EXISTS conversation_serving_executions (id TEXT PRIMARY KEY, grant_id TEXT NOT NULL, revision INTEGER NOT NULL, payload TEXT NOT NULL)")});this.writeQueue=e.catch(()=>{}),this.conversationTables=e}await this.conversationTables}async listConversationServingGrants(){return await this.ensureConversationTables(),await this.writeQueue,(await this.all("SELECT payload FROM conversation_serving_grants ORDER BY id",[])).map(e=>s.parse(JSON.parse(e.payload)))}async listConversationServingExecutions(e){return await this.ensureConversationTables(),await this.writeQueue,(await this.all("SELECT payload FROM conversation_serving_executions WHERE grant_id = ? ORDER BY id",[e])).map(i=>o.parse(JSON.parse(i.payload)))}async saveConversationServingGrant(e,i){let n=s.parse(e);return await this.saveConversationServingRow("conversation_serving_grants",n.id,n.revision,n,i),n}async saveConversationServingExecution(e,i){let n=o.parse(e);return await this.saveConversationServingRow("conversation_serving_executions",n.id,n.revision,n,i,n.grantId),n}async saveConversationServingRow(e,i,n,t,v,c){if(n!==v+1)throw new Error("Conversation serving revision is invalid.");await this.ensureConversationTables();let d=this.writeQueue.then(async()=>{await this.exec("BEGIN IMMEDIATE");try{let r=await this.get(`SELECT revision, payload FROM ${e} WHERE id = ?`,[i]);if((r?.revision??0)!==v)throw new Error("Conversation serving authority changed.");if(r){let a=JSON.parse(r.payload),g=t;if((e==="conversation_serving_grants"?["id","ownerInstanceId","teamId","profileId","projectId","hostedModelId","role","roleTargetId"]:["id","grantId","jobId","artifactHash","priorBindingId","leaseId","canarySeconds","createdAt"]).some(E=>a[E]!==g[E]))throw new Error("The retained serving identity cannot be replaced.")}if(e==="conversation_serving_grants"){let a=s.parse(t);if(a.enabled&&await this.get("SELECT id FROM conversation_serving_grants WHERE id != ? AND json_extract(payload, '$.enabled') = 1 AND json_extract(payload, '$.profileId') = ? AND json_extract(payload, '$.role') = ? AND json_extract(payload, '$.roleTargetId') = ? LIMIT 1",[i,a.profileId,a.role,a.roleTargetId]))throw new Error("This native serving target already has an enabled owner grant. Revoke it before registering another.")}r?await this.run(`UPDATE ${e} SET revision = ?, payload = ? WHERE id = ?`,[n,JSON.stringify(t),i]):c?await this.run(`INSERT INTO ${e} (id, grant_id, revision, payload) VALUES (?, ?, ?, ?)`,[i,c,n,JSON.stringify(t)]):await this.run(`INSERT INTO ${e} (id, revision, payload) VALUES (?, ?, ?)`,[i,n,JSON.stringify(t)]),await this.exec("COMMIT")}catch(r){throw await this.exec("ROLLBACK").catch(()=>{}),r}});this.writeQueue=d.catch(()=>{}),await d}};export{T as SqliteConversationServingStore};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as c}from"./chunk-KCJVFLBB.js";import"./chunk-WXG3G2O6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import{h as d}from"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as p}from"./chunk-FTQLQJQV.js";var l=class extends c{static{p(this,"SqliteCreateImproveStore")}async getCreateImproveRun(e){await this.ready,await this.writeQueue;let t=await this.get("SELECT payload FROM create_improve_runs WHERE id = ?",[e]);return t?d.parse(JSON.parse(t.payload)):null}async listCreateImproveRuns(e={}){await this.ready,await this.writeQueue;let t=[],a=[];e.profileId&&(t.push("profile_id = ?"),a.push(e.profileId)),e.conversationId&&(t.push("conversation_id = ?"),a.push(e.conversationId)),e.targetKind&&(t.push("target_kind = ?"),a.push(e.targetKind)),e.targetId&&(t.push("target_id = ?"),a.push(e.targetId));let o=Array.isArray(e.state)?e.state:e.state?[e.state]:[];o.length>0&&(t.push(`state IN (${o.map(()=>"?").join(", ")})`),a.push(...o));let s=Math.max(1,Math.min(1e3,Math.trunc(e.limit??250)));return a.push(s),(await this.all(`SELECT payload
2
+ import{a as c}from"./chunk-KCJVFLBB.js";import"./chunk-2THZ6GZY.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import{h as d}from"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as p}from"./chunk-FTQLQJQV.js";var l=class extends c{static{p(this,"SqliteCreateImproveStore")}async getCreateImproveRun(e){await this.ready,await this.writeQueue;let t=await this.get("SELECT payload FROM create_improve_runs WHERE id = ?",[e]);return t?d.parse(JSON.parse(t.payload)):null}async listCreateImproveRuns(e={}){await this.ready,await this.writeQueue;let t=[],a=[];e.profileId&&(t.push("profile_id = ?"),a.push(e.profileId)),e.conversationId&&(t.push("conversation_id = ?"),a.push(e.conversationId)),e.targetKind&&(t.push("target_kind = ?"),a.push(e.targetKind)),e.targetId&&(t.push("target_id = ?"),a.push(e.targetId));let o=Array.isArray(e.state)?e.state:e.state?[e.state]:[];o.length>0&&(t.push(`state IN (${o.map(()=>"?").join(", ")})`),a.push(...o));let s=Math.max(1,Math.min(1e3,Math.trunc(e.limit??250)));return a.push(s),(await this.all(`SELECT payload
3
3
  FROM create_improve_runs
4
4
  ${t.length>0?`WHERE ${t.join(" AND ")}`:""}
5
5
  ORDER BY updated_at DESC
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as l}from"./chunk-KCJVFLBB.js";import{a as u}from"./chunk-U7D6Q744.js";import"./chunk-WXG3G2O6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import{d as i}from"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-SSHE6B7Z.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import{o as r,w as o}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as n}from"./chunk-FTQLQJQV.js";var c=class extends l{static{n(this,"SqliteDatasetStore")}async listDatasetCatalogTasksets(e){return await this.ready,await this.writeQueue,(await this.all(`SELECT
2
+ import{a as l}from"./chunk-KCJVFLBB.js";import{a as u}from"./chunk-L5L3H6CI.js";import"./chunk-2THZ6GZY.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import{d as i}from"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-AITV76GO.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import{o as r,w as o}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as n}from"./chunk-FTQLQJQV.js";var c=class extends l{static{n(this,"SqliteDatasetStore")}async listDatasetCatalogTasksets(e){return await this.ready,await this.writeQueue,(await this.all(`SELECT
3
3
  id AS taskset_id,
4
4
  CAST(json_extract(payload, '$.revision') AS INTEGER) AS taskset_revision,
5
5
  json_extract(payload, '$.datasetArtifact.id') AS artifact_id,
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as m}from"./chunk-7PDF2UX2.js";import{a as k}from"./chunk-KCJVFLBB.js";import{v as f}from"./chunk-WXG3G2O6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import{Hb as E,Ib as O,O as v,Ob as h,Pb as C,Q as y,f as R,h as p,m as H}from"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import{Ka as P,m as _}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as s,o as c}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as g}from"./chunk-FTQLQJQV.js";var w=class extends k{static{g(this,"SqliteEvaluationResultStore")}async saveProfileEvaluationGrade(a){let e=P.parse(a);c(e,"Profile evaluation grade");let n=await this.getProfileEvaluationGrade(e.contentHash);return n||(await this.upsertPayload("INSERT INTO profile_evaluation_grades (content_hash, payload) VALUES (?, ?) ON CONFLICT(content_hash) DO NOTHING",[e.contentHash,JSON.stringify(e)]),e)}async getProfileEvaluationGrade(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_grades WHERE content_hash = ?",[a],P.parse)}async saveProfileEvaluationReceipt(a){let e=R.parse(a);H(e);let n=await this.getProfileEvaluationReceipt(e.id);if(n){if(n.contentHash!==e.contentHash)throw new Error(`Profile evaluation receipt ${e.id} is immutable.`);return n}return await this.upsertPayload("INSERT INTO profile_evaluation_receipts (id, run_id, payload) VALUES (?, ?, ?)",[e.id,e.runManifest.id,JSON.stringify(e)]),e}async getProfileEvaluationReceipt(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_receipts WHERE id = ?",[a],R.parse)}async saveProfileEvaluationRun(a){let e=m.parse(a);c(e,"Profile evaluation run"),c(e.manifest,"Profile evaluation run manifest"),_(e.metric);let n=e.manifest.profileEvaluation;if(!n||n.profileId!==e.profileRef.profileId||e.metric.runManifest.id!==e.manifest.id||e.metric.runManifest.contentHash!==e.manifest.contentHash||s(e.receiptRefs)!==s(e.metric.receiptRefs))throw new Error("Profile evaluation run differs from its manifest or metric receipts.");if(e.receiptRefs.length!==e.manifest.population.length||e.gradeRefs.length!==e.receiptRefs.length)throw new Error("Profile evaluation run has an incomplete receipt or grade population.");for(let[t,u]of e.manifest.population.entries()){let d=e.receiptRefs[t],r=await this.getProfileEvaluationReceipt(d.id);if(!r||r.contentHash!==d.contentHash||r.runManifest.id!==e.manifest.id||r.runManifest.contentHash!==e.manifest.contentHash||r.id!==u.receiptId||r.taskId!==u.taskId||r.seed!==u.seed)throw new Error("Profile evaluation run references a missing or mismatched receipt.");let l=e.gradeRefs[t],o=await this.getProfileEvaluationGrade(l.contentHash);if(!o||o.contentHash!==l.contentHash||!r.graderEvidenceRefs.some(S=>S.id===l.id&&S.contentHash===l.contentHash))throw new Error("Profile evaluation run references a missing or mismatched grade.")}let i=await this.getProfileEvaluationRun(e.manifest.id);if(i){if(i.contentHash!==e.contentHash)throw new Error(`Profile evaluation run ${e.manifest.id} is immutable.`);return i}return await this.upsertPayload("INSERT INTO profile_evaluation_runs (id, profile_key, taskset_id, payload, created_at) VALUES (?, ?, ?, ?, ?)",[e.manifest.id,s(e.profileRef),e.manifest.tasksetRelease.id,JSON.stringify(e),e.completedAt]),e}async getProfileEvaluationRun(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_runs WHERE id = ?",[a],m.parse)}async listProfileEvaluationRuns(a){return this.listParsedPayloads("SELECT payload FROM profile_evaluation_runs WHERE profile_key = ? ORDER BY created_at DESC, id ASC",[s(f.parse(a))],m.parse)}async saveProfileEvaluationComparison(a,e){let n=f.parse(a),i=E.parse(e);c(i,"Profile evaluation comparison");let t=[];for(let d of i.members){let r=await this.getProfileEvaluationRun(d.runManifest.id);if(!r||s(r.profileRef)!==s(n)||r.manifest.contentHash!==d.runManifest.contentHash||r.metric.contentHash!==d.metricResultHash)throw new Error("Profile evaluation comparison references a missing or mismatched run.");t.push({manifest:r.manifest,result:r.metric})}if(O({id:i.id,members:t,createdAt:i.createdAt}).contentHash!==i.contentHash)throw new Error("Profile evaluation comparison differs from retained run evidence.");let u=await this.getProfileEvaluationComparison(i.id);if(u){if(u.contentHash!==i.contentHash)throw new Error(`Profile evaluation comparison ${i.id} is immutable.`);return u}return await this.upsertPayload("INSERT INTO profile_evaluation_comparisons (id, profile_key, payload, created_at) VALUES (?, ?, ?, ?)",[i.id,s(n),JSON.stringify(i),i.createdAt]),i}async getProfileEvaluationComparison(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_comparisons WHERE id = ?",[a],E.parse)}async listProfileEvaluationComparisons(a){return this.listParsedPayloads("SELECT payload FROM profile_evaluation_comparisons WHERE profile_key = ? ORDER BY created_at DESC, id ASC",[s(f.parse(a))],E.parse)}async saveProfileEvaluationSuiteRun(a,e,n){let i=f.parse(a),t=h.parse(n);c(t,"Profile evaluation suite run");let u=[];for(let l of t.members){let o=await this.getProfileEvaluationRun(l.runManifest.id);if(!o||s(o.profileRef)!==s(i)||o.manifest.contentHash!==l.runManifest.contentHash||o.contentHash!==l.runHash||o.passed!==l.passed||o.metric.value!==l.score)throw new Error("Profile evaluation suite references a missing or mismatched run.");u.push({definitionId:l.definitionId,manifest:o.manifest,runHash:o.contentHash,passed:o.passed,score:o.metric.value})}if(C({id:t.id,suiteId:t.suiteId,catalog:e,members:u,createdAt:t.createdAt,completedAt:t.completedAt}).contentHash!==t.contentHash)throw new Error("Profile evaluation suite differs from retained run evidence.");let r=await this.getProfileEvaluationSuiteRun(t.id);if(r){if(r.contentHash!==t.contentHash)throw new Error(`Profile evaluation suite run ${t.id} is immutable.`);return r}return await this.upsertPayload("INSERT INTO profile_evaluation_suite_runs (id, profile_key, payload, created_at) VALUES (?, ?, ?, ?)",[t.id,s(i),JSON.stringify(t),t.createdAt]),t}async getProfileEvaluationSuiteRun(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_suite_runs WHERE id = ?",[a],h.parse)}async listProfileEvaluationSuiteRuns(a){return this.listParsedPayloads("SELECT payload FROM profile_evaluation_suite_runs WHERE profile_key = ? ORDER BY created_at DESC, id ASC",[s(f.parse(a))],h.parse)}async saveBenchmarkRun(a){let e=v.parse(a.run);return c(e,"Benchmark run"),await this.upsertPayload(`INSERT INTO benchmark_runs (id, taskset_id, phase, payload, created_at)
2
+ import{a as m}from"./chunk-RIFWD5XM.js";import{a as k}from"./chunk-KCJVFLBB.js";import{v as f}from"./chunk-2THZ6GZY.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import{Hb as E,Ib as O,O as v,Ob as h,Pb as C,Q as y,f as R,h as p,m as H}from"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import{Ka as P,m as _}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as s,o as c}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as g}from"./chunk-FTQLQJQV.js";var w=class extends k{static{g(this,"SqliteEvaluationResultStore")}async saveProfileEvaluationGrade(a){let e=P.parse(a);c(e,"Profile evaluation grade");let n=await this.getProfileEvaluationGrade(e.contentHash);return n||(await this.upsertPayload("INSERT INTO profile_evaluation_grades (content_hash, payload) VALUES (?, ?) ON CONFLICT(content_hash) DO NOTHING",[e.contentHash,JSON.stringify(e)]),e)}async getProfileEvaluationGrade(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_grades WHERE content_hash = ?",[a],P.parse)}async saveProfileEvaluationReceipt(a){let e=R.parse(a);H(e);let n=await this.getProfileEvaluationReceipt(e.id);if(n){if(n.contentHash!==e.contentHash)throw new Error(`Profile evaluation receipt ${e.id} is immutable.`);return n}return await this.upsertPayload("INSERT INTO profile_evaluation_receipts (id, run_id, payload) VALUES (?, ?, ?)",[e.id,e.runManifest.id,JSON.stringify(e)]),e}async getProfileEvaluationReceipt(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_receipts WHERE id = ?",[a],R.parse)}async saveProfileEvaluationRun(a){let e=m.parse(a);c(e,"Profile evaluation run"),c(e.manifest,"Profile evaluation run manifest"),_(e.metric);let n=e.manifest.profileEvaluation;if(!n||n.profileId!==e.profileRef.profileId||e.metric.runManifest.id!==e.manifest.id||e.metric.runManifest.contentHash!==e.manifest.contentHash||s(e.receiptRefs)!==s(e.metric.receiptRefs))throw new Error("Profile evaluation run differs from its manifest or metric receipts.");if(e.receiptRefs.length!==e.manifest.population.length||e.gradeRefs.length!==e.receiptRefs.length)throw new Error("Profile evaluation run has an incomplete receipt or grade population.");for(let[t,u]of e.manifest.population.entries()){let d=e.receiptRefs[t],r=await this.getProfileEvaluationReceipt(d.id);if(!r||r.contentHash!==d.contentHash||r.runManifest.id!==e.manifest.id||r.runManifest.contentHash!==e.manifest.contentHash||r.id!==u.receiptId||r.taskId!==u.taskId||r.seed!==u.seed)throw new Error("Profile evaluation run references a missing or mismatched receipt.");let l=e.gradeRefs[t],o=await this.getProfileEvaluationGrade(l.contentHash);if(!o||o.contentHash!==l.contentHash||!r.graderEvidenceRefs.some(S=>S.id===l.id&&S.contentHash===l.contentHash))throw new Error("Profile evaluation run references a missing or mismatched grade.")}let i=await this.getProfileEvaluationRun(e.manifest.id);if(i){if(i.contentHash!==e.contentHash)throw new Error(`Profile evaluation run ${e.manifest.id} is immutable.`);return i}return await this.upsertPayload("INSERT INTO profile_evaluation_runs (id, profile_key, taskset_id, payload, created_at) VALUES (?, ?, ?, ?, ?)",[e.manifest.id,s(e.profileRef),e.manifest.tasksetRelease.id,JSON.stringify(e),e.completedAt]),e}async getProfileEvaluationRun(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_runs WHERE id = ?",[a],m.parse)}async listProfileEvaluationRuns(a){return this.listParsedPayloads("SELECT payload FROM profile_evaluation_runs WHERE profile_key = ? ORDER BY created_at DESC, id ASC",[s(f.parse(a))],m.parse)}async saveProfileEvaluationComparison(a,e){let n=f.parse(a),i=E.parse(e);c(i,"Profile evaluation comparison");let t=[];for(let d of i.members){let r=await this.getProfileEvaluationRun(d.runManifest.id);if(!r||s(r.profileRef)!==s(n)||r.manifest.contentHash!==d.runManifest.contentHash||r.metric.contentHash!==d.metricResultHash)throw new Error("Profile evaluation comparison references a missing or mismatched run.");t.push({manifest:r.manifest,result:r.metric})}if(O({id:i.id,members:t,createdAt:i.createdAt}).contentHash!==i.contentHash)throw new Error("Profile evaluation comparison differs from retained run evidence.");let u=await this.getProfileEvaluationComparison(i.id);if(u){if(u.contentHash!==i.contentHash)throw new Error(`Profile evaluation comparison ${i.id} is immutable.`);return u}return await this.upsertPayload("INSERT INTO profile_evaluation_comparisons (id, profile_key, payload, created_at) VALUES (?, ?, ?, ?)",[i.id,s(n),JSON.stringify(i),i.createdAt]),i}async getProfileEvaluationComparison(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_comparisons WHERE id = ?",[a],E.parse)}async listProfileEvaluationComparisons(a){return this.listParsedPayloads("SELECT payload FROM profile_evaluation_comparisons WHERE profile_key = ? ORDER BY created_at DESC, id ASC",[s(f.parse(a))],E.parse)}async saveProfileEvaluationSuiteRun(a,e,n){let i=f.parse(a),t=h.parse(n);c(t,"Profile evaluation suite run");let u=[];for(let l of t.members){let o=await this.getProfileEvaluationRun(l.runManifest.id);if(!o||s(o.profileRef)!==s(i)||o.manifest.contentHash!==l.runManifest.contentHash||o.contentHash!==l.runHash||o.passed!==l.passed||o.metric.value!==l.score)throw new Error("Profile evaluation suite references a missing or mismatched run.");u.push({definitionId:l.definitionId,manifest:o.manifest,runHash:o.contentHash,passed:o.passed,score:o.metric.value})}if(C({id:t.id,suiteId:t.suiteId,catalog:e,members:u,createdAt:t.createdAt,completedAt:t.completedAt}).contentHash!==t.contentHash)throw new Error("Profile evaluation suite differs from retained run evidence.");let r=await this.getProfileEvaluationSuiteRun(t.id);if(r){if(r.contentHash!==t.contentHash)throw new Error(`Profile evaluation suite run ${t.id} is immutable.`);return r}return await this.upsertPayload("INSERT INTO profile_evaluation_suite_runs (id, profile_key, payload, created_at) VALUES (?, ?, ?, ?)",[t.id,s(i),JSON.stringify(t),t.createdAt]),t}async getProfileEvaluationSuiteRun(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_suite_runs WHERE id = ?",[a],h.parse)}async listProfileEvaluationSuiteRuns(a){return this.listParsedPayloads("SELECT payload FROM profile_evaluation_suite_runs WHERE profile_key = ? ORDER BY created_at DESC, id ASC",[s(f.parse(a))],h.parse)}async saveBenchmarkRun(a){let e=v.parse(a.run);return c(e,"Benchmark run"),await this.upsertPayload(`INSERT INTO benchmark_runs (id, taskset_id, phase, payload, created_at)
3
3
  VALUES (?, ?, ?, ?, ?)
4
4
  ON CONFLICT(id) DO NOTHING`,[e.id,a.tasksetId,e.phase,JSON.stringify(e),e.createdAt]),e}async listBenchmarkRuns(a){return this.listParsedPayloads("SELECT payload FROM benchmark_runs WHERE taskset_id = ? ORDER BY created_at DESC, id ASC",[a],v.parse)}async saveBenchmarkComparison(a){let e=y.parse(a.comparison);return c(e,"Benchmark comparison"),await this.upsertPayload(`INSERT INTO benchmark_comparisons (id, taskset_id, payload, created_at)
5
5
  VALUES (?, ?, ?, ?)
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as h,b as d,c as p,h as N}from"./chunk-3JVZ7OCQ.js";import"./chunk-O5ZOW474.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import{a as T}from"./chunk-KCJVFLBB.js";import"./chunk-WXG3G2O6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import{Aa as I,F as u}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as l}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as c}from"./chunk-FTQLQJQV.js";function L(o,e){let i=d(o,e.scope,e.executionId);if(i.ownerActorId!==e.actorId||!i.completedAt)throw new Error("human_local_publication_source_denied");return o.exec("CREATE TABLE IF NOT EXISTS human_local_publications(scope TEXT NOT NULL,actor_id TEXT NOT NULL,execution_id TEXT NOT NULL,operation_id TEXT NOT NULL,execution_hash TEXT NOT NULL,publication TEXT NOT NULL,PRIMARY KEY(scope,actor_id,execution_id,operation_id))"),i}c(L,"setup");function w(o,e){if(L(o,e).executionHash!==e.executionHash)throw new Error("human_local_publication_source_changed");let t=o.get("SELECT publication,execution_hash FROM human_local_publications WHERE scope=? AND actor_id=? AND execution_id=? AND operation_id=?",[e.scope,e.actorId,e.executionId,e.operationId]);if(t){if(t.execution_hash!==e.executionHash||l(JSON.parse(t.publication))!==l(e.publication))throw new Error("human_local_publication_operation_conflict");return}o.run("INSERT INTO human_local_publications VALUES(?,?,?,?,?,?)",[e.scope,e.actorId,e.executionId,e.operationId,e.executionHash,JSON.stringify(e.publication)])}c(w,"retainHumanLocalPublication");function O(o,e){let i=L(o,e);return o.all("SELECT publication,execution_hash FROM human_local_publications WHERE scope=? AND actor_id=? AND execution_id=? ORDER BY operation_id LIMIT 1001",[e.scope,e.actorId,e.executionId]).map(t=>{if(t.execution_hash!==i.executionHash)throw new Error("human_local_publication_source_changed");return JSON.parse(t.publication)})}c(O,"readHumanLocalPublications");function _(o,e){let i=d(o,e.teamId,e.executionId);if(i.ownerActorId!==e.actorId)throw new Error("live_agent_account_denied");let t=o.get("SELECT owner_id FROM local_experiment_executions WHERE team_id=? AND id=?",[e.teamId,e.executionId]),n=p(o,e.teamId,e.executionId).find(g=>g.receiptId===e.receiptId);if(!n||n.admission.request.model.providerId!=="claude-code")throw new Error("live_agent_case_denied");let a=o.get("SELECT payload FROM local_experiment_events WHERE team_id=? AND execution_id=? AND case_id=? AND type='external.start' ORDER BY sequence LIMIT 1",[e.teamId,e.executionId,e.receiptId]);if(!a||JSON.parse(a.payload).sessionId!==e.sessionId)throw new Error("live_agent_session_stale");o.exec("CREATE TABLE IF NOT EXISTS human_live_controls(team_id TEXT NOT NULL,actor_id TEXT NOT NULL,operation_id TEXT NOT NULL,request_hash TEXT NOT NULL,state TEXT NOT NULL,PRIMARY KEY(team_id,actor_id,operation_id))");let{phase:r,ownerId:R,...E}=e,m=l(E),s=o.get("SELECT request_hash,state FROM human_live_controls WHERE team_id=? AND actor_id=? AND operation_id=?",[e.teamId,e.actorId,e.operationId]);if(s&&s.request_hash!==m)throw new Error("live_agent_operation_conflict");if(e.phase==="inspect")return s?{replay:!0,state:s.state}:null;if(N(o,e.ownerId),t?.owner_id!==e.ownerId)throw new Error("live_agent_execution_lease_lost");if(e.phase==="acknowledge"){if(!s)throw new Error("live_agent_operation_missing");return s.state==="acknowledged"?{replay:!0,state:"acknowledged"}:(v(o,e,"external.control_receipt",{sessionId:e.sessionId,operationId:e.operationId,action:e.action,transport:"process_stdin",state:"acknowledged",occurredAt:new Date().toISOString()}),o.run("UPDATE human_live_controls SET state='acknowledged' WHERE team_id=? AND actor_id=? AND operation_id=?",[e.teamId,e.actorId,e.operationId]),{replay:!1,state:"acknowledged"})}if(s)return{replay:!0,state:s.state};if(o.get("SELECT c.operation_id FROM human_live_controls c JOIN local_experiment_events e ON e.team_id=c.team_id AND json_extract(e.payload,'$.actorId')=c.actor_id AND json_extract(e.payload,'$.operationId')=c.operation_id WHERE c.team_id=? AND c.actor_id=? AND c.state='prepared' AND e.execution_id=? AND e.case_id=? AND e.type='external.human_intervention' LIMIT 1",[e.teamId,e.actorId,e.executionId,e.receiptId]))throw new Error("live_agent_prior_delivery_unknown");if(n.status!=="running"||i.completedAt)throw new Error("live_agent_already_sealed");return o.run("INSERT INTO human_live_controls VALUES(?,?,?,?,'prepared')",[e.teamId,e.actorId,e.operationId,m]),v(o,e,"external.human_intervention",{...E,occurredAt:new Date().toISOString()}),{replay:!1,state:"prepared"}}c(_,"writeHumanLiveControl");function v(o,e,i,t){let n=JSON.stringify(t),a=Buffer.byteLength(n),r=o.get("SELECT event_count,byte_count FROM local_experiment_trace_budgets WHERE team_id=? AND execution_id=?",[e.teamId,e.executionId]);if(a>1048576||(r?.event_count??0)>=2e4||(r?.byte_count??0)+a>67108864)throw new Error("live_agent_control_too_large");o.run("INSERT INTO local_experiment_events(team_id,execution_id,case_id,type,payload) VALUES(?,?,?,?,?)",[e.teamId,e.executionId,e.receiptId,i,n]),o.run("INSERT INTO local_experiment_trace_budgets(team_id,execution_id,event_count,byte_count) VALUES(?,?,1,?) ON CONFLICT(team_id,execution_id) DO UPDATE SET event_count=event_count+1,byte_count=byte_count+excluded.byte_count",[e.teamId,e.executionId,a])}c(v,"appendControlEvent");var y=`
2
+ import{a as h,b as d,c as p,h as N}from"./chunk-SRK4WX7D.js";import"./chunk-5TTQCT3G.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import{a as T}from"./chunk-KCJVFLBB.js";import"./chunk-2THZ6GZY.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import{Aa as I,F as u}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as l}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as c}from"./chunk-FTQLQJQV.js";function L(o,e){let i=d(o,e.scope,e.executionId);if(i.ownerActorId!==e.actorId||!i.completedAt)throw new Error("human_local_publication_source_denied");return o.exec("CREATE TABLE IF NOT EXISTS human_local_publications(scope TEXT NOT NULL,actor_id TEXT NOT NULL,execution_id TEXT NOT NULL,operation_id TEXT NOT NULL,execution_hash TEXT NOT NULL,publication TEXT NOT NULL,PRIMARY KEY(scope,actor_id,execution_id,operation_id))"),i}c(L,"setup");function w(o,e){if(L(o,e).executionHash!==e.executionHash)throw new Error("human_local_publication_source_changed");let t=o.get("SELECT publication,execution_hash FROM human_local_publications WHERE scope=? AND actor_id=? AND execution_id=? AND operation_id=?",[e.scope,e.actorId,e.executionId,e.operationId]);if(t){if(t.execution_hash!==e.executionHash||l(JSON.parse(t.publication))!==l(e.publication))throw new Error("human_local_publication_operation_conflict");return}o.run("INSERT INTO human_local_publications VALUES(?,?,?,?,?,?)",[e.scope,e.actorId,e.executionId,e.operationId,e.executionHash,JSON.stringify(e.publication)])}c(w,"retainHumanLocalPublication");function O(o,e){let i=L(o,e);return o.all("SELECT publication,execution_hash FROM human_local_publications WHERE scope=? AND actor_id=? AND execution_id=? ORDER BY operation_id LIMIT 1001",[e.scope,e.actorId,e.executionId]).map(t=>{if(t.execution_hash!==i.executionHash)throw new Error("human_local_publication_source_changed");return JSON.parse(t.publication)})}c(O,"readHumanLocalPublications");function _(o,e){let i=d(o,e.teamId,e.executionId);if(i.ownerActorId!==e.actorId)throw new Error("live_agent_account_denied");let t=o.get("SELECT owner_id FROM local_experiment_executions WHERE team_id=? AND id=?",[e.teamId,e.executionId]),n=p(o,e.teamId,e.executionId).find(g=>g.receiptId===e.receiptId);if(!n||n.admission.request.model.providerId!=="claude-code")throw new Error("live_agent_case_denied");let a=o.get("SELECT payload FROM local_experiment_events WHERE team_id=? AND execution_id=? AND case_id=? AND type='external.start' ORDER BY sequence LIMIT 1",[e.teamId,e.executionId,e.receiptId]);if(!a||JSON.parse(a.payload).sessionId!==e.sessionId)throw new Error("live_agent_session_stale");o.exec("CREATE TABLE IF NOT EXISTS human_live_controls(team_id TEXT NOT NULL,actor_id TEXT NOT NULL,operation_id TEXT NOT NULL,request_hash TEXT NOT NULL,state TEXT NOT NULL,PRIMARY KEY(team_id,actor_id,operation_id))");let{phase:r,ownerId:R,...E}=e,m=l(E),s=o.get("SELECT request_hash,state FROM human_live_controls WHERE team_id=? AND actor_id=? AND operation_id=?",[e.teamId,e.actorId,e.operationId]);if(s&&s.request_hash!==m)throw new Error("live_agent_operation_conflict");if(e.phase==="inspect")return s?{replay:!0,state:s.state}:null;if(N(o,e.ownerId),t?.owner_id!==e.ownerId)throw new Error("live_agent_execution_lease_lost");if(e.phase==="acknowledge"){if(!s)throw new Error("live_agent_operation_missing");return s.state==="acknowledged"?{replay:!0,state:"acknowledged"}:(v(o,e,"external.control_receipt",{sessionId:e.sessionId,operationId:e.operationId,action:e.action,transport:"process_stdin",state:"acknowledged",occurredAt:new Date().toISOString()}),o.run("UPDATE human_live_controls SET state='acknowledged' WHERE team_id=? AND actor_id=? AND operation_id=?",[e.teamId,e.actorId,e.operationId]),{replay:!1,state:"acknowledged"})}if(s)return{replay:!0,state:s.state};if(o.get("SELECT c.operation_id FROM human_live_controls c JOIN local_experiment_events e ON e.team_id=c.team_id AND json_extract(e.payload,'$.actorId')=c.actor_id AND json_extract(e.payload,'$.operationId')=c.operation_id WHERE c.team_id=? AND c.actor_id=? AND c.state='prepared' AND e.execution_id=? AND e.case_id=? AND e.type='external.human_intervention' LIMIT 1",[e.teamId,e.actorId,e.executionId,e.receiptId]))throw new Error("live_agent_prior_delivery_unknown");if(n.status!=="running"||i.completedAt)throw new Error("live_agent_already_sealed");return o.run("INSERT INTO human_live_controls VALUES(?,?,?,?,'prepared')",[e.teamId,e.actorId,e.operationId,m]),v(o,e,"external.human_intervention",{...E,occurredAt:new Date().toISOString()}),{replay:!1,state:"prepared"}}c(_,"writeHumanLiveControl");function v(o,e,i,t){let n=JSON.stringify(t),a=Buffer.byteLength(n),r=o.get("SELECT event_count,byte_count FROM local_experiment_trace_budgets WHERE team_id=? AND execution_id=?",[e.teamId,e.executionId]);if(a>1048576||(r?.event_count??0)>=2e4||(r?.byte_count??0)+a>67108864)throw new Error("live_agent_control_too_large");o.run("INSERT INTO local_experiment_events(team_id,execution_id,case_id,type,payload) VALUES(?,?,?,?,?)",[e.teamId,e.executionId,e.receiptId,i,n]),o.run("INSERT INTO local_experiment_trace_budgets(team_id,execution_id,event_count,byte_count) VALUES(?,?,1,?) ON CONFLICT(team_id,execution_id) DO UPDATE SET event_count=event_count+1,byte_count=byte_count+excluded.byte_count",[e.teamId,e.executionId,a])}c(v,"appendControlEvent");var y=`
3
3
  CREATE TABLE IF NOT EXISTS human_review_revisions(scope TEXT NOT NULL,id TEXT NOT NULL,revision INTEGER NOT NULL,payload TEXT NOT NULL,PRIMARY KEY(scope,id,revision));
4
4
  CREATE TABLE IF NOT EXISTS human_reviews(scope TEXT NOT NULL,id TEXT NOT NULL,revision INTEGER NOT NULL,project_id TEXT NOT NULL,payload TEXT NOT NULL,PRIMARY KEY(scope,id));
5
5
  CREATE INDEX IF NOT EXISTS human_reviews_project_idx ON human_reviews(scope,project_id,id);
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import"./chunk-WXG3G2O6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import{H as d}from"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";function f(e){if(Array.isArray(e)){let r=!1,n=e.map(c=>{let t=f(c);return r||=t.changed,t.value});return{value:r?n:e,changed:r}}if(!u(e))return{value:e,changed:!1};let o=!1,i={};for(let[r,n]of Object.entries(e)){if(r==="learnedPreference"&&n!==null){let t=u(n)?Object.fromEntries(Object.entries(n).filter(([l])=>l!=="qualificationKind")):n,a=d.safeParse(t);i[r]=a.success?a.data:null,o||=!a.success||t!==n;continue}let c=f(n);i[r]=c.value,o||=c.changed}return{value:o?i:e,changed:o}}s(f,"sanitizeUnverifiableLearnedPreferenceBindings");function u(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}s(u,"isRecord");export{f as sanitizeUnverifiableLearnedPreferenceBindings};
2
+ import"./chunk-2THZ6GZY.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import{H as d}from"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";function f(e){if(Array.isArray(e)){let r=!1,n=e.map(c=>{let t=f(c);return r||=t.changed,t.value});return{value:r?n:e,changed:r}}if(!u(e))return{value:e,changed:!1};let o=!1,i={};for(let[r,n]of Object.entries(e)){if(r==="learnedPreference"&&n!==null){let t=u(n)?Object.fromEntries(Object.entries(n).filter(([l])=>l!=="qualificationKind")):n,a=d.safeParse(t);i[r]=a.success?a.data:null,o||=!a.success||t!==n;continue}let c=f(n);i[r]=c.value,o||=c.changed}return{value:o?i:e,changed:o}}s(f,"sanitizeUnverifiableLearnedPreferenceBindings");function u(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}s(u,"isRecord");export{f as sanitizeUnverifiableLearnedPreferenceBindings};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as D,c as J}from"./chunk-XVDFJ3ZF.js";import{a as N,b as u,c as R,d as E,e as w,f as v,g as P,h as x,i as j}from"./chunk-3JVZ7OCQ.js";import{h as c}from"./chunk-O5ZOW474.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import{a as M}from"./chunk-KCJVFLBB.js";import{Xb as f,_b as h,bc as O,cc as W,vc as F}from"./chunk-WXG3G2O6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import{ja as L}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import{e as y}from"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as d}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as I}from"./chunk-X2J2P5ZT.js";import{a as _}from"./chunk-FTQLQJQV.js";function Y(s,e){let t=s.all(`SELECT e.id,e.payload,
2
+ import{a as D,c as J}from"./chunk-XVDFJ3ZF.js";import{a as N,b as u,c as R,d as E,e as w,f as v,g as P,h as x,i as j}from"./chunk-SRK4WX7D.js";import{h as c}from"./chunk-5TTQCT3G.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import{a as M}from"./chunk-KCJVFLBB.js";import{Xb as f,_b as h,bc as O,cc as W,vc as F}from"./chunk-2THZ6GZY.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import{ja as L}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import{e as y}from"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as d}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as I}from"./chunk-X2J2P5ZT.js";import{a as _}from"./chunk-FTQLQJQV.js";function Y(s,e){let t=s.all(`SELECT e.id,e.payload,
3
3
  COALESCE(json_extract(c.payload,'$.configuration.request.name'),json_extract(d.payload,'$.configuration.request.name')) AS name,
4
4
  count(*) OVER () AS total FROM local_experiment_executions e
5
5
  LEFT JOIN local_experiment_configurations c ON c.team_id=e.team_id AND c.execution_id=e.id
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as B}from"./chunk-OI4DAZ4U.js";import{a as E}from"./chunk-KCJVFLBB.js";import"./chunk-WXG3G2O6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import{j as v,k as y}from"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import{d as k}from"./chunk-2GEZ3ZY7.js";import{wa as M}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import{H as u}from"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import{M as R,da as g}from"./chunk-ZEOYNUHL.js";import{Aa as s}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as d}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as p}from"./chunk-FTQLQJQV.js";var T=class extends E{static{p(this,"SqliteModelBatchReviewStore")}async findModelBatchReview(t,r){return this.modelBatchReviewTransaction(t,r)}async beginModelBatchReview(t,r,o){let e=await this.modelBatchReviewTransaction(t,r,o);if(!e)throw new Error("Model batch review was not created.");return e}async modelBatchReviewTransaction(t,r,o){let e=k.parse(r);await this.ready;let l=this.writeQueue.then(async()=>{let a=this.db;if(!a)throw new Error("Model review store is closed.");a.exec("BEGIN IMMEDIATE");let w=!0,h=B(a,t,()=>{if(!w)throw new Error("Model review transaction is closed.")});try{let i=a.get("SELECT payload FROM model_projects WHERE id = ? AND profile_id = ?",[e.modelId,t]);if(!i)throw new s("model_not_found",404);let n=u.parse(JSON.parse(i.payload)),m=await v(h,e);if(m||!o)return a.exec("COMMIT"),m;if(n.revision!==e.expectedModelRevision||!n.trainingSetup.tasksetRef||!R(n.trainingSetup.tasksetRef,e.tasksetRef))throw new s("model_revision_conflict",409);let f=a.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ? AND profile_id = ?",[e.tasksetRef.id,e.tasksetRef.revision,t]),c=f?M.parse(JSON.parse(f.payload)):null;if(!c||c.contentHash!==e.tasksetRef.contentHash||d(c.metadata.learning)!==d(g(o.taskset)))throw new s("model_review_package_mismatch",409);let _=await y(h,{scope:t,request:e,package:o,now:new Date().toISOString()});return a.exec("COMMIT"),_}catch(i){throw a.exec("ROLLBACK"),i}finally{w=!1}});return this.writeQueue=l.then(()=>{},()=>{}),l}};export{T as SqliteModelBatchReviewStore};
2
+ import{b as B}from"./chunk-OI4DAZ4U.js";import{a as E}from"./chunk-KCJVFLBB.js";import"./chunk-2THZ6GZY.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import{j as v,k as y}from"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import{d as k}from"./chunk-2GEZ3ZY7.js";import{wa as M}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import{H as u}from"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import{M as R,da as g}from"./chunk-ZEOYNUHL.js";import{Aa as s}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as d}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as p}from"./chunk-FTQLQJQV.js";var T=class extends E{static{p(this,"SqliteModelBatchReviewStore")}async findModelBatchReview(t,r){return this.modelBatchReviewTransaction(t,r)}async beginModelBatchReview(t,r,o){let e=await this.modelBatchReviewTransaction(t,r,o);if(!e)throw new Error("Model batch review was not created.");return e}async modelBatchReviewTransaction(t,r,o){let e=k.parse(r);await this.ready;let l=this.writeQueue.then(async()=>{let a=this.db;if(!a)throw new Error("Model review store is closed.");a.exec("BEGIN IMMEDIATE");let w=!0,h=B(a,t,()=>{if(!w)throw new Error("Model review transaction is closed.")});try{let i=a.get("SELECT payload FROM model_projects WHERE id = ? AND profile_id = ?",[e.modelId,t]);if(!i)throw new s("model_not_found",404);let n=u.parse(JSON.parse(i.payload)),m=await v(h,e);if(m||!o)return a.exec("COMMIT"),m;if(n.revision!==e.expectedModelRevision||!n.trainingSetup.tasksetRef||!R(n.trainingSetup.tasksetRef,e.tasksetRef))throw new s("model_revision_conflict",409);let f=a.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ? AND profile_id = ?",[e.tasksetRef.id,e.tasksetRef.revision,t]),c=f?M.parse(JSON.parse(f.payload)):null;if(!c||c.contentHash!==e.tasksetRef.contentHash||d(c.metadata.learning)!==d(g(o.taskset)))throw new s("model_review_package_mismatch",409);let _=await y(h,{scope:t,request:e,package:o,now:new Date().toISOString()});return a.exec("COMMIT"),_}catch(i){throw a.exec("ROLLBACK"),i}finally{w=!1}});return this.writeQueue=l.then(()=>{},()=>{}),l}};export{T as SqliteModelBatchReviewStore};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as C,b as Te}from"./chunk-NDNSLCPE.js";import{a as Q,d as ve}from"./chunk-CWE2N3JI.js";import{d as we,f as Ie,g as ye}from"./chunk-O4YHISU2.js";import{a as he,b as F,c as J,d as ge,e as ke,f as Me}from"./chunk-DUR32LJG.js";import"./chunk-Z5R4OSGC.js";import{a as me,d as B,e as b,g as fe}from"./chunk-QKGNAYSC.js";import{b as Se,c as Pe,d as W}from"./chunk-HT6ILPD6.js";import{b as pe}from"./chunk-VMW23TIZ.js";import{a as ue}from"./chunk-KCJVFLBB.js";import"./chunk-WXG3G2O6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import{b as de,c as ce,z as le}from"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import{Ca as x,Da as ie,Ia as ne,M as ee,O as L,R as te,U as re,oa as ae,wa as oe,za as se}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import{D as X,H as v,O as Y,U as Z,j as k,x as N}from"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import{L as g,M as R,O as G,S as V,mb as K}from"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as I}from"./chunk-X2J2P5ZT.js";import{a as m}from"./chunk-FTQLQJQV.js";import qe from"node:path";import{createHash as xe}from"node:crypto";function j(o){let{request:a,resolved:r}=b(o.request,o.package),{starter:t,...n}=r,e=a.rewardBindingRef&&!R(a.rewardBindingRef,g(r.rewardBinding));if(e&&(!o.rewardSelection||!R(a.rewardBindingRef,g(o.rewardSelection.rewardBinding))))throw new Error("The selected starter Reward is unavailable for package preparation.");let i=re({owner:{scopeId:a.profileId,modelId:a.modelId},source:n,...e?o.rewardSelection:{rewardBinding:n.rewardBinding,rewards:n.rewards,assets:n.assets}}),{taskset:s,taskDefinition:p,rewardBinding:l,rewards:d,assets:h}=i;if(o.source.profileId!==a.profileId||o.source.sourceHash!==t.contentHash)throw new Error("Starter source must belong to this Profile and pin the catalog package.");let u=i.execution!==void 0,y=s.environment.kind==="text"&&s.environment.entrypoint==="openpond.text.v1"&&!s.environment.stateful&&(!s.environmentRelease&&!s.verifierSetRelease||i.executionResources!==void 0)&&!s.capabilities.length&&!s.tools.length;if(!["sft","grpo"].includes(a.method)||p.harness||!y&&!u||s.tasks.some(c=>c.artifactRefs.length)||s.graders.some(c=>c.kind==="model_judge"&&(!c.model||c.calibrationStatus!=="passed")))throw new Error("This starter requires an additional training or environment adapter before preparation.");let w=new Set(o.approvedTrainingTaskIds);if(w.size!==o.approvedTrainingTaskIds.length)throw new Error("Starter training approvals must be unique.");for(let c of w){let P=s.tasks.find(H=>H.id===c);if(!P||P.split!=="train")throw new Error(`Starter approval must reference a training task: ${c}.`);if(a.method==="sft"&&P.expectedOutput===null)throw new Error(`SFT starter approval requires a reviewed target: ${c}.`)}if(a.method==="grpo"&&s.tasks.some(c=>c.split==="train"&&!w.has(c.id)))throw new Error("GRPO starter preparation requires approval of every training task.");for(let c of o.fixtures){if(!s.tasks.some(P=>P.id===c.taskId))throw new Error(`Starter fixture references an unknown task: ${c.taskId}.`);u&&!c.infrastructureError&&ee.parse(c.metadata.toolScript)}let E=s.id,f=se({profileId:a.profileId,id:`${E}-draft`,name:t.name,now:o.createdAt}),S=[];for(let c of s.graders){if(c.kind!=="custom_verifier")continue;let P=h.find(D=>D.id===c.verifierRef.id);if(!P)throw new Error(`Starter verifier asset is missing: ${c.id}.`);let H=c.verifierRef.path;S.some(D=>D.path===H)||S.push({path:H,role:"verifier",content:V(P,c.verifierRef)})}let _=ae.parse({...f,objective:p.instructions,metrics:s.metrics??f.metrics,sourceRefs:[o.source],policy:s.policy,environment:{...f.environment,kind:u?"agent":"chat",entrypoint:s.environment.entrypoint,stateful:s.environment.stateful,toolNames:s.tools.map(c=>c.name),deterministicSeeds:s.environment.deterministicSeeds,defaultTimeoutMs:s.environment.defaultTimeoutMs,networkPolicy:s.environment.networkPolicy,metadata:{portableEnvironment:s.environment,portableTools:s.tools,...i.executionResources?{portableExecutionResources:i.executionResources}:i.execution?{portableExecutionResources:{environment:i.execution.environment,verifierSet:i.execution.verifierSet}}:{}}},output:{mode:"structured_json",jsonSchema:p.outputSchema,renderer:null},capabilities:{...f.capabilities,taskKind:u?"single_agent":"chat",requiresTools:u,requiresState:u,supportedSignals:a.method==="grpo"?["reward"]:["demonstration"],compatibleMethods:[a.method],rewardKinds:[...new Set(s.graders.map(c=>c.kind==="human"?"human":c.kind==="model_judge"?"model_judge":"deterministic"))],requiresPrivilegedGrading:!0,environmentPlacements:["local","remote"]},tasks:s.tasks.map(({artifactRefs:c,...P})=>({...P,schemaVersion:"openpond.taskData.v1",sourceRefs:[o.source.id],metadata:{exampleOrigin:"curated_starter",starter:g(t),portableTaskRecord:{...P,artifactRefs:[]}}})),graders:ie(l,d,h),graderFixtures:o.fixtures,learningSignals:{...f.learningSignals,rewards:a.method==="grpo"?s.tasks.filter(c=>w.has(c.id)).map(c=>({kind:"reward",id:`starter-reward-${c.id}`,taskId:c.id,task:p.instructions,rules:[{id:l.id,points:1,condition:"Execute the published Reward binding with its declared normalization, weights and required gates."}],otherwisePoints:0,executable:!0,approved:!0,confidence:1,sourceRefs:[o.source.id],artifactRef:l.id,metadata:{starter:g(t),rewardBinding:g(l),approvalOrigin:"catalog_publication"}})):[],demonstrations:a.method==="sft"?s.tasks.filter(c=>w.has(c.id)).map(c=>({kind:"demonstration",id:`starter-target-${c.id}`,taskId:c.id,sourceRefs:[o.source.id],artifactRef:s.id,approved:!0,confidence:1,prompt:null,response:JSON.stringify(c.expectedOutput),metadata:{starter:g(t),approvalOrigin:"catalog_publication"}})):[]},metadata:{starter:g(t),starterTasksetRelease:g(s),taskDefinition:g(p),rewardBinding:g(l),rewardExecution:{binding:l,rewards:d},portableCapabilities:s.capabilities,derivedPortableMetadata:s.metadata,modelTasksetDerivation:s.metadata.modelTasksetDerivation}}),M=le({draft:_,now:o.createdAt,tasksetId:E,sourcePackageHash:s.contentHash});return M.metrics=s.metrics,s.metadata.tasksetOutputContract===void 0?delete M.metadata.tasksetOutputContract:M.metadata.tasksetOutputContract=s.metadata.tasksetOutputContract,M.contentHash=x(M),{draft:_,taskset:M,generatedFiles:S,resources:i}}m(j,"prepareModelStarterTaskset");function O(o,a){let r=B(a),t=o.get("SELECT request_hash, payload FROM model_starter_creation_operations WHERE profile_id = ? AND operation_id = ?",[r.profileId,r.operationId]);if(!t)return null;if(t.request_hash!==Re(r))throw new Error("Starter creation operation was already used with different configuration.");return v.parse(JSON.parse(t.payload))}m(O,"findModelStarterCreation");async function Ee(o,a){let r=B(a.request);if(r.learning)throw new Error("Create this Model in a hosted workspace to enable continual learning.");let t=O(o,r);if(t)return t;let{taskset:n,resources:e}=j(a),i=fe(a.package),s=await Y({id:r.modelId,profileId:r.profileId,name:r.name,objective:i.taskDefinition.instructions,defaultBaseModel:r.startingModel,defaultDestinationId:null,trainingSetup:me({package:e,setup:X.parse({tasksetRef:g(n),rewardBindingRef:g(e.rewardBinding),baseModel:r.startingModel,method:r.method,managedRolloutPlacement:"remote"})})},0);o.exec("BEGIN IMMEDIATE");try{let p=O(o,r);if(p)return o.exec("COMMIT"),p;if(o.get("SELECT id FROM tasksets WHERE id = ?",[n.id])||o.get("SELECT id FROM model_projects WHERE id = ?",[r.modelId]))throw new Error("Starter creation requires a new Model and Taskset identity.");let l=[...e.executionResources??e.execution?[{kind:"asset",resource:te(e.executionResources??e.execution)}]:[],...i.execution?[{kind:"asset",resource:L(i.execution)}]:[],...i.assets.map(u=>({kind:"asset",resource:u})),...i.rewards.map(u=>({kind:"reward",resource:u})),{kind:"binding",resource:i.rewardBinding},{kind:"definition",resource:i.taskDefinition},{kind:"package",resource:i.taskset},...e.taskset.contentHash===i.taskset.contentHash?[]:[{kind:"definition",resource:e.taskDefinition},{kind:"package",resource:e.taskset},...e.execution?[{kind:"asset",resource:L(e.execution)}]:[]]];for(let{kind:u,resource:y}of l)he(o,r.profileId,u,y);let d=JSON.stringify(n);o.run("INSERT INTO tasksets (id, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)",[n.id,n.profileId,n.status,d,n.createdAt,n.updatedAt]),o.run("INSERT INTO taskset_revisions (taskset_id, revision, content_hash, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[n.id,n.revision,n.contentHash,n.profileId,n.status,d,n.createdAt,n.updatedAt]);let h=ke(o,s);return o.run("INSERT INTO model_starter_creation_operations (profile_id, operation_id, request_hash, payload) VALUES (?, ?, ?, ?)",[r.profileId,r.operationId,Re(r),JSON.stringify(h)]),o.exec("COMMIT"),h}catch(p){throw o.exec("ROLLBACK"),p}}m(Ee,"commitModelStarterCreation");function Re(o){return xe("sha256").update(k(o)).digest("hex")}m(Re,"requestHash");function q(o,a,r,t,n){let e=v.parse(r);o.exec("BEGIN IMMEDIATE");try{let i=o.get("SELECT payload FROM model_projects WHERE id = ?",[e.id]),s=i?v.parse(JSON.parse(i.payload)):null;s&&s.profileId!==e.profileId&&T("Model ownership changed during hosted synchronization.");let p;if(t)k(s)!==k(a)&&T("Model changed while its hosted configuration was loading. Refresh before applying it."),p=e;else{(!s||!a||a.id!==e.id||a.profileId!==e.profileId)&&T("Model is no longer available for hosted synchronization."),s.hosted?.teamId!==a.hosted?.teamId&&s.hosted?.teamId!==e.hosted?.teamId&&T("Model hosting team changed during synchronization.");let l=e.hosted,d=s.hosted,h=d;if(l){d?.apiOrigin&&d.apiOrigin!==l.apiOrigin&&T("Model hosting API changed during synchronization.");let u=d?.apiOrigin===l.apiOrigin&&d?.teamId===l.teamId&&d.projectId===l.projectId;u&&d.revision===l.revision&&d.etag!==l.etag&&T("Hosted Model receipts disagree about the same revision."),h={...u&&d.revision>l.revision?d:l,tasksets:u?je(d.tasksets,l.tasksets,w=>`${w.localTasksetId}:${w.releaseHash}`,w=>w.syncedAt):l.tasksets}}p=v.parse({...s,hosted:h,tasksetSyncs:je(s.tasksetSyncs,e.tasksetSyncs,u=>u.localTasksetId,u=>u.lastAttemptAt)})}return n?.(),o.run(`INSERT INTO model_projects (id, profile_id, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?)
2
+ import{a as C,b as Te}from"./chunk-NDNSLCPE.js";import{a as Q,d as ve}from"./chunk-CWE2N3JI.js";import{d as we,f as Ie,g as ye}from"./chunk-O4YHISU2.js";import{a as he,b as F,c as J,d as ge,e as ke,f as Me}from"./chunk-DUR32LJG.js";import"./chunk-Z5R4OSGC.js";import{a as me,d as B,e as b,g as fe}from"./chunk-QKGNAYSC.js";import{b as Se,c as Pe,d as W}from"./chunk-HT6ILPD6.js";import{b as pe}from"./chunk-VMW23TIZ.js";import{a as ue}from"./chunk-KCJVFLBB.js";import"./chunk-2THZ6GZY.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import{b as de,c as ce,z as le}from"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import{Ca as x,Da as ie,Ia as ne,M as ee,O as L,R as te,U as re,oa as ae,wa as oe,za as se}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import{D as X,H as v,O as Y,U as Z,j as k,x as N}from"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import{L as g,M as R,O as G,S as V,mb as K}from"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as I}from"./chunk-X2J2P5ZT.js";import{a as m}from"./chunk-FTQLQJQV.js";import qe from"node:path";import{createHash as xe}from"node:crypto";function j(o){let{request:a,resolved:r}=b(o.request,o.package),{starter:t,...n}=r,e=a.rewardBindingRef&&!R(a.rewardBindingRef,g(r.rewardBinding));if(e&&(!o.rewardSelection||!R(a.rewardBindingRef,g(o.rewardSelection.rewardBinding))))throw new Error("The selected starter Reward is unavailable for package preparation.");let i=re({owner:{scopeId:a.profileId,modelId:a.modelId},source:n,...e?o.rewardSelection:{rewardBinding:n.rewardBinding,rewards:n.rewards,assets:n.assets}}),{taskset:s,taskDefinition:p,rewardBinding:l,rewards:d,assets:h}=i;if(o.source.profileId!==a.profileId||o.source.sourceHash!==t.contentHash)throw new Error("Starter source must belong to this Profile and pin the catalog package.");let u=i.execution!==void 0,y=s.environment.kind==="text"&&s.environment.entrypoint==="openpond.text.v1"&&!s.environment.stateful&&(!s.environmentRelease&&!s.verifierSetRelease||i.executionResources!==void 0)&&!s.capabilities.length&&!s.tools.length;if(!["sft","grpo"].includes(a.method)||p.harness||!y&&!u||s.tasks.some(c=>c.artifactRefs.length)||s.graders.some(c=>c.kind==="model_judge"&&(!c.model||c.calibrationStatus!=="passed")))throw new Error("This starter requires an additional training or environment adapter before preparation.");let w=new Set(o.approvedTrainingTaskIds);if(w.size!==o.approvedTrainingTaskIds.length)throw new Error("Starter training approvals must be unique.");for(let c of w){let P=s.tasks.find(H=>H.id===c);if(!P||P.split!=="train")throw new Error(`Starter approval must reference a training task: ${c}.`);if(a.method==="sft"&&P.expectedOutput===null)throw new Error(`SFT starter approval requires a reviewed target: ${c}.`)}if(a.method==="grpo"&&s.tasks.some(c=>c.split==="train"&&!w.has(c.id)))throw new Error("GRPO starter preparation requires approval of every training task.");for(let c of o.fixtures){if(!s.tasks.some(P=>P.id===c.taskId))throw new Error(`Starter fixture references an unknown task: ${c.taskId}.`);u&&!c.infrastructureError&&ee.parse(c.metadata.toolScript)}let E=s.id,f=se({profileId:a.profileId,id:`${E}-draft`,name:t.name,now:o.createdAt}),S=[];for(let c of s.graders){if(c.kind!=="custom_verifier")continue;let P=h.find(D=>D.id===c.verifierRef.id);if(!P)throw new Error(`Starter verifier asset is missing: ${c.id}.`);let H=c.verifierRef.path;S.some(D=>D.path===H)||S.push({path:H,role:"verifier",content:V(P,c.verifierRef)})}let _=ae.parse({...f,objective:p.instructions,metrics:s.metrics??f.metrics,sourceRefs:[o.source],policy:s.policy,environment:{...f.environment,kind:u?"agent":"chat",entrypoint:s.environment.entrypoint,stateful:s.environment.stateful,toolNames:s.tools.map(c=>c.name),deterministicSeeds:s.environment.deterministicSeeds,defaultTimeoutMs:s.environment.defaultTimeoutMs,networkPolicy:s.environment.networkPolicy,metadata:{portableEnvironment:s.environment,portableTools:s.tools,...i.executionResources?{portableExecutionResources:i.executionResources}:i.execution?{portableExecutionResources:{environment:i.execution.environment,verifierSet:i.execution.verifierSet}}:{}}},output:{mode:"structured_json",jsonSchema:p.outputSchema,renderer:null},capabilities:{...f.capabilities,taskKind:u?"single_agent":"chat",requiresTools:u,requiresState:u,supportedSignals:a.method==="grpo"?["reward"]:["demonstration"],compatibleMethods:[a.method],rewardKinds:[...new Set(s.graders.map(c=>c.kind==="human"?"human":c.kind==="model_judge"?"model_judge":"deterministic"))],requiresPrivilegedGrading:!0,environmentPlacements:["local","remote"]},tasks:s.tasks.map(({artifactRefs:c,...P})=>({...P,schemaVersion:"openpond.taskData.v1",sourceRefs:[o.source.id],metadata:{exampleOrigin:"curated_starter",starter:g(t),portableTaskRecord:{...P,artifactRefs:[]}}})),graders:ie(l,d,h),graderFixtures:o.fixtures,learningSignals:{...f.learningSignals,rewards:a.method==="grpo"?s.tasks.filter(c=>w.has(c.id)).map(c=>({kind:"reward",id:`starter-reward-${c.id}`,taskId:c.id,task:p.instructions,rules:[{id:l.id,points:1,condition:"Execute the published Reward binding with its declared normalization, weights and required gates."}],otherwisePoints:0,executable:!0,approved:!0,confidence:1,sourceRefs:[o.source.id],artifactRef:l.id,metadata:{starter:g(t),rewardBinding:g(l),approvalOrigin:"catalog_publication"}})):[],demonstrations:a.method==="sft"?s.tasks.filter(c=>w.has(c.id)).map(c=>({kind:"demonstration",id:`starter-target-${c.id}`,taskId:c.id,sourceRefs:[o.source.id],artifactRef:s.id,approved:!0,confidence:1,prompt:null,response:JSON.stringify(c.expectedOutput),metadata:{starter:g(t),approvalOrigin:"catalog_publication"}})):[]},metadata:{starter:g(t),starterTasksetRelease:g(s),taskDefinition:g(p),rewardBinding:g(l),rewardExecution:{binding:l,rewards:d},portableCapabilities:s.capabilities,derivedPortableMetadata:s.metadata,modelTasksetDerivation:s.metadata.modelTasksetDerivation}}),M=le({draft:_,now:o.createdAt,tasksetId:E,sourcePackageHash:s.contentHash});return M.metrics=s.metrics,s.metadata.tasksetOutputContract===void 0?delete M.metadata.tasksetOutputContract:M.metadata.tasksetOutputContract=s.metadata.tasksetOutputContract,M.contentHash=x(M),{draft:_,taskset:M,generatedFiles:S,resources:i}}m(j,"prepareModelStarterTaskset");function O(o,a){let r=B(a),t=o.get("SELECT request_hash, payload FROM model_starter_creation_operations WHERE profile_id = ? AND operation_id = ?",[r.profileId,r.operationId]);if(!t)return null;if(t.request_hash!==Re(r))throw new Error("Starter creation operation was already used with different configuration.");return v.parse(JSON.parse(t.payload))}m(O,"findModelStarterCreation");async function Ee(o,a){let r=B(a.request);if(r.learning)throw new Error("Create this Model in a hosted workspace to enable continual learning.");let t=O(o,r);if(t)return t;let{taskset:n,resources:e}=j(a),i=fe(a.package),s=await Y({id:r.modelId,profileId:r.profileId,name:r.name,objective:i.taskDefinition.instructions,defaultBaseModel:r.startingModel,defaultDestinationId:null,trainingSetup:me({package:e,setup:X.parse({tasksetRef:g(n),rewardBindingRef:g(e.rewardBinding),baseModel:r.startingModel,method:r.method,managedRolloutPlacement:"remote"})})},0);o.exec("BEGIN IMMEDIATE");try{let p=O(o,r);if(p)return o.exec("COMMIT"),p;if(o.get("SELECT id FROM tasksets WHERE id = ?",[n.id])||o.get("SELECT id FROM model_projects WHERE id = ?",[r.modelId]))throw new Error("Starter creation requires a new Model and Taskset identity.");let l=[...e.executionResources??e.execution?[{kind:"asset",resource:te(e.executionResources??e.execution)}]:[],...i.execution?[{kind:"asset",resource:L(i.execution)}]:[],...i.assets.map(u=>({kind:"asset",resource:u})),...i.rewards.map(u=>({kind:"reward",resource:u})),{kind:"binding",resource:i.rewardBinding},{kind:"definition",resource:i.taskDefinition},{kind:"package",resource:i.taskset},...e.taskset.contentHash===i.taskset.contentHash?[]:[{kind:"definition",resource:e.taskDefinition},{kind:"package",resource:e.taskset},...e.execution?[{kind:"asset",resource:L(e.execution)}]:[]]];for(let{kind:u,resource:y}of l)he(o,r.profileId,u,y);let d=JSON.stringify(n);o.run("INSERT INTO tasksets (id, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)",[n.id,n.profileId,n.status,d,n.createdAt,n.updatedAt]),o.run("INSERT INTO taskset_revisions (taskset_id, revision, content_hash, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[n.id,n.revision,n.contentHash,n.profileId,n.status,d,n.createdAt,n.updatedAt]);let h=ke(o,s);return o.run("INSERT INTO model_starter_creation_operations (profile_id, operation_id, request_hash, payload) VALUES (?, ?, ?, ?)",[r.profileId,r.operationId,Re(r),JSON.stringify(h)]),o.exec("COMMIT"),h}catch(p){throw o.exec("ROLLBACK"),p}}m(Ee,"commitModelStarterCreation");function Re(o){return xe("sha256").update(k(o)).digest("hex")}m(Re,"requestHash");function q(o,a,r,t,n){let e=v.parse(r);o.exec("BEGIN IMMEDIATE");try{let i=o.get("SELECT payload FROM model_projects WHERE id = ?",[e.id]),s=i?v.parse(JSON.parse(i.payload)):null;s&&s.profileId!==e.profileId&&T("Model ownership changed during hosted synchronization.");let p;if(t)k(s)!==k(a)&&T("Model changed while its hosted configuration was loading. Refresh before applying it."),p=e;else{(!s||!a||a.id!==e.id||a.profileId!==e.profileId)&&T("Model is no longer available for hosted synchronization."),s.hosted?.teamId!==a.hosted?.teamId&&s.hosted?.teamId!==e.hosted?.teamId&&T("Model hosting team changed during synchronization.");let l=e.hosted,d=s.hosted,h=d;if(l){d?.apiOrigin&&d.apiOrigin!==l.apiOrigin&&T("Model hosting API changed during synchronization.");let u=d?.apiOrigin===l.apiOrigin&&d?.teamId===l.teamId&&d.projectId===l.projectId;u&&d.revision===l.revision&&d.etag!==l.etag&&T("Hosted Model receipts disagree about the same revision."),h={...u&&d.revision>l.revision?d:l,tasksets:u?je(d.tasksets,l.tasksets,w=>`${w.localTasksetId}:${w.releaseHash}`,w=>w.syncedAt):l.tasksets}}p=v.parse({...s,hosted:h,tasksetSyncs:je(s.tasksetSyncs,e.tasksetSyncs,u=>u.localTasksetId,u=>u.lastAttemptAt)})}return n?.(),o.run(`INSERT INTO model_projects (id, profile_id, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?)
3
3
  ON CONFLICT(id) DO UPDATE SET payload = excluded.payload, updated_at = excluded.updated_at`,[p.id,p.profileId,JSON.stringify(p),p.createdAt,p.updatedAt]),o.exec("COMMIT"),p}catch(i){throw o.exec("ROLLBACK"),i}}m(q,"commitModelProjectHosting");function je(o,a,r,t){let n=new Map(o.map(e=>[r(e),e]));for(let e of a){let i=n.get(r(e));(!i||Date.parse(t(e))>=Date.parse(t(i)))&&n.set(r(e),e)}return[...n.values()]}m(je,"mergeLatest");function T(o){throw new Z(409,{schemaVersion:"openpond.modelProjectApiError.v2",code:"model_hosting_conflict",message:o,retryable:!1,requestId:null,details:{}})}m(T,"conflict");function z(o,a){let{request:r,resolved:t}=b(a.request,a.package),n=r.rewardBindingRef;if(!n||R(n,g(t.rewardBinding)))return a;function e(l,d){let h=o.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[r.profileId,l,d.id,d.revision]);if(!h)throw new Error(`The selected starter ${l} is unavailable in this Profile.`);let u=K[l].parse(JSON.parse(h.payload));if(G(u),d.contentHash&&d.contentHash!==u.contentHash)throw new Error("The selected starter Reward differs from its immutable reference.");return u}m(e,"read");let i=e("binding",n),s=[...new Map(i.sources.map(l=>[k(l.reward),e("reward",l.reward)])).values()],p=new Map(t.assets.map(l=>[l.id,l]));for(let l of s){let d=l.implementation;for(let h of[...l.assets,..."verifierRef"in d?[d.verifierRef]:[],..."rubricRef"in d?[d.rubricRef]:[],..."inputContract"in d?[d.inputContract]:[]])p.has(h.id)||p.set(h.id,e("asset",{id:h.id,revision:1}))}return{...a,rewardSelection:{rewardBinding:i,rewards:s,assets:[...p.values()]}}}m(z,"resolveModelStarterSelection");import be from"node:path";async function $(o,a,r){let t=r.project.trainingSetup.tasksetRef;if(!t)return;let n=o.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[t.id,t.revision]);if(!n)return;let e=oe.parse(JSON.parse(n.payload));if(e.profileId!==r.project.profileId||e.contentHash!==t.contentHash)return;let i=o.get("SELECT payload FROM model_projects WHERE id = ?",[r.project.id]),s=i?v.parse(JSON.parse(i.payload)):null;if(s&&(s.profileId!==r.project.profileId||s.revision!==r.expectedRevision))return;let p=s?.hosted?.tasksets.find(f=>f.localTasksetId===e.id&&f.localTasksetHash===e.contentHash),l=typeof e.metadata.importedPackageHash=="string"?e.metadata.importedPackageHash:p?.packageHash;if(!l){if(e.metadata.learning!==void 0||e.metadata.taskDefinition!==void 0||e.metadata.rewardBinding!==void 0)return;let f=r.project.trainingSetup,S=f.baseModel??r.project.defaultBaseModel,_=f.method??(e.authoringProvenance.buildIntent==="verifiable_reward"?"grpo":null);if(!f.rewardBindingRef&&(_!=="grpo"||f.recipe||!S?.revision||!S.tokenizerRevision||!S.chatTemplateHash))return;if(x(e)!==t.contentHash)throw new Error("Selected Taskset differs from its immutable content hash.");let M=ne({taskset:e,adapterId:we(e)});return Te({storeDir:a,taskset:e,content:{schemaVersion:"openpond.tasksetPackage.v1",taskset:M.tasksetRelease,environment:M.environmentRelease,verifierSet:M.verifierSetRelease}})}let d=await Pe(a,l);if(d.taskset.id!==(p?.releaseId??t.id)||d.taskset.revision!==(p?.releaseRevision??t.revision))throw new Error("Cached package differs from its selected Taskset revision.");let{files:h,contentHash:u,...y}=d,w=Ie(d,typeof e.metadata.importedPackageHash=="string"),E=await ye({root:be.join(a,"training","tasksets",C(e)),content:y,sources:h.filter(f=>!w.has(f.asset.id)).map(f=>({asset:f.asset,sourcePath:e.tasks.flatMap(S=>S.assets??[]).find(S=>S.id===f.asset.id)?.artifactRef??f.asset.path})),fileOrder:h.map(f=>f.asset.id)});if(E.contentHash!==d.contentHash)throw new Error("Imported package bytes changed before the Reward edit.");return E}m($,"loadModelTasksetPackage");var{package:It,evaluationPackage:yt,...Ce}=de.shape,A=I.object({apiOrigin:I.string().url().refine(o=>new URL(o).origin===o),teamId:I.string().min(1),project:v,localTaskset:N,localEvaluation:N.optional(),evaluationPackageHash:I.string().regex(/^[a-f0-9]{64}$/).optional(),packageHash:I.string().regex(/^[a-f0-9]{64}$/),request:I.object(Ce).strict()}).strict().refine(o=>!!o.localEvaluation==!!o.evaluationPackageHash,"Evaluation bytes and local identity must be captured together.");function U(o,a){let r=o.get("SELECT payload FROM model_project_package_operations WHERE profile_id = ? AND model_id = ? AND state = 'pending'",[a.profileId,a.modelId]),t=r?A.parse(JSON.parse(r.payload)):null;if(t&&(t.apiOrigin!==a.apiOrigin||t.teamId!==a.teamId))throw new Error("Finish the pending package publication in its original API and workspace before changing hosting.");return t}m(U,"pendingModelPackageOperation");function Oe(o,a){let r=A.parse(a);o.exec("BEGIN IMMEDIATE");try{let t=U(o,{profileId:r.project.profileId,modelId:r.project.id,apiOrigin:r.apiOrigin,teamId:r.teamId});if(t)return o.exec("COMMIT"),t;let n=o.get("SELECT payload FROM model_projects WHERE id = ?",[r.project.id]),e=n?v.parse(JSON.parse(n.payload)):null;if(k(e)!==k(r.project))throw new Error("Model changed while its package was being prepared. Retry the push.");let i=o.get("SELECT payload, state FROM model_project_package_operations WHERE operation_id = ?",[r.request.operationId]);if(i){let s=A.parse(JSON.parse(i.payload));if(k({...s,project:r.project})!==k(r))throw new Error("Package operation identity was reused with different publication content.");if(i.state==="committed")return o.exec("COMMIT"),s;o.run("UPDATE model_project_package_operations SET state = 'pending', payload = ? WHERE operation_id = ? AND state = 'rejected'",[JSON.stringify(r),r.request.operationId])}else o.run("INSERT INTO model_project_package_operations (operation_id, profile_id, model_id, api_origin, team_id, state, payload, created_at) VALUES (?, ?, ?, ?, ?, 'pending', ?, ?)",[r.request.operationId,r.project.profileId,r.project.id,r.apiOrigin,r.teamId,JSON.stringify(r),new Date().toISOString()]);return o.exec("COMMIT"),r}catch(t){throw o.exec("ROLLBACK"),t}}m(Oe,"prepareModelPackageOperation");function _e(o,a,r){let t=ce.parse(r),n=o.get("SELECT payload, receipt FROM model_project_package_operations WHERE operation_id = ?",[a]);if(!n)throw new Error("Package push has no durable local intent.");let e=A.parse(JSON.parse(n.payload));if(n.receipt&&k(JSON.parse(n.receipt))!==k(t))throw new Error("Package push retry returned a different receipt.");if(t.operationId!==a||t.teamId!==e.teamId||t.packageHash!==e.packageHash||t.modelProjectId!==e.request.modelProjectId)throw new Error("Package push receipt differs from its local intent.");if(e.evaluationPackageHash&&(!t.evaluation||t.evaluation.packageHash!==e.evaluationPackageHash||k(t.evaluation.taskset)!==k(e.request.modelConfiguration?.trainingSetup.evaluationTasksetRef)))throw new Error("Evaluation package receipt differs from its local intent.");let i=e.project,s=t.project;if(e.request.selection==="select"&&!s)throw new Error("Selected package receipt is missing Model configuration.");if(!s&&!i.hosted)throw new Error("Historical package receipt has no existing hosted Model.");let p=new Date().toISOString(),l=v.parse({...i,hosted:{schemaVersion:"openpond.hostedModelProjectLink.v1",apiOrigin:e.apiOrigin,teamId:e.teamId,projectId:s?.id??i.hosted.projectId,portableProjectId:i.id,revision:s?.revision??i.hosted.revision,etag:t.projectEtag,syncedSourceRevision:e.request.selection==="select"?i.revision:i.hosted.syncedSourceRevision,syncedAt:p,tasksets:[...(i.hosted?.tasksets??[]).filter(d=>d.releaseHash!==t.taskset.contentHash&&d.releaseHash!==t.evaluation?.taskset.contentHash),{localTasksetId:e.localTaskset.id,localTasksetHash:e.localTaskset.contentHash,releaseId:t.taskset.id,releaseRevision:t.taskset.revision,releaseHash:t.taskset.contentHash,packageHash:t.packageHash,hostedTasksetId:t.hostedTasksetId,syncedAt:p},...e.localEvaluation&&t.evaluation?[{localTasksetId:e.localEvaluation.id,localTasksetHash:e.localEvaluation.contentHash,releaseId:t.evaluation.taskset.id,releaseRevision:t.evaluation.taskset.revision,releaseHash:t.evaluation.taskset.contentHash,packageHash:t.evaluation.packageHash,hostedTasksetId:t.evaluation.hostedTasksetId,syncedAt:p}]:[]]},tasksetSyncs:[...i.tasksetSyncs.filter(d=>d.localTasksetId!==e.localTaskset.id&&d.localTasksetId!==e.localEvaluation?.id),{localTasksetId:e.localTaskset.id,releaseId:t.taskset.id,releaseRevision:t.taskset.revision,releaseHash:t.taskset.contentHash,state:"synced",hostedTasksetId:t.hostedTasksetId,lastAttemptAt:p,syncedAt:p,lastError:null},...e.localEvaluation&&t.evaluation?[{localTasksetId:e.localEvaluation.id,releaseId:t.evaluation.taskset.id,releaseRevision:t.evaluation.taskset.revision,releaseHash:t.evaluation.taskset.contentHash,state:"synced",hostedTasksetId:t.evaluation.hostedTasksetId,lastAttemptAt:p,syncedAt:p,lastError:null}]:[]]});return q(o,i,l,!1,()=>{o.run("UPDATE model_project_package_operations SET state = 'committed', receipt = ? WHERE operation_id = ?",[JSON.stringify(t),a])})}m(_e,"completeModelPackageOperation");var He=class extends ue{static{m(this,"SqliteModelConfigurationStore")}async pendingModelPackagePush(a){if(await this.ready,await this.writeQueue,!this.db)throw new Error("Package push store is closed.");return U(this.db,a)}async prepareModelPackagePush(a){await this.ready;let r=this.writeQueue.then(()=>{if(!this.db)throw new Error("Package push store is closed.");return Oe(this.db,a)});return this.writeQueue=r.then(()=>{},()=>{}),r}async completeModelPackagePush(a,r){await this.ready;let t=this.writeQueue.then(()=>{if(!this.db)throw new Error("Package push store is closed.");return _e(this.db,a,r)});return this.writeQueue=t.then(()=>{},()=>{}),t}async rejectModelPackagePush(a){await this.ready;let r=this.writeQueue.then(()=>{if(!this.db)throw new Error("Package push store is closed.");this.db.run("UPDATE model_project_package_operations SET state = 'rejected' WHERE operation_id = ? AND state = 'pending'",[a])});return this.writeQueue=r.then(()=>{},()=>{}),r}async findModelProjectConfigurationSave(a){if(await this.ready,await this.writeQueue,!this.db)throw new Error("Model check failed because the local store is closed.");return J(this.db,a)}async saveModelProjectConfiguration(a){await this.ready;let r=this.writeQueue.then(async()=>{if(!this.db)throw new Error("Model save failed because the local store is closed.");let t=J(this.db,a);if(t)return t;let n=await $(this.db,this.home,a),e=F(this.db,a,!0,n);if(e?.imported)await W({home:this.home,...e.imported});else if(e){let i=qe.join(this.home,"training","tasksets",C(e.source));await Q(this.home,e,e.directoryId,{source:{directory:i,packageHash:await pe(i)},verify:m(s=>ve(s,e.taskset),"verify")}),this.db.run("UPDATE model_project_taskset_preparations SET state = 'materialized' WHERE profile_id = ? AND operation_id = ?",[a.project.profileId,a.operationId])}return ge(this.db,a,e,n?.modelResources?{...n.modelResources,taskset:n.taskset,executionResources:{environment:n.environment,verifierSet:n.verifierSet}}:n)});return this.writeQueue=r.then(()=>{},()=>{}),r}async previewModelProjectTasksetSave(a){if(await this.ready,await this.writeQueue,!this.db)throw new Error("Model check failed because the local store is closed.");return F(this.db,a,!1,await $(this.db,this.home,a))?.taskset??null}async findModelStarterCreation(a){if(await this.ready,await this.writeQueue,!this.db)throw new Error("Starter lookup failed because the local store is closed.");return O(this.db,a)}async saveModelStarterCreation(a){await this.ready;let r=this.writeQueue.then(async()=>{if(!this.db)throw new Error("Starter creation failed because the local store is closed.");let t=O(this.db,a.request);if(t)return t;let n=z(this.db,a),e=j(n);return await Q(this.home,e,e.taskset.id),Ee(this.db,n)});return this.writeQueue=r.then(()=>{},()=>{}),r}async prepareModelStarterCreation(a){if(await this.ready,await this.writeQueue,!this.db)throw new Error("Starter check failed because the local store is closed.");return j(z(this.db,a))}async saveModelProjectHosting(a,r,t=!1,n=[]){await this.ready;let e=this.writeQueue.then(async()=>{if(!this.db)throw new Error("Model synchronization failed because the local store is closed.");if(n.length&&!t)throw new Error("Package import requires an atomic Model replacement.");for(let i of n){if(i.taskset.profileId!==r.profileId)throw new Error("Imported package belongs to another Profile.");i.reuseExisting?await Se(this.home,i.package):await W({home:this.home,...i})}return q(this.db,a,r,t,()=>{for(let i of n)Me(this.db,i)})});return this.writeQueue=e.then(()=>{},()=>{}),e}};export{He as SqliteModelConfigurationStore};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import"./chunk-IUYGQO2K.js";import{c as D,e as O,f as W}from"./chunk-DUR32LJG.js";import{a as _}from"./chunk-Z5R4OSGC.js";import"./chunk-QKGNAYSC.js";import{d as C}from"./chunk-HT6ILPD6.js";import"./chunk-VMW23TIZ.js";import"./chunk-JCHLDNCX.js";import{e as B}from"./chunk-7SOHV5BH.js";import{a as z}from"./chunk-KCJVFLBB.js";import"./chunk-WXG3G2O6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import{f as q,h as A}from"./chunk-GR4MJJCE.js";import{z as L}from"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import{Fa as u,ga as b,ja as H,wa as x}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import{I as T,J as I,O as y}from"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import{L as w,Q as E,S}from"./chunk-ZEOYNUHL.js";import{Ra as R,Wa as M}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as c}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as s}from"./chunk-X2J2P5ZT.js";import{a as h}from"./chunk-FTQLQJQV.js";var F=s.string().trim().min(1).max(500),P=s.string().regex(/^[a-f0-9]{64}$/),f=s.object({schemaVersion:s.literal("openpond.localModelProjectPreparationInput.v1"),source:s.object({ownerId:F,datasetId:F,revision:s.number().int().positive(),workspaceHash:P,packageHash:P}).strict(),project:T,rewardBinding:M,rewards:s.array(R).min(1).max(100),assets:s.array(E).max(100)}).strict(),N=s.object({schemaVersion:s.literal("openpond.localModelProjectPreparation.v1"),request:f,package:b,taskset:x,saveRequest:I,contentHash:P}).strict();async function Q(p){let e=f.parse(p.request),r=H(p.source);if(r.contentHash!==e.source.packageHash)throw new Error("Dataset package changed since preparation was requested.");if(e.project.trainingSetup.tasksetRef||e.project.trainingSetup.tasksetRelease||e.project.trainingSetup.evaluationTasksetRef||e.project.trainingSetup.rewardBindingRef||e.project.trainingSetup.harnessRelease)throw new Error("Preparation selects its Taskset and Reward from the pinned source; omit preselected Taskset, Reward and Harness references.");if(!e.project.trainingSetup.recipe||!e.project.trainingSetup.baseModel)throw new Error("Preparation requires an explicit pinned base model and complete recipe.");let a=e.project.trainingSetup.baseModel,o=e.project.trainingSetup.recipe,i=o.baseModel;if(!a.revision||!a.tokenizerRevision||!a.chatTemplateHash||!i||i.id!==a.modelId||i.revision!==a.revision||i.tokenizerRevision!==a.tokenizerRevision||i.chatTemplateHash!==a.chatTemplateHash||o.method!==e.project.trainingSetup.method)throw new Error("Project and recipe must select the same pinned base model and training method.");if(!r.taskset.tasks.some(t=>t.split==="train")||!r.taskset.tasks.some(t=>t.split==="validation"||t.split==="frozen_eval"))throw new Error("Preparation requires existing training and held-out validation tasks; it never changes splits.");let n=new Set(e.rewardBinding.sources.map(t=>c(t.reward)));if(new Set(e.rewards.map(t=>c(w(t)))).size!==e.rewards.length||e.rewards.some(t=>!n.has(c(w(t)))))throw new Error("Preparation Reward closure contains unexpected or duplicate releases.");let l=e.rewards.flatMap(t=>[...t.assets,..."verifierRef"in t.implementation?[t.implementation.verifierRef]:[],..."rubricRef"in t.implementation?[t.implementation.rubricRef]:[],..."inputContract"in t.implementation?[t.implementation.inputContract]:[]]),G=new Set(l.map(t=>t.id));if(new Set(e.assets.map(t=>t.id)).size!==e.assets.length||e.assets.some(t=>!G.has(t.id)))throw new Error("Preparation Reward closure contains unexpected or duplicate assets.");for(let t of l){let d=e.assets.find(K=>K.id===t.id);if(!d||t.visibility!=="verifier")throw new Error("Preparation requires its exact private verifier asset closure.");S(d,t)}for(let t of["training","evaluation"])if(!e.rewardBinding.sources.some(d=>d.role===t&&d.weight>0))throw new Error(`Preparation requires a positively weighted ${t} Reward source.`);let k=A({owner:{scopeId:e.project.profileId,modelId:e.project.id},source:r,rewardBinding:e.rewardBinding,rewards:e.rewards,assets:e.assets}),g=k.modelResources.assets.filter(t=>e.assets.some(d=>d.id===t.id));if(new Set(g.map(t=>t.asset.path)).size!==g.length||g.some(t=>t.asset.visibility!=="verifier"))throw new Error("Preparation requires distinct private verifier paths with verifier visibility.");let m=u({package:k,profileId:e.project.profileId,name:p.name,createdAt:p.createdAt});m.taskset=_(m.taskset,p.reviewedTaskset,r);let j=w(m.taskset),J=await y({...e.project,trainingSetup:{...e.project.trainingSetup,tasksetRef:j,evaluationTasksetRef:m.taskset.tasks.some(t=>t.split==="validation"||t.split==="frozen_eval")?j:null,rewardBindingRef:w(e.rewardBinding)}},0),v={schemaVersion:"openpond.localModelProjectPreparation.v1",request:e,package:k,taskset:m.taskset,saveRequest:J};return N.parse({...v,contentHash:c(v)})}h(Q,"prepareLocalModelProject");function V(p){let e=N.parse(p),{contentHash:r,...a}=e;if(c(a)!==r)throw new Error("Project preparation receipt content hash changed.");return e}h(V,"parseLocalModelProjectPreparation");var $=class extends z{static{h(this,"SqliteModelProjectPreparationStore")}async compile(e){let r=this.database.get("SELECT id FROM local_resource_owner WHERE singleton=1",[]),a=this.database.get("SELECT r.payload FROM local_dataset_versions w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=? AND w.revision=?",[e.source.datasetId,e.source.revision]);if(!a||!r||r.id!==e.source.ownerId)throw new Error("Dataset is unavailable on the selected local owner.");let o=B(this.database,a.payload);if(o.ownerId!==r.id||o.workspace.contentHash!==e.source.workspaceHash)throw new Error("Dataset owner or workspace changed since preparation was requested.");let i=q({workspace:o.workspace,preparation:null,adapterId:"openpond-desktop-taskset-authoring-v1",now:o.workspace.draft.updatedAt}),n=L({draft:{...o.workspace.draft,profileId:e.project.profileId},now:o.workspace.draft.updatedAt});return Q({request:e,source:i,reviewedTaskset:n,createdAt:o.workspace.draft.updatedAt,name:o.workspace.draft.name})}async prepareLocalModelProject(e){let r=f.parse(e);await this.ready;let a=this.writeQueue.then(async()=>{if(this.database.get("SELECT id FROM model_projects WHERE id=?",[r.project.id]))throw new Error("Model Project already exists; preparation only creates a distinct Model.");return this.compile(r)});return this.writeQueue=a.then(()=>{},()=>{}),a}async applyLocalModelProjectPreparation(e){let r=V(e);await this.ready;let a=this.writeQueue.then(async()=>{let o=await this.compile(r.request);if(c(o)!==c(r))throw new Error("Project preparation differs from the exact source, Reward closure or recipe. Prepare and review it again.");let i=D(this.database,r.saveRequest);if(i)return{project:i,taskset:r.taskset,packageHash:r.package.contentHash,preparationHash:r.contentHash};if(this.database.get("SELECT id FROM model_projects WHERE id=?",[r.request.project.id]))throw new Error("Model Project already exists with a different preparation.");let n=u({package:r.package,profileId:r.request.project.profileId,name:r.taskset.name,createdAt:r.taskset.createdAt});n.taskset=o.taskset,await C({home:this.home,...n}),this.database.exec("BEGIN IMMEDIATE");try{W(this.database,n);let l=O(this.database,r.saveRequest,null,r.package);return this.database.exec("COMMIT"),{project:l,taskset:n.taskset,packageHash:n.package.contentHash,preparationHash:r.contentHash}}catch(l){throw this.database.exec("ROLLBACK"),l}});return this.writeQueue=a.then(()=>{},()=>{}),a}};export{$ as SqliteModelProjectPreparationStore};
2
+ import"./chunk-IUYGQO2K.js";import{c as D,e as O,f as W}from"./chunk-DUR32LJG.js";import{a as _}from"./chunk-Z5R4OSGC.js";import"./chunk-QKGNAYSC.js";import{d as C}from"./chunk-HT6ILPD6.js";import"./chunk-VMW23TIZ.js";import"./chunk-JCHLDNCX.js";import{e as B}from"./chunk-S5ACNR5Y.js";import{a as z}from"./chunk-KCJVFLBB.js";import"./chunk-2THZ6GZY.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-2Q2AWPP2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import{f as q,h as A}from"./chunk-GR4MJJCE.js";import{z as L}from"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import{Fa as u,ga as b,ja as H,wa as x}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import{I as T,J as I,O as y}from"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import{L as w,Q as E,S}from"./chunk-ZEOYNUHL.js";import{Ra as R,Wa as M}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as c}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as s}from"./chunk-X2J2P5ZT.js";import{a as h}from"./chunk-FTQLQJQV.js";var F=s.string().trim().min(1).max(500),P=s.string().regex(/^[a-f0-9]{64}$/),f=s.object({schemaVersion:s.literal("openpond.localModelProjectPreparationInput.v1"),source:s.object({ownerId:F,datasetId:F,revision:s.number().int().positive(),workspaceHash:P,packageHash:P}).strict(),project:T,rewardBinding:M,rewards:s.array(R).min(1).max(100),assets:s.array(E).max(100)}).strict(),N=s.object({schemaVersion:s.literal("openpond.localModelProjectPreparation.v1"),request:f,package:b,taskset:x,saveRequest:I,contentHash:P}).strict();async function Q(p){let e=f.parse(p.request),r=H(p.source);if(r.contentHash!==e.source.packageHash)throw new Error("Dataset package changed since preparation was requested.");if(e.project.trainingSetup.tasksetRef||e.project.trainingSetup.tasksetRelease||e.project.trainingSetup.evaluationTasksetRef||e.project.trainingSetup.rewardBindingRef||e.project.trainingSetup.harnessRelease)throw new Error("Preparation selects its Taskset and Reward from the pinned source; omit preselected Taskset, Reward and Harness references.");if(!e.project.trainingSetup.recipe||!e.project.trainingSetup.baseModel)throw new Error("Preparation requires an explicit pinned base model and complete recipe.");let a=e.project.trainingSetup.baseModel,o=e.project.trainingSetup.recipe,i=o.baseModel;if(!a.revision||!a.tokenizerRevision||!a.chatTemplateHash||!i||i.id!==a.modelId||i.revision!==a.revision||i.tokenizerRevision!==a.tokenizerRevision||i.chatTemplateHash!==a.chatTemplateHash||o.method!==e.project.trainingSetup.method)throw new Error("Project and recipe must select the same pinned base model and training method.");if(!r.taskset.tasks.some(t=>t.split==="train")||!r.taskset.tasks.some(t=>t.split==="validation"||t.split==="frozen_eval"))throw new Error("Preparation requires existing training and held-out validation tasks; it never changes splits.");let n=new Set(e.rewardBinding.sources.map(t=>c(t.reward)));if(new Set(e.rewards.map(t=>c(w(t)))).size!==e.rewards.length||e.rewards.some(t=>!n.has(c(w(t)))))throw new Error("Preparation Reward closure contains unexpected or duplicate releases.");let l=e.rewards.flatMap(t=>[...t.assets,..."verifierRef"in t.implementation?[t.implementation.verifierRef]:[],..."rubricRef"in t.implementation?[t.implementation.rubricRef]:[],..."inputContract"in t.implementation?[t.implementation.inputContract]:[]]),G=new Set(l.map(t=>t.id));if(new Set(e.assets.map(t=>t.id)).size!==e.assets.length||e.assets.some(t=>!G.has(t.id)))throw new Error("Preparation Reward closure contains unexpected or duplicate assets.");for(let t of l){let d=e.assets.find(K=>K.id===t.id);if(!d||t.visibility!=="verifier")throw new Error("Preparation requires its exact private verifier asset closure.");S(d,t)}for(let t of["training","evaluation"])if(!e.rewardBinding.sources.some(d=>d.role===t&&d.weight>0))throw new Error(`Preparation requires a positively weighted ${t} Reward source.`);let k=A({owner:{scopeId:e.project.profileId,modelId:e.project.id},source:r,rewardBinding:e.rewardBinding,rewards:e.rewards,assets:e.assets}),g=k.modelResources.assets.filter(t=>e.assets.some(d=>d.id===t.id));if(new Set(g.map(t=>t.asset.path)).size!==g.length||g.some(t=>t.asset.visibility!=="verifier"))throw new Error("Preparation requires distinct private verifier paths with verifier visibility.");let m=u({package:k,profileId:e.project.profileId,name:p.name,createdAt:p.createdAt});m.taskset=_(m.taskset,p.reviewedTaskset,r);let j=w(m.taskset),J=await y({...e.project,trainingSetup:{...e.project.trainingSetup,tasksetRef:j,evaluationTasksetRef:m.taskset.tasks.some(t=>t.split==="validation"||t.split==="frozen_eval")?j:null,rewardBindingRef:w(e.rewardBinding)}},0),v={schemaVersion:"openpond.localModelProjectPreparation.v1",request:e,package:k,taskset:m.taskset,saveRequest:J};return N.parse({...v,contentHash:c(v)})}h(Q,"prepareLocalModelProject");function V(p){let e=N.parse(p),{contentHash:r,...a}=e;if(c(a)!==r)throw new Error("Project preparation receipt content hash changed.");return e}h(V,"parseLocalModelProjectPreparation");var $=class extends z{static{h(this,"SqliteModelProjectPreparationStore")}async compile(e){let r=this.database.get("SELECT id FROM local_resource_owner WHERE singleton=1",[]),a=this.database.get("SELECT r.payload FROM local_dataset_versions w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=? AND w.revision=?",[e.source.datasetId,e.source.revision]);if(!a||!r||r.id!==e.source.ownerId)throw new Error("Dataset is unavailable on the selected local owner.");let o=B(this.database,a.payload);if(o.ownerId!==r.id||o.workspace.contentHash!==e.source.workspaceHash)throw new Error("Dataset owner or workspace changed since preparation was requested.");let i=q({workspace:o.workspace,preparation:null,adapterId:"openpond-desktop-taskset-authoring-v1",now:o.workspace.draft.updatedAt}),n=L({draft:{...o.workspace.draft,profileId:e.project.profileId},now:o.workspace.draft.updatedAt});return Q({request:e,source:i,reviewedTaskset:n,createdAt:o.workspace.draft.updatedAt,name:o.workspace.draft.name})}async prepareLocalModelProject(e){let r=f.parse(e);await this.ready;let a=this.writeQueue.then(async()=>{if(this.database.get("SELECT id FROM model_projects WHERE id=?",[r.project.id]))throw new Error("Model Project already exists; preparation only creates a distinct Model.");return this.compile(r)});return this.writeQueue=a.then(()=>{},()=>{}),a}async applyLocalModelProjectPreparation(e){let r=V(e);await this.ready;let a=this.writeQueue.then(async()=>{let o=await this.compile(r.request);if(c(o)!==c(r))throw new Error("Project preparation differs from the exact source, Reward closure or recipe. Prepare and review it again.");let i=D(this.database,r.saveRequest);if(i)return{project:i,taskset:r.taskset,packageHash:r.package.contentHash,preparationHash:r.contentHash};if(this.database.get("SELECT id FROM model_projects WHERE id=?",[r.request.project.id]))throw new Error("Model Project already exists with a different preparation.");let n=u({package:r.package,profileId:r.request.project.profileId,name:r.taskset.name,createdAt:r.taskset.createdAt});n.taskset=o.taskset,await C({home:this.home,...n}),this.database.exec("BEGIN IMMEDIATE");try{W(this.database,n);let l=O(this.database,r.saveRequest,null,r.package);return this.database.exec("COMMIT"),{project:l,taskset:n.taskset,packageHash:n.package.contentHash,preparationHash:r.contentHash}}catch(l){throw this.database.exec("ROLLBACK"),l}});return this.writeQueue=a.then(()=>{},()=>{}),a}};export{$ as SqliteModelProjectPreparationStore};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as h}from"./chunk-KCJVFLBB.js";import{hl as n}from"./chunk-NK2L5HA2.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import{j as d}from"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as m}from"./chunk-FTQLQJQV.js";var p=`CREATE TABLE IF NOT EXISTS model_modification_recordings (
2
+ import{a as h}from"./chunk-KCJVFLBB.js";import{hl as n}from"./chunk-2Q2AWPP2.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import{j as d}from"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as m}from"./chunk-FTQLQJQV.js";var p=`CREATE TABLE IF NOT EXISTS model_modification_recordings (
3
3
  account_scope_hash TEXT NOT NULL, team_id TEXT NOT NULL, actor_id TEXT NOT NULL,
4
4
  id TEXT NOT NULL, operation_id TEXT NOT NULL, command_hash TEXT NOT NULL, project_id TEXT,
5
5
  metadata TEXT NOT NULL, document TEXT NOT NULL,
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as _}from"./chunk-KCJVFLBB.js";import{a as k}from"./chunk-U7D6Q744.js";import{d}from"./chunk-GD3RCUDH.js";import"./chunk-SSHE6B7Z.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as c}from"./chunk-FTQLQJQV.js";var n=class extends _{static{c(this,"SqliteSidebarFileBookmarkStore")}async listSidebarFileBookmarks(r){return await this.ready,await this.writeQueue,(await this.all(`SELECT workspace_kind, workspace_id, workspace_name, file_path, status, sort_order,
2
+ import{a as _}from"./chunk-KCJVFLBB.js";import{a as k}from"./chunk-L5L3H6CI.js";import{d}from"./chunk-GD3RCUDH.js";import"./chunk-AITV76GO.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as c}from"./chunk-FTQLQJQV.js";var n=class extends _{static{c(this,"SqliteSidebarFileBookmarkStore")}async listSidebarFileBookmarks(r){return await this.ready,await this.writeQueue,(await this.all(`SELECT workspace_kind, workspace_id, workspace_name, file_path, status, sort_order,
3
3
  source_session_id, created_at, updated_at
4
4
  FROM sidebar_file_bookmarks
5
5
  WHERE scope = ?
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import"./chunk-N73MU2C3.js";import{a as p}from"./chunk-KCJVFLBB.js";import{a as d}from"./chunk-U7D6Q744.js";import"./chunk-SSHE6B7Z.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";function c(a){let r=!!a.pinned,n=r?!1:!!a.archived,t=typeof a.order=="number"&&Number.isFinite(a.order)?a.order:void 0;return{pinned:r,archived:n,...t===void 0?{}:{order:t}}}s(c,"normalizeSidebarAppPreference");var u=class extends p{static{s(this,"SqliteSidebarPreferenceStore")}async getSidebarAppPreferences(r){await this.ready,await this.writeQueue;let n=await this.all(`SELECT app_id, pinned, archived, sort_order
2
+ import"./chunk-N73MU2C3.js";import{a as p}from"./chunk-KCJVFLBB.js";import{a as d}from"./chunk-L5L3H6CI.js";import"./chunk-AITV76GO.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";function c(a){let r=!!a.pinned,n=r?!1:!!a.archived,t=typeof a.order=="number"&&Number.isFinite(a.order)?a.order:void 0;return{pinned:r,archived:n,...t===void 0?{}:{order:t}}}s(c,"normalizeSidebarAppPreference");var u=class extends p{static{s(this,"SqliteSidebarPreferenceStore")}async getSidebarAppPreferences(r){await this.ready,await this.writeQueue;let n=await this.all(`SELECT app_id, pinned, archived, sort_order
3
3
  FROM sidebar_app_preferences
4
4
  WHERE scope = ?`,[r]),t={};for(let e of n)t[e.app_id]={pinned:e.pinned===1,archived:e.archived===1,...e.sort_order===null?{}:{order:e.sort_order}};return t}async patchSidebarAppPreference(r,n,t){await this.ready;let e={},i=this.writeQueue.then(async()=>{let o=await this.get(`SELECT app_id, pinned, archived, sort_order
5
5
  FROM sidebar_app_preferences
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as o}from"./chunk-7PXZ4X4P.js";import{b as u,c as l,d as c,e as _}from"./chunk-VS2LOUCT.js";import"./chunk-DMFUEUAZ.js";import{a as h}from"./chunk-KCJVFLBB.js";import{a as d}from"./chunk-U7D6Q744.js";import"./chunk-FYWQWKVS.js";import"./chunk-SSHE6B7Z.js";import{C as g,z as r}from"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as p}from"./chunk-FTQLQJQV.js";var S=["queued","running","needs_resume"],R=class extends h{static{p(this,"SqliteSubagentStore")}async getPersistedSubagentRun(t){await this.ready;let s=await this.persistedLifecycleRow("SELECT * FROM subagent_runs WHERE id = ?",[t]);return s?u(s):null}async upsertPersistedSubagentRun(t){await this.ready;let s=r.parse(t),n=d(),a=o(this.storePath);try{a.run(`INSERT INTO subagent_runs (
2
+ import{a as o}from"./chunk-7PXZ4X4P.js";import{b as u,c as l,d as c,e as _}from"./chunk-VS2LOUCT.js";import"./chunk-DMFUEUAZ.js";import{a as h}from"./chunk-KCJVFLBB.js";import{a as d}from"./chunk-L5L3H6CI.js";import"./chunk-FYWQWKVS.js";import"./chunk-AITV76GO.js";import{C as g,z as r}from"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as p}from"./chunk-FTQLQJQV.js";var S=["queued","running","needs_resume"],R=class extends h{static{p(this,"SqliteSubagentStore")}async getPersistedSubagentRun(t){await this.ready;let s=await this.persistedLifecycleRow("SELECT * FROM subagent_runs WHERE id = ?",[t]);return s?u(s):null}async upsertPersistedSubagentRun(t){await this.ready;let s=r.parse(t),n=d(),a=o(this.storePath);try{a.run(`INSERT INTO subagent_runs (
3
3
  id,
4
4
  parent_session_id,
5
5
  parent_turn_id,