openpond 0.2.0 → 0.2.1

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-QP3NMDK4.js +2 -0
  2. package/dist/chunks/app-layer-N7VFRVJ2.js +3 -0
  3. package/dist/chunks/app-server-runtime-OCLPUI7F.js +2 -0
  4. package/dist/chunks/apps-AMG75TI4.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-5BBVEWG3.js +2 -0
  10. package/dist/chunks/chunk-5O7ZVCMV.js +6 -0
  11. package/dist/chunks/chunk-6FA3GG5B.js +33 -0
  12. package/dist/chunks/chunk-6MI4KKWF.js +2 -0
  13. package/dist/chunks/chunk-BBG546O6.js +6 -0
  14. package/dist/chunks/chunk-BX4J2VDU.js +2 -0
  15. package/dist/chunks/chunk-BZMVB3GS.js +2 -0
  16. package/dist/chunks/chunk-C5LOZSVS.js +2 -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-ES2ISFJC.js +66 -0
  21. package/dist/chunks/chunk-F65NIZLM.js +2199 -0
  22. package/dist/chunks/chunk-FGJ5LFPL.js +5 -0
  23. package/dist/chunks/chunk-FTQLQJQV.js +2 -0
  24. package/dist/chunks/chunk-FY7OQ5RK.js +24 -0
  25. package/dist/chunks/chunk-FYCJSUFV.js +53 -0
  26. package/dist/chunks/chunk-GLUWATL5.js +2 -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-IR3YJWPW.js +7 -0
  31. package/dist/chunks/chunk-KU7QOHFT.js +2872 -0
  32. package/dist/chunks/chunk-KV553EWX.js +16 -0
  33. package/dist/chunks/chunk-MGN6GLNZ.js +2 -0
  34. package/dist/chunks/chunk-OG5Q6NXK.js +28 -0
  35. package/dist/chunks/chunk-OGPHXXCD.js +1 -0
  36. package/dist/chunks/chunk-PI36UHRA.js +18 -0
  37. package/dist/chunks/chunk-RWSAGQTP.js +2 -0
  38. package/dist/chunks/chunk-SAE4OIPC.js +2 -0
  39. package/dist/chunks/chunk-SDO4FC4Q.js +2 -0
  40. package/dist/chunks/chunk-UKUVMXOW.js +12 -0
  41. package/dist/chunks/chunk-VCLCFK3O.js +36 -0
  42. package/dist/chunks/chunk-VYUMTRB3.js +5 -0
  43. package/dist/chunks/chunk-X37KMV27.js +1 -0
  44. package/dist/chunks/chunk-XDHAGACI.js +3 -0
  45. package/dist/chunks/chunk-XEOEKFG6.js +71 -0
  46. package/dist/chunks/chunk-ZF7TEGY5.js +5 -0
  47. package/dist/chunks/chunk-ZVOO7FKM.js +2 -0
  48. package/dist/chunks/cli-M2FG7SSI.js +2 -0
  49. package/dist/chunks/configuration-command-XBKBIZBO.js +2 -0
  50. package/dist/chunks/continual-D75WA7E7.js +7 -0
  51. package/dist/chunks/core-commands-LUZVWXQR.js +2 -0
  52. package/dist/chunks/database-X2CUV732.js +2 -0
  53. package/dist/chunks/desktop-test-KGC4JVJ7.js +3 -0
  54. package/dist/chunks/dist-NKLXFA37.js +2 -0
  55. package/dist/chunks/extension-NQ7N5LEY.js +5 -0
  56. package/dist/chunks/help-MWK66XZK.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-XJZA3QKZ.js +3 -0
  60. package/dist/chunks/organizations-UECDFEYE.js +2 -0
  61. package/dist/chunks/profile-KUMIZURM.js +3 -0
  62. package/dist/chunks/project-agent-NILMJHLV.js +2 -0
  63. package/dist/chunks/sandbox-command-QHH65OSE.js +2 -0
  64. package/dist/chunks/sandbox-template-N7I63PNU.js +10 -0
  65. package/dist/chunks/src-724HF43W.js +82 -0
  66. package/dist/chunks/src-VTKTTKQO.js +319 -0
  67. package/dist/chunks/taskset-PISBOILQ.js +2 -0
  68. package/dist/chunks/teams-bot-UV4RU53M.js +3 -0
  69. package/dist/chunks/training-2NDOWH5S.js +2 -0
  70. package/dist/chunks/workspaces-XXT4KUD3.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-DxecRQUL.js +176 -0
  75. package/dist/web/assets/AppDialog-B65Eo3gp.js +1 -0
  76. package/dist/web/assets/AppTerminalPanel-B2EKQM7W.js +2 -0
  77. package/dist/web/assets/{AppsView-B1NUuAIf.js → AppsView-BBoVe7s2.js} +1 -1
  78. package/dist/web/assets/{BrowserSidebar-DOvYxXeP.js → BrowserSidebar-CSM1atSJ.js} +1 -1
  79. package/dist/web/assets/{CartesianChart-pOrYpzBr.js → CartesianChart-CJKfXiEG.js} +1 -1
  80. package/dist/web/assets/{CollaborationTabs-CgbR-MBJ.js → CollaborationTabs-BMZamWFC.js} +1 -1
  81. package/dist/web/assets/{CommandMenu-CrIr4qUX.js → CommandMenu-B3U1z2eo.js} +1 -1
  82. package/dist/web/assets/{CommunityView-CvAVQ_HZ.js → CommunityView-CTyRUcfy.js} +1 -1
  83. package/dist/web/assets/{ComposerCreateImproveStrip-DybcKwwd.js → ComposerCreateImproveStrip-D7usvRtK.js} +1 -1
  84. package/dist/web/assets/GetStartedView-Ibu7oKWJ.js +1 -0
  85. package/dist/web/assets/HostedModelLearningReview-qnzIkT70.js +1 -0
  86. package/dist/web/assets/HostedModelLearningSettings--PKjpYsy.js +1 -0
  87. package/dist/web/assets/LabModelVersionDetailPage-s9uUN6fV.js +1 -0
  88. package/dist/web/assets/{LabSkillSidebar-CuaYrtiu.js → LabSkillSidebar-BKYseMiJ.js} +1 -1
  89. package/dist/web/assets/LabsRoute-C1FWCoYb.css +1 -0
  90. package/dist/web/assets/LabsRoute-DoRs0K6v.js +32 -0
  91. package/dist/web/assets/MainChatThread-DvuyMcMB.js +2 -0
  92. package/dist/web/assets/MainPane-BWwcxgHD.js +8 -0
  93. package/dist/web/assets/{MarkdownText-DOlVQR8a.js → MarkdownText-D8XC5UT_.js} +1 -1
  94. package/dist/web/assets/{Messages-DMubppta.js → Messages-e4A8JUjD.js} +6 -6
  95. package/dist/web/assets/{NativeSkillSidebar-DSFwZ-od.js → NativeSkillSidebar-D2Joh8XB.js} +1 -1
  96. package/dist/web/assets/{NewExperienceSwitcher-Dj0ePIJ-.js → NewExperienceSwitcher-CzGebt2E.js} +1 -1
  97. package/dist/web/assets/{NewProjectDialog-B8NQV-Ji.js → NewProjectDialog-CdMTSxUE.js} +1 -1
  98. package/dist/web/assets/{OutputsPage-D_LDYTgV.js → OutputsPage-m7cSb8dW.js} +1 -1
  99. package/dist/web/assets/{ProjectsPage-xjDYPc_W.js → ProjectsPage-C9mz8W1g.js} +1 -1
  100. package/dist/web/assets/RightChatPanelStack-B4LEqKEj.js +1 -0
  101. package/dist/web/assets/{RightSidebarHomePanel-j0VckZUu.js → RightSidebarHomePanel-DOeUsH7h.js} +1 -1
  102. package/dist/web/assets/{ScheduledWorkPage-1aT4bBY-.js → ScheduledWorkPage-UXZSSWgA.js} +1 -1
  103. package/dist/web/assets/{SettingsView-BSpuMDpv.js → SettingsView-CQm1ai73.js} +7 -7
  104. package/dist/web/assets/TeamChatView-C4haojB7.js +3 -0
  105. package/dist/web/assets/{TerminalOverlay-CrSwUk2d.js → TerminalOverlay-p2GZsuyQ.js} +3 -3
  106. package/dist/web/assets/{TrainingCreationPanel-B4HMRwUg.js → TrainingCreationPanel-BYJSlO8X.js} +1 -1
  107. package/dist/web/assets/{TrainingDraftPanel-D4r1tN3I.js → TrainingDraftPanel-DR5KlayH.js} +1 -1
  108. package/dist/web/assets/{UsageSettingsSection-2aymqwIM.js → UsageSettingsSection-BQToNXE4.js} +5 -5
  109. package/dist/web/assets/{WorkSidebarPanel-B0X0OiR6.js → WorkSidebarPanel--EeytWeg.js} +1 -1
  110. package/dist/web/assets/WorkspaceDiffPanel-BrovSYhn.js +14 -0
  111. package/dist/web/assets/{WorkspaceEnvironmentMenu-OAfMEt7L.js → WorkspaceEnvironmentMenu-l-keRgvj.js} +3 -3
  112. package/dist/web/assets/{WorkspaceGitDialogs-YxcPH2Rq.js → WorkspaceGitDialogs-aicWzaZu.js} +1 -1
  113. package/dist/web/assets/{WorkspaceMonacoEditor-COKTiQZl.js → WorkspaceMonacoEditor-CO_E74jM.js} +36 -36
  114. package/dist/web/assets/{arrow-up-right-_TX-awvK.js → arrow-up-right-rwPXNfVn.js} +1 -1
  115. package/dist/web/assets/chat-file-links-B3jDstSC.js +1 -0
  116. package/dist/web/assets/chevron-up-D089nvYQ.js +1 -0
  117. package/dist/web/assets/{clipboard-CyRSS8Sy.js → clipboard-DwEExyU4.js} +1 -1
  118. package/dist/web/assets/{cloud-upload-uBJBUYTy.js → cloud-upload-D2he0-vQ.js} +1 -1
  119. package/dist/web/assets/{cssMode-BrXSsZYs.js → cssMode-DS4k0NcI.js} +1 -1
  120. package/dist/web/assets/{folder-open-DktdZNW7.js → folder-open-CAOLduKD.js} +1 -1
  121. package/dist/web/assets/{folder-plus-DO06i9Vo.js → folder-plus-D56MrxVT.js} +1 -1
  122. package/dist/web/assets/{git-commit-horizontal-zFSIkPs7.js → git-commit-horizontal-CeNM0oKJ.js} +1 -1
  123. package/dist/web/assets/{htmlMode-X9UMFkjt.js → htmlMode-Xkni5erh.js} +1 -1
  124. package/dist/web/assets/{index-ByQIHpc9.css → index-BGMzUaup.css} +1 -1
  125. package/dist/web/assets/{index-UOGdfLzi.js → index-KwyAyscP.js} +1 -1
  126. package/dist/web/assets/{info-BEJXUqCD.js → info-CcrBaEE_.js} +1 -1
  127. package/dist/web/assets/{jsonMode-DIsB-j2E.js → jsonMode-C4YPbQB7.js} +1 -1
  128. package/dist/web/assets/{lspLanguageFeatures-CmZ17KpA.js → lspLanguageFeatures-CF5oMTz6.js} +1 -1
  129. package/dist/web/assets/{minimize-2-DumTpFtE.js → minimize-2-DzHQnInk.js} +1 -1
  130. package/dist/web/assets/{monaco.contribution-DJ_NmcHu.js → monaco.contribution-0EN4mGCC.js} +2 -2
  131. package/dist/web/assets/{monaco.contribution-YVDfJcG4.js → monaco.contribution-B4qcTP0w.js} +2 -2
  132. package/dist/web/assets/{monaco.contribution-LZEujgny.js → monaco.contribution-CJK_NrBm.js} +2 -2
  133. package/dist/web/assets/{monaco.contribution-D6w5PJji.js → monaco.contribution-CkPGKNd-.js} +2 -2
  134. package/dist/web/assets/{play-CLFeH7CU.js → play-p3-AMTPL.js} +1 -1
  135. package/dist/web/assets/{python-Djbda_qZ.js → python-B0kpTxAZ.js} +1 -1
  136. package/dist/web/assets/{refresh-cw-B4IpQ_7Q.js → refresh-cw-_jbTIzzr.js} +1 -1
  137. package/dist/web/assets/{save-BbTHztnA.js → save-Cy6hEotx.js} +1 -1
  138. package/dist/web/assets/{square-BJrVbmz6.js → square-DKQkcrOH.js} +1 -1
  139. package/dist/web/assets/{toggleHighContrast-BopU5W9S.js → toggleHighContrast-Bnk1VVVq.js} +1 -1
  140. package/dist/web/assets/{tsMode-CH_0_YDX.js → tsMode-BDrSVy7V.js} +1 -1
  141. package/dist/web/assets/{upload-UumVeufu.js → upload-COn0my_O.js} +1 -1
  142. package/dist/web/assets/{useLocalAgentSchedules-BRa23U7O.js → useLocalAgentSchedules-iZNB4Oee.js} +1 -1
  143. package/dist/web/assets/{wifi-off-BWJWivn6.js → wifi-off-Cqt-ZLXY.js} +1 -1
  144. package/dist/web/assets/{workers-pTe8RvSI.js → workers-hu0Ym93h.js} +1 -1
  145. package/dist/web/assets/{yaml-DNLASORn.js → yaml-D-JLDGL6.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,429 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import {
3
- consumeStream,
4
- formatStreamItem
5
- } from "./chunk-W5GKHH77.js";
6
- import {
7
- ensureApiKey,
8
- fetchAppsWithCache,
9
- fetchToolsWithCache,
10
- normalizeRepoName,
11
- pollDeploymentLogs,
12
- resolveAppTarget
13
- } from "./chunk-3VEYNDHN.js";
14
- import {
15
- createAgentFromPrompt,
16
- deployApp,
17
- executeUserTool,
18
- getAppEnvironment,
19
- getAppRuntimeSummary,
20
- getUserPerformance,
21
- loadConfig,
22
- runAssistantMode,
23
- submitBacktestDetail,
24
- submitBacktestTx,
25
- updateAppCodeVisibility,
26
- updateAppEnvironment
27
- } from "./chunk-FJ2JGB2N.js";
28
- import {
29
- resolveBaseUrl,
30
- resolvePublicApiBaseUrl
31
- } from "./chunk-SMNFI2FU.js";
32
- import "./chunk-KSRWKXRB.js";
33
- import "./chunk-PS37DB5F.js";
34
- import "./chunk-4KA25HUP.js";
35
- import "./chunk-ZNQEROWP.js";
36
- import "./chunk-7RIGZB7N.js";
37
- import "./chunk-4L3ZJS2T.js";
38
- import "./chunk-JTHL5XJ2.js";
39
- import "./chunk-FQS2QL5F.js";
40
- import {
41
- parseBooleanOption,
42
- parseJsonOption,
43
- parseTimeOption,
44
- resolveTemplateEnvironment
45
- } from "./chunk-MUMPWI4O.js";
46
- import "./chunk-UACZUFIA.js";
47
-
48
- // src/cli/apps.ts
49
- async function runAppsTools() {
50
- const config = await loadConfig();
51
- const uiBase = resolveBaseUrl(config);
52
- const apiKey = await ensureApiKey(config, uiBase);
53
- const apiBase = resolvePublicApiBaseUrl(config);
54
- const tools = await fetchToolsWithCache({ apiBase, apiKey });
55
- console.log(JSON.stringify(tools, null, 2));
56
- }
57
- async function runAppsList(options) {
58
- const config = await loadConfig();
59
- const uiBase = resolveBaseUrl(config);
60
- const apiBase = resolvePublicApiBaseUrl(config);
61
- const apiKey = await ensureApiKey(config, uiBase);
62
- const handle = typeof options.handle === "string" ? String(options.handle) : void 0;
63
- const normalizedHandle = handle ? normalizeRepoName(handle) : null;
64
- const forceRefresh = options.refresh !== void 0 ? parseBooleanOption(options.refresh) : void 0;
65
- const apps = await fetchAppsWithCache({
66
- apiBase,
67
- apiKey,
68
- forceRefresh
69
- });
70
- const filtered = normalizedHandle ? apps.filter((app) => {
71
- const candidate = normalizeRepoName(app.handle || app.gitOwner);
72
- return candidate === normalizedHandle;
73
- }) : apps;
74
- if (filtered.length === 0) {
75
- console.log("no apps found");
76
- return;
77
- }
78
- if (parseBooleanOption(options.json)) {
79
- console.log(JSON.stringify({ apps: filtered }, null, 2));
80
- return;
81
- }
82
- for (const app of filtered) {
83
- const owner = app.handle || app.gitOwner || "unknown";
84
- const repo = app.repo || app.gitRepo || app.id;
85
- const status = app.latestDeployment?.status || "no-deploy";
86
- const branch = app.latestDeployment?.gitBranch || app.defaultBranch || "-";
87
- const codeVisibility = app.codeVisibility || "unknown";
88
- const sandbox = app.sandbox ? "yes" : "no";
89
- console.log(
90
- `${owner}/${repo} ${status} ${branch} code=${codeVisibility} sandbox=${sandbox} ${app.id}`
91
- );
92
- }
93
- }
94
- async function runAppsCodeVisibility(options, target) {
95
- const visibility = typeof options.visibility === "string" ? options.visibility.trim() : typeof options.codeVisibility === "string" ? options.codeVisibility.trim() : "";
96
- if (visibility !== "public" && visibility !== "private") {
97
- throw new Error(
98
- "usage: apps code-visibility <handle>/<repo> --visibility public|private"
99
- );
100
- }
101
- const config = await loadConfig();
102
- const uiBase = resolveBaseUrl(config);
103
- const apiBase = resolvePublicApiBaseUrl(config);
104
- const apiKey = await ensureApiKey(config, uiBase);
105
- const { app, handle, repo } = await resolveAppTarget(apiBase, apiKey, target);
106
- const result = await updateAppCodeVisibility(
107
- apiBase,
108
- apiKey,
109
- app.id,
110
- visibility
111
- );
112
- console.log(
113
- `${handle}/${repo} code_visibility=${result.app?.codeVisibility ?? visibility} app_id=${app.id}`
114
- );
115
- }
116
- async function runAppsPerformance(options) {
117
- const config = await loadConfig();
118
- const uiBase = resolveBaseUrl(config);
119
- const apiKey = await ensureApiKey(config, uiBase);
120
- const apiBase = resolvePublicApiBaseUrl(config);
121
- const appId = typeof options.appId === "string" ? String(options.appId) : void 0;
122
- const performance = await getUserPerformance(apiBase, apiKey, { appId });
123
- console.log(JSON.stringify(performance, null, 2));
124
- }
125
- async function runAppsSummary(_options, target) {
126
- const config = await loadConfig();
127
- const uiBase = resolveBaseUrl(config);
128
- const apiBase = resolvePublicApiBaseUrl(config);
129
- const apiKey = await ensureApiKey(config, uiBase);
130
- const { app } = await resolveAppTarget(apiBase, apiKey, target);
131
- const summary = await getAppRuntimeSummary(apiBase, apiKey, app.id);
132
- console.log(JSON.stringify(summary, null, 2));
133
- }
134
- async function runAppsAssistant(options, mode, target, contentParts) {
135
- const prompt = (typeof options.prompt === "string" ? options.prompt : null) || contentParts.join(" ");
136
- if (!prompt.trim()) {
137
- throw new Error(
138
- "usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>"
139
- );
140
- }
141
- const config = await loadConfig();
142
- const uiBase = resolveBaseUrl(config);
143
- const apiBase = resolvePublicApiBaseUrl(config);
144
- const apiKey = await ensureApiKey(config, uiBase);
145
- const { app } = await resolveAppTarget(apiBase, apiKey, target);
146
- const result = await runAssistantMode(apiBase, apiKey, {
147
- appId: app.id,
148
- mode,
149
- prompt: prompt.trim()
150
- });
151
- console.log(JSON.stringify(result, null, 2));
152
- }
153
- async function runAppsAgentCreate(options, contentParts) {
154
- const config = await loadConfig();
155
- const uiBase = resolveBaseUrl(config);
156
- const apiKey = await ensureApiKey(config, uiBase);
157
- const apiBase = resolvePublicApiBaseUrl(config);
158
- const prompt = (typeof options.prompt === "string" ? options.prompt : null) || contentParts.join(" ");
159
- if (!prompt.trim()) {
160
- throw new Error(
161
- "usage: apps agent create --prompt <text> [--team-id <id>]"
162
- );
163
- }
164
- const templateRepoUrl = typeof options.templateRepoUrl === "string" ? options.templateRepoUrl : void 0;
165
- const templateBranch = typeof options.templateBranch === "string" ? options.templateBranch : void 0;
166
- const templateLocalPath = typeof options.templateLocalPath === "string" ? options.templateLocalPath : void 0;
167
- const teamId = typeof options.teamId === "string" && options.teamId.trim() ? options.teamId.trim() : void 0;
168
- if (templateLocalPath && String(templateLocalPath).trim().length > 0) {
169
- throw new Error("templateLocalPath is not supported; use templateRepoUrl");
170
- }
171
- const envVars = typeof options.env === "string" ? parseJsonOption(options.env, "env") : void 0;
172
- if (envVars) {
173
- if (typeof envVars !== "object" || Array.isArray(envVars)) {
174
- throw new Error("env must be a JSON object");
175
- }
176
- for (const [key, value] of Object.entries(envVars)) {
177
- if (typeof value !== "string") {
178
- throw new Error(`env value for ${key} must be a string`);
179
- }
180
- }
181
- }
182
- const template = templateRepoUrl || templateBranch || envVars ? {
183
- templateRepoUrl,
184
- templateBranch,
185
- envVars
186
- } : void 0;
187
- const deployEnvironment = typeof options.deployEnvironment === "string" ? options.deployEnvironment === "preview" ? "preview" : "production" : void 0;
188
- const deployDisabled = options.deployDisabled !== void 0 ? parseBooleanOption(options.deployDisabled) : void 0;
189
- const streamDeployLogs = options.streamDeployLogs !== void 0 ? parseBooleanOption(options.streamDeployLogs) : true;
190
- const response = await createAgentFromPrompt(apiBase, apiKey, {
191
- prompt: prompt.trim(),
192
- ...teamId ? { teamId } : {},
193
- ...template ? { template } : {},
194
- ...deployEnvironment ? { deployEnvironment } : {},
195
- ...deployDisabled !== void 0 ? { deployDisabled } : {},
196
- streamDeployLogs
197
- });
198
- if (!response.ok) {
199
- const text = await response.text().catch(() => "");
200
- throw new Error(`agent create failed: ${response.status} ${text}`);
201
- }
202
- let conversationId = null;
203
- let appId = null;
204
- let deploymentId = null;
205
- await consumeStream(response, {
206
- onConversationId: (id) => {
207
- conversationId = id;
208
- },
209
- onItems: (items) => {
210
- for (const item of items) {
211
- const line = formatStreamItem(item);
212
- if (line) {
213
- console.log(line);
214
- }
215
- const typed = item;
216
- if (!appId && typeof typed.appId === "string") {
217
- appId = typed.appId;
218
- }
219
- if (!deploymentId && typeof typed.deploymentId === "string") {
220
- deploymentId = typed.deploymentId;
221
- }
222
- }
223
- }
224
- });
225
- if (conversationId) {
226
- console.log(`conversation_id: ${conversationId}`);
227
- }
228
- if (appId) {
229
- console.log(`app_id: ${appId}`);
230
- }
231
- if (deploymentId) {
232
- console.log(`deployment_id: ${deploymentId}`);
233
- }
234
- try {
235
- await fetchAppsWithCache({ apiBase, apiKey, forceRefresh: true });
236
- await fetchToolsWithCache({ apiBase, apiKey, forceRefresh: true });
237
- } catch (error) {
238
- console.warn("cache refresh failed", error);
239
- }
240
- }
241
- async function runAppsToolsExecute(options, appId, deploymentId, toolName) {
242
- const config = await loadConfig();
243
- const uiBase = resolveBaseUrl(config);
244
- const apiKey = await ensureApiKey(config, uiBase);
245
- const apiBase = resolvePublicApiBaseUrl(config);
246
- const methodRaw = typeof options.method === "string" ? String(options.method).toUpperCase() : void 0;
247
- const method = methodRaw && ["GET", "POST", "PUT", "DELETE"].includes(methodRaw) ? methodRaw : void 0;
248
- if (methodRaw && !method) {
249
- throw new Error("method must be GET, POST, PUT, or DELETE");
250
- }
251
- const body = typeof options.body === "string" ? parseJsonOption(String(options.body), "body") : void 0;
252
- const headers = typeof options.headers === "string" ? parseJsonOption(String(options.headers), "headers") : void 0;
253
- const scheduleId = typeof options.scheduleId === "string" ? String(options.scheduleId) : void 0;
254
- const notifyEmail = parseBooleanOption(options.notifyEmail);
255
- const withSummary = parseBooleanOption(options.summary) || parseBooleanOption(options.withSummary);
256
- const result = await executeUserTool(apiBase, apiKey, {
257
- appId,
258
- deploymentId,
259
- toolName,
260
- scheduleId,
261
- method,
262
- body,
263
- headers,
264
- notifyEmail: notifyEmail || void 0
265
- });
266
- console.log(JSON.stringify(result, null, 2));
267
- if (withSummary && result.ok) {
268
- const summary = await getAppRuntimeSummary(apiBase, apiKey, appId);
269
- console.log(JSON.stringify({ summary }, null, 2));
270
- }
271
- }
272
- async function runAppsEnvSet(options, target) {
273
- const rawEnv = typeof options.env === "string" ? options.env : typeof options.vars === "string" ? options.vars : typeof options.envVars === "string" ? options.envVars : null;
274
- if (!rawEnv) {
275
- throw new Error("usage: apps env set <handle>/<repo> --env <json>");
276
- }
277
- const parsed = parseJsonOption(rawEnv, "env");
278
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
279
- throw new Error("env must be a JSON object");
280
- }
281
- const envVars = {};
282
- for (const [key, value] of Object.entries(
283
- parsed
284
- )) {
285
- if (typeof value !== "string") {
286
- throw new Error(`env value for ${key} must be a string`);
287
- }
288
- if (!key.startsWith("OPENTOOL_PUBLIC_")) {
289
- throw new Error("only OPENTOOL_PUBLIC_ env vars can be set");
290
- }
291
- envVars[key] = value;
292
- }
293
- const config = await loadConfig();
294
- const uiBase = resolveBaseUrl(config);
295
- const apiBase = resolvePublicApiBaseUrl(config);
296
- const apiKey = await ensureApiKey(config, uiBase);
297
- const { app } = await resolveAppTarget(apiBase, apiKey, target);
298
- const result = await updateAppEnvironment(apiBase, apiKey, app.id, {
299
- envVars
300
- });
301
- console.log(JSON.stringify(result, null, 2));
302
- }
303
- async function runAppsEnvGet(_options, target) {
304
- const config = await loadConfig();
305
- const uiBase = resolveBaseUrl(config);
306
- const apiBase = resolvePublicApiBaseUrl(config);
307
- const apiKey = await ensureApiKey(config, uiBase);
308
- const { app } = await resolveAppTarget(apiBase, apiKey, target);
309
- const result = await getAppEnvironment(apiBase, apiKey, app.id);
310
- console.log(JSON.stringify(result, null, 2));
311
- }
312
- async function runAppsDeploy(options, target) {
313
- const config = await loadConfig();
314
- const uiBase = resolveBaseUrl(config);
315
- const apiBase = resolvePublicApiBaseUrl(config);
316
- const apiKey = await ensureApiKey(config, uiBase);
317
- const { app, handle, repo } = await resolveAppTarget(apiBase, apiKey, target);
318
- const envRaw = typeof options.env === "string" ? options.env : typeof options.environment === "string" ? options.environment : void 0;
319
- const environment = resolveTemplateEnvironment(envRaw);
320
- const result = await deployApp(apiBase, apiKey, app.id, { environment });
321
- console.log(JSON.stringify(result, null, 2));
322
- const shouldWatch = parseBooleanOption(options.watch) || parseBooleanOption(options.wait) || parseBooleanOption(options.follow);
323
- if (!shouldWatch) return;
324
- await pollDeploymentLogs({
325
- baseUrl: apiBase,
326
- apiKey,
327
- deploymentId: result.deploymentId,
328
- prefix: `[${handle}/${repo}] `,
329
- intervalMs: options.interval ? Number(options.interval) : void 0,
330
- timeoutMs: options.timeout ? Number(options.timeout) : void 0
331
- });
332
- }
333
- function resolveBacktestEventsParams(options) {
334
- let params = {};
335
- if (typeof options.params === "string") {
336
- const parsed = parseJsonOption(String(options.params), "params");
337
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
338
- throw new Error("params must be a JSON object");
339
- }
340
- for (const [key, value] of Object.entries(
341
- parsed
342
- )) {
343
- if (value === void 0) continue;
344
- params[key] = typeof value === "string" ? value : JSON.stringify(value);
345
- }
346
- }
347
- const addParam = (key, value) => {
348
- if (value === void 0 || value === "") return;
349
- params[key] = value;
350
- };
351
- addParam(
352
- "source",
353
- typeof options.source === "string" ? options.source.trim() : void 0
354
- );
355
- addParam(
356
- "symbol",
357
- typeof options.symbol === "string" ? options.symbol.trim() : void 0
358
- );
359
- addParam(
360
- "cursor",
361
- typeof options.cursor === "string" ? options.cursor.trim() : void 0
362
- );
363
- addParam(
364
- "status",
365
- typeof options.status === "string" ? options.status.trim() : void 0
366
- );
367
- addParam(
368
- "backtestRunId",
369
- typeof options.runId === "string" ? options.runId.trim() : typeof options.backtestRunId === "string" ? options.backtestRunId.trim() : void 0
370
- );
371
- addParam("since", parseTimeOption(options.since, "since"));
372
- addParam("until", parseTimeOption(options.until, "until"));
373
- if (typeof options.limit === "string" && options.limit.trim().length > 0) {
374
- const parsed = Number.parseInt(options.limit, 10);
375
- if (!Number.isFinite(parsed)) {
376
- throw new Error("limit must be a number");
377
- }
378
- addParam("limit", String(parsed));
379
- }
380
- return Object.keys(params).length ? params : void 0;
381
- }
382
- async function runBacktestEvents(options, target) {
383
- const config = await loadConfig();
384
- const uiBase = resolveBaseUrl(config);
385
- const apiKey = await ensureApiKey(config, uiBase);
386
- const apiBase = resolvePublicApiBaseUrl(config);
387
- const { app } = await resolveAppTarget(apiBase, apiKey, target);
388
- const query = {
389
- ...resolveBacktestEventsParams(options) ?? {},
390
- appId: app.id
391
- };
392
- const result = await submitBacktestTx(apiBase, apiKey, {
393
- method: "GET",
394
- query
395
- });
396
- console.log(JSON.stringify(result, null, 2));
397
- }
398
- async function runBacktestGet(options, target) {
399
- const runId = typeof options.runId === "string" ? options.runId.trim() : typeof options.backtestRunId === "string" ? options.backtestRunId.trim() : "";
400
- if (!runId) {
401
- throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");
402
- }
403
- const config = await loadConfig();
404
- const uiBase = resolveBaseUrl(config);
405
- const apiKey = await ensureApiKey(config, uiBase);
406
- const apiBase = resolvePublicApiBaseUrl(config);
407
- const { app } = await resolveAppTarget(apiBase, apiKey, target);
408
- const result = await submitBacktestDetail(apiBase, apiKey, {
409
- appId: app.id,
410
- runId
411
- });
412
- console.log(JSON.stringify(result, null, 2));
413
- }
414
- export {
415
- resolveBacktestEventsParams,
416
- runAppsAgentCreate,
417
- runAppsAssistant,
418
- runAppsCodeVisibility,
419
- runAppsDeploy,
420
- runAppsEnvGet,
421
- runAppsEnvSet,
422
- runAppsList,
423
- runAppsPerformance,
424
- runAppsSummary,
425
- runAppsTools,
426
- runAppsToolsExecute,
427
- runBacktestEvents,
428
- runBacktestGet
429
- };