openpond 0.0.38 → 0.0.39

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-LTBWNA2F.js} +32 -10
  5. package/dist/chunks/app-server-runtime-VYYJ2AWX.js +18 -0
  6. package/dist/chunks/{apps-AKBI6AS7.js → apps-CZAJBGE3.js} +6 -4
  7. package/dist/chunks/{chunk-LZZM3IHS.js → chunk-2SF6HLT7.js} +5899 -5939
  8. package/dist/chunks/{chunk-XCATKTK3.js → chunk-3CDPPVLE.js} +108 -66
  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-4HIWFIMN.js +37172 -0
  12. package/dist/chunks/{chunk-AHPQTEIJ.js → chunk-4N6E3OVF.js} +4 -4
  13. package/dist/chunks/{chunk-YTJL6XPU.js → chunk-6V7MJVRO.js} +56 -11
  14. package/dist/chunks/{chunk-QRM7XMAO.js → chunk-BQQZNGI6.js} +152 -161
  15. package/dist/chunks/chunk-DBHSOTYZ.js +1552 -0
  16. package/dist/chunks/{chunk-275WCETC.js → chunk-FCVVOMIP.js} +145 -5
  17. package/dist/chunks/{chunk-GB6VUZUA.js → chunk-JIEUB6OS.js} +1 -1
  18. package/dist/chunks/{chunk-HS2AGRDV.js → chunk-JJPAMKXZ.js} +1 -1
  19. package/dist/chunks/{chunk-GDZYDLEL.js → chunk-JRROTGQT.js} +1 -110
  20. package/dist/chunks/chunk-KHNHUA2H.js +1737 -0
  21. package/dist/chunks/{chunk-AHNFNWUN.js → chunk-L6XH4ZGZ.js} +1 -1
  22. package/dist/chunks/chunk-M2NXTLH2.js +4054 -0
  23. package/dist/chunks/{chunk-SLMP353Q.js → chunk-MIZHCABO.js} +2 -195
  24. package/dist/chunks/chunk-SMNFI2FU.js +113 -0
  25. package/dist/chunks/chunk-VCVQLECH.js +675 -0
  26. package/dist/chunks/{chunk-V35STJF4.js → chunk-ZJBJQCQZ.js} +179 -52
  27. package/dist/chunks/{cli-7BKDWFNU.js → cli-JS76LCW2.js} +9 -5
  28. package/dist/chunks/{core-commands-YN4RMWA3.js → core-commands-4MRJQZJV.js} +7 -5
  29. package/dist/chunks/{harness-BHQRMXJR.js → desktop-test-RNMWLOVU.js} +15 -14
  30. package/dist/chunks/{chunk-XERQHYBO.js → extension-GDRW22N3.js} +5868 -3580
  31. package/dist/chunks/{help-VREQNA4I.js → help-LWNREJ7U.js} +1 -1
  32. package/dist/chunks/{opchat-D63YTNSX.js → opchat-2K2JIGK3.js} +9 -10
  33. package/dist/chunks/{organizations-I46KG7TC.js → organizations-Z5HVD2E7.js} +11 -9
  34. package/dist/chunks/{profile-WKZJHEPG.js → profile-QNECVVGN.js} +12 -38
  35. package/dist/chunks/{project-agent-ZUC3YMCT.js → project-agent-W3V75WBR.js} +9 -411
  36. package/dist/chunks/{sandbox-command-AAOPFTI5.js → sandbox-command-X3FO74NX.js} +7 -5
  37. package/dist/chunks/{sandbox-template-GKNVR4C5.js → sandbox-template-5B4T4BGU.js} +8 -6
  38. package/dist/chunks/{src-RPW5TOPI.js → src-ESAILPUH.js} +32 -30
  39. package/dist/chunks/src-IC5RX4L6.js +63517 -0
  40. package/dist/chunks/{teams-bot-PSL3ZO6Z.js → teams-bot-NTQ6VFFL.js} +6 -4
  41. package/dist/chunks/training-BR5A7SPU.js +320 -0
  42. package/dist/chunks/{workspaces-BPXC2DHT.js → workspaces-XC3QBD2Y.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
@@ -87,6 +87,7 @@ var json = "json";
87
87
  var number = "number";
88
88
  var string = "string";
89
89
  var CHAT_OPTION_SCHEMA = {
90
+ agent: string,
90
91
  approvalPolicy: string,
91
92
  cwd: string,
92
93
  json: boolean,
@@ -98,6 +99,7 @@ var CHAT_OPTION_SCHEMA = {
98
99
  nonInteractive: boolean,
99
100
  project: string,
100
101
  provider: string,
102
+ resume: string,
101
103
  sandbox: string,
102
104
  server: string,
103
105
  stdin: boolean,
@@ -135,6 +137,8 @@ var SANDBOX_OPTION_SCHEMA = {
135
137
  dockerfileContext: string,
136
138
  dockerfileTarget: string,
137
139
  domain: string,
140
+ env: string,
141
+ environment: string,
138
142
  envLiteral: string,
139
143
  envName: string,
140
144
  envRef: string,
@@ -351,7 +355,6 @@ var AGENT_OPTION_SCHEMA = {
351
355
  targetProjectId: string,
352
356
  teamId: string,
353
357
  triggerType: string,
354
- workItemId: string,
355
358
  workflowMode: string
356
359
  };
357
360
 
@@ -394,7 +397,7 @@ var CLI_COMMAND_REGISTRY = [
394
397
  name: "help",
395
398
  usage: "openpond help",
396
399
  optionSchema: {},
397
- handler: async () => (await import("./help-VREQNA4I.js")).printHelp()
400
+ handler: async () => (await import("./help-LWNREJ7U.js")).printHelp()
398
401
  },
399
402
  {
400
403
  name: "version",
@@ -406,19 +409,19 @@ var CLI_COMMAND_REGISTRY = [
406
409
  name: "check-update",
407
410
  usage: "openpond check-update",
408
411
  optionSchema: {},
409
- handler: async () => (await import("./core-commands-YN4RMWA3.js")).runCheckUpdate()
412
+ handler: async () => (await import("./core-commands-4MRJQZJV.js")).runCheckUpdate()
410
413
  },
411
414
  {
412
415
  name: "login",
413
416
  usage: "openpond login [--base-url <url>]",
414
417
  optionSchema: CLI_GLOBAL_OPTION_SCHEMA,
415
- handler: async ({ options }) => (await import("./core-commands-YN4RMWA3.js")).runLogin(options)
418
+ handler: async ({ options }) => (await import("./core-commands-4MRJQZJV.js")).runLogin(options)
416
419
  },
417
420
  {
418
421
  name: "init",
419
422
  usage: "openpond init [--path <dir>]",
420
423
  optionSchema: { path: "string" },
421
- handler: async ({ options }) => (await import("./profile-WKZJHEPG.js")).runOpenPondInitCommand(options)
424
+ handler: async ({ options }) => (await import("./profile-QNECVVGN.js")).runOpenPondInitCommand(options)
422
425
  },
423
426
  {
424
427
  name: "profile",
@@ -444,30 +447,17 @@ var CLI_COMMAND_REGISTRY = [
444
447
  kind: "string",
445
448
  path: "string",
446
449
  publishHostedSource: "boolean",
447
- teamId: "string",
448
- workItemId: "string"
450
+ teamId: "string"
449
451
  },
450
- handler: async ({ options, rest }) => (await import("./profile-WKZJHEPG.js")).runOpenPondProfileCommand(options, rest)
452
+ handler: async ({ options, rest }) => (await import("./profile-QNECVVGN.js")).runOpenPondProfileCommand(options, rest)
451
453
  },
452
454
  {
453
455
  name: "agents",
454
456
  usage: "openpond agents [--json]",
455
457
  optionSchema: { json: "boolean" },
456
- handler: async ({ options, rest }) => (await import("./profile-WKZJHEPG.js")).runOpenPondAgentsCommand(options, rest)
458
+ handler: async ({ options, rest }) => (await import("./profile-QNECVVGN.js")).runOpenPondAgentsCommand(options, rest)
457
459
  },
458
460
  ...profileSdkAliasDefinitions(),
459
- {
460
- name: "extend",
461
- usage: "openpond extend <instructions>",
462
- optionSchema: { cwd: "string" },
463
- handler: async ({ options, rest }) => (await import("./extend-REGNTBK3.js")).runOpenPondExtendCommand(options, rest)
464
- },
465
- {
466
- name: "edit",
467
- usage: "openpond edit <instructions>",
468
- optionSchema: { cwd: "string" },
469
- handler: async ({ options, rest }) => (await import("./extend-REGNTBK3.js")).runOpenPondEditCommand(options, rest)
470
- },
471
461
  {
472
462
  name: "extension",
473
463
  usage: "openpond extension <add|preview|list|inspect|update|remove> [owner/repo]",
@@ -478,25 +468,33 @@ var CLI_COMMAND_REGISTRY = [
478
468
  "openpond extension remove <owner/repo> [--json]"
479
469
  ],
480
470
  optionSchema: { all: "boolean", json: "boolean", ref: "string" },
481
- handler: async ({ options, rest }) => (await import("./extension-7K77DAVL.js")).runOpenPondExtensionCommand(options, rest)
471
+ handler: async ({ options, rest }) => (await import("./extension-GDRW22N3.js")).runOpenPondExtensionCommand(options, rest)
482
472
  },
483
473
  {
484
474
  name: "profiles",
485
475
  usage: "openpond profiles [args]",
486
476
  optionSchema: { json: "boolean" },
487
- handler: async ({ options, rest }) => (await import("./core-commands-YN4RMWA3.js")).runProfiles(options, rest)
477
+ handler: async ({ options, rest }) => (await import("./core-commands-4MRJQZJV.js")).runProfiles(options, rest)
488
478
  },
489
479
  {
490
480
  name: "account",
491
481
  usage: "openpond account",
492
482
  optionSchema: { json: "boolean" },
493
- handler: async () => (await import("./core-commands-YN4RMWA3.js")).runAccount()
483
+ handler: async () => (await import("./core-commands-4MRJQZJV.js")).runAccount()
494
484
  },
495
485
  {
496
486
  name: "health",
497
487
  usage: "openpond health",
498
488
  optionSchema: { json: "boolean" },
499
- handler: async ({ options }) => (await import("./core-commands-YN4RMWA3.js")).runHealth(options)
489
+ handler: async ({ options }) => (await import("./core-commands-4MRJQZJV.js")).runHealth(options)
490
+ },
491
+ {
492
+ name: "app-server",
493
+ usage: "openpond app-server [--store-dir DIR]",
494
+ optionSchema: {
495
+ storeDir: "string"
496
+ },
497
+ handler: async ({ options, rest }) => (await import("./app-layer-LTBWNA2F.js")).runOpenPondServerCommand("app-server", options, rest)
500
498
  },
501
499
  {
502
500
  name: "serve",
@@ -507,7 +505,7 @@ var CLI_COMMAND_REGISTRY = [
507
505
  listen: "string",
508
506
  port: "integer"
509
507
  },
510
- handler: async ({ options, rest }) => (await import("./app-layer-DPUJRNO2.js")).runOpenPondServerCommand("serve", options, rest)
508
+ handler: async ({ options, rest }) => (await import("./app-layer-LTBWNA2F.js")).runOpenPondServerCommand("serve", options, rest)
511
509
  },
512
510
  {
513
511
  name: "ui",
@@ -520,7 +518,7 @@ var CLI_COMMAND_REGISTRY = [
520
518
  port: "integer",
521
519
  webRoot: "string"
522
520
  },
523
- handler: async ({ options, rest }) => (await import("./app-layer-DPUJRNO2.js")).runOpenPondServerCommand("web", options, rest)
521
+ handler: async ({ options, rest }) => (await import("./app-layer-LTBWNA2F.js")).runOpenPondServerCommand("web", options, rest)
524
522
  },
525
523
  {
526
524
  name: "tui",
@@ -534,13 +532,13 @@ var CLI_COMMAND_REGISTRY = [
534
532
  provider: "string",
535
533
  server: "string"
536
534
  },
537
- handler: async ({ options, rest }) => (await import("./app-layer-DPUJRNO2.js")).runOpenPondTerminalCommand(options, rest)
535
+ handler: async ({ options, rest }) => (await import("./app-layer-LTBWNA2F.js")).runOpenPondTerminalCommand(options, rest)
538
536
  },
539
537
  {
540
538
  name: "chat",
541
- usage: "openpond chat (--message-file <path>|--message <text>|--stdin) --non-interactive [--provider <id>] [--model <id>] [--project <id>] [--yes] [--approval-policy <policy>] [--json] [--timeout-sec <n>] [--max-output-bytes <n>] [--sandbox <mode>]",
539
+ usage: "openpond chat (--message-file <path>|--message <text>|--stdin) --non-interactive [--provider <id>] [--model <id>] [--agent <id>] [--project <id>] [--resume <session-id>] [--yes] [--approval-policy <policy>] [--json] [--timeout-sec <n>] [--max-output-bytes <n>] [--sandbox <mode>]",
542
540
  optionSchema: CHAT_OPTION_SCHEMA,
543
- handler: async ({ options, rest }) => (await import("./app-layer-DPUJRNO2.js")).runOpenPondTerminalCommand(options, rest)
541
+ handler: async ({ options, rest }) => (await import("./app-layer-LTBWNA2F.js")).runOpenPondTerminalCommand(options, rest)
544
542
  },
545
543
  {
546
544
  name: "tool",
@@ -576,7 +574,7 @@ var CLI_COMMAND_REGISTRY = [
576
574
  name: "sandbox-template",
577
575
  usage: "openpond sandbox-template <command> [args]",
578
576
  optionSchema: SANDBOX_TEMPLATE_OPTION_SCHEMA,
579
- handler: async ({ options, rest }) => (await import("./sandbox-template-GKNVR4C5.js")).runSandboxTemplateCommand(options, rest)
577
+ handler: async ({ options, rest }) => (await import("./sandbox-template-5B4T4BGU.js")).runSandboxTemplateCommand(options, rest)
580
578
  },
581
579
  {
582
580
  name: "repo",
@@ -593,47 +591,57 @@ var CLI_COMMAND_REGISTRY = [
593
591
  aliases: ["organization"],
594
592
  usage: "openpond organizations <login|list|use|logout|whoami> [args]",
595
593
  optionSchema: {
594
+ accessToken: "string",
595
+ arguments: "json",
596
596
  callbackPort: "integer",
597
+ clientId: "string",
598
+ customDomain: "string",
599
+ displayName: "string",
600
+ email: "string",
601
+ env: "string",
602
+ environment: "string",
597
603
  json: "boolean",
604
+ name: "string",
598
605
  open: "boolean",
599
- timeoutSeconds: "integer"
606
+ origin: "string",
607
+ primaryContactEmail: "string",
608
+ printToken: "boolean",
609
+ resourceUrl: "string",
610
+ role: "string",
611
+ scope: "string",
612
+ scopes: "string",
613
+ slug: "string",
614
+ status: "string",
615
+ timeout: "integer",
616
+ timeoutSeconds: "integer",
617
+ tool: "string",
618
+ toolName: "string",
619
+ toolset: "string",
620
+ url: "string"
600
621
  },
601
- handler: async ({ options, rest }) => (await import("./organizations-I46KG7TC.js")).runOrganizationsCommand(options, rest)
622
+ handler: async ({ options, rest }) => (await import("./organizations-Z5HVD2E7.js")).runOrganizationsCommand(options, rest)
602
623
  },
603
624
  {
604
625
  name: "project",
605
626
  usage: "openpond project <list|create|upsert|get|update|sync|source-upload|archive> [args]",
606
627
  optionSchema: PROJECT_OPTION_SCHEMA,
607
- handler: async ({ options, rest }) => (await import("./project-agent-ZUC3YMCT.js")).runProjectCommand(options, rest)
628
+ handler: async ({ options, rest }) => (await import("./project-agent-W3V75WBR.js")).runProjectCommand(options, rest)
608
629
  },
609
630
  {
610
631
  name: "agent",
611
- usage: "openpond agent <inspect|build|validate|eval|traces|list|create|upsert|get|update|run|run-test|bind-source|source|edit|archive> [args]",
632
+ usage: "openpond agent <inspect|build|validate|eval|traces|list|create|upsert|get|update|run|run-test|bind-source|source|archive> [args]",
612
633
  usages: [
613
634
  "openpond agent run <action> [--cwd <project>] [--input <json>]",
614
635
  "openpond agent run <agentId> --team-id <id> [--conversation-id <id>] [--target-project-id <projectId>] [--input <json>]",
615
- "openpond agent source check-status <workItemId> --team-id <id> [--limit <n>]",
616
- "openpond agent edit open <agentId> --team-id <id> --project-id <id> [--message <text>]",
617
- "openpond agent edit checkpoint-result|commit-result|pr-result <workItemId> --team-id <id> --ref <artifact-ref>"
636
+ "openpond agent source checks <agentId> --team-id <id> [--check-kind <kind>]",
637
+ "openpond agent source publish <agentId> --team-id <id> [--expected-manifest-hash <hash>]"
618
638
  ],
619
639
  optionSchema: AGENT_OPTION_SCHEMA,
620
- handler: async ({ options, rest }) => (await import("./project-agent-ZUC3YMCT.js")).runAgentCommand(options, rest)
640
+ handler: async ({ options, rest }) => (await import("./project-agent-W3V75WBR.js")).runAgentCommand(options, rest)
621
641
  },
622
642
  {
623
- name: "goal",
624
- usage: "openpond goal <command> [args]",
625
- optionSchema: {
626
- agentId: "string",
627
- cwd: "string",
628
- goalStorage: "string",
629
- json: "boolean",
630
- goalId: "string"
631
- },
632
- handler: async ({ options, rest }) => (await import("./cli-2KBVNDRY.js")).runGoalCommand(options, rest)
633
- },
634
- {
635
- name: "harness",
636
- usage: "openpond harness desktop <run|attach> <scenario...> [--isolated|--attach|--packaged|--none] [--app <path>] [--artifacts-dir <path>] [--json <path>]",
643
+ name: "desktop-test",
644
+ usage: "openpond desktop-test <run|attach> <scenario...> [--isolated|--attach|--packaged|--none] [--app <path>] [--artifacts-dir <path>] [--json <path>]",
637
645
  optionSchema: {
638
646
  artifactsDir: "string",
639
647
  attach: "boolean",
@@ -650,22 +658,56 @@ var CLI_COMMAND_REGISTRY = [
650
658
  token: "string",
651
659
  tokenFile: "string"
652
660
  },
653
- handler: async ({ options, rest }) => (await import("./harness-BHQRMXJR.js")).runHarnessCommand(options, rest)
661
+ handler: async ({ options, rest }) => (await import("./desktop-test-RNMWLOVU.js")).runDesktopTestCommand(options, rest)
654
662
  },
655
663
  {
656
664
  name: "sandbox",
657
665
  usage: "openpond sandbox <command> [args]",
658
666
  optionSchema: SANDBOX_OPTION_SCHEMA,
659
- handler: async ({ options, rest }) => (await import("./sandbox-command-AAOPFTI5.js")).runSandboxCommand(options, rest)
667
+ handler: async ({ options, rest }) => (await import("./sandbox-command-X3FO74NX.js")).runSandboxCommand(options, rest)
668
+ },
669
+ {
670
+ name: "training",
671
+ usage: "openpond training <start|status|watch|logs|cancel|artifacts> <model-run-id|run-id>",
672
+ usages: [
673
+ "openpond training start <model-run-id> [--manifest <path>] [--yes] [--max-spend <usd>] [--retention-days <days>] [--detach] [--json]",
674
+ "openpond training status <run-id> [--json]",
675
+ "openpond training watch <run-id> [--interval-ms <ms>] [--json]",
676
+ "openpond training logs <run-id> [--json]",
677
+ "openpond training cancel <run-id> [--json]",
678
+ "openpond training artifacts <run-id> [--json]"
679
+ ],
680
+ optionSchema: {
681
+ apiBaseUrl: "string",
682
+ detach: "boolean",
683
+ intervalMs: "integer",
684
+ json: "boolean",
685
+ manifest: "string",
686
+ maxSpend: "number",
687
+ retentionDays: "integer",
688
+ yes: "boolean"
689
+ },
690
+ handler: async ({ options, rest }) => (await import("./training-BR5A7SPU.js")).runTrainingCommand(options, rest)
660
691
  },
661
692
  {
662
693
  name: "opchat",
663
694
  usage: "openpond opchat <command> [args]",
664
695
  optionSchema: {
696
+ compatModel: "string",
697
+ compatibilityModel: "string",
698
+ env: "string",
699
+ environment: "string",
665
700
  json: "boolean",
701
+ message: "string",
702
+ model: "string",
703
+ opchatApiBaseUrl: "string",
704
+ opchatApiUrl: "string",
705
+ prompt: "string",
706
+ skipStream: "boolean",
707
+ skipTool: "boolean",
666
708
  stream: "boolean"
667
709
  },
668
- handler: async ({ options, rest }) => (await import("./opchat-D63YTNSX.js")).runOpChatCommand(options, rest)
710
+ handler: async ({ options, rest }) => (await import("./opchat-2K2JIGK3.js")).runOpChatCommand(options, rest)
669
711
  },
670
712
  {
671
713
  name: "teams-bot",
@@ -674,7 +716,7 @@ var CLI_COMMAND_REGISTRY = [
674
716
  json: "boolean",
675
717
  teamId: "string"
676
718
  },
677
- handler: async ({ options, rest }) => (await import("./teams-bot-PSL3ZO6Z.js")).runTeamsBotCommand(options, rest)
719
+ handler: async ({ options, rest }) => (await import("./teams-bot-NTQ6VFFL.js")).runTeamsBotCommand(options, rest)
678
720
  },
679
721
  {
680
722
  name: "apps",
@@ -695,7 +737,7 @@ var CLI_COMMAND_REGISTRY = [
695
737
  name: "opentool",
696
738
  usage: "openpond opentool <init|validate|build> [args]",
697
739
  optionSchema: {},
698
- handler: async ({ rest }) => (await import("./core-commands-YN4RMWA3.js")).runOpentool(rest)
740
+ handler: async ({ rest }) => (await import("./core-commands-4MRJQZJV.js")).runOpentool(rest)
699
741
  }
700
742
  ];
701
743
  var CLI_COMMAND_BY_NAME = /* @__PURE__ */ new Map();
@@ -767,11 +809,11 @@ function profileSdkAliasDefinitions() {
767
809
  name,
768
810
  usage: `openpond ${name} [args]`,
769
811
  optionSchema: PROFILE_SDK_OPTION_SCHEMA,
770
- handler: async ({ options, rest }) => (await import("./profile-WKZJHEPG.js")).runOpenPondProfileSdkAlias(name, options, rest)
812
+ handler: async ({ options, rest }) => (await import("./profile-QNECVVGN.js")).runOpenPondProfileSdkAlias(name, options, rest)
771
813
  }));
772
814
  }
773
815
  async function runToolCommand({ options, rest }) {
774
- const { runToolList, runToolRun } = await import("./core-commands-YN4RMWA3.js");
816
+ const { runToolList, runToolRun } = await import("./core-commands-4MRJQZJV.js");
775
817
  const subcommand = rest[0];
776
818
  if (subcommand === "list") {
777
819
  const target = rest[1];
@@ -795,8 +837,8 @@ async function runToolCommand({ options, rest }) {
795
837
  throw new Error("usage: tool <list|run> <handle>/<repo> [args]");
796
838
  }
797
839
  async function runBacktestCommand({ options, rest }) {
798
- const { runBacktestRun } = await import("./core-commands-YN4RMWA3.js");
799
- const { runBacktestEvents, runBacktestGet } = await import("./apps-AKBI6AS7.js");
840
+ const { runBacktestRun } = await import("./core-commands-4MRJQZJV.js");
841
+ const { runBacktestEvents, runBacktestGet } = await import("./apps-CZAJBGE3.js");
800
842
  const subcommand = rest[0] || "run";
801
843
  if (subcommand === "run") {
802
844
  const target = rest[1];
@@ -830,7 +872,7 @@ async function runBacktestCommand({ options, rest }) {
830
872
  throw new Error("usage: backtest <run|events|get> <handle>/<repo> [args]");
831
873
  }
832
874
  async function runDeployCommand({ options, rest }) {
833
- const { runDeployWatch } = await import("./core-commands-YN4RMWA3.js");
875
+ const { runDeployWatch } = await import("./core-commands-4MRJQZJV.js");
834
876
  const subcommand = rest[0] || "watch";
835
877
  if (subcommand !== "watch") {
836
878
  throw new Error(
@@ -846,7 +888,7 @@ async function runDeployCommand({ options, rest }) {
846
888
  await runDeployWatch(options, target);
847
889
  }
848
890
  async function runTemplateCommand({ options, rest }) {
849
- const { runTemplateBranches, runTemplateStatus, runTemplateUpdate } = await import("./core-commands-YN4RMWA3.js");
891
+ const { runTemplateBranches, runTemplateStatus, runTemplateUpdate } = await import("./core-commands-4MRJQZJV.js");
850
892
  const subcommand = rest[0] || "status";
851
893
  const target = rest[1];
852
894
  if (!target) {
@@ -871,7 +913,7 @@ async function runTemplateCommand({ options, rest }) {
871
913
  );
872
914
  }
873
915
  async function runRepoCommand({ options, rest }) {
874
- const { runRepoCreate, runRepoPush } = await import("./core-commands-YN4RMWA3.js");
916
+ const { runRepoCreate, runRepoPush } = await import("./core-commands-4MRJQZJV.js");
875
917
  const subcommand = rest[0] || "create";
876
918
  if (subcommand === "create") {
877
919
  await runRepoCreate(options, rest.slice(1));
@@ -898,7 +940,7 @@ async function runAppsCommand({ options, rest }) {
898
940
  runAppsSummary,
899
941
  runAppsTools,
900
942
  runAppsToolsExecute
901
- } = await import("./apps-AKBI6AS7.js");
943
+ } = await import("./apps-CZAJBGE3.js");
902
944
  const subcommand = rest[0];
903
945
  if (subcommand === "list") {
904
946
  await runAppsList(options);
@@ -4,7 +4,7 @@ import {
4
4
  parseSandboxRuntimeProfileIdOption,
5
5
  parseSandboxRuntimePromotionPolicyOption,
6
6
  parseSandboxWorkflowModeOption
7
- } from "./chunk-275WCETC.js";
7
+ } from "./chunk-FCVVOMIP.js";
8
8
  import {
9
9
  parseBooleanOption,
10
10
  parseCsvOption,
@@ -79,7 +79,6 @@ function formatSandboxLine(sandbox) {
79
79
  return [
80
80
  sandbox.id,
81
81
  sandbox.state,
82
- sandbox.runtimeDriver,
83
82
  `spent=${captured}/${budget}`,
84
83
  mppMode,
85
84
  repo
@@ -589,7 +588,6 @@ function summarizeSandbox(sandbox) {
589
588
  return {
590
589
  id: sandbox.id,
591
590
  state: sandbox.state,
592
- runtimeDriver: sandbox.runtimeDriver,
593
591
  repo: sandbox.repo,
594
592
  runtimeId: sandbox.runtimeId ?? null,
595
593
  repoRef: sandbox.repoRef ?? null,
@@ -1,10 +1,228 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
2
  import {
3
- getOpChatModel,
4
- listOpChatModels,
5
- sendHostedChatTurn,
6
- streamHostedChatTurn
7
- } from "./chunk-HLCTINEP.js";
3
+ withVercelProtectionBypass
4
+ } from "./chunk-DBHSOTYZ.js";
5
+ import {
6
+ DEFAULT_OPENPOND_OPCHAT_API_BASE_URL
7
+ } from "./chunk-KSRWKXRB.js";
8
+
9
+ // ../../packages/cloud/src/hosted-chat.ts
10
+ import { randomUUID } from "node:crypto";
11
+ function normalizeApiBaseUrl(value) {
12
+ const trimmed = normalizeOptionalOpChatApiBaseUrl(value);
13
+ if (!trimmed) throw new Error("apiBaseUrl is required");
14
+ return trimmed;
15
+ }
16
+ function trimTrailingSlashes(value) {
17
+ return value.replace(/\/+$/, "");
18
+ }
19
+ function normalizeOptionalOpChatApiBaseUrl(value) {
20
+ let trimmed = trimTrailingSlashes(value?.trim() ?? "");
21
+ if (!trimmed) return null;
22
+ trimmed = trimmed.replace(/\/chat\/completions$/i, "").replace(/\/models(?:\/[^/]+)?$/i, "");
23
+ if (trimmed.endsWith("/opchat/v1")) return trimmed;
24
+ if (trimmed.endsWith("/opchat")) return `${trimmed}/v1`;
25
+ if (trimmed.endsWith("/v1")) {
26
+ trimmed = trimmed.slice(0, -"/v1".length);
27
+ }
28
+ return `${trimTrailingSlashes(trimmed)}/opchat/v1`;
29
+ }
30
+ function resolveOpChatApiBaseUrl(options = {}) {
31
+ const runtimeEnv = options.env ?? (typeof process !== "undefined" ? process.env : {});
32
+ const explicit = normalizeOptionalOpChatApiBaseUrl(options.opChatApiBaseUrl) ?? normalizeOptionalOpChatApiBaseUrl(runtimeEnv.OPENPOND_OPCHAT_API_URL);
33
+ if (explicit) return explicit;
34
+ const migrationInput = normalizeOptionalOpChatApiBaseUrl(options.chatApiBaseUrl) ?? normalizeOptionalOpChatApiBaseUrl(runtimeEnv.OPENPOND_CHAT_API_URL) ?? normalizeOptionalOpChatApiBaseUrl(runtimeEnv.OPENPOND_GATEWAY_URL);
35
+ if (migrationInput) return migrationInput;
36
+ const apiBase = normalizeOptionalOpChatApiBaseUrl(options.apiBaseUrl) ?? normalizeOptionalOpChatApiBaseUrl(runtimeEnv.OPENPOND_API_URL);
37
+ return apiBase ?? DEFAULT_OPENPOND_OPCHAT_API_BASE_URL;
38
+ }
39
+ function requireToken(value) {
40
+ const trimmed = value.trim();
41
+ if (!trimmed) throw new Error("OpenPond API key is required");
42
+ return trimmed;
43
+ }
44
+ function hostedHeaders(requestUrl, token, accept, requestId) {
45
+ const headers = new Headers();
46
+ headers.set("Authorization", `Bearer ${requireToken(token)}`);
47
+ headers.set("Content-Type", "application/json");
48
+ headers.set("Accept", accept);
49
+ headers.set("x-openpond-client", "openpond-code");
50
+ headers.set("x-openpond-request-id", requestId || randomUUID());
51
+ return withVercelProtectionBypass(requestUrl, headers);
52
+ }
53
+ async function readError(response) {
54
+ const text = await response.text().catch(() => "");
55
+ if (!text) return response.statusText || `HTTP ${response.status}`;
56
+ try {
57
+ const payload = JSON.parse(text);
58
+ const error = typeof payload.error === "string" ? payload.error : payload.error && typeof payload.error === "object" && !Array.isArray(payload.error) ? payload.error : null;
59
+ const code = typeof payload.code === "string" ? payload.code : error && typeof error !== "string" && typeof error.code === "string" ? error.code : null;
60
+ const message = typeof payload.message === "string" ? payload.message : error && typeof error !== "string" && typeof error.message === "string" ? error.message : null;
61
+ const label = typeof error === "string" ? error : error && typeof error.type === "string" ? error.type : null;
62
+ return [code, label, message].filter(Boolean).join(": ") || text;
63
+ } catch {
64
+ return text;
65
+ }
66
+ }
67
+ function buildHostedChatBody(options, stream) {
68
+ const body = {
69
+ model: options.model,
70
+ messages: options.messages,
71
+ stream
72
+ };
73
+ if (typeof options.temperature === "number") {
74
+ body.temperature = options.temperature;
75
+ }
76
+ if (typeof options.maxTokens === "number") {
77
+ body.max_tokens = options.maxTokens;
78
+ }
79
+ if (options.tools) {
80
+ body.tools = options.tools;
81
+ }
82
+ const toolChoice = options.toolChoice ?? options.tool_choice;
83
+ if (toolChoice !== void 0) {
84
+ body.tool_choice = toolChoice;
85
+ }
86
+ if (options.metadata) {
87
+ body.metadata = options.metadata;
88
+ }
89
+ return body;
90
+ }
91
+ async function listOpChatModels(options) {
92
+ const apiBaseUrl = normalizeApiBaseUrl(options.apiBaseUrl);
93
+ const requestUrl = `${apiBaseUrl}/models`;
94
+ const response = await fetch(requestUrl, {
95
+ method: "GET",
96
+ headers: hostedHeaders(requestUrl, options.token, "application/json"),
97
+ signal: options.signal
98
+ });
99
+ if (!response.ok) {
100
+ throw new Error(
101
+ `Hosted model list failed: ${response.status} ${await readError(
102
+ response
103
+ )}`
104
+ );
105
+ }
106
+ return await response.json();
107
+ }
108
+ async function getOpChatModel(options) {
109
+ const apiBaseUrl = normalizeApiBaseUrl(options.apiBaseUrl);
110
+ const requestUrl = `${apiBaseUrl}/models/${encodeURIComponent(options.model)}`;
111
+ const response = await fetch(
112
+ requestUrl,
113
+ {
114
+ method: "GET",
115
+ headers: hostedHeaders(requestUrl, options.token, "application/json"),
116
+ signal: options.signal
117
+ }
118
+ );
119
+ if (!response.ok) {
120
+ throw new Error(
121
+ `Hosted model lookup failed: ${response.status} ${await readError(
122
+ response
123
+ )}`
124
+ );
125
+ }
126
+ return await response.json();
127
+ }
128
+ async function sendHostedChatTurn(options) {
129
+ const apiBaseUrl = normalizeApiBaseUrl(options.apiBaseUrl);
130
+ const requestUrl = `${apiBaseUrl}/chat/completions`;
131
+ const response = await fetch(requestUrl, {
132
+ method: "POST",
133
+ headers: hostedHeaders(
134
+ requestUrl,
135
+ options.token,
136
+ "application/json",
137
+ options.requestId
138
+ ),
139
+ body: JSON.stringify(buildHostedChatBody(options, false)),
140
+ signal: options.signal
141
+ });
142
+ if (!response.ok) {
143
+ throw new Error(
144
+ `Hosted chat failed: ${response.status} ${await readError(response)}`
145
+ );
146
+ }
147
+ return await response.json();
148
+ }
149
+ async function* parseOpenAISSE(stream, signal) {
150
+ const reader = stream.getReader();
151
+ const decoder = new TextDecoder();
152
+ let buffer = "";
153
+ const readAbortError = () => signal?.reason instanceof Error ? signal.reason : new Error("hosted_chat_aborted");
154
+ try {
155
+ while (true) {
156
+ if (signal?.aborted) throw readAbortError();
157
+ const result = await reader.read();
158
+ if (result.done) break;
159
+ buffer += decoder.decode(result.value, { stream: true });
160
+ const lines = buffer.split("\n");
161
+ buffer = lines.pop() || "";
162
+ for (const line of lines) {
163
+ const trimmed = line.trim();
164
+ if (!trimmed.startsWith("data:")) continue;
165
+ const data = trimmed.slice(5).trim();
166
+ if (!data) continue;
167
+ if (data === "[DONE]") return;
168
+ yield JSON.parse(data);
169
+ }
170
+ }
171
+ } finally {
172
+ try {
173
+ reader.releaseLock();
174
+ } catch {
175
+ }
176
+ }
177
+ }
178
+ async function* streamHostedChatTurn(options) {
179
+ const apiBaseUrl = normalizeApiBaseUrl(options.apiBaseUrl);
180
+ const requestUrl = `${apiBaseUrl}/chat/completions`;
181
+ const response = await fetch(requestUrl, {
182
+ method: "POST",
183
+ headers: hostedHeaders(
184
+ requestUrl,
185
+ options.token,
186
+ "text/event-stream",
187
+ options.requestId
188
+ ),
189
+ body: JSON.stringify(buildHostedChatBody(options, true)),
190
+ signal: options.signal
191
+ });
192
+ if (!response.ok || !response.body) {
193
+ throw new Error(
194
+ `Hosted chat stream failed: ${response.status} ${await readError(
195
+ response
196
+ )}`
197
+ );
198
+ }
199
+ for await (const raw of parseOpenAISSE(response.body, options.signal)) {
200
+ const chunk = raw;
201
+ if (chunk.error) {
202
+ throw new Error(chunk.error.message || "Hosted chat stream error");
203
+ }
204
+ if (chunk.usage) {
205
+ yield { type: "usage", usage: chunk.usage, raw };
206
+ }
207
+ const choice = chunk.choices?.[0];
208
+ if (!choice) continue;
209
+ const content = choice.delta?.content;
210
+ if (content) {
211
+ yield { type: "text_delta", text: content, raw };
212
+ }
213
+ const reasoning = choice.delta?.reasoning_content;
214
+ if (reasoning) {
215
+ yield { type: "reasoning_delta", text: reasoning, raw };
216
+ }
217
+ const toolCalls = choice.delta?.tool_calls;
218
+ if (Array.isArray(toolCalls) && toolCalls.length > 0) {
219
+ yield { type: "tool_call_delta", toolCalls, raw };
220
+ }
221
+ if (choice.finish_reason !== void 0 && choice.finish_reason !== null) {
222
+ yield { type: "finish", finishReason: choice.finish_reason, raw };
223
+ }
224
+ }
225
+ }
8
226
 
9
227
  // ../../packages/cloud/src/opchat-smoke.ts
10
228
  var DEFAULT_MODEL = "openpond-chat";
@@ -290,5 +508,10 @@ function formatUsage(usage) {
290
508
  }
291
509
 
292
510
  export {
511
+ resolveOpChatApiBaseUrl,
512
+ listOpChatModels,
513
+ getOpChatModel,
514
+ sendHostedChatTurn,
515
+ streamHostedChatTurn,
293
516
  runOpChatSmoke
294
517
  };