openpond 0.2.42 → 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.
Files changed (181) hide show
  1. package/dist/app-server.d.ts +4473 -653
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/actions-command-5IEZEP6W.js +2 -0
  4. package/dist/chunks/{app-layer-ETI5QXQ3.js → app-layer-7SPLENWD.js} +1 -1
  5. package/dist/chunks/app-server-runtime-NQ2BYPGK.js +2 -0
  6. package/dist/chunks/apps-XQ7PHJTD.js +2 -0
  7. package/dist/chunks/{chunk-NT2UKDF7.js → chunk-2CXJK2M3.js} +1 -1
  8. package/dist/chunks/{chunk-MOMDY22U.js → chunk-36RCXSEJ.js} +1 -1
  9. package/dist/chunks/chunk-3QC2DDQ5.js +2 -0
  10. package/dist/chunks/chunk-3XDFNA7W.js +2 -0
  11. package/dist/chunks/chunk-4S4WH65X.js +3 -0
  12. package/dist/chunks/chunk-4TMC5F2P.js +5 -0
  13. package/dist/chunks/{chunk-Z7VAZVC5.js → chunk-65QCNUGE.js} +283 -202
  14. package/dist/chunks/{chunk-JYM3O4G7.js → chunk-ANVOHBUV.js} +1 -1
  15. package/dist/chunks/chunk-ARJUNUH6.js +5 -0
  16. package/dist/chunks/{chunk-LRGLV6JX.js → chunk-B3O2GAQH.js} +1 -1
  17. package/dist/chunks/{chunk-BJSXEGWG.js → chunk-CEEZ7Y2J.js} +1 -1
  18. package/dist/chunks/{chunk-ZG7QX66E.js → chunk-CR6CDOKS.js} +8 -8
  19. package/dist/chunks/{chunk-AANEPCEZ.js → chunk-DZVVGU6K.js} +1 -1
  20. package/dist/chunks/chunk-HY2Q7EDK.js +4 -0
  21. package/dist/chunks/chunk-IT4AT6LB.js +42 -0
  22. package/dist/chunks/{chunk-VQG25QBJ.js → chunk-KPDWQCF6.js} +1 -1
  23. package/dist/chunks/chunk-KRC2S5QF.js +5 -0
  24. package/dist/chunks/{chunk-AT6XYNQ5.js → chunk-L6HCBIAU.js} +1 -1
  25. package/dist/chunks/chunk-LNEOLOK2.js +13 -0
  26. package/dist/chunks/chunk-NM2GYDPA.js +19 -0
  27. package/dist/chunks/{chunk-QZ4KTU65.js → chunk-OI2N2636.js} +1 -1
  28. package/dist/chunks/{chunk-6UGTLC7Z.js → chunk-OJVIH7J6.js} +1 -1
  29. package/dist/chunks/{chunk-TPMXLA5Y.js → chunk-OMM4ZO7E.js} +7 -7
  30. package/dist/chunks/{chunk-S2MLTFZF.js → chunk-OQPFFKU6.js} +1 -1
  31. package/dist/chunks/{chunk-VTWY3U4M.js → chunk-PEYA2Q7Q.js} +1 -1
  32. package/dist/chunks/{chunk-2VTXKZNK.js → chunk-QID62K65.js} +5 -5
  33. package/dist/chunks/{chunk-76YP4FDQ.js → chunk-RAWEO7SJ.js} +2 -2
  34. package/dist/chunks/{chunk-BAQ3DWH2.js → chunk-W5NQ2DI7.js} +12 -12
  35. package/dist/chunks/{chunk-ZLQQUZH7.js → chunk-X2B4MN6W.js} +1 -1
  36. package/dist/chunks/{chunk-EEJ3HL6O.js → chunk-YF6IDYTS.js} +1 -1
  37. package/dist/chunks/{chunk-R6YJY7F2.js → chunk-YOOPTMQK.js} +1 -1
  38. package/dist/chunks/{chunk-MJC26GOX.js → chunk-Z3D4C7BG.js} +6 -6
  39. package/dist/chunks/{chunk-QUNRWDVO.js → chunk-Z6ZR5O3J.js} +3 -3
  40. package/dist/chunks/{chunk-SUAT5DR4.js → chunk-ZEVARU6J.js} +5 -5
  41. package/dist/chunks/cli-OJU6NQSA.js +2 -0
  42. package/dist/chunks/{configuration-command-N2FD7DWB.js → configuration-command-LDPUCHVH.js} +1 -1
  43. package/dist/chunks/core-commands-UZL5RF2M.js +2 -0
  44. package/dist/chunks/datasets-42AZHVSV.js +13 -0
  45. package/dist/chunks/desktop-test-DI76HKS7.js +3 -0
  46. package/dist/chunks/dist-6YP37XI5.js +2 -0
  47. package/dist/chunks/experiments-Z3S35BYN.js +2 -0
  48. package/dist/chunks/{extension-7GYFAHRP.js → extension-JEUZZJ5X.js} +1 -1
  49. package/dist/chunks/{help-MD7Z72QS.js → help-4F4QGL4C.js} +1 -1
  50. package/dist/chunks/hosted-harness-runtime-VZNYNQ6T.js +2 -0
  51. package/dist/chunks/hosted-profile-compiler-JXLPR7SX.js +2 -0
  52. package/dist/chunks/{hosted-profile-evaluation-control-VV2NXFBE.js → hosted-profile-evaluation-control-Q54YXXIM.js} +1 -1
  53. package/dist/chunks/{hosted-profile-evaluation-inspection-XMPRKON6.js → hosted-profile-evaluation-inspection-7WESM3ZH.js} +1 -1
  54. package/dist/chunks/hosted-profile-evaluation-preparation-QP24PYBL.js +3 -0
  55. package/dist/chunks/opchat-UFWWVJL6.js +3 -0
  56. package/dist/chunks/organizations-SBBIOF6O.js +2 -0
  57. package/dist/chunks/{profile-BZDCYKGL.js → profile-ESULTWDN.js} +1 -1
  58. package/dist/chunks/project-agent-IBHUQ3JX.js +2 -0
  59. package/dist/chunks/sandbox-command-PAJAIMWM.js +2 -0
  60. package/dist/chunks/{sandbox-template-ZYXK4QCI.js → sandbox-template-7WHGNVM6.js} +1 -1
  61. package/dist/chunks/src-5MJSO3UD.js +326 -0
  62. package/dist/chunks/{src-5Z35O6L7.js → src-A3OVZOSV.js} +1 -1
  63. package/dist/chunks/{teams-bot-WXGP3PA6.js → teams-bot-YMCDLBGT.js} +1 -1
  64. package/dist/chunks/{workspaces-7WY3ZVQW.js → workspaces-ZZ7R5BUL.js} +1 -1
  65. package/dist/cli.js +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/profile/local-profile.d.ts +2 -0
  68. package/dist/web/assets/App-6AQXN2SM.js +226 -0
  69. package/dist/web/assets/{AppDialog-DMymIOcU.js → AppDialog-CV3ddujB.js} +1 -1
  70. package/dist/web/assets/AppTerminalPanel-dhbGOO_K.js +2 -0
  71. package/dist/web/assets/{AppsView-CUrRKOiz.js → AppsView-Bxa-9BF2.js} +1 -1
  72. package/dist/web/assets/{BrowserSidebar-C5psWtoF.js → BrowserSidebar-BLwL2FOG.js} +1 -1
  73. package/dist/web/assets/{CartesianChart-DVGs4fGn.js → CartesianChart-BOxN-Su1.js} +1 -1
  74. package/dist/web/assets/{CollaborationTabs-D6eqNw88.js → CollaborationTabs-DTmJvNJx.js} +1 -1
  75. package/dist/web/assets/{CommandMenu--GRjuf3j.js → CommandMenu-DggN2ygj.js} +1 -1
  76. package/dist/web/assets/{CommunityView-CHGceVA_.js → CommunityView-CuDrYOIf.js} +1 -1
  77. package/dist/web/assets/{ComposerCreateImproveStrip-D08PAaxI.js → ComposerCreateImproveStrip-BrduENlL.js} +1 -1
  78. package/dist/web/assets/{GetStartedView-BPZcWzsG.js → GetStartedView-Db1IEWzv.js} +1 -1
  79. package/dist/web/assets/HostedModelLearningReview-kofNdPAe.js +1 -0
  80. package/dist/web/assets/{HostedModelLearningSettings-BmEMKcoy.js → HostedModelLearningSettings-6ij3nwWD.js} +1 -1
  81. package/dist/web/assets/{LabModelVersionDetailPage-CX5pOLl2.js → LabModelVersionDetailPage-C7Maqcit.js} +1 -1
  82. package/dist/web/assets/{LabSkillSidebar-C4vAz_0b.js → LabSkillSidebar-Bz0U-Nmw.js} +1 -1
  83. package/dist/web/assets/LabsRoute-Ch1N-e2S.js +52 -0
  84. package/dist/web/assets/LabsRoute-Dw6-12kt.css +1 -0
  85. package/dist/web/assets/MainChatThread-BJbhZOvs.js +2 -0
  86. package/dist/web/assets/{MainPane-EwtIf5_E.js → MainPane-Cs2Kng_k.js} +4 -4
  87. package/dist/web/assets/{MarkdownText-Bj9uRWtM.js → MarkdownText-BhzHRq1J.js} +1 -1
  88. package/dist/web/assets/{NativeSkillSidebar-U7PHw5DO.js → NativeSkillSidebar-LU-PhEhW.js} +1 -1
  89. package/dist/web/assets/{NewExperienceSwitcher-DneuamYK.js → NewExperienceSwitcher-Bi_gpHLG.js} +1 -1
  90. package/dist/web/assets/{NewProjectDialog-CrpXYCYV.js → NewProjectDialog-B8pWvSkq.js} +1 -1
  91. package/dist/web/assets/{OutputsPage-C1SPqz45.js → OutputsPage-BkGI0kHp.js} +1 -1
  92. package/dist/web/assets/{ProjectsPage-CCW3mGQb.js → ProjectsPage-Ca8_iEWu.js} +1 -1
  93. package/dist/web/assets/{RightChatPanelStack-D7ECzLfp.js → RightChatPanelStack-DjEdxsq8.js} +1 -1
  94. package/dist/web/assets/{RightSidebarHomePanel-B-4r-yLc.js → RightSidebarHomePanel-6pygznxX.js} +1 -1
  95. package/dist/web/assets/{ScheduledWorkPage-XjmcT64Z.js → ScheduledWorkPage-BSiOxxAH.js} +1 -1
  96. package/dist/web/assets/{SettingsView-BEBpD7W0.js → SettingsView-1XN7KLBl.js} +3 -3
  97. package/dist/web/assets/{TeamChatView-n9GnPY4F.js → TeamChatView-BGLCPTen.js} +2 -2
  98. package/dist/web/assets/{TerminalOverlay-CNaaMo7W.js → TerminalOverlay-DHkS2cVJ.js} +1 -1
  99. package/dist/web/assets/{TrainingCreationPanel-CEEXMmC5.js → TrainingCreationPanel-Dneamjzh.js} +1 -1
  100. package/dist/web/assets/{TrainingDraftPanel-CwyoL_Dy.js → TrainingDraftPanel-Cfh59jLZ.js} +1 -1
  101. package/dist/web/assets/{UsageSettingsSection-BNjgosYd.js → UsageSettingsSection-C9l1KY-O.js} +1 -1
  102. package/dist/web/assets/{WorkSidebarPanel-BatJltaq.js → WorkSidebarPanel-CEnO-Txp.js} +1 -1
  103. package/dist/web/assets/{WorkspaceDiffPanel-Cbr7qcqm.js → WorkspaceDiffPanel-BiuQBflC.js} +3 -3
  104. package/dist/web/assets/{WorkspaceEnvironmentMenu-DYu-PXRv.js → WorkspaceEnvironmentMenu-Dr-E0c1j.js} +1 -1
  105. package/dist/web/assets/{WorkspaceGitDialogs-BoamHtgk.js → WorkspaceGitDialogs-mE3Og6Zo.js} +1 -1
  106. package/dist/web/assets/{WorkspaceMonacoEditor-yg83VXk5.js → WorkspaceMonacoEditor-DPZ0n0G9.js} +60 -60
  107. package/dist/web/assets/{arrow-up-right-CN9lcbsD.js → arrow-up-right-DU2KsZD-.js} +1 -1
  108. package/dist/web/assets/{clipboard-DfLDGpSz.js → clipboard-g2b4_k81.js} +1 -1
  109. package/dist/web/assets/{cloud-upload-hk4EBTu-.js → cloud-upload-P2bDOPsQ.js} +1 -1
  110. package/dist/web/assets/cssMode-CPbPVAUt.js +1 -0
  111. package/dist/web/assets/{folder-open-BmhusYOx.js → folder-open-BmsONNsr.js} +1 -1
  112. package/dist/web/assets/{folder-plus-Bedc_RqV.js → folder-plus-B18NgUxy.js} +1 -1
  113. package/dist/web/assets/{git-commit-horizontal-D2Zvz4i7.js → git-commit-horizontal-enxGCV_e.js} +1 -1
  114. package/dist/web/assets/htmlMode-DiV88uQv.js +1 -0
  115. package/dist/web/assets/index-B9VSiz_z.css +1 -0
  116. package/dist/web/assets/{index-CpTHPmvd.js → index-vfpCN9zy.js} +6 -6
  117. package/dist/web/assets/{info-CayXQYUk.js → info-DmuSBIYe.js} +1 -1
  118. package/dist/web/assets/{jsonMode-_Ywm0ZC4.js → jsonMode-BaeOjuKU.js} +4 -4
  119. package/dist/web/assets/{lspLanguageFeatures-Caw_TPYu.js → lspLanguageFeatures-D8To0CQA.js} +1 -1
  120. package/dist/web/assets/{minimize-2-sPQtjkx8.js → minimize-2-C2xnEzCe.js} +1 -1
  121. package/dist/web/assets/monaco.contribution-DbrACt99.js +2 -0
  122. package/dist/web/assets/{monaco.contribution-CngZuH1Z.js → monaco.contribution-DgTFvG2Q.js} +2 -2
  123. package/dist/web/assets/{monaco.contribution-DmEqb8O2.js → monaco.contribution-JW3MxX6k.js} +2 -2
  124. package/dist/web/assets/{monaco.contribution-Bqi-s2-g.js → monaco.contribution-bytkwn0O.js} +2 -2
  125. package/dist/web/assets/{monitor-BuaCDSIZ.js → monitor-mtHVW7gU.js} +1 -1
  126. package/dist/web/assets/{python-D6SoZF70.js → python-DAPe0Urm.js} +1 -1
  127. package/dist/web/assets/{refresh-cw-DmpWkVF6.js → refresh-cw-Dvm_Pq3U.js} +1 -1
  128. package/dist/web/assets/{save-Di43Sc13.js → save-B2eVAjW6.js} +1 -1
  129. package/dist/web/assets/{square-Cui64whj.js → square-16bX2k2i.js} +1 -1
  130. package/dist/web/assets/toggleHighContrast-BgpFWRpS.css +1 -0
  131. package/dist/web/assets/{toggleHighContrast-e8XiQRTr.js → toggleHighContrast-Ce0YhEQg.js} +1 -1
  132. package/dist/web/assets/{tsMode-Cvh0MpFm.js → tsMode-CnvMmHz6.js} +1 -1
  133. package/dist/web/assets/{upload-Dphgk6dy.js → upload-COPbAaD-.js} +1 -1
  134. package/dist/web/assets/{useLocalAgentSchedules-CDN8WQld.js → useLocalAgentSchedules-C-Wjm5HK.js} +1 -1
  135. package/dist/web/assets/{useSessionTurnCache-Bvcc_al6.js → useSessionTurnCache-BfVbncMB.js} +1 -1
  136. package/dist/web/assets/{wifi-off-CIWXrn3o.js → wifi-off-C9iLbCC-.js} +1 -1
  137. package/dist/web/assets/{workers-XU4YZxHD.js → workers-BXh_u8Fr.js} +1 -1
  138. package/dist/web/assets/{yaml-BZ0UGaZH.js → yaml-CRSr9x6_.js} +1 -1
  139. package/dist/web/index.html +5 -5
  140. package/docs/command-reference.md +8 -1
  141. package/package.json +4 -2
  142. package/dist/chunks/actions-command-6EMO4BIK.js +0 -2
  143. package/dist/chunks/app-server-runtime-CJ7SJTTF.js +0 -2
  144. package/dist/chunks/apps-LH5AJCUI.js +0 -2
  145. package/dist/chunks/chunk-2Z6H32OC.js +0 -2
  146. package/dist/chunks/chunk-3CKJETWW.js +0 -2
  147. package/dist/chunks/chunk-4F2Q4CFS.js +0 -4
  148. package/dist/chunks/chunk-ANCZVBMI.js +0 -42
  149. package/dist/chunks/chunk-AUOMUBLE.js +0 -3
  150. package/dist/chunks/chunk-GC4OCTP6.js +0 -2
  151. package/dist/chunks/chunk-KCENW4ME.js +0 -2
  152. package/dist/chunks/chunk-OUN6VQDO.js +0 -5
  153. package/dist/chunks/chunk-TPOW52DO.js +0 -13
  154. package/dist/chunks/chunk-VI3ZF54E.js +0 -5
  155. package/dist/chunks/chunk-XJAK6DDB.js +0 -5
  156. package/dist/chunks/chunk-ZQWXPDCB.js +0 -19
  157. package/dist/chunks/cli-FM3DESGO.js +0 -2
  158. package/dist/chunks/core-commands-D2MJ7QFZ.js +0 -2
  159. package/dist/chunks/datasets-UYIZCMNZ.js +0 -13
  160. package/dist/chunks/desktop-test-IWDHFDSZ.js +0 -3
  161. package/dist/chunks/dist-JPRXSUXC.js +0 -2
  162. package/dist/chunks/experiments-Q6TAHJV3.js +0 -2
  163. package/dist/chunks/hosted-harness-runtime-LMYM7PYZ.js +0 -2
  164. package/dist/chunks/hosted-profile-compiler-H2J5HFT3.js +0 -2
  165. package/dist/chunks/hosted-profile-evaluation-preparation-ZZ3MZJDR.js +0 -3
  166. package/dist/chunks/opchat-URWW53CK.js +0 -3
  167. package/dist/chunks/organizations-BPBJV7LZ.js +0 -2
  168. package/dist/chunks/project-agent-U6YNYPHS.js +0 -2
  169. package/dist/chunks/sandbox-command-TTLFWUXV.js +0 -2
  170. package/dist/chunks/src-NABQMSR3.js +0 -325
  171. package/dist/web/assets/App-BpYDvJ6x.js +0 -226
  172. package/dist/web/assets/AppTerminalPanel-CFsUD-di.js +0 -2
  173. package/dist/web/assets/HostedModelLearningReview-DiS-n3XW.js +0 -1
  174. package/dist/web/assets/LabsRoute-BL04wKhE.js +0 -52
  175. package/dist/web/assets/LabsRoute-Cq9XLVDP.css +0 -1
  176. package/dist/web/assets/MainChatThread-BSwHDALr.js +0 -2
  177. package/dist/web/assets/cssMode-DkhTpCaH.js +0 -1
  178. package/dist/web/assets/htmlMode-Bf3_KJ2b.js +0 -1
  179. package/dist/web/assets/index-DUIWDN8o.css +0 -1
  180. package/dist/web/assets/monaco.contribution-DKY5M77J.js +0 -2
  181. 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-VI3ZF54E.js";import{$a as o,k as t}from"./chunk-TPOW52DO.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};
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-BAQ3DWH2.js";import{e as pe}from"./chunk-VI3ZF54E.js";import{d as N,e as B}from"./chunk-MJC26GOX.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(`