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,1136 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import {
3
- buildHostedRunIdempotencyKey,
4
- collectProfileSourceUploadEntries,
5
- commitActiveProfileChanges,
6
- defaultLocalProfileRepoPath,
7
- formatOpenPondProfileSetupRequirement,
8
- hostedPublishStatusFromPayload,
9
- hostedRunStatusFromRunSummary,
10
- hostedRunSummaryFromPayload,
11
- hostedSourceCheckStatusFromPayload,
12
- initLocalProfileRepo,
13
- loadLocalProfileRepo,
14
- loadOpenPondProfileState,
15
- runProfileCheck,
16
- runProfileSdkCommand,
17
- saveProfilePushStatus
18
- } from "./chunk-A6G3PFA5.js";
19
- import {
20
- collectAgentSdkProjectSourceUploadEntries,
21
- collectProjectSourceUploadEntries,
22
- mergeProjectSourceUploadEntries,
23
- parseAgentSourceCheckDispatch,
24
- parseAgentSourceCheckKind
25
- } from "./chunk-G65WAOJV.js";
26
- import "./chunk-3ELF4FXY.js";
27
- import "./chunk-YVCYVDNP.js";
28
- import "./chunk-X7ZG4TSW.js";
29
- import {
30
- resolveSandboxClient
31
- } from "./chunk-3VEYNDHN.js";
32
- import "./chunk-FJ2JGB2N.js";
33
- import "./chunk-SMNFI2FU.js";
34
- import "./chunk-KSRWKXRB.js";
35
- import "./chunk-PS37DB5F.js";
36
- import "./chunk-4KA25HUP.js";
37
- import "./chunk-ZNQEROWP.js";
38
- import "./chunk-7RIGZB7N.js";
39
- import "./chunk-4L3ZJS2T.js";
40
- import "./chunk-JTHL5XJ2.js";
41
- import "./chunk-FQS2QL5F.js";
42
- import {
43
- optionString,
44
- parseBooleanOption,
45
- requiredTeamId
46
- } from "./chunk-MUMPWI4O.js";
47
- import "./chunk-UACZUFIA.js";
48
-
49
- // src/cli/profile.ts
50
- import { readFile } from "node:fs/promises";
51
- import path2 from "node:path";
52
-
53
- // ../../packages/cloud/src/profile/hosted-agent-materialization.ts
54
- import path from "node:path";
55
- async function materializeHostedProfileAgentSource(input) {
56
- if (!input.state.sourcePath) {
57
- throw new Error("Active OpenPond profile is missing a source path.");
58
- }
59
- const agent = input.state.agents.find(
60
- (candidate) => candidate.id === input.agentId
61
- );
62
- if (!agent) {
63
- throw new Error(
64
- `Profile agent not found for hosted materialization: ${input.agentId}`
65
- );
66
- }
67
- if (!agent.enabled) {
68
- throw new Error(`Profile agent is disabled: ${input.agentId}`);
69
- }
70
- const sourceRoot = resolveProfileAgentSourceRoot(
71
- input.state.sourcePath,
72
- agent.path
73
- );
74
- const collected = await collectProjectSourceUploadEntries(sourceRoot);
75
- const agentSdk = await collectAgentSdkProjectSourceUploadEntries(
76
- sourceRoot,
77
- collected.entries
78
- );
79
- const upload = mergeProjectSourceUploadEntries(
80
- collected,
81
- agentSdk.entries
82
- );
83
- const materializationProject = await getOrCreateHostedSourceProject({
84
- client: input.client,
85
- teamId: input.teamId,
86
- projectId: input.projectId ?? null,
87
- profileProjectId: input.profileProjectId,
88
- profileName: input.profileName,
89
- agentId: input.agentId,
90
- localHead: input.localHead,
91
- hostedHead: input.hostedHead
92
- });
93
- const uploadedProject = await input.client.projects.uploadSource(
94
- materializationProject.id,
95
- {
96
- teamId: input.teamId,
97
- entries: upload.entries,
98
- branch: input.sourceRef,
99
- commitMessage: `Materialize OpenPond profile agent ${input.agentId}`
100
- }
101
- );
102
- const syncedProject = await input.client.projects.sync(uploadedProject.id, {
103
- teamId: input.teamId
104
- });
105
- const sourceCommitSha = sandboxProjectSourceCommitSha(syncedProject) ?? sandboxProjectSourceCommitSha(uploadedProject);
106
- const sourceRef = sandboxProjectSourceRef(syncedProject) ?? sandboxProjectSourceRef(uploadedProject) ?? input.sourceRef;
107
- const runtimeAgentExternalId = `openpond-profile-agent:${input.profileProjectId}:${input.profileName}:${input.agentId}`;
108
- const existingRuntimeAgent = (await input.client.agents.list({
109
- teamId: input.teamId
110
- })).find((candidate) => candidate.externalId === runtimeAgentExternalId);
111
- const runtimeAgent = await input.client.agents.upsert({
112
- teamId: input.teamId,
113
- projectId: syncedProject.id,
114
- name: agent.name || input.agentId,
115
- slug: hostedRuntimeAgentSlug(input.profileName, input.agentId),
116
- selectedEntrypoint: hostedEntrypointForProfileAgent(
117
- input.state,
118
- input.agentId
119
- ),
120
- triggerType: "manual",
121
- runtimeSource: {
122
- mode: "latest_source",
123
- ...sourceRef ? { sourceRef } : {},
124
- ...sourceCommitSha ? { sourceCommitSha } : {}
125
- },
126
- metadata: {
127
- ...existingRuntimeAgent?.metadata ?? {},
128
- source: "openpond_profile_agent_materialization",
129
- profileProjectId: input.profileProjectId,
130
- profileName: input.profileName,
131
- profileAgentId: input.agentId,
132
- profileSourcePath: agent.path,
133
- localHead: input.localHead,
134
- hostedHead: input.hostedHead
135
- },
136
- externalId: runtimeAgentExternalId
137
- });
138
- const uploadMetadata = record(agentSdk.uploadMetadata);
139
- const commands = record(uploadMetadata?.commands);
140
- const dependencySetup = record(uploadMetadata?.dependencySetup);
141
- const setupCommands = stringArray(dependencySetup?.commands);
142
- const validationCommands = [
143
- text(commands?.validate),
144
- text(commands?.eval)
145
- ].filter((command) => Boolean(command));
146
- return {
147
- status: "uploaded",
148
- agentId: input.agentId,
149
- runtimeAgentId: runtimeAgent.id,
150
- projectId: syncedProject.id,
151
- sourceRoot,
152
- sourceRef,
153
- sourceCommitSha: sourceCommitSha ?? null,
154
- manifestHash: syncedProject.sandboxManifestHash ?? null,
155
- manifestPath: syncedProject.sandboxManifestPath ?? null,
156
- manifestSyncedAt: syncedProject.sandboxManifestSyncedAt ?? null,
157
- fileCount: upload.fileCount,
158
- totalBytes: upload.totalBytes,
159
- generatedManifestPath: agentSdk.generatedManifestPath,
160
- synthesizedOpenPondYaml: agentSdk.synthesizedOpenPondYaml,
161
- uploadMetadataPath: agentSdk.uploadMetadataPath,
162
- setupCommands,
163
- validationCommands,
164
- materializedAt: (/* @__PURE__ */ new Date()).toISOString()
165
- };
166
- }
167
- async function getOrCreateHostedSourceProject(input) {
168
- if (input.projectId) {
169
- try {
170
- return await input.client.projects.get(input.projectId, {
171
- teamId: input.teamId
172
- });
173
- } catch {
174
- }
175
- }
176
- return input.client.projects.upsert({
177
- teamId: input.teamId,
178
- name: `OpenPond profile ${input.profileName} ${input.agentId}`,
179
- sourceType: "manual",
180
- externalId: `openpond-profile:${input.profileProjectId}:${input.profileName}:${input.agentId}`,
181
- description: `Materialized OpenPond profile agent ${input.agentId} for hosted Team execution.`,
182
- metadata: {
183
- source: "openpond_profile_agent_materialization",
184
- profileProjectId: input.profileProjectId,
185
- profileName: input.profileName,
186
- profileAgentId: input.agentId,
187
- localHead: input.localHead,
188
- hostedHead: input.hostedHead
189
- }
190
- });
191
- }
192
- function resolveProfileAgentSourceRoot(sourcePath, agentPath) {
193
- const normalized = agentPath.replace(/\\/g, "/");
194
- const absolute = path.resolve(sourcePath, normalized);
195
- const relative = path.relative(sourcePath, absolute);
196
- if (relative.startsWith("..") || path.isAbsolute(relative)) {
197
- throw new Error(`Profile agent path escapes profile source: ${agentPath}`);
198
- }
199
- return normalized === "agent/agent.ts" || normalized.endsWith("/agent.ts") ? sourcePath : absolute;
200
- }
201
- function hostedEntrypointForProfileAgent(state, agentId) {
202
- const action = state.actionCatalog.find(
203
- (candidate) => candidate.agentId === agentId && (candidate.sourceActionId === "chat" || candidate.name === "chat")
204
- ) ?? state.actionCatalog.find((candidate) => candidate.agentId === agentId);
205
- return {
206
- scope: "action",
207
- name: typeof action?.sourceActionId === "string" && action.sourceActionId || typeof action?.name === "string" && action.name || "chat"
208
- };
209
- }
210
- function hostedRuntimeAgentSlug(profileName, agentId) {
211
- const slug = `openpond-profile-${profileName}-${agentId}`.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
212
- return slug || "openpond-profile-agent";
213
- }
214
- function sandboxProjectSourceCommitSha(project) {
215
- const item = record(project);
216
- const sourceConfig = record(item?.sourceConfig);
217
- const metadata = record(item?.metadata);
218
- return text(sourceConfig?.sourceCommitSha) ?? text(sourceConfig?.commitSha) ?? text(sourceConfig?.remoteSha) ?? text(metadata?.projectSourceUploadCommitSha) ?? text(metadata?.sourceCommitSha) ?? text(item?.templateRemoteSha);
219
- }
220
- function sandboxProjectSourceRef(project) {
221
- const item = record(project);
222
- const sourceConfig = record(item?.sourceConfig);
223
- return text(sourceConfig?.sourceRef) ?? text(sourceConfig?.branch) ?? text(item?.gitBranch) ?? text(item?.defaultBranch);
224
- }
225
- function record(value) {
226
- return value && typeof value === "object" && !Array.isArray(value) ? value : null;
227
- }
228
- function text(value) {
229
- return typeof value === "string" && value.trim() ? value.trim() : null;
230
- }
231
- function stringArray(value) {
232
- return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
233
- }
234
-
235
- // src/cli/profile.ts
236
- async function runOpenPondInitCommand(options) {
237
- const state = await initLocalProfileRepo({
238
- repoPath: optionString(options, "path") || defaultLocalProfileRepoPath(),
239
- profile: optionString(options, "profile") || "default",
240
- template: optionString(options, "template") || "blank-agent",
241
- force: parseBooleanOption(options.force)
242
- });
243
- if (parseBooleanOption(options.json)) {
244
- console.log(JSON.stringify(state, null, 2));
245
- return;
246
- }
247
- console.log(`Initialized OpenPond profile ${state.activeProfile} at ${state.repoPath}`);
248
- console.log(`Profile source: ${state.sourcePath}`);
249
- }
250
- async function runOpenPondProfileCommand(options, rest) {
251
- const subcommand = rest[0] ?? "current";
252
- if (subcommand === "load") {
253
- const repoPath = optionString(options, "path") || rest[1];
254
- if (!repoPath) {
255
- throw new Error("usage: openpond profile load --path <dir> [--profile <name>]");
256
- }
257
- const state = await loadLocalProfileRepo(repoPath, optionString(options, "profile") || void 0);
258
- if (parseBooleanOption(options.json)) {
259
- console.log(JSON.stringify(state, null, 2));
260
- return;
261
- }
262
- console.log(`Loaded OpenPond profile ${state.activeProfile} from ${state.repoPath}`);
263
- return;
264
- }
265
- if (subcommand === "current" || subcommand === "status") {
266
- const state = await loadOpenPondProfileState();
267
- if (parseBooleanOption(options.json)) {
268
- console.log(JSON.stringify(state, null, 2));
269
- return;
270
- }
271
- printProfileState(state);
272
- return;
273
- }
274
- if (subcommand === "diff") {
275
- const state = await loadOpenPondProfileState();
276
- if (parseBooleanOption(options.json)) {
277
- console.log(JSON.stringify({ diff: state.diff, profile: state }, null, 2));
278
- return;
279
- }
280
- printProfileDiff(state);
281
- return;
282
- }
283
- if (subcommand === "catalog") {
284
- const state = await loadOpenPondProfileState();
285
- if (parseBooleanOption(options.json)) {
286
- console.log(JSON.stringify({ catalog: state.catalog, actions: state.actionCatalog, profile: state }, null, 2));
287
- return;
288
- }
289
- printProfileCatalog(state);
290
- return;
291
- }
292
- if (subcommand === "commit") {
293
- await runProfileCommitCommand(options, rest.slice(1));
294
- return;
295
- }
296
- if (subcommand === "push") {
297
- await runProfilePushCommand(options);
298
- return;
299
- }
300
- if (subcommand === "check") {
301
- await runProfileCheck(optionString(options, "kind") || rest[1] || "all");
302
- return;
303
- }
304
- if (subcommand === "ensure-hosted") {
305
- await runHostedProfileEnsureCommand(options);
306
- return;
307
- }
308
- if (subcommand === "hosted") {
309
- const nested = rest[1] ?? "status";
310
- if (nested === "ensure") {
311
- await runHostedProfileEnsureCommand(options);
312
- return;
313
- }
314
- if (nested === "status" || nested === "current") {
315
- await runHostedProfileStatusCommand(options);
316
- return;
317
- }
318
- throw new Error("usage: openpond profile hosted [status|ensure] --team-id <id> [--json]");
319
- }
320
- if (subcommand === "agents") {
321
- const nested = rest[1] ?? "list";
322
- if (nested !== "list") {
323
- throw new Error("usage: openpond profile agents list [--json]");
324
- }
325
- await runOpenPondAgentsCommand(options, ["list"]);
326
- return;
327
- }
328
- throw new Error("usage: openpond profile <status|diff|catalog|commit|push|load|check|agents|hosted|ensure-hosted> [args]");
329
- }
330
- async function runProfileCommitCommand(options, rest) {
331
- const message = optionString(options, "message") || optionString(options, "commitMessage") || rest.join(" ").trim() || void 0;
332
- const result = await commitActiveProfileChanges(message);
333
- if (parseBooleanOption(options.json)) {
334
- console.log(JSON.stringify(result, null, 2));
335
- return;
336
- }
337
- if (!result.committed) {
338
- console.log("No profile changes to commit.");
339
- printProfileState(result.state);
340
- return;
341
- }
342
- console.log("Committed OpenPond profile changes.");
343
- if (result.stdout.trim()) console.log(result.stdout.trim());
344
- printProfileState(result.state);
345
- }
346
- async function runProfilePushCommand(options) {
347
- const teamId = requiredTeamId(options, "usage: openpond profile push");
348
- const state = await loadOpenPondProfileState();
349
- if (state.error) throw new Error(state.error);
350
- if (!state.repoPath || !state.sourcePath || !state.manifestPath) {
351
- throw new Error("No active OpenPond profile. Run `openpond init`.");
352
- }
353
- if (!state.git?.isRepo) {
354
- throw new Error("Active OpenPond profile source is not Git-backed. Run `openpond init` or reload a Git-backed profile.");
355
- }
356
- if (!state.git.head) {
357
- throw new Error("Profile source must have a committed Git head before push. Run `openpond profile commit` first.");
358
- }
359
- if (state.git.dirty) {
360
- throw new Error("Profile source has uncommitted changes. Run `openpond profile commit` before push.");
361
- }
362
- const client = await resolveSandboxClient(options);
363
- const hosted = parseBooleanOption(options.ensureHosted) ? await client.profile.ensureHosted({ teamId }) : await client.profile.get({ teamId });
364
- if (!hosted) {
365
- throw new Error("No hosted OpenPond profile repo found. Run `openpond profile ensure-hosted --team-id <id>` first, or pass `--ensure-hosted` to push.");
366
- }
367
- const force = parseBooleanOption(options.force);
368
- const currentHostedHead = hosted.sourceUpload?.sourceCommitSha ?? null;
369
- const lastPushedHostedHead = state.hosted?.sourceCommitSha ?? null;
370
- if (lastPushedHostedHead && currentHostedHead !== lastPushedHostedHead && !force) {
371
- throw new Error(
372
- [
373
- "Hosted profile source changed since the last local push.",
374
- `Last pushed hosted head: ${lastPushedHostedHead}`,
375
- `Current hosted head: ${currentHostedHead ?? "none"}`,
376
- "Inspect hosted changes before pushing, or rerun with --force to overwrite explicitly."
377
- ].join("\n")
378
- );
379
- }
380
- const explicitHostedSourceAgentId = optionString(options, "hostedSourceAgentId");
381
- const requestHostedSourceChecks = parseBooleanOption(options.hostedSourceChecks);
382
- const publishHostedSource = parseBooleanOption(options.publishHostedSource);
383
- const hostedRunAgentId = optionString(options, "hostedRunAgentId");
384
- const hostedSourceAgentId = explicitHostedSourceAgentId || (requestHostedSourceChecks || publishHostedSource ? hostedRunAgentId : null);
385
- const manifest = JSON.parse(await readFile(state.manifestPath, "utf8"));
386
- const hostedManifest = normalizeHostedProfileManifest(manifest);
387
- const sourcePath = manifest.profiles[state.activeProfile ?? manifest.defaultProfile]?.path ?? "profiles/default";
388
- const upload = await collectProfileSourceUploadForPush({
389
- state,
390
- hostedSourceAgentId
391
- });
392
- const result = await client.profile.push({
393
- teamId,
394
- entries: upload.entries,
395
- branch: state.git.branch ?? "main",
396
- commitMessage: optionString(options, "commitMessage") || optionString(options, "message") || `Push OpenPond profile ${state.activeProfile ?? "default"} at ${state.git.shortHead ?? state.git.head}`,
397
- expectedSourceCommitSha: currentHostedHead,
398
- localHeadSha: state.git.head,
399
- manifest: hostedManifest,
400
- sourcePath,
401
- agents: state.agents.map((agent) => ({
402
- id: agent.id,
403
- path: agent.path,
404
- enabled: agent.enabled
405
- }))
406
- });
407
- const pushedAt = (/* @__PURE__ */ new Date()).toISOString();
408
- const preserveHostedPromotionEvidence = state.hosted?.lastPushedLocalHead === state.git.head && state.hosted?.sourceCommitSha === result.sourceUpload.sourceCommitSha;
409
- let pushStatus = {
410
- status: "pushed",
411
- promotionStatus: preserveHostedPromotionEvidence ? state.hosted?.promotionStatus ?? "uploaded" : "uploaded",
412
- hostedRunStatus: preserveHostedPromotionEvidence ? state.hosted?.hostedRunStatus ?? "not_started" : "not_started",
413
- pushedAt,
414
- teamId,
415
- projectId: result.profile.project.id,
416
- localHead: state.git.head,
417
- hostedHead: result.sourceUpload.sourceCommitSha,
418
- sourceRef: result.sourceUpload.sourceRef,
419
- hostedRunAgentId: preserveHostedPromotionEvidence ? state.hosted?.hostedRunAgentId ?? null : null,
420
- hostedRunId: preserveHostedPromotionEvidence ? state.hosted?.hostedRunId ?? null : null,
421
- hostedRunAt: preserveHostedPromotionEvidence ? state.hosted?.hostedRunAt ?? null : null,
422
- hostedSourceMaterialization: preserveHostedPromotionEvidence ? state.hosted?.hostedSourceMaterialization ?? null : null,
423
- hostedSourceCheck: preserveHostedPromotionEvidence ? state.hosted?.hostedSourceCheck ?? null : null,
424
- hostedPublish: preserveHostedPromotionEvidence ? state.hosted?.hostedPublish ?? null : null,
425
- hostedRun: preserveHostedPromotionEvidence ? state.hosted?.hostedRun ?? null : null
426
- };
427
- await saveProfilePushStatus(pushStatus);
428
- let hostedRuntimeAgentId = hostedSourceAgentId ?? resolveHostedRuntimeAgentIdForRun(state, hostedRunAgentId);
429
- const hostedSourceDispatch = parseAgentSourceCheckDispatch(
430
- options.hostedSourceDispatch,
431
- "hosted-source-dispatch"
432
- ) ?? "coding_core";
433
- let hostedSourceDeployPlan = null;
434
- let hostedSourceChecks = null;
435
- let hostedSourcePublish = null;
436
- if (hostedSourceAgentId && (requestHostedSourceChecks || publishHostedSource || explicitHostedSourceAgentId)) {
437
- try {
438
- const hostedSourceMaterialization = await materializeHostedProfileAgentSource({
439
- client,
440
- teamId,
441
- profileProjectId: result.profile.project.id,
442
- profileName: state.activeProfile ?? manifest.defaultProfile,
443
- state,
444
- agentId: hostedSourceAgentId,
445
- sourceRef: result.sourceUpload.sourceRef ?? state.git.branch ?? "main",
446
- localHead: state.git.head,
447
- hostedHead: result.sourceUpload.sourceCommitSha,
448
- projectId: optionString(options, "hostedSourceProjectId") || (state.hosted?.hostedSourceMaterialization?.agentId === hostedSourceAgentId ? state.hosted.hostedSourceMaterialization.projectId : null)
449
- });
450
- pushStatus = {
451
- ...pushStatus,
452
- promotionStatus: "hosted_source_materialized",
453
- hostedSourceMaterialization
454
- };
455
- hostedRuntimeAgentId = hostedSourceMaterialization.runtimeAgentId ?? hostedSourceAgentId;
456
- await saveProfilePushStatus(pushStatus);
457
- } catch (error) {
458
- const message = error instanceof Error ? error.message : String(error);
459
- pushStatus = {
460
- ...pushStatus,
461
- promotionStatus: "hosted_source_materialize_failed",
462
- hostedSourceMaterialization: {
463
- status: "failed",
464
- agentId: hostedSourceAgentId,
465
- projectId: optionString(options, "hostedSourceProjectId") ?? null,
466
- error: message
467
- },
468
- error: message
469
- };
470
- await saveProfilePushStatus(pushStatus);
471
- throw new Error(`Hosted source materialization failed after push: ${message}`);
472
- }
473
- }
474
- if (requestHostedSourceChecks || publishHostedSource) {
475
- if (!hostedSourceAgentId) {
476
- throw new Error("--hosted-source-agent-id or --hosted-run-agent-id is required for hosted source checks or publish.");
477
- }
478
- if (!hostedRuntimeAgentId) {
479
- throw new Error("Unable to resolve the hosted runtime agent for source checks.");
480
- }
481
- try {
482
- hostedSourceDeployPlan = await client.agents.sourceDeployPlan(hostedRuntimeAgentId, { teamId });
483
- if (requestHostedSourceChecks) {
484
- const sourceRef = pushStatus.hostedSourceMaterialization?.sourceRef ?? result.sourceUpload.sourceRef;
485
- const baseSha = pushStatus.hostedSourceMaterialization?.sourceCommitSha ?? result.sourceUpload.sourceCommitSha;
486
- hostedSourceChecks = await client.agents.requestSourceChecks(hostedRuntimeAgentId, {
487
- teamId,
488
- ...sourceRef ? { sourceRef } : {},
489
- ...baseSha ? { baseSha } : {},
490
- checkKind: parseAgentSourceCheckKind(
491
- optionString(options, "hostedCheckKind") || optionString(options, "checkKind")
492
- ) ?? "all",
493
- dispatch: hostedSourceDispatch,
494
- metadata: {
495
- source: "openpond_profile_push_checks",
496
- localHead: state.git.head,
497
- hostedHead: result.sourceUpload.sourceCommitSha,
498
- materializedProjectId: pushStatus.hostedSourceMaterialization?.projectId ?? null,
499
- materializedSourceCommitSha: pushStatus.hostedSourceMaterialization?.sourceCommitSha ?? null,
500
- sourceRef,
501
- dispatch: hostedSourceDispatch
502
- }
503
- });
504
- if (hostedSourceChecks.dispatchResult?.status === "failed") {
505
- throw new Error(hostedSourceChecks.dispatchResult.error ?? "hosted_source_check_dispatch_failed");
506
- }
507
- if (hostedSourceChecks.dispatchResult?.status === "completed") {
508
- const sourceCheckStatus = record2(hostedSourceChecks.sourceCheckStatus);
509
- if (sourceCheckStatusPassed(sourceCheckStatus)) {
510
- await bindValidatedHostedRuntimeSource({
511
- client,
512
- teamId,
513
- runtimeAgentId: hostedRuntimeAgentId,
514
- sourceRef,
515
- sourceCommitSha: baseSha,
516
- validatedAt: (/* @__PURE__ */ new Date()).toISOString()
517
- });
518
- hostedSourceDeployPlan = await client.agents.sourceDeployPlan(hostedRuntimeAgentId, { teamId });
519
- }
520
- }
521
- }
522
- pushStatus = {
523
- ...pushStatus,
524
- promotionStatus: requestHostedSourceChecks ? "hosted_source_check_pending" : pushStatus.promotionStatus,
525
- hostedSourceCheck: hostedSourceCheckStatusFromPayload({
526
- agentId: hostedRuntimeAgentId,
527
- status: requestHostedSourceChecks ? "requested" : "deploy_plan_ready",
528
- deployPlan: hostedSourceDeployPlan,
529
- checkResult: hostedSourceChecks
530
- })
531
- };
532
- await saveProfilePushStatus(pushStatus);
533
- } catch (error) {
534
- const message = error instanceof Error ? error.message : String(error);
535
- pushStatus = {
536
- ...pushStatus,
537
- promotionStatus: "hosted_source_check_failed",
538
- hostedSourceCheck: hostedSourceCheckStatusFromPayload({
539
- agentId: hostedRuntimeAgentId,
540
- status: "failed",
541
- deployPlan: hostedSourceDeployPlan,
542
- checkedAt: (/* @__PURE__ */ new Date()).toISOString(),
543
- error: message
544
- }),
545
- error: message
546
- };
547
- await saveProfilePushStatus(pushStatus);
548
- throw new Error(`Hosted source check failed after push: ${message}`);
549
- }
550
- }
551
- if (publishHostedSource) {
552
- if (!hostedSourceAgentId) {
553
- throw new Error("--hosted-source-agent-id or --hosted-run-agent-id is required for hosted source publish.");
554
- }
555
- if (!hostedRuntimeAgentId) {
556
- throw new Error("Unable to resolve the hosted runtime agent for source publish.");
557
- }
558
- try {
559
- const expectedManifestHash = optionString(options, "expectedManifestHash") || pushStatus.hostedSourceCheck?.manifestHash || hostedSourceDeployPlan?.source.manifestHash || void 0;
560
- hostedSourcePublish = await client.agents.publishSource(hostedRuntimeAgentId, {
561
- teamId,
562
- ...expectedManifestHash ? { expectedManifestHash } : {},
563
- ...pushStatus.hostedSourceMaterialization?.sourceCommitSha ?? result.sourceUpload.sourceCommitSha ? { expectedSourceCommitSha: pushStatus.hostedSourceMaterialization?.sourceCommitSha ?? result.sourceUpload.sourceCommitSha } : {}
564
- });
565
- pushStatus = {
566
- ...pushStatus,
567
- promotionStatus: "hosted_source_published",
568
- hostedPublish: hostedPublishStatusFromPayload({
569
- agentId: hostedRuntimeAgentId,
570
- publishResult: hostedSourcePublish
571
- })
572
- };
573
- await saveProfilePushStatus(pushStatus);
574
- } catch (error) {
575
- const message = error instanceof Error ? error.message : String(error);
576
- pushStatus = {
577
- ...pushStatus,
578
- promotionStatus: "hosted_source_publish_failed",
579
- hostedPublish: {
580
- status: "failed",
581
- agentId: hostedRuntimeAgentId,
582
- error: message
583
- },
584
- error: message
585
- };
586
- await saveProfilePushStatus(pushStatus);
587
- throw new Error(`Hosted source publish failed after push: ${message}`);
588
- }
589
- }
590
- let hostedRun = null;
591
- if (hostedRunAgentId) {
592
- const hostedRunRuntimeAgentId = hostedRuntimeAgentId || hostedRunAgentId;
593
- const hostedRunStartedAt = (/* @__PURE__ */ new Date()).toISOString();
594
- const hostedRunInput = parseJsonObjectOption(options, "hostedRunInput") ?? { prompt: "hello", channel: "openpond_chat" };
595
- const hostedRunConversationId = optionString(options, "hostedRunConversationId") || optionString(options, "conversationId");
596
- const hostedRunTargetProjectId = optionString(options, "hostedRunTargetProjectId");
597
- const hostedRunIdempotencyKey = buildHostedRunIdempotencyKey({
598
- explicitKey: optionString(options, "hostedRunIdempotencyKey"),
599
- retry: parseBooleanOption(options.hostedRunRetry),
600
- localHead: state.git.head,
601
- sourceHead: pushStatus.hostedSourceMaterialization?.sourceCommitSha ?? result.sourceUpload.sourceCommitSha,
602
- runtimeAgentId: hostedRunRuntimeAgentId,
603
- targetProjectId: hostedRunTargetProjectId,
604
- input: hostedRunInput
605
- });
606
- await saveProfilePushStatus({
607
- ...pushStatus,
608
- promotionStatus: "hosted_run_pending",
609
- hostedRunStatus: "running",
610
- hostedRunAgentId: hostedRunRuntimeAgentId,
611
- hostedRunAt: hostedRunStartedAt
612
- });
613
- try {
614
- hostedRun = await client.agents.run(hostedRunRuntimeAgentId, {
615
- teamId,
616
- ...hostedRunConversationId ? { conversationId: hostedRunConversationId } : {},
617
- ...hostedRunTargetProjectId ? { targetProjectId: hostedRunTargetProjectId } : {},
618
- ...hostedRunTargetProjectId ? { targetProject: { id: hostedRunTargetProjectId } } : {},
619
- idempotencyKey: hostedRunIdempotencyKey,
620
- input: hostedRunInput,
621
- metadata: {
622
- source: "openpond_profile_push_run",
623
- ...hostedRunConversationId ? { conversationId: hostedRunConversationId } : {},
624
- targetProjectId: hostedRunTargetProjectId || null,
625
- localHead: state.git.head,
626
- hostedHead: result.sourceUpload.sourceCommitSha,
627
- hostedRunIdempotencyKey,
628
- hostedRunRetry: parseBooleanOption(options.hostedRunRetry),
629
- materializedProjectId: pushStatus.hostedSourceMaterialization?.projectId ?? null,
630
- materializedSourceCommitSha: pushStatus.hostedSourceMaterialization?.sourceCommitSha ?? null,
631
- sourceRef: pushStatus.hostedSourceMaterialization?.sourceRef ?? result.sourceUpload.sourceRef,
632
- publishedSnapshotId: pushStatus.hostedPublish?.snapshotId ?? null,
633
- manifestHash: pushStatus.hostedPublish?.manifestHash ?? pushStatus.hostedSourceCheck?.manifestHash ?? null
634
- },
635
- runtimeSourcePolicy: publishHostedSource ? {
636
- requirePublishedSnapshot: true,
637
- source: "diagnostic"
638
- } : {
639
- allowLatestSource: true,
640
- source: "diagnostic"
641
- }
642
- });
643
- const hostedRunSummary = hostedRunSummaryFromPayload({
644
- agentId: hostedRunRuntimeAgentId,
645
- runResult: hostedRun
646
- });
647
- const hostedRunStatus = hostedRunStatusFromRunSummary(hostedRunSummary);
648
- await saveProfilePushStatus({
649
- ...pushStatus,
650
- promotionStatus: hostedRunStatus === "passed" ? "hosted_run_passed" : hostedRunStatus === "failed" ? "hosted_run_failed" : "hosted_run_pending",
651
- hostedRunStatus,
652
- hostedRunAgentId: hostedRunRuntimeAgentId,
653
- hostedRunId: hostedRun.run.id,
654
- hostedRunAt: hostedRun.run.createdAt ?? hostedRunStartedAt,
655
- hostedRun: hostedRunSummary
656
- });
657
- } catch (error) {
658
- const message = error instanceof Error ? error.message : String(error);
659
- await saveProfilePushStatus({
660
- ...pushStatus,
661
- promotionStatus: "hosted_run_failed",
662
- hostedRunStatus: "failed",
663
- hostedRunAgentId: hostedRunRuntimeAgentId,
664
- hostedRunAt: (/* @__PURE__ */ new Date()).toISOString(),
665
- hostedRun: {
666
- status: "failed",
667
- agentId: hostedRunRuntimeAgentId,
668
- error: message
669
- },
670
- error: message
671
- });
672
- throw new Error(`Hosted invocation failed to start after push: ${message}`);
673
- }
674
- }
675
- if (parseBooleanOption(options.json)) {
676
- console.log(
677
- JSON.stringify(
678
- {
679
- ...result,
680
- uploaded: summarizeProfileSourceUpload(upload),
681
- hostedSourceMaterialization: pushStatus.hostedSourceMaterialization ?? null,
682
- hostedSourceChecks,
683
- hostedSourcePublish,
684
- hostedRun
685
- },
686
- null,
687
- 2
688
- )
689
- );
690
- return;
691
- }
692
- console.log(`Pushed OpenPond profile ${state.activeProfile ?? "default"} to hosted profile repo.`);
693
- console.log(`Project id: ${result.profile.project.id}`);
694
- console.log(`Local head: ${state.git.head}`);
695
- console.log(`Hosted source commit: ${result.sourceUpload.sourceCommitSha ?? "unknown"}`);
696
- console.log(
697
- `Uploaded ${upload.fileCount} file(s), ${upload.totalBytes} byte(s) via ${upload.transport.mode} (limits: ${upload.limits.maxFiles} files, ${upload.limits.maxFileBytes} bytes/file, ${upload.limits.maxTotalBytes} bytes total).`
698
- );
699
- console.log(
700
- hostedRun ? `Hosted invocation: running ${hostedRun.run.id}` : "Hosted invocation: not started"
701
- );
702
- if (pushStatus.hostedSourceMaterialization) {
703
- console.log(
704
- `Hosted materialized: ${pushStatus.hostedSourceMaterialization.status}` + (pushStatus.hostedSourceMaterialization.projectId ? ` ${pushStatus.hostedSourceMaterialization.projectId}` : "") + (pushStatus.hostedSourceMaterialization.sourceCommitSha ? ` ${pushStatus.hostedSourceMaterialization.sourceCommitSha}` : "")
705
- );
706
- }
707
- if (pushStatus.hostedSourceCheck) {
708
- console.log(`Hosted source checks: ${pushStatus.hostedSourceCheck.status}`);
709
- }
710
- if (pushStatus.hostedPublish) {
711
- console.log(
712
- `Hosted publish: ${pushStatus.hostedPublish.status}` + (pushStatus.hostedPublish.snapshotId ? ` ${pushStatus.hostedPublish.snapshotId}` : "")
713
- );
714
- }
715
- console.log(`Uploaded files: ${upload.fileCount}`);
716
- }
717
- function summarizeProfileSourceUpload(upload) {
718
- return {
719
- fileCount: upload.fileCount,
720
- totalBytes: upload.totalBytes,
721
- limits: upload.limits,
722
- transport: upload.transport
723
- };
724
- }
725
- function normalizeHostedProfileManifest(manifest) {
726
- return {
727
- ...manifest,
728
- profiles: Object.fromEntries(
729
- Object.entries(manifest.profiles).map(([name, profile]) => [
730
- name,
731
- {
732
- path: profile.path,
733
- defaultAgent: profile.defaultAgent ?? "default",
734
- enabledAgents: profile.enabledAgents ?? []
735
- }
736
- ])
737
- )
738
- };
739
- }
740
- async function collectProfileSourceUploadForPush(input) {
741
- const repoPath = input.state.repoPath;
742
- if (!repoPath) {
743
- throw new Error("Active OpenPond profile is missing a repository path.");
744
- }
745
- const collected = await collectProfileSourceUploadEntries(repoPath);
746
- if (!input.hostedSourceAgentId) return collected;
747
- if (!input.state.sourcePath) {
748
- throw new Error("Active OpenPond profile is missing a source path.");
749
- }
750
- const agent = input.state.agents.find(
751
- (candidate) => candidate.id === input.hostedSourceAgentId
752
- );
753
- if (!agent) {
754
- throw new Error(
755
- `Profile agent not found for hosted source upload: ${input.hostedSourceAgentId}`
756
- );
757
- }
758
- const sourceRoot = resolveProfileAgentSourceRoot2(
759
- input.state.sourcePath,
760
- agent.path
761
- );
762
- const relativeSourceRoot = path2.relative(repoPath, sourceRoot).replace(/\\/g, "/");
763
- if (relativeSourceRoot.startsWith("..") || path2.isAbsolute(relativeSourceRoot)) {
764
- throw new Error(`Profile agent path escapes profile repo: ${agent.path}`);
765
- }
766
- const agentSdk = await collectAgentSdkProjectSourceUploadEntries(
767
- sourceRoot,
768
- []
769
- );
770
- if (agentSdk.entries.length === 0) return collected;
771
- return mergeProjectSourceUploadEntries(
772
- collected,
773
- agentSdk.entries.map((entry) => ({
774
- ...entry,
775
- path: relativeSourceRoot ? `${relativeSourceRoot}/${entry.path}` : entry.path
776
- }))
777
- );
778
- }
779
- function resolveProfileAgentSourceRoot2(sourcePath, agentPath) {
780
- const normalized = agentPath.replace(/\\/g, "/");
781
- const absolute = path2.resolve(sourcePath, normalized);
782
- const relative = path2.relative(sourcePath, absolute);
783
- if (relative.startsWith("..") || path2.isAbsolute(relative)) {
784
- throw new Error(`Profile agent path escapes profile source: ${agentPath}`);
785
- }
786
- return normalized === "agent/agent.ts" || normalized.endsWith("/agent.ts") ? sourcePath : absolute;
787
- }
788
- function record2(value) {
789
- return value && typeof value === "object" && !Array.isArray(value) ? value : null;
790
- }
791
- function text2(value) {
792
- return typeof value === "string" && value.trim() ? value.trim() : null;
793
- }
794
- function resolveHostedRuntimeAgentIdForRun(state, hostedRunAgentId) {
795
- if (!hostedRunAgentId) return null;
796
- const materialization = state.hosted?.hostedSourceMaterialization;
797
- if (materialization?.agentId === hostedRunAgentId && materialization.runtimeAgentId) {
798
- return materialization.runtimeAgentId;
799
- }
800
- return hostedRunAgentId;
801
- }
802
- async function bindValidatedHostedRuntimeSource(input) {
803
- if (!input.sourceRef || !input.sourceCommitSha) return;
804
- await input.client.agents.update(input.runtimeAgentId, {
805
- teamId: input.teamId,
806
- runtimeSource: {
807
- mode: "latest_source",
808
- sourceRef: input.sourceRef,
809
- sourceCommitSha: input.sourceCommitSha,
810
- buildStatus: "succeeded",
811
- validationStatus: "passed",
812
- validatedAt: input.validatedAt
813
- }
814
- });
815
- }
816
- function sourceCheckStatusPassed(status) {
817
- if (!status) return false;
818
- const finalResultState = text2(status.finalResultState)?.toLowerCase();
819
- if (finalResultState && finalResultState !== "completed" && !passingStatus(finalResultState)) {
820
- return false;
821
- }
822
- const checkRuns = Array.isArray(status.checkRuns) ? status.checkRuns.map(record2).filter((item) => Boolean(item)) : [];
823
- if (checkRuns.some(checkRunFailed)) return false;
824
- const buildPassed = checkRuns.some(
825
- (run) => checkRunCommand(run).includes("build") && checkEvidencePassed(run)
826
- );
827
- const validationPassed = checkEvidencePassed(record2(status.validation)) || checkRuns.some(
828
- (run) => checkRunCommand(run).includes("validate") && checkEvidencePassed(run)
829
- );
830
- const evalEvidence = record2(status.eval);
831
- const evalRequired = (text2(status.requestedCheckKind) ?? "all") === "all" || (text2(status.requestedCheckKind) ?? "") === "eval" || Boolean(evalEvidence) || checkRuns.some((run) => checkRunCommand(run).includes("eval"));
832
- const evalPassed = !evalRequired || checkEvidencePassed(evalEvidence) || checkRuns.some(
833
- (run) => checkRunCommand(run).includes("eval") && checkEvidencePassed(run)
834
- );
835
- return buildPassed && validationPassed && evalPassed;
836
- }
837
- function checkRunCommand(run) {
838
- return (text2(run.command) ?? "").toLowerCase();
839
- }
840
- function checkRunFailed(run) {
841
- const passed = run.passed;
842
- if (typeof passed === "boolean") return !passed;
843
- const exitCode = run.exitCode;
844
- if (typeof exitCode === "number" && exitCode !== 0) return true;
845
- const status = text2(run.status)?.toLowerCase();
846
- return Boolean(status && failingStatus(status));
847
- }
848
- function checkEvidencePassed(evidence) {
849
- if (!evidence) return false;
850
- if (typeof evidence.passed === "boolean") return evidence.passed;
851
- const failed = numericEvidence(evidence.failed) ?? numericEvidence(evidence.failedCount);
852
- if (failed !== null && failed > 0) return false;
853
- const exitCode = evidence.exitCode;
854
- if (typeof exitCode === "number") return exitCode === 0;
855
- const status = text2(evidence.status)?.toLowerCase();
856
- return Boolean(status && passingStatus(status));
857
- }
858
- function numericEvidence(value) {
859
- if (typeof value === "number" && Number.isFinite(value)) return value;
860
- if (typeof value === "string" && value.trim()) {
861
- const parsed = Number(value);
862
- return Number.isFinite(parsed) ? parsed : null;
863
- }
864
- return null;
865
- }
866
- function passingStatus(status) {
867
- return status === "passed" || status === "succeeded" || status === "success";
868
- }
869
- function failingStatus(status) {
870
- return status === "failed" || status === "failure" || status === "cancelled";
871
- }
872
- async function runHostedProfileStatusCommand(options) {
873
- const teamId = requiredTeamId(
874
- options,
875
- "usage: openpond profile hosted status"
876
- );
877
- const client = await resolveSandboxClient(options);
878
- const profile = await client.profile.get({ teamId });
879
- if (parseBooleanOption(options.json)) {
880
- console.log(JSON.stringify({ profile }, null, 2));
881
- return;
882
- }
883
- if (!profile) {
884
- console.log("No hosted OpenPond profile repo found.");
885
- console.log("Run `openpond profile ensure-hosted --team-id <id>` to create one.");
886
- return;
887
- }
888
- printHostedProfileSummary(profile);
889
- }
890
- async function runHostedProfileEnsureCommand(options) {
891
- const teamId = requiredTeamId(
892
- options,
893
- "usage: openpond profile ensure-hosted"
894
- );
895
- const client = await resolveSandboxClient(options);
896
- const profile = await client.profile.ensureHosted({ teamId });
897
- if (parseBooleanOption(options.json)) {
898
- console.log(JSON.stringify({ profile }, null, 2));
899
- return;
900
- }
901
- printHostedProfileSummary(profile);
902
- }
903
- async function runOpenPondAgentsCommand(options, rest) {
904
- const subcommand = rest[0] ?? "list";
905
- if (subcommand !== "list") {
906
- throw new Error("usage: openpond agents list [--json]");
907
- }
908
- const state = await loadOpenPondProfileState();
909
- if (state.error) throw new Error(state.error);
910
- if (parseBooleanOption(options.json)) {
911
- console.log(JSON.stringify({ agents: state.agents, profile: state }, null, 2));
912
- return;
913
- }
914
- if (state.mode === "none") {
915
- console.log("No active OpenPond profile. Run `openpond init`.");
916
- return;
917
- }
918
- if (state.agents.length === 0) {
919
- console.log(`No agents found in ${state.activeProfile}.`);
920
- return;
921
- }
922
- for (const agent of state.agents) {
923
- console.log(`${agent.id} ${agent.enabled ? "enabled" : "disabled"} ${agent.path}`);
924
- }
925
- }
926
- async function runOpenPondProfileSdkAlias(command, options, rest) {
927
- const cwd = optionString(options, "cwd");
928
- const args = [...rest, ...optionArgs(options, /* @__PURE__ */ new Set(["cwd", "account", "profile", "handle", "baseUrl"]))];
929
- await runProfileSdkCommand({
930
- command,
931
- cwd: cwd ? path2.resolve(cwd) : void 0,
932
- args,
933
- inherit: true
934
- });
935
- }
936
- function printProfileState(state) {
937
- if (state.mode === "none") {
938
- console.log("No active OpenPond profile.");
939
- console.log(`Default location: ${defaultLocalProfileRepoPath()}`);
940
- return;
941
- }
942
- console.log(`Mode: ${state.mode}`);
943
- console.log(`Repo: ${state.repoPath}`);
944
- console.log(`Profile: ${state.activeProfile}`);
945
- console.log(`Source: ${state.sourcePath ?? "missing"}`);
946
- console.log(`State: ${state.summary.message}`);
947
- if (state.git) {
948
- console.log(`Git: ${state.git.branch ?? "detached"} ${state.git.shortHead ?? "no-head"}${state.git.dirty ? " dirty" : " clean"}`);
949
- if (state.git.upstream) {
950
- console.log(`Upstream: ${state.git.upstream} ahead ${state.git.ahead ?? "?"} behind ${state.git.behind ?? "?"}`);
951
- }
952
- }
953
- if (state.hosted?.projectId || state.hosted?.sourceCommitSha) {
954
- console.log(`Hosted: ${state.hosted.projectId ?? "unbound"} ${state.hosted.sourceCommitSha ?? "no-source-head"}`);
955
- if (state.hosted.hostedSourceMaterialization) {
956
- console.log(
957
- `Hosted materialized: ${state.hosted.hostedSourceMaterialization.status}` + (state.hosted.hostedSourceMaterialization.agentId ? ` ${state.hosted.hostedSourceMaterialization.agentId}` : "") + (state.hosted.hostedSourceMaterialization.sourceCommitSha ? ` ${state.hosted.hostedSourceMaterialization.sourceCommitSha}` : "")
958
- );
959
- }
960
- if (state.hosted.hostedSourceCheck) {
961
- console.log(
962
- `Hosted checks: ${state.hosted.hostedSourceCheck.status}` + (state.hosted.hostedSourceCheck.sandboxId ? ` sandbox ${state.hosted.hostedSourceCheck.sandboxId}` : "")
963
- );
964
- }
965
- if (state.hosted.hostedPublish) {
966
- console.log(
967
- `Hosted publish: ${state.hosted.hostedPublish.status}` + (state.hosted.hostedPublish.snapshotId ? ` ${state.hosted.hostedPublish.snapshotId}` : "")
968
- );
969
- }
970
- if (state.hosted.hostedRun) {
971
- console.log(
972
- `Hosted run: ${state.hosted.hostedRun.status}` + (state.hosted.hostedRun.runId ? ` ${state.hosted.hostedRun.runId}` : "") + (state.hosted.hostedRun.runtimeId ? ` runtime ${state.hosted.hostedRun.runtimeId}` : "")
973
- );
974
- }
975
- }
976
- console.log(`Catalog: ${state.catalog.actionCount} action(s)${state.catalog.stale ? " stale" : ""}`);
977
- console.log(
978
- `Setup gate: ${state.setupGate.status} (${state.setupGate.blockingCount} blocking, ${state.setupGate.optionalMissingCount} optional missing)`
979
- );
980
- if (state.summary.defaultAction) {
981
- console.log(`Default action: ${state.summary.defaultAction}`);
982
- }
983
- if (state.setupGate.blockingRequirements.length > 0) {
984
- console.log("Blocking setup:");
985
- for (const requirement of state.setupGate.blockingRequirements.slice(0, 10)) {
986
- console.log(` ${formatOpenPondProfileSetupRequirement(requirement)}`);
987
- }
988
- if (state.setupGate.blockingRequirements.length > 10) {
989
- console.log(` ... ${state.setupGate.blockingRequirements.length - 10} more`);
990
- }
991
- }
992
- if (!state.summary.checkFresh && state.summary.checkStaleReason) {
993
- console.log(`Checks: stale - ${state.summary.checkStaleReason}`);
994
- } else if (state.summary.checkFresh) {
995
- console.log("Checks: fresh");
996
- }
997
- if (state.lastCheck) {
998
- console.log(`Last check: ${state.lastCheck.command} ${state.lastCheck.status} at ${state.lastCheck.checkedAt}`);
999
- }
1000
- if (state.error) {
1001
- console.log(`Error: ${state.error}`);
1002
- }
1003
- if (state.agents.length > 0) {
1004
- console.log("Agents:");
1005
- for (const agent of state.agents) {
1006
- console.log(` ${agent.id} (${agent.enabled ? "enabled" : "disabled"}) ${agent.path}`);
1007
- }
1008
- }
1009
- if (state.skills.length > 0) {
1010
- console.log("Skills:");
1011
- for (const skill of state.skills) {
1012
- const status = skill.validationStatus === "valid" ? "valid" : skill.validationStatus;
1013
- console.log(` ${skill.name} (${status}) ${skill.path}`);
1014
- }
1015
- }
1016
- }
1017
- function printProfileDiff(state) {
1018
- if (state.mode === "none") {
1019
- console.log("No active OpenPond profile.");
1020
- return;
1021
- }
1022
- console.log(`Profile: ${state.activeProfile}`);
1023
- console.log(`State: ${state.summary.message}`);
1024
- const groups = [
1025
- ["Changed agents", state.diff.changedAgents],
1026
- ["New agents", state.diff.newAgents],
1027
- ["Deleted agents", state.diff.deletedAgents],
1028
- ["Changed skills", state.diff.changedSkills],
1029
- ["Changed actions", state.diff.changedActions],
1030
- ["Changed extensions", state.diff.changedExtensions],
1031
- ["Setup changes", state.diff.setupChanges],
1032
- ["Env requirement changes", state.diff.envRequirementChanges]
1033
- ];
1034
- for (const [label, values] of groups) {
1035
- if (values.length === 0) continue;
1036
- console.log(`${label}: ${values.join(", ")}`);
1037
- }
1038
- if (state.diff.files.length === 0) {
1039
- console.log("No source changes.");
1040
- return;
1041
- }
1042
- console.log("Files:");
1043
- for (const file of state.diff.files) {
1044
- console.log(` ${file.status.padEnd(2)} ${file.path}`);
1045
- }
1046
- }
1047
- function printProfileCatalog(state) {
1048
- if (state.mode === "none") {
1049
- console.log("No active OpenPond profile.");
1050
- return;
1051
- }
1052
- console.log(`Profile: ${state.activeProfile}`);
1053
- console.log(`Catalog: ${state.catalog.actionCount} action(s)${state.catalog.stale ? " stale" : ""}`);
1054
- console.log(
1055
- `Setup gate: ${state.setupGate.status} (${state.setupGate.blockingCount} blocking, ${state.setupGate.optionalMissingCount} optional missing)`
1056
- );
1057
- if (state.catalog.generatedAt) console.log(`Generated at: ${state.catalog.generatedAt}`);
1058
- if (state.catalog.error) console.log(`Catalog error: ${state.catalog.error}`);
1059
- if (state.actionCatalog.length === 0) {
1060
- console.log("No catalog actions found. Run `openpond inspect` or `openpond build`.");
1061
- return;
1062
- }
1063
- for (const action of state.actionCatalog) {
1064
- const label = action.label ?? action.name ?? action.id;
1065
- const visibility = action.visibility ?? "default";
1066
- const actionBlocking = state.setupGate.blockingRequirements.filter(
1067
- (requirement) => requirement.actionId === action.id
1068
- );
1069
- const setup = actionBlocking.length ? `setup_required:${actionBlocking.map((requirement) => requirement.label).join(",")}` : "setup_ready";
1070
- console.log(`${action.id} ${visibility} ${setup} ${label}`);
1071
- }
1072
- const sourceBlocking = state.setupGate.blockingRequirements.filter(
1073
- (requirement) => requirement.actionId === null
1074
- );
1075
- if (sourceBlocking.length > 0) {
1076
- console.log("Source setup blockers:");
1077
- for (const requirement of sourceBlocking) {
1078
- console.log(` ${formatOpenPondProfileSetupRequirement(requirement)}`);
1079
- }
1080
- }
1081
- }
1082
- function printHostedProfileSummary(profile) {
1083
- console.log(`Hosted profile repo: ${profile.project.name}`);
1084
- console.log(`Project id: ${profile.project.id}`);
1085
- console.log(`Role: ${profile.project.role ?? "profile"}`);
1086
- console.log(`Default profile: ${profile.defaultProfile}`);
1087
- console.log(`Source path: ${profile.sourcePath}`);
1088
- console.log(`Seed status: ${profile.seedStatus}`);
1089
- if (profile.sourceUpload?.sourceRef) {
1090
- console.log(`Source ref: ${profile.sourceUpload.sourceRef}`);
1091
- }
1092
- if (profile.sourceUpload?.sourceCommitSha) {
1093
- console.log(`Source commit: ${profile.sourceUpload.sourceCommitSha}`);
1094
- }
1095
- if (profile.seededAt) {
1096
- console.log(`Seeded at: ${profile.seededAt}`);
1097
- }
1098
- if (profile.agents.length > 0) {
1099
- console.log("Agents:");
1100
- for (const agent of profile.agents) {
1101
- console.log(` ${agent.id} (${agent.enabled ? "enabled" : "disabled"}) ${agent.path}`);
1102
- }
1103
- }
1104
- }
1105
- function optionArgs(options, ignored) {
1106
- const args = [];
1107
- const booleanFlags = /* @__PURE__ */ new Set(["force", "json"]);
1108
- for (const [key, value] of Object.entries(options)) {
1109
- if (ignored.has(key)) continue;
1110
- const flag = `--${key.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`)}`;
1111
- if (value === true || booleanFlags.has(key) && value === "true") {
1112
- args.push(flag);
1113
- } else if (booleanFlags.has(key) && value === "false") {
1114
- continue;
1115
- } else if (typeof value === "string") {
1116
- args.push(flag, value);
1117
- }
1118
- }
1119
- return args;
1120
- }
1121
- function parseJsonObjectOption(options, key) {
1122
- const raw = optionString(options, key);
1123
- if (!raw) return null;
1124
- const parsed = JSON.parse(raw);
1125
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
1126
- throw new Error(`--${key} must be a JSON object`);
1127
- }
1128
- return parsed;
1129
- }
1130
- export {
1131
- collectProfileSourceUploadForPush,
1132
- runOpenPondAgentsCommand,
1133
- runOpenPondInitCommand,
1134
- runOpenPondProfileCommand,
1135
- runOpenPondProfileSdkAlias
1136
- };