openpond 0.0.38 → 0.0.40

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 (212) hide show
  1. package/README.md +3 -4
  2. package/dist/api/core.d.ts +6 -0
  3. package/dist/api/vercel-protection.d.ts +1 -0
  4. package/dist/chunks/{app-layer-DPUJRNO2.js → app-layer-UPNMLDO5.js} +37 -11
  5. package/dist/chunks/app-server-runtime-2WTZXXOF.js +18 -0
  6. package/dist/chunks/{apps-AKBI6AS7.js → apps-XLPSFCW4.js} +6 -4
  7. package/dist/chunks/{chunk-LZZM3IHS.js → chunk-2SF6HLT7.js} +5899 -5939
  8. package/dist/chunks/chunk-34U5C7ZD.js +37172 -0
  9. package/dist/chunks/{chunk-JWF37O5E.js → chunk-3HW6OSHP.js} +1 -3
  10. package/dist/chunks/{chunk-43YI36NA.js → chunk-3KLQ52B2.js} +228 -5
  11. package/dist/chunks/{chunk-YTJL6XPU.js → chunk-75ZLFVFZ.js} +56 -11
  12. package/dist/chunks/{chunk-HS2AGRDV.js → chunk-CZG4XKVF.js} +1 -1
  13. package/dist/chunks/chunk-DBHSOTYZ.js +1552 -0
  14. package/dist/chunks/{chunk-275WCETC.js → chunk-FCVVOMIP.js} +145 -5
  15. package/dist/chunks/{chunk-AHNFNWUN.js → chunk-HHALVXPK.js} +1 -1
  16. package/dist/chunks/{chunk-GB6VUZUA.js → chunk-JIEUB6OS.js} +1 -1
  17. package/dist/chunks/chunk-KHNHUA2H.js +1737 -0
  18. package/dist/chunks/{chunk-GDZYDLEL.js → chunk-KSOI7GFA.js} +1 -110
  19. package/dist/chunks/chunk-M2NXTLH2.js +4054 -0
  20. package/dist/chunks/{chunk-AHPQTEIJ.js → chunk-MCBAI5M5.js} +4 -4
  21. package/dist/chunks/{chunk-SLMP353Q.js → chunk-MIZHCABO.js} +2 -195
  22. package/dist/chunks/{chunk-XCATKTK3.js → chunk-QHUJ2XVJ.js} +108 -66
  23. package/dist/chunks/chunk-SMNFI2FU.js +113 -0
  24. package/dist/chunks/chunk-VCVQLECH.js +675 -0
  25. package/dist/chunks/{chunk-V35STJF4.js → chunk-ZJBJQCQZ.js} +179 -52
  26. package/dist/chunks/{chunk-QRM7XMAO.js → chunk-ZTE6A2VE.js} +155 -163
  27. package/dist/chunks/{cli-7BKDWFNU.js → cli-ZIY4LAYZ.js} +9 -5
  28. package/dist/chunks/{core-commands-YN4RMWA3.js → core-commands-D66KZEHU.js} +7 -5
  29. package/dist/chunks/{harness-BHQRMXJR.js → desktop-test-FDA6MV77.js} +15 -14
  30. package/dist/chunks/{chunk-XERQHYBO.js → extension-GDRW22N3.js} +5868 -3580
  31. package/dist/chunks/{help-VREQNA4I.js → help-7QG4UITV.js} +1 -1
  32. package/dist/chunks/{opchat-D63YTNSX.js → opchat-I2WGEFGU.js} +9 -10
  33. package/dist/chunks/{organizations-I46KG7TC.js → organizations-MADRLI2I.js} +11 -9
  34. package/dist/chunks/{profile-WKZJHEPG.js → profile-B4A3GT3U.js} +12 -38
  35. package/dist/chunks/{project-agent-ZUC3YMCT.js → project-agent-PCO42FZJ.js} +9 -411
  36. package/dist/chunks/{sandbox-command-AAOPFTI5.js → sandbox-command-LBKSIR7P.js} +7 -5
  37. package/dist/chunks/{sandbox-template-GKNVR4C5.js → sandbox-template-YJXGG4H3.js} +8 -6
  38. package/dist/chunks/src-23HDSVNH.js +63517 -0
  39. package/dist/chunks/{src-RPW5TOPI.js → src-35JYS27L.js} +32 -30
  40. package/dist/chunks/{teams-bot-PSL3ZO6Z.js → teams-bot-L4SR2SWM.js} +6 -4
  41. package/dist/chunks/training-BR5A7SPU.js +320 -0
  42. package/dist/chunks/{workspaces-BPXC2DHT.js → workspaces-NGDIBOKQ.js} +2 -2
  43. package/dist/cli.js +24 -12
  44. package/dist/config.d.ts +9 -3
  45. package/dist/index.js +1300 -1045
  46. package/dist/profile/local-profile-types.d.ts +16 -0
  47. package/dist/profile/local-profile.d.ts +50 -4
  48. package/dist/sandbox/client-handles.d.ts +33 -46
  49. package/dist/sandbox/client.d.ts +4 -26
  50. package/dist/sandbox/sandbox-instance-client.d.ts +5 -5
  51. package/dist/sandbox/types/client.d.ts +1 -2
  52. package/dist/sandbox/types/core.d.ts +0 -1
  53. package/dist/sandbox/types/org-project-agent.d.ts +3 -89
  54. package/dist/sandbox/types/record.d.ts +1 -2
  55. package/dist/sandbox/types/runtime-profiles.d.ts +2 -2
  56. package/dist/sandbox-template/manifest.d.ts +1 -1
  57. package/dist/skills/openpond-agent-authoring/SKILL.md +40 -0
  58. package/dist/skills/openpond-agent-authoring/references/action-and-chat-design.md +13 -0
  59. package/dist/skills/openpond-agent-authoring/references/integrations-and-setup.md +13 -0
  60. package/dist/skills/openpond-agent-authoring/references/profile-layout.md +29 -0
  61. package/dist/skills/openpond-agent-authoring/references/validation-and-repair.md +14 -0
  62. package/dist/skills/openpond-desktop-harness/SKILL.md +1 -1
  63. package/dist/skills/openpond-skill-authoring/SKILL.md +44 -0
  64. package/dist/skills/openpond-skill-authoring/references/copying-and-adaptation.md +16 -0
  65. package/dist/skills/openpond-skill-authoring/references/skill-package-layout.md +38 -0
  66. package/dist/skills/openpond-skill-authoring/references/validation-and-repair.md +24 -0
  67. package/dist/skills/openpond-skill-authoring/scripts/validate-skill.mjs +102 -0
  68. package/dist/skills/openpond-taskset-authoring/SKILL.md +64 -22
  69. package/dist/skills/openpond-taskset-authoring/artifact.json +39 -0
  70. package/dist/skills/openpond-taskset-authoring/references/graders-and-rewards.md +3 -0
  71. package/dist/skills/openpond-taskset-authoring/references/method-selection.md +1 -1
  72. package/dist/skills/openpond-taskset-authoring/references/privacy-and-provenance.md +2 -0
  73. package/dist/skills/openpond-taskset-authoring/references/task-design.md +32 -0
  74. package/dist/web/assets/{AppDialog-DrwJb_wG.js → AppDialog-Bua3f-6v.js} +1 -1
  75. package/dist/web/assets/{AppsView-DPagLMsc.js → AppsView-DrJkHeSO.js} +1 -1
  76. package/dist/web/assets/BrowserSidebar-Bf-4Vozm.js +1 -0
  77. package/dist/web/assets/CommandMenu-DDZlGQiB.js +1 -0
  78. package/dist/web/assets/CommunityView-BtcCrba7.js +1 -0
  79. package/dist/web/assets/ComposerCreateImproveStrip-DOe5Otg6.js +1 -0
  80. package/dist/web/assets/GetStartedView-CG4z0Dtw.js +1 -0
  81. package/dist/web/assets/GetStartedView-yVmnGZPw.css +1 -0
  82. package/dist/web/assets/LabModelVersionDetailPage-BEkmSKuv.js +1 -0
  83. package/dist/web/assets/LabSkillSidebar-BIotN_RB.js +1 -0
  84. package/dist/web/assets/LabsRoute-CfOe0Zt5.js +3 -0
  85. package/dist/web/assets/LabsRoute-CoSPO4HR.css +1 -0
  86. package/dist/web/assets/MainChatThread-C0-l1mHt.js +2 -0
  87. package/dist/web/assets/MainPane-Bky_Rqcx.css +1 -0
  88. package/dist/web/assets/MainPane-aOVlVyRK.js +6 -0
  89. package/dist/web/assets/MarkdownText-D7DT1k1k.js +9 -0
  90. package/dist/web/assets/Messages-CBIXruA9.js +9 -0
  91. package/dist/web/assets/NativeSkillSidebar-C4t69Y7B.js +1 -0
  92. package/dist/web/assets/NewProjectDialog-Bat65tYD.js +1 -0
  93. package/dist/web/assets/OutputsPage-C58n39Db.js +1 -0
  94. package/dist/web/assets/RightChatPanelStack-Bp7nZxQ0.js +1 -0
  95. package/dist/web/assets/ScheduledWorkPage-BXP0j_c_.js +1 -0
  96. package/dist/web/assets/SettingsView-CtWK_aQ0.css +1 -0
  97. package/dist/web/assets/SettingsView-DOOfhO9a.js +6 -0
  98. package/dist/web/assets/TeamChatView-Cgxm-pKA.css +1 -0
  99. package/dist/web/assets/TeamChatView-De2wdqyY.js +3 -0
  100. package/dist/web/assets/{TerminalOverlay-BKl0p8pa.js → TerminalOverlay-BsuCH3NX.js} +1 -1
  101. package/dist/web/assets/TrainingCreationPanel-D2OFWyQ-.js +1 -0
  102. package/dist/web/assets/TrainingDraftPanel-DBpulXTz.js +1 -0
  103. package/dist/web/assets/{UsageSettingsSection-zDAwzTGl.js → UsageSettingsSection-DzMLUXAO.js} +37 -37
  104. package/dist/web/assets/WorkspaceDiffPanel-B7yIhjNF.js +14 -0
  105. package/dist/web/assets/WorkspaceEnvironmentMenu-B6jXM9xG.js +32 -0
  106. package/dist/web/assets/WorkspaceGitDialogs-CQ0fl9Qk.js +1 -0
  107. package/dist/web/assets/{WorkspaceMonacoEditor-DPGcG8fy.js → WorkspaceMonacoEditor-C2ctzITz.js} +3 -3
  108. package/dist/web/assets/arrow-up-right-ecwcx3xt.js +1 -0
  109. package/dist/web/assets/chevron-up-DP8PPfWd.js +1 -0
  110. package/dist/web/assets/circle-alert-envg1D6O.js +1 -0
  111. package/dist/web/assets/cloud-upload-5MGPLnaA.js +1 -0
  112. package/dist/web/assets/{cssMode-CKN9CcfG.js → cssMode-CFifcEfw.js} +1 -1
  113. package/dist/web/assets/folder-open-Dq3ZjeEP.js +1 -0
  114. package/dist/web/assets/folder-plus-EiZ5wbv_.js +1 -0
  115. package/dist/web/assets/git-branch-w29jmQ-X.js +1 -0
  116. package/dist/web/assets/{git-commit-horizontal-Bxi8YPep.js → git-commit-horizontal-CGZM0PZo.js} +1 -1
  117. package/dist/web/assets/{htmlMode-CeUcNhBZ.js → htmlMode-Ct1P-_lf.js} +1 -1
  118. package/dist/web/assets/index-ByIQyiUl.js +178 -0
  119. package/dist/web/assets/index-D4uCeiep.js +1 -0
  120. package/dist/web/assets/index-D9jTe16Q.css +1 -0
  121. package/dist/web/assets/info-Cd2HkIeb.js +1 -0
  122. package/dist/web/assets/{jsonMode-97z0Yz9u.js → jsonMode-BAUNCNAX.js} +1 -1
  123. package/dist/web/assets/{lspLanguageFeatures-D4Tp-JmI.js → lspLanguageFeatures-fucFYI1A.js} +1 -1
  124. package/dist/web/assets/monaco.contribution-Ce4v5kei.js +2 -0
  125. package/dist/web/assets/monaco.contribution-DLLMi4cB.js +2 -0
  126. package/dist/web/assets/monaco.contribution-g9QiIm1d.js +2 -0
  127. package/dist/web/assets/monaco.contribution-nG-5Cyjz.js +2 -0
  128. package/dist/web/assets/monitor-DgHCnCKl.js +1 -0
  129. package/dist/web/assets/{play-C-37dnR1.js → play-Be0XDHBu.js} +1 -1
  130. package/dist/web/assets/{python-CGpDXY7_.js → python-CEhEiPo7.js} +1 -1
  131. package/dist/web/assets/{refresh-cw-BAaaPCXl.js → refresh-cw-DH0KLbdD.js} +1 -1
  132. package/dist/web/assets/reply-D1TK2yV8.js +1 -0
  133. package/dist/web/assets/{save-Cvxs3XyC.js → save-C1MSeBnQ.js} +1 -1
  134. package/dist/web/assets/square-CemI-0g5.js +1 -0
  135. package/dist/web/assets/square-pen-CqfsvR_n.js +1 -0
  136. package/dist/web/assets/{toggleHighContrast-CD42jH4g.js → toggleHighContrast-DrdQN3Rl.js} +1 -1
  137. package/dist/web/assets/training-BQVNUTZA.css +1 -0
  138. package/dist/web/assets/training-model-data-B7-1Bxil.js +1 -0
  139. package/dist/web/assets/{tsMode-ZROIxEjv.js → tsMode-CKB5oOUU.js} +1 -1
  140. package/dist/web/assets/{upload-DvCSGERK.js → upload-t751LLqP.js} +1 -1
  141. package/dist/web/assets/useLocalAgentSchedules-CzC3wfIP.js +1 -0
  142. package/dist/web/assets/{wifi-off-BIb94PkS.js → wifi-off-CxTHH3JU.js} +1 -1
  143. package/dist/web/assets/{workers-oYqbrVYG.js → workers-CqYddzCd.js} +1 -1
  144. package/dist/web/assets/{yaml-WqBjNgOO.js → yaml-e5wBkc-C.js} +1 -1
  145. package/dist/web/index.html +2 -2
  146. package/docs/command-reference.md +75 -40
  147. package/package.json +3 -1
  148. package/dist/chunks/chunk-FWLOFUPU.js +0 -864
  149. package/dist/chunks/chunk-HLCTINEP.js +0 -224
  150. package/dist/chunks/chunk-MPGSHXGF.js +0 -3896
  151. package/dist/chunks/chunk-T4QXKU5Y.js +0 -1
  152. package/dist/chunks/chunk-XEJ7XXUQ.js +0 -1301
  153. package/dist/chunks/chunk-ZI4GDAUB.js +0 -3522
  154. package/dist/chunks/cli-2KBVNDRY.js +0 -23
  155. package/dist/chunks/extend-REGNTBK3.js +0 -89
  156. package/dist/chunks/extension-7K77DAVL.js +0 -121
  157. package/dist/chunks/fileFromPath-DHCRY3BD.js +0 -2151
  158. package/dist/chunks/src-MWDIK56B.js +0 -105881
  159. package/dist/web/assets/BrowserSidebar-DMn2V8RV.js +0 -1
  160. package/dist/web/assets/CloudWorkView-Cl_7mM3c.js +0 -1
  161. package/dist/web/assets/CloudWorkView-DNoPIlMj.css +0 -1
  162. package/dist/web/assets/CommandMenu-CHMQLez_.js +0 -1
  163. package/dist/web/assets/CommunityView-DcHVDUk0.js +0 -1
  164. package/dist/web/assets/ComposerCreateImproveStrip-BZ3Dgzmo.js +0 -1
  165. package/dist/web/assets/GetStartedView-DBLdduwr.css +0 -1
  166. package/dist/web/assets/GetStartedView-DTRotFqz.js +0 -1
  167. package/dist/web/assets/LabSkillSidebar-D-PqFe1T.js +0 -1
  168. package/dist/web/assets/LabsRoute-BrJkBNig.css +0 -1
  169. package/dist/web/assets/LabsRoute-Dew1BwK5.js +0 -3
  170. package/dist/web/assets/MainChatThread-BaPxxzrw.js +0 -2
  171. package/dist/web/assets/MakeAgentTutorialLearningPanel-CBsfnONQ.js +0 -2
  172. package/dist/web/assets/MarkdownText-DGLfAM_Z.js +0 -7
  173. package/dist/web/assets/Messages-CIX9uTjX.js +0 -10
  174. package/dist/web/assets/NativeSkillSidebar-AP_uHn6g.js +0 -1
  175. package/dist/web/assets/NewProjectDialog-C6lHkafU.js +0 -1
  176. package/dist/web/assets/PostTrainingLearningPanel-CZEgPc8O.js +0 -2
  177. package/dist/web/assets/PostTrainingStatusPill-CeEpwUDB.js +0 -1
  178. package/dist/web/assets/ProfileSettingsSection-Cg4tKO-C.css +0 -1
  179. package/dist/web/assets/ProfileSettingsSection-EumMLlEp.js +0 -1
  180. package/dist/web/assets/RightChatPanelStack-MXBcx3zO.js +0 -1
  181. package/dist/web/assets/SettingsView-Caljbns2.css +0 -1
  182. package/dist/web/assets/SettingsView-DyURG_Uh.js +0 -6
  183. package/dist/web/assets/TeamChatView-Bx44q3WV.css +0 -1
  184. package/dist/web/assets/TeamChatView-D3v6aqJ3.js +0 -3
  185. package/dist/web/assets/TrainingCreationPanel-CfZQTuT5.js +0 -1
  186. package/dist/web/assets/TrainingDraftPanel-DslRPSDW.js +0 -1
  187. package/dist/web/assets/WorkspaceDiffPanel-C_MZPPlL.js +0 -14
  188. package/dist/web/assets/WorkspaceEnvironmentMenu-BUAnn80j.js +0 -32
  189. package/dist/web/assets/WorkspaceGitDialogs-Drbf4ujA.js +0 -1
  190. package/dist/web/assets/activity-Dnr3jqb3.js +0 -1
  191. package/dist/web/assets/boxes-BinC8UPn.js +0 -1
  192. package/dist/web/assets/chevron-up-Bjp_-_Cb.js +0 -1
  193. package/dist/web/assets/circle-x-ubnvEYuE.js +0 -1
  194. package/dist/web/assets/copy-B_ZCCUMz.js +0 -1
  195. package/dist/web/assets/create-pipeline-request-D6uLUxe9.js +0 -4
  196. package/dist/web/assets/file-8HAMlTmQ.js +0 -1
  197. package/dist/web/assets/git-branch-l2Zih3Bv.js +0 -1
  198. package/dist/web/assets/index-BMFyOFRU.css +0 -1
  199. package/dist/web/assets/index-BzwcDzbT.js +0 -1
  200. package/dist/web/assets/index-KoQSSt_f.js +0 -177
  201. package/dist/web/assets/info-JTbDQxHx.js +0 -1
  202. package/dist/web/assets/make-agent-tutorial-D6nBCgv-.js +0 -2
  203. package/dist/web/assets/monaco.contribution-B3j6oown.js +0 -2
  204. package/dist/web/assets/monaco.contribution-BXHxPPWL.js +0 -2
  205. package/dist/web/assets/monaco.contribution-C2P5zIzh.js +0 -2
  206. package/dist/web/assets/monaco.contribution-C8c6OtGi.js +0 -2
  207. package/dist/web/assets/monitor-kzHtxHnA.js +0 -1
  208. package/dist/web/assets/reply-9rehU13k.js +0 -1
  209. package/dist/web/assets/rotate-cw-C1Z_Xs23.js +0 -1
  210. package/dist/web/assets/training-BN8CALIc.css +0 -1
  211. package/dist/web/assets/training-model-data-BXUCzS0p.js +0 -1
  212. package/docs/agent-edit-check-status-json.md +0 -132
@@ -1,11 +1,8 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
2
  import {
3
- DEFAULT_OPENPOND_API_BASE_URL,
4
3
  DEFAULT_OPENPOND_CHAT_MODEL,
5
- DEFAULT_OPENPOND_WEB_BASE_URL,
6
4
  ProviderCatalogSchema,
7
5
  SandboxAppActionRegistrySchema,
8
- checkOpenPondApiHealth,
9
6
  createRepo,
10
7
  getAppEnvironment,
11
8
  getOpenPondAccount,
@@ -15,7 +12,12 @@ import {
15
12
  saveConfig,
16
13
  saveProfileApiKey,
17
14
  setActiveProfile
18
- } from "./chunk-LZZM3IHS.js";
15
+ } from "./chunk-2SF6HLT7.js";
16
+ import {
17
+ DEFAULT_OPENPOND_API_BASE_URL,
18
+ DEFAULT_OPENPOND_WEB_BASE_URL,
19
+ withVercelProtectionBypass
20
+ } from "./chunk-KHNHUA2H.js";
19
21
 
20
22
  // ../../packages/runtime/dist/chat.js
21
23
  import { randomUUID } from "node:crypto";
@@ -78,6 +80,9 @@ function normalizeOpChatApiBaseUrl(value) {
78
80
  return null;
79
81
  try {
80
82
  const url = new URL(normalized);
83
+ if (url.hostname.toLowerCase() === "api-new.staging-api.openpond.ai") {
84
+ url.hostname = "staging-api.openpond.ai";
85
+ }
81
86
  const segments = url.pathname.split("/").filter(Boolean);
82
87
  const opChatIndex = segments.findIndex((segment) => segment.toLowerCase() === "opchat");
83
88
  if (opChatIndex >= 0) {
@@ -111,11 +116,12 @@ function deriveEnvironment(fallback) {
111
116
  }
112
117
 
113
118
  // ../../packages/runtime/dist/selectors.js
114
- function accountToken(account) {
119
+ function accountToken(account, env = process.env) {
115
120
  const candidates = [
116
121
  account?.apiKey,
117
122
  account?.session?.token,
118
- account?.token
123
+ account?.token,
124
+ env.OPENPOND_API_KEY
119
125
  ];
120
126
  for (const value of candidates) {
121
127
  const trimmed = typeof value === "string" ? value.trim() : "";
@@ -406,7 +412,7 @@ function errorMessage(error) {
406
412
  }
407
413
 
408
414
  // ../../packages/runtime/dist/chat.js
409
- var PROVIDER_CATALOG_FETCH_TIMEOUT_MS = 2500;
415
+ var PROVIDER_CATALOG_FETCH_TIMEOUT_MS = 15e3;
410
416
  async function loadOpenPondProviderCatalog() {
411
417
  const context = await loadOpenPondAccountContext();
412
418
  if (!context.token) {
@@ -451,13 +457,16 @@ async function* streamOpenPondHostedChatTurn(input) {
451
457
  tools: input.tools,
452
458
  toolChoice: input.toolChoice,
453
459
  requestId: input.requestId,
460
+ reasoningEffort: input.reasoningEffort,
461
+ maxTokens: input.maxTokens,
454
462
  signal: input.signal
455
463
  });
456
464
  }
457
465
  async function listOpChatProviderCatalog(options) {
458
- const response = await fetch(opChatEndpointUrl(options.apiBaseUrl, "provider-catalog"), {
466
+ const requestUrl = opChatEndpointUrl(options.apiBaseUrl, "provider-catalog");
467
+ const response = await fetch(requestUrl, {
459
468
  method: "GET",
460
- headers: opChatHeaders(options.token, "application/json"),
469
+ headers: opChatHeaders(requestUrl, options.token, "application/json"),
461
470
  signal: options.signal
462
471
  });
463
472
  if (!response.ok) {
@@ -466,56 +475,61 @@ async function listOpChatProviderCatalog(options) {
466
475
  return ProviderCatalogSchema.parse(await response.json());
467
476
  }
468
477
  async function* streamOpChatChatCompletion(options) {
469
- const response = await fetch(opChatEndpointUrl(options.apiBaseUrl, "chat/completions"), {
478
+ const requestUrl = opChatEndpointUrl(options.apiBaseUrl, "chat/completions");
479
+ const response = await fetch(requestUrl, {
470
480
  method: "POST",
471
- headers: opChatHeaders(options.token, "text/event-stream", options.requestId),
472
- body: JSON.stringify(buildOpChatBody(options)),
481
+ headers: opChatHeaders(requestUrl, options.token, "application/json", options.requestId),
482
+ // Hosted turns are published only after the provider finishes. Requesting
483
+ // the complete response also preserves whitespace that some upstream
484
+ // token streams omit at chunk boundaries.
485
+ body: JSON.stringify(buildOpChatBody(options, false)),
473
486
  signal: options.signal
474
487
  });
475
- if (!response.ok || !response.body) {
476
- throw new Error(`OpenPond OpChat stream failed: ${response.status} ${await readOpChatError(response)}`);
488
+ if (!response.ok) {
489
+ throw new Error(`OpenPond OpChat request failed: ${response.status} ${await readOpChatError(response)}`);
477
490
  }
478
- let reasoningText = "";
479
- let hasToolCalls = false;
480
- let pendingFinish = null;
481
- let latestRaw = null;
482
- for await (const raw of parseOpChatSse(response.body, options.signal)) {
483
- latestRaw = raw;
484
- if (raw && typeof raw === "object" && "error" in raw) {
485
- throw new Error(`OpenPond OpChat stream failed: ${errorMessageFromPayload(raw)}`);
486
- }
487
- const usage = parseUsage(raw);
488
- if (usage)
489
- yield { type: "usage", usage, raw };
490
- for (const delta of streamDeltasFromChunk(raw)) {
491
- if (delta.type === "reasoning_delta")
492
- reasoningText += delta.text;
493
- if (delta.type === "tool_call_delta")
494
- hasToolCalls = true;
495
- if (delta.type === "finish")
496
- pendingFinish = delta;
497
- else
498
- yield delta;
499
- }
491
+ const raw = await response.json();
492
+ if (raw && typeof raw === "object" && "error" in raw) {
493
+ throw new Error(`OpenPond OpChat request failed: ${errorMessageFromPayload(raw)}`);
494
+ }
495
+ const record = raw && typeof raw === "object" ? raw : {};
496
+ const choices = Array.isArray(record.choices) ? record.choices : [];
497
+ const choice = choices[0] && typeof choices[0] === "object" ? choices[0] : {};
498
+ const message = choice.message && typeof choice.message === "object" ? choice.message : {};
499
+ const reasoningText = streamTextValue(message.reasoning_content);
500
+ const content = streamTextValue(message.content);
501
+ const toolCalls = parseToolCalls(message.tool_calls);
502
+ const usage = parseUsage(raw);
503
+ if (reasoningText)
504
+ yield { type: "reasoning_delta", text: reasoningText, raw };
505
+ if (content)
506
+ yield { type: "text_delta", text: content, raw };
507
+ if (toolCalls.length > 0) {
508
+ yield { type: "tool_call_delta", toolCalls, raw };
500
509
  }
501
- if (hasToolCalls && reasoningText) {
510
+ if (toolCalls.length > 0 && reasoningText) {
502
511
  yield {
503
512
  type: "continuation",
504
513
  continuation: {
505
514
  kind: "chat_completions_reasoning",
506
515
  reasoningContent: reasoningText
507
516
  },
508
- raw: latestRaw
517
+ raw
509
518
  };
510
519
  }
511
- if (pendingFinish)
512
- yield pendingFinish;
520
+ if (usage)
521
+ yield { type: "usage", usage, raw };
522
+ yield {
523
+ type: "finish",
524
+ finishReason: stringValue(choice.finish_reason),
525
+ raw
526
+ };
513
527
  }
514
- function buildOpChatBody(options) {
528
+ function buildOpChatBody(options, stream) {
515
529
  const body = {
516
530
  model: options.model,
517
531
  messages: options.messages.map(opChatMessage),
518
- stream: true
532
+ stream
519
533
  };
520
534
  if (options.tools) {
521
535
  body.tools = options.tools;
@@ -523,8 +537,23 @@ function buildOpChatBody(options) {
523
537
  if (options.toolChoice !== void 0) {
524
538
  body.tool_choice = options.toolChoice;
525
539
  }
540
+ if (typeof options.maxTokens === "number") {
541
+ body.max_tokens = options.maxTokens;
542
+ }
543
+ Object.assign(body, opChatReasoningFields(options.reasoningEffort));
526
544
  return body;
527
545
  }
546
+ function opChatReasoningFields(effort) {
547
+ if (!effort)
548
+ return {};
549
+ if (effort === "low") {
550
+ return { thinking: { type: "disabled" } };
551
+ }
552
+ return {
553
+ thinking: { type: "enabled" },
554
+ reasoning_effort: effort === "xhigh" ? "max" : "high"
555
+ };
556
+ }
528
557
  function opChatMessage(message) {
529
558
  const { continuation, ...projected } = message;
530
559
  if (message.role === "assistant" && continuation?.kind === "chat_completions_reasoning") {
@@ -541,7 +570,7 @@ function opChatEndpointUrl(apiBaseUrl, path) {
541
570
  throw new Error("OpenPond OpChat API base URL is required.");
542
571
  return `${normalized}/${path}`;
543
572
  }
544
- function opChatHeaders(token, accept, requestId) {
573
+ function opChatHeaders(requestUrl, token, accept, requestId) {
545
574
  const trimmed = token.trim();
546
575
  if (!trimmed)
547
576
  throw new Error("OpenPond API key is required for OpChat.");
@@ -551,7 +580,7 @@ function opChatHeaders(token, accept, requestId) {
551
580
  headers.set("Accept", accept);
552
581
  headers.set("x-openpond-client", "openpond-app");
553
582
  headers.set("x-openpond-request-id", requestId || randomUUID());
554
- return headers;
583
+ return withVercelProtectionBypass(requestUrl, headers);
555
584
  }
556
585
  async function readOpChatError(response) {
557
586
  const text = await response.text().catch(() => "");
@@ -578,72 +607,6 @@ function errorMessageFromPayload(payload) {
578
607
  }
579
608
  return [stringValue(record.error), stringValue(record.message)].filter(Boolean).join(": ") || JSON.stringify(payload);
580
609
  }
581
- async function* parseOpChatSse(stream, signal) {
582
- const reader = stream.getReader();
583
- const decoder = new TextDecoder();
584
- let buffer = "";
585
- const abortError = () => signal?.reason instanceof Error ? signal.reason : new Error("openpond_opchat_aborted");
586
- try {
587
- while (true) {
588
- if (signal?.aborted)
589
- throw abortError();
590
- const result = await reader.read();
591
- if (result.done)
592
- break;
593
- buffer += decoder.decode(result.value, { stream: true });
594
- const blocks = buffer.split(/\r?\n\r?\n/);
595
- buffer = blocks.pop() ?? "";
596
- for (const block of blocks) {
597
- for (const payload of parseSseBlock(block))
598
- yield payload;
599
- }
600
- }
601
- } finally {
602
- reader.releaseLock();
603
- }
604
- buffer += decoder.decode();
605
- if (buffer.trim()) {
606
- for (const payload of parseSseBlock(buffer))
607
- yield payload;
608
- }
609
- }
610
- function parseSseBlock(block) {
611
- const data = block.split(/\r?\n/).filter((line) => line.startsWith("data:")).map((line) => line.slice(5).trim()).join("\n").trim();
612
- if (!data || data === "[DONE]")
613
- return [];
614
- return [JSON.parse(data)];
615
- }
616
- function streamDeltasFromChunk(raw) {
617
- if (!raw || typeof raw !== "object")
618
- return [];
619
- const record = raw;
620
- const choices = Array.isArray(record.choices) ? record.choices : [];
621
- const deltas = [];
622
- for (const choice of choices) {
623
- if (!choice || typeof choice !== "object")
624
- continue;
625
- const choiceRecord = choice;
626
- const delta = choiceRecord.delta && typeof choiceRecord.delta === "object" ? choiceRecord.delta : {};
627
- for (const key of ["content", "reasoning_content"]) {
628
- const value = stringValue(delta[key]);
629
- if (!value)
630
- continue;
631
- deltas.push({
632
- type: key === "content" ? "text_delta" : "reasoning_delta",
633
- text: value,
634
- raw
635
- });
636
- }
637
- const toolCalls = parseToolCalls(delta.tool_calls);
638
- if (toolCalls.length > 0) {
639
- deltas.push({ type: "tool_call_delta", toolCalls, raw });
640
- }
641
- const finishReason = stringValue(choiceRecord.finish_reason);
642
- if (finishReason)
643
- deltas.push({ type: "finish", finishReason, raw });
644
- }
645
- return deltas;
646
- }
647
610
  function parseToolCalls(value) {
648
611
  return Array.isArray(value) ? value.filter((item) => Boolean(item) && typeof item === "object") : [];
649
612
  }
@@ -658,6 +621,9 @@ function parseUsage(raw) {
658
621
  function stringValue(value) {
659
622
  return typeof value === "string" && value.trim() ? value : null;
660
623
  }
624
+ function streamTextValue(value) {
625
+ return typeof value === "string" && value.length > 0 ? value : null;
626
+ }
661
627
 
662
628
  // ../../packages/runtime/dist/version.js
663
629
  import { readFileSync as readFileSync2 } from "node:fs";
@@ -837,71 +803,76 @@ async function loadAccountProfileLookups(context) {
837
803
  const key = profileKey(account.handle, account.baseUrl);
838
804
  const token = accountToken(account);
839
805
  if (!token) {
840
- return [key, { response: null, authFailed: false }];
806
+ return [
807
+ key,
808
+ { response: null, authFailed: false, error: null }
809
+ ];
841
810
  }
842
811
  try {
843
812
  return [
844
813
  key,
845
814
  {
846
815
  response: await getOpenPondAccount(resolvePublicApiBaseUrl(account, context.config), token),
847
- authFailed: false
816
+ authFailed: false,
817
+ error: null
818
+ }
819
+ ];
820
+ } catch (error) {
821
+ return [
822
+ key,
823
+ {
824
+ response: null,
825
+ authFailed: true,
826
+ error: errorMessage(error)
848
827
  }
849
828
  ];
850
- } catch {
851
- return [key, { response: null, authFailed: true }];
852
829
  }
853
830
  }));
854
831
  return Object.fromEntries(entries);
855
832
  }
833
+ async function loadOpenPondAccountStateForContext(context) {
834
+ const accountProfiles = await loadAccountProfileLookups(context);
835
+ const activeLookup = context.account ? accountProfiles[profileKey(context.account.handle, context.account.baseUrl)] ?? null : null;
836
+ const accountResponse = activeLookup?.response ?? null;
837
+ const authError = context.token && activeLookup?.authFailed ? activeLookup.error || "OpenPond account authentication failed." : null;
838
+ return {
839
+ account: toAccountState({
840
+ ...context,
841
+ accountResponse,
842
+ accountProfiles,
843
+ authFailed: Boolean(authError),
844
+ error: authError
845
+ })
846
+ };
847
+ }
848
+ async function loadOpenPondAccountState() {
849
+ return loadOpenPondAccountStateForContext(await loadOpenPondAccountContext());
850
+ }
856
851
  async function loadOpenPondApps(options = {}) {
857
852
  const context = await loadOpenPondAccountContext();
853
+ const accountPromise = loadOpenPondAccountStateForContext(context);
858
854
  if (!context.token) {
859
- const accountProfiles2 = await loadAccountProfileLookups(context);
860
855
  return {
861
- account: toAccountState({ ...context, accountProfiles: accountProfiles2 }),
856
+ ...await accountPromise,
862
857
  apps: [],
863
858
  error: "No OpenPond API key or session token is configured."
864
859
  };
865
860
  }
866
- const [healthResult, accountResult, appsResult, accountProfilesResult] = await Promise.allSettled([
867
- checkOpenPondApiHealth(context.apiBaseUrl, context.token),
868
- getOpenPondAccount(context.apiBaseUrl, context.token),
861
+ const [accountResult, appsResult] = await Promise.allSettled([
862
+ accountPromise,
869
863
  listApps(context.apiBaseUrl, context.token, {
870
864
  handle: context.account?.handle,
871
865
  limit: options.limit ?? 20,
872
866
  offset: options.offset ?? 0,
873
867
  includeScheduled: options.includeScheduled ?? true
874
- }),
875
- loadAccountProfileLookups(context)
868
+ })
876
869
  ]);
877
- const health = healthResult.status === "fulfilled" ? healthResult.value : null;
878
- const accountResponse = accountResult.status === "fulfilled" ? accountResult.value : null;
879
- const accountProfiles = accountProfilesResult.status === "fulfilled" ? accountProfilesResult.value : {};
880
- if (accountResult.status === "fulfilled" && context.account) {
881
- accountProfiles[profileKey(context.account.handle, context.account.baseUrl)] = {
882
- response: accountResult.value,
883
- authFailed: false
884
- };
885
- }
886
- const appsSucceeded = appsResult.status === "fulfilled";
887
- const accountSucceeded = accountResult.status === "fulfilled";
888
- const anyAuthenticatedCallSucceeded = appsSucceeded || accountSucceeded || health?.authenticated === true;
889
- const allAuthenticatedCallsFailed = !appsSucceeded && !accountSucceeded && health?.authenticated !== true;
890
- const authError = health?.authenticated === false && !anyAuthenticatedCallSucceeded ? health.error || "OpenPond account authentication failed." : allAuthenticatedCallsFailed ? appsResult.status === "rejected" ? errorMessage(appsResult.reason) : accountResult.status === "rejected" ? errorMessage(accountResult.reason) : null : null;
891
- const profileError = accountResult.status === "rejected" && anyAuthenticatedCallSucceeded ? `Profile unavailable: ${errorMessage(accountResult.reason)}` : null;
892
- const appsError = appsResult.status === "rejected" ? errorMessage(appsResult.reason) : null;
893
- const effectiveHealth = health && anyAuthenticatedCallSucceeded ? { ...health, authenticated: true, error: void 0 } : health;
870
+ if (accountResult.status === "rejected")
871
+ throw accountResult.reason;
894
872
  return {
895
- account: toAccountState({
896
- ...context,
897
- accountResponse,
898
- accountProfiles,
899
- health: effectiveHealth,
900
- authFailed: Boolean(authError),
901
- error: authError ?? profileError
902
- }),
873
+ account: accountResult.value.account,
903
874
  apps: appsResult.status === "fulfilled" ? appsResult.value.map(normalizeApp).filter((value) => Boolean(value)) : [],
904
- error: appsError
875
+ error: appsResult.status === "rejected" ? errorMessage(appsResult.reason) : null
905
876
  };
906
877
  }
907
878
  async function createOpenPondRepoApp(input) {
@@ -939,20 +910,6 @@ async function deriveHandleForApiKey(input, apiBaseUrl) {
939
910
  return fromProfile;
940
911
  } catch {
941
912
  }
942
- try {
943
- const apps = await listApps(apiBaseUrl, input.apiKey);
944
- const counts = /* @__PURE__ */ new Map();
945
- for (const app of apps) {
946
- const handle2 = normalizeDerivedHandle(app.handle);
947
- if (!handle2)
948
- continue;
949
- counts.set(handle2, (counts.get(handle2) ?? 0) + 1);
950
- }
951
- const [handle] = Array.from(counts.entries()).sort((left, right) => right[1] - left[1])[0] ?? [];
952
- if (handle)
953
- return handle;
954
- } catch {
955
- }
956
913
  return fallbackHandleForApiKey(input.apiKey);
957
914
  }
958
915
  async function saveOpenPondAccount(input) {
@@ -972,8 +929,41 @@ async function saveOpenPondAccount(input) {
972
929
  return loadOpenPondAccountContext(handle, baseUrl);
973
930
  }
974
931
 
932
+ // ../../packages/runtime/dist/remove-account.js
933
+ function findAccountIndex(accounts, handle, baseUrl) {
934
+ const normalizedBaseUrl = normalizeBaseUrl(baseUrl);
935
+ const exactIndex = accounts.findIndex((account) => handleEquals(account.handle, handle) && baseUrlEquals(account.baseUrl, normalizedBaseUrl));
936
+ if (exactIndex !== -1)
937
+ return exactIndex;
938
+ const matchingIndexes = accounts.map((account, index) => ({ account, index })).filter(({ account }) => handleEquals(account.handle, handle));
939
+ if (matchingIndexes.length === 1)
940
+ return matchingIndexes[0].index;
941
+ if (matchingIndexes.length > 1) {
942
+ throw new Error(`Multiple OpenPond accounts match ${handle}; select one with its base URL.`);
943
+ }
944
+ return -1;
945
+ }
946
+ async function removeOpenPondAccount(input) {
947
+ const handle = input.handle.trim();
948
+ if (!handle)
949
+ throw new Error("OpenPond account handle is required.");
950
+ const config = await loadGlobalConfig();
951
+ const accounts = (config.accounts ?? []).map((account2) => ({ ...account2 }));
952
+ const index = findAccountIndex(accounts, handle, input.baseUrl);
953
+ if (index === -1)
954
+ throw new Error(`OpenPond account not found: ${handle}`);
955
+ const account = accounts[index];
956
+ const activeProfile = normalizeActiveProfile(config.activeProfile);
957
+ if (activeProfile && accountMatchesSelector(account, activeProfile)) {
958
+ throw new Error("Switch to another OpenPond account before removing the active account.");
959
+ }
960
+ accounts.splice(index, 1);
961
+ await saveConfig({ ...config, accounts });
962
+ return loadOpenPondAccountContext();
963
+ }
964
+
975
965
  // ../../packages/runtime/dist/update-account-config.js
976
- function findAccountIndex(accounts, handle, currentBaseUrl) {
966
+ function findAccountIndex2(accounts, handle, currentBaseUrl) {
977
967
  const normalizedCurrentBaseUrl = normalizeBaseUrl(currentBaseUrl);
978
968
  const exactIndex = accounts.findIndex((account) => handleEquals(account.handle, handle) && baseUrlEquals(account.baseUrl, normalizedCurrentBaseUrl));
979
969
  if (exactIndex !== -1)
@@ -1003,7 +993,7 @@ async function updateOpenPondAccountConfig(input) {
1003
993
  throw new Error("OpenPond account handle is required.");
1004
994
  const config = await loadGlobalConfig();
1005
995
  const accounts = (config.accounts ?? []).map((account) => ({ ...account }));
1006
- const index = findAccountIndex(accounts, handle, input.currentBaseUrl);
996
+ const index = findAccountIndex2(accounts, handle, input.currentBaseUrl);
1007
997
  if (index === -1)
1008
998
  throw new Error(`OpenPond account not found: ${handle}`);
1009
999
  const previousAccount = accounts[index];
@@ -1082,11 +1072,13 @@ function nextLineEnd(value) {
1082
1072
  export {
1083
1073
  loadOpenPondAccountContext,
1084
1074
  switchOpenPondAccount,
1075
+ loadOpenPondAccountState,
1085
1076
  loadOpenPondApps,
1086
1077
  createOpenPondRepoApp,
1087
1078
  loadOpenPondProviderCatalog,
1088
1079
  streamOpenPondHostedChatTurn,
1089
1080
  saveOpenPondAccount,
1081
+ removeOpenPondAccount,
1090
1082
  updateOpenPondAccountConfig,
1091
1083
  getOpenPondAppEnvironment,
1092
1084
  getBundledRuntimeVersion,
@@ -1,15 +1,19 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
2
  import {
3
3
  resolveWebLaunchMessages,
4
+ runOpenPondAppServerCli,
4
5
  runOpenPondServerCli
5
- } from "./chunk-YTJL6XPU.js";
6
- import "./chunk-HS2AGRDV.js";
7
- import "./chunk-QRM7XMAO.js";
8
- import "./chunk-LZZM3IHS.js";
9
- import "./chunk-XEJ7XXUQ.js";
6
+ } from "./chunk-75ZLFVFZ.js";
7
+ import "./chunk-VCVQLECH.js";
8
+ import "./chunk-ZTE6A2VE.js";
9
+ import "./chunk-CZG4XKVF.js";
10
+ import "./chunk-2SF6HLT7.js";
11
+ import "./chunk-M2NXTLH2.js";
10
12
  import "./chunk-WYDVQOBL.js";
13
+ import "./chunk-KHNHUA2H.js";
11
14
  import "./chunk-UACZUFIA.js";
12
15
  export {
13
16
  resolveWebLaunchMessages,
17
+ runOpenPondAppServerCli,
14
18
  runOpenPondServerCli
15
19
  };
@@ -16,11 +16,13 @@ import {
16
16
  runTemplateUpdate,
17
17
  runToolList,
18
18
  runToolRun
19
- } from "./chunk-AHPQTEIJ.js";
20
- import "./chunk-275WCETC.js";
21
- import "./chunk-GDZYDLEL.js";
22
- import "./chunk-XCATKTK3.js";
23
- import "./chunk-ZI4GDAUB.js";
19
+ } from "./chunk-MCBAI5M5.js";
20
+ import "./chunk-FCVVOMIP.js";
21
+ import "./chunk-KHNHUA2H.js";
22
+ import "./chunk-KSOI7GFA.js";
23
+ import "./chunk-SMNFI2FU.js";
24
+ import "./chunk-QHUJ2XVJ.js";
25
+ import "./chunk-DBHSOTYZ.js";
24
26
  import "./chunk-KSRWKXRB.js";
25
27
  import "./chunk-MUMPWI4O.js";
26
28
  import "./chunk-UACZUFIA.js";
@@ -1,12 +1,14 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
2
  import {
3
3
  runProcessCommand
4
- } from "./chunk-275WCETC.js";
4
+ } from "./chunk-FCVVOMIP.js";
5
+ import "./chunk-KHNHUA2H.js";
5
6
  import {
6
7
  CliUsageError
7
- } from "./chunk-GDZYDLEL.js";
8
- import "./chunk-XCATKTK3.js";
9
- import "./chunk-ZI4GDAUB.js";
8
+ } from "./chunk-KSOI7GFA.js";
9
+ import "./chunk-SMNFI2FU.js";
10
+ import "./chunk-QHUJ2XVJ.js";
11
+ import "./chunk-DBHSOTYZ.js";
10
12
  import "./chunk-KSRWKXRB.js";
11
13
  import {
12
14
  optionString,
@@ -14,13 +16,13 @@ import {
14
16
  } from "./chunk-MUMPWI4O.js";
15
17
  import "./chunk-UACZUFIA.js";
16
18
 
17
- // src/cli/harness.ts
19
+ // src/cli/desktop-test.ts
18
20
  import path from "node:path";
19
21
  import { access } from "node:fs/promises";
20
22
  import { constants } from "node:fs";
21
23
  import { createRequire } from "node:module";
22
24
  var DESKTOP_HARNESS_SCRIPT = path.join("scripts", "desktop-harness.ts");
23
- async function runHarnessCommand(options, rest) {
25
+ async function runDesktopTestCommand(options, rest) {
24
26
  const invocation = await buildDesktopHarnessInvocation({ options, rest });
25
27
  const result = await runProcessCommand(invocation.command, invocation.args, {
26
28
  cwd: invocation.cwd,
@@ -34,14 +36,13 @@ async function runHarnessCommand(options, rest) {
34
36
  async function buildDesktopHarnessInvocation(input) {
35
37
  const options = input.options;
36
38
  const rest = input.rest;
37
- const surface = rest[0];
38
- const action = rest[1];
39
- if (surface !== "desktop" || action !== "run" && action !== "attach") {
39
+ const action = rest[0];
40
+ if (action !== "run" && action !== "attach") {
40
41
  throw new CliUsageError(desktopHarnessCliUsage());
41
42
  }
42
- const scenarios = rest.slice(2);
43
+ const scenarios = rest.slice(1);
43
44
  if (scenarios.length === 0) {
44
- throw new CliUsageError("usage: openpond harness desktop run <scenario...> [options]");
45
+ throw new CliUsageError("usage: openpond desktop-test run <scenario...> [options]");
45
46
  }
46
47
  const startCwd = optionString(options, "cwd") || input.cwd || process.cwd();
47
48
  const repoRoot = await resolveDesktopHarnessRepoRoot(startCwd);
@@ -118,8 +119,8 @@ async function fileExists(filePath) {
118
119
  }
119
120
  function desktopHarnessCliUsage() {
120
121
  return [
121
- "usage: openpond harness desktop run <scenario...> [options]",
122
- " openpond harness desktop attach <scenario...> [options]",
122
+ "usage: openpond desktop-test run <scenario...> [options]",
123
+ " openpond desktop-test attach <scenario...> [options]",
123
124
  "",
124
125
  "Options include --isolated, --attach, --packaged, --none, --app <path>,",
125
126
  "--server <url>, --token <token>, --token-file <path>, --devtools-port <port>, --artifacts-dir <path>,",
@@ -139,5 +140,5 @@ var HarnessCommandFailedError = class extends Error {
139
140
  export {
140
141
  buildDesktopHarnessInvocation,
141
142
  resolveDesktopHarnessRepoRoot,
142
- runHarnessCommand
143
+ runDesktopTestCommand
143
144
  };