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