openpond 0.2.23 → 0.2.25

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 (148) hide show
  1. package/dist/app-server.js +1 -1
  2. package/dist/chunks/actions-command-S27YU6NW.js +2 -0
  3. package/dist/chunks/{app-layer-4CK6ZEKN.js → app-layer-57323XKJ.js} +1 -1
  4. package/dist/chunks/app-server-runtime-QIIJ3KQJ.js +2 -0
  5. package/dist/chunks/apps-U3TXSPU6.js +2 -0
  6. package/dist/chunks/{chunk-MD7IADMT.js → chunk-3YSCXFE6.js} +3 -3
  7. package/dist/chunks/chunk-4KDHMGKI.js +2 -0
  8. package/dist/chunks/{chunk-NS3VMSTX.js → chunk-5WFXFKLA.js} +2 -2
  9. package/dist/chunks/chunk-6LY7GYNK.js +2 -0
  10. package/dist/chunks/{chunk-BZMVB3GS.js → chunk-6XF4GI35.js} +1 -1
  11. package/dist/chunks/{chunk-73KFNV3D.js → chunk-7TV2VBSD.js} +1 -1
  12. package/dist/chunks/{chunk-CXDS2LSW.js → chunk-AC2M2HO3.js} +1 -1
  13. package/dist/chunks/{chunk-ZVOO7FKM.js → chunk-BSHAIAXY.js} +1 -1
  14. package/dist/chunks/{chunk-QWE3RHNY.js → chunk-C5OV4XWF.js} +1 -1
  15. package/dist/chunks/{chunk-WYHHDJEG.js → chunk-D6BBQHZM.js} +12 -12
  16. package/dist/chunks/{chunk-JS6MS2NR.js → chunk-F3VURV3Q.js} +2 -2
  17. package/dist/chunks/chunk-F4WS5QIT.js +54 -0
  18. package/dist/chunks/{chunk-V4ACXLID.js → chunk-GOQDMRUV.js} +1 -1
  19. package/dist/chunks/chunk-J3ZRHNGL.js +2 -0
  20. package/dist/chunks/{chunk-T3VPZRIX.js → chunk-JTX6QZEP.js} +1 -1
  21. package/dist/chunks/{chunk-H75VJFMZ.js → chunk-KLSLHUTO.js} +1 -1
  22. package/dist/chunks/{chunk-Q76GR2JM.js → chunk-M4CJXPMH.js} +1 -1
  23. package/dist/chunks/chunk-M4VGRNP6.js +2 -0
  24. package/dist/chunks/{chunk-XDVKDELR.js → chunk-RBQZVQQM.js} +1 -1
  25. package/dist/chunks/chunk-TJNIYJUH.js +2 -0
  26. package/dist/chunks/{chunk-CTC5EYSH.js → chunk-TR37PJIQ.js} +3 -3
  27. package/dist/chunks/{chunk-3XUBKIBN.js → chunk-UBHTZJEV.js} +1 -1
  28. package/dist/chunks/{chunk-V2BBMZ7I.js → chunk-WK5HTGXV.js} +1 -1
  29. package/dist/chunks/chunk-XRV4WLI7.js +2 -0
  30. package/dist/chunks/chunk-XWPC3AN4.js +1 -0
  31. package/dist/chunks/chunk-Y2NQXJ2Q.js +5 -0
  32. package/dist/chunks/{chunk-DWROB2J6.js → chunk-YNH6AUGE.js} +1 -1
  33. package/dist/chunks/cli-GGYPZNZC.js +2 -0
  34. package/dist/chunks/configuration-command-BASDSNVK.js +2 -0
  35. package/dist/chunks/{continual-OJYXVTIZ.js → continual-6EW2SLGL.js} +1 -1
  36. package/dist/chunks/core-commands-YQTVPPLJ.js +2 -0
  37. package/dist/chunks/desktop-test-JITAYXCK.js +3 -0
  38. package/dist/chunks/dist-5C6RYTQQ.js +2 -0
  39. package/dist/chunks/{extension-AZRG5IPK.js → extension-ZKWQ3ZPJ.js} +1 -1
  40. package/dist/chunks/{help-6IMGNP7A.js → help-SDEZHWZL.js} +1 -1
  41. package/dist/chunks/{opchat-OS7WAVZO.js → opchat-IOP37GN3.js} +1 -1
  42. package/dist/chunks/organizations-4LQEILYG.js +2 -0
  43. package/dist/chunks/{profile-A3YR3WVU.js → profile-MVLYUDLU.js} +1 -1
  44. package/dist/chunks/project-agent-DALYNEZ4.js +2 -0
  45. package/dist/chunks/sandbox-command-VHCKLKN5.js +2 -0
  46. package/dist/chunks/{sandbox-template-FK2TGQPK.js → sandbox-template-WY7XIMDK.js} +1 -1
  47. package/dist/chunks/{src-UIX7LWM7.js → src-22KEI2VU.js} +1 -1
  48. package/dist/chunks/{src-RZFKQSHW.js → src-R3FALV6F.js} +101 -101
  49. package/dist/chunks/taskset-YPKY3HUM.js +2 -0
  50. package/dist/chunks/{teams-bot-PASMNRFS.js → teams-bot-47H7LRFD.js} +1 -1
  51. package/dist/chunks/training-7PST5HZU.js +2 -0
  52. package/dist/chunks/{workspaces-YFAAPNVP.js → workspaces-RAHQXYWB.js} +1 -1
  53. package/dist/cli.js +1 -1
  54. package/dist/index.js +1 -1
  55. package/dist/web/assets/{App-CZo3tYaG.js → App-BzNZ7ycx.js} +28 -28
  56. package/dist/web/assets/{AppDialog-18Y9aU8z.js → AppDialog-C3H3HARP.js} +1 -1
  57. package/dist/web/assets/{AppTerminalPanel-9jAU4wYe.js → AppTerminalPanel-DIXARKfe.js} +2 -2
  58. package/dist/web/assets/{AppsView-BCYnY9mm.js → AppsView-D0xPDTPJ.js} +1 -1
  59. package/dist/web/assets/{BrowserSidebar-BVf3sUAG.js → BrowserSidebar-D5eE9O30.js} +1 -1
  60. package/dist/web/assets/{CartesianChart-iai9Dz1D.js → CartesianChart-KMVbiMJX.js} +1 -1
  61. package/dist/web/assets/{CollaborationTabs-D7bZIwFC.js → CollaborationTabs-C1LTvUbK.js} +1 -1
  62. package/dist/web/assets/{CommandMenu-diFDbKQl.js → CommandMenu-C9elnZaI.js} +1 -1
  63. package/dist/web/assets/{CommunityView-DaLkwOxW.js → CommunityView-BvXxVHmL.js} +1 -1
  64. package/dist/web/assets/{ComposerCreateImproveStrip-B59nTCE7.js → ComposerCreateImproveStrip-Cwu8EaCb.js} +1 -1
  65. package/dist/web/assets/{GetStartedView-BETryURK.js → GetStartedView-BI1j30-I.js} +1 -1
  66. package/dist/web/assets/HostedModelLearningReview-Bwkg3lyV.js +1 -0
  67. package/dist/web/assets/{HostedModelLearningSettings-FCly06RA.js → HostedModelLearningSettings-DhaT1bxX.js} +1 -1
  68. package/dist/web/assets/{LabModelVersionDetailPage-9MzQj6cy.js → LabModelVersionDetailPage-CeSm-sAq.js} +1 -1
  69. package/dist/web/assets/{LabSkillSidebar-BJHO5-J9.js → LabSkillSidebar-BzGs7EC8.js} +1 -1
  70. package/dist/web/assets/{LabsRoute-6jVWrbOO.js → LabsRoute-BQi8W0-2.js} +4 -4
  71. package/dist/web/assets/{MainChatThread-DAoPK8jG.js → MainChatThread-D3KXQ4Te.js} +2 -2
  72. package/dist/web/assets/{MainPane-LDPzuZSj.js → MainPane-J15DRf-n.js} +4 -4
  73. package/dist/web/assets/{MarkdownText-B8URwlq9.js → MarkdownText-BWIVACAt.js} +1 -1
  74. package/dist/web/assets/{Messages-Byk73D9T.js → Messages-BPbo8ih9.js} +1 -1
  75. package/dist/web/assets/{NativeSkillSidebar-BodHqCCH.js → NativeSkillSidebar-BeqI4dXF.js} +1 -1
  76. package/dist/web/assets/{NewExperienceSwitcher-BkUxxlOu.js → NewExperienceSwitcher-BggrQVIi.js} +1 -1
  77. package/dist/web/assets/{NewProjectDialog-BZr2wm-4.js → NewProjectDialog-B4PTFf78.js} +1 -1
  78. package/dist/web/assets/{OutputsPage-C8ZDtD1Y.js → OutputsPage-DChjcyaP.js} +1 -1
  79. package/dist/web/assets/{ProjectsPage-CgfjGsl2.js → ProjectsPage-BdUkyg6I.js} +1 -1
  80. package/dist/web/assets/{RightChatPanelStack-DV3csVka.js → RightChatPanelStack-CLCOzLVJ.js} +1 -1
  81. package/dist/web/assets/{RightSidebarHomePanel-DvLaHLBb.js → RightSidebarHomePanel-qs2Fa4JQ.js} +1 -1
  82. package/dist/web/assets/{ScheduledWorkPage-DtzxPTAL.js → ScheduledWorkPage-DzehKDhk.js} +1 -1
  83. package/dist/web/assets/{SettingsView-C3sVxgPc.js → SettingsView-DJiJKYWW.js} +3 -3
  84. package/dist/web/assets/{TeamChatView-B-w2nrWF.js → TeamChatView-uGwanVsA.js} +1 -1
  85. package/dist/web/assets/{TerminalOverlay-_X7WVAev.js → TerminalOverlay-DJNdErEp.js} +1 -1
  86. package/dist/web/assets/{TrainingCreationPanel-DaVppW1m.js → TrainingCreationPanel-CwyKMNwt.js} +1 -1
  87. package/dist/web/assets/{TrainingDraftPanel-CVj19T6L.js → TrainingDraftPanel-Rdusv4s_.js} +1 -1
  88. package/dist/web/assets/{UsageSettingsSection-fRTHVjhG.js → UsageSettingsSection-BkRalGcP.js} +1 -1
  89. package/dist/web/assets/{WorkSidebarPanel-CGOQwdIW.js → WorkSidebarPanel-d8PB-XNy.js} +1 -1
  90. package/dist/web/assets/{WorkspaceDiffPanel-D6hbMv14.js → WorkspaceDiffPanel-DfpyLroX.js} +3 -3
  91. package/dist/web/assets/{WorkspaceEnvironmentMenu-rWj1aDI4.js → WorkspaceEnvironmentMenu-DhUUB-lq.js} +1 -1
  92. package/dist/web/assets/{WorkspaceGitDialogs-DVU5SrD-.js → WorkspaceGitDialogs-0juVLtVy.js} +1 -1
  93. package/dist/web/assets/{WorkspaceMonacoEditor-D78JPviN.js → WorkspaceMonacoEditor-Blo5esSN.js} +3 -3
  94. package/dist/web/assets/{arrow-up-right-CnaPKXjg.js → arrow-up-right-BXeo-8KJ.js} +1 -1
  95. package/dist/web/assets/{chat-file-links-D1INEr8r.js → chat-file-links-BEbA_E33.js} +1 -1
  96. package/dist/web/assets/chevron-up-Dx5rir4H.js +1 -0
  97. package/dist/web/assets/{clipboard-B8GTg8tx.js → clipboard-17OIp5F-.js} +1 -1
  98. package/dist/web/assets/{cloud-upload-BlEc_10E.js → cloud-upload-D28o8URw.js} +1 -1
  99. package/dist/web/assets/{cssMode-BiYvezMD.js → cssMode-DDPYV_bh.js} +1 -1
  100. package/dist/web/assets/{folder-open-BaNdbDD5.js → folder-open-CqBlANkk.js} +1 -1
  101. package/dist/web/assets/{folder-plus-BQhz_VxM.js → folder-plus-DkUnvZhx.js} +1 -1
  102. package/dist/web/assets/{git-commit-horizontal-wv523Ooq.js → git-commit-horizontal-BEIomQj0.js} +1 -1
  103. package/dist/web/assets/{htmlMode-BaMdOCq4.js → htmlMode-gF-t3JxJ.js} +1 -1
  104. package/dist/web/assets/{index-DP8vqolj.js → index-Dg_FWrRZ.js} +2 -2
  105. package/dist/web/assets/{info-C0Ova1D9.js → info-n9PKmODI.js} +1 -1
  106. package/dist/web/assets/{jsonMode-BTt0GByK.js → jsonMode-B5DVQ7wE.js} +1 -1
  107. package/dist/web/assets/{lspLanguageFeatures-C-1acLbv.js → lspLanguageFeatures-FK4QlUnB.js} +1 -1
  108. package/dist/web/assets/{minimize-2-CW5KYp0W.js → minimize-2--J7-Zqg1.js} +1 -1
  109. package/dist/web/assets/{monaco.contribution-DoAhyjpn.js → monaco.contribution-CM_Srh4F.js} +2 -2
  110. package/dist/web/assets/{monaco.contribution-P9b5cZU2.js → monaco.contribution-CV2W_Ydj.js} +2 -2
  111. package/dist/web/assets/{monaco.contribution-DyKzYxR3.js → monaco.contribution-DCmsluF_.js} +2 -2
  112. package/dist/web/assets/{monaco.contribution-CpiBa8rP.js → monaco.contribution-DEkLSjvo.js} +2 -2
  113. package/dist/web/assets/{play-jV1i4pfe.js → play-CT6lFZDI.js} +1 -1
  114. package/dist/web/assets/{python-BQnnGrv3.js → python-DQHHAEpa.js} +1 -1
  115. package/dist/web/assets/{refresh-cw-REnkUGNy.js → refresh-cw-Cm-4hHSn.js} +1 -1
  116. package/dist/web/assets/{save-B2WTTCI_.js → save-CwgR_oyc.js} +1 -1
  117. package/dist/web/assets/{square-CRb2lKMC.js → square-DPrPBeHW.js} +1 -1
  118. package/dist/web/assets/{toggleHighContrast-BGsGhGW4.js → toggleHighContrast-C1QZjrPj.js} +1 -1
  119. package/dist/web/assets/{tsMode-BWtSmvFs.js → tsMode-DY4Ji1ac.js} +1 -1
  120. package/dist/web/assets/{upload-B_PICaZn.js → upload-DABGNAIq.js} +1 -1
  121. package/dist/web/assets/{useLocalAgentSchedules-zmmvBnwd.js → useLocalAgentSchedules-D5P28Jej.js} +1 -1
  122. package/dist/web/assets/{wifi-off-CjKTt0zE.js → wifi-off-CJOdJJRb.js} +1 -1
  123. package/dist/web/assets/{workers-CxglqyKV.js → workers-BLjr7D_D.js} +1 -1
  124. package/dist/web/assets/{yaml-DgyPsmb2.js → yaml-eXk00scV.js} +1 -1
  125. package/dist/web/index.html +1 -1
  126. package/package.json +1 -1
  127. package/dist/chunks/actions-command-CZD7U6CC.js +0 -2
  128. package/dist/chunks/app-server-runtime-5XZWU7JL.js +0 -2
  129. package/dist/chunks/apps-NIQBGOGH.js +0 -2
  130. package/dist/chunks/chunk-3YAGJU2X.js +0 -2
  131. package/dist/chunks/chunk-G2VYRU27.js +0 -5
  132. package/dist/chunks/chunk-HZP5U2AA.js +0 -3
  133. package/dist/chunks/chunk-J3WNPOLS.js +0 -2
  134. package/dist/chunks/chunk-NNLI4OWY.js +0 -53
  135. package/dist/chunks/chunk-SS3EG6S2.js +0 -2
  136. package/dist/chunks/chunk-Y7ZYJQGZ.js +0 -2
  137. package/dist/chunks/cli-GWKOPTLS.js +0 -2
  138. package/dist/chunks/configuration-command-OAZNWOFX.js +0 -2
  139. package/dist/chunks/core-commands-VGUAOSWS.js +0 -2
  140. package/dist/chunks/desktop-test-SPTFR43A.js +0 -3
  141. package/dist/chunks/dist-UA2RQUA4.js +0 -2
  142. package/dist/chunks/organizations-QPACFCMH.js +0 -2
  143. package/dist/chunks/project-agent-5H6VCDAY.js +0 -2
  144. package/dist/chunks/sandbox-command-RKUHXCZJ.js +0 -2
  145. package/dist/chunks/taskset-PISBOILQ.js +0 -2
  146. package/dist/chunks/training-2NDOWH5S.js +0 -2
  147. package/dist/web/assets/HostedModelLearningReview-D5JtAiLZ.js +0 -1
  148. package/dist/web/assets/chevron-up-Bx5d_Wmr.js +0 -1
@@ -1 +1 @@
1
- import{c as v,v as s}from"./App-CZo3tYaG.js";import{r as c}from"./index-DP8vqolj.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,v as s}from"./App-BzNZ7ycx.js";import{r as c}from"./index-Dg_FWrRZ.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 +1 @@
1
- import{c as a}from"./App-CZo3tYaG.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-BzNZ7ycx.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-D78JPviN.js";import"./toggleHighContrast-BGsGhGW4.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-Blo5esSN.js";import"./toggleHighContrast-C1QZjrPj.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-D78JPviN.js";import"./toggleHighContrast-BGsGhGW4.js";import"./index-DP8vqolj.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-Blo5esSN.js";import"./toggleHighContrast-C1QZjrPj.js";import"./index-Dg_FWrRZ.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,7 +7,7 @@
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-DP8vqolj.js"></script>
10
+ <script type="module" crossorigin src="./assets/index-Dg_FWrRZ.js"></script>
11
11
  <link rel="stylesheet" crossorigin href="./assets/index-C5EoPZr0.css">
12
12
  </head>
13
13
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openpond",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
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{b as h,c as f,d as p}from"./chunk-XEOEKFG6.js";import{a as w}from"./chunk-H75VJFMZ.js";import"./chunk-J3WNPOLS.js";import"./chunk-J2S7BOZU.js";import"./chunk-WYHHDJEG.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import{f as y}from"./chunk-3M53YXEI.js";import{a as c}from"./chunk-FTQLQJQV.js";import{promises as I,watch as N}from"node:fs";import m from"node:path";import{execFile as A}from"node:child_process";import{promisify as E}from"node:util";var S=E(A);async function x(t,n){let r=n[0]??"check",e=m.resolve(s(t,"cwd")??process.cwd()),l=s(t,"sourceDirectory"),u=s(t,"outputDirectory"),d=y(t.json);if(r==="check"||r==="build"){let o=await f({projectRoot:e,sourceDirectory:l,outputDirectory:u});if(d){console.log(JSON.stringify({status:"passed",actionCount:o.registry.actions.length,registry:o.registry,manifest:o.manifest,outputDirectory:o.outputDirectory},null,2));return}console.log(`${r==="check"?"Validated":"Built"} ${o.registry.actions.length} Project Action${o.registry.actions.length===1?"":"s"}.`),console.log(`Registry: ${o.registryPath}`),console.log(`Bundle: ${o.bundlePath}`);return}if(r==="run"){let o=n[1];if(!o)throw new Error("usage: openpond actions run <action-id> [--input JSON|--input-file PATH]");let a=await p({projectRoot:e,sourceDirectory:l,outputDirectory:u,build:"always"}).run({actionId:o,input:await v(t,e),timeoutMs:R(t,"timeoutMs")});console.log(JSON.stringify(a,null,2));return}if(r==="dev"){let o=n[1]??null;await $({projectRoot:e,sourceDirectory:l,outputDirectory:u,actionId:o,options:t,json:d});return}if(r==="publish"){let o=b(t,"projectId"),i=b(t,"teamId"),a=s(t,"apiKey")??process.env.OPENPOND_API_KEY?.trim();if(!a)throw new Error("OpenPond API key is required. Set OPENPOND_API_KEY or pass --api-key.");let j=await f({projectRoot:e,sourceDirectory:l,outputDirectory:u}),D=s(t,"sourceCommitSha")??await P(e,["rev-parse","HEAD"]),O=s(t,"sourceRef")??await P(e,["rev-parse","--abbrev-ref","HEAD"]),g=await w({apiKey:a,baseUrl:s(t,"baseUrl")??process.env.OPENPOND_API_URL}).actions.publish({projectId:o,teamId:i,sourceRef:O,sourceCommitSha:D,build:j});console.log(d?JSON.stringify({release:g},null,2):`Published Project Actions release ${g.id} from ${g.sourceCommitSha}.`);return}throw new Error("usage: openpond actions <check|build|run|dev|publish> [action-id]")}c(x,"runProjectActionsCommand");async function $(t){let n=!1,r=!1,e=c(async()=>{if(n){r=!0;return}n=!0;try{let o=p({projectRoot:t.projectRoot,sourceDirectory:t.sourceDirectory,outputDirectory:t.outputDirectory,build:"always"});if(t.actionId){let i=await o.run({actionId:t.actionId,input:await v(t.options,t.projectRoot),timeoutMs:R(t.options,"timeoutMs")});console.log(JSON.stringify(i,null,2))}else{let i=await o.build(),a={status:"ready",actionCount:i.registry.actions.length,bundleHash:i.manifest.bundleHash};console.log(t.json?JSON.stringify(a):`Ready with ${a.actionCount} Project Action${a.actionCount===1?"":"s"}.`)}}catch(o){console.error(o instanceof Error?o.message:String(o))}finally{n=!1,r&&(r=!1,await e())}},"execute");await e();let l=await h(t.projectRoot),u=m.resolve(t.projectRoot,t.sourceDirectory??l.sourceDirectory??"openpond/actions");console.log(`Watching ${u}`);let d=N(u,{recursive:!0},()=>{setTimeout(()=>{e()},50)});await new Promise(o=>{let i=c(()=>{d.close(),o()},"stop");process.once("SIGINT",i),process.once("SIGTERM",i)})}c($,"runDev");async function v(t,n){let r=s(t,"input"),e=s(t,"inputFile");if(r&&e)throw new Error("Use either --input or --input-file, not both.");return r?JSON.parse(r):e?JSON.parse(await I.readFile(m.resolve(n,e),"utf8")):{}}c(v,"actionInput");function s(t,n){let r=t[n];return typeof r=="string"&&r.trim()?r.trim():void 0}c(s,"stringOption");function b(t,n){let r=s(t,n);if(!r)throw new Error(`--${n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)} is required.`);return r}c(b,"requiredOption");async function P(t,n){let{stdout:r}=await S("git",n,{cwd:t}),e=r.trim();if(!e)throw new Error(`git ${n.join(" ")} returned no value.`);return e}c(P,"gitValue");function R(t,n){let r=s(t,n);if(r===void 0)return;let e=Number(r);if(!Number.isInteger(e)||e<=0)throw new Error(`--${n} must be a positive integer.`);return e}c(R,"integerOption");export{x as runProjectActionsCommand};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{ed as c,fd as d}from"./chunk-NS3VMSTX.js";import"./chunk-T3VPZRIX.js";import{j as a,t as b}from"./chunk-MD7IADMT.js";import"./chunk-XDVKDELR.js";import"./chunk-V2BBMZ7I.js";import"./chunk-Q76GR2JM.js";import"./chunk-XEOEKFG6.js";import"./chunk-CTC5EYSH.js";import"./chunk-6MI4KKWF.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-J3WNPOLS.js";import"./chunk-J2S7BOZU.js";import"./chunk-WYHHDJEG.js";import"./chunk-6FA3GG5B.js";import"./chunk-NNLI4OWY.js";import"./chunk-HZP5U2AA.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,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{c as g,i as $,j as J,k as L,l as v,m as q}from"./chunk-G2VYRU27.js";import{f as m,h as y}from"./chunk-ZVOO7FKM.js";import{b as H,c as Q}from"./chunk-22UARBPW.js";import"./chunk-OGPHXXCD.js";import"./chunk-H75VJFMZ.js";import{J as C,K as G,L as k,O as W,Q as M,S as z,T as F,Z as f,c as D,m as K,r as V,s as _}from"./chunk-SS3EG6S2.js";import"./chunk-GLUWATL5.js";import"./chunk-J3WNPOLS.js";import"./chunk-J2S7BOZU.js";import"./chunk-WYHHDJEG.js";import"./chunk-CXDS2LSW.js";import"./chunk-NNLI4OWY.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-JS6MS2NR.js";import{a as S,f as w,j as T,k as j}from"./chunk-3M53YXEI.js";import{a as p}from"./chunk-FTQLQJQV.js";async function ie(){let e=await f(),s=m(e),t=await g(e,s),n=y(e),r=await L({apiBase:n,apiKey:t});console.log(JSON.stringify(r,null,2))}p(ie,"runAppsTools");async function se(e){let s=await f(),t=m(s),n=y(s),r=await g(s,t),i=typeof e.handle=="string"?String(e.handle):void 0,o=i?$(i):null,c=e.refresh!==void 0?w(e.refresh):void 0,l=await J({apiBase:n,apiKey:r,forceRefresh:c}),u=o?l.filter(a=>$(a.handle||a.gitOwner)===o):l;if(u.length===0){console.log("no apps found");return}if(w(e.json)){console.log(JSON.stringify({apps:u},null,2));return}for(let a of u){let d=a.handle||a.gitOwner||"unknown",h=a.repo||a.gitRepo||a.id,B=a.latestDeployment?.status||"no-deploy",R=a.latestDeployment?.gitBranch||a.defaultBranch||"-",I=a.codeVisibility||"unknown",E=a.sandbox?"yes":"no";console.log(`${d}/${h} ${B} ${R} code=${I} sandbox=${E} ${a.id}`)}}p(se,"runAppsList");async function oe(e,s){let t=typeof e.visibility=="string"?e.visibility.trim():typeof e.codeVisibility=="string"?e.codeVisibility.trim():"";if(t!=="public"&&t!=="private")throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");let n=await f(),r=m(n),i=y(n),o=await g(n,r),{app:c,handle:l,repo:u}=await v(i,o,s),a=await K(i,o,c.id,t);console.log(`${l}/${u} code_visibility=${a.app?.codeVisibility??t} app_id=${c.id}`)}p(oe,"runAppsCodeVisibility");async function ae(e){let s=await f(),t=m(s),n=await g(s,t),r=y(s),i=typeof e.appId=="string"?String(e.appId):void 0,o=await G(r,n,{appId:i});console.log(JSON.stringify(o,null,2))}p(ae,"runAppsPerformance");async function ce(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await k(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(ce,"runAppsSummary");async function le(e,s,t,n){let r=(typeof e.prompt=="string"?e.prompt:null)||n.join(" ");if(!r.trim())throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,t),a=await W(c,l,{appId:u.id,mode:s,prompt:r.trim()});console.log(JSON.stringify(a,null,2))}p(le,"runAppsAssistant");async function de(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),o=(typeof e.prompt=="string"?e.prompt:null)||s.join(" ");if(!o.trim())throw new Error("usage: apps agent create --prompt <text> [--team-id <id>]");let c=typeof e.templateRepoUrl=="string"?e.templateRepoUrl:void 0,l=typeof e.templateBranch=="string"?e.templateBranch:void 0,u=typeof e.templateLocalPath=="string"?e.templateLocalPath:void 0,a=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0;if(u&&String(u).trim().length>0)throw new Error("templateLocalPath is not supported; use templateRepoUrl");let d=typeof e.env=="string"?S(e.env,"env"):void 0;if(d){if(typeof d!="object"||Array.isArray(d))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(d))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}let h=c||l||d?{templateRepoUrl:c,templateBranch:l,envVars:d}:void 0,B=typeof e.deployEnvironment=="string"?e.deployEnvironment==="preview"?"preview":"production":void 0,R=e.deployDisabled!==void 0?w(e.deployDisabled):void 0,I=e.streamDeployLogs!==void 0?w(e.streamDeployLogs):!0,E=await C(i,r,{prompt:o.trim(),...a?{teamId:a}:{},...h?{template:h}:{},...B?{deployEnvironment:B}:{},...R!==void 0?{deployDisabled:R}:{},streamDeployLogs:I});if(!E.ok){let b=await E.text().catch(()=>"");throw new Error(`agent create failed: ${E.status} ${b}`)}let N=null,O=null,P=null;await H(E,{onConversationId:p(b=>{N=b},"onConversationId"),onItems:p(b=>{for(let A of b){let U=Q(A);U&&console.log(U);let x=A;!O&&typeof x.appId=="string"&&(O=x.appId),!P&&typeof x.deploymentId=="string"&&(P=x.deploymentId)}},"onItems")}),N&&console.log(`conversation_id: ${N}`),O&&console.log(`app_id: ${O}`),P&&console.log(`deployment_id: ${P}`);try{await J({apiBase:i,apiKey:r,forceRefresh:!0}),await L({apiBase:i,apiKey:r,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}p(de,"runAppsAgentCreate");async function pe(e,s,t,n){let r=await f(),i=m(r),o=await g(r,i),c=y(r),l=typeof e.method=="string"?String(e.method).toUpperCase():void 0,u=l&&["GET","POST","PUT","DELETE"].includes(l)?l:void 0;if(l&&!u)throw new Error("method must be GET, POST, PUT, or DELETE");let a=typeof e.body=="string"?S(String(e.body),"body"):void 0,d=typeof e.headers=="string"?S(String(e.headers),"headers"):void 0,h=typeof e.scheduleId=="string"?String(e.scheduleId):void 0,B=w(e.notifyEmail),R=w(e.summary)||w(e.withSummary),I=await M(c,o,{appId:s,deploymentId:t,toolName:n,scheduleId:h,method:u,body:a,headers:d,notifyEmail:B||void 0});if(console.log(JSON.stringify(I,null,2)),R&&I.ok){let E=await k(c,o,s);console.log(JSON.stringify({summary:E},null,2))}}p(pe,"runAppsToolsExecute");async function ue(e,s){let t=typeof e.env=="string"?e.env:typeof e.vars=="string"?e.vars:typeof e.envVars=="string"?e.envVars:null;if(!t)throw new Error("usage: apps env set <handle>/<repo> --env <json>");let n=S(t,"env");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("env must be a JSON object");let r={};for(let[d,h]of Object.entries(n)){if(typeof h!="string")throw new Error(`env value for ${d} must be a string`);if(!d.startsWith("OPENTOOL_PUBLIC_"))throw new Error("only OPENTOOL_PUBLIC_ env vars can be set");r[d]=h}let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,s),a=await V(c,l,u.id,{envVars:r});console.log(JSON.stringify(a,null,2))}p(ue,"runAppsEnvSet");async function fe(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await _(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(fe,"runAppsEnvGet");async function ge(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o,handle:c,repo:l}=await v(r,i,s),u=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,a=j(u),d=await D(r,i,o.id,{environment:a});console.log(JSON.stringify(d,null,2)),(w(e.watch)||w(e.wait)||w(e.follow))&&await q({baseUrl:r,apiKey:i,deploymentId:d.deploymentId,prefix:`[${c}/${l}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}p(ge,"runAppsDeploy");function X(e){let s={};if(typeof e.params=="string"){let n=S(String(e.params),"params");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("params must be a JSON object");for(let[r,i]of Object.entries(n))i!==void 0&&(s[r]=typeof i=="string"?i:JSON.stringify(i))}let t=p((n,r)=>{r===void 0||r===""||(s[n]=r)},"addParam");if(t("source",typeof e.source=="string"?e.source.trim():void 0),t("symbol",typeof e.symbol=="string"?e.symbol.trim():void 0),t("cursor",typeof e.cursor=="string"?e.cursor.trim():void 0),t("status",typeof e.status=="string"?e.status.trim():void 0),t("backtestRunId",typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():void 0),t("since",T(e.since,"since")),t("until",T(e.until,"until")),typeof e.limit=="string"&&e.limit.trim().length>0){let n=Number.parseInt(e.limit,10);if(!Number.isFinite(n))throw new Error("limit must be a number");t("limit",String(n))}return Object.keys(s).length?s:void 0}p(X,"resolveBacktestEventsParams");async function me(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),{app:o}=await v(i,r,s),c={...X(e)??{},appId:o.id},l=await z(i,r,{method:"GET",query:c});console.log(JSON.stringify(l,null,2))}p(me,"runBacktestEvents");async function ye(e,s){let t=typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():"";if(!t)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");let n=await f(),r=m(n),i=await g(n,r),o=y(n),{app:c}=await v(o,i,s),l=await F(o,i,{appId:c.id,runId:t});console.log(JSON.stringify(l,null,2))}p(ye,"runBacktestGet");export{X as resolveBacktestEventsParams,de as runAppsAgentCreate,le as runAppsAssistant,oe as runAppsCodeVisibility,ge as runAppsDeploy,fe as runAppsEnvGet,ue as runAppsEnvSet,se as runAppsList,ae as runAppsPerformance,ce as runAppsSummary,ie as runAppsTools,pe as runAppsToolsExecute,me as runBacktestEvents,ye as runBacktestGet};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{A as F,a as fe,b as L,c as R,d as me,e as D,f as G,g as j,h as z,j as ye,l as T,m as we,n as S,o as he,y as B}from"./chunk-G2VYRU27.js";import{b as H,c as be,d as ve,f as w,h as P,i as Re}from"./chunk-ZVOO7FKM.js";import{$ as ge,M as ce,N as le,R as de,V as pe,Z as y,_ as ue,aa as C,h as $,i as ne,l as oe,n as re,o as ie,p as ae,q as se}from"./chunk-SS3EG6S2.js";import{a as Z,b as ee,c as te}from"./chunk-JS6MS2NR.js";import{a as M,f as v,k as X}from"./chunk-3M53YXEI.js";import{a as g}from"./chunk-FTQLQJQV.js";import{promises as V,existsSync as W}from"node:fs";import U from"node:path";import{stdin as $e}from"node:process";async function Ge(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=await ie(n,i,a.id);console.log(JSON.stringify(s,null,2))}g(Ge,"runTemplateStatus");async function je(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=await ae(n,i,a.id);console.log(JSON.stringify(s,null,2))}g(je,"runTemplateBranches");async function ze(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,f=X(s),c=await se(n,i,a.id,{environment:f});console.log(JSON.stringify(c,null,2))}g(ze,"runTemplateUpdate");async function He(e){let o=await y(),t=w(o),r=typeof e.apiKey=="string"?e.apiKey:typeof e.key=="string"?e.key:null,n=r?r.trim():await L();if(!n)throw new Error("API key is required");n.startsWith("opk_")||console.log("warning: API keys usually start with opk_."),await C({handle:o.activeProfile?.handle||"default",apiKey:n,baseUrl:t,apiBaseUrl:o.apiBaseUrl,chatApiBaseUrl:o.chatApiBaseUrl,setActive:!0}),console.log("Saved account credentials to the encrypted OpenPond credential store.")}g(He,"runLogin");async function Fe(e,o){let t=o[0]||"list";if(t==="list"){let r=await ue();console.log(JSON.stringify({profiles:r},null,2));return}if(t==="use"){let r=o[1];if(!r)throw new Error("usage: profiles use <name> [--base-url <url>]");let n=await ge(r,{baseUrl:H(e)});console.log(JSON.stringify({profile:n},null,2));return}if(t==="save"){let r=o[1];if(!r)throw new Error("usage: profiles save <name> --api-key <key> [--base-url <url>] [--api-base-url <url>] [--chat-api-base-url <url>]");let n=typeof e.apiKey=="string"?e.apiKey:typeof e.key=="string"?e.key:null,i=n?n.trim():await L(),a=typeof e.environment=="string"?e.environment:typeof e.env=="string"?e.env:void 0,s=await C({handle:r,apiKey:i,baseUrl:H(e),apiBaseUrl:be(e),chatApiBaseUrl:ve(e),environment:a,setActive:!0});console.log(JSON.stringify({profile:s},null,2));return}throw new Error("usage: profiles <list|use|save> [args]")}g(Fe,"runProfiles");async function Ve(){let e=await y(),o=w(e),t=P(e),r=await R(e,o),n=await ce(t,r);console.log(JSON.stringify(n,null,2))}g(Ve,"runAccount");async function We(e){let o=await y(),t=P(o),r=fe(o),n=await le(t,r);console.log(JSON.stringify(n,null,2))}g(We,"runHealth");async function qe(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=typeof e.branch=="string"?String(e.branch):void 0,f=await $(n,i,a.id,{branch:s});if(!f?.id){console.log("no deployments found");return}let c=await ne(n,i,f.id),d=(c&&Array.isArray(c.toolsJson)?c.toolsJson:null)||(c&&typeof c.metadataJson=="object"&&c.metadataJson?c.metadataJson.tools:null),u=Array.isArray(d)?d:[];if(u.length===0){console.log("no tools found");return}for(let l of u){let m=l,h=m.profile||m.function,I=m.name||h?.name||"unknown",p=m.description||h?.description||"";console.log(p?`${I} - ${p}`:I)}}g(qe,"runToolList");async function Ye(e,o,t){let r=await y(),n=w(r),i=P(r),a=await R(r,n),{app:s}=await T(i,a,o),f=typeof e.branch=="string"?String(e.branch):void 0,c=await $(i,a,s.id,{branch:f});if(!c?.id)throw new Error("no deployments found");let d;if(typeof e.body=="string")try{d=JSON.parse(e.body)}catch{throw new Error("tool body must be valid JSON")}let u=typeof e.method=="string"?String(e.method).toUpperCase():"POST",l=await pe(n,a,{appId:s.id,deploymentId:c.id,toolName:t,method:u,body:d,headers:a?{"openpond-api-key":a}:void 0});if(!l.ok)throw new Error(l.error||`tool failed (${l.status})`);let m=l.data??{ok:!0};console.log(JSON.stringify(m,null,2))}g(Ye,"runToolRun");async function Qe(e,o,t){let r=await y(),n=w(r),i=P(r),a=await R(r,n),{app:s}=await T(i,a,o),f=typeof e.branch=="string"?String(e.branch):void 0,c=typeof e.deploymentId=="string"?String(e.deploymentId):void 0,d=c?{id:c}:await $(i,a,s.id,{branch:f});if(!d?.id)throw new Error("no deployments found");let u=typeof e.body=="string"?M(String(e.body),"body"):{};if(!u||typeof u!="object"||Array.isArray(u))throw new Error("body must be a JSON object");let l=typeof e.method=="string"?String(e.method).toUpperCase():"POST",m={...u,appId:s.id,deploymentId:d.id,toolName:t,method:l},h=await de(i,a,m);console.log(JSON.stringify(h,null,2))}g(Qe,"runBacktestRun");async function Xe(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a,handle:s,repo:f}=await T(n,i,o),c=typeof e.branch=="string"?String(e.branch):void 0,d=typeof e.deploymentId=="string"?String(e.deploymentId):void 0,u=d?{id:d}:await $(n,i,a.id,{branch:c});if(!u?.id){console.log("no deployments found");return}await we({baseUrl:n,apiKey:i,deploymentId:u.id,prefix:`[${s}/${f}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}g(Xe,"runDeployWatch");async function Ze(e,o){let r=((typeof e.name=="string"?e.name:null)||o.join(" ")).trim();if(!r)throw new Error("usage: repo create --name <name> [--team-id <id>] [--path <dir>] [--template <owner/repo|url>] [--template-branch <branch>] [--empty|--opentool] [--sandbox] [--token] [--auto-schedule-migration <true|false>]");let n=await y(),i=w(n),a=await R(n,i),s=P(n),f=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0,c=typeof e.template=="string"?e.template.trim():"";if(c&&(e.empty==="true"||e.opentool==="true"))throw new Error("choose one: --template or --empty/--opentool");if(e.empty==="true"&&e.opentool==="true")throw new Error("choose one: --empty or --opentool");let d=typeof e.description=="string"?e.description.trim():void 0,u=typeof e.templateBranch=="string"&&e.templateBranch.trim().length>0?e.templateBranch.trim():void 0,l=typeof e.env=="string"?M(e.env,"env"):void 0;if(l){if(typeof l!="object"||Array.isArray(l))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(l))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}if(c){e.deployOnPush!==void 0&&console.warn("deploy-on-push is not used for template create (auto deploys)");let b=Re(c,i),k=(await re(s,a,[{name:r,...d?{description:d}:{},templateRepoUrl:b,...u?{templateBranch:u}:{},...l?{envVars:l}:{}}],f)).items?.[0];if(!k||k.status!=="ok"||!k.appId)throw new Error(k?.error||"Template create failed");console.log(`app_id: ${k.appId}`),k.deploymentId&&console.log(`deployment_id: ${k.deploymentId}`),k.conversationId&&console.log(`conversation_id: ${k.conversationId}`);return}let m=process.cwd(),h=typeof e.path=="string"?e.path:typeof e.dir=="string"?e.dir:null,I=h&&h.trim().length>0?h.trim():$e.isTTY?await he(m):m,p=U.resolve(I);if(W(p)){if(!(await V.stat(p)).isDirectory())throw new Error(`path is not a directory: ${p}`)}else await V.mkdir(p,{recursive:!0});let Pe=(await V.readdir(p)).filter(b=>b!==".git").length===0,x=v(e.yes)||v(e.force);if(!Pe&&!x&&!await S(`Directory is not empty (${p}). Continue?`,!1)){console.log("aborted");return}let ke=U.join(p,".git");if(!W(ke)){if(!(x?!0:await S("Initialize git repository here?",!0))){console.log("aborted");return}let A=await B("git",["init"],{cwd:p});if(A.code!==0)throw new Error(`git init failed: ${A.stderr.trim()||A.stdout.trim()||"unknown error"}`)}let K=await F(p,"origin");if(K&&!x&&!await S(`Remote "origin" already set (${K}). Replace it?`,!1)){console.log("aborted");return}let q=e.opentool==="true"?"opentool":"empty",Te=v(e.sandbox),Be=v(e.deployOnPush),N=e.autoScheduleMigration,Y=typeof N=="string"||typeof N=="boolean",Ee=Y?v(N):void 0,E=await oe(s,a,{name:r,...f?{teamId:f}:{},...d?{description:d}:{},...q?{repoInit:q}:{},...Te?{sandbox:!0}:{},...l?{envVars:l}:{},...Be?{deployOnPush:!0}:{},...Y?{autoScheduleMigration:Ee}:{}}),O=me(E);z(O);let J=v(e.token)||v(e.setRemoteToken),Oe=D(O,a),Q=J?Oe:O,_=await B("git",K?["remote","set-url","origin",Q]:["remote","add","origin",Q],{cwd:p});if(_.code!==0)throw new Error(`git remote failed: ${j(_.stderr.trim()||_.stdout.trim()||"unknown error")}`);let Ae=J?G(O):O;console.log(`app_id: ${E.appId}`),E.gitOwner&&E.gitRepo&&console.log(`repo: ${E.gitOwner}/${E.gitRepo}`),console.log(`remote: ${Ae}`),console.log('next: git add . && git commit -m "init"');let Ie=E.defaultBranch||"master";console.log(`next: openpond repo push --path ${p} --branch ${Ie}`),J||console.log(`token-remote (non-interactive): git -C ${p} remote set-url origin ${G(O)}`);try{await ye({apiBase:s,apiKey:a,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}g(Ze,"runRepoCreate");async function Se(e){let o=await B("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e});if(o.code!==0)return null;let t=o.stdout.trim();return t.length>0?t:null}g(Se,"resolveGitBranch");async function et(e){let o=await y(),t=w(o),r=await R(o,t),n=typeof e.path=="string"?e.path:typeof e.dir=="string"?e.dir:null,i=U.resolve(n&&n.trim().length>0?n.trim():"."),a=U.join(i,".git");if(!W(a))throw new Error(`git repo not found at ${i} (missing .git)`);let s=await F(i,"origin");if(!s)throw new Error("origin remote not set; run `openpond repo create` first");z(s);let c=(typeof e.branch=="string"?e.branch.trim():"")||await Se(i);if(!c)throw new Error("unable to resolve git branch; pass --branch");let d;try{d=D(s,r)}catch{throw new Error("origin remote must be https for tokenized pushes")}let u=v(e.keepTokenRemote)||v(e.token)||v(e.setRemoteToken),l=s.includes("x-access-token:"),m=!u&&!l?s:null,h=process.env.GIT_TERMINAL_PROMPT;process.env.GIT_TERMINAL_PROMPT="0";try{if(!l){let p=await B("git",["remote","set-url","origin",d],{cwd:i});if(p.code!==0)throw new Error(`git remote set-url failed: ${j(p.stderr.trim()||p.stdout.trim()||"unknown error")}`)}if((await B("git",["push","-u","origin",c],{cwd:i,inherit:!0})).code!==0)throw new Error("git push failed")}finally{m&&await B("git",["remote","set-url","origin",m],{cwd:i}).catch(()=>null),h===void 0?delete process.env.GIT_TERMINAL_PROMPT:process.env.GIT_TERMINAL_PROMPT=h}}g(et,"runRepoPush");async function tt(e){if(e.length===0)throw new Error("usage: opentool <init|validate|build> [args]");let o=process.platform==="win32"?"npx.cmd":"npx";if((await B(o,["opentool",...e],{inherit:!0})).code!==0)throw new Error("opentool command failed")}g(tt,"runOpentool");async function nt(){let e="openpond",o=Z(),t=await te(e),r=`npm i -g ${e}@${t}`,n=ee(o,t);if(n===0){console.log(`${e} is up to date (${o})`);return}if(n===-1){console.log(`Update available: ${o} -> ${t}`),console.log(`Run: ${r}`);return}if(n===1){console.log(`Installed version (${o}) is newer than npm latest (${t}).`);return}if(o===t){console.log(`${e} is up to date (${o})`);return}console.log(`Installed: ${o}`),console.log(`Latest: ${t}`),console.log(`Run: ${r}`)}g(nt,"runCheckUpdate");export{Ge as a,je as b,ze as c,He as d,Fe as e,Ve as f,We as g,qe as h,Ye as i,Qe as j,Xe as k,Ze as l,Se as m,et as n,tt as o,nt as p};
@@ -1,5 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{e as D,f as K,g as W}from"./chunk-ZVOO7FKM.js";import{Z as B,ca as L,da as x,ea as U,f as A,fa as C,g as I,ga as M,ha as N,ia as k,j as _,u as T}from"./chunk-SS3EG6S2.js";import{a as O,b as v}from"./chunk-GLUWATL5.js";import{h as $}from"./chunk-J2S7BOZU.js";import{f as y}from"./chunk-3M53YXEI.js";import{a as o}from"./chunk-FTQLQJQV.js";import{stdin as q,stdout as F}from"node:process";import{createInterface as oe}from"node:readline/promises";var ie=`${O}/settings/api-keys`;function se(e){let t=process.env.OPENPOND_API_KEY?.trim();if(t)return t;let n=e.apiKey?.trim();if(n)return n;let r=e.token?.trim();return r&&r.startsWith("opk_")?r:null}o(se,"resolveApiKey");async function ae(){if(!q.isTTY||!F.isTTY)throw new Error("OpenPond API key is required in non-interactive mode. Set OPENPOND_API_KEY or run `openpond login` in a terminal.");console.log("Open the OpenPond UI to create an API key:"),console.log(ie);let e=oe({input:q,output:F});try{let t=(await e.question("Paste your OpenPond API key: ")).trim();if(!t)throw new Error("API key is required");return t.startsWith("opk_")||console.log("warning: API keys usually start with opk_."),t}finally{e.close()}}o(ae,"promptForApiKey");async function H(e,t){let n=se(e);if(n)return n;let r=await ae();return await L({apiKey:r,baseUrl:t,activeProfile:e.activeProfile}),console.log("Saved account credentials to the encrypted OpenPond credential store."),r}o(H,"ensureApiKey");function ve(e){if(e.repoUrl)return e.repoUrl;if(e.gitHost&&e.gitOwner&&e.gitRepo)return`https://${e.gitHost}/${e.gitOwner}/${e.gitRepo}.git`;throw new Error("repoUrl missing from API response")}o(ve,"resolveRepoUrl");function Ae(e,t){let n=new URL(e),r=encodeURIComponent(t);return`${n.protocol}//x-access-token:${r}@${n.host}${n.pathname}`}o(Ae,"formatTokenizedRepoUrl");function Ie(e){let t=new URL(e);return`${t.protocol}//x-access-token:$OPENPOND_API_KEY@${t.host}${t.pathname}`}o(Ie,"formatTokenizedRepoUrlForPrint");function _e(e){return e.replace(/x-access-token:[^@]+@/g,"x-access-token:***@")}o(_e,"redactToken");function Te(e){let t=process.env.OPENPOND_BASE_URL;if(t)try{let n=new URL(t).hostname,r=new URL(e).hostname;n&&r&&n!==r&&(console.warn(`warning: repo host (${r}) does not match OPENPOND_BASE_URL (${n})`),console.warn("warning: verify your git host configuration matches OPENPOND_BASE_URL."))}catch{}}o(Te,"warnOnRepoHostMismatch");function Y(e){let t=e.split("/").filter(Boolean);if(t.length!==2)throw new Error("expected <handle>/<repo>");return{handle:t[0],repo:t[1]}}o(Y,"parseHandleRepo");function P(e){return(e||"").trim().toLowerCase()}o(P,"normalizeRepoName");async function ue(e){if(!e.forceRefresh){let n=await U({apiBase:e.apiBase,apiKey:e.apiKey,ttlMs:x});if(n)return n}let t=await _(e.apiBase,e.apiKey);return await C({apiBase:e.apiBase,apiKey:e.apiKey,apps:t}),t}o(ue,"fetchAppsWithCache");async function ke(e){if(!e.forceRefresh){let r=await M({apiBase:e.apiBase,apiKey:e.apiKey,ttlMs:x});if(r)return r}let t=await T(e.apiBase,e.apiKey),n=Array.isArray(t.tools)?t.tools:[];return await N({apiBase:e.apiBase,apiKey:e.apiKey,tools:n}),n}o(ke,"fetchToolsWithCache");async function De(e,t,n){let{handle:r,repo:s}=Y(n),i=await ue({apiBase:e,apiKey:t}),a=P(s),d=i.find(u=>u.handle&&u.handle!==r?!1:[u.repo,u.gitRepo,u.id].map(P).includes(a));if(!d)throw new Error(`app not found for ${r}/${s}`);return{app:d,handle:r,repo:s}}o(De,"resolveAppTarget");async function Ke(e){let t=e.intervalMs??5e3,n=e.timeoutMs??240*1e3,r=new Set,s=Date.now();for(;Date.now()-s<n;){let a=(await A(e.baseUrl,e.apiKey,e.deploymentId)).filter(u=>!r.has(u.id));for(let u of a)r.add(u.id);for(let u of a)console.log(`${e.prefix}${u.message}`);let d=await I(e.baseUrl,e.apiKey,e.deploymentId);if(d.status==="failed"){console.log(`${e.prefix}deployment failed`);return}if(d.status==="running"||d.status==="deployed"){console.log(`${e.prefix}deployment complete`);return}await new Promise(u=>setTimeout(u,t))}console.log(`${e.prefix}deployment still in progress`)}o(Ke,"pollDeploymentLogs");import{stdin as z,stdout as V}from"node:process";import{createInterface as G}from"node:readline/promises";async function X(){let e=[];for await(let t of process.stdin)e.push(Buffer.isBuffer(t)?t:Buffer.from(String(t)));return Buffer.concat(e).toString("utf8").replace(/\r?\n$/,"")}o(X,"readAllStdin");function j(e){return new Promise((t,n)=>{let r=process.stdin,s=process.stderr,i="",a=r.isRaw;function d(){r.off("data",u),r.setRawMode&&r.setRawMode(a),r.pause(),s.write(`
3
- `)}o(d,"cleanup");function u(p){let f=Buffer.isBuffer(p)?p:Buffer.from(p);for(let c of f){if(c===3){d(),n(new Error("secret prompt cancelled"));return}if(c===13||c===10){d(),t(i);return}if(c===127||c===8){i.length>0&&(i=i.slice(0,-1),s.write("\b \b"));continue}i+=Buffer.from([c]).toString("utf8"),s.write("*")}}o(u,"onData"),s.write(e),r.resume(),r.setRawMode&&r.setRawMode(!0),r.on("data",u)})}o(j,"readMaskedLine");async function Ye(e,t=!1){let n=G({input:z,output:V});try{let r=t?"[Y/n]":"[y/N]",s=(await n.question(`${e} ${r} `)).trim().toLowerCase();return s?s==="y"||s==="yes":t}finally{n.close()}}o(Ye,"promptConfirm");async function ze(e){let t=G({input:z,output:V});try{return(await t.question(`Local path (default: ${e}): `)).trim()||e}finally{t.close()}}o(ze,"promptForPath");var J=["readonly","attempt","feature","rollout","replay","template_build","scheduled_run","patch_only","hotfix","multi_feature_batch"],Z=["none","manual","auto_after_checks"],Q=[...k];function de(e,t){return(process.env.OPENPOND_SANDBOX_BASE_URL||process.env.OPENPOND_API_URL||e.apiBaseUrl||W(process.env.OPENPOND_BASE_URL||e.baseUrl)||v).replace(/\/$/,"")}o(de,"resolveSandboxBaseUrl");async function rt(e){let t=await ce(e),n=K(t),r=await H(t,n),s=D(e)||process.env.OPENPOND_SANDBOX_API_URL?.trim()||null,i=de(t,e);return $(s?{apiKey:r,sandboxApiUrl:s}:{apiKey:r,baseUrl:i})}o(rt,"resolveSandboxClient");async function ce(e){return B()}o(ce,"loadSandboxConfig");function ot(e){if(e===void 0)return;if(typeof e!="string"||!e.trim())throw new Error("workflow-mode must be a non-empty value");let t=e.trim();if(!J.includes(t))throw new Error(`workflow-mode must be one of ${J.join(", ")}`);return t}o(ot,"parseSandboxWorkflowModeOption");function it(e){if(e===void 0)return;if(typeof e!="string"||!e.trim())throw new Error("runtime-promotion-policy must be a non-empty value");let t=e.trim();if(!Z.includes(t))throw new Error(`runtime-promotion-policy must be one of ${Z.join(", ")}`);return t}o(it,"parseSandboxRuntimePromotionPolicyOption");function st(e){if(typeof e!="string"||!e.trim())return;let t=e.trim();if(!Q.includes(t))throw new Error(`runtime-profile-id must be one of ${Q.join(", ")}`);return t}o(st,"parseSandboxRuntimeProfileIdOption");function le(e){let t=ee(e.envRef,"env-ref").map(({name:i,value:a})=>({name:i,secretRef:a})),n=ee(e.envLiteral,"env-literal").map(({name:i,value:a})=>{if(fe(i)&&!y(e.allowPlainSecretEnv))throw new Error(`refusing plaintext value for secret-like env ${i}; create a sandbox secret and pass --env-ref ${i}=openpond://secret/...`);return{name:i,value:a}}),r=[...t,...n],s=new Set;for(let i of r){if(s.has(i.name))throw new Error(`duplicate sandbox env var: ${i.name}`);s.add(i.name)}return r}o(le,"parseSandboxEnvOptions");function at(e,t){let n=le(t),r=new Set(n.map(a=>a.name)),s=new Map(n.map(a=>[a.name,a]));for(let a of e.inputs.env)if(s.get(a.name)?.value!==void 0&&a.secret!==!1)throw new Error(`sandbox template env ${a.name} requires a secret ref. Pass --env-ref ${a.name}=openpond://secret/...`);let i=e.inputs.env.filter(a=>a.required&&!r.has(a.name)).map(a=>a.name);if(i.length>0)throw new Error(`missing required sandbox template env refs: ${i.join(", ")}. Pass --env-ref NAME=openpond://secret/...`);return n}o(at,"parseSandboxTemplateEnvOptions");function ee(e,t){return typeof e!="string"?[]:e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>{let r=n.indexOf("=");if(r<=0)throw new Error(`${t} entries must use NAME=value`);let s=n.slice(0,r).trim(),i=n.slice(r+1).trim();if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(s))throw new Error(`${t} has invalid env name: ${s}`);if(!i)throw new Error(`${t} value is required for ${s}`);return{name:s,value:i}})}o(ee,"parseSandboxEnvAssignments");function fe(e){return/(?:SECRET|TOKEN|KEY|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|DATABASE_URL|DSN)/i.test(e)}o(fe,"isSecretLikeEnvName");async function ut(e,t){if(typeof e.value=="string"||typeof e.secretValue=="string")throw new Error("sandbox secret values must be provided with --stdin or the masked prompt");if(y(e.stdin)){let s=await X();if(!s)throw new Error(`${t} read no secret value from stdin`);return s}if(!process.stdin.isTTY)throw new Error(`${t} requires --stdin when not running in a TTY`);let r=await j(`${t}: `);if(!r)throw new Error(`${t} cannot be empty`);return r}o(ut,"readSandboxSecretValue");function dt(e){return{id:e.id,teamId:e.teamId,name:e.name,scope:e.scope,status:e.status,secretRef:e.secretRef,currentVersion:e.currentVersion,updatedAt:e.updatedAt,lastUsedAt:e.lastUsedAt,attachedDestinations:e.attachments?.length??0}}o(dt,"summarizeSandboxSecret");import{Buffer as S}from"node:buffer";import{spawn as re}from"node:child_process";var pe=600*1e3,me=2*1024*1024;function b(e,t=[],n={}){return n.inherit&&n.terminateWhenStdoutIncludes!==void 0?Promise.reject(new Error("terminateWhenStdoutIncludes requires captured stdout")):n.terminateWhenStdoutIncludes===""?Promise.reject(new Error("terminateWhenStdoutIncludes must not be empty")):new Promise((r,s)=>{let i=re(e,t,{cwd:n.cwd,env:n.env?{...process.env,...n.env}:void 0,shell:n.shell,detached:n.detached??process.platform!=="win32",stdio:n.inherit?"inherit":[n.stdin===void 0?"ignore":"pipe","pipe","pipe"]}),a=new h(te(n)),d=new h(te(n)),u=!1,p=n.timeoutMs??pe,f,c,w=null,g=!1,R=o(()=>{f&&clearTimeout(f),c&&clearTimeout(c)},"clearTimers"),E=o(l=>{w!==null||g||(w=l,u=l==="timeout",f&&(clearTimeout(f),f=void 0),ne(i.pid,"SIGTERM"),c=setTimeout(()=>{i.exitCode===null&&i.signalCode===null&&ne(i.pid,"SIGKILL")},5e3))},"requestTermination");p>0&&(f=setTimeout(()=>{E("timeout")},p)),n.inherit||(i.stdout?.on("data",l=>{a.append(l);let m=n.terminateWhenStdoutIncludes;m!==void 0&&a.text().includes(m)&&E("output")}),i.stderr?.on("data",l=>{d.append(l)})),i.on("error",l=>{R(),g=!0,s(l)}),i.on("close",(l,m)=>{g||(g=!0,R(),r({code:l,signal:m,terminationReason:w??(m?"signal":"exit"),stdout:a.text(),stderr:d.text(),timedOut:u,stdoutTruncated:a.truncated,stderrTruncated:d.truncated}))}),n.stdin!==void 0&&i.stdin?.end(n.stdin)})}o(b,"runProcessCommand");var h=class{static{o(this,"BoundedOutput")}#t=[];#n;#e=0;truncated=!1;constructor(t){this.#n=t}append(t){let n=S.isBuffer(t)?t:S.from(t),r=this.#n-this.#e;if(r<=0){n.byteLength>0&&(this.truncated=!0);return}if(n.byteLength<=r){this.#t.push(n),this.#e+=n.byteLength;return}this.#t.push(n.subarray(0,r)),this.#e+=r,this.truncated=!0}text(){let t=S.concat(this.#t,this.#e).toString("utf8");return this.truncated?`${t}
4
- [truncated after ${this.#n} bytes]
5
- `:t}};function te(e){let t=e.maxOutputBytes??me;return Math.max(0,Math.floor(t))}o(te,"maxOutputBytes");function ne(e,t){if(e){if(process.platform==="win32"){let n=["/PID",String(e),"/T"];t==="SIGKILL"&&n.push("/F"),re("taskkill",n,{stdio:"ignore",windowsHide:!0}).unref();return}try{process.kill(-e,t)}catch(n){if(n.code!=="ESRCH")throw n}}}o(ne,"terminateProcessTree");async function ge(e,t,n={}){return b(e,t,{cwd:n.cwd,inherit:n.inherit,timeoutMs:n.timeoutMs,maxOutputBytes:n.maxOutputBytes,terminateWhenStdoutIncludes:n.terminateWhenStdoutIncludes})}o(ge,"runCommand");async function xt(e,t={}){let n=t.timeoutSeconds===void 0?void 0:t.timeoutSeconds*1e3;return b(e,[],{cwd:t.cwd,env:t.env,shell:!0,inherit:t.inherit,timeoutMs:n,maxOutputBytes:t.maxOutputBytes})}o(xt,"runShellCommand");async function Pt(e,t){let n=await ge("git",["remote","get-url",t],{cwd:e});if(n.code!==0)return null;let r=n.stdout.trim();return r.length>0?r:null}o(Pt,"getGitRemoteUrl");export{se as a,ae as b,H as c,ve as d,Ae as e,Ie as f,_e as g,Te as h,P as i,ue as j,ke as k,De as l,Ke as m,Ye as n,ze as o,rt as p,ot as q,it as r,st as s,le as t,at as u,ut as v,dt as w,b as x,ge as y,xt as z,Pt as A};
@@ -1,3 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as t}from"./chunk-ES2ISFJC.js";import{a as c}from"./chunk-FTQLQJQV.js";var O=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),v=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function E(n){let a=typeof n=="string"?new TextEncoder().encode(n):n,r=Math.ceil((a.byteLength+9)/64)*64,d=new Uint8Array(r);d.set(a),d[a.byteLength]=128;let b=a.byteLength*8,A=new DataView(d.buffer);A.setUint32(r-8,Math.floor(b/4294967296),!1),A.setUint32(r-4,b>>>0,!1);let e=new Uint32Array(O),f=new Uint32Array(64);for(let u=0;u<r;u+=64){for(let o=0;o<16;o+=1)f[o]=A.getUint32(u+o*4,!1);for(let o=16;o<64;o+=1){let g=f[o-15],S=f[o-2],T=i(g,7)^i(g,18)^g>>>3,w=i(S,17)^i(S,19)^S>>>10;f[o]=f[o-16]+T+f[o-7]+w>>>0}let s=e[0],p=e[1],h=e[2],_=e[3],x=e[4],y=e[5],R=e[6],H=e[7];for(let o=0;o<64;o+=1){let g=x&y^~x&R,S=s&p^s&h^p&h,T=i(s,2)^i(s,13)^i(s,22),w=i(x,6)^i(x,11)^i(x,25),j=H+w+g+v[o]+f[o]>>>0,L=T+S>>>0;H=R,R=y,y=x,x=_+j>>>0,_=h,h=p,p=s,s=j+L>>>0}e[0]=e[0]+s>>>0,e[1]=e[1]+p>>>0,e[2]=e[2]+h>>>0,e[3]=e[3]+_>>>0,e[4]=e[4]+x>>>0,e[5]=e[5]+y>>>0,e[6]=e[6]+R>>>0,e[7]=e[7]+H>>>0}return Array.from(e,u=>u.toString(16).padStart(8,"0")).join("")}c(E,"sha256Hex");function i(n,a){return n>>>a|n<<32-a}c(i,"rotateRight");var z=2e3,U=25e7,l=t.string().trim().min(1).max(240),m=t.string().regex(/^[a-f0-9]{64}$/),Y=t.string().datetime({offset:!0}),q=t.record(t.string(),t.unknown()).default({}),M=t.object({id:l,contentHash:m}).strict(),F=M.extend({revision:t.number().int().positive()}).strict(),W=t.object({id:l,path:t.string().trim().min(1).max(z).refine(N),contentHash:m,sizeBytes:t.number().int().nonnegative().max(U),mediaType:t.string().trim().min(1).max(200),visibility:t.enum(["policy","verifier","host_private"])}).strict(),G=t.object({id:l,contentHash:m,mediaType:t.string().trim().min(1).max(200).nullable().default(null),sizeBytes:t.number().int().nonnegative().max(U).nullable().default(null)}).strict(),K=t.enum(["policy_failure","grader_failure","environment_failure","infrastructure_failure","timeout","cancelled"]);function B(n){return`${JSON.stringify(I(n),null,2)}
3
- `}c(B,"canonicalJson");function C(n){return E(n)}c(C,"sha256");function P(n){return C(B(n))}c(P,"contentHash");function Q(n,a){let{contentHash:r,...d}=n,b=P(d);if(r!==b)throw new Error(`${a} contentHash is ${r}; expected ${b}.`)}c(Q,"assertContentHash");function N(n){let a=n.replaceAll("\\","/");return!a||a.startsWith("/")||a.includes("\0")?!1:!a.split("/").some(r=>!r||r==="."||r==="..")}c(N,"safeRelativePath");function I(n){return Array.isArray(n)?n.map(I):!n||typeof n!="object"?n:Object.fromEntries(Object.entries(n).sort(([a],[r])=>a.localeCompare(r)).map(([a,r])=>[a,I(r)]))}c(I,"sortValue");var ae=t.object({provider:l,model:l,revision:t.string().trim().min(1).max(500).nullable().default(null),artifactHash:m.nullable().default(null),tokenizerRevision:t.string().trim().min(1).max(500).nullable().default(null),chatTemplateHash:m.nullable().default(null)}).strict(),$=["openpond","codex","anthropic","openai","xai","google","openrouter","deepseek","zai","moonshot","together","groq","custom-openai-compatible"],D=t.enum($),oe=t.object({providerId:D,modelId:t.string().trim().min(1).max(300)});export{l as a,m as b,Y as c,q as d,M as e,F as f,W as g,G as h,K as i,B as j,C as k,P as l,Q as m,ae as n,$ as o,D as p,oe as q};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{$a as ie,$b as Ee,Ab as ve,Bb as we,Cb as P,Da as H,Db as Se,Eb as Re,Fb as _,Gb as I,Ib as _e,Jb as ke,Kb as Ie,Lb as F,Rb as ye,Ta as X,Tb as B,Ub as Ae,Va as Y,Wb as Le,Ya as Z,Za as V,Zb as Ce,_a as ee,_b as je,a as m,ab as te,ac as N,cb as ne,cc as Te,db as re,dc as De,eb as ae,gb as oe,ib as se,kb as ce,mb as y,nb as u,ob as de,pb as me,qb as le,rb as ue,sb as pe,ub as ge,vb as he,wb as fe,yb as be,zb as xe}from"./chunk-WYHHDJEG.js";import{a,b as E,c as l,e as C,l as k}from"./chunk-HZP5U2AA.js";import{b as e}from"./chunk-ES2ISFJC.js";import{a as c}from"./chunk-FTQLQJQV.js";var M=e.discriminatedUnion("kind",[e.object({kind:e.literal("manual"),identity:a}).strict(),e.object({kind:e.literal("schedule"),scheduledAt:l}).strict(),e.object({kind:e.literal("approved_count"),checkedAt:l}).strict()]),$=e.object({schemaVersion:e.literal("openpond.learningChain.v1"),id:a,revision:e.number().int().positive(),modelProjectId:a,activeIterationId:a.nullable(),acceptedParent:P.nullable().optional(),latestIterationId:a,lastReservedAt:l.nullable(),updatedAt:l}).strict(),G=e.object({eligible:e.number().int().nonnegative(),awaitingReview:e.number().int().nonnegative(),excluded:e.number().int().nonnegative(),consumed:e.number().int().nonnegative()}).strict(),qe=e.object({schemaVersion:e.literal("openpond.learningConsumption.v1"),id:a,revision:e.literal(1),chainId:a,iterationId:a,evidence:u,decision:u,reservedAt:l}).strict(),Pe=e.object({schemaVersion:e.literal("openpond.learningIterationReservation.v1"),id:a,revision:e.number().int().positive(),chainId:a,iterationId:a,policy:u,trigger:M,requestHash:E,outcome:e.enum(["reserved","waiting_for_data","waiting_for_review"]),counts:G,budget:e.object({maximumSpendUsd:e.number().nonnegative(),reservedSpendUsd:e.number().nonnegative(),settledSpendUsd:e.number().nonnegative(),settledAt:l.nullable()}).strict(),createdAt:l,updatedAt:l}).strict();var v=e.object({operationId:a}),Xe=v.extend({action:e.literal("import_intake"),format:Te,files:e.array(De).min(1).max(100),expectedPreviewHash:e.string().length(64),name:e.string().trim().min(1).max(500),recordIds:e.array(e.string().min(1).max(200)).min(1).max(90)}).strict(),O=v.extend({action:e.literal("publish"),expectedRevision:e.number().int().nonnegative(),finalizeDraft:N.optional()}),Oe=e.discriminatedUnion("kind",[O.extend({kind:e.literal("asset"),content:ke}).strict(),O.extend({kind:e.literal("definition"),content:de}).strict(),O.extend({kind:e.literal("reward"),content:Z}).strict(),O.extend({kind:e.literal("binding"),content:ee}).strict(),O.extend({kind:e.literal("source"),content:le}).strict(),O.extend({kind:e.literal("policy"),content:ve}).strict()]),Ye=v.extend({action:e.literal("publish_resources"),finalizeDraft:N.optional(),resources:e.array(e.union(Oe.options.map(t=>t.omit({operationId:!0,action:!0,finalizeDraft:!0})))).min(1).max(20)}).strict(),Ze=v.extend({action:e.literal("submit_example"),example:pe}).strict(),ei=v.extend({action:e.literal("submit_feedback"),feedback:he}).strict(),ii=v.extend({action:e.literal("apply_correction"),feedbackId:a,evidence:u}).strict(),ti=v.extend({action:e.literal("resolve_feedback"),feedbackId:a,expectedRevision:e.number().int().positive(),disposition:e.enum(["applied","rejected","superseded"]),decision:u.nullable(),note:e.string().max(2e4)}).strict(),ni=v.extend({action:e.literal("queue_grade"),evidence:u,target:e.enum(["observed","proposed_target"]),proposedTarget:y.nullable(),timeoutMs:e.number().int().min(100).max(3e5).default(3e4),maximumSpendUsd:e.number().nonnegative().max(1e3).default(0)}).strict(),ri=v.extend({action:e.literal("review"),evidence:u,expectedRevision:e.number().int().nonnegative(),disposition:e.enum(["approved","rejected","pending"]),targetApproval:e.enum(["approved","rejected","pending","not_required"]),approvedTarget:y.nullable(),observedGradeId:a.nullable(),targetGradeId:a.nullable(),note:e.string().max(2e4)}).strict(),ai=v.extend({action:e.literal("seal_batch"),batchId:a,taskDefinition:u,purpose:e.enum(["supervised_training","reward_training","evaluation"]),evidence:e.array(u).min(1).max(1e4),decisions:e.array(u).min(1).max(1e4)}).strict(),oi=v.extend({action:e.literal("cancel_grade"),gradeId:a,expectedRevision:e.number().int().positive()}).strict(),si=v.extend({action:e.literal("save_draft"),expectedRevision:e.number().int().nonnegative(),draft:je}).strict(),ci=v.extend({action:e.literal("archive_draft"),draft:u}).strict(),di=v.extend({action:e.literal("queue_reward_check"),draft:u,timeoutMs:e.number().int().min(100).max(3e5).default(3e4),maximumSpendUsd:e.number().nonnegative().max(1e3).default(0)}).strict(),mi=v.extend({action:e.literal("cancel_reward_check"),checkId:a,expectedRevision:e.number().int().positive()}).strict(),li=v.extend({action:e.literal("publish_checked_reward"),draft:u,checkId:a,checkRevision:e.number().int().positive()}).strict(),ui=v.extend({action:e.literal("reserve_iteration"),policy:u,trigger:M}).strict(),pi=v.extend({action:e.literal("cancel_iteration_reservation"),iterationId:a,expectedRevision:e.number().int().positive()}).strict(),gi=v.extend({action:e.literal("cancel_iteration"),iterationId:a,expectedRevision:e.number().int().positive()}).strict(),hi=v.extend({action:e.literal("retry_iteration_dispatch"),iterationId:a,expectedRevision:e.number().int().positive()}).strict(),He=e.union([li,Xe,gi,hi,pi,ui,di,mi,si,ci,Oe,Ye,Ze,ei,ii,ti,ni,ri,ai,oi]);var fi=e.object({provider:a,protocol:a,payload:y}).strict(),Fe=e.object({schemaVersion:e.literal("openpond.learningIterationDispatch.v1"),id:a,revision:e.number().int().positive(),iterationId:a,chainId:a,policy:u,batch:u,state:e.enum(["preparing","prepared","submitted","settled","blocked"]),submission:fi.nullable(),submissionHash:e.string().regex(/^[a-f0-9]{64}$/).nullable(),submissionStartedAt:l.nullable(),execution:C.nullable(),terminalReceipt:C.nullable(),cancelRequestedAt:l.nullable(),leaseOwner:a.nullable(),leaseGeneration:e.number().int().nonnegative(),leaseExpiresAt:l.nullable(),consecutiveFailures:e.number().int().nonnegative(),nextAttemptAt:l.nullable(),lastError:e.string().max(2e4).nullable(),createdAt:l,updatedAt:l}).strict().superRefine((t,i)=>{(!!t.submission!=!!t.submissionHash||t.submission&&k(t.submission)!==t.submissionHash)&&i.addIssue({code:"custom",path:["submissionHash"],message:"Dispatch submission identity changed."}),t.submissionStartedAt&&!t.submission&&i.addIssue({code:"custom",path:["submission"],message:"A started dispatch requires its persisted submission."}),t.execution&&!t.submissionStartedAt&&i.addIssue({code:"custom",path:["execution"],message:"An execution requires a started dispatch."}),["prepared","submitted"].includes(t.state)&&!t.submission&&i.addIssue({code:"custom",path:["state"],message:"A prepared dispatch requires its immutable submission."}),t.state==="submitted"&&!t.execution&&i.addIssue({code:"custom",path:["execution"],message:"A submitted dispatch requires an observed execution."}),t.state==="settled"&&t.submissionStartedAt&&!t.terminalReceipt&&i.addIssue({code:"custom",path:["terminalReceipt"],message:"A started dispatch requires terminal receipt evidence before settlement."}),!!t.leaseOwner!=!!t.leaseExpiresAt&&i.addIssue({code:"custom",path:["leaseOwner"],message:"Dispatch lease owner and expiration must be recorded together."})}),Bi=e.object({scope:a,dispatchId:a,submissionHash:e.string().regex(/^[a-f0-9]{64}$/),execution:C.nullable(),status:e.enum(["running","evaluating","succeeded","failed","cancelled"]),spendUsd:e.number().nonnegative(),cleanupComplete:e.boolean(),receipt:C.nullable(),evaluation:C.nullable(),candidate:C.nullable(),failure:e.string().max(2e4).nullable()}).strict().superRefine((t,i)=>{["succeeded","failed","cancelled"].includes(t.status)&&(!t.cleanupComplete||!t.receipt)&&i.addIssue({code:"custom",path:["receipt"],message:"Terminal execution requires an authoritative cleanup receipt."}),t.status!=="cancelled"&&!t.execution&&i.addIssue({code:"custom",path:["execution"],message:"The execution identity is required."}),t.candidate&&(t.status!=="succeeded"||!t.evaluation)&&i.addIssue({code:"custom",path:["candidate"],message:"A candidate requires successful retained evaluation."})});var Be=e.object({schemaVersion:e.literal("openpond.learningSchedule.v1"),id:a,revision:e.number().int().positive(),policy:u,modelProjectId:a,executionOwner:e.enum(["local","hosted"]),state:e.enum(["scheduled","disabled","blocked"]),intervalSeconds:e.number().int().min(60).max(31536e3).nullable(),calendar:ce.nullable().default(null),nextRunAt:l.nullable(),lastFire:u.nullable(),consecutiveFailures:e.number().int().nonnegative(),nextAttemptAt:l.nullable(),lastError:e.string().max(2e4).nullable(),createdAt:l,updatedAt:l}).strict().superRefine((t,i)=>{t.state!=="disabled"&&(!t.intervalSeconds&&!t.calendar||!t.nextRunAt)&&i.addIssue({code:"custom",path:["nextRunAt"],message:"An active timer must retain its cadence and due time."}),t.state==="disabled"&&t.nextRunAt&&i.addIssue({code:"custom",path:["nextRunAt"],message:"A disabled timer cannot have a pending occurrence."}),t.intervalSeconds&&t.calendar&&i.addIssue({code:"custom",path:["calendar"],message:"A timer uses either an interval or a nightly calendar."})}),Ue=e.object({schemaVersion:e.literal("openpond.learningScheduleFire.v1"),id:a,revision:e.literal(1),scheduleId:a,policy:u,scheduledAt:l,coalescedThroughAt:l,coalescedCount:e.number().int().nonnegative(),outcome:e.enum(["reserved","waiting_for_data","waiting_for_review","skipped"]),reason:e.enum(["active_iteration","cooldown","daily_budget"]).nullable(),iteration:e.object({id:a,revision:e.number().int().positive()}).strict().nullable(),createdAt:l,contentHash:E}).strict().superRefine((t,i)=>{(t.outcome==="skipped"!=!!t.reason||t.outcome!=="skipped"!=!!t.iteration)&&i.addIssue({code:"custom",path:["outcome"],message:"A fire retains either its reservation or its explicit skip reason."})});function $e(t){H(t,262144);let i=Ce.parse(t.fields),n=t.base?V.parse(t.base):null;if(n&&n.id!==t.id)throw new m("reward_authoring_base_mismatch",422);let o=i.fixtures?.length?F({text:JSON.stringify(i.fixtures),path:"reward-fixtures.json",mediaType:"application/json",visibility:"verifier"}):null,r=null,s,d;if(i.kind==="custom_verifier")r=F({text:i.code,path:"verifier.mjs",mediaType:"application/javascript",visibility:"verifier"}),s={kind:i.kind,verifierRef:r.asset,exportName:i.exportName,timeoutMs:T(i.timeout,"Time limit"),networkPolicy:"none",...n?.implementation.kind==="custom_verifier"&&n.implementation.runtime!==void 0?{runtime:n.implementation.runtime}:{}};else if(i.kind==="model_judge"||i.kind==="human"){if(!i.rubric.trim())throw new m("reward_rubric_required",422,"Write the rubric before checking or publishing this Reward.");if(r=F({text:i.rubric,path:"rubric.md",mediaType:"text/markdown",visibility:"verifier"}),i.kind==="human")s={kind:i.kind,rubricRef:r.asset,reviewerRole:i.reviewerRole};else{let h={providerId:i.providerId,modelId:i.modelId,revision:i.modelRevision.trim()||null},x=T(i.temperature,"Temperature"),w=n?.implementation,b=w?.kind==="model_judge"&&w.rubricRef.contentHash===r.asset.contentHash&&w.model?.providerId===h.providerId&&w.model?.modelId===h.modelId&&w.model?.revision===h.revision&&(w.temperature??0)===x&&n?.fixtureSetRef?.contentHash===o?.asset.contentHash;s={kind:i.kind,rubricRef:r.asset,model:h,temperature:x,calibrationStatus:b?w.calibrationStatus:"pending"},b&&(d=n?.calibrationCheckRef)}}else i.kind==="learned_model"?(D(i.inputContract,"Model input contract"),r=F({text:i.inputContract,path:"input-contract.json",mediaType:"application/json",visibility:"verifier"}),s={kind:i.kind,modelVersion:{id:i.learnedId,contentHash:i.learnedHash},inputContract:r.asset}):i.kind==="state"?s={kind:i.kind,config:{fields:Ve(i.fields)}}:i.kind==="content"?s={kind:i.kind,config:{outputField:i.outputField,expectedField:i.expectedField,...i.expectedValue?{expectedValue:i.expectedValue}:{}}}:i.kind==="schema"?s={kind:i.kind,config:{jsonSchema:D(i.schema,"Output schema")}}:i.kind==="artifact"?s={kind:i.kind,config:{refIncludes:i.reference}}:s={kind:i.kind,config:{requiredEvents:Ve(i.events)}};let g=[...r?[r]:[],...o?[o]:[]];return{reward:ne({schemaVersion:"openpond.rewardRelease.v1",id:t.id,revision:(n?.revision??0)+1,name:i.name,description:i.description,implementation:s,rawScore:i.kind==="learned_model"?{minimum:T(i.minimum,"Minimum score"),maximum:T(i.maximum,"Maximum score")}:{minimum:0,maximum:1},assets:g.map(h=>h.asset),...o?{fixtureSetRef:o.asset}:{},...d?{calibrationCheckRef:d}:{}}),assets:g}}c($e,"compileRewardAuthoring");function D(t,i){try{let n=JSON.parse(t);return H(n,131072),y.parse(n)}catch{throw new m("reward_authoring_json_invalid",422,`${i} must be a JSON object.`)}}c(D,"parseRewardAuthoringObject");function T(t,i){let n=Number(t);if(!t.trim()||!Number.isFinite(n))throw new m("reward_authoring_number_invalid",422,`${i} must be a finite number.`);return n}c(T,"authoringNumber");function Ve(t){return t.split(",").map(i=>i.trim()).filter(Boolean)}c(Ve,"split");var Je=e.object({id:a,name:e.string().trim().min(1).max(500),input:y,output:y,expectedOutput:y.nullable(),evaluatorContext:y.nullable(),artifactRefs:e.array(a).max(100),runtimeEventRefs:e.array(a).max(100),infrastructureError:e.string().max(2e4).nullable(),expected:e.discriminatedUnion("status",[e.object({status:e.literal("scored"),minimum:e.number().finite(),maximum:e.number().finite(),passed:e.boolean().nullable()}).strict(),e.object({status:e.enum(["pending","unavailable","failed"])}).strict()])}).strict().superRefine((t,i)=>{t.expected.status==="scored"&&t.expected.minimum>t.expected.maximum&&i.addIssue({code:"custom",path:["expected"],message:"Expected score minimum must not exceed maximum."})}),bi=e.object({id:a,packageVersion:e.string().min(1).max(100),engine:e.string().min(1).max(200)}).strict(),ze=e.object({fixture:e.object({id:a,contentHash:E}).strict(),result:te,matchesExpectation:e.boolean()}).strict(),Ne=e.object({schemaVersion:e.literal("openpond.rewardCheckRun.v1"),id:a,revision:e.number().int().positive(),draft:u,reward:u,snapshotHash:E,fixtureRefs:e.array(e.object({id:a,contentHash:E}).strict()).min(1).max(50),status:e.enum(["queued","running","completed","failed","cancelling","cancelled"]),runtime:bi.nullable(),results:e.array(ze).max(50),matchesExpectations:e.boolean().nullable(),failure:e.string().max(2e4).nullable(),timeoutMs:e.number().int().min(100).max(3e5),maximumSpendUsd:e.number().nonnegative().max(1e3),judgeCalls:e.array(se).max(1e3).optional(),requestedBy:a.optional(),leaseOwner:a.nullable(),leaseExpiresAt:l.nullable(),attemptCount:e.number().int().nonnegative(),createdAt:l,updatedAt:l}).strict();function xi(t){if(!t.length||t.length>50)throw new m("reward_check_fixtures_required",422,"Add between one and 50 fixtures before checking this Reward.");if(new Set(t.map(i=>i.id)).size!==t.length)throw new m("reward_fixture_id_duplicate",422);return t.map(i=>Je.parse({id:i.id,name:i.name,input:D(i.input,`${i.name}: input`),output:D(i.output,`${i.name}: output`),expectedOutput:i.expectedOutput.trim()?D(i.expectedOutput,`${i.name}: expected answer`):null,evaluatorContext:i.evaluatorContext.trim()?D(i.evaluatorContext,`${i.name}: evaluator context`):null,artifactRefs:i.artifactRefs.map(n=>n.trim()).filter(Boolean),runtimeEventRefs:i.runtimeEventRefs.map(n=>n.trim()).filter(Boolean),infrastructureError:i.infrastructureError||null,expected:i.expectedStatus==="scored"?{status:i.expectedStatus,minimum:T(i.minimumScore,`${i.name}: minimum score`),maximum:T(i.maximumScore,`${i.name}: maximum score`),passed:i.expectedPassed==="any"?null:i.expectedPassed==="true"}:{status:i.expectedStatus}}))}c(xi,"compileRewardFixtures");function mt(t,i){let n=$e({id:t.targetId,fields:t.fields,base:i}),o=xi(t.fields.fixtures??[]),r=o.map(s=>({id:s.id,contentHash:k(s)}));return{...n,fixtures:o,fixtureRefs:r,snapshotHash:k({reward:n.reward,fixtures:o})}}c(mt,"compileRewardCheck");async function lt(t){let i=Je.parse(t.fixture),n=X.parse({id:i.id,clusterKey:i.id,split:"validation",input:i.input,expectedOutput:i.expectedOutput,privilegedContextRef:null}),o=re({schemaVersion:"openpond.rewardBinding.v1",id:`fixture-binding-${k(_(t.reward))}`,revision:1,sources:[{graderId:t.reward.id,reward:_(t.reward),role:"evaluation",normalization:t.reward.rawScore.minimum===0&&t.reward.rawScore.maximum===1?{kind:"identity"}:{kind:"linear",minimum:t.reward.rawScore.minimum,maximum:t.reward.rawScore.maximum,direction:"higher"},weight:1,required:!0,hardGate:!1,privileged:!0,fixtureRefs:[]}],aggregation:"weighted_mean",unscorable:"exclude_optional_require_all_required"},[t.reward]);return(await oe({binding:o,rewards:[t.reward],task:n,evidence:{output:i.output,artifactRefs:i.artifactRefs,runtimeEventRefs:i.runtimeEventRefs,infrastructureError:i.infrastructureError},signal:t.signal,customVerifier:t.customVerifier,modelJudge:t.modelJudge,purpose:"fixture_calibration"})).results[0]}c(lt,"executeRewardFixture");function ut(t,i){let n=t.expected,o=i.status===n.status&&(n.status!=="scored"||i.rawScore!==null&&i.rawScore>=n.minimum&&i.rawScore<=n.maximum&&(n.passed===null||n.passed===i.passed));return ze.parse({fixture:{id:t.id,contentHash:k(t)},result:i,matchesExpectation:o})}c(ut,"matchRewardFixture");var J={draft:Ee,reward_check:Ne,asset:Ie,definition:me,reward:V,binding:ie,source:ue,evidence:ge,feedback:fe,decision:be,batch:xe,policy:we,chain:$,consumption:qe,reservation:Pe,dispatch:Fe,schedule:Be,schedule_fire:Ue,iteration:Se,grade:Re,package:Y},Q=e.enum(Object.keys(J)),Me=class extends m{static{c(this,"LearningConflictError")}kind;id;expectedRevision;currentRevision;constructor(i,n,o,r){super("learning_revision_conflict",409,`Revision conflict for ${i} ${n}: expected ${o}, current ${r}.`),this.kind=i,this.id=n,this.expectedRevision=o,this.currentRevision=r,this.name="LearningConflictError"}};async function L(t,i,n,o){let r=await t.get(i,n,o);if(!r)throw new m("learning_resource_not_found",404,`${i}:${n}`);return J[i].parse(r)}c(L,"requireLearningResource");async function S(t,i,n){let o=await L(t,i,n.id,n.revision);if(!("contentHash"in o)||o.contentHash!==n.contentHash)throw new m("learning_release_hash_mismatch",409,`${i}:${n.id}`);return _e(o),o}c(S,"requireLearningRelease");function At(t,i,n){return`evidence-${k([t,i,n])}`}c(At,"learningEvidenceId");function Lt(t,i){return k([t,i])}c(Lt,"learningOperationId");async function Ot(t,i,n,o){let{batch:r,release:s,evidence:d,definition:g}=await K(t,i,n,o);for(let f of d)for(let h of B(f,g))await t.reserveFamilySplit(h.namespace,h.kind,h.key,h.split);return await t.put("batch",r,0,{parentId:g.id}),await t.put("package",s,0,{parentId:r.id}),[Ge("batch",r),Ge("package",s)]}c(Ot,"sealLearningBatch");async function K(t,i,n,o){let r=await S(t,"definition",i.taskDefinition),s=await S(t,"binding",r.rewardBinding),d=await Promise.all(s.sources.map(b=>S(t,"reward",b.reward)));ae(s,d);let g=await Promise.all(i.evidence.map(b=>vi(t,b))),f=await Promise.all(i.decisions.map(async b=>{let R=await S(t,"decision",b),p=await L(t,"decision",b.id);if(!I(_(p),b))throw new m("task_admission_revision_stale",409);return R})),h=[];for(let b of g)for(let R of B(b,r)){let p=await t.familySplit(R.namespace,R.kind,R.key);p!==null&&h.push({...R,split:p})}let x=Ae({id:i.batchId,definition:r,binding:s,rewards:d,purpose:i.purpose,evidence:g,decisions:f,priorSplits:h,actorId:n,now:o}),w=Le({batch:x,definition:r,binding:s,rewards:d,evidence:g,decisions:f});return{batch:x,release:w,evidence:g,definition:r}}c(K,"prepareLearningBatch");async function vi(t,i){let n=await S(t,"evidence",i),o=await L(t,"evidence",i.id);if(!I(_(o),i))throw new m("task_evidence_revision_stale",409);return n}c(vi,"requireCurrentLearningEvidence");function Ge(t,i){return{kind:t,id:i.id,revision:i.revision}}c(Ge,"pointer");async function Qe(t,i,n){let o=new Date(n).toISOString().slice(0,10),r=0,s=0,d;do{let g=await t.list("reservation",{parentId:i,limit:100,...d?{afterId:d}:{}});for(let{budget:f}of g.items)r+=f.reservedSpendUsd,f.settledAt&&new Date(f.settledAt).toISOString().slice(0,10)===o&&(s+=f.settledSpendUsd);d=g.nextCursor??void 0}while(d);return{reservedSpendUsd:r,settledSpendUsd:s,committedSpendUsd:r+s}}c(Qe,"readLearningIterationBudget");function W(t){return`chain-${k(t)}`}c(W,"learningChainId");function wi(t,i){return`consumption-${k([t,i.id,i.revision])}`}c(wi,"learningConsumptionId");async function z(t,i,n={}){let o=i.training.method==="sft"?"supervised_training":"reward_training";if(!["sft","grpo","ppo"].includes(i.training.method))throw new m("learning_batch_method_unsupported",422);if(i.admission.mode!=="human")throw new m("learning_automatic_admission_not_available",422);let r=await S(t,"definition",i.taskDefinition);if(!I(r.rewardBinding,i.rewardBinding))throw new m("learning_policy_binding_mismatch",422);let s={eligible:0,awaitingReview:0,excluded:0,consumed:0},d=[],g=[],f=W(i.modelProjectId),h=new Set,x=0;for(let w of i.sources){let b=await S(t,"source",w),R=await L(t,"source",b.id);if(!b.enabled||!R.enabled)throw new m("learning_source_disabled",409);if(!I(b.taskDefinition,i.taskDefinition))throw new m("learning_policy_source_definition_mismatch",422);let p;do{let j=await t.list("evidence",{parentId:b.id,limit:100,...p?{afterId:p}:{}});for(let A of j.items){if(h.has(A.id))continue;if(h.add(A.id),!i.sources.some(U=>I(A.source,U))||!I(A.submission.taskDefinition,i.taskDefinition)||A.submission.split!=="train"){s.excluded+=1;continue}if(await t.get("consumption",wi(f,A))){s.consumed+=1;continue}if(++x>i.limits.maxBacklogExamples)throw new m("learning_backlog_limit_exceeded",409);let q=await t.get("decision",`decision-${A.id}`);if(!q||!I(q.evidence,_(A))||q.taskAdmissibility==="pending"||q.actor.kind!=="human"){s.awaitingReview+=1;continue}try{ye({decision:q,evidence:A,definition:r,purpose:o})}catch(U){if(!(U instanceof m))throw U;s.excluded+=1;continue}s.eligible+=1,n.collectEligible&&g.push(_(A)),d.length<i.limits.maxBatchExamples&&d.push({evidence:A,decision:q})}p=j.nextCursor??void 0}while(p)}return{counts:s,selected:d,purpose:o,eligibleEvidence:g}}c(z,"inspectIterationEligibility");async function Ke(t,i,n=!1){let o=null,r;do{let s=await t.list("iteration",{parentId:i,status:"accepted",limit:100,...r?{afterId:r}:{}});for(let d of s.items){if(!d.candidateVersion||!d.candidateDecision||!d.candidateDecisionAt||!d.trainingJob){if(n)throw new m("learning_accepted_parent_evidence_missing",409);continue}let g=P.parse({iterationId:d.id,iterationRevision:d.revision,candidate:d.candidateVersion,decision:d.candidateDecision,decidedAt:d.candidateDecisionAt}),f=[Date.parse(g.decidedAt),g.decision.id,g.decision.revision],h=o?[Date.parse(o.decidedAt),o.decision.id,o.decision.revision]:null;(!h||f[0]>h[0]||f[0]===h[0]&&(f[1]>h[1]||f[1]===h[1]&&f[2]>h[2]))&&(o=g)}r=s.nextCursor??void 0}while(r);return o}c(Ke,"latestAcceptedLearningParent");async function We(t,i,n){if(!n)return{trainingParent:i.trainingParent,trainingParentSelection:null};let o=await L(t,"iteration",n.iterationId,n.iterationRevision),r=await S(t,"policy",o.policy);if(o.status!=="accepted"||!o.candidateVersion||!o.candidateDecision||!o.trainingJob||o.candidateVersion.id!==n.candidate.id||o.candidateVersion.contentHash!==n.candidate.contentHash||!I(o.candidateDecision,n.decision)||o.candidateDecisionAt!==n.decidedAt||r.modelProjectId!==i.modelProjectId||r.executionOwner!==i.executionOwner)throw new m("learning_accepted_parent_evidence_mismatch",409);if(r.trainingParent.id!==i.trainingParent.id||r.trainingParent.contentHash!==i.trainingParent.contentHash||r.training.method!==i.training.method)throw new m("learning_accepted_parent_configuration_mismatch",409,"The accepted checkpoint belongs to a different starting model or training method.");return{trainingParent:n.candidate,trainingParentSelection:n}}c(We,"resolveLearningTrainingParent");var Si=e.object({policy:u,modelProjectId:a,inspectedAt:l,chain:$.nullable(),trainingParent:e.object({reference:C,selection:P.nullable()}).strict().nullable().default(null),counts:G.nullable(),minimumApprovedExamples:e.number().int().positive(),canReserve:e.boolean(),blockers:e.array(e.object({code:e.string().min(1).max(200),message:e.string().min(1).max(2e4)}).strict()).max(20),cooldownUntil:l.nullable(),budget:e.object({reservedSpendUsd:e.number().nonnegative(),settledSpendUsd:e.number().nonnegative(),committedSpendUsd:e.number().nonnegative(),maximumIterationSpendUsd:e.number().nonnegative(),maximumDailySpendUsd:e.number().nonnegative()}).strict()}).strict();async function mn(t,i,n,o){let r=await S(t,"policy",i),s=await L(t,"policy",r.id);if(!I(_(s),i))throw new m("learning_policy_revision_stale",409);let d=W(r.modelProjectId),g=await t.get("chain",d),f=await Qe(t,d,o),h=[],x=c((p,j)=>{h.push({code:p,message:j})},"block");r.enabled||x("learning_policy_paused","Learning is paused."),(r.automation.accept||r.automation.serve)&&x("learning_automatic_acceptance_not_available","Candidates require explicit acceptance and serving selection."),g?.activeIterationId&&x("learning_iteration_active","An iteration is already active.");let w=g?.lastReservedAt&&Date.parse(o)-Date.parse(g.lastReservedAt)<r.limits.cooldownSeconds*1e3?new Date(Date.parse(g.lastReservedAt)+r.limits.cooldownSeconds*1e3).toISOString():null;w&&x("learning_iteration_cooldown","The training cooldown has not elapsed."),f.committedSpendUsd+r.limits.maxIterationSpendUsd>r.limits.maxDailySpendUsd&&x("learning_daily_budget_exhausted","The daily budget cannot cover another iteration's maximum spend.");let b=null;try{let p=await z(t,r);b=p.counts,b.eligible<r.admission.minimumApprovedExamples?b.awaitingReview>0?x("learning_waiting_for_review","More approved tasks are required before training."):x("learning_waiting_for_data","More eligible new tasks are required before training."):await K(t,{action:"seal_batch",operationId:"policy-inspection",batchId:"policy-inspection",taskDefinition:r.taskDefinition,purpose:p.purpose,evidence:p.selected.map(j=>_(j.evidence)),decisions:p.selected.map(j=>_(j.decision))},n,o)}catch(p){if(!(p instanceof m))throw p;x(p.code,p.message.slice(0,2e4))}let R=null;try{let p=await We(t,r,await Ke(t,d,!0));R={reference:p.trainingParent,selection:p.trainingParentSelection}}catch(p){if(!(p instanceof m))throw p;x(p.code,p.message.slice(0,2e4))}return Si.parse({policy:_(r),modelProjectId:r.modelProjectId,inspectedAt:o,chain:g,trainingParent:R,counts:b,minimumApprovedExamples:r.admission.minimumApprovedExamples,canReserve:h.length===0,blockers:h,cooldownUntil:w,budget:{...f,maximumIterationSpendUsd:r.limits.maxIterationSpendUsd,maximumDailySpendUsd:r.limits.maxDailySpendUsd}})}c(mn,"inspectLearningPolicy");var Ri=e.object({modelProjectId:a.nullable(),inspectedAt:l,pendingTrainingCount:e.number().int().nonnegative().nullable(),issues:e.array(e.object({policyId:a,code:e.string(),message:e.string()}).strict())}).strict();async function vn(t,i,n){let o=new Set,r=[],s;do{let d=await t.list("policy",{limit:100,...i?{parentId:i}:{},...s?{afterId:s}:{}});for(let g of d.items)try{let f=await z(t,g,{collectEligible:!0}),h=await S(t,"definition",g.taskDefinition);for(let x of f.eligibleEvidence){let w=await S(t,"evidence",x),b=!1;for(let R of B(w,h)){let p=await t.familySplit(R.namespace,R.kind,R.key);if(p!==null&&p!=="train"){b=!0;break}}b||o.add(JSON.stringify([x.id,x.revision,x.contentHash]))}}catch(f){if(!(f instanceof m))throw f;r.push({policyId:g.id,code:f.code,message:f.message})}s=d.nextCursor??void 0}while(s);return Ri.parse({modelProjectId:i,inspectedAt:n,pendingTrainingCount:r.length?null:o.size,issues:r})}c(vn,"inspectLearningTaskQueue");function Cn(t){try{H(t,16777216)}catch(i){throw new m("learning_json_invalid",400,i instanceof Error?i.message:"Expected bounded JSON.")}}c(Cn,"assertLearningRequestJson");var jn=e.object({scope:a,command:He}).strict(),En=e.discriminatedUnion("action",[e.object({action:e.literal("inspect_task_queue"),scope:a,modelProjectId:a.nullable()}).strict(),e.object({action:e.literal("inspect_policy"),scope:a,policy:u}).strict(),e.object({action:e.literal("inspect_evidence"),scope:a,evidence:u}).strict(),e.object({action:e.literal("get"),scope:a,kind:Q,id:a,revision:e.number().int().positive().optional()}).strict(),e.object({action:e.literal("list"),scope:a,kind:Q,parentId:a.optional(),status:e.string().min(1).max(200).optional(),reviewState:e.enum(["inbox","reviewed"]).optional(),afterId:a.optional(),limit:e.number().int().min(1).max(100).default(50)}).strict()]),Tn=e.object({evidence:u,definition:u,inspection:e.object({evidenceValidity:e.enum(["valid","invalid"]),taskReady:e.boolean(),observedOutputValid:e.boolean().nullable(),issues:e.array(e.object({path:e.string(),code:e.string(),message:e.string()}).strict()).max(100)}).strict()}).strict(),Dn=e.object({operationId:a,resources:e.array(e.union(Object.values(J))).max(100)}).strict();export{$ as a,qe as b,Pe as c,He as d,Fe as e,Be as f,bi as g,Ne as h,mt as i,lt as j,ut as k,J as l,Me as m,L as n,S as o,At as p,Lt as q,Ot as r,vi as s,W as t,wi as u,z as v,Qe as w,Ke as x,We as y,Si as z,mn as A,Ri as B,vn as C,Cn as D,jn as E,En as F,Tn as G,Dn as H};