openpond 0.0.30-bootstrap.0

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 (193) hide show
  1. package/CHANGELOG.md +128 -0
  2. package/LICENSE +21 -0
  3. package/README.md +162 -0
  4. package/RELEASE.md +20 -0
  5. package/dist/api/core.d.ts +22 -0
  6. package/dist/api/deployments.d.ts +30 -0
  7. package/dist/api/types.d.ts +624 -0
  8. package/dist/api.d.ts +90 -0
  9. package/dist/cache.d.ts +22 -0
  10. package/dist/chunks/app-layer-YKXEQGOW.js +163 -0
  11. package/dist/chunks/apps-GGSIN2ZF.js +539 -0
  12. package/dist/chunks/chunk-3CC6MH35.js +1663 -0
  13. package/dist/chunks/chunk-3Y4EL3P6.js +1090 -0
  14. package/dist/chunks/chunk-4HYJG2JE.js +3875 -0
  15. package/dist/chunks/chunk-5G4E547X.js +294 -0
  16. package/dist/chunks/chunk-74O6FGVN.js +598 -0
  17. package/dist/chunks/chunk-AUJLPKGI.js +632 -0
  18. package/dist/chunks/chunk-BYAPLT37.js +744 -0
  19. package/dist/chunks/chunk-FUP7EGT7.js +1845 -0
  20. package/dist/chunks/chunk-I6HN3ZGW.js +88 -0
  21. package/dist/chunks/chunk-KRKGHVMQ.js +294 -0
  22. package/dist/chunks/chunk-LHYK6QO2.js +1300 -0
  23. package/dist/chunks/chunk-NLBKZZEK.js +224 -0
  24. package/dist/chunks/chunk-OG75GMVO.js +1 -0
  25. package/dist/chunks/chunk-Q57SVPEH.js +11663 -0
  26. package/dist/chunks/chunk-UACZUFIA.js +47 -0
  27. package/dist/chunks/chunk-VQX33YAG.js +5135 -0
  28. package/dist/chunks/chunk-W5GKHH77.js +168 -0
  29. package/dist/chunks/chunk-WYDVQOBL.js +17581 -0
  30. package/dist/chunks/chunk-XSAXENQD.js +4167 -0
  31. package/dist/chunks/chunk-Y6G6WRTG.js +210 -0
  32. package/dist/chunks/cli-NVKNE4AZ.js +11 -0
  33. package/dist/chunks/cli-X3HPLSOV.js +19 -0
  34. package/dist/chunks/core-commands-IM2UKLU4.js +41 -0
  35. package/dist/chunks/extend-YXCBULPO.js +84 -0
  36. package/dist/chunks/harness-GMK6IY2U.js +140 -0
  37. package/dist/chunks/help-LMH5FGT2.js +65 -0
  38. package/dist/chunks/opchat-BWXZ32GX.js +169 -0
  39. package/dist/chunks/organizations-4ISQRGMQ.js +738 -0
  40. package/dist/chunks/profile-NLDZDT3L.js +1110 -0
  41. package/dist/chunks/project-agent-ZPVO25HA.js +892 -0
  42. package/dist/chunks/sandbox-command-5GFJ2U3V.js +1652 -0
  43. package/dist/chunks/sandbox-template-LZN4F55Z.js +1646 -0
  44. package/dist/chunks/src-3RBI4DNN.js +3595 -0
  45. package/dist/chunks/src-EYXQS6XD.js +73427 -0
  46. package/dist/chunks/teams-bot-WP3FHKGA.js +137 -0
  47. package/dist/cli.js +77 -0
  48. package/dist/client-types.d.ts +222 -0
  49. package/dist/client.d.ts +19 -0
  50. package/dist/config.d.ts +184 -0
  51. package/dist/hosted-chat.d.ts +162 -0
  52. package/dist/index.d.ts +5 -0
  53. package/dist/index.js +25481 -0
  54. package/dist/indicators.d.ts +38 -0
  55. package/dist/opchat-smoke.d.ts +47 -0
  56. package/dist/private-json-file.d.ts +3 -0
  57. package/dist/profile/local-profile-types.d.ts +160 -0
  58. package/dist/profile/local-profile.d.ts +69 -0
  59. package/dist/profile/profile-catalog.d.ts +14 -0
  60. package/dist/profile/profile-git.d.ts +17 -0
  61. package/dist/profile/profile-promotion.d.ts +21 -0
  62. package/dist/profile/profile-setup-gate.d.ts +22 -0
  63. package/dist/profile/profile-skills.d.ts +30 -0
  64. package/dist/profile/profile-source-upload.d.ts +29 -0
  65. package/dist/profile/source-upload-cache.d.ts +29 -0
  66. package/dist/sandbox/async-request-options.d.ts +2 -0
  67. package/dist/sandbox/client-handles.d.ts +113 -0
  68. package/dist/sandbox/client.d.ts +348 -0
  69. package/dist/sandbox/runtime-handle.d.ts +36 -0
  70. package/dist/sandbox/sandbox-instance-client.d.ts +72 -0
  71. package/dist/sandbox/smoke.d.ts +3 -0
  72. package/dist/sandbox/stream.d.ts +7 -0
  73. package/dist/sandbox/types/billing.d.ts +176 -0
  74. package/dist/sandbox/types/client.d.ts +103 -0
  75. package/dist/sandbox/types/core.d.ts +140 -0
  76. package/dist/sandbox/types/index.d.ts +14 -0
  77. package/dist/sandbox/types/io.d.ts +240 -0
  78. package/dist/sandbox/types/microsoft-teams-bot.d.ts +51 -0
  79. package/dist/sandbox/types/org-project-agent.d.ts +610 -0
  80. package/dist/sandbox/types/record.d.ts +53 -0
  81. package/dist/sandbox/types/responses.d.ts +295 -0
  82. package/dist/sandbox/types/runtime-profiles.d.ts +15 -0
  83. package/dist/sandbox/types/runtime.d.ts +152 -0
  84. package/dist/sandbox/types/schedules.d.ts +141 -0
  85. package/dist/sandbox/types/snapshots.d.ts +205 -0
  86. package/dist/sandbox/types/workflow-modes.d.ts +1 -0
  87. package/dist/sandbox/types/workload-sources.d.ts +20 -0
  88. package/dist/sandbox/url.d.ts +2 -0
  89. package/dist/sandbox-template/manifest.d.ts +304 -0
  90. package/dist/sandbox-template/manifest.js +18381 -0
  91. package/dist/skills/openpond-cli/SKILL.md +49 -0
  92. package/dist/skills/openpond-desktop-harness/SKILL.md +113 -0
  93. package/dist/skills/openpond-desktop-harness/agents/openai.yaml +4 -0
  94. package/dist/skills/openpond-taskset-authoring/SKILL.md +38 -0
  95. package/dist/skills/openpond-taskset-authoring/references/graders-and-rewards.md +11 -0
  96. package/dist/skills/openpond-taskset-authoring/references/method-selection.md +12 -0
  97. package/dist/skills/openpond-taskset-authoring/references/privacy-and-provenance.md +8 -0
  98. package/dist/skills/openpond-taskset-authoring/references/task-design.md +13 -0
  99. package/dist/stream.d.ts +20 -0
  100. package/dist/types.d.ts +57 -0
  101. package/dist/urls.d.ts +4 -0
  102. package/dist/web/assets/AppsView-Bu-Nc3Ew.js +1 -0
  103. package/dist/web/assets/AppsView-DIhprTIC.css +1 -0
  104. package/dist/web/assets/BrowserSidebar-CCguQ-DR.js +1 -0
  105. package/dist/web/assets/BrowserSidebar-D9i7gQzw.css +1 -0
  106. package/dist/web/assets/CloudWorkView-DNoPIlMj.css +1 -0
  107. package/dist/web/assets/CloudWorkView-Dr3xqLE5.js +1 -0
  108. package/dist/web/assets/CommandMenu-CnodJFHD.js +1 -0
  109. package/dist/web/assets/CommandMenu-hNQCm8mw.css +1 -0
  110. package/dist/web/assets/CommunityView-CIbjNUZr.js +1 -0
  111. package/dist/web/assets/CommunityView-DSik4sd2.css +1 -0
  112. package/dist/web/assets/GetStartedView-C3ZrnEz5.css +1 -0
  113. package/dist/web/assets/GetStartedView-C8nyH_PT.js +1 -0
  114. package/dist/web/assets/LabsExtensions-GtJzxDnK.js +1 -0
  115. package/dist/web/assets/LabsProfile-DG7rWYur.js +1 -0
  116. package/dist/web/assets/LabsRoute-D6MDHBzq.js +2 -0
  117. package/dist/web/assets/LabsRoute-TEt9j1vB.css +1 -0
  118. package/dist/web/assets/LabsSignals-BfsDN86w.js +1 -0
  119. package/dist/web/assets/LabsSignals-D6iA6Ryl.css +1 -0
  120. package/dist/web/assets/NewProjectDialog-CaKiCoVS.js +1 -0
  121. package/dist/web/assets/ProfileSettingsSection-DTQS2DVL.css +1 -0
  122. package/dist/web/assets/ProfileSettingsSection-DxEzoF3K.js +1 -0
  123. package/dist/web/assets/ProfileView-CEscW7Ru.js +1 -0
  124. package/dist/web/assets/SettingsView-DwbGu8Kj.css +1 -0
  125. package/dist/web/assets/SettingsView-JIRR_FO4.js +63 -0
  126. package/dist/web/assets/TeamChatView-B5M1ThhJ.js +3 -0
  127. package/dist/web/assets/TeamChatView-Bx44q3WV.css +1 -0
  128. package/dist/web/assets/TerminalOverlay-C1iP4OS1.js +19 -0
  129. package/dist/web/assets/TerminalOverlay-DwBiZLwk.css +1 -0
  130. package/dist/web/assets/TrainingSettingsSection-BDYvI2te.js +1 -0
  131. package/dist/web/assets/TrainingView-CoCFK6W3.js +5 -0
  132. package/dist/web/assets/WorkspaceDiffPanel-CMxKQeo7.js +14 -0
  133. package/dist/web/assets/WorkspaceEnvironmentMenu-B8JJbwIz.js +32 -0
  134. package/dist/web/assets/WorkspaceEnvironmentMenu-DGIFdG3o.css +1 -0
  135. package/dist/web/assets/WorkspaceGitDialogs-B4sp9BGn.js +1 -0
  136. package/dist/web/assets/WorkspaceMonacoEditor-BBqimG5X.js +845 -0
  137. package/dist/web/assets/WorkspaceMonacoEditor-BwKcXIZw.css +1 -0
  138. package/dist/web/assets/boxes-DAaDUabq.js +1 -0
  139. package/dist/web/assets/codicon-ngg6Pgfi.ttf +0 -0
  140. package/dist/web/assets/css.worker-DBVD8oXr.js +93 -0
  141. package/dist/web/assets/cssMode-CBF1mieJ.js +1 -0
  142. package/dist/web/assets/dockerfile-BG73LgW2.js +1 -0
  143. package/dist/web/assets/editor.worker-CdQrwHl8.js +26 -0
  144. package/dist/web/assets/git-commit-horizontal-CAickXpN.js +1 -0
  145. package/dist/web/assets/git-dialogs-BZDqS1eT.css +1 -0
  146. package/dist/web/assets/html.worker-CwpTb9lJ.js +470 -0
  147. package/dist/web/assets/htmlMode-2u8OHtWO.js +1 -0
  148. package/dist/web/assets/index-BdY6A-YN.css +1 -0
  149. package/dist/web/assets/index-CU2qhUYV.js +195 -0
  150. package/dist/web/assets/index-Dz2B3-4C.js +1 -0
  151. package/dist/web/assets/info-CQNTh78o.js +1 -0
  152. package/dist/web/assets/json.worker-BoL8UZqY.js +58 -0
  153. package/dist/web/assets/jsonMode-C4CWXViX.js +7 -0
  154. package/dist/web/assets/lspLanguageFeatures-CBs_BOlB.js +4 -0
  155. package/dist/web/assets/markdown-BFxVWTOG.js +1 -0
  156. package/dist/web/assets/monaco.contribution-C1LUxAKf.js +2 -0
  157. package/dist/web/assets/monaco.contribution-Cpf6dWsh.js +2 -0
  158. package/dist/web/assets/monaco.contribution-lOXpG2xQ.js +2 -0
  159. package/dist/web/assets/monaco.contribution-sd3cFkcN.js +2 -0
  160. package/dist/web/assets/monitor-DsIswrMV.js +1 -0
  161. package/dist/web/assets/play-CeRw21NV.js +1 -0
  162. package/dist/web/assets/python-CXYq3BUl.js +1 -0
  163. package/dist/web/assets/refresh-cw-N5b_6AP5.js +1 -0
  164. package/dist/web/assets/reply-BSKjZrJg.js +1 -0
  165. package/dist/web/assets/save-D0oHH1a3.js +1 -0
  166. package/dist/web/assets/settings-lists-BEg6LMcy.css +1 -0
  167. package/dist/web/assets/shell-DiJ1NA_G.js +1 -0
  168. package/dist/web/assets/toggleHighContrast-B7NOMXDY.css +1 -0
  169. package/dist/web/assets/toggleHighContrast-DRjlcwes.js +62 -0
  170. package/dist/web/assets/training-model-data-BPrc68VG.js +1 -0
  171. package/dist/web/assets/ts.worker-BH9nVgjN.js +67718 -0
  172. package/dist/web/assets/tsMode-x-1A7ZcB.js +11 -0
  173. package/dist/web/assets/wifi-off-Dt52ofzh.js +1 -0
  174. package/dist/web/assets/workers-Ciff6Dzi.js +1 -0
  175. package/dist/web/assets/yaml-CB67Kxnz.js +1 -0
  176. package/dist/web/connected-apps/github.svg +3 -0
  177. package/dist/web/connected-apps/google.svg +6 -0
  178. package/dist/web/connected-apps/linear.svg +3 -0
  179. package/dist/web/connected-apps/microsoft.svg +6 -0
  180. package/dist/web/connected-apps/notion.svg +3 -0
  181. package/dist/web/connected-apps/openpond-mcp.svg +4 -0
  182. package/dist/web/connected-apps/slack.svg +6 -0
  183. package/dist/web/connected-apps/x.svg +3 -0
  184. package/dist/web/favicon-16x16.png +0 -0
  185. package/dist/web/favicon-32x32.png +0 -0
  186. package/dist/web/index.html +16 -0
  187. package/dist/web/openpond-icon.png +0 -0
  188. package/dist/web/openpond-wordlogo-white.png +0 -0
  189. package/dist/web/tokens/eth.svg +1 -0
  190. package/dist/web/tokens/usdc.svg +1 -0
  191. package/docs/agent-edit-check-status-json.md +132 -0
  192. package/docs/command-reference.md +695 -0
  193. package/package.json +84 -0
@@ -0,0 +1,1090 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+
3
+ // src/cli/common/options.ts
4
+ function parseJsonOption(value, label) {
5
+ try {
6
+ return JSON.parse(value);
7
+ } catch {
8
+ throw new Error(`${label} must be valid JSON`);
9
+ }
10
+ }
11
+ function parseJsonObjectOption(value, label) {
12
+ const parsed = parseJsonOption(value, label);
13
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
14
+ throw new Error(`${label} must be a JSON object`);
15
+ }
16
+ return parsed;
17
+ }
18
+ function optionString(options, key) {
19
+ const value = options[key];
20
+ return typeof value === "string" ? value.trim() : "";
21
+ }
22
+ function requiredTeamId(options, usage) {
23
+ const teamId = optionString(options, "teamId");
24
+ if (!teamId) {
25
+ throw new Error(`${usage} --team-id <id>`);
26
+ }
27
+ return teamId;
28
+ }
29
+ function optionalJsonObject(options, key, label) {
30
+ const value = optionString(options, key);
31
+ return value ? parseJsonObjectOption(value, label) : void 0;
32
+ }
33
+ function parseBooleanOption(value) {
34
+ if (value === true) return true;
35
+ if (typeof value === "string") {
36
+ return value.toLowerCase() === "true";
37
+ }
38
+ return false;
39
+ }
40
+ function parseNumberOption(value, label) {
41
+ if (typeof value !== "string") return void 0;
42
+ const parsed = Number(value);
43
+ if (!Number.isFinite(parsed)) {
44
+ throw new Error(`${label} must be a number`);
45
+ }
46
+ return parsed;
47
+ }
48
+ function parseIntegerOption(value, label) {
49
+ const parsed = parseNumberOption(value, label);
50
+ if (parsed === void 0) return void 0;
51
+ if (!Number.isInteger(parsed)) {
52
+ throw new Error(`${label} must be an integer`);
53
+ }
54
+ return parsed;
55
+ }
56
+ function parseCsvOption(value) {
57
+ if (typeof value !== "string") return [];
58
+ return value.split(",").map((item) => item.trim()).filter(Boolean);
59
+ }
60
+ function parseTimeOption(value, label) {
61
+ if (typeof value !== "string") return void 0;
62
+ const trimmed = value.trim();
63
+ if (!trimmed) return void 0;
64
+ if (/^\d+$/.test(trimmed)) return trimmed;
65
+ const parsed = Date.parse(trimmed);
66
+ if (!Number.isNaN(parsed)) {
67
+ return String(parsed);
68
+ }
69
+ throw new Error(`${label} must be a unix ms timestamp or ISO date`);
70
+ }
71
+ function resolveTemplateEnvironment(value) {
72
+ if (!value) return "production";
73
+ const normalized = value.toLowerCase();
74
+ if (normalized === "preview" || normalized === "production") {
75
+ return normalized;
76
+ }
77
+ throw new Error("env must be preview or production");
78
+ }
79
+
80
+ // src/cli/common/version.ts
81
+ import { readFileSync } from "node:fs";
82
+ import path from "node:path";
83
+ function getInstalledCliVersion() {
84
+ const candidatePaths = [
85
+ "../../../package.json",
86
+ "../../package.json",
87
+ "../package.json",
88
+ "./package.json",
89
+ "../../../../package.json"
90
+ ];
91
+ for (const candidatePath of candidatePaths) {
92
+ try {
93
+ const packageJsonPath = new URL(candidatePath, import.meta.url);
94
+ const raw = readFileSync(packageJsonPath, "utf-8");
95
+ const parsed = JSON.parse(raw);
96
+ if (typeof parsed.version === "string") {
97
+ return parsed.version;
98
+ }
99
+ } catch {
100
+ }
101
+ }
102
+ try {
103
+ const raw = readFileSync(path.join(path.dirname(process.execPath), "package.json"), "utf-8");
104
+ const parsed = JSON.parse(raw);
105
+ if (typeof parsed.version === "string") {
106
+ return parsed.version;
107
+ }
108
+ } catch {
109
+ }
110
+ return "unknown";
111
+ }
112
+ function parseSemver(version) {
113
+ const match = /^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(version.trim());
114
+ if (!match) return null;
115
+ const major = Number.parseInt(match[1], 10);
116
+ const minor = Number.parseInt(match[2], 10);
117
+ const patch = Number.parseInt(match[3], 10);
118
+ if (!Number.isFinite(major) || !Number.isFinite(minor) || !Number.isFinite(patch)) {
119
+ return null;
120
+ }
121
+ return [major, minor, patch];
122
+ }
123
+ function compareSemver(left, right) {
124
+ const l = parseSemver(left);
125
+ const r = parseSemver(right);
126
+ if (!l || !r) return null;
127
+ for (let i = 0; i < 3; i += 1) {
128
+ if (l[i] < r[i]) return -1;
129
+ if (l[i] > r[i]) return 1;
130
+ }
131
+ return 0;
132
+ }
133
+ async function fetchLatestNpmVersion(packageName) {
134
+ const controller = new AbortController();
135
+ const timer = setTimeout(() => controller.abort(), 7e3);
136
+ try {
137
+ const response = await fetch(
138
+ `https://registry.npmjs.org/${encodeURIComponent(packageName)}/latest`,
139
+ { signal: controller.signal }
140
+ );
141
+ if (!response.ok) {
142
+ const text = await response.text().catch(() => "");
143
+ throw new Error(
144
+ `npm registry request failed: ${response.status} ${text}`.trim()
145
+ );
146
+ }
147
+ const payload = await response.json().catch(() => ({}));
148
+ if (typeof payload.version !== "string" || payload.version.trim().length === 0) {
149
+ throw new Error("npm registry payload missing version");
150
+ }
151
+ return payload.version.trim();
152
+ } finally {
153
+ clearTimeout(timer);
154
+ }
155
+ }
156
+
157
+ // src/cli/command-option-schemas.ts
158
+ var boolean = "boolean";
159
+ var integer = "integer";
160
+ var json = "json";
161
+ var number = "number";
162
+ var string = "string";
163
+ var CHAT_OPTION_SCHEMA = {
164
+ approvalPolicy: string,
165
+ cwd: string,
166
+ json: boolean,
167
+ maxOutputBytes: integer,
168
+ message: string,
169
+ messageFile: string,
170
+ model: string,
171
+ noServerStart: boolean,
172
+ nonInteractive: boolean,
173
+ project: string,
174
+ provider: string,
175
+ sandbox: string,
176
+ server: string,
177
+ stdin: boolean,
178
+ timeoutSec: integer,
179
+ yes: boolean
180
+ };
181
+ var SANDBOX_OPTION_SCHEMA = {
182
+ access: string,
183
+ agentId: string,
184
+ all: boolean,
185
+ artifactPaths: string,
186
+ async: boolean,
187
+ authHeader: string,
188
+ authHeaderValue: string,
189
+ authToken: string,
190
+ autoStart: boolean,
191
+ baseRef: string,
192
+ branch: string,
193
+ budget: number,
194
+ budgetUsd: number,
195
+ cleanup: boolean,
196
+ cols: integer,
197
+ command: string,
198
+ content: string,
199
+ contentBase64: string,
200
+ contents: string,
201
+ contentsBase64: string,
202
+ cpu: number,
203
+ create: boolean,
204
+ description: string,
205
+ diskGb: number,
206
+ dockerBuildArgs: json,
207
+ dockerRegistrySecretRefs: string,
208
+ dockerfile: string,
209
+ dockerfileContext: string,
210
+ dockerfileTarget: string,
211
+ domain: string,
212
+ envLiteral: string,
213
+ envName: string,
214
+ envRef: string,
215
+ expectedMppMode: string,
216
+ expectedVersion: integer,
217
+ failOnUnpreservedChanges: boolean,
218
+ ffOnly: boolean,
219
+ forceWithLease: boolean,
220
+ fork: boolean,
221
+ fromPath: string,
222
+ idempotencyKey: string,
223
+ idleTimeoutSeconds: integer,
224
+ image: string,
225
+ imageDigest: string,
226
+ input: string,
227
+ inputBase64: string,
228
+ integrationCapabilities: string,
229
+ integrationConnection: string,
230
+ integrationScopes: string,
231
+ intervalMs: integer,
232
+ json: boolean,
233
+ keep: boolean,
234
+ label: string,
235
+ leaseId: string,
236
+ lifecycleHint: json,
237
+ manifestPath: string,
238
+ maxDurationSeconds: integer,
239
+ maxEntries: number,
240
+ maxResults: number,
241
+ memoryGb: number,
242
+ message: string,
243
+ name: string,
244
+ noPreview: boolean,
245
+ overwrite: boolean,
246
+ params: json,
247
+ path: string,
248
+ paths: string,
249
+ payload: json,
250
+ port: integer,
251
+ preview: boolean,
252
+ projectId: string,
253
+ publish: boolean,
254
+ q: string,
255
+ query: string,
256
+ rebase: boolean,
257
+ recursive: boolean,
258
+ registrySecretRef: string,
259
+ remote: string,
260
+ replayState: string,
261
+ repo: string,
262
+ respondAsync: boolean,
263
+ rows: integer,
264
+ runtimeAgentId: string,
265
+ runtimeBaseBranch: string,
266
+ runtimeBaseSha: string,
267
+ runtimeId: string,
268
+ runtimeProfileId: string,
269
+ runtimeProjectId: string,
270
+ runtimePromotionPolicy: string,
271
+ runtimeWorkspaceRoot: string,
272
+ sandboxId: string,
273
+ scope: string,
274
+ since: integer,
275
+ snapshot: boolean,
276
+ snapshotId: string,
277
+ sourceProjectId: string,
278
+ sourceRepoUrl: string,
279
+ sourceSandboxId: string,
280
+ startPoint: string,
281
+ status: string,
282
+ stdin: boolean,
283
+ summary: boolean,
284
+ tag: string,
285
+ tags: string,
286
+ targetId: string,
287
+ targetType: string,
288
+ teamId: string,
289
+ templateName: string,
290
+ templateVersion: string,
291
+ templateVisibility: string,
292
+ timeoutSeconds: integer,
293
+ toPath: string,
294
+ type: string,
295
+ useCase: string,
296
+ validationCommand: string,
297
+ value: string,
298
+ version: string,
299
+ volumeDeleteOnSandboxDelete: boolean,
300
+ volumeMountPath: string,
301
+ volumeName: string,
302
+ volumeStorageGb: number,
303
+ workflowMode: string
304
+ };
305
+ var SANDBOX_TEMPLATE_OPTION_SCHEMA = {
306
+ action: string,
307
+ agentId: string,
308
+ budget: number,
309
+ budgetUsd: number,
310
+ build: string,
311
+ branch: string,
312
+ commit: boolean,
313
+ commitMessage: string,
314
+ description: string,
315
+ dir: string,
316
+ disableSchedule: string,
317
+ disableSchedules: string,
318
+ enableSchedule: string,
319
+ enableSchedules: string,
320
+ entrypoint: string,
321
+ env: json,
322
+ envRef: string,
323
+ file: string,
324
+ force: boolean,
325
+ idleTimeoutSeconds: integer,
326
+ inherit: boolean,
327
+ input: json,
328
+ inputFile: string,
329
+ inputFiles: string,
330
+ inputJson: json,
331
+ inputs: json,
332
+ json: boolean,
333
+ keepTokenRemote: boolean,
334
+ manifest: string,
335
+ maxDurationSeconds: integer,
336
+ name: string,
337
+ noPush: boolean,
338
+ noWrite: boolean,
339
+ out: string,
340
+ outDir: string,
341
+ output: string,
342
+ outputDir: string,
343
+ params: json,
344
+ path: string,
345
+ plan: string,
346
+ projectId: string,
347
+ repo: string,
348
+ runtimeAgentId: string,
349
+ runtimeBaseBranch: string,
350
+ runtimeBaseSha: string,
351
+ runtimeId: string,
352
+ runtimeProjectId: string,
353
+ runtimePromotionPolicy: string,
354
+ scheduleMode: string,
355
+ scheduleOverride: json,
356
+ scheduleOverrides: json,
357
+ schedules: string,
358
+ service: string,
359
+ setRemoteToken: boolean,
360
+ setupTimeoutSeconds: integer,
361
+ target: string,
362
+ teamId: string,
363
+ timeoutSeconds: integer,
364
+ token: string,
365
+ workflowMode: string,
366
+ yes: boolean
367
+ };
368
+ var PROJECT_OPTION_SCHEMA = {
369
+ branch: string,
370
+ commitMessage: string,
371
+ defaultBranch: string,
372
+ description: string,
373
+ gitOwner: string,
374
+ gitRepo: string,
375
+ internalRepoPath: string,
376
+ json: boolean,
377
+ name: string,
378
+ path: string,
379
+ projectId: string,
380
+ repo: string,
381
+ sourceCheckDispatch: string,
382
+ sourceType: string,
383
+ teamId: string,
384
+ templateRepoUrl: string
385
+ };
386
+ var AGENT_OPTION_SCHEMA = {
387
+ agentId: string,
388
+ agentEdit: json,
389
+ allowLatestSource: boolean,
390
+ attachmentsJson: json,
391
+ baseSha: string,
392
+ chatMode: string,
393
+ checkKind: string,
394
+ conversationId: string,
395
+ cwd: string,
396
+ dispatch: string,
397
+ entrypointName: string,
398
+ entrypointScope: string,
399
+ expectedManifestHash: string,
400
+ evalStatus: string,
401
+ expectedSourceCommitSha: string,
402
+ idempotencyKey: string,
403
+ input: json,
404
+ inputFile: string,
405
+ json: boolean,
406
+ limit: integer,
407
+ message: string,
408
+ metadata: json,
409
+ name: string,
410
+ path: string,
411
+ payload: json,
412
+ projectId: string,
413
+ prompt: string,
414
+ publishedSnapshotId: string,
415
+ ref: string,
416
+ requirePublishedSnapshot: boolean,
417
+ requiredEnv: string,
418
+ requiredIntegrations: string,
419
+ runtimePromotionPolicy: string,
420
+ runtimeSourceMode: string,
421
+ sourceCheckDispatch: string,
422
+ sourceMode: string,
423
+ sourceRef: string,
424
+ status: string,
425
+ targetProjectId: string,
426
+ teamId: string,
427
+ triggerType: string,
428
+ workItemId: string,
429
+ workflowMode: string
430
+ };
431
+
432
+ // src/cli/command-registry.ts
433
+ var CLI_GLOBAL_OPTION_SCHEMA = {
434
+ account: "string",
435
+ apiBaseUrl: "string",
436
+ apiBaseurl: "string",
437
+ baseUrl: "string",
438
+ baseurl: "string",
439
+ chatApiBaseUrl: "string",
440
+ chatApiBaseurl: "string",
441
+ checkUpdate: "boolean",
442
+ cwd: "string",
443
+ help: "boolean",
444
+ json: "boolean",
445
+ profile: "string",
446
+ sandboxApiUrl: "string",
447
+ sandboxApiurl: "string",
448
+ tui: "boolean",
449
+ version: "boolean"
450
+ };
451
+ var CLI_SHORT_OPTION_ALIASES = {
452
+ C: "cwd",
453
+ f: "force",
454
+ h: "help",
455
+ j: "json",
456
+ v: "version",
457
+ y: "yes"
458
+ };
459
+ var PROFILE_SDK_OPTION_SCHEMA = {
460
+ cwd: "string",
461
+ input: "json",
462
+ inputFile: "string",
463
+ json: "boolean",
464
+ path: "string"
465
+ };
466
+ var CLI_COMMAND_REGISTRY = [
467
+ {
468
+ name: "help",
469
+ usage: "openpond help",
470
+ optionSchema: {},
471
+ handler: async () => (await import("./help-LMH5FGT2.js")).printHelp()
472
+ },
473
+ {
474
+ name: "version",
475
+ usage: "openpond version",
476
+ optionSchema: {},
477
+ handler: () => console.log(getInstalledCliVersion())
478
+ },
479
+ {
480
+ name: "check-update",
481
+ usage: "openpond check-update",
482
+ optionSchema: {},
483
+ handler: async () => (await import("./core-commands-IM2UKLU4.js")).runCheckUpdate()
484
+ },
485
+ {
486
+ name: "login",
487
+ usage: "openpond login [--base-url <url>]",
488
+ optionSchema: CLI_GLOBAL_OPTION_SCHEMA,
489
+ handler: async ({ options }) => (await import("./core-commands-IM2UKLU4.js")).runLogin(options)
490
+ },
491
+ {
492
+ name: "init",
493
+ usage: "openpond init [--path <dir>]",
494
+ optionSchema: { path: "string" },
495
+ handler: async ({ options }) => (await import("./profile-NLDZDT3L.js")).runOpenPondInitCommand(options)
496
+ },
497
+ {
498
+ name: "profile",
499
+ usage: "openpond profile <current|init|load|check|push|commit|diff|catalog>",
500
+ optionSchema: {
501
+ checkKind: "string",
502
+ conversationId: "string",
503
+ ensureHosted: "boolean",
504
+ expectedManifestHash: "string",
505
+ force: "boolean",
506
+ hostedCheckKind: "string",
507
+ hostedRunAgentId: "string",
508
+ hostedRunConversationId: "string",
509
+ hostedRunIdempotencyKey: "string",
510
+ hostedRunInput: "json",
511
+ hostedRunRetry: "boolean",
512
+ hostedRunTargetProjectId: "string",
513
+ hostedSourceDispatch: "string",
514
+ hostedSourceAgentId: "string",
515
+ hostedSourceChecks: "boolean",
516
+ hostedSourceProjectId: "string",
517
+ json: "boolean",
518
+ kind: "string",
519
+ path: "string",
520
+ publishHostedSource: "boolean",
521
+ teamId: "string",
522
+ workItemId: "string"
523
+ },
524
+ handler: async ({ options, rest }) => (await import("./profile-NLDZDT3L.js")).runOpenPondProfileCommand(options, rest)
525
+ },
526
+ {
527
+ name: "agents",
528
+ usage: "openpond agents [--json]",
529
+ optionSchema: { json: "boolean" },
530
+ handler: async ({ options, rest }) => (await import("./profile-NLDZDT3L.js")).runOpenPondAgentsCommand(options, rest)
531
+ },
532
+ ...profileSdkAliasDefinitions(),
533
+ {
534
+ name: "extend",
535
+ usage: "openpond extend <instructions>",
536
+ optionSchema: { cwd: "string" },
537
+ handler: async ({ options, rest }) => (await import("./extend-YXCBULPO.js")).runOpenPondExtendCommand(options, rest)
538
+ },
539
+ {
540
+ name: "edit",
541
+ usage: "openpond edit <instructions>",
542
+ optionSchema: { cwd: "string" },
543
+ handler: async ({ options, rest }) => (await import("./extend-YXCBULPO.js")).runOpenPondEditCommand(options, rest)
544
+ },
545
+ {
546
+ name: "profiles",
547
+ usage: "openpond profiles [args]",
548
+ optionSchema: { json: "boolean" },
549
+ handler: async ({ options, rest }) => (await import("./core-commands-IM2UKLU4.js")).runProfiles(options, rest)
550
+ },
551
+ {
552
+ name: "account",
553
+ usage: "openpond account",
554
+ optionSchema: { json: "boolean" },
555
+ handler: async () => (await import("./core-commands-IM2UKLU4.js")).runAccount()
556
+ },
557
+ {
558
+ name: "health",
559
+ usage: "openpond health",
560
+ optionSchema: { json: "boolean" },
561
+ handler: async ({ options }) => (await import("./core-commands-IM2UKLU4.js")).runHealth(options)
562
+ },
563
+ {
564
+ name: "serve",
565
+ usage: "openpond serve [args]",
566
+ optionSchema: {
567
+ host: "string",
568
+ hostname: "string",
569
+ listen: "string",
570
+ port: "integer"
571
+ },
572
+ handler: async ({ options, rest }) => (await import("./app-layer-YKXEQGOW.js")).runOpenPondServerCommand("serve", options, rest)
573
+ },
574
+ {
575
+ name: "ui",
576
+ usage: "openpond ui [args]",
577
+ optionSchema: {
578
+ host: "string",
579
+ hostname: "string",
580
+ listen: "string",
581
+ port: "integer",
582
+ webRoot: "string"
583
+ },
584
+ handler: async ({ options, rest }) => (await import("./app-layer-YKXEQGOW.js")).runOpenPondServerCommand("web", options, rest)
585
+ },
586
+ {
587
+ name: "tui",
588
+ aliases: ["interactive"],
589
+ usage: "openpond tui [--provider <id>] [--model <id>] [--project <id>]",
590
+ optionSchema: {
591
+ cwd: "string",
592
+ model: "string",
593
+ noServerStart: "boolean",
594
+ project: "string",
595
+ provider: "string",
596
+ server: "string"
597
+ },
598
+ handler: async ({ options, rest }) => (await import("./app-layer-YKXEQGOW.js")).runOpenPondTerminalCommand(options, rest)
599
+ },
600
+ {
601
+ name: "chat",
602
+ usage: "openpond chat (--message-file <path>|--message <text>|--stdin) --non-interactive [--provider <id>] [--model <id>] [--project <id>] [--yes] [--approval-policy <policy>] [--json] [--timeout-sec <n>] [--max-output-bytes <n>] [--sandbox <mode>]",
603
+ optionSchema: CHAT_OPTION_SCHEMA,
604
+ handler: async ({ options, rest }) => (await import("./app-layer-YKXEQGOW.js")).runOpenPondTerminalCommand(options, rest)
605
+ },
606
+ {
607
+ name: "tool",
608
+ usage: "openpond tool <list|run> <handle>/<repo> [args]",
609
+ optionSchema: { body: "json", json: "boolean" },
610
+ handler: runToolCommand
611
+ },
612
+ {
613
+ name: "backtest",
614
+ usage: "openpond backtest <run|events|get> <handle>/<repo> [args]",
615
+ optionSchema: {
616
+ body: "json",
617
+ branch: "string",
618
+ deploymentId: "string",
619
+ limit: "integer",
620
+ runId: "string"
621
+ },
622
+ handler: runBacktestCommand
623
+ },
624
+ {
625
+ name: "deploy",
626
+ usage: "openpond deploy watch <handle>/<repo> [--branch <branch>]",
627
+ optionSchema: { branch: "string" },
628
+ handler: runDeployCommand
629
+ },
630
+ {
631
+ name: "template",
632
+ usage: "openpond template <status|branches|update> <handle>/<repo> [--env preview|production]",
633
+ optionSchema: { env: "string" },
634
+ handler: runTemplateCommand
635
+ },
636
+ {
637
+ name: "sandbox-template",
638
+ usage: "openpond sandbox-template <command> [args]",
639
+ optionSchema: SANDBOX_TEMPLATE_OPTION_SCHEMA,
640
+ handler: async ({ options, rest }) => (await import("./sandbox-template-LZN4F55Z.js")).runSandboxTemplateCommand(options, rest)
641
+ },
642
+ {
643
+ name: "repo",
644
+ usage: "openpond repo <create|push> [--name <name>] [--path <dir>] [--branch <branch>]",
645
+ optionSchema: {
646
+ branch: "string",
647
+ name: "string",
648
+ path: "string"
649
+ },
650
+ handler: runRepoCommand
651
+ },
652
+ {
653
+ name: "organizations",
654
+ aliases: ["organization"],
655
+ usage: "openpond organizations <login|list|use|logout|whoami> [args]",
656
+ optionSchema: {
657
+ callbackPort: "integer",
658
+ json: "boolean",
659
+ open: "boolean",
660
+ timeoutSeconds: "integer"
661
+ },
662
+ handler: async ({ options, rest }) => (await import("./organizations-4ISQRGMQ.js")).runOrganizationsCommand(options, rest)
663
+ },
664
+ {
665
+ name: "project",
666
+ usage: "openpond project <list|create|upsert|get|update|sync|source-upload|archive> [args]",
667
+ optionSchema: PROJECT_OPTION_SCHEMA,
668
+ handler: async ({ options, rest }) => (await import("./project-agent-ZPVO25HA.js")).runProjectCommand(options, rest)
669
+ },
670
+ {
671
+ name: "agent",
672
+ usage: "openpond agent <inspect|build|validate|eval|traces|list|create|upsert|get|update|run|run-test|bind-source|source|edit|archive> [args]",
673
+ usages: [
674
+ "openpond agent run <action> [--cwd <project>] [--input <json>]",
675
+ "openpond agent run <agentId> --team-id <id> [--conversation-id <id>] [--target-project-id <projectId>] [--input <json>]",
676
+ "openpond agent source check-status <workItemId> --team-id <id> [--limit <n>]",
677
+ "openpond agent edit open <agentId> --team-id <id> --project-id <id> [--message <text>]",
678
+ "openpond agent edit checkpoint-result|commit-result|pr-result <workItemId> --team-id <id> --ref <artifact-ref>"
679
+ ],
680
+ optionSchema: AGENT_OPTION_SCHEMA,
681
+ handler: async ({ options, rest }) => (await import("./project-agent-ZPVO25HA.js")).runAgentCommand(options, rest)
682
+ },
683
+ {
684
+ name: "goal",
685
+ usage: "openpond goal <command> [args]",
686
+ optionSchema: {
687
+ agentId: "string",
688
+ cwd: "string",
689
+ goalStorage: "string",
690
+ json: "boolean",
691
+ goalId: "string"
692
+ },
693
+ handler: async ({ options, rest }) => (await import("./cli-X3HPLSOV.js")).runGoalCommand(options, rest)
694
+ },
695
+ {
696
+ name: "harness",
697
+ usage: "openpond harness desktop <run|attach> <scenario...> [--isolated|--attach|--packaged|--none] [--app <path>] [--artifacts-dir <path>] [--json <path>]",
698
+ optionSchema: {
699
+ artifactsDir: "string",
700
+ attach: "boolean",
701
+ cwd: "string",
702
+ devtoolsPort: "integer",
703
+ grep: "string",
704
+ isolated: "boolean",
705
+ json: "string",
706
+ jsonPath: "string",
707
+ keepHome: "boolean",
708
+ none: "boolean",
709
+ server: "string",
710
+ timeoutMs: "integer",
711
+ token: "string",
712
+ tokenFile: "string"
713
+ },
714
+ handler: async ({ options, rest }) => (await import("./harness-GMK6IY2U.js")).runHarnessCommand(options, rest)
715
+ },
716
+ {
717
+ name: "sandbox",
718
+ usage: "openpond sandbox <command> [args]",
719
+ optionSchema: SANDBOX_OPTION_SCHEMA,
720
+ handler: async ({ options, rest }) => (await import("./sandbox-command-5GFJ2U3V.js")).runSandboxCommand(options, rest)
721
+ },
722
+ {
723
+ name: "opchat",
724
+ usage: "openpond opchat <command> [args]",
725
+ optionSchema: {
726
+ json: "boolean",
727
+ stream: "boolean"
728
+ },
729
+ handler: async ({ options, rest }) => (await import("./opchat-BWXZ32GX.js")).runOpChatCommand(options, rest)
730
+ },
731
+ {
732
+ name: "teams-bot",
733
+ usage: "openpond teams-bot <command> [args]",
734
+ optionSchema: {
735
+ json: "boolean",
736
+ teamId: "string"
737
+ },
738
+ handler: async ({ options, rest }) => (await import("./teams-bot-WP3FHKGA.js")).runTeamsBotCommand(options, rest)
739
+ },
740
+ {
741
+ name: "apps",
742
+ usage: "openpond apps <list|code-visibility|tools|deploy|env get|env set|performance|summary|assistant|store events|trade-facts|agent create|positions tx> [args]",
743
+ optionSchema: {
744
+ appId: "string",
745
+ body: "json",
746
+ env: "json",
747
+ json: "boolean",
748
+ limit: "integer",
749
+ refresh: "boolean",
750
+ teamId: "string",
751
+ watch: "boolean"
752
+ },
753
+ handler: runAppsCommand
754
+ },
755
+ {
756
+ name: "opentool",
757
+ usage: "openpond opentool <init|validate|build> [args]",
758
+ optionSchema: {},
759
+ handler: async ({ rest }) => (await import("./core-commands-IM2UKLU4.js")).runOpentool(rest)
760
+ }
761
+ ];
762
+ var CLI_COMMAND_BY_NAME = /* @__PURE__ */ new Map();
763
+ for (const definition of CLI_COMMAND_REGISTRY) {
764
+ CLI_COMMAND_BY_NAME.set(definition.name, definition);
765
+ for (const alias of definition.aliases ?? []) {
766
+ CLI_COMMAND_BY_NAME.set(alias, definition);
767
+ }
768
+ }
769
+ function listCliCommandDefinitions() {
770
+ return CLI_COMMAND_REGISTRY;
771
+ }
772
+ function getCliCommandDefinition(command) {
773
+ return CLI_COMMAND_BY_NAME.get(command) ?? null;
774
+ }
775
+ function getCliOptionKind(command, key) {
776
+ const definition = command ? getCliCommandDefinition(command) : null;
777
+ return definition?.optionSchema[key] ?? CLI_GLOBAL_OPTION_SCHEMA[key];
778
+ }
779
+ function getAnyCliOptionKind(key) {
780
+ const globalKind = CLI_GLOBAL_OPTION_SCHEMA[key];
781
+ if (globalKind) return globalKind;
782
+ for (const definition of CLI_COMMAND_REGISTRY) {
783
+ const kind = definition.optionSchema[key];
784
+ if (kind) return kind;
785
+ }
786
+ return void 0;
787
+ }
788
+ async function runCliCommand(context) {
789
+ const definition = getCliCommandDefinition(context.command);
790
+ if (!definition) return false;
791
+ if (parseBooleanOption(context.options.help)) {
792
+ printCliCommandUsage(definition);
793
+ return true;
794
+ }
795
+ await definition.handler(context);
796
+ return true;
797
+ }
798
+ function formatCliCommandUsage(definition) {
799
+ const lines = [
800
+ `Usage:`,
801
+ ` ${definition.usage}`,
802
+ ...(definition.usages ?? []).map((usage) => ` ${usage}`)
803
+ ];
804
+ if (definition.aliases?.length) {
805
+ lines.push("", `Aliases:`, ` ${definition.aliases.join(", ")}`);
806
+ }
807
+ const options = Object.entries(definition.optionSchema).sort(
808
+ ([left], [right]) => left.localeCompare(right)
809
+ );
810
+ if (options.length > 0) {
811
+ lines.push("", "Options:");
812
+ for (const [name, kind] of options) {
813
+ const optionName = cliOptionName(name);
814
+ lines.push(kind === "boolean" ? ` --${optionName}` : ` --${optionName} <${kind}>`);
815
+ }
816
+ }
817
+ return lines.join("\n");
818
+ }
819
+ function printCliCommandUsage(definition) {
820
+ console.log(formatCliCommandUsage(definition));
821
+ }
822
+ function cliOptionName(name) {
823
+ return name.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);
824
+ }
825
+ function profileSdkAliasDefinitions() {
826
+ const aliases = ["inspect", "build", "validate", "eval", "run"];
827
+ return aliases.map((name) => ({
828
+ name,
829
+ usage: `openpond ${name} [args]`,
830
+ optionSchema: PROFILE_SDK_OPTION_SCHEMA,
831
+ handler: async ({ options, rest }) => (await import("./profile-NLDZDT3L.js")).runOpenPondProfileSdkAlias(name, options, rest)
832
+ }));
833
+ }
834
+ async function runToolCommand({ options, rest }) {
835
+ const { runToolList, runToolRun } = await import("./core-commands-IM2UKLU4.js");
836
+ const subcommand = rest[0];
837
+ if (subcommand === "list") {
838
+ const target = rest[1];
839
+ if (!target) {
840
+ throw new Error("usage: tool list <handle>/<repo>");
841
+ }
842
+ await runToolList(options, target);
843
+ return;
844
+ }
845
+ if (subcommand === "run") {
846
+ const target = rest[1];
847
+ const toolName = rest[2];
848
+ if (!target || !toolName) {
849
+ throw new Error(
850
+ "usage: tool run <handle>/<repo> <tool> [--body <json>]"
851
+ );
852
+ }
853
+ await runToolRun(options, target, toolName);
854
+ return;
855
+ }
856
+ throw new Error("usage: tool <list|run> <handle>/<repo> [args]");
857
+ }
858
+ async function runBacktestCommand({ options, rest }) {
859
+ const { runBacktestRun } = await import("./core-commands-IM2UKLU4.js");
860
+ const { runBacktestEvents, runBacktestGet } = await import("./apps-GGSIN2ZF.js");
861
+ const subcommand = rest[0] || "run";
862
+ if (subcommand === "run") {
863
+ const target = rest[1];
864
+ const toolName = rest[2];
865
+ if (!target || !toolName) {
866
+ throw new Error(
867
+ "usage: backtest run <handle>/<repo> <tool> [--body <json>] [--branch <branch>] [--deployment-id <id>]"
868
+ );
869
+ }
870
+ await runBacktestRun(options, target, toolName);
871
+ return;
872
+ }
873
+ if (subcommand === "events") {
874
+ const target = rest[1];
875
+ if (!target) {
876
+ throw new Error(
877
+ "usage: backtest events <handle>/<repo> [--run-id <id>] [--limit <n>]"
878
+ );
879
+ }
880
+ await runBacktestEvents(options, target);
881
+ return;
882
+ }
883
+ if (subcommand === "get") {
884
+ const target = rest[1];
885
+ if (!target) {
886
+ throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");
887
+ }
888
+ await runBacktestGet(options, target);
889
+ return;
890
+ }
891
+ throw new Error("usage: backtest <run|events|get> <handle>/<repo> [args]");
892
+ }
893
+ async function runDeployCommand({ options, rest }) {
894
+ const { runDeployWatch } = await import("./core-commands-IM2UKLU4.js");
895
+ const subcommand = rest[0] || "watch";
896
+ if (subcommand !== "watch") {
897
+ throw new Error(
898
+ "usage: deploy watch <handle>/<repo> [--branch <branch>]"
899
+ );
900
+ }
901
+ const target = rest[1];
902
+ if (!target) {
903
+ throw new Error(
904
+ "usage: deploy watch <handle>/<repo> [--branch <branch>]"
905
+ );
906
+ }
907
+ await runDeployWatch(options, target);
908
+ }
909
+ async function runTemplateCommand({ options, rest }) {
910
+ const { runTemplateBranches, runTemplateStatus, runTemplateUpdate } = await import("./core-commands-IM2UKLU4.js");
911
+ const subcommand = rest[0] || "status";
912
+ const target = rest[1];
913
+ if (!target) {
914
+ throw new Error(
915
+ "usage: template <status|branches|update> <handle>/<repo> [--env preview|production]"
916
+ );
917
+ }
918
+ if (subcommand === "status") {
919
+ await runTemplateStatus(options, target);
920
+ return;
921
+ }
922
+ if (subcommand === "branches") {
923
+ await runTemplateBranches(options, target);
924
+ return;
925
+ }
926
+ if (subcommand === "update") {
927
+ await runTemplateUpdate(options, target);
928
+ return;
929
+ }
930
+ throw new Error(
931
+ "usage: template <status|branches|update> <handle>/<repo> [--env preview|production]"
932
+ );
933
+ }
934
+ async function runRepoCommand({ options, rest }) {
935
+ const { runRepoCreate, runRepoPush } = await import("./core-commands-IM2UKLU4.js");
936
+ const subcommand = rest[0] || "create";
937
+ if (subcommand === "create") {
938
+ await runRepoCreate(options, rest.slice(1));
939
+ return;
940
+ }
941
+ if (subcommand === "push") {
942
+ await runRepoPush(options);
943
+ return;
944
+ }
945
+ throw new Error(
946
+ "usage: repo <create|push> [--name <name>] [--path <dir>] [--branch <branch>]"
947
+ );
948
+ }
949
+ async function runAppsCommand({ options, rest }) {
950
+ const {
951
+ runAppsAgentCreate,
952
+ runAppsAssistant,
953
+ runAppsCodeVisibility,
954
+ runAppsDeploy,
955
+ runAppsEnvGet,
956
+ runAppsEnvSet,
957
+ runAppsList,
958
+ runAppsPerformance,
959
+ runAppsPositionsTx,
960
+ runAppsStoreEvents,
961
+ runAppsSummary,
962
+ runAppsTools,
963
+ runAppsToolsExecute,
964
+ runAppsTradeFacts
965
+ } = await import("./apps-GGSIN2ZF.js");
966
+ const subcommand = rest[0];
967
+ if (subcommand === "list") {
968
+ await runAppsList(options);
969
+ return;
970
+ }
971
+ if (subcommand === "code-visibility") {
972
+ const target = rest[1];
973
+ if (!target) {
974
+ throw new Error(
975
+ "usage: apps code-visibility <handle>/<repo> --visibility public|private"
976
+ );
977
+ }
978
+ await runAppsCodeVisibility(options, target);
979
+ return;
980
+ }
981
+ if (subcommand === "tools") {
982
+ if (rest[1] === "execute") {
983
+ const appId = rest[2];
984
+ const deploymentId = rest[3];
985
+ const toolName = rest[4];
986
+ if (!appId || !deploymentId || !toolName) {
987
+ throw new Error(
988
+ "usage: apps tools execute <appId> <deploymentId> <tool> [--body <json>]"
989
+ );
990
+ }
991
+ await runAppsToolsExecute(options, appId, deploymentId, toolName);
992
+ return;
993
+ }
994
+ await runAppsTools();
995
+ return;
996
+ }
997
+ if (subcommand === "deploy") {
998
+ const target = rest[1];
999
+ if (!target) {
1000
+ throw new Error(
1001
+ "usage: apps deploy <handle>/<repo> [--env preview|production] [--watch]"
1002
+ );
1003
+ }
1004
+ await runAppsDeploy(options, target);
1005
+ return;
1006
+ }
1007
+ if (subcommand === "env" && rest[1] === "get") {
1008
+ const target = rest[2];
1009
+ if (!target) {
1010
+ throw new Error("usage: apps env get <handle>/<repo>");
1011
+ }
1012
+ await runAppsEnvGet(options, target);
1013
+ return;
1014
+ }
1015
+ if (subcommand === "env" && rest[1] === "set") {
1016
+ const target = rest[2];
1017
+ if (!target) {
1018
+ throw new Error("usage: apps env set <handle>/<repo> --env <json>");
1019
+ }
1020
+ await runAppsEnvSet(options, target);
1021
+ return;
1022
+ }
1023
+ if (subcommand === "performance") {
1024
+ await runAppsPerformance(options);
1025
+ return;
1026
+ }
1027
+ if (subcommand === "summary") {
1028
+ const target = rest[1];
1029
+ if (!target) {
1030
+ throw new Error("usage: apps summary <handle>/<repo>");
1031
+ }
1032
+ await runAppsSummary(options, target);
1033
+ return;
1034
+ }
1035
+ if (subcommand === "assistant") {
1036
+ const mode = rest[1];
1037
+ const target = rest[2];
1038
+ if (mode !== "plan" && mode !== "performance" || !target) {
1039
+ throw new Error(
1040
+ "usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>"
1041
+ );
1042
+ }
1043
+ await runAppsAssistant(options, mode, target, rest.slice(3));
1044
+ return;
1045
+ }
1046
+ if (subcommand === "store" && rest[1] === "events") {
1047
+ await runAppsStoreEvents(options);
1048
+ return;
1049
+ }
1050
+ if (subcommand === "trade-facts") {
1051
+ await runAppsTradeFacts(options);
1052
+ return;
1053
+ }
1054
+ if (subcommand === "agent" && rest[1] === "create") {
1055
+ await runAppsAgentCreate(options, rest.slice(2));
1056
+ return;
1057
+ }
1058
+ if (subcommand === "positions" && rest[1] === "tx") {
1059
+ await runAppsPositionsTx(options);
1060
+ return;
1061
+ }
1062
+ throw new Error(
1063
+ "usage: apps <list|code-visibility|tools|deploy|env get|env set|performance|summary|assistant|store events|trade-facts|agent create|positions tx> [args]"
1064
+ );
1065
+ }
1066
+
1067
+ export {
1068
+ parseJsonOption,
1069
+ parseJsonObjectOption,
1070
+ optionString,
1071
+ requiredTeamId,
1072
+ optionalJsonObject,
1073
+ parseBooleanOption,
1074
+ parseNumberOption,
1075
+ parseIntegerOption,
1076
+ parseCsvOption,
1077
+ parseTimeOption,
1078
+ resolveTemplateEnvironment,
1079
+ getInstalledCliVersion,
1080
+ compareSemver,
1081
+ fetchLatestNpmVersion,
1082
+ CLI_GLOBAL_OPTION_SCHEMA,
1083
+ CLI_SHORT_OPTION_ALIASES,
1084
+ listCliCommandDefinitions,
1085
+ getCliCommandDefinition,
1086
+ getCliOptionKind,
1087
+ getAnyCliOptionKind,
1088
+ runCliCommand,
1089
+ formatCliCommandUsage
1090
+ };