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,669 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import {
3
- DEFAULT_CACHE_TTL_MS,
4
- SANDBOX_RUNTIME_PROFILE_IDS,
5
- getCachedApps,
6
- getCachedTools,
7
- getDeploymentLogs,
8
- getDeploymentStatus,
9
- listApps,
10
- listUserTools,
11
- loadConfig,
12
- saveGlobalConfig,
13
- setCachedApps,
14
- setCachedTools
15
- } from "./chunk-FJ2JGB2N.js";
16
- import {
17
- mapUiBaseToApiBase,
18
- resolveBaseUrl,
19
- resolveSandboxApiUrlOption
20
- } from "./chunk-SMNFI2FU.js";
21
- import {
22
- DEFAULT_OPENPOND_API_BASE_URL,
23
- DEFAULT_OPENPOND_WEB_BASE_URL
24
- } from "./chunk-KSRWKXRB.js";
25
- import {
26
- createOpenPondSandboxClient
27
- } from "./chunk-JTHL5XJ2.js";
28
- import {
29
- parseBooleanOption
30
- } from "./chunk-MUMPWI4O.js";
31
-
32
- // src/cli/common/auth.ts
33
- import { stdin as input, stdout as output } from "node:process";
34
- import { createInterface } from "node:readline/promises";
35
- var UI_API_KEY_URL = `${DEFAULT_OPENPOND_WEB_BASE_URL}/settings/api-keys`;
36
- function resolveApiKey(config) {
37
- const envKey = process.env.OPENPOND_API_KEY?.trim();
38
- if (envKey) return envKey;
39
- const stored = config.apiKey?.trim();
40
- if (stored) return stored;
41
- const legacy = config.token?.trim();
42
- if (legacy && legacy.startsWith("opk_")) return legacy;
43
- return null;
44
- }
45
- async function promptForApiKey() {
46
- if (!input.isTTY || !output.isTTY) {
47
- throw new Error(
48
- "OpenPond API key is required in non-interactive mode. Set OPENPOND_API_KEY or run `openpond login` in a terminal."
49
- );
50
- }
51
- console.log("Open the OpenPond UI to create an API key:");
52
- console.log(UI_API_KEY_URL);
53
- const rl = createInterface({ input, output });
54
- try {
55
- const value = (await rl.question("Paste your OpenPond API key: ")).trim();
56
- if (!value) {
57
- throw new Error("API key is required");
58
- }
59
- if (!value.startsWith("opk_")) {
60
- console.log("warning: API keys usually start with opk_.");
61
- }
62
- return value;
63
- } finally {
64
- rl.close();
65
- }
66
- }
67
- async function ensureApiKey(config, baseUrl) {
68
- const existing = resolveApiKey(config);
69
- if (existing) return existing;
70
- const apiKey = await promptForApiKey();
71
- await saveGlobalConfig({
72
- apiKey,
73
- baseUrl,
74
- activeProfile: config.activeProfile
75
- });
76
- console.log("Saved account credentials to the encrypted OpenPond credential store.");
77
- return apiKey;
78
- }
79
-
80
- // src/cli/common/repo-format.ts
81
- function resolveRepoUrl(response) {
82
- if (response.repoUrl) return response.repoUrl;
83
- if (response.gitHost && response.gitOwner && response.gitRepo) {
84
- return `https://${response.gitHost}/${response.gitOwner}/${response.gitRepo}.git`;
85
- }
86
- throw new Error("repoUrl missing from API response");
87
- }
88
- function formatTokenizedRepoUrl(repoUrl, token) {
89
- const url = new URL(repoUrl);
90
- const encodedToken = encodeURIComponent(token);
91
- return `${url.protocol}//x-access-token:${encodedToken}@${url.host}${url.pathname}`;
92
- }
93
- function formatTokenizedRepoUrlForPrint(repoUrl) {
94
- const url = new URL(repoUrl);
95
- return `${url.protocol}//x-access-token:$OPENPOND_API_KEY@${url.host}${url.pathname}`;
96
- }
97
- function redactToken(value) {
98
- return value.replace(/x-access-token:[^@]+@/g, "x-access-token:***@");
99
- }
100
- function warnOnRepoHostMismatch(repoUrl) {
101
- const envBase = process.env.OPENPOND_BASE_URL;
102
- if (!envBase) return;
103
- try {
104
- const baseHost = new URL(envBase).hostname;
105
- const repoHost = new URL(repoUrl).hostname;
106
- if (baseHost && repoHost && baseHost !== repoHost) {
107
- console.warn(
108
- `warning: repo host (${repoHost}) does not match OPENPOND_BASE_URL (${baseHost})`
109
- );
110
- console.warn(
111
- "warning: verify your git host configuration matches OPENPOND_BASE_URL."
112
- );
113
- }
114
- } catch {
115
- }
116
- }
117
- function parseHandleRepo(value) {
118
- const parts = value.split("/").filter(Boolean);
119
- if (parts.length !== 2) {
120
- throw new Error("expected <handle>/<repo>");
121
- }
122
- return { handle: parts[0], repo: parts[1] };
123
- }
124
- function normalizeRepoName(value) {
125
- return (value || "").trim().toLowerCase();
126
- }
127
-
128
- // src/cli/common/cache.ts
129
- async function fetchAppsWithCache(params) {
130
- if (!params.forceRefresh) {
131
- const cached = await getCachedApps({
132
- apiBase: params.apiBase,
133
- apiKey: params.apiKey,
134
- ttlMs: DEFAULT_CACHE_TTL_MS
135
- });
136
- if (cached) {
137
- return cached;
138
- }
139
- }
140
- const apps = await listApps(params.apiBase, params.apiKey);
141
- await setCachedApps({
142
- apiBase: params.apiBase,
143
- apiKey: params.apiKey,
144
- apps
145
- });
146
- return apps;
147
- }
148
- async function fetchToolsWithCache(params) {
149
- if (!params.forceRefresh) {
150
- const cached = await getCachedTools({
151
- apiBase: params.apiBase,
152
- apiKey: params.apiKey,
153
- ttlMs: DEFAULT_CACHE_TTL_MS
154
- });
155
- if (cached) {
156
- return cached;
157
- }
158
- }
159
- const result = await listUserTools(params.apiBase, params.apiKey);
160
- const tools = Array.isArray(result.tools) ? result.tools : [];
161
- await setCachedTools({
162
- apiBase: params.apiBase,
163
- apiKey: params.apiKey,
164
- tools
165
- });
166
- return tools;
167
- }
168
- async function resolveAppTarget(apiBase, apiKey, target) {
169
- const { handle, repo } = parseHandleRepo(target);
170
- const apps = await fetchAppsWithCache({ apiBase, apiKey });
171
- const normalizedRepo = normalizeRepoName(repo);
172
- const match = apps.find((app) => {
173
- if (app.handle && app.handle !== handle) {
174
- return false;
175
- }
176
- const candidates = [app.repo, app.gitRepo, app.id].map(normalizeRepoName);
177
- return candidates.includes(normalizedRepo);
178
- });
179
- if (!match) {
180
- throw new Error(`app not found for ${handle}/${repo}`);
181
- }
182
- return { app: match, handle, repo };
183
- }
184
- async function pollDeploymentLogs(params) {
185
- const intervalMs = params.intervalMs ?? 5e3;
186
- const timeoutMs = params.timeoutMs ?? 4 * 60 * 1e3;
187
- const seen = /* @__PURE__ */ new Set();
188
- const startedAt = Date.now();
189
- while (Date.now() - startedAt < timeoutMs) {
190
- const logs = await getDeploymentLogs(
191
- params.baseUrl,
192
- params.apiKey,
193
- params.deploymentId
194
- );
195
- const newLogs = logs.filter((log) => !seen.has(log.id));
196
- for (const log of newLogs) {
197
- seen.add(log.id);
198
- }
199
- for (const log of newLogs) {
200
- console.log(`${params.prefix}${log.message}`);
201
- }
202
- const status = await getDeploymentStatus(
203
- params.baseUrl,
204
- params.apiKey,
205
- params.deploymentId
206
- );
207
- if (status.status === "failed") {
208
- console.log(`${params.prefix}deployment failed`);
209
- return;
210
- }
211
- if (status.status === "running" || status.status === "deployed") {
212
- console.log(`${params.prefix}deployment complete`);
213
- return;
214
- }
215
- await new Promise((resolve) => setTimeout(resolve, intervalMs));
216
- }
217
- console.log(`${params.prefix}deployment still in progress`);
218
- }
219
-
220
- // src/cli/common/prompts.ts
221
- import { stdin as input2, stdout as output2 } from "node:process";
222
- import { createInterface as createInterface2 } from "node:readline/promises";
223
- async function readAllStdin() {
224
- const chunks = [];
225
- for await (const chunk of process.stdin) {
226
- chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk)));
227
- }
228
- return Buffer.concat(chunks).toString("utf8").replace(/\r?\n$/, "");
229
- }
230
- function readMaskedLine(prompt) {
231
- return new Promise((resolve, reject) => {
232
- const stdin = process.stdin;
233
- const stderr = process.stderr;
234
- let value = "";
235
- const wasRaw = stdin.isRaw;
236
- function cleanup() {
237
- stdin.off("data", onData);
238
- if (stdin.setRawMode) stdin.setRawMode(wasRaw);
239
- stdin.pause();
240
- stderr.write("\n");
241
- }
242
- function onData(chunk) {
243
- const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
244
- for (const byte of buffer) {
245
- if (byte === 3) {
246
- cleanup();
247
- reject(new Error("secret prompt cancelled"));
248
- return;
249
- }
250
- if (byte === 13 || byte === 10) {
251
- cleanup();
252
- resolve(value);
253
- return;
254
- }
255
- if (byte === 127 || byte === 8) {
256
- if (value.length > 0) {
257
- value = value.slice(0, -1);
258
- stderr.write("\b \b");
259
- }
260
- continue;
261
- }
262
- value += Buffer.from([byte]).toString("utf8");
263
- stderr.write("*");
264
- }
265
- }
266
- stderr.write(prompt);
267
- stdin.resume();
268
- if (stdin.setRawMode) stdin.setRawMode(true);
269
- stdin.on("data", onData);
270
- });
271
- }
272
- async function promptConfirm(question, defaultValue = false) {
273
- const rl = createInterface2({ input: input2, output: output2 });
274
- try {
275
- const suffix = defaultValue ? "[Y/n]" : "[y/N]";
276
- const answer = (await rl.question(`${question} ${suffix} `)).trim().toLowerCase();
277
- if (!answer) return defaultValue;
278
- return answer === "y" || answer === "yes";
279
- } finally {
280
- rl.close();
281
- }
282
- }
283
- async function promptForPath(defaultPath) {
284
- const rl = createInterface2({ input: input2, output: output2 });
285
- try {
286
- const answer = (await rl.question(`Local path (default: ${defaultPath}): `)).trim();
287
- return answer || defaultPath;
288
- } finally {
289
- rl.close();
290
- }
291
- }
292
-
293
- // src/cli/common/sandbox-options.ts
294
- var SANDBOX_WORKFLOW_MODES = [
295
- "readonly",
296
- "attempt",
297
- "feature",
298
- "rollout",
299
- "replay",
300
- "template_build",
301
- "scheduled_run",
302
- "patch_only",
303
- "hotfix",
304
- "multi_feature_batch"
305
- ];
306
- var SANDBOX_RUNTIME_PROMOTION_POLICIES = ["none", "manual", "auto_after_checks"];
307
- var SANDBOX_RUNTIME_PROFILES = [
308
- ...SANDBOX_RUNTIME_PROFILE_IDS
309
- ];
310
- function resolveSandboxBaseUrl(config, options) {
311
- void options;
312
- const base = process.env.OPENPOND_SANDBOX_BASE_URL || process.env.OPENPOND_API_URL || config.apiBaseUrl || mapUiBaseToApiBase(process.env.OPENPOND_BASE_URL || config.baseUrl) || DEFAULT_OPENPOND_API_BASE_URL;
313
- return base.replace(/\/$/, "");
314
- }
315
- async function resolveSandboxClient(options) {
316
- const config = await loadSandboxConfig(options);
317
- const uiBase = resolveBaseUrl(config);
318
- const apiKey = await ensureApiKey(config, uiBase);
319
- const sandboxApiUrl = resolveSandboxApiUrlOption(options) || process.env.OPENPOND_SANDBOX_API_URL?.trim() || null;
320
- const baseUrl = resolveSandboxBaseUrl(config, options);
321
- return createOpenPondSandboxClient(
322
- sandboxApiUrl ? { apiKey, sandboxApiUrl } : { apiKey, baseUrl }
323
- );
324
- }
325
- async function loadSandboxConfig(options) {
326
- void options;
327
- return loadConfig();
328
- }
329
- function parseSandboxWorkflowModeOption(value) {
330
- if (value === void 0) return void 0;
331
- if (typeof value !== "string" || !value.trim()) {
332
- throw new Error("workflow-mode must be a non-empty value");
333
- }
334
- const mode = value.trim();
335
- if (!SANDBOX_WORKFLOW_MODES.includes(mode)) {
336
- throw new Error(
337
- `workflow-mode must be one of ${SANDBOX_WORKFLOW_MODES.join(", ")}`
338
- );
339
- }
340
- return mode;
341
- }
342
- function parseSandboxRuntimePromotionPolicyOption(value) {
343
- if (value === void 0) return void 0;
344
- if (typeof value !== "string" || !value.trim()) {
345
- throw new Error("runtime-promotion-policy must be a non-empty value");
346
- }
347
- const policy = value.trim();
348
- if (!SANDBOX_RUNTIME_PROMOTION_POLICIES.includes(policy)) {
349
- throw new Error(
350
- `runtime-promotion-policy must be one of ${SANDBOX_RUNTIME_PROMOTION_POLICIES.join(
351
- ", "
352
- )}`
353
- );
354
- }
355
- return policy;
356
- }
357
- function parseSandboxRuntimeProfileIdOption(value) {
358
- if (typeof value !== "string" || !value.trim()) return void 0;
359
- const runtimeProfileId = value.trim();
360
- if (!SANDBOX_RUNTIME_PROFILES.includes(runtimeProfileId)) {
361
- throw new Error(
362
- `runtime-profile-id must be one of ${SANDBOX_RUNTIME_PROFILES.join(
363
- ", "
364
- )}`
365
- );
366
- }
367
- return runtimeProfileId;
368
- }
369
- function parseSandboxEnvOptions(options) {
370
- const refs = parseSandboxEnvAssignments(options.envRef, "env-ref").map(
371
- ({ name, value }) => ({ name, secretRef: value })
372
- );
373
- const literals = parseSandboxEnvAssignments(
374
- options.envLiteral,
375
- "env-literal"
376
- ).map(({ name, value }) => {
377
- if (isSecretLikeEnvName(name) && !parseBooleanOption(options.allowPlainSecretEnv)) {
378
- throw new Error(
379
- `refusing plaintext value for secret-like env ${name}; create a sandbox secret and pass --env-ref ${name}=openpond://secret/...`
380
- );
381
- }
382
- return { name, value };
383
- });
384
- const env = [...refs, ...literals];
385
- const names = /* @__PURE__ */ new Set();
386
- for (const item of env) {
387
- if (names.has(item.name)) {
388
- throw new Error(`duplicate sandbox env var: ${item.name}`);
389
- }
390
- names.add(item.name);
391
- }
392
- return env;
393
- }
394
- function parseSandboxTemplateEnvOptions(manifest, options) {
395
- const env = parseSandboxEnvOptions(options);
396
- const provided = new Set(env.map((item) => item.name));
397
- const providedByName = new Map(env.map((item) => [item.name, item]));
398
- for (const requirement of manifest.inputs.env) {
399
- const value = providedByName.get(requirement.name);
400
- if (value?.value !== void 0 && requirement.secret !== false) {
401
- throw new Error(
402
- `sandbox template env ${requirement.name} requires a secret ref. Pass --env-ref ${requirement.name}=openpond://secret/...`
403
- );
404
- }
405
- }
406
- const missing = manifest.inputs.env.filter((item) => item.required && !provided.has(item.name)).map((item) => item.name);
407
- if (missing.length > 0) {
408
- throw new Error(
409
- `missing required sandbox template env refs: ${missing.join(
410
- ", "
411
- )}. Pass --env-ref NAME=openpond://secret/...`
412
- );
413
- }
414
- return env;
415
- }
416
- function parseSandboxEnvAssignments(value, label) {
417
- if (typeof value !== "string") return [];
418
- return value.split(",").map((item) => item.trim()).filter(Boolean).map((item) => {
419
- const separator = item.indexOf("=");
420
- if (separator <= 0) {
421
- throw new Error(`${label} entries must use NAME=value`);
422
- }
423
- const name = item.slice(0, separator).trim();
424
- const entryValue = item.slice(separator + 1).trim();
425
- if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
426
- throw new Error(`${label} has invalid env name: ${name}`);
427
- }
428
- if (!entryValue) {
429
- throw new Error(`${label} value is required for ${name}`);
430
- }
431
- return { name, value: entryValue };
432
- });
433
- }
434
- function isSecretLikeEnvName(name) {
435
- return /(?:SECRET|TOKEN|KEY|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|DATABASE_URL|DSN)/i.test(
436
- name
437
- );
438
- }
439
- async function readSandboxSecretValue(options, label) {
440
- if (typeof options.value === "string" || typeof options.secretValue === "string") {
441
- throw new Error(
442
- "sandbox secret values must be provided with --stdin or the masked prompt"
443
- );
444
- }
445
- const useStdin = parseBooleanOption(options.stdin);
446
- if (useStdin) {
447
- const value2 = await readAllStdin();
448
- if (!value2) throw new Error(`${label} read no secret value from stdin`);
449
- return value2;
450
- }
451
- if (!process.stdin.isTTY) {
452
- throw new Error(`${label} requires --stdin when not running in a TTY`);
453
- }
454
- const value = await readMaskedLine(`${label}: `);
455
- if (!value) throw new Error(`${label} cannot be empty`);
456
- return value;
457
- }
458
- function summarizeSandboxSecret(secret) {
459
- return {
460
- id: secret.id,
461
- teamId: secret.teamId,
462
- name: secret.name,
463
- scope: secret.scope,
464
- status: secret.status,
465
- secretRef: secret.secretRef,
466
- currentVersion: secret.currentVersion,
467
- updatedAt: secret.updatedAt,
468
- lastUsedAt: secret.lastUsedAt,
469
- attachedDestinations: secret.attachments?.length ?? 0
470
- };
471
- }
472
-
473
- // ../../packages/cloud/src/process-runner.ts
474
- import { Buffer as Buffer2 } from "node:buffer";
475
- import { spawn } from "node:child_process";
476
- var DEFAULT_PROCESS_TIMEOUT_MS = 10 * 60 * 1e3;
477
- var DEFAULT_PROCESS_MAX_OUTPUT_BYTES = 2 * 1024 * 1024;
478
- function runProcessCommand(command, args = [], options = {}) {
479
- if (options.inherit && options.terminateWhenStdoutIncludes !== void 0) {
480
- return Promise.reject(new Error("terminateWhenStdoutIncludes requires captured stdout"));
481
- }
482
- if (options.terminateWhenStdoutIncludes === "") {
483
- return Promise.reject(new Error("terminateWhenStdoutIncludes must not be empty"));
484
- }
485
- return new Promise((resolve, reject) => {
486
- const proc = spawn(command, args, {
487
- cwd: options.cwd,
488
- env: options.env ? { ...process.env, ...options.env } : void 0,
489
- shell: options.shell,
490
- detached: options.detached ?? process.platform !== "win32",
491
- stdio: options.inherit ? "inherit" : [options.stdin === void 0 ? "ignore" : "pipe", "pipe", "pipe"]
492
- });
493
- const stdout = new BoundedOutput(maxOutputBytes(options));
494
- const stderr = new BoundedOutput(maxOutputBytes(options));
495
- let timedOut = false;
496
- const timeoutMs = options.timeoutMs ?? DEFAULT_PROCESS_TIMEOUT_MS;
497
- let timeout;
498
- let forceKill;
499
- let requestedTermination = null;
500
- let settled = false;
501
- const clearTimers = () => {
502
- if (timeout) clearTimeout(timeout);
503
- if (forceKill) clearTimeout(forceKill);
504
- };
505
- const requestTermination = (reason) => {
506
- if (requestedTermination !== null || settled) return;
507
- requestedTermination = reason;
508
- timedOut = reason === "timeout";
509
- if (timeout) {
510
- clearTimeout(timeout);
511
- timeout = void 0;
512
- }
513
- terminateProcessTree(proc.pid, "SIGTERM");
514
- forceKill = setTimeout(() => {
515
- if (proc.exitCode === null && proc.signalCode === null) terminateProcessTree(proc.pid, "SIGKILL");
516
- }, 5e3);
517
- };
518
- if (timeoutMs > 0) {
519
- timeout = setTimeout(() => {
520
- requestTermination("timeout");
521
- }, timeoutMs);
522
- }
523
- if (!options.inherit) {
524
- proc.stdout?.on("data", (chunk) => {
525
- stdout.append(chunk);
526
- const marker = options.terminateWhenStdoutIncludes;
527
- if (marker !== void 0 && stdout.text().includes(marker)) {
528
- requestTermination("output");
529
- }
530
- });
531
- proc.stderr?.on("data", (chunk) => {
532
- stderr.append(chunk);
533
- });
534
- }
535
- proc.on("error", (error) => {
536
- clearTimers();
537
- settled = true;
538
- reject(error);
539
- });
540
- proc.on("close", (code, signal) => {
541
- if (settled) return;
542
- settled = true;
543
- clearTimers();
544
- resolve({
545
- code,
546
- signal,
547
- terminationReason: requestedTermination ?? (signal ? "signal" : "exit"),
548
- stdout: stdout.text(),
549
- stderr: stderr.text(),
550
- timedOut,
551
- stdoutTruncated: stdout.truncated,
552
- stderrTruncated: stderr.truncated
553
- });
554
- });
555
- if (options.stdin !== void 0) {
556
- proc.stdin?.end(options.stdin);
557
- }
558
- });
559
- }
560
- var BoundedOutput = class {
561
- #chunks = [];
562
- #maxBytes;
563
- #bytes = 0;
564
- truncated = false;
565
- constructor(maxBytes) {
566
- this.#maxBytes = maxBytes;
567
- }
568
- append(value) {
569
- const chunk = Buffer2.isBuffer(value) ? value : Buffer2.from(value);
570
- const remaining = this.#maxBytes - this.#bytes;
571
- if (remaining <= 0) {
572
- if (chunk.byteLength > 0) this.truncated = true;
573
- return;
574
- }
575
- if (chunk.byteLength <= remaining) {
576
- this.#chunks.push(chunk);
577
- this.#bytes += chunk.byteLength;
578
- return;
579
- }
580
- this.#chunks.push(chunk.subarray(0, remaining));
581
- this.#bytes += remaining;
582
- this.truncated = true;
583
- }
584
- text() {
585
- const value = Buffer2.concat(this.#chunks, this.#bytes).toString("utf8");
586
- return this.truncated ? `${value}
587
- [truncated after ${this.#maxBytes} bytes]
588
- ` : value;
589
- }
590
- };
591
- function maxOutputBytes(options) {
592
- const value = options.maxOutputBytes ?? DEFAULT_PROCESS_MAX_OUTPUT_BYTES;
593
- return Math.max(0, Math.floor(value));
594
- }
595
- function terminateProcessTree(pid, signal) {
596
- if (!pid) return;
597
- if (process.platform === "win32") {
598
- const args = ["/PID", String(pid), "/T"];
599
- if (signal === "SIGKILL") args.push("/F");
600
- const killer = spawn("taskkill", args, { stdio: "ignore", windowsHide: true });
601
- killer.unref();
602
- return;
603
- }
604
- try {
605
- process.kill(-pid, signal);
606
- } catch (error) {
607
- if (error.code !== "ESRCH") throw error;
608
- }
609
- }
610
-
611
- // src/cli/common/shell.ts
612
- async function runCommand(command, args, options = {}) {
613
- return runProcessCommand(command, args, {
614
- cwd: options.cwd,
615
- inherit: options.inherit,
616
- timeoutMs: options.timeoutMs,
617
- maxOutputBytes: options.maxOutputBytes,
618
- terminateWhenStdoutIncludes: options.terminateWhenStdoutIncludes
619
- });
620
- }
621
- async function runShellCommand(command, options = {}) {
622
- const timeoutMs = options.timeoutSeconds === void 0 ? void 0 : options.timeoutSeconds * 1e3;
623
- return runProcessCommand(command, [], {
624
- cwd: options.cwd,
625
- env: options.env,
626
- shell: true,
627
- inherit: options.inherit,
628
- timeoutMs,
629
- maxOutputBytes: options.maxOutputBytes
630
- });
631
- }
632
- async function getGitRemoteUrl(cwd, remoteName) {
633
- const result = await runCommand("git", ["remote", "get-url", remoteName], {
634
- cwd
635
- });
636
- if (result.code !== 0) return null;
637
- const url = result.stdout.trim();
638
- return url.length > 0 ? url : null;
639
- }
640
-
641
- export {
642
- resolveApiKey,
643
- promptForApiKey,
644
- ensureApiKey,
645
- resolveRepoUrl,
646
- formatTokenizedRepoUrl,
647
- formatTokenizedRepoUrlForPrint,
648
- redactToken,
649
- warnOnRepoHostMismatch,
650
- normalizeRepoName,
651
- fetchAppsWithCache,
652
- fetchToolsWithCache,
653
- resolveAppTarget,
654
- pollDeploymentLogs,
655
- promptConfirm,
656
- promptForPath,
657
- resolveSandboxClient,
658
- parseSandboxWorkflowModeOption,
659
- parseSandboxRuntimePromotionPolicyOption,
660
- parseSandboxRuntimeProfileIdOption,
661
- parseSandboxEnvOptions,
662
- parseSandboxTemplateEnvOptions,
663
- readSandboxSecretValue,
664
- summarizeSandboxSecret,
665
- runProcessCommand,
666
- runCommand,
667
- runShellCommand,
668
- getGitRemoteUrl
669
- };