openpond 0.0.38 → 0.0.39
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 +3 -4
- package/dist/api/core.d.ts +6 -0
- package/dist/api/vercel-protection.d.ts +1 -0
- package/dist/chunks/{app-layer-DPUJRNO2.js → app-layer-LTBWNA2F.js} +32 -10
- package/dist/chunks/app-server-runtime-VYYJ2AWX.js +18 -0
- package/dist/chunks/{apps-AKBI6AS7.js → apps-CZAJBGE3.js} +6 -4
- package/dist/chunks/{chunk-LZZM3IHS.js → chunk-2SF6HLT7.js} +5899 -5939
- package/dist/chunks/{chunk-XCATKTK3.js → chunk-3CDPPVLE.js} +108 -66
- package/dist/chunks/{chunk-JWF37O5E.js → chunk-3HW6OSHP.js} +1 -3
- package/dist/chunks/{chunk-43YI36NA.js → chunk-3KLQ52B2.js} +228 -5
- package/dist/chunks/chunk-4HIWFIMN.js +37172 -0
- package/dist/chunks/{chunk-AHPQTEIJ.js → chunk-4N6E3OVF.js} +4 -4
- package/dist/chunks/{chunk-YTJL6XPU.js → chunk-6V7MJVRO.js} +56 -11
- package/dist/chunks/{chunk-QRM7XMAO.js → chunk-BQQZNGI6.js} +152 -161
- package/dist/chunks/chunk-DBHSOTYZ.js +1552 -0
- package/dist/chunks/{chunk-275WCETC.js → chunk-FCVVOMIP.js} +145 -5
- package/dist/chunks/{chunk-GB6VUZUA.js → chunk-JIEUB6OS.js} +1 -1
- package/dist/chunks/{chunk-HS2AGRDV.js → chunk-JJPAMKXZ.js} +1 -1
- package/dist/chunks/{chunk-GDZYDLEL.js → chunk-JRROTGQT.js} +1 -110
- package/dist/chunks/chunk-KHNHUA2H.js +1737 -0
- package/dist/chunks/{chunk-AHNFNWUN.js → chunk-L6XH4ZGZ.js} +1 -1
- package/dist/chunks/chunk-M2NXTLH2.js +4054 -0
- package/dist/chunks/{chunk-SLMP353Q.js → chunk-MIZHCABO.js} +2 -195
- package/dist/chunks/chunk-SMNFI2FU.js +113 -0
- package/dist/chunks/chunk-VCVQLECH.js +675 -0
- package/dist/chunks/{chunk-V35STJF4.js → chunk-ZJBJQCQZ.js} +179 -52
- package/dist/chunks/{cli-7BKDWFNU.js → cli-JS76LCW2.js} +9 -5
- package/dist/chunks/{core-commands-YN4RMWA3.js → core-commands-4MRJQZJV.js} +7 -5
- package/dist/chunks/{harness-BHQRMXJR.js → desktop-test-RNMWLOVU.js} +15 -14
- package/dist/chunks/{chunk-XERQHYBO.js → extension-GDRW22N3.js} +5868 -3580
- package/dist/chunks/{help-VREQNA4I.js → help-LWNREJ7U.js} +1 -1
- package/dist/chunks/{opchat-D63YTNSX.js → opchat-2K2JIGK3.js} +9 -10
- package/dist/chunks/{organizations-I46KG7TC.js → organizations-Z5HVD2E7.js} +11 -9
- package/dist/chunks/{profile-WKZJHEPG.js → profile-QNECVVGN.js} +12 -38
- package/dist/chunks/{project-agent-ZUC3YMCT.js → project-agent-W3V75WBR.js} +9 -411
- package/dist/chunks/{sandbox-command-AAOPFTI5.js → sandbox-command-X3FO74NX.js} +7 -5
- package/dist/chunks/{sandbox-template-GKNVR4C5.js → sandbox-template-5B4T4BGU.js} +8 -6
- package/dist/chunks/{src-RPW5TOPI.js → src-ESAILPUH.js} +32 -30
- package/dist/chunks/src-IC5RX4L6.js +63517 -0
- package/dist/chunks/{teams-bot-PSL3ZO6Z.js → teams-bot-NTQ6VFFL.js} +6 -4
- package/dist/chunks/training-BR5A7SPU.js +320 -0
- package/dist/chunks/{workspaces-BPXC2DHT.js → workspaces-XC3QBD2Y.js} +2 -2
- package/dist/cli.js +24 -12
- package/dist/config.d.ts +9 -3
- package/dist/index.js +1300 -1045
- package/dist/profile/local-profile-types.d.ts +16 -0
- package/dist/profile/local-profile.d.ts +50 -4
- package/dist/sandbox/client-handles.d.ts +33 -46
- package/dist/sandbox/client.d.ts +4 -26
- package/dist/sandbox/sandbox-instance-client.d.ts +5 -5
- package/dist/sandbox/types/client.d.ts +1 -2
- package/dist/sandbox/types/core.d.ts +0 -1
- package/dist/sandbox/types/org-project-agent.d.ts +3 -89
- package/dist/sandbox/types/record.d.ts +1 -2
- package/dist/sandbox/types/runtime-profiles.d.ts +2 -2
- package/dist/sandbox-template/manifest.d.ts +1 -1
- package/dist/skills/openpond-agent-authoring/SKILL.md +40 -0
- package/dist/skills/openpond-agent-authoring/references/action-and-chat-design.md +13 -0
- package/dist/skills/openpond-agent-authoring/references/integrations-and-setup.md +13 -0
- package/dist/skills/openpond-agent-authoring/references/profile-layout.md +29 -0
- package/dist/skills/openpond-agent-authoring/references/validation-and-repair.md +14 -0
- package/dist/skills/openpond-desktop-harness/SKILL.md +1 -1
- package/dist/skills/openpond-skill-authoring/SKILL.md +44 -0
- package/dist/skills/openpond-skill-authoring/references/copying-and-adaptation.md +16 -0
- package/dist/skills/openpond-skill-authoring/references/skill-package-layout.md +38 -0
- package/dist/skills/openpond-skill-authoring/references/validation-and-repair.md +24 -0
- package/dist/skills/openpond-skill-authoring/scripts/validate-skill.mjs +102 -0
- package/dist/skills/openpond-taskset-authoring/SKILL.md +64 -22
- package/dist/skills/openpond-taskset-authoring/artifact.json +39 -0
- package/dist/skills/openpond-taskset-authoring/references/graders-and-rewards.md +3 -0
- package/dist/skills/openpond-taskset-authoring/references/method-selection.md +1 -1
- package/dist/skills/openpond-taskset-authoring/references/privacy-and-provenance.md +2 -0
- package/dist/skills/openpond-taskset-authoring/references/task-design.md +32 -0
- package/dist/web/assets/{AppDialog-DrwJb_wG.js → AppDialog-Bua3f-6v.js} +1 -1
- package/dist/web/assets/{AppsView-DPagLMsc.js → AppsView-DrJkHeSO.js} +1 -1
- package/dist/web/assets/BrowserSidebar-Bf-4Vozm.js +1 -0
- package/dist/web/assets/CommandMenu-DDZlGQiB.js +1 -0
- package/dist/web/assets/CommunityView-BtcCrba7.js +1 -0
- package/dist/web/assets/ComposerCreateImproveStrip-DOe5Otg6.js +1 -0
- package/dist/web/assets/GetStartedView-CG4z0Dtw.js +1 -0
- package/dist/web/assets/GetStartedView-yVmnGZPw.css +1 -0
- package/dist/web/assets/LabModelVersionDetailPage-BEkmSKuv.js +1 -0
- package/dist/web/assets/LabSkillSidebar-BIotN_RB.js +1 -0
- package/dist/web/assets/LabsRoute-CfOe0Zt5.js +3 -0
- package/dist/web/assets/LabsRoute-CoSPO4HR.css +1 -0
- package/dist/web/assets/MainChatThread-C0-l1mHt.js +2 -0
- package/dist/web/assets/MainPane-Bky_Rqcx.css +1 -0
- package/dist/web/assets/MainPane-aOVlVyRK.js +6 -0
- package/dist/web/assets/MarkdownText-D7DT1k1k.js +9 -0
- package/dist/web/assets/Messages-CBIXruA9.js +9 -0
- package/dist/web/assets/NativeSkillSidebar-C4t69Y7B.js +1 -0
- package/dist/web/assets/NewProjectDialog-Bat65tYD.js +1 -0
- package/dist/web/assets/OutputsPage-C58n39Db.js +1 -0
- package/dist/web/assets/RightChatPanelStack-Bp7nZxQ0.js +1 -0
- package/dist/web/assets/ScheduledWorkPage-BXP0j_c_.js +1 -0
- package/dist/web/assets/SettingsView-CtWK_aQ0.css +1 -0
- package/dist/web/assets/SettingsView-DOOfhO9a.js +6 -0
- package/dist/web/assets/TeamChatView-Cgxm-pKA.css +1 -0
- package/dist/web/assets/TeamChatView-De2wdqyY.js +3 -0
- package/dist/web/assets/{TerminalOverlay-BKl0p8pa.js → TerminalOverlay-BsuCH3NX.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-D2OFWyQ-.js +1 -0
- package/dist/web/assets/TrainingDraftPanel-DBpulXTz.js +1 -0
- package/dist/web/assets/{UsageSettingsSection-zDAwzTGl.js → UsageSettingsSection-DzMLUXAO.js} +37 -37
- package/dist/web/assets/WorkspaceDiffPanel-B7yIhjNF.js +14 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-B6jXM9xG.js +32 -0
- package/dist/web/assets/WorkspaceGitDialogs-CQ0fl9Qk.js +1 -0
- package/dist/web/assets/{WorkspaceMonacoEditor-DPGcG8fy.js → WorkspaceMonacoEditor-C2ctzITz.js} +3 -3
- package/dist/web/assets/arrow-up-right-ecwcx3xt.js +1 -0
- package/dist/web/assets/chevron-up-DP8PPfWd.js +1 -0
- package/dist/web/assets/circle-alert-envg1D6O.js +1 -0
- package/dist/web/assets/cloud-upload-5MGPLnaA.js +1 -0
- package/dist/web/assets/{cssMode-CKN9CcfG.js → cssMode-CFifcEfw.js} +1 -1
- package/dist/web/assets/folder-open-Dq3ZjeEP.js +1 -0
- package/dist/web/assets/folder-plus-EiZ5wbv_.js +1 -0
- package/dist/web/assets/git-branch-w29jmQ-X.js +1 -0
- package/dist/web/assets/{git-commit-horizontal-Bxi8YPep.js → git-commit-horizontal-CGZM0PZo.js} +1 -1
- package/dist/web/assets/{htmlMode-CeUcNhBZ.js → htmlMode-Ct1P-_lf.js} +1 -1
- package/dist/web/assets/index-ByIQyiUl.js +178 -0
- package/dist/web/assets/index-D4uCeiep.js +1 -0
- package/dist/web/assets/index-D9jTe16Q.css +1 -0
- package/dist/web/assets/info-Cd2HkIeb.js +1 -0
- package/dist/web/assets/{jsonMode-97z0Yz9u.js → jsonMode-BAUNCNAX.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-D4Tp-JmI.js → lspLanguageFeatures-fucFYI1A.js} +1 -1
- package/dist/web/assets/monaco.contribution-Ce4v5kei.js +2 -0
- package/dist/web/assets/monaco.contribution-DLLMi4cB.js +2 -0
- package/dist/web/assets/monaco.contribution-g9QiIm1d.js +2 -0
- package/dist/web/assets/monaco.contribution-nG-5Cyjz.js +2 -0
- package/dist/web/assets/monitor-DgHCnCKl.js +1 -0
- package/dist/web/assets/{play-C-37dnR1.js → play-Be0XDHBu.js} +1 -1
- package/dist/web/assets/{python-CGpDXY7_.js → python-CEhEiPo7.js} +1 -1
- package/dist/web/assets/{refresh-cw-BAaaPCXl.js → refresh-cw-DH0KLbdD.js} +1 -1
- package/dist/web/assets/reply-D1TK2yV8.js +1 -0
- package/dist/web/assets/{save-Cvxs3XyC.js → save-C1MSeBnQ.js} +1 -1
- package/dist/web/assets/square-CemI-0g5.js +1 -0
- package/dist/web/assets/square-pen-CqfsvR_n.js +1 -0
- package/dist/web/assets/{toggleHighContrast-CD42jH4g.js → toggleHighContrast-DrdQN3Rl.js} +1 -1
- package/dist/web/assets/training-BQVNUTZA.css +1 -0
- package/dist/web/assets/training-model-data-B7-1Bxil.js +1 -0
- package/dist/web/assets/{tsMode-ZROIxEjv.js → tsMode-CKB5oOUU.js} +1 -1
- package/dist/web/assets/{upload-DvCSGERK.js → upload-t751LLqP.js} +1 -1
- package/dist/web/assets/useLocalAgentSchedules-CzC3wfIP.js +1 -0
- package/dist/web/assets/{wifi-off-BIb94PkS.js → wifi-off-CxTHH3JU.js} +1 -1
- package/dist/web/assets/{workers-oYqbrVYG.js → workers-CqYddzCd.js} +1 -1
- package/dist/web/assets/{yaml-WqBjNgOO.js → yaml-e5wBkc-C.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +75 -40
- package/package.json +3 -1
- package/dist/chunks/chunk-FWLOFUPU.js +0 -864
- package/dist/chunks/chunk-HLCTINEP.js +0 -224
- package/dist/chunks/chunk-MPGSHXGF.js +0 -3896
- package/dist/chunks/chunk-T4QXKU5Y.js +0 -1
- package/dist/chunks/chunk-XEJ7XXUQ.js +0 -1301
- package/dist/chunks/chunk-ZI4GDAUB.js +0 -3522
- package/dist/chunks/cli-2KBVNDRY.js +0 -23
- package/dist/chunks/extend-REGNTBK3.js +0 -89
- package/dist/chunks/extension-7K77DAVL.js +0 -121
- package/dist/chunks/fileFromPath-DHCRY3BD.js +0 -2151
- package/dist/chunks/src-MWDIK56B.js +0 -105881
- package/dist/web/assets/BrowserSidebar-DMn2V8RV.js +0 -1
- package/dist/web/assets/CloudWorkView-Cl_7mM3c.js +0 -1
- package/dist/web/assets/CloudWorkView-DNoPIlMj.css +0 -1
- package/dist/web/assets/CommandMenu-CHMQLez_.js +0 -1
- package/dist/web/assets/CommunityView-DcHVDUk0.js +0 -1
- package/dist/web/assets/ComposerCreateImproveStrip-BZ3Dgzmo.js +0 -1
- package/dist/web/assets/GetStartedView-DBLdduwr.css +0 -1
- package/dist/web/assets/GetStartedView-DTRotFqz.js +0 -1
- package/dist/web/assets/LabSkillSidebar-D-PqFe1T.js +0 -1
- package/dist/web/assets/LabsRoute-BrJkBNig.css +0 -1
- package/dist/web/assets/LabsRoute-Dew1BwK5.js +0 -3
- package/dist/web/assets/MainChatThread-BaPxxzrw.js +0 -2
- package/dist/web/assets/MakeAgentTutorialLearningPanel-CBsfnONQ.js +0 -2
- package/dist/web/assets/MarkdownText-DGLfAM_Z.js +0 -7
- package/dist/web/assets/Messages-CIX9uTjX.js +0 -10
- package/dist/web/assets/NativeSkillSidebar-AP_uHn6g.js +0 -1
- package/dist/web/assets/NewProjectDialog-C6lHkafU.js +0 -1
- package/dist/web/assets/PostTrainingLearningPanel-CZEgPc8O.js +0 -2
- package/dist/web/assets/PostTrainingStatusPill-CeEpwUDB.js +0 -1
- package/dist/web/assets/ProfileSettingsSection-Cg4tKO-C.css +0 -1
- package/dist/web/assets/ProfileSettingsSection-EumMLlEp.js +0 -1
- package/dist/web/assets/RightChatPanelStack-MXBcx3zO.js +0 -1
- package/dist/web/assets/SettingsView-Caljbns2.css +0 -1
- package/dist/web/assets/SettingsView-DyURG_Uh.js +0 -6
- package/dist/web/assets/TeamChatView-Bx44q3WV.css +0 -1
- package/dist/web/assets/TeamChatView-D3v6aqJ3.js +0 -3
- package/dist/web/assets/TrainingCreationPanel-CfZQTuT5.js +0 -1
- package/dist/web/assets/TrainingDraftPanel-DslRPSDW.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-C_MZPPlL.js +0 -14
- package/dist/web/assets/WorkspaceEnvironmentMenu-BUAnn80j.js +0 -32
- package/dist/web/assets/WorkspaceGitDialogs-Drbf4ujA.js +0 -1
- package/dist/web/assets/activity-Dnr3jqb3.js +0 -1
- package/dist/web/assets/boxes-BinC8UPn.js +0 -1
- package/dist/web/assets/chevron-up-Bjp_-_Cb.js +0 -1
- package/dist/web/assets/circle-x-ubnvEYuE.js +0 -1
- package/dist/web/assets/copy-B_ZCCUMz.js +0 -1
- package/dist/web/assets/create-pipeline-request-D6uLUxe9.js +0 -4
- package/dist/web/assets/file-8HAMlTmQ.js +0 -1
- package/dist/web/assets/git-branch-l2Zih3Bv.js +0 -1
- package/dist/web/assets/index-BMFyOFRU.css +0 -1
- package/dist/web/assets/index-BzwcDzbT.js +0 -1
- package/dist/web/assets/index-KoQSSt_f.js +0 -177
- package/dist/web/assets/info-JTbDQxHx.js +0 -1
- package/dist/web/assets/make-agent-tutorial-D6nBCgv-.js +0 -2
- package/dist/web/assets/monaco.contribution-B3j6oown.js +0 -2
- package/dist/web/assets/monaco.contribution-BXHxPPWL.js +0 -2
- package/dist/web/assets/monaco.contribution-C2P5zIzh.js +0 -2
- package/dist/web/assets/monaco.contribution-C8c6OtGi.js +0 -2
- package/dist/web/assets/monitor-kzHtxHnA.js +0 -1
- package/dist/web/assets/reply-9rehU13k.js +0 -1
- package/dist/web/assets/rotate-cw-C1Z_Xs23.js +0 -1
- package/dist/web/assets/training-BN8CALIc.css +0 -1
- package/dist/web/assets/training-model-data-BXUCzS0p.js +0 -1
- package/docs/agent-edit-check-status-json.md +0 -132
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
resolveSandboxClient
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-FCVVOMIP.js";
|
|
5
|
+
import "./chunk-KHNHUA2H.js";
|
|
6
|
+
import "./chunk-JRROTGQT.js";
|
|
7
|
+
import "./chunk-SMNFI2FU.js";
|
|
8
|
+
import "./chunk-3CDPPVLE.js";
|
|
9
|
+
import "./chunk-DBHSOTYZ.js";
|
|
8
10
|
import "./chunk-KSRWKXRB.js";
|
|
9
11
|
import {
|
|
10
12
|
optionString,
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
resolveApiBaseUrlOption
|
|
4
|
+
} from "./chunk-SMNFI2FU.js";
|
|
5
|
+
import "./chunk-KSRWKXRB.js";
|
|
6
|
+
import {
|
|
7
|
+
optionString,
|
|
8
|
+
parseBooleanOption,
|
|
9
|
+
parseIntegerOption,
|
|
10
|
+
parseNumberOption
|
|
11
|
+
} from "./chunk-MUMPWI4O.js";
|
|
12
|
+
import "./chunk-UACZUFIA.js";
|
|
13
|
+
|
|
14
|
+
// src/cli/training.ts
|
|
15
|
+
import { readFile } from "node:fs/promises";
|
|
16
|
+
import { request as requestHttp } from "node:http";
|
|
17
|
+
import os from "node:os";
|
|
18
|
+
import path from "node:path";
|
|
19
|
+
import { createInterface } from "node:readline/promises";
|
|
20
|
+
var DEFAULT_LOCAL_TRAINING_API_URL = "http://127.0.0.1:17874";
|
|
21
|
+
var TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
22
|
+
"cancelled",
|
|
23
|
+
"completed",
|
|
24
|
+
"failed",
|
|
25
|
+
"succeeded"
|
|
26
|
+
]);
|
|
27
|
+
async function runTrainingCommand(options, rest, dependencies = {}) {
|
|
28
|
+
const subcommand = rest[0];
|
|
29
|
+
const id = rest[1];
|
|
30
|
+
if (!subcommand || ![
|
|
31
|
+
"start",
|
|
32
|
+
"status",
|
|
33
|
+
"watch",
|
|
34
|
+
"logs",
|
|
35
|
+
"cancel",
|
|
36
|
+
"artifacts"
|
|
37
|
+
].includes(
|
|
38
|
+
subcommand
|
|
39
|
+
) || !id) {
|
|
40
|
+
throw new Error(
|
|
41
|
+
"usage: training <start|status|watch|logs|cancel|artifacts> <model-run-id|run-id>"
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
if (rest.length > 2) {
|
|
45
|
+
throw new Error(`training ${subcommand} accepts exactly one identifier`);
|
|
46
|
+
}
|
|
47
|
+
const baseUrl = resolveApiBaseUrlOption(options) ?? process.env.OPENPOND_LOCAL_API_URL?.replace(/\/$/, "") ?? DEFAULT_LOCAL_TRAINING_API_URL;
|
|
48
|
+
const client = new TrainingApiClient({
|
|
49
|
+
baseUrl,
|
|
50
|
+
request: dependencies.request ?? await createLocalAuthenticatedRequest(baseUrl)
|
|
51
|
+
});
|
|
52
|
+
const json = parseBooleanOption(options.json);
|
|
53
|
+
if (subcommand === "start") {
|
|
54
|
+
await startTraining({
|
|
55
|
+
client,
|
|
56
|
+
dependencies,
|
|
57
|
+
json,
|
|
58
|
+
modelRunId: id,
|
|
59
|
+
options
|
|
60
|
+
});
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (subcommand === "watch") {
|
|
64
|
+
await watchTraining({
|
|
65
|
+
client,
|
|
66
|
+
runId: id,
|
|
67
|
+
json,
|
|
68
|
+
intervalMs: parseIntegerOption(options.intervalMs, "interval-ms") ?? 2e3,
|
|
69
|
+
sleep: dependencies.sleep
|
|
70
|
+
});
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const endpoint = subcommand === "status" ? "status" : subcommand === "logs" ? "logs" : subcommand === "artifacts" ? "artifacts" : "cancel";
|
|
74
|
+
const result = await client.modelRun(
|
|
75
|
+
id,
|
|
76
|
+
endpoint,
|
|
77
|
+
subcommand === "cancel" ? "POST" : "GET"
|
|
78
|
+
);
|
|
79
|
+
printResult(result, json);
|
|
80
|
+
}
|
|
81
|
+
async function createLocalAuthenticatedRequest(baseUrl) {
|
|
82
|
+
const url = new URL(baseUrl);
|
|
83
|
+
if (url.protocol !== "http:" || !["127.0.0.1", "localhost", "::1"].includes(url.hostname)) {
|
|
84
|
+
return fetch;
|
|
85
|
+
}
|
|
86
|
+
const appHome = process.env.OPENPOND_APP_HOME?.trim() || path.join(os.homedir(), ".openpond", "openpond-app");
|
|
87
|
+
const token = (await readFile(path.join(appHome, "token"), "utf8")).trim();
|
|
88
|
+
if (!token) {
|
|
89
|
+
throw new Error("OpenPond local capability token is empty.");
|
|
90
|
+
}
|
|
91
|
+
return (async (resource, init = {}) => {
|
|
92
|
+
const target = resource instanceof Request ? new URL(resource.url) : new URL(String(resource));
|
|
93
|
+
const headers = new Headers(init.headers);
|
|
94
|
+
headers.set("authorization", `Bearer ${token}`);
|
|
95
|
+
const nodeHeaders = {};
|
|
96
|
+
headers.forEach((value, name) => {
|
|
97
|
+
nodeHeaders[name] = value;
|
|
98
|
+
});
|
|
99
|
+
return new Promise((resolve, reject) => {
|
|
100
|
+
let settled = false;
|
|
101
|
+
const request = requestHttp(
|
|
102
|
+
target,
|
|
103
|
+
{
|
|
104
|
+
method: init.method ?? "GET",
|
|
105
|
+
headers: nodeHeaders
|
|
106
|
+
},
|
|
107
|
+
(response) => {
|
|
108
|
+
const chunks = [];
|
|
109
|
+
response.on("data", (chunk) => chunks.push(chunk));
|
|
110
|
+
response.once("error", rejectOnce);
|
|
111
|
+
response.once("end", () => {
|
|
112
|
+
if (settled) return;
|
|
113
|
+
settled = true;
|
|
114
|
+
const responseHeaders = new Headers();
|
|
115
|
+
for (const [name, value] of Object.entries(response.headers)) {
|
|
116
|
+
if (Array.isArray(value)) {
|
|
117
|
+
for (const item of value) responseHeaders.append(name, item);
|
|
118
|
+
} else if (value !== void 0) {
|
|
119
|
+
responseHeaders.set(name, value);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
resolve(
|
|
123
|
+
new Response(new Uint8Array(Buffer.concat(chunks)), {
|
|
124
|
+
status: response.statusCode ?? 500,
|
|
125
|
+
statusText: response.statusMessage,
|
|
126
|
+
headers: responseHeaders
|
|
127
|
+
})
|
|
128
|
+
);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
const rejectOnce = (error) => {
|
|
133
|
+
if (settled) return;
|
|
134
|
+
settled = true;
|
|
135
|
+
reject(error);
|
|
136
|
+
};
|
|
137
|
+
request.once("error", rejectOnce);
|
|
138
|
+
if (init.signal) {
|
|
139
|
+
const abort = () => request.destroy(
|
|
140
|
+
init.signal?.reason instanceof Error ? init.signal.reason : new Error("Training API request aborted.")
|
|
141
|
+
);
|
|
142
|
+
if (init.signal.aborted) abort();
|
|
143
|
+
else init.signal.addEventListener("abort", abort, { once: true });
|
|
144
|
+
}
|
|
145
|
+
if (init.body !== void 0 && init.body !== null) {
|
|
146
|
+
if (typeof init.body !== "string" && !(init.body instanceof Uint8Array)) {
|
|
147
|
+
request.destroy(
|
|
148
|
+
new Error("Local Training API supports string or byte request bodies.")
|
|
149
|
+
);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
request.write(init.body);
|
|
153
|
+
}
|
|
154
|
+
request.end();
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
var TrainingApiClient = class {
|
|
159
|
+
baseUrl;
|
|
160
|
+
request;
|
|
161
|
+
constructor(input) {
|
|
162
|
+
this.baseUrl = input.baseUrl.replace(/\/$/, "");
|
|
163
|
+
this.request = input.request ?? fetch;
|
|
164
|
+
}
|
|
165
|
+
modelRun(id, action, method, body) {
|
|
166
|
+
return this.json(
|
|
167
|
+
`/v1/training/model-runs/${encodeURIComponent(id)}/${action}`,
|
|
168
|
+
method,
|
|
169
|
+
body
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
async json(pathname, method, body) {
|
|
173
|
+
const response = await this.request(`${this.baseUrl}${pathname}`, {
|
|
174
|
+
method,
|
|
175
|
+
headers: body === void 0 ? { Accept: "application/json" } : {
|
|
176
|
+
Accept: "application/json",
|
|
177
|
+
"Content-Type": "application/json"
|
|
178
|
+
},
|
|
179
|
+
body: body === void 0 ? void 0 : JSON.stringify(body)
|
|
180
|
+
});
|
|
181
|
+
const text = await response.text();
|
|
182
|
+
let payload = null;
|
|
183
|
+
if (text) {
|
|
184
|
+
try {
|
|
185
|
+
payload = JSON.parse(text);
|
|
186
|
+
} catch {
|
|
187
|
+
payload = text;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (!response.ok) {
|
|
191
|
+
const message = payload && typeof payload === "object" && "error" in payload && typeof payload.error === "string" ? payload.error : `${response.status} ${response.statusText}`.trim();
|
|
192
|
+
throw new Error(`Training API request failed: ${message}`);
|
|
193
|
+
}
|
|
194
|
+
return payload;
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
async function startTraining(input) {
|
|
198
|
+
const maximumSpendUsd = parseNumberOption(
|
|
199
|
+
input.options.maxSpend,
|
|
200
|
+
"max-spend"
|
|
201
|
+
) ?? null;
|
|
202
|
+
if (maximumSpendUsd !== null && maximumSpendUsd < 0) {
|
|
203
|
+
throw new Error("max-spend must be non-negative");
|
|
204
|
+
}
|
|
205
|
+
const retentionDays = parseIntegerOption(input.options.retentionDays, "retention-days") ?? null;
|
|
206
|
+
if (retentionDays !== null && retentionDays <= 0) {
|
|
207
|
+
throw new Error("retention-days must be a positive integer");
|
|
208
|
+
}
|
|
209
|
+
const manifestPath = optionString(input.options, "manifest");
|
|
210
|
+
const manifest = manifestPath ? await readManifest(manifestPath) : void 0;
|
|
211
|
+
const controls = { maximumSpendUsd, retentionDays };
|
|
212
|
+
const preparation = await input.client.modelRun(
|
|
213
|
+
input.modelRunId,
|
|
214
|
+
"prepare",
|
|
215
|
+
"POST",
|
|
216
|
+
controls
|
|
217
|
+
);
|
|
218
|
+
if (!input.json) {
|
|
219
|
+
console.log("Preparation:");
|
|
220
|
+
console.log(JSON.stringify(preparation, null, 2));
|
|
221
|
+
}
|
|
222
|
+
const confirmed = parseBooleanOption(input.options.yes) || await confirmStart(input.dependencies.confirm);
|
|
223
|
+
if (!confirmed) {
|
|
224
|
+
throw new Error("Training start cancelled.");
|
|
225
|
+
}
|
|
226
|
+
const result = await input.client.modelRun(
|
|
227
|
+
input.modelRunId,
|
|
228
|
+
"start",
|
|
229
|
+
"POST",
|
|
230
|
+
{ ...controls, manifest }
|
|
231
|
+
);
|
|
232
|
+
printResult(result, input.json);
|
|
233
|
+
if (parseBooleanOption(input.options.detach)) return;
|
|
234
|
+
const runId = readRunId(result) ?? input.modelRunId;
|
|
235
|
+
await watchTraining({
|
|
236
|
+
client: input.client,
|
|
237
|
+
runId,
|
|
238
|
+
json: input.json,
|
|
239
|
+
intervalMs: 2e3,
|
|
240
|
+
sleep: input.dependencies.sleep
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
async function watchTraining(input) {
|
|
244
|
+
if (input.intervalMs < 250) {
|
|
245
|
+
throw new Error("interval-ms must be at least 250");
|
|
246
|
+
}
|
|
247
|
+
const sleep = input.sleep ?? ((milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)));
|
|
248
|
+
let previous = "";
|
|
249
|
+
for (; ; ) {
|
|
250
|
+
const status = await input.client.modelRun(
|
|
251
|
+
input.runId,
|
|
252
|
+
"status",
|
|
253
|
+
"GET"
|
|
254
|
+
);
|
|
255
|
+
const serialized = JSON.stringify(status);
|
|
256
|
+
if (input.json || serialized !== previous) {
|
|
257
|
+
printResult(status, input.json);
|
|
258
|
+
previous = serialized;
|
|
259
|
+
}
|
|
260
|
+
if (TERMINAL_STATUSES.has(readStatus(status))) return;
|
|
261
|
+
await sleep(input.intervalMs);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
async function readManifest(path2) {
|
|
265
|
+
let parsed;
|
|
266
|
+
try {
|
|
267
|
+
parsed = JSON.parse(await readFile(path2, "utf8"));
|
|
268
|
+
} catch (error) {
|
|
269
|
+
throw new Error(
|
|
270
|
+
`Could not read Harness Run Manifest ${path2}: ${error instanceof Error ? error.message : String(error)}`
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
274
|
+
throw new Error("Harness Run Manifest must be a JSON object.");
|
|
275
|
+
}
|
|
276
|
+
return parsed;
|
|
277
|
+
}
|
|
278
|
+
async function confirmStart(injected) {
|
|
279
|
+
const message = "Start this exact prepared training run? Downloads, provisioning, or spend may begin.";
|
|
280
|
+
if (injected) return injected(message);
|
|
281
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
282
|
+
throw new Error(
|
|
283
|
+
"training start requires --yes when standard input is not interactive"
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
const prompt = createInterface({
|
|
287
|
+
input: process.stdin,
|
|
288
|
+
output: process.stdout
|
|
289
|
+
});
|
|
290
|
+
try {
|
|
291
|
+
const answer = await prompt.question(`${message} [y/N] `);
|
|
292
|
+
return answer.trim().toLowerCase() === "y" || answer.trim().toLowerCase() === "yes";
|
|
293
|
+
} finally {
|
|
294
|
+
prompt.close();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
function readRunId(value) {
|
|
298
|
+
if (!value || typeof value !== "object") return null;
|
|
299
|
+
const job = "job" in value ? value.job : null;
|
|
300
|
+
if (!job || typeof job !== "object" || !("id" in job)) return null;
|
|
301
|
+
return typeof job.id === "string" ? job.id : null;
|
|
302
|
+
}
|
|
303
|
+
function readStatus(value) {
|
|
304
|
+
if (!value || typeof value !== "object") return "";
|
|
305
|
+
if ("state" in value && typeof value.state === "string") {
|
|
306
|
+
return value.state;
|
|
307
|
+
}
|
|
308
|
+
return "status" in value && typeof value.status === "string" ? value.status : "";
|
|
309
|
+
}
|
|
310
|
+
function printResult(value, json) {
|
|
311
|
+
if (json) {
|
|
312
|
+
console.log(JSON.stringify(value));
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
console.log(JSON.stringify(value, null, 2));
|
|
316
|
+
}
|
|
317
|
+
export {
|
|
318
|
+
TrainingApiClient,
|
|
319
|
+
runTrainingCommand
|
|
320
|
+
};
|
|
@@ -45,8 +45,8 @@ import {
|
|
|
45
45
|
truncatePatch,
|
|
46
46
|
uniqueSortedPaths,
|
|
47
47
|
workspaceImageContentType
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import "./chunk-
|
|
48
|
+
} from "./chunk-L6XH4ZGZ.js";
|
|
49
|
+
import "./chunk-JJPAMKXZ.js";
|
|
50
50
|
import "./chunk-UACZUFIA.js";
|
|
51
51
|
export {
|
|
52
52
|
MACOS_GIT_MISSING_DEVELOPER_TOOLS_ERROR,
|
package/dist/cli.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
parseArgs
|
|
4
|
+
parseArgs
|
|
5
|
+
} from "./chunks/chunk-JRROTGQT.js";
|
|
6
|
+
import {
|
|
5
7
|
resolveAccountOption,
|
|
6
8
|
resolveBaseUrlOption
|
|
7
|
-
} from "./chunks/chunk-
|
|
9
|
+
} from "./chunks/chunk-SMNFI2FU.js";
|
|
8
10
|
import {
|
|
9
11
|
getInstalledCliVersion,
|
|
10
12
|
runCliCommand
|
|
11
|
-
} from "./chunks/chunk-
|
|
13
|
+
} from "./chunks/chunk-3CDPPVLE.js";
|
|
12
14
|
import "./chunks/chunk-KSRWKXRB.js";
|
|
13
15
|
import {
|
|
14
16
|
parseBooleanOption
|
|
@@ -35,11 +37,11 @@ async function runOpenPondCli(argv = process.argv.slice(2)) {
|
|
|
35
37
|
return;
|
|
36
38
|
}
|
|
37
39
|
if (action === "check-update") {
|
|
38
|
-
await (await import("./chunks/core-commands-
|
|
40
|
+
await (await import("./chunks/core-commands-4MRJQZJV.js")).runCheckUpdate();
|
|
39
41
|
return;
|
|
40
42
|
}
|
|
41
43
|
if (action === "help") {
|
|
42
|
-
(await import("./chunks/help-
|
|
44
|
+
(await import("./chunks/help-LWNREJ7U.js")).printHelp();
|
|
43
45
|
return;
|
|
44
46
|
}
|
|
45
47
|
const selectedAccount = resolveAccountOption(options);
|
|
@@ -51,31 +53,41 @@ async function runOpenPondCli(argv = process.argv.slice(2)) {
|
|
|
51
53
|
process.env.OPENPOND_BASE_URL = selectedBaseUrl;
|
|
52
54
|
}
|
|
53
55
|
if (action === "tui") {
|
|
54
|
-
await (await import("./chunks/app-layer-
|
|
56
|
+
await (await import("./chunks/app-layer-LTBWNA2F.js")).runOpenPondTerminalCommand(options, rest);
|
|
55
57
|
return;
|
|
56
58
|
}
|
|
57
59
|
if (action === "ui") {
|
|
58
|
-
await (await import("./chunks/app-layer-
|
|
60
|
+
await (await import("./chunks/app-layer-LTBWNA2F.js")).runOpenPondServerCommand("web", options, rest);
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
61
63
|
if (await runCliCommand({ command, options, rest })) {
|
|
62
64
|
return;
|
|
63
65
|
}
|
|
64
|
-
(await import("./chunks/help-
|
|
66
|
+
(await import("./chunks/help-LWNREJ7U.js")).printHelp();
|
|
65
67
|
process.exit(1);
|
|
66
68
|
}
|
|
67
69
|
async function runEmbeddedCompanion(argv) {
|
|
70
|
+
if (argv[0] === "__app-server") {
|
|
71
|
+
process.argv = [process.execPath, "openpond-app-server", ...argv.slice(1)];
|
|
72
|
+
const [{ createOpenPondAppServer }, { runOpenPondAppServerCli }] = await Promise.all([
|
|
73
|
+
import("./chunks/app-server-runtime-VYYJ2AWX.js"),
|
|
74
|
+
import("./chunks/cli-JS76LCW2.js")
|
|
75
|
+
]);
|
|
76
|
+
await runOpenPondAppServerCli(createOpenPondAppServer);
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
68
79
|
if (argv[0] === "__server") {
|
|
69
80
|
process.argv = [process.execPath, "openpond-server", ...argv.slice(1)];
|
|
70
81
|
const [{ createOpenPondServer }, { runOpenPondServerCli }] = await Promise.all([
|
|
71
|
-
import("./chunks/src-
|
|
72
|
-
import("./chunks/cli-
|
|
82
|
+
import("./chunks/src-IC5RX4L6.js"),
|
|
83
|
+
import("./chunks/cli-JS76LCW2.js")
|
|
73
84
|
]);
|
|
74
|
-
await
|
|
85
|
+
const { createOpenPondAppServer } = await import("./chunks/app-server-runtime-VYYJ2AWX.js");
|
|
86
|
+
await runOpenPondServerCli({ createOpenPondServer, createOpenPondAppServer });
|
|
75
87
|
return true;
|
|
76
88
|
}
|
|
77
89
|
if (argv[0] === "__terminal") {
|
|
78
|
-
await (await import("./chunks/src-
|
|
90
|
+
await (await import("./chunks/src-ESAILPUH.js")).runOpenPondTerminalCli(argv.slice(1));
|
|
79
91
|
return true;
|
|
80
92
|
}
|
|
81
93
|
return false;
|
package/dist/config.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ export type LocalOpenPondProfileCheckStatus = {
|
|
|
26
26
|
export type LocalOpenPondProfileHostedSourceCheckStatus = {
|
|
27
27
|
status: string;
|
|
28
28
|
agentId?: string | null;
|
|
29
|
-
workItemId?: string | null;
|
|
30
29
|
deployPlanStatus?: string | null;
|
|
31
30
|
canRun?: boolean | null;
|
|
32
31
|
canDeploy?: boolean | null;
|
|
@@ -126,13 +125,20 @@ export type LocalOpenPondProfileConfig = {
|
|
|
126
125
|
mode: "local";
|
|
127
126
|
lastCheck?: LocalOpenPondProfileCheckStatus;
|
|
128
127
|
lastPush?: LocalOpenPondProfilePushStatus;
|
|
128
|
+
profiles?: LocalOpenPondProfileCatalogEntry[];
|
|
129
|
+
};
|
|
130
|
+
export type LocalOpenPondProfileCatalogEntry = {
|
|
131
|
+
source: "local" | "github" | "openpond_git";
|
|
132
|
+
repositoryId: string;
|
|
133
|
+
repoPath: string;
|
|
134
|
+
profile: string;
|
|
135
|
+
lastCheck?: LocalOpenPondProfileCheckStatus;
|
|
136
|
+
lastPush?: LocalOpenPondProfilePushStatus;
|
|
129
137
|
};
|
|
130
|
-
export type LocalGoalStorageLocation = "global" | "workspace";
|
|
131
138
|
export type LocalConfig = {
|
|
132
139
|
accounts?: LocalAccountConfig[];
|
|
133
140
|
activeProfile?: ActiveProfileSelector;
|
|
134
141
|
openpondProfile?: LocalOpenPondProfileConfig;
|
|
135
|
-
goalStorageLocation?: LocalGoalStorageLocation;
|
|
136
142
|
baseUrl?: string;
|
|
137
143
|
apiBaseUrl?: string;
|
|
138
144
|
chatApiBaseUrl?: string;
|