openpond 0.2.42 → 0.2.44

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 (181) hide show
  1. package/dist/app-server.d.ts +4473 -653
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/actions-command-5IEZEP6W.js +2 -0
  4. package/dist/chunks/{app-layer-ETI5QXQ3.js → app-layer-7SPLENWD.js} +1 -1
  5. package/dist/chunks/app-server-runtime-NQ2BYPGK.js +2 -0
  6. package/dist/chunks/apps-XQ7PHJTD.js +2 -0
  7. package/dist/chunks/{chunk-NT2UKDF7.js → chunk-2CXJK2M3.js} +1 -1
  8. package/dist/chunks/{chunk-MOMDY22U.js → chunk-36RCXSEJ.js} +1 -1
  9. package/dist/chunks/chunk-3QC2DDQ5.js +2 -0
  10. package/dist/chunks/chunk-3XDFNA7W.js +2 -0
  11. package/dist/chunks/chunk-4S4WH65X.js +3 -0
  12. package/dist/chunks/chunk-4TMC5F2P.js +5 -0
  13. package/dist/chunks/{chunk-Z7VAZVC5.js → chunk-65QCNUGE.js} +283 -202
  14. package/dist/chunks/{chunk-JYM3O4G7.js → chunk-ANVOHBUV.js} +1 -1
  15. package/dist/chunks/chunk-ARJUNUH6.js +5 -0
  16. package/dist/chunks/{chunk-LRGLV6JX.js → chunk-B3O2GAQH.js} +1 -1
  17. package/dist/chunks/{chunk-BJSXEGWG.js → chunk-CEEZ7Y2J.js} +1 -1
  18. package/dist/chunks/{chunk-ZG7QX66E.js → chunk-CR6CDOKS.js} +8 -8
  19. package/dist/chunks/{chunk-AANEPCEZ.js → chunk-DZVVGU6K.js} +1 -1
  20. package/dist/chunks/chunk-HY2Q7EDK.js +4 -0
  21. package/dist/chunks/chunk-IT4AT6LB.js +42 -0
  22. package/dist/chunks/{chunk-VQG25QBJ.js → chunk-KPDWQCF6.js} +1 -1
  23. package/dist/chunks/chunk-KRC2S5QF.js +5 -0
  24. package/dist/chunks/{chunk-AT6XYNQ5.js → chunk-L6HCBIAU.js} +1 -1
  25. package/dist/chunks/chunk-LNEOLOK2.js +13 -0
  26. package/dist/chunks/chunk-NM2GYDPA.js +19 -0
  27. package/dist/chunks/{chunk-QZ4KTU65.js → chunk-OI2N2636.js} +1 -1
  28. package/dist/chunks/{chunk-6UGTLC7Z.js → chunk-OJVIH7J6.js} +1 -1
  29. package/dist/chunks/{chunk-TPMXLA5Y.js → chunk-OMM4ZO7E.js} +7 -7
  30. package/dist/chunks/{chunk-S2MLTFZF.js → chunk-OQPFFKU6.js} +1 -1
  31. package/dist/chunks/{chunk-VTWY3U4M.js → chunk-PEYA2Q7Q.js} +1 -1
  32. package/dist/chunks/{chunk-2VTXKZNK.js → chunk-QID62K65.js} +5 -5
  33. package/dist/chunks/{chunk-76YP4FDQ.js → chunk-RAWEO7SJ.js} +2 -2
  34. package/dist/chunks/{chunk-BAQ3DWH2.js → chunk-W5NQ2DI7.js} +12 -12
  35. package/dist/chunks/{chunk-ZLQQUZH7.js → chunk-X2B4MN6W.js} +1 -1
  36. package/dist/chunks/{chunk-EEJ3HL6O.js → chunk-YF6IDYTS.js} +1 -1
  37. package/dist/chunks/{chunk-R6YJY7F2.js → chunk-YOOPTMQK.js} +1 -1
  38. package/dist/chunks/{chunk-MJC26GOX.js → chunk-Z3D4C7BG.js} +6 -6
  39. package/dist/chunks/{chunk-QUNRWDVO.js → chunk-Z6ZR5O3J.js} +3 -3
  40. package/dist/chunks/{chunk-SUAT5DR4.js → chunk-ZEVARU6J.js} +5 -5
  41. package/dist/chunks/cli-OJU6NQSA.js +2 -0
  42. package/dist/chunks/{configuration-command-N2FD7DWB.js → configuration-command-LDPUCHVH.js} +1 -1
  43. package/dist/chunks/core-commands-UZL5RF2M.js +2 -0
  44. package/dist/chunks/datasets-42AZHVSV.js +13 -0
  45. package/dist/chunks/desktop-test-DI76HKS7.js +3 -0
  46. package/dist/chunks/dist-6YP37XI5.js +2 -0
  47. package/dist/chunks/experiments-Z3S35BYN.js +2 -0
  48. package/dist/chunks/{extension-7GYFAHRP.js → extension-JEUZZJ5X.js} +1 -1
  49. package/dist/chunks/{help-MD7Z72QS.js → help-4F4QGL4C.js} +1 -1
  50. package/dist/chunks/hosted-harness-runtime-VZNYNQ6T.js +2 -0
  51. package/dist/chunks/hosted-profile-compiler-JXLPR7SX.js +2 -0
  52. package/dist/chunks/{hosted-profile-evaluation-control-VV2NXFBE.js → hosted-profile-evaluation-control-Q54YXXIM.js} +1 -1
  53. package/dist/chunks/{hosted-profile-evaluation-inspection-XMPRKON6.js → hosted-profile-evaluation-inspection-7WESM3ZH.js} +1 -1
  54. package/dist/chunks/hosted-profile-evaluation-preparation-QP24PYBL.js +3 -0
  55. package/dist/chunks/opchat-UFWWVJL6.js +3 -0
  56. package/dist/chunks/organizations-SBBIOF6O.js +2 -0
  57. package/dist/chunks/{profile-BZDCYKGL.js → profile-ESULTWDN.js} +1 -1
  58. package/dist/chunks/project-agent-IBHUQ3JX.js +2 -0
  59. package/dist/chunks/sandbox-command-PAJAIMWM.js +2 -0
  60. package/dist/chunks/{sandbox-template-ZYXK4QCI.js → sandbox-template-7WHGNVM6.js} +1 -1
  61. package/dist/chunks/src-5MJSO3UD.js +326 -0
  62. package/dist/chunks/{src-5Z35O6L7.js → src-A3OVZOSV.js} +1 -1
  63. package/dist/chunks/{teams-bot-WXGP3PA6.js → teams-bot-YMCDLBGT.js} +1 -1
  64. package/dist/chunks/{workspaces-7WY3ZVQW.js → workspaces-ZZ7R5BUL.js} +1 -1
  65. package/dist/cli.js +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/profile/local-profile.d.ts +2 -0
  68. package/dist/web/assets/App-6AQXN2SM.js +226 -0
  69. package/dist/web/assets/{AppDialog-DMymIOcU.js → AppDialog-CV3ddujB.js} +1 -1
  70. package/dist/web/assets/AppTerminalPanel-dhbGOO_K.js +2 -0
  71. package/dist/web/assets/{AppsView-CUrRKOiz.js → AppsView-Bxa-9BF2.js} +1 -1
  72. package/dist/web/assets/{BrowserSidebar-C5psWtoF.js → BrowserSidebar-BLwL2FOG.js} +1 -1
  73. package/dist/web/assets/{CartesianChart-DVGs4fGn.js → CartesianChart-BOxN-Su1.js} +1 -1
  74. package/dist/web/assets/{CollaborationTabs-D6eqNw88.js → CollaborationTabs-DTmJvNJx.js} +1 -1
  75. package/dist/web/assets/{CommandMenu--GRjuf3j.js → CommandMenu-DggN2ygj.js} +1 -1
  76. package/dist/web/assets/{CommunityView-CHGceVA_.js → CommunityView-CuDrYOIf.js} +1 -1
  77. package/dist/web/assets/{ComposerCreateImproveStrip-D08PAaxI.js → ComposerCreateImproveStrip-BrduENlL.js} +1 -1
  78. package/dist/web/assets/{GetStartedView-BPZcWzsG.js → GetStartedView-Db1IEWzv.js} +1 -1
  79. package/dist/web/assets/HostedModelLearningReview-kofNdPAe.js +1 -0
  80. package/dist/web/assets/{HostedModelLearningSettings-BmEMKcoy.js → HostedModelLearningSettings-6ij3nwWD.js} +1 -1
  81. package/dist/web/assets/{LabModelVersionDetailPage-CX5pOLl2.js → LabModelVersionDetailPage-C7Maqcit.js} +1 -1
  82. package/dist/web/assets/{LabSkillSidebar-C4vAz_0b.js → LabSkillSidebar-Bz0U-Nmw.js} +1 -1
  83. package/dist/web/assets/LabsRoute-Ch1N-e2S.js +52 -0
  84. package/dist/web/assets/LabsRoute-Dw6-12kt.css +1 -0
  85. package/dist/web/assets/MainChatThread-BJbhZOvs.js +2 -0
  86. package/dist/web/assets/{MainPane-EwtIf5_E.js → MainPane-Cs2Kng_k.js} +4 -4
  87. package/dist/web/assets/{MarkdownText-Bj9uRWtM.js → MarkdownText-BhzHRq1J.js} +1 -1
  88. package/dist/web/assets/{NativeSkillSidebar-U7PHw5DO.js → NativeSkillSidebar-LU-PhEhW.js} +1 -1
  89. package/dist/web/assets/{NewExperienceSwitcher-DneuamYK.js → NewExperienceSwitcher-Bi_gpHLG.js} +1 -1
  90. package/dist/web/assets/{NewProjectDialog-CrpXYCYV.js → NewProjectDialog-B8pWvSkq.js} +1 -1
  91. package/dist/web/assets/{OutputsPage-C1SPqz45.js → OutputsPage-BkGI0kHp.js} +1 -1
  92. package/dist/web/assets/{ProjectsPage-CCW3mGQb.js → ProjectsPage-Ca8_iEWu.js} +1 -1
  93. package/dist/web/assets/{RightChatPanelStack-D7ECzLfp.js → RightChatPanelStack-DjEdxsq8.js} +1 -1
  94. package/dist/web/assets/{RightSidebarHomePanel-B-4r-yLc.js → RightSidebarHomePanel-6pygznxX.js} +1 -1
  95. package/dist/web/assets/{ScheduledWorkPage-XjmcT64Z.js → ScheduledWorkPage-BSiOxxAH.js} +1 -1
  96. package/dist/web/assets/{SettingsView-BEBpD7W0.js → SettingsView-1XN7KLBl.js} +3 -3
  97. package/dist/web/assets/{TeamChatView-n9GnPY4F.js → TeamChatView-BGLCPTen.js} +2 -2
  98. package/dist/web/assets/{TerminalOverlay-CNaaMo7W.js → TerminalOverlay-DHkS2cVJ.js} +1 -1
  99. package/dist/web/assets/{TrainingCreationPanel-CEEXMmC5.js → TrainingCreationPanel-Dneamjzh.js} +1 -1
  100. package/dist/web/assets/{TrainingDraftPanel-CwyoL_Dy.js → TrainingDraftPanel-Cfh59jLZ.js} +1 -1
  101. package/dist/web/assets/{UsageSettingsSection-BNjgosYd.js → UsageSettingsSection-C9l1KY-O.js} +1 -1
  102. package/dist/web/assets/{WorkSidebarPanel-BatJltaq.js → WorkSidebarPanel-CEnO-Txp.js} +1 -1
  103. package/dist/web/assets/{WorkspaceDiffPanel-Cbr7qcqm.js → WorkspaceDiffPanel-BiuQBflC.js} +3 -3
  104. package/dist/web/assets/{WorkspaceEnvironmentMenu-DYu-PXRv.js → WorkspaceEnvironmentMenu-Dr-E0c1j.js} +1 -1
  105. package/dist/web/assets/{WorkspaceGitDialogs-BoamHtgk.js → WorkspaceGitDialogs-mE3Og6Zo.js} +1 -1
  106. package/dist/web/assets/{WorkspaceMonacoEditor-yg83VXk5.js → WorkspaceMonacoEditor-DPZ0n0G9.js} +60 -60
  107. package/dist/web/assets/{arrow-up-right-CN9lcbsD.js → arrow-up-right-DU2KsZD-.js} +1 -1
  108. package/dist/web/assets/{clipboard-DfLDGpSz.js → clipboard-g2b4_k81.js} +1 -1
  109. package/dist/web/assets/{cloud-upload-hk4EBTu-.js → cloud-upload-P2bDOPsQ.js} +1 -1
  110. package/dist/web/assets/cssMode-CPbPVAUt.js +1 -0
  111. package/dist/web/assets/{folder-open-BmhusYOx.js → folder-open-BmsONNsr.js} +1 -1
  112. package/dist/web/assets/{folder-plus-Bedc_RqV.js → folder-plus-B18NgUxy.js} +1 -1
  113. package/dist/web/assets/{git-commit-horizontal-D2Zvz4i7.js → git-commit-horizontal-enxGCV_e.js} +1 -1
  114. package/dist/web/assets/htmlMode-DiV88uQv.js +1 -0
  115. package/dist/web/assets/index-B9VSiz_z.css +1 -0
  116. package/dist/web/assets/{index-CpTHPmvd.js → index-vfpCN9zy.js} +6 -6
  117. package/dist/web/assets/{info-CayXQYUk.js → info-DmuSBIYe.js} +1 -1
  118. package/dist/web/assets/{jsonMode-_Ywm0ZC4.js → jsonMode-BaeOjuKU.js} +4 -4
  119. package/dist/web/assets/{lspLanguageFeatures-Caw_TPYu.js → lspLanguageFeatures-D8To0CQA.js} +1 -1
  120. package/dist/web/assets/{minimize-2-sPQtjkx8.js → minimize-2-C2xnEzCe.js} +1 -1
  121. package/dist/web/assets/monaco.contribution-DbrACt99.js +2 -0
  122. package/dist/web/assets/{monaco.contribution-CngZuH1Z.js → monaco.contribution-DgTFvG2Q.js} +2 -2
  123. package/dist/web/assets/{monaco.contribution-DmEqb8O2.js → monaco.contribution-JW3MxX6k.js} +2 -2
  124. package/dist/web/assets/{monaco.contribution-Bqi-s2-g.js → monaco.contribution-bytkwn0O.js} +2 -2
  125. package/dist/web/assets/{monitor-BuaCDSIZ.js → monitor-mtHVW7gU.js} +1 -1
  126. package/dist/web/assets/{python-D6SoZF70.js → python-DAPe0Urm.js} +1 -1
  127. package/dist/web/assets/{refresh-cw-DmpWkVF6.js → refresh-cw-Dvm_Pq3U.js} +1 -1
  128. package/dist/web/assets/{save-Di43Sc13.js → save-B2eVAjW6.js} +1 -1
  129. package/dist/web/assets/{square-Cui64whj.js → square-16bX2k2i.js} +1 -1
  130. package/dist/web/assets/toggleHighContrast-BgpFWRpS.css +1 -0
  131. package/dist/web/assets/{toggleHighContrast-e8XiQRTr.js → toggleHighContrast-Ce0YhEQg.js} +1 -1
  132. package/dist/web/assets/{tsMode-Cvh0MpFm.js → tsMode-CnvMmHz6.js} +1 -1
  133. package/dist/web/assets/{upload-Dphgk6dy.js → upload-COPbAaD-.js} +1 -1
  134. package/dist/web/assets/{useLocalAgentSchedules-CDN8WQld.js → useLocalAgentSchedules-C-Wjm5HK.js} +1 -1
  135. package/dist/web/assets/{useSessionTurnCache-Bvcc_al6.js → useSessionTurnCache-BfVbncMB.js} +1 -1
  136. package/dist/web/assets/{wifi-off-CIWXrn3o.js → wifi-off-C9iLbCC-.js} +1 -1
  137. package/dist/web/assets/{workers-XU4YZxHD.js → workers-BXh_u8Fr.js} +1 -1
  138. package/dist/web/assets/{yaml-BZ0UGaZH.js → yaml-CRSr9x6_.js} +1 -1
  139. package/dist/web/index.html +5 -5
  140. package/docs/command-reference.md +8 -1
  141. package/package.json +4 -2
  142. package/dist/chunks/actions-command-6EMO4BIK.js +0 -2
  143. package/dist/chunks/app-server-runtime-CJ7SJTTF.js +0 -2
  144. package/dist/chunks/apps-LH5AJCUI.js +0 -2
  145. package/dist/chunks/chunk-2Z6H32OC.js +0 -2
  146. package/dist/chunks/chunk-3CKJETWW.js +0 -2
  147. package/dist/chunks/chunk-4F2Q4CFS.js +0 -4
  148. package/dist/chunks/chunk-ANCZVBMI.js +0 -42
  149. package/dist/chunks/chunk-AUOMUBLE.js +0 -3
  150. package/dist/chunks/chunk-GC4OCTP6.js +0 -2
  151. package/dist/chunks/chunk-KCENW4ME.js +0 -2
  152. package/dist/chunks/chunk-OUN6VQDO.js +0 -5
  153. package/dist/chunks/chunk-TPOW52DO.js +0 -13
  154. package/dist/chunks/chunk-VI3ZF54E.js +0 -5
  155. package/dist/chunks/chunk-XJAK6DDB.js +0 -5
  156. package/dist/chunks/chunk-ZQWXPDCB.js +0 -19
  157. package/dist/chunks/cli-FM3DESGO.js +0 -2
  158. package/dist/chunks/core-commands-D2MJ7QFZ.js +0 -2
  159. package/dist/chunks/datasets-UYIZCMNZ.js +0 -13
  160. package/dist/chunks/desktop-test-IWDHFDSZ.js +0 -3
  161. package/dist/chunks/dist-JPRXSUXC.js +0 -2
  162. package/dist/chunks/experiments-Q6TAHJV3.js +0 -2
  163. package/dist/chunks/hosted-harness-runtime-LMYM7PYZ.js +0 -2
  164. package/dist/chunks/hosted-profile-compiler-H2J5HFT3.js +0 -2
  165. package/dist/chunks/hosted-profile-evaluation-preparation-ZZ3MZJDR.js +0 -3
  166. package/dist/chunks/opchat-URWW53CK.js +0 -3
  167. package/dist/chunks/organizations-BPBJV7LZ.js +0 -2
  168. package/dist/chunks/project-agent-U6YNYPHS.js +0 -2
  169. package/dist/chunks/sandbox-command-TTLFWUXV.js +0 -2
  170. package/dist/chunks/src-NABQMSR3.js +0 -325
  171. package/dist/web/assets/App-BpYDvJ6x.js +0 -226
  172. package/dist/web/assets/AppTerminalPanel-CFsUD-di.js +0 -2
  173. package/dist/web/assets/HostedModelLearningReview-DiS-n3XW.js +0 -1
  174. package/dist/web/assets/LabsRoute-BL04wKhE.js +0 -52
  175. package/dist/web/assets/LabsRoute-Cq9XLVDP.css +0 -1
  176. package/dist/web/assets/MainChatThread-BSwHDALr.js +0 -2
  177. package/dist/web/assets/cssMode-DkhTpCaH.js +0 -1
  178. package/dist/web/assets/htmlMode-Bf3_KJ2b.js +0 -1
  179. package/dist/web/assets/index-DUIWDN8o.css +0 -1
  180. package/dist/web/assets/monaco.contribution-DKY5M77J.js +0 -2
  181. package/dist/web/assets/toggleHighContrast-B7NOMXDY.css +0 -1
@@ -1,42 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as Te,c as Pe,e as Z,j as Oe,k as ke,n as Ae,o as _e}from"./chunk-BJSXEGWG.js";import{E as v,I as Ie}from"./chunk-OUN6VQDO.js";import{i as xe,o as Ce,q as Ee}from"./chunk-VTWY3U4M.js";import{a as X,b as ye,h as Re}from"./chunk-EEJ3HL6O.js";import{Cd as O,Fd as L,Gd as ne,I as E,J as re,M as q,N as _,a as j}from"./chunk-VI3ZF54E.js";import{X as ge,Y as fe,_ as K,b as ie,ba as he,c as ae,ea as ve,fa as V,ja as we,la as be,ma as Se,p as ue,r as le,s as ce,t as pe,u as de,w as me}from"./chunk-ALZRXBEC.js";import{y as A}from"./chunk-MTJNKRXL.js";import{b as o}from"./chunk-ES2ISFJC.js";import{c as se,d as B,f as oe,h as H}from"./chunk-H7IWJN7L.js";import{a}from"./chunk-FTQLQJQV.js";import{promises as ee}from"node:fs";import at from"node:os";import ut from"node:path";import{createServer as lt}from"node:http";import{randomBytes as ct}from"node:crypto";var et=o.discriminatedUnion("op",[o.strictObject({op:o.literal("set"),path:o.array(o.string().min(1)).min(1),value:o.unknown()}),o.strictObject({op:o.literal("unset"),path:o.array(o.string().min(1)).min(1)})]),tt=o.discriminatedUnion("action",[o.strictObject({action:o.literal("patch"),expectedRevision:o.string(),operations:o.array(et).max(100)}),o.strictObject({action:o.literal("replace"),expectedRevision:o.string(),text:o.string().max(1048576)}),o.strictObject({action:o.literal("validate"),text:o.string().max(1048576)}),o.strictObject({action:o.literal("restore"),expectedRevision:o.string(),revision:o.string()}),o.strictObject({action:o.literal("trust"),root:o.string(),accountId:o.string(),trusted:o.boolean()}),o.strictObject({action:o.literal("client-state"),owner:o.string(),patch:we,importOnly:o.boolean().optional()})]);function He(n){let e=null;async function t(s,i){let u=H(n).config,l=null,c=null,p=null;try{l=await ae(u),p=await V(n,{projectRoot:s,accountId:i}),s||(e=p)}catch(S){c=B(S,u)}let h=p??(s?null:e);return{path:u,text:l,rawRevision:ie(l),issue:c,effective:h,usingLastValid:!p&&!!h,applies:"next_turn",recoverableRevisions:await le(n),clientState:c?null:await be(n)}}a(t,"status");async function r(s){let i=tt.parse(s);return i.action==="validate"?{valid:!0,document:ue(i.text,H(n).config)}:(i.action==="patch"&&await me(n,i.expectedRevision,i.operations),i.action==="replace"&&await ce(n,i.expectedRevision,i.text),i.action==="restore"&&await pe(n,i.revision,i.expectedRevision),i.action==="trust"&&await ve(n,i.root,i.accountId,i.trusted),i.action==="client-state"?Se(n,i.owner,i.patch,i.importOnly):t())}return a(r,"mutate"),{status:t,mutate:r,schema:de}}a(He,"createConfigurationPayloads");import{Buffer as Me}from"node:buffer";var $={"Access-Control-Allow-Headers":"authorization, content-type, x-openpond-team-id","Access-Control-Allow-Methods":"GET, POST, PUT, PATCH, DELETE, OPTIONS"},rt=25*1024*1024,D=class extends Error{constructor(t,r,s){super(s);this.status=t;this.code=r;this.name="HttpBodyError"}status;code;static{a(this,"HttpBodyError")}};function Ne(n,e,t={}){for(let[s,i]of Object.entries($))e.setHeader(s,i);let r=Be(n.headers.origin);return r?(e.setHeader("Vary",it(e.getHeader("Vary"))),nt(r,t)?(e.setHeader("Access-Control-Allow-Origin",r),{allowed:!0,origin:r}):{allowed:!1,origin:r}):{allowed:!0,origin:null}}a(Ne,"applyCorsHeaders");function nt(n,e={}){if(n==="null")return!0;let t=Ue(n);return t?ot(t)?!0:new Set((e.allowedOrigins??[]).map(s=>s?Ue(s):null).filter(s=>!!s)).has(t):!1}a(nt,"isAllowedCorsOrigin");function I(n,e,t){n.writeHead(e,{"Content-Type":"application/json",...$}),n.end(JSON.stringify(t))}a(I,"sendJson");function jt(n,e,t){n.writeHead(e,{"Content-Type":"text/plain; charset=utf-8",...$}),n.end(t)}a(jt,"sendText");function Lt(n,e,t,r){n.writeHead(e,{"Content-Type":r,"Content-Length":String(t.byteLength),"Cache-Control":"no-store","X-Content-Type-Options":"nosniff",...$}),n.end(t)}a(Lt,"sendBinary");async function Q(n,e={}){let t=e.maxBytes??rt,r=Be(n.headers["content-type"]),s=[],i=0;for await(let l of n){let c=Me.from(l);if(i+=c.byteLength,i>t)throw new D(413,"request_body_too_large",`JSON request body exceeds ${t} bytes.`);s.push(c)}let u=Me.concat(s).toString("utf8").trim();if(!u)return{};if(!st(r))throw new D(415,"unsupported_media_type","JSON request body requires Content-Type: application/json.");try{return JSON.parse(u)}catch{throw new D(400,"invalid_json","Request body is not valid JSON.")}}a(Q,"readJson");function qe(n,e,t){let r=n.headers.authorization;return(typeof r=="string"&&r.startsWith("Bearer ")?r.slice(7):null)===t}a(qe,"hasAuth");function Be(n){return Array.isArray(n)?n[0]??null:n??null}a(Be,"headerValue");function st(n){if(!n)return!1;let e=n.split(";")[0]?.trim().toLowerCase();return e==="application/json"||!!e?.endsWith("+json")}a(st,"isJsonContentType");function Ue(n){try{let e=new URL(n);return e.protocol!=="http:"&&e.protocol!=="https:"?null:e.origin}catch{return null}}a(Ue,"normalizeOrigin");function ot(n){let e=new URL(n);return e.hostname==="localhost"||e.hostname==="127.0.0.1"||e.hostname==="::1"||e.hostname==="[::1]"}a(ot,"isLoopbackOrigin");function it(n){let t=(Array.isArray(n)?n.join(", "):n?String(n):"").split(",").map(r=>r.trim()).filter(Boolean);return t.some(r=>r.toLowerCase()==="origin")||t.push("Origin"),t.join(", ")}a(it,"appendVaryOrigin");function De(n){return`<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>OpenPond recovery</title>
3
- <style nonce="${n}">body{font:16px system-ui;background:#171819;color:#eee;max-width:850px;margin:6vh auto;padding:24px}textarea{box-sizing:border-box;width:100%;min-height:280px;background:#222;color:#eee;padding:14px;border:1px solid #777;border-radius:8px;font:14px monospace}button,input,select{font:inherit;margin:6px;padding:8px}pre{white-space:pre-wrap}code{overflow-wrap:anywhere}button{cursor:pointer}p{line-height:1.5}</style>
4
- <h1>OpenPond needs a storage repair</h1><p id="issue" role="alert">Loading recovery details\u2026</p><p><code id="file"></code></p>
5
- <p id="action"></p><p>Migration backups and the source installation remain available. Execution services are stopped while recovery is open.</p>
6
- <details id="editor"><summary>Edit configuration</summary><textarea id="text" aria-label="Configuration TOML" spellcheck="false"></textarea><button id="save">Validate and save</button><button id="reload">Reload file</button><select id="revisions" aria-label="Restore a verified configuration revision"><option value="">Restore a verified revision\u2026</option></select></details>
7
- <details><summary>Migration sources and diagnostics</summary><pre id="migration"></pre><label>Previous app home <input id="appHome"></label><label>Previous account config <input id="configSource"></label><label>Configuration conflict choices (JSON from the preview) <textarea id="resolutions" aria-label="Migration conflict choices" spellcheck="false" placeholder='[{"path":["chat","steer_active_responses"],"choice":"existing"}]'></textarea></label><button id="preview">Preview migration</button><button id="migrate">Use these sources</button><button id="restart">Restart failed preparation</button><button id="diagnostics">Export diagnostics</button></details>
8
- <button id="retry">Retry startup</button><p id="message" role="status"></p>
9
- <script nonce="${n}">
10
- let token='',state=null,editing=false,revision=null;
11
- const el=id=>document.getElementById(id);
12
- async function request(route,body){const r=await fetch(route,{method:body?'POST':'GET',headers:{'Content-Type':'application/json',Authorization:'Bearer '+token},body:body?JSON.stringify(body):undefined});const v=await r.json();if(!r.ok)throw Error(v.error||'Recovery request failed');return v;}
13
- function message(error){el('message').textContent=error instanceof Error?error.message:String(error);}
14
- async function load(){state=await request('/v1/recovery');el('issue').textContent=state.issue.message;el('action').textContent=state.issue.action;el('file').textContent=state.issue.path;el('migration').textContent=JSON.stringify(state.migration,null,2);if(!editing){el('text').value=state.config.text||'schema_version = 1\\n';revision=state.config.rawRevision;}el('revisions').replaceChildren(new Option('Restore a verified revision\u2026',''),...state.config.recoverableRevisions.map(r=>new Option(r.createdAt,r.revision)));el('editor').hidden=!state.configEditable;}
15
- el('text').oninput=()=>{editing=true};
16
- el('reload').onclick=()=>{editing=false;load().catch(message)};
17
- el('save').onclick=async()=>{try{await request('/v1/configuration',{action:'replace',text:el('text').value,expectedRevision:revision});editing=false;await load();message('Configuration saved. Retry startup when ready.')}catch(e){message(e)}};
18
- el('revisions').onchange=async e=>{if(!e.target.value)return;try{await request('/v1/configuration',{action:'restore',revision:e.target.value,expectedRevision:state.config.rawRevision});editing=false;await load();message('Verified revision restored.')}catch(e){message(e)}};
19
- for(const [id,action] of [['preview','preview'],['migrate','migrate'],['restart','restart']])el(id).onclick=async()=>{try{const result=await request('/v1/recovery',{action,sourceAppHome:el('appHome').value||undefined,sourceConfig:el('configSource').value||undefined,resolutions:el('resolutions').value?JSON.parse(el('resolutions').value):undefined});el('migration').textContent=JSON.stringify(result,null,2);message(action==='preview'?'Review the source paths above.':'Migration operation completed; retry startup.')}catch(e){message(e)}};
20
- el('diagnostics').onclick=()=>{if(!state)return;const blob=new Blob([JSON.stringify({issue:state.issue,migration:state.migration,config:{path:state.config.path,rawRevision:state.config.rawRevision,issue:state.config.issue}},null,2)],{type:'application/json'});const a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download='openpond-recovery-diagnostics.json';a.click();URL.revokeObjectURL(a.href)};
21
- el('retry').onclick=async()=>{try{await request('/v1/recovery',{action:'retry'});message('Starting OpenPond\u2026');const timer=setInterval(async()=>{try{const h=await(await fetch('/health')).json();if(!h.recovery){clearInterval(timer);const next=new URLSearchParams(location.hash.slice(1)).get('returnTo');if(next){const u=new URL(next);if(['localhost','127.0.0.1','[::1]'].includes(u.hostname)){location.replace(u.toString());return}}location.reload();}}catch{}},500)}catch(e){message(e)}};
22
- (async()=>{const params=new URLSearchParams(location.hash.slice(1));token=params.get('openpondToken')||'';if(!token&&window.openpond?.getConnection)token=(await window.openpond.getConnection()).token;if(!token){message('Open the authenticated recovery URL from the launcher.');return}await load()})().catch(message);
23
- </script></html>`}a(De,"startupRecoveryPage");var pt=o.strictObject({action:o.enum(["preview","migrate","restart","retry"]),sourceAppHome:o.string().optional(),sourceConfig:o.string().optional(),resolutions:ge.optional()});function Fe(n){return n instanceof se&&/^(PRIVATE_STORAGE_|UNSAFE_STORAGE_|INVALID_CONFIG|CONFIG_|MIGRATION_|SOURCE_CHANGED_|CREDENTIAL_|UNSUPPORTED_STORAGE_|INVALID_MIGRATION_|INVALID_ACCOUNT_|MISSING_INSTRUCTION_|INVALID_PROFILE_|DATABASE_RECOVERY_)/.test(n.issue.code)}a(Fe,"isRecoverableStartupError");async function je(n,e,t){let r=/^(UNSUPPORTED_STORAGE_|INVALID_MIGRATION_|UNSAFE_STORAGE_|PRIVATE_STORAGE_)/.test(t.issue.code),s=r?await ee.mkdtemp(ut.join(at.tmpdir(),"openpond-recovery-")):n;return Te(s,async()=>{let{token:i,tokenFile:u}=await Oe(s),l=He(n),c=t.issue,p,h=new Promise(w=>{p=w}),S=lt((w,g)=>{(async()=>{let b=new URL(w.url??"/","http://127.0.0.1");if(!Ne(w,g).allowed){I(g,403,{error:"Origin not allowed"});return}if(w.method==="OPTIONS"){I(g,204,{});return}if(w.method==="GET"&&b.pathname==="/health"){I(g,200,{ok:!0,server:"openpond-app-server",version:ye,recovery:!0});return}if(w.method==="GET"&&b.pathname==="/"){let f=ct(18).toString("base64");g.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store","Content-Security-Policy":`default-src 'none'; script-src 'nonce-${f}'; style-src 'nonce-${f}'; connect-src 'self'; base-uri 'none'; frame-ancestors 'none'`}),g.end(De(f));return}if(!qe(w,b,i)){I(g,401,{error:"Unauthorized"});return}let U=!r;if(w.method==="GET"&&b.pathname==="/v1/recovery"){I(g,200,{issue:c,configEditable:U,config:r?{path:H(n).config,text:null,rawRevision:"unavailable",issue:c,recoverableRevisions:[]}:await l.status(),migration:await fe(n).catch(f=>({issue:B(f,n)}))});return}if(w.method==="POST"&&b.pathname==="/v1/configuration"&&U){I(g,200,await l.mutate(await Q(w)));return}if(w.method==="POST"&&b.pathname==="/v1/recovery"){let f=pt.parse(await Q(w));if(r&&f.action!=="retry"&&f.action!=="preview")throw t;if(f.action==="restart"){I(g,200,await he(n));return}if(f.action==="preview"||f.action==="migrate"){I(g,200,await K(n,{sourceAppHome:f.sourceAppHome,sourceConfig:f.sourceConfig,resolutions:f.resolutions,dryRun:f.action==="preview"}));return}await K(n),await V(n),I(g,200,{ready:!0}),p();return}I(g,503,{error:`${c.message} ${c.action}`,issue:c,recovery:!0})})().catch(b=>{c=B(b,n),I(g,422,{error:`${c.message} ${c.action}`,issue:c})})});await new Promise((w,g)=>{S.once("error",g),S.listen(e,"127.0.0.1",()=>{S.off("error",g),w()})});let P=S.address().port,k=`http://127.0.0.1:${P}`;return await Pe(s,k,"startup-recovery"),{url:k,port:P,token:i,tokenFile:u,storePath:H(n).database,repaired:h,close:a(async()=>{S.closeIdleConnections(),await new Promise((w,g)=>S.close(b=>b?g(b):w())),r&&await ee.rm(s,{recursive:!0,force:!0})},"close")}}).catch(async i=>{throw r&&await ee.rm(s,{recursive:!0,force:!0}),i})}a(je,"startRecoveryServer");import{createHash as Et}from"node:crypto";import{createHash as dt,randomUUID as Le}from"node:crypto";var mt=o.object({updatedAt:o.string(),id:o.string().min(1)}).strict(),gt=o.object({entries:o.array(E).max(200),nextBefore:mt.nullable()}).strict(),ft=o.object({run:E,replayed:o.boolean()}).strict(),W=class{constructor(e){this.client=e}client;static{a(this,"HostedCreateImproveStorage")}async getCreateImproveRun(e){let t=await this.client.request({contractVersion:v,requestId:Le(),operation:"create-improve/execute",params:{action:"get",runId:e}});return t===null?null:E.parse(t)}async listCreateImproveRuns(e={}){let t=Math.max(1,Math.min(1e3,Math.trunc(e.limit??250))),r=Array.isArray(e.state)?[...e.state]:e.state?[e.state]:[],s=[],i=null;for(;s.length<t;){let u=gt.parse(await this.client.request({contractVersion:v,requestId:Le(),operation:"create-improve/execute",params:{action:"page",query:{profileId:e.profileId??null,targetKind:e.targetKind??null,targetId:e.targetId??null,state:r},before:i,limit:Math.min(50,t-s.length)}}));if(e.conversationId&&u.entries.some(l=>l.scope.conversationId!==e.conversationId))throw new Error("Hosted Create/Improve page crossed its conversation scope.");if(s.push(...u.entries),!u.nextBefore)break;if(u.entries.length===0||i&&(u.nextBefore.updatedAt>i.updatedAt||u.nextBefore.updatedAt===i.updatedAt&&u.nextBefore.id>=i.id))throw new Error("Hosted Create/Improve cursor did not advance.");i=u.nextBefore}return s}async upsertCreateImproveRun(e){let t=E.parse(e),r=`create-improve:${dt("sha256").update(JSON.stringify(t)).digest("hex")}`,s=await this.client.request({contractVersion:v,requestId:r,operation:"create-improve/execute",params:{action:"put",run:t}});return E.parse(o.object({run:o.unknown()}).strict().parse(s).run)}async mutateCreateImproveRun(e,t){let r=re.parse(e),s=await this.getCreateImproveRun(r.runId);if(!s)throw new Error(`Create/Improve run not found: ${r.runId}`);if(s.appliedActionIds.includes(r.actionId))return{run:s,replayed:!0};if(s.revision!==r.expectedRevision)throw new Error(`Create/Improve run changed from revision ${r.expectedRevision} to ${s.revision}. Refresh and try again.`);let i=E.parse(t(s));if(i.id!==s.id||i.revision!==s.revision+1||!i.appliedActionIds.includes(r.actionId))throw new Error("Create/Improve mutation must preserve identity, advance one revision and record its action.");return ft.parse(await this.client.request({contractVersion:v,requestId:r.actionId,operation:"create-improve/execute",params:{action:"mutate",mutation:r,next:i}}))}};import{randomUUID as vt}from"node:crypto";async function F(n,e){let t=n;for(;;)try{return await e(t)}catch(r){if(!ht(r)||t<=1)throw r;t=Math.max(1,Math.floor(t/2))}}a(F,"hostedBoundedPage");function ht(n){return n instanceof Error?n.message==="Host storage response is too large."||n.message==="Host storage request failed: host_storage_response_too_large":!1}a(ht,"isOversizeResponse");var wt=o.object({entries:o.array(o.object({sequence:o.number().int().positive(),event:j})).max(200),totalMatchingEvents:o.number().int().nonnegative(),remainingMatchingEvents:o.number().int().nonnegative()}).strict(),G=class{constructor(e){this.client=e}client;static{a(this,"HostedRuntimeEventStorage")}async runtimeEventsForSession(e,t={}){let r=t.limit==null?1e4:Math.max(0,Math.trunc(t.limit));if(r===0)return[];let s=Math.min(r,1e4),i=[],u=Math.max(0,t.afterSequence??0),l=0,c=t.names?new Set(t.names):null;for(;i.length<=s;){let p=await this.runtimeEventPageRows({sessionId:e,afterSequence:u,beforeSequence:null,limit:Math.min(200,s+1-i.length),excludeReasoningDeltas:t.excludeReasoningDeltas});for(let h of p.entries){if(h.sequence<=u)throw new Error("Host event cursor did not advance.");if(u=h.sequence,l+=1,l>1e4)throw new Error("Hosted runtime event scan exceeds 10,000 rows; use a narrower query.");(!c||c.has(h.event.name))&&i.push(h.event)}if(p.entries.length===0||p.remainingMatchingEvents<=p.entries.length)break}if(i.length>s||t.limit==null&&r===1e4&&i.length===s)throw new Error("Hosted runtime event read exceeds 10,000 rows; use a bounded cursor query.");return i}async persistedRuntimeEventsForSession(e,t={}){return this.runtimeEventsForSession(e,t)}async appendRuntimeEvent(e){let t=j.parse(e),r=await this.client.request({contractVersion:v,requestId:t.id,operation:"event/append",params:{event:t}});return o.object({event:j}).strict().parse(r).event}async runtimeEventPageRows(e){let t=Math.max(1,Math.min(1e3,Math.trunc(e.limit))),r=Math.max(0,Math.trunc(e.afterSequence)),s=e.beforeSequence,i=[],u=0,l=0;for(;i.length<t;){let c=Math.min(200,t-i.length),p=await F(c,async h=>wt.parse(await this.client.request({contractVersion:v,requestId:`event-page:${vt()}`,operation:"events/page",params:{sessionId:e.sessionId,afterSequence:r,beforeSequence:s,limit:h,...e.excludeReasoningDeltas?{excludeReasoningDeltas:!0}:{}}})));if(i.length===0&&(u=p.totalMatchingEvents,l=p.remainingMatchingEvents),i=s===null?[...i,...p.entries]:[...p.entries,...i],p.entries.length===0||p.remainingMatchingEvents<=p.entries.length)break;if(s===null){let h=p.entries.at(-1).sequence;if(h<=r)throw new Error("Host event cursor did not advance.");r=h}else{let h=p.entries[0].sequence;if(h>=s)throw new Error("Host event cursor did not advance.");s=h}}return{entries:i,totalMatchingEvents:u,remainingMatchingEvents:l}}};import{randomUUID as y}from"node:crypto";var Ve=o.object({revision:o.number().int().min(1),session:q}).strict(),$e=o.object({revision:o.number().int().min(1),turn:_}).strict(),bt=o.object({sessions:o.array(q).max(200),nextAfterId:o.string().min(1).nullable()}).strict(),St=o.object({turns:o.array(_).max(200),nextBeforeSortIndex:o.number().int().nonnegative().nullable()}).strict(),J=class{constructor(e){this.client=e}client;static{a(this,"HostedSessionStorage")}async count(){let e=await this.client.request({contractVersion:v,requestId:y(),operation:"session/count",params:{}});return o.object({count:o.number().int().nonnegative()}).strict().parse(e).count}async get(e){let t=await this.client.request({contractVersion:v,requestId:y(),operation:"session/get",params:{sessionId:e}});return t===null?null:Ve.parse(t)}async sessionCount(){return this.count()}async sessionShells(){let e=[],t=null;do{let r=await F(Math.min(10,1001-e.length),async s=>bt.parse(await this.client.request({contractVersion:v,requestId:y(),operation:"session/page",params:{afterId:t,limit:s}})));if(e.push(...r.sessions),e.length>1e3)throw new Error("Hosted session list exceeds 1,000 rows; use a scoped page query.");if(r.nextAfterId!==null&&(r.sessions.length===0||t!==null&&r.nextAfterId<=t))throw new Error("Host session cursor did not advance.");t=r.nextAfterId}while(t!==null);return e}async getSession(e){return(await this.get(e))?.session??null}async insertSessionAtFront(e){await this.put({session:e,expectedRevision:null,requestId:y()})}async updateSession(e,t){let r=await this.get(e);if(!r)return null;let s=q.parse(t(r.session));if(s.id!==e)throw new Error("A session update cannot change its identity.");return(await this.put({session:s,expectedRevision:r.revision,requestId:y()})).session}async put(e){let t=q.parse(e.session);return Ve.parse(await this.client.request({contractVersion:v,requestId:e.requestId,operation:"session/put",params:{sessionId:t.id,expectedRevision:e.expectedRevision,session:t}}))}async readTurn(e){let t=await this.client.request({contractVersion:v,requestId:y(),operation:"turn/get",params:{turnId:e}});return t===null?null:$e.parse(t)}async getTurn(e){return(await this.readTurn(e))?.turn??null}async turnsForSession(e,t=50){let r=Math.max(1,Math.min(1e3,Math.trunc(t))),s=[],i=null;for(;s.length<r;){let u=await F(Math.min(200,r-s.length),async l=>St.parse(await this.client.request({contractVersion:v,requestId:y(),operation:"turn/page",params:{sessionId:e,beforeSortIndex:i,limit:l}})));if(s.push(...u.turns),u.nextBeforeSortIndex===null)break;if(i!==null&&u.nextBeforeSortIndex>=i)throw new Error("Host turn cursor did not advance.");i=u.nextBeforeSortIndex}return s}async countTurnsForSession(e){let t=await this.client.request({contractVersion:v,requestId:y(),operation:"turn/count",params:{sessionId:e}});return o.object({count:o.number().int().nonnegative()}).strict().parse(t).count}async hasSubagentParentWakeTurn(e,t){return await this.wakeCount(e,"messageId",t)>0}async countSubagentParentWakeTurns(e,t){return this.wakeCount(e,"fromRunId",t)}async latestAssistantTextForSession(e){let t=await this.client.request({contractVersion:v,requestId:y(),operation:"events/latestAssistantText",params:{sessionId:e}});return o.object({text:o.string().nullable()}).strict().parse(t).text}async wakeCount(e,t,r){let s=await this.client.request({contractVersion:v,requestId:y(),operation:"turn/wakeCount",params:{sessionId:e,key:t,value:r}});return o.object({count:o.number().int().nonnegative()}).strict().parse(s).count}async latestTurnForSession(e,t){let r=await this.client.request({contractVersion:v,requestId:y(),operation:"turn/latest",params:{sessionId:e,status:t??null}});return r===null?null:_.parse(r)}async latestPersistedTurnForSession(e,t){return this.latestTurnForSession(e,t)}async insertTurn(e){await this.putTurn({turn:e,expectedRevision:null,requestId:y()})}async updateTurn(e,t){let r=await this.readTurn(e);if(!r)return null;let s=_.parse(t(r.turn));if(s.id!==e||s.sessionId!==r.turn.sessionId)throw new Error("A turn update cannot change its identity.");return(await this.putTurn({turn:s,expectedRevision:r.revision,requestId:y()})).turn}async putTurn(e){let t=_.parse(e.turn);return $e.parse(await this.client.request({contractVersion:v,requestId:e.requestId,operation:"turn/put",params:{sessionId:t.sessionId,turnId:t.id,expectedRevision:e.expectedRevision,turn:t}}))}};import{createHash as yt,randomUUID as Rt}from"node:crypto";var x=o.object({ok:o.literal(!0)}).strict(),z=o.array(O),It=o.array(o.string()),Tt=o.object({turnId:o.string(),run:A}).strict(),Pt=o.object({inputs:o.array(O).max(10),hasMore:o.boolean()}).strict(),xt=o.object({items:o.array(L).max(10),hasMore:o.boolean()}).strict(),Ct=o.object({items:o.array(o.string()).max(200),hasMore:o.boolean()}).strict();function Y(n,e){return`inbox:${n}:${yt("sha256").update(JSON.stringify(e)).digest("hex")}`}a(Y,"retryKey");var M=class{constructor(e){this.client=e}client;static{a(this,"HostedTaskInboxStorage")}async call(e,t,r=Rt()){let s=await this.client.request({contractVersion:v,requestId:r,operation:"task-inbox/execute",params:e});return t.parse(s)}async inputPages(e,t=Number.MAX_SAFE_INTEGER){let r=[],s=0;for(;r.length<t;){let i=await this.call(e(s),Pt);for(let u of i.inputs){if(u.sequence<=s)throw new Error("Host task input cursor did not advance.");if(s=u.sequence,r.push(u),r.length>=t)break}if(!i.hasMore)return r;if(i.inputs.length===0)throw new Error("Host task input page made no progress.")}return r}async recoverTaskInboxOwners(e){return this.call({action:"recoverTaskInboxOwners",ownerId:e},o.array(o.object({sessionId:o.string(),turnId:o.string()}).strict()))}async hasTaskCompletion(e){return this.call({action:"hasTaskCompletion",turnId:e},o.boolean())}async taskInboxSnapshot(e){let t=await this.call({action:"taskInboxSnapshot",sessionId:e},ne),[r,s]=await Promise.all([this.inputPages(i=>({action:"taskInboxSnapshotInputs",sessionId:e,afterSequence:i})),this.taskWaitsForSession(e)]);return{...t,inputs:r,waits:s}}async declareTaskWork(e,t,r,s){await this.call({action:"declareTaskWork",sessionId:e,turnId:t,ownerId:r,areas:s},x)}async taskWorkAreas(e){return this.call({action:"taskWorkAreas",sessionId:e},It)}async admitTaskInput(e){return this.call({action:"admitTaskInput",input:e},O)}async admitTaskInputs(e){return this.call({action:"admitTaskInputs",inputs:e},z)}async rejectTaskInput(e,t){await this.call({action:"rejectTaskInput",id:e,error:t},x)}async getTaskInput(e){return this.call({action:"getTaskInput",id:e},O.nullable())}async taskInputsForSession(e,t={}){let r=Math.max(1,Math.min(500,t.limit??128)),s=[],i=t.afterSequence??0;for(;s.length<r;){let u=Math.min(10,r-s.length),l=await this.call({action:"taskInputsForSession",sessionId:e,query:{afterSequence:i,pendingOnly:t.pendingOnly,limit:u}},z);if(!l.length)break;for(let c of l){if(c.sequence<=i)throw new Error("Host task input cursor did not advance.");i=c.sequence,s.push(c)}if(l.length<u)break}return s}async mutateTaskInput(e,t,r){return this.call({action:"mutateTaskInput",sessionId:e,inputId:t,change:r},O,Y("mutate",{sessionId:e,inputId:t,change:r}))}async openTaskInboxTurn(e,t,r){await this.call({action:"openTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},x,Y("open",{sessionId:e,turnId:t,ownerId:r}))}async renewTaskInboxTurn(e,t,r){await this.call({action:"renewTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},x)}async pendingTaskInputs(e,t){return this.inputPages(r=>({action:"pendingTaskInputs",sessionId:e,turnId:t,afterSequence:r}))}async taskAssignmentInputs(e){return this.inputPages(t=>({action:"taskAssignmentInputs",turnId:e,afterSequence:t}))}async pauseTaskInboxTurn(e,t,r){await this.call({action:"pauseTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},x)}async includeTaskInputs(e,t,r,s){return this.call({action:"includeTaskInputs",sessionId:e,turnId:t,ownerId:r,requestId:s},z,Y("include",{sessionId:e,turnId:t,ownerId:r,requestId:s}))}async settleTaskInputRequest(e,t){await this.call({action:"settleTaskInputRequest",requestId:e,outcome:t},x)}async sealTaskInboxTurn(e,t,r){return this.call({action:"sealTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},o.boolean())}async sealNativeTaskInboxTurn(e,t,r){return this.call({action:"sealNativeTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},z)}async closeTaskInboxTurn(e,t,r,s){await this.call({action:"closeTaskInboxTurn",sessionId:e,turnId:t,ownerId:r,outcome:s},x)}async taskInboxPaused(e){return this.call({action:"taskInboxPaused",sessionId:e},o.boolean())}async reserveTaskFollowup(e,t,r){return this.call({action:"reserveTaskFollowup",sessionId:e,turnId:t,ownerId:r},O.nullable(),Y("reserve",{sessionId:e,turnId:t,ownerId:r}))}async taskInboxWakeTargets(){let e=[],t="";for(;;){let r=await this.call({action:"taskInboxWakeTargets",afterSessionId:t},Ct);for(let s of r.items){if(s<=t)throw new Error("Host task wake cursor did not advance.");t=s,e.push(s)}if(!r.hasMore)return e;if(!r.items.length)throw new Error("Host task wake page made no progress.")}}async createTaskWait(e){return this.call({action:"createTaskWait",value:e},L)}async settleTaskWait(e,t){return this.call({action:"settleTaskWait",id:e,state:t},L)}async taskWaitsForSession(e){let t=[],r="";for(;;){let s=await this.call({action:"taskWaitsForSession",sessionId:e,afterId:r},xt);for(let i of s.items){if(i.id<=r)throw new Error("Host task wait cursor did not advance.");r=i.id,t.push(i)}if(!s.hasMore)return t;if(!s.items.length)throw new Error("Host task wait page made no progress.")}}async commitSubagentCompletion(e,t){await this.call({action:"commitSubagentCompletion",value:e,turnId:t},x)}async pendingTaskCompletions(e=""){let t=[],r=e;for(;t.length<100;){let s=await this.call({action:"pendingTaskCompletions",afterTurnId:r},o.array(Tt).max(10));for(let i of s){if(i.turnId<=r)throw new Error("Host task completion cursor did not advance.");r=i.turnId,t.push(i)}if(s.length<10)break}return t}async settleTaskCompletion(e,t){await this.call({action:"settleTaskCompletion",turnId:e,inputId:t},x)}async upsertSubagentRun(e){return this.call({action:"upsertSubagentRun",value:A.parse(e)},A)}async getSubagentRun(e){return this.call({action:"getSubagentRun",id:e},A.nullable())}async listSubagentRuns(e={}){let r=[],s="",i=e.status?Array.isArray(e.status)?[...e.status]:[e.status]:null;for(;;){let u=await this.call({action:"listSubagentRuns",query:{parentSessionId:e.parentSessionId,childSessionId:e.childSessionId,status:i,afterId:s,limit:10}},o.array(A).max(10));for(let l of u){if(l.id<=s)throw new Error("Host subagent run cursor did not advance.");if(s=l.id,r.push(l),r.length>1e3)throw new Error("Hosted subagent run list exceeds 1,000 rows; use a narrower session or status query.")}if(u.length<10)break}return r.sort((u,l)=>(l.updatedAt??l.createdAt).localeCompare(u.updatedAt??u.createdAt)),e.limit===void 0?r:r.slice(0,Math.max(1,Math.min(1e3,e.limit)))}async listActiveSubagentRuns(e={}){return this.listSubagentRuns({...e,status:e.status??["queued","running","needs_resume"]})}};var te=class extends M{static{a(this,"HostedTurnRepository")}sessions;events;approvals;usage;createImprove;constructor(e){super(e),this.sessions=new J(e),this.events=new G(e),this.approvals=new Ae(e),this.usage=new _e(e),this.createImprove=new W(e)}sessionShells(){return this.sessions.sessionShells()}sessionCount(){return this.sessions.sessionCount()}getSession(e){return this.sessions.getSession(e)}insertSessionAtFront(e){return this.sessions.insertSessionAtFront(e)}updateSession(e,t){return this.sessions.updateSession(e,t)}getTurn(e){return this.sessions.getTurn(e)}insertTurn(e){return this.sessions.insertTurn(e)}updateTurn(e,t){return this.sessions.updateTurn(e,t)}latestTurnForSession(e,t){return this.sessions.latestTurnForSession(e,t)}latestPersistedTurnForSession(e,t){return this.sessions.latestPersistedTurnForSession(e,t)}turnsForSession(e,t){return this.sessions.turnsForSession(e,t)}countTurnsForSession(e){return this.sessions.countTurnsForSession(e)}hasSubagentParentWakeTurn(e,t){return this.sessions.hasSubagentParentWakeTurn(e,t)}countSubagentParentWakeTurns(e,t){return this.sessions.countSubagentParentWakeTurns(e,t)}latestAssistantTextForSession(e){return this.sessions.latestAssistantTextForSession(e)}appendRuntimeEvent(e){return this.events.appendRuntimeEvent(e)}runtimeEventsForSession(e,t){return this.events.runtimeEventsForSession(e,t)}persistedRuntimeEventsForSession(e,t){return this.events.persistedRuntimeEventsForSession(e,t)}async runtimeEventsForTurn(e,t){let r=await this.getTurn(e);if(!r)return[];let s=(await this.events.runtimeEventsForSession(r.sessionId)).filter(i=>i.turnId===e&&(!t?.names||t.names.includes(i.name)));return t?.limit==null?s:s.slice(0,Math.max(0,t.limit))}runtimeEventPageRows(e){return this.events.runtimeEventPageRows(e)}getApproval(e){return this.approvals.getApproval(e)}async upsertApproval(e){let t=await this.approvals.readApproval(e.id);t&&JSON.stringify(t.approval)===JSON.stringify(e)||await this.approvals.putApproval({approval:e,expectedRevision:t?.revision??null,requestId:`approval:${Et("sha256").update(JSON.stringify({approval:e,revision:t?.revision??null})).digest("hex")}`})}upsertModelUsageRecord(e){return this.usage.upsertModelUsageRecord(e)}listModelUsageRecords(e){return this.usage.listModelUsageRecords(e)}getCreateImproveRun(e){return this.createImprove.getCreateImproveRun(e)}listCreateImproveRuns(e){return this.createImprove.listCreateImproveRuns(e)}upsertCreateImproveRun(e){return this.createImprove.upsertCreateImproveRun(e)}mutateCreateImproveRun(e,t){return this.createImprove.mutateCreateImproveRun(e,t)}};function We(n){return new te(n)}a(We,"createHostedRuntimeCoreStorage");function Ge(n=process.env){let e=n.OPENPOND_API_KEY?.trim(),t=n.OPENPOND_OPCHAT_API_URL?.trim(),r=n.OPENPOND_HOSTED_MODEL_ID?.trim();if(!e||!t||!r)throw new Error("Hosted model stream requires a host credential, API URL, and admitted model.");let s=new URL(t);if(s.protocol!=="https:"||s.username||s.password||s.search||s.hash)throw new Error("Hosted model stream API URL is invalid.");return a(async function*(u){if(u.model!==r)throw new Error("Hosted model selection changed outside host admission.");yield*xe({...u,apiBaseUrl:s.toString(),token:e,model:r})},"streamHostedModel")}a(Ge,"createHostedModelStreamFromEnvironment");import{existsSync as Ot}from"node:fs";import T from"node:path";import{fileURLToPath as kt}from"node:url";var Je=T.dirname(kt(import.meta.url));function R(n,e,t){let r=n[e+1];if(!r||r.startsWith("--"))throw new Error(`${t} requires a value.`);return r}a(R,"requireValue");function ze(n,e){let t=Number.parseInt(n,10);if(!Number.isFinite(t)||t<0||t>65535)throw new Error(`${e} must be a port from 0 to 65535.`);return t}a(ze,"parsePort");function Xe(n){let e="serve",t=X,r=17874,s=null,i=!1,u=!1,l=null,c,p=!1,h,S=null,P=null,k=null,w=null,g,b="sqlite_bundle",U=0,f=n[0];if(f&&!f.startsWith("-")){if(f==="serve"||f==="server")e="serve";else if(f==="app-server")e="app-server";else if(f==="web")e="web";else{if(f==="help")return{mode:e,host:t,port:r,webRoot:s,openBrowser:i,printAccessUrl:u,storeDir:l,runtimeStorage:b,help:!0};throw new Error(`Unknown command: ${f}`)}U=1}for(let m=U;m<n.length;m+=1){let d=n[m];if(d==="--help"||d==="-h")return{mode:e,host:t,port:r,webRoot:s,openBrowser:i,printAccessUrl:u,storeDir:l,runtimeStorage:b,help:!0};if(d==="--listen"){let C=Re(R(n,m,d));t=C.host,r=ze(String(C.port),d),m+=1}else if(d==="--hostname"||d==="--host")t=R(n,m,d),m+=1;else if(d==="--port")r=ze(R(n,m,d),d),m+=1;else if(d==="--web-root")s=T.resolve(R(n,m,d)),m+=1;else if(d==="--source-browser-state")h=T.resolve(R(n,m,d)),m+=1;else{if(d==="--store-dir")throw new Error("--store-dir has been replaced by --home. Use --home <directory> or OPENPOND_HOME.");if(d==="--home")l=T.resolve(R(n,m,d)),m+=1;else if(d==="--hosted-cache-home")c=T.resolve(R(n,m,d)),m+=1;else if(d==="--experiment-owner")p=!0;else if(d==="--runtime-storage"){if(R(n,m,d)!=="hosted-postgres")throw new Error("Unsupported app-server runtime storage.");b="hosted_postgres",m+=1}else if(d==="--profile-source-root")S=T.resolve(R(n,m,d)),m+=1;else if(d==="--profile-repository-id")P=R(n,m,d),m+=1;else if(d==="--profile-id")k=R(n,m,d),m+=1;else if(d==="--profile-revision")w=R(n,m,d),m+=1;else if(d==="--hosted-profile-release"){if(g)throw new Error("Duplicate hosted Profile release descriptor.");let C=R(n,m,d);if(C.length>16e3||!/^[A-Za-z0-9_-]+$/.test(C))throw new Error("Invalid hosted Profile release descriptor.");try{g=ke.parse(JSON.parse(Buffer.from(C,"base64url").toString("utf8")))}catch{throw new Error("Invalid hosted Profile release descriptor.")}m+=1}else if(d==="--open-browser")i=!0;else if(d==="--print-access-url")u=!0;else throw new Error(`Unknown option: ${d}`)}}if(i&&u)throw new Error("--open-browser and --print-access-url cannot be used together.");if(e!=="web"&&(i||u))throw new Error("Browser options are only available in web mode.");let N=[S,P,k,w].filter(Boolean).length;if(N&&(N!==4||e!=="app-server"))throw new Error("Profile source flags require app-server mode and --profile-source-root, --profile-repository-id, --profile-id, and --profile-revision together.");if(b==="hosted_postgres"&&(e!=="app-server"||l||N))throw new Error("Hosted Postgres app-server cannot use --home or local Profile source flags.");if(g&&b!=="hosted_postgres")throw new Error("Hosted Profile release requires hosted Postgres app-server mode.");if(c&&b!=="hosted_postgres")throw new Error("Hosted cache home requires hosted Postgres mode.");if(p&&(e!=="app-server"||b!=="sqlite_bundle"||N||!l))throw new Error("Experiment owner mode requires an isolated app-server home without Profile selection.");return{mode:e,host:t,port:r,webRoot:s,openBrowser:i,printAccessUrl:u,storeDir:l,runtimeStorage:b,sourceBrowserState:h,...N?{profileSource:{repoPath:S,repositoryId:P,profileId:k,sourceRevision:w}}:{},...g?{admittedProfileRelease:g}:{},...c?{hostedCacheHome:c}:{},...p?{experimentOwner:!0}:{},help:!1}}a(Xe,"parseCliArgs");function At(){return[process.env.OPENPOND_WEB_ROOT,T.resolve(process.cwd(),"apps/web/dist"),T.resolve(Je,"../../web/dist"),T.resolve(process.cwd(),"web"),T.resolve(Je,"../web")].filter(n=>!!n)}a(At,"defaultWebRootCandidates");function _t(n){let e=n?[n]:At();for(let t of e){let r=T.resolve(t);if(Ot(T.join(r,"index.html")))return r}return null}a(_t,"resolveWebRoot");function Ht(n){let e=n==="0.0.0.0"||n==="::"?"127.0.0.1":n;return e.includes(":")&&!e.startsWith("[")?`[${e}]`:e}a(Ht,"formatHostForUrl");function Mt(n){return`http://${Ht(n.status.host)}:${n.status.port}`}a(Mt,"browserBaseUrl");function Ut(n,e){let t=new URL(n),r=new URLSearchParams;return r.set("openpondServerUrl",n),r.set("openpondToken",e),t.hash=r.toString(),t.toString()}a(Ut,"tokenizedWebUrl");async function Ye(n,e=Ee){let t=Ut(n.baseUrl,n.token);if(n.printAccessUrl)return{stdout:[`OpenPond access URL: ${t}`],stderr:[]};if(!n.openBrowser)return{stdout:[`OpenPond web UI: ${n.baseUrl}`],stderr:[]};let r=await e(t);return r.opened?{stdout:[`Opened OpenPond in your browser: ${n.baseUrl}`],stderr:[]}:{stdout:[`OpenPond access URL: ${t}`],stderr:[`Could not open the system browser: ${r.error}`]}}a(Ye,"resolveWebLaunchMessages");function Ze(){console.log(`Usage:
24
- openpond-app-server serve [--hostname HOST] [--port PORT]
25
- openpond-app-server app-server [--home DIR]
26
- openpond-app-server web [--hostname HOST] [--port PORT] [--web-root DIR]
27
-
28
- Options:
29
- --listen HOST:PORT Set host and port together
30
- --hostname HOST Bind host (default ${X})
31
- --port PORT Bind port, or 0 for any free port (default ${17874})
32
- --web-root DIR Directory containing the built web UI for web mode
33
- --home DIR Local app-server state directory
34
- --runtime-storage hosted-postgres Host-admitted Postgres app-server mode
35
- --hosted-profile-release BASE64URL Host-admitted immutable Profile release descriptor
36
- --profile-source-root DIR Authorized Profile repository source for app-server
37
- --profile-repository-id ID Source repository identity supplied by the host
38
- --profile-id ID Profile within that source
39
- --profile-revision REV Accepted immutable source revision
40
- --open-browser Open the authenticated web URL in the system browser
41
- --print-access-url Print the authenticated URL instead of opening it
42
- `)}a(Ze,"printHelp");async function un(n){let e=Xe(process.argv.slice(2));if(e.help){Ze();return}let t=e.mode==="web"?_t(e.webRoot):null;if(e.mode==="web"&&!t)throw new Error("Could not find a built OpenPond web UI. Run `pnpm build:web` or pass --web-root.");if(e.mode==="app-server"){await Qe(n.createOpenPondAppServer,e.storeDir,e.profileSource,e.runtimeStorage,e.admittedProfileRelease,e.hostedCacheHome,e.experimentOwner);return}e.storeDir&&(process.env.OPENPOND_HOME=e.storeDir);let r,s=e.port;for(;;)try{r=await n.createOpenPondServer({host:e.host,port:s,webRoot:t,sourceBrowserState:e.sourceBrowserState,...e.storeDir?{storeDir:e.storeDir}:{},httpEnabled:!0});break}catch(c){if(!Fe(c))throw c;let p=await je(oe({home:e.storeDir??void 0}),s,c);s=p.port,console.log(`OPENPOND_APP_SERVER_READY ${JSON.stringify({mode:"recovery",url:p.url,tokenFile:p.tokenFile,storePath:p.storePath})}`),console.error(`${c.issue.code}: ${c.issue.message} ${c.issue.action}`);let h=await Ye({baseUrl:p.url,openBrowser:e.openBrowser,printAccessUrl:e.printAccessUrl,token:p.token});for(let P of h.stdout)console.log(P);for(let P of h.stderr)console.error(P);let S=a(()=>{p.close().finally(()=>process.exit(0))},"close");process.once("SIGINT",S),process.once("SIGTERM",S);try{await p.repaired}finally{process.off("SIGINT",S),process.off("SIGTERM",S),await p.close()}}let i=e.mode==="web"?Mt(r):null;if(console.log(`OPENPOND_APP_SERVER_READY ${JSON.stringify({mode:e.mode,url:r.url,webUrl:null,webRoot:t,tokenFile:r.tokenFile,storePath:r.storePath,runtime:Ce()})}`),i){let c=await Ye({baseUrl:i,openBrowser:e.openBrowser,printAccessUrl:e.printAccessUrl,token:r.token});for(let p of c.stderr)console.error(p);for(let p of c.stdout)console.log(p)}else console.log(`OpenPond API server: ${r.url}`);let u=!1,l=a(async()=>{u||(u=!0,await r.close(),process.exit(0))},"shutdown");process.on("SIGINT",()=>{l()}),process.on("SIGTERM",()=>{l()}),await new Promise(()=>{})}a(un,"runOpenPondServerCli");async function ln(n){let e=process.argv.slice(2),t=Xe(!e[0]||e[0].startsWith("-")?["app-server",...e]:e);if(t.help){Ze();return}if(t.mode!=="app-server")throw new Error("The app-server entrypoint only accepts the app-server command.");await Qe(n,t.storeDir,t.profileSource,t.runtimeStorage,t.admittedProfileRelease,t.hostedCacheHome,t.experimentOwner)}a(ln,"runOpenPondAppServerCli");async function Qe(n,e,t,r="sqlite_bundle",s,i,u=!1){let l=new Ie;if(r==="hosted_postgres"){if(e||t)throw new Error("Hosted Postgres app-server cannot use local storage sources.");await Z({appServer:a(()=>n({...i?{storeDir:i}:{},hostStorageClient:l,runtimeStorage:{kind:"hosted_postgres",client:l,core:We(l),inbox:new M(l),...s?{admittedProfileRelease:s}:{}},streamOpenPondHostedChatTurn:Ge()}),"appServer"),readable:process.stdin,writable:process.stdout,hostStorageClient:l});return}e&&(process.env.OPENPOND_HOME=e);let c=await n({...e?{storeDir:e}:{},...t?{profileSource:t}:{},...u?{experimentPolicyClient:l,services:{webSearch:!1,scheduling:!1,connectedApps:!1,tasksets:!1,projectActions:!1,profileActions:!1,backgroundReview:!1}}:{},hostStorageClient:l});await Z({appServer:c,readable:process.stdin,writable:process.stdout,hostStorageClient:l})}a(Qe,"runAgentServer");export{He as a,D as b,Ne as c,I as d,jt as e,Lt as f,Q as g,qe as h,Ye as i,un as j,ln as k};
@@ -1,3 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{f as S}from"./chunk-3M53YXEI.js";import{a as o}from"./chunk-FTQLQJQV.js";import{readFileSync as j}from"node:fs";import k from"node:path";function x(){let t=["../../../package.json","../../package.json","../package.json","./package.json","../../../../package.json"];for(let n of t)try{let s=new URL(n,import.meta.url),i=j(s,"utf-8"),r=JSON.parse(i);if(typeof r.version=="string")return r.version}catch{}try{let n=j(k.join(k.dirname(process.execPath),"package.json"),"utf-8"),s=JSON.parse(n);if(typeof s.version=="string")return s.version}catch{}return"unknown"}o(x,"getInstalledCliVersion");function I(t){let n=/^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(t.trim());if(!n)return null;let s=Number.parseInt(n[1],10),i=Number.parseInt(n[2],10),r=Number.parseInt(n[3],10);return!Number.isFinite(s)||!Number.isFinite(i)||!Number.isFinite(r)?null:[s,i,r]}o(I,"parseSemver");function X(t,n){let s=I(t),i=I(n);if(!s||!i)return null;for(let r=0;r<3;r+=1){if(s[r]<i[r])return-1;if(s[r]>i[r])return 1}return 0}o(X,"compareSemver");async function Y(t){let n=new AbortController,s=setTimeout(()=>n.abort(),7e3);try{let i=await fetch(`https://registry.npmjs.org/${encodeURIComponent(t)}/latest`,{signal:n.signal});if(!i.ok){let d=await i.text().catch(()=>"");throw new Error(`npm registry request failed: ${i.status} ${d}`.trim())}let r=await i.json().catch(()=>({}));if(typeof r.version!="string"||r.version.trim().length===0)throw new Error("npm registry payload missing version");return r.version.trim()}finally{clearTimeout(s)}}o(Y,"fetchLatestNpmVersion");var a="boolean",m="integer",l="json",g="number",e="string",P={agent:e,approvalPolicy:e,cwd:e,json:a,maxOutputBytes:m,message:e,messageFile:e,model:e,noServerStart:a,nonInteractive:a,project:e,provider:e,resume:e,sandbox:e,server:e,stdin:a,timeoutSec:m,yes:a},O={access:e,agentId:e,all:a,artifactPaths:e,async:a,authHeader:e,authHeaderValue:e,authToken:e,autoStart:a,baseRef:e,branch:e,budget:g,budgetUsd:g,cleanup:a,cols:m,command:e,content:e,contentBase64:e,contents:e,contentsBase64:e,cpu:g,create:a,description:e,diskGb:g,dockerBuildArgs:l,dockerRegistrySecretRefs:e,dockerfile:e,dockerfileContext:e,dockerfileTarget:e,domain:e,env:e,environment:e,envLiteral:e,envName:e,envRef:e,expectedMppMode:e,expectedVersion:m,failOnUnpreservedChanges:a,ffOnly:a,forceWithLease:a,fork:a,fromPath:e,idempotencyKey:e,idleTimeoutSeconds:m,image:e,imageDigest:e,input:e,inputBase64:e,integrationCapabilities:e,integrationConnection:e,integrationScopes:e,intervalMs:m,json:a,keep:a,label:e,leaseId:e,lifecycleHint:l,manifestPath:e,maxDurationSeconds:m,maxEntries:g,maxResults:g,memoryGb:g,message:e,name:e,noPreview:a,overwrite:a,params:l,path:e,paths:e,payload:l,port:m,preview:a,projectId:e,publish:a,q:e,query:e,rebase:a,recursive:a,registrySecretRef:e,remote:e,replayState:e,repo:e,respondAsync:a,rows:m,runtimeAgentId:e,runtimeBaseBranch:e,runtimeBaseSha:e,runtimeId:e,runtimeProfileId:e,runtimeProjectId:e,runtimePromotionPolicy:e,runtimeWorkspaceRoot:e,sandboxId:e,scope:e,since:m,snapshot:a,snapshotId:e,sourceProjectId:e,sourceRepoUrl:e,sourceSandboxId:e,startPoint:e,status:e,stdin:a,summary:a,tag:e,tags:e,targetId:e,targetType:e,teamId:e,templateName:e,templateVersion:e,templateVisibility:e,timeoutSeconds:m,toPath:e,type:e,useCase:e,validationCommand:e,value:e,version:e,volumeDeleteOnSandboxDelete:a,volumeMountPath:e,volumeName:e,volumeStorageGb:g,workflowMode:e},A={action:e,agentId:e,budget:g,budgetUsd:g,build:e,branch:e,commit:a,commitMessage:e,description:e,dir:e,disableSchedule:e,disableSchedules:e,enableSchedule:e,enableSchedules:e,entrypoint:e,env:l,envRef:e,file:e,force:a,idleTimeoutSeconds:m,inherit:a,input:l,inputFile:e,inputFiles:e,inputJson:l,inputs:l,json:a,keepTokenRemote:a,manifest:e,maxDurationSeconds:m,name:e,noPush:a,noWrite:a,out:e,outDir:e,output:e,outputDir:e,params:l,path:e,plan:e,projectId:e,repo:e,runtimeAgentId:e,runtimeBaseBranch:e,runtimeBaseSha:e,runtimeId:e,runtimeProjectId:e,runtimePromotionPolicy:e,scheduleMode:e,scheduleOverride:l,scheduleOverrides:l,schedules:e,service:e,setRemoteToken:a,setupTimeoutSeconds:m,target:e,teamId:e,timeoutSeconds:m,token:e,workflowMode:e,yes:a},T={branch:e,commitMessage:e,defaultBranch:e,description:e,gitOwner:e,gitRepo:e,internalRepoPath:e,json:a,name:e,path:e,projectId:e,repo:e,sourceCheckDispatch:e,sourceType:e,teamId:e,templateRepoUrl:e},E={agentId:e,agentEdit:l,allowLatestSource:a,allowedActions:e,attachmentsJson:l,baseSha:e,chatMode:e,checkKind:e,conversationId:e,cwd:e,dispatch:e,entrypointName:e,entrypointScope:e,expectedManifestHash:e,evalStatus:e,expectedSourceCommitSha:e,idempotencyKey:e,input:l,inputFile:e,json:a,limit:m,message:e,metadata:l,name:e,path:e,payload:l,projectId:e,prompt:e,provider:e,publishedSnapshotId:e,ref:e,requirePublishedSnapshot:a,requiredEnv:e,requiredIntegrations:e,runtimePromotionPolicy:e,runtimeSourceMode:e,sourceCheckDispatch:e,sourceMode:e,sourceRef:e,status:e,targetProjectId:e,teamId:e,triggerType:e,workflowMode:e};var b={account:"string",apiBaseUrl:"string",apiBaseurl:"string",baseUrl:"string",baseurl:"string",chatApiBaseUrl:"string",chatApiBaseurl:"string",checkUpdate:"boolean",cwd:"string",help:"boolean",home:"string",json:"boolean",profile:"string",sandboxApiUrl:"string",sandboxApiurl:"string",tui:"boolean",version:"boolean"},ae={C:"cwd",f:"force",h:"help",j:"json",v:"version",y:"yes"},B={cwd:"string",input:"json",inputFile:"string",json:"boolean",path:"string"},C=[{name:"datasets",usage:"openpond datasets <upload|read|list|validate|publish> [folder|id] --team <id> --api-base-url <origin> [--operation-id <id>] [--expected-revision <n>] [--publish] [--project <id>] [--dataset-id <id>]",optionSchema:{team:"string",operationId:"string",expectedRevision:"integer",publish:"boolean",project:"string",datasetId:"string",cursor:"string",workspaceHash:"string",packageHash:"string",json:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./datasets-UYIZCMNZ.js")).runDatasetsCommand(t,n),"handler")},{name:"experiments",usage:"openpond experiments <prepare-harness|save|read|list|executions|start|status|cancel|retry|score|passes|pass|cancel-pass|pass-result|result|compare> [id] [candidate-id] --team <id> [--input-file <path>] [--operation-id <id>] [--json]",optionSchema:{team:"string",inputFile:"string",operationId:"string",project:"string",datasetHash:"string",search:"string",afterId:"string",limit:"integer",json:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./experiments-Q6TAHJV3.js")).runExperimentsCommand(t,n),"handler")},{name:"home",usage:"openpond home [--home <directory>]",optionSchema:{},handler:o(async()=>console.log((await import("./dist-ELWB75PL.js")).resolveOpenPondHome()),"handler")},{name:"config",usage:"openpond config <get|set|unset|path|validate|schema|doctor|migrate|recover|restart-migration|revisions|replace|effective|trust|untrust|export|backup|restore|collect-orphans|clear-cache> [key] [value] [--home <directory>] [--json]",optionSchema:{keyPath:"json",value:"string",file:"string",project:"boolean",revision:"string",expectedRevision:"string",sourceAppHome:"string",sourceConfig:"string",sourceBrowserState:"string",dryRun:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./configuration-command-N2FD7DWB.js")).runConfigurationCommand(t,n),"handler")},{name:"help",usage:"openpond help",optionSchema:{},handler:o(async()=>(await import("./help-MD7Z72QS.js")).printHelp(),"handler")},{name:"version",usage:"openpond version",optionSchema:{},handler:o(()=>console.log(x()),"handler")},{name:"check-update",usage:"openpond check-update",optionSchema:{},handler:o(async()=>(await import("./core-commands-D2MJ7QFZ.js")).runCheckUpdate(),"handler")},{name:"login",usage:"openpond login [--base-url <url>]",optionSchema:b,handler:o(async({options:t})=>(await import("./core-commands-D2MJ7QFZ.js")).runLogin(t),"handler")},{name:"init",usage:"openpond init [--path <dir>] [--profile <name>] [--template <name>] [--force] [--json]",optionSchema:{...b,force:"boolean",path:"string",template:"string"},handler:o(async({options:t})=>(await import("./profile-BZDCYKGL.js")).runOpenPondInitCommand(t),"handler")},{name:"profile",usage:"openpond profile <current|init|load|check|push|commit|diff|catalog>",optionSchema:{checkKind:"string",conversationId:"string",ensureHosted:"boolean",expectedManifestHash:"string",force:"boolean",hostedCheckKind:"string",hostedRunAgentId:"string",hostedRunConversationId:"string",hostedRunIdempotencyKey:"string",hostedRunInput:"json",hostedRunRetry:"boolean",hostedRunTargetProjectId:"string",hostedSourceDispatch:"string",hostedSourceAgentId:"string",hostedSourceChecks:"boolean",hostedSourceProjectId:"string",json:"boolean",kind:"string",path:"string",publishHostedSource:"boolean",teamId:"string"},handler:o(async({options:t,rest:n})=>(await import("./profile-BZDCYKGL.js")).runOpenPondProfileCommand(t,n),"handler")},{name:"agents",usage:"openpond agents [--json]",optionSchema:{json:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./profile-BZDCYKGL.js")).runOpenPondAgentsCommand(t,n),"handler")},{name:"actions",usage:"openpond actions <check|build|run|dev|publish> [action-id] [--cwd DIR] [--input JSON|--input-file PATH]",optionSchema:{apiKey:"string",baseUrl:"string",cwd:"string",input:"string",inputFile:"string",json:"boolean",outputDirectory:"string",sourceDirectory:"string",sourceCommitSha:"string",sourceRef:"string",projectId:"string",teamId:"string",timeoutMs:"integer"},handler:o(async({options:t,rest:n})=>(await import("./actions-command-6EMO4BIK.js")).runProjectActionsCommand(t,n),"handler")},...K(),{name:"extension",usage:"openpond extension <add|preview|list|inspect|update|remove> [owner/repo]",usages:["openpond extension add <owner/repo> [--ref <branch|tag|sha>] [--json]","openpond extension update <owner/repo> [--ref <branch|tag|sha>] [--json]","openpond extension update --all [--json]","openpond extension remove <owner/repo> [--json]"],optionSchema:{all:"boolean",json:"boolean",ref:"string"},handler:o(async({options:t,rest:n})=>(await import("./extension-7GYFAHRP.js")).runOpenPondExtensionCommand(t,n),"handler")},{name:"profiles",usage:"openpond profiles [args]",optionSchema:{json:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./core-commands-D2MJ7QFZ.js")).runProfiles(t,n),"handler")},{name:"account",usage:"openpond account",optionSchema:{json:"boolean"},handler:o(async()=>(await import("./core-commands-D2MJ7QFZ.js")).runAccount(),"handler")},{name:"health",usage:"openpond health",optionSchema:{json:"boolean"},handler:o(async({options:t})=>(await import("./core-commands-D2MJ7QFZ.js")).runHealth(t),"handler")},{name:"app-server",usage:"openpond app-server [--home DIR]",optionSchema:{home:"string"},handler:o(async({options:t,rest:n})=>(await import("./app-layer-ETI5QXQ3.js")).runOpenPondServerCommand("app-server",t,n),"handler")},{name:"serve",usage:"openpond serve [args]",optionSchema:{host:"string",hostname:"string",listen:"string",port:"integer"},handler:o(async({options:t,rest:n})=>(await import("./app-layer-ETI5QXQ3.js")).runOpenPondServerCommand("serve",t,n),"handler")},{name:"ui",usage:"openpond ui [--no-open] [--hostname HOST] [--port PORT]",optionSchema:{host:"string",hostname:"string",listen:"string",noOpen:"boolean",port:"integer",webRoot:"string"},handler:o(async({options:t,rest:n})=>(await import("./app-layer-ETI5QXQ3.js")).runOpenPondServerCommand("web",t,n),"handler")},{name:"tui",aliases:["interactive"],usage:"openpond tui [--provider <id>] [--model <id>] [--project <id>]",optionSchema:{cwd:"string",model:"string",noServerStart:"boolean",project:"string",provider:"string",server:"string"},handler:o(async({options:t,rest:n})=>(await import("./app-layer-ETI5QXQ3.js")).runOpenPondTerminalCommand(t,n),"handler")},{name:"chat",usage:"openpond chat (--message-file <path>|--message <text>|--stdin) --non-interactive [--provider <id>] [--model <id>] [--agent <id>] [--project <id>] [--resume <session-id>] [--yes] [--approval-policy <policy>] [--json] [--timeout-sec <n>] [--max-output-bytes <n>] [--sandbox <mode>]",optionSchema:P,handler:o(async({options:t,rest:n})=>(await import("./app-layer-ETI5QXQ3.js")).runOpenPondTerminalCommand(t,n),"handler")},{name:"tool",usage:"openpond tool <list|run> <handle>/<repo> [args]",optionSchema:{body:"json",json:"boolean"},handler:F},{name:"backtest",usage:"openpond backtest <run|events|get> <handle>/<repo> [args]",optionSchema:{body:"json",branch:"string",deploymentId:"string",limit:"integer",runId:"string"},handler:$},{name:"deploy",usage:"openpond deploy watch <handle>/<repo> [--branch <branch>]",optionSchema:{branch:"string"},handler:G},{name:"template",usage:"openpond template <status|branches|update> <handle>/<repo> [--env preview|production]",optionSchema:{env:"string"},handler:J},{name:"sandbox-template",usage:"openpond sandbox-template <command> [args]",optionSchema:A,handler:o(async({options:t,rest:n})=>(await import("./sandbox-template-ZYXK4QCI.js")).runSandboxTemplateCommand(t,n),"handler")},{name:"repo",usage:"openpond repo <create|push> [--name <name>] [--path <dir>] [--branch <branch>]",optionSchema:{branch:"string",name:"string",path:"string"},handler:V},{name:"organizations",aliases:["organization"],usage:"openpond organizations <login|list|use|logout|whoami> [args]",optionSchema:{accessToken:"string",arguments:"json",callbackPort:"integer",clientId:"string",customDomain:"string",displayName:"string",email:"string",env:"string",environment:"string",json:"boolean",name:"string",open:"boolean",origin:"string",primaryContactEmail:"string",printToken:"boolean",resourceUrl:"string",role:"string",scope:"string",scopes:"string",slug:"string",status:"string",timeout:"integer",timeoutSeconds:"integer",tool:"string",toolName:"string",toolset:"string",url:"string"},handler:o(async({options:t,rest:n})=>(await import("./organizations-BPBJV7LZ.js")).runOrganizationsCommand(t,n),"handler")},{name:"project",usage:"openpond project <list|create|upsert|get|update|sync|source-upload|archive> [args]",optionSchema:T,handler:o(async({options:t,rest:n})=>(await import("./project-agent-U6YNYPHS.js")).runProjectCommand(t,n),"handler")},{name:"agent",usage:"openpond agent <inspect|build|validate|eval|traces|list|create|upsert|get|update|run|run-test|bind-source|source|archive> [args]",usages:["openpond agent run <action> [--cwd <project>] [--input <json>]","openpond agent run <agentId> --team-id <id> [--conversation-id <id>] [--target-project-id <projectId>] [--input <json>]","openpond agent source checks <agentId> --team-id <id> [--check-kind <kind>]","openpond agent source publish <agentId> --team-id <id> [--expected-manifest-hash <hash>]"],optionSchema:E,handler:o(async({options:t,rest:n})=>(await import("./project-agent-U6YNYPHS.js")).runAgentCommand(t,n),"handler")},{name:"desktop-test",usage:"openpond desktop-test <run|attach> <scenario...> [--isolated|--attach|--packaged|--none] [--app <path>] [--artifacts-dir <path>] [--json <path>]",optionSchema:{artifactsDir:"string",attach:"boolean",cwd:"string",devtoolsPort:"integer",grep:"string",isolated:"boolean",json:"string",jsonPath:"string",keepHome:"boolean",none:"boolean",server:"string",timeoutMs:"integer",token:"string",tokenFile:"string"},handler:o(async({options:t,rest:n})=>(await import("./desktop-test-IWDHFDSZ.js")).runDesktopTestCommand(t,n),"handler")},{name:"sandbox",usage:"openpond sandbox <command> [args]",optionSchema:O,handler:o(async({options:t,rest:n})=>(await import("./sandbox-command-TTLFWUXV.js")).runSandboxCommand(t,n),"handler")},{name:"continual",usage:"openpond continual <init|validate|run|report> [manifest-or-series-id]",usages:["openpond continual init --from <tasks.jsonl> [--output <continual-support.yaml>] [--non-interactive]","openpond continual validate <continual-support.yaml> [--json]","openpond continual run <continual-support.yaml> [--api-base-url <url>] [--json]","openpond continual report <comparison-series-id> [--output <report.json>] [--json]"],optionSchema:{apiBaseUrl:"string",commit:"string",correctionCasesPerFamily:"integer",correctionSelection:"string",description:"string",from:"string",grader:"string",id:"string",json:"boolean",license:"string",name:"string",nonInteractive:"boolean",output:"string",repository:"string",seed:"string",semanticSimilarityThreshold:"number"},handler:o(async({options:t,rest:n})=>(await import("./continual-MHMPLLUZ.js")).runContinualCommand(t,n),"handler")},{name:"training",usage:"openpond training <create-project|start|status|watch|logs|cancel|resume|artifacts|benchmark> <taskset-id|model-run-id|run-id|model-id>",usages:["openpond training create-project <taskset-id> --recipe <path> [--project-id <id>] [--profile <id>] [--name <name>] [--objective <text>] [--destination <id>] [--rollout-placement <local|remote>] [--gpu-placement-objective <fast|balanced|economical>] [--run-preset <preset>] [--max-spend <usd>] [--retention-days <days>] [--json]","openpond training start <model-project-id> [--comparison-series-entry <entry-id>] [--manifest <path>] [--yes] [--export-approved] [--max-spend <usd>] [--retention-days <days>] [--detach] [--json]","openpond training status <run-id> [--json]","openpond training watch <run-id> [--interval-ms <ms>] [--json]","openpond training logs <run-id> [--json]","openpond training cancel <run-id> [--json]","openpond training resume <model-run-id> [--json]","openpond training artifacts <run-id> [--json]","openpond training benchmark <model-id> [--provider <id>] [--model <id>] [--reasoning-effort <level>] [--max-spend <usd>] [--json]"],optionSchema:{apiBaseUrl:"string",comparisonSeriesEntry:"string",detach:"boolean",destination:"string",exportApproved:"boolean",gpuPlacementObjective:"string",intervalMs:"integer",json:"boolean",manifest:"string",maxSpend:"number",model:"string",name:"string",objective:"string",profile:"string",projectId:"string",provider:"string",recipe:"string",reasoningEffort:"string",retentionDays:"integer",rolloutPlacement:"string",runPreset:"string",yes:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./training-7PST5HZU.js")).runTrainingCommand(t,n),"handler")},{name:"taskset",usage:"openpond taskset <import|publish|readiness|delete-draft> <package-path|draft-id|taskset-id> [--profile <id>] [--model <id>] [--json]",usages:["openpond taskset import <package-directory|taskset.json> [--profile <id>] [--json]","openpond taskset publish <draft-id> [--model <id>] [--json]","openpond taskset readiness <taskset-id> [--json]","openpond taskset delete-draft <draft-id> [--json]"],optionSchema:{apiBaseUrl:"string",json:"boolean",model:"string",profile:"string"},handler:o(async({options:t,rest:n})=>(await import("./taskset-BZYQT65N.js")).runTasksetCommand(t,n),"handler")},{name:"opchat",usage:"openpond opchat <command> [args]",optionSchema:{compatModel:"string",compatibilityModel:"string",env:"string",environment:"string",effort:"string",json:"boolean",message:"string",model:"string",opchatApiBaseUrl:"string",opchatApiUrl:"string",prompt:"string",skipStream:"boolean",skipTool:"boolean",stream:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./opchat-URWW53CK.js")).runOpChatCommand(t,n),"handler")},{name:"teams-bot",usage:"openpond teams-bot <command> [args]",optionSchema:{json:"boolean",teamId:"string"},handler:o(async({options:t,rest:n})=>(await import("./teams-bot-WXGP3PA6.js")).runTeamsBotCommand(t,n),"handler")},{name:"apps",usage:"openpond apps <list|code-visibility|tools|deploy|env get|env set|performance|summary|assistant|agent create> [args]",optionSchema:{appId:"string",body:"json",env:"json",json:"boolean",limit:"integer",refresh:"boolean",teamId:"string",watch:"boolean"},handler:q},{name:"opentool",usage:"openpond opentool <init|validate|build> [args]",optionSchema:{},handler:o(async({rest:t})=>(await import("./core-commands-D2MJ7QFZ.js")).runOpentool(t),"handler")}],y=new Map;for(let t of C){y.set(t.name,t);for(let n of t.aliases??[])y.set(n,t)}function re(){return C}o(re,"listCliCommandDefinitions");function w(t){return y.get(t)??null}o(w,"getCliCommandDefinition");function ie(t,n){return w(t||"ui")?.optionSchema[n]??b[n]}o(ie,"getCliOptionKind");function se(t){let n=b[t];if(n)return n;for(let s of C){let i=s.optionSchema[t];if(i)return i}}o(se,"getAnyCliOptionKind");async function pe(t){let n=w(t.command);return n?S(t.options.help)?(L(n),!0):(await n.handler(t),!0):!1}o(pe,"runCliCommand");function H(t){let n=["Usage:",` ${t.usage}`,...(t.usages??[]).map(i=>` ${i}`)];t.aliases?.length&&n.push("","Aliases:",` ${t.aliases.join(", ")}`);let s=Object.entries(t.optionSchema).sort(([i],[r])=>i.localeCompare(r));if(s.length>0){n.push("","Options:");for(let[i,r]of s){let d=U(i);n.push(r==="boolean"?` --${d}`:` --${d} <${r}>`)}}return n.join(`
3
- `)}o(H,"formatCliCommandUsage");function L(t){console.log(H(t))}o(L,"printCliCommandUsage");function U(t){return t.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}o(U,"cliOptionName");function K(){return["inspect","build","validate","eval","run"].map(n=>({name:n,usage:`openpond ${n} [args]`,optionSchema:B,handler:o(async({options:s,rest:i})=>(await import("./profile-BZDCYKGL.js")).runOpenPondProfileSdkAlias(n,s,i),"handler")}))}o(K,"profileSdkAliasDefinitions");async function F({options:t,rest:n}){let{runToolList:s,runToolRun:i}=await import("./core-commands-D2MJ7QFZ.js"),r=n[0];if(r==="list"){let d=n[1];if(!d)throw new Error("usage: tool list <handle>/<repo>");await s(t,d);return}if(r==="run"){let d=n[1],c=n[2];if(!d||!c)throw new Error("usage: tool run <handle>/<repo> <tool> [--body <json>]");await i(t,d,c);return}throw new Error("usage: tool <list|run> <handle>/<repo> [args]")}o(F,"runToolCommand");async function $({options:t,rest:n}){let{runBacktestRun:s}=await import("./core-commands-D2MJ7QFZ.js"),{runBacktestEvents:i,runBacktestGet:r}=await import("./apps-LH5AJCUI.js"),d=n[0]||"run";if(d==="run"){let c=n[1],f=n[2];if(!c||!f)throw new Error("usage: backtest run <handle>/<repo> <tool> [--body <json>] [--branch <branch>] [--deployment-id <id>]");await s(t,c,f);return}if(d==="events"){let c=n[1];if(!c)throw new Error("usage: backtest events <handle>/<repo> [--run-id <id>] [--limit <n>]");await i(t,c);return}if(d==="get"){let c=n[1];if(!c)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");await r(t,c);return}throw new Error("usage: backtest <run|events|get> <handle>/<repo> [args]")}o($,"runBacktestCommand");async function G({options:t,rest:n}){let{runDeployWatch:s}=await import("./core-commands-D2MJ7QFZ.js");if((n[0]||"watch")!=="watch")throw new Error("usage: deploy watch <handle>/<repo> [--branch <branch>]");let r=n[1];if(!r)throw new Error("usage: deploy watch <handle>/<repo> [--branch <branch>]");await s(t,r)}o(G,"runDeployCommand");async function J({options:t,rest:n}){let{runTemplateBranches:s,runTemplateStatus:i,runTemplateUpdate:r}=await import("./core-commands-D2MJ7QFZ.js"),d=n[0]||"status",c=n[1];if(!c)throw new Error("usage: template <status|branches|update> <handle>/<repo> [--env preview|production]");if(d==="status"){await i(t,c);return}if(d==="branches"){await s(t,c);return}if(d==="update"){await r(t,c);return}throw new Error("usage: template <status|branches|update> <handle>/<repo> [--env preview|production]")}o(J,"runTemplateCommand");async function V({options:t,rest:n}){let{runRepoCreate:s,runRepoPush:i}=await import("./core-commands-D2MJ7QFZ.js"),r=n[0]||"create";if(r==="create"){await s(t,n.slice(1));return}if(r==="push"){await i(t);return}throw new Error("usage: repo <create|push> [--name <name>] [--path <dir>] [--branch <branch>]")}o(V,"runRepoCommand");async function q({options:t,rest:n}){let{runAppsAgentCreate:s,runAppsAssistant:i,runAppsCodeVisibility:r,runAppsDeploy:d,runAppsEnvGet:c,runAppsEnvSet:f,runAppsList:R,runAppsPerformance:N,runAppsSummary:M,runAppsTools:_,runAppsToolsExecute:D}=await import("./apps-LH5AJCUI.js"),u=n[0];if(u==="list"){await R(t);return}if(u==="code-visibility"){let p=n[1];if(!p)throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");await r(t,p);return}if(u==="tools"){if(n[1]==="execute"){let p=n[2],h=n[3],v=n[4];if(!p||!h||!v)throw new Error("usage: apps tools execute <appId> <deploymentId> <tool> [--body <json>]");await D(t,p,h,v);return}await _();return}if(u==="deploy"){let p=n[1];if(!p)throw new Error("usage: apps deploy <handle>/<repo> [--env preview|production] [--watch]");await d(t,p);return}if(u==="env"&&n[1]==="get"){let p=n[2];if(!p)throw new Error("usage: apps env get <handle>/<repo>");await c(t,p);return}if(u==="env"&&n[1]==="set"){let p=n[2];if(!p)throw new Error("usage: apps env set <handle>/<repo> --env <json>");await f(t,p);return}if(u==="performance"){await N(t);return}if(u==="summary"){let p=n[1];if(!p)throw new Error("usage: apps summary <handle>/<repo>");await M(t,p);return}if(u==="assistant"){let p=n[1],h=n[2];if(p!=="plan"&&p!=="performance"||!h)throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");await i(t,p,h,n.slice(3));return}if(u==="agent"&&n[1]==="create"){await s(t,n.slice(2));return}throw new Error("usage: apps <list|code-visibility|tools|deploy|env get|env set|performance|summary|assistant|agent create> [args]")}o(q,"runAppsCommand");export{x as a,X as b,Y as c,b as d,ae as e,re as f,w as g,ie as h,se as i,pe as j,H as k};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{g as P}from"./chunk-SUAT5DR4.js";import{Q as O,Z as W,_ as $,ca as D}from"./chunk-2VTXKZNK.js";import{da as y}from"./chunk-VI3ZF54E.js";import{Cc as L,Pb as q,Ya as w}from"./chunk-TPMXLA5Y.js";import{Ya as M,Za as A,ab as V,bb as _,cb as B}from"./chunk-TPOW52DO.js";import{Aa as j}from"./chunk-QUNRWDVO.js";import{a as k,b as R,c as x,k as I,l as g,n as b,q as C}from"./chunk-HZP5U2AA.js";import{b as p}from"./chunk-ES2ISFJC.js";import{a as f}from"./chunk-FTQLQJQV.js";import{promises as N}from"node:fs";import F from"node:path";async function se(e){let s=await P(e.store,e.harnessRelease);if(!s)throw new Error("Profile evaluation Harness release is unavailable.");return J({...e,runtime:s})}f(se,"profileEvaluationsForRelease");async function J(e){let s=e.runtime,a=s.release.harnessRelease;if(a.id!==e.harnessRelease.id||a.contentHash!==e.harnessRelease.contentHash)throw new Error("Profile evaluation runtime differs from its requested release.");let o=a.metadata.profile;if(!o||typeof o!="object"||o.id!==e.ref.profileId||o.sourceRevision!==e.sourceRevision)throw new Error("Profile evaluation release differs from its accepted source.");let t={profileRef:e.ref,sourceRevision:e.sourceRevision,harnessRelease:e.harnessRelease};if(!a.files.some(u=>u.path==="evals/catalog.json"))return{...t,catalogHash:null,definitions:[],suites:[]};let i=F.join(s.release.bundlePath,"source"),n=f(async u=>a.files.some(H=>H.path===u)?N.readFile(F.join(i,...u.split("/"))):void 0,"read"),[c,d,v]=await Promise.all([n("evals/catalog.json"),n("workflows/catalog.json"),n("workflows/actions.json")]),{catalog:m,catalogHash:r}=A({agentSnapshot:s.release.agentSnapshot,harnessRelease:a,catalogBytes:c,workflowBytes:d,actionBytes:v});return{...t,catalogHash:r,definitions:m.definitions,suites:m.suites}}f(J,"profileEvaluationsForRuntime");import{promises as G}from"node:fs";import K from"node:path";async function he(e){let s=e.definition.tasksetRelease,a=await P(e.store,e.harnessRelease);if(!a)throw new Error("Evaluation Profile Harness release is unavailable.");let o=await X({...e,runtime:a});if(o)return o;let t=await e.store.listTasksetRevisions(e.profileId);for(let i of t){if(s.id!==i.id&&s.id!==`taskset-release-${i.id}-r${i.revision}`)continue;let n=await Q(e.storeDir,i);if(n.taskset.id===s.id&&n.taskset.contentHash===s.contentHash)return n}throw new Error(`Released Taskset ${s.id} is unavailable in Profile ${e.profileId}.`)}f(he,"loadLocalProfileEvaluationTaskset");async function Q(e,s){let a=s.metadata.importedPackageHash;if(typeof a=="string"){let i=await $(e,a);if(i.taskset.id!==s.id||i.taskset.revision!==s.revision)throw new Error("Imported evaluation Taskset differs from its local Profile revision.");return i}if(q(s)!==s.contentHash)throw new Error("Authored evaluation Taskset differs from its immutable revision.");let o=L({taskset:s,adapterId:O(s)}),t=await D({storeDir:e,taskset:s,content:{schemaVersion:"openpond.tasksetPackage.v1",taskset:o.tasksetRelease,environment:o.environmentRelease,verifierSet:o.verifierSetRelease}});return await W(e,t),t}f(Q,"loadCandidate");async function X(e){let s=e.definition.tasksetRelease,a=e.runtime;if(a.release.harnessRelease.id!==e.harnessRelease.id||a.release.harnessRelease.contentHash!==e.harnessRelease.contentHash)throw new Error("Evaluation Taskset runtime differs from its requested release.");let o=`evals/tasksets/${s.contentHash}.json`,t=a.release.harnessRelease.files.find(i=>i.path===o);if(t){if(t.visibility!=="verifier")throw new Error("Evaluation Taskset package is not verifier-private.");let i=await G.readFile(K.join(a.release.bundlePath,"source",...o.split("/")));if(I(i)!==t.contentHash)throw new Error("Released evaluation Taskset package bytes differ from their source receipt.");let n=w(JSON.parse(i.toString("utf8")));if(n.taskset.id!==s.id||n.taskset.contentHash!==s.contentHash)throw new Error("Released evaluation Taskset package differs from its definition.");return n}return null}f(X,"loadReleasedProfileEvaluationTaskset");var Y=p.object({id:k,createdAt:x,definitionId:k,modelRef:C,hostModelConfigurationHash:R.optional(),maximumSpendUsd:p.number().positive().max(1e4).optional(),expectedManifestHash:R.optional(),hostExperiment:p.object({definition:p.object({id:k,revision:p.number().int().positive(),contentHash:R}).strict(),configurationHash:R,project:p.object({id:k,revision:p.number().int().positive(),contentHash:R,targetId:k.nullable()}).strict().optional()}).strict().optional()}).strict();function Ee(e){return async(s,a)=>{let o=Y.parse(s);if(a?.requireExpectedManifestHash&&!o.expectedManifestHash)throw new Error("Profile evaluation execution requires the reviewed manifest hash.");let t=await e.selectedWorkflows(),i=await e.loadCatalog({ref:t.profileRef,sourceRevision:t.sourceRevision,harnessRelease:t.harnessRelease}),n={schemaVersion:"openpond.profileEvaluations.v1",definitions:i.definitions,suites:i.suites},c=i.definitions.find(l=>l.id===o.definitionId);if(!c)throw new Error(`Evaluation ${o.definitionId} is absent from the selected Profile release.`);let d=c.target,v=d.kind==="workflow"?t.workflows.find(l=>l.binding.workflowId===d.workflowId)?.binding:j.parse({schemaVersion:"openpond.profileComponentBinding.v1",profileId:t.profileRef.profileId,sourceRevision:t.sourceRevision,harnessRelease:t.harnessRelease,target:d});if(!v)throw new Error(`Evaluation workflow ${d.kind==="workflow"?d.workflowId:""} is absent from the selected Profile release.`);let m=w(await e.loadTasksetPackage(c,t.profileRef.profileId,t.harnessRelease)),r=m.taskset;if(r.id!==c.tasksetRelease.id||r.contentHash!==c.tasksetRelease.contentHash)throw new Error("Evaluation Taskset package differs from its released definition.");let u=r.environment.kind==="text"&&r.tools.length===0,H=r.environment.kind==="work"&&r.environment.entrypoint==="openpond-work-v1"&&r.tools.every(l=>["work_exec","work_save_output"].includes(l.name));if(!u&&!H)throw new Error("Profile evaluation supports text cases or Work cases with the built-in execution and output tools.");if(o.maximumSpendUsd!==void 0&&!u)throw new Error("Bounded hosted Profile evaluation currently qualifies text cases without external compute.");if(r.tasks.some(l=>l.artifactRefs.length>y.maxAttachments||l.artifactRefs.some(h=>h.visibility!=="policy"||h.mediaType!=="application/pdf"||h.sizeBytes>y.maxAttachmentBytes)))throw new Error("Profile evaluation accepts only bounded policy-visible PDF task attachments.");if(r.graders.some(l=>l.kind==="model_judge"||l.kind==="custom_verifier")||r.metrics?.aggregation==="custom")throw new Error("Profile evaluation cannot run this Taskset's model judge, custom verifier, or custom metric in the current app-server runtime.");let T={adapterId:d.kind==="workflow"?"openpond.profile-workflow":"openpond.profile-component",placement:e.placement,runtimeVersion:"app-server-v1",capabilityReceipt:g({adapterId:d.kind==="workflow"?"openpond.profile-workflow":"openpond.profile-component",packageHash:m.contentHash,connectedAppScopes:r.policy.connectedAppScopes})},z=M({catalog:n,definitionId:c.id,profileId:t.profileRef.profileId,sourceRevision:t.sourceRevision,harnessRelease:t.harnessRelease,environmentHash:g({packageHash:m.contentHash,runtimeTarget:T})}),U=b.parse({provider:o.modelRef.providerId,model:o.modelRef.modelId,revision:null,artifactHash:null,tokenizerRevision:null,chatTemplateHash:null}),S=await e.modelConfigurationHash(o.modelRef,o),E=V({schemaVersion:"openpond.tasksetRunManifest.v1",id:o.id,tasksetRelease:c.tasksetRelease,packageHash:m.contentHash,execution:{kind:"harness",harnessRelease:t.harnessRelease},profileEvaluation:z,policy:{kind:"model",model:U,configurationHash:S},gradingRole:"evaluation",metricPolicy:_(r),population:c.taskIds.flatMap(l=>c.seeds.map(h=>({receiptId:`evaluation-${g([o.id,l,h]).slice(0,32)}`,taskId:l,seed:h,fixtureId:null}))),runtimeTarget:T,limits:{maxTurns:128,timeoutMs:r.environment.defaultTimeoutMs,maxOutputBytes:25e7,maximumSpendUsd:o.maximumSpendUsd??null},createdAt:o.createdAt,metadata:{sourceTasksetId:r.metadata.sourceTasksetId??r.id,...t.profileRef.source==="openpond_git"?{profileRepositoryId:t.profileRef.repositoryId}:{},...o.hostExperiment?{experimentDefinition:o.hostExperiment.definition,experimentConfigurationHash:o.hostExperiment.configurationHash,...o.hostExperiment.project?{project:o.hostExperiment.project}:{}}:{}}});if(B(E,r,n),o.expectedManifestHash&&E.contentHash!==o.expectedManifestHash)throw new Error("Profile evaluation setup changed since preview; prepare the run again.");return{manifest:E,taskset:r,profileRef:t.profileRef,binding:v,modelRef:o.modelRef,modelConfigurationHash:S}}}f(Ee,"createProfileEvaluationRunPreparationService");export{se as a,J as b,he as c,X as d,Ee as e};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{Wa as A,v as C}from"./chunk-TPOW52DO.js";import{a as m,b as p,c as R,e as H,h as T,l as h,m as z}from"./chunk-HZP5U2AA.js";import{b as e}from"./chunk-ES2ISFJC.js";import{a as d}from"./chunk-FTQLQJQV.js";var F=e.number().finite().nonnegative(),V=e.discriminatedUnion("kind",[e.object({kind:e.literal("model"),modelId:m,configurationHash:p}).strict(),e.object({kind:e.literal("harness"),source:A,model:e.object({modelId:m,configurationHash:p}).strict()}).strict(),e.object({kind:e.literal("fixture"),configurationHash:p}).strict()]),U=e.object({release:H.extend({revision:e.union([e.number().int().positive(),e.string().trim().min(1).max(200)])}).strict(),feedbackKey:C,configurationHash:p.optional(),output:e.enum(["boolean","score","category"]),categories:e.array(e.string().trim().min(1).max(120)).max(50)}).strict().superRefine((t,n)=>{t.output==="category"!=t.categories.length>0&&n.addIssue({code:"custom",path:["categories"],message:"Only category feedback declares categories."}),new Set(t.categories).size!==t.categories.length&&n.addIssue({code:"custom",path:["categories"],message:"Feedback categories must be unique."})}),M=e.object({caseId:m,seed:e.string().trim().min(1).max(500),fixtureId:m.nullable()}).strict();function K(t){let n=M.parse(t);return JSON.stringify([n.caseId,n.seed,n.fixtureId])}d(K,"experimentCaseKey");var D=e.object({schemaVersion:e.literal("openpond.experimentManifest.v1"),id:m,name:e.string().trim().min(1).max(500),teamId:m,operationId:m,maximumCostUsd:F.nullable(),dataset:H.extend({revision:e.number().int().positive()}).strict(),target:V,execution:e.object({packageHash:p,runtimeTargetHash:p,metricPolicyHash:p}).strict().optional(),lineage:e.object({definition:H.extend({revision:e.number().int().positive()}).strict().nullable(),execution:H,scoringPassId:m.nullable()}).strict().optional(),evaluators:e.array(U).max(100),population:e.array(M).min(1).max(1e4),createdAt:R}).strict().superRefine((t,n)=>{t.lineage&&t.id!==(t.lineage.scoringPassId??t.lineage.execution.id)&&n.addIssue({code:"custom",path:["lineage"],message:"Experiment identity must match its execution or independent scoring pass."}),new Set(t.population.map(K)).size!==t.population.length&&n.addIssue({code:"custom",path:["population"],message:"Experiment cases must be unique."}),new Set(t.evaluators.map(s=>s.feedbackKey)).size!==t.evaluators.length&&n.addIssue({code:"custom",path:["evaluators"],message:"Experiment feedback keys must be unique."})}),q=D.extend({contentHash:p}).strict(),J=e.object({feedbackKey:C,evaluator:U.shape.release,status:e.enum(["scored","unavailable","failed","pending"]),value:e.union([e.boolean(),e.number().finite(),e.string().max(120)]).nullable(),passed:e.boolean().nullable().optional(),reasoning:e.string().max(2e4).nullable(),evidenceRefs:e.array(T).max(1e3)}).strict(),B=e.object({inputTokens:e.number().int().nonnegative().nullable(),outputTokens:e.number().int().nonnegative().nullable(),totalTokens:e.number().int().nonnegative().nullable(),costUsd:F.nullable(),latencyMs:e.number().finite().nonnegative().nullable()}).strict().superRefine((t,n)=>{t.inputTokens!==null&&t.outputTokens!==null&&t.totalTokens!==null&&t.totalTokens<t.inputTokens+t.outputTokens&&n.addIssue({code:"custom",path:["totalTokens"],message:"Total tokens cannot be less than input plus output."})}),G=e.object({identity:M,status:e.enum(["completed","failed","cancelled","unavailable"]),output:e.unknown().nullable(),error:e.object({code:m,message:e.string().max(2e3)}).strict().nullable(),feedback:e.array(J).max(100),usage:B,traceRef:T.nullable(),startedAt:R.nullable(),completedAt:R.nullable()}).strict(),N=e.object({schemaVersion:e.literal("openpond.experimentResult.v1"),manifest:H,status:e.enum(["completed","failed","cancelled"]),cases:e.array(G).min(1).max(1e4),completedAt:R}).strict(),O=N.extend({contentHash:p}).strict();function L(t,n){q.parse(n),z(n,"Experiment manifest");let s=N.parse(t);if(s.manifest.id!==n.id||s.manifest.contentHash!==n.contentHash)throw new Error("Experiment result differs from its manifest.");let v=new Set(n.population.map(K)),l=new Set,w=new Map(n.evaluators.map(g=>[g.feedbackKey,g]));for(let g of s.cases){let S=K(g.identity);if(!v.has(S)||l.has(S))throw new Error("Experiment result has an unexpected or repeated case.");l.add(S);let I=new Set;for(let i of g.feedback){let a=w.get(i.feedbackKey);if(!a||I.has(i.feedbackKey)||i.evaluator.id!==a.release.id||i.evaluator.contentHash!==a.release.contentHash||i.evaluator.revision!==a.release.revision)throw new Error("Experiment feedback differs from its pinned evaluator.");if(I.add(i.feedbackKey),i.status==="scored"){if(i.value===null||typeof i.value!=={boolean:"boolean",score:"number",category:"string"}[a.output]||a.output==="category"&&!a.categories.includes(i.value)||a.output==="score"&&(i.value<0||i.value>1))throw new Error("Experiment feedback value violates its output contract.")}else if(i.value!==null||i.passed!==null&&i.passed!==void 0)throw new Error("Unscored experiment feedback cannot claim a value or pass decision.")}}if(l.size!==v.size)throw new Error("Experiment result omits admitted cases.");return O.parse({...s,contentHash:h(s)})}d(L,"createExperimentResult");function Q(t){let n=q.parse(t.manifest),s=O.parse(t.result),{contentHash:v,...l}=s;if(h(l)!==v)throw new Error("Experiment result integrity failed.");return L(l,n),{manifest:n,result:s}}d(Q,"verifyExperimentEvidence");function $(t,n){for(let a of[t,n])Q(a);let s=[];if(t.manifest.teamId!==n.manifest.teamId&&s.push("different_workspace"),(t.manifest.dataset.id!==n.manifest.dataset.id||t.manifest.dataset.contentHash!==n.manifest.dataset.contentHash||t.manifest.dataset.revision!==n.manifest.dataset.revision)&&s.push("different_dataset_version"),t.manifest.target.kind!==n.manifest.target.kind&&s.push("different_target_kind"),h(t.manifest.execution??null)!==h(n.manifest.execution??null)&&s.push("different_execution_contract"),t.manifest.target.kind==="harness"&&n.manifest.target.kind==="harness"){let a=t.manifest.target.source,r=n.manifest.target.source;(a.profileId!==r.profileId||h(a.target)!==h(r.target))&&s.push("different_component"),a.environmentHash!==r.environmentHash&&s.push("different_environment"),(a.definitionId!==r.definitionId||a.definitionHash!==r.definitionHash)&&s.push("different_evaluation_definition")}let v=d(a=>[...a.evaluators].sort((r,o)=>r.feedbackKey.localeCompare(o.feedbackKey)),"orderedEvaluators");h(v(t.manifest))!==h(v(n.manifest))&&s.push("different_evaluators");let l=new Map(t.result.cases.map(a=>[K(a.identity),a])),w=new Map(n.result.cases.map(a=>[K(a.identity),a])),g=[...new Set([...l.keys(),...w.keys()])].sort();(l.size!==w.size||g.some(a=>!l.has(a)||!w.has(a)))&&s.push("different_population");let S=s.length===0,I=g.map(a=>{let r=l.get(a)??null,o=w.get(a)??null,j=new Map(r?.feedback.map(c=>[c.feedbackKey,c])??[]),_=new Map(o?.feedback.map(c=>[c.feedbackKey,c])??[]);return{identity:(r??o).identity,baseline:r,candidate:o,feedback:t.manifest.evaluators.map(c=>{let y=j.get(c.feedbackKey),x=_.get(c.feedbackKey),f=S?!r||!o?"missing_case":r.status!=="completed"||o.status!=="completed"||r.error||o.error?"case_not_completed":!y||!x||y.status!=="scored"||x.status!=="scored"?"feedback_unavailable":c.output==="category"?"categorical_feedback":null:"incompatible_experiments",u=d(k=>typeof k?.value=="boolean"?Number(k.value):typeof k?.value=="number"?k.value:null,"numeric"),b=f?null:u(y),E=f?null:u(x),P=d(k=>f?null:typeof k?.value=="boolean"?k.value:k?.passed??null,"pass");return{feedbackKey:c.feedbackKey,eligible:f===null,reason:f,baseline:b,candidate:E,delta:b===null||E===null?null:E-b,baselinePassed:P(y),candidatePassed:P(x)}})}}),i=t.manifest.evaluators.map((a,r)=>{let o=I.map(u=>u.feedback[r]).filter(u=>u.eligible),j=d(u=>o.length?o.reduce((b,E)=>b+E[u],0)/o.length:null,"mean"),_=j("baseline"),c=j("candidate"),y=d(u=>o.length&&o.every(b=>b[u]!==null)?o.reduce((b,E)=>b+Number(E[u]),0)/o.length:null,"passRate"),x=y("baselinePassed"),f=y("candidatePassed");return{feedbackKey:a.feedbackKey,eligibleCount:o.length,excludedCount:I.length-o.length,baseline:_,candidate:c,delta:_===null||c===null?null:c-_,baselinePassRate:x,candidatePassRate:f,passRateDelta:x===null||f===null?null:f-x}});return{comparable:S,reasons:s,cases:I,metrics:i}}d($,"compareExperiments");export{Q as a,$ as b};
@@ -1,5 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as e}from"./chunk-ES2ISFJC.js";import{a}from"./chunk-FTQLQJQV.js";import{createHash as he}from"node:crypto";function V(r){if(r===null||typeof r=="boolean"||typeof r=="string")return r;if(typeof r=="number"){if(!Number.isFinite(r))throw new Error("Canonical JSON cannot encode a non-finite number.");return r}if(Array.isArray(r))return r.map(V);if(typeof r=="object"){let t={};for(let i of Object.keys(r).sort()){let n=r[i];n!==void 0&&(t[i]=V(n))}return t}throw new Error(`Canonical JSON cannot encode ${typeof r}.`)}a(V,"canonicalJson");function I(r){return he("sha256").update(JSON.stringify(V(r)),"utf8").digest("hex")}a(I,"canonicalHash");function Oe(r){if(!r.maxContextTokens||!r.usableContextTokens)return{shouldCompact:!1,projectedTokens:r.projectedTokens,thresholdTokens:Number.MAX_SAFE_INTEGER,usableContextTokens:0,maxContextTokens:0,tokenSource:"heuristic"};let t=Math.max(.01,Math.min(1,(r.triggerPercent??85)/100)),i=Math.max(1,Math.floor(r.usableContextTokens*t));return{shouldCompact:r.projectedTokens>=i,projectedTokens:r.projectedTokens,thresholdTokens:i,usableContextTokens:r.usableContextTokens,maxContextTokens:r.maxContextTokens,tokenSource:"heuristic"}}a(Oe,"agentCompactionDecision");async function Ne(r){await r.started();try{return await r.compact()}catch(t){throw await r.failed(t),t}}a(Ne,"runAgentCompaction");async function Be(r){let t=r.host.projectEvents(r.events),i=r.host.selectEvents(t,r.maxContextTokens),{summaryEvents:n,preservedEvents:o,preservedEventIds:l}=i;if(n.length===0)throw new Error("There is not enough prior context to compact.");let u=r.host.normalizeRecords(n),p=r.host.normalizeRecords(o),f=r.host.buildFileLedger(r.host.normalizeRecords(t)),h=r.host.serializeRecords(u,r.host.inputCharBudget(r.maxContextTokens));if(!h.text.trim())throw new Error("There is not enough prior context to compact.");let y=r.host.buildSummaryMessages({serializedHistory:h.text,fileLedger:f}),S=Date.now(),R=(await r.host.streamSummary({model:r.model,messages:y,signal:r.signal})).trim(),z=Date.now()-S;if(!R)throw new Error("Compaction summary was empty.");let m=r.host.estimateProjection({events:t,preservedEvents:o,summary:R}),g=r.host.createMetrics({sourceEvents:t.length,summarizedEvents:n.length,preservedEvents:o.length,sourceRecords:h.sourceRecordCount,includedRecords:h.includedRecordCount,omittedRecords:h.omittedRecordCount,preservedRecords:p.length,truncatedRecords:h.truncatedRecordCount,summaryInputTruncated:h.inputTruncated,sourceSelectionStrategy:h.selectionStrategy,summaryInputChars:h.inputChars,retainedTailTokens:i.retainedTailTokens,retainedTailBudgetTokens:i.retainedTailBudgetTokens,finalProviderContextTokens:m.inputTokensAfter,durationMs:z,fileLedgerEntries:f.length,splitTurnId:i.splitTurnId});return{summary:R,model:r.model,compactedThroughEventId:t[t.length-1]?.id??null,compactedThroughTurnId:r.host.lastTurnId(t),preservedFromEventId:o[0]?.id??null,preservedEventIds:l,preservedResourceRefs:r.host.durableResourceRefs(r.events),sourceEventCount:n.length,preservedEventCount:o.length,fileLedger:f,inputTokensBefore:m.inputTokensBefore,inputTokensAfter:m.inputTokensAfter,maxContextTokens:r.maxContextTokens,tokenSource:"heuristic",metrics:g}}a(Be,"runAgentCompactionProgram");var be=e.enum(["thread.started","thread.resumed","turn.started","turn.steered","turn.interrupted","turn.completed","turn.failed","item.started","item.delta","item.completed","assistant.reasoning.delta","assistant.delta","tool.started","tool.completed","approval.requested","approval.resolved","user_input.requested","user_input.resolved","compaction.started","compaction.completed","harness.admitted","harness.refiner.queued","harness.refiner.started","harness.refiner.completed","harness.refiner.failed","diagnostic"]),fe=e.object({sequence:e.number().int().nonnegative(),name:be,source:e.enum(["runtime","provider","tool","host","refiner"]),status:e.string().trim().min(1).nullable().default(null),threadId:e.string().trim().min(1),turnId:e.string().trim().min(1).nullable().default(null),callId:e.string().trim().min(1).nullable().default(null),output:e.string().nullable().default(null),error:e.string().nullable().default(null),data:e.record(e.string(),e.unknown()).default({})}).strict();function Le(r){return I(fe.parse(r))}a(Le,"canonicalEventHash");var E="2026-09-20",Ke=["initialize","initialized","runtime/capabilities","thread/start","thread/resume","thread/read","turn/start","turn/steer","task/inbox","task/queue","task/inputUpdate","turn/interrupt","approval/resolve","userInput/resolve","profile/workflows","profile/evaluations","profile/trainingSource","profile/evaluations/prepare","profile/evaluations/run","profile/evaluations/runSuite","profile/evaluations/executeCase","profile/evaluations/executeRun","profile/evaluations/compare","profile/evaluations/report","experiments/executeCase","experiments/cancelCase","harness/inspect","harness/proposalReview","harness/review","harness/acceptEvaluationReview","harness/materializeEvaluationTaskset","harness/runEvaluationBaseline","harness/validate","harness/backgroundReview","harness/diff","harness/rollback","refiner/inspect","refiner/update","refiner/activate","refiner/rollback"],U=e.object({jsonrpc:e.literal("2.0"),id:e.union([e.string(),e.number()]),method:e.string().trim().min(1),params:e.unknown().optional()}).strict(),J=e.object({jsonrpc:e.literal("2.0"),method:e.string().trim().min(1),params:e.unknown().optional()}).strict(),O=e.object({jsonrpc:e.literal("2.0"),id:e.union([e.string(),e.number()]),result:e.unknown()}).strict(),N=e.object({jsonrpc:e.literal("2.0"),id:e.union([e.string(),e.number(),e.null()]),error:e.object({code:e.number().int(),message:e.string(),data:e.unknown().optional()}).strict()}).strict(),Ge=e.union([U,J,O,N]),ge=e.object({protocolVersion:e.string().trim().min(1),client:e.object({name:e.string().trim().min(1),version:e.string().trim().min(1)}).strict(),capabilities:e.record(e.string(),e.unknown()).default({})}).strict(),P=class{static{a(this,"AgentJsonRpcDispatcher")}#e;#t=null;#r=!1;constructor(t){this.#e=t}get initialized(){return this.#r}async handle(t){let i=J.safeParse(t);if(i.success&&!("id"in t)){if(i.data.method==="initialized"){if(!this.#t)throw new w(-32002,"initialize must be called first");this.#r=!0}return null}let n=U.safeParse(t);if(!n.success)return M(null,-32600,"Invalid Request",n.error.flatten());let o=n.data;try{let l=await this.#n(o.method,o.params);return{jsonrpc:"2.0",id:o.id,result:l}}catch(l){let u=l instanceof w?l:new w(-32603,l instanceof Error?l.message:String(l));return M(o.id,u.code,u.message,u.data)}}async#n(t,i){if(t==="initialize"){let n=ge.parse(i);if(n.protocolVersion!==E)throw new w(-32001,"Incompatible agent protocol version",{requested:n.protocolVersion,supported:E});return this.#t=n,{protocolVersion:E,server:{name:"openpond-app-server",version:"1"},capabilities:await this.#e.capabilities()}}if(!this.#r)throw new w(-32002,"initialized notification is required");switch(t){case"runtime/capabilities":return this.#e.capabilities(i);case"thread/start":return this.#e.threadStart(i);case"thread/resume":return this.#e.threadResume(i);case"thread/read":return this.#e.threadRead(i);case"turn/start":return this.#e.turnStart(i);case"turn/steer":return this.#e.turnSteer(i);case"task/inbox":return this.#e.taskInbox(i);case"task/queue":return this.#e.taskQueue(i);case"task/inputUpdate":return this.#e.taskInputUpdate(i);case"turn/interrupt":return this.#e.turnInterrupt(i);case"approval/resolve":return this.#e.approvalResolve(i);case"userInput/resolve":return this.#e.userInputResolve(i);case"profile/workflows":return this.#e.profileWorkflows(i);case"profile/evaluations":return this.#e.profileEvaluations(i);case"profile/trainingSource":return this.#e.profileTrainingSource(i);case"profile/evaluations/prepare":return this.#e.profileEvaluationPrepare(i);case"profile/evaluations/run":return this.#e.profileEvaluationRun(i);case"experiments/executeCase":{if(!this.#e.experimentExecuteCase)throw new Error("Experiment execution is unavailable in this runtime.");return this.#e.experimentExecuteCase(i)}case"experiments/cancelCase":{if(!this.#e.experimentCancelCase)throw new Error("Experiment cancellation is unavailable in this runtime.");return this.#e.experimentCancelCase(i)}case"profile/evaluations/runSuite":return this.#e.profileEvaluationRunSuite(i);case"profile/evaluations/executeCase":return this.#e.profileEvaluationExecuteCase(i);case"profile/evaluations/executeRun":return this.#e.profileEvaluationExecuteRun(i);case"profile/evaluations/compare":return this.#e.profileEvaluationCompare(i);case"profile/evaluations/report":return this.#e.profileEvaluationReport(i);case"harness/inspect":return this.#e.harnessInspect(i);case"harness/proposalReview":return this.#e.harnessProposalReview(i);case"harness/review":return this.#e.harnessReview(i);case"harness/acceptEvaluationReview":return this.#e.harnessAcceptEvaluationReview(i);case"harness/materializeEvaluationTaskset":return this.#e.harnessMaterializeEvaluationTaskset(i);case"harness/runEvaluationBaseline":return this.#e.harnessRunEvaluationBaseline(i);case"harness/validate":return this.#e.harnessValidate(i);case"harness/backgroundReview":return this.#e.harnessBackgroundReview(i);case"harness/diff":return this.#e.harnessDiff(i);case"harness/rollback":return this.#e.harnessRollback(i);case"refiner/inspect":return this.#e.refinerInspect(i);case"refiner/update":return this.#e.refinerUpdate(i);case"refiner/activate":return this.#e.refinerActivate(i);case"refiner/rollback":return this.#e.refinerRollback(i);default:throw new w(-32601,`Method not found: ${t}`)}}},w=class extends Error{static{a(this,"JsonRpcDispatchError")}code;data;constructor(t,i,n){super(i),this.code=t,this.data=n}};function M(r,t,i,n){return{jsonrpc:"2.0",id:r,error:{code:t,message:i,...n===void 0?{}:{data:n}}}}a(M,"jsonRpcError");var L=class{static{a(this,"AgentRpcClient")}#e;#t;constructor(t){this.#e=t.request.bind(t),this.#t=t.notify.bind(t)}async initialize(t,i={}){let n=await this.#e("initialize",{protocolVersion:E,client:t,capabilities:i});return await this.#t("initialized"),n}capabilities=a((t={})=>this.#e("runtime/capabilities",t),"capabilities");threadStart=a(t=>this.#e("thread/start",t),"threadStart");threadResume=a(t=>this.#e("thread/resume",t),"threadResume");threadRead=a(t=>this.#e("thread/read",t),"threadRead");turnStart=a(t=>this.#e("turn/start",t),"turnStart");turnSteer=a(t=>this.#e("turn/steer",t),"turnSteer");taskInbox=a(t=>this.#e("task/inbox",t),"taskInbox");taskQueue=a(t=>this.#e("task/queue",t),"taskQueue");taskInputUpdate=a(t=>this.#e("task/inputUpdate",t),"taskInputUpdate");turnInterrupt=a(t=>this.#e("turn/interrupt",t),"turnInterrupt");approvalResolve=a(t=>this.#e("approval/resolve",t),"approvalResolve");userInputResolve=a(t=>this.#e("userInput/resolve",t),"userInputResolve");profileWorkflows=a(t=>this.#e("profile/workflows",t),"profileWorkflows");profileEvaluations=a(t=>this.#e("profile/evaluations",t),"profileEvaluations");profileEvaluationPrepare=a(t=>this.#e("profile/evaluations/prepare",t),"profileEvaluationPrepare");profileEvaluationRun=a(t=>this.#e("profile/evaluations/run",t),"profileEvaluationRun");profileEvaluationRunSuite=a(t=>this.#e("profile/evaluations/runSuite",t),"profileEvaluationRunSuite");profileEvaluationExecuteCase=a(t=>this.#e("profile/evaluations/executeCase",t),"profileEvaluationExecuteCase");profileEvaluationExecuteRun=a(t=>this.#e("profile/evaluations/executeRun",t),"profileEvaluationExecuteRun");profileEvaluationCompare=a(t=>this.#e("profile/evaluations/compare",t),"profileEvaluationCompare");experimentExecuteCase=a(t=>this.#e("experiments/executeCase",t),"experimentExecuteCase");experimentCancelCase=a(t=>this.#e("experiments/cancelCase",t),"experimentCancelCase");harnessInspect=a((t={})=>this.#e("harness/inspect",t),"harnessInspect");harnessProposalReview=a((t={})=>this.#e("harness/proposalReview",t),"harnessProposalReview");harnessReview=a((t={})=>this.#e("harness/review",t),"harnessReview");harnessAcceptEvaluationReview=a((t={})=>this.#e("harness/acceptEvaluationReview",t),"harnessAcceptEvaluationReview");harnessMaterializeEvaluationTaskset=a((t={})=>this.#e("harness/materializeEvaluationTaskset",t),"harnessMaterializeEvaluationTaskset");harnessRunEvaluationBaseline=a((t={})=>this.#e("harness/runEvaluationBaseline",t),"harnessRunEvaluationBaseline");harnessValidate=a((t={})=>this.#e("harness/validate",t),"harnessValidate");harnessBackgroundReview=a((t={})=>this.#e("harness/backgroundReview",t),"harnessBackgroundReview");harnessDiff=a((t={})=>this.#e("harness/diff",t),"harnessDiff");harnessRollback=a((t={})=>this.#e("harness/rollback",t),"harnessRollback");refinerInspect=a(t=>this.#e("refiner/inspect",t),"refinerInspect");refinerUpdate=a(t=>this.#e("refiner/update",t),"refinerUpdate");refinerActivate=a(t=>this.#e("refiner/activate",t),"refinerActivate");refinerRollback=a(t=>this.#e("refiner/rollback",t),"refinerRollback")};var c=e.string().trim().min(1).max(200),A=e.string().trim().min(1).max(32e3),T=e.number().int().nonnegative(),D=e.object({id:c,sessionId:c,senderSessionId:c.nullable(),senderKind:e.enum(["user","task","runtime"]),kind:e.enum(["steer","message","followup","queued","result"]),body:A,payload:e.record(e.string(),e.unknown()),idempotencyKey:c,replyTo:c.nullable(),expectedTurnId:c.nullable()}).strict(),ve=e.discriminatedUnion("action",[e.object({action:e.literal("resume"),expectedRevision:e.number().int().positive()}).strict(),e.object({action:e.literal("cancel"),expectedRevision:e.number().int().positive()}).strict(),e.object({action:e.literal("edit"),expectedRevision:e.number().int().positive(),body:A}).strict(),e.object({action:e.literal("steer"),expectedRevision:e.number().int().positive(),expectedTurnId:c}).strict()]),F=e.object({id:c,sessionId:c,turnId:c,targetSessionId:c.nullable(),targetTurnId:c.nullable(),targetInputId:c.nullable(),afterSequence:T,deadline:e.string(),state:e.enum(["waiting","message","completed","failed","interrupted","unavailable","timeout","cancelled"]),createdAt:e.string(),updatedAt:e.string()}).strict(),W=e.record(e.string(),e.unknown()),xe=e.enum(["queued","running","completed","failed","cancelled","needs_resume"]),Ie=e.object({parentSessionId:c.nullable().optional(),childSessionId:c.nullable().optional(),status:e.array(xe).nullable().optional(),afterId:e.string().max(200),limit:e.number().int().min(1).max(10)}).strict(),K=e.discriminatedUnion("action",[e.object({action:e.literal("recoverTaskInboxOwners"),ownerId:c}).strict(),e.object({action:e.literal("hasTaskCompletion"),turnId:c}).strict(),e.object({action:e.literal("taskInboxSnapshot"),sessionId:c}).strict(),e.object({action:e.literal("taskInboxSnapshotInputs"),sessionId:c,afterSequence:T}).strict(),e.object({action:e.literal("declareTaskWork"),sessionId:c,turnId:c,ownerId:c,areas:e.array(A).max(100)}).strict(),e.object({action:e.literal("taskWorkAreas"),sessionId:c}).strict(),e.object({action:e.literal("admitTaskInput"),input:D}).strict(),e.object({action:e.literal("admitTaskInputs"),inputs:e.array(D).max(50)}).strict(),e.object({action:e.literal("rejectTaskInput"),id:c,error:A}).strict(),e.object({action:e.literal("getTaskInput"),id:c}).strict(),e.object({action:e.literal("taskInputsForSession"),sessionId:c,query:e.object({afterSequence:T.optional(),pendingOnly:e.boolean().optional(),limit:e.number().int().min(1).max(500).optional()}).strict()}).strict(),e.object({action:e.literal("mutateTaskInput"),sessionId:c,inputId:c,change:ve}).strict(),e.object({action:e.literal("openTaskInboxTurn"),sessionId:c,turnId:c,ownerId:c}).strict(),e.object({action:e.literal("renewTaskInboxTurn"),sessionId:c,turnId:c,ownerId:c}).strict(),e.object({action:e.literal("pendingTaskInputs"),sessionId:c,turnId:c,afterSequence:T}).strict(),e.object({action:e.literal("taskAssignmentInputs"),turnId:c,afterSequence:T}).strict(),e.object({action:e.literal("pauseTaskInboxTurn"),sessionId:c,turnId:c,ownerId:c}).strict(),e.object({action:e.literal("includeTaskInputs"),sessionId:c,turnId:c,ownerId:c,requestId:c}).strict(),e.object({action:e.literal("settleTaskInputRequest"),requestId:c,outcome:e.enum(["resolved","failed","replaced"])}).strict(),e.object({action:e.literal("sealTaskInboxTurn"),sessionId:c,turnId:c,ownerId:c}).strict(),e.object({action:e.literal("sealNativeTaskInboxTurn"),sessionId:c,turnId:c,ownerId:c}).strict(),e.object({action:e.literal("closeTaskInboxTurn"),sessionId:c,turnId:c,ownerId:c,outcome:e.enum(["completed","failed","interrupted"])}).strict(),e.object({action:e.literal("taskInboxPaused"),sessionId:c}).strict(),e.object({action:e.literal("reserveTaskFollowup"),sessionId:c,turnId:c,ownerId:c}).strict(),e.object({action:e.literal("taskInboxWakeTargets"),afterSessionId:e.string().max(200)}).strict(),e.object({action:e.literal("createTaskWait"),value:F}).strict(),e.object({action:e.literal("settleTaskWait"),id:c,state:F.shape.state}).strict(),e.object({action:e.literal("taskWaitsForSession"),sessionId:c,afterId:e.string().max(200)}).strict(),e.object({action:e.literal("commitSubagentCompletion"),value:W,turnId:c}).strict(),e.object({action:e.literal("pendingTaskCompletions"),afterTurnId:e.string().max(200)}).strict(),e.object({action:e.literal("settleTaskCompletion"),turnId:c,inputId:c}).strict(),e.object({action:e.literal("upsertSubagentRun"),value:W}).strict(),e.object({action:e.literal("getSubagentRun"),id:c}).strict(),e.object({action:e.literal("listSubagentRuns"),query:Ie}).strict()]);var q=e.string().trim().min(1).max(191),G=e.object({createdAt:e.string().min(1),id:q}).strict(),Q=e.enum(["trigger_decision","route_decision","refiner_outcome","proposal","targeted_validation","apply_receipt"]),X=e.discriminatedUnion("action",[e.object({action:e.literal("active_release"),workspaceId:q}).strict(),e.object({action:e.literal("put_artifact"),workspaceId:q,kind:Q,artifact:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("artifact_page"),workspaceId:q,kind:Q,before:G.nullable(),limit:e.number().int().min(1).max(200)}).strict(),e.object({action:e.literal("pending_trigger_page"),workspaceId:q,before:G.nullable(),limit:e.number().int().min(1).max(200)}).strict()]);var b=e.string().trim().min(1).max(240),Y=e.string().regex(/^[a-f0-9]{64}$/),Z=e.enum(["run_overlay","observation","trigger_decision","route_decision","proposal","targeted_validation","apply_receipt","refiner_outcome"]),ee=e.object({createdAt:e.string().datetime(),id:b}).strict(),te=e.discriminatedUnion("action",[e.object({action:e.literal("artifact_put"),workspaceId:b,kind:Z,artifact:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("artifact_page"),workspaceId:b,kind:Z,before:ee.nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("pending_page"),workspaceId:b,before:ee.nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("workspace_get"),workspaceId:b}).strict(),e.object({action:e.literal("background_get"),workspaceId:b}).strict(),e.object({action:e.literal("overlay_get"),runId:b}).strict(),e.object({action:e.literal("overlay_freeze"),runId:b,expectedRevision:e.number().int().nonnegative(),overlay:e.record(e.string(),e.unknown()),proposal:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("memory_get"),workspaceId:b,sessionId:b,key:b}).strict(),e.object({action:e.literal("memory_page"),workspaceId:b,sessionId:b,before:e.object({updatedAt:e.string().datetime(),key:b}).strict().nullable(),limit:e.number().int().min(1).max(20),includeDeleted:e.boolean()}).strict(),e.object({action:e.literal("memory_write"),sessionId:b,input:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("release_get"),contentHash:Y}).strict(),e.object({action:e.literal("release_put"),record:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("session_get"),sessionId:b}).strict(),e.object({action:e.literal("turn_get"),turnId:b}).strict(),e.object({action:e.literal("turn_page"),sessionId:b,before:e.number().int().positive().nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("event_page"),turnId:b,afterSequence:e.number().int().nonnegative(),names:e.array(b).max(40),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("event_append"),event:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("usage_put"),record:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("snapshot_restore"),turnId:b,expectedHash:Y,snapshot:e.record(e.string(),e.unknown())}).strict()]);var v=e.string().trim().min(1).max(200),re=e.string().regex(/^[a-f0-9]{64}$/),we=e.object({kind:e.enum(["structural","visual","test","user_review"]),status:e.enum(["passed","failed","not_run"]),label:e.string().trim().min(1).max(240),detail:e.string().trim().max(4e3).nullable().optional(),ref:e.string().trim().max(4096).nullable().optional()}),ne=e.object({id:v,title:e.string().trim().min(1).max(240),sourceTaskId:v,sourceTurnId:v,revision:e.number().int().positive(),createdAt:e.string().datetime(),contentType:e.string().trim().min(1).max(200),sizeBytes:e.number().int().min(1).max(1e7),sha256:re,validation:e.array(we).max(32)}).strict(),ae=e.object({sessionId:v,turnId:v,output:ne}).strict(),ie=e.object({uploadId:v,index:e.number().int().min(0).max(1024),offset:e.number().int().min(0).max(1e7),sha256:re,contentsBase64:e.string().min(1).max(131072)}).strict(),se=e.object({uploadId:v}).strict(),ke=ne.pick({id:!0,title:!0,sourceTaskId:!0,sourceTurnId:!0,revision:!0,createdAt:!0,validation:!0}),oe=e.object({sessionId:v,turnId:v,output:ke,sandboxPath:e.string().trim().min(1).max(4096)}).strict();var _=e.string().trim().min(1).max(200),je=e.object({type:e.enum(["create","get","start","stop","exec","open_port","list_files","download_file","upload_file","search_files","delete_file","stat_file","mkdir","move_file","process_start","process_get","git_status","git_diff","git_export_patch","git_branch","git_commit","git_pull","git_push"]),sandboxId:_.optional(),payload:e.unknown().optional(),processId:_.optional(),failOnUnpreservedChanges:e.boolean().optional()}).strict().superRefine((r,t)=>{r.type!=="create"&&!r.sandboxId&&t.addIssue({code:"custom",message:"Sandbox identity is required."}),r.type==="create"&&r.sandboxId&&t.addIssue({code:"custom",message:"Create cannot target a sandbox identity."}),r.type==="process_get"&&!r.processId&&t.addIssue({code:"custom",message:"Process identity is required."})}),ce=e.object({action:je}).strict(),le=e.object({sessionId:_,turnId:_,name:_}).strict();var d=1,s=e.string().trim().min(1).max(191),k=e.number().int().min(1).max(200),gt=e.object({teamId:s,ownerUserId:s,workspaceId:s,conversationId:s,turnId:s,attempt:e.number().int().min(1),leaseGeneration:e.number().int().min(1)}).strict(),ue=e.discriminatedUnion("operation",[e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("experiment/policy"),params:e.object({caseId:s,admissionHash:e.string().regex(/^[a-f0-9]{64}$/),ordinal:e.number().int().nonnegative(),messages:e.array(e.record(e.string(),e.unknown())).max(2e3),tools:e.array(e.record(e.string(),e.unknown())).max(200)}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("sandbox/request"),params:ce}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("embedding/authorize"),params:le}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("output/begin"),params:ae}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("output/chunk"),params:ie}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("output/complete"),params:se}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("output/saveSandboxFile"),params:oe}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("settings/get"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("harness/get"),params:e.object({reference:e.object({id:s,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("harness/overlay/get"),params:e.object({runId:s}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("harness/overlay/put"),params:e.object({runId:s,expectedRevision:e.number().int().min(0).nullable(),overlay:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("harness/overlay/freezeProposal"),params:e.object({runId:s,expectedRevision:e.number().int().min(0),overlay:e.record(e.string(),e.unknown()),proposal:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("harness/memory/get"),params:e.object({workspaceId:s,key:e.string().min(1).max(120)}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("harness/memory/list"),params:e.object({workspaceId:s,includeDeleted:e.boolean(),before:e.object({updatedAt:e.string(),key:e.string()}).strict().nullable(),limit:k}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("harness/memory/search"),params:e.object({workspaceId:s,query:e.string().trim().min(1).max(500),limit:e.number().int().min(1).max(20)}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("harness/memory/write"),params:e.object({input:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("harness/state/read"),params:e.object({workspaceId:s,kind:e.enum(["selection","workspace_settings","evaluation_review_settings","candidates","cross_run_requests"]),afterId:s.nullable(),limit:e.number().int().min(1).max(100)}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("profile-evaluations/execute"),params:e.discriminatedUnion("action",[e.object({action:e.literal("get"),kind:e.enum(["grade","receipt","run","comparison","suite"]),id:s}).strict(),e.object({action:e.literal("page"),kind:e.enum(["grade","receipt","run","comparison","suite"]),profileKey:e.string().regex(/^[a-f0-9]{64}$/),before:e.object({createdAt:e.string(),id:s}).strict().nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("put"),kind:e.enum(["grade","receipt","run","comparison","suite"]),payload:e.record(e.string(),e.unknown()),profileKey:e.string().regex(/^[a-f0-9]{64}$/).nullable(),createdAt:e.string()}).strict()])}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("harness/workspace/transition"),params:e.discriminatedUnion("action",[e.object({action:e.literal("advance"),receiptId:s,workspaceId:s,proposal:e.record(e.string(),e.unknown()),validations:e.array(e.record(e.string(),e.unknown())).max(100),nextRelease:e.object({id:s,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),nextSourceRevision:e.string().min(1),now:e.string()}).strict(),e.object({action:e.literal("reviewedAdvance"),receiptId:s,workspaceId:s,proposal:e.record(e.string(),e.unknown()),validations:e.array(e.record(e.string(),e.unknown())).max(100),nextRelease:e.object({id:s,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),nextSourceRevision:e.string().min(1),reviewer:s,now:e.string()}).strict(),e.object({action:e.literal("rollback"),receiptId:s,workspaceId:s,expectedWorkspaceRevision:e.number().int().nonnegative(),expectedChannelRevision:e.number().int().nonnegative(),targetRelease:e.object({id:s,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),targetSourceRevision:e.string().min(1),rollbackOf:e.object({id:s,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),now:e.string()}).strict()])}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("task-inbox/execute"),params:K}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("harness/review/execute"),params:te}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("refiner/execute"),params:e.object({action:X}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("create-improve/execute"),params:e.discriminatedUnion("action",[e.object({action:e.literal("get"),runId:s}).strict(),e.object({action:e.literal("page"),query:e.object({profileId:s.nullable(),targetKind:s.nullable(),targetId:s.nullable(),state:e.array(s).max(20)}).strict(),before:e.object({updatedAt:e.string(),id:s}).strict().nullable(),limit:k}).strict(),e.object({action:e.literal("put"),run:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("mutate"),mutation:e.record(e.string(),e.unknown()),next:e.record(e.string(),e.unknown())}).strict()])}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("approval/get"),params:e.object({approvalId:s}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("approval/upsert"),params:e.object({approval:e.record(e.string(),e.unknown()),expectedRevision:e.number().int().min(1).nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("usage/getByRequestId"),params:e.object({requestId:s}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("usage/upsert"),params:e.object({record:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("usage/page"),params:e.object({query:e.object({sessionId:s.optional(),turnId:s.optional(),provider:s.optional(),model:s.optional(),startedAtFrom:e.string().optional(),startedAtTo:e.string().optional(),visibility:e.enum(["user_facing","background","system"]).optional(),status:e.enum(["started","completed","failed","interrupted","missing"]).optional()}).strict(),before:e.object({startedAt:e.string(),requestOrdinal:e.number().int().min(0),id:s}).strict().nullable(),limit:k}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("capabilities"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("session/count"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("session/get"),params:e.object({sessionId:s}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("session/page"),params:e.object({afterId:s.nullable(),limit:k}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("session/put"),params:e.object({sessionId:s,expectedRevision:e.number().int().min(1).nullable(),session:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("turn/count"),params:e.object({sessionId:s}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("turn/wakeCount"),params:e.object({sessionId:s,key:e.enum(["messageId","fromRunId"]),value:s}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("turn/get"),params:e.object({turnId:s}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("turn/put"),params:e.object({sessionId:s,turnId:s,expectedRevision:e.number().int().min(1).nullable(),turn:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("turn/latest"),params:e.object({sessionId:s,status:e.enum(["in_progress","completed","failed","interrupted"]).nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("turn/page"),params:e.object({sessionId:s,beforeSortIndex:e.number().int().min(0).nullable().optional(),limit:k}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("thread/turnPage"),params:e.object({sessionId:s,beforeSortIndex:e.number().int().min(0).nullable().optional(),limit:k}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("event/append"),params:e.object({event:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("events/page"),params:e.object({sessionId:s.nullable(),afterSequence:e.number().int().min(0),beforeSequence:e.number().int().min(1).nullable().optional(),limit:k,excludeReasoningDeltas:e.boolean().optional()}).strict()}).strict(),e.object({contractVersion:e.literal(d),requestId:s,operation:e.literal("events/latestAssistantText"),params:e.object({sessionId:s}).strict()}).strict()]),vt=e.object({contractVersion:e.literal(d),operations:e.array(e.enum(["sandbox/request","embedding/authorize","output/begin","output/chunk","output/complete","output/saveSandboxFile","settings/get","harness/get","harness/overlay/get","harness/overlay/put","harness/overlay/freezeProposal","harness/memory/get","harness/memory/list","harness/memory/search","harness/memory/write","harness/state/read","profile-evaluations/execute","harness/review/execute","harness/workspace/transition","task-inbox/execute","refiner/execute","create-improve/execute","approval/get","approval/upsert","usage/getByRequestId","usage/upsert","usage/page","session/count","session/get","session/page","session/put","turn/count","turn/wakeCount","turn/get","turn/put","turn/latest","turn/page","thread/turnPage","event/append","events/page","events/latestAssistantText"])).max(48),allowedTools:e.array(s).max(128),maxPageSize:k,maxRequestBytes:e.number().int().min(1).max(8388608),maxInFlight:e.number().int().min(1).max(64)}).strict();var de=class{static{a(this,"AgentHostStorageClient")}#e=new Map;#t=null;#r=1;bind(t){if(this.#t)throw new Error("Host storage client is already bound.");this.#t=t}async request(t,i=15e3){let n=ue.parse(t);if(!this.#t)throw new Error("Host storage transport is unavailable.");if(this.#e.size>=32)throw new Error("Host storage request limit exceeded.");let o=`host-storage:${this.#r++}`,l={jsonrpc:"2.0",id:o,method:"host/storage",params:n};if(Buffer.byteLength(JSON.stringify(l))>(n.operation==="experiment/policy"?8388608:256e3))throw new Error("Host storage request is too large.");let u=new Promise((p,f)=>{let h=n.operation==="sandbox/request"||n.operation==="experiment/policy"?3e5:6e4,y=setTimeout(()=>{this.#e.delete(o),f(new Error("Host storage request timed out."))},Math.max(1,Math.min(h,i)));this.#e.set(o,{resolve:p,reject:f,timer:y})});try{await this.#t(l)}catch(p){let f=this.#e.get(o);f&&(clearTimeout(f.timer),this.#e.delete(o),f.reject(p instanceof Error?p:new Error(String(p))))}return u}accept(t){let i=O.safeParse(t),n=i.success?null:N.safeParse(t),o=i.success?i.data:n?.success?n.data:null;if(!o||typeof o.id!="string"||!o.id.startsWith("host-storage:"))return!1;let l=this.#e.get(o.id);return l?(clearTimeout(l.timer),this.#e.delete(o.id),Buffer.byteLength(JSON.stringify(o))>1e6?(l.reject(new Error("Host storage response is too large.")),!0):("error"in o?l.reject(new Error(`Host storage request failed: ${o.error.message}`)):l.resolve(o.result),!0)):!0}close(){this.#t=null;for(let t of this.#e.values())clearTimeout(t.timer),t.reject(new Error("Host storage transport closed."));this.#e.clear()}};import{once as ye}from"node:events";import{createInterface as Re}from"node:readline";async function Et(r){let t=null,i=Promise.resolve(),n=[],o=a(m=>(i=i.then(async()=>{r.writable.write(`${JSON.stringify(m)}
3
- `)||await ye(r.writable,"drain")}),i),"write");r.hostStorageClient?.bind(m=>o(m));let l=a(()=>{if(!(!t?.initialized||n.length===0))for(let m of n.splice(0))o(m)},"flushPendingNotifications"),u,p=new Set,f=Re({input:r.readable,crlfDelay:1/0}),h=[],y=!1,S=null,R=a(async m=>{let g=t;if(!g)throw new Error("Agent runtime dispatcher is unavailable.");let x=(async()=>{let $=await g.handle(m);$&&await o($),l()})(),B=m&&typeof m=="object"&&"method"in m?m.method:null;if(B==="initialize"||B==="initialized"){await x;return}p.add(x),x.finally(()=>p.delete(x))},"dispatch"),z=(async()=>{let m=typeof r.host=="function"?await r.host():r.host;for(t=new P(m),u=m.subscribe?.(g=>{if(!t?.initialized){n.push(g);return}o(g)});h.length>0;)await R(h.shift());y=!0})().catch(m=>{S=m,f.close()});try{for await(let m of f){if(!m.trim())continue;if(Buffer.byteLength(m,"utf8")>1e6){await o({jsonrpc:"2.0",id:null,error:{code:-32600,message:"Request exceeds the JSONL size limit"}});continue}let g;try{g=JSON.parse(m)}catch{await o({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}});continue}if(!r.hostStorageClient?.accept(g))if(y)await R(g);else if(h.length>=64){let x=g&&typeof g=="object"&&"id"in g?g.id:null;(typeof x=="string"||typeof x=="number")&&await o({jsonrpc:"2.0",id:x,error:{code:-32e3,message:"Runtime startup request limit exceeded"}})}else h.push(g)}if(await z,S)throw S;await Promise.all(p),await i}finally{r.hostStorageClient?.close(),u?.()}}a(Et,"runAgentJsonlServer");var H=e.object({threadId:e.string().trim().min(1)}).passthrough(),Se=H.extend({includeHistory:e.boolean().optional()}),Ee=e.object({session:e.unknown()}).strict(),C=H.extend({input:e.unknown()}),Te=C.extend({idempotencyKey:e.string().trim().min(1).max(200)}),qe=C.extend({inputId:e.string().trim().min(1)}),_e=H.extend({reason:e.string().trim().min(1).optional()}),Ce=e.object({approvalId:e.string().trim().min(1),input:e.unknown()}).strict();function Vt(r){let t=a(async(n,o,l)=>{let u=performance.now();r.telemetry?.({method:n,phase:"started",threadId:o,durationMs:null,errorClass:null});try{let p=await l();return r.telemetry?.({method:n,phase:"completed",threadId:o,durationMs:performance.now()-u,errorClass:null}),p}catch(p){throw r.telemetry?.({method:n,phase:"failed",threadId:o,durationMs:performance.now()-u,errorClass:p instanceof Error?p.name:"UnknownError"}),p}},"run"),i=a(async(n,o="thread/read")=>{let{threadId:l,includeHistory:u}=Se.parse(n);return t(o,l,async()=>{if(u===!1)return{thread:await r.readThread(l),turns:[],events:[]};let[p,f,h]=await Promise.all([r.readThread(l),r.listTurns(l),r.listEvents(l)]);return{thread:p,turns:f,events:h}})},"threadRead");return{capabilities:a(n=>t("runtime/capabilities",null,()=>r.capabilities(n)),"capabilities"),threadStart:a(async n=>t("thread/start",null,async()=>({thread:await r.createThread(Ee.parse(n).session)})),"threadStart"),threadResume:a(n=>i(n,"thread/resume"),"threadResume"),threadRead:i,turnStart:a(async n=>{let o=C.parse(n);return t("turn/start",o.threadId,async()=>({turn:await r.startTurn(o.threadId,o.input)}))},"turnStart"),turnSteer:a(async n=>{let o=C.parse(n);return t("turn/steer",o.threadId,async()=>({receipt:await r.steerTurn(o.threadId,o.input)}))},"turnSteer"),taskInbox:a(async n=>{let{threadId:o}=H.parse(n);return t("task/inbox",o,()=>r.readTaskInbox(o))},"taskInbox"),taskQueue:a(async n=>{let o=Te.parse(n);return t("task/queue",o.threadId,()=>r.queueTaskInput(o.threadId,o.input,o.idempotencyKey))},"taskQueue"),taskInputUpdate:a(async n=>{let o=qe.parse(n);return t("task/inputUpdate",o.threadId,()=>r.updateTaskInput(o.threadId,o.inputId,o.input))},"taskInputUpdate"),turnInterrupt:a(async n=>{let o=_e.parse(n);return t("turn/interrupt",o.threadId,async()=>({turn:await r.interruptTurn(o.threadId,o.reason)}))},"turnInterrupt"),approvalResolve:a(async n=>{let o=Ce.parse(n);return t("approval/resolve",null,async()=>({approval:await r.resolveApproval(o.approvalId,o.input)}))},"approvalResolve"),userInputResolve:a(async n=>{let o=C.parse(n);return t("userInput/resolve",o.threadId,async()=>(r.isTurnActive(o.threadId)&&await r.waitForTurnSettlement(o.threadId),{turn:await r.startTurn(o.threadId,o.input)}))},"userInputResolve"),profileWorkflows:a(()=>t("profile/workflows",null,()=>r.listProfileWorkflows()),"profileWorkflows"),profileEvaluations:a(n=>t("profile/evaluations",null,()=>r.listProfileEvaluations(n)),"profileEvaluations"),profileTrainingSource:a(()=>t("profile/trainingSource",null,()=>r.loadProfileTrainingSource()),"profileTrainingSource"),profileEvaluationPrepare:a(n=>t("profile/evaluations/prepare",null,()=>r.prepareProfileEvaluationRun(n)),"profileEvaluationPrepare"),profileEvaluationRun:a(n=>t("profile/evaluations/run",null,()=>r.runPreparedProfileEvaluation(n)),"profileEvaluationRun"),...r.executeExperimentCase?{experimentExecuteCase:a(n=>t("experiments/executeCase",null,()=>r.executeExperimentCase(n)),"experimentExecuteCase")}:{},...r.cancelExperimentCase?{experimentCancelCase:a(n=>t("experiments/cancelCase",null,()=>r.cancelExperimentCase(n)),"experimentCancelCase")}:{},profileEvaluationRunSuite:a(n=>t("profile/evaluations/runSuite",null,()=>r.runProfileEvaluationSuite(n)),"profileEvaluationRunSuite"),profileEvaluationExecuteCase:a(n=>t("profile/evaluations/executeCase",null,()=>r.executeProfileEvaluationCase(n)),"profileEvaluationExecuteCase"),profileEvaluationExecuteRun:a(n=>t("profile/evaluations/executeRun",null,()=>r.executeProfileEvaluationRun(n)),"profileEvaluationExecuteRun"),profileEvaluationCompare:a(n=>t("profile/evaluations/compare",null,()=>r.compareProfileEvaluationRuns(n)),"profileEvaluationCompare"),profileEvaluationReport:a(n=>t("profile/evaluations/report",null,()=>r.buildProfileEvaluationReport(n)),"profileEvaluationReport"),harnessInspect:a(()=>t("harness/inspect",null,()=>r.inspectHarness()),"harnessInspect"),harnessProposalReview:a(n=>t("harness/proposalReview",null,()=>r.reviewHarnessProposal(n)),"harnessProposalReview"),harnessReview:a(n=>t("harness/review",null,()=>r.reviewHarness(n)),"harnessReview"),harnessAcceptEvaluationReview:a(n=>t("harness/acceptEvaluationReview",null,()=>r.acceptHarnessEvaluationReview(n)),"harnessAcceptEvaluationReview"),harnessMaterializeEvaluationTaskset:a(n=>t("harness/materializeEvaluationTaskset",null,()=>r.materializeHarnessEvaluationTaskset(n)),"harnessMaterializeEvaluationTaskset"),harnessRunEvaluationBaseline:a(n=>t("harness/runEvaluationBaseline",null,()=>r.runHarnessEvaluationBaseline(n)),"harnessRunEvaluationBaseline"),harnessValidate:a(()=>t("harness/validate",null,()=>r.validateHarness()),"harnessValidate"),harnessBackgroundReview:a(n=>t("harness/backgroundReview",null,()=>r.updateHarnessBackgroundReview(n)),"harnessBackgroundReview"),harnessDiff:a(n=>t("harness/diff",null,()=>r.diffHarness(n)),"harnessDiff"),harnessRollback:a(n=>t("harness/rollback",null,()=>r.rollbackHarness(n)),"harnessRollback"),refinerInspect:a(()=>t("refiner/inspect",null,()=>r.inspectRefiner()),"refinerInspect"),refinerUpdate:a(n=>t("refiner/update",null,()=>r.updateRefiner(n)),"refinerUpdate"),refinerActivate:a(n=>t("refiner/activate",null,()=>r.activateRefiner(n)),"refinerActivate"),refinerRollback:a(n=>t("refiner/rollback",null,()=>r.rollbackRefiner(n)),"refinerRollback"),subscribe:r.subscribeEvents&&r.eventNotification?n=>r.subscribeEvents(o=>n(r.eventNotification(o))):void 0}}a(Vt,"createAgentRuntimeService");var j=e.string().regex(/^[a-f0-9]{64}$/),Pe=e.object({harnessReleaseHash:j,instructionsHash:j,skillHashes:e.record(e.string(),j),agentAssetHashes:e.record(e.string(),j),toolCatalogHash:j,memoryRevision:e.number().int().nonnegative().nullable()}).strict(),Ae=e.object({protocolVersion:e.string().trim().min(1),threadId:e.string().trim().min(1),turnId:e.string().trim().min(1),harnessReleaseHash:j,toolCatalogHash:j,context:e.record(e.string(),e.unknown()),pendingInteraction:e.record(e.string(),e.unknown()).nullable(),usage:e.record(e.string(),e.unknown())}).strict();function Mt(r){return I(Pe.parse(r))}a(Mt,"effectiveSurfaceHash");function Ut(r){return I(Ae.parse(r))}a(Ut,"checkpointHash");function Jt(r){return[r.system,...r.harnessInstructions,...r.skillInstructions,...r.hostInstructions??[]].map(t=>t.trim()).filter(Boolean).join(`
4
-
5
- `)}a(Jt,"materializeAgentPrompt");function Kt(r){let t=new Map;for(let u of r){let p=u.name.trim();if(!p)throw new Error("Agent tool names cannot be empty.");if(t.has(p))throw new Error(`Duplicate agent tool: ${p}.`);if(!u.unavailableReason&&!u.execute)throw new Error(`Agent tool ${p} is declared as available without an executor.`);t.set(p,{...u,name:p})}let i=[...t.values()].sort((u,p)=>u.name.localeCompare(p.name)),n=i.filter(u=>!u.unavailableReason).map(u=>({name:u.name,description:u.description,inputSchema:e.toJSONSchema(u.inputSchema,{target:"draft-7",unrepresentable:"any"})})),o=i.map(u=>({name:u.name,displayLabel:u.displayLabel??u.name,placement:u.placement,available:!u.unavailableReason,unavailableReason:u.unavailableReason??null})),l=I({modelTools:n,capabilities:o});return{byName:t,tools:i,modelTools:n,capabilities:o,hash:l}}a(Kt,"createAgentToolCatalog");async function Gt(r,t){let i=r.byName.get(t.name);if(!i)throw new Error(`Unknown agent tool: ${t.name}.`);if(i.unavailableReason)throw new Error(`Agent tool ${t.name} is unavailable: ${i.unavailableReason}`);if(!i.execute)throw new Error(`Agent tool ${t.name} has no executor.`);return i.execute(i.inputSchema.parse(t.arguments),t.context)}a(Gt,"executeAgentTool");function Qt(r){let t=new Set,i=[...r].map(l=>{let u=l.name.trim();if(!u)throw new Error("Agent tool names cannot be empty.");if(t.has(u))throw new Error(`Duplicate agent tool: ${u}.`);if(t.add(u),!l.unavailableReason&&!l.executorAvailable)throw new Error(`Agent tool ${u} is declared as available without an executor.`);return{...l,name:u}}).sort((l,u)=>l.name.localeCompare(u.name)),n=i.filter(l=>!l.unavailableReason).map(l=>({name:l.name,description:l.description,inputSchema:l.inputSchema})),o=i.map(l=>({name:l.name,displayLabel:l.displayLabel??l.name,placement:l.placement,available:!l.unavailableReason,unavailableReason:l.unavailableReason??null}));return{byName:new Map(i.map(l=>[l.name,l])),tools:i,modelTools:n,capabilities:o,hash:I({modelTools:n,capabilities:o})}}a(Qt,"createAgentToolCatalogProjection");async function Xt(r,t){let i=r.byName.get(t.name);if(!i)throw new Error(`Unknown agent tool: ${t.name}.`);if(i.unavailableReason)throw new Error(`Agent tool ${t.name} is unavailable: ${i.unavailableReason}`);if(!i.execute)throw new Error(`Agent tool ${t.name} has no executor.`);let n=i.validateArguments?i.validateArguments(t.arguments):t.arguments;return i.execute(n,t.context)}a(Xt,"executeProjectedAgentTool");var pe=class{static{a(this,"TaskSignals")}#e=new Map;notify(t){for(let i of[...this.#e.get(t)??[]])i()}subscribe(t,i){let n=this.#e.get(t);return n||this.#e.set(t,n=new Set),n.add(i),()=>{n.delete(i),n.size===0&&this.#e.delete(t)}}async wait(t){let i=a(()=>{},"wake"),n=0,o=a(()=>{n+=1,i()},"changed"),l=[...new Set(t.taskIds)].map(p=>this.subscribe(p,o)),u=setTimeout(o,Math.max(0,t.deadline-Date.now()));t.signal.addEventListener("abort",o);try{for(;;){t.signal.throwIfAborted();let p=n,f=await t.read();if(f!==null)return f;if(Date.now()>=t.deadline)return null;n===p&&await new Promise(h=>{i=h,(n!==p||t.signal.aborted)&&h()})}}finally{clearTimeout(u),t.signal.removeEventListener("abort",o);for(let p of l)p()}}},me=class{static{a(this,"TaskSerialExecutor")}#e=new Map;async run(t,i){let o=(this.#e.get(t)??Promise.resolve()).then(i),l=o.then(()=>{},()=>{});this.#e.set(t,l);try{return await o}finally{this.#e.get(t)===l&&this.#e.delete(t)}}};export{V as a,I as b,Oe as c,Ne as d,Be as e,be as f,fe as g,Le as h,E as i,Ke as j,U as k,J as l,O as m,N as n,Ge as o,ge as p,P as q,L as r,K as s,X as t,te as u,ne as v,ae as w,ie as x,se as y,ke as z,oe as A,je as B,ce as C,le as D,d as E,gt as F,ue as G,vt as H,de as I,Et as J,Vt as K,Pe as L,Ae as M,Mt as N,Ut as O,Jt as P,Kt as Q,Gt as R,Qt as S,Xt as T,pe as U,me as V};