openpond 0.2.52 → 0.2.53

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 (136) hide show
  1. package/dist/app-server.d.ts +1 -0
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/{app-layer-RRFI27N4.js → app-layer-I7MZYVLL.js} +1 -1
  4. package/dist/chunks/{app-server-runtime-NITNSHYS.js → app-server-runtime-KZP2LB5X.js} +1 -1
  5. package/dist/chunks/{apps-NELJL377.js → apps-TM74FFQB.js} +1 -1
  6. package/dist/chunks/{chunk-CFLMKFOE.js → chunk-3LX6RU3C.js} +2 -2
  7. package/dist/chunks/{chunk-7YR6CBNU.js → chunk-4SHKI3BH.js} +1 -1
  8. package/dist/chunks/{chunk-7MXZJQS7.js → chunk-4TZHH5FC.js} +1 -1
  9. package/dist/chunks/{chunk-T5T7NCHJ.js → chunk-5TNDPNS3.js} +1 -1
  10. package/dist/chunks/{chunk-AV3WI7JZ.js → chunk-6JAN4RMN.js} +1 -1
  11. package/dist/chunks/{chunk-OE2VF6KU.js → chunk-6VF3Q6QJ.js} +1 -1
  12. package/dist/chunks/{chunk-PVSUQGWK.js → chunk-7ZG3IT7C.js} +1 -1
  13. package/dist/chunks/{chunk-EPY7M5XS.js → chunk-AFUDIT36.js} +1 -1
  14. package/dist/chunks/{chunk-Q4H3NUVW.js → chunk-AH22RHPS.js} +2 -2
  15. package/dist/chunks/{chunk-DLZP22WV.js → chunk-FPUUZQUP.js} +1 -1
  16. package/dist/chunks/{chunk-ZBZBV5TB.js → chunk-GCOUYYHG.js} +1 -1
  17. package/dist/chunks/{chunk-MASJQWA2.js → chunk-GXSTZBM6.js} +1 -1
  18. package/dist/chunks/{chunk-IOQUF34U.js → chunk-H2VT22JK.js} +1 -1
  19. package/dist/chunks/{chunk-L3V4QKRV.js → chunk-NHFGEVVH.js} +1 -1
  20. package/dist/chunks/{chunk-HJEY5LBD.js → chunk-PQHTZ5CP.js} +1 -1
  21. package/dist/chunks/{chunk-QJRXTIOC.js → chunk-USKE34VR.js} +1 -1
  22. package/dist/chunks/{chunk-XC7AHL57.js → chunk-XGE2XI6M.js} +44 -44
  23. package/dist/chunks/{chunk-FQZFLNLY.js → chunk-YD55Z5H3.js} +1 -1
  24. package/dist/chunks/{chunk-RLZPX4YP.js → chunk-YJ4PNAST.js} +1 -1
  25. package/dist/chunks/{cli-ZYFSCHZK.js → cli-JVB345H2.js} +1 -1
  26. package/dist/chunks/{configuration-command-SA56RV5B.js → configuration-command-MATM4XR5.js} +1 -1
  27. package/dist/chunks/{connected-evidence-IVSQZYIB.js → connected-evidence-YDPGNHLP.js} +1 -1
  28. package/dist/chunks/{core-commands-W5IGIITV.js → core-commands-MTV4EKXY.js} +1 -1
  29. package/dist/chunks/{datasets-KSO2UG6R.js → datasets-CP3IT47T.js} +1 -1
  30. package/dist/chunks/{desktop-test-6HXFM7PO.js → desktop-test-IAZC5MAH.js} +1 -1
  31. package/dist/chunks/{dist-5VFPYEIV.js → dist-SAABJU5F.js} +1 -1
  32. package/dist/chunks/{evaluation-coordination-MOFBXRXN.js → evaluation-coordination-EPHLZXYM.js} +1 -1
  33. package/dist/chunks/{experiment-improvements-TDHM6NEA.js → experiment-improvements-6JTOPA74.js} +1 -1
  34. package/dist/chunks/{experiments-HFPDFD4I.js → experiments-XHPFGECH.js} +1 -1
  35. package/dist/chunks/{extension-R373LYIB.js → extension-GX7DLW2X.js} +1 -1
  36. package/dist/chunks/{help-PEFQDDTA.js → help-WLKSACLZ.js} +1 -1
  37. package/dist/chunks/{hosted-experiment-improvement-MGBPXXW2.js → hosted-experiment-improvement-HAB3UE6A.js} +1 -1
  38. package/dist/chunks/{hosted-harness-runtime-WOLADXXP.js → hosted-harness-runtime-YM23QNDK.js} +1 -1
  39. package/dist/chunks/{hosted-profile-candidate-LVNKOTKJ.js → hosted-profile-candidate-EOBGKQAS.js} +1 -1
  40. package/dist/chunks/{hosted-profile-compiler-NBMUCZVS.js → hosted-profile-compiler-OZAOZ2ES.js} +1 -1
  41. package/dist/chunks/{hosted-profile-evaluation-control-7B3RAZU2.js → hosted-profile-evaluation-control-RJ6XJZCS.js} +1 -1
  42. package/dist/chunks/{hosted-profile-evaluation-inspection-FPCV42DD.js → hosted-profile-evaluation-inspection-SJIDXPHI.js} +1 -1
  43. package/dist/chunks/{hosted-profile-evaluation-preparation-I6H6RFT6.js → hosted-profile-evaluation-preparation-26EI5LJR.js} +1 -1
  44. package/dist/chunks/{human-review-HRGGACEM.js → human-review-AAVMISBF.js} +1 -1
  45. package/dist/chunks/{import-RSAQ44GG.js → import-V3HUGRHR.js} +1 -1
  46. package/dist/chunks/{opchat-I7ZWJ5XK.js → opchat-QK43DXTY.js} +1 -1
  47. package/dist/chunks/{organizations-LFCZIH7E.js → organizations-SRPAWKC7.js} +1 -1
  48. package/dist/chunks/{profile-EPIX5QVK.js → profile-C6CQNVYE.js} +1 -1
  49. package/dist/chunks/{project-agent-DGOPMECP.js → project-agent-GZV5HNYI.js} +1 -1
  50. package/dist/chunks/{sandbox-command-Q5F6VUOS.js → sandbox-command-4TJXQTKT.js} +1 -1
  51. package/dist/chunks/{sandbox-template-7GICPIKJ.js → sandbox-template-BBGGPJMI.js} +1 -1
  52. package/dist/chunks/{src-DH5AQ4Z7.js → src-CR6UZYTX.js} +1 -1
  53. package/dist/chunks/{src-MGP3OYHL.js → src-P3VYLFLI.js} +109 -109
  54. package/dist/chunks/{teams-bot-Z6RJGHME.js → teams-bot-7I4BAUVO.js} +1 -1
  55. package/dist/cli.js +1 -1
  56. package/dist/web/assets/App-CO2F717V.css +1 -0
  57. package/dist/web/assets/{App-Dg6mZIQk.js → App-CuhaCsfb.js} +65 -64
  58. package/dist/web/assets/{AppDialog-gcj3rrTZ.js → AppDialog-BdusXgU0.js} +1 -1
  59. package/dist/web/assets/{AppTerminalPanel-Be-E4qZF.js → AppTerminalPanel-C4uRpnBz.js} +2 -2
  60. package/dist/web/assets/{AppsView-BdyPNSpT.js → AppsView-BS1czXUP.js} +1 -1
  61. package/dist/web/assets/{BrowserSidebar-CcQxU0uO.js → BrowserSidebar-Bl7V6YO2.js} +1 -1
  62. package/dist/web/assets/{CartesianChart-CN5hB6rV.js → CartesianChart-BstFbsdn.js} +1 -1
  63. package/dist/web/assets/{CollaborationTabs-BiDPHgXG.js → CollaborationTabs-B8YAf0c1.js} +1 -1
  64. package/dist/web/assets/{CommandMenu-B2qJCgWH.js → CommandMenu-DZct7zUJ.js} +1 -1
  65. package/dist/web/assets/{CommunityView-D1aOQKfS.js → CommunityView-CR0-W-uG.js} +1 -1
  66. package/dist/web/assets/{ComposerCreateImproveStrip-f1tdD0QS.js → ComposerCreateImproveStrip-DR-Qo7b4.js} +1 -1
  67. package/dist/web/assets/{GetStartedView-CPYs0fYN.js → GetStartedView-xqQoMMei.js} +1 -1
  68. package/dist/web/assets/HostedModelLearningReview-CHxxf_Lu.js +1 -0
  69. package/dist/web/assets/{HostedModelLearningSettings-IEKRXOkG.js → HostedModelLearningSettings-De3i9wF4.js} +1 -1
  70. package/dist/web/assets/{LabModelVersionDetailPage-DkIa0oG_.js → LabModelVersionDetailPage-DAY1MmqP.js} +1 -1
  71. package/dist/web/assets/{LabSkillSidebar-BUlU1Ti-.js → LabSkillSidebar-DLnIgnry.js} +1 -1
  72. package/dist/web/assets/{LabsRoute-8cKFNq19.js → LabsRoute-CXJRJMhr.js} +4 -4
  73. package/dist/web/assets/{MainChatThread-C5GwaIl_.js → MainChatThread-BwAla81W.js} +2 -2
  74. package/dist/web/assets/{MainPane-SMqq5YAM.js → MainPane-CakOBCHw.js} +4 -4
  75. package/dist/web/assets/{MarkdownText-CLnvdLVg.js → MarkdownText-gJMuefaJ.js} +1 -1
  76. package/dist/web/assets/{NativeSkillSidebar-B9bVb00x.js → NativeSkillSidebar-Dlxb8iOC.js} +1 -1
  77. package/dist/web/assets/{NewExperienceSwitcher-CelgG7Ua.js → NewExperienceSwitcher-DM-cqJ-K.js} +1 -1
  78. package/dist/web/assets/{NewProjectDialog-eEnsg9s2.js → NewProjectDialog-Cu1q75gq.js} +1 -1
  79. package/dist/web/assets/{OutputsPage-ByvsTUW-.js → OutputsPage-DiXMkasl.js} +1 -1
  80. package/dist/web/assets/{ProjectsPage-Cl2zFh8X.js → ProjectsPage-DqiBHiCB.js} +1 -1
  81. package/dist/web/assets/{RightChatPanelStack-MnGscF87.js → RightChatPanelStack-VaOOmxwd.js} +1 -1
  82. package/dist/web/assets/{RightSidebarHomePanel-C6NXMYuy.js → RightSidebarHomePanel-CeSFJM5s.js} +1 -1
  83. package/dist/web/assets/{ScheduledWorkPage-DCb6d7Lg.js → ScheduledWorkPage-D1jRQxFs.js} +1 -1
  84. package/dist/web/assets/{SettingsView-BMFfrxmo.js → SettingsView-RA9OXgcu.js} +3 -3
  85. package/dist/web/assets/{TeamChatView-DW_v2B9E.js → TeamChatView-DM0adMtj.js} +1 -1
  86. package/dist/web/assets/{TerminalOverlay-BJ7qsr9F.js → TerminalOverlay-CFlH51DD.js} +1 -1
  87. package/dist/web/assets/{TrainingCreationPanel-GSIwP6f1.js → TrainingCreationPanel-CgIBVGha.js} +1 -1
  88. package/dist/web/assets/{TrainingDraftPanel-DorY6I29.js → TrainingDraftPanel-Bbo3RRie.js} +1 -1
  89. package/dist/web/assets/{UsageSettingsSection-DmzStI9q.js → UsageSettingsSection-CSRjJUSa.js} +1 -1
  90. package/dist/web/assets/{WorkSidebarPanel-zsJrGaaL.js → WorkSidebarPanel-DwlEMEoG.js} +1 -1
  91. package/dist/web/assets/WorkspaceDiffPanel-pGVezNMw.js +14 -0
  92. package/dist/web/assets/{WorkspaceEnvironmentMenu-vJw9hE0y.js → WorkspaceEnvironmentMenu-Byjngd9V.js} +1 -1
  93. package/dist/web/assets/{WorkspaceGitDialogs-BpL-xtRX.js → WorkspaceGitDialogs-Dgmg-6XG.js} +1 -1
  94. package/dist/web/assets/{WorkspaceMonacoEditor-CJ3x0GHH.js → WorkspaceMonacoEditor-BR4qxMgU.js} +3 -3
  95. package/dist/web/assets/{arrow-up-right-C60QSULo.js → arrow-up-right-H0pvnH2s.js} +1 -1
  96. package/dist/web/assets/{chunk-UHVJOMWN-BxgPi0yP.js → chunk-UHVJOMWN-BqXRe639.js} +1 -1
  97. package/dist/web/assets/{clipboard-QIy0Jd_K.js → clipboard-BZzZ82Bk.js} +1 -1
  98. package/dist/web/assets/{cloud-upload-B9L-_gy0.js → cloud-upload-CJPYPVl8.js} +1 -1
  99. package/dist/web/assets/{cssMode-ffPyPUW9.js → cssMode-WC4Rg1l-.js} +1 -1
  100. package/dist/web/assets/{folder-open-BFy7KXWm.js → folder-open-sLZJxLQy.js} +1 -1
  101. package/dist/web/assets/{folder-plus-C3iGtUOI.js → folder-plus-C84wrpt_.js} +1 -1
  102. package/dist/web/assets/{git-commit-horizontal-DsTniKvi.js → git-commit-horizontal-Cotm7KEC.js} +1 -1
  103. package/dist/web/assets/{htmlMode-7ytlsiyK.js → htmlMode-C6oZGeaB.js} +1 -1
  104. package/dist/web/assets/{index-BK8GmZmB.js → index-BxWTVKtn.js} +2 -2
  105. package/dist/web/assets/index-dSmk3FLJ.css +1 -0
  106. package/dist/web/assets/{info-C8mwoaIJ.js → info-Dc81lEfw.js} +1 -1
  107. package/dist/web/assets/{jsonMode-BT35NJi4.js → jsonMode-BET4LQIn.js} +1 -1
  108. package/dist/web/assets/{lspLanguageFeatures-BKAwIewO.js → lspLanguageFeatures-BPxA_-Kg.js} +1 -1
  109. package/dist/web/assets/{minimize-2-34MApatV.js → minimize-2-Bs7MVN3C.js} +1 -1
  110. package/dist/web/assets/{monaco.contribution-CxtX0z-m.js → monaco.contribution-7AUuf2NS.js} +2 -2
  111. package/dist/web/assets/{monaco.contribution-9diduNNi.js → monaco.contribution-BH6kkO4b.js} +2 -2
  112. package/dist/web/assets/{monaco.contribution-DVnPUDsR.js → monaco.contribution-DFzEyaHi.js} +2 -2
  113. package/dist/web/assets/{monaco.contribution-Dj4R5U8Z.js → monaco.contribution-DXzyQfVi.js} +2 -2
  114. package/dist/web/assets/{monitor-4JxqJ7wz.js → monitor-DXL019Wf.js} +1 -1
  115. package/dist/web/assets/{play-C4PtpamL.js → play-CXkxUZeU.js} +1 -1
  116. package/dist/web/assets/{python-0GVncePC.js → python-PzBkTjWx.js} +1 -1
  117. package/dist/web/assets/{save-DjB16eou.js → save-DpezrtH2.js} +1 -1
  118. package/dist/web/assets/{square-Coz7UQqd.js → square-oy7f5Ce6.js} +1 -1
  119. package/dist/web/assets/{toggleHighContrast-D-3108_3.js → toggleHighContrast-Cto-fOXm.js} +1 -1
  120. package/dist/web/assets/{tsMode-CV4ktqqR.js → tsMode-BYA4LNc6.js} +1 -1
  121. package/dist/web/assets/{upload-D007T9Hm.js → upload-C5YFNgtS.js} +1 -1
  122. package/dist/web/assets/{useLocalAgentSchedules-BXjFbAVS.js → useLocalAgentSchedules-CnyTsqlf.js} +1 -1
  123. package/dist/web/assets/useProviderSettings-B_KeQjE5.js +5 -0
  124. package/dist/web/assets/{useSessionTurnCache-Bee6zbC_.js → useSessionTurnCache-DICuJSJW.js} +1 -1
  125. package/dist/web/assets/{wifi-off-BbNZc0za.js → wifi-off-nzHj7JXp.js} +1 -1
  126. package/dist/web/assets/{workers-DNQ5ne3z.js → workers-Dboaw6f_.js} +1 -1
  127. package/dist/web/assets/{yaml-BfAho-gB.js → yaml-uuY5JmO8.js} +1 -1
  128. package/dist/web/index.html +2 -2
  129. package/package.json +1 -1
  130. package/dist/web/assets/App-DkH8CeoI.css +0 -1
  131. package/dist/web/assets/HostedModelLearningReview-DVfJyUW_.js +0 -1
  132. package/dist/web/assets/WorkspaceDiffPanel-CiFsZjMm.js +0 -14
  133. package/dist/web/assets/index-C0H85uUI.css +0 -1
  134. package/dist/web/assets/useProviderSettings-SY7mp-5B.js +0 -5
  135. /package/dist/chunks/{chunk-XDMUD4FW.js → chunk-2JO2KWT3.js} +0 -0
  136. /package/dist/chunks/{chunk-XBCIBAXD.js → chunk-GS2NKNKG.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{g as m0}from"./chunk-QJRXTIOC.js";import{c as j0}from"./chunk-IR3YJWPW.js";import{y as c0}from"./chunk-WV2APYWG.js";import{b as R,xa as u0}from"./chunk-PJM2G7SG.js";import{b as g}from"./chunk-ES2ISFJC.js";import{a as r,b as $0,c as _0,e as xx}from"./chunk-FTQLQJQV.js";var M0=_0((F8,w0)=>{"use strict";var Bx=Object.create,J=Object.defineProperty,rx=Object.getOwnPropertyDescriptor,C0=Object.getOwnPropertyNames,Ex=Object.getPrototypeOf,fx=Object.prototype.hasOwnProperty,jx=r((v,E,f)=>E in v?J(v,E,{enumerable:!0,configurable:!0,writable:!0,value:f}):v[E]=f,"__defNormalProp"),bx=r((v,E)=>function(){return v&&(E=(0,v[C0(v)[0]])(v=0)),E},"__esm"),Cx=r((v,E)=>function(){return E||(0,v[C0(v)[0]])((E={exports:{}}).exports,E),E.exports},"__commonJS"),H0=r((v,E)=>{for(var f in E)J(v,f,{get:E[f],enumerable:!0})},"__export"),y0=r((v,E,f,C)=>{if(E&&typeof E=="object"||typeof E=="function")for(let b of C0(E))!fx.call(v,b)&&b!==f&&J(v,b,{get:r(()=>E[b],"get"),enumerable:!(C=rx(E,b))||C.enumerable});return v},"__copyProps"),Dx=r((v,E,f)=>(f=v!=null?Bx(Ex(v)):{},y0(E||!v||!v.__esModule?J(f,"default",{value:v,enumerable:!0}):f,v)),"__toESM"),tx=r(v=>y0(J({},"__esModule",{value:!0}),v),"__toCommonJS"),ex=r((v,E,f)=>(jx(v,typeof E!="symbol"?E+"":E,f),f),"__publicField"),h0={};H0(h0,{QuickJSFFI:r(()=>L0,"QuickJSFFI")});var L0,ax=bx({"src/ffi.ts"(){"use strict";L0=class{static{r(this,"QuickJSFFI")}constructor(v){this.module=v,this.DEBUG=!1,this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]),this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]),this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]),this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]),this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]),this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]),this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]),this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]),this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]),this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]),this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]),this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]),this.QTS_NewHostRef=this.module.cwrap("QTS_NewHostRef","number",["number","number"]),this.QTS_GetHostRefId=this.module.cwrap("QTS_GetHostRefId","number",["number"]),this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]),this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]),this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]),this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]),this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]),this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]),this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]),this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]),this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]),this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]),this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]),this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]),this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]),this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]),this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]),this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]),this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]),this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]),this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]),this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]),this.QTS_GetSymbolDescriptionOrKey=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]),this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]),this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]),this.QTS_ExecutePendingJob=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]),this.QTS_GetProp=this.module.cwrap("QTS_GetProp","number",["number","number","number"]),this.QTS_GetPropNumber=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]),this.QTS_SetProp=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]),this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]),this.QTS_GetOwnPropertyNames=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]),this.QTS_Call=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]),this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]),this.QTS_Dump=this.module.cwrap("QTS_Dump","number",["number","number"]),this.QTS_Eval=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]),this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]),this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]),this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]),this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]),this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]),this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]),this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]),this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]),this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]),this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]),this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]),this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]),this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]),this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","string","number","boolean","number"]),this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]),this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]),this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]),this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]),this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]),this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]),this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"])}}}}),nx=Cx({"dist/emscripten-module.cjs"(v,E){"use strict";var f=(()=>{var C=globalThis.document?.currentScript?.src;return async function(b={}){var t,x=b,S=!!globalThis.window,i=!!globalThis.WorkerGlobalScope,q=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";function l(F){F={log:F||function(){}};for(let B of l.Pa)B(F);return x.quickJSEmscriptenExtensions=F}r(l,"q"),l.Pa=[],x.quickjsEmscriptenInit=l,l.Pa.push(F=>{F.getWasmMemory=function(){return M}});var D="./this.program",a=r((F,B)=>{throw B},"u");if(typeof __filename<"u"?C=__filename:i&&(C=self.location.href),q){var n=$0("fs");1<process.argv.length&&(D=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),a=r((F,B)=>{throw process.exitCode=F,B},"u")}else if(S||i)try{new URL(".",C)}catch{}var G=console.log.bind(console),u=console.error.bind(console),o=!1,p;function L(F){for(var B=0,A=F.length,j=new Uint8Array(A),e;B<A;++B)e=F.charCodeAt(B),j[B]=~e>>8&e;return j}r(L,"ca");var Z,W,K,c,Q,H,D0=!1;function t0(){var F=M.buffer;x.HEAP8=K=new Int8Array(F),new Int16Array(F),x.HEAPU8=c=new Uint8Array(F),new Uint16Array(F),Q=new Int32Array(F),H=new Uint32Array(F),new Float32Array(F),new Float64Array(F),new BigInt64Array(F),new BigUint64Array(F)}r(t0,"H");function x0(F){throw x.onAbort?.(F),F="Aborted("+F+")",u(F),o=!0,F=new WebAssembly.RuntimeError(F+". Build with -sASSERTIONS for more info."),W?.(F),F}r(x0,"I");var A0;async function X0(F){return F}r(X0,"da");async function Z0(F){var B=A0;try{var A=await X0(B);return await WebAssembly.instantiate(A,F)}catch(j){u(`failed to asynchronously prepare wasm: ${j}`),x0(j)}}r(Z0,"ea");async function K0(F){return Z0(F)}r(K0,"fa");class F0{static{r(this,"K")}constructor(B){ex(this,"name","ExitStatus"),this.message=`Program terminated with exit(${B})`,this.status=B}}for(var e0=F=>{for(;0<F.length;)F.shift()(x)},a0=[],n0=[],P0=()=>{var F=x.preRun.shift();n0.push(F)},z=!0,M,i0=new TextDecoder,o0=(F,B,A,j)=>{if(A=B+A,j)return A;for(;F[B]&&!(B>=A);)++B;return B},I=(F,B,A)=>F?i0.decode(c.subarray(F,o0(c,F,B,A))):"",v0=0,O0=[0,31,60,91,121,152,182,213,244,274,305,335],J0=[0,31,59,90,120,151,181,212,243,273,304,334],P={},s0=F=>{p=F,z||0<v0||(x.onExit?.(F),o=!0),a(F,new F0(F))},U0=F=>{if(!o)try{F()}catch(B){B instanceof F0||B=="unwind"||a(1,B)}finally{if(!(z||0<v0))try{p=F=p,s0(F)}catch(B){B instanceof F0||B=="unwind"||a(1,B)}}},N=(F,B,A)=>{var j=c;if(!(0<A))return 0;var e=B;A=B+A-1;for(var s=0;s<F.length;++s){var k=F.codePointAt(s);if(127>=k){if(B>=A)break;j[B++]=k}else if(2047>=k){if(B+1>=A)break;j[B++]=192|k>>6,j[B++]=128|k&63}else if(65535>=k){if(B+2>=A)break;j[B++]=224|k>>12,j[B++]=128|k>>6&63,j[B++]=128|k&63}else{if(B+3>=A)break;j[B++]=240|k>>18,j[B++]=128|k>>12&63,j[B++]=128|k>>6&63,j[B++]=128|k&63,s++}}return j[B]=0,B-e},B0={},k0=()=>{if(!r0){var F={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:D||"./this.program"},B;for(B in B0)B0[B]===void 0?delete F[B]:F[B]=B0[B];var A=[];for(B in F)A.push(`${B}=${F[B]}`);r0=A}return r0},r0,E0=F=>{for(var B=0,A=0;A<F.length;++A){var j=F.charCodeAt(A);127>=j?B++:2047>=j?B+=2:55296<=j&&57343>=j?(B+=4,++A):B+=3}return B},W0=[null,[],[]],z0=(F,B,A,j)=>{var e={string:r(d=>{var m=0;if(d!=null&&d!==0){m=E0(d)+1;var h=f0(m);N(d,h,m),m=h}return m},"string"),array:r(d=>{var m=f0(d.length);return K.set(d,m),m},"array")};F=x["_"+F];var s=[],k=0;if(j)for(var T=0;T<j.length;T++){var V=e[A[T]];V?(k===0&&(k=q0()),s[T]=V(j[T])):s[T]=j[T]}return A=F(...s),A=(function(d){return k!==0&&l0(k),B==="string"?I(d):B==="boolean"?!!d:d})(A)},O=new Uint8Array(123),w=25;0<=w;--w)O[48+w]=52+w,O[65+w]=w,O[97+w]=26+w;if(O[43]=62,O[47]=63,x.wasmMemory?M=x.wasmMemory:M=new WebAssembly.Memory({initial:(x.INITIAL_MEMORY||16777216)/65536,maximum:32768}),t0(),x.noExitRuntime&&(z=x.noExitRuntime),x.print&&(G=x.print),x.printErr&&(u=x.printErr),x.thisProgram&&(D=x.thisProgram),x.preInit)for(typeof x.preInit=="function"&&(x.preInit=[x.preInit]);0<x.preInit.length;)x.preInit.shift()();x.cwrap=(F,B,A,j)=>{var e=!A||A.every(s=>s==="number"||s==="boolean");return B!=="string"&&e&&!j?x["_"+F]:(...s)=>z0(F,B,A,s)},x.UTF8ToString=I,x.stringToUTF8=(F,B,A)=>N(F,B,A),x.lengthBytesUTF8=E0;var p0,l0,f0,q0,Y0={b:r((F,B,A,j)=>x0(`Assertion failed: ${I(F)}, at: `+[B?I(B):"unknown filename",A,j?I(j):"unknown function"]),"b"),q:r(()=>x0(""),"q"),l:r(()=>{z=!1,v0=0},"l"),m:r(function(F,B){F=-9007199254740992>F||9007199254740992<F?NaN:Number(F),F=new Date(1e3*F),Q[B>>2]=F.getSeconds(),Q[B+4>>2]=F.getMinutes(),Q[B+8>>2]=F.getHours(),Q[B+12>>2]=F.getDate(),Q[B+16>>2]=F.getMonth(),Q[B+20>>2]=F.getFullYear()-1900,Q[B+24>>2]=F.getDay();var A=F.getFullYear();Q[B+28>>2]=(A%4!==0||A%100===0&&A%400!==0?J0:O0)[F.getMonth()]+F.getDate()-1|0,Q[B+36>>2]=-(60*F.getTimezoneOffset()),A=new Date(F.getFullYear(),6,1).getTimezoneOffset();var j=new Date(F.getFullYear(),0,1).getTimezoneOffset();Q[B+32>>2]=(A!=j&&F.getTimezoneOffset()==Math.min(j,A))|0},"m"),j:r((F,B)=>{if(P[F]&&(clearTimeout(P[F].id),delete P[F]),!B)return 0;var A=setTimeout(()=>{delete P[F],U0(()=>p0(F,performance.now()))},B);return P[F]={id:A,Qa:B},0},"j"),n:r((F,B,A,j)=>{var e=new Date().getFullYear(),s=new Date(e,0,1).getTimezoneOffset();e=new Date(e,6,1).getTimezoneOffset(),H[F>>2]=60*Math.max(s,e),Q[B>>2]=+(s!=e),B=r(k=>{var T=Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(T/60)).padStart(2,"0")}${String(T%60).padStart(2,"0")}`},"d"),F=B(s),B=B(e),e<s?(N(F,A,17),N(B,j,17)):(N(F,j,17),N(B,A,17))},"n"),p:r(()=>Date.now(),"p"),k:r(F=>{var B=c.length;if(F>>>=0,2147483648<F)return!1;for(var A=1;4>=A;A*=2){var j=B*(1+.2/A);j=Math.min(j,F+100663296);x:{j=(Math.min(2147483648,65536*Math.ceil(Math.max(F,j)/65536))-M.buffer.byteLength+65535)/65536|0;try{M.grow(j),t0();var e=1;break x}catch{}e=void 0}if(e)return!0}return!1},"k"),e:r((F,B)=>{var A=0,j=0,e;for(e of k0()){var s=B+A;H[F+j>>2]=s,A+=N(e,s,1/0)+1,j+=4}return 0},"e"),f:r((F,B)=>{var A=k0();H[F>>2]=A.length,F=0;for(var j of A)F+=E0(j)+1;return H[B>>2]=F,0},"f"),d:r(()=>52,"d"),o:r(function(){return 70},"o"),c:r((F,B,A,j)=>{for(var e=0,s=0;s<A;s++){var k=H[B>>2],T=H[B+4>>2];B+=8;for(var V=0;V<T;V++){var d=F,m=c[k+V],h=W0[d];m===0||m===10?(d=d===1?G:u,m=o0(h,0),m=i0.decode(h.buffer?h.subarray(0,m):new Uint8Array(h.slice(0,m))),d(m),h.length=0):h.push(m)}e+=T}return H[j>>2]=e,0},"c"),a:M,r:s0,s:r(function(F,B,A,j,e){return x.callbacks.callFunction(void 0,F,B,A,j,e)},"s"),i:r(function(F){return x.callbacks.shouldInterrupt(void 0,F)},"i"),h:r(function(F,B,A){return A=I(A),x.callbacks.loadModuleSource(void 0,F,B,A)},"h"),g:r(function(F,B,A,j){return A=I(A),j=I(j),x.callbacks.normalizeModule(void 0,F,B,A,j)},"g"),t:r(function(F,B){x.callbacks.freeHostRef(void 0,F,B)},"t")},Y;return Y=await(async function(){function F(A){return A=Y=A.exports,x._malloc=A.v,x._QTS_Throw=A.w,x._QTS_NewError=A.x,x._QTS_RuntimeSetMemoryLimit=A.y,x._QTS_RuntimeComputeMemoryUsage=A.z,x._QTS_RuntimeDumpMemoryUsage=A.A,x._QTS_RecoverableLeakCheck=A.B,x._QTS_BuildIsSanitizeLeak=A.C,x._QTS_RuntimeSetMaxStackSize=A.D,x._QTS_GetUndefined=A.E,x._QTS_GetNull=A.F,x._QTS_GetFalse=A.G,x._QTS_GetTrue=A.H,x._QTS_NewHostRef=A.I,x._QTS_GetHostRefId=A.J,x._QTS_NewRuntime=A.K,x._QTS_FreeRuntime=A.L,x._free=A.M,x._QTS_NewContext=A.N,x._QTS_FreeContext=A.O,x._QTS_FreeValuePointer=A.P,x._QTS_FreeValuePointerRuntime=A.Q,x._QTS_FreeVoidPointer=A.R,x._QTS_FreeCString=A.S,x._QTS_DupValuePointer=A.T,x._QTS_NewObject=A.U,x._QTS_NewObjectProto=A.V,x._QTS_NewArray=A.W,x._QTS_NewArrayBuffer=A.X,x._QTS_NewFloat64=A.Y,x._QTS_GetFloat64=A.Z,x._QTS_NewString=A._,x._QTS_GetString=A.$,x._QTS_GetArrayBuffer=A.aa,x._QTS_GetArrayBufferLength=A.ba,x._QTS_NewSymbol=A.ca,x._QTS_GetSymbolDescriptionOrKey=A.da,x._QTS_IsGlobalSymbol=A.ea,x._QTS_IsJobPending=A.fa,x._QTS_ExecutePendingJob=A.ga,x._QTS_GetProp=A.ha,x._QTS_GetPropNumber=A.ia,x._QTS_SetProp=A.ja,x._QTS_DefineProp=A.ka,x._QTS_GetOwnPropertyNames=A.la,x._QTS_Call=A.ma,x._QTS_ResolveException=A.na,x._QTS_Dump=A.oa,x._QTS_Eval=A.pa,x._QTS_GetModuleNamespace=A.qa,x._QTS_Typeof=A.ra,x._QTS_GetLength=A.sa,x._QTS_IsEqual=A.ta,x._QTS_GetGlobalObject=A.ua,x._QTS_NewPromiseCapability=A.va,x._QTS_PromiseState=A.wa,x._QTS_PromiseResult=A.xa,x._QTS_TestStringArg=A.ya,x._QTS_GetDebugLogEnabled=A.za,x._QTS_SetDebugLogEnabled=A.Aa,x._QTS_BuildIsDebug=A.Ba,x._QTS_BuildIsAsyncify=A.Ca,x._QTS_NewFunction=A.Da,x._QTS_ArgvGetJSValueConstPointer=A.Ea,x._QTS_RuntimeEnableInterruptHandler=A.Fa,x._QTS_RuntimeDisableInterruptHandler=A.Ga,x._QTS_RuntimeEnableModuleLoader=A.Ha,x._QTS_RuntimeDisableModuleLoader=A.Ia,x._QTS_bjson_encode=A.Ja,x._QTS_bjson_decode=A.Ka,p0=A.La,l0=A.Ma,f0=A.Na,q0=A.Oa,Y}r(F,"b");var B={a:Y0};return x.instantiateWasm?new Promise(A=>{x.instantiateWasm(B,(j,e)=>{A(F(j,e))})}):(A0??(A0=L(`\0asm\0\0\0\xBEi\`\x7F\x7F\0\`\x7F\x7F\x7F\x7F\`\x7F~\x7F\x7F~\`\x7F\x7F\x7F\`\x7F\x7F\`\x7F~\x7F\x7F\x7F~\`\x7F\x7F\x7F\0\`\x7F~~\`\x7F\x7F\x7F\x7F\x7F\`\x7F\0\`\x7F~\0\`\x7F~\x7F\`||\`\x7F\x7F~\`\x7F\x7F~\x7F\`\x7F~\x7F\x7F\x7F\x7F~\`\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F~\x7F~\`\x7F~\x7F\0\`\x7F\x7F\x7F\x7F\0\`\x7F~\x7F\x7F\`\x7F~~~\`\x7F\x7F\x7F~\`\x7F~~\x7F\x7F\x7F~\`\x7F\x7F~\x7F\x7F\`\x7F~~\x7F\`\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F~~\x7F\x7F~\`\x7F\x7F\x7F\x7F~\`|||\`\0\x7F\`\x7F~\x7F\x7F\x7F\`~\x7F\`\0\0\`\x7F~\`\x07\x7F~\x7F~~~\x7F\x7F\`\x7F~\x7F~\x7F\x7F\`\x7F~~\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F~\x7F\`\x7F~~~\x7F\x7F\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`~~\`\x7F|\x7F\`\x7F~\x7F~~\`\x7F~\x7F~~\x7F\x7F\`~\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F~\`\x7F~\x7F\x7F\0\`\x7F\x7F|\`\x07\x7F~\x7F\x7F\x7F\x7F\x7F~\`~\x7F\0\`\x7F\x7F~\0\`\x7F~~\x7F~\`\x7F~\x7F~\x7F\`\x7F~\x7F~\0\`\x7F~~~\x7F\` \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\x7F~\`~\x7F\x7F\x7F\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F~\x7F\x7F\x7F\x7F\`\x7F\x7F~~\`|\x7F\`\x7F~~\x7F\x7F\0\`\x7F~~\x7F\0\`|\x7F|\`||\x7F|\`\x7F\x7F~\x7F\0\`\x7F~~~~\x7F\x7F\`\x7F\x7F~~\x7F\`\x7F~~\x7F\x7F\x7F\`\x7F|\x7F\x7F\x7F\x7F\x7F\`\0|\`\x7F~\x7F~\x7F~\`\r\x7F\x7F\x7F\x7F\x7F\x7F\x7F~\x7F\x7F\x7F\x7F\x7F~\`\x7F\x7F~\x7F\x7F\x7F\`\x7F\x7F~~~~\x7F\`\x7F\x7F~\x7F~\`\x07\x7F~~~\x7F\x7F\x7F~\`\x7F|\`\x7F|\x7F\x7F\x7F~\`\b\x7F~~\x7F\x7F\x7F\x7F\x7F~\`\x7F~\x7F\x7F\x7F\x7F\0\`\b\x7F\x7F\x7F\x7F\x7F\x7F~\x7F~\`\x7F~\x7F\x7F\x7F\x7F\x7F\`
2
+ import{g as m0}from"./chunk-USKE34VR.js";import{c as j0}from"./chunk-IR3YJWPW.js";import{y as c0}from"./chunk-WV2APYWG.js";import{b as R,xa as u0}from"./chunk-PJM2G7SG.js";import{b as g}from"./chunk-ES2ISFJC.js";import{a as r,b as $0,c as _0,e as xx}from"./chunk-FTQLQJQV.js";var M0=_0((F8,w0)=>{"use strict";var Bx=Object.create,J=Object.defineProperty,rx=Object.getOwnPropertyDescriptor,C0=Object.getOwnPropertyNames,Ex=Object.getPrototypeOf,fx=Object.prototype.hasOwnProperty,jx=r((v,E,f)=>E in v?J(v,E,{enumerable:!0,configurable:!0,writable:!0,value:f}):v[E]=f,"__defNormalProp"),bx=r((v,E)=>function(){return v&&(E=(0,v[C0(v)[0]])(v=0)),E},"__esm"),Cx=r((v,E)=>function(){return E||(0,v[C0(v)[0]])((E={exports:{}}).exports,E),E.exports},"__commonJS"),H0=r((v,E)=>{for(var f in E)J(v,f,{get:E[f],enumerable:!0})},"__export"),y0=r((v,E,f,C)=>{if(E&&typeof E=="object"||typeof E=="function")for(let b of C0(E))!fx.call(v,b)&&b!==f&&J(v,b,{get:r(()=>E[b],"get"),enumerable:!(C=rx(E,b))||C.enumerable});return v},"__copyProps"),Dx=r((v,E,f)=>(f=v!=null?Bx(Ex(v)):{},y0(E||!v||!v.__esModule?J(f,"default",{value:v,enumerable:!0}):f,v)),"__toESM"),tx=r(v=>y0(J({},"__esModule",{value:!0}),v),"__toCommonJS"),ex=r((v,E,f)=>(jx(v,typeof E!="symbol"?E+"":E,f),f),"__publicField"),h0={};H0(h0,{QuickJSFFI:r(()=>L0,"QuickJSFFI")});var L0,ax=bx({"src/ffi.ts"(){"use strict";L0=class{static{r(this,"QuickJSFFI")}constructor(v){this.module=v,this.DEBUG=!1,this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]),this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]),this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]),this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]),this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]),this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]),this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]),this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]),this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]),this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]),this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]),this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]),this.QTS_NewHostRef=this.module.cwrap("QTS_NewHostRef","number",["number","number"]),this.QTS_GetHostRefId=this.module.cwrap("QTS_GetHostRefId","number",["number"]),this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]),this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]),this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]),this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]),this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]),this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]),this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]),this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]),this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]),this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]),this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]),this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]),this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]),this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]),this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]),this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]),this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]),this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]),this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]),this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]),this.QTS_GetSymbolDescriptionOrKey=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]),this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]),this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]),this.QTS_ExecutePendingJob=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]),this.QTS_GetProp=this.module.cwrap("QTS_GetProp","number",["number","number","number"]),this.QTS_GetPropNumber=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]),this.QTS_SetProp=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]),this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]),this.QTS_GetOwnPropertyNames=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]),this.QTS_Call=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]),this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]),this.QTS_Dump=this.module.cwrap("QTS_Dump","number",["number","number"]),this.QTS_Eval=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]),this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]),this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]),this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]),this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]),this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]),this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]),this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]),this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]),this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]),this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]),this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]),this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]),this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]),this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","string","number","boolean","number"]),this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]),this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]),this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]),this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]),this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]),this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]),this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"])}}}}),nx=Cx({"dist/emscripten-module.cjs"(v,E){"use strict";var f=(()=>{var C=globalThis.document?.currentScript?.src;return async function(b={}){var t,x=b,S=!!globalThis.window,i=!!globalThis.WorkerGlobalScope,q=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";function l(F){F={log:F||function(){}};for(let B of l.Pa)B(F);return x.quickJSEmscriptenExtensions=F}r(l,"q"),l.Pa=[],x.quickjsEmscriptenInit=l,l.Pa.push(F=>{F.getWasmMemory=function(){return M}});var D="./this.program",a=r((F,B)=>{throw B},"u");if(typeof __filename<"u"?C=__filename:i&&(C=self.location.href),q){var n=$0("fs");1<process.argv.length&&(D=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),a=r((F,B)=>{throw process.exitCode=F,B},"u")}else if(S||i)try{new URL(".",C)}catch{}var G=console.log.bind(console),u=console.error.bind(console),o=!1,p;function L(F){for(var B=0,A=F.length,j=new Uint8Array(A),e;B<A;++B)e=F.charCodeAt(B),j[B]=~e>>8&e;return j}r(L,"ca");var Z,W,K,c,Q,H,D0=!1;function t0(){var F=M.buffer;x.HEAP8=K=new Int8Array(F),new Int16Array(F),x.HEAPU8=c=new Uint8Array(F),new Uint16Array(F),Q=new Int32Array(F),H=new Uint32Array(F),new Float32Array(F),new Float64Array(F),new BigInt64Array(F),new BigUint64Array(F)}r(t0,"H");function x0(F){throw x.onAbort?.(F),F="Aborted("+F+")",u(F),o=!0,F=new WebAssembly.RuntimeError(F+". Build with -sASSERTIONS for more info."),W?.(F),F}r(x0,"I");var A0;async function X0(F){return F}r(X0,"da");async function Z0(F){var B=A0;try{var A=await X0(B);return await WebAssembly.instantiate(A,F)}catch(j){u(`failed to asynchronously prepare wasm: ${j}`),x0(j)}}r(Z0,"ea");async function K0(F){return Z0(F)}r(K0,"fa");class F0{static{r(this,"K")}constructor(B){ex(this,"name","ExitStatus"),this.message=`Program terminated with exit(${B})`,this.status=B}}for(var e0=F=>{for(;0<F.length;)F.shift()(x)},a0=[],n0=[],P0=()=>{var F=x.preRun.shift();n0.push(F)},z=!0,M,i0=new TextDecoder,o0=(F,B,A,j)=>{if(A=B+A,j)return A;for(;F[B]&&!(B>=A);)++B;return B},I=(F,B,A)=>F?i0.decode(c.subarray(F,o0(c,F,B,A))):"",v0=0,O0=[0,31,60,91,121,152,182,213,244,274,305,335],J0=[0,31,59,90,120,151,181,212,243,273,304,334],P={},s0=F=>{p=F,z||0<v0||(x.onExit?.(F),o=!0),a(F,new F0(F))},U0=F=>{if(!o)try{F()}catch(B){B instanceof F0||B=="unwind"||a(1,B)}finally{if(!(z||0<v0))try{p=F=p,s0(F)}catch(B){B instanceof F0||B=="unwind"||a(1,B)}}},N=(F,B,A)=>{var j=c;if(!(0<A))return 0;var e=B;A=B+A-1;for(var s=0;s<F.length;++s){var k=F.codePointAt(s);if(127>=k){if(B>=A)break;j[B++]=k}else if(2047>=k){if(B+1>=A)break;j[B++]=192|k>>6,j[B++]=128|k&63}else if(65535>=k){if(B+2>=A)break;j[B++]=224|k>>12,j[B++]=128|k>>6&63,j[B++]=128|k&63}else{if(B+3>=A)break;j[B++]=240|k>>18,j[B++]=128|k>>12&63,j[B++]=128|k>>6&63,j[B++]=128|k&63,s++}}return j[B]=0,B-e},B0={},k0=()=>{if(!r0){var F={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:D||"./this.program"},B;for(B in B0)B0[B]===void 0?delete F[B]:F[B]=B0[B];var A=[];for(B in F)A.push(`${B}=${F[B]}`);r0=A}return r0},r0,E0=F=>{for(var B=0,A=0;A<F.length;++A){var j=F.charCodeAt(A);127>=j?B++:2047>=j?B+=2:55296<=j&&57343>=j?(B+=4,++A):B+=3}return B},W0=[null,[],[]],z0=(F,B,A,j)=>{var e={string:r(d=>{var m=0;if(d!=null&&d!==0){m=E0(d)+1;var h=f0(m);N(d,h,m),m=h}return m},"string"),array:r(d=>{var m=f0(d.length);return K.set(d,m),m},"array")};F=x["_"+F];var s=[],k=0;if(j)for(var T=0;T<j.length;T++){var V=e[A[T]];V?(k===0&&(k=q0()),s[T]=V(j[T])):s[T]=j[T]}return A=F(...s),A=(function(d){return k!==0&&l0(k),B==="string"?I(d):B==="boolean"?!!d:d})(A)},O=new Uint8Array(123),w=25;0<=w;--w)O[48+w]=52+w,O[65+w]=w,O[97+w]=26+w;if(O[43]=62,O[47]=63,x.wasmMemory?M=x.wasmMemory:M=new WebAssembly.Memory({initial:(x.INITIAL_MEMORY||16777216)/65536,maximum:32768}),t0(),x.noExitRuntime&&(z=x.noExitRuntime),x.print&&(G=x.print),x.printErr&&(u=x.printErr),x.thisProgram&&(D=x.thisProgram),x.preInit)for(typeof x.preInit=="function"&&(x.preInit=[x.preInit]);0<x.preInit.length;)x.preInit.shift()();x.cwrap=(F,B,A,j)=>{var e=!A||A.every(s=>s==="number"||s==="boolean");return B!=="string"&&e&&!j?x["_"+F]:(...s)=>z0(F,B,A,s)},x.UTF8ToString=I,x.stringToUTF8=(F,B,A)=>N(F,B,A),x.lengthBytesUTF8=E0;var p0,l0,f0,q0,Y0={b:r((F,B,A,j)=>x0(`Assertion failed: ${I(F)}, at: `+[B?I(B):"unknown filename",A,j?I(j):"unknown function"]),"b"),q:r(()=>x0(""),"q"),l:r(()=>{z=!1,v0=0},"l"),m:r(function(F,B){F=-9007199254740992>F||9007199254740992<F?NaN:Number(F),F=new Date(1e3*F),Q[B>>2]=F.getSeconds(),Q[B+4>>2]=F.getMinutes(),Q[B+8>>2]=F.getHours(),Q[B+12>>2]=F.getDate(),Q[B+16>>2]=F.getMonth(),Q[B+20>>2]=F.getFullYear()-1900,Q[B+24>>2]=F.getDay();var A=F.getFullYear();Q[B+28>>2]=(A%4!==0||A%100===0&&A%400!==0?J0:O0)[F.getMonth()]+F.getDate()-1|0,Q[B+36>>2]=-(60*F.getTimezoneOffset()),A=new Date(F.getFullYear(),6,1).getTimezoneOffset();var j=new Date(F.getFullYear(),0,1).getTimezoneOffset();Q[B+32>>2]=(A!=j&&F.getTimezoneOffset()==Math.min(j,A))|0},"m"),j:r((F,B)=>{if(P[F]&&(clearTimeout(P[F].id),delete P[F]),!B)return 0;var A=setTimeout(()=>{delete P[F],U0(()=>p0(F,performance.now()))},B);return P[F]={id:A,Qa:B},0},"j"),n:r((F,B,A,j)=>{var e=new Date().getFullYear(),s=new Date(e,0,1).getTimezoneOffset();e=new Date(e,6,1).getTimezoneOffset(),H[F>>2]=60*Math.max(s,e),Q[B>>2]=+(s!=e),B=r(k=>{var T=Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(T/60)).padStart(2,"0")}${String(T%60).padStart(2,"0")}`},"d"),F=B(s),B=B(e),e<s?(N(F,A,17),N(B,j,17)):(N(F,j,17),N(B,A,17))},"n"),p:r(()=>Date.now(),"p"),k:r(F=>{var B=c.length;if(F>>>=0,2147483648<F)return!1;for(var A=1;4>=A;A*=2){var j=B*(1+.2/A);j=Math.min(j,F+100663296);x:{j=(Math.min(2147483648,65536*Math.ceil(Math.max(F,j)/65536))-M.buffer.byteLength+65535)/65536|0;try{M.grow(j),t0();var e=1;break x}catch{}e=void 0}if(e)return!0}return!1},"k"),e:r((F,B)=>{var A=0,j=0,e;for(e of k0()){var s=B+A;H[F+j>>2]=s,A+=N(e,s,1/0)+1,j+=4}return 0},"e"),f:r((F,B)=>{var A=k0();H[F>>2]=A.length,F=0;for(var j of A)F+=E0(j)+1;return H[B>>2]=F,0},"f"),d:r(()=>52,"d"),o:r(function(){return 70},"o"),c:r((F,B,A,j)=>{for(var e=0,s=0;s<A;s++){var k=H[B>>2],T=H[B+4>>2];B+=8;for(var V=0;V<T;V++){var d=F,m=c[k+V],h=W0[d];m===0||m===10?(d=d===1?G:u,m=o0(h,0),m=i0.decode(h.buffer?h.subarray(0,m):new Uint8Array(h.slice(0,m))),d(m),h.length=0):h.push(m)}e+=T}return H[j>>2]=e,0},"c"),a:M,r:s0,s:r(function(F,B,A,j,e){return x.callbacks.callFunction(void 0,F,B,A,j,e)},"s"),i:r(function(F){return x.callbacks.shouldInterrupt(void 0,F)},"i"),h:r(function(F,B,A){return A=I(A),x.callbacks.loadModuleSource(void 0,F,B,A)},"h"),g:r(function(F,B,A,j){return A=I(A),j=I(j),x.callbacks.normalizeModule(void 0,F,B,A,j)},"g"),t:r(function(F,B){x.callbacks.freeHostRef(void 0,F,B)},"t")},Y;return Y=await(async function(){function F(A){return A=Y=A.exports,x._malloc=A.v,x._QTS_Throw=A.w,x._QTS_NewError=A.x,x._QTS_RuntimeSetMemoryLimit=A.y,x._QTS_RuntimeComputeMemoryUsage=A.z,x._QTS_RuntimeDumpMemoryUsage=A.A,x._QTS_RecoverableLeakCheck=A.B,x._QTS_BuildIsSanitizeLeak=A.C,x._QTS_RuntimeSetMaxStackSize=A.D,x._QTS_GetUndefined=A.E,x._QTS_GetNull=A.F,x._QTS_GetFalse=A.G,x._QTS_GetTrue=A.H,x._QTS_NewHostRef=A.I,x._QTS_GetHostRefId=A.J,x._QTS_NewRuntime=A.K,x._QTS_FreeRuntime=A.L,x._free=A.M,x._QTS_NewContext=A.N,x._QTS_FreeContext=A.O,x._QTS_FreeValuePointer=A.P,x._QTS_FreeValuePointerRuntime=A.Q,x._QTS_FreeVoidPointer=A.R,x._QTS_FreeCString=A.S,x._QTS_DupValuePointer=A.T,x._QTS_NewObject=A.U,x._QTS_NewObjectProto=A.V,x._QTS_NewArray=A.W,x._QTS_NewArrayBuffer=A.X,x._QTS_NewFloat64=A.Y,x._QTS_GetFloat64=A.Z,x._QTS_NewString=A._,x._QTS_GetString=A.$,x._QTS_GetArrayBuffer=A.aa,x._QTS_GetArrayBufferLength=A.ba,x._QTS_NewSymbol=A.ca,x._QTS_GetSymbolDescriptionOrKey=A.da,x._QTS_IsGlobalSymbol=A.ea,x._QTS_IsJobPending=A.fa,x._QTS_ExecutePendingJob=A.ga,x._QTS_GetProp=A.ha,x._QTS_GetPropNumber=A.ia,x._QTS_SetProp=A.ja,x._QTS_DefineProp=A.ka,x._QTS_GetOwnPropertyNames=A.la,x._QTS_Call=A.ma,x._QTS_ResolveException=A.na,x._QTS_Dump=A.oa,x._QTS_Eval=A.pa,x._QTS_GetModuleNamespace=A.qa,x._QTS_Typeof=A.ra,x._QTS_GetLength=A.sa,x._QTS_IsEqual=A.ta,x._QTS_GetGlobalObject=A.ua,x._QTS_NewPromiseCapability=A.va,x._QTS_PromiseState=A.wa,x._QTS_PromiseResult=A.xa,x._QTS_TestStringArg=A.ya,x._QTS_GetDebugLogEnabled=A.za,x._QTS_SetDebugLogEnabled=A.Aa,x._QTS_BuildIsDebug=A.Ba,x._QTS_BuildIsAsyncify=A.Ca,x._QTS_NewFunction=A.Da,x._QTS_ArgvGetJSValueConstPointer=A.Ea,x._QTS_RuntimeEnableInterruptHandler=A.Fa,x._QTS_RuntimeDisableInterruptHandler=A.Ga,x._QTS_RuntimeEnableModuleLoader=A.Ha,x._QTS_RuntimeDisableModuleLoader=A.Ia,x._QTS_bjson_encode=A.Ja,x._QTS_bjson_decode=A.Ka,p0=A.La,l0=A.Ma,f0=A.Na,q0=A.Oa,Y}r(F,"b");var B={a:Y0};return x.instantiateWasm?new Promise(A=>{x.instantiateWasm(B,(j,e)=>{A(F(j,e))})}):(A0??(A0=L(`\0asm\0\0\0\xBEi\`\x7F\x7F\0\`\x7F\x7F\x7F\x7F\`\x7F~\x7F\x7F~\`\x7F\x7F\x7F\`\x7F\x7F\`\x7F~\x7F\x7F\x7F~\`\x7F\x7F\x7F\0\`\x7F~~\`\x7F\x7F\x7F\x7F\x7F\`\x7F\0\`\x7F~\0\`\x7F~\x7F\`||\`\x7F\x7F~\`\x7F\x7F~\x7F\`\x7F~\x7F\x7F\x7F\x7F~\`\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F~\x7F~\`\x7F~\x7F\0\`\x7F\x7F\x7F\x7F\0\`\x7F~\x7F\x7F\`\x7F~~~\`\x7F\x7F\x7F~\`\x7F~~\x7F\x7F\x7F~\`\x7F\x7F~\x7F\x7F\`\x7F~~\x7F\`\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F~~\x7F\x7F~\`\x7F\x7F\x7F\x7F~\`|||\`\0\x7F\`\x7F~\x7F\x7F\x7F\`~\x7F\`\0\0\`\x7F~\`\x07\x7F~\x7F~~~\x7F\x7F\`\x7F~\x7F~\x7F\x7F\`\x7F~~\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F~\x7F\`\x7F~~~\x7F\x7F\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`~~\`\x7F|\x7F\`\x7F~\x7F~~\`\x7F~\x7F~~\x7F\x7F\`~\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F~\`\x7F~\x7F\x7F\0\`\x7F\x7F|\`\x07\x7F~\x7F\x7F\x7F\x7F\x7F~\`~\x7F\0\`\x7F\x7F~\0\`\x7F~~\x7F~\`\x7F~\x7F~\x7F\`\x7F~\x7F~\0\`\x7F~~~\x7F\` \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\x7F~\`~\x7F\x7F\x7F\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F~\x7F\x7F\x7F\x7F\`\x7F\x7F~~\`|\x7F\`\x7F~~\x7F\x7F\0\`\x7F~~\x7F\0\`|\x7F|\`||\x7F|\`\x7F\x7F~\x7F\0\`\x7F~~~~\x7F\x7F\`\x7F\x7F~~\x7F\`\x7F~~\x7F\x7F\x7F\`\x7F|\x7F\x7F\x7F\x7F\x7F\`\0|\`\x7F~\x7F~\x7F~\`\r\x7F\x7F\x7F\x7F\x7F\x7F\x7F~\x7F\x7F\x7F\x7F\x7F~\`\x7F\x7F~\x7F\x7F\x7F\`\x7F\x7F~~~~\x7F\`\x7F\x7F~\x7F~\`\x07\x7F~~~\x7F\x7F\x7F~\`\x7F|\`\x7F|\x7F\x7F\x7F~\`\b\x7F~~\x7F\x7F\x7F\x7F\x7F~\`\x7F~\x7F\x7F\x7F\x7F\0\`\b\x7F\x7F\x7F\x7F\x7F\x7F~\x7F~\`\x7F~\x7F\x7F\x7F\x7F\x7F\`
3
3
  \x7F\x7F~\x7F\x7F~~~\x7F\x7F\x7F\`\x7F\x7F~~~~\`||\x7F\`\x7F\x7F\x7F\x7F\x7F|\`\x7F\x7F~~\x7F\x7F\`\x7F~~\0\`\x07\x7F~\x7F\x7F\x7F\x7F\x7F\0\`\x7F~~~~\`|\x7F\x7F\`\x7F\x7F~~~\`\b\x7F~~~~\x7F~~~\`~~\x7F\x7F\`\x07\x7F\x7F\x7F~~~\x7F\x7F\`\x7F\x7F|\0\`\x7F~|~\`\0~\`\x7F|\0\` \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0~ab\0ac\0\bad\0ae\0af\0ag\0\bah\0ai\0aj\0+ak\0al\0!am\x003an\0ao\0ap\0Jaq\0!ar\0 as\0at\0\0aa\x80\x80\x80\xAB
4
4
  \xA9
5
5
 
@@ -1,5 +1,5 @@
1
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 as o}from"./chunk-FTQLQJQV.js";import{createHash as Te}from"node:crypto";function W(n){if(n===null||typeof n=="boolean"||typeof n=="string")return n;if(typeof n=="number"){if(!Number.isFinite(n))throw new Error("Canonical JSON cannot encode a non-finite number.");return n}if(Array.isArray(n))return n.map(W);if(typeof n=="object"){let t={};for(let r of Object.keys(n).sort()){let i=n[r];i!==void 0&&(t[r]=W(i))}return t}throw new Error(`Canonical JSON cannot encode ${typeof n}.`)}o(W,"canonicalJson");function R(n){return Te("sha256").update(JSON.stringify(W(n)),"utf8").digest("hex")}o(R,"canonicalHash");function rt(n){if(!n.maxContextTokens||!n.usableContextTokens)return{shouldCompact:!1,projectedTokens:n.projectedTokens,thresholdTokens:Number.MAX_SAFE_INTEGER,usableContextTokens:0,maxContextTokens:0,tokenSource:"heuristic"};let t=Math.max(.01,Math.min(1,(n.triggerPercent??85)/100)),r=Math.max(1,Math.floor(n.usableContextTokens*t));return{shouldCompact:n.projectedTokens>=r,projectedTokens:n.projectedTokens,thresholdTokens:r,usableContextTokens:n.usableContextTokens,maxContextTokens:n.maxContextTokens,tokenSource:"heuristic"}}o(rt,"agentCompactionDecision");async function it(n){await n.started();try{return await n.compact()}catch(t){throw await n.failed(t),t}}o(it,"runAgentCompaction");async function nt(n){let t=n.host.projectEvents(n.events),r=n.host.selectEvents(t,n.maxContextTokens),{summaryEvents:i,preservedEvents:s,preservedEventIds:c}=r;if(i.length===0)throw new Error("There is not enough prior context to compact.");let l=n.host.normalizeRecords(i),d=n.host.normalizeRecords(s),m=n.host.buildFileLedger(n.host.normalizeRecords(t)),h=n.host.serializeRecords(l,n.host.inputCharBudget(n.maxContextTokens));if(!h.text.trim())throw new Error("There is not enough prior context to compact.");let y=n.host.buildSummaryMessages({serializedHistory:h.text,fileLedger:m}),b=Date.now(),v=(await n.host.streamSummary({model:n.model,messages:y,signal:n.signal})).trim(),I=Date.now()-b;if(!v)throw new Error("Compaction summary was empty.");let g=n.host.estimateProjection({events:t,preservedEvents:s,summary:v}),f=n.host.createMetrics({sourceEvents:t.length,summarizedEvents:i.length,preservedEvents:s.length,sourceRecords:h.sourceRecordCount,includedRecords:h.includedRecordCount,omittedRecords:h.omittedRecordCount,preservedRecords:d.length,truncatedRecords:h.truncatedRecordCount,summaryInputTruncated:h.inputTruncated,sourceSelectionStrategy:h.selectionStrategy,summaryInputChars:h.inputChars,retainedTailTokens:r.retainedTailTokens,retainedTailBudgetTokens:r.retainedTailBudgetTokens,finalProviderContextTokens:g.inputTokensAfter,durationMs:I,fileLedgerEntries:m.length,splitTurnId:r.splitTurnId});return{summary:v,model:n.model,compactedThroughEventId:t[t.length-1]?.id??null,compactedThroughTurnId:n.host.lastTurnId(t),preservedFromEventId:s[0]?.id??null,preservedEventIds:c,preservedResourceRefs:n.host.durableResourceRefs(n.events),sourceEventCount:i.length,preservedEventCount:s.length,fileLedger:m,inputTokensBefore:g.inputTokensBefore,inputTokensAfter:g.inputTokensAfter,maxContextTokens:n.maxContextTokens,tokenSource:"heuristic",metrics:f}}o(nt,"runAgentCompactionProgram");var Ce=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"]),qe=e.object({sequence:e.number().int().nonnegative(),name:Ce,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 lt(n){return R(qe.parse(n))}o(lt,"canonicalEventHash");var A="2026-09-20",mt=["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"],Z=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(),ee=e.object({jsonrpc:e.literal("2.0"),method:e.string().trim().min(1),params:e.unknown().optional()}).strict(),F=e.object({jsonrpc:e.literal("2.0"),id:e.union([e.string(),e.number()]),result:e.unknown()}).strict(),J=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(),ht=e.union([Z,ee,F,J]),Pe=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(),B=class{static{o(this,"AgentJsonRpcDispatcher")}#e;#t=null;#r=!1;constructor(t){this.#e=t}get initialized(){return this.#r}async handle(t){let r=ee.safeParse(t);if(r.success&&!("id"in t)){if(r.data.method==="initialized"){if(!this.#t)throw new T(-32002,"initialize must be called first");this.#r=!0}return null}let i=Z.safeParse(t);if(!i.success)return Y(null,-32600,"Invalid Request",i.error.flatten());let s=i.data;try{let c=await this.#i(s.method,s.params);return{jsonrpc:"2.0",id:s.id,result:c}}catch(c){let l=c instanceof T?c:new T(-32603,c instanceof Error?c.message:String(c));return Y(s.id,l.code,l.message,l.data)}}async#i(t,r){if(t==="initialize"){let i=Pe.parse(r);if(i.protocolVersion!==A)throw new T(-32001,"Incompatible agent protocol version",{requested:i.protocolVersion,supported:A});return this.#t=i,{protocolVersion:A,server:{name:"openpond-app-server",version:"1"},capabilities:await this.#e.capabilities()}}if(!this.#r)throw new T(-32002,"initialized notification is required");switch(t){case"runtime/capabilities":return this.#e.capabilities(r);case"thread/start":return this.#e.threadStart(r);case"thread/resume":return this.#e.threadResume(r);case"thread/read":return this.#e.threadRead(r);case"turn/start":return this.#e.turnStart(r);case"turn/steer":return this.#e.turnSteer(r);case"task/inbox":return this.#e.taskInbox(r);case"task/queue":return this.#e.taskQueue(r);case"task/inputUpdate":return this.#e.taskInputUpdate(r);case"turn/interrupt":return this.#e.turnInterrupt(r);case"approval/resolve":return this.#e.approvalResolve(r);case"userInput/resolve":return this.#e.userInputResolve(r);case"profile/workflows":return this.#e.profileWorkflows(r);case"profile/evaluations":return this.#e.profileEvaluations(r);case"profile/trainingSource":return this.#e.profileTrainingSource(r);case"profile/evaluations/prepare":return this.#e.profileEvaluationPrepare(r);case"profile/evaluations/run":return this.#e.profileEvaluationRun(r);case"experiments/executeCase":{if(!this.#e.experimentExecuteCase)throw new Error("Experiment execution is unavailable in this runtime.");return this.#e.experimentExecuteCase(r)}case"experiments/cancelCase":{if(!this.#e.experimentCancelCase)throw new Error("Experiment cancellation is unavailable in this runtime.");return this.#e.experimentCancelCase(r)}case"profile/evaluations/runSuite":return this.#e.profileEvaluationRunSuite(r);case"profile/evaluations/executeCase":return this.#e.profileEvaluationExecuteCase(r);case"profile/evaluations/executeRun":return this.#e.profileEvaluationExecuteRun(r);case"profile/evaluations/compare":return this.#e.profileEvaluationCompare(r);case"profile/evaluations/report":return this.#e.profileEvaluationReport(r);case"harness/inspect":return this.#e.harnessInspect(r);case"harness/proposalReview":return this.#e.harnessProposalReview(r);case"harness/review":return this.#e.harnessReview(r);case"harness/acceptEvaluationReview":return this.#e.harnessAcceptEvaluationReview(r);case"harness/materializeEvaluationTaskset":return this.#e.harnessMaterializeEvaluationTaskset(r);case"harness/runEvaluationBaseline":return this.#e.harnessRunEvaluationBaseline(r);case"harness/validate":return this.#e.harnessValidate(r);case"harness/backgroundReview":return this.#e.harnessBackgroundReview(r);case"harness/diff":return this.#e.harnessDiff(r);case"harness/rollback":return this.#e.harnessRollback(r);case"refiner/inspect":return this.#e.refinerInspect(r);case"refiner/update":return this.#e.refinerUpdate(r);case"refiner/activate":return this.#e.refinerActivate(r);case"refiner/rollback":return this.#e.refinerRollback(r);default:throw new T(-32601,`Method not found: ${t}`)}}},T=class extends Error{static{o(this,"JsonRpcDispatchError")}code;data;constructor(t,r,i){super(r),this.code=t,this.data=i}};function Y(n,t,r,i){return{jsonrpc:"2.0",id:n,error:{code:t,message:r,...i===void 0?{}:{data:i}}}}o(Y,"jsonRpcError");var te=class{static{o(this,"AgentRpcClient")}#e;#t;constructor(t){this.#e=t.request.bind(t),this.#t=t.notify.bind(t)}async initialize(t,r={}){let i=await this.#e("initialize",{protocolVersion:A,client:t,capabilities:r});return await this.#t("initialized"),i}capabilities=o((t={})=>this.#e("runtime/capabilities",t),"capabilities");threadStart=o(t=>this.#e("thread/start",t),"threadStart");threadResume=o(t=>this.#e("thread/resume",t),"threadResume");threadRead=o(t=>this.#e("thread/read",t),"threadRead");turnStart=o(t=>this.#e("turn/start",t),"turnStart");turnSteer=o(t=>this.#e("turn/steer",t),"turnSteer");taskInbox=o(t=>this.#e("task/inbox",t),"taskInbox");taskQueue=o(t=>this.#e("task/queue",t),"taskQueue");taskInputUpdate=o(t=>this.#e("task/inputUpdate",t),"taskInputUpdate");turnInterrupt=o(t=>this.#e("turn/interrupt",t),"turnInterrupt");approvalResolve=o(t=>this.#e("approval/resolve",t),"approvalResolve");userInputResolve=o(t=>this.#e("userInput/resolve",t),"userInputResolve");profileWorkflows=o(t=>this.#e("profile/workflows",t),"profileWorkflows");profileEvaluations=o(t=>this.#e("profile/evaluations",t),"profileEvaluations");profileEvaluationPrepare=o(t=>this.#e("profile/evaluations/prepare",t),"profileEvaluationPrepare");profileEvaluationRun=o(t=>this.#e("profile/evaluations/run",t),"profileEvaluationRun");profileEvaluationRunSuite=o(t=>this.#e("profile/evaluations/runSuite",t),"profileEvaluationRunSuite");profileEvaluationExecuteCase=o(t=>this.#e("profile/evaluations/executeCase",t),"profileEvaluationExecuteCase");profileEvaluationExecuteRun=o(t=>this.#e("profile/evaluations/executeRun",t),"profileEvaluationExecuteRun");profileEvaluationCompare=o(t=>this.#e("profile/evaluations/compare",t),"profileEvaluationCompare");experimentExecuteCase=o(t=>this.#e("experiments/executeCase",t),"experimentExecuteCase");experimentCancelCase=o(t=>this.#e("experiments/cancelCase",t),"experimentCancelCase");harnessInspect=o((t={})=>this.#e("harness/inspect",t),"harnessInspect");harnessProposalReview=o((t={})=>this.#e("harness/proposalReview",t),"harnessProposalReview");harnessReview=o((t={})=>this.#e("harness/review",t),"harnessReview");harnessAcceptEvaluationReview=o((t={})=>this.#e("harness/acceptEvaluationReview",t),"harnessAcceptEvaluationReview");harnessMaterializeEvaluationTaskset=o((t={})=>this.#e("harness/materializeEvaluationTaskset",t),"harnessMaterializeEvaluationTaskset");harnessRunEvaluationBaseline=o((t={})=>this.#e("harness/runEvaluationBaseline",t),"harnessRunEvaluationBaseline");harnessValidate=o((t={})=>this.#e("harness/validate",t),"harnessValidate");harnessBackgroundReview=o((t={})=>this.#e("harness/backgroundReview",t),"harnessBackgroundReview");harnessDiff=o((t={})=>this.#e("harness/diff",t),"harnessDiff");harnessRollback=o((t={})=>this.#e("harness/rollback",t),"harnessRollback");refinerInspect=o(t=>this.#e("refiner/inspect",t),"refinerInspect");refinerUpdate=o(t=>this.#e("refiner/update",t),"refinerUpdate");refinerActivate=o(t=>this.#e("refiner/activate",t),"refinerActivate");refinerRollback=o(t=>this.#e("refiner/rollback",t),"refinerRollback")};var G=e.object({caseId:e.string().trim().min(1).max(191),admissionHash:e.string().regex(/^[a-f0-9]{64}$/),definitionHash:e.string().regex(/^[a-f0-9]{64}$/),ordinal:e.number().int().nonnegative(),operation:e.enum(["create","reset","step","collect","destroy"]),value:e.record(e.string(),e.unknown()),timeoutMs:e.number().int().min(1).max(3e4)}).strict();var u=e.string().trim().min(1).max(200),$=e.string().trim().min(1).max(32e3),z=e.number().int().nonnegative(),re=e.object({id:u,sessionId:u,senderSessionId:u.nullable(),senderKind:e.enum(["user","task","runtime"]),kind:e.enum(["steer","message","followup","queued","result"]),body:$,payload:e.record(e.string(),e.unknown()),idempotencyKey:u,replyTo:u.nullable(),expectedTurnId:u.nullable()}).strict(),Ae=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:$}).strict(),e.object({action:e.literal("steer"),expectedRevision:e.number().int().positive(),expectedTurnId:u}).strict()]),ie=e.object({id:u,sessionId:u,turnId:u,targetSessionId:u.nullable(),targetTurnId:u.nullable(),targetInputId:u.nullable(),afterSequence:z,deadline:e.string(),state:e.enum(["waiting","message","completed","failed","interrupted","unavailable","timeout","cancelled"]),createdAt:e.string(),updatedAt:e.string()}).strict(),ne=e.record(e.string(),e.unknown()),ze=e.enum(["queued","running","completed","failed","cancelled","needs_resume"]),He=e.object({parentSessionId:u.nullable().optional(),childSessionId:u.nullable().optional(),status:e.array(ze).nullable().optional(),afterId:e.string().max(200),limit:e.number().int().min(1).max(10)}).strict(),se=e.discriminatedUnion("action",[e.object({action:e.literal("recoverTaskInboxOwners"),ownerId:u}).strict(),e.object({action:e.literal("hasTaskCompletion"),turnId:u}).strict(),e.object({action:e.literal("taskInboxSnapshot"),sessionId:u}).strict(),e.object({action:e.literal("taskInboxSnapshotInputs"),sessionId:u,afterSequence:z}).strict(),e.object({action:e.literal("declareTaskWork"),sessionId:u,turnId:u,ownerId:u,areas:e.array($).max(100)}).strict(),e.object({action:e.literal("taskWorkAreas"),sessionId:u}).strict(),e.object({action:e.literal("admitTaskInput"),input:re}).strict(),e.object({action:e.literal("admitTaskInputs"),inputs:e.array(re).max(50)}).strict(),e.object({action:e.literal("rejectTaskInput"),id:u,error:$}).strict(),e.object({action:e.literal("getTaskInput"),id:u}).strict(),e.object({action:e.literal("taskInputsForSession"),sessionId:u,query:e.object({afterSequence:z.optional(),pendingOnly:e.boolean().optional(),limit:e.number().int().min(1).max(500).optional()}).strict()}).strict(),e.object({action:e.literal("mutateTaskInput"),sessionId:u,inputId:u,change:Ae}).strict(),e.object({action:e.literal("openTaskInboxTurn"),sessionId:u,turnId:u,ownerId:u}).strict(),e.object({action:e.literal("renewTaskInboxTurn"),sessionId:u,turnId:u,ownerId:u}).strict(),e.object({action:e.literal("pendingTaskInputs"),sessionId:u,turnId:u,afterSequence:z}).strict(),e.object({action:e.literal("taskAssignmentInputs"),turnId:u,afterSequence:z}).strict(),e.object({action:e.literal("pauseTaskInboxTurn"),sessionId:u,turnId:u,ownerId:u}).strict(),e.object({action:e.literal("includeTaskInputs"),sessionId:u,turnId:u,ownerId:u,requestId:u}).strict(),e.object({action:e.literal("settleTaskInputRequest"),requestId:u,outcome:e.enum(["resolved","failed","replaced"])}).strict(),e.object({action:e.literal("sealTaskInboxTurn"),sessionId:u,turnId:u,ownerId:u}).strict(),e.object({action:e.literal("sealNativeTaskInboxTurn"),sessionId:u,turnId:u,ownerId:u}).strict(),e.object({action:e.literal("closeTaskInboxTurn"),sessionId:u,turnId:u,ownerId:u,outcome:e.enum(["completed","failed","interrupted"])}).strict(),e.object({action:e.literal("taskInboxPaused"),sessionId:u}).strict(),e.object({action:e.literal("reserveTaskFollowup"),sessionId:u,turnId:u,ownerId:u}).strict(),e.object({action:e.literal("taskInboxWakeTargets"),afterSessionId:e.string().max(200)}).strict(),e.object({action:e.literal("createTaskWait"),value:ie}).strict(),e.object({action:e.literal("settleTaskWait"),id:u,state:ie.shape.state}).strict(),e.object({action:e.literal("taskWaitsForSession"),sessionId:u,afterId:e.string().max(200)}).strict(),e.object({action:e.literal("commitSubagentCompletion"),value:ne,turnId:u}).strict(),e.object({action:e.literal("pendingTaskCompletions"),afterTurnId:e.string().max(200)}).strict(),e.object({action:e.literal("settleTaskCompletion"),turnId:u,inputId:u}).strict(),e.object({action:e.literal("upsertSubagentRun"),value:ne}).strict(),e.object({action:e.literal("getSubagentRun"),id:u}).strict(),e.object({action:e.literal("listSubagentRuns"),query:He}).strict()]);var H=e.string().trim().min(1).max(191),oe=e.object({createdAt:e.string().min(1),id:H}).strict(),ae=e.enum(["trigger_decision","route_decision","refiner_outcome","proposal","targeted_validation","apply_receipt"]),ce=e.discriminatedUnion("action",[e.object({action:e.literal("active_release"),workspaceId:H}).strict(),e.object({action:e.literal("put_artifact"),workspaceId:H,kind:ae,artifact:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("artifact_page"),workspaceId:H,kind:ae,before:oe.nullable(),limit:e.number().int().min(1).max(200)}).strict(),e.object({action:e.literal("pending_trigger_page"),workspaceId:H,before:oe.nullable(),limit:e.number().int().min(1).max(200)}).strict()]);var w=e.string().trim().min(1).max(240),le=e.string().regex(/^[a-f0-9]{64}$/),ue=e.enum(["run_overlay","observation","trigger_decision","route_decision","proposal","targeted_validation","apply_receipt","refiner_outcome"]),de=e.object({createdAt:e.string().datetime(),id:w}).strict(),pe=e.discriminatedUnion("action",[e.object({action:e.literal("artifact_put"),workspaceId:w,kind:ue,artifact:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("artifact_page"),workspaceId:w,kind:ue,before:de.nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("pending_page"),workspaceId:w,before:de.nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("workspace_get"),workspaceId:w}).strict(),e.object({action:e.literal("background_get"),workspaceId:w}).strict(),e.object({action:e.literal("overlay_get"),runId:w}).strict(),e.object({action:e.literal("overlay_freeze"),runId:w,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:w,sessionId:w,key:w}).strict(),e.object({action:e.literal("memory_page"),workspaceId:w,sessionId:w,before:e.object({updatedAt:e.string().datetime(),key:w}).strict().nullable(),limit:e.number().int().min(1).max(20),includeDeleted:e.boolean()}).strict(),e.object({action:e.literal("memory_write"),sessionId:w,input:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("release_get"),contentHash:le}).strict(),e.object({action:e.literal("release_put"),record:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("session_get"),sessionId:w}).strict(),e.object({action:e.literal("turn_get"),turnId:w}).strict(),e.object({action:e.literal("turn_page"),sessionId:w,before:e.number().int().positive().nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("event_page"),turnId:w,afterSequence:e.number().int().nonnegative(),names:e.array(w).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:w,expectedHash:le,snapshot:e.record(e.string(),e.unknown())}).strict()]);var j=e.string().trim().min(1).max(200),me=e.string().regex(/^[a-f0-9]{64}$/),Me=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()}),he=e.object({id:j,title:e.string().trim().min(1).max(240),sourceTaskId:j,sourceTurnId:j,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:me,validation:e.array(Me).max(32)}).strict(),fe=e.object({sessionId:j,turnId:j,output:he}).strict(),be=e.object({uploadId:j,index:e.number().int().min(0).max(1024),offset:e.number().int().min(0).max(1e7),sha256:me,contentsBase64:e.string().min(1).max(131072)}).strict(),ge=e.object({uploadId:j}).strict(),Ve=he.pick({id:!0,title:!0,sourceTaskId:!0,sourceTurnId:!0,revision:!0,createdAt:!0,validation:!0}),we=e.object({sessionId:j,turnId:j,output:Ve,sandboxPath:e.string().trim().min(1).max(4096)}).strict();var M=e.string().trim().min(1).max(200),Ue=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:M.optional(),payload:e.unknown().optional(),processId:M.optional(),failOnUnpreservedChanges:e.boolean().optional()}).strict().superRefine((n,t)=>{n.type!=="create"&&!n.sandboxId&&t.addIssue({code:"custom",message:"Sandbox identity is required."}),n.type==="create"&&n.sandboxId&&t.addIssue({code:"custom",message:"Create cannot target a sandbox identity."}),n.type==="process_get"&&!n.processId&&t.addIssue({code:"custom",message:"Process identity is required."})}),ve=e.object({action:Ue}).strict(),xe=e.object({sessionId:M,turnId:M,name:M}).strict();var p=1,a=e.string().trim().min(1).max(191),C=e.number().int().min(1).max(200),Ot=e.object({teamId:a,ownerUserId:a,workspaceId:a,conversationId:a,turnId:a,attempt:e.number().int().min(1),leaseGeneration:e.number().int().min(1)}).strict(),Ie=e.discriminatedUnion("operation",[e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile-evaluations/grade"),params:e.object({action:e.enum(["upload","execute"]),callId:a,sessionId:a,turnId:a,sha256:e.string().regex(/^[a-f0-9]{64}$/),sizeBytes:e.number().int().positive().max(2e7),timeoutMs:e.number().int().positive().max(3e5),offset:e.number().int().nonnegative().max(2e7).optional(),contentsBase64:e.string().max(131072).optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile-evaluations/sandbox"),params:e.object({sessionId:a,turnId:a,action:e.enum(["upload","exec","read","stop"]),area:e.enum(["policy","runtime"]).optional(),path:e.string().min(1).max(4096).optional(),sha256:e.string().regex(/^[a-f0-9]{64}$/).optional(),sizeBytes:e.number().int().min(0).max(1e7).optional(),offset:e.number().int().min(0).max(1e7).optional(),contentsBase64:e.string().max(131072).optional(),command:e.string().min(1).max(2e4).optional(),stdin:e.string().max(12e4).optional(),cwd:e.string().max(4096).optional(),timeoutMs:e.number().int().min(1).max(18e4).optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/list"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/read"),params:e.object({fileId:a,revision:e.number().int().min(1),offset:e.number().int().min(0).max(1e7).optional(),maxChars:e.number().int().min(1).max(1e5).optional(),firstPage:e.number().int().min(1).max(1e3).optional(),pageCount:e.number().int().min(1).max(10).optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/readBytes"),params:e.object({sessionId:a,turnId:a,fileId:a,revision:e.number().int().positive(),sha256:e.string().regex(/^[a-f0-9]{64}$/),sizeBytes:e.number().int().min(1).max(1e7),offset:e.number().int().min(0).max(1e7)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile.externalDataset.authorize"),params:e.object({bindingHash:e.string().regex(/^[a-f0-9]{64}$/),manifestHash:e.string().regex(/^[a-f0-9]{64}$/).optional(),taskId:a.optional(),seed:e.string().min(1).max(500).optional()}).strict().refine(n=>!!n.taskId==!!n.seed,"Case authority requires both task and seed.")}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("experiment/environment"),params:G}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("experiment/policy"),params:e.object({caseId:a,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(p),requestId:a,operation:e.literal("sandbox/request"),params:ve}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("embedding/authorize"),params:xe}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/begin"),params:fe}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/chunk"),params:be}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/complete"),params:ge}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/saveSandboxFile"),params:we}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("settings/get"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/get"),params:e.object({reference:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/overlay/get"),params:e.object({runId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/overlay/put"),params:e.object({runId:a,expectedRevision:e.number().int().min(0).nullable(),overlay:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/overlay/freezeProposal"),params:e.object({runId:a,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(p),requestId:a,operation:e.literal("harness/memory/get"),params:e.object({workspaceId:a,key:e.string().min(1).max(120)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/list"),params:e.object({workspaceId:a,includeDeleted:e.boolean(),before:e.object({updatedAt:e.string(),key:e.string()}).strict().nullable(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/search"),params:e.object({workspaceId:a,query:e.string().trim().min(1).max(500),limit:e.number().int().min(1).max(20)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/write"),params:e.object({input:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/state/read"),params:e.object({workspaceId:a,kind:e.enum(["selection","workspace_settings","evaluation_review_settings","candidates","cross_run_requests"]),afterId:a.nullable(),limit:e.number().int().min(1).max(100)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,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:a}).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:a}).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(p),requestId:a,operation:e.literal("harness/workspace/transition"),params:e.discriminatedUnion("action",[e.object({action:e.literal("advance"),receiptId:a,workspaceId:a,proposal:e.record(e.string(),e.unknown()),validations:e.array(e.record(e.string(),e.unknown())).max(100),nextRelease:e.object({id:a,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:a,workspaceId:a,proposal:e.record(e.string(),e.unknown()),validations:e.array(e.record(e.string(),e.unknown())).max(100),nextRelease:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),nextSourceRevision:e.string().min(1),reviewer:a,now:e.string()}).strict(),e.object({action:e.literal("rollback"),receiptId:a,workspaceId:a,expectedWorkspaceRevision:e.number().int().nonnegative(),expectedChannelRevision:e.number().int().nonnegative(),targetRelease:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),targetSourceRevision:e.string().min(1),rollbackOf:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),now:e.string()}).strict()])}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("task-inbox/execute"),params:se}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/review/execute"),params:pe}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("refiner/execute"),params:e.object({action:ce}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("create-improve/execute"),params:e.discriminatedUnion("action",[e.object({action:e.literal("get"),runId:a}).strict(),e.object({action:e.literal("page"),query:e.object({profileId:a.nullable(),targetKind:a.nullable(),targetId:a.nullable(),state:e.array(a).max(20)}).strict(),before:e.object({updatedAt:e.string(),id:a}).strict().nullable(),limit:C}).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(p),requestId:a,operation:e.literal("approval/get"),params:e.object({approvalId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,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(p),requestId:a,operation:e.literal("usage/getByRequestId"),params:e.object({requestId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("usage/upsert"),params:e.object({record:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("usage/page"),params:e.object({query:e.object({sessionId:a.optional(),turnId:a.optional(),provider:a.optional(),model:a.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:a}).strict().nullable(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("capabilities"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/count"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/get"),params:e.object({sessionId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/page"),params:e.object({afterId:a.nullable(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/put"),params:e.object({sessionId:a,expectedRevision:e.number().int().min(1).nullable(),session:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/count"),params:e.object({sessionId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/wakeCount"),params:e.object({sessionId:a,key:e.enum(["messageId","fromRunId"]),value:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/get"),params:e.object({turnId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/put"),params:e.object({sessionId:a,turnId:a,expectedRevision:e.number().int().min(1).nullable(),turn:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/latest"),params:e.object({sessionId:a,status:e.enum(["in_progress","completed","failed","interrupted"]).nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/page"),params:e.object({sessionId:a,beforeSortIndex:e.number().int().min(0).nullable().optional(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("thread/turnPage"),params:e.object({sessionId:a,beforeSortIndex:e.number().int().min(0).nullable().optional(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("event/append"),params:e.object({event:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("events/page"),params:e.object({sessionId:a.nullable(),afterSequence:e.number().int().min(0),beforeSequence:e.number().int().min(1).nullable().optional(),limit:C,excludeReasoningDeltas:e.boolean().optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("events/latestAssistantText"),params:e.object({sessionId:a}).strict()}).strict()]),Bt=e.object({contractVersion:e.literal(p),operations:e.array(e.enum(["experiment/policy","experiment/environment","sandbox/request","embedding/authorize","output/begin","output/chunk","output/complete","output/saveSandboxFile","output/list","output/read","output/readBytes","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","profile-evaluations/sandbox","profile-evaluations/grade","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(50),allowedTools:e.array(a).max(128),maxPageSize:C,maxRequestBytes:e.number().int().min(1).max(8388608),maxInFlight:e.number().int().min(1).max(64)}).strict();var ye=class{static{o(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,r=15e3){let i=Ie.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 s=`host-storage:${this.#r++}`,c={jsonrpc:"2.0",id:s,method:"host/storage",params:i},l=i.operation==="experiment/policy"||i.operation==="experiment/environment";if(Buffer.byteLength(JSON.stringify(c))>(l?8388608:256e3))throw new Error("Host storage request is too large.");let d=new Promise((m,h)=>{let y=i.operation==="sandbox/request"||l?3e5:6e4,b=setTimeout(()=>{this.#e.delete(s),h(new Error("Host storage request timed out."))},Math.max(1,Math.min(y,r)));this.#e.set(s,{resolve:m,reject:h,timer:b,maxResponseBytes:i.operation==="experiment/environment"?16e5:1e6})});try{await this.#t(c)}catch(m){let h=this.#e.get(s);h&&(clearTimeout(h.timer),this.#e.delete(s),h.reject(m instanceof Error?m:new Error(String(m))))}return d}accept(t){let r=F.safeParse(t),i=r.success?null:J.safeParse(t),s=r.success?r.data:i?.success?i.data:null;if(!s||typeof s.id!="string"||!s.id.startsWith("host-storage:"))return!1;let c=this.#e.get(s.id);return c?(clearTimeout(c.timer),this.#e.delete(s.id),Buffer.byteLength(JSON.stringify(s))>c.maxResponseBytes?(c.reject(new Error("Host storage response is too large.")),!0):("error"in s?c.reject(new Error(`Host storage request failed: ${s.error.message}`)):c.resolve(s.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 Oe}from"node:events";import{createInterface as Be}from"node:readline";async function Qt(n){let t=null,r=Promise.resolve(),i=[],s=o(g=>(r=r.then(async()=>{n.writable.write(`${JSON.stringify(g)}
2
+ import{b as e}from"./chunk-ES2ISFJC.js";import{a as o}from"./chunk-FTQLQJQV.js";import{createHash as Te}from"node:crypto";function W(n){if(n===null||typeof n=="boolean"||typeof n=="string")return n;if(typeof n=="number"){if(!Number.isFinite(n))throw new Error("Canonical JSON cannot encode a non-finite number.");return n}if(Array.isArray(n))return n.map(W);if(typeof n=="object"){let t={};for(let r of Object.keys(n).sort()){let i=n[r];i!==void 0&&(t[r]=W(i))}return t}throw new Error(`Canonical JSON cannot encode ${typeof n}.`)}o(W,"canonicalJson");function R(n){return Te("sha256").update(JSON.stringify(W(n)),"utf8").digest("hex")}o(R,"canonicalHash");function rt(n){if(!n.maxContextTokens||!n.usableContextTokens)return{shouldCompact:!1,projectedTokens:n.projectedTokens,thresholdTokens:Number.MAX_SAFE_INTEGER,usableContextTokens:0,maxContextTokens:0,tokenSource:"heuristic"};let t=Math.max(.01,Math.min(1,(n.triggerPercent??85)/100)),r=Math.max(1,Math.floor(n.usableContextTokens*t));return{shouldCompact:n.projectedTokens>=r,projectedTokens:n.projectedTokens,thresholdTokens:r,usableContextTokens:n.usableContextTokens,maxContextTokens:n.maxContextTokens,tokenSource:"heuristic"}}o(rt,"agentCompactionDecision");async function it(n){await n.started();try{return await n.compact()}catch(t){throw await n.failed(t),t}}o(it,"runAgentCompaction");async function nt(n){let t=n.host.projectEvents(n.events),r=n.host.selectEvents(t,n.maxContextTokens),{summaryEvents:i,preservedEvents:s,preservedEventIds:c}=r;if(i.length===0)throw new Error("There is not enough prior context to compact.");let l=n.host.normalizeRecords(i),d=n.host.normalizeRecords(s),m=n.host.buildFileLedger(n.host.normalizeRecords(t)),h=n.host.serializeRecords(l,n.host.inputCharBudget(n.maxContextTokens));if(!h.text.trim())throw new Error("There is not enough prior context to compact.");let y=n.host.buildSummaryMessages({serializedHistory:h.text,fileLedger:m}),b=Date.now(),v=(await n.host.streamSummary({model:n.model,messages:y,signal:n.signal})).trim(),I=Date.now()-b;if(!v)throw new Error("Compaction summary was empty.");let g=n.host.estimateProjection({events:t,preservedEvents:s,summary:v}),f=n.host.createMetrics({sourceEvents:t.length,summarizedEvents:i.length,preservedEvents:s.length,sourceRecords:h.sourceRecordCount,includedRecords:h.includedRecordCount,omittedRecords:h.omittedRecordCount,preservedRecords:d.length,truncatedRecords:h.truncatedRecordCount,summaryInputTruncated:h.inputTruncated,sourceSelectionStrategy:h.selectionStrategy,summaryInputChars:h.inputChars,retainedTailTokens:r.retainedTailTokens,retainedTailBudgetTokens:r.retainedTailBudgetTokens,finalProviderContextTokens:g.inputTokensAfter,durationMs:I,fileLedgerEntries:m.length,splitTurnId:r.splitTurnId});return{summary:v,model:n.model,compactedThroughEventId:t[t.length-1]?.id??null,compactedThroughTurnId:n.host.lastTurnId(t),preservedFromEventId:s[0]?.id??null,preservedEventIds:c,preservedResourceRefs:n.host.durableResourceRefs(n.events),sourceEventCount:i.length,preservedEventCount:s.length,fileLedger:m,inputTokensBefore:g.inputTokensBefore,inputTokensAfter:g.inputTokensAfter,maxContextTokens:n.maxContextTokens,tokenSource:"heuristic",metrics:f}}o(nt,"runAgentCompactionProgram");var Ce=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"]),qe=e.object({sequence:e.number().int().nonnegative(),name:Ce,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 lt(n){return R(qe.parse(n))}o(lt,"canonicalEventHash");var A="2026-09-20",mt=["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"],Z=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(),ee=e.object({jsonrpc:e.literal("2.0"),method:e.string().trim().min(1),params:e.unknown().optional()}).strict(),F=e.object({jsonrpc:e.literal("2.0"),id:e.union([e.string(),e.number()]),result:e.unknown()}).strict(),J=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(),ht=e.union([Z,ee,F,J]),Pe=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(),B=class{static{o(this,"AgentJsonRpcDispatcher")}#e;#t=null;#r=!1;constructor(t){this.#e=t}get initialized(){return this.#r}async handle(t){let r=ee.safeParse(t);if(r.success&&!("id"in t)){if(r.data.method==="initialized"){if(!this.#t)throw new T(-32002,"initialize must be called first");this.#r=!0}return null}let i=Z.safeParse(t);if(!i.success)return Y(null,-32600,"Invalid Request",i.error.flatten());let s=i.data;try{let c=await this.#i(s.method,s.params);return{jsonrpc:"2.0",id:s.id,result:c}}catch(c){let l=c instanceof T?c:new T(-32603,c instanceof Error?c.message:String(c));return Y(s.id,l.code,l.message,l.data)}}async#i(t,r){if(t==="initialize"){let i=Pe.parse(r);if(i.protocolVersion!==A)throw new T(-32001,"Incompatible agent protocol version",{requested:i.protocolVersion,supported:A});return this.#t=i,{protocolVersion:A,server:{name:"openpond-app-server",version:"1"},capabilities:await this.#e.capabilities()}}if(!this.#r)throw new T(-32002,"initialized notification is required");switch(t){case"runtime/capabilities":return this.#e.capabilities(r);case"thread/start":return this.#e.threadStart(r);case"thread/resume":return this.#e.threadResume(r);case"thread/read":return this.#e.threadRead(r);case"turn/start":return this.#e.turnStart(r);case"turn/steer":return this.#e.turnSteer(r);case"task/inbox":return this.#e.taskInbox(r);case"task/queue":return this.#e.taskQueue(r);case"task/inputUpdate":return this.#e.taskInputUpdate(r);case"turn/interrupt":return this.#e.turnInterrupt(r);case"approval/resolve":return this.#e.approvalResolve(r);case"userInput/resolve":return this.#e.userInputResolve(r);case"profile/workflows":return this.#e.profileWorkflows(r);case"profile/evaluations":return this.#e.profileEvaluations(r);case"profile/trainingSource":return this.#e.profileTrainingSource(r);case"profile/evaluations/prepare":return this.#e.profileEvaluationPrepare(r);case"profile/evaluations/run":return this.#e.profileEvaluationRun(r);case"experiments/executeCase":{if(!this.#e.experimentExecuteCase)throw new Error("Experiment execution is unavailable in this runtime.");return this.#e.experimentExecuteCase(r)}case"experiments/cancelCase":{if(!this.#e.experimentCancelCase)throw new Error("Experiment cancellation is unavailable in this runtime.");return this.#e.experimentCancelCase(r)}case"profile/evaluations/runSuite":return this.#e.profileEvaluationRunSuite(r);case"profile/evaluations/executeCase":return this.#e.profileEvaluationExecuteCase(r);case"profile/evaluations/executeRun":return this.#e.profileEvaluationExecuteRun(r);case"profile/evaluations/compare":return this.#e.profileEvaluationCompare(r);case"profile/evaluations/report":return this.#e.profileEvaluationReport(r);case"harness/inspect":return this.#e.harnessInspect(r);case"harness/proposalReview":return this.#e.harnessProposalReview(r);case"harness/review":return this.#e.harnessReview(r);case"harness/acceptEvaluationReview":return this.#e.harnessAcceptEvaluationReview(r);case"harness/materializeEvaluationTaskset":return this.#e.harnessMaterializeEvaluationTaskset(r);case"harness/runEvaluationBaseline":return this.#e.harnessRunEvaluationBaseline(r);case"harness/validate":return this.#e.harnessValidate(r);case"harness/backgroundReview":return this.#e.harnessBackgroundReview(r);case"harness/diff":return this.#e.harnessDiff(r);case"harness/rollback":return this.#e.harnessRollback(r);case"refiner/inspect":return this.#e.refinerInspect(r);case"refiner/update":return this.#e.refinerUpdate(r);case"refiner/activate":return this.#e.refinerActivate(r);case"refiner/rollback":return this.#e.refinerRollback(r);default:throw new T(-32601,`Method not found: ${t}`)}}},T=class extends Error{static{o(this,"JsonRpcDispatchError")}code;data;constructor(t,r,i){super(r),this.code=t,this.data=i}};function Y(n,t,r,i){return{jsonrpc:"2.0",id:n,error:{code:t,message:r,...i===void 0?{}:{data:i}}}}o(Y,"jsonRpcError");var te=class{static{o(this,"AgentRpcClient")}#e;#t;constructor(t){this.#e=t.request.bind(t),this.#t=t.notify.bind(t)}async initialize(t,r={}){let i=await this.#e("initialize",{protocolVersion:A,client:t,capabilities:r});return await this.#t("initialized"),i}capabilities=o((t={})=>this.#e("runtime/capabilities",t),"capabilities");threadStart=o(t=>this.#e("thread/start",t),"threadStart");threadResume=o(t=>this.#e("thread/resume",t),"threadResume");threadRead=o(t=>this.#e("thread/read",t),"threadRead");turnStart=o(t=>this.#e("turn/start",t),"turnStart");turnSteer=o(t=>this.#e("turn/steer",t),"turnSteer");taskInbox=o(t=>this.#e("task/inbox",t),"taskInbox");taskQueue=o(t=>this.#e("task/queue",t),"taskQueue");taskInputUpdate=o(t=>this.#e("task/inputUpdate",t),"taskInputUpdate");turnInterrupt=o(t=>this.#e("turn/interrupt",t),"turnInterrupt");approvalResolve=o(t=>this.#e("approval/resolve",t),"approvalResolve");userInputResolve=o(t=>this.#e("userInput/resolve",t),"userInputResolve");profileWorkflows=o(t=>this.#e("profile/workflows",t),"profileWorkflows");profileEvaluations=o(t=>this.#e("profile/evaluations",t),"profileEvaluations");profileEvaluationPrepare=o(t=>this.#e("profile/evaluations/prepare",t),"profileEvaluationPrepare");profileEvaluationRun=o(t=>this.#e("profile/evaluations/run",t),"profileEvaluationRun");profileEvaluationRunSuite=o(t=>this.#e("profile/evaluations/runSuite",t),"profileEvaluationRunSuite");profileEvaluationExecuteCase=o(t=>this.#e("profile/evaluations/executeCase",t),"profileEvaluationExecuteCase");profileEvaluationExecuteRun=o(t=>this.#e("profile/evaluations/executeRun",t),"profileEvaluationExecuteRun");profileEvaluationCompare=o(t=>this.#e("profile/evaluations/compare",t),"profileEvaluationCompare");experimentExecuteCase=o(t=>this.#e("experiments/executeCase",t),"experimentExecuteCase");experimentCancelCase=o(t=>this.#e("experiments/cancelCase",t),"experimentCancelCase");harnessInspect=o((t={})=>this.#e("harness/inspect",t),"harnessInspect");harnessProposalReview=o((t={})=>this.#e("harness/proposalReview",t),"harnessProposalReview");harnessReview=o((t={})=>this.#e("harness/review",t),"harnessReview");harnessAcceptEvaluationReview=o((t={})=>this.#e("harness/acceptEvaluationReview",t),"harnessAcceptEvaluationReview");harnessMaterializeEvaluationTaskset=o((t={})=>this.#e("harness/materializeEvaluationTaskset",t),"harnessMaterializeEvaluationTaskset");harnessRunEvaluationBaseline=o((t={})=>this.#e("harness/runEvaluationBaseline",t),"harnessRunEvaluationBaseline");harnessValidate=o((t={})=>this.#e("harness/validate",t),"harnessValidate");harnessBackgroundReview=o((t={})=>this.#e("harness/backgroundReview",t),"harnessBackgroundReview");harnessDiff=o((t={})=>this.#e("harness/diff",t),"harnessDiff");harnessRollback=o((t={})=>this.#e("harness/rollback",t),"harnessRollback");refinerInspect=o(t=>this.#e("refiner/inspect",t),"refinerInspect");refinerUpdate=o(t=>this.#e("refiner/update",t),"refinerUpdate");refinerActivate=o(t=>this.#e("refiner/activate",t),"refinerActivate");refinerRollback=o(t=>this.#e("refiner/rollback",t),"refinerRollback")};var G=e.object({caseId:e.string().trim().min(1).max(191),admissionHash:e.string().regex(/^[a-f0-9]{64}$/),definitionHash:e.string().regex(/^[a-f0-9]{64}$/),ordinal:e.number().int().nonnegative(),operation:e.enum(["create","reset","step","collect","destroy"]),value:e.record(e.string(),e.unknown()),timeoutMs:e.number().int().min(1).max(3e4)}).strict();var u=e.string().trim().min(1).max(200),$=e.string().trim().min(1).max(32e3),z=e.number().int().nonnegative(),re=e.object({id:u,sessionId:u,senderSessionId:u.nullable(),senderKind:e.enum(["user","task","runtime"]),kind:e.enum(["steer","message","followup","queued","result"]),body:$,payload:e.record(e.string(),e.unknown()),idempotencyKey:u,replyTo:u.nullable(),expectedTurnId:u.nullable()}).strict(),Ae=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:$}).strict(),e.object({action:e.literal("steer"),expectedRevision:e.number().int().positive(),expectedTurnId:u}).strict()]),ie=e.object({id:u,sessionId:u,turnId:u,targetSessionId:u.nullable(),targetTurnId:u.nullable(),targetInputId:u.nullable(),afterSequence:z,deadline:e.string(),state:e.enum(["waiting","message","completed","failed","interrupted","unavailable","timeout","cancelled"]),createdAt:e.string(),updatedAt:e.string()}).strict(),ne=e.record(e.string(),e.unknown()),ze=e.enum(["queued","running","completed","failed","cancelled","needs_resume"]),He=e.object({parentSessionId:u.nullable().optional(),childSessionId:u.nullable().optional(),status:e.array(ze).nullable().optional(),afterId:e.string().max(200),limit:e.number().int().min(1).max(10)}).strict(),se=e.discriminatedUnion("action",[e.object({action:e.literal("recoverTaskInboxOwners"),ownerId:u}).strict(),e.object({action:e.literal("hasTaskCompletion"),turnId:u}).strict(),e.object({action:e.literal("taskInboxSnapshot"),sessionId:u}).strict(),e.object({action:e.literal("taskInboxSnapshotInputs"),sessionId:u,afterSequence:z}).strict(),e.object({action:e.literal("declareTaskWork"),sessionId:u,turnId:u,ownerId:u,areas:e.array($).max(100)}).strict(),e.object({action:e.literal("taskWorkAreas"),sessionId:u}).strict(),e.object({action:e.literal("admitTaskInput"),input:re}).strict(),e.object({action:e.literal("admitTaskInputs"),inputs:e.array(re).max(50)}).strict(),e.object({action:e.literal("rejectTaskInput"),id:u,error:$}).strict(),e.object({action:e.literal("getTaskInput"),id:u}).strict(),e.object({action:e.literal("taskInputsForSession"),sessionId:u,query:e.object({afterSequence:z.optional(),pendingOnly:e.boolean().optional(),limit:e.number().int().min(1).max(500).optional()}).strict()}).strict(),e.object({action:e.literal("mutateTaskInput"),sessionId:u,inputId:u,change:Ae}).strict(),e.object({action:e.literal("openTaskInboxTurn"),sessionId:u,turnId:u,ownerId:u}).strict(),e.object({action:e.literal("renewTaskInboxTurn"),sessionId:u,turnId:u,ownerId:u}).strict(),e.object({action:e.literal("pendingTaskInputs"),sessionId:u,turnId:u,afterSequence:z}).strict(),e.object({action:e.literal("taskAssignmentInputs"),turnId:u,afterSequence:z}).strict(),e.object({action:e.literal("pauseTaskInboxTurn"),sessionId:u,turnId:u,ownerId:u}).strict(),e.object({action:e.literal("includeTaskInputs"),sessionId:u,turnId:u,ownerId:u,requestId:u}).strict(),e.object({action:e.literal("settleTaskInputRequest"),requestId:u,outcome:e.enum(["resolved","failed","replaced"])}).strict(),e.object({action:e.literal("sealTaskInboxTurn"),sessionId:u,turnId:u,ownerId:u}).strict(),e.object({action:e.literal("sealNativeTaskInboxTurn"),sessionId:u,turnId:u,ownerId:u}).strict(),e.object({action:e.literal("closeTaskInboxTurn"),sessionId:u,turnId:u,ownerId:u,outcome:e.enum(["completed","failed","interrupted"])}).strict(),e.object({action:e.literal("taskInboxPaused"),sessionId:u}).strict(),e.object({action:e.literal("reserveTaskFollowup"),sessionId:u,turnId:u,ownerId:u}).strict(),e.object({action:e.literal("taskInboxWakeTargets"),afterSessionId:e.string().max(200)}).strict(),e.object({action:e.literal("createTaskWait"),value:ie}).strict(),e.object({action:e.literal("settleTaskWait"),id:u,state:ie.shape.state}).strict(),e.object({action:e.literal("taskWaitsForSession"),sessionId:u,afterId:e.string().max(200)}).strict(),e.object({action:e.literal("commitSubagentCompletion"),value:ne,turnId:u}).strict(),e.object({action:e.literal("pendingTaskCompletions"),afterTurnId:e.string().max(200)}).strict(),e.object({action:e.literal("settleTaskCompletion"),turnId:u,inputId:u}).strict(),e.object({action:e.literal("upsertSubagentRun"),value:ne}).strict(),e.object({action:e.literal("getSubagentRun"),id:u}).strict(),e.object({action:e.literal("listSubagentRuns"),query:He}).strict()]);var H=e.string().trim().min(1).max(191),oe=e.object({createdAt:e.string().min(1),id:H}).strict(),ae=e.enum(["trigger_decision","route_decision","refiner_outcome","proposal","targeted_validation","apply_receipt"]),ce=e.discriminatedUnion("action",[e.object({action:e.literal("active_release"),workspaceId:H}).strict(),e.object({action:e.literal("put_artifact"),workspaceId:H,kind:ae,artifact:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("artifact_page"),workspaceId:H,kind:ae,before:oe.nullable(),limit:e.number().int().min(1).max(200)}).strict(),e.object({action:e.literal("pending_trigger_page"),workspaceId:H,before:oe.nullable(),limit:e.number().int().min(1).max(200)}).strict()]);var w=e.string().trim().min(1).max(240),le=e.string().regex(/^[a-f0-9]{64}$/),ue=e.enum(["run_overlay","observation","trigger_decision","route_decision","proposal","targeted_validation","apply_receipt","refiner_outcome"]),de=e.object({createdAt:e.string().datetime(),id:w}).strict(),pe=e.discriminatedUnion("action",[e.object({action:e.literal("artifact_put"),workspaceId:w,kind:ue,artifact:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("artifact_page"),workspaceId:w,kind:ue,before:de.nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("pending_page"),workspaceId:w,before:de.nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("workspace_get"),workspaceId:w}).strict(),e.object({action:e.literal("background_get"),workspaceId:w}).strict(),e.object({action:e.literal("overlay_get"),runId:w}).strict(),e.object({action:e.literal("overlay_freeze"),runId:w,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:w,sessionId:w,key:w}).strict(),e.object({action:e.literal("memory_page"),workspaceId:w,sessionId:w,before:e.object({updatedAt:e.string().datetime(),key:w}).strict().nullable(),limit:e.number().int().min(1).max(20),includeDeleted:e.boolean()}).strict(),e.object({action:e.literal("memory_write"),sessionId:w,input:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("release_get"),contentHash:le}).strict(),e.object({action:e.literal("release_put"),record:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("session_get"),sessionId:w}).strict(),e.object({action:e.literal("turn_get"),turnId:w}).strict(),e.object({action:e.literal("turn_page"),sessionId:w,before:e.number().int().positive().nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("event_page"),turnId:w,afterSequence:e.number().int().nonnegative(),names:e.array(w).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:w,expectedHash:le,snapshot:e.record(e.string(),e.unknown())}).strict()]);var j=e.string().trim().min(1).max(200),me=e.string().regex(/^[a-f0-9]{64}$/),Me=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()}),he=e.object({id:j,title:e.string().trim().min(1).max(240),sourceTaskId:j,sourceTurnId:j,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:me,validation:e.array(Me).max(32)}).strict(),fe=e.object({sessionId:j,turnId:j,output:he}).strict(),be=e.object({uploadId:j,index:e.number().int().min(0).max(1024),offset:e.number().int().min(0).max(1e7),sha256:me,contentsBase64:e.string().min(1).max(131072)}).strict(),ge=e.object({uploadId:j}).strict(),Ve=he.pick({id:!0,title:!0,sourceTaskId:!0,sourceTurnId:!0,revision:!0,createdAt:!0,validation:!0}),we=e.object({sessionId:j,turnId:j,output:Ve,sandboxPath:e.string().trim().min(1).max(4096)}).strict();var M=e.string().trim().min(1).max(200),Ue=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:M.optional(),payload:e.unknown().optional(),processId:M.optional(),failOnUnpreservedChanges:e.boolean().optional()}).strict().superRefine((n,t)=>{n.type!=="create"&&!n.sandboxId&&t.addIssue({code:"custom",message:"Sandbox identity is required."}),n.type==="create"&&n.sandboxId&&t.addIssue({code:"custom",message:"Create cannot target a sandbox identity."}),n.type==="process_get"&&!n.processId&&t.addIssue({code:"custom",message:"Process identity is required."})}),ve=e.object({action:Ue}).strict(),xe=e.object({sessionId:M,turnId:M,name:M}).strict();var p=1,a=e.string().trim().min(1).max(191),C=e.number().int().min(1).max(200),Ot=e.object({teamId:a,ownerUserId:a,workspaceId:a,conversationId:a,turnId:a,attempt:e.number().int().min(1),leaseGeneration:e.number().int().min(1)}).strict(),Ie=e.discriminatedUnion("operation",[e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile-evaluations/grade"),params:e.object({action:e.enum(["upload","execute"]),callId:a,sessionId:a,turnId:a,sha256:e.string().regex(/^[a-f0-9]{64}$/),sizeBytes:e.number().int().positive().max(2e7),timeoutMs:e.number().int().positive().max(3e5),offset:e.number().int().nonnegative().max(2e7).optional(),contentsBase64:e.string().max(131072).optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile-evaluations/sandbox"),params:e.object({sessionId:a,turnId:a,action:e.enum(["upload","exec","read","stop"]),area:e.enum(["policy","runtime"]).optional(),path:e.string().min(1).max(4096).optional(),sha256:e.string().regex(/^[a-f0-9]{64}$/).optional(),sizeBytes:e.number().int().min(0).max(1e7).optional(),offset:e.number().int().min(0).max(1e7).optional(),contentsBase64:e.string().max(131072).optional(),command:e.string().min(1).max(2e4).optional(),stdin:e.string().max(12e4).optional(),cwd:e.string().max(4096).optional(),timeoutMs:e.number().int().min(1).max(18e4).optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/list"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/read"),params:e.object({fileId:a,revision:e.number().int().min(1),offset:e.number().int().min(0).max(1e7).optional(),maxChars:e.number().int().min(1).max(1e5).optional(),firstPage:e.number().int().min(1).max(1e3).optional(),pageCount:e.number().int().min(1).max(10).optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/readBytes"),params:e.object({sessionId:a,turnId:a,fileId:a,revision:e.number().int().positive(),sha256:e.string().regex(/^[a-f0-9]{64}$/),sizeBytes:e.number().int().min(1).max(1e7),offset:e.number().int().min(0).max(1e7)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile.externalDataset.authorize"),params:e.object({bindingHash:e.string().regex(/^[a-f0-9]{64}$/),manifestHash:e.string().regex(/^[a-f0-9]{64}$/).optional(),taskId:a.optional(),seed:e.string().min(1).max(500).optional()}).strict().refine(n=>!!n.taskId==!!n.seed,"Case authority requires both task and seed.")}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("experiment/environment"),params:G}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("experiment/policy"),params:e.object({caseId:a,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(p),requestId:a,operation:e.literal("sandbox/request"),params:ve}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("embedding/authorize"),params:xe}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/begin"),params:fe}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/chunk"),params:be}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/complete"),params:ge}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/saveSandboxFile"),params:we}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("settings/get"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/get"),params:e.object({reference:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/overlay/get"),params:e.object({runId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/overlay/put"),params:e.object({runId:a,expectedRevision:e.number().int().min(0).nullable(),overlay:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/overlay/freezeProposal"),params:e.object({runId:a,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(p),requestId:a,operation:e.literal("harness/memory/get"),params:e.object({workspaceId:a,key:e.string().min(1).max(120)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/list"),params:e.object({workspaceId:a,includeDeleted:e.boolean(),before:e.object({updatedAt:e.string(),key:e.string()}).strict().nullable(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/search"),params:e.object({workspaceId:a,query:e.string().trim().min(1).max(500),limit:e.number().int().min(1).max(20)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/write"),params:e.object({input:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/state/read"),params:e.object({workspaceId:a,kind:e.enum(["selection","workspace_settings","evaluation_review_settings","candidates","cross_run_requests"]),afterId:a.nullable(),limit:e.number().int().min(1).max(100)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,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:a}).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:a}).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(p),requestId:a,operation:e.literal("harness/workspace/transition"),params:e.discriminatedUnion("action",[e.object({action:e.literal("advance"),receiptId:a,workspaceId:a,proposal:e.record(e.string(),e.unknown()),validations:e.array(e.record(e.string(),e.unknown())).max(100),nextRelease:e.object({id:a,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:a,workspaceId:a,proposal:e.record(e.string(),e.unknown()),validations:e.array(e.record(e.string(),e.unknown())).max(100),nextRelease:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),nextSourceRevision:e.string().min(1),reviewer:a,now:e.string()}).strict(),e.object({action:e.literal("rollback"),receiptId:a,workspaceId:a,expectedWorkspaceRevision:e.number().int().nonnegative(),expectedChannelRevision:e.number().int().nonnegative(),targetRelease:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),targetSourceRevision:e.string().min(1),rollbackOf:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),now:e.string()}).strict()])}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("task-inbox/execute"),params:se}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/review/execute"),params:pe}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("refiner/execute"),params:e.object({action:ce}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("create-improve/execute"),params:e.discriminatedUnion("action",[e.object({action:e.literal("get"),runId:a}).strict(),e.object({action:e.literal("page"),query:e.object({profileId:a.nullable(),targetKind:a.nullable(),targetId:a.nullable(),state:e.array(a).max(20)}).strict(),before:e.object({updatedAt:e.string(),id:a}).strict().nullable(),limit:C}).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(p),requestId:a,operation:e.literal("approval/get"),params:e.object({approvalId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,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(p),requestId:a,operation:e.literal("usage/getByRequestId"),params:e.object({requestId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("usage/upsert"),params:e.object({record:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("usage/page"),params:e.object({query:e.object({sessionId:a.optional(),turnId:a.optional(),provider:a.optional(),model:a.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:a}).strict().nullable(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("capabilities"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/count"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/get"),params:e.object({sessionId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/page"),params:e.object({afterId:a.nullable(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/put"),params:e.object({sessionId:a,expectedRevision:e.number().int().min(1).nullable(),session:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/count"),params:e.object({sessionId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/wakeCount"),params:e.object({sessionId:a,key:e.enum(["messageId","fromRunId"]),value:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/get"),params:e.object({turnId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/put"),params:e.object({sessionId:a,turnId:a,expectedRevision:e.number().int().min(1).nullable(),turn:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/latest"),params:e.object({sessionId:a,status:e.enum(["in_progress","completed","failed","interrupted"]).nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/page"),params:e.object({sessionId:a,beforeSortIndex:e.number().int().min(0).nullable().optional(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("thread/turnPage"),params:e.object({sessionId:a,beforeSortIndex:e.number().int().min(0).nullable().optional(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("event/append"),params:e.object({event:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("events/page"),params:e.object({sessionId:a.nullable(),afterSequence:e.number().int().min(0),beforeSequence:e.number().int().min(1).nullable().optional(),limit:C,excludeReasoningDeltas:e.boolean().optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("events/latestAssistantText"),params:e.object({sessionId:a}).strict()}).strict()]),Bt=e.object({contractVersion:e.literal(p),operations:e.array(e.enum(["experiment/policy","experiment/environment","sandbox/request","embedding/authorize","output/begin","output/chunk","output/complete","output/saveSandboxFile","output/list","output/read","output/readBytes","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","profile-evaluations/sandbox","profile-evaluations/grade","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(50),allowedTools:e.array(a).max(128),maxPageSize:C,maxRequestBytes:e.number().int().min(1).max(8388608),maxInFlight:e.number().int().min(1).max(64)}).strict();var ye=class{static{o(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,r=15e3){let i=Ie.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 s=`host-storage:${this.#r++}`,c={jsonrpc:"2.0",id:s,method:"host/storage",params:i},l=i.operation==="experiment/policy"||i.operation==="experiment/environment";if(Buffer.byteLength(JSON.stringify(c))>(l?8388608:256e3))throw new Error("Host storage request is too large.");let d=new Promise((m,h)=>{let y=i.operation==="profile-evaluations/grade"?42e4:i.operation==="sandbox/request"||i.operation==="profile-evaluations/sandbox"||l?3e5:6e4,b=setTimeout(()=>{this.#e.delete(s),h(new Error("Host storage request timed out."))},Math.max(1,Math.min(y,r)));this.#e.set(s,{resolve:m,reject:h,timer:b,maxResponseBytes:i.operation==="experiment/environment"?16e5:1e6})});try{await this.#t(c)}catch(m){let h=this.#e.get(s);h&&(clearTimeout(h.timer),this.#e.delete(s),h.reject(m instanceof Error?m:new Error(String(m))))}return d}accept(t){let r=F.safeParse(t),i=r.success?null:J.safeParse(t),s=r.success?r.data:i?.success?i.data:null;if(!s||typeof s.id!="string"||!s.id.startsWith("host-storage:"))return!1;let c=this.#e.get(s.id);return c?(clearTimeout(c.timer),this.#e.delete(s.id),Buffer.byteLength(JSON.stringify(s))>c.maxResponseBytes?(c.reject(new Error("Host storage response is too large.")),!0):("error"in s?c.reject(new Error(`Host storage request failed: ${s.error.message}`)):c.resolve(s.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 Oe}from"node:events";import{createInterface as Be}from"node:readline";async function Qt(n){let t=null,r=Promise.resolve(),i=[],s=o(g=>(r=r.then(async()=>{n.writable.write(`${JSON.stringify(g)}
3
3
  `)||await Oe(n.writable,"drain")}),r),"write");n.hostStorageClient?.bind(g=>s(g));let c=o(()=>{if(!(!t?.initialized||i.length===0))for(let g of i.splice(0))s(g)},"flushPendingNotifications"),l,d=new Set,m=Be({input:n.readable,crlfDelay:1/0}),h=[],y=!1,b=null,v=o(async g=>{let f=t;if(!f)throw new Error("Agent runtime dispatcher is unavailable.");let E=(async()=>{let X=await f.handle(g);X&&await s(X),c()})(),Q=g&&typeof g=="object"&&"method"in g?g.method:null;if(Q==="initialize"||Q==="initialized"){await E;return}d.add(E),E.finally(()=>d.delete(E))},"dispatch"),I=(async()=>{let g=typeof n.host=="function"?await n.host():n.host;for(t=new B(g),l=g.subscribe?.(f=>{if(!t?.initialized){i.push(f);return}s(f)});h.length>0;)await v(h.shift());y=!0})().catch(g=>{b=g,m.close()});try{for await(let g of m){if(!g.trim())continue;if(Buffer.byteLength(g,"utf8")>1e6){await s({jsonrpc:"2.0",id:null,error:{code:-32600,message:"Request exceeds the JSONL size limit"}});continue}let f;try{f=JSON.parse(g)}catch{await s({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}});continue}if(!n.hostStorageClient?.accept(f))if(y)await v(f);else if(h.length>=64){let E=f&&typeof f=="object"&&"id"in f?f.id:null;(typeof E=="string"||typeof E=="number")&&await s({jsonrpc:"2.0",id:E,error:{code:-32e3,message:"Runtime startup request limit exceeded"}})}else h.push(f)}if(await I,b)throw b;await Promise.all(d),await r}finally{n.hostStorageClient?.close(),l?.()}}o(Qt,"runAgentJsonlServer");var N=e.object({threadId:e.string().trim().min(1)}).passthrough(),$e=N.extend({includeHistory:e.boolean().optional()}),Ne=e.object({session:e.unknown()}).strict(),V=N.extend({input:e.unknown()}),Le=V.extend({idempotencyKey:e.string().trim().min(1).max(200)}),De=V.extend({inputId:e.string().trim().min(1)}),We=N.extend({reason:e.string().trim().min(1).optional()}),Fe=e.object({approvalId:e.string().trim().min(1),input:e.unknown()}).strict();function sr(n){let t=o(async(i,s,c)=>{let l=performance.now();n.telemetry?.({method:i,phase:"started",threadId:s,durationMs:null,errorClass:null});try{let d=await c();return n.telemetry?.({method:i,phase:"completed",threadId:s,durationMs:performance.now()-l,errorClass:null}),d}catch(d){throw n.telemetry?.({method:i,phase:"failed",threadId:s,durationMs:performance.now()-l,errorClass:d instanceof Error?d.name:"UnknownError"}),d}},"run"),r=o(async(i,s="thread/read")=>{let{threadId:c,includeHistory:l}=$e.parse(i);return t(s,c,async()=>{if(l===!1)return{thread:await n.readThread(c),turns:[],events:[]};let[d,m,h]=await Promise.all([n.readThread(c),n.listTurns(c),n.listEvents(c)]);return{thread:d,turns:m,events:h}})},"threadRead");return{capabilities:o(i=>t("runtime/capabilities",null,()=>n.capabilities(i)),"capabilities"),threadStart:o(async i=>t("thread/start",null,async()=>({thread:await n.createThread(Ne.parse(i).session)})),"threadStart"),threadResume:o(i=>r(i,"thread/resume"),"threadResume"),threadRead:r,turnStart:o(async i=>{let s=V.parse(i);return t("turn/start",s.threadId,async()=>({turn:await n.startTurn(s.threadId,s.input)}))},"turnStart"),turnSteer:o(async i=>{let s=V.parse(i);return t("turn/steer",s.threadId,async()=>({receipt:await n.steerTurn(s.threadId,s.input)}))},"turnSteer"),taskInbox:o(async i=>{let{threadId:s}=N.parse(i);return t("task/inbox",s,()=>n.readTaskInbox(s))},"taskInbox"),taskQueue:o(async i=>{let s=Le.parse(i);return t("task/queue",s.threadId,()=>n.queueTaskInput(s.threadId,s.input,s.idempotencyKey))},"taskQueue"),taskInputUpdate:o(async i=>{let s=De.parse(i);return t("task/inputUpdate",s.threadId,()=>n.updateTaskInput(s.threadId,s.inputId,s.input))},"taskInputUpdate"),turnInterrupt:o(async i=>{let s=We.parse(i);return t("turn/interrupt",s.threadId,async()=>({turn:await n.interruptTurn(s.threadId,s.reason)}))},"turnInterrupt"),approvalResolve:o(async i=>{let s=Fe.parse(i);return t("approval/resolve",null,async()=>({approval:await n.resolveApproval(s.approvalId,s.input)}))},"approvalResolve"),userInputResolve:o(async i=>{let s=V.parse(i);return t("userInput/resolve",s.threadId,async()=>(n.isTurnActive(s.threadId)&&await n.waitForTurnSettlement(s.threadId),{turn:await n.startTurn(s.threadId,s.input)}))},"userInputResolve"),profileWorkflows:o(()=>t("profile/workflows",null,()=>n.listProfileWorkflows()),"profileWorkflows"),profileEvaluations:o(i=>t("profile/evaluations",null,()=>n.listProfileEvaluations(i)),"profileEvaluations"),profileTrainingSource:o(()=>t("profile/trainingSource",null,()=>n.loadProfileTrainingSource()),"profileTrainingSource"),profileEvaluationPrepare:o(i=>t("profile/evaluations/prepare",null,()=>n.prepareProfileEvaluationRun(i)),"profileEvaluationPrepare"),profileEvaluationRun:o(i=>t("profile/evaluations/run",null,()=>n.runPreparedProfileEvaluation(i)),"profileEvaluationRun"),...n.executeExperimentCase?{experimentExecuteCase:o(i=>t("experiments/executeCase",null,()=>n.executeExperimentCase(i)),"experimentExecuteCase")}:{},...n.cancelExperimentCase?{experimentCancelCase:o(i=>t("experiments/cancelCase",null,()=>n.cancelExperimentCase(i)),"experimentCancelCase")}:{},profileEvaluationRunSuite:o(i=>t("profile/evaluations/runSuite",null,()=>n.runProfileEvaluationSuite(i)),"profileEvaluationRunSuite"),profileEvaluationExecuteCase:o(i=>t("profile/evaluations/executeCase",null,()=>n.executeProfileEvaluationCase(i)),"profileEvaluationExecuteCase"),profileEvaluationExecuteRun:o(i=>t("profile/evaluations/executeRun",null,()=>n.executeProfileEvaluationRun(i)),"profileEvaluationExecuteRun"),profileEvaluationCompare:o(i=>t("profile/evaluations/compare",null,()=>n.compareProfileEvaluationRuns(i)),"profileEvaluationCompare"),profileEvaluationReport:o(i=>t("profile/evaluations/report",null,()=>n.buildProfileEvaluationReport(i)),"profileEvaluationReport"),harnessInspect:o(()=>t("harness/inspect",null,()=>n.inspectHarness()),"harnessInspect"),harnessProposalReview:o(i=>t("harness/proposalReview",null,()=>n.reviewHarnessProposal(i)),"harnessProposalReview"),harnessReview:o(i=>t("harness/review",null,()=>n.reviewHarness(i)),"harnessReview"),harnessAcceptEvaluationReview:o(i=>t("harness/acceptEvaluationReview",null,()=>n.acceptHarnessEvaluationReview(i)),"harnessAcceptEvaluationReview"),harnessMaterializeEvaluationTaskset:o(i=>t("harness/materializeEvaluationTaskset",null,()=>n.materializeHarnessEvaluationTaskset(i)),"harnessMaterializeEvaluationTaskset"),harnessRunEvaluationBaseline:o(i=>t("harness/runEvaluationBaseline",null,()=>n.runHarnessEvaluationBaseline(i)),"harnessRunEvaluationBaseline"),harnessValidate:o(()=>t("harness/validate",null,()=>n.validateHarness()),"harnessValidate"),harnessBackgroundReview:o(i=>t("harness/backgroundReview",null,()=>n.updateHarnessBackgroundReview(i)),"harnessBackgroundReview"),harnessDiff:o(i=>t("harness/diff",null,()=>n.diffHarness(i)),"harnessDiff"),harnessRollback:o(i=>t("harness/rollback",null,()=>n.rollbackHarness(i)),"harnessRollback"),refinerInspect:o(()=>t("refiner/inspect",null,()=>n.inspectRefiner()),"refinerInspect"),refinerUpdate:o(i=>t("refiner/update",null,()=>n.updateRefiner(i)),"refinerUpdate"),refinerActivate:o(i=>t("refiner/activate",null,()=>n.activateRefiner(i)),"refinerActivate"),refinerRollback:o(i=>t("refiner/rollback",null,()=>n.rollbackRefiner(i)),"refinerRollback"),subscribe:n.subscribeEvents&&n.eventNotification?i=>n.subscribeEvents(s=>i(n.eventNotification(s))):void 0}}o(sr,"createAgentRuntimeService");var q=e.string().regex(/^[a-f0-9]{64}$/),Je=e.object({harnessReleaseHash:q,instructionsHash:q,skillHashes:e.record(e.string(),q),agentAssetHashes:e.record(e.string(),q),toolCatalogHash:q,memoryRevision:e.number().int().nonnegative().nullable()}).strict(),Ge=e.object({protocolVersion:e.string().trim().min(1),threadId:e.string().trim().min(1),turnId:e.string().trim().min(1),harnessReleaseHash:q,toolCatalogHash:q,context:e.record(e.string(),e.unknown()),pendingInteraction:e.record(e.string(),e.unknown()).nullable(),usage:e.record(e.string(),e.unknown())}).strict();function ur(n){return R(Je.parse(n))}o(ur,"effectiveSurfaceHash");function dr(n){return R(Ge.parse(n))}o(dr,"checkpointHash");function pr(n){return[n.system,...n.harnessInstructions,...n.skillInstructions,...n.hostInstructions??[]].map(t=>t.trim()).filter(Boolean).join(`
4
4
 
5
5
  `)}o(pr,"materializeAgentPrompt");function gr(n){let t=new Map;for(let l of n){let d=l.name.trim();if(!d)throw new Error("Agent tool names cannot be empty.");if(t.has(d))throw new Error(`Duplicate agent tool: ${d}.`);if(!l.unavailableReason&&!l.execute)throw new Error(`Agent tool ${d} is declared as available without an executor.`);t.set(d,{...l,name:d})}let r=[...t.values()].sort((l,d)=>l.name.localeCompare(d.name)),i=r.filter(l=>!l.unavailableReason).map(l=>({name:l.name,description:l.description,inputSchema:e.toJSONSchema(l.inputSchema,{target:"draft-7",unrepresentable:"any"})})),s=r.map(l=>({name:l.name,displayLabel:l.displayLabel??l.name,placement:l.placement,available:!l.unavailableReason,unavailableReason:l.unavailableReason??null})),c=R({modelTools:i,capabilities:s});return{byName:t,tools:r,modelTools:i,capabilities:s,hash:c}}o(gr,"createAgentToolCatalog");async function wr(n,t){let r=n.byName.get(t.name);if(!r)throw new Error(`Unknown agent tool: ${t.name}.`);if(r.unavailableReason)throw new Error(`Agent tool ${t.name} is unavailable: ${r.unavailableReason}`);if(!r.execute)throw new Error(`Agent tool ${t.name} has no executor.`);return r.execute(r.inputSchema.parse(t.arguments),t.context)}o(wr,"executeAgentTool");function vr(n){let t=new Set,r=[...n].map(c=>{let l=c.name.trim();if(!l)throw new Error("Agent tool names cannot be empty.");if(t.has(l))throw new Error(`Duplicate agent tool: ${l}.`);if(t.add(l),!c.unavailableReason&&!c.executorAvailable)throw new Error(`Agent tool ${l} is declared as available without an executor.`);return{...c,name:l}}).sort((c,l)=>c.name.localeCompare(l.name)),i=r.filter(c=>!c.unavailableReason).map(c=>({name:c.name,description:c.description,inputSchema:c.inputSchema})),s=r.map(c=>({name:c.name,displayLabel:c.displayLabel??c.name,placement:c.placement,available:!c.unavailableReason,unavailableReason:c.unavailableReason??null}));return{byName:new Map(r.map(c=>[c.name,c])),tools:r,modelTools:i,capabilities:s,hash:R({modelTools:i,capabilities:s})}}o(vr,"createAgentToolCatalogProjection");async function xr(n,t){let r=n.byName.get(t.name);if(!r)throw new Error(`Unknown agent tool: ${t.name}.`);if(r.unavailableReason)throw new Error(`Agent tool ${t.name} is unavailable: ${r.unavailableReason}`);if(!r.execute)throw new Error(`Agent tool ${t.name} has no executor.`);let i=r.validateArguments?r.validateArguments(t.arguments):t.arguments;return r.execute(i,t.context)}o(xr,"executeProjectedAgentTool");var ke=class{static{o(this,"TaskSignals")}#e=new Map;notify(t){for(let r of[...this.#e.get(t)??[]])r()}subscribe(t,r){let i=this.#e.get(t);return i||this.#e.set(t,i=new Set),i.add(r),()=>{i.delete(r),i.size===0&&this.#e.delete(t)}}async wait(t){let r=o(()=>{},"wake"),i=0,s=o(()=>{i+=1,r()},"changed"),c=[...new Set(t.taskIds)].map(d=>this.subscribe(d,s)),l=setTimeout(s,Math.max(0,t.deadline-Date.now()));t.signal.addEventListener("abort",s);try{for(;;){t.signal.throwIfAborted();let d=i,m=await t.read();if(m!==null)return m;if(Date.now()>=t.deadline)return null;i===d&&await new Promise(h=>{r=h,(i!==d||t.signal.aborted)&&h()})}}finally{clearTimeout(l),t.signal.removeEventListener("abort",s);for(let d of c)d()}}},je=class{static{o(this,"TaskSerialExecutor")}#e=new Map;async run(t,r){let s=(this.#e.get(t)??Promise.resolve()).then(r),c=s.then(()=>{},()=>{});this.#e.set(t,c);try{return await s}finally{this.#e.get(t)===c&&this.#e.delete(t)}}};var L=class extends Error{static{o(this,"AcpRpcError")}code;data;constructor(t,r,i){super(r),this.code=t,this.data=i,this.name="AcpRpcError"}};import{execFile as Ke}from"node:child_process";function k(n,t){if(n.pid){if(process.platform==="win32"){Ke("taskkill",["/PID",String(n.pid),"/T",...t==="SIGKILL"?["/F"]:[]],{windowsHide:!0},()=>{});return}try{process.kill(-n.pid,t)}catch(r){if(r.code!=="ESRCH")throw r}}}o(k,"signalNativeProcess");import{spawn as Qe}from"node:child_process";import{StringDecoder as Xe}from"node:string_decoder";var K=8*1024*1024,D={outcome:{outcome:"cancelled"}};function P(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}o(P,"object");var _e=class{static{o(this,"AcpClient")}options;child=null;pending=new Map;sessions=new Set;activePrompts=new Set;permissions=new Map;nextId=1;buffer="";decoder=new Xe("utf8");initialized=null;updateQueue=Promise.resolve();stopped=!1;constructor(t){this.options=t}initialize(){return this.initialized?this.initialized:(this.initialized=this.connect(),this.initialized)}async connect(){if(this.stopped)throw new Error("ACP client is closed; reconnect with a new client.");let t=Qe(this.options.command,this.options.args,{cwd:this.options.cwd,env:this.options.env??process.env,stdio:["pipe","pipe","pipe"],shell:!1,detached:process.platform!=="win32"});this.child=t,t.stdout.on("data",r=>this.consume(this.decoder.write(r))),t.stderr.resume(),t.stdin.on("error",r=>this.fail(r)),t.on("error",r=>this.fail(r)),t.on("exit",(r,i)=>this.fail(new Error(`ACP agent exited (${i??r??"unknown"}).`)));try{let r=await this.request("initialize",{protocolVersion:1,clientInfo:{name:"openpond",title:"OpenPond",version:"1"},clientCapabilities:{fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}}});if(r.protocolVersion!==1)throw new Error(`Unsupported ACP protocol version: ${r.protocolVersion}`);return r}catch(r){throw await this.stop(),r}}async authenticate(t){let i=(await this.initialize()).authMethods?.find(s=>s.id===t);if(!i)throw new Error("The agent did not advertise this authentication method.");if(i.type==="terminal")throw new Error("Run the agent's terminal login, then reconnect.");await this.request("authenticate",{methodId:t})}async createSession(t,r=[]){await this.initialize();let i=await this.request("session/new",{cwd:t,mcpServers:r});if(typeof i.sessionId!="string"||!i.sessionId)throw new Error("Agent returned no native session identity.");return this.sessions.add(i.sessionId),i}async loadSession(t,r,i=[]){if(!(await this.initialize()).agentCapabilities?.loadSession)throw new Error("This agent does not support native session loading.");this.sessions.add(t);try{let c=await this.request("session/load",{sessionId:t,cwd:r,mcpServers:i});return await this.updateQueue,{...c,sessionId:t}}catch(c){throw this.sessions.delete(t),c}}async setModel(t,r){this.assertSession(t),await this.request("session/set_model",{sessionId:t,modelId:r})}async setMode(t,r){this.assertSession(t),await this.request("session/set_mode",{sessionId:t,modeId:r})}async setConfigOption(t,r,i){return this.assertSession(t),await this.request("session/set_config_option",{sessionId:t,configId:r,value:i})}async prompt(t,r,i){if(this.assertSession(t),i?.aborted)throw new Error("ACP prompt cancelled.");if(this.activePrompts.has(t))throw new Error("A prompt is already active for this native session.");this.activePrompts.add(t);let s,c=o(()=>{this.cancel(t),s=setTimeout(()=>{this.stop()},5e3),s.unref()},"abort");i?.addEventListener("abort",c,{once:!0});try{let l=await this.request("session/prompt",{sessionId:t,prompt:r},0);return await this.updateQueue,i?.aborted?{...l,stopReason:"cancelled"}:l}catch(l){if(i?.aborted)return{stopReason:"cancelled"};throw l}finally{s&&clearTimeout(s),i?.removeEventListener("abort",c),this.activePrompts.delete(t),this.cancelPermissions(t)}}cancel(t){this.cancelPermissions(t),this.sessions.has(t)&&this.child&&this.write({jsonrpc:"2.0",method:"session/cancel",params:{sessionId:t}})}async stop(){if(this.stopped)return;this.stopped=!0;let t=this.child;this.fail(new Error("ACP connection closed.")),!(!t||t.exitCode!==null||t.signalCode!==null)&&await new Promise(r=>{let i=setTimeout(()=>k(t,"SIGKILL"),2e3);i.unref(),t.once("exit",()=>{clearTimeout(i),r()}),k(t,"SIGTERM")})}assertSession(t){if(!this.sessions.has(t))throw new Error("Session does not belong to this ACP connection.")}request(t,r,i=this.options.requestTimeoutMs??3e4){let s=this.nextId++;return new Promise((c,l)=>{let d=i>0?setTimeout(()=>{this.pending.delete(s),l(new Error(`ACP request timed out: ${t}`))},i):void 0;d?.unref(),this.pending.set(s,{resolve:c,reject:l,timer:d});try{this.write({jsonrpc:"2.0",id:s,method:t,params:r})}catch(m){d&&clearTimeout(d),this.pending.delete(s),l(m)}})}write(t){if(!this.child||this.child.stdin.destroyed)throw new Error("ACP connection is not running.");let r=JSON.stringify(t);if(Buffer.byteLength(r)>K)throw new Error("ACP frame exceeds the size limit.");this.child.stdin.write(`${r}
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{Fa as j}from"./chunk-XDMUD4FW.js";import{n as _,o as k,r as U,u as L,w as O,x as V}from"./chunk-WV2APYWG.js";import{Y as C,h as b,i as x}from"./chunk-PJM2G7SG.js";import{i as M,m as p,n as T}from"./chunk-NNF6KCHD.js";import{b as v}from"./chunk-ES2ISFJC.js";import{a as I}from"./chunk-FTQLQJQV.js";var y=v.object({sessionId:v.string().trim().min(1).max(500),turnId:v.string().trim().min(1).max(500)}).strict();async function Q(e){L(e.manifest,e.taskset,e.catalog),V(e.taskset,e.metricSource);let o=e.manifest.profileEvaluation,t=e.catalog.definitions.find(a=>a.id===o.definitionId),d=new Map(e.taskset.tasks.map(a=>[a.id,a])),h=[],r=[];for(let a of e.manifest.population){e.signal?.throwIfAborted();let l=d.get(a.taskId),s=await e.loadCompletedMember?.(a)??null;if(s){let{receipt:m,grade:u}=s,{contentHash:H,...g}=b.parse(u);if(!k(m)||H!==p(g)||m.id!==a.receiptId||m.runManifest.id!==e.manifest.id||m.runManifest.contentHash!==e.manifest.contentHash||m.taskId!==a.taskId||m.seed!==a.seed||m.graderEvidenceRefs.length!==1||m.graderEvidenceRefs[0]?.contentHash!==H||u.taskHash!==p(l)||u.graderSetHash!==p(e.taskset.graders)||m.metadata.score!==u.score||m.metadata.passed!==u.passed)throw new Error(`Retained Profile evaluation member ${a.receiptId} differs from its admitted evidence.`);r.push(u),h.push(m);continue}let n=await e.execute({task:C(l),seed:a.seed,source:o,...e.signal?{signal:e.signal}:{}});e.signal?.throwIfAborted();let c=await x({task:l,evidence:n.evidence,graders:e.taskset.graders,...e.modelJudge?{modelJudge:e.modelJudge}:{},...e.customVerifier?{customVerifier:e.customVerifier}:{},...e.signal?{signal:e.signal}:{}}),E=M.parse(await e.saveGrade(c));if(E.contentHash!==c.contentHash)throw new Error("Stored Profile evaluation grade differs from its graded evidence.");let w=n.failureClass??c.failureClass,P=_({schemaVersion:"openpond.attemptReceipt.v1",id:a.receiptId,runManifest:{id:e.manifest.id,contentHash:e.manifest.contentHash},taskId:a.taskId,seed:a.seed,terminal:n.terminal,failureClass:w,outputHash:n.evidence.infrastructureError?null:p(n.evidence.output),traceHash:n.traceHash,artifactRefs:n.artifactRefs,graderEvidenceRefs:[E],startedAt:n.startedAt,completedAt:n.completedAt,latencyMs:n.latencyMs,costUsd:n.costUsd,metadata:{gradingRole:"evaluation",score:c.score,passed:c.passed,rewardEligible:c.rewardEligible,sourceRevision:o.sourceRevision,definitionHash:o.definitionHash,environmentHash:o.environmentHash,...n.retainedEvidenceRef?{retainedEvidenceRef:y.parse(n.retainedEvidenceRef)}:{}}});await e.saveReceipt(P),r.push(c),h.push(P)}let i=await O({manifest:e.manifest,taskset:e.taskset,receipts:h,...e.metricSource!==void 0?{source:e.metricSource}:{},...e.signal?{signal:e.signal}:{}},e.metricExecutor),R=r.filter(a=>a.passed).length/r.length;return{receipts:h,grades:r,metric:i,passRate:R,passed:R>=t.criterion.minimumPassRate&&(!t.criterion.requireComplete||h.every(a=>a.terminal))}}I(Q,"executeProfileEvaluationRun");function q(e,o){if(o==="agent_action"){let t=e.find(d=>d.name==="workspace_action_result"&&d.action==="profile_workflow_action")?.output;if(typeof t!="string")throw new Error("Profile Agent action evaluation did not produce a released action result.");return t}return e.filter(t=>t.name==="assistant.delta"&&typeof t.output=="string").map(t=>t.output??"").join("")}I(q,"profileEvaluationOutput");async function z(e){let{store:o,manifest:t,receipt:d}=e;if(!d.metadata.retainedEvidenceRef)return null;let h=y.parse(d.metadata.retainedEvidenceRef),[r,i]=await Promise.all([o.getSession(h.sessionId),o.getTurn(h.turnId)]),R=r?.metadata?.profileEvaluationRun,a=t.profileEvaluation;if(!r||!i||i.sessionId!==r.id||!a||!r.currentProfile||p(r.currentProfile)!==p(e.profileRef)||p(R)!==p({id:t.id,contentHash:t.contentHash})||r.metadata?.taskId!==d.taskId||r.metadata?.seed!==d.seed||!i.completedAt||i.completedAt!==d.completedAt||i.startedAt!==d.startedAt||!i.harnessSnapshot||i.harnessSnapshot.harnessRelease.id!==a.harnessRelease.id||i.harnessSnapshot.harnessRelease.contentHash!==a.harnessRelease.contentHash||t.policy.kind!=="model"||!i.modelRef||i.modelRef.providerId!==t.policy.model.provider||i.modelRef.modelId!==t.policy.model.model)throw new Error("Retained Profile policy turn differs from its admitted case.");let l=await o.runtimeEventsForTurn(i.id);if(l.some(u=>u.turnId!==i.id)||p(l)!==d.traceHash)throw new Error("Retained Profile policy trace differs from its immutable receipt.");let s=q(l,a.target.kind);if(d.outputHash!==null&&p({text:s})!==d.outputHash)throw new Error("Retained Profile output differs from its immutable receipt.");let n=d.artifactRefs.flatMap(u=>{let H=l.filter(f=>(f.action==="work_output_save"||f.action==="sandbox_save_output")&&f.status==="completed").flatMap(f=>{let $=f.data&&typeof f.data=="object"?f.data:{},A=j.safeParse($.outputRef);return A.success?[A.data]:[]}).filter(f=>f.sourceTaskId===r.id&&f.sourceTurnId===i.id&&`${r.id}/${f.id}/${f.revision}/${f.title}`===u.id&&f.sha256===u.contentHash&&f.sizeBytes===u.sizeBytes&&f.contentType===u.mediaType);if(H.length!==1)throw new Error("The case output has no unique sealed saved-file identity.");let g=H[0];if(g.location.kind!=="managed")return[];let S=`/api/work/outputs/${encodeURIComponent(g.location.fileId)}`;if(g.location.downloadPath!==S)throw new Error("The saved output has no canonical managed download route.");return[{id:g.id,title:g.title,revision:g.revision,contentType:g.contentType,sizeBytes:g.sizeBytes,sha256:g.sha256,downloadPath:S}]}),c=await o.listModelUsageRecords({sessionId:r.id,turnId:i.id,limit:1e4}),E=e.eventAfterId?l.findIndex(u=>u.id===e.eventAfterId):-1;if(e.eventAfterId&&E<0)throw new Error("Profile trace cursor is unavailable in this case.");let w=E+1,P=Math.max(1,Math.min(250,e.eventLimit??100)),m=l.slice(w,w+P);return{ref:h,prompt:i.prompt,output:d.outputHash===null?null:{text:s},partialOutput:d.outputHash===null&&s?{text:s}:null,error:i.error,events:m,eventCount:l.length,nextEventCursor:w+m.length<l.length?m.at(-1).id:null,files:n,usage:c,usageCoverage:c.length===1e4?"partial":"complete"}}I(z,"readProfileEvaluationPolicyEvidence");var ne=v.object({runId:v.string().trim().min(1).max(240),receiptId:v.string().trim().min(1).max(500).optional(),eventAfterId:v.string().trim().min(1).max(500).optional(),eventLimit:v.number().int().min(1).max(250).optional(),manifest:U.optional()}).strict().refine(e=>e.receiptId||!e.eventAfterId&&!e.eventLimit,"Select a case before requesting its trace page.").refine(e=>!e.manifest||e.receiptId,"Interrupted-run inspection requires one exact case.");async function de(e){let o=await e.store.getProfileEvaluationRun(e.runId);if(o&&p(o.profileRef)!==p(e.profileRef))throw new Error("Profile evaluation run is unavailable in the selected Profile.");let t=o?.manifest??e.manifest;if(!t||!o&&!e.receiptId)throw new Error("Profile evaluation run is unavailable in the selected Profile.");if(o){if(e.manifest&&e.manifest.contentHash!==o.manifest.contentHash)throw new Error("Profile evaluation run differs from its pinned manifest.")}else if(T(t,"Interrupted Profile evaluation manifest"),t.id!==e.runId||t.profileEvaluation?.profileId!==e.profileRef.profileId||e.profileRef.source==="openpond_git"&&t.metadata.profileRepositoryId!==e.profileRef.repositoryId)throw new Error("Profile evaluation run is unavailable in the selected Profile.");let d=t.population.map((r,i)=>({member:r,index:i})).filter(({member:r})=>!e.receiptId||r.receiptId===e.receiptId);if(e.receiptId&&d.length!==1)throw new Error("Profile evaluation case is unavailable in the selected run.");let h=await Promise.all(d.map(async({member:r,index:i})=>{let R=o?null:await e.store.getProfileEvaluationReceipt(r.receiptId),a=o?.receiptRefs[i]??(R?{id:R.id,contentHash:R.contentHash}:null),l=o?.gradeRefs[i]??R?.graderEvidenceRefs[0];if(!a||!l)throw new Error("Profile evaluation run has incomplete case evidence.");let[s,n]=await Promise.all([e.store.getProfileEvaluationReceipt(a.id),e.store.getProfileEvaluationGrade(l.contentHash)]);if(!s||!o&&!k(s)||s.contentHash!==a.contentHash||s.id!==r.receiptId||s.taskId!==r.taskId||s.seed!==r.seed||s.runManifest.id!==t.id||s.runManifest.contentHash!==t.contentHash||!n||n.contentHash!==l.contentHash||!s.graderEvidenceRefs.some(c=>c.id===l.id&&c.contentHash===l.contentHash))throw new Error("Profile evaluation case evidence differs from its retained run.");return{taskId:r.taskId,seed:r.seed,receiptId:s.id,receiptHash:s.contentHash,traceHash:s.traceHash,outputHash:s.outputHash,score:n.score,passed:n.passed,gradingStatus:n.gradingStatus,failureClass:n.failureClass,artifactCount:s.artifactRefs.length,latencyMs:s.latencyMs,costUsd:s.costUsd,terminal:s.terminal,feedback:n.components.map(c=>({graderId:c.graderId,graderVersion:c.graderVersion,score:c.score,passed:c.passed,feedback:c.feedback})),...e.receiptId?{receipt:s,evidence:await z({store:e.store,profileRef:e.profileRef,manifest:t,receipt:s,eventAfterId:e.eventAfterId,eventLimit:e.eventLimit})}:{}}}));return{runId:t.id,sourceRevision:t.profileEvaluation?.sourceRevision??null,cases:h}}I(de,"inspectProfileEvaluationRun");export{Q as a,q as b,ne as c,de as d};
2
+ import{Fa as j}from"./chunk-2JO2KWT3.js";import{n as _,o as k,r as U,u as L,w as O,x as V}from"./chunk-WV2APYWG.js";import{Y as C,h as b,i as x}from"./chunk-PJM2G7SG.js";import{i as M,m as p,n as T}from"./chunk-NNF6KCHD.js";import{b as v}from"./chunk-ES2ISFJC.js";import{a as I}from"./chunk-FTQLQJQV.js";var y=v.object({sessionId:v.string().trim().min(1).max(500),turnId:v.string().trim().min(1).max(500)}).strict();async function Q(e){L(e.manifest,e.taskset,e.catalog),V(e.taskset,e.metricSource);let o=e.manifest.profileEvaluation,t=e.catalog.definitions.find(a=>a.id===o.definitionId),d=new Map(e.taskset.tasks.map(a=>[a.id,a])),h=[],r=[];for(let a of e.manifest.population){e.signal?.throwIfAborted();let l=d.get(a.taskId),s=await e.loadCompletedMember?.(a)??null;if(s){let{receipt:m,grade:u}=s,{contentHash:H,...g}=b.parse(u);if(!k(m)||H!==p(g)||m.id!==a.receiptId||m.runManifest.id!==e.manifest.id||m.runManifest.contentHash!==e.manifest.contentHash||m.taskId!==a.taskId||m.seed!==a.seed||m.graderEvidenceRefs.length!==1||m.graderEvidenceRefs[0]?.contentHash!==H||u.taskHash!==p(l)||u.graderSetHash!==p(e.taskset.graders)||m.metadata.score!==u.score||m.metadata.passed!==u.passed)throw new Error(`Retained Profile evaluation member ${a.receiptId} differs from its admitted evidence.`);r.push(u),h.push(m);continue}let n=await e.execute({task:C(l),seed:a.seed,source:o,...e.signal?{signal:e.signal}:{}});e.signal?.throwIfAborted();let c=await x({task:l,evidence:n.evidence,graders:e.taskset.graders,...e.modelJudge?{modelJudge:e.modelJudge}:{},...e.customVerifier?{customVerifier:e.customVerifier}:{},...e.signal?{signal:e.signal}:{}}),E=M.parse(await e.saveGrade(c));if(E.contentHash!==c.contentHash)throw new Error("Stored Profile evaluation grade differs from its graded evidence.");let w=n.failureClass??c.failureClass,P=_({schemaVersion:"openpond.attemptReceipt.v1",id:a.receiptId,runManifest:{id:e.manifest.id,contentHash:e.manifest.contentHash},taskId:a.taskId,seed:a.seed,terminal:n.terminal,failureClass:w,outputHash:n.evidence.infrastructureError?null:p(n.evidence.output),traceHash:n.traceHash,artifactRefs:n.artifactRefs,graderEvidenceRefs:[E],startedAt:n.startedAt,completedAt:n.completedAt,latencyMs:n.latencyMs,costUsd:n.costUsd,metadata:{gradingRole:"evaluation",score:c.score,passed:c.passed,rewardEligible:c.rewardEligible,sourceRevision:o.sourceRevision,definitionHash:o.definitionHash,environmentHash:o.environmentHash,...n.retainedEvidenceRef?{retainedEvidenceRef:y.parse(n.retainedEvidenceRef)}:{}}});await e.saveReceipt(P),r.push(c),h.push(P)}let i=await O({manifest:e.manifest,taskset:e.taskset,receipts:h,...e.metricSource!==void 0?{source:e.metricSource}:{},...e.signal?{signal:e.signal}:{}},e.metricExecutor),R=r.filter(a=>a.passed).length/r.length;return{receipts:h,grades:r,metric:i,passRate:R,passed:R>=t.criterion.minimumPassRate&&(!t.criterion.requireComplete||h.every(a=>a.terminal))}}I(Q,"executeProfileEvaluationRun");function q(e,o){if(o==="agent_action"){let t=e.find(d=>d.name==="workspace_action_result"&&d.action==="profile_workflow_action")?.output;if(typeof t!="string")throw new Error("Profile Agent action evaluation did not produce a released action result.");return t}return e.filter(t=>t.name==="assistant.delta"&&typeof t.output=="string").map(t=>t.output??"").join("")}I(q,"profileEvaluationOutput");async function z(e){let{store:o,manifest:t,receipt:d}=e;if(!d.metadata.retainedEvidenceRef)return null;let h=y.parse(d.metadata.retainedEvidenceRef),[r,i]=await Promise.all([o.getSession(h.sessionId),o.getTurn(h.turnId)]),R=r?.metadata?.profileEvaluationRun,a=t.profileEvaluation;if(!r||!i||i.sessionId!==r.id||!a||!r.currentProfile||p(r.currentProfile)!==p(e.profileRef)||p(R)!==p({id:t.id,contentHash:t.contentHash})||r.metadata?.taskId!==d.taskId||r.metadata?.seed!==d.seed||!i.completedAt||i.completedAt!==d.completedAt||i.startedAt!==d.startedAt||!i.harnessSnapshot||i.harnessSnapshot.harnessRelease.id!==a.harnessRelease.id||i.harnessSnapshot.harnessRelease.contentHash!==a.harnessRelease.contentHash||t.policy.kind!=="model"||!i.modelRef||i.modelRef.providerId!==t.policy.model.provider||i.modelRef.modelId!==t.policy.model.model)throw new Error("Retained Profile policy turn differs from its admitted case.");let l=await o.runtimeEventsForTurn(i.id);if(l.some(u=>u.turnId!==i.id)||p(l)!==d.traceHash)throw new Error("Retained Profile policy trace differs from its immutable receipt.");let s=q(l,a.target.kind);if(d.outputHash!==null&&p({text:s})!==d.outputHash)throw new Error("Retained Profile output differs from its immutable receipt.");let n=d.artifactRefs.flatMap(u=>{let H=l.filter(f=>(f.action==="work_output_save"||f.action==="sandbox_save_output")&&f.status==="completed").flatMap(f=>{let $=f.data&&typeof f.data=="object"?f.data:{},A=j.safeParse($.outputRef);return A.success?[A.data]:[]}).filter(f=>f.sourceTaskId===r.id&&f.sourceTurnId===i.id&&`${r.id}/${f.id}/${f.revision}/${f.title}`===u.id&&f.sha256===u.contentHash&&f.sizeBytes===u.sizeBytes&&f.contentType===u.mediaType);if(H.length!==1)throw new Error("The case output has no unique sealed saved-file identity.");let g=H[0];if(g.location.kind!=="managed")return[];let S=`/api/work/outputs/${encodeURIComponent(g.location.fileId)}`;if(g.location.downloadPath!==S)throw new Error("The saved output has no canonical managed download route.");return[{id:g.id,title:g.title,revision:g.revision,contentType:g.contentType,sizeBytes:g.sizeBytes,sha256:g.sha256,downloadPath:S}]}),c=await o.listModelUsageRecords({sessionId:r.id,turnId:i.id,limit:1e4}),E=e.eventAfterId?l.findIndex(u=>u.id===e.eventAfterId):-1;if(e.eventAfterId&&E<0)throw new Error("Profile trace cursor is unavailable in this case.");let w=E+1,P=Math.max(1,Math.min(250,e.eventLimit??100)),m=l.slice(w,w+P);return{ref:h,prompt:i.prompt,output:d.outputHash===null?null:{text:s},partialOutput:d.outputHash===null&&s?{text:s}:null,error:i.error,events:m,eventCount:l.length,nextEventCursor:w+m.length<l.length?m.at(-1).id:null,files:n,usage:c,usageCoverage:c.length===1e4?"partial":"complete"}}I(z,"readProfileEvaluationPolicyEvidence");var ne=v.object({runId:v.string().trim().min(1).max(240),receiptId:v.string().trim().min(1).max(500).optional(),eventAfterId:v.string().trim().min(1).max(500).optional(),eventLimit:v.number().int().min(1).max(250).optional(),manifest:U.optional()}).strict().refine(e=>e.receiptId||!e.eventAfterId&&!e.eventLimit,"Select a case before requesting its trace page.").refine(e=>!e.manifest||e.receiptId,"Interrupted-run inspection requires one exact case.");async function de(e){let o=await e.store.getProfileEvaluationRun(e.runId);if(o&&p(o.profileRef)!==p(e.profileRef))throw new Error("Profile evaluation run is unavailable in the selected Profile.");let t=o?.manifest??e.manifest;if(!t||!o&&!e.receiptId)throw new Error("Profile evaluation run is unavailable in the selected Profile.");if(o){if(e.manifest&&e.manifest.contentHash!==o.manifest.contentHash)throw new Error("Profile evaluation run differs from its pinned manifest.")}else if(T(t,"Interrupted Profile evaluation manifest"),t.id!==e.runId||t.profileEvaluation?.profileId!==e.profileRef.profileId||e.profileRef.source==="openpond_git"&&t.metadata.profileRepositoryId!==e.profileRef.repositoryId)throw new Error("Profile evaluation run is unavailable in the selected Profile.");let d=t.population.map((r,i)=>({member:r,index:i})).filter(({member:r})=>!e.receiptId||r.receiptId===e.receiptId);if(e.receiptId&&d.length!==1)throw new Error("Profile evaluation case is unavailable in the selected run.");let h=await Promise.all(d.map(async({member:r,index:i})=>{let R=o?null:await e.store.getProfileEvaluationReceipt(r.receiptId),a=o?.receiptRefs[i]??(R?{id:R.id,contentHash:R.contentHash}:null),l=o?.gradeRefs[i]??R?.graderEvidenceRefs[0];if(!a||!l)throw new Error("Profile evaluation run has incomplete case evidence.");let[s,n]=await Promise.all([e.store.getProfileEvaluationReceipt(a.id),e.store.getProfileEvaluationGrade(l.contentHash)]);if(!s||!o&&!k(s)||s.contentHash!==a.contentHash||s.id!==r.receiptId||s.taskId!==r.taskId||s.seed!==r.seed||s.runManifest.id!==t.id||s.runManifest.contentHash!==t.contentHash||!n||n.contentHash!==l.contentHash||!s.graderEvidenceRefs.some(c=>c.id===l.id&&c.contentHash===l.contentHash))throw new Error("Profile evaluation case evidence differs from its retained run.");return{taskId:r.taskId,seed:r.seed,receiptId:s.id,receiptHash:s.contentHash,traceHash:s.traceHash,outputHash:s.outputHash,score:n.score,passed:n.passed,gradingStatus:n.gradingStatus,failureClass:n.failureClass,artifactCount:s.artifactRefs.length,latencyMs:s.latencyMs,costUsd:s.costUsd,terminal:s.terminal,feedback:n.components.map(c=>({graderId:c.graderId,graderVersion:c.graderVersion,score:c.score,passed:c.passed,feedback:c.feedback})),...e.receiptId?{receipt:s,evidence:await z({store:e.store,profileRef:e.profileRef,manifest:t,receipt:s,eventAfterId:e.eventAfterId,eventLimit:e.eventLimit})}:{}}}));return{runId:t.id,sourceRevision:t.profileEvaluation?.sourceRevision??null,cases:h}}I(de,"inspectProfileEvaluationRun");export{Q as a,q as b,ne as c,de as d};