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,1643 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
materializeSourceUploadFile,
|
|
4
|
-
readSourceUploadCache,
|
|
5
|
-
writeSourceUploadCache
|
|
6
|
-
} from "./chunk-J3YDKJFD.js";
|
|
7
|
-
import {
|
|
8
|
-
formatSandboxTemplateDiagnostics,
|
|
9
|
-
validateSandboxTemplateYaml
|
|
10
|
-
} from "./chunk-YVCYVDNP.js";
|
|
11
|
-
import {
|
|
12
|
-
yaml
|
|
13
|
-
} from "./chunk-X7ZG4TSW.js";
|
|
14
|
-
import {
|
|
15
|
-
parseSandboxRuntimePromotionPolicyOption,
|
|
16
|
-
parseSandboxWorkflowModeOption,
|
|
17
|
-
runProcessCommand
|
|
18
|
-
} from "./chunk-HFPUR4CQ.js";
|
|
19
|
-
import {
|
|
20
|
-
optionString,
|
|
21
|
-
optionalJsonObject,
|
|
22
|
-
parseBooleanOption,
|
|
23
|
-
parseCsvOption,
|
|
24
|
-
parseIntegerOption,
|
|
25
|
-
requiredTeamId
|
|
26
|
-
} from "./chunk-MUMPWI4O.js";
|
|
27
|
-
|
|
28
|
-
// ../../packages/cloud/src/profile/agent-sdk-command.ts
|
|
29
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
30
|
-
import { createRequire } from "node:module";
|
|
31
|
-
import path from "node:path";
|
|
32
|
-
function resolveLocalAgentSdkCommand(cwd) {
|
|
33
|
-
const packageDistCli = path.join(
|
|
34
|
-
cwd,
|
|
35
|
-
"node_modules",
|
|
36
|
-
"openpond-agent-sdk",
|
|
37
|
-
"dist",
|
|
38
|
-
"cli.js"
|
|
39
|
-
);
|
|
40
|
-
if (existsSync(packageDistCli)) return { command: process.execPath, args: [packageDistCli] };
|
|
41
|
-
const localBin = path.join(cwd, "node_modules", ".bin", "openpond-agent");
|
|
42
|
-
if (existsSync(localBin)) return { command: localBin, args: [] };
|
|
43
|
-
const packageCli = path.join(
|
|
44
|
-
cwd,
|
|
45
|
-
"node_modules",
|
|
46
|
-
"openpond-agent-sdk",
|
|
47
|
-
"src",
|
|
48
|
-
"cli.ts"
|
|
49
|
-
);
|
|
50
|
-
if (existsSync(packageCli)) {
|
|
51
|
-
return nodeTypescriptCommand(path.dirname(path.dirname(packageCli)), packageCli);
|
|
52
|
-
}
|
|
53
|
-
const packageDependencyCli = resolveAgentSdkDependencyCli(cwd);
|
|
54
|
-
if (packageDependencyCli) return packageDependencyCli;
|
|
55
|
-
return { command: "openpond-agent", args: [] };
|
|
56
|
-
}
|
|
57
|
-
function resolveAgentSdkDependencyCli(cwd) {
|
|
58
|
-
const packageJsonPath = path.join(cwd, "package.json");
|
|
59
|
-
if (!existsSync(packageJsonPath)) return null;
|
|
60
|
-
try {
|
|
61
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
62
|
-
const versionSpec = packageJson.dependencies?.["openpond-agent-sdk"] ?? packageJson.devDependencies?.["openpond-agent-sdk"] ?? packageJson.peerDependencies?.["openpond-agent-sdk"];
|
|
63
|
-
if (!versionSpec?.startsWith("file:")) return null;
|
|
64
|
-
const packageRoot = path.resolve(cwd, versionSpec.slice("file:".length));
|
|
65
|
-
const sourceCli = path.join(packageRoot, "src", "cli.ts");
|
|
66
|
-
if (existsSync(sourceCli)) return nodeTypescriptCommand(packageRoot, sourceCli);
|
|
67
|
-
const distCli = path.join(packageRoot, "dist", "cli.js");
|
|
68
|
-
if (existsSync(distCli)) return { command: process.execPath, args: [distCli] };
|
|
69
|
-
} catch {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
function nodeTypescriptCommand(packageRoot, sourceCli) {
|
|
75
|
-
const tsxCli = createRequire(path.join(packageRoot, "package.json")).resolve("tsx/cli");
|
|
76
|
-
return { command: process.execPath, args: [tsxCli, sourceCli] };
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// ../../packages/cloud/src/profile/project-source-upload.ts
|
|
80
|
-
import { Buffer } from "node:buffer";
|
|
81
|
-
import { existsSync as existsSync4, promises as fs2 } from "node:fs";
|
|
82
|
-
import path4 from "node:path";
|
|
83
|
-
|
|
84
|
-
// ../../packages/cloud/src/profile/project-source-upload-agent-sdk.ts
|
|
85
|
-
import { createHash } from "node:crypto";
|
|
86
|
-
import { existsSync as existsSync3, promises as fs, readFileSync as readFileSync2, statSync } from "node:fs";
|
|
87
|
-
import { tmpdir } from "node:os";
|
|
88
|
-
import path3 from "node:path";
|
|
89
|
-
import { gunzipSync } from "node:zlib";
|
|
90
|
-
|
|
91
|
-
// ../../packages/cloud/src/profile/project-source-upload-bun-compat.ts
|
|
92
|
-
import { existsSync as existsSync2 } from "node:fs";
|
|
93
|
-
import path2 from "node:path";
|
|
94
|
-
function detectAgentSdkPackageManager(projectPath, packageJson) {
|
|
95
|
-
const packageManager = packageJson.packageManager;
|
|
96
|
-
if (typeof packageManager === "string") {
|
|
97
|
-
const name = packageManager.split("@")[0];
|
|
98
|
-
if (name === "bun" || name === "npm" || name === "pnpm" || name === "yarn") {
|
|
99
|
-
return name;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (existsSync2(path2.join(projectPath, "bun.lock")) || existsSync2(path2.join(projectPath, "bun.lockb"))) {
|
|
103
|
-
return "bun";
|
|
104
|
-
}
|
|
105
|
-
if (existsSync2(path2.join(projectPath, "pnpm-lock.yaml"))) return "pnpm";
|
|
106
|
-
if (existsSync2(path2.join(projectPath, "yarn.lock"))) return "yarn";
|
|
107
|
-
if (existsSync2(path2.join(projectPath, "package-lock.json")) || existsSync2(path2.join(projectPath, "npm-shrinkwrap.json"))) {
|
|
108
|
-
return "npm";
|
|
109
|
-
}
|
|
110
|
-
return "unknown";
|
|
111
|
-
}
|
|
112
|
-
function agentSdkDependencyInstallCommand(packageManager) {
|
|
113
|
-
if (packageManager === "npm") return "npm install --offline";
|
|
114
|
-
if (packageManager === "pnpm") return "pnpm install --offline";
|
|
115
|
-
if (packageManager === "yarn") return "yarn install --offline";
|
|
116
|
-
if (packageManager === "bun") return "bun install --offline";
|
|
117
|
-
return "pnpm install --offline";
|
|
118
|
-
}
|
|
119
|
-
function agentSdkRunScriptCommand(packageManager, scriptName) {
|
|
120
|
-
if (packageManager === "pnpm") return `pnpm run ${scriptName}`;
|
|
121
|
-
if (packageManager === "yarn") return `yarn ${scriptName}`;
|
|
122
|
-
if (packageManager === "npm") return `npm run ${scriptName}`;
|
|
123
|
-
if (packageManager === "bun") return `bun run ${scriptName}`;
|
|
124
|
-
return `pnpm run ${scriptName}`;
|
|
125
|
-
}
|
|
126
|
-
function agentSdkRunJsonScriptCommand(packageManager, scriptName) {
|
|
127
|
-
if (packageManager === "pnpm") return `pnpm --silent run ${scriptName}`;
|
|
128
|
-
if (packageManager === "yarn") return `yarn --silent ${scriptName}`;
|
|
129
|
-
if (packageManager === "npm") return `npm run --silent ${scriptName}`;
|
|
130
|
-
if (packageManager === "bun") return `bun run --silent ${scriptName}`;
|
|
131
|
-
return `pnpm --silent run ${scriptName}`;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// ../../packages/cloud/src/profile/project-source-upload-agent-sdk.ts
|
|
135
|
-
var AGENT_SDK_VENDOR_TARBALL_PATH = ".openpond/vendor/openpond-agent-sdk.tgz";
|
|
136
|
-
var AGENT_SDK_VENDOR_NPM_DEPENDENCY_DIR = ".openpond/vendor/npm";
|
|
137
|
-
var AGENT_SDK_MATERIALIZED_DEPENDENCY_SPEC = `file:${AGENT_SDK_VENDOR_TARBALL_PATH}`;
|
|
138
|
-
var AGENT_SDK_SYNTHESIZED_OPENPOND_YAML_SENTINEL = "# openpond-agent-sdk-source-upload: synthesized-openpond-yaml";
|
|
139
|
-
async function runCommand(command, args, options = {}) {
|
|
140
|
-
return runProcessCommand(command, args, { cwd: options.cwd });
|
|
141
|
-
}
|
|
142
|
-
function readOpenPondAgentSdkVersionSpec(packageJson) {
|
|
143
|
-
for (const key of ["dependencies", "devDependencies", "peerDependencies"]) {
|
|
144
|
-
const dependencies = packageJson[key];
|
|
145
|
-
if (!dependencies || typeof dependencies !== "object" || Array.isArray(dependencies)) {
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
const value = dependencies["openpond-agent-sdk"];
|
|
149
|
-
if (typeof value === "string" && value.trim()) return value.trim();
|
|
150
|
-
}
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
async function buildAgentSdkMaterializedDependency(projectPath, packageJson) {
|
|
154
|
-
const sdkSource = resolveLocalOpenPondAgentSdkMaterializationSource(
|
|
155
|
-
projectPath,
|
|
156
|
-
packageJson
|
|
157
|
-
);
|
|
158
|
-
if (!sdkSource) return null;
|
|
159
|
-
const tempDir = await fs.mkdtemp(path3.join(tmpdir(), "openpond-agent-sdk-pack-"));
|
|
160
|
-
try {
|
|
161
|
-
const sdkContents = sdkSource.kind === "package_root" ? await packOpenPondAgentSdkPackageRoot(sdkSource.packageRoot, tempDir) : sdkSource.kind === "registry" ? await packOpenPondAgentSdkRegistryPackage(
|
|
162
|
-
sdkSource.versionSpec,
|
|
163
|
-
tempDir
|
|
164
|
-
) : sdkSource.tarballContents;
|
|
165
|
-
const sdkDependencyTarballs = await packAgentSdkRuntimeDependencyTarballs({
|
|
166
|
-
sdkPackageJson: sdkSource.packageJson,
|
|
167
|
-
dependencyBaseDir: sdkSource.dependencyBaseDir,
|
|
168
|
-
projectPackageJson: packageJson,
|
|
169
|
-
projectPath,
|
|
170
|
-
tempDir
|
|
171
|
-
});
|
|
172
|
-
const packageManager = detectAgentSdkPackageManager(projectPath, packageJson);
|
|
173
|
-
const rewrittenPackageJson = rewriteAgentSdkPackageJsonForMaterialization(
|
|
174
|
-
packageJson,
|
|
175
|
-
sdkDependencyTarballs,
|
|
176
|
-
packageManager
|
|
177
|
-
);
|
|
178
|
-
const pnpmWorkspaceSource = packageManager === "pnpm" || packageManager === "unknown" ? buildAgentSdkPnpmWorkspaceSource(projectPath, sdkDependencyTarballs) : null;
|
|
179
|
-
const installCommand = agentSdkDependencyInstallCommand(packageManager);
|
|
180
|
-
const sdkPackage = {
|
|
181
|
-
packageName: "openpond-agent-sdk",
|
|
182
|
-
source: "uploaded_tarball",
|
|
183
|
-
path: AGENT_SDK_VENDOR_TARBALL_PATH,
|
|
184
|
-
sha256: sha256Hex(sdkContents),
|
|
185
|
-
sizeBytes: sdkContents.byteLength
|
|
186
|
-
};
|
|
187
|
-
return {
|
|
188
|
-
rewrittenPackageJson,
|
|
189
|
-
pnpmWorkspaceSource,
|
|
190
|
-
tarballs: [
|
|
191
|
-
{
|
|
192
|
-
...sdkPackage,
|
|
193
|
-
contents: sdkContents
|
|
194
|
-
},
|
|
195
|
-
...sdkDependencyTarballs
|
|
196
|
-
],
|
|
197
|
-
dependencySetup: {
|
|
198
|
-
required: true,
|
|
199
|
-
packageManager,
|
|
200
|
-
installCommand,
|
|
201
|
-
commands: [installCommand],
|
|
202
|
-
packageJsonPath: "package.json",
|
|
203
|
-
expectedBinaryPath: "node_modules/.bin/openpond-agent",
|
|
204
|
-
generatedArtifactDirectory: ".openpond",
|
|
205
|
-
sdkPackage,
|
|
206
|
-
dependencyPackages: sdkDependencyTarballs.map((tarball) => ({
|
|
207
|
-
packageName: tarball.packageName,
|
|
208
|
-
source: tarball.source,
|
|
209
|
-
versionSpec: tarball.versionSpec,
|
|
210
|
-
path: tarball.path,
|
|
211
|
-
sha256: tarball.sha256,
|
|
212
|
-
sizeBytes: tarball.sizeBytes
|
|
213
|
-
}))
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
} finally {
|
|
217
|
-
await fs.rm(tempDir, { recursive: true, force: true });
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
async function packOpenPondAgentSdkPackageRoot(sdkPackageRoot, tempDir) {
|
|
221
|
-
const pack = await runCommand(
|
|
222
|
-
"npm",
|
|
223
|
-
["pack", "--silent", "--pack-destination", tempDir, sdkPackageRoot],
|
|
224
|
-
{ cwd: sdkPackageRoot }
|
|
225
|
-
);
|
|
226
|
-
if (pack.code !== 0) {
|
|
227
|
-
const details = [pack.stderr.trim(), pack.stdout.trim()].filter(Boolean).join("\n");
|
|
228
|
-
throw new Error(
|
|
229
|
-
`failed to pack openpond-agent-sdk for source upload${details ? `:
|
|
230
|
-
${details}` : ""}`
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
const tarballName = pack.stdout.trim().split(/\r?\n/).filter(Boolean).pop();
|
|
234
|
-
if (!tarballName) {
|
|
235
|
-
throw new Error("failed to pack openpond-agent-sdk for source upload: npm pack did not return a tarball name");
|
|
236
|
-
}
|
|
237
|
-
return fs.readFile(path3.join(tempDir, tarballName));
|
|
238
|
-
}
|
|
239
|
-
async function packAgentSdkRuntimeDependencyTarballs(params) {
|
|
240
|
-
const sdkDependencies = recordStringMap(params.sdkPackageJson.dependencies);
|
|
241
|
-
const projectDependencies = recordStringMap(
|
|
242
|
-
params.projectPackageJson.dependencies
|
|
243
|
-
);
|
|
244
|
-
const projectDevDependencies = recordStringMap(
|
|
245
|
-
params.projectPackageJson.devDependencies
|
|
246
|
-
);
|
|
247
|
-
delete projectDependencies["openpond-agent-sdk"];
|
|
248
|
-
delete projectDevDependencies["openpond-agent-sdk"];
|
|
249
|
-
const pending = [
|
|
250
|
-
...Object.entries(sdkDependencies).map(([packageName, versionSpec]) => ({
|
|
251
|
-
packageName,
|
|
252
|
-
versionSpec,
|
|
253
|
-
dependencyBaseDir: params.dependencyBaseDir
|
|
254
|
-
})),
|
|
255
|
-
...Object.entries(projectDependencies).map(([packageName, versionSpec]) => ({
|
|
256
|
-
packageName,
|
|
257
|
-
versionSpec,
|
|
258
|
-
dependencyBaseDir: params.projectPath
|
|
259
|
-
})),
|
|
260
|
-
...Object.entries(projectDevDependencies).map(
|
|
261
|
-
([packageName, versionSpec]) => ({
|
|
262
|
-
packageName,
|
|
263
|
-
versionSpec,
|
|
264
|
-
dependencyBaseDir: params.projectPath
|
|
265
|
-
})
|
|
266
|
-
)
|
|
267
|
-
].sort((left, right) => left.packageName.localeCompare(right.packageName));
|
|
268
|
-
const seen = /* @__PURE__ */ new Set();
|
|
269
|
-
const tarballs = [];
|
|
270
|
-
while (pending.length > 0) {
|
|
271
|
-
const { packageName, versionSpec, dependencyBaseDir } = pending.shift();
|
|
272
|
-
if (seen.has(packageName)) continue;
|
|
273
|
-
seen.add(packageName);
|
|
274
|
-
const packTarget = npmPackTargetForDependency({
|
|
275
|
-
packageName,
|
|
276
|
-
versionSpec,
|
|
277
|
-
dependencyBaseDir
|
|
278
|
-
});
|
|
279
|
-
const pack = await runCommand(
|
|
280
|
-
"npm",
|
|
281
|
-
["pack", "--silent", "--pack-destination", params.tempDir, packTarget],
|
|
282
|
-
{ cwd: dependencyBaseDir }
|
|
283
|
-
);
|
|
284
|
-
if (pack.code !== 0) {
|
|
285
|
-
const details = [pack.stderr.trim(), pack.stdout.trim()].filter(Boolean).join("\n");
|
|
286
|
-
throw new Error(
|
|
287
|
-
`failed to pack openpond-agent-sdk dependency ${packageName}${details ? `:
|
|
288
|
-
${details}` : ""}`
|
|
289
|
-
);
|
|
290
|
-
}
|
|
291
|
-
const tarballName = pack.stdout.trim().split(/\r?\n/).filter(Boolean).pop();
|
|
292
|
-
if (!tarballName) {
|
|
293
|
-
throw new Error(
|
|
294
|
-
`failed to pack openpond-agent-sdk dependency ${packageName}: npm pack did not return a tarball name`
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
const contents = await fs.readFile(path3.join(params.tempDir, tarballName));
|
|
298
|
-
let packedPackageJson;
|
|
299
|
-
try {
|
|
300
|
-
packedPackageJson = readPackageJsonFromNpmTarball(contents);
|
|
301
|
-
} catch (error) {
|
|
302
|
-
throw new Error(
|
|
303
|
-
`failed to inspect packed dependency ${packageName}: ${error instanceof Error ? error.message : String(error)}`
|
|
304
|
-
);
|
|
305
|
-
}
|
|
306
|
-
tarballs.push({
|
|
307
|
-
packageName,
|
|
308
|
-
source: "npm_dependency_tarball",
|
|
309
|
-
versionSpec,
|
|
310
|
-
path: `${AGENT_SDK_VENDOR_NPM_DEPENDENCY_DIR}/${sanitizeNpmPackageNameForVendor(
|
|
311
|
-
packageName
|
|
312
|
-
)}.tgz`,
|
|
313
|
-
contents,
|
|
314
|
-
sha256: sha256Hex(contents),
|
|
315
|
-
sizeBytes: contents.byteLength
|
|
316
|
-
});
|
|
317
|
-
for (const [dependencyName, dependencySpec] of Object.entries(
|
|
318
|
-
recordStringMap(packedPackageJson.dependencies)
|
|
319
|
-
)) {
|
|
320
|
-
pending.push({
|
|
321
|
-
packageName: dependencyName,
|
|
322
|
-
versionSpec: dependencySpec,
|
|
323
|
-
dependencyBaseDir
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
for (const [dependencyName, dependencySpec] of Object.entries(
|
|
327
|
-
recordStringMap(packedPackageJson.optionalDependencies)
|
|
328
|
-
)) {
|
|
329
|
-
if (!isSupportedSandboxOptionalDependency(dependencyName)) continue;
|
|
330
|
-
pending.push({
|
|
331
|
-
packageName: dependencyName,
|
|
332
|
-
versionSpec: dependencySpec,
|
|
333
|
-
dependencyBaseDir
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
return tarballs.sort((left, right) => left.packageName.localeCompare(right.packageName));
|
|
338
|
-
}
|
|
339
|
-
function isSupportedSandboxOptionalDependency(packageName) {
|
|
340
|
-
if (packageName === "fsevents") return false;
|
|
341
|
-
if (packageName.startsWith("@esbuild/")) {
|
|
342
|
-
return packageName === "@esbuild/linux-x64" || packageName === "@esbuild/linux-arm64";
|
|
343
|
-
}
|
|
344
|
-
return true;
|
|
345
|
-
}
|
|
346
|
-
function npmPackTargetForDependency(params) {
|
|
347
|
-
if (params.versionSpec.startsWith("file:")) {
|
|
348
|
-
return path3.resolve(
|
|
349
|
-
params.dependencyBaseDir,
|
|
350
|
-
params.versionSpec.slice("file:".length)
|
|
351
|
-
);
|
|
352
|
-
}
|
|
353
|
-
return `${params.packageName}@${params.versionSpec}`;
|
|
354
|
-
}
|
|
355
|
-
function sanitizeNpmPackageNameForVendor(packageName) {
|
|
356
|
-
return packageName.replace(/^@/, "").replace(/[\/\\]/g, "__").replace(/[^a-zA-Z0-9._-]/g, "_");
|
|
357
|
-
}
|
|
358
|
-
async function packOpenPondAgentSdkRegistryPackage(versionSpec, tempDir) {
|
|
359
|
-
const pack = await runCommand(
|
|
360
|
-
"npm",
|
|
361
|
-
[
|
|
362
|
-
"pack",
|
|
363
|
-
"--silent",
|
|
364
|
-
"--pack-destination",
|
|
365
|
-
tempDir,
|
|
366
|
-
`openpond-agent-sdk@${versionSpec}`
|
|
367
|
-
],
|
|
368
|
-
{ cwd: tempDir }
|
|
369
|
-
);
|
|
370
|
-
if (pack.code !== 0) {
|
|
371
|
-
const details = [pack.stderr.trim(), pack.stdout.trim()].filter(Boolean).join("\n");
|
|
372
|
-
throw new Error(
|
|
373
|
-
`failed to pack openpond-agent-sdk for source upload${details ? `:
|
|
374
|
-
${details}` : ""}`
|
|
375
|
-
);
|
|
376
|
-
}
|
|
377
|
-
const tarballName = pack.stdout.trim().split(/\r?\n/).filter(Boolean).pop();
|
|
378
|
-
if (!tarballName) {
|
|
379
|
-
throw new Error(
|
|
380
|
-
"failed to pack openpond-agent-sdk for source upload: npm pack did not return a tarball name"
|
|
381
|
-
);
|
|
382
|
-
}
|
|
383
|
-
return fs.readFile(path3.join(tempDir, tarballName));
|
|
384
|
-
}
|
|
385
|
-
function resolveLocalOpenPondAgentSdkMaterializationSource(projectPath, packageJson) {
|
|
386
|
-
const versionSpec = readOpenPondAgentSdkVersionSpec(packageJson);
|
|
387
|
-
if (versionSpec?.startsWith("file:")) {
|
|
388
|
-
const candidate = path3.resolve(projectPath, versionSpec.slice("file:".length));
|
|
389
|
-
if (isOpenPondAgentSdkPackageRoot(candidate)) {
|
|
390
|
-
return {
|
|
391
|
-
kind: "package_root",
|
|
392
|
-
packageRoot: candidate,
|
|
393
|
-
dependencyBaseDir: candidate,
|
|
394
|
-
packageJson: JSON.parse(
|
|
395
|
-
readFileSyncUtf8(path3.join(candidate, "package.json"))
|
|
396
|
-
)
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
if (isLocalNpmTarball(candidate)) {
|
|
400
|
-
const tarballContents = readFileSync2(candidate);
|
|
401
|
-
const tarballPackageJson = readPackageJsonFromNpmTarball(tarballContents);
|
|
402
|
-
if (tarballPackageJson.name === "openpond-agent-sdk") {
|
|
403
|
-
return {
|
|
404
|
-
kind: "tarball",
|
|
405
|
-
tarballPath: candidate,
|
|
406
|
-
tarballContents,
|
|
407
|
-
dependencyBaseDir: path3.dirname(candidate),
|
|
408
|
-
packageJson: tarballPackageJson
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
if (versionSpec?.startsWith("workspace:")) {
|
|
414
|
-
const candidate = findOpenPondAgentSdkPackageRootInAncestors(projectPath);
|
|
415
|
-
if (candidate) {
|
|
416
|
-
return {
|
|
417
|
-
kind: "package_root",
|
|
418
|
-
packageRoot: candidate,
|
|
419
|
-
dependencyBaseDir: candidate,
|
|
420
|
-
packageJson: JSON.parse(
|
|
421
|
-
readFileSyncUtf8(path3.join(candidate, "package.json"))
|
|
422
|
-
)
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
const installedPackageRoot = path3.join(
|
|
427
|
-
projectPath,
|
|
428
|
-
"node_modules",
|
|
429
|
-
"openpond-agent-sdk"
|
|
430
|
-
);
|
|
431
|
-
if (isOpenPondAgentSdkPackageRoot(installedPackageRoot)) {
|
|
432
|
-
const installedPackageJson = JSON.parse(
|
|
433
|
-
readFileSyncUtf8(path3.join(installedPackageRoot, "package.json"))
|
|
434
|
-
);
|
|
435
|
-
const installedVersion = text(installedPackageJson.version);
|
|
436
|
-
return {
|
|
437
|
-
kind: "registry",
|
|
438
|
-
versionSpec: installedVersion ?? versionSpec ?? "latest",
|
|
439
|
-
dependencyBaseDir: installedPackageRoot,
|
|
440
|
-
packageJson: installedPackageJson
|
|
441
|
-
};
|
|
442
|
-
}
|
|
443
|
-
return null;
|
|
444
|
-
}
|
|
445
|
-
function findOpenPondAgentSdkPackageRootInAncestors(projectPath) {
|
|
446
|
-
let current = path3.resolve(projectPath);
|
|
447
|
-
while (true) {
|
|
448
|
-
if (isOpenPondAgentSdkPackageRoot(current)) return current;
|
|
449
|
-
const parent = path3.dirname(current);
|
|
450
|
-
if (parent === current) return null;
|
|
451
|
-
current = parent;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
function isOpenPondAgentSdkPackageRoot(candidate) {
|
|
455
|
-
const packageJsonPath = path3.join(candidate, "package.json");
|
|
456
|
-
if (!existsSync3(packageJsonPath)) return false;
|
|
457
|
-
try {
|
|
458
|
-
const parsed = JSON.parse(readFileSyncUtf8(packageJsonPath));
|
|
459
|
-
return parsed.name === "openpond-agent-sdk";
|
|
460
|
-
} catch {
|
|
461
|
-
return false;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
function isLocalNpmTarball(candidate) {
|
|
465
|
-
if (!existsSync3(candidate)) return false;
|
|
466
|
-
try {
|
|
467
|
-
return statSync(candidate).isFile() && (candidate.endsWith(".tgz") || candidate.endsWith(".tar.gz"));
|
|
468
|
-
} catch {
|
|
469
|
-
return false;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
function readPackageJsonFromNpmTarball(tarballContents) {
|
|
473
|
-
const tarContents = gunzipSync(tarballContents);
|
|
474
|
-
let offset = 0;
|
|
475
|
-
while (offset + 512 <= tarContents.length) {
|
|
476
|
-
const header = tarContents.subarray(offset, offset + 512);
|
|
477
|
-
if (header.every((byte) => byte === 0)) break;
|
|
478
|
-
const name = readTarString(header, 0, 100);
|
|
479
|
-
const prefix = readTarString(header, 345, 155);
|
|
480
|
-
const entryPath = prefix ? `${prefix}/${name}` : name;
|
|
481
|
-
const sizeText = readTarString(header, 124, 12).trim();
|
|
482
|
-
const size = Number.parseInt(sizeText || "0", 8);
|
|
483
|
-
if (!Number.isFinite(size) || size < 0) {
|
|
484
|
-
throw new Error("failed to read openpond-agent-sdk tarball: invalid entry size");
|
|
485
|
-
}
|
|
486
|
-
const dataStart = offset + 512;
|
|
487
|
-
const dataEnd = dataStart + size;
|
|
488
|
-
if (entryPath === "package/package.json" || entryPath.endsWith("/package.json")) {
|
|
489
|
-
return JSON.parse(
|
|
490
|
-
tarContents.subarray(dataStart, dataEnd).toString("utf8")
|
|
491
|
-
);
|
|
492
|
-
}
|
|
493
|
-
offset = dataStart + Math.ceil(size / 512) * 512;
|
|
494
|
-
}
|
|
495
|
-
throw new Error("failed to read npm package tarball: missing package.json");
|
|
496
|
-
}
|
|
497
|
-
function readTarString(header, start, length) {
|
|
498
|
-
const field = header.subarray(start, start + length);
|
|
499
|
-
const nullIndex = field.indexOf(0);
|
|
500
|
-
return field.subarray(0, nullIndex === -1 ? field.length : nullIndex).toString("utf8");
|
|
501
|
-
}
|
|
502
|
-
function rewriteAgentSdkPackageJsonForMaterialization(packageJson, dependencyTarballs, packageManager) {
|
|
503
|
-
const rewritten = { ...packageJson };
|
|
504
|
-
const dependencies = recordCopy(rewritten.dependencies);
|
|
505
|
-
const overrides = recordCopy(rewritten.overrides);
|
|
506
|
-
dependencies["openpond-agent-sdk"] = AGENT_SDK_MATERIALIZED_DEPENDENCY_SPEC;
|
|
507
|
-
for (const tarball of dependencyTarballs) {
|
|
508
|
-
const dependencySpec = `file:${tarball.path}`;
|
|
509
|
-
dependencies[tarball.packageName] = dependencySpec;
|
|
510
|
-
overrides[tarball.packageName] = dependencySpec;
|
|
511
|
-
}
|
|
512
|
-
rewritten.dependencies = dependencies;
|
|
513
|
-
if (Object.keys(overrides).length > 0) {
|
|
514
|
-
rewritten.overrides = overrides;
|
|
515
|
-
}
|
|
516
|
-
if (packageManager === "pnpm" || packageManager === "unknown") {
|
|
517
|
-
delete rewritten.packageManager;
|
|
518
|
-
}
|
|
519
|
-
for (const key of ["devDependencies", "peerDependencies"]) {
|
|
520
|
-
const entries = recordCopy(rewritten[key]);
|
|
521
|
-
delete entries["openpond-agent-sdk"];
|
|
522
|
-
if (Object.keys(entries).length > 0) {
|
|
523
|
-
rewritten[key] = entries;
|
|
524
|
-
} else {
|
|
525
|
-
delete rewritten[key];
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
return rewritten;
|
|
529
|
-
}
|
|
530
|
-
function buildAgentSdkPnpmWorkspaceSource(projectPath, dependencyTarballs) {
|
|
531
|
-
const workspacePath = path3.join(projectPath, "pnpm-workspace.yaml");
|
|
532
|
-
let workspace = {};
|
|
533
|
-
if (existsSync3(workspacePath)) {
|
|
534
|
-
const parsed = yaml.load(readFileSyncUtf8(workspacePath));
|
|
535
|
-
workspace = parsed && typeof parsed === "object" && !Array.isArray(parsed) ? { ...parsed } : {};
|
|
536
|
-
}
|
|
537
|
-
if (!Array.isArray(workspace.packages)) workspace.packages = [];
|
|
538
|
-
const overrides = recordCopy(workspace.overrides);
|
|
539
|
-
for (const tarball of dependencyTarballs) {
|
|
540
|
-
overrides[tarball.packageName] = `file:${tarball.path}`;
|
|
541
|
-
}
|
|
542
|
-
workspace.overrides = overrides;
|
|
543
|
-
const allowBuilds = recordCopy(workspace.allowBuilds);
|
|
544
|
-
allowBuilds.esbuild = true;
|
|
545
|
-
const vendoredEsbuild = dependencyTarballs.find(
|
|
546
|
-
(tarball) => tarball.packageName === "esbuild"
|
|
547
|
-
);
|
|
548
|
-
if (vendoredEsbuild) {
|
|
549
|
-
allowBuilds[`esbuild@file:${vendoredEsbuild.path}`] = true;
|
|
550
|
-
}
|
|
551
|
-
workspace.allowBuilds = allowBuilds;
|
|
552
|
-
workspace.supportedArchitectures = {
|
|
553
|
-
os: ["linux"],
|
|
554
|
-
cpu: ["x64", "arm64"],
|
|
555
|
-
libc: ["glibc", "musl"]
|
|
556
|
-
};
|
|
557
|
-
return yaml.dump(workspace, { lineWidth: 120, noRefs: true });
|
|
558
|
-
}
|
|
559
|
-
function recordStringMap(value) {
|
|
560
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
561
|
-
const entries = {};
|
|
562
|
-
for (const [key, entryValue] of Object.entries(value)) {
|
|
563
|
-
if (typeof entryValue === "string" && entryValue.trim()) {
|
|
564
|
-
entries[key] = entryValue.trim();
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
return entries;
|
|
568
|
-
}
|
|
569
|
-
function recordCopy(value) {
|
|
570
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
571
|
-
return { ...value };
|
|
572
|
-
}
|
|
573
|
-
function recordArray(value) {
|
|
574
|
-
return Array.isArray(value) ? value.filter(
|
|
575
|
-
(item) => Boolean(item) && typeof item === "object" && !Array.isArray(item)
|
|
576
|
-
) : [];
|
|
577
|
-
}
|
|
578
|
-
function text(value) {
|
|
579
|
-
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
580
|
-
}
|
|
581
|
-
function sha256Hex(contents) {
|
|
582
|
-
return createHash("sha256").update(contents).digest("hex");
|
|
583
|
-
}
|
|
584
|
-
function dependencySetupCommands(value) {
|
|
585
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
586
|
-
const record = value;
|
|
587
|
-
if (Array.isArray(record.commands)) {
|
|
588
|
-
return record.commands.filter(
|
|
589
|
-
(command) => typeof command === "string" && command.trim() !== ""
|
|
590
|
-
);
|
|
591
|
-
}
|
|
592
|
-
return typeof record.installCommand === "string" && record.installCommand.trim() ? [record.installCommand.trim()] : [];
|
|
593
|
-
}
|
|
594
|
-
function mergeManifestSetupCommands(manifest, commands) {
|
|
595
|
-
if (commands.length === 0) return manifest;
|
|
596
|
-
const setup = manifest.setup && typeof manifest.setup === "object" && !Array.isArray(manifest.setup) ? recordCopy(manifest.setup) : {};
|
|
597
|
-
const existingCommands = Array.isArray(setup.commands) ? setup.commands.filter(
|
|
598
|
-
(command) => typeof command === "string" && command.trim() !== ""
|
|
599
|
-
) : [];
|
|
600
|
-
const mergedCommands = [...commands];
|
|
601
|
-
for (const command of existingCommands) {
|
|
602
|
-
if (!mergedCommands.includes(command)) mergedCommands.push(command);
|
|
603
|
-
}
|
|
604
|
-
return {
|
|
605
|
-
...manifest,
|
|
606
|
-
setup: {
|
|
607
|
-
...setup,
|
|
608
|
-
commands: mergedCommands
|
|
609
|
-
}
|
|
610
|
-
};
|
|
611
|
-
}
|
|
612
|
-
function sanitizeAgentSdkRuntimeManifestForOpenPondYaml(source, dependencySetup) {
|
|
613
|
-
const parsed = yaml.load(source);
|
|
614
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
615
|
-
return `${AGENT_SDK_SYNTHESIZED_OPENPOND_YAML_SENTINEL}
|
|
616
|
-
${source}`;
|
|
617
|
-
}
|
|
618
|
-
const manifest = mergeManifestSetupCommands(
|
|
619
|
-
{ ...parsed },
|
|
620
|
-
dependencySetupCommands(dependencySetup)
|
|
621
|
-
);
|
|
622
|
-
delete manifest.schema;
|
|
623
|
-
sanitizeGeneratedManifestNamedCommands(manifest, "actions");
|
|
624
|
-
sanitizeGeneratedManifestNamedCommands(manifest, "services");
|
|
625
|
-
return `${AGENT_SDK_SYNTHESIZED_OPENPOND_YAML_SENTINEL}
|
|
626
|
-
${yaml.dump(manifest, { lineWidth: -1, noRefs: true })}`;
|
|
627
|
-
}
|
|
628
|
-
function sanitizeGeneratedManifestNamedCommands(manifest, key) {
|
|
629
|
-
if (!Array.isArray(manifest[key])) return;
|
|
630
|
-
manifest[key] = manifest[key].map((entry) => {
|
|
631
|
-
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
632
|
-
return entry;
|
|
633
|
-
}
|
|
634
|
-
const sanitized = { ...entry };
|
|
635
|
-
delete sanitized.id;
|
|
636
|
-
delete sanitized.label;
|
|
637
|
-
return sanitized;
|
|
638
|
-
});
|
|
639
|
-
}
|
|
640
|
-
function isAgentSdkProject(projectPath) {
|
|
641
|
-
if (!existsSync3(path3.join(projectPath, "agent", "agent.ts"))) return false;
|
|
642
|
-
const packageJsonPath = path3.join(projectPath, "package.json");
|
|
643
|
-
if (!existsSync3(packageJsonPath)) return false;
|
|
644
|
-
try {
|
|
645
|
-
const parsed = JSON.parse(readFileSyncUtf8(packageJsonPath));
|
|
646
|
-
return Boolean(
|
|
647
|
-
parsed.dependencies?.["openpond-agent-sdk"] || parsed.devDependencies?.["openpond-agent-sdk"] || parsed.peerDependencies?.["openpond-agent-sdk"]
|
|
648
|
-
);
|
|
649
|
-
} catch {
|
|
650
|
-
return false;
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
function readFileSyncUtf8(filePath) {
|
|
654
|
-
return readFileSync2(filePath, "utf8");
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
// ../../packages/cloud/src/profile/project-source-upload.ts
|
|
658
|
-
function optionString2(options, key) {
|
|
659
|
-
const value = options[key];
|
|
660
|
-
return typeof value === "string" ? value.trim() : "";
|
|
661
|
-
}
|
|
662
|
-
async function runCommand2(command, args, options = {}) {
|
|
663
|
-
return runProcessCommand(command, args, { cwd: options.cwd });
|
|
664
|
-
}
|
|
665
|
-
var PROJECT_SOURCE_UPLOAD_MAX_FILES = 1500;
|
|
666
|
-
var PROJECT_SOURCE_UPLOAD_MAX_FILE_BYTES = 8 * 1024 * 1024;
|
|
667
|
-
var PROJECT_SOURCE_UPLOAD_MAX_BYTES = 100 * 1024 * 1024;
|
|
668
|
-
var PROJECT_SOURCE_UPLOAD_CONCURRENCY = 8;
|
|
669
|
-
var PROJECT_SOURCE_UPLOAD_LIMITS = {
|
|
670
|
-
maxFiles: PROJECT_SOURCE_UPLOAD_MAX_FILES,
|
|
671
|
-
maxFileBytes: PROJECT_SOURCE_UPLOAD_MAX_FILE_BYTES,
|
|
672
|
-
maxTotalBytes: PROJECT_SOURCE_UPLOAD_MAX_BYTES,
|
|
673
|
-
concurrency: PROJECT_SOURCE_UPLOAD_CONCURRENCY
|
|
674
|
-
};
|
|
675
|
-
var PROJECT_SOURCE_UPLOAD_TRANSPORT = {
|
|
676
|
-
mode: "single_json_payload",
|
|
677
|
-
chunkingSupported: false
|
|
678
|
-
};
|
|
679
|
-
var AGENT_SDK_SOURCE_UPLOAD_METADATA_PATH = ".openpond/source-upload-metadata.json";
|
|
680
|
-
var AGENT_SDK_GENERATED_SKILLS_DIR = ".openpond/skills";
|
|
681
|
-
var AGENT_SDK_GENERATED_ARTIFACTS = [
|
|
682
|
-
".openpond/agent-inspect.json",
|
|
683
|
-
".openpond/agent-manifest.json",
|
|
684
|
-
".openpond/action-registry.json",
|
|
685
|
-
".openpond/openpond-manifest.preview.yaml",
|
|
686
|
-
".openpond/runtime-bridge.mjs",
|
|
687
|
-
".openpond/validator-report.md"
|
|
688
|
-
];
|
|
689
|
-
function isSafeProjectSourcePath(filePath) {
|
|
690
|
-
return filePath.length > 0 && !filePath.includes("\0") && !path4.isAbsolute(filePath) && !filePath.split(/[\\/]+/).some((part) => !part || part === "." || part === "..");
|
|
691
|
-
}
|
|
692
|
-
function shouldSkipProjectSourcePath(filePath) {
|
|
693
|
-
return filePath.split(/[\\/]+/).some((segment) => {
|
|
694
|
-
const lower = segment.toLowerCase();
|
|
695
|
-
return lower === ".git" || lower === ".openpond" || lower === "node_modules" || lower === ".next" || lower === ".turbo" || lower.startsWith(".env");
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
async function resolveProjectSourceUploadBranch(projectPath, options) {
|
|
699
|
-
const explicit = optionString2(options, "branch");
|
|
700
|
-
if (explicit) return explicit;
|
|
701
|
-
const branch = await runCommand2("git", ["branch", "--show-current"], {
|
|
702
|
-
cwd: projectPath
|
|
703
|
-
});
|
|
704
|
-
if (branch.code !== 0) return null;
|
|
705
|
-
return branch.stdout.trim() || null;
|
|
706
|
-
}
|
|
707
|
-
async function collectProjectSourceUploadEntries(projectPath) {
|
|
708
|
-
const sourcePaths = await collectProjectSourceUploadPaths(projectPath);
|
|
709
|
-
if (sourcePaths.length === 0) {
|
|
710
|
-
throw new Error("no source files found to upload");
|
|
711
|
-
}
|
|
712
|
-
if (sourcePaths.length > PROJECT_SOURCE_UPLOAD_MAX_FILES) {
|
|
713
|
-
throw new Error(
|
|
714
|
-
`too many source files to upload: ${sourcePaths.length} > ${PROJECT_SOURCE_UPLOAD_MAX_FILES}`
|
|
715
|
-
);
|
|
716
|
-
}
|
|
717
|
-
const sortedSourcePaths = sourcePaths.sort();
|
|
718
|
-
const filesToUpload = (await mapWithConcurrency(sortedSourcePaths, PROJECT_SOURCE_UPLOAD_CONCURRENCY, async (sourcePath) => {
|
|
719
|
-
const absolutePath = path4.resolve(projectPath, sourcePath);
|
|
720
|
-
const relative = path4.relative(projectPath, absolutePath);
|
|
721
|
-
if (relative.startsWith("..") || path4.isAbsolute(relative)) {
|
|
722
|
-
throw new Error(`source path escapes project: ${sourcePath}`);
|
|
723
|
-
}
|
|
724
|
-
const stat = await fs2.stat(absolutePath);
|
|
725
|
-
if (!stat.isFile()) return null;
|
|
726
|
-
if (stat.size > PROJECT_SOURCE_UPLOAD_MAX_FILE_BYTES) {
|
|
727
|
-
throw new Error(
|
|
728
|
-
`source file is too large: ${sourcePath} (${stat.size} bytes)`
|
|
729
|
-
);
|
|
730
|
-
}
|
|
731
|
-
return {
|
|
732
|
-
path: sourcePath.replace(/\\/g, "/"),
|
|
733
|
-
absolutePath,
|
|
734
|
-
size: stat.size,
|
|
735
|
-
mtimeMs: Math.trunc(stat.mtimeMs),
|
|
736
|
-
ctimeMs: Math.trunc(stat.ctimeMs)
|
|
737
|
-
};
|
|
738
|
-
})).filter((file) => file !== null);
|
|
739
|
-
let totalBytes = 0;
|
|
740
|
-
for (const file of filesToUpload) {
|
|
741
|
-
totalBytes += file.size;
|
|
742
|
-
if (totalBytes > PROJECT_SOURCE_UPLOAD_MAX_BYTES) {
|
|
743
|
-
throw new Error(
|
|
744
|
-
`source upload is too large: ${totalBytes} > ${PROJECT_SOURCE_UPLOAD_MAX_BYTES}`
|
|
745
|
-
);
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
const cache = await readSourceUploadCache(projectPath);
|
|
749
|
-
const materialized = await mapWithConcurrency(
|
|
750
|
-
filesToUpload,
|
|
751
|
-
PROJECT_SOURCE_UPLOAD_CONCURRENCY,
|
|
752
|
-
async (file) => materializeSourceUploadFile(file, cache)
|
|
753
|
-
);
|
|
754
|
-
await writeSourceUploadCache(projectPath, materialized).catch(() => {
|
|
755
|
-
});
|
|
756
|
-
const entries = materialized.map((item) => item.entry);
|
|
757
|
-
return {
|
|
758
|
-
entries,
|
|
759
|
-
fileCount: entries.length,
|
|
760
|
-
totalBytes,
|
|
761
|
-
limits: PROJECT_SOURCE_UPLOAD_LIMITS,
|
|
762
|
-
transport: PROJECT_SOURCE_UPLOAD_TRANSPORT
|
|
763
|
-
};
|
|
764
|
-
}
|
|
765
|
-
async function mapWithConcurrency(items, concurrency, mapper) {
|
|
766
|
-
const results = new Array(items.length);
|
|
767
|
-
let nextIndex = 0;
|
|
768
|
-
const workerCount = Math.max(1, Math.min(concurrency, items.length));
|
|
769
|
-
await Promise.all(
|
|
770
|
-
Array.from({ length: workerCount }, async () => {
|
|
771
|
-
while (nextIndex < items.length) {
|
|
772
|
-
const index = nextIndex;
|
|
773
|
-
nextIndex += 1;
|
|
774
|
-
results[index] = await mapper(items[index], index);
|
|
775
|
-
}
|
|
776
|
-
})
|
|
777
|
-
);
|
|
778
|
-
return results;
|
|
779
|
-
}
|
|
780
|
-
async function collectProjectSourceUploadPaths(projectPath) {
|
|
781
|
-
const files = await runCommand2(
|
|
782
|
-
"git",
|
|
783
|
-
["ls-files", "-z", "--cached", "--others", "--exclude-standard"],
|
|
784
|
-
{ cwd: projectPath }
|
|
785
|
-
);
|
|
786
|
-
if (files.code !== 0) {
|
|
787
|
-
if (existsSync4(path4.join(projectPath, ".git"))) {
|
|
788
|
-
throw new Error(
|
|
789
|
-
`git ls-files failed: ${files.stderr.trim() || files.stdout.trim() || "unknown error"}`
|
|
790
|
-
);
|
|
791
|
-
}
|
|
792
|
-
return collectFilesystemProjectSourceUploadPaths(projectPath);
|
|
793
|
-
}
|
|
794
|
-
return files.stdout.split("\0").map((filePath) => filePath.trim()).filter(Boolean).filter((filePath) => {
|
|
795
|
-
const normalized = filePath.replace(/\\/g, "/");
|
|
796
|
-
return isSafeProjectSourcePath(normalized) && !shouldSkipProjectSourcePath(normalized);
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
async function collectFilesystemProjectSourceUploadPaths(projectPath) {
|
|
800
|
-
const sourcePaths = [];
|
|
801
|
-
async function visit(relativeDir) {
|
|
802
|
-
const absoluteDir = path4.join(projectPath, relativeDir);
|
|
803
|
-
const entries = await fs2.readdir(absoluteDir, { withFileTypes: true });
|
|
804
|
-
for (const entry of entries) {
|
|
805
|
-
const relativePath = path4.join(relativeDir, entry.name).replace(/\\/g, "/");
|
|
806
|
-
if (!isSafeProjectSourcePath(relativePath) || shouldSkipProjectSourcePath(relativePath)) {
|
|
807
|
-
continue;
|
|
808
|
-
}
|
|
809
|
-
if (entry.isDirectory()) {
|
|
810
|
-
await visit(relativePath);
|
|
811
|
-
continue;
|
|
812
|
-
}
|
|
813
|
-
if (entry.isFile()) sourcePaths.push(relativePath);
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
try {
|
|
817
|
-
await visit("");
|
|
818
|
-
} catch (error) {
|
|
819
|
-
throw new Error(
|
|
820
|
-
`filesystem source scan failed: ${error instanceof Error ? error.message : String(error)}`
|
|
821
|
-
);
|
|
822
|
-
}
|
|
823
|
-
return sourcePaths;
|
|
824
|
-
}
|
|
825
|
-
async function collectAgentSdkProjectSourceUploadEntries(projectPath, existingEntries) {
|
|
826
|
-
if (!isAgentSdkProject(projectPath)) {
|
|
827
|
-
return {
|
|
828
|
-
entries: [],
|
|
829
|
-
generatedManifestPath: null,
|
|
830
|
-
synthesizedOpenPondYaml: false,
|
|
831
|
-
uploadMetadataPath: null,
|
|
832
|
-
uploadMetadata: null,
|
|
833
|
-
uploadMetadataHash: null
|
|
834
|
-
};
|
|
835
|
-
}
|
|
836
|
-
await runAgentSdkProjectCheck(projectPath, "build");
|
|
837
|
-
await runAgentSdkProjectCheck(projectPath, "validate");
|
|
838
|
-
await runAgentSdkProjectCheck(projectPath, "eval");
|
|
839
|
-
const packageJson = readAgentSdkProjectPackageJson(projectPath);
|
|
840
|
-
const materializedDependency = await buildAgentSdkMaterializedDependency(
|
|
841
|
-
projectPath,
|
|
842
|
-
packageJson
|
|
843
|
-
);
|
|
844
|
-
const manifestPath = ".openpond/openpond-manifest.preview.yaml";
|
|
845
|
-
const manifestSource = await fs2.readFile(path4.join(projectPath, manifestPath), "utf8");
|
|
846
|
-
const openPondYamlSource = sanitizeAgentSdkRuntimeManifestForOpenPondYaml(
|
|
847
|
-
manifestSource,
|
|
848
|
-
materializedDependency?.dependencySetup ?? null
|
|
849
|
-
);
|
|
850
|
-
const manifestResult = validateSandboxTemplateYaml(openPondYamlSource);
|
|
851
|
-
if (!manifestResult.ok) {
|
|
852
|
-
throw new Error(
|
|
853
|
-
`generated ${manifestPath} failed sandbox-template validation after openpond.yaml sanitization:
|
|
854
|
-
${formatSandboxTemplateDiagnostics(
|
|
855
|
-
manifestResult.diagnostics
|
|
856
|
-
)}`
|
|
857
|
-
);
|
|
858
|
-
}
|
|
859
|
-
const entries = [];
|
|
860
|
-
if (materializedDependency?.rewrittenPackageJson) {
|
|
861
|
-
entries.push(
|
|
862
|
-
projectSourceUploadTextEntry(
|
|
863
|
-
"package.json",
|
|
864
|
-
`${JSON.stringify(materializedDependency.rewrittenPackageJson, null, 2)}
|
|
865
|
-
`
|
|
866
|
-
)
|
|
867
|
-
);
|
|
868
|
-
}
|
|
869
|
-
if (materializedDependency?.pnpmWorkspaceSource) {
|
|
870
|
-
entries.push(
|
|
871
|
-
projectSourceUploadTextEntry(
|
|
872
|
-
"pnpm-workspace.yaml",
|
|
873
|
-
materializedDependency.pnpmWorkspaceSource
|
|
874
|
-
)
|
|
875
|
-
);
|
|
876
|
-
}
|
|
877
|
-
for (const tarball of materializedDependency?.tarballs ?? []) {
|
|
878
|
-
entries.push(
|
|
879
|
-
projectSourceUploadBufferEntry(tarball.path, tarball.contents)
|
|
880
|
-
);
|
|
881
|
-
}
|
|
882
|
-
const generatedArtifactPaths = await collectAgentSdkGeneratedArtifactPaths(projectPath);
|
|
883
|
-
for (const artifactPath of generatedArtifactPaths) {
|
|
884
|
-
entries.push(await projectSourceUploadFileEntry(projectPath, artifactPath));
|
|
885
|
-
}
|
|
886
|
-
const hasAuthoredOpenPondYaml = existingEntries.some((entry) => entry.path === "openpond.yaml") || existsSync4(path4.join(projectPath, "openpond.yaml"));
|
|
887
|
-
if (!hasAuthoredOpenPondYaml) {
|
|
888
|
-
entries.push(projectSourceUploadTextEntry("openpond.yaml", openPondYamlSource));
|
|
889
|
-
} else {
|
|
890
|
-
const authoredSource = await fs2.readFile(path4.join(projectPath, "openpond.yaml"), "utf8");
|
|
891
|
-
const authoredResult = validateSandboxTemplateYaml(authoredSource);
|
|
892
|
-
if (!authoredResult.ok) {
|
|
893
|
-
throw new Error(
|
|
894
|
-
`authored openpond.yaml failed sandbox-template validation:
|
|
895
|
-
${formatSandboxTemplateDiagnostics(
|
|
896
|
-
authoredResult.diagnostics
|
|
897
|
-
)}`
|
|
898
|
-
);
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
const uploadMetadata = await buildAgentSdkSourceUploadMetadata(projectPath, {
|
|
902
|
-
packageJson,
|
|
903
|
-
generatedManifestPath: manifestPath,
|
|
904
|
-
generatedArtifactPaths,
|
|
905
|
-
synthesizedOpenPondYaml: !hasAuthoredOpenPondYaml,
|
|
906
|
-
openPondYamlSource,
|
|
907
|
-
dependencySetup: materializedDependency?.dependencySetup ?? null
|
|
908
|
-
});
|
|
909
|
-
const uploadMetadataSource = `${JSON.stringify(uploadMetadata, null, 2)}
|
|
910
|
-
`;
|
|
911
|
-
const uploadMetadataHash = {
|
|
912
|
-
sha256: sha256Hex(Buffer.from(uploadMetadataSource, "utf8")),
|
|
913
|
-
sizeBytes: Buffer.byteLength(uploadMetadataSource, "utf8")
|
|
914
|
-
};
|
|
915
|
-
entries.push(
|
|
916
|
-
projectSourceUploadTextEntry(
|
|
917
|
-
AGENT_SDK_SOURCE_UPLOAD_METADATA_PATH,
|
|
918
|
-
uploadMetadataSource
|
|
919
|
-
)
|
|
920
|
-
);
|
|
921
|
-
return {
|
|
922
|
-
entries,
|
|
923
|
-
generatedManifestPath: manifestPath,
|
|
924
|
-
synthesizedOpenPondYaml: !hasAuthoredOpenPondYaml,
|
|
925
|
-
uploadMetadataPath: AGENT_SDK_SOURCE_UPLOAD_METADATA_PATH,
|
|
926
|
-
uploadMetadata,
|
|
927
|
-
uploadMetadataHash
|
|
928
|
-
};
|
|
929
|
-
}
|
|
930
|
-
async function buildAgentSdkSourceUploadMetadata(projectPath, params) {
|
|
931
|
-
const packageManager = detectAgentSdkPackageManager(projectPath, params.packageJson);
|
|
932
|
-
const commandHints = buildAgentSdkCommandHints(params.packageJson, packageManager);
|
|
933
|
-
const setupRequirements = await collectAgentSdkSourceSetupRequirements(projectPath);
|
|
934
|
-
const artifactHashes = {};
|
|
935
|
-
for (const artifactPath of params.generatedArtifactPaths) {
|
|
936
|
-
const absolutePath = path4.join(projectPath, artifactPath);
|
|
937
|
-
if (!existsSync4(absolutePath)) continue;
|
|
938
|
-
const contents = await fs2.readFile(absolutePath);
|
|
939
|
-
artifactHashes[artifactPath] = {
|
|
940
|
-
sha256: sha256Hex(contents),
|
|
941
|
-
sizeBytes: contents.byteLength
|
|
942
|
-
};
|
|
943
|
-
}
|
|
944
|
-
artifactHashes["openpond.yaml"] = {
|
|
945
|
-
sha256: sha256Hex(Buffer.from(params.openPondYamlSource, "utf8")),
|
|
946
|
-
sizeBytes: Buffer.byteLength(params.openPondYamlSource, "utf8")
|
|
947
|
-
};
|
|
948
|
-
return {
|
|
949
|
-
schema: "openpond.agent.source_upload.v1",
|
|
950
|
-
sourceTreeMode: "typescript_agent_sdk",
|
|
951
|
-
packageManager,
|
|
952
|
-
sdk: {
|
|
953
|
-
packageName: "openpond-agent-sdk",
|
|
954
|
-
versionSpec: readOpenPondAgentSdkVersionSpec2(params.packageJson)
|
|
955
|
-
},
|
|
956
|
-
commands: commandHints,
|
|
957
|
-
...params.dependencySetup ? { dependencySetup: params.dependencySetup } : {},
|
|
958
|
-
...setupRequirements.length > 0 ? { setupRequirements } : {},
|
|
959
|
-
generatedManifestPath: params.generatedManifestPath,
|
|
960
|
-
synthesizedOpenPondYaml: params.synthesizedOpenPondYaml,
|
|
961
|
-
openPondYamlMode: params.synthesizedOpenPondYaml ? "synthesized" : "authored",
|
|
962
|
-
artifactHashes
|
|
963
|
-
};
|
|
964
|
-
}
|
|
965
|
-
async function collectAgentSdkGeneratedArtifactPaths(projectPath) {
|
|
966
|
-
const generatedArtifacts = /* @__PURE__ */ new Set();
|
|
967
|
-
for (const artifactPath of AGENT_SDK_GENERATED_ARTIFACTS) {
|
|
968
|
-
if (existsSync4(path4.join(projectPath, artifactPath))) {
|
|
969
|
-
generatedArtifacts.add(artifactPath);
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
for (const skillArtifactPath of await collectAgentSdkGeneratedSkillArtifactPaths(projectPath)) {
|
|
973
|
-
generatedArtifacts.add(skillArtifactPath);
|
|
974
|
-
}
|
|
975
|
-
return Array.from(generatedArtifacts).sort((left, right) => left.localeCompare(right));
|
|
976
|
-
}
|
|
977
|
-
async function collectAgentSdkGeneratedSkillArtifactPaths(projectPath) {
|
|
978
|
-
const skillsRoot = path4.join(projectPath, AGENT_SDK_GENERATED_SKILLS_DIR);
|
|
979
|
-
if (!existsSync4(skillsRoot)) return [];
|
|
980
|
-
const results = [];
|
|
981
|
-
async function visit(relativeDir) {
|
|
982
|
-
const absoluteDir = path4.join(projectPath, relativeDir);
|
|
983
|
-
const entries = await fs2.readdir(absoluteDir, { withFileTypes: true });
|
|
984
|
-
entries.sort((left, right) => left.name.localeCompare(right.name));
|
|
985
|
-
for (const entry of entries) {
|
|
986
|
-
const relativePath = path4.join(relativeDir, entry.name).replace(/\\/g, "/");
|
|
987
|
-
if (!isSafeProjectSourcePath(relativePath)) continue;
|
|
988
|
-
if (entry.isDirectory()) {
|
|
989
|
-
await visit(relativePath);
|
|
990
|
-
continue;
|
|
991
|
-
}
|
|
992
|
-
if (entry.isFile()) results.push(relativePath);
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
await visit(AGENT_SDK_GENERATED_SKILLS_DIR);
|
|
996
|
-
return results;
|
|
997
|
-
}
|
|
998
|
-
async function collectAgentSdkSourceSetupRequirements(projectPath) {
|
|
999
|
-
const requirements = [];
|
|
1000
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1001
|
-
for (const relativePath of [
|
|
1002
|
-
".openpond/action-registry.json",
|
|
1003
|
-
".openpond/agent-manifest.json"
|
|
1004
|
-
]) {
|
|
1005
|
-
const payload = await readJsonFileIfExists(path4.join(projectPath, relativePath));
|
|
1006
|
-
if (!payload) continue;
|
|
1007
|
-
for (const actionRecord of [
|
|
1008
|
-
...recordArray(payload.actions),
|
|
1009
|
-
...recordArray(payload.actionCatalog)
|
|
1010
|
-
]) {
|
|
1011
|
-
const actionId = text(actionRecord.id) ?? text(actionRecord.name);
|
|
1012
|
-
const actionName = text(actionRecord.name) ?? actionId;
|
|
1013
|
-
if (!actionId && !actionName) continue;
|
|
1014
|
-
for (const setupRecord of recordArray(actionRecord.setupRequirements)) {
|
|
1015
|
-
const setupRequirement = { ...setupRecord };
|
|
1016
|
-
if (actionId) setupRequirement.actionId = actionId;
|
|
1017
|
-
if (actionName && actionName !== actionId) setupRequirement.actionName = actionName;
|
|
1018
|
-
const key = setupRequirementIdentity(setupRequirement);
|
|
1019
|
-
if (seen.has(key)) continue;
|
|
1020
|
-
seen.add(key);
|
|
1021
|
-
requirements.push(setupRequirement);
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
return requirements;
|
|
1026
|
-
}
|
|
1027
|
-
async function readJsonFileIfExists(filePath) {
|
|
1028
|
-
try {
|
|
1029
|
-
const parsed = JSON.parse(await fs2.readFile(filePath, "utf8"));
|
|
1030
|
-
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
1031
|
-
} catch {
|
|
1032
|
-
return null;
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
function setupRequirementIdentity(record) {
|
|
1036
|
-
return [
|
|
1037
|
-
text(record.actionId) ?? "",
|
|
1038
|
-
text(record.actionName) ?? "",
|
|
1039
|
-
text(record.kind) ?? text(record.type) ?? "",
|
|
1040
|
-
text(record.label) ?? text(record.name) ?? text(record.key) ?? text(record.provider) ?? text(record.tool) ?? text(record.command) ?? text(record.packageName) ?? ""
|
|
1041
|
-
].join(":");
|
|
1042
|
-
}
|
|
1043
|
-
function readAgentSdkProjectPackageJson(projectPath) {
|
|
1044
|
-
const packageJsonPath = path4.join(projectPath, "package.json");
|
|
1045
|
-
return JSON.parse(readFileSyncUtf8(packageJsonPath));
|
|
1046
|
-
}
|
|
1047
|
-
function buildAgentSdkCommandHints(packageJson, packageManager) {
|
|
1048
|
-
return {
|
|
1049
|
-
inspect: buildAgentSdkCommandHint(
|
|
1050
|
-
packageJson,
|
|
1051
|
-
packageManager,
|
|
1052
|
-
"agent:inspect",
|
|
1053
|
-
"openpond-agent inspect --json",
|
|
1054
|
-
true
|
|
1055
|
-
),
|
|
1056
|
-
build: buildAgentSdkCommandHint(
|
|
1057
|
-
packageJson,
|
|
1058
|
-
packageManager,
|
|
1059
|
-
"agent:build",
|
|
1060
|
-
"openpond-agent build"
|
|
1061
|
-
),
|
|
1062
|
-
validate: buildAgentSdkCommandHint(
|
|
1063
|
-
packageJson,
|
|
1064
|
-
packageManager,
|
|
1065
|
-
"agent:validate",
|
|
1066
|
-
"openpond-agent validate"
|
|
1067
|
-
),
|
|
1068
|
-
eval: buildAgentSdkCommandHint(
|
|
1069
|
-
packageJson,
|
|
1070
|
-
packageManager,
|
|
1071
|
-
"agent:eval",
|
|
1072
|
-
"openpond-agent eval"
|
|
1073
|
-
)
|
|
1074
|
-
};
|
|
1075
|
-
}
|
|
1076
|
-
function buildAgentSdkCommandHint(packageJson, packageManager, scriptName, fallback, jsonOutput = false) {
|
|
1077
|
-
const scripts = packageJson.scripts;
|
|
1078
|
-
const hasScript = scripts && typeof scripts === "object" && !Array.isArray(scripts) && typeof scripts[scriptName] === "string";
|
|
1079
|
-
if (!hasScript) return fallback;
|
|
1080
|
-
return jsonOutput ? agentSdkRunJsonScriptCommand(packageManager, scriptName) : agentSdkRunScriptCommand(packageManager, scriptName);
|
|
1081
|
-
}
|
|
1082
|
-
function readOpenPondAgentSdkVersionSpec2(packageJson) {
|
|
1083
|
-
for (const key of ["dependencies", "devDependencies", "peerDependencies"]) {
|
|
1084
|
-
const dependencies = packageJson[key];
|
|
1085
|
-
if (!dependencies || typeof dependencies !== "object" || Array.isArray(dependencies)) {
|
|
1086
|
-
continue;
|
|
1087
|
-
}
|
|
1088
|
-
const value = dependencies["openpond-agent-sdk"];
|
|
1089
|
-
if (typeof value === "string" && value.trim()) return value.trim();
|
|
1090
|
-
}
|
|
1091
|
-
return null;
|
|
1092
|
-
}
|
|
1093
|
-
async function runAgentSdkProjectCheck(projectPath, commandName) {
|
|
1094
|
-
const command = resolveLocalAgentSdkCommand(projectPath);
|
|
1095
|
-
const result = await runCommand2(command.command, [...command.args, commandName, "--cwd", projectPath], {
|
|
1096
|
-
cwd: projectPath
|
|
1097
|
-
});
|
|
1098
|
-
if (result.code !== 0) {
|
|
1099
|
-
const details = [result.stderr.trim(), result.stdout.trim()].filter(Boolean).join("\n");
|
|
1100
|
-
throw new Error(
|
|
1101
|
-
`openpond agent ${commandName} failed for ${projectPath}${details ? `:
|
|
1102
|
-
${details}` : ""}`
|
|
1103
|
-
);
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
async function projectSourceUploadFileEntry(projectPath, relativePath) {
|
|
1107
|
-
const normalized = relativePath.replace(/\\/g, "/");
|
|
1108
|
-
if (!isSafeProjectSourcePath(normalized) || normalized.startsWith(".env")) {
|
|
1109
|
-
throw new Error(`unsafe generated source path: ${relativePath}`);
|
|
1110
|
-
}
|
|
1111
|
-
const absolutePath = path4.join(projectPath, normalized);
|
|
1112
|
-
const stat = await fs2.stat(absolutePath);
|
|
1113
|
-
if (!stat.isFile()) {
|
|
1114
|
-
throw new Error(`generated source path is not a file: ${relativePath}`);
|
|
1115
|
-
}
|
|
1116
|
-
if (stat.size > PROJECT_SOURCE_UPLOAD_MAX_FILE_BYTES) {
|
|
1117
|
-
throw new Error(`generated source file is too large: ${relativePath} (${stat.size} bytes)`);
|
|
1118
|
-
}
|
|
1119
|
-
return {
|
|
1120
|
-
path: normalized,
|
|
1121
|
-
type: "file",
|
|
1122
|
-
contentsBase64: Buffer.from(await fs2.readFile(absolutePath)).toString("base64")
|
|
1123
|
-
};
|
|
1124
|
-
}
|
|
1125
|
-
function projectSourceUploadTextEntry(relativePath, contents) {
|
|
1126
|
-
const normalized = relativePath.replace(/\\/g, "/");
|
|
1127
|
-
if (!isSafeProjectSourcePath(normalized) || normalized.startsWith(".env")) {
|
|
1128
|
-
throw new Error(`unsafe generated source path: ${relativePath}`);
|
|
1129
|
-
}
|
|
1130
|
-
const byteLength = Buffer.byteLength(contents, "utf8");
|
|
1131
|
-
if (byteLength > PROJECT_SOURCE_UPLOAD_MAX_FILE_BYTES) {
|
|
1132
|
-
throw new Error(`generated source file is too large: ${relativePath} (${byteLength} bytes)`);
|
|
1133
|
-
}
|
|
1134
|
-
return {
|
|
1135
|
-
path: normalized,
|
|
1136
|
-
type: "file",
|
|
1137
|
-
contentsBase64: Buffer.from(contents, "utf8").toString("base64")
|
|
1138
|
-
};
|
|
1139
|
-
}
|
|
1140
|
-
function projectSourceUploadBufferEntry(relativePath, contents) {
|
|
1141
|
-
const normalized = relativePath.replace(/\\/g, "/");
|
|
1142
|
-
if (!isSafeProjectSourcePath(normalized) || normalized.startsWith(".env")) {
|
|
1143
|
-
throw new Error(`unsafe generated source path: ${relativePath}`);
|
|
1144
|
-
}
|
|
1145
|
-
if (contents.byteLength > PROJECT_SOURCE_UPLOAD_MAX_FILE_BYTES) {
|
|
1146
|
-
throw new Error(
|
|
1147
|
-
`generated source file is too large: ${relativePath} (${contents.byteLength} bytes)`
|
|
1148
|
-
);
|
|
1149
|
-
}
|
|
1150
|
-
return {
|
|
1151
|
-
path: normalized,
|
|
1152
|
-
type: "file",
|
|
1153
|
-
contentsBase64: contents.toString("base64")
|
|
1154
|
-
};
|
|
1155
|
-
}
|
|
1156
|
-
function mergeProjectSourceUploadEntries(collected, extraEntries) {
|
|
1157
|
-
const byPath = /* @__PURE__ */ new Map();
|
|
1158
|
-
const regeneratesPnpmLock = extraEntries.some(
|
|
1159
|
-
(entry) => entry.path === "pnpm-workspace.yaml"
|
|
1160
|
-
);
|
|
1161
|
-
for (const entry of collected.entries) {
|
|
1162
|
-
if (regeneratesPnpmLock && entry.path === "pnpm-lock.yaml") continue;
|
|
1163
|
-
byPath.set(entry.path, entry);
|
|
1164
|
-
}
|
|
1165
|
-
for (const entry of extraEntries) byPath.set(entry.path, entry);
|
|
1166
|
-
const entries = Array.from(byPath.values()).sort(
|
|
1167
|
-
(left, right) => left.path.localeCompare(right.path)
|
|
1168
|
-
);
|
|
1169
|
-
const totalBytes = entries.reduce(
|
|
1170
|
-
(sum, entry) => sum + Buffer.byteLength(entry.contentsBase64, "base64"),
|
|
1171
|
-
0
|
|
1172
|
-
);
|
|
1173
|
-
if (entries.length > PROJECT_SOURCE_UPLOAD_MAX_FILES) {
|
|
1174
|
-
throw new Error(`too many source files to upload: ${entries.length} > ${PROJECT_SOURCE_UPLOAD_MAX_FILES}`);
|
|
1175
|
-
}
|
|
1176
|
-
if (totalBytes > PROJECT_SOURCE_UPLOAD_MAX_BYTES) {
|
|
1177
|
-
throw new Error(`source upload is too large: ${totalBytes} > ${PROJECT_SOURCE_UPLOAD_MAX_BYTES}`);
|
|
1178
|
-
}
|
|
1179
|
-
return {
|
|
1180
|
-
entries,
|
|
1181
|
-
fileCount: entries.length,
|
|
1182
|
-
totalBytes,
|
|
1183
|
-
limits: PROJECT_SOURCE_UPLOAD_LIMITS,
|
|
1184
|
-
transport: PROJECT_SOURCE_UPLOAD_TRANSPORT
|
|
1185
|
-
};
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
// src/cli/project-agent-inputs.ts
|
|
1189
|
-
function parseProjectSourceType(value) {
|
|
1190
|
-
const sourceType = typeof value === "string" && value.trim() ? value.trim() : "manual";
|
|
1191
|
-
if (sourceType !== "github_repo" && sourceType !== "internal_repo" && sourceType !== "template" && sourceType !== "manual") {
|
|
1192
|
-
throw new Error(
|
|
1193
|
-
"source-type must be one of github_repo, internal_repo, template, manual"
|
|
1194
|
-
);
|
|
1195
|
-
}
|
|
1196
|
-
return sourceType;
|
|
1197
|
-
}
|
|
1198
|
-
function parseAgentEntrypointScope(value) {
|
|
1199
|
-
if (value === void 0) return void 0;
|
|
1200
|
-
if (typeof value !== "string" || !value.trim()) {
|
|
1201
|
-
throw new Error("entrypoint-scope must be a non-empty value");
|
|
1202
|
-
}
|
|
1203
|
-
const scope = value.trim();
|
|
1204
|
-
if (scope !== "entire_manifest" && scope !== "start" && scope !== "action" && scope !== "service" && scope !== "schedule") {
|
|
1205
|
-
throw new Error(
|
|
1206
|
-
"entrypoint-scope must be one of entire_manifest, start, action, service, schedule"
|
|
1207
|
-
);
|
|
1208
|
-
}
|
|
1209
|
-
return scope;
|
|
1210
|
-
}
|
|
1211
|
-
function parseAgentTriggerType(value) {
|
|
1212
|
-
if (value === void 0) return void 0;
|
|
1213
|
-
if (typeof value !== "string" || !value.trim()) {
|
|
1214
|
-
throw new Error("trigger-type must be a non-empty value");
|
|
1215
|
-
}
|
|
1216
|
-
const triggerType = value.trim();
|
|
1217
|
-
if (triggerType !== "manual" && triggerType !== "schedule" && triggerType !== "endpoint" && triggerType !== "background") {
|
|
1218
|
-
throw new Error(
|
|
1219
|
-
"trigger-type must be one of manual, schedule, endpoint, background"
|
|
1220
|
-
);
|
|
1221
|
-
}
|
|
1222
|
-
return triggerType;
|
|
1223
|
-
}
|
|
1224
|
-
function parseAgentSourceMode(value, optionName = "source-mode") {
|
|
1225
|
-
if (value === void 0) return void 0;
|
|
1226
|
-
if (typeof value !== "string" || !value.trim()) {
|
|
1227
|
-
throw new Error(`${optionName} must be a non-empty value`);
|
|
1228
|
-
}
|
|
1229
|
-
const mode = value.trim();
|
|
1230
|
-
if (mode !== "latest_source" && mode !== "published_snapshot" && mode !== "auto") {
|
|
1231
|
-
throw new Error(
|
|
1232
|
-
`${optionName} must be one of latest_source, published_snapshot, auto`
|
|
1233
|
-
);
|
|
1234
|
-
}
|
|
1235
|
-
return mode;
|
|
1236
|
-
}
|
|
1237
|
-
function buildAgentSourceConfig(options) {
|
|
1238
|
-
const hasSourceMode = Object.prototype.hasOwnProperty.call(
|
|
1239
|
-
options,
|
|
1240
|
-
"sourceMode"
|
|
1241
|
-
);
|
|
1242
|
-
const mode = parseAgentSourceMode(
|
|
1243
|
-
hasSourceMode ? options.sourceMode : options.runtimeSourceMode,
|
|
1244
|
-
hasSourceMode ? "source-mode" : "runtime-source-mode"
|
|
1245
|
-
);
|
|
1246
|
-
const sourceRef = optionString(options, "sourceRef");
|
|
1247
|
-
const sourceCommitSha = optionString(options, "sourceCommitSha");
|
|
1248
|
-
const publishedSnapshotId = optionString(options, "publishedSnapshotId") || optionString(options, "snapshotId");
|
|
1249
|
-
const publishedSnapshotName = optionString(options, "publishedSnapshotName") || optionString(options, "snapshotName");
|
|
1250
|
-
const publishedSnapshotVersion = optionString(options, "publishedSnapshotVersion") || optionString(options, "snapshotVersion");
|
|
1251
|
-
const buildStatus = optionString(options, "buildStatus");
|
|
1252
|
-
const validationStatus = optionString(options, "validationStatus");
|
|
1253
|
-
const validatedAt = optionString(options, "validatedAt");
|
|
1254
|
-
const config = {
|
|
1255
|
-
...mode ? { mode } : {},
|
|
1256
|
-
...sourceRef ? { sourceRef } : {},
|
|
1257
|
-
...sourceCommitSha ? { sourceCommitSha } : {},
|
|
1258
|
-
...publishedSnapshotId ? { publishedSnapshotId } : {},
|
|
1259
|
-
...publishedSnapshotName ? { publishedSnapshotName } : {},
|
|
1260
|
-
...publishedSnapshotVersion ? { publishedSnapshotVersion } : {},
|
|
1261
|
-
...buildStatus ? { buildStatus } : {},
|
|
1262
|
-
...validationStatus ? { validationStatus } : {},
|
|
1263
|
-
...validatedAt ? { validatedAt } : {}
|
|
1264
|
-
};
|
|
1265
|
-
return Object.keys(config).length > 0 ? config : void 0;
|
|
1266
|
-
}
|
|
1267
|
-
function buildAgentSourcePolicy(options, source = "manual") {
|
|
1268
|
-
const requirePublishedSnapshot = parseBooleanOption(
|
|
1269
|
-
options.requirePublishedSnapshot
|
|
1270
|
-
);
|
|
1271
|
-
const allowLatestSource = parseBooleanOption(options.allowLatestSource);
|
|
1272
|
-
if (!requirePublishedSnapshot && !allowLatestSource && source === "manual") {
|
|
1273
|
-
return void 0;
|
|
1274
|
-
}
|
|
1275
|
-
return {
|
|
1276
|
-
source,
|
|
1277
|
-
...requirePublishedSnapshot ? { requirePublishedSnapshot } : {},
|
|
1278
|
-
...allowLatestSource || source === "diagnostic" ? { allowLatestSource: allowLatestSource || source === "diagnostic" } : {}
|
|
1279
|
-
};
|
|
1280
|
-
}
|
|
1281
|
-
function parseAgentSourceCheckKind(value) {
|
|
1282
|
-
if (value === void 0) return void 0;
|
|
1283
|
-
if (typeof value !== "string" || !value.trim()) {
|
|
1284
|
-
throw new Error("check-kind must be a non-empty value");
|
|
1285
|
-
}
|
|
1286
|
-
const checkKind = value.trim();
|
|
1287
|
-
if (checkKind !== "validate" && checkKind !== "eval" && checkKind !== "publish_review" && checkKind !== "all") {
|
|
1288
|
-
throw new Error(
|
|
1289
|
-
"check-kind must be one of validate, eval, publish_review, all"
|
|
1290
|
-
);
|
|
1291
|
-
}
|
|
1292
|
-
return checkKind;
|
|
1293
|
-
}
|
|
1294
|
-
function parseAgentSourceCheckDispatch(value, optionName = "source-check-dispatch") {
|
|
1295
|
-
if (value === void 0) return void 0;
|
|
1296
|
-
if (typeof value !== "string" || !value.trim()) {
|
|
1297
|
-
throw new Error(`${optionName} must be a non-empty value`);
|
|
1298
|
-
}
|
|
1299
|
-
const dispatch = value.trim();
|
|
1300
|
-
if (dispatch !== "request_only" && dispatch !== "coding_core") {
|
|
1301
|
-
throw new Error(
|
|
1302
|
-
`${optionName} must be one of request_only, coding_core`
|
|
1303
|
-
);
|
|
1304
|
-
}
|
|
1305
|
-
return dispatch;
|
|
1306
|
-
}
|
|
1307
|
-
function parsePositiveLimit(value) {
|
|
1308
|
-
if (value === void 0) return void 0;
|
|
1309
|
-
const parsed = parseIntegerOption(value, "limit");
|
|
1310
|
-
if (parsed === void 0) return void 0;
|
|
1311
|
-
if (parsed <= 0) throw new Error("limit must be greater than 0");
|
|
1312
|
-
return parsed;
|
|
1313
|
-
}
|
|
1314
|
-
function buildAgentSourceChecksInput(teamId, options) {
|
|
1315
|
-
const metadata = optionalJsonObject(options, "metadata", "metadata");
|
|
1316
|
-
const checkKind = parseAgentSourceCheckKind(options.checkKind);
|
|
1317
|
-
const dispatch = parseAgentSourceCheckDispatch(
|
|
1318
|
-
options.sourceCheckDispatch ?? options.dispatch
|
|
1319
|
-
);
|
|
1320
|
-
return {
|
|
1321
|
-
teamId,
|
|
1322
|
-
...optionString(options, "sourceRef") ? { sourceRef: optionString(options, "sourceRef") } : {},
|
|
1323
|
-
...optionString(options, "baseSha") ? { baseSha: optionString(options, "baseSha") } : {},
|
|
1324
|
-
...checkKind ? { checkKind } : {},
|
|
1325
|
-
...dispatch ? { dispatch } : {},
|
|
1326
|
-
...metadata ? { metadata } : {}
|
|
1327
|
-
};
|
|
1328
|
-
}
|
|
1329
|
-
function buildAgentSourcePublishInput(teamId, options) {
|
|
1330
|
-
return {
|
|
1331
|
-
teamId,
|
|
1332
|
-
...optionString(options, "expectedManifestHash") ? { expectedManifestHash: optionString(options, "expectedManifestHash") } : {},
|
|
1333
|
-
...optionString(options, "expectedSourceCommitSha") ? {
|
|
1334
|
-
expectedSourceCommitSha: optionString(
|
|
1335
|
-
options,
|
|
1336
|
-
"expectedSourceCommitSha"
|
|
1337
|
-
)
|
|
1338
|
-
} : {},
|
|
1339
|
-
...optionString(options, "evalStatus") ? { evalStatus: optionString(options, "evalStatus") } : {},
|
|
1340
|
-
...optionString(options, "taskRunId") ? { taskRunId: optionString(options, "taskRunId") } : {},
|
|
1341
|
-
...optionString(options, "traceArtifactRef") ? { traceArtifactRef: optionString(options, "traceArtifactRef") } : {},
|
|
1342
|
-
...optionString(options, "evalResultArtifactRef") ? { evalResultArtifactRef: optionString(options, "evalResultArtifactRef") } : {}
|
|
1343
|
-
};
|
|
1344
|
-
}
|
|
1345
|
-
function buildProjectUpsertInput(options) {
|
|
1346
|
-
const usage = "usage: project create --team-id <id> --name <name>";
|
|
1347
|
-
const teamId = requiredTeamId(options, usage);
|
|
1348
|
-
const name = optionString(options, "name");
|
|
1349
|
-
if (!name) {
|
|
1350
|
-
throw new Error(
|
|
1351
|
-
`${usage} [--source-type manual|github_repo|internal_repo|template]`
|
|
1352
|
-
);
|
|
1353
|
-
}
|
|
1354
|
-
const sourceType = parseProjectSourceType(options.sourceType);
|
|
1355
|
-
const repoUrl = optionString(options, "repoUrl") || optionString(options, "repo");
|
|
1356
|
-
const sourceConfig = {
|
|
1357
|
-
...optionalJsonObject(options, "sourceConfig", "source-config") ?? {},
|
|
1358
|
-
...repoUrl ? { repoUrl } : {}
|
|
1359
|
-
};
|
|
1360
|
-
const metadata = optionalJsonObject(options, "metadata", "metadata");
|
|
1361
|
-
return {
|
|
1362
|
-
teamId,
|
|
1363
|
-
name,
|
|
1364
|
-
sourceType,
|
|
1365
|
-
...optionString(options, "slug") ? { slug: optionString(options, "slug") } : {},
|
|
1366
|
-
...optionString(options, "description") ? { description: optionString(options, "description") } : {},
|
|
1367
|
-
...options.status === "active" || options.status === "disabled" || options.status === "archived" ? { status: options.status } : {},
|
|
1368
|
-
...Object.keys(sourceConfig).length > 0 ? { sourceConfig } : {},
|
|
1369
|
-
...optionString(options, "normalizedSourceIdentity") ? {
|
|
1370
|
-
normalizedSourceIdentity: optionString(
|
|
1371
|
-
options,
|
|
1372
|
-
"normalizedSourceIdentity"
|
|
1373
|
-
)
|
|
1374
|
-
} : {},
|
|
1375
|
-
...optionString(options, "externalId") ? { externalId: optionString(options, "externalId") } : {},
|
|
1376
|
-
...optionString(options, "gitProvider") ? { gitProvider: optionString(options, "gitProvider") } : {},
|
|
1377
|
-
...optionString(options, "gitHost") ? { gitHost: optionString(options, "gitHost") } : {},
|
|
1378
|
-
...optionString(options, "gitOwner") ? { gitOwner: optionString(options, "gitOwner") } : {},
|
|
1379
|
-
...optionString(options, "gitRepo") ? { gitRepo: optionString(options, "gitRepo") } : {},
|
|
1380
|
-
...optionString(options, "gitBranch") ? { gitBranch: optionString(options, "gitBranch") } : {},
|
|
1381
|
-
...optionString(options, "defaultBranch") ? { defaultBranch: optionString(options, "defaultBranch") } : {},
|
|
1382
|
-
...optionString(options, "internalRepoPath") ? { internalRepoPath: optionString(options, "internalRepoPath") } : {},
|
|
1383
|
-
...optionString(options, "templateSourceProjectId") ? {
|
|
1384
|
-
templateSourceProjectId: optionString(
|
|
1385
|
-
options,
|
|
1386
|
-
"templateSourceProjectId"
|
|
1387
|
-
)
|
|
1388
|
-
} : {},
|
|
1389
|
-
...optionString(options, "templateRepoUrl") ? { templateRepoUrl: optionString(options, "templateRepoUrl") } : {},
|
|
1390
|
-
...optionString(options, "templateBranch") ? { templateBranch: optionString(options, "templateBranch") } : {},
|
|
1391
|
-
...optionString(options, "templateRemoteSha") ? { templateRemoteSha: optionString(options, "templateRemoteSha") } : {},
|
|
1392
|
-
...metadata ? { metadata } : {}
|
|
1393
|
-
};
|
|
1394
|
-
}
|
|
1395
|
-
function buildProjectUpdateInput(teamId, options) {
|
|
1396
|
-
const repoUrl = optionString(options, "repoUrl") || optionString(options, "repo");
|
|
1397
|
-
const sourceConfig = optionalJsonObject(
|
|
1398
|
-
options,
|
|
1399
|
-
"sourceConfig",
|
|
1400
|
-
"source-config"
|
|
1401
|
-
);
|
|
1402
|
-
const metadata = optionalJsonObject(options, "metadata", "metadata");
|
|
1403
|
-
return {
|
|
1404
|
-
teamId,
|
|
1405
|
-
...optionString(options, "name") ? { name: optionString(options, "name") } : {},
|
|
1406
|
-
...optionString(options, "slug") ? { slug: optionString(options, "slug") } : {},
|
|
1407
|
-
...optionString(options, "description") ? { description: optionString(options, "description") } : {},
|
|
1408
|
-
...options.status === "active" || options.status === "disabled" || options.status === "archived" ? { status: options.status } : {},
|
|
1409
|
-
...options.sourceType !== void 0 ? { sourceType: parseProjectSourceType(options.sourceType) } : {},
|
|
1410
|
-
...sourceConfig || repoUrl ? {
|
|
1411
|
-
sourceConfig: {
|
|
1412
|
-
...sourceConfig ?? {},
|
|
1413
|
-
...repoUrl ? { repoUrl } : {}
|
|
1414
|
-
}
|
|
1415
|
-
} : {},
|
|
1416
|
-
...optionString(options, "normalizedSourceIdentity") ? {
|
|
1417
|
-
normalizedSourceIdentity: optionString(
|
|
1418
|
-
options,
|
|
1419
|
-
"normalizedSourceIdentity"
|
|
1420
|
-
)
|
|
1421
|
-
} : {},
|
|
1422
|
-
...optionString(options, "externalId") ? { externalId: optionString(options, "externalId") } : {},
|
|
1423
|
-
...optionString(options, "gitProvider") ? { gitProvider: optionString(options, "gitProvider") } : {},
|
|
1424
|
-
...optionString(options, "gitHost") ? { gitHost: optionString(options, "gitHost") } : {},
|
|
1425
|
-
...optionString(options, "gitOwner") ? { gitOwner: optionString(options, "gitOwner") } : {},
|
|
1426
|
-
...optionString(options, "gitRepo") ? { gitRepo: optionString(options, "gitRepo") } : {},
|
|
1427
|
-
...optionString(options, "gitBranch") ? { gitBranch: optionString(options, "gitBranch") } : {},
|
|
1428
|
-
...optionString(options, "defaultBranch") ? { defaultBranch: optionString(options, "defaultBranch") } : {},
|
|
1429
|
-
...optionString(options, "internalRepoPath") ? { internalRepoPath: optionString(options, "internalRepoPath") } : {},
|
|
1430
|
-
...optionString(options, "templateSourceProjectId") ? {
|
|
1431
|
-
templateSourceProjectId: optionString(
|
|
1432
|
-
options,
|
|
1433
|
-
"templateSourceProjectId"
|
|
1434
|
-
)
|
|
1435
|
-
} : {},
|
|
1436
|
-
...optionString(options, "templateRepoUrl") ? { templateRepoUrl: optionString(options, "templateRepoUrl") } : {},
|
|
1437
|
-
...optionString(options, "templateBranch") ? { templateBranch: optionString(options, "templateBranch") } : {},
|
|
1438
|
-
...optionString(options, "templateRemoteSha") ? { templateRemoteSha: optionString(options, "templateRemoteSha") } : {},
|
|
1439
|
-
...metadata ? { metadata } : {}
|
|
1440
|
-
};
|
|
1441
|
-
}
|
|
1442
|
-
function buildAgentUpsertInput(options) {
|
|
1443
|
-
const usage = "usage: agent create --team-id <id> --project-id <id> --name <name>";
|
|
1444
|
-
const teamId = requiredTeamId(options, usage);
|
|
1445
|
-
const projectId = optionString(options, "projectId");
|
|
1446
|
-
const name = optionString(options, "name");
|
|
1447
|
-
if (!projectId || !name) {
|
|
1448
|
-
throw new Error(usage);
|
|
1449
|
-
}
|
|
1450
|
-
const entrypointScope = parseAgentEntrypointScope(options.entrypointScope);
|
|
1451
|
-
const entrypointName = optionString(options, "entrypointName");
|
|
1452
|
-
const triggerType = parseAgentTriggerType(options.triggerType);
|
|
1453
|
-
const workflowMode = parseSandboxWorkflowModeOption(options.workflowMode);
|
|
1454
|
-
const promotionPolicy = parseSandboxRuntimePromotionPolicyOption(
|
|
1455
|
-
options.runtimePromotionPolicy
|
|
1456
|
-
);
|
|
1457
|
-
const agentSource = buildAgentSourceConfig(options);
|
|
1458
|
-
const metadata = optionalJsonObject(options, "metadata", "metadata");
|
|
1459
|
-
return {
|
|
1460
|
-
teamId,
|
|
1461
|
-
projectId,
|
|
1462
|
-
name,
|
|
1463
|
-
...optionString(options, "slug") ? { slug: optionString(options, "slug") } : {},
|
|
1464
|
-
...optionString(options, "description") ? { description: optionString(options, "description") } : {},
|
|
1465
|
-
...options.status === "active" || options.status === "disabled" || options.status === "archived" ? { status: options.status } : {},
|
|
1466
|
-
...entrypointScope ? {
|
|
1467
|
-
selectedEntrypoint: {
|
|
1468
|
-
scope: entrypointScope,
|
|
1469
|
-
name: entrypointName || null
|
|
1470
|
-
}
|
|
1471
|
-
} : {},
|
|
1472
|
-
...triggerType ? { triggerType } : {},
|
|
1473
|
-
...workflowMode ? { defaultWorkflowMode: workflowMode } : {},
|
|
1474
|
-
...optionString(options, "defaultBranch") ? { defaultBranch: optionString(options, "defaultBranch") } : {},
|
|
1475
|
-
...optionString(options, "sourceRefOverride") ? { sourceRefOverride: optionString(options, "sourceRefOverride") } : {},
|
|
1476
|
-
...promotionPolicy ? { defaultPromotionPolicy: promotionPolicy } : {},
|
|
1477
|
-
...agentSource ? { runtimeSource: agentSource } : {},
|
|
1478
|
-
...optionalJsonObject(options, "endpointPolicy", "endpoint-policy") ? {
|
|
1479
|
-
endpointPolicy: optionalJsonObject(
|
|
1480
|
-
options,
|
|
1481
|
-
"endpointPolicy",
|
|
1482
|
-
"endpoint-policy"
|
|
1483
|
-
)
|
|
1484
|
-
} : {},
|
|
1485
|
-
...optionalJsonObject(
|
|
1486
|
-
options,
|
|
1487
|
-
"backgroundTaskPolicy",
|
|
1488
|
-
"background-task-policy"
|
|
1489
|
-
) ? {
|
|
1490
|
-
backgroundTaskPolicy: optionalJsonObject(
|
|
1491
|
-
options,
|
|
1492
|
-
"backgroundTaskPolicy",
|
|
1493
|
-
"background-task-policy"
|
|
1494
|
-
)
|
|
1495
|
-
} : {},
|
|
1496
|
-
...optionalJsonObject(options, "resourcePolicy", "resource-policy") ? {
|
|
1497
|
-
defaultResourcePolicy: optionalJsonObject(
|
|
1498
|
-
options,
|
|
1499
|
-
"resourcePolicy",
|
|
1500
|
-
"resource-policy"
|
|
1501
|
-
)
|
|
1502
|
-
} : {},
|
|
1503
|
-
...optionalJsonObject(options, "lifecyclePolicy", "lifecycle-policy") ? {
|
|
1504
|
-
defaultLifecyclePolicy: optionalJsonObject(
|
|
1505
|
-
options,
|
|
1506
|
-
"lifecyclePolicy",
|
|
1507
|
-
"lifecycle-policy"
|
|
1508
|
-
)
|
|
1509
|
-
} : {},
|
|
1510
|
-
...optionalJsonObject(options, "checkpointPolicy", "checkpoint-policy") ? {
|
|
1511
|
-
defaultCheckpointPolicy: optionalJsonObject(
|
|
1512
|
-
options,
|
|
1513
|
-
"checkpointPolicy",
|
|
1514
|
-
"checkpoint-policy"
|
|
1515
|
-
)
|
|
1516
|
-
} : {},
|
|
1517
|
-
...parseCsvOption(options.requiredIntegrations).length > 0 ? {
|
|
1518
|
-
requiredIntegrationRefs: parseCsvOption(options.requiredIntegrations)
|
|
1519
|
-
} : {},
|
|
1520
|
-
...parseCsvOption(options.requiredEnv).length > 0 ? { requiredEnvironmentVariableRefs: parseCsvOption(options.requiredEnv) } : {},
|
|
1521
|
-
...optionalJsonObject(options, "schedulePolicy", "schedule-policy") ? {
|
|
1522
|
-
schedulePolicy: optionalJsonObject(
|
|
1523
|
-
options,
|
|
1524
|
-
"schedulePolicy",
|
|
1525
|
-
"schedule-policy"
|
|
1526
|
-
)
|
|
1527
|
-
} : {},
|
|
1528
|
-
...optionString(options, "externalId") ? { externalId: optionString(options, "externalId") } : {},
|
|
1529
|
-
...metadata ? { metadata } : {}
|
|
1530
|
-
};
|
|
1531
|
-
}
|
|
1532
|
-
function buildAgentUpdateInput(teamId, options) {
|
|
1533
|
-
const entrypointScope = parseAgentEntrypointScope(options.entrypointScope);
|
|
1534
|
-
const entrypointName = optionString(options, "entrypointName");
|
|
1535
|
-
const triggerType = parseAgentTriggerType(options.triggerType);
|
|
1536
|
-
const workflowMode = parseSandboxWorkflowModeOption(options.workflowMode);
|
|
1537
|
-
const promotionPolicy = parseSandboxRuntimePromotionPolicyOption(
|
|
1538
|
-
options.runtimePromotionPolicy
|
|
1539
|
-
);
|
|
1540
|
-
const agentSource = buildAgentSourceConfig(options);
|
|
1541
|
-
const metadata = optionalJsonObject(options, "metadata", "metadata");
|
|
1542
|
-
return {
|
|
1543
|
-
teamId,
|
|
1544
|
-
...optionString(options, "projectId") ? { projectId: optionString(options, "projectId") } : {},
|
|
1545
|
-
...optionString(options, "name") ? { name: optionString(options, "name") } : {},
|
|
1546
|
-
...optionString(options, "slug") ? { slug: optionString(options, "slug") } : {},
|
|
1547
|
-
...optionString(options, "description") ? { description: optionString(options, "description") } : {},
|
|
1548
|
-
...options.status === "active" || options.status === "disabled" || options.status === "archived" ? { status: options.status } : {},
|
|
1549
|
-
...entrypointScope ? {
|
|
1550
|
-
selectedEntrypoint: {
|
|
1551
|
-
scope: entrypointScope,
|
|
1552
|
-
name: entrypointName || null
|
|
1553
|
-
}
|
|
1554
|
-
} : {},
|
|
1555
|
-
...triggerType ? { triggerType } : {},
|
|
1556
|
-
...workflowMode ? { defaultWorkflowMode: workflowMode } : {},
|
|
1557
|
-
...optionString(options, "defaultBranch") ? { defaultBranch: optionString(options, "defaultBranch") } : {},
|
|
1558
|
-
...optionString(options, "sourceRefOverride") ? { sourceRefOverride: optionString(options, "sourceRefOverride") } : {},
|
|
1559
|
-
...promotionPolicy ? { defaultPromotionPolicy: promotionPolicy } : {},
|
|
1560
|
-
...agentSource ? { runtimeSource: agentSource } : {},
|
|
1561
|
-
...optionalJsonObject(options, "endpointPolicy", "endpoint-policy") ? {
|
|
1562
|
-
endpointPolicy: optionalJsonObject(
|
|
1563
|
-
options,
|
|
1564
|
-
"endpointPolicy",
|
|
1565
|
-
"endpoint-policy"
|
|
1566
|
-
)
|
|
1567
|
-
} : {},
|
|
1568
|
-
...optionalJsonObject(
|
|
1569
|
-
options,
|
|
1570
|
-
"backgroundTaskPolicy",
|
|
1571
|
-
"background-task-policy"
|
|
1572
|
-
) ? {
|
|
1573
|
-
backgroundTaskPolicy: optionalJsonObject(
|
|
1574
|
-
options,
|
|
1575
|
-
"backgroundTaskPolicy",
|
|
1576
|
-
"background-task-policy"
|
|
1577
|
-
)
|
|
1578
|
-
} : {},
|
|
1579
|
-
...optionalJsonObject(options, "resourcePolicy", "resource-policy") ? {
|
|
1580
|
-
defaultResourcePolicy: optionalJsonObject(
|
|
1581
|
-
options,
|
|
1582
|
-
"resourcePolicy",
|
|
1583
|
-
"resource-policy"
|
|
1584
|
-
)
|
|
1585
|
-
} : {},
|
|
1586
|
-
...optionalJsonObject(options, "lifecyclePolicy", "lifecycle-policy") ? {
|
|
1587
|
-
defaultLifecyclePolicy: optionalJsonObject(
|
|
1588
|
-
options,
|
|
1589
|
-
"lifecyclePolicy",
|
|
1590
|
-
"lifecycle-policy"
|
|
1591
|
-
)
|
|
1592
|
-
} : {},
|
|
1593
|
-
...optionalJsonObject(options, "checkpointPolicy", "checkpoint-policy") ? {
|
|
1594
|
-
defaultCheckpointPolicy: optionalJsonObject(
|
|
1595
|
-
options,
|
|
1596
|
-
"checkpointPolicy",
|
|
1597
|
-
"checkpoint-policy"
|
|
1598
|
-
)
|
|
1599
|
-
} : {},
|
|
1600
|
-
...parseCsvOption(options.requiredIntegrations).length > 0 ? {
|
|
1601
|
-
requiredIntegrationRefs: parseCsvOption(options.requiredIntegrations)
|
|
1602
|
-
} : {},
|
|
1603
|
-
...parseCsvOption(options.requiredEnv).length > 0 ? { requiredEnvironmentVariableRefs: parseCsvOption(options.requiredEnv) } : {},
|
|
1604
|
-
...optionalJsonObject(options, "schedulePolicy", "schedule-policy") ? {
|
|
1605
|
-
schedulePolicy: optionalJsonObject(
|
|
1606
|
-
options,
|
|
1607
|
-
"schedulePolicy",
|
|
1608
|
-
"schedule-policy"
|
|
1609
|
-
)
|
|
1610
|
-
} : {},
|
|
1611
|
-
...optionString(options, "externalId") ? { externalId: optionString(options, "externalId") } : {},
|
|
1612
|
-
...metadata ? { metadata } : {}
|
|
1613
|
-
};
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
export {
|
|
1617
|
-
resolveLocalAgentSdkCommand,
|
|
1618
|
-
PROJECT_SOURCE_UPLOAD_MAX_FILES,
|
|
1619
|
-
PROJECT_SOURCE_UPLOAD_MAX_FILE_BYTES,
|
|
1620
|
-
PROJECT_SOURCE_UPLOAD_MAX_BYTES,
|
|
1621
|
-
PROJECT_SOURCE_UPLOAD_CONCURRENCY,
|
|
1622
|
-
PROJECT_SOURCE_UPLOAD_LIMITS,
|
|
1623
|
-
PROJECT_SOURCE_UPLOAD_TRANSPORT,
|
|
1624
|
-
resolveProjectSourceUploadBranch,
|
|
1625
|
-
collectProjectSourceUploadEntries,
|
|
1626
|
-
collectAgentSdkProjectSourceUploadEntries,
|
|
1627
|
-
mergeProjectSourceUploadEntries,
|
|
1628
|
-
parseProjectSourceType,
|
|
1629
|
-
parseAgentEntrypointScope,
|
|
1630
|
-
parseAgentTriggerType,
|
|
1631
|
-
parseAgentSourceMode,
|
|
1632
|
-
buildAgentSourceConfig,
|
|
1633
|
-
buildAgentSourcePolicy,
|
|
1634
|
-
parseAgentSourceCheckKind,
|
|
1635
|
-
parseAgentSourceCheckDispatch,
|
|
1636
|
-
parsePositiveLimit,
|
|
1637
|
-
buildAgentSourceChecksInput,
|
|
1638
|
-
buildAgentSourcePublishInput,
|
|
1639
|
-
buildProjectUpsertInput,
|
|
1640
|
-
buildProjectUpdateInput,
|
|
1641
|
-
buildAgentUpsertInput,
|
|
1642
|
-
buildAgentUpdateInput
|
|
1643
|
-
};
|