openpond 0.2.0 → 0.2.2

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 (220) hide show
  1. package/dist/chunks/actions-command-F55CBR2K.js +2 -0
  2. package/dist/chunks/app-layer-GNYLOBCX.js +3 -0
  3. package/dist/chunks/app-server-runtime-VAGY4LQS.js +2 -0
  4. package/dist/chunks/apps-HZ5JGBDR.js +2 -0
  5. package/dist/chunks/chunk-22UARBPW.js +3 -0
  6. package/dist/chunks/chunk-3A7HZJNE.js +1 -0
  7. package/dist/chunks/chunk-3M53YXEI.js +2 -0
  8. package/dist/chunks/chunk-3NDRIQTI.js +2 -0
  9. package/dist/chunks/chunk-6FA3GG5B.js +33 -0
  10. package/dist/chunks/chunk-6MI4KKWF.js +2 -0
  11. package/dist/chunks/chunk-7D2LMRP7.js +2 -0
  12. package/dist/chunks/chunk-A42DFLOR.js +16 -0
  13. package/dist/chunks/chunk-AF57BF75.js +24 -0
  14. package/dist/chunks/chunk-BX4J2VDU.js +2 -0
  15. package/dist/chunks/chunk-BZMVB3GS.js +2 -0
  16. package/dist/chunks/chunk-CCJG7GLE.js +5 -0
  17. package/dist/chunks/chunk-CWQWV2T3.js +2 -0
  18. package/dist/chunks/chunk-DUA3QP6Y.js +19 -0
  19. package/dist/chunks/chunk-EAPFMACH.js +10 -0
  20. package/dist/chunks/chunk-EG3XB6M6.js +5 -0
  21. package/dist/chunks/chunk-ES2ISFJC.js +66 -0
  22. package/dist/chunks/chunk-FTQLQJQV.js +2 -0
  23. package/dist/chunks/chunk-FYCJSUFV.js +53 -0
  24. package/dist/chunks/chunk-GEANXBLX.js +2 -0
  25. package/dist/chunks/chunk-GLUWATL5.js +2 -0
  26. package/dist/chunks/chunk-GPZYIVFV.js +2199 -0
  27. package/dist/chunks/chunk-H7IWJN7L.js +17 -0
  28. package/dist/chunks/chunk-HZP5U2AA.js +3 -0
  29. package/dist/chunks/chunk-I5K74TOH.js +3 -0
  30. package/dist/chunks/chunk-I7G35U7K.js +2 -0
  31. package/dist/chunks/chunk-IR3YJWPW.js +7 -0
  32. package/dist/chunks/chunk-J7WZSLHS.js +18 -0
  33. package/dist/chunks/chunk-K35OOAW2.js +6 -0
  34. package/dist/chunks/chunk-KDXLNQNF.js +12 -0
  35. package/dist/chunks/chunk-KJYNLFWD.js +2872 -0
  36. package/dist/chunks/chunk-KV2IXO2T.js +6 -0
  37. package/dist/chunks/chunk-NVGMZ2IN.js +2 -0
  38. package/dist/chunks/chunk-OGPHXXCD.js +1 -0
  39. package/dist/chunks/chunk-RAKJWIYO.js +36 -0
  40. package/dist/chunks/chunk-RWSAGQTP.js +2 -0
  41. package/dist/chunks/chunk-SDO4FC4Q.js +2 -0
  42. package/dist/chunks/chunk-T5XCPX4P.js +3 -0
  43. package/dist/chunks/chunk-VYUMTRB3.js +5 -0
  44. package/dist/chunks/chunk-X37KMV27.js +1 -0
  45. package/dist/chunks/chunk-XAYIETBO.js +28 -0
  46. package/dist/chunks/chunk-XEOEKFG6.js +71 -0
  47. package/dist/chunks/chunk-ZVOO7FKM.js +2 -0
  48. package/dist/chunks/cli-UYTSZB4Y.js +2 -0
  49. package/dist/chunks/configuration-command-HAPIYG25.js +2 -0
  50. package/dist/chunks/continual-D75WA7E7.js +7 -0
  51. package/dist/chunks/core-commands-N37UZEVE.js +2 -0
  52. package/dist/chunks/database-X2CUV732.js +2 -0
  53. package/dist/chunks/desktop-test-V7FBEG7U.js +3 -0
  54. package/dist/chunks/dist-NKLXFA37.js +2 -0
  55. package/dist/chunks/extension-NEPOQ44P.js +5 -0
  56. package/dist/chunks/help-HC4N5ZQC.js +8 -0
  57. package/dist/chunks/module-ES6BEMUI-ZVL3F6NW.js +2 -0
  58. package/dist/chunks/module-asyncify-2EFITU5U-R7TVXNAE.js +2 -0
  59. package/dist/chunks/opchat-C7XRN4ZW.js +3 -0
  60. package/dist/chunks/organizations-LQGRZJ2V.js +2 -0
  61. package/dist/chunks/profile-UWM24A7R.js +3 -0
  62. package/dist/chunks/project-agent-2ME52ZJW.js +2 -0
  63. package/dist/chunks/sandbox-command-53L3ZICT.js +2 -0
  64. package/dist/chunks/sandbox-template-55HUM5H7.js +10 -0
  65. package/dist/chunks/src-EYJF2LWV.js +319 -0
  66. package/dist/chunks/src-VGW2UEMV.js +82 -0
  67. package/dist/chunks/taskset-PISBOILQ.js +2 -0
  68. package/dist/chunks/teams-bot-FHD2HCHN.js +3 -0
  69. package/dist/chunks/training-2NDOWH5S.js +2 -0
  70. package/dist/chunks/workspaces-CQFVCR7T.js +2 -0
  71. package/dist/cli.js +3 -109
  72. package/dist/index.js +1 -31230
  73. package/dist/sandbox-template/manifest.js +1 -18380
  74. package/dist/web/assets/App-BoJQRfeu.js +176 -0
  75. package/dist/web/assets/AppDialog-rdfmJsGF.js +1 -0
  76. package/dist/web/assets/AppTerminalPanel-CLW0kxtg.js +2 -0
  77. package/dist/web/assets/{AppsView-B1NUuAIf.js → AppsView-DxMXadnp.js} +1 -1
  78. package/dist/web/assets/{BrowserSidebar-DOvYxXeP.js → BrowserSidebar-BH_jl0JS.js} +1 -1
  79. package/dist/web/assets/{CartesianChart-pOrYpzBr.js → CartesianChart-oT_rMYpf.js} +1 -1
  80. package/dist/web/assets/{CollaborationTabs-CgbR-MBJ.js → CollaborationTabs-CukgFGE0.js} +1 -1
  81. package/dist/web/assets/{CommandMenu-CrIr4qUX.js → CommandMenu-2btBTgOF.js} +1 -1
  82. package/dist/web/assets/{CommunityView-CvAVQ_HZ.js → CommunityView-DMTREmN5.js} +1 -1
  83. package/dist/web/assets/{ComposerCreateImproveStrip-DybcKwwd.js → ComposerCreateImproveStrip-3tN55cg9.js} +1 -1
  84. package/dist/web/assets/GetStartedView-CMHL24_w.js +1 -0
  85. package/dist/web/assets/HostedModelLearningReview-CqkSelkC.js +1 -0
  86. package/dist/web/assets/HostedModelLearningSettings-xqd2lSW3.js +1 -0
  87. package/dist/web/assets/LabModelVersionDetailPage-Bpnya5DM.js +1 -0
  88. package/dist/web/assets/{LabSkillSidebar-CuaYrtiu.js → LabSkillSidebar-BKZjScr8.js} +1 -1
  89. package/dist/web/assets/LabsRoute-BhPFmA_Z.js +32 -0
  90. package/dist/web/assets/LabsRoute-C1FWCoYb.css +1 -0
  91. package/dist/web/assets/MainChatThread-Bosxokt-.js +2 -0
  92. package/dist/web/assets/MainPane-Di-Rwe7x.js +8 -0
  93. package/dist/web/assets/{MarkdownText-DOlVQR8a.js → MarkdownText-dK4SBPp_.js} +1 -1
  94. package/dist/web/assets/{Messages-DMubppta.js → Messages-ftYRMKYa.js} +6 -6
  95. package/dist/web/assets/{NativeSkillSidebar-DSFwZ-od.js → NativeSkillSidebar-Cwo7JdB2.js} +1 -1
  96. package/dist/web/assets/{NewExperienceSwitcher-Dj0ePIJ-.js → NewExperienceSwitcher-C1_JzTq2.js} +1 -1
  97. package/dist/web/assets/{NewProjectDialog-B8NQV-Ji.js → NewProjectDialog-CxP6v6YW.js} +1 -1
  98. package/dist/web/assets/{OutputsPage-D_LDYTgV.js → OutputsPage-DL21_Alp.js} +1 -1
  99. package/dist/web/assets/{ProjectsPage-xjDYPc_W.js → ProjectsPage-BO9VyvMA.js} +1 -1
  100. package/dist/web/assets/RightChatPanelStack-DaqAnzdR.js +1 -0
  101. package/dist/web/assets/{RightSidebarHomePanel-j0VckZUu.js → RightSidebarHomePanel-PbUG12AO.js} +1 -1
  102. package/dist/web/assets/{ScheduledWorkPage-1aT4bBY-.js → ScheduledWorkPage-BhL-cXML.js} +1 -1
  103. package/dist/web/assets/{SettingsView-BSpuMDpv.js → SettingsView-D6-s7G88.js} +7 -7
  104. package/dist/web/assets/TeamChatView-DbS1N-fo.js +3 -0
  105. package/dist/web/assets/{TerminalOverlay-CrSwUk2d.js → TerminalOverlay-CphyBXJR.js} +3 -3
  106. package/dist/web/assets/{TrainingCreationPanel-B4HMRwUg.js → TrainingCreationPanel-Czsdraix.js} +1 -1
  107. package/dist/web/assets/{TrainingDraftPanel-D4r1tN3I.js → TrainingDraftPanel-Bq3B5pUk.js} +1 -1
  108. package/dist/web/assets/{UsageSettingsSection-2aymqwIM.js → UsageSettingsSection-B74FNwaP.js} +5 -5
  109. package/dist/web/assets/{WorkSidebarPanel-B0X0OiR6.js → WorkSidebarPanel-BgaK4XSg.js} +1 -1
  110. package/dist/web/assets/WorkspaceDiffPanel-C3seHnVY.js +14 -0
  111. package/dist/web/assets/{WorkspaceEnvironmentMenu-OAfMEt7L.js → WorkspaceEnvironmentMenu-DPghQUdv.js} +3 -3
  112. package/dist/web/assets/{WorkspaceGitDialogs-YxcPH2Rq.js → WorkspaceGitDialogs-D8c6Okb_.js} +1 -1
  113. package/dist/web/assets/{WorkspaceMonacoEditor-COKTiQZl.js → WorkspaceMonacoEditor-2kjRFf4l.js} +36 -36
  114. package/dist/web/assets/{arrow-up-right-_TX-awvK.js → arrow-up-right-C5X-29oa.js} +1 -1
  115. package/dist/web/assets/chat-file-links-Bmz9kVct.js +1 -0
  116. package/dist/web/assets/chevron-up-NbP9vY4E.js +1 -0
  117. package/dist/web/assets/{clipboard-CyRSS8Sy.js → clipboard-fvHMXPWa.js} +1 -1
  118. package/dist/web/assets/{cloud-upload-uBJBUYTy.js → cloud-upload-BAycsdHL.js} +1 -1
  119. package/dist/web/assets/{cssMode-BrXSsZYs.js → cssMode-Yis679a5.js} +1 -1
  120. package/dist/web/assets/{folder-open-DktdZNW7.js → folder-open-bii4KUCv.js} +1 -1
  121. package/dist/web/assets/{folder-plus-DO06i9Vo.js → folder-plus-B0B7mUCx.js} +1 -1
  122. package/dist/web/assets/{git-commit-horizontal-zFSIkPs7.js → git-commit-horizontal-B6yTdtnB.js} +1 -1
  123. package/dist/web/assets/{htmlMode-X9UMFkjt.js → htmlMode-DHeBSKVF.js} +1 -1
  124. package/dist/web/assets/{index-UOGdfLzi.js → index-667pXXsu.js} +1 -1
  125. package/dist/web/assets/{index-ByQIHpc9.css → index-BGMzUaup.css} +1 -1
  126. package/dist/web/assets/{info-BEJXUqCD.js → info-NCOESX3I.js} +1 -1
  127. package/dist/web/assets/{jsonMode-DIsB-j2E.js → jsonMode-C4oxy1cU.js} +1 -1
  128. package/dist/web/assets/{lspLanguageFeatures-CmZ17KpA.js → lspLanguageFeatures-CLj3WGZW.js} +1 -1
  129. package/dist/web/assets/{minimize-2-DumTpFtE.js → minimize-2-DtI1vgd7.js} +1 -1
  130. package/dist/web/assets/{monaco.contribution-D6w5PJji.js → monaco.contribution-DZPgekIQ.js} +2 -2
  131. package/dist/web/assets/{monaco.contribution-DJ_NmcHu.js → monaco.contribution-Ddw-TznO.js} +2 -2
  132. package/dist/web/assets/{monaco.contribution-YVDfJcG4.js → monaco.contribution-DhVPJ-oY.js} +2 -2
  133. package/dist/web/assets/{monaco.contribution-LZEujgny.js → monaco.contribution-DrW6DjWP.js} +2 -2
  134. package/dist/web/assets/{play-CLFeH7CU.js → play-DB3XFAnG.js} +1 -1
  135. package/dist/web/assets/{python-Djbda_qZ.js → python-DLyUeEeL.js} +1 -1
  136. package/dist/web/assets/{refresh-cw-B4IpQ_7Q.js → refresh-cw-0zSLZtfp.js} +1 -1
  137. package/dist/web/assets/{save-BbTHztnA.js → save-BCZlshOA.js} +1 -1
  138. package/dist/web/assets/{square-BJrVbmz6.js → square-CRytZWR_.js} +1 -1
  139. package/dist/web/assets/{toggleHighContrast-BopU5W9S.js → toggleHighContrast-TXg0rI_R.js} +1 -1
  140. package/dist/web/assets/{tsMode-CH_0_YDX.js → tsMode-Bj1019AY.js} +1 -1
  141. package/dist/web/assets/{upload-UumVeufu.js → upload-CnE9u7GB.js} +1 -1
  142. package/dist/web/assets/{useLocalAgentSchedules-BRa23U7O.js → useLocalAgentSchedules-qI87RHVI.js} +1 -1
  143. package/dist/web/assets/{wifi-off-BWJWivn6.js → wifi-off-CfuwRBx7.js} +1 -1
  144. package/dist/web/assets/{workers-pTe8RvSI.js → workers-CXdUI7wU.js} +1 -1
  145. package/dist/web/assets/{yaml-DNLASORn.js → yaml-AP8aiwLm.js} +1 -1
  146. package/dist/web/index.html +2 -2
  147. package/package.json +4 -3
  148. package/dist/chunks/actions-command-6N5XWMR6.js +0 -185
  149. package/dist/chunks/app-layer-F3CGXB33.js +0 -216
  150. package/dist/chunks/app-server-runtime-RHO5TFUC.js +0 -23
  151. package/dist/chunks/apps-L5XCL7QY.js +0 -429
  152. package/dist/chunks/chunk-26AMV5ZI.js +0 -634
  153. package/dist/chunks/chunk-3EB7I67T.js +0 -630
  154. package/dist/chunks/chunk-3ELF4FXY.js +0 -96
  155. package/dist/chunks/chunk-3VEYNDHN.js +0 -669
  156. package/dist/chunks/chunk-4KA25HUP.js +0 -5648
  157. package/dist/chunks/chunk-4L3ZJS2T.js +0 -1207
  158. package/dist/chunks/chunk-6SMNG6YA.js +0 -1303
  159. package/dist/chunks/chunk-7RIGZB7N.js +0 -1148
  160. package/dist/chunks/chunk-A6G3PFA5.js +0 -2164
  161. package/dist/chunks/chunk-BVY5JYM6.js +0 -512
  162. package/dist/chunks/chunk-DLQQIWN2.js +0 -648
  163. package/dist/chunks/chunk-FJ2JGB2N.js +0 -1373
  164. package/dist/chunks/chunk-FQS2QL5F.js +0 -14522
  165. package/dist/chunks/chunk-G65WAOJV.js +0 -1643
  166. package/dist/chunks/chunk-JTHL5XJ2.js +0 -1838
  167. package/dist/chunks/chunk-K4TZEHAW.js +0 -602
  168. package/dist/chunks/chunk-KCRCIQPD.js +0 -66
  169. package/dist/chunks/chunk-KSRWKXRB.js +0 -12
  170. package/dist/chunks/chunk-MUMPWI4O.js +0 -92
  171. package/dist/chunks/chunk-NTK22KJD.js +0 -10707
  172. package/dist/chunks/chunk-OCBRPU2K.js +0 -629
  173. package/dist/chunks/chunk-PS37DB5F.js +0 -183
  174. package/dist/chunks/chunk-R3C3MNSI.js +0 -140
  175. package/dist/chunks/chunk-SMNFI2FU.js +0 -113
  176. package/dist/chunks/chunk-UACZUFIA.js +0 -47
  177. package/dist/chunks/chunk-UZMVNKXM.js +0 -1275
  178. package/dist/chunks/chunk-VT6BLHMB.js +0 -67198
  179. package/dist/chunks/chunk-W5GKHH77.js +0 -168
  180. package/dist/chunks/chunk-X6F4LBTQ.js +0 -832
  181. package/dist/chunks/chunk-X7ZG4TSW.js +0 -3063
  182. package/dist/chunks/chunk-XA4KBDMY.js +0 -13723
  183. package/dist/chunks/chunk-YVCYVDNP.js +0 -746
  184. package/dist/chunks/chunk-ZNQEROWP.js +0 -254
  185. package/dist/chunks/cli-D2MUUBEX.js +0 -23
  186. package/dist/chunks/configuration-command-NR6JYIUD.js +0 -187
  187. package/dist/chunks/continual-37CE4LLJ.js +0 -803
  188. package/dist/chunks/core-commands-SWGIOZLW.js +0 -50
  189. package/dist/chunks/database-DEYUZDIM.js +0 -20
  190. package/dist/chunks/desktop-test-QOS7G5NE.js +0 -148
  191. package/dist/chunks/dist-AKYCQNNF.js +0 -187
  192. package/dist/chunks/extension-HJUJBQAD.js +0 -9378
  193. package/dist/chunks/help-J6PZ23IC.js +0 -67
  194. package/dist/chunks/opchat-ABX5YBAT.js +0 -169
  195. package/dist/chunks/organizations-CPNC47DO.js +0 -806
  196. package/dist/chunks/profile-Q3HB5MIO.js +0 -1136
  197. package/dist/chunks/project-agent-YHUBX4OR.js +0 -516
  198. package/dist/chunks/sandbox-command-YFL5QTWX.js +0 -1661
  199. package/dist/chunks/sandbox-template-Z6P7NTNF.js +0 -1655
  200. package/dist/chunks/src-7XEENEBI.js +0 -3628
  201. package/dist/chunks/src-KBBIV4NT.js +0 -56125
  202. package/dist/chunks/taskset-2TRZBRRT.js +0 -66
  203. package/dist/chunks/teams-bot-WD33NLH5.js +0 -146
  204. package/dist/chunks/training-4XH37UZB.js +0 -17
  205. package/dist/chunks/workspaces-WG2MH2WE.js +0 -99
  206. package/dist/web/assets/App-C9aGkxVg.js +0 -173
  207. package/dist/web/assets/AppDialog-CK6_lg8c.js +0 -1
  208. package/dist/web/assets/AppTerminalPanel-BKqgX4sd.js +0 -2
  209. package/dist/web/assets/GetStartedView-DVInkexN.js +0 -1
  210. package/dist/web/assets/LabModelVersionDetailPage-NaaPElmM.js +0 -1
  211. package/dist/web/assets/LabsRoute-BRR6x3SX.js +0 -2
  212. package/dist/web/assets/LabsRoute-CGFgymTX.css +0 -1
  213. package/dist/web/assets/MainChatThread-BfkjCZB9.js +0 -2
  214. package/dist/web/assets/MainPane-Gw-YK38n.js +0 -8
  215. package/dist/web/assets/RightChatPanelStack-BktRQ9wg.js +0 -1
  216. package/dist/web/assets/TeamChatView-BPWJbDf1.js +0 -3
  217. package/dist/web/assets/WorkspaceDiffPanel-Pg7GL0br.js +0 -14
  218. package/dist/web/assets/chat-file-links-CWLsRYvW.js +0 -1
  219. package/dist/web/assets/chevron-up--mNnEqha.js +0 -1
  220. package/dist/web/assets/index-BEPmTPIA.js +0 -1
@@ -1,67 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import {
3
- CLI_GLOBAL_OPTION_SCHEMA,
4
- formatCliCommandUsage,
5
- listCliCommandDefinitions
6
- } from "./chunk-7RIGZB7N.js";
7
- import "./chunk-MUMPWI4O.js";
8
- import "./chunk-UACZUFIA.js";
9
-
10
- // src/cli/help.ts
11
- function printHelp() {
12
- console.log(formatCliHelp());
13
- }
14
- function formatCliHelp() {
15
- const lines = [
16
- "OpenPond CLI",
17
- "",
18
- "Usage:",
19
- " openpond [--no-open] [--hostname HOST] [--port PORT]",
20
- " openpond <command> [options] [-- passthrough...]",
21
- " openpond --version",
22
- "",
23
- "Commands:"
24
- ];
25
- for (const definition of listCliCommandDefinitions()) {
26
- const aliases = definition.aliases?.length ? ` (aliases: ${definition.aliases.join(", ")})` : "";
27
- lines.push(` ${definition.usage}${aliases}`);
28
- for (const usage of definition.usages ?? []) lines.push(` ${usage}`);
29
- }
30
- lines.push("", "Global options:");
31
- for (const [name, kind] of Object.entries(CLI_GLOBAL_OPTION_SCHEMA).sort(
32
- ([left], [right]) => left.localeCompare(right)
33
- )) {
34
- const flag = name.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);
35
- lines.push(kind === "boolean" ? ` --${flag}` : ` --${flag} <${kind}>`);
36
- }
37
- lines.push(
38
- "",
39
- "Run `openpond <command> --help` for the selected command schema.",
40
- "Arguments after `--` are passed through without option parsing."
41
- );
42
- return lines.join("\n");
43
- }
44
- function formatCliCommandReference() {
45
- const sections = listCliCommandDefinitions().map(
46
- (definition) => `## ${definition.name}
47
-
48
- \`\`\`text
49
- ${formatCliCommandUsage(definition)}
50
- \`\`\``
51
- );
52
- return [
53
- "# OpenPond CLI command reference",
54
- "",
55
- "<!-- Generated by `pnpm --dir apps/cli docs:commands`; do not edit by hand. -->",
56
- "",
57
- "Parsing, aliases, command help, and this reference use the same authoritative registry.",
58
- "",
59
- ...sections,
60
- ""
61
- ].join("\n");
62
- }
63
- export {
64
- formatCliCommandReference,
65
- formatCliHelp,
66
- printHelp
67
- };
@@ -1,169 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import {
3
- getOpChatModel,
4
- listOpChatModels,
5
- resolveOpChatApiBaseUrl,
6
- runOpChatSmoke,
7
- sendHostedChatTurn,
8
- streamHostedChatTurn
9
- } from "./chunk-BVY5JYM6.js";
10
- import {
11
- ensureApiKey
12
- } from "./chunk-3VEYNDHN.js";
13
- import {
14
- loadConfig
15
- } from "./chunk-FJ2JGB2N.js";
16
- import {
17
- resolveApiBaseUrlOption,
18
- resolveBaseUrl,
19
- resolveChatApiBaseUrlOption
20
- } from "./chunk-SMNFI2FU.js";
21
- import "./chunk-KSRWKXRB.js";
22
- import "./chunk-PS37DB5F.js";
23
- import "./chunk-4KA25HUP.js";
24
- import "./chunk-ZNQEROWP.js";
25
- import "./chunk-7RIGZB7N.js";
26
- import "./chunk-4L3ZJS2T.js";
27
- import "./chunk-JTHL5XJ2.js";
28
- import "./chunk-FQS2QL5F.js";
29
- import {
30
- parseBooleanOption
31
- } from "./chunk-MUMPWI4O.js";
32
- import "./chunk-UACZUFIA.js";
33
-
34
- // src/cli/opchat.ts
35
- import { randomUUID } from "node:crypto";
36
- async function runOpChatCommand(options, rest) {
37
- const subcommand = rest[0] || "smoke";
38
- const config = await loadConfig();
39
- const apiKey = await ensureApiKey(config, resolveBaseUrl(config));
40
- const apiBaseUrl = resolveOpChatCliBaseUrl(config, options);
41
- if (subcommand === "provider-catalog" || subcommand === "providers-catalog" || subcommand === "catalog") {
42
- const catalog = await getOpChatProviderCatalog({ apiBaseUrl, token: apiKey });
43
- console.log(JSON.stringify(catalog, null, 2));
44
- return;
45
- }
46
- if (subcommand === "models" || subcommand === "model-list") {
47
- const models = await listOpChatModels({ apiBaseUrl, token: apiKey });
48
- console.log(JSON.stringify(models, null, 2));
49
- return;
50
- }
51
- if (subcommand === "model" || subcommand === "model-get") {
52
- const model = rest[1] || optionString(options, "model");
53
- if (!model) {
54
- throw new Error("usage: opchat model <model>");
55
- }
56
- const result = await getOpChatModel({ apiBaseUrl, token: apiKey, model });
57
- console.log(JSON.stringify(result, null, 2));
58
- return;
59
- }
60
- if (subcommand === "chat") {
61
- const model = optionString(options, "model") || "openpond-chat";
62
- const message = optionString(options, "message") || optionString(options, "prompt") || "Reply with a short confirmation from OpChat.";
63
- const stream = parseBooleanOption(options.stream);
64
- if (!stream) {
65
- const completion = await sendHostedChatTurn({
66
- apiBaseUrl,
67
- token: apiKey,
68
- model,
69
- messages: [{ role: "user", content: message }]
70
- });
71
- console.log(JSON.stringify(completion, null, 2));
72
- return;
73
- }
74
- let text = "";
75
- let finishReason = null;
76
- let usage = null;
77
- for await (const chunk of streamHostedChatTurn({
78
- apiBaseUrl,
79
- token: apiKey,
80
- model,
81
- messages: [{ role: "user", content: message }]
82
- })) {
83
- if (chunk.type === "text_delta") {
84
- text += chunk.text;
85
- process.stdout.write(chunk.text);
86
- } else if (chunk.type === "finish") {
87
- finishReason = chunk.finishReason;
88
- } else if (chunk.type === "usage") {
89
- usage = chunk.usage;
90
- }
91
- }
92
- process.stdout.write("\n");
93
- console.log(JSON.stringify({ finishReason, usage, text }, null, 2));
94
- return;
95
- }
96
- if (subcommand === "smoke") {
97
- const summary = await runOpChatSmoke({
98
- apiBaseUrl,
99
- token: apiKey,
100
- defaultModel: optionString(options, "model") || void 0,
101
- compatibilityModel: optionString(options, "compatibilityModel") || optionString(options, "compatModel") || void 0,
102
- skipStream: parseBooleanOption(options.skipStream),
103
- skipTool: parseBooleanOption(options.skipTool),
104
- log: (line) => console.log(line)
105
- });
106
- if (parseBooleanOption(options.json)) {
107
- console.log(JSON.stringify(summary, null, 2));
108
- }
109
- return;
110
- }
111
- throw new Error(
112
- "usage: opchat <provider-catalog|models|model|chat|smoke> [--opchat-api-base-url <url>]"
113
- );
114
- }
115
- async function getOpChatProviderCatalog(options) {
116
- const apiBaseUrl = options.apiBaseUrl.trim().replace(/\/+$/, "");
117
- if (!apiBaseUrl) throw new Error("OpChat API base URL is required.");
118
- const token = options.token.trim();
119
- if (!token) throw new Error("OpenPond API key is required.");
120
- const response = await fetch(`${apiBaseUrl}/provider-catalog`, {
121
- method: "GET",
122
- headers: {
123
- Authorization: `Bearer ${token}`,
124
- Accept: "application/json",
125
- "Content-Type": "application/json",
126
- "x-openpond-client": "openpond-cli",
127
- "x-openpond-request-id": randomUUID()
128
- }
129
- });
130
- if (!response.ok) {
131
- throw new Error(
132
- `Hosted provider catalog failed: ${response.status} ${await readResponseError(response)}`
133
- );
134
- }
135
- return response.json();
136
- }
137
- async function readResponseError(response) {
138
- const text = await response.text().catch(() => "");
139
- if (!text) return response.statusText || `HTTP ${response.status}`;
140
- try {
141
- const payload = JSON.parse(text);
142
- if (typeof payload.message === "string") return payload.message;
143
- if (typeof payload.error === "string") return payload.error;
144
- if (payload.error && typeof payload.error === "object" && !Array.isArray(payload.error)) {
145
- const error = payload.error;
146
- return [error.code, error.message].filter(Boolean).join(": ") || text;
147
- }
148
- return text;
149
- } catch {
150
- return text;
151
- }
152
- }
153
- function resolveOpChatCliBaseUrl(config, options) {
154
- const explicit = optionString(options, "opchatApiBaseUrl") || optionString(options, "opchatApiBaseurl") || optionString(options, "opChatApiBaseUrl") || optionString(options, "opChatApiBaseurl") || optionString(options, "opchatApiUrl") || optionString(options, "opChatApiUrl");
155
- if (explicit) {
156
- return resolveOpChatApiBaseUrl({ opChatApiBaseUrl: explicit });
157
- }
158
- return resolveOpChatApiBaseUrl({
159
- apiBaseUrl: resolveApiBaseUrlOption(options) || config.apiBaseUrl,
160
- chatApiBaseUrl: resolveChatApiBaseUrlOption(options) || config.chatApiBaseUrl
161
- });
162
- }
163
- function optionString(options, key) {
164
- const value = options[key];
165
- return typeof value === "string" ? value.trim() : "";
166
- }
167
- export {
168
- runOpChatCommand
169
- };