base44 0.0.45 → 0.0.47

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="019cf669-df28-7e60-8dfa-54f6d79055c0")}catch(e){}}();import { createRequire } from "node:module";
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="019d016f-610c-7b02-aa0c-f97344c92bec")}catch(e){}}();import { createRequire } from "node:module";
2
2
  var __create = Object.create;
3
3
  var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
@@ -3188,9 +3188,9 @@ var require_fs = __commonJS((exports) => {
3188
3188
  var require_path = __commonJS((exports) => {
3189
3189
  Object.defineProperty(exports, "__esModule", { value: true });
3190
3190
  exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = undefined;
3191
- var os = __require("os");
3191
+ var os2 = __require("os");
3192
3192
  var path8 = __require("path");
3193
- var IS_WINDOWS_PLATFORM = os.platform() === "win32";
3193
+ var IS_WINDOWS_PLATFORM = os2.platform() === "win32";
3194
3194
  var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
3195
3195
  var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
3196
3196
  var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
@@ -8243,8 +8243,8 @@ var require_settings4 = __commonJS((exports) => {
8243
8243
  Object.defineProperty(exports, "__esModule", { value: true });
8244
8244
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = undefined;
8245
8245
  var fs11 = __require("fs");
8246
- var os = __require("os");
8247
- var CPU_COUNT = Math.max(os.cpus().length, 1);
8246
+ var os2 = __require("os");
8247
+ var CPU_COUNT = Math.max(os2.cpus().length, 1);
8248
8248
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
8249
8249
  lstat: fs11.lstat,
8250
8250
  lstatSync: fs11.lstatSync,
@@ -12363,403 +12363,11 @@ var require_front_matter = __commonJS((exports, module) => {
12363
12363
  }
12364
12364
  });
12365
12365
 
12366
- // ../../node_modules/dotenv/package.json
12367
- var require_package2 = __commonJS((exports, module) => {
12368
- module.exports = {
12369
- name: "dotenv",
12370
- version: "17.3.1",
12371
- description: "Loads environment variables from .env file",
12372
- main: "lib/main.js",
12373
- types: "lib/main.d.ts",
12374
- exports: {
12375
- ".": {
12376
- types: "./lib/main.d.ts",
12377
- require: "./lib/main.js",
12378
- default: "./lib/main.js"
12379
- },
12380
- "./config": "./config.js",
12381
- "./config.js": "./config.js",
12382
- "./lib/env-options": "./lib/env-options.js",
12383
- "./lib/env-options.js": "./lib/env-options.js",
12384
- "./lib/cli-options": "./lib/cli-options.js",
12385
- "./lib/cli-options.js": "./lib/cli-options.js",
12386
- "./package.json": "./package.json"
12387
- },
12388
- scripts: {
12389
- "dts-check": "tsc --project tests/types/tsconfig.json",
12390
- lint: "standard",
12391
- pretest: "npm run lint && npm run dts-check",
12392
- test: "tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000",
12393
- "test:coverage": "tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
12394
- prerelease: "npm test",
12395
- release: "standard-version"
12396
- },
12397
- repository: {
12398
- type: "git",
12399
- url: "git://github.com/motdotla/dotenv.git"
12400
- },
12401
- homepage: "https://github.com/motdotla/dotenv#readme",
12402
- funding: "https://dotenvx.com",
12403
- keywords: [
12404
- "dotenv",
12405
- "env",
12406
- ".env",
12407
- "environment",
12408
- "variables",
12409
- "config",
12410
- "settings"
12411
- ],
12412
- readmeFilename: "README.md",
12413
- license: "BSD-2-Clause",
12414
- devDependencies: {
12415
- "@types/node": "^18.11.3",
12416
- decache: "^4.6.2",
12417
- sinon: "^14.0.1",
12418
- standard: "^17.0.0",
12419
- "standard-version": "^9.5.0",
12420
- tap: "^19.2.0",
12421
- typescript: "^4.8.4"
12422
- },
12423
- engines: {
12424
- node: ">=12"
12425
- },
12426
- browser: {
12427
- fs: false
12428
- }
12429
- };
12430
- });
12431
-
12432
- // ../../node_modules/dotenv/lib/main.js
12433
- var require_main = __commonJS((exports, module) => {
12434
- var fs14 = __require("fs");
12435
- var path11 = __require("path");
12436
- var os = __require("os");
12437
- var crypto = __require("crypto");
12438
- var packageJson = require_package2();
12439
- var version2 = packageJson.version;
12440
- var TIPS = [
12441
- "\uD83D\uDD10 encrypt with Dotenvx: https://dotenvx.com",
12442
- "\uD83D\uDD10 prevent committing .env to code: https://dotenvx.com/precommit",
12443
- "\uD83D\uDD10 prevent building .env in docker: https://dotenvx.com/prebuild",
12444
- "\uD83E\uDD16 agentic secret storage: https://dotenvx.com/as2",
12445
- "⚡️ secrets for agents: https://dotenvx.com/as2",
12446
- "\uD83D\uDEE1️ auth for agents: https://vestauth.com",
12447
- "\uD83D\uDEE0️ run anywhere with `dotenvx run -- yourcommand`",
12448
- "⚙️ specify custom .env file path with { path: '/custom/path/.env' }",
12449
- "⚙️ enable debug logging with { debug: true }",
12450
- "⚙️ override existing env vars with { override: true }",
12451
- "⚙️ suppress all logs with { quiet: true }",
12452
- "⚙️ write to custom object with { processEnv: myObject }",
12453
- "⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"
12454
- ];
12455
- function _getRandomTip() {
12456
- return TIPS[Math.floor(Math.random() * TIPS.length)];
12457
- }
12458
- function parseBoolean(value) {
12459
- if (typeof value === "string") {
12460
- return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
12461
- }
12462
- return Boolean(value);
12463
- }
12464
- function supportsAnsi() {
12465
- return process.stdout.isTTY;
12466
- }
12467
- function dim(text) {
12468
- return supportsAnsi() ? `\x1B[2m${text}\x1B[0m` : text;
12469
- }
12470
- var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
12471
- function parse9(src) {
12472
- const obj = {};
12473
- let lines = src.toString();
12474
- lines = lines.replace(/\r\n?/mg, `
12475
- `);
12476
- let match;
12477
- while ((match = LINE.exec(lines)) != null) {
12478
- const key = match[1];
12479
- let value = match[2] || "";
12480
- value = value.trim();
12481
- const maybeQuote = value[0];
12482
- value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
12483
- if (maybeQuote === '"') {
12484
- value = value.replace(/\\n/g, `
12485
- `);
12486
- value = value.replace(/\\r/g, "\r");
12487
- }
12488
- obj[key] = value;
12489
- }
12490
- return obj;
12491
- }
12492
- function _parseVault(options) {
12493
- options = options || {};
12494
- const vaultPath = _vaultPath(options);
12495
- options.path = vaultPath;
12496
- const result = DotenvModule.configDotenv(options);
12497
- if (!result.parsed) {
12498
- const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
12499
- err.code = "MISSING_DATA";
12500
- throw err;
12501
- }
12502
- const keys = _dotenvKey(options).split(",");
12503
- const length = keys.length;
12504
- let decrypted;
12505
- for (let i = 0;i < length; i++) {
12506
- try {
12507
- const key = keys[i].trim();
12508
- const attrs = _instructions(result, key);
12509
- decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
12510
- break;
12511
- } catch (error48) {
12512
- if (i + 1 >= length) {
12513
- throw error48;
12514
- }
12515
- }
12516
- }
12517
- return DotenvModule.parse(decrypted);
12518
- }
12519
- function _warn(message) {
12520
- console.error(`[dotenv@${version2}][WARN] ${message}`);
12521
- }
12522
- function _debug(message) {
12523
- console.log(`[dotenv@${version2}][DEBUG] ${message}`);
12524
- }
12525
- function _log(message) {
12526
- console.log(`[dotenv@${version2}] ${message}`);
12527
- }
12528
- function _dotenvKey(options) {
12529
- if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
12530
- return options.DOTENV_KEY;
12531
- }
12532
- if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
12533
- return process.env.DOTENV_KEY;
12534
- }
12535
- return "";
12536
- }
12537
- function _instructions(result, dotenvKey) {
12538
- let uri;
12539
- try {
12540
- uri = new URL(dotenvKey);
12541
- } catch (error48) {
12542
- if (error48.code === "ERR_INVALID_URL") {
12543
- 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");
12544
- err.code = "INVALID_DOTENV_KEY";
12545
- throw err;
12546
- }
12547
- throw error48;
12548
- }
12549
- const key = uri.password;
12550
- if (!key) {
12551
- const err = new Error("INVALID_DOTENV_KEY: Missing key part");
12552
- err.code = "INVALID_DOTENV_KEY";
12553
- throw err;
12554
- }
12555
- const environment = uri.searchParams.get("environment");
12556
- if (!environment) {
12557
- const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
12558
- err.code = "INVALID_DOTENV_KEY";
12559
- throw err;
12560
- }
12561
- const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
12562
- const ciphertext = result.parsed[environmentKey];
12563
- if (!ciphertext) {
12564
- const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
12565
- err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
12566
- throw err;
12567
- }
12568
- return { ciphertext, key };
12569
- }
12570
- function _vaultPath(options) {
12571
- let possibleVaultPath = null;
12572
- if (options && options.path && options.path.length > 0) {
12573
- if (Array.isArray(options.path)) {
12574
- for (const filepath of options.path) {
12575
- if (fs14.existsSync(filepath)) {
12576
- possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
12577
- }
12578
- }
12579
- } else {
12580
- possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
12581
- }
12582
- } else {
12583
- possibleVaultPath = path11.resolve(process.cwd(), ".env.vault");
12584
- }
12585
- if (fs14.existsSync(possibleVaultPath)) {
12586
- return possibleVaultPath;
12587
- }
12588
- return null;
12589
- }
12590
- function _resolveHome(envPath) {
12591
- return envPath[0] === "~" ? path11.join(os.homedir(), envPath.slice(1)) : envPath;
12592
- }
12593
- function _configVault(options) {
12594
- const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
12595
- const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
12596
- if (debug || !quiet) {
12597
- _log("Loading env from encrypted .env.vault");
12598
- }
12599
- const parsed = DotenvModule._parseVault(options);
12600
- let processEnv = process.env;
12601
- if (options && options.processEnv != null) {
12602
- processEnv = options.processEnv;
12603
- }
12604
- DotenvModule.populate(processEnv, parsed, options);
12605
- return { parsed };
12606
- }
12607
- function configDotenv(options) {
12608
- const dotenvPath = path11.resolve(process.cwd(), ".env");
12609
- let encoding = "utf8";
12610
- let processEnv = process.env;
12611
- if (options && options.processEnv != null) {
12612
- processEnv = options.processEnv;
12613
- }
12614
- let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
12615
- let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
12616
- if (options && options.encoding) {
12617
- encoding = options.encoding;
12618
- } else {
12619
- if (debug) {
12620
- _debug("No encoding is specified. UTF-8 is used by default");
12621
- }
12622
- }
12623
- let optionPaths = [dotenvPath];
12624
- if (options && options.path) {
12625
- if (!Array.isArray(options.path)) {
12626
- optionPaths = [_resolveHome(options.path)];
12627
- } else {
12628
- optionPaths = [];
12629
- for (const filepath of options.path) {
12630
- optionPaths.push(_resolveHome(filepath));
12631
- }
12632
- }
12633
- }
12634
- let lastError;
12635
- const parsedAll = {};
12636
- for (const path12 of optionPaths) {
12637
- try {
12638
- const parsed = DotenvModule.parse(fs14.readFileSync(path12, { encoding }));
12639
- DotenvModule.populate(parsedAll, parsed, options);
12640
- } catch (e2) {
12641
- if (debug) {
12642
- _debug(`Failed to load ${path12} ${e2.message}`);
12643
- }
12644
- lastError = e2;
12645
- }
12646
- }
12647
- const populated = DotenvModule.populate(processEnv, parsedAll, options);
12648
- debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
12649
- quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
12650
- if (debug || !quiet) {
12651
- const keysCount = Object.keys(populated).length;
12652
- const shortPaths = [];
12653
- for (const filePath of optionPaths) {
12654
- try {
12655
- const relative3 = path11.relative(process.cwd(), filePath);
12656
- shortPaths.push(relative3);
12657
- } catch (e2) {
12658
- if (debug) {
12659
- _debug(`Failed to load ${filePath} ${e2.message}`);
12660
- }
12661
- lastError = e2;
12662
- }
12663
- }
12664
- _log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`-- tip: ${_getRandomTip()}`)}`);
12665
- }
12666
- if (lastError) {
12667
- return { parsed: parsedAll, error: lastError };
12668
- } else {
12669
- return { parsed: parsedAll };
12670
- }
12671
- }
12672
- function config9(options) {
12673
- if (_dotenvKey(options).length === 0) {
12674
- return DotenvModule.configDotenv(options);
12675
- }
12676
- const vaultPath = _vaultPath(options);
12677
- if (!vaultPath) {
12678
- _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
12679
- return DotenvModule.configDotenv(options);
12680
- }
12681
- return DotenvModule._configVault(options);
12682
- }
12683
- function decrypt(encrypted, keyStr) {
12684
- const key = Buffer.from(keyStr.slice(-64), "hex");
12685
- let ciphertext = Buffer.from(encrypted, "base64");
12686
- const nonce = ciphertext.subarray(0, 12);
12687
- const authTag = ciphertext.subarray(-16);
12688
- ciphertext = ciphertext.subarray(12, -16);
12689
- try {
12690
- const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
12691
- aesgcm.setAuthTag(authTag);
12692
- return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
12693
- } catch (error48) {
12694
- const isRange = error48 instanceof RangeError;
12695
- const invalidKeyLength = error48.message === "Invalid key length";
12696
- const decryptionFailed = error48.message === "Unsupported state or unable to authenticate data";
12697
- if (isRange || invalidKeyLength) {
12698
- const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
12699
- err.code = "INVALID_DOTENV_KEY";
12700
- throw err;
12701
- } else if (decryptionFailed) {
12702
- const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
12703
- err.code = "DECRYPTION_FAILED";
12704
- throw err;
12705
- } else {
12706
- throw error48;
12707
- }
12708
- }
12709
- }
12710
- function populate(processEnv, parsed, options = {}) {
12711
- const debug = Boolean(options && options.debug);
12712
- const override = Boolean(options && options.override);
12713
- const populated = {};
12714
- if (typeof parsed !== "object") {
12715
- const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
12716
- err.code = "OBJECT_REQUIRED";
12717
- throw err;
12718
- }
12719
- for (const key of Object.keys(parsed)) {
12720
- if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
12721
- if (override === true) {
12722
- processEnv[key] = parsed[key];
12723
- populated[key] = parsed[key];
12724
- }
12725
- if (debug) {
12726
- if (override === true) {
12727
- _debug(`"${key}" is already defined and WAS overwritten`);
12728
- } else {
12729
- _debug(`"${key}" is already defined and was NOT overwritten`);
12730
- }
12731
- }
12732
- } else {
12733
- processEnv[key] = parsed[key];
12734
- populated[key] = parsed[key];
12735
- }
12736
- }
12737
- return populated;
12738
- }
12739
- var DotenvModule = {
12740
- configDotenv,
12741
- _configVault,
12742
- _parseVault,
12743
- config: config9,
12744
- decrypt,
12745
- parse: parse9,
12746
- populate
12747
- };
12748
- exports.configDotenv = DotenvModule.configDotenv;
12749
- exports._configVault = DotenvModule._configVault;
12750
- exports._parseVault = DotenvModule._parseVault;
12751
- exports.config = DotenvModule.config;
12752
- exports.decrypt = DotenvModule.decrypt;
12753
- exports.parse = DotenvModule.parse;
12754
- exports.populate = DotenvModule.populate;
12755
- module.exports = DotenvModule;
12756
- });
12757
-
12758
12366
  // ../../node_modules/isexe/windows.js
12759
12367
  var require_windows = __commonJS((exports, module) => {
12760
12368
  module.exports = isexe;
12761
12369
  isexe.sync = sync;
12762
- var fs15 = __require("fs");
12370
+ var fs14 = __require("fs");
12763
12371
  function checkPathExt(path11, options) {
12764
12372
  var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT;
12765
12373
  if (!pathext) {
@@ -12784,12 +12392,12 @@ var require_windows = __commonJS((exports, module) => {
12784
12392
  return checkPathExt(path11, options);
12785
12393
  }
12786
12394
  function isexe(path11, options, cb) {
12787
- fs15.stat(path11, function(er, stat) {
12395
+ fs14.stat(path11, function(er, stat) {
12788
12396
  cb(er, er ? false : checkStat(stat, path11, options));
12789
12397
  });
12790
12398
  }
12791
12399
  function sync(path11, options) {
12792
- return checkStat(fs15.statSync(path11), path11, options);
12400
+ return checkStat(fs14.statSync(path11), path11, options);
12793
12401
  }
12794
12402
  });
12795
12403
 
@@ -12797,14 +12405,14 @@ var require_windows = __commonJS((exports, module) => {
12797
12405
  var require_mode = __commonJS((exports, module) => {
12798
12406
  module.exports = isexe;
12799
12407
  isexe.sync = sync;
12800
- var fs15 = __require("fs");
12408
+ var fs14 = __require("fs");
12801
12409
  function isexe(path11, options, cb) {
12802
- fs15.stat(path11, function(er, stat) {
12410
+ fs14.stat(path11, function(er, stat) {
12803
12411
  cb(er, er ? false : checkStat(stat, options));
12804
12412
  });
12805
12413
  }
12806
12414
  function sync(path11, options) {
12807
- return checkStat(fs15.statSync(path11), options);
12415
+ return checkStat(fs14.statSync(path11), options);
12808
12416
  }
12809
12417
  function checkStat(stat, options) {
12810
12418
  return stat.isFile() && checkMode(stat, options);
@@ -12826,7 +12434,7 @@ var require_mode = __commonJS((exports, module) => {
12826
12434
 
12827
12435
  // ../../node_modules/isexe/index.js
12828
12436
  var require_isexe = __commonJS((exports, module) => {
12829
- var fs15 = __require("fs");
12437
+ var fs14 = __require("fs");
12830
12438
  var core2;
12831
12439
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
12832
12440
  core2 = require_windows();
@@ -12988,7 +12596,7 @@ var require_resolveCommand = __commonJS((exports, module) => {
12988
12596
  var which = require_which();
12989
12597
  var getPathKey = require_path_key();
12990
12598
  function resolveCommandAttempt(parsed, withoutPathExt) {
12991
- const env3 = parsed.options.env || process.env;
12599
+ const env2 = parsed.options.env || process.env;
12992
12600
  const cwd = process.cwd();
12993
12601
  const hasCustomCwd = parsed.options.cwd != null;
12994
12602
  const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;
@@ -13000,7 +12608,7 @@ var require_resolveCommand = __commonJS((exports, module) => {
13000
12608
  let resolved;
13001
12609
  try {
13002
12610
  resolved = which.sync(parsed.command, {
13003
- path: env3[getPathKey({ env: env3 })],
12611
+ path: env2[getPathKey({ env: env2 })],
13004
12612
  pathExt: withoutPathExt ? path11.delimiter : undefined
13005
12613
  });
13006
12614
  } catch (e2) {} finally {
@@ -13065,16 +12673,16 @@ var require_shebang_command = __commonJS((exports, module) => {
13065
12673
 
13066
12674
  // ../../node_modules/cross-spawn/lib/util/readShebang.js
13067
12675
  var require_readShebang = __commonJS((exports, module) => {
13068
- var fs15 = __require("fs");
12676
+ var fs14 = __require("fs");
13069
12677
  var shebangCommand = require_shebang_command();
13070
12678
  function readShebang(command) {
13071
12679
  const size = 150;
13072
12680
  const buffer = Buffer.alloc(size);
13073
12681
  let fd;
13074
12682
  try {
13075
- fd = fs15.openSync(command, "r");
13076
- fs15.readSync(fd, buffer, 0, size, 0);
13077
- fs15.closeSync(fd);
12683
+ fd = fs14.openSync(command, "r");
12684
+ fs14.readSync(fd, buffer, 0, size, 0);
12685
+ fs14.closeSync(fd);
13078
12686
  } catch (e2) {}
13079
12687
  return shebangCommand(buffer.toString());
13080
12688
  }
@@ -13118,7 +12726,7 @@ var require_parse4 = __commonJS((exports, module) => {
13118
12726
  }
13119
12727
  return parsed;
13120
12728
  }
13121
- function parse10(command, args, options) {
12729
+ function parse9(command, args, options) {
13122
12730
  if (args && !Array.isArray(args)) {
13123
12731
  options = args;
13124
12732
  args = null;
@@ -13137,7 +12745,7 @@ var require_parse4 = __commonJS((exports, module) => {
13137
12745
  };
13138
12746
  return options.shell ? parsed : parseNonShell(parsed);
13139
12747
  }
13140
- module.exports = parse10;
12748
+ module.exports = parse9;
13141
12749
  });
13142
12750
 
13143
12751
  // ../../node_modules/cross-spawn/lib/enoent.js
@@ -13190,16 +12798,16 @@ var require_enoent = __commonJS((exports, module) => {
13190
12798
  // ../../node_modules/cross-spawn/index.js
13191
12799
  var require_cross_spawn = __commonJS((exports, module) => {
13192
12800
  var cp = __require("child_process");
13193
- var parse10 = require_parse4();
12801
+ var parse9 = require_parse4();
13194
12802
  var enoent = require_enoent();
13195
12803
  function spawn(command, args, options) {
13196
- const parsed = parse10(command, args, options);
12804
+ const parsed = parse9(command, args, options);
13197
12805
  const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
13198
12806
  enoent.hookChildProcess(spawned, parsed);
13199
12807
  return spawned;
13200
12808
  }
13201
12809
  function spawnSync(command, args, options) {
13202
- const parsed = parse10(command, args, options);
12810
+ const parsed = parse9(command, args, options);
13203
12811
  const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
13204
12812
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
13205
12813
  return result;
@@ -13207,7 +12815,7 @@ var require_cross_spawn = __commonJS((exports, module) => {
13207
12815
  module.exports = spawn;
13208
12816
  module.exports.spawn = spawn;
13209
12817
  module.exports.sync = spawnSync;
13210
- module.exports._parse = parse10;
12818
+ module.exports._parse = parse9;
13211
12819
  module.exports._enoent = enoent;
13212
12820
  });
13213
12821
 
@@ -19346,7 +18954,7 @@ var require_createNode = __commonJS((exports) => {
19346
18954
  if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
19347
18955
  value = value.valueOf();
19348
18956
  }
19349
- const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema9, sourceObjects } = ctx;
18957
+ const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema8, sourceObjects } = ctx;
19350
18958
  let ref = undefined;
19351
18959
  if (aliasDuplicateObjects && value && typeof value === "object") {
19352
18960
  ref = sourceObjects.get(value);
@@ -19360,7 +18968,7 @@ var require_createNode = __commonJS((exports) => {
19360
18968
  }
19361
18969
  if (tagName?.startsWith("!!"))
19362
18970
  tagName = defaultTagPrefix + tagName.slice(2);
19363
- let tagObj = findTagObject(value, tagName, schema9.tags);
18971
+ let tagObj = findTagObject(value, tagName, schema8.tags);
19364
18972
  if (!tagObj) {
19365
18973
  if (value && typeof value.toJSON === "function") {
19366
18974
  value = value.toJSON();
@@ -19371,7 +18979,7 @@ var require_createNode = __commonJS((exports) => {
19371
18979
  ref.node = node2;
19372
18980
  return node2;
19373
18981
  }
19374
- tagObj = value instanceof Map ? schema9[identity3.MAP] : (Symbol.iterator in Object(value)) ? schema9[identity3.SEQ] : schema9[identity3.MAP];
18982
+ tagObj = value instanceof Map ? schema8[identity3.MAP] : (Symbol.iterator in Object(value)) ? schema8[identity3.SEQ] : schema8[identity3.MAP];
19375
18983
  }
19376
18984
  if (onTagObj) {
19377
18985
  onTagObj(tagObj);
@@ -19394,7 +19002,7 @@ var require_Collection = __commonJS((exports) => {
19394
19002
  var createNode = require_createNode();
19395
19003
  var identity3 = require_identity();
19396
19004
  var Node2 = require_Node();
19397
- function collectionFromPath(schema9, path16, value) {
19005
+ function collectionFromPath(schema8, path16, value) {
19398
19006
  let v = value;
19399
19007
  for (let i2 = path16.length - 1;i2 >= 0; --i2) {
19400
19008
  const k2 = path16[i2];
@@ -19412,27 +19020,27 @@ var require_Collection = __commonJS((exports) => {
19412
19020
  onAnchor: () => {
19413
19021
  throw new Error("This should not happen, please report a bug.");
19414
19022
  },
19415
- schema: schema9,
19023
+ schema: schema8,
19416
19024
  sourceObjects: new Map
19417
19025
  });
19418
19026
  }
19419
19027
  var isEmptyPath = (path16) => path16 == null || typeof path16 === "object" && !!path16[Symbol.iterator]().next().done;
19420
19028
 
19421
19029
  class Collection extends Node2.NodeBase {
19422
- constructor(type, schema9) {
19030
+ constructor(type, schema8) {
19423
19031
  super(type);
19424
19032
  Object.defineProperty(this, "schema", {
19425
- value: schema9,
19033
+ value: schema8,
19426
19034
  configurable: true,
19427
19035
  enumerable: false,
19428
19036
  writable: true
19429
19037
  });
19430
19038
  }
19431
- clone(schema9) {
19039
+ clone(schema8) {
19432
19040
  const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
19433
- if (schema9)
19434
- copy.schema = schema9;
19435
- copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(schema9) : it3);
19041
+ if (schema8)
19042
+ copy.schema = schema8;
19043
+ copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(schema8) : it3);
19436
19044
  if (this.range)
19437
19045
  copy.range = this.range.slice();
19438
19046
  return copy;
@@ -20364,12 +19972,12 @@ var require_Pair = __commonJS((exports) => {
20364
19972
  this.key = key;
20365
19973
  this.value = value;
20366
19974
  }
20367
- clone(schema9) {
19975
+ clone(schema8) {
20368
19976
  let { key, value } = this;
20369
19977
  if (identity3.isNode(key))
20370
- key = key.clone(schema9);
19978
+ key = key.clone(schema8);
20371
19979
  if (identity3.isNode(value))
20372
- value = value.clone(schema9);
19980
+ value = value.clone(schema8);
20373
19981
  return new Pair(key, value);
20374
19982
  }
20375
19983
  toJSON(_2, ctx) {
@@ -20554,13 +20162,13 @@ var require_YAMLMap = __commonJS((exports) => {
20554
20162
  static get tagName() {
20555
20163
  return "tag:yaml.org,2002:map";
20556
20164
  }
20557
- constructor(schema9) {
20558
- super(identity3.MAP, schema9);
20165
+ constructor(schema8) {
20166
+ super(identity3.MAP, schema8);
20559
20167
  this.items = [];
20560
20168
  }
20561
- static from(schema9, obj, ctx) {
20169
+ static from(schema8, obj, ctx) {
20562
20170
  const { keepUndefined, replacer } = ctx;
20563
- const map2 = new this(schema9);
20171
+ const map2 = new this(schema8);
20564
20172
  const add = (key, value) => {
20565
20173
  if (typeof replacer === "function")
20566
20174
  value = replacer.call(obj, key, value);
@@ -20576,8 +20184,8 @@ var require_YAMLMap = __commonJS((exports) => {
20576
20184
  for (const key of Object.keys(obj))
20577
20185
  add(key, obj[key]);
20578
20186
  }
20579
- if (typeof schema9.sortMapEntries === "function") {
20580
- map2.items.sort(schema9.sortMapEntries);
20187
+ if (typeof schema8.sortMapEntries === "function") {
20188
+ map2.items.sort(schema8.sortMapEntries);
20581
20189
  }
20582
20190
  return map2;
20583
20191
  }
@@ -20670,7 +20278,7 @@ var require_map2 = __commonJS((exports) => {
20670
20278
  onError("Expected a mapping for this tag");
20671
20279
  return map3;
20672
20280
  },
20673
- createNode: (schema9, obj, ctx) => YAMLMap.YAMLMap.from(schema9, obj, ctx)
20281
+ createNode: (schema8, obj, ctx) => YAMLMap.YAMLMap.from(schema8, obj, ctx)
20674
20282
  };
20675
20283
  exports.map = map2;
20676
20284
  });
@@ -20688,8 +20296,8 @@ var require_YAMLSeq = __commonJS((exports) => {
20688
20296
  static get tagName() {
20689
20297
  return "tag:yaml.org,2002:seq";
20690
20298
  }
20691
- constructor(schema9) {
20692
- super(identity3.SEQ, schema9);
20299
+ constructor(schema8) {
20300
+ super(identity3.SEQ, schema8);
20693
20301
  this.items = [];
20694
20302
  }
20695
20303
  add(value) {
@@ -20743,9 +20351,9 @@ var require_YAMLSeq = __commonJS((exports) => {
20743
20351
  onComment
20744
20352
  });
20745
20353
  }
20746
- static from(schema9, obj, ctx) {
20354
+ static from(schema8, obj, ctx) {
20747
20355
  const { replacer } = ctx;
20748
- const seq = new this(schema9);
20356
+ const seq = new this(schema8);
20749
20357
  if (obj && Symbol.iterator in Object(obj)) {
20750
20358
  let i2 = 0;
20751
20359
  for (let it3 of obj) {
@@ -20782,7 +20390,7 @@ var require_seq2 = __commonJS((exports) => {
20782
20390
  onError("Expected a sequence for this tag");
20783
20391
  return seq2;
20784
20392
  },
20785
- createNode: (schema9, obj, ctx) => YAMLSeq.YAMLSeq.from(schema9, obj, ctx)
20393
+ createNode: (schema8, obj, ctx) => YAMLSeq.YAMLSeq.from(schema8, obj, ctx)
20786
20394
  };
20787
20395
  exports.seq = seq;
20788
20396
  });
@@ -20957,7 +20565,7 @@ var require_schema2 = __commonJS((exports) => {
20957
20565
  var bool = require_bool2();
20958
20566
  var float = require_float2();
20959
20567
  var int2 = require_int2();
20960
- var schema9 = [
20568
+ var schema8 = [
20961
20569
  map2.map,
20962
20570
  seq.seq,
20963
20571
  string4.string,
@@ -20970,7 +20578,7 @@ var require_schema2 = __commonJS((exports) => {
20970
20578
  float.floatExp,
20971
20579
  float.float
20972
20580
  ];
20973
- exports.schema = schema9;
20581
+ exports.schema = schema8;
20974
20582
  });
20975
20583
 
20976
20584
  // ../../node_modules/yaml/dist/schema/json/schema.js
@@ -21033,8 +20641,8 @@ var require_schema3 = __commonJS((exports) => {
21033
20641
  return str;
21034
20642
  }
21035
20643
  };
21036
- var schema9 = [map2.map, seq.seq].concat(jsonScalars, jsonError);
21037
- exports.schema = schema9;
20644
+ var schema8 = [map2.map, seq.seq].concat(jsonScalars, jsonError);
20645
+ exports.schema = schema8;
21038
20646
  });
21039
20647
 
21040
20648
  // ../../node_modules/yaml/dist/schema/yaml-1.1/binary.js
@@ -21124,9 +20732,9 @@ ${cn.comment}` : item.comment;
21124
20732
  onError("Expected a sequence for this tag");
21125
20733
  return seq;
21126
20734
  }
21127
- function createPairs(schema9, iterable, ctx) {
20735
+ function createPairs(schema8, iterable, ctx) {
21128
20736
  const { replacer } = ctx;
21129
- const pairs2 = new YAMLSeq.YAMLSeq(schema9);
20737
+ const pairs2 = new YAMLSeq.YAMLSeq(schema8);
21130
20738
  pairs2.tag = "tag:yaml.org,2002:pairs";
21131
20739
  let i2 = 0;
21132
20740
  if (iterable && Symbol.iterator in Object(iterable))
@@ -21205,8 +20813,8 @@ var require_omap2 = __commonJS((exports) => {
21205
20813
  }
21206
20814
  return map2;
21207
20815
  }
21208
- static from(schema9, iterable, ctx) {
21209
- const pairs$1 = pairs.createPairs(schema9, iterable, ctx);
20816
+ static from(schema8, iterable, ctx) {
20817
+ const pairs$1 = pairs.createPairs(schema8, iterable, ctx);
21210
20818
  const omap2 = new this;
21211
20819
  omap2.items = pairs$1.items;
21212
20820
  return omap2;
@@ -21233,7 +20841,7 @@ var require_omap2 = __commonJS((exports) => {
21233
20841
  }
21234
20842
  return Object.assign(new YAMLOMap, pairs$1);
21235
20843
  },
21236
- createNode: (schema9, iterable, ctx) => YAMLOMap.from(schema9, iterable, ctx)
20844
+ createNode: (schema8, iterable, ctx) => YAMLOMap.from(schema8, iterable, ctx)
21237
20845
  };
21238
20846
  exports.YAMLOMap = YAMLOMap;
21239
20847
  exports.omap = omap;
@@ -21397,8 +21005,8 @@ var require_set2 = __commonJS((exports) => {
21397
21005
  var YAMLMap = require_YAMLMap();
21398
21006
 
21399
21007
  class YAMLSet extends YAMLMap.YAMLMap {
21400
- constructor(schema9) {
21401
- super(schema9);
21008
+ constructor(schema8) {
21009
+ super(schema8);
21402
21010
  this.tag = YAMLSet.tag;
21403
21011
  }
21404
21012
  add(key) {
@@ -21438,9 +21046,9 @@ var require_set2 = __commonJS((exports) => {
21438
21046
  else
21439
21047
  throw new Error("Set items must all have null values");
21440
21048
  }
21441
- static from(schema9, iterable, ctx) {
21049
+ static from(schema8, iterable, ctx) {
21442
21050
  const { replacer } = ctx;
21443
- const set3 = new this(schema9);
21051
+ const set3 = new this(schema8);
21444
21052
  if (iterable && Symbol.iterator in Object(iterable))
21445
21053
  for (let value of iterable) {
21446
21054
  if (typeof replacer === "function")
@@ -21457,7 +21065,7 @@ var require_set2 = __commonJS((exports) => {
21457
21065
  nodeClass: YAMLSet,
21458
21066
  default: false,
21459
21067
  tag: "tag:yaml.org,2002:set",
21460
- createNode: (schema9, iterable, ctx) => YAMLSet.from(schema9, iterable, ctx),
21068
+ createNode: (schema8, iterable, ctx) => YAMLSet.from(schema8, iterable, ctx),
21461
21069
  resolve(map2, onError) {
21462
21070
  if (identity3.isMap(map2)) {
21463
21071
  if (map2.hasAllNullValues(true))
@@ -21570,7 +21178,7 @@ var require_schema4 = __commonJS((exports) => {
21570
21178
  var pairs = require_pairs2();
21571
21179
  var set2 = require_set2();
21572
21180
  var timestamp = require_timestamp2();
21573
- var schema9 = [
21181
+ var schema8 = [
21574
21182
  map2.map,
21575
21183
  seq.seq,
21576
21184
  string4.string,
@@ -21593,7 +21201,7 @@ var require_schema4 = __commonJS((exports) => {
21593
21201
  timestamp.floatTime,
21594
21202
  timestamp.timestamp
21595
21203
  ];
21596
- exports.schema = schema9;
21204
+ exports.schema = schema8;
21597
21205
  });
21598
21206
 
21599
21207
  // ../../node_modules/yaml/dist/schema/tags.js
@@ -21605,7 +21213,7 @@ var require_tags = __commonJS((exports) => {
21605
21213
  var bool = require_bool2();
21606
21214
  var float = require_float2();
21607
21215
  var int2 = require_int2();
21608
- var schema9 = require_schema2();
21216
+ var schema8 = require_schema2();
21609
21217
  var schema$1 = require_schema3();
21610
21218
  var binary = require_binary2();
21611
21219
  var merge3 = require_merge3();
@@ -21615,7 +21223,7 @@ var require_tags = __commonJS((exports) => {
21615
21223
  var set2 = require_set2();
21616
21224
  var timestamp = require_timestamp2();
21617
21225
  var schemas3 = new Map([
21618
- ["core", schema9.schema],
21226
+ ["core", schema8.schema],
21619
21227
  ["failsafe", [map2.map, seq.seq, string4.string]],
21620
21228
  ["json", schema$1.schema],
21621
21229
  ["yaml11", schema$2.schema],
@@ -21697,9 +21305,9 @@ var require_Schema = __commonJS((exports) => {
21697
21305
  var sortMapEntriesByKey = (a2, b) => a2.key < b.key ? -1 : a2.key > b.key ? 1 : 0;
21698
21306
 
21699
21307
  class Schema {
21700
- constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema: schema9, sortMapEntries, toStringDefaults }) {
21308
+ constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema: schema8, sortMapEntries, toStringDefaults }) {
21701
21309
  this.compat = Array.isArray(compat2) ? tags.getTags(compat2, "compat") : compat2 ? tags.getTags(null, compat2) : null;
21702
- this.name = typeof schema9 === "string" && schema9 || "core";
21310
+ this.name = typeof schema8 === "string" && schema8 || "core";
21703
21311
  this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
21704
21312
  this.tags = tags.getTags(customTags, this.name, merge3);
21705
21313
  this.toStringOptions = toStringDefaults ?? null;
@@ -23191,11 +22799,11 @@ var require_compose_scalar = __commonJS((exports) => {
23191
22799
  scalar.comment = comment;
23192
22800
  return scalar;
23193
22801
  }
23194
- function findScalarTagByName(schema9, value, tagName, tagToken, onError) {
22802
+ function findScalarTagByName(schema8, value, tagName, tagToken, onError) {
23195
22803
  if (tagName === "!")
23196
- return schema9[identity3.SCALAR];
22804
+ return schema8[identity3.SCALAR];
23197
22805
  const matchWithTest = [];
23198
- for (const tag of schema9.tags) {
22806
+ for (const tag of schema8.tags) {
23199
22807
  if (!tag.collection && tag.tag === tagName) {
23200
22808
  if (tag.default && tag.test)
23201
22809
  matchWithTest.push(tag);
@@ -23206,18 +22814,18 @@ var require_compose_scalar = __commonJS((exports) => {
23206
22814
  for (const tag of matchWithTest)
23207
22815
  if (tag.test?.test(value))
23208
22816
  return tag;
23209
- const kt3 = schema9.knownTags[tagName];
22817
+ const kt3 = schema8.knownTags[tagName];
23210
22818
  if (kt3 && !kt3.collection) {
23211
- schema9.tags.push(Object.assign({}, kt3, { default: false, test: undefined }));
22819
+ schema8.tags.push(Object.assign({}, kt3, { default: false, test: undefined }));
23212
22820
  return kt3;
23213
22821
  }
23214
22822
  onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
23215
- return schema9[identity3.SCALAR];
22823
+ return schema8[identity3.SCALAR];
23216
22824
  }
23217
- function findScalarTagByTest({ atKey, directives, schema: schema9 }, value, token, onError) {
23218
- const tag = schema9.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema9[identity3.SCALAR];
23219
- if (schema9.compat) {
23220
- const compat2 = schema9.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema9[identity3.SCALAR];
22825
+ function findScalarTagByTest({ atKey, directives, schema: schema8 }, value, token, onError) {
22826
+ const tag = schema8.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema8[identity3.SCALAR];
22827
+ if (schema8.compat) {
22828
+ const compat2 = schema8.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema8[identity3.SCALAR];
23221
22829
  if (tag.tag !== compat2.tag) {
23222
22830
  const ts = directives.tagString(tag.tag);
23223
22831
  const cs = directives.tagString(compat2.tag);
@@ -23400,7 +23008,7 @@ var require_composer = __commonJS((exports) => {
23400
23008
  var node_process = __require("process");
23401
23009
  var directives = require_directives();
23402
23010
  var Document = require_Document();
23403
- var errors4 = require_errors();
23011
+ var errors3 = require_errors();
23404
23012
  var identity3 = require_identity();
23405
23013
  var composeDoc = require_compose_doc();
23406
23014
  var resolveEnd = require_resolve_end();
@@ -23451,9 +23059,9 @@ var require_composer = __commonJS((exports) => {
23451
23059
  this.onError = (source, code2, message, warning) => {
23452
23060
  const pos2 = getErrorPos(source);
23453
23061
  if (warning)
23454
- this.warnings.push(new errors4.YAMLWarning(pos2, code2, message));
23062
+ this.warnings.push(new errors3.YAMLWarning(pos2, code2, message));
23455
23063
  else
23456
- this.errors.push(new errors4.YAMLParseError(pos2, code2, message));
23064
+ this.errors.push(new errors3.YAMLParseError(pos2, code2, message));
23457
23065
  };
23458
23066
  this.directives = new directives.Directives({ version: options.version || "1.2" });
23459
23067
  this.options = options;
@@ -23537,7 +23145,7 @@ ${cb}` : comment;
23537
23145
  break;
23538
23146
  case "error": {
23539
23147
  const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
23540
- const error48 = new errors4.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
23148
+ const error48 = new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
23541
23149
  if (this.atDirectives || !this.doc)
23542
23150
  this.errors.push(error48);
23543
23151
  else
@@ -23547,7 +23155,7 @@ ${cb}` : comment;
23547
23155
  case "doc-end": {
23548
23156
  if (!this.doc) {
23549
23157
  const msg = "Unexpected doc-end without preceding document";
23550
- this.errors.push(new errors4.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
23158
+ this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
23551
23159
  break;
23552
23160
  }
23553
23161
  this.doc.directives.docEnd = true;
@@ -23562,7 +23170,7 @@ ${end.comment}` : end.comment;
23562
23170
  break;
23563
23171
  }
23564
23172
  default:
23565
- this.errors.push(new errors4.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
23173
+ this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
23566
23174
  }
23567
23175
  }
23568
23176
  *end(forceDoc = false, endOffset = -1) {
@@ -23588,7 +23196,7 @@ ${end.comment}` : end.comment;
23588
23196
  var require_cst_scalar = __commonJS((exports) => {
23589
23197
  var resolveBlockScalar = require_resolve_block_scalar();
23590
23198
  var resolveFlowScalar = require_resolve_flow_scalar();
23591
- var errors4 = require_errors();
23199
+ var errors3 = require_errors();
23592
23200
  var stringifyString = require_stringifyString();
23593
23201
  function resolveAsScalar(token, strict = true, onError) {
23594
23202
  if (token) {
@@ -23597,7 +23205,7 @@ var require_cst_scalar = __commonJS((exports) => {
23597
23205
  if (onError)
23598
23206
  onError(offset, code2, message);
23599
23207
  else
23600
- throw new errors4.YAMLParseError([offset, offset + 1], code2, message);
23208
+ throw new errors3.YAMLParseError([offset, offset + 1], code2, message);
23601
23209
  };
23602
23210
  switch (token.type) {
23603
23211
  case "scalar":
@@ -25155,14 +24763,14 @@ var require_parser = __commonJS((exports) => {
25155
24763
  case "scalar":
25156
24764
  case "single-quoted-scalar":
25157
24765
  case "double-quoted-scalar": {
25158
- const fs15 = this.flowScalar(this.type);
24766
+ const fs14 = this.flowScalar(this.type);
25159
24767
  if (atNextItem || it3.value) {
25160
- map2.items.push({ start, key: fs15, sep: [] });
24768
+ map2.items.push({ start, key: fs14, sep: [] });
25161
24769
  this.onKeyLine = true;
25162
24770
  } else if (it3.sep) {
25163
- this.stack.push(fs15);
24771
+ this.stack.push(fs14);
25164
24772
  } else {
25165
- Object.assign(it3, { key: fs15, sep: [] });
24773
+ Object.assign(it3, { key: fs14, sep: [] });
25166
24774
  this.onKeyLine = true;
25167
24775
  }
25168
24776
  return;
@@ -25290,13 +24898,13 @@ var require_parser = __commonJS((exports) => {
25290
24898
  case "scalar":
25291
24899
  case "single-quoted-scalar":
25292
24900
  case "double-quoted-scalar": {
25293
- const fs15 = this.flowScalar(this.type);
24901
+ const fs14 = this.flowScalar(this.type);
25294
24902
  if (!it3 || it3.value)
25295
- fc.items.push({ start: [], key: fs15, sep: [] });
24903
+ fc.items.push({ start: [], key: fs14, sep: [] });
25296
24904
  else if (it3.sep)
25297
- this.stack.push(fs15);
24905
+ this.stack.push(fs14);
25298
24906
  else
25299
- Object.assign(it3, { key: fs15, sep: [] });
24907
+ Object.assign(it3, { key: fs14, sep: [] });
25300
24908
  return;
25301
24909
  }
25302
24910
  case "flow-map-end":
@@ -25459,7 +25067,7 @@ var require_parser = __commonJS((exports) => {
25459
25067
  var require_public_api = __commonJS((exports) => {
25460
25068
  var composer = require_composer();
25461
25069
  var Document = require_Document();
25462
- var errors4 = require_errors();
25070
+ var errors3 = require_errors();
25463
25071
  var log = require_log();
25464
25072
  var identity3 = require_identity();
25465
25073
  var lineCounter = require_line_counter();
@@ -25476,8 +25084,8 @@ var require_public_api = __commonJS((exports) => {
25476
25084
  const docs = Array.from(composer$1.compose(parser$1.parse(source)));
25477
25085
  if (prettyErrors && lineCounter2)
25478
25086
  for (const doc2 of docs) {
25479
- doc2.errors.forEach(errors4.prettifyError(source, lineCounter2));
25480
- doc2.warnings.forEach(errors4.prettifyError(source, lineCounter2));
25087
+ doc2.errors.forEach(errors3.prettifyError(source, lineCounter2));
25088
+ doc2.warnings.forEach(errors3.prettifyError(source, lineCounter2));
25481
25089
  }
25482
25090
  if (docs.length > 0)
25483
25091
  return docs;
@@ -25492,17 +25100,17 @@ var require_public_api = __commonJS((exports) => {
25492
25100
  if (!doc2)
25493
25101
  doc2 = _doc;
25494
25102
  else if (doc2.options.logLevel !== "silent") {
25495
- doc2.errors.push(new errors4.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
25103
+ doc2.errors.push(new errors3.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
25496
25104
  break;
25497
25105
  }
25498
25106
  }
25499
25107
  if (prettyErrors && lineCounter2) {
25500
- doc2.errors.forEach(errors4.prettifyError(source, lineCounter2));
25501
- doc2.warnings.forEach(errors4.prettifyError(source, lineCounter2));
25108
+ doc2.errors.forEach(errors3.prettifyError(source, lineCounter2));
25109
+ doc2.warnings.forEach(errors3.prettifyError(source, lineCounter2));
25502
25110
  }
25503
25111
  return doc2;
25504
25112
  }
25505
- function parse10(src, reviver, options) {
25113
+ function parse9(src, reviver, options) {
25506
25114
  let _reviver = undefined;
25507
25115
  if (typeof reviver === "function") {
25508
25116
  _reviver = reviver;
@@ -25543,12 +25151,404 @@ var require_public_api = __commonJS((exports) => {
25543
25151
  return value.toString(options);
25544
25152
  return new Document.Document(value, _replacer, options).toString(options);
25545
25153
  }
25546
- exports.parse = parse10;
25154
+ exports.parse = parse9;
25547
25155
  exports.parseAllDocuments = parseAllDocuments;
25548
25156
  exports.parseDocument = parseDocument;
25549
25157
  exports.stringify = stringify;
25550
25158
  });
25551
25159
 
25160
+ // ../../node_modules/dotenv/package.json
25161
+ var require_package2 = __commonJS((exports, module) => {
25162
+ module.exports = {
25163
+ name: "dotenv",
25164
+ version: "17.3.1",
25165
+ description: "Loads environment variables from .env file",
25166
+ main: "lib/main.js",
25167
+ types: "lib/main.d.ts",
25168
+ exports: {
25169
+ ".": {
25170
+ types: "./lib/main.d.ts",
25171
+ require: "./lib/main.js",
25172
+ default: "./lib/main.js"
25173
+ },
25174
+ "./config": "./config.js",
25175
+ "./config.js": "./config.js",
25176
+ "./lib/env-options": "./lib/env-options.js",
25177
+ "./lib/env-options.js": "./lib/env-options.js",
25178
+ "./lib/cli-options": "./lib/cli-options.js",
25179
+ "./lib/cli-options.js": "./lib/cli-options.js",
25180
+ "./package.json": "./package.json"
25181
+ },
25182
+ scripts: {
25183
+ "dts-check": "tsc --project tests/types/tsconfig.json",
25184
+ lint: "standard",
25185
+ pretest: "npm run lint && npm run dts-check",
25186
+ test: "tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000",
25187
+ "test:coverage": "tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
25188
+ prerelease: "npm test",
25189
+ release: "standard-version"
25190
+ },
25191
+ repository: {
25192
+ type: "git",
25193
+ url: "git://github.com/motdotla/dotenv.git"
25194
+ },
25195
+ homepage: "https://github.com/motdotla/dotenv#readme",
25196
+ funding: "https://dotenvx.com",
25197
+ keywords: [
25198
+ "dotenv",
25199
+ "env",
25200
+ ".env",
25201
+ "environment",
25202
+ "variables",
25203
+ "config",
25204
+ "settings"
25205
+ ],
25206
+ readmeFilename: "README.md",
25207
+ license: "BSD-2-Clause",
25208
+ devDependencies: {
25209
+ "@types/node": "^18.11.3",
25210
+ decache: "^4.6.2",
25211
+ sinon: "^14.0.1",
25212
+ standard: "^17.0.0",
25213
+ "standard-version": "^9.5.0",
25214
+ tap: "^19.2.0",
25215
+ typescript: "^4.8.4"
25216
+ },
25217
+ engines: {
25218
+ node: ">=12"
25219
+ },
25220
+ browser: {
25221
+ fs: false
25222
+ }
25223
+ };
25224
+ });
25225
+
25226
+ // ../../node_modules/dotenv/lib/main.js
25227
+ var require_main = __commonJS((exports, module) => {
25228
+ var fs14 = __require("fs");
25229
+ var path16 = __require("path");
25230
+ var os2 = __require("os");
25231
+ var crypto = __require("crypto");
25232
+ var packageJson = require_package2();
25233
+ var version2 = packageJson.version;
25234
+ var TIPS = [
25235
+ "\uD83D\uDD10 encrypt with Dotenvx: https://dotenvx.com",
25236
+ "\uD83D\uDD10 prevent committing .env to code: https://dotenvx.com/precommit",
25237
+ "\uD83D\uDD10 prevent building .env in docker: https://dotenvx.com/prebuild",
25238
+ "\uD83E\uDD16 agentic secret storage: https://dotenvx.com/as2",
25239
+ "⚡️ secrets for agents: https://dotenvx.com/as2",
25240
+ "\uD83D\uDEE1️ auth for agents: https://vestauth.com",
25241
+ "\uD83D\uDEE0️ run anywhere with `dotenvx run -- yourcommand`",
25242
+ "⚙️ specify custom .env file path with { path: '/custom/path/.env' }",
25243
+ "⚙️ enable debug logging with { debug: true }",
25244
+ "⚙️ override existing env vars with { override: true }",
25245
+ "⚙️ suppress all logs with { quiet: true }",
25246
+ "⚙️ write to custom object with { processEnv: myObject }",
25247
+ "⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"
25248
+ ];
25249
+ function _getRandomTip() {
25250
+ return TIPS[Math.floor(Math.random() * TIPS.length)];
25251
+ }
25252
+ function parseBoolean(value) {
25253
+ if (typeof value === "string") {
25254
+ return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
25255
+ }
25256
+ return Boolean(value);
25257
+ }
25258
+ function supportsAnsi() {
25259
+ return process.stdout.isTTY;
25260
+ }
25261
+ function dim2(text) {
25262
+ return supportsAnsi() ? `\x1B[2m${text}\x1B[0m` : text;
25263
+ }
25264
+ var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
25265
+ function parse9(src) {
25266
+ const obj = {};
25267
+ let lines = src.toString();
25268
+ lines = lines.replace(/\r\n?/mg, `
25269
+ `);
25270
+ let match;
25271
+ while ((match = LINE.exec(lines)) != null) {
25272
+ const key = match[1];
25273
+ let value = match[2] || "";
25274
+ value = value.trim();
25275
+ const maybeQuote = value[0];
25276
+ value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
25277
+ if (maybeQuote === '"') {
25278
+ value = value.replace(/\\n/g, `
25279
+ `);
25280
+ value = value.replace(/\\r/g, "\r");
25281
+ }
25282
+ obj[key] = value;
25283
+ }
25284
+ return obj;
25285
+ }
25286
+ function _parseVault(options) {
25287
+ options = options || {};
25288
+ const vaultPath = _vaultPath(options);
25289
+ options.path = vaultPath;
25290
+ const result = DotenvModule.configDotenv(options);
25291
+ if (!result.parsed) {
25292
+ const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
25293
+ err.code = "MISSING_DATA";
25294
+ throw err;
25295
+ }
25296
+ const keys = _dotenvKey(options).split(",");
25297
+ const length = keys.length;
25298
+ let decrypted;
25299
+ for (let i2 = 0;i2 < length; i2++) {
25300
+ try {
25301
+ const key = keys[i2].trim();
25302
+ const attrs = _instructions(result, key);
25303
+ decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
25304
+ break;
25305
+ } catch (error48) {
25306
+ if (i2 + 1 >= length) {
25307
+ throw error48;
25308
+ }
25309
+ }
25310
+ }
25311
+ return DotenvModule.parse(decrypted);
25312
+ }
25313
+ function _warn(message) {
25314
+ console.error(`[dotenv@${version2}][WARN] ${message}`);
25315
+ }
25316
+ function _debug(message) {
25317
+ console.log(`[dotenv@${version2}][DEBUG] ${message}`);
25318
+ }
25319
+ function _log(message) {
25320
+ console.log(`[dotenv@${version2}] ${message}`);
25321
+ }
25322
+ function _dotenvKey(options) {
25323
+ if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
25324
+ return options.DOTENV_KEY;
25325
+ }
25326
+ if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
25327
+ return process.env.DOTENV_KEY;
25328
+ }
25329
+ return "";
25330
+ }
25331
+ function _instructions(result, dotenvKey) {
25332
+ let uri;
25333
+ try {
25334
+ uri = new URL(dotenvKey);
25335
+ } catch (error48) {
25336
+ if (error48.code === "ERR_INVALID_URL") {
25337
+ 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");
25338
+ err.code = "INVALID_DOTENV_KEY";
25339
+ throw err;
25340
+ }
25341
+ throw error48;
25342
+ }
25343
+ const key = uri.password;
25344
+ if (!key) {
25345
+ const err = new Error("INVALID_DOTENV_KEY: Missing key part");
25346
+ err.code = "INVALID_DOTENV_KEY";
25347
+ throw err;
25348
+ }
25349
+ const environment = uri.searchParams.get("environment");
25350
+ if (!environment) {
25351
+ const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
25352
+ err.code = "INVALID_DOTENV_KEY";
25353
+ throw err;
25354
+ }
25355
+ const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
25356
+ const ciphertext = result.parsed[environmentKey];
25357
+ if (!ciphertext) {
25358
+ const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
25359
+ err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
25360
+ throw err;
25361
+ }
25362
+ return { ciphertext, key };
25363
+ }
25364
+ function _vaultPath(options) {
25365
+ let possibleVaultPath = null;
25366
+ if (options && options.path && options.path.length > 0) {
25367
+ if (Array.isArray(options.path)) {
25368
+ for (const filepath of options.path) {
25369
+ if (fs14.existsSync(filepath)) {
25370
+ possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
25371
+ }
25372
+ }
25373
+ } else {
25374
+ possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
25375
+ }
25376
+ } else {
25377
+ possibleVaultPath = path16.resolve(process.cwd(), ".env.vault");
25378
+ }
25379
+ if (fs14.existsSync(possibleVaultPath)) {
25380
+ return possibleVaultPath;
25381
+ }
25382
+ return null;
25383
+ }
25384
+ function _resolveHome(envPath) {
25385
+ return envPath[0] === "~" ? path16.join(os2.homedir(), envPath.slice(1)) : envPath;
25386
+ }
25387
+ function _configVault(options) {
25388
+ const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
25389
+ const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
25390
+ if (debug || !quiet) {
25391
+ _log("Loading env from encrypted .env.vault");
25392
+ }
25393
+ const parsed = DotenvModule._parseVault(options);
25394
+ let processEnv = process.env;
25395
+ if (options && options.processEnv != null) {
25396
+ processEnv = options.processEnv;
25397
+ }
25398
+ DotenvModule.populate(processEnv, parsed, options);
25399
+ return { parsed };
25400
+ }
25401
+ function configDotenv(options) {
25402
+ const dotenvPath = path16.resolve(process.cwd(), ".env");
25403
+ let encoding = "utf8";
25404
+ let processEnv = process.env;
25405
+ if (options && options.processEnv != null) {
25406
+ processEnv = options.processEnv;
25407
+ }
25408
+ let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
25409
+ let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
25410
+ if (options && options.encoding) {
25411
+ encoding = options.encoding;
25412
+ } else {
25413
+ if (debug) {
25414
+ _debug("No encoding is specified. UTF-8 is used by default");
25415
+ }
25416
+ }
25417
+ let optionPaths = [dotenvPath];
25418
+ if (options && options.path) {
25419
+ if (!Array.isArray(options.path)) {
25420
+ optionPaths = [_resolveHome(options.path)];
25421
+ } else {
25422
+ optionPaths = [];
25423
+ for (const filepath of options.path) {
25424
+ optionPaths.push(_resolveHome(filepath));
25425
+ }
25426
+ }
25427
+ }
25428
+ let lastError;
25429
+ const parsedAll = {};
25430
+ for (const path17 of optionPaths) {
25431
+ try {
25432
+ const parsed = DotenvModule.parse(fs14.readFileSync(path17, { encoding }));
25433
+ DotenvModule.populate(parsedAll, parsed, options);
25434
+ } catch (e2) {
25435
+ if (debug) {
25436
+ _debug(`Failed to load ${path17} ${e2.message}`);
25437
+ }
25438
+ lastError = e2;
25439
+ }
25440
+ }
25441
+ const populated = DotenvModule.populate(processEnv, parsedAll, options);
25442
+ debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
25443
+ quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
25444
+ if (debug || !quiet) {
25445
+ const keysCount = Object.keys(populated).length;
25446
+ const shortPaths = [];
25447
+ for (const filePath of optionPaths) {
25448
+ try {
25449
+ const relative3 = path16.relative(process.cwd(), filePath);
25450
+ shortPaths.push(relative3);
25451
+ } catch (e2) {
25452
+ if (debug) {
25453
+ _debug(`Failed to load ${filePath} ${e2.message}`);
25454
+ }
25455
+ lastError = e2;
25456
+ }
25457
+ }
25458
+ _log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim2(`-- tip: ${_getRandomTip()}`)}`);
25459
+ }
25460
+ if (lastError) {
25461
+ return { parsed: parsedAll, error: lastError };
25462
+ } else {
25463
+ return { parsed: parsedAll };
25464
+ }
25465
+ }
25466
+ function config9(options) {
25467
+ if (_dotenvKey(options).length === 0) {
25468
+ return DotenvModule.configDotenv(options);
25469
+ }
25470
+ const vaultPath = _vaultPath(options);
25471
+ if (!vaultPath) {
25472
+ _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
25473
+ return DotenvModule.configDotenv(options);
25474
+ }
25475
+ return DotenvModule._configVault(options);
25476
+ }
25477
+ function decrypt(encrypted, keyStr) {
25478
+ const key = Buffer.from(keyStr.slice(-64), "hex");
25479
+ let ciphertext = Buffer.from(encrypted, "base64");
25480
+ const nonce = ciphertext.subarray(0, 12);
25481
+ const authTag = ciphertext.subarray(-16);
25482
+ ciphertext = ciphertext.subarray(12, -16);
25483
+ try {
25484
+ const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
25485
+ aesgcm.setAuthTag(authTag);
25486
+ return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
25487
+ } catch (error48) {
25488
+ const isRange = error48 instanceof RangeError;
25489
+ const invalidKeyLength = error48.message === "Invalid key length";
25490
+ const decryptionFailed = error48.message === "Unsupported state or unable to authenticate data";
25491
+ if (isRange || invalidKeyLength) {
25492
+ const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
25493
+ err.code = "INVALID_DOTENV_KEY";
25494
+ throw err;
25495
+ } else if (decryptionFailed) {
25496
+ const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
25497
+ err.code = "DECRYPTION_FAILED";
25498
+ throw err;
25499
+ } else {
25500
+ throw error48;
25501
+ }
25502
+ }
25503
+ }
25504
+ function populate(processEnv, parsed, options = {}) {
25505
+ const debug = Boolean(options && options.debug);
25506
+ const override = Boolean(options && options.override);
25507
+ const populated = {};
25508
+ if (typeof parsed !== "object") {
25509
+ const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
25510
+ err.code = "OBJECT_REQUIRED";
25511
+ throw err;
25512
+ }
25513
+ for (const key of Object.keys(parsed)) {
25514
+ if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
25515
+ if (override === true) {
25516
+ processEnv[key] = parsed[key];
25517
+ populated[key] = parsed[key];
25518
+ }
25519
+ if (debug) {
25520
+ if (override === true) {
25521
+ _debug(`"${key}" is already defined and WAS overwritten`);
25522
+ } else {
25523
+ _debug(`"${key}" is already defined and was NOT overwritten`);
25524
+ }
25525
+ }
25526
+ } else {
25527
+ processEnv[key] = parsed[key];
25528
+ populated[key] = parsed[key];
25529
+ }
25530
+ }
25531
+ return populated;
25532
+ }
25533
+ var DotenvModule = {
25534
+ configDotenv,
25535
+ _configVault,
25536
+ _parseVault,
25537
+ config: config9,
25538
+ decrypt,
25539
+ parse: parse9,
25540
+ populate
25541
+ };
25542
+ exports.configDotenv = DotenvModule.configDotenv;
25543
+ exports._configVault = DotenvModule._configVault;
25544
+ exports._parseVault = DotenvModule._parseVault;
25545
+ exports.config = DotenvModule.config;
25546
+ exports.decrypt = DotenvModule.decrypt;
25547
+ exports.parse = DotenvModule.parse;
25548
+ exports.populate = DotenvModule.populate;
25549
+ module.exports = DotenvModule;
25550
+ });
25551
+
25552
25552
  // ../../node_modules/lodash/_arrayReduce.js
25553
25553
  var require__arrayReduce = __commonJS((exports, module) => {
25554
25554
  function arrayReduce(array2, iteratee, accumulator, initAccum) {
@@ -27636,14 +27636,14 @@ function getStringWidth(text) {
27636
27636
  }
27637
27637
  return width;
27638
27638
  }
27639
- function generateIndent(indent2, command, options) {
27640
- const queue = command.type === INDENT_COMMAND_TYPE_DEDENT ? indent2.queue.slice(0, -1) : [...indent2.queue, command];
27639
+ function generateIndent(indent2, command2, options) {
27640
+ const queue = command2.type === INDENT_COMMAND_TYPE_DEDENT ? indent2.queue.slice(0, -1) : [...indent2.queue, command2];
27641
27641
  let value = "";
27642
27642
  let length = 0;
27643
27643
  let lastTabs = 0;
27644
27644
  let lastSpaces = 0;
27645
- for (const command2 of queue) {
27646
- switch (command2.type) {
27645
+ for (const command22 of queue) {
27646
+ switch (command22.type) {
27647
27647
  case INDENT_COMMAND_TYPE_INDENT:
27648
27648
  flush();
27649
27649
  if (options.useTabs) {
@@ -27653,20 +27653,20 @@ function generateIndent(indent2, command, options) {
27653
27653
  }
27654
27654
  break;
27655
27655
  case INDENT_COMMAND_TYPE_STRING: {
27656
- const { string: string4 } = command2;
27656
+ const { string: string4 } = command22;
27657
27657
  flush();
27658
27658
  value += string4;
27659
27659
  length += string4.length;
27660
27660
  break;
27661
27661
  }
27662
27662
  case INDENT_COMMAND_TYPE_WIDTH: {
27663
- const { width } = command2;
27663
+ const { width } = command22;
27664
27664
  lastTabs += 1;
27665
27665
  lastSpaces += width;
27666
27666
  break;
27667
27667
  }
27668
27668
  default:
27669
- throw new Error(`Unexpected indent comment '${command2.type}'.`);
27669
+ throw new Error(`Unexpected indent comment '${command22.type}'.`);
27670
27670
  }
27671
27671
  }
27672
27672
  flushSpaces();
@@ -27713,17 +27713,17 @@ function makeAlign(indent2, indentOptions, options) {
27713
27713
  if (indentOptions === Number.NEGATIVE_INFINITY) {
27714
27714
  return indent2.root;
27715
27715
  }
27716
- let command;
27716
+ let command2;
27717
27717
  if (typeof indentOptions === "number") {
27718
27718
  if (indentOptions < 0) {
27719
- command = INDENT_COMMAND_DEDENT;
27719
+ command2 = INDENT_COMMAND_DEDENT;
27720
27720
  } else {
27721
- command = { type: INDENT_COMMAND_TYPE_WIDTH, width: indentOptions };
27721
+ command2 = { type: INDENT_COMMAND_TYPE_WIDTH, width: indentOptions };
27722
27722
  }
27723
27723
  } else {
27724
- command = { type: INDENT_COMMAND_TYPE_STRING, string: indentOptions };
27724
+ command2 = { type: INDENT_COMMAND_TYPE_STRING, string: indentOptions };
27725
27725
  }
27726
- return generateIndent(indent2, command, options);
27726
+ return generateIndent(indent2, command2, options);
27727
27727
  }
27728
27728
  function makeIndent(indent2, options) {
27729
27729
  return generateIndent(indent2, INDENT_COMMAND_INDENT, options);
@@ -133400,14 +133400,14 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
133400
133400
  return ROOT_INDENT2;
133401
133401
  }
133402
133402
  };
133403
- function generateIndent2(indent22, command, options8) {
133404
- const queue = command.type === INDENT_COMMAND_TYPE_DEDENT2 ? indent22.queue.slice(0, -1) : [...indent22.queue, command];
133403
+ function generateIndent2(indent22, command2, options8) {
133404
+ const queue = command2.type === INDENT_COMMAND_TYPE_DEDENT2 ? indent22.queue.slice(0, -1) : [...indent22.queue, command2];
133405
133405
  let value = "";
133406
133406
  let length = 0;
133407
133407
  let lastTabs = 0;
133408
133408
  let lastSpaces = 0;
133409
- for (const command2 of queue) {
133410
- switch (command2.type) {
133409
+ for (const command22 of queue) {
133410
+ switch (command22.type) {
133411
133411
  case INDENT_COMMAND_TYPE_INDENT2:
133412
133412
  flush();
133413
133413
  if (options8.useTabs) {
@@ -133417,20 +133417,20 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
133417
133417
  }
133418
133418
  break;
133419
133419
  case INDENT_COMMAND_TYPE_STRING2: {
133420
- const { string: string4 } = command2;
133420
+ const { string: string4 } = command22;
133421
133421
  flush();
133422
133422
  value += string4;
133423
133423
  length += string4.length;
133424
133424
  break;
133425
133425
  }
133426
133426
  case INDENT_COMMAND_TYPE_WIDTH2: {
133427
- const { width } = command2;
133427
+ const { width } = command22;
133428
133428
  lastTabs += 1;
133429
133429
  lastSpaces += width;
133430
133430
  break;
133431
133431
  }
133432
133432
  default:
133433
- throw new Error(`Unexpected indent comment '${command2.type}'.`);
133433
+ throw new Error(`Unexpected indent comment '${command22.type}'.`);
133434
133434
  }
133435
133435
  }
133436
133436
  flushSpaces();
@@ -133477,17 +133477,17 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
133477
133477
  if (indentOptions === Number.NEGATIVE_INFINITY) {
133478
133478
  return indent22.root;
133479
133479
  }
133480
- let command;
133480
+ let command2;
133481
133481
  if (typeof indentOptions === "number") {
133482
133482
  if (indentOptions < 0) {
133483
- command = INDENT_COMMAND_DEDENT2;
133483
+ command2 = INDENT_COMMAND_DEDENT2;
133484
133484
  } else {
133485
- command = { type: INDENT_COMMAND_TYPE_WIDTH2, width: indentOptions };
133485
+ command2 = { type: INDENT_COMMAND_TYPE_WIDTH2, width: indentOptions };
133486
133486
  }
133487
133487
  } else {
133488
- command = { type: INDENT_COMMAND_TYPE_STRING2, string: indentOptions };
133488
+ command2 = { type: INDENT_COMMAND_TYPE_STRING2, string: indentOptions };
133489
133489
  }
133490
- return generateIndent2(indent22, command, options8);
133490
+ return generateIndent2(indent22, command2, options8);
133491
133491
  }
133492
133492
  function makeIndent2(indent22, options8) {
133493
133493
  return generateIndent2(indent22, INDENT_COMMAND_INDENT2, options8);
@@ -214717,7 +214717,7 @@ var require_dist5 = __commonJS((exports, module) => {
214717
214717
  });
214718
214718
  module.exports = __toCommonJS(src_exports);
214719
214719
  var import_promises22 = __require("node:fs/promises");
214720
- var import_node_fs22 = __require("node:fs");
214720
+ var import_node_fs23 = __require("node:fs");
214721
214721
  var DEVIN_LOCAL_PATH = "/opt/.devin";
214722
214722
  var CURSOR2 = "cursor";
214723
214723
  var CURSOR_CLI = "cursor-cli";
@@ -214774,7 +214774,7 @@ var require_dist5 = __commonJS((exports, module) => {
214774
214774
  return { isAgent: true, agent: { name: REPLIT } };
214775
214775
  }
214776
214776
  try {
214777
- await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs22.constants.F_OK);
214777
+ await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs23.constants.F_OK);
214778
214778
  return { isAgent: true, agent: { name: DEVIN } };
214779
214779
  } catch (error48) {}
214780
214780
  return { isAgent: false, agent: undefined };
@@ -215888,6 +215888,715 @@ ${l}
215888
215888
  }
215889
215889
  } }).prompt();
215890
215890
 
215891
+ // ../../node_modules/chalk/source/vendor/ansi-styles/index.js
215892
+ var ANSI_BACKGROUND_OFFSET = 10;
215893
+ var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
215894
+ var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
215895
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
215896
+ var styles = {
215897
+ modifier: {
215898
+ reset: [0, 0],
215899
+ bold: [1, 22],
215900
+ dim: [2, 22],
215901
+ italic: [3, 23],
215902
+ underline: [4, 24],
215903
+ overline: [53, 55],
215904
+ inverse: [7, 27],
215905
+ hidden: [8, 28],
215906
+ strikethrough: [9, 29]
215907
+ },
215908
+ color: {
215909
+ black: [30, 39],
215910
+ red: [31, 39],
215911
+ green: [32, 39],
215912
+ yellow: [33, 39],
215913
+ blue: [34, 39],
215914
+ magenta: [35, 39],
215915
+ cyan: [36, 39],
215916
+ white: [37, 39],
215917
+ blackBright: [90, 39],
215918
+ gray: [90, 39],
215919
+ grey: [90, 39],
215920
+ redBright: [91, 39],
215921
+ greenBright: [92, 39],
215922
+ yellowBright: [93, 39],
215923
+ blueBright: [94, 39],
215924
+ magentaBright: [95, 39],
215925
+ cyanBright: [96, 39],
215926
+ whiteBright: [97, 39]
215927
+ },
215928
+ bgColor: {
215929
+ bgBlack: [40, 49],
215930
+ bgRed: [41, 49],
215931
+ bgGreen: [42, 49],
215932
+ bgYellow: [43, 49],
215933
+ bgBlue: [44, 49],
215934
+ bgMagenta: [45, 49],
215935
+ bgCyan: [46, 49],
215936
+ bgWhite: [47, 49],
215937
+ bgBlackBright: [100, 49],
215938
+ bgGray: [100, 49],
215939
+ bgGrey: [100, 49],
215940
+ bgRedBright: [101, 49],
215941
+ bgGreenBright: [102, 49],
215942
+ bgYellowBright: [103, 49],
215943
+ bgBlueBright: [104, 49],
215944
+ bgMagentaBright: [105, 49],
215945
+ bgCyanBright: [106, 49],
215946
+ bgWhiteBright: [107, 49]
215947
+ }
215948
+ };
215949
+ var modifierNames = Object.keys(styles.modifier);
215950
+ var foregroundColorNames = Object.keys(styles.color);
215951
+ var backgroundColorNames = Object.keys(styles.bgColor);
215952
+ var colorNames = [...foregroundColorNames, ...backgroundColorNames];
215953
+ function assembleStyles() {
215954
+ const codes = new Map;
215955
+ for (const [groupName, group] of Object.entries(styles)) {
215956
+ for (const [styleName, style] of Object.entries(group)) {
215957
+ styles[styleName] = {
215958
+ open: `\x1B[${style[0]}m`,
215959
+ close: `\x1B[${style[1]}m`
215960
+ };
215961
+ group[styleName] = styles[styleName];
215962
+ codes.set(style[0], style[1]);
215963
+ }
215964
+ Object.defineProperty(styles, groupName, {
215965
+ value: group,
215966
+ enumerable: false
215967
+ });
215968
+ }
215969
+ Object.defineProperty(styles, "codes", {
215970
+ value: codes,
215971
+ enumerable: false
215972
+ });
215973
+ styles.color.close = "\x1B[39m";
215974
+ styles.bgColor.close = "\x1B[49m";
215975
+ styles.color.ansi = wrapAnsi16();
215976
+ styles.color.ansi256 = wrapAnsi256();
215977
+ styles.color.ansi16m = wrapAnsi16m();
215978
+ styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
215979
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
215980
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
215981
+ Object.defineProperties(styles, {
215982
+ rgbToAnsi256: {
215983
+ value(red, green, blue) {
215984
+ if (red === green && green === blue) {
215985
+ if (red < 8) {
215986
+ return 16;
215987
+ }
215988
+ if (red > 248) {
215989
+ return 231;
215990
+ }
215991
+ return Math.round((red - 8) / 247 * 24) + 232;
215992
+ }
215993
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
215994
+ },
215995
+ enumerable: false
215996
+ },
215997
+ hexToRgb: {
215998
+ value(hex) {
215999
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
216000
+ if (!matches) {
216001
+ return [0, 0, 0];
216002
+ }
216003
+ let [colorString] = matches;
216004
+ if (colorString.length === 3) {
216005
+ colorString = [...colorString].map((character) => character + character).join("");
216006
+ }
216007
+ const integer = Number.parseInt(colorString, 16);
216008
+ return [
216009
+ integer >> 16 & 255,
216010
+ integer >> 8 & 255,
216011
+ integer & 255
216012
+ ];
216013
+ },
216014
+ enumerable: false
216015
+ },
216016
+ hexToAnsi256: {
216017
+ value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
216018
+ enumerable: false
216019
+ },
216020
+ ansi256ToAnsi: {
216021
+ value(code) {
216022
+ if (code < 8) {
216023
+ return 30 + code;
216024
+ }
216025
+ if (code < 16) {
216026
+ return 90 + (code - 8);
216027
+ }
216028
+ let red;
216029
+ let green;
216030
+ let blue;
216031
+ if (code >= 232) {
216032
+ red = ((code - 232) * 10 + 8) / 255;
216033
+ green = red;
216034
+ blue = red;
216035
+ } else {
216036
+ code -= 16;
216037
+ const remainder = code % 36;
216038
+ red = Math.floor(code / 36) / 5;
216039
+ green = Math.floor(remainder / 6) / 5;
216040
+ blue = remainder % 6 / 5;
216041
+ }
216042
+ const value = Math.max(red, green, blue) * 2;
216043
+ if (value === 0) {
216044
+ return 30;
216045
+ }
216046
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
216047
+ if (value === 2) {
216048
+ result += 60;
216049
+ }
216050
+ return result;
216051
+ },
216052
+ enumerable: false
216053
+ },
216054
+ rgbToAnsi: {
216055
+ value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
216056
+ enumerable: false
216057
+ },
216058
+ hexToAnsi: {
216059
+ value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
216060
+ enumerable: false
216061
+ }
216062
+ });
216063
+ return styles;
216064
+ }
216065
+ var ansiStyles = assembleStyles();
216066
+ var ansi_styles_default = ansiStyles;
216067
+
216068
+ // ../../node_modules/chalk/source/vendor/supports-color/index.js
216069
+ import process2 from "node:process";
216070
+ import os from "node:os";
216071
+ import tty from "node:tty";
216072
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
216073
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
216074
+ const position = argv.indexOf(prefix + flag);
216075
+ const terminatorPosition = argv.indexOf("--");
216076
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
216077
+ }
216078
+ var { env } = process2;
216079
+ var flagForceColor;
216080
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
216081
+ flagForceColor = 0;
216082
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
216083
+ flagForceColor = 1;
216084
+ }
216085
+ function envForceColor() {
216086
+ if ("FORCE_COLOR" in env) {
216087
+ if (env.FORCE_COLOR === "true") {
216088
+ return 1;
216089
+ }
216090
+ if (env.FORCE_COLOR === "false") {
216091
+ return 0;
216092
+ }
216093
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
216094
+ }
216095
+ }
216096
+ function translateLevel(level) {
216097
+ if (level === 0) {
216098
+ return false;
216099
+ }
216100
+ return {
216101
+ level,
216102
+ hasBasic: true,
216103
+ has256: level >= 2,
216104
+ has16m: level >= 3
216105
+ };
216106
+ }
216107
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
216108
+ const noFlagForceColor = envForceColor();
216109
+ if (noFlagForceColor !== undefined) {
216110
+ flagForceColor = noFlagForceColor;
216111
+ }
216112
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
216113
+ if (forceColor === 0) {
216114
+ return 0;
216115
+ }
216116
+ if (sniffFlags) {
216117
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
216118
+ return 3;
216119
+ }
216120
+ if (hasFlag("color=256")) {
216121
+ return 2;
216122
+ }
216123
+ }
216124
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) {
216125
+ return 1;
216126
+ }
216127
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
216128
+ return 0;
216129
+ }
216130
+ const min = forceColor || 0;
216131
+ if (env.TERM === "dumb") {
216132
+ return min;
216133
+ }
216134
+ if (process2.platform === "win32") {
216135
+ const osRelease = os.release().split(".");
216136
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
216137
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
216138
+ }
216139
+ return 1;
216140
+ }
216141
+ if ("CI" in env) {
216142
+ if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env))) {
216143
+ return 3;
216144
+ }
216145
+ if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env)) || env.CI_NAME === "codeship") {
216146
+ return 1;
216147
+ }
216148
+ return min;
216149
+ }
216150
+ if ("TEAMCITY_VERSION" in env) {
216151
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
216152
+ }
216153
+ if (env.COLORTERM === "truecolor") {
216154
+ return 3;
216155
+ }
216156
+ if (env.TERM === "xterm-kitty") {
216157
+ return 3;
216158
+ }
216159
+ if (env.TERM === "xterm-ghostty") {
216160
+ return 3;
216161
+ }
216162
+ if (env.TERM === "wezterm") {
216163
+ return 3;
216164
+ }
216165
+ if ("TERM_PROGRAM" in env) {
216166
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
216167
+ switch (env.TERM_PROGRAM) {
216168
+ case "iTerm.app": {
216169
+ return version >= 3 ? 3 : 2;
216170
+ }
216171
+ case "Apple_Terminal": {
216172
+ return 2;
216173
+ }
216174
+ }
216175
+ }
216176
+ if (/-256(color)?$/i.test(env.TERM)) {
216177
+ return 2;
216178
+ }
216179
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
216180
+ return 1;
216181
+ }
216182
+ if ("COLORTERM" in env) {
216183
+ return 1;
216184
+ }
216185
+ return min;
216186
+ }
216187
+ function createSupportsColor(stream, options = {}) {
216188
+ const level = _supportsColor(stream, {
216189
+ streamIsTTY: stream && stream.isTTY,
216190
+ ...options
216191
+ });
216192
+ return translateLevel(level);
216193
+ }
216194
+ var supportsColor = {
216195
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
216196
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
216197
+ };
216198
+ var supports_color_default = supportsColor;
216199
+
216200
+ // ../../node_modules/chalk/source/utilities.js
216201
+ function stringReplaceAll(string, substring, replacer) {
216202
+ let index = string.indexOf(substring);
216203
+ if (index === -1) {
216204
+ return string;
216205
+ }
216206
+ const substringLength = substring.length;
216207
+ let endIndex = 0;
216208
+ let returnValue = "";
216209
+ do {
216210
+ returnValue += string.slice(endIndex, index) + substring + replacer;
216211
+ endIndex = index + substringLength;
216212
+ index = string.indexOf(substring, endIndex);
216213
+ } while (index !== -1);
216214
+ returnValue += string.slice(endIndex);
216215
+ return returnValue;
216216
+ }
216217
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
216218
+ let endIndex = 0;
216219
+ let returnValue = "";
216220
+ do {
216221
+ const gotCR = string[index - 1] === "\r";
216222
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
216223
+ ` : `
216224
+ `) + postfix;
216225
+ endIndex = index + 1;
216226
+ index = string.indexOf(`
216227
+ `, endIndex);
216228
+ } while (index !== -1);
216229
+ returnValue += string.slice(endIndex);
216230
+ return returnValue;
216231
+ }
216232
+
216233
+ // ../../node_modules/chalk/source/index.js
216234
+ var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
216235
+ var GENERATOR = Symbol("GENERATOR");
216236
+ var STYLER = Symbol("STYLER");
216237
+ var IS_EMPTY = Symbol("IS_EMPTY");
216238
+ var levelMapping = [
216239
+ "ansi",
216240
+ "ansi",
216241
+ "ansi256",
216242
+ "ansi16m"
216243
+ ];
216244
+ var styles2 = Object.create(null);
216245
+ var applyOptions = (object, options = {}) => {
216246
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
216247
+ throw new Error("The `level` option should be an integer from 0 to 3");
216248
+ }
216249
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
216250
+ object.level = options.level === undefined ? colorLevel : options.level;
216251
+ };
216252
+ var chalkFactory = (options) => {
216253
+ const chalk = (...strings) => strings.join(" ");
216254
+ applyOptions(chalk, options);
216255
+ Object.setPrototypeOf(chalk, createChalk.prototype);
216256
+ return chalk;
216257
+ };
216258
+ function createChalk(options) {
216259
+ return chalkFactory(options);
216260
+ }
216261
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
216262
+ for (const [styleName, style] of Object.entries(ansi_styles_default)) {
216263
+ styles2[styleName] = {
216264
+ get() {
216265
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
216266
+ Object.defineProperty(this, styleName, { value: builder });
216267
+ return builder;
216268
+ }
216269
+ };
216270
+ }
216271
+ styles2.visible = {
216272
+ get() {
216273
+ const builder = createBuilder(this, this[STYLER], true);
216274
+ Object.defineProperty(this, "visible", { value: builder });
216275
+ return builder;
216276
+ }
216277
+ };
216278
+ var getModelAnsi = (model, level, type, ...arguments_) => {
216279
+ if (model === "rgb") {
216280
+ if (level === "ansi16m") {
216281
+ return ansi_styles_default[type].ansi16m(...arguments_);
216282
+ }
216283
+ if (level === "ansi256") {
216284
+ return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
216285
+ }
216286
+ return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
216287
+ }
216288
+ if (model === "hex") {
216289
+ return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
216290
+ }
216291
+ return ansi_styles_default[type][model](...arguments_);
216292
+ };
216293
+ var usedModels = ["rgb", "hex", "ansi256"];
216294
+ for (const model of usedModels) {
216295
+ styles2[model] = {
216296
+ get() {
216297
+ const { level } = this;
216298
+ return function(...arguments_) {
216299
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
216300
+ return createBuilder(this, styler, this[IS_EMPTY]);
216301
+ };
216302
+ }
216303
+ };
216304
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
216305
+ styles2[bgModel] = {
216306
+ get() {
216307
+ const { level } = this;
216308
+ return function(...arguments_) {
216309
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
216310
+ return createBuilder(this, styler, this[IS_EMPTY]);
216311
+ };
216312
+ }
216313
+ };
216314
+ }
216315
+ var proto = Object.defineProperties(() => {}, {
216316
+ ...styles2,
216317
+ level: {
216318
+ enumerable: true,
216319
+ get() {
216320
+ return this[GENERATOR].level;
216321
+ },
216322
+ set(level) {
216323
+ this[GENERATOR].level = level;
216324
+ }
216325
+ }
216326
+ });
216327
+ var createStyler = (open, close, parent) => {
216328
+ let openAll;
216329
+ let closeAll;
216330
+ if (parent === undefined) {
216331
+ openAll = open;
216332
+ closeAll = close;
216333
+ } else {
216334
+ openAll = parent.openAll + open;
216335
+ closeAll = close + parent.closeAll;
216336
+ }
216337
+ return {
216338
+ open,
216339
+ close,
216340
+ openAll,
216341
+ closeAll,
216342
+ parent
216343
+ };
216344
+ };
216345
+ var createBuilder = (self2, _styler, _isEmpty) => {
216346
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
216347
+ Object.setPrototypeOf(builder, proto);
216348
+ builder[GENERATOR] = self2;
216349
+ builder[STYLER] = _styler;
216350
+ builder[IS_EMPTY] = _isEmpty;
216351
+ return builder;
216352
+ };
216353
+ var applyStyle = (self2, string) => {
216354
+ if (self2.level <= 0 || !string) {
216355
+ return self2[IS_EMPTY] ? "" : string;
216356
+ }
216357
+ let styler = self2[STYLER];
216358
+ if (styler === undefined) {
216359
+ return string;
216360
+ }
216361
+ const { openAll, closeAll } = styler;
216362
+ if (string.includes("\x1B")) {
216363
+ while (styler !== undefined) {
216364
+ string = stringReplaceAll(string, styler.close, styler.open);
216365
+ styler = styler.parent;
216366
+ }
216367
+ }
216368
+ const lfIndex = string.indexOf(`
216369
+ `);
216370
+ if (lfIndex !== -1) {
216371
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
216372
+ }
216373
+ return openAll + string + closeAll;
216374
+ };
216375
+ Object.defineProperties(createChalk.prototype, styles2);
216376
+ var chalk = createChalk();
216377
+ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
216378
+ var source_default = chalk;
216379
+
216380
+ // src/cli/utils/theme.ts
216381
+ var theme = {
216382
+ colors: {
216383
+ base44Orange: source_default.hex("#E86B3C"),
216384
+ base44OrangeBackground: source_default.bgHex("#E86B3C"),
216385
+ shinyOrange: source_default.hex("#FFD700"),
216386
+ links: source_default.hex("#00D4FF"),
216387
+ white: source_default.white
216388
+ },
216389
+ styles: {
216390
+ header: source_default.dim,
216391
+ bold: source_default.bold,
216392
+ dim: source_default.dim,
216393
+ error: source_default.red,
216394
+ warn: source_default.yellow
216395
+ },
216396
+ format: {
216397
+ errorContext(ctx) {
216398
+ const parts = [
216399
+ ctx.sessionId ? `Session: ${ctx.sessionId}` : null,
216400
+ ctx.appId ? `App: ${ctx.appId}` : null,
216401
+ new Date().toISOString()
216402
+ ].filter(Boolean);
216403
+ return source_default.dim(parts.join(" | "));
216404
+ },
216405
+ details(lines) {
216406
+ return lines.map((line) => ` • ${line}`).join(`
216407
+ `);
216408
+ },
216409
+ agentHints(hints) {
216410
+ if (hints.length === 0) {
216411
+ return null;
216412
+ }
216413
+ const hintLines = hints.map((hint) => {
216414
+ if (hint.command) {
216415
+ return ` Run: ${hint.command}`;
216416
+ }
216417
+ return ` ${hint.message}`;
216418
+ });
216419
+ return ["[Agent Hints]", ...hintLines].join(`
216420
+ `);
216421
+ }
216422
+ }
216423
+ };
216424
+
216425
+ // src/cli/utils/animate.ts
216426
+ function sleep(ms) {
216427
+ return new Promise((resolve) => setTimeout(resolve, ms));
216428
+ }
216429
+ async function animateLineReveal(line, duration) {
216430
+ const steps = 8;
216431
+ const stepDuration = duration / steps;
216432
+ for (let step = 0;step <= steps; step++) {
216433
+ const progress = step / steps;
216434
+ const revealIndex = Math.floor(progress * line.length);
216435
+ let output = "";
216436
+ for (let i = 0;i < line.length; i++) {
216437
+ if (i < revealIndex) {
216438
+ output += theme.colors.base44Orange(line[i]);
216439
+ } else if (i === revealIndex) {
216440
+ output += theme.colors.shinyOrange(line[i]);
216441
+ } else {
216442
+ output += theme.styles.dim(line[i]);
216443
+ }
216444
+ }
216445
+ process.stdout.write(`\r${output}`);
216446
+ await sleep(stepDuration);
216447
+ }
216448
+ process.stdout.write(`\r${theme.colors.base44Orange(line)}
216449
+ `);
216450
+ }
216451
+ async function shimmerPass(lines, duration) {
216452
+ const moveUp = `\x1B[${lines.length}A`;
216453
+ const steps = 12;
216454
+ const stepDuration = duration / steps;
216455
+ const maxWidth = Math.max(...lines.map((l) => l.length));
216456
+ for (let step = 0;step <= steps; step++) {
216457
+ const shimmerPos = Math.floor(step / steps * (maxWidth + 6));
216458
+ process.stdout.write(moveUp);
216459
+ for (const line of lines) {
216460
+ let output = "";
216461
+ for (let i = 0;i < line.length; i++) {
216462
+ const dist = Math.abs(i - shimmerPos);
216463
+ if (dist < 3) {
216464
+ output += dist === 0 ? theme.colors.white(line[i]) : theme.colors.shinyOrange(line[i]);
216465
+ } else {
216466
+ output += theme.colors.base44Orange(line[i]);
216467
+ }
216468
+ }
216469
+ console.log(output);
216470
+ }
216471
+ await sleep(stepDuration);
216472
+ }
216473
+ process.stdout.write(moveUp);
216474
+ for (const line of lines) {
216475
+ console.log(theme.colors.base44Orange(line));
216476
+ }
216477
+ }
216478
+ async function printAnimatedLines(lines) {
216479
+ const totalDuration = 1000;
216480
+ const lineDelay = totalDuration / lines.length;
216481
+ for (let i = 0;i < lines.length; i++) {
216482
+ const line = lines[i];
216483
+ await animateLineReveal(line, 100);
216484
+ if (i < lines.length - 1) {
216485
+ await sleep(lineDelay - 100);
216486
+ }
216487
+ }
216488
+ await shimmerPass(lines, 200);
216489
+ }
216490
+
216491
+ // src/cli/utils/banner.ts
216492
+ var BANNER_LINES = [
216493
+ "██████╗ █████╗ ███████╗███████╗ ██╗ ██╗██╗ ██╗",
216494
+ "██╔══██╗██╔══██╗██╔════╝██╔════╝ ██║ ██║██║ ██║",
216495
+ "██████╔╝███████║███████╗█████╗ ███████║███████║",
216496
+ "██╔══██╗██╔══██║╚════██║██╔══╝ ╚════██║╚════██║",
216497
+ "██████╔╝██║ ██║███████║███████╗ ██║ ██║",
216498
+ "╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝"
216499
+ ];
216500
+ async function printBanner() {
216501
+ await printAnimatedLines(BANNER_LINES);
216502
+ }
216503
+ // ../../node_modules/p-wait-for/index.js
216504
+ var resolveValue = Symbol("resolveValue");
216505
+ var sleep2 = (ms, signal) => new Promise((resolve, reject) => {
216506
+ if (signal?.aborted) {
216507
+ reject(signal.reason);
216508
+ return;
216509
+ }
216510
+ const timeout = setTimeout(resolve, ms);
216511
+ if (signal) {
216512
+ signal.addEventListener("abort", () => {
216513
+ clearTimeout(timeout);
216514
+ reject(signal.reason);
216515
+ }, { once: true });
216516
+ }
216517
+ });
216518
+ var validateOptions = (interval, timeout) => {
216519
+ if (typeof interval !== "number" || !Number.isFinite(interval) || interval < 0) {
216520
+ throw new TypeError("Expected interval to be a finite non-negative number");
216521
+ }
216522
+ if (typeof timeout === "object" && timeout !== null) {
216523
+ if (typeof timeout.milliseconds !== "number" || Number.isNaN(timeout.milliseconds) || timeout.milliseconds < 0) {
216524
+ throw new TypeError("Expected timeout.milliseconds to be a finite non-negative number");
216525
+ }
216526
+ } else if (typeof timeout === "number" && (Number.isNaN(timeout) || timeout < 0)) {
216527
+ throw new TypeError("Expected timeout to be a finite non-negative number");
216528
+ }
216529
+ };
216530
+ var createTimeoutError = (timeout) => {
216531
+ if (timeout.message instanceof Error) {
216532
+ return timeout.message;
216533
+ }
216534
+ const message = timeout.message ?? `Promise timed out after ${timeout.milliseconds} milliseconds`;
216535
+ return new TimeoutError(message);
216536
+ };
216537
+ var handleFallback = (timeout) => {
216538
+ if (timeout.fallback) {
216539
+ return timeout.fallback();
216540
+ }
216541
+ throw createTimeoutError(timeout);
216542
+ };
216543
+ var handleAbortError = (timeoutSignal, timeout, signal) => {
216544
+ if (timeoutSignal?.aborted) {
216545
+ if (typeof timeout === "object") {
216546
+ return handleFallback(timeout);
216547
+ }
216548
+ throw new TimeoutError;
216549
+ }
216550
+ throw signal.reason;
216551
+ };
216552
+ async function pWaitFor(condition, options = {}) {
216553
+ const {
216554
+ interval = 20,
216555
+ timeout = Number.POSITIVE_INFINITY,
216556
+ before = true,
216557
+ signal
216558
+ } = options;
216559
+ validateOptions(interval, timeout);
216560
+ const timeoutMs = typeof timeout === "number" ? timeout : timeout?.milliseconds ?? Number.POSITIVE_INFINITY;
216561
+ const timeoutSignal = timeoutMs === Number.POSITIVE_INFINITY ? undefined : AbortSignal.timeout(timeoutMs);
216562
+ const combinedSignal = timeoutSignal && signal ? AbortSignal.any([timeoutSignal, signal]) : timeoutSignal ?? signal;
216563
+ if (!before) {
216564
+ await sleep2(interval, combinedSignal);
216565
+ }
216566
+ if (combinedSignal?.aborted) {
216567
+ return handleAbortError(timeoutSignal, timeout, signal);
216568
+ }
216569
+ while (true) {
216570
+ try {
216571
+ const value = await condition();
216572
+ if (typeof value === "object" && value !== null && resolveValue in value) {
216573
+ return value[resolveValue];
216574
+ }
216575
+ if (value === true) {
216576
+ return;
216577
+ }
216578
+ if (value === false) {
216579
+ await sleep2(interval, combinedSignal);
216580
+ continue;
216581
+ }
216582
+ throw new TypeError("Expected condition to return a boolean");
216583
+ } catch (error) {
216584
+ if (error === combinedSignal?.reason) {
216585
+ return handleAbortError(timeoutSignal, timeout, signal);
216586
+ }
216587
+ throw error;
216588
+ }
216589
+ }
216590
+ }
216591
+ pWaitFor.resolveWith = (value) => ({ [resolveValue]: value });
216592
+
216593
+ class TimeoutError extends Error {
216594
+ constructor(message = "Promise timed out") {
216595
+ super(message);
216596
+ this.name = "TimeoutError";
216597
+ }
216598
+ }
216599
+
215891
216600
  // ../../node_modules/zod/v4/classic/external.js
215892
216601
  var exports_external = {};
215893
216602
  __export(exports_external, {
@@ -216145,7 +216854,7 @@ __export(exports_core2, {
216145
216854
  safeDecode: () => safeDecode,
216146
216855
  registry: () => registry,
216147
216856
  regexes: () => exports_regexes,
216148
- process: () => process2,
216857
+ process: () => process3,
216149
216858
  prettifyError: () => prettifyError,
216150
216859
  parseAsync: () => parseAsync,
216151
216860
  parse: () => parse,
@@ -216428,12 +217137,12 @@ function $constructor(name, initializer, params) {
216428
217137
  }
216429
217138
  inst._zod.traits.add(name);
216430
217139
  initializer(inst, def);
216431
- const proto = _2.prototype;
216432
- const keys = Object.keys(proto);
217140
+ const proto2 = _2.prototype;
217141
+ const keys = Object.keys(proto2);
216433
217142
  for (let i = 0;i < keys.length; i++) {
216434
217143
  const k2 = keys[i];
216435
217144
  if (!(k2 in inst)) {
216436
- inst[k2] = proto[k2].bind(inst);
217145
+ inst[k2] = proto2[k2].bind(inst);
216437
217146
  }
216438
217147
  }
216439
217148
  }
@@ -226609,7 +227318,7 @@ function initializeContext(params) {
226609
227318
  external: params?.external ?? undefined
226610
227319
  };
226611
227320
  }
226612
- function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
227321
+ function process3(schema, ctx, _params = { path: [], schemaPath: [] }) {
226613
227322
  var _a2;
226614
227323
  const def = schema._zod.def;
226615
227324
  const seen = ctx.seen.get(schema);
@@ -226646,7 +227355,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
226646
227355
  if (parent) {
226647
227356
  if (!result.ref)
226648
227357
  result.ref = parent;
226649
- process2(parent, ctx, params);
227358
+ process3(parent, ctx, params);
226650
227359
  ctx.seen.get(parent).isParent = true;
226651
227360
  }
226652
227361
  }
@@ -226922,14 +227631,14 @@ function isTransforming(_schema, _ctx) {
226922
227631
  }
226923
227632
  var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
226924
227633
  const ctx = initializeContext({ ...params, processors });
226925
- process2(schema, ctx);
227634
+ process3(schema, ctx);
226926
227635
  extractDefs(ctx, schema);
226927
227636
  return finalize(ctx, schema);
226928
227637
  };
226929
227638
  var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
226930
227639
  const { libraryOptions, target } = params ?? {};
226931
227640
  const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
226932
- process2(schema, ctx);
227641
+ process3(schema, ctx);
226933
227642
  extractDefs(ctx, schema);
226934
227643
  return finalize(ctx, schema);
226935
227644
  };
@@ -227180,7 +227889,7 @@ var arrayProcessor = (schema, ctx, _json, params) => {
227180
227889
  if (typeof maximum === "number")
227181
227890
  json.maxItems = maximum;
227182
227891
  json.type = "array";
227183
- json.items = process2(def.element, ctx, { ...params, path: [...params.path, "items"] });
227892
+ json.items = process3(def.element, ctx, { ...params, path: [...params.path, "items"] });
227184
227893
  };
227185
227894
  var objectProcessor = (schema, ctx, _json, params) => {
227186
227895
  const json = _json;
@@ -227189,7 +227898,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
227189
227898
  json.properties = {};
227190
227899
  const shape = def.shape;
227191
227900
  for (const key in shape) {
227192
- json.properties[key] = process2(shape[key], ctx, {
227901
+ json.properties[key] = process3(shape[key], ctx, {
227193
227902
  ...params,
227194
227903
  path: [...params.path, "properties", key]
227195
227904
  });
@@ -227212,7 +227921,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
227212
227921
  if (ctx.io === "output")
227213
227922
  json.additionalProperties = false;
227214
227923
  } else if (def.catchall) {
227215
- json.additionalProperties = process2(def.catchall, ctx, {
227924
+ json.additionalProperties = process3(def.catchall, ctx, {
227216
227925
  ...params,
227217
227926
  path: [...params.path, "additionalProperties"]
227218
227927
  });
@@ -227221,7 +227930,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
227221
227930
  var unionProcessor = (schema, ctx, json, params) => {
227222
227931
  const def = schema._zod.def;
227223
227932
  const isExclusive = def.inclusive === false;
227224
- const options = def.options.map((x3, i) => process2(x3, ctx, {
227933
+ const options = def.options.map((x3, i) => process3(x3, ctx, {
227225
227934
  ...params,
227226
227935
  path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
227227
227936
  }));
@@ -227233,11 +227942,11 @@ var unionProcessor = (schema, ctx, json, params) => {
227233
227942
  };
227234
227943
  var intersectionProcessor = (schema, ctx, json, params) => {
227235
227944
  const def = schema._zod.def;
227236
- const a = process2(def.left, ctx, {
227945
+ const a = process3(def.left, ctx, {
227237
227946
  ...params,
227238
227947
  path: [...params.path, "allOf", 0]
227239
227948
  });
227240
- const b = process2(def.right, ctx, {
227949
+ const b = process3(def.right, ctx, {
227241
227950
  ...params,
227242
227951
  path: [...params.path, "allOf", 1]
227243
227952
  });
@@ -227254,11 +227963,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
227254
227963
  json.type = "array";
227255
227964
  const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
227256
227965
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
227257
- const prefixItems = def.items.map((x3, i) => process2(x3, ctx, {
227966
+ const prefixItems = def.items.map((x3, i) => process3(x3, ctx, {
227258
227967
  ...params,
227259
227968
  path: [...params.path, prefixPath, i]
227260
227969
  }));
227261
- const rest = def.rest ? process2(def.rest, ctx, {
227970
+ const rest = def.rest ? process3(def.rest, ctx, {
227262
227971
  ...params,
227263
227972
  path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
227264
227973
  }) : null;
@@ -227298,7 +228007,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
227298
228007
  const keyBag = keyType._zod.bag;
227299
228008
  const patterns = keyBag?.patterns;
227300
228009
  if (def.mode === "loose" && patterns && patterns.size > 0) {
227301
- const valueSchema = process2(def.valueType, ctx, {
228010
+ const valueSchema = process3(def.valueType, ctx, {
227302
228011
  ...params,
227303
228012
  path: [...params.path, "patternProperties", "*"]
227304
228013
  });
@@ -227308,12 +228017,12 @@ var recordProcessor = (schema, ctx, _json, params) => {
227308
228017
  }
227309
228018
  } else {
227310
228019
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
227311
- json.propertyNames = process2(def.keyType, ctx, {
228020
+ json.propertyNames = process3(def.keyType, ctx, {
227312
228021
  ...params,
227313
228022
  path: [...params.path, "propertyNames"]
227314
228023
  });
227315
228024
  }
227316
- json.additionalProperties = process2(def.valueType, ctx, {
228025
+ json.additionalProperties = process3(def.valueType, ctx, {
227317
228026
  ...params,
227318
228027
  path: [...params.path, "additionalProperties"]
227319
228028
  });
@@ -227328,7 +228037,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
227328
228037
  };
227329
228038
  var nullableProcessor = (schema, ctx, json, params) => {
227330
228039
  const def = schema._zod.def;
227331
- const inner = process2(def.innerType, ctx, params);
228040
+ const inner = process3(def.innerType, ctx, params);
227332
228041
  const seen = ctx.seen.get(schema);
227333
228042
  if (ctx.target === "openapi-3.0") {
227334
228043
  seen.ref = def.innerType;
@@ -227339,20 +228048,20 @@ var nullableProcessor = (schema, ctx, json, params) => {
227339
228048
  };
227340
228049
  var nonoptionalProcessor = (schema, ctx, _json, params) => {
227341
228050
  const def = schema._zod.def;
227342
- process2(def.innerType, ctx, params);
228051
+ process3(def.innerType, ctx, params);
227343
228052
  const seen = ctx.seen.get(schema);
227344
228053
  seen.ref = def.innerType;
227345
228054
  };
227346
228055
  var defaultProcessor = (schema, ctx, json, params) => {
227347
228056
  const def = schema._zod.def;
227348
- process2(def.innerType, ctx, params);
228057
+ process3(def.innerType, ctx, params);
227349
228058
  const seen = ctx.seen.get(schema);
227350
228059
  seen.ref = def.innerType;
227351
228060
  json.default = JSON.parse(JSON.stringify(def.defaultValue));
227352
228061
  };
227353
228062
  var prefaultProcessor = (schema, ctx, json, params) => {
227354
228063
  const def = schema._zod.def;
227355
- process2(def.innerType, ctx, params);
228064
+ process3(def.innerType, ctx, params);
227356
228065
  const seen = ctx.seen.get(schema);
227357
228066
  seen.ref = def.innerType;
227358
228067
  if (ctx.io === "input")
@@ -227360,7 +228069,7 @@ var prefaultProcessor = (schema, ctx, json, params) => {
227360
228069
  };
227361
228070
  var catchProcessor = (schema, ctx, json, params) => {
227362
228071
  const def = schema._zod.def;
227363
- process2(def.innerType, ctx, params);
228072
+ process3(def.innerType, ctx, params);
227364
228073
  const seen = ctx.seen.get(schema);
227365
228074
  seen.ref = def.innerType;
227366
228075
  let catchValue;
@@ -227374,32 +228083,32 @@ var catchProcessor = (schema, ctx, json, params) => {
227374
228083
  var pipeProcessor = (schema, ctx, _json, params) => {
227375
228084
  const def = schema._zod.def;
227376
228085
  const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
227377
- process2(innerType, ctx, params);
228086
+ process3(innerType, ctx, params);
227378
228087
  const seen = ctx.seen.get(schema);
227379
228088
  seen.ref = innerType;
227380
228089
  };
227381
228090
  var readonlyProcessor = (schema, ctx, json, params) => {
227382
228091
  const def = schema._zod.def;
227383
- process2(def.innerType, ctx, params);
228092
+ process3(def.innerType, ctx, params);
227384
228093
  const seen = ctx.seen.get(schema);
227385
228094
  seen.ref = def.innerType;
227386
228095
  json.readOnly = true;
227387
228096
  };
227388
228097
  var promiseProcessor = (schema, ctx, _json, params) => {
227389
228098
  const def = schema._zod.def;
227390
- process2(def.innerType, ctx, params);
228099
+ process3(def.innerType, ctx, params);
227391
228100
  const seen = ctx.seen.get(schema);
227392
228101
  seen.ref = def.innerType;
227393
228102
  };
227394
228103
  var optionalProcessor = (schema, ctx, _json, params) => {
227395
228104
  const def = schema._zod.def;
227396
- process2(def.innerType, ctx, params);
228105
+ process3(def.innerType, ctx, params);
227397
228106
  const seen = ctx.seen.get(schema);
227398
228107
  seen.ref = def.innerType;
227399
228108
  };
227400
228109
  var lazyProcessor = (schema, ctx, _json, params) => {
227401
228110
  const innerType = schema._zod.innerType;
227402
- process2(innerType, ctx, params);
228111
+ process3(innerType, ctx, params);
227403
228112
  const seen = ctx.seen.get(schema);
227404
228113
  seen.ref = innerType;
227405
228114
  };
@@ -227451,7 +228160,7 @@ function toJSONSchema(input, params) {
227451
228160
  const defs = {};
227452
228161
  for (const entry of registry2._idmap.entries()) {
227453
228162
  const [_2, schema] = entry;
227454
- process2(schema, ctx2);
228163
+ process3(schema, ctx2);
227455
228164
  }
227456
228165
  const schemas = {};
227457
228166
  const external = {
@@ -227474,7 +228183,7 @@ function toJSONSchema(input, params) {
227474
228183
  return { schemas };
227475
228184
  }
227476
228185
  const ctx = initializeContext({ ...params, processors: allProcessors });
227477
- process2(input, ctx);
228186
+ process3(input, ctx);
227478
228187
  extractDefs(ctx, input);
227479
228188
  return finalize(ctx, input);
227480
228189
  }
@@ -227520,7 +228229,7 @@ class JSONSchemaGenerator {
227520
228229
  });
227521
228230
  }
227522
228231
  process(schema, _params = { path: [], schemaPath: [] }) {
227523
- return process2(schema, this.ctx, _params);
228232
+ return process3(schema, this.ctx, _params);
227524
228233
  }
227525
228234
  emit(schema, _params) {
227526
228235
  if (_params) {
@@ -229867,7 +230576,7 @@ var normalizeRetryOptions = (retry2 = {}) => {
229867
230576
  };
229868
230577
 
229869
230578
  // ../../node_modules/ky/distribution/errors/TimeoutError.js
229870
- class TimeoutError extends Error {
230579
+ class TimeoutError2 extends Error {
229871
230580
  request;
229872
230581
  constructor(request) {
229873
230582
  super(`Request timed out: ${request.method} ${request.url}`);
@@ -229883,7 +230592,7 @@ async function timeout(request, init, abortController, options) {
229883
230592
  if (abortController) {
229884
230593
  abortController.abort();
229885
230594
  }
229886
- reject(new TimeoutError(request));
230595
+ reject(new TimeoutError2(request));
229887
230596
  }, options.timeout);
229888
230597
  options.fetch(request, init).then(resolve).catch(reject).then(() => {
229889
230598
  clearTimeout(timeoutId);
@@ -229946,7 +230655,7 @@ function isHTTPError(error48) {
229946
230655
  return error48 instanceof HTTPError || error48?.name === HTTPError.name;
229947
230656
  }
229948
230657
  function isTimeoutError(error48) {
229949
- return error48 instanceof TimeoutError || error48?.name === TimeoutError.name;
230658
+ return error48 instanceof TimeoutError2 || error48?.name === TimeoutError2.name;
229950
230659
  }
229951
230660
 
229952
230661
  // ../../node_modules/ky/distribution/core/Ky.js
@@ -230849,7 +231558,7 @@ async function isLoggedIn() {
230849
231558
  }
230850
231559
 
230851
231560
  // src/core/project/api.ts
230852
- import { Readable } from "node:stream";
231561
+ import { Readable as Readable2 } from "node:stream";
230853
231562
  import { pipeline } from "node:stream/promises";
230854
231563
 
230855
231564
  // ../../node_modules/@isaacs/fs-minipass/dist/esm/index.js
@@ -236356,66 +237065,11 @@ var mtimeFilter = (opt) => {
236356
237065
  }
236357
237066
  opt.filter = filter ? (path8, stat) => filter(path8, stat) && !((opt.mtimeCache?.get(path8) ?? stat.mtime ?? 0) > (stat.mtime ?? 0)) : (path8, stat) => !((opt.mtimeCache?.get(path8) ?? stat.mtime ?? 0) > (stat.mtime ?? 0));
236358
237067
  };
236359
- // src/core/project/api.ts
236360
- async function createProject(projectName, description) {
236361
- let response;
236362
- try {
236363
- response = await base44Client.post("api/apps", {
236364
- json: {
236365
- name: projectName,
236366
- user_description: description ?? `Backend for '${projectName}'`,
236367
- is_managed_source_code: false,
236368
- public_settings: "public_without_login"
236369
- }
236370
- });
236371
- } catch (error48) {
236372
- throw await ApiError.fromHttpError(error48, "creating project");
236373
- }
236374
- const result = CreateProjectResponseSchema.safeParse(await response.json());
236375
- if (!result.success) {
236376
- throw new SchemaValidationError("Invalid response from server", result.error);
236377
- }
236378
- return {
236379
- projectId: result.data.id
236380
- };
236381
- }
236382
- async function listProjects() {
236383
- let response;
236384
- try {
236385
- response = await base44Client.get("api/apps", {
236386
- searchParams: {
236387
- sort: "-updated_date",
236388
- fields: "id,name,user_description,is_managed_source_code",
236389
- limit: 50
236390
- }
236391
- });
236392
- } catch (error48) {
236393
- throw await ApiError.fromHttpError(error48, "listing projects");
236394
- }
236395
- const result = ProjectsResponseSchema.safeParse(await response.json());
236396
- if (!result.success) {
236397
- throw new SchemaValidationError("Invalid response from server", result.error);
236398
- }
236399
- return result.data;
236400
- }
236401
- async function downloadProject(projectId, projectPath) {
236402
- let response;
236403
- try {
236404
- response = await base44Client.get(`api/apps/${projectId}/eject`, {
236405
- timeout: false
236406
- });
236407
- } catch (error48) {
236408
- throw await ApiError.fromHttpError(error48, "downloading project");
236409
- }
236410
- const nodeStream = Readable.fromWeb(response.body);
236411
- await makeDirectory(projectPath);
236412
- await pipeline(nodeStream, extract({ cwd: projectPath }));
236413
- }
236414
237068
  // ../../node_modules/globby/index.js
236415
- import process4 from "node:process";
237069
+ import process5 from "node:process";
236416
237070
  import fs13 from "node:fs";
236417
237071
  import nodePath from "node:path";
236418
- import { Readable as Readable2 } from "node:stream";
237072
+ import { Readable } from "node:stream";
236419
237073
 
236420
237074
  // ../../node_modules/@sindresorhus/merge-streams/index.js
236421
237075
  import { on, once } from "node:events";
@@ -236650,7 +237304,7 @@ var TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
236650
237304
  // ../../node_modules/globby/ignore.js
236651
237305
  var import_fast_glob = __toESM(require_out4(), 1);
236652
237306
  var import_ignore = __toESM(require_ignore(), 1);
236653
- import process3 from "node:process";
237307
+ import process4 from "node:process";
236654
237308
  import fs12 from "node:fs";
236655
237309
  import fsPromises from "node:fs/promises";
236656
237310
  import path10 from "node:path";
@@ -236984,7 +237638,7 @@ var createIgnorePredicate = (patterns, cwd, baseDir) => {
236984
237638
  };
236985
237639
  var normalizeOptions = (options = {}) => {
236986
237640
  const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
236987
- const cwd = toPath(options.cwd) ?? process3.cwd();
237641
+ const cwd = toPath(options.cwd) ?? process4.cwd();
236988
237642
  const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
236989
237643
  return {
236990
237644
  cwd,
@@ -237068,7 +237722,7 @@ var getDirectoryGlob = ({ directoryPath, files, extensions }) => {
237068
237722
  return files ? files.map((file2) => nodePath.posix.join(directoryPath, `**/${nodePath.extname(file2) ? file2 : `${file2}${extensionGlob}`}`)) : [nodePath.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
237069
237723
  };
237070
237724
  var directoryToGlob = async (directoryPaths, {
237071
- cwd = process4.cwd(),
237725
+ cwd = process5.cwd(),
237072
237726
  files,
237073
237727
  extensions,
237074
237728
  fs: fsImplementation
@@ -237084,7 +237738,7 @@ var directoryToGlob = async (directoryPaths, {
237084
237738
  return globs.flat();
237085
237739
  };
237086
237740
  var directoryToGlobSync = (directoryPaths, {
237087
- cwd = process4.cwd(),
237741
+ cwd = process5.cwd(),
237088
237742
  files,
237089
237743
  extensions,
237090
237744
  fs: fsImplementation
@@ -237178,7 +237832,7 @@ var applyIgnoreFilesAndGetFilterSync = (options) => {
237178
237832
  };
237179
237833
  var createFilterFunction = (isIgnored, cwd) => {
237180
237834
  const seen = new Set;
237181
- const basePath = cwd || process4.cwd();
237835
+ const basePath = cwd || process5.cwd();
237182
237836
  const pathCache = new Map;
237183
237837
  return (fastGlobResult) => {
237184
237838
  const pathKey = nodePath.normalize(fastGlobResult.path ?? fastGlobResult);
@@ -237307,7 +237961,7 @@ var globbyStream = normalizeArgumentsSync((patterns, options) => {
237307
237961
  const tasks = generateTasksSync(patterns, modifiedOptions);
237308
237962
  const streams = tasks.map((task) => import_fast_glob2.default.stream(task.patterns, task.options));
237309
237963
  if (streams.length === 0) {
237310
- return Readable2.from([]);
237964
+ return Readable.from([]);
237311
237965
  }
237312
237966
  const stream = mergeStreams(streams).filter((fastGlobResult) => filter(fastGlobResult));
237313
237967
  return stream;
@@ -238698,6 +239352,94 @@ async function readAppConfig(projectRoot) {
238698
239352
  }
238699
239353
  return result.data;
238700
239354
  }
239355
+
239356
+ // src/core/site/schema.ts
239357
+ var DeployResponseSchema = exports_external.object({
239358
+ app_url: exports_external.url()
239359
+ }).transform((data) => ({
239360
+ appUrl: data.app_url
239361
+ }));
239362
+ var PublishedUrlResponseSchema = exports_external.object({
239363
+ url: exports_external.string()
239364
+ });
239365
+
239366
+ // src/core/project/api.ts
239367
+ async function createProject(projectName, description) {
239368
+ let response;
239369
+ try {
239370
+ response = await base44Client.post("api/apps", {
239371
+ json: {
239372
+ name: projectName,
239373
+ user_description: description ?? `Backend for '${projectName}'`,
239374
+ is_managed_source_code: false,
239375
+ public_settings: "public_without_login"
239376
+ }
239377
+ });
239378
+ } catch (error48) {
239379
+ throw await ApiError.fromHttpError(error48, "creating project");
239380
+ }
239381
+ const result = CreateProjectResponseSchema.safeParse(await response.json());
239382
+ if (!result.success) {
239383
+ throw new SchemaValidationError("Invalid response from server", result.error);
239384
+ }
239385
+ return {
239386
+ projectId: result.data.id
239387
+ };
239388
+ }
239389
+ async function listProjects() {
239390
+ let response;
239391
+ try {
239392
+ response = await base44Client.get("api/apps", {
239393
+ searchParams: {
239394
+ sort: "-updated_date",
239395
+ fields: "id,name,user_description,is_managed_source_code",
239396
+ limit: 50
239397
+ }
239398
+ });
239399
+ } catch (error48) {
239400
+ throw await ApiError.fromHttpError(error48, "listing projects");
239401
+ }
239402
+ const result = ProjectsResponseSchema.safeParse(await response.json());
239403
+ if (!result.success) {
239404
+ throw new SchemaValidationError("Invalid response from server", result.error);
239405
+ }
239406
+ return result.data;
239407
+ }
239408
+ async function downloadProject(projectId, projectPath) {
239409
+ let response;
239410
+ try {
239411
+ response = await base44Client.get(`api/apps/${projectId}/eject`, {
239412
+ timeout: false
239413
+ });
239414
+ } catch (error48) {
239415
+ throw await ApiError.fromHttpError(error48, "downloading project");
239416
+ }
239417
+ const nodeStream = Readable2.fromWeb(response.body);
239418
+ await makeDirectory(projectPath);
239419
+ await pipeline(nodeStream, extract({ cwd: projectPath }));
239420
+ }
239421
+ async function getAppUserToken() {
239422
+ try {
239423
+ const response = await getAppClient().get("auth/token").json();
239424
+ return response.token;
239425
+ } catch (error48) {
239426
+ throw await ApiError.fromHttpError(error48, "exchanging platform token for app user token");
239427
+ }
239428
+ }
239429
+ async function getSiteUrl(projectId) {
239430
+ const id = projectId ?? getAppConfig().id;
239431
+ let response;
239432
+ try {
239433
+ response = await base44Client.get(`api/apps/platform/${id}/published-url`);
239434
+ } catch (error48) {
239435
+ throw await ApiError.fromHttpError(error48, "fetching site URL");
239436
+ }
239437
+ const result = PublishedUrlResponseSchema.safeParse(await response.json());
239438
+ if (!result.success) {
239439
+ throw new SchemaValidationError("Invalid response from server", result.error);
239440
+ }
239441
+ return result.data.url;
239442
+ }
238701
239443
  // src/core/project/template.ts
238702
239444
  var import_ejs = __toESM(require_ejs(), 1);
238703
239445
  var import_front_matter = __toESM(require_front_matter(), 1);
@@ -238710,7 +239452,7 @@ import { join as join8 } from "node:path";
238710
239452
  // package.json
238711
239453
  var package_default = {
238712
239454
  name: "base44",
238713
- version: "0.0.45",
239455
+ version: "0.0.47",
238714
239456
  description: "Base44 CLI - Unified interface for managing Base44 applications",
238715
239457
  type: "module",
238716
239458
  bin: {
@@ -238807,7 +239549,10 @@ function getTemplatesIndexPath() {
238807
239549
  return join8(ASSETS_DIR, "templates", "templates.json");
238808
239550
  }
238809
239551
  function getDenoWrapperPath() {
238810
- return join8(ASSETS_DIR, "deno-runtime", "main.js");
239552
+ return join8(ASSETS_DIR, "deno-runtime", "main.ts");
239553
+ }
239554
+ function getExecWrapperPath() {
239555
+ return join8(ASSETS_DIR, "deno-runtime", "exec.ts");
238811
239556
  }
238812
239557
  function ensureNpmAssets(sourceDir) {
238813
239558
  if (existsSync(ASSETS_DIR))
@@ -238886,16 +239631,6 @@ async function createProjectFilesForExistingProject(options) {
238886
239631
  // src/core/project/deploy.ts
238887
239632
  import { resolve } from "node:path";
238888
239633
 
238889
- // src/core/site/schema.ts
238890
- var DeployResponseSchema = exports_external.object({
238891
- app_url: exports_external.url()
238892
- }).transform((data) => ({
238893
- appUrl: data.app_url
238894
- }));
238895
- var PublishedUrlResponseSchema = exports_external.object({
238896
- url: exports_external.string()
238897
- });
238898
-
238899
239634
  // src/core/site/api.ts
238900
239635
  async function uploadSite(archivePath) {
238901
239636
  const archiveBuffer = await readFile(archivePath);
@@ -238918,20 +239653,6 @@ async function uploadSite(archivePath) {
238918
239653
  }
238919
239654
  return result.data;
238920
239655
  }
238921
- async function getSiteUrl(projectId) {
238922
- const id = projectId ?? getAppConfig().id;
238923
- let response;
238924
- try {
238925
- response = await base44Client.get(`api/apps/platform/${id}/published-url`);
238926
- } catch (error48) {
238927
- throw await ApiError.fromHttpError(error48, "fetching site URL");
238928
- }
238929
- const result = PublishedUrlResponseSchema.safeParse(await response.json());
238930
- if (!result.success) {
238931
- throw new SchemaValidationError("Invalid response from server", result.error);
238932
- }
238933
- return result.data.url;
238934
- }
238935
239656
  // src/core/site/config.ts
238936
239657
  async function getSiteFilePaths(outputDir) {
238937
239658
  return await globby("**/*", {
@@ -239178,799 +239899,6 @@ async function getUserInfo(accessToken) {
239178
239899
  }
239179
239900
  return result.data;
239180
239901
  }
239181
- // src/core/resources/secret/schema.ts
239182
- var ListSecretsResponseSchema = exports_external.record(exports_external.string(), exports_external.string());
239183
- var SetSecretsResponseSchema = exports_external.object({
239184
- success: exports_external.boolean()
239185
- });
239186
- var DeleteSecretResponseSchema = exports_external.object({
239187
- success: exports_external.boolean()
239188
- });
239189
-
239190
- // src/core/resources/secret/api.ts
239191
- async function listSecrets() {
239192
- const appClient = getAppClient();
239193
- let response;
239194
- try {
239195
- response = await appClient.get("secrets");
239196
- } catch (error48) {
239197
- throw await ApiError.fromHttpError(error48, "listing secrets");
239198
- }
239199
- const result = ListSecretsResponseSchema.safeParse(await response.json());
239200
- if (!result.success) {
239201
- throw new SchemaValidationError("Invalid response from server", result.error);
239202
- }
239203
- return result.data;
239204
- }
239205
- async function setSecrets(secrets) {
239206
- const appClient = getAppClient();
239207
- let response;
239208
- try {
239209
- response = await appClient.post("secrets", {
239210
- json: secrets,
239211
- timeout: false
239212
- });
239213
- } catch (error48) {
239214
- throw await ApiError.fromHttpError(error48, "setting secrets");
239215
- }
239216
- const result = SetSecretsResponseSchema.safeParse(await response.json());
239217
- if (!result.success) {
239218
- throw new SchemaValidationError("Invalid response from server", result.error);
239219
- }
239220
- return result.data;
239221
- }
239222
- async function deleteSecret(name2) {
239223
- const appClient = getAppClient();
239224
- let response;
239225
- try {
239226
- response = await appClient.delete("secrets", {
239227
- searchParams: { secret_name: name2 },
239228
- timeout: false
239229
- });
239230
- } catch (error48) {
239231
- throw await ApiError.fromHttpError(error48, "deleting secret");
239232
- }
239233
- const result = DeleteSecretResponseSchema.safeParse(await response.json());
239234
- if (!result.success) {
239235
- throw new SchemaValidationError("Invalid response from server", result.error);
239236
- }
239237
- return result.data;
239238
- }
239239
- // src/core/utils/env.ts
239240
- var import_dotenv = __toESM(require_main(), 1);
239241
- async function parseEnvFile(filePath) {
239242
- const content = await readTextFile(filePath);
239243
- return import_dotenv.parse(content);
239244
- }
239245
- // ../../node_modules/chalk/source/vendor/ansi-styles/index.js
239246
- var ANSI_BACKGROUND_OFFSET = 10;
239247
- var wrapAnsi16 = (offset = 0) => (code2) => `\x1B[${code2 + offset}m`;
239248
- var wrapAnsi256 = (offset = 0) => (code2) => `\x1B[${38 + offset};5;${code2}m`;
239249
- var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
239250
- var styles = {
239251
- modifier: {
239252
- reset: [0, 0],
239253
- bold: [1, 22],
239254
- dim: [2, 22],
239255
- italic: [3, 23],
239256
- underline: [4, 24],
239257
- overline: [53, 55],
239258
- inverse: [7, 27],
239259
- hidden: [8, 28],
239260
- strikethrough: [9, 29]
239261
- },
239262
- color: {
239263
- black: [30, 39],
239264
- red: [31, 39],
239265
- green: [32, 39],
239266
- yellow: [33, 39],
239267
- blue: [34, 39],
239268
- magenta: [35, 39],
239269
- cyan: [36, 39],
239270
- white: [37, 39],
239271
- blackBright: [90, 39],
239272
- gray: [90, 39],
239273
- grey: [90, 39],
239274
- redBright: [91, 39],
239275
- greenBright: [92, 39],
239276
- yellowBright: [93, 39],
239277
- blueBright: [94, 39],
239278
- magentaBright: [95, 39],
239279
- cyanBright: [96, 39],
239280
- whiteBright: [97, 39]
239281
- },
239282
- bgColor: {
239283
- bgBlack: [40, 49],
239284
- bgRed: [41, 49],
239285
- bgGreen: [42, 49],
239286
- bgYellow: [43, 49],
239287
- bgBlue: [44, 49],
239288
- bgMagenta: [45, 49],
239289
- bgCyan: [46, 49],
239290
- bgWhite: [47, 49],
239291
- bgBlackBright: [100, 49],
239292
- bgGray: [100, 49],
239293
- bgGrey: [100, 49],
239294
- bgRedBright: [101, 49],
239295
- bgGreenBright: [102, 49],
239296
- bgYellowBright: [103, 49],
239297
- bgBlueBright: [104, 49],
239298
- bgMagentaBright: [105, 49],
239299
- bgCyanBright: [106, 49],
239300
- bgWhiteBright: [107, 49]
239301
- }
239302
- };
239303
- var modifierNames = Object.keys(styles.modifier);
239304
- var foregroundColorNames = Object.keys(styles.color);
239305
- var backgroundColorNames = Object.keys(styles.bgColor);
239306
- var colorNames = [...foregroundColorNames, ...backgroundColorNames];
239307
- function assembleStyles() {
239308
- const codes = new Map;
239309
- for (const [groupName, group] of Object.entries(styles)) {
239310
- for (const [styleName, style] of Object.entries(group)) {
239311
- styles[styleName] = {
239312
- open: `\x1B[${style[0]}m`,
239313
- close: `\x1B[${style[1]}m`
239314
- };
239315
- group[styleName] = styles[styleName];
239316
- codes.set(style[0], style[1]);
239317
- }
239318
- Object.defineProperty(styles, groupName, {
239319
- value: group,
239320
- enumerable: false
239321
- });
239322
- }
239323
- Object.defineProperty(styles, "codes", {
239324
- value: codes,
239325
- enumerable: false
239326
- });
239327
- styles.color.close = "\x1B[39m";
239328
- styles.bgColor.close = "\x1B[49m";
239329
- styles.color.ansi = wrapAnsi16();
239330
- styles.color.ansi256 = wrapAnsi256();
239331
- styles.color.ansi16m = wrapAnsi16m();
239332
- styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
239333
- styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
239334
- styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
239335
- Object.defineProperties(styles, {
239336
- rgbToAnsi256: {
239337
- value(red, green, blue) {
239338
- if (red === green && green === blue) {
239339
- if (red < 8) {
239340
- return 16;
239341
- }
239342
- if (red > 248) {
239343
- return 231;
239344
- }
239345
- return Math.round((red - 8) / 247 * 24) + 232;
239346
- }
239347
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
239348
- },
239349
- enumerable: false
239350
- },
239351
- hexToRgb: {
239352
- value(hex3) {
239353
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex3.toString(16));
239354
- if (!matches) {
239355
- return [0, 0, 0];
239356
- }
239357
- let [colorString] = matches;
239358
- if (colorString.length === 3) {
239359
- colorString = [...colorString].map((character) => character + character).join("");
239360
- }
239361
- const integer2 = Number.parseInt(colorString, 16);
239362
- return [
239363
- integer2 >> 16 & 255,
239364
- integer2 >> 8 & 255,
239365
- integer2 & 255
239366
- ];
239367
- },
239368
- enumerable: false
239369
- },
239370
- hexToAnsi256: {
239371
- value: (hex3) => styles.rgbToAnsi256(...styles.hexToRgb(hex3)),
239372
- enumerable: false
239373
- },
239374
- ansi256ToAnsi: {
239375
- value(code2) {
239376
- if (code2 < 8) {
239377
- return 30 + code2;
239378
- }
239379
- if (code2 < 16) {
239380
- return 90 + (code2 - 8);
239381
- }
239382
- let red;
239383
- let green;
239384
- let blue;
239385
- if (code2 >= 232) {
239386
- red = ((code2 - 232) * 10 + 8) / 255;
239387
- green = red;
239388
- blue = red;
239389
- } else {
239390
- code2 -= 16;
239391
- const remainder = code2 % 36;
239392
- red = Math.floor(code2 / 36) / 5;
239393
- green = Math.floor(remainder / 6) / 5;
239394
- blue = remainder % 6 / 5;
239395
- }
239396
- const value = Math.max(red, green, blue) * 2;
239397
- if (value === 0) {
239398
- return 30;
239399
- }
239400
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
239401
- if (value === 2) {
239402
- result += 60;
239403
- }
239404
- return result;
239405
- },
239406
- enumerable: false
239407
- },
239408
- rgbToAnsi: {
239409
- value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
239410
- enumerable: false
239411
- },
239412
- hexToAnsi: {
239413
- value: (hex3) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex3)),
239414
- enumerable: false
239415
- }
239416
- });
239417
- return styles;
239418
- }
239419
- var ansiStyles = assembleStyles();
239420
- var ansi_styles_default = ansiStyles;
239421
-
239422
- // ../../node_modules/chalk/source/vendor/supports-color/index.js
239423
- import process5 from "node:process";
239424
- import os from "node:os";
239425
- import tty from "node:tty";
239426
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process5.argv) {
239427
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
239428
- const position = argv.indexOf(prefix + flag);
239429
- const terminatorPosition = argv.indexOf("--");
239430
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
239431
- }
239432
- var { env: env2 } = process5;
239433
- var flagForceColor;
239434
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
239435
- flagForceColor = 0;
239436
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
239437
- flagForceColor = 1;
239438
- }
239439
- function envForceColor() {
239440
- if ("FORCE_COLOR" in env2) {
239441
- if (env2.FORCE_COLOR === "true") {
239442
- return 1;
239443
- }
239444
- if (env2.FORCE_COLOR === "false") {
239445
- return 0;
239446
- }
239447
- return env2.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env2.FORCE_COLOR, 10), 3);
239448
- }
239449
- }
239450
- function translateLevel(level) {
239451
- if (level === 0) {
239452
- return false;
239453
- }
239454
- return {
239455
- level,
239456
- hasBasic: true,
239457
- has256: level >= 2,
239458
- has16m: level >= 3
239459
- };
239460
- }
239461
- function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
239462
- const noFlagForceColor = envForceColor();
239463
- if (noFlagForceColor !== undefined) {
239464
- flagForceColor = noFlagForceColor;
239465
- }
239466
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
239467
- if (forceColor === 0) {
239468
- return 0;
239469
- }
239470
- if (sniffFlags) {
239471
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
239472
- return 3;
239473
- }
239474
- if (hasFlag("color=256")) {
239475
- return 2;
239476
- }
239477
- }
239478
- if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) {
239479
- return 1;
239480
- }
239481
- if (haveStream && !streamIsTTY && forceColor === undefined) {
239482
- return 0;
239483
- }
239484
- const min = forceColor || 0;
239485
- if (env2.TERM === "dumb") {
239486
- return min;
239487
- }
239488
- if (process5.platform === "win32") {
239489
- const osRelease = os.release().split(".");
239490
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
239491
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
239492
- }
239493
- return 1;
239494
- }
239495
- if ("CI" in env2) {
239496
- if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env2))) {
239497
- return 3;
239498
- }
239499
- if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env2)) || env2.CI_NAME === "codeship") {
239500
- return 1;
239501
- }
239502
- return min;
239503
- }
239504
- if ("TEAMCITY_VERSION" in env2) {
239505
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
239506
- }
239507
- if (env2.COLORTERM === "truecolor") {
239508
- return 3;
239509
- }
239510
- if (env2.TERM === "xterm-kitty") {
239511
- return 3;
239512
- }
239513
- if (env2.TERM === "xterm-ghostty") {
239514
- return 3;
239515
- }
239516
- if (env2.TERM === "wezterm") {
239517
- return 3;
239518
- }
239519
- if ("TERM_PROGRAM" in env2) {
239520
- const version2 = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
239521
- switch (env2.TERM_PROGRAM) {
239522
- case "iTerm.app": {
239523
- return version2 >= 3 ? 3 : 2;
239524
- }
239525
- case "Apple_Terminal": {
239526
- return 2;
239527
- }
239528
- }
239529
- }
239530
- if (/-256(color)?$/i.test(env2.TERM)) {
239531
- return 2;
239532
- }
239533
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
239534
- return 1;
239535
- }
239536
- if ("COLORTERM" in env2) {
239537
- return 1;
239538
- }
239539
- return min;
239540
- }
239541
- function createSupportsColor(stream, options = {}) {
239542
- const level = _supportsColor(stream, {
239543
- streamIsTTY: stream && stream.isTTY,
239544
- ...options
239545
- });
239546
- return translateLevel(level);
239547
- }
239548
- var supportsColor = {
239549
- stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
239550
- stderr: createSupportsColor({ isTTY: tty.isatty(2) })
239551
- };
239552
- var supports_color_default = supportsColor;
239553
-
239554
- // ../../node_modules/chalk/source/utilities.js
239555
- function stringReplaceAll(string4, substring, replacer) {
239556
- let index = string4.indexOf(substring);
239557
- if (index === -1) {
239558
- return string4;
239559
- }
239560
- const substringLength = substring.length;
239561
- let endIndex = 0;
239562
- let returnValue = "";
239563
- do {
239564
- returnValue += string4.slice(endIndex, index) + substring + replacer;
239565
- endIndex = index + substringLength;
239566
- index = string4.indexOf(substring, endIndex);
239567
- } while (index !== -1);
239568
- returnValue += string4.slice(endIndex);
239569
- return returnValue;
239570
- }
239571
- function stringEncaseCRLFWithFirstIndex(string4, prefix, postfix, index) {
239572
- let endIndex = 0;
239573
- let returnValue = "";
239574
- do {
239575
- const gotCR = string4[index - 1] === "\r";
239576
- returnValue += string4.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
239577
- ` : `
239578
- `) + postfix;
239579
- endIndex = index + 1;
239580
- index = string4.indexOf(`
239581
- `, endIndex);
239582
- } while (index !== -1);
239583
- returnValue += string4.slice(endIndex);
239584
- return returnValue;
239585
- }
239586
-
239587
- // ../../node_modules/chalk/source/index.js
239588
- var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
239589
- var GENERATOR = Symbol("GENERATOR");
239590
- var STYLER = Symbol("STYLER");
239591
- var IS_EMPTY = Symbol("IS_EMPTY");
239592
- var levelMapping = [
239593
- "ansi",
239594
- "ansi",
239595
- "ansi256",
239596
- "ansi16m"
239597
- ];
239598
- var styles2 = Object.create(null);
239599
- var applyOptions = (object2, options = {}) => {
239600
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
239601
- throw new Error("The `level` option should be an integer from 0 to 3");
239602
- }
239603
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
239604
- object2.level = options.level === undefined ? colorLevel : options.level;
239605
- };
239606
- var chalkFactory = (options) => {
239607
- const chalk = (...strings) => strings.join(" ");
239608
- applyOptions(chalk, options);
239609
- Object.setPrototypeOf(chalk, createChalk.prototype);
239610
- return chalk;
239611
- };
239612
- function createChalk(options) {
239613
- return chalkFactory(options);
239614
- }
239615
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
239616
- for (const [styleName, style] of Object.entries(ansi_styles_default)) {
239617
- styles2[styleName] = {
239618
- get() {
239619
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
239620
- Object.defineProperty(this, styleName, { value: builder });
239621
- return builder;
239622
- }
239623
- };
239624
- }
239625
- styles2.visible = {
239626
- get() {
239627
- const builder = createBuilder(this, this[STYLER], true);
239628
- Object.defineProperty(this, "visible", { value: builder });
239629
- return builder;
239630
- }
239631
- };
239632
- var getModelAnsi = (model, level, type, ...arguments_) => {
239633
- if (model === "rgb") {
239634
- if (level === "ansi16m") {
239635
- return ansi_styles_default[type].ansi16m(...arguments_);
239636
- }
239637
- if (level === "ansi256") {
239638
- return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
239639
- }
239640
- return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
239641
- }
239642
- if (model === "hex") {
239643
- return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
239644
- }
239645
- return ansi_styles_default[type][model](...arguments_);
239646
- };
239647
- var usedModels = ["rgb", "hex", "ansi256"];
239648
- for (const model of usedModels) {
239649
- styles2[model] = {
239650
- get() {
239651
- const { level } = this;
239652
- return function(...arguments_) {
239653
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
239654
- return createBuilder(this, styler, this[IS_EMPTY]);
239655
- };
239656
- }
239657
- };
239658
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
239659
- styles2[bgModel] = {
239660
- get() {
239661
- const { level } = this;
239662
- return function(...arguments_) {
239663
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
239664
- return createBuilder(this, styler, this[IS_EMPTY]);
239665
- };
239666
- }
239667
- };
239668
- }
239669
- var proto = Object.defineProperties(() => {}, {
239670
- ...styles2,
239671
- level: {
239672
- enumerable: true,
239673
- get() {
239674
- return this[GENERATOR].level;
239675
- },
239676
- set(level) {
239677
- this[GENERATOR].level = level;
239678
- }
239679
- }
239680
- });
239681
- var createStyler = (open, close, parent) => {
239682
- let openAll;
239683
- let closeAll;
239684
- if (parent === undefined) {
239685
- openAll = open;
239686
- closeAll = close;
239687
- } else {
239688
- openAll = parent.openAll + open;
239689
- closeAll = close + parent.closeAll;
239690
- }
239691
- return {
239692
- open,
239693
- close,
239694
- openAll,
239695
- closeAll,
239696
- parent
239697
- };
239698
- };
239699
- var createBuilder = (self2, _styler, _isEmpty) => {
239700
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
239701
- Object.setPrototypeOf(builder, proto);
239702
- builder[GENERATOR] = self2;
239703
- builder[STYLER] = _styler;
239704
- builder[IS_EMPTY] = _isEmpty;
239705
- return builder;
239706
- };
239707
- var applyStyle = (self2, string4) => {
239708
- if (self2.level <= 0 || !string4) {
239709
- return self2[IS_EMPTY] ? "" : string4;
239710
- }
239711
- let styler = self2[STYLER];
239712
- if (styler === undefined) {
239713
- return string4;
239714
- }
239715
- const { openAll, closeAll } = styler;
239716
- if (string4.includes("\x1B")) {
239717
- while (styler !== undefined) {
239718
- string4 = stringReplaceAll(string4, styler.close, styler.open);
239719
- styler = styler.parent;
239720
- }
239721
- }
239722
- const lfIndex = string4.indexOf(`
239723
- `);
239724
- if (lfIndex !== -1) {
239725
- string4 = stringEncaseCRLFWithFirstIndex(string4, closeAll, openAll, lfIndex);
239726
- }
239727
- return openAll + string4 + closeAll;
239728
- };
239729
- Object.defineProperties(createChalk.prototype, styles2);
239730
- var chalk = createChalk();
239731
- var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
239732
- var source_default = chalk;
239733
-
239734
- // src/cli/utils/theme.ts
239735
- var theme = {
239736
- colors: {
239737
- base44Orange: source_default.hex("#E86B3C"),
239738
- base44OrangeBackground: source_default.bgHex("#E86B3C"),
239739
- shinyOrange: source_default.hex("#FFD700"),
239740
- links: source_default.hex("#00D4FF"),
239741
- white: source_default.white
239742
- },
239743
- styles: {
239744
- header: source_default.dim,
239745
- bold: source_default.bold,
239746
- dim: source_default.dim,
239747
- error: source_default.red,
239748
- warn: source_default.yellow
239749
- },
239750
- format: {
239751
- errorContext(ctx) {
239752
- const parts = [
239753
- ctx.sessionId ? `Session: ${ctx.sessionId}` : null,
239754
- ctx.appId ? `App: ${ctx.appId}` : null,
239755
- new Date().toISOString()
239756
- ].filter(Boolean);
239757
- return source_default.dim(parts.join(" | "));
239758
- },
239759
- details(lines) {
239760
- return lines.map((line) => ` • ${line}`).join(`
239761
- `);
239762
- },
239763
- agentHints(hints) {
239764
- if (hints.length === 0) {
239765
- return null;
239766
- }
239767
- const hintLines = hints.map((hint) => {
239768
- if (hint.command) {
239769
- return ` Run: ${hint.command}`;
239770
- }
239771
- return ` ${hint.message}`;
239772
- });
239773
- return ["[Agent Hints]", ...hintLines].join(`
239774
- `);
239775
- }
239776
- }
239777
- };
239778
-
239779
- // src/cli/utils/animate.ts
239780
- function sleep(ms) {
239781
- return new Promise((resolve2) => setTimeout(resolve2, ms));
239782
- }
239783
- async function animateLineReveal(line, duration3) {
239784
- const steps = 8;
239785
- const stepDuration = duration3 / steps;
239786
- for (let step = 0;step <= steps; step++) {
239787
- const progress = step / steps;
239788
- const revealIndex = Math.floor(progress * line.length);
239789
- let output = "";
239790
- for (let i = 0;i < line.length; i++) {
239791
- if (i < revealIndex) {
239792
- output += theme.colors.base44Orange(line[i]);
239793
- } else if (i === revealIndex) {
239794
- output += theme.colors.shinyOrange(line[i]);
239795
- } else {
239796
- output += theme.styles.dim(line[i]);
239797
- }
239798
- }
239799
- process.stdout.write(`\r${output}`);
239800
- await sleep(stepDuration);
239801
- }
239802
- process.stdout.write(`\r${theme.colors.base44Orange(line)}
239803
- `);
239804
- }
239805
- async function shimmerPass(lines, duration3) {
239806
- const moveUp = `\x1B[${lines.length}A`;
239807
- const steps = 12;
239808
- const stepDuration = duration3 / steps;
239809
- const maxWidth = Math.max(...lines.map((l) => l.length));
239810
- for (let step = 0;step <= steps; step++) {
239811
- const shimmerPos = Math.floor(step / steps * (maxWidth + 6));
239812
- process.stdout.write(moveUp);
239813
- for (const line of lines) {
239814
- let output = "";
239815
- for (let i = 0;i < line.length; i++) {
239816
- const dist = Math.abs(i - shimmerPos);
239817
- if (dist < 3) {
239818
- output += dist === 0 ? theme.colors.white(line[i]) : theme.colors.shinyOrange(line[i]);
239819
- } else {
239820
- output += theme.colors.base44Orange(line[i]);
239821
- }
239822
- }
239823
- console.log(output);
239824
- }
239825
- await sleep(stepDuration);
239826
- }
239827
- process.stdout.write(moveUp);
239828
- for (const line of lines) {
239829
- console.log(theme.colors.base44Orange(line));
239830
- }
239831
- }
239832
- async function printAnimatedLines(lines) {
239833
- const totalDuration = 1000;
239834
- const lineDelay = totalDuration / lines.length;
239835
- for (let i = 0;i < lines.length; i++) {
239836
- const line = lines[i];
239837
- await animateLineReveal(line, 100);
239838
- if (i < lines.length - 1) {
239839
- await sleep(lineDelay - 100);
239840
- }
239841
- }
239842
- await shimmerPass(lines, 200);
239843
- }
239844
-
239845
- // src/cli/utils/banner.ts
239846
- var BANNER_LINES = [
239847
- "██████╗ █████╗ ███████╗███████╗ ██╗ ██╗██╗ ██╗",
239848
- "██╔══██╗██╔══██╗██╔════╝██╔════╝ ██║ ██║██║ ██║",
239849
- "██████╔╝███████║███████╗█████╗ ███████║███████║",
239850
- "██╔══██╗██╔══██║╚════██║██╔══╝ ╚════██║╚════██║",
239851
- "██████╔╝██║ ██║███████║███████╗ ██║ ██║",
239852
- "╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝"
239853
- ];
239854
- async function printBanner(isNonInteractive) {
239855
- if (isNonInteractive) {
239856
- console.log(theme.colors.base44Orange(BANNER_LINES.join(`
239857
- `)));
239858
- } else {
239859
- await printAnimatedLines(BANNER_LINES);
239860
- }
239861
- }
239862
- // src/cli/errors.ts
239863
- class CLIExitError extends Error {
239864
- code;
239865
- constructor(code2) {
239866
- super(`CLI exited with code ${code2}`);
239867
- this.code = code2;
239868
- this.name = "CLIExitError";
239869
- }
239870
- }
239871
-
239872
- // src/cli/utils/prompts.ts
239873
- var onPromptCancel = () => {
239874
- Ne("Operation cancelled.");
239875
- throw new CLIExitError(0);
239876
- };
239877
- // ../../node_modules/p-wait-for/index.js
239878
- var resolveValue = Symbol("resolveValue");
239879
- var sleep2 = (ms, signal) => new Promise((resolve2, reject) => {
239880
- if (signal?.aborted) {
239881
- reject(signal.reason);
239882
- return;
239883
- }
239884
- const timeout2 = setTimeout(resolve2, ms);
239885
- if (signal) {
239886
- signal.addEventListener("abort", () => {
239887
- clearTimeout(timeout2);
239888
- reject(signal.reason);
239889
- }, { once: true });
239890
- }
239891
- });
239892
- var validateOptions = (interval, timeout2) => {
239893
- if (typeof interval !== "number" || !Number.isFinite(interval) || interval < 0) {
239894
- throw new TypeError("Expected interval to be a finite non-negative number");
239895
- }
239896
- if (typeof timeout2 === "object" && timeout2 !== null) {
239897
- if (typeof timeout2.milliseconds !== "number" || Number.isNaN(timeout2.milliseconds) || timeout2.milliseconds < 0) {
239898
- throw new TypeError("Expected timeout.milliseconds to be a finite non-negative number");
239899
- }
239900
- } else if (typeof timeout2 === "number" && (Number.isNaN(timeout2) || timeout2 < 0)) {
239901
- throw new TypeError("Expected timeout to be a finite non-negative number");
239902
- }
239903
- };
239904
- var createTimeoutError = (timeout2) => {
239905
- if (timeout2.message instanceof Error) {
239906
- return timeout2.message;
239907
- }
239908
- const message = timeout2.message ?? `Promise timed out after ${timeout2.milliseconds} milliseconds`;
239909
- return new TimeoutError2(message);
239910
- };
239911
- var handleFallback = (timeout2) => {
239912
- if (timeout2.fallback) {
239913
- return timeout2.fallback();
239914
- }
239915
- throw createTimeoutError(timeout2);
239916
- };
239917
- var handleAbortError = (timeoutSignal, timeout2, signal) => {
239918
- if (timeoutSignal?.aborted) {
239919
- if (typeof timeout2 === "object") {
239920
- return handleFallback(timeout2);
239921
- }
239922
- throw new TimeoutError2;
239923
- }
239924
- throw signal.reason;
239925
- };
239926
- async function pWaitFor(condition, options = {}) {
239927
- const {
239928
- interval = 20,
239929
- timeout: timeout2 = Number.POSITIVE_INFINITY,
239930
- before = true,
239931
- signal
239932
- } = options;
239933
- validateOptions(interval, timeout2);
239934
- const timeoutMs = typeof timeout2 === "number" ? timeout2 : timeout2?.milliseconds ?? Number.POSITIVE_INFINITY;
239935
- const timeoutSignal = timeoutMs === Number.POSITIVE_INFINITY ? undefined : AbortSignal.timeout(timeoutMs);
239936
- const combinedSignal = timeoutSignal && signal ? AbortSignal.any([timeoutSignal, signal]) : timeoutSignal ?? signal;
239937
- if (!before) {
239938
- await sleep2(interval, combinedSignal);
239939
- }
239940
- if (combinedSignal?.aborted) {
239941
- return handleAbortError(timeoutSignal, timeout2, signal);
239942
- }
239943
- while (true) {
239944
- try {
239945
- const value = await condition();
239946
- if (typeof value === "object" && value !== null && resolveValue in value) {
239947
- return value[resolveValue];
239948
- }
239949
- if (value === true) {
239950
- return;
239951
- }
239952
- if (value === false) {
239953
- await sleep2(interval, combinedSignal);
239954
- continue;
239955
- }
239956
- throw new TypeError("Expected condition to return a boolean");
239957
- } catch (error48) {
239958
- if (error48 === combinedSignal?.reason) {
239959
- return handleAbortError(timeoutSignal, timeout2, signal);
239960
- }
239961
- throw error48;
239962
- }
239963
- }
239964
- }
239965
- pWaitFor.resolveWith = (value) => ({ [resolveValue]: value });
239966
-
239967
- class TimeoutError2 extends Error {
239968
- constructor(message = "Promise timed out") {
239969
- super(message);
239970
- this.name = "TimeoutError";
239971
- }
239972
- }
239973
-
239974
239902
  // src/cli/commands/auth/login-flow.ts
239975
239903
  async function generateAndDisplayDeviceCode() {
239976
239904
  const deviceCodeResponse = await runTask("Generating device code...", async () => {
@@ -240033,6 +239961,25 @@ async function login() {
240033
239961
  };
240034
239962
  }
240035
239963
 
239964
+ // src/cli/utils/command/middleware.ts
239965
+ async function ensureAuth(errorReporter) {
239966
+ const loggedIn = await isLoggedIn();
239967
+ if (!loggedIn) {
239968
+ R2.info("You need to login first to continue.");
239969
+ await login();
239970
+ }
239971
+ try {
239972
+ const userInfo = await readAuth();
239973
+ errorReporter.setContext({
239974
+ user: { email: userInfo.email, name: userInfo.name }
239975
+ });
239976
+ } catch {}
239977
+ }
239978
+ async function ensureAppConfig(errorReporter) {
239979
+ const appConfig = await initAppConfig();
239980
+ errorReporter.setContext({ appId: appConfig.id });
239981
+ }
239982
+
240036
239983
  // ../../node_modules/is-plain-obj/index.js
240037
239984
  function isPlainObject2(value) {
240038
239985
  if (typeof value !== "object" || value === null) {
@@ -240376,12 +240323,12 @@ var NO_ESCAPE_REGEXP = /^[\w./-]+$/;
240376
240323
  // ../../node_modules/is-unicode-supported/index.js
240377
240324
  import process7 from "node:process";
240378
240325
  function isUnicodeSupported() {
240379
- const { env: env3 } = process7;
240380
- const { TERM, TERM_PROGRAM } = env3;
240326
+ const { env: env2 } = process7;
240327
+ const { TERM, TERM_PROGRAM } = env2;
240381
240328
  if (process7.platform !== "win32") {
240382
240329
  return TERM !== "linux";
240383
240330
  }
240384
- return Boolean(env3.WT_SESSION) || Boolean(env3.TERMINUS_SUBLIME) || env3.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env3.TERMINAL_EMULATOR === "JetBrains-JediTerm";
240331
+ return Boolean(env2.WT_SESSION) || Boolean(env2.TERMINUS_SUBLIME) || env2.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env2.TERMINAL_EMULATOR === "JetBrains-JediTerm";
240385
240332
  }
240386
240333
 
240387
240334
  // ../../node_modules/figures/index.js
@@ -240894,13 +240841,13 @@ import path12 from "node:path";
240894
240841
  // ../../node_modules/npm-run-path/node_modules/path-key/index.js
240895
240842
  function pathKey(options = {}) {
240896
240843
  const {
240897
- env: env3 = process.env,
240844
+ env: env2 = process.env,
240898
240845
  platform: platform6 = process.platform
240899
240846
  } = options;
240900
240847
  if (platform6 !== "win32") {
240901
240848
  return "PATH";
240902
240849
  }
240903
- return Object.keys(env3).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
240850
+ return Object.keys(env2).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
240904
240851
  }
240905
240852
 
240906
240853
  // ../../node_modules/npm-run-path/node_modules/unicorn-magic/node.js
@@ -240960,12 +240907,12 @@ var applyExecPath = (result, pathParts, execPath, cwdPath) => {
240960
240907
  result.push(pathPart);
240961
240908
  }
240962
240909
  };
240963
- var npmRunPathEnv = ({ env: env3 = process8.env, ...options } = {}) => {
240964
- env3 = { ...env3 };
240965
- const pathName = pathKey({ env: env3 });
240966
- options.path = env3[pathName];
240967
- env3[pathName] = npmRunPath(options);
240968
- return env3;
240910
+ var npmRunPathEnv = ({ env: env2 = process8.env, ...options } = {}) => {
240911
+ env2 = { ...env2 };
240912
+ const pathName = pathKey({ env: env2 });
240913
+ options.path = env2[pathName];
240914
+ env2[pathName] = npmRunPath(options);
240915
+ return env2;
240969
240916
  };
240970
240917
 
240971
240918
  // ../../node_modules/execa/lib/terminate/kill.js
@@ -242314,17 +242261,17 @@ var addDefaultOptions = ({
242314
242261
  serialization
242315
242262
  });
242316
242263
  var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath: nodePath2 }) => {
242317
- const env3 = extendEnv ? { ...process10.env, ...envOption } : envOption;
242264
+ const env2 = extendEnv ? { ...process10.env, ...envOption } : envOption;
242318
242265
  if (preferLocal || node) {
242319
242266
  return npmRunPathEnv({
242320
- env: env3,
242267
+ env: env2,
242321
242268
  cwd: localDirectory,
242322
242269
  execPath: nodePath2,
242323
242270
  preferLocal,
242324
242271
  addExecPath: node
242325
242272
  });
242326
242273
  }
242327
- return env3;
242274
+ return env2;
242328
242275
  };
242329
242276
 
242330
242277
  // ../../node_modules/execa/lib/arguments/shell.js
@@ -246593,6 +246540,10 @@ function formatUpgradeMessage(info, distribution) {
246593
246540
  ].join(`
246594
246541
  `);
246595
246542
  }
246543
+ function formatPlainUpgradeMessage(info, distribution) {
246544
+ const instruction = getUpgradeInstruction(detectInstallMethod(distribution));
246545
+ return `Update available: ${info.currentVersion} → ${info.latestVersion}. ${instruction}`;
246546
+ }
246596
246547
  async function printUpgradeNotification(upgradeCheckPromise, distribution) {
246597
246548
  try {
246598
246549
  const upgradeInfo = await upgradeCheckPromise;
@@ -246602,47 +246553,23 @@ async function printUpgradeNotification(upgradeCheckPromise, distribution) {
246602
246553
  } catch {}
246603
246554
  }
246604
246555
 
246605
- // src/cli/utils/runCommand.ts
246606
- async function runCommand(commandFn, options, context) {
246607
- if (options?.fullBanner) {
246608
- await printBanner(context.isNonInteractive);
246556
+ // src/cli/utils/command/render.ts
246557
+ async function showCommandStart(fullBanner) {
246558
+ if (fullBanner) {
246559
+ await printBanner();
246609
246560
  We("");
246610
246561
  } else {
246611
246562
  We(theme.colors.base44OrangeBackground(" Base 44 "));
246612
246563
  }
246613
- const upgradeCheckPromise = startUpgradeCheck();
246614
- try {
246615
- if (options?.requireAuth) {
246616
- const loggedIn = await isLoggedIn();
246617
- if (!loggedIn) {
246618
- R2.info("You need to login first to continue.");
246619
- await login();
246620
- }
246621
- try {
246622
- const userInfo = await readAuth();
246623
- context.errorReporter.setContext({
246624
- user: { email: userInfo.email, name: userInfo.name }
246625
- });
246626
- } catch {}
246627
- }
246628
- if (options?.requireAppConfig !== false) {
246629
- const appConfig = await initAppConfig();
246630
- context.errorReporter.setContext({ appId: appConfig.id });
246631
- }
246632
- const result = await commandFn();
246633
- await printUpgradeNotification(upgradeCheckPromise, context.distribution);
246634
- Le(result.outroMessage || "");
246635
- if (result.stdout) {
246636
- process.stdout.write(result.stdout);
246637
- }
246638
- } catch (error48) {
246639
- displayError(error48);
246640
- const errorContext = context.errorReporter.getErrorContext();
246641
- Le(theme.format.errorContext(errorContext));
246642
- throw error48;
246564
+ }
246565
+ async function showCommandEnd(result, upgradeCheckPromise, distribution) {
246566
+ await printUpgradeNotification(upgradeCheckPromise, distribution);
246567
+ Le(result.outroMessage || "");
246568
+ if (result.stdout) {
246569
+ process.stdout.write(result.stdout);
246643
246570
  }
246644
246571
  }
246645
- function displayError(error48) {
246572
+ function showThemedError(error48, context) {
246646
246573
  const errorMessage = error48 instanceof Error ? error48.message : String(error48);
246647
246574
  R2.error(errorMessage);
246648
246575
  if (isCLIError(error48)) {
@@ -246657,7 +246584,111 @@ function displayError(error48) {
246657
246584
  if (process.env.DEBUG === "1" && error48 instanceof Error && error48.stack) {
246658
246585
  R2.error(theme.styles.dim(error48.stack));
246659
246586
  }
246587
+ const errorContext = context.errorReporter.getErrorContext();
246588
+ Le(theme.format.errorContext(errorContext));
246589
+ }
246590
+ function showPlainError(error48) {
246591
+ const errorMessage = error48 instanceof Error ? error48.message : String(error48);
246592
+ process.stderr.write(`Error: ${errorMessage}
246593
+ `);
246594
+ if (isCLIError(error48)) {
246595
+ for (const detail of error48.details) {
246596
+ process.stderr.write(` ${detail}
246597
+ `);
246598
+ }
246599
+ for (const hint of error48.hints) {
246600
+ const cmd = hint.command ? ` (${hint.command})` : "";
246601
+ process.stderr.write(` Hint: ${hint.message}${cmd}
246602
+ `);
246603
+ }
246604
+ }
246605
+ if (process.env.DEBUG === "1" && error48 instanceof Error && error48.stack) {
246606
+ process.stderr.write(`${error48.stack}
246607
+ `);
246608
+ }
246660
246609
  }
246610
+
246611
+ // src/cli/utils/command/Base44Command.ts
246612
+ class Base44Command extends Command {
246613
+ _context;
246614
+ _commandOptions;
246615
+ constructor(name2, options) {
246616
+ super(name2);
246617
+ this._commandOptions = {
246618
+ requireAuth: options?.requireAuth ?? true,
246619
+ requireAppConfig: options?.requireAppConfig ?? true,
246620
+ fullBanner: options?.fullBanner ?? false
246621
+ };
246622
+ }
246623
+ setContext(context) {
246624
+ this._context = context;
246625
+ }
246626
+ get isNonInteractive() {
246627
+ return this._context?.isNonInteractive ?? false;
246628
+ }
246629
+ get context() {
246630
+ if (!this._context) {
246631
+ throw new Error("Base44Command context not set. Ensure the command is registered via createProgram().");
246632
+ }
246633
+ return this._context;
246634
+ }
246635
+ action(fn) {
246636
+ return super.action(async (...args) => {
246637
+ const quiet = this.context.isNonInteractive;
246638
+ if (!quiet) {
246639
+ await showCommandStart(this._commandOptions.fullBanner);
246640
+ }
246641
+ const upgradeCheckPromise = startUpgradeCheck();
246642
+ try {
246643
+ if (this._commandOptions.requireAuth) {
246644
+ await ensureAuth(this.context.errorReporter);
246645
+ }
246646
+ if (this._commandOptions.requireAppConfig) {
246647
+ await ensureAppConfig(this.context.errorReporter);
246648
+ }
246649
+ const result = await fn(...args) ?? {};
246650
+ if (!quiet) {
246651
+ await showCommandEnd(result, upgradeCheckPromise, this.context.distribution);
246652
+ } else {
246653
+ if (result.outroMessage) {
246654
+ process.stdout.write(`${result.outroMessage}
246655
+ `);
246656
+ }
246657
+ if (result.stdout) {
246658
+ process.stdout.write(result.stdout);
246659
+ }
246660
+ const upgradeInfo = await upgradeCheckPromise;
246661
+ if (upgradeInfo) {
246662
+ process.stderr.write(`${formatPlainUpgradeMessage(upgradeInfo, this.context.distribution)}
246663
+ `);
246664
+ }
246665
+ }
246666
+ } catch (error48) {
246667
+ if (quiet) {
246668
+ showPlainError(error48);
246669
+ } else {
246670
+ showThemedError(error48, this.context);
246671
+ }
246672
+ throw error48;
246673
+ }
246674
+ });
246675
+ }
246676
+ }
246677
+ // src/cli/errors.ts
246678
+ class CLIExitError extends Error {
246679
+ code;
246680
+ constructor(code2) {
246681
+ super(`CLI exited with code ${code2}`);
246682
+ this.code = code2;
246683
+ this.name = "CLIExitError";
246684
+ }
246685
+ }
246686
+
246687
+ // src/cli/utils/prompts.ts
246688
+ var onPromptCancel = () => {
246689
+ Ne("Operation cancelled.");
246690
+ throw new CLIExitError(0);
246691
+ };
246661
246692
  // src/cli/utils/runTask.ts
246662
246693
  async function runTask(startMessage, operation, options) {
246663
246694
  const s = bt2();
@@ -246688,7 +246719,7 @@ var import_lodash = __toESM(require_lodash(), 1);
246688
246719
  var composer = require_composer();
246689
246720
  var Document = require_Document();
246690
246721
  var Schema = require_Schema();
246691
- var errors4 = require_errors();
246722
+ var errors3 = require_errors();
246692
246723
  var Alias = require_Alias();
246693
246724
  var identity3 = require_identity();
246694
246725
  var Pair = require_Pair();
@@ -246704,9 +246735,9 @@ var visit = require_visit();
246704
246735
  var $Composer = composer.Composer;
246705
246736
  var $Document = Document.Document;
246706
246737
  var $Schema = Schema.Schema;
246707
- var $YAMLError = errors4.YAMLError;
246708
- var $YAMLParseError = errors4.YAMLParseError;
246709
- var $YAMLWarning = errors4.YAMLWarning;
246738
+ var $YAMLError = errors3.YAMLError;
246739
+ var $YAMLParseError = errors3.YAMLParseError;
246740
+ var $YAMLWarning = errors3.YAMLWarning;
246710
246741
  var $Alias = Alias.Alias;
246711
246742
  var $isAlias = identity3.isAlias;
246712
246743
  var $isCollection = identity3.isCollection;
@@ -246744,6 +246775,84 @@ function formatYaml(data, options = {}) {
246744
246775
  const replacer = stripEmpty ? stripEmptyReplacer : undefined;
246745
246776
  return $stringify(data, replacer, { indent: YAML_INDENT }).trimEnd();
246746
246777
  }
246778
+ // src/core/resources/secret/schema.ts
246779
+ var ListSecretsResponseSchema = exports_external.record(exports_external.string(), exports_external.string());
246780
+ var SetSecretsResponseSchema = exports_external.object({
246781
+ success: exports_external.boolean()
246782
+ });
246783
+ var DeleteSecretResponseSchema = exports_external.object({
246784
+ success: exports_external.boolean()
246785
+ });
246786
+
246787
+ // src/core/resources/secret/api.ts
246788
+ async function listSecrets() {
246789
+ const appClient = getAppClient();
246790
+ let response;
246791
+ try {
246792
+ response = await appClient.get("secrets");
246793
+ } catch (error48) {
246794
+ throw await ApiError.fromHttpError(error48, "listing secrets");
246795
+ }
246796
+ const result = ListSecretsResponseSchema.safeParse(await response.json());
246797
+ if (!result.success) {
246798
+ throw new SchemaValidationError("Invalid response from server", result.error);
246799
+ }
246800
+ return result.data;
246801
+ }
246802
+ async function setSecrets(secrets) {
246803
+ const appClient = getAppClient();
246804
+ let response;
246805
+ try {
246806
+ response = await appClient.post("secrets", {
246807
+ json: secrets,
246808
+ timeout: false
246809
+ });
246810
+ } catch (error48) {
246811
+ throw await ApiError.fromHttpError(error48, "setting secrets");
246812
+ }
246813
+ const result = SetSecretsResponseSchema.safeParse(await response.json());
246814
+ if (!result.success) {
246815
+ throw new SchemaValidationError("Invalid response from server", result.error);
246816
+ }
246817
+ return result.data;
246818
+ }
246819
+ async function deleteSecret(name2) {
246820
+ const appClient = getAppClient();
246821
+ let response;
246822
+ try {
246823
+ response = await appClient.delete("secrets", {
246824
+ searchParams: { secret_name: name2 },
246825
+ timeout: false
246826
+ });
246827
+ } catch (error48) {
246828
+ throw await ApiError.fromHttpError(error48, "deleting secret");
246829
+ }
246830
+ const result = DeleteSecretResponseSchema.safeParse(await response.json());
246831
+ if (!result.success) {
246832
+ throw new SchemaValidationError("Invalid response from server", result.error);
246833
+ }
246834
+ return result.data;
246835
+ }
246836
+ // src/core/utils/dependencies.ts
246837
+ import { spawnSync as spawnSync2 } from "node:child_process";
246838
+ function verifyDenoInstalled(context) {
246839
+ const result = spawnSync2("deno", ["--version"]);
246840
+ if (result.error) {
246841
+ throw new DependencyNotFoundError(`Deno is required ${context}`, {
246842
+ hints: [
246843
+ {
246844
+ message: "Install Deno: https://docs.deno.com/runtime/getting_started/installation/"
246845
+ }
246846
+ ]
246847
+ });
246848
+ }
246849
+ }
246850
+ // src/core/utils/env.ts
246851
+ var import_dotenv = __toESM(require_main(), 1);
246852
+ async function parseEnvFile(filePath) {
246853
+ const content = await readTextFile(filePath);
246854
+ return import_dotenv.parse(content);
246855
+ }
246747
246856
  // src/cli/commands/agents/pull.ts
246748
246857
  async function pullAgentsAction() {
246749
246858
  const { project: project2 } = await readProjectConfig();
@@ -246774,10 +246883,8 @@ async function pullAgentsAction() {
246774
246883
  outroMessage: `Pulled ${remoteAgents.total} agents to ${agentsDir}`
246775
246884
  };
246776
246885
  }
246777
- function getAgentsPullCommand(context) {
246778
- return new Command("pull").description("Pull agents from Base44 to local files (replaces all local agent configs)").action(async () => {
246779
- await runCommand(pullAgentsAction, { requireAuth: true }, context);
246780
- });
246886
+ function getAgentsPullCommand() {
246887
+ return new Base44Command("pull").description("Pull agents from Base44 to local files (replaces all local agent configs)").action(pullAgentsAction);
246781
246888
  }
246782
246889
 
246783
246890
  // src/cli/commands/agents/push.ts
@@ -246801,22 +246908,21 @@ async function pushAgentsAction() {
246801
246908
  }
246802
246909
  return { outroMessage: "Agents pushed to Base44" };
246803
246910
  }
246804
- function getAgentsPushCommand(context) {
246805
- return new Command("push").description("Push local agents to Base44 (replaces all remote agent configs)").action(async () => {
246806
- await runCommand(pushAgentsAction, { requireAuth: true }, context);
246807
- });
246911
+ function getAgentsPushCommand() {
246912
+ return new Base44Command("push").description("Push local agents to Base44 (replaces all remote agent configs)").action(pushAgentsAction);
246808
246913
  }
246809
246914
 
246810
246915
  // src/cli/commands/agents/index.ts
246811
- function getAgentsCommand(context) {
246812
- return new Command("agents").description("Manage project agents").addCommand(getAgentsPushCommand(context)).addCommand(getAgentsPullCommand(context));
246916
+ function getAgentsCommand() {
246917
+ return new Command("agents").description("Manage project agents").addCommand(getAgentsPushCommand()).addCommand(getAgentsPullCommand());
246813
246918
  }
246814
246919
 
246815
246920
  // src/cli/commands/auth/login.ts
246816
- function getLoginCommand(context) {
246817
- return new Command("login").description("Authenticate with Base44").action(async () => {
246818
- await runCommand(login, { requireAppConfig: false }, context);
246819
- });
246921
+ function getLoginCommand() {
246922
+ return new Base44Command("login", {
246923
+ requireAuth: false,
246924
+ requireAppConfig: false
246925
+ }).description("Authenticate with Base44").action(login);
246820
246926
  }
246821
246927
 
246822
246928
  // src/cli/commands/auth/logout.ts
@@ -246824,10 +246930,11 @@ async function logout() {
246824
246930
  await deleteAuth();
246825
246931
  return { outroMessage: "Logged out successfully" };
246826
246932
  }
246827
- function getLogoutCommand(context) {
246828
- return new Command("logout").description("Logout from current device").action(async () => {
246829
- await runCommand(logout, { requireAppConfig: false }, context);
246830
- });
246933
+ function getLogoutCommand() {
246934
+ return new Base44Command("logout", {
246935
+ requireAuth: false,
246936
+ requireAppConfig: false
246937
+ }).description("Logout from current device").action(logout);
246831
246938
  }
246832
246939
 
246833
246940
  // src/cli/commands/auth/whoami.ts
@@ -246835,10 +246942,8 @@ async function whoami() {
246835
246942
  const auth2 = await readAuth();
246836
246943
  return { outroMessage: `Logged in as: ${theme.styles.bold(auth2.email)}` };
246837
246944
  }
246838
- function getWhoamiCommand(context) {
246839
- return new Command("whoami").description("Display current authenticated user").action(async () => {
246840
- await runCommand(whoami, { requireAuth: true, requireAppConfig: false }, context);
246841
- });
246945
+ function getWhoamiCommand() {
246946
+ return new Base44Command("whoami", { requireAppConfig: false }).description("Display current authenticated user").action(whoami);
246842
246947
  }
246843
246948
 
246844
246949
  // src/cli/commands/connectors/list-available.ts
@@ -246863,10 +246968,8 @@ ${pad}`)}`);
246863
246968
  outroMessage: `Found ${integrations.length} available integrations.`
246864
246969
  };
246865
246970
  }
246866
- function getConnectorsListAvailableCommand(context) {
246867
- return new Command("list-available").description("List all available integration types").action(async () => {
246868
- await runCommand(listAvailableAction, { requireAuth: true }, context);
246869
- });
246971
+ function getConnectorsListAvailableCommand() {
246972
+ return new Base44Command("list-available").description("List all available integration types").action(listAvailableAction);
246870
246973
  }
246871
246974
 
246872
246975
  // src/cli/commands/connectors/pull.ts
@@ -246900,10 +247003,8 @@ async function pullConnectorsAction() {
246900
247003
  outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
246901
247004
  };
246902
247005
  }
246903
- function getConnectorsPullCommand(context) {
246904
- return new Command("pull").description("Pull connectors from Base44 to local files (replaces all local connector configs)").action(async () => {
246905
- await runCommand(pullConnectorsAction, { requireAuth: true }, context);
246906
- });
247006
+ function getConnectorsPullCommand() {
247007
+ return new Base44Command("pull").description("Pull connectors from Base44 to local files (replaces all local connector configs)").action(pullConnectorsAction);
246907
247008
  }
246908
247009
 
246909
247010
  // ../../node_modules/open/index.js
@@ -246994,12 +247095,12 @@ import { promisify as promisify5 } from "node:util";
246994
247095
  import childProcess from "node:child_process";
246995
247096
  var execFile = promisify5(childProcess.execFile);
246996
247097
  var powerShellPath = () => `${process15.env.SYSTEMROOT || process15.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
246997
- var executePowerShell = async (command, options = {}) => {
247098
+ var executePowerShell = async (command2, options = {}) => {
246998
247099
  const {
246999
247100
  powerShellPath: psPath,
247000
247101
  ...execFileOptions
247001
247102
  } = options;
247002
- const encodedCommand = executePowerShell.encodeCommand(command);
247103
+ const encodedCommand = executePowerShell.encodeCommand(command2);
247003
247104
  return execFile(psPath ?? powerShellPath(), [
247004
247105
  ...executePowerShell.argumentsPrefix,
247005
247106
  encodedCommand
@@ -247015,7 +247116,7 @@ executePowerShell.argumentsPrefix = [
247015
247116
  "Bypass",
247016
247117
  "-EncodedCommand"
247017
247118
  ];
247018
- executePowerShell.encodeCommand = (command) => Buffer6.from(command, "utf16le").toString("base64");
247119
+ executePowerShell.encodeCommand = (command2) => Buffer6.from(command2, "utf16le").toString("base64");
247019
247120
  executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
247020
247121
 
247021
247122
  // ../../node_modules/wsl-utils/utilities.js
@@ -247081,8 +247182,8 @@ var canAccessPowerShell = async () => {
247081
247182
  };
247082
247183
  var wslDefaultBrowser = async () => {
247083
247184
  const psPath = await powerShellPath2();
247084
- const command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
247085
- const { stdout } = await executePowerShell(command, { powerShellPath: psPath });
247185
+ const command2 = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
247186
+ const { stdout } = await executePowerShell(command2, { powerShellPath: psPath });
247086
247187
  return stdout.trim();
247087
247188
  };
247088
247189
  var convertWslPathToWindows = async (path16) => {
@@ -247326,7 +247427,7 @@ var baseOpen = async (options) => {
247326
247427
  }
247327
247428
  throw new Error(`${browser.name} is not supported as a default browser`);
247328
247429
  }
247329
- let command;
247430
+ let command2;
247330
247431
  const cliArguments = [];
247331
247432
  const childProcessOptions = {};
247332
247433
  let shouldUseWindowsInWsl = false;
@@ -247334,7 +247435,7 @@ var baseOpen = async (options) => {
247334
247435
  shouldUseWindowsInWsl = await canAccessPowerShell();
247335
247436
  }
247336
247437
  if (platform6 === "darwin") {
247337
- command = "open";
247438
+ command2 = "open";
247338
247439
  if (options.wait) {
247339
247440
  cliArguments.push("--wait-apps");
247340
247441
  }
@@ -247348,7 +247449,7 @@ var baseOpen = async (options) => {
247348
247449
  cliArguments.push("-a", app);
247349
247450
  }
247350
247451
  } else if (platform6 === "win32" || shouldUseWindowsInWsl) {
247351
- command = await powerShellPath2();
247452
+ command2 = await powerShellPath2();
247352
247453
  cliArguments.push(...executePowerShell.argumentsPrefix);
247353
247454
  if (!is_wsl_default) {
247354
247455
  childProcessOptions.windowsVerbatimArguments = true;
@@ -247378,7 +247479,7 @@ var baseOpen = async (options) => {
247378
247479
  }
247379
247480
  } else {
247380
247481
  if (app) {
247381
- command = app;
247482
+ command2 = app;
247382
247483
  } else {
247383
247484
  const isBundled = !__dirname2 || __dirname2 === "/";
247384
247485
  let exeLocalXdgOpen = false;
@@ -247387,7 +247488,7 @@ var baseOpen = async (options) => {
247387
247488
  exeLocalXdgOpen = true;
247388
247489
  } catch {}
247389
247490
  const useSystemXdgOpen = process20.versions.electron ?? (platform6 === "android" || isBundled || !exeLocalXdgOpen);
247390
- command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
247491
+ command2 = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
247391
247492
  }
247392
247493
  if (appArguments.length > 0) {
247393
247494
  cliArguments.push(...appArguments);
@@ -247403,7 +247504,7 @@ var baseOpen = async (options) => {
247403
247504
  if (options.target) {
247404
247505
  cliArguments.push(options.target);
247405
247506
  }
247406
- const subprocess = childProcess3.spawn(command, cliArguments, childProcessOptions);
247507
+ const subprocess = childProcess3.spawn(command2, cliArguments, childProcessOptions);
247407
247508
  if (options.wait) {
247408
247509
  return new Promise((resolve2, reject) => {
247409
247510
  subprocess.once("error", reject);
@@ -247546,7 +247647,7 @@ async function runOAuthFlowWithSkip(connector2) {
247546
247647
  timeout: POLL_TIMEOUT_MS
247547
247648
  });
247548
247649
  } catch (err) {
247549
- if (err instanceof TimeoutError2) {
247650
+ if (err instanceof TimeoutError) {
247550
247651
  finalStatus = "PENDING";
247551
247652
  } else {
247552
247653
  throw err;
@@ -247682,15 +247783,15 @@ async function pushConnectorsAction(isNonInteractive) {
247682
247783
  printSummary(results, oauthOutcomes);
247683
247784
  return { outroMessage };
247684
247785
  }
247685
- function getConnectorsPushCommand(context) {
247686
- return new Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(async () => {
247687
- await runCommand(() => pushConnectorsAction(context.isNonInteractive), { requireAuth: true }, context);
247786
+ function getConnectorsPushCommand() {
247787
+ return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(async (_options, command2) => {
247788
+ return await pushConnectorsAction(command2.isNonInteractive);
247688
247789
  });
247689
247790
  }
247690
247791
 
247691
247792
  // src/cli/commands/connectors/index.ts
247692
- function getConnectorsCommand(context) {
247693
- return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsListAvailableCommand(context)).addCommand(getConnectorsPullCommand(context)).addCommand(getConnectorsPushCommand(context));
247793
+ function getConnectorsCommand() {
247794
+ return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsListAvailableCommand()).addCommand(getConnectorsPullCommand()).addCommand(getConnectorsPushCommand());
247694
247795
  }
247695
247796
 
247696
247797
  // src/cli/commands/dashboard/open.ts
@@ -247701,15 +247802,15 @@ async function openDashboard(isNonInteractive) {
247701
247802
  }
247702
247803
  return { outroMessage: `Dashboard opened at ${dashboardUrl}` };
247703
247804
  }
247704
- function getDashboardOpenCommand(context) {
247705
- return new Command("open").description("Open the app dashboard in your browser").action(async () => {
247706
- await runCommand(() => openDashboard(context.isNonInteractive), { requireAuth: true }, context);
247805
+ function getDashboardOpenCommand() {
247806
+ return new Base44Command("open").description("Open the app dashboard in your browser").action(async (_options, command2) => {
247807
+ return await openDashboard(command2.isNonInteractive);
247707
247808
  });
247708
247809
  }
247709
247810
 
247710
247811
  // src/cli/commands/dashboard/index.ts
247711
- function getDashboardCommand(context) {
247712
- return new Command("dashboard").description("Manage app dashboard").addCommand(getDashboardOpenCommand(context));
247812
+ function getDashboardCommand() {
247813
+ return new Command("dashboard").description("Manage app dashboard").addCommand(getDashboardOpenCommand());
247713
247814
  }
247714
247815
 
247715
247816
  // src/cli/commands/entities/push.ts
@@ -247737,10 +247838,8 @@ async function pushEntitiesAction() {
247737
247838
  }
247738
247839
  return { outroMessage: "Entities pushed to Base44" };
247739
247840
  }
247740
- function getEntitiesPushCommand(context) {
247741
- return new Command("entities").description("Manage project entities").addCommand(new Command("push").description("Push local entities to Base44").action(async () => {
247742
- await runCommand(pushEntitiesAction, { requireAuth: true }, context);
247743
- }));
247841
+ function getEntitiesPushCommand() {
247842
+ return new Command("entities").description("Manage project entities").addCommand(new Base44Command("push").description("Push local entities to Base44").action(pushEntitiesAction));
247744
247843
  }
247745
247844
 
247746
247845
  // src/cli/commands/functions/delete.ts
@@ -247783,16 +247882,16 @@ async function deleteFunctionsAction(names) {
247783
247882
  function parseNames(args) {
247784
247883
  return args.flatMap((arg) => arg.split(",")).map((n2) => n2.trim()).filter(Boolean);
247785
247884
  }
247786
- function validateNames(command) {
247787
- const names = parseNames(command.args);
247885
+ function validateNames(command2) {
247886
+ const names = parseNames(command2.args);
247788
247887
  if (names.length === 0) {
247789
- command.error("At least one function name is required");
247888
+ command2.error("At least one function name is required");
247790
247889
  }
247791
247890
  }
247792
- function getDeleteCommand(context) {
247793
- return new Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").hook("preAction", validateNames).action(async (rawNames) => {
247891
+ function getDeleteCommand() {
247892
+ return new Base44Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").hook("preAction", validateNames).action(async (rawNames) => {
247794
247893
  const names = parseNames(rawNames);
247795
- await runCommand(() => deleteFunctionsAction(names), { requireAuth: true }, context);
247894
+ return deleteFunctionsAction(names);
247796
247895
  });
247797
247896
  }
247798
247897
 
@@ -247898,12 +247997,10 @@ async function deployFunctionsAction(names, options) {
247898
247997
  }
247899
247998
  return { outroMessage: buildDeploySummary(results) };
247900
247999
  }
247901
- function getDeployCommand(context) {
247902
- return new Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (rawNames, options) => {
247903
- await runCommand(() => {
247904
- const names = parseNames2(rawNames);
247905
- return deployFunctionsAction(names, options);
247906
- }, { requireAuth: true }, context);
248000
+ function getDeployCommand() {
248001
+ return new Base44Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (rawNames, options) => {
248002
+ const names = parseNames2(rawNames);
248003
+ return deployFunctionsAction(names, options);
247907
248004
  });
247908
248005
  }
247909
248006
 
@@ -247922,10 +248019,8 @@ async function listFunctionsAction() {
247922
248019
  outroMessage: `${functions.length} function${functions.length !== 1 ? "s" : ""} on remote`
247923
248020
  };
247924
248021
  }
247925
- function getListCommand(context) {
247926
- return new Command("list").description("List all deployed functions").action(async () => {
247927
- await runCommand(listFunctionsAction, { requireAuth: true }, context);
247928
- });
248022
+ function getListCommand() {
248023
+ return new Base44Command("list").description("List all deployed functions").action(listFunctionsAction);
247929
248024
  }
247930
248025
 
247931
248026
  // src/cli/commands/functions/pull.ts
@@ -247966,15 +248061,13 @@ async function pullFunctionsAction(name2) {
247966
248061
  outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
247967
248062
  };
247968
248063
  }
247969
- function getPullCommand(context) {
247970
- return new Command("pull").description("Pull deployed functions from Base44").argument("[name]", "Function name to pull (pulls all if omitted)").action(async (name2) => {
247971
- await runCommand(() => pullFunctionsAction(name2), { requireAuth: true }, context);
247972
- });
248064
+ function getPullCommand() {
248065
+ return new Base44Command("pull").description("Pull deployed functions from Base44").argument("[name]", "Function name to pull (pulls all if omitted)").action(pullFunctionsAction);
247973
248066
  }
247974
248067
 
247975
248068
  // src/cli/commands/functions/index.ts
247976
- function getFunctionsCommand(context) {
247977
- return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(context)).addCommand(getDeleteCommand(context)).addCommand(getListCommand(context)).addCommand(getPullCommand(context));
248069
+ function getFunctionsCommand() {
248070
+ return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand()).addCommand(getDeleteCommand()).addCommand(getListCommand()).addCommand(getPullCommand());
247978
248071
  }
247979
248072
 
247980
248073
  // src/cli/commands/project/create.ts
@@ -247992,10 +248085,10 @@ async function getTemplateById(templateId) {
247992
248085
  }
247993
248086
  return template2;
247994
248087
  }
247995
- function validateNonInteractiveFlags(command) {
247996
- const { path: path17 } = command.opts();
247997
- if (path17 && !command.args.length) {
247998
- command.error("--path requires a project name argument. Usage: base44 create <name> --path <path>");
248088
+ function validateNonInteractiveFlags(command2) {
248089
+ const { path: path17 } = command2.opts();
248090
+ if (path17 && !command2.args.length) {
248091
+ command2.error("--path requires a project name argument. Usage: base44 create <name> --path <path>");
247999
248092
  }
248000
248093
  }
248001
248094
  async function createInteractive(options) {
@@ -248144,21 +248237,35 @@ async function executeCreate({
248144
248237
  }
248145
248238
  return { outroMessage: "Your project is set up and ready to use" };
248146
248239
  }
248147
- function getCreateCommand(context) {
248148
- return new Command("create").description("Create a new Base44 project").addArgument(new Argument("name", "Project name").argOptional()).option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").option("--no-skills", "Skip AI agent skills installation").addHelpText("after", `
248240
+ function getCreateCommand() {
248241
+ return new Base44Command("create", {
248242
+ requireAppConfig: false,
248243
+ fullBanner: true
248244
+ }).description("Create a new Base44 project").addArgument(new Argument("name", "Project name").argOptional()).option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").option("--no-skills", "Skip AI agent skills installation").addHelpText("after", `
248149
248245
  Examples:
248150
248246
  $ base44 create my-app Creates a base44 project at ./my-app
248151
248247
  $ base44 create my-todo-app --template backend-and-client Creates a base44 backend-and-client project at ./my-todo-app
248152
- $ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(async (name2, options) => {
248248
+ $ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(async (name2, options, command2) => {
248153
248249
  if (name2 && !options.path) {
248154
248250
  options.path = `./${import_kebabCase.default(name2)}`;
248155
248251
  }
248156
- const isNonInteractive = !!(options.name ?? name2) && !!options.path;
248157
- if (isNonInteractive) {
248158
- await runCommand(() => createNonInteractive({ name: options.name ?? name2, ...options }), { requireAuth: true, requireAppConfig: false }, context);
248159
- } else {
248160
- await runCommand(() => createInteractive({ name: name2, ...options }), { fullBanner: true, requireAuth: true, requireAppConfig: false }, context);
248252
+ const skipPrompts = !!(options.name ?? name2) && !!options.path;
248253
+ if (!skipPrompts && command2.isNonInteractive) {
248254
+ throw new InvalidInputError("Project name and --path are required in non-interactive mode", {
248255
+ hints: [
248256
+ {
248257
+ message: "Usage: base44 create <name> --path <path>"
248258
+ }
248259
+ ]
248260
+ });
248161
248261
  }
248262
+ if (skipPrompts) {
248263
+ return await createNonInteractive({
248264
+ name: options.name ?? name2,
248265
+ ...options
248266
+ });
248267
+ }
248268
+ return await createInteractive({ name: name2, ...options });
248162
248269
  });
248163
248270
  }
248164
248271
 
@@ -248226,12 +248333,15 @@ ${summaryLines.join(`
248226
248333
  }
248227
248334
  return { outroMessage: "App deployed successfully" };
248228
248335
  }
248229
- function getDeployCommand2(context) {
248230
- return new Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
248231
- await runCommand(() => deployAction({
248336
+ function getDeployCommand2() {
248337
+ return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options, command2) => {
248338
+ if (command2.isNonInteractive && !options.yes) {
248339
+ throw new InvalidInputError("--yes is required in non-interactive mode");
248340
+ }
248341
+ return await deployAction({
248232
248342
  ...options,
248233
- isNonInteractive: context.isNonInteractive
248234
- }), { requireAuth: true }, context);
248343
+ isNonInteractive: command2.isNonInteractive
248344
+ });
248235
248345
  });
248236
248346
  }
248237
248347
  async function handleOAuthConnectors(connectorResults, options) {
@@ -248255,13 +248365,13 @@ function printStripeResult(r) {
248255
248365
  }
248256
248366
 
248257
248367
  // src/cli/commands/project/link.ts
248258
- function validateNonInteractiveFlags2(command) {
248259
- const { create: create4, name: name2, projectId } = command.opts();
248368
+ function validateNonInteractiveFlags2(command2) {
248369
+ const { create: create4, name: name2, projectId } = command2.opts();
248260
248370
  if (create4 && projectId) {
248261
- command.error("--create and --projectId cannot be used together");
248371
+ command2.error("--create and --projectId cannot be used together");
248262
248372
  }
248263
248373
  if (create4 && !name2) {
248264
- command.error("--name is required when using --create");
248374
+ command2.error("--name is required when using --create");
248265
248375
  }
248266
248376
  }
248267
248377
  async function promptForLinkAction() {
@@ -248394,9 +248504,13 @@ async function link(options) {
248394
248504
  R2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(finalProjectId))}`);
248395
248505
  return { outroMessage: "Project linked" };
248396
248506
  }
248397
- function getLinkCommand(context) {
248398
- return new Command("link").description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(async (options) => {
248399
- await runCommand(() => link(options), { requireAuth: true, requireAppConfig: false }, context);
248507
+ function getLinkCommand() {
248508
+ return new Base44Command("link", { requireAppConfig: false }).description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(async (options, command2) => {
248509
+ const skipPrompts = !!options.create || !!options.projectId;
248510
+ if (!skipPrompts && command2.isNonInteractive) {
248511
+ throw new InvalidInputError("--create with --name, or --projectId, is required in non-interactive mode");
248512
+ }
248513
+ return await link(options);
248400
248514
  });
248401
248515
  }
248402
248516
 
@@ -248516,10 +248630,8 @@ async function logsAction(options) {
248516
248630
  ` : formatLogs(entries);
248517
248631
  return { outroMessage: "Fetched logs", stdout: logsOutput };
248518
248632
  }
248519
- function getLogsCommand(context) {
248520
- return new Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all project functions").option("--since <datetime>", "Show logs from this time (ISO format)", normalizeDatetime).option("--until <datetime>", "Show logs until this time (ISO format)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).action(async (options) => {
248521
- await runCommand(() => logsAction(options), { requireAuth: true }, context);
248522
- });
248633
+ function getLogsCommand() {
248634
+ return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all project functions").option("--since <datetime>", "Show logs from this time (ISO format)", normalizeDatetime).option("--until <datetime>", "Show logs until this time (ISO format)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).action(logsAction);
248523
248635
  }
248524
248636
 
248525
248637
  // src/cli/commands/secrets/delete.ts
@@ -248534,10 +248646,8 @@ async function deleteSecretAction(key) {
248534
248646
  outroMessage: "Secret deleted successfully."
248535
248647
  };
248536
248648
  }
248537
- function getSecretsDeleteCommand(context) {
248538
- return new Command("delete").description("Delete a secret").argument("<key>", "Secret name to delete").action(async (key) => {
248539
- await runCommand(() => deleteSecretAction(key), { requireAuth: true }, context);
248540
- });
248649
+ function getSecretsDeleteCommand() {
248650
+ return new Base44Command("delete").description("Delete a secret").argument("<key>", "Secret name to delete").action(deleteSecretAction);
248541
248651
  }
248542
248652
 
248543
248653
  // src/cli/commands/secrets/list.ts
@@ -248559,10 +248669,8 @@ async function listSecretsAction() {
248559
248669
  outroMessage: `Found ${names.length} secrets.`
248560
248670
  };
248561
248671
  }
248562
- function getSecretsListCommand(context) {
248563
- return new Command("list").description("List secret names").action(async () => {
248564
- await runCommand(listSecretsAction, { requireAuth: true }, context);
248565
- });
248672
+ function getSecretsListCommand() {
248673
+ return new Base44Command("list").description("List secret names").action(listSecretsAction);
248566
248674
  }
248567
248675
 
248568
248676
  // src/cli/commands/secrets/set.ts
@@ -248616,15 +248724,13 @@ async function setSecretsAction(entries, options) {
248616
248724
  outroMessage: "Secrets set successfully."
248617
248725
  };
248618
248726
  }
248619
- function getSecretsSetCommand(context) {
248620
- return new Command("set").description("Set one or more secrets (KEY=VALUE format)").argument("[entries...]", "KEY=VALUE pairs (e.g. KEY1=VALUE1 KEY2=VALUE2)").option("--env-file <path>", "Path to .env file").action(async (entries, options) => {
248621
- await runCommand(() => setSecretsAction(entries, options), { requireAuth: true }, context);
248622
- });
248727
+ function getSecretsSetCommand() {
248728
+ return new Base44Command("set").description("Set one or more secrets (KEY=VALUE format)").argument("[entries...]", "KEY=VALUE pairs (e.g. KEY1=VALUE1 KEY2=VALUE2)").option("--env-file <path>", "Path to .env file").action(setSecretsAction);
248623
248729
  }
248624
248730
 
248625
248731
  // src/cli/commands/secrets/index.ts
248626
- function getSecretsCommand(context) {
248627
- return new Command("secrets").description("Manage project secrets (environment variables)").addCommand(getSecretsListCommand(context)).addCommand(getSecretsSetCommand(context)).addCommand(getSecretsDeleteCommand(context));
248732
+ function getSecretsCommand() {
248733
+ return new Command("secrets").description("Manage project secrets (environment variables)").addCommand(getSecretsListCommand()).addCommand(getSecretsSetCommand()).addCommand(getSecretsDeleteCommand());
248628
248734
  }
248629
248735
 
248630
248736
  // src/cli/commands/site/deploy.ts
@@ -248657,12 +248763,15 @@ async function deployAction2(options) {
248657
248763
  });
248658
248764
  return { outroMessage: `Visit your site at: ${result.appUrl}` };
248659
248765
  }
248660
- function getSiteDeployCommand(context) {
248661
- return new Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
248662
- await runCommand(() => deployAction2({
248766
+ function getSiteDeployCommand() {
248767
+ return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(async (options, command2) => {
248768
+ if (command2.isNonInteractive && !options.yes) {
248769
+ throw new InvalidInputError("--yes is required in non-interactive mode");
248770
+ }
248771
+ return await deployAction2({
248663
248772
  ...options,
248664
- isNonInteractive: context.isNonInteractive
248665
- }), { requireAuth: true }, context);
248773
+ isNonInteractive: command2.isNonInteractive
248774
+ });
248666
248775
  });
248667
248776
  }
248668
248777
 
@@ -248674,15 +248783,15 @@ async function openAction(isNonInteractive) {
248674
248783
  }
248675
248784
  return { outroMessage: `Site opened at ${siteUrl}` };
248676
248785
  }
248677
- function getSiteOpenCommand(context) {
248678
- return new Command("open").description("Open the published site in your browser").action(async () => {
248679
- await runCommand(() => openAction(context.isNonInteractive), { requireAuth: true }, context);
248786
+ function getSiteOpenCommand() {
248787
+ return new Base44Command("open").description("Open the published site in your browser").action(async (_options, command2) => {
248788
+ return await openAction(command2.isNonInteractive);
248680
248789
  });
248681
248790
  }
248682
248791
 
248683
248792
  // src/cli/commands/site/index.ts
248684
- function getSiteCommand(context) {
248685
- return new Command("site").description("Manage app site (frontend app)").addCommand(getSiteDeployCommand(context)).addCommand(getSiteOpenCommand(context));
248793
+ function getSiteCommand() {
248794
+ return new Command("site").description("Manage app site (frontend app)").addCommand(getSiteDeployCommand()).addCommand(getSiteOpenCommand());
248686
248795
  }
248687
248796
 
248688
248797
  // src/core/types/generator.ts
@@ -248805,15 +248914,13 @@ async function generateTypesAction() {
248805
248914
  outroMessage: tsconfigUpdated ? `Generated ${TYPES_FILE_PATH} and updated tsconfig.json` : `Generated ${TYPES_FILE_PATH}`
248806
248915
  };
248807
248916
  }
248808
- function getTypesGenerateCommand(context) {
248809
- return new Command("generate").description("Generate TypeScript declaration file (types.d.ts) from project resources").action(async () => {
248810
- await runCommand(() => generateTypesAction(), { requireAuth: false }, context);
248811
- });
248917
+ function getTypesGenerateCommand() {
248918
+ return new Base44Command("generate", { requireAuth: false }).description("Generate TypeScript declaration file (types.d.ts) from project resources").action(generateTypesAction);
248812
248919
  }
248813
248920
 
248814
248921
  // src/cli/commands/types/index.ts
248815
- function getTypesCommand(context) {
248816
- return new Command("types").description("Manage TypeScript type generation").addCommand(getTypesGenerateCommand(context));
248922
+ function getTypesCommand() {
248923
+ return new Command("types").description("Manage TypeScript type generation").addCommand(getTypesGenerateCommand());
248817
248924
  }
248818
248925
 
248819
248926
  // src/cli/dev/dev-server/main.ts
@@ -248943,6 +249050,7 @@ var { promisify: promisify11 } = __require("util");
248943
249050
  var tmp = require_tmp();
248944
249051
  var $fileSync = tmp.fileSync;
248945
249052
  var fileWithOptions = promisify11((options8, cb2) => tmp.file(options8, (err, path18, fd, cleanup) => err ? cb2(err) : cb2(undefined, { path: path18, fd, cleanup: promisify11(cleanup) })));
249053
+ var $file = async (options8) => fileWithOptions(options8);
248946
249054
  var $dirSync = tmp.dirSync;
248947
249055
  var dirWithOptions = promisify11((options8, cb2) => tmp.dir(options8, (err, path18, cleanup) => err ? cb2(err) : cb2(undefined, { path: path18, cleanup: promisify11(cleanup) })));
248948
249056
  var $dir = async (options8) => dirWithOptions(options8);
@@ -248975,7 +249083,7 @@ function createDevLogger() {
248975
249083
  }
248976
249084
 
248977
249085
  // src/cli/dev/dev-server/function-manager.ts
248978
- import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
249086
+ import { spawn as spawn2 } from "node:child_process";
248979
249087
  var READY_TIMEOUT = 30000;
248980
249088
 
248981
249089
  class FunctionManager {
@@ -248989,15 +249097,7 @@ class FunctionManager {
248989
249097
  this.logger = logger;
248990
249098
  this.wrapperPath = wrapperPath;
248991
249099
  if (functions.length > 0) {
248992
- this.verifyDenoIsInstalled();
248993
- }
248994
- }
248995
- verifyDenoIsInstalled() {
248996
- const result = spawnSync2("deno", ["--version"]);
248997
- if (result.error) {
248998
- throw new DependencyNotFoundError("Deno is required to run functions", {
248999
- hints: [{ message: "Install Deno from https://deno.com/download" }]
249000
- });
249100
+ verifyDenoInstalled("to run backend functions locally");
249001
249101
  }
249002
249102
  }
249003
249103
  getFunctionNames() {
@@ -251595,9 +251695,94 @@ async function devAction(options8) {
251595
251695
  outroMessage: `Dev server is available at ${theme.colors.links(`http://localhost:${resolvedPort}`)}`
251596
251696
  };
251597
251697
  }
251598
- function getDevCommand(context) {
251599
- return new Command("dev").description("Start the development server").option("-p, --port <number>", "Port for the development server").action(async (options8) => {
251600
- await runCommand(() => devAction(options8), { requireAuth: true }, context);
251698
+ function getDevCommand() {
251699
+ return new Base44Command("dev").description("Start the development server").option("-p, --port <number>", "Port for the development server").action(devAction);
251700
+ }
251701
+
251702
+ // src/core/exec/run-script.ts
251703
+ import { spawn as spawn3 } from "node:child_process";
251704
+ import { copyFileSync, writeFileSync as writeFileSync2 } from "node:fs";
251705
+ async function runScript(options8) {
251706
+ const { appId, code: code2 } = options8;
251707
+ verifyDenoInstalled("to run scripts with exec");
251708
+ const cleanupFns = [];
251709
+ const tempScript = await $file({ postfix: ".ts" });
251710
+ cleanupFns.push(tempScript.cleanup);
251711
+ writeFileSync2(tempScript.path, code2, "utf-8");
251712
+ const scriptPath = `file://${tempScript.path}`;
251713
+ const [appUserToken, appBaseUrl] = await Promise.all([
251714
+ getAppUserToken(),
251715
+ getSiteUrl()
251716
+ ]);
251717
+ const tempWrapper = await $file({ postfix: ".ts" });
251718
+ cleanupFns.push(tempWrapper.cleanup);
251719
+ copyFileSync(getExecWrapperPath(), tempWrapper.path);
251720
+ try {
251721
+ const exitCode = await new Promise((resolvePromise) => {
251722
+ const child = spawn3("deno", ["run", "--allow-all", "--node-modules-dir=auto", tempWrapper.path], {
251723
+ env: {
251724
+ ...process.env,
251725
+ SCRIPT_PATH: scriptPath,
251726
+ BASE44_APP_ID: appId,
251727
+ BASE44_ACCESS_TOKEN: appUserToken,
251728
+ BASE44_APP_BASE_URL: appBaseUrl
251729
+ },
251730
+ stdio: "inherit"
251731
+ });
251732
+ child.on("close", (code3) => {
251733
+ resolvePromise(code3 ?? 1);
251734
+ });
251735
+ });
251736
+ return { exitCode };
251737
+ } finally {
251738
+ for (const cleanup of cleanupFns) {
251739
+ cleanup();
251740
+ }
251741
+ }
251742
+ }
251743
+ // src/cli/commands/exec.ts
251744
+ function readStdin() {
251745
+ return new Promise((resolve8, reject) => {
251746
+ let data = "";
251747
+ process.stdin.setEncoding("utf-8");
251748
+ process.stdin.on("data", (chunk) => {
251749
+ data += chunk;
251750
+ });
251751
+ process.stdin.on("end", () => resolve8(data));
251752
+ process.stdin.on("error", reject);
251753
+ });
251754
+ }
251755
+ async function execAction(isNonInteractive) {
251756
+ const noInputError = new InvalidInputError("No input provided. Pipe a script to stdin.", {
251757
+ hints: [
251758
+ { message: "File: cat ./script.ts | base44 exec" },
251759
+ {
251760
+ message: 'Eval: echo "const users = await base44.entities.User.list(); console.log(users)" | base44 exec'
251761
+ }
251762
+ ]
251763
+ });
251764
+ if (!isNonInteractive) {
251765
+ throw noInputError;
251766
+ }
251767
+ const code2 = await readStdin();
251768
+ if (!code2.trim()) {
251769
+ throw noInputError;
251770
+ }
251771
+ const { exitCode } = await runScript({ appId: getAppConfig().id, code: code2 });
251772
+ if (exitCode !== 0) {
251773
+ process.exitCode = exitCode;
251774
+ }
251775
+ return {};
251776
+ }
251777
+ function getExecCommand() {
251778
+ return new Base44Command("exec").description("Run a script with the Base44 SDK pre-authenticated as the current user").addHelpText("after", `
251779
+ Examples:
251780
+ Run a script file:
251781
+ $ cat ./script.ts | base44 exec
251782
+
251783
+ Inline script:
251784
+ $ echo "const users = await base44.entities.User.list()" | base44 exec`).action(async (_options, command2) => {
251785
+ return await execAction(command2.isNonInteractive);
251601
251786
  });
251602
251787
  }
251603
251788
 
@@ -251689,9 +251874,18 @@ async function eject(options8) {
251689
251874
  }
251690
251875
  return { outroMessage: "Your new project is set and ready to use" };
251691
251876
  }
251692
- function getEjectCommand(context) {
251693
- return new Command("eject").description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(async (options8) => {
251694
- await runCommand(() => eject({ ...options8, isNonInteractive: context.isNonInteractive }), { requireAuth: true, requireAppConfig: false }, context);
251877
+ function getEjectCommand() {
251878
+ return new Base44Command("eject", { requireAppConfig: false }).description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(async (options8, command2) => {
251879
+ if (command2.isNonInteractive && !options8.projectId) {
251880
+ throw new InvalidInputError("--project-id is required in non-interactive mode");
251881
+ }
251882
+ if (command2.isNonInteractive && !options8.path) {
251883
+ throw new InvalidInputError("--path is required in non-interactive mode");
251884
+ }
251885
+ return await eject({
251886
+ ...options8,
251887
+ isNonInteractive: command2.isNonInteractive
251888
+ });
251695
251889
  });
251696
251890
  }
251697
251891
 
@@ -251702,23 +251896,29 @@ function createProgram(context) {
251702
251896
  program2.configureHelp({
251703
251897
  sortSubcommands: true
251704
251898
  });
251705
- program2.addCommand(getLoginCommand(context));
251706
- program2.addCommand(getWhoamiCommand(context));
251707
- program2.addCommand(getLogoutCommand(context));
251708
- program2.addCommand(getCreateCommand(context));
251709
- program2.addCommand(getDashboardCommand(context));
251710
- program2.addCommand(getDeployCommand2(context));
251711
- program2.addCommand(getLinkCommand(context));
251712
- program2.addCommand(getEjectCommand(context));
251713
- program2.addCommand(getEntitiesPushCommand(context));
251714
- program2.addCommand(getAgentsCommand(context));
251715
- program2.addCommand(getConnectorsCommand(context));
251716
- program2.addCommand(getFunctionsCommand(context));
251717
- program2.addCommand(getSecretsCommand(context));
251718
- program2.addCommand(getSiteCommand(context));
251719
- program2.addCommand(getTypesCommand(context));
251720
- program2.addCommand(getDevCommand(context), { hidden: true });
251721
- program2.addCommand(getLogsCommand(context), { hidden: true });
251899
+ program2.hook("preAction", (_10, actionCommand) => {
251900
+ if (actionCommand instanceof Base44Command) {
251901
+ actionCommand.setContext(context);
251902
+ }
251903
+ });
251904
+ program2.addCommand(getLoginCommand());
251905
+ program2.addCommand(getWhoamiCommand());
251906
+ program2.addCommand(getLogoutCommand());
251907
+ program2.addCommand(getCreateCommand());
251908
+ program2.addCommand(getDashboardCommand());
251909
+ program2.addCommand(getDeployCommand2());
251910
+ program2.addCommand(getLinkCommand());
251911
+ program2.addCommand(getEjectCommand());
251912
+ program2.addCommand(getEntitiesPushCommand());
251913
+ program2.addCommand(getAgentsCommand());
251914
+ program2.addCommand(getConnectorsCommand());
251915
+ program2.addCommand(getFunctionsCommand());
251916
+ program2.addCommand(getSecretsCommand());
251917
+ program2.addCommand(getSiteCommand());
251918
+ program2.addCommand(getTypesCommand());
251919
+ program2.addCommand(getExecCommand());
251920
+ program2.addCommand(getDevCommand(), { hidden: true });
251921
+ program2.addCommand(getLogsCommand(), { hidden: true });
251722
251922
  return program2;
251723
251923
  }
251724
251924
 
@@ -255834,7 +256034,7 @@ class ErrorReporter {
255834
256034
  return this.context.user?.email ?? `anon-${this.sessionId}`;
255835
256035
  }
255836
256036
  buildProperties(error48) {
255837
- const { user, command, appId } = this.context;
256037
+ const { user, command: command2, appId } = this.context;
255838
256038
  const errorCode = error48 && isCLIError(error48) ? error48.code : undefined;
255839
256039
  const userError = error48 ? isUserError(error48) : undefined;
255840
256040
  const apiProps = error48 instanceof ApiError ? {
@@ -255850,9 +256050,9 @@ class ErrorReporter {
255850
256050
  session_started_at: this.sessionStartedAt.toISOString(),
255851
256051
  execution_duration_ms: Date.now() - this.sessionStartedAt.getTime(),
255852
256052
  ...user && { $set: { email: user.email, name: user.name } },
255853
- command_name: command?.name,
255854
- command_args: command?.args,
255855
- command_options: command?.options,
256053
+ command_name: command2?.name,
256054
+ command_args: command2?.args,
256055
+ command_options: command2?.options,
255856
256056
  app_id: appId,
255857
256057
  ...errorCode !== undefined && {
255858
256058
  error_code: errorCode,
@@ -255900,9 +256100,9 @@ class ErrorReporter {
255900
256100
  }
255901
256101
 
255902
256102
  // src/cli/telemetry/commander-hooks.ts
255903
- function getFullCommandName(command) {
256103
+ function getFullCommandName(command2) {
255904
256104
  const parts = [];
255905
- let current = command;
256105
+ let current = command2;
255906
256106
  while (current) {
255907
256107
  const name2 = current.name();
255908
256108
  if (current.parent) {
@@ -255960,6 +256160,6 @@ export {
255960
256160
  CLIExitError
255961
256161
  };
255962
256162
 
255963
- //# debugId=3E5EB4969FCF055864756E2164756E21
256163
+ //# debugId=3FB5B8D24B78E00F64756E2164756E21
255964
256164
 
255965
- //# chunkId=019cf669-df28-7e60-8dfa-54f6d79055c0
256165
+ //# chunkId=019d016f-610c-7b02-aa0c-f97344c92bec