@builder.io/buildercode 0.3.3 → 0.3.5
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 +291 -186
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -244266,7 +244266,7 @@ const LIB_CACHE = /* @__PURE__ */ new Map();
|
|
|
244266
244266
|
const PENDING_LIB_CACHE = /* @__PURE__ */ new Map();
|
|
244267
244267
|
const NODE_MODULE_CACHE = /* @__PURE__ */ new Map();
|
|
244268
244268
|
const TSCONFIG_CACHE = /* @__PURE__ */ new Map();
|
|
244269
|
-
const pkgVersion = process.env.OVERRIDE_VERSION ?? "0.3.
|
|
244269
|
+
const pkgVersion = process.env.OVERRIDE_VERSION ?? "0.3.5";
|
|
244270
244270
|
//#endregion
|
|
244271
244271
|
//#region ../dev-tools/core/detect-frameworks.ts
|
|
244272
244272
|
async function detectFrameworks$1(sys) {
|
|
@@ -521534,7 +521534,7 @@ Make the necessary changes and try again.`
|
|
|
521534
521534
|
position: agent?.position ?? `${basePosition}-agent`,
|
|
521535
521535
|
mode,
|
|
521536
521536
|
includeMemories,
|
|
521537
|
-
modelOverride: resolveModelShortcut(resolvedModel) ?? this.#lastModelOverride ?? this.#modelOverride,
|
|
521537
|
+
modelOverride: agent?.inheritSessionModel && (this.#lastModelOverride ?? this.#modelOverride) ? this.#lastModelOverride ?? this.#modelOverride : resolveModelShortcut(resolvedModel) ?? this.#lastModelOverride ?? this.#modelOverride,
|
|
521538
521538
|
sessionOrCompletionId: sessionId,
|
|
521539
521539
|
workingDirectory: this.#workingDirectory,
|
|
521540
521540
|
mcpServers,
|
|
@@ -523174,16 +523174,7 @@ Make the necessary changes and try again.`
|
|
|
523174
523174
|
this.#currentMessage = void 0;
|
|
523175
523175
|
if (filesChanged) this.#devServerOrchestrator?.addCheckpoint();
|
|
523176
523176
|
if (signal?.aborted) throw newAbortError(signal.reason);
|
|
523177
|
-
const scheduledMessage = this.#consumeScheduledMessages();
|
|
523178
|
-
if (scheduledMessage?.syncChanges) await this.syncChangesFromRemote(scheduledMessage.syncChanges);
|
|
523179
523177
|
const { hasHealthIssue } = await this.#checkAndUpdateHealthIssueCount();
|
|
523180
|
-
if (scheduledMessage) {
|
|
523181
|
-
this.#logger.debug(`(agentCompletion-${loopCount}): consumed queued messages`);
|
|
523182
|
-
includeUserMessage = true;
|
|
523183
|
-
userMessage = scheduledMessage;
|
|
523184
|
-
totalCompletions = 0;
|
|
523185
|
-
continue;
|
|
523186
|
-
}
|
|
523187
523178
|
if (!shouldContinue) {
|
|
523188
523179
|
if (signal?.aborted) throw newAbortError(signal.reason);
|
|
523189
523180
|
const sessionMode = this.getSessionMode();
|
|
@@ -523199,6 +523190,15 @@ Make the necessary changes and try again.`
|
|
|
523199
523190
|
healthIssueCount++;
|
|
523200
523191
|
continue;
|
|
523201
523192
|
}
|
|
523193
|
+
const scheduledMessage = this.#consumeScheduledMessages();
|
|
523194
|
+
if (scheduledMessage?.syncChanges) await this.syncChangesFromRemote(scheduledMessage.syncChanges);
|
|
523195
|
+
if (scheduledMessage) {
|
|
523196
|
+
this.#logger.debug(`(agentCompletion-${loopCount}): consumed queued messages`);
|
|
523197
|
+
includeUserMessage = true;
|
|
523198
|
+
userMessage = scheduledMessage;
|
|
523199
|
+
totalCompletions = 0;
|
|
523200
|
+
continue;
|
|
523201
|
+
}
|
|
523202
523202
|
const devServer = this.#devServerOrchestrator;
|
|
523203
523203
|
const shouldRunValidateCommand = userMessage.runValidateCommand ?? true;
|
|
523204
523204
|
if (devServer?.validateCommand && shouldRunValidateCommand && validationCount < 2 && this.#pendingValidation) {
|
|
@@ -523341,7 +523341,7 @@ failed with code ${result.code}`,
|
|
|
523341
523341
|
skipFileDiff: this.#skipFileDiff,
|
|
523342
523342
|
maxTokens: this.#maxTokens,
|
|
523343
523343
|
aclPolicy: this.#fusionConfig?.accessControl,
|
|
523344
|
-
repoIndexingConfig: this.#fusionConfig?.repoIndexingConfig,
|
|
523344
|
+
repoIndexingConfig: this.#fusionConfig?.repoIndexingConfig ?? { designSystems: [] },
|
|
523345
523345
|
recommendedRoot: this.#recommendedRootDir,
|
|
523346
523346
|
attachments: userInput.attachments,
|
|
523347
523347
|
customInstructions: sessionContext.customInstructions,
|
|
@@ -526439,7 +526439,8 @@ async function exit$1(toolContext, input) {
|
|
|
526439
526439
|
};
|
|
526440
526440
|
}
|
|
526441
526441
|
if (state === "verified") {
|
|
526442
|
-
const
|
|
526442
|
+
const setupNoInstallNeeded = !configuration.setupCommand.value;
|
|
526443
|
+
const setupVerified = configuration.setupCommand.verified || setupNoInstallNeeded;
|
|
526443
526444
|
const devVerified = configuration.devCommand.verified;
|
|
526444
526445
|
const serverVerified = configuration.devServer.verified;
|
|
526445
526446
|
const validateCommand = configuration.validateCommand.verified;
|
|
@@ -534260,7 +534261,8 @@ const InputPrompt = (0, import_react.memo)(({ onSubmit, onChange, onSlashCommand
|
|
|
534260
534261
|
const [inputKey, setInputKey] = (0, import_react.useState)(0);
|
|
534261
534262
|
const hasPlan = state.hasPlanToApply && !!onImplementPlan;
|
|
534262
534263
|
const planIsActive = hasPlan && !value;
|
|
534263
|
-
const
|
|
534264
|
+
const isPlanning = state.sessionMode === "planning" || state.sessionMode === "auto-planning";
|
|
534265
|
+
const hint = hasPlan ? "Type to refine the plan..." : isPlanning ? "Describe what you want to plan..." : "Describe what you want to build...";
|
|
534264
534266
|
const slashMenuActive = (0, import_react.useMemo)(() => !!onSlashCommand && isSlashCommandInput(value) && value.trim().length > 0 && value !== dismissedSlashValue, [
|
|
534265
534267
|
dismissedSlashValue,
|
|
534266
534268
|
onSlashCommand,
|
|
@@ -534330,7 +534332,7 @@ const InputPrompt = (0, import_react.memo)(({ onSubmit, onChange, onSlashCommand
|
|
|
534330
534332
|
setDismissedAtValue(value);
|
|
534331
534333
|
}, [value]);
|
|
534332
534334
|
const theme = useTheme();
|
|
534333
|
-
const accentColor =
|
|
534335
|
+
const accentColor = isPlanning ? "cyan" : "magenta";
|
|
534334
534336
|
const ide = state.ideContext;
|
|
534335
534337
|
const ideBasename = ide?.file ? ide.file.split("/").pop() ?? ide.file : null;
|
|
534336
534338
|
const ideFilename = ideBasename && ideBasename.length > 20 ? "…" + ideBasename.slice(-19) : ideBasename;
|
|
@@ -536912,7 +536914,7 @@ const ContextSection = (0, import_react.memo)(() => {
|
|
|
536912
536914
|
const $ = (0, import_compiler_runtime.c)(72);
|
|
536913
536915
|
const [state] = useCodeGenState();
|
|
536914
536916
|
const ctx = state.contextWindow;
|
|
536915
|
-
const barWidth = SIDEBAR_WIDTH$1 -
|
|
536917
|
+
const barWidth = SIDEBAR_WIDTH$1 - 24;
|
|
536916
536918
|
if (!ctx) {
|
|
536917
536919
|
let t0;
|
|
536918
536920
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -537885,7 +537887,7 @@ const TodoSection = (0, import_react.memo)(() => {
|
|
|
537885
537887
|
return t4;
|
|
537886
537888
|
});
|
|
537887
537889
|
const FooterSection = (0, import_react.memo)(() => {
|
|
537888
|
-
const $ = (0, import_compiler_runtime.c)(
|
|
537890
|
+
const $ = (0, import_compiler_runtime.c)(10);
|
|
537889
537891
|
const [state] = useCodeGenState();
|
|
537890
537892
|
let t0;
|
|
537891
537893
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -537893,49 +537895,63 @@ const FooterSection = (0, import_react.memo)(() => {
|
|
|
537893
537895
|
$[0] = t0;
|
|
537894
537896
|
} else t0 = $[0];
|
|
537895
537897
|
let t1;
|
|
537896
|
-
if ($[1]
|
|
537897
|
-
t1 =
|
|
537898
|
-
$[1] = t1;
|
|
537899
|
-
} else t1 = $[1];
|
|
537900
|
-
const t2 = state.gitState?.currentBranch;
|
|
537901
|
-
let t3;
|
|
537902
|
-
if ($[2] !== t2) {
|
|
537903
|
-
t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
537898
|
+
if ($[1] !== state.sessionId) {
|
|
537899
|
+
t1 = state.sessionId && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
537904
537900
|
marginTop: 1,
|
|
537905
537901
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
537906
537902
|
dimColor: true,
|
|
537907
|
-
children: [
|
|
537903
|
+
children: ["--resume ", state.sessionId]
|
|
537908
537904
|
})
|
|
537909
537905
|
});
|
|
537910
|
-
$[
|
|
537911
|
-
$[
|
|
537912
|
-
} else
|
|
537906
|
+
$[1] = state.sessionId;
|
|
537907
|
+
$[2] = t1;
|
|
537908
|
+
} else t1 = $[2];
|
|
537909
|
+
let t2;
|
|
537910
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
537911
|
+
t2 = process.cwd().replace(process.env.HOME ?? "", "~");
|
|
537912
|
+
$[3] = t2;
|
|
537913
|
+
} else t2 = $[3];
|
|
537914
|
+
const t3 = state.gitState?.currentBranch;
|
|
537913
537915
|
let t4;
|
|
537914
|
-
if ($[4]
|
|
537915
|
-
t4 = /* @__PURE__ */ (0, import_jsx_runtime.
|
|
537916
|
+
if ($[4] !== t3) {
|
|
537917
|
+
t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
537918
|
+
marginTop: 1,
|
|
537919
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
537920
|
+
dimColor: true,
|
|
537921
|
+
children: [t2, t3]
|
|
537922
|
+
})
|
|
537923
|
+
});
|
|
537924
|
+
$[4] = t3;
|
|
537925
|
+
$[5] = t4;
|
|
537926
|
+
} else t4 = $[5];
|
|
537927
|
+
let t5;
|
|
537928
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
537929
|
+
t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
537916
537930
|
dimColor: true,
|
|
537917
537931
|
children: [
|
|
537918
537932
|
"•",
|
|
537919
537933
|
" Fusion ",
|
|
537920
|
-
"0.3.
|
|
537934
|
+
"0.3.5"
|
|
537921
537935
|
]
|
|
537922
537936
|
});
|
|
537923
|
-
$[
|
|
537924
|
-
} else
|
|
537925
|
-
let
|
|
537926
|
-
if ($[
|
|
537927
|
-
|
|
537937
|
+
$[6] = t5;
|
|
537938
|
+
} else t5 = $[6];
|
|
537939
|
+
let t6;
|
|
537940
|
+
if ($[7] !== t1 || $[8] !== t4) {
|
|
537941
|
+
t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
537928
537942
|
flexDirection: "column",
|
|
537929
537943
|
children: [
|
|
537930
537944
|
t0,
|
|
537931
|
-
|
|
537932
|
-
t4
|
|
537945
|
+
t1,
|
|
537946
|
+
t4,
|
|
537947
|
+
t5
|
|
537933
537948
|
]
|
|
537934
537949
|
});
|
|
537935
|
-
$[
|
|
537936
|
-
$[
|
|
537937
|
-
|
|
537938
|
-
|
|
537950
|
+
$[7] = t1;
|
|
537951
|
+
$[8] = t4;
|
|
537952
|
+
$[9] = t6;
|
|
537953
|
+
} else t6 = $[9];
|
|
537954
|
+
return t6;
|
|
537939
537955
|
});
|
|
537940
537956
|
const Sidebar = (0, import_react.memo)(() => {
|
|
537941
537957
|
const $ = (0, import_compiler_runtime.c)(10);
|
|
@@ -597468,7 +597484,7 @@ function _temp2$1(line, i) {
|
|
|
597468
597484
|
}, i);
|
|
597469
597485
|
}
|
|
597470
597486
|
function ToolCallRead(t0) {
|
|
597471
|
-
const $ = (0, import_compiler_runtime.c)(
|
|
597487
|
+
const $ = (0, import_compiler_runtime.c)(14);
|
|
597472
597488
|
const { tool } = t0;
|
|
597473
597489
|
let t1;
|
|
597474
597490
|
if ($[0] !== tool.input) {
|
|
@@ -597478,43 +597494,41 @@ function ToolCallRead(t0) {
|
|
|
597478
597494
|
} else t1 = $[1];
|
|
597479
597495
|
const { file_path, offset, limit, view_range } = t1;
|
|
597480
597496
|
let rangeInfo;
|
|
597481
|
-
if (view_range) rangeInfo =
|
|
597497
|
+
if (view_range) rangeInfo = `:${view_range[0]} ${view_range[1] - view_range[0]}L`;
|
|
597482
597498
|
else if (offset != null || limit != null) {
|
|
597483
|
-
|
|
597484
|
-
|
|
597485
|
-
|
|
597486
|
-
|
|
597487
|
-
|
|
597488
|
-
$[
|
|
597489
|
-
|
|
597490
|
-
|
|
597491
|
-
} else parts = $[4];
|
|
597492
|
-
rangeInfo = parts.join(", ");
|
|
597499
|
+
const t2 = `${offset != null ? `:${offset}` : ""}${limit != null ? ` ${limit}L` : ""}`;
|
|
597500
|
+
let t3;
|
|
597501
|
+
if ($[2] !== t2) {
|
|
597502
|
+
t3 = t2.trim();
|
|
597503
|
+
$[2] = t2;
|
|
597504
|
+
$[3] = t3;
|
|
597505
|
+
} else t3 = $[3];
|
|
597506
|
+
rangeInfo = t3;
|
|
597493
597507
|
}
|
|
597494
597508
|
let t2;
|
|
597495
|
-
if ($[
|
|
597509
|
+
if ($[4] !== file_path) {
|
|
597496
597510
|
t2 = file_path && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FilePath, { path: file_path });
|
|
597497
|
-
$[
|
|
597498
|
-
$[
|
|
597499
|
-
} else t2 = $[
|
|
597511
|
+
$[4] = file_path;
|
|
597512
|
+
$[5] = t2;
|
|
597513
|
+
} else t2 = $[5];
|
|
597500
597514
|
let t3;
|
|
597501
|
-
if ($[
|
|
597515
|
+
if ($[6] !== rangeInfo) {
|
|
597502
597516
|
t3 = rangeInfo && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
597503
597517
|
dimColor: true,
|
|
597504
597518
|
children: rangeInfo
|
|
597505
597519
|
});
|
|
597506
|
-
$[
|
|
597507
|
-
$[
|
|
597508
|
-
} else t3 = $[
|
|
597520
|
+
$[6] = rangeInfo;
|
|
597521
|
+
$[7] = t3;
|
|
597522
|
+
} else t3 = $[7];
|
|
597509
597523
|
let t4;
|
|
597510
|
-
if ($[
|
|
597524
|
+
if ($[8] !== t2 || $[9] !== t3) {
|
|
597511
597525
|
t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [t2, t3] });
|
|
597512
|
-
$[
|
|
597513
|
-
$[
|
|
597514
|
-
$[
|
|
597515
|
-
} else t4 = $[
|
|
597526
|
+
$[8] = t2;
|
|
597527
|
+
$[9] = t3;
|
|
597528
|
+
$[10] = t4;
|
|
597529
|
+
} else t4 = $[10];
|
|
597516
597530
|
let t5;
|
|
597517
|
-
if ($[
|
|
597531
|
+
if ($[11] !== t4 || $[12] !== tool) {
|
|
597518
597532
|
t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
597519
597533
|
flexDirection: "column",
|
|
597520
597534
|
paddingX: 1,
|
|
@@ -597524,10 +597538,10 @@ function ToolCallRead(t0) {
|
|
|
597524
597538
|
extra: t4
|
|
597525
597539
|
})
|
|
597526
597540
|
});
|
|
597527
|
-
$[
|
|
597528
|
-
$[
|
|
597529
|
-
$[
|
|
597530
|
-
} else t5 = $[
|
|
597541
|
+
$[11] = t4;
|
|
597542
|
+
$[12] = tool;
|
|
597543
|
+
$[13] = t5;
|
|
597544
|
+
} else t5 = $[13];
|
|
597531
597545
|
return t5;
|
|
597532
597546
|
}
|
|
597533
597547
|
function ToolCallEdit(t0) {
|
|
@@ -597664,7 +597678,7 @@ function ToolCallMultiEdit(t0) {
|
|
|
597664
597678
|
return t7;
|
|
597665
597679
|
}
|
|
597666
597680
|
function ToolCallBash(t0) {
|
|
597667
|
-
const $ = (0, import_compiler_runtime.c)(
|
|
597681
|
+
const $ = (0, import_compiler_runtime.c)(21);
|
|
597668
597682
|
const { tool } = t0;
|
|
597669
597683
|
let t1;
|
|
597670
597684
|
if ($[0] !== tool.input) {
|
|
@@ -597673,61 +597687,78 @@ function ToolCallBash(t0) {
|
|
|
597673
597687
|
$[1] = t1;
|
|
597674
597688
|
} else t1 = $[1];
|
|
597675
597689
|
const { command, description, restart } = t1;
|
|
597690
|
+
const displayTitle = restart ? "[restart]" : description;
|
|
597676
597691
|
let t2;
|
|
597677
|
-
if ($[2] !== command || $[3] !==
|
|
597678
|
-
t2 = restart
|
|
597692
|
+
if ($[2] !== command || $[3] !== restart) {
|
|
597693
|
+
t2 = !restart && command ? command.includes("\n") ? command.split("\n")[0] + " ..." : command.slice(0, 80) : void 0;
|
|
597679
597694
|
$[2] = command;
|
|
597680
|
-
$[3] =
|
|
597681
|
-
$[4] =
|
|
597682
|
-
|
|
597683
|
-
} else t2 = $[5];
|
|
597695
|
+
$[3] = restart;
|
|
597696
|
+
$[4] = t2;
|
|
597697
|
+
} else t2 = $[4];
|
|
597684
597698
|
const displayCmd = t2;
|
|
597685
597699
|
let t3;
|
|
597686
|
-
if ($[
|
|
597700
|
+
if ($[5] !== tool.state || $[6] !== tool.toolResult) {
|
|
597687
597701
|
t3 = tool.state === "success" || tool.state === "error" ? getResultText(tool.toolResult) : void 0;
|
|
597688
|
-
$[
|
|
597689
|
-
$[
|
|
597690
|
-
$[
|
|
597691
|
-
} else t3 = $[
|
|
597702
|
+
$[5] = tool.state;
|
|
597703
|
+
$[6] = tool.toolResult;
|
|
597704
|
+
$[7] = t3;
|
|
597705
|
+
} else t3 = $[7];
|
|
597692
597706
|
const resultText = t3;
|
|
597693
597707
|
let t4;
|
|
597694
|
-
if ($[
|
|
597695
|
-
t4 =
|
|
597696
|
-
$[
|
|
597697
|
-
$[
|
|
597698
|
-
} else t4 = $[
|
|
597708
|
+
if ($[8] !== displayTitle) {
|
|
597709
|
+
t4 = displayTitle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CmdText, { cmd: displayTitle }) : void 0;
|
|
597710
|
+
$[8] = displayTitle;
|
|
597711
|
+
$[9] = t4;
|
|
597712
|
+
} else t4 = $[9];
|
|
597699
597713
|
let t5;
|
|
597700
|
-
if ($[
|
|
597714
|
+
if ($[10] !== t4 || $[11] !== tool) {
|
|
597701
597715
|
t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolHeader, {
|
|
597702
597716
|
tool,
|
|
597703
597717
|
label: TOOL_LABELS.Bash,
|
|
597704
597718
|
extra: t4
|
|
597705
597719
|
});
|
|
597706
|
-
$[
|
|
597707
|
-
$[
|
|
597708
|
-
$[
|
|
597709
|
-
} else t5 = $[
|
|
597720
|
+
$[10] = t4;
|
|
597721
|
+
$[11] = tool;
|
|
597722
|
+
$[12] = t5;
|
|
597723
|
+
} else t5 = $[12];
|
|
597710
597724
|
let t6;
|
|
597711
|
-
if ($[
|
|
597712
|
-
t6 =
|
|
597725
|
+
if ($[13] !== displayCmd) {
|
|
597726
|
+
t6 = displayCmd && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
597727
|
+
paddingLeft: 3,
|
|
597728
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
597729
|
+
dimColor: true,
|
|
597730
|
+
children: ["$ ", displayCmd]
|
|
597731
|
+
})
|
|
597732
|
+
});
|
|
597733
|
+
$[13] = displayCmd;
|
|
597734
|
+
$[14] = t6;
|
|
597735
|
+
} else t6 = $[14];
|
|
597736
|
+
let t7;
|
|
597737
|
+
if ($[15] !== resultText) {
|
|
597738
|
+
t7 = resultText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OutputPreview, {
|
|
597713
597739
|
text: resultText,
|
|
597714
597740
|
maxLines: 8
|
|
597715
597741
|
});
|
|
597716
|
-
$[
|
|
597717
|
-
$[
|
|
597718
|
-
} else
|
|
597719
|
-
let
|
|
597720
|
-
if ($[
|
|
597721
|
-
|
|
597742
|
+
$[15] = resultText;
|
|
597743
|
+
$[16] = t7;
|
|
597744
|
+
} else t7 = $[16];
|
|
597745
|
+
let t8;
|
|
597746
|
+
if ($[17] !== t5 || $[18] !== t6 || $[19] !== t7) {
|
|
597747
|
+
t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
597722
597748
|
flexDirection: "column",
|
|
597723
597749
|
paddingX: 1,
|
|
597724
|
-
children: [
|
|
597750
|
+
children: [
|
|
597751
|
+
t5,
|
|
597752
|
+
t6,
|
|
597753
|
+
t7
|
|
597754
|
+
]
|
|
597725
597755
|
});
|
|
597726
|
-
$[
|
|
597727
|
-
$[
|
|
597728
|
-
$[
|
|
597729
|
-
|
|
597730
|
-
|
|
597756
|
+
$[17] = t5;
|
|
597757
|
+
$[18] = t6;
|
|
597758
|
+
$[19] = t7;
|
|
597759
|
+
$[20] = t8;
|
|
597760
|
+
} else t8 = $[20];
|
|
597761
|
+
return t8;
|
|
597731
597762
|
}
|
|
597732
597763
|
function ToolCallGrep(t0) {
|
|
597733
597764
|
const $ = (0, import_compiler_runtime.c)(23);
|
|
@@ -598613,8 +598644,30 @@ function buildDots(added, removed) {
|
|
|
598613
598644
|
red: dots - green
|
|
598614
598645
|
};
|
|
598615
598646
|
}
|
|
598647
|
+
const IDLE_VERBS = [
|
|
598648
|
+
"Worked",
|
|
598649
|
+
"Cooked",
|
|
598650
|
+
"Crunched",
|
|
598651
|
+
"Built",
|
|
598652
|
+
"Boiled",
|
|
598653
|
+
"Crafted",
|
|
598654
|
+
"Brewed",
|
|
598655
|
+
"Hammered",
|
|
598656
|
+
"Churned",
|
|
598657
|
+
"Wrangled",
|
|
598658
|
+
"Baked",
|
|
598659
|
+
"Forged",
|
|
598660
|
+
"Hacked",
|
|
598661
|
+
"Computed",
|
|
598662
|
+
"Chiseled"
|
|
598663
|
+
];
|
|
598664
|
+
function pickVerb(seed) {
|
|
598665
|
+
let hash = 0;
|
|
598666
|
+
for (let i = 0; i < seed.length; i++) hash = hash * 31 + seed.charCodeAt(i) >>> 0;
|
|
598667
|
+
return IDLE_VERBS[hash % IDLE_VERBS.length];
|
|
598668
|
+
}
|
|
598616
598669
|
function IdleBlock(t0) {
|
|
598617
|
-
const $ = (0, import_compiler_runtime.c)(
|
|
598670
|
+
const $ = (0, import_compiler_runtime.c)(20);
|
|
598618
598671
|
const { message } = t0;
|
|
598619
598672
|
let t1;
|
|
598620
598673
|
if ($[0] !== message.durationMs) {
|
|
@@ -598623,73 +598676,86 @@ function IdleBlock(t0) {
|
|
|
598623
598676
|
$[1] = t1;
|
|
598624
598677
|
} else t1 = $[1];
|
|
598625
598678
|
const duration = t1;
|
|
598626
|
-
|
|
598627
|
-
if ($[2] !== message.creditsUsed) {
|
|
598628
|
-
t2 = message.creditsUsed > 0 ? `${message.creditsUsed.toFixed(2)} credits` : null;
|
|
598629
|
-
$[2] = message.creditsUsed;
|
|
598630
|
-
$[3] = t2;
|
|
598631
|
-
} else t2 = $[3];
|
|
598632
|
-
const credits = t2;
|
|
598679
|
+
const t2 = message.id ?? duration;
|
|
598633
598680
|
let t3;
|
|
598634
|
-
if ($[
|
|
598635
|
-
t3 =
|
|
598681
|
+
if ($[2] !== t2) {
|
|
598682
|
+
t3 = pickVerb(t2);
|
|
598683
|
+
$[2] = t2;
|
|
598684
|
+
$[3] = t3;
|
|
598685
|
+
} else t3 = $[3];
|
|
598686
|
+
const verb = t3;
|
|
598687
|
+
let t4;
|
|
598688
|
+
if ($[4] !== message.creditsUsed) {
|
|
598689
|
+
t4 = message.creditsUsed > 0 ? `${message.creditsUsed.toFixed(2)} credits` : null;
|
|
598690
|
+
$[4] = message.creditsUsed;
|
|
598691
|
+
$[5] = t4;
|
|
598692
|
+
} else t4 = $[5];
|
|
598693
|
+
const credits = t4;
|
|
598694
|
+
let t5;
|
|
598695
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
598696
|
+
t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
598636
598697
|
color: "magenta",
|
|
598637
598698
|
bold: true,
|
|
598638
598699
|
children: "✦"
|
|
598639
598700
|
});
|
|
598640
|
-
$[
|
|
598641
|
-
} else
|
|
598642
|
-
let
|
|
598643
|
-
if ($[
|
|
598644
|
-
|
|
598701
|
+
$[6] = t5;
|
|
598702
|
+
} else t5 = $[6];
|
|
598703
|
+
let t6;
|
|
598704
|
+
if ($[7] !== duration || $[8] !== verb) {
|
|
598705
|
+
t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
598645
598706
|
bold: true,
|
|
598646
|
-
children: [
|
|
598707
|
+
children: [
|
|
598708
|
+
verb,
|
|
598709
|
+
" for ",
|
|
598710
|
+
duration
|
|
598711
|
+
]
|
|
598647
598712
|
});
|
|
598648
|
-
$[
|
|
598649
|
-
$[
|
|
598650
|
-
|
|
598651
|
-
|
|
598652
|
-
|
|
598653
|
-
|
|
598713
|
+
$[7] = duration;
|
|
598714
|
+
$[8] = verb;
|
|
598715
|
+
$[9] = t6;
|
|
598716
|
+
} else t6 = $[9];
|
|
598717
|
+
let t7;
|
|
598718
|
+
if ($[10] !== credits) {
|
|
598719
|
+
t7 = credits && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
598654
598720
|
dimColor: true,
|
|
598655
598721
|
children: ["· ", credits]
|
|
598656
598722
|
});
|
|
598657
|
-
$[
|
|
598658
|
-
$[
|
|
598659
|
-
} else
|
|
598660
|
-
let
|
|
598661
|
-
if ($[
|
|
598662
|
-
|
|
598723
|
+
$[10] = credits;
|
|
598724
|
+
$[11] = t7;
|
|
598725
|
+
} else t7 = $[11];
|
|
598726
|
+
let t8;
|
|
598727
|
+
if ($[12] !== t6 || $[13] !== t7) {
|
|
598728
|
+
t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
598663
598729
|
gap: 1,
|
|
598664
598730
|
children: [
|
|
598665
|
-
|
|
598666
|
-
|
|
598667
|
-
|
|
598731
|
+
t5,
|
|
598732
|
+
t6,
|
|
598733
|
+
t7
|
|
598668
598734
|
]
|
|
598669
598735
|
});
|
|
598670
|
-
$[
|
|
598671
|
-
$[10] = t5;
|
|
598672
|
-
$[11] = t6;
|
|
598673
|
-
} else t6 = $[11];
|
|
598674
|
-
let t7;
|
|
598675
|
-
if ($[12] !== message.applyResults) {
|
|
598676
|
-
t7 = message.applyResults.map(_temp$1);
|
|
598677
|
-
$[12] = message.applyResults;
|
|
598736
|
+
$[12] = t6;
|
|
598678
598737
|
$[13] = t7;
|
|
598679
|
-
|
|
598680
|
-
|
|
598681
|
-
|
|
598682
|
-
|
|
598738
|
+
$[14] = t8;
|
|
598739
|
+
} else t8 = $[14];
|
|
598740
|
+
let t9;
|
|
598741
|
+
if ($[15] !== message.applyResults) {
|
|
598742
|
+
t9 = message.applyResults.map(_temp$1);
|
|
598743
|
+
$[15] = message.applyResults;
|
|
598744
|
+
$[16] = t9;
|
|
598745
|
+
} else t9 = $[16];
|
|
598746
|
+
let t10;
|
|
598747
|
+
if ($[17] !== t8 || $[18] !== t9) {
|
|
598748
|
+
t10 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
598683
598749
|
flexDirection: "column",
|
|
598684
598750
|
paddingX: 0,
|
|
598685
598751
|
marginY: 1,
|
|
598686
|
-
children: [
|
|
598752
|
+
children: [t8, t9]
|
|
598687
598753
|
});
|
|
598688
|
-
$[
|
|
598689
|
-
$[
|
|
598690
|
-
$[
|
|
598691
|
-
} else
|
|
598692
|
-
return
|
|
598754
|
+
$[17] = t8;
|
|
598755
|
+
$[18] = t9;
|
|
598756
|
+
$[19] = t10;
|
|
598757
|
+
} else t10 = $[19];
|
|
598758
|
+
return t10;
|
|
598693
598759
|
}
|
|
598694
598760
|
function _temp$1(result) {
|
|
598695
598761
|
const { green, red } = buildDots(result.addedLines, result.removedLines);
|
|
@@ -598701,13 +598767,15 @@ function _temp$1(result) {
|
|
|
598701
598767
|
dimColor: true,
|
|
598702
598768
|
children: result.filePath
|
|
598703
598769
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, { children: [
|
|
598704
|
-
|
|
598705
|
-
|
|
598706
|
-
children: [
|
|
598707
|
-
|
|
598708
|
-
|
|
598709
|
-
|
|
598710
|
-
|
|
598770
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
598771
|
+
marginRight: 1,
|
|
598772
|
+
children: [result.addedLines > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
598773
|
+
color: "green",
|
|
598774
|
+
children: ["+", result.addedLines]
|
|
598775
|
+
}), result.removedLines > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
598776
|
+
color: "red",
|
|
598777
|
+
children: ["-", result.removedLines]
|
|
598778
|
+
})]
|
|
598711
598779
|
}),
|
|
598712
598780
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
598713
598781
|
color: "green",
|
|
@@ -598794,6 +598862,7 @@ const CodeSessionWrapper = (0, import_react.memo)((t0) => {
|
|
|
598794
598862
|
const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
|
|
598795
598863
|
const { stdout } = useStdout();
|
|
598796
598864
|
const [cols, setCols] = (0, import_react.useState)(stdout?.columns ?? 80);
|
|
598865
|
+
const [rows, setRows] = (0, import_react.useState)(stdout?.rows ?? 24);
|
|
598797
598866
|
const [slashMenuActive, setSlashMenuActive] = (0, import_react.useState)(false);
|
|
598798
598867
|
const [ctrlCPending, setCtrlCPending] = (0, import_react.useState)(false);
|
|
598799
598868
|
const ctrlCTimer = (0, import_react.useRef)(null);
|
|
@@ -598827,7 +598896,7 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
|
|
|
598827
598896
|
}, [scrollByClamped]);
|
|
598828
598897
|
const [state, api, proxy] = useCodeGenState();
|
|
598829
598898
|
const showWelcome = state.state === "loading" || state.state === "initial-with-url" || state.state === "initial-without-url";
|
|
598830
|
-
const showSidebar = cols >= 90 && !showWelcome;
|
|
598899
|
+
const showSidebar = cols >= 90 && rows >= 24 && !showWelcome;
|
|
598831
598900
|
const answerUserQuestions = (0, import_react.useCallback)((answers) => {
|
|
598832
598901
|
const id = state.activeUserQuestions?.id;
|
|
598833
598902
|
if (!id) return;
|
|
@@ -598837,6 +598906,7 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
|
|
|
598837
598906
|
const handleResize = () => {
|
|
598838
598907
|
scrollRef.current?.remeasure();
|
|
598839
598908
|
setCols(stdout?.columns ?? 80);
|
|
598909
|
+
setRows(stdout?.rows ?? 24);
|
|
598840
598910
|
};
|
|
598841
598911
|
stdout?.on("resize", handleResize);
|
|
598842
598912
|
return () => {
|
|
@@ -598949,12 +599019,11 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
|
|
|
598949
599019
|
scrollRef.current?.scrollToBottom();
|
|
598950
599020
|
}, [handleSlashCommand]);
|
|
598951
599021
|
const handleImplementPlan = (0, import_react.useCallback)(async () => {
|
|
598952
|
-
await api.switchSessionMode("normal");
|
|
598953
|
-
await api.clearSession();
|
|
598954
599022
|
await api.sendMessage({
|
|
598955
|
-
userPrompt: "
|
|
598956
|
-
displayPrompt:
|
|
599023
|
+
userPrompt: "Let's implement the plan. Pay attention to the details, makes sure to use TodoWrite to update the steps to todo.",
|
|
599024
|
+
displayPrompt: `Let's implement the plan`,
|
|
598957
599025
|
queue: true,
|
|
599026
|
+
sessionMode: "normal",
|
|
598958
599027
|
user: {
|
|
598959
599028
|
role: "user",
|
|
598960
599029
|
source: "builder.io"
|
|
@@ -598963,6 +599032,9 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
|
|
|
598963
599032
|
userScrolledUp.current = false;
|
|
598964
599033
|
scrollRef.current?.scrollToBottom();
|
|
598965
599034
|
}, [api]);
|
|
599035
|
+
const startIndex = Math.max(0, state.messages.length - 200);
|
|
599036
|
+
const visibleMessages = state.messages.slice(startIndex);
|
|
599037
|
+
const hiddenCount = startIndex;
|
|
598966
599038
|
const showInput = !!!state.activeUserQuestions;
|
|
598967
599039
|
if (!isTabActive) return null;
|
|
598968
599040
|
if (showWelcome) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
@@ -599003,11 +599075,24 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
|
|
|
599003
599075
|
children: "You can still type below. Use /clear to reset the session."
|
|
599004
599076
|
})]
|
|
599005
599077
|
}),
|
|
599006
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.
|
|
599078
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ScrollView, {
|
|
599007
599079
|
ref: scrollRef,
|
|
599008
599080
|
flexGrow: 1,
|
|
599009
599081
|
flexDirection: "column",
|
|
599010
|
-
children:
|
|
599082
|
+
children: [hiddenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
599083
|
+
paddingX: 2,
|
|
599084
|
+
paddingY: 1,
|
|
599085
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
599086
|
+
dimColor: true,
|
|
599087
|
+
children: [
|
|
599088
|
+
"─── ",
|
|
599089
|
+
hiddenCount,
|
|
599090
|
+
" older message",
|
|
599091
|
+
hiddenCount === 1 ? "" : "s",
|
|
599092
|
+
" not shown ───"
|
|
599093
|
+
]
|
|
599094
|
+
})
|
|
599095
|
+
}), visibleMessages.map((msg, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorBoundary, {
|
|
599011
599096
|
fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
599012
599097
|
paddingX: 2,
|
|
599013
599098
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
@@ -599016,8 +599101,8 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
|
|
|
599016
599101
|
children: "[failed to render message]"
|
|
599017
599102
|
})
|
|
599018
599103
|
}),
|
|
599019
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MessageBlockView, { message: proxy.messages[i] }, `msg-${msg.id}-${i}`)
|
|
599020
|
-
}, `err-${msg.id}-${i}`))
|
|
599104
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MessageBlockView, { message: proxy.messages[startIndex + i] }, `msg-${msg.id}-${startIndex + i}`)
|
|
599105
|
+
}, `err-${msg.id}-${startIndex + i}`))]
|
|
599021
599106
|
})
|
|
599022
599107
|
})
|
|
599023
599108
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
@@ -599358,6 +599443,7 @@ const ClawSidebar = (0, import_react.memo)(() => {
|
|
|
599358
599443
|
const ClawSession = (0, import_react.memo)(({ credentials, isActive, onNewMessages, onExit }) => {
|
|
599359
599444
|
const { stdout } = useStdout();
|
|
599360
599445
|
const [cols, setCols] = (0, import_react.useState)(stdout?.columns ?? 80);
|
|
599446
|
+
const [rows, setRows] = (0, import_react.useState)(stdout?.rows ?? 24);
|
|
599361
599447
|
const theme = useTheme();
|
|
599362
599448
|
const [inputValue, setInputValue] = (0, import_react.useState)("");
|
|
599363
599449
|
const [ctrlCPending, setCtrlCPending] = (0, import_react.useState)(false);
|
|
@@ -599400,13 +599486,14 @@ const ClawSession = (0, import_react.memo)(({ credentials, isActive, onNewMessag
|
|
|
599400
599486
|
const handleResize = () => {
|
|
599401
599487
|
scrollRef.current?.remeasure();
|
|
599402
599488
|
setCols(stdout?.columns ?? 80);
|
|
599489
|
+
setRows(stdout?.rows ?? 24);
|
|
599403
599490
|
};
|
|
599404
599491
|
stdout?.on("resize", handleResize);
|
|
599405
599492
|
return () => {
|
|
599406
599493
|
stdout?.off("resize", handleResize);
|
|
599407
599494
|
};
|
|
599408
599495
|
}, [stdout]);
|
|
599409
|
-
const showSidebar = cols >= 100;
|
|
599496
|
+
const showSidebar = cols >= 100 && rows >= 24;
|
|
599410
599497
|
const handleSubmit = (0, import_react.useCallback)(async (val) => {
|
|
599411
599498
|
if (!val.trim() || isSending) return;
|
|
599412
599499
|
setInputValue("");
|
|
@@ -599469,17 +599556,35 @@ const ClawSession = (0, import_react.memo)(({ credentials, isActive, onNewMessag
|
|
|
599469
599556
|
dimColor: true,
|
|
599470
599557
|
children: "No messages yet. Send a message to start a conversation with Claw."
|
|
599471
599558
|
})
|
|
599472
|
-
}) :
|
|
599473
|
-
|
|
599559
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: (() => {
|
|
599560
|
+
const startIndex = Math.max(0, messages.length - 100);
|
|
599561
|
+
const visibleMessages = messages.slice(startIndex);
|
|
599562
|
+
const hiddenCount = startIndex;
|
|
599563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [hiddenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
599474
599564
|
paddingX: 2,
|
|
599475
|
-
|
|
599476
|
-
|
|
599565
|
+
paddingY: 1,
|
|
599566
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
599477
599567
|
dimColor: true,
|
|
599478
|
-
children:
|
|
599568
|
+
children: [
|
|
599569
|
+
"─── ",
|
|
599570
|
+
hiddenCount,
|
|
599571
|
+
" older message",
|
|
599572
|
+
hiddenCount === 1 ? "" : "s",
|
|
599573
|
+
" not shown ───"
|
|
599574
|
+
]
|
|
599479
599575
|
})
|
|
599480
|
-
}),
|
|
599481
|
-
|
|
599482
|
-
|
|
599576
|
+
}), visibleMessages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorBoundary, {
|
|
599577
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
599578
|
+
paddingX: 2,
|
|
599579
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
599580
|
+
color: "red",
|
|
599581
|
+
dimColor: true,
|
|
599582
|
+
children: "[failed to render message]"
|
|
599583
|
+
})
|
|
599584
|
+
}),
|
|
599585
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClawMessageView, { message: msg })
|
|
599586
|
+
}, msg.id))] });
|
|
599587
|
+
})() })
|
|
599483
599588
|
})
|
|
599484
599589
|
}),
|
|
599485
599590
|
isWaitingForReply && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
@@ -599976,7 +600081,7 @@ function initSentry() {
|
|
|
599976
600081
|
init({
|
|
599977
600082
|
dsn: "https://1c5033d697e0271ebe53773bff826de0@o117565.ingest.us.sentry.io/4511107776905216",
|
|
599978
600083
|
tracesSampleRate: 0,
|
|
599979
|
-
release: "0.3.
|
|
600084
|
+
release: "0.3.5",
|
|
599980
600085
|
environment: process.env.NODE_ENV ?? "development",
|
|
599981
600086
|
enabled: false,
|
|
599982
600087
|
registerEsmLoaderHooks: false,
|
|
@@ -600000,7 +600105,7 @@ function isStandaloneBinary() {
|
|
|
600000
600105
|
return !path$6.basename(process.execPath, ".exe").startsWith("node");
|
|
600001
600106
|
}
|
|
600002
600107
|
function getCurrentVersion() {
|
|
600003
|
-
return "0.3.
|
|
600108
|
+
return "0.3.5";
|
|
600004
600109
|
}
|
|
600005
600110
|
async function fetchLatestVersion() {
|
|
600006
600111
|
return new Promise((resolve, reject) => {
|
|
@@ -600176,7 +600281,7 @@ async function downloadFile(url, dest) {
|
|
|
600176
600281
|
}
|
|
600177
600282
|
//#endregion
|
|
600178
600283
|
//#region src/cli.tsx
|
|
600179
|
-
const VERSION = "0.3.
|
|
600284
|
+
const VERSION = "0.3.5";
|
|
600180
600285
|
async function startInk(command, options) {
|
|
600181
600286
|
await render(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
|
600182
600287
|
command,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/buildercode",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Builder.io
|
|
3
|
+
"version": "0.3.5",
|
|
4
|
+
"description": "Builder.io CLI - AI-powered code generation",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
7
7
|
"builder": "dist/cli.mjs"
|