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.
- package/dist/app-server.d.ts +18127 -5586
- package/dist/app-server.js +1 -1
- package/dist/chunks/actions-command-CRDLSPFA.js +2 -0
- package/dist/chunks/{app-layer-OV7RVSQW.js → app-layer-MDJFV3HZ.js} +1 -1
- package/dist/chunks/app-server-runtime-PJONTCCO.js +2 -0
- package/dist/chunks/apps-MD2DKEDW.js +2 -0
- package/dist/chunks/{chunk-T5QA4W2H.js → chunk-25GCTLAZ.js} +5 -5
- package/dist/chunks/chunk-3BJ4P5LI.js +520 -0
- package/dist/chunks/chunk-3SRIPOJQ.js +2 -0
- package/dist/chunks/{chunk-7EDOA6KD.js → chunk-4EGDKOYP.js} +3 -3
- package/dist/chunks/{chunk-QUNRWDVO.js → chunk-5ZFEQLRI.js} +3 -3
- package/dist/chunks/chunk-6BL2ZIAP.js +184 -0
- package/dist/chunks/chunk-6QUICEQA.js +5 -0
- package/dist/chunks/chunk-7D2WMUWK.js +3 -0
- package/dist/chunks/chunk-7KIBRK3A.js +4 -0
- package/dist/chunks/{chunk-O277DPTX.js → chunk-B6LYKEMU.js} +1 -1
- package/dist/chunks/{chunk-ZG7QX66E.js → chunk-CR6CDOKS.js} +8 -8
- package/dist/chunks/chunk-CXS3WXL3.js +2 -0
- package/dist/chunks/chunk-DWGB536R.js +19 -0
- package/dist/chunks/{chunk-6UPCR6EL.js → chunk-EG55BFQ4.js} +1 -1
- package/dist/chunks/chunk-ELNJUG64.js +17 -0
- package/dist/chunks/{chunk-HI7W3IVO.js → chunk-FXIUKYUR.js} +12 -12
- package/dist/chunks/chunk-GEDEVI4Y.js +2 -0
- package/dist/chunks/chunk-H3C4ZYEA.js +16 -0
- package/dist/chunks/chunk-HUBI3RUK.js +2 -0
- package/dist/chunks/{chunk-IE2WZ3I3.js → chunk-IYRHG54Q.js} +1 -1
- package/dist/chunks/chunk-J65BMG5Q.js +2 -0
- package/dist/chunks/chunk-KOR2AZVB.js +24 -0
- package/dist/chunks/{chunk-LLNCHGE4.js → chunk-LL4QP2IM.js} +1 -1
- package/dist/chunks/chunk-M2YXYBSP.js +2 -0
- package/dist/chunks/chunk-NPOHW5OU.js +2 -0
- package/dist/chunks/{chunk-KRC2S5QF.js → chunk-NXUCGKY2.js} +3 -3
- package/dist/chunks/chunk-PDIT2QS7.js +8 -0
- package/dist/chunks/{chunk-T7MJBBHE.js → chunk-PGKEDR3S.js} +1 -1
- package/dist/chunks/chunk-QVRNOGAU.js +21 -0
- package/dist/chunks/chunk-TNXILYI6.js +2 -0
- package/dist/chunks/chunk-TVQE3JMI.js +2 -0
- package/dist/chunks/chunk-U6SFIFDM.js +2409 -0
- package/dist/chunks/chunk-V6WBSW5Q.js +3 -0
- package/dist/chunks/chunk-VESOG2SS.js +2 -0
- package/dist/chunks/chunk-VFTUP5NQ.js +2 -0
- package/dist/chunks/{chunk-G2WJC6DE.js → chunk-VVV5I22A.js} +2 -2
- package/dist/chunks/chunk-XPB6NY7L.js +42 -0
- package/dist/chunks/{chunk-VG7XO6PR.js → chunk-XWLI7WJH.js} +2 -24
- package/dist/chunks/{chunk-KIGN4FI6.js → chunk-YWX7FKLM.js} +1 -1
- package/dist/chunks/cli-BKBH6FZY.js +2 -0
- package/dist/chunks/{configuration-command-ANYM5UYG.js → configuration-command-75ZCMZ6X.js} +1 -1
- package/dist/chunks/connected-evidence-UPUVVQ6P.js +2 -0
- package/dist/chunks/{continual-MHMPLLUZ.js → continual-WWPXK2LO.js} +1 -1
- package/dist/chunks/core-commands-SS2GV7WU.js +2 -0
- package/dist/chunks/datasets-TCLXV34N.js +2 -0
- package/dist/chunks/desktop-test-7ZHZHUB6.js +3 -0
- package/dist/chunks/{dist-GC7DXKTI.js → dist-VDN6E54A.js} +1 -1
- package/dist/chunks/evaluation-coordination-ZX5GLMRC.js +2 -0
- package/dist/chunks/experiment-improvements-O6DCQXCX.js +2 -0
- package/dist/chunks/experiments-JOQOBQXY.js +2 -0
- package/dist/chunks/{extension-5LQRULQP.js → extension-3M2CSWZB.js} +1 -1
- package/dist/chunks/{help-NTSTG6RR.js → help-RLRU33WN.js} +1 -1
- package/dist/chunks/hosted-experiment-improvement-IKO677PI.js +3 -0
- package/dist/chunks/hosted-harness-runtime-H2Q2SNZT.js +2 -0
- package/dist/chunks/hosted-profile-candidate-FHHSLJNO.js +3 -0
- package/dist/chunks/hosted-profile-compiler-5B256VV3.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-Z25TZOW4.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-MFYPLTZQ.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-MAB2PSCC.js +3 -0
- package/dist/chunks/human-review-6H3BW7OZ.js +2 -0
- package/dist/chunks/learning-Y6WNDVQW.js +2 -0
- package/dist/chunks/{opchat-77PRAQ5W.js → opchat-3E4FH3DC.js} +1 -1
- package/dist/chunks/{organizations-2KWTYIPU.js → organizations-PRVCUPMN.js} +1 -1
- package/dist/chunks/{profile-HVLH672B.js → profile-DC4UEVVG.js} +1 -1
- package/dist/chunks/project-agent-ZX3CELKI.js +2 -0
- package/dist/chunks/sandbox-command-HHQMZK3G.js +2 -0
- package/dist/chunks/{sandbox-template-QMB6DSTS.js → sandbox-template-DFHWHCIQ.js} +1 -1
- package/dist/chunks/{src-N447LUPO.js → src-CREVQF7M.js} +1 -1
- package/dist/chunks/src-MAZ7OBVY.js +327 -0
- package/dist/chunks/taskset-TB2ICAZU.js +2 -0
- package/dist/chunks/{teams-bot-RNHQMPQA.js → teams-bot-BNBL57S5.js} +1 -1
- package/dist/chunks/training-FW5FOGR3.js +2 -0
- package/dist/chunks/{workspaces-V5YTXJLV.js → workspaces-WTPFRJMS.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/profile/local-profile.d.ts +2 -0
- package/dist/web/assets/App-BgeSqoRS.css +1 -0
- package/dist/web/assets/App-C6EWFrLP.js +227 -0
- package/dist/web/assets/{AppDialog-v-BfV1lA.js → AppDialog-Cgn_fTGR.js} +1 -1
- package/dist/web/assets/AppTerminalPanel-cNYkSvM2.js +2 -0
- package/dist/web/assets/{AppsView-Dl-37F0w.js → AppsView-9zpKBSLv.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-DltF217k.js → BrowserSidebar-Xo21N1ej.js} +1 -1
- package/dist/web/assets/{CartesianChart-gK-Ll3kX.js → CartesianChart-Bg3Lm5mZ.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-BuWquQYn.js → CollaborationTabs-BIfgIy5X.js} +1 -1
- package/dist/web/assets/{CommandMenu-Cs5S8t-Q.js → CommandMenu-D9BimyPx.js} +1 -1
- package/dist/web/assets/{CommunityView-BJBkQEMV.js → CommunityView-BoW-yLju.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-C36fKc-v.js → ComposerCreateImproveStrip-BIKVEgr1.js} +1 -1
- package/dist/web/assets/{GetStartedView-9A49MgYA.js → GetStartedView-B99v4-hh.js} +1 -1
- package/dist/web/assets/HostedModelLearningReview-DEScpX2Z.js +1 -0
- package/dist/web/assets/HostedModelLearningSettings-4HT5eEiL.js +1 -0
- package/dist/web/assets/LabModelVersionDetailPage-DkYdI7gr.js +1 -0
- package/dist/web/assets/{LabSkillSidebar-BAKym5GY.js → LabSkillSidebar-Bp5XYipm.js} +1 -1
- package/dist/web/assets/LabsRoute-ACN76d2j.css +1 -0
- package/dist/web/assets/LabsRoute-VopO7n34.js +105 -0
- package/dist/web/assets/MainChatThread-3Gg0oDZT.js +2 -0
- package/dist/web/assets/{MainPane-gPkr0OWu.js → MainPane-CUqMVG9-.js} +11 -11
- package/dist/web/assets/{MarkdownText-B-au2zEv.js → MarkdownText-De0WzrEw.js} +1 -1
- package/dist/web/assets/{NativeSkillSidebar-DHFKZ7P1.js → NativeSkillSidebar-B4jtf5RO.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-Dhbf5KJT.js → NewExperienceSwitcher-Bg1DVr96.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-hlAzFK2Y.js → NewProjectDialog-i_wvIBw-.js} +1 -1
- package/dist/web/assets/{OutputsPage-C0N2rOxE.js → OutputsPage-CZiPxLyN.js} +1 -1
- package/dist/web/assets/{ProjectsPage-CkHBgLPx.js → ProjectsPage-BD0eml0M.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-BiW6ZzPN.js → RightChatPanelStack-CEBFPHKP.js} +1 -1
- package/dist/web/assets/{RightSidebarHomePanel-BS9YSdYB.js → RightSidebarHomePanel-BTpU5wGh.js} +1 -1
- package/dist/web/assets/{ScheduledWorkPage-819sQcDR.js → ScheduledWorkPage-Y6XGoh-X.js} +1 -1
- package/dist/web/assets/{SettingsView-BZrOUPZb.js → SettingsView-Kh14f463.js} +3 -3
- package/dist/web/assets/{TeamChatView-CUNcbSa7.js → TeamChatView-5LjuRNd6.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-MIlGPpXe.js → TerminalOverlay-BCWBSotQ.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-BNcyNoa8.js → TrainingCreationPanel-hvOHRVJx.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-CKV16LNC.js → TrainingDraftPanel-CGEHGljE.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-SVgUHnUL.js → UsageSettingsSection-B8nbqhag.js} +1 -1
- package/dist/web/assets/{WorkSidebarPanel-CfkaaFHA.js → WorkSidebarPanel-B6hlPEIs.js} +1 -1
- package/dist/web/assets/{WorkspaceDiffPanel-CQhqlqg5.js → WorkspaceDiffPanel-q8A15-0x.js} +9 -9
- package/dist/web/assets/{WorkspaceEnvironmentMenu-CJB-z2tS.js → WorkspaceEnvironmentMenu-BiFTPWtC.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-B3xtasTt.js → WorkspaceGitDialogs-Dyx4Rbiy.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-DVfyICNZ.js → WorkspaceMonacoEditor-B1dKexHo.js} +60 -60
- package/dist/web/assets/{arrow-up-right-CYG4Vm07.js → arrow-up-right-CCj7SOGp.js} +1 -1
- package/dist/web/assets/chunk-DJWHN7NU-1eQoMoKO.js +1 -0
- package/dist/web/assets/{clipboard-DGSnfljX.js → clipboard-BY6ELc9Z.js} +1 -1
- package/dist/web/assets/{cloud-upload-Bw_zrS2y.js → cloud-upload-BOka5EKK.js} +1 -1
- package/dist/web/assets/cssMode-C34j8ti5.js +1 -0
- package/dist/web/assets/{folder-open-CcGOldH7.js → folder-open-CX2jidFj.js} +1 -1
- package/dist/web/assets/{folder-plus-DEIDaX2B.js → folder-plus-Dh2Q9LP3.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-B-Ao6y--.js → git-commit-horizontal-CfevriuT.js} +1 -1
- package/dist/web/assets/htmlMode-BORwVkZg.js +1 -0
- package/dist/web/assets/index-B9VSiz_z.css +1 -0
- package/dist/web/assets/{index-C8_8-lW7.js → index-BBjRfC--.js} +6 -6
- package/dist/web/assets/{info-DwOXHkN_.js → info-Bv3dbs3G.js} +1 -1
- package/dist/web/assets/{jsonMode-txmGM7K6.js → jsonMode-BYWtZ6AK.js} +4 -4
- package/dist/web/assets/{lspLanguageFeatures-D59Drc_9.js → lspLanguageFeatures-CEAdFSpU.js} +1 -1
- package/dist/web/assets/{minimize-2-C5UCV16_.js → minimize-2-MhorZwY5.js} +1 -1
- package/dist/web/assets/{monaco.contribution-BOmcYK8k.js → monaco.contribution-CDhPpbIo.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CbK7796k.js → monaco.contribution-CN7AWJNd.js} +2 -2
- package/dist/web/assets/monaco.contribution-DHA7FuJX.js +2 -0
- package/dist/web/assets/{monaco.contribution-5HcktwaM.js → monaco.contribution-ZUUVx_3M.js} +2 -2
- package/dist/web/assets/{monitor-D4hpNTai.js → monitor-DLcrkfM5.js} +1 -1
- package/dist/web/assets/{python-Cie4Ghu8.js → python-CXwvPmc4.js} +1 -1
- package/dist/web/assets/{refresh-cw-CIOzrJnj.js → refresh-cw-BTfIxHb3.js} +1 -1
- package/dist/web/assets/{save-D7EtdMHG.js → save-DaN65kMq.js} +1 -1
- package/dist/web/assets/{square-JpDfrqp_.js → square-zRgIUdSv.js} +1 -1
- package/dist/web/assets/toggleHighContrast-BgpFWRpS.css +1 -0
- package/dist/web/assets/{toggleHighContrast-DdGkc-Be.js → toggleHighContrast-DWeRZFzr.js} +1 -1
- package/dist/web/assets/{tsMode-DwgEL7oI.js → tsMode-nLBhKngY.js} +1 -1
- package/dist/web/assets/{upload-BkwOzqS-.js → upload-BfUu4Eu1.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-bO0Qycih.js → useLocalAgentSchedules-BCITWhg2.js} +1 -1
- package/dist/web/assets/{useSessionTurnCache-DxUh5scW.js → useSessionTurnCache-BQMWfV8u.js} +1 -1
- package/dist/web/assets/{wifi-off-D6Keejtn.js → wifi-off-bdka5es5.js} +1 -1
- package/dist/web/assets/{workers-BgG66q0n.js → workers-z7XHFFNs.js} +1 -1
- package/dist/web/assets/{yaml-COMRGPWg.js → yaml-BTr4i4DD.js} +1 -1
- package/dist/web/index.html +5 -5
- package/docs/command-reference.md +85 -1
- package/package.json +6 -2
- package/dist/chunks/actions-command-DWQ3VGGP.js +0 -2
- package/dist/chunks/app-server-runtime-JVLXE5LF.js +0 -2
- package/dist/chunks/apps-5DQAYDNI.js +0 -2
- package/dist/chunks/chunk-3D4QN4NM.js +0 -19
- package/dist/chunks/chunk-45UOD2DA.js +0 -2
- package/dist/chunks/chunk-5IN3HQJU.js +0 -2
- package/dist/chunks/chunk-6KKQXETR.js +0 -5
- package/dist/chunks/chunk-6XF4GI35.js +0 -2
- package/dist/chunks/chunk-7KC5LWCU.js +0 -2
- package/dist/chunks/chunk-7R7O2XXP.js +0 -2
- package/dist/chunks/chunk-DGD52VZC.js +0 -13
- package/dist/chunks/chunk-E6WT4HWF.js +0 -3
- package/dist/chunks/chunk-EWQZASG4.js +0 -2400
- package/dist/chunks/chunk-IFI24VF6.js +0 -5
- package/dist/chunks/chunk-KDOS6YMH.js +0 -2
- package/dist/chunks/chunk-MDE3HHLH.js +0 -2
- package/dist/chunks/chunk-P45OSKQL.js +0 -4
- package/dist/chunks/chunk-ROJX6IYW.js +0 -578
- package/dist/chunks/chunk-SXN3QOW4.js +0 -3
- package/dist/chunks/chunk-V44RF57H.js +0 -2
- package/dist/chunks/chunk-VJJ3UXOI.js +0 -42
- package/dist/chunks/chunk-W3NG7YLC.js +0 -8
- package/dist/chunks/chunk-XMKAMR7M.js +0 -2
- package/dist/chunks/cli-7D7CYCIY.js +0 -2
- package/dist/chunks/core-commands-TYWE3TNW.js +0 -2
- package/dist/chunks/datasets-FM3UBK4R.js +0 -13
- package/dist/chunks/desktop-test-Z5IKJU3P.js +0 -3
- package/dist/chunks/experiments-IWBRIDQE.js +0 -2
- package/dist/chunks/hosted-harness-runtime-S75BLD57.js +0 -2
- package/dist/chunks/hosted-profile-compiler-JNNYWLC7.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-IK4Y2EQZ.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-YWKUB7RT.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-JXOF73BB.js +0 -3
- package/dist/chunks/project-agent-7NLKJMAM.js +0 -2
- package/dist/chunks/sandbox-command-FNS4JBVC.js +0 -2
- package/dist/chunks/src-TZBL6NA7.js +0 -325
- package/dist/chunks/taskset-BZYQT65N.js +0 -2
- package/dist/chunks/training-7PST5HZU.js +0 -2
- package/dist/web/assets/App-7h_oHCFd.css +0 -1
- package/dist/web/assets/App-BEQmrTGQ.js +0 -226
- package/dist/web/assets/AppTerminalPanel-CnKcllS2.js +0 -2
- package/dist/web/assets/HostedModelLearningReview-JgxDUDio.js +0 -1
- package/dist/web/assets/HostedModelLearningSettings-CH7CsAhw.js +0 -1
- package/dist/web/assets/LabModelVersionDetailPage-N2qcy1Yv.js +0 -1
- package/dist/web/assets/LabsRoute-DooCmsN8.css +0 -1
- package/dist/web/assets/LabsRoute-Y992kQoQ.js +0 -52
- package/dist/web/assets/MainChatThread-CPhREQso.js +0 -2
- package/dist/web/assets/cssMode-CSpYOKj-.js +0 -1
- package/dist/web/assets/htmlMode-DstkgJXG.js +0 -1
- package/dist/web/assets/index-DUIWDN8o.css +0 -1
- package/dist/web/assets/monaco.contribution-BomZ1gys.js +0 -2
- package/dist/web/assets/toggleHighContrast-B7NOMXDY.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{F as h}from"./chunk-
|
|
2
|
+
import{F as h}from"./chunk-NXUCGKY2.js";import{h as S}from"./chunk-25GCTLAZ.js";import{fa as A}from"./chunk-U6SFIFDM.js";import{Fa as O,Ga as k,i as I,l as P,o as b,q as H,r as w,v as f}from"./chunk-5ZFEQLRI.js";import{l as g}from"./chunk-HZP5U2AA.js";import{b as c}from"./chunk-ES2ISFJC.js";import{a as u}from"./chunk-FTQLQJQV.js";import{randomUUID as T}from"node:crypto";import{readFile as v}from"node:fs/promises";import p from"node:path";import{randomUUID as $}from"node:crypto";var y=c.object({revision:c.number().int().nonnegative(),overlay:H}).strict(),z=y.extend({proposal:w}).strict(),m=class{constructor(e){this.client=e}client;static{u(this,"HostedHarnessOverlayStorage")}async getHarnessRunOverlay(e){let s=await this.client.request({contractVersion:h,requestId:$(),operation:"harness/overlay/get",params:{runId:e}});return s===null?null:y.parse(s).overlay}async putHarnessRunOverlay(e){let s=H.parse(e.overlay);if(!e.requestId.trim()||s.revision!==(e.expectedRevision===null?0:e.expectedRevision+1))throw new Error("Hosted Harness overlay mutation requires a stable request and next revision.");let r=y.parse(await this.client.request({contractVersion:h,requestId:e.requestId,operation:"harness/overlay/put",params:{runId:s.runId,expectedRevision:e.expectedRevision,overlay:s}}));if(r.revision!==s.revision||r.overlay.contentHash!==s.contentHash)throw new Error("Host Harness overlay response changed committed identity.");return r.overlay}async createHarnessRunOverlay(e){if(e.revision!==0||e.status!=="active")throw new Error("A new Harness run overlay must be active at revision 0.");return this.putHarnessRunOverlay({overlay:e,expectedRevision:null,requestId:`harness-overlay:${e.runId}:${e.contentHash}`})}async ensureHarnessRunOverlay(e){let s=await this.getHarnessRunOverlay(e.runId);if(s){if(s.workspace.workspaceId!==e.workspace.id||s.baseHarnessRelease.id!==e.harnessRelease.id||s.baseHarnessRelease.contentHash!==e.harnessRelease.contentHash)throw new Error("The durable Agent run is already bound to another Harness release.");return s}let r=f({schemaVersion:"openpond.harnessRunOverlay.v1",id:`overlay-${g({runId:e.runId,harnessRelease:e.harnessRelease}).slice(0,24)}`,runId:e.runId,baseHarnessRelease:e.harnessRelease,workspace:{workspaceId:e.workspace.id,revision:e.workspace.revision,sourceRevision:e.workspace.sourceRevision,channelRevision:e.workspace.currentChannel.revision},revision:0,status:"active",edits:[],createdAt:e.admittedAt,updatedAt:e.admittedAt,metadata:{}});return this.createHarnessRunOverlay(r)}async appendHarnessRunOverlayEditsAtomically(e){return this.transition(e,"append")}async freezeHarnessRunOverlayAtomically(e){return this.transition({...e,edits:[]},"freeze")}async abandonHarnessRunOverlayAtomically(e){return this.transition({...e,edits:[]},"abandon")}async freezeHarnessRunOverlayWithProposalAtomically(e){let s=await this.getHarnessRunOverlay(e.runId);if(!s||s.revision!==e.expectedRevision||s.status!=="active")throw new Error("Hosted Harness overlay revision or status changed.");let r=new Set(s.edits.map(i=>i.id));for(let i of e.edits){if(r.has(i.id))throw new Error(`Harness overlay edit id already exists: ${i.id}.`);r.add(i.id)}let{contentHash:l,...n}=s,t=f({...n,revision:s.revision+1,status:"frozen",edits:[...s.edits,...e.edits],updatedAt:e.updatedAt}),d=w.parse(e.buildProposal(t)),a=z.parse(await this.client.request({contractVersion:h,requestId:`harness-proposal:${t.runId}:${d.contentHash}`,operation:"harness/overlay/freezeProposal",params:{runId:t.runId,expectedRevision:s.revision,overlay:t,proposal:d}}));if(a.overlay.contentHash!==t.contentHash||a.proposal.contentHash!==d.contentHash)throw new Error("Host Harness proposal response changed committed identity.");return{overlay:a.overlay,proposal:a.proposal}}async transition(e,s){let r=await this.getHarnessRunOverlay(e.runId);if(!r||r.revision!==e.expectedRevision||r.status==="abandoned"||s!=="abandon"&&r.status!=="active")throw new Error("Hosted Harness overlay revision or status changed.");if(s==="append"&&e.edits.length===0)throw new Error("Harness overlay append requires edits.");let l=new Set(r.edits.map(a=>a.id));for(let a of e.edits){if(l.has(a.id))throw new Error(`Harness overlay edit id already exists: ${a.id}.`);l.add(a.id)}let{contentHash:n,...t}=r,d=f({...t,revision:r.revision+1,status:s==="append"?"active":s==="freeze"?"frozen":"abandoned",edits:[...r.edits,...e.edits],updatedAt:e.updatedAt});return this.putHarnessRunOverlay({overlay:d,expectedRevision:r.revision,requestId:`harness-overlay:${d.runId}:${d.contentHash}`})}};var N=c.object({workspace:b,release:c.object({id:c.string().min(1),contentHash:c.string().regex(/^[a-f0-9]{64}$/),sourceRevision:c.string().min(1),assetsPath:c.string().min(1)}).strict()}).strict();async function C(o,e=null){let s=await o.request({contractVersion:h,requestId:T(),operation:"harness/get",params:{reference:e}});if(s===null)return null;let r=N.parse(s);if(!p.isAbsolute(r.release.assetsPath))throw new Error("Hosted Harness assets path must be absolute.");let[l,n]=await Promise.all([v(p.join(r.release.assetsPath,"agent-snapshot.json"),"utf8"),v(p.join(r.release.assetsPath,"harness-release.json"),"utf8")]),t=A.parse({schemaVersion:"openpond.localHarnessReleaseRecord.v1",workspaceId:r.workspace.id,sourceRevision:r.release.sourceRevision,agentSnapshot:I.parse(JSON.parse(l)),harnessRelease:P.parse(JSON.parse(n)),bundlePath:r.release.assetsPath,createdAt:new Date().toISOString()});if(t.harnessRelease.id!==r.release.id||t.harnessRelease.contentHash!==r.release.contentHash||(e!==null?e.id!==r.release.id||e.contentHash!==r.release.contentHash:r.workspace.currentChannel.release?.contentHash!==r.release.contentHash))throw new Error("Hosted Harness release differs from its bound workspace.");return S({workspace:r.workspace,release:t})}u(C,"loadHostedHarnessRuntime");async function se(o,e){let s=e.profileComponentBinding,r=e.profileWorkflowBinding;if(s){if(r||e.currentProfile?.profileId!==s.profileId)throw new Error("Profile component binding differs from the session Profile reference.");let n=await x(o,s.harnessRelease);if(E(n,s.profileId,s.sourceRevision,e.currentProfile?.repositoryId),s.target.kind==="profile")return n;if(s.target.kind==="skill"){let i=s.target.skillPath;if(!n.release.agentSnapshot.skills.some(j=>j.path===i))throw new Error("Bound Profile Skill is unavailable in its released source.");let R=await v(p.join(n.release.bundlePath,"source",i),"utf8");return{...n,instructionContext:[n.instructionContext,`Released Profile Skill (${i}):
|
|
3
3
|
${R}`].join(`
|
|
4
4
|
|
|
5
5
|
`)}}let t=await q(n),d=s.target.actionId,a=t.actions.find(i=>i.id===d);if(!a)throw new Error("Bound Profile Agent action is unavailable in its released source.");return{...n,workflowAction:a}}if(r){if(e.currentProfile?.profileId!==r.profileId)throw new Error("Profile workflow binding differs from the session Profile reference.");let n=await x(o,r.harnessRelease);E(n,r.profileId,r.sourceRevision,e.currentProfile?.repositoryId);let t=await q(n),d=k({binding:r,harnessRelease:n.release.harnessRelease,catalog:t.catalog,catalogHash:t.catalogHash}),a=d.invocation.kind==="agent_action"?d.invocation.actionId:null,i=a?t.actions.find(R=>R.id===a):void 0;if(a&&!i)throw new Error(`Bound Profile action ${a} is missing from its release.`);return{...n,workflow:d,...i?{workflowAction:i}:{}}}let l=await new m(o).getHarnessRunOverlay(e.id);return C(o,l?.baseHarnessRelease??null)}u(se,"loadHostedHarnessRuntimeForSession");async function x(o,e){let s=await C(o,e);if(!s)throw new Error("The bound Profile Harness release is unavailable.");return s}u(x,"requireRelease");function E(o,e,s,r){let l=o.release.harnessRelease.metadata.profile;if(!l||typeof l!="object"||l.id!==e||l.sourceRevision!==s||l.repositoryId!==void 0&&l.repositoryId!==r)throw new Error("Bound Profile source differs from its released Harness source.")}u(E,"assertProfileProvenance");async function q(o){let e=p.join(o.release.bundlePath,"source"),[s,r]=await Promise.all([v(p.join(e,"workflows","catalog.json")),v(p.join(e,"workflows","actions.json"))]);return O({agentSnapshot:o.release.agentSnapshot,harnessRelease:o.release.harnessRelease,catalogBytes:s,actionBytes:r})}u(q,"loadHostedProfileCatalog");export{m as a,C as b,se as c};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as be,b as Ae,c as Ie,d as ve}from"./chunk-V62BHD5G.js";import{c as O,i as L}from"./chunk-DXAZUJPA.js";import{a as Oe}from"./chunk-6FA3GG5B.js";import{f as Re}from"./chunk-H7IWJN7L.js";import{a as s}from"./chunk-FTQLQJQV.js";var
|
|
3
|
-
`)),this.name="OpenPondProfileSetupRequiredError",this.details={error:"agent_source_setup_required",actionId:t,setupGate:n,missing:o,blockingSetupRequirements:n.blockingRequirements,setupRequirements:n.requirements}}};function
|
|
2
|
+
import{a as be,b as Ae,c as Ie,d as ve}from"./chunk-V62BHD5G.js";import{c as O,i as L}from"./chunk-DXAZUJPA.js";import{a as Oe}from"./chunk-6FA3GG5B.js";import{f as Re}from"./chunk-H7IWJN7L.js";import{a as s}from"./chunk-FTQLQJQV.js";var W=class extends Error{static{s(this,"OpenPondProfileSetupRequiredError")}code="agent_source_setup_required";details;constructor(t,n){let o=n.blockingRequirements.map(r=>r.label);super(["agent_source_setup_required",`Profile action ${t} has unresolved required setup.`,o.length?`Missing setup: ${o.join(", ")}`:""].filter(Boolean).join(`
|
|
3
|
+
`)),this.name="OpenPondProfileSetupRequiredError",this.details={error:"agent_source_setup_required",actionId:t,setupGate:n,missing:o,blockingSetupRequirements:n.blockingRequirements,setupRequirements:n.requirements}}};function K(e){let t=new Map;for(let a of e.sourceSetupRequirements??[]){let l=bt(a);if(e.actionId&&l&&l!==e.actionId&&h(a.actionName)!==e.actionId&&h(a.sourceActionId)!==e.actionId)continue;let c=Ee({record:a,source:"source_upload_metadata",actionId:l});c&&t.set(c.ref,c)}for(let a of e.actionCatalog)if(!(e.actionId&&a.id!==e.actionId&&a.name!==e.actionId))for(let l of a.setupRequirements??[]){let c=Ee({record:l,source:"action_catalog",actionId:a.id});c&&t.set(c.ref,c)}let n=Array.from(t.values()),o=n.filter(a=>a.blocking),r=n.filter(a=>!a.required&&!ne(a.status)).length,i=n.filter(a=>ne(a.status)).length;return{status:It(o),requirementCount:n.length,blockingCount:o.length,optionalMissingCount:r,readyCount:i,requirements:n,blockingRequirements:o}}s(K,"buildOpenPondProfileSetupGate");function oe(e,t){if(t.blockingRequirements.length>0)throw new W(e,t)}s(oe,"assertOpenPondProfileActionReady");function Rt(e){let t=e.actionId?`${e.actionId}: `:"",n=e.required?"required":"optional";return`${t}${e.label} (${n}, ${e.status})`}s(Rt,"formatOpenPondProfileSetupRequirement");function Ee(e){let t=e.source==="action_catalog"&&h(e.record.source)==="source_upload_metadata"?"source_upload_metadata":e.source,n=h(e.record.kind)??h(e.record.type),o=h(e.record.label)??h(e.record.name)??h(e.record.key)??h(e.record.provider)??h(e.record.tool)??h(e.record.command)??h(e.record.packageName)??h(e.record.path)??h(e.record.repo)??h(e.record.url)??h(e.record.id)??n??"setup requirement",r=e.record.required!==!1,i=At(e.record);return{ref:[t,e.actionId??"source",n??"requirement",o].join(":"),source:t,actionId:e.actionId,kind:n,label:o,status:i,required:r,blocking:r&&!ne(i)}}s(Ee,"setupRequirementFromRecord");function bt(e){return h(e.actionId)??h(e.sourceActionId)??h(e.actionName)}s(bt,"setupRequirementActionId");function At(e){let t=h(e.status)??h(e.state);return t?t==="satisfied"||t==="connected"||t==="provided"?"ready":t:typeof e.satisfied=="boolean"?e.satisfied?"ready":"setup_required":typeof e.ready=="boolean"&&e.ready?"ready":"setup_required"}s(At,"setupStatus");function It(e){return e.length===0?"ready":e.some(t=>["blocked","unsupported","unsupported_dependency","stale"].includes(t.status))?"blocked":"setup_required"}s(It,"gateStatus");function ne(e){return e==="ready"||e==="disabled"}s(ne,"isReadyStatus");function h(e){return typeof e=="string"&&e.trim()?e.trim():null}s(h,"text");import{stat as qt}from"node:fs/promises";import se from"node:path";import{spawn as vt}from"node:child_process";import{existsSync as re}from"node:fs";import{readFile as Et,rm as Kn,writeFile as _e}from"node:fs/promises";import ie from"node:path";var Le=["**/node_modules/","**/.bun/","**/.env","**/.env.*","**/.openpond/traces/","**/.openpond/vendor/","**/.openpond/eval-results.json","**/.openpond/artifact-index.json","**/.openpond/source-upload-cache.json",""].join(`
|
|
4
4
|
`);async function Me(e){if(!re(ie.join(e,".git"))){let i=await R(e,["init","-b","main"]);if(i.code!==0)throw new Error(H("git init",i))}let t=ie.join(e,".gitignore");if(re(t)?await xt(t):await _e(t,Le,"utf8"),await _t(e))return;let n=await N(e);if(!n.dirty&&n.files.length===0)return;let o=await R(e,["add","-A"]);if(o.code!==0)throw new Error(H("git add",o));let r=await R(e,["commit","-m","Initialize OpenPond profile"],{env:{...process.env,GIT_AUTHOR_NAME:process.env.GIT_AUTHOR_NAME||"OpenPond",GIT_AUTHOR_EMAIL:process.env.GIT_AUTHOR_EMAIL||"openpond@example.invalid",GIT_COMMITTER_NAME:process.env.GIT_COMMITTER_NAME||"OpenPond",GIT_COMMITTER_EMAIL:process.env.GIT_COMMITTER_EMAIL||"openpond@example.invalid"}});if(r.code!==0&&!/nothing to commit/i.test(r.stdout+r.stderr))throw new Error(H("git commit",r))}s(Me,"ensureProfileGitRepo");async function xt(e){let t=await Et(e,"utf8").catch(()=>""),n=Le.split(/\r?\n/).map(r=>r.trim()).filter(Boolean).filter(r=>!t.split(/\r?\n/).some(i=>i.trim()===r));if(n.length===0)return;let o=t.endsWith(`
|
|
5
5
|
`)||t.length===0?"":`
|
|
6
6
|
`;await _e(e,`${t}${o}${n.join(`
|
|
7
7
|
`)}
|
|
8
|
-
`,"utf8")}s(xt,"ensureProfileGitignoreRules");async function N(e){if(!re(ie.join(e,".git")))return{isRepo:!1,branch:null,head:null,shortHead:null,dirty:!1,upstream:null,ahead:null,behind:null,remoteUrl:null,files:[],error:null};let t=await R(e,["rev-parse","--is-inside-work-tree"]);if(t.code!==0||t.stdout.trim()!=="true")return{isRepo:!1,branch:null,head:null,shortHead:null,dirty:!1,upstream:null,ahead:null,behind:null,remoteUrl:null,files:[],error:t.stderr.trim()||t.stdout.trim()||"not a Git work tree"};let[n,o,r,i,a]=await Promise.all([B(e,["branch","--show-current"]),B(e,["rev-parse","HEAD"]),R(e,["status","--porcelain=v1","-uall"]),B(e,["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"]),B(e,["remote","get-url","origin"])]),l=r.code===0?Mt(r.stdout):[],c=i?await Lt(e):{ahead:null,behind:null},d=o||null;return{isRepo:!0,branch:n||null,head:d,shortHead:d?d.slice(0,12):null,dirty:l.length>0,upstream:i,ahead:c.ahead,behind:c.behind,remoteUrl:a,files:l,error:r.code===0?null:H("git status",r)}}s(N,"loadProfileGitState");async function $e(e,t){let n=await N(e);if(!n.isRepo)throw new Error(n.error??"Active OpenPond profile source is not a Git repo.");if(!n.dirty)return{committed:!1,stdout:"",stderr:"",state:n};let o=await R(e,["add","-A"]);if(o.code!==0)throw new Error(H("git add",o));let r=await R(e,["commit","-m",t]);if(r.code!==0)throw new Error(H("git commit",r));return{committed:!0,stdout:r.stdout,stderr:r.stderr,state:await N(e)}}s($e,"commitProfileChanges");async function qe(e){return B(e,["rev-parse","HEAD"])}s(qe,"profileGitHead");async function _t(e){return(await R(e,["rev-parse","--verify","HEAD"])).code===0}s(_t,"hasGitHead");async function Lt(e){let t=await R(e,["rev-list","--left-right","--count","@{u}...HEAD"]);if(t.code!==0)return{ahead:null,behind:null};let[n,o]=t.stdout.trim().split(/\s+/),r=n?Number.parseInt(n,10):Number.NaN,i=o?Number.parseInt(o,10):Number.NaN;return{ahead:Number.isFinite(i)?i:null,behind:Number.isFinite(r)?r:null}}s(Lt,"loadAheadBehind");async function B(e,t){let n=await R(e,t);return n.code!==0?null:n.stdout.trim()||null}s(B,"gitText");function Mt(e){return e.split(/\r?\n/).map(t=>t.trimEnd()).filter(Boolean).map(t=>{let n=t[0]??" ",o=t[1]??" ",r=`${n}${o}`.trim()||"changed",i=t.slice(3),a=i.split(" -> "),l=n===" "?null:n,c=o===" "?null:o,d=a.length===2?a[1]:i,g=a.length===2?a[0]:null;return{path:xe(d),originalPath:g?xe(g):null,indexStatus:l,worktreeStatus:c,status:r,category:$t(l,c)}})}s(Mt,"parsePorcelainStatus");function $t(e,t){return e==="?"&&t==="?"?"untracked":e==="R"||t==="R"?"renamed":e==="A"||t==="A"?"added":e==="D"||t==="D"?"deleted":e==="M"||t==="M"?"modified":"changed"}s($t,"gitChangeCategory");function xe(e){let t=e.trim();if(!t.startsWith('"')||!t.endsWith('"'))return t;try{return JSON.parse(t)}catch{return t.slice(1,-1)}}s(xe,"unquoteGitPath");function H(e,t){return t.stderr.trim()||t.stdout.trim()||`${e} failed with exit code ${t.code??"unknown"}`}s(H,"gitFailureMessage");async function R(e,t,n={}){return new Promise((o,r)=>{let i=vt("git",t,{cwd:e,env:n.env,stdio:"pipe"}),a="",l="";i.stdout?.on("data",c=>{a+=String(c)}),i.stderr?.on("data",c=>{l+=String(c)}),i.on("error",r),i.on("close",c=>{o({code:c,stdout:a,stderr:l})}),n.input!==void 0?i.stdin?.end(n.input):i.stdin?.end()})}s(R,"runGitCommand");var ae=1500,Te=8*1024*1024,le=100*1024*1024,ce=8,jt={maxFiles:ae,maxFileBytes:Te,maxTotalBytes:le,concurrency:ce},Ft={mode:"single_json_payload",chunkingSupported:!1};async function Tt(e){let t=await R(e,["ls-files","-z"]);if(t.code!==0)throw new Error(t.stderr.trim()||t.stdout.trim()||"git ls-files failed for profile source upload");let n=t.stdout.split("\0").map(c=>c.trim()).filter(Boolean).filter(c=>{let d=c.replace(/\\/g,"/");return Fe(d)&&!Gt(d)}).sort();if(n.length===0)throw new Error("No committed profile source files found to upload.");if(n.length>ae)throw new Error(`Too many profile source files to upload: ${n.length} > ${ae}`);let o=(await je(n,ce,async c=>{let d=se.resolve(e,c),g=se.relative(e,d).replace(/\\/g,"/");if(!Fe(g))throw new Error(`Profile source path escapes repo: ${c}`);let P=await qt(d);if(!P.isFile())return null;if(P.size>Te)throw new Error(`Profile source file is too large: ${c} (${P.size} bytes)`);return{path:g,absolutePath:d,size:P.size,mtimeMs:Math.trunc(P.mtimeMs),ctimeMs:Math.trunc(P.ctimeMs)}})).filter(c=>c!==null),r=0;for(let c of o)if(r+=c.size,r>le)throw new Error(`Profile source upload is too large: ${r} > ${le}`);let i=await Ae(e),a=await je(o,ce,async c=>Ie(c,i));await ve(e,a).catch(()=>{});let l=a.map(c=>c.entry);return{entries:l,fileCount:l.length,totalBytes:r,limits:jt,transport:Ft}}s(Tt,"collectProfileSourceUploadEntries");async function je(e,t,n){let o=new Array(e.length),r=0,i=Math.max(1,Math.min(t,e.length));return await Promise.all(Array.from({length:i},async()=>{for(;r<e.length;){let a=r;r+=1,o[a]=await n(e[a],a)}})),o}s(je,"mapWithConcurrency");function Fe(e){return e.length>0&&!e.includes("\0")&&!se.isAbsolute(e)&&!e.split(/[\\/]+/).some(t=>!t||t==="."||t==="..")}s(Fe,"isSafeProfileSourcePath");function Gt(e){return e.split(/[\\/]+/).some((t,n,o)=>{let r=t.toLowerCase();if(r===".git"||r==="node_modules"||r===".bun"||r===".env"||r.startsWith(".env.")||e.replace(/\\/g,"/")===be)return!0;if(r!==".openpond")return!1;let i=o[n+1]?.toLowerCase();return i==="goals"||i==="traces"||i==="vendor"||i==="eval-results.json"||i==="artifact-index.json"})}s(Gt,"shouldSkipProfileSourcePath");function Ht(e){let t=y(e.checkResult),n=y(t?.deployPlan)??y(e.deployPlan),o=y(n?.source),r=y(n?.checks),i=y(t?.sourceCheckStatus);return{status:e.status,agentId:e.agentId,deployPlanStatus:f(n?.status),canRun:Ge(n?.canRun),canDeploy:Ge(n?.canDeploy),sourceRef:f(o?.sourceRef),sourceCommitSha:f(o?.sourceCommitSha),manifestHash:f(o?.manifestHash),manifestPath:f(o?.manifestPath),setupCommands:b(r?.setupCommands),validationCommands:b(r?.validationCommands),requiredChecks:b(r?.requiredChecks),evalNames:b(r?.evalNames),blockedReasons:b(n?.blockedReasons),staleReasons:b(n?.staleReasons),runtimeId:f(i?.latestRuntimeId),sandboxId:f(i?.latestSandboxId),traceArtifactRefs:b(i?.traceArtifactRefs),evalResultArtifactRefs:b(i?.evalResultArtifactRefs),validatorArtifactRefs:b(i?.validatorArtifactRefs),checkedAt:e.checkedAt??new Date().toISOString(),error:e.error??null}}s(Ht,"hostedSourceCheckStatusFromPayload");function Nt(e){let t=y(e.publishResult),n=y(t?.activeManifestSnapshot)??y(t?.manifestSnapshot)??y(t?.snapshot);return{status:e.status??"published",agentId:e.agentId,snapshotId:f(n?.id),sourceRef:f(n?.sourceRef),sourceCommitSha:f(n?.sourceCommitSha),manifestHash:f(n?.manifestHash),manifestPath:f(n?.manifestPath),buildStatus:f(n?.buildStatus),validationStatus:f(n?.validationStatus),evalStatus:f(n?.evalStatus),publishedAt:f(t?.publishedAt)??f(n?.publishedAt),error:e.error??null}}s(Nt,"hostedPublishStatusFromPayload");function Ut(e){let t=y(e.runResult),n=y(t?.run),o=y(n?.runtimeSource),r=y(n?.metadata),i=y(r?.sourceSummary),a=y(r?.setupGate),l=y(r?.responseSummary),c=y(r?.traceSummary),d=y(r?.evalSummary);return{status:f(n?.status)??(e.error?"failed":"running"),agentId:f(n?.agentId)??e.agentId,runId:f(n?.id),runtimeId:f(n?.runtimeId),sandboxId:f(n?.sandboxId),sourceRef:f(o?.sourceRef)??f(i?.sourceRef)??f(r?.sourceRef),sourceCommitSha:f(o?.sourceCommitSha)??f(i?.sourceCommitSha)??f(r?.hostedHead),manifestHash:f(o?.manifestHash)??f(i?.manifestHash),setupGateStatus:f(a?.status),setupRequirementRefs:Bt(a),artifactRefs:b(l?.artifactRefs),traceArtifactRefs:b(c?.artifactRefs),evalArtifactRefs:b(d?.artifactRefs),startedAt:f(n?.createdAt),completedAt:f(n?.completedAt),error:e.error??null}}s(Ut,"hostedRunSummaryFromPayload");function Dt(e){return e?.status?e.status==="succeeded"||e.status==="passed"?"passed":e.status==="failed"||e.status==="cancelled"?"failed":"running":"not_started"}s(Dt,"hostedRunStatusFromRunSummary");function Bt(e){return e?(Array.isArray(e.requirements)?e.requirements:Array.isArray(e.blockingRequirements)?e.blockingRequirements:[]).map(n=>{let o=y(n);return f(o?.ref)??f(o?.id)??f(o?.label)}).filter(n=>!!n):[]}s(Bt,"setupRequirementRefs");function y(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}s(y,"record");function f(e){return typeof e=="string"&&e.trim()?e.trim():null}s(f,"text");function Ge(e){return typeof e=="boolean"?e:null}s(Ge,"booleanValue");function b(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim().length>0):[]}s(b,"textArray");import{createRequire as st}from"node:module";import{createHash as et,randomUUID as tt}from"node:crypto";import{spawn as hn}from"node:child_process";import{existsSync as k}from"node:fs";import{cp as yn,mkdir as v,readFile as at,readdir as lt,rename as Pe,rm as he,symlink as wn,writeFile as D}from"node:fs/promises";import u from"node:path";function ue(e=null){return{actionCount:0,generatedAt:null,manifestPath:null,registryPath:null,stale:!0,error:e}}s(ue,"emptyProfileCatalogState");function de(e=null){return{skillCount:0,generatedAt:null,stale:!0,error:e}}s(de,"emptyProfileSkillCatalogState");function fe(){return{status:"ready",requirementCount:0,blockingCount:0,optionalMissingCount:0,readyCount:0,requirements:[],blockingRequirements:[]}}s(fe,"emptyProfileSetupGate");function K(){return{changedAgents:[],newAgents:[],deletedAgents:[],changedSkills:[],changedActions:[],changedExtensions:[],setupChanges:[],envRequirementChanges:[],files:[]}}s(K,"emptyProfileDiffSummary");function pe(e=null){return{state:e?"error":"none",message:e??"No active OpenPond profile.",agentCount:0,actionCount:0,defaultAction:null,checkFresh:!1,checkStaleReason:e??"No active profile.",localHead:null,hostedHead:null}}s(pe,"emptyProfileSummary");import{existsSync as U}from"node:fs";import{readFile as zt,stat as Jt}from"node:fs/promises";import Y from"node:path";var He=".openpond/agent-manifest.json",Ne=".openpond/action-registry.json",Wt=".openpond/source-upload-metadata.json",Kt=".openpond/agent-package-origin.json";async function Be(e){return Je({agentId:"default",sourcePath:e,preferred:!0})}s(Be,"loadProfileActionCatalog");async function ze(e){if(e.length===0)return{catalog:{actionCount:0,generatedAt:null,manifestPath:null,registryPath:null,stale:!1,error:null},actionCatalog:[],sourceSetupRequirements:[]};let t=[...e.filter(l=>l.preferred),...e.filter(l=>!l.preferred)],n=await Promise.all(t.map(Je)),o=new Map,r=[];for(let l of n)for(let c of l.actionCatalog){let d=o.has(c.id)?`${c.agentId??"agent"}.${c.sourceActionId??c.id}`:c.id,g=d===c.id?c:{...c,id:d};o.set(d,g),r.push(g)}let i=Vt(n.map(l=>l.catalog.generatedAt)),a=n.map(l=>l.catalog.error).filter(Boolean);return{catalog:{actionCount:r.length,generatedAt:i,manifestPath:n.find(l=>l.catalog.manifestPath)?.catalog.manifestPath??null,registryPath:n.find(l=>l.catalog.registryPath)?.catalog.registryPath??null,stale:n.some(l=>l.catalog.stale),error:a.length>0?a.join("; "):null},actionCatalog:r,sourceSetupRequirements:n.flatMap(l=>l.sourceSetupRequirements)}}s(ze,"loadProfileActionCatalogForSources");async function Je(e){let t=e.sourcePath,n=Y.join(t,He),o=Y.join(t,Ne),r=Y.join(t,Wt),i=Y.join(t,Kt);try{let a=await V(n),l=await V(o),c=await V(r),d=w(await V(i)),g=w(w(a)?.inputSchemas),P=De(w(c)?.setupRequirements)??[],x=Xt(P),S=new Map;for(let m of[...ge(w(a)?.actionCatalog),...ge(w(l)?.actions),...ge(w(a)?.actions)]){let $=p(m.id)??p(m.name);if(!$)continue;let C=S.get($),kt=Zt({sourceRequirementsByAction:x,actionId:$,actionName:p(m.name)}),Ct=Qt(De(m.setupRequirements)??C?.setupRequirements??[],kt),Ot={id:$,agentId:e.agentId,sourcePath:t,sourceActionId:$,name:p(m.name)??C?.name??$,label:p(m.label)??C?.label??rn($),description:p(m.description)??C?.description??null,visibility:p(m.visibility)??C?.visibility??"default",inputSchema:on(m.inputSchema,g)??C?.inputSchema??null,outputSchema:We(m.outputSchema)??C?.outputSchema??null,approvalPolicy:w(m.approvalPolicy)??C?.approvalPolicy??null,artifactPolicy:w(m.artifactPolicy)??C?.artifactPolicy??null,setupRequirements:Ct,mcp:w(m.mcp)??C?.mcp??null,schedulePolicy:w(m.schedulePolicy)??C?.schedulePolicy??null,trace:Yt(w(m.trace)??C?.trace??null,d),implementation:w(m.implementation)??C?.implementation??null,invokesModel:typeof m.invokesModel=="boolean"?m.invokesModel:C?.invokesModel};S.set($,Ot)}let M=Array.from(S.values()).filter(m=>m.visibility!=="internal"&&m.visibility!=="debug"),G=[...a?[]:[He],...l?[]:[Ne]],_=await nn([n,o]);return{catalog:{actionCount:M.length,generatedAt:_,manifestPath:U(n)?n:null,registryPath:U(o)?o:null,stale:G.length>0,error:G.length>0?tn(e,G):null},actionCatalog:M,sourceSetupRequirements:P}}catch(a){return{catalog:{actionCount:0,generatedAt:null,manifestPath:U(n)?n:null,registryPath:U(o)?o:null,stale:!0,error:a instanceof Error?a.message:String(a)},actionCatalog:[],sourceSetupRequirements:[]}}}s(Je,"loadProfileActionCatalogSource");function Yt(e,t){if(!t)return e;let n=p(t.versionId),o=p(t.digest);return!n||!o?e:{...e??{},agentVersionId:n,agentPackageDigest:o,validationReceiptIds:Ue(t.validationReceiptIds),evalReceiptIds:Ue(t.evalReceiptIds)}}s(Yt,"mergeAgentPackageTrace");function Ue(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim().length>0):[]}s(Ue,"stringArray");function Vt(e){let t=0;for(let n of e){if(!n)continue;let o=Date.parse(n);Number.isFinite(o)&&(t=Math.max(t,o))}return t>0?new Date(t).toISOString():null}s(Vt,"latestIso");function Xt(e){let t=new Map;for(let n of e){let o=[p(n.actionId),p(n.sourceActionId),p(n.actionName)].filter(r=>!!r);for(let r of o){let i=t.get(r)??[];i.push(n),t.set(r,i)}}return t}s(Xt,"sourceSetupRequirementsByAction");function Zt(e){return[...e.sourceRequirementsByAction.get(e.actionId)??[],...e.actionName&&e.actionName!==e.actionId?e.sourceRequirementsByAction.get(e.actionName)??[]:[]].map(n=>({...n,source:"source_upload_metadata"}))}s(Zt,"setupRequirementsForActionSource");function Qt(e,t){if(t.length===0)return e;let n=[],o=new Set;for(let r of[...e,...t]){let i=en(r);o.has(i)||(o.add(i),n.push(r))}return n}s(Qt,"mergeSetupRequirements");function en(e){return[p(e.actionId)??p(e.sourceActionId)??p(e.actionName)??"",p(e.kind)??p(e.type)??"",p(e.name)??p(e.key)??p(e.provider)??p(e.tool)??p(e.command)??p(e.packageName)??p(e.path)??p(e.repo)??p(e.url)??p(e.id)??""].join(":")}s(en,"setupRequirementIdentity");function tn(e,t){return[`Profile agent ${e.agentId} at ${e.sourcePath} is missing SDK catalog artifact(s): ${t.join(", ")}.`,"Run `openpond profile check --kind all` after source materialization so each enabled profile agent has inspect/build artifacts."].join(" ")}s(tn,"missingSourceArtifactsMessage");async function V(e){return U(e)?JSON.parse(await zt(e,"utf8")):null}s(V,"readJsonIfExists");async function nn(e){let t=0;for(let n of e){if(!U(n))continue;let o=await Jt(n);t=Math.max(t,o.mtimeMs)}return t>0?new Date(t).toISOString():null}s(nn,"latestMtime");function w(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}s(w,"asRecord");function ge(e){return Array.isArray(e)?e.filter(t=>!!w(t)):[]}s(ge,"records");function De(e){return Array.isArray(e)?e.filter(t=>!!w(t)):null}s(De,"recordArray");function p(e){return typeof e=="string"&&e.trim()?e.trim():null}s(p,"text");function We(e){return p(e)??w(e)}s(We,"schemaValue");function on(e,t){let n=We(e);return typeof n!="string"?n:w(t?.[n])??n}s(on,"resolvedSchemaValue");function rn(e){let t=e.replace(/[._-]+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}s(rn,"titleFromActionId");import{createHash as sn}from"node:crypto";import{existsSync as Xe}from"node:fs";import{readdir as Ze,readFile as an,stat as ln}from"node:fs/promises";import q from"node:path";var me="skills",X="SKILL.md",Ke=8e4;async function Qe(e){let t=q.join(e,me);if(!Xe(t))return{skillCatalog:Ye({stale:!1}),skills:[]};try{let n=await Ze(t,{withFileTypes:!0}),o=(await Promise.all(n.filter(i=>i.isDirectory()).map(i=>un(e,i.name)))).sort((i,a)=>i.name.localeCompare(a.name)||i.path.localeCompare(a.path));fn(o);let r=await pn(e,o);return{skillCatalog:{skillCount:o.length,generatedAt:r,stale:!1,error:null},skills:o}}catch(n){return{skillCatalog:Ye({stale:!0,error:n instanceof Error?n.message:String(n)}),skills:[]}}}s(Qe,"loadProfileSkills");function cn(e){let t=[],n=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/.exec(e);if(!n)return{name:null,description:null,body:e.trim(),messages:["SKILL.md must start with YAML frontmatter bounded by ---."]};let o=n[1]??"",r=(n[2]??"").trim(),i;try{i=Oe.load(o)}catch(d){t.push(`SKILL.md frontmatter is invalid YAML: ${d instanceof Error?d.message:String(d)}`)}let a=mn(i),l=Ve(a?.name),c=Ve(a?.description);return l||t.push("Skill frontmatter must include a non-empty name."),c||t.push("Skill frontmatter must include a non-empty description."),r||t.push("Skill body must be non-empty markdown."),{name:l,description:c,body:r,messages:t}}s(cn,"parseProfileSkillMarkdown");function Ye(e={}){return{skillCount:0,generatedAt:null,stale:e.stale??!0,error:e.error??null}}s(Ye,"emptyProfileSkillCatalogState");async function un(e,t){let n=q.join(me,t,X).replace(/\\/g,"/"),o=q.join(e,n),r=[],i=q.join(e,me,t),a=await dn(i),l="";Xe(o)?l=await an(o,"utf8"):r.push(`Missing ${X}.`),l.length>Ke&&r.push(`Skill markdown exceeds the limit of ${Ke} characters.`);let c=cn(l);r.push(...c.messages);let d=c.name??t,g=c.description??"";return gn(d)||r.push("Skill name must be lowercase kebab-case."),d!==t&&r.push(`Skill name must match its directory name (${t}).`),{name:d,description:g,path:n,scope:"profile",enabled:r.length===0,sourcePath:e,charCount:l.length,sourceHash:Pn(l),validationStatus:r.length>0?"error":"valid",validationMessages:r,resourceFiles:a.filter(P=>P!==X)}}s(un,"loadProfileSkillDirectory");async function dn(e){let t=[];async function n(o,r){let i=await Ze(o,{withFileTypes:!0});await Promise.all(i.map(async a=>{let l=r?`${r}/${a.name}`:a.name;a.isDirectory()?await n(q.join(o,a.name),l):a.isFile()&&t.push(l)}))}return s(n,"visit"),await n(e,""),t.sort()}s(dn,"listPackageFiles");function fn(e){let t=new Map;for(let n of e)t.set(n.name,(t.get(n.name)??0)+1);for(let n of e)(t.get(n.name)??0)<=1||(n.enabled=!1,n.validationStatus="error",n.validationMessages=[...n.validationMessages,`Duplicate skill name: ${n.name}`])}s(fn,"markDuplicateSkillNames");async function pn(e,t){let n=0;for(let o of t){let r=q.dirname(q.join(e,o.path)),i=[X,...o.resourceFiles];for(let a of i){let l=await ln(q.join(r,a)).catch(()=>null);l?.isFile()&&(n=Math.max(n,l.mtimeMs))}}return n>0?new Date(n).toISOString():null}s(pn,"latestSkillMtime");function gn(e){return/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e)}s(gn,"isKebabCaseSkillName");function mn(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}s(mn,"asRecord");function Ve(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}s(Ve,"text");function Pn(e){return sn("sha256").update(e).digest("hex")}s(Pn,"sha256Hex");var F="openpond-profile.json",Sn="settings/profile.yaml",ct="default",E="default";function kn(e,t){let n=e?.defaultAgent??E,o=e?.enabledAgents&&e.enabledAgents.length>0?e.enabledAgents:[n];return{...e??{},path:t,defaultAgent:n,enabledAgents:o}}s(kn,"mergeProfileRepoManifestEntry");function Q(e,t,n){let o=A(e);if(e){let l=o.findIndex(d=>u.resolve(d.repoPath)===u.resolve(e.repoPath)&&d.profile===e.profile),c={source:o[l]?.source??"local",repositoryId:o[l]?.repositoryId??u.resolve(e.repoPath),repoPath:u.resolve(e.repoPath),profile:e.profile,...e.lastCheck?{lastCheck:e.lastCheck}:{},...e.lastPush?{lastPush:e.lastPush}:{}};l>=0?o[l]=c:o.push(c)}let r=o.findIndex(l=>u.resolve(l.repoPath)===u.resolve(t)&&l.profile===n),i=r>=0?o[r]:{source:"local",repositoryId:u.resolve(t),repoPath:u.resolve(t),profile:n};return r<0&&o.push(i),{repoPath:u.resolve(t),profile:n,mode:"local",profiles:o,...i.lastCheck?{lastCheck:i.lastCheck}:{},...i.lastPush?{lastPush:i.lastPush}:{}}}s(Q,"mergeActiveLocalProfileConfig");function A(e){if(!e)return[];let t=e.profiles?.map(n=>({...n}))??[];return t.some(n=>u.resolve(n.repoPath)===u.resolve(e.repoPath)&&n.profile===e.profile)||t.push({source:"local",repositoryId:u.resolve(e.repoPath),repoPath:u.resolve(e.repoPath),profile:e.profile,...e.lastCheck?{lastCheck:e.lastCheck}:{},...e.lastPush?{lastPush:e.lastPush}:{}}),t}s(A,"profileConfigEntries");var Cn=st(import.meta.url);function On(){return u.join(Re(),"library","profiles","default-repo")}s(On,"defaultLocalProfileRepoPath");function ut(e=null){return{mode:"none",repoPath:null,activeProfile:null,sourcePath:null,manifestPath:null,agents:[],skills:[],evals:[],git:null,catalog:ue(e),skillCatalog:de(e),actionCatalog:[],sourceSetupRequirements:[],setupGate:fe(),diff:K(),hosted:null,summary:pe(e),lastCheck:null,error:e}}s(ut,"emptyProfileState");async function qo(e={}){let t=u.resolve(e.repoPath??On()),n=ke(e.profile),o=u.join("profiles",n),r=u.join(t,o),i=e.template??"blank-agent",a=i==="blank-profile";await v(t,{recursive:!0});let l=k(u.join(t,F)),c=await T(t).catch(()=>Tn(n,o));if(a&&l&&c.profiles[n])throw new Error(`Profile "${n}" already exists in ${t}.`);c.defaultProfile=c.defaultProfile||n,c.profiles[n]=kn(c.profiles[n],o),a&&(c.profiles[n].enabledAgents=[]),a?await v(r,{recursive:!0}):await In(r,i,!!e.force),await pt(r),await vn(t,r,n,{includeDefaultAgent:!a}),await Z(t,c),await Me(t);let d=(await O()).openpondProfile;return await L({openpondProfile:Q(d,t,n)}),j()}s(qo,"initLocalProfileRepo");async function jo(e,t,n){let o=u.resolve(e),r=await T(o),i=ke(t??r.defaultProfile);Ce(r,o,i);let a=(await O()).openpondProfile,l=Q(a,o,i);return dt(l,o,i,n),await L({openpondProfile:l}),j()}s(jo,"loadLocalProfileRepo");async function Fo(e,t,n){let o=u.resolve(e),r=await T(o),i=ke(t??r.defaultProfile);Ce(r,o,i);let a=(await O()).openpondProfile,l=Q(a,o,i);return dt(l,o,i,n),a&&(l.repoPath=a.repoPath,l.profile=a.profile,l.lastCheck=a.lastCheck,l.lastPush=a.lastPush),await L({openpondProfile:l}),bn(ye({repoPath:o,profile:i,source:n?.source,repositoryId:n?.repositoryId}))}s(Fo,"registerLocalProfileRepo");function dt(e,t,n,o){o&&(e.profiles=A(e).map(r=>u.resolve(r.repoPath)===t&&r.profile===n?{...r,source:o.source,repositoryId:o.repositoryId}:r))}s(dt,"applyProfileIdentity");async function To(e,t){let n=e.trim(),o=Fn(t);if(!n)throw new Error("Agent ID is required.");let i=(await O()).openpondProfile;if(!i)throw new Error("No active local Profile.");let a=await T(i.repoPath),l=a.profiles[i.profile];if(!l)throw new Error(`Profile "${i.profile}" was not found.`);let c=l.defaultAgent??E;if(!(l.enabledAgents??[c]).includes(n))throw new Error(`Agent "${n}" was not found in Profile "${i.profile}".`);let g={...l.agentNames??{}};return o===n?delete g[n]:g[n]=o,Object.keys(g).length?l.agentNames=g:delete l.agentNames,await Z(i.repoPath,a),j()}s(To,"renameActiveProfileAgent");async function Go(e){let t=e.agentPackage;if(Gn(t),!/^[a-z0-9][a-z0-9._-]{0,190}$/.test(t.agentId))throw new Error("Agent package ID is not safe for a local Profile.");let n=await te(),o=n.state.sourcePath;await pt(o);let r=u.join(o,"agents");await v(r,{recursive:!0});let i=u.join(r,t.agentId),a=k(i);if(a&&e.overwrite!==!0)throw new Error(`Agent "${t.agentId}" already exists. Confirm replacement to install this version.`);let l=u.join(r,`.${t.agentId}.${tt()}.installing`),c=u.join(r,`.${t.agentId}.${tt()}.backup`),d=await T(n.config.repoPath),g=JSON.stringify(d),P=!1,x=!1;try{await Hn(l,t),a&&(await Pe(i,c),P=!0),await Pe(l,i),x=!0;let S=d.profiles[n.config.profile];if(!S)throw new Error(`Profile "${n.config.profile}" was not found.`);let M=new Set(S.enabledAgents??[]);M.add(t.agentId),S.enabledAgents=[...M],S.defaultAgent||(S.defaultAgent=t.agentId),S.agentNames={...S.agentNames??{},[t.agentId]:t.title},await Z(n.config.repoPath,d),P&&await he(c,{recursive:!0,force:!0})}catch(S){throw await he(l,{recursive:!0,force:!0}),x&&await he(i,{recursive:!0,force:!0}),P&&k(c)&&await Pe(c,i),JSON.stringify(d)!==g&&await Z(n.config.repoPath,JSON.parse(g)).catch(()=>{}),S}return{state:await j(),agentId:t.agentId,versionId:t.versionId,digest:t.digest}}s(Go,"installAgentPackageIntoActiveProfile");async function j(){let t=(await O()).openpondProfile;return t?ee(t):ut()}s(j,"loadOpenPondProfileState");function ye(e){return{source:e.source??"local",repositoryId:e.repositoryId?.trim()||u.resolve(e.repoPath),profileId:e.profile}}s(ye,"openPondProfileRef");async function Rn(){let e=(await O()).openpondProfile;if(!e)return{lastUsed:null,profiles:[]};let t=A(e),n=await Promise.all(t.map(async o=>{let r=await ee({repoPath:o.repoPath,profile:o.profile,mode:"local",...o.lastCheck?{lastCheck:o.lastCheck}:{},...o.lastPush?{lastPush:o.lastPush}:{}});return{ref:ye(o),name:o.profile,repoPath:o.repoPath,sourcePath:r.sourcePath,state:r}}));return{lastUsed:ye({repoPath:e.repoPath,profile:e.profile,source:A(e).find(o=>u.resolve(o.repoPath)===u.resolve(e.repoPath)&&o.profile===e.profile)?.source,repositoryId:A(e).find(o=>u.resolve(o.repoPath)===u.resolve(e.repoPath)&&o.profile===e.profile)?.repositoryId}),profiles:n}}s(Rn,"loadOpenPondProfileLibrary");async function bn(e){if(!e)return j();let t=(await O()).openpondProfile,n=A(t).find(o=>o.source===e.source&&o.repositoryId===e.repositoryId&&o.profile===e.profileId);return n?ee({repoPath:n.repoPath,profile:n.profile,mode:"local",...n.lastCheck?{lastCheck:n.lastCheck}:{},...n.lastPush?{lastPush:n.lastPush}:{}}):ut(`Profile "${e.profileId}" is not installed on this device.`)}s(bn,"loadOpenPondProfileStateForRef");async function Ho(e){let t=(await O()).openpondProfile,n=A(t).find(o=>o.source===e.source&&o.repositoryId===e.repositoryId&&o.profile===e.profileId);if(!n)throw new Error(`Profile "${e.profileId}" is not installed on this device.`);return await L({openpondProfile:Q(t,n.repoPath,n.profile)}),j()}s(Ho,"selectOpenPondProfile");async function No(e){let t=(await O()).openpondProfile;if(!t)return{lastUsed:null,profiles:[]};let n=A(t).filter(i=>i.source!==e.source||i.repositoryId!==e.repositoryId||i.profile!==e.profileId);if(n.length===0)return await L({openpondProfile:null}),{lastUsed:null,profiles:[]};let r=u.resolve(t.repoPath)===u.resolve(A(t).find(i=>i.source===e.source&&i.repositoryId===e.repositoryId&&i.profile===e.profileId)?.repoPath??"")&&t.profile===e.profileId?n[0]:n.find(i=>u.resolve(i.repoPath)===u.resolve(t.repoPath)&&i.profile===t.profile)??n[0];return await L({openpondProfile:{repoPath:r.repoPath,profile:r.profile,mode:"local",profiles:n,...r.lastCheck?{lastCheck:r.lastCheck}:{},...r.lastPush?{lastPush:r.lastPush}:{}}}),Rn()}s(No,"removeOpenPondProfile");async function ee(e){try{let t=await T(e.repoPath),n=Ce(t,e.repoPath,e.profile),o=await xn(t,e.profile),r=mt({manifest:t,profile:e.profile,profileSourcePath:n,agents:o}),[i,a,l,c]=await Promise.all([N(e.repoPath),ze(r),Qe(n),_n(n,r)]),d=ot(e),g=qn(i,e.profile),P=W({actionCatalog:a.actionCatalog,sourceSetupRequirements:a.sourceSetupRequirements}),x=Ln({agents:o,actionCatalog:a.actionCatalog,catalog:a.catalog,diff:g,git:i,hosted:d,lastCheck:e.lastCheck??null,error:null});return{mode:"local",repoPath:e.repoPath,activeProfile:e.profile,sourcePath:n,manifestPath:u.join(e.repoPath,F),agents:o,skills:l.skills,evals:c,git:i,catalog:a.catalog,skillCatalog:l.skillCatalog,actionCatalog:a.actionCatalog,sourceSetupRequirements:a.sourceSetupRequirements,setupGate:P,diff:g,hosted:d,summary:x,lastCheck:e.lastCheck??null,error:null}}catch(t){let n=await N(e.repoPath).catch(()=>null),o=t instanceof Error?t.message:String(t);return{mode:"local",repoPath:e.repoPath,activeProfile:e.profile,sourcePath:null,manifestPath:u.join(e.repoPath,F),agents:[],skills:[],evals:[],git:n,catalog:ue(o),skillCatalog:de(o),actionCatalog:[],sourceSetupRequirements:[],setupGate:fe(),diff:K(),hosted:ot(e),summary:pe(o),lastCheck:e.lastCheck??null,error:o}}}s(ee,"loadOpenPondProfileStateForConfig");async function Uo(e){return ee({repoPath:u.resolve(e.repoPath),profile:e.profileId,mode:"local"})}s(Uo,"loadOpenPondProfileStateFromSource");async function te(){let e=(await O()).openpondProfile;if(!e)throw new Error("No active OpenPond profile. Run `openpond init` or `openpond profile load --path <dir>`.");let t=await j();if(t.error)throw new Error(t.error);if(!t.sourcePath)throw new Error("Active OpenPond profile has no source path.");return{config:e,state:t}}s(te,"requireActiveLocalProfile");async function Do(e){let t=await te(),n=e.command==="run"?e.args??[]:[],o=e.command==="run"?t.state.actionCatalog.find(l=>l.id===n[0]):null,r=u.resolve(e.cwd??o?.sourcePath??t.state.sourcePath),i=e.command==="run"?nt(r,e.args??[],o?.sourceActionId??null):null;if(e.command==="run"&&i){let l=i[0],c=u.resolve(t.state.sourcePath)===r?{actionCatalog:t.state.actionCatalog,sourceSetupRequirements:t.state.sourceSetupRequirements}:await Be(r);oe(l,W({actionCatalog:c.actionCatalog,sourceSetupRequirements:c.sourceSetupRequirements,actionId:l}))}let a=await ft({command:e.command,args:e.command==="run"?i??nt(r,e.args??[]):e.args,cwd:r,inherit:e.inherit,throwOnFailure:!1});if((e.command==="inspect"||e.command==="build"||e.command==="validate"||e.command==="eval")&&await Se(e.command,a.code),a.code!==0){let l=a.stderr.trim()||a.stdout.trim();throw new Error(l||`${e.command} failed with exit code ${a.code??"unknown"}`)}return a}s(Do,"runProfileSdkCommand");async function ft(e){let t=u.resolve(e.cwd),n=Un(),o=e.command==="run"?[...n.args,e.command,...e.args??[]]:[...n.args,e.command,"--cwd",t,...e.args??[]],r=await wt(n.command,o,{cwd:t,inherit:e.inherit,timeoutMs:e.timeoutMs,maxOutputBytes:e.maxOutputBytes});if(e.throwOnFailure!==!1&&r.code!==0){let i=St(r,e.command);throw new Error(i||`${e.command} failed with exit code ${r.code??"unknown"}`)}return r}s(ft,"runAgentSdkProjectCommand");function nt(e,t,n=null){let[o,...r]=t;if(!o||o.startsWith("--"))throw new Error("run requires an action name");return[n??o,"--cwd",e,...r]}s(nt,"runCommandArgs");async function Bo(e){let t=!e||e==="all"?["inspect","build","validate","eval"]:[e],n=await te(),o=await T(n.config.repoPath),r=mt({manifest:o,profile:n.config.profile,profileSourcePath:n.state.sourcePath,agents:n.state.agents});if(r.length===0){if(t.some(i=>i!=="inspect"&&i!=="build"&&i!=="validate"&&i!=="eval"))throw new Error("check kind must be one of inspect, build, validate, eval, all");await Se("validate",0);return}for(let i of t){if(i!=="inspect"&&i!=="build"&&i!=="validate"&&i!=="eval")throw new Error("check kind must be one of inspect, build, validate, eval, all");for(let a of r)await An({command:i,source:a,profileSourcePath:n.state.sourcePath,sourceCount:r.length})}}s(Bo,"runProfileCheck");async function An(e){let t=e.command==="inspect"||e.command==="validate"||e.command==="eval"?["--json"]:[];if(e.sourceCount>1){let o=u.relative(e.profileSourcePath,e.source.sourcePath)||".";console.log(`
|
|
8
|
+
`,"utf8")}s(xt,"ensureProfileGitignoreRules");async function N(e){if(!re(ie.join(e,".git")))return{isRepo:!1,branch:null,head:null,shortHead:null,dirty:!1,upstream:null,ahead:null,behind:null,remoteUrl:null,files:[],error:null};let t=await R(e,["rev-parse","--is-inside-work-tree"]);if(t.code!==0||t.stdout.trim()!=="true")return{isRepo:!1,branch:null,head:null,shortHead:null,dirty:!1,upstream:null,ahead:null,behind:null,remoteUrl:null,files:[],error:t.stderr.trim()||t.stdout.trim()||"not a Git work tree"};let[n,o,r,i,a]=await Promise.all([B(e,["branch","--show-current"]),B(e,["rev-parse","HEAD"]),R(e,["status","--porcelain=v1","-uall"]),B(e,["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"]),B(e,["remote","get-url","origin"])]),l=r.code===0?Mt(r.stdout):[],c=i?await Lt(e):{ahead:null,behind:null},d=o||null;return{isRepo:!0,branch:n||null,head:d,shortHead:d?d.slice(0,12):null,dirty:l.length>0,upstream:i,ahead:c.ahead,behind:c.behind,remoteUrl:a,files:l,error:r.code===0?null:H("git status",r)}}s(N,"loadProfileGitState");async function $e(e,t){let n=await N(e);if(!n.isRepo)throw new Error(n.error??"Active OpenPond profile source is not a Git repo.");if(!n.dirty)return{committed:!1,stdout:"",stderr:"",state:n};let o=await R(e,["add","-A"]);if(o.code!==0)throw new Error(H("git add",o));let r=await R(e,["commit","-m",t]);if(r.code!==0)throw new Error(H("git commit",r));return{committed:!0,stdout:r.stdout,stderr:r.stderr,state:await N(e)}}s($e,"commitProfileChanges");async function qe(e){return B(e,["rev-parse","HEAD"])}s(qe,"profileGitHead");async function _t(e){return(await R(e,["rev-parse","--verify","HEAD"])).code===0}s(_t,"hasGitHead");async function Lt(e){let t=await R(e,["rev-list","--left-right","--count","@{u}...HEAD"]);if(t.code!==0)return{ahead:null,behind:null};let[n,o]=t.stdout.trim().split(/\s+/),r=n?Number.parseInt(n,10):Number.NaN,i=o?Number.parseInt(o,10):Number.NaN;return{ahead:Number.isFinite(i)?i:null,behind:Number.isFinite(r)?r:null}}s(Lt,"loadAheadBehind");async function B(e,t){let n=await R(e,t);return n.code!==0?null:n.stdout.trim()||null}s(B,"gitText");function Mt(e){return e.split(/\r?\n/).map(t=>t.trimEnd()).filter(Boolean).map(t=>{let n=t[0]??" ",o=t[1]??" ",r=`${n}${o}`.trim()||"changed",i=t.slice(3),a=i.split(" -> "),l=n===" "?null:n,c=o===" "?null:o,d=a.length===2?a[1]:i,g=a.length===2?a[0]:null;return{path:xe(d),originalPath:g?xe(g):null,indexStatus:l,worktreeStatus:c,status:r,category:$t(l,c)}})}s(Mt,"parsePorcelainStatus");function $t(e,t){return e==="?"&&t==="?"?"untracked":e==="R"||t==="R"?"renamed":e==="A"||t==="A"?"added":e==="D"||t==="D"?"deleted":e==="M"||t==="M"?"modified":"changed"}s($t,"gitChangeCategory");function xe(e){let t=e.trim();if(!t.startsWith('"')||!t.endsWith('"'))return t;try{return JSON.parse(t)}catch{return t.slice(1,-1)}}s(xe,"unquoteGitPath");function H(e,t){return t.stderr.trim()||t.stdout.trim()||`${e} failed with exit code ${t.code??"unknown"}`}s(H,"gitFailureMessage");async function R(e,t,n={}){return new Promise((o,r)=>{let i=vt("git",t,{cwd:e,env:n.env,stdio:"pipe"}),a="",l="";i.stdout?.on("data",c=>{a+=String(c)}),i.stderr?.on("data",c=>{l+=String(c)}),i.on("error",r),i.on("close",c=>{o({code:c,stdout:a,stderr:l})}),n.input!==void 0?i.stdin?.end(n.input):i.stdin?.end()})}s(R,"runGitCommand");var ae=1500,Te=8*1024*1024,le=100*1024*1024,ce=8,jt={maxFiles:ae,maxFileBytes:Te,maxTotalBytes:le,concurrency:ce},Ft={mode:"single_json_payload",chunkingSupported:!1};async function Tt(e){let t=await R(e,["ls-files","-z"]);if(t.code!==0)throw new Error(t.stderr.trim()||t.stdout.trim()||"git ls-files failed for profile source upload");let n=t.stdout.split("\0").map(c=>c.trim()).filter(Boolean).filter(c=>{let d=c.replace(/\\/g,"/");return Fe(d)&&!Gt(d)}).sort();if(n.length===0)throw new Error("No committed profile source files found to upload.");if(n.length>ae)throw new Error(`Too many profile source files to upload: ${n.length} > ${ae}`);let o=(await je(n,ce,async c=>{let d=se.resolve(e,c),g=se.relative(e,d).replace(/\\/g,"/");if(!Fe(g))throw new Error(`Profile source path escapes repo: ${c}`);let P=await qt(d);if(!P.isFile())return null;if(P.size>Te)throw new Error(`Profile source file is too large: ${c} (${P.size} bytes)`);return{path:g,absolutePath:d,size:P.size,mtimeMs:Math.trunc(P.mtimeMs),ctimeMs:Math.trunc(P.ctimeMs)}})).filter(c=>c!==null),r=0;for(let c of o)if(r+=c.size,r>le)throw new Error(`Profile source upload is too large: ${r} > ${le}`);let i=await Ae(e),a=await je(o,ce,async c=>Ie(c,i));await ve(e,a).catch(()=>{});let l=a.map(c=>c.entry);return{entries:l,fileCount:l.length,totalBytes:r,limits:jt,transport:Ft}}s(Tt,"collectProfileSourceUploadEntries");async function je(e,t,n){let o=new Array(e.length),r=0,i=Math.max(1,Math.min(t,e.length));return await Promise.all(Array.from({length:i},async()=>{for(;r<e.length;){let a=r;r+=1,o[a]=await n(e[a],a)}})),o}s(je,"mapWithConcurrency");function Fe(e){return e.length>0&&!e.includes("\0")&&!se.isAbsolute(e)&&!e.split(/[\\/]+/).some(t=>!t||t==="."||t==="..")}s(Fe,"isSafeProfileSourcePath");function Gt(e){return e.split(/[\\/]+/).some((t,n,o)=>{let r=t.toLowerCase();if(r===".git"||r==="node_modules"||r===".bun"||r===".env"||r.startsWith(".env.")||e.replace(/\\/g,"/")===be)return!0;if(r!==".openpond")return!1;let i=o[n+1]?.toLowerCase();return i==="goals"||i==="traces"||i==="vendor"||i==="eval-results.json"||i==="artifact-index.json"})}s(Gt,"shouldSkipProfileSourcePath");function Ht(e){let t=y(e.checkResult),n=y(t?.deployPlan)??y(e.deployPlan),o=y(n?.source),r=y(n?.checks),i=y(t?.sourceCheckStatus);return{status:e.status,agentId:e.agentId,deployPlanStatus:f(n?.status),canRun:Ge(n?.canRun),canDeploy:Ge(n?.canDeploy),sourceRef:f(o?.sourceRef),sourceCommitSha:f(o?.sourceCommitSha),manifestHash:f(o?.manifestHash),manifestPath:f(o?.manifestPath),setupCommands:b(r?.setupCommands),validationCommands:b(r?.validationCommands),requiredChecks:b(r?.requiredChecks),evalNames:b(r?.evalNames),blockedReasons:b(n?.blockedReasons),staleReasons:b(n?.staleReasons),runtimeId:f(i?.latestRuntimeId),sandboxId:f(i?.latestSandboxId),traceArtifactRefs:b(i?.traceArtifactRefs),evalResultArtifactRefs:b(i?.evalResultArtifactRefs),validatorArtifactRefs:b(i?.validatorArtifactRefs),checkedAt:e.checkedAt??new Date().toISOString(),error:e.error??null}}s(Ht,"hostedSourceCheckStatusFromPayload");function Nt(e){let t=y(e.publishResult),n=y(t?.activeManifestSnapshot)??y(t?.manifestSnapshot)??y(t?.snapshot);return{status:e.status??"published",agentId:e.agentId,snapshotId:f(n?.id),sourceRef:f(n?.sourceRef),sourceCommitSha:f(n?.sourceCommitSha),manifestHash:f(n?.manifestHash),manifestPath:f(n?.manifestPath),buildStatus:f(n?.buildStatus),validationStatus:f(n?.validationStatus),evalStatus:f(n?.evalStatus),publishedAt:f(t?.publishedAt)??f(n?.publishedAt),error:e.error??null}}s(Nt,"hostedPublishStatusFromPayload");function Ut(e){let t=y(e.runResult),n=y(t?.run),o=y(n?.runtimeSource),r=y(n?.metadata),i=y(r?.sourceSummary),a=y(r?.setupGate),l=y(r?.responseSummary),c=y(r?.traceSummary),d=y(r?.evalSummary);return{status:f(n?.status)??(e.error?"failed":"running"),agentId:f(n?.agentId)??e.agentId,runId:f(n?.id),runtimeId:f(n?.runtimeId),sandboxId:f(n?.sandboxId),sourceRef:f(o?.sourceRef)??f(i?.sourceRef)??f(r?.sourceRef),sourceCommitSha:f(o?.sourceCommitSha)??f(i?.sourceCommitSha)??f(r?.hostedHead),manifestHash:f(o?.manifestHash)??f(i?.manifestHash),setupGateStatus:f(a?.status),setupRequirementRefs:Bt(a),artifactRefs:b(l?.artifactRefs),traceArtifactRefs:b(c?.artifactRefs),evalArtifactRefs:b(d?.artifactRefs),startedAt:f(n?.createdAt),completedAt:f(n?.completedAt),error:e.error??null}}s(Ut,"hostedRunSummaryFromPayload");function Dt(e){return e?.status?e.status==="succeeded"||e.status==="passed"?"passed":e.status==="failed"||e.status==="cancelled"?"failed":"running":"not_started"}s(Dt,"hostedRunStatusFromRunSummary");function Bt(e){return e?(Array.isArray(e.requirements)?e.requirements:Array.isArray(e.blockingRequirements)?e.blockingRequirements:[]).map(n=>{let o=y(n);return f(o?.ref)??f(o?.id)??f(o?.label)}).filter(n=>!!n):[]}s(Bt,"setupRequirementRefs");function y(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}s(y,"record");function f(e){return typeof e=="string"&&e.trim()?e.trim():null}s(f,"text");function Ge(e){return typeof e=="boolean"?e:null}s(Ge,"booleanValue");function b(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim().length>0):[]}s(b,"textArray");import{createRequire as st}from"node:module";import{createHash as et,randomUUID as tt}from"node:crypto";import{spawn as hn}from"node:child_process";import{existsSync as k}from"node:fs";import{cp as yn,mkdir as v,readFile as at,readdir as lt,rename as Pe,rm as he,symlink as wn,writeFile as D}from"node:fs/promises";import u from"node:path";function ue(e=null){return{actionCount:0,generatedAt:null,manifestPath:null,registryPath:null,stale:!0,error:e}}s(ue,"emptyProfileCatalogState");function de(e=null){return{skillCount:0,generatedAt:null,stale:!0,error:e}}s(de,"emptyProfileSkillCatalogState");function fe(){return{status:"ready",requirementCount:0,blockingCount:0,optionalMissingCount:0,readyCount:0,requirements:[],blockingRequirements:[]}}s(fe,"emptyProfileSetupGate");function Y(){return{changedAgents:[],newAgents:[],deletedAgents:[],changedSkills:[],changedActions:[],changedExtensions:[],setupChanges:[],envRequirementChanges:[],files:[]}}s(Y,"emptyProfileDiffSummary");function pe(e=null){return{state:e?"error":"none",message:e??"No active OpenPond profile.",agentCount:0,actionCount:0,defaultAction:null,checkFresh:!1,checkStaleReason:e??"No active profile.",localHead:null,hostedHead:null}}s(pe,"emptyProfileSummary");import{existsSync as U}from"node:fs";import{readFile as zt,stat as Jt}from"node:fs/promises";import V from"node:path";var He=".openpond/agent-manifest.json",Ne=".openpond/action-registry.json",Wt=".openpond/source-upload-metadata.json",Kt=".openpond/agent-package-origin.json";async function Be(e){return Je({agentId:"default",sourcePath:e,preferred:!0})}s(Be,"loadProfileActionCatalog");async function ze(e){if(e.length===0)return{catalog:{actionCount:0,generatedAt:null,manifestPath:null,registryPath:null,stale:!1,error:null},actionCatalog:[],sourceSetupRequirements:[]};let t=[...e.filter(l=>l.preferred),...e.filter(l=>!l.preferred)],n=await Promise.all(t.map(Je)),o=new Map,r=[];for(let l of n)for(let c of l.actionCatalog){let d=o.has(c.id)?`${c.agentId??"agent"}.${c.sourceActionId??c.id}`:c.id,g=d===c.id?c:{...c,id:d};o.set(d,g),r.push(g)}let i=Vt(n.map(l=>l.catalog.generatedAt)),a=n.map(l=>l.catalog.error).filter(Boolean);return{catalog:{actionCount:r.length,generatedAt:i,manifestPath:n.find(l=>l.catalog.manifestPath)?.catalog.manifestPath??null,registryPath:n.find(l=>l.catalog.registryPath)?.catalog.registryPath??null,stale:n.some(l=>l.catalog.stale),error:a.length>0?a.join("; "):null},actionCatalog:r,sourceSetupRequirements:n.flatMap(l=>l.sourceSetupRequirements)}}s(ze,"loadProfileActionCatalogForSources");async function Je(e){let t=e.sourcePath,n=V.join(t,He),o=V.join(t,Ne),r=V.join(t,Wt),i=V.join(t,Kt);try{let a=await X(n),l=await X(o),c=await X(r),d=w(await X(i)),g=w(w(a)?.inputSchemas),P=De(w(c)?.setupRequirements)??[],x=Xt(P),S=new Map;for(let m of[...ge(w(a)?.actionCatalog),...ge(w(l)?.actions),...ge(w(a)?.actions)]){let $=p(m.id)??p(m.name);if(!$)continue;let C=S.get($),kt=Zt({sourceRequirementsByAction:x,actionId:$,actionName:p(m.name)}),Ct=Qt(De(m.setupRequirements)??C?.setupRequirements??[],kt),Ot={id:$,agentId:e.agentId,sourcePath:t,sourceActionId:$,name:p(m.name)??C?.name??$,label:p(m.label)??C?.label??rn($),description:p(m.description)??C?.description??null,visibility:p(m.visibility)??C?.visibility??"default",inputSchema:on(m.inputSchema,g)??C?.inputSchema??null,outputSchema:We(m.outputSchema)??C?.outputSchema??null,approvalPolicy:w(m.approvalPolicy)??C?.approvalPolicy??null,artifactPolicy:w(m.artifactPolicy)??C?.artifactPolicy??null,setupRequirements:Ct,mcp:w(m.mcp)??C?.mcp??null,schedulePolicy:w(m.schedulePolicy)??C?.schedulePolicy??null,trace:Yt(w(m.trace)??C?.trace??null,d),implementation:w(m.implementation)??C?.implementation??null,invokesModel:typeof m.invokesModel=="boolean"?m.invokesModel:C?.invokesModel};S.set($,Ot)}let M=Array.from(S.values()).filter(m=>m.visibility!=="internal"&&m.visibility!=="debug"),G=[...a?[]:[He],...l?[]:[Ne]],_=await nn([n,o]);return{catalog:{actionCount:M.length,generatedAt:_,manifestPath:U(n)?n:null,registryPath:U(o)?o:null,stale:G.length>0,error:G.length>0?tn(e,G):null},actionCatalog:M,sourceSetupRequirements:P}}catch(a){return{catalog:{actionCount:0,generatedAt:null,manifestPath:U(n)?n:null,registryPath:U(o)?o:null,stale:!0,error:a instanceof Error?a.message:String(a)},actionCatalog:[],sourceSetupRequirements:[]}}}s(Je,"loadProfileActionCatalogSource");function Yt(e,t){if(!t)return e;let n=p(t.versionId),o=p(t.digest);return!n||!o?e:{...e??{},agentVersionId:n,agentPackageDigest:o,validationReceiptIds:Ue(t.validationReceiptIds),evalReceiptIds:Ue(t.evalReceiptIds)}}s(Yt,"mergeAgentPackageTrace");function Ue(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim().length>0):[]}s(Ue,"stringArray");function Vt(e){let t=0;for(let n of e){if(!n)continue;let o=Date.parse(n);Number.isFinite(o)&&(t=Math.max(t,o))}return t>0?new Date(t).toISOString():null}s(Vt,"latestIso");function Xt(e){let t=new Map;for(let n of e){let o=[p(n.actionId),p(n.sourceActionId),p(n.actionName)].filter(r=>!!r);for(let r of o){let i=t.get(r)??[];i.push(n),t.set(r,i)}}return t}s(Xt,"sourceSetupRequirementsByAction");function Zt(e){return[...e.sourceRequirementsByAction.get(e.actionId)??[],...e.actionName&&e.actionName!==e.actionId?e.sourceRequirementsByAction.get(e.actionName)??[]:[]].map(n=>({...n,source:"source_upload_metadata"}))}s(Zt,"setupRequirementsForActionSource");function Qt(e,t){if(t.length===0)return e;let n=[],o=new Set;for(let r of[...e,...t]){let i=en(r);o.has(i)||(o.add(i),n.push(r))}return n}s(Qt,"mergeSetupRequirements");function en(e){return[p(e.actionId)??p(e.sourceActionId)??p(e.actionName)??"",p(e.kind)??p(e.type)??"",p(e.name)??p(e.key)??p(e.provider)??p(e.tool)??p(e.command)??p(e.packageName)??p(e.path)??p(e.repo)??p(e.url)??p(e.id)??""].join(":")}s(en,"setupRequirementIdentity");function tn(e,t){return[`Profile agent ${e.agentId} at ${e.sourcePath} is missing SDK catalog artifact(s): ${t.join(", ")}.`,"Run `openpond profile check --kind all` after source materialization so each enabled profile agent has inspect/build artifacts."].join(" ")}s(tn,"missingSourceArtifactsMessage");async function X(e){return U(e)?JSON.parse(await zt(e,"utf8")):null}s(X,"readJsonIfExists");async function nn(e){let t=0;for(let n of e){if(!U(n))continue;let o=await Jt(n);t=Math.max(t,o.mtimeMs)}return t>0?new Date(t).toISOString():null}s(nn,"latestMtime");function w(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}s(w,"asRecord");function ge(e){return Array.isArray(e)?e.filter(t=>!!w(t)):[]}s(ge,"records");function De(e){return Array.isArray(e)?e.filter(t=>!!w(t)):null}s(De,"recordArray");function p(e){return typeof e=="string"&&e.trim()?e.trim():null}s(p,"text");function We(e){return p(e)??w(e)}s(We,"schemaValue");function on(e,t){let n=We(e);return typeof n!="string"?n:w(t?.[n])??n}s(on,"resolvedSchemaValue");function rn(e){let t=e.replace(/[._-]+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}s(rn,"titleFromActionId");import{createHash as sn}from"node:crypto";import{existsSync as Xe}from"node:fs";import{readdir as Ze,readFile as an,stat as ln}from"node:fs/promises";import q from"node:path";var me="skills",Z="SKILL.md",Ke=8e4;async function Qe(e){let t=q.join(e,me);if(!Xe(t))return{skillCatalog:Ye({stale:!1}),skills:[]};try{let n=await Ze(t,{withFileTypes:!0}),o=(await Promise.all(n.filter(i=>i.isDirectory()).map(i=>un(e,i.name)))).sort((i,a)=>i.name.localeCompare(a.name)||i.path.localeCompare(a.path));fn(o);let r=await pn(e,o);return{skillCatalog:{skillCount:o.length,generatedAt:r,stale:!1,error:null},skills:o}}catch(n){return{skillCatalog:Ye({stale:!0,error:n instanceof Error?n.message:String(n)}),skills:[]}}}s(Qe,"loadProfileSkills");function cn(e){let t=[],n=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/.exec(e);if(!n)return{name:null,description:null,body:e.trim(),messages:["SKILL.md must start with YAML frontmatter bounded by ---."]};let o=n[1]??"",r=(n[2]??"").trim(),i;try{i=Oe.load(o)}catch(d){t.push(`SKILL.md frontmatter is invalid YAML: ${d instanceof Error?d.message:String(d)}`)}let a=mn(i),l=Ve(a?.name),c=Ve(a?.description);return l||t.push("Skill frontmatter must include a non-empty name."),c||t.push("Skill frontmatter must include a non-empty description."),r||t.push("Skill body must be non-empty markdown."),{name:l,description:c,body:r,messages:t}}s(cn,"parseProfileSkillMarkdown");function Ye(e={}){return{skillCount:0,generatedAt:null,stale:e.stale??!0,error:e.error??null}}s(Ye,"emptyProfileSkillCatalogState");async function un(e,t){let n=q.join(me,t,Z).replace(/\\/g,"/"),o=q.join(e,n),r=[],i=q.join(e,me,t),a=await dn(i),l="";Xe(o)?l=await an(o,"utf8"):r.push(`Missing ${Z}.`),l.length>Ke&&r.push(`Skill markdown exceeds the limit of ${Ke} characters.`);let c=cn(l);r.push(...c.messages);let d=c.name??t,g=c.description??"";return gn(d)||r.push("Skill name must be lowercase kebab-case."),d!==t&&r.push(`Skill name must match its directory name (${t}).`),{name:d,description:g,path:n,scope:"profile",enabled:r.length===0,sourcePath:e,charCount:l.length,sourceHash:Pn(l),validationStatus:r.length>0?"error":"valid",validationMessages:r,resourceFiles:a.filter(P=>P!==Z)}}s(un,"loadProfileSkillDirectory");async function dn(e){let t=[];async function n(o,r){let i=await Ze(o,{withFileTypes:!0});await Promise.all(i.map(async a=>{let l=r?`${r}/${a.name}`:a.name;a.isDirectory()?await n(q.join(o,a.name),l):a.isFile()&&t.push(l)}))}return s(n,"visit"),await n(e,""),t.sort()}s(dn,"listPackageFiles");function fn(e){let t=new Map;for(let n of e)t.set(n.name,(t.get(n.name)??0)+1);for(let n of e)(t.get(n.name)??0)<=1||(n.enabled=!1,n.validationStatus="error",n.validationMessages=[...n.validationMessages,`Duplicate skill name: ${n.name}`])}s(fn,"markDuplicateSkillNames");async function pn(e,t){let n=0;for(let o of t){let r=q.dirname(q.join(e,o.path)),i=[Z,...o.resourceFiles];for(let a of i){let l=await ln(q.join(r,a)).catch(()=>null);l?.isFile()&&(n=Math.max(n,l.mtimeMs))}}return n>0?new Date(n).toISOString():null}s(pn,"latestSkillMtime");function gn(e){return/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e)}s(gn,"isKebabCaseSkillName");function mn(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}s(mn,"asRecord");function Ve(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}s(Ve,"text");function Pn(e){return sn("sha256").update(e).digest("hex")}s(Pn,"sha256Hex");var F="openpond-profile.json",Sn="settings/profile.yaml",ct="default",E="default";function kn(e,t){let n=e?.defaultAgent??E,o=e?.enabledAgents&&e.enabledAgents.length>0?e.enabledAgents:[n];return{...e??{},path:t,defaultAgent:n,enabledAgents:o}}s(kn,"mergeProfileRepoManifestEntry");function ee(e,t,n){let o=A(e);if(e){let l=o.findIndex(d=>u.resolve(d.repoPath)===u.resolve(e.repoPath)&&d.profile===e.profile),c={source:o[l]?.source??"local",repositoryId:o[l]?.repositoryId??u.resolve(e.repoPath),repoPath:u.resolve(e.repoPath),profile:e.profile,...e.lastCheck?{lastCheck:e.lastCheck}:{},...e.lastPush?{lastPush:e.lastPush}:{}};l>=0?o[l]=c:o.push(c)}let r=o.findIndex(l=>u.resolve(l.repoPath)===u.resolve(t)&&l.profile===n),i=r>=0?o[r]:{source:"local",repositoryId:u.resolve(t),repoPath:u.resolve(t),profile:n};return r<0&&o.push(i),{repoPath:u.resolve(t),profile:n,mode:"local",profiles:o,...i.lastCheck?{lastCheck:i.lastCheck}:{},...i.lastPush?{lastPush:i.lastPush}:{}}}s(ee,"mergeActiveLocalProfileConfig");function A(e){if(!e)return[];let t=e.profiles?.map(n=>({...n}))??[];return t.some(n=>u.resolve(n.repoPath)===u.resolve(e.repoPath)&&n.profile===e.profile)||t.push({source:"local",repositoryId:u.resolve(e.repoPath),repoPath:u.resolve(e.repoPath),profile:e.profile,...e.lastCheck?{lastCheck:e.lastCheck}:{},...e.lastPush?{lastPush:e.lastPush}:{}}),t}s(A,"profileConfigEntries");var Cn=st(import.meta.url);function On(){return u.join(Re(),"library","profiles","default-repo")}s(On,"defaultLocalProfileRepoPath");function ut(e=null){return{mode:"none",repoPath:null,activeProfile:null,sourcePath:null,manifestPath:null,agents:[],skills:[],evals:[],git:null,catalog:ue(e),skillCatalog:de(e),actionCatalog:[],sourceSetupRequirements:[],setupGate:fe(),diff:Y(),hosted:null,summary:pe(e),lastCheck:null,error:e}}s(ut,"emptyProfileState");async function qo(e={}){let t=u.resolve(e.repoPath??On()),n=ke(e.profile),o=u.join("profiles",n),r=u.join(t,o),i=e.template??"blank-agent",a=i==="blank-profile";await v(t,{recursive:!0});let l=k(u.join(t,F)),c=await T(t).catch(()=>Tn(n,o));if(a&&l&&c.profiles[n])throw new Error(`Profile "${n}" already exists in ${t}.`);c.defaultProfile=c.defaultProfile||n,c.profiles[n]=kn(c.profiles[n],o),a&&(c.profiles[n].enabledAgents=[]),a?await v(r,{recursive:!0}):await In(r,i,!!e.force),await pt(r),await vn(t,r,n,{includeDefaultAgent:!a}),await Q(t,c),await Me(t);let d=(await O()).openpondProfile;return await L({openpondProfile:ee(d,t,n)}),j()}s(qo,"initLocalProfileRepo");async function jo(e,t,n){let o=u.resolve(e),r=await T(o),i=ke(t??r.defaultProfile);Ce(r,o,i);let a=(await O()).openpondProfile,l=ee(a,o,i);return dt(l,o,i,n),await L({openpondProfile:l}),j()}s(jo,"loadLocalProfileRepo");async function Fo(e,t,n){let o=u.resolve(e),r=await T(o),i=ke(t??r.defaultProfile);Ce(r,o,i);let a=(await O()).openpondProfile,l=ee(a,o,i);return dt(l,o,i,n),a&&(l.repoPath=a.repoPath,l.profile=a.profile,l.lastCheck=a.lastCheck,l.lastPush=a.lastPush),await L({openpondProfile:l}),bn(ye({repoPath:o,profile:i,source:n?.source,repositoryId:n?.repositoryId}))}s(Fo,"registerLocalProfileRepo");function dt(e,t,n,o){o&&(e.profiles=A(e).map(r=>u.resolve(r.repoPath)===t&&r.profile===n?{...r,source:o.source,repositoryId:o.repositoryId}:r))}s(dt,"applyProfileIdentity");async function To(e,t){let n=e.trim(),o=Fn(t);if(!n)throw new Error("Agent ID is required.");let i=(await O()).openpondProfile;if(!i)throw new Error("No active local Profile.");let a=await T(i.repoPath),l=a.profiles[i.profile];if(!l)throw new Error(`Profile "${i.profile}" was not found.`);let c=l.defaultAgent??E;if(!(l.enabledAgents??[c]).includes(n))throw new Error(`Agent "${n}" was not found in Profile "${i.profile}".`);let g={...l.agentNames??{}};return o===n?delete g[n]:g[n]=o,Object.keys(g).length?l.agentNames=g:delete l.agentNames,await Q(i.repoPath,a),j()}s(To,"renameActiveProfileAgent");async function Go(e){let t=e.agentPackage;if(Gn(t),!/^[a-z0-9][a-z0-9._-]{0,190}$/.test(t.agentId))throw new Error("Agent package ID is not safe for a local Profile.");let n=await te(),o=n.state.sourcePath;await pt(o);let r=u.join(o,"agents");await v(r,{recursive:!0});let i=u.join(r,t.agentId),a=k(i);if(a&&e.overwrite!==!0)throw new Error(`Agent "${t.agentId}" already exists. Confirm replacement to install this version.`);let l=u.join(r,`.${t.agentId}.${tt()}.installing`),c=u.join(r,`.${t.agentId}.${tt()}.backup`),d=await T(n.config.repoPath),g=JSON.stringify(d),P=!1,x=!1;try{await Hn(l,t),a&&(await Pe(i,c),P=!0),await Pe(l,i),x=!0;let S=d.profiles[n.config.profile];if(!S)throw new Error(`Profile "${n.config.profile}" was not found.`);let M=new Set(S.enabledAgents??[]);M.add(t.agentId),S.enabledAgents=[...M],S.defaultAgent||(S.defaultAgent=t.agentId),S.agentNames={...S.agentNames??{},[t.agentId]:t.title},await Q(n.config.repoPath,d),P&&await he(c,{recursive:!0,force:!0})}catch(S){throw await he(l,{recursive:!0,force:!0}),x&&await he(i,{recursive:!0,force:!0}),P&&k(c)&&await Pe(c,i),JSON.stringify(d)!==g&&await Q(n.config.repoPath,JSON.parse(g)).catch(()=>{}),S}return{state:await j(),agentId:t.agentId,versionId:t.versionId,digest:t.digest}}s(Go,"installAgentPackageIntoActiveProfile");async function j(){let t=(await O()).openpondProfile;return t?z(t):ut()}s(j,"loadOpenPondProfileState");function ye(e){return{source:e.source??"local",repositoryId:e.repositoryId?.trim()||u.resolve(e.repoPath),profileId:e.profile}}s(ye,"openPondProfileRef");async function Rn(){let e=(await O()).openpondProfile;if(!e)return{lastUsed:null,profiles:[]};let t=A(e),n=await Promise.all(t.map(async o=>{let r=await z({repoPath:o.repoPath,profile:o.profile,mode:"local",...o.lastCheck?{lastCheck:o.lastCheck}:{},...o.lastPush?{lastPush:o.lastPush}:{}});return{ref:ye(o),name:o.profile,repoPath:o.repoPath,sourcePath:r.sourcePath,state:r}}));return{lastUsed:ye({repoPath:e.repoPath,profile:e.profile,source:A(e).find(o=>u.resolve(o.repoPath)===u.resolve(e.repoPath)&&o.profile===e.profile)?.source,repositoryId:A(e).find(o=>u.resolve(o.repoPath)===u.resolve(e.repoPath)&&o.profile===e.profile)?.repositoryId}),profiles:n}}s(Rn,"loadOpenPondProfileLibrary");async function bn(e){if(!e)return j();let t=(await O()).openpondProfile,n=A(t).find(o=>o.source===e.source&&o.repositoryId===e.repositoryId&&o.profile===e.profileId);return n?z({repoPath:n.repoPath,profile:n.profile,mode:"local",...n.lastCheck?{lastCheck:n.lastCheck}:{},...n.lastPush?{lastPush:n.lastPush}:{}}):ut(`Profile "${e.profileId}" is not installed on this device.`)}s(bn,"loadOpenPondProfileStateForRef");async function Ho(e){let t=(await O()).openpondProfile,n=A(t).find(o=>o.source===e.source&&o.repositoryId===e.repositoryId&&o.profile===e.profileId);if(!n)throw new Error(`Profile "${e.profileId}" is not installed on this device.`);return await L({openpondProfile:ee(t,n.repoPath,n.profile)}),j()}s(Ho,"selectOpenPondProfile");async function No(e){let t=(await O()).openpondProfile;if(!t)return{lastUsed:null,profiles:[]};let n=A(t).filter(i=>i.source!==e.source||i.repositoryId!==e.repositoryId||i.profile!==e.profileId);if(n.length===0)return await L({openpondProfile:null}),{lastUsed:null,profiles:[]};let r=u.resolve(t.repoPath)===u.resolve(A(t).find(i=>i.source===e.source&&i.repositoryId===e.repositoryId&&i.profile===e.profileId)?.repoPath??"")&&t.profile===e.profileId?n[0]:n.find(i=>u.resolve(i.repoPath)===u.resolve(t.repoPath)&&i.profile===t.profile)??n[0];return await L({openpondProfile:{repoPath:r.repoPath,profile:r.profile,mode:"local",profiles:n,...r.lastCheck?{lastCheck:r.lastCheck}:{},...r.lastPush?{lastPush:r.lastPush}:{}}}),Rn()}s(No,"removeOpenPondProfile");async function Uo(e,t){return z({mode:"local",repoPath:e,profile:t})}s(Uo,"inspectOpenPondProfileSource");async function z(e){try{let t=await T(e.repoPath),n=Ce(t,e.repoPath,e.profile),o=await xn(t,e.profile),r=mt({manifest:t,profile:e.profile,profileSourcePath:n,agents:o}),[i,a,l,c]=await Promise.all([N(e.repoPath),ze(r),Qe(n),_n(n,r)]),d=ot(e),g=qn(i,e.profile),P=K({actionCatalog:a.actionCatalog,sourceSetupRequirements:a.sourceSetupRequirements}),x=Ln({agents:o,actionCatalog:a.actionCatalog,catalog:a.catalog,diff:g,git:i,hosted:d,lastCheck:e.lastCheck??null,error:null});return{mode:"local",repoPath:e.repoPath,activeProfile:e.profile,sourcePath:n,manifestPath:u.join(e.repoPath,F),agents:o,skills:l.skills,evals:c,git:i,catalog:a.catalog,skillCatalog:l.skillCatalog,actionCatalog:a.actionCatalog,sourceSetupRequirements:a.sourceSetupRequirements,setupGate:P,diff:g,hosted:d,summary:x,lastCheck:e.lastCheck??null,error:null}}catch(t){let n=await N(e.repoPath).catch(()=>null),o=t instanceof Error?t.message:String(t);return{mode:"local",repoPath:e.repoPath,activeProfile:e.profile,sourcePath:null,manifestPath:u.join(e.repoPath,F),agents:[],skills:[],evals:[],git:n,catalog:ue(o),skillCatalog:de(o),actionCatalog:[],sourceSetupRequirements:[],setupGate:fe(),diff:Y(),hosted:ot(e),summary:pe(o),lastCheck:e.lastCheck??null,error:o}}}s(z,"loadOpenPondProfileStateForConfig");async function Do(e){return z({repoPath:u.resolve(e.repoPath),profile:e.profileId,mode:"local"})}s(Do,"loadOpenPondProfileStateFromSource");async function te(){let e=(await O()).openpondProfile;if(!e)throw new Error("No active OpenPond profile. Run `openpond init` or `openpond profile load --path <dir>`.");let t=await j();if(t.error)throw new Error(t.error);if(!t.sourcePath)throw new Error("Active OpenPond profile has no source path.");return{config:e,state:t}}s(te,"requireActiveLocalProfile");async function Bo(e){let t=await te(),n=e.command==="run"?e.args??[]:[],o=e.command==="run"?t.state.actionCatalog.find(l=>l.id===n[0]):null,r=u.resolve(e.cwd??o?.sourcePath??t.state.sourcePath),i=e.command==="run"?nt(r,e.args??[],o?.sourceActionId??null):null;if(e.command==="run"&&i){let l=i[0],c=u.resolve(t.state.sourcePath)===r?{actionCatalog:t.state.actionCatalog,sourceSetupRequirements:t.state.sourceSetupRequirements}:await Be(r);oe(l,K({actionCatalog:c.actionCatalog,sourceSetupRequirements:c.sourceSetupRequirements,actionId:l}))}let a=await ft({command:e.command,args:e.command==="run"?i??nt(r,e.args??[]):e.args,cwd:r,inherit:e.inherit,throwOnFailure:!1});if((e.command==="inspect"||e.command==="build"||e.command==="validate"||e.command==="eval")&&await Se(e.command,a.code),a.code!==0){let l=a.stderr.trim()||a.stdout.trim();throw new Error(l||`${e.command} failed with exit code ${a.code??"unknown"}`)}return a}s(Bo,"runProfileSdkCommand");async function ft(e){let t=u.resolve(e.cwd),n=Un(),o=e.command==="run"?[...n.args,e.command,...e.args??[]]:[...n.args,e.command,"--cwd",t,...e.args??[]],r=await wt(n.command,o,{cwd:t,inherit:e.inherit,timeoutMs:e.timeoutMs,maxOutputBytes:e.maxOutputBytes});if(e.throwOnFailure!==!1&&r.code!==0){let i=St(r,e.command);throw new Error(i||`${e.command} failed with exit code ${r.code??"unknown"}`)}return r}s(ft,"runAgentSdkProjectCommand");function nt(e,t,n=null){let[o,...r]=t;if(!o||o.startsWith("--"))throw new Error("run requires an action name");return[n??o,"--cwd",e,...r]}s(nt,"runCommandArgs");async function zo(e){let t=!e||e==="all"?["inspect","build","validate","eval"]:[e],n=await te(),o=await T(n.config.repoPath),r=mt({manifest:o,profile:n.config.profile,profileSourcePath:n.state.sourcePath,agents:n.state.agents});if(r.length===0){if(t.some(i=>i!=="inspect"&&i!=="build"&&i!=="validate"&&i!=="eval"))throw new Error("check kind must be one of inspect, build, validate, eval, all");await Se("validate",0);return}for(let i of t){if(i!=="inspect"&&i!=="build"&&i!=="validate"&&i!=="eval")throw new Error("check kind must be one of inspect, build, validate, eval, all");for(let a of r)await An({command:i,source:a,profileSourcePath:n.state.sourcePath,sourceCount:r.length})}}s(zo,"runProfileCheck");async function An(e){let t=e.command==="inspect"||e.command==="validate"||e.command==="eval"?["--json"]:[];if(e.sourceCount>1){let o=u.relative(e.profileSourcePath,e.source.sourcePath)||".";console.log(`
|
|
9
9
|
[profile:${e.source.agentId}] ${e.command} ${o}`)}let n=await ft({command:e.command,args:t,cwd:e.source.sourcePath,inherit:!1,throwOnFailure:!1});if(n.stdout.trim()&&console.log(n.stdout.trim()),n.stderr.trim()&&console.error(n.stderr.trim()),await Se(e.command,n.code),n.code!==0){let o=St(n,e.command);throw new Error([`Profile check failed for enabled agent ${e.source.agentId} at ${e.source.sourcePath}.`,o||`${e.command} failed with exit code ${n.code??"unknown"}`].join(`
|
|
10
|
-
`))}}s(An,"runProfileCheckForSource");async function
|
|
10
|
+
`))}}s(An,"runProfileCheckForSource");async function Jo(e){let t=await te();if(!t.state.repoPath)throw new Error("Active OpenPond profile has no repo path.");let n=await $e(t.state.repoPath,e?.trim()||`Update OpenPond profile ${t.state.activeProfile??ct}`);return{committed:n.committed,stdout:n.stdout,stderr:n.stderr,state:await j()}}s(Jo,"commitActiveProfileChanges");async function Wo(e){let t=(await O()).openpondProfile;if(!t)return;let n=A(t).map(o=>u.resolve(o.repoPath)===u.resolve(t.repoPath)&&o.profile===t.profile?{...o,lastPush:e}:o);await L({openpondProfile:{...t,lastPush:e,profiles:n}})}s(Wo,"saveProfilePushStatus");async function Se(e,t){let n=(await O()).openpondProfile;if(!n)return;let o=await qe(n.repoPath).catch(()=>null),r={command:e,status:t===0?"passed":"failed",checkedAt:new Date().toISOString(),exitCode:t,sourceHead:o},i=A(n).map(a=>u.resolve(a.repoPath)===u.resolve(n.repoPath)&&a.profile===n.profile?{...a,lastCheck:r}:a);await L({openpondProfile:{...n,lastCheck:r,profiles:i}})}s(Se,"saveProfileCheckStatus");async function In(e,t,n){if(await v(e,{recursive:!0}),(await lt(e)).length>0&&!n)return;let r=J(),i=u.join(r,"templates",t);if(!k(i))throw new Error(`Unknown agent template "${t}".`);await yn(i,e,{recursive:!0,force:n,errorOnExist:!1}),await En(e,r)}s(In,"ensureProfileSource");async function vn(e,t,n,o={}){if(await v(u.join(e,"profiles"),{recursive:!0}),o.includeDefaultAgent===!1)return;for(let a of["agents","skills","workflows","actions","extensions","prompts","goals","evals","settings","traces"])await v(u.join(t,a),{recursive:!0});let r=u.join(t,Sn);k(r)||await D(r,["schema: openpond.profile.v1",`profile: ${n}`,"agents:",` - id: ${E}`," path: agent/agent.ts"," enabled: true",""].join(`
|
|
11
11
|
`),"utf8");let i=u.join(t,"openpond.lock");k(i)||await D(i,`# OpenPond profile lockfile placeholder
|
|
12
12
|
`,"utf8")}s(vn,"ensureProfileScaffoldFiles");async function En(e,t){let n=u.join(e,"package.json"),o=await at(n,"utf8"),r=JSON.parse(o);r.dependencies={...r.dependencies??{},"openpond-agent-sdk":`file:${t}`},await D(n,`${JSON.stringify(r,null,2)}
|
|
13
|
-
`,"utf8")}s(En,"rewriteTemplateSdkDependency");async function pt(e){if(!k(u.join(e,"package.json")))return;let t=
|
|
14
|
-
`,"utf8")}s(
|
|
13
|
+
`,"utf8")}s(En,"rewriteTemplateSdkDependency");async function pt(e){if(!k(u.join(e,"package.json")))return;let t=J();await gt(t);let n=u.join(e,"node_modules"),o=u.join(n,"openpond-agent-sdk");await v(n,{recursive:!0}),k(o)||await wn(t,o,"dir")}s(pt,"ensureProfileDependencies");async function gt(e){if(k(u.join(e,"dist","cli.js"))&&k(u.join(e,"dist","primitives","index.js")))return;let t=u.join(e,"scripts","build.ts");if(!k(t))throw new Error(`Resolved openpond-agent-sdk at ${e}, but built SDK files are missing.`);let n=await wt(process.execPath,[yt(e),t],{cwd:e});if(n.code!==0){let o=n.stderr.trim()||n.stdout.trim();throw new Error(o||`openpond-agent-sdk build failed with exit code ${n.code??"unknown"}`)}}s(gt,"ensureAgentSdkBuilt");async function xn(e,t){let n=e.profiles[t];if(!n)return[];let o=n.defaultAgent??E,r=new Set(n.enabledAgents??[o]);return Array.from(r).map(i=>({id:i,name:n.agentNames?.[i]?.trim()||i,path:i===E?"agent/agent.ts":`agents/${i}`,enabled:!0}))}s(xn,"listProfileAgents");function mt(e){let t=e.manifest.profiles[e.profile]?.defaultAgent??E;return e.agents.map(n=>({agentId:n.id,sourcePath:n.id===E?e.profileSourcePath:u.join(e.profileSourcePath,"agents",n.id),preferred:n.id===t}))}s(mt,"profileCatalogSources");async function _n(e,t){let n=new Map,o=[{root:u.join(e,"evals"),agentId:null},...t.flatMap(r=>[{root:u.join(r.sourcePath,"agent","evals"),agentId:r.agentId},{root:u.join(r.sourcePath,"evals"),agentId:r.agentId}])];for(let r of o)for(let i of await Pt(r.root)){let a=u.relative(e,i).split(u.sep).join("/");n.has(a)||n.set(a,{id:a,name:u.basename(i).replace(/\.eval\.[^.]+$/i,"").replace(/\.[^.]+$/i,""),path:a,agentId:r.agentId,sourcePath:i})}return[...n.values()].sort((r,i)=>r.name.localeCompare(i.name)||r.path.localeCompare(i.path))}s(_n,"loadProfileEvals");async function Pt(e){if(!k(e))return[];let t=[];for(let n of await lt(e,{withFileTypes:!0})){let o=u.join(e,n.name);n.isDirectory()?t.push(...await Pt(o)):n.isFile()&&/\.eval\.(?:[cm]?[jt]sx?)$/i.test(n.name)&&t.push(o)}return t}s(Pt,"listEvalSourceFiles");function ot(e){let t=e.lastPush;return t?{teamId:t.teamId??null,projectId:t.projectId??null,sourceRef:t.sourceRef??null,sourceCommitSha:t.hostedHead??null,lastPushedAt:t.pushedAt,lastPushedLocalHead:t.localHead??null,lastPushedHostedHead:t.hostedHead??null,promotionStatus:t.promotionStatus??null,hostedRunStatus:t.hostedRunStatus??null,hostedRunAgentId:t.hostedRunAgentId??null,hostedRunId:t.hostedRunId??null,hostedRunAt:t.hostedRunAt??null,hostedSourceMaterialization:t.hostedSourceMaterialization??null,hostedSourceCheck:t.hostedSourceCheck??null,hostedPublish:t.hostedPublish??null,hostedRun:t.hostedRun??null}:null}s(ot,"hostedBindingFromConfig");function Ln(e){let t=e.actionCatalog.find(r=>r.id==="chat")?.id??e.actionCatalog.find(r=>r.name==="chat")?.id??e.actionCatalog.find(r=>r.id.endsWith(".chat"))?.id??null,n=!!(!e.catalog.stale&&!e.git.dirty&&e.git.head&&(e.agents.length===0||e.lastCheck?.status==="passed"&&e.lastCheck.sourceHead===e.git.head)),o=e.agents.length===0&&!e.catalog.stale&&!e.git.dirty?null:Mn({catalog:e.catalog,git:e.git,lastCheck:e.lastCheck});return e.error?{state:"error",message:e.error,agentCount:e.agents.length,actionCount:e.actionCatalog.length,defaultAction:t,checkFresh:n,checkStaleReason:o,localHead:e.git.head,hostedHead:e.hosted?.sourceCommitSha??null}:e.git.isRepo?e.git.head?e.git.dirty?{state:"dirty",message:$n(e.diff),agentCount:e.agents.length,actionCount:e.actionCatalog.length,defaultAction:t,checkFresh:n,checkStaleReason:o,localHead:e.git.head,hostedHead:e.hosted?.sourceCommitSha??null}:{state:"ready",message:e.catalog.stale?"Profile source is clean; action catalog needs inspect/build.":"Profile source is clean.",agentCount:e.agents.length,actionCount:e.actionCatalog.length,defaultAction:t,checkFresh:n,checkStaleReason:o,localHead:e.git.head,hostedHead:e.hosted?.sourceCommitSha??null}:{state:"pending_commit",message:"Profile source is ready for its first commit.",agentCount:e.agents.length,actionCount:e.actionCatalog.length,defaultAction:t,checkFresh:!1,checkStaleReason:"Profile source has no committed head.",localHead:null,hostedHead:e.hosted?.sourceCommitSha??null}:{state:"error",message:"Profile source is not Git-backed.",agentCount:e.agents.length,actionCount:e.actionCatalog.length,defaultAction:t,checkFresh:!1,checkStaleReason:"Profile source is not Git-backed.",localHead:null,hostedHead:e.hosted?.sourceCommitSha??null}}s(Ln,"summarizeProfileState");function Mn(e){return e.catalog.error?`Catalog error: ${e.catalog.error}`:e.catalog.stale?"Action catalog artifacts are missing or stale.":e.lastCheck?e.lastCheck.status!=="passed"?`Last ${e.lastCheck.command} check failed.`:e.lastCheck.sourceHead?e.git.head&&e.lastCheck.sourceHead!==e.git.head?"Profile source changed since the last check.":e.git.dirty?"Profile has uncommitted source changes.":null:"Last check did not record a source head.":"Profile checks have not run."}s(Mn,"profileCheckStaleReason");function $n(e){let t=[];return e.changedAgents.length>0&&t.push(`${e.changedAgents.length} changed agent(s)`),e.newAgents.length>0&&t.push(`${e.newAgents.length} new agent(s)`),e.deletedAgents.length>0&&t.push(`${e.deletedAgents.length} deleted agent(s)`),e.changedSkills.length>0&&t.push(`${e.changedSkills.length} changed skill(s)`),e.changedActions.length>0&&t.push(`${e.changedActions.length} changed action(s)`),e.changedExtensions.length>0&&t.push(`${e.changedExtensions.length} changed extension(s)`),e.setupChanges.length>0&&t.push(`${e.setupChanges.length} setup change(s)`),e.envRequirementChanges.length>0&&t.push(`${e.envRequirementChanges.length} env requirement change(s)`),t.length>0?`Profile has ${t.join(", ")}.`:"Profile has uncommitted source changes."}s($n,"profileDirtyMessage");function qn(e,t){let n=Y();n.files=e.files;let o=`profiles/${t}/`;for(let r of e.files){let i=r.path.replace(/\\/g,"/");if(i===F||i===".gitignore"){I(n.setupChanges,i);continue}if(!i.startsWith(o))continue;let a=i.slice(o.length);jn(n,r,a)}return n}s(qn,"summarizeProfileDiff");function jn(e,t,n){let o=n.split("/")[0]??"";if(o==="agent")rt(e,E,t.category);else if(o==="agents"){let r=n.split("/")[1];r&&rt(e,r,t.category)}else o==="skills"?I(e.changedSkills,n.split("/")[1]??n):o==="actions"?I(e.changedActions,n.split("/")[1]??n):o==="extensions"?I(e.changedExtensions,n.split("/")[1]??n):(o==="settings"||n==="package.json"||n==="openpond.yaml"||n==="openpond.lock")&&I(e.setupChanges,n);n.toLowerCase().includes("env")&&I(e.envRequirementChanges,n),n.startsWith(".openpond/")&&I(e.changedActions,"catalog")}s(jn,"classifyProfileFileChange");function rt(e,t,n){if(n==="added"||n==="untracked"){I(e.newAgents,t);return}if(n==="deleted"){I(e.deletedAgents,t);return}I(e.changedAgents,t)}s(rt,"addAgentChange");function I(e,t){!t||e.includes(t)||e.push(t)}s(I,"addUnique");function ke(e){let t=e?.trim();if(!t)return ct;if(!/^[a-zA-Z0-9._-]+$/.test(t))throw new Error("profile name may only contain letters, numbers, dots, underscores, and hyphens");return t}s(ke,"normalizeProfileName");function Fn(e){let t=e.trim().replace(/\s+/g," ");if(!t)throw new Error("Agent name is required.");if(t.length>80)throw new Error("Agent name must be 80 characters or fewer.");if(/[\u0000-\u001f\u007f]/.test(t))throw new Error("Agent name cannot contain control characters.");return t}s(Fn,"normalizeAgentDisplayName");function Tn(e,t){return{schema:"openpond.profileRepo.v1",defaultProfile:e,profiles:{[e]:{path:t,defaultAgent:E,enabledAgents:[E]}}}}s(Tn,"defaultProfileManifest");async function T(e){let t=u.join(e,F),n=await at(t,"utf8"),o=JSON.parse(n);if(o.schema!=="openpond.profileRepo.v1"||!o.profiles||typeof o.profiles!="object")throw new Error(`${t} is not an OpenPond profile repo manifest.`);return o}s(T,"readProfileManifest");async function Q(e,t){await D(u.join(e,F),`${JSON.stringify(t,null,2)}
|
|
14
|
+
`,"utf8")}s(Q,"writeProfileManifest");function Ce(e,t,n){let o=e.profiles[n];if(!o)throw new Error(`Profile "${n}" was not found in ${u.join(t,F)}.`);let r=u.resolve(t,o.path);if(!k(r))throw new Error(`Profile source path does not exist: ${r}`);return r}s(Ce,"profileSourcePath");function Gn(e){let t=0,n=new Set;for(let l of e.source.files){let c=ht(l.path);if(n.has(c))throw new Error(`Agent package contains duplicate source path ${c}.`);n.add(c);let d=Buffer.from(l.contentsBase64,"base64");if(d.byteLength!==l.sizeBytes||et("sha256").update(d).digest("hex")!==l.sha256)throw new Error(`Agent package source checksum failed for ${c}.`);t+=d.byteLength}if(t!==e.source.totalSizeBytes)throw new Error("Agent package source size does not match its manifest.");let{digest:o,versionId:r,...i}=e,a=et("sha256").update(Nn(i)).digest("hex");if(a!==e.digest||e.versionId!==`agent-${a.slice(0,20)}`)throw new Error("Agent package content digest does not match its version.")}s(Gn,"verifyAgentPackageIntegrity");async function Hn(e,t){await v(e,{recursive:!0,mode:448});for(let o of t.source.files){let r=ht(o.path),i=u.resolve(e,r);if(!i.startsWith(`${u.resolve(e)}${u.sep}`))throw new Error("Agent package source path escapes its install root.");await v(u.dirname(i),{recursive:!0,mode:448});let a=Buffer.from(o.contentsBase64,"base64");if(r==="package.json"){let l=JSON.parse(a.toString("utf8"));l.dependencies={...l.dependencies??{},"openpond-agent-sdk":`file:${J()}`},a=Buffer.from(`${JSON.stringify(l,null,2)}
|
|
15
15
|
`,"utf8")}await D(i,a,{mode:384,flag:"wx"})}let n=u.join(e,".openpond","agent-package-origin.json");await v(u.dirname(n),{recursive:!0,mode:448}),await D(n,`${JSON.stringify({schema:"openpond.agent-package-origin.v1",agentId:t.agentId,versionId:t.versionId,digest:t.digest,validationReceiptIds:t.receipts.filter(o=>o.kind==="sdk_validation").map(o=>o.id),evalReceiptIds:t.receipts.filter(o=>o.kind==="sdk_eval").map(o=>o.id)},null,2)}
|
|
16
|
-
`,{mode:384,flag:"wx"})}s(Hn,"materializeAgentPackage");function ht(e){let t=e.trim().replaceAll("\\","/"),n=u.posix.normalize(t);if(!n||n==="."||n===".."||n.startsWith("/")||n.startsWith("../")||n.split("/").some(o=>o===".."))throw new Error(`Agent package contains an invalid source path: ${e}.`);return n}s(ht,"normalizeAgentPackagePath");function Nn(e){return JSON.stringify(we(e))}s(Nn,"stableAgentPackageJson");function we(e){return Array.isArray(e)?e.map(we):!e||typeof e!="object"?e:Object.fromEntries(Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>[t,we(n)]))}s(we,"sortAgentPackageJson");function
|
|
16
|
+
`,{mode:384,flag:"wx"})}s(Hn,"materializeAgentPackage");function ht(e){let t=e.trim().replaceAll("\\","/"),n=u.posix.normalize(t);if(!n||n==="."||n===".."||n.startsWith("/")||n.startsWith("../")||n.split("/").some(o=>o===".."))throw new Error(`Agent package contains an invalid source path: ${e}.`);return n}s(ht,"normalizeAgentPackagePath");function Nn(e){return JSON.stringify(we(e))}s(Nn,"stableAgentPackageJson");function we(e){return Array.isArray(e)?e.map(we):!e||typeof e!="object"?e:Object.fromEntries(Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>[t,we(n)]))}s(we,"sortAgentPackageJson");function J(){let e=Cn.resolve("openpond-agent-sdk/package.json");return u.dirname(e)}s(J,"resolveAgentSdkRoot");async function Ko(){let e=J();return await gt(e),e}s(Ko,"prepareAgentSdkRuntimePackage");function Un(){let e=J(),t=u.join(e,"dist","cli.js");if(k(t))return{command:process.execPath,args:[t]};let n=u.join(e,"src","cli.ts");if(k(n))return{command:process.execPath,args:[yt(e),n]};throw new Error(`openpond-agent CLI was not found under ${e}`)}s(Un,"resolveAgentSdkCliLaunch");function yt(e){return st(u.join(e,"package.json")).resolve("tsx/cli")}s(yt,"resolveTsxCli");async function wt(e,t,n={}){return new Promise((o,r)=>{let i=hn(e,t,{cwd:n.cwd,stdio:n.inherit?"inherit":"pipe"}),a="",l="",c=!1,d=!1,g=!1,P=n.timeoutMs??600*1e3,x=n.maxOutputBytes??2*1024*1024,S=P>0?setTimeout(()=>{g=!0,i.kill("SIGTERM")},P):null,M=P>0?setTimeout(()=>{g&&i.exitCode===null&&i.kill("SIGKILL")},P+5e3):null;n.inherit||(i.stdout?.on("data",_=>{let m=it(a,String(_),x,c);a=m.text,c=m.truncated}),i.stderr?.on("data",_=>{let m=it(l,String(_),x,d);l=m.text,d=m.truncated}));let G=s(()=>{S&&clearTimeout(S),M&&clearTimeout(M)},"clearTimers");i.on("error",_=>{G(),r(_)}),i.on("close",_=>{G(),o({code:_,stdout:a,stderr:l,timedOut:g,stdoutTruncated:c,stderrTruncated:d})})})}s(wt,"spawnCommand");function it(e,t,n,o){if(o)return{text:e,truncated:!0};let r=`${e}${t}`;return Buffer.byteLength(r,"utf8")<=n?{text:r,truncated:!1}:{text:`${Buffer.from(r).subarray(0,Math.max(0,n)).toString("utf8")}
|
|
17
17
|
[truncated after ${n} bytes]
|
|
18
18
|
`,truncated:!0}}s(it,"appendBoundedOutput");function St(e,t){let n=e.stderr.trim()||e.stdout.trim(),o=[e.timedOut?`${t} timed out`:"",e.stdoutTruncated?"stdout truncated":"",e.stderrTruncated?"stderr truncated":""].filter(Boolean);return[n,...o].filter(Boolean).join(`
|
|
19
|
-
`)}s(St,"commandFailureDetail");export{cn as a,
|
|
19
|
+
`)}s(St,"commandFailureDetail");export{cn as a,W as b,K as c,oe as d,Rt as e,Tt as f,Ht as g,Nt as h,Ut as i,Dt as j,F as k,Sn as l,ct as m,E as n,kn as o,ee as p,On as q,ut as r,qo as s,jo as t,Fo as u,To as v,Go as w,j as x,ye as y,Rn as z,bn as A,Ho as B,No as C,Uo as D,Do as E,te as F,Bo as G,ft as H,zo as I,Jo as J,Wo as K,Ko as L};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{g as J}from"./chunk-25GCTLAZ.js";import{$ as G,S as U,aa as F,ea as N}from"./chunk-U6SFIFDM.js";import{L as O,da as H}from"./chunk-6QUICEQA.js";import{$ as R,Ta as $,pc as L}from"./chunk-KOR2AZVB.js";import{Q as _,R as q,S as E}from"./chunk-XWLI7WJH.js";import{U as V,V as P,X as z,ba as W}from"./chunk-QVRNOGAU.js";import{Ea as j}from"./chunk-5ZFEQLRI.js";import{a as g,b as h,c as b,k as M,l as s,n as B,q as A}from"./chunk-HZP5U2AA.js";import{b as c}from"./chunk-ES2ISFJC.js";import{a as u}from"./chunk-FTQLQJQV.js";import{promises as Y}from"node:fs";import Z from"node:path";async function ue(e){let i=e.definition.tasksetRelease,r=await J(e.store,e.harnessRelease);if(!r)throw new Error("Evaluation Profile Harness release is unavailable.");let t=await te({...e,runtime:r});if(t)return t;let a=await e.store.listTasksetRevisions(e.profileId);for(let o of a){if(i.id!==o.id&&i.id!==`taskset-release-${o.id}-r${o.revision}`)continue;let l=await ee(e.storeDir,o);if(l.taskset.id===i.id&&l.taskset.contentHash===i.contentHash)return l}throw new Error(`Released Taskset ${i.id} is unavailable in Profile ${e.profileId}.`)}u(ue,"loadLocalProfileEvaluationTaskset");async function ee(e,i){let r=i.metadata.importedPackageHash;if(typeof r=="string"){let o=await F(e,r);if(o.taskset.id!==i.id||o.taskset.revision!==i.revision)throw new Error("Imported evaluation Taskset differs from its local Profile revision.");return o}if($(i)!==i.contentHash)throw new Error("Authored evaluation Taskset differs from its immutable revision.");let t=L({taskset:i,adapterId:U(i)}),a=await N({storeDir:e,taskset:i,content:{schemaVersion:"openpond.tasksetPackage.v1",taskset:t.tasksetRelease,environment:t.environmentRelease,verifierSet:t.verifierSetRelease}});return await G(e,a),a}u(ee,"loadCandidate");async function te(e){let i=e.definition.tasksetRelease,r=e.runtime;if(r.release.harnessRelease.id!==e.harnessRelease.id||r.release.harnessRelease.contentHash!==e.harnessRelease.contentHash)throw new Error("Evaluation Taskset runtime differs from its requested release.");let t=`evals/tasksets/${i.contentHash}.json`,a=r.release.harnessRelease.files.find(o=>o.path===t);if(a){if(a.visibility!=="verifier")throw new Error("Evaluation Taskset package is not verifier-private.");let o=await Y.readFile(Z.join(r.release.bundlePath,"source",...t.split("/")));if(M(o)!==a.contentHash)throw new Error("Released evaluation Taskset package bytes differ from their source receipt.");let l=R(JSON.parse(o.toString("utf8")));if(l.taskset.id!==i.id||l.taskset.contentHash!==i.contentHash)throw new Error("Released evaluation Taskset package differs from its definition.");return l}return null}u(te,"loadReleasedProfileEvaluationTaskset");function y(e){return{id:z(e),label:"Selected Dataset evaluation",description:"Explicit sealed external Dataset evaluation recipe.",target:e.target,tasksetRelease:{id:e.dataset.id,contentHash:e.dataset.contentHash},split:e.split,taskIds:[...new Set(e.population.map(i=>i.taskId))],seeds:[...new Set(e.population.map(i=>i.seed))],criterion:e.criterion}}u(y,"externalProfileEvaluationDefinition");async function we(e){let i=e.manifest.profileEvaluation,r=i?.externalDatasetBinding?P(i.externalDatasetBinding):null;if(!r)return null;if(!e.resolveExternalDataset)throw new Error("This owner has no authorized external Dataset resolver.");let t=await e.resolveExternalDataset(r,e.selected);await t.authorize();let a=R(t.packageValue),o=await e.loadCatalog({ref:e.selected.profileRef,sourceRevision:e.selected.sourceRevision,harnessRelease:e.selected.harnessRelease});if(s(t.binding)!==s(r)||r.profileId!==e.selected.profileRef.profileId||r.declaredProfileCatalogHash!==o.catalogHash||a.contentHash!==r.packageHash||s(a.taskset)!==s(e.taskset)||r.environmentHash!==s(a.taskset.environment)||r.privateDatasetClosureHash!==s(a.files.filter(d=>d.asset.visibility!=="policy").map(d=>d.asset)))throw new Error("External Dataset admission changed its actual Profile, package or private closure.");let l=y(r),m={schemaVersion:"openpond.profileEvaluations.v1",definitions:[l],suites:[]};if(E(e.manifest,e.taskset,m),!i||i.catalogHash!==s(m)||i.definitionHash!==s(l)||s(i.target)!==s(r.target))throw new Error("External Dataset manifest changed its derived definition.");return await t.authorize(),{...t,packageValue:a,definition:l,catalog:m}}u(we,"admitProfileExternalDataset");var ae=c.object({id:g,createdAt:b,definitionId:g,externalDatasetBinding:V.optional(),profileRef:O.optional(),profileSource:c.object({sourceRevision:c.string().min(1).max(500),harnessRelease:c.object({id:g,contentHash:h}).strict()}).strict().optional(),modelRef:A,hostModelConfigurationHash:h.optional(),hostArtifactHash:h.optional(),maximumSpendUsd:c.number().positive().max(1e4).optional(),expectedManifestHash:h.optional(),hostExperiment:c.object({definition:c.object({id:g,revision:c.number().int().positive(),contentHash:h}).strict().nullable(),configurationHash:h,project:c.object({id:g,revision:c.number().int().positive(),contentHash:h,targetId:g.nullable()}).strict().optional()}).strict().optional()}).strict();function Se(e){return async(i,r)=>{let t=ae.parse(i);if(r?.requireExpectedManifestHash&&!t.expectedManifestHash)throw new Error("Profile evaluation execution requires the reviewed manifest hash.");if(t.profileSource&&!t.profileRef)throw new Error("An exact Profile source requires its accepted Profile reference.");let a=r?.selectedWorkflows??await e.selectedWorkflows(t.profileRef,t.profileSource);if(t.profileRef&&s(t.profileRef)!==s(a.profileRef))throw new Error("Profile preparation did not resolve the explicitly selected Profile.");if(t.profileSource&&(a.sourceRevision!==t.profileSource.sourceRevision||s(a.harnessRelease)!==s(t.profileSource.harnessRelease)))throw new Error("Profile preparation changed its explicitly pinned source.");let o=t.externalDatasetBinding?P(t.externalDatasetBinding):null,l=o?await(e.resolveExternalDataset?e.resolveExternalDataset(o,a):Promise.reject(new Error("This host has not qualified external Dataset Profile execution."))):null;if(l&&(await l.authorize(),s(P(l.binding))!==s(o)))throw new Error("External Dataset admission differs from the actual authorized recipe.");let m=await e.loadCatalog({ref:a.profileRef,sourceRevision:a.sourceRevision,harnessRelease:a.harnessRelease});if(o&&o.declaredProfileCatalogHash!==m.catalogHash)throw new Error("The original Profile verifier catalog changed.");let d=o?y(o):null;if(d&&t.definitionId!==d.id)throw new Error("Use the external recipe's own definition identity.");let T={schemaVersion:"openpond.profileEvaluations.v1",definitions:d?[d]:m.definitions,suites:d?[]:m.suites},p=d??m.definitions.find(n=>n.id===t.definitionId);if(!p)throw new Error(`Evaluation ${t.definitionId} is absent from the selected Profile release.`);let v=p.target,D=v.kind==="workflow"?a.workflows.find(n=>n.binding.workflowId===v.workflowId)?.binding:j.parse({schemaVersion:"openpond.profileComponentBinding.v1",profileId:a.profileRef.profileId,sourceRevision:a.sourceRevision,harnessRelease:a.harnessRelease,target:v});if(!D)throw new Error(`Evaluation workflow ${v.kind==="workflow"?v.workflowId:""} is absent from the selected Profile release.`);let k=R(l?.packageValue??await e.loadTasksetPackage(p,a.profileRef.profileId,a.harnessRelease)),f=k.taskset;if(f.id!==p.tasksetRelease.id||f.contentHash!==p.tasksetRelease.contentHash)throw new Error("Evaluation Taskset package differs from its released definition.");let S=f.environment.kind==="text"&&f.tools.length===0,K=f.environment.kind==="work"&&f.environment.entrypoint==="openpond-work-v1"&&f.tools.every(n=>["work_exec","work_save_output"].includes(n.name));if(!S&&!K)throw new Error("Profile evaluation supports text cases or Work cases with the built-in execution and output tools.");if(t.maximumSpendUsd!==void 0&&!S)throw new Error("Bounded hosted Profile evaluation currently qualifies text cases without external compute.");if(f.tasks.some(n=>n.artifactRefs.length>H.maxAttachments||n.artifactRefs.some(w=>w.visibility!=="policy"||w.mediaType!=="application/pdf"||w.sizeBytes>H.maxAttachmentBytes)))throw new Error("Profile evaluation accepts only bounded policy-visible PDF task attachments.");if(!o&&!e.privateGradingPreflight&&(f.graders.some(n=>n.kind==="model_judge"||n.kind==="custom_verifier")||f.metrics?.aggregation==="custom"))throw new Error("Profile evaluation cannot run this Taskset's model judge, custom verifier, or custom metric in the current app-server runtime.");await e.privateGradingPreflight?.(k);let I={adapterId:v.kind==="workflow"?"openpond.profile-workflow":"openpond.profile-component",placement:e.placement,runtimeVersion:"app-server-v1",capabilityReceipt:s({adapterId:v.kind==="workflow"?"openpond.profile-workflow":"openpond.profile-component",packageHash:k.contentHash,connectedAppScopes:f.policy.connectedAppScopes})},Q={...W({catalog:T,definitionId:p.id,profileId:a.profileRef.profileId,sourceRevision:a.sourceRevision,harnessRelease:a.harnessRelease,environmentHash:s({packageHash:k.contentHash,runtimeTarget:I})}),...o?{externalDatasetBinding:o}:{},...e.sourceCandidate?{sourceCandidate:e.sourceCandidate}:{}};if(o&&(o.packageHash!==k.contentHash||o.environmentHash!==s(f.environment)||o.privateDatasetClosureHash!==s(k.files.filter(n=>n.asset.visibility!=="policy").map(n=>n.asset))))throw new Error("External Dataset package/environment/private closure changed.");let X=B.parse({provider:t.modelRef.providerId,model:t.modelRef.modelId,revision:null,artifactHash:t.hostArtifactHash??null,tokenizerRevision:null,chatTemplateHash:null}),C=await e.modelConfigurationHash(t.modelRef,t),x=_({schemaVersion:"openpond.tasksetRunManifest.v1",id:t.id,tasksetRelease:p.tasksetRelease,packageHash:k.contentHash,execution:{kind:"harness",harnessRelease:a.harnessRelease},profileEvaluation:Q,policy:{kind:"model",model:X,configurationHash:C},gradingRole:"evaluation",metricPolicy:q(f),population:o?o.population.map(n=>({...n,receiptId:`evaluation-${s([t.id,n.taskId,n.seed,n.fixtureId]).slice(0,32)}`})):p.taskIds.flatMap(n=>p.seeds.map(w=>({receiptId:`evaluation-${s([t.id,n,w]).slice(0,32)}`,taskId:n,seed:w,fixtureId:null}))),runtimeTarget:I,limits:{maxTurns:128,timeoutMs:f.environment.defaultTimeoutMs,maxOutputBytes:25e7,maximumSpendUsd:t.maximumSpendUsd??null},createdAt:t.createdAt,metadata:{sourceTasksetId:f.metadata.sourceTasksetId??f.id,...a.profileRef.source==="openpond_git"?{profileRepositoryId:a.profileRef.repositoryId}:{},...t.hostExperiment?{experimentDefinition:t.hostExperiment.definition,experimentConfigurationHash:t.hostExperiment.configurationHash,...t.hostExperiment.project?{project:t.hostExperiment.project}:{}}:{}}});if(E(x,f,T),l&&await l.authorize(),t.expectedManifestHash&&x.contentHash!==t.expectedManifestHash)throw new Error("Profile evaluation setup changed since preview; prepare the run again.");return{manifest:x,taskset:f,profileRef:a.profileRef,binding:D,modelRef:t.modelRef,modelConfigurationHash:C}}}u(Se,"createProfileEvaluationRunPreparationService");export{ue as a,te as b,we as c,Se as d};
|