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
package/dist/api.d.ts ADDED
@@ -0,0 +1,90 @@
1
+ import type { AgentCreateRequest, AppCodeVisibilityUpdateResponse, AppEnvironmentGetResponse, AppEnvironmentUpdateRequest, AppEnvironmentUpdateResponse, AppExecutionTimelineResponse, AppListItem, AppRuntimeSummary, AppSchedulesResponse, AssistantRunRequest, AssistantRunResponse, BacktestRunRequest, CreateLocalProjectInput, CreateRepoRequest, CreateRepoResponse, HeadlessAppRequest, HeadlessAppsResponse, OpenPondAccountBalanceResponse, OpenPondAccountResponse, OpenPondApiHealth, OpenToolRecipe, OpenToolRecipeGetRequest, OpenToolRecipeListRequest, OpenToolRecipeListResponse, OpenToolRecipeSearchRequest, OpenToolRecipeSearchResponse, OpenToolRulesGetRequest, OpenToolRulesGetResponse, ScheduleDeleteResponse, ScheduleExecutionLog, ScheduleExecutionLogsResponse, ScheduleRunNowRequest, ScheduleRunNowResponse, ScheduleToggleRequest, ScheduleToggleResult, TemplateBranchesResponse, TemplateDeployLatestRequest, TemplateDeployLatestResponse, TemplateStatusResponse, ToolExecuteRequest, ToolExecuteResponse, ToolManifest } from "./api/types.js";
2
+ import type { ChatRequestBody } from "./types.js";
3
+ export { apiFetch } from "./api/core.js";
4
+ export { commitFiles, deployApp, getDeploymentDetail, getDeploymentLogs, getDeploymentStatus, getLatestDeploymentForApp, promotePreviewToProduction, startAppLifecycle, } from "./api/deployments.js";
5
+ export type { AgentCreateRequest, AppCodeVisibilityUpdateResponse, AppEnvironmentGetResponse, AppEnvironmentUpdateRequest, AppEnvironmentUpdateResponse, AppExecutionDeployment, AppExecutionTimelineResponse, AppExecutionToolRun, AppListItem, AppRuntimeSummary, AppSchedule, AppSchedulesResponse, AppScheduleSummary, AssistantMode, AssistantRunRequest, AssistantRunResponse, BacktestRunRequest, CreateLocalProjectInput, CreateRepoRequest, CreateRepoResponse, DeploymentDetail, DeploymentLogEntry, HeadlessAppRequest, HeadlessAppResponse, HeadlessAppsResponse, OpenPondAccount, OpenPondAccountBalanceResponse, OpenPondAccountProduct, OpenPondAccountResponse, OpenPondApiHealth, OpenPondApiHealthResponse, OpenToolRecipe, OpenToolRecipeDomain, OpenToolRecipeGetRequest, OpenToolRecipeListRequest, OpenToolRecipeListResponse, OpenToolRecipeSearchRequest, OpenToolRecipeSearchResponse, OpenToolRecipeSummary, OpenToolRulesGetRequest, OpenToolRulesGetResponse, PromotePreviewToProductionRequest, PromotePreviewToProductionResponse, ScheduleDeleteResponse, ScheduleExecutionLog, ScheduleExecutionLogsResponse, ScheduleExecutionStatus, ScheduleRunNowRequest, ScheduleRunNowResponse, ScheduleToggleRequest, ScheduleToggleResult, StartAppLifecycleRequest, StartAppLifecycleResponse, TemplateBranchesResponse, TemplateDeployLatestRequest, TemplateDeployLatestResponse, TemplateStatusResponse, ToolExecuteRequest, ToolExecuteResponse, ToolManifest, } from "./api/types.js";
6
+ export declare function listApps(apiBase: string, token: string, options?: {
7
+ handle?: string;
8
+ limit?: number;
9
+ offset?: number;
10
+ includeScheduled?: boolean;
11
+ }): Promise<AppListItem[]>;
12
+ export declare function createLocalProject(baseUrl: string, token: string, input: CreateLocalProjectInput): Promise<{
13
+ appId: string;
14
+ }>;
15
+ export declare function createRepo(apiBase: string, apiKey: string, input: CreateRepoRequest): Promise<CreateRepoResponse>;
16
+ export declare function updateAppCodeVisibility(apiBase: string, apiKey: string, appId: string, codeVisibility: "public" | "private"): Promise<AppCodeVisibilityUpdateResponse>;
17
+ export declare function createHeadlessApps(baseUrl: string, token: string, items: HeadlessAppRequest[], teamId?: string): Promise<HeadlessAppsResponse>;
18
+ export declare function getTemplateStatus(apiBase: string, token: string, appId: string): Promise<TemplateStatusResponse>;
19
+ export declare function listTemplateBranches(apiBase: string, token: string, appId: string): Promise<TemplateBranchesResponse>;
20
+ export declare function deployLatestTemplate(apiBase: string, token: string, appId: string, input: TemplateDeployLatestRequest): Promise<TemplateDeployLatestResponse>;
21
+ export declare function updateAppEnvironment(apiBase: string, token: string, appId: string, input: AppEnvironmentUpdateRequest): Promise<AppEnvironmentUpdateResponse>;
22
+ export declare function getAppEnvironment(apiBase: string, token: string, appId: string): Promise<AppEnvironmentGetResponse>;
23
+ export declare function fetchToolManifest(baseUrl: string, token: string): Promise<ToolManifest>;
24
+ export declare function listUserTools(baseUrl: string, token: string): Promise<{
25
+ tools?: unknown[];
26
+ }>;
27
+ export declare function listAppSchedules(baseUrl: string, token: string, appId: string): Promise<AppSchedulesResponse>;
28
+ export declare function listOpenToolRecipes(baseUrl: string, token: string, input?: OpenToolRecipeListRequest): Promise<OpenToolRecipeListResponse>;
29
+ export declare function searchOpenToolRecipes(baseUrl: string, token: string, input: OpenToolRecipeSearchRequest): Promise<OpenToolRecipeSearchResponse>;
30
+ export declare function getOpenToolRecipe(baseUrl: string, token: string, input: OpenToolRecipeGetRequest): Promise<OpenToolRecipe>;
31
+ export declare function getOpenToolRules(baseUrl: string, token: string, input: OpenToolRulesGetRequest): Promise<OpenToolRulesGetResponse>;
32
+ export declare function startAppSchedules(baseUrl: string, token: string, appId: string, input?: ScheduleToggleRequest): Promise<ScheduleToggleResult>;
33
+ export declare function stopAppSchedules(baseUrl: string, token: string, appId: string): Promise<ScheduleToggleResult>;
34
+ export declare function stopCurrentAppSchedules(baseUrl: string, token: string): Promise<ScheduleToggleResult>;
35
+ export declare function runScheduleNow(baseUrl: string, token: string, input: ScheduleRunNowRequest): Promise<ScheduleRunNowResponse>;
36
+ export declare function deleteOrArchiveSchedule(baseUrl: string, token: string, appId: string, scheduleId: string): Promise<ScheduleDeleteResponse>;
37
+ export declare function listScheduleExecutionLogs(baseUrl: string, token: string, scheduleId: string, options?: {
38
+ limit?: number;
39
+ }): Promise<ScheduleExecutionLogsResponse>;
40
+ export declare function listDeploymentScheduleExecutionLogs(baseUrl: string, token: string, deploymentId: string, options?: {
41
+ limit?: number;
42
+ }): Promise<ScheduleExecutionLogsResponse>;
43
+ export declare function getScheduleExecutionLog(baseUrl: string, token: string, runId: string): Promise<ScheduleExecutionLog>;
44
+ export declare function getAppExecutionTimeline(baseUrl: string, token: string, appId: string, options?: {
45
+ limit?: number;
46
+ }): Promise<AppExecutionTimelineResponse>;
47
+ export declare function createAgentFromPrompt(baseUrl: string, token: string, payload: AgentCreateRequest): Promise<Response>;
48
+ export declare function getUserPerformance(baseUrl: string, token: string, options?: {
49
+ appId?: string;
50
+ }): Promise<unknown>;
51
+ export declare function getAppRuntimeSummary(baseUrl: string, token: string, appId: string): Promise<AppRuntimeSummary>;
52
+ export declare function getOpenPondAccount(baseUrl: string, token: string): Promise<OpenPondAccountResponse>;
53
+ export declare function getOpenPondAccountBalance(baseUrl: string, token: string): Promise<OpenPondAccountBalanceResponse>;
54
+ export declare function checkOpenPondApiHealth(baseUrl: string, token?: string | null): Promise<OpenPondApiHealth>;
55
+ export declare function runAssistantMode(baseUrl: string, token: string, payload: AssistantRunRequest): Promise<AssistantRunResponse>;
56
+ export declare function postAgentDigest(baseUrl: string, token: string, body: {
57
+ content: string;
58
+ runAt?: string;
59
+ metadata?: Record<string, unknown>;
60
+ }): Promise<unknown>;
61
+ export declare function executeUserTool(baseUrl: string, token: string, body: {
62
+ appId: string;
63
+ deploymentId: string;
64
+ toolName: string;
65
+ scheduleId?: string;
66
+ method?: "GET" | "POST" | "PUT" | "DELETE";
67
+ body?: unknown;
68
+ headers?: Record<string, string>;
69
+ notifyEmail?: boolean;
70
+ }): Promise<{
71
+ ok: boolean;
72
+ status: number;
73
+ data?: unknown;
74
+ error?: string;
75
+ }>;
76
+ export declare function submitPositionsTx(baseUrl: string, token: string, params: {
77
+ method: "GET" | "POST";
78
+ body?: unknown;
79
+ query?: Record<string, string>;
80
+ }): Promise<unknown>;
81
+ export declare function submitBacktestRun(baseUrl: string, token: string, body: BacktestRunRequest): Promise<unknown>;
82
+ export declare function submitBacktestTx(baseUrl: string, token: string, params: {
83
+ method: "GET" | "POST";
84
+ body?: unknown;
85
+ query?: Record<string, string>;
86
+ }): Promise<unknown>;
87
+ export declare function submitBacktestDetail(baseUrl: string, token: string, query: Record<string, string>): Promise<unknown>;
88
+ export declare function chatRequest(baseUrl: string, token: string, body: ChatRequestBody): Promise<Response>;
89
+ export declare function resolveWorkerBaseUrl(baseUrl: string): string;
90
+ export declare function executeHostedTool(baseUrl: string, token: string, payload: ToolExecuteRequest): Promise<ToolExecuteResponse>;
@@ -0,0 +1,22 @@
1
+ import type { AppListItem } from "./api.js";
2
+ export declare const DEFAULT_CACHE_TTL_MS: number;
3
+ export declare function getCachedApps(params: {
4
+ apiBase: string;
5
+ apiKey: string;
6
+ ttlMs?: number;
7
+ }): Promise<AppListItem[] | null>;
8
+ export declare function setCachedApps(params: {
9
+ apiBase: string;
10
+ apiKey: string;
11
+ apps: AppListItem[];
12
+ }): Promise<void>;
13
+ export declare function getCachedTools(params: {
14
+ apiBase: string;
15
+ apiKey: string;
16
+ ttlMs?: number;
17
+ }): Promise<unknown[] | null>;
18
+ export declare function setCachedTools(params: {
19
+ apiBase: string;
20
+ apiKey: string;
21
+ tools: unknown[];
22
+ }): Promise<void>;
@@ -0,0 +1,163 @@
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 "./chunk-3Y4EL3P6.js";
9
+ import "./chunk-UACZUFIA.js";
10
+
11
+ // src/cli/app-layer.ts
12
+ import { existsSync } from "node:fs";
13
+ import { createRequire } from "node:module";
14
+ import path from "node:path";
15
+ import { fileURLToPath } from "node:url";
16
+
17
+ // src/cli/build-mode.ts
18
+ var IS_COMPILED_CLI = false;
19
+
20
+ // src/cli/app-layer.ts
21
+ var __dirname = path.dirname(fileURLToPath(import.meta.url));
22
+ var OpenPondChildProcessExitError = class extends Error {
23
+ constructor(message, exitCode) {
24
+ super(message);
25
+ this.exitCode = exitCode;
26
+ this.name = "OpenPondChildProcessExitError";
27
+ }
28
+ exitCode;
29
+ };
30
+ async function runOpenPondServerCommand(mode, options, rest) {
31
+ const server = resolveAppEntrypoint("server");
32
+ const args = [...server.args, mode, ...forwardedOptions(options), ...rest];
33
+ const webRoot = mode === "web" && typeof options.webRoot !== "string" ? packagedWebRoot() : null;
34
+ if (webRoot) args.push("--web-root", webRoot);
35
+ await runChild(server.runner, args, server.cwd);
36
+ }
37
+ async function runOpenPondTerminalCommand(options, rest) {
38
+ validateTerminalForwardingOptions(options);
39
+ const terminal = resolveAppEntrypoint("terminal");
40
+ const server = resolveAppEntrypoint("server");
41
+ const args = [...terminal.args, "chat", ...forwardedOptions(normalizeTerminalPaths(options)), ...rest];
42
+ await runChild(terminal.runner, args, process.cwd(), {
43
+ OPENPOND_SERVER_RUNNER: server.runner,
44
+ OPENPOND_SERVER_ARGS: JSON.stringify(server.args),
45
+ OPENPOND_SERVER_CWD: server.cwd
46
+ });
47
+ }
48
+ function findWorkspaceRoot() {
49
+ if (process.env.OPENPOND_FORCE_EMBEDDED_COMPANIONS === "1") return null;
50
+ const candidates = [
51
+ path.resolve(__dirname, "../../../.."),
52
+ path.resolve(__dirname, "../../.."),
53
+ process.cwd()
54
+ ];
55
+ for (const candidate of candidates) {
56
+ if (existsSync(path.join(candidate, "apps", "server")) && existsSync(path.join(candidate, "apps", "terminal"))) {
57
+ return candidate;
58
+ }
59
+ }
60
+ return null;
61
+ }
62
+ function resolveAppEntrypoint(app) {
63
+ const workspaceRoot = findWorkspaceRoot();
64
+ if (workspaceRoot) {
65
+ const source = path.join(workspaceRoot, "apps", app, "src", "index.ts");
66
+ if (existsSync(source)) {
67
+ const workspaceRequire = createRequire(path.join(workspaceRoot, "package.json"));
68
+ return {
69
+ runner: process.execPath,
70
+ args: [workspaceRequire.resolve("tsx/cli"), source],
71
+ cwd: workspaceRoot
72
+ };
73
+ }
74
+ const built = path.join(workspaceRoot, "apps", app, "dist", "index.js");
75
+ if (existsSync(built)) return { runner: process.execPath, args: [built], cwd: workspaceRoot };
76
+ }
77
+ const installedCli = installedCliEntrypoint();
78
+ const embeddedMode = app === "server" ? "__server" : "__terminal";
79
+ if (installedCli) {
80
+ return { runner: process.execPath, args: [installedCli, embeddedMode], cwd: path.dirname(path.dirname(installedCli)) };
81
+ }
82
+ if (isCompiledExecutable()) return { runner: process.execPath, args: [embeddedMode], cwd: process.cwd() };
83
+ throw new Error(`Could not find the installed OpenPond ${app} companion.`);
84
+ }
85
+ function installedCliEntrypoint() {
86
+ for (const candidate of [
87
+ path.resolve(__dirname, "../cli.js"),
88
+ path.resolve(__dirname, "../../dist/cli.js")
89
+ ]) {
90
+ if (existsSync(candidate)) return candidate;
91
+ }
92
+ return null;
93
+ }
94
+ function packagedWebRoot() {
95
+ if (IS_COMPILED_CLI) {
96
+ const candidate2 = path.join(path.dirname(process.execPath), "web");
97
+ return existsSync(path.join(candidate2, "index.html")) ? candidate2 : null;
98
+ }
99
+ const installedCli = installedCliEntrypoint();
100
+ if (!installedCli) return null;
101
+ const candidate = path.join(path.dirname(installedCli), "web");
102
+ return existsSync(path.join(candidate, "index.html")) ? candidate : null;
103
+ }
104
+ function isCompiledExecutable() {
105
+ if (IS_COMPILED_CLI) return true;
106
+ const argvEntry = process.argv[1];
107
+ return Boolean(argvEntry && path.resolve(argvEntry) === path.resolve(process.execPath));
108
+ }
109
+ function forwardedOptions(options) {
110
+ const ignored = /* @__PURE__ */ new Set(["account", "handle", "baseUrl", "tui"]);
111
+ const args = [];
112
+ for (const [key, value] of Object.entries(options)) {
113
+ if (ignored.has(key)) continue;
114
+ const flag = `--${key.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`)}`;
115
+ if (value === true || value === "true") {
116
+ args.push(flag);
117
+ } else if (value === false || value === "false") {
118
+ continue;
119
+ } else {
120
+ args.push(flag, value);
121
+ }
122
+ }
123
+ return args;
124
+ }
125
+ function normalizeTerminalPaths(options) {
126
+ const callerCwd = process.cwd();
127
+ const next = { ...options };
128
+ if (typeof options.cwd === "string" && options.cwd.trim().length > 0) {
129
+ next.cwd = path.resolve(callerCwd, options.cwd);
130
+ }
131
+ if (typeof options.messageFile === "string" && options.messageFile.trim().length > 0) {
132
+ next.messageFile = path.resolve(callerCwd, options.messageFile);
133
+ }
134
+ return next;
135
+ }
136
+ function validateTerminalForwardingOptions(options) {
137
+ if (typeof options.approvalPolicy === "string" && !["on-request", "never", "on-failure", "untrusted"].includes(options.approvalPolicy)) {
138
+ throw new CliUsageError("approval-policy must be on-request, never, on-failure, or untrusted");
139
+ }
140
+ if (typeof options.sandbox === "string" && !["read-only", "workspace-write", "danger-full-access"].includes(options.sandbox)) {
141
+ throw new CliUsageError("sandbox must be read-only, workspace-write, or danger-full-access");
142
+ }
143
+ }
144
+ async function runChild(command, args, cwd, env) {
145
+ const result = await runProcessCommand(command, args, {
146
+ cwd,
147
+ // Keep embedded companions in the CLI's process group so an outer package
148
+ // runner can stop the complete installed CLI tree with one signal.
149
+ detached: false,
150
+ env,
151
+ inherit: true,
152
+ timeoutMs: 0
153
+ });
154
+ if (result.code !== 0 || result.signal) {
155
+ const detail = result.signal ? `signal ${result.signal}` : `code ${result.code ?? "unknown"}`;
156
+ throw new OpenPondChildProcessExitError(`${path.basename(command)} exited with ${detail}`, result.code ?? 1);
157
+ }
158
+ }
159
+ export {
160
+ OpenPondChildProcessExitError,
161
+ runOpenPondServerCommand,
162
+ runOpenPondTerminalCommand
163
+ };