@base44-preview/cli 0.1.32-pr.666.eab827b → 0.1.33-pr.643.05768bf
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 +720 -660
- package/dist/cli/index.js.map +19 -22
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -31177,7 +31177,7 @@ function cleanDoc(doc) {
|
|
|
31177
31177
|
return mapDoc(doc, (currentDoc) => cleanDocFn(currentDoc));
|
|
31178
31178
|
}
|
|
31179
31179
|
function replaceEndOfLine(doc, replacement = literalline) {
|
|
31180
|
-
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ?
|
|
31180
|
+
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ? join31(replacement, currentDoc.split(`
|
|
31181
31181
|
`)) : currentDoc);
|
|
31182
31182
|
}
|
|
31183
31183
|
function canBreakFn(doc) {
|
|
@@ -31257,7 +31257,7 @@ function indentIfBreak(contents, options) {
|
|
|
31257
31257
|
negate: options.negate
|
|
31258
31258
|
};
|
|
31259
31259
|
}
|
|
31260
|
-
function
|
|
31260
|
+
function join31(separator, docs) {
|
|
31261
31261
|
assertDoc(separator);
|
|
31262
31262
|
assertDocArray(docs);
|
|
31263
31263
|
const parts = [];
|
|
@@ -31968,7 +31968,7 @@ var init_doc = __esm(() => {
|
|
|
31968
31968
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
31969
31969
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
31970
31970
|
builders = {
|
|
31971
|
-
join:
|
|
31971
|
+
join: join31,
|
|
31972
31972
|
line,
|
|
31973
31973
|
softline,
|
|
31974
31974
|
hardline,
|
|
@@ -37919,9 +37919,9 @@ function zt3(e, t) {
|
|
|
37919
37919
|
return e.map(() => Pc(e, t), "expressions");
|
|
37920
37920
|
}
|
|
37921
37921
|
function tn2(e, t) {
|
|
37922
|
-
return ft3(e, (r) => typeof r == "string" ? t ? W4(0, r, /(\\*)`/gu, "$1$1\\`") :
|
|
37922
|
+
return ft3(e, (r) => typeof r == "string" ? t ? W4(0, r, /(\\*)`/gu, "$1$1\\`") : ms2(r) : r);
|
|
37923
37923
|
}
|
|
37924
|
-
function
|
|
37924
|
+
function ms2(e) {
|
|
37925
37925
|
return W4(0, e, /([\\`]|\$\{)/gu, "\\$1");
|
|
37926
37926
|
}
|
|
37927
37927
|
function kc({ node: e, parent: t }) {
|
|
@@ -38021,7 +38021,7 @@ async function mo(e, t, r, n, s) {
|
|
|
38021
38021
|
for (let S = 0;S < g.length; S++) {
|
|
38022
38022
|
let j = g[S];
|
|
38023
38023
|
if (S % 2 === 0) {
|
|
38024
|
-
j && (j =
|
|
38024
|
+
j && (j = ms2(j), s.__embeddedInHtml && (j = W4(0, j, /<\/(?=script\b)/giu, "<\\/")), h.push(j));
|
|
38025
38025
|
continue;
|
|
38026
38026
|
}
|
|
38027
38027
|
let U = Number(j);
|
|
@@ -41615,7 +41615,7 @@ function ds2(e) {
|
|
|
41615
41615
|
function qt2(e) {
|
|
41616
41616
|
return Ut3(e) || e === 95;
|
|
41617
41617
|
}
|
|
41618
|
-
function
|
|
41618
|
+
function ms3(e) {
|
|
41619
41619
|
return qt2(e) || Ee3(e);
|
|
41620
41620
|
}
|
|
41621
41621
|
function xs3(e) {
|
|
@@ -44055,7 +44055,7 @@ var init_acorn = __esm(() => {
|
|
|
44055
44055
|
};
|
|
44056
44056
|
f2.regexp_eatUnicodePropertyValue = function(e) {
|
|
44057
44057
|
var t = 0;
|
|
44058
|
-
for (e.lastStringValue = "";
|
|
44058
|
+
for (e.lastStringValue = "";ms3(t = e.current()); )
|
|
44059
44059
|
e.lastStringValue += q5(t), e.advance();
|
|
44060
44060
|
return e.lastStringValue !== "";
|
|
44061
44061
|
};
|
|
@@ -45348,7 +45348,7 @@ var Ci4, _i4, Ti4, an3 = (t) => {
|
|
|
45348
45348
|
toString() {
|
|
45349
45349
|
return this.start.file.content.substring(this.start.offset, this.end.offset);
|
|
45350
45350
|
}
|
|
45351
|
-
}, qe3, Ce5, Rn2, $n2, Dn2, Yi4 = "(:(where|is)\\()?",
|
|
45351
|
+
}, qe3, Ce5, Rn2, $n2, Dn2, Yi4 = "(:(where|is)\\()?", ms4 = "-shadowcsshost", Qi4 = "-shadowcsscontext", Bt3 = "[^)(]*", Ki4, Zi4, zt4, Yr3, Qr3, er4, Kr2, tr4, Zr2, gs3 = "%COMMENT%", eo3, to3, nr4 = "%COMMA_IN_PLACEHOLDER%", sr4 = "%SEMI_IN_PLACEHOLDER%", ir4 = "%COLON_IN_PLACEHOLDER%", no3, so3, io3, f3, ie3, Bn2, On2, Fn2, M5, Vn2, Un2, Hn3, Wn2, R5, qn3, jn2, rr4, vs4, Te4, Gt4, ro3, oo3, ao3, je4 = class {
|
|
45352
45352
|
strings;
|
|
45353
45353
|
expressions;
|
|
45354
45354
|
i18nPlaceholders;
|
|
@@ -47437,10 +47437,10 @@ var init_angular = __esm(() => {
|
|
|
47437
47437
|
Zi4 = `(?:\\(${Ki4}\\)|${Bt3})+?`;
|
|
47438
47438
|
zt4 = `(?:\\((${Zi4})\\))`;
|
|
47439
47439
|
Yr3 = new RegExp("(:nth-[-\\w]+)" + zt4, "g");
|
|
47440
|
-
Qr3 = new RegExp(
|
|
47440
|
+
Qr3 = new RegExp(ms4 + zt4 + "?([^,{]*)", "gim");
|
|
47441
47441
|
er4 = Qi4 + zt4 + "?([^{]*)";
|
|
47442
47442
|
Kr2 = new RegExp(`${Yi4}(${er4})`, "gim");
|
|
47443
|
-
tr4 =
|
|
47443
|
+
tr4 = ms4 + "-no-combinator";
|
|
47444
47444
|
Zr2 = new RegExp(`${tr4}(?![^(]*\\))`, "g");
|
|
47445
47445
|
eo3 = new RegExp(gs3, "g");
|
|
47446
47446
|
to3 = new RegExp(`(\\s*(?:${gs3}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`, "g");
|
|
@@ -48644,7 +48644,7 @@ function qr3(a, t) {
|
|
|
48644
48644
|
return true;
|
|
48645
48645
|
let e = ve6(a);
|
|
48646
48646
|
e && (a = a.slice(e.length));
|
|
48647
|
-
let s =
|
|
48647
|
+
let s = ms5(a, 0);
|
|
48648
48648
|
return s !== false && (a = a.slice(0, s)), zr3.test(a);
|
|
48649
48649
|
}
|
|
48650
48650
|
function $r4(a, t, e) {
|
|
@@ -52298,7 +52298,7 @@ var Hs5, Re5 = (a, t) => {
|
|
|
52298
52298
|
return this.parseV8Intrinsic() || super.parseExprAtom(e);
|
|
52299
52299
|
}
|
|
52300
52300
|
}, Kt5, Ht6, hs4, tr5, pt7, ze5, sr5, ir5, qe4, ut4, Ee5, ua2, Wt6, da2, cs4, ma2, ls4, ps4, us4 = (a) => a === `
|
|
52301
|
-
` || a === "\r" || a === "\u2028" || a === "\u2029", fs23, ds4,
|
|
52301
|
+
` || a === "\r" || a === "\u2028" || a === "\u2029", fs23, ds4, ms5, ve6, ee3 = (a, t) => (e, s, ...i) => e | 1 && s == null ? undefined : (t.call(s) ?? s[a]).apply(s, i), ur5, fr5, xs5, mr3, Ps5, te5, xr4, se5, Pr3, gs4, St6, Ts3, wt6, Ct7, bs4, As4, me6 = null, wr4 = 10, Ss3, c4, ws4, Er4, Cs3, Es3, fn4, Ns4, De5, ks4 = "Unexpected parseExpression() input: ", Me5, vr4, Lr4, xe4, Dr4, Mr4, Or4, Fr4, vs5, Br4, Ls5, Rr4, Ur4, Os4, Fs5, H6, Oe5 = "module", Nt6 = "commonjs", Fe5, ie4 = (a) => H6(Kr3(a)), Vr4, js5 = "v8intrinsic", Vs4, _4 = (a, t = Vr4) => ({ ...t, plugins: [...t.plugins, ...a] }), zr3, Hr3, zs5, Wr2, Jr2, Gr3, Xr2, qs5, Yr4, Lt7, vt7, $s4, ea2, ta2, sa2, ia2, ra2;
|
|
52302
52302
|
var init_babel = __esm(() => {
|
|
52303
52303
|
Hs5 = Object.defineProperty;
|
|
52304
52304
|
Ks4 = {};
|
|
@@ -55433,7 +55433,7 @@ var init_babel = __esm(() => {
|
|
|
55433
55433
|
ps4 = or5;
|
|
55434
55434
|
fs23 = hr5;
|
|
55435
55435
|
ds4 = cr4;
|
|
55436
|
-
|
|
55436
|
+
ms5 = lr4;
|
|
55437
55437
|
ve6 = pr5;
|
|
55438
55438
|
ur5 = Array.prototype.findLast ?? function(a) {
|
|
55439
55439
|
for (let t = this.length - 1;t >= 0; t--) {
|
|
@@ -85877,7 +85877,7 @@ function ps5(e) {
|
|
|
85877
85877
|
function fs24(e, t) {
|
|
85878
85878
|
return { open: e.charAt(2) === "~", close: t.charAt(t.length - 3) === "~" };
|
|
85879
85879
|
}
|
|
85880
|
-
function
|
|
85880
|
+
function ms6(e) {
|
|
85881
85881
|
return e.replace(/^\{\{~?!-?-?/, "").replace(/-?-?~?\}\}$/, "");
|
|
85882
85882
|
}
|
|
85883
85883
|
function ds5(e, t, r, s) {
|
|
@@ -87725,7 +87725,7 @@ Expecting ` + Qt.join(", ") + ", got '" + (this.terminals_[L] || L) + "'" : De =
|
|
|
87725
87725
|
};
|
|
87726
87726
|
jr3 = G6;
|
|
87727
87727
|
Ft7 = {};
|
|
87728
|
-
Oe6(Ft7, { SourceLocation: () => Qe6, id: () => ps5, prepareBlock: () => ys5, prepareMustache: () => gs5, preparePartialBlock: () => ks5, preparePath: () => ds5, prepareProgram: () => Ss4, prepareRawBlock: () => bs5, stripComment: () =>
|
|
87728
|
+
Oe6(Ft7, { SourceLocation: () => Qe6, id: () => ps5, prepareBlock: () => ys5, prepareMustache: () => gs5, preparePartialBlock: () => ks5, preparePath: () => ds5, prepareProgram: () => Ss4, prepareRawBlock: () => bs5, stripComment: () => ms6, stripFlags: () => fs24 });
|
|
87729
87729
|
Qr5 = {};
|
|
87730
87730
|
for (ue5 in Ft7)
|
|
87731
87731
|
Object.prototype.hasOwnProperty.call(Ft7, ue5) && (Qr5[ue5] = Ft7[ue5]);
|
|
@@ -89973,7 +89973,7 @@ spurious results.`);
|
|
|
89973
89973
|
var exports_html = {};
|
|
89974
89974
|
__export(exports_html, {
|
|
89975
89975
|
default: () => ws6,
|
|
89976
|
-
languages: () =>
|
|
89976
|
+
languages: () => ms7,
|
|
89977
89977
|
options: () => ds6,
|
|
89978
89978
|
parsers: () => Qr6,
|
|
89979
89979
|
printers: () => Ll2
|
|
@@ -92502,7 +92502,7 @@ ${e}`, wi7, Ja3 = (e) => e?.kind === "angularControlFlowBlock" && (e.name === "c
|
|
|
92502
92502
|
}
|
|
92503
92503
|
return i;
|
|
92504
92504
|
}
|
|
92505
|
-
}, us6, Ur6 = null, $o2 = () => (Ur6 || (Ur6 = new us6), Ur6), zo2, ps6, al2, hs6,
|
|
92505
|
+
}, us6, Ur6 = null, $o2 = () => (Ur6 || (Ur6 = new us6), Ur6), zo2, ps6, al2, hs6, ms7, Wr4, fs25 = "HTML", ol3, ds6, Qr6, gs6, cl2, Zt8, _s6, er7, Ss5, oe7, $r6, zr5, We9 = class We {
|
|
92506
92506
|
constructor(t = {}) {
|
|
92507
92507
|
tn6(this, oe7);
|
|
92508
92508
|
ir7(this, "kind");
|
|
@@ -92597,7 +92597,7 @@ ${e}`, wi7, Ja3 = (e) => e?.kind === "angularControlFlowBlock" && (e.name === "c
|
|
|
92597
92597
|
var init_html = __esm(() => {
|
|
92598
92598
|
Jr4 = Object.defineProperty;
|
|
92599
92599
|
ws6 = {};
|
|
92600
|
-
en6(ws6, { languages: () =>
|
|
92600
|
+
en6(ws6, { languages: () => ms7, options: () => ds6, parsers: () => Qr6, printers: () => Ll2 });
|
|
92601
92601
|
As6 = String.prototype.replaceAll ?? function(e, t) {
|
|
92602
92602
|
return e.global ? this.replace(e, t) : this.split(e).join(t);
|
|
92603
92603
|
};
|
|
@@ -92998,7 +92998,7 @@ If '${e}' is a directive input, make sure the directive is imported by the curre
|
|
|
92998
92998
|
ps6 = Yo2;
|
|
92999
92999
|
al2 = { features: { experimental_frontMatterSupport: { massageAstNode: true, embed: true, print: true } }, preprocess: ps6, print: sl3, insertPragma: bi7, massageAstNode: dn5, embed: fi7, getVisitorKeys: _i6 };
|
|
93000
93000
|
hs6 = al2;
|
|
93001
|
-
|
|
93001
|
+
ms7 = [{ name: "Angular", type: "markup", aceMode: "html", extensions: [".component.html"], tmScope: "text.html.basic", aliases: ["xhtml"], codemirrorMode: "htmlmixed", codemirrorMimeType: "text/html", parsers: ["angular"], vscodeLanguageIds: ["html"], filenames: [], linguistLanguageId: 146 }, { name: "HTML", type: "markup", aceMode: "html", extensions: [".html", ".hta", ".htm", ".html.hl", ".inc", ".xht", ".xhtml"], tmScope: "text.html.basic", aliases: ["xhtml"], codemirrorMode: "htmlmixed", codemirrorMimeType: "text/html", parsers: ["html"], vscodeLanguageIds: ["html"], linguistLanguageId: 146 }, { name: "Lightning Web Components", type: "markup", aceMode: "html", extensions: [], tmScope: "text.html.basic", aliases: ["xhtml"], codemirrorMode: "htmlmixed", codemirrorMimeType: "text/html", parsers: ["lwc"], vscodeLanguageIds: ["html"], filenames: [], linguistLanguageId: 146 }, { name: "MJML", type: "markup", aceMode: "html", extensions: [".mjml"], tmScope: "text.mjml.basic", aliases: ["MJML", "mjml"], codemirrorMode: "htmlmixed", codemirrorMimeType: "text/html", parsers: ["mjml"], filenames: [], vscodeLanguageIds: ["mjml"], linguistLanguageId: 146 }, { name: "Vue", type: "markup", aceMode: "vue", extensions: [".vue"], tmScope: "source.vue", codemirrorMode: "vue", codemirrorMimeType: "text/x-vue", parsers: ["vue"], vscodeLanguageIds: ["vue"], linguistLanguageId: 391 }];
|
|
93002
93002
|
Wr4 = { bracketSpacing: { category: "Common", type: "boolean", default: true, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, objectWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap object literals.", choices: [{ value: "preserve", description: "Keep as multi-line, if there is a newline between the opening brace and first property." }, { value: "collapse", description: "Fit to a single line when possible." }] }, singleQuote: { category: "Common", type: "boolean", default: false, description: "Use single quotes instead of double quotes." }, proseWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap prose.", choices: [{ value: "always", description: "Wrap prose if it exceeds the print width." }, { value: "never", description: "Do not wrap prose." }, { value: "preserve", description: "Wrap prose as-is." }] }, bracketSameLine: { category: "Common", type: "boolean", default: false, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: false, description: "Enforce single attribute per line in HTML, Vue and JSX." } };
|
|
93003
93003
|
ol3 = { bracketSameLine: Wr4.bracketSameLine, htmlWhitespaceSensitivity: { category: fs25, type: "choice", default: "css", description: "How to handle whitespaces in HTML.", choices: [{ value: "css", description: "Respect the default value of CSS display property." }, { value: "strict", description: "Whitespaces are considered sensitive." }, { value: "ignore", description: "Whitespaces are considered insensitive." }] }, singleAttributePerLine: Wr4.singleAttributePerLine, vueIndentScriptAndStyle: { category: fs25, type: "boolean", default: false, description: "Indent script and style tags in Vue files." } };
|
|
93004
93004
|
ds6 = ol3;
|
|
@@ -94224,7 +94224,7 @@ var El3, Ft10, Cl3, vl3, Al3, bl3, x7 = (e, r) => () => (r || e((r = { exports:
|
|
|
94224
94224
|
for (let i of vl3(r))
|
|
94225
94225
|
!bl3.call(e, i) && i !== t && Ft10(e, i, { get: () => r[i], enumerable: !(n = Cl3(r, i)) || n.enumerable });
|
|
94226
94226
|
return e;
|
|
94227
|
-
}, Re9 = (e, r, t) => (t = e != null ? El3(Al3(e)) : {}, xl3(r || !e || !e.__esModule ? Ft10(t, "default", { value: e, enumerable: true }) : t, e)), Tr6, Qi7, Mt10, uu2, lu2, Du2, Ie9, hu2, Fu2, Eu2, vu2, bu2, xu2, yu2, Se9, Tu2, $e8, Ou2, qu2, Iu2, mr6, Ju2, ea4, na3, ua4, Kt8, sa4, fa3, pa3, Fa4, Ea3, va3, xa3, wa3, Zr6, Qt8, Oa3, Pa3, Le9, rt11, Ua4, za3, ja4, nn7, Ja4, no5, oo5, cn6, po5, se8, ln6, bo3, wo4, Bo3, Oo3, Io4, hn6, Yo3, zo3, jo3, Jo3, rs6, us7, ss7, yn6,
|
|
94227
|
+
}, Re9 = (e, r, t) => (t = e != null ? El3(Al3(e)) : {}, xl3(r || !e || !e.__esModule ? Ft10(t, "default", { value: e, enumerable: true }) : t, e)), Tr6, Qi7, Mt10, uu2, lu2, Du2, Ie9, hu2, Fu2, Eu2, vu2, bu2, xu2, yu2, Se9, Tu2, $e8, Ou2, qu2, Iu2, mr6, Ju2, ea4, na3, ua4, Kt8, sa4, fa3, pa3, Fa4, Ea3, va3, xa3, wa3, Zr6, Qt8, Oa3, Pa3, Le9, rt11, Ua4, za3, ja4, nn7, Ja4, no5, oo5, cn6, po5, se8, ln6, bo3, wo4, Bo3, Oo3, Io4, hn6, Yo3, zo3, jo3, Jo3, rs6, us7, ss7, yn6, ms8, Es6, vs8, ys7, ks7, Bs8, Ps8, Ss6, Ys8, zs8, js8, Hs8, Js8, Zs8, nc2, oc2, cc2, Pn5, Ec2, vc2, bc2, Tc2, qc2, Ic2, Sc2, Rc2, Yc2, zc2, Vc2, el3, gl3, Me9 = (e, r) => (t, n, ...i) => t | 1 && n == null ? undefined : (r.call(n) ?? n[e]).apply(n, i), wl3, U9, kl3, Tl3, R10, $i7, _l3 = () => {}, tr8, V9 = "string", j7 = "array", be9 = "cursor", ee6 = "indent", re6 = "align", De8 = "trim", X10 = "group", J11 = "fill", Q10 = "if-break", pe8 = "indent-if-break", he9 = "line-suffix", de8 = "line-suffix-boundary", $9 = "line", me10 = "label", te9 = "break-parent", Br6, W10, ql2 = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e), gt10, Be8, $n5, Hn5, ne9, Or6, Jn4, Qn5, Ue7, qr5, Nr6, ar8, M9, Sl3, nr7, Ll3 = "cr", Rl2 = "crlf", Ml2 = "\r", Ul2 = `\r
|
|
94228
94228
|
`, Yl2 = `
|
|
94229
94229
|
`, Gl2, ri8 = () => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g, ti8 = "©®‼⁉™ℹ↔↕↖↗↘↙↩↪⌨⏏⏱⏲⏸⏹⏺▪▫▶◀◻◼☀☁☂☃☄☎☑☘☝☠☢☣☦☪☮☯☸☹☺♀♂♟♠♣♥♦♨♻♾⚒⚔⚕⚖⚗⚙⚛⚜⚠⚧⚰⚱⛈⛏⛑⛓⛩⛱⛷⛸⛹✂✈✉✌✍✏✒✔✖✝✡✳✴❄❇❣❤➡⤴⤵⬅⬆⬇", zl2, Wl2, or8, jl2, $l2, vt11, H10, ue8, bt11, Ir5, oi8, si8, ci8, Jl2, Ql2, li8, xt9, fi8, bi8, ef, rf, Di7, nf, hi8 = (e) => String(e).split(/[/\\]/u).pop(), di8 = (e) => String(e).startsWith("file:"), sf = undefined, wt10, Sr6, kt11, sr8 = 3, _e8, gi8 = "format", Ei8, Ci7, Lr7 = (e) => _e8(e).content.trimStart().match(Ci7)?.index === 0, vi8 = (e) => _e8(e).content.trimStart().match(Ei8)?.index === 0, Ai8 = (e) => {
|
|
94230
94230
|
let { frontMatter: r } = _e8(e), t = `<!-- @${gi8} -->`;
|
|
@@ -95901,7 +95901,7 @@ $$`;
|
|
|
95901
95901
|
return n === -1 || t < n ? t : n;
|
|
95902
95902
|
}
|
|
95903
95903
|
});
|
|
95904
|
-
|
|
95904
|
+
ms8 = x7((i2, ds) => {
|
|
95905
95905
|
var br = se8(), T0 = yn6();
|
|
95906
95906
|
ds.exports = hs;
|
|
95907
95907
|
hs.locator = T0;
|
|
@@ -96210,7 +96210,7 @@ $$`;
|
|
|
96210
96210
|
Y.interruptList = [["atxHeading", { pedantic: false }], ["fencedCode", { pedantic: false }], ["thematicBreak", { pedantic: false }], ["definition", { commonmark: false }]];
|
|
96211
96211
|
Y.interruptBlockquote = [["indentedCode", { commonmark: true }], ["fencedCode", { commonmark: true }], ["atxHeading", { commonmark: true }], ["setextHeading", { commonmark: true }], ["thematicBreak", { commonmark: true }], ["html", { commonmark: true }], ["list", { commonmark: true }], ["definition", { commonmark: false }]];
|
|
96212
96212
|
Y.blockTokenizers = { blankLine: wa3(), indentedCode: Oa3(), fencedCode: Pa3(), blockquote: Ua4(), atxHeading: za3(), thematicBreak: ja4(), list: no5(), setextHeading: oo5(), html: po5(), definition: bo3(), table: wo4(), paragraph: Bo3() };
|
|
96213
|
-
Y.inlineTokenizers = { escape: Io4(), autoLink: Yo3(), url: Jo3(), email: us7(), html: ss7(), link:
|
|
96213
|
+
Y.inlineTokenizers = { escape: Io4(), autoLink: Yo3(), url: Jo3(), email: us7(), html: ss7(), link: ms8(), reference: Es6(), strong: ys7(), emphasis: Ps8(), deletion: Ys8(), code: js8(), break: Js8(), text: Zs8() };
|
|
96214
96214
|
Y.blockMethods = rc(Y.blockTokenizers);
|
|
96215
96215
|
Y.inlineMethods = rc(Y.inlineTokenizers);
|
|
96216
96216
|
Y.tokenizeBlock = Nn("block");
|
|
@@ -124807,7 +124807,7 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124807
124807
|
}
|
|
124808
124808
|
}
|
|
124809
124809
|
}, ast_path_default, is_object_default, skipWhitespace, skipSpaces, skipToLineEnd, skipEverythingButNewLine, isNewlineCharacter = (character) => character === `
|
|
124810
|
-
` || character === "\r" || character === "\u2028" || character === "\u2029", skip_newline_default, has_newline_default, is_non_empty_array_default, get_sorted_child_nodes_default, childNodesCache, returnFalse = () => false, isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/u.test(text), is_previous_line_empty_default, breakParent2, hardline2, indent2,
|
|
124810
|
+
` || character === "\r" || character === "\u2028" || character === "\u2029", skip_newline_default, has_newline_default, is_non_empty_array_default, get_sorted_child_nodes_default, childNodesCache, returnFalse = () => false, isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/u.test(text), is_previous_line_empty_default, breakParent2, hardline2, indent2, join33, line22, lineSuffix2, create_print_pre_check_function_default = () => noop_default2, core_options_evaluate_default, arrayToReversed, toReversed, method_to_reversed_default, import_n_readlines, get_interpreter_default, getFileBasename = (file) => {
|
|
124811
124811
|
try {
|
|
124812
124812
|
return path112.basename(toPath3(file));
|
|
124813
124813
|
} catch {
|
|
@@ -134836,7 +134836,7 @@ ${codeblock}`, options8);
|
|
|
134836
134836
|
breakParent: breakParent2,
|
|
134837
134837
|
hardline: hardline2,
|
|
134838
134838
|
indent: indent2,
|
|
134839
|
-
join:
|
|
134839
|
+
join: join33,
|
|
134840
134840
|
line: line22,
|
|
134841
134841
|
lineSuffix: lineSuffix2
|
|
134842
134842
|
} = builders);
|
|
@@ -228838,7 +228838,7 @@ function normalizeBase44Env() {
|
|
|
228838
228838
|
loadProjectEnvFiles();
|
|
228839
228839
|
|
|
228840
228840
|
// src/cli/index.ts
|
|
228841
|
-
import { dirname as dirname30, join as
|
|
228841
|
+
import { dirname as dirname30, join as join41 } from "node:path";
|
|
228842
228842
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
228843
228843
|
|
|
228844
228844
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -236598,6 +236598,13 @@ var FinalizeDeploymentResponseSchema = object({
|
|
|
236598
236598
|
}).transform((data) => ({
|
|
236599
236599
|
deploymentId: data.deployment_id
|
|
236600
236600
|
}));
|
|
236601
|
+
var PublishDeploymentResponseSchema = object({
|
|
236602
|
+
git_commit_hash: string2(),
|
|
236603
|
+
deployed_at: string2()
|
|
236604
|
+
}).transform((data) => ({
|
|
236605
|
+
gitHash: data.git_commit_hash,
|
|
236606
|
+
deployedAt: data.deployed_at
|
|
236607
|
+
}));
|
|
236601
236608
|
|
|
236602
236609
|
// src/core/project/api.ts
|
|
236603
236610
|
var PUBLIC_SETTINGS = {
|
|
@@ -239376,7 +239383,7 @@ import { join as join13 } from "node:path";
|
|
|
239376
239383
|
// package.json
|
|
239377
239384
|
var package_default = {
|
|
239378
239385
|
name: "base44",
|
|
239379
|
-
version: "0.1.
|
|
239386
|
+
version: "0.1.33",
|
|
239380
239387
|
description: "Base44 CLI - Unified interface for managing Base44 applications",
|
|
239381
239388
|
type: "module",
|
|
239382
239389
|
bin: {
|
|
@@ -239681,6 +239688,23 @@ async function finalizeDeployment(deploymentId, sessionId, payload) {
|
|
|
239681
239688
|
}
|
|
239682
239689
|
return result.data;
|
|
239683
239690
|
}
|
|
239691
|
+
async function publishDeployment(gitHash) {
|
|
239692
|
+
const appClient = getAppClient();
|
|
239693
|
+
let response;
|
|
239694
|
+
try {
|
|
239695
|
+
response = await appClient.post("deploy", {
|
|
239696
|
+
json: { git_commit_hash: gitHash },
|
|
239697
|
+
timeout: 120000
|
|
239698
|
+
});
|
|
239699
|
+
} catch (error) {
|
|
239700
|
+
throw await ApiError.fromHttpError(error, "publishing deployment");
|
|
239701
|
+
}
|
|
239702
|
+
const result = PublishDeploymentResponseSchema.safeParse(await response.json());
|
|
239703
|
+
if (!result.success) {
|
|
239704
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
239705
|
+
}
|
|
239706
|
+
return { ...result.data, appUrl: await getSiteUrl() };
|
|
239707
|
+
}
|
|
239684
239708
|
// src/core/site/config.ts
|
|
239685
239709
|
async function getSiteFilePaths(outputDir) {
|
|
239686
239710
|
return await globby("**/*", {
|
|
@@ -240264,11 +240288,6 @@ async function putPresignedBody(upload, body) {
|
|
|
240264
240288
|
|
|
240265
240289
|
// src/core/site/deployment.ts
|
|
240266
240290
|
var NO_ASSETS = { manifest: {}, filesByHash: new Map };
|
|
240267
|
-
var DEPLOYMENTS_API_ENV = "BASE44_DEPLOYMENTS_API";
|
|
240268
|
-
function deploymentsApiEnabled(env = process.env) {
|
|
240269
|
-
const value = env[DEPLOYMENTS_API_ENV];
|
|
240270
|
-
return value === "1" || value === "true";
|
|
240271
|
-
}
|
|
240272
240291
|
async function deployToDeployments(options) {
|
|
240273
240292
|
const { projectRoot, outputDir, gitHash, concurrency, progress } = options;
|
|
240274
240293
|
const worker = await resolveWorkerBuild(projectRoot, progress);
|
|
@@ -246837,21 +246856,10 @@ var {
|
|
|
246837
246856
|
} = getIpcExport();
|
|
246838
246857
|
|
|
246839
246858
|
// src/core/utils/git.ts
|
|
246840
|
-
import { dirname as dirname13, join as join19 } from "node:path";
|
|
246841
246859
|
var GIT_HASH_PATTERN = /^[a-fA-F0-9]{7,64}$/;
|
|
246842
246860
|
function isGitCommitHash(value) {
|
|
246843
246861
|
return GIT_HASH_PATTERN.test(value);
|
|
246844
246862
|
}
|
|
246845
|
-
async function findGitRoot2(startPath = process.cwd()) {
|
|
246846
|
-
let current = startPath;
|
|
246847
|
-
while (!await pathExists(join19(current, ".git"))) {
|
|
246848
|
-
const parent = dirname13(current);
|
|
246849
|
-
if (parent === current)
|
|
246850
|
-
return;
|
|
246851
|
-
current = parent;
|
|
246852
|
-
}
|
|
246853
|
-
return current;
|
|
246854
|
-
}
|
|
246855
246863
|
|
|
246856
246864
|
// src/core/site/git-hash.ts
|
|
246857
246865
|
async function resolveGitHash(projectRoot, explicit) {
|
|
@@ -246885,7 +246893,7 @@ async function gitHead(projectRoot) {
|
|
|
246885
246893
|
}
|
|
246886
246894
|
}
|
|
246887
246895
|
// src/core/project/deploy.ts
|
|
246888
|
-
function hasResourcesToDeploy(projectData) {
|
|
246896
|
+
async function hasResourcesToDeploy(projectData) {
|
|
246889
246897
|
const {
|
|
246890
246898
|
project,
|
|
246891
246899
|
entities,
|
|
@@ -246896,7 +246904,7 @@ function hasResourcesToDeploy(projectData) {
|
|
|
246896
246904
|
connectors,
|
|
246897
246905
|
authConfig
|
|
246898
246906
|
} = projectData;
|
|
246899
|
-
const hasSite = Boolean(project.site?.outputDirectory);
|
|
246907
|
+
const hasSite = Boolean(project.site?.outputDirectory) || Boolean(await detectFullStackArtifact(project.root));
|
|
246900
246908
|
const hasEntities = entities.length > 0;
|
|
246901
246909
|
const hasFunctions = functions.length > 0;
|
|
246902
246910
|
const hasActors = actors.length > 0;
|
|
@@ -246955,27 +246963,75 @@ async function deployAll(projectData, options) {
|
|
|
246955
246963
|
await authConfigResource.push(authConfig);
|
|
246956
246964
|
const skipConnectorSync = connectors.length === 0 && hasWorkspaceApiKeyAuth();
|
|
246957
246965
|
const connectorResults = skipConnectorSync ? [] : (await pushConnectors(connectors)).results;
|
|
246958
|
-
|
|
246959
|
-
|
|
246966
|
+
const appUrl = await deployProjectSite(project, options);
|
|
246967
|
+
return appUrl ? { appUrl, connectorResults } : { connectorResults };
|
|
246968
|
+
}
|
|
246969
|
+
async function deployProjectSite(project, options) {
|
|
246970
|
+
const outputDirectory = project.site?.outputDirectory;
|
|
246971
|
+
const outputDir = outputDirectory ? resolve5(project.root, outputDirectory) : null;
|
|
246972
|
+
if (!outputDir) {
|
|
246973
|
+
if (!await detectFullStackArtifact(project.root)) {
|
|
246974
|
+
return;
|
|
246975
|
+
}
|
|
246976
|
+
const gitHash = await resolveGitHash(project.root, options?.gitHash);
|
|
246977
|
+
return shipCommit(project.root, null, gitHash, options);
|
|
246978
|
+
}
|
|
246979
|
+
const gitHash = await resolveGitHash(project.root, options?.gitHash).catch(() => {
|
|
246980
|
+
return;
|
|
246981
|
+
});
|
|
246982
|
+
if (!gitHash) {
|
|
246983
|
+
options?.onSiteProgress?.("No commit found for this build, so it was deployed without one. Commit your work to address deployments by it.");
|
|
246960
246984
|
const { appUrl } = await deploySite(outputDir);
|
|
246961
|
-
return
|
|
246985
|
+
return appUrl;
|
|
246962
246986
|
}
|
|
246963
|
-
return
|
|
246987
|
+
return shipCommit(project.root, outputDir, gitHash, options);
|
|
246988
|
+
}
|
|
246989
|
+
async function shipCommit(projectRoot, outputDir, gitHash, options) {
|
|
246990
|
+
await deployToDeployments({
|
|
246991
|
+
projectRoot,
|
|
246992
|
+
outputDir,
|
|
246993
|
+
gitHash,
|
|
246994
|
+
progress: {
|
|
246995
|
+
onWarning: (message) => options?.onSiteProgress?.(message),
|
|
246996
|
+
onAssets: ({ totalAssets, newAssets }) => options?.onSiteProgress?.(`Found ${totalAssets} static assets (${newAssets} new)`)
|
|
246997
|
+
}
|
|
246998
|
+
});
|
|
246999
|
+
if (options?.publish === false) {
|
|
247000
|
+
return;
|
|
247001
|
+
}
|
|
247002
|
+
try {
|
|
247003
|
+
const { appUrl } = await publishDeployment(gitHash);
|
|
247004
|
+
return appUrl;
|
|
247005
|
+
} catch (error) {
|
|
247006
|
+
if (!publishesFromBuilder(error)) {
|
|
247007
|
+
throw error;
|
|
247008
|
+
}
|
|
247009
|
+
options?.onSiteProgress?.("Site deployed. This app is published from the Base44 builder, so production was left where it was.");
|
|
247010
|
+
return;
|
|
247011
|
+
}
|
|
247012
|
+
}
|
|
247013
|
+
function publishesFromBuilder(error) {
|
|
247014
|
+
if (!(error instanceof ApiError)) {
|
|
247015
|
+
return false;
|
|
247016
|
+
}
|
|
247017
|
+
const body = error.responseBody;
|
|
247018
|
+
return body?.error?.code === "git_commit_hash_not_supported";
|
|
246964
247019
|
}
|
|
246965
247020
|
// src/core/project/target.ts
|
|
246966
|
-
import { dirname as
|
|
247021
|
+
import { dirname as dirname13, join as join19, resolve as resolve6 } from "node:path";
|
|
246967
247022
|
async function resolveBuildTarget(projectRoot, overrides = {}) {
|
|
246968
247023
|
const project = await readSettingsIfPresent(projectRoot);
|
|
246969
247024
|
const root = project?.root ?? projectRoot ?? process.cwd();
|
|
246970
247025
|
const site = project ? siteOrDefault(project) : DEFAULT_SITE;
|
|
246971
247026
|
return {
|
|
246972
247027
|
root,
|
|
246973
|
-
configDir: project ?
|
|
247028
|
+
configDir: project ? dirname13(project.configPath) : join19(root, PROJECT_SUBDIR),
|
|
246974
247029
|
buildCommand: site.buildCommand,
|
|
246975
247030
|
outputDir: resolve6(root, overrides.outputDir ?? site.outputDirectory ?? DEFAULT_SITE.outputDirectory),
|
|
246976
247031
|
entitiesDir: project?.entitiesDir ?? "entities",
|
|
246977
247032
|
agentsDir: project?.agentsDir ?? "agents",
|
|
246978
|
-
functionsDir: project?.functionsDir ?? "functions"
|
|
247033
|
+
functionsDir: project?.functionsDir ?? "functions",
|
|
247034
|
+
actorsDir: project?.actorsDir ?? "actors"
|
|
246979
247035
|
};
|
|
246980
247036
|
}
|
|
246981
247037
|
async function readSettingsIfPresent(projectRoot) {
|
|
@@ -247706,9 +247762,6 @@ function getConnectorsUrl(projectId) {
|
|
|
247706
247762
|
const id = projectId ?? getAppContext().id;
|
|
247707
247763
|
return `${getBase44ApiUrl()}/apps/${id}/editor/workspace/app-connections`;
|
|
247708
247764
|
}
|
|
247709
|
-
function getBaseCodeUrl(appId, branchName) {
|
|
247710
|
-
return `${getBase44ApiUrl()}/apps/${appId}/editor/workspace/code?branch=${encodeURIComponent(branchName)}`;
|
|
247711
|
-
}
|
|
247712
247765
|
// src/cli/utils/yaml.ts
|
|
247713
247766
|
var import_lodash = __toESM(require_lodash8(), 1);
|
|
247714
247767
|
var YAML_INDENT = 2;
|
|
@@ -247835,7 +247888,7 @@ function getActorsCommand() {
|
|
|
247835
247888
|
}
|
|
247836
247889
|
|
|
247837
247890
|
// src/cli/commands/agent-skills/pull.ts
|
|
247838
|
-
import { dirname as
|
|
247891
|
+
import { dirname as dirname14, join as join20 } from "node:path";
|
|
247839
247892
|
// src/core/utils/dependencies.ts
|
|
247840
247893
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
247841
247894
|
function verifyDenoInstalled(context) {
|
|
@@ -247924,7 +247977,7 @@ async function pullAction({
|
|
|
247924
247977
|
runTask
|
|
247925
247978
|
}) {
|
|
247926
247979
|
const { project } = await readProjectConfig();
|
|
247927
|
-
const dir =
|
|
247980
|
+
const dir = join20(dirname14(project.configPath), project.agentSkillsDir);
|
|
247928
247981
|
const remote = await runTask("Fetching agent skills from Base44", () => fetchAgentSkills(), {
|
|
247929
247982
|
successMessage: "Agent skills fetched successfully",
|
|
247930
247983
|
errorMessage: "Failed to fetch agent skills"
|
|
@@ -247980,14 +248033,14 @@ function getAgentSkillsCommand() {
|
|
|
247980
248033
|
}
|
|
247981
248034
|
|
|
247982
248035
|
// src/cli/commands/agents/pull.ts
|
|
247983
|
-
import { dirname as
|
|
248036
|
+
import { dirname as dirname15, join as join21 } from "node:path";
|
|
247984
248037
|
async function pullAgentsAction({
|
|
247985
248038
|
log,
|
|
247986
248039
|
runTask
|
|
247987
248040
|
}) {
|
|
247988
248041
|
const { project } = await readProjectConfig();
|
|
247989
|
-
const configDir =
|
|
247990
|
-
const agentsDir =
|
|
248042
|
+
const configDir = dirname15(project.configPath);
|
|
248043
|
+
const agentsDir = join21(configDir, project.agentsDir);
|
|
247991
248044
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
247992
248045
|
return await fetchAgents();
|
|
247993
248046
|
}, {
|
|
@@ -249563,11 +249616,11 @@ function redactedApiError(apiError, raw, method, path, retryAfter) {
|
|
|
249563
249616
|
}
|
|
249564
249617
|
// src/core/api-spec/spec.ts
|
|
249565
249618
|
import { rename, rm, stat as stat3 } from "node:fs/promises";
|
|
249566
|
-
import { join as
|
|
249619
|
+
import { join as join22 } from "node:path";
|
|
249567
249620
|
var SPEC_CACHE_TTL_MS = 60 * 60 * 1000;
|
|
249568
249621
|
function getSpecCachePath(apiUrl = getBase44ApiUrl()) {
|
|
249569
249622
|
const server = new URL(apiUrl).host.replace(/[^a-zA-Z0-9.-]/g, "_");
|
|
249570
|
-
return
|
|
249623
|
+
return join22(getBase44GlobalDir(), "cache", server, "openapi.json");
|
|
249571
249624
|
}
|
|
249572
249625
|
function isSpecCacheFresh(mtimeMs, now = Date.now()) {
|
|
249573
249626
|
return now - mtimeMs < SPEC_CACHE_TTL_MS;
|
|
@@ -249917,12 +249970,12 @@ function getApiCommand() {
|
|
|
249917
249970
|
}
|
|
249918
249971
|
|
|
249919
249972
|
// src/cli/commands/auth/password-login.ts
|
|
249920
|
-
import { dirname as
|
|
249973
|
+
import { dirname as dirname16, join as join23 } from "node:path";
|
|
249921
249974
|
async function passwordLoginAction({ log, runTask }, action) {
|
|
249922
249975
|
const shouldEnable = action === "enable";
|
|
249923
249976
|
const { project } = await readProjectConfig();
|
|
249924
|
-
const configDir =
|
|
249925
|
-
const authDir =
|
|
249977
|
+
const configDir = dirname16(project.configPath);
|
|
249978
|
+
const authDir = join23(configDir, project.authDir);
|
|
249926
249979
|
const updated = await runTask("Updating local auth config", async () => {
|
|
249927
249980
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
249928
249981
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -249942,14 +249995,14 @@ function getPasswordLoginCommand() {
|
|
|
249942
249995
|
}
|
|
249943
249996
|
|
|
249944
249997
|
// src/cli/commands/auth/pull.ts
|
|
249945
|
-
import { dirname as
|
|
249998
|
+
import { dirname as dirname17, join as join24 } from "node:path";
|
|
249946
249999
|
async function pullAuthAction({
|
|
249947
250000
|
log,
|
|
249948
250001
|
runTask
|
|
249949
250002
|
}) {
|
|
249950
250003
|
const { project } = await readProjectConfig();
|
|
249951
|
-
const configDir =
|
|
249952
|
-
const authDir =
|
|
250004
|
+
const configDir = dirname17(project.configPath);
|
|
250005
|
+
const authDir = join24(configDir, project.authDir);
|
|
249953
250006
|
const remoteConfig = await runTask("Fetching auth config from Base44", async () => {
|
|
249954
250007
|
return await pullAuthConfig();
|
|
249955
250008
|
}, {
|
|
@@ -250013,7 +250066,7 @@ function getAuthPushCommand() {
|
|
|
250013
250066
|
}
|
|
250014
250067
|
|
|
250015
250068
|
// src/cli/commands/auth/social-login.ts
|
|
250016
|
-
import { dirname as
|
|
250069
|
+
import { dirname as dirname18, join as join25, resolve as resolve7 } from "node:path";
|
|
250017
250070
|
var PROVIDER_LABELS = {
|
|
250018
250071
|
google: "Google",
|
|
250019
250072
|
microsoft: "Microsoft",
|
|
@@ -250083,8 +250136,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask }, provider, a
|
|
|
250083
250136
|
}
|
|
250084
250137
|
}
|
|
250085
250138
|
const { project } = await readProjectConfig();
|
|
250086
|
-
const configDir =
|
|
250087
|
-
const authDir =
|
|
250139
|
+
const configDir = dirname18(project.configPath);
|
|
250140
|
+
const authDir = join25(configDir, project.authDir);
|
|
250088
250141
|
const { config: updated } = await runTask("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
250089
250142
|
if (clientSecret) {
|
|
250090
250143
|
await runTask("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -250109,7 +250162,7 @@ function getSocialLoginCommand() {
|
|
|
250109
250162
|
}
|
|
250110
250163
|
|
|
250111
250164
|
// src/cli/commands/auth/sso.ts
|
|
250112
|
-
import { dirname as
|
|
250165
|
+
import { dirname as dirname19, join as join26, resolve as resolve8 } from "node:path";
|
|
250113
250166
|
var SSOConfigFileSchema = object({
|
|
250114
250167
|
provider: _enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
250115
250168
|
clientId: string2(),
|
|
@@ -250272,8 +250325,8 @@ async function ssoEnableAction({ isNonInteractive, runTask }, options) {
|
|
|
250272
250325
|
throw error;
|
|
250273
250326
|
}
|
|
250274
250327
|
const { project } = await readProjectConfig();
|
|
250275
|
-
const configDir =
|
|
250276
|
-
const authDir =
|
|
250328
|
+
const configDir = dirname19(project.configPath);
|
|
250329
|
+
const authDir = join26(configDir, project.authDir);
|
|
250277
250330
|
await runTask("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
250278
250331
|
await runTask("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
250279
250332
|
return {
|
|
@@ -250288,8 +250341,8 @@ async function ssoDisableAction({ log, runTask }, options) {
|
|
|
250288
250341
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
250289
250342
|
}
|
|
250290
250343
|
const { project } = await readProjectConfig();
|
|
250291
|
-
const configDir =
|
|
250292
|
-
const authDir =
|
|
250344
|
+
const configDir = dirname19(project.configPath);
|
|
250345
|
+
const authDir = join26(configDir, project.authDir);
|
|
250293
250346
|
const updated = await runTask("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
250294
250347
|
await runTask("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
250295
250348
|
if (!hasAnyLoginMethod(updated)) {
|
|
@@ -251171,13 +251224,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
251171
251224
|
}
|
|
251172
251225
|
|
|
251173
251226
|
// src/cli/commands/connectors/pull.ts
|
|
251174
|
-
import { dirname as
|
|
251227
|
+
import { dirname as dirname20, join as join27, resolve as resolve9 } from "node:path";
|
|
251175
251228
|
async function resolveConnectorsDir(options) {
|
|
251176
251229
|
if (!getAppContext().projectRoot) {
|
|
251177
251230
|
return resolve9(options.dir ?? "connectors");
|
|
251178
251231
|
}
|
|
251179
251232
|
const { project } = await readProjectConfig();
|
|
251180
|
-
return
|
|
251233
|
+
return join27(dirname20(project.configPath), project.connectorsDir);
|
|
251181
251234
|
}
|
|
251182
251235
|
async function pullConnectorsAction({ log, runTask, jsonMode }, options) {
|
|
251183
251236
|
const connectorsDir = await resolveConnectorsDir(options);
|
|
@@ -251564,11 +251617,11 @@ function getListCommand() {
|
|
|
251564
251617
|
}
|
|
251565
251618
|
|
|
251566
251619
|
// src/cli/commands/functions/pull.ts
|
|
251567
|
-
import { dirname as
|
|
251620
|
+
import { dirname as dirname21, join as join28 } from "node:path";
|
|
251568
251621
|
async function pullFunctionsAction({ log, runTask }, name) {
|
|
251569
251622
|
const { project, functions } = await readProjectConfig();
|
|
251570
|
-
const configDir =
|
|
251571
|
-
const functionsDir =
|
|
251623
|
+
const configDir = dirname21(project.configPath);
|
|
251624
|
+
const functionsDir = join28(configDir, project.functionsDir);
|
|
251572
251625
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
251573
251626
|
const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
|
|
251574
251627
|
const { functions } = await listDeployedFunctions();
|
|
@@ -251682,7 +251735,7 @@ import { basename as basename7, resolve as resolve11 } from "node:path";
|
|
|
251682
251735
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
251683
251736
|
|
|
251684
251737
|
// src/cli/commands/project/scaffold-shared.ts
|
|
251685
|
-
import { join as
|
|
251738
|
+
import { join as join29 } from "node:path";
|
|
251686
251739
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
251687
251740
|
async function getTemplateById(templateId) {
|
|
251688
251741
|
const templates = await listTemplates();
|
|
@@ -251745,7 +251798,7 @@ async function completeProjectSetup({
|
|
|
251745
251798
|
env: { VITE_BASE44_APP_ID: projectId }
|
|
251746
251799
|
})`${buildCommand}`;
|
|
251747
251800
|
updateMessage("Deploying site...");
|
|
251748
|
-
return await deploySite(
|
|
251801
|
+
return await deploySite(join29(resolvedPath, outputDirectory));
|
|
251749
251802
|
}, {
|
|
251750
251803
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
251751
251804
|
errorMessage: "Failed to deploy site"
|
|
@@ -251955,7 +252008,7 @@ async function deployAction(ctx, options = {}) {
|
|
|
251955
252008
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
251956
252009
|
}
|
|
251957
252010
|
const projectData = await readProjectConfig(options.projectRoot);
|
|
251958
|
-
if (!hasResourcesToDeploy(projectData)) {
|
|
252011
|
+
if (!await hasResourcesToDeploy(projectData)) {
|
|
251959
252012
|
return {
|
|
251960
252013
|
outroMessage: "No resources found to deploy"
|
|
251961
252014
|
};
|
|
@@ -252014,6 +252067,11 @@ ${summaryLines.join(`
|
|
|
252014
252067
|
const functionTotal = functions.length;
|
|
252015
252068
|
let actorCompleted = 0;
|
|
252016
252069
|
const result = await deployAll(projectData, {
|
|
252070
|
+
gitHash: options.gitHash,
|
|
252071
|
+
publish: options.publish,
|
|
252072
|
+
onSiteProgress: (message) => {
|
|
252073
|
+
log.message(theme.styles.dim(message));
|
|
252074
|
+
},
|
|
252017
252075
|
onVisibilitySet: (level) => {
|
|
252018
252076
|
log.success(`App visibility set to ${level}`);
|
|
252019
252077
|
},
|
|
@@ -252049,7 +252107,7 @@ ${summaryLines.join(`
|
|
|
252049
252107
|
return { outroMessage: "App deployed successfully" };
|
|
252050
252108
|
}
|
|
252051
252109
|
function getDeployCommand3() {
|
|
252052
|
-
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, actors, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").option("--build", "Build the site before deploying (skips the prompt)").option("--no-build", "Deploy without building (skips the prompt)").action(deployAction);
|
|
252110
|
+
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, actors, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").option("--build", "Build the site before deploying (skips the prompt)").option("--no-build", "Deploy without building (skips the prompt)").option("--no-publish", "Deploy the site without serving it in production yet").addOption(new Option2("--git-hash <hash>", "Commit the built site came from (defaults to the checkout's HEAD)").argParser(parseGitHash)).action(deployAction);
|
|
252053
252111
|
}
|
|
252054
252112
|
async function handleOAuthConnectors(connectorResults, isNonInteractive, options, log) {
|
|
252055
252113
|
const needsOAuth = filterPendingOAuth(connectorResults);
|
|
@@ -252070,6 +252128,12 @@ function printStripeResult(r, log) {
|
|
|
252070
252128
|
}
|
|
252071
252129
|
log.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
252072
252130
|
}
|
|
252131
|
+
function parseGitHash(value) {
|
|
252132
|
+
if (!isGitCommitHash(value)) {
|
|
252133
|
+
throw new InvalidArgumentError2("Expected a git commit hash (7-64 hex chars).");
|
|
252134
|
+
}
|
|
252135
|
+
return value;
|
|
252136
|
+
}
|
|
252073
252137
|
|
|
252074
252138
|
// src/cli/commands/project/app-id-options.ts
|
|
252075
252139
|
function readExplicitAppId(command) {
|
|
@@ -252667,6 +252731,25 @@ function declaredBundle({
|
|
|
252667
252731
|
}
|
|
252668
252732
|
};
|
|
252669
252733
|
}
|
|
252734
|
+
function declaredActor({
|
|
252735
|
+
name,
|
|
252736
|
+
entry,
|
|
252737
|
+
source,
|
|
252738
|
+
size,
|
|
252739
|
+
digest,
|
|
252740
|
+
staticEgress
|
|
252741
|
+
}) {
|
|
252742
|
+
return {
|
|
252743
|
+
name,
|
|
252744
|
+
entry,
|
|
252745
|
+
source,
|
|
252746
|
+
module: { size, digest },
|
|
252747
|
+
static_egress: staticEgress
|
|
252748
|
+
};
|
|
252749
|
+
}
|
|
252750
|
+
function actorUploadPath(actor) {
|
|
252751
|
+
return `actors/${actor.name}.mjs`;
|
|
252752
|
+
}
|
|
252670
252753
|
function declaredServingConfig(config) {
|
|
252671
252754
|
const stated = {
|
|
252672
252755
|
html_handling: config?.htmlHandling ?? null,
|
|
@@ -252721,6 +252804,7 @@ async function createVersion(artifacts, options = {}) {
|
|
|
252721
252804
|
}
|
|
252722
252805
|
} : {},
|
|
252723
252806
|
backend_bundles: artifacts.backendBundles.map(declaredBundle),
|
|
252807
|
+
actors: artifacts.actors.map(declaredActor),
|
|
252724
252808
|
entities: artifacts.entities,
|
|
252725
252809
|
agents: artifacts.agents,
|
|
252726
252810
|
source_commit: options.sourceCommit
|
|
@@ -252729,7 +252813,8 @@ async function createVersion(artifacts, options = {}) {
|
|
|
252729
252813
|
...artifacts.assets,
|
|
252730
252814
|
...artifacts.siteWorker?.modules ?? []
|
|
252731
252815
|
];
|
|
252732
|
-
const
|
|
252816
|
+
const actorsAt = declaredFiles.length + artifacts.backendBundles.length;
|
|
252817
|
+
const slotCount = actorsAt + artifacts.actors.length;
|
|
252733
252818
|
options.progress?.onDeclared?.({ fileCount: slotCount });
|
|
252734
252819
|
if (declared.uploads.length !== slotCount) {
|
|
252735
252820
|
throw new InternalError(`Declared ${slotCount} files but the server signed ${declared.uploads.length} upload URLs.`);
|
|
@@ -252738,12 +252823,18 @@ async function createVersion(artifacts, options = {}) {
|
|
|
252738
252823
|
if (drifted !== -1) {
|
|
252739
252824
|
throw new InternalError(`Upload ${drifted} is signed for ${declared.uploads[drifted].path}, but that slot declared ${declaredFiles[drifted].path}.`);
|
|
252740
252825
|
}
|
|
252826
|
+
const actorDrifted = artifacts.actors.findIndex((actor, index) => declared.uploads[actorsAt + index].path !== actorUploadPath(actor));
|
|
252827
|
+
if (actorDrifted !== -1) {
|
|
252828
|
+
throw new InternalError(`Upload ${actorsAt + actorDrifted} is signed for ${declared.uploads[actorsAt + actorDrifted].path}, but that slot declared the actor ${artifacts.actors[actorDrifted].name}.`);
|
|
252829
|
+
}
|
|
252741
252830
|
let uploadedFiles = 0;
|
|
252742
252831
|
await pMap(declared.uploads, async (upload, index) => {
|
|
252743
252832
|
if (index < declaredFiles.length) {
|
|
252744
252833
|
await putPresigned(upload, declaredFiles[index].absolutePath);
|
|
252745
|
-
} else {
|
|
252834
|
+
} else if (index < actorsAt) {
|
|
252746
252835
|
await putPresignedBody(upload, artifacts.backendBundles[index - declaredFiles.length].module);
|
|
252836
|
+
} else {
|
|
252837
|
+
await putPresignedBody(upload, artifacts.actors[index - actorsAt].module);
|
|
252747
252838
|
}
|
|
252748
252839
|
uploadedFiles++;
|
|
252749
252840
|
options.progress?.onUpload?.({
|
|
@@ -252761,11 +252852,10 @@ async function setEnvironmentVersion(environment, versionId, options = {}) {
|
|
|
252761
252852
|
}
|
|
252762
252853
|
// src/core/version/artifacts.ts
|
|
252763
252854
|
import { createHash as createHash3 } from "node:crypto";
|
|
252764
|
-
import { join as
|
|
252855
|
+
import { join as join30, resolve as resolve14 } from "node:path";
|
|
252765
252856
|
|
|
252766
|
-
// src/core/version/
|
|
252767
|
-
import {
|
|
252768
|
-
import { relative as relative6 } from "node:path";
|
|
252857
|
+
// src/core/version/actors.ts
|
|
252858
|
+
import { dirname as dirname22, relative as relative7, resolve as resolve13 } from "node:path";
|
|
252769
252859
|
|
|
252770
252860
|
// ../functions-compiler/src/assembly.ts
|
|
252771
252861
|
import path17 from "node:path";
|
|
@@ -258299,6 +258389,18 @@ function consolePatch(runtimeSecrets) {
|
|
|
258299
258389
|
return runtimeSecrets ? `${CONSOLE_PATCH}
|
|
258300
258390
|
${RUNTIME_SECRETS_RESERVED_PATCH}` : CONSOLE_PATCH;
|
|
258301
258391
|
}
|
|
258392
|
+
async function prepareFunction(entry, files, postResponseTelemetry = false, runtimeSecrets = false) {
|
|
258393
|
+
assertNoReservedFilenames(files);
|
|
258394
|
+
return {
|
|
258395
|
+
entry: ENTRY_FILENAME,
|
|
258396
|
+
files: {
|
|
258397
|
+
...userFiles(files),
|
|
258398
|
+
...workerRuntimeFiles(),
|
|
258399
|
+
...runtimeSecrets ? { [ACTIVATION_FILENAME]: activationShimSource() } : {},
|
|
258400
|
+
[ENTRY_FILENAME]: buildEntrySource(entry, postResponseTelemetry, runtimeSecrets)
|
|
258401
|
+
}
|
|
258402
|
+
};
|
|
258403
|
+
}
|
|
258302
258404
|
var BANNER_FORMAT = 1;
|
|
258303
258405
|
function buildBanner(entries, telemetry, runtimeSecrets) {
|
|
258304
258406
|
return `//!b44:${BANNER_FORMAT} ${JSON.stringify({
|
|
@@ -258342,6 +258444,50 @@ function activationImport(runtimeSecrets) {
|
|
|
258342
258444
|
return runtimeSecrets ? `
|
|
258343
258445
|
import { ensureActivation, takeActivationChallenge, withoutActivationHeaders } from "./${ACTIVATION_FILENAME}";` : "";
|
|
258344
258446
|
}
|
|
258447
|
+
function buildEntrySource(userEntry, telemetry, runtimeSecrets = false) {
|
|
258448
|
+
const userImport = `./${userEntry.replace(/^\.\//, "")}`;
|
|
258449
|
+
const handlerExpr = telemetry ? "_b44AttachTelemetry(await handler(request, info))" : runtimeSecrets ? "await handler(request, info)" : "handler(request, info)";
|
|
258450
|
+
const guard = activationGuard(runtimeSecrets);
|
|
258451
|
+
const returnExpr = guard(handlerExpr);
|
|
258452
|
+
return `// Auto-generated by the base44 bundler. Do not edit.
|
|
258453
|
+
|
|
258454
|
+
import { currentWorkerRuntimeContext as _b44Context, runWithWorkerEnvironment as _b44Run } from ${JSON.stringify(RUNTIME_CONTEXT_SPECIFIER)};
|
|
258455
|
+
import { getRegisteredHandler, installStaticEgressFetch } from "./${SHIM_FILENAME}";${activationImport(runtimeSecrets)}
|
|
258456
|
+
|
|
258457
|
+
${consolePatch(runtimeSecrets)}
|
|
258458
|
+
// Static egress reads workerEnv from the active request store. Install it
|
|
258459
|
+
// before telemetry so telemetry remains the outermost fetch wrapper.
|
|
258460
|
+
installStaticEgressFetch();
|
|
258461
|
+
${telemetry ? TELEMETRY_PATCH : ""}
|
|
258462
|
+
|
|
258463
|
+
let _b44Init = null;
|
|
258464
|
+
export default {
|
|
258465
|
+
async fetch(request, env, ctx) {
|
|
258466
|
+
${runtimeSecrets ? ACTIVATION_TAKE : ""} const _b44Env = (request.headers.get('base44-functions-version') ?? '') === 'prod' ? 'prod' : 'preview';
|
|
258467
|
+
return _b44Run({ env: _b44Env, secrets: ${runtimeSecrets ? "process.env" : "env"}, workerEnv: env, waitUntil: (p) => ctx.waitUntil(p)${telemetry ? `, ${TELEMETRY_STORE_FIELDS}` : ""} }, async () => {
|
|
258468
|
+
${runtimeSecrets ? ACTIVATION_GATE : ""} if (!_b44Init) _b44Init = import(${JSON.stringify(userImport)}).catch(e => { _b44Init = null; throw e; });
|
|
258469
|
+
const _b44Mod = await _b44Init;
|
|
258470
|
+
// Deno.serve capture wins (legacy contract, zero behavior change);
|
|
258471
|
+
// a default-exported handler is the new-contract fallback.
|
|
258472
|
+
const handler = getRegisteredHandler() ?? (typeof _b44Mod?.default === 'function' ? _b44Mod.default : null);
|
|
258473
|
+
if (!handler) {
|
|
258474
|
+
return ${guard(`new Response(
|
|
258475
|
+
"The function must export default a request handler or call Deno.serve()",
|
|
258476
|
+
{ status: 503 },
|
|
258477
|
+
)`)};
|
|
258478
|
+
}
|
|
258479
|
+
// Deno's handler signature is (request, info). Cloudflare doesn't expose a
|
|
258480
|
+
// connection address the same way; pass a best-effort placeholder. Real
|
|
258481
|
+
// client IP is available via the "cf-connecting-ip" request header.
|
|
258482
|
+
const info = {
|
|
258483
|
+
remoteAddr: { transport: "tcp", hostname: "0.0.0.0", port: 0 },
|
|
258484
|
+
};
|
|
258485
|
+
return ${returnExpr};
|
|
258486
|
+
});
|
|
258487
|
+
},
|
|
258488
|
+
};
|
|
258489
|
+
`;
|
|
258490
|
+
}
|
|
258345
258491
|
function buildFunctionModuleSource(functionName, userEntry) {
|
|
258346
258492
|
const userImport = `./${userEntry.replace(/^\.\//, "")}`;
|
|
258347
258493
|
return `// Auto-generated by the base44 bundler. Do not edit.
|
|
@@ -258644,6 +258790,284 @@ function runtimeContextVirtualPlugin() {
|
|
|
258644
258790
|
};
|
|
258645
258791
|
}
|
|
258646
258792
|
|
|
258793
|
+
// ../functions-compiler/src/actor-compat.ts
|
|
258794
|
+
var ACTOR_ENTRY_FILENAME2 = "__base44_actor_entry.mjs";
|
|
258795
|
+
var ACTOR_PRELUDE_FILENAME = "__base44_actor_prelude.mjs";
|
|
258796
|
+
var ACTOR_AUTH_FILENAME = "__base44_actor_auth.mjs";
|
|
258797
|
+
var ACTORS_PREFIX = "base44/actors/";
|
|
258798
|
+
var ENTRY_SUFFIX = "/entry.ts";
|
|
258799
|
+
function actorNameFromEntry(entry) {
|
|
258800
|
+
if (!entry.startsWith(ACTORS_PREFIX) || !entry.endsWith(ENTRY_SUFFIX))
|
|
258801
|
+
return null;
|
|
258802
|
+
const name = entry.slice(ACTORS_PREFIX.length, -ENTRY_SUFFIX.length);
|
|
258803
|
+
return name && !name.includes("/") ? name : null;
|
|
258804
|
+
}
|
|
258805
|
+
function applyActorCompat(entry, files) {
|
|
258806
|
+
const actorName = actorNameFromEntry(entry);
|
|
258807
|
+
if (!actorName || files[entry] === undefined)
|
|
258808
|
+
return null;
|
|
258809
|
+
assertNoReservedFilenames(files);
|
|
258810
|
+
if (ACTOR_PRELUDE_FILENAME in files) {
|
|
258811
|
+
throw new Error(`Reserved filename "${ACTOR_PRELUDE_FILENAME}" in actor bundle — ` + "it is generated by the bundler. Rename the file.");
|
|
258812
|
+
}
|
|
258813
|
+
if (ACTOR_AUTH_FILENAME in files) {
|
|
258814
|
+
throw new Error(`Reserved filename "${ACTOR_AUTH_FILENAME}" in actor bundle — ` + "it is generated by the bundler. Rename the file.");
|
|
258815
|
+
}
|
|
258816
|
+
const handlerName = actorName;
|
|
258817
|
+
const doClassName = handlerName;
|
|
258818
|
+
const prelude = buildPrelude();
|
|
258819
|
+
const entryWrapper = buildEntryWrapper(doClassName, entry);
|
|
258820
|
+
return {
|
|
258821
|
+
entry: ACTOR_ENTRY_FILENAME2,
|
|
258822
|
+
files: {
|
|
258823
|
+
...files,
|
|
258824
|
+
...workerRuntimeFiles(),
|
|
258825
|
+
[ACTOR_AUTH_FILENAME]: buildActorAuth(),
|
|
258826
|
+
[ACTOR_PRELUDE_FILENAME]: prelude,
|
|
258827
|
+
[ACTOR_ENTRY_FILENAME2]: entryWrapper
|
|
258828
|
+
},
|
|
258829
|
+
handlerName,
|
|
258830
|
+
doClassName
|
|
258831
|
+
};
|
|
258832
|
+
}
|
|
258833
|
+
function buildActorAuth() {
|
|
258834
|
+
return `// Auto-generated by the base44 bundler. Do not edit.
|
|
258835
|
+
const TOKEN_HEADER = "X-Base44-Actor-Token";
|
|
258836
|
+
const IDENTITY_HEADER = "X-Base44-Actor-Identity";
|
|
258837
|
+
const CLOCK_SKEW_SECONDS = 30;
|
|
258838
|
+
const TOKEN_TTL_SECONDS = 300;
|
|
258839
|
+
|
|
258840
|
+
const decodeSegment = (segment) => {
|
|
258841
|
+
const normalized = segment.replace(/-/g, "+").replace(/_/g, "/");
|
|
258842
|
+
const padded = normalized + "=".repeat((4 - normalized.length % 4) % 4);
|
|
258843
|
+
const binary = atob(padded);
|
|
258844
|
+
return new Uint8Array([...binary].map((character) => character.charCodeAt(0)));
|
|
258845
|
+
};
|
|
258846
|
+
|
|
258847
|
+
const decodeJsonSegment = (segment) =>
|
|
258848
|
+
JSON.parse(new TextDecoder().decode(decodeSegment(segment)));
|
|
258849
|
+
|
|
258850
|
+
const unauthorized = () => ({
|
|
258851
|
+
ok: false,
|
|
258852
|
+
response: new Response("Unauthorized", { status: 401 }),
|
|
258853
|
+
});
|
|
258854
|
+
|
|
258855
|
+
const validPrincipal = (principal) => {
|
|
258856
|
+
if (principal === null || typeof principal !== "object" || Array.isArray(principal)) return false;
|
|
258857
|
+
if (principal.type === "authenticated") {
|
|
258858
|
+
return typeof principal.userId === "string" && principal.userId.length > 0 && principal.userId.length <= 128;
|
|
258859
|
+
}
|
|
258860
|
+
if (principal.type === "anonymous") {
|
|
258861
|
+
return typeof principal.anonymousId === "string" && principal.anonymousId.length > 0 && principal.anonymousId.length <= 128;
|
|
258862
|
+
}
|
|
258863
|
+
return false;
|
|
258864
|
+
};
|
|
258865
|
+
|
|
258866
|
+
export async function verifyActorConnection(request, env, actorName, room) {
|
|
258867
|
+
const publicKey = env.BASE44_ACTOR_PUBLIC_KEY;
|
|
258868
|
+
const scriptId = env.BASE44_ACTOR_SCRIPT_ID;
|
|
258869
|
+
const token = request.headers.get(TOKEN_HEADER) ?? new URL(request.url).searchParams.get("token");
|
|
258870
|
+
if (
|
|
258871
|
+
typeof publicKey !== "string" || !publicKey ||
|
|
258872
|
+
typeof scriptId !== "string" || !scriptId ||
|
|
258873
|
+
typeof token !== "string" || token.length > 4096
|
|
258874
|
+
) return unauthorized();
|
|
258875
|
+
|
|
258876
|
+
const parts = token.split(".");
|
|
258877
|
+
if (parts.length !== 3) return unauthorized();
|
|
258878
|
+
try {
|
|
258879
|
+
const header = decodeJsonSegment(parts[0]);
|
|
258880
|
+
const claims = decodeJsonSegment(parts[1]);
|
|
258881
|
+
if (header?.alg !== "EdDSA" || (header.typ !== undefined && header.typ !== "JWT")) {
|
|
258882
|
+
return unauthorized();
|
|
258883
|
+
}
|
|
258884
|
+
const key = await crypto.subtle.importKey(
|
|
258885
|
+
"raw",
|
|
258886
|
+
decodeSegment(publicKey),
|
|
258887
|
+
{ name: "Ed25519" },
|
|
258888
|
+
false,
|
|
258889
|
+
["verify"],
|
|
258890
|
+
);
|
|
258891
|
+
const validSignature = await crypto.subtle.verify(
|
|
258892
|
+
{ name: "Ed25519" },
|
|
258893
|
+
key,
|
|
258894
|
+
decodeSegment(parts[2]),
|
|
258895
|
+
new TextEncoder().encode(parts[0] + "." + parts[1]),
|
|
258896
|
+
);
|
|
258897
|
+
if (!validSignature) return unauthorized();
|
|
258898
|
+
|
|
258899
|
+
const now = Math.floor(Date.now() / 1000);
|
|
258900
|
+
const times = [claims.iat, claims.nbf, claims.exp];
|
|
258901
|
+
if (!times.every(Number.isInteger)) return unauthorized();
|
|
258902
|
+
if (
|
|
258903
|
+
claims.iss !== "base44" ||
|
|
258904
|
+
claims.aud !== "base44-actor-connect" ||
|
|
258905
|
+
claims.purpose !== "actor-connect" ||
|
|
258906
|
+
claims.v !== 1 ||
|
|
258907
|
+
typeof claims.jti !== "string" || !claims.jti || claims.jti.length > 64 ||
|
|
258908
|
+
claims.iat > now + CLOCK_SKEW_SECONDS ||
|
|
258909
|
+
claims.nbf > now + CLOCK_SKEW_SECONDS ||
|
|
258910
|
+
claims.exp < now - CLOCK_SKEW_SECONDS ||
|
|
258911
|
+
claims.exp <= claims.iat || claims.exp - claims.iat > TOKEN_TTL_SECONDS ||
|
|
258912
|
+
claims.app_id !== env.BASE44_APP_ID ||
|
|
258913
|
+
claims.actor_name !== actorName ||
|
|
258914
|
+
claims.actor_script_id !== scriptId ||
|
|
258915
|
+
claims.room !== room ||
|
|
258916
|
+
claims.connection_id !== new URL(request.url).searchParams.get("_pk") ||
|
|
258917
|
+
claims.runtime_mode !== (env.BASE44_FUNCTIONS_VERSION === "prod" ? "prod" : "preview") ||
|
|
258918
|
+
!validPrincipal(claims.principal)
|
|
258919
|
+
) return unauthorized();
|
|
258920
|
+
|
|
258921
|
+
return {
|
|
258922
|
+
ok: true,
|
|
258923
|
+
identity: Object.freeze({ ...claims.principal }),
|
|
258924
|
+
runtimeMode: claims.runtime_mode,
|
|
258925
|
+
};
|
|
258926
|
+
} catch {
|
|
258927
|
+
return unauthorized();
|
|
258928
|
+
}
|
|
258929
|
+
}
|
|
258930
|
+
|
|
258931
|
+
export function authorizedActorRequest(request, identity, actorName, room, runtimeMode) {
|
|
258932
|
+
const url = new URL(request.url);
|
|
258933
|
+
url.searchParams.delete("token");
|
|
258934
|
+
url.pathname = "/parties/" + encodeURIComponent(actorName) + "/" + encodeURIComponent(room);
|
|
258935
|
+
const headers = new Headers(request.headers);
|
|
258936
|
+
headers.delete(TOKEN_HEADER);
|
|
258937
|
+
headers.set(IDENTITY_HEADER, JSON.stringify(identity));
|
|
258938
|
+
headers.set("base44-functions-version", runtimeMode === "prod" ? "prod" : "preview");
|
|
258939
|
+
return new Request(new Request(url.toString(), request), { headers });
|
|
258940
|
+
}
|
|
258941
|
+
`;
|
|
258942
|
+
}
|
|
258943
|
+
function buildPrelude() {
|
|
258944
|
+
return `// Auto-generated by the base44 bundler. Do not edit.
|
|
258945
|
+
import { currentWorkerRuntimeContext as _b44Context } from ${JSON.stringify(RUNTIME_CONTEXT_SPECIFIER)};
|
|
258946
|
+
import { installStaticEgressFetch } from "./${SHIM_FILENAME}";
|
|
258947
|
+
|
|
258948
|
+
${CONSOLE_PATCH}
|
|
258949
|
+
installStaticEgressFetch();
|
|
258950
|
+
`;
|
|
258951
|
+
}
|
|
258952
|
+
function buildEntryWrapper(doClassName, userEntry) {
|
|
258953
|
+
const userImport = `./${userEntry.replace(/^\.\//, "")}`;
|
|
258954
|
+
return `// Auto-generated by the base44 bundler. Do not edit.
|
|
258955
|
+
// The prelude is intentionally the first dependency: it installs the fetch
|
|
258956
|
+
// shim before the user module evaluates while this static default import keeps
|
|
258957
|
+
// missing-default actors as bundle-time errors.
|
|
258958
|
+
import "./${ACTOR_PRELUDE_FILENAME}";
|
|
258959
|
+
import Base44UserActor from ${JSON.stringify(userImport)};
|
|
258960
|
+
import { runWithWorkerEnvironment as _b44Run } from ${JSON.stringify(RUNTIME_CONTEXT_SPECIFIER)};
|
|
258961
|
+
import { authorizedActorRequest as _b44AuthorizedActorRequest, verifyActorConnection as _b44VerifyActorConnection } from "./${ACTOR_AUTH_FILENAME}";
|
|
258962
|
+
|
|
258963
|
+
const _b44ActorState = new WeakMap();
|
|
258964
|
+
const _b44RunWithActorEnvironment = (ctx, env, runtimeEnv, callback) => _b44Run({
|
|
258965
|
+
env: runtimeEnv,
|
|
258966
|
+
secrets: env,
|
|
258967
|
+
workerEnv: env,
|
|
258968
|
+
waitUntil: (promise) => ctx.waitUntil(promise),
|
|
258969
|
+
}, callback);
|
|
258970
|
+
const _b44ConstructActor = (ctx, env, newTarget) => _b44RunWithActorEnvironment(
|
|
258971
|
+
ctx,
|
|
258972
|
+
env,
|
|
258973
|
+
"prod",
|
|
258974
|
+
() => {
|
|
258975
|
+
// A derived constructor may return an explicitly constructed instance.
|
|
258976
|
+
// This keeps the user's constructor and class-field initializers inside the
|
|
258977
|
+
// request-scoped Worker environment without changing the exported subclass.
|
|
258978
|
+
const actor = Reflect.construct(Base44UserActor, [ctx, env], newTarget);
|
|
258979
|
+
_b44ActorState.set(actor, { ctx, env, runtimeEnv: null });
|
|
258980
|
+
return actor;
|
|
258981
|
+
},
|
|
258982
|
+
);
|
|
258983
|
+
const _b44RunActor = (actor, request, callback) => {
|
|
258984
|
+
const state = _b44ActorState.get(actor);
|
|
258985
|
+
const runtimeEnv = request
|
|
258986
|
+
? ((request.headers.get("base44-functions-version") ?? "") === "prod" ? "prod" : "preview")
|
|
258987
|
+
: (state.runtimeEnv ?? "prod");
|
|
258988
|
+
state.runtimeEnv = runtimeEnv;
|
|
258989
|
+
return _b44RunWithActorEnvironment(state.ctx, state.env, runtimeEnv, callback);
|
|
258990
|
+
};
|
|
258991
|
+
|
|
258992
|
+
export class ${doClassName} extends Base44UserActor {
|
|
258993
|
+
// Read by the shim's service-token exchange: the assertion's actor_name claim
|
|
258994
|
+
// selects the verification key on the platform side. A static (not .name) so
|
|
258995
|
+
// minification can't change it.
|
|
258996
|
+
static _b44ActorName = ${JSON.stringify(doClassName)};
|
|
258997
|
+
|
|
258998
|
+
constructor(ctx, env) {
|
|
258999
|
+
return _b44ConstructActor(ctx, env, new.target);
|
|
259000
|
+
}
|
|
259001
|
+
|
|
259002
|
+
fetch(request) {
|
|
259003
|
+
return _b44RunActor(this, request, () => super.fetch(request));
|
|
259004
|
+
}
|
|
259005
|
+
|
|
259006
|
+
onConnect(...args) {
|
|
259007
|
+
return _b44RunActor(this, null, () => super.onConnect(...args));
|
|
259008
|
+
}
|
|
259009
|
+
|
|
259010
|
+
onMessage(...args) {
|
|
259011
|
+
return _b44RunActor(this, null, () => super.onMessage(...args));
|
|
259012
|
+
}
|
|
259013
|
+
|
|
259014
|
+
onClose(...args) {
|
|
259015
|
+
return _b44RunActor(this, null, () => super.onClose(...args));
|
|
259016
|
+
}
|
|
259017
|
+
|
|
259018
|
+
onAlarm(...args) {
|
|
259019
|
+
return _b44RunActor(this, null, () => super.onAlarm(...args));
|
|
259020
|
+
}
|
|
259021
|
+
|
|
259022
|
+
onStart(...args) {
|
|
259023
|
+
return _b44RunActor(this, null, () => super.onStart(...args));
|
|
259024
|
+
}
|
|
259025
|
+
|
|
259026
|
+
onError(...args) {
|
|
259027
|
+
return _b44RunActor(this, null, () => super.onError(...args));
|
|
259028
|
+
}
|
|
259029
|
+
}
|
|
259030
|
+
export default {
|
|
259031
|
+
async fetch(request, env, ctx) {
|
|
259032
|
+
const url = new URL(request.url);
|
|
259033
|
+
const parts = url.pathname.split("/");
|
|
259034
|
+
const direct = parts[1] === "rooms" && parts.length === 3;
|
|
259035
|
+
const legacy = parts[1] === "parties" && parts.length === 4;
|
|
259036
|
+
if (direct || legacy) {
|
|
259037
|
+
// Decode the room: the token was verified against the decoded instance id,
|
|
259038
|
+
// so an escaped room must map to the same Durable Object.
|
|
259039
|
+
const namespace = direct ? "${doClassName}" : parts[2];
|
|
259040
|
+
const encodedRoom = direct ? parts[2] : parts[3];
|
|
259041
|
+
let room;
|
|
259042
|
+
try { room = decodeURIComponent(encodedRoom); } catch { return new Response("Invalid room", { status: 400 }); }
|
|
259043
|
+
let actorRequest = request;
|
|
259044
|
+
if (direct || typeof env.BASE44_ACTOR_PUBLIC_KEY === "string") {
|
|
259045
|
+
const verification = await _b44VerifyActorConnection(request, env, "${doClassName}", room);
|
|
259046
|
+
if (!verification.ok) return verification.response;
|
|
259047
|
+
actorRequest = _b44AuthorizedActorRequest(
|
|
259048
|
+
request,
|
|
259049
|
+
verification.identity,
|
|
259050
|
+
"${doClassName}",
|
|
259051
|
+
room,
|
|
259052
|
+
verification.runtimeMode,
|
|
259053
|
+
);
|
|
259054
|
+
}
|
|
259055
|
+
const doNs = env["${doClassName}"];
|
|
259056
|
+
if (doNs && typeof doNs.idFromName === "function") {
|
|
259057
|
+
const stub = doNs.get(doNs.idFromName(room));
|
|
259058
|
+
const req = new Request(actorRequest);
|
|
259059
|
+
req.headers.set("x-partykit-room", room);
|
|
259060
|
+
req.headers.set("x-partykit-namespace", namespace);
|
|
259061
|
+
return stub.fetch(req);
|
|
259062
|
+
}
|
|
259063
|
+
return new Response("DO binding not found", { status: 503 });
|
|
259064
|
+
}
|
|
259065
|
+
return new Response("Not found", { status: 404 });
|
|
259066
|
+
},
|
|
259067
|
+
};
|
|
259068
|
+
`;
|
|
259069
|
+
}
|
|
259070
|
+
|
|
258647
259071
|
// ../../node_modules/zod/v3/helpers/util.js
|
|
258648
259072
|
var util;
|
|
258649
259073
|
(function(util) {
|
|
@@ -263148,6 +263572,51 @@ function setSpanTags(tags) {
|
|
|
263148
263572
|
// ../functions-compiler/src/bundler.ts
|
|
263149
263573
|
var NORMALIZED_MAIN_MODULE = "_bundled.mjs";
|
|
263150
263574
|
var MAX_PARALLEL_COMPILES = 4;
|
|
263575
|
+
async function bundle(req) {
|
|
263576
|
+
let actor;
|
|
263577
|
+
try {
|
|
263578
|
+
actor = applyActorCompat(req.entry, req.files);
|
|
263579
|
+
} catch (e) {
|
|
263580
|
+
return denoCompatErrorOrThrow(e);
|
|
263581
|
+
}
|
|
263582
|
+
if (actor) {
|
|
263583
|
+
if (req.runtimeSecrets) {
|
|
263584
|
+
return denoCompatErrorOrThrow(new DenoCompatError("runtimeSecrets is not supported for Actor entries: an Actor reads secrets " + "from its Durable Object env, so it must be deployed in binding mode."));
|
|
263585
|
+
}
|
|
263586
|
+
const outcome = await installAndCompile({
|
|
263587
|
+
entry: actor.entry,
|
|
263588
|
+
files: actor.files
|
|
263589
|
+
});
|
|
263590
|
+
if (outcome.ok) {
|
|
263591
|
+
return {
|
|
263592
|
+
ok: true,
|
|
263593
|
+
module: outcome.module,
|
|
263594
|
+
main_module: NORMALIZED_MAIN_MODULE,
|
|
263595
|
+
warnings: outcome.warnings,
|
|
263596
|
+
handler_name: actor.handlerName,
|
|
263597
|
+
do_class_name: actor.doClassName
|
|
263598
|
+
};
|
|
263599
|
+
}
|
|
263600
|
+
return { ok: false, stage: outcome.stage, errors: outcome.errors };
|
|
263601
|
+
}
|
|
263602
|
+
let prepared;
|
|
263603
|
+
try {
|
|
263604
|
+
prepared = await prepareFunction(req.entry, req.files, req.postResponseTelemetry, req.runtimeSecrets);
|
|
263605
|
+
} catch (e) {
|
|
263606
|
+
return denoCompatErrorOrThrow(e);
|
|
263607
|
+
}
|
|
263608
|
+
const outcome = await installAndCompile(prepared);
|
|
263609
|
+
if (outcome.ok) {
|
|
263610
|
+
return {
|
|
263611
|
+
ok: true,
|
|
263612
|
+
module: outcome.module,
|
|
263613
|
+
main_module: NORMALIZED_MAIN_MODULE,
|
|
263614
|
+
warnings: outcome.warnings,
|
|
263615
|
+
...activationField(req.runtimeSecrets ?? false)
|
|
263616
|
+
};
|
|
263617
|
+
}
|
|
263618
|
+
return { ok: false, stage: outcome.stage, errors: outcome.errors };
|
|
263619
|
+
}
|
|
263151
263620
|
function activationField(runtimeSecrets) {
|
|
263152
263621
|
return runtimeSecrets ? { activation: ACTIVATION_MODE } : {};
|
|
263153
263622
|
}
|
|
@@ -263335,6 +263804,16 @@ async function installAndCompile(prepared) {
|
|
|
263335
263804
|
return { ok: false, stage: "esbuild", errors: result.errors };
|
|
263336
263805
|
});
|
|
263337
263806
|
}
|
|
263807
|
+
function denoCompatErrorOrThrow(e) {
|
|
263808
|
+
if (e instanceof DenoCompatError) {
|
|
263809
|
+
return {
|
|
263810
|
+
ok: false,
|
|
263811
|
+
stage: "deno_compat",
|
|
263812
|
+
errors: [denoCompatErrorItem(e)]
|
|
263813
|
+
};
|
|
263814
|
+
}
|
|
263815
|
+
throw e;
|
|
263816
|
+
}
|
|
263338
263817
|
function denoCompatErrorItem(e) {
|
|
263339
263818
|
return { message: e.message, file: e.file };
|
|
263340
263819
|
}
|
|
@@ -263537,6 +264016,8 @@ async function mapWithConcurrency2(items, limit, fn) {
|
|
|
263537
264016
|
return results;
|
|
263538
264017
|
}
|
|
263539
264018
|
// src/core/version/functions.ts
|
|
264019
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
264020
|
+
import { relative as relative6 } from "node:path";
|
|
263540
264021
|
var SHARD_POLICY = {
|
|
263541
264022
|
shardSize: 100,
|
|
263542
264023
|
globalShardSize: 100,
|
|
@@ -263544,11 +264025,11 @@ var SHARD_POLICY = {
|
|
|
263544
264025
|
gzipCapBytes: 9500000
|
|
263545
264026
|
};
|
|
263546
264027
|
var COMPILE_MODES = { runtimeSecrets: false, postResponseTelemetry: false };
|
|
263547
|
-
async function requireCompilerRuntime() {
|
|
264028
|
+
async function requireCompilerRuntime(what = "Backend functions") {
|
|
263548
264029
|
try {
|
|
263549
264030
|
await Promise.all([import("esbuild"), import("@deno/loader")]);
|
|
263550
264031
|
} catch (error) {
|
|
263551
|
-
throw new DependencyNotFoundError(
|
|
264032
|
+
throw new DependencyNotFoundError(`${what} cannot be compiled by this installation of the CLI.`, {
|
|
263552
264033
|
hints: [{ message: "Install the CLI from npm: npm install -g base44" }],
|
|
263553
264034
|
cause: error instanceof Error ? error : undefined
|
|
263554
264035
|
});
|
|
@@ -263605,6 +264086,97 @@ async function compileBackendBundles(root, functionsDir) {
|
|
|
263605
264086
|
});
|
|
263606
264087
|
}
|
|
263607
264088
|
|
|
264089
|
+
// src/core/version/actors.ts
|
|
264090
|
+
var MAX_ACTORS = 50;
|
|
264091
|
+
var COMPILE_CONCURRENCY = 4;
|
|
264092
|
+
var ACTORS_ROOT = "base44/actors";
|
|
264093
|
+
var SHARED_ROOT = "base44/shared";
|
|
264094
|
+
function forwardSlashed(from, to) {
|
|
264095
|
+
return relative7(from, to).split(/[/\\]/).join("/");
|
|
264096
|
+
}
|
|
264097
|
+
async function readSharedFiles2(actorsDir) {
|
|
264098
|
+
const sharedDir = resolve13(actorsDir, "..", "shared");
|
|
264099
|
+
if (!await pathExists(sharedDir)) {
|
|
264100
|
+
return {};
|
|
264101
|
+
}
|
|
264102
|
+
const paths = await globby(BACKEND_FILE_GLOB, {
|
|
264103
|
+
cwd: sharedDir,
|
|
264104
|
+
absolute: true
|
|
264105
|
+
});
|
|
264106
|
+
const files = {};
|
|
264107
|
+
for (const path of paths.sort()) {
|
|
264108
|
+
files[`${SHARED_ROOT}/${forwardSlashed(sharedDir, path)}`] = await readTextFile(path);
|
|
264109
|
+
}
|
|
264110
|
+
return files;
|
|
264111
|
+
}
|
|
264112
|
+
async function compilerInput2(actor, shared) {
|
|
264113
|
+
const actorDir = dirname22(actor.entryPath);
|
|
264114
|
+
const entry = `${ACTORS_ROOT}/${actor.name}/entry.ts`;
|
|
264115
|
+
const source = await readTextFile(actor.entryPath);
|
|
264116
|
+
const candidates = { ...shared };
|
|
264117
|
+
for (const filePath of actor.filePaths) {
|
|
264118
|
+
if (filePath !== actor.entryPath) {
|
|
264119
|
+
candidates[`${ACTORS_ROOT}/${actor.name}/${forwardSlashed(actorDir, filePath)}`] = await readTextFile(filePath);
|
|
264120
|
+
}
|
|
264121
|
+
}
|
|
264122
|
+
candidates[entry] = source;
|
|
264123
|
+
return {
|
|
264124
|
+
entry,
|
|
264125
|
+
files: await collectReachableFiles(entry, candidates),
|
|
264126
|
+
source
|
|
264127
|
+
};
|
|
264128
|
+
}
|
|
264129
|
+
async function compileActors(actorsDir) {
|
|
264130
|
+
const actors = await readAllActors(actorsDir);
|
|
264131
|
+
if (actors.length === 0) {
|
|
264132
|
+
return [];
|
|
264133
|
+
}
|
|
264134
|
+
if (actors.length > MAX_ACTORS) {
|
|
264135
|
+
throw new InvalidInputError(`Too many actors: found ${actors.length}, the limit is ${MAX_ACTORS}.`);
|
|
264136
|
+
}
|
|
264137
|
+
await requireCompilerRuntime("Actors");
|
|
264138
|
+
const shared = await readSharedFiles2(actorsDir);
|
|
264139
|
+
const sorted = [...actors].sort((a, b) => a.name < b.name ? -1 : 1);
|
|
264140
|
+
const compiled = await pMap(sorted, async (actor) => {
|
|
264141
|
+
const input = await compilerInput2(actor, shared);
|
|
264142
|
+
const result = await bundle({ entry: input.entry, files: input.files });
|
|
264143
|
+
return {
|
|
264144
|
+
name: actor.name,
|
|
264145
|
+
entry: input.entry,
|
|
264146
|
+
source: input.source,
|
|
264147
|
+
result
|
|
264148
|
+
};
|
|
264149
|
+
}, { concurrency: COMPILE_CONCURRENCY });
|
|
264150
|
+
const failures = compiled.flatMap(({ name, result }) => result.ok ? [] : [
|
|
264151
|
+
{
|
|
264152
|
+
function: name,
|
|
264153
|
+
message: `Actor "${name}" failed to compile.`,
|
|
264154
|
+
errors: result.errors
|
|
264155
|
+
}
|
|
264156
|
+
]);
|
|
264157
|
+
if (failures.length > 0) {
|
|
264158
|
+
throw new InvalidInputError(`Actors failed to compile (${failures.length} error${failures.length === 1 ? "" : "s"}).`, { details: failures.map(describeFailure) });
|
|
264159
|
+
}
|
|
264160
|
+
return compiled.map(({ name, entry, source, result }) => {
|
|
264161
|
+
const module = new TextEncoder().encode(compiledModule(name, result));
|
|
264162
|
+
return {
|
|
264163
|
+
name,
|
|
264164
|
+
entry,
|
|
264165
|
+
source,
|
|
264166
|
+
module,
|
|
264167
|
+
size: module.byteLength,
|
|
264168
|
+
digest: sha256(module),
|
|
264169
|
+
staticEgress: STATIC_EGRESS_ARTIFACT_MARKER
|
|
264170
|
+
};
|
|
264171
|
+
});
|
|
264172
|
+
}
|
|
264173
|
+
function compiledModule(name, result) {
|
|
264174
|
+
if (!result.ok || result.do_class_name !== name) {
|
|
264175
|
+
throw new InternalError(`Actor "${name}" did not compile as an actor of that name.`);
|
|
264176
|
+
}
|
|
264177
|
+
return result.module;
|
|
264178
|
+
}
|
|
264179
|
+
|
|
263608
264180
|
// src/core/version/publish.ts
|
|
263609
264181
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
263610
264182
|
var DEFAULT_ENVIRONMENT = "production";
|
|
@@ -263657,7 +264229,7 @@ async function collectBuildOutput(outputDir, options = {}) {
|
|
|
263657
264229
|
}
|
|
263658
264230
|
async function describeSiteWorker(built) {
|
|
263659
264231
|
const { config, modules } = built;
|
|
263660
|
-
const entry =
|
|
264232
|
+
const entry = resolve14(config.configDir, config.main);
|
|
263661
264233
|
const main = modules.find((m) => m.absolutePath === entry)?.name;
|
|
263662
264234
|
if (!main) {
|
|
263663
264235
|
throw new InvalidInputError(`The Worker's entry module ${config.main} is not among the ${modules.length} modules collected from ${config.configDir}.`);
|
|
@@ -263688,14 +264260,14 @@ async function readRawResources(dir) {
|
|
|
263688
264260
|
const payloads = {};
|
|
263689
264261
|
for (const relativePath of files.sort()) {
|
|
263690
264262
|
const name = relativePath.replace(/\.jsonc?$/, "");
|
|
263691
|
-
payloads[name] = await readJsonFile(
|
|
264263
|
+
payloads[name] = await readJsonFile(join30(dir, ...relativePath.split("/")));
|
|
263692
264264
|
}
|
|
263693
264265
|
return payloads;
|
|
263694
264266
|
}
|
|
263695
264267
|
async function collectResources(configDir, dirs) {
|
|
263696
264268
|
const [entities, agents] = await Promise.all([
|
|
263697
|
-
readRawResources(
|
|
263698
|
-
readRawResources(
|
|
264269
|
+
readRawResources(join30(configDir, dirs.entitiesDir)),
|
|
264270
|
+
readRawResources(join30(configDir, dirs.agentsDir))
|
|
263699
264271
|
]);
|
|
263700
264272
|
return { entities, agents };
|
|
263701
264273
|
}
|
|
@@ -263707,7 +264279,8 @@ async function collectArtifacts(target) {
|
|
|
263707
264279
|
entryFile: ENTRY2
|
|
263708
264280
|
}),
|
|
263709
264281
|
...siteWorker ? { siteWorker } : {},
|
|
263710
|
-
backendBundles: await tagStep2("build", () => compileBackendBundles(target.root,
|
|
264282
|
+
backendBundles: await tagStep2("build", () => compileBackendBundles(target.root, join30(target.configDir, target.functionsDir))),
|
|
264283
|
+
actors: await tagStep2("build", () => compileActors(join30(target.configDir, target.actorsDir))),
|
|
263711
264284
|
...await collectResources(target.configDir, target)
|
|
263712
264285
|
};
|
|
263713
264286
|
}
|
|
@@ -264165,7 +264738,7 @@ function getSecretsListCommand() {
|
|
|
264165
264738
|
}
|
|
264166
264739
|
|
|
264167
264740
|
// src/cli/commands/secrets/set.ts
|
|
264168
|
-
import { resolve as
|
|
264741
|
+
import { resolve as resolve15 } from "node:path";
|
|
264169
264742
|
function parseEntries(entries) {
|
|
264170
264743
|
const secrets = {};
|
|
264171
264744
|
for (const entry of entries) {
|
|
@@ -264196,7 +264769,7 @@ async function setSecretsAction({ log, runTask }, entries, options) {
|
|
|
264196
264769
|
validateInput(entries, options);
|
|
264197
264770
|
let secrets;
|
|
264198
264771
|
if (options.envFile) {
|
|
264199
|
-
secrets = await parseEnvFile(
|
|
264772
|
+
secrets = await parseEnvFile(resolve15(options.envFile));
|
|
264200
264773
|
if (Object.keys(secrets).length === 0) {
|
|
264201
264774
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
264202
264775
|
}
|
|
@@ -264224,512 +264797,8 @@ function getSecretsCommand() {
|
|
|
264224
264797
|
return new Command2("secrets").description("Manage project secrets (environment variables)").addCommand(getSecretsListCommand()).addCommand(getSecretsSetCommand()).addCommand(getSecretsDeleteCommand());
|
|
264225
264798
|
}
|
|
264226
264799
|
|
|
264227
|
-
// src/cli/commands/session/import.ts
|
|
264228
|
-
var import_ms2 = __toESM(require_ms(), 1);
|
|
264229
|
-
|
|
264230
|
-
// src/core/session-import/transcript.ts
|
|
264231
|
-
import { gzipSync } from "node:zlib";
|
|
264232
|
-
var SESSION_SOURCE_LABELS = {
|
|
264233
|
-
claude_code: "Claude Code",
|
|
264234
|
-
codex: "Codex"
|
|
264235
|
-
};
|
|
264236
|
-
var MAX_TURNS = 120;
|
|
264237
|
-
var MAX_CHARS_PER_TURN = 4000;
|
|
264238
|
-
var MAX_TOTAL_CHARS = 1e5;
|
|
264239
|
-
var TRUNCATION_MARK = " … [truncated]";
|
|
264240
|
-
function parseJsonObject(line) {
|
|
264241
|
-
if (line[0] !== "{")
|
|
264242
|
-
return;
|
|
264243
|
-
try {
|
|
264244
|
-
const parsed = JSON.parse(line);
|
|
264245
|
-
return typeof parsed === "object" && parsed !== null ? parsed : undefined;
|
|
264246
|
-
} catch {
|
|
264247
|
-
return;
|
|
264248
|
-
}
|
|
264249
|
-
}
|
|
264250
|
-
function stringField(object, key) {
|
|
264251
|
-
const value = object[key];
|
|
264252
|
-
return typeof value === "string" && value !== "" ? value : undefined;
|
|
264253
|
-
}
|
|
264254
|
-
function objectField(object, key) {
|
|
264255
|
-
const value = object[key];
|
|
264256
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : undefined;
|
|
264257
|
-
}
|
|
264258
|
-
function contentText(content) {
|
|
264259
|
-
if (typeof content === "string")
|
|
264260
|
-
return content.trim();
|
|
264261
|
-
if (!Array.isArray(content))
|
|
264262
|
-
return "";
|
|
264263
|
-
return content.map((block) => typeof block === "object" && block !== null && typeof block.text === "string" ? block.text : "").filter((text) => text !== "").join(`
|
|
264264
|
-
`).trim();
|
|
264265
|
-
}
|
|
264266
|
-
function conversationTurn(role, content) {
|
|
264267
|
-
const text = contentText(content);
|
|
264268
|
-
return text === "" || text.startsWith("<") || text.startsWith(INTERRUPT_MARKER) ? undefined : { role, text };
|
|
264269
|
-
}
|
|
264270
|
-
var NOT_CONVERSATION_FLAGS = [
|
|
264271
|
-
"isMeta",
|
|
264272
|
-
"isSidechain",
|
|
264273
|
-
"isCompactSummary",
|
|
264274
|
-
"isVisibleInTranscriptOnly",
|
|
264275
|
-
"isApiErrorMessage"
|
|
264276
|
-
];
|
|
264277
|
-
var INTERRUPT_MARKER = "[Request interrupted by user";
|
|
264278
|
-
var SLASH_COMMAND_NAME = /<command-name>([^<]*)<\/command-name>/;
|
|
264279
|
-
var SLASH_COMMAND_ARGS = /<command-args>([^<]*)<\/command-args>/;
|
|
264280
|
-
function slashCommandText(text) {
|
|
264281
|
-
const name = SLASH_COMMAND_NAME.exec(text)?.[1]?.trim();
|
|
264282
|
-
if (!name)
|
|
264283
|
-
return;
|
|
264284
|
-
const args = SLASH_COMMAND_ARGS.exec(text)?.[1]?.trim();
|
|
264285
|
-
return args ? `${name} ${args}` : name;
|
|
264286
|
-
}
|
|
264287
|
-
function claudeTurnFromLine(line) {
|
|
264288
|
-
const type = stringField(line, "type");
|
|
264289
|
-
if (type !== "user" && type !== "assistant")
|
|
264290
|
-
return;
|
|
264291
|
-
if (NOT_CONVERSATION_FLAGS.some((flag) => line[flag] === true)) {
|
|
264292
|
-
return;
|
|
264293
|
-
}
|
|
264294
|
-
const message = objectField(line, "message");
|
|
264295
|
-
if (message?.model === "<synthetic>")
|
|
264296
|
-
return;
|
|
264297
|
-
const content = message?.content;
|
|
264298
|
-
const command = type === "user" ? slashCommandText(contentText(content)) : undefined;
|
|
264299
|
-
return command ? { role: "user", text: command } : conversationTurn(type, content);
|
|
264300
|
-
}
|
|
264301
|
-
var CODEX_INJECTED_USER_ITEM = /^\s*(<(recommended_plugins|environment_context|user_instructions)>|# AGENTS\.md instructions for )/;
|
|
264302
|
-
function codexTurnFromLine(line) {
|
|
264303
|
-
if (stringField(line, "type") !== "response_item")
|
|
264304
|
-
return;
|
|
264305
|
-
const payload = objectField(line, "payload");
|
|
264306
|
-
if (payload === undefined || payload.type !== "message")
|
|
264307
|
-
return;
|
|
264308
|
-
const role = payload.role;
|
|
264309
|
-
if (role !== "user" && role !== "assistant")
|
|
264310
|
-
return;
|
|
264311
|
-
const turn = conversationTurn(role, payload.content);
|
|
264312
|
-
if (turn?.role === "user" && CODEX_INJECTED_USER_ITEM.test(turn.text)) {
|
|
264313
|
-
return;
|
|
264314
|
-
}
|
|
264315
|
-
return turn;
|
|
264316
|
-
}
|
|
264317
|
-
function mergeConsecutiveRoles(turns) {
|
|
264318
|
-
const merged = [];
|
|
264319
|
-
for (const turn of turns) {
|
|
264320
|
-
const last = merged.at(-1);
|
|
264321
|
-
if (last?.role === turn.role) {
|
|
264322
|
-
last.text = `${last.text}
|
|
264323
|
-
|
|
264324
|
-
${turn.text}`;
|
|
264325
|
-
} else {
|
|
264326
|
-
merged.push({ ...turn });
|
|
264327
|
-
}
|
|
264328
|
-
}
|
|
264329
|
-
return merged;
|
|
264330
|
-
}
|
|
264331
|
-
function cut(text, maxChars) {
|
|
264332
|
-
const end = text.charCodeAt(maxChars - 1);
|
|
264333
|
-
return text.slice(0, end >= 55296 && end <= 56319 ? maxChars - 1 : maxChars);
|
|
264334
|
-
}
|
|
264335
|
-
function clip(text, maxChars) {
|
|
264336
|
-
return text.length <= maxChars ? text : cut(text, maxChars - TRUNCATION_MARK.length) + TRUNCATION_MARK;
|
|
264337
|
-
}
|
|
264338
|
-
function prepareTranscript(source) {
|
|
264339
|
-
const merged = mergeConsecutiveRoles(source).map((turn) => ({
|
|
264340
|
-
role: turn.role,
|
|
264341
|
-
text: clip(turn.text, MAX_CHARS_PER_TURN)
|
|
264342
|
-
}));
|
|
264343
|
-
let kept = merged.slice(-MAX_TURNS);
|
|
264344
|
-
let total = kept.reduce((sum, turn) => sum + turn.text.length, 0);
|
|
264345
|
-
while (kept.length > 1 && total > MAX_TOTAL_CHARS) {
|
|
264346
|
-
total -= kept[0]?.text.length ?? 0;
|
|
264347
|
-
kept = kept.slice(1);
|
|
264348
|
-
}
|
|
264349
|
-
const droppedTurns = merged.length - kept.length;
|
|
264350
|
-
const firstUser = kept.findIndex((turn) => turn.role === "user");
|
|
264351
|
-
return {
|
|
264352
|
-
turns: firstUser === -1 ? [] : kept.slice(firstUser),
|
|
264353
|
-
droppedTurns
|
|
264354
|
-
};
|
|
264355
|
-
}
|
|
264356
|
-
function encodeTurns(turns) {
|
|
264357
|
-
return gzipSync(JSON.stringify(turns), { level: 9 }).toString("base64");
|
|
264358
|
-
}
|
|
264359
|
-
|
|
264360
|
-
// src/core/session-import/api.ts
|
|
264361
|
-
var ImportResponseSchema = object({ branch_id: string2().min(1), branch_name: string2().min(1) }).transform((data) => ({
|
|
264362
|
-
branchId: data.branch_id,
|
|
264363
|
-
branchName: data.branch_name
|
|
264364
|
-
}));
|
|
264365
|
-
function withoutTranscript(error) {
|
|
264366
|
-
if (error instanceof HTTPError) {
|
|
264367
|
-
delete error.options.context.__requestBody;
|
|
264368
|
-
}
|
|
264369
|
-
return error;
|
|
264370
|
-
}
|
|
264371
|
-
function withUnavailableHint(error) {
|
|
264372
|
-
if (error.statusCode !== 404)
|
|
264373
|
-
return error;
|
|
264374
|
-
return new ApiError(error.message, {
|
|
264375
|
-
statusCode: error.statusCode,
|
|
264376
|
-
requestUrl: error.requestUrl,
|
|
264377
|
-
requestMethod: error.requestMethod,
|
|
264378
|
-
responseBody: error.responseBody,
|
|
264379
|
-
requestId: error.requestId,
|
|
264380
|
-
details: error.details,
|
|
264381
|
-
hints: [
|
|
264382
|
-
{
|
|
264383
|
-
message: "Session import works on apps imported from a repository, and needs early access on your account. Check the app id."
|
|
264384
|
-
}
|
|
264385
|
-
],
|
|
264386
|
-
cause: error
|
|
264387
|
-
});
|
|
264388
|
-
}
|
|
264389
|
-
async function importSession(params) {
|
|
264390
|
-
let response;
|
|
264391
|
-
try {
|
|
264392
|
-
response = await getAppClient().post("imported/session-imports", {
|
|
264393
|
-
json: {
|
|
264394
|
-
source: params.source,
|
|
264395
|
-
source_session_id: params.sessionId,
|
|
264396
|
-
title: params.title,
|
|
264397
|
-
turns_gzip_base64: encodeTurns(params.turns)
|
|
264398
|
-
},
|
|
264399
|
-
timeout: 60000
|
|
264400
|
-
});
|
|
264401
|
-
} catch (error) {
|
|
264402
|
-
throw withUnavailableHint(await ApiError.fromHttpError(withoutTranscript(error), "importing session"));
|
|
264403
|
-
}
|
|
264404
|
-
const result = ImportResponseSchema.safeParse(await response.json());
|
|
264405
|
-
if (!result.success) {
|
|
264406
|
-
throw new SchemaValidationError("Invalid session import response from server", result.error);
|
|
264407
|
-
}
|
|
264408
|
-
return { ...result.data, created: response.status === 201 };
|
|
264409
|
-
}
|
|
264410
|
-
// src/core/session-import/sessions.ts
|
|
264411
|
-
import { createReadStream as createReadStream3 } from "node:fs";
|
|
264412
|
-
import { readdir as readdir2, realpath, stat as stat4 } from "node:fs/promises";
|
|
264413
|
-
import { homedir as homedir4 } from "node:os";
|
|
264414
|
-
import { join as join32, sep as sep2 } from "node:path";
|
|
264415
|
-
import { createInterface as createInterface2 } from "node:readline";
|
|
264416
|
-
function defaultSessionRoots() {
|
|
264417
|
-
const claudeHome = process.env.CLAUDE_CONFIG_DIR ?? join32(homedir4(), ".claude");
|
|
264418
|
-
return {
|
|
264419
|
-
claudeProjectsDir: join32(claudeHome, "projects"),
|
|
264420
|
-
codexHome: process.env.CODEX_HOME ?? join32(homedir4(), ".codex")
|
|
264421
|
-
};
|
|
264422
|
-
}
|
|
264423
|
-
var CODEX_ROLLOUT_FILE = /^rollout-.*-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/;
|
|
264424
|
-
var MAX_TITLE_CHARS = 80;
|
|
264425
|
-
async function forEachJsonObject(filePath, onObject) {
|
|
264426
|
-
const stream = createReadStream3(filePath, { encoding: "utf8" });
|
|
264427
|
-
const lines = createInterface2({
|
|
264428
|
-
input: stream,
|
|
264429
|
-
crlfDelay: Number.POSITIVE_INFINITY
|
|
264430
|
-
});
|
|
264431
|
-
try {
|
|
264432
|
-
for await (const line of lines) {
|
|
264433
|
-
const object = parseJsonObject(line);
|
|
264434
|
-
if (object && onObject(object) === false)
|
|
264435
|
-
break;
|
|
264436
|
-
}
|
|
264437
|
-
} finally {
|
|
264438
|
-
lines.close();
|
|
264439
|
-
stream.destroy();
|
|
264440
|
-
}
|
|
264441
|
-
}
|
|
264442
|
-
async function listDir(dir) {
|
|
264443
|
-
try {
|
|
264444
|
-
return await readdir2(dir, { withFileTypes: true });
|
|
264445
|
-
} catch {
|
|
264446
|
-
return [];
|
|
264447
|
-
}
|
|
264448
|
-
}
|
|
264449
|
-
async function withMtime(files) {
|
|
264450
|
-
const stamped = await Promise.all(files.map(async (file) => {
|
|
264451
|
-
try {
|
|
264452
|
-
return { ...file, updatedAtMs: (await stat4(file.filePath)).mtimeMs };
|
|
264453
|
-
} catch {
|
|
264454
|
-
return;
|
|
264455
|
-
}
|
|
264456
|
-
}));
|
|
264457
|
-
return stamped.filter((file) => file !== undefined);
|
|
264458
|
-
}
|
|
264459
|
-
function oneLine(text) {
|
|
264460
|
-
const flat = text.replace(/\s+/g, " ").trim();
|
|
264461
|
-
return flat.length <= MAX_TITLE_CHARS ? flat : `${cut(flat, MAX_TITLE_CHARS - 1)}…`;
|
|
264462
|
-
}
|
|
264463
|
-
function claudeAdapter(projectsDir) {
|
|
264464
|
-
return {
|
|
264465
|
-
async files() {
|
|
264466
|
-
const found = [];
|
|
264467
|
-
for (const project of await listDir(projectsDir)) {
|
|
264468
|
-
if (!project.isDirectory())
|
|
264469
|
-
continue;
|
|
264470
|
-
const projectDir = join32(projectsDir, project.name);
|
|
264471
|
-
for (const entry of await listDir(projectDir)) {
|
|
264472
|
-
if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
|
264473
|
-
found.push({
|
|
264474
|
-
source: "claude_code",
|
|
264475
|
-
id: entry.name.slice(0, -".jsonl".length),
|
|
264476
|
-
filePath: join32(projectDir, entry.name)
|
|
264477
|
-
});
|
|
264478
|
-
}
|
|
264479
|
-
}
|
|
264480
|
-
}
|
|
264481
|
-
return withMtime(found);
|
|
264482
|
-
},
|
|
264483
|
-
async head(filePath) {
|
|
264484
|
-
let cwd;
|
|
264485
|
-
await forEachJsonObject(filePath, (line) => {
|
|
264486
|
-
cwd = stringField(line, "cwd");
|
|
264487
|
-
return cwd === undefined;
|
|
264488
|
-
});
|
|
264489
|
-
return { cwd };
|
|
264490
|
-
},
|
|
264491
|
-
async read(file) {
|
|
264492
|
-
const turns = [];
|
|
264493
|
-
let cwd;
|
|
264494
|
-
let customTitle;
|
|
264495
|
-
let aiTitle;
|
|
264496
|
-
let summary;
|
|
264497
|
-
await forEachJsonObject(file.filePath, (line) => {
|
|
264498
|
-
const type = stringField(line, "type");
|
|
264499
|
-
if (type === "custom-title") {
|
|
264500
|
-
customTitle = stringField(line, "customTitle") ?? customTitle;
|
|
264501
|
-
} else if (type === "ai-title") {
|
|
264502
|
-
aiTitle = stringField(line, "aiTitle") ?? aiTitle;
|
|
264503
|
-
} else if (type === "summary") {
|
|
264504
|
-
summary = stringField(line, "summary") ?? summary;
|
|
264505
|
-
} else {
|
|
264506
|
-
cwd ??= stringField(line, "cwd");
|
|
264507
|
-
const turn = claudeTurnFromLine(line);
|
|
264508
|
-
if (turn)
|
|
264509
|
-
turns.push(turn);
|
|
264510
|
-
}
|
|
264511
|
-
return;
|
|
264512
|
-
});
|
|
264513
|
-
return { cwd, title: customTitle ?? aiTitle ?? summary, turns };
|
|
264514
|
-
}
|
|
264515
|
-
};
|
|
264516
|
-
}
|
|
264517
|
-
function codexAdapter(codexHome) {
|
|
264518
|
-
const sessionsDir = join32(codexHome, "sessions");
|
|
264519
|
-
const titleOf = async (id) => {
|
|
264520
|
-
let title;
|
|
264521
|
-
try {
|
|
264522
|
-
await forEachJsonObject(join32(codexHome, "session_index.jsonl"), (line) => {
|
|
264523
|
-
if (stringField(line, "id") === id) {
|
|
264524
|
-
title = stringField(line, "thread_name") ?? title;
|
|
264525
|
-
}
|
|
264526
|
-
return;
|
|
264527
|
-
});
|
|
264528
|
-
} catch {}
|
|
264529
|
-
return title;
|
|
264530
|
-
};
|
|
264531
|
-
return {
|
|
264532
|
-
async files() {
|
|
264533
|
-
const found = [];
|
|
264534
|
-
for (const year of await listDir(sessionsDir)) {
|
|
264535
|
-
for (const month of await listDir(join32(sessionsDir, year.name))) {
|
|
264536
|
-
const monthDir = join32(sessionsDir, year.name, month.name);
|
|
264537
|
-
for (const day of await listDir(monthDir)) {
|
|
264538
|
-
const dayDir = join32(monthDir, day.name);
|
|
264539
|
-
for (const entry of await listDir(dayDir)) {
|
|
264540
|
-
const id = CODEX_ROLLOUT_FILE.exec(entry.name)?.[1];
|
|
264541
|
-
if (id && entry.isFile()) {
|
|
264542
|
-
found.push({
|
|
264543
|
-
source: "codex",
|
|
264544
|
-
id,
|
|
264545
|
-
filePath: join32(dayDir, entry.name)
|
|
264546
|
-
});
|
|
264547
|
-
}
|
|
264548
|
-
}
|
|
264549
|
-
}
|
|
264550
|
-
}
|
|
264551
|
-
}
|
|
264552
|
-
return withMtime(found);
|
|
264553
|
-
},
|
|
264554
|
-
async head(filePath) {
|
|
264555
|
-
const head = {};
|
|
264556
|
-
await forEachJsonObject(filePath, (line) => {
|
|
264557
|
-
const payload = objectField(line, "payload");
|
|
264558
|
-
if (stringField(line, "type") !== "session_meta" || !payload) {
|
|
264559
|
-
return true;
|
|
264560
|
-
}
|
|
264561
|
-
head.cwd = stringField(payload, "cwd");
|
|
264562
|
-
const source = payload.source;
|
|
264563
|
-
head.skip = typeof source !== "string" || source === "exec";
|
|
264564
|
-
return false;
|
|
264565
|
-
});
|
|
264566
|
-
return head;
|
|
264567
|
-
},
|
|
264568
|
-
async read(file) {
|
|
264569
|
-
const turns = [];
|
|
264570
|
-
let cwd;
|
|
264571
|
-
await forEachJsonObject(file.filePath, (line) => {
|
|
264572
|
-
const payload = objectField(line, "payload");
|
|
264573
|
-
if (stringField(line, "type") === "session_meta" && payload) {
|
|
264574
|
-
cwd ??= stringField(payload, "cwd");
|
|
264575
|
-
}
|
|
264576
|
-
const turn = codexTurnFromLine(line);
|
|
264577
|
-
if (turn)
|
|
264578
|
-
turns.push(turn);
|
|
264579
|
-
return;
|
|
264580
|
-
});
|
|
264581
|
-
return { cwd, title: await titleOf(file.id), turns };
|
|
264582
|
-
}
|
|
264583
|
-
};
|
|
264584
|
-
}
|
|
264585
|
-
function adapters(roots) {
|
|
264586
|
-
return [
|
|
264587
|
-
claudeAdapter(roots.claudeProjectsDir),
|
|
264588
|
-
codexAdapter(roots.codexHome)
|
|
264589
|
-
];
|
|
264590
|
-
}
|
|
264591
|
-
async function describe2(adapter, file) {
|
|
264592
|
-
const content = await adapter.read(file);
|
|
264593
|
-
const firstPrompt = content.turns.find((turn) => turn.role === "user")?.text;
|
|
264594
|
-
const title = oneLine(content.title ?? firstPrompt ?? "");
|
|
264595
|
-
if (content.turns.length === 0 || title === "")
|
|
264596
|
-
return;
|
|
264597
|
-
return {
|
|
264598
|
-
session: {
|
|
264599
|
-
source: file.source,
|
|
264600
|
-
id: file.id,
|
|
264601
|
-
title,
|
|
264602
|
-
cwd: content.cwd,
|
|
264603
|
-
filePath: file.filePath,
|
|
264604
|
-
updatedAtMs: file.updatedAtMs
|
|
264605
|
-
},
|
|
264606
|
-
turns: content.turns
|
|
264607
|
-
};
|
|
264608
|
-
}
|
|
264609
|
-
async function isWithin(cwd, dir) {
|
|
264610
|
-
const roots = new Set([dir, await realpath(dir).catch(() => dir)]);
|
|
264611
|
-
const places = new Set([cwd, await realpath(cwd).catch(() => cwd)]);
|
|
264612
|
-
return [...roots].some((root) => [...places].some((place) => place === root || place.startsWith(root + sep2)));
|
|
264613
|
-
}
|
|
264614
|
-
async function listSessions(roots, { within, limit }) {
|
|
264615
|
-
const found = [];
|
|
264616
|
-
const files = (await Promise.all(adapters(roots).map(async (adapter) => (await adapter.files()).map((file) => ({ adapter, file }))))).flat().sort((a, b) => b.file.updatedAtMs - a.file.updatedAtMs);
|
|
264617
|
-
for (const { adapter, file } of files) {
|
|
264618
|
-
if (found.length >= limit)
|
|
264619
|
-
break;
|
|
264620
|
-
const head = await adapter.head(file.filePath).catch(() => ({ skip: true }));
|
|
264621
|
-
if (head.skip)
|
|
264622
|
-
continue;
|
|
264623
|
-
if (within && (!head.cwd || !await isWithin(head.cwd, within)))
|
|
264624
|
-
continue;
|
|
264625
|
-
const described = await describe2(adapter, file).catch(() => {
|
|
264626
|
-
return;
|
|
264627
|
-
});
|
|
264628
|
-
if (described)
|
|
264629
|
-
found.push(described.session);
|
|
264630
|
-
}
|
|
264631
|
-
return found;
|
|
264632
|
-
}
|
|
264633
|
-
async function readSessionById(roots, id) {
|
|
264634
|
-
for (const adapter of adapters(roots)) {
|
|
264635
|
-
const file = (await adapter.files()).find((candidate) => candidate.id === id);
|
|
264636
|
-
if (!file)
|
|
264637
|
-
continue;
|
|
264638
|
-
try {
|
|
264639
|
-
return await describe2(adapter, file);
|
|
264640
|
-
} catch (error) {
|
|
264641
|
-
throw new FileReadError(`Failed to read session file ${file.filePath}: ${error instanceof Error ? error.message : "Unknown error"}`, { cause: error instanceof Error ? error : undefined });
|
|
264642
|
-
}
|
|
264643
|
-
}
|
|
264644
|
-
return;
|
|
264645
|
-
}
|
|
264646
|
-
// src/cli/commands/session/import.ts
|
|
264647
|
-
var PICKER_LIMIT = 30;
|
|
264648
|
-
async function pickSession(all) {
|
|
264649
|
-
const within = all ? undefined : await findGitRoot2() ?? process.cwd();
|
|
264650
|
-
const sessions = await listSessions(defaultSessionRoots(), {
|
|
264651
|
-
within,
|
|
264652
|
-
limit: PICKER_LIMIT
|
|
264653
|
-
});
|
|
264654
|
-
if (sessions.length === 0) {
|
|
264655
|
-
throw new InvalidInputError(all ? "No Claude Code or Codex sessions found on this machine." : "No Claude Code or Codex sessions found for this repository. Pass --all to list sessions from every directory, or --session <id>.");
|
|
264656
|
-
}
|
|
264657
|
-
const choice = await Je({
|
|
264658
|
-
message: "Which session do you want to continue in Base Code?",
|
|
264659
|
-
options: sessions.map((session) => ({
|
|
264660
|
-
value: session,
|
|
264661
|
-
label: session.title,
|
|
264662
|
-
hint: `${SESSION_SOURCE_LABELS[session.source]}, ${import_ms2.default(Date.now() - session.updatedAtMs)} ago`
|
|
264663
|
-
}))
|
|
264664
|
-
});
|
|
264665
|
-
if (Ct(choice)) {
|
|
264666
|
-
Ne("Operation cancelled.");
|
|
264667
|
-
throw new CLIExitError(0);
|
|
264668
|
-
}
|
|
264669
|
-
return choice.id;
|
|
264670
|
-
}
|
|
264671
|
-
async function importSessionAction(ctx, options) {
|
|
264672
|
-
const { log, runTask, jsonMode } = ctx;
|
|
264673
|
-
const interactive = !ctx.isNonInteractive && !jsonMode;
|
|
264674
|
-
const appId = requireApp(ctx).id;
|
|
264675
|
-
if (!options.session && !interactive) {
|
|
264676
|
-
throw new InvalidInputError("--session <id> is required in non-interactive mode");
|
|
264677
|
-
}
|
|
264678
|
-
const sessionId = options.session ?? await pickSession(options.all);
|
|
264679
|
-
const found = await runTask("Reading session", () => readSessionById(defaultSessionRoots(), sessionId));
|
|
264680
|
-
if (!found) {
|
|
264681
|
-
throw new InvalidInputError(`No Claude Code or Codex session with id "${sessionId}" was found on this machine.`);
|
|
264682
|
-
}
|
|
264683
|
-
const { session } = found;
|
|
264684
|
-
const { turns, droppedTurns } = prepareTranscript(found.turns);
|
|
264685
|
-
if (turns.length === 0) {
|
|
264686
|
-
throw new InvalidInputError("This session has no conversation text to import.");
|
|
264687
|
-
}
|
|
264688
|
-
if (droppedTurns > 0) {
|
|
264689
|
-
log.info(`Sending the latest ${turns.length} messages; ${droppedTurns} older ones exceed the size limit.`);
|
|
264690
|
-
}
|
|
264691
|
-
const confirmed = await confirmPush({
|
|
264692
|
-
isNonInteractive: !interactive,
|
|
264693
|
-
yes: options.yes,
|
|
264694
|
-
log,
|
|
264695
|
-
warning: `This uploads the ${turns.length} messages of "${session.title}" to your Base44 app. Only text goes up; tool calls and their output stay on this machine.`
|
|
264696
|
-
});
|
|
264697
|
-
if (!confirmed) {
|
|
264698
|
-
return { outroMessage: "Import cancelled" };
|
|
264699
|
-
}
|
|
264700
|
-
const imported = await runTask("Importing session", () => importSession({
|
|
264701
|
-
source: session.source,
|
|
264702
|
-
sessionId: session.id,
|
|
264703
|
-
title: session.title,
|
|
264704
|
-
turns
|
|
264705
|
-
}));
|
|
264706
|
-
const url = getBaseCodeUrl(appId, imported.branchName);
|
|
264707
|
-
const result = {
|
|
264708
|
-
branchId: imported.branchId,
|
|
264709
|
-
branchName: imported.branchName,
|
|
264710
|
-
url,
|
|
264711
|
-
created: imported.created,
|
|
264712
|
-
source: session.source,
|
|
264713
|
-
sessionId: session.id,
|
|
264714
|
-
messageCount: turns.length
|
|
264715
|
-
};
|
|
264716
|
-
return {
|
|
264717
|
-
outroMessage: `${imported.created ? "Imported into" : "Already imported into"} branch ${theme.styles.bold(imported.branchName)}
|
|
264718
|
-
${theme.colors.links(url)}`,
|
|
264719
|
-
stdout: jsonMode ? toJsonStdout(result) : undefined
|
|
264720
|
-
};
|
|
264721
|
-
}
|
|
264722
|
-
function getSessionImportCommand() {
|
|
264723
|
-
return new Base44Command("import").description("Continue a local Claude Code or Codex session in a Base Code branch").option("--session <id>", "Session id to import (skips the picker)").option("--all", "List sessions from every directory, not just this repository").option("-y, --yes", "Skip the confirmation prompt").action(importSessionAction);
|
|
264724
|
-
}
|
|
264725
|
-
|
|
264726
|
-
// src/cli/commands/session/index.ts
|
|
264727
|
-
function getSessionCommand() {
|
|
264728
|
-
return new Command2("session").description("Move local coding-agent sessions into Base44 (experimental)").addCommand(getSessionImportCommand());
|
|
264729
|
-
}
|
|
264730
|
-
|
|
264731
264800
|
// src/cli/commands/site/deploy.ts
|
|
264732
|
-
import { resolve as
|
|
264801
|
+
import { resolve as resolve16 } from "node:path";
|
|
264733
264802
|
async function deployAction2(ctx, options) {
|
|
264734
264803
|
const { isNonInteractive } = ctx;
|
|
264735
264804
|
if (isNonInteractive && !options.yes) {
|
|
@@ -264746,17 +264815,18 @@ async function deployAction2(ctx, options) {
|
|
|
264746
264815
|
return { outroMessage: "Deployment cancelled" };
|
|
264747
264816
|
}
|
|
264748
264817
|
}
|
|
264749
|
-
return
|
|
264818
|
+
return deployToDeploymentsApi(ctx, project, options);
|
|
264750
264819
|
}
|
|
264751
264820
|
async function deployToDeploymentsApi(ctx, project, options) {
|
|
264752
264821
|
const { runTask, log, jsonMode } = ctx;
|
|
264753
264822
|
const projectRoot = project.root;
|
|
264823
|
+
const outputDir = siteOutputDir(project);
|
|
264754
264824
|
const gitHash = await resolveGitHash(projectRoot, options.gitHash);
|
|
264755
264825
|
const progressLines = [];
|
|
264756
264826
|
const warnings = [];
|
|
264757
264827
|
const { deploymentId } = await runTask("Deploying site...", async (updateMessage) => await deployToDeployments({
|
|
264758
264828
|
projectRoot,
|
|
264759
|
-
outputDir
|
|
264829
|
+
outputDir,
|
|
264760
264830
|
gitHash,
|
|
264761
264831
|
concurrency: options.concurrency,
|
|
264762
264832
|
progress: {
|
|
@@ -264782,33 +264852,24 @@ async function deployToDeploymentsApi(ctx, project, options) {
|
|
|
264782
264852
|
for (const warning of warnings) {
|
|
264783
264853
|
log.warn(warning);
|
|
264784
264854
|
}
|
|
264855
|
+
const published = options.publish ? await runTask("Publishing site...", async () => await publishDeployment(gitHash), { successMessage: "Site published", errorMessage: "Publish failed" }) : undefined;
|
|
264856
|
+
if (published) {
|
|
264857
|
+
log.message(`${theme.styles.header("App URL")}: ${theme.colors.links(published.appUrl)}`);
|
|
264858
|
+
}
|
|
264785
264859
|
return {
|
|
264786
264860
|
outroMessage: `Deployment ${deploymentId} (commit ${gitHash.slice(0, 12)})`,
|
|
264787
|
-
stdout: jsonMode ? `${JSON.stringify({ deploymentId, gitHash }, null, 2)}
|
|
264861
|
+
stdout: jsonMode ? `${JSON.stringify({ deploymentId, gitHash, published: Boolean(published) }, null, 2)}
|
|
264788
264862
|
` : undefined
|
|
264789
264863
|
};
|
|
264790
264864
|
}
|
|
264791
|
-
async function deployTarball({ runTask }, project) {
|
|
264792
|
-
const outputDir = siteOutputDir(project);
|
|
264793
|
-
const { appUrl } = await runTask("Creating archive and deploying site...", async () => await deploySite(outputDir), {
|
|
264794
|
-
successMessage: "Site deployed successfully",
|
|
264795
|
-
errorMessage: "Deployment failed"
|
|
264796
|
-
});
|
|
264797
|
-
return { outroMessage: `Visit your site at: ${appUrl}` };
|
|
264798
|
-
}
|
|
264799
264865
|
function siteOutputDir(project) {
|
|
264800
264866
|
const { outputDirectory = DEFAULT_SITE.outputDirectory } = siteOrDefault(project);
|
|
264801
|
-
return
|
|
264867
|
+
return resolve16(project.root, outputDirectory);
|
|
264802
264868
|
}
|
|
264803
264869
|
function getSiteDeployCommand() {
|
|
264804
|
-
|
|
264805
|
-
if (deploymentsApiEnabled()) {
|
|
264806
|
-
command.addOption(new Option2("--git-hash <hash>", "Commit the build came from (defaults to the checkout's HEAD)").argParser(parseGitHash));
|
|
264807
|
-
command.addOption(new Option2("--concurrency <n>", "Parallel asset uploads").default(DEFAULT_UPLOAD_CONCURRENCY).argParser(parseConcurrency));
|
|
264808
|
-
}
|
|
264809
|
-
return command.action(deployAction2);
|
|
264870
|
+
return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").option("--build", "Build the site before deploying (skips the prompt)").option("--no-build", "Deploy without building (skips the prompt)").option("--publish", "Serve this build in production once it is deployed").addOption(new Option2("--git-hash <hash>", "Commit the build came from (defaults to the checkout's HEAD)").argParser(parseGitHash2)).addOption(new Option2("--concurrency <n>", "Parallel asset uploads").default(DEFAULT_UPLOAD_CONCURRENCY).argParser(parseConcurrency)).action(deployAction2);
|
|
264810
264871
|
}
|
|
264811
|
-
function
|
|
264872
|
+
function parseGitHash2(value) {
|
|
264812
264873
|
if (!isGitCommitHash(value)) {
|
|
264813
264874
|
throw new InvalidArgumentError2("Expected a git commit hash (7-64 hex chars).");
|
|
264814
264875
|
}
|
|
@@ -265142,10 +265203,10 @@ function toPascalCase(name) {
|
|
|
265142
265203
|
return name.split(/[-_\s]+/).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
|
|
265143
265204
|
}
|
|
265144
265205
|
// src/core/types/update-project.ts
|
|
265145
|
-
import { join as
|
|
265206
|
+
import { join as join34 } from "node:path";
|
|
265146
265207
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
265147
265208
|
async function updateProjectConfig(projectRoot) {
|
|
265148
|
-
const tsconfigPath =
|
|
265209
|
+
const tsconfigPath = join34(projectRoot, "tsconfig.json");
|
|
265149
265210
|
if (!await pathExists(tsconfigPath)) {
|
|
265150
265211
|
return false;
|
|
265151
265212
|
}
|
|
@@ -265626,7 +265687,7 @@ function getWorkspaceCommand() {
|
|
|
265626
265687
|
// src/cli/dev/dev-server/main.ts
|
|
265627
265688
|
var import_cors = __toESM(require_lib4(), 1);
|
|
265628
265689
|
var import_express6 = __toESM(require_express(), 1);
|
|
265629
|
-
import { dirname as dirname28, join as
|
|
265690
|
+
import { dirname as dirname28, join as join39 } from "node:path";
|
|
265630
265691
|
|
|
265631
265692
|
// ../../node_modules/get-port/index.js
|
|
265632
265693
|
import net from "node:net";
|
|
@@ -265756,7 +265817,7 @@ var $tmpName = promisify12(tmp.tmpName);
|
|
|
265756
265817
|
|
|
265757
265818
|
// src/cli/dev/dev-server/function-manager.ts
|
|
265758
265819
|
import { spawn as spawn3 } from "node:child_process";
|
|
265759
|
-
import { dirname as dirname25, join as
|
|
265820
|
+
import { dirname as dirname25, join as join35 } from "node:path";
|
|
265760
265821
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
265761
265822
|
|
|
265762
265823
|
// src/cli/dev/dev-server/base-function-manager.ts
|
|
@@ -265861,7 +265922,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
265861
265922
|
}
|
|
265862
265923
|
spawnFunction(func, port) {
|
|
265863
265924
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
265864
|
-
const importMapPath =
|
|
265925
|
+
const importMapPath = join35(dirname25(this.wrapperPath), "import-map.json");
|
|
265865
265926
|
const process2 = spawn3("deno", ["run", "--allow-all", "--import-map", importMapPath, this.wrapperPath], {
|
|
265866
265927
|
env: {
|
|
265867
265928
|
...globalThis.process.env,
|
|
@@ -265934,8 +265995,8 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
265934
265995
|
// src/cli/dev/dev-server/function-bundler.ts
|
|
265935
265996
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
265936
265997
|
import { isBuiltin as isBuiltin3 } from "node:module";
|
|
265937
|
-
import { homedir as
|
|
265938
|
-
import { join as
|
|
265998
|
+
import { homedir as homedir4 } from "node:os";
|
|
265999
|
+
import { join as join36 } from "node:path";
|
|
265939
266000
|
import { pathToFileURL as pathToFileURL7 } from "node:url";
|
|
265940
266001
|
var depsPromise;
|
|
265941
266002
|
function loadDeps() {
|
|
@@ -266056,9 +266117,9 @@ export default {
|
|
|
266056
266117
|
};
|
|
266057
266118
|
`;
|
|
266058
266119
|
function ensureBundlerConfig() {
|
|
266059
|
-
const dir =
|
|
266120
|
+
const dir = join36(homedir4(), ".base44", "function-bundler");
|
|
266060
266121
|
mkdirSync2(dir, { recursive: true });
|
|
266061
|
-
const configPath =
|
|
266122
|
+
const configPath = join36(dir, "deno.json");
|
|
266062
266123
|
writeFileSync2(configPath, `${JSON.stringify({ nodeModulesDir: "auto" }, null, 2)}
|
|
266063
266124
|
`);
|
|
266064
266125
|
return configPath;
|
|
@@ -267590,16 +267651,16 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
|
267590
267651
|
|
|
267591
267652
|
// src/cli/dev/dev-server/watcher.ts
|
|
267592
267653
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
267593
|
-
import { relative as
|
|
267654
|
+
import { relative as relative11 } from "node:path";
|
|
267594
267655
|
|
|
267595
267656
|
// ../../node_modules/chokidar/index.js
|
|
267596
267657
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
267597
267658
|
import { stat as statcb, Stats } from "node:fs";
|
|
267598
|
-
import { readdir as
|
|
267659
|
+
import { readdir as readdir3, stat as stat7 } from "node:fs/promises";
|
|
267599
267660
|
import * as sp3 from "node:path";
|
|
267600
267661
|
|
|
267601
267662
|
// ../../node_modules/readdirp/index.js
|
|
267602
|
-
import { lstat as lstat2, readdir as
|
|
267663
|
+
import { lstat as lstat2, readdir as readdir2, realpath, stat as stat5 } from "node:fs/promises";
|
|
267603
267664
|
import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "node:path";
|
|
267604
267665
|
import { Readable as Readable6 } from "node:stream";
|
|
267605
267666
|
var EntryTypes = {
|
|
@@ -267681,7 +267742,7 @@ class ReaddirpStream extends Readable6 {
|
|
|
267681
267742
|
const { root, type } = opts;
|
|
267682
267743
|
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
267683
267744
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
267684
|
-
const statMethod = opts.lstat ? lstat2 :
|
|
267745
|
+
const statMethod = opts.lstat ? lstat2 : stat5;
|
|
267685
267746
|
if (wantBigintFsStats) {
|
|
267686
267747
|
this._stat = (path) => statMethod(path, { bigint: true });
|
|
267687
267748
|
} else {
|
|
@@ -267752,7 +267813,7 @@ class ReaddirpStream extends Readable6 {
|
|
|
267752
267813
|
async _exploreDir(path, depth) {
|
|
267753
267814
|
let files;
|
|
267754
267815
|
try {
|
|
267755
|
-
files = await
|
|
267816
|
+
files = await readdir2(path, this._rdOptions);
|
|
267756
267817
|
} catch (error) {
|
|
267757
267818
|
this._onError(error);
|
|
267758
267819
|
}
|
|
@@ -267790,7 +267851,7 @@ class ReaddirpStream extends Readable6 {
|
|
|
267790
267851
|
if (stats && stats.isSymbolicLink()) {
|
|
267791
267852
|
const full = entry.fullPath;
|
|
267792
267853
|
try {
|
|
267793
|
-
const entryRealPath = await
|
|
267854
|
+
const entryRealPath = await realpath(full);
|
|
267794
267855
|
const entryRealPathStats = await lstat2(entryRealPath);
|
|
267795
267856
|
if (entryRealPathStats.isFile()) {
|
|
267796
267857
|
return "file";
|
|
@@ -267834,7 +267895,7 @@ function readdirp(root, options = {}) {
|
|
|
267834
267895
|
|
|
267835
267896
|
// ../../node_modules/chokidar/handler.js
|
|
267836
267897
|
import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
|
|
267837
|
-
import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as
|
|
267898
|
+
import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat6 } from "node:fs/promises";
|
|
267838
267899
|
import { type as osType } from "node:os";
|
|
267839
267900
|
import * as sp2 from "node:path";
|
|
267840
267901
|
var STR_DATA = "data";
|
|
@@ -267860,7 +267921,7 @@ var EVENTS = {
|
|
|
267860
267921
|
};
|
|
267861
267922
|
var EV = EVENTS;
|
|
267862
267923
|
var THROTTLE_MODE_WATCH = "watch";
|
|
267863
|
-
var statMethods = { lstat: lstat3, stat:
|
|
267924
|
+
var statMethods = { lstat: lstat3, stat: stat6 };
|
|
267864
267925
|
var KEY_LISTENERS = "listeners";
|
|
267865
267926
|
var KEY_ERR = "errHandlers";
|
|
267866
267927
|
var KEY_RAW = "rawEmitters";
|
|
@@ -268331,7 +268392,7 @@ class NodeFsHandler {
|
|
|
268331
268392
|
return;
|
|
268332
268393
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
268333
268394
|
try {
|
|
268334
|
-
const newStats = await
|
|
268395
|
+
const newStats = await stat6(file);
|
|
268335
268396
|
if (this.fsw.closed)
|
|
268336
268397
|
return;
|
|
268337
268398
|
const at = newStats.atimeMs;
|
|
@@ -268679,7 +268740,7 @@ class DirEntry {
|
|
|
268679
268740
|
return;
|
|
268680
268741
|
const dir = this.path;
|
|
268681
268742
|
try {
|
|
268682
|
-
await
|
|
268743
|
+
await readdir3(dir);
|
|
268683
268744
|
} catch (err) {
|
|
268684
268745
|
if (this._removeWatcher) {
|
|
268685
268746
|
this._removeWatcher(sp3.dirname(dir), sp3.basename(dir));
|
|
@@ -269003,7 +269064,7 @@ class FSWatcher extends EventEmitter3 {
|
|
|
269003
269064
|
const fullPath = opts.cwd ? sp3.join(opts.cwd, path) : path;
|
|
269004
269065
|
let stats;
|
|
269005
269066
|
try {
|
|
269006
|
-
stats = await
|
|
269067
|
+
stats = await stat7(fullPath);
|
|
269007
269068
|
} catch (err) {}
|
|
269008
269069
|
if (!stats || this.closed)
|
|
269009
269070
|
return;
|
|
@@ -269275,7 +269336,7 @@ class WatchBase44 extends EventEmitter4 {
|
|
|
269275
269336
|
ignoreInitial: true
|
|
269276
269337
|
});
|
|
269277
269338
|
watcher.on("all", import_debounce.default(async (_event, path) => {
|
|
269278
|
-
this.emit("change", name,
|
|
269339
|
+
this.emit("change", name, relative11(targetPath, path));
|
|
269279
269340
|
}, WATCH_DEBOUNCE_MS));
|
|
269280
269341
|
watcher.on("error", (err) => {
|
|
269281
269342
|
this.logger.error(`Watch handler failed for ${targetPath}`, err);
|
|
@@ -269387,8 +269448,8 @@ async function createDevServer(options) {
|
|
|
269387
269448
|
broadcastEntityEvent(io, appId, entityName, event);
|
|
269388
269449
|
};
|
|
269389
269450
|
const base44ConfigWatcher = new WatchBase44({
|
|
269390
|
-
functions:
|
|
269391
|
-
entities:
|
|
269451
|
+
functions: join39(dirname28(project.configPath), project.functionsDir),
|
|
269452
|
+
entities: join39(dirname28(project.configPath), project.entitiesDir)
|
|
269392
269453
|
}, devLogger);
|
|
269393
269454
|
base44ConfigWatcher.on("change", async (name) => {
|
|
269394
269455
|
try {
|
|
@@ -269591,7 +269652,7 @@ function readExecEnvTarget(env = process.env) {
|
|
|
269591
269652
|
// src/core/exec/run-script.ts
|
|
269592
269653
|
import { spawn as spawn4 } from "node:child_process";
|
|
269593
269654
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
269594
|
-
import { join as
|
|
269655
|
+
import { join as join40 } from "node:path";
|
|
269595
269656
|
var SDK_SPECIFIER = '"npm:@base44/sdk"';
|
|
269596
269657
|
function wrapperSource(sdkVersion) {
|
|
269597
269658
|
const source = readFileSync4(getExecWrapperPath(), "utf-8");
|
|
@@ -269627,7 +269688,7 @@ async function runScript(options) {
|
|
|
269627
269688
|
writeFileSync3(tempWrapper.path, wrapperSource(sdkVersion), "utf-8");
|
|
269628
269689
|
const configDir = await $dir({ unsafeCleanup: true });
|
|
269629
269690
|
cleanupFns.push(configDir.cleanup);
|
|
269630
|
-
const configPath =
|
|
269691
|
+
const configPath = join40(configDir.path, "deno.json");
|
|
269631
269692
|
writeFileSync3(configPath, JSON.stringify(DENO_CONFIG), "utf-8");
|
|
269632
269693
|
try {
|
|
269633
269694
|
const exitCode = await new Promise((resolvePromise) => {
|
|
@@ -269748,7 +269809,7 @@ Examples:
|
|
|
269748
269809
|
}
|
|
269749
269810
|
|
|
269750
269811
|
// src/cli/commands/project/eject.ts
|
|
269751
|
-
import { resolve as
|
|
269812
|
+
import { resolve as resolve20 } from "node:path";
|
|
269752
269813
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
269753
269814
|
async function eject(ctx, options, command) {
|
|
269754
269815
|
const { log, runTask, isNonInteractive } = ctx;
|
|
@@ -269812,7 +269873,7 @@ async function eject(ctx, options, command) {
|
|
|
269812
269873
|
Ne("Operation cancelled.");
|
|
269813
269874
|
throw new CLIExitError(0);
|
|
269814
269875
|
}
|
|
269815
|
-
const resolvedPath =
|
|
269876
|
+
const resolvedPath = resolve20(selectedPath);
|
|
269816
269877
|
await runTask("Downloading your project's code...", async (updateMessage) => {
|
|
269817
269878
|
await createProjectFilesForExistingProject({
|
|
269818
269879
|
projectId,
|
|
@@ -269899,7 +269960,6 @@ function createProgram(context) {
|
|
|
269899
269960
|
program.addCommand(getSecretsCommand());
|
|
269900
269961
|
program.addCommand(getSandboxCommand());
|
|
269901
269962
|
program.addCommand(getBranchesCommand());
|
|
269902
|
-
program.addCommand(getSessionCommand(), { hidden: true });
|
|
269903
269963
|
program.addCommand(getApiCommand());
|
|
269904
269964
|
program.addCommand(getAuthCommand());
|
|
269905
269965
|
program.addCommand(getSiteCommand());
|
|
@@ -269919,7 +269979,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
269919
269979
|
import { release, type } from "node:os";
|
|
269920
269980
|
|
|
269921
269981
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
269922
|
-
import { dirname as dirname29, posix, sep as
|
|
269982
|
+
import { dirname as dirname29, posix, sep as sep2 } from "path";
|
|
269923
269983
|
function createModulerModifier() {
|
|
269924
269984
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
269925
269985
|
return async (frames) => {
|
|
@@ -269928,7 +269988,7 @@ function createModulerModifier() {
|
|
|
269928
269988
|
return frames;
|
|
269929
269989
|
};
|
|
269930
269990
|
}
|
|
269931
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname29(process.argv[1]) : process.cwd(), isWindows =
|
|
269991
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname29(process.argv[1]) : process.cwd(), isWindows = sep2 === "\\") {
|
|
269932
269992
|
const normalizedBase = isWindows ? normalizeWindowsPath2(basePath) : basePath;
|
|
269933
269993
|
return (filename) => {
|
|
269934
269994
|
if (!filename)
|
|
@@ -271963,8 +272023,8 @@ class ReduceableCache {
|
|
|
271963
272023
|
}
|
|
271964
272024
|
}
|
|
271965
272025
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs
|
|
271966
|
-
import { createReadStream as
|
|
271967
|
-
import { createInterface as
|
|
272026
|
+
import { createReadStream as createReadStream3 } from "node:fs";
|
|
272027
|
+
import { createInterface as createInterface2 } from "node:readline";
|
|
271968
272028
|
var LRU_FILE_CONTENTS_CACHE = new ReduceableCache(25);
|
|
271969
272029
|
var LRU_FILE_CONTENTS_FS_READ_FAILED = new ReduceableCache(20);
|
|
271970
272030
|
var DEFAULT_LINES_OF_CONTEXT = 7;
|
|
@@ -272007,8 +272067,8 @@ async function addSourceContext(frames) {
|
|
|
272007
272067
|
}
|
|
272008
272068
|
function getContextLinesFromFile(path, ranges, output) {
|
|
272009
272069
|
return new Promise((resolve) => {
|
|
272010
|
-
const stream =
|
|
272011
|
-
const lineReaded =
|
|
272070
|
+
const stream = createReadStream3(path);
|
|
272071
|
+
const lineReaded = createInterface2({
|
|
272012
272072
|
input: stream
|
|
272013
272073
|
});
|
|
272014
272074
|
function destroyStreamAndResolve() {
|
|
@@ -273919,7 +273979,7 @@ function addCommandInfoToErrorReporter(program, errorReporter) {
|
|
|
273919
273979
|
// src/cli/index.ts
|
|
273920
273980
|
var __dirname4 = dirname30(fileURLToPath7(import.meta.url));
|
|
273921
273981
|
async function runCLI(options) {
|
|
273922
|
-
ensureNpmAssets(
|
|
273982
|
+
ensureNpmAssets(join41(__dirname4, "../assets"));
|
|
273923
273983
|
const errorReporter = new ErrorReporter;
|
|
273924
273984
|
errorReporter.registerProcessErrorHandlers();
|
|
273925
273985
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -273958,4 +274018,4 @@ export {
|
|
|
273958
274018
|
runCLI
|
|
273959
274019
|
};
|
|
273960
274020
|
|
|
273961
|
-
//# debugId=
|
|
274021
|
+
//# debugId=32AD23ED17452F4764756E2164756E21
|