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,210 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import {
3
+ getBundledRuntimeVersion
4
+ } from "./chunk-Q57SVPEH.js";
5
+
6
+ // ../server/src/cli.ts
7
+ import { existsSync } from "node:fs";
8
+ import path2 from "node:path";
9
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
10
+
11
+ // ../server/src/constants.ts
12
+ var DEFAULT_HOST = "127.0.0.1";
13
+ var DEFAULT_PORT = 17874;
14
+ var VERSION = "0.0.30-bootstrap.0";
15
+ var HOSTED_CHAT_SYSTEM_PROMPT = "You are OpenPond Chat. Respond in the user's language. If the user's latest message is language-neutral, ambiguous, or only a short test, respond in English. Be concise and directly answer the latest request. Do not use emojis. Use Markdown when it improves scanability. If you emit reasoning or thinking content, keep it sparse and user-readable: at most one short sentence for major progress, decisions, or blockers. Omit reasoning for routine searches, reads, tool calls, and obvious next steps. Do not restate the user request, narrate every action, or include code blocks, code excerpts, diffs, raw tool payloads, or markdown examples in reasoning. Put necessary code or exact snippets only in the final assistant answer. When the user asks to show or preview an image that is available as a workspace path or signed image URL, use Markdown image syntax like ![description](path-or-url) instead of a bare path or raw HTML. For workspace-backed answers, use a Codex-style shape: brief outcome first, then Changed Files if files changed, then Verification if checks ran. End with a concise final answer that summarizes the result and verification when relevant. Do not mention raw tool JSON, internal repo paths, or origin/remote URLs unless the user explicitly asks for them or they are necessary to explain a git/deploy failure.";
16
+ var APP_PREFERENCES_CACHE_TYPE = "app_preferences";
17
+ var APP_PREFERENCES_CACHE_KEY = "global";
18
+
19
+ // ../server/src/utils.ts
20
+ import { randomUUID } from "node:crypto";
21
+ import path from "node:path";
22
+ import { fileURLToPath } from "node:url";
23
+ function now() {
24
+ return (/* @__PURE__ */ new Date()).toISOString();
25
+ }
26
+ function textFromUnknown(value) {
27
+ if (typeof value === "string") return value;
28
+ if (value instanceof Error) return value.message || value.name;
29
+ if (value === null || value === void 0) return "";
30
+ try {
31
+ return JSON.stringify(value);
32
+ } catch {
33
+ return String(value);
34
+ }
35
+ }
36
+ function extractDelta(params) {
37
+ if (!params || typeof params !== "object") return "";
38
+ const record = params;
39
+ for (const key of ["delta", "text", "output", "chunk", "message"]) {
40
+ if (typeof record[key] === "string") return record[key];
41
+ }
42
+ if (record.delta && typeof record.delta === "object") return textFromUnknown(record.delta);
43
+ return "";
44
+ }
45
+ function event(input) {
46
+ return {
47
+ id: randomUUID(),
48
+ timestamp: now(),
49
+ ...input
50
+ };
51
+ }
52
+ function parseListen(input) {
53
+ const value = input.replace(/^https?:\/\//, "");
54
+ const [host, port] = value.split(":");
55
+ return {
56
+ host: host || DEFAULT_HOST,
57
+ port: port ? Number.parseInt(port, 10) : DEFAULT_PORT
58
+ };
59
+ }
60
+ function isCliEntrypoint(metaUrl) {
61
+ const entry = process.argv[1] ? path.resolve(process.argv[1]) : "";
62
+ return entry === path.resolve(fileURLToPath(metaUrl));
63
+ }
64
+
65
+ // ../server/src/cli.ts
66
+ var __dirname = path2.dirname(fileURLToPath2(import.meta.url));
67
+ function requireValue(args, index, flag) {
68
+ const value = args[index + 1];
69
+ if (!value || value.startsWith("--")) throw new Error(`${flag} requires a value.`);
70
+ return value;
71
+ }
72
+ function parsePort(value, flag) {
73
+ const port = Number.parseInt(value, 10);
74
+ if (!Number.isFinite(port) || port < 0 || port > 65535) throw new Error(`${flag} must be a port from 0 to 65535.`);
75
+ return port;
76
+ }
77
+ function parseCliArgs(args) {
78
+ let mode = "serve";
79
+ let host = DEFAULT_HOST;
80
+ let port = DEFAULT_PORT;
81
+ let webRoot = null;
82
+ let index = 0;
83
+ const command = args[0];
84
+ if (command && !command.startsWith("-")) {
85
+ if (command === "serve" || command === "server") mode = "serve";
86
+ else if (command === "web") mode = "web";
87
+ else if (command === "help") return { mode, host, port, webRoot, help: true };
88
+ else throw new Error(`Unknown command: ${command}`);
89
+ index = 1;
90
+ }
91
+ for (let i = index; i < args.length; i += 1) {
92
+ const arg = args[i];
93
+ if (arg === "--help" || arg === "-h") return { mode, host, port, webRoot, help: true };
94
+ if (arg === "--listen") {
95
+ const listen = parseListen(requireValue(args, i, arg));
96
+ host = listen.host;
97
+ port = parsePort(String(listen.port), arg);
98
+ i += 1;
99
+ } else if (arg === "--hostname" || arg === "--host") {
100
+ host = requireValue(args, i, arg);
101
+ i += 1;
102
+ } else if (arg === "--port") {
103
+ port = parsePort(requireValue(args, i, arg), arg);
104
+ i += 1;
105
+ } else if (arg === "--web-root") {
106
+ webRoot = path2.resolve(requireValue(args, i, arg));
107
+ i += 1;
108
+ } else {
109
+ throw new Error(`Unknown option: ${arg}`);
110
+ }
111
+ }
112
+ return { mode, host, port, webRoot, help: false };
113
+ }
114
+ function defaultWebRootCandidates() {
115
+ return [
116
+ process.env.OPENPOND_WEB_ROOT,
117
+ path2.resolve(process.cwd(), "apps/web/dist"),
118
+ path2.resolve(__dirname, "../../web/dist"),
119
+ path2.resolve(process.cwd(), "web"),
120
+ path2.resolve(__dirname, "../web")
121
+ ].filter((candidate) => Boolean(candidate));
122
+ }
123
+ function resolveWebRoot(explicitWebRoot) {
124
+ const candidates = explicitWebRoot ? [explicitWebRoot] : defaultWebRootCandidates();
125
+ for (const candidate of candidates) {
126
+ const resolved = path2.resolve(candidate);
127
+ if (existsSync(path2.join(resolved, "index.html"))) return resolved;
128
+ }
129
+ return null;
130
+ }
131
+ function formatHostForUrl(host) {
132
+ const browserHost = host === "0.0.0.0" || host === "::" ? "127.0.0.1" : host;
133
+ return browserHost.includes(":") && !browserHost.startsWith("[") ? `[${browserHost}]` : browserHost;
134
+ }
135
+ function browserBaseUrl(instance) {
136
+ return `http://${formatHostForUrl(instance.status.host)}:${instance.status.port}`;
137
+ }
138
+ function tokenizedWebUrl(baseUrl, token) {
139
+ const url = new URL(baseUrl);
140
+ const params = new URLSearchParams();
141
+ params.set("openpondServerUrl", baseUrl);
142
+ params.set("openpondToken", token);
143
+ url.hash = params.toString();
144
+ return url.toString();
145
+ }
146
+ function printHelp() {
147
+ console.log(`Usage:
148
+ openpond-app-server serve [--hostname HOST] [--port PORT]
149
+ openpond-app-server web [--hostname HOST] [--port PORT] [--web-root DIR]
150
+
151
+ Options:
152
+ --listen HOST:PORT Set host and port together
153
+ --hostname HOST Bind host (default ${DEFAULT_HOST})
154
+ --port PORT Bind port, or 0 for any free port (default ${DEFAULT_PORT})
155
+ --web-root DIR Directory containing the built web UI for web mode
156
+ `);
157
+ }
158
+ async function runOpenPondServerCli(createOpenPondServer) {
159
+ const args = parseCliArgs(process.argv.slice(2));
160
+ if (args.help) {
161
+ printHelp();
162
+ return;
163
+ }
164
+ const webRoot = args.mode === "web" ? resolveWebRoot(args.webRoot) : null;
165
+ if (args.mode === "web" && !webRoot) {
166
+ throw new Error("Could not find a built OpenPond web UI. Run `pnpm build:web` or pass --web-root.");
167
+ }
168
+ const instance = await createOpenPondServer({ host: args.host, port: args.port, webRoot });
169
+ const webUrl = args.mode === "web" ? tokenizedWebUrl(browserBaseUrl(instance), instance.token) : null;
170
+ console.log(
171
+ `OPENPOND_APP_SERVER_READY ${JSON.stringify({
172
+ mode: args.mode,
173
+ url: instance.url,
174
+ webUrl,
175
+ webRoot,
176
+ tokenFile: instance.tokenFile,
177
+ storePath: instance.storePath,
178
+ runtime: getBundledRuntimeVersion()
179
+ })}`
180
+ );
181
+ if (webUrl) {
182
+ console.log(`OpenPond web UI: ${webUrl}`);
183
+ console.log(`Tailscale Serve URL token: #openpondToken=${encodeURIComponent(instance.token)}`);
184
+ } else {
185
+ console.log(`OpenPond API server: ${instance.url}`);
186
+ }
187
+ const shutdown = async () => {
188
+ await instance.close();
189
+ process.exit(0);
190
+ };
191
+ process.on("SIGINT", () => void shutdown());
192
+ process.on("SIGTERM", () => void shutdown());
193
+ await new Promise(() => {
194
+ });
195
+ }
196
+
197
+ export {
198
+ DEFAULT_HOST,
199
+ DEFAULT_PORT,
200
+ VERSION,
201
+ HOSTED_CHAT_SYSTEM_PROMPT,
202
+ APP_PREFERENCES_CACHE_TYPE,
203
+ APP_PREFERENCES_CACHE_KEY,
204
+ now,
205
+ textFromUnknown,
206
+ extractDelta,
207
+ event,
208
+ isCliEntrypoint,
209
+ runOpenPondServerCli
210
+ };
@@ -0,0 +1,11 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import {
3
+ runOpenPondServerCli
4
+ } from "./chunk-Y6G6WRTG.js";
5
+ import "./chunk-Q57SVPEH.js";
6
+ import "./chunk-LHYK6QO2.js";
7
+ import "./chunk-WYDVQOBL.js";
8
+ import "./chunk-UACZUFIA.js";
9
+ export {
10
+ runOpenPondServerCli
11
+ };
@@ -0,0 +1,19 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import {
3
+ createLocalGoal,
4
+ printGoalHelp,
5
+ runGoalCommand
6
+ } from "./chunk-4HYJG2JE.js";
7
+ import "./chunk-NLBKZZEK.js";
8
+ import "./chunk-VQX33YAG.js";
9
+ import "./chunk-LHYK6QO2.js";
10
+ import "./chunk-WYDVQOBL.js";
11
+ import "./chunk-XSAXENQD.js";
12
+ import "./chunk-5G4E547X.js";
13
+ import "./chunk-3Y4EL3P6.js";
14
+ import "./chunk-UACZUFIA.js";
15
+ export {
16
+ createLocalGoal,
17
+ printGoalHelp,
18
+ runGoalCommand
19
+ };
@@ -0,0 +1,41 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import {
3
+ resolveGitBranch,
4
+ runAccount,
5
+ runBacktestRun,
6
+ runCheckUpdate,
7
+ runDeployWatch,
8
+ runHealth,
9
+ runLogin,
10
+ runOpentool,
11
+ runProfiles,
12
+ runRepoCreate,
13
+ runRepoPush,
14
+ runTemplateBranches,
15
+ runTemplateStatus,
16
+ runTemplateUpdate,
17
+ runToolList,
18
+ runToolRun
19
+ } from "./chunk-74O6FGVN.js";
20
+ import "./chunk-XSAXENQD.js";
21
+ import "./chunk-5G4E547X.js";
22
+ import "./chunk-3Y4EL3P6.js";
23
+ import "./chunk-UACZUFIA.js";
24
+ export {
25
+ resolveGitBranch,
26
+ runAccount,
27
+ runBacktestRun,
28
+ runCheckUpdate,
29
+ runDeployWatch,
30
+ runHealth,
31
+ runLogin,
32
+ runOpentool,
33
+ runProfiles,
34
+ runRepoCreate,
35
+ runRepoPush,
36
+ runTemplateBranches,
37
+ runTemplateStatus,
38
+ runTemplateUpdate,
39
+ runToolList,
40
+ runToolRun
41
+ };
@@ -0,0 +1,84 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import "./chunk-KRKGHVMQ.js";
3
+ import "./chunk-W5GKHH77.js";
4
+ import {
5
+ loadOpenPondProfileState
6
+ } from "./chunk-FUP7EGT7.js";
7
+ import "./chunk-I6HN3ZGW.js";
8
+ import {
9
+ createLocalGoal,
10
+ runGoalCommand
11
+ } from "./chunk-4HYJG2JE.js";
12
+ import "./chunk-NLBKZZEK.js";
13
+ import "./chunk-VQX33YAG.js";
14
+ import "./chunk-LHYK6QO2.js";
15
+ import "./chunk-BYAPLT37.js";
16
+ import "./chunk-WYDVQOBL.js";
17
+ import "./chunk-XSAXENQD.js";
18
+ import "./chunk-5G4E547X.js";
19
+ import "./chunk-3Y4EL3P6.js";
20
+ import "./chunk-UACZUFIA.js";
21
+
22
+ // src/cli/extend.ts
23
+ async function runOpenPondExtendCommand(options, rest) {
24
+ await runOpenPondAgentPipelineCommand({
25
+ options,
26
+ rest,
27
+ kind: "create_agent",
28
+ command: "openpond extend",
29
+ surface: "local_extend",
30
+ usage: 'usage: extend "<profile capability change>" [--run]'
31
+ });
32
+ }
33
+ async function runOpenPondEditCommand(options, rest) {
34
+ await runOpenPondAgentPipelineCommand({
35
+ options,
36
+ rest,
37
+ kind: "update_agent",
38
+ command: "/edit",
39
+ surface: "direct_prompt_edit",
40
+ usage: 'usage: edit "<profile agent change>" [--agent-id <id>] [--run]'
41
+ });
42
+ }
43
+ async function runOpenPondAgentPipelineCommand(params) {
44
+ const { options, rest } = params;
45
+ const state = await loadOpenPondProfileState();
46
+ if (state.error) throw new Error(state.error);
47
+ if (!state.sourcePath) {
48
+ throw new Error("No active OpenPond profile. Run `openpond init` or `openpond profile load --path <dir>`.");
49
+ }
50
+ const goalOptions = { ...options };
51
+ if (typeof goalOptions.cwd !== "string" || goalOptions.cwd.trim().length === 0) {
52
+ goalOptions.cwd = state.sourcePath;
53
+ }
54
+ if (params.kind === "update_agent") {
55
+ const selectedAgentId = typeof goalOptions.agentId === "string" && goalOptions.agentId.trim() ? goalOptions.agentId.trim() : state.agents[0]?.id ?? "default";
56
+ goalOptions.agentId = selectedAgentId;
57
+ }
58
+ const objective = rest.join(" ").trim();
59
+ if (!objective) {
60
+ throw new Error(params.usage);
61
+ }
62
+ const goal = await createLocalGoal({
63
+ options: goalOptions,
64
+ objective,
65
+ kind: params.kind,
66
+ createPipeline: {
67
+ command: params.command,
68
+ surface: params.surface,
69
+ profile: {
70
+ activeProfile: state.activeProfile,
71
+ repoPath: state.repoPath,
72
+ sourcePath: state.sourcePath,
73
+ localHead: state.git?.head ?? null
74
+ }
75
+ }
76
+ });
77
+ if (options.run === true || options.run === "true") {
78
+ await runGoalCommand({ ...goalOptions, goalId: goal.id }, ["run"]);
79
+ }
80
+ }
81
+ export {
82
+ runOpenPondEditCommand,
83
+ runOpenPondExtendCommand
84
+ };
@@ -0,0 +1,140 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import {
3
+ runProcessCommand
4
+ } from "./chunk-XSAXENQD.js";
5
+ import {
6
+ CliUsageError
7
+ } from "./chunk-5G4E547X.js";
8
+ import {
9
+ optionString,
10
+ parseBooleanOption
11
+ } from "./chunk-3Y4EL3P6.js";
12
+ import "./chunk-UACZUFIA.js";
13
+
14
+ // src/cli/harness.ts
15
+ import path from "node:path";
16
+ import { access } from "node:fs/promises";
17
+ import { constants } from "node:fs";
18
+ import { createRequire } from "node:module";
19
+ var DESKTOP_HARNESS_SCRIPT = path.join("scripts", "desktop-harness.ts");
20
+ async function runHarnessCommand(options, rest) {
21
+ const invocation = await buildDesktopHarnessInvocation({ options, rest });
22
+ const result = await runProcessCommand(invocation.command, invocation.args, {
23
+ cwd: invocation.cwd,
24
+ inherit: true,
25
+ timeoutMs: 0
26
+ });
27
+ if (result.code !== 0) {
28
+ throw new HarnessCommandFailedError(result.code);
29
+ }
30
+ }
31
+ async function buildDesktopHarnessInvocation(input) {
32
+ const options = input.options;
33
+ const rest = input.rest;
34
+ const surface = rest[0];
35
+ const action = rest[1];
36
+ if (surface !== "desktop" || action !== "run" && action !== "attach") {
37
+ throw new CliUsageError(desktopHarnessCliUsage());
38
+ }
39
+ const scenarios = rest.slice(2);
40
+ if (scenarios.length === 0) {
41
+ throw new CliUsageError("usage: openpond harness desktop run <scenario...> [options]");
42
+ }
43
+ const startCwd = optionString(options, "cwd") || input.cwd || process.cwd();
44
+ const repoRoot = await resolveDesktopHarnessRepoRoot(startCwd);
45
+ const env = input.env ?? process.env;
46
+ const command = env.OPENPOND_NODE_BINARY?.trim() || process.execPath;
47
+ const tsxCli = createRequire(import.meta.url).resolve("tsx/cli");
48
+ const args = [tsxCli, DESKTOP_HARNESS_SCRIPT, "run", ...scenarios];
49
+ const launchMode = resolveLaunchMode(options, action);
50
+ if (launchMode) args.push(`--${launchMode}`);
51
+ appendStringFlag(args, "--app", options, "app");
52
+ appendStringFlag(args, "--server", options, "server");
53
+ appendStringFlag(args, "--token", options, "token");
54
+ appendStringFlag(args, "--token-file", options, "tokenFile");
55
+ appendStringFlag(args, "--devtools-port", options, "devtoolsPort");
56
+ appendStringFlag(args, "--artifacts-dir", options, "artifactsDir");
57
+ appendJsonFlag(args, options);
58
+ appendStringFlag(args, "--grep", options, "grep");
59
+ appendStringFlag(args, "--timeout-ms", options, "timeoutMs");
60
+ if (parseBooleanOption(options.keepHome)) args.push("--keep-home");
61
+ return { command, args, cwd: repoRoot };
62
+ }
63
+ async function resolveDesktopHarnessRepoRoot(startCwd) {
64
+ let current = path.resolve(startCwd);
65
+ while (true) {
66
+ const scriptPath = path.join(current, DESKTOP_HARNESS_SCRIPT);
67
+ if (await fileExists(scriptPath)) return current;
68
+ const parent = path.dirname(current);
69
+ if (parent === current) {
70
+ throw new CliUsageError(
71
+ `Could not find ${DESKTOP_HARNESS_SCRIPT}. Run this command from the OpenPond source checkout or pass --cwd <repo>.`
72
+ );
73
+ }
74
+ current = parent;
75
+ }
76
+ }
77
+ function resolveLaunchMode(options, action) {
78
+ let mode = action === "attach" ? "attach" : null;
79
+ for (const candidate of ["isolated", "attach", "packaged", "none"]) {
80
+ if (!parseBooleanOption(options[candidate])) continue;
81
+ if (mode && mode !== candidate) {
82
+ throw new CliUsageError("Choose only one desktop harness launch mode: --isolated, --attach, --packaged, or --none.");
83
+ }
84
+ mode = candidate;
85
+ }
86
+ return mode;
87
+ }
88
+ function appendStringFlag(args, flag, options, key) {
89
+ const value = optionString(options, key);
90
+ if (!value) return;
91
+ args.push(flag, value);
92
+ }
93
+ function appendJsonFlag(args, options) {
94
+ const json = optionString(options, "json");
95
+ const jsonPath = optionString(options, "jsonPath");
96
+ if (json && isBooleanLiteral(json)) {
97
+ throw new CliUsageError("harness --json requires a report path. Use --json <path> or --json-path <path>.");
98
+ }
99
+ if (json && jsonPath && json !== jsonPath) {
100
+ throw new CliUsageError("Use only one JSON report path: --json <path> or --json-path <path>.");
101
+ }
102
+ const value = json || jsonPath;
103
+ if (value) args.push("--json", value);
104
+ }
105
+ function isBooleanLiteral(value) {
106
+ return /^(true|false|1|0|yes|no)$/i.test(value);
107
+ }
108
+ async function fileExists(filePath) {
109
+ try {
110
+ await access(filePath, constants.R_OK);
111
+ return true;
112
+ } catch {
113
+ return false;
114
+ }
115
+ }
116
+ function desktopHarnessCliUsage() {
117
+ return [
118
+ "usage: openpond harness desktop run <scenario...> [options]",
119
+ " openpond harness desktop attach <scenario...> [options]",
120
+ "",
121
+ "Options include --isolated, --attach, --packaged, --none, --app <path>,",
122
+ "--server <url>, --token <token>, --token-file <path>, --devtools-port <port>, --artifacts-dir <path>,",
123
+ "--json <path>, --json-path <path>, --grep <pattern>, --timeout-ms <ms>,",
124
+ "--keep-home, and --cwd <repo>."
125
+ ].join("\n");
126
+ }
127
+ var HarnessCommandFailedError = class extends Error {
128
+ exitCode;
129
+ constructor(code) {
130
+ const exitCode = typeof code === "number" && code > 0 ? code : 1;
131
+ super(`desktop harness failed with exit code ${exitCode}`);
132
+ this.name = "HarnessCommandFailedError";
133
+ this.exitCode = exitCode;
134
+ }
135
+ };
136
+ export {
137
+ buildDesktopHarnessInvocation,
138
+ resolveDesktopHarnessRepoRoot,
139
+ runHarnessCommand
140
+ };
@@ -0,0 +1,65 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import {
3
+ CLI_GLOBAL_OPTION_SCHEMA,
4
+ formatCliCommandUsage,
5
+ listCliCommandDefinitions
6
+ } from "./chunk-3Y4EL3P6.js";
7
+ import "./chunk-UACZUFIA.js";
8
+
9
+ // src/cli/help.ts
10
+ function printHelp() {
11
+ console.log(formatCliHelp());
12
+ }
13
+ function formatCliHelp() {
14
+ const lines = [
15
+ "OpenPond CLI",
16
+ "",
17
+ "Usage:",
18
+ " openpond <command> [options] [-- passthrough...]",
19
+ " openpond --version",
20
+ "",
21
+ "Commands:"
22
+ ];
23
+ for (const definition of listCliCommandDefinitions()) {
24
+ const aliases = definition.aliases?.length ? ` (aliases: ${definition.aliases.join(", ")})` : "";
25
+ lines.push(` ${definition.usage}${aliases}`);
26
+ for (const usage of definition.usages ?? []) lines.push(` ${usage}`);
27
+ }
28
+ lines.push("", "Global options:");
29
+ for (const [name, kind] of Object.entries(CLI_GLOBAL_OPTION_SCHEMA).sort(
30
+ ([left], [right]) => left.localeCompare(right)
31
+ )) {
32
+ const flag = name.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);
33
+ lines.push(kind === "boolean" ? ` --${flag}` : ` --${flag} <${kind}>`);
34
+ }
35
+ lines.push(
36
+ "",
37
+ "Run `openpond <command> --help` for the selected command schema.",
38
+ "Arguments after `--` are passed through without option parsing."
39
+ );
40
+ return lines.join("\n");
41
+ }
42
+ function formatCliCommandReference() {
43
+ const sections = listCliCommandDefinitions().map(
44
+ (definition) => `## ${definition.name}
45
+
46
+ \`\`\`text
47
+ ${formatCliCommandUsage(definition)}
48
+ \`\`\``
49
+ );
50
+ return [
51
+ "# OpenPond CLI command reference",
52
+ "",
53
+ "<!-- Generated by `pnpm --dir apps/cli docs:commands`; do not edit by hand. -->",
54
+ "",
55
+ "Parsing, aliases, command help, and this reference use the same authoritative registry.",
56
+ "",
57
+ ...sections,
58
+ ""
59
+ ].join("\n");
60
+ }
61
+ export {
62
+ formatCliCommandReference,
63
+ formatCliHelp,
64
+ printHelp
65
+ };