@pipelab/cli 2.0.0-beta.22 → 2.0.0-beta.25

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.
@@ -0,0 +1,4 @@
1
+ import "./src-PqA91tjF.mjs";
2
+ import "./dist-BC_B45iu.mjs";
3
+ import { c as setupSettingsConfigFile } from "./config-DJaqZVxZ.mjs";
4
+ export { setupSettingsConfigFile };
@@ -1,5 +1,5 @@
1
1
  import { a as __require, s as __toESM, t as __commonJSMin } from "./chunk-M2dkpuaD.mjs";
2
- import { i as savedFileMigrator, n as connectionsMigrator, r as fileRepoMigrations, t as appSettingsMigrator, w as useLogger } from "./src-CoHipk5y.mjs";
2
+ import { i as savedFileMigrator, n as connectionsMigrator, r as fileRepoMigrations, t as appSettingsMigrator, w as useLogger } from "./src-PqA91tjF.mjs";
3
3
  import path, { dirname, join } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { constants } from "node:os";
package/index.mjs CHANGED
@@ -1,8 +1,8 @@
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 { a as WebSocketError, c as transformUrl, d as SubscriptionRequiredError, f as usePlugins, i as savedFileMigrator, l as isSupabaseAvailable, n as connectionsMigrator, o as isWebSocketRequestMessage, r as fileRepoMigrations, s as isRequired, t as appSettingsMigrator, u as supabase, v as processGraph, w as useLogger } from "./src-CoHipk5y.mjs";
3
+ import { a as WebSocketError, c as transformUrl, d as SubscriptionRequiredError, f as usePlugins, i as savedFileMigrator, l as isSupabaseAvailable, n as connectionsMigrator, o as isWebSocketRequestMessage, r as fileRepoMigrations, s as isRequired, t as appSettingsMigrator, u as supabase, v as processGraph, w as useLogger } from "./src-PqA91tjF.mjs";
4
4
  import "./dist-BC_B45iu.mjs";
5
- import { a as setupPipelineConfigFileByName, c as setupSettingsConfigFile, d as extractTarGz, f as extractZip, g as execa, h as require_balanced_match, i as setupConnectionsConfigFile, l as downloadFile, m as require_commonjs$8, n as deletePipelineConfigFileByPath, o as setupPipelineConfigFileByPath, p as getFolderSize, s as setupProjectsConfigFile, t as deletePipelineConfigFileByName } from "./config-C4SmHbuE.mjs";
5
+ import { a as setupPipelineConfigFileByName, c as setupSettingsConfigFile, d as extractTarGz, f as extractZip, g as execa, h as require_balanced_match, i as setupConnectionsConfigFile, l as downloadFile, m as require_commonjs$8, n as deletePipelineConfigFileByPath, o as setupPipelineConfigFileByPath, p as getFolderSize, s as setupProjectsConfigFile, t as deletePipelineConfigFileByName } from "./config-DJaqZVxZ.mjs";
6
6
  import path, { delimiter, dirname, isAbsolute, join, normalize, resolve, sep } from "node:path";
7
7
  import { fileURLToPath, pathToFileURL } from "node:url";
8
8
  import { homedir, platform, release } from "node:os";
@@ -121,7 +121,7 @@ var PipelabContext = class {
121
121
  async createTempFolder(prefix = "pipelab-") {
122
122
  const baseDir = this.getTempPath();
123
123
  await mkdir(baseDir, { recursive: true });
124
- return await mkdtemp(join(await realpath(baseDir), prefix));
124
+ return mkdtemp(join(await realpath(baseDir), prefix));
125
125
  }
126
126
  getCachePath(folder, ...subpaths) {
127
127
  const base = this.getSettings()?.cacheFolder || join(this.userDataPath, "cache");
@@ -3967,6 +3967,121 @@ const registerShellHandlers = (_context) => {
3967
3967
  });
3968
3968
  };
3969
3969
  //#endregion
3970
+ //#region ../../packages/core-node/src/fs-utils.ts
3971
+ var import_slash = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
3972
+ module.exports = (path) => {
3973
+ const isExtendedLengthPath = /^\\\\\?\\/.test(path);
3974
+ const hasNonAscii = /[^\u0000-\u0080]+/.test(path);
3975
+ if (isExtendedLengthPath || hasNonAscii) return path;
3976
+ return path.replace(/\\/g, "/");
3977
+ };
3978
+ })))(), 1);
3979
+ function removeTrailingSlash$1(path) {
3980
+ return path.replace(/[\\/]+$/, "");
3981
+ }
3982
+ function isWindowsDriveRoot(path) {
3983
+ return /^[a-z]:$/.test(path);
3984
+ }
3985
+ const windowsSystemFolders = [
3986
+ "windows",
3987
+ "program files",
3988
+ "program files (x86)",
3989
+ "users",
3990
+ "programdata",
3991
+ "perflogs"
3992
+ ];
3993
+ function isWindowsSystemDirectory(path) {
3994
+ if (!isWindowsDriveRoot(path.substring(0, 2)) || path.charAt(2) !== "/") return false;
3995
+ const folder = path.substring(3);
3996
+ return windowsSystemFolders.includes(folder);
3997
+ }
3998
+ const unixSystemDirectories = new Set([
3999
+ "",
4000
+ "/usr",
4001
+ "/var",
4002
+ "/opt",
4003
+ "/etc",
4004
+ "/bin",
4005
+ "/sbin",
4006
+ "/lib",
4007
+ "/lib64",
4008
+ "/boot",
4009
+ "/sys",
4010
+ "/proc",
4011
+ "/dev",
4012
+ "/run",
4013
+ "/home",
4014
+ "/root",
4015
+ "/mnt",
4016
+ "/media",
4017
+ "/srv",
4018
+ "/applications",
4019
+ "/library",
4020
+ "/system",
4021
+ "/volumes",
4022
+ "/snap"
4023
+ ]);
4024
+ const homeDirectory = removeTrailingSlash$1((0, import_slash.default)(resolve(homedir()))).toLowerCase();
4025
+ const additionalProtectedPaths = [
4026
+ getDefaultUserDataPath$1("dev"),
4027
+ getDefaultUserDataPath$1("beta"),
4028
+ getDefaultUserDataPath$1("prod"),
4029
+ projectRoot,
4030
+ process.cwd(),
4031
+ "/tmp",
4032
+ "/var/tmp",
4033
+ process.env.TEMP,
4034
+ process.env.TMP,
4035
+ join(homedir(), "AppData"),
4036
+ join(homedir(), "AppData", "Local"),
4037
+ join(homedir(), "AppData", "Roaming"),
4038
+ join(homedir(), "Library"),
4039
+ join(homedir(), "Library", "Application Support"),
4040
+ join(homedir(), ".config"),
4041
+ join(homedir(), ".local"),
4042
+ join(homedir(), ".local", "share"),
4043
+ join(homedir(), ".cache"),
4044
+ join(homedir(), "OneDrive"),
4045
+ join(homedir(), "Dropbox"),
4046
+ join(homedir(), ".ssh"),
4047
+ join(homedir(), ".gnupg"),
4048
+ join(homedir(), ".aws"),
4049
+ join(homedir(), ".docker"),
4050
+ join(homedir(), ".kube"),
4051
+ join(homedir(), ".vscode"),
4052
+ join(homedir(), ".vscode-insiders"),
4053
+ join(homedir(), ".cursor"),
4054
+ join(homedir(), ".npm"),
4055
+ join(homedir(), ".pnpm-state"),
4056
+ join(homedir(), ".yarn"),
4057
+ join(homedir(), ".cargo"),
4058
+ join(homedir(), ".rustup"),
4059
+ join(homedir(), ".m2"),
4060
+ join(homedir(), ".gradle")
4061
+ ].filter((p) => typeof p === "string" && p.length > 0);
4062
+ const userSubdirectories = new Set([
4063
+ join(homedir(), "Downloads"),
4064
+ join(homedir(), "Documents"),
4065
+ join(homedir(), "Desktop"),
4066
+ join(homedir(), "Pictures"),
4067
+ join(homedir(), "Music"),
4068
+ join(homedir(), "Videos"),
4069
+ join(homedir(), "Saved Games"),
4070
+ join(homedir(), "Contacts"),
4071
+ join(homedir(), "Searches"),
4072
+ join(homedir(), "Links"),
4073
+ join(homedir(), "3D Objects"),
4074
+ ...additionalProtectedPaths
4075
+ ].map((p) => removeTrailingSlash$1((0, import_slash.default)(resolve(p))).toLowerCase()));
4076
+ /**
4077
+ * Checks if a path matches a critical user or system directory.
4078
+ */
4079
+ function isPathBlacklisted(pathToCheck) {
4080
+ if (!pathToCheck) return false;
4081
+ const normalized = removeTrailingSlash$1((0, import_slash.default)(resolve(pathToCheck))).toLowerCase();
4082
+ return normalized === homeDirectory || unixSystemDirectories.has(normalized) || userSubdirectories.has(normalized) || isWindowsDriveRoot(normalized) || isWindowsSystemDirectory(normalized);
4083
+ }
4084
+ //#endregion
3970
4085
  //#region ../../packages/core-node/src/handlers/fs.ts
3971
4086
  const registerFsHandlers = (_context) => {
3972
4087
  const { handle } = useAPI();
@@ -4038,6 +4153,26 @@ const registerFsHandlers = (_context) => {
4038
4153
  });
4039
4154
  }
4040
4155
  });
4156
+ handle("fs:isPathBlacklisted", async (event, { value, send }) => {
4157
+ try {
4158
+ send({
4159
+ type: "end",
4160
+ data: {
4161
+ type: "success",
4162
+ result: { isBlacklisted: isPathBlacklisted(value.path) }
4163
+ }
4164
+ });
4165
+ } catch (error) {
4166
+ logger().error("Failed to check blacklist for path:", error);
4167
+ send({
4168
+ type: "end",
4169
+ data: {
4170
+ type: "error",
4171
+ ipcError: error instanceof Error ? error.message : "Unable to check path blacklist"
4172
+ }
4173
+ });
4174
+ }
4175
+ });
4041
4176
  };
4042
4177
  //#endregion
4043
4178
  //#region ../../packages/core-node/src/handlers/config.ts
@@ -66759,8 +66894,9 @@ async function serveCommand(options, version, _dirname) {
66759
66894
  let rawAssetFolder;
66760
66895
  rawAssetFolder = await fetchPipelabAsset("@pipelab/ui", releaseTag, { context });
66761
66896
  const server = http.createServer(async (request, response) => {
66762
- if (request.url?.startsWith("/media-file/")) {
66763
- const encodedPath = request.url.substring(12);
66897
+ const urlObj = request.url ? new URL(request.url, "http://localhost") : null;
66898
+ if (urlObj && urlObj.pathname.startsWith("/media-file/")) {
66899
+ const encodedPath = urlObj.pathname.substring(12);
66764
66900
  const filePath = decodeURIComponent(encodedPath);
66765
66901
  const normalizedPath = filePath.startsWith("/") && filePath.match(/^\/[a-zA-Z]:/) ? filePath.substring(1) : filePath;
66766
66902
  if (existsSync(normalizedPath)) try {
@@ -67231,14 +67367,23 @@ const handleActionExecute = async (nodeId, pluginId, params, mainWindow, send, a
67231
67367
  inputs: resolvedInputs,
67232
67368
  log: (...args) => {
67233
67369
  const decorator = `[${node.node.name}]`;
67234
- const logArgs = [decorator, ...args];
67370
+ const formattedArgs = args.map((arg) => {
67371
+ if (arg instanceof Error) return arg.stack || arg.message || String(arg);
67372
+ if (typeof arg === "object" && arg !== null) try {
67373
+ return JSON.stringify(arg, null, 2);
67374
+ } catch {
67375
+ return String(arg);
67376
+ }
67377
+ return arg;
67378
+ });
67379
+ const logArgs = [decorator, ...formattedArgs];
67235
67380
  logger().info(...logArgs);
67236
67381
  send({
67237
67382
  type: "log",
67238
67383
  data: {
67239
67384
  decorator,
67240
67385
  time: Date.now(),
67241
- message: args
67386
+ message: formattedArgs
67242
67387
  }
67243
67388
  });
67244
67389
  },
@@ -67416,9 +67561,9 @@ const builtInPlugins = async (options) => {
67416
67561
  const envStart = Date.now();
67417
67562
  await Promise.all([ensureNodeJS(options.context), ensurePNPM(options.context)]);
67418
67563
  console.log(`[Plugins] Environment preparation took ${Date.now() - envStart}ms`);
67419
- const { usePlugins } = await import("./src-DU3j_v2A.mjs");
67564
+ const { usePlugins } = await import("./src-BiFlFfFL.mjs");
67420
67565
  const { registerPlugins } = usePlugins();
67421
- const { webSocketServer } = await import("./src-5EzZR-UT.mjs");
67566
+ const { webSocketServer } = await import("./src-B_k6ITjY.mjs");
67422
67567
  webSocketServer.broadcast("startup:progress", { type: "ready" });
67423
67568
  (async () => {
67424
67569
  const totalStart = Date.now();
@@ -67438,7 +67583,7 @@ const builtInPlugins = async (options) => {
67438
67583
  "@pipelab/plugin-netlify"
67439
67584
  ]) pluginsToLoad.set(name, "latest");
67440
67585
  try {
67441
- const { setupSettingsConfigFile } = await import("./config-B-M_kmKR.mjs");
67586
+ const { setupSettingsConfigFile } = await import("./config-CzJC4vJj.mjs");
67442
67587
  const settingsPlugins = (await (await setupSettingsConfigFile(options.context)).getConfig())?.plugins || [];
67443
67588
  for (const plugin of settingsPlugins) if (plugin.name) if (plugin.enabled) {
67444
67589
  if (!pluginsToLoad.has(plugin.name)) pluginsToLoad.set(plugin.name, "latest");
@@ -69171,7 +69316,7 @@ async function runPipelineCommand(file, options, version) {
69171
69316
  }
69172
69317
  //#endregion
69173
69318
  //#region package.json
69174
- var version$2 = "2.0.0-beta.22";
69319
+ var version$2 = "2.0.0-beta.25";
69175
69320
  //#endregion
69176
69321
  //#region src/paths.ts
69177
69322
  const getDefaultUserDataPath = () => {
@@ -77236,4 +77381,4 @@ program.hook("postAction", (thisCommand) => {
77236
77381
  program.parse(process.argv);
77237
77382
  if (!process.argv.slice(2).length) program.outputHelp();
77238
77383
  //#endregion
77239
- export { CacheFolder as A, BuildHistoryStorage as C, WebSocketServer as D, registerShellHandlers as E, getDefaultUserDataPath$1 as M, projectRoot as N, webSocketServer as O, registerHistoryHandlers as S, registerFsHandlers as T, isOnline as _, executeGraphWithHistory as a, sendStartupReady as b, findInstalledPlugins as c, handleActionExecute as d, ensureNodeJS as f, fetchPipelabPlugin as g, fetchPipelabAsset as h, registerEngineHandlers as i, PipelabContext 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, runPnpm as v, registerConfigHandlers as w, serveCommand as x, sendStartupProgress as y };
77384
+ export { useAPI as A, BuildHistoryStorage as C, registerShellHandlers as D, isPathBlacklisted as E, PipelabContext as M, getDefaultUserDataPath$1 as N, WebSocketServer as O, projectRoot as P, registerHistoryHandlers as S, registerFsHandlers as T, isOnline as _, executeGraphWithHistory as a, sendStartupReady as b, findInstalledPlugins as c, handleActionExecute as d, ensureNodeJS as f, fetchPipelabPlugin as g, fetchPipelabAsset as h, registerEngineHandlers as i, CacheFolder as j, webSocketServer 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, runPnpm as v, registerConfigHandlers as w, serveCommand as x, sendStartupProgress as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipelab/cli",
3
- "version": "2.0.0-beta.22",
3
+ "version": "2.0.0-beta.25",
4
4
  "description": "The command line interface for Pipelab",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "author": "CynToolkit",
@@ -0,0 +1,5 @@
1
+ import "./src-PqA91tjF.mjs";
2
+ import "./dist-BC_B45iu.mjs";
3
+ import "./config-DJaqZVxZ.mjs";
4
+ import { k as webSocketServer } from "./index.mjs";
5
+ export { webSocketServer };
@@ -0,0 +1,3 @@
1
+ import { f as usePlugins } from "./src-PqA91tjF.mjs";
2
+ import "./dist-BC_B45iu.mjs";
3
+ export { usePlugins };
@@ -32330,16 +32330,15 @@ const supabase = (options) => {
32330
32330
  const transformUrl = (url) => {
32331
32331
  if (url && typeof url === "string") {
32332
32332
  const getHost = () => {
32333
- if (typeof window !== "undefined") if (window.location.port === "5173") return `http://${window.location.hostname}:33753`;
32334
- else return `${window.location.protocol}//${window.location.host}`;
32333
+ if (typeof window !== "undefined") return `${window.location.protocol}//${window.location.host}`;
32335
32334
  return "http://localhost:33753";
32336
32335
  };
32337
32336
  if (url.startsWith("file://")) {
32338
- const filePath = url.substring(7);
32337
+ const filePath = decodeURIComponent(url.substring(7));
32339
32338
  return `${getHost()}/media-file/${encodeURIComponent(filePath)}`;
32340
32339
  }
32341
32340
  if (url.startsWith("media://")) {
32342
- const filePath = url.replace(/^media:\/\/+/, "/");
32341
+ const filePath = decodeURIComponent(url.replace(/^media:\/\/+/, "/"));
32343
32342
  return `${getHost()}/media-file/${encodeURIComponent(filePath)}`;
32344
32343
  }
32345
32344
  }
@@ -1,4 +0,0 @@
1
- import "./src-CoHipk5y.mjs";
2
- import "./dist-BC_B45iu.mjs";
3
- import { c as setupSettingsConfigFile } from "./config-C4SmHbuE.mjs";
4
- export { setupSettingsConfigFile };
package/src-5EzZR-UT.mjs DELETED
@@ -1,5 +0,0 @@
1
- import "./src-CoHipk5y.mjs";
2
- import "./dist-BC_B45iu.mjs";
3
- import "./config-C4SmHbuE.mjs";
4
- import { O as webSocketServer } from "./index.mjs";
5
- export { webSocketServer };
package/src-DU3j_v2A.mjs DELETED
@@ -1,3 +0,0 @@
1
- import { f as usePlugins } from "./src-CoHipk5y.mjs";
2
- import "./dist-BC_B45iu.mjs";
3
- export { usePlugins };