@pipelab/cli 2.0.0-beta.13 → 2.0.0-beta.14
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/{config-BGFI4YTD.mjs → config-C2_-dWDC.mjs} +25 -19
- package/config-kWOWhsn6.mjs +4 -0
- package/index.mjs +119 -39
- package/package.json +1 -1
- package/src-D_Ep0XH3.mjs +5 -0
- package/{src-CTcX3YjS.mjs → src-IhkP0N4B.mjs} +129 -60
- package/src-XVe3IQMi.mjs +3 -0
- package/config-B6BzqMsi.mjs +0 -4
- package/src-DZNeIUut.mjs +0 -3
- package/src-DfyJc3PL.mjs +0 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as __require, s as __toESM, t as __commonJSMin } from "./chunk-M2dkpuaD.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { C as useLogger, n as normalizePipelineConfig, t as configRegistry } from "./src-IhkP0N4B.mjs";
|
|
3
3
|
import path, { dirname, join } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { constants
|
|
5
|
+
import { constants } from "node:os";
|
|
6
6
|
import { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
7
|
-
import fs$1, { mkdir,
|
|
7
|
+
import fs$1, { mkdir, readdir, stat, writeFile } from "node:fs/promises";
|
|
8
8
|
import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
9
9
|
import { StringDecoder } from "node:string_decoder";
|
|
10
10
|
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
@@ -40243,14 +40243,6 @@ const ensure = async (filesPath, defaultContent = "{}") => {
|
|
|
40243
40243
|
}
|
|
40244
40244
|
};
|
|
40245
40245
|
/**
|
|
40246
|
-
* Generates a unique temporary folder.
|
|
40247
|
-
*/
|
|
40248
|
-
const generateTempFolder = async (base) => {
|
|
40249
|
-
const targetBase = base || tmpdir();
|
|
40250
|
-
await mkdir(targetBase, { recursive: true });
|
|
40251
|
-
return await mkdtemp(join(await realpath(targetBase), "pipelab-"));
|
|
40252
|
-
};
|
|
40253
|
-
/**
|
|
40254
40246
|
* Extracts a .tar.gz archive.
|
|
40255
40247
|
*/
|
|
40256
40248
|
async function extractTarGz(archivePath, destinationDir) {
|
|
@@ -40336,8 +40328,7 @@ async function getFolderSize(dirPath) {
|
|
|
40336
40328
|
//#endregion
|
|
40337
40329
|
//#region ../../packages/core-node/src/config.ts
|
|
40338
40330
|
const getMigrator = (name) => {
|
|
40339
|
-
|
|
40340
|
-
if (name.startsWith("pipeline-") || path.isAbsolute(name) || name.endsWith(".json")) return configRegistry["pipeline"];
|
|
40331
|
+
return configRegistry[name] || configRegistry["pipeline"];
|
|
40341
40332
|
};
|
|
40342
40333
|
const setupConfigFile = async (name, options) => {
|
|
40343
40334
|
const ctx = options.context;
|
|
@@ -40369,8 +40360,9 @@ const setupConfigFile = async (name, options) => {
|
|
|
40369
40360
|
parseFailed = true;
|
|
40370
40361
|
}
|
|
40371
40362
|
let json = void 0;
|
|
40363
|
+
let migrationFailed = false;
|
|
40372
40364
|
try {
|
|
40373
|
-
json = await migrator.migrate(originalJson, {
|
|
40365
|
+
if (!parseFailed) json = await migrator.migrate(originalJson, {
|
|
40374
40366
|
debug: false,
|
|
40375
40367
|
onStep: async (state, version) => {
|
|
40376
40368
|
const parsedPath = path.parse(filesPath);
|
|
@@ -40383,20 +40375,34 @@ const setupConfigFile = async (name, options) => {
|
|
|
40383
40375
|
}
|
|
40384
40376
|
}
|
|
40385
40377
|
});
|
|
40378
|
+
else json = migrator.defaultValue;
|
|
40386
40379
|
} catch (e) {
|
|
40387
40380
|
logger().error(`Error migrating config ${name}:`, e);
|
|
40381
|
+
migrationFailed = true;
|
|
40388
40382
|
json = migrator.defaultValue;
|
|
40389
40383
|
}
|
|
40390
40384
|
let normalized = false;
|
|
40391
40385
|
if (name.startsWith("pipeline-") || path.isAbsolute(name) || name.endsWith(".json") || name === "pipeline") normalized = normalizePipelineConfig(json);
|
|
40392
|
-
if (originalJson?.version !== json?.version || normalized || content === void 0 || parseFailed)
|
|
40393
|
-
|
|
40394
|
-
|
|
40395
|
-
|
|
40386
|
+
if (originalJson?.version !== json?.version || normalized || content === void 0 || parseFailed || migrationFailed) {
|
|
40387
|
+
if (parseFailed || migrationFailed) try {
|
|
40388
|
+
const parsedPath = path.parse(filesPath);
|
|
40389
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
40390
|
+
const corruptedPath = path.join(parsedPath.dir, `${parsedPath.name}.corrupted.${timestamp}.json`);
|
|
40391
|
+
const backupContent = parseFailed ? content || "" : JSON.stringify(originalJson, null, 2);
|
|
40392
|
+
await fs$1.writeFile(corruptedPath, backupContent);
|
|
40393
|
+
logger().info(`Corrupted config file preserved at ${corruptedPath}`);
|
|
40394
|
+
} catch (e) {
|
|
40395
|
+
logger().error(`Failed to backup corrupted config ${name}:`, e);
|
|
40396
|
+
}
|
|
40397
|
+
try {
|
|
40398
|
+
await fs$1.writeFile(filesPath, JSON.stringify(json));
|
|
40399
|
+
} catch (e) {
|
|
40400
|
+
logger().error(`Error saving migrated config ${name}:`, e);
|
|
40401
|
+
}
|
|
40396
40402
|
}
|
|
40397
40403
|
return json;
|
|
40398
40404
|
}
|
|
40399
40405
|
};
|
|
40400
40406
|
};
|
|
40401
40407
|
//#endregion
|
|
40402
|
-
export { extractTarGz as a,
|
|
40408
|
+
export { extractTarGz as a, require_commonjs$2 as c, ensure as i, require_balanced_match as l, setupConfigFile as n, extractZip as o, downloadFile as r, getFolderSize as s, getMigrator as t, execa as u };
|
package/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { a as __require, n as __esmMin, s as __toESM, t as __commonJSMin } from "./chunk-M2dkpuaD.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { C as useLogger, _ as processGraph, a as isWebSocketRequestMessage, c as isSupabaseAvailable, d as usePlugins, i as WebSocketError, l as supabase, o as isRequired, r as savedFileMigrator, s as transformUrl, u as SubscriptionRequiredError } from "./src-IhkP0N4B.mjs";
|
|
4
4
|
import "./dist-BC_B45iu.mjs";
|
|
5
|
-
import { a as extractTarGz, c as
|
|
5
|
+
import { a as extractTarGz, c as require_commonjs$8, l as require_balanced_match, n as setupConfigFile, o as extractZip, r as downloadFile, s as getFolderSize, t as getMigrator, u as execa } from "./config-C2_-dWDC.mjs";
|
|
6
6
|
import path, { delimiter, dirname, isAbsolute, join, normalize, resolve, sep } from "node:path";
|
|
7
7
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
8
|
-
import { homedir, platform, release
|
|
8
|
+
import { homedir, platform, release } from "node:os";
|
|
9
9
|
import fs, { createReadStream, existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
10
|
+
import fs$1, { access, chmod, cp, mkdir, mkdtemp, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
10
11
|
import http from "http";
|
|
11
12
|
import http$1 from "node:http";
|
|
12
13
|
import { webcrypto } from "node:crypto";
|
|
13
14
|
import { dirname as dirname$1, isAbsolute as isAbsolute$1, posix, relative, sep as sep$1 } from "path";
|
|
14
|
-
import fs$1, { access, chmod, cp, mkdir, readFile, readdir, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
15
15
|
import { execFile } from "node:child_process";
|
|
16
16
|
import { promisify, stripVTControlCharacters, styleText } from "node:util";
|
|
17
17
|
import P, { platform as platform$1, stdin, stdout } from "node:process";
|
|
@@ -28,9 +28,23 @@ var init_esm_shims = __esmMin((() => {
|
|
|
28
28
|
__dirname$1 = /* @__PURE__ */ getDirname();
|
|
29
29
|
}));
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region ../../packages/
|
|
31
|
+
//#region ../../packages/constants/src/index.ts
|
|
32
32
|
init_esm_shims();
|
|
33
|
-
const
|
|
33
|
+
const websocketPort = 33753;
|
|
34
|
+
const SandboxFolder = {
|
|
35
|
+
Packages: "packages",
|
|
36
|
+
ThirdParty: "thirdparty",
|
|
37
|
+
Config: "config",
|
|
38
|
+
Temp: "temp",
|
|
39
|
+
Cache: "cache",
|
|
40
|
+
Pnpm: "pnpm"
|
|
41
|
+
};
|
|
42
|
+
const DEFAULT_NODE_VERSION = "24.14.1";
|
|
43
|
+
const DEFAULT_PNPM_VERSION = "10.12.0";
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region ../../packages/core-node/src/context.ts
|
|
46
|
+
const metaUrl = typeof import.meta !== "undefined" ? import.meta.url : void 0;
|
|
47
|
+
const _dirname = typeof __dirname$1 !== "undefined" ? __dirname$1 : metaUrl ? dirname(fileURLToPath(metaUrl)) : process.cwd();
|
|
34
48
|
const getDefaultUserDataPath$1 = (env) => {
|
|
35
49
|
const base = (() => {
|
|
36
50
|
switch (platform()) {
|
|
@@ -70,6 +84,59 @@ var PipelabContext = class {
|
|
|
70
84
|
getConfigPath(...subpaths) {
|
|
71
85
|
return join(this.userDataPath, "config", ...subpaths);
|
|
72
86
|
}
|
|
87
|
+
getTempPath(...subpaths) {
|
|
88
|
+
return join(this.userDataPath, "temp", ...subpaths);
|
|
89
|
+
}
|
|
90
|
+
async createTempFolder(prefix = "pipelab-") {
|
|
91
|
+
const baseDir = this.getTempPath();
|
|
92
|
+
await mkdir(baseDir, { recursive: true });
|
|
93
|
+
return await mkdtemp(join(await realpath(baseDir), prefix));
|
|
94
|
+
}
|
|
95
|
+
getCachePath(...subpaths) {
|
|
96
|
+
return join(this.userDataPath, "cache", ...subpaths);
|
|
97
|
+
}
|
|
98
|
+
getPnpmPath(...subpaths) {
|
|
99
|
+
return join(this.userDataPath, "pnpm", ...subpaths);
|
|
100
|
+
}
|
|
101
|
+
getNodePath(version = DEFAULT_NODE_VERSION) {
|
|
102
|
+
const isWindows = process.platform === "win32";
|
|
103
|
+
return this.getThirdPartyPath("node", version, isWindows ? "node.exe" : "bin/node");
|
|
104
|
+
}
|
|
105
|
+
getPnpmBinPath(version = DEFAULT_PNPM_VERSION) {
|
|
106
|
+
return this.getPackagesPath("pnpm", version, "bin", "pnpm.cjs");
|
|
107
|
+
}
|
|
108
|
+
getSandboxFolders() {
|
|
109
|
+
const foldersRecord = {
|
|
110
|
+
[SandboxFolder.Packages]: {
|
|
111
|
+
label: "Packages",
|
|
112
|
+
path: this.getPackagesPath()
|
|
113
|
+
},
|
|
114
|
+
[SandboxFolder.ThirdParty]: {
|
|
115
|
+
label: "Third-Party Tools",
|
|
116
|
+
path: this.getThirdPartyPath()
|
|
117
|
+
},
|
|
118
|
+
[SandboxFolder.Config]: {
|
|
119
|
+
label: "Configuration",
|
|
120
|
+
path: this.getConfigPath()
|
|
121
|
+
},
|
|
122
|
+
[SandboxFolder.Temp]: {
|
|
123
|
+
label: "Temporary Files",
|
|
124
|
+
path: this.getTempPath()
|
|
125
|
+
},
|
|
126
|
+
[SandboxFolder.Cache]: {
|
|
127
|
+
label: "Cache",
|
|
128
|
+
path: this.getCachePath()
|
|
129
|
+
},
|
|
130
|
+
[SandboxFolder.Pnpm]: {
|
|
131
|
+
label: "PNPM Home",
|
|
132
|
+
path: this.getPnpmPath()
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
return Object.keys(foldersRecord).map((key) => ({
|
|
136
|
+
name: key,
|
|
137
|
+
...foldersRecord[key]
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
73
140
|
};
|
|
74
141
|
//#endregion
|
|
75
142
|
//#region ../../packages/core-node/node_modules/ws/lib/constants.js
|
|
@@ -3629,9 +3696,6 @@ const useAPI = () => {
|
|
|
3629
3696
|
};
|
|
3630
3697
|
};
|
|
3631
3698
|
//#endregion
|
|
3632
|
-
//#region ../../packages/constants/src/index.ts
|
|
3633
|
-
const websocketPort = 33753;
|
|
3634
|
-
//#endregion
|
|
3635
3699
|
//#region ../../packages/core-node/src/websocket-server.ts
|
|
3636
3700
|
var WebSocketServer = class {
|
|
3637
3701
|
wss = null;
|
|
@@ -4431,6 +4495,15 @@ var BuildHistoryStorage = class {
|
|
|
4431
4495
|
const files = await this.getAllPipelineFiles();
|
|
4432
4496
|
const diskSpace = await checkDiskSpace(this.context.userDataPath);
|
|
4433
4497
|
const pipelabSize = await getFolderSize(this.context.userDataPath);
|
|
4498
|
+
const folders = [];
|
|
4499
|
+
for (const folder of this.context.getSandboxFolders()) {
|
|
4500
|
+
const size = await getFolderSize(folder.path);
|
|
4501
|
+
folders.push({
|
|
4502
|
+
name: folder.name,
|
|
4503
|
+
label: folder.label,
|
|
4504
|
+
size
|
|
4505
|
+
});
|
|
4506
|
+
}
|
|
4434
4507
|
const policy = (await (await setupConfigFile("settings", { context: this.context })).getConfig())?.buildHistory?.retentionPolicy || {
|
|
4435
4508
|
enabled: false,
|
|
4436
4509
|
maxEntries: 50,
|
|
@@ -4449,7 +4522,8 @@ var BuildHistoryStorage = class {
|
|
|
4449
4522
|
disk: {
|
|
4450
4523
|
total: diskSpace.size,
|
|
4451
4524
|
free: diskSpace.free,
|
|
4452
|
-
pipelab: pipelabSize
|
|
4525
|
+
pipelab: pipelabSize,
|
|
4526
|
+
folders
|
|
4453
4527
|
}
|
|
4454
4528
|
};
|
|
4455
4529
|
let totalSize = 0;
|
|
@@ -4477,7 +4551,8 @@ var BuildHistoryStorage = class {
|
|
|
4477
4551
|
disk: {
|
|
4478
4552
|
total: diskSpace.size,
|
|
4479
4553
|
free: diskSpace.free,
|
|
4480
|
-
pipelab: pipelabSize
|
|
4554
|
+
pipelab: pipelabSize,
|
|
4555
|
+
folders
|
|
4481
4556
|
}
|
|
4482
4557
|
};
|
|
4483
4558
|
} catch (error) {
|
|
@@ -4789,7 +4864,7 @@ const registerHistoryHandlers = (context) => {
|
|
|
4789
4864
|
}
|
|
4790
4865
|
}
|
|
4791
4866
|
};
|
|
4792
|
-
await settings.
|
|
4867
|
+
await settings.setConfig(newConfig);
|
|
4793
4868
|
send({
|
|
4794
4869
|
type: "end",
|
|
4795
4870
|
data: {
|
|
@@ -25904,9 +25979,9 @@ var require_protected = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
25904
25979
|
//#region ../../node_modules/pacote/lib/util/cache-dir.js
|
|
25905
25980
|
var require_cache_dir = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
25906
25981
|
const { resolve: resolve$7 } = __require("node:path");
|
|
25907
|
-
const { tmpdir
|
|
25982
|
+
const { tmpdir, homedir: homedir$1 } = __require("node:os");
|
|
25908
25983
|
module.exports = (fakePlatform = false) => {
|
|
25909
|
-
const temp = tmpdir
|
|
25984
|
+
const temp = tmpdir();
|
|
25910
25985
|
const uidOrPid = process.getuid ? process.getuid() : process.pid;
|
|
25911
25986
|
const home = homedir$1() || resolve$7(temp, "npm-" + uidOrPid);
|
|
25912
25987
|
const platform = fakePlatform || process.platform;
|
|
@@ -66444,10 +66519,7 @@ function registerMigrationHandlers(context) {
|
|
|
66444
66519
|
const { config: name } = value;
|
|
66445
66520
|
logger().info("[CLI Migration] config:load", name);
|
|
66446
66521
|
try {
|
|
66447
|
-
|
|
66448
|
-
if (name === "projects") migrator = fileRepoMigrations;
|
|
66449
|
-
else if (name === "settings") migrator = appSettingsMigrator;
|
|
66450
|
-
else if (name.startsWith("pipeline-") || name.endsWith(".plb")) migrator = savedFileMigrator;
|
|
66522
|
+
const migrator = getMigrator(name);
|
|
66451
66523
|
if (!migrator) throw new Error(`No migrator found for configuration: ${name}. All files loaded via config:load MUST have a migration schema.`);
|
|
66452
66524
|
send({
|
|
66453
66525
|
type: "end",
|
|
@@ -66543,8 +66615,6 @@ async function serveCommand(options, version, _dirname) {
|
|
|
66543
66615
|
}
|
|
66544
66616
|
//#endregion
|
|
66545
66617
|
//#region ../../packages/core-node/src/utils/remote.ts
|
|
66546
|
-
const DEFAULT_NODE_VERSION = "24.14.1";
|
|
66547
|
-
const DEFAULT_PNPM_VERSION = "10.12.0";
|
|
66548
66618
|
function isPackageComplete(packageDir) {
|
|
66549
66619
|
return existsSync(join(packageDir, "package.json"));
|
|
66550
66620
|
}
|
|
@@ -66723,7 +66793,7 @@ async function ensureNodeJS(context, version = DEFAULT_NODE_VERSION) {
|
|
|
66723
66793
|
const extension = isWindows ? "zip" : "tar.gz";
|
|
66724
66794
|
const fileName = `node-v${version}-${platform === "osx" ? "darwin" : platform}-${arch}.${extension}`;
|
|
66725
66795
|
const downloadUrl = `https://nodejs.org/dist/v${version}/${fileName}`;
|
|
66726
|
-
const tempDir = await
|
|
66796
|
+
const tempDir = await context.createTempFolder("node-download-");
|
|
66727
66797
|
const archivePath = join(tempDir, fileName);
|
|
66728
66798
|
sendStartupProgress(`Downloading Node.js v${version}...`);
|
|
66729
66799
|
console.log(`Downloading Node.js from ${downloadUrl}...`);
|
|
@@ -67117,9 +67187,9 @@ const builtInPlugins = async (options) => {
|
|
|
67117
67187
|
const envStart = Date.now();
|
|
67118
67188
|
await Promise.all([ensureNodeJS(options.context), ensurePNPM(options.context)]);
|
|
67119
67189
|
console.log(`[Plugins] Environment preparation took ${Date.now() - envStart}ms`);
|
|
67120
|
-
const { usePlugins } = await import("./src-
|
|
67190
|
+
const { usePlugins } = await import("./src-XVe3IQMi.mjs");
|
|
67121
67191
|
const { registerPlugins } = usePlugins();
|
|
67122
|
-
const { webSocketServer } = await import("./src-
|
|
67192
|
+
const { webSocketServer } = await import("./src-D_Ep0XH3.mjs");
|
|
67123
67193
|
(async () => {
|
|
67124
67194
|
const totalStart = Date.now();
|
|
67125
67195
|
const pluginsToLoad = /* @__PURE__ */ new Map();
|
|
@@ -67138,7 +67208,7 @@ const builtInPlugins = async (options) => {
|
|
|
67138
67208
|
"@pipelab/plugin-netlify"
|
|
67139
67209
|
]) pluginsToLoad.set(name, "latest");
|
|
67140
67210
|
try {
|
|
67141
|
-
const { setupConfigFile } = await import("./config-
|
|
67211
|
+
const { setupConfigFile } = await import("./config-kWOWhsn6.mjs");
|
|
67142
67212
|
const settingsPlugins = (await (await setupConfigFile("settings", { context: options.context })).getConfig())?.plugins || [];
|
|
67143
67213
|
for (const plugin of settingsPlugins) if (plugin.name) if (plugin.enabled) {
|
|
67144
67214
|
if (!pluginsToLoad.has(plugin.name)) pluginsToLoad.set(plugin.name, "latest");
|
|
@@ -67167,7 +67237,6 @@ const builtInPlugins = async (options) => {
|
|
|
67167
67237
|
webSocketServer.broadcast("startup:progress", { type: "ready" });
|
|
67168
67238
|
}, 2e3);
|
|
67169
67239
|
})();
|
|
67170
|
-
return [];
|
|
67171
67240
|
};
|
|
67172
67241
|
//#endregion
|
|
67173
67242
|
//#region ../../packages/core-node/src/utils.ts
|
|
@@ -67223,7 +67292,7 @@ const executeGraphWithHistory = async ({ graph, variables, projectName, projectP
|
|
|
67223
67292
|
const shouldDisableHistory = process.env.PIPELAB_DISABLE_HISTORY === "true";
|
|
67224
67293
|
if (!shouldDisableHistory) await buildHistoryStorage.save(initialEntry);
|
|
67225
67294
|
const logs = [];
|
|
67226
|
-
const sandboxPath = await
|
|
67295
|
+
const sandboxPath = await ctx.createTempFolder("pipeline-sandbox-");
|
|
67227
67296
|
const { logger } = useLogger();
|
|
67228
67297
|
let completedSteps = 0;
|
|
67229
67298
|
const { registerPlugins, plugins: registeredPlugins } = usePlugins();
|
|
@@ -67689,8 +67758,9 @@ const registerEngineHandlers = (context) => {
|
|
|
67689
67758
|
};
|
|
67690
67759
|
handle("action:execute", async (event, { send, value }) => {
|
|
67691
67760
|
const { nodeId, params, pluginId } = value;
|
|
67692
|
-
|
|
67693
|
-
const
|
|
67761
|
+
await (await setupConfigFile("settings", { context })).getConfig();
|
|
67762
|
+
const cachePath = join(context.userDataPath, "cache", "actions", pluginId, nodeId);
|
|
67763
|
+
const cwd = await context.createTempFolder("action-execute-");
|
|
67694
67764
|
const mainWindow = void 0;
|
|
67695
67765
|
abortControllerGraph = new AbortController();
|
|
67696
67766
|
const signalPromise = new Promise((resolve, reject) => {
|
|
@@ -67729,11 +67799,11 @@ const registerEngineHandlers = (context) => {
|
|
|
67729
67799
|
});
|
|
67730
67800
|
handle("graph:execute", async (event, { send, value }) => {
|
|
67731
67801
|
const { graph, variables, projectName, projectPath, pipelineId } = value;
|
|
67732
|
-
|
|
67802
|
+
await (await setupConfigFile("settings", { context })).getConfig();
|
|
67733
67803
|
const effectiveProjectName = projectName || "Unnamed Project";
|
|
67734
67804
|
const effectiveProjectPath = projectPath || "";
|
|
67735
67805
|
const effectivePipelineId = pipelineId || "unknown";
|
|
67736
|
-
const effectiveCachePath =
|
|
67806
|
+
const effectiveCachePath = join(context.userDataPath, "cache", effectivePipelineId);
|
|
67737
67807
|
const mainWindow = void 0;
|
|
67738
67808
|
abortControllerGraph = new AbortController();
|
|
67739
67809
|
try {
|
|
@@ -68216,14 +68286,11 @@ const registerPluginsHandlers = (context) => {
|
|
|
68216
68286
|
}
|
|
68217
68287
|
});
|
|
68218
68288
|
handle("plugin:ensure-loaded", async (_, { send, value }) => {
|
|
68219
|
-
const {
|
|
68289
|
+
const { plugins } = value;
|
|
68220
68290
|
const { plugins: registeredPlugins, registerPlugins } = usePlugins();
|
|
68221
68291
|
const loaded = [];
|
|
68222
68292
|
const failed = [];
|
|
68223
68293
|
const pluginsToEnsure = /* @__PURE__ */ new Set();
|
|
68224
|
-
if (Array.isArray(pluginIds)) {
|
|
68225
|
-
for (const id of pluginIds) if (id) pluginsToEnsure.add(id);
|
|
68226
|
-
}
|
|
68227
68294
|
if (plugins && typeof plugins === "object") {
|
|
68228
68295
|
for (const id of Object.keys(plugins)) if (id) pluginsToEnsure.add(id);
|
|
68229
68296
|
}
|
|
@@ -68376,7 +68443,7 @@ async function runPipelineCommand(file, options, version) {
|
|
|
68376
68443
|
}
|
|
68377
68444
|
//#endregion
|
|
68378
68445
|
//#region package.json
|
|
68379
|
-
var version$2 = "2.0.0-beta.
|
|
68446
|
+
var version$2 = "2.0.0-beta.14";
|
|
68380
68447
|
//#endregion
|
|
68381
68448
|
//#region src/paths.ts
|
|
68382
68449
|
const getDefaultUserDataPath = () => {
|
|
@@ -68436,7 +68503,7 @@ async function usageCommand(options) {
|
|
|
68436
68503
|
"Oldest Entry": info.oldestEntry ? new Date(info.oldestEntry).toLocaleString() : "N/A",
|
|
68437
68504
|
"Newest Entry": info.newestEntry ? new Date(info.newestEntry).toLocaleString() : "N/A",
|
|
68438
68505
|
"User Data Path": info.userDataPath,
|
|
68439
|
-
"Cache Path": info.
|
|
68506
|
+
"Cache Path": join(info.userDataPath, "build-history")
|
|
68440
68507
|
});
|
|
68441
68508
|
console.log("\nRetention Policy:");
|
|
68442
68509
|
console.table({
|
|
@@ -69845,10 +69912,13 @@ async function setupCommand(options) {
|
|
|
69845
69912
|
pt("Setup aborted.");
|
|
69846
69913
|
process.exit(0);
|
|
69847
69914
|
}
|
|
69915
|
+
const theme = configChanges.theme === "light" ? "light" : "dark";
|
|
69916
|
+
const localeValue = configChanges.locale;
|
|
69917
|
+
const locale = isLocale(localeValue) ? localeValue : "en-US";
|
|
69848
69918
|
await settings.setConfig({
|
|
69849
69919
|
...config,
|
|
69850
|
-
theme
|
|
69851
|
-
locale
|
|
69920
|
+
theme,
|
|
69921
|
+
locale
|
|
69852
69922
|
});
|
|
69853
69923
|
const integrations = await yt({
|
|
69854
69924
|
message: "Which integrations would you like to enable?",
|
|
@@ -69879,6 +69949,16 @@ async function setupCommand(options) {
|
|
|
69879
69949
|
wt(`You're all set! You can now use Pipelab CLI to manage your automation.\n\nType 'pipelab --help' to get started.`, "Setup Complete");
|
|
69880
69950
|
gt("Happy automating! 🚀");
|
|
69881
69951
|
}
|
|
69952
|
+
function isLocale(value) {
|
|
69953
|
+
return typeof value === "string" && [
|
|
69954
|
+
"en-US",
|
|
69955
|
+
"fr-FR",
|
|
69956
|
+
"pt-BR",
|
|
69957
|
+
"zh-CN",
|
|
69958
|
+
"es-ES",
|
|
69959
|
+
"de-DE"
|
|
69960
|
+
].includes(value);
|
|
69961
|
+
}
|
|
69882
69962
|
(/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
69883
69963
|
const fs$3 = __require("fs");
|
|
69884
69964
|
const path$2 = __require("path");
|
|
@@ -76439,4 +76519,4 @@ program.hook("postAction", (thisCommand) => {
|
|
|
76439
76519
|
program.parse(process.argv);
|
|
76440
76520
|
if (!process.argv.slice(2).length) program.outputHelp();
|
|
76441
76521
|
//#endregion
|
|
76442
|
-
export {
|
|
76522
|
+
export { PipelabContext as A, BuildHistoryStorage as C, WebSocketServer as D, registerShellHandlers as E, projectRoot as M, webSocketServer as O, registerHistoryHandlers as S, registerFsHandlers as T, runPnpm as _, executeGraphWithHistory as a, serveCommand as b, findInstalledPlugins as c, handleActionExecute as d, ensureNodeJS as f, fetchPipelabPlugin as g, fetchPipelabAsset as h, registerEngineHandlers as i, getDefaultUserDataPath$1 as j, useAPI as k, loadCustomPlugin as l, fetchPackage as m, registerAllHandlers as n, getFinalPlugins as o, ensurePNPM as p, registerAgentsHandlers as r, builtInPlugins as s, runPipelineCommand as t, loadPipelabPlugin as u, sendStartupProgress as v, registerConfigHandlers as w, registerMigrationHandlers as x, sendStartupReady as y };
|
package/package.json
CHANGED
package/src-D_Ep0XH3.mjs
ADDED
|
@@ -1580,6 +1580,56 @@ function literal(literal_, message) {
|
|
|
1580
1580
|
}
|
|
1581
1581
|
};
|
|
1582
1582
|
}
|
|
1583
|
+
function looseObject(entries, message) {
|
|
1584
|
+
return {
|
|
1585
|
+
kind: "schema",
|
|
1586
|
+
type: "loose_object",
|
|
1587
|
+
reference: looseObject,
|
|
1588
|
+
expects: "Object",
|
|
1589
|
+
async: false,
|
|
1590
|
+
entries,
|
|
1591
|
+
message,
|
|
1592
|
+
_run(dataset, config2) {
|
|
1593
|
+
const input = dataset.value;
|
|
1594
|
+
if (input && typeof input === "object") {
|
|
1595
|
+
dataset.typed = true;
|
|
1596
|
+
dataset.value = {};
|
|
1597
|
+
for (const key in this.entries) {
|
|
1598
|
+
const value2 = input[key];
|
|
1599
|
+
const valueDataset = this.entries[key]._run({
|
|
1600
|
+
typed: false,
|
|
1601
|
+
value: value2
|
|
1602
|
+
}, config2);
|
|
1603
|
+
if (valueDataset.issues) {
|
|
1604
|
+
const pathItem = {
|
|
1605
|
+
type: "object",
|
|
1606
|
+
origin: "value",
|
|
1607
|
+
input,
|
|
1608
|
+
key,
|
|
1609
|
+
value: value2
|
|
1610
|
+
};
|
|
1611
|
+
for (const issue of valueDataset.issues) {
|
|
1612
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
1613
|
+
else issue.path = [pathItem];
|
|
1614
|
+
dataset.issues?.push(issue);
|
|
1615
|
+
}
|
|
1616
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1617
|
+
if (config2.abortEarly) {
|
|
1618
|
+
dataset.typed = false;
|
|
1619
|
+
break;
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
if (!valueDataset.typed) dataset.typed = false;
|
|
1623
|
+
if (valueDataset.value !== void 0 || key in input) dataset.value[key] = valueDataset.value;
|
|
1624
|
+
}
|
|
1625
|
+
if (!dataset.issues || !config2.abortEarly) {
|
|
1626
|
+
for (const key in input) if (_isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
|
|
1627
|
+
}
|
|
1628
|
+
} else _addIssue(this, "type", dataset, config2);
|
|
1629
|
+
return dataset;
|
|
1630
|
+
}
|
|
1631
|
+
};
|
|
1632
|
+
}
|
|
1583
1633
|
function number(message) {
|
|
1584
1634
|
return {
|
|
1585
1635
|
kind: "schema",
|
|
@@ -2051,7 +2101,7 @@ const defaultAppSettings = settingsMigratorInternal.createDefault({
|
|
|
2051
2101
|
plugins: DEFAULT_PLUGINS,
|
|
2052
2102
|
isInternalMigrationBannerClosed: false
|
|
2053
2103
|
});
|
|
2054
|
-
const appSettingsMigrator
|
|
2104
|
+
const appSettingsMigrator = settingsMigratorInternal.createMigrations({
|
|
2055
2105
|
defaultValue: defaultAppSettings,
|
|
2056
2106
|
migrations: [
|
|
2057
2107
|
createMigration({
|
|
@@ -2120,6 +2170,18 @@ const appSettingsMigrator$1 = settingsMigratorInternal.createMigrations({
|
|
|
2120
2170
|
})
|
|
2121
2171
|
]
|
|
2122
2172
|
});
|
|
2173
|
+
const connectionsMigratorInternal = createMigrator();
|
|
2174
|
+
const defaultConnections = connectionsMigratorInternal.createDefault({
|
|
2175
|
+
version: "1.0.0",
|
|
2176
|
+
connections: []
|
|
2177
|
+
});
|
|
2178
|
+
const connectionsMigrator = connectionsMigratorInternal.createMigrations({
|
|
2179
|
+
defaultValue: defaultConnections,
|
|
2180
|
+
migrations: [createMigration({
|
|
2181
|
+
version: "1.0.0",
|
|
2182
|
+
up: finalVersion
|
|
2183
|
+
})]
|
|
2184
|
+
});
|
|
2123
2185
|
const fileRepoMigratorInternal = createMigrator();
|
|
2124
2186
|
const defaultFileRepo = fileRepoMigratorInternal.createDefault({
|
|
2125
2187
|
version: "2.0.0",
|
|
@@ -2130,7 +2192,7 @@ const defaultFileRepo = fileRepoMigratorInternal.createDefault({
|
|
|
2130
2192
|
}],
|
|
2131
2193
|
pipelines: []
|
|
2132
2194
|
});
|
|
2133
|
-
const fileRepoMigrations
|
|
2195
|
+
const fileRepoMigrations = fileRepoMigratorInternal.createMigrations({
|
|
2134
2196
|
defaultValue: defaultFileRepo,
|
|
2135
2197
|
migrations: [createMigration({
|
|
2136
2198
|
version: "1.0.0",
|
|
@@ -2281,10 +2343,7 @@ const LEGACY_ID_MAP = {
|
|
|
2281
2343
|
};
|
|
2282
2344
|
const getStrictPluginId = (pluginId) => {
|
|
2283
2345
|
if (!pluginId) return pluginId;
|
|
2284
|
-
|
|
2285
|
-
if (pluginId.startsWith("@") || pluginId.includes("/") || pluginId.startsWith("pipelab-plugin-")) return pluginId;
|
|
2286
|
-
const prefixed = `@pipelab/plugin-${pluginId}`;
|
|
2287
|
-
return LEGACY_ID_MAP[prefixed] || prefixed;
|
|
2346
|
+
return LEGACY_ID_MAP[pluginId] || pluginId;
|
|
2288
2347
|
};
|
|
2289
2348
|
const normalizeBlockPluginId = (block) => {
|
|
2290
2349
|
if (!block) return false;
|
|
@@ -2312,10 +2371,57 @@ const normalizePipelineConfig$1 = (state) => {
|
|
|
2312
2371
|
return changed;
|
|
2313
2372
|
};
|
|
2314
2373
|
const configRegistry$1 = {
|
|
2315
|
-
settings: appSettingsMigrator
|
|
2316
|
-
projects: fileRepoMigrations
|
|
2317
|
-
pipeline: savedFileMigrator$1
|
|
2374
|
+
settings: appSettingsMigrator,
|
|
2375
|
+
projects: fileRepoMigrations,
|
|
2376
|
+
pipeline: savedFileMigrator$1,
|
|
2377
|
+
connections: connectionsMigrator
|
|
2318
2378
|
};
|
|
2379
|
+
//#endregion
|
|
2380
|
+
//#region ../../packages/shared/src/save-location.ts
|
|
2381
|
+
const SaveLocationInternalValidator = object({
|
|
2382
|
+
id: string(),
|
|
2383
|
+
project: string(),
|
|
2384
|
+
lastModified: string(),
|
|
2385
|
+
type: literal("internal"),
|
|
2386
|
+
configName: string()
|
|
2387
|
+
});
|
|
2388
|
+
/** @deprecated External pipeline files are deprecated and will be removed in future versions. */
|
|
2389
|
+
const SaveLocationExternalValidator = object({
|
|
2390
|
+
id: string(),
|
|
2391
|
+
project: string(),
|
|
2392
|
+
path: string(),
|
|
2393
|
+
lastModified: string(),
|
|
2394
|
+
type: literal("external"),
|
|
2395
|
+
summary: object({
|
|
2396
|
+
plugins: array(string()),
|
|
2397
|
+
name: string(),
|
|
2398
|
+
description: string()
|
|
2399
|
+
})
|
|
2400
|
+
});
|
|
2401
|
+
const SaveLocationPipelabCloudValidator = object({
|
|
2402
|
+
id: string(),
|
|
2403
|
+
project: string(),
|
|
2404
|
+
type: literal("pipelab-cloud")
|
|
2405
|
+
});
|
|
2406
|
+
const SaveLocationValidator = union([
|
|
2407
|
+
SaveLocationExternalValidator,
|
|
2408
|
+
SaveLocationInternalValidator,
|
|
2409
|
+
SaveLocationPipelabCloudValidator
|
|
2410
|
+
]);
|
|
2411
|
+
object({
|
|
2412
|
+
version: literal("1.0.0"),
|
|
2413
|
+
data: optional(record(string(), SaveLocationValidator), {})
|
|
2414
|
+
});
|
|
2415
|
+
const FileRepoProjectValidatorV2$1 = object({
|
|
2416
|
+
id: string(),
|
|
2417
|
+
name: string(),
|
|
2418
|
+
description: string()
|
|
2419
|
+
});
|
|
2420
|
+
object({
|
|
2421
|
+
version: literal("2.0.0"),
|
|
2422
|
+
projects: array(FileRepoProjectValidatorV2$1),
|
|
2423
|
+
pipelines: optional(array(SaveLocationValidator), [])
|
|
2424
|
+
});
|
|
2319
2425
|
object({
|
|
2320
2426
|
cacheFolder: string(),
|
|
2321
2427
|
theme: union([literal("light"), literal("dark")]),
|
|
@@ -2467,6 +2573,17 @@ object({
|
|
|
2467
2573
|
})),
|
|
2468
2574
|
isInternalMigrationBannerClosed: optional(boolean(), false)
|
|
2469
2575
|
});
|
|
2576
|
+
const ConnectionValidator = looseObject({
|
|
2577
|
+
id: string(),
|
|
2578
|
+
pluginName: string(),
|
|
2579
|
+
name: string(),
|
|
2580
|
+
createdAt: string(),
|
|
2581
|
+
isDefault: boolean()
|
|
2582
|
+
});
|
|
2583
|
+
object({
|
|
2584
|
+
version: literal("1.0.0"),
|
|
2585
|
+
connections: array(ConnectionValidator)
|
|
2586
|
+
});
|
|
2470
2587
|
//#endregion
|
|
2471
2588
|
//#region ../../node_modules/tslog/dist/esm/prettyLogStyles.js
|
|
2472
2589
|
const prettyLogStyles = {
|
|
@@ -4077,7 +4194,7 @@ const processGraph = async (options) => {
|
|
|
4077
4194
|
const OriginValidator = object({
|
|
4078
4195
|
pluginId: string(),
|
|
4079
4196
|
nodeId: string(),
|
|
4080
|
-
version: pipe(
|
|
4197
|
+
version: optional(pipe(string(), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent.")))
|
|
4081
4198
|
});
|
|
4082
4199
|
const BlockActionValidatorV1 = object({
|
|
4083
4200
|
type: literal("action"),
|
|
@@ -4090,7 +4207,7 @@ const EditorParamValidatorV3 = union([literal("simple"), literal("editor")]);
|
|
|
4090
4207
|
const BlockActionValidatorV3 = object({
|
|
4091
4208
|
type: literal("action"),
|
|
4092
4209
|
uid: string(),
|
|
4093
|
-
name: pipe(
|
|
4210
|
+
name: optional(pipe(string(), description("A custom name provided by the user"))),
|
|
4094
4211
|
disabled: optional(boolean()),
|
|
4095
4212
|
params: record(string(), object({
|
|
4096
4213
|
editor: EditorParamValidatorV3,
|
|
@@ -32241,38 +32358,6 @@ const usePlugins = () => {
|
|
|
32241
32358
|
};
|
|
32242
32359
|
};
|
|
32243
32360
|
//#endregion
|
|
32244
|
-
//#region ../../packages/shared/src/save-location.ts
|
|
32245
|
-
const SaveLocationInternalValidator = object({
|
|
32246
|
-
id: string(),
|
|
32247
|
-
project: string(),
|
|
32248
|
-
lastModified: string(),
|
|
32249
|
-
type: literal("internal"),
|
|
32250
|
-
configName: string()
|
|
32251
|
-
});
|
|
32252
|
-
/** @deprecated External pipeline files are deprecated and will be removed in future versions. */
|
|
32253
|
-
const SaveLocationExternalValidator = object({
|
|
32254
|
-
id: string(),
|
|
32255
|
-
project: string(),
|
|
32256
|
-
path: string(),
|
|
32257
|
-
lastModified: string(),
|
|
32258
|
-
type: literal("external"),
|
|
32259
|
-
summary: object({
|
|
32260
|
-
plugins: array(string()),
|
|
32261
|
-
name: string(),
|
|
32262
|
-
description: string()
|
|
32263
|
-
})
|
|
32264
|
-
});
|
|
32265
|
-
const SaveLocationPipelabCloudValidator = object({
|
|
32266
|
-
id: string(),
|
|
32267
|
-
project: string(),
|
|
32268
|
-
type: literal("pipelab-cloud")
|
|
32269
|
-
});
|
|
32270
|
-
const SaveLocationValidator = union([
|
|
32271
|
-
SaveLocationExternalValidator,
|
|
32272
|
-
SaveLocationInternalValidator,
|
|
32273
|
-
SaveLocationPipelabCloudValidator
|
|
32274
|
-
]);
|
|
32275
|
-
//#endregion
|
|
32276
32361
|
//#region ../../packages/shared/src/subscription-errors.ts
|
|
32277
32362
|
var SubscriptionRequiredError = class extends Error {
|
|
32278
32363
|
code = "SUBSCRIPTION_REQUIRED";
|
|
@@ -32347,20 +32432,6 @@ object({
|
|
|
32347
32432
|
version: literal("1.0.0"),
|
|
32348
32433
|
data: optional(record(string(), SaveLocationValidator), {})
|
|
32349
32434
|
});
|
|
32350
|
-
const FileRepoProjectValidatorV2$1 = object({
|
|
32351
|
-
id: string(),
|
|
32352
|
-
name: string(),
|
|
32353
|
-
description: string()
|
|
32354
|
-
});
|
|
32355
|
-
object({
|
|
32356
|
-
version: literal("2.0.0"),
|
|
32357
|
-
projects: array(FileRepoProjectValidatorV2$1),
|
|
32358
|
-
pipelines: optional(array(SaveLocationValidator), [])
|
|
32359
|
-
});
|
|
32360
|
-
object({
|
|
32361
|
-
version: literal("1.0.0"),
|
|
32362
|
-
data: optional(record(string(), SaveLocationValidator), {})
|
|
32363
|
-
});
|
|
32364
32435
|
const FileRepoProjectValidatorV2 = object({
|
|
32365
32436
|
id: string(),
|
|
32366
32437
|
name: string(),
|
|
@@ -32373,10 +32444,8 @@ object({
|
|
|
32373
32444
|
});
|
|
32374
32445
|
//#endregion
|
|
32375
32446
|
//#region ../../packages/shared/src/index.ts
|
|
32376
|
-
const appSettingsMigrator = appSettingsMigrator$1;
|
|
32377
|
-
const fileRepoMigrations = fileRepoMigrations$1;
|
|
32378
32447
|
const savedFileMigrator = savedFileMigrator$1;
|
|
32379
32448
|
const configRegistry = configRegistry$1;
|
|
32380
32449
|
const normalizePipelineConfig = normalizePipelineConfig$1;
|
|
32381
32450
|
//#endregion
|
|
32382
|
-
export { useLogger as
|
|
32451
|
+
export { useLogger as C, SaveLocationInternalValidator as D, SaveLocationExternalValidator as E, SaveLocationPipelabCloudValidator as O, fmt as S, FileRepoProjectValidatorV2$1 as T, processGraph as _, isWebSocketRequestMessage as a, createQuickJs as b, isSupabaseAvailable as c, usePlugins as d, EditorParamValidatorV3 as f, VariableValidatorV1 as g, SavedFileSimpleValidatorV4 as h, WebSocketError as i, SaveLocationValidator as k, supabase as l, SavedFileDefaultValidatorV4 as m, normalizePipelineConfig as n, isRequired as o, OriginValidator as p, savedFileMigrator as r, transformUrl as s, configRegistry as t, SubscriptionRequiredError as u, variableToFormattedVariable as v, ConnectionValidator as w, createQuickJsFromVariant as x, makeResolvedParams as y };
|
package/src-XVe3IQMi.mjs
ADDED
package/config-B6BzqMsi.mjs
DELETED
package/src-DZNeIUut.mjs
DELETED