openpond 0.2.0 → 0.2.2
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/chunks/actions-command-F55CBR2K.js +2 -0
- package/dist/chunks/app-layer-GNYLOBCX.js +3 -0
- package/dist/chunks/app-server-runtime-VAGY4LQS.js +2 -0
- package/dist/chunks/apps-HZ5JGBDR.js +2 -0
- package/dist/chunks/chunk-22UARBPW.js +3 -0
- package/dist/chunks/chunk-3A7HZJNE.js +1 -0
- package/dist/chunks/chunk-3M53YXEI.js +2 -0
- package/dist/chunks/chunk-3NDRIQTI.js +2 -0
- package/dist/chunks/chunk-6FA3GG5B.js +33 -0
- package/dist/chunks/chunk-6MI4KKWF.js +2 -0
- package/dist/chunks/chunk-7D2LMRP7.js +2 -0
- package/dist/chunks/chunk-A42DFLOR.js +16 -0
- package/dist/chunks/chunk-AF57BF75.js +24 -0
- package/dist/chunks/chunk-BX4J2VDU.js +2 -0
- package/dist/chunks/chunk-BZMVB3GS.js +2 -0
- package/dist/chunks/chunk-CCJG7GLE.js +5 -0
- package/dist/chunks/chunk-CWQWV2T3.js +2 -0
- package/dist/chunks/chunk-DUA3QP6Y.js +19 -0
- package/dist/chunks/chunk-EAPFMACH.js +10 -0
- package/dist/chunks/chunk-EG3XB6M6.js +5 -0
- package/dist/chunks/chunk-ES2ISFJC.js +66 -0
- package/dist/chunks/chunk-FTQLQJQV.js +2 -0
- package/dist/chunks/chunk-FYCJSUFV.js +53 -0
- package/dist/chunks/chunk-GEANXBLX.js +2 -0
- package/dist/chunks/chunk-GLUWATL5.js +2 -0
- package/dist/chunks/chunk-GPZYIVFV.js +2199 -0
- package/dist/chunks/chunk-H7IWJN7L.js +17 -0
- package/dist/chunks/chunk-HZP5U2AA.js +3 -0
- package/dist/chunks/chunk-I5K74TOH.js +3 -0
- package/dist/chunks/chunk-I7G35U7K.js +2 -0
- package/dist/chunks/chunk-IR3YJWPW.js +7 -0
- package/dist/chunks/chunk-J7WZSLHS.js +18 -0
- package/dist/chunks/chunk-K35OOAW2.js +6 -0
- package/dist/chunks/chunk-KDXLNQNF.js +12 -0
- package/dist/chunks/chunk-KJYNLFWD.js +2872 -0
- package/dist/chunks/chunk-KV2IXO2T.js +6 -0
- package/dist/chunks/chunk-NVGMZ2IN.js +2 -0
- package/dist/chunks/chunk-OGPHXXCD.js +1 -0
- package/dist/chunks/chunk-RAKJWIYO.js +36 -0
- package/dist/chunks/chunk-RWSAGQTP.js +2 -0
- package/dist/chunks/chunk-SDO4FC4Q.js +2 -0
- package/dist/chunks/chunk-T5XCPX4P.js +3 -0
- package/dist/chunks/chunk-VYUMTRB3.js +5 -0
- package/dist/chunks/chunk-X37KMV27.js +1 -0
- package/dist/chunks/chunk-XAYIETBO.js +28 -0
- package/dist/chunks/chunk-XEOEKFG6.js +71 -0
- package/dist/chunks/chunk-ZVOO7FKM.js +2 -0
- package/dist/chunks/cli-UYTSZB4Y.js +2 -0
- package/dist/chunks/configuration-command-HAPIYG25.js +2 -0
- package/dist/chunks/continual-D75WA7E7.js +7 -0
- package/dist/chunks/core-commands-N37UZEVE.js +2 -0
- package/dist/chunks/database-X2CUV732.js +2 -0
- package/dist/chunks/desktop-test-V7FBEG7U.js +3 -0
- package/dist/chunks/dist-NKLXFA37.js +2 -0
- package/dist/chunks/extension-NEPOQ44P.js +5 -0
- package/dist/chunks/help-HC4N5ZQC.js +8 -0
- package/dist/chunks/module-ES6BEMUI-ZVL3F6NW.js +2 -0
- package/dist/chunks/module-asyncify-2EFITU5U-R7TVXNAE.js +2 -0
- package/dist/chunks/opchat-C7XRN4ZW.js +3 -0
- package/dist/chunks/organizations-LQGRZJ2V.js +2 -0
- package/dist/chunks/profile-UWM24A7R.js +3 -0
- package/dist/chunks/project-agent-2ME52ZJW.js +2 -0
- package/dist/chunks/sandbox-command-53L3ZICT.js +2 -0
- package/dist/chunks/sandbox-template-55HUM5H7.js +10 -0
- package/dist/chunks/src-EYJF2LWV.js +319 -0
- package/dist/chunks/src-VGW2UEMV.js +82 -0
- package/dist/chunks/taskset-PISBOILQ.js +2 -0
- package/dist/chunks/teams-bot-FHD2HCHN.js +3 -0
- package/dist/chunks/training-2NDOWH5S.js +2 -0
- package/dist/chunks/workspaces-CQFVCR7T.js +2 -0
- package/dist/cli.js +3 -109
- package/dist/index.js +1 -31230
- package/dist/sandbox-template/manifest.js +1 -18380
- package/dist/web/assets/App-BoJQRfeu.js +176 -0
- package/dist/web/assets/AppDialog-rdfmJsGF.js +1 -0
- package/dist/web/assets/AppTerminalPanel-CLW0kxtg.js +2 -0
- package/dist/web/assets/{AppsView-B1NUuAIf.js → AppsView-DxMXadnp.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-DOvYxXeP.js → BrowserSidebar-BH_jl0JS.js} +1 -1
- package/dist/web/assets/{CartesianChart-pOrYpzBr.js → CartesianChart-oT_rMYpf.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-CgbR-MBJ.js → CollaborationTabs-CukgFGE0.js} +1 -1
- package/dist/web/assets/{CommandMenu-CrIr4qUX.js → CommandMenu-2btBTgOF.js} +1 -1
- package/dist/web/assets/{CommunityView-CvAVQ_HZ.js → CommunityView-DMTREmN5.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-DybcKwwd.js → ComposerCreateImproveStrip-3tN55cg9.js} +1 -1
- package/dist/web/assets/GetStartedView-CMHL24_w.js +1 -0
- package/dist/web/assets/HostedModelLearningReview-CqkSelkC.js +1 -0
- package/dist/web/assets/HostedModelLearningSettings-xqd2lSW3.js +1 -0
- package/dist/web/assets/LabModelVersionDetailPage-Bpnya5DM.js +1 -0
- package/dist/web/assets/{LabSkillSidebar-CuaYrtiu.js → LabSkillSidebar-BKZjScr8.js} +1 -1
- package/dist/web/assets/LabsRoute-BhPFmA_Z.js +32 -0
- package/dist/web/assets/LabsRoute-C1FWCoYb.css +1 -0
- package/dist/web/assets/MainChatThread-Bosxokt-.js +2 -0
- package/dist/web/assets/MainPane-Di-Rwe7x.js +8 -0
- package/dist/web/assets/{MarkdownText-DOlVQR8a.js → MarkdownText-dK4SBPp_.js} +1 -1
- package/dist/web/assets/{Messages-DMubppta.js → Messages-ftYRMKYa.js} +6 -6
- package/dist/web/assets/{NativeSkillSidebar-DSFwZ-od.js → NativeSkillSidebar-Cwo7JdB2.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-Dj0ePIJ-.js → NewExperienceSwitcher-C1_JzTq2.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-B8NQV-Ji.js → NewProjectDialog-CxP6v6YW.js} +1 -1
- package/dist/web/assets/{OutputsPage-D_LDYTgV.js → OutputsPage-DL21_Alp.js} +1 -1
- package/dist/web/assets/{ProjectsPage-xjDYPc_W.js → ProjectsPage-BO9VyvMA.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-DaqAnzdR.js +1 -0
- package/dist/web/assets/{RightSidebarHomePanel-j0VckZUu.js → RightSidebarHomePanel-PbUG12AO.js} +1 -1
- package/dist/web/assets/{ScheduledWorkPage-1aT4bBY-.js → ScheduledWorkPage-BhL-cXML.js} +1 -1
- package/dist/web/assets/{SettingsView-BSpuMDpv.js → SettingsView-D6-s7G88.js} +7 -7
- package/dist/web/assets/TeamChatView-DbS1N-fo.js +3 -0
- package/dist/web/assets/{TerminalOverlay-CrSwUk2d.js → TerminalOverlay-CphyBXJR.js} +3 -3
- package/dist/web/assets/{TrainingCreationPanel-B4HMRwUg.js → TrainingCreationPanel-Czsdraix.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-D4r1tN3I.js → TrainingDraftPanel-Bq3B5pUk.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-2aymqwIM.js → UsageSettingsSection-B74FNwaP.js} +5 -5
- package/dist/web/assets/{WorkSidebarPanel-B0X0OiR6.js → WorkSidebarPanel-BgaK4XSg.js} +1 -1
- package/dist/web/assets/WorkspaceDiffPanel-C3seHnVY.js +14 -0
- package/dist/web/assets/{WorkspaceEnvironmentMenu-OAfMEt7L.js → WorkspaceEnvironmentMenu-DPghQUdv.js} +3 -3
- package/dist/web/assets/{WorkspaceGitDialogs-YxcPH2Rq.js → WorkspaceGitDialogs-D8c6Okb_.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-COKTiQZl.js → WorkspaceMonacoEditor-2kjRFf4l.js} +36 -36
- package/dist/web/assets/{arrow-up-right-_TX-awvK.js → arrow-up-right-C5X-29oa.js} +1 -1
- package/dist/web/assets/chat-file-links-Bmz9kVct.js +1 -0
- package/dist/web/assets/chevron-up-NbP9vY4E.js +1 -0
- package/dist/web/assets/{clipboard-CyRSS8Sy.js → clipboard-fvHMXPWa.js} +1 -1
- package/dist/web/assets/{cloud-upload-uBJBUYTy.js → cloud-upload-BAycsdHL.js} +1 -1
- package/dist/web/assets/{cssMode-BrXSsZYs.js → cssMode-Yis679a5.js} +1 -1
- package/dist/web/assets/{folder-open-DktdZNW7.js → folder-open-bii4KUCv.js} +1 -1
- package/dist/web/assets/{folder-plus-DO06i9Vo.js → folder-plus-B0B7mUCx.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-zFSIkPs7.js → git-commit-horizontal-B6yTdtnB.js} +1 -1
- package/dist/web/assets/{htmlMode-X9UMFkjt.js → htmlMode-DHeBSKVF.js} +1 -1
- package/dist/web/assets/{index-UOGdfLzi.js → index-667pXXsu.js} +1 -1
- package/dist/web/assets/{index-ByQIHpc9.css → index-BGMzUaup.css} +1 -1
- package/dist/web/assets/{info-BEJXUqCD.js → info-NCOESX3I.js} +1 -1
- package/dist/web/assets/{jsonMode-DIsB-j2E.js → jsonMode-C4oxy1cU.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-CmZ17KpA.js → lspLanguageFeatures-CLj3WGZW.js} +1 -1
- package/dist/web/assets/{minimize-2-DumTpFtE.js → minimize-2-DtI1vgd7.js} +1 -1
- package/dist/web/assets/{monaco.contribution-D6w5PJji.js → monaco.contribution-DZPgekIQ.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DJ_NmcHu.js → monaco.contribution-Ddw-TznO.js} +2 -2
- package/dist/web/assets/{monaco.contribution-YVDfJcG4.js → monaco.contribution-DhVPJ-oY.js} +2 -2
- package/dist/web/assets/{monaco.contribution-LZEujgny.js → monaco.contribution-DrW6DjWP.js} +2 -2
- package/dist/web/assets/{play-CLFeH7CU.js → play-DB3XFAnG.js} +1 -1
- package/dist/web/assets/{python-Djbda_qZ.js → python-DLyUeEeL.js} +1 -1
- package/dist/web/assets/{refresh-cw-B4IpQ_7Q.js → refresh-cw-0zSLZtfp.js} +1 -1
- package/dist/web/assets/{save-BbTHztnA.js → save-BCZlshOA.js} +1 -1
- package/dist/web/assets/{square-BJrVbmz6.js → square-CRytZWR_.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-BopU5W9S.js → toggleHighContrast-TXg0rI_R.js} +1 -1
- package/dist/web/assets/{tsMode-CH_0_YDX.js → tsMode-Bj1019AY.js} +1 -1
- package/dist/web/assets/{upload-UumVeufu.js → upload-CnE9u7GB.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-BRa23U7O.js → useLocalAgentSchedules-qI87RHVI.js} +1 -1
- package/dist/web/assets/{wifi-off-BWJWivn6.js → wifi-off-CfuwRBx7.js} +1 -1
- package/dist/web/assets/{workers-pTe8RvSI.js → workers-CXdUI7wU.js} +1 -1
- package/dist/web/assets/{yaml-DNLASORn.js → yaml-AP8aiwLm.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +4 -3
- package/dist/chunks/actions-command-6N5XWMR6.js +0 -185
- package/dist/chunks/app-layer-F3CGXB33.js +0 -216
- package/dist/chunks/app-server-runtime-RHO5TFUC.js +0 -23
- package/dist/chunks/apps-L5XCL7QY.js +0 -429
- package/dist/chunks/chunk-26AMV5ZI.js +0 -634
- package/dist/chunks/chunk-3EB7I67T.js +0 -630
- package/dist/chunks/chunk-3ELF4FXY.js +0 -96
- package/dist/chunks/chunk-3VEYNDHN.js +0 -669
- package/dist/chunks/chunk-4KA25HUP.js +0 -5648
- package/dist/chunks/chunk-4L3ZJS2T.js +0 -1207
- package/dist/chunks/chunk-6SMNG6YA.js +0 -1303
- package/dist/chunks/chunk-7RIGZB7N.js +0 -1148
- package/dist/chunks/chunk-A6G3PFA5.js +0 -2164
- package/dist/chunks/chunk-BVY5JYM6.js +0 -512
- package/dist/chunks/chunk-DLQQIWN2.js +0 -648
- package/dist/chunks/chunk-FJ2JGB2N.js +0 -1373
- package/dist/chunks/chunk-FQS2QL5F.js +0 -14522
- package/dist/chunks/chunk-G65WAOJV.js +0 -1643
- package/dist/chunks/chunk-JTHL5XJ2.js +0 -1838
- package/dist/chunks/chunk-K4TZEHAW.js +0 -602
- package/dist/chunks/chunk-KCRCIQPD.js +0 -66
- package/dist/chunks/chunk-KSRWKXRB.js +0 -12
- package/dist/chunks/chunk-MUMPWI4O.js +0 -92
- package/dist/chunks/chunk-NTK22KJD.js +0 -10707
- package/dist/chunks/chunk-OCBRPU2K.js +0 -629
- package/dist/chunks/chunk-PS37DB5F.js +0 -183
- package/dist/chunks/chunk-R3C3MNSI.js +0 -140
- package/dist/chunks/chunk-SMNFI2FU.js +0 -113
- package/dist/chunks/chunk-UACZUFIA.js +0 -47
- package/dist/chunks/chunk-UZMVNKXM.js +0 -1275
- package/dist/chunks/chunk-VT6BLHMB.js +0 -67198
- package/dist/chunks/chunk-W5GKHH77.js +0 -168
- package/dist/chunks/chunk-X6F4LBTQ.js +0 -832
- package/dist/chunks/chunk-X7ZG4TSW.js +0 -3063
- package/dist/chunks/chunk-XA4KBDMY.js +0 -13723
- package/dist/chunks/chunk-YVCYVDNP.js +0 -746
- package/dist/chunks/chunk-ZNQEROWP.js +0 -254
- package/dist/chunks/cli-D2MUUBEX.js +0 -23
- package/dist/chunks/configuration-command-NR6JYIUD.js +0 -187
- package/dist/chunks/continual-37CE4LLJ.js +0 -803
- package/dist/chunks/core-commands-SWGIOZLW.js +0 -50
- package/dist/chunks/database-DEYUZDIM.js +0 -20
- package/dist/chunks/desktop-test-QOS7G5NE.js +0 -148
- package/dist/chunks/dist-AKYCQNNF.js +0 -187
- package/dist/chunks/extension-HJUJBQAD.js +0 -9378
- package/dist/chunks/help-J6PZ23IC.js +0 -67
- package/dist/chunks/opchat-ABX5YBAT.js +0 -169
- package/dist/chunks/organizations-CPNC47DO.js +0 -806
- package/dist/chunks/profile-Q3HB5MIO.js +0 -1136
- package/dist/chunks/project-agent-YHUBX4OR.js +0 -516
- package/dist/chunks/sandbox-command-YFL5QTWX.js +0 -1661
- package/dist/chunks/sandbox-template-Z6P7NTNF.js +0 -1655
- package/dist/chunks/src-7XEENEBI.js +0 -3628
- package/dist/chunks/src-KBBIV4NT.js +0 -56125
- package/dist/chunks/taskset-2TRZBRRT.js +0 -66
- package/dist/chunks/teams-bot-WD33NLH5.js +0 -146
- package/dist/chunks/training-4XH37UZB.js +0 -17
- package/dist/chunks/workspaces-WG2MH2WE.js +0 -99
- package/dist/web/assets/App-C9aGkxVg.js +0 -173
- package/dist/web/assets/AppDialog-CK6_lg8c.js +0 -1
- package/dist/web/assets/AppTerminalPanel-BKqgX4sd.js +0 -2
- package/dist/web/assets/GetStartedView-DVInkexN.js +0 -1
- package/dist/web/assets/LabModelVersionDetailPage-NaaPElmM.js +0 -1
- package/dist/web/assets/LabsRoute-BRR6x3SX.js +0 -2
- package/dist/web/assets/LabsRoute-CGFgymTX.css +0 -1
- package/dist/web/assets/MainChatThread-BfkjCZB9.js +0 -2
- package/dist/web/assets/MainPane-Gw-YK38n.js +0 -8
- package/dist/web/assets/RightChatPanelStack-BktRQ9wg.js +0 -1
- package/dist/web/assets/TeamChatView-BPWJbDf1.js +0 -3
- package/dist/web/assets/WorkspaceDiffPanel-Pg7GL0br.js +0 -14
- package/dist/web/assets/chat-file-links-CWLsRYvW.js +0 -1
- package/dist/web/assets/chevron-up--mNnEqha.js +0 -1
- package/dist/web/assets/index-BEPmTPIA.js +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{b as f}from"./chunk-ES2ISFJC.js";import{a as c}from"./chunk-FTQLQJQV.js";import{promises as K}from"node:fs";import k from"node:path";function _(t){return!!(t&&typeof t=="object"&&t.kind==="openpond-project-action"&&typeof t.id=="string"&&typeof t.run=="function")}c(_,"isProjectActionDefinition");var I="openpond/project-actions.json",G=f.object({values:f.record(f.string(),f.unknown()).optional().default({}),environment:f.record(f.string(),f.string().trim().min(1)).optional().default({})}).strict(),q=f.object({sourceDirectory:f.string().trim().min(1).optional(),outputDirectory:f.string().trim().min(1).optional(),environment:f.record(f.string(),f.string().trim().min(1)).optional().default({}),connections:f.record(f.string(),G).optional().default({})}).strict();async function R(t){let r=k.resolve(t),e=k.join(r,I),o=await K.readFile(e,"utf8").catch(n=>{if(n.code==="ENOENT")return null;throw n});if(o===null)return q.parse({});let s;try{s=JSON.parse(o)}catch(n){let i=n instanceof Error?n.message:String(n);throw new Error(`${I} is not valid JSON: ${i}`)}return q.parse(s)}c(R,"loadProjectActionConfiguration");function C(t,r=process.env){let e={};for(let[s,n]of Object.entries(t.environment)){let i=r[n];i!==void 0&&(e[s]=i)}let o={};for(let[s,n]of Object.entries(t.connections)){let i={...n.values};for(let[u,a]of Object.entries(n.environment)){let p=r[a];p!==void 0&&(i[u]=p)}o[s]=i}return{environment:e,connections:o}}c(C,"resolveProjectActionRuntime");import{randomUUID as x}from"node:crypto";import{spawn as Z}from"node:child_process";import{promises as E}from"node:fs";import m from"node:path";import{promises as v}from"node:fs";import l from"node:path";import{fileURLToPath as X,pathToFileURL as Y}from"node:url";import{build as Q}from"esbuild";import{promises as z}from"node:fs";import P from"node:path";import{createHash as ct}from"node:crypto";import{promises as at}from"node:fs";import{createRequire as ut}from"node:module";import O from"node:path";function J(t){return f.toJSONSchema(t,{unrepresentable:"any"})}c(J,"projectActionJsonSchema");function tt(t){let r=[],e=new Set,o=c(n=>{if(!e.has(n)){if(n&&(typeof n=="object"||typeof n=="function")&&e.add(n),_(n)){r.push(n);return}if(Array.isArray(n)){n.forEach(o);return}n&&typeof n=="object"&&Object.values(n).forEach(o)}},"visit");t.forEach(o);let s=new Map;for(let n of r){if(s.has(n.id))throw new Error(`Duplicate Project Action id: ${n.id}`);s.set(n.id,n)}return[...s.values()].sort((n,i)=>n.id.localeCompare(i.id))}c(tt,"collectProjectActions");function et(t){return{schemaVersion:"openpond.projectActionRegistry.v1",actions:t.map(ot)}}c(et,"createProjectActionRegistry");function ot(t){return{id:t.id,sourceActionId:t.id,name:t.id,label:t.label,description:t.description,visibility:"default",inputSchema:J(t.inputSchema),outputSchema:J(t.outputSchema),approvalPolicy:{...t.approval,required:t.approval.mode==="always"||t.approval.mode==="sensitive"||t.approval.mode==="writes"&&t.behavior==="write",risk:t.behavior},artifactPolicy:{outputArtifacts:[],persistRunSummary:!0,persistTrace:!0},setupRequirements:[...t.setup],mcp:{enabled:!1},schedulePolicy:{enabled:!1,allowAdHoc:!0},trace:{name:t.id,namespace:"project-actions"},implementation:{type:"openpond-project-action",actionId:t.id,behavior:t.behavior,timeoutMs:t.timeoutMs,concurrency:t.concurrency},invokesModel:t.invokesModel}}c(ot,"toCatalogEntry");var rt=/\.(?:[cm]?[jt]s)$/i,nt=/(?:\.d\.ts|\.test\.[cm]?[jt]s|\.spec\.[cm]?[jt]s)$/i;async function it(t){let r=P.resolve(t.projectRoot),e=P.resolve(r,t.sourceDirectory??"openpond/actions");if(!st(r,e))throw new Error("Project Action source directory must stay inside the Project root.");if(!(await z.stat(e).catch(()=>null))?.isDirectory())throw new Error(`Project Action source directory does not exist: ${e}`);let n=(await B(e)).filter(i=>rt.test(i)&&!nt.test(i)).map(i=>P.relative(r,i).split(P.sep).join("/")).sort();if(n.length===0)throw new Error(`No Project Action files were found under ${e}.`);return{projectRoot:r,sourceRoot:e,files:n}}c(it,"discoverProjectActionFiles");async function B(t){let r=await z.readdir(t,{withFileTypes:!0}),e=[];for(let o of r.sort((s,n)=>s.name.localeCompare(n.name))){if(o.name.startsWith(".")||o.name==="node_modules")continue;let s=P.join(t,o.name);o.isDirectory()?e.push(...await B(s)):o.isFile()&&e.push(s)}return e}c(B,"walk");function st(t,r){let e=P.relative(t,r);return e===""||!e.startsWith("..")&&!P.isAbsolute(e)}c(st,"isWithin");function L(t){return ct("sha256").update(t).digest("hex")}c(L,"sha256");function M(t){return`${JSON.stringify(N(t),null,2)}
|
|
3
|
+
`}c(M,"canonicalJson");function N(t){return Array.isArray(t)?t.map(N):!t||typeof t!="object"?t:Object.fromEntries(Object.entries(t).sort(([r],[e])=>r.localeCompare(e)).map(([r,e])=>[r,N(e)]))}c(N,"sortValue");async function W(t,r){for(let e of r)if(e.required!==!1){if(e.kind==="package")try{ut(O.join(t,"package.json")).resolve(e.name)}catch{throw new Error(`Project Action package is not installed: ${e.name}`)}if(e.kind==="native_tool"&&!await ft(e.name))throw new Error(`Project Action native tool is not installed: ${e.name}`)}}c(W,"validateProjectActionStaticSetup");async function lt(t,r,e){await W(t,r);for(let o of r)if(o.required!==!1){if(o.kind==="connection"&&!(o.name in(e.connections??{})))throw new Error(`Project Action connection is not configured: ${o.name}`);if(o.kind==="env"&&!(o.name in(e.environment??{})))throw new Error(`Project Action environment value is not configured: ${o.name}`)}}c(lt,"validateProjectActionRunSetup");async function ft(t){if(!t.trim()||t.includes("/")||t.includes("\\"))return!1;for(let r of(process.env.PATH??"").split(O.delimiter).filter(Boolean)){let e=process.platform==="win32"?(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";").map(o=>O.join(r,`${t}${o}`)):[O.join(r,t)];for(let o of e)if(await at.access(o).then(()=>!0).catch(()=>!1))return!0}return!1}c(ft,"executableExists");var H=".openpond/actions";async function dt(t){let r=await R(t.projectRoot),e=await it({projectRoot:t.projectRoot,sourceDirectory:t.sourceDirectory??r.sourceDirectory}),o=l.resolve(e.projectRoot,t.outputDirectory??r.outputDirectory??H);mt(e.projectRoot,o),await v.mkdir(o,{recursive:!0});let s=l.join(o,"entry.mjs"),n=l.join(o,"bundle.mjs"),i=l.join(o,"runner.mjs"),u=l.join(o,"action-registry.json"),a=l.join(o,"build-manifest.json"),p=e.files.map((h,A)=>{let T=l.relative(o,l.join(e.projectRoot,h)).split(l.sep).join("/"),V=T.startsWith(".")?T:`./${T}`;return`import * as actionModule${A} from ${JSON.stringify(V)};`}),d=e.files.map((h,A)=>`actionModule${A}`).join(", ");await v.writeFile(s,[...p,`export const projectActionModules = [${d}];`,"export default projectActionModules;",""].join(`
|
|
4
|
+
`),"utf8"),await Q({entryPoints:[s],outfile:n,bundle:!0,platform:"node",format:"esm",target:"node22.14",sourcemap:!1,legalComments:"none",logLevel:"silent",nodePaths:pt(e.projectRoot)});let g=`openpond_action_build=${Date.now()}_${Math.random().toString(16).slice(2)}`,w=await import(`${Y(n).href}?${g}`),$=tt(w.projectActionModules??w.default??[]);for(let h of $)await W(e.projectRoot,h.setup);let j=et($);await v.writeFile(u,M(j),"utf8"),await v.writeFile(i,ht(),{encoding:"utf8",mode:493});let D=L(await v.readFile(n)),b=L(M(j)),y={schemaVersion:"openpond.projectActionBuild.v1",sourceDirectory:l.relative(e.projectRoot,e.sourceRoot).split(l.sep).join("/"),sourceFiles:e.files,bundleFile:l.basename(n),runnerFile:l.basename(i),registryFile:l.basename(u),bundleHash:D,registryHash:b};return await v.writeFile(a,M(y),"utf8"),await v.rm(s,{force:!0}),{projectRoot:e.projectRoot,outputDirectory:o,bundlePath:n,runnerPath:i,registryPath:u,manifestPath:a,registry:j,manifest:y}}c(dt,"buildProjectActions");function pt(t){let r=[],e=t;for(;;){r.push(l.join(e,"node_modules"));let o=l.dirname(e);if(o===e)break;e=o}return r.push(l.resolve(l.dirname(X(import.meta.url)),"../../../node_modules")),[...new Set(r)]}c(pt,"dependencySearchPaths");function mt(t,r){let e=l.relative(t,r);if(e.startsWith("..")||l.isAbsolute(e))throw new Error("Project Action output directory must stay inside the Project root.")}c(mt,"assertWithinProject");function ht(){return`#!/usr/bin/env node
|
|
5
|
+
import { promises as fs } from "node:fs";
|
|
6
|
+
import { stdin } from "node:process";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
9
|
+
|
|
10
|
+
let requestText = "";
|
|
11
|
+
stdin.setEncoding("utf8");
|
|
12
|
+
for await (const chunk of stdin) requestText += chunk;
|
|
13
|
+
const request = JSON.parse(requestText);
|
|
14
|
+
const bundlePath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "bundle.mjs");
|
|
15
|
+
const loaded = await import(pathToFileURL(bundlePath).href);
|
|
16
|
+
const values = [];
|
|
17
|
+
const seen = new Set();
|
|
18
|
+
const visit = (value) => {
|
|
19
|
+
if (seen.has(value)) return;
|
|
20
|
+
if (value && (typeof value === "object" || typeof value === "function")) seen.add(value);
|
|
21
|
+
if (value?.kind === "openpond-project-action" && typeof value.run === "function") { values.push(value); return; }
|
|
22
|
+
if (Array.isArray(value)) { value.forEach(visit); return; }
|
|
23
|
+
if (value && typeof value === "object") Object.values(value).forEach(visit);
|
|
24
|
+
};
|
|
25
|
+
(loaded.projectActionModules ?? loaded.default ?? []).forEach(visit);
|
|
26
|
+
const action = values.find((candidate) => candidate.id === request.actionId);
|
|
27
|
+
if (!action) throw new Error(\`Unknown Project Action: \${request.actionId}\`);
|
|
28
|
+
const controller = new AbortController();
|
|
29
|
+
const timeoutMs = Math.min(request.timeoutMs ?? action.timeoutMs, action.timeoutMs);
|
|
30
|
+
const timer = setTimeout(() => controller.abort(new Error(\`Project Action timed out after \${timeoutMs}ms.\`)), timeoutMs);
|
|
31
|
+
const traces = [];
|
|
32
|
+
const outputs = [];
|
|
33
|
+
const env = request.environment ?? {};
|
|
34
|
+
const connections = request.connections ?? {};
|
|
35
|
+
const context = {
|
|
36
|
+
runId: request.runId,
|
|
37
|
+
actionId: action.id,
|
|
38
|
+
idempotencyKey: request.idempotencyKey ?? null,
|
|
39
|
+
projectRoot: request.projectRoot,
|
|
40
|
+
outputDirectory: request.outputDirectory,
|
|
41
|
+
signal: controller.signal,
|
|
42
|
+
env(name) { return Object.prototype.hasOwnProperty.call(env, name) ? env[name] : undefined; },
|
|
43
|
+
connection(name) {
|
|
44
|
+
if (!Object.prototype.hasOwnProperty.call(connections, name)) throw new Error(\`Project Action connection is not configured: \${name}\`);
|
|
45
|
+
return connections[name];
|
|
46
|
+
},
|
|
47
|
+
trace(name, payload) { traces.push({ name, ...(payload ? { payload } : {}), timestamp: new Date().toISOString() }); },
|
|
48
|
+
output(value) {
|
|
49
|
+
if (!value || typeof value.path !== "string" || !value.path.trim()) throw new Error("Project Action output requires a path.");
|
|
50
|
+
const outputPath = path.resolve(request.outputDirectory, value.path);
|
|
51
|
+
const relative = path.relative(request.outputDirectory, outputPath);
|
|
52
|
+
if (relative.startsWith("..") || path.isAbsolute(relative)) throw new Error("Project Action output must stay inside the run output directory.");
|
|
53
|
+
outputs.push({ ...value, path: relative.split(path.sep).join("/") });
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
try {
|
|
57
|
+
const input = action.inputSchema.parse(request.input ?? {});
|
|
58
|
+
const result = await Promise.race([
|
|
59
|
+
Promise.resolve(action.run(context, input)),
|
|
60
|
+
new Promise((_, reject) => controller.signal.addEventListener("abort", () => reject(controller.signal.reason), { once: true })),
|
|
61
|
+
]);
|
|
62
|
+
const output = action.outputSchema.parse(result);
|
|
63
|
+
for (const artifact of outputs) {
|
|
64
|
+
const stats = await fs.stat(path.resolve(request.outputDirectory, artifact.path)).catch(() => null);
|
|
65
|
+
if (!stats?.isFile()) throw new Error(\`Project Action output does not exist: \${artifact.path}\`);
|
|
66
|
+
}
|
|
67
|
+
await fs.writeFile(request.responseFile, JSON.stringify({ ok: true, output, traces, outputs }), "utf8");
|
|
68
|
+
} finally {
|
|
69
|
+
clearTimeout(timer);
|
|
70
|
+
}
|
|
71
|
+
`}c(ht,"runtimeSource");var F=new Map;function zt(t){let r=m.resolve(t.projectRoot),e=t.build??"if-missing",o=null,s=c(async()=>{if(e==="always")return n();if(o)return o;if(e==="never"||e==="if-missing"){let i=await R(r),u=m.resolve(r,t.outputDirectory??i.outputDirectory??H),a=await jt(r,u);if(a)return o=a;if(e==="never")throw new Error(`Project Actions have not been built in ${u}.`)}return n()},"ensureBuild"),n=c(async()=>(o=await dt({projectRoot:r,sourceDirectory:t.sourceDirectory,outputDirectory:t.outputDirectory}),o),"runBuild");return{build:n,async catalog(){return(await s()).registry},async run(i){let u=await s(),a=u.registry.actions.find(h=>h.id===i.actionId);if(!a)throw new Error(`Unknown Project Action: ${i.actionId}`);let p=C(await R(r)),d={...i,environment:{...p.environment,...i.environment??{}},connections:{...p.connections,...i.connections??{}}};await lt(r,a.setupRequirements,d);let g=i.runId?.trim()||x(),w=m.resolve(i.outputDirectory??m.join(r,".openpond","outputs",g));Pt(r,w,"Project Action output directory"),await E.mkdir(w,{recursive:!0});let $=await wt(`${r}\0${i.actionId}`,a.implementation.concurrency,d.signal),j=m.join(u.outputDirectory,`.run-${x()}.json`),D=Date.now(),b,y;try{b=await vt({runnerPath:u.runnerPath,cwd:r,signal:d.signal,request:{actionId:i.actionId,input:d.input??{},runId:g,idempotencyKey:d.idempotencyKey??null,timeoutMs:d.timeoutMs,projectRoot:r,outputDirectory:w,responseFile:j,environment:d.environment??{},connections:d.connections??{}}}),y=JSON.parse(await E.readFile(j,"utf8"))}catch(h){let A=h instanceof Error?h.message:String(h);throw new Error(S(A,d))}finally{await E.rm(j,{force:!0}).catch(()=>{}),$()}return{runId:g,actionId:i.actionId,status:"succeeded",output:y.output,stdout:S(b.stdout,d),stderr:S(b.stderr,d),traces:U(y.traces,d),outputs:U(y.outputs,d),outputDirectory:w,durationMs:Date.now()-D}}}}c(zt,"createLocalActionRunner");async function wt(t,r,e){if(r===null)return()=>{};let o=F.get(t)??{active:0,waiting:[]};F.set(t,o),o.active>=r?await new Promise((n,i)=>{let u=c(()=>{e?.removeEventListener("abort",a),n()},"resume"),a=c(()=>{let p=o.waiting.indexOf(u);p>=0&&o.waiting.splice(p,1),i(e?.reason instanceof Error?e.reason:new Error("Project Action was cancelled."))},"abort");if(e?.aborted){a();return}o.waiting.push(u),e?.addEventListener("abort",a,{once:!0})}):o.active+=1;let s=!1;return()=>{if(s)return;s=!0;let n=o.waiting.shift();if(n){n();return}o.active-=1,o.active===0&&o.waiting.length===0&&F.delete(t)}}c(wt,"acquireLocalActionSlot");async function jt(t,r){let e=m.join(r,"build-manifest.json"),o=m.join(r,"action-registry.json"),[s,n]=await Promise.all([E.readFile(e,"utf8").catch(()=>null),E.readFile(o,"utf8").catch(()=>null)]);if(!s||!n)return null;let i=JSON.parse(s),u=JSON.parse(n);return{projectRoot:t,outputDirectory:r,bundlePath:m.join(r,i.bundleFile),runnerPath:m.join(r,i.runnerFile),registryPath:o,manifestPath:e,registry:u,manifest:i}}c(jt,"loadBuild");function S(t,r){let e=t;for(let o of yt(r))o.length>=4&&(e=e.split(o).join("[REDACTED]"));return e}c(S,"redactRuntimeValues");function U(t,r){let e=JSON.stringify(t);return JSON.parse(S(e,r))}c(U,"redactRuntimeValue");function yt(t){let r=new Set(Object.values(t.environment??{})),e=c(o=>{typeof o=="string"?r.add(o):Array.isArray(o)?o.forEach(e):o&&typeof o=="object"&&Object.values(o).forEach(e)},"visit");return e(t.connections??{}),[...r].filter(Boolean).sort((o,s)=>s.length-o.length)}c(yt,"runtimeStringValues");function vt(t){return new Promise((r,e)=>{if(t.signal?.aborted){e(t.signal.reason instanceof Error?t.signal.reason:new Error("Project Action was cancelled."));return}let o;try{o=JSON.stringify(t.request)}catch(a){e(new Error(`Project Action request is not serializable: ${a instanceof Error?a.message:String(a)}`));return}let s=Z(process.execPath,[t.runnerPath],{cwd:t.cwd,env:gt(),stdio:["pipe","pipe","pipe"]}),n="",i="";s.stdout.setEncoding("utf8"),s.stderr.setEncoding("utf8"),s.stdout.on("data",a=>{n+=a}),s.stderr.on("data",a=>{i+=a});let u=c(()=>s.kill("SIGTERM"),"abort");t.signal?.addEventListener("abort",u,{once:!0}),s.once("error",e),s.once("close",(a,p)=>{if(t.signal?.removeEventListener("abort",u),t.signal?.aborted){e(t.signal.reason instanceof Error?t.signal.reason:new Error("Project Action was cancelled."));return}if(a!==0){e(new Error(`Project Action process failed (${a??p??"unknown"}): ${i.trim()||n.trim()}`));return}r({stdout:n,stderr:i})}),s.stdin.end(o)})}c(vt,"executeChild");function Pt(t,r,e){let o=m.relative(t,r);if(o.startsWith("..")||m.isAbsolute(o))throw new Error(`${e} must stay inside the Project root.`)}c(Pt,"assertWithinProject2");function gt(){let t={};for(let r of["PATH","SystemRoot","WINDIR","TMPDIR","TEMP","TMP"])process.env[r]!==void 0&&(t[r]=process.env[r]);return t}c(gt,"minimalEnvironment");export{I as a,R as b,dt as c,zt as d};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a,b as s}from"./chunk-GLUWATL5.js";import{a as n}from"./chunk-FTQLQJQV.js";var p=new URL(s).hostname,c=new URL(a).hostname;function b(r){let t=typeof r.account=="string"?r.account:typeof r.profile=="string"?r.profile:null;if(!t)return null;let e=t.trim();if(!e||e==="true")throw new Error("account must be a non-empty value");return e}n(b,"resolveAccountOption");function d(r){let t=typeof r.baseUrl=="string"?r.baseUrl:typeof r.baseurl=="string"?r.baseurl:null;if(!t)return null;let e=t.trim();if(!e||e==="true")throw new Error("baseurl must be a non-empty value");return e.replace(/\/$/,"")}n(d,"resolveBaseUrlOption");function w(r){let t=typeof r.apiBaseUrl=="string"?r.apiBaseUrl:typeof r.apiBaseurl=="string"?r.apiBaseurl:null;if(!t)return null;let e=t.trim();if(!e||e==="true")throw new Error("api-base-url must be a non-empty value");return e.replace(/\/$/,"")}n(w,"resolveApiBaseUrlOption");function h(r){let t=typeof r.chatApiBaseUrl=="string"?r.chatApiBaseUrl:typeof r.chatApiBaseurl=="string"?r.chatApiBaseurl:typeof r.chatApiUrl=="string"?r.chatApiUrl:null;if(!t)return null;let e=t.trim();if(!e||e==="true")throw new Error("chat-api-base-url must be a non-empty value");return e.replace(/\/$/,"")}n(h,"resolveChatApiBaseUrlOption");function A(r){let t=typeof r.sandboxApiUrl=="string"?r.sandboxApiUrl:typeof r.sandboxApiurl=="string"?r.sandboxApiurl:null;if(!t)return null;let e=t.trim();if(!e||e==="true")throw new Error("sandbox-api-url must be a non-empty value");return e.replace(/\/$/,"")}n(A,"resolveSandboxApiUrlOption");function B(r){return(process.env.OPENPOND_BASE_URL||r.baseUrl||a).replace(/\/$/,"")}n(B,"resolveBaseUrl");function m(r){if(!r)return null;let t=r.replace(/\/$/,"");try{let o=new URL(t).hostname.toLowerCase();if(o===c||o==="openpond.live"||o==="www.openpond.live")return s;if(o===p||o.startsWith("api."))return t}catch{return null}return null}n(m,"mapUiBaseToApiBase");function E(r){let t=process.env.OPENPOND_API_URL,e=r?.apiBaseUrl?.trim(),o=m(process.env.OPENPOND_BASE_URL||r?.baseUrl);return(t||e||o||s).replace(/\/$/,"")}n(E,"resolvePublicApiBaseUrl");function O(r,t){let e=r.trim();if(!e)throw new Error("template must be non-empty");if(e.startsWith("http://")||e.startsWith("https://"))return e.endsWith(".git")?e:`${e}.git`;let o=t.replace(/\/$/,""),[l,i]=e.includes("/")?e.split("/",2):["openpondai",e],u=i.endsWith(".git")?i.slice(0,-4):i;if(!l||!u)throw new Error("template must be <owner>/<repo> or a full https URL");return`${o}/${l}/${u}.git`}n(O,"normalizeTemplateRepoUrl");export{b as a,d as b,w as c,h as d,A as e,B as f,m as g,E as h,O as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{i as a,j as b,k as c}from"./chunk-RAKJWIYO.js";import"./chunk-VYUMTRB3.js";import"./chunk-7D2LMRP7.js";import"./chunk-KV2IXO2T.js";import"./chunk-AF57BF75.js";import"./chunk-GPZYIVFV.js";import"./chunk-6MI4KKWF.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-6FA3GG5B.js";import"./chunk-KDXLNQNF.js";import"./chunk-XAYIETBO.js";import"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as resolveWebLaunchMessages,c as runOpenPondAppServerCli,b as runOpenPondServerCli};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as f}from"./chunk-I7G35U7K.js";import{$a as I,Ba as J,Qa as N,Ra as q,Ua as k,Wa as A,Xa as B,_a as H,b as d,c as w,e as b,hb as E,ib as M,ja as C,jb as T,la as m,ma as j,na as x,oa as F,pa as v,qa as P}from"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import{d as O,f as S,h as g}from"./chunk-H7IWJN7L.js";import"./chunk-T5XCPX4P.js";import"./chunk-3M53YXEI.js";import{a as l}from"./chunk-FTQLQJQV.js";import R from"node:path";import{readFile as p}from"node:fs/promises";var n=l((t,s)=>typeof t[s]=="string"?t[s]:void 0,"stringOption");function a(t){console.log(JSON.stringify(t,null,2))}l(a,"print");function U(t,s){let i=n(t,"keyPath");if(i){let r=JSON.parse(i);if(Array.isArray(r)&&r.length&&r.every(c=>typeof c=="string"&&c.length))return r;throw new f("--key-path must be a JSON array of key segments.")}if(!s)throw new f("Specify a setting key, or --key-path for keys containing dots.");return s.split(".")}l(U,"keyPath");async function G(t,s){let i=S({home:n(t,"home")}),r=s[0]??"get",c=g(i).config;if(r==="path"){console.log(c);return}if(r==="export"){let e=await T(i),o=n(t,"file");o?(await b(R.resolve(o),JSON.stringify(e,null,2),{privateParent:!1}),a({path:R.resolve(o),requiresRebinding:e.requiresRebinding})):a(e);return}if(r==="backup"||r==="restore"){let e=n(t,"file"),o=n(t,"keyFile");if(!e||!o)throw new f(`config ${r} requires --file <encrypted-backup> and --key-file <separate-32-byte-key-file>.`);let u=await p(o),y=u.length===32?u:Buffer.from(u.toString("utf8").trim(),"base64");try{a(r==="backup"?await E(i,e,y):await M(e,i,y))}finally{y.fill(0),u.fill(0)}return}if(r==="collect-orphans"){a(await N(i));return}if(r==="schema"){a(F());return}if(r==="migrate"){let e=n(t,"resolutionFile"),o=e?q.parse(JSON.parse(await p(e,"utf8"))):void 0;a(await k(i,{resolutions:o,sourceAppHome:n(t,"sourceAppHome"),sourceConfig:n(t,"sourceConfig"),sourceBrowserState:n(t,"sourceBrowserState"),dryRun:t.dryRun===!0||t.dryRun==="true"}));return}if(r==="recover"){let e=n(t,"revision");a(e?await x(i,e,n(t,"expectedRevision")??d(await w(c))):await A(i));return}if(r==="restart-migration"){a(await B(i));return}if(r==="effective"){a(await I(i,{projectRoot:n(t,"projectRoot"),accountId:n(t,"accountId")}));return}if(r==="trust"||r==="untrust"){let e=n(t,"projectRoot")??s[1];if(!e)throw new f("Specify the canonical project root with --project-root.");await H(i,e,n(t,"accountId")??"local",r==="trust"),a({root:e,trusted:r==="trust"});return}if(r==="revisions"){a(await m(i));return}if(r==="validate"){let e=n(t,"file")??c;C(await p(e,"utf8"),e,t.project===!0||t.project==="true"?"project":"user"),a({valid:!0,path:e});return}if(r==="replace"){let e=n(t,"file");if(!e)throw new f("config replace requires --file <validated-toml-file>.");a(await j(i,n(t,"expectedRevision")??d(await w(c)),await p(e,"utf8")));return}if(r==="doctor"){let e=await w(c),o=null;try{await v(i)}catch(u){o=O(u,c)}a({home:i,path:c,rawRevision:d(e),issue:o,recoverableRevisions:await m(i),migration:await w(R.join(g(i).runtime,"migration.json"))!==null}),o&&(process.exitCode=1);return}if(await k(i),r==="clear-cache"){await J(i),a({cleared:!0,path:g(i).cache});return}let h=await v(i);if(r==="get"){if(!s[1]&&!t.keyPath){a(h);return}let e=h.document;for(let o of U(t,s[1]))e=e&&typeof e=="object"?e[o]:void 0;a(e??null);return}if(r==="set"||r==="unset"){let e=U(t,s[1]),o;if(r==="set"){let u=n(t,"value")??s[2];if(u===void 0)throw new f("config set requires a value. Use JSON for arrays, tables, numbers and booleans.");try{o=JSON.parse(u)}catch{o=u}}a(await P(i,n(t,"expectedRevision")??h.rawRevision,[r==="set"?{op:"set",path:e,value:o}:{op:"unset",path:e}]));return}throw new f(`Unknown config command: ${r}`)}l(G,"runConfigurationCommand");export{G as runConfigurationCommand};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as V,c as D}from"./chunk-BZMVB3GS.js";import{a as M}from"./chunk-6MI4KKWF.js";import{a as J}from"./chunk-6FA3GG5B.js";import{c as U}from"./chunk-ZVOO7FKM.js";import"./chunk-GLUWATL5.js";import{b as n}from"./chunk-ES2ISFJC.js";import{c as k,f as O,g as te,h as q}from"./chunk-3M53YXEI.js";import{a as d}from"./chunk-FTQLQJQV.js";import{readFile as ge,writeFile as ye}from"node:fs/promises";import E from"node:path";import{createInterface as Ee}from"node:readline/promises";var Ae=Object.freeze({init:"openpond continual init --from ./tasks.jsonl",validate:"openpond continual validate ./continual-support.yaml",run:"openpond continual run ./continual-support.yaml",report:"openpond continual report <comparison-series-id>"});import{createHash as ke}from"node:crypto";function W(e){return`${JSON.stringify(G(e),null,2)}
|
|
3
|
+
`}d(W,"canonicalJson");function w(e){return ke("sha256").update(W(e)).digest("hex")}d(w,"contentHash");function G(e){return Array.isArray(e)?e.map(G):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).sort(([s],[t])=>s.localeCompare(t)).map(([s,t])=>[s,G(t)])):e}d(G,"normalize");function oe(e){let s=e.semanticSimilarityThreshold??.8;if(!(s>0&&s<=1))throw new Error("semanticSimilarityThreshold must be in (0, 1].");let t=new Set((e.allowSharedFamiliesBetween??[]).flatMap(([a,c])=>[`${a}\0${c}`,`${c}\0${a}`])),o=[];for(let a=0;a<e.panels.length;a+=1){let c=e.panels[a];for(let i=a+1;i<e.panels.length;i+=1){let f=e.panels[i];for(let l of c.tasks)for(let m of f.tasks){let g={leftPanel:c.id,rightPanel:f.id,leftTaskId:l.id,rightTaskId:m.id};if(l.id===m.id?o.push({...g,kind:"duplicate_id",similarity:1}):l.contentHash===m.contentHash&&o.push({...g,kind:"duplicate_content",similarity:1}),l.familyId===m.familyId&&!t.has(`${c.id}\0${f.id}`)&&o.push({...g,kind:"family_overlap",similarity:null}),l.prompt&&m.prompt){let u=Ie(l.prompt,m.prompt);u>=s&&o.push({...g,kind:"prompt_overlap",similarity:u})}}}}let r={schemaVersion:"openpond.continualBenchLeakageAudit.v1",threshold:s,findings:o.sort((a,c)=>JSON.stringify(a).localeCompare(JSON.stringify(c)))};return{...r,contentHash:w(r)}}d(oe,"auditContinualBenchLeakage");function Ie(e,s){let t=d(i=>new Set(i.toLowerCase().match(/[a-z0-9]+/g)??[]),"tokens"),o=t(e),r=t(s),a=new Set([...o,...r]);if(!a.size)return 1;let c=0;for(let i of o)r.has(i)&&(c+=1);return c/a.size}d(Ie,"jaccard");var S=n.string().trim().min(1).max(240),j=n.string().regex(/^[a-f0-9]{64}$/),Xe=n.object({id:S,contentHash:j}).strict(),ve=n.object({id:S,familyId:S,contentHash:j,prompt:n.string().max(1e6).optional(),payload:n.record(n.string(),n.unknown()).optional()}).strict(),Se=n.object({id:S,role:M,passLabel:S.nullable(),taskIds:n.array(S).min(1).max(1e6),disclosurePhase:n.enum(["review","evaluation","final"]),optimizerEligible:n.boolean()}).strict().superRefine((e,s)=>{let t=e.role==="correction"||e.role==="training_eligible";e.optimizerEligible!==t&&s.addIssue({code:"custom",path:["optimizerEligible"],message:"Only correction and training-eligible panels may be optimizer eligible."}),e.role==="frozen_final"&&e.disclosurePhase!=="final"&&s.addIssue({code:"custom",path:["disclosurePhase"],message:"The frozen-final panel may only be disclosed in the final phase."}),new Set(e.taskIds).size!==e.taskIds.length&&s.addIssue({code:"custom",path:["taskIds"],message:"Panel task ids must be unique."})}),Pe=n.object({label:S,familyIds:n.array(S).min(1).max(1e5)}).strict(),xe=n.object({adapter:n.literal("openpond"),apiBaseUrl:n.string().url().optional(),series:n.record(n.string(),n.unknown())}).strict(),T=n.object({schemaVersion:n.literal("openpond.continualBenchManifest.v1"),id:S,revision:n.number().int().positive(),name:n.string().trim().min(1).max(500),description:n.string().trim().min(1).max(2e4),license:n.string().trim().min(1).max(100),source:n.object({repository:n.string().trim().min(1).max(2e3).nullable(),commit:n.string().trim().min(1).max(500).nullable(),generatedBy:n.string().trim().min(1).max(2e3)}).strict(),split:n.object({seed:S,correctionCasesPerFamily:n.number().int().positive().max(100),correctionSelection:n.enum(["stable_hash","minimize_prompt_similarity"]),semanticSimilarityThreshold:n.number().gt(0).lte(1)}).strict(),passes:n.array(Pe).min(1).max(1e3),tasks:n.array(ve).min(1).max(1e6),panels:n.array(Se).min(1).max(1e5),grader:n.object({id:S,contentHash:j,outcomeScale:n.object({minimum:n.number().finite(),maximum:n.number().finite()}).strict()}).strict(),evaluation:n.object({seeds:n.array(n.number().int()).min(1).max(100),repetitions:n.number().int().positive().max(100),confidenceLevel:n.number().gt(0).lt(1),pairedBootstrapSamples:n.number().int().min(1e3).max(1e6)}).strict(),execution:xe.optional(),contentHash:j}).strict().superRefine((e,s)=>{let t=e.tasks.map(i=>i.id);new Set(t).size!==t.length&&s.addIssue({code:"custom",path:["tasks"],message:"Manifest task ids must be unique."});let o=new Set(t);for(let[i,f]of e.panels.entries())f.taskIds.some(l=>!o.has(l))&&s.addIssue({code:"custom",path:["panels",i,"taskIds"],message:"Every panel task must exist in the manifest inventory."});let r=e.passes.map(i=>i.label);new Set(r).size!==r.length&&s.addIssue({code:"custom",path:["passes"],message:"Pass labels must be unique."});let a=new Set(e.tasks.map(i=>i.familyId)),c=e.passes.flatMap(i=>i.familyIds);new Set(c).size!==c.length&&s.addIssue({code:"custom",path:["passes"],message:"An issue family may belong to only one pass."}),c.some(i=>!a.has(i))&&s.addIssue({code:"custom",path:["passes"],message:"Every assigned family must exist in the task inventory."})});function se(e){return T.parse({...e,contentHash:w(e)})}d(se,"sealPortableManifest");function ie(e){let s=T.parse(e),{contentHash:t,...o}=s;return t===w(o)}d(ie,"verifyPortableManifest");var L=n.string().trim().min(1).max(240),K=n.string().regex(/^[a-f0-9]{64}$/),Y=n.number().finite().nullable(),Ce=n.object({attemptId:L,seed:n.number().int(),repetition:n.number().int().nonnegative(),score:Y,passed:n.boolean().nullable(),latencyMs:n.number().nonnegative().nullable(),costUsd:n.number().nonnegative().nullable(),transcript:n.object({path:n.string().min(1),contentHash:K}).strict().nullable(),trace:n.object({path:n.string().min(1),contentHash:K}).strict().nullable(),graderOutputHash:K.nullable(),status:n.enum(["completed","failed","cancelled"])}).strict(),re=n.object({targetId:L,panelId:L,panelRole:M,taskId:L,familyId:L,attempts:n.array(Ce).min(1).max(1e4),meanScore:Y,passRate:Y,confidenceInterval:n.tuple([n.number().finite(),n.number().finite()]).nullable()}).strict(),ae=n.object({targetId:L,trainingGpuSeconds:n.number().nonnegative().nullable(),evaluationGpuSeconds:n.number().nonnegative().nullable(),providerSpendUsd:n.number().nonnegative().nullable(),totalSpendUsd:n.number().nonnegative().nullable(),durationSeconds:n.number().nonnegative().nullable(),optimizerGroups:n.number().int().nonnegative().nullable(),trajectories:n.number().int().nonnegative().nullable()}).strict(),le=n.enum(["systems_complete","correction_absorbed","issue_generalized","continually_current","frontier_pareto_result","inconclusive","loss"]);function ce(e){let s=[],t=[...e.families].sort((o,r)=>o.passLabel.localeCompare(r.passLabel));for(let o of t)s.push(F({id:`${o.passLabel.toLowerCase()}-correction`,role:"correction",passLabel:o.passLabel,taskIds:o.correctionTaskIds,familyIds:[o.familyId],optimizerEligible:!0})),s.push(F({id:`${o.passLabel.toLowerCase()}-siblings`,role:"sibling_verification",passLabel:o.passLabel,taskIds:o.siblingTaskIds,familyIds:[o.familyId],optimizerEligible:!1}));for(let o=0;o<t.length;o+=1){let r=t.slice(0,o+1);s.push(F({id:`known-${r[o].passLabel.toLowerCase()}`,role:"cumulative_known",passLabel:r[o].passLabel,taskIds:r.flatMap(a=>[...a.correctionTaskIds,...a.siblingTaskIds]),familyIds:r.map(a=>a.familyId),optimizerEligible:!1}))}return s.push(F({id:"training-eligible",role:"training_eligible",passLabel:null,taskIds:t.flatMap(o=>o.correctionTaskIds),familyIds:t.map(o=>o.familyId),optimizerEligible:!0})),s}d(ce,"createContinualBenchPanelAllocations");function Q(e){let s=new Set(["sibling_verification","development","retained","frozen_final"]),t=new Set(e.panels.filter(a=>s.has(a.role)).flatMap(a=>a.taskIds)),r=e.panels.filter(a=>a.optimizerEligible).flatMap(a=>a.taskIds).filter(a=>t.has(a));if(r.length)throw new Error(`Hidden evaluation tasks are optimizer eligible: ${[...new Set(r)].sort().join(", ")}`)}d(Q,"assertOptimizerIsolation");function F(e){let s={...e,taskIds:[...e.taskIds].sort(),familyIds:[...e.familyIds].sort()};return{...s,contentHash:w(s)}}d(F,"sealPanel");function A(e){let s=T.safeParse(e);if(!s.success)return{valid:!1,manifestHash:null,leakageHash:null,issues:s.error.issues.map(i=>({severity:"error",code:"schema",message:i.message,path:i.path.join(".")}))};let t=s.data,o=[];ie(t)||o.push({severity:"error",code:"content_hash",message:"Manifest contentHash does not match its canonical payload.",path:"contentHash"});let r=new Map(t.tasks.map(i=>[i.id,i])),a=[];for(let i of t.passes){let f=t.panels.find(u=>u.role==="correction"&&u.passLabel===i.label),l=t.panels.find(u=>u.role==="sibling_verification"&&u.passLabel===i.label);if(!f||!l){o.push({severity:"error",code:"missing_holdout",message:`Pass ${i.label} requires both correction and sibling-verification panels.`,path:"panels"});continue}a.push([f.id,l.id]);let m=new Set(f.taskIds.map(u=>r.get(u)?.familyId)),g=new Set(l.taskIds.map(u=>r.get(u)?.familyId));for(let u of i.familyIds)(!m.has(u)||!g.has(u))&&o.push({severity:"error",code:"insufficient_family",message:`Pass ${i.label} family ${u} lacks a correction or sibling case; the holdout was not weakened.`,path:"passes"})}let c=oe({panels:t.panels.filter(i=>i.role!=="cumulative_known"&&i.role!=="training_eligible").map(i=>({id:i.id,tasks:i.taskIds.map(f=>{let l=r.get(f);return{id:l.id,familyId:l.familyId,contentHash:l.contentHash,prompt:l.prompt}})})),allowSharedFamiliesBetween:a,semanticSimilarityThreshold:t.split.semanticSimilarityThreshold});for(let i of c.findings)o.push({severity:"error",code:`leakage_${i.kind}`,message:`${i.leftTaskId} in ${i.leftPanel} overlaps ${i.rightTaskId} in ${i.rightPanel}.`,path:"panels"});return{valid:!o.some(i=>i.severity==="error"),manifestHash:t.contentHash,issues:o,leakageHash:c.contentHash}}d(A,"validateContinualBenchManifest");function de(e){let s=A(e);if(!s.valid)throw new Error(s.issues.map(t=>`${t.code}: ${t.message}`).join(`
|
|
4
|
+
`));return T.parse(e)}d(de,"requireValidContinualBenchManifest");var R=n.string().trim().min(1).max(240),me=n.string().regex(/^[a-f0-9]{64}$/),_e=n.object({id:R,label:n.string().trim().min(1).max(500),kind:n.enum(["candidate","accepted_head","base","master","external_reference"]),ordinal:n.number().int().nonnegative().nullable(),meanScore:n.number().finite().nullable(),confidenceInterval:n.tuple([n.number().finite(),n.number().finite()]).nullable(),taskMetrics:n.array(re).max(1e6),efficiency:ae.nullable(),evidenceUrl:n.string().url().nullable()}).strict(),pe=n.object({schemaVersion:n.literal("openpond.continualBenchReport.v1"),seriesId:R,protocol:n.object({id:R,revision:n.number().int().positive(),contentHash:me}).strict(),generatedAt:n.string().datetime({offset:!0}),status:n.enum(["partial","terminal"]),points:n.array(_e).min(1).max(1e4),outcomes:n.array(le).max(7),audit:n.array(n.object({requirement:R,status:n.enum(["passed","failed","unavailable"]),evidenceRefs:n.array(R).max(1e5)}).strict()).max(1e4),chart:n.object({x:n.literal("ordinal"),y:n.literal("meanScore"),series:n.array(n.object({pointId:R,label:n.string(),ordinal:n.number().nullable(),value:n.number().nullable(),lower:n.number().nullable(),upper:n.number().nullable(),kind:n.string()}).strict())}).strict(),contentHash:me}).strict();function ue(e){let s={x:"ordinal",y:"meanScore",series:e.points.map(o=>({pointId:o.id,label:o.label,ordinal:o.ordinal,value:o.meanScore,lower:o.confidenceInterval?.[0]??null,upper:o.confidenceInterval?.[1]??null,kind:o.kind}))},t={...e,chart:s};return pe.parse({...t,contentHash:w(t)})}d(ue,"createContinualBenchReport");function fe(e){let s=pe.parse(e),{contentHash:t,...o}=s;if(t!==w(o))throw new Error("Continual Support report content hash does not match its payload.");return W(s)}d(fe,"exportContinualBenchReport");function be(e){let s=e.correctionCasesPerFamily??1;if(!Number.isInteger(s)||s<1)throw new Error("correctionCasesPerFamily must be a positive integer.");let t=new Map,o=new Map;for(let l of e.tasks){if(t.has(l.id))throw new Error(`Duplicate task id: ${l.id}`);t.set(l.id,l);let m=o.get(l.familyId)??[];m.push(l),o.set(l.familyId,m)}let r=new Map;for(let l of e.passes){if(!l.label.trim())throw new Error("Pass labels cannot be empty.");for(let m of l.familyIds){if(r.has(m))throw new Error(`Family ${m} is assigned to more than one pass.`);r.set(m,l.label)}}let a=[],c=[],i=[];for(let[l,m]of[...o].sort(([g],[u])=>g.localeCompare(u))){let g=r.get(l);if(!g){i.push({code:"unassigned_family",familyId:l,taskCount:m.length});continue}let u=[...m].sort((y,v)=>{let P=w([e.seed,l,y.id,y.contentHash]),h=w([e.seed,l,v.id,v.contentHash]);return P.localeCompare(h)||y.id.localeCompare(v.id)});if(u.length<=s){i.push({code:"insufficient_siblings",familyId:l,taskCount:u.length});continue}e.correctionSelection==="minimize_prompt_similarity"&&s===1&&u.every(y=>y.prompt)&&(u=[...u].sort((y,v)=>{let P=he(y,u),h=he(v,u);return P-h||y.id.localeCompare(v.id)}));let I=u.slice(0,s),$=u.slice(s);a.push(...I.map(y=>({...y,passLabel:g,panelRole:"correction",optimizerEligible:!0})),...$.map(y=>({...y,passLabel:g,panelRole:"sibling_verification",optimizerEligible:!1}))),c.push({familyId:l,passLabel:g,correctionTaskIds:I.map(y=>y.id),siblingTaskIds:$.map(y=>y.id)})}for(let l of r.keys())if(!o.has(l))throw new Error(`Assigned family ${l} has no source tasks.`);let f={schemaVersion:"openpond.continualBenchSplit.v1",seed:e.seed,allocations:a.sort((l,m)=>l.passLabel.localeCompare(m.passLabel)||l.familyId.localeCompare(m.familyId)||l.id.localeCompare(m.id)),families:c.sort((l,m)=>l.passLabel.localeCompare(m.passLabel)||l.familyId.localeCompare(m.familyId)),advisories:i.sort((l,m)=>l.familyId.localeCompare(m.familyId)||l.code.localeCompare(m.code))};return{...f,contentHash:w(f)}}d(be,"createContinualBenchSplit");function he(e,s){return Math.max(...s.filter(t=>t.id!==e.id).map(t=>$e(e.prompt,t.prompt)))}d(he,"maximumSiblingSimilarity");function $e(e,s){let t=d(i=>new Set(i.toLowerCase().match(/[a-z0-9]+/g)??[]),"tokenize"),o=t(e),r=t(s),a=new Set([...o,...r]);if(!a.size)return 1;let c=0;for(let i of o)r.has(i)&&(c+=1);return c/a.size}d($e,"jaccard");async function et(e,s,t={}){let o=s[0];if(!o||!["init","validate","run","report"].includes(o))throw new Error("usage: openpond continual <init|validate|run|report> [manifest-or-series-id]");let r=t.log??console.log;if(o==="init"){await He(e,s.slice(1),t,r);return}if(o==="report"){await Re(e,s.slice(1),t,r);return}let a=s[1];if(!a||s.length!==2)throw new Error(`usage: openpond continual ${o} <manifest-path>`);let c=await ze(E.resolve(a),t.readFile??ge),i=A(c);if(o==="validate"){if(O(e.json))r(JSON.stringify(i,null,2));else{r(i.valid?`Valid Continual Support manifest ${i.manifestHash}.`:"Continual Support manifest is invalid."),r(`Leakage audit ${i.leakageHash??"unavailable"}; ${i.issues.length} finding(s).`);for(let l of i.issues)r(`${l.severity}: ${l.code} at ${l.path}: ${l.message}`)}if(!i.valid)throw Fe("Continual Support validation failed.",2);return}let f=de(c);Q(f),await Le(f,e,t,r)}d(et,"runContinualCommand");async function He(e,s,t,o){if(s.length)throw new Error("continual init accepts --from and --output options, not positional arguments.");let r=k(e,"from");if(!r)throw new Error("continual init requires --from <tasks.json|tasks.jsonl>.");let a=E.resolve(k(e,"output")||"continual-support.yaml"),c=await Be(E.resolve(r),t.readFile??ge),i=O(e.nonInteractive)||!process.stdin.isTTY,f=t.prompt??Me,l=await Oe(c,i,f),m=l.filter(p=>p.panelRole===null||p.panelRole==="correction"||p.panelRole==="sibling_verification"),g=[...new Map(m.map(p=>[p.passLabel,p])).keys()].sort().map(p=>({label:p,familyIds:[...new Set(m.filter(_=>_.passLabel===p).map(_=>_.familyId))].sort()})),u=l.map(p=>({id:p.id,familyId:p.familyId,contentHash:w(p.payload),...p.prompt?{prompt:p.prompt}:{},payload:p.payload})),I=be({tasks:m.map(p=>({id:p.id,familyId:p.familyId,contentHash:w(p.payload),prompt:p.prompt})),passes:g,seed:k(e,"seed")||"continual-support-v1",correctionCasesPerFamily:q(e.correctionCasesPerFamily,"correction-cases-per-family")??1,correctionSelection:k(e,"correctionSelection")==="stable_hash"?"stable_hash":"minimize_prompt_similarity"});if(I.advisories.length)throw new Error(`The proposed split is incomplete and was not weakened: ${I.advisories.map(p=>`${p.code}:${p.familyId}`).join(", ")}`);let $=ce(I).map(p=>({id:p.id,role:p.role,passLabel:p.passLabel,taskIds:p.taskIds,disclosurePhase:p.role==="sibling_verification"?"evaluation":"review",optimizerEligible:p.optimizerEligible})),y=["development","retained","frozen_final"];for(let p of y){let _=l.filter(x=>x.panelRole===p).map(x=>x.id).sort();_.length&&$.push({id:p.replace("_","-"),role:p,passLabel:null,taskIds:_,disclosurePhase:p==="frozen_final"?"final":"evaluation",optimizerEligible:!1})}let v=k(e,"id")||je(k(e,"name")||E.basename(r,E.extname(r))),P=k(e,"grader")||"user-supplied-grader-v1",h={schemaVersion:"openpond.continualBenchManifest.v1",id:v,revision:1,name:k(e,"name")||v,description:k(e,"description")||"A sealed continual-support workflow converted from an ordinary task set.",license:k(e,"license")||"UNSPECIFIED",source:{repository:k(e,"repository")||null,commit:k(e,"commit")||null,generatedBy:`openpond continual init --from ${r}`},split:{seed:I.seed,correctionCasesPerFamily:q(e.correctionCasesPerFamily,"correction-cases-per-family")??1,correctionSelection:k(e,"correctionSelection")==="stable_hash"?"stable_hash":"minimize_prompt_similarity",semanticSimilarityThreshold:te(e.semanticSimilarityThreshold,"semantic-similarity-threshold")??.8},passes:g,tasks:u,panels:$,grader:{id:P,contentHash:w({id:P}),outcomeScale:{minimum:0,maximum:1}},evaluation:{seeds:[1701,1709,1721],repetitions:3,confidenceLevel:.95,pairedBootstrapSamples:1e4}},H=se(h),ne=a.endsWith(".json")?`${JSON.stringify(H,null,2)}
|
|
5
|
+
`:J.dump(H,{noRefs:!0,lineWidth:120,sortKeys:!1});await(t.writeFile??ye)(a,ne,"utf8"),o(`Created ${a}.`),o(`Manifest ${H.contentHash}; split ${I.contentHash}.`)}d(He,"initializeManifest");async function Le(e,s,t,o){if(!e.execution)throw new Error("This manifest validates locally but needs an execution.openpond series binding before `continual run`.");let r={...e.execution.series},a=r.benchmarkProtocol,c=C(a?.issueFamilyLedger);if(!a||c.contentHash!==e.contentHash)throw new Error("execution.series.benchmarkProtocol.issueFamilyLedger must bind the exact sealed portable manifest hash.");let i=U(s)??e.execution.apiBaseUrl??process.env.OPENPOND_LOCAL_API_URL?.replace(/\/$/,"")??V,f=t.request??await D(i),l=C(await X(f,`${i}/v1/training/comparison-series`,"POST",{series:r})),m=b(l.id)||b(r.id),g=ee(l.revision);if(!m||!g)throw new Error("OpenPond did not return a Comparison Series identity and revision.");await X(f,`${i}/v1/training/comparison-series/${encodeURIComponent(m)}/seal`,"POST",{expectedRevision:g});let u=`/models/comparisons/${encodeURIComponent(m)}`,I={comparisonSeriesId:m,canonicalUrl:u,protocolHash:e.contentHash};o(O(s.json)?JSON.stringify(I,null,2):`Created and sealed Comparison Series ${m}.
|
|
6
|
+
${u}
|
|
7
|
+
No release was queued or started.`)}d(Le,"submitManifest");async function Re(e,s,t,o){let r=s[0];if(!r||s.length!==1)throw new Error("usage: openpond continual report <comparison-series-id> [--output <path>]");let a=U(e)??process.env.OPENPOND_LOCAL_API_URL?.replace(/\/$/,"")??V,c=t.request??await D(a),i=C(await X(c,`${a}/v1/training`,"GET")),f=N(i.comparisonSeries).map(C).find(h=>h.id===r);if(!f)throw new Error(`Comparison Series ${r} was not found.`);let l=C(f.benchmarkProtocol),m=N(i.comparisonSeriesEntries).map(C).filter(h=>h.seriesId===r),g=N(i.modelCurrencySnapshots).map(C).filter(h=>h.seriesId===r),u=new Map(g.map(h=>[b(h.entryId),h])),I=m.filter(h=>b(h.modelVersionId)).map(h=>{let H=u.get(b(h.id)),p=N(H?.panels).map(C).map(B=>z(B.strictSuccess)).filter(B=>B!==null),_=p.length?p.reduce((B,we)=>B+we,0)/p.length:null,x=Z(H?.efficiency);return{id:b(h.id),label:b(h.label),kind:"candidate",ordinal:z(h.ordinal),meanScore:_,confidenceInterval:null,taskMetrics:[],efficiency:x?{targetId:b(h.modelVersionId),trainingGpuSeconds:z(x.gpuSeconds),evaluationGpuSeconds:null,providerSpendUsd:null,totalSpendUsd:z(x.costUsd),durationSeconds:z(x.latencyMs)===null?null:z(x.latencyMs)/1e3,optimizerGroups:null,trajectories:null}:null,evidenceUrl:`${a}/models/comparisons/${encodeURIComponent(r)}`}});if(!I.length)throw new Error(`Comparison Series ${r} has no receipt-derived candidate points to report.`);let $=m.every(h=>["candidate","accepted","rejected","no_signal","failed","cancelled"].includes(b(h.status)||"")),y=ue({schemaVersion:"openpond.continualBenchReport.v1",seriesId:r,protocol:{id:b(l.id),revision:ee(l.revision),contentHash:b(l.contentHash)},generatedAt:new Date().toISOString(),status:$?"terminal":"partial",points:I,outcomes:[],audit:[{requirement:"receipt-derived-points",status:"passed",evidenceRefs:I.map(h=>h.id)}]}),v=fe(y),P=k(e,"output");P?(await(t.writeFile??ye)(E.resolve(P),v,"utf8"),o(`Wrote ${E.resolve(P)} (${y.contentHash}).`)):o(v.trimEnd())}d(Re,"exportReport");async function ze(e,s){let t=await s(e,"utf8");return e.endsWith(".json")?JSON.parse(t):J.load(t)}d(ze,"loadStructuredFile");async function Be(e,s){let t=await s(e,"utf8"),o=e.endsWith(".jsonl")?t.split(/\r?\n/).filter(r=>r.trim()).map((r,a)=>{try{return JSON.parse(r)}catch{throw new Error(`Invalid JSONL at line ${a+1}.`)}}):JSON.parse(t);if(!Array.isArray(o)||!o.length)throw new Error("The source must contain a non-empty JSON array or JSONL sequence.");return o.map((r,a)=>Te(r,a))}d(Be,"readSourceRows");function Te(e,s){let t=C(e),o=b(t.id)||b(t.taskId)||b(t.task_id);if(!o)throw new Error(`Source row ${s+1} is missing id/taskId.`);let r=b(t.familyId)||b(t.family_id)||b(t.clusterKey),a=b(t.passLabel)||b(t.pass_label),c=b(t.panelRole)||b(t.panel_role);if(c&&!new Set(["correction","sibling_verification","cumulative_known","development","retained","frozen_final","training_eligible"]).has(c))throw new Error(`Source row ${o} has unsupported panel role ${c}.`);return{id:o,familyId:r,passLabel:a,panelRole:c,prompt:b(t.prompt)||b(Z(t.input)?.prompt)||void 0,payload:t}}d(Te,"normalizeSourceRow");async function Oe(e,s,t){let o=[],r=new Map;for(let a of e){let c=a.familyId;if(!c){if(s)throw new Error(`Task ${a.id} lacks familyId; non-interactive init never fabricates issue families.`);if(c=(await t(`Issue family for ${a.id}: `)).trim(),!c)throw new Error(`Task ${a.id} requires an issue family.`)}let i=a.passLabel;if(!a.panelRole||a.panelRole==="correction"||a.panelRole==="sibling_verification"){if(i=i||r.get(c)||null,!i){if(s)throw new Error(`Task family ${c} lacks passLabel; provide labels for CI.`);i=(await t(`Pass label for family ${c}: `)).trim()}if(!i)throw new Error(`Family ${c} requires a pass label.`);let f=r.get(c);if(f&&f!==i)throw new Error(`Family ${c} appears in both ${f} and ${i}.`);r.set(c,i)}o.push({...a,familyId:c,passLabel:i})}return o}d(Oe,"completeLabels");async function Me(e){let s=Ee({input:process.stdin,output:process.stdout});try{return await s.question(e)}finally{s.close()}}d(Me,"defaultPrompt");async function X(e,s,t,o){let r=await e(s,{method:t,headers:o===void 0?{Accept:"application/json"}:{Accept:"application/json","Content-Type":"application/json"},body:o===void 0?void 0:JSON.stringify(o)}),a=await r.text(),c=a?JSON.parse(a):null;if(!r.ok)throw new Error(`OpenPond request failed (${r.status}): ${b(Z(c)?.error)||r.statusText}`);return c}d(X,"requestJson");function C(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}d(C,"object");function Z(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}d(Z,"objectOrNull");function N(e){return Array.isArray(e)?e:[]}d(N,"array");function b(e){return typeof e=="string"&&e.trim()?e.trim():null}d(b,"string");function ee(e){return typeof e=="number"&&Number.isFinite(e)?e:null}d(ee,"number");function z(e){return ee(e)}d(z,"numberOrNull");function je(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"continual-support"}d(je,"slug");function Fe(e,s){return Object.assign(new Error(e),{exitCode:s})}d(Fe,"withExitCode");export{et as runContinualCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"./chunk-GEANXBLX.js";import"./chunk-CCJG7GLE.js";import"./chunk-ZVOO7FKM.js";import"./chunk-OGPHXXCD.js";import"./chunk-EG3XB6M6.js";import"./chunk-NVGMZ2IN.js";import"./chunk-KDXLNQNF.js";import"./chunk-CWQWV2T3.js";import"./chunk-XAYIETBO.js";import"./chunk-GLUWATL5.js";import"./chunk-I7G35U7K.js";import"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-T5XCPX4P.js";import"./chunk-3M53YXEI.js";import"./chunk-FTQLQJQV.js";export{m as resolveGitBranch,f as runAccount,j as runBacktestRun,p as runCheckUpdate,k as runDeployWatch,g as runHealth,d as runLogin,o as runOpentool,e as runProfiles,l as runRepoCreate,n as runRepoPush,b as runTemplateBranches,a as runTemplateStatus,c as runTemplateUpdate,h as runToolList,i as runToolRun};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{m as a,n as b,o as c,p as d,q as e,r as f,s as g}from"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as PERSISTENCE_TABLES_SQL,g as deleteLocalRecord,d as getLocalRecord,e as listLocalRecords,b as openStorageDatabase,f as putLocalRecord,c as withLocalDatabase};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{x as f}from"./chunk-CCJG7GLE.js";import"./chunk-ZVOO7FKM.js";import"./chunk-OGPHXXCD.js";import"./chunk-EG3XB6M6.js";import"./chunk-NVGMZ2IN.js";import"./chunk-KDXLNQNF.js";import"./chunk-CWQWV2T3.js";import"./chunk-XAYIETBO.js";import"./chunk-GLUWATL5.js";import{a as c}from"./chunk-I7G35U7K.js";import"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-T5XCPX4P.js";import{c as p,f as u}from"./chunk-3M53YXEI.js";import{a as r}from"./chunk-FTQLQJQV.js";import d from"node:path";import{access as v}from"node:fs/promises";import{constants as C}from"node:fs";import{createRequire as P}from"node:module";var l=d.join("scripts","desktop-harness.ts");async function $(n,t){let o=await j({options:n,rest:t}),e=await f(o.command,o.args,{cwd:o.cwd,inherit:!0,timeoutMs:0});if(e.code!==0)throw new m(e.code)}r($,"runDesktopTestCommand");async function j(n){let t=n.options,o=n.rest,e=o[0];if(e!=="run"&&e!=="attach")throw new c(D());let a=o.slice(1);if(a.length===0)throw new c("usage: openpond desktop-test run <scenario...> [options]");let g=p(t,"cwd")||n.cwd||process.cwd(),w=await O(g),k=(n.env??process.env).OPENPOND_NODE_BINARY?.trim()||process.execPath,s=[P(import.meta.url).resolve("tsx/cli"),l,"run",...a],h=x(t,e);return h&&s.push(`--${h}`),i(s,"--app",t,"app"),i(s,"--server",t,"server"),i(s,"--token",t,"token"),i(s,"--token-file",t,"tokenFile"),i(s,"--devtools-port",t,"devtoolsPort"),i(s,"--artifacts-dir",t,"artifactsDir"),H(s,t),i(s,"--grep",t,"grep"),i(s,"--timeout-ms",t,"timeoutMs"),u(t.keepHome)&&s.push("--keep-home"),{command:k,args:s,cwd:w}}r(j,"buildDesktopHarnessInvocation");async function O(n){let t=d.resolve(n);for(;;){let o=d.join(t,l);if(await R(o))return t;let e=d.dirname(t);if(e===t)throw new c(`Could not find ${l}. Run this command from the OpenPond source checkout or pass --cwd <repo>.`);t=e}}r(O,"resolveDesktopHarnessRepoRoot");function x(n,t){let o=t==="attach"?"attach":null;for(let e of["isolated","attach","packaged","none"])if(u(n[e])){if(o&&o!==e)throw new c("Choose only one desktop harness launch mode: --isolated, --attach, --packaged, or --none.");o=e}return o}r(x,"resolveLaunchMode");function i(n,t,o,e){let a=p(o,e);a&&n.push(t,a)}r(i,"appendStringFlag");function H(n,t){let o=p(t,"json"),e=p(t,"jsonPath");if(o&&y(o))throw new c("harness --json requires a report path. Use --json <path> or --json-path <path>.");if(o&&e&&o!==e)throw new c("Use only one JSON report path: --json <path> or --json-path <path>.");let a=o||e;a&&n.push("--json",a)}r(H,"appendJsonFlag");function y(n){return/^(true|false|1|0|yes|no)$/i.test(n)}r(y,"isBooleanLiteral");async function R(n){try{return await v(n,C.R_OK),!0}catch{return!1}}r(R,"fileExists");function D(){return["usage: openpond desktop-test run <scenario...> [options]"," openpond desktop-test attach <scenario...> [options]","","Options include --isolated, --attach, --packaged, --none, --app <path>,","--server <url>, --token <token>, --token-file <path>, --devtools-port <port>, --artifacts-dir <path>,","--json <path>, --json-path <path>, --grep <pattern>, --timeout-ms <ms>,","--keep-home, and --cwd <repo>."].join(`
|
|
3
|
+
`)}r(D,"desktopHarnessCliUsage");var m=class extends Error{static{r(this,"HarnessCommandFailedError")}exitCode;constructor(t){let o=typeof t=="number"&&t>0?t:1;super(`desktop harness failed with exit code ${o}`),this.name="HarnessCommandFailedError",this.exitCode=o}};export{j as buildDesktopHarnessInvocation,O as resolveDesktopHarnessRepoRoot,$ as runDesktopTestCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{$a as xa,Aa as Y,Ba as Z,Ca as _,Da as $,Ea as aa,Fa as ba,Ga as ca,Ha as da,Ia as ea,Ja as fa,Ka as ga,La as ha,Ma as ia,Na as ja,Oa as ka,Pa as la,Qa as ma,Ra as na,Sa as oa,Ta as pa,Ua as qa,Va as ra,Wa as sa,Xa as ta,Ya as ua,Za as va,_a as wa,a as l,ab as ya,b as m,bb as za,c as n,cb as Aa,d as o,db as Ba,e as p,ea as v,eb as Ca,f as q,fa as w,fb as Da,g as r,ga as x,gb as Ea,h as s,ha as y,hb as Fa,i as t,ia as z,ib as Ga,j as u,ja as A,jb as Ha,ka as B,kb as Ia,la as C,ma as D,na as E,oa as F,pa as G,qa as H,ra as I,sa as J,ta as K,ua as L,va as M,wa as N,xa as O,ya as W,za as X}from"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import{a,b,c,d,e,f,g,h,i,k as j,l as k,m as P,n as Q,o as R,p as S,q as T,r as U,s as V}from"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{Ca as CLIENT_CHOICE_KEYS,Ba as ClientChoicesSchema,w as ConfigSchema,v as CredentialReferenceSchema,L as LAYOUT_PREFERENCE_KEYS,l as MISSING_REVISION,na as MigrationResolutionsSchema,P as PERSISTENCE_TABLES_SQL,c as PersistenceError,ea as accountId,r as acquireFileLock,ja as artifactReference,za as assertConfigRunCurrent,Ia as assertHomeCompatible,k as assertStorageAncestors,p as atomicWriteFile,b as bindHomeCallbacks,ya as captureConfigRun,Z as clearCache,ma as collectArtifactOrphans,F as configEditorSchema,C as configRecoveryRevisions,N as configToPreferences,da as credentialVersions,ba as deleteCredential,V as deleteLocalRecord,y as diffConfig,Aa as effectivePreferences,g as expandHome,Fa as exportRecoveryBackup,Ha as exportSettings,m as fileRevision,S as getLocalRecord,qa as initializeHome,e as isMissing,O as layoutPreferences,Y as listCache,T as listLocalRecords,J as mergeConfig,ca as newCredentialId,Q as openStorageDatabase,H as patchConfig,d as persistenceIssue,M as preferencesToConfig,o as privateDirectory,s as processIsDead,j as protectPrivateDirectory,ia as publishManagedArtifact,U as putLocalRecord,fa as readAccountConfiguration,W as readCache,Da as readClientChoices,G as readConfig,_ as readCredential,$ as readCredentials,t as readJsonFile,oa as readMigrationJournal,n as readOptionalFile,ua as readPreferences,sa as recoverMigration,la as releaseArtifactReference,B as rememberValidConfig,D as replaceConfigText,i as resolveConfigPath,xa as resolveEffectiveConfig,f as resolveOpenPondHome,pa as resolveStoredPath,ta as restartMigration,E as restoreConfigRevision,Ga as restoreRecoveryBackup,z as serializeConfig,wa as setProjectTrust,h as storagePaths,ga as updateAccountConfiguration,Ea as updateClientChoices,I as updateConfig,u as updateJsonFile,va as updatePreferences,x as validateConfigDocument,A as validateConfigText,ha as validateManagedArtifacts,ra as validateMigratedHome,K as watchConfig,q as withFileLock,R as withLocalDatabase,ka as withManagedArtifact,a as withOpenPondHome,X as writeCache,aa as writeCredential};
|