base44 0.0.9 → 0.0.11

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
@@ -5,12 +5,11 @@ 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";
10
8
  import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
11
9
  import * as g from "node:readline";
12
10
  import O from "node:readline";
13
11
  import Stream, { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark } from "node:stream";
12
+ import os, { constants, homedir, tmpdir } from "node:os";
14
13
  import { fileURLToPath } from "node:url";
15
14
  import fs$1 from "fs";
16
15
  import path$1, { dirname as dirname$1, parse } from "path";
@@ -18,6 +17,7 @@ import { finished } from "node:stream/promises";
18
17
  import EE, { EventEmitter as EventEmitter$1 } from "events";
19
18
  import fsPromises, { access, copyFile, mkdir, readFile, unlink, writeFile } from "node:fs/promises";
20
19
  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,415 +2705,6 @@ 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
-
3117
2708
  //#endregion
3118
2709
  //#region node_modules/sisteransi/src/index.js
3119
2710
  var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -4956,7 +4547,6 @@ const string$1 = (params) => {
4956
4547
  };
4957
4548
  const integer = /^-?\d+$/;
4958
4549
  const number$1 = /^-?\d+(?:\.\d+)?$/;
4959
- const boolean$1 = /^(?:true|false)$/i;
4960
4550
  const lowercase = /^[^A-Z]*$/;
4961
4551
  const uppercase = /^[^a-z]*$/;
4962
4552
 
@@ -5735,24 +5325,6 @@ const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst,
5735
5325
  $ZodCheckNumberFormat.init(inst, def);
5736
5326
  $ZodNumber.init(inst, def);
5737
5327
  });
5738
- const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
5739
- $ZodType.init(inst, def);
5740
- inst._zod.pattern = boolean$1;
5741
- inst._zod.parse = (payload, _ctx) => {
5742
- if (def.coerce) try {
5743
- payload.value = Boolean(payload.value);
5744
- } catch (_$2) {}
5745
- const input = payload.value;
5746
- if (typeof input === "boolean") return payload;
5747
- payload.issues.push({
5748
- expected: "boolean",
5749
- code: "invalid_type",
5750
- input,
5751
- inst
5752
- });
5753
- return payload;
5754
- };
5755
- });
5756
5328
  const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
5757
5329
  $ZodType.init(inst, def);
5758
5330
  inst._zod.parse = (payload) => payload;
@@ -6058,61 +5630,6 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
6058
5630
  });
6059
5631
  };
6060
5632
  });
6061
- const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
6062
- def.inclusive = false;
6063
- $ZodUnion.init(inst, def);
6064
- const _super = inst._zod.parse;
6065
- defineLazy(inst._zod, "propValues", () => {
6066
- const propValues = {};
6067
- for (const option of def.options) {
6068
- const pv = option._zod.propValues;
6069
- if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
6070
- for (const [k$2, v$1] of Object.entries(pv)) {
6071
- if (!propValues[k$2]) propValues[k$2] = /* @__PURE__ */ new Set();
6072
- for (const val of v$1) propValues[k$2].add(val);
6073
- }
6074
- }
6075
- return propValues;
6076
- });
6077
- const disc = cached(() => {
6078
- const opts = def.options;
6079
- const map = /* @__PURE__ */ new Map();
6080
- for (const o$2 of opts) {
6081
- const values = o$2._zod.propValues?.[def.discriminator];
6082
- if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o$2)}"`);
6083
- for (const v$1 of values) {
6084
- if (map.has(v$1)) throw new Error(`Duplicate discriminator value "${String(v$1)}"`);
6085
- map.set(v$1, o$2);
6086
- }
6087
- }
6088
- return map;
6089
- });
6090
- inst._zod.parse = (payload, ctx) => {
6091
- const input = payload.value;
6092
- if (!isObject$2(input)) {
6093
- payload.issues.push({
6094
- code: "invalid_type",
6095
- expected: "object",
6096
- input,
6097
- inst
6098
- });
6099
- return payload;
6100
- }
6101
- const opt = disc.value.get(input?.[def.discriminator]);
6102
- if (opt) return opt._zod.run(payload, ctx);
6103
- if (def.unionFallback) return _super(payload, ctx);
6104
- payload.issues.push({
6105
- code: "invalid_union",
6106
- errors: [],
6107
- note: "No matching discriminator",
6108
- discriminator: def.discriminator,
6109
- input,
6110
- path: [def.discriminator],
6111
- inst
6112
- });
6113
- return payload;
6114
- };
6115
- });
6116
5633
  const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
6117
5634
  $ZodType.init(inst, def);
6118
5635
  inst._zod.parse = (payload, ctx) => {
@@ -6212,6 +5729,77 @@ function handleIntersectionResults(result, left, right) {
6212
5729
  result.value = merged.data;
6213
5730
  return result;
6214
5731
  }
5732
+ const $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
5733
+ $ZodType.init(inst, def);
5734
+ const items = def.items;
5735
+ inst._zod.parse = (payload, ctx) => {
5736
+ const input = payload.value;
5737
+ if (!Array.isArray(input)) {
5738
+ payload.issues.push({
5739
+ input,
5740
+ inst,
5741
+ expected: "tuple",
5742
+ code: "invalid_type"
5743
+ });
5744
+ return payload;
5745
+ }
5746
+ payload.value = [];
5747
+ const proms = [];
5748
+ const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
5749
+ const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;
5750
+ if (!def.rest) {
5751
+ const tooBig = input.length > items.length;
5752
+ const tooSmall = input.length < optStart - 1;
5753
+ if (tooBig || tooSmall) {
5754
+ payload.issues.push({
5755
+ ...tooBig ? {
5756
+ code: "too_big",
5757
+ maximum: items.length,
5758
+ inclusive: true
5759
+ } : {
5760
+ code: "too_small",
5761
+ minimum: items.length
5762
+ },
5763
+ input,
5764
+ inst,
5765
+ origin: "array"
5766
+ });
5767
+ return payload;
5768
+ }
5769
+ }
5770
+ let i$1 = -1;
5771
+ for (const item of items) {
5772
+ i$1++;
5773
+ if (i$1 >= input.length) {
5774
+ if (i$1 >= optStart) continue;
5775
+ }
5776
+ const result = item._zod.run({
5777
+ value: input[i$1],
5778
+ issues: []
5779
+ }, ctx);
5780
+ if (result instanceof Promise) proms.push(result.then((result$1) => handleTupleResult(result$1, payload, i$1)));
5781
+ else handleTupleResult(result, payload, i$1);
5782
+ }
5783
+ if (def.rest) {
5784
+ const rest = input.slice(items.length);
5785
+ for (const el of rest) {
5786
+ i$1++;
5787
+ const result = def.rest._zod.run({
5788
+ value: el,
5789
+ issues: []
5790
+ }, ctx);
5791
+ if (result instanceof Promise) proms.push(result.then((result$1) => handleTupleResult(result$1, payload, i$1)));
5792
+ else handleTupleResult(result, payload, i$1);
5793
+ }
5794
+ }
5795
+ if (proms.length) return Promise.all(proms).then(() => payload);
5796
+ return payload;
5797
+ };
5798
+ });
5799
+ function handleTupleResult(result, final, index) {
5800
+ if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
5801
+ final.value[index] = result.value;
5802
+ }
6215
5803
  const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
6216
5804
  $ZodType.init(inst, def);
6217
5805
  const values = getEnumValues(def.entries);
@@ -6230,24 +5818,6 @@ const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
6230
5818
  return payload;
6231
5819
  };
6232
5820
  });
6233
- const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
6234
- $ZodType.init(inst, def);
6235
- if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
6236
- const values = new Set(def.values);
6237
- inst._zod.values = values;
6238
- 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("|")})$`);
6239
- inst._zod.parse = (payload, _ctx) => {
6240
- const input = payload.value;
6241
- if (values.has(input)) return payload;
6242
- payload.issues.push({
6243
- code: "invalid_value",
6244
- values: def.values,
6245
- input,
6246
- inst
6247
- });
6248
- return payload;
6249
- };
6250
- });
6251
5821
  const $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
6252
5822
  $ZodType.init(inst, def);
6253
5823
  inst._zod.parse = (payload, ctx) => {
@@ -6809,13 +6379,6 @@ function _int(Class, params) {
6809
6379
  });
6810
6380
  }
6811
6381
  /* @__NO_SIDE_EFFECTS__ */
6812
- function _boolean(Class, params) {
6813
- return new Class({
6814
- type: "boolean",
6815
- ...normalizeParams(params)
6816
- });
6817
- }
6818
- /* @__NO_SIDE_EFFECTS__ */
6819
6382
  function _unknown(Class) {
6820
6383
  return new Class({ type: "unknown" });
6821
6384
  }
@@ -7386,9 +6949,6 @@ const numberProcessor = (schema, ctx, _json, _params) => {
7386
6949
  }
7387
6950
  if (typeof multipleOf === "number") json.multipleOf = multipleOf;
7388
6951
  };
7389
- const booleanProcessor = (_schema, _ctx, json, _params) => {
7390
- json.type = "boolean";
7391
- };
7392
6952
  const neverProcessor = (_schema, _ctx, json, _params) => {
7393
6953
  json.not = {};
7394
6954
  };
@@ -7400,27 +6960,6 @@ const enumProcessor = (schema, _ctx, json, _params) => {
7400
6960
  if (values.every((v$1) => typeof v$1 === "string")) json.type = "string";
7401
6961
  json.enum = values;
7402
6962
  };
7403
- const literalProcessor = (schema, ctx, json, _params) => {
7404
- const def = schema._zod.def;
7405
- const vals = [];
7406
- for (const val of def.values) if (val === void 0) {
7407
- if (ctx.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema");
7408
- } else if (typeof val === "bigint") if (ctx.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema");
7409
- else vals.push(Number(val));
7410
- else vals.push(val);
7411
- if (vals.length === 0) {} else if (vals.length === 1) {
7412
- const val = vals[0];
7413
- json.type = val === null ? "null" : typeof val;
7414
- if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") json.enum = [val];
7415
- else json.const = val;
7416
- } else {
7417
- if (vals.every((v$1) => typeof v$1 === "number")) json.type = "number";
7418
- if (vals.every((v$1) => typeof v$1 === "string")) json.type = "string";
7419
- if (vals.every((v$1) => typeof v$1 === "boolean")) json.type = "boolean";
7420
- if (vals.every((v$1) => v$1 === null)) json.type = "null";
7421
- json.enum = vals;
7422
- }
7423
- };
7424
6963
  const customProcessor = (_schema, ctx, _json, _params) => {
7425
6964
  if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
7426
6965
  };
@@ -7503,6 +7042,44 @@ const intersectionProcessor = (schema, ctx, json, params) => {
7503
7042
  const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
7504
7043
  json.allOf = [...isSimpleIntersection(a$1) ? a$1.allOf : [a$1], ...isSimpleIntersection(b$2) ? b$2.allOf : [b$2]];
7505
7044
  };
7045
+ const tupleProcessor = (schema, ctx, _json, params) => {
7046
+ const json = _json;
7047
+ const def = schema._zod.def;
7048
+ json.type = "array";
7049
+ const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
7050
+ const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
7051
+ const prefixItems = def.items.map((x$2, i$1) => process$2(x$2, ctx, {
7052
+ ...params,
7053
+ path: [
7054
+ ...params.path,
7055
+ prefixPath$1,
7056
+ i$1
7057
+ ]
7058
+ }));
7059
+ const rest = def.rest ? process$2(def.rest, ctx, {
7060
+ ...params,
7061
+ path: [
7062
+ ...params.path,
7063
+ restPath,
7064
+ ...ctx.target === "openapi-3.0" ? [def.items.length] : []
7065
+ ]
7066
+ }) : null;
7067
+ if (ctx.target === "draft-2020-12") {
7068
+ json.prefixItems = prefixItems;
7069
+ if (rest) json.items = rest;
7070
+ } else if (ctx.target === "openapi-3.0") {
7071
+ json.items = { anyOf: prefixItems };
7072
+ if (rest) json.items.anyOf.push(rest);
7073
+ json.minItems = prefixItems.length;
7074
+ if (!rest) json.maxItems = prefixItems.length;
7075
+ } else {
7076
+ json.items = prefixItems;
7077
+ if (rest) json.additionalItems = rest;
7078
+ }
7079
+ const { minimum, maximum } = schema._zod.bag;
7080
+ if (typeof minimum === "number") json.minItems = minimum;
7081
+ if (typeof maximum === "number") json.maxItems = maximum;
7082
+ };
7506
7083
  const nullableProcessor = (schema, ctx, json, params) => {
7507
7084
  const def = schema._zod.def;
7508
7085
  const inner = process$2(def.innerType, ctx, params);
@@ -7895,14 +7472,6 @@ const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, d
7895
7472
  function int(params) {
7896
7473
  return _int(ZodNumberFormat, params);
7897
7474
  }
7898
- const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
7899
- $ZodBoolean.init(inst, def);
7900
- ZodType.init(inst, def);
7901
- inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
7902
- });
7903
- function boolean(params) {
7904
- return _boolean(ZodBoolean, params);
7905
- }
7906
7475
  const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
7907
7476
  $ZodUnknown.init(inst, def);
7908
7477
  ZodType.init(inst, def);
@@ -8001,18 +7570,6 @@ function union(options, params) {
8001
7570
  ...normalizeParams(params)
8002
7571
  });
8003
7572
  }
8004
- const ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => {
8005
- ZodUnion.init(inst, def);
8006
- $ZodDiscriminatedUnion.init(inst, def);
8007
- });
8008
- function discriminatedUnion(discriminator, options, params) {
8009
- return new ZodDiscriminatedUnion({
8010
- type: "union",
8011
- options,
8012
- discriminator,
8013
- ...normalizeParams(params)
8014
- });
8015
- }
8016
7573
  const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
8017
7574
  $ZodIntersection.init(inst, def);
8018
7575
  ZodType.init(inst, def);
@@ -8025,6 +7582,25 @@ function intersection(left, right) {
8025
7582
  right
8026
7583
  });
8027
7584
  }
7585
+ const ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
7586
+ $ZodTuple.init(inst, def);
7587
+ ZodType.init(inst, def);
7588
+ inst._zod.processJSONSchema = (ctx, json, params) => tupleProcessor(inst, ctx, json, params);
7589
+ inst.rest = (rest) => inst.clone({
7590
+ ...inst._zod.def,
7591
+ rest
7592
+ });
7593
+ });
7594
+ function tuple(items, _paramsOrRest, _params) {
7595
+ const hasRest = _paramsOrRest instanceof $ZodType;
7596
+ const params = hasRest ? _params : _paramsOrRest;
7597
+ return new ZodTuple({
7598
+ type: "tuple",
7599
+ items,
7600
+ rest: hasRest ? _paramsOrRest : null,
7601
+ ...normalizeParams(params)
7602
+ });
7603
+ }
8028
7604
  const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
8029
7605
  $ZodEnum.init(inst, def);
8030
7606
  ZodType.init(inst, def);
@@ -8062,23 +7638,6 @@ function _enum(values, params) {
8062
7638
  ...normalizeParams(params)
8063
7639
  });
8064
7640
  }
8065
- const ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
8066
- $ZodLiteral.init(inst, def);
8067
- ZodType.init(inst, def);
8068
- inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
8069
- inst.values = new Set(def.values);
8070
- Object.defineProperty(inst, "value", { get() {
8071
- if (def.values.length > 1) throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
8072
- return def.values[0];
8073
- } });
8074
- });
8075
- function literal(value, params) {
8076
- return new ZodLiteral({
8077
- type: "literal",
8078
- values: Array.isArray(value) ? value : [value],
8079
- ...normalizeParams(params)
8080
- });
8081
- }
8082
7641
  const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
8083
7642
  $ZodTransform.init(inst, def);
8084
7643
  ZodType.init(inst, def);
@@ -17126,6 +16685,14 @@ async function readFile$1(filePath) {
17126
16685
  throw new Error(`Failed to read file ${filePath}: ${error instanceof Error ? error.message : "Unknown error"}`);
17127
16686
  }
17128
16687
  }
16688
+ async function readTextFile(filePath) {
16689
+ if (!await pathExists(filePath)) throw new Error(`File not found: ${filePath}`);
16690
+ try {
16691
+ return await readFile(filePath, "utf-8");
16692
+ } catch (error) {
16693
+ throw new Error(`Failed to read file ${filePath}: ${error instanceof Error ? error.message : "Unknown error"}`);
16694
+ }
16695
+ }
17129
16696
  async function readJsonFile(filePath) {
17130
16697
  if (!await pathExists(filePath)) throw new Error(`File not found: ${filePath}`);
17131
16698
  try {
@@ -17198,39 +16765,19 @@ const entityResource = {
17198
16765
 
17199
16766
  //#endregion
17200
16767
  //#region src/core/resources/function/schema.ts
17201
- const HttpTriggerSchema = object({
17202
- id: string().optional(),
17203
- name: string().optional(),
17204
- description: string().optional(),
17205
- type: literal("http"),
17206
- path: string().min(1, "Path cannot be empty")
17207
- });
17208
- const ScheduleTriggerSchema = object({
17209
- id: string().optional(),
17210
- name: string().optional(),
17211
- description: string().optional(),
17212
- type: literal("schedule"),
17213
- scheduleMode: _enum(["recurring", "once"]).optional(),
17214
- cron: string().min(1, "Cron expression cannot be empty"),
17215
- isActive: boolean().optional(),
17216
- timezone: string().optional()
17217
- });
17218
- const EventTriggerSchema = object({
17219
- id: string().optional(),
17220
- name: string().optional(),
17221
- description: string().optional(),
17222
- type: literal("event"),
17223
- entity: string().min(1, "Entity name cannot be empty"),
17224
- event: string().min(1, "Event type cannot be empty")
17225
- });
17226
- const TriggerSchema = discriminatedUnion("type", [
17227
- HttpTriggerSchema,
17228
- ScheduleTriggerSchema,
17229
- EventTriggerSchema
17230
- ]);
17231
16768
  const FunctionConfigSchema = object({
16769
+ name: string().min(1, "Function name cannot be empty").refine((name$1) => !name$1.includes("."), "Function name cannot contain dots"),
17232
16770
  entry: string().min(1, "Entry point cannot be empty"),
17233
- triggers: array(TriggerSchema).optional()
16771
+ triggers: tuple([]).optional()
16772
+ });
16773
+ const FunctionSchema = FunctionConfigSchema.extend({ codePath: string().min(1, "Code path cannot be empty") });
16774
+ const DeployFunctionsResponseSchema = object({
16775
+ deployed: array(string()),
16776
+ deleted: array(string()),
16777
+ errors: array(object({
16778
+ name: string(),
16779
+ message: string()
16780
+ })).nullable()
17234
16781
  });
17235
16782
 
17236
16783
  //#endregion
@@ -17238,7 +16785,19 @@ const FunctionConfigSchema = object({
17238
16785
  async function readFunctionConfig(configPath) {
17239
16786
  const parsed = await readJsonFile(configPath);
17240
16787
  const result = FunctionConfigSchema.safeParse(parsed);
17241
- if (!result.success) throw new Error(`Invalid function configuration in ${configPath}: ${result.error.issues.map((e$1) => e$1.message).join(", ")}`);
16788
+ if (!result.success) throw new Error(`Invalid function configuration in ${configPath}: ${result.error.message}`);
16789
+ return result.data;
16790
+ }
16791
+ async function readFunction(configPath) {
16792
+ const config$2 = await readFunctionConfig(configPath);
16793
+ const codePath = join(dirname(configPath), config$2.entry);
16794
+ if (!await pathExists(codePath)) throw new Error(`Function code file not found: ${codePath} (referenced in ${configPath})`);
16795
+ const functionData = {
16796
+ ...config$2,
16797
+ codePath
16798
+ };
16799
+ const result = FunctionSchema.safeParse(functionData);
16800
+ if (!result.success) throw new Error(`Invalid function in ${configPath}: ${result.error.message}`);
17242
16801
  return result.data;
17243
16802
  }
17244
16803
  async function readAllFunctions(functionsDir) {
@@ -17247,12 +16806,56 @@ async function readAllFunctions(functionsDir) {
17247
16806
  cwd: functionsDir,
17248
16807
  absolute: true
17249
16808
  });
17250
- return await Promise.all(configFiles.map((configPath) => readFunctionConfig(configPath)));
16809
+ const functions = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
16810
+ const names = /* @__PURE__ */ new Set();
16811
+ for (const fn of functions) {
16812
+ if (names.has(fn.name)) throw new Error(`Duplicate function name "${fn.name}"`);
16813
+ names.add(fn.name);
16814
+ }
16815
+ return functions;
16816
+ }
16817
+
16818
+ //#endregion
16819
+ //#region src/core/resources/function/api.ts
16820
+ function toDeployPayloadItem(fn) {
16821
+ return {
16822
+ name: fn.name,
16823
+ entry: fn.entry,
16824
+ files: [{
16825
+ path: fn.entry,
16826
+ content: fn.code
16827
+ }]
16828
+ };
16829
+ }
16830
+ async function deployFunctions(functions) {
16831
+ const appClient = getAppClient();
16832
+ const payload = { functions: functions.map(toDeployPayloadItem) };
16833
+ const response = await appClient.put("backend-functions", {
16834
+ json: payload,
16835
+ timeout: 3e4
16836
+ });
16837
+ return DeployFunctionsResponseSchema.parse(await response.json());
16838
+ }
16839
+
16840
+ //#endregion
16841
+ //#region src/core/resources/function/deploy.ts
16842
+ async function loadFunctionCode(fn) {
16843
+ const code$1 = await readTextFile(fn.codePath);
16844
+ return {
16845
+ ...fn,
16846
+ code: code$1
16847
+ };
16848
+ }
16849
+ async function pushFunctions(functions) {
16850
+ return deployFunctions(await Promise.all(functions.map(loadFunctionCode)));
17251
16851
  }
17252
16852
 
17253
16853
  //#endregion
17254
16854
  //#region src/core/resources/function/resource.ts
17255
- const functionResource = { readAll: readAllFunctions };
16855
+ const functionResource = {
16856
+ readAll: readAllFunctions,
16857
+ push: pushFunctions
16858
+ };
17256
16859
 
17257
16860
  //#endregion
17258
16861
  //#region src/core/project/schema.ts
@@ -26187,10 +25790,436 @@ async function getUserInfo(accessToken) {
26187
25790
  return result.data;
26188
25791
  }
26189
25792
 
25793
+ //#endregion
25794
+ //#region node_modules/chalk/source/vendor/ansi-styles/index.js
25795
+ const ANSI_BACKGROUND_OFFSET = 10;
25796
+ const wrapAnsi16 = (offset = 0) => (code$1) => `\u001B[${code$1 + offset}m`;
25797
+ const wrapAnsi256 = (offset = 0) => (code$1) => `\u001B[${38 + offset};5;${code$1}m`;
25798
+ const wrapAnsi16m = (offset = 0) => (red$1, green$1, blue$1) => `\u001B[${38 + offset};2;${red$1};${green$1};${blue$1}m`;
25799
+ const styles$1 = {
25800
+ modifier: {
25801
+ reset: [0, 0],
25802
+ bold: [1, 22],
25803
+ dim: [2, 22],
25804
+ italic: [3, 23],
25805
+ underline: [4, 24],
25806
+ overline: [53, 55],
25807
+ inverse: [7, 27],
25808
+ hidden: [8, 28],
25809
+ strikethrough: [9, 29]
25810
+ },
25811
+ color: {
25812
+ black: [30, 39],
25813
+ red: [31, 39],
25814
+ green: [32, 39],
25815
+ yellow: [33, 39],
25816
+ blue: [34, 39],
25817
+ magenta: [35, 39],
25818
+ cyan: [36, 39],
25819
+ white: [37, 39],
25820
+ blackBright: [90, 39],
25821
+ gray: [90, 39],
25822
+ grey: [90, 39],
25823
+ redBright: [91, 39],
25824
+ greenBright: [92, 39],
25825
+ yellowBright: [93, 39],
25826
+ blueBright: [94, 39],
25827
+ magentaBright: [95, 39],
25828
+ cyanBright: [96, 39],
25829
+ whiteBright: [97, 39]
25830
+ },
25831
+ bgColor: {
25832
+ bgBlack: [40, 49],
25833
+ bgRed: [41, 49],
25834
+ bgGreen: [42, 49],
25835
+ bgYellow: [43, 49],
25836
+ bgBlue: [44, 49],
25837
+ bgMagenta: [45, 49],
25838
+ bgCyan: [46, 49],
25839
+ bgWhite: [47, 49],
25840
+ bgBlackBright: [100, 49],
25841
+ bgGray: [100, 49],
25842
+ bgGrey: [100, 49],
25843
+ bgRedBright: [101, 49],
25844
+ bgGreenBright: [102, 49],
25845
+ bgYellowBright: [103, 49],
25846
+ bgBlueBright: [104, 49],
25847
+ bgMagentaBright: [105, 49],
25848
+ bgCyanBright: [106, 49],
25849
+ bgWhiteBright: [107, 49]
25850
+ }
25851
+ };
25852
+ const modifierNames = Object.keys(styles$1.modifier);
25853
+ const foregroundColorNames = Object.keys(styles$1.color);
25854
+ const backgroundColorNames = Object.keys(styles$1.bgColor);
25855
+ const colorNames = [...foregroundColorNames, ...backgroundColorNames];
25856
+ function assembleStyles() {
25857
+ const codes = /* @__PURE__ */ new Map();
25858
+ for (const [groupName, group] of Object.entries(styles$1)) {
25859
+ for (const [styleName, style] of Object.entries(group)) {
25860
+ styles$1[styleName] = {
25861
+ open: `\u001B[${style[0]}m`,
25862
+ close: `\u001B[${style[1]}m`
25863
+ };
25864
+ group[styleName] = styles$1[styleName];
25865
+ codes.set(style[0], style[1]);
25866
+ }
25867
+ Object.defineProperty(styles$1, groupName, {
25868
+ value: group,
25869
+ enumerable: false
25870
+ });
25871
+ }
25872
+ Object.defineProperty(styles$1, "codes", {
25873
+ value: codes,
25874
+ enumerable: false
25875
+ });
25876
+ styles$1.color.close = "\x1B[39m";
25877
+ styles$1.bgColor.close = "\x1B[49m";
25878
+ styles$1.color.ansi = wrapAnsi16();
25879
+ styles$1.color.ansi256 = wrapAnsi256();
25880
+ styles$1.color.ansi16m = wrapAnsi16m();
25881
+ styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
25882
+ styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
25883
+ styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
25884
+ Object.defineProperties(styles$1, {
25885
+ rgbToAnsi256: {
25886
+ value(red$1, green$1, blue$1) {
25887
+ if (red$1 === green$1 && green$1 === blue$1) {
25888
+ if (red$1 < 8) return 16;
25889
+ if (red$1 > 248) return 231;
25890
+ return Math.round((red$1 - 8) / 247 * 24) + 232;
25891
+ }
25892
+ return 16 + 36 * Math.round(red$1 / 255 * 5) + 6 * Math.round(green$1 / 255 * 5) + Math.round(blue$1 / 255 * 5);
25893
+ },
25894
+ enumerable: false
25895
+ },
25896
+ hexToRgb: {
25897
+ value(hex) {
25898
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
25899
+ if (!matches) return [
25900
+ 0,
25901
+ 0,
25902
+ 0
25903
+ ];
25904
+ let [colorString] = matches;
25905
+ if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
25906
+ const integer$1 = Number.parseInt(colorString, 16);
25907
+ return [
25908
+ integer$1 >> 16 & 255,
25909
+ integer$1 >> 8 & 255,
25910
+ integer$1 & 255
25911
+ ];
25912
+ },
25913
+ enumerable: false
25914
+ },
25915
+ hexToAnsi256: {
25916
+ value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
25917
+ enumerable: false
25918
+ },
25919
+ ansi256ToAnsi: {
25920
+ value(code$1) {
25921
+ if (code$1 < 8) return 30 + code$1;
25922
+ if (code$1 < 16) return 90 + (code$1 - 8);
25923
+ let red$1;
25924
+ let green$1;
25925
+ let blue$1;
25926
+ if (code$1 >= 232) {
25927
+ red$1 = ((code$1 - 232) * 10 + 8) / 255;
25928
+ green$1 = red$1;
25929
+ blue$1 = red$1;
25930
+ } else {
25931
+ code$1 -= 16;
25932
+ const remainder = code$1 % 36;
25933
+ red$1 = Math.floor(code$1 / 36) / 5;
25934
+ green$1 = Math.floor(remainder / 6) / 5;
25935
+ blue$1 = remainder % 6 / 5;
25936
+ }
25937
+ const value = Math.max(red$1, green$1, blue$1) * 2;
25938
+ if (value === 0) return 30;
25939
+ let result = 30 + (Math.round(blue$1) << 2 | Math.round(green$1) << 1 | Math.round(red$1));
25940
+ if (value === 2) result += 60;
25941
+ return result;
25942
+ },
25943
+ enumerable: false
25944
+ },
25945
+ rgbToAnsi: {
25946
+ value: (red$1, green$1, blue$1) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red$1, green$1, blue$1)),
25947
+ enumerable: false
25948
+ },
25949
+ hexToAnsi: {
25950
+ value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
25951
+ enumerable: false
25952
+ }
25953
+ });
25954
+ return styles$1;
25955
+ }
25956
+ const ansiStyles = assembleStyles();
25957
+ var ansi_styles_default = ansiStyles;
25958
+
25959
+ //#endregion
25960
+ //#region node_modules/chalk/source/vendor/supports-color/index.js
25961
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
25962
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
25963
+ const position = argv.indexOf(prefix + flag);
25964
+ const terminatorPosition = argv.indexOf("--");
25965
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
25966
+ }
25967
+ const { env } = y;
25968
+ let flagForceColor;
25969
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
25970
+ else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
25971
+ function envForceColor() {
25972
+ if ("FORCE_COLOR" in env) {
25973
+ if (env.FORCE_COLOR === "true") return 1;
25974
+ if (env.FORCE_COLOR === "false") return 0;
25975
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
25976
+ }
25977
+ }
25978
+ function translateLevel(level) {
25979
+ if (level === 0) return false;
25980
+ return {
25981
+ level,
25982
+ hasBasic: true,
25983
+ has256: level >= 2,
25984
+ has16m: level >= 3
25985
+ };
25986
+ }
25987
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
25988
+ const noFlagForceColor = envForceColor();
25989
+ if (noFlagForceColor !== void 0) flagForceColor = noFlagForceColor;
25990
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
25991
+ if (forceColor === 0) return 0;
25992
+ if (sniffFlags) {
25993
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
25994
+ if (hasFlag("color=256")) return 2;
25995
+ }
25996
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) return 1;
25997
+ if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
25998
+ const min = forceColor || 0;
25999
+ if (env.TERM === "dumb") return min;
26000
+ if (y.platform === "win32") {
26001
+ const osRelease = os.release().split(".");
26002
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
26003
+ return 1;
26004
+ }
26005
+ if ("CI" in env) {
26006
+ if ([
26007
+ "GITHUB_ACTIONS",
26008
+ "GITEA_ACTIONS",
26009
+ "CIRCLECI"
26010
+ ].some((key) => key in env)) return 3;
26011
+ if ([
26012
+ "TRAVIS",
26013
+ "APPVEYOR",
26014
+ "GITLAB_CI",
26015
+ "BUILDKITE",
26016
+ "DRONE"
26017
+ ].some((sign) => sign in env) || env.CI_NAME === "codeship") return 1;
26018
+ return min;
26019
+ }
26020
+ if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
26021
+ if (env.COLORTERM === "truecolor") return 3;
26022
+ if (env.TERM === "xterm-kitty") return 3;
26023
+ if (env.TERM === "xterm-ghostty") return 3;
26024
+ if (env.TERM === "wezterm") return 3;
26025
+ if ("TERM_PROGRAM" in env) {
26026
+ const version$2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
26027
+ switch (env.TERM_PROGRAM) {
26028
+ case "iTerm.app": return version$2 >= 3 ? 3 : 2;
26029
+ case "Apple_Terminal": return 2;
26030
+ }
26031
+ }
26032
+ if (/-256(color)?$/i.test(env.TERM)) return 2;
26033
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
26034
+ if ("COLORTERM" in env) return 1;
26035
+ return min;
26036
+ }
26037
+ function createSupportsColor(stream, options = {}) {
26038
+ return translateLevel(_supportsColor(stream, {
26039
+ streamIsTTY: stream && stream.isTTY,
26040
+ ...options
26041
+ }));
26042
+ }
26043
+ const supportsColor = {
26044
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
26045
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
26046
+ };
26047
+ var supports_color_default = supportsColor;
26048
+
26049
+ //#endregion
26050
+ //#region node_modules/chalk/source/utilities.js
26051
+ function stringReplaceAll(string$2, substring, replacer) {
26052
+ let index = string$2.indexOf(substring);
26053
+ if (index === -1) return string$2;
26054
+ const substringLength = substring.length;
26055
+ let endIndex = 0;
26056
+ let returnValue = "";
26057
+ do {
26058
+ returnValue += string$2.slice(endIndex, index) + substring + replacer;
26059
+ endIndex = index + substringLength;
26060
+ index = string$2.indexOf(substring, endIndex);
26061
+ } while (index !== -1);
26062
+ returnValue += string$2.slice(endIndex);
26063
+ return returnValue;
26064
+ }
26065
+ function stringEncaseCRLFWithFirstIndex(string$2, prefix, postfix, index) {
26066
+ let endIndex = 0;
26067
+ let returnValue = "";
26068
+ do {
26069
+ const gotCR = string$2[index - 1] === "\r";
26070
+ returnValue += string$2.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
26071
+ endIndex = index + 1;
26072
+ index = string$2.indexOf("\n", endIndex);
26073
+ } while (index !== -1);
26074
+ returnValue += string$2.slice(endIndex);
26075
+ return returnValue;
26076
+ }
26077
+
26078
+ //#endregion
26079
+ //#region node_modules/chalk/source/index.js
26080
+ const { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
26081
+ const GENERATOR = Symbol("GENERATOR");
26082
+ const STYLER = Symbol("STYLER");
26083
+ const IS_EMPTY = Symbol("IS_EMPTY");
26084
+ const levelMapping = [
26085
+ "ansi",
26086
+ "ansi",
26087
+ "ansi256",
26088
+ "ansi16m"
26089
+ ];
26090
+ const styles = Object.create(null);
26091
+ const applyOptions = (object$1, options = {}) => {
26092
+ 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");
26093
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
26094
+ object$1.level = options.level === void 0 ? colorLevel : options.level;
26095
+ };
26096
+ const chalkFactory = (options) => {
26097
+ const chalk$1 = (...strings) => strings.join(" ");
26098
+ applyOptions(chalk$1, options);
26099
+ Object.setPrototypeOf(chalk$1, createChalk.prototype);
26100
+ return chalk$1;
26101
+ };
26102
+ function createChalk(options) {
26103
+ return chalkFactory(options);
26104
+ }
26105
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
26106
+ for (const [styleName, style] of Object.entries(ansi_styles_default)) styles[styleName] = { get() {
26107
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
26108
+ Object.defineProperty(this, styleName, { value: builder });
26109
+ return builder;
26110
+ } };
26111
+ styles.visible = { get() {
26112
+ const builder = createBuilder(this, this[STYLER], true);
26113
+ Object.defineProperty(this, "visible", { value: builder });
26114
+ return builder;
26115
+ } };
26116
+ const getModelAnsi = (model, level, type, ...arguments_) => {
26117
+ if (model === "rgb") {
26118
+ if (level === "ansi16m") return ansi_styles_default[type].ansi16m(...arguments_);
26119
+ if (level === "ansi256") return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
26120
+ return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
26121
+ }
26122
+ if (model === "hex") return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
26123
+ return ansi_styles_default[type][model](...arguments_);
26124
+ };
26125
+ for (const model of [
26126
+ "rgb",
26127
+ "hex",
26128
+ "ansi256"
26129
+ ]) {
26130
+ styles[model] = { get() {
26131
+ const { level } = this;
26132
+ return function(...arguments_) {
26133
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
26134
+ return createBuilder(this, styler, this[IS_EMPTY]);
26135
+ };
26136
+ } };
26137
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
26138
+ styles[bgModel] = { get() {
26139
+ const { level } = this;
26140
+ return function(...arguments_) {
26141
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
26142
+ return createBuilder(this, styler, this[IS_EMPTY]);
26143
+ };
26144
+ } };
26145
+ }
26146
+ const proto = Object.defineProperties(() => {}, {
26147
+ ...styles,
26148
+ level: {
26149
+ enumerable: true,
26150
+ get() {
26151
+ return this[GENERATOR].level;
26152
+ },
26153
+ set(level) {
26154
+ this[GENERATOR].level = level;
26155
+ }
26156
+ }
26157
+ });
26158
+ const createStyler = (open, close, parent) => {
26159
+ let openAll;
26160
+ let closeAll;
26161
+ if (parent === void 0) {
26162
+ openAll = open;
26163
+ closeAll = close;
26164
+ } else {
26165
+ openAll = parent.openAll + open;
26166
+ closeAll = close + parent.closeAll;
26167
+ }
26168
+ return {
26169
+ open,
26170
+ close,
26171
+ openAll,
26172
+ closeAll,
26173
+ parent
26174
+ };
26175
+ };
26176
+ const createBuilder = (self$1, _styler, _isEmpty) => {
26177
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
26178
+ Object.setPrototypeOf(builder, proto);
26179
+ builder[GENERATOR] = self$1;
26180
+ builder[STYLER] = _styler;
26181
+ builder[IS_EMPTY] = _isEmpty;
26182
+ return builder;
26183
+ };
26184
+ const applyStyle = (self$1, string$2) => {
26185
+ if (self$1.level <= 0 || !string$2) return self$1[IS_EMPTY] ? "" : string$2;
26186
+ let styler = self$1[STYLER];
26187
+ if (styler === void 0) return string$2;
26188
+ const { openAll, closeAll } = styler;
26189
+ if (string$2.includes("\x1B")) while (styler !== void 0) {
26190
+ string$2 = stringReplaceAll(string$2, styler.close, styler.open);
26191
+ styler = styler.parent;
26192
+ }
26193
+ const lfIndex = string$2.indexOf("\n");
26194
+ if (lfIndex !== -1) string$2 = stringEncaseCRLFWithFirstIndex(string$2, closeAll, openAll, lfIndex);
26195
+ return openAll + string$2 + closeAll;
26196
+ };
26197
+ Object.defineProperties(createChalk.prototype, styles);
26198
+ const chalk = createChalk();
26199
+ const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
26200
+ var source_default = chalk;
26201
+
26202
+ //#endregion
26203
+ //#region src/cli/utils/theme.ts
26204
+ /**
26205
+ * Base44 CLI theme configuration
26206
+ */
26207
+ const theme = {
26208
+ colors: {
26209
+ base44Orange: source_default.hex("#E86B3C"),
26210
+ shinyOrange: source_default.hex("#FFD700"),
26211
+ links: source_default.hex("#00D4FF"),
26212
+ white: source_default.white
26213
+ },
26214
+ styles: {
26215
+ header: source_default.dim,
26216
+ bold: source_default.bold,
26217
+ dim: source_default.dim
26218
+ }
26219
+ };
26220
+
26190
26221
  //#endregion
26191
26222
  //#region src/cli/utils/animate.ts
26192
- const orange$2 = source_default.hex("#E86B3C");
26193
- const gold = source_default.hex("#FFD700");
26194
26223
  /**
26195
26224
  * Sleep for a specified number of milliseconds.
26196
26225
  */
@@ -26207,13 +26236,13 @@ async function animateLineReveal(line, duration$2) {
26207
26236
  const progress = step / steps;
26208
26237
  const revealIndex = Math.floor(progress * line.length);
26209
26238
  let output = "";
26210
- for (let i$1 = 0; i$1 < line.length; i$1++) if (i$1 < revealIndex) output += orange$2(line[i$1]);
26211
- else if (i$1 === revealIndex) output += gold(line[i$1]);
26212
- else output += source_default.dim(line[i$1]);
26239
+ for (let i$1 = 0; i$1 < line.length; i$1++) if (i$1 < revealIndex) output += theme.colors.base44Orange(line[i$1]);
26240
+ else if (i$1 === revealIndex) output += theme.colors.shinyOrange(line[i$1]);
26241
+ else output += theme.styles.dim(line[i$1]);
26213
26242
  process.stdout.write(`\r${output}`);
26214
26243
  await sleep(stepDuration);
26215
26244
  }
26216
- process.stdout.write(`\r${orange$2(line)}\n`);
26245
+ process.stdout.write(`\r${theme.colors.base44Orange(line)}\n`);
26217
26246
  }
26218
26247
  /**
26219
26248
  * Quick shimmer pass over the entire banner.
@@ -26230,15 +26259,15 @@ async function shimmerPass(lines, duration$2) {
26230
26259
  let output = "";
26231
26260
  for (let i$1 = 0; i$1 < line.length; i$1++) {
26232
26261
  const dist = Math.abs(i$1 - shimmerPos);
26233
- if (dist < 3) output += dist === 0 ? source_default.white(line[i$1]) : gold(line[i$1]);
26234
- else output += orange$2(line[i$1]);
26262
+ if (dist < 3) output += dist === 0 ? theme.colors.white(line[i$1]) : theme.colors.shinyOrange(line[i$1]);
26263
+ else output += theme.colors.base44Orange(line[i$1]);
26235
26264
  }
26236
26265
  console.log(output);
26237
26266
  }
26238
26267
  await sleep(stepDuration);
26239
26268
  }
26240
26269
  process.stdout.write(moveUp);
26241
- for (const line of lines) console.log(orange$2(line));
26270
+ for (const line of lines) console.log(theme.colors.base44Orange(line));
26242
26271
  }
26243
26272
  /**
26244
26273
  * Animate the output with a smooth line-by-line reveal.
@@ -26258,7 +26287,6 @@ async function printAnimatedLines(lines) {
26258
26287
 
26259
26288
  //#endregion
26260
26289
  //#region src/cli/utils/banner.ts
26261
- const orange$1 = source_default.hex("#E86B3C");
26262
26290
  const BANNER_LINES = [
26263
26291
  "██████╗ █████╗ ███████╗███████╗ ██╗ ██╗██╗ ██╗",
26264
26292
  "██╔══██╗██╔══██╗██╔════╝██╔════╝ ██║ ██║██║ ██║",
@@ -26273,12 +26301,11 @@ const BANNER_LINES = [
26273
26301
  */
26274
26302
  async function printBanner() {
26275
26303
  if (process.stdout.isTTY) await printAnimatedLines(BANNER_LINES);
26276
- else console.log(orange$1(BANNER_LINES.join("\n")));
26304
+ else console.log(theme.colors.base44Orange(BANNER_LINES.join("\n")));
26277
26305
  }
26278
26306
 
26279
26307
  //#endregion
26280
26308
  //#region src/cli/utils/runCommand.ts
26281
- const base44Color = source_default.bgHex("#E86B3C");
26282
26309
  /**
26283
26310
  * Wraps a command function with the Base44 intro/outro and error handling.
26284
26311
  * All CLI commands should use this utility to ensure consistent branding.
@@ -26322,7 +26349,7 @@ async function runCommand(commandFn, options) {
26322
26349
  if (options?.fullBanner) {
26323
26350
  await printBanner();
26324
26351
  Ie("");
26325
- } else Ie(base44Color(" Base 44 "));
26352
+ } else Ie(theme.colors.base44Orange(" Base 44 "));
26326
26353
  await loadProjectEnv();
26327
26354
  try {
26328
26355
  if (options?.requireAuth) {
@@ -26414,7 +26441,7 @@ async function generateAndDisplayDeviceCode() {
26414
26441
  successMessage: "Device code generated",
26415
26442
  errorMessage: "Failed to generate device code"
26416
26443
  });
26417
- M.info(`Verification code: ${source_default.bold(deviceCodeResponse.userCode)}\nPlease confirm this code at: ${deviceCodeResponse.verificationUri}`);
26444
+ M.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}\nPlease confirm this code at: ${deviceCodeResponse.verificationUri}`);
26418
26445
  return deviceCodeResponse;
26419
26446
  }
26420
26447
  async function waitForAuthentication(deviceCode, expiresIn, interval) {
@@ -26458,7 +26485,7 @@ async function login() {
26458
26485
  const token = await waitForAuthentication(deviceCodeResponse.deviceCode, deviceCodeResponse.expiresIn, deviceCodeResponse.interval);
26459
26486
  const userInfo = await getUserInfo(token.accessToken);
26460
26487
  await saveAuthData(token, userInfo);
26461
- return { outroMessage: `Successfully logged in as ${source_default.bold(userInfo.email)}` };
26488
+ return { outroMessage: `Successfully logged in as ${theme.styles.bold(userInfo.email)}` };
26462
26489
  }
26463
26490
  const loginCommand = new Command("login").description("Authenticate with Base44").action(async () => {
26464
26491
  await runCommand(login);
@@ -26468,7 +26495,7 @@ const loginCommand = new Command("login").description("Authenticate with Base44"
26468
26495
  //#region src/cli/commands/auth/whoami.ts
26469
26496
  async function whoami() {
26470
26497
  const auth = await readAuth();
26471
- return { outroMessage: `Logged in as: ${source_default.bold(auth.email)}` };
26498
+ return { outroMessage: `Logged in as: ${theme.styles.bold(auth.email)}` };
26472
26499
  }
26473
26500
  const whoamiCommand = new Command("whoami").description("Display current authenticated user").action(async () => {
26474
26501
  await runCommand(whoami, { requireAuth: true });
@@ -31488,6 +31515,30 @@ const entitiesPushCommand = new Command("entities").description("Manage project
31488
31515
  await runCommand(pushEntitiesAction, { requireAuth: true });
31489
31516
  }));
31490
31517
 
31518
+ //#endregion
31519
+ //#region src/cli/commands/functions/deploy.ts
31520
+ async function deployFunctionsAction() {
31521
+ const { functions } = await readProjectConfig();
31522
+ if (functions.length === 0) return { outroMessage: "No functions found. Create functions in the 'functions' directory." };
31523
+ M.info(`Found ${functions.length} ${functions.length === 1 ? "function" : "functions"} to deploy`);
31524
+ const result = await runTask("Deploying functions to Base44", async () => {
31525
+ return await pushFunctions(functions);
31526
+ }, {
31527
+ successMessage: "Functions deployed successfully",
31528
+ errorMessage: "Failed to deploy functions"
31529
+ });
31530
+ if (result.deployed.length > 0) M.success(`Deployed: ${result.deployed.join(", ")}`);
31531
+ if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
31532
+ if (result.errors && result.errors.length > 0) {
31533
+ const errorMessages = result.errors.map((e$1) => `'${e$1.name}' function: ${e$1.message}`).join("\n");
31534
+ throw new Error(`Function deployment errors:\n${errorMessages}`);
31535
+ }
31536
+ return {};
31537
+ }
31538
+ const functionsDeployCommand = new Command("functions").description("Manage project functions").addCommand(new Command("deploy").description("Deploy local functions to Base44").action(async () => {
31539
+ await runCommand(deployFunctionsAction, { requireAuth: true });
31540
+ }));
31541
+
31491
31542
  //#endregion
31492
31543
  //#region node_modules/is-plain-obj/index.js
31493
31544
  function isPlainObject(value) {
@@ -32112,7 +32163,7 @@ const green = format(32, 39);
32112
32163
  const yellow = format(33, 39);
32113
32164
  const blue = format(34, 39);
32114
32165
  const magenta = format(35, 39);
32115
- const cyan$1 = format(36, 39);
32166
+ const cyan = format(36, 39);
32116
32167
  const white = format(37, 39);
32117
32168
  const gray = format(90, 39);
32118
32169
  const bgBlack = format(40, 49);
@@ -38156,8 +38207,6 @@ var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
38156
38207
  //#endregion
38157
38208
  //#region src/cli/commands/project/create.ts
38158
38209
  var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
38159
- const orange = source_default.hex("#E86B3C");
38160
- const cyan = source_default.hex("#00D4FF");
38161
38210
  const DEFAULT_TEMPLATE_ID = "backend-only";
38162
38211
  async function getDefaultTemplate() {
38163
38212
  const template = (await listTemplates()).find((t) => t.id === DEFAULT_TEMPLATE_ID);
@@ -38201,7 +38250,7 @@ async function createInteractive(options) {
38201
38250
  projectPath: async ({ results }) => {
38202
38251
  const suggestedPath = `./${(0, import_lodash.default)(results.name)}`;
38203
38252
  return he({
38204
- message: "Where should we create the base44 folder?",
38253
+ message: "Where should we create your project?",
38205
38254
  placeholder: suggestedPath,
38206
38255
  initialValue: suggestedPath
38207
38256
  });
@@ -38237,7 +38286,7 @@ async function executeCreate({ template, name: rawName, description, projectPath
38237
38286
  template
38238
38287
  });
38239
38288
  }, {
38240
- successMessage: orange("Project created successfully"),
38289
+ successMessage: theme.colors.base44Orange("Project created successfully"),
38241
38290
  errorMessage: "Failed to create project"
38242
38291
  });
38243
38292
  await loadProjectEnv(resolvedPath);
@@ -38246,21 +38295,21 @@ async function executeCreate({ template, name: rawName, description, projectPath
38246
38295
  if (entities.length > 0) {
38247
38296
  let shouldPushEntities;
38248
38297
  if (isInteractive) {
38249
- const result = await ye({ message: "Would you like to push entities now?" });
38298
+ const result = await ye({ message: "Set up the backend data now? (This pushes the data models used by the template to Base44)" });
38250
38299
  shouldPushEntities = !pD(result) && result;
38251
38300
  } else shouldPushEntities = !!deploy;
38252
- if (shouldPushEntities) await runTask(`Pushing ${entities.length} entities to Base44...`, async () => {
38301
+ if (shouldPushEntities) await runTask(`Pushing ${entities.length} data models to Base44...`, async () => {
38253
38302
  await pushEntities(entities);
38254
38303
  }, {
38255
- successMessage: orange("Entities pushed successfully"),
38256
- errorMessage: "Failed to push entities"
38304
+ successMessage: theme.colors.base44Orange("Data models pushed successfully"),
38305
+ errorMessage: "Failed to push data models"
38257
38306
  });
38258
38307
  }
38259
38308
  if (project.site) {
38260
38309
  const { installCommand, buildCommand, outputDirectory } = project.site;
38261
38310
  let shouldDeploy;
38262
38311
  if (isInteractive) {
38263
- const result = await ye({ message: "Would you like to deploy the site now?" });
38312
+ const result = await ye({ message: "Would you like to deploy the site now? (Hosted on Base44)" });
38264
38313
  shouldDeploy = !pD(result) && result;
38265
38314
  } else shouldDeploy = !!deploy;
38266
38315
  if (shouldDeploy && installCommand && buildCommand && outputDirectory) {
@@ -38277,17 +38326,17 @@ async function executeCreate({ template, name: rawName, description, projectPath
38277
38326
  updateMessage("Deploying site...");
38278
38327
  return await deploySite(join(resolvedPath, outputDirectory));
38279
38328
  }, {
38280
- successMessage: orange("Site deployed successfully"),
38329
+ successMessage: theme.colors.base44Orange("Site deployed successfully"),
38281
38330
  errorMessage: "Failed to deploy site"
38282
38331
  });
38283
38332
  finalAppUrl = appUrl;
38284
38333
  }
38285
38334
  }
38286
38335
  const dashboardUrl = `${getBase44ApiUrl()}/apps/${projectId}/editor/preview`;
38287
- M.message(`${source_default.dim("Project")}: ${orange(name$1)}`);
38288
- M.message(`${source_default.dim("Dashboard")}: ${cyan(dashboardUrl)}`);
38289
- if (finalAppUrl) M.message(`${source_default.dim("Site")}: ${cyan(finalAppUrl)}`);
38290
- return { outroMessage: "Your project is set and ready to use" };
38336
+ M.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name$1)}`);
38337
+ M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
38338
+ if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
38339
+ return { outroMessage: "Your project is set up and ready to use" };
38291
38340
  }
38292
38341
  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) => {
38293
38342
  await chooseCreate(options);
@@ -38316,7 +38365,7 @@ const siteDeployCommand = new Command("site").description("Manage site deploymen
38316
38365
 
38317
38366
  //#endregion
38318
38367
  //#region package.json
38319
- var version = "0.0.9";
38368
+ var version = "0.0.11";
38320
38369
 
38321
38370
  //#endregion
38322
38371
  //#region src/cli/index.ts
@@ -38327,6 +38376,7 @@ program.addCommand(whoamiCommand);
38327
38376
  program.addCommand(logoutCommand);
38328
38377
  program.addCommand(createCommand);
38329
38378
  program.addCommand(entitiesPushCommand);
38379
+ program.addCommand(functionsDeployCommand);
38330
38380
  program.addCommand(siteDeployCommand);
38331
38381
  program.parse();
38332
38382