@base44-preview/cli 0.0.9-pr.74.f76e562 → 0.0.9-pr.75.b644c97

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.
Files changed (2) hide show
  1. package/dist/cli/index.js +664 -643
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -5,11 +5,12 @@ import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
5
5
  import path, { basename, dirname, join, posix, resolve, win32 } from "node:path";
6
6
  import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
7
7
  import y, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
8
+ import os, { constants, homedir, tmpdir } from "node:os";
9
+ import tty from "node:tty";
8
10
  import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
9
11
  import * as g from "node:readline";
10
12
  import O from "node:readline";
11
13
  import Stream, { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark } from "node:stream";
12
- import os, { constants, homedir, tmpdir } from "node:os";
13
14
  import { fileURLToPath } from "node:url";
14
15
  import fs$1 from "fs";
15
16
  import path$1, { dirname as dirname$1, parse } from "path";
@@ -17,7 +18,6 @@ import { finished } from "node:stream/promises";
17
18
  import EE, { EventEmitter as EventEmitter$1 } from "events";
18
19
  import fsPromises, { access, copyFile, mkdir, readFile, unlink, writeFile } from "node:fs/promises";
19
20
  import { Buffer as Buffer$1 } from "buffer";
20
- import tty from "node:tty";
21
21
  import { randomBytes, randomUUID } from "node:crypto";
22
22
  import { StringDecoder } from "node:string_decoder";
23
23
  import assert from "assert";
@@ -2705,6 +2705,415 @@ var require_commander = /* @__PURE__ */ __commonJSMin(((exports) => {
2705
2705
  var import_commander = /* @__PURE__ */ __toESM(require_commander(), 1);
2706
2706
  const { program: program$1, createCommand: createCommand$1, createArgument, createOption, CommanderError, InvalidArgumentError, InvalidOptionArgumentError, Command, Argument, Option, Help } = import_commander.default;
2707
2707
 
2708
+ //#endregion
2709
+ //#region node_modules/chalk/source/vendor/ansi-styles/index.js
2710
+ const ANSI_BACKGROUND_OFFSET = 10;
2711
+ const wrapAnsi16 = (offset = 0) => (code$1) => `\u001B[${code$1 + offset}m`;
2712
+ const wrapAnsi256 = (offset = 0) => (code$1) => `\u001B[${38 + offset};5;${code$1}m`;
2713
+ const wrapAnsi16m = (offset = 0) => (red$1, green$1, blue$1) => `\u001B[${38 + offset};2;${red$1};${green$1};${blue$1}m`;
2714
+ const styles$1 = {
2715
+ modifier: {
2716
+ reset: [0, 0],
2717
+ bold: [1, 22],
2718
+ dim: [2, 22],
2719
+ italic: [3, 23],
2720
+ underline: [4, 24],
2721
+ overline: [53, 55],
2722
+ inverse: [7, 27],
2723
+ hidden: [8, 28],
2724
+ strikethrough: [9, 29]
2725
+ },
2726
+ color: {
2727
+ black: [30, 39],
2728
+ red: [31, 39],
2729
+ green: [32, 39],
2730
+ yellow: [33, 39],
2731
+ blue: [34, 39],
2732
+ magenta: [35, 39],
2733
+ cyan: [36, 39],
2734
+ white: [37, 39],
2735
+ blackBright: [90, 39],
2736
+ gray: [90, 39],
2737
+ grey: [90, 39],
2738
+ redBright: [91, 39],
2739
+ greenBright: [92, 39],
2740
+ yellowBright: [93, 39],
2741
+ blueBright: [94, 39],
2742
+ magentaBright: [95, 39],
2743
+ cyanBright: [96, 39],
2744
+ whiteBright: [97, 39]
2745
+ },
2746
+ bgColor: {
2747
+ bgBlack: [40, 49],
2748
+ bgRed: [41, 49],
2749
+ bgGreen: [42, 49],
2750
+ bgYellow: [43, 49],
2751
+ bgBlue: [44, 49],
2752
+ bgMagenta: [45, 49],
2753
+ bgCyan: [46, 49],
2754
+ bgWhite: [47, 49],
2755
+ bgBlackBright: [100, 49],
2756
+ bgGray: [100, 49],
2757
+ bgGrey: [100, 49],
2758
+ bgRedBright: [101, 49],
2759
+ bgGreenBright: [102, 49],
2760
+ bgYellowBright: [103, 49],
2761
+ bgBlueBright: [104, 49],
2762
+ bgMagentaBright: [105, 49],
2763
+ bgCyanBright: [106, 49],
2764
+ bgWhiteBright: [107, 49]
2765
+ }
2766
+ };
2767
+ const modifierNames = Object.keys(styles$1.modifier);
2768
+ const foregroundColorNames = Object.keys(styles$1.color);
2769
+ const backgroundColorNames = Object.keys(styles$1.bgColor);
2770
+ const colorNames = [...foregroundColorNames, ...backgroundColorNames];
2771
+ function assembleStyles() {
2772
+ const codes = /* @__PURE__ */ new Map();
2773
+ for (const [groupName, group] of Object.entries(styles$1)) {
2774
+ for (const [styleName, style] of Object.entries(group)) {
2775
+ styles$1[styleName] = {
2776
+ open: `\u001B[${style[0]}m`,
2777
+ close: `\u001B[${style[1]}m`
2778
+ };
2779
+ group[styleName] = styles$1[styleName];
2780
+ codes.set(style[0], style[1]);
2781
+ }
2782
+ Object.defineProperty(styles$1, groupName, {
2783
+ value: group,
2784
+ enumerable: false
2785
+ });
2786
+ }
2787
+ Object.defineProperty(styles$1, "codes", {
2788
+ value: codes,
2789
+ enumerable: false
2790
+ });
2791
+ styles$1.color.close = "\x1B[39m";
2792
+ styles$1.bgColor.close = "\x1B[49m";
2793
+ styles$1.color.ansi = wrapAnsi16();
2794
+ styles$1.color.ansi256 = wrapAnsi256();
2795
+ styles$1.color.ansi16m = wrapAnsi16m();
2796
+ styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
2797
+ styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
2798
+ styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
2799
+ Object.defineProperties(styles$1, {
2800
+ rgbToAnsi256: {
2801
+ value(red$1, green$1, blue$1) {
2802
+ if (red$1 === green$1 && green$1 === blue$1) {
2803
+ if (red$1 < 8) return 16;
2804
+ if (red$1 > 248) return 231;
2805
+ return Math.round((red$1 - 8) / 247 * 24) + 232;
2806
+ }
2807
+ return 16 + 36 * Math.round(red$1 / 255 * 5) + 6 * Math.round(green$1 / 255 * 5) + Math.round(blue$1 / 255 * 5);
2808
+ },
2809
+ enumerable: false
2810
+ },
2811
+ hexToRgb: {
2812
+ value(hex) {
2813
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
2814
+ if (!matches) return [
2815
+ 0,
2816
+ 0,
2817
+ 0
2818
+ ];
2819
+ let [colorString] = matches;
2820
+ if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
2821
+ const integer$1 = Number.parseInt(colorString, 16);
2822
+ return [
2823
+ integer$1 >> 16 & 255,
2824
+ integer$1 >> 8 & 255,
2825
+ integer$1 & 255
2826
+ ];
2827
+ },
2828
+ enumerable: false
2829
+ },
2830
+ hexToAnsi256: {
2831
+ value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
2832
+ enumerable: false
2833
+ },
2834
+ ansi256ToAnsi: {
2835
+ value(code$1) {
2836
+ if (code$1 < 8) return 30 + code$1;
2837
+ if (code$1 < 16) return 90 + (code$1 - 8);
2838
+ let red$1;
2839
+ let green$1;
2840
+ let blue$1;
2841
+ if (code$1 >= 232) {
2842
+ red$1 = ((code$1 - 232) * 10 + 8) / 255;
2843
+ green$1 = red$1;
2844
+ blue$1 = red$1;
2845
+ } else {
2846
+ code$1 -= 16;
2847
+ const remainder = code$1 % 36;
2848
+ red$1 = Math.floor(code$1 / 36) / 5;
2849
+ green$1 = Math.floor(remainder / 6) / 5;
2850
+ blue$1 = remainder % 6 / 5;
2851
+ }
2852
+ const value = Math.max(red$1, green$1, blue$1) * 2;
2853
+ if (value === 0) return 30;
2854
+ let result = 30 + (Math.round(blue$1) << 2 | Math.round(green$1) << 1 | Math.round(red$1));
2855
+ if (value === 2) result += 60;
2856
+ return result;
2857
+ },
2858
+ enumerable: false
2859
+ },
2860
+ rgbToAnsi: {
2861
+ value: (red$1, green$1, blue$1) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red$1, green$1, blue$1)),
2862
+ enumerable: false
2863
+ },
2864
+ hexToAnsi: {
2865
+ value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
2866
+ enumerable: false
2867
+ }
2868
+ });
2869
+ return styles$1;
2870
+ }
2871
+ const ansiStyles = assembleStyles();
2872
+ var ansi_styles_default = ansiStyles;
2873
+
2874
+ //#endregion
2875
+ //#region node_modules/chalk/source/vendor/supports-color/index.js
2876
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
2877
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
2878
+ const position = argv.indexOf(prefix + flag);
2879
+ const terminatorPosition = argv.indexOf("--");
2880
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
2881
+ }
2882
+ const { env } = y;
2883
+ let flagForceColor;
2884
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
2885
+ else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
2886
+ function envForceColor() {
2887
+ if ("FORCE_COLOR" in env) {
2888
+ if (env.FORCE_COLOR === "true") return 1;
2889
+ if (env.FORCE_COLOR === "false") return 0;
2890
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
2891
+ }
2892
+ }
2893
+ function translateLevel(level) {
2894
+ if (level === 0) return false;
2895
+ return {
2896
+ level,
2897
+ hasBasic: true,
2898
+ has256: level >= 2,
2899
+ has16m: level >= 3
2900
+ };
2901
+ }
2902
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
2903
+ const noFlagForceColor = envForceColor();
2904
+ if (noFlagForceColor !== void 0) flagForceColor = noFlagForceColor;
2905
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
2906
+ if (forceColor === 0) return 0;
2907
+ if (sniffFlags) {
2908
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
2909
+ if (hasFlag("color=256")) return 2;
2910
+ }
2911
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) return 1;
2912
+ if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
2913
+ const min = forceColor || 0;
2914
+ if (env.TERM === "dumb") return min;
2915
+ if (y.platform === "win32") {
2916
+ const osRelease = os.release().split(".");
2917
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
2918
+ return 1;
2919
+ }
2920
+ if ("CI" in env) {
2921
+ if ([
2922
+ "GITHUB_ACTIONS",
2923
+ "GITEA_ACTIONS",
2924
+ "CIRCLECI"
2925
+ ].some((key) => key in env)) return 3;
2926
+ if ([
2927
+ "TRAVIS",
2928
+ "APPVEYOR",
2929
+ "GITLAB_CI",
2930
+ "BUILDKITE",
2931
+ "DRONE"
2932
+ ].some((sign) => sign in env) || env.CI_NAME === "codeship") return 1;
2933
+ return min;
2934
+ }
2935
+ if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
2936
+ if (env.COLORTERM === "truecolor") return 3;
2937
+ if (env.TERM === "xterm-kitty") return 3;
2938
+ if (env.TERM === "xterm-ghostty") return 3;
2939
+ if (env.TERM === "wezterm") return 3;
2940
+ if ("TERM_PROGRAM" in env) {
2941
+ const version$2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
2942
+ switch (env.TERM_PROGRAM) {
2943
+ case "iTerm.app": return version$2 >= 3 ? 3 : 2;
2944
+ case "Apple_Terminal": return 2;
2945
+ }
2946
+ }
2947
+ if (/-256(color)?$/i.test(env.TERM)) return 2;
2948
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
2949
+ if ("COLORTERM" in env) return 1;
2950
+ return min;
2951
+ }
2952
+ function createSupportsColor(stream, options = {}) {
2953
+ return translateLevel(_supportsColor(stream, {
2954
+ streamIsTTY: stream && stream.isTTY,
2955
+ ...options
2956
+ }));
2957
+ }
2958
+ const supportsColor = {
2959
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
2960
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
2961
+ };
2962
+ var supports_color_default = supportsColor;
2963
+
2964
+ //#endregion
2965
+ //#region node_modules/chalk/source/utilities.js
2966
+ function stringReplaceAll(string$2, substring, replacer) {
2967
+ let index = string$2.indexOf(substring);
2968
+ if (index === -1) return string$2;
2969
+ const substringLength = substring.length;
2970
+ let endIndex = 0;
2971
+ let returnValue = "";
2972
+ do {
2973
+ returnValue += string$2.slice(endIndex, index) + substring + replacer;
2974
+ endIndex = index + substringLength;
2975
+ index = string$2.indexOf(substring, endIndex);
2976
+ } while (index !== -1);
2977
+ returnValue += string$2.slice(endIndex);
2978
+ return returnValue;
2979
+ }
2980
+ function stringEncaseCRLFWithFirstIndex(string$2, prefix, postfix, index) {
2981
+ let endIndex = 0;
2982
+ let returnValue = "";
2983
+ do {
2984
+ const gotCR = string$2[index - 1] === "\r";
2985
+ returnValue += string$2.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
2986
+ endIndex = index + 1;
2987
+ index = string$2.indexOf("\n", endIndex);
2988
+ } while (index !== -1);
2989
+ returnValue += string$2.slice(endIndex);
2990
+ return returnValue;
2991
+ }
2992
+
2993
+ //#endregion
2994
+ //#region node_modules/chalk/source/index.js
2995
+ const { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
2996
+ const GENERATOR = Symbol("GENERATOR");
2997
+ const STYLER = Symbol("STYLER");
2998
+ const IS_EMPTY = Symbol("IS_EMPTY");
2999
+ const levelMapping = [
3000
+ "ansi",
3001
+ "ansi",
3002
+ "ansi256",
3003
+ "ansi16m"
3004
+ ];
3005
+ const styles = Object.create(null);
3006
+ const applyOptions = (object$1, options = {}) => {
3007
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
3008
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
3009
+ object$1.level = options.level === void 0 ? colorLevel : options.level;
3010
+ };
3011
+ const chalkFactory = (options) => {
3012
+ const chalk$1 = (...strings) => strings.join(" ");
3013
+ applyOptions(chalk$1, options);
3014
+ Object.setPrototypeOf(chalk$1, createChalk.prototype);
3015
+ return chalk$1;
3016
+ };
3017
+ function createChalk(options) {
3018
+ return chalkFactory(options);
3019
+ }
3020
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
3021
+ for (const [styleName, style] of Object.entries(ansi_styles_default)) styles[styleName] = { get() {
3022
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
3023
+ Object.defineProperty(this, styleName, { value: builder });
3024
+ return builder;
3025
+ } };
3026
+ styles.visible = { get() {
3027
+ const builder = createBuilder(this, this[STYLER], true);
3028
+ Object.defineProperty(this, "visible", { value: builder });
3029
+ return builder;
3030
+ } };
3031
+ const getModelAnsi = (model, level, type, ...arguments_) => {
3032
+ if (model === "rgb") {
3033
+ if (level === "ansi16m") return ansi_styles_default[type].ansi16m(...arguments_);
3034
+ if (level === "ansi256") return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
3035
+ return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
3036
+ }
3037
+ if (model === "hex") return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
3038
+ return ansi_styles_default[type][model](...arguments_);
3039
+ };
3040
+ for (const model of [
3041
+ "rgb",
3042
+ "hex",
3043
+ "ansi256"
3044
+ ]) {
3045
+ styles[model] = { get() {
3046
+ const { level } = this;
3047
+ return function(...arguments_) {
3048
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
3049
+ return createBuilder(this, styler, this[IS_EMPTY]);
3050
+ };
3051
+ } };
3052
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
3053
+ styles[bgModel] = { get() {
3054
+ const { level } = this;
3055
+ return function(...arguments_) {
3056
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
3057
+ return createBuilder(this, styler, this[IS_EMPTY]);
3058
+ };
3059
+ } };
3060
+ }
3061
+ const proto = Object.defineProperties(() => {}, {
3062
+ ...styles,
3063
+ level: {
3064
+ enumerable: true,
3065
+ get() {
3066
+ return this[GENERATOR].level;
3067
+ },
3068
+ set(level) {
3069
+ this[GENERATOR].level = level;
3070
+ }
3071
+ }
3072
+ });
3073
+ const createStyler = (open, close, parent) => {
3074
+ let openAll;
3075
+ let closeAll;
3076
+ if (parent === void 0) {
3077
+ openAll = open;
3078
+ closeAll = close;
3079
+ } else {
3080
+ openAll = parent.openAll + open;
3081
+ closeAll = close + parent.closeAll;
3082
+ }
3083
+ return {
3084
+ open,
3085
+ close,
3086
+ openAll,
3087
+ closeAll,
3088
+ parent
3089
+ };
3090
+ };
3091
+ const createBuilder = (self$1, _styler, _isEmpty) => {
3092
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
3093
+ Object.setPrototypeOf(builder, proto);
3094
+ builder[GENERATOR] = self$1;
3095
+ builder[STYLER] = _styler;
3096
+ builder[IS_EMPTY] = _isEmpty;
3097
+ return builder;
3098
+ };
3099
+ const applyStyle = (self$1, string$2) => {
3100
+ if (self$1.level <= 0 || !string$2) return self$1[IS_EMPTY] ? "" : string$2;
3101
+ let styler = self$1[STYLER];
3102
+ if (styler === void 0) return string$2;
3103
+ const { openAll, closeAll } = styler;
3104
+ if (string$2.includes("\x1B")) while (styler !== void 0) {
3105
+ string$2 = stringReplaceAll(string$2, styler.close, styler.open);
3106
+ styler = styler.parent;
3107
+ }
3108
+ const lfIndex = string$2.indexOf("\n");
3109
+ if (lfIndex !== -1) string$2 = stringEncaseCRLFWithFirstIndex(string$2, closeAll, openAll, lfIndex);
3110
+ return openAll + string$2 + closeAll;
3111
+ };
3112
+ Object.defineProperties(createChalk.prototype, styles);
3113
+ const chalk = createChalk();
3114
+ const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
3115
+ var source_default = chalk;
3116
+
2708
3117
  //#endregion
2709
3118
  //#region node_modules/sisteransi/src/index.js
2710
3119
  var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -4547,7 +4956,6 @@ const string$1 = (params) => {
4547
4956
  };
4548
4957
  const integer = /^-?\d+$/;
4549
4958
  const number$1 = /^-?\d+(?:\.\d+)?$/;
4550
- const boolean$1 = /^(?:true|false)$/i;
4551
4959
  const lowercase = /^[^A-Z]*$/;
4552
4960
  const uppercase = /^[^a-z]*$/;
4553
4961
 
@@ -5326,24 +5734,6 @@ const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst,
5326
5734
  $ZodCheckNumberFormat.init(inst, def);
5327
5735
  $ZodNumber.init(inst, def);
5328
5736
  });
5329
- const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
5330
- $ZodType.init(inst, def);
5331
- inst._zod.pattern = boolean$1;
5332
- inst._zod.parse = (payload, _ctx) => {
5333
- if (def.coerce) try {
5334
- payload.value = Boolean(payload.value);
5335
- } catch (_$2) {}
5336
- const input = payload.value;
5337
- if (typeof input === "boolean") return payload;
5338
- payload.issues.push({
5339
- expected: "boolean",
5340
- code: "invalid_type",
5341
- input,
5342
- inst
5343
- });
5344
- return payload;
5345
- };
5346
- });
5347
5737
  const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
5348
5738
  $ZodType.init(inst, def);
5349
5739
  inst._zod.parse = (payload) => payload;
@@ -5649,61 +6039,6 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
5649
6039
  });
5650
6040
  };
5651
6041
  });
5652
- const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
5653
- def.inclusive = false;
5654
- $ZodUnion.init(inst, def);
5655
- const _super = inst._zod.parse;
5656
- defineLazy(inst._zod, "propValues", () => {
5657
- const propValues = {};
5658
- for (const option of def.options) {
5659
- const pv = option._zod.propValues;
5660
- if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
5661
- for (const [k$2, v$1] of Object.entries(pv)) {
5662
- if (!propValues[k$2]) propValues[k$2] = /* @__PURE__ */ new Set();
5663
- for (const val of v$1) propValues[k$2].add(val);
5664
- }
5665
- }
5666
- return propValues;
5667
- });
5668
- const disc = cached(() => {
5669
- const opts = def.options;
5670
- const map = /* @__PURE__ */ new Map();
5671
- for (const o$2 of opts) {
5672
- const values = o$2._zod.propValues?.[def.discriminator];
5673
- if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o$2)}"`);
5674
- for (const v$1 of values) {
5675
- if (map.has(v$1)) throw new Error(`Duplicate discriminator value "${String(v$1)}"`);
5676
- map.set(v$1, o$2);
5677
- }
5678
- }
5679
- return map;
5680
- });
5681
- inst._zod.parse = (payload, ctx) => {
5682
- const input = payload.value;
5683
- if (!isObject$2(input)) {
5684
- payload.issues.push({
5685
- code: "invalid_type",
5686
- expected: "object",
5687
- input,
5688
- inst
5689
- });
5690
- return payload;
5691
- }
5692
- const opt = disc.value.get(input?.[def.discriminator]);
5693
- if (opt) return opt._zod.run(payload, ctx);
5694
- if (def.unionFallback) return _super(payload, ctx);
5695
- payload.issues.push({
5696
- code: "invalid_union",
5697
- errors: [],
5698
- note: "No matching discriminator",
5699
- discriminator: def.discriminator,
5700
- input,
5701
- path: [def.discriminator],
5702
- inst
5703
- });
5704
- return payload;
5705
- };
5706
- });
5707
6042
  const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
5708
6043
  $ZodType.init(inst, def);
5709
6044
  inst._zod.parse = (payload, ctx) => {
@@ -5803,6 +6138,77 @@ function handleIntersectionResults(result, left, right) {
5803
6138
  result.value = merged.data;
5804
6139
  return result;
5805
6140
  }
6141
+ const $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
6142
+ $ZodType.init(inst, def);
6143
+ const items = def.items;
6144
+ inst._zod.parse = (payload, ctx) => {
6145
+ const input = payload.value;
6146
+ if (!Array.isArray(input)) {
6147
+ payload.issues.push({
6148
+ input,
6149
+ inst,
6150
+ expected: "tuple",
6151
+ code: "invalid_type"
6152
+ });
6153
+ return payload;
6154
+ }
6155
+ payload.value = [];
6156
+ const proms = [];
6157
+ const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
6158
+ const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;
6159
+ if (!def.rest) {
6160
+ const tooBig = input.length > items.length;
6161
+ const tooSmall = input.length < optStart - 1;
6162
+ if (tooBig || tooSmall) {
6163
+ payload.issues.push({
6164
+ ...tooBig ? {
6165
+ code: "too_big",
6166
+ maximum: items.length,
6167
+ inclusive: true
6168
+ } : {
6169
+ code: "too_small",
6170
+ minimum: items.length
6171
+ },
6172
+ input,
6173
+ inst,
6174
+ origin: "array"
6175
+ });
6176
+ return payload;
6177
+ }
6178
+ }
6179
+ let i$1 = -1;
6180
+ for (const item of items) {
6181
+ i$1++;
6182
+ if (i$1 >= input.length) {
6183
+ if (i$1 >= optStart) continue;
6184
+ }
6185
+ const result = item._zod.run({
6186
+ value: input[i$1],
6187
+ issues: []
6188
+ }, ctx);
6189
+ if (result instanceof Promise) proms.push(result.then((result$1) => handleTupleResult(result$1, payload, i$1)));
6190
+ else handleTupleResult(result, payload, i$1);
6191
+ }
6192
+ if (def.rest) {
6193
+ const rest = input.slice(items.length);
6194
+ for (const el of rest) {
6195
+ i$1++;
6196
+ const result = def.rest._zod.run({
6197
+ value: el,
6198
+ issues: []
6199
+ }, ctx);
6200
+ if (result instanceof Promise) proms.push(result.then((result$1) => handleTupleResult(result$1, payload, i$1)));
6201
+ else handleTupleResult(result, payload, i$1);
6202
+ }
6203
+ }
6204
+ if (proms.length) return Promise.all(proms).then(() => payload);
6205
+ return payload;
6206
+ };
6207
+ });
6208
+ function handleTupleResult(result, final, index) {
6209
+ if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
6210
+ final.value[index] = result.value;
6211
+ }
5806
6212
  const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
5807
6213
  $ZodType.init(inst, def);
5808
6214
  const values = getEnumValues(def.entries);
@@ -5821,24 +6227,6 @@ const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
5821
6227
  return payload;
5822
6228
  };
5823
6229
  });
5824
- const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
5825
- $ZodType.init(inst, def);
5826
- if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
5827
- const values = new Set(def.values);
5828
- inst._zod.values = values;
5829
- inst._zod.pattern = /* @__PURE__ */ new RegExp(`^(${def.values.map((o$2) => typeof o$2 === "string" ? escapeRegex(o$2) : o$2 ? escapeRegex(o$2.toString()) : String(o$2)).join("|")})$`);
5830
- inst._zod.parse = (payload, _ctx) => {
5831
- const input = payload.value;
5832
- if (values.has(input)) return payload;
5833
- payload.issues.push({
5834
- code: "invalid_value",
5835
- values: def.values,
5836
- input,
5837
- inst
5838
- });
5839
- return payload;
5840
- };
5841
- });
5842
6230
  const $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
5843
6231
  $ZodType.init(inst, def);
5844
6232
  inst._zod.parse = (payload, ctx) => {
@@ -6400,13 +6788,6 @@ function _int(Class, params) {
6400
6788
  });
6401
6789
  }
6402
6790
  /* @__NO_SIDE_EFFECTS__ */
6403
- function _boolean(Class, params) {
6404
- return new Class({
6405
- type: "boolean",
6406
- ...normalizeParams(params)
6407
- });
6408
- }
6409
- /* @__NO_SIDE_EFFECTS__ */
6410
6791
  function _unknown(Class) {
6411
6792
  return new Class({ type: "unknown" });
6412
6793
  }
@@ -6977,9 +7358,6 @@ const numberProcessor = (schema, ctx, _json, _params) => {
6977
7358
  }
6978
7359
  if (typeof multipleOf === "number") json.multipleOf = multipleOf;
6979
7360
  };
6980
- const booleanProcessor = (_schema, _ctx, json, _params) => {
6981
- json.type = "boolean";
6982
- };
6983
7361
  const neverProcessor = (_schema, _ctx, json, _params) => {
6984
7362
  json.not = {};
6985
7363
  };
@@ -6991,27 +7369,6 @@ const enumProcessor = (schema, _ctx, json, _params) => {
6991
7369
  if (values.every((v$1) => typeof v$1 === "string")) json.type = "string";
6992
7370
  json.enum = values;
6993
7371
  };
6994
- const literalProcessor = (schema, ctx, json, _params) => {
6995
- const def = schema._zod.def;
6996
- const vals = [];
6997
- for (const val of def.values) if (val === void 0) {
6998
- if (ctx.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema");
6999
- } else if (typeof val === "bigint") if (ctx.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema");
7000
- else vals.push(Number(val));
7001
- else vals.push(val);
7002
- if (vals.length === 0) {} else if (vals.length === 1) {
7003
- const val = vals[0];
7004
- json.type = val === null ? "null" : typeof val;
7005
- if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") json.enum = [val];
7006
- else json.const = val;
7007
- } else {
7008
- if (vals.every((v$1) => typeof v$1 === "number")) json.type = "number";
7009
- if (vals.every((v$1) => typeof v$1 === "string")) json.type = "string";
7010
- if (vals.every((v$1) => typeof v$1 === "boolean")) json.type = "boolean";
7011
- if (vals.every((v$1) => v$1 === null)) json.type = "null";
7012
- json.enum = vals;
7013
- }
7014
- };
7015
7372
  const customProcessor = (_schema, ctx, _json, _params) => {
7016
7373
  if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
7017
7374
  };
@@ -7094,6 +7451,44 @@ const intersectionProcessor = (schema, ctx, json, params) => {
7094
7451
  const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
7095
7452
  json.allOf = [...isSimpleIntersection(a$1) ? a$1.allOf : [a$1], ...isSimpleIntersection(b$2) ? b$2.allOf : [b$2]];
7096
7453
  };
7454
+ const tupleProcessor = (schema, ctx, _json, params) => {
7455
+ const json = _json;
7456
+ const def = schema._zod.def;
7457
+ json.type = "array";
7458
+ const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
7459
+ const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
7460
+ const prefixItems = def.items.map((x$2, i$1) => process$2(x$2, ctx, {
7461
+ ...params,
7462
+ path: [
7463
+ ...params.path,
7464
+ prefixPath$1,
7465
+ i$1
7466
+ ]
7467
+ }));
7468
+ const rest = def.rest ? process$2(def.rest, ctx, {
7469
+ ...params,
7470
+ path: [
7471
+ ...params.path,
7472
+ restPath,
7473
+ ...ctx.target === "openapi-3.0" ? [def.items.length] : []
7474
+ ]
7475
+ }) : null;
7476
+ if (ctx.target === "draft-2020-12") {
7477
+ json.prefixItems = prefixItems;
7478
+ if (rest) json.items = rest;
7479
+ } else if (ctx.target === "openapi-3.0") {
7480
+ json.items = { anyOf: prefixItems };
7481
+ if (rest) json.items.anyOf.push(rest);
7482
+ json.minItems = prefixItems.length;
7483
+ if (!rest) json.maxItems = prefixItems.length;
7484
+ } else {
7485
+ json.items = prefixItems;
7486
+ if (rest) json.additionalItems = rest;
7487
+ }
7488
+ const { minimum, maximum } = schema._zod.bag;
7489
+ if (typeof minimum === "number") json.minItems = minimum;
7490
+ if (typeof maximum === "number") json.maxItems = maximum;
7491
+ };
7097
7492
  const nullableProcessor = (schema, ctx, json, params) => {
7098
7493
  const def = schema._zod.def;
7099
7494
  const inner = process$2(def.innerType, ctx, params);
@@ -7486,14 +7881,6 @@ const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, d
7486
7881
  function int(params) {
7487
7882
  return _int(ZodNumberFormat, params);
7488
7883
  }
7489
- const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
7490
- $ZodBoolean.init(inst, def);
7491
- ZodType.init(inst, def);
7492
- inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
7493
- });
7494
- function boolean(params) {
7495
- return _boolean(ZodBoolean, params);
7496
- }
7497
7884
  const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
7498
7885
  $ZodUnknown.init(inst, def);
7499
7886
  ZodType.init(inst, def);
@@ -7592,18 +7979,6 @@ function union(options, params) {
7592
7979
  ...normalizeParams(params)
7593
7980
  });
7594
7981
  }
7595
- const ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => {
7596
- ZodUnion.init(inst, def);
7597
- $ZodDiscriminatedUnion.init(inst, def);
7598
- });
7599
- function discriminatedUnion(discriminator, options, params) {
7600
- return new ZodDiscriminatedUnion({
7601
- type: "union",
7602
- options,
7603
- discriminator,
7604
- ...normalizeParams(params)
7605
- });
7606
- }
7607
7982
  const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
7608
7983
  $ZodIntersection.init(inst, def);
7609
7984
  ZodType.init(inst, def);
@@ -7616,6 +7991,25 @@ function intersection(left, right) {
7616
7991
  right
7617
7992
  });
7618
7993
  }
7994
+ const ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
7995
+ $ZodTuple.init(inst, def);
7996
+ ZodType.init(inst, def);
7997
+ inst._zod.processJSONSchema = (ctx, json, params) => tupleProcessor(inst, ctx, json, params);
7998
+ inst.rest = (rest) => inst.clone({
7999
+ ...inst._zod.def,
8000
+ rest
8001
+ });
8002
+ });
8003
+ function tuple(items, _paramsOrRest, _params) {
8004
+ const hasRest = _paramsOrRest instanceof $ZodType;
8005
+ const params = hasRest ? _params : _paramsOrRest;
8006
+ return new ZodTuple({
8007
+ type: "tuple",
8008
+ items,
8009
+ rest: hasRest ? _paramsOrRest : null,
8010
+ ...normalizeParams(params)
8011
+ });
8012
+ }
7619
8013
  const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
7620
8014
  $ZodEnum.init(inst, def);
7621
8015
  ZodType.init(inst, def);
@@ -7653,23 +8047,6 @@ function _enum(values, params) {
7653
8047
  ...normalizeParams(params)
7654
8048
  });
7655
8049
  }
7656
- const ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
7657
- $ZodLiteral.init(inst, def);
7658
- ZodType.init(inst, def);
7659
- inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
7660
- inst.values = new Set(def.values);
7661
- Object.defineProperty(inst, "value", { get() {
7662
- if (def.values.length > 1) throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
7663
- return def.values[0];
7664
- } });
7665
- });
7666
- function literal(value, params) {
7667
- return new ZodLiteral({
7668
- type: "literal",
7669
- values: Array.isArray(value) ? value : [value],
7670
- ...normalizeParams(params)
7671
- });
7672
- }
7673
8050
  const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
7674
8051
  $ZodTransform.init(inst, def);
7675
8052
  ZodType.init(inst, def);
@@ -16717,6 +17094,14 @@ async function readFile$1(filePath) {
16717
17094
  throw new Error(`Failed to read file ${filePath}: ${error instanceof Error ? error.message : "Unknown error"}`);
16718
17095
  }
16719
17096
  }
17097
+ async function readTextFile(filePath) {
17098
+ if (!await pathExists(filePath)) throw new Error(`File not found: ${filePath}`);
17099
+ try {
17100
+ return await readFile(filePath, "utf-8");
17101
+ } catch (error) {
17102
+ throw new Error(`Failed to read file ${filePath}: ${error instanceof Error ? error.message : "Unknown error"}`);
17103
+ }
17104
+ }
16720
17105
  async function readJsonFile(filePath) {
16721
17106
  if (!await pathExists(filePath)) throw new Error(`File not found: ${filePath}`);
16722
17107
  try {
@@ -16789,39 +17174,19 @@ const entityResource = {
16789
17174
 
16790
17175
  //#endregion
16791
17176
  //#region src/core/resources/function/schema.ts
16792
- const HttpTriggerSchema = object({
16793
- id: string().optional(),
16794
- name: string().optional(),
16795
- description: string().optional(),
16796
- type: literal("http"),
16797
- path: string().min(1, "Path cannot be empty")
16798
- });
16799
- const ScheduleTriggerSchema = object({
16800
- id: string().optional(),
16801
- name: string().optional(),
16802
- description: string().optional(),
16803
- type: literal("schedule"),
16804
- scheduleMode: _enum(["recurring", "once"]).optional(),
16805
- cron: string().min(1, "Cron expression cannot be empty"),
16806
- isActive: boolean().optional(),
16807
- timezone: string().optional()
16808
- });
16809
- const EventTriggerSchema = object({
16810
- id: string().optional(),
16811
- name: string().optional(),
16812
- description: string().optional(),
16813
- type: literal("event"),
16814
- entity: string().min(1, "Entity name cannot be empty"),
16815
- event: string().min(1, "Event type cannot be empty")
16816
- });
16817
- const TriggerSchema = discriminatedUnion("type", [
16818
- HttpTriggerSchema,
16819
- ScheduleTriggerSchema,
16820
- EventTriggerSchema
16821
- ]);
16822
17177
  const FunctionConfigSchema = object({
17178
+ name: string().min(1, "Function name cannot be empty").refine((name$1) => !name$1.includes("."), "Function name cannot contain dots"),
16823
17179
  entry: string().min(1, "Entry point cannot be empty"),
16824
- triggers: array(TriggerSchema).optional()
17180
+ triggers: tuple([]).optional()
17181
+ });
17182
+ const FunctionSchema = FunctionConfigSchema.extend({ codePath: string().min(1, "Code path cannot be empty") });
17183
+ const DeployFunctionsResponseSchema = object({
17184
+ deployed: array(string()),
17185
+ deleted: array(string()),
17186
+ errors: array(object({
17187
+ name: string(),
17188
+ message: string()
17189
+ })).nullable()
16825
17190
  });
16826
17191
 
16827
17192
  //#endregion
@@ -16829,7 +17194,19 @@ const FunctionConfigSchema = object({
16829
17194
  async function readFunctionConfig(configPath) {
16830
17195
  const parsed = await readJsonFile(configPath);
16831
17196
  const result = FunctionConfigSchema.safeParse(parsed);
16832
- if (!result.success) throw new Error(`Invalid function configuration in ${configPath}: ${result.error.issues.map((e$1) => e$1.message).join(", ")}`);
17197
+ if (!result.success) throw new Error(`Invalid function configuration in ${configPath}: ${result.error.message}`);
17198
+ return result.data;
17199
+ }
17200
+ async function readFunction(configPath) {
17201
+ const config$2 = await readFunctionConfig(configPath);
17202
+ const codePath = join(dirname(configPath), config$2.entry);
17203
+ if (!await pathExists(codePath)) throw new Error(`Function code file not found: ${codePath} (referenced in ${configPath})`);
17204
+ const functionData = {
17205
+ ...config$2,
17206
+ codePath
17207
+ };
17208
+ const result = FunctionSchema.safeParse(functionData);
17209
+ if (!result.success) throw new Error(`Invalid function in ${configPath}: ${result.error.message}`);
16833
17210
  return result.data;
16834
17211
  }
16835
17212
  async function readAllFunctions(functionsDir) {
@@ -16838,12 +17215,53 @@ async function readAllFunctions(functionsDir) {
16838
17215
  cwd: functionsDir,
16839
17216
  absolute: true
16840
17217
  });
16841
- return await Promise.all(configFiles.map((configPath) => readFunctionConfig(configPath)));
17218
+ const functions = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
17219
+ const names = /* @__PURE__ */ new Set();
17220
+ for (const fn of functions) {
17221
+ if (names.has(fn.name)) throw new Error(`Duplicate function name "${fn.name}"`);
17222
+ names.add(fn.name);
17223
+ }
17224
+ return functions;
17225
+ }
17226
+
17227
+ //#endregion
17228
+ //#region src/core/resources/function/api.ts
17229
+ function toDeployPayloadItem(fn) {
17230
+ return {
17231
+ name: fn.name,
17232
+ entry: fn.entry,
17233
+ files: [{
17234
+ path: fn.entry,
17235
+ content: fn.code
17236
+ }]
17237
+ };
17238
+ }
17239
+ async function deployFunctions(functions) {
17240
+ const appClient = getAppClient();
17241
+ const payload = { functions: functions.map(toDeployPayloadItem) };
17242
+ const response = await appClient.put("backend-functions", { json: payload });
17243
+ return DeployFunctionsResponseSchema.parse(await response.json());
17244
+ }
17245
+
17246
+ //#endregion
17247
+ //#region src/core/resources/function/deploy.ts
17248
+ async function loadFunctionCode(fn) {
17249
+ const code$1 = await readTextFile(fn.codePath);
17250
+ return {
17251
+ ...fn,
17252
+ code: code$1
17253
+ };
17254
+ }
17255
+ async function pushFunctions(functions) {
17256
+ return deployFunctions(await Promise.all(functions.map(loadFunctionCode)));
16842
17257
  }
16843
17258
 
16844
17259
  //#endregion
16845
17260
  //#region src/core/resources/function/resource.ts
16846
- const functionResource = { readAll: readAllFunctions };
17261
+ const functionResource = {
17262
+ readAll: readAllFunctions,
17263
+ push: pushFunctions
17264
+ };
16847
17265
 
16848
17266
  //#endregion
16849
17267
  //#region src/core/project/schema.ts
@@ -25778,436 +26196,10 @@ async function getUserInfo(accessToken) {
25778
26196
  return result.data;
25779
26197
  }
25780
26198
 
25781
- //#endregion
25782
- //#region node_modules/chalk/source/vendor/ansi-styles/index.js
25783
- const ANSI_BACKGROUND_OFFSET = 10;
25784
- const wrapAnsi16 = (offset = 0) => (code$1) => `\u001B[${code$1 + offset}m`;
25785
- const wrapAnsi256 = (offset = 0) => (code$1) => `\u001B[${38 + offset};5;${code$1}m`;
25786
- const wrapAnsi16m = (offset = 0) => (red$1, green$1, blue$1) => `\u001B[${38 + offset};2;${red$1};${green$1};${blue$1}m`;
25787
- const styles$1 = {
25788
- modifier: {
25789
- reset: [0, 0],
25790
- bold: [1, 22],
25791
- dim: [2, 22],
25792
- italic: [3, 23],
25793
- underline: [4, 24],
25794
- overline: [53, 55],
25795
- inverse: [7, 27],
25796
- hidden: [8, 28],
25797
- strikethrough: [9, 29]
25798
- },
25799
- color: {
25800
- black: [30, 39],
25801
- red: [31, 39],
25802
- green: [32, 39],
25803
- yellow: [33, 39],
25804
- blue: [34, 39],
25805
- magenta: [35, 39],
25806
- cyan: [36, 39],
25807
- white: [37, 39],
25808
- blackBright: [90, 39],
25809
- gray: [90, 39],
25810
- grey: [90, 39],
25811
- redBright: [91, 39],
25812
- greenBright: [92, 39],
25813
- yellowBright: [93, 39],
25814
- blueBright: [94, 39],
25815
- magentaBright: [95, 39],
25816
- cyanBright: [96, 39],
25817
- whiteBright: [97, 39]
25818
- },
25819
- bgColor: {
25820
- bgBlack: [40, 49],
25821
- bgRed: [41, 49],
25822
- bgGreen: [42, 49],
25823
- bgYellow: [43, 49],
25824
- bgBlue: [44, 49],
25825
- bgMagenta: [45, 49],
25826
- bgCyan: [46, 49],
25827
- bgWhite: [47, 49],
25828
- bgBlackBright: [100, 49],
25829
- bgGray: [100, 49],
25830
- bgGrey: [100, 49],
25831
- bgRedBright: [101, 49],
25832
- bgGreenBright: [102, 49],
25833
- bgYellowBright: [103, 49],
25834
- bgBlueBright: [104, 49],
25835
- bgMagentaBright: [105, 49],
25836
- bgCyanBright: [106, 49],
25837
- bgWhiteBright: [107, 49]
25838
- }
25839
- };
25840
- const modifierNames = Object.keys(styles$1.modifier);
25841
- const foregroundColorNames = Object.keys(styles$1.color);
25842
- const backgroundColorNames = Object.keys(styles$1.bgColor);
25843
- const colorNames = [...foregroundColorNames, ...backgroundColorNames];
25844
- function assembleStyles() {
25845
- const codes = /* @__PURE__ */ new Map();
25846
- for (const [groupName, group] of Object.entries(styles$1)) {
25847
- for (const [styleName, style] of Object.entries(group)) {
25848
- styles$1[styleName] = {
25849
- open: `\u001B[${style[0]}m`,
25850
- close: `\u001B[${style[1]}m`
25851
- };
25852
- group[styleName] = styles$1[styleName];
25853
- codes.set(style[0], style[1]);
25854
- }
25855
- Object.defineProperty(styles$1, groupName, {
25856
- value: group,
25857
- enumerable: false
25858
- });
25859
- }
25860
- Object.defineProperty(styles$1, "codes", {
25861
- value: codes,
25862
- enumerable: false
25863
- });
25864
- styles$1.color.close = "\x1B[39m";
25865
- styles$1.bgColor.close = "\x1B[49m";
25866
- styles$1.color.ansi = wrapAnsi16();
25867
- styles$1.color.ansi256 = wrapAnsi256();
25868
- styles$1.color.ansi16m = wrapAnsi16m();
25869
- styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
25870
- styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
25871
- styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
25872
- Object.defineProperties(styles$1, {
25873
- rgbToAnsi256: {
25874
- value(red$1, green$1, blue$1) {
25875
- if (red$1 === green$1 && green$1 === blue$1) {
25876
- if (red$1 < 8) return 16;
25877
- if (red$1 > 248) return 231;
25878
- return Math.round((red$1 - 8) / 247 * 24) + 232;
25879
- }
25880
- return 16 + 36 * Math.round(red$1 / 255 * 5) + 6 * Math.round(green$1 / 255 * 5) + Math.round(blue$1 / 255 * 5);
25881
- },
25882
- enumerable: false
25883
- },
25884
- hexToRgb: {
25885
- value(hex) {
25886
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
25887
- if (!matches) return [
25888
- 0,
25889
- 0,
25890
- 0
25891
- ];
25892
- let [colorString] = matches;
25893
- if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
25894
- const integer$1 = Number.parseInt(colorString, 16);
25895
- return [
25896
- integer$1 >> 16 & 255,
25897
- integer$1 >> 8 & 255,
25898
- integer$1 & 255
25899
- ];
25900
- },
25901
- enumerable: false
25902
- },
25903
- hexToAnsi256: {
25904
- value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
25905
- enumerable: false
25906
- },
25907
- ansi256ToAnsi: {
25908
- value(code$1) {
25909
- if (code$1 < 8) return 30 + code$1;
25910
- if (code$1 < 16) return 90 + (code$1 - 8);
25911
- let red$1;
25912
- let green$1;
25913
- let blue$1;
25914
- if (code$1 >= 232) {
25915
- red$1 = ((code$1 - 232) * 10 + 8) / 255;
25916
- green$1 = red$1;
25917
- blue$1 = red$1;
25918
- } else {
25919
- code$1 -= 16;
25920
- const remainder = code$1 % 36;
25921
- red$1 = Math.floor(code$1 / 36) / 5;
25922
- green$1 = Math.floor(remainder / 6) / 5;
25923
- blue$1 = remainder % 6 / 5;
25924
- }
25925
- const value = Math.max(red$1, green$1, blue$1) * 2;
25926
- if (value === 0) return 30;
25927
- let result = 30 + (Math.round(blue$1) << 2 | Math.round(green$1) << 1 | Math.round(red$1));
25928
- if (value === 2) result += 60;
25929
- return result;
25930
- },
25931
- enumerable: false
25932
- },
25933
- rgbToAnsi: {
25934
- value: (red$1, green$1, blue$1) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red$1, green$1, blue$1)),
25935
- enumerable: false
25936
- },
25937
- hexToAnsi: {
25938
- value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
25939
- enumerable: false
25940
- }
25941
- });
25942
- return styles$1;
25943
- }
25944
- const ansiStyles = assembleStyles();
25945
- var ansi_styles_default = ansiStyles;
25946
-
25947
- //#endregion
25948
- //#region node_modules/chalk/source/vendor/supports-color/index.js
25949
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
25950
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
25951
- const position = argv.indexOf(prefix + flag);
25952
- const terminatorPosition = argv.indexOf("--");
25953
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
25954
- }
25955
- const { env } = y;
25956
- let flagForceColor;
25957
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
25958
- else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
25959
- function envForceColor() {
25960
- if ("FORCE_COLOR" in env) {
25961
- if (env.FORCE_COLOR === "true") return 1;
25962
- if (env.FORCE_COLOR === "false") return 0;
25963
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
25964
- }
25965
- }
25966
- function translateLevel(level) {
25967
- if (level === 0) return false;
25968
- return {
25969
- level,
25970
- hasBasic: true,
25971
- has256: level >= 2,
25972
- has16m: level >= 3
25973
- };
25974
- }
25975
- function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
25976
- const noFlagForceColor = envForceColor();
25977
- if (noFlagForceColor !== void 0) flagForceColor = noFlagForceColor;
25978
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
25979
- if (forceColor === 0) return 0;
25980
- if (sniffFlags) {
25981
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
25982
- if (hasFlag("color=256")) return 2;
25983
- }
25984
- if ("TF_BUILD" in env && "AGENT_NAME" in env) return 1;
25985
- if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
25986
- const min = forceColor || 0;
25987
- if (env.TERM === "dumb") return min;
25988
- if (y.platform === "win32") {
25989
- const osRelease = os.release().split(".");
25990
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
25991
- return 1;
25992
- }
25993
- if ("CI" in env) {
25994
- if ([
25995
- "GITHUB_ACTIONS",
25996
- "GITEA_ACTIONS",
25997
- "CIRCLECI"
25998
- ].some((key) => key in env)) return 3;
25999
- if ([
26000
- "TRAVIS",
26001
- "APPVEYOR",
26002
- "GITLAB_CI",
26003
- "BUILDKITE",
26004
- "DRONE"
26005
- ].some((sign) => sign in env) || env.CI_NAME === "codeship") return 1;
26006
- return min;
26007
- }
26008
- if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
26009
- if (env.COLORTERM === "truecolor") return 3;
26010
- if (env.TERM === "xterm-kitty") return 3;
26011
- if (env.TERM === "xterm-ghostty") return 3;
26012
- if (env.TERM === "wezterm") return 3;
26013
- if ("TERM_PROGRAM" in env) {
26014
- const version$2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
26015
- switch (env.TERM_PROGRAM) {
26016
- case "iTerm.app": return version$2 >= 3 ? 3 : 2;
26017
- case "Apple_Terminal": return 2;
26018
- }
26019
- }
26020
- if (/-256(color)?$/i.test(env.TERM)) return 2;
26021
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
26022
- if ("COLORTERM" in env) return 1;
26023
- return min;
26024
- }
26025
- function createSupportsColor(stream, options = {}) {
26026
- return translateLevel(_supportsColor(stream, {
26027
- streamIsTTY: stream && stream.isTTY,
26028
- ...options
26029
- }));
26030
- }
26031
- const supportsColor = {
26032
- stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
26033
- stderr: createSupportsColor({ isTTY: tty.isatty(2) })
26034
- };
26035
- var supports_color_default = supportsColor;
26036
-
26037
- //#endregion
26038
- //#region node_modules/chalk/source/utilities.js
26039
- function stringReplaceAll(string$2, substring, replacer) {
26040
- let index = string$2.indexOf(substring);
26041
- if (index === -1) return string$2;
26042
- const substringLength = substring.length;
26043
- let endIndex = 0;
26044
- let returnValue = "";
26045
- do {
26046
- returnValue += string$2.slice(endIndex, index) + substring + replacer;
26047
- endIndex = index + substringLength;
26048
- index = string$2.indexOf(substring, endIndex);
26049
- } while (index !== -1);
26050
- returnValue += string$2.slice(endIndex);
26051
- return returnValue;
26052
- }
26053
- function stringEncaseCRLFWithFirstIndex(string$2, prefix, postfix, index) {
26054
- let endIndex = 0;
26055
- let returnValue = "";
26056
- do {
26057
- const gotCR = string$2[index - 1] === "\r";
26058
- returnValue += string$2.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
26059
- endIndex = index + 1;
26060
- index = string$2.indexOf("\n", endIndex);
26061
- } while (index !== -1);
26062
- returnValue += string$2.slice(endIndex);
26063
- return returnValue;
26064
- }
26065
-
26066
- //#endregion
26067
- //#region node_modules/chalk/source/index.js
26068
- const { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
26069
- const GENERATOR = Symbol("GENERATOR");
26070
- const STYLER = Symbol("STYLER");
26071
- const IS_EMPTY = Symbol("IS_EMPTY");
26072
- const levelMapping = [
26073
- "ansi",
26074
- "ansi",
26075
- "ansi256",
26076
- "ansi16m"
26077
- ];
26078
- const styles = Object.create(null);
26079
- const applyOptions = (object$1, options = {}) => {
26080
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
26081
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
26082
- object$1.level = options.level === void 0 ? colorLevel : options.level;
26083
- };
26084
- const chalkFactory = (options) => {
26085
- const chalk$1 = (...strings) => strings.join(" ");
26086
- applyOptions(chalk$1, options);
26087
- Object.setPrototypeOf(chalk$1, createChalk.prototype);
26088
- return chalk$1;
26089
- };
26090
- function createChalk(options) {
26091
- return chalkFactory(options);
26092
- }
26093
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
26094
- for (const [styleName, style] of Object.entries(ansi_styles_default)) styles[styleName] = { get() {
26095
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
26096
- Object.defineProperty(this, styleName, { value: builder });
26097
- return builder;
26098
- } };
26099
- styles.visible = { get() {
26100
- const builder = createBuilder(this, this[STYLER], true);
26101
- Object.defineProperty(this, "visible", { value: builder });
26102
- return builder;
26103
- } };
26104
- const getModelAnsi = (model, level, type, ...arguments_) => {
26105
- if (model === "rgb") {
26106
- if (level === "ansi16m") return ansi_styles_default[type].ansi16m(...arguments_);
26107
- if (level === "ansi256") return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
26108
- return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
26109
- }
26110
- if (model === "hex") return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
26111
- return ansi_styles_default[type][model](...arguments_);
26112
- };
26113
- for (const model of [
26114
- "rgb",
26115
- "hex",
26116
- "ansi256"
26117
- ]) {
26118
- styles[model] = { get() {
26119
- const { level } = this;
26120
- return function(...arguments_) {
26121
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
26122
- return createBuilder(this, styler, this[IS_EMPTY]);
26123
- };
26124
- } };
26125
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
26126
- styles[bgModel] = { get() {
26127
- const { level } = this;
26128
- return function(...arguments_) {
26129
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
26130
- return createBuilder(this, styler, this[IS_EMPTY]);
26131
- };
26132
- } };
26133
- }
26134
- const proto = Object.defineProperties(() => {}, {
26135
- ...styles,
26136
- level: {
26137
- enumerable: true,
26138
- get() {
26139
- return this[GENERATOR].level;
26140
- },
26141
- set(level) {
26142
- this[GENERATOR].level = level;
26143
- }
26144
- }
26145
- });
26146
- const createStyler = (open, close, parent) => {
26147
- let openAll;
26148
- let closeAll;
26149
- if (parent === void 0) {
26150
- openAll = open;
26151
- closeAll = close;
26152
- } else {
26153
- openAll = parent.openAll + open;
26154
- closeAll = close + parent.closeAll;
26155
- }
26156
- return {
26157
- open,
26158
- close,
26159
- openAll,
26160
- closeAll,
26161
- parent
26162
- };
26163
- };
26164
- const createBuilder = (self$1, _styler, _isEmpty) => {
26165
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
26166
- Object.setPrototypeOf(builder, proto);
26167
- builder[GENERATOR] = self$1;
26168
- builder[STYLER] = _styler;
26169
- builder[IS_EMPTY] = _isEmpty;
26170
- return builder;
26171
- };
26172
- const applyStyle = (self$1, string$2) => {
26173
- if (self$1.level <= 0 || !string$2) return self$1[IS_EMPTY] ? "" : string$2;
26174
- let styler = self$1[STYLER];
26175
- if (styler === void 0) return string$2;
26176
- const { openAll, closeAll } = styler;
26177
- if (string$2.includes("\x1B")) while (styler !== void 0) {
26178
- string$2 = stringReplaceAll(string$2, styler.close, styler.open);
26179
- styler = styler.parent;
26180
- }
26181
- const lfIndex = string$2.indexOf("\n");
26182
- if (lfIndex !== -1) string$2 = stringEncaseCRLFWithFirstIndex(string$2, closeAll, openAll, lfIndex);
26183
- return openAll + string$2 + closeAll;
26184
- };
26185
- Object.defineProperties(createChalk.prototype, styles);
26186
- const chalk = createChalk();
26187
- const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
26188
- var source_default = chalk;
26189
-
26190
- //#endregion
26191
- //#region src/cli/utils/theme.ts
26192
- /**
26193
- * Base44 CLI theme configuration
26194
- */
26195
- const theme = {
26196
- colors: {
26197
- base44Orange: source_default.hex("#E86B3C"),
26198
- shinyOrange: source_default.hex("#FFD700"),
26199
- links: source_default.hex("#00D4FF"),
26200
- white: source_default.white
26201
- },
26202
- styles: {
26203
- header: source_default.dim,
26204
- bold: source_default.bold,
26205
- dim: source_default.dim
26206
- }
26207
- };
26208
-
26209
26199
  //#endregion
26210
26200
  //#region src/cli/utils/animate.ts
26201
+ const orange$2 = source_default.hex("#E86B3C");
26202
+ const gold = source_default.hex("#FFD700");
26211
26203
  /**
26212
26204
  * Sleep for a specified number of milliseconds.
26213
26205
  */
@@ -26224,13 +26216,13 @@ async function animateLineReveal(line, duration$2) {
26224
26216
  const progress = step / steps;
26225
26217
  const revealIndex = Math.floor(progress * line.length);
26226
26218
  let output = "";
26227
- for (let i$1 = 0; i$1 < line.length; i$1++) if (i$1 < revealIndex) output += theme.colors.base44Orange(line[i$1]);
26228
- else if (i$1 === revealIndex) output += theme.colors.shinyOrange(line[i$1]);
26229
- else output += theme.styles.dim(line[i$1]);
26219
+ for (let i$1 = 0; i$1 < line.length; i$1++) if (i$1 < revealIndex) output += orange$2(line[i$1]);
26220
+ else if (i$1 === revealIndex) output += gold(line[i$1]);
26221
+ else output += source_default.dim(line[i$1]);
26230
26222
  process.stdout.write(`\r${output}`);
26231
26223
  await sleep(stepDuration);
26232
26224
  }
26233
- process.stdout.write(`\r${theme.colors.base44Orange(line)}\n`);
26225
+ process.stdout.write(`\r${orange$2(line)}\n`);
26234
26226
  }
26235
26227
  /**
26236
26228
  * Quick shimmer pass over the entire banner.
@@ -26247,15 +26239,15 @@ async function shimmerPass(lines, duration$2) {
26247
26239
  let output = "";
26248
26240
  for (let i$1 = 0; i$1 < line.length; i$1++) {
26249
26241
  const dist = Math.abs(i$1 - shimmerPos);
26250
- if (dist < 3) output += dist === 0 ? theme.colors.white(line[i$1]) : theme.colors.shinyOrange(line[i$1]);
26251
- else output += theme.colors.base44Orange(line[i$1]);
26242
+ if (dist < 3) output += dist === 0 ? source_default.white(line[i$1]) : gold(line[i$1]);
26243
+ else output += orange$2(line[i$1]);
26252
26244
  }
26253
26245
  console.log(output);
26254
26246
  }
26255
26247
  await sleep(stepDuration);
26256
26248
  }
26257
26249
  process.stdout.write(moveUp);
26258
- for (const line of lines) console.log(theme.colors.base44Orange(line));
26250
+ for (const line of lines) console.log(orange$2(line));
26259
26251
  }
26260
26252
  /**
26261
26253
  * Animate the output with a smooth line-by-line reveal.
@@ -26275,6 +26267,7 @@ async function printAnimatedLines(lines) {
26275
26267
 
26276
26268
  //#endregion
26277
26269
  //#region src/cli/utils/banner.ts
26270
+ const orange$1 = source_default.hex("#E86B3C");
26278
26271
  const BANNER_LINES = [
26279
26272
  "██████╗ █████╗ ███████╗███████╗ ██╗ ██╗██╗ ██╗",
26280
26273
  "██╔══██╗██╔══██╗██╔════╝██╔════╝ ██║ ██║██║ ██║",
@@ -26289,11 +26282,12 @@ const BANNER_LINES = [
26289
26282
  */
26290
26283
  async function printBanner() {
26291
26284
  if (process.stdout.isTTY) await printAnimatedLines(BANNER_LINES);
26292
- else console.log(theme.colors.base44Orange(BANNER_LINES.join("\n")));
26285
+ else console.log(orange$1(BANNER_LINES.join("\n")));
26293
26286
  }
26294
26287
 
26295
26288
  //#endregion
26296
26289
  //#region src/cli/utils/runCommand.ts
26290
+ const base44Color = source_default.bgHex("#E86B3C");
26297
26291
  /**
26298
26292
  * Wraps a command function with the Base44 intro/outro and error handling.
26299
26293
  * All CLI commands should use this utility to ensure consistent branding.
@@ -26337,7 +26331,7 @@ async function runCommand(commandFn, options) {
26337
26331
  if (options?.fullBanner) {
26338
26332
  await printBanner();
26339
26333
  Ie("");
26340
- } else Ie(theme.colors.base44Orange(" Base 44 "));
26334
+ } else Ie(base44Color(" Base 44 "));
26341
26335
  await loadProjectEnv();
26342
26336
  try {
26343
26337
  if (options?.requireAuth) {
@@ -26429,7 +26423,7 @@ async function generateAndDisplayDeviceCode() {
26429
26423
  successMessage: "Device code generated",
26430
26424
  errorMessage: "Failed to generate device code"
26431
26425
  });
26432
- M.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}\nPlease confirm this code at: ${deviceCodeResponse.verificationUri}`);
26426
+ M.info(`Verification code: ${source_default.bold(deviceCodeResponse.userCode)}\nPlease confirm this code at: ${deviceCodeResponse.verificationUri}`);
26433
26427
  return deviceCodeResponse;
26434
26428
  }
26435
26429
  async function waitForAuthentication(deviceCode, expiresIn, interval) {
@@ -26473,7 +26467,7 @@ async function login() {
26473
26467
  const token = await waitForAuthentication(deviceCodeResponse.deviceCode, deviceCodeResponse.expiresIn, deviceCodeResponse.interval);
26474
26468
  const userInfo = await getUserInfo(token.accessToken);
26475
26469
  await saveAuthData(token, userInfo);
26476
- return { outroMessage: `Successfully logged in as ${theme.styles.bold(userInfo.email)}` };
26470
+ return { outroMessage: `Successfully logged in as ${source_default.bold(userInfo.email)}` };
26477
26471
  }
26478
26472
  const loginCommand = new Command("login").description("Authenticate with Base44").action(async () => {
26479
26473
  await runCommand(login);
@@ -26483,7 +26477,7 @@ const loginCommand = new Command("login").description("Authenticate with Base44"
26483
26477
  //#region src/cli/commands/auth/whoami.ts
26484
26478
  async function whoami() {
26485
26479
  const auth = await readAuth();
26486
- return { outroMessage: `Logged in as: ${theme.styles.bold(auth.email)}` };
26480
+ return { outroMessage: `Logged in as: ${source_default.bold(auth.email)}` };
26487
26481
  }
26488
26482
  const whoamiCommand = new Command("whoami").description("Display current authenticated user").action(async () => {
26489
26483
  await runCommand(whoami, { requireAuth: true });
@@ -31503,6 +31497,30 @@ const entitiesPushCommand = new Command("entities").description("Manage project
31503
31497
  await runCommand(pushEntitiesAction, { requireAuth: true });
31504
31498
  }));
31505
31499
 
31500
+ //#endregion
31501
+ //#region src/cli/commands/functions/deploy.ts
31502
+ async function deployFunctionsAction() {
31503
+ const { functions } = await readProjectConfig();
31504
+ if (functions.length === 0) return { outroMessage: "No functions found. Create functions in the 'functions' directory." };
31505
+ M.info(`Found ${functions.length} ${functions.length === 1 ? "function" : "functions"} to deploy`);
31506
+ const result = await runTask("Deploying functions to Base44", async () => {
31507
+ return await pushFunctions(functions);
31508
+ }, {
31509
+ successMessage: "Functions deployed successfully",
31510
+ errorMessage: "Failed to deploy functions"
31511
+ });
31512
+ if (result.deployed.length > 0) M.success(`Deployed: ${result.deployed.join(", ")}`);
31513
+ if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
31514
+ if (result.errors && result.errors.length > 0) {
31515
+ const errorMessages = result.errors.map((e$1) => ` ${e$1.name}: ${e$1.message}`).join("\n");
31516
+ throw new Error(`Function deployment errors:\n${errorMessages}`);
31517
+ }
31518
+ return {};
31519
+ }
31520
+ const functionsDeployCommand = new Command("functions").description("Manage project functions").addCommand(new Command("deploy").description("Deploy local functions to Base44").action(async () => {
31521
+ await runCommand(deployFunctionsAction, { requireAuth: true });
31522
+ }));
31523
+
31506
31524
  //#endregion
31507
31525
  //#region node_modules/is-plain-obj/index.js
31508
31526
  function isPlainObject(value) {
@@ -32127,7 +32145,7 @@ const green = format(32, 39);
32127
32145
  const yellow = format(33, 39);
32128
32146
  const blue = format(34, 39);
32129
32147
  const magenta = format(35, 39);
32130
- const cyan = format(36, 39);
32148
+ const cyan$1 = format(36, 39);
32131
32149
  const white = format(37, 39);
32132
32150
  const gray = format(90, 39);
32133
32151
  const bgBlack = format(40, 49);
@@ -38171,6 +38189,8 @@ var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
38171
38189
  //#endregion
38172
38190
  //#region src/cli/commands/project/create.ts
38173
38191
  var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
38192
+ const orange = source_default.hex("#E86B3C");
38193
+ const cyan = source_default.hex("#00D4FF");
38174
38194
  const DEFAULT_TEMPLATE_ID = "backend-only";
38175
38195
  async function getDefaultTemplate() {
38176
38196
  const template = (await listTemplates()).find((t) => t.id === DEFAULT_TEMPLATE_ID);
@@ -38250,7 +38270,7 @@ async function executeCreate({ template, name: rawName, description, projectPath
38250
38270
  template
38251
38271
  });
38252
38272
  }, {
38253
- successMessage: theme.colors.base44Orange("Project created successfully"),
38273
+ successMessage: orange("Project created successfully"),
38254
38274
  errorMessage: "Failed to create project"
38255
38275
  });
38256
38276
  await loadProjectEnv(resolvedPath);
@@ -38265,7 +38285,7 @@ async function executeCreate({ template, name: rawName, description, projectPath
38265
38285
  if (shouldPushEntities) await runTask(`Pushing ${entities.length} entities to Base44...`, async () => {
38266
38286
  await pushEntities(entities);
38267
38287
  }, {
38268
- successMessage: theme.colors.base44Orange("Entities pushed successfully"),
38288
+ successMessage: orange("Entities pushed successfully"),
38269
38289
  errorMessage: "Failed to push entities"
38270
38290
  });
38271
38291
  }
@@ -38290,16 +38310,16 @@ async function executeCreate({ template, name: rawName, description, projectPath
38290
38310
  updateMessage("Deploying site...");
38291
38311
  return await deploySite(join(resolvedPath, outputDirectory));
38292
38312
  }, {
38293
- successMessage: theme.colors.base44Orange("Site deployed successfully"),
38313
+ successMessage: orange("Site deployed successfully"),
38294
38314
  errorMessage: "Failed to deploy site"
38295
38315
  });
38296
38316
  finalAppUrl = appUrl;
38297
38317
  }
38298
38318
  }
38299
38319
  const dashboardUrl = `${getBase44ApiUrl()}/apps/${projectId}/editor/preview`;
38300
- M.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name$1)}`);
38301
- M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
38302
- if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
38320
+ M.message(`${source_default.dim("Project")}: ${orange(name$1)}`);
38321
+ M.message(`${source_default.dim("Dashboard")}: ${cyan(dashboardUrl)}`);
38322
+ if (finalAppUrl) M.message(`${source_default.dim("Site")}: ${cyan(finalAppUrl)}`);
38303
38323
  return { outroMessage: "Your project is set and ready to use" };
38304
38324
  }
38305
38325
  const createCommand = new Command("create").description("Create a new Base44 project").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("-p, --path <path>", "Path where to create the project").option("--deploy", "Build and deploy the site").hook("preAction", validateNonInteractiveFlags).action(async (options) => {
@@ -38340,6 +38360,7 @@ program.addCommand(whoamiCommand);
38340
38360
  program.addCommand(logoutCommand);
38341
38361
  program.addCommand(createCommand);
38342
38362
  program.addCommand(entitiesPushCommand);
38363
+ program.addCommand(functionsDeployCommand);
38343
38364
  program.addCommand(siteDeployCommand);
38344
38365
  program.parse();
38345
38366