openpond 0.2.0 → 0.2.1

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 (220) hide show
  1. package/dist/chunks/actions-command-QP3NMDK4.js +2 -0
  2. package/dist/chunks/app-layer-N7VFRVJ2.js +3 -0
  3. package/dist/chunks/app-server-runtime-OCLPUI7F.js +2 -0
  4. package/dist/chunks/apps-AMG75TI4.js +2 -0
  5. package/dist/chunks/chunk-22UARBPW.js +3 -0
  6. package/dist/chunks/chunk-3A7HZJNE.js +1 -0
  7. package/dist/chunks/chunk-3M53YXEI.js +2 -0
  8. package/dist/chunks/chunk-3NDRIQTI.js +2 -0
  9. package/dist/chunks/chunk-5BBVEWG3.js +2 -0
  10. package/dist/chunks/chunk-5O7ZVCMV.js +6 -0
  11. package/dist/chunks/chunk-6FA3GG5B.js +33 -0
  12. package/dist/chunks/chunk-6MI4KKWF.js +2 -0
  13. package/dist/chunks/chunk-BBG546O6.js +6 -0
  14. package/dist/chunks/chunk-BX4J2VDU.js +2 -0
  15. package/dist/chunks/chunk-BZMVB3GS.js +2 -0
  16. package/dist/chunks/chunk-C5LOZSVS.js +2 -0
  17. package/dist/chunks/chunk-CWQWV2T3.js +2 -0
  18. package/dist/chunks/chunk-DUA3QP6Y.js +19 -0
  19. package/dist/chunks/chunk-EAPFMACH.js +10 -0
  20. package/dist/chunks/chunk-ES2ISFJC.js +66 -0
  21. package/dist/chunks/chunk-F65NIZLM.js +2199 -0
  22. package/dist/chunks/chunk-FGJ5LFPL.js +5 -0
  23. package/dist/chunks/chunk-FTQLQJQV.js +2 -0
  24. package/dist/chunks/chunk-FY7OQ5RK.js +24 -0
  25. package/dist/chunks/chunk-FYCJSUFV.js +53 -0
  26. package/dist/chunks/chunk-GLUWATL5.js +2 -0
  27. package/dist/chunks/chunk-H7IWJN7L.js +17 -0
  28. package/dist/chunks/chunk-HZP5U2AA.js +3 -0
  29. package/dist/chunks/chunk-I5K74TOH.js +3 -0
  30. package/dist/chunks/chunk-IR3YJWPW.js +7 -0
  31. package/dist/chunks/chunk-KU7QOHFT.js +2872 -0
  32. package/dist/chunks/chunk-KV553EWX.js +16 -0
  33. package/dist/chunks/chunk-MGN6GLNZ.js +2 -0
  34. package/dist/chunks/chunk-OG5Q6NXK.js +28 -0
  35. package/dist/chunks/chunk-OGPHXXCD.js +1 -0
  36. package/dist/chunks/chunk-PI36UHRA.js +18 -0
  37. package/dist/chunks/chunk-RWSAGQTP.js +2 -0
  38. package/dist/chunks/chunk-SAE4OIPC.js +2 -0
  39. package/dist/chunks/chunk-SDO4FC4Q.js +2 -0
  40. package/dist/chunks/chunk-UKUVMXOW.js +12 -0
  41. package/dist/chunks/chunk-VCLCFK3O.js +36 -0
  42. package/dist/chunks/chunk-VYUMTRB3.js +5 -0
  43. package/dist/chunks/chunk-X37KMV27.js +1 -0
  44. package/dist/chunks/chunk-XDHAGACI.js +3 -0
  45. package/dist/chunks/chunk-XEOEKFG6.js +71 -0
  46. package/dist/chunks/chunk-ZF7TEGY5.js +5 -0
  47. package/dist/chunks/chunk-ZVOO7FKM.js +2 -0
  48. package/dist/chunks/cli-M2FG7SSI.js +2 -0
  49. package/dist/chunks/configuration-command-XBKBIZBO.js +2 -0
  50. package/dist/chunks/continual-D75WA7E7.js +7 -0
  51. package/dist/chunks/core-commands-LUZVWXQR.js +2 -0
  52. package/dist/chunks/database-X2CUV732.js +2 -0
  53. package/dist/chunks/desktop-test-KGC4JVJ7.js +3 -0
  54. package/dist/chunks/dist-NKLXFA37.js +2 -0
  55. package/dist/chunks/extension-NQ7N5LEY.js +5 -0
  56. package/dist/chunks/help-MWK66XZK.js +8 -0
  57. package/dist/chunks/module-ES6BEMUI-ZVL3F6NW.js +2 -0
  58. package/dist/chunks/module-asyncify-2EFITU5U-R7TVXNAE.js +2 -0
  59. package/dist/chunks/opchat-XJZA3QKZ.js +3 -0
  60. package/dist/chunks/organizations-UECDFEYE.js +2 -0
  61. package/dist/chunks/profile-KUMIZURM.js +3 -0
  62. package/dist/chunks/project-agent-NILMJHLV.js +2 -0
  63. package/dist/chunks/sandbox-command-QHH65OSE.js +2 -0
  64. package/dist/chunks/sandbox-template-N7I63PNU.js +10 -0
  65. package/dist/chunks/src-724HF43W.js +82 -0
  66. package/dist/chunks/src-VTKTTKQO.js +319 -0
  67. package/dist/chunks/taskset-PISBOILQ.js +2 -0
  68. package/dist/chunks/teams-bot-UV4RU53M.js +3 -0
  69. package/dist/chunks/training-2NDOWH5S.js +2 -0
  70. package/dist/chunks/workspaces-XXT4KUD3.js +2 -0
  71. package/dist/cli.js +3 -109
  72. package/dist/index.js +1 -31230
  73. package/dist/sandbox-template/manifest.js +1 -18380
  74. package/dist/web/assets/App-DxecRQUL.js +176 -0
  75. package/dist/web/assets/AppDialog-B65Eo3gp.js +1 -0
  76. package/dist/web/assets/AppTerminalPanel-B2EKQM7W.js +2 -0
  77. package/dist/web/assets/{AppsView-B1NUuAIf.js → AppsView-BBoVe7s2.js} +1 -1
  78. package/dist/web/assets/{BrowserSidebar-DOvYxXeP.js → BrowserSidebar-CSM1atSJ.js} +1 -1
  79. package/dist/web/assets/{CartesianChart-pOrYpzBr.js → CartesianChart-CJKfXiEG.js} +1 -1
  80. package/dist/web/assets/{CollaborationTabs-CgbR-MBJ.js → CollaborationTabs-BMZamWFC.js} +1 -1
  81. package/dist/web/assets/{CommandMenu-CrIr4qUX.js → CommandMenu-B3U1z2eo.js} +1 -1
  82. package/dist/web/assets/{CommunityView-CvAVQ_HZ.js → CommunityView-CTyRUcfy.js} +1 -1
  83. package/dist/web/assets/{ComposerCreateImproveStrip-DybcKwwd.js → ComposerCreateImproveStrip-D7usvRtK.js} +1 -1
  84. package/dist/web/assets/GetStartedView-Ibu7oKWJ.js +1 -0
  85. package/dist/web/assets/HostedModelLearningReview-qnzIkT70.js +1 -0
  86. package/dist/web/assets/HostedModelLearningSettings--PKjpYsy.js +1 -0
  87. package/dist/web/assets/LabModelVersionDetailPage-s9uUN6fV.js +1 -0
  88. package/dist/web/assets/{LabSkillSidebar-CuaYrtiu.js → LabSkillSidebar-BKYseMiJ.js} +1 -1
  89. package/dist/web/assets/LabsRoute-C1FWCoYb.css +1 -0
  90. package/dist/web/assets/LabsRoute-DoRs0K6v.js +32 -0
  91. package/dist/web/assets/MainChatThread-DvuyMcMB.js +2 -0
  92. package/dist/web/assets/MainPane-BWwcxgHD.js +8 -0
  93. package/dist/web/assets/{MarkdownText-DOlVQR8a.js → MarkdownText-D8XC5UT_.js} +1 -1
  94. package/dist/web/assets/{Messages-DMubppta.js → Messages-e4A8JUjD.js} +6 -6
  95. package/dist/web/assets/{NativeSkillSidebar-DSFwZ-od.js → NativeSkillSidebar-D2Joh8XB.js} +1 -1
  96. package/dist/web/assets/{NewExperienceSwitcher-Dj0ePIJ-.js → NewExperienceSwitcher-CzGebt2E.js} +1 -1
  97. package/dist/web/assets/{NewProjectDialog-B8NQV-Ji.js → NewProjectDialog-CdMTSxUE.js} +1 -1
  98. package/dist/web/assets/{OutputsPage-D_LDYTgV.js → OutputsPage-m7cSb8dW.js} +1 -1
  99. package/dist/web/assets/{ProjectsPage-xjDYPc_W.js → ProjectsPage-C9mz8W1g.js} +1 -1
  100. package/dist/web/assets/RightChatPanelStack-B4LEqKEj.js +1 -0
  101. package/dist/web/assets/{RightSidebarHomePanel-j0VckZUu.js → RightSidebarHomePanel-DOeUsH7h.js} +1 -1
  102. package/dist/web/assets/{ScheduledWorkPage-1aT4bBY-.js → ScheduledWorkPage-UXZSSWgA.js} +1 -1
  103. package/dist/web/assets/{SettingsView-BSpuMDpv.js → SettingsView-CQm1ai73.js} +7 -7
  104. package/dist/web/assets/TeamChatView-C4haojB7.js +3 -0
  105. package/dist/web/assets/{TerminalOverlay-CrSwUk2d.js → TerminalOverlay-p2GZsuyQ.js} +3 -3
  106. package/dist/web/assets/{TrainingCreationPanel-B4HMRwUg.js → TrainingCreationPanel-BYJSlO8X.js} +1 -1
  107. package/dist/web/assets/{TrainingDraftPanel-D4r1tN3I.js → TrainingDraftPanel-DR5KlayH.js} +1 -1
  108. package/dist/web/assets/{UsageSettingsSection-2aymqwIM.js → UsageSettingsSection-BQToNXE4.js} +5 -5
  109. package/dist/web/assets/{WorkSidebarPanel-B0X0OiR6.js → WorkSidebarPanel--EeytWeg.js} +1 -1
  110. package/dist/web/assets/WorkspaceDiffPanel-BrovSYhn.js +14 -0
  111. package/dist/web/assets/{WorkspaceEnvironmentMenu-OAfMEt7L.js → WorkspaceEnvironmentMenu-l-keRgvj.js} +3 -3
  112. package/dist/web/assets/{WorkspaceGitDialogs-YxcPH2Rq.js → WorkspaceGitDialogs-aicWzaZu.js} +1 -1
  113. package/dist/web/assets/{WorkspaceMonacoEditor-COKTiQZl.js → WorkspaceMonacoEditor-CO_E74jM.js} +36 -36
  114. package/dist/web/assets/{arrow-up-right-_TX-awvK.js → arrow-up-right-rwPXNfVn.js} +1 -1
  115. package/dist/web/assets/chat-file-links-B3jDstSC.js +1 -0
  116. package/dist/web/assets/chevron-up-D089nvYQ.js +1 -0
  117. package/dist/web/assets/{clipboard-CyRSS8Sy.js → clipboard-DwEExyU4.js} +1 -1
  118. package/dist/web/assets/{cloud-upload-uBJBUYTy.js → cloud-upload-D2he0-vQ.js} +1 -1
  119. package/dist/web/assets/{cssMode-BrXSsZYs.js → cssMode-DS4k0NcI.js} +1 -1
  120. package/dist/web/assets/{folder-open-DktdZNW7.js → folder-open-CAOLduKD.js} +1 -1
  121. package/dist/web/assets/{folder-plus-DO06i9Vo.js → folder-plus-D56MrxVT.js} +1 -1
  122. package/dist/web/assets/{git-commit-horizontal-zFSIkPs7.js → git-commit-horizontal-CeNM0oKJ.js} +1 -1
  123. package/dist/web/assets/{htmlMode-X9UMFkjt.js → htmlMode-Xkni5erh.js} +1 -1
  124. package/dist/web/assets/{index-ByQIHpc9.css → index-BGMzUaup.css} +1 -1
  125. package/dist/web/assets/{index-UOGdfLzi.js → index-KwyAyscP.js} +1 -1
  126. package/dist/web/assets/{info-BEJXUqCD.js → info-CcrBaEE_.js} +1 -1
  127. package/dist/web/assets/{jsonMode-DIsB-j2E.js → jsonMode-C4YPbQB7.js} +1 -1
  128. package/dist/web/assets/{lspLanguageFeatures-CmZ17KpA.js → lspLanguageFeatures-CF5oMTz6.js} +1 -1
  129. package/dist/web/assets/{minimize-2-DumTpFtE.js → minimize-2-DzHQnInk.js} +1 -1
  130. package/dist/web/assets/{monaco.contribution-DJ_NmcHu.js → monaco.contribution-0EN4mGCC.js} +2 -2
  131. package/dist/web/assets/{monaco.contribution-YVDfJcG4.js → monaco.contribution-B4qcTP0w.js} +2 -2
  132. package/dist/web/assets/{monaco.contribution-LZEujgny.js → monaco.contribution-CJK_NrBm.js} +2 -2
  133. package/dist/web/assets/{monaco.contribution-D6w5PJji.js → monaco.contribution-CkPGKNd-.js} +2 -2
  134. package/dist/web/assets/{play-CLFeH7CU.js → play-p3-AMTPL.js} +1 -1
  135. package/dist/web/assets/{python-Djbda_qZ.js → python-B0kpTxAZ.js} +1 -1
  136. package/dist/web/assets/{refresh-cw-B4IpQ_7Q.js → refresh-cw-_jbTIzzr.js} +1 -1
  137. package/dist/web/assets/{save-BbTHztnA.js → save-Cy6hEotx.js} +1 -1
  138. package/dist/web/assets/{square-BJrVbmz6.js → square-DKQkcrOH.js} +1 -1
  139. package/dist/web/assets/{toggleHighContrast-BopU5W9S.js → toggleHighContrast-Bnk1VVVq.js} +1 -1
  140. package/dist/web/assets/{tsMode-CH_0_YDX.js → tsMode-BDrSVy7V.js} +1 -1
  141. package/dist/web/assets/{upload-UumVeufu.js → upload-COn0my_O.js} +1 -1
  142. package/dist/web/assets/{useLocalAgentSchedules-BRa23U7O.js → useLocalAgentSchedules-iZNB4Oee.js} +1 -1
  143. package/dist/web/assets/{wifi-off-BWJWivn6.js → wifi-off-Cqt-ZLXY.js} +1 -1
  144. package/dist/web/assets/{workers-pTe8RvSI.js → workers-hu0Ym93h.js} +1 -1
  145. package/dist/web/assets/{yaml-DNLASORn.js → yaml-D-JLDGL6.js} +1 -1
  146. package/dist/web/index.html +2 -2
  147. package/package.json +4 -3
  148. package/dist/chunks/actions-command-6N5XWMR6.js +0 -185
  149. package/dist/chunks/app-layer-F3CGXB33.js +0 -216
  150. package/dist/chunks/app-server-runtime-RHO5TFUC.js +0 -23
  151. package/dist/chunks/apps-L5XCL7QY.js +0 -429
  152. package/dist/chunks/chunk-26AMV5ZI.js +0 -634
  153. package/dist/chunks/chunk-3EB7I67T.js +0 -630
  154. package/dist/chunks/chunk-3ELF4FXY.js +0 -96
  155. package/dist/chunks/chunk-3VEYNDHN.js +0 -669
  156. package/dist/chunks/chunk-4KA25HUP.js +0 -5648
  157. package/dist/chunks/chunk-4L3ZJS2T.js +0 -1207
  158. package/dist/chunks/chunk-6SMNG6YA.js +0 -1303
  159. package/dist/chunks/chunk-7RIGZB7N.js +0 -1148
  160. package/dist/chunks/chunk-A6G3PFA5.js +0 -2164
  161. package/dist/chunks/chunk-BVY5JYM6.js +0 -512
  162. package/dist/chunks/chunk-DLQQIWN2.js +0 -648
  163. package/dist/chunks/chunk-FJ2JGB2N.js +0 -1373
  164. package/dist/chunks/chunk-FQS2QL5F.js +0 -14522
  165. package/dist/chunks/chunk-G65WAOJV.js +0 -1643
  166. package/dist/chunks/chunk-JTHL5XJ2.js +0 -1838
  167. package/dist/chunks/chunk-K4TZEHAW.js +0 -602
  168. package/dist/chunks/chunk-KCRCIQPD.js +0 -66
  169. package/dist/chunks/chunk-KSRWKXRB.js +0 -12
  170. package/dist/chunks/chunk-MUMPWI4O.js +0 -92
  171. package/dist/chunks/chunk-NTK22KJD.js +0 -10707
  172. package/dist/chunks/chunk-OCBRPU2K.js +0 -629
  173. package/dist/chunks/chunk-PS37DB5F.js +0 -183
  174. package/dist/chunks/chunk-R3C3MNSI.js +0 -140
  175. package/dist/chunks/chunk-SMNFI2FU.js +0 -113
  176. package/dist/chunks/chunk-UACZUFIA.js +0 -47
  177. package/dist/chunks/chunk-UZMVNKXM.js +0 -1275
  178. package/dist/chunks/chunk-VT6BLHMB.js +0 -67198
  179. package/dist/chunks/chunk-W5GKHH77.js +0 -168
  180. package/dist/chunks/chunk-X6F4LBTQ.js +0 -832
  181. package/dist/chunks/chunk-X7ZG4TSW.js +0 -3063
  182. package/dist/chunks/chunk-XA4KBDMY.js +0 -13723
  183. package/dist/chunks/chunk-YVCYVDNP.js +0 -746
  184. package/dist/chunks/chunk-ZNQEROWP.js +0 -254
  185. package/dist/chunks/cli-D2MUUBEX.js +0 -23
  186. package/dist/chunks/configuration-command-NR6JYIUD.js +0 -187
  187. package/dist/chunks/continual-37CE4LLJ.js +0 -803
  188. package/dist/chunks/core-commands-SWGIOZLW.js +0 -50
  189. package/dist/chunks/database-DEYUZDIM.js +0 -20
  190. package/dist/chunks/desktop-test-QOS7G5NE.js +0 -148
  191. package/dist/chunks/dist-AKYCQNNF.js +0 -187
  192. package/dist/chunks/extension-HJUJBQAD.js +0 -9378
  193. package/dist/chunks/help-J6PZ23IC.js +0 -67
  194. package/dist/chunks/opchat-ABX5YBAT.js +0 -169
  195. package/dist/chunks/organizations-CPNC47DO.js +0 -806
  196. package/dist/chunks/profile-Q3HB5MIO.js +0 -1136
  197. package/dist/chunks/project-agent-YHUBX4OR.js +0 -516
  198. package/dist/chunks/sandbox-command-YFL5QTWX.js +0 -1661
  199. package/dist/chunks/sandbox-template-Z6P7NTNF.js +0 -1655
  200. package/dist/chunks/src-7XEENEBI.js +0 -3628
  201. package/dist/chunks/src-KBBIV4NT.js +0 -56125
  202. package/dist/chunks/taskset-2TRZBRRT.js +0 -66
  203. package/dist/chunks/teams-bot-WD33NLH5.js +0 -146
  204. package/dist/chunks/training-4XH37UZB.js +0 -17
  205. package/dist/chunks/workspaces-WG2MH2WE.js +0 -99
  206. package/dist/web/assets/App-C9aGkxVg.js +0 -173
  207. package/dist/web/assets/AppDialog-CK6_lg8c.js +0 -1
  208. package/dist/web/assets/AppTerminalPanel-BKqgX4sd.js +0 -2
  209. package/dist/web/assets/GetStartedView-DVInkexN.js +0 -1
  210. package/dist/web/assets/LabModelVersionDetailPage-NaaPElmM.js +0 -1
  211. package/dist/web/assets/LabsRoute-BRR6x3SX.js +0 -2
  212. package/dist/web/assets/LabsRoute-CGFgymTX.css +0 -1
  213. package/dist/web/assets/MainChatThread-BfkjCZB9.js +0 -2
  214. package/dist/web/assets/MainPane-Gw-YK38n.js +0 -8
  215. package/dist/web/assets/RightChatPanelStack-BktRQ9wg.js +0 -1
  216. package/dist/web/assets/TeamChatView-BPWJbDf1.js +0 -3
  217. package/dist/web/assets/WorkspaceDiffPanel-Pg7GL0br.js +0 -14
  218. package/dist/web/assets/chat-file-links-CWLsRYvW.js +0 -1
  219. package/dist/web/assets/chevron-up--mNnEqha.js +0 -1
  220. package/dist/web/assets/index-BEPmTPIA.js +0 -1
@@ -0,0 +1,71 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{b as f}from"./chunk-ES2ISFJC.js";import{a as c}from"./chunk-FTQLQJQV.js";import{promises as K}from"node:fs";import k from"node:path";function _(t){return!!(t&&typeof t=="object"&&t.kind==="openpond-project-action"&&typeof t.id=="string"&&typeof t.run=="function")}c(_,"isProjectActionDefinition");var I="openpond/project-actions.json",G=f.object({values:f.record(f.string(),f.unknown()).optional().default({}),environment:f.record(f.string(),f.string().trim().min(1)).optional().default({})}).strict(),q=f.object({sourceDirectory:f.string().trim().min(1).optional(),outputDirectory:f.string().trim().min(1).optional(),environment:f.record(f.string(),f.string().trim().min(1)).optional().default({}),connections:f.record(f.string(),G).optional().default({})}).strict();async function R(t){let r=k.resolve(t),e=k.join(r,I),o=await K.readFile(e,"utf8").catch(n=>{if(n.code==="ENOENT")return null;throw n});if(o===null)return q.parse({});let s;try{s=JSON.parse(o)}catch(n){let i=n instanceof Error?n.message:String(n);throw new Error(`${I} is not valid JSON: ${i}`)}return q.parse(s)}c(R,"loadProjectActionConfiguration");function C(t,r=process.env){let e={};for(let[s,n]of Object.entries(t.environment)){let i=r[n];i!==void 0&&(e[s]=i)}let o={};for(let[s,n]of Object.entries(t.connections)){let i={...n.values};for(let[u,a]of Object.entries(n.environment)){let p=r[a];p!==void 0&&(i[u]=p)}o[s]=i}return{environment:e,connections:o}}c(C,"resolveProjectActionRuntime");import{randomUUID as x}from"node:crypto";import{spawn as Z}from"node:child_process";import{promises as E}from"node:fs";import m from"node:path";import{promises as v}from"node:fs";import l from"node:path";import{fileURLToPath as X,pathToFileURL as Y}from"node:url";import{build as Q}from"esbuild";import{promises as z}from"node:fs";import P from"node:path";import{createHash as ct}from"node:crypto";import{promises as at}from"node:fs";import{createRequire as ut}from"node:module";import O from"node:path";function J(t){return f.toJSONSchema(t,{unrepresentable:"any"})}c(J,"projectActionJsonSchema");function tt(t){let r=[],e=new Set,o=c(n=>{if(!e.has(n)){if(n&&(typeof n=="object"||typeof n=="function")&&e.add(n),_(n)){r.push(n);return}if(Array.isArray(n)){n.forEach(o);return}n&&typeof n=="object"&&Object.values(n).forEach(o)}},"visit");t.forEach(o);let s=new Map;for(let n of r){if(s.has(n.id))throw new Error(`Duplicate Project Action id: ${n.id}`);s.set(n.id,n)}return[...s.values()].sort((n,i)=>n.id.localeCompare(i.id))}c(tt,"collectProjectActions");function et(t){return{schemaVersion:"openpond.projectActionRegistry.v1",actions:t.map(ot)}}c(et,"createProjectActionRegistry");function ot(t){return{id:t.id,sourceActionId:t.id,name:t.id,label:t.label,description:t.description,visibility:"default",inputSchema:J(t.inputSchema),outputSchema:J(t.outputSchema),approvalPolicy:{...t.approval,required:t.approval.mode==="always"||t.approval.mode==="sensitive"||t.approval.mode==="writes"&&t.behavior==="write",risk:t.behavior},artifactPolicy:{outputArtifacts:[],persistRunSummary:!0,persistTrace:!0},setupRequirements:[...t.setup],mcp:{enabled:!1},schedulePolicy:{enabled:!1,allowAdHoc:!0},trace:{name:t.id,namespace:"project-actions"},implementation:{type:"openpond-project-action",actionId:t.id,behavior:t.behavior,timeoutMs:t.timeoutMs,concurrency:t.concurrency},invokesModel:t.invokesModel}}c(ot,"toCatalogEntry");var rt=/\.(?:[cm]?[jt]s)$/i,nt=/(?:\.d\.ts|\.test\.[cm]?[jt]s|\.spec\.[cm]?[jt]s)$/i;async function it(t){let r=P.resolve(t.projectRoot),e=P.resolve(r,t.sourceDirectory??"openpond/actions");if(!st(r,e))throw new Error("Project Action source directory must stay inside the Project root.");if(!(await z.stat(e).catch(()=>null))?.isDirectory())throw new Error(`Project Action source directory does not exist: ${e}`);let n=(await B(e)).filter(i=>rt.test(i)&&!nt.test(i)).map(i=>P.relative(r,i).split(P.sep).join("/")).sort();if(n.length===0)throw new Error(`No Project Action files were found under ${e}.`);return{projectRoot:r,sourceRoot:e,files:n}}c(it,"discoverProjectActionFiles");async function B(t){let r=await z.readdir(t,{withFileTypes:!0}),e=[];for(let o of r.sort((s,n)=>s.name.localeCompare(n.name))){if(o.name.startsWith(".")||o.name==="node_modules")continue;let s=P.join(t,o.name);o.isDirectory()?e.push(...await B(s)):o.isFile()&&e.push(s)}return e}c(B,"walk");function st(t,r){let e=P.relative(t,r);return e===""||!e.startsWith("..")&&!P.isAbsolute(e)}c(st,"isWithin");function L(t){return ct("sha256").update(t).digest("hex")}c(L,"sha256");function M(t){return`${JSON.stringify(N(t),null,2)}
3
+ `}c(M,"canonicalJson");function N(t){return Array.isArray(t)?t.map(N):!t||typeof t!="object"?t:Object.fromEntries(Object.entries(t).sort(([r],[e])=>r.localeCompare(e)).map(([r,e])=>[r,N(e)]))}c(N,"sortValue");async function W(t,r){for(let e of r)if(e.required!==!1){if(e.kind==="package")try{ut(O.join(t,"package.json")).resolve(e.name)}catch{throw new Error(`Project Action package is not installed: ${e.name}`)}if(e.kind==="native_tool"&&!await ft(e.name))throw new Error(`Project Action native tool is not installed: ${e.name}`)}}c(W,"validateProjectActionStaticSetup");async function lt(t,r,e){await W(t,r);for(let o of r)if(o.required!==!1){if(o.kind==="connection"&&!(o.name in(e.connections??{})))throw new Error(`Project Action connection is not configured: ${o.name}`);if(o.kind==="env"&&!(o.name in(e.environment??{})))throw new Error(`Project Action environment value is not configured: ${o.name}`)}}c(lt,"validateProjectActionRunSetup");async function ft(t){if(!t.trim()||t.includes("/")||t.includes("\\"))return!1;for(let r of(process.env.PATH??"").split(O.delimiter).filter(Boolean)){let e=process.platform==="win32"?(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";").map(o=>O.join(r,`${t}${o}`)):[O.join(r,t)];for(let o of e)if(await at.access(o).then(()=>!0).catch(()=>!1))return!0}return!1}c(ft,"executableExists");var H=".openpond/actions";async function dt(t){let r=await R(t.projectRoot),e=await it({projectRoot:t.projectRoot,sourceDirectory:t.sourceDirectory??r.sourceDirectory}),o=l.resolve(e.projectRoot,t.outputDirectory??r.outputDirectory??H);mt(e.projectRoot,o),await v.mkdir(o,{recursive:!0});let s=l.join(o,"entry.mjs"),n=l.join(o,"bundle.mjs"),i=l.join(o,"runner.mjs"),u=l.join(o,"action-registry.json"),a=l.join(o,"build-manifest.json"),p=e.files.map((h,A)=>{let T=l.relative(o,l.join(e.projectRoot,h)).split(l.sep).join("/"),V=T.startsWith(".")?T:`./${T}`;return`import * as actionModule${A} from ${JSON.stringify(V)};`}),d=e.files.map((h,A)=>`actionModule${A}`).join(", ");await v.writeFile(s,[...p,`export const projectActionModules = [${d}];`,"export default projectActionModules;",""].join(`
4
+ `),"utf8"),await Q({entryPoints:[s],outfile:n,bundle:!0,platform:"node",format:"esm",target:"node22.14",sourcemap:!1,legalComments:"none",logLevel:"silent",nodePaths:pt(e.projectRoot)});let g=`openpond_action_build=${Date.now()}_${Math.random().toString(16).slice(2)}`,w=await import(`${Y(n).href}?${g}`),$=tt(w.projectActionModules??w.default??[]);for(let h of $)await W(e.projectRoot,h.setup);let j=et($);await v.writeFile(u,M(j),"utf8"),await v.writeFile(i,ht(),{encoding:"utf8",mode:493});let D=L(await v.readFile(n)),b=L(M(j)),y={schemaVersion:"openpond.projectActionBuild.v1",sourceDirectory:l.relative(e.projectRoot,e.sourceRoot).split(l.sep).join("/"),sourceFiles:e.files,bundleFile:l.basename(n),runnerFile:l.basename(i),registryFile:l.basename(u),bundleHash:D,registryHash:b};return await v.writeFile(a,M(y),"utf8"),await v.rm(s,{force:!0}),{projectRoot:e.projectRoot,outputDirectory:o,bundlePath:n,runnerPath:i,registryPath:u,manifestPath:a,registry:j,manifest:y}}c(dt,"buildProjectActions");function pt(t){let r=[],e=t;for(;;){r.push(l.join(e,"node_modules"));let o=l.dirname(e);if(o===e)break;e=o}return r.push(l.resolve(l.dirname(X(import.meta.url)),"../../../node_modules")),[...new Set(r)]}c(pt,"dependencySearchPaths");function mt(t,r){let e=l.relative(t,r);if(e.startsWith("..")||l.isAbsolute(e))throw new Error("Project Action output directory must stay inside the Project root.")}c(mt,"assertWithinProject");function ht(){return`#!/usr/bin/env node
5
+ import { promises as fs } from "node:fs";
6
+ import { stdin } from "node:process";
7
+ import path from "node:path";
8
+ import { fileURLToPath, pathToFileURL } from "node:url";
9
+
10
+ let requestText = "";
11
+ stdin.setEncoding("utf8");
12
+ for await (const chunk of stdin) requestText += chunk;
13
+ const request = JSON.parse(requestText);
14
+ const bundlePath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "bundle.mjs");
15
+ const loaded = await import(pathToFileURL(bundlePath).href);
16
+ const values = [];
17
+ const seen = new Set();
18
+ const visit = (value) => {
19
+ if (seen.has(value)) return;
20
+ if (value && (typeof value === "object" || typeof value === "function")) seen.add(value);
21
+ if (value?.kind === "openpond-project-action" && typeof value.run === "function") { values.push(value); return; }
22
+ if (Array.isArray(value)) { value.forEach(visit); return; }
23
+ if (value && typeof value === "object") Object.values(value).forEach(visit);
24
+ };
25
+ (loaded.projectActionModules ?? loaded.default ?? []).forEach(visit);
26
+ const action = values.find((candidate) => candidate.id === request.actionId);
27
+ if (!action) throw new Error(\`Unknown Project Action: \${request.actionId}\`);
28
+ const controller = new AbortController();
29
+ const timeoutMs = Math.min(request.timeoutMs ?? action.timeoutMs, action.timeoutMs);
30
+ const timer = setTimeout(() => controller.abort(new Error(\`Project Action timed out after \${timeoutMs}ms.\`)), timeoutMs);
31
+ const traces = [];
32
+ const outputs = [];
33
+ const env = request.environment ?? {};
34
+ const connections = request.connections ?? {};
35
+ const context = {
36
+ runId: request.runId,
37
+ actionId: action.id,
38
+ idempotencyKey: request.idempotencyKey ?? null,
39
+ projectRoot: request.projectRoot,
40
+ outputDirectory: request.outputDirectory,
41
+ signal: controller.signal,
42
+ env(name) { return Object.prototype.hasOwnProperty.call(env, name) ? env[name] : undefined; },
43
+ connection(name) {
44
+ if (!Object.prototype.hasOwnProperty.call(connections, name)) throw new Error(\`Project Action connection is not configured: \${name}\`);
45
+ return connections[name];
46
+ },
47
+ trace(name, payload) { traces.push({ name, ...(payload ? { payload } : {}), timestamp: new Date().toISOString() }); },
48
+ output(value) {
49
+ if (!value || typeof value.path !== "string" || !value.path.trim()) throw new Error("Project Action output requires a path.");
50
+ const outputPath = path.resolve(request.outputDirectory, value.path);
51
+ const relative = path.relative(request.outputDirectory, outputPath);
52
+ if (relative.startsWith("..") || path.isAbsolute(relative)) throw new Error("Project Action output must stay inside the run output directory.");
53
+ outputs.push({ ...value, path: relative.split(path.sep).join("/") });
54
+ },
55
+ };
56
+ try {
57
+ const input = action.inputSchema.parse(request.input ?? {});
58
+ const result = await Promise.race([
59
+ Promise.resolve(action.run(context, input)),
60
+ new Promise((_, reject) => controller.signal.addEventListener("abort", () => reject(controller.signal.reason), { once: true })),
61
+ ]);
62
+ const output = action.outputSchema.parse(result);
63
+ for (const artifact of outputs) {
64
+ const stats = await fs.stat(path.resolve(request.outputDirectory, artifact.path)).catch(() => null);
65
+ if (!stats?.isFile()) throw new Error(\`Project Action output does not exist: \${artifact.path}\`);
66
+ }
67
+ await fs.writeFile(request.responseFile, JSON.stringify({ ok: true, output, traces, outputs }), "utf8");
68
+ } finally {
69
+ clearTimeout(timer);
70
+ }
71
+ `}c(ht,"runtimeSource");var F=new Map;function zt(t){let r=m.resolve(t.projectRoot),e=t.build??"if-missing",o=null,s=c(async()=>{if(e==="always")return n();if(o)return o;if(e==="never"||e==="if-missing"){let i=await R(r),u=m.resolve(r,t.outputDirectory??i.outputDirectory??H),a=await jt(r,u);if(a)return o=a;if(e==="never")throw new Error(`Project Actions have not been built in ${u}.`)}return n()},"ensureBuild"),n=c(async()=>(o=await dt({projectRoot:r,sourceDirectory:t.sourceDirectory,outputDirectory:t.outputDirectory}),o),"runBuild");return{build:n,async catalog(){return(await s()).registry},async run(i){let u=await s(),a=u.registry.actions.find(h=>h.id===i.actionId);if(!a)throw new Error(`Unknown Project Action: ${i.actionId}`);let p=C(await R(r)),d={...i,environment:{...p.environment,...i.environment??{}},connections:{...p.connections,...i.connections??{}}};await lt(r,a.setupRequirements,d);let g=i.runId?.trim()||x(),w=m.resolve(i.outputDirectory??m.join(r,".openpond","outputs",g));Pt(r,w,"Project Action output directory"),await E.mkdir(w,{recursive:!0});let $=await wt(`${r}\0${i.actionId}`,a.implementation.concurrency,d.signal),j=m.join(u.outputDirectory,`.run-${x()}.json`),D=Date.now(),b,y;try{b=await vt({runnerPath:u.runnerPath,cwd:r,signal:d.signal,request:{actionId:i.actionId,input:d.input??{},runId:g,idempotencyKey:d.idempotencyKey??null,timeoutMs:d.timeoutMs,projectRoot:r,outputDirectory:w,responseFile:j,environment:d.environment??{},connections:d.connections??{}}}),y=JSON.parse(await E.readFile(j,"utf8"))}catch(h){let A=h instanceof Error?h.message:String(h);throw new Error(S(A,d))}finally{await E.rm(j,{force:!0}).catch(()=>{}),$()}return{runId:g,actionId:i.actionId,status:"succeeded",output:y.output,stdout:S(b.stdout,d),stderr:S(b.stderr,d),traces:U(y.traces,d),outputs:U(y.outputs,d),outputDirectory:w,durationMs:Date.now()-D}}}}c(zt,"createLocalActionRunner");async function wt(t,r,e){if(r===null)return()=>{};let o=F.get(t)??{active:0,waiting:[]};F.set(t,o),o.active>=r?await new Promise((n,i)=>{let u=c(()=>{e?.removeEventListener("abort",a),n()},"resume"),a=c(()=>{let p=o.waiting.indexOf(u);p>=0&&o.waiting.splice(p,1),i(e?.reason instanceof Error?e.reason:new Error("Project Action was cancelled."))},"abort");if(e?.aborted){a();return}o.waiting.push(u),e?.addEventListener("abort",a,{once:!0})}):o.active+=1;let s=!1;return()=>{if(s)return;s=!0;let n=o.waiting.shift();if(n){n();return}o.active-=1,o.active===0&&o.waiting.length===0&&F.delete(t)}}c(wt,"acquireLocalActionSlot");async function jt(t,r){let e=m.join(r,"build-manifest.json"),o=m.join(r,"action-registry.json"),[s,n]=await Promise.all([E.readFile(e,"utf8").catch(()=>null),E.readFile(o,"utf8").catch(()=>null)]);if(!s||!n)return null;let i=JSON.parse(s),u=JSON.parse(n);return{projectRoot:t,outputDirectory:r,bundlePath:m.join(r,i.bundleFile),runnerPath:m.join(r,i.runnerFile),registryPath:o,manifestPath:e,registry:u,manifest:i}}c(jt,"loadBuild");function S(t,r){let e=t;for(let o of yt(r))o.length>=4&&(e=e.split(o).join("[REDACTED]"));return e}c(S,"redactRuntimeValues");function U(t,r){let e=JSON.stringify(t);return JSON.parse(S(e,r))}c(U,"redactRuntimeValue");function yt(t){let r=new Set(Object.values(t.environment??{})),e=c(o=>{typeof o=="string"?r.add(o):Array.isArray(o)?o.forEach(e):o&&typeof o=="object"&&Object.values(o).forEach(e)},"visit");return e(t.connections??{}),[...r].filter(Boolean).sort((o,s)=>s.length-o.length)}c(yt,"runtimeStringValues");function vt(t){return new Promise((r,e)=>{if(t.signal?.aborted){e(t.signal.reason instanceof Error?t.signal.reason:new Error("Project Action was cancelled."));return}let o;try{o=JSON.stringify(t.request)}catch(a){e(new Error(`Project Action request is not serializable: ${a instanceof Error?a.message:String(a)}`));return}let s=Z(process.execPath,[t.runnerPath],{cwd:t.cwd,env:gt(),stdio:["pipe","pipe","pipe"]}),n="",i="";s.stdout.setEncoding("utf8"),s.stderr.setEncoding("utf8"),s.stdout.on("data",a=>{n+=a}),s.stderr.on("data",a=>{i+=a});let u=c(()=>s.kill("SIGTERM"),"abort");t.signal?.addEventListener("abort",u,{once:!0}),s.once("error",e),s.once("close",(a,p)=>{if(t.signal?.removeEventListener("abort",u),t.signal?.aborted){e(t.signal.reason instanceof Error?t.signal.reason:new Error("Project Action was cancelled."));return}if(a!==0){e(new Error(`Project Action process failed (${a??p??"unknown"}): ${i.trim()||n.trim()}`));return}r({stdout:n,stderr:i})}),s.stdin.end(o)})}c(vt,"executeChild");function Pt(t,r,e){let o=m.relative(t,r);if(o.startsWith("..")||m.isAbsolute(o))throw new Error(`${e} must stay inside the Project root.`)}c(Pt,"assertWithinProject2");function gt(){let t={};for(let r of["PATH","SystemRoot","WINDIR","TMPDIR","TEMP","TMP"])process.env[r]!==void 0&&(t[r]=process.env[r]);return t}c(gt,"minimalEnvironment");export{I as a,R as b,dt as c,zt as d};
@@ -0,0 +1,5 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{B as Q,C as ee,D as b,E as te,F as ne,l as M,z as G}from"./chunk-SAE4OIPC.js";import{a as j,b as y,c as w,h as Z,i as E,j as B}from"./chunk-UKUVMXOW.js";import{Ha as Y,bb as $,ub as F,wa as K}from"./chunk-OG5Q6NXK.js";import{a as l}from"./chunk-HZP5U2AA.js";import{b as a}from"./chunk-ES2ISFJC.js";import{a as d}from"./chunk-FTQLQJQV.js";var ye="openpond-chat",we=24,Pe=4e4,N=2e4,H="outputs",D="inputs/previous-outputs",ae="inputs/.openpond-context.json",Oe=100,oe=100,re=100*1024*1024,x=class{static{d(this,"OpenPondWorkClient")}#e;#t;#n;#o;constructor(e){this.#e=e.apiKey,this.#t=e.apiBaseUrl,this.#n=e.chatApiBaseUrl,this.#o=e.sandboxes}async run(e){let t=e.prompt.trim();if(!t)throw new Error("Work prompt is required");e.signal?.throwIfAborted();let o=d(async u=>e.onEvent?.(u),"emit"),n=e.cleanup??"keep",s=xe(n),i=null,c=null,f=!1,g=ie(e.maxSteps,1,100,we),p="";try{await o({type:"status",message:"Preparing sandbox"}),i=await this.#l(e),await o({type:"sandbox",sandboxId:i.id,state:i.state}),await this.#c(i.id,e.inputs??[]),c=await this.#p(i.id);let u=[{role:"system",content:ke(i.id,(e.inputs?.length??0)>0)},...(e.history??[]).map(h=>({...h})),{role:"user",content:t}];for(let h=1;h<=g;h+=1){e.signal?.throwIfAborted(),await o({type:"status",message:`Thinking \xB7 step ${h}`});let X=(await B({apiBaseUrl:this.#n,token:this.#e,model:e.model?.trim()||ye,messages:u,tools:be,toolChoice:"auto",signal:e.signal,metadata:{source:"openpond-sdk-work",sandboxId:i.id,apiBaseUrl:this.#t,...e.metadata}})).choices?.[0],W=X?.message?.content?.trim()??"",L=X?.message?.tool_calls??[];if(u.push({role:"assistant",content:W||null,...L.length>0?{tool_calls:L}:{}}),W&&(p=W,await o({type:"assistant",text:W})),L.length===0){let O=await this.#i(i.id,c);for(let U of O)await o({type:"output",output:U});f=!0,await this.#s(i.id,O,e,s,o);let A={sandboxId:i.id,text:p,steps:h,outputs:O,lifecycle:s};return await o({type:"done",...A}),A}for(let[O,A]of L.entries()){let U=await this.#u(i.id,A,O,e.timeoutSeconds,o);u.push(U)}}throw new Error(`Work did not finish within ${g} steps`)}catch(u){if(i&&c&&!f)try{let h=await this.#i(i.id,c);for(let V of h)await o({type:"output",output:V});await this.#s(i.id,h,e,s,o)}catch(h){se(u,s,h)}throw se(u,s),u}}async deleteSandbox(e){(await this.#o.get(e)).state!=="deleted"&&await this.#o.delete(e)}async#c(e,t){if(t.length===0)return;if(t.length>oe)throw new Error(`Work inputs exceed the ${oe} file limit`);if(t.reduce((i,c)=>i+Buffer.byteLength(c.contentsBase64,"base64"),0)>re)throw new Error(`Work inputs exceed the ${re} byte limit`);await this.#o.mkdir(e,{path:D,recursive:!0});let n=new Set,s=[];for(let[i,c]of t.entries()){let f=Ce(c,i,n),g=`${D}/${f}`;await this.#o.uploadFileBase64(e,g,c.contentsBase64),s.push({id:c.id,path:g,name:c.name,mimeType:c.mimeType??null,checksumSha256:c.checksumSha256??null,revision:c.revision??null,metadata:c.metadata??{}})}await this.#o.uploadFile(e,ae,JSON.stringify({version:1,files:s},null,2))}async#s(e,t,o,n,s){if(n.persistence.outputCount=t.length,t.length===0)n.persistence.status="not_needed";else if(o.persistOutput){n.persistence.status="running";for(let i of t){await s({type:"persistence",output:i,status:"started"});try{let c=Re(this.#o,e,i);await o.persistOutput({output:i,download:c}),n.persistence.persistedCount+=1,await s({type:"persistence",output:i,status:"succeeded"})}catch(c){let f=k(c);throw n.persistence.status="failed",n.persistence.error=f,await s({type:"persistence",output:i,status:"failed",error:f}),(o.cleanup??"keep")!=="keep"&&await this.#r(e,"stop",n,s),c}}n.persistence.status="complete"}else{if((o.cleanup??"keep")==="delete"&&!o.discardOutputs)throw n.persistence.status="failed",n.persistence.error="Deleting a Work sandbox with outputs requires persistOutput or discardOutputs: true",await this.#r(e,"stop",n,s),new Error(n.persistence.error);n.persistence.status="not_requested"}await this.#r(e,o.cleanup??"keep",n,s)}async#r(e,t,o,n){if(t!=="keep"){o.cleanup.status="running",await n({type:"cleanup",policy:t,status:"started"});try{let s=t==="delete"?await this.#o.delete(e):(await this.#o.stop(e)).sandbox;o.cleanup.finalSandboxState=s.state,o.cleanup.status=t==="delete"&&s.state==="deleted"||t==="stop"&&s.state==="stopped"?"complete":"pending",await n({type:"cleanup",policy:t,status:o.cleanup.status,sandboxState:s.state})}catch(s){let i=k(s);throw o.cleanup.status="failed",o.cleanup.error=i,await n({type:"cleanup",policy:t,status:"failed",error:i}),s}}}downloadOutput(e,t){return this.#o.downloadFileResponse(e,typeof t=="string"?t:t.path)}async#p(e){return await this.#o.mkdir(e,{path:H,recursive:!0}),Se(await this.#a(e))}async#i(e,t){return(await this.#a(e)).filter(n=>t.get(n.path)!==de(n)).sort((n,s)=>n.path.localeCompare(s.path)).slice(0,Oe).map(Ie)}async#a(e){return(await this.#o.listFiles(e,{path:H,recursive:!0,maxEntries:500})).files.filter(o=>o.type==="file"&&!ce(o.path).includes("/.openpond-"))}async#l(e){if(e.sandboxId){let n=await this.#o.get(e.sandboxId);if(n.state==="stopped")await this.#o.start(n.id,{async:!0});else if(n.state==="deleted"||n.state==="error")throw new Error(`Cannot resume sandbox ${n.id} in state ${n.state}`);return await this.#d(n.id,e.signal)}let t=e.budgetUsd?.trim()||"1.00",o=await this.#o.create({...e.repo?.trim()?{repo:e.repo.trim()}:{},runtimeProfileId:"openpond-work-v1",resources:{cpu:2,memoryGb:4,diskGb:16},budget:{maxUsd:t},quotas:{maxSpendUsd:t,maxDurationSeconds:3600,idleTimeoutSeconds:900,maxCommands:200,maxOpenPorts:4},metadata:{source:"openpond-sdk-work",...e.metadata}},{async:!0});return this.#d(o.id,e.signal)}async#d(e,t){let o=Date.now()+72e4,n=await this.#o.get(e);for(;Date.now()<o;){if(t?.throwIfAborted(),n.state==="running")return n;if(n.state==="error"||n.state==="deleted")throw new Error(`Sandbox ${n.id} entered ${n.state}${n.logs.length?`: ${n.logs.join(`
3
+ `)}`:""}`);await Ae(2e3,t),n=await this.#o.get(e)}throw new Error(`Sandbox ${e} did not become ready before timeout`)}async#u(e,t,o,n,s){let i=t.id||`work_tool_${o}`,c=t.function?.name;if(c!=="run_command")return P(i,{error:`Unknown tool: ${c??"missing"}`});let f;try{f=JSON.parse(t.function?.arguments||"{}")}catch(p){return P(i,{error:`Invalid tool arguments: ${k(p)}`})}let g=typeof f.command=="string"?f.command.trim():"";if(!g)return P(i,{error:"command is required"});if(g.length>N){let p=`command exceeds the ${N} character limit`;return await s({type:"tool",toolCallId:i,command:g,status:"failed",output:p}),P(i,{status:"failed",error:p})}await s({type:"tool",toolCallId:i,command:g,status:"started"});try{let p=await this.#o.exec(e,{command:g,timeoutSeconds:ie(n,1,900,180)}),u=Le(p.command.output,Pe),h=p.command.status==="succeeded"?"succeeded":"failed";return await s({type:"tool",toolCallId:i,command:g,status:h,output:u,exitCode:p.command.exitCode}),P(i,{status:p.command.status,exitCode:p.command.exitCode,output:u})}catch(p){if(p instanceof j)throw p;let u=k(p);return await s({type:"tool",toolCallId:i,command:g,status:"failed",output:u}),P(i,{status:"failed",error:u})}}},be=[{type:"function",function:{name:"run_command",description:"Run a shell command inside the persistent OpenPond sandbox. Use standard shell tools to inspect, edit, build, and test files. Commands start in the repository workspace.",parameters:{type:"object",additionalProperties:!1,properties:{command:{type:"string",minLength:1,maxLength:N,description:"Shell command to execute."}},required:["command"]}}}];function ke(r,e){return["You are OpenPond Work, a careful coding agent operating in an isolated Linux sandbox.",`The active sandbox is ${r}.`,...e?[`Caller-provided durable files are staged under ${D}; structured metadata is in ${ae}.`]:[],"Use run_command to inspect the workspace, edit files, and validate your work.",`Place completed user-facing files in ${H}. The runtime collects new and revised files there automatically when the turn completes.`,"Do the requested work completely. Preserve existing user changes and avoid destructive commands.","Keep the user informed with concise prose, but call tools whenever verification or file changes are needed.","Before finishing, run relevant tests and summarize the concrete result."].join(`
4
+ `)}d(ke,"systemPrompt");function xe(r){return{cleanupPolicy:r,persistence:{status:"not_requested",outputCount:0,persistedCount:0},cleanup:{status:"not_requested"}}}d(xe,"initialLifecycle");function Re(r,e,t){let o=null;return()=>(o??=r.downloadFileResponse(e,{path:t.path,maxBytes:Math.max(1,t.sizeBytes)}).then(n=>{let s=Buffer.byteLength(n.file.contentsBase64,"base64");if(n.file.truncated||n.file.returnedBytes!==n.file.totalSizeBytes||s!==t.sizeBytes)throw new Error(`Output download was incomplete for ${t.name}`);return n}),o)}d(Re,"lazyOutputDownload");function Ce(r,e,t){let o=r.id.replace(/[^a-zA-Z0-9._-]+/g,"-").slice(0,80)||`input-${e+1}`,n=r.name.replace(/[^a-zA-Z0-9._-]+/g,"-").slice(-120)||"file",s=`${o}-${n}`,i=s,c=1;for(;t.has(i);)c+=1,i=`${s}-${c}`;return t.add(i),i}d(Ce,"uniqueInputName");function se(r,e,t){!r||typeof r!="object"||Object.assign(r,{workLifecycle:e,...t?{workFinalizationError:k(t)}:{}})}d(se,"attachWorkFailure");function Se(r){return new Map(r.map(e=>[e.path,de(e)]))}d(Se,"outputSignatures");function de(r){return`${r.sizeBytes}:${r.updatedAt}`}d(de,"outputSignature");function Ie(r){let e=ce(r.path).split("/").at(-1)||r.path,t=ve(e);return{path:r.path,name:e,mimeType:t,sizeBytes:r.sizeBytes,updatedAt:r.updatedAt,isBinary:r.isBinary??null,previewable:r.previewable??(t.startsWith("image/")||t==="application/pdf"||t.startsWith("text/"))}}d(Ie,"workOutputFromFile");function ce(r){return r.replaceAll("\\","/")}d(ce,"normalizedOutputPath");function ve(r){let e=r.toLowerCase().match(/\.[^.]+$/)?.[0]??"";return We[e]??"application/octet-stream"}d(ve,"workOutputMimeType");var We=Object.freeze({".avif":"image/avif",".csv":"text/csv",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".gif":"image/gif",".html":"text/html",".jpeg":"image/jpeg",".jpg":"image/jpeg",".json":"application/json",".m4a":"audio/mp4",".md":"text/markdown",".mov":"video/quicktime",".mp3":"audio/mpeg",".mp4":"video/mp4",".pdf":"application/pdf",".png":"image/png",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".svg":"image/svg+xml",".tsv":"text/tab-separated-values",".txt":"text/plain",".wav":"audio/wav",".webm":"video/webm",".webp":"image/webp",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});function P(r,e){return{role:"tool",tool_call_id:r,content:JSON.stringify(e)}}d(P,"toolMessage");function ie(r,e,t,o){return Number.isFinite(r)?Math.min(t,Math.max(e,Math.floor(r))):o}d(ie,"boundedInteger");function Le(r,e){return r.length<=e?r:`${r.slice(0,e)}
5
+ \u2026 output truncated by openpond-sdk`}d(Le,"truncate");function k(r){return r instanceof Error?r.message:String(r)}d(k,"errorMessage");function Ae(r,e){return new Promise((t,o)=>{if(e?.aborted){o(e.reason);return}let n=setTimeout(t,r);n.unref?.(),e?.addEventListener("abort",()=>{clearTimeout(n),o(e.reason)},{once:!0})})}d(Ae,"sleep");import{promises as pe}from"node:fs";var R=class{static{d(this,"OpenPondProjectActionsClient")}#e;#t;constructor(e){this.#e=e.apiKey,this.#t=e.apiBaseUrl.replace(/\/+$/,"")}async list(e){let t=await y(this.#t,this.#e,T(e.projectId,"releases",e.teamId));return(await w(t,"List Project Action releases")).releases}async catalog(e){let t=await y(this.#t,this.#e,T(e.projectId,"catalog",e.teamId));return(await w(t,"Get Project Action catalog")).catalog}async publish(e){let[t,o]=await Promise.all([pe.readFile(e.build.bundlePath),pe.readFile(e.build.runnerPath)]),n=await y(this.#t,this.#e,T(e.projectId,"releases",e.teamId),{method:"POST",body:JSON.stringify({sourceRef:e.sourceRef,sourceCommitSha:e.sourceCommitSha,bundleBase64:t.toString("base64"),runnerBase64:o.toString("base64"),registry:e.build.registry,manifest:e.build.manifest,metadata:e.metadata})});return(await w(n,"Publish Project Actions")).release}async run(e){let t=await y(this.#t,this.#e,T(e.projectId,`actions/${encodeURIComponent(e.actionId)}`,e.teamId),{method:"POST",body:JSON.stringify({input:e.value??{},releaseId:e.releaseId,idempotencyKey:e.idempotencyKey,callerType:e.callerType??"sdk",callerId:e.callerId}),signal:e.signal,timeoutMs:9e5});return(await w(t,"Run Project Action")).invocation}};function T(r,e,t){return`/v1/project-actions/${encodeURIComponent(r)}/${e}?teamId=${encodeURIComponent(t)}`}d(T,"projectActionPath");var S=class{static{d(this,"OpenPondProfileActionsClient")}#e;#t;constructor(e){this.#e=e.apiKey,this.#t=e.apiBaseUrl.replace(/\/+$/,"")}async catalog(e){let t=C(e.teamId,"teamId"),o=new URLSearchParams({teamId:t});e.profileId?.trim()&&o.set("profileId",e.profileId.trim()),e.profileName?.trim()&&o.set("profileName",e.profileName.trim());let n=await y(this.#t,this.#e,`/v1/profile/actions?${o.toString()}`);return(await w(n,"Get Profile Action catalog")).catalog}async run(e){let t=C(e.teamId,"teamId"),o=C(e.actionKey,"actionKey"),n=C(e.idempotencyKey,"idempotencyKey"),s=C(e.catalogVersion,"catalogVersion"),i=await y(this.#t,this.#e,`/v1/profile/actions/run?${new URLSearchParams({teamId:t}).toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e.profileId?.trim()?{profileId:e.profileId.trim()}:{},...e.profileName?.trim()?{profileName:e.profileName.trim()}:{},actionKey:o,value:e.value??{},conversationId:e.conversationId??null,createConversation:e.createConversation,conversationTitle:e.conversationTitle??null,idempotencyKey:n,catalogVersion:s,externalCapabilityLeases:e.externalCapabilityLeases})});return w(i,"Run Profile Action")}};function C(r,e){let t=r.trim();if(!t)throw new Error(`${e} is required`);return t}d(C,"requiredValue");import{randomUUID as le}from"node:crypto";var I=class{static{d(this,"OpenPondWorkflowsClient")}#e;#t;constructor(e){this.#e=e.apiKey,this.#t=e.apiBaseUrl.replace(/\/+$/,"")}async list(e={}){return this.#n("","List Workflows",{signal:e.signal})}async create(e,t={}){return this.#n("","Create Workflow",{method:"POST",body:JSON.stringify({...e,clientRequestId:e.clientRequestId?.trim()||le()}),signal:t.signal})}async update(e,t,o={}){return this.#n(`/schedules/${encodeURIComponent(z(e,"scheduleId"))}`,"Update Workflow",{method:"PATCH",body:JSON.stringify(t),signal:o.signal})}async delete(e,t={}){return this.#n(`/schedules/${encodeURIComponent(z(e,"scheduleId"))}`,"Delete Workflow",{method:"DELETE",signal:t.signal})}async runNow(e,t={},o={}){return this.#n(`/schedules/${encodeURIComponent(z(e,"scheduleId"))}/run`,"Run Workflow",{method:"POST",body:JSON.stringify({clientRequestId:t.clientRequestId?.trim()||le()}),signal:o.signal})}async#n(e,t,o={}){let n=await y(this.#t,this.#e,`/v1/saved-work${e}`,o);return w(n,t)}};function z(r,e){let t=r.trim();if(!t)throw new Error(`${e} is required`);return t}d(z,"requiredId");var _=a.object({id:l,scope:l,sourceId:l,name:a.string().trim().min(1).max(100),keyPrefix:a.string().min(1).max(100),createdAt:a.iso.datetime(),expiresAt:a.iso.datetime(),revokedAt:a.iso.datetime().nullable()}).strict(),ue=a.string().regex(/^opk_key_[A-Za-z0-9]{16}_[A-Za-z0-9]{48}$/),q=a.discriminatedUnion("action",[a.object({action:a.literal("create"),scope:l,sourceId:l,name:a.string().trim().min(1).max(100),expiresAt:a.iso.datetime(),operationId:l,apiKey:ue}).strict(),a.object({action:a.literal("list"),scope:l,sourceId:l,afterId:l.optional(),limit:a.number().int().min(1).max(100).default(30)}).strict(),a.object({action:a.literal("revoke"),scope:l,sourceId:l,id:l}).strict()]),me=a.object({credential:_,apiKey:ue}).strict(),ge=a.object({items:a.array(_).max(100),nextCursor:l.nullable()}).strict(),he=a.object({scope:l,sourceId:l}).strict(),fe=a.object({scope:l,source:$,taskDefinition:$,enabled:a.boolean(),allowedSplits:a.array(Y).min(1).max(4)}).strict();var Te=a.object({batchId:a.string().trim().min(1).max(500),modelProjectId:a.string().trim().min(1).max(500)}).strict(),_e=a.object({batchId:a.string().min(1),projectId:a.string().min(1),tasksetId:a.string().min(1),releaseId:a.string().min(1),revision:a.number().int().positive(),contentHash:a.string().regex(/^[a-f0-9]{64}$/)}).strict(),m=class extends Error{constructor(t,o,n,s){super(n);this.status=t;this.code=o;this.details=s;this.name="OpenPondLearningError"}status;code;details;static{d(this,"OpenPondLearningError")}},v=class{static{d(this,"OpenPondLearningClient")}#e;constructor(e){if(!e.apiKey.trim()||!e.scope.trim())throw new Error("Learning API key and scope are required.");let t=new URL(e.baseUrl);if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.search||t.hash)throw new Error("Learning base URL must be an HTTP(S) endpoint without credentials, query, or fragment.");this.#e={...e,baseUrl:t.toString().replace(/\/+$/,"")}}async command(e,t={}){Q(e);let o=ee.parse({scope:this.#e.scope,command:e}),n=ne.parse(await this.#n("commands",o,t));if(n.operationId!==e.operationId)throw new m(502,"operation_identity_mismatch","Learning response did not match the submitted operation.",null);return n}submitExample(e,t={}){return this.command({action:"submit_example",operationId:e.idempotencyKey,example:e},t)}submitFeedback(e,t={}){return this.command({action:"submit_feedback",operationId:e.idempotencyKey,feedback:e},t)}async get(e,t,o,n={}){let s=b.parse({action:"get",scope:this.#e.scope,kind:e,id:t,...o===void 0?{}:{revision:o}});return M[e].parse(await this.#n("read",s,n))}async inspectEvidence(e,t={}){let o=b.parse({action:"inspect_evidence",scope:this.#e.scope,evidence:e}),n=te.parse(await this.#n("read",o,t));if(!F(n.evidence,e))throw new m(502,"evidence_identity_mismatch","Inspection did not match the requested evidence release.",null);return n}async inspectPolicy(e,t={}){let o=b.parse({action:"inspect_policy",scope:this.#e.scope,policy:e}),n=G.parse(await this.#n("read",o,t));if(!F(n.policy,e))throw new m(502,"policy_identity_mismatch","Inspection did not match the requested policy release.",null);return n}async createSourceCredential(e,t={}){let o=q.parse({...e,action:"create",scope:this.#e.scope}),n=me.parse(await this.#n("credentials",o,t));if(this.#t(n.credential,e.sourceId),n.apiKey!==e.apiKey||!e.apiKey.startsWith(`${n.credential.keyPrefix}_`))throw new m(502,"credential_identity_mismatch","Credential response did not match the prepared credential.",null);return n}async listSourceCredentials(e,t={},o={}){let n=q.parse({...t,action:"list",scope:this.#e.scope,sourceId:e}),s=ge.parse(await this.#n("credentials",n,o));if(s.items.length>(t.limit??30))throw new m(502,"credential_page_invalid","Credential response exceeded the requested page size.",null);for(let i of s.items)this.#t(i,e);return s}async revokeSourceCredential(e,t,o={}){let n=q.parse({action:"revoke",scope:this.#e.scope,sourceId:e,id:t}),s=_.parse(await this.#n("credentials",n,o));if(this.#t(s,e),s.id!==t||s.revokedAt===null)throw new m(502,"credential_revocation_mismatch","Credential revocation did not match the requested credential.",null);return s}async sourceConfiguration(e,t={}){let o=he.parse({scope:this.#e.scope,sourceId:e}),n=fe.parse(await this.#n("source-config",o,t));if(n.scope!==this.#e.scope||n.source.id!==e)throw new m(502,"source_identity_mismatch","Source configuration did not match the requested source.",null);return n}#t(e,t){if(e.scope!==this.#e.scope||e.sourceId!==t)throw new m(502,"credential_scope_mismatch","Credential response did not match the requested source.",null)}async list(e,t={},o={}){let n=b.parse({action:"list",scope:this.#e.scope,kind:e,...t});return a.object({items:a.array(M[e]).max(100),nextCursor:a.string().nullable()}).strict().parse(await this.#n("read",n,o))}async publishBatch(e,t={}){let o=Te.parse(e),n=_e.parse(await this.#n("publish-batch",{...o,scope:this.#e.scope},t));if(n.batchId!==o.batchId)throw new m(502,"batch_identity_mismatch","Published batch response did not match the requested batch.",null);return n}async#n(e,t,o){K(t,16777216);let n=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/learning/${e}`,{method:"POST",headers:{Authorization:`Bearer ${this.#e.apiKey}`,"Content-Type":"application/json",Accept:"application/json","X-OpenPond-Team-Id":this.#e.scope},body:JSON.stringify(t),signal:o.signal,redirect:"error"}),s=await qe(n);if(!n.ok){let i=a.object({code:a.string().optional(),error:a.string().optional()}).passthrough().safeParse(s);throw new m(n.status,i.success?i.data.code??"learning_request_failed":"learning_request_failed",i.success?i.data.error??`Learning request failed (${n.status}).`:`Learning request failed (${n.status}).`,s)}return s}};async function qe(r){let t=r.body?.getReader();if(!t)throw new m(r.status,"empty_response","Learning response was empty.",null);let o=new TextDecoder,n=0,s="";try{for(;;){let c=await t.read();if(c.done)break;if(n+=c.value.byteLength,n>16777216)throw new m(r.status,"response_too_large","Learning response exceeded 16 MiB; request a smaller page.",null);s+=o.decode(c.value,{stream:!0})}s+=o.decode();let i=JSON.parse(s);return K(i,16777216),i}finally{await t.cancel(),t.releaseLock()}}d(qe,"readBoundedLearningResponse");var J=class{static{d(this,"OpenPondClient")}sandboxes;work;workflows;actions;profileActions;learning;constructor(e){let t=e.apiKey.trim();if(!t)throw new Error("OpenPond API key is required");let o=e.baseUrl?.trim()||"https://api.openpond.ai";this.learning=n=>new v({apiKey:t,baseUrl:o,scope:n}),this.sandboxes=Z({apiKey:t,baseUrl:o,sandboxApiUrl:e.sandboxApiUrl}),this.work=new x({apiKey:t,apiBaseUrl:o,chatApiBaseUrl:e.chatApiUrl?.trim()||E({apiBaseUrl:o,env:{}}),sandboxes:this.sandboxes}),this.workflows=new I({apiKey:t,apiBaseUrl:o}),this.actions=new R({apiKey:t,apiBaseUrl:o}),this.profileActions=new S({apiKey:t,apiBaseUrl:o})}};function _t(r){return new J(r)}d(_t,"createOpenPondClient");export{_t as a};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a,b as s}from"./chunk-GLUWATL5.js";import{a as n}from"./chunk-FTQLQJQV.js";var p=new URL(s).hostname,c=new URL(a).hostname;function b(r){let t=typeof r.account=="string"?r.account:typeof r.profile=="string"?r.profile:null;if(!t)return null;let e=t.trim();if(!e||e==="true")throw new Error("account must be a non-empty value");return e}n(b,"resolveAccountOption");function d(r){let t=typeof r.baseUrl=="string"?r.baseUrl:typeof r.baseurl=="string"?r.baseurl:null;if(!t)return null;let e=t.trim();if(!e||e==="true")throw new Error("baseurl must be a non-empty value");return e.replace(/\/$/,"")}n(d,"resolveBaseUrlOption");function w(r){let t=typeof r.apiBaseUrl=="string"?r.apiBaseUrl:typeof r.apiBaseurl=="string"?r.apiBaseurl:null;if(!t)return null;let e=t.trim();if(!e||e==="true")throw new Error("api-base-url must be a non-empty value");return e.replace(/\/$/,"")}n(w,"resolveApiBaseUrlOption");function h(r){let t=typeof r.chatApiBaseUrl=="string"?r.chatApiBaseUrl:typeof r.chatApiBaseurl=="string"?r.chatApiBaseurl:typeof r.chatApiUrl=="string"?r.chatApiUrl:null;if(!t)return null;let e=t.trim();if(!e||e==="true")throw new Error("chat-api-base-url must be a non-empty value");return e.replace(/\/$/,"")}n(h,"resolveChatApiBaseUrlOption");function A(r){let t=typeof r.sandboxApiUrl=="string"?r.sandboxApiUrl:typeof r.sandboxApiurl=="string"?r.sandboxApiurl:null;if(!t)return null;let e=t.trim();if(!e||e==="true")throw new Error("sandbox-api-url must be a non-empty value");return e.replace(/\/$/,"")}n(A,"resolveSandboxApiUrlOption");function B(r){return(process.env.OPENPOND_BASE_URL||r.baseUrl||a).replace(/\/$/,"")}n(B,"resolveBaseUrl");function m(r){if(!r)return null;let t=r.replace(/\/$/,"");try{let o=new URL(t).hostname.toLowerCase();if(o===c||o==="openpond.live"||o==="www.openpond.live")return s;if(o===p||o.startsWith("api."))return t}catch{return null}return null}n(m,"mapUiBaseToApiBase");function E(r){let t=process.env.OPENPOND_API_URL,e=r?.apiBaseUrl?.trim(),o=m(process.env.OPENPOND_BASE_URL||r?.baseUrl);return(t||e||o||s).replace(/\/$/,"")}n(E,"resolvePublicApiBaseUrl");function O(r,t){let e=r.trim();if(!e)throw new Error("template must be non-empty");if(e.startsWith("http://")||e.startsWith("https://"))return e.endsWith(".git")?e:`${e}.git`;let o=t.replace(/\/$/,""),[l,i]=e.includes("/")?e.split("/",2):["openpondai",e],u=i.endsWith(".git")?i.slice(0,-4):i;if(!l||!u)throw new Error("template must be <owner>/<repo> or a full https URL");return`${o}/${l}/${u}.git`}n(O,"normalizeTemplateRepoUrl");export{b as a,d as b,w as c,h as d,A as e,B as f,m as g,E as h,O as i};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{i as a,j as b,k as c}from"./chunk-VCLCFK3O.js";import"./chunk-VYUMTRB3.js";import"./chunk-5BBVEWG3.js";import"./chunk-BBG546O6.js";import"./chunk-FY7OQ5RK.js";import"./chunk-F65NIZLM.js";import"./chunk-6MI4KKWF.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-6FA3GG5B.js";import"./chunk-UKUVMXOW.js";import"./chunk-OG5Q6NXK.js";import"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as resolveWebLaunchMessages,c as runOpenPondAppServerCli,b as runOpenPondServerCli};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as f}from"./chunk-C5LOZSVS.js";import{$a as I,Ba as J,Qa as N,Ra as q,Ua as k,Wa as A,Xa as B,_a as H,b as d,c as w,e as b,hb as E,ib as M,ja as C,jb as T,la as m,ma as j,na as x,oa as F,pa as v,qa as P}from"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import{d as O,f as S,h as g}from"./chunk-H7IWJN7L.js";import"./chunk-XDHAGACI.js";import"./chunk-3M53YXEI.js";import{a as l}from"./chunk-FTQLQJQV.js";import R from"node:path";import{readFile as p}from"node:fs/promises";var n=l((t,s)=>typeof t[s]=="string"?t[s]:void 0,"stringOption");function a(t){console.log(JSON.stringify(t,null,2))}l(a,"print");function U(t,s){let i=n(t,"keyPath");if(i){let r=JSON.parse(i);if(Array.isArray(r)&&r.length&&r.every(c=>typeof c=="string"&&c.length))return r;throw new f("--key-path must be a JSON array of key segments.")}if(!s)throw new f("Specify a setting key, or --key-path for keys containing dots.");return s.split(".")}l(U,"keyPath");async function G(t,s){let i=S({home:n(t,"home")}),r=s[0]??"get",c=g(i).config;if(r==="path"){console.log(c);return}if(r==="export"){let e=await T(i),o=n(t,"file");o?(await b(R.resolve(o),JSON.stringify(e,null,2),{privateParent:!1}),a({path:R.resolve(o),requiresRebinding:e.requiresRebinding})):a(e);return}if(r==="backup"||r==="restore"){let e=n(t,"file"),o=n(t,"keyFile");if(!e||!o)throw new f(`config ${r} requires --file <encrypted-backup> and --key-file <separate-32-byte-key-file>.`);let u=await p(o),y=u.length===32?u:Buffer.from(u.toString("utf8").trim(),"base64");try{a(r==="backup"?await E(i,e,y):await M(e,i,y))}finally{y.fill(0),u.fill(0)}return}if(r==="collect-orphans"){a(await N(i));return}if(r==="schema"){a(F());return}if(r==="migrate"){let e=n(t,"resolutionFile"),o=e?q.parse(JSON.parse(await p(e,"utf8"))):void 0;a(await k(i,{resolutions:o,sourceAppHome:n(t,"sourceAppHome"),sourceConfig:n(t,"sourceConfig"),sourceBrowserState:n(t,"sourceBrowserState"),dryRun:t.dryRun===!0||t.dryRun==="true"}));return}if(r==="recover"){let e=n(t,"revision");a(e?await x(i,e,n(t,"expectedRevision")??d(await w(c))):await A(i));return}if(r==="restart-migration"){a(await B(i));return}if(r==="effective"){a(await I(i,{projectRoot:n(t,"projectRoot"),accountId:n(t,"accountId")}));return}if(r==="trust"||r==="untrust"){let e=n(t,"projectRoot")??s[1];if(!e)throw new f("Specify the canonical project root with --project-root.");await H(i,e,n(t,"accountId")??"local",r==="trust"),a({root:e,trusted:r==="trust"});return}if(r==="revisions"){a(await m(i));return}if(r==="validate"){let e=n(t,"file")??c;C(await p(e,"utf8"),e,t.project===!0||t.project==="true"?"project":"user"),a({valid:!0,path:e});return}if(r==="replace"){let e=n(t,"file");if(!e)throw new f("config replace requires --file <validated-toml-file>.");a(await j(i,n(t,"expectedRevision")??d(await w(c)),await p(e,"utf8")));return}if(r==="doctor"){let e=await w(c),o=null;try{await v(i)}catch(u){o=O(u,c)}a({home:i,path:c,rawRevision:d(e),issue:o,recoverableRevisions:await m(i),migration:await w(R.join(g(i).runtime,"migration.json"))!==null}),o&&(process.exitCode=1);return}if(await k(i),r==="clear-cache"){await J(i),a({cleared:!0,path:g(i).cache});return}let h=await v(i);if(r==="get"){if(!s[1]&&!t.keyPath){a(h);return}let e=h.document;for(let o of U(t,s[1]))e=e&&typeof e=="object"?e[o]:void 0;a(e??null);return}if(r==="set"||r==="unset"){let e=U(t,s[1]),o;if(r==="set"){let u=n(t,"value")??s[2];if(u===void 0)throw new f("config set requires a value. Use JSON for arrays, tables, numbers and booleans.");try{o=JSON.parse(u)}catch{o=u}}a(await P(i,n(t,"expectedRevision")??h.rawRevision,[r==="set"?{op:"set",path:e,value:o}:{op:"unset",path:e}]));return}throw new f(`Unknown config command: ${r}`)}l(G,"runConfigurationCommand");export{G as runConfigurationCommand};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as V,c as D}from"./chunk-BZMVB3GS.js";import{a as M}from"./chunk-6MI4KKWF.js";import{a as J}from"./chunk-6FA3GG5B.js";import{c as U}from"./chunk-ZVOO7FKM.js";import"./chunk-GLUWATL5.js";import{b as n}from"./chunk-ES2ISFJC.js";import{c as k,f as O,g as te,h as q}from"./chunk-3M53YXEI.js";import{a as d}from"./chunk-FTQLQJQV.js";import{readFile as ge,writeFile as ye}from"node:fs/promises";import E from"node:path";import{createInterface as Ee}from"node:readline/promises";var Ae=Object.freeze({init:"openpond continual init --from ./tasks.jsonl",validate:"openpond continual validate ./continual-support.yaml",run:"openpond continual run ./continual-support.yaml",report:"openpond continual report <comparison-series-id>"});import{createHash as ke}from"node:crypto";function W(e){return`${JSON.stringify(G(e),null,2)}
3
+ `}d(W,"canonicalJson");function w(e){return ke("sha256").update(W(e)).digest("hex")}d(w,"contentHash");function G(e){return Array.isArray(e)?e.map(G):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).sort(([s],[t])=>s.localeCompare(t)).map(([s,t])=>[s,G(t)])):e}d(G,"normalize");function oe(e){let s=e.semanticSimilarityThreshold??.8;if(!(s>0&&s<=1))throw new Error("semanticSimilarityThreshold must be in (0, 1].");let t=new Set((e.allowSharedFamiliesBetween??[]).flatMap(([a,c])=>[`${a}\0${c}`,`${c}\0${a}`])),o=[];for(let a=0;a<e.panels.length;a+=1){let c=e.panels[a];for(let i=a+1;i<e.panels.length;i+=1){let f=e.panels[i];for(let l of c.tasks)for(let m of f.tasks){let g={leftPanel:c.id,rightPanel:f.id,leftTaskId:l.id,rightTaskId:m.id};if(l.id===m.id?o.push({...g,kind:"duplicate_id",similarity:1}):l.contentHash===m.contentHash&&o.push({...g,kind:"duplicate_content",similarity:1}),l.familyId===m.familyId&&!t.has(`${c.id}\0${f.id}`)&&o.push({...g,kind:"family_overlap",similarity:null}),l.prompt&&m.prompt){let u=Ie(l.prompt,m.prompt);u>=s&&o.push({...g,kind:"prompt_overlap",similarity:u})}}}}let r={schemaVersion:"openpond.continualBenchLeakageAudit.v1",threshold:s,findings:o.sort((a,c)=>JSON.stringify(a).localeCompare(JSON.stringify(c)))};return{...r,contentHash:w(r)}}d(oe,"auditContinualBenchLeakage");function Ie(e,s){let t=d(i=>new Set(i.toLowerCase().match(/[a-z0-9]+/g)??[]),"tokens"),o=t(e),r=t(s),a=new Set([...o,...r]);if(!a.size)return 1;let c=0;for(let i of o)r.has(i)&&(c+=1);return c/a.size}d(Ie,"jaccard");var S=n.string().trim().min(1).max(240),j=n.string().regex(/^[a-f0-9]{64}$/),Xe=n.object({id:S,contentHash:j}).strict(),ve=n.object({id:S,familyId:S,contentHash:j,prompt:n.string().max(1e6).optional(),payload:n.record(n.string(),n.unknown()).optional()}).strict(),Se=n.object({id:S,role:M,passLabel:S.nullable(),taskIds:n.array(S).min(1).max(1e6),disclosurePhase:n.enum(["review","evaluation","final"]),optimizerEligible:n.boolean()}).strict().superRefine((e,s)=>{let t=e.role==="correction"||e.role==="training_eligible";e.optimizerEligible!==t&&s.addIssue({code:"custom",path:["optimizerEligible"],message:"Only correction and training-eligible panels may be optimizer eligible."}),e.role==="frozen_final"&&e.disclosurePhase!=="final"&&s.addIssue({code:"custom",path:["disclosurePhase"],message:"The frozen-final panel may only be disclosed in the final phase."}),new Set(e.taskIds).size!==e.taskIds.length&&s.addIssue({code:"custom",path:["taskIds"],message:"Panel task ids must be unique."})}),Pe=n.object({label:S,familyIds:n.array(S).min(1).max(1e5)}).strict(),xe=n.object({adapter:n.literal("openpond"),apiBaseUrl:n.string().url().optional(),series:n.record(n.string(),n.unknown())}).strict(),T=n.object({schemaVersion:n.literal("openpond.continualBenchManifest.v1"),id:S,revision:n.number().int().positive(),name:n.string().trim().min(1).max(500),description:n.string().trim().min(1).max(2e4),license:n.string().trim().min(1).max(100),source:n.object({repository:n.string().trim().min(1).max(2e3).nullable(),commit:n.string().trim().min(1).max(500).nullable(),generatedBy:n.string().trim().min(1).max(2e3)}).strict(),split:n.object({seed:S,correctionCasesPerFamily:n.number().int().positive().max(100),correctionSelection:n.enum(["stable_hash","minimize_prompt_similarity"]),semanticSimilarityThreshold:n.number().gt(0).lte(1)}).strict(),passes:n.array(Pe).min(1).max(1e3),tasks:n.array(ve).min(1).max(1e6),panels:n.array(Se).min(1).max(1e5),grader:n.object({id:S,contentHash:j,outcomeScale:n.object({minimum:n.number().finite(),maximum:n.number().finite()}).strict()}).strict(),evaluation:n.object({seeds:n.array(n.number().int()).min(1).max(100),repetitions:n.number().int().positive().max(100),confidenceLevel:n.number().gt(0).lt(1),pairedBootstrapSamples:n.number().int().min(1e3).max(1e6)}).strict(),execution:xe.optional(),contentHash:j}).strict().superRefine((e,s)=>{let t=e.tasks.map(i=>i.id);new Set(t).size!==t.length&&s.addIssue({code:"custom",path:["tasks"],message:"Manifest task ids must be unique."});let o=new Set(t);for(let[i,f]of e.panels.entries())f.taskIds.some(l=>!o.has(l))&&s.addIssue({code:"custom",path:["panels",i,"taskIds"],message:"Every panel task must exist in the manifest inventory."});let r=e.passes.map(i=>i.label);new Set(r).size!==r.length&&s.addIssue({code:"custom",path:["passes"],message:"Pass labels must be unique."});let a=new Set(e.tasks.map(i=>i.familyId)),c=e.passes.flatMap(i=>i.familyIds);new Set(c).size!==c.length&&s.addIssue({code:"custom",path:["passes"],message:"An issue family may belong to only one pass."}),c.some(i=>!a.has(i))&&s.addIssue({code:"custom",path:["passes"],message:"Every assigned family must exist in the task inventory."})});function se(e){return T.parse({...e,contentHash:w(e)})}d(se,"sealPortableManifest");function ie(e){let s=T.parse(e),{contentHash:t,...o}=s;return t===w(o)}d(ie,"verifyPortableManifest");var L=n.string().trim().min(1).max(240),K=n.string().regex(/^[a-f0-9]{64}$/),Y=n.number().finite().nullable(),Ce=n.object({attemptId:L,seed:n.number().int(),repetition:n.number().int().nonnegative(),score:Y,passed:n.boolean().nullable(),latencyMs:n.number().nonnegative().nullable(),costUsd:n.number().nonnegative().nullable(),transcript:n.object({path:n.string().min(1),contentHash:K}).strict().nullable(),trace:n.object({path:n.string().min(1),contentHash:K}).strict().nullable(),graderOutputHash:K.nullable(),status:n.enum(["completed","failed","cancelled"])}).strict(),re=n.object({targetId:L,panelId:L,panelRole:M,taskId:L,familyId:L,attempts:n.array(Ce).min(1).max(1e4),meanScore:Y,passRate:Y,confidenceInterval:n.tuple([n.number().finite(),n.number().finite()]).nullable()}).strict(),ae=n.object({targetId:L,trainingGpuSeconds:n.number().nonnegative().nullable(),evaluationGpuSeconds:n.number().nonnegative().nullable(),providerSpendUsd:n.number().nonnegative().nullable(),totalSpendUsd:n.number().nonnegative().nullable(),durationSeconds:n.number().nonnegative().nullable(),optimizerGroups:n.number().int().nonnegative().nullable(),trajectories:n.number().int().nonnegative().nullable()}).strict(),le=n.enum(["systems_complete","correction_absorbed","issue_generalized","continually_current","frontier_pareto_result","inconclusive","loss"]);function ce(e){let s=[],t=[...e.families].sort((o,r)=>o.passLabel.localeCompare(r.passLabel));for(let o of t)s.push(F({id:`${o.passLabel.toLowerCase()}-correction`,role:"correction",passLabel:o.passLabel,taskIds:o.correctionTaskIds,familyIds:[o.familyId],optimizerEligible:!0})),s.push(F({id:`${o.passLabel.toLowerCase()}-siblings`,role:"sibling_verification",passLabel:o.passLabel,taskIds:o.siblingTaskIds,familyIds:[o.familyId],optimizerEligible:!1}));for(let o=0;o<t.length;o+=1){let r=t.slice(0,o+1);s.push(F({id:`known-${r[o].passLabel.toLowerCase()}`,role:"cumulative_known",passLabel:r[o].passLabel,taskIds:r.flatMap(a=>[...a.correctionTaskIds,...a.siblingTaskIds]),familyIds:r.map(a=>a.familyId),optimizerEligible:!1}))}return s.push(F({id:"training-eligible",role:"training_eligible",passLabel:null,taskIds:t.flatMap(o=>o.correctionTaskIds),familyIds:t.map(o=>o.familyId),optimizerEligible:!0})),s}d(ce,"createContinualBenchPanelAllocations");function Q(e){let s=new Set(["sibling_verification","development","retained","frozen_final"]),t=new Set(e.panels.filter(a=>s.has(a.role)).flatMap(a=>a.taskIds)),r=e.panels.filter(a=>a.optimizerEligible).flatMap(a=>a.taskIds).filter(a=>t.has(a));if(r.length)throw new Error(`Hidden evaluation tasks are optimizer eligible: ${[...new Set(r)].sort().join(", ")}`)}d(Q,"assertOptimizerIsolation");function F(e){let s={...e,taskIds:[...e.taskIds].sort(),familyIds:[...e.familyIds].sort()};return{...s,contentHash:w(s)}}d(F,"sealPanel");function A(e){let s=T.safeParse(e);if(!s.success)return{valid:!1,manifestHash:null,leakageHash:null,issues:s.error.issues.map(i=>({severity:"error",code:"schema",message:i.message,path:i.path.join(".")}))};let t=s.data,o=[];ie(t)||o.push({severity:"error",code:"content_hash",message:"Manifest contentHash does not match its canonical payload.",path:"contentHash"});let r=new Map(t.tasks.map(i=>[i.id,i])),a=[];for(let i of t.passes){let f=t.panels.find(u=>u.role==="correction"&&u.passLabel===i.label),l=t.panels.find(u=>u.role==="sibling_verification"&&u.passLabel===i.label);if(!f||!l){o.push({severity:"error",code:"missing_holdout",message:`Pass ${i.label} requires both correction and sibling-verification panels.`,path:"panels"});continue}a.push([f.id,l.id]);let m=new Set(f.taskIds.map(u=>r.get(u)?.familyId)),g=new Set(l.taskIds.map(u=>r.get(u)?.familyId));for(let u of i.familyIds)(!m.has(u)||!g.has(u))&&o.push({severity:"error",code:"insufficient_family",message:`Pass ${i.label} family ${u} lacks a correction or sibling case; the holdout was not weakened.`,path:"passes"})}let c=oe({panels:t.panels.filter(i=>i.role!=="cumulative_known"&&i.role!=="training_eligible").map(i=>({id:i.id,tasks:i.taskIds.map(f=>{let l=r.get(f);return{id:l.id,familyId:l.familyId,contentHash:l.contentHash,prompt:l.prompt}})})),allowSharedFamiliesBetween:a,semanticSimilarityThreshold:t.split.semanticSimilarityThreshold});for(let i of c.findings)o.push({severity:"error",code:`leakage_${i.kind}`,message:`${i.leftTaskId} in ${i.leftPanel} overlaps ${i.rightTaskId} in ${i.rightPanel}.`,path:"panels"});return{valid:!o.some(i=>i.severity==="error"),manifestHash:t.contentHash,issues:o,leakageHash:c.contentHash}}d(A,"validateContinualBenchManifest");function de(e){let s=A(e);if(!s.valid)throw new Error(s.issues.map(t=>`${t.code}: ${t.message}`).join(`
4
+ `));return T.parse(e)}d(de,"requireValidContinualBenchManifest");var R=n.string().trim().min(1).max(240),me=n.string().regex(/^[a-f0-9]{64}$/),_e=n.object({id:R,label:n.string().trim().min(1).max(500),kind:n.enum(["candidate","accepted_head","base","master","external_reference"]),ordinal:n.number().int().nonnegative().nullable(),meanScore:n.number().finite().nullable(),confidenceInterval:n.tuple([n.number().finite(),n.number().finite()]).nullable(),taskMetrics:n.array(re).max(1e6),efficiency:ae.nullable(),evidenceUrl:n.string().url().nullable()}).strict(),pe=n.object({schemaVersion:n.literal("openpond.continualBenchReport.v1"),seriesId:R,protocol:n.object({id:R,revision:n.number().int().positive(),contentHash:me}).strict(),generatedAt:n.string().datetime({offset:!0}),status:n.enum(["partial","terminal"]),points:n.array(_e).min(1).max(1e4),outcomes:n.array(le).max(7),audit:n.array(n.object({requirement:R,status:n.enum(["passed","failed","unavailable"]),evidenceRefs:n.array(R).max(1e5)}).strict()).max(1e4),chart:n.object({x:n.literal("ordinal"),y:n.literal("meanScore"),series:n.array(n.object({pointId:R,label:n.string(),ordinal:n.number().nullable(),value:n.number().nullable(),lower:n.number().nullable(),upper:n.number().nullable(),kind:n.string()}).strict())}).strict(),contentHash:me}).strict();function ue(e){let s={x:"ordinal",y:"meanScore",series:e.points.map(o=>({pointId:o.id,label:o.label,ordinal:o.ordinal,value:o.meanScore,lower:o.confidenceInterval?.[0]??null,upper:o.confidenceInterval?.[1]??null,kind:o.kind}))},t={...e,chart:s};return pe.parse({...t,contentHash:w(t)})}d(ue,"createContinualBenchReport");function fe(e){let s=pe.parse(e),{contentHash:t,...o}=s;if(t!==w(o))throw new Error("Continual Support report content hash does not match its payload.");return W(s)}d(fe,"exportContinualBenchReport");function be(e){let s=e.correctionCasesPerFamily??1;if(!Number.isInteger(s)||s<1)throw new Error("correctionCasesPerFamily must be a positive integer.");let t=new Map,o=new Map;for(let l of e.tasks){if(t.has(l.id))throw new Error(`Duplicate task id: ${l.id}`);t.set(l.id,l);let m=o.get(l.familyId)??[];m.push(l),o.set(l.familyId,m)}let r=new Map;for(let l of e.passes){if(!l.label.trim())throw new Error("Pass labels cannot be empty.");for(let m of l.familyIds){if(r.has(m))throw new Error(`Family ${m} is assigned to more than one pass.`);r.set(m,l.label)}}let a=[],c=[],i=[];for(let[l,m]of[...o].sort(([g],[u])=>g.localeCompare(u))){let g=r.get(l);if(!g){i.push({code:"unassigned_family",familyId:l,taskCount:m.length});continue}let u=[...m].sort((y,v)=>{let P=w([e.seed,l,y.id,y.contentHash]),h=w([e.seed,l,v.id,v.contentHash]);return P.localeCompare(h)||y.id.localeCompare(v.id)});if(u.length<=s){i.push({code:"insufficient_siblings",familyId:l,taskCount:u.length});continue}e.correctionSelection==="minimize_prompt_similarity"&&s===1&&u.every(y=>y.prompt)&&(u=[...u].sort((y,v)=>{let P=he(y,u),h=he(v,u);return P-h||y.id.localeCompare(v.id)}));let I=u.slice(0,s),$=u.slice(s);a.push(...I.map(y=>({...y,passLabel:g,panelRole:"correction",optimizerEligible:!0})),...$.map(y=>({...y,passLabel:g,panelRole:"sibling_verification",optimizerEligible:!1}))),c.push({familyId:l,passLabel:g,correctionTaskIds:I.map(y=>y.id),siblingTaskIds:$.map(y=>y.id)})}for(let l of r.keys())if(!o.has(l))throw new Error(`Assigned family ${l} has no source tasks.`);let f={schemaVersion:"openpond.continualBenchSplit.v1",seed:e.seed,allocations:a.sort((l,m)=>l.passLabel.localeCompare(m.passLabel)||l.familyId.localeCompare(m.familyId)||l.id.localeCompare(m.id)),families:c.sort((l,m)=>l.passLabel.localeCompare(m.passLabel)||l.familyId.localeCompare(m.familyId)),advisories:i.sort((l,m)=>l.familyId.localeCompare(m.familyId)||l.code.localeCompare(m.code))};return{...f,contentHash:w(f)}}d(be,"createContinualBenchSplit");function he(e,s){return Math.max(...s.filter(t=>t.id!==e.id).map(t=>$e(e.prompt,t.prompt)))}d(he,"maximumSiblingSimilarity");function $e(e,s){let t=d(i=>new Set(i.toLowerCase().match(/[a-z0-9]+/g)??[]),"tokenize"),o=t(e),r=t(s),a=new Set([...o,...r]);if(!a.size)return 1;let c=0;for(let i of o)r.has(i)&&(c+=1);return c/a.size}d($e,"jaccard");async function et(e,s,t={}){let o=s[0];if(!o||!["init","validate","run","report"].includes(o))throw new Error("usage: openpond continual <init|validate|run|report> [manifest-or-series-id]");let r=t.log??console.log;if(o==="init"){await He(e,s.slice(1),t,r);return}if(o==="report"){await Re(e,s.slice(1),t,r);return}let a=s[1];if(!a||s.length!==2)throw new Error(`usage: openpond continual ${o} <manifest-path>`);let c=await ze(E.resolve(a),t.readFile??ge),i=A(c);if(o==="validate"){if(O(e.json))r(JSON.stringify(i,null,2));else{r(i.valid?`Valid Continual Support manifest ${i.manifestHash}.`:"Continual Support manifest is invalid."),r(`Leakage audit ${i.leakageHash??"unavailable"}; ${i.issues.length} finding(s).`);for(let l of i.issues)r(`${l.severity}: ${l.code} at ${l.path}: ${l.message}`)}if(!i.valid)throw Fe("Continual Support validation failed.",2);return}let f=de(c);Q(f),await Le(f,e,t,r)}d(et,"runContinualCommand");async function He(e,s,t,o){if(s.length)throw new Error("continual init accepts --from and --output options, not positional arguments.");let r=k(e,"from");if(!r)throw new Error("continual init requires --from <tasks.json|tasks.jsonl>.");let a=E.resolve(k(e,"output")||"continual-support.yaml"),c=await Be(E.resolve(r),t.readFile??ge),i=O(e.nonInteractive)||!process.stdin.isTTY,f=t.prompt??Me,l=await Oe(c,i,f),m=l.filter(p=>p.panelRole===null||p.panelRole==="correction"||p.panelRole==="sibling_verification"),g=[...new Map(m.map(p=>[p.passLabel,p])).keys()].sort().map(p=>({label:p,familyIds:[...new Set(m.filter(_=>_.passLabel===p).map(_=>_.familyId))].sort()})),u=l.map(p=>({id:p.id,familyId:p.familyId,contentHash:w(p.payload),...p.prompt?{prompt:p.prompt}:{},payload:p.payload})),I=be({tasks:m.map(p=>({id:p.id,familyId:p.familyId,contentHash:w(p.payload),prompt:p.prompt})),passes:g,seed:k(e,"seed")||"continual-support-v1",correctionCasesPerFamily:q(e.correctionCasesPerFamily,"correction-cases-per-family")??1,correctionSelection:k(e,"correctionSelection")==="stable_hash"?"stable_hash":"minimize_prompt_similarity"});if(I.advisories.length)throw new Error(`The proposed split is incomplete and was not weakened: ${I.advisories.map(p=>`${p.code}:${p.familyId}`).join(", ")}`);let $=ce(I).map(p=>({id:p.id,role:p.role,passLabel:p.passLabel,taskIds:p.taskIds,disclosurePhase:p.role==="sibling_verification"?"evaluation":"review",optimizerEligible:p.optimizerEligible})),y=["development","retained","frozen_final"];for(let p of y){let _=l.filter(x=>x.panelRole===p).map(x=>x.id).sort();_.length&&$.push({id:p.replace("_","-"),role:p,passLabel:null,taskIds:_,disclosurePhase:p==="frozen_final"?"final":"evaluation",optimizerEligible:!1})}let v=k(e,"id")||je(k(e,"name")||E.basename(r,E.extname(r))),P=k(e,"grader")||"user-supplied-grader-v1",h={schemaVersion:"openpond.continualBenchManifest.v1",id:v,revision:1,name:k(e,"name")||v,description:k(e,"description")||"A sealed continual-support workflow converted from an ordinary task set.",license:k(e,"license")||"UNSPECIFIED",source:{repository:k(e,"repository")||null,commit:k(e,"commit")||null,generatedBy:`openpond continual init --from ${r}`},split:{seed:I.seed,correctionCasesPerFamily:q(e.correctionCasesPerFamily,"correction-cases-per-family")??1,correctionSelection:k(e,"correctionSelection")==="stable_hash"?"stable_hash":"minimize_prompt_similarity",semanticSimilarityThreshold:te(e.semanticSimilarityThreshold,"semantic-similarity-threshold")??.8},passes:g,tasks:u,panels:$,grader:{id:P,contentHash:w({id:P}),outcomeScale:{minimum:0,maximum:1}},evaluation:{seeds:[1701,1709,1721],repetitions:3,confidenceLevel:.95,pairedBootstrapSamples:1e4}},H=se(h),ne=a.endsWith(".json")?`${JSON.stringify(H,null,2)}
5
+ `:J.dump(H,{noRefs:!0,lineWidth:120,sortKeys:!1});await(t.writeFile??ye)(a,ne,"utf8"),o(`Created ${a}.`),o(`Manifest ${H.contentHash}; split ${I.contentHash}.`)}d(He,"initializeManifest");async function Le(e,s,t,o){if(!e.execution)throw new Error("This manifest validates locally but needs an execution.openpond series binding before `continual run`.");let r={...e.execution.series},a=r.benchmarkProtocol,c=C(a?.issueFamilyLedger);if(!a||c.contentHash!==e.contentHash)throw new Error("execution.series.benchmarkProtocol.issueFamilyLedger must bind the exact sealed portable manifest hash.");let i=U(s)??e.execution.apiBaseUrl??process.env.OPENPOND_LOCAL_API_URL?.replace(/\/$/,"")??V,f=t.request??await D(i),l=C(await X(f,`${i}/v1/training/comparison-series`,"POST",{series:r})),m=b(l.id)||b(r.id),g=ee(l.revision);if(!m||!g)throw new Error("OpenPond did not return a Comparison Series identity and revision.");await X(f,`${i}/v1/training/comparison-series/${encodeURIComponent(m)}/seal`,"POST",{expectedRevision:g});let u=`/models/comparisons/${encodeURIComponent(m)}`,I={comparisonSeriesId:m,canonicalUrl:u,protocolHash:e.contentHash};o(O(s.json)?JSON.stringify(I,null,2):`Created and sealed Comparison Series ${m}.
6
+ ${u}
7
+ No release was queued or started.`)}d(Le,"submitManifest");async function Re(e,s,t,o){let r=s[0];if(!r||s.length!==1)throw new Error("usage: openpond continual report <comparison-series-id> [--output <path>]");let a=U(e)??process.env.OPENPOND_LOCAL_API_URL?.replace(/\/$/,"")??V,c=t.request??await D(a),i=C(await X(c,`${a}/v1/training`,"GET")),f=N(i.comparisonSeries).map(C).find(h=>h.id===r);if(!f)throw new Error(`Comparison Series ${r} was not found.`);let l=C(f.benchmarkProtocol),m=N(i.comparisonSeriesEntries).map(C).filter(h=>h.seriesId===r),g=N(i.modelCurrencySnapshots).map(C).filter(h=>h.seriesId===r),u=new Map(g.map(h=>[b(h.entryId),h])),I=m.filter(h=>b(h.modelVersionId)).map(h=>{let H=u.get(b(h.id)),p=N(H?.panels).map(C).map(B=>z(B.strictSuccess)).filter(B=>B!==null),_=p.length?p.reduce((B,we)=>B+we,0)/p.length:null,x=Z(H?.efficiency);return{id:b(h.id),label:b(h.label),kind:"candidate",ordinal:z(h.ordinal),meanScore:_,confidenceInterval:null,taskMetrics:[],efficiency:x?{targetId:b(h.modelVersionId),trainingGpuSeconds:z(x.gpuSeconds),evaluationGpuSeconds:null,providerSpendUsd:null,totalSpendUsd:z(x.costUsd),durationSeconds:z(x.latencyMs)===null?null:z(x.latencyMs)/1e3,optimizerGroups:null,trajectories:null}:null,evidenceUrl:`${a}/models/comparisons/${encodeURIComponent(r)}`}});if(!I.length)throw new Error(`Comparison Series ${r} has no receipt-derived candidate points to report.`);let $=m.every(h=>["candidate","accepted","rejected","no_signal","failed","cancelled"].includes(b(h.status)||"")),y=ue({schemaVersion:"openpond.continualBenchReport.v1",seriesId:r,protocol:{id:b(l.id),revision:ee(l.revision),contentHash:b(l.contentHash)},generatedAt:new Date().toISOString(),status:$?"terminal":"partial",points:I,outcomes:[],audit:[{requirement:"receipt-derived-points",status:"passed",evidenceRefs:I.map(h=>h.id)}]}),v=fe(y),P=k(e,"output");P?(await(t.writeFile??ye)(E.resolve(P),v,"utf8"),o(`Wrote ${E.resolve(P)} (${y.contentHash}).`)):o(v.trimEnd())}d(Re,"exportReport");async function ze(e,s){let t=await s(e,"utf8");return e.endsWith(".json")?JSON.parse(t):J.load(t)}d(ze,"loadStructuredFile");async function Be(e,s){let t=await s(e,"utf8"),o=e.endsWith(".jsonl")?t.split(/\r?\n/).filter(r=>r.trim()).map((r,a)=>{try{return JSON.parse(r)}catch{throw new Error(`Invalid JSONL at line ${a+1}.`)}}):JSON.parse(t);if(!Array.isArray(o)||!o.length)throw new Error("The source must contain a non-empty JSON array or JSONL sequence.");return o.map((r,a)=>Te(r,a))}d(Be,"readSourceRows");function Te(e,s){let t=C(e),o=b(t.id)||b(t.taskId)||b(t.task_id);if(!o)throw new Error(`Source row ${s+1} is missing id/taskId.`);let r=b(t.familyId)||b(t.family_id)||b(t.clusterKey),a=b(t.passLabel)||b(t.pass_label),c=b(t.panelRole)||b(t.panel_role);if(c&&!new Set(["correction","sibling_verification","cumulative_known","development","retained","frozen_final","training_eligible"]).has(c))throw new Error(`Source row ${o} has unsupported panel role ${c}.`);return{id:o,familyId:r,passLabel:a,panelRole:c,prompt:b(t.prompt)||b(Z(t.input)?.prompt)||void 0,payload:t}}d(Te,"normalizeSourceRow");async function Oe(e,s,t){let o=[],r=new Map;for(let a of e){let c=a.familyId;if(!c){if(s)throw new Error(`Task ${a.id} lacks familyId; non-interactive init never fabricates issue families.`);if(c=(await t(`Issue family for ${a.id}: `)).trim(),!c)throw new Error(`Task ${a.id} requires an issue family.`)}let i=a.passLabel;if(!a.panelRole||a.panelRole==="correction"||a.panelRole==="sibling_verification"){if(i=i||r.get(c)||null,!i){if(s)throw new Error(`Task family ${c} lacks passLabel; provide labels for CI.`);i=(await t(`Pass label for family ${c}: `)).trim()}if(!i)throw new Error(`Family ${c} requires a pass label.`);let f=r.get(c);if(f&&f!==i)throw new Error(`Family ${c} appears in both ${f} and ${i}.`);r.set(c,i)}o.push({...a,familyId:c,passLabel:i})}return o}d(Oe,"completeLabels");async function Me(e){let s=Ee({input:process.stdin,output:process.stdout});try{return await s.question(e)}finally{s.close()}}d(Me,"defaultPrompt");async function X(e,s,t,o){let r=await e(s,{method:t,headers:o===void 0?{Accept:"application/json"}:{Accept:"application/json","Content-Type":"application/json"},body:o===void 0?void 0:JSON.stringify(o)}),a=await r.text(),c=a?JSON.parse(a):null;if(!r.ok)throw new Error(`OpenPond request failed (${r.status}): ${b(Z(c)?.error)||r.statusText}`);return c}d(X,"requestJson");function C(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}d(C,"object");function Z(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}d(Z,"objectOrNull");function N(e){return Array.isArray(e)?e:[]}d(N,"array");function b(e){return typeof e=="string"&&e.trim()?e.trim():null}d(b,"string");function ee(e){return typeof e=="number"&&Number.isFinite(e)?e:null}d(ee,"number");function z(e){return ee(e)}d(z,"numberOrNull");function je(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"continual-support"}d(je,"slug");function Fe(e,s){return Object.assign(new Error(e),{exitCode:s})}d(Fe,"withExitCode");export{et as runContinualCommand};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"./chunk-MGN6GLNZ.js";import"./chunk-FGJ5LFPL.js";import"./chunk-ZVOO7FKM.js";import"./chunk-OGPHXXCD.js";import"./chunk-ZF7TEGY5.js";import"./chunk-SAE4OIPC.js";import"./chunk-UKUVMXOW.js";import"./chunk-CWQWV2T3.js";import"./chunk-OG5Q6NXK.js";import"./chunk-GLUWATL5.js";import"./chunk-C5LOZSVS.js";import"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-XDHAGACI.js";import"./chunk-3M53YXEI.js";import"./chunk-FTQLQJQV.js";export{m as resolveGitBranch,f as runAccount,j as runBacktestRun,p as runCheckUpdate,k as runDeployWatch,g as runHealth,d as runLogin,o as runOpentool,e as runProfiles,l as runRepoCreate,n as runRepoPush,b as runTemplateBranches,a as runTemplateStatus,c as runTemplateUpdate,h as runToolList,i as runToolRun};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{m as a,n as b,o as c,p as d,q as e,r as f,s as g}from"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as PERSISTENCE_TABLES_SQL,g as deleteLocalRecord,d as getLocalRecord,e as listLocalRecords,b as openStorageDatabase,f as putLocalRecord,c as withLocalDatabase};
@@ -0,0 +1,3 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{x as f}from"./chunk-FGJ5LFPL.js";import"./chunk-ZVOO7FKM.js";import"./chunk-OGPHXXCD.js";import"./chunk-ZF7TEGY5.js";import"./chunk-SAE4OIPC.js";import"./chunk-UKUVMXOW.js";import"./chunk-CWQWV2T3.js";import"./chunk-OG5Q6NXK.js";import"./chunk-GLUWATL5.js";import{a as c}from"./chunk-C5LOZSVS.js";import"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-XDHAGACI.js";import{c as p,f as u}from"./chunk-3M53YXEI.js";import{a as r}from"./chunk-FTQLQJQV.js";import d from"node:path";import{access as v}from"node:fs/promises";import{constants as C}from"node:fs";import{createRequire as P}from"node:module";var l=d.join("scripts","desktop-harness.ts");async function $(n,t){let o=await j({options:n,rest:t}),e=await f(o.command,o.args,{cwd:o.cwd,inherit:!0,timeoutMs:0});if(e.code!==0)throw new m(e.code)}r($,"runDesktopTestCommand");async function j(n){let t=n.options,o=n.rest,e=o[0];if(e!=="run"&&e!=="attach")throw new c(D());let a=o.slice(1);if(a.length===0)throw new c("usage: openpond desktop-test run <scenario...> [options]");let g=p(t,"cwd")||n.cwd||process.cwd(),w=await O(g),k=(n.env??process.env).OPENPOND_NODE_BINARY?.trim()||process.execPath,s=[P(import.meta.url).resolve("tsx/cli"),l,"run",...a],h=x(t,e);return h&&s.push(`--${h}`),i(s,"--app",t,"app"),i(s,"--server",t,"server"),i(s,"--token",t,"token"),i(s,"--token-file",t,"tokenFile"),i(s,"--devtools-port",t,"devtoolsPort"),i(s,"--artifacts-dir",t,"artifactsDir"),H(s,t),i(s,"--grep",t,"grep"),i(s,"--timeout-ms",t,"timeoutMs"),u(t.keepHome)&&s.push("--keep-home"),{command:k,args:s,cwd:w}}r(j,"buildDesktopHarnessInvocation");async function O(n){let t=d.resolve(n);for(;;){let o=d.join(t,l);if(await R(o))return t;let e=d.dirname(t);if(e===t)throw new c(`Could not find ${l}. Run this command from the OpenPond source checkout or pass --cwd <repo>.`);t=e}}r(O,"resolveDesktopHarnessRepoRoot");function x(n,t){let o=t==="attach"?"attach":null;for(let e of["isolated","attach","packaged","none"])if(u(n[e])){if(o&&o!==e)throw new c("Choose only one desktop harness launch mode: --isolated, --attach, --packaged, or --none.");o=e}return o}r(x,"resolveLaunchMode");function i(n,t,o,e){let a=p(o,e);a&&n.push(t,a)}r(i,"appendStringFlag");function H(n,t){let o=p(t,"json"),e=p(t,"jsonPath");if(o&&y(o))throw new c("harness --json requires a report path. Use --json <path> or --json-path <path>.");if(o&&e&&o!==e)throw new c("Use only one JSON report path: --json <path> or --json-path <path>.");let a=o||e;a&&n.push("--json",a)}r(H,"appendJsonFlag");function y(n){return/^(true|false|1|0|yes|no)$/i.test(n)}r(y,"isBooleanLiteral");async function R(n){try{return await v(n,C.R_OK),!0}catch{return!1}}r(R,"fileExists");function D(){return["usage: openpond desktop-test run <scenario...> [options]"," openpond desktop-test attach <scenario...> [options]","","Options include --isolated, --attach, --packaged, --none, --app <path>,","--server <url>, --token <token>, --token-file <path>, --devtools-port <port>, --artifacts-dir <path>,","--json <path>, --json-path <path>, --grep <pattern>, --timeout-ms <ms>,","--keep-home, and --cwd <repo>."].join(`
3
+ `)}r(D,"desktopHarnessCliUsage");var m=class extends Error{static{r(this,"HarnessCommandFailedError")}exitCode;constructor(t){let o=typeof t=="number"&&t>0?t:1;super(`desktop harness failed with exit code ${o}`),this.name="HarnessCommandFailedError",this.exitCode=o}};export{j as buildDesktopHarnessInvocation,O as resolveDesktopHarnessRepoRoot,$ as runDesktopTestCommand};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{$a as xa,Aa as Y,Ba as Z,Ca as _,Da as $,Ea as aa,Fa as ba,Ga as ca,Ha as da,Ia as ea,Ja as fa,Ka as ga,La as ha,Ma as ia,Na as ja,Oa as ka,Pa as la,Qa as ma,Ra as na,Sa as oa,Ta as pa,Ua as qa,Va as ra,Wa as sa,Xa as ta,Ya as ua,Za as va,_a as wa,a as l,ab as ya,b as m,bb as za,c as n,cb as Aa,d as o,db as Ba,e as p,ea as v,eb as Ca,f as q,fa as w,fb as Da,g as r,ga as x,gb as Ea,h as s,ha as y,hb as Fa,i as t,ia as z,ib as Ga,j as u,ja as A,jb as Ha,ka as B,kb as Ia,la as C,ma as D,na as E,oa as F,pa as G,qa as H,ra as I,sa as J,ta as K,ua as L,va as M,wa as N,xa as O,ya as W,za as X}from"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import{a,b,c,d,e,f,g,h,i,k as j,l as k,m as P,n as Q,o as R,p as S,q as T,r as U,s as V}from"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{Ca as CLIENT_CHOICE_KEYS,Ba as ClientChoicesSchema,w as ConfigSchema,v as CredentialReferenceSchema,L as LAYOUT_PREFERENCE_KEYS,l as MISSING_REVISION,na as MigrationResolutionsSchema,P as PERSISTENCE_TABLES_SQL,c as PersistenceError,ea as accountId,r as acquireFileLock,ja as artifactReference,za as assertConfigRunCurrent,Ia as assertHomeCompatible,k as assertStorageAncestors,p as atomicWriteFile,b as bindHomeCallbacks,ya as captureConfigRun,Z as clearCache,ma as collectArtifactOrphans,F as configEditorSchema,C as configRecoveryRevisions,N as configToPreferences,da as credentialVersions,ba as deleteCredential,V as deleteLocalRecord,y as diffConfig,Aa as effectivePreferences,g as expandHome,Fa as exportRecoveryBackup,Ha as exportSettings,m as fileRevision,S as getLocalRecord,qa as initializeHome,e as isMissing,O as layoutPreferences,Y as listCache,T as listLocalRecords,J as mergeConfig,ca as newCredentialId,Q as openStorageDatabase,H as patchConfig,d as persistenceIssue,M as preferencesToConfig,o as privateDirectory,s as processIsDead,j as protectPrivateDirectory,ia as publishManagedArtifact,U as putLocalRecord,fa as readAccountConfiguration,W as readCache,Da as readClientChoices,G as readConfig,_ as readCredential,$ as readCredentials,t as readJsonFile,oa as readMigrationJournal,n as readOptionalFile,ua as readPreferences,sa as recoverMigration,la as releaseArtifactReference,B as rememberValidConfig,D as replaceConfigText,i as resolveConfigPath,xa as resolveEffectiveConfig,f as resolveOpenPondHome,pa as resolveStoredPath,ta as restartMigration,E as restoreConfigRevision,Ga as restoreRecoveryBackup,z as serializeConfig,wa as setProjectTrust,h as storagePaths,ga as updateAccountConfiguration,Ea as updateClientChoices,I as updateConfig,u as updateJsonFile,va as updatePreferences,x as validateConfigDocument,A as validateConfigText,ha as validateManagedArtifacts,ra as validateMigratedHome,K as watchConfig,q as withFileLock,R as withLocalDatabase,ka as withManagedArtifact,a as withOpenPondHome,X as writeCache,aa as writeCredential};