openpond 0.0.30 → 0.0.32

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 (115) hide show
  1. package/dist/chunks/{app-layer-FIGCNZJX.js → app-layer-CUQQUVJS.js} +20 -3
  2. package/dist/chunks/{apps-4RMNCKXS.js → apps-TAYMUCWX.js} +3 -3
  3. package/dist/chunks/{chunk-57P2GCW5.js → chunk-3UOLQG6N.js} +1 -1
  4. package/dist/chunks/{chunk-MFS3SYUH.js → chunk-3ZJIEA5F.js} +1 -1
  5. package/dist/chunks/{chunk-4S3XGFGL.js → chunk-4HQURM3N.js} +1 -1
  6. package/dist/chunks/{chunk-BNVHGSI7.js → chunk-4M4WAORL.js} +874 -798
  7. package/dist/chunks/{chunk-DANRS43D.js → chunk-5RHZKQRK.js} +14 -76
  8. package/dist/chunks/{chunk-BNPFMGZD.js → chunk-D264OHTR.js} +4 -5
  9. package/dist/chunks/{chunk-BBEVMP6O.js → chunk-DCNAXREU.js} +179 -160
  10. package/dist/chunks/chunk-E5RVRUJB.js +1222 -0
  11. package/dist/chunks/{chunk-RJXX6TJA.js → chunk-EONKWOLU.js} +2 -2
  12. package/dist/chunks/{chunk-VQX33YAG.js → chunk-FQW3AQVJ.js} +689 -121
  13. package/dist/chunks/{chunk-GGKA4HLQ.js → chunk-GYZYZGKS.js} +238 -69
  14. package/dist/chunks/{chunk-KMSMK7PI.js → chunk-OXQG773T.js} +33 -33
  15. package/dist/chunks/{chunk-BX4XSB2J.js → chunk-PJXJ2HRT.js} +1816 -1113
  16. package/dist/chunks/chunk-Q5MZCRJA.js +70 -0
  17. package/dist/chunks/{chunk-OV3KAFWB.js → chunk-W2DJR3FA.js} +1 -1
  18. package/dist/chunks/{chunk-KEDXE4BA.js → chunk-XADW35CL.js} +3 -3
  19. package/dist/chunks/{chunk-IUTUUNAX.js → chunk-Y4F4XD5V.js} +1 -1
  20. package/dist/chunks/{cli-2L4NB7HD.js → cli-WW5BVN5Z.js} +4 -3
  21. package/dist/chunks/{cli-5RL7B2Z3.js → cli-ZOCP7X5M.js} +6 -6
  22. package/dist/chunks/{core-commands-AZJZGTZS.js → core-commands-SYGK7K57.js} +4 -4
  23. package/dist/chunks/{extend-6IWYZI37.js → extend-Q5HZ7TMA.js} +11 -11
  24. package/dist/chunks/fileFromPath-DHCRY3BD.js +2151 -0
  25. package/dist/chunks/{harness-SSNXDSKM.js → harness-ZPBPQVAS.js} +3 -3
  26. package/dist/chunks/{help-MUJJMI3Q.js → help-3V3TRQNX.js} +1 -1
  27. package/dist/chunks/{opchat-RW4CFAQB.js → opchat-OUPMEFE5.js} +5 -5
  28. package/dist/chunks/{organizations-V7DTNLSI.js → organizations-5CSLBDAW.js} +4 -4
  29. package/dist/chunks/{profile-WDBKJ7YW.js → profile-OQYSXHOG.js} +206 -166
  30. package/dist/chunks/{project-agent-3TZ3BPYN.js → project-agent-TBTWOUJF.js} +6 -7
  31. package/dist/chunks/{sandbox-command-HOYHF4NC.js → sandbox-command-HCHPY7KW.js} +4 -4
  32. package/dist/chunks/{sandbox-template-IYGB4CZU.js → sandbox-template-PNTOZ6W3.js} +5 -6
  33. package/dist/chunks/{src-CBPRIWG5.js → src-C6MXLDYQ.js} +22 -6
  34. package/dist/chunks/{src-ZRQKSQTD.js → src-GZT4UX6I.js} +80887 -52945
  35. package/dist/chunks/{teams-bot-UWGCFL6C.js → teams-bot-CQ76XI6T.js} +3 -3
  36. package/dist/chunks/workspaces-DHVVOTVR.js +93 -0
  37. package/dist/cli.js +10 -10
  38. package/dist/config.d.ts +0 -2
  39. package/dist/index.js +273 -69
  40. package/dist/profile/local-profile-types.d.ts +8 -2
  41. package/dist/profile/local-profile.d.ts +3 -1
  42. package/dist/sandbox/types/org-project-agent.d.ts +1 -2
  43. package/dist/web/assets/{AppsView-Bu-Nc3Ew.js → AppsView-CF2g-7FH.js} +1 -1
  44. package/dist/web/assets/{BrowserSidebar-CCguQ-DR.js → BrowserSidebar-lUsLUl20.js} +1 -1
  45. package/dist/web/assets/CloudWorkView-BnfGW4OV.js +1 -0
  46. package/dist/web/assets/{CommandMenu-CnodJFHD.js → CommandMenu-BsS4Bgb6.js} +1 -1
  47. package/dist/web/assets/{CommunityView-CIbjNUZr.js → CommunityView-C8qVOwlp.js} +1 -1
  48. package/dist/web/assets/ComposerCreateImproveStrip-C_LIpfSq.js +1 -0
  49. package/dist/web/assets/GetStartedView-Du533wOh.js +1 -0
  50. package/dist/web/assets/LabsRoute-CgKtVYTP.css +1 -0
  51. package/dist/web/assets/LabsRoute-yk8lNMQc.js +3 -0
  52. package/dist/web/assets/{NewProjectDialog-CaKiCoVS.js → NewProjectDialog-DH7wA1z9.js} +1 -1
  53. package/dist/web/assets/ProfileSettingsSection-CqnfjiCl.css +1 -0
  54. package/dist/web/assets/ProfileSettingsSection-D7JvMZdW.js +1 -0
  55. package/dist/web/assets/SettingsView-C9TgCaWG.js +63 -0
  56. package/dist/web/assets/TeamChatView-D_CE7br9.js +3 -0
  57. package/dist/web/assets/{TerminalOverlay-C1iP4OS1.js → TerminalOverlay-CC-VDSlp.js} +1 -1
  58. package/dist/web/assets/TrainingCreationPanel-NFCoaBUI.js +1 -0
  59. package/dist/web/assets/TrainingDraftPanel-BWEmVFjM.js +1 -0
  60. package/dist/web/assets/WorkspaceDiffPanel-SlLlGZM1.js +14 -0
  61. package/dist/web/assets/{WorkspaceEnvironmentMenu-B8JJbwIz.js → WorkspaceEnvironmentMenu-BAoMBTVD.js} +1 -1
  62. package/dist/web/assets/{WorkspaceGitDialogs-B4sp9BGn.js → WorkspaceGitDialogs-CVIFrzyl.js} +1 -1
  63. package/dist/web/assets/{WorkspaceMonacoEditor-BBqimG5X.js → WorkspaceMonacoEditor-0trp0-TI.js} +3 -3
  64. package/dist/web/assets/{boxes-DAaDUabq.js → boxes-CFihgX2z.js} +1 -1
  65. package/dist/web/assets/create-pipeline-request-AJWLMTyw.js +4 -0
  66. package/dist/web/assets/{cssMode-CBF1mieJ.js → cssMode-HvqfCFyP.js} +1 -1
  67. package/dist/web/assets/{git-commit-horizontal-CAickXpN.js → git-commit-horizontal-C5mUmACv.js} +1 -1
  68. package/dist/web/assets/{htmlMode-2u8OHtWO.js → htmlMode-C8btgUt-.js} +1 -1
  69. package/dist/web/assets/index-8H-GDlM5.css +1 -0
  70. package/dist/web/assets/index-D7Vr3zcV.js +192 -0
  71. package/dist/web/assets/index-DUqAiF57.js +1 -0
  72. package/dist/web/assets/{info-CQNTh78o.js → info-D0xuy5IB.js} +1 -1
  73. package/dist/web/assets/{jsonMode-C4CWXViX.js → jsonMode-5zVz9G0X.js} +1 -1
  74. package/dist/web/assets/{lspLanguageFeatures-CBs_BOlB.js → lspLanguageFeatures-DxlSSL7c.js} +1 -1
  75. package/dist/web/assets/{monaco.contribution-lOXpG2xQ.js → monaco.contribution-B1pWWwqT.js} +2 -2
  76. package/dist/web/assets/{monaco.contribution-sd3cFkcN.js → monaco.contribution-BKpVvKK9.js} +2 -2
  77. package/dist/web/assets/{monaco.contribution-C1LUxAKf.js → monaco.contribution-BXdXsSWI.js} +2 -2
  78. package/dist/web/assets/{monaco.contribution-Cpf6dWsh.js → monaco.contribution-CIjjzpUR.js} +2 -2
  79. package/dist/web/assets/{monitor-DsIswrMV.js → monitor-B4-9Shtp.js} +1 -1
  80. package/dist/web/assets/{play-CeRw21NV.js → play-BJdhBqQE.js} +1 -1
  81. package/dist/web/assets/{python-CXYq3BUl.js → python-CEK8J4w_.js} +1 -1
  82. package/dist/web/assets/{refresh-cw-N5b_6AP5.js → refresh-cw-DE0u_nmZ.js} +1 -1
  83. package/dist/web/assets/{reply-BSKjZrJg.js → reply-2MfLJ93n.js} +1 -1
  84. package/dist/web/assets/{save-D0oHH1a3.js → save-CBIVKaf8.js} +1 -1
  85. package/dist/web/assets/{toggleHighContrast-DRjlcwes.js → toggleHighContrast-CC73mtvA.js} +1 -1
  86. package/dist/web/assets/training-BY8siNUK.css +1 -0
  87. package/dist/web/assets/training-model-data-BXUCzS0p.js +1 -0
  88. package/dist/web/assets/{tsMode-x-1A7ZcB.js → tsMode-Bhn9wr_1.js} +1 -1
  89. package/dist/web/assets/{wifi-off-Dt52ofzh.js → wifi-off-BKTqnqj0.js} +1 -1
  90. package/dist/web/assets/{workers-Ciff6Dzi.js → workers-C_adgrEg.js} +1 -1
  91. package/dist/web/assets/{yaml-CB67Kxnz.js → yaml-DDRAcADU.js} +1 -1
  92. package/dist/web/index.html +2 -2
  93. package/package.json +1 -1
  94. package/dist/chunks/chunk-OG75GMVO.js +0 -1
  95. package/dist/web/assets/CloudWorkView-Dr3xqLE5.js +0 -1
  96. package/dist/web/assets/GetStartedView-C8nyH_PT.js +0 -1
  97. package/dist/web/assets/LabsExtensions-GtJzxDnK.js +0 -1
  98. package/dist/web/assets/LabsProfile-DG7rWYur.js +0 -1
  99. package/dist/web/assets/LabsRoute-D6MDHBzq.js +0 -2
  100. package/dist/web/assets/LabsRoute-TEt9j1vB.css +0 -1
  101. package/dist/web/assets/LabsSignals-BfsDN86w.js +0 -1
  102. package/dist/web/assets/LabsSignals-D6iA6Ryl.css +0 -1
  103. package/dist/web/assets/ProfileSettingsSection-DTQS2DVL.css +0 -1
  104. package/dist/web/assets/ProfileSettingsSection-DxEzoF3K.js +0 -1
  105. package/dist/web/assets/ProfileView-CEscW7Ru.js +0 -1
  106. package/dist/web/assets/SettingsView-JIRR_FO4.js +0 -63
  107. package/dist/web/assets/TeamChatView-B5M1ThhJ.js +0 -3
  108. package/dist/web/assets/TrainingSettingsSection-BDYvI2te.js +0 -1
  109. package/dist/web/assets/TrainingView-CoCFK6W3.js +0 -5
  110. package/dist/web/assets/WorkspaceDiffPanel-CMxKQeo7.js +0 -14
  111. package/dist/web/assets/index-BdY6A-YN.css +0 -1
  112. package/dist/web/assets/index-CU2qhUYV.js +0 -195
  113. package/dist/web/assets/index-Dz2B3-4C.js +0 -1
  114. package/dist/web/assets/settings-lists-BEg6LMcy.css +0 -1
  115. package/dist/web/assets/training-model-data-BPrc68VG.js +0 -1
@@ -1,14 +1,14 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
2
  import {
3
3
  runProcessCommand
4
- } from "./chunk-BNPFMGZD.js";
4
+ } from "./chunk-D264OHTR.js";
5
5
  import {
6
6
  CliUsageError
7
- } from "./chunk-MFS3SYUH.js";
7
+ } from "./chunk-3ZJIEA5F.js";
8
8
  import {
9
9
  optionString,
10
10
  parseBooleanOption
11
- } from "./chunk-KMSMK7PI.js";
11
+ } from "./chunk-OXQG773T.js";
12
12
  import "./chunk-UACZUFIA.js";
13
13
 
14
14
  // src/cli/harness.ts
@@ -3,7 +3,7 @@ import {
3
3
  CLI_GLOBAL_OPTION_SCHEMA,
4
4
  formatCliCommandUsage,
5
5
  listCliCommandDefinitions
6
- } from "./chunk-KMSMK7PI.js";
6
+ } from "./chunk-OXQG773T.js";
7
7
  import "./chunk-UACZUFIA.js";
8
8
 
9
9
  // src/cli/help.ts
@@ -1,26 +1,26 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
2
  import {
3
3
  runOpChatSmoke
4
- } from "./chunk-57P2GCW5.js";
4
+ } from "./chunk-3UOLQG6N.js";
5
5
  import {
6
6
  getOpChatModel,
7
7
  listOpChatModels,
8
8
  resolveOpChatApiBaseUrl,
9
9
  sendHostedChatTurn,
10
10
  streamHostedChatTurn
11
- } from "./chunk-OV3KAFWB.js";
11
+ } from "./chunk-W2DJR3FA.js";
12
12
  import {
13
13
  ensureApiKey,
14
14
  loadConfig
15
- } from "./chunk-BNPFMGZD.js";
15
+ } from "./chunk-D264OHTR.js";
16
16
  import {
17
17
  resolveApiBaseUrlOption,
18
18
  resolveBaseUrl,
19
19
  resolveChatApiBaseUrlOption
20
- } from "./chunk-MFS3SYUH.js";
20
+ } from "./chunk-3ZJIEA5F.js";
21
21
  import {
22
22
  parseBooleanOption
23
- } from "./chunk-KMSMK7PI.js";
23
+ } from "./chunk-OXQG773T.js";
24
24
  import "./chunk-UACZUFIA.js";
25
25
 
26
26
  // src/cli/opchat.ts
@@ -2,19 +2,19 @@ import { createRequire as __openpondCreateRequire } from "node:module"; var requ
2
2
  import {
3
3
  DEFAULT_OPENPOND_API_BASE_URL,
4
4
  DEFAULT_OPENPOND_WEB_BASE_URL
5
- } from "./chunk-BX4XSB2J.js";
5
+ } from "./chunk-PJXJ2HRT.js";
6
6
  import "./chunk-LHYK6QO2.js";
7
7
  import "./chunk-WYDVQOBL.js";
8
8
  import {
9
9
  resolveSandboxClient
10
- } from "./chunk-BNPFMGZD.js";
11
- import "./chunk-MFS3SYUH.js";
10
+ } from "./chunk-D264OHTR.js";
11
+ import "./chunk-3ZJIEA5F.js";
12
12
  import {
13
13
  parseBooleanOption,
14
14
  parseCsvOption,
15
15
  parseIntegerOption,
16
16
  parseJsonOption
17
- } from "./chunk-KMSMK7PI.js";
17
+ } from "./chunk-OXQG773T.js";
18
18
  import "./chunk-UACZUFIA.js";
19
19
 
20
20
  // src/cli/organizations.ts
@@ -5,7 +5,7 @@ import {
5
5
  mergeProjectSourceUploadEntries,
6
6
  parseAgentSourceCheckDispatch,
7
7
  parseAgentSourceCheckKind
8
- } from "./chunk-BNVHGSI7.js";
8
+ } from "./chunk-4M4WAORL.js";
9
9
  import {
10
10
  buildHostedRunIdempotencyKey,
11
11
  collectProfileSourceUploadEntries,
@@ -22,27 +22,205 @@ import {
22
22
  runProfileCheck,
23
23
  runProfileSdkCommand,
24
24
  saveProfilePushStatus
25
- } from "./chunk-GGKA4HLQ.js";
26
- import "./chunk-4S3XGFGL.js";
27
- import "./chunk-VQX33YAG.js";
25
+ } from "./chunk-GYZYZGKS.js";
26
+ import "./chunk-4HQURM3N.js";
27
+ import "./chunk-FQW3AQVJ.js";
28
28
  import "./chunk-LHYK6QO2.js";
29
- import "./chunk-OG75GMVO.js";
30
29
  import "./chunk-BYAPLT37.js";
31
30
  import "./chunk-WYDVQOBL.js";
32
31
  import {
33
32
  resolveSandboxClient
34
- } from "./chunk-BNPFMGZD.js";
35
- import "./chunk-MFS3SYUH.js";
33
+ } from "./chunk-D264OHTR.js";
34
+ import "./chunk-3ZJIEA5F.js";
36
35
  import {
37
36
  optionString,
38
37
  parseBooleanOption,
39
38
  requiredTeamId
40
- } from "./chunk-KMSMK7PI.js";
39
+ } from "./chunk-OXQG773T.js";
41
40
  import "./chunk-UACZUFIA.js";
42
41
 
43
42
  // src/cli/profile.ts
44
43
  import { readFile } from "node:fs/promises";
44
+ import path2 from "node:path";
45
+
46
+ // ../../packages/cloud/src/profile/hosted-agent-materialization.ts
45
47
  import path from "node:path";
48
+ async function materializeHostedProfileAgentSource(input) {
49
+ if (!input.state.sourcePath) {
50
+ throw new Error("Active OpenPond profile is missing a source path.");
51
+ }
52
+ const agent = input.state.agents.find(
53
+ (candidate) => candidate.id === input.agentId
54
+ );
55
+ if (!agent) {
56
+ throw new Error(
57
+ `Profile agent not found for hosted materialization: ${input.agentId}`
58
+ );
59
+ }
60
+ if (!agent.enabled) {
61
+ throw new Error(`Profile agent is disabled: ${input.agentId}`);
62
+ }
63
+ const sourceRoot = resolveProfileAgentSourceRoot(
64
+ input.state.sourcePath,
65
+ agent.path
66
+ );
67
+ const collected = await collectProjectSourceUploadEntries(sourceRoot);
68
+ const agentSdk = await collectAgentSdkProjectSourceUploadEntries(
69
+ sourceRoot,
70
+ collected.entries
71
+ );
72
+ const upload = mergeProjectSourceUploadEntries(
73
+ collected,
74
+ agentSdk.entries
75
+ );
76
+ const materializationProject = await getOrCreateHostedSourceProject({
77
+ client: input.client,
78
+ teamId: input.teamId,
79
+ projectId: input.projectId ?? null,
80
+ profileProjectId: input.profileProjectId,
81
+ profileName: input.profileName,
82
+ agentId: input.agentId,
83
+ localHead: input.localHead,
84
+ hostedHead: input.hostedHead
85
+ });
86
+ const uploadedProject = await input.client.projects.uploadSource(
87
+ materializationProject.id,
88
+ {
89
+ teamId: input.teamId,
90
+ entries: upload.entries,
91
+ branch: input.sourceRef,
92
+ commitMessage: `Materialize OpenPond profile agent ${input.agentId}`
93
+ }
94
+ );
95
+ const syncedProject = await input.client.projects.sync(uploadedProject.id, {
96
+ teamId: input.teamId
97
+ });
98
+ const sourceCommitSha = sandboxProjectSourceCommitSha(syncedProject) ?? sandboxProjectSourceCommitSha(uploadedProject);
99
+ const sourceRef = sandboxProjectSourceRef(syncedProject) ?? sandboxProjectSourceRef(uploadedProject) ?? input.sourceRef;
100
+ const runtimeAgent = await input.client.agents.upsert({
101
+ teamId: input.teamId,
102
+ projectId: syncedProject.id,
103
+ name: agent.name || input.agentId,
104
+ slug: hostedRuntimeAgentSlug(input.profileName, input.agentId),
105
+ selectedEntrypoint: hostedEntrypointForProfileAgent(
106
+ input.state,
107
+ input.agentId
108
+ ),
109
+ triggerType: "manual",
110
+ runtimeSource: {
111
+ mode: "latest_source",
112
+ ...sourceRef ? { sourceRef } : {},
113
+ ...sourceCommitSha ? { sourceCommitSha } : {}
114
+ },
115
+ metadata: {
116
+ source: "openpond_profile_agent_materialization",
117
+ profileProjectId: input.profileProjectId,
118
+ profileName: input.profileName,
119
+ profileAgentId: input.agentId,
120
+ profileSourcePath: agent.path,
121
+ localHead: input.localHead,
122
+ hostedHead: input.hostedHead
123
+ },
124
+ externalId: `openpond-profile-agent:${input.profileProjectId}:${input.profileName}:${input.agentId}`
125
+ });
126
+ const uploadMetadata = record(agentSdk.uploadMetadata);
127
+ const commands = record(uploadMetadata?.commands);
128
+ const dependencySetup = record(uploadMetadata?.dependencySetup);
129
+ const setupCommands = stringArray(dependencySetup?.commands);
130
+ const validationCommands = [
131
+ text(commands?.validate),
132
+ text(commands?.eval)
133
+ ].filter((command) => Boolean(command));
134
+ return {
135
+ status: "uploaded",
136
+ agentId: input.agentId,
137
+ runtimeAgentId: runtimeAgent.id,
138
+ projectId: syncedProject.id,
139
+ sourceRoot,
140
+ sourceRef,
141
+ sourceCommitSha: sourceCommitSha ?? null,
142
+ manifestHash: syncedProject.sandboxManifestHash ?? null,
143
+ manifestPath: syncedProject.sandboxManifestPath ?? null,
144
+ manifestSyncedAt: syncedProject.sandboxManifestSyncedAt ?? null,
145
+ fileCount: upload.fileCount,
146
+ totalBytes: upload.totalBytes,
147
+ generatedManifestPath: agentSdk.generatedManifestPath,
148
+ synthesizedOpenPondYaml: agentSdk.synthesizedOpenPondYaml,
149
+ uploadMetadataPath: agentSdk.uploadMetadataPath,
150
+ setupCommands,
151
+ validationCommands,
152
+ materializedAt: (/* @__PURE__ */ new Date()).toISOString()
153
+ };
154
+ }
155
+ async function getOrCreateHostedSourceProject(input) {
156
+ if (input.projectId) {
157
+ try {
158
+ return await input.client.projects.get(input.projectId, {
159
+ teamId: input.teamId
160
+ });
161
+ } catch {
162
+ }
163
+ }
164
+ return input.client.projects.upsert({
165
+ teamId: input.teamId,
166
+ name: `OpenPond profile ${input.profileName} ${input.agentId}`,
167
+ sourceType: "manual",
168
+ externalId: `openpond-profile:${input.profileProjectId}:${input.profileName}:${input.agentId}`,
169
+ description: `Materialized OpenPond profile agent ${input.agentId} for hosted Team execution.`,
170
+ metadata: {
171
+ source: "openpond_profile_agent_materialization",
172
+ profileProjectId: input.profileProjectId,
173
+ profileName: input.profileName,
174
+ profileAgentId: input.agentId,
175
+ localHead: input.localHead,
176
+ hostedHead: input.hostedHead
177
+ }
178
+ });
179
+ }
180
+ function resolveProfileAgentSourceRoot(sourcePath, agentPath) {
181
+ const normalized = agentPath.replace(/\\/g, "/");
182
+ const absolute = path.resolve(sourcePath, normalized);
183
+ const relative = path.relative(sourcePath, absolute);
184
+ if (relative.startsWith("..") || path.isAbsolute(relative)) {
185
+ throw new Error(`Profile agent path escapes profile source: ${agentPath}`);
186
+ }
187
+ return normalized === "agent/agent.ts" || normalized.endsWith("/agent.ts") ? sourcePath : absolute;
188
+ }
189
+ function hostedEntrypointForProfileAgent(state, agentId) {
190
+ const action = state.actionCatalog.find(
191
+ (candidate) => candidate.agentId === agentId && (candidate.sourceActionId === "chat" || candidate.name === "chat")
192
+ ) ?? state.actionCatalog.find((candidate) => candidate.agentId === agentId);
193
+ return {
194
+ scope: "action",
195
+ name: typeof action?.sourceActionId === "string" && action.sourceActionId || typeof action?.name === "string" && action.name || "chat"
196
+ };
197
+ }
198
+ function hostedRuntimeAgentSlug(profileName, agentId) {
199
+ const slug = `openpond-profile-${profileName}-${agentId}`.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
200
+ return slug || "openpond-profile-agent";
201
+ }
202
+ function sandboxProjectSourceCommitSha(project) {
203
+ const item = record(project);
204
+ const sourceConfig = record(item?.sourceConfig);
205
+ const metadata = record(item?.metadata);
206
+ return text(sourceConfig?.sourceCommitSha) ?? text(sourceConfig?.commitSha) ?? text(sourceConfig?.remoteSha) ?? text(metadata?.projectSourceUploadCommitSha) ?? text(metadata?.sourceCommitSha) ?? text(item?.templateRemoteSha);
207
+ }
208
+ function sandboxProjectSourceRef(project) {
209
+ const item = record(project);
210
+ const sourceConfig = record(item?.sourceConfig);
211
+ return text(sourceConfig?.sourceRef) ?? text(sourceConfig?.branch) ?? text(item?.gitBranch) ?? text(item?.defaultBranch);
212
+ }
213
+ function record(value) {
214
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
215
+ }
216
+ function text(value) {
217
+ return typeof value === "string" && value.trim() ? value.trim() : null;
218
+ }
219
+ function stringArray(value) {
220
+ return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
221
+ }
222
+
223
+ // src/cli/profile.ts
46
224
  async function runOpenPondInitCommand(options) {
47
225
  const state = await initLocalProfileRepo({
48
226
  repoPath: optionString(options, "path") || defaultLocalProfileRepoPath(),
@@ -323,7 +501,7 @@ async function runProfilePushCommand(options) {
323
501
  if (refreshed) {
324
502
  hostedSourceChecks = refreshed;
325
503
  }
326
- const sourceCheckStatus = record(hostedSourceChecks.sourceCheckStatus);
504
+ const sourceCheckStatus = record2(hostedSourceChecks.sourceCheckStatus);
327
505
  if (sourceCheckStatusPassed(sourceCheckStatus)) {
328
506
  await bindValidatedHostedRuntimeSource({
329
507
  client,
@@ -576,12 +754,12 @@ async function collectProfileSourceUploadForPush(input) {
576
754
  `Profile agent not found for hosted source upload: ${input.hostedSourceAgentId}`
577
755
  );
578
756
  }
579
- const sourceRoot = resolveProfileAgentSourceRoot(
757
+ const sourceRoot = resolveProfileAgentSourceRoot2(
580
758
  input.state.sourcePath,
581
759
  agent.path
582
760
  );
583
- const relativeSourceRoot = path.relative(repoPath, sourceRoot).replace(/\\/g, "/");
584
- if (relativeSourceRoot.startsWith("..") || path.isAbsolute(relativeSourceRoot)) {
761
+ const relativeSourceRoot = path2.relative(repoPath, sourceRoot).replace(/\\/g, "/");
762
+ if (relativeSourceRoot.startsWith("..") || path2.isAbsolute(relativeSourceRoot)) {
585
763
  throw new Error(`Profile agent path escapes profile repo: ${agent.path}`);
586
764
  }
587
765
  const agentSdk = await collectAgentSdkProjectSourceUploadEntries(
@@ -597,159 +775,21 @@ async function collectProfileSourceUploadForPush(input) {
597
775
  }))
598
776
  );
599
777
  }
600
- async function materializeHostedProfileAgentSource(input) {
601
- if (!input.state.sourcePath) {
602
- throw new Error("Active OpenPond profile is missing a source path.");
603
- }
604
- const agent = input.state.agents.find((candidate) => candidate.id === input.agentId);
605
- if (!agent) {
606
- throw new Error(`Profile agent not found for hosted materialization: ${input.agentId}`);
607
- }
608
- const sourceRoot = resolveProfileAgentSourceRoot(input.state.sourcePath, agent.path);
609
- const collected = await collectProjectSourceUploadEntries(sourceRoot);
610
- const agentSdk = await collectAgentSdkProjectSourceUploadEntries(sourceRoot, collected.entries);
611
- const upload = mergeProjectSourceUploadEntries(collected, agentSdk.entries);
612
- const materializationProject = await getOrCreateHostedSourceProject({
613
- client: input.client,
614
- teamId: input.teamId,
615
- projectId: input.projectId ?? null,
616
- profileProjectId: input.profileProjectId,
617
- profileName: input.profileName,
618
- agentId: input.agentId,
619
- localHead: input.localHead,
620
- hostedHead: input.hostedHead
621
- });
622
- const uploadedProject = await input.client.projects.uploadSource(materializationProject.id, {
623
- teamId: input.teamId,
624
- entries: upload.entries,
625
- branch: input.sourceRef,
626
- commitMessage: `Materialize OpenPond profile agent ${input.agentId}`
627
- });
628
- const syncedProject = await input.client.projects.sync(uploadedProject.id, {
629
- teamId: input.teamId
630
- });
631
- const sourceCommitSha = sandboxProjectSourceCommitSha(syncedProject) ?? sandboxProjectSourceCommitSha(uploadedProject);
632
- const sourceRef = sandboxProjectSourceRef(syncedProject) ?? sandboxProjectSourceRef(uploadedProject) ?? input.sourceRef;
633
- const selectedEntrypoint = hostedEntrypointForProfileAgent(input.state, input.agentId);
634
- const runtimeAgent = await input.client.agents.upsert({
635
- teamId: input.teamId,
636
- projectId: syncedProject.id,
637
- name: agent.name || input.agentId,
638
- slug: hostedRuntimeAgentSlug(input.profileName, input.agentId),
639
- selectedEntrypoint,
640
- triggerType: "manual",
641
- runtimeSource: {
642
- mode: "latest_source",
643
- ...sourceRef ? { sourceRef } : {},
644
- ...sourceCommitSha ? { sourceCommitSha } : {}
645
- },
646
- metadata: {
647
- source: "openpond_profile_agent_materialization",
648
- profileProjectId: input.profileProjectId,
649
- profileName: input.profileName,
650
- profileAgentId: input.agentId,
651
- profileSourcePath: agent.path,
652
- localHead: input.localHead,
653
- hostedHead: input.hostedHead
654
- },
655
- externalId: `openpond-profile-agent:${input.profileProjectId}:${input.profileName}:${input.agentId}`
656
- });
657
- const uploadMetadata = record(agentSdk.uploadMetadata);
658
- const commands = record(uploadMetadata?.commands);
659
- const dependencySetup = record(uploadMetadata?.dependencySetup);
660
- const setupCommands = stringArray(dependencySetup?.commands);
661
- const validationCommands = [
662
- text(commands?.validate),
663
- text(commands?.eval)
664
- ].filter((command) => Boolean(command));
665
- return {
666
- status: "uploaded",
667
- agentId: input.agentId,
668
- runtimeAgentId: runtimeAgent.id,
669
- projectId: syncedProject.id,
670
- sourceRoot,
671
- sourceRef,
672
- sourceCommitSha: sourceCommitSha ?? null,
673
- manifestHash: syncedProject.sandboxManifestHash ?? null,
674
- manifestPath: syncedProject.sandboxManifestPath ?? null,
675
- manifestSyncedAt: syncedProject.sandboxManifestSyncedAt ?? null,
676
- fileCount: upload.fileCount,
677
- totalBytes: upload.totalBytes,
678
- generatedManifestPath: agentSdk.generatedManifestPath,
679
- synthesizedOpenPondYaml: agentSdk.synthesizedOpenPondYaml,
680
- uploadMetadataPath: agentSdk.uploadMetadataPath,
681
- setupCommands,
682
- validationCommands,
683
- materializedAt: (/* @__PURE__ */ new Date()).toISOString()
684
- };
685
- }
686
- async function getOrCreateHostedSourceProject(input) {
687
- if (input.projectId) {
688
- try {
689
- return await input.client.projects.get(input.projectId, {
690
- teamId: input.teamId
691
- });
692
- } catch {
693
- }
694
- }
695
- return input.client.projects.upsert({
696
- teamId: input.teamId,
697
- name: `OpenPond profile ${input.profileName} ${input.agentId}`,
698
- sourceType: "manual",
699
- externalId: `openpond-profile:${input.profileProjectId}:${input.profileName}:${input.agentId}`,
700
- description: `Materialized OpenPond profile agent ${input.agentId} for hosted sandbox checks.`,
701
- metadata: {
702
- source: "openpond_profile_agent_materialization",
703
- profileProjectId: input.profileProjectId,
704
- profileName: input.profileName,
705
- profileAgentId: input.agentId,
706
- localHead: input.localHead,
707
- hostedHead: input.hostedHead
708
- }
709
- });
710
- }
711
- function resolveProfileAgentSourceRoot(sourcePath, agentPath) {
778
+ function resolveProfileAgentSourceRoot2(sourcePath, agentPath) {
712
779
  const normalized = agentPath.replace(/\\/g, "/");
713
- const absolute = path.resolve(sourcePath, normalized);
714
- const relative = path.relative(sourcePath, absolute);
715
- if (relative.startsWith("..") || path.isAbsolute(relative)) {
780
+ const absolute = path2.resolve(sourcePath, normalized);
781
+ const relative = path2.relative(sourcePath, absolute);
782
+ if (relative.startsWith("..") || path2.isAbsolute(relative)) {
716
783
  throw new Error(`Profile agent path escapes profile source: ${agentPath}`);
717
784
  }
718
785
  return normalized === "agent/agent.ts" || normalized.endsWith("/agent.ts") ? sourcePath : absolute;
719
786
  }
720
- function hostedEntrypointForProfileAgent(state, agentId) {
721
- const action = state.actionCatalog.find(
722
- (candidate) => candidate.agentId === agentId && (candidate.sourceActionId === "chat" || candidate.name === "chat")
723
- ) ?? state.actionCatalog.find((candidate) => candidate.agentId === agentId);
724
- return {
725
- scope: "action",
726
- name: typeof action?.sourceActionId === "string" && action.sourceActionId || typeof action?.name === "string" && action.name || "chat"
727
- };
728
- }
729
- function hostedRuntimeAgentSlug(profileName, agentId) {
730
- const slug = `openpond-profile-${profileName}-${agentId}`.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
731
- return slug || "openpond-profile-agent";
732
- }
733
- function sandboxProjectSourceCommitSha(project) {
734
- const item = record(project);
735
- const sourceConfig = record(item?.sourceConfig);
736
- const metadata = record(item?.metadata);
737
- return text(sourceConfig?.sourceCommitSha) ?? text(sourceConfig?.commitSha) ?? text(sourceConfig?.remoteSha) ?? text(metadata?.projectSourceUploadCommitSha) ?? text(metadata?.sourceCommitSha) ?? text(item?.templateRemoteSha);
738
- }
739
- function sandboxProjectSourceRef(project) {
740
- const item = record(project);
741
- const sourceConfig = record(item?.sourceConfig);
742
- return text(sourceConfig?.sourceRef) ?? text(sourceConfig?.branch) ?? text(item?.gitBranch) ?? text(item?.defaultBranch);
743
- }
744
- function record(value) {
787
+ function record2(value) {
745
788
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
746
789
  }
747
- function text(value) {
790
+ function text2(value) {
748
791
  return typeof value === "string" && value.trim() ? value.trim() : null;
749
792
  }
750
- function stringArray(value) {
751
- return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
752
- }
753
793
  function resolveHostedRuntimeAgentIdForRun(state, hostedRunAgentId) {
754
794
  if (!hostedRunAgentId) return null;
755
795
  const materialization = state.hosted?.hostedSourceMaterialization;
@@ -759,7 +799,7 @@ function resolveHostedRuntimeAgentIdForRun(state, hostedRunAgentId) {
759
799
  return hostedRunAgentId;
760
800
  }
761
801
  async function refreshHostedSourceCheckStatus(input) {
762
- const workItemId = text(record(input.checkResult.workItem)?.id);
802
+ const workItemId = text2(record2(input.checkResult.workItem)?.id);
763
803
  if (!workItemId) return null;
764
804
  const status = await input.client.workItems.status(workItemId, {
765
805
  teamId: input.teamId,
@@ -789,34 +829,34 @@ async function bindValidatedHostedRuntimeSource(input) {
789
829
  }
790
830
  function sourceCheckStatusPassed(status) {
791
831
  if (!status) return false;
792
- const finalResultState = text(status.finalResultState)?.toLowerCase();
832
+ const finalResultState = text2(status.finalResultState)?.toLowerCase();
793
833
  if (finalResultState && finalResultState !== "completed" && !passingStatus(finalResultState)) {
794
834
  return false;
795
835
  }
796
- const checkRuns = Array.isArray(status.checkRuns) ? status.checkRuns.map(record).filter((item) => Boolean(item)) : [];
836
+ const checkRuns = Array.isArray(status.checkRuns) ? status.checkRuns.map(record2).filter((item) => Boolean(item)) : [];
797
837
  if (checkRuns.some(checkRunFailed)) return false;
798
838
  const buildPassed = checkRuns.some(
799
839
  (run) => checkRunCommand(run).includes("build") && checkEvidencePassed(run)
800
840
  );
801
- const validationPassed = checkEvidencePassed(record(status.validation)) || checkRuns.some(
841
+ const validationPassed = checkEvidencePassed(record2(status.validation)) || checkRuns.some(
802
842
  (run) => checkRunCommand(run).includes("validate") && checkEvidencePassed(run)
803
843
  );
804
- const evalEvidence = record(status.eval);
805
- const evalRequired = (text(status.requestedCheckKind) ?? "all") === "all" || (text(status.requestedCheckKind) ?? "") === "eval" || Boolean(evalEvidence) || checkRuns.some((run) => checkRunCommand(run).includes("eval"));
844
+ const evalEvidence = record2(status.eval);
845
+ const evalRequired = (text2(status.requestedCheckKind) ?? "all") === "all" || (text2(status.requestedCheckKind) ?? "") === "eval" || Boolean(evalEvidence) || checkRuns.some((run) => checkRunCommand(run).includes("eval"));
806
846
  const evalPassed = !evalRequired || checkEvidencePassed(evalEvidence) || checkRuns.some(
807
847
  (run) => checkRunCommand(run).includes("eval") && checkEvidencePassed(run)
808
848
  );
809
849
  return buildPassed && validationPassed && evalPassed;
810
850
  }
811
851
  function checkRunCommand(run) {
812
- return (text(run.command) ?? "").toLowerCase();
852
+ return (text2(run.command) ?? "").toLowerCase();
813
853
  }
814
854
  function checkRunFailed(run) {
815
855
  const passed = run.passed;
816
856
  if (typeof passed === "boolean") return !passed;
817
857
  const exitCode = run.exitCode;
818
858
  if (typeof exitCode === "number" && exitCode !== 0) return true;
819
- const status = text(run.status)?.toLowerCase();
859
+ const status = text2(run.status)?.toLowerCase();
820
860
  return Boolean(status && failingStatus(status));
821
861
  }
822
862
  function checkEvidencePassed(evidence) {
@@ -826,7 +866,7 @@ function checkEvidencePassed(evidence) {
826
866
  if (failed !== null && failed > 0) return false;
827
867
  const exitCode = evidence.exitCode;
828
868
  if (typeof exitCode === "number") return exitCode === 0;
829
- const status = text(evidence.status)?.toLowerCase();
869
+ const status = text2(evidence.status)?.toLowerCase();
830
870
  return Boolean(status && passingStatus(status));
831
871
  }
832
872
  function numericEvidence(value) {
@@ -902,7 +942,7 @@ async function runOpenPondProfileSdkAlias(command, options, rest) {
902
942
  const args = [...rest, ...optionArgs(options, /* @__PURE__ */ new Set(["cwd", "account", "profile", "handle", "baseUrl"]))];
903
943
  await runProfileSdkCommand({
904
944
  command,
905
- cwd: cwd ? path.resolve(cwd) : void 0,
945
+ cwd: cwd ? path2.resolve(cwd) : void 0,
906
946
  args,
907
947
  inherit: true
908
948
  });
@@ -30,25 +30,24 @@ import {
30
30
  parseProjectSourceType,
31
31
  resolveLocalAgentSdkCommand,
32
32
  resolveProjectSourceUploadBranch
33
- } from "./chunk-BNVHGSI7.js";
34
- import "./chunk-4S3XGFGL.js";
35
- import "./chunk-VQX33YAG.js";
33
+ } from "./chunk-4M4WAORL.js";
34
+ import "./chunk-4HQURM3N.js";
35
+ import "./chunk-FQW3AQVJ.js";
36
36
  import "./chunk-LHYK6QO2.js";
37
- import "./chunk-OG75GMVO.js";
38
37
  import "./chunk-BYAPLT37.js";
39
38
  import "./chunk-WYDVQOBL.js";
40
39
  import {
41
40
  parseSandboxWorkflowModeOption,
42
41
  resolveSandboxClient,
43
42
  runCommand
44
- } from "./chunk-BNPFMGZD.js";
45
- import "./chunk-MFS3SYUH.js";
43
+ } from "./chunk-D264OHTR.js";
44
+ import "./chunk-3ZJIEA5F.js";
46
45
  import {
47
46
  optionString,
48
47
  optionalJsonObject,
49
48
  parseBooleanOption,
50
49
  requiredTeamId
51
- } from "./chunk-KMSMK7PI.js";
50
+ } from "./chunk-OXQG773T.js";
52
51
  import "./chunk-UACZUFIA.js";
53
52
 
54
53
  // src/cli/project-agent-formatters.ts
@@ -15,19 +15,19 @@ import {
15
15
  summarizeReplayArtifact,
16
16
  summarizeSandbox,
17
17
  waitForSandboxCreateReady
18
- } from "./chunk-RJXX6TJA.js";
18
+ } from "./chunk-EONKWOLU.js";
19
19
  import {
20
20
  readSandboxSecretValue,
21
21
  resolveSandboxClient,
22
22
  summarizeSandboxSecret
23
- } from "./chunk-BNPFMGZD.js";
24
- import "./chunk-MFS3SYUH.js";
23
+ } from "./chunk-D264OHTR.js";
24
+ import "./chunk-3ZJIEA5F.js";
25
25
  import {
26
26
  parseBooleanOption,
27
27
  parseIntegerOption,
28
28
  parseJsonObjectOption,
29
29
  parseNumberOption
30
- } from "./chunk-KMSMK7PI.js";
30
+ } from "./chunk-OXQG773T.js";
31
31
  import "./chunk-UACZUFIA.js";
32
32
 
33
33
  // src/cli/sandbox-files-command.ts
@@ -2,11 +2,10 @@ import { createRequire as __openpondCreateRequire } from "node:module"; var requ
2
2
  import {
3
3
  createSandboxFromPlan,
4
4
  summarizeSandbox
5
- } from "./chunk-RJXX6TJA.js";
5
+ } from "./chunk-EONKWOLU.js";
6
6
  import {
7
7
  resolveGitBranch
8
- } from "./chunk-KEDXE4BA.js";
9
- import "./chunk-OG75GMVO.js";
8
+ } from "./chunk-XADW35CL.js";
10
9
  import {
11
10
  OPENPOND_MANIFEST_FILE_NAME,
12
11
  SANDBOX_TEMPLATE_BUILD_PLAN_FILE_NAME,
@@ -36,16 +35,16 @@ import {
36
35
  runCommand,
37
36
  runShellCommand,
38
37
  warnOnRepoHostMismatch
39
- } from "./chunk-BNPFMGZD.js";
38
+ } from "./chunk-D264OHTR.js";
40
39
  import {
41
40
  resolveBaseUrl,
42
41
  resolvePublicApiBaseUrl
43
- } from "./chunk-MFS3SYUH.js";
42
+ } from "./chunk-3ZJIEA5F.js";
44
43
  import {
45
44
  parseBooleanOption,
46
45
  parseIntegerOption,
47
46
  parseJsonOption
48
- } from "./chunk-KMSMK7PI.js";
47
+ } from "./chunk-OXQG773T.js";
49
48
  import "./chunk-UACZUFIA.js";
50
49
 
51
50
  // src/cli/sandbox-template.ts