@base44-preview/cli 0.1.32-pr.665.9dd49bd → 0.1.32-pr.666.ebaf096
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 +628 -619
- package/dist/cli/index.js.map +16 -13
- 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" ? join33(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 join33(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: join33,
|
|
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\\`") : ms3(r) : r);
|
|
37923
37923
|
}
|
|
37924
|
-
function
|
|
37924
|
+
function ms3(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 = ms3(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 ms4(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 = "";ms4(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)\\()?", ms5 = "-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(ms5 + zt4 + "?([^,{]*)", "gim");
|
|
47441
47441
|
er4 = Qi4 + zt4 + "?([^{]*)";
|
|
47442
47442
|
Kr2 = new RegExp(`${Yi4}(${er4})`, "gim");
|
|
47443
|
-
tr4 =
|
|
47443
|
+
tr4 = ms5 + "-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 = ms6(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, ms6, 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
|
+
ms6 = 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 ms7(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: () => ms7, 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: () => ms8,
|
|
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, ms8, 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: () => ms8, 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
|
+
ms8 = [{ 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, ms9, 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
|
+
ms9 = 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: ms9(), 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, join35, 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: join35,
|
|
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 join43 } from "node:path";
|
|
228842
228842
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
228843
228843
|
|
|
228844
228844
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -246837,10 +246837,21 @@ var {
|
|
|
246837
246837
|
} = getIpcExport();
|
|
246838
246838
|
|
|
246839
246839
|
// src/core/utils/git.ts
|
|
246840
|
+
import { dirname as dirname13, join as join19 } from "node:path";
|
|
246840
246841
|
var GIT_HASH_PATTERN = /^[a-fA-F0-9]{7,64}$/;
|
|
246841
246842
|
function isGitCommitHash(value) {
|
|
246842
246843
|
return GIT_HASH_PATTERN.test(value);
|
|
246843
246844
|
}
|
|
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
|
+
}
|
|
246844
246855
|
|
|
246845
246856
|
// src/core/site/git-hash.ts
|
|
246846
246857
|
async function resolveGitHash(projectRoot, explicit) {
|
|
@@ -246952,20 +246963,19 @@ async function deployAll(projectData, options) {
|
|
|
246952
246963
|
return { connectorResults };
|
|
246953
246964
|
}
|
|
246954
246965
|
// src/core/project/target.ts
|
|
246955
|
-
import { dirname as
|
|
246966
|
+
import { dirname as dirname14, join as join20, resolve as resolve6 } from "node:path";
|
|
246956
246967
|
async function resolveBuildTarget(projectRoot, overrides = {}) {
|
|
246957
246968
|
const project = await readSettingsIfPresent(projectRoot);
|
|
246958
246969
|
const root = project?.root ?? projectRoot ?? process.cwd();
|
|
246959
246970
|
const site = project ? siteOrDefault(project) : DEFAULT_SITE;
|
|
246960
246971
|
return {
|
|
246961
246972
|
root,
|
|
246962
|
-
configDir: project ?
|
|
246973
|
+
configDir: project ? dirname14(project.configPath) : join20(root, PROJECT_SUBDIR),
|
|
246963
246974
|
buildCommand: site.buildCommand,
|
|
246964
246975
|
outputDir: resolve6(root, overrides.outputDir ?? site.outputDirectory ?? DEFAULT_SITE.outputDirectory),
|
|
246965
246976
|
entitiesDir: project?.entitiesDir ?? "entities",
|
|
246966
246977
|
agentsDir: project?.agentsDir ?? "agents",
|
|
246967
|
-
functionsDir: project?.functionsDir ?? "functions"
|
|
246968
|
-
actorsDir: project?.actorsDir ?? "actors"
|
|
246978
|
+
functionsDir: project?.functionsDir ?? "functions"
|
|
246969
246979
|
};
|
|
246970
246980
|
}
|
|
246971
246981
|
async function readSettingsIfPresent(projectRoot) {
|
|
@@ -247696,6 +247706,9 @@ function getConnectorsUrl(projectId) {
|
|
|
247696
247706
|
const id = projectId ?? getAppContext().id;
|
|
247697
247707
|
return `${getBase44ApiUrl()}/apps/${id}/editor/workspace/app-connections`;
|
|
247698
247708
|
}
|
|
247709
|
+
function getBaseCodeUrl(appId, branchName) {
|
|
247710
|
+
return `${getBase44ApiUrl()}/apps/${appId}/editor/workspace/code?branch=${encodeURIComponent(branchName)}`;
|
|
247711
|
+
}
|
|
247699
247712
|
// src/cli/utils/yaml.ts
|
|
247700
247713
|
var import_lodash = __toESM(require_lodash8(), 1);
|
|
247701
247714
|
var YAML_INDENT = 2;
|
|
@@ -247822,7 +247835,7 @@ function getActorsCommand() {
|
|
|
247822
247835
|
}
|
|
247823
247836
|
|
|
247824
247837
|
// src/cli/commands/agent-skills/pull.ts
|
|
247825
|
-
import { dirname as
|
|
247838
|
+
import { dirname as dirname15, join as join21 } from "node:path";
|
|
247826
247839
|
// src/core/utils/dependencies.ts
|
|
247827
247840
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
247828
247841
|
function verifyDenoInstalled(context) {
|
|
@@ -247911,7 +247924,7 @@ async function pullAction({
|
|
|
247911
247924
|
runTask
|
|
247912
247925
|
}) {
|
|
247913
247926
|
const { project } = await readProjectConfig();
|
|
247914
|
-
const dir =
|
|
247927
|
+
const dir = join21(dirname15(project.configPath), project.agentSkillsDir);
|
|
247915
247928
|
const remote = await runTask("Fetching agent skills from Base44", () => fetchAgentSkills(), {
|
|
247916
247929
|
successMessage: "Agent skills fetched successfully",
|
|
247917
247930
|
errorMessage: "Failed to fetch agent skills"
|
|
@@ -247967,14 +247980,14 @@ function getAgentSkillsCommand() {
|
|
|
247967
247980
|
}
|
|
247968
247981
|
|
|
247969
247982
|
// src/cli/commands/agents/pull.ts
|
|
247970
|
-
import { dirname as
|
|
247983
|
+
import { dirname as dirname16, join as join22 } from "node:path";
|
|
247971
247984
|
async function pullAgentsAction({
|
|
247972
247985
|
log,
|
|
247973
247986
|
runTask
|
|
247974
247987
|
}) {
|
|
247975
247988
|
const { project } = await readProjectConfig();
|
|
247976
|
-
const configDir =
|
|
247977
|
-
const agentsDir =
|
|
247989
|
+
const configDir = dirname16(project.configPath);
|
|
247990
|
+
const agentsDir = join22(configDir, project.agentsDir);
|
|
247978
247991
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
247979
247992
|
return await fetchAgents();
|
|
247980
247993
|
}, {
|
|
@@ -249550,11 +249563,11 @@ function redactedApiError(apiError, raw, method, path, retryAfter) {
|
|
|
249550
249563
|
}
|
|
249551
249564
|
// src/core/api-spec/spec.ts
|
|
249552
249565
|
import { rename, rm, stat as stat3 } from "node:fs/promises";
|
|
249553
|
-
import { join as
|
|
249566
|
+
import { join as join23 } from "node:path";
|
|
249554
249567
|
var SPEC_CACHE_TTL_MS = 60 * 60 * 1000;
|
|
249555
249568
|
function getSpecCachePath(apiUrl = getBase44ApiUrl()) {
|
|
249556
249569
|
const server = new URL(apiUrl).host.replace(/[^a-zA-Z0-9.-]/g, "_");
|
|
249557
|
-
return
|
|
249570
|
+
return join23(getBase44GlobalDir(), "cache", server, "openapi.json");
|
|
249558
249571
|
}
|
|
249559
249572
|
function isSpecCacheFresh(mtimeMs, now = Date.now()) {
|
|
249560
249573
|
return now - mtimeMs < SPEC_CACHE_TTL_MS;
|
|
@@ -249904,12 +249917,12 @@ function getApiCommand() {
|
|
|
249904
249917
|
}
|
|
249905
249918
|
|
|
249906
249919
|
// src/cli/commands/auth/password-login.ts
|
|
249907
|
-
import { dirname as
|
|
249920
|
+
import { dirname as dirname17, join as join24 } from "node:path";
|
|
249908
249921
|
async function passwordLoginAction({ log, runTask }, action) {
|
|
249909
249922
|
const shouldEnable = action === "enable";
|
|
249910
249923
|
const { project } = await readProjectConfig();
|
|
249911
|
-
const configDir =
|
|
249912
|
-
const authDir =
|
|
249924
|
+
const configDir = dirname17(project.configPath);
|
|
249925
|
+
const authDir = join24(configDir, project.authDir);
|
|
249913
249926
|
const updated = await runTask("Updating local auth config", async () => {
|
|
249914
249927
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
249915
249928
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -249929,14 +249942,14 @@ function getPasswordLoginCommand() {
|
|
|
249929
249942
|
}
|
|
249930
249943
|
|
|
249931
249944
|
// src/cli/commands/auth/pull.ts
|
|
249932
|
-
import { dirname as
|
|
249945
|
+
import { dirname as dirname18, join as join25 } from "node:path";
|
|
249933
249946
|
async function pullAuthAction({
|
|
249934
249947
|
log,
|
|
249935
249948
|
runTask
|
|
249936
249949
|
}) {
|
|
249937
249950
|
const { project } = await readProjectConfig();
|
|
249938
|
-
const configDir =
|
|
249939
|
-
const authDir =
|
|
249951
|
+
const configDir = dirname18(project.configPath);
|
|
249952
|
+
const authDir = join25(configDir, project.authDir);
|
|
249940
249953
|
const remoteConfig = await runTask("Fetching auth config from Base44", async () => {
|
|
249941
249954
|
return await pullAuthConfig();
|
|
249942
249955
|
}, {
|
|
@@ -250000,7 +250013,7 @@ function getAuthPushCommand() {
|
|
|
250000
250013
|
}
|
|
250001
250014
|
|
|
250002
250015
|
// src/cli/commands/auth/social-login.ts
|
|
250003
|
-
import { dirname as
|
|
250016
|
+
import { dirname as dirname19, join as join26, resolve as resolve7 } from "node:path";
|
|
250004
250017
|
var PROVIDER_LABELS = {
|
|
250005
250018
|
google: "Google",
|
|
250006
250019
|
microsoft: "Microsoft",
|
|
@@ -250070,8 +250083,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask }, provider, a
|
|
|
250070
250083
|
}
|
|
250071
250084
|
}
|
|
250072
250085
|
const { project } = await readProjectConfig();
|
|
250073
|
-
const configDir =
|
|
250074
|
-
const authDir =
|
|
250086
|
+
const configDir = dirname19(project.configPath);
|
|
250087
|
+
const authDir = join26(configDir, project.authDir);
|
|
250075
250088
|
const { config: updated } = await runTask("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
250076
250089
|
if (clientSecret) {
|
|
250077
250090
|
await runTask("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -250096,7 +250109,7 @@ function getSocialLoginCommand() {
|
|
|
250096
250109
|
}
|
|
250097
250110
|
|
|
250098
250111
|
// src/cli/commands/auth/sso.ts
|
|
250099
|
-
import { dirname as
|
|
250112
|
+
import { dirname as dirname20, join as join27, resolve as resolve8 } from "node:path";
|
|
250100
250113
|
var SSOConfigFileSchema = object({
|
|
250101
250114
|
provider: _enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
250102
250115
|
clientId: string2(),
|
|
@@ -250259,8 +250272,8 @@ async function ssoEnableAction({ isNonInteractive, runTask }, options) {
|
|
|
250259
250272
|
throw error;
|
|
250260
250273
|
}
|
|
250261
250274
|
const { project } = await readProjectConfig();
|
|
250262
|
-
const configDir =
|
|
250263
|
-
const authDir =
|
|
250275
|
+
const configDir = dirname20(project.configPath);
|
|
250276
|
+
const authDir = join27(configDir, project.authDir);
|
|
250264
250277
|
await runTask("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
250265
250278
|
await runTask("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
250266
250279
|
return {
|
|
@@ -250275,8 +250288,8 @@ async function ssoDisableAction({ log, runTask }, options) {
|
|
|
250275
250288
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
250276
250289
|
}
|
|
250277
250290
|
const { project } = await readProjectConfig();
|
|
250278
|
-
const configDir =
|
|
250279
|
-
const authDir =
|
|
250291
|
+
const configDir = dirname20(project.configPath);
|
|
250292
|
+
const authDir = join27(configDir, project.authDir);
|
|
250280
250293
|
const updated = await runTask("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
250281
250294
|
await runTask("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
250282
250295
|
if (!hasAnyLoginMethod(updated)) {
|
|
@@ -251158,13 +251171,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
251158
251171
|
}
|
|
251159
251172
|
|
|
251160
251173
|
// src/cli/commands/connectors/pull.ts
|
|
251161
|
-
import { dirname as
|
|
251174
|
+
import { dirname as dirname21, join as join28, resolve as resolve9 } from "node:path";
|
|
251162
251175
|
async function resolveConnectorsDir(options) {
|
|
251163
251176
|
if (!getAppContext().projectRoot) {
|
|
251164
251177
|
return resolve9(options.dir ?? "connectors");
|
|
251165
251178
|
}
|
|
251166
251179
|
const { project } = await readProjectConfig();
|
|
251167
|
-
return
|
|
251180
|
+
return join28(dirname21(project.configPath), project.connectorsDir);
|
|
251168
251181
|
}
|
|
251169
251182
|
async function pullConnectorsAction({ log, runTask, jsonMode }, options) {
|
|
251170
251183
|
const connectorsDir = await resolveConnectorsDir(options);
|
|
@@ -251551,11 +251564,11 @@ function getListCommand() {
|
|
|
251551
251564
|
}
|
|
251552
251565
|
|
|
251553
251566
|
// src/cli/commands/functions/pull.ts
|
|
251554
|
-
import { dirname as
|
|
251567
|
+
import { dirname as dirname22, join as join29 } from "node:path";
|
|
251555
251568
|
async function pullFunctionsAction({ log, runTask }, name) {
|
|
251556
251569
|
const { project, functions } = await readProjectConfig();
|
|
251557
|
-
const configDir =
|
|
251558
|
-
const functionsDir =
|
|
251570
|
+
const configDir = dirname22(project.configPath);
|
|
251571
|
+
const functionsDir = join29(configDir, project.functionsDir);
|
|
251559
251572
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
251560
251573
|
const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
|
|
251561
251574
|
const { functions } = await listDeployedFunctions();
|
|
@@ -251669,7 +251682,7 @@ import { basename as basename7, resolve as resolve11 } from "node:path";
|
|
|
251669
251682
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
251670
251683
|
|
|
251671
251684
|
// src/cli/commands/project/scaffold-shared.ts
|
|
251672
|
-
import { join as
|
|
251685
|
+
import { join as join30 } from "node:path";
|
|
251673
251686
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
251674
251687
|
async function getTemplateById(templateId) {
|
|
251675
251688
|
const templates = await listTemplates();
|
|
@@ -251732,7 +251745,7 @@ async function completeProjectSetup({
|
|
|
251732
251745
|
env: { VITE_BASE44_APP_ID: projectId }
|
|
251733
251746
|
})`${buildCommand}`;
|
|
251734
251747
|
updateMessage("Deploying site...");
|
|
251735
|
-
return await deploySite(
|
|
251748
|
+
return await deploySite(join30(resolvedPath, outputDirectory));
|
|
251736
251749
|
}, {
|
|
251737
251750
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
251738
251751
|
errorMessage: "Failed to deploy site"
|
|
@@ -252654,25 +252667,6 @@ function declaredBundle({
|
|
|
252654
252667
|
}
|
|
252655
252668
|
};
|
|
252656
252669
|
}
|
|
252657
|
-
function declaredActor({
|
|
252658
|
-
name,
|
|
252659
|
-
entry,
|
|
252660
|
-
source,
|
|
252661
|
-
size,
|
|
252662
|
-
digest,
|
|
252663
|
-
staticEgress
|
|
252664
|
-
}) {
|
|
252665
|
-
return {
|
|
252666
|
-
name,
|
|
252667
|
-
entry,
|
|
252668
|
-
source,
|
|
252669
|
-
module: { size, digest },
|
|
252670
|
-
static_egress: staticEgress
|
|
252671
|
-
};
|
|
252672
|
-
}
|
|
252673
|
-
function actorUploadPath(actor) {
|
|
252674
|
-
return `actors/${actor.name}.mjs`;
|
|
252675
|
-
}
|
|
252676
252670
|
function declaredServingConfig(config) {
|
|
252677
252671
|
const stated = {
|
|
252678
252672
|
html_handling: config?.htmlHandling ?? null,
|
|
@@ -252727,7 +252721,6 @@ async function createVersion(artifacts, options = {}) {
|
|
|
252727
252721
|
}
|
|
252728
252722
|
} : {},
|
|
252729
252723
|
backend_bundles: artifacts.backendBundles.map(declaredBundle),
|
|
252730
|
-
actors: artifacts.actors.map(declaredActor),
|
|
252731
252724
|
entities: artifacts.entities,
|
|
252732
252725
|
agents: artifacts.agents,
|
|
252733
252726
|
source_commit: options.sourceCommit
|
|
@@ -252736,8 +252729,7 @@ async function createVersion(artifacts, options = {}) {
|
|
|
252736
252729
|
...artifacts.assets,
|
|
252737
252730
|
...artifacts.siteWorker?.modules ?? []
|
|
252738
252731
|
];
|
|
252739
|
-
const
|
|
252740
|
-
const slotCount = actorsAt + artifacts.actors.length;
|
|
252732
|
+
const slotCount = declaredFiles.length + artifacts.backendBundles.length;
|
|
252741
252733
|
options.progress?.onDeclared?.({ fileCount: slotCount });
|
|
252742
252734
|
if (declared.uploads.length !== slotCount) {
|
|
252743
252735
|
throw new InternalError(`Declared ${slotCount} files but the server signed ${declared.uploads.length} upload URLs.`);
|
|
@@ -252746,18 +252738,12 @@ async function createVersion(artifacts, options = {}) {
|
|
|
252746
252738
|
if (drifted !== -1) {
|
|
252747
252739
|
throw new InternalError(`Upload ${drifted} is signed for ${declared.uploads[drifted].path}, but that slot declared ${declaredFiles[drifted].path}.`);
|
|
252748
252740
|
}
|
|
252749
|
-
const actorDrifted = artifacts.actors.findIndex((actor, index) => declared.uploads[actorsAt + index].path !== actorUploadPath(actor));
|
|
252750
|
-
if (actorDrifted !== -1) {
|
|
252751
|
-
throw new InternalError(`Upload ${actorsAt + actorDrifted} is signed for ${declared.uploads[actorsAt + actorDrifted].path}, but that slot declared the actor ${artifacts.actors[actorDrifted].name}.`);
|
|
252752
|
-
}
|
|
252753
252741
|
let uploadedFiles = 0;
|
|
252754
252742
|
await pMap(declared.uploads, async (upload, index) => {
|
|
252755
252743
|
if (index < declaredFiles.length) {
|
|
252756
252744
|
await putPresigned(upload, declaredFiles[index].absolutePath);
|
|
252757
|
-
} else if (index < actorsAt) {
|
|
252758
|
-
await putPresignedBody(upload, artifacts.backendBundles[index - declaredFiles.length].module);
|
|
252759
252745
|
} else {
|
|
252760
|
-
await putPresignedBody(upload, artifacts.
|
|
252746
|
+
await putPresignedBody(upload, artifacts.backendBundles[index - declaredFiles.length].module);
|
|
252761
252747
|
}
|
|
252762
252748
|
uploadedFiles++;
|
|
252763
252749
|
options.progress?.onUpload?.({
|
|
@@ -252775,10 +252761,11 @@ async function setEnvironmentVersion(environment, versionId, options = {}) {
|
|
|
252775
252761
|
}
|
|
252776
252762
|
// src/core/version/artifacts.ts
|
|
252777
252763
|
import { createHash as createHash3 } from "node:crypto";
|
|
252778
|
-
import { join as
|
|
252764
|
+
import { join as join31, resolve as resolve13 } from "node:path";
|
|
252779
252765
|
|
|
252780
|
-
// src/core/version/
|
|
252781
|
-
import {
|
|
252766
|
+
// src/core/version/functions.ts
|
|
252767
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
252768
|
+
import { relative as relative6 } from "node:path";
|
|
252782
252769
|
|
|
252783
252770
|
// ../functions-compiler/src/assembly.ts
|
|
252784
252771
|
import path17 from "node:path";
|
|
@@ -258312,18 +258299,6 @@ function consolePatch(runtimeSecrets) {
|
|
|
258312
258299
|
return runtimeSecrets ? `${CONSOLE_PATCH}
|
|
258313
258300
|
${RUNTIME_SECRETS_RESERVED_PATCH}` : CONSOLE_PATCH;
|
|
258314
258301
|
}
|
|
258315
|
-
async function prepareFunction(entry, files, postResponseTelemetry = false, runtimeSecrets = false) {
|
|
258316
|
-
assertNoReservedFilenames(files);
|
|
258317
|
-
return {
|
|
258318
|
-
entry: ENTRY_FILENAME,
|
|
258319
|
-
files: {
|
|
258320
|
-
...userFiles(files),
|
|
258321
|
-
...workerRuntimeFiles(),
|
|
258322
|
-
...runtimeSecrets ? { [ACTIVATION_FILENAME]: activationShimSource() } : {},
|
|
258323
|
-
[ENTRY_FILENAME]: buildEntrySource(entry, postResponseTelemetry, runtimeSecrets)
|
|
258324
|
-
}
|
|
258325
|
-
};
|
|
258326
|
-
}
|
|
258327
258302
|
var BANNER_FORMAT = 1;
|
|
258328
258303
|
function buildBanner(entries, telemetry, runtimeSecrets) {
|
|
258329
258304
|
return `//!b44:${BANNER_FORMAT} ${JSON.stringify({
|
|
@@ -258367,50 +258342,6 @@ function activationImport(runtimeSecrets) {
|
|
|
258367
258342
|
return runtimeSecrets ? `
|
|
258368
258343
|
import { ensureActivation, takeActivationChallenge, withoutActivationHeaders } from "./${ACTIVATION_FILENAME}";` : "";
|
|
258369
258344
|
}
|
|
258370
|
-
function buildEntrySource(userEntry, telemetry, runtimeSecrets = false) {
|
|
258371
|
-
const userImport = `./${userEntry.replace(/^\.\//, "")}`;
|
|
258372
|
-
const handlerExpr = telemetry ? "_b44AttachTelemetry(await handler(request, info))" : runtimeSecrets ? "await handler(request, info)" : "handler(request, info)";
|
|
258373
|
-
const guard = activationGuard(runtimeSecrets);
|
|
258374
|
-
const returnExpr = guard(handlerExpr);
|
|
258375
|
-
return `// Auto-generated by the base44 bundler. Do not edit.
|
|
258376
|
-
|
|
258377
|
-
import { currentWorkerRuntimeContext as _b44Context, runWithWorkerEnvironment as _b44Run } from ${JSON.stringify(RUNTIME_CONTEXT_SPECIFIER)};
|
|
258378
|
-
import { getRegisteredHandler, installStaticEgressFetch } from "./${SHIM_FILENAME}";${activationImport(runtimeSecrets)}
|
|
258379
|
-
|
|
258380
|
-
${consolePatch(runtimeSecrets)}
|
|
258381
|
-
// Static egress reads workerEnv from the active request store. Install it
|
|
258382
|
-
// before telemetry so telemetry remains the outermost fetch wrapper.
|
|
258383
|
-
installStaticEgressFetch();
|
|
258384
|
-
${telemetry ? TELEMETRY_PATCH : ""}
|
|
258385
|
-
|
|
258386
|
-
let _b44Init = null;
|
|
258387
|
-
export default {
|
|
258388
|
-
async fetch(request, env, ctx) {
|
|
258389
|
-
${runtimeSecrets ? ACTIVATION_TAKE : ""} const _b44Env = (request.headers.get('base44-functions-version') ?? '') === 'prod' ? 'prod' : 'preview';
|
|
258390
|
-
return _b44Run({ env: _b44Env, secrets: ${runtimeSecrets ? "process.env" : "env"}, workerEnv: env, waitUntil: (p) => ctx.waitUntil(p)${telemetry ? `, ${TELEMETRY_STORE_FIELDS}` : ""} }, async () => {
|
|
258391
|
-
${runtimeSecrets ? ACTIVATION_GATE : ""} if (!_b44Init) _b44Init = import(${JSON.stringify(userImport)}).catch(e => { _b44Init = null; throw e; });
|
|
258392
|
-
const _b44Mod = await _b44Init;
|
|
258393
|
-
// Deno.serve capture wins (legacy contract, zero behavior change);
|
|
258394
|
-
// a default-exported handler is the new-contract fallback.
|
|
258395
|
-
const handler = getRegisteredHandler() ?? (typeof _b44Mod?.default === 'function' ? _b44Mod.default : null);
|
|
258396
|
-
if (!handler) {
|
|
258397
|
-
return ${guard(`new Response(
|
|
258398
|
-
"The function must export default a request handler or call Deno.serve()",
|
|
258399
|
-
{ status: 503 },
|
|
258400
|
-
)`)};
|
|
258401
|
-
}
|
|
258402
|
-
// Deno's handler signature is (request, info). Cloudflare doesn't expose a
|
|
258403
|
-
// connection address the same way; pass a best-effort placeholder. Real
|
|
258404
|
-
// client IP is available via the "cf-connecting-ip" request header.
|
|
258405
|
-
const info = {
|
|
258406
|
-
remoteAddr: { transport: "tcp", hostname: "0.0.0.0", port: 0 },
|
|
258407
|
-
};
|
|
258408
|
-
return ${returnExpr};
|
|
258409
|
-
});
|
|
258410
|
-
},
|
|
258411
|
-
};
|
|
258412
|
-
`;
|
|
258413
|
-
}
|
|
258414
258345
|
function buildFunctionModuleSource(functionName, userEntry) {
|
|
258415
258346
|
const userImport = `./${userEntry.replace(/^\.\//, "")}`;
|
|
258416
258347
|
return `// Auto-generated by the base44 bundler. Do not edit.
|
|
@@ -258713,284 +258644,6 @@ function runtimeContextVirtualPlugin() {
|
|
|
258713
258644
|
};
|
|
258714
258645
|
}
|
|
258715
258646
|
|
|
258716
|
-
// ../functions-compiler/src/actor-compat.ts
|
|
258717
|
-
var ACTOR_ENTRY_FILENAME2 = "__base44_actor_entry.mjs";
|
|
258718
|
-
var ACTOR_PRELUDE_FILENAME = "__base44_actor_prelude.mjs";
|
|
258719
|
-
var ACTOR_AUTH_FILENAME = "__base44_actor_auth.mjs";
|
|
258720
|
-
var ACTORS_PREFIX = "base44/actors/";
|
|
258721
|
-
var ENTRY_SUFFIX = "/entry.ts";
|
|
258722
|
-
function actorNameFromEntry(entry) {
|
|
258723
|
-
if (!entry.startsWith(ACTORS_PREFIX) || !entry.endsWith(ENTRY_SUFFIX))
|
|
258724
|
-
return null;
|
|
258725
|
-
const name = entry.slice(ACTORS_PREFIX.length, -ENTRY_SUFFIX.length);
|
|
258726
|
-
return name && !name.includes("/") ? name : null;
|
|
258727
|
-
}
|
|
258728
|
-
function applyActorCompat(entry, files) {
|
|
258729
|
-
const actorName = actorNameFromEntry(entry);
|
|
258730
|
-
if (!actorName || files[entry] === undefined)
|
|
258731
|
-
return null;
|
|
258732
|
-
assertNoReservedFilenames(files);
|
|
258733
|
-
if (ACTOR_PRELUDE_FILENAME in files) {
|
|
258734
|
-
throw new Error(`Reserved filename "${ACTOR_PRELUDE_FILENAME}" in actor bundle — ` + "it is generated by the bundler. Rename the file.");
|
|
258735
|
-
}
|
|
258736
|
-
if (ACTOR_AUTH_FILENAME in files) {
|
|
258737
|
-
throw new Error(`Reserved filename "${ACTOR_AUTH_FILENAME}" in actor bundle — ` + "it is generated by the bundler. Rename the file.");
|
|
258738
|
-
}
|
|
258739
|
-
const handlerName = actorName;
|
|
258740
|
-
const doClassName = handlerName;
|
|
258741
|
-
const prelude = buildPrelude();
|
|
258742
|
-
const entryWrapper = buildEntryWrapper(doClassName, entry);
|
|
258743
|
-
return {
|
|
258744
|
-
entry: ACTOR_ENTRY_FILENAME2,
|
|
258745
|
-
files: {
|
|
258746
|
-
...files,
|
|
258747
|
-
...workerRuntimeFiles(),
|
|
258748
|
-
[ACTOR_AUTH_FILENAME]: buildActorAuth(),
|
|
258749
|
-
[ACTOR_PRELUDE_FILENAME]: prelude,
|
|
258750
|
-
[ACTOR_ENTRY_FILENAME2]: entryWrapper
|
|
258751
|
-
},
|
|
258752
|
-
handlerName,
|
|
258753
|
-
doClassName
|
|
258754
|
-
};
|
|
258755
|
-
}
|
|
258756
|
-
function buildActorAuth() {
|
|
258757
|
-
return `// Auto-generated by the base44 bundler. Do not edit.
|
|
258758
|
-
const TOKEN_HEADER = "X-Base44-Actor-Token";
|
|
258759
|
-
const IDENTITY_HEADER = "X-Base44-Actor-Identity";
|
|
258760
|
-
const CLOCK_SKEW_SECONDS = 30;
|
|
258761
|
-
const TOKEN_TTL_SECONDS = 300;
|
|
258762
|
-
|
|
258763
|
-
const decodeSegment = (segment) => {
|
|
258764
|
-
const normalized = segment.replace(/-/g, "+").replace(/_/g, "/");
|
|
258765
|
-
const padded = normalized + "=".repeat((4 - normalized.length % 4) % 4);
|
|
258766
|
-
const binary = atob(padded);
|
|
258767
|
-
return new Uint8Array([...binary].map((character) => character.charCodeAt(0)));
|
|
258768
|
-
};
|
|
258769
|
-
|
|
258770
|
-
const decodeJsonSegment = (segment) =>
|
|
258771
|
-
JSON.parse(new TextDecoder().decode(decodeSegment(segment)));
|
|
258772
|
-
|
|
258773
|
-
const unauthorized = () => ({
|
|
258774
|
-
ok: false,
|
|
258775
|
-
response: new Response("Unauthorized", { status: 401 }),
|
|
258776
|
-
});
|
|
258777
|
-
|
|
258778
|
-
const validPrincipal = (principal) => {
|
|
258779
|
-
if (principal === null || typeof principal !== "object" || Array.isArray(principal)) return false;
|
|
258780
|
-
if (principal.type === "authenticated") {
|
|
258781
|
-
return typeof principal.userId === "string" && principal.userId.length > 0 && principal.userId.length <= 128;
|
|
258782
|
-
}
|
|
258783
|
-
if (principal.type === "anonymous") {
|
|
258784
|
-
return typeof principal.anonymousId === "string" && principal.anonymousId.length > 0 && principal.anonymousId.length <= 128;
|
|
258785
|
-
}
|
|
258786
|
-
return false;
|
|
258787
|
-
};
|
|
258788
|
-
|
|
258789
|
-
export async function verifyActorConnection(request, env, actorName, room) {
|
|
258790
|
-
const publicKey = env.BASE44_ACTOR_PUBLIC_KEY;
|
|
258791
|
-
const scriptId = env.BASE44_ACTOR_SCRIPT_ID;
|
|
258792
|
-
const token = request.headers.get(TOKEN_HEADER) ?? new URL(request.url).searchParams.get("token");
|
|
258793
|
-
if (
|
|
258794
|
-
typeof publicKey !== "string" || !publicKey ||
|
|
258795
|
-
typeof scriptId !== "string" || !scriptId ||
|
|
258796
|
-
typeof token !== "string" || token.length > 4096
|
|
258797
|
-
) return unauthorized();
|
|
258798
|
-
|
|
258799
|
-
const parts = token.split(".");
|
|
258800
|
-
if (parts.length !== 3) return unauthorized();
|
|
258801
|
-
try {
|
|
258802
|
-
const header = decodeJsonSegment(parts[0]);
|
|
258803
|
-
const claims = decodeJsonSegment(parts[1]);
|
|
258804
|
-
if (header?.alg !== "EdDSA" || (header.typ !== undefined && header.typ !== "JWT")) {
|
|
258805
|
-
return unauthorized();
|
|
258806
|
-
}
|
|
258807
|
-
const key = await crypto.subtle.importKey(
|
|
258808
|
-
"raw",
|
|
258809
|
-
decodeSegment(publicKey),
|
|
258810
|
-
{ name: "Ed25519" },
|
|
258811
|
-
false,
|
|
258812
|
-
["verify"],
|
|
258813
|
-
);
|
|
258814
|
-
const validSignature = await crypto.subtle.verify(
|
|
258815
|
-
{ name: "Ed25519" },
|
|
258816
|
-
key,
|
|
258817
|
-
decodeSegment(parts[2]),
|
|
258818
|
-
new TextEncoder().encode(parts[0] + "." + parts[1]),
|
|
258819
|
-
);
|
|
258820
|
-
if (!validSignature) return unauthorized();
|
|
258821
|
-
|
|
258822
|
-
const now = Math.floor(Date.now() / 1000);
|
|
258823
|
-
const times = [claims.iat, claims.nbf, claims.exp];
|
|
258824
|
-
if (!times.every(Number.isInteger)) return unauthorized();
|
|
258825
|
-
if (
|
|
258826
|
-
claims.iss !== "base44" ||
|
|
258827
|
-
claims.aud !== "base44-actor-connect" ||
|
|
258828
|
-
claims.purpose !== "actor-connect" ||
|
|
258829
|
-
claims.v !== 1 ||
|
|
258830
|
-
typeof claims.jti !== "string" || !claims.jti || claims.jti.length > 64 ||
|
|
258831
|
-
claims.iat > now + CLOCK_SKEW_SECONDS ||
|
|
258832
|
-
claims.nbf > now + CLOCK_SKEW_SECONDS ||
|
|
258833
|
-
claims.exp < now - CLOCK_SKEW_SECONDS ||
|
|
258834
|
-
claims.exp <= claims.iat || claims.exp - claims.iat > TOKEN_TTL_SECONDS ||
|
|
258835
|
-
claims.app_id !== env.BASE44_APP_ID ||
|
|
258836
|
-
claims.actor_name !== actorName ||
|
|
258837
|
-
claims.actor_script_id !== scriptId ||
|
|
258838
|
-
claims.room !== room ||
|
|
258839
|
-
claims.connection_id !== new URL(request.url).searchParams.get("_pk") ||
|
|
258840
|
-
claims.runtime_mode !== (env.BASE44_FUNCTIONS_VERSION === "prod" ? "prod" : "preview") ||
|
|
258841
|
-
!validPrincipal(claims.principal)
|
|
258842
|
-
) return unauthorized();
|
|
258843
|
-
|
|
258844
|
-
return {
|
|
258845
|
-
ok: true,
|
|
258846
|
-
identity: Object.freeze({ ...claims.principal }),
|
|
258847
|
-
runtimeMode: claims.runtime_mode,
|
|
258848
|
-
};
|
|
258849
|
-
} catch {
|
|
258850
|
-
return unauthorized();
|
|
258851
|
-
}
|
|
258852
|
-
}
|
|
258853
|
-
|
|
258854
|
-
export function authorizedActorRequest(request, identity, actorName, room, runtimeMode) {
|
|
258855
|
-
const url = new URL(request.url);
|
|
258856
|
-
url.searchParams.delete("token");
|
|
258857
|
-
url.pathname = "/parties/" + encodeURIComponent(actorName) + "/" + encodeURIComponent(room);
|
|
258858
|
-
const headers = new Headers(request.headers);
|
|
258859
|
-
headers.delete(TOKEN_HEADER);
|
|
258860
|
-
headers.set(IDENTITY_HEADER, JSON.stringify(identity));
|
|
258861
|
-
headers.set("base44-functions-version", runtimeMode === "prod" ? "prod" : "preview");
|
|
258862
|
-
return new Request(new Request(url.toString(), request), { headers });
|
|
258863
|
-
}
|
|
258864
|
-
`;
|
|
258865
|
-
}
|
|
258866
|
-
function buildPrelude() {
|
|
258867
|
-
return `// Auto-generated by the base44 bundler. Do not edit.
|
|
258868
|
-
import { currentWorkerRuntimeContext as _b44Context } from ${JSON.stringify(RUNTIME_CONTEXT_SPECIFIER)};
|
|
258869
|
-
import { installStaticEgressFetch } from "./${SHIM_FILENAME}";
|
|
258870
|
-
|
|
258871
|
-
${CONSOLE_PATCH}
|
|
258872
|
-
installStaticEgressFetch();
|
|
258873
|
-
`;
|
|
258874
|
-
}
|
|
258875
|
-
function buildEntryWrapper(doClassName, userEntry) {
|
|
258876
|
-
const userImport = `./${userEntry.replace(/^\.\//, "")}`;
|
|
258877
|
-
return `// Auto-generated by the base44 bundler. Do not edit.
|
|
258878
|
-
// The prelude is intentionally the first dependency: it installs the fetch
|
|
258879
|
-
// shim before the user module evaluates while this static default import keeps
|
|
258880
|
-
// missing-default actors as bundle-time errors.
|
|
258881
|
-
import "./${ACTOR_PRELUDE_FILENAME}";
|
|
258882
|
-
import Base44UserActor from ${JSON.stringify(userImport)};
|
|
258883
|
-
import { runWithWorkerEnvironment as _b44Run } from ${JSON.stringify(RUNTIME_CONTEXT_SPECIFIER)};
|
|
258884
|
-
import { authorizedActorRequest as _b44AuthorizedActorRequest, verifyActorConnection as _b44VerifyActorConnection } from "./${ACTOR_AUTH_FILENAME}";
|
|
258885
|
-
|
|
258886
|
-
const _b44ActorState = new WeakMap();
|
|
258887
|
-
const _b44RunWithActorEnvironment = (ctx, env, runtimeEnv, callback) => _b44Run({
|
|
258888
|
-
env: runtimeEnv,
|
|
258889
|
-
secrets: env,
|
|
258890
|
-
workerEnv: env,
|
|
258891
|
-
waitUntil: (promise) => ctx.waitUntil(promise),
|
|
258892
|
-
}, callback);
|
|
258893
|
-
const _b44ConstructActor = (ctx, env, newTarget) => _b44RunWithActorEnvironment(
|
|
258894
|
-
ctx,
|
|
258895
|
-
env,
|
|
258896
|
-
"prod",
|
|
258897
|
-
() => {
|
|
258898
|
-
// A derived constructor may return an explicitly constructed instance.
|
|
258899
|
-
// This keeps the user's constructor and class-field initializers inside the
|
|
258900
|
-
// request-scoped Worker environment without changing the exported subclass.
|
|
258901
|
-
const actor = Reflect.construct(Base44UserActor, [ctx, env], newTarget);
|
|
258902
|
-
_b44ActorState.set(actor, { ctx, env, runtimeEnv: null });
|
|
258903
|
-
return actor;
|
|
258904
|
-
},
|
|
258905
|
-
);
|
|
258906
|
-
const _b44RunActor = (actor, request, callback) => {
|
|
258907
|
-
const state = _b44ActorState.get(actor);
|
|
258908
|
-
const runtimeEnv = request
|
|
258909
|
-
? ((request.headers.get("base44-functions-version") ?? "") === "prod" ? "prod" : "preview")
|
|
258910
|
-
: (state.runtimeEnv ?? "prod");
|
|
258911
|
-
state.runtimeEnv = runtimeEnv;
|
|
258912
|
-
return _b44RunWithActorEnvironment(state.ctx, state.env, runtimeEnv, callback);
|
|
258913
|
-
};
|
|
258914
|
-
|
|
258915
|
-
export class ${doClassName} extends Base44UserActor {
|
|
258916
|
-
// Read by the shim's service-token exchange: the assertion's actor_name claim
|
|
258917
|
-
// selects the verification key on the platform side. A static (not .name) so
|
|
258918
|
-
// minification can't change it.
|
|
258919
|
-
static _b44ActorName = ${JSON.stringify(doClassName)};
|
|
258920
|
-
|
|
258921
|
-
constructor(ctx, env) {
|
|
258922
|
-
return _b44ConstructActor(ctx, env, new.target);
|
|
258923
|
-
}
|
|
258924
|
-
|
|
258925
|
-
fetch(request) {
|
|
258926
|
-
return _b44RunActor(this, request, () => super.fetch(request));
|
|
258927
|
-
}
|
|
258928
|
-
|
|
258929
|
-
onConnect(...args) {
|
|
258930
|
-
return _b44RunActor(this, null, () => super.onConnect(...args));
|
|
258931
|
-
}
|
|
258932
|
-
|
|
258933
|
-
onMessage(...args) {
|
|
258934
|
-
return _b44RunActor(this, null, () => super.onMessage(...args));
|
|
258935
|
-
}
|
|
258936
|
-
|
|
258937
|
-
onClose(...args) {
|
|
258938
|
-
return _b44RunActor(this, null, () => super.onClose(...args));
|
|
258939
|
-
}
|
|
258940
|
-
|
|
258941
|
-
onAlarm(...args) {
|
|
258942
|
-
return _b44RunActor(this, null, () => super.onAlarm(...args));
|
|
258943
|
-
}
|
|
258944
|
-
|
|
258945
|
-
onStart(...args) {
|
|
258946
|
-
return _b44RunActor(this, null, () => super.onStart(...args));
|
|
258947
|
-
}
|
|
258948
|
-
|
|
258949
|
-
onError(...args) {
|
|
258950
|
-
return _b44RunActor(this, null, () => super.onError(...args));
|
|
258951
|
-
}
|
|
258952
|
-
}
|
|
258953
|
-
export default {
|
|
258954
|
-
async fetch(request, env, ctx) {
|
|
258955
|
-
const url = new URL(request.url);
|
|
258956
|
-
const parts = url.pathname.split("/");
|
|
258957
|
-
const direct = parts[1] === "rooms" && parts.length === 3;
|
|
258958
|
-
const legacy = parts[1] === "parties" && parts.length === 4;
|
|
258959
|
-
if (direct || legacy) {
|
|
258960
|
-
// Decode the room: the token was verified against the decoded instance id,
|
|
258961
|
-
// so an escaped room must map to the same Durable Object.
|
|
258962
|
-
const namespace = direct ? "${doClassName}" : parts[2];
|
|
258963
|
-
const encodedRoom = direct ? parts[2] : parts[3];
|
|
258964
|
-
let room;
|
|
258965
|
-
try { room = decodeURIComponent(encodedRoom); } catch { return new Response("Invalid room", { status: 400 }); }
|
|
258966
|
-
let actorRequest = request;
|
|
258967
|
-
if (direct || typeof env.BASE44_ACTOR_PUBLIC_KEY === "string") {
|
|
258968
|
-
const verification = await _b44VerifyActorConnection(request, env, "${doClassName}", room);
|
|
258969
|
-
if (!verification.ok) return verification.response;
|
|
258970
|
-
actorRequest = _b44AuthorizedActorRequest(
|
|
258971
|
-
request,
|
|
258972
|
-
verification.identity,
|
|
258973
|
-
"${doClassName}",
|
|
258974
|
-
room,
|
|
258975
|
-
verification.runtimeMode,
|
|
258976
|
-
);
|
|
258977
|
-
}
|
|
258978
|
-
const doNs = env["${doClassName}"];
|
|
258979
|
-
if (doNs && typeof doNs.idFromName === "function") {
|
|
258980
|
-
const stub = doNs.get(doNs.idFromName(room));
|
|
258981
|
-
const req = new Request(actorRequest);
|
|
258982
|
-
req.headers.set("x-partykit-room", room);
|
|
258983
|
-
req.headers.set("x-partykit-namespace", namespace);
|
|
258984
|
-
return stub.fetch(req);
|
|
258985
|
-
}
|
|
258986
|
-
return new Response("DO binding not found", { status: 503 });
|
|
258987
|
-
}
|
|
258988
|
-
return new Response("Not found", { status: 404 });
|
|
258989
|
-
},
|
|
258990
|
-
};
|
|
258991
|
-
`;
|
|
258992
|
-
}
|
|
258993
|
-
|
|
258994
258647
|
// ../../node_modules/zod/v3/helpers/util.js
|
|
258995
258648
|
var util;
|
|
258996
258649
|
(function(util) {
|
|
@@ -263495,51 +263148,6 @@ function setSpanTags(tags) {
|
|
|
263495
263148
|
// ../functions-compiler/src/bundler.ts
|
|
263496
263149
|
var NORMALIZED_MAIN_MODULE = "_bundled.mjs";
|
|
263497
263150
|
var MAX_PARALLEL_COMPILES = 4;
|
|
263498
|
-
async function bundle(req) {
|
|
263499
|
-
let actor;
|
|
263500
|
-
try {
|
|
263501
|
-
actor = applyActorCompat(req.entry, req.files);
|
|
263502
|
-
} catch (e) {
|
|
263503
|
-
return denoCompatErrorOrThrow(e);
|
|
263504
|
-
}
|
|
263505
|
-
if (actor) {
|
|
263506
|
-
if (req.runtimeSecrets) {
|
|
263507
|
-
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."));
|
|
263508
|
-
}
|
|
263509
|
-
const outcome = await installAndCompile({
|
|
263510
|
-
entry: actor.entry,
|
|
263511
|
-
files: actor.files
|
|
263512
|
-
});
|
|
263513
|
-
if (outcome.ok) {
|
|
263514
|
-
return {
|
|
263515
|
-
ok: true,
|
|
263516
|
-
module: outcome.module,
|
|
263517
|
-
main_module: NORMALIZED_MAIN_MODULE,
|
|
263518
|
-
warnings: outcome.warnings,
|
|
263519
|
-
handler_name: actor.handlerName,
|
|
263520
|
-
do_class_name: actor.doClassName
|
|
263521
|
-
};
|
|
263522
|
-
}
|
|
263523
|
-
return { ok: false, stage: outcome.stage, errors: outcome.errors };
|
|
263524
|
-
}
|
|
263525
|
-
let prepared;
|
|
263526
|
-
try {
|
|
263527
|
-
prepared = await prepareFunction(req.entry, req.files, req.postResponseTelemetry, req.runtimeSecrets);
|
|
263528
|
-
} catch (e) {
|
|
263529
|
-
return denoCompatErrorOrThrow(e);
|
|
263530
|
-
}
|
|
263531
|
-
const outcome = await installAndCompile(prepared);
|
|
263532
|
-
if (outcome.ok) {
|
|
263533
|
-
return {
|
|
263534
|
-
ok: true,
|
|
263535
|
-
module: outcome.module,
|
|
263536
|
-
main_module: NORMALIZED_MAIN_MODULE,
|
|
263537
|
-
warnings: outcome.warnings,
|
|
263538
|
-
...activationField(req.runtimeSecrets ?? false)
|
|
263539
|
-
};
|
|
263540
|
-
}
|
|
263541
|
-
return { ok: false, stage: outcome.stage, errors: outcome.errors };
|
|
263542
|
-
}
|
|
263543
263151
|
function activationField(runtimeSecrets) {
|
|
263544
263152
|
return runtimeSecrets ? { activation: ACTIVATION_MODE } : {};
|
|
263545
263153
|
}
|
|
@@ -263727,16 +263335,6 @@ async function installAndCompile(prepared) {
|
|
|
263727
263335
|
return { ok: false, stage: "esbuild", errors: result.errors };
|
|
263728
263336
|
});
|
|
263729
263337
|
}
|
|
263730
|
-
function denoCompatErrorOrThrow(e) {
|
|
263731
|
-
if (e instanceof DenoCompatError) {
|
|
263732
|
-
return {
|
|
263733
|
-
ok: false,
|
|
263734
|
-
stage: "deno_compat",
|
|
263735
|
-
errors: [denoCompatErrorItem(e)]
|
|
263736
|
-
};
|
|
263737
|
-
}
|
|
263738
|
-
throw e;
|
|
263739
|
-
}
|
|
263740
263338
|
function denoCompatErrorItem(e) {
|
|
263741
263339
|
return { message: e.message, file: e.file };
|
|
263742
263340
|
}
|
|
@@ -263939,8 +263537,6 @@ async function mapWithConcurrency2(items, limit, fn) {
|
|
|
263939
263537
|
return results;
|
|
263940
263538
|
}
|
|
263941
263539
|
// src/core/version/functions.ts
|
|
263942
|
-
import { createHash as createHash2 } from "node:crypto";
|
|
263943
|
-
import { relative as relative6 } from "node:path";
|
|
263944
263540
|
var SHARD_POLICY = {
|
|
263945
263541
|
shardSize: 100,
|
|
263946
263542
|
globalShardSize: 100,
|
|
@@ -263948,11 +263544,11 @@ var SHARD_POLICY = {
|
|
|
263948
263544
|
gzipCapBytes: 9500000
|
|
263949
263545
|
};
|
|
263950
263546
|
var COMPILE_MODES = { runtimeSecrets: false, postResponseTelemetry: false };
|
|
263951
|
-
async function requireCompilerRuntime(
|
|
263547
|
+
async function requireCompilerRuntime() {
|
|
263952
263548
|
try {
|
|
263953
263549
|
await Promise.all([import("esbuild"), import("@deno/loader")]);
|
|
263954
263550
|
} catch (error) {
|
|
263955
|
-
throw new DependencyNotFoundError(
|
|
263551
|
+
throw new DependencyNotFoundError("Backend functions cannot be compiled by this installation of the CLI.", {
|
|
263956
263552
|
hints: [{ message: "Install the CLI from npm: npm install -g base44" }],
|
|
263957
263553
|
cause: error instanceof Error ? error : undefined
|
|
263958
263554
|
});
|
|
@@ -264009,97 +263605,6 @@ async function compileBackendBundles(root, functionsDir) {
|
|
|
264009
263605
|
});
|
|
264010
263606
|
}
|
|
264011
263607
|
|
|
264012
|
-
// src/core/version/actors.ts
|
|
264013
|
-
var MAX_ACTORS = 50;
|
|
264014
|
-
var COMPILE_CONCURRENCY = 4;
|
|
264015
|
-
var ACTORS_ROOT = "base44/actors";
|
|
264016
|
-
var SHARED_ROOT = "base44/shared";
|
|
264017
|
-
function forwardSlashed(from, to) {
|
|
264018
|
-
return relative7(from, to).split(/[/\\]/).join("/");
|
|
264019
|
-
}
|
|
264020
|
-
async function readSharedFiles2(actorsDir) {
|
|
264021
|
-
const sharedDir = resolve13(actorsDir, "..", "shared");
|
|
264022
|
-
if (!await pathExists(sharedDir)) {
|
|
264023
|
-
return {};
|
|
264024
|
-
}
|
|
264025
|
-
const paths = await globby(BACKEND_FILE_GLOB, {
|
|
264026
|
-
cwd: sharedDir,
|
|
264027
|
-
absolute: true
|
|
264028
|
-
});
|
|
264029
|
-
const files = {};
|
|
264030
|
-
for (const path of paths.sort()) {
|
|
264031
|
-
files[`${SHARED_ROOT}/${forwardSlashed(sharedDir, path)}`] = await readTextFile(path);
|
|
264032
|
-
}
|
|
264033
|
-
return files;
|
|
264034
|
-
}
|
|
264035
|
-
async function compilerInput2(actor, shared) {
|
|
264036
|
-
const actorDir = dirname22(actor.entryPath);
|
|
264037
|
-
const entry = `${ACTORS_ROOT}/${actor.name}/entry.ts`;
|
|
264038
|
-
const source = await readTextFile(actor.entryPath);
|
|
264039
|
-
const candidates = { ...shared };
|
|
264040
|
-
for (const filePath of actor.filePaths) {
|
|
264041
|
-
if (filePath !== actor.entryPath) {
|
|
264042
|
-
candidates[`${ACTORS_ROOT}/${actor.name}/${forwardSlashed(actorDir, filePath)}`] = await readTextFile(filePath);
|
|
264043
|
-
}
|
|
264044
|
-
}
|
|
264045
|
-
candidates[entry] = source;
|
|
264046
|
-
return {
|
|
264047
|
-
entry,
|
|
264048
|
-
files: await collectReachableFiles(entry, candidates),
|
|
264049
|
-
source
|
|
264050
|
-
};
|
|
264051
|
-
}
|
|
264052
|
-
async function compileActors(actorsDir) {
|
|
264053
|
-
const actors = await readAllActors(actorsDir);
|
|
264054
|
-
if (actors.length === 0) {
|
|
264055
|
-
return [];
|
|
264056
|
-
}
|
|
264057
|
-
if (actors.length > MAX_ACTORS) {
|
|
264058
|
-
throw new InvalidInputError(`Too many actors: found ${actors.length}, the limit is ${MAX_ACTORS}.`);
|
|
264059
|
-
}
|
|
264060
|
-
await requireCompilerRuntime("Actors");
|
|
264061
|
-
const shared = await readSharedFiles2(actorsDir);
|
|
264062
|
-
const sorted = [...actors].sort((a, b) => a.name < b.name ? -1 : 1);
|
|
264063
|
-
const compiled = await pMap(sorted, async (actor) => {
|
|
264064
|
-
const input = await compilerInput2(actor, shared);
|
|
264065
|
-
const result = await bundle({ entry: input.entry, files: input.files });
|
|
264066
|
-
return {
|
|
264067
|
-
name: actor.name,
|
|
264068
|
-
entry: input.entry,
|
|
264069
|
-
source: input.source,
|
|
264070
|
-
result
|
|
264071
|
-
};
|
|
264072
|
-
}, { concurrency: COMPILE_CONCURRENCY });
|
|
264073
|
-
const failures = compiled.flatMap(({ name, result }) => result.ok ? [] : [
|
|
264074
|
-
{
|
|
264075
|
-
function: name,
|
|
264076
|
-
message: `Actor "${name}" failed to compile.`,
|
|
264077
|
-
errors: result.errors
|
|
264078
|
-
}
|
|
264079
|
-
]);
|
|
264080
|
-
if (failures.length > 0) {
|
|
264081
|
-
throw new InvalidInputError(`Actors failed to compile (${failures.length} error${failures.length === 1 ? "" : "s"}).`, { details: failures.map(describeFailure) });
|
|
264082
|
-
}
|
|
264083
|
-
return compiled.map(({ name, entry, source, result }) => {
|
|
264084
|
-
const module = new TextEncoder().encode(compiledModule(name, result));
|
|
264085
|
-
return {
|
|
264086
|
-
name,
|
|
264087
|
-
entry,
|
|
264088
|
-
source,
|
|
264089
|
-
module,
|
|
264090
|
-
size: module.byteLength,
|
|
264091
|
-
digest: sha256(module),
|
|
264092
|
-
staticEgress: STATIC_EGRESS_ARTIFACT_MARKER
|
|
264093
|
-
};
|
|
264094
|
-
});
|
|
264095
|
-
}
|
|
264096
|
-
function compiledModule(name, result) {
|
|
264097
|
-
if (!result.ok || result.do_class_name !== name) {
|
|
264098
|
-
throw new InternalError(`Actor "${name}" did not compile as an actor of that name.`);
|
|
264099
|
-
}
|
|
264100
|
-
return result.module;
|
|
264101
|
-
}
|
|
264102
|
-
|
|
264103
263608
|
// src/core/version/publish.ts
|
|
264104
263609
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
264105
263610
|
var DEFAULT_ENVIRONMENT = "production";
|
|
@@ -264152,7 +263657,7 @@ async function collectBuildOutput(outputDir, options = {}) {
|
|
|
264152
263657
|
}
|
|
264153
263658
|
async function describeSiteWorker(built) {
|
|
264154
263659
|
const { config, modules } = built;
|
|
264155
|
-
const entry =
|
|
263660
|
+
const entry = resolve13(config.configDir, config.main);
|
|
264156
263661
|
const main = modules.find((m) => m.absolutePath === entry)?.name;
|
|
264157
263662
|
if (!main) {
|
|
264158
263663
|
throw new InvalidInputError(`The Worker's entry module ${config.main} is not among the ${modules.length} modules collected from ${config.configDir}.`);
|
|
@@ -264183,14 +263688,14 @@ async function readRawResources(dir) {
|
|
|
264183
263688
|
const payloads = {};
|
|
264184
263689
|
for (const relativePath of files.sort()) {
|
|
264185
263690
|
const name = relativePath.replace(/\.jsonc?$/, "");
|
|
264186
|
-
payloads[name] = await readJsonFile(
|
|
263691
|
+
payloads[name] = await readJsonFile(join31(dir, ...relativePath.split("/")));
|
|
264187
263692
|
}
|
|
264188
263693
|
return payloads;
|
|
264189
263694
|
}
|
|
264190
263695
|
async function collectResources(configDir, dirs) {
|
|
264191
263696
|
const [entities, agents] = await Promise.all([
|
|
264192
|
-
readRawResources(
|
|
264193
|
-
readRawResources(
|
|
263697
|
+
readRawResources(join31(configDir, dirs.entitiesDir)),
|
|
263698
|
+
readRawResources(join31(configDir, dirs.agentsDir))
|
|
264194
263699
|
]);
|
|
264195
263700
|
return { entities, agents };
|
|
264196
263701
|
}
|
|
@@ -264202,8 +263707,7 @@ async function collectArtifacts(target) {
|
|
|
264202
263707
|
entryFile: ENTRY2
|
|
264203
263708
|
}),
|
|
264204
263709
|
...siteWorker ? { siteWorker } : {},
|
|
264205
|
-
backendBundles: await tagStep2("build", () => compileBackendBundles(target.root,
|
|
264206
|
-
actors: await tagStep2("build", () => compileActors(join30(target.configDir, target.actorsDir))),
|
|
263710
|
+
backendBundles: await tagStep2("build", () => compileBackendBundles(target.root, join31(target.configDir, target.functionsDir))),
|
|
264207
263711
|
...await collectResources(target.configDir, target)
|
|
264208
263712
|
};
|
|
264209
263713
|
}
|
|
@@ -264661,7 +264165,7 @@ function getSecretsListCommand() {
|
|
|
264661
264165
|
}
|
|
264662
264166
|
|
|
264663
264167
|
// src/cli/commands/secrets/set.ts
|
|
264664
|
-
import { resolve as
|
|
264168
|
+
import { resolve as resolve14 } from "node:path";
|
|
264665
264169
|
function parseEntries(entries) {
|
|
264666
264170
|
const secrets = {};
|
|
264667
264171
|
for (const entry of entries) {
|
|
@@ -264692,7 +264196,7 @@ async function setSecretsAction({ log, runTask }, entries, options) {
|
|
|
264692
264196
|
validateInput(entries, options);
|
|
264693
264197
|
let secrets;
|
|
264694
264198
|
if (options.envFile) {
|
|
264695
|
-
secrets = await parseEnvFile(
|
|
264199
|
+
secrets = await parseEnvFile(resolve14(options.envFile));
|
|
264696
264200
|
if (Object.keys(secrets).length === 0) {
|
|
264697
264201
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
264698
264202
|
}
|
|
@@ -264720,8 +264224,512 @@ function getSecretsCommand() {
|
|
|
264720
264224
|
return new Command2("secrets").description("Manage project secrets (environment variables)").addCommand(getSecretsListCommand()).addCommand(getSecretsSetCommand()).addCommand(getSecretsDeleteCommand());
|
|
264721
264225
|
}
|
|
264722
264226
|
|
|
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
|
+
|
|
264723
264731
|
// src/cli/commands/site/deploy.ts
|
|
264724
|
-
import { resolve as
|
|
264732
|
+
import { resolve as resolve15 } from "node:path";
|
|
264725
264733
|
async function deployAction2(ctx, options) {
|
|
264726
264734
|
const { isNonInteractive } = ctx;
|
|
264727
264735
|
if (isNonInteractive && !options.yes) {
|
|
@@ -264790,7 +264798,7 @@ async function deployTarball({ runTask }, project) {
|
|
|
264790
264798
|
}
|
|
264791
264799
|
function siteOutputDir(project) {
|
|
264792
264800
|
const { outputDirectory = DEFAULT_SITE.outputDirectory } = siteOrDefault(project);
|
|
264793
|
-
return
|
|
264801
|
+
return resolve15(project.root, outputDirectory);
|
|
264794
264802
|
}
|
|
264795
264803
|
function getSiteDeployCommand() {
|
|
264796
264804
|
const command = 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)");
|
|
@@ -265134,10 +265142,10 @@ function toPascalCase(name) {
|
|
|
265134
265142
|
return name.split(/[-_\s]+/).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
|
|
265135
265143
|
}
|
|
265136
265144
|
// src/core/types/update-project.ts
|
|
265137
|
-
import { join as
|
|
265145
|
+
import { join as join36 } from "node:path";
|
|
265138
265146
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
265139
265147
|
async function updateProjectConfig(projectRoot) {
|
|
265140
|
-
const tsconfigPath =
|
|
265148
|
+
const tsconfigPath = join36(projectRoot, "tsconfig.json");
|
|
265141
265149
|
if (!await pathExists(tsconfigPath)) {
|
|
265142
265150
|
return false;
|
|
265143
265151
|
}
|
|
@@ -265618,7 +265626,7 @@ function getWorkspaceCommand() {
|
|
|
265618
265626
|
// src/cli/dev/dev-server/main.ts
|
|
265619
265627
|
var import_cors = __toESM(require_lib4(), 1);
|
|
265620
265628
|
var import_express6 = __toESM(require_express(), 1);
|
|
265621
|
-
import { dirname as dirname28, join as
|
|
265629
|
+
import { dirname as dirname28, join as join41 } from "node:path";
|
|
265622
265630
|
|
|
265623
265631
|
// ../../node_modules/get-port/index.js
|
|
265624
265632
|
import net from "node:net";
|
|
@@ -265748,7 +265756,7 @@ var $tmpName = promisify12(tmp.tmpName);
|
|
|
265748
265756
|
|
|
265749
265757
|
// src/cli/dev/dev-server/function-manager.ts
|
|
265750
265758
|
import { spawn as spawn3 } from "node:child_process";
|
|
265751
|
-
import { dirname as dirname25, join as
|
|
265759
|
+
import { dirname as dirname25, join as join37 } from "node:path";
|
|
265752
265760
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
265753
265761
|
|
|
265754
265762
|
// src/cli/dev/dev-server/base-function-manager.ts
|
|
@@ -265853,7 +265861,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
265853
265861
|
}
|
|
265854
265862
|
spawnFunction(func, port) {
|
|
265855
265863
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
265856
|
-
const importMapPath =
|
|
265864
|
+
const importMapPath = join37(dirname25(this.wrapperPath), "import-map.json");
|
|
265857
265865
|
const process2 = spawn3("deno", ["run", "--allow-all", "--import-map", importMapPath, this.wrapperPath], {
|
|
265858
265866
|
env: {
|
|
265859
265867
|
...globalThis.process.env,
|
|
@@ -265926,8 +265934,8 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
265926
265934
|
// src/cli/dev/dev-server/function-bundler.ts
|
|
265927
265935
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
265928
265936
|
import { isBuiltin as isBuiltin3 } from "node:module";
|
|
265929
|
-
import { homedir as
|
|
265930
|
-
import { join as
|
|
265937
|
+
import { homedir as homedir5 } from "node:os";
|
|
265938
|
+
import { join as join38 } from "node:path";
|
|
265931
265939
|
import { pathToFileURL as pathToFileURL7 } from "node:url";
|
|
265932
265940
|
var depsPromise;
|
|
265933
265941
|
function loadDeps() {
|
|
@@ -266048,9 +266056,9 @@ export default {
|
|
|
266048
266056
|
};
|
|
266049
266057
|
`;
|
|
266050
266058
|
function ensureBundlerConfig() {
|
|
266051
|
-
const dir =
|
|
266059
|
+
const dir = join38(homedir5(), ".base44", "function-bundler");
|
|
266052
266060
|
mkdirSync2(dir, { recursive: true });
|
|
266053
|
-
const configPath =
|
|
266061
|
+
const configPath = join38(dir, "deno.json");
|
|
266054
266062
|
writeFileSync2(configPath, `${JSON.stringify({ nodeModulesDir: "auto" }, null, 2)}
|
|
266055
266063
|
`);
|
|
266056
266064
|
return configPath;
|
|
@@ -267582,16 +267590,16 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
|
267582
267590
|
|
|
267583
267591
|
// src/cli/dev/dev-server/watcher.ts
|
|
267584
267592
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
267585
|
-
import { relative as
|
|
267593
|
+
import { relative as relative10 } from "node:path";
|
|
267586
267594
|
|
|
267587
267595
|
// ../../node_modules/chokidar/index.js
|
|
267588
267596
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
267589
267597
|
import { stat as statcb, Stats } from "node:fs";
|
|
267590
|
-
import { readdir as
|
|
267598
|
+
import { readdir as readdir4, stat as stat8 } from "node:fs/promises";
|
|
267591
267599
|
import * as sp3 from "node:path";
|
|
267592
267600
|
|
|
267593
267601
|
// ../../node_modules/readdirp/index.js
|
|
267594
|
-
import { lstat as lstat2, readdir as
|
|
267602
|
+
import { lstat as lstat2, readdir as readdir3, realpath as realpath2, stat as stat6 } from "node:fs/promises";
|
|
267595
267603
|
import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "node:path";
|
|
267596
267604
|
import { Readable as Readable6 } from "node:stream";
|
|
267597
267605
|
var EntryTypes = {
|
|
@@ -267673,7 +267681,7 @@ class ReaddirpStream extends Readable6 {
|
|
|
267673
267681
|
const { root, type } = opts;
|
|
267674
267682
|
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
267675
267683
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
267676
|
-
const statMethod = opts.lstat ? lstat2 :
|
|
267684
|
+
const statMethod = opts.lstat ? lstat2 : stat6;
|
|
267677
267685
|
if (wantBigintFsStats) {
|
|
267678
267686
|
this._stat = (path) => statMethod(path, { bigint: true });
|
|
267679
267687
|
} else {
|
|
@@ -267744,7 +267752,7 @@ class ReaddirpStream extends Readable6 {
|
|
|
267744
267752
|
async _exploreDir(path, depth) {
|
|
267745
267753
|
let files;
|
|
267746
267754
|
try {
|
|
267747
|
-
files = await
|
|
267755
|
+
files = await readdir3(path, this._rdOptions);
|
|
267748
267756
|
} catch (error) {
|
|
267749
267757
|
this._onError(error);
|
|
267750
267758
|
}
|
|
@@ -267782,7 +267790,7 @@ class ReaddirpStream extends Readable6 {
|
|
|
267782
267790
|
if (stats && stats.isSymbolicLink()) {
|
|
267783
267791
|
const full = entry.fullPath;
|
|
267784
267792
|
try {
|
|
267785
|
-
const entryRealPath = await
|
|
267793
|
+
const entryRealPath = await realpath2(full);
|
|
267786
267794
|
const entryRealPathStats = await lstat2(entryRealPath);
|
|
267787
267795
|
if (entryRealPathStats.isFile()) {
|
|
267788
267796
|
return "file";
|
|
@@ -267826,7 +267834,7 @@ function readdirp(root, options = {}) {
|
|
|
267826
267834
|
|
|
267827
267835
|
// ../../node_modules/chokidar/handler.js
|
|
267828
267836
|
import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
|
|
267829
|
-
import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as
|
|
267837
|
+
import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat7 } from "node:fs/promises";
|
|
267830
267838
|
import { type as osType } from "node:os";
|
|
267831
267839
|
import * as sp2 from "node:path";
|
|
267832
267840
|
var STR_DATA = "data";
|
|
@@ -267852,7 +267860,7 @@ var EVENTS = {
|
|
|
267852
267860
|
};
|
|
267853
267861
|
var EV = EVENTS;
|
|
267854
267862
|
var THROTTLE_MODE_WATCH = "watch";
|
|
267855
|
-
var statMethods = { lstat: lstat3, stat:
|
|
267863
|
+
var statMethods = { lstat: lstat3, stat: stat7 };
|
|
267856
267864
|
var KEY_LISTENERS = "listeners";
|
|
267857
267865
|
var KEY_ERR = "errHandlers";
|
|
267858
267866
|
var KEY_RAW = "rawEmitters";
|
|
@@ -268323,7 +268331,7 @@ class NodeFsHandler {
|
|
|
268323
268331
|
return;
|
|
268324
268332
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
268325
268333
|
try {
|
|
268326
|
-
const newStats = await
|
|
268334
|
+
const newStats = await stat7(file);
|
|
268327
268335
|
if (this.fsw.closed)
|
|
268328
268336
|
return;
|
|
268329
268337
|
const at = newStats.atimeMs;
|
|
@@ -268671,7 +268679,7 @@ class DirEntry {
|
|
|
268671
268679
|
return;
|
|
268672
268680
|
const dir = this.path;
|
|
268673
268681
|
try {
|
|
268674
|
-
await
|
|
268682
|
+
await readdir4(dir);
|
|
268675
268683
|
} catch (err) {
|
|
268676
268684
|
if (this._removeWatcher) {
|
|
268677
268685
|
this._removeWatcher(sp3.dirname(dir), sp3.basename(dir));
|
|
@@ -268995,7 +269003,7 @@ class FSWatcher extends EventEmitter3 {
|
|
|
268995
269003
|
const fullPath = opts.cwd ? sp3.join(opts.cwd, path) : path;
|
|
268996
269004
|
let stats;
|
|
268997
269005
|
try {
|
|
268998
|
-
stats = await
|
|
269006
|
+
stats = await stat8(fullPath);
|
|
268999
269007
|
} catch (err) {}
|
|
269000
269008
|
if (!stats || this.closed)
|
|
269001
269009
|
return;
|
|
@@ -269267,7 +269275,7 @@ class WatchBase44 extends EventEmitter4 {
|
|
|
269267
269275
|
ignoreInitial: true
|
|
269268
269276
|
});
|
|
269269
269277
|
watcher.on("all", import_debounce.default(async (_event, path) => {
|
|
269270
|
-
this.emit("change", name,
|
|
269278
|
+
this.emit("change", name, relative10(targetPath, path));
|
|
269271
269279
|
}, WATCH_DEBOUNCE_MS));
|
|
269272
269280
|
watcher.on("error", (err) => {
|
|
269273
269281
|
this.logger.error(`Watch handler failed for ${targetPath}`, err);
|
|
@@ -269379,8 +269387,8 @@ async function createDevServer(options) {
|
|
|
269379
269387
|
broadcastEntityEvent(io, appId, entityName, event);
|
|
269380
269388
|
};
|
|
269381
269389
|
const base44ConfigWatcher = new WatchBase44({
|
|
269382
|
-
functions:
|
|
269383
|
-
entities:
|
|
269390
|
+
functions: join41(dirname28(project.configPath), project.functionsDir),
|
|
269391
|
+
entities: join41(dirname28(project.configPath), project.entitiesDir)
|
|
269384
269392
|
}, devLogger);
|
|
269385
269393
|
base44ConfigWatcher.on("change", async (name) => {
|
|
269386
269394
|
try {
|
|
@@ -269583,7 +269591,7 @@ function readExecEnvTarget(env = process.env) {
|
|
|
269583
269591
|
// src/core/exec/run-script.ts
|
|
269584
269592
|
import { spawn as spawn4 } from "node:child_process";
|
|
269585
269593
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
269586
|
-
import { join as
|
|
269594
|
+
import { join as join42 } from "node:path";
|
|
269587
269595
|
var SDK_SPECIFIER = '"npm:@base44/sdk"';
|
|
269588
269596
|
function wrapperSource(sdkVersion) {
|
|
269589
269597
|
const source = readFileSync4(getExecWrapperPath(), "utf-8");
|
|
@@ -269619,7 +269627,7 @@ async function runScript(options) {
|
|
|
269619
269627
|
writeFileSync3(tempWrapper.path, wrapperSource(sdkVersion), "utf-8");
|
|
269620
269628
|
const configDir = await $dir({ unsafeCleanup: true });
|
|
269621
269629
|
cleanupFns.push(configDir.cleanup);
|
|
269622
|
-
const configPath =
|
|
269630
|
+
const configPath = join42(configDir.path, "deno.json");
|
|
269623
269631
|
writeFileSync3(configPath, JSON.stringify(DENO_CONFIG), "utf-8");
|
|
269624
269632
|
try {
|
|
269625
269633
|
const exitCode = await new Promise((resolvePromise) => {
|
|
@@ -269740,7 +269748,7 @@ Examples:
|
|
|
269740
269748
|
}
|
|
269741
269749
|
|
|
269742
269750
|
// src/cli/commands/project/eject.ts
|
|
269743
|
-
import { resolve as
|
|
269751
|
+
import { resolve as resolve19 } from "node:path";
|
|
269744
269752
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
269745
269753
|
async function eject(ctx, options, command) {
|
|
269746
269754
|
const { log, runTask, isNonInteractive } = ctx;
|
|
@@ -269804,7 +269812,7 @@ async function eject(ctx, options, command) {
|
|
|
269804
269812
|
Ne("Operation cancelled.");
|
|
269805
269813
|
throw new CLIExitError(0);
|
|
269806
269814
|
}
|
|
269807
|
-
const resolvedPath =
|
|
269815
|
+
const resolvedPath = resolve19(selectedPath);
|
|
269808
269816
|
await runTask("Downloading your project's code...", async (updateMessage) => {
|
|
269809
269817
|
await createProjectFilesForExistingProject({
|
|
269810
269818
|
projectId,
|
|
@@ -269891,6 +269899,7 @@ function createProgram(context) {
|
|
|
269891
269899
|
program.addCommand(getSecretsCommand());
|
|
269892
269900
|
program.addCommand(getSandboxCommand());
|
|
269893
269901
|
program.addCommand(getBranchesCommand());
|
|
269902
|
+
program.addCommand(getSessionCommand(), { hidden: true });
|
|
269894
269903
|
program.addCommand(getApiCommand());
|
|
269895
269904
|
program.addCommand(getAuthCommand());
|
|
269896
269905
|
program.addCommand(getSiteCommand());
|
|
@@ -269910,7 +269919,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
269910
269919
|
import { release, type } from "node:os";
|
|
269911
269920
|
|
|
269912
269921
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
269913
|
-
import { dirname as dirname29, posix, sep as
|
|
269922
|
+
import { dirname as dirname29, posix, sep as sep3 } from "path";
|
|
269914
269923
|
function createModulerModifier() {
|
|
269915
269924
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
269916
269925
|
return async (frames) => {
|
|
@@ -269919,7 +269928,7 @@ function createModulerModifier() {
|
|
|
269919
269928
|
return frames;
|
|
269920
269929
|
};
|
|
269921
269930
|
}
|
|
269922
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname29(process.argv[1]) : process.cwd(), isWindows =
|
|
269931
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname29(process.argv[1]) : process.cwd(), isWindows = sep3 === "\\") {
|
|
269923
269932
|
const normalizedBase = isWindows ? normalizeWindowsPath2(basePath) : basePath;
|
|
269924
269933
|
return (filename) => {
|
|
269925
269934
|
if (!filename)
|
|
@@ -271954,8 +271963,8 @@ class ReduceableCache {
|
|
|
271954
271963
|
}
|
|
271955
271964
|
}
|
|
271956
271965
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs
|
|
271957
|
-
import { createReadStream as
|
|
271958
|
-
import { createInterface as
|
|
271966
|
+
import { createReadStream as createReadStream4 } from "node:fs";
|
|
271967
|
+
import { createInterface as createInterface3 } from "node:readline";
|
|
271959
271968
|
var LRU_FILE_CONTENTS_CACHE = new ReduceableCache(25);
|
|
271960
271969
|
var LRU_FILE_CONTENTS_FS_READ_FAILED = new ReduceableCache(20);
|
|
271961
271970
|
var DEFAULT_LINES_OF_CONTEXT = 7;
|
|
@@ -271998,8 +272007,8 @@ async function addSourceContext(frames) {
|
|
|
271998
272007
|
}
|
|
271999
272008
|
function getContextLinesFromFile(path, ranges, output) {
|
|
272000
272009
|
return new Promise((resolve) => {
|
|
272001
|
-
const stream =
|
|
272002
|
-
const lineReaded =
|
|
272010
|
+
const stream = createReadStream4(path);
|
|
272011
|
+
const lineReaded = createInterface3({
|
|
272003
272012
|
input: stream
|
|
272004
272013
|
});
|
|
272005
272014
|
function destroyStreamAndResolve() {
|
|
@@ -273910,7 +273919,7 @@ function addCommandInfoToErrorReporter(program, errorReporter) {
|
|
|
273910
273919
|
// src/cli/index.ts
|
|
273911
273920
|
var __dirname4 = dirname30(fileURLToPath7(import.meta.url));
|
|
273912
273921
|
async function runCLI(options) {
|
|
273913
|
-
ensureNpmAssets(
|
|
273922
|
+
ensureNpmAssets(join43(__dirname4, "../assets"));
|
|
273914
273923
|
const errorReporter = new ErrorReporter;
|
|
273915
273924
|
errorReporter.registerProcessErrorHandlers();
|
|
273916
273925
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -273949,4 +273958,4 @@ export {
|
|
|
273949
273958
|
runCLI
|
|
273950
273959
|
};
|
|
273951
273960
|
|
|
273952
|
-
//# debugId=
|
|
273961
|
+
//# debugId=F036CB7D2B7C691564756E2164756E21
|