openpond 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-server.d.ts +6 -0
- package/dist/app-server.js +1 -1
- package/dist/chunks/{actions-command-V5DZWEON.js → actions-command-Q5HXY5XD.js} +1 -1
- package/dist/chunks/{app-layer-Y7SEYQCA.js → app-layer-S6H572UM.js} +1 -1
- package/dist/chunks/app-server-runtime-GIFUDGYZ.js +2 -0
- package/dist/chunks/{apps-HSS4KWPK.js → apps-K5HMFAPI.js} +1 -1
- package/dist/chunks/{chunk-3T5XJEDM.js → chunk-3GLSX322.js} +2 -2
- package/dist/chunks/{chunk-3DJF6IZ7.js → chunk-3V5FPSOK.js} +1 -1
- package/dist/chunks/{chunk-WW5SGVGJ.js → chunk-3YH3S5U2.js} +1 -1
- package/dist/chunks/{chunk-LCKCUSP7.js → chunk-ECH6PXVK.js} +1 -1
- package/dist/chunks/{chunk-UW6ES5DM.js → chunk-I4FOBNHQ.js} +15 -15
- package/dist/chunks/chunk-MPQWFPGA.js +5 -0
- package/dist/chunks/{chunk-B3RE35SQ.js → chunk-MSF7ZBFG.js} +1 -1
- package/dist/chunks/{chunk-RPS53CGT.js → chunk-NHBCFMAC.js} +1 -1
- package/dist/chunks/{chunk-2I4W24NK.js → chunk-NYPLOXEP.js} +1 -1
- package/dist/chunks/{chunk-J2MP4LSF.js → chunk-OHGSESPN.js} +1 -1
- package/dist/chunks/chunk-OW4KET6I.js +5 -0
- package/dist/chunks/{chunk-O4IARD7H.js → chunk-R33VLNFY.js} +1 -1
- package/dist/chunks/{chunk-ENCAWWFY.js → chunk-XK77GSBL.js} +346 -337
- package/dist/chunks/{chunk-GA7VBKCH.js → chunk-ZMRT4B4H.js} +14 -14
- package/dist/chunks/{cli-KSVNPTUC.js → cli-XJJYXKXM.js} +1 -1
- package/dist/chunks/{configuration-command-QFJTY4ZU.js → configuration-command-Q7XVBZ2E.js} +1 -1
- package/dist/chunks/{core-commands-TO3M5MO4.js → core-commands-6GZ7T4SK.js} +1 -1
- package/dist/chunks/{desktop-test-5SU5G4FN.js → desktop-test-EKPOPWTL.js} +1 -1
- package/dist/chunks/{extension-DCZ5DPRY.js → extension-A2BWJMRQ.js} +1 -1
- package/dist/chunks/{help-IHCPRO43.js → help-MTWG7AXZ.js} +1 -1
- package/dist/chunks/{opchat-YQVCNDDK.js → opchat-4QGK6MRL.js} +1 -1
- package/dist/chunks/{organizations-TJAS5AO2.js → organizations-TTUM577J.js} +1 -1
- package/dist/chunks/{profile-2XAUWXP5.js → profile-C33CIJOV.js} +1 -1
- package/dist/chunks/{project-agent-EN66WJBL.js → project-agent-5P3ALPRY.js} +1 -1
- package/dist/chunks/{sandbox-command-LYUXPY4U.js → sandbox-command-CEIXSDW2.js} +1 -1
- package/dist/chunks/{sandbox-template-HXH2CSY4.js → sandbox-template-KTKWVKZ7.js} +1 -1
- package/dist/chunks/src-7NWHHROY.js +319 -0
- package/dist/chunks/{src-4DML3FLR.js → src-ZAF6VEWJ.js} +1 -1
- package/dist/chunks/{teams-bot-YH7QUK2N.js → teams-bot-O7IFQ3L6.js} +1 -1
- package/dist/chunks/{workspaces-DC33D43W.js → workspaces-I5BVMFVY.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/assets/{App-Br9-pOIC.js → App-BqgpZNh-.js} +33 -33
- package/dist/web/assets/{AppDialog-C6Xd84LF.js → AppDialog-BCzsyF8y.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-CjLTHGd7.js → AppTerminalPanel-Cqtaoc93.js} +2 -2
- package/dist/web/assets/{AppsView-BaOXLPG_.js → AppsView-BHz8ruGV.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-C1UHkaci.js → BrowserSidebar-vrHh2y_s.js} +1 -1
- package/dist/web/assets/{CartesianChart-CC6gURj1.js → CartesianChart-C5PgQkxh.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-D3v9jxIV.js → CollaborationTabs-OSqxEZgD.js} +1 -1
- package/dist/web/assets/{CommandMenu-DZJ4xot1.js → CommandMenu-XMeH3T6m.js} +1 -1
- package/dist/web/assets/{CommunityView-VElVyeHB.js → CommunityView-BPsy_BnG.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-D_Pldm1h.js → ComposerCreateImproveStrip-Bsh9eyj1.js} +1 -1
- package/dist/web/assets/{GetStartedView-Ciy_6VB-.js → GetStartedView-Ay67q9mX.js} +1 -1
- package/dist/web/assets/HostedModelLearningReview-C8PfSxcz.js +1 -0
- package/dist/web/assets/{HostedModelLearningSettings-Cba2jDOj.js → HostedModelLearningSettings-MG_1VD7H.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-YGGjl8dY.js → LabModelVersionDetailPage-CPkCZhBg.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-D55wufz-.js → LabSkillSidebar-Y06Ghxe7.js} +1 -1
- package/dist/web/assets/{LabsRoute-BvJAvcAo.js → LabsRoute-CBy4evwc.js} +4 -4
- package/dist/web/assets/{MainChatThread-CQ9hEgUz.js → MainChatThread-CqG9WewR.js} +2 -2
- package/dist/web/assets/{MainPane-CH2CUmxD.js → MainPane-CQVCd0hz.js} +4 -4
- package/dist/web/assets/{MarkdownText-B7CT2cwK.js → MarkdownText-BSXFJB5s.js} +1 -1
- package/dist/web/assets/{Messages-9_Bf5Lii.js → Messages-CcKLreir.js} +1 -1
- package/dist/web/assets/{NativeSkillSidebar-BIpYM4uF.js → NativeSkillSidebar-BF4T1Tuy.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-D6RLDRgD.js → NewExperienceSwitcher-BH2-_iQt.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-DlnYnpsm.js → NewProjectDialog-BSkPgqLX.js} +1 -1
- package/dist/web/assets/{OutputsPage-D1JY14ij.js → OutputsPage-DBAfj1e_.js} +1 -1
- package/dist/web/assets/{ProjectsPage-kRy0z4oP.js → ProjectsPage-DOTViI5-.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-D0Zdekbb.js → RightChatPanelStack-D3wuMm3F.js} +1 -1
- package/dist/web/assets/{RightSidebarHomePanel-BCW78Zbx.js → RightSidebarHomePanel-DLP1LFoX.js} +1 -1
- package/dist/web/assets/{ScheduledWorkPage-D2iewjFh.js → ScheduledWorkPage-BETU42Pi.js} +1 -1
- package/dist/web/assets/{SettingsView-CLSg--Vp.css → SettingsView-B9Tn0_zX.css} +1 -1
- package/dist/web/assets/SettingsView-D2eKwMH6.js +9 -0
- package/dist/web/assets/{TeamChatView-BhcWyJXF.js → TeamChatView-ytGArG3p.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-GXVklUL1.js → TerminalOverlay-FV-T6Vk6.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-DPEt3Kcq.js → TrainingCreationPanel-D7UhsNpa.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-BiYk2Ti6.js → TrainingDraftPanel-BZ4ZhYbm.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-DOR-WjP_.js → UsageSettingsSection-Ml9cMCUi.js} +1 -1
- package/dist/web/assets/{WorkSidebarPanel-MFyj6kAC.js → WorkSidebarPanel-DZZK0_vI.js} +1 -1
- package/dist/web/assets/{WorkspaceDiffPanel-Dhk5IRNe.js → WorkspaceDiffPanel-CSLiV2LC.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-CR-2HGxj.js → WorkspaceEnvironmentMenu-dqDA6sik.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-YTvn4Rpj.js → WorkspaceGitDialogs-C9ptN_7-.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-C_NHJaDf.js → WorkspaceMonacoEditor-BOa6xAaO.js} +3 -3
- package/dist/web/assets/{arrow-up-right-B_joTAq0.js → arrow-up-right-Qq_YNPUt.js} +1 -1
- package/dist/web/assets/{chat-file-links-CtG3brZZ.js → chat-file-links-z54bmvhH.js} +1 -1
- package/dist/web/assets/chevron-up-CIrVx_eP.js +1 -0
- package/dist/web/assets/{clipboard-BuMCABK6.js → clipboard-C_cLfHiu.js} +1 -1
- package/dist/web/assets/{cloud-upload-Cx6hdgxq.js → cloud-upload-B1A_725d.js} +1 -1
- package/dist/web/assets/{cssMode-DgBmbKa2.js → cssMode-DKjB86V7.js} +1 -1
- package/dist/web/assets/{folder-open-CbqwcgQ4.js → folder-open-BAqrqIkA.js} +1 -1
- package/dist/web/assets/{folder-plus-DsZqlrho.js → folder-plus-Aw6rEy1D.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-DI-UCrjd.js → git-commit-horizontal-75RSWQ3Q.js} +1 -1
- package/dist/web/assets/{htmlMode-BuyogX60.js → htmlMode-CH03ACqd.js} +1 -1
- package/dist/web/assets/{index-BPeus0zA.js → index-C0gdp_hv.js} +2 -2
- package/dist/web/assets/{info-Csd_7rfz.js → info-CXzXdZ1o.js} +1 -1
- package/dist/web/assets/{jsonMode-DflDpOXZ.js → jsonMode-Bvmzl5ln.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-C_Z8VeHY.js → lspLanguageFeatures-BKXLyuIE.js} +1 -1
- package/dist/web/assets/{minimize-2-CiM53hsa.js → minimize-2-C-6SC3Bs.js} +1 -1
- package/dist/web/assets/{monaco.contribution-JwSEb0Jo.js → monaco.contribution-BON5T_eJ.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CGcq8kux.js → monaco.contribution-BwSCuTR3.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CRL61P2H.js → monaco.contribution-Cv_QTWVQ.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BINeU8ff.js → monaco.contribution-rtAnmt_x.js} +2 -2
- package/dist/web/assets/{play-DkIcSdr1.js → play-BnkiBq8x.js} +1 -1
- package/dist/web/assets/{python--dgmZUVn.js → python-Rd5MxRAN.js} +1 -1
- package/dist/web/assets/{refresh-cw-DgmxGLBV.js → refresh-cw-BISaiIBt.js} +1 -1
- package/dist/web/assets/{save-C_D7xpZD.js → save-BcVbYiGU.js} +1 -1
- package/dist/web/assets/{square-BcHQSDWK.js → square-Bn32OIid.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-8waBinRS.js → toggleHighContrast-DDw4wPS9.js} +1 -1
- package/dist/web/assets/{tsMode-BBuDuuGt.js → tsMode-Dt73U5ww.js} +1 -1
- package/dist/web/assets/{upload-C7vLlEEp.js → upload-AB1N3bCZ.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-Bjl2NojO.js → useLocalAgentSchedules-D7QTyYKj.js} +1 -1
- package/dist/web/assets/{wifi-off-BLh536Wc.js → wifi-off-BAX1UWLx.js} +1 -1
- package/dist/web/assets/{workers-B6wHgIsA.js → workers-DE3-vPyS.js} +1 -1
- package/dist/web/assets/{yaml-8rW7oQNv.js → yaml-C0JBPZbg.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/chunks/app-server-runtime-R7O7EWVF.js +0 -2
- package/dist/chunks/chunk-5NGYLR3V.js +0 -5
- package/dist/chunks/chunk-B6IIGPWS.js +0 -6
- package/dist/chunks/src-KE3LWA75.js +0 -319
- package/dist/web/assets/HostedModelLearningReview-__PVEYUw.js +0 -1
- package/dist/web/assets/SettingsView-JjtvXV3D.js +0 -9
- package/dist/web/assets/chevron-up-BKSpg6hY.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{A as F,a as fe,b as L,c as R,d as me,e as D,f as G,g as j,h as z,j as ye,l as T,m as we,n as S,o as he,y as B}from"./chunk-G2VYRU27.js";import{b as H,c as be,d as ve,f as w,h as P,i as Re}from"./chunk-ZVOO7FKM.js";import{$ as ge,M as ce,N as le,R as de,V as pe,Z as y,_ as ue,aa as C,h as $,i as ne,l as oe,n as re,o as ie,p as ae,q as se}from"./chunk-SS3EG6S2.js";import{a as Z,b as ee,c as te}from"./chunk-3T5XJEDM.js";import{a as M,f as v,k as X}from"./chunk-3M53YXEI.js";import{a as g}from"./chunk-FTQLQJQV.js";import{promises as V,existsSync as W}from"node:fs";import U from"node:path";import{stdin as $e}from"node:process";async function Ge(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=await ie(n,i,a.id);console.log(JSON.stringify(s,null,2))}g(Ge,"runTemplateStatus");async function je(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=await ae(n,i,a.id);console.log(JSON.stringify(s,null,2))}g(je,"runTemplateBranches");async function ze(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,f=X(s),c=await se(n,i,a.id,{environment:f});console.log(JSON.stringify(c,null,2))}g(ze,"runTemplateUpdate");async function He(e){let o=await y(),t=w(o),r=typeof e.apiKey=="string"?e.apiKey:typeof e.key=="string"?e.key:null,n=r?r.trim():await L();if(!n)throw new Error("API key is required");n.startsWith("opk_")||console.log("warning: API keys usually start with opk_."),await C({handle:o.activeProfile?.handle||"default",apiKey:n,baseUrl:t,apiBaseUrl:o.apiBaseUrl,chatApiBaseUrl:o.chatApiBaseUrl,setActive:!0}),console.log("Saved account credentials to the encrypted OpenPond credential store.")}g(He,"runLogin");async function Fe(e,o){let t=o[0]||"list";if(t==="list"){let r=await ue();console.log(JSON.stringify({profiles:r},null,2));return}if(t==="use"){let r=o[1];if(!r)throw new Error("usage: profiles use <name> [--base-url <url>]");let n=await ge(r,{baseUrl:H(e)});console.log(JSON.stringify({profile:n},null,2));return}if(t==="save"){let r=o[1];if(!r)throw new Error("usage: profiles save <name> --api-key <key> [--base-url <url>] [--api-base-url <url>] [--chat-api-base-url <url>]");let n=typeof e.apiKey=="string"?e.apiKey:typeof e.key=="string"?e.key:null,i=n?n.trim():await L(),a=typeof e.environment=="string"?e.environment:typeof e.env=="string"?e.env:void 0,s=await C({handle:r,apiKey:i,baseUrl:H(e),apiBaseUrl:be(e),chatApiBaseUrl:ve(e),environment:a,setActive:!0});console.log(JSON.stringify({profile:s},null,2));return}throw new Error("usage: profiles <list|use|save> [args]")}g(Fe,"runProfiles");async function Ve(){let e=await y(),o=w(e),t=P(e),r=await R(e,o),n=await ce(t,r);console.log(JSON.stringify(n,null,2))}g(Ve,"runAccount");async function We(e){let o=await y(),t=P(o),r=fe(o),n=await le(t,r);console.log(JSON.stringify(n,null,2))}g(We,"runHealth");async function qe(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=typeof e.branch=="string"?String(e.branch):void 0,f=await $(n,i,a.id,{branch:s});if(!f?.id){console.log("no deployments found");return}let c=await ne(n,i,f.id),d=(c&&Array.isArray(c.toolsJson)?c.toolsJson:null)||(c&&typeof c.metadataJson=="object"&&c.metadataJson?c.metadataJson.tools:null),u=Array.isArray(d)?d:[];if(u.length===0){console.log("no tools found");return}for(let l of u){let m=l,h=m.profile||m.function,I=m.name||h?.name||"unknown",p=m.description||h?.description||"";console.log(p?`${I} - ${p}`:I)}}g(qe,"runToolList");async function Ye(e,o,t){let r=await y(),n=w(r),i=P(r),a=await R(r,n),{app:s}=await T(i,a,o),f=typeof e.branch=="string"?String(e.branch):void 0,c=await $(i,a,s.id,{branch:f});if(!c?.id)throw new Error("no deployments found");let d;if(typeof e.body=="string")try{d=JSON.parse(e.body)}catch{throw new Error("tool body must be valid JSON")}let u=typeof e.method=="string"?String(e.method).toUpperCase():"POST",l=await pe(n,a,{appId:s.id,deploymentId:c.id,toolName:t,method:u,body:d,headers:a?{"openpond-api-key":a}:void 0});if(!l.ok)throw new Error(l.error||`tool failed (${l.status})`);let m=l.data??{ok:!0};console.log(JSON.stringify(m,null,2))}g(Ye,"runToolRun");async function Qe(e,o,t){let r=await y(),n=w(r),i=P(r),a=await R(r,n),{app:s}=await T(i,a,o),f=typeof e.branch=="string"?String(e.branch):void 0,c=typeof e.deploymentId=="string"?String(e.deploymentId):void 0,d=c?{id:c}:await $(i,a,s.id,{branch:f});if(!d?.id)throw new Error("no deployments found");let u=typeof e.body=="string"?M(String(e.body),"body"):{};if(!u||typeof u!="object"||Array.isArray(u))throw new Error("body must be a JSON object");let l=typeof e.method=="string"?String(e.method).toUpperCase():"POST",m={...u,appId:s.id,deploymentId:d.id,toolName:t,method:l},h=await de(i,a,m);console.log(JSON.stringify(h,null,2))}g(Qe,"runBacktestRun");async function Xe(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a,handle:s,repo:f}=await T(n,i,o),c=typeof e.branch=="string"?String(e.branch):void 0,d=typeof e.deploymentId=="string"?String(e.deploymentId):void 0,u=d?{id:d}:await $(n,i,a.id,{branch:c});if(!u?.id){console.log("no deployments found");return}await we({baseUrl:n,apiKey:i,deploymentId:u.id,prefix:`[${s}/${f}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}g(Xe,"runDeployWatch");async function Ze(e,o){let r=((typeof e.name=="string"?e.name:null)||o.join(" ")).trim();if(!r)throw new Error("usage: repo create --name <name> [--team-id <id>] [--path <dir>] [--template <owner/repo|url>] [--template-branch <branch>] [--empty|--opentool] [--sandbox] [--token] [--auto-schedule-migration <true|false>]");let n=await y(),i=w(n),a=await R(n,i),s=P(n),f=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0,c=typeof e.template=="string"?e.template.trim():"";if(c&&(e.empty==="true"||e.opentool==="true"))throw new Error("choose one: --template or --empty/--opentool");if(e.empty==="true"&&e.opentool==="true")throw new Error("choose one: --empty or --opentool");let d=typeof e.description=="string"?e.description.trim():void 0,u=typeof e.templateBranch=="string"&&e.templateBranch.trim().length>0?e.templateBranch.trim():void 0,l=typeof e.env=="string"?M(e.env,"env"):void 0;if(l){if(typeof l!="object"||Array.isArray(l))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(l))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}if(c){e.deployOnPush!==void 0&&console.warn("deploy-on-push is not used for template create (auto deploys)");let b=Re(c,i),k=(await re(s,a,[{name:r,...d?{description:d}:{},templateRepoUrl:b,...u?{templateBranch:u}:{},...l?{envVars:l}:{}}],f)).items?.[0];if(!k||k.status!=="ok"||!k.appId)throw new Error(k?.error||"Template create failed");console.log(`app_id: ${k.appId}`),k.deploymentId&&console.log(`deployment_id: ${k.deploymentId}`),k.conversationId&&console.log(`conversation_id: ${k.conversationId}`);return}let m=process.cwd(),h=typeof e.path=="string"?e.path:typeof e.dir=="string"?e.dir:null,I=h&&h.trim().length>0?h.trim():$e.isTTY?await he(m):m,p=U.resolve(I);if(W(p)){if(!(await V.stat(p)).isDirectory())throw new Error(`path is not a directory: ${p}`)}else await V.mkdir(p,{recursive:!0});let Pe=(await V.readdir(p)).filter(b=>b!==".git").length===0,x=v(e.yes)||v(e.force);if(!Pe&&!x&&!await S(`Directory is not empty (${p}). Continue?`,!1)){console.log("aborted");return}let ke=U.join(p,".git");if(!W(ke)){if(!(x?!0:await S("Initialize git repository here?",!0))){console.log("aborted");return}let A=await B("git",["init"],{cwd:p});if(A.code!==0)throw new Error(`git init failed: ${A.stderr.trim()||A.stdout.trim()||"unknown error"}`)}let K=await F(p,"origin");if(K&&!x&&!await S(`Remote "origin" already set (${K}). Replace it?`,!1)){console.log("aborted");return}let q=e.opentool==="true"?"opentool":"empty",Te=v(e.sandbox),Be=v(e.deployOnPush),N=e.autoScheduleMigration,Y=typeof N=="string"||typeof N=="boolean",Ee=Y?v(N):void 0,E=await oe(s,a,{name:r,...f?{teamId:f}:{},...d?{description:d}:{},...q?{repoInit:q}:{},...Te?{sandbox:!0}:{},...l?{envVars:l}:{},...Be?{deployOnPush:!0}:{},...Y?{autoScheduleMigration:Ee}:{}}),O=me(E);z(O);let J=v(e.token)||v(e.setRemoteToken),Oe=D(O,a),Q=J?Oe:O,_=await B("git",K?["remote","set-url","origin",Q]:["remote","add","origin",Q],{cwd:p});if(_.code!==0)throw new Error(`git remote failed: ${j(_.stderr.trim()||_.stdout.trim()||"unknown error")}`);let Ae=J?G(O):O;console.log(`app_id: ${E.appId}`),E.gitOwner&&E.gitRepo&&console.log(`repo: ${E.gitOwner}/${E.gitRepo}`),console.log(`remote: ${Ae}`),console.log('next: git add . && git commit -m "init"');let Ie=E.defaultBranch||"master";console.log(`next: openpond repo push --path ${p} --branch ${Ie}`),J||console.log(`token-remote (non-interactive): git -C ${p} remote set-url origin ${G(O)}`);try{await ye({apiBase:s,apiKey:a,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}g(Ze,"runRepoCreate");async function Se(e){let o=await B("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e});if(o.code!==0)return null;let t=o.stdout.trim();return t.length>0?t:null}g(Se,"resolveGitBranch");async function et(e){let o=await y(),t=w(o),r=await R(o,t),n=typeof e.path=="string"?e.path:typeof e.dir=="string"?e.dir:null,i=U.resolve(n&&n.trim().length>0?n.trim():"."),a=U.join(i,".git");if(!W(a))throw new Error(`git repo not found at ${i} (missing .git)`);let s=await F(i,"origin");if(!s)throw new Error("origin remote not set; run `openpond repo create` first");z(s);let c=(typeof e.branch=="string"?e.branch.trim():"")||await Se(i);if(!c)throw new Error("unable to resolve git branch; pass --branch");let d;try{d=D(s,r)}catch{throw new Error("origin remote must be https for tokenized pushes")}let u=v(e.keepTokenRemote)||v(e.token)||v(e.setRemoteToken),l=s.includes("x-access-token:"),m=!u&&!l?s:null,h=process.env.GIT_TERMINAL_PROMPT;process.env.GIT_TERMINAL_PROMPT="0";try{if(!l){let p=await B("git",["remote","set-url","origin",d],{cwd:i});if(p.code!==0)throw new Error(`git remote set-url failed: ${j(p.stderr.trim()||p.stdout.trim()||"unknown error")}`)}if((await B("git",["push","-u","origin",c],{cwd:i,inherit:!0})).code!==0)throw new Error("git push failed")}finally{m&&await B("git",["remote","set-url","origin",m],{cwd:i}).catch(()=>null),h===void 0?delete process.env.GIT_TERMINAL_PROMPT:process.env.GIT_TERMINAL_PROMPT=h}}g(et,"runRepoPush");async function tt(e){if(e.length===0)throw new Error("usage: opentool <init|validate|build> [args]");let o=process.platform==="win32"?"npx.cmd":"npx";if((await B(o,["opentool",...e],{inherit:!0})).code!==0)throw new Error("opentool command failed")}g(tt,"runOpentool");async function nt(){let e="openpond",o=Z(),t=await te(e),r=`npm i -g ${e}@${t}`,n=ee(o,t);if(n===0){console.log(`${e} is up to date (${o})`);return}if(n===-1){console.log(`Update available: ${o} -> ${t}`),console.log(`Run: ${r}`);return}if(n===1){console.log(`Installed version (${o}) is newer than npm latest (${t}).`);return}if(o===t){console.log(`${e} is up to date (${o})`);return}console.log(`Installed: ${o}`),console.log(`Latest: ${t}`),console.log(`Run: ${r}`)}g(nt,"runCheckUpdate");export{Ge as a,je as b,ze as c,He as d,Fe as e,Ve as f,We as g,qe as h,Ye as i,Qe as j,Xe as k,Ze as l,Se as m,et as n,tt as o,nt as p};
|
|
2
|
+
import{A as F,a as fe,b as L,c as R,d as me,e as D,f as G,g as j,h as z,j as ye,l as T,m as we,n as S,o as he,y as B}from"./chunk-G2VYRU27.js";import{b as H,c as be,d as ve,f as w,h as P,i as Re}from"./chunk-ZVOO7FKM.js";import{$ as ge,M as ce,N as le,R as de,V as pe,Z as y,_ as ue,aa as C,h as $,i as ne,l as oe,n as re,o as ie,p as ae,q as se}from"./chunk-SS3EG6S2.js";import{a as Z,b as ee,c as te}from"./chunk-3GLSX322.js";import{a as M,f as v,k as X}from"./chunk-3M53YXEI.js";import{a as g}from"./chunk-FTQLQJQV.js";import{promises as V,existsSync as W}from"node:fs";import U from"node:path";import{stdin as $e}from"node:process";async function Ge(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=await ie(n,i,a.id);console.log(JSON.stringify(s,null,2))}g(Ge,"runTemplateStatus");async function je(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=await ae(n,i,a.id);console.log(JSON.stringify(s,null,2))}g(je,"runTemplateBranches");async function ze(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,f=X(s),c=await se(n,i,a.id,{environment:f});console.log(JSON.stringify(c,null,2))}g(ze,"runTemplateUpdate");async function He(e){let o=await y(),t=w(o),r=typeof e.apiKey=="string"?e.apiKey:typeof e.key=="string"?e.key:null,n=r?r.trim():await L();if(!n)throw new Error("API key is required");n.startsWith("opk_")||console.log("warning: API keys usually start with opk_."),await C({handle:o.activeProfile?.handle||"default",apiKey:n,baseUrl:t,apiBaseUrl:o.apiBaseUrl,chatApiBaseUrl:o.chatApiBaseUrl,setActive:!0}),console.log("Saved account credentials to the encrypted OpenPond credential store.")}g(He,"runLogin");async function Fe(e,o){let t=o[0]||"list";if(t==="list"){let r=await ue();console.log(JSON.stringify({profiles:r},null,2));return}if(t==="use"){let r=o[1];if(!r)throw new Error("usage: profiles use <name> [--base-url <url>]");let n=await ge(r,{baseUrl:H(e)});console.log(JSON.stringify({profile:n},null,2));return}if(t==="save"){let r=o[1];if(!r)throw new Error("usage: profiles save <name> --api-key <key> [--base-url <url>] [--api-base-url <url>] [--chat-api-base-url <url>]");let n=typeof e.apiKey=="string"?e.apiKey:typeof e.key=="string"?e.key:null,i=n?n.trim():await L(),a=typeof e.environment=="string"?e.environment:typeof e.env=="string"?e.env:void 0,s=await C({handle:r,apiKey:i,baseUrl:H(e),apiBaseUrl:be(e),chatApiBaseUrl:ve(e),environment:a,setActive:!0});console.log(JSON.stringify({profile:s},null,2));return}throw new Error("usage: profiles <list|use|save> [args]")}g(Fe,"runProfiles");async function Ve(){let e=await y(),o=w(e),t=P(e),r=await R(e,o),n=await ce(t,r);console.log(JSON.stringify(n,null,2))}g(Ve,"runAccount");async function We(e){let o=await y(),t=P(o),r=fe(o),n=await le(t,r);console.log(JSON.stringify(n,null,2))}g(We,"runHealth");async function qe(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a}=await T(n,i,o),s=typeof e.branch=="string"?String(e.branch):void 0,f=await $(n,i,a.id,{branch:s});if(!f?.id){console.log("no deployments found");return}let c=await ne(n,i,f.id),d=(c&&Array.isArray(c.toolsJson)?c.toolsJson:null)||(c&&typeof c.metadataJson=="object"&&c.metadataJson?c.metadataJson.tools:null),u=Array.isArray(d)?d:[];if(u.length===0){console.log("no tools found");return}for(let l of u){let m=l,h=m.profile||m.function,I=m.name||h?.name||"unknown",p=m.description||h?.description||"";console.log(p?`${I} - ${p}`:I)}}g(qe,"runToolList");async function Ye(e,o,t){let r=await y(),n=w(r),i=P(r),a=await R(r,n),{app:s}=await T(i,a,o),f=typeof e.branch=="string"?String(e.branch):void 0,c=await $(i,a,s.id,{branch:f});if(!c?.id)throw new Error("no deployments found");let d;if(typeof e.body=="string")try{d=JSON.parse(e.body)}catch{throw new Error("tool body must be valid JSON")}let u=typeof e.method=="string"?String(e.method).toUpperCase():"POST",l=await pe(n,a,{appId:s.id,deploymentId:c.id,toolName:t,method:u,body:d,headers:a?{"openpond-api-key":a}:void 0});if(!l.ok)throw new Error(l.error||`tool failed (${l.status})`);let m=l.data??{ok:!0};console.log(JSON.stringify(m,null,2))}g(Ye,"runToolRun");async function Qe(e,o,t){let r=await y(),n=w(r),i=P(r),a=await R(r,n),{app:s}=await T(i,a,o),f=typeof e.branch=="string"?String(e.branch):void 0,c=typeof e.deploymentId=="string"?String(e.deploymentId):void 0,d=c?{id:c}:await $(i,a,s.id,{branch:f});if(!d?.id)throw new Error("no deployments found");let u=typeof e.body=="string"?M(String(e.body),"body"):{};if(!u||typeof u!="object"||Array.isArray(u))throw new Error("body must be a JSON object");let l=typeof e.method=="string"?String(e.method).toUpperCase():"POST",m={...u,appId:s.id,deploymentId:d.id,toolName:t,method:l},h=await de(i,a,m);console.log(JSON.stringify(h,null,2))}g(Qe,"runBacktestRun");async function Xe(e,o){let t=await y(),r=w(t),n=P(t),i=await R(t,r),{app:a,handle:s,repo:f}=await T(n,i,o),c=typeof e.branch=="string"?String(e.branch):void 0,d=typeof e.deploymentId=="string"?String(e.deploymentId):void 0,u=d?{id:d}:await $(n,i,a.id,{branch:c});if(!u?.id){console.log("no deployments found");return}await we({baseUrl:n,apiKey:i,deploymentId:u.id,prefix:`[${s}/${f}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}g(Xe,"runDeployWatch");async function Ze(e,o){let r=((typeof e.name=="string"?e.name:null)||o.join(" ")).trim();if(!r)throw new Error("usage: repo create --name <name> [--team-id <id>] [--path <dir>] [--template <owner/repo|url>] [--template-branch <branch>] [--empty|--opentool] [--sandbox] [--token] [--auto-schedule-migration <true|false>]");let n=await y(),i=w(n),a=await R(n,i),s=P(n),f=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0,c=typeof e.template=="string"?e.template.trim():"";if(c&&(e.empty==="true"||e.opentool==="true"))throw new Error("choose one: --template or --empty/--opentool");if(e.empty==="true"&&e.opentool==="true")throw new Error("choose one: --empty or --opentool");let d=typeof e.description=="string"?e.description.trim():void 0,u=typeof e.templateBranch=="string"&&e.templateBranch.trim().length>0?e.templateBranch.trim():void 0,l=typeof e.env=="string"?M(e.env,"env"):void 0;if(l){if(typeof l!="object"||Array.isArray(l))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(l))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}if(c){e.deployOnPush!==void 0&&console.warn("deploy-on-push is not used for template create (auto deploys)");let b=Re(c,i),k=(await re(s,a,[{name:r,...d?{description:d}:{},templateRepoUrl:b,...u?{templateBranch:u}:{},...l?{envVars:l}:{}}],f)).items?.[0];if(!k||k.status!=="ok"||!k.appId)throw new Error(k?.error||"Template create failed");console.log(`app_id: ${k.appId}`),k.deploymentId&&console.log(`deployment_id: ${k.deploymentId}`),k.conversationId&&console.log(`conversation_id: ${k.conversationId}`);return}let m=process.cwd(),h=typeof e.path=="string"?e.path:typeof e.dir=="string"?e.dir:null,I=h&&h.trim().length>0?h.trim():$e.isTTY?await he(m):m,p=U.resolve(I);if(W(p)){if(!(await V.stat(p)).isDirectory())throw new Error(`path is not a directory: ${p}`)}else await V.mkdir(p,{recursive:!0});let Pe=(await V.readdir(p)).filter(b=>b!==".git").length===0,x=v(e.yes)||v(e.force);if(!Pe&&!x&&!await S(`Directory is not empty (${p}). Continue?`,!1)){console.log("aborted");return}let ke=U.join(p,".git");if(!W(ke)){if(!(x?!0:await S("Initialize git repository here?",!0))){console.log("aborted");return}let A=await B("git",["init"],{cwd:p});if(A.code!==0)throw new Error(`git init failed: ${A.stderr.trim()||A.stdout.trim()||"unknown error"}`)}let K=await F(p,"origin");if(K&&!x&&!await S(`Remote "origin" already set (${K}). Replace it?`,!1)){console.log("aborted");return}let q=e.opentool==="true"?"opentool":"empty",Te=v(e.sandbox),Be=v(e.deployOnPush),N=e.autoScheduleMigration,Y=typeof N=="string"||typeof N=="boolean",Ee=Y?v(N):void 0,E=await oe(s,a,{name:r,...f?{teamId:f}:{},...d?{description:d}:{},...q?{repoInit:q}:{},...Te?{sandbox:!0}:{},...l?{envVars:l}:{},...Be?{deployOnPush:!0}:{},...Y?{autoScheduleMigration:Ee}:{}}),O=me(E);z(O);let J=v(e.token)||v(e.setRemoteToken),Oe=D(O,a),Q=J?Oe:O,_=await B("git",K?["remote","set-url","origin",Q]:["remote","add","origin",Q],{cwd:p});if(_.code!==0)throw new Error(`git remote failed: ${j(_.stderr.trim()||_.stdout.trim()||"unknown error")}`);let Ae=J?G(O):O;console.log(`app_id: ${E.appId}`),E.gitOwner&&E.gitRepo&&console.log(`repo: ${E.gitOwner}/${E.gitRepo}`),console.log(`remote: ${Ae}`),console.log('next: git add . && git commit -m "init"');let Ie=E.defaultBranch||"master";console.log(`next: openpond repo push --path ${p} --branch ${Ie}`),J||console.log(`token-remote (non-interactive): git -C ${p} remote set-url origin ${G(O)}`);try{await ye({apiBase:s,apiKey:a,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}g(Ze,"runRepoCreate");async function Se(e){let o=await B("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e});if(o.code!==0)return null;let t=o.stdout.trim();return t.length>0?t:null}g(Se,"resolveGitBranch");async function et(e){let o=await y(),t=w(o),r=await R(o,t),n=typeof e.path=="string"?e.path:typeof e.dir=="string"?e.dir:null,i=U.resolve(n&&n.trim().length>0?n.trim():"."),a=U.join(i,".git");if(!W(a))throw new Error(`git repo not found at ${i} (missing .git)`);let s=await F(i,"origin");if(!s)throw new Error("origin remote not set; run `openpond repo create` first");z(s);let c=(typeof e.branch=="string"?e.branch.trim():"")||await Se(i);if(!c)throw new Error("unable to resolve git branch; pass --branch");let d;try{d=D(s,r)}catch{throw new Error("origin remote must be https for tokenized pushes")}let u=v(e.keepTokenRemote)||v(e.token)||v(e.setRemoteToken),l=s.includes("x-access-token:"),m=!u&&!l?s:null,h=process.env.GIT_TERMINAL_PROMPT;process.env.GIT_TERMINAL_PROMPT="0";try{if(!l){let p=await B("git",["remote","set-url","origin",d],{cwd:i});if(p.code!==0)throw new Error(`git remote set-url failed: ${j(p.stderr.trim()||p.stdout.trim()||"unknown error")}`)}if((await B("git",["push","-u","origin",c],{cwd:i,inherit:!0})).code!==0)throw new Error("git push failed")}finally{m&&await B("git",["remote","set-url","origin",m],{cwd:i}).catch(()=>null),h===void 0?delete process.env.GIT_TERMINAL_PROMPT:process.env.GIT_TERMINAL_PROMPT=h}}g(et,"runRepoPush");async function tt(e){if(e.length===0)throw new Error("usage: opentool <init|validate|build> [args]");let o=process.platform==="win32"?"npx.cmd":"npx";if((await B(o,["opentool",...e],{inherit:!0})).code!==0)throw new Error("opentool command failed")}g(tt,"runOpentool");async function nt(){let e="openpond",o=Z(),t=await te(e),r=`npm i -g ${e}@${t}`,n=ee(o,t);if(n===0){console.log(`${e} is up to date (${o})`);return}if(n===-1){console.log(`Update available: ${o} -> ${t}`),console.log(`Run: ${r}`);return}if(n===1){console.log(`Installed version (${o}) is newer than npm latest (${t}).`);return}if(o===t){console.log(`${e} is up to date (${o})`);return}console.log(`Installed: ${o}`),console.log(`Latest: ${t}`),console.log(`Run: ${r}`)}g(nt,"runCheckUpdate");export{Ge as a,je as b,ze as c,He as d,Fe as e,Ve as f,We as g,qe as h,Ye as i,Qe as j,Xe as k,Ze as l,Se as m,et as n,tt as o,nt as p};
|