@builder.io/buildercode 0.4.12 → 0.4.14
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.mjs +106 -58
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -246277,7 +246277,7 @@ var init_typescript$1 = __esmMin((() => {
|
|
|
246277
246277
|
//#region ../dev-tools/cli/version.ts
|
|
246278
246278
|
var builderVersion, pkgVersion;
|
|
246279
246279
|
var init_version = __esmMin((() => {
|
|
246280
|
-
builderVersion = "0.4.
|
|
246280
|
+
builderVersion = "0.4.14";
|
|
246281
246281
|
pkgVersion = process.env.OVERRIDE_VERSION ?? builderVersion;
|
|
246282
246282
|
}));
|
|
246283
246283
|
//#endregion
|
|
@@ -538369,6 +538369,22 @@ function loadCredentials(sys, scope = "user") {
|
|
|
538369
538369
|
}
|
|
538370
538370
|
return {};
|
|
538371
538371
|
}
|
|
538372
|
+
function clearCredentials(sys, scope = "user") {
|
|
538373
|
+
const locations = scope === "user" ? [getUserScopedCredentialsPath()] : [
|
|
538374
|
+
join(sys.getAppRootDir(), "node_modules", ".builder", "data.json"),
|
|
538375
|
+
join(sys.getAppRootDir(), ".builder", "config", "data.json"),
|
|
538376
|
+
join(sys.getAppRootDir(), ".config", "builderio", "data.json"),
|
|
538377
|
+
join(sys.getRepoRootDir(), ".git", ".builder.json")
|
|
538378
|
+
];
|
|
538379
|
+
let removedAny = false;
|
|
538380
|
+
for (const filepath of locations) if (existsSync(filepath)) try {
|
|
538381
|
+
sys.unlinkSync(filepath);
|
|
538382
|
+
removedAny = true;
|
|
538383
|
+
} catch (e) {
|
|
538384
|
+
sys.Sentry?.captureException(e, { level: "warning" });
|
|
538385
|
+
}
|
|
538386
|
+
return removedAny;
|
|
538387
|
+
}
|
|
538372
538388
|
async function createAuthServer(opts) {
|
|
538373
538389
|
let resolve;
|
|
538374
538390
|
let reject;
|
|
@@ -543475,6 +543491,11 @@ const SLASH_COMMANDS = [
|
|
|
543475
543491
|
label: "/exit",
|
|
543476
543492
|
description: "Exit the app"
|
|
543477
543493
|
},
|
|
543494
|
+
{
|
|
543495
|
+
id: "logout",
|
|
543496
|
+
label: "/logout",
|
|
543497
|
+
description: "Log out and re-authenticate"
|
|
543498
|
+
},
|
|
543478
543499
|
{
|
|
543479
543500
|
id: "launch",
|
|
543480
543501
|
label: "/launch",
|
|
@@ -543585,6 +543606,15 @@ const EFFORT_COMMANDS = [
|
|
|
543585
543606
|
description: "Full extended reasoning"
|
|
543586
543607
|
}
|
|
543587
543608
|
];
|
|
543609
|
+
const LOGOUT_COMMANDS = [{
|
|
543610
|
+
id: "confirm",
|
|
543611
|
+
label: "Yes, log out",
|
|
543612
|
+
description: "Clear credentials and re-authenticate"
|
|
543613
|
+
}, {
|
|
543614
|
+
id: "cancel",
|
|
543615
|
+
label: "Cancel",
|
|
543616
|
+
description: "Stay logged in"
|
|
543617
|
+
}];
|
|
543588
543618
|
const SUBVIEW_IDS = new Set([
|
|
543589
543619
|
"mode",
|
|
543590
543620
|
"model",
|
|
@@ -543594,7 +543624,8 @@ const SUBVIEW_IDS = new Set([
|
|
|
543594
543624
|
"context",
|
|
543595
543625
|
"help",
|
|
543596
543626
|
"sessions",
|
|
543597
|
-
"themes"
|
|
543627
|
+
"themes",
|
|
543628
|
+
"logout"
|
|
543598
543629
|
]);
|
|
543599
543630
|
const MAX_VISIBLE_ITEMS = 8;
|
|
543600
543631
|
const SUBVIEW_CONFIG = {
|
|
@@ -543621,6 +543652,10 @@ const SUBVIEW_CONFIG = {
|
|
|
543621
543652
|
themes: {
|
|
543622
543653
|
title: "Theme",
|
|
543623
543654
|
description: "Choose color theme"
|
|
543655
|
+
},
|
|
543656
|
+
logout: {
|
|
543657
|
+
title: "Log out",
|
|
543658
|
+
description: "You will need to re-authenticate"
|
|
543624
543659
|
}
|
|
543625
543660
|
};
|
|
543626
543661
|
function renderCommandRow({ cmd, isSelected, maxLabelLen, theme }) {
|
|
@@ -543694,6 +543729,7 @@ function SlashCommandMenu({ filter, onSelect, onCancel, currentReasoning = "medi
|
|
|
543694
543729
|
description: entry.title
|
|
543695
543730
|
}));
|
|
543696
543731
|
if (view === "themes") return THEME_COMMANDS;
|
|
543732
|
+
if (view === "logout") return LOGOUT_COMMANDS;
|
|
543697
543733
|
return filtered;
|
|
543698
543734
|
}, [view, filtered]);
|
|
543699
543735
|
(0, import_react.useEffect)(() => {
|
|
@@ -545691,7 +545727,7 @@ const RecentSessions = (0, import_react.memo)(({ cwd, sessions: sessionsProp, li
|
|
|
545691
545727
|
//#endregion
|
|
545692
545728
|
//#region src/components/WelcomeScreen.tsx
|
|
545693
545729
|
await init_build();
|
|
545694
|
-
const VERSION$1 = "0.4.
|
|
545730
|
+
const VERSION$1 = "0.4.14";
|
|
545695
545731
|
const FOCUS_SESSIONS = "welcome-sessions";
|
|
545696
545732
|
const MAX_SESSIONS = 5;
|
|
545697
545733
|
const WelcomeScreen = (0, import_react.memo)((t0) => {
|
|
@@ -547554,7 +547590,7 @@ const FooterSection = (0, import_react.memo)(() => {
|
|
|
547554
547590
|
children: [
|
|
547555
547591
|
"•",
|
|
547556
547592
|
" Fusion ",
|
|
547557
|
-
"0.4.
|
|
547593
|
+
"0.4.14"
|
|
547558
547594
|
]
|
|
547559
547595
|
});
|
|
547560
547596
|
$[5] = t4;
|
|
@@ -607254,42 +607290,7 @@ function highlightCode(code, lang) {
|
|
|
607254
607290
|
}
|
|
607255
607291
|
}
|
|
607256
607292
|
//#endregion
|
|
607257
|
-
//#region src/components/
|
|
607258
|
-
await init_build();
|
|
607259
|
-
function renderInlineFormatting(text) {
|
|
607260
|
-
const parts = [];
|
|
607261
|
-
const regex = /(\*\*(.+?)\*\*|__(.+?)__|~~(.+?)~~|\*(.+?)\*|_(.+?)_|`([^`]+)`|\[([^\]]+)\]\(([^)]+)\))/g;
|
|
607262
|
-
let lastIndex = 0;
|
|
607263
|
-
let match;
|
|
607264
|
-
let key = 0;
|
|
607265
|
-
while ((match = regex.exec(text)) !== null) {
|
|
607266
|
-
if (match.index > lastIndex) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: text.slice(lastIndex, match.index) }, key++));
|
|
607267
|
-
if (match[2] || match[3]) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
607268
|
-
bold: true,
|
|
607269
|
-
children: match[2] ?? match[3]
|
|
607270
|
-
}, key++));
|
|
607271
|
-
else if (match[4]) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
607272
|
-
strikethrough: true,
|
|
607273
|
-
children: match[4]
|
|
607274
|
-
}, key++));
|
|
607275
|
-
else if (match[5] || match[6]) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
607276
|
-
italic: true,
|
|
607277
|
-
children: match[5] ?? match[6]
|
|
607278
|
-
}, key++));
|
|
607279
|
-
else if (match[7]) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
607280
|
-
color: "yellow",
|
|
607281
|
-
children: match[7]
|
|
607282
|
-
}, key++));
|
|
607283
|
-
else if (match[8] && match[9]) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
607284
|
-
color: "cyan",
|
|
607285
|
-
underline: true,
|
|
607286
|
-
children: hyperlink(match[9], match[8])
|
|
607287
|
-
}, key++));
|
|
607288
|
-
lastIndex = match.index + match[0].length;
|
|
607289
|
-
}
|
|
607290
|
-
if (lastIndex < text.length) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: text.slice(lastIndex) }, key++));
|
|
607291
|
-
return parts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: parts }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: text });
|
|
607292
|
-
}
|
|
607293
|
+
//#region src/components/parseMarkdownBlocks.ts
|
|
607293
607294
|
function parseMarkdownBlocks(raw) {
|
|
607294
607295
|
const blocks = [];
|
|
607295
607296
|
const lines = raw.replace(/\r/g, "").split("\n");
|
|
@@ -607399,6 +607400,43 @@ function parseMarkdownBlocks(raw) {
|
|
|
607399
607400
|
}
|
|
607400
607401
|
return blocks;
|
|
607401
607402
|
}
|
|
607403
|
+
//#endregion
|
|
607404
|
+
//#region src/components/StreamingOutput.tsx
|
|
607405
|
+
await init_build();
|
|
607406
|
+
function renderInlineFormatting(text) {
|
|
607407
|
+
const parts = [];
|
|
607408
|
+
const regex = /(\*\*(.+?)\*\*|__(.+?)__|~~(.+?)~~|\*(.+?)\*|_(.+?)_|`([^`]+)`|\[([^\]]+)\]\(([^)]+)\))/g;
|
|
607409
|
+
let lastIndex = 0;
|
|
607410
|
+
let match;
|
|
607411
|
+
let key = 0;
|
|
607412
|
+
while ((match = regex.exec(text)) !== null) {
|
|
607413
|
+
if (match.index > lastIndex) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: text.slice(lastIndex, match.index) }, key++));
|
|
607414
|
+
if (match[2] || match[3]) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
607415
|
+
bold: true,
|
|
607416
|
+
children: match[2] ?? match[3]
|
|
607417
|
+
}, key++));
|
|
607418
|
+
else if (match[4]) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
607419
|
+
strikethrough: true,
|
|
607420
|
+
children: match[4]
|
|
607421
|
+
}, key++));
|
|
607422
|
+
else if (match[5] || match[6]) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
607423
|
+
italic: true,
|
|
607424
|
+
children: match[5] ?? match[6]
|
|
607425
|
+
}, key++));
|
|
607426
|
+
else if (match[7]) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
607427
|
+
color: "yellow",
|
|
607428
|
+
children: match[7]
|
|
607429
|
+
}, key++));
|
|
607430
|
+
else if (match[8] && match[9]) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
607431
|
+
color: "cyan",
|
|
607432
|
+
underline: true,
|
|
607433
|
+
children: hyperlink(match[9], match[8])
|
|
607434
|
+
}, key++));
|
|
607435
|
+
lastIndex = match.index + match[0].length;
|
|
607436
|
+
}
|
|
607437
|
+
if (lastIndex < text.length) parts.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: text.slice(lastIndex) }, key++));
|
|
607438
|
+
return parts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: parts }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: text });
|
|
607439
|
+
}
|
|
607402
607440
|
function renderCodeBlock(content, lang) {
|
|
607403
607441
|
const highlighted = highlightCode(content, lang);
|
|
607404
607442
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
@@ -641945,8 +641983,8 @@ function openExternalEditor() {
|
|
|
641945
641983
|
//#region src/components/CodeSession.tsx
|
|
641946
641984
|
await init_build();
|
|
641947
641985
|
const CodeSessionWrapper = (0, import_react.memo)((t0) => {
|
|
641948
|
-
const $ = (0, import_compiler_runtime.c)(
|
|
641949
|
-
const { session, sys, onExit, isTabActive: t1, updateCheck, credentials, onResumeSession, localSessions } = t0;
|
|
641986
|
+
const $ = (0, import_compiler_runtime.c)(16);
|
|
641987
|
+
const { session, sys, onExit, onLogout, isTabActive: t1, updateCheck, credentials, onResumeSession, localSessions } = t0;
|
|
641950
641988
|
const isTabActive = t1 === void 0 ? true : t1;
|
|
641951
641989
|
const [proxy, api] = useCodeGenFromSession(session);
|
|
641952
641990
|
let t2;
|
|
@@ -641957,11 +641995,12 @@ const CodeSessionWrapper = (0, import_react.memo)((t0) => {
|
|
|
641957
641995
|
$[2] = t2;
|
|
641958
641996
|
} else t2 = $[2];
|
|
641959
641997
|
let t3;
|
|
641960
|
-
if ($[3] !== credentials || $[4] !== isTabActive || $[5] !== localSessions || $[6] !== onExit || $[7] !==
|
|
641998
|
+
if ($[3] !== credentials || $[4] !== isTabActive || $[5] !== localSessions || $[6] !== onExit || $[7] !== onLogout || $[8] !== onResumeSession || $[9] !== session || $[10] !== sys || $[11] !== updateCheck) {
|
|
641961
641999
|
t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CodeSession, {
|
|
641962
642000
|
session,
|
|
641963
642001
|
sys,
|
|
641964
642002
|
onExit,
|
|
642003
|
+
onLogout,
|
|
641965
642004
|
isTabActive,
|
|
641966
642005
|
updateCheck,
|
|
641967
642006
|
credentials,
|
|
@@ -641972,25 +642011,26 @@ const CodeSessionWrapper = (0, import_react.memo)((t0) => {
|
|
|
641972
642011
|
$[4] = isTabActive;
|
|
641973
642012
|
$[5] = localSessions;
|
|
641974
642013
|
$[6] = onExit;
|
|
641975
|
-
$[7] =
|
|
641976
|
-
$[8] =
|
|
641977
|
-
$[9] =
|
|
641978
|
-
$[10] =
|
|
641979
|
-
$[11] =
|
|
641980
|
-
|
|
642014
|
+
$[7] = onLogout;
|
|
642015
|
+
$[8] = onResumeSession;
|
|
642016
|
+
$[9] = session;
|
|
642017
|
+
$[10] = sys;
|
|
642018
|
+
$[11] = updateCheck;
|
|
642019
|
+
$[12] = t3;
|
|
642020
|
+
} else t3 = $[12];
|
|
641981
642021
|
let t4;
|
|
641982
|
-
if ($[
|
|
642022
|
+
if ($[13] !== t2 || $[14] !== t3) {
|
|
641983
642023
|
t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CodeGenStateContext.Provider, {
|
|
641984
642024
|
value: t2,
|
|
641985
642025
|
children: t3
|
|
641986
642026
|
});
|
|
641987
|
-
$[
|
|
641988
|
-
$[
|
|
641989
|
-
$[
|
|
641990
|
-
} else t4 = $[
|
|
642027
|
+
$[13] = t2;
|
|
642028
|
+
$[14] = t3;
|
|
642029
|
+
$[15] = t4;
|
|
642030
|
+
} else t4 = $[15];
|
|
641991
642031
|
return t4;
|
|
641992
642032
|
});
|
|
641993
|
-
const CodeSession = (0, import_react.memo)(({ session, sys, onExit, isTabActive = true, updateCheck, credentials, onResumeSession, localSessions }) => {
|
|
642033
|
+
const CodeSession = (0, import_react.memo)(({ session, sys, onExit, onLogout, isTabActive = true, updateCheck, credentials, onResumeSession, localSessions }) => {
|
|
641994
642034
|
const { stdout } = useStdout();
|
|
641995
642035
|
const { rows, columns } = useWindowSize();
|
|
641996
642036
|
const [slashMenuActive, setSlashMenuActive] = (0, import_react.useState)(false);
|
|
@@ -642165,6 +642205,9 @@ const CodeSession = (0, import_react.memo)(({ session, sys, onExit, isTabActive
|
|
|
642165
642205
|
createdUnixTime: proxy.createdUnixTime
|
|
642166
642206
|
});
|
|
642167
642207
|
break;
|
|
642208
|
+
case "logout":
|
|
642209
|
+
if (selection.value === "confirm") onLogout?.();
|
|
642210
|
+
break;
|
|
642168
642211
|
case "config":
|
|
642169
642212
|
if (selection.value === "showSidebar") setPreference("showSidebar", !prefs.showSidebar);
|
|
642170
642213
|
break;
|
|
@@ -643369,6 +643412,10 @@ function CodeCommand({ onExit, sys, options, updateCheck }) {
|
|
|
643369
643412
|
const handleClawNewMessages = (0, import_react.useCallback)(() => {
|
|
643370
643413
|
if (displayMode !== "claw") setClawHasUnread(true);
|
|
643371
643414
|
}, [displayMode]);
|
|
643415
|
+
const handleLogout = (0, import_react.useCallback)(() => {
|
|
643416
|
+
clearCredentials(sys, "user");
|
|
643417
|
+
cleanup();
|
|
643418
|
+
}, [sys, cleanup]);
|
|
643372
643419
|
(0, import_react.useEffect)(() => {
|
|
643373
643420
|
if (isInsideVSCodeTerminal() && !isIdeBridgeActive()) installIdeBridge().then((result) => {
|
|
643374
643421
|
if (result.success) setIdeBridgeInstalled(true);
|
|
@@ -643495,6 +643542,7 @@ function CodeCommand({ onExit, sys, options, updateCheck }) {
|
|
|
643495
643542
|
credentials: credentialsRef.current,
|
|
643496
643543
|
session: sessionRef.current,
|
|
643497
643544
|
onExit: cleanup,
|
|
643545
|
+
onLogout: handleLogout,
|
|
643498
643546
|
isTabActive: onCodegen,
|
|
643499
643547
|
updateCheck,
|
|
643500
643548
|
onResumeSession: resumeSession,
|
|
@@ -643529,7 +643577,7 @@ function isStandaloneBinary() {
|
|
|
643529
643577
|
return !path$24.basename(process.execPath, ".exe").startsWith("node");
|
|
643530
643578
|
}
|
|
643531
643579
|
function getCurrentVersion() {
|
|
643532
|
-
return "0.4.
|
|
643580
|
+
return "0.4.14";
|
|
643533
643581
|
}
|
|
643534
643582
|
async function fetchLatestVersion() {
|
|
643535
643583
|
return new Promise((resolve, reject) => {
|
|
@@ -643972,7 +644020,7 @@ function initSentry() {
|
|
|
643972
644020
|
init({
|
|
643973
644021
|
dsn: "https://1c5033d697e0271ebe53773bff826de0@o117565.ingest.us.sentry.io/4511107776905216",
|
|
643974
644022
|
tracesSampleRate: 0,
|
|
643975
|
-
release: "0.4.
|
|
644023
|
+
release: "0.4.14",
|
|
643976
644024
|
environment: process.env.NODE_ENV ?? "development",
|
|
643977
644025
|
enabled: false,
|
|
643978
644026
|
registerEsmLoaderHooks: false,
|
|
@@ -643988,7 +644036,7 @@ await init_build();
|
|
|
643988
644036
|
init_esm$6();
|
|
643989
644037
|
init_node_sys();
|
|
643990
644038
|
init_dist$8();
|
|
643991
|
-
const VERSION = "0.4.
|
|
644039
|
+
const VERSION = "0.4.14";
|
|
643992
644040
|
async function startInk(command, options) {
|
|
643993
644041
|
const sys = await createDevToolsNodeSys({
|
|
643994
644042
|
cwd: process.cwd(),
|