openpond 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/cache.d.ts +7 -10
- package/dist/chunks/actions-command-QP3NMDK4.js +2 -0
- package/dist/chunks/app-layer-N7VFRVJ2.js +3 -0
- package/dist/chunks/app-server-runtime-OCLPUI7F.js +2 -0
- package/dist/chunks/apps-AMG75TI4.js +2 -0
- package/dist/chunks/chunk-22UARBPW.js +3 -0
- package/dist/chunks/chunk-3A7HZJNE.js +1 -0
- package/dist/chunks/chunk-3M53YXEI.js +2 -0
- package/dist/chunks/chunk-3NDRIQTI.js +2 -0
- package/dist/chunks/chunk-5BBVEWG3.js +2 -0
- package/dist/chunks/chunk-5O7ZVCMV.js +6 -0
- package/dist/chunks/chunk-6FA3GG5B.js +33 -0
- package/dist/chunks/chunk-6MI4KKWF.js +2 -0
- package/dist/chunks/chunk-BBG546O6.js +6 -0
- package/dist/chunks/chunk-BX4J2VDU.js +2 -0
- package/dist/chunks/chunk-BZMVB3GS.js +2 -0
- package/dist/chunks/chunk-C5LOZSVS.js +2 -0
- package/dist/chunks/chunk-CWQWV2T3.js +2 -0
- package/dist/chunks/chunk-DUA3QP6Y.js +19 -0
- package/dist/chunks/chunk-EAPFMACH.js +10 -0
- package/dist/chunks/chunk-ES2ISFJC.js +66 -0
- package/dist/chunks/chunk-F65NIZLM.js +2199 -0
- package/dist/chunks/chunk-FGJ5LFPL.js +5 -0
- package/dist/chunks/chunk-FTQLQJQV.js +2 -0
- package/dist/chunks/chunk-FY7OQ5RK.js +24 -0
- package/dist/chunks/chunk-FYCJSUFV.js +53 -0
- package/dist/chunks/chunk-GLUWATL5.js +2 -0
- package/dist/chunks/chunk-H7IWJN7L.js +17 -0
- package/dist/chunks/chunk-HZP5U2AA.js +3 -0
- package/dist/chunks/chunk-I5K74TOH.js +3 -0
- package/dist/chunks/chunk-IR3YJWPW.js +7 -0
- package/dist/chunks/chunk-KU7QOHFT.js +2872 -0
- package/dist/chunks/chunk-KV553EWX.js +16 -0
- package/dist/chunks/chunk-MGN6GLNZ.js +2 -0
- package/dist/chunks/chunk-OG5Q6NXK.js +28 -0
- package/dist/chunks/chunk-OGPHXXCD.js +1 -0
- package/dist/chunks/chunk-PI36UHRA.js +18 -0
- package/dist/chunks/chunk-RWSAGQTP.js +2 -0
- package/dist/chunks/chunk-SAE4OIPC.js +2 -0
- package/dist/chunks/chunk-SDO4FC4Q.js +2 -0
- package/dist/chunks/chunk-UKUVMXOW.js +12 -0
- package/dist/chunks/chunk-VCLCFK3O.js +36 -0
- package/dist/chunks/chunk-VYUMTRB3.js +5 -0
- package/dist/chunks/chunk-X37KMV27.js +1 -0
- package/dist/chunks/chunk-XDHAGACI.js +3 -0
- package/dist/chunks/chunk-XEOEKFG6.js +71 -0
- package/dist/chunks/chunk-ZF7TEGY5.js +5 -0
- package/dist/chunks/chunk-ZVOO7FKM.js +2 -0
- package/dist/chunks/cli-M2FG7SSI.js +2 -0
- package/dist/chunks/configuration-command-XBKBIZBO.js +2 -0
- package/dist/chunks/continual-D75WA7E7.js +7 -0
- package/dist/chunks/core-commands-LUZVWXQR.js +2 -0
- package/dist/chunks/database-X2CUV732.js +2 -0
- package/dist/chunks/desktop-test-KGC4JVJ7.js +3 -0
- package/dist/chunks/dist-NKLXFA37.js +2 -0
- package/dist/chunks/extension-NQ7N5LEY.js +5 -0
- package/dist/chunks/help-MWK66XZK.js +8 -0
- package/dist/chunks/module-ES6BEMUI-ZVL3F6NW.js +2 -0
- package/dist/chunks/module-asyncify-2EFITU5U-R7TVXNAE.js +2 -0
- package/dist/chunks/opchat-XJZA3QKZ.js +3 -0
- package/dist/chunks/organizations-UECDFEYE.js +2 -0
- package/dist/chunks/profile-KUMIZURM.js +3 -0
- package/dist/chunks/project-agent-NILMJHLV.js +2 -0
- package/dist/chunks/sandbox-command-QHH65OSE.js +2 -0
- package/dist/chunks/sandbox-template-N7I63PNU.js +10 -0
- package/dist/chunks/src-724HF43W.js +82 -0
- package/dist/chunks/src-VTKTTKQO.js +319 -0
- package/dist/chunks/taskset-PISBOILQ.js +2 -0
- package/dist/chunks/teams-bot-UV4RU53M.js +3 -0
- package/dist/chunks/training-2NDOWH5S.js +2 -0
- package/dist/chunks/workspaces-XXT4KUD3.js +2 -0
- package/dist/cli.js +3 -101
- package/dist/client.d.ts +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/index.js +1 -26305
- package/dist/private-json-file.d.ts +1 -2
- package/dist/sandbox-template/manifest.js +1 -18380
- package/dist/web/assets/App-DxecRQUL.js +176 -0
- package/dist/web/assets/AppDialog-B65Eo3gp.js +1 -0
- package/dist/web/assets/AppTerminalPanel-B2EKQM7W.js +2 -0
- package/dist/web/assets/{AppsView-Ck_OzQWf.js → AppsView-BBoVe7s2.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-CqciX8aL.js → BrowserSidebar-CSM1atSJ.js} +1 -1
- package/dist/web/assets/{CartesianChart-Y0lsL4vC.js → CartesianChart-CJKfXiEG.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-BOb9PjvS.js → CollaborationTabs-BMZamWFC.js} +1 -1
- package/dist/web/assets/{CommandMenu-Co6JnmTu.js → CommandMenu-B3U1z2eo.js} +1 -1
- package/dist/web/assets/{CommunityView-BbTSeL7h.js → CommunityView-CTyRUcfy.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-BGzCWVFp.js → ComposerCreateImproveStrip-D7usvRtK.js} +1 -1
- package/dist/web/assets/GetStartedView-Ibu7oKWJ.js +1 -0
- package/dist/web/assets/HostedModelLearningReview-qnzIkT70.js +1 -0
- package/dist/web/assets/HostedModelLearningSettings--PKjpYsy.js +1 -0
- package/dist/web/assets/LabModelVersionDetailPage-s9uUN6fV.js +1 -0
- package/dist/web/assets/{LabSkillSidebar-C5oS6UmH.js → LabSkillSidebar-BKYseMiJ.js} +1 -1
- package/dist/web/assets/LabsRoute-C1FWCoYb.css +1 -0
- package/dist/web/assets/LabsRoute-DoRs0K6v.js +32 -0
- package/dist/web/assets/MainChatThread-DvuyMcMB.js +2 -0
- package/dist/web/assets/MainPane-BWwcxgHD.js +8 -0
- package/dist/web/assets/{MarkdownText-DqJarmTh.js → MarkdownText-D8XC5UT_.js} +1 -1
- package/dist/web/assets/{Messages-BaT7HOzB.js → Messages-e4A8JUjD.js} +6 -6
- package/dist/web/assets/{NativeSkillSidebar-DXp8snN5.js → NativeSkillSidebar-D2Joh8XB.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-CLHuGUN5.js → NewExperienceSwitcher-CzGebt2E.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-CzpHCAaC.js → NewProjectDialog-CdMTSxUE.js} +1 -1
- package/dist/web/assets/{OutputsPage-DIzx-Ge6.js → OutputsPage-m7cSb8dW.js} +1 -1
- package/dist/web/assets/{ProjectsPage-DojwrhOy.js → ProjectsPage-C9mz8W1g.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-B4LEqKEj.js +1 -0
- package/dist/web/assets/{RightSidebarHomePanel-DTzfuEX3.js → RightSidebarHomePanel-DOeUsH7h.js} +1 -1
- package/dist/web/assets/ScheduledWorkPage-UXZSSWgA.js +1 -0
- package/dist/web/assets/SettingsView-CAH0vreE.css +1 -0
- package/dist/web/assets/SettingsView-CQm1ai73.js +9 -0
- package/dist/web/assets/TeamChatView-C4haojB7.js +3 -0
- package/dist/web/assets/{TerminalOverlay-DnNVrCtu.js → TerminalOverlay-p2GZsuyQ.js} +3 -3
- package/dist/web/assets/{TrainingCreationPanel-CDwwyucO.js → TrainingCreationPanel-BYJSlO8X.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-BijDnV_0.js → TrainingDraftPanel-DR5KlayH.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-Y5BFAu1p.js → UsageSettingsSection-BQToNXE4.js} +5 -5
- package/dist/web/assets/{WorkSidebarPanel-CkJlvZKm.js → WorkSidebarPanel--EeytWeg.js} +1 -1
- package/dist/web/assets/WorkspaceDiffPanel-BrovSYhn.js +14 -0
- package/dist/web/assets/{WorkspaceEnvironmentMenu-D8knAy1q.js → WorkspaceEnvironmentMenu-l-keRgvj.js} +3 -3
- package/dist/web/assets/{WorkspaceGitDialogs-_LHTrvh6.js → WorkspaceGitDialogs-aicWzaZu.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-B2B7OM_L.js → WorkspaceMonacoEditor-CO_E74jM.js} +36 -36
- package/dist/web/assets/{arrow-up-right-4nAzMtjW.js → arrow-up-right-rwPXNfVn.js} +1 -1
- package/dist/web/assets/chat-file-links-B3jDstSC.js +1 -0
- package/dist/web/assets/chevron-up-D089nvYQ.js +1 -0
- package/dist/web/assets/{clipboard-BzjUoZFo.js → clipboard-DwEExyU4.js} +1 -1
- package/dist/web/assets/{cloud-upload-CsrrwS-b.js → cloud-upload-D2he0-vQ.js} +1 -1
- package/dist/web/assets/{cssMode-CIbSSHKJ.js → cssMode-DS4k0NcI.js} +1 -1
- package/dist/web/assets/{folder-open-vRTuLzpS.js → folder-open-CAOLduKD.js} +1 -1
- package/dist/web/assets/{folder-plus-hyqwgUnx.js → folder-plus-D56MrxVT.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-CaxKfeYa.js → git-commit-horizontal-CeNM0oKJ.js} +1 -1
- package/dist/web/assets/{htmlMode-C3MGQGam.js → htmlMode-Xkni5erh.js} +1 -1
- package/dist/web/assets/{index-ByQIHpc9.css → index-BGMzUaup.css} +1 -1
- package/dist/web/assets/{index-Dvq7bpBG.js → index-KwyAyscP.js} +1 -1
- package/dist/web/assets/{info-aYWeE1Iw.js → info-CcrBaEE_.js} +1 -1
- package/dist/web/assets/{jsonMode-CpD6UkT7.js → jsonMode-C4YPbQB7.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-DpcK8ZI6.js → lspLanguageFeatures-CF5oMTz6.js} +1 -1
- package/dist/web/assets/{minimize-2-DeYg7XqB.js → minimize-2-DzHQnInk.js} +1 -1
- package/dist/web/assets/{monaco.contribution-CrrdDQgP.js → monaco.contribution-0EN4mGCC.js} +2 -2
- package/dist/web/assets/{monaco.contribution-JWFq0HzV.js → monaco.contribution-B4qcTP0w.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BDTM0ZJq.js → monaco.contribution-CJK_NrBm.js} +2 -2
- package/dist/web/assets/{monaco.contribution-C-_ekTxy.js → monaco.contribution-CkPGKNd-.js} +2 -2
- package/dist/web/assets/{play-BqgRTddV.js → play-p3-AMTPL.js} +1 -1
- package/dist/web/assets/{python-B67wope9.js → python-B0kpTxAZ.js} +1 -1
- package/dist/web/assets/{refresh-cw-DwMA_2On.js → refresh-cw-_jbTIzzr.js} +1 -1
- package/dist/web/assets/{save-B0BKh5oQ.js → save-Cy6hEotx.js} +1 -1
- package/dist/web/assets/{square-LY3oz82L.js → square-DKQkcrOH.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-B2jka5B1.js → toggleHighContrast-Bnk1VVVq.js} +1 -1
- package/dist/web/assets/{tsMode-1MUwluYD.js → tsMode-BDrSVy7V.js} +1 -1
- package/dist/web/assets/{upload-bSKSkFVa.js → upload-COn0my_O.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules--jnnM4Fz.js → useLocalAgentSchedules-iZNB4Oee.js} +1 -1
- package/dist/web/assets/{wifi-off-DA34iPmr.js → wifi-off-Cqt-ZLXY.js} +1 -1
- package/dist/web/assets/{workers-CczIcRcl.js → workers-hu0Ym93h.js} +1 -1
- package/dist/web/assets/{yaml-DwEGoHA9.js → yaml-D-JLDGL6.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +28 -2
- package/package.json +10 -7
- package/dist/chunks/actions-command-6N5XWMR6.js +0 -185
- package/dist/chunks/app-layer-XEYHFJHI.js +0 -214
- package/dist/chunks/app-server-runtime-FJM2EQPH.js +0 -21
- package/dist/chunks/apps-GSXUDK6V.js +0 -427
- package/dist/chunks/chunk-2JABRRNR.js +0 -183
- package/dist/chunks/chunk-47EIAYI7.js +0 -2162
- package/dist/chunks/chunk-4L3ZJS2T.js +0 -1207
- package/dist/chunks/chunk-5TKZBMQM.js +0 -731
- package/dist/chunks/chunk-6G6MDZLM.js +0 -14509
- package/dist/chunks/chunk-BVY5JYM6.js +0 -512
- package/dist/chunks/chunk-C5TKGE5Y.js +0 -1275
- package/dist/chunks/chunk-CNTM26OW.js +0 -602
- package/dist/chunks/chunk-D7BO5Y5J.js +0 -1531
- package/dist/chunks/chunk-DJL4TJYG.js +0 -70
- package/dist/chunks/chunk-DLQQIWN2.js +0 -648
- package/dist/chunks/chunk-DNXBJZAU.js +0 -630
- package/dist/chunks/chunk-EFET7LB7.js +0 -1331
- package/dist/chunks/chunk-FQS2QL5F.js +0 -14522
- package/dist/chunks/chunk-HFPUR4CQ.js +0 -669
- package/dist/chunks/chunk-J3YDKJFD.js +0 -88
- package/dist/chunks/chunk-J7PYGDRY.js +0 -634
- package/dist/chunks/chunk-JTHL5XJ2.js +0 -1838
- package/dist/chunks/chunk-KSRWKXRB.js +0 -12
- package/dist/chunks/chunk-KWDOAJJI.js +0 -238
- package/dist/chunks/chunk-MUMPWI4O.js +0 -92
- package/dist/chunks/chunk-N3TGCM7J.js +0 -1135
- package/dist/chunks/chunk-NTK22KJD.js +0 -10707
- package/dist/chunks/chunk-O6B6YCMI.js +0 -57688
- package/dist/chunks/chunk-R3C3MNSI.js +0 -140
- package/dist/chunks/chunk-SMNFI2FU.js +0 -113
- package/dist/chunks/chunk-UACZUFIA.js +0 -47
- package/dist/chunks/chunk-W5GKHH77.js +0 -168
- package/dist/chunks/chunk-WBAZFKC7.js +0 -1643
- package/dist/chunks/chunk-X7ZG4TSW.js +0 -3063
- package/dist/chunks/chunk-YVCYVDNP.js +0 -746
- package/dist/chunks/cli-6PFRZ2WV.js +0 -21
- package/dist/chunks/continual-FYDKLCO7.js +0 -803
- package/dist/chunks/core-commands-MAN3CSJQ.js +0 -48
- package/dist/chunks/desktop-test-OE5SST2W.js +0 -146
- package/dist/chunks/extension-J3CIEDP4.js +0 -10041
- package/dist/chunks/help-JNGJJFU5.js +0 -67
- package/dist/chunks/opchat-6HEQJFLL.js +0 -167
- package/dist/chunks/organizations-MWAPNOCK.js +0 -804
- package/dist/chunks/profile-P7HMONTZ.js +0 -1134
- package/dist/chunks/project-agent-2RAK7GAZ.js +0 -514
- package/dist/chunks/sandbox-command-G22CPFNK.js +0 -1659
- package/dist/chunks/sandbox-template-S4WRUWJ6.js +0 -1653
- package/dist/chunks/src-BKBZ7WLO.js +0 -3624
- package/dist/chunks/src-RTGN2O4H.js +0 -65745
- package/dist/chunks/taskset-BMI7KOWP.js +0 -66
- package/dist/chunks/teams-bot-5VBYEN7M.js +0 -144
- package/dist/chunks/training-UPVSGDTB.js +0 -17
- package/dist/chunks/workspaces-IJQPWX3H.js +0 -99
- package/dist/web/assets/App-BOkhmdHu.js +0 -173
- package/dist/web/assets/AppDialog-BCjKFUBn.js +0 -1
- package/dist/web/assets/AppTerminalPanel-DRU8GIfy.js +0 -2
- package/dist/web/assets/GetStartedView-jEogFjxP.js +0 -1
- package/dist/web/assets/LabModelVersionDetailPage-CrudId_1.js +0 -1
- package/dist/web/assets/LabsRoute-9v8qwEBc.js +0 -2
- package/dist/web/assets/LabsRoute-CGFgymTX.css +0 -1
- package/dist/web/assets/MainChatThread-VtMpAxlP.js +0 -2
- package/dist/web/assets/MainPane-BbknUzp3.js +0 -8
- package/dist/web/assets/RightChatPanelStack-CIE5bgmO.js +0 -1
- package/dist/web/assets/ScheduledWorkPage-DdbcQGSv.js +0 -1
- package/dist/web/assets/SettingsView-CC5GXaE1.css +0 -1
- package/dist/web/assets/SettingsView-QT_OLmDh.js +0 -6
- package/dist/web/assets/TeamChatView-C4-nG1tC.js +0 -3
- package/dist/web/assets/WorkspaceDiffPanel-CBgzmBk8.js +0 -14
- package/dist/web/assets/chat-file-links-Bned0MT7.js +0 -1
- package/dist/web/assets/chevron-up-DK7ejCfk.js +0 -1
- package/dist/web/assets/index-66-ohHD5.js +0 -1
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// ../../packages/cloud/src/urls.ts
|
|
4
|
-
var DEFAULT_OPENPOND_WEB_BASE_URL = "https://openpond.ai";
|
|
5
|
-
var DEFAULT_OPENPOND_API_BASE_URL = "https://api.openpond.ai";
|
|
6
|
-
var DEFAULT_OPENPOND_OPCHAT_API_BASE_URL = "https://api.openpond.ai/opchat/v1";
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
DEFAULT_OPENPOND_WEB_BASE_URL,
|
|
10
|
-
DEFAULT_OPENPOND_API_BASE_URL,
|
|
11
|
-
DEFAULT_OPENPOND_OPCHAT_API_BASE_URL
|
|
12
|
-
};
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
runAppServerJsonl
|
|
4
|
-
} from "./chunk-5TKZBMQM.js";
|
|
5
|
-
import {
|
|
6
|
-
DEFAULT_HOST,
|
|
7
|
-
DEFAULT_PORT,
|
|
8
|
-
parseListen
|
|
9
|
-
} from "./chunk-DJL4TJYG.js";
|
|
10
|
-
import {
|
|
11
|
-
getBundledRuntimeVersion,
|
|
12
|
-
openUrlWithSystemBrowser
|
|
13
|
-
} from "./chunk-EFET7LB7.js";
|
|
14
|
-
|
|
15
|
-
// ../server/src/cli.ts
|
|
16
|
-
import { existsSync } from "node:fs";
|
|
17
|
-
import path from "node:path";
|
|
18
|
-
import { fileURLToPath } from "node:url";
|
|
19
|
-
var __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
20
|
-
function requireValue(args, index, flag) {
|
|
21
|
-
const value = args[index + 1];
|
|
22
|
-
if (!value || value.startsWith("--")) throw new Error(`${flag} requires a value.`);
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
function parsePort(value, flag) {
|
|
26
|
-
const port = Number.parseInt(value, 10);
|
|
27
|
-
if (!Number.isFinite(port) || port < 0 || port > 65535) throw new Error(`${flag} must be a port from 0 to 65535.`);
|
|
28
|
-
return port;
|
|
29
|
-
}
|
|
30
|
-
function parseCliArgs(args) {
|
|
31
|
-
let mode = "serve";
|
|
32
|
-
let host = DEFAULT_HOST;
|
|
33
|
-
let port = DEFAULT_PORT;
|
|
34
|
-
let webRoot = null;
|
|
35
|
-
let openBrowser = false;
|
|
36
|
-
let printAccessUrl = false;
|
|
37
|
-
let storeDir = null;
|
|
38
|
-
let index = 0;
|
|
39
|
-
const command = args[0];
|
|
40
|
-
if (command && !command.startsWith("-")) {
|
|
41
|
-
if (command === "serve" || command === "server") mode = "serve";
|
|
42
|
-
else if (command === "app-server") mode = "app-server";
|
|
43
|
-
else if (command === "web") mode = "web";
|
|
44
|
-
else if (command === "help") {
|
|
45
|
-
return { mode, host, port, webRoot, openBrowser, printAccessUrl, storeDir, help: true };
|
|
46
|
-
} else throw new Error(`Unknown command: ${command}`);
|
|
47
|
-
index = 1;
|
|
48
|
-
}
|
|
49
|
-
for (let i = index; i < args.length; i += 1) {
|
|
50
|
-
const arg = args[i];
|
|
51
|
-
if (arg === "--help" || arg === "-h") {
|
|
52
|
-
return { mode, host, port, webRoot, openBrowser, printAccessUrl, storeDir, help: true };
|
|
53
|
-
}
|
|
54
|
-
if (arg === "--listen") {
|
|
55
|
-
const listen = parseListen(requireValue(args, i, arg));
|
|
56
|
-
host = listen.host;
|
|
57
|
-
port = parsePort(String(listen.port), arg);
|
|
58
|
-
i += 1;
|
|
59
|
-
} else if (arg === "--hostname" || arg === "--host") {
|
|
60
|
-
host = requireValue(args, i, arg);
|
|
61
|
-
i += 1;
|
|
62
|
-
} else if (arg === "--port") {
|
|
63
|
-
port = parsePort(requireValue(args, i, arg), arg);
|
|
64
|
-
i += 1;
|
|
65
|
-
} else if (arg === "--web-root") {
|
|
66
|
-
webRoot = path.resolve(requireValue(args, i, arg));
|
|
67
|
-
i += 1;
|
|
68
|
-
} else if (arg === "--store-dir") {
|
|
69
|
-
storeDir = path.resolve(requireValue(args, i, arg));
|
|
70
|
-
i += 1;
|
|
71
|
-
} else if (arg === "--open-browser") {
|
|
72
|
-
openBrowser = true;
|
|
73
|
-
} else if (arg === "--print-access-url") {
|
|
74
|
-
printAccessUrl = true;
|
|
75
|
-
} else {
|
|
76
|
-
throw new Error(`Unknown option: ${arg}`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
if (openBrowser && printAccessUrl) {
|
|
80
|
-
throw new Error("--open-browser and --print-access-url cannot be used together.");
|
|
81
|
-
}
|
|
82
|
-
if (mode !== "web" && (openBrowser || printAccessUrl)) {
|
|
83
|
-
throw new Error("Browser options are only available in web mode.");
|
|
84
|
-
}
|
|
85
|
-
return { mode, host, port, webRoot, openBrowser, printAccessUrl, storeDir, help: false };
|
|
86
|
-
}
|
|
87
|
-
function defaultWebRootCandidates() {
|
|
88
|
-
return [
|
|
89
|
-
process.env.OPENPOND_WEB_ROOT,
|
|
90
|
-
path.resolve(process.cwd(), "apps/web/dist"),
|
|
91
|
-
path.resolve(__dirname, "../../web/dist"),
|
|
92
|
-
path.resolve(process.cwd(), "web"),
|
|
93
|
-
path.resolve(__dirname, "../web")
|
|
94
|
-
].filter((candidate) => Boolean(candidate));
|
|
95
|
-
}
|
|
96
|
-
function resolveWebRoot(explicitWebRoot) {
|
|
97
|
-
const candidates = explicitWebRoot ? [explicitWebRoot] : defaultWebRootCandidates();
|
|
98
|
-
for (const candidate of candidates) {
|
|
99
|
-
const resolved = path.resolve(candidate);
|
|
100
|
-
if (existsSync(path.join(resolved, "index.html"))) return resolved;
|
|
101
|
-
}
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
function formatHostForUrl(host) {
|
|
105
|
-
const browserHost = host === "0.0.0.0" || host === "::" ? "127.0.0.1" : host;
|
|
106
|
-
return browserHost.includes(":") && !browserHost.startsWith("[") ? `[${browserHost}]` : browserHost;
|
|
107
|
-
}
|
|
108
|
-
function browserBaseUrl(instance) {
|
|
109
|
-
return `http://${formatHostForUrl(instance.status.host)}:${instance.status.port}`;
|
|
110
|
-
}
|
|
111
|
-
function tokenizedWebUrl(baseUrl, token) {
|
|
112
|
-
const url = new URL(baseUrl);
|
|
113
|
-
const params = new URLSearchParams();
|
|
114
|
-
params.set("openpondServerUrl", baseUrl);
|
|
115
|
-
params.set("openpondToken", token);
|
|
116
|
-
url.hash = params.toString();
|
|
117
|
-
return url.toString();
|
|
118
|
-
}
|
|
119
|
-
async function resolveWebLaunchMessages(input, handOffToBrowser = openUrlWithSystemBrowser) {
|
|
120
|
-
const accessUrl = tokenizedWebUrl(input.baseUrl, input.token);
|
|
121
|
-
if (input.printAccessUrl) {
|
|
122
|
-
return { stdout: [`OpenPond access URL: ${accessUrl}`], stderr: [] };
|
|
123
|
-
}
|
|
124
|
-
if (!input.openBrowser) {
|
|
125
|
-
return { stdout: [`OpenPond web UI: ${input.baseUrl}`], stderr: [] };
|
|
126
|
-
}
|
|
127
|
-
const handoff = await handOffToBrowser(accessUrl);
|
|
128
|
-
if (handoff.opened) {
|
|
129
|
-
return { stdout: [`Opened OpenPond in your browser: ${input.baseUrl}`], stderr: [] };
|
|
130
|
-
}
|
|
131
|
-
return {
|
|
132
|
-
stdout: [`OpenPond access URL: ${accessUrl}`],
|
|
133
|
-
stderr: [`Could not open the system browser: ${handoff.error}`]
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
function printHelp() {
|
|
137
|
-
console.log(`Usage:
|
|
138
|
-
openpond-app-server serve [--hostname HOST] [--port PORT]
|
|
139
|
-
openpond-app-server app-server [--store-dir DIR]
|
|
140
|
-
openpond-app-server web [--hostname HOST] [--port PORT] [--web-root DIR]
|
|
141
|
-
|
|
142
|
-
Options:
|
|
143
|
-
--listen HOST:PORT Set host and port together
|
|
144
|
-
--hostname HOST Bind host (default ${DEFAULT_HOST})
|
|
145
|
-
--port PORT Bind port, or 0 for any free port (default ${DEFAULT_PORT})
|
|
146
|
-
--web-root DIR Directory containing the built web UI for web mode
|
|
147
|
-
--store-dir DIR Local app-server state directory
|
|
148
|
-
--open-browser Open the authenticated web URL in the system browser
|
|
149
|
-
--print-access-url Print the authenticated URL instead of opening it
|
|
150
|
-
`);
|
|
151
|
-
}
|
|
152
|
-
async function runOpenPondServerCli(factories) {
|
|
153
|
-
const args = parseCliArgs(process.argv.slice(2));
|
|
154
|
-
if (args.help) {
|
|
155
|
-
printHelp();
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
const webRoot = args.mode === "web" ? resolveWebRoot(args.webRoot) : null;
|
|
159
|
-
if (args.mode === "web" && !webRoot) {
|
|
160
|
-
throw new Error("Could not find a built OpenPond web UI. Run `pnpm build:web` or pass --web-root.");
|
|
161
|
-
}
|
|
162
|
-
if (args.mode === "app-server") {
|
|
163
|
-
await runAgentServer(factories.createOpenPondAppServer, args.storeDir);
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
const instance = await factories.createOpenPondServer({
|
|
167
|
-
host: args.host,
|
|
168
|
-
port: args.port,
|
|
169
|
-
webRoot,
|
|
170
|
-
...args.storeDir ? { storeDir: args.storeDir } : {},
|
|
171
|
-
httpEnabled: true
|
|
172
|
-
});
|
|
173
|
-
const webBaseUrl = args.mode === "web" ? browserBaseUrl(instance) : null;
|
|
174
|
-
console.log(
|
|
175
|
-
`OPENPOND_APP_SERVER_READY ${JSON.stringify({
|
|
176
|
-
mode: args.mode,
|
|
177
|
-
url: instance.url,
|
|
178
|
-
webUrl: null,
|
|
179
|
-
webRoot,
|
|
180
|
-
tokenFile: instance.tokenFile,
|
|
181
|
-
storePath: instance.storePath,
|
|
182
|
-
runtime: getBundledRuntimeVersion()
|
|
183
|
-
})}`
|
|
184
|
-
);
|
|
185
|
-
if (webBaseUrl) {
|
|
186
|
-
const messages = await resolveWebLaunchMessages({
|
|
187
|
-
baseUrl: webBaseUrl,
|
|
188
|
-
openBrowser: args.openBrowser,
|
|
189
|
-
printAccessUrl: args.printAccessUrl,
|
|
190
|
-
token: instance.token
|
|
191
|
-
});
|
|
192
|
-
for (const message of messages.stderr) console.error(message);
|
|
193
|
-
for (const message of messages.stdout) console.log(message);
|
|
194
|
-
} else {
|
|
195
|
-
console.log(`OpenPond API server: ${instance.url}`);
|
|
196
|
-
}
|
|
197
|
-
let shuttingDown = false;
|
|
198
|
-
const shutdown = async () => {
|
|
199
|
-
if (shuttingDown) return;
|
|
200
|
-
shuttingDown = true;
|
|
201
|
-
await instance.close();
|
|
202
|
-
process.exit(0);
|
|
203
|
-
};
|
|
204
|
-
process.on("SIGINT", () => void shutdown());
|
|
205
|
-
process.on("SIGTERM", () => void shutdown());
|
|
206
|
-
await new Promise(() => {
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
async function runOpenPondAppServerCli(createOpenPondAppServer) {
|
|
210
|
-
const rawArgs = process.argv.slice(2);
|
|
211
|
-
const args = parseCliArgs(
|
|
212
|
-
!rawArgs[0] || rawArgs[0].startsWith("-") ? ["app-server", ...rawArgs] : rawArgs
|
|
213
|
-
);
|
|
214
|
-
if (args.help) {
|
|
215
|
-
printHelp();
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
if (args.mode !== "app-server") {
|
|
219
|
-
throw new Error("The app-server entrypoint only accepts the app-server command.");
|
|
220
|
-
}
|
|
221
|
-
await runAgentServer(createOpenPondAppServer, args.storeDir);
|
|
222
|
-
}
|
|
223
|
-
async function runAgentServer(createOpenPondAppServer, storeDir) {
|
|
224
|
-
const appServer = await createOpenPondAppServer({
|
|
225
|
-
...storeDir ? { storeDir } : {}
|
|
226
|
-
});
|
|
227
|
-
await runAppServerJsonl({
|
|
228
|
-
appServer,
|
|
229
|
-
readable: process.stdin,
|
|
230
|
-
writable: process.stdout
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export {
|
|
235
|
-
resolveWebLaunchMessages,
|
|
236
|
-
runOpenPondServerCli,
|
|
237
|
-
runOpenPondAppServerCli
|
|
238
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
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
|
-
export {
|
|
81
|
-
parseJsonOption,
|
|
82
|
-
parseJsonObjectOption,
|
|
83
|
-
optionString,
|
|
84
|
-
requiredTeamId,
|
|
85
|
-
optionalJsonObject,
|
|
86
|
-
parseBooleanOption,
|
|
87
|
-
parseNumberOption,
|
|
88
|
-
parseIntegerOption,
|
|
89
|
-
parseCsvOption,
|
|
90
|
-
parseTimeOption,
|
|
91
|
-
resolveTemplateEnvironment
|
|
92
|
-
};
|