@swmansion/argent 0.29.1-next.19 → 0.29.1-next.20

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/cli-cmds.mjs CHANGED
@@ -7377,322 +7377,395 @@ var require_dist = __commonJS({
7377
7377
  }
7378
7378
  });
7379
7379
 
7380
- // ../../node_modules/dotenv/lib/main.js
7381
- var require_main = __commonJS({
7382
- "../../node_modules/dotenv/lib/main.js"(exports, module) {
7383
- var fs18 = __require("fs");
7384
- var path24 = __require("path");
7385
- var os4 = __require("os");
7386
- var crypto3 = __require("crypto");
7387
- var TIPS = [
7388
- "\u25C8 encrypted .env [www.dotenvx.com]",
7389
- "\u25C8 secrets for agents [www.dotenvx.com]",
7390
- "\u2301 auth for agents [www.vestauth.com]",
7391
- "\u2318 custom filepath { path: '/custom/path/.env' }",
7392
- "\u2318 enable debugging { debug: true }",
7393
- "\u2318 override existing { override: true }",
7394
- "\u2318 suppress logs { quiet: true }",
7395
- "\u2318 multiple files { path: ['.env.local', '.env'] }"
7396
- ];
7397
- function _getRandomTip() {
7398
- return TIPS[Math.floor(Math.random() * TIPS.length)];
7399
- }
7400
- function parseBoolean(value) {
7401
- if (typeof value === "string") {
7402
- return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
7403
- }
7404
- return Boolean(value);
7405
- }
7406
- function supportsAnsi() {
7407
- return process.stdout.isTTY;
7408
- }
7409
- function dim2(text2) {
7410
- return supportsAnsi() ? `\x1B[2m${text2}\x1B[0m` : text2;
7411
- }
7412
- var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
7413
- function parse3(src) {
7414
- const obj = {};
7415
- let lines = src.toString();
7416
- lines = lines.replace(/\r\n?/mg, "\n");
7417
- let match;
7418
- while ((match = LINE.exec(lines)) != null) {
7419
- const key = match[1];
7420
- let value = match[2] || "";
7421
- value = value.trim();
7422
- const maybeQuote = value[0];
7423
- value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
7424
- if (maybeQuote === '"') {
7425
- value = value.replace(/\\n/g, "\n");
7426
- value = value.replace(/\\r/g, "\r");
7427
- }
7428
- obj[key] = value;
7429
- }
7430
- return obj;
7431
- }
7432
- function _parseVault(options) {
7433
- options = options || {};
7434
- const vaultPath = _vaultPath(options);
7435
- options.path = vaultPath;
7436
- const result = DotenvModule.configDotenv(options);
7437
- if (!result.parsed) {
7438
- const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
7439
- err.code = "MISSING_DATA";
7440
- throw err;
7380
+ // ../../node_modules/dotenv/dist/index.cjs
7381
+ var require_dist2 = __commonJS({
7382
+ "../../node_modules/dotenv/dist/index.cjs"(exports, module) {
7383
+ var j = (e, n3) => () => {
7384
+ try {
7385
+ return n3 || e((n3 = { exports: {} }).exports, n3), n3.exports;
7386
+ } catch (t2) {
7387
+ throw n3 = 0, t2;
7441
7388
  }
7442
- const keys = _dotenvKey(options).split(",");
7443
- const length = keys.length;
7444
- let decrypted;
7445
- for (let i2 = 0; i2 < length; i2++) {
7446
- try {
7447
- const key = keys[i2].trim();
7448
- const attrs = _instructions(result, key);
7449
- decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
7450
- break;
7451
- } catch (error63) {
7452
- if (i2 + 1 >= length) {
7453
- throw error63;
7454
- }
7389
+ };
7390
+ var k = j((xe, U2) => {
7391
+ function G(e) {
7392
+ return typeof e == "string" ? !["false", "0", "no", "off", ""].includes(e.toLowerCase()) : !!e;
7393
+ }
7394
+ function Y(e = process.env) {
7395
+ let n3 = {};
7396
+ for (let t2 of ["ENCODING", "PATH", "QUIET", "DEBUG", "OVERRIDE", "FAST"]) {
7397
+ let o = e[`DOTENV_${t2}`] != null ? e[`DOTENV_${t2}`] : e[`DOTENV_CONFIG_${t2}`];
7398
+ o != null && (n3[t2.toLowerCase()] = t2 === "ENCODING" || t2 === "PATH" ? o : G(o));
7455
7399
  }
7400
+ return n3;
7456
7401
  }
7457
- return DotenvModule.parse(decrypted);
7458
- }
7459
- function _warn(message) {
7460
- console.error(`\u26A0 ${message}`);
7461
- }
7462
- function _debug(message) {
7463
- console.log(`\u2506 ${message}`);
7464
- }
7465
- function _log(message) {
7466
- console.log(`\u25C7 ${message}`);
7467
- }
7468
- function _dotenvKey(options) {
7469
- if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
7470
- return options.DOTENV_KEY;
7402
+ U2.exports = { parseBoolean: G, optionsFromEnv: Y };
7403
+ });
7404
+ var N = j((ye, x) => {
7405
+ var z2 = __require("fs"), I2 = __require("path"), Z = __require("os"), { URL: ee, fileURLToPath: te } = __require("url"), { parseBoolean: $, optionsFromEnv: B } = k(), re2 = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg, b = new Uint8Array(256);
7406
+ for (let e = 48; e <= 57; e++) b[e] = 1;
7407
+ for (let e = 65; e <= 90; e++) b[e] = 1;
7408
+ for (let e = 97; e <= 122; e++) b[e] = 1;
7409
+ b[45] = 1;
7410
+ b[46] = 1;
7411
+ b[95] = 1;
7412
+ function ne(e) {
7413
+ let n3 = {}, t2 = e.toString();
7414
+ t2 = t2.replace(/\r\n?/mg, `
7415
+ `);
7416
+ let o;
7417
+ for (; (o = re2.exec(t2)) != null; ) {
7418
+ let r2 = o[1], s = o[2] || "";
7419
+ s = s.trim();
7420
+ let i2 = s[0];
7421
+ s = s.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"), i2 === '"' && (s = s.replace(/\\n/g, `
7422
+ `), s = s.replace(/\\r/g, "\r")), n3[r2] = s;
7423
+ }
7424
+ return n3;
7471
7425
  }
7472
- if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
7473
- return process.env.DOTENV_KEY;
7426
+ function w(e) {
7427
+ return e <= 32 ? e === 32 || e >= 9 && e <= 13 : e >= 160 && (e === 160 || e === 5760 || e >= 8192 && e <= 8202 || e === 8232 || e === 8233 || e === 8239 || e === 8287 || e === 12288 || e === 65279);
7474
7428
  }
7475
- return "";
7476
- }
7477
- function _instructions(result, dotenvKey) {
7478
- let uri;
7479
- try {
7480
- uri = new URL(dotenvKey);
7481
- } catch (error63) {
7482
- if (error63.code === "ERR_INVALID_URL") {
7483
- const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
7484
- err.code = "INVALID_DOTENV_KEY";
7485
- throw err;
7429
+ function q(e) {
7430
+ return e === 10 || e === 8232 || e === 8233;
7431
+ }
7432
+ function oe(e) {
7433
+ let n3 = {}, t2 = typeof e == "string" ? e : e.toString();
7434
+ t2.indexOf("\r") !== -1 && (t2 = t2.replace(/\r\n?/g, `
7435
+ `));
7436
+ let o = t2.length, r2 = 0;
7437
+ for (; r2 < o; ) {
7438
+ let s = t2.charCodeAt(r2);
7439
+ for (; r2 < o && w(s); ) r2++, s = t2.charCodeAt(r2);
7440
+ if (r2 >= o) break;
7441
+ if (s === 35) {
7442
+ for (; r2 < o && !q(t2.charCodeAt(r2)); ) r2++;
7443
+ continue;
7444
+ }
7445
+ let i2 = -1;
7446
+ if (s === 101 && r2 + 6 < o && t2.charCodeAt(r2 + 1) === 120 && t2.charCodeAt(r2 + 2) === 112 && t2.charCodeAt(r2 + 3) === 111 && t2.charCodeAt(r2 + 4) === 114 && t2.charCodeAt(r2 + 5) === 116) {
7447
+ let v = t2.charCodeAt(r2 + 6);
7448
+ if (w(v)) {
7449
+ let u3 = r2 + 7;
7450
+ for (; u3 < o && w(t2.charCodeAt(u3)); ) u3++;
7451
+ b[t2.charCodeAt(u3)] && (i2 = r2 + 6, r2 = u3);
7452
+ } else s = t2.charCodeAt(r2);
7453
+ }
7454
+ let l2 = r2, d = 0;
7455
+ for (; r2 < o && (d = t2.charCodeAt(r2), b[d]); ) r2++;
7456
+ if (r2 === l2) {
7457
+ for (; r2 < o && !q(t2.charCodeAt(r2)); ) r2++;
7458
+ continue;
7459
+ }
7460
+ let h2 = t2.slice(l2, r2), f = r2;
7461
+ if (r2 >= o && (d = 0), w(d)) do
7462
+ r2++, d = r2 < o ? t2.charCodeAt(r2) : 0;
7463
+ while (w(d));
7464
+ if (d === 61) r2++;
7465
+ else if (d === 58 && r2 === f && r2 + 1 < o && w(t2.charCodeAt(r2 + 1))) r2 += 2;
7466
+ else {
7467
+ for (r2 = i2 === -1 ? f : i2; r2 < o && !q(t2.charCodeAt(r2)); ) r2++;
7468
+ continue;
7469
+ }
7470
+ let c2 = r2, a2 = r2;
7471
+ for (; a2 < o && w(t2.charCodeAt(a2)); ) a2++;
7472
+ let g = t2.charCodeAt(a2), p, y2 = false;
7473
+ if (g === 39 || g === 34 || g === 96) {
7474
+ let v = t2[a2], u3 = t2.indexOf(v, a2 + 1), m = -1, C = -1;
7475
+ for (; u3 !== -1; ) {
7476
+ let O = t2.charCodeAt(u3 - 1) === 92, E = u3 + 1;
7477
+ for (; E < o && !q(t2.charCodeAt(E)) && w(t2.charCodeAt(E)); ) E++;
7478
+ if ((E === o || q(t2.charCodeAt(E)) || t2.charCodeAt(E) === 35) && (m = u3, C = E), !O) break;
7479
+ u3 = t2.indexOf(v, u3 + 1);
7480
+ }
7481
+ if (m !== -1) {
7482
+ if (p = t2.slice(a2 + 1, m), r2 = C, t2.charCodeAt(r2) === 35) for (; r2 < o && !q(t2.charCodeAt(r2)); ) r2++;
7483
+ y2 = true;
7484
+ }
7485
+ }
7486
+ if (!y2) {
7487
+ let v = t2.indexOf(`
7488
+ `, c2);
7489
+ v === -1 && (v = o);
7490
+ let u3;
7491
+ if (o < 4096) u3 = t2.indexOf("#", c2), (u3 === -1 || u3 > v) && (u3 = v);
7492
+ else for (u3 = c2; u3 < v && t2.charCodeAt(u3) !== 35; ) u3++;
7493
+ let m = c2, C = u3;
7494
+ for (; m < C && w(t2.charCodeAt(m)); ) m++;
7495
+ for (; C > m && w(t2.charCodeAt(C - 1)); ) C--;
7496
+ let O = t2.charCodeAt(m);
7497
+ if (p = t2.slice(m, C), p.includes("\u2028") || p.includes("\u2029") ? p = p.replace(/^(['"`])([\s\S]*)\1$/mg, "$2") : C - m >= 2 && (O === 39 || O === 34 || O === 96) && t2.charCodeAt(C - 1) === O && (p = t2.slice(m + 1, C - 1)), r2 = u3, u3 < v) for (; r2 < o && !q(t2.charCodeAt(r2)); ) r2++;
7498
+ }
7499
+ g === 34 && (y2 || a2 < r2) && p.indexOf("\\") !== -1 && (p = p.replace(/\\n/g, `
7500
+ `).replace(/\\r/g, "\r")), n3[h2] = p;
7486
7501
  }
7487
- throw error63;
7502
+ return n3;
7488
7503
  }
7489
- const key = uri.password;
7490
- if (!key) {
7491
- const err = new Error("INVALID_DOTENV_KEY: Missing key part");
7492
- err.code = "INVALID_DOTENV_KEY";
7493
- throw err;
7504
+ function se(e, n3) {
7505
+ return n3 && $(n3.fast) ? oe(e) : ne(e);
7494
7506
  }
7495
- const environment = uri.searchParams.get("environment");
7496
- if (!environment) {
7497
- const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
7498
- err.code = "INVALID_DOTENV_KEY";
7499
- throw err;
7507
+ function T(e) {
7508
+ console.log(`\u2506 ${e}`);
7500
7509
  }
7501
- const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
7502
- const ciphertext = result.parsed[environmentKey];
7503
- if (!ciphertext) {
7504
- const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
7505
- err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
7506
- throw err;
7510
+ function ie(e) {
7511
+ console.error(`\u25C7 ${e}`);
7507
7512
  }
7508
- return { ciphertext, key };
7509
- }
7510
- function _vaultPath(options) {
7511
- let possibleVaultPath = null;
7512
- if (options && options.path && options.path.length > 0) {
7513
- if (Array.isArray(options.path)) {
7514
- for (const filepath of options.path) {
7515
- if (fs18.existsSync(filepath)) {
7516
- possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
7517
- }
7513
+ function V(e) {
7514
+ return e[0] === "~" ? I2.join(Z.homedir(), e.slice(1)) : e;
7515
+ }
7516
+ function ce(e = {}) {
7517
+ let n3 = { ...e };
7518
+ for (let t2 of Object.keys(n3)) n3[t2] === void 0 && delete n3[t2];
7519
+ return { ...B(), ...n3 };
7520
+ }
7521
+ function ae(e) {
7522
+ e = ce(e);
7523
+ let n3 = I2.resolve(process.cwd(), ".env"), t2 = "utf8", o = process.env;
7524
+ e && e.processEnv != null && (o = e.processEnv);
7525
+ let r2 = $(e && e.debug);
7526
+ e && e.encoding ? t2 = e.encoding : r2 && T("no encoding is specified (UTF-8 is used by default)");
7527
+ let s = [n3];
7528
+ if (e && e.path) if (!Array.isArray(e.path)) s = [V(e.path)];
7529
+ else {
7530
+ s = [];
7531
+ for (let c2 of e.path) s.push(V(c2));
7532
+ }
7533
+ let i2, l2 = {}, d = { fast: e.fast };
7534
+ for (let c2 of s) try {
7535
+ let a2 = A.parse(z2.readFileSync(c2, { encoding: t2 }), d);
7536
+ A.populate(l2, a2, e);
7537
+ } catch (a2) {
7538
+ r2 && T(`failed to load ${c2} ${a2.message}`), i2 = a2;
7539
+ }
7540
+ let h2 = A.populate(o, l2, e), f = $(Object.prototype.hasOwnProperty.call(e, "quiet") ? e.quiet : B(o).quiet);
7541
+ if (r2 || !f) {
7542
+ let c2 = Object.keys(h2).length, a2 = [];
7543
+ for (let g of s) try {
7544
+ let p = I2.relative(process.cwd(), g instanceof ee ? te(g) : g);
7545
+ a2.push(p);
7546
+ } catch (p) {
7547
+ r2 && T(`failed to load ${g} ${p.message}`), i2 = p;
7518
7548
  }
7519
- } else {
7520
- possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
7549
+ ie(`injected env (${c2}) from ${a2.join(",")}`);
7521
7550
  }
7522
- } else {
7523
- possibleVaultPath = path24.resolve(process.cwd(), ".env.vault");
7551
+ return i2 ? { parsed: l2, error: i2 } : { parsed: l2 };
7524
7552
  }
7525
- if (fs18.existsSync(possibleVaultPath)) {
7526
- return possibleVaultPath;
7553
+ function le(e) {
7554
+ return A.configDotenv(e);
7527
7555
  }
7528
- return null;
7529
- }
7530
- function _resolveHome(envPath) {
7531
- return envPath[0] === "~" ? path24.join(os4.homedir(), envPath.slice(1)) : envPath;
7532
- }
7533
- function _configVault(options) {
7534
- const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
7535
- const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
7536
- if (debug || !quiet) {
7537
- _log("loading env from encrypted .env.vault");
7538
- }
7539
- const parsed = DotenvModule._parseVault(options);
7540
- let processEnv = process.env;
7541
- if (options && options.processEnv != null) {
7542
- processEnv = options.processEnv;
7543
- }
7544
- DotenvModule.populate(processEnv, parsed, options);
7545
- return { parsed };
7546
- }
7547
- function configDotenv(options) {
7548
- const dotenvPath = path24.resolve(process.cwd(), ".env");
7549
- let encoding = "utf8";
7550
- let processEnv = process.env;
7551
- if (options && options.processEnv != null) {
7552
- processEnv = options.processEnv;
7553
- }
7554
- let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
7555
- let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
7556
- if (options && options.encoding) {
7557
- encoding = options.encoding;
7558
- } else {
7559
- if (debug) {
7560
- _debug("no encoding is specified (UTF-8 is used by default)");
7556
+ function fe(e, n3, t2 = {}) {
7557
+ let o = $(t2 && t2.debug), r2 = $(t2 && t2.override), s = {};
7558
+ if (e === null || typeof e != "object" || n3 === null || typeof n3 != "object") {
7559
+ let i2 = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
7560
+ throw i2.code = "OBJECT_REQUIRED", i2;
7561
7561
  }
7562
+ for (let i2 of Object.keys(n3)) Object.prototype.hasOwnProperty.call(e, i2) ? (r2 === true && (e[i2] = n3[i2], s[i2] = n3[i2]), o && T(r2 === true ? `"${i2}" is already defined and WAS overwritten` : `"${i2}" is already defined and was NOT overwritten`)) : (e[i2] = n3[i2], s[i2] = n3[i2]);
7563
+ return s;
7562
7564
  }
7563
- let optionPaths = [dotenvPath];
7564
- if (options && options.path) {
7565
- if (!Array.isArray(options.path)) {
7566
- optionPaths = [_resolveHome(options.path)];
7567
- } else {
7568
- optionPaths = [];
7569
- for (const filepath of options.path) {
7570
- optionPaths.push(_resolveHome(filepath));
7565
+ var A = { configDotenv: ae, config: le, parse: se, populate: fe };
7566
+ x.exports.configDotenv = A.configDotenv;
7567
+ x.exports.config = A.config;
7568
+ x.exports.parse = A.parse;
7569
+ x.exports.populate = A.populate;
7570
+ x.exports = A;
7571
+ });
7572
+ var M = j((Te, W2) => {
7573
+ var _ = __require("child_process"), ue = __require("fs"), L = __require("path");
7574
+ function de(e) {
7575
+ let n3 = ['"'], t2 = 0;
7576
+ for (let o of e) {
7577
+ if (o === "\\") {
7578
+ t2++;
7579
+ continue;
7571
7580
  }
7581
+ o === '"' ? n3.push("\\".repeat(t2 * 2 + 1), '"') : n3.push("\\".repeat(t2), o), t2 = 0;
7572
7582
  }
7583
+ return n3.push("\\".repeat(t2 * 2), '"'), n3.join("");
7573
7584
  }
7574
- let lastError;
7575
- const parsedAll = {};
7576
- for (const path25 of optionPaths) {
7577
- try {
7578
- const parsed = DotenvModule.parse(fs18.readFileSync(path25, { encoding }));
7579
- DotenvModule.populate(parsedAll, parsed, options);
7580
- } catch (e) {
7581
- if (debug) {
7582
- _debug(`failed to load ${path25} ${e.message}`);
7585
+ function H(e, n3 = 1) {
7586
+ for (let t2 = 0; t2 < n3; t2++) {
7587
+ let o = [];
7588
+ for (let r2 of e) {
7589
+ let s = r2.charCodeAt(0), i2 = s >= 48 && s <= 57 || s >= 65 && s <= 90 || s >= 97 && s <= 122, l2 = "\\/:._-".includes(r2);
7590
+ !i2 && !l2 && s < 128 && o.push("^"), o.push(r2);
7583
7591
  }
7584
- lastError = e;
7592
+ e = o.join("");
7585
7593
  }
7594
+ return e;
7595
+ }
7596
+ function P(e, n3) {
7597
+ let t2 = Object.keys(e).reverse().find((o) => o.toUpperCase() === n3);
7598
+ return t2 === void 0 ? void 0 : e[t2];
7586
7599
  }
7587
- const populated = DotenvModule.populate(processEnv, parsedAll, options);
7588
- debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
7589
- quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
7590
- if (debug || !quiet) {
7591
- const keysCount = Object.keys(populated).length;
7592
- const shortPaths = [];
7593
- for (const filePath of optionPaths) {
7600
+ function pe(e, n3, t2) {
7601
+ let o = (P(n3, "PATHEXT") || ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean), s = o.some((l2) => e.toLowerCase().endsWith(l2.toLowerCase())) ? ["", ...o] : [...o, ""], i2 = /[\\/]/.test(e) ? [t2] : [t2, ...(P(n3, "PATH") || "").split(";")];
7602
+ for (let l2 of i2) for (let d of s) {
7603
+ let h2 = L.resolve(t2, l2.replace(/^"|"$/g, ""), e + d);
7594
7604
  try {
7595
- const relative3 = path24.relative(process.cwd(), filePath);
7596
- shortPaths.push(relative3);
7597
- } catch (e) {
7598
- if (debug) {
7599
- _debug(`failed to load ${filePath} ${e.message}`);
7600
- }
7601
- lastError = e;
7605
+ if (ue.statSync(h2).isFile()) return h2;
7606
+ } catch {
7602
7607
  }
7603
7608
  }
7604
- _log(`injected env (${keysCount}) from ${shortPaths.join(",")} ${dim2(`// tip: ${_getRandomTip()}`)}`);
7605
7609
  }
7606
- if (lastError) {
7607
- return { parsed: parsedAll, error: lastError };
7608
- } else {
7609
- return { parsed: parsedAll };
7610
- }
7611
- }
7612
- function config3(options) {
7613
- if (_dotenvKey(options).length === 0) {
7614
- return DotenvModule.configDotenv(options);
7610
+ function he(e, n3, t2) {
7611
+ if (process.platform !== "win32") return _.spawn(e, n3, t2);
7612
+ let o = t2.env || process.env, r2 = pe(e, o, t2.cwd || process.cwd());
7613
+ if (r2 && /\.(?:exe|com)$/i.test(r2)) return _.spawn(r2, n3, t2);
7614
+ let s = /\.(?:bat|cmd)$/i.test(r2 || e), i2 = [H(L.normalize(r2 || e))];
7615
+ for (let d of n3) i2.push(H(de(d), s ? 2 : 1));
7616
+ let l2 = i2.join(" ");
7617
+ return _.spawn(P(o, "COMSPEC") || "cmd.exe", ["/d", "/v:off", "/s", "/c", `"${l2}"`], { ...t2, windowsVerbatimArguments: true });
7615
7618
  }
7616
- const vaultPath = _vaultPath(options);
7617
- if (!vaultPath) {
7618
- _warn(`you set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}`);
7619
- return DotenvModule.configDotenv(options);
7619
+ W2.exports = he;
7620
+ });
7621
+ var X = j(($e, F) => {
7622
+ var ge = __require("fs"), me = __require("os"), Q = __require("path"), ve = __require("child_process"), Ce = M(), R2 = N(), { optionsFromEnv: J } = k();
7623
+ function D() {
7624
+ console.log(["Usage: dotenv run [--help] [-q|--quiet] [--debug] [--override] [--fast] [-f|--file <paths>] [--] <command> [args...]", "", "Run a command with environment variables from a .env file.", "Place dotenv options before the command; all following arguments go to the command.", "", "Options:", " -f, --file <paths> .env paths, comma-separated or repeated (default: .env)", " -q, --quiet suppress the injected env message", " --debug enable debug logging", " --override override existing environment variables", " --fast use the faster character-scanner parser", "", "Environment variables (DOTENV_CONFIG_* names remain as fallbacks):", " DOTENV_PATH, DOTENV_ENCODING, DOTENV_QUIET,", " DOTENV_DEBUG, DOTENV_OVERRIDE,", " DOTENV_FAST"].join(`
7625
+ `));
7620
7626
  }
7621
- return DotenvModule._configVault(options);
7622
- }
7623
- function decrypt(encrypted, keyStr) {
7624
- const key = Buffer.from(keyStr.slice(-64), "hex");
7625
- let ciphertext = Buffer.from(encrypted, "base64");
7626
- const nonce = ciphertext.subarray(0, 12);
7627
- const authTag = ciphertext.subarray(-16);
7628
- ciphertext = ciphertext.subarray(12, -16);
7629
- try {
7630
- const aesgcm = crypto3.createDecipheriv("aes-256-gcm", key, nonce);
7631
- aesgcm.setAuthTag(authTag);
7632
- return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
7633
- } catch (error63) {
7634
- const isRange = error63 instanceof RangeError;
7635
- const invalidKeyLength = error63.message === "Invalid key length";
7636
- const decryptionFailed = error63.message === "Unsupported state or unable to authenticate data";
7637
- if (isRange || invalidKeyLength) {
7638
- const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
7639
- err.code = "INVALID_DOTENV_KEY";
7640
- throw err;
7641
- } else if (decryptionFailed) {
7642
- const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
7643
- err.code = "DECRYPTION_FAILED";
7644
- throw err;
7645
- } else {
7646
- throw error63;
7627
+ function we(e) {
7628
+ let n3 = [], t2 = false, o, r2, s, i2, l2 = -1;
7629
+ for (let h2 = 0; h2 < e.length; h2++) {
7630
+ let f = e[h2];
7631
+ if (f === "--") {
7632
+ l2 = h2 + 1;
7633
+ break;
7634
+ }
7635
+ if (f === "--help" || f === "-h") return { help: true };
7636
+ if (f === "--quiet" || f === "-q") {
7637
+ o = true;
7638
+ continue;
7639
+ }
7640
+ if (f === "--debug") {
7641
+ r2 = true;
7642
+ continue;
7643
+ }
7644
+ if (f === "--override") {
7645
+ s = true;
7646
+ continue;
7647
+ }
7648
+ if (f === "--fast") {
7649
+ i2 = true;
7650
+ continue;
7651
+ }
7652
+ if (f === "-f" || f === "--file" || f.startsWith("-f=") || f.startsWith("--file=")) {
7653
+ let c2 = f.indexOf("="), a2 = c2 === -1 ? f : f.slice(0, c2), g = c2 === -1 ? e[++h2] : f.slice(c2 + 1);
7654
+ if (!g || g === "--") return { error: `${a2} requires a path` };
7655
+ let p = g.split(",").map((y2) => y2.trim()).filter(Boolean);
7656
+ if (p.length === 0) return { error: `${a2} requires a path` };
7657
+ n3.push(...p), t2 = true;
7658
+ continue;
7659
+ }
7660
+ if (f.startsWith("-")) return { error: `unknown option: ${f}` };
7661
+ l2 = h2;
7662
+ break;
7647
7663
  }
7664
+ let d = l2 === -1 ? [] : e.slice(l2);
7665
+ return { paths: n3, pathSet: t2, quiet: o, debug: r2, override: s, fast: i2, command: d };
7648
7666
  }
7649
- }
7650
- function populate(processEnv, parsed, options = {}) {
7651
- const debug = Boolean(options && options.debug);
7652
- const override = Boolean(options && options.override);
7653
- const populated = {};
7654
- if (typeof parsed !== "object") {
7655
- const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
7656
- err.code = "OBJECT_REQUIRED";
7657
- throw err;
7667
+ function Ae(e) {
7668
+ return e[0] === "~" ? Q.join(me.homedir(), e.slice(1)) : e;
7658
7669
  }
7659
- for (const key of Object.keys(parsed)) {
7660
- if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
7661
- if (override === true) {
7662
- processEnv[key] = parsed[key];
7663
- populated[key] = parsed[key];
7670
+ function Ee(e) {
7671
+ let n3 = J(), t2 = { encoding: n3.encoding || "utf8", quiet: n3.quiet, debug: n3.debug === true, override: n3.override === true, fast: n3.fast === true, paths: [".env"], defaultPath: true };
7672
+ return n3.path != null && (t2.paths = [n3.path], t2.defaultPath = false), e.pathSet && (t2.paths = e.paths, t2.defaultPath = false), e.quiet != null && (t2.quiet = e.quiet), e.debug != null && (t2.debug = e.debug), e.override != null && (t2.override = e.override), e.fast != null && (t2.fast = e.fast), t2;
7673
+ }
7674
+ function be(e) {
7675
+ let n3 = {}, t2 = [], o = { override: e.override, debug: e.debug };
7676
+ for (let s of e.paths) {
7677
+ let i2 = Q.resolve(process.cwd(), Ae(s));
7678
+ try {
7679
+ let l2 = R2.parse(ge.readFileSync(i2, { encoding: e.encoding }), { fast: e.fast });
7680
+ R2.populate(n3, l2, o), t2.push(s);
7681
+ } catch (l2) {
7682
+ if (e.debug && console.log(`\u2506 failed to load ${s} ${l2.message}`), !(e.defaultPath && l2.code === "ENOENT")) throw l2;
7664
7683
  }
7665
- if (debug) {
7666
- if (override === true) {
7667
- _debug(`"${key}" is already defined and WAS overwritten`);
7668
- } else {
7669
- _debug(`"${key}" is already defined and was NOT overwritten`);
7684
+ }
7685
+ return { injected: R2.populate(process.env, n3, o), loadedPaths: t2 };
7686
+ }
7687
+ function K(e) {
7688
+ let n3 = e[0];
7689
+ if (n3 === "--help" || n3 === "-h") {
7690
+ D();
7691
+ return;
7692
+ }
7693
+ if (n3 !== "run") {
7694
+ D(), process.exitCode = 1;
7695
+ return;
7696
+ }
7697
+ let t2 = we(e.slice(1));
7698
+ if (t2.help) {
7699
+ D();
7700
+ return;
7701
+ }
7702
+ if (t2.error) {
7703
+ console.error(`dotenv: ${t2.error}`), D(), process.exitCode = 1;
7704
+ return;
7705
+ }
7706
+ if (t2.command.length === 0) {
7707
+ D(), process.exitCode = 1;
7708
+ return;
7709
+ }
7710
+ let o = Ee(t2);
7711
+ try {
7712
+ let c2 = be(o);
7713
+ if (!(o.quiet == null ? J().quiet : o.quiet)) {
7714
+ let g = `\u25C7 injected env (${Object.keys(c2.injected).length})`;
7715
+ c2.loadedPaths.length > 0 && (g += ` from ${c2.loadedPaths.join(", ")}`), console.error(g);
7716
+ }
7717
+ } catch (c2) {
7718
+ console.error(`dotenv: ${c2.message}`), process.exitCode = 1;
7719
+ return;
7720
+ }
7721
+ let r2 = !!process.stdin.isTTY, s = process.platform !== "win32" && !r2, i2 = Ce(t2.command[0], t2.command.slice(1), { stdio: "inherit", detached: s }), l2 = /* @__PURE__ */ new Map(), d = 0;
7722
+ function h2(c2) {
7723
+ if (!(!i2.pid || i2.exitCode !== null || i2.signalCode !== null)) {
7724
+ if (process.platform === "win32") {
7725
+ ve.spawnSync("taskkill", ["/pid", String(i2.pid), "/T", "/F"], { stdio: "ignore" });
7726
+ return;
7727
+ }
7728
+ try {
7729
+ process.kill(s ? -i2.pid : i2.pid, c2);
7730
+ } catch (a2) {
7731
+ if (a2.code !== "ESRCH") throw a2;
7670
7732
  }
7671
7733
  }
7672
- } else {
7673
- processEnv[key] = parsed[key];
7674
- populated[key] = parsed[key];
7675
7734
  }
7735
+ function f() {
7736
+ for (let [c2, a2] of l2) process.removeListener(c2, a2);
7737
+ }
7738
+ for (let c2 of ["SIGINT", "SIGTERM", "SIGHUP", "SIGQUIT"]) {
7739
+ let a2 = () => {
7740
+ if (c2 === "SIGINT") {
7741
+ if (d++, r2 && process.platform !== "win32" && d === 1) return;
7742
+ if (d > 1) {
7743
+ h2(d === 2 ? "SIGTERM" : "SIGKILL");
7744
+ return;
7745
+ }
7746
+ }
7747
+ h2(c2);
7748
+ };
7749
+ l2.set(c2, a2), process.on(c2, a2);
7750
+ }
7751
+ i2.on("error", function(c2) {
7752
+ f(), console.error(`dotenv: ${c2.message}`), process.exitCode = 1;
7753
+ }), i2.on("exit", function(c2, a2) {
7754
+ f(), typeof c2 == "number" ? process.exit(c2) : (setInterval(() => {
7755
+ }, 1e3), process.kill(process.pid, a2));
7756
+ });
7676
7757
  }
7677
- return populated;
7678
- }
7679
- var DotenvModule = {
7680
- configDotenv,
7681
- _configVault,
7682
- _parseVault,
7683
- config: config3,
7684
- decrypt,
7685
- parse: parse3,
7686
- populate
7687
- };
7688
- module.exports.configDotenv = DotenvModule.configDotenv;
7689
- module.exports._configVault = DotenvModule._configVault;
7690
- module.exports._parseVault = DotenvModule._parseVault;
7691
- module.exports.config = DotenvModule.config;
7692
- module.exports.decrypt = DotenvModule.decrypt;
7693
- module.exports.parse = DotenvModule.parse;
7694
- module.exports.populate = DotenvModule.populate;
7695
- module.exports = DotenvModule;
7758
+ F.exports = K;
7759
+ __require.main === F && K(process.argv.slice(2));
7760
+ });
7761
+ var S = N();
7762
+ var qe = X();
7763
+ module.exports = S;
7764
+ module.exports.config = S.config;
7765
+ module.exports.configDotenv = S.configDotenv;
7766
+ module.exports.parse = S.parse;
7767
+ module.exports.populate = S.populate;
7768
+ __require.main === module && qe(process.argv.slice(2));
7696
7769
  }
7697
7770
  });
7698
7771
 
@@ -31104,7 +31177,7 @@ function updateConfig(mutate, scope = "global", options = {}) {
31104
31177
  }
31105
31178
 
31106
31179
  // ../configuration-core/src/secrets.ts
31107
- var import_dotenv = __toESM(require_main(), 1);
31180
+ var import_dotenv = __toESM(require_dist2(), 1);
31108
31181
  import * as fs5 from "node:fs";
31109
31182
  import * as path10 from "node:path";
31110
31183
  var SECRET_ENV_PREFIX = "ARGENT_SECRET_";
@@ -35306,7 +35379,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
35306
35379
  var SESSION_ID2 = randomUUID5();
35307
35380
  function readCliVersion() {
35308
35381
  if (true) {
35309
- return "0.29.1-next.19";
35382
+ return "0.29.1-next.20";
35310
35383
  }
35311
35384
  return "0.0.0";
35312
35385
  }