@base44-preview/cli 0.1.32-pr.666.ebaf096 → 0.1.33-pr.667.b65bd0b
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 +679 -631
- package/dist/cli/index.js.map +16 -18
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -31177,7 +31177,7 @@ function cleanDoc(doc) {
|
|
|
31177
31177
|
return mapDoc(doc, (currentDoc) => cleanDocFn(currentDoc));
|
|
31178
31178
|
}
|
|
31179
31179
|
function replaceEndOfLine(doc, replacement = literalline) {
|
|
31180
|
-
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ?
|
|
31180
|
+
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ? join31(replacement, currentDoc.split(`
|
|
31181
31181
|
`)) : currentDoc);
|
|
31182
31182
|
}
|
|
31183
31183
|
function canBreakFn(doc) {
|
|
@@ -31257,7 +31257,7 @@ function indentIfBreak(contents, options) {
|
|
|
31257
31257
|
negate: options.negate
|
|
31258
31258
|
};
|
|
31259
31259
|
}
|
|
31260
|
-
function
|
|
31260
|
+
function join31(separator, docs) {
|
|
31261
31261
|
assertDoc(separator);
|
|
31262
31262
|
assertDocArray(docs);
|
|
31263
31263
|
const parts = [];
|
|
@@ -31968,7 +31968,7 @@ var init_doc = __esm(() => {
|
|
|
31968
31968
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
31969
31969
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
31970
31970
|
builders = {
|
|
31971
|
-
join:
|
|
31971
|
+
join: join31,
|
|
31972
31972
|
line,
|
|
31973
31973
|
softline,
|
|
31974
31974
|
hardline,
|
|
@@ -37919,9 +37919,9 @@ function zt3(e, t) {
|
|
|
37919
37919
|
return e.map(() => Pc(e, t), "expressions");
|
|
37920
37920
|
}
|
|
37921
37921
|
function tn2(e, t) {
|
|
37922
|
-
return ft3(e, (r) => typeof r == "string" ? t ? W4(0, r, /(\\*)`/gu, "$1$1\\`") :
|
|
37922
|
+
return ft3(e, (r) => typeof r == "string" ? t ? W4(0, r, /(\\*)`/gu, "$1$1\\`") : ms2(r) : r);
|
|
37923
37923
|
}
|
|
37924
|
-
function
|
|
37924
|
+
function ms2(e) {
|
|
37925
37925
|
return W4(0, e, /([\\`]|\$\{)/gu, "\\$1");
|
|
37926
37926
|
}
|
|
37927
37927
|
function kc({ node: e, parent: t }) {
|
|
@@ -38021,7 +38021,7 @@ async function mo(e, t, r, n, s) {
|
|
|
38021
38021
|
for (let S = 0;S < g.length; S++) {
|
|
38022
38022
|
let j = g[S];
|
|
38023
38023
|
if (S % 2 === 0) {
|
|
38024
|
-
j && (j =
|
|
38024
|
+
j && (j = ms2(j), s.__embeddedInHtml && (j = W4(0, j, /<\/(?=script\b)/giu, "<\\/")), h.push(j));
|
|
38025
38025
|
continue;
|
|
38026
38026
|
}
|
|
38027
38027
|
let U = Number(j);
|
|
@@ -41615,7 +41615,7 @@ function ds2(e) {
|
|
|
41615
41615
|
function qt2(e) {
|
|
41616
41616
|
return Ut3(e) || e === 95;
|
|
41617
41617
|
}
|
|
41618
|
-
function
|
|
41618
|
+
function ms3(e) {
|
|
41619
41619
|
return qt2(e) || Ee3(e);
|
|
41620
41620
|
}
|
|
41621
41621
|
function xs3(e) {
|
|
@@ -44055,7 +44055,7 @@ var init_acorn = __esm(() => {
|
|
|
44055
44055
|
};
|
|
44056
44056
|
f2.regexp_eatUnicodePropertyValue = function(e) {
|
|
44057
44057
|
var t = 0;
|
|
44058
|
-
for (e.lastStringValue = "";
|
|
44058
|
+
for (e.lastStringValue = "";ms3(t = e.current()); )
|
|
44059
44059
|
e.lastStringValue += q5(t), e.advance();
|
|
44060
44060
|
return e.lastStringValue !== "";
|
|
44061
44061
|
};
|
|
@@ -45348,7 +45348,7 @@ var Ci4, _i4, Ti4, an3 = (t) => {
|
|
|
45348
45348
|
toString() {
|
|
45349
45349
|
return this.start.file.content.substring(this.start.offset, this.end.offset);
|
|
45350
45350
|
}
|
|
45351
|
-
}, qe3, Ce5, Rn2, $n2, Dn2, Yi4 = "(:(where|is)\\()?",
|
|
45351
|
+
}, qe3, Ce5, Rn2, $n2, Dn2, Yi4 = "(:(where|is)\\()?", ms4 = "-shadowcsshost", Qi4 = "-shadowcsscontext", Bt3 = "[^)(]*", Ki4, Zi4, zt4, Yr3, Qr3, er4, Kr2, tr4, Zr2, gs3 = "%COMMENT%", eo3, to3, nr4 = "%COMMA_IN_PLACEHOLDER%", sr4 = "%SEMI_IN_PLACEHOLDER%", ir4 = "%COLON_IN_PLACEHOLDER%", no3, so3, io3, f3, ie3, Bn2, On2, Fn2, M5, Vn2, Un2, Hn3, Wn2, R5, qn3, jn2, rr4, vs4, Te4, Gt4, ro3, oo3, ao3, je4 = class {
|
|
45352
45352
|
strings;
|
|
45353
45353
|
expressions;
|
|
45354
45354
|
i18nPlaceholders;
|
|
@@ -47437,10 +47437,10 @@ var init_angular = __esm(() => {
|
|
|
47437
47437
|
Zi4 = `(?:\\(${Ki4}\\)|${Bt3})+?`;
|
|
47438
47438
|
zt4 = `(?:\\((${Zi4})\\))`;
|
|
47439
47439
|
Yr3 = new RegExp("(:nth-[-\\w]+)" + zt4, "g");
|
|
47440
|
-
Qr3 = new RegExp(
|
|
47440
|
+
Qr3 = new RegExp(ms4 + zt4 + "?([^,{]*)", "gim");
|
|
47441
47441
|
er4 = Qi4 + zt4 + "?([^{]*)";
|
|
47442
47442
|
Kr2 = new RegExp(`${Yi4}(${er4})`, "gim");
|
|
47443
|
-
tr4 =
|
|
47443
|
+
tr4 = ms4 + "-no-combinator";
|
|
47444
47444
|
Zr2 = new RegExp(`${tr4}(?![^(]*\\))`, "g");
|
|
47445
47445
|
eo3 = new RegExp(gs3, "g");
|
|
47446
47446
|
to3 = new RegExp(`(\\s*(?:${gs3}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`, "g");
|
|
@@ -48644,7 +48644,7 @@ function qr3(a, t) {
|
|
|
48644
48644
|
return true;
|
|
48645
48645
|
let e = ve6(a);
|
|
48646
48646
|
e && (a = a.slice(e.length));
|
|
48647
|
-
let s =
|
|
48647
|
+
let s = ms5(a, 0);
|
|
48648
48648
|
return s !== false && (a = a.slice(0, s)), zr3.test(a);
|
|
48649
48649
|
}
|
|
48650
48650
|
function $r4(a, t, e) {
|
|
@@ -52298,7 +52298,7 @@ var Hs5, Re5 = (a, t) => {
|
|
|
52298
52298
|
return this.parseV8Intrinsic() || super.parseExprAtom(e);
|
|
52299
52299
|
}
|
|
52300
52300
|
}, Kt5, Ht6, hs4, tr5, pt7, ze5, sr5, ir5, qe4, ut4, Ee5, ua2, Wt6, da2, cs4, ma2, ls4, ps4, us4 = (a) => a === `
|
|
52301
|
-
` || a === "\r" || a === "\u2028" || a === "\u2029", fs23, ds4,
|
|
52301
|
+
` || a === "\r" || a === "\u2028" || a === "\u2029", fs23, ds4, ms5, ve6, ee3 = (a, t) => (e, s, ...i) => e | 1 && s == null ? undefined : (t.call(s) ?? s[a]).apply(s, i), ur5, fr5, xs5, mr3, Ps5, te5, xr4, se5, Pr3, gs4, St6, Ts3, wt6, Ct7, bs4, As4, me6 = null, wr4 = 10, Ss3, c4, ws4, Er4, Cs3, Es3, fn4, Ns4, De5, ks4 = "Unexpected parseExpression() input: ", Me5, vr4, Lr4, xe4, Dr4, Mr4, Or4, Fr4, vs5, Br4, Ls5, Rr4, Ur4, Os4, Fs5, H6, Oe5 = "module", Nt6 = "commonjs", Fe5, ie4 = (a) => H6(Kr3(a)), Vr4, js5 = "v8intrinsic", Vs4, _4 = (a, t = Vr4) => ({ ...t, plugins: [...t.plugins, ...a] }), zr3, Hr3, zs5, Wr2, Jr2, Gr3, Xr2, qs5, Yr4, Lt7, vt7, $s4, ea2, ta2, sa2, ia2, ra2;
|
|
52302
52302
|
var init_babel = __esm(() => {
|
|
52303
52303
|
Hs5 = Object.defineProperty;
|
|
52304
52304
|
Ks4 = {};
|
|
@@ -55433,7 +55433,7 @@ var init_babel = __esm(() => {
|
|
|
55433
55433
|
ps4 = or5;
|
|
55434
55434
|
fs23 = hr5;
|
|
55435
55435
|
ds4 = cr4;
|
|
55436
|
-
|
|
55436
|
+
ms5 = lr4;
|
|
55437
55437
|
ve6 = pr5;
|
|
55438
55438
|
ur5 = Array.prototype.findLast ?? function(a) {
|
|
55439
55439
|
for (let t = this.length - 1;t >= 0; t--) {
|
|
@@ -85877,7 +85877,7 @@ function ps5(e) {
|
|
|
85877
85877
|
function fs24(e, t) {
|
|
85878
85878
|
return { open: e.charAt(2) === "~", close: t.charAt(t.length - 3) === "~" };
|
|
85879
85879
|
}
|
|
85880
|
-
function
|
|
85880
|
+
function ms6(e) {
|
|
85881
85881
|
return e.replace(/^\{\{~?!-?-?/, "").replace(/-?-?~?\}\}$/, "");
|
|
85882
85882
|
}
|
|
85883
85883
|
function ds5(e, t, r, s) {
|
|
@@ -87725,7 +87725,7 @@ Expecting ` + Qt.join(", ") + ", got '" + (this.terminals_[L] || L) + "'" : De =
|
|
|
87725
87725
|
};
|
|
87726
87726
|
jr3 = G6;
|
|
87727
87727
|
Ft7 = {};
|
|
87728
|
-
Oe6(Ft7, { SourceLocation: () => Qe6, id: () => ps5, prepareBlock: () => ys5, prepareMustache: () => gs5, preparePartialBlock: () => ks5, preparePath: () => ds5, prepareProgram: () => Ss4, prepareRawBlock: () => bs5, stripComment: () =>
|
|
87728
|
+
Oe6(Ft7, { SourceLocation: () => Qe6, id: () => ps5, prepareBlock: () => ys5, prepareMustache: () => gs5, preparePartialBlock: () => ks5, preparePath: () => ds5, prepareProgram: () => Ss4, prepareRawBlock: () => bs5, stripComment: () => ms6, stripFlags: () => fs24 });
|
|
87729
87729
|
Qr5 = {};
|
|
87730
87730
|
for (ue5 in Ft7)
|
|
87731
87731
|
Object.prototype.hasOwnProperty.call(Ft7, ue5) && (Qr5[ue5] = Ft7[ue5]);
|
|
@@ -89973,7 +89973,7 @@ spurious results.`);
|
|
|
89973
89973
|
var exports_html = {};
|
|
89974
89974
|
__export(exports_html, {
|
|
89975
89975
|
default: () => ws6,
|
|
89976
|
-
languages: () =>
|
|
89976
|
+
languages: () => ms7,
|
|
89977
89977
|
options: () => ds6,
|
|
89978
89978
|
parsers: () => Qr6,
|
|
89979
89979
|
printers: () => Ll2
|
|
@@ -92502,7 +92502,7 @@ ${e}`, wi7, Ja3 = (e) => e?.kind === "angularControlFlowBlock" && (e.name === "c
|
|
|
92502
92502
|
}
|
|
92503
92503
|
return i;
|
|
92504
92504
|
}
|
|
92505
|
-
}, us6, Ur6 = null, $o2 = () => (Ur6 || (Ur6 = new us6), Ur6), zo2, ps6, al2, hs6,
|
|
92505
|
+
}, us6, Ur6 = null, $o2 = () => (Ur6 || (Ur6 = new us6), Ur6), zo2, ps6, al2, hs6, ms7, Wr4, fs25 = "HTML", ol3, ds6, Qr6, gs6, cl2, Zt8, _s6, er7, Ss5, oe7, $r6, zr5, We9 = class We {
|
|
92506
92506
|
constructor(t = {}) {
|
|
92507
92507
|
tn6(this, oe7);
|
|
92508
92508
|
ir7(this, "kind");
|
|
@@ -92597,7 +92597,7 @@ ${e}`, wi7, Ja3 = (e) => e?.kind === "angularControlFlowBlock" && (e.name === "c
|
|
|
92597
92597
|
var init_html = __esm(() => {
|
|
92598
92598
|
Jr4 = Object.defineProperty;
|
|
92599
92599
|
ws6 = {};
|
|
92600
|
-
en6(ws6, { languages: () =>
|
|
92600
|
+
en6(ws6, { languages: () => ms7, options: () => ds6, parsers: () => Qr6, printers: () => Ll2 });
|
|
92601
92601
|
As6 = String.prototype.replaceAll ?? function(e, t) {
|
|
92602
92602
|
return e.global ? this.replace(e, t) : this.split(e).join(t);
|
|
92603
92603
|
};
|
|
@@ -92998,7 +92998,7 @@ If '${e}' is a directive input, make sure the directive is imported by the curre
|
|
|
92998
92998
|
ps6 = Yo2;
|
|
92999
92999
|
al2 = { features: { experimental_frontMatterSupport: { massageAstNode: true, embed: true, print: true } }, preprocess: ps6, print: sl3, insertPragma: bi7, massageAstNode: dn5, embed: fi7, getVisitorKeys: _i6 };
|
|
93000
93000
|
hs6 = al2;
|
|
93001
|
-
|
|
93001
|
+
ms7 = [{ name: "Angular", type: "markup", aceMode: "html", extensions: [".component.html"], tmScope: "text.html.basic", aliases: ["xhtml"], codemirrorMode: "htmlmixed", codemirrorMimeType: "text/html", parsers: ["angular"], vscodeLanguageIds: ["html"], filenames: [], linguistLanguageId: 146 }, { name: "HTML", type: "markup", aceMode: "html", extensions: [".html", ".hta", ".htm", ".html.hl", ".inc", ".xht", ".xhtml"], tmScope: "text.html.basic", aliases: ["xhtml"], codemirrorMode: "htmlmixed", codemirrorMimeType: "text/html", parsers: ["html"], vscodeLanguageIds: ["html"], linguistLanguageId: 146 }, { name: "Lightning Web Components", type: "markup", aceMode: "html", extensions: [], tmScope: "text.html.basic", aliases: ["xhtml"], codemirrorMode: "htmlmixed", codemirrorMimeType: "text/html", parsers: ["lwc"], vscodeLanguageIds: ["html"], filenames: [], linguistLanguageId: 146 }, { name: "MJML", type: "markup", aceMode: "html", extensions: [".mjml"], tmScope: "text.mjml.basic", aliases: ["MJML", "mjml"], codemirrorMode: "htmlmixed", codemirrorMimeType: "text/html", parsers: ["mjml"], filenames: [], vscodeLanguageIds: ["mjml"], linguistLanguageId: 146 }, { name: "Vue", type: "markup", aceMode: "vue", extensions: [".vue"], tmScope: "source.vue", codemirrorMode: "vue", codemirrorMimeType: "text/x-vue", parsers: ["vue"], vscodeLanguageIds: ["vue"], linguistLanguageId: 391 }];
|
|
93002
93002
|
Wr4 = { bracketSpacing: { category: "Common", type: "boolean", default: true, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, objectWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap object literals.", choices: [{ value: "preserve", description: "Keep as multi-line, if there is a newline between the opening brace and first property." }, { value: "collapse", description: "Fit to a single line when possible." }] }, singleQuote: { category: "Common", type: "boolean", default: false, description: "Use single quotes instead of double quotes." }, proseWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap prose.", choices: [{ value: "always", description: "Wrap prose if it exceeds the print width." }, { value: "never", description: "Do not wrap prose." }, { value: "preserve", description: "Wrap prose as-is." }] }, bracketSameLine: { category: "Common", type: "boolean", default: false, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: false, description: "Enforce single attribute per line in HTML, Vue and JSX." } };
|
|
93003
93003
|
ol3 = { bracketSameLine: Wr4.bracketSameLine, htmlWhitespaceSensitivity: { category: fs25, type: "choice", default: "css", description: "How to handle whitespaces in HTML.", choices: [{ value: "css", description: "Respect the default value of CSS display property." }, { value: "strict", description: "Whitespaces are considered sensitive." }, { value: "ignore", description: "Whitespaces are considered insensitive." }] }, singleAttributePerLine: Wr4.singleAttributePerLine, vueIndentScriptAndStyle: { category: fs25, type: "boolean", default: false, description: "Indent script and style tags in Vue files." } };
|
|
93004
93004
|
ds6 = ol3;
|
|
@@ -94224,7 +94224,7 @@ var El3, Ft10, Cl3, vl3, Al3, bl3, x7 = (e, r) => () => (r || e((r = { exports:
|
|
|
94224
94224
|
for (let i of vl3(r))
|
|
94225
94225
|
!bl3.call(e, i) && i !== t && Ft10(e, i, { get: () => r[i], enumerable: !(n = Cl3(r, i)) || n.enumerable });
|
|
94226
94226
|
return e;
|
|
94227
|
-
}, Re9 = (e, r, t) => (t = e != null ? El3(Al3(e)) : {}, xl3(r || !e || !e.__esModule ? Ft10(t, "default", { value: e, enumerable: true }) : t, e)), Tr6, Qi7, Mt10, uu2, lu2, Du2, Ie9, hu2, Fu2, Eu2, vu2, bu2, xu2, yu2, Se9, Tu2, $e8, Ou2, qu2, Iu2, mr6, Ju2, ea4, na3, ua4, Kt8, sa4, fa3, pa3, Fa4, Ea3, va3, xa3, wa3, Zr6, Qt8, Oa3, Pa3, Le9, rt11, Ua4, za3, ja4, nn7, Ja4, no5, oo5, cn6, po5, se8, ln6, bo3, wo4, Bo3, Oo3, Io4, hn6, Yo3, zo3, jo3, Jo3, rs6, us7, ss7, yn6,
|
|
94227
|
+
}, Re9 = (e, r, t) => (t = e != null ? El3(Al3(e)) : {}, xl3(r || !e || !e.__esModule ? Ft10(t, "default", { value: e, enumerable: true }) : t, e)), Tr6, Qi7, Mt10, uu2, lu2, Du2, Ie9, hu2, Fu2, Eu2, vu2, bu2, xu2, yu2, Se9, Tu2, $e8, Ou2, qu2, Iu2, mr6, Ju2, ea4, na3, ua4, Kt8, sa4, fa3, pa3, Fa4, Ea3, va3, xa3, wa3, Zr6, Qt8, Oa3, Pa3, Le9, rt11, Ua4, za3, ja4, nn7, Ja4, no5, oo5, cn6, po5, se8, ln6, bo3, wo4, Bo3, Oo3, Io4, hn6, Yo3, zo3, jo3, Jo3, rs6, us7, ss7, yn6, ms8, Es6, vs8, ys7, ks7, Bs8, Ps8, Ss6, Ys8, zs8, js8, Hs8, Js8, Zs8, nc2, oc2, cc2, Pn5, Ec2, vc2, bc2, Tc2, qc2, Ic2, Sc2, Rc2, Yc2, zc2, Vc2, el3, gl3, Me9 = (e, r) => (t, n, ...i) => t | 1 && n == null ? undefined : (r.call(n) ?? n[e]).apply(n, i), wl3, U9, kl3, Tl3, R10, $i7, _l3 = () => {}, tr8, V9 = "string", j7 = "array", be9 = "cursor", ee6 = "indent", re6 = "align", De8 = "trim", X10 = "group", J11 = "fill", Q10 = "if-break", pe8 = "indent-if-break", he9 = "line-suffix", de8 = "line-suffix-boundary", $9 = "line", me10 = "label", te9 = "break-parent", Br6, W10, ql2 = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e), gt10, Be8, $n5, Hn5, ne9, Or6, Jn4, Qn5, Ue7, qr5, Nr6, ar8, M9, Sl3, nr7, Ll3 = "cr", Rl2 = "crlf", Ml2 = "\r", Ul2 = `\r
|
|
94228
94228
|
`, Yl2 = `
|
|
94229
94229
|
`, Gl2, ri8 = () => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g, ti8 = "©®‼⁉™ℹ↔↕↖↗↘↙↩↪⌨⏏⏱⏲⏸⏹⏺▪▫▶◀◻◼☀☁☂☃☄☎☑☘☝☠☢☣☦☪☮☯☸☹☺♀♂♟♠♣♥♦♨♻♾⚒⚔⚕⚖⚗⚙⚛⚜⚠⚧⚰⚱⛈⛏⛑⛓⛩⛱⛷⛸⛹✂✈✉✌✍✏✒✔✖✝✡✳✴❄❇❣❤➡⤴⤵⬅⬆⬇", zl2, Wl2, or8, jl2, $l2, vt11, H10, ue8, bt11, Ir5, oi8, si8, ci8, Jl2, Ql2, li8, xt9, fi8, bi8, ef, rf, Di7, nf, hi8 = (e) => String(e).split(/[/\\]/u).pop(), di8 = (e) => String(e).startsWith("file:"), sf = undefined, wt10, Sr6, kt11, sr8 = 3, _e8, gi8 = "format", Ei8, Ci7, Lr7 = (e) => _e8(e).content.trimStart().match(Ci7)?.index === 0, vi8 = (e) => _e8(e).content.trimStart().match(Ei8)?.index === 0, Ai8 = (e) => {
|
|
94230
94230
|
let { frontMatter: r } = _e8(e), t = `<!-- @${gi8} -->`;
|
|
@@ -95901,7 +95901,7 @@ $$`;
|
|
|
95901
95901
|
return n === -1 || t < n ? t : n;
|
|
95902
95902
|
}
|
|
95903
95903
|
});
|
|
95904
|
-
|
|
95904
|
+
ms8 = x7((i2, ds) => {
|
|
95905
95905
|
var br = se8(), T0 = yn6();
|
|
95906
95906
|
ds.exports = hs;
|
|
95907
95907
|
hs.locator = T0;
|
|
@@ -96210,7 +96210,7 @@ $$`;
|
|
|
96210
96210
|
Y.interruptList = [["atxHeading", { pedantic: false }], ["fencedCode", { pedantic: false }], ["thematicBreak", { pedantic: false }], ["definition", { commonmark: false }]];
|
|
96211
96211
|
Y.interruptBlockquote = [["indentedCode", { commonmark: true }], ["fencedCode", { commonmark: true }], ["atxHeading", { commonmark: true }], ["setextHeading", { commonmark: true }], ["thematicBreak", { commonmark: true }], ["html", { commonmark: true }], ["list", { commonmark: true }], ["definition", { commonmark: false }]];
|
|
96212
96212
|
Y.blockTokenizers = { blankLine: wa3(), indentedCode: Oa3(), fencedCode: Pa3(), blockquote: Ua4(), atxHeading: za3(), thematicBreak: ja4(), list: no5(), setextHeading: oo5(), html: po5(), definition: bo3(), table: wo4(), paragraph: Bo3() };
|
|
96213
|
-
Y.inlineTokenizers = { escape: Io4(), autoLink: Yo3(), url: Jo3(), email: us7(), html: ss7(), link:
|
|
96213
|
+
Y.inlineTokenizers = { escape: Io4(), autoLink: Yo3(), url: Jo3(), email: us7(), html: ss7(), link: ms8(), reference: Es6(), strong: ys7(), emphasis: Ps8(), deletion: Ys8(), code: js8(), break: Js8(), text: Zs8() };
|
|
96214
96214
|
Y.blockMethods = rc(Y.blockTokenizers);
|
|
96215
96215
|
Y.inlineMethods = rc(Y.inlineTokenizers);
|
|
96216
96216
|
Y.tokenizeBlock = Nn("block");
|
|
@@ -124807,7 +124807,7 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124807
124807
|
}
|
|
124808
124808
|
}
|
|
124809
124809
|
}, ast_path_default, is_object_default, skipWhitespace, skipSpaces, skipToLineEnd, skipEverythingButNewLine, isNewlineCharacter = (character) => character === `
|
|
124810
|
-
` || character === "\r" || character === "\u2028" || character === "\u2029", skip_newline_default, has_newline_default, is_non_empty_array_default, get_sorted_child_nodes_default, childNodesCache, returnFalse = () => false, isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/u.test(text), is_previous_line_empty_default, breakParent2, hardline2, indent2,
|
|
124810
|
+
` || character === "\r" || character === "\u2028" || character === "\u2029", skip_newline_default, has_newline_default, is_non_empty_array_default, get_sorted_child_nodes_default, childNodesCache, returnFalse = () => false, isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/u.test(text), is_previous_line_empty_default, breakParent2, hardline2, indent2, join33, line22, lineSuffix2, create_print_pre_check_function_default = () => noop_default2, core_options_evaluate_default, arrayToReversed, toReversed, method_to_reversed_default, import_n_readlines, get_interpreter_default, getFileBasename = (file) => {
|
|
124811
124811
|
try {
|
|
124812
124812
|
return path112.basename(toPath3(file));
|
|
124813
124813
|
} catch {
|
|
@@ -134836,7 +134836,7 @@ ${codeblock}`, options8);
|
|
|
134836
134836
|
breakParent: breakParent2,
|
|
134837
134837
|
hardline: hardline2,
|
|
134838
134838
|
indent: indent2,
|
|
134839
|
-
join:
|
|
134839
|
+
join: join33,
|
|
134840
134840
|
line: line22,
|
|
134841
134841
|
lineSuffix: lineSuffix2
|
|
134842
134842
|
} = builders);
|
|
@@ -228838,7 +228838,7 @@ function normalizeBase44Env() {
|
|
|
228838
228838
|
loadProjectEnvFiles();
|
|
228839
228839
|
|
|
228840
228840
|
// src/cli/index.ts
|
|
228841
|
-
import { dirname as dirname30, join as
|
|
228841
|
+
import { dirname as dirname30, join as join41 } from "node:path";
|
|
228842
228842
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
228843
228843
|
|
|
228844
228844
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -239376,7 +239376,7 @@ import { join as join13 } from "node:path";
|
|
|
239376
239376
|
// package.json
|
|
239377
239377
|
var package_default = {
|
|
239378
239378
|
name: "base44",
|
|
239379
|
-
version: "0.1.
|
|
239379
|
+
version: "0.1.33",
|
|
239380
239380
|
description: "Base44 CLI - Unified interface for managing Base44 applications",
|
|
239381
239381
|
type: "module",
|
|
239382
239382
|
bin: {
|
|
@@ -246837,21 +246837,10 @@ var {
|
|
|
246837
246837
|
} = getIpcExport();
|
|
246838
246838
|
|
|
246839
246839
|
// src/core/utils/git.ts
|
|
246840
|
-
import { dirname as dirname13, join as join19 } from "node:path";
|
|
246841
246840
|
var GIT_HASH_PATTERN = /^[a-fA-F0-9]{7,64}$/;
|
|
246842
246841
|
function isGitCommitHash(value) {
|
|
246843
246842
|
return GIT_HASH_PATTERN.test(value);
|
|
246844
246843
|
}
|
|
246845
|
-
async function findGitRoot2(startPath = process.cwd()) {
|
|
246846
|
-
let current = startPath;
|
|
246847
|
-
while (!await pathExists(join19(current, ".git"))) {
|
|
246848
|
-
const parent = dirname13(current);
|
|
246849
|
-
if (parent === current)
|
|
246850
|
-
return;
|
|
246851
|
-
current = parent;
|
|
246852
|
-
}
|
|
246853
|
-
return current;
|
|
246854
|
-
}
|
|
246855
246844
|
|
|
246856
246845
|
// src/core/site/git-hash.ts
|
|
246857
246846
|
async function resolveGitHash(projectRoot, explicit) {
|
|
@@ -246963,19 +246952,20 @@ async function deployAll(projectData, options) {
|
|
|
246963
246952
|
return { connectorResults };
|
|
246964
246953
|
}
|
|
246965
246954
|
// src/core/project/target.ts
|
|
246966
|
-
import { dirname as
|
|
246955
|
+
import { dirname as dirname13, join as join19, resolve as resolve6 } from "node:path";
|
|
246967
246956
|
async function resolveBuildTarget(projectRoot, overrides = {}) {
|
|
246968
246957
|
const project = await readSettingsIfPresent(projectRoot);
|
|
246969
246958
|
const root = project?.root ?? projectRoot ?? process.cwd();
|
|
246970
246959
|
const site = project ? siteOrDefault(project) : DEFAULT_SITE;
|
|
246971
246960
|
return {
|
|
246972
246961
|
root,
|
|
246973
|
-
configDir: project ?
|
|
246962
|
+
configDir: project ? dirname13(project.configPath) : join19(root, PROJECT_SUBDIR),
|
|
246974
246963
|
buildCommand: site.buildCommand,
|
|
246975
246964
|
outputDir: resolve6(root, overrides.outputDir ?? site.outputDirectory ?? DEFAULT_SITE.outputDirectory),
|
|
246976
246965
|
entitiesDir: project?.entitiesDir ?? "entities",
|
|
246977
246966
|
agentsDir: project?.agentsDir ?? "agents",
|
|
246978
|
-
functionsDir: project?.functionsDir ?? "functions"
|
|
246967
|
+
functionsDir: project?.functionsDir ?? "functions",
|
|
246968
|
+
actorsDir: project?.actorsDir ?? "actors"
|
|
246979
246969
|
};
|
|
246980
246970
|
}
|
|
246981
246971
|
async function readSettingsIfPresent(projectRoot) {
|
|
@@ -247706,9 +247696,6 @@ function getConnectorsUrl(projectId) {
|
|
|
247706
247696
|
const id = projectId ?? getAppContext().id;
|
|
247707
247697
|
return `${getBase44ApiUrl()}/apps/${id}/editor/workspace/app-connections`;
|
|
247708
247698
|
}
|
|
247709
|
-
function getBaseCodeUrl(appId, branchName) {
|
|
247710
|
-
return `${getBase44ApiUrl()}/apps/${appId}/editor/workspace/code?branch=${encodeURIComponent(branchName)}`;
|
|
247711
|
-
}
|
|
247712
247699
|
// src/cli/utils/yaml.ts
|
|
247713
247700
|
var import_lodash = __toESM(require_lodash8(), 1);
|
|
247714
247701
|
var YAML_INDENT = 2;
|
|
@@ -247835,7 +247822,7 @@ function getActorsCommand() {
|
|
|
247835
247822
|
}
|
|
247836
247823
|
|
|
247837
247824
|
// src/cli/commands/agent-skills/pull.ts
|
|
247838
|
-
import { dirname as
|
|
247825
|
+
import { dirname as dirname14, join as join20 } from "node:path";
|
|
247839
247826
|
// src/core/utils/dependencies.ts
|
|
247840
247827
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
247841
247828
|
function verifyDenoInstalled(context) {
|
|
@@ -247924,7 +247911,7 @@ async function pullAction({
|
|
|
247924
247911
|
runTask
|
|
247925
247912
|
}) {
|
|
247926
247913
|
const { project } = await readProjectConfig();
|
|
247927
|
-
const dir =
|
|
247914
|
+
const dir = join20(dirname14(project.configPath), project.agentSkillsDir);
|
|
247928
247915
|
const remote = await runTask("Fetching agent skills from Base44", () => fetchAgentSkills(), {
|
|
247929
247916
|
successMessage: "Agent skills fetched successfully",
|
|
247930
247917
|
errorMessage: "Failed to fetch agent skills"
|
|
@@ -247980,14 +247967,14 @@ function getAgentSkillsCommand() {
|
|
|
247980
247967
|
}
|
|
247981
247968
|
|
|
247982
247969
|
// src/cli/commands/agents/pull.ts
|
|
247983
|
-
import { dirname as
|
|
247970
|
+
import { dirname as dirname15, join as join21 } from "node:path";
|
|
247984
247971
|
async function pullAgentsAction({
|
|
247985
247972
|
log,
|
|
247986
247973
|
runTask
|
|
247987
247974
|
}) {
|
|
247988
247975
|
const { project } = await readProjectConfig();
|
|
247989
|
-
const configDir =
|
|
247990
|
-
const agentsDir =
|
|
247976
|
+
const configDir = dirname15(project.configPath);
|
|
247977
|
+
const agentsDir = join21(configDir, project.agentsDir);
|
|
247991
247978
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
247992
247979
|
return await fetchAgents();
|
|
247993
247980
|
}, {
|
|
@@ -249563,11 +249550,11 @@ function redactedApiError(apiError, raw, method, path, retryAfter) {
|
|
|
249563
249550
|
}
|
|
249564
249551
|
// src/core/api-spec/spec.ts
|
|
249565
249552
|
import { rename, rm, stat as stat3 } from "node:fs/promises";
|
|
249566
|
-
import { join as
|
|
249553
|
+
import { join as join22 } from "node:path";
|
|
249567
249554
|
var SPEC_CACHE_TTL_MS = 60 * 60 * 1000;
|
|
249568
249555
|
function getSpecCachePath(apiUrl = getBase44ApiUrl()) {
|
|
249569
249556
|
const server = new URL(apiUrl).host.replace(/[^a-zA-Z0-9.-]/g, "_");
|
|
249570
|
-
return
|
|
249557
|
+
return join22(getBase44GlobalDir(), "cache", server, "openapi.json");
|
|
249571
249558
|
}
|
|
249572
249559
|
function isSpecCacheFresh(mtimeMs, now = Date.now()) {
|
|
249573
249560
|
return now - mtimeMs < SPEC_CACHE_TTL_MS;
|
|
@@ -249917,12 +249904,12 @@ function getApiCommand() {
|
|
|
249917
249904
|
}
|
|
249918
249905
|
|
|
249919
249906
|
// src/cli/commands/auth/password-login.ts
|
|
249920
|
-
import { dirname as
|
|
249907
|
+
import { dirname as dirname16, join as join23 } from "node:path";
|
|
249921
249908
|
async function passwordLoginAction({ log, runTask }, action) {
|
|
249922
249909
|
const shouldEnable = action === "enable";
|
|
249923
249910
|
const { project } = await readProjectConfig();
|
|
249924
|
-
const configDir =
|
|
249925
|
-
const authDir =
|
|
249911
|
+
const configDir = dirname16(project.configPath);
|
|
249912
|
+
const authDir = join23(configDir, project.authDir);
|
|
249926
249913
|
const updated = await runTask("Updating local auth config", async () => {
|
|
249927
249914
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
249928
249915
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -249942,14 +249929,14 @@ function getPasswordLoginCommand() {
|
|
|
249942
249929
|
}
|
|
249943
249930
|
|
|
249944
249931
|
// src/cli/commands/auth/pull.ts
|
|
249945
|
-
import { dirname as
|
|
249932
|
+
import { dirname as dirname17, join as join24 } from "node:path";
|
|
249946
249933
|
async function pullAuthAction({
|
|
249947
249934
|
log,
|
|
249948
249935
|
runTask
|
|
249949
249936
|
}) {
|
|
249950
249937
|
const { project } = await readProjectConfig();
|
|
249951
|
-
const configDir =
|
|
249952
|
-
const authDir =
|
|
249938
|
+
const configDir = dirname17(project.configPath);
|
|
249939
|
+
const authDir = join24(configDir, project.authDir);
|
|
249953
249940
|
const remoteConfig = await runTask("Fetching auth config from Base44", async () => {
|
|
249954
249941
|
return await pullAuthConfig();
|
|
249955
249942
|
}, {
|
|
@@ -250013,7 +250000,7 @@ function getAuthPushCommand() {
|
|
|
250013
250000
|
}
|
|
250014
250001
|
|
|
250015
250002
|
// src/cli/commands/auth/social-login.ts
|
|
250016
|
-
import { dirname as
|
|
250003
|
+
import { dirname as dirname18, join as join25, resolve as resolve7 } from "node:path";
|
|
250017
250004
|
var PROVIDER_LABELS = {
|
|
250018
250005
|
google: "Google",
|
|
250019
250006
|
microsoft: "Microsoft",
|
|
@@ -250083,8 +250070,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask }, provider, a
|
|
|
250083
250070
|
}
|
|
250084
250071
|
}
|
|
250085
250072
|
const { project } = await readProjectConfig();
|
|
250086
|
-
const configDir =
|
|
250087
|
-
const authDir =
|
|
250073
|
+
const configDir = dirname18(project.configPath);
|
|
250074
|
+
const authDir = join25(configDir, project.authDir);
|
|
250088
250075
|
const { config: updated } = await runTask("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
250089
250076
|
if (clientSecret) {
|
|
250090
250077
|
await runTask("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -250109,7 +250096,7 @@ function getSocialLoginCommand() {
|
|
|
250109
250096
|
}
|
|
250110
250097
|
|
|
250111
250098
|
// src/cli/commands/auth/sso.ts
|
|
250112
|
-
import { dirname as
|
|
250099
|
+
import { dirname as dirname19, join as join26, resolve as resolve8 } from "node:path";
|
|
250113
250100
|
var SSOConfigFileSchema = object({
|
|
250114
250101
|
provider: _enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
250115
250102
|
clientId: string2(),
|
|
@@ -250272,8 +250259,8 @@ async function ssoEnableAction({ isNonInteractive, runTask }, options) {
|
|
|
250272
250259
|
throw error;
|
|
250273
250260
|
}
|
|
250274
250261
|
const { project } = await readProjectConfig();
|
|
250275
|
-
const configDir =
|
|
250276
|
-
const authDir =
|
|
250262
|
+
const configDir = dirname19(project.configPath);
|
|
250263
|
+
const authDir = join26(configDir, project.authDir);
|
|
250277
250264
|
await runTask("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
250278
250265
|
await runTask("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
250279
250266
|
return {
|
|
@@ -250288,8 +250275,8 @@ async function ssoDisableAction({ log, runTask }, options) {
|
|
|
250288
250275
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
250289
250276
|
}
|
|
250290
250277
|
const { project } = await readProjectConfig();
|
|
250291
|
-
const configDir =
|
|
250292
|
-
const authDir =
|
|
250278
|
+
const configDir = dirname19(project.configPath);
|
|
250279
|
+
const authDir = join26(configDir, project.authDir);
|
|
250293
250280
|
const updated = await runTask("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
250294
250281
|
await runTask("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
250295
250282
|
if (!hasAnyLoginMethod(updated)) {
|
|
@@ -251171,13 +251158,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
251171
251158
|
}
|
|
251172
251159
|
|
|
251173
251160
|
// src/cli/commands/connectors/pull.ts
|
|
251174
|
-
import { dirname as
|
|
251161
|
+
import { dirname as dirname20, join as join27, resolve as resolve9 } from "node:path";
|
|
251175
251162
|
async function resolveConnectorsDir(options) {
|
|
251176
251163
|
if (!getAppContext().projectRoot) {
|
|
251177
251164
|
return resolve9(options.dir ?? "connectors");
|
|
251178
251165
|
}
|
|
251179
251166
|
const { project } = await readProjectConfig();
|
|
251180
|
-
return
|
|
251167
|
+
return join27(dirname20(project.configPath), project.connectorsDir);
|
|
251181
251168
|
}
|
|
251182
251169
|
async function pullConnectorsAction({ log, runTask, jsonMode }, options) {
|
|
251183
251170
|
const connectorsDir = await resolveConnectorsDir(options);
|
|
@@ -251564,11 +251551,11 @@ function getListCommand() {
|
|
|
251564
251551
|
}
|
|
251565
251552
|
|
|
251566
251553
|
// src/cli/commands/functions/pull.ts
|
|
251567
|
-
import { dirname as
|
|
251554
|
+
import { dirname as dirname21, join as join28 } from "node:path";
|
|
251568
251555
|
async function pullFunctionsAction({ log, runTask }, name) {
|
|
251569
251556
|
const { project, functions } = await readProjectConfig();
|
|
251570
|
-
const configDir =
|
|
251571
|
-
const functionsDir =
|
|
251557
|
+
const configDir = dirname21(project.configPath);
|
|
251558
|
+
const functionsDir = join28(configDir, project.functionsDir);
|
|
251572
251559
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
251573
251560
|
const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
|
|
251574
251561
|
const { functions } = await listDeployedFunctions();
|
|
@@ -251682,7 +251669,7 @@ import { basename as basename7, resolve as resolve11 } from "node:path";
|
|
|
251682
251669
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
251683
251670
|
|
|
251684
251671
|
// src/cli/commands/project/scaffold-shared.ts
|
|
251685
|
-
import { join as
|
|
251672
|
+
import { join as join29 } from "node:path";
|
|
251686
251673
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
251687
251674
|
async function getTemplateById(templateId) {
|
|
251688
251675
|
const templates = await listTemplates();
|
|
@@ -251745,7 +251732,7 @@ async function completeProjectSetup({
|
|
|
251745
251732
|
env: { VITE_BASE44_APP_ID: projectId }
|
|
251746
251733
|
})`${buildCommand}`;
|
|
251747
251734
|
updateMessage("Deploying site...");
|
|
251748
|
-
return await deploySite(
|
|
251735
|
+
return await deploySite(join29(resolvedPath, outputDirectory));
|
|
251749
251736
|
}, {
|
|
251750
251737
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
251751
251738
|
errorMessage: "Failed to deploy site"
|
|
@@ -252667,6 +252654,25 @@ function declaredBundle({
|
|
|
252667
252654
|
}
|
|
252668
252655
|
};
|
|
252669
252656
|
}
|
|
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
|
+
}
|
|
252670
252676
|
function declaredServingConfig(config) {
|
|
252671
252677
|
const stated = {
|
|
252672
252678
|
html_handling: config?.htmlHandling ?? null,
|
|
@@ -252721,6 +252727,7 @@ async function createVersion(artifacts, options = {}) {
|
|
|
252721
252727
|
}
|
|
252722
252728
|
} : {},
|
|
252723
252729
|
backend_bundles: artifacts.backendBundles.map(declaredBundle),
|
|
252730
|
+
actors: artifacts.actors.map(declaredActor),
|
|
252724
252731
|
entities: artifacts.entities,
|
|
252725
252732
|
agents: artifacts.agents,
|
|
252726
252733
|
source_commit: options.sourceCommit
|
|
@@ -252729,7 +252736,8 @@ async function createVersion(artifacts, options = {}) {
|
|
|
252729
252736
|
...artifacts.assets,
|
|
252730
252737
|
...artifacts.siteWorker?.modules ?? []
|
|
252731
252738
|
];
|
|
252732
|
-
const
|
|
252739
|
+
const actorsAt = declaredFiles.length + artifacts.backendBundles.length;
|
|
252740
|
+
const slotCount = actorsAt + artifacts.actors.length;
|
|
252733
252741
|
options.progress?.onDeclared?.({ fileCount: slotCount });
|
|
252734
252742
|
if (declared.uploads.length !== slotCount) {
|
|
252735
252743
|
throw new InternalError(`Declared ${slotCount} files but the server signed ${declared.uploads.length} upload URLs.`);
|
|
@@ -252738,12 +252746,18 @@ async function createVersion(artifacts, options = {}) {
|
|
|
252738
252746
|
if (drifted !== -1) {
|
|
252739
252747
|
throw new InternalError(`Upload ${drifted} is signed for ${declared.uploads[drifted].path}, but that slot declared ${declaredFiles[drifted].path}.`);
|
|
252740
252748
|
}
|
|
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
|
+
}
|
|
252741
252753
|
let uploadedFiles = 0;
|
|
252742
252754
|
await pMap(declared.uploads, async (upload, index) => {
|
|
252743
252755
|
if (index < declaredFiles.length) {
|
|
252744
252756
|
await putPresigned(upload, declaredFiles[index].absolutePath);
|
|
252745
|
-
} else {
|
|
252757
|
+
} else if (index < actorsAt) {
|
|
252746
252758
|
await putPresignedBody(upload, artifacts.backendBundles[index - declaredFiles.length].module);
|
|
252759
|
+
} else {
|
|
252760
|
+
await putPresignedBody(upload, artifacts.actors[index - actorsAt].module);
|
|
252747
252761
|
}
|
|
252748
252762
|
uploadedFiles++;
|
|
252749
252763
|
options.progress?.onUpload?.({
|
|
@@ -252761,11 +252775,10 @@ async function setEnvironmentVersion(environment, versionId, options = {}) {
|
|
|
252761
252775
|
}
|
|
252762
252776
|
// src/core/version/artifacts.ts
|
|
252763
252777
|
import { createHash as createHash3 } from "node:crypto";
|
|
252764
|
-
import { join as
|
|
252778
|
+
import { join as join30, resolve as resolve14 } from "node:path";
|
|
252765
252779
|
|
|
252766
|
-
// src/core/version/
|
|
252767
|
-
import {
|
|
252768
|
-
import { relative as relative6 } from "node:path";
|
|
252780
|
+
// src/core/version/actors.ts
|
|
252781
|
+
import { dirname as dirname22, relative as relative7, resolve as resolve13 } from "node:path";
|
|
252769
252782
|
|
|
252770
252783
|
// ../functions-compiler/src/assembly.ts
|
|
252771
252784
|
import path17 from "node:path";
|
|
@@ -258299,6 +258312,18 @@ function consolePatch(runtimeSecrets) {
|
|
|
258299
258312
|
return runtimeSecrets ? `${CONSOLE_PATCH}
|
|
258300
258313
|
${RUNTIME_SECRETS_RESERVED_PATCH}` : CONSOLE_PATCH;
|
|
258301
258314
|
}
|
|
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
|
+
}
|
|
258302
258327
|
var BANNER_FORMAT = 1;
|
|
258303
258328
|
function buildBanner(entries, telemetry, runtimeSecrets) {
|
|
258304
258329
|
return `//!b44:${BANNER_FORMAT} ${JSON.stringify({
|
|
@@ -258342,6 +258367,50 @@ function activationImport(runtimeSecrets) {
|
|
|
258342
258367
|
return runtimeSecrets ? `
|
|
258343
258368
|
import { ensureActivation, takeActivationChallenge, withoutActivationHeaders } from "./${ACTIVATION_FILENAME}";` : "";
|
|
258344
258369
|
}
|
|
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
|
+
}
|
|
258345
258414
|
function buildFunctionModuleSource(functionName, userEntry) {
|
|
258346
258415
|
const userImport = `./${userEntry.replace(/^\.\//, "")}`;
|
|
258347
258416
|
return `// Auto-generated by the base44 bundler. Do not edit.
|
|
@@ -258644,6 +258713,284 @@ function runtimeContextVirtualPlugin() {
|
|
|
258644
258713
|
};
|
|
258645
258714
|
}
|
|
258646
258715
|
|
|
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
|
+
|
|
258647
258994
|
// ../../node_modules/zod/v3/helpers/util.js
|
|
258648
258995
|
var util;
|
|
258649
258996
|
(function(util) {
|
|
@@ -262521,6 +262868,64 @@ function logEvent(level, event, fields = {}) {
|
|
|
262521
262868
|
sink(level, event, fields);
|
|
262522
262869
|
}
|
|
262523
262870
|
|
|
262871
|
+
// ../functions-compiler/src/fetch-guard.ts
|
|
262872
|
+
var ALLOWED_HOST_SUFFIXES = ["npmjs.org", "jsr.io", "esm.sh", "deno.land"];
|
|
262873
|
+
var MAX_RESPONSE_BYTES = 30 * 1024 * 1024;
|
|
262874
|
+
function requestUrl(input) {
|
|
262875
|
+
if (input instanceof URL)
|
|
262876
|
+
return input;
|
|
262877
|
+
if (typeof input === "string")
|
|
262878
|
+
return new URL(input);
|
|
262879
|
+
return new URL(input.url);
|
|
262880
|
+
}
|
|
262881
|
+
function isDependencyHost(hostname) {
|
|
262882
|
+
return ALLOWED_HOST_SUFFIXES.some((suffix) => hostname === suffix || hostname.endsWith(`.${suffix}`));
|
|
262883
|
+
}
|
|
262884
|
+
|
|
262885
|
+
// ../functions-compiler/src/dependency-fetch-retry.ts
|
|
262886
|
+
var RETRY_DELAYS_MS = [250, 1000];
|
|
262887
|
+
var installed = false;
|
|
262888
|
+
function installDependencyFetchRetry() {
|
|
262889
|
+
if (installed)
|
|
262890
|
+
return;
|
|
262891
|
+
installed = true;
|
|
262892
|
+
globalThis.fetch = createRetryingFetch(globalThis.fetch.bind(globalThis));
|
|
262893
|
+
}
|
|
262894
|
+
function createRetryingFetch(originalFetch, delaysMs = RETRY_DELAYS_MS) {
|
|
262895
|
+
return async (input, init) => {
|
|
262896
|
+
const url = requestUrl(input);
|
|
262897
|
+
const method = init?.method ?? (input instanceof Request ? input.method : "GET");
|
|
262898
|
+
if (method.toUpperCase() !== "GET" || !isDependencyHost(url.hostname)) {
|
|
262899
|
+
return originalFetch(input, init);
|
|
262900
|
+
}
|
|
262901
|
+
for (let attempt = 0;; attempt++) {
|
|
262902
|
+
const delay = delaysMs[attempt];
|
|
262903
|
+
let response;
|
|
262904
|
+
let error;
|
|
262905
|
+
try {
|
|
262906
|
+
response = await originalFetch(input, init);
|
|
262907
|
+
if (response.status !== 429 && response.status < 500)
|
|
262908
|
+
return response;
|
|
262909
|
+
} catch (err) {
|
|
262910
|
+
error = err;
|
|
262911
|
+
}
|
|
262912
|
+
logEvent(delay === undefined ? "error" : "warn", "base44.bundler.dependency_fetch_failed", {
|
|
262913
|
+
url: url.href,
|
|
262914
|
+
attempt: attempt + 1,
|
|
262915
|
+
http_status: response?.status,
|
|
262916
|
+
error: response ? undefined : String(error?.cause ?? error)
|
|
262917
|
+
});
|
|
262918
|
+
if (delay === undefined) {
|
|
262919
|
+
if (response)
|
|
262920
|
+
return response;
|
|
262921
|
+
throw error;
|
|
262922
|
+
}
|
|
262923
|
+
await response?.body?.cancel();
|
|
262924
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
262925
|
+
}
|
|
262926
|
+
};
|
|
262927
|
+
}
|
|
262928
|
+
|
|
262524
262929
|
// ../functions-compiler/src/esbuild/deno-resolver.ts
|
|
262525
262930
|
var NAMESPACES = ["file", "http", "https", "data", "npm", "jsr"];
|
|
262526
262931
|
var RESOLVE_NAMESPACES = [...NAMESPACES, USER_NAMESPACE];
|
|
@@ -262529,6 +262934,7 @@ function denoResolverPlugin(options = {}) {
|
|
|
262529
262934
|
return {
|
|
262530
262935
|
name: "deno-resolver",
|
|
262531
262936
|
async setup(build) {
|
|
262937
|
+
installDependencyFetchRetry();
|
|
262532
262938
|
deno = await lazyDenoLoader();
|
|
262533
262939
|
const baseDir = options.configPath ? path20.dirname(options.configPath) : undefined;
|
|
262534
262940
|
const depRoots = [denoCacheRoot(), baseDir].filter((d) => Boolean(d)).map(canonicalPath);
|
|
@@ -263148,6 +263554,51 @@ function setSpanTags(tags) {
|
|
|
263148
263554
|
// ../functions-compiler/src/bundler.ts
|
|
263149
263555
|
var NORMALIZED_MAIN_MODULE = "_bundled.mjs";
|
|
263150
263556
|
var MAX_PARALLEL_COMPILES = 4;
|
|
263557
|
+
async function bundle(req) {
|
|
263558
|
+
let actor;
|
|
263559
|
+
try {
|
|
263560
|
+
actor = applyActorCompat(req.entry, req.files);
|
|
263561
|
+
} catch (e) {
|
|
263562
|
+
return denoCompatErrorOrThrow(e);
|
|
263563
|
+
}
|
|
263564
|
+
if (actor) {
|
|
263565
|
+
if (req.runtimeSecrets) {
|
|
263566
|
+
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."));
|
|
263567
|
+
}
|
|
263568
|
+
const outcome = await installAndCompile({
|
|
263569
|
+
entry: actor.entry,
|
|
263570
|
+
files: actor.files
|
|
263571
|
+
});
|
|
263572
|
+
if (outcome.ok) {
|
|
263573
|
+
return {
|
|
263574
|
+
ok: true,
|
|
263575
|
+
module: outcome.module,
|
|
263576
|
+
main_module: NORMALIZED_MAIN_MODULE,
|
|
263577
|
+
warnings: outcome.warnings,
|
|
263578
|
+
handler_name: actor.handlerName,
|
|
263579
|
+
do_class_name: actor.doClassName
|
|
263580
|
+
};
|
|
263581
|
+
}
|
|
263582
|
+
return { ok: false, stage: outcome.stage, errors: outcome.errors };
|
|
263583
|
+
}
|
|
263584
|
+
let prepared;
|
|
263585
|
+
try {
|
|
263586
|
+
prepared = await prepareFunction(req.entry, req.files, req.postResponseTelemetry, req.runtimeSecrets);
|
|
263587
|
+
} catch (e) {
|
|
263588
|
+
return denoCompatErrorOrThrow(e);
|
|
263589
|
+
}
|
|
263590
|
+
const outcome = await installAndCompile(prepared);
|
|
263591
|
+
if (outcome.ok) {
|
|
263592
|
+
return {
|
|
263593
|
+
ok: true,
|
|
263594
|
+
module: outcome.module,
|
|
263595
|
+
main_module: NORMALIZED_MAIN_MODULE,
|
|
263596
|
+
warnings: outcome.warnings,
|
|
263597
|
+
...activationField(req.runtimeSecrets ?? false)
|
|
263598
|
+
};
|
|
263599
|
+
}
|
|
263600
|
+
return { ok: false, stage: outcome.stage, errors: outcome.errors };
|
|
263601
|
+
}
|
|
263151
263602
|
function activationField(runtimeSecrets) {
|
|
263152
263603
|
return runtimeSecrets ? { activation: ACTIVATION_MODE } : {};
|
|
263153
263604
|
}
|
|
@@ -263335,11 +263786,19 @@ async function installAndCompile(prepared) {
|
|
|
263335
263786
|
return { ok: false, stage: "esbuild", errors: result.errors };
|
|
263336
263787
|
});
|
|
263337
263788
|
}
|
|
263789
|
+
function denoCompatErrorOrThrow(e) {
|
|
263790
|
+
if (e instanceof DenoCompatError) {
|
|
263791
|
+
return {
|
|
263792
|
+
ok: false,
|
|
263793
|
+
stage: "deno_compat",
|
|
263794
|
+
errors: [denoCompatErrorItem(e)]
|
|
263795
|
+
};
|
|
263796
|
+
}
|
|
263797
|
+
throw e;
|
|
263798
|
+
}
|
|
263338
263799
|
function denoCompatErrorItem(e) {
|
|
263339
263800
|
return { message: e.message, file: e.file };
|
|
263340
263801
|
}
|
|
263341
|
-
// ../functions-compiler/src/fetch-guard.ts
|
|
263342
|
-
var MAX_RESPONSE_BYTES = 30 * 1024 * 1024;
|
|
263343
263802
|
// ../functions-compiler/src/static-egress-marker.ts
|
|
263344
263803
|
var STATIC_EGRESS_ARTIFACT_MARKER = "base44.static-egress.request-env.v2";
|
|
263345
263804
|
|
|
@@ -263537,6 +263996,8 @@ async function mapWithConcurrency2(items, limit, fn) {
|
|
|
263537
263996
|
return results;
|
|
263538
263997
|
}
|
|
263539
263998
|
// src/core/version/functions.ts
|
|
263999
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
264000
|
+
import { relative as relative6 } from "node:path";
|
|
263540
264001
|
var SHARD_POLICY = {
|
|
263541
264002
|
shardSize: 100,
|
|
263542
264003
|
globalShardSize: 100,
|
|
@@ -263544,11 +264005,11 @@ var SHARD_POLICY = {
|
|
|
263544
264005
|
gzipCapBytes: 9500000
|
|
263545
264006
|
};
|
|
263546
264007
|
var COMPILE_MODES = { runtimeSecrets: false, postResponseTelemetry: false };
|
|
263547
|
-
async function requireCompilerRuntime() {
|
|
264008
|
+
async function requireCompilerRuntime(what = "Backend functions") {
|
|
263548
264009
|
try {
|
|
263549
264010
|
await Promise.all([import("esbuild"), import("@deno/loader")]);
|
|
263550
264011
|
} catch (error) {
|
|
263551
|
-
throw new DependencyNotFoundError(
|
|
264012
|
+
throw new DependencyNotFoundError(`${what} cannot be compiled by this installation of the CLI.`, {
|
|
263552
264013
|
hints: [{ message: "Install the CLI from npm: npm install -g base44" }],
|
|
263553
264014
|
cause: error instanceof Error ? error : undefined
|
|
263554
264015
|
});
|
|
@@ -263605,6 +264066,97 @@ async function compileBackendBundles(root, functionsDir) {
|
|
|
263605
264066
|
});
|
|
263606
264067
|
}
|
|
263607
264068
|
|
|
264069
|
+
// src/core/version/actors.ts
|
|
264070
|
+
var MAX_ACTORS = 50;
|
|
264071
|
+
var COMPILE_CONCURRENCY = 4;
|
|
264072
|
+
var ACTORS_ROOT = "base44/actors";
|
|
264073
|
+
var SHARED_ROOT = "base44/shared";
|
|
264074
|
+
function forwardSlashed(from, to) {
|
|
264075
|
+
return relative7(from, to).split(/[/\\]/).join("/");
|
|
264076
|
+
}
|
|
264077
|
+
async function readSharedFiles2(actorsDir) {
|
|
264078
|
+
const sharedDir = resolve13(actorsDir, "..", "shared");
|
|
264079
|
+
if (!await pathExists(sharedDir)) {
|
|
264080
|
+
return {};
|
|
264081
|
+
}
|
|
264082
|
+
const paths = await globby(BACKEND_FILE_GLOB, {
|
|
264083
|
+
cwd: sharedDir,
|
|
264084
|
+
absolute: true
|
|
264085
|
+
});
|
|
264086
|
+
const files = {};
|
|
264087
|
+
for (const path of paths.sort()) {
|
|
264088
|
+
files[`${SHARED_ROOT}/${forwardSlashed(sharedDir, path)}`] = await readTextFile(path);
|
|
264089
|
+
}
|
|
264090
|
+
return files;
|
|
264091
|
+
}
|
|
264092
|
+
async function compilerInput2(actor, shared) {
|
|
264093
|
+
const actorDir = dirname22(actor.entryPath);
|
|
264094
|
+
const entry = `${ACTORS_ROOT}/${actor.name}/entry.ts`;
|
|
264095
|
+
const source = await readTextFile(actor.entryPath);
|
|
264096
|
+
const candidates = { ...shared };
|
|
264097
|
+
for (const filePath of actor.filePaths) {
|
|
264098
|
+
if (filePath !== actor.entryPath) {
|
|
264099
|
+
candidates[`${ACTORS_ROOT}/${actor.name}/${forwardSlashed(actorDir, filePath)}`] = await readTextFile(filePath);
|
|
264100
|
+
}
|
|
264101
|
+
}
|
|
264102
|
+
candidates[entry] = source;
|
|
264103
|
+
return {
|
|
264104
|
+
entry,
|
|
264105
|
+
files: await collectReachableFiles(entry, candidates),
|
|
264106
|
+
source
|
|
264107
|
+
};
|
|
264108
|
+
}
|
|
264109
|
+
async function compileActors(actorsDir) {
|
|
264110
|
+
const actors = await readAllActors(actorsDir);
|
|
264111
|
+
if (actors.length === 0) {
|
|
264112
|
+
return [];
|
|
264113
|
+
}
|
|
264114
|
+
if (actors.length > MAX_ACTORS) {
|
|
264115
|
+
throw new InvalidInputError(`Too many actors: found ${actors.length}, the limit is ${MAX_ACTORS}.`);
|
|
264116
|
+
}
|
|
264117
|
+
await requireCompilerRuntime("Actors");
|
|
264118
|
+
const shared = await readSharedFiles2(actorsDir);
|
|
264119
|
+
const sorted = [...actors].sort((a, b) => a.name < b.name ? -1 : 1);
|
|
264120
|
+
const compiled = await pMap(sorted, async (actor) => {
|
|
264121
|
+
const input = await compilerInput2(actor, shared);
|
|
264122
|
+
const result = await bundle({ entry: input.entry, files: input.files });
|
|
264123
|
+
return {
|
|
264124
|
+
name: actor.name,
|
|
264125
|
+
entry: input.entry,
|
|
264126
|
+
source: input.source,
|
|
264127
|
+
result
|
|
264128
|
+
};
|
|
264129
|
+
}, { concurrency: COMPILE_CONCURRENCY });
|
|
264130
|
+
const failures = compiled.flatMap(({ name, result }) => result.ok ? [] : [
|
|
264131
|
+
{
|
|
264132
|
+
function: name,
|
|
264133
|
+
message: `Actor "${name}" failed to compile.`,
|
|
264134
|
+
errors: result.errors
|
|
264135
|
+
}
|
|
264136
|
+
]);
|
|
264137
|
+
if (failures.length > 0) {
|
|
264138
|
+
throw new InvalidInputError(`Actors failed to compile (${failures.length} error${failures.length === 1 ? "" : "s"}).`, { details: failures.map(describeFailure) });
|
|
264139
|
+
}
|
|
264140
|
+
return compiled.map(({ name, entry, source, result }) => {
|
|
264141
|
+
const module = new TextEncoder().encode(compiledModule(name, result));
|
|
264142
|
+
return {
|
|
264143
|
+
name,
|
|
264144
|
+
entry,
|
|
264145
|
+
source,
|
|
264146
|
+
module,
|
|
264147
|
+
size: module.byteLength,
|
|
264148
|
+
digest: sha256(module),
|
|
264149
|
+
staticEgress: STATIC_EGRESS_ARTIFACT_MARKER
|
|
264150
|
+
};
|
|
264151
|
+
});
|
|
264152
|
+
}
|
|
264153
|
+
function compiledModule(name, result) {
|
|
264154
|
+
if (!result.ok || result.do_class_name !== name) {
|
|
264155
|
+
throw new InternalError(`Actor "${name}" did not compile as an actor of that name.`);
|
|
264156
|
+
}
|
|
264157
|
+
return result.module;
|
|
264158
|
+
}
|
|
264159
|
+
|
|
263608
264160
|
// src/core/version/publish.ts
|
|
263609
264161
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
263610
264162
|
var DEFAULT_ENVIRONMENT = "production";
|
|
@@ -263657,7 +264209,7 @@ async function collectBuildOutput(outputDir, options = {}) {
|
|
|
263657
264209
|
}
|
|
263658
264210
|
async function describeSiteWorker(built) {
|
|
263659
264211
|
const { config, modules } = built;
|
|
263660
|
-
const entry =
|
|
264212
|
+
const entry = resolve14(config.configDir, config.main);
|
|
263661
264213
|
const main = modules.find((m) => m.absolutePath === entry)?.name;
|
|
263662
264214
|
if (!main) {
|
|
263663
264215
|
throw new InvalidInputError(`The Worker's entry module ${config.main} is not among the ${modules.length} modules collected from ${config.configDir}.`);
|
|
@@ -263688,14 +264240,14 @@ async function readRawResources(dir) {
|
|
|
263688
264240
|
const payloads = {};
|
|
263689
264241
|
for (const relativePath of files.sort()) {
|
|
263690
264242
|
const name = relativePath.replace(/\.jsonc?$/, "");
|
|
263691
|
-
payloads[name] = await readJsonFile(
|
|
264243
|
+
payloads[name] = await readJsonFile(join30(dir, ...relativePath.split("/")));
|
|
263692
264244
|
}
|
|
263693
264245
|
return payloads;
|
|
263694
264246
|
}
|
|
263695
264247
|
async function collectResources(configDir, dirs) {
|
|
263696
264248
|
const [entities, agents] = await Promise.all([
|
|
263697
|
-
readRawResources(
|
|
263698
|
-
readRawResources(
|
|
264249
|
+
readRawResources(join30(configDir, dirs.entitiesDir)),
|
|
264250
|
+
readRawResources(join30(configDir, dirs.agentsDir))
|
|
263699
264251
|
]);
|
|
263700
264252
|
return { entities, agents };
|
|
263701
264253
|
}
|
|
@@ -263707,7 +264259,8 @@ async function collectArtifacts(target) {
|
|
|
263707
264259
|
entryFile: ENTRY2
|
|
263708
264260
|
}),
|
|
263709
264261
|
...siteWorker ? { siteWorker } : {},
|
|
263710
|
-
backendBundles: await tagStep2("build", () => compileBackendBundles(target.root,
|
|
264262
|
+
backendBundles: await tagStep2("build", () => compileBackendBundles(target.root, join30(target.configDir, target.functionsDir))),
|
|
264263
|
+
actors: await tagStep2("build", () => compileActors(join30(target.configDir, target.actorsDir))),
|
|
263711
264264
|
...await collectResources(target.configDir, target)
|
|
263712
264265
|
};
|
|
263713
264266
|
}
|
|
@@ -264165,7 +264718,7 @@ function getSecretsListCommand() {
|
|
|
264165
264718
|
}
|
|
264166
264719
|
|
|
264167
264720
|
// src/cli/commands/secrets/set.ts
|
|
264168
|
-
import { resolve as
|
|
264721
|
+
import { resolve as resolve15 } from "node:path";
|
|
264169
264722
|
function parseEntries(entries) {
|
|
264170
264723
|
const secrets = {};
|
|
264171
264724
|
for (const entry of entries) {
|
|
@@ -264196,7 +264749,7 @@ async function setSecretsAction({ log, runTask }, entries, options) {
|
|
|
264196
264749
|
validateInput(entries, options);
|
|
264197
264750
|
let secrets;
|
|
264198
264751
|
if (options.envFile) {
|
|
264199
|
-
secrets = await parseEnvFile(
|
|
264752
|
+
secrets = await parseEnvFile(resolve15(options.envFile));
|
|
264200
264753
|
if (Object.keys(secrets).length === 0) {
|
|
264201
264754
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
264202
264755
|
}
|
|
@@ -264224,512 +264777,8 @@ function getSecretsCommand() {
|
|
|
264224
264777
|
return new Command2("secrets").description("Manage project secrets (environment variables)").addCommand(getSecretsListCommand()).addCommand(getSecretsSetCommand()).addCommand(getSecretsDeleteCommand());
|
|
264225
264778
|
}
|
|
264226
264779
|
|
|
264227
|
-
// src/cli/commands/session/import.ts
|
|
264228
|
-
var import_ms2 = __toESM(require_ms(), 1);
|
|
264229
|
-
|
|
264230
|
-
// src/core/session-import/transcript.ts
|
|
264231
|
-
import { gzipSync } from "node:zlib";
|
|
264232
|
-
var SESSION_SOURCE_LABELS = {
|
|
264233
|
-
claude_code: "Claude Code",
|
|
264234
|
-
codex: "Codex"
|
|
264235
|
-
};
|
|
264236
|
-
var MAX_TURNS = 120;
|
|
264237
|
-
var MAX_CHARS_PER_TURN = 4000;
|
|
264238
|
-
var MAX_TOTAL_CHARS = 1e5;
|
|
264239
|
-
var TRUNCATION_MARK = " … [truncated]";
|
|
264240
|
-
function parseJsonObject(line) {
|
|
264241
|
-
if (line[0] !== "{")
|
|
264242
|
-
return;
|
|
264243
|
-
try {
|
|
264244
|
-
const parsed = JSON.parse(line);
|
|
264245
|
-
return typeof parsed === "object" && parsed !== null ? parsed : undefined;
|
|
264246
|
-
} catch {
|
|
264247
|
-
return;
|
|
264248
|
-
}
|
|
264249
|
-
}
|
|
264250
|
-
function stringField(object, key) {
|
|
264251
|
-
const value = object[key];
|
|
264252
|
-
return typeof value === "string" && value !== "" ? value : undefined;
|
|
264253
|
-
}
|
|
264254
|
-
function objectField(object, key) {
|
|
264255
|
-
const value = object[key];
|
|
264256
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : undefined;
|
|
264257
|
-
}
|
|
264258
|
-
function contentText(content) {
|
|
264259
|
-
if (typeof content === "string")
|
|
264260
|
-
return content.trim();
|
|
264261
|
-
if (!Array.isArray(content))
|
|
264262
|
-
return "";
|
|
264263
|
-
return content.map((block) => typeof block === "object" && block !== null && typeof block.text === "string" ? block.text : "").filter((text) => text !== "").join(`
|
|
264264
|
-
`).trim();
|
|
264265
|
-
}
|
|
264266
|
-
function conversationTurn(role, content) {
|
|
264267
|
-
const text = contentText(content);
|
|
264268
|
-
return text === "" || text.startsWith("<") || text.startsWith(INTERRUPT_MARKER) ? undefined : { role, text };
|
|
264269
|
-
}
|
|
264270
|
-
var NOT_CONVERSATION_FLAGS = [
|
|
264271
|
-
"isMeta",
|
|
264272
|
-
"isSidechain",
|
|
264273
|
-
"isCompactSummary",
|
|
264274
|
-
"isVisibleInTranscriptOnly",
|
|
264275
|
-
"isApiErrorMessage"
|
|
264276
|
-
];
|
|
264277
|
-
var INTERRUPT_MARKER = "[Request interrupted by user";
|
|
264278
|
-
var SLASH_COMMAND_NAME = /<command-name>([^<]*)<\/command-name>/;
|
|
264279
|
-
var SLASH_COMMAND_ARGS = /<command-args>([^<]*)<\/command-args>/;
|
|
264280
|
-
function slashCommandText(text) {
|
|
264281
|
-
const name = SLASH_COMMAND_NAME.exec(text)?.[1]?.trim();
|
|
264282
|
-
if (!name)
|
|
264283
|
-
return;
|
|
264284
|
-
const args = SLASH_COMMAND_ARGS.exec(text)?.[1]?.trim();
|
|
264285
|
-
return args ? `${name} ${args}` : name;
|
|
264286
|
-
}
|
|
264287
|
-
function claudeTurnFromLine(line) {
|
|
264288
|
-
const type = stringField(line, "type");
|
|
264289
|
-
if (type !== "user" && type !== "assistant")
|
|
264290
|
-
return;
|
|
264291
|
-
if (NOT_CONVERSATION_FLAGS.some((flag) => line[flag] === true)) {
|
|
264292
|
-
return;
|
|
264293
|
-
}
|
|
264294
|
-
const message = objectField(line, "message");
|
|
264295
|
-
if (message?.model === "<synthetic>")
|
|
264296
|
-
return;
|
|
264297
|
-
const content = message?.content;
|
|
264298
|
-
const command = type === "user" ? slashCommandText(contentText(content)) : undefined;
|
|
264299
|
-
return command ? { role: "user", text: command } : conversationTurn(type, content);
|
|
264300
|
-
}
|
|
264301
|
-
var CODEX_INJECTED_USER_ITEM = /^\s*(<(recommended_plugins|environment_context|user_instructions)>|# AGENTS\.md instructions for )/;
|
|
264302
|
-
function codexTurnFromLine(line) {
|
|
264303
|
-
if (stringField(line, "type") !== "response_item")
|
|
264304
|
-
return;
|
|
264305
|
-
const payload = objectField(line, "payload");
|
|
264306
|
-
if (payload === undefined || payload.type !== "message")
|
|
264307
|
-
return;
|
|
264308
|
-
const role = payload.role;
|
|
264309
|
-
if (role !== "user" && role !== "assistant")
|
|
264310
|
-
return;
|
|
264311
|
-
const turn = conversationTurn(role, payload.content);
|
|
264312
|
-
if (turn?.role === "user" && CODEX_INJECTED_USER_ITEM.test(turn.text)) {
|
|
264313
|
-
return;
|
|
264314
|
-
}
|
|
264315
|
-
return turn;
|
|
264316
|
-
}
|
|
264317
|
-
function mergeConsecutiveRoles(turns) {
|
|
264318
|
-
const merged = [];
|
|
264319
|
-
for (const turn of turns) {
|
|
264320
|
-
const last = merged.at(-1);
|
|
264321
|
-
if (last?.role === turn.role) {
|
|
264322
|
-
last.text = `${last.text}
|
|
264323
|
-
|
|
264324
|
-
${turn.text}`;
|
|
264325
|
-
} else {
|
|
264326
|
-
merged.push({ ...turn });
|
|
264327
|
-
}
|
|
264328
|
-
}
|
|
264329
|
-
return merged;
|
|
264330
|
-
}
|
|
264331
|
-
function cut(text, maxChars) {
|
|
264332
|
-
const end = text.charCodeAt(maxChars - 1);
|
|
264333
|
-
return text.slice(0, end >= 55296 && end <= 56319 ? maxChars - 1 : maxChars);
|
|
264334
|
-
}
|
|
264335
|
-
function clip(text, maxChars) {
|
|
264336
|
-
return text.length <= maxChars ? text : cut(text, maxChars - TRUNCATION_MARK.length) + TRUNCATION_MARK;
|
|
264337
|
-
}
|
|
264338
|
-
function prepareTranscript(source) {
|
|
264339
|
-
const merged = mergeConsecutiveRoles(source).map((turn) => ({
|
|
264340
|
-
role: turn.role,
|
|
264341
|
-
text: clip(turn.text, MAX_CHARS_PER_TURN)
|
|
264342
|
-
}));
|
|
264343
|
-
let kept = merged.slice(-MAX_TURNS);
|
|
264344
|
-
let total = kept.reduce((sum, turn) => sum + turn.text.length, 0);
|
|
264345
|
-
while (kept.length > 1 && total > MAX_TOTAL_CHARS) {
|
|
264346
|
-
total -= kept[0]?.text.length ?? 0;
|
|
264347
|
-
kept = kept.slice(1);
|
|
264348
|
-
}
|
|
264349
|
-
const droppedTurns = merged.length - kept.length;
|
|
264350
|
-
const firstUser = kept.findIndex((turn) => turn.role === "user");
|
|
264351
|
-
return {
|
|
264352
|
-
turns: firstUser === -1 ? [] : kept.slice(firstUser),
|
|
264353
|
-
droppedTurns
|
|
264354
|
-
};
|
|
264355
|
-
}
|
|
264356
|
-
function encodeTurns(turns) {
|
|
264357
|
-
return gzipSync(JSON.stringify(turns), { level: 9 }).toString("base64");
|
|
264358
|
-
}
|
|
264359
|
-
|
|
264360
|
-
// src/core/session-import/api.ts
|
|
264361
|
-
var ImportResponseSchema = object({ branch_id: string2().min(1), branch_name: string2().min(1) }).transform((data) => ({
|
|
264362
|
-
branchId: data.branch_id,
|
|
264363
|
-
branchName: data.branch_name
|
|
264364
|
-
}));
|
|
264365
|
-
function withoutTranscript(error) {
|
|
264366
|
-
if (error instanceof HTTPError) {
|
|
264367
|
-
delete error.options.context.__requestBody;
|
|
264368
|
-
}
|
|
264369
|
-
return error;
|
|
264370
|
-
}
|
|
264371
|
-
function withUnavailableHint(error) {
|
|
264372
|
-
if (error.statusCode !== 404)
|
|
264373
|
-
return error;
|
|
264374
|
-
return new ApiError(error.message, {
|
|
264375
|
-
statusCode: error.statusCode,
|
|
264376
|
-
requestUrl: error.requestUrl,
|
|
264377
|
-
requestMethod: error.requestMethod,
|
|
264378
|
-
responseBody: error.responseBody,
|
|
264379
|
-
requestId: error.requestId,
|
|
264380
|
-
details: error.details,
|
|
264381
|
-
hints: [
|
|
264382
|
-
{
|
|
264383
|
-
message: "Session import works on apps imported from a repository, and needs early access on your account. Check the app id."
|
|
264384
|
-
}
|
|
264385
|
-
],
|
|
264386
|
-
cause: error
|
|
264387
|
-
});
|
|
264388
|
-
}
|
|
264389
|
-
async function importSession(params) {
|
|
264390
|
-
let response;
|
|
264391
|
-
try {
|
|
264392
|
-
response = await getAppClient().post("imported/session-imports", {
|
|
264393
|
-
json: {
|
|
264394
|
-
source: params.source,
|
|
264395
|
-
source_session_id: params.sessionId,
|
|
264396
|
-
title: params.title,
|
|
264397
|
-
turns_gzip_base64: encodeTurns(params.turns)
|
|
264398
|
-
},
|
|
264399
|
-
timeout: 60000
|
|
264400
|
-
});
|
|
264401
|
-
} catch (error) {
|
|
264402
|
-
throw withUnavailableHint(await ApiError.fromHttpError(withoutTranscript(error), "importing session"));
|
|
264403
|
-
}
|
|
264404
|
-
const result = ImportResponseSchema.safeParse(await response.json());
|
|
264405
|
-
if (!result.success) {
|
|
264406
|
-
throw new SchemaValidationError("Invalid session import response from server", result.error);
|
|
264407
|
-
}
|
|
264408
|
-
return { ...result.data, created: response.status === 201 };
|
|
264409
|
-
}
|
|
264410
|
-
// src/core/session-import/sessions.ts
|
|
264411
|
-
import { createReadStream as createReadStream3 } from "node:fs";
|
|
264412
|
-
import { readdir as readdir2, realpath, stat as stat4 } from "node:fs/promises";
|
|
264413
|
-
import { homedir as homedir4 } from "node:os";
|
|
264414
|
-
import { join as join32, sep as sep2 } from "node:path";
|
|
264415
|
-
import { createInterface as createInterface2 } from "node:readline";
|
|
264416
|
-
function defaultSessionRoots() {
|
|
264417
|
-
const claudeHome = process.env.CLAUDE_CONFIG_DIR ?? join32(homedir4(), ".claude");
|
|
264418
|
-
return {
|
|
264419
|
-
claudeProjectsDir: join32(claudeHome, "projects"),
|
|
264420
|
-
codexHome: process.env.CODEX_HOME ?? join32(homedir4(), ".codex")
|
|
264421
|
-
};
|
|
264422
|
-
}
|
|
264423
|
-
var CODEX_ROLLOUT_FILE = /^rollout-.*-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/;
|
|
264424
|
-
var MAX_TITLE_CHARS = 80;
|
|
264425
|
-
async function forEachJsonObject(filePath, onObject) {
|
|
264426
|
-
const stream = createReadStream3(filePath, { encoding: "utf8" });
|
|
264427
|
-
const lines = createInterface2({
|
|
264428
|
-
input: stream,
|
|
264429
|
-
crlfDelay: Number.POSITIVE_INFINITY
|
|
264430
|
-
});
|
|
264431
|
-
try {
|
|
264432
|
-
for await (const line of lines) {
|
|
264433
|
-
const object = parseJsonObject(line);
|
|
264434
|
-
if (object && onObject(object) === false)
|
|
264435
|
-
break;
|
|
264436
|
-
}
|
|
264437
|
-
} finally {
|
|
264438
|
-
lines.close();
|
|
264439
|
-
stream.destroy();
|
|
264440
|
-
}
|
|
264441
|
-
}
|
|
264442
|
-
async function listDir(dir) {
|
|
264443
|
-
try {
|
|
264444
|
-
return await readdir2(dir, { withFileTypes: true });
|
|
264445
|
-
} catch {
|
|
264446
|
-
return [];
|
|
264447
|
-
}
|
|
264448
|
-
}
|
|
264449
|
-
async function withMtime(files) {
|
|
264450
|
-
const stamped = await Promise.all(files.map(async (file) => {
|
|
264451
|
-
try {
|
|
264452
|
-
return { ...file, updatedAtMs: (await stat4(file.filePath)).mtimeMs };
|
|
264453
|
-
} catch {
|
|
264454
|
-
return;
|
|
264455
|
-
}
|
|
264456
|
-
}));
|
|
264457
|
-
return stamped.filter((file) => file !== undefined);
|
|
264458
|
-
}
|
|
264459
|
-
function oneLine(text) {
|
|
264460
|
-
const flat = text.replace(/\s+/g, " ").trim();
|
|
264461
|
-
return flat.length <= MAX_TITLE_CHARS ? flat : `${cut(flat, MAX_TITLE_CHARS - 1)}…`;
|
|
264462
|
-
}
|
|
264463
|
-
function claudeAdapter(projectsDir) {
|
|
264464
|
-
return {
|
|
264465
|
-
async files() {
|
|
264466
|
-
const found = [];
|
|
264467
|
-
for (const project of await listDir(projectsDir)) {
|
|
264468
|
-
if (!project.isDirectory())
|
|
264469
|
-
continue;
|
|
264470
|
-
const projectDir = join32(projectsDir, project.name);
|
|
264471
|
-
for (const entry of await listDir(projectDir)) {
|
|
264472
|
-
if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
|
264473
|
-
found.push({
|
|
264474
|
-
source: "claude_code",
|
|
264475
|
-
id: entry.name.slice(0, -".jsonl".length),
|
|
264476
|
-
filePath: join32(projectDir, entry.name)
|
|
264477
|
-
});
|
|
264478
|
-
}
|
|
264479
|
-
}
|
|
264480
|
-
}
|
|
264481
|
-
return withMtime(found);
|
|
264482
|
-
},
|
|
264483
|
-
async head(filePath) {
|
|
264484
|
-
let cwd;
|
|
264485
|
-
await forEachJsonObject(filePath, (line) => {
|
|
264486
|
-
cwd = stringField(line, "cwd");
|
|
264487
|
-
return cwd === undefined;
|
|
264488
|
-
});
|
|
264489
|
-
return { cwd };
|
|
264490
|
-
},
|
|
264491
|
-
async read(file) {
|
|
264492
|
-
const turns = [];
|
|
264493
|
-
let cwd;
|
|
264494
|
-
let customTitle;
|
|
264495
|
-
let aiTitle;
|
|
264496
|
-
let summary;
|
|
264497
|
-
await forEachJsonObject(file.filePath, (line) => {
|
|
264498
|
-
const type = stringField(line, "type");
|
|
264499
|
-
if (type === "custom-title") {
|
|
264500
|
-
customTitle = stringField(line, "customTitle") ?? customTitle;
|
|
264501
|
-
} else if (type === "ai-title") {
|
|
264502
|
-
aiTitle = stringField(line, "aiTitle") ?? aiTitle;
|
|
264503
|
-
} else if (type === "summary") {
|
|
264504
|
-
summary = stringField(line, "summary") ?? summary;
|
|
264505
|
-
} else {
|
|
264506
|
-
cwd ??= stringField(line, "cwd");
|
|
264507
|
-
const turn = claudeTurnFromLine(line);
|
|
264508
|
-
if (turn)
|
|
264509
|
-
turns.push(turn);
|
|
264510
|
-
}
|
|
264511
|
-
return;
|
|
264512
|
-
});
|
|
264513
|
-
return { cwd, title: customTitle ?? aiTitle ?? summary, turns };
|
|
264514
|
-
}
|
|
264515
|
-
};
|
|
264516
|
-
}
|
|
264517
|
-
function codexAdapter(codexHome) {
|
|
264518
|
-
const sessionsDir = join32(codexHome, "sessions");
|
|
264519
|
-
const titleOf = async (id) => {
|
|
264520
|
-
let title;
|
|
264521
|
-
try {
|
|
264522
|
-
await forEachJsonObject(join32(codexHome, "session_index.jsonl"), (line) => {
|
|
264523
|
-
if (stringField(line, "id") === id) {
|
|
264524
|
-
title = stringField(line, "thread_name") ?? title;
|
|
264525
|
-
}
|
|
264526
|
-
return;
|
|
264527
|
-
});
|
|
264528
|
-
} catch {}
|
|
264529
|
-
return title;
|
|
264530
|
-
};
|
|
264531
|
-
return {
|
|
264532
|
-
async files() {
|
|
264533
|
-
const found = [];
|
|
264534
|
-
for (const year of await listDir(sessionsDir)) {
|
|
264535
|
-
for (const month of await listDir(join32(sessionsDir, year.name))) {
|
|
264536
|
-
const monthDir = join32(sessionsDir, year.name, month.name);
|
|
264537
|
-
for (const day of await listDir(monthDir)) {
|
|
264538
|
-
const dayDir = join32(monthDir, day.name);
|
|
264539
|
-
for (const entry of await listDir(dayDir)) {
|
|
264540
|
-
const id = CODEX_ROLLOUT_FILE.exec(entry.name)?.[1];
|
|
264541
|
-
if (id && entry.isFile()) {
|
|
264542
|
-
found.push({
|
|
264543
|
-
source: "codex",
|
|
264544
|
-
id,
|
|
264545
|
-
filePath: join32(dayDir, entry.name)
|
|
264546
|
-
});
|
|
264547
|
-
}
|
|
264548
|
-
}
|
|
264549
|
-
}
|
|
264550
|
-
}
|
|
264551
|
-
}
|
|
264552
|
-
return withMtime(found);
|
|
264553
|
-
},
|
|
264554
|
-
async head(filePath) {
|
|
264555
|
-
const head = {};
|
|
264556
|
-
await forEachJsonObject(filePath, (line) => {
|
|
264557
|
-
const payload = objectField(line, "payload");
|
|
264558
|
-
if (stringField(line, "type") !== "session_meta" || !payload) {
|
|
264559
|
-
return true;
|
|
264560
|
-
}
|
|
264561
|
-
head.cwd = stringField(payload, "cwd");
|
|
264562
|
-
const source = payload.source;
|
|
264563
|
-
head.skip = typeof source !== "string" || source === "exec";
|
|
264564
|
-
return false;
|
|
264565
|
-
});
|
|
264566
|
-
return head;
|
|
264567
|
-
},
|
|
264568
|
-
async read(file) {
|
|
264569
|
-
const turns = [];
|
|
264570
|
-
let cwd;
|
|
264571
|
-
await forEachJsonObject(file.filePath, (line) => {
|
|
264572
|
-
const payload = objectField(line, "payload");
|
|
264573
|
-
if (stringField(line, "type") === "session_meta" && payload) {
|
|
264574
|
-
cwd ??= stringField(payload, "cwd");
|
|
264575
|
-
}
|
|
264576
|
-
const turn = codexTurnFromLine(line);
|
|
264577
|
-
if (turn)
|
|
264578
|
-
turns.push(turn);
|
|
264579
|
-
return;
|
|
264580
|
-
});
|
|
264581
|
-
return { cwd, title: await titleOf(file.id), turns };
|
|
264582
|
-
}
|
|
264583
|
-
};
|
|
264584
|
-
}
|
|
264585
|
-
function adapters(roots) {
|
|
264586
|
-
return [
|
|
264587
|
-
claudeAdapter(roots.claudeProjectsDir),
|
|
264588
|
-
codexAdapter(roots.codexHome)
|
|
264589
|
-
];
|
|
264590
|
-
}
|
|
264591
|
-
async function describe2(adapter, file) {
|
|
264592
|
-
const content = await adapter.read(file);
|
|
264593
|
-
const firstPrompt = content.turns.find((turn) => turn.role === "user")?.text;
|
|
264594
|
-
const title = oneLine(content.title ?? firstPrompt ?? "");
|
|
264595
|
-
if (content.turns.length === 0 || title === "")
|
|
264596
|
-
return;
|
|
264597
|
-
return {
|
|
264598
|
-
session: {
|
|
264599
|
-
source: file.source,
|
|
264600
|
-
id: file.id,
|
|
264601
|
-
title,
|
|
264602
|
-
cwd: content.cwd,
|
|
264603
|
-
filePath: file.filePath,
|
|
264604
|
-
updatedAtMs: file.updatedAtMs
|
|
264605
|
-
},
|
|
264606
|
-
turns: content.turns
|
|
264607
|
-
};
|
|
264608
|
-
}
|
|
264609
|
-
async function isWithin(cwd, dir) {
|
|
264610
|
-
const roots = new Set([dir, await realpath(dir).catch(() => dir)]);
|
|
264611
|
-
const places = new Set([cwd, await realpath(cwd).catch(() => cwd)]);
|
|
264612
|
-
return [...roots].some((root) => [...places].some((place) => place === root || place.startsWith(root + sep2)));
|
|
264613
|
-
}
|
|
264614
|
-
async function listSessions(roots, { within, limit }) {
|
|
264615
|
-
const found = [];
|
|
264616
|
-
const files = (await Promise.all(adapters(roots).map(async (adapter) => (await adapter.files()).map((file) => ({ adapter, file }))))).flat().sort((a, b) => b.file.updatedAtMs - a.file.updatedAtMs);
|
|
264617
|
-
for (const { adapter, file } of files) {
|
|
264618
|
-
if (found.length >= limit)
|
|
264619
|
-
break;
|
|
264620
|
-
const head = await adapter.head(file.filePath).catch(() => ({ skip: true }));
|
|
264621
|
-
if (head.skip)
|
|
264622
|
-
continue;
|
|
264623
|
-
if (within && (!head.cwd || !await isWithin(head.cwd, within)))
|
|
264624
|
-
continue;
|
|
264625
|
-
const described = await describe2(adapter, file).catch(() => {
|
|
264626
|
-
return;
|
|
264627
|
-
});
|
|
264628
|
-
if (described)
|
|
264629
|
-
found.push(described.session);
|
|
264630
|
-
}
|
|
264631
|
-
return found;
|
|
264632
|
-
}
|
|
264633
|
-
async function readSessionById(roots, id) {
|
|
264634
|
-
for (const adapter of adapters(roots)) {
|
|
264635
|
-
const file = (await adapter.files()).find((candidate) => candidate.id === id);
|
|
264636
|
-
if (!file)
|
|
264637
|
-
continue;
|
|
264638
|
-
try {
|
|
264639
|
-
return await describe2(adapter, file);
|
|
264640
|
-
} catch (error) {
|
|
264641
|
-
throw new FileReadError(`Failed to read session file ${file.filePath}: ${error instanceof Error ? error.message : "Unknown error"}`, { cause: error instanceof Error ? error : undefined });
|
|
264642
|
-
}
|
|
264643
|
-
}
|
|
264644
|
-
return;
|
|
264645
|
-
}
|
|
264646
|
-
// src/cli/commands/session/import.ts
|
|
264647
|
-
var PICKER_LIMIT = 30;
|
|
264648
|
-
async function pickSession(all) {
|
|
264649
|
-
const within = all ? undefined : await findGitRoot2() ?? process.cwd();
|
|
264650
|
-
const sessions = await listSessions(defaultSessionRoots(), {
|
|
264651
|
-
within,
|
|
264652
|
-
limit: PICKER_LIMIT
|
|
264653
|
-
});
|
|
264654
|
-
if (sessions.length === 0) {
|
|
264655
|
-
throw new InvalidInputError(all ? "No Claude Code or Codex sessions found on this machine." : "No Claude Code or Codex sessions found for this repository. Pass --all to list sessions from every directory, or --session <id>.");
|
|
264656
|
-
}
|
|
264657
|
-
const choice = await Je({
|
|
264658
|
-
message: "Which session do you want to continue in Base Code?",
|
|
264659
|
-
options: sessions.map((session) => ({
|
|
264660
|
-
value: session,
|
|
264661
|
-
label: session.title,
|
|
264662
|
-
hint: `${SESSION_SOURCE_LABELS[session.source]}, ${import_ms2.default(Date.now() - session.updatedAtMs)} ago`
|
|
264663
|
-
}))
|
|
264664
|
-
});
|
|
264665
|
-
if (Ct(choice)) {
|
|
264666
|
-
Ne("Operation cancelled.");
|
|
264667
|
-
throw new CLIExitError(0);
|
|
264668
|
-
}
|
|
264669
|
-
return choice.id;
|
|
264670
|
-
}
|
|
264671
|
-
async function importSessionAction(ctx, options) {
|
|
264672
|
-
const { log, runTask, jsonMode } = ctx;
|
|
264673
|
-
const interactive = !ctx.isNonInteractive && !jsonMode;
|
|
264674
|
-
const appId = requireApp(ctx).id;
|
|
264675
|
-
if (!options.session && !interactive) {
|
|
264676
|
-
throw new InvalidInputError("--session <id> is required in non-interactive mode");
|
|
264677
|
-
}
|
|
264678
|
-
const sessionId = options.session ?? await pickSession(options.all);
|
|
264679
|
-
const found = await runTask("Reading session", () => readSessionById(defaultSessionRoots(), sessionId));
|
|
264680
|
-
if (!found) {
|
|
264681
|
-
throw new InvalidInputError(`No Claude Code or Codex session with id "${sessionId}" was found on this machine.`);
|
|
264682
|
-
}
|
|
264683
|
-
const { session } = found;
|
|
264684
|
-
const { turns, droppedTurns } = prepareTranscript(found.turns);
|
|
264685
|
-
if (turns.length === 0) {
|
|
264686
|
-
throw new InvalidInputError("This session has no conversation text to import.");
|
|
264687
|
-
}
|
|
264688
|
-
if (droppedTurns > 0) {
|
|
264689
|
-
log.info(`Sending the latest ${turns.length} messages; ${droppedTurns} older ones exceed the size limit.`);
|
|
264690
|
-
}
|
|
264691
|
-
const confirmed = await confirmPush({
|
|
264692
|
-
isNonInteractive: !interactive,
|
|
264693
|
-
yes: options.yes,
|
|
264694
|
-
log,
|
|
264695
|
-
warning: `This uploads the ${turns.length} messages of "${session.title}" to your Base44 app. Only text goes up; tool calls and their output stay on this machine.`
|
|
264696
|
-
});
|
|
264697
|
-
if (!confirmed) {
|
|
264698
|
-
return { outroMessage: "Import cancelled" };
|
|
264699
|
-
}
|
|
264700
|
-
const imported = await runTask("Importing session", () => importSession({
|
|
264701
|
-
source: session.source,
|
|
264702
|
-
sessionId: session.id,
|
|
264703
|
-
title: session.title,
|
|
264704
|
-
turns
|
|
264705
|
-
}));
|
|
264706
|
-
const url = getBaseCodeUrl(appId, imported.branchName);
|
|
264707
|
-
const result = {
|
|
264708
|
-
branchId: imported.branchId,
|
|
264709
|
-
branchName: imported.branchName,
|
|
264710
|
-
url,
|
|
264711
|
-
created: imported.created,
|
|
264712
|
-
source: session.source,
|
|
264713
|
-
sessionId: session.id,
|
|
264714
|
-
messageCount: turns.length
|
|
264715
|
-
};
|
|
264716
|
-
return {
|
|
264717
|
-
outroMessage: `${imported.created ? "Imported into" : "Already imported into"} branch ${theme.styles.bold(imported.branchName)}
|
|
264718
|
-
${theme.colors.links(url)}`,
|
|
264719
|
-
stdout: jsonMode ? toJsonStdout(result) : undefined
|
|
264720
|
-
};
|
|
264721
|
-
}
|
|
264722
|
-
function getSessionImportCommand() {
|
|
264723
|
-
return new Base44Command("import").description("Continue a local Claude Code or Codex session in a Base Code branch").option("--session <id>", "Session id to import (skips the picker)").option("--all", "List sessions from every directory, not just this repository").option("-y, --yes", "Skip the confirmation prompt").action(importSessionAction);
|
|
264724
|
-
}
|
|
264725
|
-
|
|
264726
|
-
// src/cli/commands/session/index.ts
|
|
264727
|
-
function getSessionCommand() {
|
|
264728
|
-
return new Command2("session").description("Move local coding-agent sessions into Base44 (experimental)").addCommand(getSessionImportCommand());
|
|
264729
|
-
}
|
|
264730
|
-
|
|
264731
264780
|
// src/cli/commands/site/deploy.ts
|
|
264732
|
-
import { resolve as
|
|
264781
|
+
import { resolve as resolve16 } from "node:path";
|
|
264733
264782
|
async function deployAction2(ctx, options) {
|
|
264734
264783
|
const { isNonInteractive } = ctx;
|
|
264735
264784
|
if (isNonInteractive && !options.yes) {
|
|
@@ -264798,7 +264847,7 @@ async function deployTarball({ runTask }, project) {
|
|
|
264798
264847
|
}
|
|
264799
264848
|
function siteOutputDir(project) {
|
|
264800
264849
|
const { outputDirectory = DEFAULT_SITE.outputDirectory } = siteOrDefault(project);
|
|
264801
|
-
return
|
|
264850
|
+
return resolve16(project.root, outputDirectory);
|
|
264802
264851
|
}
|
|
264803
264852
|
function getSiteDeployCommand() {
|
|
264804
264853
|
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)");
|
|
@@ -265142,10 +265191,10 @@ function toPascalCase(name) {
|
|
|
265142
265191
|
return name.split(/[-_\s]+/).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
|
|
265143
265192
|
}
|
|
265144
265193
|
// src/core/types/update-project.ts
|
|
265145
|
-
import { join as
|
|
265194
|
+
import { join as join34 } from "node:path";
|
|
265146
265195
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
265147
265196
|
async function updateProjectConfig(projectRoot) {
|
|
265148
|
-
const tsconfigPath =
|
|
265197
|
+
const tsconfigPath = join34(projectRoot, "tsconfig.json");
|
|
265149
265198
|
if (!await pathExists(tsconfigPath)) {
|
|
265150
265199
|
return false;
|
|
265151
265200
|
}
|
|
@@ -265626,7 +265675,7 @@ function getWorkspaceCommand() {
|
|
|
265626
265675
|
// src/cli/dev/dev-server/main.ts
|
|
265627
265676
|
var import_cors = __toESM(require_lib4(), 1);
|
|
265628
265677
|
var import_express6 = __toESM(require_express(), 1);
|
|
265629
|
-
import { dirname as dirname28, join as
|
|
265678
|
+
import { dirname as dirname28, join as join39 } from "node:path";
|
|
265630
265679
|
|
|
265631
265680
|
// ../../node_modules/get-port/index.js
|
|
265632
265681
|
import net from "node:net";
|
|
@@ -265756,7 +265805,7 @@ var $tmpName = promisify12(tmp.tmpName);
|
|
|
265756
265805
|
|
|
265757
265806
|
// src/cli/dev/dev-server/function-manager.ts
|
|
265758
265807
|
import { spawn as spawn3 } from "node:child_process";
|
|
265759
|
-
import { dirname as dirname25, join as
|
|
265808
|
+
import { dirname as dirname25, join as join35 } from "node:path";
|
|
265760
265809
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
265761
265810
|
|
|
265762
265811
|
// src/cli/dev/dev-server/base-function-manager.ts
|
|
@@ -265861,7 +265910,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
265861
265910
|
}
|
|
265862
265911
|
spawnFunction(func, port) {
|
|
265863
265912
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
265864
|
-
const importMapPath =
|
|
265913
|
+
const importMapPath = join35(dirname25(this.wrapperPath), "import-map.json");
|
|
265865
265914
|
const process2 = spawn3("deno", ["run", "--allow-all", "--import-map", importMapPath, this.wrapperPath], {
|
|
265866
265915
|
env: {
|
|
265867
265916
|
...globalThis.process.env,
|
|
@@ -265934,8 +265983,8 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
265934
265983
|
// src/cli/dev/dev-server/function-bundler.ts
|
|
265935
265984
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
265936
265985
|
import { isBuiltin as isBuiltin3 } from "node:module";
|
|
265937
|
-
import { homedir as
|
|
265938
|
-
import { join as
|
|
265986
|
+
import { homedir as homedir4 } from "node:os";
|
|
265987
|
+
import { join as join36 } from "node:path";
|
|
265939
265988
|
import { pathToFileURL as pathToFileURL7 } from "node:url";
|
|
265940
265989
|
var depsPromise;
|
|
265941
265990
|
function loadDeps() {
|
|
@@ -266056,9 +266105,9 @@ export default {
|
|
|
266056
266105
|
};
|
|
266057
266106
|
`;
|
|
266058
266107
|
function ensureBundlerConfig() {
|
|
266059
|
-
const dir =
|
|
266108
|
+
const dir = join36(homedir4(), ".base44", "function-bundler");
|
|
266060
266109
|
mkdirSync2(dir, { recursive: true });
|
|
266061
|
-
const configPath =
|
|
266110
|
+
const configPath = join36(dir, "deno.json");
|
|
266062
266111
|
writeFileSync2(configPath, `${JSON.stringify({ nodeModulesDir: "auto" }, null, 2)}
|
|
266063
266112
|
`);
|
|
266064
266113
|
return configPath;
|
|
@@ -267590,16 +267639,16 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
|
267590
267639
|
|
|
267591
267640
|
// src/cli/dev/dev-server/watcher.ts
|
|
267592
267641
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
267593
|
-
import { relative as
|
|
267642
|
+
import { relative as relative11 } from "node:path";
|
|
267594
267643
|
|
|
267595
267644
|
// ../../node_modules/chokidar/index.js
|
|
267596
267645
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
267597
267646
|
import { stat as statcb, Stats } from "node:fs";
|
|
267598
|
-
import { readdir as
|
|
267647
|
+
import { readdir as readdir3, stat as stat7 } from "node:fs/promises";
|
|
267599
267648
|
import * as sp3 from "node:path";
|
|
267600
267649
|
|
|
267601
267650
|
// ../../node_modules/readdirp/index.js
|
|
267602
|
-
import { lstat as lstat2, readdir as
|
|
267651
|
+
import { lstat as lstat2, readdir as readdir2, realpath, stat as stat5 } from "node:fs/promises";
|
|
267603
267652
|
import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "node:path";
|
|
267604
267653
|
import { Readable as Readable6 } from "node:stream";
|
|
267605
267654
|
var EntryTypes = {
|
|
@@ -267681,7 +267730,7 @@ class ReaddirpStream extends Readable6 {
|
|
|
267681
267730
|
const { root, type } = opts;
|
|
267682
267731
|
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
267683
267732
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
267684
|
-
const statMethod = opts.lstat ? lstat2 :
|
|
267733
|
+
const statMethod = opts.lstat ? lstat2 : stat5;
|
|
267685
267734
|
if (wantBigintFsStats) {
|
|
267686
267735
|
this._stat = (path) => statMethod(path, { bigint: true });
|
|
267687
267736
|
} else {
|
|
@@ -267752,7 +267801,7 @@ class ReaddirpStream extends Readable6 {
|
|
|
267752
267801
|
async _exploreDir(path, depth) {
|
|
267753
267802
|
let files;
|
|
267754
267803
|
try {
|
|
267755
|
-
files = await
|
|
267804
|
+
files = await readdir2(path, this._rdOptions);
|
|
267756
267805
|
} catch (error) {
|
|
267757
267806
|
this._onError(error);
|
|
267758
267807
|
}
|
|
@@ -267790,7 +267839,7 @@ class ReaddirpStream extends Readable6 {
|
|
|
267790
267839
|
if (stats && stats.isSymbolicLink()) {
|
|
267791
267840
|
const full = entry.fullPath;
|
|
267792
267841
|
try {
|
|
267793
|
-
const entryRealPath = await
|
|
267842
|
+
const entryRealPath = await realpath(full);
|
|
267794
267843
|
const entryRealPathStats = await lstat2(entryRealPath);
|
|
267795
267844
|
if (entryRealPathStats.isFile()) {
|
|
267796
267845
|
return "file";
|
|
@@ -267834,7 +267883,7 @@ function readdirp(root, options = {}) {
|
|
|
267834
267883
|
|
|
267835
267884
|
// ../../node_modules/chokidar/handler.js
|
|
267836
267885
|
import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
|
|
267837
|
-
import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as
|
|
267886
|
+
import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat6 } from "node:fs/promises";
|
|
267838
267887
|
import { type as osType } from "node:os";
|
|
267839
267888
|
import * as sp2 from "node:path";
|
|
267840
267889
|
var STR_DATA = "data";
|
|
@@ -267860,7 +267909,7 @@ var EVENTS = {
|
|
|
267860
267909
|
};
|
|
267861
267910
|
var EV = EVENTS;
|
|
267862
267911
|
var THROTTLE_MODE_WATCH = "watch";
|
|
267863
|
-
var statMethods = { lstat: lstat3, stat:
|
|
267912
|
+
var statMethods = { lstat: lstat3, stat: stat6 };
|
|
267864
267913
|
var KEY_LISTENERS = "listeners";
|
|
267865
267914
|
var KEY_ERR = "errHandlers";
|
|
267866
267915
|
var KEY_RAW = "rawEmitters";
|
|
@@ -268331,7 +268380,7 @@ class NodeFsHandler {
|
|
|
268331
268380
|
return;
|
|
268332
268381
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
268333
268382
|
try {
|
|
268334
|
-
const newStats = await
|
|
268383
|
+
const newStats = await stat6(file);
|
|
268335
268384
|
if (this.fsw.closed)
|
|
268336
268385
|
return;
|
|
268337
268386
|
const at = newStats.atimeMs;
|
|
@@ -268679,7 +268728,7 @@ class DirEntry {
|
|
|
268679
268728
|
return;
|
|
268680
268729
|
const dir = this.path;
|
|
268681
268730
|
try {
|
|
268682
|
-
await
|
|
268731
|
+
await readdir3(dir);
|
|
268683
268732
|
} catch (err) {
|
|
268684
268733
|
if (this._removeWatcher) {
|
|
268685
268734
|
this._removeWatcher(sp3.dirname(dir), sp3.basename(dir));
|
|
@@ -269003,7 +269052,7 @@ class FSWatcher extends EventEmitter3 {
|
|
|
269003
269052
|
const fullPath = opts.cwd ? sp3.join(opts.cwd, path) : path;
|
|
269004
269053
|
let stats;
|
|
269005
269054
|
try {
|
|
269006
|
-
stats = await
|
|
269055
|
+
stats = await stat7(fullPath);
|
|
269007
269056
|
} catch (err) {}
|
|
269008
269057
|
if (!stats || this.closed)
|
|
269009
269058
|
return;
|
|
@@ -269275,7 +269324,7 @@ class WatchBase44 extends EventEmitter4 {
|
|
|
269275
269324
|
ignoreInitial: true
|
|
269276
269325
|
});
|
|
269277
269326
|
watcher.on("all", import_debounce.default(async (_event, path) => {
|
|
269278
|
-
this.emit("change", name,
|
|
269327
|
+
this.emit("change", name, relative11(targetPath, path));
|
|
269279
269328
|
}, WATCH_DEBOUNCE_MS));
|
|
269280
269329
|
watcher.on("error", (err) => {
|
|
269281
269330
|
this.logger.error(`Watch handler failed for ${targetPath}`, err);
|
|
@@ -269387,8 +269436,8 @@ async function createDevServer(options) {
|
|
|
269387
269436
|
broadcastEntityEvent(io, appId, entityName, event);
|
|
269388
269437
|
};
|
|
269389
269438
|
const base44ConfigWatcher = new WatchBase44({
|
|
269390
|
-
functions:
|
|
269391
|
-
entities:
|
|
269439
|
+
functions: join39(dirname28(project.configPath), project.functionsDir),
|
|
269440
|
+
entities: join39(dirname28(project.configPath), project.entitiesDir)
|
|
269392
269441
|
}, devLogger);
|
|
269393
269442
|
base44ConfigWatcher.on("change", async (name) => {
|
|
269394
269443
|
try {
|
|
@@ -269591,7 +269640,7 @@ function readExecEnvTarget(env = process.env) {
|
|
|
269591
269640
|
// src/core/exec/run-script.ts
|
|
269592
269641
|
import { spawn as spawn4 } from "node:child_process";
|
|
269593
269642
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
269594
|
-
import { join as
|
|
269643
|
+
import { join as join40 } from "node:path";
|
|
269595
269644
|
var SDK_SPECIFIER = '"npm:@base44/sdk"';
|
|
269596
269645
|
function wrapperSource(sdkVersion) {
|
|
269597
269646
|
const source = readFileSync4(getExecWrapperPath(), "utf-8");
|
|
@@ -269627,7 +269676,7 @@ async function runScript(options) {
|
|
|
269627
269676
|
writeFileSync3(tempWrapper.path, wrapperSource(sdkVersion), "utf-8");
|
|
269628
269677
|
const configDir = await $dir({ unsafeCleanup: true });
|
|
269629
269678
|
cleanupFns.push(configDir.cleanup);
|
|
269630
|
-
const configPath =
|
|
269679
|
+
const configPath = join40(configDir.path, "deno.json");
|
|
269631
269680
|
writeFileSync3(configPath, JSON.stringify(DENO_CONFIG), "utf-8");
|
|
269632
269681
|
try {
|
|
269633
269682
|
const exitCode = await new Promise((resolvePromise) => {
|
|
@@ -269748,7 +269797,7 @@ Examples:
|
|
|
269748
269797
|
}
|
|
269749
269798
|
|
|
269750
269799
|
// src/cli/commands/project/eject.ts
|
|
269751
|
-
import { resolve as
|
|
269800
|
+
import { resolve as resolve20 } from "node:path";
|
|
269752
269801
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
269753
269802
|
async function eject(ctx, options, command) {
|
|
269754
269803
|
const { log, runTask, isNonInteractive } = ctx;
|
|
@@ -269812,7 +269861,7 @@ async function eject(ctx, options, command) {
|
|
|
269812
269861
|
Ne("Operation cancelled.");
|
|
269813
269862
|
throw new CLIExitError(0);
|
|
269814
269863
|
}
|
|
269815
|
-
const resolvedPath =
|
|
269864
|
+
const resolvedPath = resolve20(selectedPath);
|
|
269816
269865
|
await runTask("Downloading your project's code...", async (updateMessage) => {
|
|
269817
269866
|
await createProjectFilesForExistingProject({
|
|
269818
269867
|
projectId,
|
|
@@ -269899,7 +269948,6 @@ function createProgram(context) {
|
|
|
269899
269948
|
program.addCommand(getSecretsCommand());
|
|
269900
269949
|
program.addCommand(getSandboxCommand());
|
|
269901
269950
|
program.addCommand(getBranchesCommand());
|
|
269902
|
-
program.addCommand(getSessionCommand(), { hidden: true });
|
|
269903
269951
|
program.addCommand(getApiCommand());
|
|
269904
269952
|
program.addCommand(getAuthCommand());
|
|
269905
269953
|
program.addCommand(getSiteCommand());
|
|
@@ -269919,7 +269967,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
269919
269967
|
import { release, type } from "node:os";
|
|
269920
269968
|
|
|
269921
269969
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
269922
|
-
import { dirname as dirname29, posix, sep as
|
|
269970
|
+
import { dirname as dirname29, posix, sep as sep2 } from "path";
|
|
269923
269971
|
function createModulerModifier() {
|
|
269924
269972
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
269925
269973
|
return async (frames) => {
|
|
@@ -269928,7 +269976,7 @@ function createModulerModifier() {
|
|
|
269928
269976
|
return frames;
|
|
269929
269977
|
};
|
|
269930
269978
|
}
|
|
269931
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname29(process.argv[1]) : process.cwd(), isWindows =
|
|
269979
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname29(process.argv[1]) : process.cwd(), isWindows = sep2 === "\\") {
|
|
269932
269980
|
const normalizedBase = isWindows ? normalizeWindowsPath2(basePath) : basePath;
|
|
269933
269981
|
return (filename) => {
|
|
269934
269982
|
if (!filename)
|
|
@@ -271963,8 +272011,8 @@ class ReduceableCache {
|
|
|
271963
272011
|
}
|
|
271964
272012
|
}
|
|
271965
272013
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs
|
|
271966
|
-
import { createReadStream as
|
|
271967
|
-
import { createInterface as
|
|
272014
|
+
import { createReadStream as createReadStream3 } from "node:fs";
|
|
272015
|
+
import { createInterface as createInterface2 } from "node:readline";
|
|
271968
272016
|
var LRU_FILE_CONTENTS_CACHE = new ReduceableCache(25);
|
|
271969
272017
|
var LRU_FILE_CONTENTS_FS_READ_FAILED = new ReduceableCache(20);
|
|
271970
272018
|
var DEFAULT_LINES_OF_CONTEXT = 7;
|
|
@@ -272007,8 +272055,8 @@ async function addSourceContext(frames) {
|
|
|
272007
272055
|
}
|
|
272008
272056
|
function getContextLinesFromFile(path, ranges, output) {
|
|
272009
272057
|
return new Promise((resolve) => {
|
|
272010
|
-
const stream =
|
|
272011
|
-
const lineReaded =
|
|
272058
|
+
const stream = createReadStream3(path);
|
|
272059
|
+
const lineReaded = createInterface2({
|
|
272012
272060
|
input: stream
|
|
272013
272061
|
});
|
|
272014
272062
|
function destroyStreamAndResolve() {
|
|
@@ -273919,7 +273967,7 @@ function addCommandInfoToErrorReporter(program, errorReporter) {
|
|
|
273919
273967
|
// src/cli/index.ts
|
|
273920
273968
|
var __dirname4 = dirname30(fileURLToPath7(import.meta.url));
|
|
273921
273969
|
async function runCLI(options) {
|
|
273922
|
-
ensureNpmAssets(
|
|
273970
|
+
ensureNpmAssets(join41(__dirname4, "../assets"));
|
|
273923
273971
|
const errorReporter = new ErrorReporter;
|
|
273924
273972
|
errorReporter.registerProcessErrorHandlers();
|
|
273925
273973
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -273958,4 +274006,4 @@ export {
|
|
|
273958
274006
|
runCLI
|
|
273959
274007
|
};
|
|
273960
274008
|
|
|
273961
|
-
//# debugId=
|
|
274009
|
+
//# debugId=41D501CA10C9A0AA64756E2164756E21
|