openpond 0.2.43 → 0.2.44
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 +4452 -652
- package/dist/app-server.js +1 -1
- package/dist/chunks/actions-command-5IEZEP6W.js +2 -0
- package/dist/chunks/{app-layer-OV7RVSQW.js → app-layer-7SPLENWD.js} +1 -1
- package/dist/chunks/app-server-runtime-NQ2BYPGK.js +2 -0
- package/dist/chunks/apps-XQ7PHJTD.js +2 -0
- package/dist/chunks/{chunk-LLNCHGE4.js → chunk-2CXJK2M3.js} +1 -1
- package/dist/chunks/{chunk-MDE3HHLH.js → chunk-36RCXSEJ.js} +1 -1
- package/dist/chunks/chunk-3QC2DDQ5.js +2 -0
- package/dist/chunks/chunk-3XDFNA7W.js +2 -0
- package/dist/chunks/chunk-4S4WH65X.js +3 -0
- package/dist/chunks/chunk-4TMC5F2P.js +5 -0
- package/dist/chunks/{chunk-ROJX6IYW.js → chunk-65QCNUGE.js} +281 -200
- package/dist/chunks/{chunk-O277DPTX.js → chunk-ANVOHBUV.js} +1 -1
- package/dist/chunks/chunk-ARJUNUH6.js +5 -0
- package/dist/chunks/{chunk-V44RF57H.js → chunk-CEEZ7Y2J.js} +1 -1
- package/dist/chunks/{chunk-ZG7QX66E.js → chunk-CR6CDOKS.js} +8 -8
- package/dist/chunks/{chunk-W3NG7YLC.js → chunk-DZVVGU6K.js} +1 -1
- package/dist/chunks/chunk-HY2Q7EDK.js +4 -0
- package/dist/chunks/chunk-IT4AT6LB.js +42 -0
- package/dist/chunks/{chunk-7KC5LWCU.js → chunk-L6HCBIAU.js} +1 -1
- package/dist/chunks/chunk-LNEOLOK2.js +13 -0
- package/dist/chunks/chunk-NM2GYDPA.js +19 -0
- package/dist/chunks/{chunk-6UPCR6EL.js → chunk-OI2N2636.js} +1 -1
- package/dist/chunks/{chunk-VG7XO6PR.js → chunk-OMM4ZO7E.js} +7 -7
- package/dist/chunks/{chunk-KDOS6YMH.js → chunk-OQPFFKU6.js} +1 -1
- package/dist/chunks/{chunk-7EDOA6KD.js → chunk-PEYA2Q7Q.js} +1 -1
- package/dist/chunks/{chunk-EWQZASG4.js → chunk-QID62K65.js} +5 -5
- package/dist/chunks/{chunk-G2WJC6DE.js → chunk-RAWEO7SJ.js} +2 -2
- package/dist/chunks/{chunk-HI7W3IVO.js → chunk-W5NQ2DI7.js} +12 -12
- package/dist/chunks/{chunk-IE2WZ3I3.js → chunk-X2B4MN6W.js} +1 -1
- package/dist/chunks/{chunk-T7MJBBHE.js → chunk-YF6IDYTS.js} +1 -1
- package/dist/chunks/{chunk-E6WT4HWF.js → chunk-YOOPTMQK.js} +1 -1
- package/dist/chunks/{chunk-QUNRWDVO.js → chunk-Z6ZR5O3J.js} +3 -3
- package/dist/chunks/{chunk-T5QA4W2H.js → chunk-ZEVARU6J.js} +5 -5
- package/dist/chunks/cli-OJU6NQSA.js +2 -0
- package/dist/chunks/{configuration-command-ANYM5UYG.js → configuration-command-LDPUCHVH.js} +1 -1
- package/dist/chunks/core-commands-UZL5RF2M.js +2 -0
- package/dist/chunks/{datasets-FM3UBK4R.js → datasets-42AZHVSV.js} +3 -3
- package/dist/chunks/desktop-test-DI76HKS7.js +3 -0
- package/dist/chunks/{dist-GC7DXKTI.js → dist-6YP37XI5.js} +1 -1
- package/dist/chunks/experiments-Z3S35BYN.js +2 -0
- package/dist/chunks/{extension-5LQRULQP.js → extension-JEUZZJ5X.js} +1 -1
- package/dist/chunks/{help-NTSTG6RR.js → help-4F4QGL4C.js} +1 -1
- package/dist/chunks/hosted-harness-runtime-VZNYNQ6T.js +2 -0
- package/dist/chunks/hosted-profile-compiler-JXLPR7SX.js +2 -0
- package/dist/chunks/{hosted-profile-evaluation-control-IK4Y2EQZ.js → hosted-profile-evaluation-control-Q54YXXIM.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-inspection-YWKUB7RT.js → hosted-profile-evaluation-inspection-7WESM3ZH.js} +1 -1
- package/dist/chunks/hosted-profile-evaluation-preparation-QP24PYBL.js +3 -0
- package/dist/chunks/opchat-UFWWVJL6.js +3 -0
- package/dist/chunks/organizations-SBBIOF6O.js +2 -0
- package/dist/chunks/{profile-HVLH672B.js → profile-ESULTWDN.js} +1 -1
- package/dist/chunks/project-agent-IBHUQ3JX.js +2 -0
- package/dist/chunks/sandbox-command-PAJAIMWM.js +2 -0
- package/dist/chunks/{sandbox-template-QMB6DSTS.js → sandbox-template-7WHGNVM6.js} +1 -1
- package/dist/chunks/src-5MJSO3UD.js +326 -0
- package/dist/chunks/{src-N447LUPO.js → src-A3OVZOSV.js} +1 -1
- package/dist/chunks/{teams-bot-RNHQMPQA.js → teams-bot-YMCDLBGT.js} +1 -1
- package/dist/chunks/{workspaces-V5YTXJLV.js → workspaces-ZZ7R5BUL.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/profile/local-profile.d.ts +2 -0
- package/dist/web/assets/App-6AQXN2SM.js +226 -0
- package/dist/web/assets/{AppDialog-v-BfV1lA.js → AppDialog-CV3ddujB.js} +1 -1
- package/dist/web/assets/AppTerminalPanel-dhbGOO_K.js +2 -0
- package/dist/web/assets/{AppsView-Dl-37F0w.js → AppsView-Bxa-9BF2.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-DltF217k.js → BrowserSidebar-BLwL2FOG.js} +1 -1
- package/dist/web/assets/{CartesianChart-gK-Ll3kX.js → CartesianChart-BOxN-Su1.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-BuWquQYn.js → CollaborationTabs-DTmJvNJx.js} +1 -1
- package/dist/web/assets/{CommandMenu-Cs5S8t-Q.js → CommandMenu-DggN2ygj.js} +1 -1
- package/dist/web/assets/{CommunityView-BJBkQEMV.js → CommunityView-CuDrYOIf.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-C36fKc-v.js → ComposerCreateImproveStrip-BrduENlL.js} +1 -1
- package/dist/web/assets/{GetStartedView-9A49MgYA.js → GetStartedView-Db1IEWzv.js} +1 -1
- package/dist/web/assets/HostedModelLearningReview-kofNdPAe.js +1 -0
- package/dist/web/assets/{HostedModelLearningSettings-CH7CsAhw.js → HostedModelLearningSettings-6ij3nwWD.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-N2qcy1Yv.js → LabModelVersionDetailPage-C7Maqcit.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-BAKym5GY.js → LabSkillSidebar-Bz0U-Nmw.js} +1 -1
- package/dist/web/assets/LabsRoute-Ch1N-e2S.js +52 -0
- package/dist/web/assets/LabsRoute-Dw6-12kt.css +1 -0
- package/dist/web/assets/MainChatThread-BJbhZOvs.js +2 -0
- package/dist/web/assets/{MainPane-gPkr0OWu.js → MainPane-Cs2Kng_k.js} +4 -4
- package/dist/web/assets/{MarkdownText-B-au2zEv.js → MarkdownText-BhzHRq1J.js} +1 -1
- package/dist/web/assets/{NativeSkillSidebar-DHFKZ7P1.js → NativeSkillSidebar-LU-PhEhW.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-Dhbf5KJT.js → NewExperienceSwitcher-Bi_gpHLG.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-hlAzFK2Y.js → NewProjectDialog-B8pWvSkq.js} +1 -1
- package/dist/web/assets/{OutputsPage-C0N2rOxE.js → OutputsPage-BkGI0kHp.js} +1 -1
- package/dist/web/assets/{ProjectsPage-CkHBgLPx.js → ProjectsPage-Ca8_iEWu.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-BiW6ZzPN.js → RightChatPanelStack-DjEdxsq8.js} +1 -1
- package/dist/web/assets/{RightSidebarHomePanel-BS9YSdYB.js → RightSidebarHomePanel-6pygznxX.js} +1 -1
- package/dist/web/assets/{ScheduledWorkPage-819sQcDR.js → ScheduledWorkPage-BSiOxxAH.js} +1 -1
- package/dist/web/assets/{SettingsView-BZrOUPZb.js → SettingsView-1XN7KLBl.js} +3 -3
- package/dist/web/assets/{TeamChatView-CUNcbSa7.js → TeamChatView-BGLCPTen.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-MIlGPpXe.js → TerminalOverlay-DHkS2cVJ.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-BNcyNoa8.js → TrainingCreationPanel-Dneamjzh.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-CKV16LNC.js → TrainingDraftPanel-Cfh59jLZ.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-SVgUHnUL.js → UsageSettingsSection-C9l1KY-O.js} +1 -1
- package/dist/web/assets/{WorkSidebarPanel-CfkaaFHA.js → WorkSidebarPanel-CEnO-Txp.js} +1 -1
- package/dist/web/assets/{WorkspaceDiffPanel-CQhqlqg5.js → WorkspaceDiffPanel-BiuQBflC.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-CJB-z2tS.js → WorkspaceEnvironmentMenu-Dr-E0c1j.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-B3xtasTt.js → WorkspaceGitDialogs-mE3Og6Zo.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-DVfyICNZ.js → WorkspaceMonacoEditor-DPZ0n0G9.js} +60 -60
- package/dist/web/assets/{arrow-up-right-CYG4Vm07.js → arrow-up-right-DU2KsZD-.js} +1 -1
- package/dist/web/assets/{clipboard-DGSnfljX.js → clipboard-g2b4_k81.js} +1 -1
- package/dist/web/assets/{cloud-upload-Bw_zrS2y.js → cloud-upload-P2bDOPsQ.js} +1 -1
- package/dist/web/assets/cssMode-CPbPVAUt.js +1 -0
- package/dist/web/assets/{folder-open-CcGOldH7.js → folder-open-BmsONNsr.js} +1 -1
- package/dist/web/assets/{folder-plus-DEIDaX2B.js → folder-plus-B18NgUxy.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-B-Ao6y--.js → git-commit-horizontal-enxGCV_e.js} +1 -1
- package/dist/web/assets/htmlMode-DiV88uQv.js +1 -0
- package/dist/web/assets/index-B9VSiz_z.css +1 -0
- package/dist/web/assets/{index-C8_8-lW7.js → index-vfpCN9zy.js} +6 -6
- package/dist/web/assets/{info-DwOXHkN_.js → info-DmuSBIYe.js} +1 -1
- package/dist/web/assets/{jsonMode-txmGM7K6.js → jsonMode-BaeOjuKU.js} +4 -4
- package/dist/web/assets/{lspLanguageFeatures-D59Drc_9.js → lspLanguageFeatures-D8To0CQA.js} +1 -1
- package/dist/web/assets/{minimize-2-C5UCV16_.js → minimize-2-C2xnEzCe.js} +1 -1
- package/dist/web/assets/monaco.contribution-DbrACt99.js +2 -0
- package/dist/web/assets/{monaco.contribution-5HcktwaM.js → monaco.contribution-DgTFvG2Q.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BOmcYK8k.js → monaco.contribution-JW3MxX6k.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CbK7796k.js → monaco.contribution-bytkwn0O.js} +2 -2
- package/dist/web/assets/{monitor-D4hpNTai.js → monitor-mtHVW7gU.js} +1 -1
- package/dist/web/assets/{python-Cie4Ghu8.js → python-DAPe0Urm.js} +1 -1
- package/dist/web/assets/{refresh-cw-CIOzrJnj.js → refresh-cw-Dvm_Pq3U.js} +1 -1
- package/dist/web/assets/{save-D7EtdMHG.js → save-B2eVAjW6.js} +1 -1
- package/dist/web/assets/{square-JpDfrqp_.js → square-16bX2k2i.js} +1 -1
- package/dist/web/assets/toggleHighContrast-BgpFWRpS.css +1 -0
- package/dist/web/assets/{toggleHighContrast-DdGkc-Be.js → toggleHighContrast-Ce0YhEQg.js} +1 -1
- package/dist/web/assets/{tsMode-DwgEL7oI.js → tsMode-CnvMmHz6.js} +1 -1
- package/dist/web/assets/{upload-BkwOzqS-.js → upload-COPbAaD-.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-bO0Qycih.js → useLocalAgentSchedules-C-Wjm5HK.js} +1 -1
- package/dist/web/assets/{useSessionTurnCache-DxUh5scW.js → useSessionTurnCache-BfVbncMB.js} +1 -1
- package/dist/web/assets/{wifi-off-D6Keejtn.js → wifi-off-C9iLbCC-.js} +1 -1
- package/dist/web/assets/{workers-BgG66q0n.js → workers-BXh_u8Fr.js} +1 -1
- package/dist/web/assets/{yaml-COMRGPWg.js → yaml-CRSr9x6_.js} +1 -1
- package/dist/web/index.html +5 -5
- package/docs/command-reference.md +8 -1
- package/package.json +4 -2
- package/dist/chunks/actions-command-DWQ3VGGP.js +0 -2
- package/dist/chunks/app-server-runtime-JVLXE5LF.js +0 -2
- package/dist/chunks/apps-5DQAYDNI.js +0 -2
- package/dist/chunks/chunk-3D4QN4NM.js +0 -19
- package/dist/chunks/chunk-45UOD2DA.js +0 -2
- package/dist/chunks/chunk-5IN3HQJU.js +0 -2
- package/dist/chunks/chunk-6KKQXETR.js +0 -5
- package/dist/chunks/chunk-7R7O2XXP.js +0 -2
- package/dist/chunks/chunk-DGD52VZC.js +0 -13
- package/dist/chunks/chunk-IFI24VF6.js +0 -5
- package/dist/chunks/chunk-P45OSKQL.js +0 -4
- package/dist/chunks/chunk-SXN3QOW4.js +0 -3
- package/dist/chunks/chunk-VJJ3UXOI.js +0 -42
- package/dist/chunks/chunk-XMKAMR7M.js +0 -2
- package/dist/chunks/cli-7D7CYCIY.js +0 -2
- package/dist/chunks/core-commands-TYWE3TNW.js +0 -2
- package/dist/chunks/desktop-test-Z5IKJU3P.js +0 -3
- package/dist/chunks/experiments-IWBRIDQE.js +0 -2
- package/dist/chunks/hosted-harness-runtime-S75BLD57.js +0 -2
- package/dist/chunks/hosted-profile-compiler-JNNYWLC7.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-preparation-JXOF73BB.js +0 -3
- package/dist/chunks/opchat-77PRAQ5W.js +0 -3
- package/dist/chunks/organizations-2KWTYIPU.js +0 -2
- package/dist/chunks/project-agent-7NLKJMAM.js +0 -2
- package/dist/chunks/sandbox-command-FNS4JBVC.js +0 -2
- package/dist/chunks/src-TZBL6NA7.js +0 -325
- package/dist/web/assets/App-BEQmrTGQ.js +0 -226
- package/dist/web/assets/AppTerminalPanel-CnKcllS2.js +0 -2
- package/dist/web/assets/HostedModelLearningReview-JgxDUDio.js +0 -1
- package/dist/web/assets/LabsRoute-DooCmsN8.css +0 -1
- package/dist/web/assets/LabsRoute-Y992kQoQ.js +0 -52
- package/dist/web/assets/MainChatThread-CPhREQso.js +0 -2
- package/dist/web/assets/cssMode-CSpYOKj-.js +0 -1
- package/dist/web/assets/htmlMode-DstkgJXG.js +0 -1
- package/dist/web/assets/index-DUIWDN8o.css +0 -1
- package/dist/web/assets/monaco.contribution-BomZ1gys.js +0 -2
- package/dist/web/assets/toggleHighContrast-B7NOMXDY.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{L as r}from"./chunk-
|
|
2
|
+
import{L as r}from"./chunk-4TMC5F2P.js";import{Fb as o,k as t}from"./chunk-LNEOLOK2.js";import{e as a}from"./chunk-HZP5U2AA.js";import{b as e}from"./chunk-ES2ISFJC.js";var s=e.object({profileRef:r,manifest:o,metric:t,gradeRefs:e.array(a),receiptRefs:e.array(a),passRate:e.number().min(0).max(1),passed:e.boolean(),completedAt:e.string().datetime(),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict();export{s as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as fe,b as me,d as he,e as q,f as L,g as ye,h as Ae,i as ge,j as Pe}from"./chunk-HI7W3IVO.js";import{e as pe}from"./chunk-6KKQXETR.js";import{d as N,e as B}from"./chunk-Z3D4C7BG.js";import{D as oe,g as te}from"./chunk-MTJNKRXL.js";import{p as de}from"./chunk-HZP5U2AA.js";import{a}from"./chunk-FTQLQJQV.js";import{randomUUID as qe}from"node:crypto";var Re=new URL(B).hostname,we=new URL(N).hostname,Ne=`${B}/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===Re)return B;if(o===we||o===`www.${we}`||o==="openpond.live"||o==="www.openpond.live")return B;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)??B)}a(G,"resolvePublicApiBaseUrl");function J(e,n,t){return Le(e,n,t)}a(J,"resolveHostedChatApiBaseUrl");function Le(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)??De(t)}a(Le,"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 De(e){return W(e)??Ne}a(De,"opChatBaseFromPublicApiBase");function D(e){return e?.trim()?e.trim():"production"}a(D,"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 b(e,n){return l(e)===l(n)}a(b,"baseUrlEquals");function F(e,n){return`${e?.trim().toLowerCase()||""}|${l(n)??"default"}`}a(F,"profileKey");function Q(e){return l(e?.baseUrl)}a(Q,"selectorBaseUrl");function _(e){let n=l(e.baseUrl);return n?{handle:e.handle,baseUrl:n}:{handle:e.handle}}a(_,"selectorFromAccount");function A(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(A,"normalizeActiveProfile");function U(e,n){if(!P(e.handle,n.handle))return!1;let t=Q(n);return t?b(e.baseUrl,t):!l(e.baseUrl)}a(U,"accountMatchesSelector");function re(e,n){if(!P(e.handle,n.handle))return!1;let t=Q(n);return t?b(e.baseUrl,t):!l(e.baseUrl)}a(re,"profileMatchesSelector");function Oe(e,n,t){let o=Array.isArray(e.accounts)?e.accounts:[],r=n||process.env.OPENPOND_ACCOUNT?A({handle:n||process.env.OPENPOND_ACCOUNT||"",baseUrl:t??process.env.OPENPOND_BASE_URL??null}):A(e.activeProfile);if(r){let s=o.find(c=>U(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(Oe,"findActiveAccount");function xe(e){let n=Array.isArray(e.accounts)?e.accounts:[],t=A(e.activeProfile)??(n[0]?_(n[0]):null);return ae(n.map(o=>({handle:o.handle,baseUrl:l(o.baseUrl),apiBaseUrl:l(o.apiBaseUrl),chatApiBaseUrl:l(o.chatApiBaseUrl),environment:D(o.environment),isActive:t?U(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(xe,"fallbackProfilesFromConfig");function ae(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:D(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(ae,"normalizeProfiles");function be(e){return e.hasApiKey||e.hasSessionToken?"signed_in":"signed_out"}a(be,"profileAuthHealth");function $e(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($e,"normalizeHealth");function Ue(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(Ue,"normalizeProfile");function He(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(He,"normalizeProducts");function Me(e){return e.handle.trim().toLowerCase()==="default"&&!l(e.baseUrl)&&!e.hasApiKey&&!e.hasSessionToken}a(Me,"isEmptyDefaultProfile");function ze(e){let n=e?.trim();return n?n.length>=12?`\u2022\u2022\u2022\u2022\u2022\u2022${n.slice(-6)}`:"\u2022\u2022\u2022\u2022\u2022\u2022":null}a(ze,"apiKeyHint");function Fe(e){return e?.auth?.authType!=="openpond-api-key"||!e.auth.keyAccess?null:{ownerType:e.auth.keyAccess.ownerType,teamId:e.auth.keyAccess.teamId,scopes:e.auth.scopes}}a(Fe,"apiKeyAccess");function X(e){let{config:n,profiles:t,account:o,token:r,apiBaseUrl:s,accountResponse:i,accountProfiles:c,health:m,authFailed:g,error:f}=e,w=J(o,n,s),h=Ue(i??null),C=A(n.activeProfile),v=(o?_(o):null)??C,O=h?.handle||o?.handle||v?.handle||null,I=(v?t.find(d=>re(d,v)):null)??t.find(d=>d.isActive)??null,y=g?"auth_error":r?"signed_in":"signed_out",u=h?.name||h?.handle||h?.email||O||"Signed out",T=l(I?.baseUrl||o?.baseUrl||N),k=D(I?.environment||o?.environment),x=A(v)??(O?A({handle:O,baseUrl:I?.baseUrl??o?.baseUrl}):null),M=(t.length>0?t:O?[{handle:O,baseUrl:Q(x)??l(o?.baseUrl),apiBaseUrl:s,chatApiBaseUrl:w,environment:k,isActive:!0,hasApiKey:!!r,hasSessionToken:!1,sessionAppId:null,sessionConversationId:null}]:[]).filter(d=>!Me(d));return{state:y,activeProfile:x,label:u,email:h?.email??null,avatarUrl:h?.image??null,environment:k,baseUrl:T,apiBaseUrl:s,chatApiBaseUrl:w,creditsLabel:h?.credits??null,profile:h,products:He(i?.products),apiHealth:$e(m??null,s),accounts:M.map(d=>{let R=l(d.baseUrl),Te=n.accounts?.find(ue=>P(ue.handle,d.handle)&&b(ue.baseUrl,R)),ne=c?.[F(d.handle,R)]??null,z=Ue(ne?.response??null);return{handle:d.handle,baseUrl:R,apiBaseUrl:l(d.apiBaseUrl),chatApiBaseUrl:l(d.chatApiBaseUrl),environment:D(d.environment),isActive:x?re(d,x):!1,authHealth:ne?.authFailed?"auth_error":be(d),displayLabel:z?.name||z?.handle||z?.email||d.handle,email:z?.email??null,avatarUrl:z?.image??null,apiKeyHint:ze(Te?.apiKey),apiKeyAccess:Fe(ne?.response??null)}}),error:f??m?.error??null}}a(X,"toAccountState");async function je(e){try{return ae(await Ae())}catch{return xe(e)}}a(je,"loadProfiles");async function p(e,n){let t=await ye(),o=await je(t),r=Oe(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(p,"loadOpenPondAccountContext");async function Ke(e){let n=l(e.baseUrl);return await ge(e.handle,{baseUrl:n}),p(e.handle,n)}a(Ke,"switchOpenPondAccount");function $(e){return e instanceof Error?e.message:String(e)}a($,"errorMessage");var We=15e3;function Ve(e){return e===oe?"OpenPond Chat":e==="deepseek-v4-flash"?"DeepSeek V4 Flash":e.replace(/[-_/]+/g," ")}a(Ve,"displayNameForHostedModel");function Ge(e){let n=typeof e.id=="string"?e.id:null;return n?{id:n,displayName:Ve(n),ownedBy:typeof e.owned_by=="string"?e.owned_by:null,streaming:!0,raw:e}:null}a(Ge,"normalizeHostedModel");async function Je(){let e=await p();if(!e.token)return{models:[],error:"No OpenPond API key or session token is configured."};try{return{models:(await Xe({apiBaseUrl:e.chatApiBaseUrl,token:e.token})).data.map(o=>Ge(o)).filter(o=>!!o),error:null}}catch(n){return{models:[],error:$(n)}}}a(Je,"loadOpenPondHostedModels");async function Ye(){let e=await p();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."))},We);try{return{catalog:await Ee({apiBaseUrl:e.chatApiBaseUrl,token:e.token,signal:n.signal}),error:null}}catch(o){return{catalog:null,error:$(o)}}finally{clearTimeout(t)}}a(Ye,"loadOpenPondProviderCatalog");async function*Qe(e){let n=await p();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||oe,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(Qe,"streamOpenPondHostedChatTurn");async function Xe(e){let n=se(e.apiBaseUrl,"models"),t=await fetch(n,{method:"GET",headers:ie(e.token,"application/json"),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat model list failed: ${t.status} ${await le(t)}`);return await t.json()}a(Xe,"listOpChatModels");async function Ee(e){let n=se(e.apiBaseUrl,"provider-catalog"),t=await fetch(n,{method:"GET",headers:ie(e.token,"application/json"),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat provider catalog failed: ${t.status} ${await le(t)}`);let o=await t.json();return!o||typeof o!="object"||!Array.isArray(o.providers)?te.parse(o):te.parse({...o,providers:o.providers.filter(r=>r!==null&&typeof r=="object"&&de.safeParse(r.id).success)})}a(Ee,"listOpChatProviderCatalog");async function*ve(e){let n=se(e.apiBaseUrl,"chat/completions"),t=await fetch(n,{method:"POST",headers:ie(e.token,"text/event-stream",e.requestId),body:JSON.stringify(rn(e,!0)),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat request failed: ${t.status} ${await le(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="",m=null,g=Ze(t.headers),f=t.body.getReader(),w=new TextDecoder,h="",C=[],ee=a(()=>{if(C.length===0)return[];let y=C.join(`
|
|
2
|
+
import{a as fe,b as me,d as he,e as q,f as L,g as ye,h as Ae,i as ge,j as Pe}from"./chunk-W5NQ2DI7.js";import{e as pe}from"./chunk-4TMC5F2P.js";import{d as N,e as B}from"./chunk-Z3D4C7BG.js";import{D as oe,g as te}from"./chunk-MTJNKRXL.js";import{p as de}from"./chunk-HZP5U2AA.js";import{a}from"./chunk-FTQLQJQV.js";import{randomUUID as qe}from"node:crypto";var Re=new URL(B).hostname,we=new URL(N).hostname,Ne=`${B}/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===Re)return B;if(o===we||o===`www.${we}`||o==="openpond.live"||o==="www.openpond.live")return B;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)??B)}a(G,"resolvePublicApiBaseUrl");function J(e,n,t){return Le(e,n,t)}a(J,"resolveHostedChatApiBaseUrl");function Le(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)??De(t)}a(Le,"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 De(e){return W(e)??Ne}a(De,"opChatBaseFromPublicApiBase");function D(e){return e?.trim()?e.trim():"production"}a(D,"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 b(e,n){return l(e)===l(n)}a(b,"baseUrlEquals");function F(e,n){return`${e?.trim().toLowerCase()||""}|${l(n)??"default"}`}a(F,"profileKey");function Q(e){return l(e?.baseUrl)}a(Q,"selectorBaseUrl");function _(e){let n=l(e.baseUrl);return n?{handle:e.handle,baseUrl:n}:{handle:e.handle}}a(_,"selectorFromAccount");function A(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(A,"normalizeActiveProfile");function U(e,n){if(!P(e.handle,n.handle))return!1;let t=Q(n);return t?b(e.baseUrl,t):!l(e.baseUrl)}a(U,"accountMatchesSelector");function re(e,n){if(!P(e.handle,n.handle))return!1;let t=Q(n);return t?b(e.baseUrl,t):!l(e.baseUrl)}a(re,"profileMatchesSelector");function Oe(e,n,t){let o=Array.isArray(e.accounts)?e.accounts:[],r=n||process.env.OPENPOND_ACCOUNT?A({handle:n||process.env.OPENPOND_ACCOUNT||"",baseUrl:t??process.env.OPENPOND_BASE_URL??null}):A(e.activeProfile);if(r){let s=o.find(c=>U(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(Oe,"findActiveAccount");function xe(e){let n=Array.isArray(e.accounts)?e.accounts:[],t=A(e.activeProfile)??(n[0]?_(n[0]):null);return ae(n.map(o=>({handle:o.handle,baseUrl:l(o.baseUrl),apiBaseUrl:l(o.apiBaseUrl),chatApiBaseUrl:l(o.chatApiBaseUrl),environment:D(o.environment),isActive:t?U(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(xe,"fallbackProfilesFromConfig");function ae(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:D(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(ae,"normalizeProfiles");function be(e){return e.hasApiKey||e.hasSessionToken?"signed_in":"signed_out"}a(be,"profileAuthHealth");function $e(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($e,"normalizeHealth");function Ue(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(Ue,"normalizeProfile");function He(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(He,"normalizeProducts");function Me(e){return e.handle.trim().toLowerCase()==="default"&&!l(e.baseUrl)&&!e.hasApiKey&&!e.hasSessionToken}a(Me,"isEmptyDefaultProfile");function ze(e){let n=e?.trim();return n?n.length>=12?`\u2022\u2022\u2022\u2022\u2022\u2022${n.slice(-6)}`:"\u2022\u2022\u2022\u2022\u2022\u2022":null}a(ze,"apiKeyHint");function Fe(e){return e?.auth?.authType!=="openpond-api-key"||!e.auth.keyAccess?null:{ownerType:e.auth.keyAccess.ownerType,teamId:e.auth.keyAccess.teamId,scopes:e.auth.scopes}}a(Fe,"apiKeyAccess");function X(e){let{config:n,profiles:t,account:o,token:r,apiBaseUrl:s,accountResponse:i,accountProfiles:c,health:m,authFailed:g,error:f}=e,w=J(o,n,s),h=Ue(i??null),C=A(n.activeProfile),v=(o?_(o):null)??C,O=h?.handle||o?.handle||v?.handle||null,I=(v?t.find(d=>re(d,v)):null)??t.find(d=>d.isActive)??null,y=g?"auth_error":r?"signed_in":"signed_out",u=h?.name||h?.handle||h?.email||O||"Signed out",T=l(I?.baseUrl||o?.baseUrl||N),k=D(I?.environment||o?.environment),x=A(v)??(O?A({handle:O,baseUrl:I?.baseUrl??o?.baseUrl}):null),M=(t.length>0?t:O?[{handle:O,baseUrl:Q(x)??l(o?.baseUrl),apiBaseUrl:s,chatApiBaseUrl:w,environment:k,isActive:!0,hasApiKey:!!r,hasSessionToken:!1,sessionAppId:null,sessionConversationId:null}]:[]).filter(d=>!Me(d));return{state:y,activeProfile:x,label:u,email:h?.email??null,avatarUrl:h?.image??null,environment:k,baseUrl:T,apiBaseUrl:s,chatApiBaseUrl:w,creditsLabel:h?.credits??null,profile:h,products:He(i?.products),apiHealth:$e(m??null,s),accounts:M.map(d=>{let R=l(d.baseUrl),Te=n.accounts?.find(ue=>P(ue.handle,d.handle)&&b(ue.baseUrl,R)),ne=c?.[F(d.handle,R)]??null,z=Ue(ne?.response??null);return{handle:d.handle,baseUrl:R,apiBaseUrl:l(d.apiBaseUrl),chatApiBaseUrl:l(d.chatApiBaseUrl),environment:D(d.environment),isActive:x?re(d,x):!1,authHealth:ne?.authFailed?"auth_error":be(d),displayLabel:z?.name||z?.handle||z?.email||d.handle,email:z?.email??null,avatarUrl:z?.image??null,apiKeyHint:ze(Te?.apiKey),apiKeyAccess:Fe(ne?.response??null)}}),error:f??m?.error??null}}a(X,"toAccountState");async function je(e){try{return ae(await Ae())}catch{return xe(e)}}a(je,"loadProfiles");async function p(e,n){let t=await ye(),o=await je(t),r=Oe(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(p,"loadOpenPondAccountContext");async function Ke(e){let n=l(e.baseUrl);return await ge(e.handle,{baseUrl:n}),p(e.handle,n)}a(Ke,"switchOpenPondAccount");function $(e){return e instanceof Error?e.message:String(e)}a($,"errorMessage");var We=15e3;function Ve(e){return e===oe?"OpenPond Chat":e==="deepseek-v4-flash"?"DeepSeek V4 Flash":e.replace(/[-_/]+/g," ")}a(Ve,"displayNameForHostedModel");function Ge(e){let n=typeof e.id=="string"?e.id:null;return n?{id:n,displayName:Ve(n),ownedBy:typeof e.owned_by=="string"?e.owned_by:null,streaming:!0,raw:e}:null}a(Ge,"normalizeHostedModel");async function Je(){let e=await p();if(!e.token)return{models:[],error:"No OpenPond API key or session token is configured."};try{return{models:(await Xe({apiBaseUrl:e.chatApiBaseUrl,token:e.token})).data.map(o=>Ge(o)).filter(o=>!!o),error:null}}catch(n){return{models:[],error:$(n)}}}a(Je,"loadOpenPondHostedModels");async function Ye(){let e=await p();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."))},We);try{return{catalog:await Ee({apiBaseUrl:e.chatApiBaseUrl,token:e.token,signal:n.signal}),error:null}}catch(o){return{catalog:null,error:$(o)}}finally{clearTimeout(t)}}a(Ye,"loadOpenPondProviderCatalog");async function*Qe(e){let n=await p();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||oe,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(Qe,"streamOpenPondHostedChatTurn");async function Xe(e){let n=se(e.apiBaseUrl,"models"),t=await fetch(n,{method:"GET",headers:ie(e.token,"application/json"),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat model list failed: ${t.status} ${await le(t)}`);return await t.json()}a(Xe,"listOpChatModels");async function Ee(e){let n=se(e.apiBaseUrl,"provider-catalog"),t=await fetch(n,{method:"GET",headers:ie(e.token,"application/json"),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat provider catalog failed: ${t.status} ${await le(t)}`);let o=await t.json();return!o||typeof o!="object"||!Array.isArray(o.providers)?te.parse(o):te.parse({...o,providers:o.providers.filter(r=>r!==null&&typeof r=="object"&&de.safeParse(r.id).success)})}a(Ee,"listOpChatProviderCatalog");async function*ve(e){let n=se(e.apiBaseUrl,"chat/completions"),t=await fetch(n,{method:"POST",headers:ie(e.token,"text/event-stream",e.requestId),body:JSON.stringify(rn(e,!0)),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat request failed: ${t.status} ${await le(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="",m=null,g=Ze(t.headers),f=t.body.getReader(),w=new TextDecoder,h="",C=[],ee=a(()=>{if(C.length===0)return[];let y=C.join(`
|
|
3
3
|
`);if(C=[],y==="[DONE]")return r=!0,[];let u;try{u=JSON.parse(y)}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: ${_e(u)}`);i=u;let T=u&&typeof u=="object"?u:{},k=Array.isArray(T.choices)?T.choices:[],x=k[0]&&typeof k[0]=="object"?k[0]:{},K=x.delta&&typeof x.delta=="object"?x.delta:{},M=[],d=Be(K.reasoning_content);d&&(c+=d,M.push({type:"reasoning_delta",text:d,raw:u}));let R=Be(K.content);return R&&M.push({type:"text_delta",text:R,raw:u}),tn(o,K.tool_calls),s=H(x.finish_reason)??s,m=ln(u)??m,M},"consumeEvent"),v=a(y=>{let u=y.endsWith("\r")?y.slice(0,-1):y;return u?u.startsWith(":")?[]:(u.startsWith("data:")&&C.push(u.slice(5).trimStart()),[]):ee()},"consumeLine");try{for(;;){let y=await f.read();if(y.done)break;h+=w.decode(y.value,{stream:!0});let u=h.split(`
|
|
4
4
|
`);h=u.pop()??"";for(let T of u)for(let k of v(T))yield k}if(h+=w.decode(),h)for(let y of v(h))yield y;for(let y of ee())yield y}finally{f.releaseLock()}if(!r)throw new Error("OpenPond OpChat request failed: stream ended before [DONE].");let O=on(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 I=en(m,g);I&&(yield{type:"usage",usage:I,raw:i}),yield{type:"finish",finishReason:s,raw:i}}a(ve,"streamOpChatChatCompletion");function Ze(e){let n=ke(e,["fireworks-prompt-tokens","prompt-tokens"]),t=ke(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(Ze,"cacheUsageFromResponseHeaders");function ke(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(ke,"firstHeaderTokenCount");function en(e,n){if(!n||nn(e))return e;let t={...e??{},cached_input_tokens:n.cached_input_tokens,cache_telemetry_source:"provider_response_headers"};return E(e?.prompt_tokens)===null&&n.prompt_tokens!==void 0&&(t.prompt_tokens=n.prompt_tokens),t}a(en,"usageWithResponseHeaderCache");function nn(e){return e?E(e.cached_input_tokens)!==null||E(e.cache_read_input_tokens)!==null||E(e.cache_creation_input_tokens)!==null||E(e.prompt_cache_hit_tokens)!==null||E(e.prompt_cache_miss_tokens)!==null?!0:E(e.prompt_tokens_details?.cached_tokens)!==null||E(e.input_tokens_details?.cached_tokens)!==null:!1}a(nn,"usageHasCacheTelemetry");function E(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(E,"usageTokenCount");function tn(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(tn,"mergeOpChatToolCallDeltas");function on(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(on,"completedOpChatToolCalls");function rn(e,n){let t={model:e.model,messages:e.messages.map(sn),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,an(e.reasoningEffort)),t}a(rn,"buildOpChatBody");function an(e){return e?e==="off"?{thinking:{type:"disabled"}}:{thinking:{type:"enabled"},reasoning_effort:e}:{}}a(an,"opChatReasoningFields");function sn(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(sn,"opChatMessage");function se(e,n){let t=e.trim().replace(/\/+$/,"");if(!t)throw new Error("OpenPond OpChat API base URL is required.");return`${t}/${n}`}a(se,"opChatEndpointUrl");function ie(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||qe()),r}a(ie,"opChatHeaders");async function le(e){let n=await e.text().catch(()=>"");if(!n)return e.statusText||`HTTP ${e.status}`;try{return _e(JSON.parse(n))}catch{return n}}a(le,"readOpChatError");function _e(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[H(o.code),H(o.type),H(o.message)].filter(Boolean).join(": ")}return[H(n.error),H(n.message)].filter(Boolean).join(": ")||JSON.stringify(e)}a(_e,"errorMessageFromPayload");function ln(e){if(!e||typeof e!="object")return null;let n=e.usage;return!n||typeof n!="object"?null:n}a(ln,"parseUsage");function H(e){return typeof e=="string"&&e.trim()?e:null}a(H,"stringValue");function Be(e){return typeof e=="string"&&e.length>0?e:null}a(Be,"streamTextValue");import{readFileSync as cn}from"node:fs";var j;function un(){if(j!==void 0)return j??"openpond-code bundled";try{let e=new URL("../package.json",import.meta.resolve("openpond")),n=JSON.parse(cn(e,"utf8"));j=typeof n.version=="string"?`openpond-code@${n.version}`:null}catch{j=null}return j??"openpond-code bundled"}a(un,"getBundledRuntimeVersion");import{spawn as dn}from"node:child_process";function Se(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(Se,"resolveSystemBrowserCommand");async function pn(e,n={}){let t=n.command??Se(e),o=n.handoffTimeoutMs??1500;return new Promise(r=>{let s=!1,i=null,c=a(g=>{s||(s=!0,i&&clearTimeout(i),r(g))},"finish"),m=dn(t.command,t.args,{detached:!1,shell:!1,stdio:"ignore",windowsHide:!0});m.once("error",g=>{let f=g.code;c({opened:!1,error:f?`browser launcher ${t.command} failed (${f})`:`browser launcher ${t.command} failed`})}),m.once("close",(g,f)=>{if(g===0){c({opened:!0});return}let w=f?`signal ${f}`:`code ${g??"unknown"}`;c({opened:!1,error:`browser launcher ${t.command} exited with ${w}`})}),i=setTimeout(()=>{m.unref(),c({opened:!0})},o),i.unref()})}a(pn,"openUrlWithSystemBrowser");function fn(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=pe.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:hn(n.scheduleSummary)}}a(fn,"normalizeApp");function S(e){return typeof e=="string"?e:e instanceof Date?e.toISOString():null}a(S,"normalizeDateString");function mn(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:S(n.startAt),endAt:S(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:S(n.lastExecutionAt),lastExecutionStatus:typeof n.lastExecutionStatus=="string"?n.lastExecutionStatus:null,lastRunNowAt:S(n.lastRunNowAt),lastRunNowStatus:typeof n.lastRunNowStatus=="string"?n.lastRunNowStatus:null,updatedAt:S(n.updatedAt)??new Date().toISOString(),deploymentId:r,isProduction:typeof n.isProduction=="boolean"?n.isProduction:void 0,payload:n.payload}}a(mn,"normalizeSchedule");function hn(e){if(!e||typeof e!="object")return null;let n=e,t=Array.isArray(n.schedules)?n.schedules.map(mn).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:S(n.nextRunAt),lastRunAt:S(n.lastRunAt),schedules:t,truncated:typeof n.truncated=="boolean"?n.truncated:void 0}}a(hn,"normalizeScheduleSummary");async function yn(e){let n=Array.isArray(e.config.accounts)?e.config.accounts:[],t=await Promise.all(n.map(async o=>{let r=F(o.handle,o.baseUrl),s=Y(o);if(!s)return[r,{response:null,authFailed:!1,error:null}];try{return[r,{response:await q(G(o,e.config),s),authFailed:!1,error:null}]}catch(i){return[r,{response:null,authFailed:!0,error:$(i)}]}}));return Object.fromEntries(t)}a(yn,"loadAccountProfileLookups");async function Ce(e){let n=await yn(e),t=e.account?n[F(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(Ce,"loadOpenPondAccountStateForContext");async function An(){return Ce(await p())}a(An,"loadOpenPondAccountState");async function Ie(e={}){let n=await p(),t=Ce(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,fe(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(fn).filter(s=>!!s):[],error:r.status==="rejected"?$(r.reason):null}}a(Ie,"loadOpenPondApps");async function gn(e){let n=await p();if(!n.token)throw new Error("No OpenPond API key or session token is configured.");return{account:n,response:await me(n.apiBaseUrl,n.token,e)}}a(gn,"createOpenPondRepoApp");import{createHash as Pn}from"node:crypto";function wn(e){return`account-${Pn("sha256").update(e).digest("hex").slice(0,8)}`}a(wn,"fallbackHandleForApiKey");function Z(e){let n=e?.trim();return n?n.replace(/^@/,""):null}a(Z,"normalizeDerivedHandle");async function On(e,n){let t=Z(e.handle);if(t)return t;try{let r=(await q(n,e.apiKey)).account,s=Z(r.handle)??Z(r.email?.split("@")[0])??Z(r.id);if(s)return s}catch{}return wn(e.apiKey)}a(On,"deriveHandleForApiKey");async function xn(e){let n=e.baseUrl??N,t=l(e.apiBaseUrl)??V(n)??B,o=l(e.chatApiBaseUrl),r=await On(e,t);return await Pe({handle:r,apiKey:e.apiKey,baseUrl:n,apiBaseUrl:t,chatApiBaseUrl:o,environment:e.environment??"production",setActive:e.setActive}),p(r,n)}a(xn,"saveOpenPondAccount");function bn(e,n,t){let o=l(t),r=e.findIndex(i=>P(i.handle,n)&&b(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(bn,"findAccountIndex");async function Un(e){let n=e.handle.trim();if(!n)throw new Error("OpenPond account handle is required.");return await L(t=>{let o=(t.accounts??[]).map(m=>({...m})),r=bn(o,n,e.baseUrl);if(r===-1)throw new Error(`OpenPond account not found: ${n}`);let s=o[r],i=A(t.activeProfile),c=!!(i&&U(s,i));o.splice(r,1),t.accounts=o,(c||!i||!o.some(m=>U(m,i)))&&(o[0]?t.activeProfile=_(o[0]):delete t.activeProfile)}),p()}a(Un,"removeOpenPondAccount");async function kn(){let e;return await L(n=>{let t=A(n.activeProfile),o=(n.accounts??[]).map(s=>({...s})),r=t?o.findIndex(s=>U(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}),p(e.handle,e.baseUrl)}a(kn,"signOutOpenPondAccount");function Bn(e,n,t){let o=l(t),r=e.findIndex(i=>P(i.handle,n)&&b(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(Bn,"findAccountIndex");function ce(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(ce,"applyOptionalUrl");async function En(e){let n=e.handle.trim();if(!n)throw new Error("OpenPond account handle is required.");let t;return await L(o=>{let r=(o.accounts??[]).map(f=>({...f})),s=Bn(r,n,e.currentBaseUrl);if(s===-1)throw new Error(`OpenPond account not found: ${n}`);let i=r[s];if(t={...i},e.apiKey!==void 0){let f=e.apiKey.trim();if(!f)throw new Error("OpenPond API key cannot be empty.");t.apiKey=f,delete t.session,delete t.token}if(ce(t,"baseUrl",e.baseUrl),ce(t,"apiBaseUrl",e.apiBaseUrl),ce(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)&&b(f.baseUrl,t.baseUrl))!==-1)throw new Error("Another OpenPond account already uses that handle and base URL.");let m=A(o.activeProfile),g=!!(m&&U(i,m));r[s]=t,o.accounts=r,o.activeProfile=e.setActive||g?_(t):o.activeProfile}),p(t.handle,t.baseUrl)}a(En,"updateOpenPondAccountConfig");async function vn(e){let n=await p();if(!n.token)throw new Error("OpenPond is signed out. Add an account before reading app config.");return he(n.apiBaseUrl,n.token,e.appId)}a(vn,"getOpenPondAppEnvironment");function _n(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=Sn(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(_n,"createReadyLineParser");function Sn(e){let n=e.indexOf(`
|