openpond 0.2.23 → 0.2.25
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.js +1 -1
- package/dist/chunks/actions-command-S27YU6NW.js +2 -0
- package/dist/chunks/{app-layer-4CK6ZEKN.js → app-layer-57323XKJ.js} +1 -1
- package/dist/chunks/app-server-runtime-QIIJ3KQJ.js +2 -0
- package/dist/chunks/apps-U3TXSPU6.js +2 -0
- package/dist/chunks/{chunk-MD7IADMT.js → chunk-3YSCXFE6.js} +3 -3
- package/dist/chunks/chunk-4KDHMGKI.js +2 -0
- package/dist/chunks/{chunk-NS3VMSTX.js → chunk-5WFXFKLA.js} +2 -2
- package/dist/chunks/chunk-6LY7GYNK.js +2 -0
- package/dist/chunks/{chunk-BZMVB3GS.js → chunk-6XF4GI35.js} +1 -1
- package/dist/chunks/{chunk-73KFNV3D.js → chunk-7TV2VBSD.js} +1 -1
- package/dist/chunks/{chunk-CXDS2LSW.js → chunk-AC2M2HO3.js} +1 -1
- package/dist/chunks/{chunk-ZVOO7FKM.js → chunk-BSHAIAXY.js} +1 -1
- package/dist/chunks/{chunk-QWE3RHNY.js → chunk-C5OV4XWF.js} +1 -1
- package/dist/chunks/{chunk-WYHHDJEG.js → chunk-D6BBQHZM.js} +12 -12
- package/dist/chunks/{chunk-JS6MS2NR.js → chunk-F3VURV3Q.js} +2 -2
- package/dist/chunks/chunk-F4WS5QIT.js +54 -0
- package/dist/chunks/{chunk-V4ACXLID.js → chunk-GOQDMRUV.js} +1 -1
- package/dist/chunks/chunk-J3ZRHNGL.js +2 -0
- package/dist/chunks/{chunk-T3VPZRIX.js → chunk-JTX6QZEP.js} +1 -1
- package/dist/chunks/{chunk-H75VJFMZ.js → chunk-KLSLHUTO.js} +1 -1
- package/dist/chunks/{chunk-Q76GR2JM.js → chunk-M4CJXPMH.js} +1 -1
- package/dist/chunks/chunk-M4VGRNP6.js +2 -0
- package/dist/chunks/{chunk-XDVKDELR.js → chunk-RBQZVQQM.js} +1 -1
- package/dist/chunks/chunk-TJNIYJUH.js +2 -0
- package/dist/chunks/{chunk-CTC5EYSH.js → chunk-TR37PJIQ.js} +3 -3
- package/dist/chunks/{chunk-3XUBKIBN.js → chunk-UBHTZJEV.js} +1 -1
- package/dist/chunks/{chunk-V2BBMZ7I.js → chunk-WK5HTGXV.js} +1 -1
- package/dist/chunks/chunk-XRV4WLI7.js +2 -0
- package/dist/chunks/chunk-XWPC3AN4.js +1 -0
- package/dist/chunks/chunk-Y2NQXJ2Q.js +5 -0
- package/dist/chunks/{chunk-DWROB2J6.js → chunk-YNH6AUGE.js} +1 -1
- package/dist/chunks/cli-GGYPZNZC.js +2 -0
- package/dist/chunks/configuration-command-BASDSNVK.js +2 -0
- package/dist/chunks/{continual-OJYXVTIZ.js → continual-6EW2SLGL.js} +1 -1
- package/dist/chunks/core-commands-YQTVPPLJ.js +2 -0
- package/dist/chunks/desktop-test-JITAYXCK.js +3 -0
- package/dist/chunks/dist-5C6RYTQQ.js +2 -0
- package/dist/chunks/{extension-AZRG5IPK.js → extension-ZKWQ3ZPJ.js} +1 -1
- package/dist/chunks/{help-6IMGNP7A.js → help-SDEZHWZL.js} +1 -1
- package/dist/chunks/{opchat-OS7WAVZO.js → opchat-IOP37GN3.js} +1 -1
- package/dist/chunks/organizations-4LQEILYG.js +2 -0
- package/dist/chunks/{profile-A3YR3WVU.js → profile-MVLYUDLU.js} +1 -1
- package/dist/chunks/project-agent-DALYNEZ4.js +2 -0
- package/dist/chunks/sandbox-command-VHCKLKN5.js +2 -0
- package/dist/chunks/{sandbox-template-FK2TGQPK.js → sandbox-template-WY7XIMDK.js} +1 -1
- package/dist/chunks/{src-UIX7LWM7.js → src-22KEI2VU.js} +1 -1
- package/dist/chunks/{src-RZFKQSHW.js → src-R3FALV6F.js} +101 -101
- package/dist/chunks/taskset-YPKY3HUM.js +2 -0
- package/dist/chunks/{teams-bot-PASMNRFS.js → teams-bot-47H7LRFD.js} +1 -1
- package/dist/chunks/training-7PST5HZU.js +2 -0
- package/dist/chunks/{workspaces-YFAAPNVP.js → workspaces-RAHQXYWB.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/assets/{App-CZo3tYaG.js → App-BzNZ7ycx.js} +28 -28
- package/dist/web/assets/{AppDialog-18Y9aU8z.js → AppDialog-C3H3HARP.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-9jAU4wYe.js → AppTerminalPanel-DIXARKfe.js} +2 -2
- package/dist/web/assets/{AppsView-BCYnY9mm.js → AppsView-D0xPDTPJ.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-BVf3sUAG.js → BrowserSidebar-D5eE9O30.js} +1 -1
- package/dist/web/assets/{CartesianChart-iai9Dz1D.js → CartesianChart-KMVbiMJX.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-D7bZIwFC.js → CollaborationTabs-C1LTvUbK.js} +1 -1
- package/dist/web/assets/{CommandMenu-diFDbKQl.js → CommandMenu-C9elnZaI.js} +1 -1
- package/dist/web/assets/{CommunityView-DaLkwOxW.js → CommunityView-BvXxVHmL.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-B59nTCE7.js → ComposerCreateImproveStrip-Cwu8EaCb.js} +1 -1
- package/dist/web/assets/{GetStartedView-BETryURK.js → GetStartedView-BI1j30-I.js} +1 -1
- package/dist/web/assets/HostedModelLearningReview-Bwkg3lyV.js +1 -0
- package/dist/web/assets/{HostedModelLearningSettings-FCly06RA.js → HostedModelLearningSettings-DhaT1bxX.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-9MzQj6cy.js → LabModelVersionDetailPage-CeSm-sAq.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-BJHO5-J9.js → LabSkillSidebar-BzGs7EC8.js} +1 -1
- package/dist/web/assets/{LabsRoute-6jVWrbOO.js → LabsRoute-BQi8W0-2.js} +4 -4
- package/dist/web/assets/{MainChatThread-DAoPK8jG.js → MainChatThread-D3KXQ4Te.js} +2 -2
- package/dist/web/assets/{MainPane-LDPzuZSj.js → MainPane-J15DRf-n.js} +4 -4
- package/dist/web/assets/{MarkdownText-B8URwlq9.js → MarkdownText-BWIVACAt.js} +1 -1
- package/dist/web/assets/{Messages-Byk73D9T.js → Messages-BPbo8ih9.js} +1 -1
- package/dist/web/assets/{NativeSkillSidebar-BodHqCCH.js → NativeSkillSidebar-BeqI4dXF.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-BkUxxlOu.js → NewExperienceSwitcher-BggrQVIi.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-BZr2wm-4.js → NewProjectDialog-B4PTFf78.js} +1 -1
- package/dist/web/assets/{OutputsPage-C8ZDtD1Y.js → OutputsPage-DChjcyaP.js} +1 -1
- package/dist/web/assets/{ProjectsPage-CgfjGsl2.js → ProjectsPage-BdUkyg6I.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-DV3csVka.js → RightChatPanelStack-CLCOzLVJ.js} +1 -1
- package/dist/web/assets/{RightSidebarHomePanel-DvLaHLBb.js → RightSidebarHomePanel-qs2Fa4JQ.js} +1 -1
- package/dist/web/assets/{ScheduledWorkPage-DtzxPTAL.js → ScheduledWorkPage-DzehKDhk.js} +1 -1
- package/dist/web/assets/{SettingsView-C3sVxgPc.js → SettingsView-DJiJKYWW.js} +3 -3
- package/dist/web/assets/{TeamChatView-B-w2nrWF.js → TeamChatView-uGwanVsA.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-_X7WVAev.js → TerminalOverlay-DJNdErEp.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-DaVppW1m.js → TrainingCreationPanel-CwyKMNwt.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-CVj19T6L.js → TrainingDraftPanel-Rdusv4s_.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-fRTHVjhG.js → UsageSettingsSection-BkRalGcP.js} +1 -1
- package/dist/web/assets/{WorkSidebarPanel-CGOQwdIW.js → WorkSidebarPanel-d8PB-XNy.js} +1 -1
- package/dist/web/assets/{WorkspaceDiffPanel-D6hbMv14.js → WorkspaceDiffPanel-DfpyLroX.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-rWj1aDI4.js → WorkspaceEnvironmentMenu-DhUUB-lq.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-DVU5SrD-.js → WorkspaceGitDialogs-0juVLtVy.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-D78JPviN.js → WorkspaceMonacoEditor-Blo5esSN.js} +3 -3
- package/dist/web/assets/{arrow-up-right-CnaPKXjg.js → arrow-up-right-BXeo-8KJ.js} +1 -1
- package/dist/web/assets/{chat-file-links-D1INEr8r.js → chat-file-links-BEbA_E33.js} +1 -1
- package/dist/web/assets/chevron-up-Dx5rir4H.js +1 -0
- package/dist/web/assets/{clipboard-B8GTg8tx.js → clipboard-17OIp5F-.js} +1 -1
- package/dist/web/assets/{cloud-upload-BlEc_10E.js → cloud-upload-D28o8URw.js} +1 -1
- package/dist/web/assets/{cssMode-BiYvezMD.js → cssMode-DDPYV_bh.js} +1 -1
- package/dist/web/assets/{folder-open-BaNdbDD5.js → folder-open-CqBlANkk.js} +1 -1
- package/dist/web/assets/{folder-plus-BQhz_VxM.js → folder-plus-DkUnvZhx.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-wv523Ooq.js → git-commit-horizontal-BEIomQj0.js} +1 -1
- package/dist/web/assets/{htmlMode-BaMdOCq4.js → htmlMode-gF-t3JxJ.js} +1 -1
- package/dist/web/assets/{index-DP8vqolj.js → index-Dg_FWrRZ.js} +2 -2
- package/dist/web/assets/{info-C0Ova1D9.js → info-n9PKmODI.js} +1 -1
- package/dist/web/assets/{jsonMode-BTt0GByK.js → jsonMode-B5DVQ7wE.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-C-1acLbv.js → lspLanguageFeatures-FK4QlUnB.js} +1 -1
- package/dist/web/assets/{minimize-2-CW5KYp0W.js → minimize-2--J7-Zqg1.js} +1 -1
- package/dist/web/assets/{monaco.contribution-DoAhyjpn.js → monaco.contribution-CM_Srh4F.js} +2 -2
- package/dist/web/assets/{monaco.contribution-P9b5cZU2.js → monaco.contribution-CV2W_Ydj.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DyKzYxR3.js → monaco.contribution-DCmsluF_.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CpiBa8rP.js → monaco.contribution-DEkLSjvo.js} +2 -2
- package/dist/web/assets/{play-jV1i4pfe.js → play-CT6lFZDI.js} +1 -1
- package/dist/web/assets/{python-BQnnGrv3.js → python-DQHHAEpa.js} +1 -1
- package/dist/web/assets/{refresh-cw-REnkUGNy.js → refresh-cw-Cm-4hHSn.js} +1 -1
- package/dist/web/assets/{save-B2WTTCI_.js → save-CwgR_oyc.js} +1 -1
- package/dist/web/assets/{square-CRb2lKMC.js → square-DPrPBeHW.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-BGsGhGW4.js → toggleHighContrast-C1QZjrPj.js} +1 -1
- package/dist/web/assets/{tsMode-BWtSmvFs.js → tsMode-DY4Ji1ac.js} +1 -1
- package/dist/web/assets/{upload-B_PICaZn.js → upload-DABGNAIq.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-zmmvBnwd.js → useLocalAgentSchedules-D5P28Jej.js} +1 -1
- package/dist/web/assets/{wifi-off-CjKTt0zE.js → wifi-off-CJOdJJRb.js} +1 -1
- package/dist/web/assets/{workers-CxglqyKV.js → workers-BLjr7D_D.js} +1 -1
- package/dist/web/assets/{yaml-DgyPsmb2.js → yaml-eXk00scV.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/chunks/actions-command-CZD7U6CC.js +0 -2
- package/dist/chunks/app-server-runtime-5XZWU7JL.js +0 -2
- package/dist/chunks/apps-NIQBGOGH.js +0 -2
- package/dist/chunks/chunk-3YAGJU2X.js +0 -2
- package/dist/chunks/chunk-G2VYRU27.js +0 -5
- package/dist/chunks/chunk-HZP5U2AA.js +0 -3
- package/dist/chunks/chunk-J3WNPOLS.js +0 -2
- package/dist/chunks/chunk-NNLI4OWY.js +0 -53
- package/dist/chunks/chunk-SS3EG6S2.js +0 -2
- package/dist/chunks/chunk-Y7ZYJQGZ.js +0 -2
- package/dist/chunks/cli-GWKOPTLS.js +0 -2
- package/dist/chunks/configuration-command-OAZNWOFX.js +0 -2
- package/dist/chunks/core-commands-VGUAOSWS.js +0 -2
- package/dist/chunks/desktop-test-SPTFR43A.js +0 -3
- package/dist/chunks/dist-UA2RQUA4.js +0 -2
- package/dist/chunks/organizations-QPACFCMH.js +0 -2
- package/dist/chunks/project-agent-5H6VCDAY.js +0 -2
- package/dist/chunks/sandbox-command-RKUHXCZJ.js +0 -2
- package/dist/chunks/taskset-PISBOILQ.js +0 -2
- package/dist/chunks/training-2NDOWH5S.js +0 -2
- package/dist/web/assets/HostedModelLearningReview-D5JtAiLZ.js +0 -1
- package/dist/web/assets/chevron-up-Bx5d_Wmr.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as Q,c as Z,t as ee,y as oe}from"./chunk-
|
|
2
|
+
import{b as Q,c as Z,t as ee,y as oe}from"./chunk-3YSCXFE6.js";import{a as T,b as X,h as K}from"./chunk-RBQZVQQM.js";import{n as te,p as re}from"./chunk-WK5HTGXV.js";import{Aa as D,Ca as H,Da as M,Ea as $,Fa as j,Ha as G,b as L,c as B,gb as V,hb as J,jb as I,mb as F,pb as W,qb as E,ub as z,wb as q,xb as Y}from"./chunk-F4WS5QIT.js";import{b as i}from"./chunk-ES2ISFJC.js";import{c as N,d as C,f as k,h as R}from"./chunk-H7IWJN7L.js";import{a as s}from"./chunk-FTQLQJQV.js";import{promises as U}from"node:fs";import Ee from"node:os";import Ae from"node:path";import{createServer as Ie}from"node:http";import{randomBytes as Te}from"node:crypto";var be=i.discriminatedUnion("op",[i.strictObject({op:i.literal("set"),path:i.array(i.string().min(1)).min(1),value:i.unknown()}),i.strictObject({op:i.literal("unset"),path:i.array(i.string().min(1)).min(1)})]),Oe=i.discriminatedUnion("action",[i.strictObject({action:i.literal("patch"),expectedRevision:i.string(),operations:i.array(be).max(100)}),i.strictObject({action:i.literal("replace"),expectedRevision:i.string(),text:i.string().max(1048576)}),i.strictObject({action:i.literal("validate"),text:i.string().max(1048576)}),i.strictObject({action:i.literal("restore"),expectedRevision:i.string(),revision:i.string()}),i.strictObject({action:i.literal("trust"),root:i.string(),accountId:i.string(),trusted:i.boolean()}),i.strictObject({action:i.literal("client-state"),owner:i.string(),patch:z,importOnly:i.boolean().optional()})]);function ne(e){let t=null;async function r(l,n){let g=R(e).config,w=null,p=null,d=null;try{w=await B(g),d=await E(e,{projectRoot:l,accountId:n}),l||(t=d)}catch(v){p=C(v,g)}let y=d??(l?null:t);return{path:g,text:w,rawRevision:L(w),issue:p,effective:y,usingLastValid:!d&&!!y,applies:"next_turn",recoverableRevisions:await H(e),clientState:p?null:await q(e)}}s(r,"status");async function o(l){let n=Oe.parse(l);return n.action==="validate"?{valid:!0,document:D(n.text,R(e).config)}:(n.action==="patch"&&await G(e,n.expectedRevision,n.operations),n.action==="replace"&&await M(e,n.expectedRevision,n.text),n.action==="restore"&&await $(e,n.revision,n.expectedRevision),n.action==="trust"&&await W(e,n.root,n.accountId,n.trusted),n.action==="client-state"?Y(e,n.owner,n.patch,n.importOnly):r())}return s(o,"mutate"),{status:r,mutate:o,schema:j}}s(ne,"createConfigurationPayloads");import{Buffer as ie}from"node:buffer";var A={"Access-Control-Allow-Headers":"authorization, content-type, x-openpond-team-id","Access-Control-Allow-Methods":"GET, POST, PUT, PATCH, DELETE, OPTIONS"},Se=25*1024*1024,x=class extends Error{constructor(r,o,l){super(l);this.status=r;this.code=o;this.name="HttpBodyError"}status;code;static{s(this,"HttpBodyError")}};function ae(e,t,r={}){for(let[l,n]of Object.entries(A))t.setHeader(l,n);let o=ce(e.headers.origin);return o?(t.setHeader("Vary",xe(t.getHeader("Vary"))),Re(o,r)?(t.setHeader("Access-Control-Allow-Origin",o),{allowed:!0,origin:o}):{allowed:!1,origin:o}):{allowed:!0,origin:null}}s(ae,"applyCorsHeaders");function Re(e,t={}){if(e==="null")return!0;let r=se(e);return r?Ce(r)?!0:new Set((t.allowedOrigins??[]).map(l=>l?se(l):null).filter(l=>!!l)).has(r):!1}s(Re,"isAllowedCorsOrigin");function h(e,t,r){e.writeHead(t,{"Content-Type":"application/json",...A}),e.end(JSON.stringify(r))}s(h,"sendJson");function Je(e,t,r){e.writeHead(t,{"Content-Type":"text/plain; charset=utf-8",...A}),e.end(r)}s(Je,"sendText");function Fe(e,t,r,o){e.writeHead(t,{"Content-Type":o,"Content-Length":String(r.byteLength),"Cache-Control":"no-store","X-Content-Type-Options":"nosniff",...A}),e.end(r)}s(Fe,"sendBinary");async function _(e,t={}){let r=t.maxBytes??Se,o=ce(e.headers["content-type"]),l=[],n=0;for await(let w of e){let p=ie.from(w);if(n+=p.byteLength,n>r)throw new x(413,"request_body_too_large",`JSON request body exceeds ${r} bytes.`);l.push(p)}let g=ie.concat(l).toString("utf8").trim();if(!g)return{};if(!Pe(o))throw new x(415,"unsupported_media_type","JSON request body requires Content-Type: application/json.");try{return JSON.parse(g)}catch{throw new x(400,"invalid_json","Request body is not valid JSON.")}}s(_,"readJson");function le(e,t,r){let o=e.headers.authorization;return(typeof o=="string"&&o.startsWith("Bearer ")?o.slice(7):null)===r}s(le,"hasAuth");function ce(e){return Array.isArray(e)?e[0]??null:e??null}s(ce,"headerValue");function Pe(e){if(!e)return!1;let t=e.split(";")[0]?.trim().toLowerCase();return t==="application/json"||!!t?.endsWith("+json")}s(Pe,"isJsonContentType");function se(e){try{let t=new URL(e);return t.protocol!=="http:"&&t.protocol!=="https:"?null:t.origin}catch{return null}}s(se,"normalizeOrigin");function Ce(e){let t=new URL(e);return t.hostname==="localhost"||t.hostname==="127.0.0.1"||t.hostname==="::1"||t.hostname==="[::1]"}s(Ce,"isLoopbackOrigin");function xe(e){let r=(Array.isArray(e)?e.join(", "):e?String(e):"").split(",").map(o=>o.trim()).filter(Boolean);return r.some(o=>o.toLowerCase()==="origin")||r.push("Origin"),r.join(", ")}s(xe,"appendVaryOrigin");function pe(e){return`<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>OpenPond recovery</title>
|
|
3
3
|
<style nonce="${e}">body{font:16px system-ui;background:#171819;color:#eee;max-width:850px;margin:6vh auto;padding:24px}textarea{box-sizing:border-box;width:100%;min-height:280px;background:#222;color:#eee;padding:14px;border:1px solid #777;border-radius:8px;font:14px monospace}button,input,select{font:inherit;margin:6px;padding:8px}pre{white-space:pre-wrap}code{overflow-wrap:anywhere}button{cursor:pointer}p{line-height:1.5}</style>
|
|
4
4
|
<h1>OpenPond needs a storage repair</h1><p id="issue" role="alert">Loading recovery details\u2026</p><p><code id="file"></code></p>
|
|
5
5
|
<p id="action"></p><p>Migration backups and the source installation remain available. Execution services are stopped while recovery is open.</p>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{Y as ge,a as ue,b as de,d as pe,e as K,f as N,g as fe,h as me,i as he,j as ye}from"./chunk-
|
|
2
|
+
import{Y as ge,a as ue,b as de,d as pe,e as K,f as N,g as fe,h as me,i as he,j as ye}from"./chunk-M4CJXPMH.js";import{d as R,e as U}from"./chunk-J2S7BOZU.js";import{$ as ne,H as ce}from"./chunk-F4WS5QIT.js";import{a}from"./chunk-FTQLQJQV.js";import{randomUUID as He}from"node:crypto";var _e=new URL(U).hostname,Se=new URL(R).hostname,Ce=`${U}/opchat/v1`;function l(e){if(!e)return null;let n=e.trim();return n?n.replace(/\/+$/,""):null}a(l,"normalizeBaseUrl");function V(e){let n=l(e);if(!n)return null;try{let o=new URL(n).hostname.toLowerCase();if(o===_e)return U;if(o===Se||o==="openpond.live"||o==="www.openpond.live")return U;if(o.startsWith("api."))return n}catch{return null}return null}a(V,"mapUiBaseToApiBase");function G(e,n){let t=l(process.env.OPENPOND_API_URL);if(t)return t;let o=l(e?.apiBaseUrl);if(o)return o;let r=l(n.apiBaseUrl);if(r)return r;let s=V(process.env.OPENPOND_BASE_URL);return s||(V(e?.baseUrl||n.baseUrl)??U)}a(G,"resolvePublicApiBaseUrl");function J(e,n,t){return Ie(e,n,t)}a(J,"resolveHostedChatApiBaseUrl");function Ie(e,n,t){let o=typeof process<"u"?process.env:{};return W(o.OPENPOND_OPCHAT_API_URL)??W(e?.chatApiBaseUrl??n.chatApiBaseUrl)??W(o.OPENPOND_CHAT_API_URL)??Re(t)}a(Ie,"resolveOpChatApiBaseUrl");function W(e){let n=l(e);if(!n)return null;try{let t=new URL(n),o=t.pathname.split("/").filter(Boolean),r=o.findIndex(i=>i.toLowerCase()==="opchat");return r>=0?(t.pathname=`/${[...o.slice(0,r+1),"v1"].join("/")}`,t.search="",t.hash="",l(t.toString())??null):o.findIndex(i=>i.toLowerCase()==="v1")>=0?(t.pathname="/opchat/v1",t.search="",t.hash="",l(t.toString())??null):(t.pathname=`${t.pathname.replace(/\/+$/,"")}/opchat/v1`.replace(/\/{2,}/g,"/"),t.search="",t.hash="",l(t.toString())??null)}catch{return null}}a(W,"normalizeOpChatApiBaseUrl");function Re(e){return W(e)??Ce}a(Re,"opChatBaseFromPublicApiBase");function T(e){return e?.trim()?e.trim():"production"}a(T,"deriveEnvironment");function Y(e,n=process.env){let t=[e?.apiKey,e?.session?.token,e?.token,n.OPENPOND_API_KEY];for(let o of t){let r=typeof o=="string"?o.trim():"";if(r)return r}return null}a(Y,"accountToken");function P(e,n){return!!(e&&n&&e.toLowerCase()===n.toLowerCase())}a(P,"handleEquals");function v(e,n){return l(e)===l(n)}a(v,"baseUrlEquals");function z(e,n){return`${e?.trim().toLowerCase()||""}|${l(n)??"default"}`}a(z,"profileKey");function Q(e){return l(e?.baseUrl)}a(Q,"selectorBaseUrl");function F(e){let n=l(e.baseUrl);return n?{handle:e.handle,baseUrl:n}:{handle:e.handle}}a(F,"selectorFromAccount");function g(e){let n=typeof e?.handle=="string"?e.handle.trim():"";if(!n)return null;let t=l(e?.baseUrl);return t?{handle:n,baseUrl:t}:{handle:n}}a(g,"normalizeActiveProfile");function k(e,n){if(!P(e.handle,n.handle))return!1;let t=Q(n);return t?v(e.baseUrl,t):!l(e.baseUrl)}a(k,"accountMatchesSelector");function te(e,n){if(!P(e.handle,n.handle))return!1;let t=Q(n);return t?v(e.baseUrl,t):!l(e.baseUrl)}a(te,"profileMatchesSelector");function Ae(e,n,t){let o=Array.isArray(e.accounts)?e.accounts:[],r=n||process.env.OPENPOND_ACCOUNT?g({handle:n||process.env.OPENPOND_ACCOUNT||"",baseUrl:t??process.env.OPENPOND_BASE_URL??null}):g(e.activeProfile);if(r){let s=o.find(c=>k(c,r));if(s)return s;let i=o.filter(c=>P(c.handle,r.handle));return i.length===1?i[0]??null:null}return o[0]?o[0]:null}a(Ae,"findActiveAccount");function Pe(e){let n=Array.isArray(e.accounts)?e.accounts:[],t=g(e.activeProfile)??(n[0]?F(n[0]):null);return oe(n.map(o=>({handle:o.handle,baseUrl:l(o.baseUrl),apiBaseUrl:l(o.apiBaseUrl),chatApiBaseUrl:l(o.chatApiBaseUrl),environment:T(o.environment),isActive:t?k(o,t):!1,hasApiKey:!!o.apiKey?.trim(),hasSessionToken:!!(o.session?.token?.trim()||o.token?.trim()),sessionAppId:o.session?.appId??null,sessionConversationId:o.session?.conversationId??null})))}a(Pe,"fallbackProfilesFromConfig");function oe(e){let n=new Map;for(let t of e){let o=l(t.baseUrl),r=`${t.handle.toLowerCase()}|${o??"default"}`,s={...t,baseUrl:o,apiBaseUrl:l(t.apiBaseUrl),chatApiBaseUrl:l(t.chatApiBaseUrl),environment:T(t.environment),isActive:t.isActive},i=n.get(r);(!i||s.isActive&&!i.isActive||s.hasApiKey&&!i.hasApiKey)&&n.set(r,s)}return Array.from(n.values())}a(oe,"normalizeProfiles");function we(e){return e.hasApiKey||e.hasSessionToken?"signed_in":"signed_out"}a(we,"profileAuthHealth");function Ne(e,n){return e?{reachable:e.reachable,authenticated:e.authenticated,apiBase:e.apiBase||n,latencyMs:e.latencyMs,status:e.status,service:e.service,checkedAt:e.checkedAt,error:e.error??null}:null}a(Ne,"normalizeHealth");function Oe(e){let n=e?.account;return n?{id:n.id??null,email:n.email??null,name:n.name??null,handle:n.handle??null,image:n.image??null,timezone:n.timezone??null,isAdmin:n.isAdmin??null,isVerified:n.isVerified??null,dailyAgentAppId:n.dailyAgentAppId??null,dailyAgentDeploymentId:n.dailyAgentDeploymentId??null,credits:n.credits??null}:null}a(Oe,"normalizeProfile");function Te(e){return(e??[]).map(n=>({...n,id:n.id||n.userProductId||n.openPondProductId||n.name,name:n.name,type:n.type,status:n.status,isActive:n.isActive??null,price:n.price??null,currency:n.currency??null,credits:n.credits??null}))}a(Te,"normalizeProducts");function Le(e){return e.handle.trim().toLowerCase()==="default"&&!l(e.baseUrl)&&!e.hasApiKey&&!e.hasSessionToken}a(Le,"isEmptyDefaultProfile");function X(e){let{config:n,profiles:t,account:o,token:r,apiBaseUrl:s,accountResponse:i,accountProfiles:c,health:y,authFailed:A,error:f}=e,w=J(o,n,s),m=Oe(i??null),S=g(n.activeProfile),E=(o?F(o):null)??S,O=m?.handle||o?.handle||E?.handle||null,C=(E?t.find(p=>te(p,E)):null)??t.find(p=>p.isActive)??null,h=A?"auth_error":r?"signed_in":"signed_out",u=m?.name||m?.handle||m?.email||O||"Signed out",I=l(C?.baseUrl||o?.baseUrl||R),b=T(C?.environment||o?.environment),x=g(E)??(O?g({handle:O,baseUrl:C?.baseUrl??o?.baseUrl}):null),$=(t.length>0?t:O?[{handle:O,baseUrl:Q(x)??l(o?.baseUrl),apiBaseUrl:s,chatApiBaseUrl:w,environment:b,isActive:!0,hasApiKey:!!r,hasSessionToken:!1,sessionAppId:null,sessionConversationId:null}]:[]).filter(p=>!Le(p));return{state:h,activeProfile:x,label:u,email:m?.email??null,avatarUrl:m?.image??null,environment:b,baseUrl:I,apiBaseUrl:s,chatApiBaseUrl:w,creditsLabel:m?.credits??null,profile:m,products:Te(i?.products),apiHealth:Ne(y??null,s),accounts:$.map(p=>{let H=l(p.baseUrl),le=c?.[z(p.handle,H)]??null,M=Oe(le?.response??null);return{handle:p.handle,baseUrl:H,apiBaseUrl:l(p.apiBaseUrl),chatApiBaseUrl:l(p.chatApiBaseUrl),environment:T(p.environment),isActive:x?te(p,x):!1,authHealth:le?.authFailed?"auth_error":we(p),displayLabel:M?.name||M?.handle||M?.email||p.handle,email:M?.email??null,avatarUrl:M?.image??null}}),error:f??y?.error??null}}a(X,"toAccountState");async function De(e){try{return oe(await me())}catch{return Pe(e)}}a(De,"loadProfiles");async function d(e,n){let t=await fe(),o=await De(t),r=Ae(t,e,n),s=Y(r),i=G(r,t),c=J(r,t,i);return{config:t,profiles:o,account:r,token:s,apiBaseUrl:i,chatApiBaseUrl:c,accountState:X({config:t,profiles:o,account:r,token:s,apiBaseUrl:i})}}a(d,"loadOpenPondAccountContext");async function $e(e){let n=l(e.baseUrl);return await he(e.handle,{baseUrl:n}),d(e.handle,n)}a($e,"switchOpenPondAccount");function L(e){return e instanceof Error?e.message:String(e)}a(L,"errorMessage");var Me=15e3;function ze(e){return e===ne?"OpenPond Chat":e==="deepseek-v4-flash"?"DeepSeek V4 Flash":e.replace(/[-_/]+/g," ")}a(ze,"displayNameForHostedModel");function Fe(e){let n=typeof e.id=="string"?e.id:null;return n?{id:n,displayName:ze(n),ownedBy:typeof e.owned_by=="string"?e.owned_by:null,streaming:!0,raw:e}:null}a(Fe,"normalizeHostedModel");async function je(){let e=await d();if(!e.token)return{models:[],error:"No OpenPond API key or session token is configured."};try{return{models:(await We({apiBaseUrl:e.chatApiBaseUrl,token:e.token})).data.map(o=>Fe(o)).filter(o=>!!o),error:null}}catch(n){return{models:[],error:L(n)}}}a(je,"loadOpenPondHostedModels");async function qe(){let e=await d();if(!e.token)return{catalog:null,error:"No OpenPond API key or session token is configured."};let n=new AbortController,t=setTimeout(()=>{n.abort(new Error("OpenPond provider catalog request timed out."))},Me);try{return{catalog:await Ue({apiBaseUrl:e.chatApiBaseUrl,token:e.token,signal:n.signal}),error:null}}catch(o){return{catalog:null,error:L(o)}}finally{clearTimeout(t)}}a(qe,"loadOpenPondProviderCatalog");async function*Ke(e){let n=await d();if(!n.token)throw new Error("OpenPond is signed out. Add an account in Settings before using OpenPond Chat.");yield*Ve({apiBaseUrl:n.chatApiBaseUrl,token:n.token,model:e.model||ne,messages:e.messages,tools:e.tools,toolChoice:e.toolChoice,requestId:e.requestId,reasoningEffort:e.reasoningEffort,maxTokens:e.maxTokens,temperature:e.temperature,topP:e.topP,signal:e.signal})}a(Ke,"streamOpenPondHostedChatTurn");async function We(e){let n=re(e.apiBaseUrl,"models"),t=await fetch(n,{method:"GET",headers:ae(e.token,"application/json"),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat model list failed: ${t.status} ${await se(t)}`);return await t.json()}a(We,"listOpChatModels");async function Ue(e){let n=re(e.apiBaseUrl,"provider-catalog"),t=await fetch(n,{method:"GET",headers:ae(e.token,"application/json"),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat provider catalog failed: ${t.status} ${await se(t)}`);return ce.parse(await t.json())}a(Ue,"listOpChatProviderCatalog");async function*Ve(e){let n=re(e.apiBaseUrl,"chat/completions"),t=await fetch(n,{method:"POST",headers:ae(e.token,"text/event-stream",e.requestId),body:JSON.stringify(Ze(e,!0)),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat request failed: ${t.status} ${await se(t)}`);if(!t.body)throw new Error("OpenPond OpChat request failed: streaming response body is missing.");let o=new Map,r=!1,s=null,i={},c="",y=null,A=Ge(t.headers),f=t.body.getReader(),w=new TextDecoder,m="",S=[],ee=a(()=>{if(S.length===0)return[];let h=S.join(`
|
|
3
3
|
`);if(S=[],h==="[DONE]")return r=!0,[];let u;try{u=JSON.parse(h)}catch{throw new Error("OpenPond OpChat request failed: malformed streaming event.")}if(u&&typeof u=="object"&&"error"in u)throw new Error(`OpenPond OpChat request failed: ${ke(u)}`);i=u;let I=u&&typeof u=="object"?u:{},b=Array.isArray(I.choices)?I.choices:[],x=b[0]&&typeof b[0]=="object"?b[0]:{},q=x.delta&&typeof x.delta=="object"?x.delta:{},$=[],p=be(q.reasoning_content);p&&(c+=p,$.push({type:"reasoning_delta",text:p,raw:u}));let H=be(q.content);return H&&$.push({type:"text_delta",text:H,raw:u}),Qe(o,q.tool_calls),s=D(x.finish_reason)??s,y=tn(u)??y,$},"consumeEvent"),E=a(h=>{let u=h.endsWith("\r")?h.slice(0,-1):h;return u?u.startsWith(":")?[]:(u.startsWith("data:")&&S.push(u.slice(5).trimStart()),[]):ee()},"consumeLine");try{for(;;){let h=await f.read();if(h.done)break;m+=w.decode(h.value,{stream:!0});let u=m.split(`
|
|
4
4
|
`);m=u.pop()??"";for(let I of u)for(let b of E(I))yield b}if(m+=w.decode(),m)for(let h of E(m))yield h;for(let h of ee())yield h}finally{f.releaseLock()}if(!r)throw new Error("OpenPond OpChat request failed: stream ended before [DONE].");let O=Xe(o);O.length>0&&(yield{type:"tool_call_delta",toolCalls:O,raw:i}),O.length>0&&c&&(yield{type:"continuation",continuation:{kind:"chat_completions_reasoning",reasoningContent:c},raw:i});let C=Je(y,A);C&&(yield{type:"usage",usage:C,raw:i}),yield{type:"finish",finishReason:s,raw:i}}a(Ve,"streamOpChatChatCompletion");function Ge(e){let n=xe(e,["fireworks-prompt-tokens","prompt-tokens"]),t=xe(e,["fireworks-cached-prompt-tokens","cached-prompt-tokens"]);return t===null?null:{...n===null?{}:{prompt_tokens:n},cached_input_tokens:t,cache_telemetry_source:"provider_response_headers"}}a(Ge,"cacheUsageFromResponseHeaders");function xe(e,n){for(let t of n){let o=e.get(t);if(o===null||!/^\d+$/.test(o.trim()))continue;let r=Number(o);if(Number.isSafeInteger(r)&&r>=0)return r}return null}a(xe,"firstHeaderTokenCount");function Je(e,n){if(!n||Ye(e))return e;let t={...e??{},cached_input_tokens:n.cached_input_tokens,cache_telemetry_source:"provider_response_headers"};return B(e?.prompt_tokens)===null&&n.prompt_tokens!==void 0&&(t.prompt_tokens=n.prompt_tokens),t}a(Je,"usageWithResponseHeaderCache");function Ye(e){return e?B(e.cached_input_tokens)!==null||B(e.cache_read_input_tokens)!==null||B(e.cache_creation_input_tokens)!==null||B(e.prompt_cache_hit_tokens)!==null||B(e.prompt_cache_miss_tokens)!==null?!0:B(e.prompt_tokens_details?.cached_tokens)!==null||B(e.input_tokens_details?.cached_tokens)!==null:!1}a(Ye,"usageHasCacheTelemetry");function B(e){if(typeof e=="number"&&Number.isSafeInteger(e)&&e>=0)return e;if(typeof e!="string"||!/^\d+$/.test(e.trim()))return null;let n=Number(e);return Number.isSafeInteger(n)?n:null}a(B,"usageTokenCount");function Qe(e,n){Array.isArray(n)&&n.forEach((t,o)=>{if(!t||typeof t!="object")return;let r=t,s=typeof r.index=="number"&&Number.isInteger(r.index)?r.index:o,i=e.get(s)??{arguments:""};typeof r.id=="string"&&(i.id=r.id);let c=r.function&&typeof r.function=="object"?r.function:{};typeof c.name=="string"&&(i.name=`${i.name??""}${c.name}`),typeof c.arguments=="string"&&(i.arguments+=c.arguments),e.set(s,i)})}a(Qe,"mergeOpChatToolCallDeltas");function Xe(e){return[...e.entries()].sort(([n],[t])=>n-t).flatMap(([,n])=>n.id&&n.name?[{id:n.id,type:"function",function:{name:n.name,arguments:n.arguments}}]:[])}a(Xe,"completedOpChatToolCalls");function Ze(e,n){let t={model:e.model,messages:e.messages.map(nn),stream:n};return e.tools&&(t.tools=e.tools),e.toolChoice!==void 0&&(t.tool_choice=e.toolChoice),typeof e.maxTokens=="number"&&(t.max_tokens=e.maxTokens),typeof e.temperature=="number"&&(t.temperature=e.temperature),typeof e.topP=="number"&&(t.top_p=e.topP),Object.assign(t,en(e.reasoningEffort)),t}a(Ze,"buildOpChatBody");function en(e){return e?e==="low"?{thinking:{type:"disabled"}}:{thinking:{type:"enabled"},reasoning_effort:e==="xhigh"?"max":"high"}:{}}a(en,"opChatReasoningFields");function nn(e){let{continuation:n,images:t,...o}=e,r=t?.length?[...typeof e.content=="string"&&e.content.trim()?[{type:"text",text:e.content}]:[],...t.map(s=>({type:"image_url",image_url:{url:s.url,...s.detail?{detail:s.detail}:{}}}))]:e.content;return e.role==="assistant"&&n?.kind==="chat_completions_reasoning"?{...o,...r!==void 0?{content:r}:{},reasoning_content:n.reasoningContent}:{...o,...r!==void 0?{content:r}:{}}}a(nn,"opChatMessage");function re(e,n){let t=e.trim().replace(/\/+$/,"");if(!t)throw new Error("OpenPond OpChat API base URL is required.");return`${t}/${n}`}a(re,"opChatEndpointUrl");function ae(e,n,t){let o=e.trim();if(!o)throw new Error("OpenPond API key is required for OpChat.");let r=new Headers;return r.set("Authorization",`Bearer ${o}`),r.set("Content-Type","application/json"),r.set("Accept",n),r.set("x-openpond-client","openpond-app"),r.set("x-openpond-request-id",t||He()),r}a(ae,"opChatHeaders");async function se(e){let n=await e.text().catch(()=>"");if(!n)return e.statusText||`HTTP ${e.status}`;try{return ke(JSON.parse(n))}catch{return n}}a(se,"readOpChatError");function ke(e){if(!e||typeof e!="object")return String(e||"unknown_error");let n=e,t=n.error;if(t&&typeof t=="object"){let o=t;return[D(o.code),D(o.type),D(o.message)].filter(Boolean).join(": ")}return[D(n.error),D(n.message)].filter(Boolean).join(": ")||JSON.stringify(e)}a(ke,"errorMessageFromPayload");function tn(e){if(!e||typeof e!="object")return null;let n=e.usage;return!n||typeof n!="object"?null:n}a(tn,"parseUsage");function D(e){return typeof e=="string"&&e.trim()?e:null}a(D,"stringValue");function be(e){return typeof e=="string"&&e.length>0?e:null}a(be,"streamTextValue");import{readFileSync as on}from"node:fs";var j;function rn(){if(j!==void 0)return j??"openpond-code bundled";try{let e=new URL("../package.json",import.meta.resolve("openpond")),n=JSON.parse(on(e,"utf8"));j=typeof n.version=="string"?`openpond-code@${n.version}`:null}catch{j=null}return j??"openpond-code bundled"}a(rn,"getBundledRuntimeVersion");import{spawn as an}from"node:child_process";function Be(e,n=process.platform){return n==="darwin"?{command:"open",args:[e]}:n==="win32"?{command:"rundll32.exe",args:["url.dll,FileProtocolHandler",e]}:{command:"xdg-open",args:[e]}}a(Be,"resolveSystemBrowserCommand");async function sn(e,n={}){let t=n.command??Be(e),o=n.handoffTimeoutMs??1500;return new Promise(r=>{let s=!1,i=null,c=a(A=>{s||(s=!0,i&&clearTimeout(i),r(A))},"finish"),y=an(t.command,t.args,{detached:!1,shell:!1,stdio:"ignore",windowsHide:!0});y.once("error",A=>{let f=A.code;c({opened:!1,error:f?`browser launcher ${t.command} failed (${f})`:`browser launcher ${t.command} failed`})}),y.once("close",(A,f)=>{if(A===0){c({opened:!0});return}let w=f?`signal ${f}`:`code ${A??"unknown"}`;c({opened:!1,error:`browser launcher ${t.command} exited with ${w}`})}),i=setTimeout(()=>{y.unref(),c({opened:!0})},o),i.unref()})}a(sn,"openUrlWithSystemBrowser");function ln(e){if(!e||typeof e!="object")return null;let n=e,t=typeof n.id=="string"?n.id:null,o=typeof n.name=="string"?n.name:t;if(!t||!o)return null;let r=n.latestDeployment&&typeof n.latestDeployment=="object"?n.latestDeployment:null,s=ge.safeParse(n.sandboxActionRegistry);return{id:t,name:o,description:typeof n.description=="string"?n.description:null,visibility:typeof n.visibility=="string"?n.visibility:null,gitOwner:typeof n.gitOwner=="string"?n.gitOwner:null,gitRepo:typeof n.gitRepo=="string"?n.gitRepo:null,gitHost:typeof n.gitHost=="string"?n.gitHost:null,defaultBranch:typeof n.defaultBranch=="string"?n.defaultBranch:null,sandbox:n.sandbox===!0,sandboxActionRegistry:s.success?s.data:null,sandboxManifestHash:typeof n.sandboxManifestHash=="string"?n.sandboxManifestHash:null,sandboxManifestPath:typeof n.sandboxManifestPath=="string"?n.sandboxManifestPath:null,sandboxManifestSyncedAt:typeof n.sandboxManifestSyncedAt=="string"?n.sandboxManifestSyncedAt:n.sandboxManifestSyncedAt instanceof Date?n.sandboxManifestSyncedAt.toISOString():null,sandboxManifestError:typeof n.sandboxManifestError=="string"?n.sandboxManifestError:null,updatedAt:typeof n.updatedAt=="string"?n.updatedAt:null,latestDeployment:r?{id:typeof r.id=="string"?r.id:void 0,status:typeof r.status=="string"?r.status:void 0,deploymentDomain:typeof r.deploymentDomain=="string"?r.deploymentDomain:null,createdAt:typeof r.createdAt=="string"?r.createdAt:void 0,isProduction:typeof r.isProduction=="boolean"?r.isProduction:null,gitBranch:typeof r.gitBranch=="string"?r.gitBranch:null}:null,scheduleSummary:un(n.scheduleSummary)}}a(ln,"normalizeApp");function _(e){return typeof e=="string"?e:e instanceof Date?e.toISOString():null}a(_,"normalizeDateString");function cn(e){if(!e||typeof e!="object")return null;let n=e,t=typeof n.id=="string"?n.id:null,o=typeof n.name=="string"?n.name:t,r=typeof n.deploymentId=="string"?n.deploymentId:null;return!t||!o||!r?null:{id:t,name:o,description:typeof n.description=="string"?n.description:null,scheduleType:typeof n.scheduleType=="string"?n.scheduleType:"cron",scheduleExpression:typeof n.scheduleExpression=="string"?n.scheduleExpression:"",enabled:!!n.enabled,rawEnabled:typeof n.rawEnabled=="boolean"?n.rawEnabled:void 0,syncStatus:typeof n.syncStatus=="string"?n.syncStatus:null,syncError:typeof n.syncError=="string"?n.syncError:null,startAt:_(n.startAt),endAt:_(n.endAt),maxRuns:typeof n.maxRuns=="number"?n.maxRuns:null,executionCount:typeof n.executionCount=="number"?n.executionCount:null,lifecycleStatus:typeof n.lifecycleStatus=="string"?n.lifecycleStatus:null,lifecycleReason:typeof n.lifecycleReason=="string"?n.lifecycleReason:null,lastExecutionAt:_(n.lastExecutionAt),lastExecutionStatus:typeof n.lastExecutionStatus=="string"?n.lastExecutionStatus:null,lastRunNowAt:_(n.lastRunNowAt),lastRunNowStatus:typeof n.lastRunNowStatus=="string"?n.lastRunNowStatus:null,updatedAt:_(n.updatedAt)??new Date().toISOString(),deploymentId:r,isProduction:typeof n.isProduction=="boolean"?n.isProduction:void 0,payload:n.payload}}a(cn,"normalizeSchedule");function un(e){if(!e||typeof e!="object")return null;let n=e,t=Array.isArray(n.schedules)?n.schedules.map(cn).filter(i=>!!i):[],o=typeof n.total=="number"?n.total:t.length,r=typeof n.active=="number"?n.active:t.filter(i=>i.enabled).length,s=typeof n.paused=="number"?n.paused:Math.max(0,o-r);return{total:o,active:r,paused:s,enabled:typeof n.enabled=="number"?n.enabled:r,disabled:typeof n.disabled=="number"?n.disabled:s,nextRunAt:_(n.nextRunAt),lastRunAt:_(n.lastRunAt),schedules:t,truncated:typeof n.truncated=="boolean"?n.truncated:void 0}}a(un,"normalizeScheduleSummary");async function dn(e){let n=Array.isArray(e.config.accounts)?e.config.accounts:[],t=await Promise.all(n.map(async o=>{let r=z(o.handle,o.baseUrl),s=Y(o);if(!s)return[r,{response:null,authFailed:!1,error:null}];try{return[r,{response:await K(G(o,e.config),s),authFailed:!1,error:null}]}catch(i){return[r,{response:null,authFailed:!0,error:L(i)}]}}));return Object.fromEntries(t)}a(dn,"loadAccountProfileLookups");async function Ee(e){let n=await dn(e),t=e.account?n[z(e.account.handle,e.account.baseUrl)]??null:null,o=t?.response??null,r=e.token&&t?.authFailed?t.error||"OpenPond account authentication failed.":null;return{account:X({...e,accountResponse:o,accountProfiles:n,authFailed:!!r,error:r})}}a(Ee,"loadOpenPondAccountStateForContext");async function pn(){return Ee(await d())}a(pn,"loadOpenPondAccountState");async function ve(e={}){let n=await d(),t=Ee(n);if(!n.token)return{...await t,apps:[],error:"No OpenPond API key or session token is configured."};let[o,r]=await Promise.allSettled([t,ue(n.apiBaseUrl,n.token,{handle:n.account?.handle,limit:e.limit??20,offset:e.offset??0,includeScheduled:e.includeScheduled??!0})]);if(o.status==="rejected")throw o.reason;return{account:o.value.account,apps:r.status==="fulfilled"?r.value.map(ln).filter(s=>!!s):[],error:r.status==="rejected"?L(r.reason):null}}a(ve,"loadOpenPondApps");async function fn(e){let n=await d();if(!n.token)throw new Error("No OpenPond API key or session token is configured.");return{account:n,response:await de(n.apiBaseUrl,n.token,e)}}a(fn,"createOpenPondRepoApp");import{createHash as mn}from"node:crypto";function hn(e){return`account-${mn("sha256").update(e).digest("hex").slice(0,8)}`}a(hn,"fallbackHandleForApiKey");function Z(e){let n=e?.trim();return n?n.replace(/^@/,""):null}a(Z,"normalizeDerivedHandle");async function yn(e,n){let t=Z(e.handle);if(t)return t;try{let r=(await K(n,e.apiKey)).account,s=Z(r.handle)??Z(r.email?.split("@")[0])??Z(r.id);if(s)return s}catch{}return hn(e.apiKey)}a(yn,"deriveHandleForApiKey");async function gn(e){let n=e.baseUrl??R,t=l(e.apiBaseUrl)??V(n)??U,o=l(e.chatApiBaseUrl),r=await yn(e,t);return await ye({handle:r,apiKey:e.apiKey,baseUrl:n,apiBaseUrl:t,chatApiBaseUrl:o,environment:e.environment??"production",setActive:e.setActive}),d(r,n)}a(gn,"saveOpenPondAccount");function An(e,n,t){let o=l(t),r=e.findIndex(i=>P(i.handle,n)&&v(i.baseUrl,o));if(r!==-1)return r;let s=e.map((i,c)=>({account:i,index:c})).filter(({account:i})=>P(i.handle,n));if(s.length===1)return s[0].index;if(s.length>1)throw new Error(`Multiple OpenPond accounts match ${n}; select one with its base URL.`);return-1}a(An,"findAccountIndex");async function Pn(e){let n=e.handle.trim();if(!n)throw new Error("OpenPond account handle is required.");return await N(t=>{let o=(t.accounts??[]).map(c=>({...c})),r=An(o,n,e.baseUrl);if(r===-1)throw new Error(`OpenPond account not found: ${n}`);let s=o[r],i=g(t.activeProfile);if(i&&k(s,i))throw new Error("Switch to another OpenPond account before removing the active account.");o.splice(r,1),t.accounts=o}),d()}a(Pn,"removeOpenPondAccount");async function wn(){let e;return await N(n=>{let t=g(n.activeProfile),o=(n.accounts??[]).map(s=>({...s})),r=t?o.findIndex(s=>k(s,t)):0;if(r<0||!o[r])throw new Error("No active OpenPond account to log out.");e={...o[r]},delete e.apiKey,delete e.session,o[r]=e,n.accounts=o}),d(e.handle,e.baseUrl)}a(wn,"signOutOpenPondAccount");function On(e,n,t){let o=l(t),r=e.findIndex(i=>P(i.handle,n)&&v(i.baseUrl,o));if(r!==-1)return r;let s=e.map((i,c)=>({account:i,index:c})).filter(({account:i})=>P(i.handle,n));if(s.length===1)return s[0].index;if(s.length>1)throw new Error(`Multiple OpenPond accounts match ${n}; select one with its current base URL.`);return-1}a(On,"findAccountIndex");function ie(e,n,t){if(t===void 0)return;let o=l(t);if(o){e[n]=o;return}(t===null||t.trim()==="")&&delete e[n]}a(ie,"applyOptionalUrl");async function xn(e){let n=e.handle.trim();if(!n)throw new Error("OpenPond account handle is required.");let t;return await N(o=>{let r=(o.accounts??[]).map(f=>({...f})),s=On(r,n,e.currentBaseUrl);if(s===-1)throw new Error(`OpenPond account not found: ${n}`);let i=r[s];if(t={...i},ie(t,"baseUrl",e.baseUrl),ie(t,"apiBaseUrl",e.apiBaseUrl),ie(t,"chatApiBaseUrl",e.chatApiBaseUrl),e.environment===null?delete t.environment:typeof e.environment=="string"&&e.environment.trim()&&(t.environment=e.environment.trim()),r.findIndex((f,w)=>w!==s&&P(f.handle,t.handle)&&v(f.baseUrl,t.baseUrl))!==-1)throw new Error("Another OpenPond account already uses that handle and base URL.");let y=g(o.activeProfile),A=!!(y&&k(i,y));r[s]=t,o.accounts=r,o.activeProfile=e.setActive||A?F(t):o.activeProfile}),d(t.handle,t.baseUrl)}a(xn,"updateOpenPondAccountConfig");async function bn(e){let n=await d();if(!n.token)throw new Error("OpenPond is signed out. Add an account before reading app config.");return pe(n.apiBaseUrl,n.token,e.appId)}a(bn,"getOpenPondAppEnvironment");function Un(e,n){let t="",o=a(r=>{r.startsWith(e)&&n(JSON.parse(r.slice(e.length)))},"processLine");return{push(r){for(t+=r;;){let s=kn(t);if(s<0)return;let i=t.slice(0,s).replace(/\r$/,""),c=t[s]==="\r"&&t[s+1]===`
|
|
5
5
|
`?2:1;t=t.slice(s+c),o(i)}},flush(){let r=t.trimEnd();t="",r&&o(r)}}}a(Un,"createReadyLineParser");function kn(e){let n=e.indexOf(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{$a as L,_a as H,jb as S}from"./chunk-F4WS5QIT.js";import{f as A,h as O}from"./chunk-H7IWJN7L.js";import{a as l}from"./chunk-FTQLQJQV.js";import Q from"node:path";var U="default",z=["apiKey","baseUrl","apiBaseUrl","chatApiBaseUrl","token","appId","conversationId"];function re(){return V()}l(re,"getConfigPath");function V(){return O(A()).config}l(V,"getGlobalConfigPath");function m(n,e){return Object.prototype.hasOwnProperty.call(n,e)}l(m,"hasOwn");function h(n){if(typeof n!="string")return null;let e=n.trim();return e.length>0?e:null}l(h,"normalizeHandle");function d(n){if(typeof n!="string")return null;let e=n.trim();return e?e.replace(/\/$/,""):null}l(d,"normalizeBaseUrl");function q(n){let e=h(n);if(!e)throw new Error("profile handle must be non-empty");return e}l(q,"requireHandle");function W(n){if(typeof n!="string")throw new Error("apiKey must be a non-empty string");let e=n.trim();if(!e)throw new Error("apiKey must be a non-empty string");return e}l(W,"requireApiKey");function b(n,e){let t=h(n),s=h(e);return!!(t&&s&&t.toLowerCase()===s.toLowerCase())}l(b,"handleEquals");function v(n,e,t){let s=d(t);return n.findIndex(i=>b(i.handle,e)?s?d(i.baseUrl)===s:!0:!1)}l(v,"findAccountIndex");function P(n){let e=h(n.handle)??U,t=d(n.baseUrl);return t?{handle:e,baseUrl:t}:{handle:e}}l(P,"selectorFromAccount");function y(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=h(typeof e.handle=="string"?e.handle:void 0);if(!t)return null;let s=d(typeof e.baseUrl=="string"?e.baseUrl:void 0);return s?{handle:t,baseUrl:s}:{handle:t}}l(y,"sanitizeActiveProfile");function B(n){if(!n||typeof n!="object"||Array.isArray(n))return;let e=n,t=typeof e.repoPath=="string"?e.repoPath.trim():"",s=typeof e.profile=="string"&&e.profile.trim()?e.profile.trim():"default";if(!t)return;let i={repoPath:t,profile:s,mode:"local"};if(e.lastCheck&&typeof e.lastCheck=="object"&&!Array.isArray(e.lastCheck)){let o=e.lastCheck,a=o.command,u=o.status,c=o.checkedAt;(a==="inspect"||a==="build"||a==="validate"||a==="eval"||a==="run")&&(u==="passed"||u==="failed")&&typeof c=="string"&&(i.lastCheck={command:a,status:u,checkedAt:c,...typeof o.exitCode=="number"||o.exitCode===null?{exitCode:o.exitCode}:{},...typeof o.sourceHead=="string"||o.sourceHead===null?{sourceHead:o.sourceHead}:{}})}if(e.lastPush&&typeof e.lastPush=="object"&&!Array.isArray(e.lastPush)){let o=e.lastPush,a=o.status,u=o.pushedAt;(a==="pushed"||a==="failed")&&typeof u=="string"&&(i.lastPush={status:a,pushedAt:u,...typeof o.teamId=="string"||o.teamId===null?{teamId:o.teamId}:{},...typeof o.projectId=="string"||o.projectId===null?{projectId:o.projectId}:{},...typeof o.localHead=="string"||o.localHead===null?{localHead:o.localHead}:{},...typeof o.hostedHead=="string"||o.hostedHead===null?{hostedHead:o.hostedHead}:{},...typeof o.sourceRef=="string"||o.sourceRef===null?{sourceRef:o.sourceRef}:{},...o.promotionStatus==="uploaded"||o.promotionStatus==="hosted_source_materialized"||o.promotionStatus==="hosted_source_materialize_failed"||o.promotionStatus==="hosted_source_check_pending"||o.promotionStatus==="hosted_source_check_failed"||o.promotionStatus==="hosted_source_published"||o.promotionStatus==="hosted_source_publish_failed"||o.promotionStatus==="hosted_run_pending"||o.promotionStatus==="hosted_run_passed"||o.promotionStatus==="hosted_run_failed"||o.promotionStatus===null?{promotionStatus:o.promotionStatus}:{},...o.hostedRunStatus==="not_started"||o.hostedRunStatus==="running"||o.hostedRunStatus==="passed"||o.hostedRunStatus==="failed"||o.hostedRunStatus===null?{hostedRunStatus:o.hostedRunStatus}:{},...typeof o.hostedRunAgentId=="string"||o.hostedRunAgentId===null?{hostedRunAgentId:o.hostedRunAgentId}:{},...typeof o.hostedRunId=="string"||o.hostedRunId===null?{hostedRunId:o.hostedRunId}:{},...typeof o.hostedRunAt=="string"||o.hostedRunAt===null?{hostedRunAt:o.hostedRunAt}:{},...w(o.hostedSourceMaterialization)?{hostedSourceMaterialization:w(o.hostedSourceMaterialization)}:{},...E(o.hostedSourceCheck)?{hostedSourceCheck:E(o.hostedSourceCheck)}:{},...K(o.hostedPublish)?{hostedPublish:K(o.hostedPublish)}:{},...M(o.hostedRun)?{hostedRun:M(o.hostedRun)}:{},...typeof o.error=="string"||o.error===null?{error:o.error}:{}})}if(Array.isArray(e.profiles)){let o=e.profiles.flatMap(a=>{let u=B(a);if(!u)return[];let c=a,p=c.source==="github"||c.source==="openpond_git"?c.source:"local",C=typeof c.repositoryId=="string"&&c.repositoryId.trim()?c.repositoryId.trim():Q.resolve(u.repoPath);return[{source:p,repositoryId:C,repoPath:u.repoPath,profile:u.profile,...u.lastCheck?{lastCheck:u.lastCheck}:{},...u.lastPush?{lastPush:u.lastPush}:{}}]});o.length>0&&(i.profiles=o)}return i}l(B,"sanitizeLocalOpenPondProfile");function w(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=R(e.status);return t?{status:t,...r(e,"agentId"),...r(e,"runtimeAgentId"),...r(e,"projectId"),...r(e,"sourceRoot"),...r(e,"sourceRef"),...r(e,"sourceCommitSha"),...r(e,"manifestHash"),...r(e,"manifestPath"),...r(e,"manifestSyncedAt"),...T(e,"fileCount"),...T(e,"totalBytes"),...r(e,"generatedManifestPath"),...k(e,"synthesizedOpenPondYaml"),...r(e,"uploadMetadataPath"),...f(e,"setupCommands"),...f(e,"validationCommands"),...r(e,"materializedAt"),...r(e,"error")}:null}l(w,"sanitizeHostedMaterializationStatus");function E(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=R(e.status);return t?{status:t,...r(e,"agentId"),...r(e,"deployPlanStatus"),...k(e,"canRun"),...k(e,"canDeploy"),...r(e,"sourceRef"),...r(e,"sourceCommitSha"),...r(e,"manifestHash"),...r(e,"manifestPath"),...f(e,"setupCommands"),...f(e,"validationCommands"),...f(e,"requiredChecks"),...f(e,"evalNames"),...f(e,"blockedReasons"),...f(e,"staleReasons"),...r(e,"runtimeId"),...r(e,"sandboxId"),...f(e,"traceArtifactRefs"),...f(e,"evalResultArtifactRefs"),...f(e,"validatorArtifactRefs"),...r(e,"checkedAt"),...r(e,"error")}:null}l(E,"sanitizeHostedSourceCheckStatus");function K(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=R(e.status);return t?{status:t,...r(e,"agentId"),...r(e,"snapshotId"),...r(e,"sourceRef"),...r(e,"sourceCommitSha"),...r(e,"manifestHash"),...r(e,"manifestPath"),...r(e,"buildStatus"),...r(e,"validationStatus"),...r(e,"evalStatus"),...r(e,"publishedAt"),...r(e,"error")}:null}l(K,"sanitizeHostedPublishStatus");function M(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=R(e.status);return t?{status:t,...r(e,"agentId"),...r(e,"runId"),...r(e,"runtimeId"),...r(e,"sandboxId"),...r(e,"sourceRef"),...r(e,"sourceCommitSha"),...r(e,"manifestHash"),...r(e,"setupGateStatus"),...f(e,"setupRequirementRefs"),...f(e,"artifactRefs"),...f(e,"traceArtifactRefs"),...f(e,"evalArtifactRefs"),...r(e,"startedAt"),...r(e,"completedAt"),...r(e,"error")}:null}l(M,"sanitizeHostedRunSummary");function r(n,e){let t=n[e];return typeof t=="string"||t===null?{[e]:t}:{}}l(r,"nullableStringProp");function k(n,e){let t=n[e];return typeof t=="boolean"||t===null?{[e]:t}:{}}l(k,"nullableBooleanProp");function T(n,e){let t=n[e];return typeof t=="number"||t===null?{[e]:t}:{}}l(T,"nullableNumberProp");function f(n,e){let t=n[e];if(!Array.isArray(t))return{};let s=t.filter(i=>typeof i=="string");return{[e]:s}}l(f,"stringArrayProp");function R(n){return typeof n=="string"&&n.trim()?n.trim():null}l(R,"stringField");function D(n,e){if(!b(n.handle,e.handle))return!1;let t=d(e.baseUrl);return t?d(n.baseUrl)===t:!d(n.baseUrl)}l(D,"accountMatchesSelector");function I(n,e,t={}){let s=d(e.baseUrl);if(s)return v(n,e.handle,s);let i=n.findIndex(a=>D(a,e));if(i!==-1)return i;let o=n.map((a,u)=>({account:a,index:u})).filter(({account:a})=>b(a.handle,e.handle));if(o.length>1&&t.requireUnambiguous)throw new Error(`multiple profiles found for ${e.handle}; pass --base-url to select one`);return o[0]?.index??-1}l(I,"findAccountIndexForSelector");function X(n){if(!n||typeof n!="object"||Array.isArray(n))return;let e=n,t={};return typeof e.token=="string"&&(t.token=e.token),(typeof e.appId=="string"||e.appId===null)&&(t.appId=e.appId),(typeof e.conversationId=="string"||e.conversationId===null)&&(t.conversationId=e.conversationId),Object.keys(t).length>0?t:void 0}l(X,"sanitizeSession");function Z(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=h(typeof e.handle=="string"?e.handle:void 0);if(!t)return null;let s={handle:t};typeof e.apiKey=="string"&&(s.apiKey=e.apiKey),typeof e.baseUrl=="string"&&(s.baseUrl=e.baseUrl),typeof e.apiBaseUrl=="string"&&(s.apiBaseUrl=e.apiBaseUrl),typeof e.chatApiBaseUrl=="string"&&(s.chatApiBaseUrl=e.chatApiBaseUrl),typeof e.environment=="string"&&(s.environment=e.environment);let i=X(e.session);return i&&(s.session=i),s}l(Z,"sanitizeAccount");function ee(n){let e={};return typeof n.token=="string"&&(e.token=n.token),(typeof n.appId=="string"||n.appId===null)&&(e.appId=n.appId),(typeof n.conversationId=="string"||n.conversationId===null)&&(e.conversationId=n.conversationId),Object.keys(e).length>0?e:void 0}l(ee,"extractLegacySession");function ne(n,e){let t={handle:e};typeof n.apiKey=="string"&&(t.apiKey=n.apiKey),typeof n.baseUrl=="string"&&(t.baseUrl=n.baseUrl),typeof n.apiBaseUrl=="string"&&(t.apiBaseUrl=n.apiBaseUrl),typeof n.chatApiBaseUrl=="string"&&(t.chatApiBaseUrl=n.chatApiBaseUrl);let s=ee(n);return s&&(t.session=s),t}l(ne,"extractLegacyAccount");function x(n){let e={};typeof n.lspEnabled=="boolean"&&(e.lspEnabled=n.lspEnabled),(n.executionMode==="local"||n.executionMode==="hosted")&&(e.executionMode=n.executionMode),(n.mode==="general"||n.mode==="builder")&&(e.mode=n.mode);let t=B(n.openpondProfile);t&&(e.openpondProfile=t);let s=[],i=Array.isArray(n.accounts)?n.accounts:[];for(let c of i){let p=Z(c);p&&v(s,p.handle,p.baseUrl)===-1&&s.push(p)}if(s.length===0){let c=y(n.activeProfile)?.handle||U;s.push(ne(n,c))}let o=y(n.activeProfile),a=o?I(s,o):-1,u=s[a===-1?0:a];return e.accounts=s,e.activeProfile=P(u),e}l(x,"normalizeGlobalConfig");function N(n,e,t){let s=n.accounts??[],i=d(t??process.env.OPENPOND_BASE_URL),o=h(e);if(o)return i?{handle:o,baseUrl:i}:{handle:o};let a=h(process.env.OPENPOND_ACCOUNT);if(a)return i?{handle:a,baseUrl:i}:{handle:a};let u=y(n.activeProfile);return u?i?{handle:u.handle,baseUrl:i}:u:s[0]?P(s[0]):{handle:U}}l(N,"resolveRequestedProfile");function G(n,e,t){let s=d(t);if(s){let o=v(n,e,s);if(o!==-1)return n[o]}else{let o=n.filter(a=>b(a.handle,e));if(o.length>1)throw new Error(`multiple profiles found for ${e}; pass --base-url to select one`);if(o.length===1)return o[0]}let i={handle:e};return s&&(i.baseUrl=s),n.push(i),i}l(G,"ensureAccount");function j(n){n.session&&Object.keys(n.session).length===0&&delete n.session}l(j,"cleanupAccount");function te(n,e,t,s){let i=t===null||t===void 0&&s.undefinedDeletes;switch(e){case"apiKey":{if(i){delete n.apiKey;return}typeof t=="string"&&(n.apiKey=t);return}case"baseUrl":{if(i){delete n.baseUrl;return}typeof t=="string"&&(n.baseUrl=t);return}case"apiBaseUrl":{if(i){delete n.apiBaseUrl;return}typeof t=="string"&&(n.apiBaseUrl=t);return}case"chatApiBaseUrl":{if(i){delete n.chatApiBaseUrl;return}typeof t=="string"&&(n.chatApiBaseUrl=t);return}case"token":case"appId":case"conversationId":{if(n.session||(n.session={}),i){delete n.session[e],j(n);return}(typeof t=="string"||t===null)&&(n.session[e]=t),j(n);return}}}l(te,"applyScopedKey");function $(n,e,t){if(!z.some(c=>m(e,c)))return!1;let i=n.accounts??[],o=y(e.activeProfile)??N(n),a=d(m(e,"baseUrl")?e.baseUrl??null:o.baseUrl??process.env.OPENPOND_BASE_URL),u=G(i,o.handle,a);for(let c of z)m(e,c)&&te(u,c,e[c],t);return n.accounts=i,n.activeProfile=P(u),!0}l($,"applyAccountPatch");function F(n,e){if(m(e,"lspEnabled")&&(typeof e.lspEnabled=="boolean"?n.lspEnabled=e.lspEnabled:e.lspEnabled===null&&delete n.lspEnabled),m(e,"executionMode")&&(e.executionMode==="local"||e.executionMode==="hosted"?n.executionMode=e.executionMode:e.executionMode===null&&delete n.executionMode),m(e,"mode")&&(e.mode==="general"||e.mode==="builder"?n.mode=e.mode:e.mode===null&&delete n.mode),m(e,"activeProfile")){let t=y(e.activeProfile);if(t){let s=I(n.accounts??[],t);n.activeProfile=s===-1?t:P((n.accounts??[])[s])}else e.activeProfile===null&&delete n.activeProfile}if(m(e,"openpondProfile")){let t=B(e.openpondProfile);t?n.openpondProfile=t:e.openpondProfile===null&&delete n.openpondProfile}}l(F,"applyTopLevelPatch");async function oe(n){let e=A();await S(e),await L(e,()=>n)}l(oe,"writeGlobalConfig");async function _(n){let e=A();return await S(e),await L(e,t=>{let s=x(t);return n(s),s})}l(_,"updateGlobalConfig");async function Y(){let n=A();return await S(n),x(await H(n))}l(Y,"loadGlobalConfig");async function le(n={}){let e=await Y(),t=e.accounts??[],s=N(e,n.account,n.baseUrl),i=I(t,s,{requireUnambiguous:!0}),o=i===-1?null:t[i],a=o?.session;return{...e,activeProfile:o?P(o):s,apiKey:o?.apiKey,baseUrl:o?.baseUrl,apiBaseUrl:o?.apiBaseUrl,chatApiBaseUrl:o?.chatApiBaseUrl,token:a?.token,appId:a?.appId,conversationId:a?.conversationId}}l(le,"loadConfig");async function J(){let n=await Y(),e=y(n.activeProfile);return(n.accounts??[]).map(t=>{let s=h(t.handle)??U;return{handle:s,baseUrl:d(t.baseUrl),apiBaseUrl:d(t.apiBaseUrl),chatApiBaseUrl:d(t.chatApiBaseUrl),environment:t.environment?.trim()||null,isActive:!!(e&&D({...t,handle:s},e)),hasApiKey:!!t.apiKey?.trim(),hasSessionToken:!!t.session?.token?.trim(),sessionAppId:t.session?.appId??null,sessionConversationId:t.session?.conversationId??null}})}l(J,"listConfiguredProfiles");async function ae(n,e={}){let t=q(n),s=d(e.baseUrl),i=-1;await _(a=>{let u=a.accounts??[];if(i=I(u,s?{handle:t,baseUrl:s}:{handle:t},{requireUnambiguous:!0}),i===-1)throw new Error(`profile not found: ${t}`);a.activeProfile=P(u[i])});let o=await J();return o.find(a=>a.isActive)??o[i]}l(ae,"setActiveProfile");async function ue(n){let e=q(n.handle),t=W(n.apiKey),s=d(n.baseUrl),i=d(n.apiBaseUrl),o=d(n.chatApiBaseUrl),a={handle:e};await _(p=>{let C=p.accounts??[],g=G(C,e,s);g.apiKey=t,s&&(g.baseUrl=s),i?g.apiBaseUrl=i:n.apiBaseUrl===null&&delete g.apiBaseUrl,o?g.chatApiBaseUrl=o:n.chatApiBaseUrl===null&&delete g.chatApiBaseUrl,n.environment===null?delete g.environment:typeof n.environment=="string"&&n.environment.trim()&&(g.environment=n.environment.trim()),p.accounts=C,a=P(g),n.setActive!==!1&&(p.activeProfile=a)});let c=(await J()).find(p=>b(p.handle,a.handle)?s?d(p.baseUrl)===s:!0:!1);if(!c)throw new Error(`failed to save profile: ${e}`);return c}l(ue,"saveProfileApiKey");async function ce(n){let e=x(n);F(e,n),$(e,n,{undefinedDeletes:!0}),await oe(e)}l(ce,"saveConfig");async function de(n){await _(e=>{F(e,n),$(e,n,{undefinedDeletes:!1})})}l(de,"saveGlobalConfig");export{re as a,_ as b,Y as c,le as d,J as e,ae as f,ue as g,ce as h,de as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{c as _}from"./chunk-TJNIYJUH.js";import{e as D,f as k,g as K}from"./chunk-BSHAIAXY.js";import{$ as N,W as y,X as L,Y as U,Z as M,_ as $,f as v,g as B,j as T,u as A}from"./chunk-6LY7GYNK.js";import{d as I}from"./chunk-XRV4WLI7.js";import{b as O}from"./chunk-GLUWATL5.js";import{h as C}from"./chunk-J2S7BOZU.js";import{f as w}from"./chunk-3M53YXEI.js";import{a as o}from"./chunk-FTQLQJQV.js";function ce(e){if(e.repoUrl)return e.repoUrl;if(e.gitHost&&e.gitOwner&&e.gitRepo)return`https://${e.gitHost}/${e.gitOwner}/${e.gitRepo}.git`;throw new Error("repoUrl missing from API response")}o(ce,"resolveRepoUrl");function le(e,t){let n=new URL(e),r=encodeURIComponent(t);return`${n.protocol}//x-access-token:${r}@${n.host}${n.pathname}`}o(le,"formatTokenizedRepoUrl");function fe(e){let t=new URL(e);return`${t.protocol}//x-access-token:$OPENPOND_API_KEY@${t.host}${t.pathname}`}o(fe,"formatTokenizedRepoUrlForPrint");function me(e){return e.replace(/x-access-token:[^@]+@/g,"x-access-token:***@")}o(me,"redactToken");function pe(e){let t=process.env.OPENPOND_BASE_URL;if(t)try{let n=new URL(t).hostname,r=new URL(e).hostname;n&&r&&n!==r&&(console.warn(`warning: repo host (${r}) does not match OPENPOND_BASE_URL (${n})`),console.warn("warning: verify your git host configuration matches OPENPOND_BASE_URL."))}catch{}}o(pe,"warnOnRepoHostMismatch");function W(e){let t=e.split("/").filter(Boolean);if(t.length!==2)throw new Error("expected <handle>/<repo>");return{handle:t[0],repo:t[1]}}o(W,"parseHandleRepo");function S(e){return(e||"").trim().toLowerCase()}o(S,"normalizeRepoName");async function ee(e){if(!e.forceRefresh){let n=await L({apiBase:e.apiBase,apiKey:e.apiKey,ttlMs:y});if(n)return n}let t=await T(e.apiBase,e.apiKey);return await U({apiBase:e.apiBase,apiKey:e.apiKey,apps:t}),t}o(ee,"fetchAppsWithCache");async function Re(e){if(!e.forceRefresh){let r=await M({apiBase:e.apiBase,apiKey:e.apiKey,ttlMs:y});if(r)return r}let t=await A(e.apiBase,e.apiKey),n=Array.isArray(t.tools)?t.tools:[];return await $({apiBase:e.apiBase,apiKey:e.apiKey,tools:n}),n}o(Re,"fetchToolsWithCache");async function Pe(e,t,n){let{handle:r,repo:s}=W(n),i=await ee({apiBase:e,apiKey:t}),a=S(s),d=i.find(u=>u.handle&&u.handle!==r?!1:[u.repo,u.gitRepo,u.id].map(S).includes(a));if(!d)throw new Error(`app not found for ${r}/${s}`);return{app:d,handle:r,repo:s}}o(Pe,"resolveAppTarget");async function Ee(e){let t=e.intervalMs??5e3,n=e.timeoutMs??240*1e3,r=new Set,s=Date.now();for(;Date.now()-s<n;){let a=(await v(e.baseUrl,e.apiKey,e.deploymentId)).filter(u=>!r.has(u.id));for(let u of a)r.add(u.id);for(let u of a)console.log(`${e.prefix}${u.message}`);let d=await B(e.baseUrl,e.apiKey,e.deploymentId);if(d.status==="failed"){console.log(`${e.prefix}deployment failed`);return}if(d.status==="running"||d.status==="deployed"){console.log(`${e.prefix}deployment complete`);return}await new Promise(u=>setTimeout(u,t))}console.log(`${e.prefix}deployment still in progress`)}o(Ee,"pollDeploymentLogs");import{stdin as q,stdout as H}from"node:process";import{createInterface as F}from"node:readline/promises";async function z(){let e=[];for await(let t of process.stdin)e.push(Buffer.isBuffer(t)?t:Buffer.from(String(t)));return Buffer.concat(e).toString("utf8").replace(/\r?\n$/,"")}o(z,"readAllStdin");function V(e){return new Promise((t,n)=>{let r=process.stdin,s=process.stderr,i="",a=r.isRaw;function d(){r.off("data",u),r.setRawMode&&r.setRawMode(a),r.pause(),s.write(`
|
|
3
|
+
`)}o(d,"cleanup");function u(m){let f=Buffer.isBuffer(m)?m:Buffer.from(m);for(let c of f){if(c===3){d(),n(new Error("secret prompt cancelled"));return}if(c===13||c===10){d(),t(i);return}if(c===127||c===8){i.length>0&&(i=i.slice(0,-1),s.write("\b \b"));continue}i+=Buffer.from([c]).toString("utf8"),s.write("*")}}o(u,"onData"),s.write(e),r.resume(),r.setRawMode&&r.setRawMode(!0),r.on("data",u)})}o(V,"readMaskedLine");async function Ae(e,t=!1){let n=F({input:q,output:H});try{let r=t?"[Y/n]":"[y/N]",s=(await n.question(`${e} ${r} `)).trim().toLowerCase();return s?s==="y"||s==="yes":t}finally{n.close()}}o(Ae,"promptConfirm");async function Ie(e){let t=F({input:q,output:H});try{return(await t.question(`Local path (default: ${e}): `)).trim()||e}finally{t.close()}}o(Ie,"promptForPath");var X=["readonly","attempt","feature","rollout","replay","template_build","scheduled_run","patch_only","hotfix","multi_feature_batch"],j=["none","manual","auto_after_checks"],G=[...N];function te(e,t){return(process.env.OPENPOND_SANDBOX_BASE_URL||process.env.OPENPOND_API_URL||e.apiBaseUrl||K(process.env.OPENPOND_BASE_URL||e.baseUrl)||O).replace(/\/$/,"")}o(te,"resolveSandboxBaseUrl");async function We(e){let t=await ne(e),n=k(t),r=await _(t,n),s=D(e)||process.env.OPENPOND_SANDBOX_API_URL?.trim()||null,i=te(t,e);return C(s?{apiKey:r,sandboxApiUrl:s}:{apiKey:r,baseUrl:i})}o(We,"resolveSandboxClient");async function ne(e){return I()}o(ne,"loadSandboxConfig");function qe(e){if(e===void 0)return;if(typeof e!="string"||!e.trim())throw new Error("workflow-mode must be a non-empty value");let t=e.trim();if(!X.includes(t))throw new Error(`workflow-mode must be one of ${X.join(", ")}`);return t}o(qe,"parseSandboxWorkflowModeOption");function He(e){if(e===void 0)return;if(typeof e!="string"||!e.trim())throw new Error("runtime-promotion-policy must be a non-empty value");let t=e.trim();if(!j.includes(t))throw new Error(`runtime-promotion-policy must be one of ${j.join(", ")}`);return t}o(He,"parseSandboxRuntimePromotionPolicyOption");function Fe(e){if(typeof e!="string"||!e.trim())return;let t=e.trim();if(!G.includes(t))throw new Error(`runtime-profile-id must be one of ${G.join(", ")}`);return t}o(Fe,"parseSandboxRuntimeProfileIdOption");function re(e){let t=Y(e.envRef,"env-ref").map(({name:i,value:a})=>({name:i,secretRef:a})),n=Y(e.envLiteral,"env-literal").map(({name:i,value:a})=>{if(oe(i)&&!w(e.allowPlainSecretEnv))throw new Error(`refusing plaintext value for secret-like env ${i}; create a sandbox secret and pass --env-ref ${i}=openpond://secret/...`);return{name:i,value:a}}),r=[...t,...n],s=new Set;for(let i of r){if(s.has(i.name))throw new Error(`duplicate sandbox env var: ${i.name}`);s.add(i.name)}return r}o(re,"parseSandboxEnvOptions");function ze(e,t){let n=re(t),r=new Set(n.map(a=>a.name)),s=new Map(n.map(a=>[a.name,a]));for(let a of e.inputs.env)if(s.get(a.name)?.value!==void 0&&a.secret!==!1)throw new Error(`sandbox template env ${a.name} requires a secret ref. Pass --env-ref ${a.name}=openpond://secret/...`);let i=e.inputs.env.filter(a=>a.required&&!r.has(a.name)).map(a=>a.name);if(i.length>0)throw new Error(`missing required sandbox template env refs: ${i.join(", ")}. Pass --env-ref NAME=openpond://secret/...`);return n}o(ze,"parseSandboxTemplateEnvOptions");function Y(e,t){return typeof e!="string"?[]:e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>{let r=n.indexOf("=");if(r<=0)throw new Error(`${t} entries must use NAME=value`);let s=n.slice(0,r).trim(),i=n.slice(r+1).trim();if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(s))throw new Error(`${t} has invalid env name: ${s}`);if(!i)throw new Error(`${t} value is required for ${s}`);return{name:s,value:i}})}o(Y,"parseSandboxEnvAssignments");function oe(e){return/(?:SECRET|TOKEN|KEY|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|DATABASE_URL|DSN)/i.test(e)}o(oe,"isSecretLikeEnvName");async function Ve(e,t){if(typeof e.value=="string"||typeof e.secretValue=="string")throw new Error("sandbox secret values must be provided with --stdin or the masked prompt");if(w(e.stdin)){let s=await z();if(!s)throw new Error(`${t} read no secret value from stdin`);return s}if(!process.stdin.isTTY)throw new Error(`${t} requires --stdin when not running in a TTY`);let r=await V(`${t}: `);if(!r)throw new Error(`${t} cannot be empty`);return r}o(Ve,"readSandboxSecretValue");function Xe(e){return{id:e.id,teamId:e.teamId,name:e.name,scope:e.scope,status:e.status,secretRef:e.secretRef,currentVersion:e.currentVersion,updatedAt:e.updatedAt,lastUsedAt:e.lastUsedAt,attachedDestinations:e.attachments?.length??0}}o(Xe,"summarizeSandboxSecret");import{Buffer as b}from"node:buffer";import{spawn as Q}from"node:child_process";var ie=600*1e3,se=2*1024*1024;function R(e,t=[],n={}){return n.inherit&&n.terminateWhenStdoutIncludes!==void 0?Promise.reject(new Error("terminateWhenStdoutIncludes requires captured stdout")):n.terminateWhenStdoutIncludes===""?Promise.reject(new Error("terminateWhenStdoutIncludes must not be empty")):new Promise((r,s)=>{let i=Q(e,t,{cwd:n.cwd,env:n.env?{...process.env,...n.env}:void 0,shell:n.shell,detached:n.detached??process.platform!=="win32",stdio:n.inherit?"inherit":[n.stdin===void 0?"ignore":"pipe","pipe","pipe"]}),a=new h(J(n)),d=new h(J(n)),u=!1,m=n.timeoutMs??ie,f,c,x=null,g=!1,P=o(()=>{f&&clearTimeout(f),c&&clearTimeout(c)},"clearTimers"),E=o(l=>{x!==null||g||(x=l,u=l==="timeout",f&&(clearTimeout(f),f=void 0),Z(i.pid,"SIGTERM"),c=setTimeout(()=>{i.exitCode===null&&i.signalCode===null&&Z(i.pid,"SIGKILL")},5e3))},"requestTermination");m>0&&(f=setTimeout(()=>{E("timeout")},m)),n.inherit||(i.stdout?.on("data",l=>{a.append(l);let p=n.terminateWhenStdoutIncludes;p!==void 0&&a.text().includes(p)&&E("output")}),i.stderr?.on("data",l=>{d.append(l)})),i.on("error",l=>{P(),g=!0,s(l)}),i.on("close",(l,p)=>{g||(g=!0,P(),r({code:l,signal:p,terminationReason:x??(p?"signal":"exit"),stdout:a.text(),stderr:d.text(),timedOut:u,stdoutTruncated:a.truncated,stderrTruncated:d.truncated}))}),n.stdin!==void 0&&i.stdin?.end(n.stdin)})}o(R,"runProcessCommand");var h=class{static{o(this,"BoundedOutput")}#t=[];#n;#e=0;truncated=!1;constructor(t){this.#n=t}append(t){let n=b.isBuffer(t)?t:b.from(t),r=this.#n-this.#e;if(r<=0){n.byteLength>0&&(this.truncated=!0);return}if(n.byteLength<=r){this.#t.push(n),this.#e+=n.byteLength;return}this.#t.push(n.subarray(0,r)),this.#e+=r,this.truncated=!0}text(){let t=b.concat(this.#t,this.#e).toString("utf8");return this.truncated?`${t}
|
|
4
|
+
[truncated after ${this.#n} bytes]
|
|
5
|
+
`:t}};function J(e){let t=e.maxOutputBytes??se;return Math.max(0,Math.floor(t))}o(J,"maxOutputBytes");function Z(e,t){if(e){if(process.platform==="win32"){let n=["/PID",String(e),"/T"];t==="SIGKILL"&&n.push("/F"),Q("taskkill",n,{stdio:"ignore",windowsHide:!0}).unref();return}try{process.kill(-e,t)}catch(n){if(n.code!=="ESRCH")throw n}}}o(Z,"terminateProcessTree");async function ae(e,t,n={}){return R(e,t,{cwd:n.cwd,inherit:n.inherit,timeoutMs:n.timeoutMs,maxOutputBytes:n.maxOutputBytes,terminateWhenStdoutIncludes:n.terminateWhenStdoutIncludes})}o(ae,"runCommand");async function rt(e,t={}){let n=t.timeoutSeconds===void 0?void 0:t.timeoutSeconds*1e3;return R(e,[],{cwd:t.cwd,env:t.env,shell:!0,inherit:t.inherit,timeoutMs:n,maxOutputBytes:t.maxOutputBytes})}o(rt,"runShellCommand");async function ot(e,t){let n=await ae("git",["remote","get-url",t],{cwd:e});if(n.code!==0)return null;let r=n.stdout.trim();return r.length>0?r:null}o(ot,"getGitRemoteUrl");export{ce as a,le as b,fe as c,me as d,pe as e,S as f,ee as g,Re as h,Pe as i,Ee as j,Ae as k,Ie as l,We as m,qe as n,He as o,Fe as p,re as q,ze as r,Ve as s,Xe as t,R as u,ae as v,rt as w,ot as x};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as be,b as Ae,c as Ie,d as ve}from"./chunk-
|
|
2
|
+
import{a as be,b as Ae,c as Ie,d as ve}from"./chunk-7TV2VBSD.js";import{c as O,i as L}from"./chunk-XRV4WLI7.js";import{a as Re}from"./chunk-6FA3GG5B.js";import{f as Oe}from"./chunk-H7IWJN7L.js";import{a as s}from"./chunk-FTQLQJQV.js";var J=class extends Error{static{s(this,"OpenPondProfileSetupRequiredError")}code="agent_source_setup_required";details;constructor(t,n){let o=n.blockingRequirements.map(r=>r.label);super(["agent_source_setup_required",`Profile action ${t} has unresolved required setup.`,o.length?`Missing setup: ${o.join(", ")}`:""].filter(Boolean).join(`
|
|
3
3
|
`)),this.name="OpenPondProfileSetupRequiredError",this.details={error:"agent_source_setup_required",actionId:t,setupGate:n,missing:o,blockingSetupRequirements:n.blockingRequirements,setupRequirements:n.requirements}}};function W(e){let t=new Map;for(let a of e.sourceSetupRequirements??[]){let l=bt(a);if(e.actionId&&l&&l!==e.actionId&&h(a.actionName)!==e.actionId&&h(a.sourceActionId)!==e.actionId)continue;let c=Ee({record:a,source:"source_upload_metadata",actionId:l});c&&t.set(c.ref,c)}for(let a of e.actionCatalog)if(!(e.actionId&&a.id!==e.actionId&&a.name!==e.actionId))for(let l of a.setupRequirements??[]){let c=Ee({record:l,source:"action_catalog",actionId:a.id});c&&t.set(c.ref,c)}let n=Array.from(t.values()),o=n.filter(a=>a.blocking),r=n.filter(a=>!a.required&&!ne(a.status)).length,i=n.filter(a=>ne(a.status)).length;return{status:It(o),requirementCount:n.length,blockingCount:o.length,optionalMissingCount:r,readyCount:i,requirements:n,blockingRequirements:o}}s(W,"buildOpenPondProfileSetupGate");function oe(e,t){if(t.blockingRequirements.length>0)throw new J(e,t)}s(oe,"assertOpenPondProfileActionReady");function Rt(e){let t=e.actionId?`${e.actionId}: `:"",n=e.required?"required":"optional";return`${t}${e.label} (${n}, ${e.status})`}s(Rt,"formatOpenPondProfileSetupRequirement");function Ee(e){let t=e.source==="action_catalog"&&h(e.record.source)==="source_upload_metadata"?"source_upload_metadata":e.source,n=h(e.record.kind)??h(e.record.type),o=h(e.record.label)??h(e.record.name)??h(e.record.key)??h(e.record.provider)??h(e.record.tool)??h(e.record.command)??h(e.record.packageName)??h(e.record.path)??h(e.record.repo)??h(e.record.url)??h(e.record.id)??n??"setup requirement",r=e.record.required!==!1,i=At(e.record);return{ref:[t,e.actionId??"source",n??"requirement",o].join(":"),source:t,actionId:e.actionId,kind:n,label:o,status:i,required:r,blocking:r&&!ne(i)}}s(Ee,"setupRequirementFromRecord");function bt(e){return h(e.actionId)??h(e.sourceActionId)??h(e.actionName)}s(bt,"setupRequirementActionId");function At(e){let t=h(e.status)??h(e.state);return t?t==="satisfied"||t==="connected"||t==="provided"?"ready":t:typeof e.satisfied=="boolean"?e.satisfied?"ready":"setup_required":typeof e.ready=="boolean"&&e.ready?"ready":"setup_required"}s(At,"setupStatus");function It(e){return e.length===0?"ready":e.some(t=>["blocked","unsupported","unsupported_dependency","stale"].includes(t.status))?"blocked":"setup_required"}s(It,"gateStatus");function ne(e){return e==="ready"||e==="disabled"}s(ne,"isReadyStatus");function h(e){return typeof e=="string"&&e.trim()?e.trim():null}s(h,"text");import{stat as qt}from"node:fs/promises";import se from"node:path";import{spawn as vt}from"node:child_process";import{existsSync as re}from"node:fs";import{readFile as Et,rm as Kn,writeFile as _e}from"node:fs/promises";import ie from"node:path";var Le=["**/node_modules/","**/.bun/","**/.env","**/.env.*","**/.openpond/traces/","**/.openpond/vendor/","**/.openpond/eval-results.json","**/.openpond/artifact-index.json","**/.openpond/source-upload-cache.json",""].join(`
|
|
4
4
|
`);async function Me(e){if(!re(ie.join(e,".git"))){let i=await R(e,["init","-b","main"]);if(i.code!==0)throw new Error(H("git init",i))}let t=ie.join(e,".gitignore");if(re(t)?await xt(t):await _e(t,Le,"utf8"),await _t(e))return;let n=await N(e);if(!n.dirty&&n.files.length===0)return;let o=await R(e,["add","-A"]);if(o.code!==0)throw new Error(H("git add",o));let r=await R(e,["commit","-m","Initialize OpenPond profile"],{env:{...process.env,GIT_AUTHOR_NAME:process.env.GIT_AUTHOR_NAME||"OpenPond",GIT_AUTHOR_EMAIL:process.env.GIT_AUTHOR_EMAIL||"openpond@example.invalid",GIT_COMMITTER_NAME:process.env.GIT_COMMITTER_NAME||"OpenPond",GIT_COMMITTER_EMAIL:process.env.GIT_COMMITTER_EMAIL||"openpond@example.invalid"}});if(r.code!==0&&!/nothing to commit/i.test(r.stdout+r.stderr))throw new Error(H("git commit",r))}s(Me,"ensureProfileGitRepo");async function xt(e){let t=await Et(e,"utf8").catch(()=>""),n=Le.split(/\r?\n/).map(r=>r.trim()).filter(Boolean).filter(r=>!t.split(/\r?\n/).some(i=>i.trim()===r));if(n.length===0)return;let o=t.endsWith(`
|
|
5
5
|
`)||t.length===0?"":`
|
|
@@ -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-UBHTZJEV.js";import"./chunk-3YSCXFE6.js";import"./chunk-RBQZVQQM.js";import"./chunk-WK5HTGXV.js";import"./chunk-M4CJXPMH.js";import"./chunk-TR37PJIQ.js";import"./chunk-6MI4KKWF.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-J2S7BOZU.js";import"./chunk-D6BBQHZM.js";import"./chunk-6FA3GG5B.js";import"./chunk-F4WS5QIT.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-AC2M2HO3.js";import{Aa as C,Ab as T,Ca as m,Da as j,Ea as x,Fa as F,Ga as v,Ha as P,Sa as J,b as d,c as w,e as b,fb as N,gb as q,jb as k,lb as A,mb as B,pb as H,qb as I,yb as E,zb as M}from"./chunk-F4WS5QIT.js";import"./chunk-ES2ISFJC.js";import{d as O,f as S,h as g}from"./chunk-H7IWJN7L.js";import"./chunk-F3VURV3Q.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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as V,c as D}from"./chunk-
|
|
2
|
+
import{a as V,c as D}from"./chunk-6XF4GI35.js";import{c as U}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as M}from"./chunk-6MI4KKWF.js";import"./chunk-GLUWATL5.js";import{a as J}from"./chunk-6FA3GG5B.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
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
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
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}.
|
|
@@ -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-M4VGRNP6.js";import"./chunk-Y2NQXJ2Q.js";import"./chunk-TJNIYJUH.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-OGPHXXCD.js";import"./chunk-KLSLHUTO.js";import"./chunk-6LY7GYNK.js";import"./chunk-XRV4WLI7.js";import"./chunk-GLUWATL5.js";import"./chunk-4KDHMGKI.js";import"./chunk-J2S7BOZU.js";import"./chunk-D6BBQHZM.js";import"./chunk-AC2M2HO3.js";import"./chunk-F4WS5QIT.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-F3VURV3Q.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,3 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{u as f}from"./chunk-Y2NQXJ2Q.js";import"./chunk-TJNIYJUH.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-OGPHXXCD.js";import"./chunk-KLSLHUTO.js";import"./chunk-6LY7GYNK.js";import"./chunk-XRV4WLI7.js";import"./chunk-GLUWATL5.js";import"./chunk-4KDHMGKI.js";import"./chunk-J2S7BOZU.js";import"./chunk-D6BBQHZM.js";import{a as c}from"./chunk-AC2M2HO3.js";import"./chunk-F4WS5QIT.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-F3VURV3Q.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 ga,Aa as A,Ab as Ha,Ba as B,Bb as Ia,Ca as C,Da as D,Ea as E,Fa as F,Ga as G,Ha as H,Ia as I,Ja as J,Ka as K,La as L,Ma as M,Na as N,Oa as O,Pa as W,Qa as X,Ra as Y,Sa as Z,Ta as _,Ua as $,Va as aa,Wa as ba,Xa as ca,Ya as da,Za as ea,_a as fa,a as l,ab as ha,b as m,bb as ia,c as n,cb as ja,d as o,db as ka,e as p,eb as la,f as q,fb as ma,g as r,gb as na,h as s,hb as oa,i as t,ib as pa,j as u,jb as qa,kb as ra,lb as sa,mb as ta,nb as ua,ob as va,pb as wa,qb as xa,rb as ya,sb as za,tb as Aa,ub as Ba,va as v,vb as Ca,wa as w,wb as Da,xa as x,xb as Ea,ya as y,yb as Fa,za as z,zb as Ga}from"./chunk-F4WS5QIT.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};
|