openpond 0.2.30 → 0.2.32

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 (169) hide show
  1. package/dist/api/types.d.ts +8 -0
  2. package/dist/app-server.d.ts +27797 -513
  3. package/dist/app-server.js +1 -1
  4. package/dist/chunks/{actions-command-NOCBOF5S.js → actions-command-6LFZFTLA.js} +1 -1
  5. package/dist/chunks/{app-layer-GLXYIT4B.js → app-layer-ZZHTHTJU.js} +1 -1
  6. package/dist/chunks/app-server-runtime-C7YELTKS.js +2 -0
  7. package/dist/chunks/{apps-YSWZT656.js → apps-C2BMJ7DO.js} +1 -1
  8. package/dist/chunks/{chunk-GHGVF2KG.js → chunk-2OQ6LFSG.js} +1 -1
  9. package/dist/chunks/{chunk-GOQDMRUV.js → chunk-34URWDE7.js} +1 -1
  10. package/dist/chunks/{chunk-J3ZRHNGL.js → chunk-4QX2I2DX.js} +1 -1
  11. package/dist/chunks/{chunk-TOIG2PMH.js → chunk-55UCBRIX.js} +1 -1
  12. package/dist/chunks/{chunk-2LSP2AAN.js → chunk-5BFWDFPX.js} +1 -1
  13. package/dist/chunks/{chunk-HMADUZ5P.js → chunk-7FX5ABXG.js} +1 -1
  14. package/dist/chunks/{chunk-JPCPNW6T.js → chunk-B5LKUQGM.js} +1 -1
  15. package/dist/chunks/{chunk-I7XD5OBR.js → chunk-BAKCGJ5D.js} +1 -1
  16. package/dist/chunks/{chunk-7TV2VBSD.js → chunk-DR3XPQRZ.js} +1 -1
  17. package/dist/chunks/{chunk-C5OV4XWF.js → chunk-EFTLCT7C.js} +1 -1
  18. package/dist/chunks/{chunk-F4WS5QIT.js → chunk-IFP6W4OW.js} +22 -22
  19. package/dist/chunks/{chunk-I5K74TOH.js → chunk-JEVA7YQL.js} +2 -2
  20. package/dist/chunks/{chunk-JKMPJFMN.js → chunk-JFR34MIK.js} +2 -2
  21. package/dist/chunks/chunk-JVIHGSOV.js +6 -0
  22. package/dist/chunks/{chunk-6ZK5EZGN.js → chunk-K6EGNB2A.js} +1 -1
  23. package/dist/chunks/{chunk-XLF7VRKY.js → chunk-L54LZUGH.js} +1 -1
  24. package/dist/chunks/{chunk-J2S7BOZU.js → chunk-MJC26GOX.js} +4 -4
  25. package/dist/chunks/{chunk-MAMUNDBZ.js → chunk-MVAJMRCW.js} +3 -3
  26. package/dist/chunks/{chunk-Y2NQXJ2Q.js → chunk-MXLB6MEW.js} +1 -1
  27. package/dist/chunks/chunk-PSZKG3E3.js +4 -0
  28. package/dist/chunks/chunk-PZXZYP6Z.js +578 -0
  29. package/dist/chunks/{chunk-XRV4WLI7.js → chunk-QPZNN5Q3.js} +1 -1
  30. package/dist/chunks/{chunk-ETH4SZO6.js → chunk-QTEYV4TW.js} +1 -1
  31. package/dist/chunks/{chunk-Y2KDWP74.js → chunk-T22TCCWW.js} +1 -1
  32. package/dist/chunks/{chunk-WVUPFGU7.js → chunk-UU7RXSJS.js} +1 -1
  33. package/dist/chunks/{chunk-TJNIYJUH.js → chunk-XCTFXXVY.js} +1 -1
  34. package/dist/chunks/chunk-YD2IWF3T.js +2419 -0
  35. package/dist/chunks/chunk-YW6HS6TZ.js +42 -0
  36. package/dist/chunks/{chunk-6LY7GYNK.js → chunk-Z6F6PYF4.js} +1 -1
  37. package/dist/chunks/cli-HGDLR5TC.js +2 -0
  38. package/dist/chunks/{configuration-command-VGYAJAKN.js → configuration-command-IHUB6BBM.js} +1 -1
  39. package/dist/chunks/{core-commands-QQNCA4WQ.js → core-commands-F2HIN7V4.js} +1 -1
  40. package/dist/chunks/{desktop-test-BMDAEN6Z.js → desktop-test-BFFUGVRS.js} +1 -1
  41. package/dist/chunks/{dist-5C6RYTQQ.js → dist-XCT2G25K.js} +1 -1
  42. package/dist/chunks/extension-D7IYZW7H.js +4 -0
  43. package/dist/chunks/{help-DZBHIKVE.js → help-5MKQV36D.js} +1 -1
  44. package/dist/chunks/opchat-XO7EDHY7.js +3 -0
  45. package/dist/chunks/{organizations-LAUKUPDF.js → organizations-DIRGTVK5.js} +1 -1
  46. package/dist/chunks/{profile-ESJFHPYC.js → profile-EMVJ5DJQ.js} +1 -1
  47. package/dist/chunks/{project-agent-CPQP4ZY6.js → project-agent-4QC7N3MB.js} +1 -1
  48. package/dist/chunks/{sandbox-command-W6NWHFAR.js → sandbox-command-L263BBOL.js} +1 -1
  49. package/dist/chunks/{sandbox-template-SM62NUMJ.js → sandbox-template-RYKWTBW7.js} +1 -1
  50. package/dist/chunks/src-Q4W4NIPB.js +325 -0
  51. package/dist/chunks/{src-4L62URN6.js → src-RINMQ7IQ.js} +1 -1
  52. package/dist/chunks/{teams-bot-6LEMA4OH.js → teams-bot-NIZB6DOY.js} +1 -1
  53. package/dist/chunks/{workspaces-5PQMYPBV.js → workspaces-PFLMSDBR.js} +1 -1
  54. package/dist/cli.js +1 -1
  55. package/dist/hosted-chat.d.ts +1 -0
  56. package/dist/index.js +1 -1
  57. package/dist/web/assets/App-BcbjzSeU.js +226 -0
  58. package/dist/web/assets/{AppDialog-FvWvdWfk.js → AppDialog-C1cvE0gH.js} +1 -1
  59. package/dist/web/assets/{AppTerminalPanel-Dfo_tXAE.js → AppTerminalPanel-BFJNR2ik.js} +2 -2
  60. package/dist/web/assets/{AppsView-CKg2_SXF.js → AppsView-CReOofAf.js} +1 -1
  61. package/dist/web/assets/BrowserSidebar-CPxAck2O.js +1 -0
  62. package/dist/web/assets/{CartesianChart-iXtVfIXm.js → CartesianChart-SlZ8Qfkg.js} +1 -1
  63. package/dist/web/assets/{CollaborationTabs-BFuRwsEy.js → CollaborationTabs-DgFEunqQ.js} +1 -1
  64. package/dist/web/assets/{CommandMenu-Coahy7-K.js → CommandMenu-BiROlSdv.js} +1 -1
  65. package/dist/web/assets/CommunityView-DVST_ZxO.js +1 -0
  66. package/dist/web/assets/ComposerCreateImproveStrip-jRBhdiFB.js +1 -0
  67. package/dist/web/assets/GetStartedView-Ck4EW1_s.js +1 -0
  68. package/dist/web/assets/HostedModelLearningReview-DYFjp-96.js +1 -0
  69. package/dist/web/assets/HostedModelLearningSettings-BD7quEFA.js +1 -0
  70. package/dist/web/assets/LabModelVersionDetailPage-8-Gb5AAH.js +1 -0
  71. package/dist/web/assets/{LabSkillSidebar-C7BuAuNK.js → LabSkillSidebar-DO-kFl9Z.js} +1 -1
  72. package/dist/web/assets/{LabsRoute-CUVbklNy.js → LabsRoute-Dc9RQKdA.js} +6 -6
  73. package/dist/web/assets/MainChatThread-DZXcFgmJ.js +2 -0
  74. package/dist/web/assets/MainPane-BYrnuI30.js +19 -0
  75. package/dist/web/assets/{MarkdownText-DV3sDJG3.js → MarkdownText-ueZFkEyk.js} +21 -21
  76. package/dist/web/assets/{NativeSkillSidebar-B3wc0iGh.js → NativeSkillSidebar-DlAX2-dH.js} +1 -1
  77. package/dist/web/assets/NewExperienceSwitcher-BHYLG0IZ.js +1 -0
  78. package/dist/web/assets/NewProjectDialog-BwN6SnxR.js +1 -0
  79. package/dist/web/assets/OutputsPage-Q0kpdfq_.js +1 -0
  80. package/dist/web/assets/ProjectsPage-TnlBYfFy.js +1 -0
  81. package/dist/web/assets/{ProjectsPage-DdG-U9ZW.css → ProjectsPage-kun3Ron2.css} +1 -1
  82. package/dist/web/assets/RightChatPanelStack-D2qZ-1nK.js +1 -0
  83. package/dist/web/assets/{RightSidebarHomePanel-DweT04nf.js → RightSidebarHomePanel-q6FF-DR9.js} +1 -1
  84. package/dist/web/assets/ScheduledWorkPage-BTX3Sjoa.js +1 -0
  85. package/dist/web/assets/SettingsView-C7av3zwv.css +1 -0
  86. package/dist/web/assets/SettingsView-gAhNO4Rg.js +9 -0
  87. package/dist/web/assets/{TeamChatView-BoQYnywK.js → TeamChatView-DZtfZ12z.js} +2 -2
  88. package/dist/web/assets/{TerminalOverlay-oLOOTbdP.js → TerminalOverlay-MJqx0xg6.js} +1 -1
  89. package/dist/web/assets/{TrainingCreationPanel-aCFYDuYZ.js → TrainingCreationPanel-ORoKcc3m.js} +1 -1
  90. package/dist/web/assets/{TrainingDraftPanel-CFa1YRTU.js → TrainingDraftPanel-oolNVDIx.js} +1 -1
  91. package/dist/web/assets/{UsageSettingsSection-CakaMl6_.js → UsageSettingsSection-Lh_fLOcC.js} +1 -1
  92. package/dist/web/assets/WorkSidebarPanel-BIqP9SXr.js +1 -0
  93. package/dist/web/assets/WorkspaceDiffPanel-B0Zwyx9a.js +14 -0
  94. package/dist/web/assets/WorkspaceEnvironmentMenu-BpgvG43X.js +32 -0
  95. package/dist/web/assets/{WorkspaceGitDialogs-CE6uwWBo.js → WorkspaceGitDialogs-Bw5ADFuc.js} +1 -1
  96. package/dist/web/assets/{WorkspaceMonacoEditor-Dd1yWxIF.js → WorkspaceMonacoEditor-BpivuGzo.js} +3 -3
  97. package/dist/web/assets/{arrow-up-right-DrBHDOjJ.js → arrow-up-right-BjC4ygxR.js} +1 -1
  98. package/dist/web/assets/{clipboard-BwxTBPCP.js → clipboard-BOJ-sNJz.js} +1 -1
  99. package/dist/web/assets/{cloud-upload-Ce9uYXcQ.js → cloud-upload-D-_3UWhI.js} +1 -1
  100. package/dist/web/assets/{cssMode-DDD1HmKz.js → cssMode-CnHRib-_.js} +1 -1
  101. package/dist/web/assets/{folder-open-BmWqQp0P.js → folder-open-CO3Vz0rT.js} +1 -1
  102. package/dist/web/assets/{folder-plus-B402AJf4.js → folder-plus-CL6B10XJ.js} +1 -1
  103. package/dist/web/assets/{git-commit-horizontal-C1uAivqm.js → git-commit-horizontal-C_SNHoOD.js} +1 -1
  104. package/dist/web/assets/git-dialogs-C-F47S10.css +1 -0
  105. package/dist/web/assets/{htmlMode-1MNILRvh.js → htmlMode-DBpIV7Gx.js} +1 -1
  106. package/dist/web/assets/{index-CPTsOhRN.js → index-Dx0lr1R3.js} +2 -2
  107. package/dist/web/assets/index-lqk3IxE0.css +1 -0
  108. package/dist/web/assets/{info-BNROwjpD.js → info-C1C3X2vW.js} +1 -1
  109. package/dist/web/assets/{jsonMode-mGxJ8u70.js → jsonMode-B9puI-La.js} +1 -1
  110. package/dist/web/assets/{lspLanguageFeatures-DnwAgCyz.js → lspLanguageFeatures-DwPRvLkn.js} +1 -1
  111. package/dist/web/assets/{minimize-2-DFgldo5D.js → minimize-2-Cr76Lc_J.js} +1 -1
  112. package/dist/web/assets/{monaco.contribution-BlgPPKyd.js → monaco.contribution-CnlZLXhW.js} +2 -2
  113. package/dist/web/assets/{monaco.contribution-CBuz55_x.js → monaco.contribution-DKa3PSXH.js} +2 -2
  114. package/dist/web/assets/{monaco.contribution-qZ9QzQ68.js → monaco.contribution-DQxsY08y.js} +2 -2
  115. package/dist/web/assets/{monaco.contribution-CGYtN1vj.js → monaco.contribution-OemObo_b.js} +2 -2
  116. package/dist/web/assets/monitor-CktBkAZk.js +1 -0
  117. package/dist/web/assets/{python-CpsWHcA8.js → python-CVC74_7Q.js} +1 -1
  118. package/dist/web/assets/refresh-cw-JaxiGpHD.js +1 -0
  119. package/dist/web/assets/{save-8XYI0E0Y.js → save-DFm1K29k.js} +1 -1
  120. package/dist/web/assets/{square-FQ0GLxuE.js → square-D5fFhDFt.js} +1 -1
  121. package/dist/web/assets/{toggleHighContrast-CX2hgvvU.js → toggleHighContrast-D_EkCruq.js} +1 -1
  122. package/dist/web/assets/{tsMode-D9XBNmxG.js → tsMode-BczIS4rA.js} +1 -1
  123. package/dist/web/assets/{upload-BNXILcvp.js → upload-DvED7nbd.js} +1 -1
  124. package/dist/web/assets/{useLocalAgentSchedules-Ccst1Wnz.js → useLocalAgentSchedules-DWd5OvYb.js} +1 -1
  125. package/dist/web/assets/useSessionTurnCache-oMoxBcGj.js +1 -0
  126. package/dist/web/assets/{wifi-off-BoQdtnnN.js → wifi-off-BZL-Op_B.js} +1 -1
  127. package/dist/web/assets/{workers-DpMJzLwE.js → workers-DapCJCaQ.js} +1 -1
  128. package/dist/web/assets/{yaml-BqS3gPsN.js → yaml-DB9KLqu1.js} +1 -1
  129. package/dist/web/index.html +2 -2
  130. package/docs/command-reference.md +1 -0
  131. package/package.json +1 -1
  132. package/dist/chunks/app-server-runtime-SNSNFJW7.js +0 -2
  133. package/dist/chunks/chunk-3YSCXFE6.js +0 -5
  134. package/dist/chunks/chunk-DDRIX3EP.js +0 -40
  135. package/dist/chunks/chunk-N6HBB2EA.js +0 -2985
  136. package/dist/chunks/chunk-P57W2CB2.js +0 -6
  137. package/dist/chunks/cli-DCFZ4GT6.js +0 -2
  138. package/dist/chunks/extension-IQW2KDT6.js +0 -6
  139. package/dist/chunks/opchat-BSTDLB7O.js +0 -3
  140. package/dist/chunks/src-G3GYZMCL.js +0 -323
  141. package/dist/web/assets/App-eRfSvxdE.js +0 -226
  142. package/dist/web/assets/BrowserSidebar-CBRz9dVj.js +0 -1
  143. package/dist/web/assets/CommunityView-C0B6EVIp.js +0 -1
  144. package/dist/web/assets/ComposerCreateImproveStrip-C0MkRhov.js +0 -1
  145. package/dist/web/assets/GetStartedView-f90pfPRp.js +0 -1
  146. package/dist/web/assets/HostedModelLearningReview-DdZnSPKb.js +0 -1
  147. package/dist/web/assets/HostedModelLearningSettings-p9RdBxGd.js +0 -1
  148. package/dist/web/assets/LabModelVersionDetailPage-DLqT1fMT.js +0 -1
  149. package/dist/web/assets/MainChatThread-Crjs_iFv.js +0 -2
  150. package/dist/web/assets/MainPane-Bl91XbhC.js +0 -10
  151. package/dist/web/assets/Messages-Bxo_ATcK.js +0 -10
  152. package/dist/web/assets/NewExperienceSwitcher-DBdsaysM.js +0 -1
  153. package/dist/web/assets/NewProjectDialog-CtJJ6u5l.js +0 -1
  154. package/dist/web/assets/OutputsPage-CV9rYjbQ.js +0 -1
  155. package/dist/web/assets/ProjectsPage-O162K_Yb.js +0 -1
  156. package/dist/web/assets/RightChatPanelStack-CXzHpD5V.js +0 -1
  157. package/dist/web/assets/ScheduledWorkPage-DFvjzhvz.js +0 -1
  158. package/dist/web/assets/SettingsView-B-O30p4h.js +0 -9
  159. package/dist/web/assets/SettingsView-BaWWvIJW.css +0 -1
  160. package/dist/web/assets/WorkSidebarPanel-XFwuIBFa.js +0 -1
  161. package/dist/web/assets/WorkspaceDiffPanel-CL-lAcvW.js +0 -14
  162. package/dist/web/assets/WorkspaceEnvironmentMenu-DcFKeae1.js +0 -32
  163. package/dist/web/assets/chat-file-links-DKYaOINv.js +0 -1
  164. package/dist/web/assets/chevron-up-CT-jxFh0.js +0 -1
  165. package/dist/web/assets/desktop-files-BQj1J-ob.js +0 -1
  166. package/dist/web/assets/git-dialogs-BZDqS1eT.css +0 -1
  167. package/dist/web/assets/index-BZ4iTv8E.css +0 -1
  168. package/dist/web/assets/play-BQFyTfNz.js +0 -1
  169. package/dist/web/assets/refresh-cw-DfFBmfXv.js +0 -1
@@ -1 +1 @@
1
- import{c as v,v as s}from"./App-eRfSvxdE.js";import{r as c}from"./index-CPTsOhRN.js";const m=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],x=v("rotate-ccw",m),I=5e3;function C(t){const[S,n]=c.useState([]),[y,r]=c.useState(!1),[p,l]=c.useState(null),[o,w]=c.useState(()=>new Set);c.useEffect(()=>{if(!t){n([]),l(null),r(!1);return}const e=t;let a=!1;async function d(g){if(!a){g&&r(!0);try{const h=await s.localAgentSchedules(e);if(a)return;n(h.schedules),l(null)}catch(h){a||l(f(h))}finally{!a&&g&&r(!1)}}}d(!0);const u=window.setInterval(()=>{d(!1)},I);return()=>{a=!0,window.clearInterval(u)}},[t]);async function L(){if(t){r(!0);try{const e=await s.syncLocalAgentSchedules(t);n(e.schedules),l(null)}catch(e){l(f(e))}finally{r(!1)}}}async function A(e){if(!(!t||o.has(e.id))){i(e.id,!0);try{await s.runLocalAgentSchedule(t,e.id);const a=await s.localAgentSchedules(t);n(a.schedules),l(null)}catch(a){l(f(a))}finally{i(e.id,!1)}}}async function E(e){if(!(!t||o.has(e.id))){i(e.id,!0);try{await s.patchLocalAgentSchedule(t,e.id,{enabled:!e.enabled});const a=await s.localAgentSchedules(t);n(a.schedules),l(null)}catch(a){l(f(a))}finally{i(e.id,!1)}}}function i(e,a){w(d=>{const u=new Set(d);return a?u.add(e):u.delete(e),u})}return{error:p,loading:y,pendingScheduleIds:o,refresh:L,run:A,schedules:S,toggle:E}}function f(t){return t instanceof Error?t.message:String(t)}export{x as R,C as u};
1
+ import{c as v,w as s}from"./App-BcbjzSeU.js";import{r as c}from"./index-Dx0lr1R3.js";const m=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],x=v("rotate-ccw",m),I=5e3;function C(t){const[S,n]=c.useState([]),[y,r]=c.useState(!1),[w,l]=c.useState(null),[o,p]=c.useState(()=>new Set);c.useEffect(()=>{if(!t){n([]),l(null),r(!1);return}const e=t;let a=!1;async function d(g){if(!a){g&&r(!0);try{const h=await s.localAgentSchedules(e);if(a)return;n(h.schedules),l(null)}catch(h){a||l(f(h))}finally{!a&&g&&r(!1)}}}d(!0);const u=window.setInterval(()=>{d(!1)},I);return()=>{a=!0,window.clearInterval(u)}},[t]);async function L(){if(t){r(!0);try{const e=await s.syncLocalAgentSchedules(t);n(e.schedules),l(null)}catch(e){l(f(e))}finally{r(!1)}}}async function A(e){if(!(!t||o.has(e.id))){i(e.id,!0);try{await s.runLocalAgentSchedule(t,e.id);const a=await s.localAgentSchedules(t);n(a.schedules),l(null)}catch(a){l(f(a))}finally{i(e.id,!1)}}}async function E(e){if(!(!t||o.has(e.id))){i(e.id,!0);try{await s.patchLocalAgentSchedule(t,e.id,{enabled:!e.enabled});const a=await s.localAgentSchedules(t);n(a.schedules),l(null)}catch(a){l(f(a))}finally{i(e.id,!1)}}}function i(e,a){p(d=>{const u=new Set(d);return a?u.add(e):u.delete(e),u})}return{error:w,loading:y,pendingScheduleIds:o,refresh:L,run:A,schedules:S,toggle:E}}function f(t){return t instanceof Error?t.message:String(t)}export{x as R,C as u};
@@ -0,0 +1 @@
1
+ import{r as f}from"./index-Dx0lr1R3.js";import{w as C}from"./App-BcbjzSeU.js";function S(n,e,t){return new Set(n.filter(i=>{if(e.has(i.id))return!1;if(t===void 0)return!0;if(typeof i.timestamp!="string")return!1;const a=Date.parse(i.timestamp);return Number.isFinite(a)&&a>=t}).map(i=>i.id))}function h(n){let e=null;for(const t of n){if(typeof t.timestamp!="string")continue;const i=Date.parse(t.timestamp);Number.isFinite(i)&&(e=e===null?i:Math.max(e,i))}return e}function E(n,e){const t=f.useRef({scopeKey:e,ids:new Set(n.map(r=>r.id)),initialized:!1,liveCutoff:null}),i=t.current.scopeKey===e,d=i&&t.current.initialized?S(n,t.current.ids,t.current.liveCutoff??void 0):new Set;return f.useLayoutEffect(()=>{const r=t.current,s=r.scopeKey!==e,u=Date.now();t.current={scopeKey:e,ids:new Set(n.map(l=>l.id)),initialized:!s,liveCutoff:s?Math.max(u,h(n)??0):r.liveCutoff??Math.max(u,h(n)??0)}},[n,i,e]),d}const v=new Map,M=[200,600,1500];function x({connection:n,latestTurnId:e,sessionId:t,turnRunning:i}){const[a,d]=f.useState(()=>({sessionId:null,summaries:v}));return f.useEffect(()=>{if(!n||!t)return;let r=!1,s=null;const u=i?null:e,l=o=>{const c=M[o];c===void 0||r||(s=setTimeout(()=>{m(o+1)},c))},m=async o=>{try{const c=await C.usageTurnCache(n,t);if(r)return;const p=new Map(c.turns.map(w=>[w.turnId,w]));d({sessionId:t,summaries:p}),u&&!p.has(u)&&l(o)}catch{l(o)}};return m(0),()=>{r=!0,s!==null&&clearTimeout(s)}},[n,e,t,i]),a.sessionId===t?a.summaries:v}export{x as a,E as u};
@@ -1 +1 @@
1
- import{c as a}from"./App-eRfSvxdE.js";const e=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],y=a("bell",e);const t=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],c=a("bell-off",t);const o=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],k=a("scroll-text",o);const h=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],p=a("wifi-off",h);export{c as B,k as S,p as W,y as a};
1
+ import{c as a}from"./App-BcbjzSeU.js";const e=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],y=a("bell",e);const t=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],c=a("bell-off",t);const o=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],k=a("scroll-text",o);const h=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],p=a("wifi-off",h);export{c as B,k as S,p as W,y as a};
@@ -1 +1 @@
1
- import{j7 as c}from"./WorkspaceMonacoEditor-Dd1yWxIF.js";import"./toggleHighContrast-CX2hgvvU.js";function a(e,o){const r=globalThis.MonacoEnvironment;if(r?.createTrustedTypesPolicy)try{return r.createTrustedTypesPolicy(e,o)}catch(t){console.error(t);return}try{return globalThis.trustedTypes?.createPolicy(e,o)}catch(t){console.error(t);return}}let n;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?n=globalThis.workerttPolicy:n=a("defaultWorkerFactory",{createScriptURL:e=>e});function l(e){const o=e.label,r=globalThis.MonacoEnvironment;if(r){if(typeof r.getWorker=="function")return r.getWorker("workerMain.js",o);if(typeof r.getWorkerUrl=="function"){const t=r.getWorkerUrl("workerMain.js",o);return new Worker(n?n.createScriptURL(t):t,{name:o,type:"module"})}}if(e.createWorker)return e.createWorker();throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function u(e){const o=Promise.resolve(l({label:e.label??"monaco-editor-worker",moduleId:e.moduleId,createWorker:e.createWorker})).then(r=>(r.postMessage("ignore"),r.postMessage(e.createData),r));return c.createWebWorker({worker:o,host:e.host,keepIdleModels:e.keepIdleModels})}export{u as c};
1
+ import{j7 as c}from"./WorkspaceMonacoEditor-BpivuGzo.js";import"./toggleHighContrast-D_EkCruq.js";function a(e,o){const r=globalThis.MonacoEnvironment;if(r?.createTrustedTypesPolicy)try{return r.createTrustedTypesPolicy(e,o)}catch(t){console.error(t);return}try{return globalThis.trustedTypes?.createPolicy(e,o)}catch(t){console.error(t);return}}let n;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?n=globalThis.workerttPolicy:n=a("defaultWorkerFactory",{createScriptURL:e=>e});function l(e){const o=e.label,r=globalThis.MonacoEnvironment;if(r){if(typeof r.getWorker=="function")return r.getWorker("workerMain.js",o);if(typeof r.getWorkerUrl=="function"){const t=r.getWorkerUrl("workerMain.js",o);return new Worker(n?n.createScriptURL(t):t,{name:o,type:"module"})}}if(e.createWorker)return e.createWorker();throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function u(e){const o=Promise.resolve(l({label:e.label??"monaco-editor-worker",moduleId:e.moduleId,createWorker:e.createWorker})).then(r=>(r.postMessage("ignore"),r.postMessage(e.createData),r));return c.createWebWorker({worker:o,host:e.host,keepIdleModels:e.keepIdleModels})}export{u as c};
@@ -1 +1 @@
1
- import{l as e}from"./WorkspaceMonacoEditor-Dd1yWxIF.js";import"./toggleHighContrast-CX2hgvvU.js";import"./index-CPTsOhRN.js";const r={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},l={tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|][0-9]*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,"number"],[/@numberFloat(?=[ \t]*[,\]\}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]\}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]\}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]\}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]\}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]\}])/,"number.date"]],tagHandle:[[/\![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}};export{r as conf,l as language};
1
+ import{l as e}from"./WorkspaceMonacoEditor-BpivuGzo.js";import"./toggleHighContrast-D_EkCruq.js";import"./index-Dx0lr1R3.js";const r={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},l={tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|][0-9]*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,"number"],[/@numberFloat(?=[ \t]*[,\]\}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]\}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]\}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]\}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]\}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]\}])/,"number.date"]],tagHandle:[[/\![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}};export{r as conf,l as language};
@@ -7,8 +7,8 @@
7
7
  <link rel="icon" type="image/png" sizes="16x16" href="./favicon-16x16.png" />
8
8
  <link rel="apple-touch-icon" href="./openpond-icon.png" />
9
9
  <title>OpenPond App</title>
10
- <script type="module" crossorigin src="./assets/index-CPTsOhRN.js"></script>
11
- <link rel="stylesheet" crossorigin href="./assets/index-BZ4iTv8E.css">
10
+ <script type="module" crossorigin src="./assets/index-Dx0lr1R3.js"></script>
11
+ <link rel="stylesheet" crossorigin href="./assets/index-lqk3IxE0.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="root"></div>
@@ -828,6 +828,7 @@ Usage:
828
828
  Options:
829
829
  --compatibility-model <string>
830
830
  --compat-model <string>
831
+ --effort <string>
831
832
  --env <string>
832
833
  --environment <string>
833
834
  --json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openpond",
3
- "version": "0.2.30",
3
+ "version": "0.2.32",
4
4
  "openpondReleaseVersioned": true,
5
5
  "license": "MIT",
6
6
  "description": "OpenPond CLI and local harness",
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{cd as c,dd as d}from"./chunk-N6HBB2EA.js";import"./chunk-GHGVF2KG.js";import{j as a,t as b}from"./chunk-3YSCXFE6.js";import"./chunk-HMADUZ5P.js";import"./chunk-P57W2CB2.js";import"./chunk-MAMUNDBZ.js";import"./chunk-XLF7VRKY.js";import"./chunk-L3KS6MOV.js";import"./chunk-XEOEKFG6.js";import"./chunk-TOIG2PMH.js";import"./chunk-6MI4KKWF.js";import"./chunk-ETH4SZO6.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-JPCPNW6T.js";import"./chunk-J2S7BOZU.js";import"./chunk-2LSP2AAN.js";import"./chunk-6FA3GG5B.js";import"./chunk-F4WS5QIT.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as AGENT_PROTOCOL_VERSION,c as APP_SERVER_COMPOSITION,d as createOpenPondAppServer,b as runAppServerJsonl};
@@ -1,5 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{Bb as O,c as j,e as E,f as z,g as H,i as N}from"./chunk-F4WS5QIT.js";import{b as i}from"./chunk-ES2ISFJC.js";import{a as k,c as I,f as A,h as d}from"./chunk-H7IWJN7L.js";import{a}from"./chunk-FTQLQJQV.js";import b from"node:path";import{AsyncLocalStorage as V}from"node:async_hooks";import{promises as M}from"node:fs";var B=new V;function pe(e,r=!1){let n=B.getStore();n&&(r&&(n.length=0),n.push(e))}a(pe,"onStartupFailure");async function fe(e,r){await O(e);let n;try{n=await H(b.join(d(e).runtime,"server-owner"),100)}catch(s){if(s instanceof I&&s.issue.code==="STORAGE_BUSY"){let o=await N(b.join(d(e).runtime,"endpoint.json"),()=>null);throw new I({code:"RUNTIME_ALREADY_RUNNING",path:e,message:"An OpenPond runtime already owns this home.",action:o?.url?`Connect to the existing runtime at ${o.url}, or stop it before starting another.`:"Stop the existing runtime before starting another with this home."})}throw s}let t=[];try{let s=await k(e,()=>B.run(t,r)),o=s.close.bind(s);t.length=0;let l;return{...s,close:a(()=>l??=(async()=>{try{await k(e,o)}finally{await M.rm(b.join(d(e).runtime,"endpoint.json"),{force:!0}),await n()}})(),"close")}}catch(s){try{for(let o of t.reverse())await Promise.resolve().then(()=>k(e,o)).catch(()=>{});await M.rm(b.join(d(e).runtime,"endpoint.json"),{force:!0})}finally{await n()}throw s}}a(fe,"ownHomeRuntime");async function me(e,r,n){await E(b.join(d(e).runtime,"endpoint.json"),JSON.stringify({schemaVersion:"openpond.runtimeEndpoint.v1",pid:process.pid,url:r,serverId:n}))}a(me,"publishRuntimeEndpoint");function ge(e){if(!e.maxContextTokens||!e.usableContextTokens)return{shouldCompact:!1,projectedTokens:e.projectedTokens,thresholdTokens:Number.MAX_SAFE_INTEGER,usableContextTokens:0,maxContextTokens:0,tokenSource:"heuristic"};let r=Math.max(.01,Math.min(1,(e.triggerPercent??85)/100)),n=Math.max(1,Math.floor(e.usableContextTokens*r));return{shouldCompact:e.projectedTokens>=n,projectedTokens:e.projectedTokens,thresholdTokens:n,usableContextTokens:e.usableContextTokens,maxContextTokens:e.maxContextTokens,tokenSource:"heuristic"}}a(ge,"agentCompactionDecision");async function be(e){await e.started();try{return await e.compact()}catch(r){throw await e.failed(r),r}}a(be,"runAgentCompaction");async function xe(e){let r=e.host.projectEvents(e.events),n=e.host.selectEvents(r,e.maxContextTokens),{summaryEvents:t,preservedEvents:s,preservedEventIds:o}=n;if(t.length===0)throw new Error("There is not enough prior context to compact.");let l=e.host.normalizeRecords(t),c=e.host.normalizeRecords(s),h=e.host.buildFileLedger(e.host.normalizeRecords(r)),u=e.host.serializeRecords(l,e.host.inputCharBudget(e.maxContextTokens));if(!u.text.trim())throw new Error("There is not enough prior context to compact.");let p=e.host.buildSummaryMessages({serializedHistory:u.text,fileLedger:h}),v=Date.now(),w=(await e.host.streamSummary({model:e.model,messages:p,signal:e.signal})).trim(),R=Date.now()-v;if(!w)throw new Error("Compaction summary was empty.");let P=e.host.estimateProjection({events:r,preservedEvents:s,summary:w}),_=e.host.createMetrics({sourceEvents:r.length,summarizedEvents:t.length,preservedEvents:s.length,sourceRecords:u.sourceRecordCount,includedRecords:u.includedRecordCount,omittedRecords:u.omittedRecordCount,preservedRecords:c.length,truncatedRecords:u.truncatedRecordCount,summaryInputTruncated:u.inputTruncated,sourceSelectionStrategy:u.selectionStrategy,summaryInputChars:u.inputChars,retainedTailTokens:n.retainedTailTokens,retainedTailBudgetTokens:n.retainedTailBudgetTokens,finalProviderContextTokens:P.inputTokensAfter,durationMs:R,fileLedgerEntries:h.length,splitTurnId:n.splitTurnId});return{summary:w,model:e.model,compactedThroughEventId:r[r.length-1]?.id??null,compactedThroughTurnId:e.host.lastTurnId(r),preservedFromEventId:s[0]?.id??null,preservedEventIds:o,preservedResourceRefs:e.host.durableResourceRefs(e.events),sourceEventCount:t.length,preservedEventCount:s.length,fileLedger:h,inputTokensBefore:P.inputTokensBefore,inputTokensAfter:P.inputTokensAfter,maxContextTokens:e.maxContextTokens,tokenSource:"heuristic",metrics:_}}a(xe,"runAgentCompactionProgram");var y="2026-09-20",ye=["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","harness/inspect","harness/proposalReview","harness/review","harness/acceptEvaluationReview","harness/materializeEvaluationTaskset","harness/runEvaluationBaseline","harness/validate","harness/backgroundReview","harness/diff","harness/rollback","refiner/inspect","refiner/update","refiner/activate","refiner/rollback"],U=i.object({jsonrpc:i.literal("2.0"),id:i.union([i.string(),i.number()]),method:i.string().trim().min(1),params:i.unknown().optional()}).strict(),$=i.object({jsonrpc:i.literal("2.0"),method:i.string().trim().min(1),params:i.unknown().optional()}).strict(),G=i.object({jsonrpc:i.literal("2.0"),id:i.union([i.string(),i.number()]),result:i.unknown()}).strict(),W=i.object({jsonrpc:i.literal("2.0"),id:i.union([i.string(),i.number(),i.null()]),error:i.object({code:i.number().int(),message:i.string(),data:i.unknown().optional()}).strict()}).strict(),Se=i.union([U,$,G,W]),K=i.object({protocolVersion:i.string().trim().min(1),client:i.object({name:i.string().trim().min(1),version:i.string().trim().min(1)}).strict(),capabilities:i.record(i.string(),i.unknown()).default({})}).strict(),S=class{static{a(this,"AgentJsonRpcDispatcher")}#e;#r=null;#t=!1;constructor(r){this.#e=r}get initialized(){return this.#t}async handle(r){let n=$.safeParse(r);if(n.success&&!("id"in r)){if(n.data.method==="initialized"){if(!this.#r)throw new f(-32002,"initialize must be called first");this.#t=!0}return null}let t=U.safeParse(r);if(!t.success)return q(null,-32600,"Invalid Request",t.error.flatten());let s=t.data;try{let o=await this.#n(s.method,s.params);return{jsonrpc:"2.0",id:s.id,result:o}}catch(o){let l=o instanceof f?o:new f(-32603,o instanceof Error?o.message:String(o));return q(s.id,l.code,l.message,l.data)}}async#n(r,n){if(r==="initialize"){let t=K.parse(n);if(t.protocolVersion!==y)throw new f(-32001,"Incompatible agent protocol version",{requested:t.protocolVersion,supported:y});return this.#r=t,{protocolVersion:y,server:{name:"openpond-app-server",version:"1"},capabilities:await this.#e.capabilities()}}if(!this.#t)throw new f(-32002,"initialized notification is required");switch(r){case"runtime/capabilities":return this.#e.capabilities(n);case"thread/start":return this.#e.threadStart(n);case"thread/resume":return this.#e.threadResume(n);case"thread/read":return this.#e.threadRead(n);case"turn/start":return this.#e.turnStart(n);case"turn/steer":return this.#e.turnSteer(n);case"task/inbox":return this.#e.taskInbox(n);case"task/queue":return this.#e.taskQueue(n);case"task/inputUpdate":return this.#e.taskInputUpdate(n);case"turn/interrupt":return this.#e.turnInterrupt(n);case"approval/resolve":return this.#e.approvalResolve(n);case"userInput/resolve":return this.#e.userInputResolve(n);case"profile/workflows":return this.#e.profileWorkflows(n);case"profile/evaluations":return this.#e.profileEvaluations(n);case"profile/trainingSource":return this.#e.profileTrainingSource(n);case"profile/evaluations/prepare":return this.#e.profileEvaluationPrepare(n);case"profile/evaluations/run":return this.#e.profileEvaluationRun(n);case"profile/evaluations/runSuite":return this.#e.profileEvaluationRunSuite(n);case"profile/evaluations/executeCase":return this.#e.profileEvaluationExecuteCase(n);case"profile/evaluations/executeRun":return this.#e.profileEvaluationExecuteRun(n);case"profile/evaluations/compare":return this.#e.profileEvaluationCompare(n);case"profile/evaluations/report":return this.#e.profileEvaluationReport(n);case"harness/inspect":return this.#e.harnessInspect(n);case"harness/proposalReview":return this.#e.harnessProposalReview(n);case"harness/review":return this.#e.harnessReview(n);case"harness/acceptEvaluationReview":return this.#e.harnessAcceptEvaluationReview(n);case"harness/materializeEvaluationTaskset":return this.#e.harnessMaterializeEvaluationTaskset(n);case"harness/runEvaluationBaseline":return this.#e.harnessRunEvaluationBaseline(n);case"harness/validate":return this.#e.harnessValidate(n);case"harness/backgroundReview":return this.#e.harnessBackgroundReview(n);case"harness/diff":return this.#e.harnessDiff(n);case"harness/rollback":return this.#e.harnessRollback(n);case"refiner/inspect":return this.#e.refinerInspect(n);case"refiner/update":return this.#e.refinerUpdate(n);case"refiner/activate":return this.#e.refinerActivate(n);case"refiner/rollback":return this.#e.refinerRollback(n);default:throw new f(-32601,`Method not found: ${r}`)}}},f=class extends Error{static{a(this,"JsonRpcDispatchError")}code;data;constructor(r,n,t){super(n),this.code=r,this.data=t}};function q(e,r,n,t){return{jsonrpc:"2.0",id:e,error:{code:r,message:n,...t===void 0?{}:{data:t}}}}a(q,"jsonRpcError");import{createHash as Q}from"node:crypto";function C(e){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error("Canonical JSON cannot encode a non-finite number.");return e}if(Array.isArray(e))return e.map(C);if(typeof e=="object"){let r={};for(let n of Object.keys(e).sort()){let t=e[n];t!==void 0&&(r[n]=C(t))}return r}throw new Error(`Canonical JSON cannot encode ${typeof e}.`)}a(C,"canonicalJson");function g(e){return Q("sha256").update(JSON.stringify(C(e)),"utf8").digest("hex")}a(g,"canonicalHash");var Y=i.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"]),X=i.object({sequence:i.number().int().nonnegative(),name:Y,source:i.enum(["runtime","provider","tool","host","refiner"]),status:i.string().trim().min(1).nullable().default(null),threadId:i.string().trim().min(1),turnId:i.string().trim().min(1).nullable().default(null),callId:i.string().trim().min(1).nullable().default(null),output:i.string().nullable().default(null),error:i.string().nullable().default(null),data:i.record(i.string(),i.unknown()).default({})}).strict();function He(e){return g(X.parse(e))}a(He,"canonicalEventHash");import{once as Z}from"node:events";import{createInterface as ee}from"node:readline";async function D(e){let r=new S(e.host),n=Promise.resolve(),t=[],s=a(u=>(n=n.then(async()=>{e.writable.write(`${JSON.stringify(u)}
3
- `)||await Z(e.writable,"drain")}),n),"write"),o=a(()=>{if(!(!r.initialized||t.length===0))for(let u of t.splice(0))s(u)},"flushPendingNotifications"),l=e.host.subscribe?.(u=>{if(!r.initialized){t.push(u);return}s(u)}),c=new Set,h=ee({input:e.readable,crlfDelay:1/0});try{for await(let u of h){if(!u.trim())continue;let p;try{p=JSON.parse(u)}catch{await s({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}});continue}let v=(async()=>{let R=await r.handle(p);R&&await s(R),o()})(),w=p&&typeof p=="object"&&"method"in p?p.method:null;if(w==="initialize"||w==="initialized"){await v;continue}c.add(v),v.finally(()=>c.delete(v))}await Promise.all(c),await n}finally{l?.()}}a(D,"runAgentJsonlServer");var T=i.object({threadId:i.string().trim().min(1)}).passthrough(),te=i.object({session:i.unknown()}).strict(),x=T.extend({input:i.unknown()}),re=x.extend({idempotencyKey:i.string().trim().min(1).max(200)}),ne=x.extend({inputId:i.string().trim().min(1)}),ae=T.extend({reason:i.string().trim().min(1).optional()}),ie=i.object({approvalId:i.string().trim().min(1),input:i.unknown()}).strict();function L(e){let r=a(async(t,s,o)=>{let l=performance.now();e.telemetry?.({method:t,phase:"started",threadId:s,durationMs:null,errorClass:null});try{let c=await o();return e.telemetry?.({method:t,phase:"completed",threadId:s,durationMs:performance.now()-l,errorClass:null}),c}catch(c){throw e.telemetry?.({method:t,phase:"failed",threadId:s,durationMs:performance.now()-l,errorClass:c instanceof Error?c.name:"UnknownError"}),c}},"run"),n=a(async(t,s="thread/read")=>{let{threadId:o}=T.parse(t);return r(s,o,async()=>{let[l,c,h]=await Promise.all([e.readThread(o),e.listTurns(o),e.listEvents(o)]);return{thread:l,turns:c,events:h}})},"threadRead");return{capabilities:a(t=>r("runtime/capabilities",null,()=>e.capabilities(t)),"capabilities"),threadStart:a(async t=>r("thread/start",null,async()=>({thread:await e.createThread(te.parse(t).session)})),"threadStart"),threadResume:a(t=>n(t,"thread/resume"),"threadResume"),threadRead:n,turnStart:a(async t=>{let s=x.parse(t);return r("turn/start",s.threadId,async()=>({turn:await e.startTurn(s.threadId,s.input)}))},"turnStart"),turnSteer:a(async t=>{let s=x.parse(t);return r("turn/steer",s.threadId,async()=>({receipt:await e.steerTurn(s.threadId,s.input)}))},"turnSteer"),taskInbox:a(async t=>{let{threadId:s}=T.parse(t);return r("task/inbox",s,()=>e.readTaskInbox(s))},"taskInbox"),taskQueue:a(async t=>{let s=re.parse(t);return r("task/queue",s.threadId,()=>e.queueTaskInput(s.threadId,s.input,s.idempotencyKey))},"taskQueue"),taskInputUpdate:a(async t=>{let s=ne.parse(t);return r("task/inputUpdate",s.threadId,()=>e.updateTaskInput(s.threadId,s.inputId,s.input))},"taskInputUpdate"),turnInterrupt:a(async t=>{let s=ae.parse(t);return r("turn/interrupt",s.threadId,async()=>({turn:await e.interruptTurn(s.threadId,s.reason)}))},"turnInterrupt"),approvalResolve:a(async t=>{let s=ie.parse(t);return r("approval/resolve",null,async()=>({approval:await e.resolveApproval(s.approvalId,s.input)}))},"approvalResolve"),userInputResolve:a(async t=>{let s=x.parse(t);return r("userInput/resolve",s.threadId,async()=>(e.isTurnActive(s.threadId)&&await e.waitForTurnSettlement(s.threadId),{turn:await e.startTurn(s.threadId,s.input)}))},"userInputResolve"),profileWorkflows:a(()=>r("profile/workflows",null,()=>e.listProfileWorkflows()),"profileWorkflows"),profileEvaluations:a(t=>r("profile/evaluations",null,()=>e.listProfileEvaluations(t)),"profileEvaluations"),profileTrainingSource:a(()=>r("profile/trainingSource",null,()=>e.loadProfileTrainingSource()),"profileTrainingSource"),profileEvaluationPrepare:a(t=>r("profile/evaluations/prepare",null,()=>e.prepareProfileEvaluationRun(t)),"profileEvaluationPrepare"),profileEvaluationRun:a(t=>r("profile/evaluations/run",null,()=>e.runPreparedProfileEvaluation(t)),"profileEvaluationRun"),profileEvaluationRunSuite:a(t=>r("profile/evaluations/runSuite",null,()=>e.runProfileEvaluationSuite(t)),"profileEvaluationRunSuite"),profileEvaluationExecuteCase:a(t=>r("profile/evaluations/executeCase",null,()=>e.executeProfileEvaluationCase(t)),"profileEvaluationExecuteCase"),profileEvaluationExecuteRun:a(t=>r("profile/evaluations/executeRun",null,()=>e.executeProfileEvaluationRun(t)),"profileEvaluationExecuteRun"),profileEvaluationCompare:a(t=>r("profile/evaluations/compare",null,()=>e.compareProfileEvaluationRuns(t)),"profileEvaluationCompare"),profileEvaluationReport:a(t=>r("profile/evaluations/report",null,()=>e.buildProfileEvaluationReport(t)),"profileEvaluationReport"),harnessInspect:a(()=>r("harness/inspect",null,()=>e.inspectHarness()),"harnessInspect"),harnessProposalReview:a(t=>r("harness/proposalReview",null,()=>e.reviewHarnessProposal(t)),"harnessProposalReview"),harnessReview:a(t=>r("harness/review",null,()=>e.reviewHarness(t)),"harnessReview"),harnessAcceptEvaluationReview:a(t=>r("harness/acceptEvaluationReview",null,()=>e.acceptHarnessEvaluationReview(t)),"harnessAcceptEvaluationReview"),harnessMaterializeEvaluationTaskset:a(t=>r("harness/materializeEvaluationTaskset",null,()=>e.materializeHarnessEvaluationTaskset(t)),"harnessMaterializeEvaluationTaskset"),harnessRunEvaluationBaseline:a(t=>r("harness/runEvaluationBaseline",null,()=>e.runHarnessEvaluationBaseline(t)),"harnessRunEvaluationBaseline"),harnessValidate:a(()=>r("harness/validate",null,()=>e.validateHarness()),"harnessValidate"),harnessBackgroundReview:a(t=>r("harness/backgroundReview",null,()=>e.updateHarnessBackgroundReview(t)),"harnessBackgroundReview"),harnessDiff:a(t=>r("harness/diff",null,()=>e.diffHarness(t)),"harnessDiff"),harnessRollback:a(t=>r("harness/rollback",null,()=>e.rollbackHarness(t)),"harnessRollback"),refinerInspect:a(()=>r("refiner/inspect",null,()=>e.inspectRefiner()),"refinerInspect"),refinerUpdate:a(t=>r("refiner/update",null,()=>e.updateRefiner(t)),"refinerUpdate"),refinerActivate:a(t=>r("refiner/activate",null,()=>e.activateRefiner(t)),"refinerActivate"),refinerRollback:a(t=>r("refiner/rollback",null,()=>e.rollbackRefiner(t)),"refinerRollback"),subscribe:e.subscribeEvents&&e.eventNotification?t=>e.subscribeEvents(s=>t(e.eventNotification(s))):void 0}}a(L,"createAgentRuntimeService");var m=i.string().regex(/^[a-f0-9]{64}$/),et=i.object({harnessReleaseHash:m,instructionsHash:m,skillHashes:i.record(i.string(),m),agentAssetHashes:i.record(i.string(),m),toolCatalogHash:m,memoryRevision:i.number().int().nonnegative().nullable()}).strict(),se=i.object({protocolVersion:i.string().trim().min(1),threadId:i.string().trim().min(1),turnId:i.string().trim().min(1),harnessReleaseHash:m,toolCatalogHash:m,context:i.record(i.string(),i.unknown()),pendingInteraction:i.record(i.string(),i.unknown()).nullable(),usage:i.record(i.string(),i.unknown())}).strict();function tt(e){return g(se.parse(e))}a(tt,"checkpointHash");function rt(e){return[e.system,...e.harnessInstructions,...e.skillInstructions,...e.hostInstructions??[]].map(r=>r.trim()).filter(Boolean).join(`
4
-
5
- `)}a(rt,"materializeAgentPrompt");function st(e){let r=new Set,n=[...e].map(o=>{let l=o.name.trim();if(!l)throw new Error("Agent tool names cannot be empty.");if(r.has(l))throw new Error(`Duplicate agent tool: ${l}.`);if(r.add(l),!o.unavailableReason&&!o.executorAvailable)throw new Error(`Agent tool ${l} is declared as available without an executor.`);return{...o,name:l}}).sort((o,l)=>o.name.localeCompare(l.name)),t=n.filter(o=>!o.unavailableReason).map(o=>({name:o.name,description:o.description,inputSchema:o.inputSchema})),s=n.map(o=>({name:o.name,displayLabel:o.displayLabel??o.name,placement:o.placement,available:!o.unavailableReason,unavailableReason:o.unavailableReason??null}));return{byName:new Map(n.map(o=>[o.name,o])),tools:n,modelTools:t,capabilities:s,hash:g({modelTools:t,capabilities:s})}}a(st,"createAgentToolCatalogProjection");async function ot(e,r){let n=e.byName.get(r.name);if(!n)throw new Error(`Unknown agent tool: ${r.name}.`);if(n.unavailableReason)throw new Error(`Agent tool ${r.name} is unavailable: ${n.unavailableReason}`);if(!n.execute)throw new Error(`Agent tool ${r.name} has no executor.`);let t=n.validateArguments?n.validateArguments(r.arguments):r.arguments;return n.execute(t,r.context)}a(ot,"executeProjectedAgentTool");var F=class{static{a(this,"TaskSignals")}#e=new Map;notify(r){for(let n of[...this.#e.get(r)??[]])n()}subscribe(r,n){let t=this.#e.get(r);return t||this.#e.set(r,t=new Set),t.add(n),()=>{t.delete(n),t.size===0&&this.#e.delete(r)}}async wait(r){let n=a(()=>{},"wake"),t=0,s=a(()=>{t+=1,n()},"changed"),o=[...new Set(r.taskIds)].map(c=>this.subscribe(c,s)),l=setTimeout(s,Math.max(0,r.deadline-Date.now()));r.signal.addEventListener("abort",s);try{for(;;){r.signal.throwIfAborted();let c=t,h=await r.read();if(h!==null)return h;if(Date.now()>=r.deadline)return null;t===c&&await new Promise(u=>{n=u,(t!==c||r.signal.aborted)&&u()})}}finally{clearTimeout(l),r.signal.removeEventListener("abort",s);for(let c of o)c()}}},J=class{static{a(this,"TaskSerialExecutor")}#e=new Map;async run(r,n){let s=(this.#e.get(r)??Promise.resolve()).then(n),o=s.then(()=>{},()=>{});this.#e.set(r,o);try{return await s}finally{this.#e.get(r)===o&&this.#e.delete(r)}}};function St(e){return oe({runtime:L(e.ports),close:e.close})}a(St,"createAppServer");function oe(e){let r=!1;return{runtime:e.runtime,close:a(async()=>{r||(r=!0,await e.close?.())},"close")}}a(oe,"attachAppServer");async function Tt(e){try{await D({host:e.appServer.runtime,readable:e.readable,writable:e.writable})}finally{await e.appServer.close()}}a(Tt,"runAppServerJsonl");import{randomBytes as le}from"node:crypto";function jt(){return A()}a(jt,"appDataDir");function zt(e){return d(e).config}a(zt,"providersConfigPath");function Ht(e){return d(e).credentials}a(Ht,"providerSecretsConfigPath");function Nt(e){return d(e).key}a(Nt,"providerSecretsKeyPath");async function Ot(e){let r=d(e).token;return z(r,async()=>{let n=(await j(r))?.trim(),t=process.env.OPENPOND_APP_TOKEN||n||le(32).toString("base64url");return t!==n&&await E(r,t),{token:t,tokenFile:r}})}a(Ot,"ensureCapabilityToken");export{pe as a,fe as b,me as c,g as d,ge as e,be as f,xe as g,X as h,He as i,y as j,ye as k,se as l,tt as m,rt as n,st as o,ot as p,F as q,J as r,St as s,Tt as t,jt as u,zt as v,Ht as w,Nt as x,Ot as y};
@@ -1,40 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as Q,c as Z,t as ee,y as oe}from"./chunk-3YSCXFE6.js";import{a as T,b as X,h as K}from"./chunk-HMADUZ5P.js";import{n as te,p as re}from"./chunk-P57W2CB2.js";import{Aa as D,Ca as H,Da as M,Ea as $,Fa as j,Ha as G,b as L,c as B,gb as V,hb as J,jb as I,mb as F,pb as W,qb as E,ub as z,wb as q,xb as Y}from"./chunk-F4WS5QIT.js";import{b as i}from"./chunk-ES2ISFJC.js";import{c as N,d as C,f as k,h as R}from"./chunk-H7IWJN7L.js";import{a as s}from"./chunk-FTQLQJQV.js";import{promises as U}from"node:fs";import Ee from"node:os";import Ae from"node:path";import{createServer as Ie}from"node:http";import{randomBytes as Te}from"node:crypto";var be=i.discriminatedUnion("op",[i.strictObject({op:i.literal("set"),path:i.array(i.string().min(1)).min(1),value:i.unknown()}),i.strictObject({op:i.literal("unset"),path:i.array(i.string().min(1)).min(1)})]),Oe=i.discriminatedUnion("action",[i.strictObject({action:i.literal("patch"),expectedRevision:i.string(),operations:i.array(be).max(100)}),i.strictObject({action:i.literal("replace"),expectedRevision:i.string(),text:i.string().max(1048576)}),i.strictObject({action:i.literal("validate"),text:i.string().max(1048576)}),i.strictObject({action:i.literal("restore"),expectedRevision:i.string(),revision:i.string()}),i.strictObject({action:i.literal("trust"),root:i.string(),accountId:i.string(),trusted:i.boolean()}),i.strictObject({action:i.literal("client-state"),owner:i.string(),patch:z,importOnly:i.boolean().optional()})]);function ne(e){let t=null;async function r(l,n){let g=R(e).config,w=null,p=null,d=null;try{w=await B(g),d=await E(e,{projectRoot:l,accountId:n}),l||(t=d)}catch(v){p=C(v,g)}let y=d??(l?null:t);return{path:g,text:w,rawRevision:L(w),issue:p,effective:y,usingLastValid:!d&&!!y,applies:"next_turn",recoverableRevisions:await H(e),clientState:p?null:await q(e)}}s(r,"status");async function o(l){let n=Oe.parse(l);return n.action==="validate"?{valid:!0,document:D(n.text,R(e).config)}:(n.action==="patch"&&await G(e,n.expectedRevision,n.operations),n.action==="replace"&&await M(e,n.expectedRevision,n.text),n.action==="restore"&&await $(e,n.revision,n.expectedRevision),n.action==="trust"&&await W(e,n.root,n.accountId,n.trusted),n.action==="client-state"?Y(e,n.owner,n.patch,n.importOnly):r())}return s(o,"mutate"),{status:r,mutate:o,schema:j}}s(ne,"createConfigurationPayloads");import{Buffer as ie}from"node:buffer";var A={"Access-Control-Allow-Headers":"authorization, content-type, x-openpond-team-id","Access-Control-Allow-Methods":"GET, POST, PUT, PATCH, DELETE, OPTIONS"},Se=25*1024*1024,x=class extends Error{constructor(r,o,l){super(l);this.status=r;this.code=o;this.name="HttpBodyError"}status;code;static{s(this,"HttpBodyError")}};function ae(e,t,r={}){for(let[l,n]of Object.entries(A))t.setHeader(l,n);let o=ce(e.headers.origin);return o?(t.setHeader("Vary",xe(t.getHeader("Vary"))),Re(o,r)?(t.setHeader("Access-Control-Allow-Origin",o),{allowed:!0,origin:o}):{allowed:!1,origin:o}):{allowed:!0,origin:null}}s(ae,"applyCorsHeaders");function Re(e,t={}){if(e==="null")return!0;let r=se(e);return r?Ce(r)?!0:new Set((t.allowedOrigins??[]).map(l=>l?se(l):null).filter(l=>!!l)).has(r):!1}s(Re,"isAllowedCorsOrigin");function h(e,t,r){e.writeHead(t,{"Content-Type":"application/json",...A}),e.end(JSON.stringify(r))}s(h,"sendJson");function Je(e,t,r){e.writeHead(t,{"Content-Type":"text/plain; charset=utf-8",...A}),e.end(r)}s(Je,"sendText");function Fe(e,t,r,o){e.writeHead(t,{"Content-Type":o,"Content-Length":String(r.byteLength),"Cache-Control":"no-store","X-Content-Type-Options":"nosniff",...A}),e.end(r)}s(Fe,"sendBinary");async function _(e,t={}){let r=t.maxBytes??Se,o=ce(e.headers["content-type"]),l=[],n=0;for await(let w of e){let p=ie.from(w);if(n+=p.byteLength,n>r)throw new x(413,"request_body_too_large",`JSON request body exceeds ${r} bytes.`);l.push(p)}let g=ie.concat(l).toString("utf8").trim();if(!g)return{};if(!Pe(o))throw new x(415,"unsupported_media_type","JSON request body requires Content-Type: application/json.");try{return JSON.parse(g)}catch{throw new x(400,"invalid_json","Request body is not valid JSON.")}}s(_,"readJson");function le(e,t,r){let o=e.headers.authorization;return(typeof o=="string"&&o.startsWith("Bearer ")?o.slice(7):null)===r}s(le,"hasAuth");function ce(e){return Array.isArray(e)?e[0]??null:e??null}s(ce,"headerValue");function Pe(e){if(!e)return!1;let t=e.split(";")[0]?.trim().toLowerCase();return t==="application/json"||!!t?.endsWith("+json")}s(Pe,"isJsonContentType");function se(e){try{let t=new URL(e);return t.protocol!=="http:"&&t.protocol!=="https:"?null:t.origin}catch{return null}}s(se,"normalizeOrigin");function Ce(e){let t=new URL(e);return t.hostname==="localhost"||t.hostname==="127.0.0.1"||t.hostname==="::1"||t.hostname==="[::1]"}s(Ce,"isLoopbackOrigin");function xe(e){let r=(Array.isArray(e)?e.join(", "):e?String(e):"").split(",").map(o=>o.trim()).filter(Boolean);return r.some(o=>o.toLowerCase()==="origin")||r.push("Origin"),r.join(", ")}s(xe,"appendVaryOrigin");function pe(e){return`<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>OpenPond recovery</title>
3
- <style nonce="${e}">body{font:16px system-ui;background:#171819;color:#eee;max-width:850px;margin:6vh auto;padding:24px}textarea{box-sizing:border-box;width:100%;min-height:280px;background:#222;color:#eee;padding:14px;border:1px solid #777;border-radius:8px;font:14px monospace}button,input,select{font:inherit;margin:6px;padding:8px}pre{white-space:pre-wrap}code{overflow-wrap:anywhere}button{cursor:pointer}p{line-height:1.5}</style>
4
- <h1>OpenPond needs a storage repair</h1><p id="issue" role="alert">Loading recovery details\u2026</p><p><code id="file"></code></p>
5
- <p id="action"></p><p>Migration backups and the source installation remain available. Execution services are stopped while recovery is open.</p>
6
- <details id="editor"><summary>Edit configuration</summary><textarea id="text" aria-label="Configuration TOML" spellcheck="false"></textarea><button id="save">Validate and save</button><button id="reload">Reload file</button><select id="revisions" aria-label="Restore a verified configuration revision"><option value="">Restore a verified revision\u2026</option></select></details>
7
- <details><summary>Migration sources and diagnostics</summary><pre id="migration"></pre><label>Previous app home <input id="appHome"></label><label>Previous account config <input id="configSource"></label><label>Configuration conflict choices (JSON from the preview) <textarea id="resolutions" aria-label="Migration conflict choices" spellcheck="false" placeholder='[{"path":["chat","steer_active_responses"],"choice":"existing"}]'></textarea></label><button id="preview">Preview migration</button><button id="migrate">Use these sources</button><button id="restart">Restart failed preparation</button><button id="diagnostics">Export diagnostics</button></details>
8
- <button id="retry">Retry startup</button><p id="message" role="status"></p>
9
- <script nonce="${e}">
10
- let token='',state=null,editing=false,revision=null;
11
- const el=id=>document.getElementById(id);
12
- async function request(route,body){const r=await fetch(route,{method:body?'POST':'GET',headers:{'Content-Type':'application/json',Authorization:'Bearer '+token},body:body?JSON.stringify(body):undefined});const v=await r.json();if(!r.ok)throw Error(v.error||'Recovery request failed');return v;}
13
- function message(error){el('message').textContent=error instanceof Error?error.message:String(error);}
14
- async function load(){state=await request('/v1/recovery');el('issue').textContent=state.issue.message;el('action').textContent=state.issue.action;el('file').textContent=state.issue.path;el('migration').textContent=JSON.stringify(state.migration,null,2);if(!editing){el('text').value=state.config.text||'schema_version = 1\\n';revision=state.config.rawRevision;}el('revisions').replaceChildren(new Option('Restore a verified revision\u2026',''),...state.config.recoverableRevisions.map(r=>new Option(r.createdAt,r.revision)));el('editor').hidden=!state.configEditable;}
15
- el('text').oninput=()=>{editing=true};
16
- el('reload').onclick=()=>{editing=false;load().catch(message)};
17
- el('save').onclick=async()=>{try{await request('/v1/configuration',{action:'replace',text:el('text').value,expectedRevision:revision});editing=false;await load();message('Configuration saved. Retry startup when ready.')}catch(e){message(e)}};
18
- el('revisions').onchange=async e=>{if(!e.target.value)return;try{await request('/v1/configuration',{action:'restore',revision:e.target.value,expectedRevision:state.config.rawRevision});editing=false;await load();message('Verified revision restored.')}catch(e){message(e)}};
19
- for(const [id,action] of [['preview','preview'],['migrate','migrate'],['restart','restart']])el(id).onclick=async()=>{try{const result=await request('/v1/recovery',{action,sourceAppHome:el('appHome').value||undefined,sourceConfig:el('configSource').value||undefined,resolutions:el('resolutions').value?JSON.parse(el('resolutions').value):undefined});el('migration').textContent=JSON.stringify(result,null,2);message(action==='preview'?'Review the source paths above.':'Migration operation completed; retry startup.')}catch(e){message(e)}};
20
- el('diagnostics').onclick=()=>{if(!state)return;const blob=new Blob([JSON.stringify({issue:state.issue,migration:state.migration,config:{path:state.config.path,rawRevision:state.config.rawRevision,issue:state.config.issue}},null,2)],{type:'application/json'});const a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download='openpond-recovery-diagnostics.json';a.click();URL.revokeObjectURL(a.href)};
21
- el('retry').onclick=async()=>{try{await request('/v1/recovery',{action:'retry'});message('Starting OpenPond\u2026');const timer=setInterval(async()=>{try{const h=await(await fetch('/health')).json();if(!h.recovery){clearInterval(timer);const next=new URLSearchParams(location.hash.slice(1)).get('returnTo');if(next){const u=new URL(next);if(['localhost','127.0.0.1','[::1]'].includes(u.hostname)){location.replace(u.toString());return}}location.reload();}}catch{}},500)}catch(e){message(e)}};
22
- (async()=>{const params=new URLSearchParams(location.hash.slice(1));token=params.get('openpondToken')||'';if(!token&&window.openpond?.getConnection)token=(await window.openpond.getConnection()).token;if(!token){message('Open the authenticated recovery URL from the launcher.');return}await load()})().catch(message);
23
- </script></html>`}s(pe,"startupRecoveryPage");var _e=i.strictObject({action:i.enum(["preview","migrate","restart","retry"]),sourceAppHome:i.string().optional(),sourceConfig:i.string().optional(),resolutions:V.optional()});function ue(e){return e instanceof N&&/^(PRIVATE_STORAGE_|UNSAFE_STORAGE_|INVALID_CONFIG|CONFIG_|MIGRATION_|SOURCE_CHANGED_|CREDENTIAL_|UNSUPPORTED_STORAGE_|INVALID_MIGRATION_|INVALID_ACCOUNT_|MISSING_INSTRUCTION_|INVALID_PROFILE_|DATABASE_RECOVERY_)/.test(e.issue.code)}s(ue,"isRecoverableStartupError");async function de(e,t,r){let o=/^(UNSUPPORTED_STORAGE_|INVALID_MIGRATION_|UNSAFE_STORAGE_|PRIVATE_STORAGE_)/.test(r.issue.code),l=o?await U.mkdtemp(Ae.join(Ee.tmpdir(),"openpond-recovery-")):e;return Q(l,async()=>{let{token:n,tokenFile:g}=await oe(l),w=ne(e),p=r.issue,d,y=new Promise(u=>{d=u}),v=Ie((u,f)=>{(async()=>{let a=new URL(u.url??"/","http://127.0.0.1");if(!ae(u,f).allowed){h(f,403,{error:"Origin not allowed"});return}if(u.method==="OPTIONS"){h(f,204,{});return}if(u.method==="GET"&&a.pathname==="/health"){h(f,200,{ok:!0,server:"openpond-app-server",version:X,recovery:!0});return}if(u.method==="GET"&&a.pathname==="/"){let m=Te(18).toString("base64");f.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store","Content-Security-Policy":`default-src 'none'; script-src 'nonce-${m}'; style-src 'nonce-${m}'; connect-src 'self'; base-uri 'none'; frame-ancestors 'none'`}),f.end(pe(m));return}if(!le(u,a,n)){h(f,401,{error:"Unauthorized"});return}let c=!o;if(u.method==="GET"&&a.pathname==="/v1/recovery"){h(f,200,{issue:p,configEditable:c,config:o?{path:R(e).config,text:null,rawRevision:"unavailable",issue:p,recoverableRevisions:[]}:await w.status(),migration:await J(e).catch(m=>({issue:C(m,e)}))});return}if(u.method==="POST"&&a.pathname==="/v1/configuration"&&c){h(f,200,await w.mutate(await _(u)));return}if(u.method==="POST"&&a.pathname==="/v1/recovery"){let m=_e.parse(await _(u));if(o&&m.action!=="retry"&&m.action!=="preview")throw r;if(m.action==="restart"){h(f,200,await F(e));return}if(m.action==="preview"||m.action==="migrate"){h(f,200,await I(e,{sourceAppHome:m.sourceAppHome,sourceConfig:m.sourceConfig,resolutions:m.resolutions,dryRun:m.action==="preview"}));return}await I(e),await E(e),h(f,200,{ready:!0}),d();return}h(f,503,{error:`${p.message} ${p.action}`,issue:p,recovery:!0})})().catch(a=>{p=C(a,e),h(f,422,{error:`${p.message} ${p.action}`,issue:p})})});await new Promise((u,f)=>{v.once("error",f),v.listen(t,"127.0.0.1",()=>{v.off("error",f),u()})});let O=v.address().port,P=`http://127.0.0.1:${O}`;return await Z(l,P,"startup-recovery"),{url:P,port:O,token:n,tokenFile:g,storePath:R(e).database,repaired:y,close:s(async()=>{v.closeIdleConnections(),await new Promise((u,f)=>v.close(a=>a?f(a):u())),o&&await U.rm(l,{recursive:!0,force:!0})},"close")}}).catch(async n=>{throw o&&await U.rm(l,{recursive:!0,force:!0}),n})}s(de,"startRecoveryServer");import{existsSync as Ue}from"node:fs";import b from"node:path";import{fileURLToPath as Ne}from"node:url";var fe=b.dirname(Ne(import.meta.url));function S(e,t,r){let o=e[t+1];if(!o||o.startsWith("--"))throw new Error(`${r} requires a value.`);return o}s(S,"requireValue");function ge(e,t){let r=Number.parseInt(e,10);if(!Number.isFinite(r)||r<0||r>65535)throw new Error(`${t} must be a port from 0 to 65535.`);return r}s(ge,"parsePort");function we(e){let t="serve",r=T,o=17874,l=null,n=!1,g=!1,w=null,p,d=null,y=null,v=null,O=null,P=0,u=e[0];if(u&&!u.startsWith("-")){if(u==="serve"||u==="server")t="serve";else if(u==="app-server")t="app-server";else if(u==="web")t="web";else{if(u==="help")return{mode:t,host:r,port:o,webRoot:l,openBrowser:n,printAccessUrl:g,storeDir:w,help:!0};throw new Error(`Unknown command: ${u}`)}P=1}for(let a=P;a<e.length;a+=1){let c=e[a];if(c==="--help"||c==="-h")return{mode:t,host:r,port:o,webRoot:l,openBrowser:n,printAccessUrl:g,storeDir:w,help:!0};if(c==="--listen"){let m=K(S(e,a,c));r=m.host,o=ge(String(m.port),c),a+=1}else if(c==="--hostname"||c==="--host")r=S(e,a,c),a+=1;else if(c==="--port")o=ge(S(e,a,c),c),a+=1;else if(c==="--web-root")l=b.resolve(S(e,a,c)),a+=1;else if(c==="--source-browser-state")p=b.resolve(S(e,a,c)),a+=1;else{if(c==="--store-dir")throw new Error("--store-dir has been replaced by --home. Use --home <directory> or OPENPOND_HOME.");if(c==="--home")w=b.resolve(S(e,a,c)),a+=1;else if(c==="--profile-source-root")d=b.resolve(S(e,a,c)),a+=1;else if(c==="--profile-repository-id")y=S(e,a,c),a+=1;else if(c==="--profile-id")v=S(e,a,c),a+=1;else if(c==="--profile-revision")O=S(e,a,c),a+=1;else if(c==="--open-browser")n=!0;else if(c==="--print-access-url")g=!0;else throw new Error(`Unknown option: ${c}`)}}if(n&&g)throw new Error("--open-browser and --print-access-url cannot be used together.");if(t!=="web"&&(n||g))throw new Error("Browser options are only available in web mode.");let f=[d,y,v,O].filter(Boolean).length;if(f&&(f!==4||t!=="app-server"))throw new Error("Profile source flags require app-server mode and --profile-source-root, --profile-repository-id, --profile-id, and --profile-revision together.");return{mode:t,host:r,port:o,webRoot:l,openBrowser:n,printAccessUrl:g,storeDir:w,sourceBrowserState:p,...f?{profileSource:{repoPath:d,repositoryId:y,profileId:v,sourceRevision:O}}:{},help:!1}}s(we,"parseCliArgs");function ke(){return[process.env.OPENPOND_WEB_ROOT,b.resolve(process.cwd(),"apps/web/dist"),b.resolve(fe,"../../web/dist"),b.resolve(process.cwd(),"web"),b.resolve(fe,"../web")].filter(e=>!!e)}s(ke,"defaultWebRootCandidates");function Le(e){let t=e?[e]:ke();for(let r of t){let o=b.resolve(r);if(Ue(b.join(o,"index.html")))return o}return null}s(Le,"resolveWebRoot");function Be(e){let t=e==="0.0.0.0"||e==="::"?"127.0.0.1":e;return t.includes(":")&&!t.startsWith("[")?`[${t}]`:t}s(Be,"formatHostForUrl");function De(e){return`http://${Be(e.status.host)}:${e.status.port}`}s(De,"browserBaseUrl");function He(e,t){let r=new URL(e),o=new URLSearchParams;return o.set("openpondServerUrl",e),o.set("openpondToken",t),r.hash=o.toString(),r.toString()}s(He,"tokenizedWebUrl");async function me(e,t=re){let r=He(e.baseUrl,e.token);if(e.printAccessUrl)return{stdout:[`OpenPond access URL: ${r}`],stderr:[]};if(!e.openBrowser)return{stdout:[`OpenPond web UI: ${e.baseUrl}`],stderr:[]};let o=await t(r);return o.opened?{stdout:[`Opened OpenPond in your browser: ${e.baseUrl}`],stderr:[]}:{stdout:[`OpenPond access URL: ${r}`],stderr:[`Could not open the system browser: ${o.error}`]}}s(me,"resolveWebLaunchMessages");function he(){console.log(`Usage:
24
- openpond-app-server serve [--hostname HOST] [--port PORT]
25
- openpond-app-server app-server [--home DIR]
26
- openpond-app-server web [--hostname HOST] [--port PORT] [--web-root DIR]
27
-
28
- Options:
29
- --listen HOST:PORT Set host and port together
30
- --hostname HOST Bind host (default ${T})
31
- --port PORT Bind port, or 0 for any free port (default ${17874})
32
- --web-root DIR Directory containing the built web UI for web mode
33
- --home DIR Local app-server state directory
34
- --profile-source-root DIR Authorized Profile repository source for app-server
35
- --profile-repository-id ID Source repository identity supplied by the host
36
- --profile-id ID Profile within that source
37
- --profile-revision REV Accepted immutable source revision
38
- --open-browser Open the authenticated web URL in the system browser
39
- --print-access-url Print the authenticated URL instead of opening it
40
- `)}s(he,"printHelp");async function bt(e){let t=we(process.argv.slice(2));if(t.help){he();return}let r=t.mode==="web"?Le(t.webRoot):null;if(t.mode==="web"&&!r)throw new Error("Could not find a built OpenPond web UI. Run `pnpm build:web` or pass --web-root.");if(t.mode==="app-server"){await ye(e.createOpenPondAppServer,t.storeDir,t.profileSource);return}t.storeDir&&(process.env.OPENPOND_HOME=t.storeDir);let o,l=t.port;for(;;)try{o=await e.createOpenPondServer({host:t.host,port:l,webRoot:r,sourceBrowserState:t.sourceBrowserState,...t.storeDir?{storeDir:t.storeDir}:{},httpEnabled:!0});break}catch(p){if(!ue(p))throw p;let d=await de(k({home:t.storeDir??void 0}),l,p);l=d.port,console.log(`OPENPOND_APP_SERVER_READY ${JSON.stringify({mode:"recovery",url:d.url,tokenFile:d.tokenFile,storePath:d.storePath})}`),console.error(`${p.issue.code}: ${p.issue.message} ${p.issue.action}`);let y=await me({baseUrl:d.url,openBrowser:t.openBrowser,printAccessUrl:t.printAccessUrl,token:d.token});for(let O of y.stdout)console.log(O);for(let O of y.stderr)console.error(O);let v=s(()=>{d.close().finally(()=>process.exit(0))},"close");process.once("SIGINT",v),process.once("SIGTERM",v);try{await d.repaired}finally{process.off("SIGINT",v),process.off("SIGTERM",v),await d.close()}}let n=t.mode==="web"?De(o):null;if(console.log(`OPENPOND_APP_SERVER_READY ${JSON.stringify({mode:t.mode,url:o.url,webUrl:null,webRoot:r,tokenFile:o.tokenFile,storePath:o.storePath,runtime:te()})}`),n){let p=await me({baseUrl:n,openBrowser:t.openBrowser,printAccessUrl:t.printAccessUrl,token:o.token});for(let d of p.stderr)console.error(d);for(let d of p.stdout)console.log(d)}else console.log(`OpenPond API server: ${o.url}`);let g=!1,w=s(async()=>{g||(g=!0,await o.close(),process.exit(0))},"shutdown");process.on("SIGINT",()=>{w()}),process.on("SIGTERM",()=>{w()}),await new Promise(()=>{})}s(bt,"runOpenPondServerCli");async function Ot(e){let t=process.argv.slice(2),r=we(!t[0]||t[0].startsWith("-")?["app-server",...t]:t);if(r.help){he();return}if(r.mode!=="app-server")throw new Error("The app-server entrypoint only accepts the app-server command.");await ye(e,r.storeDir,r.profileSource)}s(Ot,"runOpenPondAppServerCli");async function ye(e,t,r){t&&(process.env.OPENPOND_HOME=t);let o=await e({...t?{storeDir:t}:{},...r?{profileSource:r}:{}});await ee({appServer:o,readable:process.stdin,writable:process.stdout})}s(ye,"runAgentServer");export{ne as a,x as b,ae as c,h as d,Je as e,Fe as f,_ as g,le as h,me as i,bt as j,Ot as k};