@base44-preview/cli 0.1.15-pr.630.51361fe → 0.1.15-pr.630.5b0c119
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 +293 -125
- package/dist/cli/index.js.map +9 -9
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -52822,7 +52822,7 @@ function canBreakFn(doc) {
|
|
|
52822
52822
|
function canBreak(doc) {
|
|
52823
52823
|
return findInDoc(doc, canBreakFn, false);
|
|
52824
52824
|
}
|
|
52825
|
-
function
|
|
52825
|
+
function indent2(contents) {
|
|
52826
52826
|
assertDoc(contents);
|
|
52827
52827
|
return { type: DOC_TYPE_INDENT, contents };
|
|
52828
52828
|
}
|
|
@@ -52845,7 +52845,7 @@ function addAlignmentToDoc(doc, size, tabWidth) {
|
|
|
52845
52845
|
let aligned = doc;
|
|
52846
52846
|
if (size > 0) {
|
|
52847
52847
|
for (let level = 0;level < Math.floor(size / tabWidth); ++level) {
|
|
52848
|
-
aligned =
|
|
52848
|
+
aligned = indent2(aligned);
|
|
52849
52849
|
}
|
|
52850
52850
|
aligned = align(size % tabWidth, aligned);
|
|
52851
52851
|
aligned = align(Number.NEGATIVE_INFINITY, aligned);
|
|
@@ -53179,7 +53179,7 @@ function printDocToString(doc, options) {
|
|
|
53179
53179
|
propagateBreaks(doc);
|
|
53180
53180
|
while (commands.length > 0) {
|
|
53181
53181
|
const {
|
|
53182
|
-
indent:
|
|
53182
|
+
indent: indent22,
|
|
53183
53183
|
mode,
|
|
53184
53184
|
doc: doc2
|
|
53185
53185
|
} = commands.pop();
|
|
@@ -53199,7 +53199,7 @@ function printDocToString(doc, options) {
|
|
|
53199
53199
|
case DOC_TYPE_ARRAY:
|
|
53200
53200
|
for (let index = doc2.length - 1;index >= 0; index--) {
|
|
53201
53201
|
commands.push({
|
|
53202
|
-
indent:
|
|
53202
|
+
indent: indent22,
|
|
53203
53203
|
mode,
|
|
53204
53204
|
doc: doc2[index]
|
|
53205
53205
|
});
|
|
@@ -53213,14 +53213,14 @@ function printDocToString(doc, options) {
|
|
|
53213
53213
|
break;
|
|
53214
53214
|
case DOC_TYPE_INDENT:
|
|
53215
53215
|
commands.push({
|
|
53216
|
-
indent: makeIndent(
|
|
53216
|
+
indent: makeIndent(indent22, options),
|
|
53217
53217
|
mode,
|
|
53218
53218
|
doc: doc2.contents
|
|
53219
53219
|
});
|
|
53220
53220
|
break;
|
|
53221
53221
|
case DOC_TYPE_ALIGN:
|
|
53222
53222
|
commands.push({
|
|
53223
|
-
indent: makeAlign(
|
|
53223
|
+
indent: makeAlign(indent22, doc2.n, options),
|
|
53224
53224
|
mode,
|
|
53225
53225
|
doc: doc2.contents
|
|
53226
53226
|
});
|
|
@@ -53233,7 +53233,7 @@ function printDocToString(doc, options) {
|
|
|
53233
53233
|
case MODE_FLAT:
|
|
53234
53234
|
if (!shouldRemeasure) {
|
|
53235
53235
|
commands.push({
|
|
53236
|
-
indent:
|
|
53236
|
+
indent: indent22,
|
|
53237
53237
|
mode: doc2.break ? MODE_BREAK : MODE_FLAT,
|
|
53238
53238
|
doc: doc2.contents
|
|
53239
53239
|
});
|
|
@@ -53242,7 +53242,7 @@ function printDocToString(doc, options) {
|
|
|
53242
53242
|
case MODE_BREAK: {
|
|
53243
53243
|
shouldRemeasure = false;
|
|
53244
53244
|
const next = {
|
|
53245
|
-
indent:
|
|
53245
|
+
indent: indent22,
|
|
53246
53246
|
mode: MODE_FLAT,
|
|
53247
53247
|
doc: doc2.contents
|
|
53248
53248
|
};
|
|
@@ -53255,7 +53255,7 @@ function printDocToString(doc, options) {
|
|
|
53255
53255
|
const mostExpanded = method_at_default(0, doc2.expandedStates, -1);
|
|
53256
53256
|
if (doc2.break) {
|
|
53257
53257
|
commands.push({
|
|
53258
|
-
indent:
|
|
53258
|
+
indent: indent22,
|
|
53259
53259
|
mode: MODE_BREAK,
|
|
53260
53260
|
doc: mostExpanded
|
|
53261
53261
|
});
|
|
@@ -53264,7 +53264,7 @@ function printDocToString(doc, options) {
|
|
|
53264
53264
|
for (let index = 1;index < doc2.expandedStates.length + 1; index++) {
|
|
53265
53265
|
if (index >= doc2.expandedStates.length) {
|
|
53266
53266
|
commands.push({
|
|
53267
|
-
indent:
|
|
53267
|
+
indent: indent22,
|
|
53268
53268
|
mode: MODE_BREAK,
|
|
53269
53269
|
doc: mostExpanded
|
|
53270
53270
|
});
|
|
@@ -53272,7 +53272,7 @@ function printDocToString(doc, options) {
|
|
|
53272
53272
|
} else {
|
|
53273
53273
|
const state = doc2.expandedStates[index];
|
|
53274
53274
|
const cmd = {
|
|
53275
|
-
indent:
|
|
53275
|
+
indent: indent22,
|
|
53276
53276
|
mode: MODE_FLAT,
|
|
53277
53277
|
doc: state
|
|
53278
53278
|
};
|
|
@@ -53285,7 +53285,7 @@ function printDocToString(doc, options) {
|
|
|
53285
53285
|
}
|
|
53286
53286
|
} else {
|
|
53287
53287
|
commands.push({
|
|
53288
|
-
indent:
|
|
53288
|
+
indent: indent22,
|
|
53289
53289
|
mode: MODE_BREAK,
|
|
53290
53290
|
doc: doc2.contents
|
|
53291
53291
|
});
|
|
@@ -53311,12 +53311,12 @@ function printDocToString(doc, options) {
|
|
|
53311
53311
|
const content = parts[offset + 0];
|
|
53312
53312
|
const whitespace = parts[offset + 1];
|
|
53313
53313
|
const contentFlatCommand = {
|
|
53314
|
-
indent:
|
|
53314
|
+
indent: indent22,
|
|
53315
53315
|
mode: MODE_FLAT,
|
|
53316
53316
|
doc: content
|
|
53317
53317
|
};
|
|
53318
53318
|
const contentBreakCommand = {
|
|
53319
|
-
indent:
|
|
53319
|
+
indent: indent22,
|
|
53320
53320
|
mode: MODE_BREAK,
|
|
53321
53321
|
doc: content
|
|
53322
53322
|
};
|
|
@@ -53330,12 +53330,12 @@ function printDocToString(doc, options) {
|
|
|
53330
53330
|
break;
|
|
53331
53331
|
}
|
|
53332
53332
|
const whitespaceFlatCommand = {
|
|
53333
|
-
indent:
|
|
53333
|
+
indent: indent22,
|
|
53334
53334
|
mode: MODE_FLAT,
|
|
53335
53335
|
doc: whitespace
|
|
53336
53336
|
};
|
|
53337
53337
|
const whitespaceBreakCommand = {
|
|
53338
|
-
indent:
|
|
53338
|
+
indent: indent22,
|
|
53339
53339
|
mode: MODE_BREAK,
|
|
53340
53340
|
doc: whitespace
|
|
53341
53341
|
};
|
|
@@ -53349,7 +53349,7 @@ function printDocToString(doc, options) {
|
|
|
53349
53349
|
}
|
|
53350
53350
|
const secondContent = parts[offset + 2];
|
|
53351
53351
|
const remainingCommand = {
|
|
53352
|
-
indent:
|
|
53352
|
+
indent: indent22,
|
|
53353
53353
|
mode,
|
|
53354
53354
|
doc: {
|
|
53355
53355
|
...doc2,
|
|
@@ -53357,7 +53357,7 @@ function printDocToString(doc, options) {
|
|
|
53357
53357
|
}
|
|
53358
53358
|
};
|
|
53359
53359
|
const firstAndSecondContentFlatCommand = {
|
|
53360
|
-
indent:
|
|
53360
|
+
indent: indent22,
|
|
53361
53361
|
mode: MODE_FLAT,
|
|
53362
53362
|
doc: [content, whitespace, secondContent]
|
|
53363
53363
|
};
|
|
@@ -53376,20 +53376,20 @@ function printDocToString(doc, options) {
|
|
|
53376
53376
|
case DOC_TYPE_INDENT_IF_BREAK: {
|
|
53377
53377
|
const groupMode = doc2.groupId ? groupModeMap[doc2.groupId] : mode;
|
|
53378
53378
|
if (groupMode === MODE_BREAK) {
|
|
53379
|
-
const breakContents = doc2.type === DOC_TYPE_IF_BREAK ? doc2.breakContents : doc2.negate ? doc2.contents :
|
|
53379
|
+
const breakContents = doc2.type === DOC_TYPE_IF_BREAK ? doc2.breakContents : doc2.negate ? doc2.contents : indent2(doc2.contents);
|
|
53380
53380
|
if (breakContents) {
|
|
53381
53381
|
commands.push({
|
|
53382
|
-
indent:
|
|
53382
|
+
indent: indent22,
|
|
53383
53383
|
mode,
|
|
53384
53384
|
doc: breakContents
|
|
53385
53385
|
});
|
|
53386
53386
|
}
|
|
53387
53387
|
}
|
|
53388
53388
|
if (groupMode === MODE_FLAT) {
|
|
53389
|
-
const flatContents = doc2.type === DOC_TYPE_IF_BREAK ? doc2.flatContents : doc2.negate ?
|
|
53389
|
+
const flatContents = doc2.type === DOC_TYPE_IF_BREAK ? doc2.flatContents : doc2.negate ? indent2(doc2.contents) : doc2.contents;
|
|
53390
53390
|
if (flatContents) {
|
|
53391
53391
|
commands.push({
|
|
53392
|
-
indent:
|
|
53392
|
+
indent: indent22,
|
|
53393
53393
|
mode,
|
|
53394
53394
|
doc: flatContents
|
|
53395
53395
|
});
|
|
@@ -53399,7 +53399,7 @@ function printDocToString(doc, options) {
|
|
|
53399
53399
|
}
|
|
53400
53400
|
case DOC_TYPE_LINE_SUFFIX:
|
|
53401
53401
|
lineSuffix2.push({
|
|
53402
|
-
indent:
|
|
53402
|
+
indent: indent22,
|
|
53403
53403
|
mode,
|
|
53404
53404
|
doc: doc2.contents
|
|
53405
53405
|
});
|
|
@@ -53407,7 +53407,7 @@ function printDocToString(doc, options) {
|
|
|
53407
53407
|
case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
|
|
53408
53408
|
if (lineSuffix2.length > 0) {
|
|
53409
53409
|
commands.push({
|
|
53410
|
-
indent:
|
|
53410
|
+
indent: indent22,
|
|
53411
53411
|
mode,
|
|
53412
53412
|
doc: hardlineWithoutBreakParent
|
|
53413
53413
|
});
|
|
@@ -53428,7 +53428,7 @@ function printDocToString(doc, options) {
|
|
|
53428
53428
|
case MODE_BREAK:
|
|
53429
53429
|
if (lineSuffix2.length > 0) {
|
|
53430
53430
|
commands.push({
|
|
53431
|
-
indent:
|
|
53431
|
+
indent: indent22,
|
|
53432
53432
|
mode,
|
|
53433
53433
|
doc: doc2
|
|
53434
53434
|
}, ...lineSuffix2.reverse());
|
|
@@ -53438,23 +53438,23 @@ function printDocToString(doc, options) {
|
|
|
53438
53438
|
if (doc2.literal) {
|
|
53439
53439
|
output += newLine;
|
|
53440
53440
|
position = 0;
|
|
53441
|
-
if (
|
|
53442
|
-
if (
|
|
53443
|
-
output +=
|
|
53441
|
+
if (indent22.root) {
|
|
53442
|
+
if (indent22.root.value) {
|
|
53443
|
+
output += indent22.root.value;
|
|
53444
53444
|
}
|
|
53445
|
-
position =
|
|
53445
|
+
position = indent22.root.length;
|
|
53446
53446
|
}
|
|
53447
53447
|
} else {
|
|
53448
53448
|
trim2();
|
|
53449
|
-
output += newLine +
|
|
53450
|
-
position =
|
|
53449
|
+
output += newLine + indent22.value;
|
|
53450
|
+
position = indent22.length;
|
|
53451
53451
|
}
|
|
53452
53452
|
break;
|
|
53453
53453
|
}
|
|
53454
53454
|
break;
|
|
53455
53455
|
case DOC_TYPE_LABEL:
|
|
53456
53456
|
commands.push({
|
|
53457
|
-
indent:
|
|
53457
|
+
indent: indent22,
|
|
53458
53458
|
mode,
|
|
53459
53459
|
doc: doc2.contents
|
|
53460
53460
|
});
|
|
@@ -53616,7 +53616,7 @@ var init_doc = __esm(() => {
|
|
|
53616
53616
|
breakParent,
|
|
53617
53617
|
ifBreak,
|
|
53618
53618
|
trim: trim2,
|
|
53619
|
-
indent,
|
|
53619
|
+
indent: indent2,
|
|
53620
53620
|
indentIfBreak,
|
|
53621
53621
|
align,
|
|
53622
53622
|
addAlignmentToDoc,
|
|
@@ -140754,7 +140754,7 @@ import { pathToFileURL as pathToFileURL5 } from "url";
|
|
|
140754
140754
|
import path122 from "path";
|
|
140755
140755
|
import path142 from "path";
|
|
140756
140756
|
import url22 from "url";
|
|
140757
|
-
function
|
|
140757
|
+
function diffLines2(oldStr, newStr, options8) {
|
|
140758
140758
|
return lineDiff.diff(oldStr, newStr, options8);
|
|
140759
140759
|
}
|
|
140760
140760
|
function tokenize4(value, options8) {
|
|
@@ -140796,10 +140796,10 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
|
|
|
140796
140796
|
throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");
|
|
140797
140797
|
}
|
|
140798
140798
|
if (!optionsObj.callback) {
|
|
140799
|
-
return diffLinesResultToPatch(
|
|
140799
|
+
return diffLinesResultToPatch(diffLines2(oldStr, newStr, optionsObj));
|
|
140800
140800
|
} else {
|
|
140801
140801
|
const { callback } = optionsObj;
|
|
140802
|
-
|
|
140802
|
+
diffLines2(oldStr, newStr, Object.assign(Object.assign({}, optionsObj), { callback: (diff) => {
|
|
140803
140803
|
const patch = diffLinesResultToPatch(diff);
|
|
140804
140804
|
callback(patch);
|
|
140805
140805
|
} }));
|
|
@@ -146441,7 +146441,7 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
146441
146441
|
}
|
|
146442
146442
|
}
|
|
146443
146443
|
}, ast_path_default, is_object_default, skipWhitespace, skipSpaces, skipToLineEnd, skipEverythingButNewLine, isNewlineCharacter = (character) => character === `
|
|
146444
|
-
` || 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,
|
|
146444
|
+
` || 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, indent3, join32, 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) => {
|
|
146445
146445
|
try {
|
|
146446
146446
|
return path112.basename(toPath4(file));
|
|
146447
146447
|
} catch {
|
|
@@ -156469,7 +156469,7 @@ ${codeblock}`, options8);
|
|
|
156469
156469
|
({
|
|
156470
156470
|
breakParent: breakParent2,
|
|
156471
156471
|
hardline: hardline2,
|
|
156472
|
-
indent:
|
|
156472
|
+
indent: indent3,
|
|
156473
156473
|
join: join32,
|
|
156474
156474
|
line: line22,
|
|
156475
156475
|
lineSuffix: lineSuffix2
|
|
@@ -270015,6 +270015,10 @@ var TOOL_ALIASES = {
|
|
|
270015
270015
|
read_repo_file: "read",
|
|
270016
270016
|
write_repo_file: "write",
|
|
270017
270017
|
edit_repo_file: "edit",
|
|
270018
|
+
read_file: "read",
|
|
270019
|
+
write_file: "write",
|
|
270020
|
+
find_replace: "edit",
|
|
270021
|
+
delete_file: "delete",
|
|
270018
270022
|
set_secrets: "secrets",
|
|
270019
270023
|
generate_development_secrets: "secrets",
|
|
270020
270024
|
create_pull_request: "pr",
|
|
@@ -270028,7 +270032,55 @@ var TOOL_ALIASES = {
|
|
|
270028
270032
|
preview_screenshot: "screenshot",
|
|
270029
270033
|
connect_github_account: "github"
|
|
270030
270034
|
};
|
|
270031
|
-
var QUIET_OK_RESULTS = new Set(["read", "write", "edit", "reload"]);
|
|
270035
|
+
var QUIET_OK_RESULTS = new Set(["read", "write", "edit", "reload", "delete"]);
|
|
270036
|
+
var RESULT_LINE_MAX = 110;
|
|
270037
|
+
var DIFF_LINES_MAX = 12;
|
|
270038
|
+
var ERROR_LINES_MAX = 8;
|
|
270039
|
+
function renderEntry(entry, options = {}) {
|
|
270040
|
+
if (typeof entry === "string")
|
|
270041
|
+
return entry;
|
|
270042
|
+
if ("running" in entry)
|
|
270043
|
+
return runningLine(entry.running, entry.startedAt);
|
|
270044
|
+
return eventLine(entry.event, entry.elapsedMs, options) ?? "";
|
|
270045
|
+
}
|
|
270046
|
+
var RUNNING_DOT = "#E86B3C";
|
|
270047
|
+
var PULSE_MS = 500;
|
|
270048
|
+
function runningLine(event, startedAt, now = Date.now()) {
|
|
270049
|
+
const lit = Math.floor(now / PULSE_MS) % 2 === 0;
|
|
270050
|
+
const dot = lit ? source_default.hex(RUNNING_DOT)("●") : source_default.dim("●");
|
|
270051
|
+
const alias = toolAlias(event.name);
|
|
270052
|
+
const title = source_default.bold(event.label || alias);
|
|
270053
|
+
const inline = !event.label && event.summary ? ` ${source_default.dim(event.summary)}` : "";
|
|
270054
|
+
const seconds = Math.round((now - startedAt) / 1000);
|
|
270055
|
+
const took = seconds >= 3 ? ` ${source_default.dim(`· ${seconds}s`)}` : "";
|
|
270056
|
+
const detail = event.label && event.summary ? `
|
|
270057
|
+
${source_default.dim(`└ ${alias}: ${event.summary}`)}` : "";
|
|
270058
|
+
return `${dot} ${title}${inline}${took}${detail}`;
|
|
270059
|
+
}
|
|
270060
|
+
function fold2(lines, max, options) {
|
|
270061
|
+
if (options.verbose || lines.length <= max)
|
|
270062
|
+
return lines;
|
|
270063
|
+
const hint = options.foldHint ? ` (${options.foldHint})` : "";
|
|
270064
|
+
return [
|
|
270065
|
+
...lines.slice(0, max),
|
|
270066
|
+
source_default.dim(`… +${lines.length - max} lines${hint}`)
|
|
270067
|
+
];
|
|
270068
|
+
}
|
|
270069
|
+
var str = (v) => typeof v === "string" ? v : undefined;
|
|
270070
|
+
function diffLines(args) {
|
|
270071
|
+
const find = str(args.find);
|
|
270072
|
+
const replace = str(args.replace);
|
|
270073
|
+
if (find == null && replace == null)
|
|
270074
|
+
return null;
|
|
270075
|
+
return [
|
|
270076
|
+
...(find ?? "").split(`
|
|
270077
|
+
`).map((l) => source_default.red(`- ${l}`)),
|
|
270078
|
+
...(replace ?? "").split(`
|
|
270079
|
+
`).map((l) => source_default.green(`+ ${l}`))
|
|
270080
|
+
];
|
|
270081
|
+
}
|
|
270082
|
+
var indent = (lines) => lines.map((l) => ` ${l}`).join(`
|
|
270083
|
+
`);
|
|
270032
270084
|
function toolAlias(name) {
|
|
270033
270085
|
return TOOL_ALIASES[name] ?? name;
|
|
270034
270086
|
}
|
|
@@ -270093,7 +270145,7 @@ function formatDuration2(ms) {
|
|
|
270093
270145
|
return `${seconds}s`;
|
|
270094
270146
|
return `${Math.floor(seconds / 60)}m ${String(seconds % 60).padStart(2, "0")}s`;
|
|
270095
270147
|
}
|
|
270096
|
-
function eventLine(event, elapsedMs) {
|
|
270148
|
+
function eventLine(event, elapsedMs, options = {}) {
|
|
270097
270149
|
switch (event.kind) {
|
|
270098
270150
|
case "thinking":
|
|
270099
270151
|
return source_default.dim(`✻ ${event.text}`);
|
|
@@ -270114,12 +270166,40 @@ function eventLine(event, elapsedMs) {
|
|
|
270114
270166
|
const paramsLine = event.label && event.summary ? `
|
|
270115
270167
|
${source_default.dim(`${alias}: ${event.summary}`)}` : "";
|
|
270116
270168
|
const head = `${mark} ${title}${inlineDetail}${took}${paramsLine}`;
|
|
270169
|
+
const args = event.args ?? null;
|
|
270170
|
+
if (event.ok && alias === "edit" && args) {
|
|
270171
|
+
const diff = diffLines(args);
|
|
270172
|
+
if (diff)
|
|
270173
|
+
return `${head}
|
|
270174
|
+
${indent(fold2(diff, DIFF_LINES_MAX, options))}`;
|
|
270175
|
+
}
|
|
270176
|
+
if (event.ok && alias === "write" && args && str(args.content) != null) {
|
|
270177
|
+
const lines = str(args.content).split(`
|
|
270178
|
+
`);
|
|
270179
|
+
const count = source_default.dim(`+${lines.length} lines`);
|
|
270180
|
+
if (!options.verbose)
|
|
270181
|
+
return `${head} ${count}`;
|
|
270182
|
+
return `${head} ${count}
|
|
270183
|
+
${indent(lines.map((l) => source_default.dim(l)))}`;
|
|
270184
|
+
}
|
|
270117
270185
|
if (event.ok && (QUIET_OK_RESULTS.has(alias) || !event.result)) {
|
|
270118
270186
|
return head;
|
|
270119
270187
|
}
|
|
270120
|
-
const
|
|
270121
|
-
|
|
270122
|
-
|
|
270188
|
+
const paint = event.ok ? source_default.dim : source_default.red;
|
|
270189
|
+
const lines = event.result.split(`
|
|
270190
|
+
`).map((l) => l.trimEnd()).filter((l, i, all) => l.length > 0 || i > 0 && i < all.length - 1);
|
|
270191
|
+
if (event.ok && !options.verbose) {
|
|
270192
|
+
const first = lines[0] ?? "";
|
|
270193
|
+
const cut = first.length > RESULT_LINE_MAX ? `${first.slice(0, RESULT_LINE_MAX)}…` : first;
|
|
270194
|
+
const more = lines.length - 1;
|
|
270195
|
+
const hint = options.foldHint ? ` (${options.foldHint})` : "";
|
|
270196
|
+
const tail = more > 0 ? source_default.dim(` … +${more} lines${hint}`) : "";
|
|
270197
|
+
return `${head}
|
|
270198
|
+
${paint(linkifyUrls(cut))}${tail}`;
|
|
270199
|
+
}
|
|
270200
|
+
const shown = fold2(lines.map((l) => paint(linkifyUrls(l))), event.ok ? Number.POSITIVE_INFINITY : ERROR_LINES_MAX, options);
|
|
270201
|
+
return `${head}
|
|
270202
|
+
${indent(shown)}`;
|
|
270123
270203
|
}
|
|
270124
270204
|
}
|
|
270125
270205
|
}
|
|
@@ -270225,7 +270305,10 @@ function createTurnStream(interactive, write = (text) => process.stdout.write(te
|
|
|
270225
270305
|
elapsedMs = Date.now() - started;
|
|
270226
270306
|
running.delete(event.id);
|
|
270227
270307
|
}
|
|
270228
|
-
const line = eventLine(event, elapsedMs
|
|
270308
|
+
const line = eventLine(event, elapsedMs, {
|
|
270309
|
+
verbose: options.verbose,
|
|
270310
|
+
foldHint: "--verbose shows everything"
|
|
270311
|
+
});
|
|
270229
270312
|
if (line == null)
|
|
270230
270313
|
return;
|
|
270231
270314
|
if (interactive) {
|
|
@@ -270547,12 +270630,27 @@ function newStreamState() {
|
|
|
270547
270630
|
return { perMessage: new Map };
|
|
270548
270631
|
}
|
|
270549
270632
|
var TOOL_SETTLED = new Set(["success", "error", "stopped"]);
|
|
270633
|
+
function fullText(value) {
|
|
270634
|
+
if (typeof value === "string")
|
|
270635
|
+
return value.trimEnd();
|
|
270636
|
+
if (value == null)
|
|
270637
|
+
return "";
|
|
270638
|
+
return JSON.stringify(value);
|
|
270639
|
+
}
|
|
270640
|
+
function toolArgs(argumentsString) {
|
|
270641
|
+
try {
|
|
270642
|
+
const parsed = JSON.parse(argumentsString ?? "");
|
|
270643
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
270644
|
+
} catch {
|
|
270645
|
+
return null;
|
|
270646
|
+
}
|
|
270647
|
+
}
|
|
270550
270648
|
function oneLine(value, max) {
|
|
270551
270649
|
const text = typeof value === "string" ? value : value == null ? "" : JSON.stringify(value);
|
|
270552
270650
|
const flat = text.replace(/\s+/g, " ").trim();
|
|
270553
270651
|
return flat.length > max ? `${flat.slice(0, max)}…` : flat;
|
|
270554
270652
|
}
|
|
270555
|
-
var SALIENT_KEYS = ["command", "path", "file_path", "title"];
|
|
270653
|
+
var SALIENT_KEYS = ["command", "path", "file_path", "title", "find"];
|
|
270556
270654
|
function salvageKey(raw, keys) {
|
|
270557
270655
|
for (const key of keys) {
|
|
270558
270656
|
const match = raw.match(new RegExp(`"${key}"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)"`));
|
|
@@ -270581,6 +270679,10 @@ function toolMeta(name, argumentsString) {
|
|
|
270581
270679
|
read_repo_file: pick("path") ?? pick("file_path"),
|
|
270582
270680
|
write_repo_file: pick("path") ?? pick("file_path"),
|
|
270583
270681
|
edit_repo_file: pick("path") ?? pick("file_path"),
|
|
270682
|
+
read_file: pick("file_path") ?? pick("path"),
|
|
270683
|
+
write_file: pick("file_path") ?? pick("path"),
|
|
270684
|
+
find_replace: pick("file_path") ?? pick("path"),
|
|
270685
|
+
delete_file: pick("file_path") ?? pick("path"),
|
|
270584
270686
|
create_pull_request: pick("title"),
|
|
270585
270687
|
reload_preview: ""
|
|
270586
270688
|
};
|
|
@@ -270631,7 +270733,10 @@ function diffConversation(state, messages) {
|
|
|
270631
270733
|
}
|
|
270632
270734
|
for (const tool of message.tool_calls ?? []) {
|
|
270633
270735
|
if (!progress.announcedTools.has(tool.id)) {
|
|
270634
|
-
progress.announcedTools.set(tool.id,
|
|
270736
|
+
progress.announcedTools.set(tool.id, {
|
|
270737
|
+
...toolMeta(tool.name, tool.arguments_string),
|
|
270738
|
+
args: toolArgs(tool.arguments_string)
|
|
270739
|
+
});
|
|
270635
270740
|
const meta = progress.announcedTools.get(tool.id);
|
|
270636
270741
|
events.push({
|
|
270637
270742
|
kind: "tool_start",
|
|
@@ -270662,7 +270767,8 @@ function diffConversation(state, messages) {
|
|
|
270662
270767
|
label: labelTense(meta.label, "done"),
|
|
270663
270768
|
summary: meta.summary,
|
|
270664
270769
|
ok: status === "success",
|
|
270665
|
-
result:
|
|
270770
|
+
result: fullText(tool.results),
|
|
270771
|
+
args: meta.args
|
|
270666
270772
|
});
|
|
270667
270773
|
}
|
|
270668
270774
|
}
|
|
@@ -270736,6 +270842,81 @@ async function streamConversationUntilSettled(onEvent, options = {}) {
|
|
|
270736
270842
|
return "timeout";
|
|
270737
270843
|
}
|
|
270738
270844
|
|
|
270845
|
+
// src/cli/commands/builder/send.ts
|
|
270846
|
+
function lastAssistantReply(turn) {
|
|
270847
|
+
const messages = turn.conversation?.messages ?? [];
|
|
270848
|
+
for (let i = messages.length - 1;i >= 0; i--) {
|
|
270849
|
+
const { role, content } = messages[i];
|
|
270850
|
+
if (role === "assistant" && typeof content === "string" && content.trim()) {
|
|
270851
|
+
return content.trim();
|
|
270852
|
+
}
|
|
270853
|
+
}
|
|
270854
|
+
return;
|
|
270855
|
+
}
|
|
270856
|
+
function ndjsonWriter() {
|
|
270857
|
+
return (record) => process.stdout.write(`${JSON.stringify(record)}
|
|
270858
|
+
`);
|
|
270859
|
+
}
|
|
270860
|
+
async function sendAction(ctx, message, options) {
|
|
270861
|
+
if (options.streamJson && ctx.jsonMode) {
|
|
270862
|
+
throw new InvalidInputError("--stream-json and --json are exclusive.");
|
|
270863
|
+
}
|
|
270864
|
+
if (ctx.app)
|
|
270865
|
+
await assertBuilderApp(ctx.app.id);
|
|
270866
|
+
const branchId = await resolveBranchId(ctx);
|
|
270867
|
+
if (options.streamJson) {
|
|
270868
|
+
const write = ndjsonWriter();
|
|
270869
|
+
const turn = await streamConversationDuring(() => sendTurn(message, branchId), ({ kind, ...event }) => write({ type: kind, ...event }), { branchId });
|
|
270870
|
+
write({
|
|
270871
|
+
type: "result",
|
|
270872
|
+
queued: turn.queued === true,
|
|
270873
|
+
status: turn.status?.state ?? "ready",
|
|
270874
|
+
error_source: turn.status?.error_source ?? null,
|
|
270875
|
+
reply: lastAssistantReply(turn) ?? null
|
|
270876
|
+
});
|
|
270877
|
+
return {};
|
|
270878
|
+
}
|
|
270879
|
+
if (ctx.jsonMode) {
|
|
270880
|
+
const turn = await ctx.runTask("Agent working (a turn can take minutes)", () => sendTurn(message, branchId));
|
|
270881
|
+
if (turn.queued)
|
|
270882
|
+
return { stdout: `${JSON.stringify({ queued: true })}
|
|
270883
|
+
` };
|
|
270884
|
+
return {
|
|
270885
|
+
stdout: `${JSON.stringify({
|
|
270886
|
+
status: turn.status?.state ?? "ready",
|
|
270887
|
+
error_source: turn.status?.error_source ?? null,
|
|
270888
|
+
reply: lastAssistantReply(turn) ?? null
|
|
270889
|
+
})}
|
|
270890
|
+
`
|
|
270891
|
+
};
|
|
270892
|
+
}
|
|
270893
|
+
const stream = createTurnStream(process.stdout.isTTY === true, undefined, {
|
|
270894
|
+
verbose: options.verbose
|
|
270895
|
+
});
|
|
270896
|
+
let turn;
|
|
270897
|
+
try {
|
|
270898
|
+
turn = await streamConversationDuring(() => sendTurn(message, branchId), stream.onEvent, { branchId });
|
|
270899
|
+
} finally {
|
|
270900
|
+
stream.stop();
|
|
270901
|
+
}
|
|
270902
|
+
if (turn.queued) {
|
|
270903
|
+
return {
|
|
270904
|
+
outroMessage: "The agent is busy with an earlier message — yours was queued and runs next."
|
|
270905
|
+
};
|
|
270906
|
+
}
|
|
270907
|
+
if (turn.status?.state === "error") {
|
|
270908
|
+
return {
|
|
270909
|
+
outroMessage: `Turn failed (${turn.status.error_source ?? "unknown"}) — see the editor for details.`
|
|
270910
|
+
};
|
|
270911
|
+
}
|
|
270912
|
+
return { outroMessage: "Turn finished." };
|
|
270913
|
+
}
|
|
270914
|
+
function getSendCommand() {
|
|
270915
|
+
const command = new Base44Command("send", { supportsBranch: true });
|
|
270916
|
+
command.description("Send the agent one message and stream the turn until it finishes").argument("<message>", "What you want the agent to do").option("--verbose", "Show every tool result in full (no folding)").option("--stream-json", "Emit each stream event as a JSON line as it happens, then a final result line").action(sendAction);
|
|
270917
|
+
return command;
|
|
270918
|
+
}
|
|
270919
|
+
|
|
270739
270920
|
// src/cli/commands/builder/new.ts
|
|
270740
270921
|
var POLL_TIMEOUT_MS = 20 * 60000;
|
|
270741
270922
|
var MODES = ["direct", "fork", "copy"];
|
|
@@ -270749,6 +270930,10 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
|
|
|
270749
270930
|
if (!prompt && !options.import) {
|
|
270750
270931
|
throw new InvalidInputError('Describe the app ("<prompt>") or pass --import <repo>.');
|
|
270751
270932
|
}
|
|
270933
|
+
if (options.streamJson && jsonMode) {
|
|
270934
|
+
throw new InvalidInputError("--stream-json and --json are exclusive.");
|
|
270935
|
+
}
|
|
270936
|
+
const ndjson = options.streamJson ? ndjsonWriter() : null;
|
|
270752
270937
|
let app;
|
|
270753
270938
|
try {
|
|
270754
270939
|
app = await runTask(options.import ? "Importing the repository" : "Creating your app", () => createAndLinkApp({
|
|
@@ -270765,7 +270950,16 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
|
|
|
270765
270950
|
log.message(line);
|
|
270766
270951
|
throw error;
|
|
270767
270952
|
}
|
|
270768
|
-
if (
|
|
270953
|
+
if (ndjson) {
|
|
270954
|
+
ndjson({
|
|
270955
|
+
type: "created",
|
|
270956
|
+
id: app.id,
|
|
270957
|
+
repo_url: app.repoUrl ?? null,
|
|
270958
|
+
editor_url: app.editorUrl,
|
|
270959
|
+
dir: app.dirName,
|
|
270960
|
+
path: app.targetDir
|
|
270961
|
+
});
|
|
270962
|
+
} else if (!jsonMode) {
|
|
270769
270963
|
if (app.repoUrl)
|
|
270770
270964
|
log.message(source_default.dim(`repo ${app.repoUrl}`));
|
|
270771
270965
|
log.message(source_default.dim(`editor ${app.editorUrl}`));
|
|
@@ -270778,10 +270972,16 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
|
|
|
270778
270972
|
const branchId = await resolveActiveBranchId().catch(() => {
|
|
270779
270973
|
return;
|
|
270780
270974
|
});
|
|
270781
|
-
const stream = createTurnStream(process.stdout.isTTY === true && !jsonMode, undefined, {
|
|
270975
|
+
const stream = createTurnStream(process.stdout.isTTY === true && !jsonMode && !ndjson, undefined, {
|
|
270976
|
+
idleLabel: "provisioning the sandbox and starting the build",
|
|
270977
|
+
verbose: options.verbose
|
|
270978
|
+
});
|
|
270782
270979
|
try {
|
|
270783
270980
|
const settled = await streamConversationUntilSettled((event) => {
|
|
270784
|
-
if (
|
|
270981
|
+
if (ndjson) {
|
|
270982
|
+
const { kind, ...rest } = event;
|
|
270983
|
+
ndjson({ type: kind, ...rest });
|
|
270984
|
+
} else if (!jsonMode)
|
|
270785
270985
|
stream.onEvent(event);
|
|
270786
270986
|
}, { branchId, timeoutMs: POLL_TIMEOUT_MS });
|
|
270787
270987
|
finalState = settled === "timeout" ? "processing" : (await getAppState(app.id)).status?.state ?? "ready";
|
|
@@ -270794,6 +270994,15 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
|
|
|
270794
270994
|
stream.stop();
|
|
270795
270995
|
}
|
|
270796
270996
|
}
|
|
270997
|
+
if (ndjson) {
|
|
270998
|
+
ndjson({
|
|
270999
|
+
type: "result",
|
|
271000
|
+
id: app.id,
|
|
271001
|
+
preview_url: previewUrl ?? null,
|
|
271002
|
+
status: finalState ?? "created"
|
|
271003
|
+
});
|
|
271004
|
+
return {};
|
|
271005
|
+
}
|
|
270797
271006
|
if (jsonMode) {
|
|
270798
271007
|
return {
|
|
270799
271008
|
stdout: `${JSON.stringify({
|
|
@@ -270828,61 +271037,7 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
|
|
|
270828
271037
|
}
|
|
270829
271038
|
function getNewCommand() {
|
|
270830
271039
|
const command = new Base44Command("new", { requireAppContext: false });
|
|
270831
|
-
command.description("Create an app and start building: from a prompt (the Base44 template), or over an existing GitHub repo with --import").argument("[prompt]", "What to build; the first agent turn starts immediately").option("--import <repo>", "Build over an existing GitHub repository instead of the template").option("--mode <mode>", "How to import: direct, fork, or copy (default: direct)").option("--name <name>", "Directory and app name (invented when omitted)").option("--path <dir>", "Directory to link (default: the current directory when empty, else ./<name>)").option("--repo-name <name>", "Name for the new GitHub repo when forking/copying").option("--from-branch <name>", "Import a specific branch of the repo").action(newAction);
|
|
270832
|
-
return command;
|
|
270833
|
-
}
|
|
270834
|
-
|
|
270835
|
-
// src/cli/commands/builder/send.ts
|
|
270836
|
-
function lastAssistantReply(turn) {
|
|
270837
|
-
const messages = turn.conversation?.messages ?? [];
|
|
270838
|
-
for (let i = messages.length - 1;i >= 0; i--) {
|
|
270839
|
-
const { role, content } = messages[i];
|
|
270840
|
-
if (role === "assistant" && typeof content === "string" && content.trim()) {
|
|
270841
|
-
return content.trim();
|
|
270842
|
-
}
|
|
270843
|
-
}
|
|
270844
|
-
return;
|
|
270845
|
-
}
|
|
270846
|
-
async function sendAction(ctx, message) {
|
|
270847
|
-
if (ctx.app)
|
|
270848
|
-
await assertBuilderApp(ctx.app.id);
|
|
270849
|
-
const branchId = await resolveBranchId(ctx);
|
|
270850
|
-
if (ctx.jsonMode) {
|
|
270851
|
-
const turn = await ctx.runTask("Agent working (a turn can take minutes)", () => sendTurn(message, branchId));
|
|
270852
|
-
if (turn.queued)
|
|
270853
|
-
return { stdout: `${JSON.stringify({ queued: true })}
|
|
270854
|
-
` };
|
|
270855
|
-
return {
|
|
270856
|
-
stdout: `${JSON.stringify({
|
|
270857
|
-
status: turn.status?.state ?? "ready",
|
|
270858
|
-
error_source: turn.status?.error_source ?? null,
|
|
270859
|
-
reply: lastAssistantReply(turn) ?? null
|
|
270860
|
-
})}
|
|
270861
|
-
`
|
|
270862
|
-
};
|
|
270863
|
-
}
|
|
270864
|
-
const stream = createTurnStream(process.stdout.isTTY === true);
|
|
270865
|
-
let turn;
|
|
270866
|
-
try {
|
|
270867
|
-
turn = await streamConversationDuring(() => sendTurn(message, branchId), stream.onEvent, { branchId });
|
|
270868
|
-
} finally {
|
|
270869
|
-
stream.stop();
|
|
270870
|
-
}
|
|
270871
|
-
if (turn.queued) {
|
|
270872
|
-
return {
|
|
270873
|
-
outroMessage: "The agent is busy with an earlier message — yours was queued and runs next."
|
|
270874
|
-
};
|
|
270875
|
-
}
|
|
270876
|
-
if (turn.status?.state === "error") {
|
|
270877
|
-
return {
|
|
270878
|
-
outroMessage: `Turn failed (${turn.status.error_source ?? "unknown"}) — see the editor for details.`
|
|
270879
|
-
};
|
|
270880
|
-
}
|
|
270881
|
-
return { outroMessage: "Turn finished." };
|
|
270882
|
-
}
|
|
270883
|
-
function getSendCommand() {
|
|
270884
|
-
const command = new Base44Command("send", { supportsBranch: true });
|
|
270885
|
-
command.description("Send the agent one message and stream the turn until it finishes").argument("<message>", "What you want the agent to do").action(sendAction);
|
|
271040
|
+
command.description("Create an app and start building: from a prompt (the Base44 template), or over an existing GitHub repo with --import").argument("[prompt]", "What to build; the first agent turn starts immediately").option("--import <repo>", "Build over an existing GitHub repository instead of the template").option("--mode <mode>", "How to import: direct, fork, or copy (default: direct)").option("--name <name>", "Directory and app name (invented when omitted)").option("--path <dir>", "Directory to link (default: the current directory when empty, else ./<name>)").option("--repo-name <name>", "Name for the new GitHub repo when forking/copying").option("--from-branch <name>", "Import a specific branch of the repo").option("--verbose", "Show every tool result in full (no folding)").option("--stream-json", "Emit each stream event as a JSON line as it happens, then a final result line").action(newAction);
|
|
270886
271041
|
return command;
|
|
270887
271042
|
}
|
|
270888
271043
|
|
|
@@ -276139,22 +276294,27 @@ function createSessionEngine(options) {
|
|
|
276139
276294
|
if (!prime) {
|
|
276140
276295
|
for (const event of events) {
|
|
276141
276296
|
if (event.kind === "tool_start") {
|
|
276297
|
+
const startedAt = Date.now();
|
|
276142
276298
|
running.set(event.id, {
|
|
276143
276299
|
alias: toolAlias(event.name),
|
|
276144
276300
|
label: event.label,
|
|
276145
276301
|
summary: event.summary,
|
|
276146
|
-
startedAt
|
|
276302
|
+
startedAt
|
|
276147
276303
|
});
|
|
276304
|
+
options.onLine({ running: event, startedAt });
|
|
276148
276305
|
continue;
|
|
276149
276306
|
}
|
|
276150
|
-
let elapsedMs;
|
|
276151
276307
|
if (event.kind === "tool_end") {
|
|
276152
276308
|
const started = running.get(event.id)?.startedAt;
|
|
276153
|
-
if (started != null)
|
|
276154
|
-
elapsedMs = Date.now() - started;
|
|
276155
276309
|
running.delete(event.id);
|
|
276310
|
+
lastEventAt = Date.now();
|
|
276311
|
+
options.onLine({
|
|
276312
|
+
event,
|
|
276313
|
+
elapsedMs: started != null ? Date.now() - started : undefined
|
|
276314
|
+
});
|
|
276315
|
+
continue;
|
|
276156
276316
|
}
|
|
276157
|
-
const line = eventLine(event
|
|
276317
|
+
const line = eventLine(event);
|
|
276158
276318
|
if (line != null) {
|
|
276159
276319
|
lastEventAt = Date.now();
|
|
276160
276320
|
options.onLine(line);
|
|
@@ -276275,6 +276435,17 @@ function exitAltScreen() {
|
|
|
276275
276435
|
altScreenActive = false;
|
|
276276
276436
|
process.stdout.write("\x1B[?1007l\x1B[?1049l");
|
|
276277
276437
|
}
|
|
276438
|
+
function withEntry(items, entry) {
|
|
276439
|
+
if (typeof entry !== "string" && "event" in entry) {
|
|
276440
|
+
const i = items.findIndex((e) => typeof e !== "string" && ("running" in e) && e.running.id === entry.event.id);
|
|
276441
|
+
if (i >= 0) {
|
|
276442
|
+
const next = [...items];
|
|
276443
|
+
next[i] = entry;
|
|
276444
|
+
return next;
|
|
276445
|
+
}
|
|
276446
|
+
}
|
|
276447
|
+
return [...items, entry];
|
|
276448
|
+
}
|
|
276278
276449
|
function statusText(status, musingSeed) {
|
|
276279
276450
|
const frame = FRAMES2[Math.floor(Date.now() / 120) % FRAMES2.length];
|
|
276280
276451
|
switch (status.phase) {
|
|
@@ -276282,13 +276453,6 @@ function statusText(status, musingSeed) {
|
|
|
276282
276453
|
return source_default.dim(`${frame} ${status.awaitingLabel} (${formatDuration2(Date.now() - status.awaitingSince)})`);
|
|
276283
276454
|
case "running": {
|
|
276284
276455
|
const turnFor = formatDuration2(Date.now() - (status.turnStartedAt ?? Date.now()));
|
|
276285
|
-
const tool = status.runningTool;
|
|
276286
|
-
if (tool) {
|
|
276287
|
-
const toolFor = Math.round((Date.now() - tool.startedAt) / 1000);
|
|
276288
|
-
const others = tool.others > 0 ? ` (+${tool.others})` : "";
|
|
276289
|
-
const what = tool.label || `${tool.alias}${tool.summary ? ` ${tool.summary}` : ""}`;
|
|
276290
|
-
return source_default.dim(`${frame} ${what}${others} · ${toolFor}s (turn ${turnFor})`);
|
|
276291
|
-
}
|
|
276292
276456
|
const quiet = status.quietForMs > 60000 ? " · a long private step — details render in the editor" : "";
|
|
276293
276457
|
return `${source_default.magenta("✻")} ${source_default.dim(`${idleMusing(musingSeed)} (${turnFor})${quiet}`)}`;
|
|
276294
276458
|
}
|
|
@@ -276304,6 +276468,7 @@ function statusText(status, musingSeed) {
|
|
|
276304
276468
|
function SessionView({ engine, footer, subscribe }) {
|
|
276305
276469
|
const { exit } = use_app_default();
|
|
276306
276470
|
const [items, setItems] = import_react23.useState([]);
|
|
276471
|
+
const [verbose, setVerbose] = import_react23.useState(false);
|
|
276307
276472
|
const [input, setInput] = import_react23.useState("");
|
|
276308
276473
|
const [scroll, setScroll] = import_react23.useState(0);
|
|
276309
276474
|
const [, tick] = import_react23.useReducer((x) => x + 1, 0);
|
|
@@ -276312,10 +276477,8 @@ function SessionView({ engine, footer, subscribe }) {
|
|
|
276312
276477
|
const [pickerIndex, setPickerIndex] = import_react23.useState(null);
|
|
276313
276478
|
const maxScrollRef = import_react23.useRef(0);
|
|
276314
276479
|
const meIdRef = import_react23.useRef(null);
|
|
276315
|
-
const emit = (
|
|
276316
|
-
|
|
276317
|
-
import_react23.useEffect(() => subscribe((line) => setItems((h) => [...h, `${line}
|
|
276318
|
-
`])), [subscribe]);
|
|
276480
|
+
const emit = (entry) => setItems((h) => withEntry(h, entry));
|
|
276481
|
+
import_react23.useEffect(() => subscribe((entry) => setItems((h) => withEntry(h, entry))), [subscribe]);
|
|
276319
276482
|
import_react23.useEffect(() => {
|
|
276320
276483
|
const timer = setInterval(tick, 120);
|
|
276321
276484
|
return () => clearInterval(timer);
|
|
@@ -276383,6 +276546,10 @@ function SessionView({ engine, footer, subscribe }) {
|
|
|
276383
276546
|
exit();
|
|
276384
276547
|
return;
|
|
276385
276548
|
}
|
|
276549
|
+
if (key.ctrl && char === "o") {
|
|
276550
|
+
setVerbose((v) => !v);
|
|
276551
|
+
return;
|
|
276552
|
+
}
|
|
276386
276553
|
if (key.upArrow) {
|
|
276387
276554
|
setScroll((s) => Math.min(s + 3, maxScrollRef.current));
|
|
276388
276555
|
return;
|
|
@@ -276408,14 +276575,15 @@ function SessionView({ engine, footer, subscribe }) {
|
|
|
276408
276575
|
});
|
|
276409
276576
|
const columns = process.stdout.columns || 80;
|
|
276410
276577
|
const rows = process.stdout.rows || 24;
|
|
276411
|
-
const width =
|
|
276578
|
+
const width = columns;
|
|
276412
276579
|
const innerWidth = Math.max(10, width - 4);
|
|
276413
276580
|
const inputRows = Math.max(1, Math.ceil((input.length + 3) / innerWidth));
|
|
276414
276581
|
const pickerOpen = pickerIndex !== null;
|
|
276415
276582
|
const inputBlockHeight = pickerOpen ? MODELS.length + 3 : inputRows + 2;
|
|
276416
276583
|
const widgetHeight = inputBlockHeight + 3 + (footer.length ? 1 : 0);
|
|
276417
276584
|
const viewHeight = Math.max(3, rows - widgetHeight - 1);
|
|
276418
|
-
const lines = items.flatMap((item) => hardWrapAnsi(item,
|
|
276585
|
+
const lines = items.flatMap((item) => hardWrapAnsi(`${renderEntry(item, { verbose, foldHint: "Ctrl+O to expand" })}
|
|
276586
|
+
`, columns));
|
|
276419
276587
|
const maxScroll = Math.max(0, lines.length - viewHeight);
|
|
276420
276588
|
maxScrollRef.current = maxScroll;
|
|
276421
276589
|
const clamped = Math.min(scroll, maxScroll);
|
|
@@ -276498,7 +276666,7 @@ function SessionView({ engine, footer, subscribe }) {
|
|
|
276498
276666
|
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
|
|
276499
276667
|
dimColor: true,
|
|
276500
276668
|
wrap: "truncate-end",
|
|
276501
|
-
children: pickerOpen ? " ↑↓ to move · Enter to select · Esc to cancel" : engine.turnRunning() ? " Esc to stop · type to queue · scroll to read · Ctrl+C to exit" : " Enter to send · /model to switch model · Esc for live · Ctrl+C to exit"
|
|
276669
|
+
children: pickerOpen ? " ↑↓ to move · Enter to select · Esc to cancel" : engine.turnRunning() ? " Esc to stop · type to queue · scroll to read · Ctrl+O to expand · Ctrl+C to exit" : " Enter to send · /model to switch model · Esc for live · Ctrl+O to expand · Ctrl+C to exit"
|
|
276502
276670
|
}, undefined, false, undefined, this)
|
|
276503
276671
|
]
|
|
276504
276672
|
}, undefined, true, undefined, this);
|
|
@@ -288467,4 +288635,4 @@ export {
|
|
|
288467
288635
|
runCLI
|
|
288468
288636
|
};
|
|
288469
288637
|
|
|
288470
|
-
//# debugId=
|
|
288638
|
+
//# debugId=DBD6D874F0F8D0A564756E2164756E21
|