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
package/dist/app-server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{$b as r}from"./chunks/chunk-6BL2ZIAP.js";import{e as p}from"./chunks/chunk-3SRIPOJQ.js";import"./chunks/chunk-B6LYKEMU.js";import{i as e}from"./chunks/chunk-NXUCGKY2.js";import"./chunks/chunk-CXS3WXL3.js";import"./chunks/chunk-7D2WMUWK.js";import"./chunks/chunk-M2YXYBSP.js";import"./chunks/chunk-3BJ4P5LI.js";import"./chunks/chunk-4EGDKOYP.js";import"./chunks/chunk-J65BMG5Q.js";import"./chunks/chunk-25GCTLAZ.js";import"./chunks/chunk-LL4QP2IM.js";import"./chunks/chunk-HUBI3RUK.js";import"./chunks/chunk-VESOG2SS.js";import"./chunks/chunk-U6SFIFDM.js";import"./chunks/chunk-GEDEVI4Y.js";import"./chunks/chunk-PGKEDR3S.js";import"./chunks/chunk-FXIUKYUR.js";import"./chunks/chunk-L3KS6MOV.js";import"./chunks/chunk-XEOEKFG6.js";import"./chunks/chunk-PDIT2QS7.js";import"./chunks/chunk-6QUICEQA.js";import"./chunks/chunk-ELNJUG64.js";import"./chunks/chunk-6MI4KKWF.js";import"./chunks/chunk-KOR2AZVB.js";import"./chunks/chunk-VFTUP5NQ.js";import"./chunks/chunk-Z3D4C7BG.js";import"./chunks/chunk-XWLI7WJH.js";import"./chunks/chunk-ALZRXBEC.js";import"./chunks/chunk-MTJNKRXL.js";import"./chunks/chunk-6FA3GG5B.js";import"./chunks/chunk-QVRNOGAU.js";import"./chunks/chunk-5ZFEQLRI.js";import"./chunks/chunk-HZP5U2AA.js";import"./chunks/chunk-ES2ISFJC.js";import"./chunks/chunk-SDO4FC4Q.js";import"./chunks/chunk-IR3YJWPW.js";import"./chunks/chunk-H7IWJN7L.js";import"./chunks/chunk-FTQLQJQV.js";export{e as AGENT_PROTOCOL_VERSION,r as createOpenPondAppServer,p as runAppServerJsonl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as v}from"./chunk-65BW2QXY.js";import"./chunk-XWPC3AN4.js";import{f as b}from"./chunk-3M53YXEI.js";import{b as R,c as p,d as m}from"./chunk-XEOEKFG6.js";import{A as O}from"./chunk-H3C4ZYEA.js";import{d as P}from"./chunk-DXAZUJPA.js";import"./chunk-GLUWATL5.js";import"./chunk-VFTUP5NQ.js";import"./chunk-Z3D4C7BG.js";import"./chunk-XWLI7WJH.js";import"./chunk-ALZRXBEC.js";import"./chunk-MTJNKRXL.js";import"./chunk-QVRNOGAU.js";import"./chunk-5ZFEQLRI.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-H7IWJN7L.js";import{a as c}from"./chunk-FTQLQJQV.js";import{promises as $,watch as C}from"node:fs";import y from"node:path";import{execFile as J}from"node:child_process";import{promisify as k}from"node:util";var K=k(J);async function G(t,n){let e=n[0]??"check",o=y.resolve(i(t,"cwd")??process.cwd()),l=i(t,"sourceDirectory"),u=i(t,"outputDirectory"),d=b(t.json);if(e==="check"||e==="build"){let r=await p({projectRoot:o,sourceDirectory:l,outputDirectory:u});if(d){console.log(JSON.stringify({status:"passed",actionCount:r.registry.actions.length,registry:r.registry,manifest:r.manifest,outputDirectory:r.outputDirectory},null,2));return}console.log(`${e==="check"?"Validated":"Built"} ${r.registry.actions.length} Project Action${r.registry.actions.length===1?"":"s"}.`),console.log(`Registry: ${r.registryPath}`),console.log(`Bundle: ${r.bundlePath}`);return}if(e==="run"){let r=n[1];if(!r)throw new Error("usage: openpond actions run <action-id> [--input JSON|--input-file PATH]");let a=await m({projectRoot:o,sourceDirectory:l,outputDirectory:u,build:"always"}).run({actionId:r,input:await I(t,o),timeoutMs:A(t,"timeoutMs")});console.log(JSON.stringify(a,null,2));return}if(e==="dev"){let r=n[1]??null;await _({projectRoot:o,sourceDirectory:l,outputDirectory:u,actionId:r,options:t,json:d});return}if(e==="publish"){let r=j(t,"projectId"),s=j(t,"teamId"),a=i(t,"apiKey"),w=process.env.OPENPOND_API_KEY?.trim()||null,g=a||w?null:await P({account:i(t,"account")}),h=a??w??(g?v(g):null);if(!h)throw new Error("OpenPond API key is required. Select a saved OpenPond account, set OPENPOND_API_KEY, or pass --api-key.");let N=await p({projectRoot:o,sourceDirectory:l,outputDirectory:u}),E=i(t,"sourceCommitSha")??await D(o,["rev-parse","HEAD"]),S=i(t,"sourceRef")??await D(o,["rev-parse","--abbrev-ref","HEAD"]),f=await O({apiKey:h,baseUrl:i(t,"baseUrl")??(process.env.OPENPOND_API_URL?.trim()||g?.apiBaseUrl)}).actions.publish({projectId:r,teamId:s,sourceRef:S,sourceCommitSha:E,build:N});console.log(d?JSON.stringify({release:f},null,2):`Published Project Actions release ${f.id} from ${f.sourceCommitSha}.`);return}throw new Error("usage: openpond actions <check|build|run|dev|publish> [action-id]")}c(G,"runProjectActionsCommand");async function _(t){let n=!1,e=!1,o=c(async()=>{if(n){e=!0;return}n=!0;try{let r=m({projectRoot:t.projectRoot,sourceDirectory:t.sourceDirectory,outputDirectory:t.outputDirectory,build:"always"});if(t.actionId){let s=await r.run({actionId:t.actionId,input:await I(t.options,t.projectRoot),timeoutMs:A(t.options,"timeoutMs")});console.log(JSON.stringify(s,null,2))}else{let s=await r.build(),a={status:"ready",actionCount:s.registry.actions.length,bundleHash:s.manifest.bundleHash};console.log(t.json?JSON.stringify(a):`Ready with ${a.actionCount} Project Action${a.actionCount===1?"":"s"}.`)}}catch(r){console.error(r instanceof Error?r.message:String(r))}finally{n=!1,e&&(e=!1,await o())}},"execute");await o();let l=await R(t.projectRoot),u=y.resolve(t.projectRoot,t.sourceDirectory??l.sourceDirectory??"openpond/actions");console.log(`Watching ${u}`);let d=C(u,{recursive:!0},()=>{setTimeout(()=>{o()},50)});await new Promise(r=>{let s=c(()=>{d.close(),r()},"stop");process.once("SIGINT",s),process.once("SIGTERM",s)})}c(_,"runDev");async function I(t,n){let e=i(t,"input"),o=i(t,"inputFile");if(e&&o)throw new Error("Use either --input or --input-file, not both.");return e?JSON.parse(e):o?JSON.parse(await $.readFile(y.resolve(n,o),"utf8")):{}}c(I,"actionInput");function i(t,n){let e=t[n];return typeof e=="string"&&e.trim()?e.trim():void 0}c(i,"stringOption");function j(t,n){let e=i(t,n);if(!e)throw new Error(`--${n.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)} is required.`);return e}c(j,"requiredOption");async function D(t,n){let{stdout:e}=await K("git",n,{cwd:t}),o=e.trim();if(!o)throw new Error(`git ${n.join(" ")} returned no value.`);return o}c(D,"gitValue");function A(t,n){let e=i(t,n);if(e===void 0)return;let o=Number(e);if(!Number.isInteger(o)||o<=0)throw new Error(`--${n} must be a positive integer.`);return o}c(A,"integerOption");export{G as runProjectActionsCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{u as m}from"./chunk-B3O2GAQH.js";import"./chunk-65BW2QXY.js";import"./chunk-
|
|
2
|
+
import{u as m}from"./chunk-B3O2GAQH.js";import"./chunk-65BW2QXY.js";import{a as l}from"./chunk-EG55BFQ4.js";import"./chunk-V6WBSW5Q.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-3M53YXEI.js";import"./chunk-OGPHXXCD.js";import"./chunk-H3C4ZYEA.js";import"./chunk-Z2BYC6TP.js";import"./chunk-DXAZUJPA.js";import"./chunk-GLUWATL5.js";import"./chunk-VFTUP5NQ.js";import"./chunk-Z3D4C7BG.js";import"./chunk-XWLI7WJH.js";import"./chunk-ALZRXBEC.js";import"./chunk-MTJNKRXL.js";import"./chunk-QVRNOGAU.js";import"./chunk-5ZFEQLRI.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-H7IWJN7L.js";import{a as i}from"./chunk-FTQLQJQV.js";import{existsSync as c}from"node:fs";import{createRequire as v}from"node:module";import s from"node:path";import{fileURLToPath as E}from"node:url";var p="24.18.0";function N(e=process.versions.node){let r=/^(\d+)\.(\d+)\.(\d+)/.exec(e),n=r?Number(r[1]):Number.NaN,o=r?Number(r[2]):Number.NaN;return n===24&&o>=18?null:[`OpenPond TUI requires Node.js ${p} or newer in the Node 24 release line; detected Node.js ${e}.`,`Switch Node versions and retry (with nvm: \`nvm install ${p} && nvm use ${p}\`).`].join(`
|
|
3
3
|
`)}i(N,"openPondTuiNodeRuntimeMessage");var u=s.dirname(E(import.meta.url)),O=class extends Error{constructor(n,o){super(n);this.exitCode=o;this.name="OpenPondChildProcessExitError"}exitCode;static{i(this,"OpenPondChildProcessExitError")}};async function F(e,r,n){let o=f(e==="app-server"?"app-server":"server"),t=[...o.args,e,...P(r),...n];e==="web"&&t.push(r.noOpen===!0||r.noOpen==="true"?"--print-access-url":"--open-browser");let a=e==="web"&&typeof r.webRoot!="string"?C():null;a&&t.push("--web-root",a),await w(o.runner,t,e==="app-server"?process.cwd():o.cwd)}i(F,"runOpenPondServerCommand");async function q(e,r){b(e);let n=N();if(n)throw new l(n);let o=f("terminal"),t=f("server"),a=[...o.args,"chat",...P(R(e)),...r];await w(o.runner,a,process.cwd(),{OPENPOND_SERVER_RUNNER:t.runner,OPENPOND_SERVER_ARGS:JSON.stringify(t.args),OPENPOND_SERVER_CWD:t.cwd})}i(q,"runOpenPondTerminalCommand");function h(){if(process.env.OPENPOND_FORCE_EMBEDDED_COMPANIONS==="1")return null;let e=[s.resolve(u,"../../../.."),s.resolve(u,"../../.."),process.cwd()];for(let r of e)if(c(s.join(r,"apps","server"))&&c(s.join(r,"apps","terminal")))return r;return null}i(h,"findWorkspaceRoot");function f(e){let r=h();if(r){let t=e==="app-server"?s.join(r,"apps","server","src","app-server-entry.ts"):s.join(r,"apps",e,"src","index.ts");if(c(t)){let d=v(s.join(r,"package.json"));return{runner:process.execPath,args:[d.resolve("tsx/cli"),t],cwd:r}}let a=e==="app-server"?s.join(r,"apps","server","dist","app-server-entry.js"):s.join(r,"apps",e,"dist","index.js");if(c(a))return{runner:process.execPath,args:[a],cwd:r}}let n=_(),o=e==="app-server"?"__app-server":e==="server"?"__server":"__terminal";if(n)return{runner:process.execPath,args:[n,o],cwd:s.dirname(s.dirname(n))};if(D())return{runner:process.execPath,args:[o],cwd:process.cwd()};throw new Error(`Could not find the installed OpenPond ${e} companion.`)}i(f,"resolveAppEntrypoint");function _(){for(let e of[s.resolve(u,"../cli.js"),s.resolve(u,"../../dist/cli.js")])if(c(e))return e;return null}i(_,"installedCliEntrypoint");function C(){if(!1){let n=s.join(s.dirname(process.execPath),"web");return c(s.join(n,"index.html"))?n:null}let e=_();if(!e)return null;let r=s.join(s.dirname(e),"web");return c(s.join(r,"index.html"))?r:null}i(C,"packagedWebRoot");function D(){if(!1)return!0;let e=process.argv[1];return!!(e&&s.resolve(e)===s.resolve(process.execPath))}i(D,"isCompiledExecutable");function P(e){let r=new Set(["account","handle","baseUrl","noOpen","tui","home"]),n=[];for(let[o,t]of Object.entries(e)){if(r.has(o))continue;let a=`--${o.replace(/[A-Z]/g,d=>`-${d.toLowerCase()}`)}`;if(t===!0||t==="true")n.push(a);else{if(t===!1||t==="false")continue;n.push(a,t)}}return n}i(P,"forwardedOptions");function R(e){let r=process.cwd(),n={...e};return typeof e.cwd=="string"&&e.cwd.trim().length>0&&(n.cwd=s.resolve(r,e.cwd)),typeof e.messageFile=="string"&&e.messageFile.trim().length>0&&(n.messageFile=s.resolve(r,e.messageFile)),n}i(R,"normalizeTerminalPaths");function b(e){if(typeof e.approvalPolicy=="string"&&!["on-request","never","on-failure","untrusted"].includes(e.approvalPolicy))throw new l("approval-policy must be on-request, never, on-failure, or untrusted");if(typeof e.sandbox=="string"&&!["read-only","workspace-write","danger-full-access"].includes(e.sandbox))throw new l("sandbox must be read-only, workspace-write, or danger-full-access")}i(b,"validateTerminalForwardingOptions");async function w(e,r,n,o){let t=await m(e,r,{cwd:n,detached:!1,env:o,inherit:!0,timeoutMs:0});if(t.code!==0||t.signal){let a=t.signal?`signal ${t.signal}`:`code ${t.code??"unknown"}`;throw new O(`${s.basename(e)} exited with ${a}`,t.code??1)}}i(w,"runChild");export{O as OpenPondChildProcessExitError,F as runOpenPondServerCommand,q as runOpenPondTerminalCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{$b as d,_b as c}from"./chunk-6BL2ZIAP.js";import{e as b}from"./chunk-3SRIPOJQ.js";import"./chunk-B6LYKEMU.js";import{i as a}from"./chunk-NXUCGKY2.js";import"./chunk-CXS3WXL3.js";import"./chunk-7D2WMUWK.js";import"./chunk-M2YXYBSP.js";import"./chunk-3BJ4P5LI.js";import"./chunk-4EGDKOYP.js";import"./chunk-J65BMG5Q.js";import"./chunk-25GCTLAZ.js";import"./chunk-LL4QP2IM.js";import"./chunk-HUBI3RUK.js";import"./chunk-VESOG2SS.js";import"./chunk-U6SFIFDM.js";import"./chunk-GEDEVI4Y.js";import"./chunk-PGKEDR3S.js";import"./chunk-FXIUKYUR.js";import"./chunk-L3KS6MOV.js";import"./chunk-XEOEKFG6.js";import"./chunk-PDIT2QS7.js";import"./chunk-6QUICEQA.js";import"./chunk-ELNJUG64.js";import"./chunk-6MI4KKWF.js";import"./chunk-KOR2AZVB.js";import"./chunk-VFTUP5NQ.js";import"./chunk-Z3D4C7BG.js";import"./chunk-XWLI7WJH.js";import"./chunk-ALZRXBEC.js";import"./chunk-MTJNKRXL.js";import"./chunk-6FA3GG5B.js";import"./chunk-QVRNOGAU.js";import"./chunk-5ZFEQLRI.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as AGENT_PROTOCOL_VERSION,c as APP_SERVER_COMPOSITION,d as createOpenPondAppServer,b as runAppServerJsonl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{f as $,g as J,h as L,i as v,j as q}from"./chunk-B3O2GAQH.js";import{c as g}from"./chunk-65BW2QXY.js";import"./chunk-EG55BFQ4.js";import"./chunk-V6WBSW5Q.js";import{f as m,h as y}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as S,f as w,j as T,k as j}from"./chunk-3M53YXEI.js";import{b as H,c as Q}from"./chunk-22UARBPW.js";import"./chunk-OGPHXXCD.js";import"./chunk-H3C4ZYEA.js";import{J as C,K as G,L as k,O as W,Q as M,S as z,T as F,c as D,m as K,r as V,s as _}from"./chunk-Z2BYC6TP.js";import{d as f}from"./chunk-DXAZUJPA.js";import"./chunk-GLUWATL5.js";import"./chunk-VFTUP5NQ.js";import"./chunk-Z3D4C7BG.js";import"./chunk-XWLI7WJH.js";import"./chunk-ALZRXBEC.js";import"./chunk-MTJNKRXL.js";import"./chunk-QVRNOGAU.js";import"./chunk-5ZFEQLRI.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-H7IWJN7L.js";import{a as p}from"./chunk-FTQLQJQV.js";async function ie(){let e=await f(),s=m(e),t=await g(e,s),n=y(e),r=await L({apiBase:n,apiKey:t});console.log(JSON.stringify(r,null,2))}p(ie,"runAppsTools");async function se(e){let s=await f(),t=m(s),n=y(s),r=await g(s,t),i=typeof e.handle=="string"?String(e.handle):void 0,o=i?$(i):null,c=e.refresh!==void 0?w(e.refresh):void 0,l=await J({apiBase:n,apiKey:r,forceRefresh:c}),u=o?l.filter(a=>$(a.handle||a.gitOwner)===o):l;if(u.length===0){console.log("no apps found");return}if(w(e.json)){console.log(JSON.stringify({apps:u},null,2));return}for(let a of u){let d=a.handle||a.gitOwner||"unknown",h=a.repo||a.gitRepo||a.id,B=a.latestDeployment?.status||"no-deploy",R=a.latestDeployment?.gitBranch||a.defaultBranch||"-",I=a.codeVisibility||"unknown",E=a.sandbox?"yes":"no";console.log(`${d}/${h} ${B} ${R} code=${I} sandbox=${E} ${a.id}`)}}p(se,"runAppsList");async function oe(e,s){let t=typeof e.visibility=="string"?e.visibility.trim():typeof e.codeVisibility=="string"?e.codeVisibility.trim():"";if(t!=="public"&&t!=="private")throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");let n=await f(),r=m(n),i=y(n),o=await g(n,r),{app:c,handle:l,repo:u}=await v(i,o,s),a=await K(i,o,c.id,t);console.log(`${l}/${u} code_visibility=${a.app?.codeVisibility??t} app_id=${c.id}`)}p(oe,"runAppsCodeVisibility");async function ae(e){let s=await f(),t=m(s),n=await g(s,t),r=y(s),i=typeof e.appId=="string"?String(e.appId):void 0,o=await G(r,n,{appId:i});console.log(JSON.stringify(o,null,2))}p(ae,"runAppsPerformance");async function ce(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await k(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(ce,"runAppsSummary");async function le(e,s,t,n){let r=(typeof e.prompt=="string"?e.prompt:null)||n.join(" ");if(!r.trim())throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,t),a=await W(c,l,{appId:u.id,mode:s,prompt:r.trim()});console.log(JSON.stringify(a,null,2))}p(le,"runAppsAssistant");async function de(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),o=(typeof e.prompt=="string"?e.prompt:null)||s.join(" ");if(!o.trim())throw new Error("usage: apps agent create --prompt <text> [--team-id <id>]");let c=typeof e.templateRepoUrl=="string"?e.templateRepoUrl:void 0,l=typeof e.templateBranch=="string"?e.templateBranch:void 0,u=typeof e.templateLocalPath=="string"?e.templateLocalPath:void 0,a=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0;if(u&&String(u).trim().length>0)throw new Error("templateLocalPath is not supported; use templateRepoUrl");let d=typeof e.env=="string"?S(e.env,"env"):void 0;if(d){if(typeof d!="object"||Array.isArray(d))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(d))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}let h=c||l||d?{templateRepoUrl:c,templateBranch:l,envVars:d}:void 0,B=typeof e.deployEnvironment=="string"?e.deployEnvironment==="preview"?"preview":"production":void 0,R=e.deployDisabled!==void 0?w(e.deployDisabled):void 0,I=e.streamDeployLogs!==void 0?w(e.streamDeployLogs):!0,E=await C(i,r,{prompt:o.trim(),...a?{teamId:a}:{},...h?{template:h}:{},...B?{deployEnvironment:B}:{},...R!==void 0?{deployDisabled:R}:{},streamDeployLogs:I});if(!E.ok){let b=await E.text().catch(()=>"");throw new Error(`agent create failed: ${E.status} ${b}`)}let N=null,O=null,P=null;await H(E,{onConversationId:p(b=>{N=b},"onConversationId"),onItems:p(b=>{for(let A of b){let U=Q(A);U&&console.log(U);let x=A;!O&&typeof x.appId=="string"&&(O=x.appId),!P&&typeof x.deploymentId=="string"&&(P=x.deploymentId)}},"onItems")}),N&&console.log(`conversation_id: ${N}`),O&&console.log(`app_id: ${O}`),P&&console.log(`deployment_id: ${P}`);try{await J({apiBase:i,apiKey:r,forceRefresh:!0}),await L({apiBase:i,apiKey:r,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}p(de,"runAppsAgentCreate");async function pe(e,s,t,n){let r=await f(),i=m(r),o=await g(r,i),c=y(r),l=typeof e.method=="string"?String(e.method).toUpperCase():void 0,u=l&&["GET","POST","PUT","DELETE"].includes(l)?l:void 0;if(l&&!u)throw new Error("method must be GET, POST, PUT, or DELETE");let a=typeof e.body=="string"?S(String(e.body),"body"):void 0,d=typeof e.headers=="string"?S(String(e.headers),"headers"):void 0,h=typeof e.scheduleId=="string"?String(e.scheduleId):void 0,B=w(e.notifyEmail),R=w(e.summary)||w(e.withSummary),I=await M(c,o,{appId:s,deploymentId:t,toolName:n,scheduleId:h,method:u,body:a,headers:d,notifyEmail:B||void 0});if(console.log(JSON.stringify(I,null,2)),R&&I.ok){let E=await k(c,o,s);console.log(JSON.stringify({summary:E},null,2))}}p(pe,"runAppsToolsExecute");async function ue(e,s){let t=typeof e.env=="string"?e.env:typeof e.vars=="string"?e.vars:typeof e.envVars=="string"?e.envVars:null;if(!t)throw new Error("usage: apps env set <handle>/<repo> --env <json>");let n=S(t,"env");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("env must be a JSON object");let r={};for(let[d,h]of Object.entries(n)){if(typeof h!="string")throw new Error(`env value for ${d} must be a string`);if(!d.startsWith("OPENTOOL_PUBLIC_"))throw new Error("only OPENTOOL_PUBLIC_ env vars can be set");r[d]=h}let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,s),a=await V(c,l,u.id,{envVars:r});console.log(JSON.stringify(a,null,2))}p(ue,"runAppsEnvSet");async function fe(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await _(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(fe,"runAppsEnvGet");async function ge(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o,handle:c,repo:l}=await v(r,i,s),u=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,a=j(u),d=await D(r,i,o.id,{environment:a});console.log(JSON.stringify(d,null,2)),(w(e.watch)||w(e.wait)||w(e.follow))&&await q({baseUrl:r,apiKey:i,deploymentId:d.deploymentId,prefix:`[${c}/${l}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}p(ge,"runAppsDeploy");function X(e){let s={};if(typeof e.params=="string"){let n=S(String(e.params),"params");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("params must be a JSON object");for(let[r,i]of Object.entries(n))i!==void 0&&(s[r]=typeof i=="string"?i:JSON.stringify(i))}let t=p((n,r)=>{r===void 0||r===""||(s[n]=r)},"addParam");if(t("source",typeof e.source=="string"?e.source.trim():void 0),t("symbol",typeof e.symbol=="string"?e.symbol.trim():void 0),t("cursor",typeof e.cursor=="string"?e.cursor.trim():void 0),t("status",typeof e.status=="string"?e.status.trim():void 0),t("backtestRunId",typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():void 0),t("since",T(e.since,"since")),t("until",T(e.until,"until")),typeof e.limit=="string"&&e.limit.trim().length>0){let n=Number.parseInt(e.limit,10);if(!Number.isFinite(n))throw new Error("limit must be a number");t("limit",String(n))}return Object.keys(s).length?s:void 0}p(X,"resolveBacktestEventsParams");async function me(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),{app:o}=await v(i,r,s),c={...X(e)??{},appId:o.id},l=await z(i,r,{method:"GET",query:c});console.log(JSON.stringify(l,null,2))}p(me,"runBacktestEvents");async function ye(e,s){let t=typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():"";if(!t)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");let n=await f(),r=m(n),i=await g(n,r),o=y(n),{app:c}=await v(o,i,s),l=await F(o,i,{appId:c.id,runId:t});console.log(JSON.stringify(l,null,2))}p(ye,"runBacktestGet");export{X as resolveBacktestEventsParams,de as runAppsAgentCreate,le as runAppsAssistant,oe as runAppsCodeVisibility,ge as runAppsDeploy,fe as runAppsEnvGet,ue as runAppsEnvSet,se as runAppsList,ae as runAppsPerformance,ce as runAppsSummary,ie as runAppsTools,pe as runAppsToolsExecute,me as runBacktestEvents,ye as runBacktestGet};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{ga as P,ha as V,ia as M,ma as E,na as q}from"./chunk-EWQZASG4.js";import{kd as T}from"./chunk-6KKQXETR.js";import{b as x}from"./chunk-L3KS6MOV.js";import{q as _,r as A,s as C,x as W}from"./chunk-QUNRWDVO.js";import{k as D,l as L,m as b}from"./chunk-HZP5U2AA.js";import{a as w}from"./chunk-FTQLQJQV.js";import{randomUUID as I}from"node:crypto";import{promises as p}from"node:fs";import{stripTypeScriptTypes as X}from"node:module";import H from"node:path";async function le(e){let r=_.parse(e.overlay),t=A.parse(e.proposal),s=e.validations.map(v=>C.parse(v));if((t.route==="agent"?t.edits.filter(v=>v.target!=="harness.json"&&v.operation!=="delete"):[]).length>0){let v=t.validationPlan.find(o=>o.kind==="component_activation"&&o.required);if(!v)throw new Error("Desktop Work Agent proposals require component-activation validation before review.");if(s.find(o=>o.validationId===v.id)?.status==="passed")throw new Error("Desktop Work cannot accept a passed Agent activation receipt until an Agent source executor exists.")}if(t.overlay.id!==r.id||t.overlay.revision!==r.revision||t.overlay.contentHash!==r.contentHash)throw new Error("Refiner proposal is not bound to the supplied run overlay.");if(r.status!=="frozen")throw new Error("Only a frozen run overlay can advance a Harness workspace.");let n=await e.store.getHarnessWorkspace(t.expectedWorkspace.workspaceId);if(!n)throw new Error(`Harness workspace ${t.expectedWorkspace.workspaceId} does not exist.`);if(n.location!==e.store.harnessStoragePlacement)throw new Error("Refiner workspace does not match the admitted storage placement.");let c=P(e.storeDir,n.id),d=await E({workspaceId:n.id,sourceDir:c.source});if(d.sourceRevision!==n.sourceRevision)throw new Error(`Harness source is ${d.sourceRevision}; workspace expects ${n.sourceRevision}. Record or revert the source change before refinement.`);let h=H.join(c.root,`.source-candidate-${I()}`);await p.cp(c.source,h,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{await K(h,t);let v=await E({workspaceId:n.id,sourceDir:h}),m=(e.now??(()=>new Date().toISOString()))(),o=await q({storeDir:e.storeDir,workspaceId:n.id,compiled:v,createdAt:m});await e.store.saveHarnessReleaseRecord(o),await e.store.saveHarnessImprovementArtifact(n.id,"run_overlay",r),await e.store.saveHarnessImprovementArtifact(n.id,"proposal",t);for(let i of s)await e.store.saveHarnessImprovementArtifact(n.id,"targeted_validation",i);if(!T({workspace:n,proposal:t}).eligible&&!e.reviewAuthority)return e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:n.id,proposal:t,validations:s,nextRelease:{id:o.harnessRelease.id,contentHash:o.harnessRelease.contentHash},nextSourceRevision:o.sourceRevision,now:m});let u=H.join(c.root,`.source-backup-${I()}`),l=H.join(c.root,"source-swap.json");await J(l,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:n.id,expectedWorkspaceRevision:n.revision,previousSourceRevision:n.sourceRevision,nextSourceRevision:o.sourceRevision,backupSource:u,candidateSource:h,createdAt:m}),await p.rename(c.source,u),await p.rename(h,c.source);try{let i=e.reviewAuthority?await e.store.advanceReviewedHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:n.id,proposal:t,validations:s,nextRelease:{id:o.harnessRelease.id,contentHash:o.harnessRelease.contentHash},nextSourceRevision:o.sourceRevision,reviewer:e.reviewAuthority.reviewer,now:m}):await e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:n.id,proposal:t,validations:s,nextRelease:{id:o.harnessRelease.id,contentHash:o.harnessRelease.contentHash},nextSourceRevision:o.sourceRevision,now:m});return i.receipt.decision!=="advanced"?await $(c.source,u):await p.rm(u,{recursive:!0,force:!0}),await p.rm(l,{force:!0}),i}catch(i){throw await $(c.source,u).catch(()=>{}),await p.rm(l,{force:!0}).catch(()=>{}),i}}finally{await p.rm(h,{recursive:!0,force:!0}).catch(()=>{})}}w(le,"applyLocalHarnessRefinerProposal");async function de(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r||r.location!==e.store.harnessStoragePlacement)throw new Error(`Local Harness workspace ${e.workspaceId} does not exist.`);if(r.currentChannel.release?.id!==e.rollbackOf.id||r.currentChannel.release.contentHash!==e.rollbackOf.contentHash)throw new Error("Harness rollback source is no longer the current release.");let t=await e.store.getHarnessReleaseRecord(e.targetRelease.contentHash);if(!t||t.workspaceId!==r.id||t.harnessRelease.id!==e.targetRelease.id)throw new Error("Harness rollback target is unavailable in this workspace.");let s=P(e.storeDir,r.id);if((await E({workspaceId:r.id,sourceDir:s.source})).sourceRevision!==r.sourceRevision)throw new Error("Harness source changed before rollback.");let n=H.join(s.root,`.source-rollback-${I()}`);await p.cp(H.join(t.bundlePath,"source"),n,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{if((await E({workspaceId:r.id,sourceDir:n})).sourceRevision!==t.sourceRevision)throw new Error("Harness rollback bundle does not reproduce its registered source revision.");let d=(e.now??(()=>new Date().toISOString()))(),h=H.join(s.root,`.source-backup-${I()}`),v=H.join(s.root,"source-swap.json");await J(v,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:r.id,expectedWorkspaceRevision:r.revision,previousSourceRevision:r.sourceRevision,nextSourceRevision:t.sourceRevision,backupSource:h,candidateSource:n,createdAt:d}),await p.rename(s.source,h),await p.rename(n,s.source);try{let m=await e.store.rollbackHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:r.id,expectedWorkspaceRevision:r.revision,expectedChannelRevision:r.currentChannel.revision,targetRelease:e.targetRelease,targetSourceRevision:t.sourceRevision,rollbackOf:e.rollbackOf,now:d});return m.receipt.decision!=="rolled_back"?await $(s.source,h):await p.rm(h,{recursive:!0,force:!0}),await p.rm(v,{force:!0}),m}catch(m){throw await $(s.source,h).catch(()=>{}),await p.rm(v,{force:!0}).catch(()=>{}),m}}finally{await p.rm(n,{recursive:!0,force:!0}).catch(()=>{})}}w(de,"rollbackLocalHarnessWorkspaceRelease");async function pe(e){let r=A.parse(e.proposal);if(r.expectedWorkspace.workspaceId!==e.workspace.id)throw new Error("Refiner proposal targets a different Harness workspace.");if(r.route==="memory")return Y({proposal:r,now:e.now});let t=P(e.storeDir,e.workspace.id),s=await E({workspaceId:e.workspace.id,sourceDir:t.source});if(s.sourceRevision!==r.expectedWorkspace.sourceRevision)throw new Error("Refiner proposal source revision no longer matches the Local Harness workspace.");let a=H.join(t.root,`.validation-candidate-${I()}`);await p.cp(t.source,a,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});let n=(e.now??(()=>new Date().toISOString()))();try{await K(a,r);let c=await E({workspaceId:e.workspace.id,sourceDir:a}),d=new Map(c.manifest.files.map(o=>[o.path,o])),h=new Map(r.edits.map(o=>[o.target,o])),v=N(s),m=N(c);return Promise.all(r.validationPlan.map(async o=>{let f="passed",u="The candidate Harness source compiles and preserves its manifest contract.";try{if(o.kind==="observed_recovery"){let l=r.evidence.filter(i=>i.kind==="recovery");if(l.length===0)throw new Error("Observed-recovery validation requires recorded recovery evidence.");u=`Validated ${l.length} immutable recovery evidence reference(s) before candidate advancement.`}else if(o.kind==="prompt"){let l=r.edits.filter(i=>i.route==="prompt"&&i.target!=="harness.json");if(l.length===0)throw new Error("Prompt validation requires an instruction-file edit.");for(let i of l){let g=d.get(i.target);if(i.operation==="delete"){if(g)throw new Error(`Deleted instruction ${i.target} remains declared.`)}else if(g?.kind!=="instruction")throw new Error(`Instruction ${i.target} is not declared in the candidate Harness.`);if(i.content!==null&&/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(i.content))throw new Error(`Instruction ${i.target} appears to contain credential material.`)}u=`Validated ${l.length} textual instruction edit(s) and compiled candidate ${c.harnessRelease.id}.`}else if(o.kind==="skill"){let l=r.edits.filter(i=>i.route==="skill"&&i.target!=="harness.json");if(l.length===0)throw new Error("Skill validation requires a declared Skill-file edit.");for(let i of l){let g=d.get(i.target);if(i.operation==="delete"){if(g)throw new Error(`Deleted Skill ${i.target} remains declared.`);continue}if(g?.kind!=="skill")throw new Error(`Skill ${i.target} is not declared in the candidate Harness.`);let R=h.get(i.target)?.content;if(!R)throw new Error(`Skill edit ${i.target} has no content.`);let k=x(R);if(!k.name||!k.description||k.messages.length>0)throw new Error(`Skill ${i.target} is invalid: ${k.messages.join(" ")}`)}u=`Validated ${l.length} Skill edit(s), Skill frontmatter, and compiled candidate ${c.harnessRelease.id}.`}else if(o.kind==="dependency"){let l=c.manifest.files.find(i=>i.kind==="dependency_lock");if(!l)throw new Error("Candidate Harness has no dependency lock.");JSON.parse(await p.readFile(z(a,l.path),"utf8")),u=`Validated dependency lock ${l.path} and compiled candidate ${c.harnessRelease.id}.`}else if(o.kind==="schema")A.parse(r),u=`Validated proposal, manifest, and candidate release schemas for ${c.harnessRelease.id}.`;else if(o.kind==="package"){let l=r.edits.filter(i=>i.route==="agent"&&i.operation!=="delete"&&i.target!=="harness.json");for(let i of l){if(!i.content)throw new Error(`Agent edit ${i.target} has no source.`);X(i.content,{mode:"transform",sourceUrl:i.target,sourceMap:!1})}u=l.length>0?`Syntax-checked ${l.length} Agent source edit(s) and compiled candidate ${c.harnessRelease.id}.`:`Compiled candidate package ${c.harnessRelease.id} and preserved the Harness source manifest contract.`}else if(o.kind==="component_activation"){let l=r.edits.filter(i=>i.target!=="harness.json");if(l.length===0)throw new Error("Component activation requires a concrete Harness component edit.");if(r.route==="agent"){if(l.filter(g=>g.operation!=="delete").length>0)throw new Error("Desktop Work does not compile or execute released Agent source; use an active instruction or standalone Skill, or add an Agent executor before release.");u=`Confirmed ${l.length} deleted Agent component(s) were inactive in Desktop Work.`}else{if(!["prompt","skill"].includes(r.route))throw new Error(`Desktop Work has no activation policy for ${r.route} proposals.`);let i=r.route==="prompt"?"instruction":"skill";for(let g of l){let R=m.components.find(k=>k.path===g.target&&k.kind===i);if(g.operation==="delete"?R:!R)throw new Error(`${i} ${g.target} is not reflected in the candidate Desktop Work runtime surface.`)}if(v.contentHash===m.contentHash)throw new Error("The candidate does not change the effective Desktop Work runtime surface.");u=`Activated ${l.length} ${i} edit(s) in the candidate Desktop Work runtime surface.`}}else o.kind==="business_formula"?(f="blocked",u="Business or financial logic is retained for review until an approved deterministic fixture supplies inputs and expected outputs."):o.kind==="targeted_evaluation"?(f="blocked",u="This sensitive change requires an explicit authority-preserving targeted Evaluation before release."):o.kind==="file_render"?(f="blocked",u="File-render validation requires an exact produced artifact reference; no artifact was attached to this Harness-source proposal."):(f="blocked",u=`Local targeted validation does not yet own ${o.kind}; it requires its dedicated validator.`)}catch(l){f="failed",u=l instanceof Error?l.message:String(l)}return W({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${o.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:o.id,kind:o.kind,status:f,summary:u,evidenceRefs:r.evidence,createdAt:n,metadata:{candidateHarnessRelease:{id:c.harnessRelease.id,contentHash:c.harnessRelease.contentHash},sourceRevision:c.sourceRevision,...o.kind==="component_activation"?{targetRuntime:"desktop_work",beforeEffectiveRuntimeHash:v.contentHash,afterEffectiveRuntimeHash:m.contentHash,activatedComponentRefs:m.components,inactiveAgentRefs:m.inactiveAgents}:{}}})}))}catch(c){let d=c instanceof Error?c.message:String(c);return r.validationPlan.map(h=>W({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${h.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:h.id,kind:h.kind,status:"failed",summary:d,evidenceRefs:r.evidence,createdAt:n,metadata:{}}))}finally{await p.rm(a,{recursive:!0,force:!0}).catch(()=>{})}}w(pe,"validateLocalHarnessRefinerProposal");function N(e){let r=[...e.agentSnapshot.instructions.map(s=>({kind:"instruction",path:s.path,contentHash:s.contentHash})),...e.agentSnapshot.skills.map(s=>({kind:"skill",path:s.path,contentHash:s.contentHash}))].sort((s,a)=>s.path.localeCompare(a.path)),t=e.agentSnapshot.agents.map(s=>({path:s.path,contentHash:s.contentHash})).sort((s,a)=>s.path.localeCompare(a.path));return{contentHash:L({schemaVersion:"openpond.desktopWorkHarnessSurface.v1",components:r}),components:r,inactiveAgents:t}}w(N,"desktopWorkRuntimeSurface");function Y(e){let r=(e.now??(()=>new Date().toISOString()))(),t=e.proposal.edits.find(s=>s.route==="memory");return e.proposal.validationPlan.map(s=>{let a="passed",n="Memory candidate is bounded, scoped, and contains no obvious credential material.";try{if(s.kind==="observed_recovery"){if(!e.proposal.evidence.some(c=>c.kind==="recovery"))throw new Error("Observed-recovery validation requires recorded recovery evidence.");n="Memory proposal is grounded in immutable recovery evidence."}else if(s.kind==="memory"){if(!t||!/^memory\/[a-z0-9][a-z0-9-]{0,119}$/.test(t.target))throw new Error("Memory proposal requires one safe memory/<slug> target.");let c=e.proposal.metadata.expectedMemory;if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Memory proposal requires an expected revision snapshot.");let d=c;if(d.key!==Z(t.target))throw new Error("Memory proposal expected revision targets a different key.");if(d.revision!==null&&(!Number.isInteger(d.revision)||Number(d.revision)<1))throw new Error("Memory proposal expected revision is invalid.");if(d.contentHash!==null&&typeof d.contentHash!="string")throw new Error("Memory proposal expected content hash is invalid.");if(d.status!==null&&d.status!=="active"&&d.status!=="deleted")throw new Error("Memory proposal expected status is invalid.");if(d.revision===null&&(d.contentHash!==null||d.status!==null))throw new Error("New memory snapshot must not claim existing content or status.");if(d.revision!==null&&(typeof d.contentHash!="string"||d.status===null))throw new Error("Existing memory snapshot requires its content hash and status.");if(t.operation==="delete"&&d.status!=="active")throw new Error("Memory deletion requires an active expected revision.");if(t.operation!=="delete"){if(!t.content?.trim()||t.content.length>24e3)throw new Error("Memory content must contain 1-24,000 characters.");if(/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(t.content))throw new Error("Memory content appears to contain credential material.")}}else a="blocked",n=`Memory validation cannot satisfy ${s.kind}.`}catch(c){a="failed",n=c instanceof Error?c.message:String(c)}return W({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${e.proposal.id}-${s.id}`,proposal:{id:e.proposal.id,contentHash:e.proposal.contentHash},validationId:s.id,kind:s.kind,status:a,summary:n,evidenceRefs:e.proposal.evidence,createdAt:r,metadata:{externalState:"harness_memory"}})})}w(Y,"validateMemoryProposal");function Z(e){let r=e.replaceAll("\\","/"),t=/^memory\/([a-z0-9][a-z0-9-]{0,119})$/.exec(r);if(!t)throw new Error(`Invalid Harness memory target: ${e}.`);return t[1]}w(Z,"memoryKeyFromTarget");async function F(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r)throw new Error(`Harness workspace ${e.workspaceId} does not exist.`);let t=P(e.storeDir,r.id),s=H.join(t.root,"source-swap.json"),a=await p.readFile(s,"utf8").then(JSON.parse).catch(d=>{if(d.code==="ENOENT")return null;throw d});if(!a)return"none";let n=await E({workspaceId:r.id,sourceDir:t.source});if(r.sourceRevision===a.nextSourceRevision&&n.sourceRevision===a.nextSourceRevision)return await p.rm(a.backupSource,{recursive:!0,force:!0}),await p.rm(s,{force:!0}),"completed";let c=await E({workspaceId:r.id,sourceDir:a.backupSource});if(r.sourceRevision===a.previousSourceRevision&&c.sourceRevision===a.previousSourceRevision)return await $(t.source,a.backupSource),await p.rm(s,{force:!0}),"restored";throw new Error("Harness source-swap recovery cannot reconcile filesystem and workspace revisions.")}w(F,"recoverLocalHarnessSourceSwap");async function K(e,r){for(let t of r.edits){let s=z(e,t.target);if(t.operation==="delete"){await p.rm(s,{force:!1});continue}if(t.content===null)throw new Error(`Refiner edit ${t.id} has no content.`);if(t.operation==="create")await p.mkdir(H.dirname(s),{recursive:!0}),await p.writeFile(s,t.content,{flag:"wx"});else{let a=await p.lstat(s);if(!a.isFile()||a.isSymbolicLink())throw new Error(`Refiner update target must be a regular file: ${t.target}`);await p.writeFile(s,t.content,{flag:"w"})}}}w(K,"applyOverlayEdits");function z(e,r){let t=H.resolve(e),s=H.resolve(t,...r.replaceAll("\\","/").split("/")),a=H.relative(t,s);if(!a||a.startsWith("..")||H.isAbsolute(a))throw new Error(`Refiner edit target escapes the Harness source: ${r}`);return s}w(z,"containedPath");async function J(e,r){let t=`${e}.${I()}.tmp`;await p.writeFile(t,`${JSON.stringify(r,null,2)}
|
|
3
|
-
`,{flag:"wx"}),await p.rename(t,e)}w(J,"writeSwapJournal");async function $(e,r){await p.rm(e,{recursive:!0,force:!0}),await p.rename(r,e)}w($,"restoreSource");var y="desktop-personal",U="personal-default";async function ve(e){let r=await e.store.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:y});if(r&&r.metadata.selectionEligible!==!1)return await F({store:e.store,storeDir:e.storeDir,workspaceId:r.id}),O(e.store,r.id,r.currentChannel.release?.contentHash??null);let t=(await e.store.listHarnessWorkspaces({ownerKind:"personal",ownerId:y})).find(n=>n.metadata.selectionEligible!==!1);if(t)return await e.store.selectHarnessWorkspace({ownerKind:"personal",ownerId:y,workspaceId:t.id,updatedAt:(e.now??(()=>new Date().toISOString()))()}),O(e.store,t.id,t.currentChannel.release?.contentHash??null);let
|
|
4
|
-
`)).filter(
|
|
2
|
+
import{ia as P,ja as V,ka as M,oa as E,pa as q}from"./chunk-U6SFIFDM.js";import{b as x}from"./chunk-L3KS6MOV.js";import{kd as T}from"./chunk-6QUICEQA.js";import{q as _,r as A,s as C,x as W}from"./chunk-5ZFEQLRI.js";import{k as D,l as L,m as b}from"./chunk-HZP5U2AA.js";import{a as w}from"./chunk-FTQLQJQV.js";import{randomUUID as I}from"node:crypto";import{promises as p}from"node:fs";import{stripTypeScriptTypes as X}from"node:module";import R from"node:path";async function le(e){let r=_.parse(e.overlay),t=A.parse(e.proposal),o=e.validations.map(v=>C.parse(v));if((t.route==="agent"?t.edits.filter(v=>v.target!=="harness.json"&&v.operation!=="delete"):[]).length>0){let v=t.validationPlan.find(s=>s.kind==="component_activation"&&s.required);if(!v)throw new Error("Desktop Work Agent proposals require component-activation validation before review.");if(o.find(s=>s.validationId===v.id)?.status==="passed")throw new Error("Desktop Work cannot accept a passed Agent activation receipt until an Agent source executor exists.")}if(t.overlay.id!==r.id||t.overlay.revision!==r.revision||t.overlay.contentHash!==r.contentHash)throw new Error("Refiner proposal is not bound to the supplied run overlay.");if(r.status!=="frozen")throw new Error("Only a frozen run overlay can advance a Harness workspace.");let n=await e.store.getHarnessWorkspace(t.expectedWorkspace.workspaceId);if(!n)throw new Error(`Harness workspace ${t.expectedWorkspace.workspaceId} does not exist.`);if(n.location!==e.store.harnessStoragePlacement)throw new Error("Refiner workspace does not match the admitted storage placement.");let c=P(e.storeDir,n.id),d=await E({workspaceId:n.id,sourceDir:c.source});if(d.sourceRevision!==n.sourceRevision)throw new Error(`Harness source is ${d.sourceRevision}; workspace expects ${n.sourceRevision}. Record or revert the source change before refinement.`);let h=R.join(c.root,`.source-candidate-${I()}`);await p.cp(c.source,h,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{await K(h,t);let v=await E({workspaceId:n.id,sourceDir:h}),m=(e.now??(()=>new Date().toISOString()))(),s=await q({storeDir:e.storeDir,workspaceId:n.id,compiled:v,createdAt:m});await e.store.saveHarnessReleaseRecord(s),await e.store.saveHarnessImprovementArtifact(n.id,"run_overlay",r),await e.store.saveHarnessImprovementArtifact(n.id,"proposal",t);for(let i of o)await e.store.saveHarnessImprovementArtifact(n.id,"targeted_validation",i);if(!T({workspace:n,proposal:t}).eligible&&!e.reviewAuthority)return e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:n.id,proposal:t,validations:o,nextRelease:{id:s.harnessRelease.id,contentHash:s.harnessRelease.contentHash},nextSourceRevision:s.sourceRevision,now:m});let u=R.join(c.root,`.source-backup-${I()}`),l=R.join(c.root,"source-swap.json");await J(l,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:n.id,expectedWorkspaceRevision:n.revision,previousSourceRevision:n.sourceRevision,nextSourceRevision:s.sourceRevision,backupSource:u,candidateSource:h,createdAt:m}),await p.rename(c.source,u),await p.rename(h,c.source);try{let i=e.reviewAuthority?await e.store.advanceReviewedHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:n.id,proposal:t,validations:o,nextRelease:{id:s.harnessRelease.id,contentHash:s.harnessRelease.contentHash},nextSourceRevision:s.sourceRevision,reviewer:e.reviewAuthority.reviewer,now:m}):await e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:n.id,proposal:t,validations:o,nextRelease:{id:s.harnessRelease.id,contentHash:s.harnessRelease.contentHash},nextSourceRevision:s.sourceRevision,now:m});return i.receipt.decision!=="advanced"?await $(c.source,u):await p.rm(u,{recursive:!0,force:!0}),await p.rm(l,{force:!0}),i}catch(i){throw await $(c.source,u).catch(()=>{}),await p.rm(l,{force:!0}).catch(()=>{}),i}}finally{await p.rm(h,{recursive:!0,force:!0}).catch(()=>{})}}w(le,"applyLocalHarnessRefinerProposal");async function de(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r||r.location!==e.store.harnessStoragePlacement)throw new Error(`Local Harness workspace ${e.workspaceId} does not exist.`);if(r.currentChannel.release?.id!==e.rollbackOf.id||r.currentChannel.release.contentHash!==e.rollbackOf.contentHash)throw new Error("Harness rollback source is no longer the current release.");let t=await e.store.getHarnessReleaseRecord(e.targetRelease.contentHash);if(!t||t.workspaceId!==r.id||t.harnessRelease.id!==e.targetRelease.id)throw new Error("Harness rollback target is unavailable in this workspace.");let o=P(e.storeDir,r.id);if((await E({workspaceId:r.id,sourceDir:o.source})).sourceRevision!==r.sourceRevision)throw new Error("Harness source changed before rollback.");let n=R.join(o.root,`.source-rollback-${I()}`);await p.cp(R.join(t.bundlePath,"source"),n,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{if((await E({workspaceId:r.id,sourceDir:n})).sourceRevision!==t.sourceRevision)throw new Error("Harness rollback bundle does not reproduce its registered source revision.");let d=(e.now??(()=>new Date().toISOString()))(),h=R.join(o.root,`.source-backup-${I()}`),v=R.join(o.root,"source-swap.json");await J(v,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:r.id,expectedWorkspaceRevision:r.revision,previousSourceRevision:r.sourceRevision,nextSourceRevision:t.sourceRevision,backupSource:h,candidateSource:n,createdAt:d}),await p.rename(o.source,h),await p.rename(n,o.source);try{let m=await e.store.rollbackHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:r.id,expectedWorkspaceRevision:r.revision,expectedChannelRevision:r.currentChannel.revision,targetRelease:e.targetRelease,targetSourceRevision:t.sourceRevision,rollbackOf:e.rollbackOf,now:d});return m.receipt.decision!=="rolled_back"?await $(o.source,h):await p.rm(h,{recursive:!0,force:!0}),await p.rm(v,{force:!0}),m}catch(m){throw await $(o.source,h).catch(()=>{}),await p.rm(v,{force:!0}).catch(()=>{}),m}}finally{await p.rm(n,{recursive:!0,force:!0}).catch(()=>{})}}w(de,"rollbackLocalHarnessWorkspaceRelease");async function pe(e){let r=A.parse(e.proposal);if(r.expectedWorkspace.workspaceId!==e.workspace.id)throw new Error("Refiner proposal targets a different Harness workspace.");if(r.route==="memory")return Y({proposal:r,now:e.now});let t=P(e.storeDir,e.workspace.id),o=await E({workspaceId:e.workspace.id,sourceDir:t.source});if(o.sourceRevision!==r.expectedWorkspace.sourceRevision)throw new Error("Refiner proposal source revision no longer matches the Local Harness workspace.");let a=R.join(t.root,`.validation-candidate-${I()}`);await p.cp(t.source,a,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});let n=(e.now??(()=>new Date().toISOString()))();try{await K(a,r);let c=await E({workspaceId:e.workspace.id,sourceDir:a}),d=new Map(c.manifest.files.map(s=>[s.path,s])),h=new Map(r.edits.map(s=>[s.target,s])),v=N(o),m=N(c);return Promise.all(r.validationPlan.map(async s=>{let f="passed",u="The candidate Harness source compiles and preserves its manifest contract.";try{if(s.kind==="observed_recovery"){let l=r.evidence.filter(i=>i.kind==="recovery");if(l.length===0)throw new Error("Observed-recovery validation requires recorded recovery evidence.");u=`Validated ${l.length} immutable recovery evidence reference(s) before candidate advancement.`}else if(s.kind==="prompt"){let l=r.edits.filter(i=>i.route==="prompt"&&i.target!=="harness.json");if(l.length===0)throw new Error("Prompt validation requires an instruction-file edit.");for(let i of l){let g=d.get(i.target);if(i.operation==="delete"){if(g)throw new Error(`Deleted instruction ${i.target} remains declared.`)}else if(g?.kind!=="instruction")throw new Error(`Instruction ${i.target} is not declared in the candidate Harness.`);if(i.content!==null&&/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(i.content))throw new Error(`Instruction ${i.target} appears to contain credential material.`)}u=`Validated ${l.length} textual instruction edit(s) and compiled candidate ${c.harnessRelease.id}.`}else if(s.kind==="skill"){let l=r.edits.filter(i=>i.route==="skill"&&i.target!=="harness.json");if(l.length===0)throw new Error("Skill validation requires a declared Skill-file edit.");for(let i of l){let g=d.get(i.target);if(i.operation==="delete"){if(g)throw new Error(`Deleted Skill ${i.target} remains declared.`);continue}if(g?.kind!=="skill")throw new Error(`Skill ${i.target} is not declared in the candidate Harness.`);let k=h.get(i.target)?.content;if(!k)throw new Error(`Skill edit ${i.target} has no content.`);let H=x(k);if(!H.name||!H.description||H.messages.length>0)throw new Error(`Skill ${i.target} is invalid: ${H.messages.join(" ")}`)}u=`Validated ${l.length} Skill edit(s), Skill frontmatter, and compiled candidate ${c.harnessRelease.id}.`}else if(s.kind==="dependency"){let l=c.manifest.files.find(i=>i.kind==="dependency_lock");if(!l)throw new Error("Candidate Harness has no dependency lock.");JSON.parse(await p.readFile(z(a,l.path),"utf8")),u=`Validated dependency lock ${l.path} and compiled candidate ${c.harnessRelease.id}.`}else if(s.kind==="schema")A.parse(r),u=`Validated proposal, manifest, and candidate release schemas for ${c.harnessRelease.id}.`;else if(s.kind==="package"){let l=r.edits.filter(i=>i.route==="agent"&&i.operation!=="delete"&&i.target!=="harness.json");for(let i of l){if(!i.content)throw new Error(`Agent edit ${i.target} has no source.`);X(i.content,{mode:"transform",sourceUrl:i.target,sourceMap:!1})}u=l.length>0?`Syntax-checked ${l.length} Agent source edit(s) and compiled candidate ${c.harnessRelease.id}.`:`Compiled candidate package ${c.harnessRelease.id} and preserved the Harness source manifest contract.`}else if(s.kind==="component_activation"){let l=r.edits.filter(i=>i.target!=="harness.json");if(l.length===0)throw new Error("Component activation requires a concrete Harness component edit.");if(r.route==="agent"){if(l.filter(g=>g.operation!=="delete").length>0)throw new Error("Desktop Work does not compile or execute released Agent source; use an active instruction or standalone Skill, or add an Agent executor before release.");u=`Confirmed ${l.length} deleted Agent component(s) were inactive in Desktop Work.`}else{if(!["prompt","skill"].includes(r.route))throw new Error(`Desktop Work has no activation policy for ${r.route} proposals.`);let i=r.route==="prompt"?"instruction":"skill";for(let g of l){let k=m.components.find(H=>H.path===g.target&&H.kind===i);if(g.operation==="delete"?k:!k)throw new Error(`${i} ${g.target} is not reflected in the candidate Desktop Work runtime surface.`)}if(v.contentHash===m.contentHash)throw new Error("The candidate does not change the effective Desktop Work runtime surface.");u=`Activated ${l.length} ${i} edit(s) in the candidate Desktop Work runtime surface.`}}else s.kind==="business_formula"?(f="blocked",u="Business or financial logic is retained for review until an approved deterministic fixture supplies inputs and expected outputs."):s.kind==="targeted_evaluation"?(f="blocked",u="This sensitive change requires an explicit authority-preserving targeted Evaluation before release."):s.kind==="file_render"?(f="blocked",u="File-render validation requires an exact produced artifact reference; no artifact was attached to this Harness-source proposal."):(f="blocked",u=`Local targeted validation does not yet own ${s.kind}; it requires its dedicated validator.`)}catch(l){f="failed",u=l instanceof Error?l.message:String(l)}return W({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${s.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:s.id,kind:s.kind,status:f,summary:u,evidenceRefs:r.evidence,createdAt:n,metadata:{candidateHarnessRelease:{id:c.harnessRelease.id,contentHash:c.harnessRelease.contentHash},sourceRevision:c.sourceRevision,...s.kind==="component_activation"?{targetRuntime:"desktop_work",beforeEffectiveRuntimeHash:v.contentHash,afterEffectiveRuntimeHash:m.contentHash,activatedComponentRefs:m.components,inactiveAgentRefs:m.inactiveAgents}:{}}})}))}catch(c){let d=c instanceof Error?c.message:String(c);return r.validationPlan.map(h=>W({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${h.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:h.id,kind:h.kind,status:"failed",summary:d,evidenceRefs:r.evidence,createdAt:n,metadata:{}}))}finally{await p.rm(a,{recursive:!0,force:!0}).catch(()=>{})}}w(pe,"validateLocalHarnessRefinerProposal");function N(e){let r=[...e.agentSnapshot.instructions.map(o=>({kind:"instruction",path:o.path,contentHash:o.contentHash})),...e.agentSnapshot.skills.map(o=>({kind:"skill",path:o.path,contentHash:o.contentHash}))].sort((o,a)=>o.path.localeCompare(a.path)),t=e.agentSnapshot.agents.map(o=>({path:o.path,contentHash:o.contentHash})).sort((o,a)=>o.path.localeCompare(a.path));return{contentHash:L({schemaVersion:"openpond.desktopWorkHarnessSurface.v1",components:r}),components:r,inactiveAgents:t}}w(N,"desktopWorkRuntimeSurface");function Y(e){let r=(e.now??(()=>new Date().toISOString()))(),t=e.proposal.edits.find(o=>o.route==="memory");return e.proposal.validationPlan.map(o=>{let a="passed",n="Memory candidate is bounded, scoped, and contains no obvious credential material.";try{if(o.kind==="observed_recovery"){if(!e.proposal.evidence.some(c=>c.kind==="recovery"))throw new Error("Observed-recovery validation requires recorded recovery evidence.");n="Memory proposal is grounded in immutable recovery evidence."}else if(o.kind==="memory"){if(!t||!/^memory\/[a-z0-9][a-z0-9-]{0,119}$/.test(t.target))throw new Error("Memory proposal requires one safe memory/<slug> target.");let c=e.proposal.metadata.expectedMemory;if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Memory proposal requires an expected revision snapshot.");let d=c;if(d.key!==Z(t.target))throw new Error("Memory proposal expected revision targets a different key.");if(d.revision!==null&&(!Number.isInteger(d.revision)||Number(d.revision)<1))throw new Error("Memory proposal expected revision is invalid.");if(d.contentHash!==null&&typeof d.contentHash!="string")throw new Error("Memory proposal expected content hash is invalid.");if(d.status!==null&&d.status!=="active"&&d.status!=="deleted")throw new Error("Memory proposal expected status is invalid.");if(d.revision===null&&(d.contentHash!==null||d.status!==null))throw new Error("New memory snapshot must not claim existing content or status.");if(d.revision!==null&&(typeof d.contentHash!="string"||d.status===null))throw new Error("Existing memory snapshot requires its content hash and status.");if(t.operation==="delete"&&d.status!=="active")throw new Error("Memory deletion requires an active expected revision.");if(t.operation!=="delete"){if(!t.content?.trim()||t.content.length>24e3)throw new Error("Memory content must contain 1-24,000 characters.");if(/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(t.content))throw new Error("Memory content appears to contain credential material.")}}else a="blocked",n=`Memory validation cannot satisfy ${o.kind}.`}catch(c){a="failed",n=c instanceof Error?c.message:String(c)}return W({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${e.proposal.id}-${o.id}`,proposal:{id:e.proposal.id,contentHash:e.proposal.contentHash},validationId:o.id,kind:o.kind,status:a,summary:n,evidenceRefs:e.proposal.evidence,createdAt:r,metadata:{externalState:"harness_memory"}})})}w(Y,"validateMemoryProposal");function Z(e){let r=e.replaceAll("\\","/"),t=/^memory\/([a-z0-9][a-z0-9-]{0,119})$/.exec(r);if(!t)throw new Error(`Invalid Harness memory target: ${e}.`);return t[1]}w(Z,"memoryKeyFromTarget");async function F(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r)throw new Error(`Harness workspace ${e.workspaceId} does not exist.`);let t=P(e.storeDir,r.id),o=R.join(t.root,"source-swap.json"),a=await p.readFile(o,"utf8").then(JSON.parse).catch(d=>{if(d.code==="ENOENT")return null;throw d});if(!a)return"none";let n=await E({workspaceId:r.id,sourceDir:t.source});if(r.sourceRevision===a.nextSourceRevision&&n.sourceRevision===a.nextSourceRevision)return await p.rm(a.backupSource,{recursive:!0,force:!0}),await p.rm(o,{force:!0}),"completed";let c=await E({workspaceId:r.id,sourceDir:a.backupSource});if(r.sourceRevision===a.previousSourceRevision&&c.sourceRevision===a.previousSourceRevision)return await $(t.source,a.backupSource),await p.rm(o,{force:!0}),"restored";throw new Error("Harness source-swap recovery cannot reconcile filesystem and workspace revisions.")}w(F,"recoverLocalHarnessSourceSwap");async function K(e,r){for(let t of r.edits){let o=z(e,t.target);if(t.operation==="delete"){await p.rm(o,{force:!1});continue}if(t.content===null)throw new Error(`Refiner edit ${t.id} has no content.`);if(t.operation==="create")await p.mkdir(R.dirname(o),{recursive:!0}),await p.writeFile(o,t.content,{flag:"wx"});else{let a=await p.lstat(o);if(!a.isFile()||a.isSymbolicLink())throw new Error(`Refiner update target must be a regular file: ${t.target}`);await p.writeFile(o,t.content,{flag:"w"})}}}w(K,"applyOverlayEdits");function z(e,r){let t=R.resolve(e),o=R.resolve(t,...r.replaceAll("\\","/").split("/")),a=R.relative(t,o);if(!a||a.startsWith("..")||R.isAbsolute(a))throw new Error(`Refiner edit target escapes the Harness source: ${r}`);return o}w(z,"containedPath");async function J(e,r){let t=`${e}.${I()}.tmp`;await p.writeFile(t,`${JSON.stringify(r,null,2)}
|
|
3
|
+
`,{flag:"wx"}),await p.rename(t,e)}w(J,"writeSwapJournal");async function $(e,r){await p.rm(e,{recursive:!0,force:!0}),await p.rename(r,e)}w($,"restoreSource");var y="desktop-personal",U="personal-default";async function ve(e){let r=await e.store.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:y});if(r&&r.metadata.selectionEligible!==!1)return await F({store:e.store,storeDir:e.storeDir,workspaceId:r.id}),O(e.store,r.id,r.currentChannel.release?.contentHash??null);let t=(await e.store.listHarnessWorkspaces({ownerKind:"personal",ownerId:y})).find(n=>n.metadata.selectionEligible!==!1);if(t)return await e.store.selectHarnessWorkspace({ownerKind:"personal",ownerId:y,workspaceId:t.id,updatedAt:(e.now??(()=>new Date().toISOString()))()}),O(e.store,t.id,t.currentChannel.release?.contentHash??null);let o=await e.loadProfileState(),a=o.mode==="local"&&o.sourcePath&&!o.error?await M({store:e.store,storeDir:e.storeDir,id:U,ownerId:y,name:o.activeProfile?.trim()||"Personal Harness",profile:o,now:e.now}):await V({store:e.store,storeDir:e.storeDir,id:U,ownerId:y,name:"Personal Harness",now:e.now});return await e.store.selectHarnessWorkspace({ownerKind:"personal",ownerId:y,workspaceId:a.workspace.id,updatedAt:(e.now??(()=>new Date().toISOString()))()}),a.release}w(ve,"ensureSelectedLocalHarnessWorkspace");async function B(e){let r=await e.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:y});return r?O(e,r.id,r.currentChannel.release?.contentHash??null):null}w(B,"resolveSelectedLocalHarnessRelease");async function O(e,r,t){if(!t)throw new Error(`Selected Harness workspace ${r} has no current release.`);let o=await e.getHarnessReleaseRecord(t);if(!o||o.workspaceId!==r)throw new Error(`Selected Harness workspace ${r} points to a missing release ${t}.`);return b(o.agentSnapshot,"Selected Agent snapshot"),b(o.harnessRelease,"Selected Harness release"),o}w(O,"requireCurrentRelease");import{promises as Q}from"node:fs";import S from"node:path";async function be(e,r){if(r){let a=await e.getHarnessReleaseRecord(r.contentHash);if(!a||a.harnessRelease.id!==r.id)throw new Error("The selected immutable Harness release is unavailable.");let n=await e.getHarnessWorkspace(a.workspaceId);if(!n||n.ownerScope.kind!=="personal"||n.ownerScope.id!==y)throw new Error("The selected Harness release is not available to this local owner.");return b(a.agentSnapshot,"Selected Agent snapshot"),b(a.harnessRelease,"Selected Harness release"),G({workspace:n,release:a})}let t=await B(e);if(!t)return null;let o=await e.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:y});if(!o||o.id!==t.workspaceId)throw new Error("Selected Harness workspace changed while its release was being admitted.");return G({workspace:o,release:t})}w(be,"loadSelectedLocalHarnessRuntime");async function G(e){let{workspace:r,release:t}=e;if(t.workspaceId!==r.id)throw new Error("Harness release does not belong to the requested workspace.");let o=S.join(t.bundlePath,"source");await Promise.all(t.harnessRelease.files.map(s=>ee(o,s.path,s.contentHash)));let a=await Promise.all(t.agentSnapshot.instructions.map(async s=>({path:s.path,content:await j(o,s.path,s.contentHash)}))),n=[],c=new Map;for(let s of t.agentSnapshot.skills){let f=await j(o,s.path,s.contentHash),u=x(f);if(!u.name||!u.description||u.messages.length>0)throw new Error(`Released Harness Skill ${s.path} is invalid: ${u.messages.join(" ")||"missing name or description"}`);if(c.has(u.name))throw new Error(`Released Harness has duplicate Skill ${u.name}.`);let l=`${S.posix.dirname(s.path)}/`,i=t.harnessRelease.files.filter(k=>k.visibility==="policy"&&k.path.startsWith(l)&&k.path!==s.path).map(k=>k.path.slice(l.length)).sort(),g={name:u.name,description:u.description,path:s.path,scope:"profile",enabled:!0,sourcePath:o,charCount:f.length,sourceHash:s.contentHash,validationStatus:"valid",validationMessages:[],resourceFiles:i};n.push(g),c.set(g.name,async()=>{let k=await j(o,s.path,s.contentHash),H=x(k);if(!H.name||!H.description||H.messages.length>0)throw new Error(`Released Harness Skill ${s.path} failed validation while loading.`);return{name:H.name,description:H.description,body:H.body,path:s.path,sourceHash:s.contentHash,charCount:k.length,packagePath:S.join(o,...S.posix.dirname(s.path).split("/")),resourceFiles:i}})}n.sort((s,f)=>s.name.localeCompare(f.name));let d={profileSourcePath:o,skills:n,readSkill:c.size>0?async s=>{let f=c.get(s);if(!f)throw new Error(`Released Harness Skill not found: ${s}`);return f()}:null},h=a.sort((s,f)=>s.path.localeCompare(f.path)).map(({path:s,content:f})=>[`Active Harness instruction (${s}):`,f.trim()].join(`
|
|
4
|
+
`)).filter(s=>s.trim().length>0),m=[["Harness capability receipt:",JSON.stringify({harnessRelease:{id:t.harnessRelease.id,contentHash:t.harnessRelease.contentHash},agentSnapshot:{id:t.agentSnapshot.id,contentHash:t.agentSnapshot.contentHash},files:t.harnessRelease.files.filter(s=>s.visibility==="policy").map(s=>({path:s.path,contentHash:s.contentHash})),skills:t.agentSnapshot.skills.map(s=>s.path),agents:t.agentSnapshot.agents.map(s=>s.path),tools:t.agentSnapshot.toolDeclarations.map(s=>s.name),capabilityRequirements:t.agentSnapshot.capabilityRequirements})].join(`
|
|
5
5
|
`),h.length>0?["Active Harness preflight:","Apply the following released instructions when planning work and immediately before every tool call.","Preflight each call: (1) identify any active instruction that matches the planned operation, (2) inspect the exact tool arguments for a forbidden pattern, and (3) rewrite the call before sending it when a pattern matches. Compliance is required even when the prohibited call might still succeed.",...h].join(`
|
|
6
6
|
|
|
7
|
-
`):null].filter(
|
|
7
|
+
`):null].filter(s=>!!s?.trim()).join(`
|
|
8
8
|
|
|
9
|
-
`);return{workspace:r,release:t,instructionContext:m,skillRuntime:d}}w(G,"loadLocalHarnessRuntimeFromRelease");async function j(e,r,t){let
|
|
9
|
+
`);return{workspace:r,release:t,instructionContext:m,skillRuntime:d}}w(G,"loadLocalHarnessRuntimeFromRelease");async function j(e,r,t){let o=S.resolve(e,...r.split("/")),a=S.relative(S.resolve(e),o);if(!a||a.startsWith("..")||S.isAbsolute(a))throw new Error(`Released Harness asset escapes its bundle: ${r}`);let n=await Q.readFile(o),c=D(n);if(c!==t)throw new Error(`Released Harness asset ${r} is ${c}; expected ${t}.`);return new TextDecoder("utf-8",{fatal:!0}).decode(n)}w(j,"readVerifiedAsset");async function ee(e,r,t){let o=S.resolve(e,...r.split("/")),a=S.relative(S.resolve(e),o);if(!a||a.startsWith("..")||S.isAbsolute(a))throw new Error(`Released Harness asset escapes its bundle: ${r}`);let n=D(await Q.readFile(o));if(n!==t)throw new Error(`Released Harness asset ${r} is ${n}; expected ${t}.`)}w(ee,"verifyAsset");export{le as a,de as b,pe as c,y as d,ve as e,B as f,be as g,G as h};
|