openpond 0.2.43 → 0.2.45

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 (210) hide show
  1. package/dist/app-server.d.ts +18127 -5586
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/actions-command-CRDLSPFA.js +2 -0
  4. package/dist/chunks/{app-layer-OV7RVSQW.js → app-layer-MDJFV3HZ.js} +1 -1
  5. package/dist/chunks/app-server-runtime-PJONTCCO.js +2 -0
  6. package/dist/chunks/apps-MD2DKEDW.js +2 -0
  7. package/dist/chunks/{chunk-T5QA4W2H.js → chunk-25GCTLAZ.js} +5 -5
  8. package/dist/chunks/chunk-3BJ4P5LI.js +520 -0
  9. package/dist/chunks/chunk-3SRIPOJQ.js +2 -0
  10. package/dist/chunks/{chunk-7EDOA6KD.js → chunk-4EGDKOYP.js} +3 -3
  11. package/dist/chunks/{chunk-QUNRWDVO.js → chunk-5ZFEQLRI.js} +3 -3
  12. package/dist/chunks/chunk-6BL2ZIAP.js +184 -0
  13. package/dist/chunks/chunk-6QUICEQA.js +5 -0
  14. package/dist/chunks/chunk-7D2WMUWK.js +3 -0
  15. package/dist/chunks/chunk-7KIBRK3A.js +4 -0
  16. package/dist/chunks/{chunk-O277DPTX.js → chunk-B6LYKEMU.js} +1 -1
  17. package/dist/chunks/{chunk-ZG7QX66E.js → chunk-CR6CDOKS.js} +8 -8
  18. package/dist/chunks/chunk-CXS3WXL3.js +2 -0
  19. package/dist/chunks/chunk-DWGB536R.js +19 -0
  20. package/dist/chunks/{chunk-6UPCR6EL.js → chunk-EG55BFQ4.js} +1 -1
  21. package/dist/chunks/chunk-ELNJUG64.js +17 -0
  22. package/dist/chunks/{chunk-HI7W3IVO.js → chunk-FXIUKYUR.js} +12 -12
  23. package/dist/chunks/chunk-GEDEVI4Y.js +2 -0
  24. package/dist/chunks/chunk-H3C4ZYEA.js +16 -0
  25. package/dist/chunks/chunk-HUBI3RUK.js +2 -0
  26. package/dist/chunks/{chunk-IE2WZ3I3.js → chunk-IYRHG54Q.js} +1 -1
  27. package/dist/chunks/chunk-J65BMG5Q.js +2 -0
  28. package/dist/chunks/chunk-KOR2AZVB.js +24 -0
  29. package/dist/chunks/{chunk-LLNCHGE4.js → chunk-LL4QP2IM.js} +1 -1
  30. package/dist/chunks/chunk-M2YXYBSP.js +2 -0
  31. package/dist/chunks/chunk-NPOHW5OU.js +2 -0
  32. package/dist/chunks/{chunk-KRC2S5QF.js → chunk-NXUCGKY2.js} +3 -3
  33. package/dist/chunks/chunk-PDIT2QS7.js +8 -0
  34. package/dist/chunks/{chunk-T7MJBBHE.js → chunk-PGKEDR3S.js} +1 -1
  35. package/dist/chunks/chunk-QVRNOGAU.js +21 -0
  36. package/dist/chunks/chunk-TNXILYI6.js +2 -0
  37. package/dist/chunks/chunk-TVQE3JMI.js +2 -0
  38. package/dist/chunks/chunk-U6SFIFDM.js +2409 -0
  39. package/dist/chunks/chunk-V6WBSW5Q.js +3 -0
  40. package/dist/chunks/chunk-VESOG2SS.js +2 -0
  41. package/dist/chunks/chunk-VFTUP5NQ.js +2 -0
  42. package/dist/chunks/{chunk-G2WJC6DE.js → chunk-VVV5I22A.js} +2 -2
  43. package/dist/chunks/chunk-XPB6NY7L.js +42 -0
  44. package/dist/chunks/{chunk-VG7XO6PR.js → chunk-XWLI7WJH.js} +2 -24
  45. package/dist/chunks/{chunk-KIGN4FI6.js → chunk-YWX7FKLM.js} +1 -1
  46. package/dist/chunks/cli-BKBH6FZY.js +2 -0
  47. package/dist/chunks/{configuration-command-ANYM5UYG.js → configuration-command-75ZCMZ6X.js} +1 -1
  48. package/dist/chunks/connected-evidence-UPUVVQ6P.js +2 -0
  49. package/dist/chunks/{continual-MHMPLLUZ.js → continual-WWPXK2LO.js} +1 -1
  50. package/dist/chunks/core-commands-SS2GV7WU.js +2 -0
  51. package/dist/chunks/datasets-TCLXV34N.js +2 -0
  52. package/dist/chunks/desktop-test-7ZHZHUB6.js +3 -0
  53. package/dist/chunks/{dist-GC7DXKTI.js → dist-VDN6E54A.js} +1 -1
  54. package/dist/chunks/evaluation-coordination-ZX5GLMRC.js +2 -0
  55. package/dist/chunks/experiment-improvements-O6DCQXCX.js +2 -0
  56. package/dist/chunks/experiments-JOQOBQXY.js +2 -0
  57. package/dist/chunks/{extension-5LQRULQP.js → extension-3M2CSWZB.js} +1 -1
  58. package/dist/chunks/{help-NTSTG6RR.js → help-RLRU33WN.js} +1 -1
  59. package/dist/chunks/hosted-experiment-improvement-IKO677PI.js +3 -0
  60. package/dist/chunks/hosted-harness-runtime-H2Q2SNZT.js +2 -0
  61. package/dist/chunks/hosted-profile-candidate-FHHSLJNO.js +3 -0
  62. package/dist/chunks/hosted-profile-compiler-5B256VV3.js +2 -0
  63. package/dist/chunks/hosted-profile-evaluation-control-Z25TZOW4.js +2 -0
  64. package/dist/chunks/hosted-profile-evaluation-inspection-MFYPLTZQ.js +3 -0
  65. package/dist/chunks/hosted-profile-evaluation-preparation-MAB2PSCC.js +3 -0
  66. package/dist/chunks/human-review-6H3BW7OZ.js +2 -0
  67. package/dist/chunks/learning-Y6WNDVQW.js +2 -0
  68. package/dist/chunks/{opchat-77PRAQ5W.js → opchat-3E4FH3DC.js} +1 -1
  69. package/dist/chunks/{organizations-2KWTYIPU.js → organizations-PRVCUPMN.js} +1 -1
  70. package/dist/chunks/{profile-HVLH672B.js → profile-DC4UEVVG.js} +1 -1
  71. package/dist/chunks/project-agent-ZX3CELKI.js +2 -0
  72. package/dist/chunks/sandbox-command-HHQMZK3G.js +2 -0
  73. package/dist/chunks/{sandbox-template-QMB6DSTS.js → sandbox-template-DFHWHCIQ.js} +1 -1
  74. package/dist/chunks/{src-N447LUPO.js → src-CREVQF7M.js} +1 -1
  75. package/dist/chunks/src-MAZ7OBVY.js +327 -0
  76. package/dist/chunks/taskset-TB2ICAZU.js +2 -0
  77. package/dist/chunks/{teams-bot-RNHQMPQA.js → teams-bot-BNBL57S5.js} +1 -1
  78. package/dist/chunks/training-FW5FOGR3.js +2 -0
  79. package/dist/chunks/{workspaces-V5YTXJLV.js → workspaces-WTPFRJMS.js} +1 -1
  80. package/dist/cli.js +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/profile/local-profile.d.ts +2 -0
  83. package/dist/web/assets/App-BgeSqoRS.css +1 -0
  84. package/dist/web/assets/App-C6EWFrLP.js +227 -0
  85. package/dist/web/assets/{AppDialog-v-BfV1lA.js → AppDialog-Cgn_fTGR.js} +1 -1
  86. package/dist/web/assets/AppTerminalPanel-cNYkSvM2.js +2 -0
  87. package/dist/web/assets/{AppsView-Dl-37F0w.js → AppsView-9zpKBSLv.js} +1 -1
  88. package/dist/web/assets/{BrowserSidebar-DltF217k.js → BrowserSidebar-Xo21N1ej.js} +1 -1
  89. package/dist/web/assets/{CartesianChart-gK-Ll3kX.js → CartesianChart-Bg3Lm5mZ.js} +1 -1
  90. package/dist/web/assets/{CollaborationTabs-BuWquQYn.js → CollaborationTabs-BIfgIy5X.js} +1 -1
  91. package/dist/web/assets/{CommandMenu-Cs5S8t-Q.js → CommandMenu-D9BimyPx.js} +1 -1
  92. package/dist/web/assets/{CommunityView-BJBkQEMV.js → CommunityView-BoW-yLju.js} +1 -1
  93. package/dist/web/assets/{ComposerCreateImproveStrip-C36fKc-v.js → ComposerCreateImproveStrip-BIKVEgr1.js} +1 -1
  94. package/dist/web/assets/{GetStartedView-9A49MgYA.js → GetStartedView-B99v4-hh.js} +1 -1
  95. package/dist/web/assets/HostedModelLearningReview-DEScpX2Z.js +1 -0
  96. package/dist/web/assets/HostedModelLearningSettings-4HT5eEiL.js +1 -0
  97. package/dist/web/assets/LabModelVersionDetailPage-DkYdI7gr.js +1 -0
  98. package/dist/web/assets/{LabSkillSidebar-BAKym5GY.js → LabSkillSidebar-Bp5XYipm.js} +1 -1
  99. package/dist/web/assets/LabsRoute-ACN76d2j.css +1 -0
  100. package/dist/web/assets/LabsRoute-VopO7n34.js +105 -0
  101. package/dist/web/assets/MainChatThread-3Gg0oDZT.js +2 -0
  102. package/dist/web/assets/{MainPane-gPkr0OWu.js → MainPane-CUqMVG9-.js} +11 -11
  103. package/dist/web/assets/{MarkdownText-B-au2zEv.js → MarkdownText-De0WzrEw.js} +1 -1
  104. package/dist/web/assets/{NativeSkillSidebar-DHFKZ7P1.js → NativeSkillSidebar-B4jtf5RO.js} +1 -1
  105. package/dist/web/assets/{NewExperienceSwitcher-Dhbf5KJT.js → NewExperienceSwitcher-Bg1DVr96.js} +1 -1
  106. package/dist/web/assets/{NewProjectDialog-hlAzFK2Y.js → NewProjectDialog-i_wvIBw-.js} +1 -1
  107. package/dist/web/assets/{OutputsPage-C0N2rOxE.js → OutputsPage-CZiPxLyN.js} +1 -1
  108. package/dist/web/assets/{ProjectsPage-CkHBgLPx.js → ProjectsPage-BD0eml0M.js} +1 -1
  109. package/dist/web/assets/{RightChatPanelStack-BiW6ZzPN.js → RightChatPanelStack-CEBFPHKP.js} +1 -1
  110. package/dist/web/assets/{RightSidebarHomePanel-BS9YSdYB.js → RightSidebarHomePanel-BTpU5wGh.js} +1 -1
  111. package/dist/web/assets/{ScheduledWorkPage-819sQcDR.js → ScheduledWorkPage-Y6XGoh-X.js} +1 -1
  112. package/dist/web/assets/{SettingsView-BZrOUPZb.js → SettingsView-Kh14f463.js} +3 -3
  113. package/dist/web/assets/{TeamChatView-CUNcbSa7.js → TeamChatView-5LjuRNd6.js} +1 -1
  114. package/dist/web/assets/{TerminalOverlay-MIlGPpXe.js → TerminalOverlay-BCWBSotQ.js} +1 -1
  115. package/dist/web/assets/{TrainingCreationPanel-BNcyNoa8.js → TrainingCreationPanel-hvOHRVJx.js} +1 -1
  116. package/dist/web/assets/{TrainingDraftPanel-CKV16LNC.js → TrainingDraftPanel-CGEHGljE.js} +1 -1
  117. package/dist/web/assets/{UsageSettingsSection-SVgUHnUL.js → UsageSettingsSection-B8nbqhag.js} +1 -1
  118. package/dist/web/assets/{WorkSidebarPanel-CfkaaFHA.js → WorkSidebarPanel-B6hlPEIs.js} +1 -1
  119. package/dist/web/assets/{WorkspaceDiffPanel-CQhqlqg5.js → WorkspaceDiffPanel-q8A15-0x.js} +9 -9
  120. package/dist/web/assets/{WorkspaceEnvironmentMenu-CJB-z2tS.js → WorkspaceEnvironmentMenu-BiFTPWtC.js} +1 -1
  121. package/dist/web/assets/{WorkspaceGitDialogs-B3xtasTt.js → WorkspaceGitDialogs-Dyx4Rbiy.js} +1 -1
  122. package/dist/web/assets/{WorkspaceMonacoEditor-DVfyICNZ.js → WorkspaceMonacoEditor-B1dKexHo.js} +60 -60
  123. package/dist/web/assets/{arrow-up-right-CYG4Vm07.js → arrow-up-right-CCj7SOGp.js} +1 -1
  124. package/dist/web/assets/chunk-DJWHN7NU-1eQoMoKO.js +1 -0
  125. package/dist/web/assets/{clipboard-DGSnfljX.js → clipboard-BY6ELc9Z.js} +1 -1
  126. package/dist/web/assets/{cloud-upload-Bw_zrS2y.js → cloud-upload-BOka5EKK.js} +1 -1
  127. package/dist/web/assets/cssMode-C34j8ti5.js +1 -0
  128. package/dist/web/assets/{folder-open-CcGOldH7.js → folder-open-CX2jidFj.js} +1 -1
  129. package/dist/web/assets/{folder-plus-DEIDaX2B.js → folder-plus-Dh2Q9LP3.js} +1 -1
  130. package/dist/web/assets/{git-commit-horizontal-B-Ao6y--.js → git-commit-horizontal-CfevriuT.js} +1 -1
  131. package/dist/web/assets/htmlMode-BORwVkZg.js +1 -0
  132. package/dist/web/assets/index-B9VSiz_z.css +1 -0
  133. package/dist/web/assets/{index-C8_8-lW7.js → index-BBjRfC--.js} +6 -6
  134. package/dist/web/assets/{info-DwOXHkN_.js → info-Bv3dbs3G.js} +1 -1
  135. package/dist/web/assets/{jsonMode-txmGM7K6.js → jsonMode-BYWtZ6AK.js} +4 -4
  136. package/dist/web/assets/{lspLanguageFeatures-D59Drc_9.js → lspLanguageFeatures-CEAdFSpU.js} +1 -1
  137. package/dist/web/assets/{minimize-2-C5UCV16_.js → minimize-2-MhorZwY5.js} +1 -1
  138. package/dist/web/assets/{monaco.contribution-BOmcYK8k.js → monaco.contribution-CDhPpbIo.js} +2 -2
  139. package/dist/web/assets/{monaco.contribution-CbK7796k.js → monaco.contribution-CN7AWJNd.js} +2 -2
  140. package/dist/web/assets/monaco.contribution-DHA7FuJX.js +2 -0
  141. package/dist/web/assets/{monaco.contribution-5HcktwaM.js → monaco.contribution-ZUUVx_3M.js} +2 -2
  142. package/dist/web/assets/{monitor-D4hpNTai.js → monitor-DLcrkfM5.js} +1 -1
  143. package/dist/web/assets/{python-Cie4Ghu8.js → python-CXwvPmc4.js} +1 -1
  144. package/dist/web/assets/{refresh-cw-CIOzrJnj.js → refresh-cw-BTfIxHb3.js} +1 -1
  145. package/dist/web/assets/{save-D7EtdMHG.js → save-DaN65kMq.js} +1 -1
  146. package/dist/web/assets/{square-JpDfrqp_.js → square-zRgIUdSv.js} +1 -1
  147. package/dist/web/assets/toggleHighContrast-BgpFWRpS.css +1 -0
  148. package/dist/web/assets/{toggleHighContrast-DdGkc-Be.js → toggleHighContrast-DWeRZFzr.js} +1 -1
  149. package/dist/web/assets/{tsMode-DwgEL7oI.js → tsMode-nLBhKngY.js} +1 -1
  150. package/dist/web/assets/{upload-BkwOzqS-.js → upload-BfUu4Eu1.js} +1 -1
  151. package/dist/web/assets/{useLocalAgentSchedules-bO0Qycih.js → useLocalAgentSchedules-BCITWhg2.js} +1 -1
  152. package/dist/web/assets/{useSessionTurnCache-DxUh5scW.js → useSessionTurnCache-BQMWfV8u.js} +1 -1
  153. package/dist/web/assets/{wifi-off-D6Keejtn.js → wifi-off-bdka5es5.js} +1 -1
  154. package/dist/web/assets/{workers-BgG66q0n.js → workers-z7XHFFNs.js} +1 -1
  155. package/dist/web/assets/{yaml-COMRGPWg.js → yaml-BTr4i4DD.js} +1 -1
  156. package/dist/web/index.html +5 -5
  157. package/docs/command-reference.md +85 -1
  158. package/package.json +6 -2
  159. package/dist/chunks/actions-command-DWQ3VGGP.js +0 -2
  160. package/dist/chunks/app-server-runtime-JVLXE5LF.js +0 -2
  161. package/dist/chunks/apps-5DQAYDNI.js +0 -2
  162. package/dist/chunks/chunk-3D4QN4NM.js +0 -19
  163. package/dist/chunks/chunk-45UOD2DA.js +0 -2
  164. package/dist/chunks/chunk-5IN3HQJU.js +0 -2
  165. package/dist/chunks/chunk-6KKQXETR.js +0 -5
  166. package/dist/chunks/chunk-6XF4GI35.js +0 -2
  167. package/dist/chunks/chunk-7KC5LWCU.js +0 -2
  168. package/dist/chunks/chunk-7R7O2XXP.js +0 -2
  169. package/dist/chunks/chunk-DGD52VZC.js +0 -13
  170. package/dist/chunks/chunk-E6WT4HWF.js +0 -3
  171. package/dist/chunks/chunk-EWQZASG4.js +0 -2400
  172. package/dist/chunks/chunk-IFI24VF6.js +0 -5
  173. package/dist/chunks/chunk-KDOS6YMH.js +0 -2
  174. package/dist/chunks/chunk-MDE3HHLH.js +0 -2
  175. package/dist/chunks/chunk-P45OSKQL.js +0 -4
  176. package/dist/chunks/chunk-ROJX6IYW.js +0 -578
  177. package/dist/chunks/chunk-SXN3QOW4.js +0 -3
  178. package/dist/chunks/chunk-V44RF57H.js +0 -2
  179. package/dist/chunks/chunk-VJJ3UXOI.js +0 -42
  180. package/dist/chunks/chunk-W3NG7YLC.js +0 -8
  181. package/dist/chunks/chunk-XMKAMR7M.js +0 -2
  182. package/dist/chunks/cli-7D7CYCIY.js +0 -2
  183. package/dist/chunks/core-commands-TYWE3TNW.js +0 -2
  184. package/dist/chunks/datasets-FM3UBK4R.js +0 -13
  185. package/dist/chunks/desktop-test-Z5IKJU3P.js +0 -3
  186. package/dist/chunks/experiments-IWBRIDQE.js +0 -2
  187. package/dist/chunks/hosted-harness-runtime-S75BLD57.js +0 -2
  188. package/dist/chunks/hosted-profile-compiler-JNNYWLC7.js +0 -2
  189. package/dist/chunks/hosted-profile-evaluation-control-IK4Y2EQZ.js +0 -2
  190. package/dist/chunks/hosted-profile-evaluation-inspection-YWKUB7RT.js +0 -3
  191. package/dist/chunks/hosted-profile-evaluation-preparation-JXOF73BB.js +0 -3
  192. package/dist/chunks/project-agent-7NLKJMAM.js +0 -2
  193. package/dist/chunks/sandbox-command-FNS4JBVC.js +0 -2
  194. package/dist/chunks/src-TZBL6NA7.js +0 -325
  195. package/dist/chunks/taskset-BZYQT65N.js +0 -2
  196. package/dist/chunks/training-7PST5HZU.js +0 -2
  197. package/dist/web/assets/App-7h_oHCFd.css +0 -1
  198. package/dist/web/assets/App-BEQmrTGQ.js +0 -226
  199. package/dist/web/assets/AppTerminalPanel-CnKcllS2.js +0 -2
  200. package/dist/web/assets/HostedModelLearningReview-JgxDUDio.js +0 -1
  201. package/dist/web/assets/HostedModelLearningSettings-CH7CsAhw.js +0 -1
  202. package/dist/web/assets/LabModelVersionDetailPage-N2qcy1Yv.js +0 -1
  203. package/dist/web/assets/LabsRoute-DooCmsN8.css +0 -1
  204. package/dist/web/assets/LabsRoute-Y992kQoQ.js +0 -52
  205. package/dist/web/assets/MainChatThread-CPhREQso.js +0 -2
  206. package/dist/web/assets/cssMode-CSpYOKj-.js +0 -1
  207. package/dist/web/assets/htmlMode-DstkgJXG.js +0 -1
  208. package/dist/web/assets/index-DUIWDN8o.css +0 -1
  209. package/dist/web/assets/monaco.contribution-BomZ1gys.js +0 -2
  210. package/dist/web/assets/toggleHighContrast-B7NOMXDY.css +0 -1
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{W as H,X as y,Y as C,_ as E,aa as S,ba as P,ca as j,ea as I}from"./chunk-ELNJUG64.js";import{D as h,F as v,G as l,ja as w,la as b}from"./chunk-KOR2AZVB.js";import{b as e}from"./chunk-ES2ISFJC.js";import{a as f}from"./chunk-FTQLQJQV.js";var a=e.string().min(1).max(240),d=e.string().regex(/^[a-f0-9]{64}$/),g=e.string().regex(/^[a-f0-9]{40}$/),x=e.object({schemaVersion:e.literal("openpond.hostedProfileCandidateExport.v1"),actorId:a,teamId:a,candidateId:a,candidateRevision:e.number().int().positive(),projectId:a.nullable(),profileRef:e.object({source:e.literal("openpond_git"),repositoryId:a,profileId:a}).strict(),expectedCommit:g,component:y.shape.component,baseRelease:h,frozenHash:d,executableSourceHash:d,protectedClosureHash:d,compiler:e.object({workspaceId:a,name:e.string().max(500),repositoryId:a}).strict(),sourceManifest:e.object({base64:e.string().max(28e5),contentHash:d,sizeBytes:e.number().int().positive().max(2e6)}).strict(),policySource:w,qualification:e.object({kind:e.enum(["owner_attested_local","hosted_execution"]),ownerActorId:a,teamId:a,originalEvidence:h,baseline:h,candidate:h,comparisonHash:d,recipe:H}).strict(),createdAt:e.string().datetime(),contentHash:d}).strict();function J(n){let o=x.parse(n),{contentHash:t,...c}=o;if(l(c)!==t||o.qualification.ownerActorId!==o.actorId||o.qualification.teamId!==o.teamId||o.qualification.recipe.externalDatasetBinding.profileId!==o.profileRef.profileId||o.qualification.recipe.externalDatasetBinding.protectedProfileClosureHash!==o.protectedClosureHash)throw new Error("Hosted candidate owner attestation identity differs.");return b(o.policySource),o}f(J,"verifyHostedProfileCandidateExport");var O=e.object({schemaVersion:e.literal("openpond.hostedProfileCandidateAdoption.v1"),id:a,operationId:a,actorId:a,teamId:a,candidateId:a,exportHash:d,executionOrigin:e.enum(["owner_attested_local","hosted_execution"]),qualification:x.shape.qualification,testedCandidateRelease:h,activeRelease:h,expectedCommit:g,committedProfileGit:g,executableSourceHash:d,protectedClosureHash:d,createdAt:e.string().datetime(),contentHash:d}).strict();function R(n){let o=O.parse(n),{contentHash:t,...c}=o;if(l(c)!==t||o.executionOrigin!==o.qualification.kind||o.qualification.ownerActorId!==o.actorId||o.qualification.teamId!==o.teamId)throw new Error("Hosted candidate receipt integrity differs.");return o}f(R,"verifyHostedProfileCandidateReceipt");var T=e.discriminatedUnion("operation",[e.object({operation:e.literal("adopt"),operationId:a,export:x}).strict(),e.object({operation:e.enum(["read","rollback"]),operationId:a,adoptionOperationId:a,profileRepositoryId:a}).strict()]),K=class{static{f(this,"ExperimentImprovementClient")}constructor(n){this.options=n;let o=new URL(n.baseUrl);if(!["http:","https:"].includes(o.protocol)||o.username||o.password||o.hash||o.search||!n.apiKey.trim()||!n.teamId.trim()||!n.actorId.trim())throw new Error("Select the authenticated Improve owner and API origin.");this.origin=o.toString().replace(/\/+$/,"")}options;origin;async hostedCandidate(n,o){let t=T.parse(n);if(t.operation==="adopt"&&(t.export.actorId!==this.options.actorId||t.export.teamId!==this.options.teamId))throw new Error("The hosted candidate export belongs to a different owner.");let{response:c,value:p}=await I(this.options.fetch??fetch,`${this.origin}/v1/profile-candidate-adoptions`,{method:"POST",redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"Content-Type":"application/json","X-OpenPond-Team-Id":this.options.teamId},body:JSON.stringify({teamId:this.options.teamId,command:t}),signal:o},(m,u,r)=>Object.assign(new Error(r),{status:m,code:u}));if(!c.ok){let m=e.object({code:e.string(),message:e.string().optional(),error:e.string().optional()}).passthrough().safeParse(p);throw Object.assign(new Error(m.success?m.data.message??m.data.error??m.data.code:"Hosted candidate operation failed."),{status:c.status,code:m.success?m.data.code:void 0})}let i=R(p);if(i.actorId!==this.options.actorId||i.teamId!==this.options.teamId||i.operationId!==t.operationId||t.operation==="adopt"&&(i.exportHash!==t.export.contentHash||i.candidateId!==t.export.candidateId||i.testedCandidateRelease.contentHash!==t.export.policySource.harnessRelease.contentHash))throw new Error("Hosted candidate readback differs from the exact owner request.");return i}async command(n,o){let t=S.parse(n),{response:c,value:p}=await I(this.options.fetch??fetch,`${this.origin}/v1/experiment-improvements`,{method:"POST",redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"Content-Type":"application/json","X-OpenPond-Team-Id":this.options.teamId},body:JSON.stringify({teamId:this.options.teamId,request:t}),signal:o},(r,s,q)=>Object.assign(new Error(q),{status:r,code:s}));if(!c.ok){let r=e.object({error:e.string(),code:e.string().optional()}).passthrough().safeParse(p);throw Object.assign(new Error(r.success?r.data.error:"The Improve operation failed."),{status:c.status,code:r.success?r.data.code:void 0})}if(t.operation==="options"){let r=P.parse(p);if(r.teamId!==this.options.teamId||l(r.evidence)!==l(t.evidence))throw new Error("The Improve choices changed their exact originating evidence.");return r}if(t.operation==="humanComparisonOptions"){let r=j(p);if(r.candidateId!==t.id||r.actorId!==this.options.actorId||r.teamId!==this.options.teamId)throw new Error("Human discovery belongs to another owner or candidate.");return r}if(t.operation==="instructions"){let r=e.object({candidateId:e.string(),candidateRevision:e.number().int().positive(),path:e.string(),text:e.string().max(25e4),textHash:e.string().regex(/^[a-f0-9]{64}$/),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().parse(p);if(r.candidateId!==t.id||v(r.text)!==r.textHash)throw new Error("The candidate instructions belong to a different revision.");return r}let i=t.operation==="list"?E.parse(p):null;if(t.operation==="list"&&i&&(i.states.length>t.limit||i.states.some((r,s)=>t.cursor&&r.id<=t.cursor||s>0&&r.id<=i.states[s-1].id)||i.nextCursor&&(t.cursor&&i.nextCursor<=t.cursor||i.states.some(r=>r.id>i.nextCursor))))throw new Error("The retained candidate page changed its scan boundary.");let u=(i?i.states:[p]).map(r=>{let s=C(r);if(s.actorId!==this.options.actorId||s.teamId!==this.options.teamId||"id"in t&&s.id!==t.id)throw new Error("The Improve response belongs to a different owner or candidate.");if(t.operation==="start"&&s.requestHash!==l(t.request))throw new Error("The Improve request identity changed.");return s});return i?{states:u,nextCursor:i.nextCursor}:u[0]}};export{J as a,K as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as me,b as D,c as G,d as j,e as z,g as ye,i as T,j as we,k as S,l as he,v as B,x as F}from"./chunk-B3O2GAQH.js";import{a as re,b as L,c as R}from"./chunk-65BW2QXY.js";import{b as H,c as be,d as ve,f as w,h as P,i as Re}from"./chunk-BSHAIAXY.js";import{a as Z,b as ee,c as te}from"./chunk-SXN3QOW4.js";import{a as M,f as v,k as X}from"./chunk-3M53YXEI.js";import{M as pe,N as ue,R as ge,V as fe,h as $,i as ie,l as ae,n as se,o as ce,p as le,q as de}from"./chunk-Z2BYC6TP.js";import{d as y,e as ne,f as oe,g as C}from"./chunk-DXAZUJPA.js";import{a as g}from"./chunk-FTQLQJQV.js";import{promises as V,existsSync as W}from"node:fs";import U from"node:path";import{stdin as $e}from"node:process";async function Ge(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=await ce(n,i,a.id);console.log(JSON.stringify(s,null,2))}g(Ge,"runTemplateStatus");async function je(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=await le(n,i,a.id);console.log(JSON.stringify(s,null,2))}g(je,"runTemplateBranches");async function ze(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,f=X(s),c=await de(n,i,a.id,{environment:f});console.log(JSON.stringify(c,null,2))}g(ze,"runTemplateUpdate");async function He(e){let o=await y(),t=w(o),r=typeof e.apiKey=="string"?e.apiKey:typeof e.key=="string"?e.key:null,n=r?r.trim():await L();if(!n)throw new Error("API key is required");n.startsWith("opk_")||console.log("warning: API keys usually start with opk_."),await C({handle:o.activeProfile?.handle||"default",apiKey:n,baseUrl:t,apiBaseUrl:o.apiBaseUrl,chatApiBaseUrl:o.chatApiBaseUrl,setActive:!0}),console.log("Saved account credentials to the encrypted OpenPond credential store.")}g(He,"runLogin");async function Fe(e,o){let t=o[0]||"list";if(t==="list"){let r=await ne();console.log(JSON.stringify({profiles:r},null,2));return}if(t==="use"){let r=o[1];if(!r)throw new Error("usage: profiles use <name> [--base-url <url>]");let n=await oe(r,{baseUrl:H(e)});console.log(JSON.stringify({profile:n},null,2));return}if(t==="save"){let r=o[1];if(!r)throw new Error("usage: profiles save <name> --api-key <key> [--base-url <url>] [--api-base-url <url>] [--chat-api-base-url <url>]");let n=typeof e.apiKey=="string"?e.apiKey:typeof e.key=="string"?e.key:null,i=n?n.trim():await L(),a=typeof e.environment=="string"?e.environment:typeof e.env=="string"?e.env:void 0,s=await C({handle:r,apiKey:i,baseUrl:H(e),apiBaseUrl:be(e),chatApiBaseUrl:ve(e),environment:a,setActive:!0});console.log(JSON.stringify({profile:s},null,2));return}throw new Error("usage: profiles <list|use|save> [args]")}g(Fe,"runProfiles");async function Ve(){let e=await y(),o=w(e),t=P(e),r=await R(e,o),n=await pe(t,r);console.log(JSON.stringify(n,null,2))}g(Ve,"runAccount");async function We(e){let o=await y(),t=P(o),r=re(o),n=await ue(t,r);console.log(JSON.stringify(n,null,2))}g(We,"runHealth");async function qe(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=typeof e.branch=="string"?String(e.branch):void 0,f=await $(n,i,a.id,{branch:s});if(!f?.id){console.log("no deployments found");return}let c=await ie(n,i,f.id),d=(c&&Array.isArray(c.toolsJson)?c.toolsJson:null)||(c&&typeof c.metadataJson=="object"&&c.metadataJson?c.metadataJson.tools:null),u=Array.isArray(d)?d:[];if(u.length===0){console.log("no tools found");return}for(let l of u){let m=l,h=m.profile||m.function,I=m.name||h?.name||"unknown",p=m.description||h?.description||"";console.log(p?`${I} - ${p}`:I)}}g(qe,"runToolList");async function Ye(e,o,t){let r=await y(),n=w(r),i=P(r),a=await R(r,n),{app:s}=await T(i,a,o),f=typeof e.branch=="string"?String(e.branch):void 0,c=await $(i,a,s.id,{branch:f});if(!c?.id)throw new Error("no deployments found");let d;if(typeof e.body=="string")try{d=JSON.parse(e.body)}catch{throw new Error("tool body must be valid JSON")}let u=typeof e.method=="string"?String(e.method).toUpperCase():"POST",l=await fe(n,a,{appId:s.id,deploymentId:c.id,toolName:t,method:u,body:d,headers:a?{"openpond-api-key":a}:void 0});if(!l.ok)throw new Error(l.error||`tool failed (${l.status})`);let m=l.data??{ok:!0};console.log(JSON.stringify(m,null,2))}g(Ye,"runToolRun");async function Qe(e,o,t){let r=await y(),n=w(r),i=P(r),a=await R(r,n),{app:s}=await T(i,a,o),f=typeof e.branch=="string"?String(e.branch):void 0,c=typeof e.deploymentId=="string"?String(e.deploymentId):void 0,d=c?{id:c}:await $(i,a,s.id,{branch:f});if(!d?.id)throw new Error("no deployments found");let u=typeof e.body=="string"?M(String(e.body),"body"):{};if(!u||typeof u!="object"||Array.isArray(u))throw new Error("body must be a JSON object");let l=typeof e.method=="string"?String(e.method).toUpperCase():"POST",m={...u,appId:s.id,deploymentId:d.id,toolName:t,method:l},h=await ge(i,a,m);console.log(JSON.stringify(h,null,2))}g(Qe,"runBacktestRun");async function Xe(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a,handle:s,repo:f}=await T(n,i,o),c=typeof e.branch=="string"?String(e.branch):void 0,d=typeof e.deploymentId=="string"?String(e.deploymentId):void 0,u=d?{id:d}:await $(n,i,a.id,{branch:c});if(!u?.id){console.log("no deployments found");return}await we({baseUrl:n,apiKey:i,deploymentId:u.id,prefix:`[${s}/${f}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}g(Xe,"runDeployWatch");async function Ze(e,o){let r=((typeof e.name=="string"?e.name:null)||o.join(" ")).trim();if(!r)throw new Error("usage: repo create --name <name> [--team-id <id>] [--path <dir>] [--template <owner/repo|url>] [--template-branch <branch>] [--empty|--opentool] [--sandbox] [--token] [--auto-schedule-migration <true|false>]");let n=await y(),i=w(n),a=await R(n,i),s=P(n),f=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0,c=typeof e.template=="string"?e.template.trim():"";if(c&&(e.empty==="true"||e.opentool==="true"))throw new Error("choose one: --template or --empty/--opentool");if(e.empty==="true"&&e.opentool==="true")throw new Error("choose one: --empty or --opentool");let d=typeof e.description=="string"?e.description.trim():void 0,u=typeof e.templateBranch=="string"&&e.templateBranch.trim().length>0?e.templateBranch.trim():void 0,l=typeof e.env=="string"?M(e.env,"env"):void 0;if(l){if(typeof l!="object"||Array.isArray(l))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(l))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}if(c){e.deployOnPush!==void 0&&console.warn("deploy-on-push is not used for template create (auto deploys)");let b=Re(c,i),k=(await se(s,a,[{name:r,...d?{description:d}:{},templateRepoUrl:b,...u?{templateBranch:u}:{},...l?{envVars:l}:{}}],f)).items?.[0];if(!k||k.status!=="ok"||!k.appId)throw new Error(k?.error||"Template create failed");console.log(`app_id: ${k.appId}`),k.deploymentId&&console.log(`deployment_id: ${k.deploymentId}`),k.conversationId&&console.log(`conversation_id: ${k.conversationId}`);return}let m=process.cwd(),h=typeof e.path=="string"?e.path:typeof e.dir=="string"?e.dir:null,I=h&&h.trim().length>0?h.trim():$e.isTTY?await he(m):m,p=U.resolve(I);if(W(p)){if(!(await V.stat(p)).isDirectory())throw new Error(`path is not a directory: ${p}`)}else await V.mkdir(p,{recursive:!0});let Pe=(await V.readdir(p)).filter(b=>b!==".git").length===0,x=v(e.yes)||v(e.force);if(!Pe&&!x&&!await S(`Directory is not empty (${p}). Continue?`,!1)){console.log("aborted");return}let ke=U.join(p,".git");if(!W(ke)){if(!(x?!0:await S("Initialize git repository here?",!0))){console.log("aborted");return}let A=await B("git",["init"],{cwd:p});if(A.code!==0)throw new Error(`git init failed: ${A.stderr.trim()||A.stdout.trim()||"unknown error"}`)}let K=await F(p,"origin");if(K&&!x&&!await S(`Remote "origin" already set (${K}). Replace it?`,!1)){console.log("aborted");return}let q=e.opentool==="true"?"opentool":"empty",Te=v(e.sandbox),Be=v(e.deployOnPush),N=e.autoScheduleMigration,Y=typeof N=="string"||typeof N=="boolean",Ee=Y?v(N):void 0,E=await ae(s,a,{name:r,...f?{teamId:f}:{},...d?{description:d}:{},...q?{repoInit:q}:{},...Te?{sandbox:!0}:{},...l?{envVars:l}:{},...Be?{deployOnPush:!0}:{},...Y?{autoScheduleMigration:Ee}:{}}),O=me(E);z(O);let J=v(e.token)||v(e.setRemoteToken),Oe=D(O,a),Q=J?Oe:O,_=await B("git",K?["remote","set-url","origin",Q]:["remote","add","origin",Q],{cwd:p});if(_.code!==0)throw new Error(`git remote failed: ${j(_.stderr.trim()||_.stdout.trim()||"unknown error")}`);let Ae=J?G(O):O;console.log(`app_id: ${E.appId}`),E.gitOwner&&E.gitRepo&&console.log(`repo: ${E.gitOwner}/${E.gitRepo}`),console.log(`remote: ${Ae}`),console.log('next: git add . && git commit -m "init"');let Ie=E.defaultBranch||"master";console.log(`next: openpond repo push --path ${p} --branch ${Ie}`),J||console.log(`token-remote (non-interactive): git -C ${p} remote set-url origin ${G(O)}`);try{await ye({apiBase:s,apiKey:a,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}g(Ze,"runRepoCreate");async function Se(e){let o=await B("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e});if(o.code!==0)return null;let t=o.stdout.trim();return t.length>0?t:null}g(Se,"resolveGitBranch");async function et(e){let o=await y(),t=w(o),r=await R(o,t),n=typeof e.path=="string"?e.path:typeof e.dir=="string"?e.dir:null,i=U.resolve(n&&n.trim().length>0?n.trim():"."),a=U.join(i,".git");if(!W(a))throw new Error(`git repo not found at ${i} (missing .git)`);let s=await F(i,"origin");if(!s)throw new Error("origin remote not set; run `openpond repo create` first");z(s);let c=(typeof e.branch=="string"?e.branch.trim():"")||await Se(i);if(!c)throw new Error("unable to resolve git branch; pass --branch");let d;try{d=D(s,r)}catch{throw new Error("origin remote must be https for tokenized pushes")}let u=v(e.keepTokenRemote)||v(e.token)||v(e.setRemoteToken),l=s.includes("x-access-token:"),m=!u&&!l?s:null,h=process.env.GIT_TERMINAL_PROMPT;process.env.GIT_TERMINAL_PROMPT="0";try{if(!l){let p=await B("git",["remote","set-url","origin",d],{cwd:i});if(p.code!==0)throw new Error(`git remote set-url failed: ${j(p.stderr.trim()||p.stdout.trim()||"unknown error")}`)}if((await B("git",["push","-u","origin",c],{cwd:i,inherit:!0})).code!==0)throw new Error("git push failed")}finally{m&&await B("git",["remote","set-url","origin",m],{cwd:i}).catch(()=>null),h===void 0?delete process.env.GIT_TERMINAL_PROMPT:process.env.GIT_TERMINAL_PROMPT=h}}g(et,"runRepoPush");async function tt(e){if(e.length===0)throw new Error("usage: opentool <init|validate|build> [args]");let o=process.platform==="win32"?"npx.cmd":"npx";if((await B(o,["opentool",...e],{inherit:!0})).code!==0)throw new Error("opentool command failed")}g(tt,"runOpentool");async function nt(){let e="openpond",o=Z(),t=await te(e),r=`npm i -g ${e}@${t}`,n=ee(o,t);if(n===0){console.log(`${e} is up to date (${o})`);return}if(n===-1){console.log(`Update available: ${o} -> ${t}`),console.log(`Run: ${r}`);return}if(n===1){console.log(`Installed version (${o}) is newer than npm latest (${t}).`);return}if(o===t){console.log(`${e} is up to date (${o})`);return}console.log(`Installed: ${o}`),console.log(`Latest: ${t}`),console.log(`Run: ${r}`)}g(nt,"runCheckUpdate");export{Ge as a,je as b,ze as c,He as d,Fe as e,Ve as f,We as g,qe as h,Ye as i,Qe as j,Xe as k,Ze as l,Se as m,et as n,tt as o,nt as p};
2
+ import{a as me,b as D,c as G,d as j,e as z,g as ye,i as T,j as we,k as S,l as he,v as B,x as F}from"./chunk-B3O2GAQH.js";import{a as re,b as L,c as R}from"./chunk-65BW2QXY.js";import{a as Z,b as ee,c as te}from"./chunk-V6WBSW5Q.js";import{b as H,c as be,d as ve,f as w,h as P,i as Re}from"./chunk-BSHAIAXY.js";import{a as M,f as v,k as X}from"./chunk-3M53YXEI.js";import{M as pe,N as ue,R as ge,V as fe,h as $,i as ie,l as ae,n as se,o as ce,p as le,q as de}from"./chunk-Z2BYC6TP.js";import{d as y,e as ne,f as oe,g as C}from"./chunk-DXAZUJPA.js";import{a as g}from"./chunk-FTQLQJQV.js";import{promises as V,existsSync as W}from"node:fs";import U from"node:path";import{stdin as $e}from"node:process";async function Ge(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=await ce(n,i,a.id);console.log(JSON.stringify(s,null,2))}g(Ge,"runTemplateStatus");async function je(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=await le(n,i,a.id);console.log(JSON.stringify(s,null,2))}g(je,"runTemplateBranches");async function ze(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,f=X(s),c=await de(n,i,a.id,{environment:f});console.log(JSON.stringify(c,null,2))}g(ze,"runTemplateUpdate");async function He(e){let o=await y(),t=w(o),r=typeof e.apiKey=="string"?e.apiKey:typeof e.key=="string"?e.key:null,n=r?r.trim():await L();if(!n)throw new Error("API key is required");n.startsWith("opk_")||console.log("warning: API keys usually start with opk_."),await C({handle:o.activeProfile?.handle||"default",apiKey:n,baseUrl:t,apiBaseUrl:o.apiBaseUrl,chatApiBaseUrl:o.chatApiBaseUrl,setActive:!0}),console.log("Saved account credentials to the encrypted OpenPond credential store.")}g(He,"runLogin");async function Fe(e,o){let t=o[0]||"list";if(t==="list"){let r=await ne();console.log(JSON.stringify({profiles:r},null,2));return}if(t==="use"){let r=o[1];if(!r)throw new Error("usage: profiles use <name> [--base-url <url>]");let n=await oe(r,{baseUrl:H(e)});console.log(JSON.stringify({profile:n},null,2));return}if(t==="save"){let r=o[1];if(!r)throw new Error("usage: profiles save <name> --api-key <key> [--base-url <url>] [--api-base-url <url>] [--chat-api-base-url <url>]");let n=typeof e.apiKey=="string"?e.apiKey:typeof e.key=="string"?e.key:null,i=n?n.trim():await L(),a=typeof e.environment=="string"?e.environment:typeof e.env=="string"?e.env:void 0,s=await C({handle:r,apiKey:i,baseUrl:H(e),apiBaseUrl:be(e),chatApiBaseUrl:ve(e),environment:a,setActive:!0});console.log(JSON.stringify({profile:s},null,2));return}throw new Error("usage: profiles <list|use|save> [args]")}g(Fe,"runProfiles");async function Ve(){let e=await y(),o=w(e),t=P(e),r=await R(e,o),n=await pe(t,r);console.log(JSON.stringify(n,null,2))}g(Ve,"runAccount");async function We(e){let o=await y(),t=P(o),r=re(o),n=await ue(t,r);console.log(JSON.stringify(n,null,2))}g(We,"runHealth");async function qe(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=typeof e.branch=="string"?String(e.branch):void 0,f=await $(n,i,a.id,{branch:s});if(!f?.id){console.log("no deployments found");return}let c=await ie(n,i,f.id),d=(c&&Array.isArray(c.toolsJson)?c.toolsJson:null)||(c&&typeof c.metadataJson=="object"&&c.metadataJson?c.metadataJson.tools:null),u=Array.isArray(d)?d:[];if(u.length===0){console.log("no tools found");return}for(let l of u){let m=l,h=m.profile||m.function,I=m.name||h?.name||"unknown",p=m.description||h?.description||"";console.log(p?`${I} - ${p}`:I)}}g(qe,"runToolList");async function Ye(e,o,t){let r=await y(),n=w(r),i=P(r),a=await R(r,n),{app:s}=await T(i,a,o),f=typeof e.branch=="string"?String(e.branch):void 0,c=await $(i,a,s.id,{branch:f});if(!c?.id)throw new Error("no deployments found");let d;if(typeof e.body=="string")try{d=JSON.parse(e.body)}catch{throw new Error("tool body must be valid JSON")}let u=typeof e.method=="string"?String(e.method).toUpperCase():"POST",l=await fe(n,a,{appId:s.id,deploymentId:c.id,toolName:t,method:u,body:d,headers:a?{"openpond-api-key":a}:void 0});if(!l.ok)throw new Error(l.error||`tool failed (${l.status})`);let m=l.data??{ok:!0};console.log(JSON.stringify(m,null,2))}g(Ye,"runToolRun");async function Qe(e,o,t){let r=await y(),n=w(r),i=P(r),a=await R(r,n),{app:s}=await T(i,a,o),f=typeof e.branch=="string"?String(e.branch):void 0,c=typeof e.deploymentId=="string"?String(e.deploymentId):void 0,d=c?{id:c}:await $(i,a,s.id,{branch:f});if(!d?.id)throw new Error("no deployments found");let u=typeof e.body=="string"?M(String(e.body),"body"):{};if(!u||typeof u!="object"||Array.isArray(u))throw new Error("body must be a JSON object");let l=typeof e.method=="string"?String(e.method).toUpperCase():"POST",m={...u,appId:s.id,deploymentId:d.id,toolName:t,method:l},h=await ge(i,a,m);console.log(JSON.stringify(h,null,2))}g(Qe,"runBacktestRun");async function Xe(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a,handle:s,repo:f}=await T(n,i,o),c=typeof e.branch=="string"?String(e.branch):void 0,d=typeof e.deploymentId=="string"?String(e.deploymentId):void 0,u=d?{id:d}:await $(n,i,a.id,{branch:c});if(!u?.id){console.log("no deployments found");return}await we({baseUrl:n,apiKey:i,deploymentId:u.id,prefix:`[${s}/${f}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}g(Xe,"runDeployWatch");async function Ze(e,o){let r=((typeof e.name=="string"?e.name:null)||o.join(" ")).trim();if(!r)throw new Error("usage: repo create --name <name> [--team-id <id>] [--path <dir>] [--template <owner/repo|url>] [--template-branch <branch>] [--empty|--opentool] [--sandbox] [--token] [--auto-schedule-migration <true|false>]");let n=await y(),i=w(n),a=await R(n,i),s=P(n),f=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0,c=typeof e.template=="string"?e.template.trim():"";if(c&&(e.empty==="true"||e.opentool==="true"))throw new Error("choose one: --template or --empty/--opentool");if(e.empty==="true"&&e.opentool==="true")throw new Error("choose one: --empty or --opentool");let d=typeof e.description=="string"?e.description.trim():void 0,u=typeof e.templateBranch=="string"&&e.templateBranch.trim().length>0?e.templateBranch.trim():void 0,l=typeof e.env=="string"?M(e.env,"env"):void 0;if(l){if(typeof l!="object"||Array.isArray(l))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(l))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}if(c){e.deployOnPush!==void 0&&console.warn("deploy-on-push is not used for template create (auto deploys)");let b=Re(c,i),k=(await se(s,a,[{name:r,...d?{description:d}:{},templateRepoUrl:b,...u?{templateBranch:u}:{},...l?{envVars:l}:{}}],f)).items?.[0];if(!k||k.status!=="ok"||!k.appId)throw new Error(k?.error||"Template create failed");console.log(`app_id: ${k.appId}`),k.deploymentId&&console.log(`deployment_id: ${k.deploymentId}`),k.conversationId&&console.log(`conversation_id: ${k.conversationId}`);return}let m=process.cwd(),h=typeof e.path=="string"?e.path:typeof e.dir=="string"?e.dir:null,I=h&&h.trim().length>0?h.trim():$e.isTTY?await he(m):m,p=U.resolve(I);if(W(p)){if(!(await V.stat(p)).isDirectory())throw new Error(`path is not a directory: ${p}`)}else await V.mkdir(p,{recursive:!0});let Pe=(await V.readdir(p)).filter(b=>b!==".git").length===0,x=v(e.yes)||v(e.force);if(!Pe&&!x&&!await S(`Directory is not empty (${p}). Continue?`,!1)){console.log("aborted");return}let ke=U.join(p,".git");if(!W(ke)){if(!(x?!0:await S("Initialize git repository here?",!0))){console.log("aborted");return}let A=await B("git",["init"],{cwd:p});if(A.code!==0)throw new Error(`git init failed: ${A.stderr.trim()||A.stdout.trim()||"unknown error"}`)}let K=await F(p,"origin");if(K&&!x&&!await S(`Remote "origin" already set (${K}). Replace it?`,!1)){console.log("aborted");return}let q=e.opentool==="true"?"opentool":"empty",Te=v(e.sandbox),Be=v(e.deployOnPush),N=e.autoScheduleMigration,Y=typeof N=="string"||typeof N=="boolean",Ee=Y?v(N):void 0,E=await ae(s,a,{name:r,...f?{teamId:f}:{},...d?{description:d}:{},...q?{repoInit:q}:{},...Te?{sandbox:!0}:{},...l?{envVars:l}:{},...Be?{deployOnPush:!0}:{},...Y?{autoScheduleMigration:Ee}:{}}),O=me(E);z(O);let J=v(e.token)||v(e.setRemoteToken),Oe=D(O,a),Q=J?Oe:O,_=await B("git",K?["remote","set-url","origin",Q]:["remote","add","origin",Q],{cwd:p});if(_.code!==0)throw new Error(`git remote failed: ${j(_.stderr.trim()||_.stdout.trim()||"unknown error")}`);let Ae=J?G(O):O;console.log(`app_id: ${E.appId}`),E.gitOwner&&E.gitRepo&&console.log(`repo: ${E.gitOwner}/${E.gitRepo}`),console.log(`remote: ${Ae}`),console.log('next: git add . && git commit -m "init"');let Ie=E.defaultBranch||"master";console.log(`next: openpond repo push --path ${p} --branch ${Ie}`),J||console.log(`token-remote (non-interactive): git -C ${p} remote set-url origin ${G(O)}`);try{await ye({apiBase:s,apiKey:a,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}g(Ze,"runRepoCreate");async function Se(e){let o=await B("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e});if(o.code!==0)return null;let t=o.stdout.trim();return t.length>0?t:null}g(Se,"resolveGitBranch");async function et(e){let o=await y(),t=w(o),r=await R(o,t),n=typeof e.path=="string"?e.path:typeof e.dir=="string"?e.dir:null,i=U.resolve(n&&n.trim().length>0?n.trim():"."),a=U.join(i,".git");if(!W(a))throw new Error(`git repo not found at ${i} (missing .git)`);let s=await F(i,"origin");if(!s)throw new Error("origin remote not set; run `openpond repo create` first");z(s);let c=(typeof e.branch=="string"?e.branch.trim():"")||await Se(i);if(!c)throw new Error("unable to resolve git branch; pass --branch");let d;try{d=D(s,r)}catch{throw new Error("origin remote must be https for tokenized pushes")}let u=v(e.keepTokenRemote)||v(e.token)||v(e.setRemoteToken),l=s.includes("x-access-token:"),m=!u&&!l?s:null,h=process.env.GIT_TERMINAL_PROMPT;process.env.GIT_TERMINAL_PROMPT="0";try{if(!l){let p=await B("git",["remote","set-url","origin",d],{cwd:i});if(p.code!==0)throw new Error(`git remote set-url failed: ${j(p.stderr.trim()||p.stdout.trim()||"unknown error")}`)}if((await B("git",["push","-u","origin",c],{cwd:i,inherit:!0})).code!==0)throw new Error("git push failed")}finally{m&&await B("git",["remote","set-url","origin",m],{cwd:i}).catch(()=>null),h===void 0?delete process.env.GIT_TERMINAL_PROMPT:process.env.GIT_TERMINAL_PROMPT=h}}g(et,"runRepoPush");async function tt(e){if(e.length===0)throw new Error("usage: opentool <init|validate|build> [args]");let o=process.platform==="win32"?"npx.cmd":"npx";if((await B(o,["opentool",...e],{inherit:!0})).code!==0)throw new Error("opentool command failed")}g(tt,"runOpentool");async function nt(){let e="openpond",o=Z(),t=await te(e),r=`npm i -g ${e}@${t}`,n=ee(o,t);if(n===0){console.log(`${e} is up to date (${o})`);return}if(n===-1){console.log(`Update available: ${o} -> ${t}`),console.log(`Run: ${r}`);return}if(n===1){console.log(`Installed version (${o}) is newer than npm latest (${t}).`);return}if(o===t){console.log(`${e} is up to date (${o})`);return}console.log(`Installed: ${o}`),console.log(`Latest: ${t}`),console.log(`Run: ${r}`)}g(nt,"runCheckUpdate");export{Ge as a,je as b,ze as c,He as d,Fe as e,Ve as f,We as g,qe as h,Ye as i,Qe as j,Xe as k,Ze as l,Se as m,et as n,tt as o,nt as p};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{g as c}from"./chunk-25GCTLAZ.js";import{ca as f}from"./chunk-QVRNOGAU.js";import{a as n}from"./chunk-FTQLQJQV.js";import{promises as v}from"node:fs";import u from"node:path";async function j(e){let s=await c(e.store,e.harnessRelease);if(!s)throw new Error("Profile evaluation Harness release is unavailable.");return w({...e,runtime:s})}n(j,"profileEvaluationsForRelease");async function w(e){let s=e.runtime,o=s.release.harnessRelease;if(o.id!==e.harnessRelease.id||o.contentHash!==e.harnessRelease.contentHash)throw new Error("Profile evaluation runtime differs from its requested release.");let r=o.metadata.profile;if(!r||typeof r!="object"||r.id!==e.ref.profileId||r.sourceRevision!==e.sourceRevision)throw new Error("Profile evaluation release differs from its accepted source.");let i={profileRef:e.ref,sourceRevision:e.sourceRevision,harnessRelease:e.harnessRelease};if(!o.files.some(a=>a.path==="evals/catalog.json"))return{...i,catalogHash:null,definitions:[],suites:[]};let d=u.join(s.release.bundlePath,"source"),t=n(async a=>o.files.some(g=>g.path===a)?v.readFile(u.join(d,...a.split("/"))):void 0,"read"),[R,p,m]=await Promise.all([t("evals/catalog.json"),t("workflows/catalog.json"),t("workflows/actions.json")]),{catalog:l,catalogHash:h}=f({agentSnapshot:s.release.agentSnapshot,harnessRelease:o,catalogBytes:R,workflowBytes:p,actionBytes:m});return{...i,catalogHash:h,definitions:l.definitions,suites:l.suites}}n(w,"profileEvaluationsForRuntime");export{j as a,w as b};