@base44-preview/cli 0.0.47-pr.422.2c16c92 → 0.0.47-pr.422.8b60a4a

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
@@ -46,6 +46,134 @@ var __export = (target, all) => {
46
46
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
47
47
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
48
48
 
49
+ // ../../node_modules/picocolors/picocolors.js
50
+ var require_picocolors = __commonJS((exports, module) => {
51
+ var p = process || {};
52
+ var argv = p.argv || [];
53
+ var env = p.env || {};
54
+ var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
55
+ var formatter = (open, close, replace = open) => (input) => {
56
+ let string = "" + input, index = string.indexOf(close, open.length);
57
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
58
+ };
59
+ var replaceClose = (string, close, replace, index) => {
60
+ let result = "", cursor = 0;
61
+ do {
62
+ result += string.substring(cursor, index) + replace;
63
+ cursor = index + close.length;
64
+ index = string.indexOf(close, cursor);
65
+ } while (~index);
66
+ return result + string.substring(cursor);
67
+ };
68
+ var createColors = (enabled = isColorSupported) => {
69
+ let f = enabled ? formatter : () => String;
70
+ return {
71
+ isColorSupported: enabled,
72
+ reset: f("\x1B[0m", "\x1B[0m"),
73
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
74
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
75
+ italic: f("\x1B[3m", "\x1B[23m"),
76
+ underline: f("\x1B[4m", "\x1B[24m"),
77
+ inverse: f("\x1B[7m", "\x1B[27m"),
78
+ hidden: f("\x1B[8m", "\x1B[28m"),
79
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
80
+ black: f("\x1B[30m", "\x1B[39m"),
81
+ red: f("\x1B[31m", "\x1B[39m"),
82
+ green: f("\x1B[32m", "\x1B[39m"),
83
+ yellow: f("\x1B[33m", "\x1B[39m"),
84
+ blue: f("\x1B[34m", "\x1B[39m"),
85
+ magenta: f("\x1B[35m", "\x1B[39m"),
86
+ cyan: f("\x1B[36m", "\x1B[39m"),
87
+ white: f("\x1B[37m", "\x1B[39m"),
88
+ gray: f("\x1B[90m", "\x1B[39m"),
89
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
90
+ bgRed: f("\x1B[41m", "\x1B[49m"),
91
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
92
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
93
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
94
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
95
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
96
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
97
+ blackBright: f("\x1B[90m", "\x1B[39m"),
98
+ redBright: f("\x1B[91m", "\x1B[39m"),
99
+ greenBright: f("\x1B[92m", "\x1B[39m"),
100
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
101
+ blueBright: f("\x1B[94m", "\x1B[39m"),
102
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
103
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
104
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
105
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
106
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
107
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
108
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
109
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
110
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
111
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
112
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
113
+ };
114
+ };
115
+ module.exports = createColors();
116
+ module.exports.createColors = createColors;
117
+ });
118
+
119
+ // ../../node_modules/sisteransi/src/index.js
120
+ var require_src = __commonJS((exports, module) => {
121
+ var ESC = "\x1B";
122
+ var CSI = `${ESC}[`;
123
+ var beep = "\x07";
124
+ var cursor = {
125
+ to(x, y) {
126
+ if (!y)
127
+ return `${CSI}${x + 1}G`;
128
+ return `${CSI}${y + 1};${x + 1}H`;
129
+ },
130
+ move(x, y) {
131
+ let ret = "";
132
+ if (x < 0)
133
+ ret += `${CSI}${-x}D`;
134
+ else if (x > 0)
135
+ ret += `${CSI}${x}C`;
136
+ if (y < 0)
137
+ ret += `${CSI}${-y}A`;
138
+ else if (y > 0)
139
+ ret += `${CSI}${y}B`;
140
+ return ret;
141
+ },
142
+ up: (count = 1) => `${CSI}${count}A`,
143
+ down: (count = 1) => `${CSI}${count}B`,
144
+ forward: (count = 1) => `${CSI}${count}C`,
145
+ backward: (count = 1) => `${CSI}${count}D`,
146
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
147
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
148
+ left: `${CSI}G`,
149
+ hide: `${CSI}?25l`,
150
+ show: `${CSI}?25h`,
151
+ save: `${ESC}7`,
152
+ restore: `${ESC}8`
153
+ };
154
+ var scroll = {
155
+ up: (count = 1) => `${CSI}S`.repeat(count),
156
+ down: (count = 1) => `${CSI}T`.repeat(count)
157
+ };
158
+ var erase = {
159
+ screen: `${CSI}2J`,
160
+ up: (count = 1) => `${CSI}1J`.repeat(count),
161
+ down: (count = 1) => `${CSI}J`.repeat(count),
162
+ line: `${CSI}2K`,
163
+ lineEnd: `${CSI}K`,
164
+ lineStart: `${CSI}1K`,
165
+ lines(count) {
166
+ let clear = "";
167
+ for (let i = 0;i < count; i++)
168
+ clear += this.line + (i < count - 1 ? cursor.up() : "");
169
+ if (count)
170
+ clear += cursor.left;
171
+ return clear;
172
+ }
173
+ };
174
+ module.exports = { cursor, scroll, erase, beep };
175
+ });
176
+
49
177
  // ../../node_modules/commander/lib/error.js
50
178
  var require_error = __commonJS((exports) => {
51
179
  class CommanderError extends Error {
@@ -555,28 +683,28 @@ var require_suggestSimilar = __commonJS((exports) => {
555
683
  function editDistance(a, b) {
556
684
  if (Math.abs(a.length - b.length) > maxDistance)
557
685
  return Math.max(a.length, b.length);
558
- const d = [];
686
+ const d2 = [];
559
687
  for (let i = 0;i <= a.length; i++) {
560
- d[i] = [i];
688
+ d2[i] = [i];
561
689
  }
562
- for (let j = 0;j <= b.length; j++) {
563
- d[0][j] = j;
690
+ for (let j2 = 0;j2 <= b.length; j2++) {
691
+ d2[0][j2] = j2;
564
692
  }
565
- for (let j = 1;j <= b.length; j++) {
693
+ for (let j2 = 1;j2 <= b.length; j2++) {
566
694
  for (let i = 1;i <= a.length; i++) {
567
695
  let cost = 1;
568
- if (a[i - 1] === b[j - 1]) {
696
+ if (a[i - 1] === b[j2 - 1]) {
569
697
  cost = 0;
570
698
  } else {
571
699
  cost = 1;
572
700
  }
573
- d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);
574
- if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
575
- d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);
701
+ d2[i][j2] = Math.min(d2[i - 1][j2] + 1, d2[i][j2 - 1] + 1, d2[i - 1][j2 - 1] + cost);
702
+ if (i > 1 && j2 > 1 && a[i - 1] === b[j2 - 2] && a[i - 2] === b[j2 - 1]) {
703
+ d2[i][j2] = Math.min(d2[i][j2], d2[i - 2][j2 - 2] + 1);
576
704
  }
577
705
  }
578
706
  }
579
- return d[a.length][b.length];
707
+ return d2[a.length][b.length];
580
708
  }
581
709
  function suggestSimilar(word, candidates) {
582
710
  if (!candidates || candidates.length === 0)
@@ -1885,134 +2013,6 @@ var require_commander = __commonJS((exports) => {
1885
2013
  exports.InvalidOptionArgumentError = InvalidArgumentError;
1886
2014
  });
1887
2015
 
1888
- // ../../node_modules/picocolors/picocolors.js
1889
- var require_picocolors = __commonJS((exports, module) => {
1890
- var p = process || {};
1891
- var argv = p.argv || [];
1892
- var env = p.env || {};
1893
- var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
1894
- var formatter = (open, close, replace = open) => (input) => {
1895
- let string = "" + input, index = string.indexOf(close, open.length);
1896
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
1897
- };
1898
- var replaceClose = (string, close, replace, index) => {
1899
- let result = "", cursor = 0;
1900
- do {
1901
- result += string.substring(cursor, index) + replace;
1902
- cursor = index + close.length;
1903
- index = string.indexOf(close, cursor);
1904
- } while (~index);
1905
- return result + string.substring(cursor);
1906
- };
1907
- var createColors = (enabled = isColorSupported) => {
1908
- let f = enabled ? formatter : () => String;
1909
- return {
1910
- isColorSupported: enabled,
1911
- reset: f("\x1B[0m", "\x1B[0m"),
1912
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
1913
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
1914
- italic: f("\x1B[3m", "\x1B[23m"),
1915
- underline: f("\x1B[4m", "\x1B[24m"),
1916
- inverse: f("\x1B[7m", "\x1B[27m"),
1917
- hidden: f("\x1B[8m", "\x1B[28m"),
1918
- strikethrough: f("\x1B[9m", "\x1B[29m"),
1919
- black: f("\x1B[30m", "\x1B[39m"),
1920
- red: f("\x1B[31m", "\x1B[39m"),
1921
- green: f("\x1B[32m", "\x1B[39m"),
1922
- yellow: f("\x1B[33m", "\x1B[39m"),
1923
- blue: f("\x1B[34m", "\x1B[39m"),
1924
- magenta: f("\x1B[35m", "\x1B[39m"),
1925
- cyan: f("\x1B[36m", "\x1B[39m"),
1926
- white: f("\x1B[37m", "\x1B[39m"),
1927
- gray: f("\x1B[90m", "\x1B[39m"),
1928
- bgBlack: f("\x1B[40m", "\x1B[49m"),
1929
- bgRed: f("\x1B[41m", "\x1B[49m"),
1930
- bgGreen: f("\x1B[42m", "\x1B[49m"),
1931
- bgYellow: f("\x1B[43m", "\x1B[49m"),
1932
- bgBlue: f("\x1B[44m", "\x1B[49m"),
1933
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
1934
- bgCyan: f("\x1B[46m", "\x1B[49m"),
1935
- bgWhite: f("\x1B[47m", "\x1B[49m"),
1936
- blackBright: f("\x1B[90m", "\x1B[39m"),
1937
- redBright: f("\x1B[91m", "\x1B[39m"),
1938
- greenBright: f("\x1B[92m", "\x1B[39m"),
1939
- yellowBright: f("\x1B[93m", "\x1B[39m"),
1940
- blueBright: f("\x1B[94m", "\x1B[39m"),
1941
- magentaBright: f("\x1B[95m", "\x1B[39m"),
1942
- cyanBright: f("\x1B[96m", "\x1B[39m"),
1943
- whiteBright: f("\x1B[97m", "\x1B[39m"),
1944
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
1945
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
1946
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
1947
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
1948
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
1949
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
1950
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
1951
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
1952
- };
1953
- };
1954
- module.exports = createColors();
1955
- module.exports.createColors = createColors;
1956
- });
1957
-
1958
- // ../../node_modules/sisteransi/src/index.js
1959
- var require_src = __commonJS((exports, module) => {
1960
- var ESC = "\x1B";
1961
- var CSI = `${ESC}[`;
1962
- var beep = "\x07";
1963
- var cursor = {
1964
- to(x, y) {
1965
- if (!y)
1966
- return `${CSI}${x + 1}G`;
1967
- return `${CSI}${y + 1};${x + 1}H`;
1968
- },
1969
- move(x, y) {
1970
- let ret = "";
1971
- if (x < 0)
1972
- ret += `${CSI}${-x}D`;
1973
- else if (x > 0)
1974
- ret += `${CSI}${x}C`;
1975
- if (y < 0)
1976
- ret += `${CSI}${-y}A`;
1977
- else if (y > 0)
1978
- ret += `${CSI}${y}B`;
1979
- return ret;
1980
- },
1981
- up: (count = 1) => `${CSI}${count}A`,
1982
- down: (count = 1) => `${CSI}${count}B`,
1983
- forward: (count = 1) => `${CSI}${count}C`,
1984
- backward: (count = 1) => `${CSI}${count}D`,
1985
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
1986
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
1987
- left: `${CSI}G`,
1988
- hide: `${CSI}?25l`,
1989
- show: `${CSI}?25h`,
1990
- save: `${ESC}7`,
1991
- restore: `${ESC}8`
1992
- };
1993
- var scroll = {
1994
- up: (count = 1) => `${CSI}S`.repeat(count),
1995
- down: (count = 1) => `${CSI}T`.repeat(count)
1996
- };
1997
- var erase = {
1998
- screen: `${CSI}2J`,
1999
- up: (count = 1) => `${CSI}1J`.repeat(count),
2000
- down: (count = 1) => `${CSI}J`.repeat(count),
2001
- line: `${CSI}2K`,
2002
- lineEnd: `${CSI}K`,
2003
- lineStart: `${CSI}1K`,
2004
- lines(count) {
2005
- let clear = "";
2006
- for (let i = 0;i < count; i++)
2007
- clear += this.line + (i < count - 1 ? cursor.up() : "");
2008
- if (count)
2009
- clear += cursor.left;
2010
- return clear;
2011
- }
2012
- };
2013
- module.exports = { cursor, scroll, erase, beep };
2014
- });
2015
-
2016
2016
  // ../../node_modules/json5/lib/unicode.js
2017
2017
  var require_unicode = __commonJS((exports, module) => {
2018
2018
  exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
@@ -119126,7 +119126,7 @@ function inferParser(options8, fileInfo) {
119126
119126
  return language?.parsers[0];
119127
119127
  }
119128
119128
  function normalizeOptions4(options8, optionInfos, {
119129
- logger = false,
119129
+ logger: logger2 = false,
119130
119130
  isCLI = false,
119131
119131
  passThrough = false,
119132
119132
  FlagSchema,
@@ -119161,11 +119161,11 @@ function normalizeOptions4(options8, optionInfos, {
119161
119161
  FlagSchema
119162
119162
  });
119163
119163
  const normalizer = new Normalizer(schemas3, {
119164
- logger,
119164
+ logger: logger2,
119165
119165
  unknown: unknown2,
119166
119166
  descriptor
119167
119167
  });
119168
- const shouldSuppressDuplicateDeprecationWarnings = logger !== false;
119168
+ const shouldSuppressDuplicateDeprecationWarnings = logger2 !== false;
119169
119169
  if (shouldSuppressDuplicateDeprecationWarnings && hasDeprecationWarned) {
119170
119170
  normalizer._hasDeprecationWarned = hasDeprecationWarned;
119171
119171
  }
@@ -120760,7 +120760,7 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
120760
120760
  `));
120761
120761
  }
120762
120762
  return chooseDescription(descriptions, utils3.loggerPrintWidth);
120763
- }, import_picocolors32, levenUnknownHandler = (key2, value, { descriptor, logger, schemas: schemas3 }) => {
120763
+ }, import_picocolors32, levenUnknownHandler = (key2, value, { descriptor, logger: logger2, schemas: schemas3 }) => {
120764
120764
  const messages2 = [
120765
120765
  `Ignored unknown option ${import_picocolors32.default.yellow(descriptor.pair({ key: key2, value }))}.`
120766
120766
  ];
@@ -120768,7 +120768,7 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
120768
120768
  if (suggestion) {
120769
120769
  messages2.push(`Did you mean ${import_picocolors32.default.blue(descriptor.key(suggestion))}?`);
120770
120770
  }
120771
- logger.warn(messages2.join(" "));
120771
+ logger2.warn(messages2.join(" "));
120772
120772
  }, HANDLER_KEYS, Schema2 = class {
120773
120773
  static create(parameters) {
120774
120774
  return createSchema(this, parameters);
@@ -120805,10 +120805,10 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
120805
120805
  }
120806
120806
  }, AliasSchema, AnySchema, ArraySchema, BooleanSchema, ChoiceSchema, NumberSchema, IntegerSchema, StringSchema, defaultDescriptor, defaultUnknownHandler, defaultInvalidHandler, defaultDeprecatedHandler, Normalizer = class {
120807
120807
  constructor(schemas3, opts) {
120808
- const { logger = console, loggerPrintWidth = 80, descriptor = defaultDescriptor, unknown: unknown2 = defaultUnknownHandler, invalid = defaultInvalidHandler, deprecated = defaultDeprecatedHandler, missing = () => false, required: required2 = () => false, preprocess: preprocess2 = (x10) => x10, postprocess = () => VALUE_UNCHANGED } = opts || {};
120808
+ const { logger: logger2 = console, loggerPrintWidth = 80, descriptor = defaultDescriptor, unknown: unknown2 = defaultUnknownHandler, invalid = defaultInvalidHandler, deprecated = defaultDeprecatedHandler, missing = () => false, required: required2 = () => false, preprocess: preprocess2 = (x10) => x10, postprocess = () => VALUE_UNCHANGED } = opts || {};
120809
120809
  this._utils = {
120810
120810
  descriptor,
120811
- logger: logger || { warn: () => {} },
120811
+ logger: logger2 || { warn: () => {} },
120812
120812
  loggerPrintWidth,
120813
120813
  schemas: recordFromArray(schemas3, "name"),
120814
120814
  normalizeDefaultResult,
@@ -166684,14 +166684,14 @@ var require_logger_plugin2 = __commonJS((exports) => {
166684
166684
  var logger_1 = require_logger();
166685
166685
  var logger_plugin_1 = require_logger_plugin();
166686
166686
  var loggerPlugin = (proxyServer, options8) => {
166687
- const logger = (0, logger_1.getLogger)(options8);
166687
+ const logger2 = (0, logger_1.getLogger)(options8);
166688
166688
  proxyServer.on("error", (err, req, res, target) => {
166689
166689
  const hostname3 = req?.headers?.host;
166690
166690
  const requestHref = `${hostname3}${req?.url}`;
166691
166691
  const targetHref = `${target?.href}`;
166692
166692
  const errorMessage = "[HPM] Error occurred while proxying request %s to %s [%s] (%s)";
166693
166693
  const errReference = "https://nodejs.org/api/errors.html#errors_common_system_errors";
166694
- logger.error(errorMessage, requestHref, targetHref, err.code || err, errReference);
166694
+ logger2.error(errorMessage, requestHref, targetHref, err.code || err, errReference);
166695
166695
  });
166696
166696
  proxyServer.on("proxyRes", (proxyRes, req, res) => {
166697
166697
  const originalUrl = req.originalUrl ?? `${req.baseUrl || ""}${req.url}`;
@@ -166713,13 +166713,13 @@ var require_logger_plugin2 = __commonJS((exports) => {
166713
166713
  }
166714
166714
  const targetUrl = target.toString();
166715
166715
  const exchange = `[HPM] ${req.method} ${originalUrl} -> ${targetUrl} [${proxyRes.statusCode}]`;
166716
- logger.info(exchange);
166716
+ logger2.info(exchange);
166717
166717
  });
166718
166718
  proxyServer.on("open", (socket) => {
166719
- logger.info("[HPM] Client connected: %o", socket.address());
166719
+ logger2.info("[HPM] Client connected: %o", socket.address());
166720
166720
  });
166721
166721
  proxyServer.on("close", (req, proxySocket, proxyHead) => {
166722
- logger.info("[HPM] Client disconnected: %o", proxySocket.address());
166722
+ logger2.info("[HPM] Client disconnected: %o", proxySocket.address());
166723
166723
  });
166724
166724
  };
166725
166725
  exports.loggerPlugin = loggerPlugin;
@@ -167296,7 +167296,7 @@ var require_options_adapter = __commonJS((exports) => {
167296
167296
  };
167297
167297
  function legacyOptionsAdapter(legacyContext, legacyOptions) {
167298
167298
  let options8 = {};
167299
- let logger;
167299
+ let logger2;
167300
167300
  if (typeof legacyContext === "string" && !!url3.parse(legacyContext).host) {
167301
167301
  throw new Error(`Shorthand syntax is removed from legacyCreateProxyMiddleware().
167302
167302
  Please use "legacyCreateProxyMiddleware({ target: 'http://www.example.org' })" instead.
@@ -167307,8 +167307,8 @@ var require_options_adapter = __commonJS((exports) => {
167307
167307
  if (legacyContext && legacyOptions) {
167308
167308
  debug("map legacy context/filter to options.pathFilter");
167309
167309
  options8 = { ...legacyOptions, pathFilter: legacyContext };
167310
- logger = getLegacyLogger(options8);
167311
- logger.warn(`[http-proxy-middleware] Legacy "context" argument is deprecated. Migrate your "context" to "options.pathFilter":
167310
+ logger2 = getLegacyLogger(options8);
167311
+ logger2.warn(`[http-proxy-middleware] Legacy "context" argument is deprecated. Migrate your "context" to "options.pathFilter":
167312
167312
 
167313
167313
  const options = {
167314
167314
  pathFilter: '${legacyContext}',
@@ -167318,16 +167318,16 @@ var require_options_adapter = __commonJS((exports) => {
167318
167318
  `);
167319
167319
  } else if (legacyContext && !legacyOptions) {
167320
167320
  options8 = { ...legacyContext };
167321
- logger = getLegacyLogger(options8);
167321
+ logger2 = getLegacyLogger(options8);
167322
167322
  } else {
167323
- logger = getLegacyLogger({});
167323
+ logger2 = getLegacyLogger({});
167324
167324
  }
167325
167325
  Object.entries(proxyEventMap).forEach(([legacyEventName, proxyEventName]) => {
167326
167326
  if (options8[legacyEventName]) {
167327
167327
  options8.on = { ...options8.on };
167328
167328
  options8.on[proxyEventName] = options8[legacyEventName];
167329
167329
  debug('map legacy event "%s" to "on.%s"', legacyEventName, proxyEventName);
167330
- logger.warn(`[http-proxy-middleware] Legacy "${legacyEventName}" is deprecated. Migrate to "options.on.${proxyEventName}":
167330
+ logger2.warn(`[http-proxy-middleware] Legacy "${legacyEventName}" is deprecated. Migrate to "options.on.${proxyEventName}":
167331
167331
 
167332
167332
  const options = {
167333
167333
  on: {
@@ -167345,7 +167345,7 @@ var require_options_adapter = __commonJS((exports) => {
167345
167345
  debug("legacy logProvider: %O", logProvider);
167346
167346
  if (typeof logLevel === "string" && logLevel !== "silent") {
167347
167347
  debug('map "logProvider" to "logger"');
167348
- logger.warn(`[http-proxy-middleware] Legacy "logLevel" and "logProvider" are deprecated. Migrate to "options.logger":
167348
+ logger2.warn(`[http-proxy-middleware] Legacy "logLevel" and "logProvider" are deprecated. Migrate to "options.logger":
167349
167349
 
167350
167350
  const options = {
167351
167351
  logger: console,
@@ -218273,25 +218273,6 @@ var require_dist5 = __commonJS((exports, module) => {
218273
218273
  import { dirname as dirname18, join as join24 } from "node:path";
218274
218274
  import { fileURLToPath as fileURLToPath6 } from "node:url";
218275
218275
 
218276
- // ../../node_modules/commander/esm.mjs
218277
- var import__ = __toESM(require_commander(), 1);
218278
- var {
218279
- program,
218280
- createCommand,
218281
- createArgument,
218282
- createOption,
218283
- CommanderError,
218284
- InvalidArgumentError,
218285
- InvalidOptionArgumentError,
218286
- Command,
218287
- Argument,
218288
- Option,
218289
- Help
218290
- } = import__.default;
218291
-
218292
- // src/cli/commands/agents/pull.ts
218293
- import { dirname as dirname7, join as join12 } from "node:path";
218294
-
218295
218276
  // ../../node_modules/@clack/core/dist/index.mjs
218296
218277
  var import_picocolors = __toESM(require_picocolors(), 1);
218297
218278
  var import_sisteransi = __toESM(require_src(), 1);
@@ -219376,6 +219357,72 @@ ${l}
219376
219357
  }
219377
219358
  } }).prompt();
219378
219359
 
219360
+ // ../logger/src/ClackLogger.ts
219361
+ class ClackLogger {
219362
+ info(message) {
219363
+ R2.info(message);
219364
+ }
219365
+ success(message) {
219366
+ R2.success(message);
219367
+ }
219368
+ warn(message) {
219369
+ R2.warn(message);
219370
+ }
219371
+ error(message) {
219372
+ R2.error(message);
219373
+ }
219374
+ step(message) {
219375
+ R2.step(message);
219376
+ }
219377
+ message(message) {
219378
+ R2.message(message);
219379
+ }
219380
+ }
219381
+ // ../logger/src/SimpleLogger.ts
219382
+ class SimpleLogger {
219383
+ info(message) {
219384
+ process.stderr.write(`${message}
219385
+ `);
219386
+ }
219387
+ success(message) {
219388
+ process.stderr.write(`${message}
219389
+ `);
219390
+ }
219391
+ warn(message) {
219392
+ process.stderr.write(`Warning: ${message}
219393
+ `);
219394
+ }
219395
+ error(message) {
219396
+ process.stderr.write(`Error: ${message}
219397
+ `);
219398
+ }
219399
+ step(message) {
219400
+ process.stderr.write(`${message}
219401
+ `);
219402
+ }
219403
+ message(message) {
219404
+ process.stderr.write(`${message}
219405
+ `);
219406
+ }
219407
+ }
219408
+ // ../../node_modules/commander/esm.mjs
219409
+ var import__ = __toESM(require_commander(), 1);
219410
+ var {
219411
+ program,
219412
+ createCommand,
219413
+ createArgument,
219414
+ createOption,
219415
+ CommanderError,
219416
+ InvalidArgumentError,
219417
+ InvalidOptionArgumentError,
219418
+ Command,
219419
+ Argument,
219420
+ Option,
219421
+ Help
219422
+ } = import__.default;
219423
+
219424
+ // src/cli/commands/agents/pull.ts
219425
+ import { dirname as dirname7, join as join12 } from "node:path";
219379
219426
  // ../../node_modules/chalk/source/vendor/ansi-styles/index.js
219380
219427
  var ANSI_BACKGROUND_OFFSET = 10;
219381
219428
  var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
@@ -241768,6 +241815,16 @@ async function pushAuthConfig(config3) {
241768
241815
  }
241769
241816
  await pushAuthConfigToApi(config3);
241770
241817
  }
241818
+ // src/core/resources/auth-config/resource.ts
241819
+ var authConfigResource = {
241820
+ readAll: async (dir) => {
241821
+ const config3 = await readAuthConfig(dir);
241822
+ return config3 ? [config3] : [];
241823
+ },
241824
+ push: async (items) => {
241825
+ await pushAuthConfig(items[0] ?? null);
241826
+ }
241827
+ };
241771
241828
  // src/core/resources/connector/schema.ts
241772
241829
  var GoogleCalendarConnectorSchema = exports_external.object({
241773
241830
  type: exports_external.literal("googlecalendar"),
@@ -242893,7 +242950,7 @@ async function readProjectConfig(projectRoot) {
242893
242950
  functionResource.readAll(join8(configDir, project.functionsDir)),
242894
242951
  agentResource.readAll(join8(configDir, project.agentsDir)),
242895
242952
  connectorResource.readAll(join8(configDir, project.connectorsDir)),
242896
- readAuthConfig(join8(configDir, project.authDir))
242953
+ authConfigResource.readAll(join8(configDir, project.authDir))
242897
242954
  ]);
242898
242955
  return {
242899
242956
  project: { ...project, root, configPath },
@@ -243127,6 +243184,7 @@ var package_default = {
243127
243184
  url: "https://github.com/base44/cli"
243128
243185
  },
243129
243186
  devDependencies: {
243187
+ "@base44-cli/logger": "workspace:*",
243130
243188
  "@clack/prompts": "^1.0.1",
243131
243189
  "@seald-io/nedb": "^4.1.2",
243132
243190
  "@types/bun": "^1.2.15",
@@ -243340,7 +243398,7 @@ function hasResourcesToDeploy(projectData) {
243340
243398
  const hasFunctions = functions.length > 0;
243341
243399
  const hasAgents = agents.length > 0;
243342
243400
  const hasConnectors = connectors.length > 0;
243343
- const hasAuthConfig = authConfig !== null;
243401
+ const hasAuthConfig = authConfig.length > 0;
243344
243402
  return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasSite;
243345
243403
  }
243346
243404
  async function deployAll(projectData, options) {
@@ -243351,9 +243409,7 @@ async function deployAll(projectData, options) {
243351
243409
  onResult: options?.onFunctionResult
243352
243410
  });
243353
243411
  await agentResource.push(agents);
243354
- if (authConfig) {
243355
- await pushAuthConfig(authConfig);
243356
- }
243412
+ await authConfigResource.push(authConfig);
243357
243413
  const { results: connectorResults } = await pushConnectors(connectors);
243358
243414
  if (project.site?.outputDirectory) {
243359
243415
  const outputDir = resolve(project.root, project.site.outputDirectory);
@@ -243540,14 +243596,14 @@ async function getUserInfo(accessToken) {
243540
243596
  return result.data;
243541
243597
  }
243542
243598
  // src/cli/commands/auth/login-flow.ts
243543
- async function generateAndDisplayDeviceCode() {
243599
+ async function generateAndDisplayDeviceCode(log) {
243544
243600
  const deviceCodeResponse = await runTask("Generating device code...", async () => {
243545
243601
  return await generateDeviceCode();
243546
243602
  }, {
243547
243603
  successMessage: "Device code generated",
243548
243604
  errorMessage: "Failed to generate device code"
243549
243605
  });
243550
- R2.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}` + `
243606
+ log.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}` + `
243551
243607
  Please confirm this code at: ${deviceCodeResponse.verificationUri}`);
243552
243608
  return deviceCodeResponse;
243553
243609
  }
@@ -243591,8 +243647,8 @@ async function saveAuthData(response, userInfo) {
243591
243647
  name: userInfo.name
243592
243648
  });
243593
243649
  }
243594
- async function login() {
243595
- const deviceCodeResponse = await generateAndDisplayDeviceCode();
243650
+ async function login({ log }) {
243651
+ const deviceCodeResponse = await generateAndDisplayDeviceCode(log);
243596
243652
  const token = await waitForAuthentication(deviceCodeResponse.deviceCode, deviceCodeResponse.expiresIn, deviceCodeResponse.interval);
243597
243653
  const userInfo = await getUserInfo(token.accessToken);
243598
243654
  await saveAuthData(token, userInfo);
@@ -243602,22 +243658,22 @@ async function login() {
243602
243658
  }
243603
243659
 
243604
243660
  // src/cli/utils/command/middleware.ts
243605
- async function ensureAuth(errorReporter) {
243661
+ async function ensureAuth(ctx) {
243606
243662
  const loggedIn = await isLoggedIn();
243607
243663
  if (!loggedIn) {
243608
- R2.info("You need to login first to continue.");
243609
- await login();
243664
+ ctx.log.info("You need to login first to continue.");
243665
+ await login(ctx);
243610
243666
  }
243611
243667
  try {
243612
243668
  const userInfo = await readAuth();
243613
- errorReporter.setContext({
243669
+ ctx.errorReporter.setContext({
243614
243670
  user: { email: userInfo.email, name: userInfo.name }
243615
243671
  });
243616
243672
  } catch {}
243617
243673
  }
243618
- async function ensureAppConfig(errorReporter) {
243674
+ async function ensureAppConfig(ctx) {
243619
243675
  const appConfig = await initAppConfig();
243620
- errorReporter.setContext({ appId: appConfig.id });
243676
+ ctx.errorReporter.setContext({ appId: appConfig.id });
243621
243677
  }
243622
243678
 
243623
243679
  // ../../node_modules/is-plain-obj/index.js
@@ -250263,9 +250319,6 @@ class Base44Command extends Command {
250263
250319
  setContext(context) {
250264
250320
  this._context = context;
250265
250321
  }
250266
- get isNonInteractive() {
250267
- return this._context?.isNonInteractive ?? false;
250268
- }
250269
250322
  get context() {
250270
250323
  if (!this._context) {
250271
250324
  throw new Error("Base44Command context not set. Ensure the command is registered via createProgram().");
@@ -250281,12 +250334,12 @@ class Base44Command extends Command {
250281
250334
  const upgradeCheckPromise = startUpgradeCheck();
250282
250335
  try {
250283
250336
  if (this._commandOptions.requireAuth) {
250284
- await ensureAuth(this.context.errorReporter);
250337
+ await ensureAuth(this.context);
250285
250338
  }
250286
250339
  if (this._commandOptions.requireAppConfig) {
250287
- await ensureAppConfig(this.context.errorReporter);
250340
+ await ensureAppConfig(this.context);
250288
250341
  }
250289
- const result = await fn(...args) ?? {};
250342
+ const result = await fn(this.context, ...args) ?? {};
250290
250343
  if (!quiet) {
250291
250344
  await showCommandEnd(result, upgradeCheckPromise, this.context.distribution);
250292
250345
  } else {
@@ -250494,7 +250547,9 @@ async function parseEnvFile(filePath) {
250494
250547
  return import_dotenv.parse(content);
250495
250548
  }
250496
250549
  // src/cli/commands/agents/pull.ts
250497
- async function pullAgentsAction() {
250550
+ async function pullAgentsAction({
250551
+ log
250552
+ }) {
250498
250553
  const { project: project2 } = await readProjectConfig();
250499
250554
  const configDir = dirname7(project2.configPath);
250500
250555
  const agentsDir = join12(configDir, project2.agentsDir);
@@ -250511,13 +250566,13 @@ async function pullAgentsAction() {
250511
250566
  errorMessage: "Failed to sync agent files"
250512
250567
  });
250513
250568
  if (written.length > 0) {
250514
- R2.success(`Written: ${written.join(", ")}`);
250569
+ log.success(`Written: ${written.join(", ")}`);
250515
250570
  }
250516
250571
  if (deleted.length > 0) {
250517
- R2.warn(`Deleted: ${deleted.join(", ")}`);
250572
+ log.warn(`Deleted: ${deleted.join(", ")}`);
250518
250573
  }
250519
250574
  if (written.length === 0 && deleted.length === 0) {
250520
- R2.info("All agents are already up to date");
250575
+ log.info("All agents are already up to date");
250521
250576
  }
250522
250577
  return {
250523
250578
  outroMessage: `Pulled ${remoteAgents.total} agents to ${agentsDir}`
@@ -250528,9 +250583,11 @@ function getAgentsPullCommand() {
250528
250583
  }
250529
250584
 
250530
250585
  // src/cli/commands/agents/push.ts
250531
- async function pushAgentsAction() {
250586
+ async function pushAgentsAction({
250587
+ log
250588
+ }) {
250532
250589
  const { agents } = await readProjectConfig();
250533
- R2.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
250590
+ log.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
250534
250591
  const result = await runTask("Pushing agents to Base44", async () => {
250535
250592
  return await pushAgents(agents);
250536
250593
  }, {
@@ -250538,13 +250595,13 @@ async function pushAgentsAction() {
250538
250595
  errorMessage: "Failed to push agents"
250539
250596
  });
250540
250597
  if (result.created.length > 0) {
250541
- R2.success(`Created: ${result.created.join(", ")}`);
250598
+ log.success(`Created: ${result.created.join(", ")}`);
250542
250599
  }
250543
250600
  if (result.updated.length > 0) {
250544
- R2.success(`Updated: ${result.updated.join(", ")}`);
250601
+ log.success(`Updated: ${result.updated.join(", ")}`);
250545
250602
  }
250546
250603
  if (result.deleted.length > 0) {
250547
- R2.warn(`Deleted: ${result.deleted.join(", ")}`);
250604
+ log.warn(`Deleted: ${result.deleted.join(", ")}`);
250548
250605
  }
250549
250606
  return { outroMessage: "Agents pushed to Base44" };
250550
250607
  }
@@ -250575,7 +250632,7 @@ function validateAction(action) {
250575
250632
  });
250576
250633
  }
250577
250634
  }
250578
- async function passwordLoginAction(action) {
250635
+ async function passwordLoginAction({ log }, action) {
250579
250636
  validateAction(action);
250580
250637
  const shouldEnable = action === "enable";
250581
250638
  const { project: project2 } = await readProjectConfig();
@@ -250588,7 +250645,7 @@ async function passwordLoginAction(action) {
250588
250645
  return merged;
250589
250646
  });
250590
250647
  if (!shouldEnable && !hasAnyLoginMethod(updated)) {
250591
- R2.warn("Disabling password auth will leave no login methods enabled. Users will be locked out.");
250648
+ log.warn("Disabling password auth will leave no login methods enabled. Users will be locked out.");
250592
250649
  }
250593
250650
  const newStatus = shouldEnable ? "enabled" : "disabled";
250594
250651
  return {
@@ -250596,14 +250653,12 @@ async function passwordLoginAction(action) {
250596
250653
  };
250597
250654
  }
250598
250655
  function getPasswordLoginCommand() {
250599
- return new Base44Command("password-login").description("Enable or disable username & password authentication").argument("<enable|disable>", "enable or disable password authentication").action(async (action) => {
250600
- return passwordLoginAction(action);
250601
- });
250656
+ return new Base44Command("password-login").description("Enable or disable username & password authentication").argument("<enable|disable>", "enable or disable password authentication").action(passwordLoginAction);
250602
250657
  }
250603
250658
 
250604
250659
  // src/cli/commands/auth/pull.ts
250605
250660
  import { dirname as dirname9, join as join14 } from "node:path";
250606
- async function pullAuthAction() {
250661
+ async function pullAuthAction({ log }) {
250607
250662
  const { project: project2 } = await readProjectConfig();
250608
250663
  const configDir = dirname9(project2.configPath);
250609
250664
  const authDir = join14(configDir, project2.authDir);
@@ -250620,9 +250675,9 @@ async function pullAuthAction() {
250620
250675
  errorMessage: "Failed to sync auth config file"
250621
250676
  });
250622
250677
  if (written) {
250623
- R2.success("Auth config written to local file");
250678
+ log.success("Auth config written to local file");
250624
250679
  } else {
250625
- R2.info("Auth config is already up to date");
250680
+ log.info("Auth config is already up to date");
250626
250681
  }
250627
250682
  return {
250628
250683
  outroMessage: `Pulled auth config to ${authDir} (overwrites local file)`
@@ -250633,19 +250688,19 @@ function getAuthPullCommand() {
250633
250688
  }
250634
250689
 
250635
250690
  // src/cli/commands/auth/push.ts
250636
- async function pushAuthAction(options, command2) {
250691
+ async function pushAuthAction({ isNonInteractive, log }, options) {
250637
250692
  const { authConfig } = await readProjectConfig();
250638
- if (!authConfig) {
250639
- R2.info("No local auth config found");
250693
+ if (authConfig.length === 0) {
250694
+ log.info("No local auth config found");
250640
250695
  return {
250641
250696
  outroMessage: "No auth config to push. Run `base44 auth pull` to fetch the remote config first."
250642
250697
  };
250643
250698
  }
250644
- if (!hasAnyLoginMethod(authConfig)) {
250645
- R2.warn("This config has no login methods enabled. Pushing it will lock out all users.");
250699
+ if (!hasAnyLoginMethod(authConfig[0])) {
250700
+ log.warn("This config has no login methods enabled. Pushing it will lock out all users.");
250646
250701
  }
250647
250702
  if (!options.yes) {
250648
- if (command2.isNonInteractive) {
250703
+ if (isNonInteractive) {
250649
250704
  throw new InvalidInputError("--yes is required in non-interactive mode");
250650
250705
  }
250651
250706
  const shouldPush = await Re({
@@ -250656,7 +250711,7 @@ async function pushAuthAction(options, command2) {
250656
250711
  }
250657
250712
  }
250658
250713
  await runTask("Pushing auth config to Base44", async () => {
250659
- return await pushAuthConfig(authConfig);
250714
+ return await pushAuthConfig(authConfig[0] ?? null);
250660
250715
  }, {
250661
250716
  successMessage: "Auth config pushed successfully",
250662
250717
  errorMessage: "Failed to push auth config"
@@ -250666,9 +250721,7 @@ async function pushAuthAction(options, command2) {
250666
250721
  };
250667
250722
  }
250668
250723
  function getAuthPushCommand() {
250669
- return new Base44Command("push").description("Push local auth config to Base44").option("-y, --yes", "Skip confirmation prompt").action(async (options, command2) => {
250670
- return await pushAuthAction(options, command2);
250671
- });
250724
+ return new Base44Command("push").description("Push local auth config to Base44").option("-y, --yes", "Skip confirmation prompt").action(pushAuthAction);
250672
250725
  }
250673
250726
 
250674
250727
  // src/cli/commands/auth/index.ts
@@ -250685,7 +250738,7 @@ function getLoginCommand() {
250685
250738
  }
250686
250739
 
250687
250740
  // src/cli/commands/auth/logout.ts
250688
- async function logout() {
250741
+ async function logout(_ctx) {
250689
250742
  await deleteAuth();
250690
250743
  return { outroMessage: "Logged out successfully" };
250691
250744
  }
@@ -250697,7 +250750,7 @@ function getLogoutCommand() {
250697
250750
  }
250698
250751
 
250699
250752
  // src/cli/commands/auth/whoami.ts
250700
- async function whoami() {
250753
+ async function whoami(_ctx) {
250701
250754
  const auth2 = await readAuth();
250702
250755
  return { outroMessage: `Logged in as: ${theme.styles.bold(auth2.email)}` };
250703
250756
  }
@@ -250706,7 +250759,9 @@ function getWhoamiCommand() {
250706
250759
  }
250707
250760
 
250708
250761
  // src/cli/commands/connectors/list-available.ts
250709
- async function listAvailableAction() {
250762
+ async function listAvailableAction({
250763
+ log
250764
+ }) {
250710
250765
  const { integrations } = await runTask("Fetching available integrations from Base44", async () => {
250711
250766
  return await listAvailableIntegrations();
250712
250767
  }, {
@@ -250719,7 +250774,7 @@ async function listAvailableAction() {
250719
250774
  for (const { displayName, ...rest } of integrations) {
250720
250775
  const yaml2 = formatYaml(rest);
250721
250776
  const pad = " ".repeat(YAML_INDENT);
250722
- R2.info(`${displayName}
250777
+ log.info(`${displayName}
250723
250778
  ${pad}${yaml2.replace(/\n/g, `
250724
250779
  ${pad}`)}`);
250725
250780
  }
@@ -250733,7 +250788,9 @@ function getConnectorsListAvailableCommand() {
250733
250788
 
250734
250789
  // src/cli/commands/connectors/pull.ts
250735
250790
  import { dirname as dirname10, join as join15 } from "node:path";
250736
- async function pullConnectorsAction() {
250791
+ async function pullConnectorsAction({
250792
+ log
250793
+ }) {
250737
250794
  const { project: project2 } = await readProjectConfig();
250738
250795
  const configDir = dirname10(project2.configPath);
250739
250796
  const connectorsDir = join15(configDir, project2.connectorsDir);
@@ -250750,13 +250807,13 @@ async function pullConnectorsAction() {
250750
250807
  errorMessage: "Failed to sync connector files"
250751
250808
  });
250752
250809
  if (written.length > 0) {
250753
- R2.success(`Written: ${written.join(", ")}`);
250810
+ log.success(`Written: ${written.join(", ")}`);
250754
250811
  }
250755
250812
  if (deleted.length > 0) {
250756
- R2.warn(`Deleted: ${deleted.join(", ")}`);
250813
+ log.warn(`Deleted: ${deleted.join(", ")}`);
250757
250814
  }
250758
250815
  if (written.length === 0 && deleted.length === 0) {
250759
- R2.info("All connectors are already up to date");
250816
+ log.info("All connectors are already up to date");
250760
250817
  }
250761
250818
  return {
250762
250819
  outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
@@ -251425,14 +251482,14 @@ async function runOAuthFlowWithSkip(connector2) {
251425
251482
  }
251426
251483
  return finalStatus;
251427
251484
  }
251428
- async function promptOAuthFlows(pending, options) {
251485
+ async function promptOAuthFlows(pending, log, options) {
251429
251486
  const outcomes = new Map;
251430
251487
  if (pending.length === 0) {
251431
251488
  return outcomes;
251432
251489
  }
251433
- R2.warn(`${pending.length} connector(s) require authorization in your browser:`);
251490
+ log.warn(`${pending.length} connector(s) require authorization in your browser:`);
251434
251491
  for (const connector2 of pending) {
251435
- R2.info(` ${connector2.type}: ${theme.styles.dim(connector2.redirectUrl)}`);
251492
+ log.info(` ${connector2.type}: ${theme.styles.dim(connector2.redirectUrl)}`);
251436
251493
  }
251437
251494
  if (options?.skipPrompt) {
251438
251495
  return outcomes;
@@ -251445,11 +251502,11 @@ async function promptOAuthFlows(pending, options) {
251445
251502
  }
251446
251503
  for (const connector2 of pending) {
251447
251504
  try {
251448
- R2.info(`Opening browser for ${connector2.type}...`);
251505
+ log.info(`Opening browser for ${connector2.type}...`);
251449
251506
  const status = await runOAuthFlowWithSkip(connector2);
251450
251507
  outcomes.set(connector2.type, status);
251451
251508
  } catch (err) {
251452
- R2.error(`Failed to authorize ${connector2.type}: ${err instanceof Error ? err.message : String(err)}`);
251509
+ log.error(`Failed to authorize ${connector2.type}: ${err instanceof Error ? err.message : String(err)}`);
251453
251510
  outcomes.set(connector2.type, "FAILED");
251454
251511
  }
251455
251512
  }
@@ -251457,7 +251514,7 @@ async function promptOAuthFlows(pending, options) {
251457
251514
  }
251458
251515
 
251459
251516
  // src/cli/commands/connectors/push.ts
251460
- function printSummary(results, oauthOutcomes) {
251517
+ function printSummary(results, oauthOutcomes, log) {
251461
251518
  const synced = [];
251462
251519
  const added = [];
251463
251520
  let provisioned;
@@ -251495,57 +251552,58 @@ function printSummary(results, oauthOutcomes) {
251495
251552
  }
251496
251553
  }
251497
251554
  }
251498
- R2.info(theme.styles.bold("Summary:"));
251555
+ log.info(theme.styles.bold("Summary:"));
251499
251556
  if (provisioned) {
251500
- R2.success("Stripe sandbox provisioned");
251557
+ log.success("Stripe sandbox provisioned");
251501
251558
  if (provisioned.claimUrl) {
251502
- R2.info(` Claim your Stripe sandbox: ${theme.colors.links(provisioned.claimUrl)}`);
251559
+ log.info(` Claim your Stripe sandbox: ${theme.colors.links(provisioned.claimUrl)}`);
251503
251560
  }
251504
- R2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
251561
+ log.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
251505
251562
  }
251506
251563
  if (synced.length > 0) {
251507
- R2.success(`Synced: ${synced.join(", ")}`);
251564
+ log.success(`Synced: ${synced.join(", ")}`);
251508
251565
  }
251509
251566
  if (added.length > 0) {
251510
- R2.success(`Added: ${added.join(", ")}`);
251567
+ log.success(`Added: ${added.join(", ")}`);
251511
251568
  }
251512
251569
  if (removed.length > 0) {
251513
- R2.info(theme.styles.dim(`Removed: ${removed.join(", ")}`));
251570
+ log.info(theme.styles.dim(`Removed: ${removed.join(", ")}`));
251514
251571
  }
251515
251572
  if (skipped.length > 0) {
251516
- R2.warn(`Skipped: ${skipped.join(", ")}`);
251573
+ log.warn(`Skipped: ${skipped.join(", ")}`);
251517
251574
  }
251518
251575
  for (const r of failed) {
251519
- R2.error(`Failed: ${r.type} - ${r.error}`);
251576
+ log.error(`Failed: ${r.type} - ${r.error}`);
251520
251577
  }
251521
251578
  }
251522
- async function pushConnectorsAction(isNonInteractive) {
251579
+ async function pushConnectorsAction({
251580
+ isNonInteractive,
251581
+ log
251582
+ }) {
251523
251583
  const { connectors } = await readProjectConfig();
251524
251584
  if (connectors.length === 0) {
251525
- R2.info("No local connectors found - checking for remote connectors to remove");
251585
+ log.info("No local connectors found - checking for remote connectors to remove");
251526
251586
  } else {
251527
251587
  const connectorNames = connectors.map((c3) => c3.type).join(", ");
251528
- R2.info(`Found ${connectors.length} connectors to push: ${connectorNames}`);
251588
+ log.info(`Found ${connectors.length} connectors to push: ${connectorNames}`);
251529
251589
  }
251530
251590
  const { results } = await runTask("Pushing connectors to Base44", async () => {
251531
251591
  return await pushConnectors(connectors);
251532
251592
  });
251533
251593
  const needsOAuth = filterPendingOAuth(results);
251534
251594
  let outroMessage = "Connectors pushed to Base44";
251535
- const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
251595
+ const oauthOutcomes = await promptOAuthFlows(needsOAuth, log, {
251536
251596
  skipPrompt: isNonInteractive
251537
251597
  });
251538
251598
  const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
251539
251599
  if (needsOAuth.length > 0 && !allAuthorized) {
251540
251600
  outroMessage = isNonInteractive ? "Skipped OAuth in non-interactive mode. Run 'base44 connectors push' locally or open the links above to authorize." : "Some connectors still require authorization. Run 'base44 connectors push' or open the links above to authorize.";
251541
251601
  }
251542
- printSummary(results, oauthOutcomes);
251602
+ printSummary(results, oauthOutcomes, log);
251543
251603
  return { outroMessage };
251544
251604
  }
251545
251605
  function getConnectorsPushCommand() {
251546
- return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(async (_options, command2) => {
251547
- return await pushConnectorsAction(command2.isNonInteractive);
251548
- });
251606
+ return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(pushConnectorsAction);
251549
251607
  }
251550
251608
 
251551
251609
  // src/cli/commands/connectors/index.ts
@@ -251554,7 +251612,9 @@ function getConnectorsCommand() {
251554
251612
  }
251555
251613
 
251556
251614
  // src/cli/commands/dashboard/open.ts
251557
- async function openDashboard(isNonInteractive) {
251615
+ async function openDashboard({
251616
+ isNonInteractive
251617
+ }) {
251558
251618
  const dashboardUrl = getDashboardUrl();
251559
251619
  if (!isNonInteractive) {
251560
251620
  await open_default(dashboardUrl);
@@ -251562,9 +251622,7 @@ async function openDashboard(isNonInteractive) {
251562
251622
  return { outroMessage: `Dashboard opened at ${dashboardUrl}` };
251563
251623
  }
251564
251624
  function getDashboardOpenCommand() {
251565
- return new Base44Command("open").description("Open the app dashboard in your browser").action(async (_options, command2) => {
251566
- return await openDashboard(command2.isNonInteractive);
251567
- });
251625
+ return new Base44Command("open").description("Open the app dashboard in your browser").action(openDashboard);
251568
251626
  }
251569
251627
 
251570
251628
  // src/cli/commands/dashboard/index.ts
@@ -251573,13 +251631,15 @@ function getDashboardCommand() {
251573
251631
  }
251574
251632
 
251575
251633
  // src/cli/commands/entities/push.ts
251576
- async function pushEntitiesAction() {
251634
+ async function pushEntitiesAction({
251635
+ log
251636
+ }) {
251577
251637
  const { entities } = await readProjectConfig();
251578
251638
  if (entities.length === 0) {
251579
251639
  return { outroMessage: "No entities found in project" };
251580
251640
  }
251581
251641
  const entityNames = entities.map((e2) => e2.name).join(", ");
251582
- R2.info(`Found ${entities.length} entities to push: ${entityNames}`);
251642
+ log.info(`Found ${entities.length} entities to push: ${entityNames}`);
251583
251643
  const result = await runTask("Pushing entities to Base44", async () => {
251584
251644
  return await pushEntities(entities);
251585
251645
  }, {
@@ -251587,13 +251647,13 @@ async function pushEntitiesAction() {
251587
251647
  errorMessage: "Failed to push entities"
251588
251648
  });
251589
251649
  if (result.created.length > 0) {
251590
- R2.success(`Created: ${result.created.join(", ")}`);
251650
+ log.success(`Created: ${result.created.join(", ")}`);
251591
251651
  }
251592
251652
  if (result.updated.length > 0) {
251593
- R2.success(`Updated: ${result.updated.join(", ")}`);
251653
+ log.success(`Updated: ${result.updated.join(", ")}`);
251594
251654
  }
251595
251655
  if (result.deleted.length > 0) {
251596
- R2.warn(`Deleted: ${result.deleted.join(", ")}`);
251656
+ log.warn(`Deleted: ${result.deleted.join(", ")}`);
251597
251657
  }
251598
251658
  return { outroMessage: "Entities pushed to Base44" };
251599
251659
  }
@@ -251602,7 +251662,7 @@ function getEntitiesPushCommand() {
251602
251662
  }
251603
251663
 
251604
251664
  // src/cli/commands/functions/delete.ts
251605
- async function deleteFunctionsAction(names) {
251665
+ async function deleteFunctionsAction(_ctx, names) {
251606
251666
  let deleted = 0;
251607
251667
  let notFound = 0;
251608
251668
  let errors5 = 0;
@@ -251648,9 +251708,9 @@ function validateNames(command2) {
251648
251708
  }
251649
251709
  }
251650
251710
  function getDeleteCommand() {
251651
- return new Base44Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").hook("preAction", validateNames).action(async (rawNames) => {
251711
+ return new Base44Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").hook("preAction", validateNames).action(async (ctx, rawNames) => {
251652
251712
  const names = parseNames(rawNames);
251653
- return deleteFunctionsAction(names);
251713
+ return deleteFunctionsAction(ctx, names);
251654
251714
  });
251655
251715
  }
251656
251716
 
@@ -251658,15 +251718,15 @@ function getDeleteCommand() {
251658
251718
  function formatDuration(ms) {
251659
251719
  return `${(ms / 1000).toFixed(1)}s`;
251660
251720
  }
251661
- function formatDeployResult(result) {
251721
+ function formatDeployResult(result, log) {
251662
251722
  const label = result.name.padEnd(25);
251663
251723
  if (result.status === "deployed") {
251664
251724
  const timing = result.durationMs ? theme.styles.dim(` (${formatDuration(result.durationMs)})`) : "";
251665
- R2.success(`${label} deployed${timing}`);
251725
+ log.success(`${label} deployed${timing}`);
251666
251726
  } else if (result.status === "unchanged") {
251667
- R2.success(`${label} unchanged`);
251727
+ log.success(`${label} unchanged`);
251668
251728
  } else {
251669
- R2.error(`${label} error: ${result.error}`);
251729
+ log.error(`${label} error: ${result.error}`);
251670
251730
  }
251671
251731
  }
251672
251732
 
@@ -251685,17 +251745,17 @@ function resolveFunctionsToDeploy(names, allFunctions) {
251685
251745
  }
251686
251746
  return allFunctions.filter((f) => names.includes(f.name));
251687
251747
  }
251688
- function formatPruneResult(pruneResult) {
251748
+ function formatPruneResult(pruneResult, log) {
251689
251749
  if (pruneResult.deleted) {
251690
- R2.success(`${pruneResult.name.padEnd(25)} deleted`);
251750
+ log.success(`${pruneResult.name.padEnd(25)} deleted`);
251691
251751
  } else {
251692
- R2.error(`${pruneResult.name.padEnd(25)} error: ${pruneResult.error}`);
251752
+ log.error(`${pruneResult.name.padEnd(25)} error: ${pruneResult.error}`);
251693
251753
  }
251694
251754
  }
251695
- function formatPruneSummary(pruneResults) {
251755
+ function formatPruneSummary(pruneResults, log) {
251696
251756
  if (pruneResults.length > 0) {
251697
251757
  const pruned = pruneResults.filter((r) => r.deleted).length;
251698
- R2.info(`${pruned} deleted`);
251758
+ log.info(`${pruned} deleted`);
251699
251759
  }
251700
251760
  }
251701
251761
  function buildDeploySummary(results) {
@@ -251711,7 +251771,7 @@ function buildDeploySummary(results) {
251711
251771
  parts.push(`${failed} error${failed !== 1 ? "s" : ""}`);
251712
251772
  return parts.join(", ") || "No functions deployed";
251713
251773
  }
251714
- async function deployFunctionsAction(names, options) {
251774
+ async function deployFunctionsAction({ log }, names, options) {
251715
251775
  if (options.force && names.length > 0) {
251716
251776
  throw new InvalidInputError("--force cannot be used when specifying function names");
251717
251777
  }
@@ -251722,17 +251782,17 @@ async function deployFunctionsAction(names, options) {
251722
251782
  outroMessage: "No functions found. Create functions in the 'functions' directory."
251723
251783
  };
251724
251784
  }
251725
- R2.info(`Found ${toDeploy.length} ${toDeploy.length === 1 ? "function" : "functions"} to deploy`);
251785
+ log.info(`Found ${toDeploy.length} ${toDeploy.length === 1 ? "function" : "functions"} to deploy`);
251726
251786
  let completed = 0;
251727
251787
  const total = toDeploy.length;
251728
251788
  const results = await deployFunctionsSequentially(toDeploy, {
251729
251789
  onStart: (startNames) => {
251730
251790
  const label = startNames.length === 1 ? startNames[0] : `${startNames.length} functions`;
251731
- R2.step(theme.styles.dim(`[${completed + 1}/${total}] Deploying ${label}...`));
251791
+ log.step(theme.styles.dim(`[${completed + 1}/${total}] Deploying ${label}...`));
251732
251792
  },
251733
251793
  onResult: (result) => {
251734
251794
  completed++;
251735
- formatDeployResult(result);
251795
+ formatDeployResult(result, log);
251736
251796
  }
251737
251797
  });
251738
251798
  if (options.force) {
@@ -251743,28 +251803,30 @@ async function deployFunctionsAction(names, options) {
251743
251803
  onStart: (total2) => {
251744
251804
  pruneTotal = total2;
251745
251805
  if (total2 > 0) {
251746
- R2.info(`Found ${total2} remote ${total2 === 1 ? "function" : "functions"} to delete`);
251806
+ log.info(`Found ${total2} remote ${total2 === 1 ? "function" : "functions"} to delete`);
251747
251807
  }
251748
251808
  },
251749
251809
  onBeforeDelete: (name2) => {
251750
251810
  pruneCompleted++;
251751
- R2.step(theme.styles.dim(`[${pruneCompleted}/${pruneTotal}] Deleting ${name2}...`));
251811
+ log.step(theme.styles.dim(`[${pruneCompleted}/${pruneTotal}] Deleting ${name2}...`));
251752
251812
  },
251753
- onResult: formatPruneResult
251813
+ onResult: (r) => formatPruneResult(r, log)
251754
251814
  });
251755
- formatPruneSummary(pruneResults);
251815
+ formatPruneSummary(pruneResults, log);
251756
251816
  }
251757
251817
  return { outroMessage: buildDeploySummary(results) };
251758
251818
  }
251759
251819
  function getDeployCommand() {
251760
- return new Base44Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (rawNames, options) => {
251820
+ return new Base44Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (ctx, rawNames, options) => {
251761
251821
  const names = parseNames2(rawNames);
251762
- return deployFunctionsAction(names, options);
251822
+ return deployFunctionsAction(ctx, names, options);
251763
251823
  });
251764
251824
  }
251765
251825
 
251766
251826
  // src/cli/commands/functions/list.ts
251767
- async function listFunctionsAction() {
251827
+ async function listFunctionsAction({
251828
+ log
251829
+ }) {
251768
251830
  const { functions } = await runTask("Fetching functions...", async () => listDeployedFunctions(), { errorMessage: "Failed to fetch functions" });
251769
251831
  if (functions.length === 0) {
251770
251832
  return { outroMessage: "No functions on remote" };
@@ -251772,7 +251834,7 @@ async function listFunctionsAction() {
251772
251834
  for (const fn of functions) {
251773
251835
  const automationCount = fn.automations.length;
251774
251836
  const automationLabel = automationCount > 0 ? theme.styles.dim(` (${automationCount} automation${automationCount > 1 ? "s" : ""})`) : "";
251775
- R2.message(` ${fn.name}${automationLabel}`);
251837
+ log.message(` ${fn.name}${automationLabel}`);
251776
251838
  }
251777
251839
  return {
251778
251840
  outroMessage: `${functions.length} function${functions.length !== 1 ? "s" : ""} on remote`
@@ -251784,7 +251846,7 @@ function getListCommand() {
251784
251846
 
251785
251847
  // src/cli/commands/functions/pull.ts
251786
251848
  import { dirname as dirname11, join as join16 } from "node:path";
251787
- async function pullFunctionsAction(name2) {
251849
+ async function pullFunctionsAction({ log }, name2) {
251788
251850
  const { project: project2 } = await readProjectConfig();
251789
251851
  const configDir = dirname11(project2.configPath);
251790
251852
  const functionsDir = join16(configDir, project2.functionsDir);
@@ -251811,10 +251873,10 @@ async function pullFunctionsAction(name2) {
251811
251873
  errorMessage: "Failed to write function files"
251812
251874
  });
251813
251875
  for (const name3 of written) {
251814
- R2.success(`${name3.padEnd(25)} written`);
251876
+ log.success(`${name3.padEnd(25)} written`);
251815
251877
  }
251816
251878
  for (const name3 of skipped) {
251817
- R2.info(`${name3.padEnd(25)} unchanged`);
251879
+ log.info(`${name3.padEnd(25)} unchanged`);
251818
251880
  }
251819
251881
  return {
251820
251882
  outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
@@ -251850,7 +251912,7 @@ function validateNonInteractiveFlags(command2) {
251850
251912
  command2.error("--path requires a project name argument. Usage: base44 create <name> --path <path>");
251851
251913
  }
251852
251914
  }
251853
- async function createInteractive(options) {
251915
+ async function createInteractive(options, log) {
251854
251916
  const templates = await listTemplates();
251855
251917
  const templateOptions = templates.map((t) => ({
251856
251918
  value: t,
@@ -251892,10 +251954,10 @@ async function createInteractive(options) {
251892
251954
  deploy: options.deploy,
251893
251955
  skills: options.skills,
251894
251956
  isInteractive: true
251895
- });
251957
+ }, log);
251896
251958
  }
251897
- async function createNonInteractive(options) {
251898
- R2.info(`Creating a new project at ${resolve2(options.path)}`);
251959
+ async function createNonInteractive(options, log) {
251960
+ log.info(`Creating a new project at ${resolve2(options.path)}`);
251899
251961
  const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
251900
251962
  return await executeCreate({
251901
251963
  template: template2,
@@ -251904,7 +251966,7 @@ async function createNonInteractive(options) {
251904
251966
  deploy: options.deploy,
251905
251967
  skills: options.skills,
251906
251968
  isInteractive: false
251907
- });
251969
+ }, log);
251908
251970
  }
251909
251971
  async function executeCreate({
251910
251972
  template: template2,
@@ -251914,7 +251976,7 @@ async function executeCreate({
251914
251976
  deploy: deploy5,
251915
251977
  skills,
251916
251978
  isInteractive
251917
- }) {
251979
+ }, log) {
251918
251980
  const name2 = rawName.trim();
251919
251981
  const resolvedPath = resolve2(projectPath);
251920
251982
  const { projectId } = await runTask("Setting up your project...", async () => {
@@ -251989,13 +252051,32 @@ async function executeCreate({
251989
252051
  });
251990
252052
  } catch {}
251991
252053
  }
251992
- R2.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name2)}`);
251993
- R2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
252054
+ log.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name2)}`);
252055
+ log.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
251994
252056
  if (finalAppUrl) {
251995
- R2.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
252057
+ log.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
251996
252058
  }
251997
252059
  return { outroMessage: "Your project is set up and ready to use" };
251998
252060
  }
252061
+ async function createAction({ log, isNonInteractive }, name2, options) {
252062
+ if (name2 && !options.path) {
252063
+ options.path = `./${import_kebabCase.default(name2)}`;
252064
+ }
252065
+ const skipPrompts = !!(options.name ?? name2) && !!options.path;
252066
+ if (!skipPrompts && isNonInteractive) {
252067
+ throw new InvalidInputError("Project name and --path are required in non-interactive mode", {
252068
+ hints: [
252069
+ {
252070
+ message: "Usage: base44 create <name> --path <path>"
252071
+ }
252072
+ ]
252073
+ });
252074
+ }
252075
+ if (skipPrompts) {
252076
+ return await createNonInteractive({ name: options.name ?? name2, ...options }, log);
252077
+ }
252078
+ return await createInteractive({ name: name2, ...options }, log);
252079
+ }
251999
252080
  function getCreateCommand() {
252000
252081
  return new Base44Command("create", {
252001
252082
  requireAppConfig: false,
@@ -252004,32 +252085,14 @@ function getCreateCommand() {
252004
252085
  Examples:
252005
252086
  $ base44 create my-app Creates a base44 project at ./my-app
252006
252087
  $ base44 create my-todo-app --template backend-and-client Creates a base44 backend-and-client project at ./my-todo-app
252007
- $ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(async (name2, options, command2) => {
252008
- if (name2 && !options.path) {
252009
- options.path = `./${import_kebabCase.default(name2)}`;
252010
- }
252011
- const skipPrompts = !!(options.name ?? name2) && !!options.path;
252012
- if (!skipPrompts && command2.isNonInteractive) {
252013
- throw new InvalidInputError("Project name and --path are required in non-interactive mode", {
252014
- hints: [
252015
- {
252016
- message: "Usage: base44 create <name> --path <path>"
252017
- }
252018
- ]
252019
- });
252020
- }
252021
- if (skipPrompts) {
252022
- return await createNonInteractive({
252023
- name: options.name ?? name2,
252024
- ...options
252025
- });
252026
- }
252027
- return await createInteractive({ name: name2, ...options });
252028
- });
252088
+ $ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(createAction);
252029
252089
  }
252030
252090
 
252031
252091
  // src/cli/commands/project/deploy.ts
252032
- async function deployAction(options) {
252092
+ async function deployAction({ isNonInteractive, log }, options = {}) {
252093
+ if (isNonInteractive && !options.yes) {
252094
+ throw new InvalidInputError("--yes is required in non-interactive mode");
252095
+ }
252033
252096
  const projectData = await readProjectConfig(options.projectRoot);
252034
252097
  if (!hasResourcesToDeploy(projectData)) {
252035
252098
  return {
@@ -252050,14 +252113,14 @@ async function deployAction(options) {
252050
252113
  if (connectors.length > 0) {
252051
252114
  summaryLines.push(` - ${connectors.length} ${connectors.length === 1 ? "connector" : "connectors"}`);
252052
252115
  }
252053
- if (authConfig) {
252116
+ if (authConfig.length > 0) {
252054
252117
  summaryLines.push(" - Auth config");
252055
252118
  }
252056
252119
  if (project2.site?.outputDirectory) {
252057
252120
  summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
252058
252121
  }
252059
252122
  if (!options.yes) {
252060
- R2.warn(`This will update your Base44 app with:
252123
+ log.warn(`This will update your Base44 app with:
252061
252124
  ${summaryLines.join(`
252062
252125
  `)}`);
252063
252126
  const shouldDeploy = await Re({
@@ -252067,7 +252130,7 @@ ${summaryLines.join(`
252067
252130
  return { outroMessage: "Deployment cancelled" };
252068
252131
  }
252069
252132
  } else {
252070
- R2.info(`Deploying:
252133
+ log.info(`Deploying:
252071
252134
  ${summaryLines.join(`
252072
252135
  `)}`);
252073
252136
  }
@@ -252076,54 +252139,46 @@ ${summaryLines.join(`
252076
252139
  const result = await deployAll(projectData, {
252077
252140
  onFunctionStart: (names) => {
252078
252141
  const label = names.length === 1 ? names[0] : `${names.length} functions`;
252079
- R2.step(theme.styles.dim(`[${functionCompleted + 1}/${functionTotal}] Deploying ${label}...`));
252142
+ log.step(theme.styles.dim(`[${functionCompleted + 1}/${functionTotal}] Deploying ${label}...`));
252080
252143
  },
252081
252144
  onFunctionResult: (r) => {
252082
252145
  functionCompleted++;
252083
- formatDeployResult(r);
252146
+ formatDeployResult(r, log);
252084
252147
  }
252085
252148
  });
252086
252149
  const connectorResults = result.connectorResults ?? [];
252087
- await handleOAuthConnectors(connectorResults, options);
252150
+ await handleOAuthConnectors(connectorResults, isNonInteractive, options, log);
252088
252151
  const stripeResult = connectorResults.find((r) => r.type === "stripe");
252089
252152
  if (stripeResult?.action === "provisioned") {
252090
- printStripeResult(stripeResult);
252153
+ printStripeResult(stripeResult, log);
252091
252154
  }
252092
- R2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl())}`);
252155
+ log.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl())}`);
252093
252156
  if (result.appUrl) {
252094
- R2.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
252157
+ log.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
252095
252158
  }
252096
252159
  return { outroMessage: "App deployed successfully" };
252097
252160
  }
252098
252161
  function getDeployCommand2() {
252099
- return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options, command2) => {
252100
- if (command2.isNonInteractive && !options.yes) {
252101
- throw new InvalidInputError("--yes is required in non-interactive mode");
252102
- }
252103
- return await deployAction({
252104
- ...options,
252105
- isNonInteractive: command2.isNonInteractive
252106
- });
252107
- });
252162
+ return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(deployAction);
252108
252163
  }
252109
- async function handleOAuthConnectors(connectorResults, options) {
252164
+ async function handleOAuthConnectors(connectorResults, isNonInteractive, options, log) {
252110
252165
  const needsOAuth = filterPendingOAuth(connectorResults);
252111
252166
  if (needsOAuth.length === 0)
252112
252167
  return;
252113
- const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
252114
- skipPrompt: options.yes || options.isNonInteractive
252168
+ const oauthOutcomes = await promptOAuthFlows(needsOAuth, log, {
252169
+ skipPrompt: options.yes || isNonInteractive
252115
252170
  });
252116
252171
  const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
252117
252172
  if (!allAuthorized) {
252118
- R2.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
252173
+ log.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
252119
252174
  }
252120
252175
  }
252121
- function printStripeResult(r) {
252122
- R2.success("Stripe sandbox provisioned");
252176
+ function printStripeResult(r, log) {
252177
+ log.success("Stripe sandbox provisioned");
252123
252178
  if (r.claimUrl) {
252124
- R2.info(` Claim your Stripe sandbox: ${theme.colors.links(r.claimUrl)}`);
252179
+ log.info(` Claim your Stripe sandbox: ${theme.colors.links(r.claimUrl)}`);
252125
252180
  }
252126
- R2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
252181
+ log.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
252127
252182
  }
252128
252183
 
252129
252184
  // src/cli/commands/project/link.ts
@@ -252199,7 +252254,12 @@ async function promptForExistingProject(linkableProjects) {
252199
252254
  }
252200
252255
  return selectedProject;
252201
252256
  }
252202
- async function link(options) {
252257
+ async function link(ctx, options) {
252258
+ const { log, isNonInteractive } = ctx;
252259
+ const skipPrompts = !!options.create || !!options.projectId;
252260
+ if (!skipPrompts && isNonInteractive) {
252261
+ throw new InvalidInputError("--create with --name, or --projectId, is required in non-interactive mode");
252262
+ }
252203
252263
  const projectRoot = await findProjectRoot();
252204
252264
  if (!projectRoot) {
252205
252265
  throw new ConfigNotFoundError("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
@@ -252263,17 +252323,11 @@ async function link(options) {
252263
252323
  setAppConfig({ id: projectId, projectRoot: projectRoot.root });
252264
252324
  finalProjectId = projectId;
252265
252325
  }
252266
- R2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(finalProjectId))}`);
252326
+ log.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(finalProjectId))}`);
252267
252327
  return { outroMessage: "Project linked" };
252268
252328
  }
252269
252329
  function getLinkCommand() {
252270
- return new Base44Command("link", { requireAppConfig: false }).description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(async (options, command2) => {
252271
- const skipPrompts = !!options.create || !!options.projectId;
252272
- if (!skipPrompts && command2.isNonInteractive) {
252273
- throw new InvalidInputError("--create with --name, or --projectId, is required in non-interactive mode");
252274
- }
252275
- return await link(options);
252276
- });
252330
+ return new Base44Command("link", { requireAppConfig: false }).description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(link);
252277
252331
  }
252278
252332
 
252279
252333
  // src/cli/commands/project/logs.ts
@@ -252375,7 +252429,7 @@ function validateLimit(limit) {
252375
252429
  throw new InvalidInputError(`Invalid limit: "${limit}". Must be a number between 1 and 1000.`);
252376
252430
  }
252377
252431
  }
252378
- async function logsAction(options) {
252432
+ async function logsAction(_ctx, options) {
252379
252433
  validateLimit(options.limit);
252380
252434
  const specifiedFunctions = parseFunctionNames(options.function);
252381
252435
  const allProjectFunctions = await getAllFunctionNames();
@@ -252397,7 +252451,7 @@ function getLogsCommand() {
252397
252451
  }
252398
252452
 
252399
252453
  // src/cli/commands/secrets/delete.ts
252400
- async function deleteSecretAction(key) {
252454
+ async function deleteSecretAction(_ctx, key) {
252401
252455
  await runTask(`Deleting secret "${key}"`, async () => {
252402
252456
  return await deleteSecret(key);
252403
252457
  }, {
@@ -252413,7 +252467,9 @@ function getSecretsDeleteCommand() {
252413
252467
  }
252414
252468
 
252415
252469
  // src/cli/commands/secrets/list.ts
252416
- async function listSecretsAction() {
252470
+ async function listSecretsAction({
252471
+ log
252472
+ }) {
252417
252473
  const secrets = await runTask("Fetching secrets from Base44", async () => {
252418
252474
  return await listSecrets();
252419
252475
  }, {
@@ -252425,7 +252481,7 @@ async function listSecretsAction() {
252425
252481
  return { outroMessage: "No secrets configured." };
252426
252482
  }
252427
252483
  for (const name2 of names) {
252428
- R2.info(name2);
252484
+ log.info(name2);
252429
252485
  }
252430
252486
  return {
252431
252487
  outroMessage: `Found ${names.length} secrets.`
@@ -252463,7 +252519,7 @@ function validateInput(entries, options) {
252463
252519
  throw new InvalidInputError("Provide KEY=VALUE pairs or --env-file, but not both.");
252464
252520
  }
252465
252521
  }
252466
- async function setSecretsAction(entries, options) {
252522
+ async function setSecretsAction({ log }, entries, options) {
252467
252523
  validateInput(entries, options);
252468
252524
  let secrets;
252469
252525
  if (options.envFile) {
@@ -252481,7 +252537,7 @@ async function setSecretsAction(entries, options) {
252481
252537
  successMessage: `${names.length} secrets set successfully`,
252482
252538
  errorMessage: "Failed to set secrets"
252483
252539
  });
252484
- R2.info(`Set: ${names.join(", ")}`);
252540
+ log.info(`Set: ${names.join(", ")}`);
252485
252541
  return {
252486
252542
  outroMessage: "Secrets set successfully."
252487
252543
  };
@@ -252497,7 +252553,10 @@ function getSecretsCommand() {
252497
252553
 
252498
252554
  // src/cli/commands/site/deploy.ts
252499
252555
  import { resolve as resolve4 } from "node:path";
252500
- async function deployAction2(options) {
252556
+ async function deployAction2({ isNonInteractive }, options) {
252557
+ if (isNonInteractive && !options.yes) {
252558
+ throw new InvalidInputError("--yes is required in non-interactive mode");
252559
+ }
252501
252560
  const { project: project2 } = await readProjectConfig();
252502
252561
  if (!project2.site?.outputDirectory) {
252503
252562
  throw new ConfigNotFoundError("No site configuration found.", {
@@ -252526,19 +252585,13 @@ async function deployAction2(options) {
252526
252585
  return { outroMessage: `Visit your site at: ${result.appUrl}` };
252527
252586
  }
252528
252587
  function getSiteDeployCommand() {
252529
- return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(async (options, command2) => {
252530
- if (command2.isNonInteractive && !options.yes) {
252531
- throw new InvalidInputError("--yes is required in non-interactive mode");
252532
- }
252533
- return await deployAction2({
252534
- ...options,
252535
- isNonInteractive: command2.isNonInteractive
252536
- });
252537
- });
252588
+ return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(deployAction2);
252538
252589
  }
252539
252590
 
252540
252591
  // src/cli/commands/site/open.ts
252541
- async function openAction(isNonInteractive) {
252592
+ async function openAction({
252593
+ isNonInteractive
252594
+ }) {
252542
252595
  const siteUrl = await getSiteUrl();
252543
252596
  if (!isNonInteractive) {
252544
252597
  await open_default(siteUrl);
@@ -252546,9 +252599,7 @@ async function openAction(isNonInteractive) {
252546
252599
  return { outroMessage: `Site opened at ${siteUrl}` };
252547
252600
  }
252548
252601
  function getSiteOpenCommand() {
252549
- return new Base44Command("open").description("Open the published site in your browser").action(async (_options, command2) => {
252550
- return await openAction(command2.isNonInteractive);
252551
- });
252602
+ return new Base44Command("open").description("Open the published site in your browser").action(openAction);
252552
252603
  }
252553
252604
 
252554
252605
  // src/cli/commands/site/index.ts
@@ -252666,7 +252717,7 @@ async function updateProjectConfig(projectRoot) {
252666
252717
  }
252667
252718
  // src/cli/commands/types/generate.ts
252668
252719
  var TYPES_FILE_PATH = "base44/.types/types.d.ts";
252669
- async function generateTypesAction() {
252720
+ async function generateTypesAction(_ctx) {
252670
252721
  const { entities, functions, agents, connectors, project: project2 } = await readProjectConfig();
252671
252722
  await runTask("Generating types", async () => {
252672
252723
  await generateTypesFile({ entities, functions, agents, connectors });
@@ -252686,9 +252737,9 @@ function getTypesCommand() {
252686
252737
  }
252687
252738
 
252688
252739
  // src/cli/dev/dev-server/main.ts
252689
- import { dirname as dirname16, join as join23 } from "node:path";
252690
252740
  var import_cors = __toESM(require_lib4(), 1);
252691
252741
  var import_express5 = __toESM(require_express(), 1);
252742
+ import { dirname as dirname16, join as join23 } from "node:path";
252692
252743
 
252693
252744
  // ../../node_modules/get-port/index.js
252694
252745
  import net from "node:net";
@@ -252854,9 +252905,9 @@ class FunctionManager {
252854
252905
  starting = new Map;
252855
252906
  logger;
252856
252907
  wrapperPath;
252857
- constructor(functions, logger, wrapperPath) {
252908
+ constructor(functions, logger2, wrapperPath) {
252858
252909
  this.functions = new Map(functions.map((f7) => [f7.name, f7]));
252859
- this.logger = logger;
252910
+ this.logger = logger2;
252860
252911
  this.wrapperPath = wrapperPath;
252861
252912
  if (functions.length > 0) {
252862
252913
  verifyDenoInstalled("to run backend functions locally");
@@ -252995,7 +253046,7 @@ class FunctionManager {
252995
253046
  var import_express = __toESM(require_express(), 1);
252996
253047
  var import_http_proxy_middleware = __toESM(require_dist2(), 1);
252997
253048
  import { ServerResponse } from "node:http";
252998
- function createFunctionRouter(manager, logger) {
253049
+ function createFunctionRouter(manager, logger2) {
252999
253050
  const router = import_express.Router({ mergeParams: true });
253000
253051
  const portsByRequest = new WeakMap;
253001
253052
  const proxy = import_http_proxy_middleware.createProxyMiddleware({
@@ -253010,7 +253061,7 @@ function createFunctionRouter(manager, logger) {
253010
253061
  proxyReq.setHeader("Base44-Api-Url", `${req.protocol}://${req.headers.host}`);
253011
253062
  },
253012
253063
  error: (err, _req, res) => {
253013
- logger.error("Function proxy error:", err);
253064
+ logger2.error("Function proxy error:", err);
253014
253065
  if (res instanceof ServerResponse && !res.headersSent) {
253015
253066
  res.writeHead(502, { "Content-Type": "application/json" });
253016
253067
  res.end(JSON.stringify({
@@ -253028,7 +253079,7 @@ function createFunctionRouter(manager, logger) {
253028
253079
  portsByRequest.set(req, port);
253029
253080
  next();
253030
253081
  } catch (error48) {
253031
- logger.error("Function error:", error48);
253082
+ logger2.error("Function error:", error48);
253032
253083
  const message = error48 instanceof Error ? error48.message : String(error48);
253033
253084
  res.status(500).json({ error: message });
253034
253085
  }
@@ -253364,7 +253415,7 @@ var import_express3 = __toESM(require_express(), 1);
253364
253415
  // src/cli/dev/dev-server/routes/entities/entities-user-router.ts
253365
253416
  var import_express2 = __toESM(require_express(), 1);
253366
253417
  var import_jsonwebtoken = __toESM(require_jsonwebtoken(), 1);
253367
- function createUserRouter(db2, logger) {
253418
+ function createUserRouter(db2, logger2) {
253368
253419
  const router = import_express2.Router({ mergeParams: true });
253369
253420
  const parseBody = import_express2.json();
253370
253421
  function withAuth(handler) {
@@ -253443,7 +253494,7 @@ function createUserRouter(db2, logger) {
253443
253494
  res.status(422).json(error48.context);
253444
253495
  return;
253445
253496
  }
253446
- logger.error(`Error in PUT /${USER_COLLECTION}/${req.params.id}:`, error48);
253497
+ logger2.error(`Error in PUT /${USER_COLLECTION}/${req.params.id}:`, error48);
253447
253498
  res.status(500).json({ error: "Internal server error" });
253448
253499
  }
253449
253500
  } else {
@@ -253479,7 +253530,7 @@ function parseFields(fields) {
253479
253530
  }
253480
253531
  return Object.keys(projection).length > 0 ? projection : undefined;
253481
253532
  }
253482
- async function createEntityRoutes(db2, logger, broadcast) {
253533
+ async function createEntityRoutes(db2, logger2, broadcast) {
253483
253534
  const router = import_express3.Router({ mergeParams: true });
253484
253535
  const parseBody = import_express3.json();
253485
253536
  function withCollection(handler) {
@@ -253507,7 +253558,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253507
253558
  }
253508
253559
  broadcast(appId, entityName, createData(data));
253509
253560
  }
253510
- const userRouter = createUserRouter(db2, logger);
253561
+ const userRouter = createUserRouter(db2, logger2);
253511
253562
  router.use("/User", userRouter);
253512
253563
  router.get("/:entityName/:id", withCollection(async (req, res, collection) => {
253513
253564
  const { entityName, id: id2 } = req.params;
@@ -253519,7 +253570,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253519
253570
  }
253520
253571
  res.json(stripInternalFields(doc2));
253521
253572
  } catch (error48) {
253522
- logger.error(`Error in GET /${entityName}/${id2}:`, error48);
253573
+ logger2.error(`Error in GET /${entityName}/${id2}:`, error48);
253523
253574
  res.status(500).json({ error: "Internal server error" });
253524
253575
  }
253525
253576
  }));
@@ -253560,7 +253611,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253560
253611
  const docs = await cursor3;
253561
253612
  res.json(stripInternalFields(docs));
253562
253613
  } catch (error48) {
253563
- logger.error(`Error in GET /${entityName}:`, error48);
253614
+ logger2.error(`Error in GET /${entityName}:`, error48);
253564
253615
  res.status(500).json({ error: "Internal server error" });
253565
253616
  }
253566
253617
  }));
@@ -253585,7 +253636,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253585
253636
  res.status(422).json(error48.context);
253586
253637
  return;
253587
253638
  }
253588
- logger.error(`Error in POST /${entityName}:`, error48);
253639
+ logger2.error(`Error in POST /${entityName}:`, error48);
253589
253640
  res.status(500).json({ error: "Internal server error" });
253590
253641
  }
253591
253642
  }));
@@ -253616,7 +253667,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253616
253667
  res.status(422).json(error48.context);
253617
253668
  return;
253618
253669
  }
253619
- logger.error(`Error in POST /${entityName}/bulk:`, error48);
253670
+ logger2.error(`Error in POST /${entityName}/bulk:`, error48);
253620
253671
  res.status(500).json({ error: "Internal server error" });
253621
253672
  }
253622
253673
  }));
@@ -253643,7 +253694,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253643
253694
  res.status(422).json(error48.context);
253644
253695
  return;
253645
253696
  }
253646
- logger.error(`Error in PUT /${entityName}/${id2}:`, error48);
253697
+ logger2.error(`Error in PUT /${entityName}/${id2}:`, error48);
253647
253698
  res.status(500).json({ error: "Internal server error" });
253648
253699
  }
253649
253700
  }));
@@ -253661,7 +253712,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253661
253712
  }
253662
253713
  res.json({ success: true });
253663
253714
  } catch (error48) {
253664
- logger.error(`Error in DELETE /${entityName}/${id2}:`, error48);
253715
+ logger2.error(`Error in DELETE /${entityName}/${id2}:`, error48);
253665
253716
  res.status(500).json({ error: "Internal server error" });
253666
253717
  }
253667
253718
  }));
@@ -253672,7 +253723,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253672
253723
  const numRemoved = await collection.removeAsync(query, { multi: true });
253673
253724
  res.json({ success: true, deleted: numRemoved });
253674
253725
  } catch (error48) {
253675
- logger.error(`Error in DELETE /${entityName}:`, error48);
253726
+ logger2.error(`Error in DELETE /${entityName}:`, error48);
253676
253727
  res.status(500).json({ error: "Internal server error" });
253677
253728
  }
253678
253729
  }));
@@ -253688,7 +253739,7 @@ import path18 from "node:path";
253688
253739
  function createFileToken(fileUri) {
253689
253740
  return createHash("sha256").update(fileUri).digest("hex");
253690
253741
  }
253691
- function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
253742
+ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger2) {
253692
253743
  const router = import_express4.Router({ mergeParams: true });
253693
253744
  const parseBody = import_express4.json();
253694
253745
  const privateFilesDir = path18.join(mediaFilesDir, "private");
@@ -253741,12 +253792,12 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
253741
253792
  res.json({ signed_url });
253742
253793
  });
253743
253794
  router.post("/Core/:endpointName", (req, res, next) => {
253744
- logger.warn(`Core.${req.params.endpointName} is not supported in local development`);
253795
+ logger2.warn(`Core.${req.params.endpointName} is not supported in local development`);
253745
253796
  req.url = req.originalUrl;
253746
253797
  remoteProxy(req, res, next);
253747
253798
  });
253748
253799
  router.post("/installable/:packageName/integration-endpoints/:endpointName", (req, res, next) => {
253749
- logger.warn(`${req.params.packageName}.${req.params.endpointName} is not supported in local development`);
253800
+ logger2.warn(`${req.params.packageName}.${req.params.endpointName} is not supported in local development`);
253750
253801
  req.url = req.originalUrl;
253751
253802
  remoteProxy(req, res, next);
253752
253803
  });
@@ -253759,10 +253810,10 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
253759
253810
  });
253760
253811
  return router;
253761
253812
  }
253762
- function createCustomIntegrationRoutes(remoteProxy, logger) {
253813
+ function createCustomIntegrationRoutes(remoteProxy, logger2) {
253763
253814
  const router = import_express4.Router({ mergeParams: true });
253764
253815
  router.post("/:slug/:operationId", (req, res, next) => {
253765
- logger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
253816
+ logger2.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
253766
253817
  req.url = req.originalUrl;
253767
253818
  remoteProxy(req, res, next);
253768
253819
  });
@@ -255395,10 +255446,10 @@ class WatchBase44 extends EventEmitter4 {
255395
255446
  entryNames;
255396
255447
  watchers = new Map;
255397
255448
  queueWaitForCreationTimeout = null;
255398
- constructor(itemsToWatch, logger) {
255449
+ constructor(itemsToWatch, logger2) {
255399
255450
  super();
255400
255451
  this.itemsToWatch = itemsToWatch;
255401
- this.logger = logger;
255452
+ this.logger = logger2;
255402
255453
  this.entryNames = Object.keys(itemsToWatch);
255403
255454
  }
255404
255455
  async start() {
@@ -255495,12 +255546,12 @@ async function createDevServer(options8) {
255495
255546
  const functionRoutes = createFunctionRouter(functionManager, devLogger);
255496
255547
  app.use("/api/apps/:appId/functions", functionRoutes);
255497
255548
  if (functionManager.getFunctionNames().length > 0) {
255498
- R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
255549
+ options8.log.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
255499
255550
  }
255500
255551
  const db2 = new Database;
255501
255552
  await db2.load(entities);
255502
255553
  if (db2.getCollectionNames().length > 0) {
255503
- R2.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
255554
+ options8.log.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
255504
255555
  }
255505
255556
  let emitEntityEvent = () => {};
255506
255557
  const entityRoutes = await createEntityRoutes(db2, devLogger, (...args) => emitEntityEvent(...args));
@@ -255596,9 +255647,10 @@ async function createDevServer(options8) {
255596
255647
  }
255597
255648
 
255598
255649
  // src/cli/commands/dev.ts
255599
- async function devAction(options8) {
255650
+ async function devAction({ log }, options8) {
255600
255651
  const port = options8.port ? Number(options8.port) : undefined;
255601
255652
  const { port: resolvedPort } = await createDevServer({
255653
+ log,
255602
255654
  port,
255603
255655
  denoWrapperPath: getDenoWrapperPath(),
255604
255656
  loadResources: async () => {
@@ -255696,15 +255748,22 @@ Examples:
255696
255748
  $ cat ./script.ts | base44 exec
255697
255749
 
255698
255750
  Inline script:
255699
- $ echo "const users = await base44.entities.User.list()" | base44 exec`).action(async (_options, command2) => {
255700
- return await execAction(command2.isNonInteractive);
255751
+ $ echo "const users = await base44.entities.User.list()" | base44 exec`).action(async ({ isNonInteractive }) => {
255752
+ return await execAction(isNonInteractive);
255701
255753
  });
255702
255754
  }
255703
255755
 
255704
255756
  // src/cli/commands/project/eject.ts
255705
255757
  import { resolve as resolve8 } from "node:path";
255706
255758
  var import_kebabCase2 = __toESM(require_kebabCase(), 1);
255707
- async function eject(options8) {
255759
+ async function eject(ctx, options8) {
255760
+ const { log, isNonInteractive } = ctx;
255761
+ if (isNonInteractive && !options8.projectId) {
255762
+ throw new InvalidInputError("--project-id is required in non-interactive mode");
255763
+ }
255764
+ if (isNonInteractive && !options8.path) {
255765
+ throw new InvalidInputError("--path is required in non-interactive mode");
255766
+ }
255708
255767
  const projects = await listProjects();
255709
255768
  const ejectableProjects = projects.filter((p4) => p4.isManagedSourceCode !== false);
255710
255769
  let selectedProject;
@@ -255720,7 +255779,7 @@ async function eject(options8) {
255720
255779
  });
255721
255780
  }
255722
255781
  selectedProject = foundProject;
255723
- R2.info(`Selected project: ${theme.styles.bold(selectedProject.name)}`);
255782
+ log.info(`Selected project: ${theme.styles.bold(selectedProject.name)}`);
255724
255783
  } else {
255725
255784
  if (ejectableProjects.length === 0) {
255726
255785
  return { outroMessage: "No projects available to eject." };
@@ -255784,24 +255843,13 @@ async function eject(options8) {
255784
255843
  successMessage: theme.colors.base44Orange("Project built successfully"),
255785
255844
  errorMessage: "Failed to build project"
255786
255845
  });
255787
- await deployAction({ yes: true, projectRoot: resolvedPath });
255846
+ await deployAction(ctx, { yes: true, projectRoot: resolvedPath });
255788
255847
  }
255789
255848
  }
255790
255849
  return { outroMessage: "Your new project is set and ready to use" };
255791
255850
  }
255792
255851
  function getEjectCommand() {
255793
- return new Base44Command("eject", { requireAppConfig: false }).description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(async (options8, command2) => {
255794
- if (command2.isNonInteractive && !options8.projectId) {
255795
- throw new InvalidInputError("--project-id is required in non-interactive mode");
255796
- }
255797
- if (command2.isNonInteractive && !options8.path) {
255798
- throw new InvalidInputError("--path is required in non-interactive mode");
255799
- }
255800
- return await eject({
255801
- ...options8,
255802
- isNonInteractive: command2.isNonInteractive
255803
- });
255804
- });
255852
+ return new Base44Command("eject", { requireAppConfig: false }).description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(eject);
255805
255853
  }
255806
255854
 
255807
255855
  // src/cli/program.ts
@@ -255829,7 +255877,7 @@ function createProgram(context) {
255829
255877
  program2.addCommand(getConnectorsCommand());
255830
255878
  program2.addCommand(getFunctionsCommand());
255831
255879
  program2.addCommand(getSecretsCommand());
255832
- program2.addCommand(getAuthCommand());
255880
+ program2.addCommand(getAuthCommand(), { hidden: true });
255833
255881
  program2.addCommand(getSiteCommand());
255834
255882
  program2.addCommand(getTypesCommand());
255835
255883
  program2.addCommand(getExecCommand());
@@ -256284,23 +256332,23 @@ function isInstanceOf(candidate, base) {
256284
256332
  }
256285
256333
 
256286
256334
  // ../../node_modules/@posthog/core/dist/utils/number-utils.mjs
256287
- function clampToRange(value, min, max, logger, fallbackValue) {
256335
+ function clampToRange(value, min, max, logger2, fallbackValue) {
256288
256336
  if (min > max) {
256289
- logger.warn("min cannot be greater than max.");
256337
+ logger2.warn("min cannot be greater than max.");
256290
256338
  min = max;
256291
256339
  }
256292
256340
  if (isNumber(value))
256293
256341
  if (value > max) {
256294
- logger.warn(" cannot be greater than max: " + max + ". Using max value instead.");
256342
+ logger2.warn(" cannot be greater than max: " + max + ". Using max value instead.");
256295
256343
  return max;
256296
256344
  } else {
256297
256345
  if (!(value < min))
256298
256346
  return value;
256299
- logger.warn(" cannot be less than min: " + min + ". Using min value instead.");
256347
+ logger2.warn(" cannot be less than min: " + min + ". Using min value instead.");
256300
256348
  return min;
256301
256349
  }
256302
- logger.warn(" must be a number. using max or fallback. max: " + max + ", fallback: " + fallbackValue);
256303
- return clampToRange(fallbackValue || max, min, max, logger);
256350
+ logger2.warn(" must be a number. using max or fallback. max: " + max + ", fallback: " + fallbackValue);
256351
+ return clampToRange(fallbackValue || max, min, max, logger2);
256304
256352
  }
256305
256353
 
256306
256354
  // ../../node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
@@ -256390,7 +256438,7 @@ var _createLogger = (prefix, maybeCall, consoleLike) => {
256390
256438
  consoleMethod(prefix, ...args);
256391
256439
  });
256392
256440
  }
256393
- const logger = {
256441
+ const logger2 = {
256394
256442
  info: (...args) => {
256395
256443
  _log("log", ...args);
256396
256444
  },
@@ -256405,7 +256453,7 @@ var _createLogger = (prefix, maybeCall, consoleLike) => {
256405
256453
  },
256406
256454
  createLogger: (additionalPrefix) => _createLogger(`${prefix} ${additionalPrefix}`, maybeCall, consoleLike)
256407
256455
  };
256408
- return logger;
256456
+ return logger2;
256409
256457
  };
256410
256458
  var passThrough = (fn9) => fn9();
256411
256459
  function createLogger(prefix, maybeCall = passThrough) {
@@ -260047,10 +260095,12 @@ async function runCLI(options8) {
260047
260095
  const errorReporter = new ErrorReporter;
260048
260096
  errorReporter.registerProcessErrorHandlers();
260049
260097
  const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
260098
+ const log = isNonInteractive ? new SimpleLogger : new ClackLogger;
260050
260099
  const context = {
260051
260100
  errorReporter,
260052
260101
  isNonInteractive,
260053
- distribution: options8?.distribution ?? "npm"
260102
+ distribution: options8?.distribution ?? "npm",
260103
+ log
260054
260104
  };
260055
260105
  const program2 = createProgram(context);
260056
260106
  try {
@@ -260076,4 +260126,4 @@ export {
260076
260126
  CLIExitError
260077
260127
  };
260078
260128
 
260079
- //# debugId=4B13E7885715C10064756E2164756E21
260129
+ //# debugId=016FD3965FA3714964756E2164756E21