@pipelab/plugin-electron 1.0.0-beta.14 → 1.0.0-beta.16

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/dist/index.cjs CHANGED
@@ -8,11 +8,11 @@ let node_os = require("node:os");
8
8
  let node_url = require("node:url");
9
9
  let node_fs = require("node:fs");
10
10
  node_fs = require_chunk.__toESM(node_fs);
11
+ let node_fs_promises = require("node:fs/promises");
12
+ node_fs_promises = require_chunk.__toESM(node_fs_promises);
11
13
  let node_http = require("node:http");
12
14
  node_http = require_chunk.__toESM(node_http);
13
15
  let node_crypto = require("node:crypto");
14
- let node_fs_promises = require("node:fs/promises");
15
- node_fs_promises = require_chunk.__toESM(node_fs_promises);
16
16
  let node_child_process = require("node:child_process");
17
17
  let node_string_decoder = require("node:string_decoder");
18
18
  let node_util = require("node:util");
@@ -26,6 +26,8 @@ let node_v8 = require("node:v8");
26
26
  let node_stream_promises = require("node:stream/promises");
27
27
  let node_stream = require("node:stream");
28
28
  let node_buffer = require("node:buffer");
29
+ let node_dns_promises = require("node:dns/promises");
30
+ node_dns_promises = require_chunk.__toESM(node_dns_promises);
29
31
  //#region ../../packages/migration/src/models/createMigration.ts
30
32
  function createMigration$1(migration) {
31
33
  return {
@@ -1604,6 +1606,56 @@ function literal(literal_, message) {
1604
1606
  }
1605
1607
  };
1606
1608
  }
1609
+ function looseObject(entries, message) {
1610
+ return {
1611
+ kind: "schema",
1612
+ type: "loose_object",
1613
+ reference: looseObject,
1614
+ expects: "Object",
1615
+ async: false,
1616
+ entries,
1617
+ message,
1618
+ _run(dataset, config2) {
1619
+ const input = dataset.value;
1620
+ if (input && typeof input === "object") {
1621
+ dataset.typed = true;
1622
+ dataset.value = {};
1623
+ for (const key in this.entries) {
1624
+ const value2 = input[key];
1625
+ const valueDataset = this.entries[key]._run({
1626
+ typed: false,
1627
+ value: value2
1628
+ }, config2);
1629
+ if (valueDataset.issues) {
1630
+ const pathItem = {
1631
+ type: "object",
1632
+ origin: "value",
1633
+ input,
1634
+ key,
1635
+ value: value2
1636
+ };
1637
+ for (const issue of valueDataset.issues) {
1638
+ if (issue.path) issue.path.unshift(pathItem);
1639
+ else issue.path = [pathItem];
1640
+ dataset.issues?.push(issue);
1641
+ }
1642
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
1643
+ if (config2.abortEarly) {
1644
+ dataset.typed = false;
1645
+ break;
1646
+ }
1647
+ }
1648
+ if (!valueDataset.typed) dataset.typed = false;
1649
+ if (valueDataset.value !== void 0 || key in input) dataset.value[key] = valueDataset.value;
1650
+ }
1651
+ if (!dataset.issues || !config2.abortEarly) {
1652
+ for (const key in input) if (_isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
1653
+ }
1654
+ } else _addIssue(this, "type", dataset, config2);
1655
+ return dataset;
1656
+ }
1657
+ };
1658
+ }
1607
1659
  function number(message) {
1608
1660
  return {
1609
1661
  kind: "schema",
@@ -2141,6 +2193,18 @@ settingsMigratorInternal.createMigrations({
2141
2193
  })
2142
2194
  ]
2143
2195
  });
2196
+ const connectionsMigratorInternal = createMigrator();
2197
+ const defaultConnections = connectionsMigratorInternal.createDefault({
2198
+ version: "1.0.0",
2199
+ connections: []
2200
+ });
2201
+ connectionsMigratorInternal.createMigrations({
2202
+ defaultValue: defaultConnections,
2203
+ migrations: [createMigration({
2204
+ version: "1.0.0",
2205
+ up: finalVersion
2206
+ })]
2207
+ });
2144
2208
  const fileRepoMigratorInternal = createMigrator();
2145
2209
  const defaultFileRepo = fileRepoMigratorInternal.createDefault({
2146
2210
  version: "2.0.0",
@@ -2302,11 +2366,51 @@ const LEGACY_ID_MAP = {
2302
2366
  };
2303
2367
  const getStrictPluginId = (pluginId) => {
2304
2368
  if (!pluginId) return pluginId;
2305
- if (LEGACY_ID_MAP[pluginId]) return LEGACY_ID_MAP[pluginId];
2306
- if (pluginId.startsWith("@") || pluginId.includes("/") || pluginId.startsWith("pipelab-plugin-")) return pluginId;
2307
- const prefixed = `@pipelab/plugin-${pluginId}`;
2308
- return LEGACY_ID_MAP[prefixed] || prefixed;
2369
+ return LEGACY_ID_MAP[pluginId] || pluginId;
2309
2370
  };
2371
+ //#endregion
2372
+ //#region ../../packages/shared/src/save-location.ts
2373
+ const SaveLocationInternalValidator = object({
2374
+ id: string(),
2375
+ project: string(),
2376
+ lastModified: string(),
2377
+ type: literal("internal"),
2378
+ configName: string()
2379
+ });
2380
+ const SaveLocationValidator = union([
2381
+ object({
2382
+ id: string(),
2383
+ project: string(),
2384
+ path: string(),
2385
+ lastModified: string(),
2386
+ type: literal("external"),
2387
+ summary: object({
2388
+ plugins: array(string()),
2389
+ name: string(),
2390
+ description: string()
2391
+ })
2392
+ }),
2393
+ SaveLocationInternalValidator,
2394
+ object({
2395
+ id: string(),
2396
+ project: string(),
2397
+ type: literal("pipelab-cloud")
2398
+ })
2399
+ ]);
2400
+ object({
2401
+ version: literal("1.0.0"),
2402
+ data: optional(record(string(), SaveLocationValidator), {})
2403
+ });
2404
+ const FileRepoProjectValidatorV2$1 = object({
2405
+ id: string(),
2406
+ name: string(),
2407
+ description: string()
2408
+ });
2409
+ object({
2410
+ version: literal("2.0.0"),
2411
+ projects: array(FileRepoProjectValidatorV2$1),
2412
+ pipelines: optional(array(SaveLocationValidator), [])
2413
+ });
2310
2414
  object({
2311
2415
  cacheFolder: string(),
2312
2416
  theme: union([literal("light"), literal("dark")]),
@@ -2458,6 +2562,17 @@ object({
2458
2562
  })),
2459
2563
  isInternalMigrationBannerClosed: optional(boolean(), false)
2460
2564
  });
2565
+ const ConnectionValidator = looseObject({
2566
+ id: string(),
2567
+ pluginName: string(),
2568
+ name: string(),
2569
+ createdAt: string(),
2570
+ isDefault: boolean()
2571
+ });
2572
+ object({
2573
+ version: literal("1.0.0"),
2574
+ connections: array(ConnectionValidator)
2575
+ });
2461
2576
  //#endregion
2462
2577
  //#region ../../node_modules/tslog/dist/esm/prettyLogStyles.js
2463
2578
  const prettyLogStyles = {
@@ -2978,7 +3093,7 @@ const useLogger = () => {
2978
3093
  const OriginValidator = object({
2979
3094
  pluginId: string(),
2980
3095
  nodeId: string(),
2981
- version: pipe(optional(string()), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent."))
3096
+ version: optional(pipe(string(), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent.")))
2982
3097
  });
2983
3098
  const BlockActionValidatorV1 = object({
2984
3099
  type: literal("action"),
@@ -2991,7 +3106,7 @@ const EditorParamValidatorV3 = union([literal("simple"), literal("editor")]);
2991
3106
  const BlockActionValidatorV3 = object({
2992
3107
  type: literal("action"),
2993
3108
  uid: string(),
2994
- name: pipe(optional(string()), description("A custom name provided by the user")),
3109
+ name: optional(pipe(string(), description("A custom name provided by the user"))),
2995
3110
  disabled: optional(boolean()),
2996
3111
  params: record(string(), object({
2997
3112
  editor: EditorParamValidatorV3,
@@ -45321,35 +45436,6 @@ const createBooleanParam = (value, definition) => {
45321
45436
  };
45322
45437
  };
45323
45438
  //#endregion
45324
- //#region ../../packages/shared/src/save-location.ts
45325
- const SaveLocationInternalValidator = object({
45326
- id: string(),
45327
- project: string(),
45328
- lastModified: string(),
45329
- type: literal("internal"),
45330
- configName: string()
45331
- });
45332
- const SaveLocationValidator = union([
45333
- object({
45334
- id: string(),
45335
- project: string(),
45336
- path: string(),
45337
- lastModified: string(),
45338
- type: literal("external"),
45339
- summary: object({
45340
- plugins: array(string()),
45341
- name: string(),
45342
- description: string()
45343
- })
45344
- }),
45345
- SaveLocationInternalValidator,
45346
- object({
45347
- id: string(),
45348
- project: string(),
45349
- type: literal("pipelab-cloud")
45350
- })
45351
- ]);
45352
- //#endregion
45353
45439
  //#region ../../packages/shared/src/websocket.types.ts
45354
45440
  var WebSocketError = class extends Error {
45355
45441
  constructor(message, code, requestId) {
@@ -45366,20 +45452,6 @@ object({
45366
45452
  version: literal("1.0.0"),
45367
45453
  data: optional(record(string(), SaveLocationValidator), {})
45368
45454
  });
45369
- const FileRepoProjectValidatorV2$1 = object({
45370
- id: string(),
45371
- name: string(),
45372
- description: string()
45373
- });
45374
- object({
45375
- version: literal("2.0.0"),
45376
- projects: array(FileRepoProjectValidatorV2$1),
45377
- pipelines: optional(array(SaveLocationValidator), [])
45378
- });
45379
- object({
45380
- version: literal("1.0.0"),
45381
- data: optional(record(string(), SaveLocationValidator), {})
45382
- });
45383
45455
  const FileRepoProjectValidatorV2 = object({
45384
45456
  id: string(),
45385
45457
  name: string(),
@@ -45391,8 +45463,41 @@ object({
45391
45463
  pipelines: optional(array(SaveLocationValidator), [])
45392
45464
  });
45393
45465
  //#endregion
45466
+ //#region ../../packages/constants/src/index.ts
45467
+ const outFolderName = (binName, platform, arch) => {
45468
+ let platformName = "";
45469
+ let archName = "";
45470
+ console.log("platform", platform);
45471
+ if (platform === "linux") platformName = "linux";
45472
+ else if (platform === "win32") platformName = "win32";
45473
+ else if (platform === "darwin") platformName = "darwin";
45474
+ else throw new Error("Unsupported platform");
45475
+ if (arch === "x64") archName = "x64";
45476
+ else if (arch === "arm") archName = "arm";
45477
+ else if (arch === "arm64") archName = "arm64";
45478
+ else if (arch === "ia32") archName = "ia32";
45479
+ else throw new Error("Unsupported architecture");
45480
+ return `${binName}-${platformName}-${archName}`;
45481
+ };
45482
+ /**
45483
+ * Get the binary name for a given platform
45484
+ * @param name
45485
+ * @param platform If not provided, it will try to use process.platform (Node.js only)
45486
+ * @returns
45487
+ */
45488
+ const getBinName = (name, platform) => {
45489
+ const p = platform || (typeof process !== "undefined" ? process.platform : "unknown");
45490
+ if (p === "win32") return `${name}.exe`;
45491
+ if (p === "darwin") return `${name}.app/Contents/MacOS/${name}`;
45492
+ return name;
45493
+ };
45494
+ const websocketPort = 33753;
45495
+ const DEFAULT_NODE_VERSION = "24.14.1";
45496
+ const DEFAULT_PNPM_VERSION = "10.12.0";
45497
+ //#endregion
45394
45498
  //#region ../../packages/core-node/src/context.ts
45395
- const _dirname = typeof __dirname !== "undefined" ? __dirname : require("url").pathToFileURL(__filename).href ? (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href)) : process.cwd();
45499
+ const metaUrl = require("url").pathToFileURL(__filename).href;
45500
+ const _dirname = typeof __dirname !== "undefined" ? __dirname : metaUrl ? (0, node_path.dirname)((0, node_url.fileURLToPath)(metaUrl)) : process.cwd();
45396
45501
  const isDev = process.env.NODE_ENV === "development";
45397
45502
  /**
45398
45503
  * Finds the monorepo root by looking for pnpm-workspace.yaml.
@@ -48964,36 +49069,6 @@ const useAPI = () => {
48964
49069
  };
48965
49070
  };
48966
49071
  //#endregion
48967
- //#region ../../packages/constants/src/index.ts
48968
- const outFolderName = (binName, platform, arch) => {
48969
- let platformName = "";
48970
- let archName = "";
48971
- console.log("platform", platform);
48972
- if (platform === "linux") platformName = "linux";
48973
- else if (platform === "win32") platformName = "win32";
48974
- else if (platform === "darwin") platformName = "darwin";
48975
- else throw new Error("Unsupported platform");
48976
- if (arch === "x64") archName = "x64";
48977
- else if (arch === "arm") archName = "arm";
48978
- else if (arch === "arm64") archName = "arm64";
48979
- else if (arch === "ia32") archName = "ia32";
48980
- else throw new Error("Unsupported architecture");
48981
- return `${binName}-${platformName}-${archName}`;
48982
- };
48983
- /**
48984
- * Get the binary name for a given platform
48985
- * @param name
48986
- * @param platform If not provided, it will try to use process.platform (Node.js only)
48987
- * @returns
48988
- */
48989
- const getBinName = (name, platform) => {
48990
- const p = platform || (typeof process !== "undefined" ? process.platform : "unknown");
48991
- if (p === "win32") return `${name}.exe`;
48992
- if (p === "darwin") return `${name}.app/Contents/MacOS/${name}`;
48993
- return name;
48994
- };
48995
- const websocketPort = 33753;
48996
- //#endregion
48997
49072
  //#region ../../packages/core-node/src/websocket-server.ts
48998
49073
  var WebSocketServer = class {
48999
49074
  wss = null;
@@ -59600,17 +59675,17 @@ var require_path_arg = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
59600
59675
  //#endregion
59601
59676
  //#region ../../node_modules/mkdirp/lib/find-made.js
59602
59677
  var require_find_made = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
59603
- const { dirname: dirname$15 } = require("path");
59678
+ const { dirname: dirname$14 } = require("path");
59604
59679
  const findMade = (opts, parent, path$83 = void 0) => {
59605
59680
  if (path$83 === parent) return Promise.resolve();
59606
- return opts.statAsync(parent).then((st) => st.isDirectory() ? path$83 : void 0, (er) => er.code === "ENOENT" ? findMade(opts, dirname$15(parent), parent) : void 0);
59681
+ return opts.statAsync(parent).then((st) => st.isDirectory() ? path$83 : void 0, (er) => er.code === "ENOENT" ? findMade(opts, dirname$14(parent), parent) : void 0);
59607
59682
  };
59608
59683
  const findMadeSync = (opts, parent, path$84 = void 0) => {
59609
59684
  if (path$84 === parent) return void 0;
59610
59685
  try {
59611
59686
  return opts.statSync(parent).isDirectory() ? path$84 : void 0;
59612
59687
  } catch (er) {
59613
- return er.code === "ENOENT" ? findMadeSync(opts, dirname$15(parent), parent) : void 0;
59688
+ return er.code === "ENOENT" ? findMadeSync(opts, dirname$14(parent), parent) : void 0;
59614
59689
  }
59615
59690
  };
59616
59691
  module.exports = {
@@ -59621,10 +59696,10 @@ var require_find_made = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
59621
59696
  //#endregion
59622
59697
  //#region ../../node_modules/mkdirp/lib/mkdirp-manual.js
59623
59698
  var require_mkdirp_manual = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
59624
- const { dirname: dirname$14 } = require("path");
59699
+ const { dirname: dirname$13 } = require("path");
59625
59700
  const mkdirpManual = (path$81, opts, made) => {
59626
59701
  opts.recursive = false;
59627
- const parent = dirname$14(path$81);
59702
+ const parent = dirname$13(path$81);
59628
59703
  if (parent === path$81) return opts.mkdirAsync(path$81, opts).catch((er) => {
59629
59704
  if (er.code !== "EISDIR") throw er;
59630
59705
  });
@@ -59640,7 +59715,7 @@ var require_mkdirp_manual = /* @__PURE__ */ require_chunk.__commonJSMin(((export
59640
59715
  });
59641
59716
  };
59642
59717
  const mkdirpManualSync = (path$82, opts, made) => {
59643
- const parent = dirname$14(path$82);
59718
+ const parent = dirname$13(path$82);
59644
59719
  opts.recursive = false;
59645
59720
  if (parent === path$82) try {
59646
59721
  return opts.mkdirSync(path$82, opts);
@@ -59669,12 +59744,12 @@ var require_mkdirp_manual = /* @__PURE__ */ require_chunk.__commonJSMin(((export
59669
59744
  //#endregion
59670
59745
  //#region ../../node_modules/mkdirp/lib/mkdirp-native.js
59671
59746
  var require_mkdirp_native = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
59672
- const { dirname: dirname$13 } = require("path");
59747
+ const { dirname: dirname$12 } = require("path");
59673
59748
  const { findMade, findMadeSync } = require_find_made();
59674
59749
  const { mkdirpManual, mkdirpManualSync } = require_mkdirp_manual();
59675
59750
  const mkdirpNative = (path$79, opts) => {
59676
59751
  opts.recursive = true;
59677
- if (dirname$13(path$79) === path$79) return opts.mkdirAsync(path$79, opts);
59752
+ if (dirname$12(path$79) === path$79) return opts.mkdirAsync(path$79, opts);
59678
59753
  return findMade(opts, path$79).then((made) => opts.mkdirAsync(path$79, opts).then(() => made).catch((er) => {
59679
59754
  if (er.code === "ENOENT") return mkdirpManual(path$79, opts);
59680
59755
  else throw er;
@@ -59682,7 +59757,7 @@ var require_mkdirp_native = /* @__PURE__ */ require_chunk.__commonJSMin(((export
59682
59757
  };
59683
59758
  const mkdirpNativeSync = (path$80, opts) => {
59684
59759
  opts.recursive = true;
59685
- if (dirname$13(path$80) === path$80) return opts.mkdirSync(path$80, opts);
59760
+ if (dirname$12(path$80) === path$80) return opts.mkdirSync(path$80, opts);
59686
59761
  const made = findMadeSync(opts, path$80);
59687
59762
  try {
59688
59763
  opts.mkdirSync(path$80, opts);
@@ -89401,14 +89476,6 @@ var import_tar = /* @__PURE__ */ require_chunk.__toESM(require_tar$1(), 1);
89401
89476
  var import_yauzl = /* @__PURE__ */ require_chunk.__toESM(require_yauzl(), 1);
89402
89477
  require_archiver();
89403
89478
  /**
89404
- * Generates a unique temporary folder.
89405
- */
89406
- const generateTempFolder$1 = async (base) => {
89407
- const targetBase = base || (0, node_os.tmpdir)();
89408
- await (0, node_fs_promises.mkdir)(targetBase, { recursive: true });
89409
- return await (0, node_fs_promises.mkdtemp)((0, node_path.join)(await (0, node_fs_promises.realpath)(targetBase), "pipelab-"));
89410
- };
89411
- /**
89412
89479
  * Extracts a .tar.gz archive.
89413
89480
  */
89414
89481
  async function extractTarGz(archivePath, destinationDir) {
@@ -98913,11 +98980,11 @@ var require_is = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
98913
98980
  //#region ../../node_modules/@npmcli/git/lib/find.js
98914
98981
  var require_find = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
98915
98982
  const is = require_is();
98916
- const { dirname: dirname$11 } = require("path");
98983
+ const { dirname: dirname$10 } = require("path");
98917
98984
  module.exports = async ({ cwd = process.cwd(), root } = {}) => {
98918
98985
  while (true) {
98919
98986
  if (await is({ cwd })) return cwd;
98920
- const next = dirname$11(cwd);
98987
+ const next = dirname$10(cwd);
98921
98988
  if (cwd === root || cwd === next) return null;
98922
98989
  cwd = next;
98923
98990
  }
@@ -99441,7 +99508,7 @@ var require_sort$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
99441
99508
  //#endregion
99442
99509
  //#region ../../node_modules/@npmcli/package-json/lib/index.js
99443
99510
  var require_lib$18 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
99444
- const { readFile: readFile$9, writeFile: writeFile$5 } = require("node:fs/promises");
99511
+ const { readFile: readFile$9, writeFile: writeFile$4 } = require("node:fs/promises");
99445
99512
  const { resolve: resolve$11 } = require("node:path");
99446
99513
  const parseJSON = require_lib$30();
99447
99514
  const updateDeps = require_update_dependencies();
@@ -99614,7 +99681,7 @@ var require_lib$18 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
99614
99681
  const content = sort ? packageSort(rest) : rest;
99615
99682
  const fileContent = `${JSON.stringify(content, null, format)}\n`.replace(/\n/g, eol);
99616
99683
  if (fileContent.trim() !== this.#readFileContent.trim()) {
99617
- const written = await writeFile$5(this.filename, fileContent);
99684
+ const written = await writeFile$4(this.filename, fileContent);
99618
99685
  this.#readFileContent = fileContent;
99619
99686
  return written;
99620
99687
  }
@@ -100712,8 +100779,8 @@ var require_errors$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
100712
100779
  var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
100713
100780
  const { ERR_FS_CP_DIR_TO_NON_DIR, ERR_FS_CP_EEXIST, ERR_FS_CP_EINVAL, ERR_FS_CP_FIFO_PIPE, ERR_FS_CP_NON_DIR_TO_DIR, ERR_FS_CP_SOCKET, ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY, ERR_FS_CP_UNKNOWN, ERR_FS_EISDIR, ERR_INVALID_ARG_TYPE } = require_errors$3();
100714
100781
  const { constants: { errno: { EEXIST, EISDIR, EINVAL, ENOTDIR } } } = require("os");
100715
- const { chmod: chmod$2, copyFile, lstat: lstat$2, mkdir: mkdir$8, readdir: readdir$6, readlink, stat: stat$5, symlink, unlink, utimes } = require("fs/promises");
100716
- const { dirname: dirname$10, isAbsolute: isAbsolute$2, join: join$13, parse, resolve: resolve$10, sep: sep$2, toNamespacedPath } = require("path");
100782
+ const { chmod: chmod$2, copyFile, lstat: lstat$2, mkdir: mkdir$7, readdir: readdir$6, readlink, stat: stat$5, symlink, unlink, utimes } = require("fs/promises");
100783
+ const { dirname: dirname$9, isAbsolute: isAbsolute$2, join: join$13, parse, resolve: resolve$10, sep: sep$2, toNamespacedPath } = require("path");
100717
100784
  const { fileURLToPath } = require("url");
100718
100785
  const defaultOptions = {
100719
100786
  dereference: false,
@@ -100787,9 +100854,9 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
100787
100854
  })]);
100788
100855
  }
100789
100856
  async function checkParentDir(destStat, src, dest, opts) {
100790
- const destParent = dirname$10(dest);
100857
+ const destParent = dirname$9(dest);
100791
100858
  if (await pathExists(destParent)) return getStatsForCopy(destStat, src, dest, opts);
100792
- await mkdir$8(destParent, { recursive: true });
100859
+ await mkdir$7(destParent, { recursive: true });
100793
100860
  return getStatsForCopy(destStat, src, dest, opts);
100794
100861
  }
100795
100862
  function pathExists(dest) {
@@ -100800,8 +100867,8 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
100800
100867
  );
100801
100868
  }
100802
100869
  async function checkParentPaths(src, srcStat, dest) {
100803
- const srcParent = resolve$10(dirname$10(src));
100804
- const destParent = resolve$10(dirname$10(dest));
100870
+ const srcParent = resolve$10(dirname$9(src));
100871
+ const destParent = resolve$10(dirname$9(dest));
100805
100872
  if (destParent === srcParent || destParent === parse(destParent).root) return;
100806
100873
  let destStat;
100807
100874
  try {
@@ -100914,7 +100981,7 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
100914
100981
  return copyDir(src, dest, opts);
100915
100982
  }
100916
100983
  async function mkDirAndCopy(srcMode, src, dest, opts) {
100917
- await mkdir$8(dest);
100984
+ await mkdir$7(dest);
100918
100985
  await copyDir(src, dest, opts);
100919
100986
  return setDestMode(dest, srcMode);
100920
100987
  }
@@ -100930,7 +100997,7 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
100930
100997
  }
100931
100998
  async function onLink(destStat, src, dest) {
100932
100999
  let resolvedSrc = await readlink(src);
100933
- if (!isAbsolute$2(resolvedSrc)) resolvedSrc = resolve$10(dirname$10(src), resolvedSrc);
101000
+ if (!isAbsolute$2(resolvedSrc)) resolvedSrc = resolve$10(dirname$9(src), resolvedSrc);
100934
101001
  if (!destStat) return symlink(resolvedSrc, dest);
100935
101002
  let resolvedDest;
100936
101003
  try {
@@ -100941,7 +101008,7 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
100941
101008
  // istanbul ignore next: should not be possible
100942
101009
  throw err;
100943
101010
  }
100944
- if (!isAbsolute$2(resolvedDest)) resolvedDest = resolve$10(dirname$10(dest), resolvedDest);
101011
+ if (!isAbsolute$2(resolvedDest)) resolvedDest = resolve$10(dirname$9(dest), resolvedDest);
100945
101012
  if (isSrcSubdir(resolvedSrc, resolvedDest)) throw new ERR_FS_CP_EINVAL({
100946
101013
  message: `cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`,
100947
101014
  path: dest,
@@ -100989,11 +101056,11 @@ var require_cp = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
100989
101056
  var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
100990
101057
  const { join: join$12, sep: sep$1 } = require("path");
100991
101058
  const getOptions = require_get_options();
100992
- const { mkdir: mkdir$7, mkdtemp: mkdtemp$1, rm: rm$8 } = require("fs/promises");
101059
+ const { mkdir: mkdir$6, mkdtemp, rm: rm$8 } = require("fs/promises");
100993
101060
  const withTempDir = async (root, fn, opts) => {
100994
101061
  const options = getOptions(opts, { copy: ["tmpPrefix"] });
100995
- await mkdir$7(root, { recursive: true });
100996
- const target = await mkdtemp$1(join$12(`${root}${sep$1}`, options.tmpPrefix || ""));
101062
+ await mkdir$6(root, { recursive: true });
101063
+ const target = await mkdtemp(join$12(`${root}${sep$1}`, options.tmpPrefix || ""));
100997
101064
  let err;
100998
101065
  let result;
100999
101066
  try {
@@ -101028,7 +101095,7 @@ var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((expor
101028
101095
  //#endregion
101029
101096
  //#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/move-file.js
101030
101097
  var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
101031
- const { dirname: dirname$9, join: join$10, resolve: resolve$9, relative: relative$1, isAbsolute: isAbsolute$1 } = require("path");
101098
+ const { dirname: dirname$8, join: join$10, resolve: resolve$9, relative: relative$1, isAbsolute: isAbsolute$1 } = require("path");
101032
101099
  const fs$12 = require("fs/promises");
101033
101100
  const pathExists = async (path$54) => {
101034
101101
  try {
@@ -101045,7 +101112,7 @@ var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
101045
101112
  ...options
101046
101113
  };
101047
101114
  if (!options.overwrite && await pathExists(destination)) throw new Error(`The destination file exists: ${destination}`);
101048
- await fs$12.mkdir(dirname$9(destination), { recursive: true });
101115
+ await fs$12.mkdir(dirname$8(destination), { recursive: true });
101049
101116
  try {
101050
101117
  await fs$12.rename(source, destination);
101051
101118
  } catch (error) {
@@ -101067,7 +101134,7 @@ var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
101067
101134
  if (isAbsolute$1(target)) target = resolve$9(symDestination, relative$1(symSource, target));
101068
101135
  let targetStat = "file";
101069
101136
  try {
101070
- targetStat = await fs$12.stat(resolve$9(dirname$9(symSource), target));
101137
+ targetStat = await fs$12.stat(resolve$9(dirname$8(symSource), target));
101071
101138
  if (targetStat.isDirectory()) targetStat = "junction";
101072
101139
  } catch {}
101073
101140
  await fs$12.symlink(target, symDestination, targetStat);
@@ -101229,7 +101296,7 @@ var require_path = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module
101229
101296
  //#region ../../node_modules/cacache/lib/entry-index.js
101230
101297
  var require_entry_index = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
101231
101298
  const crypto$1 = require("crypto");
101232
- const { appendFile, mkdir: mkdir$6, readFile: readFile$8, readdir: readdir$4, rm: rm$7, writeFile: writeFile$4 } = require("fs/promises");
101299
+ const { appendFile, mkdir: mkdir$5, readFile: readFile$8, readdir: readdir$4, rm: rm$7, writeFile: writeFile$3 } = require("fs/promises");
101233
101300
  const { Minipass } = require_commonjs$10();
101234
101301
  const path$14 = require("path");
101235
101302
  const ssri = require_lib$17();
@@ -101263,7 +101330,7 @@ var require_entry_index = /* @__PURE__ */ require_chunk.__commonJSMin(((exports,
101263
101330
  }).join("\n");
101264
101331
  const setup = async () => {
101265
101332
  const target = tmpName(cache, opts.tmpPrefix);
101266
- await mkdir$6(path$14.dirname(target), { recursive: true });
101333
+ await mkdir$5(path$14.dirname(target), { recursive: true });
101267
101334
  return {
101268
101335
  target,
101269
101336
  moved: false
@@ -101276,8 +101343,8 @@ var require_entry_index = /* @__PURE__ */ require_chunk.__commonJSMin(((exports,
101276
101343
  });
101277
101344
  };
101278
101345
  const write = async (tmp) => {
101279
- await writeFile$4(tmp.target, newIndex, { flag: "wx" });
101280
- await mkdir$6(path$14.dirname(bucket), { recursive: true });
101346
+ await writeFile$3(tmp.target, newIndex, { flag: "wx" });
101347
+ await mkdir$5(path$14.dirname(bucket), { recursive: true });
101281
101348
  await moveFile(tmp.target, bucket);
101282
101349
  tmp.moved = true;
101283
101350
  };
@@ -101301,7 +101368,7 @@ var require_entry_index = /* @__PURE__ */ require_chunk.__commonJSMin(((exports,
101301
101368
  metadata
101302
101369
  };
101303
101370
  try {
101304
- await mkdir$6(path$14.dirname(bucket), { recursive: true });
101371
+ await mkdir$5(path$14.dirname(bucket), { recursive: true });
101305
101372
  const stringified = JSON.stringify(entry);
101306
101373
  await appendFile(bucket, `\n${hashEntry(stringified)}\t${stringified}`);
101307
101374
  } catch (err) {
@@ -106144,7 +106211,7 @@ var require_rm = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
106144
106211
  //#endregion
106145
106212
  //#region ../../node_modules/cacache/lib/verify.js
106146
106213
  var require_verify$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
106147
- const { mkdir: mkdir$5, readFile: readFile$7, rm: rm$5, stat: stat$4, truncate, writeFile: writeFile$3 } = require("fs/promises");
106214
+ const { mkdir: mkdir$4, readFile: readFile$7, rm: rm$5, stat: stat$4, truncate, writeFile: writeFile$2 } = require("fs/promises");
106148
106215
  const contentPath = require_path();
106149
106216
  const fsm = require_lib$15();
106150
106217
  const glob = require_glob();
@@ -106194,7 +106261,7 @@ var require_verify$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
106194
106261
  }
106195
106262
  async function fixPerms(cache, opts) {
106196
106263
  opts.log.silly("verify", "fixing cache permissions");
106197
- await mkdir$5(cache, { recursive: true });
106264
+ await mkdir$4(cache, { recursive: true });
106198
106265
  return null;
106199
106266
  }
106200
106267
  async function garbageCollect(cache, opts) {
@@ -106333,7 +106400,7 @@ var require_verify$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
106333
106400
  async function writeVerifile(cache, opts) {
106334
106401
  const verifile = path$10.join(cache, "_lastverified");
106335
106402
  opts.log.silly("verify", "writing verifile to " + verifile);
106336
- return writeFile$3(verifile, `${Date.now()}`);
106403
+ return writeFile$2(verifile, `${Date.now()}`);
106337
106404
  }
106338
106405
  module.exports.lastRun = lastRun;
106339
106406
  async function lastRun(cache) {
@@ -106884,7 +106951,7 @@ var require_lib$12 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
106884
106951
  var require_lib$11 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
106885
106952
  const bundled = require_lib$12();
106886
106953
  const { readFile: readFile$6, readdir: readdir$3, stat: stat$3 } = require("fs/promises");
106887
- const { resolve: resolve$8, basename: basename$4, dirname: dirname$8 } = require("path");
106954
+ const { resolve: resolve$8, basename: basename$4, dirname: dirname$7 } = require("path");
106888
106955
  const normalizePackageBin = require_lib$21();
106889
106956
  const readPackage = ({ path: path$49, packageJsonCache }) => packageJsonCache.has(path$49) ? Promise.resolve(packageJsonCache.get(path$49)) : readFile$6(path$49).then((json) => {
106890
106957
  const pkg = normalizePackageBin(JSON.parse(json));
@@ -106923,9 +106990,9 @@ var require_lib$11 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
106923
106990
  }));
106924
106991
  if (pkg) {
106925
106992
  if (pkg.bin) {
106926
- const dir = dirname$8(path$51);
106993
+ const dir = dirname$7(path$51);
106927
106994
  const scope = basename$4(dir);
106928
- const nm = /^@.+/.test(scope) ? dirname$8(dir) : dir;
106995
+ const nm = /^@.+/.test(scope) ? dirname$7(dir) : dir;
106929
106996
  const binFiles = [];
106930
106997
  Object.keys(pkg.bin).forEach((b) => {
106931
106998
  const base = resolve$8(nm, ".bin", b);
@@ -110592,9 +110659,9 @@ var require_protected = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
110592
110659
  //#region ../../node_modules/pacote/lib/util/cache-dir.js
110593
110660
  var require_cache_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
110594
110661
  const { resolve: resolve$7 } = require("node:path");
110595
- const { tmpdir: tmpdir$3, homedir } = require("node:os");
110662
+ const { tmpdir, homedir } = require("node:os");
110596
110663
  module.exports = (fakePlatform = false) => {
110597
- const temp = tmpdir$3();
110664
+ const temp = tmpdir();
110598
110665
  const uidOrPid = process.getuid ? process.getuid() : process.pid;
110599
110666
  const home = homedir() || resolve$7(temp, "npm-" + uidOrPid);
110600
110667
  const platform = fakePlatform || process.platform;
@@ -112416,7 +112483,7 @@ var require_lib$10 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
112416
112483
  var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
112417
112484
  const { Walker: IgnoreWalker } = require_lib$10();
112418
112485
  const { lstatSync: lstat$1, readFileSync: readFile$5 } = require("fs");
112419
- const { basename: basename$3, dirname: dirname$7, extname: extname$1, join: join$9, relative, resolve: resolve$6, sep } = require("path");
112486
+ const { basename: basename$3, dirname: dirname$6, extname: extname$1, join: join$9, relative, resolve: resolve$6, sep } = require("path");
112420
112487
  const { log } = require_lib$29();
112421
112488
  const defaultRules = Symbol("npm-packlist.rules.default");
112422
112489
  const strictRules = Symbol("npm-packlist.rules.strict");
@@ -112488,7 +112555,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112488
112555
  const workspaces = options.workspaces.map((ws) => normalizePath(ws));
112489
112556
  // istanbul ignore else - this does nothing unless we need it to
112490
112557
  if (path$47 !== prefix && workspaces.includes(path$47)) {
112491
- const relpath = relative(options.prefix, dirname$7(options.path));
112558
+ const relpath = relative(options.prefix, dirname$6(options.path));
112492
112559
  additionalDefaults.push(...readOutOfTreeIgnoreFiles(options.prefix, relpath));
112493
112560
  } else if (path$47 === prefix) additionalDefaults.push(...workspaces.map((w) => normalizePath(relative(options.path, w))));
112494
112561
  }
@@ -112667,7 +112734,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112667
112734
  //#region ../../node_modules/@npmcli/run-script/lib/set-path.js
112668
112735
  var require_set_path = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
112669
112736
  const { log } = require_lib$29();
112670
- const { resolve: resolve$5, dirname: dirname$6, delimiter: delimiter$2 } = require("path");
112737
+ const { resolve: resolve$5, dirname: dirname$5, delimiter: delimiter$2 } = require("path");
112671
112738
  const nodeGypPath = resolve$5(__dirname, "../lib/node-gyp-bin");
112672
112739
  const setPATH = (projectPath, binPaths, env) => {
112673
112740
  const PATH = Object.keys(env).filter((p) => /^path$/i.test(p) && env[p]).map((p) => env[p].split(delimiter$2)).reduce((set, p) => set.concat(p.filter((concatted) => !set.includes(concatted))), []).join(delimiter$2);
@@ -112685,7 +112752,7 @@ var require_set_path = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
112685
112752
  do {
112686
112753
  pathArr.push(resolve$5(p, "node_modules", ".bin"));
112687
112754
  pp = p;
112688
- p = dirname$6(p);
112755
+ p = dirname$5(p);
112689
112756
  } while (p !== pp);
112690
112757
  pathArr.push(nodeGypPath, PATH);
112691
112758
  const pathVal = pathArr.join(delimiter$2);
@@ -123844,7 +123911,7 @@ var require_auth = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module
123844
123911
  //#endregion
123845
123912
  //#region ../../node_modules/make-fetch-happen/lib/options.js
123846
123913
  var require_options$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
123847
- const dns$2 = require("dns");
123914
+ const dns$3 = require("dns");
123848
123915
  const conditionalHeaders = [
123849
123916
  "if-modified-since",
123850
123917
  "if-none-match",
@@ -123869,7 +123936,7 @@ var require_options$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
123869
123936
  };
123870
123937
  options.dns = {
123871
123938
  ttl: 300 * 1e3,
123872
- lookup: dns$2.lookup,
123939
+ lookup: dns$3.lookup,
123873
123940
  ...options.dns
123874
123941
  };
123875
123942
  options.cache = options.cache || "default";
@@ -125286,9 +125353,9 @@ var require_key$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
125286
125353
  //#region ../../node_modules/@npmcli/agent/lib/dns.js
125287
125354
  var require_dns = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
125288
125355
  const { LRUCache } = require_index_min$5();
125289
- const dns$1 = require("dns");
125356
+ const dns$2 = require("dns");
125290
125357
  const cache = new LRUCache({ max: 50 });
125291
- const getOptions = ({ family = 0, hints = dns$1.ADDRCONFIG, all = false, verbatim = void 0, ttl = 300 * 1e3, lookup = dns$1.lookup }) => ({
125358
+ const getOptions = ({ family = 0, hints = dns$2.ADDRCONFIG, all = false, verbatim = void 0, ttl = 300 * 1e3, lookup = dns$2.lookup }) => ({
125292
125359
  hints,
125293
125360
  lookup: (hostname, ...args) => {
125294
125361
  const callback = args.pop();
@@ -130327,7 +130394,7 @@ var require_dist$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
130327
130394
  const socks_1 = require_build$1();
130328
130395
  const agent_base_1 = require_dist$12();
130329
130396
  const debug_1 = __importDefault(require_src$1());
130330
- const dns = __importStar(require("dns"));
130397
+ const dns$1 = __importStar(require("dns"));
130331
130398
  const net$1 = __importStar(require("net"));
130332
130399
  const tls$1 = __importStar(require("tls"));
130333
130400
  const url_1$1 = require("url");
@@ -130399,7 +130466,7 @@ var require_dist$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
130399
130466
  const { shouldLookup, proxy, timeout } = this;
130400
130467
  if (!opts.host) throw new Error("No `host` defined!");
130401
130468
  let { host } = opts;
130402
- const { port, lookup: lookupFn = dns.lookup } = opts;
130469
+ const { port, lookup: lookupFn = dns$1.lookup } = opts;
130403
130470
  if (shouldLookup) host = await new Promise((resolve, reject) => {
130404
130471
  lookupFn(host, {}, (err, res) => {
130405
130472
  if (err) reject(err);
@@ -142036,8 +142103,8 @@ var require_registry = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
142036
142103
  //#endregion
142037
142104
  //#region ../../node_modules/pacote/lib/fetcher.js
142038
142105
  var require_fetcher = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
142039
- const { basename: basename$2, dirname: dirname$5 } = require("node:path");
142040
- const { rm: rm$4, mkdir: mkdir$4 } = require("node:fs/promises");
142106
+ const { basename: basename$2, dirname: dirname$4 } = require("node:path");
142107
+ const { rm: rm$4, mkdir: mkdir$3 } = require("node:fs/promises");
142041
142108
  const PackageJson = require_lib$18();
142042
142109
  const cacache = require_lib$14();
142043
142110
  const fsm = require_lib$13();
@@ -142085,7 +142152,7 @@ var require_fetcher = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mod
142085
142152
  this.npmBin = opts.npmBin || "npm";
142086
142153
  this.npmInstallCmd = opts.npmInstallCmd || ["install", "--force"];
142087
142154
  this.npmCliConfig = opts.npmCliConfig || [
142088
- `--cache=${dirname$5(this.cache)}`,
142155
+ `--cache=${dirname$4(this.cache)}`,
142089
142156
  `--prefer-offline=${!!this.preferOffline}`,
142090
142157
  `--prefer-online=${!!this.preferOnline}`,
142091
142158
  `--offline=${!!this.offline}`,
@@ -142221,7 +142288,7 @@ var require_fetcher = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mod
142221
142288
  }
142222
142289
  async #mkdir(dest) {
142223
142290
  await this.#empty(dest);
142224
- return await mkdir$4(dest, { recursive: true });
142291
+ return await mkdir$3(dest, { recursive: true });
142225
142292
  }
142226
142293
  async extract(dest) {
142227
142294
  await this.#mkdir(dest);
@@ -142241,7 +142308,7 @@ var require_fetcher = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mod
142241
142308
  }));
142242
142309
  }
142243
142310
  async tarballFile(dest) {
142244
- await mkdir$4(dirname$5(dest), { recursive: true });
142311
+ await mkdir$3(dirname$4(dest), { recursive: true });
142245
142312
  return this.#toFile(dest);
142246
142313
  }
142247
142314
  #extract(dest, tarball) {
@@ -150666,7 +150733,7 @@ var require_error = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
150666
150733
  const { promisify } = require("util");
150667
150734
  const path$3 = require("path");
150668
150735
  const { createHash } = require("crypto");
150669
- const { realpath: realpath$1, lstat, createReadStream, readdir: readdir$2 } = require("fs");
150736
+ const { realpath, lstat, createReadStream, readdir: readdir$2 } = require("fs");
150670
150737
  const url = require("url");
150671
150738
  const slasher = require_glob_slash();
150672
150739
  const minimatch = require_minimatch();
@@ -150989,7 +151056,7 @@ var require_error = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
150989
151056
  };
150990
151057
  const getHandlers = (methods) => Object.assign({
150991
151058
  lstat: promisify(lstat),
150992
- realpath: promisify(realpath$1),
151059
+ realpath: promisify(realpath),
150993
151060
  createReadStream,
150994
151061
  readdir: promisify(readdir$2),
150995
151062
  sendError
@@ -151128,8 +151195,6 @@ const sendStartupProgress = (message) => {
151128
151195
  };
151129
151196
  //#endregion
151130
151197
  //#region ../../packages/core-node/src/utils/remote.ts
151131
- const DEFAULT_NODE_VERSION = "24.14.1";
151132
- const DEFAULT_PNPM_VERSION = "10.12.0";
151133
151198
  function isPackageComplete(packageDir) {
151134
151199
  return (0, node_fs.existsSync)((0, node_path.join)(packageDir, "package.json"));
151135
151200
  }
@@ -151170,6 +151235,20 @@ async function withLock(key, fn) {
151170
151235
  activeOperations.set(key, promise);
151171
151236
  return promise;
151172
151237
  }
151238
+ let isOnlineCached = null;
151239
+ let lastCheckTime = 0;
151240
+ async function isOnline() {
151241
+ const now = Date.now();
151242
+ if (isOnlineCached !== null && now - lastCheckTime < 1e4) return isOnlineCached;
151243
+ try {
151244
+ await Promise.race([node_dns_promises.default.lookup("registry.npmjs.org"), new Promise((_, reject) => setTimeout(() => reject(/* @__PURE__ */ new Error("timeout")), 1500))]);
151245
+ isOnlineCached = true;
151246
+ } catch {
151247
+ isOnlineCached = false;
151248
+ }
151249
+ lastCheckTime = now;
151250
+ return isOnlineCached;
151251
+ }
151173
151252
  /**
151174
151253
  * Robust utility to fetch, cache, and resolve an NPM package.
151175
151254
  * Centralized in core-node to avoid circular dependencies.
@@ -151196,7 +151275,15 @@ async function fetchPackage(packageName, versionOrRange, options) {
151196
151275
  if (resolvedVersionOrRange === "local") resolvedVersionOrRange = "latest";
151197
151276
  console.log(`[Fetcher] Resolving ${packageName}@${resolvedVersionOrRange || "latest"}...`);
151198
151277
  const resolveStart = Date.now();
151199
- try {
151278
+ if (!await isOnline()) {
151279
+ console.warn(`[Fetcher] ${packageName}: offline mode detected (${Date.now() - resolveStart}ms), trying local fallback...`);
151280
+ const fallbackStart = Date.now();
151281
+ const fallbackVersion = await tryLocalFallback(resolvedVersionOrRange, /* @__PURE__ */ new Error("Offline"), baseDir, packageName);
151282
+ if (fallbackVersion) {
151283
+ resolvedVersion = fallbackVersion;
151284
+ console.log(`[Fetcher] ${packageName}: Resolved to local fallback ${resolvedVersion} (${Date.now() - fallbackStart}ms)`);
151285
+ } else throw new Error(`Offline and no local fallback version available for ${packageName}`);
151286
+ } else try {
151200
151287
  const cachePath = (0, node_path.join)(ctx.userDataPath, "cache", "pacote");
151201
151288
  let packumentPromise = packumentRequests.get(packageName);
151202
151289
  if (!packumentPromise) {
@@ -151206,7 +151293,16 @@ async function fetchPackage(packageName, versionOrRange, options) {
151206
151293
  const packument = await packumentPromise;
151207
151294
  const versions = Object.keys(packument.versions);
151208
151295
  const range = resolvedVersionOrRange || "latest";
151209
- const foundVersion = packument["dist-tags"]?.[range] || import_semver$1.default.maxSatisfying(versions, range);
151296
+ let foundVersion = packument["dist-tags"]?.[range] || import_semver$1.default.maxSatisfying(versions, range);
151297
+ if (range === "latest" && ctx.releaseTag && ctx.releaseTag !== "latest") {
151298
+ const releaseTagVersion = packument["dist-tags"]?.[ctx.releaseTag];
151299
+ if (releaseTagVersion && import_semver$1.default.valid(releaseTagVersion)) {
151300
+ if (!foundVersion || import_semver$1.default.valid(foundVersion) && import_semver$1.default.gte(releaseTagVersion, foundVersion)) {
151301
+ console.log(`[Fetcher] Using release tag "${ctx.releaseTag}" (${releaseTagVersion}) instead of "latest" (${foundVersion || "none"}) for ${packageName}`);
151302
+ foundVersion = releaseTagVersion;
151303
+ } else if (foundVersion) console.warn(`[Fetcher] Tag "${ctx.releaseTag}" (${releaseTagVersion}) is older than "latest" (${foundVersion}) for ${packageName}, keeping "latest"`);
151304
+ }
151305
+ }
151210
151306
  if (!foundVersion) throw new Error(`Package ${packageName}@${range} not found on npm (available tags: ${Object.keys(packument["dist-tags"] || {}).join(", ")})`);
151211
151307
  resolvedVersion = foundVersion;
151212
151308
  console.log(`[Fetcher] ${packageName}: Resolved to v${resolvedVersion} via npm (${Date.now() - resolveStart}ms)`);
@@ -151321,7 +151417,7 @@ async function ensureNodeJS(context, version = DEFAULT_NODE_VERSION) {
151321
151417
  const extension = isWindows ? "zip" : "tar.gz";
151322
151418
  const fileName = `node-v${version}-${platform === "osx" ? "darwin" : platform}-${arch}.${extension}`;
151323
151419
  const downloadUrl = `https://nodejs.org/dist/v${version}/${fileName}`;
151324
- const tempDir = await generateTempFolder$1((0, node_os.tmpdir)());
151420
+ const tempDir = await context.createTempFolder("node-download-");
151325
151421
  const archivePath = (0, node_path.join)(tempDir, fileName);
151326
151422
  sendStartupProgress(`Downloading Node.js v${version}...`);
151327
151423
  console.log(`Downloading Node.js from ${downloadUrl}...`);
@@ -151556,15 +151652,6 @@ if (isDev && projectRoot) {
151556
151652
  //#region ../plugin-core/src/pipelab.ts
151557
151653
  const createActionRunner = (runner) => runner;
151558
151654
  //#endregion
151559
- //#region ../plugin-core/src/fs-utils.ts
151560
- const generateTempFolder = async (base) => {
151561
- const targetBase = base || (0, node_os.tmpdir)();
151562
- await (0, node_fs_promises.mkdir)(targetBase, { recursive: true });
151563
- const realPath = await (0, node_fs_promises.realpath)(targetBase);
151564
- console.log("join", (0, node_path.join)(realPath, "pipelab-"));
151565
- return await (0, node_fs_promises.mkdtemp)((0, node_path.join)(realPath, "pipelab-"));
151566
- };
151567
- //#endregion
151568
151655
  //#region ../plugin-core/src/node-utils.ts
151569
151656
  const fileExists = async (path) => {
151570
151657
  try {
@@ -152092,7 +152179,7 @@ const forge = async (action, appFolder, { cwd, log, inputs, setOutput, paths, ab
152092
152179
  log("Building electron");
152093
152180
  if (action !== "preview") await detectRuntime(appFolder);
152094
152181
  const { modules, node } = paths;
152095
- const destinationFolder = await generateTempFolder(paths.cache);
152182
+ const destinationFolder = await context.createTempFolder("electron-forge-");
152096
152183
  log(`Staging build in ${destinationFolder}`);
152097
152184
  try {
152098
152185
  const forge = (0, node_path.join)(destinationFolder, "node_modules", "@electron-forge", "cli", "dist", "electron-forge.js");