@base44-preview/cli 0.0.21-pr.112.b9c226a → 0.0.21-pr.112.c15189d
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/index.js +330 -191
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:
|
|
|
3
3
|
import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
4
4
|
import path, { basename, dirname, join, posix, resolve, win32 } from "node:path";
|
|
5
5
|
import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
6
|
-
import
|
|
6
|
+
import process$1, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
|
|
7
7
|
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
8
8
|
import * as g from "node:readline";
|
|
9
9
|
import O from "node:readline";
|
|
@@ -15,8 +15,6 @@ import { finished } from "node:stream/promises";
|
|
|
15
15
|
import path$1, { dirname as dirname$1, parse } from "path";
|
|
16
16
|
import EE, { EventEmitter as EventEmitter$1 } from "events";
|
|
17
17
|
import fs$2 from "fs";
|
|
18
|
-
import { getAppClient } from "@core/clients/index.js";
|
|
19
|
-
import { formatApiError } from "@core/errors.js";
|
|
20
18
|
import { Buffer as Buffer$1 } from "buffer";
|
|
21
19
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
22
20
|
import { StringDecoder } from "node:string_decoder";
|
|
@@ -25,8 +23,6 @@ import * as realZlib$1 from "zlib";
|
|
|
25
23
|
import realZlib from "zlib";
|
|
26
24
|
import assert$1 from "node:assert";
|
|
27
25
|
import tty from "node:tty";
|
|
28
|
-
import { fetchAgents, pushAgents, writeAgents } from "@core/resources/agent/index.js";
|
|
29
|
-
import { readProjectConfig } from "@core/index.js";
|
|
30
26
|
import { scheduler, setImmediate as setImmediate$1, setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
31
27
|
import { serialize } from "node:v8";
|
|
32
28
|
import { Buffer as Buffer$2 } from "node:buffer";
|
|
@@ -897,7 +893,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
897
893
|
const childProcess$1 = __require("node:child_process");
|
|
898
894
|
const path$15 = __require("node:path");
|
|
899
895
|
const fs$10 = __require("node:fs");
|
|
900
|
-
const process$
|
|
896
|
+
const process$4 = __require("node:process");
|
|
901
897
|
const { Argument, humanReadableArgName } = require_argument();
|
|
902
898
|
const { CommanderError } = require_error$1();
|
|
903
899
|
const { Help } = require_help();
|
|
@@ -948,10 +944,10 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
948
944
|
this._showHelpAfterError = false;
|
|
949
945
|
this._showSuggestionAfterError = true;
|
|
950
946
|
this._outputConfiguration = {
|
|
951
|
-
writeOut: (str) => process$
|
|
952
|
-
writeErr: (str) => process$
|
|
953
|
-
getOutHelpWidth: () => process$
|
|
954
|
-
getErrHelpWidth: () => process$
|
|
947
|
+
writeOut: (str) => process$4.stdout.write(str),
|
|
948
|
+
writeErr: (str) => process$4.stderr.write(str),
|
|
949
|
+
getOutHelpWidth: () => process$4.stdout.isTTY ? process$4.stdout.columns : void 0,
|
|
950
|
+
getErrHelpWidth: () => process$4.stderr.isTTY ? process$4.stderr.columns : void 0,
|
|
955
951
|
outputError: (str, write) => write(str)
|
|
956
952
|
};
|
|
957
953
|
this._hidden = false;
|
|
@@ -1305,7 +1301,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1305
1301
|
*/
|
|
1306
1302
|
_exit(exitCode, code$1, message) {
|
|
1307
1303
|
if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code$1, message));
|
|
1308
|
-
process$
|
|
1304
|
+
process$4.exit(exitCode);
|
|
1309
1305
|
}
|
|
1310
1306
|
/**
|
|
1311
1307
|
* Register callback `fn` for the command.
|
|
@@ -1644,11 +1640,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1644
1640
|
if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
|
|
1645
1641
|
parseOptions = parseOptions || {};
|
|
1646
1642
|
if (argv === void 0 && parseOptions.from === void 0) {
|
|
1647
|
-
if (process$
|
|
1648
|
-
const execArgv$1 = process$
|
|
1643
|
+
if (process$4.versions?.electron) parseOptions.from = "electron";
|
|
1644
|
+
const execArgv$1 = process$4.execArgv ?? [];
|
|
1649
1645
|
if (execArgv$1.includes("-e") || execArgv$1.includes("--eval") || execArgv$1.includes("-p") || execArgv$1.includes("--print")) parseOptions.from = "eval";
|
|
1650
1646
|
}
|
|
1651
|
-
if (argv === void 0) argv = process$
|
|
1647
|
+
if (argv === void 0) argv = process$4.argv;
|
|
1652
1648
|
this.rawArgs = argv.slice();
|
|
1653
1649
|
let userArgs;
|
|
1654
1650
|
switch (parseOptions.from) {
|
|
@@ -1658,7 +1654,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1658
1654
|
userArgs = argv.slice(2);
|
|
1659
1655
|
break;
|
|
1660
1656
|
case "electron":
|
|
1661
|
-
if (process$
|
|
1657
|
+
if (process$4.defaultApp) {
|
|
1662
1658
|
this._scriptPath = argv[1];
|
|
1663
1659
|
userArgs = argv.slice(2);
|
|
1664
1660
|
} else userArgs = argv.slice(1);
|
|
@@ -1772,15 +1768,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1772
1768
|
}
|
|
1773
1769
|
launchWithNode = sourceExt.includes(path$15.extname(executableFile));
|
|
1774
1770
|
let proc$1;
|
|
1775
|
-
if (process$
|
|
1771
|
+
if (process$4.platform !== "win32") if (launchWithNode) {
|
|
1776
1772
|
args.unshift(executableFile);
|
|
1777
|
-
args = incrementNodeInspectorPort(process$
|
|
1778
|
-
proc$1 = childProcess$1.spawn(process$
|
|
1773
|
+
args = incrementNodeInspectorPort(process$4.execArgv).concat(args);
|
|
1774
|
+
proc$1 = childProcess$1.spawn(process$4.argv[0], args, { stdio: "inherit" });
|
|
1779
1775
|
} else proc$1 = childProcess$1.spawn(executableFile, args, { stdio: "inherit" });
|
|
1780
1776
|
else {
|
|
1781
1777
|
args.unshift(executableFile);
|
|
1782
|
-
args = incrementNodeInspectorPort(process$
|
|
1783
|
-
proc$1 = childProcess$1.spawn(process$
|
|
1778
|
+
args = incrementNodeInspectorPort(process$4.execArgv).concat(args);
|
|
1779
|
+
proc$1 = childProcess$1.spawn(process$4.execPath, args, { stdio: "inherit" });
|
|
1784
1780
|
}
|
|
1785
1781
|
if (!proc$1.killed) [
|
|
1786
1782
|
"SIGUSR1",
|
|
@@ -1789,14 +1785,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1789
1785
|
"SIGINT",
|
|
1790
1786
|
"SIGHUP"
|
|
1791
1787
|
].forEach((signal) => {
|
|
1792
|
-
process$
|
|
1788
|
+
process$4.on(signal, () => {
|
|
1793
1789
|
if (proc$1.killed === false && proc$1.exitCode === null) proc$1.kill(signal);
|
|
1794
1790
|
});
|
|
1795
1791
|
});
|
|
1796
1792
|
const exitCallback = this._exitCallback;
|
|
1797
1793
|
proc$1.on("close", (code$1) => {
|
|
1798
1794
|
code$1 = code$1 ?? 1;
|
|
1799
|
-
if (!exitCallback) process$
|
|
1795
|
+
if (!exitCallback) process$4.exit(code$1);
|
|
1800
1796
|
else exitCallback(new CommanderError(code$1, "commander.executeSubCommandAsync", "(close)"));
|
|
1801
1797
|
});
|
|
1802
1798
|
proc$1.on("error", (err) => {
|
|
@@ -1808,7 +1804,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1808
1804
|
- ${executableDirMessage}`;
|
|
1809
1805
|
throw new Error(executableMissing);
|
|
1810
1806
|
} else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
|
|
1811
|
-
if (!exitCallback) process$
|
|
1807
|
+
if (!exitCallback) process$4.exit(1);
|
|
1812
1808
|
else {
|
|
1813
1809
|
const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
|
|
1814
1810
|
wrappedError.nestedError = err;
|
|
@@ -2214,13 +2210,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2214
2210
|
*/
|
|
2215
2211
|
_parseOptionsEnv() {
|
|
2216
2212
|
this.options.forEach((option) => {
|
|
2217
|
-
if (option.envVar && option.envVar in process$
|
|
2213
|
+
if (option.envVar && option.envVar in process$4.env) {
|
|
2218
2214
|
const optionKey = option.attributeName();
|
|
2219
2215
|
if (this.getOptionValue(optionKey) === void 0 || [
|
|
2220
2216
|
"default",
|
|
2221
2217
|
"config",
|
|
2222
2218
|
"env"
|
|
2223
|
-
].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$
|
|
2219
|
+
].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$4.env[option.envVar]);
|
|
2224
2220
|
else this.emit(`optionEnv:${option.name()}`);
|
|
2225
2221
|
}
|
|
2226
2222
|
});
|
|
@@ -2599,7 +2595,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2599
2595
|
*/
|
|
2600
2596
|
help(contextOptions) {
|
|
2601
2597
|
this.outputHelp(contextOptions);
|
|
2602
|
-
let exitCode = process$
|
|
2598
|
+
let exitCode = process$4.exitCode || 0;
|
|
2603
2599
|
if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
|
|
2604
2600
|
this._exit(exitCode, "commander.help", "(outputHelp)");
|
|
2605
2601
|
}
|
|
@@ -2715,16 +2711,16 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2715
2711
|
const CSI = `${ESC}[`;
|
|
2716
2712
|
const beep = "\x07";
|
|
2717
2713
|
const cursor = {
|
|
2718
|
-
to(x$2, y$
|
|
2719
|
-
if (!y$
|
|
2720
|
-
return `${CSI}${y$
|
|
2714
|
+
to(x$2, y$1) {
|
|
2715
|
+
if (!y$1) return `${CSI}${x$2 + 1}G`;
|
|
2716
|
+
return `${CSI}${y$1 + 1};${x$2 + 1}H`;
|
|
2721
2717
|
},
|
|
2722
|
-
move(x$2, y$
|
|
2718
|
+
move(x$2, y$1) {
|
|
2723
2719
|
let ret = "";
|
|
2724
2720
|
if (x$2 < 0) ret += `${CSI}${-x$2}D`;
|
|
2725
2721
|
else if (x$2 > 0) ret += `${CSI}${x$2}C`;
|
|
2726
|
-
if (y$
|
|
2727
|
-
else if (y$
|
|
2722
|
+
if (y$1 < 0) ret += `${CSI}${-y$1}A`;
|
|
2723
|
+
else if (y$1 > 0) ret += `${CSI}${y$1}B`;
|
|
2728
2724
|
return ret;
|
|
2729
2725
|
},
|
|
2730
2726
|
up: (count$1 = 1) => `${CSI}${count$1}A`,
|
|
@@ -3034,13 +3030,13 @@ function rD() {
|
|
|
3034
3030
|
}
|
|
3035
3031
|
}), r;
|
|
3036
3032
|
}
|
|
3037
|
-
const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y
|
|
3033
|
+
const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e$1) => `${d$1.values().next().value}${V$1}${e$1}${G$1}`, K$1 = (e$1) => `${d$1.values().next().value}${_$1}${e$1}${y}`, aD = (e$1) => e$1.split(" ").map((u$2) => p(u$2)), k$1 = (e$1, u$2, t) => {
|
|
3038
3034
|
const F$1 = [...u$2];
|
|
3039
3035
|
let s = !1, i$1 = !1, D$1 = p(P$1(e$1[e$1.length - 1]));
|
|
3040
3036
|
for (const [C$1, n$1] of F$1.entries()) {
|
|
3041
3037
|
const E = p(n$1);
|
|
3042
3038
|
if (D$1 + E <= t ? e$1[e$1.length - 1] += n$1 : (e$1.push(n$1), D$1 = 0), d$1.has(n$1) && (s = !0, i$1 = F$1.slice(C$1 + 1).join("").startsWith(_$1)), s) {
|
|
3043
|
-
i$1 ? n$1 === y
|
|
3039
|
+
i$1 ? n$1 === y && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
|
|
3044
3040
|
continue;
|
|
3045
3041
|
}
|
|
3046
3042
|
D$1 += E, D$1 === t && C$1 < F$1.length - 1 && (e$1.push(""), D$1 = 0);
|
|
@@ -3082,7 +3078,7 @@ const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y$1 = "\x07", V$1 = "["
|
|
|
3082
3078
|
`)];
|
|
3083
3079
|
for (const [E, a$1] of n$1.entries()) {
|
|
3084
3080
|
if (F$1 += a$1, d$1.has(a$1)) {
|
|
3085
|
-
const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y
|
|
3081
|
+
const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y})`)).exec(n$1.slice(E).join("")) || { groups: {} };
|
|
3086
3082
|
if (c$1.code !== void 0) {
|
|
3087
3083
|
const f = Number.parseFloat(c$1.code);
|
|
3088
3084
|
s = f === oD ? void 0 : f;
|
|
@@ -3483,7 +3479,7 @@ var RD = class extends x$1 {
|
|
|
3483
3479
|
//#endregion
|
|
3484
3480
|
//#region node_modules/@clack/prompts/dist/index.mjs
|
|
3485
3481
|
function ce() {
|
|
3486
|
-
return
|
|
3482
|
+
return process$1.platform !== "win32" ? process$1.env.TERM !== "linux" : !!process$1.env.CI || !!process$1.env.WT_SESSION || !!process$1.env.TERMINUS_SUBLIME || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
3487
3483
|
}
|
|
3488
3484
|
const V = ce(), u$1 = (t, n$1) => V ? t : n$1, le = u$1("◆", "*"), L = u$1("■", "x"), W = u$1("▲", "x"), C = u$1("◇", "o"), ue = u$1("┌", "T"), o$1 = u$1("│", "|"), d = u$1("└", "—"), k = u$1("●", ">"), P = u$1("○", " "), A = u$1("◻", "[•]"), T = u$1("◼", "[+]"), F = u$1("◻", "[ ]"), $e = u$1("▪", "•"), _ = u$1("─", "-"), me = u$1("╮", "+"), de = u$1("├", "+"), pe = u$1("╯", "+"), q = u$1("●", "•"), D = u$1("◆", "*"), U = u$1("▲", "!"), K = u$1("■", "x"), b = (t) => {
|
|
3489
3485
|
switch (t) {
|
|
@@ -5822,6 +5818,97 @@ function handleTupleResult(result, final, index) {
|
|
|
5822
5818
|
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
5823
5819
|
final.value[index] = result.value;
|
|
5824
5820
|
}
|
|
5821
|
+
const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
5822
|
+
$ZodType.init(inst, def);
|
|
5823
|
+
inst._zod.parse = (payload, ctx) => {
|
|
5824
|
+
const input = payload.value;
|
|
5825
|
+
if (!isPlainObject$1(input)) {
|
|
5826
|
+
payload.issues.push({
|
|
5827
|
+
expected: "record",
|
|
5828
|
+
code: "invalid_type",
|
|
5829
|
+
input,
|
|
5830
|
+
inst
|
|
5831
|
+
});
|
|
5832
|
+
return payload;
|
|
5833
|
+
}
|
|
5834
|
+
const proms = [];
|
|
5835
|
+
const values = def.keyType._zod.values;
|
|
5836
|
+
if (values) {
|
|
5837
|
+
payload.value = {};
|
|
5838
|
+
const recordKeys = /* @__PURE__ */ new Set();
|
|
5839
|
+
for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
5840
|
+
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
5841
|
+
const result = def.valueType._zod.run({
|
|
5842
|
+
value: input[key],
|
|
5843
|
+
issues: []
|
|
5844
|
+
}, ctx);
|
|
5845
|
+
if (result instanceof Promise) proms.push(result.then((result$1) => {
|
|
5846
|
+
if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues));
|
|
5847
|
+
payload.value[key] = result$1.value;
|
|
5848
|
+
}));
|
|
5849
|
+
else {
|
|
5850
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
5851
|
+
payload.value[key] = result.value;
|
|
5852
|
+
}
|
|
5853
|
+
}
|
|
5854
|
+
let unrecognized;
|
|
5855
|
+
for (const key in input) if (!recordKeys.has(key)) {
|
|
5856
|
+
unrecognized = unrecognized ?? [];
|
|
5857
|
+
unrecognized.push(key);
|
|
5858
|
+
}
|
|
5859
|
+
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
5860
|
+
code: "unrecognized_keys",
|
|
5861
|
+
input,
|
|
5862
|
+
inst,
|
|
5863
|
+
keys: unrecognized
|
|
5864
|
+
});
|
|
5865
|
+
} else {
|
|
5866
|
+
payload.value = {};
|
|
5867
|
+
for (const key of Reflect.ownKeys(input)) {
|
|
5868
|
+
if (key === "__proto__") continue;
|
|
5869
|
+
let keyResult = def.keyType._zod.run({
|
|
5870
|
+
value: key,
|
|
5871
|
+
issues: []
|
|
5872
|
+
}, ctx);
|
|
5873
|
+
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
5874
|
+
if (typeof key === "string" && number$1.test(key) && keyResult.issues.length && keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number")) {
|
|
5875
|
+
const retryResult = def.keyType._zod.run({
|
|
5876
|
+
value: Number(key),
|
|
5877
|
+
issues: []
|
|
5878
|
+
}, ctx);
|
|
5879
|
+
if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
5880
|
+
if (retryResult.issues.length === 0) keyResult = retryResult;
|
|
5881
|
+
}
|
|
5882
|
+
if (keyResult.issues.length) {
|
|
5883
|
+
if (def.mode === "loose") payload.value[key] = input[key];
|
|
5884
|
+
else payload.issues.push({
|
|
5885
|
+
code: "invalid_key",
|
|
5886
|
+
origin: "record",
|
|
5887
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
5888
|
+
input: key,
|
|
5889
|
+
path: [key],
|
|
5890
|
+
inst
|
|
5891
|
+
});
|
|
5892
|
+
continue;
|
|
5893
|
+
}
|
|
5894
|
+
const result = def.valueType._zod.run({
|
|
5895
|
+
value: input[key],
|
|
5896
|
+
issues: []
|
|
5897
|
+
}, ctx);
|
|
5898
|
+
if (result instanceof Promise) proms.push(result.then((result$1) => {
|
|
5899
|
+
if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues));
|
|
5900
|
+
payload.value[keyResult.value] = result$1.value;
|
|
5901
|
+
}));
|
|
5902
|
+
else {
|
|
5903
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
5904
|
+
payload.value[keyResult.value] = result.value;
|
|
5905
|
+
}
|
|
5906
|
+
}
|
|
5907
|
+
}
|
|
5908
|
+
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
5909
|
+
return payload;
|
|
5910
|
+
};
|
|
5911
|
+
});
|
|
5825
5912
|
const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
5826
5913
|
$ZodType.init(inst, def);
|
|
5827
5914
|
const values = getEnumValues(def.entries);
|
|
@@ -6657,7 +6744,7 @@ function initializeContext(params) {
|
|
|
6657
6744
|
external: params?.external ?? void 0
|
|
6658
6745
|
};
|
|
6659
6746
|
}
|
|
6660
|
-
function process$
|
|
6747
|
+
function process$3(schema, ctx, _params = {
|
|
6661
6748
|
path: [],
|
|
6662
6749
|
schemaPath: []
|
|
6663
6750
|
}) {
|
|
@@ -6694,7 +6781,7 @@ function process$2(schema, ctx, _params = {
|
|
|
6694
6781
|
const parent = schema._zod.parent;
|
|
6695
6782
|
if (parent) {
|
|
6696
6783
|
if (!result.ref) result.ref = parent;
|
|
6697
|
-
process$
|
|
6784
|
+
process$3(parent, ctx, params);
|
|
6698
6785
|
ctx.seen.get(parent).isParent = true;
|
|
6699
6786
|
}
|
|
6700
6787
|
}
|
|
@@ -6906,7 +6993,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
|
6906
6993
|
...params,
|
|
6907
6994
|
processors
|
|
6908
6995
|
});
|
|
6909
|
-
process$
|
|
6996
|
+
process$3(schema, ctx);
|
|
6910
6997
|
extractDefs(ctx, schema);
|
|
6911
6998
|
return finalize(ctx, schema);
|
|
6912
6999
|
};
|
|
@@ -6918,7 +7005,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
6918
7005
|
io,
|
|
6919
7006
|
processors
|
|
6920
7007
|
});
|
|
6921
|
-
process$
|
|
7008
|
+
process$3(schema, ctx);
|
|
6922
7009
|
extractDefs(ctx, schema);
|
|
6923
7010
|
return finalize(ctx, schema);
|
|
6924
7011
|
};
|
|
@@ -7005,7 +7092,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
7005
7092
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
7006
7093
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
7007
7094
|
json.type = "array";
|
|
7008
|
-
json.items = process$
|
|
7095
|
+
json.items = process$3(def.element, ctx, {
|
|
7009
7096
|
...params,
|
|
7010
7097
|
path: [...params.path, "items"]
|
|
7011
7098
|
});
|
|
@@ -7016,7 +7103,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7016
7103
|
json.type = "object";
|
|
7017
7104
|
json.properties = {};
|
|
7018
7105
|
const shape = def.shape;
|
|
7019
|
-
for (const key in shape) json.properties[key] = process$
|
|
7106
|
+
for (const key in shape) json.properties[key] = process$3(shape[key], ctx, {
|
|
7020
7107
|
...params,
|
|
7021
7108
|
path: [
|
|
7022
7109
|
...params.path,
|
|
@@ -7034,7 +7121,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7034
7121
|
if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
|
|
7035
7122
|
else if (!def.catchall) {
|
|
7036
7123
|
if (ctx.io === "output") json.additionalProperties = false;
|
|
7037
|
-
} else if (def.catchall) json.additionalProperties = process$
|
|
7124
|
+
} else if (def.catchall) json.additionalProperties = process$3(def.catchall, ctx, {
|
|
7038
7125
|
...params,
|
|
7039
7126
|
path: [...params.path, "additionalProperties"]
|
|
7040
7127
|
});
|
|
@@ -7042,7 +7129,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7042
7129
|
const unionProcessor = (schema, ctx, json, params) => {
|
|
7043
7130
|
const def = schema._zod.def;
|
|
7044
7131
|
const isExclusive = def.inclusive === false;
|
|
7045
|
-
const options = def.options.map((x$2, i$1) => process$
|
|
7132
|
+
const options = def.options.map((x$2, i$1) => process$3(x$2, ctx, {
|
|
7046
7133
|
...params,
|
|
7047
7134
|
path: [
|
|
7048
7135
|
...params.path,
|
|
@@ -7055,7 +7142,7 @@ const unionProcessor = (schema, ctx, json, params) => {
|
|
|
7055
7142
|
};
|
|
7056
7143
|
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
7057
7144
|
const def = schema._zod.def;
|
|
7058
|
-
const a$1 = process$
|
|
7145
|
+
const a$1 = process$3(def.left, ctx, {
|
|
7059
7146
|
...params,
|
|
7060
7147
|
path: [
|
|
7061
7148
|
...params.path,
|
|
@@ -7063,7 +7150,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
|
|
|
7063
7150
|
0
|
|
7064
7151
|
]
|
|
7065
7152
|
});
|
|
7066
|
-
const b$2 = process$
|
|
7153
|
+
const b$2 = process$3(def.right, ctx, {
|
|
7067
7154
|
...params,
|
|
7068
7155
|
path: [
|
|
7069
7156
|
...params.path,
|
|
@@ -7080,7 +7167,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7080
7167
|
json.type = "array";
|
|
7081
7168
|
const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
7082
7169
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
7083
|
-
const prefixItems = def.items.map((x$2, i$1) => process$
|
|
7170
|
+
const prefixItems = def.items.map((x$2, i$1) => process$3(x$2, ctx, {
|
|
7084
7171
|
...params,
|
|
7085
7172
|
path: [
|
|
7086
7173
|
...params.path,
|
|
@@ -7088,7 +7175,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7088
7175
|
i$1
|
|
7089
7176
|
]
|
|
7090
7177
|
}));
|
|
7091
|
-
const rest = def.rest ? process$
|
|
7178
|
+
const rest = def.rest ? process$3(def.rest, ctx, {
|
|
7092
7179
|
...params,
|
|
7093
7180
|
path: [
|
|
7094
7181
|
...params.path,
|
|
@@ -7112,9 +7199,42 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7112
7199
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
7113
7200
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
7114
7201
|
};
|
|
7202
|
+
const recordProcessor = (schema, ctx, _json, params) => {
|
|
7203
|
+
const json = _json;
|
|
7204
|
+
const def = schema._zod.def;
|
|
7205
|
+
json.type = "object";
|
|
7206
|
+
const keyType = def.keyType;
|
|
7207
|
+
const patterns = keyType._zod.bag?.patterns;
|
|
7208
|
+
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
7209
|
+
const valueSchema = process$3(def.valueType, ctx, {
|
|
7210
|
+
...params,
|
|
7211
|
+
path: [
|
|
7212
|
+
...params.path,
|
|
7213
|
+
"patternProperties",
|
|
7214
|
+
"*"
|
|
7215
|
+
]
|
|
7216
|
+
});
|
|
7217
|
+
json.patternProperties = {};
|
|
7218
|
+
for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
|
|
7219
|
+
} else {
|
|
7220
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$3(def.keyType, ctx, {
|
|
7221
|
+
...params,
|
|
7222
|
+
path: [...params.path, "propertyNames"]
|
|
7223
|
+
});
|
|
7224
|
+
json.additionalProperties = process$3(def.valueType, ctx, {
|
|
7225
|
+
...params,
|
|
7226
|
+
path: [...params.path, "additionalProperties"]
|
|
7227
|
+
});
|
|
7228
|
+
}
|
|
7229
|
+
const keyValues = keyType._zod.values;
|
|
7230
|
+
if (keyValues) {
|
|
7231
|
+
const validKeyValues = [...keyValues].filter((v$1) => typeof v$1 === "string" || typeof v$1 === "number");
|
|
7232
|
+
if (validKeyValues.length > 0) json.required = validKeyValues;
|
|
7233
|
+
}
|
|
7234
|
+
};
|
|
7115
7235
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
7116
7236
|
const def = schema._zod.def;
|
|
7117
|
-
const inner = process$
|
|
7237
|
+
const inner = process$3(def.innerType, ctx, params);
|
|
7118
7238
|
const seen = ctx.seen.get(schema);
|
|
7119
7239
|
if (ctx.target === "openapi-3.0") {
|
|
7120
7240
|
seen.ref = def.innerType;
|
|
@@ -7123,27 +7243,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
|
|
|
7123
7243
|
};
|
|
7124
7244
|
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
7125
7245
|
const def = schema._zod.def;
|
|
7126
|
-
process$
|
|
7246
|
+
process$3(def.innerType, ctx, params);
|
|
7127
7247
|
const seen = ctx.seen.get(schema);
|
|
7128
7248
|
seen.ref = def.innerType;
|
|
7129
7249
|
};
|
|
7130
7250
|
const defaultProcessor = (schema, ctx, json, params) => {
|
|
7131
7251
|
const def = schema._zod.def;
|
|
7132
|
-
process$
|
|
7252
|
+
process$3(def.innerType, ctx, params);
|
|
7133
7253
|
const seen = ctx.seen.get(schema);
|
|
7134
7254
|
seen.ref = def.innerType;
|
|
7135
7255
|
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
7136
7256
|
};
|
|
7137
7257
|
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
7138
7258
|
const def = schema._zod.def;
|
|
7139
|
-
process$
|
|
7259
|
+
process$3(def.innerType, ctx, params);
|
|
7140
7260
|
const seen = ctx.seen.get(schema);
|
|
7141
7261
|
seen.ref = def.innerType;
|
|
7142
7262
|
if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
7143
7263
|
};
|
|
7144
7264
|
const catchProcessor = (schema, ctx, json, params) => {
|
|
7145
7265
|
const def = schema._zod.def;
|
|
7146
|
-
process$
|
|
7266
|
+
process$3(def.innerType, ctx, params);
|
|
7147
7267
|
const seen = ctx.seen.get(schema);
|
|
7148
7268
|
seen.ref = def.innerType;
|
|
7149
7269
|
let catchValue;
|
|
@@ -7157,20 +7277,20 @@ const catchProcessor = (schema, ctx, json, params) => {
|
|
|
7157
7277
|
const pipeProcessor = (schema, ctx, _json, params) => {
|
|
7158
7278
|
const def = schema._zod.def;
|
|
7159
7279
|
const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
|
|
7160
|
-
process$
|
|
7280
|
+
process$3(innerType, ctx, params);
|
|
7161
7281
|
const seen = ctx.seen.get(schema);
|
|
7162
7282
|
seen.ref = innerType;
|
|
7163
7283
|
};
|
|
7164
7284
|
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
7165
7285
|
const def = schema._zod.def;
|
|
7166
|
-
process$
|
|
7286
|
+
process$3(def.innerType, ctx, params);
|
|
7167
7287
|
const seen = ctx.seen.get(schema);
|
|
7168
7288
|
seen.ref = def.innerType;
|
|
7169
7289
|
json.readOnly = true;
|
|
7170
7290
|
};
|
|
7171
7291
|
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
7172
7292
|
const def = schema._zod.def;
|
|
7173
|
-
process$
|
|
7293
|
+
process$3(def.innerType, ctx, params);
|
|
7174
7294
|
const seen = ctx.seen.get(schema);
|
|
7175
7295
|
seen.ref = def.innerType;
|
|
7176
7296
|
};
|
|
@@ -7641,6 +7761,21 @@ function tuple(items, _paramsOrRest, _params) {
|
|
|
7641
7761
|
...normalizeParams(params)
|
|
7642
7762
|
});
|
|
7643
7763
|
}
|
|
7764
|
+
const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
|
|
7765
|
+
$ZodRecord.init(inst, def);
|
|
7766
|
+
ZodType.init(inst, def);
|
|
7767
|
+
inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
|
|
7768
|
+
inst.keyType = def.keyType;
|
|
7769
|
+
inst.valueType = def.valueType;
|
|
7770
|
+
});
|
|
7771
|
+
function record(keyType, valueType, params) {
|
|
7772
|
+
return new ZodRecord({
|
|
7773
|
+
type: "record",
|
|
7774
|
+
keyType,
|
|
7775
|
+
valueType,
|
|
7776
|
+
...normalizeParams(params)
|
|
7777
|
+
});
|
|
7778
|
+
}
|
|
7644
7779
|
const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
7645
7780
|
$ZodEnum.init(inst, def);
|
|
7646
7781
|
ZodType.init(inst, def);
|
|
@@ -7903,19 +8038,11 @@ var AuthValidationError = class extends Error {
|
|
|
7903
8038
|
this.name = "AuthValidationError";
|
|
7904
8039
|
}
|
|
7905
8040
|
};
|
|
7906
|
-
/**
|
|
7907
|
-
* Formats an API error response into a human-readable string.
|
|
7908
|
-
* Prefers `message` (human-readable) over `detail`.
|
|
7909
|
-
*/
|
|
7910
|
-
function formatApiError$1(errorJson) {
|
|
7911
|
-
const error = errorJson;
|
|
7912
|
-
const content = error?.message ?? error?.detail ?? errorJson;
|
|
7913
|
-
return typeof content === "string" ? content : JSON.stringify(content, null, 2);
|
|
7914
|
-
}
|
|
7915
8041
|
|
|
7916
8042
|
//#endregion
|
|
7917
8043
|
//#region src/core/consts.ts
|
|
7918
8044
|
const PROJECT_SUBDIR = "base44";
|
|
8045
|
+
const CONFIG_FILE_EXTENSION = "jsonc";
|
|
7919
8046
|
const CONFIG_FILE_EXTENSION_GLOB = "{json,jsonc}";
|
|
7920
8047
|
const FUNCTION_CONFIG_FILE = `function.${CONFIG_FILE_EXTENSION_GLOB}`;
|
|
7921
8048
|
const APP_CONFIG_PATTERN = `**/.app.${CONFIG_FILE_EXTENSION_GLOB}`;
|
|
@@ -16208,7 +16335,7 @@ const createIgnorePredicate = (patterns, cwd, baseDir) => {
|
|
|
16208
16335
|
};
|
|
16209
16336
|
const normalizeOptions$2 = (options = {}) => {
|
|
16210
16337
|
const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
|
|
16211
|
-
const cwd = toPath$1(options.cwd) ??
|
|
16338
|
+
const cwd = toPath$1(options.cwd) ?? process$1.cwd();
|
|
16212
16339
|
const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
|
|
16213
16340
|
return {
|
|
16214
16341
|
cwd,
|
|
@@ -16305,7 +16432,7 @@ const getDirectoryGlob = ({ directoryPath, files, extensions }) => {
|
|
|
16305
16432
|
const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
|
|
16306
16433
|
return files ? files.map((file) => path.posix.join(directoryPath, `**/${path.extname(file) ? file : `${file}${extensionGlob}`}`)) : [path.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
|
|
16307
16434
|
};
|
|
16308
|
-
const directoryToGlob = async (directoryPaths, { cwd =
|
|
16435
|
+
const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => {
|
|
16309
16436
|
return (await Promise.all(directoryPaths.map(async (directoryPath) => {
|
|
16310
16437
|
if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
|
|
16311
16438
|
directoryPath,
|
|
@@ -16319,7 +16446,7 @@ const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extension
|
|
|
16319
16446
|
}) : directoryPath;
|
|
16320
16447
|
}))).flat();
|
|
16321
16448
|
};
|
|
16322
|
-
const directoryToGlobSync = (directoryPaths, { cwd =
|
|
16449
|
+
const directoryToGlobSync = (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
|
|
16323
16450
|
if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
|
|
16324
16451
|
directoryPath,
|
|
16325
16452
|
files,
|
|
@@ -16415,7 +16542,7 @@ const applyIgnoreFilesAndGetFilterSync = (options) => {
|
|
|
16415
16542
|
};
|
|
16416
16543
|
const createFilterFunction = (isIgnored, cwd) => {
|
|
16417
16544
|
const seen = /* @__PURE__ */ new Set();
|
|
16418
|
-
const basePath = cwd ||
|
|
16545
|
+
const basePath = cwd || process$1.cwd();
|
|
16419
16546
|
const pathCache = /* @__PURE__ */ new Map();
|
|
16420
16547
|
return (fastGlobResult) => {
|
|
16421
16548
|
const pathKey$1 = path.normalize(fastGlobResult.path ?? fastGlobResult);
|
|
@@ -16550,9 +16677,7 @@ const SyncEntitiesResponseSchema = object({
|
|
|
16550
16677
|
//#region src/core/resources/entity/config.ts
|
|
16551
16678
|
async function readEntityFile(entityPath) {
|
|
16552
16679
|
const parsed = await readJsonFile(entityPath);
|
|
16553
|
-
|
|
16554
|
-
if (!result.success) throw new Error(`Invalid entity configuration in ${entityPath}: ${result.error.issues.map((e$1) => e$1.message).join(", ")}`);
|
|
16555
|
-
return result.data;
|
|
16680
|
+
return EntitySchema.parse(parsed);
|
|
16556
16681
|
}
|
|
16557
16682
|
async function readAllEntities(entitiesDir) {
|
|
16558
16683
|
if (!await pathExists(entitiesDir)) return [];
|
|
@@ -16566,7 +16691,7 @@ async function readAllEntities(entitiesDir) {
|
|
|
16566
16691
|
//#endregion
|
|
16567
16692
|
//#region src/core/resources/entity/api.ts
|
|
16568
16693
|
async function syncEntities(entities) {
|
|
16569
|
-
const appClient = getAppClient
|
|
16694
|
+
const appClient = getAppClient();
|
|
16570
16695
|
const schemaSyncPayload = Object.fromEntries(entities.map((entity) => [entity.name, entity]));
|
|
16571
16696
|
const response = await appClient.put("entity-schemas", {
|
|
16572
16697
|
json: { entityNameToSchema: schemaSyncPayload },
|
|
@@ -16574,8 +16699,8 @@ async function syncEntities(entities) {
|
|
|
16574
16699
|
});
|
|
16575
16700
|
if (!response.ok) {
|
|
16576
16701
|
const errorJson = await response.json();
|
|
16577
|
-
if (response.status === 428) throw new Error(`Failed to delete entity: ${formatApiError
|
|
16578
|
-
throw new Error(`Error occurred while syncing entities: ${formatApiError
|
|
16702
|
+
if (response.status === 428) throw new Error(`Failed to delete entity: ${formatApiError(errorJson)}`);
|
|
16703
|
+
throw new Error(`Error occurred while syncing entities: ${formatApiError(errorJson)}`);
|
|
16579
16704
|
}
|
|
16580
16705
|
return SyncEntitiesResponseSchema.parse(await response.json());
|
|
16581
16706
|
}
|
|
@@ -16663,7 +16788,7 @@ function toDeployPayloadItem(fn) {
|
|
|
16663
16788
|
};
|
|
16664
16789
|
}
|
|
16665
16790
|
async function deployFunctions(functions) {
|
|
16666
|
-
const appClient = getAppClient
|
|
16791
|
+
const appClient = getAppClient();
|
|
16667
16792
|
const payload = { functions: functions.map(toDeployPayloadItem) };
|
|
16668
16793
|
const response = await appClient.put("backend-functions", {
|
|
16669
16794
|
json: payload,
|
|
@@ -16699,51 +16824,26 @@ const functionResource = {
|
|
|
16699
16824
|
|
|
16700
16825
|
//#endregion
|
|
16701
16826
|
//#region src/core/resources/agent/schema.ts
|
|
16702
|
-
const
|
|
16703
|
-
entity_name: string().min(1),
|
|
16704
|
-
allowed_operations: array(_enum([
|
|
16705
|
-
"read",
|
|
16706
|
-
"create",
|
|
16707
|
-
"update",
|
|
16708
|
-
"delete"
|
|
16709
|
-
])).default([])
|
|
16710
|
-
});
|
|
16711
|
-
const BackendFunctionToolConfigSchema = object({
|
|
16712
|
-
function_name: string().min(1),
|
|
16713
|
-
description: string().default("agent backend function")
|
|
16714
|
-
});
|
|
16715
|
-
const ToolConfigSchema = union([EntityToolConfigSchema, BackendFunctionToolConfigSchema]);
|
|
16716
|
-
const AgentConfigSchema = object({
|
|
16717
|
-
name: string().regex(/^[a-z0-9_]+$/, "Agent name must be lowercase alphanumeric with underscores").min(1).max(100),
|
|
16718
|
-
description: string().min(1, "Agent description cannot be empty"),
|
|
16719
|
-
instructions: string().min(1, "Agent instructions cannot be empty"),
|
|
16720
|
-
tool_configs: array(ToolConfigSchema).default([]),
|
|
16721
|
-
whatsapp_greeting: string().nullable().optional()
|
|
16722
|
-
});
|
|
16827
|
+
const AgentConfigSchema = looseObject({ name: string().regex(/^[a-z0-9_]+$/, "Agent name must be lowercase alphanumeric with underscores").min(1).max(100) });
|
|
16723
16828
|
const SyncAgentsResponseSchema = object({
|
|
16724
16829
|
created: array(string()),
|
|
16725
16830
|
updated: array(string()),
|
|
16726
16831
|
deleted: array(string())
|
|
16727
16832
|
});
|
|
16728
|
-
const AgentConfigApiResponseSchema =
|
|
16729
|
-
name: string(),
|
|
16730
|
-
description: string(),
|
|
16731
|
-
instructions: string(),
|
|
16732
|
-
tool_configs: array(ToolConfigSchema).default([]),
|
|
16733
|
-
whatsapp_greeting: string().nullable().optional()
|
|
16734
|
-
});
|
|
16833
|
+
const AgentConfigApiResponseSchema = looseObject({ name: string() });
|
|
16735
16834
|
const ListAgentsResponseSchema = object({
|
|
16736
16835
|
items: array(AgentConfigApiResponseSchema),
|
|
16737
16836
|
total: number()
|
|
16738
|
-
})
|
|
16837
|
+
}).transform((data) => ({
|
|
16838
|
+
items: data.items,
|
|
16839
|
+
total: data.total
|
|
16840
|
+
}));
|
|
16739
16841
|
|
|
16740
16842
|
//#endregion
|
|
16741
16843
|
//#region src/core/resources/agent/config.ts
|
|
16742
16844
|
async function readAgentFile(agentPath) {
|
|
16743
16845
|
const parsed = await readJsonFile(agentPath);
|
|
16744
|
-
|
|
16745
|
-
if (!result.success) throw new Error(`Invalid agent configuration in ${agentPath}: ${result.error.issues.map((e$1) => e$1.message).join(", ")}`);
|
|
16746
|
-
return result.data;
|
|
16846
|
+
return AgentConfigSchema.parse(parsed);
|
|
16747
16847
|
}
|
|
16748
16848
|
async function readAllAgents(agentsDir) {
|
|
16749
16849
|
if (!await pathExists(agentsDir)) return [];
|
|
@@ -16759,20 +16859,29 @@ async function readAllAgents(agentsDir) {
|
|
|
16759
16859
|
}
|
|
16760
16860
|
return agents;
|
|
16761
16861
|
}
|
|
16862
|
+
async function writeAgents(agentsDir, remoteAgents) {
|
|
16863
|
+
const existingAgents = await readAllAgents(agentsDir);
|
|
16864
|
+
const newNames = new Set(remoteAgents.map((a$1) => a$1.name));
|
|
16865
|
+
const toDelete = existingAgents.filter((a$1) => !newNames.has(a$1.name));
|
|
16866
|
+
for (const agent of toDelete) {
|
|
16867
|
+
const files = await globby(`${agent.name}.${CONFIG_FILE_EXTENSION_GLOB}`, {
|
|
16868
|
+
cwd: agentsDir,
|
|
16869
|
+
absolute: true
|
|
16870
|
+
});
|
|
16871
|
+
for (const filePath of files) await deleteFile(filePath);
|
|
16872
|
+
}
|
|
16873
|
+
for (const agent of remoteAgents) await writeJsonFile(join(agentsDir, `${agent.name}.${CONFIG_FILE_EXTENSION}`), agent);
|
|
16874
|
+
return {
|
|
16875
|
+
written: remoteAgents.map((a$1) => a$1.name),
|
|
16876
|
+
deleted: toDelete.map((a$1) => a$1.name)
|
|
16877
|
+
};
|
|
16878
|
+
}
|
|
16762
16879
|
|
|
16763
16880
|
//#endregion
|
|
16764
16881
|
//#region src/core/resources/agent/api.ts
|
|
16765
|
-
async function pushAgents
|
|
16766
|
-
const
|
|
16767
|
-
|
|
16768
|
-
name: agent.name,
|
|
16769
|
-
description: agent.description,
|
|
16770
|
-
instructions: agent.instructions,
|
|
16771
|
-
tool_configs: agent.tool_configs,
|
|
16772
|
-
whatsapp_greeting: agent.whatsapp_greeting ?? null
|
|
16773
|
-
}));
|
|
16774
|
-
const response = await appClient.put("agent-configs", {
|
|
16775
|
-
json: payload,
|
|
16882
|
+
async function pushAgents(agents) {
|
|
16883
|
+
const response = await getAppClient().put("agent-configs", {
|
|
16884
|
+
json: agents,
|
|
16776
16885
|
throwHttpErrors: false
|
|
16777
16886
|
});
|
|
16778
16887
|
if (!response.ok) {
|
|
@@ -16781,12 +16890,20 @@ async function pushAgents$1(agents) {
|
|
|
16781
16890
|
}
|
|
16782
16891
|
return SyncAgentsResponseSchema.parse(await response.json());
|
|
16783
16892
|
}
|
|
16893
|
+
async function fetchAgents() {
|
|
16894
|
+
const response = await getAppClient().get("agent-configs", { throwHttpErrors: false });
|
|
16895
|
+
if (!response.ok) {
|
|
16896
|
+
const errorJson = await response.json();
|
|
16897
|
+
throw new Error(`Error occurred while fetching agents: ${formatApiError(errorJson)}`);
|
|
16898
|
+
}
|
|
16899
|
+
return ListAgentsResponseSchema.parse(await response.json());
|
|
16900
|
+
}
|
|
16784
16901
|
|
|
16785
16902
|
//#endregion
|
|
16786
16903
|
//#region src/core/resources/agent/resource.ts
|
|
16787
16904
|
const agentResource = {
|
|
16788
16905
|
readAll: readAllAgents,
|
|
16789
|
-
push: pushAgents
|
|
16906
|
+
push: pushAgents
|
|
16790
16907
|
};
|
|
16791
16908
|
|
|
16792
16909
|
//#endregion
|
|
@@ -16866,7 +16983,7 @@ async function findProjectRoot(startPath) {
|
|
|
16866
16983
|
* @example
|
|
16867
16984
|
* const { project, entities, functions } = await readProjectConfig();
|
|
16868
16985
|
*/
|
|
16869
|
-
async function readProjectConfig
|
|
16986
|
+
async function readProjectConfig(projectRoot) {
|
|
16870
16987
|
let found;
|
|
16871
16988
|
if (projectRoot) {
|
|
16872
16989
|
const configPath$1 = await findConfigInDir(projectRoot);
|
|
@@ -25523,7 +25640,7 @@ async function uploadSite(archivePath) {
|
|
|
25523
25640
|
const blob = new Blob([archiveBuffer], { type: "application/gzip" });
|
|
25524
25641
|
const formData = new FormData();
|
|
25525
25642
|
formData.append("file", blob, "dist.tar.gz");
|
|
25526
|
-
const response = await getAppClient
|
|
25643
|
+
const response = await getAppClient().post("deploy-dist", { body: formData });
|
|
25527
25644
|
return DeployResponseSchema.parse(await response.json());
|
|
25528
25645
|
}
|
|
25529
25646
|
|
|
@@ -30580,6 +30697,11 @@ async function readAppConfig(projectRoot) {
|
|
|
30580
30697
|
* Authenticated HTTP client for Base44 API.
|
|
30581
30698
|
* Automatically handles token refresh and retry on 401 responses.
|
|
30582
30699
|
*/
|
|
30700
|
+
function formatApiError(errorJson) {
|
|
30701
|
+
const error = errorJson;
|
|
30702
|
+
const content = error?.message ?? error?.detail ?? errorJson;
|
|
30703
|
+
return typeof content === "string" ? content : JSON.stringify(content, null, 2);
|
|
30704
|
+
}
|
|
30583
30705
|
const retriedRequests = /* @__PURE__ */ new WeakSet();
|
|
30584
30706
|
/**
|
|
30585
30707
|
* Handles 401 responses by refreshing the token and retrying the request.
|
|
@@ -30628,11 +30750,24 @@ const base44Client = distribution_default.create({
|
|
|
30628
30750
|
* const appClient = getAppClient();
|
|
30629
30751
|
* const response = await appClient.get("entities");
|
|
30630
30752
|
*/
|
|
30631
|
-
function getAppClient
|
|
30753
|
+
function getAppClient() {
|
|
30632
30754
|
const { id } = getAppConfig();
|
|
30633
30755
|
return base44Client.extend({ prefixUrl: new URL(`/api/apps/${id}/`, getBase44ApiUrl()).href });
|
|
30634
30756
|
}
|
|
30635
30757
|
|
|
30758
|
+
//#endregion
|
|
30759
|
+
//#region src/core/clients/schemas.ts
|
|
30760
|
+
const ApiErrorSchema = object({
|
|
30761
|
+
error_type: string().optional(),
|
|
30762
|
+
message: union([string(), record(string(), unknown())]).optional(),
|
|
30763
|
+
detail: union([
|
|
30764
|
+
string(),
|
|
30765
|
+
record(string(), unknown()),
|
|
30766
|
+
array(unknown())
|
|
30767
|
+
]).optional(),
|
|
30768
|
+
traceback: string().optional()
|
|
30769
|
+
});
|
|
30770
|
+
|
|
30636
30771
|
//#endregion
|
|
30637
30772
|
//#region src/core/auth/api.ts
|
|
30638
30773
|
async function generateDeviceCode() {
|
|
@@ -30882,13 +31017,13 @@ var ansi_styles_default = ansiStyles;
|
|
|
30882
31017
|
|
|
30883
31018
|
//#endregion
|
|
30884
31019
|
//#region node_modules/chalk/source/vendor/supports-color/index.js
|
|
30885
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
31020
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$1.argv) {
|
|
30886
31021
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
30887
31022
|
const position = argv.indexOf(prefix + flag);
|
|
30888
31023
|
const terminatorPosition = argv.indexOf("--");
|
|
30889
31024
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
30890
31025
|
}
|
|
30891
|
-
const { env } =
|
|
31026
|
+
const { env } = process$1;
|
|
30892
31027
|
let flagForceColor;
|
|
30893
31028
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
30894
31029
|
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
@@ -30921,7 +31056,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
30921
31056
|
if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
|
|
30922
31057
|
const min = forceColor || 0;
|
|
30923
31058
|
if (env.TERM === "dumb") return min;
|
|
30924
|
-
if (
|
|
31059
|
+
if (process$1.platform === "win32") {
|
|
30925
31060
|
const osRelease = os.release().split(".");
|
|
30926
31061
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
30927
31062
|
return 1;
|
|
@@ -31448,7 +31583,7 @@ const logoutCommand = new Command("logout").description("Logout from current dev
|
|
|
31448
31583
|
//#endregion
|
|
31449
31584
|
//#region src/cli/commands/entities/push.ts
|
|
31450
31585
|
async function pushEntitiesAction() {
|
|
31451
|
-
const { entities } = await readProjectConfig
|
|
31586
|
+
const { entities } = await readProjectConfig();
|
|
31452
31587
|
if (entities.length === 0) return { outroMessage: "No entities found in project" };
|
|
31453
31588
|
M.info(`Found ${entities.length} entities to push`);
|
|
31454
31589
|
const result = await runTask("Pushing entities to Base44", async () => {
|
|
@@ -31460,62 +31595,66 @@ async function pushEntitiesAction() {
|
|
|
31460
31595
|
if (result.created.length > 0) M.success(`Created: ${result.created.join(", ")}`);
|
|
31461
31596
|
if (result.updated.length > 0) M.success(`Updated: ${result.updated.join(", ")}`);
|
|
31462
31597
|
if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
|
|
31463
|
-
return {};
|
|
31598
|
+
return { outroMessage: "Entities pushed to Base44" };
|
|
31464
31599
|
}
|
|
31465
31600
|
const entitiesPushCommand = new Command("entities").description("Manage project entities").addCommand(new Command("push").description("Push local entities to Base44").action(async () => {
|
|
31466
31601
|
await runCommand(pushEntitiesAction, { requireAuth: true });
|
|
31467
31602
|
}));
|
|
31468
31603
|
|
|
31604
|
+
//#endregion
|
|
31605
|
+
//#region src/cli/commands/agents/push.ts
|
|
31606
|
+
async function pushAgentsAction() {
|
|
31607
|
+
const { agents } = await readProjectConfig();
|
|
31608
|
+
M.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
|
|
31609
|
+
const result = await runTask("Pushing agents to Base44", async () => {
|
|
31610
|
+
return await pushAgents(agents);
|
|
31611
|
+
}, {
|
|
31612
|
+
successMessage: "Agents pushed successfully",
|
|
31613
|
+
errorMessage: "Failed to push agents"
|
|
31614
|
+
});
|
|
31615
|
+
if (result.created.length > 0) M.success(`Created: ${result.created.join(", ")}`);
|
|
31616
|
+
if (result.updated.length > 0) M.success(`Updated: ${result.updated.join(", ")}`);
|
|
31617
|
+
if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
|
|
31618
|
+
return { outroMessage: "Agents pushed to Base44" };
|
|
31619
|
+
}
|
|
31620
|
+
const agentsPushCommand = new Command("push").description("Push local agents to Base44 (replaces all remote agent configs)").action(async () => {
|
|
31621
|
+
await runCommand(pushAgentsAction, { requireAuth: true });
|
|
31622
|
+
});
|
|
31623
|
+
|
|
31469
31624
|
//#endregion
|
|
31470
31625
|
//#region src/cli/commands/agents/pull.ts
|
|
31471
31626
|
async function pullAgentsAction() {
|
|
31472
31627
|
const { project } = await readProjectConfig();
|
|
31473
31628
|
const agentsDir = join(dirname(project.configPath), project.agentsDir);
|
|
31474
|
-
const
|
|
31629
|
+
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
31475
31630
|
return await fetchAgents();
|
|
31476
31631
|
}, {
|
|
31477
31632
|
successMessage: "Agents fetched successfully",
|
|
31478
31633
|
errorMessage: "Failed to fetch agents"
|
|
31479
31634
|
});
|
|
31480
|
-
if (
|
|
31635
|
+
if (remoteAgents.items.length === 0) return { outroMessage: "No agents found on Base44" };
|
|
31481
31636
|
const { written, deleted } = await runTask("Writing agent files", async () => {
|
|
31482
|
-
return await writeAgents(agentsDir,
|
|
31637
|
+
return await writeAgents(agentsDir, remoteAgents.items);
|
|
31483
31638
|
}, {
|
|
31484
31639
|
successMessage: "Agent files written successfully",
|
|
31485
31640
|
errorMessage: "Failed to write agent files"
|
|
31486
31641
|
});
|
|
31487
31642
|
if (written.length > 0) M.success(`Written: ${written.join(", ")}`);
|
|
31488
31643
|
if (deleted.length > 0) M.warn(`Deleted: ${deleted.join(", ")}`);
|
|
31489
|
-
return { outroMessage: `Pulled ${
|
|
31644
|
+
return { outroMessage: `Pulled ${remoteAgents.total} agents to ${agentsDir}` };
|
|
31490
31645
|
}
|
|
31491
31646
|
const agentsPullCommand = new Command("pull").description("Pull agents from Base44 to local files (replaces all local agent configs)").action(async () => {
|
|
31492
31647
|
await runCommand(pullAgentsAction, { requireAuth: true });
|
|
31493
31648
|
});
|
|
31494
31649
|
|
|
31495
31650
|
//#endregion
|
|
31496
|
-
//#region src/cli/commands/agents/
|
|
31497
|
-
|
|
31498
|
-
const { agents } = await readProjectConfig();
|
|
31499
|
-
M.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
|
|
31500
|
-
const result = await runTask("Pushing agents to Base44", async () => {
|
|
31501
|
-
return await pushAgents(agents);
|
|
31502
|
-
}, {
|
|
31503
|
-
successMessage: "Agents pushed successfully",
|
|
31504
|
-
errorMessage: "Failed to push agents"
|
|
31505
|
-
});
|
|
31506
|
-
if (result.created.length > 0) M.success(`Created: ${result.created.join(", ")}`);
|
|
31507
|
-
if (result.updated.length > 0) M.success(`Updated: ${result.updated.join(", ")}`);
|
|
31508
|
-
if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
|
|
31509
|
-
return {};
|
|
31510
|
-
}
|
|
31511
|
-
const agentsCommand = new Command("agents").description("Manage project agents").addCommand(new Command("push").description("Push local agents to Base44 (replaces all remote agent configs)").action(async () => {
|
|
31512
|
-
await runCommand(pushAgentsAction, { requireAuth: true });
|
|
31513
|
-
})).addCommand(agentsPullCommand);
|
|
31651
|
+
//#region src/cli/commands/agents/index.ts
|
|
31652
|
+
const agentsCommand = new Command("agents").description("Manage project agents").addCommand(agentsPushCommand).addCommand(agentsPullCommand);
|
|
31514
31653
|
|
|
31515
31654
|
//#endregion
|
|
31516
31655
|
//#region src/cli/commands/functions/deploy.ts
|
|
31517
31656
|
async function deployFunctionsAction() {
|
|
31518
|
-
const { functions } = await readProjectConfig
|
|
31657
|
+
const { functions } = await readProjectConfig();
|
|
31519
31658
|
if (functions.length === 0) return { outroMessage: "No functions found. Create functions in the 'functions' directory." };
|
|
31520
31659
|
M.info(`Found ${functions.length} ${functions.length === 1 ? "function" : "functions"} to deploy`);
|
|
31521
31660
|
const result = await runTask("Deploying functions to Base44", async () => {
|
|
@@ -31530,7 +31669,7 @@ async function deployFunctionsAction() {
|
|
|
31530
31669
|
const errorMessages = result.errors.map((e$1) => `'${e$1.name}' function: ${e$1.message}`).join("\n");
|
|
31531
31670
|
throw new Error(`Function deployment errors:\n${errorMessages}`);
|
|
31532
31671
|
}
|
|
31533
|
-
return {};
|
|
31672
|
+
return { outroMessage: "Functions deployed to Base44" };
|
|
31534
31673
|
}
|
|
31535
31674
|
const functionsDeployCommand = new Command("functions").description("Manage project functions").addCommand(new Command("deploy").description("Deploy local functions to Base44").action(async () => {
|
|
31536
31675
|
await runCommand(deployFunctionsAction, { requireAuth: true });
|
|
@@ -31706,9 +31845,9 @@ const getSubprocessResult = ({ stdout: stdout$1 }) => {
|
|
|
31706
31845
|
//#region node_modules/execa/lib/utils/standard-stream.js
|
|
31707
31846
|
const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
|
|
31708
31847
|
const STANDARD_STREAMS = [
|
|
31709
|
-
|
|
31710
|
-
|
|
31711
|
-
|
|
31848
|
+
process$1.stdin,
|
|
31849
|
+
process$1.stdout,
|
|
31850
|
+
process$1.stderr
|
|
31712
31851
|
];
|
|
31713
31852
|
const STANDARD_STREAMS_ALIASES = [
|
|
31714
31853
|
"stdin",
|
|
@@ -31833,9 +31972,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
|
31833
31972
|
//#endregion
|
|
31834
31973
|
//#region node_modules/is-unicode-supported/index.js
|
|
31835
31974
|
function isUnicodeSupported() {
|
|
31836
|
-
const { env: env$1 } =
|
|
31975
|
+
const { env: env$1 } = process$1;
|
|
31837
31976
|
const { TERM, TERM_PROGRAM } = env$1;
|
|
31838
|
-
if (
|
|
31977
|
+
if (process$1.platform !== "win32") return TERM !== "linux";
|
|
31839
31978
|
return Boolean(env$1.WT_SESSION) || Boolean(env$1.TERMINUS_SUBLIME) || env$1.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env$1.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
31840
31979
|
}
|
|
31841
31980
|
|
|
@@ -32762,7 +32901,7 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
|
32762
32901
|
|
|
32763
32902
|
//#endregion
|
|
32764
32903
|
//#region node_modules/npm-run-path/index.js
|
|
32765
|
-
const npmRunPath = ({ cwd =
|
|
32904
|
+
const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath: execPath$1 = process$1.execPath, addExecPath = true } = {}) => {
|
|
32766
32905
|
const cwdPath = path.resolve(toPath(cwd));
|
|
32767
32906
|
const result = [];
|
|
32768
32907
|
const pathParts = pathOption.split(path.delimiter);
|
|
@@ -32780,7 +32919,7 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
|
|
|
32780
32919
|
const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
|
|
32781
32920
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
32782
32921
|
};
|
|
32783
|
-
const npmRunPathEnv = ({ env: env$1 =
|
|
32922
|
+
const npmRunPathEnv = ({ env: env$1 = process$1.env, ...options } = {}) => {
|
|
32784
32923
|
env$1 = { ...env$1 };
|
|
32785
32924
|
const pathName = pathKey({ env: env$1 });
|
|
32786
32925
|
options.path = env$1[pathName];
|
|
@@ -33915,7 +34054,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
|
33915
34054
|
};
|
|
33916
34055
|
const getDefaultCwd = () => {
|
|
33917
34056
|
try {
|
|
33918
|
-
return
|
|
34057
|
+
return process$1.cwd();
|
|
33919
34058
|
} catch (error) {
|
|
33920
34059
|
error.message = `The current directory does not exist.\n${error.message}`;
|
|
33921
34060
|
throw error;
|
|
@@ -33950,7 +34089,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
33950
34089
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
33951
34090
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
33952
34091
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
33953
|
-
if (
|
|
34092
|
+
if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
33954
34093
|
return {
|
|
33955
34094
|
file,
|
|
33956
34095
|
commandArguments,
|
|
@@ -33977,7 +34116,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
|
|
|
33977
34116
|
});
|
|
33978
34117
|
const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
|
|
33979
34118
|
const env$1 = extendEnv ? {
|
|
33980
|
-
...
|
|
34119
|
+
...process$1.env,
|
|
33981
34120
|
...envOption
|
|
33982
34121
|
} : envOption;
|
|
33983
34122
|
if (preferLocal || node) return npmRunPathEnv({
|
|
@@ -34977,12 +35116,12 @@ const guessStreamDirection = {
|
|
|
34977
35116
|
}
|
|
34978
35117
|
};
|
|
34979
35118
|
const getStandardStreamDirection = (value) => {
|
|
34980
|
-
if ([0,
|
|
35119
|
+
if ([0, process$1.stdin].includes(value)) return "input";
|
|
34981
35120
|
if ([
|
|
34982
35121
|
1,
|
|
34983
35122
|
2,
|
|
34984
|
-
|
|
34985
|
-
|
|
35123
|
+
process$1.stdout,
|
|
35124
|
+
process$1.stderr
|
|
34986
35125
|
].includes(value)) return "output";
|
|
34987
35126
|
};
|
|
34988
35127
|
const DEFAULT_DIRECTION = "output";
|
|
@@ -36046,9 +36185,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
|
|
|
36046
36185
|
Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
|
|
36047
36186
|
};
|
|
36048
36187
|
const getIpcExport = () => {
|
|
36049
|
-
const anyProcess =
|
|
36188
|
+
const anyProcess = process$1;
|
|
36050
36189
|
const isSubprocess = true;
|
|
36051
|
-
const ipc =
|
|
36190
|
+
const ipc = process$1.channel !== void 0;
|
|
36052
36191
|
return {
|
|
36053
36192
|
...getIpcMethods(anyProcess, isSubprocess, ipc),
|
|
36054
36193
|
getCancelSignal: getCancelSignal$1.bind(void 0, {
|
|
@@ -36290,7 +36429,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
|
|
|
36290
36429
|
|
|
36291
36430
|
//#endregion
|
|
36292
36431
|
//#region node_modules/signal-exit/dist/mjs/index.js
|
|
36293
|
-
const processOk = (process$
|
|
36432
|
+
const processOk = (process$5) => !!process$5 && typeof process$5 === "object" && typeof process$5.removeListener === "function" && typeof process$5.emit === "function" && typeof process$5.reallyExit === "function" && typeof process$5.listeners === "function" && typeof process$5.kill === "function" && typeof process$5.pid === "number" && typeof process$5.on === "function";
|
|
36294
36433
|
const kExitEmitter = Symbol.for("signal-exit emitter");
|
|
36295
36434
|
const global$1 = globalThis;
|
|
36296
36435
|
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
@@ -36358,7 +36497,7 @@ var SignalExitFallback = class extends SignalExitBase {
|
|
|
36358
36497
|
};
|
|
36359
36498
|
var SignalExit = class extends SignalExitBase {
|
|
36360
36499
|
/* c8 ignore start */
|
|
36361
|
-
#hupSig = process$
|
|
36500
|
+
#hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
36362
36501
|
/* c8 ignore stop */
|
|
36363
36502
|
#emitter = new Emitter();
|
|
36364
36503
|
#process;
|
|
@@ -36366,15 +36505,15 @@ var SignalExit = class extends SignalExitBase {
|
|
|
36366
36505
|
#originalProcessReallyExit;
|
|
36367
36506
|
#sigListeners = {};
|
|
36368
36507
|
#loaded = false;
|
|
36369
|
-
constructor(process$
|
|
36508
|
+
constructor(process$5) {
|
|
36370
36509
|
super();
|
|
36371
|
-
this.#process = process$
|
|
36510
|
+
this.#process = process$5;
|
|
36372
36511
|
this.#sigListeners = {};
|
|
36373
36512
|
for (const sig of signals) this.#sigListeners[sig] = () => {
|
|
36374
36513
|
const listeners = this.#process.listeners(sig);
|
|
36375
36514
|
let { count: count$1 } = this.#emitter;
|
|
36376
36515
|
/* c8 ignore start */
|
|
36377
|
-
const p$1 = process$
|
|
36516
|
+
const p$1 = process$5;
|
|
36378
36517
|
if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
|
|
36379
36518
|
/* c8 ignore stop */
|
|
36380
36519
|
if (listeners.length === count$1) {
|
|
@@ -36382,11 +36521,11 @@ var SignalExit = class extends SignalExitBase {
|
|
|
36382
36521
|
const ret = this.#emitter.emit("exit", null, sig);
|
|
36383
36522
|
/* c8 ignore start */
|
|
36384
36523
|
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
36385
|
-
if (!ret) process$
|
|
36524
|
+
if (!ret) process$5.kill(process$5.pid, s);
|
|
36386
36525
|
}
|
|
36387
36526
|
};
|
|
36388
|
-
this.#originalProcessReallyExit = process$
|
|
36389
|
-
this.#originalProcessEmit = process$
|
|
36527
|
+
this.#originalProcessReallyExit = process$5.reallyExit;
|
|
36528
|
+
this.#originalProcessEmit = process$5.emit;
|
|
36390
36529
|
}
|
|
36391
36530
|
onExit(cb, opts) {
|
|
36392
36531
|
/* c8 ignore start */
|
|
@@ -36453,8 +36592,8 @@ var SignalExit = class extends SignalExitBase {
|
|
|
36453
36592
|
} else return og.call(this.#process, ev, ...args);
|
|
36454
36593
|
}
|
|
36455
36594
|
};
|
|
36456
|
-
const process$
|
|
36457
|
-
const { onExit, load, unload } = signalExitWrap(processOk(process$
|
|
36595
|
+
const process$2 = globalThis.process;
|
|
36596
|
+
const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
|
|
36458
36597
|
|
|
36459
36598
|
//#endregion
|
|
36460
36599
|
//#region node_modules/execa/lib/terminate/cleanup.js
|
|
@@ -38296,7 +38435,7 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38296
38435
|
id: projectId,
|
|
38297
38436
|
projectRoot: resolvedPath
|
|
38298
38437
|
});
|
|
38299
|
-
const { project, entities } = await readProjectConfig
|
|
38438
|
+
const { project, entities } = await readProjectConfig(resolvedPath);
|
|
38300
38439
|
let finalAppUrl;
|
|
38301
38440
|
if (entities.length > 0) {
|
|
38302
38441
|
let shouldPushEntities;
|
|
@@ -38408,7 +38547,7 @@ function isInsideContainer() {
|
|
|
38408
38547
|
//#endregion
|
|
38409
38548
|
//#region node_modules/is-wsl/index.js
|
|
38410
38549
|
const isWsl = () => {
|
|
38411
|
-
if (
|
|
38550
|
+
if (process$1.platform !== "linux") return false;
|
|
38412
38551
|
if (os.release().toLowerCase().includes("microsoft")) {
|
|
38413
38552
|
if (isInsideContainer()) return false;
|
|
38414
38553
|
return true;
|
|
@@ -38419,12 +38558,12 @@ const isWsl = () => {
|
|
|
38419
38558
|
return false;
|
|
38420
38559
|
}
|
|
38421
38560
|
};
|
|
38422
|
-
var is_wsl_default =
|
|
38561
|
+
var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
38423
38562
|
|
|
38424
38563
|
//#endregion
|
|
38425
38564
|
//#region node_modules/powershell-utils/index.js
|
|
38426
38565
|
const execFile$2 = promisify(childProcess.execFile);
|
|
38427
|
-
const powerShellPath$1 = () => `${
|
|
38566
|
+
const powerShellPath$1 = () => `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
38428
38567
|
const executePowerShell = async (command, options = {}) => {
|
|
38429
38568
|
const { powerShellPath: psPath, ...execFileOptions } = options;
|
|
38430
38569
|
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
@@ -38535,7 +38674,7 @@ function defineLazyProperty(object$1, propertyName, valueGetter) {
|
|
|
38535
38674
|
//#region node_modules/default-browser-id/index.js
|
|
38536
38675
|
const execFileAsync$3 = promisify(execFile);
|
|
38537
38676
|
async function defaultBrowserId() {
|
|
38538
|
-
if (
|
|
38677
|
+
if (process$1.platform !== "darwin") throw new Error("macOS only");
|
|
38539
38678
|
const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
|
|
38540
38679
|
"read",
|
|
38541
38680
|
"com.apple.LaunchServices/com.apple.launchservices.secure",
|
|
@@ -38550,7 +38689,7 @@ async function defaultBrowserId() {
|
|
|
38550
38689
|
//#region node_modules/run-applescript/index.js
|
|
38551
38690
|
const execFileAsync$2 = promisify(execFile);
|
|
38552
38691
|
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
38553
|
-
if (
|
|
38692
|
+
if (process$1.platform !== "darwin") throw new Error("macOS only");
|
|
38554
38693
|
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
38555
38694
|
const execOptions = {};
|
|
38556
38695
|
if (signal) execOptions.signal = signal;
|
|
@@ -38659,14 +38798,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
|
|
|
38659
38798
|
const execFileAsync = promisify(execFile);
|
|
38660
38799
|
const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
|
|
38661
38800
|
async function defaultBrowser() {
|
|
38662
|
-
if (
|
|
38801
|
+
if (process$1.platform === "darwin") {
|
|
38663
38802
|
const id = await defaultBrowserId();
|
|
38664
38803
|
return {
|
|
38665
38804
|
name: await bundleName(id),
|
|
38666
38805
|
id
|
|
38667
38806
|
};
|
|
38668
38807
|
}
|
|
38669
|
-
if (
|
|
38808
|
+
if (process$1.platform === "linux") {
|
|
38670
38809
|
const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
|
|
38671
38810
|
"query",
|
|
38672
38811
|
"default",
|
|
@@ -38678,13 +38817,13 @@ async function defaultBrowser() {
|
|
|
38678
38817
|
id
|
|
38679
38818
|
};
|
|
38680
38819
|
}
|
|
38681
|
-
if (
|
|
38820
|
+
if (process$1.platform === "win32") return defaultBrowser$1();
|
|
38682
38821
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
38683
38822
|
}
|
|
38684
38823
|
|
|
38685
38824
|
//#endregion
|
|
38686
38825
|
//#region node_modules/is-in-ssh/index.js
|
|
38687
|
-
const isInSsh = Boolean(
|
|
38826
|
+
const isInSsh = Boolean(process$1.env.SSH_CONNECTION || process$1.env.SSH_CLIENT || process$1.env.SSH_TTY);
|
|
38688
38827
|
var is_in_ssh_default = isInSsh;
|
|
38689
38828
|
|
|
38690
38829
|
//#endregion
|
|
@@ -38692,7 +38831,7 @@ var is_in_ssh_default = isInSsh;
|
|
|
38692
38831
|
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
38693
38832
|
const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
38694
38833
|
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
38695
|
-
const { platform: platform$1, arch } =
|
|
38834
|
+
const { platform: platform$1, arch } = process$1;
|
|
38696
38835
|
const tryEachApp = async (apps$1, opener) => {
|
|
38697
38836
|
if (apps$1.length === 0) return;
|
|
38698
38837
|
const errors = [];
|
|
@@ -38805,7 +38944,7 @@ const baseOpen = async (options) => {
|
|
|
38805
38944
|
await fs$1.access(localXdgOpenPath, constants$1.X_OK);
|
|
38806
38945
|
exeLocalXdgOpen = true;
|
|
38807
38946
|
} catch {}
|
|
38808
|
-
command =
|
|
38947
|
+
command = process$1.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
|
|
38809
38948
|
}
|
|
38810
38949
|
if (appArguments.length > 0) cliArguments.push(...appArguments);
|
|
38811
38950
|
if (!options.wait) {
|
|
@@ -38919,7 +39058,7 @@ const dashboardCommand = new Command("dashboard").description("Open the app dash
|
|
|
38919
39058
|
//#endregion
|
|
38920
39059
|
//#region src/cli/commands/project/deploy.ts
|
|
38921
39060
|
async function deployAction$1(options) {
|
|
38922
|
-
const projectData = await readProjectConfig
|
|
39061
|
+
const projectData = await readProjectConfig();
|
|
38923
39062
|
if (!hasResourcesToDeploy(projectData)) return { outroMessage: "No resources found to deploy" };
|
|
38924
39063
|
const { project, entities, functions } = projectData;
|
|
38925
39064
|
const summaryLines = [];
|
|
@@ -39068,7 +39207,7 @@ const linkCommand = new Command("link").description("Link a local project to a B
|
|
|
39068
39207
|
//#endregion
|
|
39069
39208
|
//#region src/cli/commands/site/deploy.ts
|
|
39070
39209
|
async function deployAction(options) {
|
|
39071
|
-
const { project } = await readProjectConfig
|
|
39210
|
+
const { project } = await readProjectConfig();
|
|
39072
39211
|
if (!project.site?.outputDirectory) throw new Error("No site configuration found. Please add 'site.outputDirectory' to your config.jsonc");
|
|
39073
39212
|
const outputDir = resolve(project.root, project.site.outputDirectory);
|
|
39074
39213
|
if (!options.yes) {
|