omnius 1.0.92 → 1.0.94
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/index.js +531 -392
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -562893,13 +562893,6 @@ function fileLink(filePath) {
|
|
|
562893
562893
|
}
|
|
562894
562894
|
return filePath;
|
|
562895
562895
|
}
|
|
562896
|
-
function linkifyPaths(text) {
|
|
562897
|
-
if (!isTTY2) return text;
|
|
562898
|
-
return text.replace(/(\/[\w./\-@+]+)/g, (match) => {
|
|
562899
|
-
if (match.length < 3 || match.endsWith("/")) return match;
|
|
562900
|
-
return hyperlink(`file://${match}`, match);
|
|
562901
|
-
});
|
|
562902
|
-
}
|
|
562903
562896
|
function setEmojisEnabled(enabled2) {
|
|
562904
562897
|
_emojisEnabled = enabled2;
|
|
562905
562898
|
}
|
|
@@ -563025,131 +563018,391 @@ function renderTaskAborted() {
|
|
|
563025
563018
|
${c3.yellow("⚠")} ${c3.bold("Task aborted by user")}
|
|
563026
563019
|
`);
|
|
563027
563020
|
}
|
|
563028
|
-
function
|
|
563029
|
-
|
|
563030
|
-
const label = TOOL_LABELS[toolName] ?? toolName;
|
|
563031
|
-
const argsSummary = formatToolArgs(toolName, args, verbose);
|
|
563032
|
-
const colorFn = _colorsEnabled ? TOOL_COLORS[toolName] ?? c3.dim : (t2) => t2;
|
|
563033
|
-
const emojiPrefix = _emojisEnabled ? `${icon} ` : "";
|
|
563034
|
-
process.stdout.write(`
|
|
563035
|
-
${emojiPrefix}${colorFn(c3.bold(label))}${argsSummary ? c3.dim(": ") + argsSummary : ""}
|
|
563036
|
-
`);
|
|
563021
|
+
function normalizeToolOpts(arg) {
|
|
563022
|
+
return typeof arg === "boolean" ? { verbose: arg } : arg ?? {};
|
|
563037
563023
|
}
|
|
563038
|
-
function
|
|
563039
|
-
|
|
563040
|
-
process.stdout.write(` ${c3.dim(connector)}─ ${content}
|
|
563041
|
-
`);
|
|
563024
|
+
function toolColorCode(toolName) {
|
|
563025
|
+
return TOOL_COLOR_CODES[toolName] ?? tuiTextDim();
|
|
563042
563026
|
}
|
|
563043
|
-
function
|
|
563044
|
-
|
|
563045
|
-
|
|
563046
|
-
|
|
563047
|
-
|
|
563048
|
-
|
|
563049
|
-
|
|
563050
|
-
|
|
563051
|
-
|
|
563052
|
-
|
|
563053
|
-
|
|
563054
|
-
|
|
563055
|
-
|
|
563056
|
-
|
|
563057
|
-
|
|
563027
|
+
function toolColorSeq(code8, bold = false) {
|
|
563028
|
+
if (!_colorsEnabled || !isTTY2) return "";
|
|
563029
|
+
return `\x1B[${bold ? "1;" : ""}38;5;${code8}m`;
|
|
563030
|
+
}
|
|
563031
|
+
function toolResetSeq() {
|
|
563032
|
+
return _colorsEnabled && isTTY2 ? RESET2 : "";
|
|
563033
|
+
}
|
|
563034
|
+
function visibleLen(text) {
|
|
563035
|
+
return stripAnsi(text).length;
|
|
563036
|
+
}
|
|
563037
|
+
function truncateAnsiToWidth(text, width) {
|
|
563038
|
+
if (width <= 0) return "";
|
|
563039
|
+
if (visibleLen(text) <= width) return text;
|
|
563040
|
+
if (width === 1) return "…";
|
|
563041
|
+
const target = Math.max(0, width - 1);
|
|
563042
|
+
let out = "";
|
|
563043
|
+
let visible = 0;
|
|
563044
|
+
let hasAnsi = false;
|
|
563045
|
+
const tokenRe = /\x1B\[[0-?]*[ -/]*[@-~]|\x1B\][^\x07]*(?:\x07|\x1B\\)|./gs;
|
|
563046
|
+
for (const token of text.matchAll(tokenRe)) {
|
|
563047
|
+
const value2 = token[0];
|
|
563048
|
+
if (value2.startsWith("\x1B")) {
|
|
563049
|
+
hasAnsi = true;
|
|
563050
|
+
out += value2;
|
|
563051
|
+
continue;
|
|
563058
563052
|
}
|
|
563059
|
-
|
|
563060
|
-
|
|
563061
|
-
|
|
563062
|
-
|
|
563063
|
-
|
|
563064
|
-
|
|
563065
|
-
|
|
563066
|
-
|
|
563067
|
-
|
|
563068
|
-
|
|
563053
|
+
if (visible >= target) break;
|
|
563054
|
+
out += value2;
|
|
563055
|
+
visible += 1;
|
|
563056
|
+
}
|
|
563057
|
+
return `${out}…${hasAnsi ? RESET2 : ""}`;
|
|
563058
|
+
}
|
|
563059
|
+
function wrapToolTextLine(text, width) {
|
|
563060
|
+
if (width <= 0) return [text];
|
|
563061
|
+
if (text.length === 0) return [""];
|
|
563062
|
+
const out = [];
|
|
563063
|
+
const continuationIndent = hangingIndentForPlainLine(text, width);
|
|
563064
|
+
let remaining = text;
|
|
563065
|
+
while (remaining.length > width) {
|
|
563066
|
+
let breakAt = remaining.lastIndexOf(" ", width);
|
|
563067
|
+
if (breakAt <= continuationIndent.length) breakAt = width;
|
|
563068
|
+
out.push(remaining.slice(0, breakAt).trimEnd());
|
|
563069
|
+
remaining = continuationIndent + remaining.slice(breakAt).trimStart();
|
|
563070
|
+
}
|
|
563071
|
+
out.push(remaining);
|
|
563072
|
+
return out;
|
|
563073
|
+
}
|
|
563074
|
+
function buildToolTopBorder(title, metrics2, width, colorCode) {
|
|
563075
|
+
const border = toolColorSeq(colorCode);
|
|
563076
|
+
const titleColor = toolColorSeq(colorCode, true);
|
|
563077
|
+
const metricColor = toolColorSeq(222);
|
|
563078
|
+
const reset = toolResetSeq();
|
|
563079
|
+
const inner = Math.max(4, width - 2);
|
|
563080
|
+
const titleVisible = stripAnsi(title);
|
|
563081
|
+
const metricsVisible = stripAnsi(metrics2);
|
|
563082
|
+
const titleChip = ` ${titleVisible} `;
|
|
563083
|
+
const titleSpan = titleChip.length + 2;
|
|
563084
|
+
const metricsChip = metricsVisible ? ` ${metricsVisible} ` : "";
|
|
563085
|
+
const metricsSpan = metricsChip ? metricsChip.length + 2 : 0;
|
|
563086
|
+
let titleSegment;
|
|
563087
|
+
let metricsSegment = "";
|
|
563088
|
+
let fillerWidth;
|
|
563089
|
+
if (titleSpan + metricsSpan + 4 <= inner) {
|
|
563090
|
+
titleSegment = `${border}[${titleColor}${titleChip}${reset}${border}]`;
|
|
563091
|
+
metricsSegment = metricsChip ? `${border}[${metricColor}${metricsChip}${reset}${border}]` : "";
|
|
563092
|
+
fillerWidth = inner - titleSpan - metricsSpan - 2;
|
|
563093
|
+
} else if (titleSpan + 4 <= inner) {
|
|
563094
|
+
titleSegment = `${border}[${titleColor}${titleChip}${reset}${border}]`;
|
|
563095
|
+
fillerWidth = inner - titleSpan - 2;
|
|
563096
|
+
} else {
|
|
563097
|
+
const room = Math.max(3, inner - 8);
|
|
563098
|
+
const truncated = titleVisible.length > room ? titleVisible.slice(0, Math.max(1, room - 1)) + "…" : titleVisible;
|
|
563099
|
+
titleSegment = `${border}[${titleColor} ${truncated} ${reset}${border}]`;
|
|
563100
|
+
fillerWidth = Math.max(0, inner - (truncated.length + 4) - 2);
|
|
563101
|
+
}
|
|
563102
|
+
return `${border}${BOX_TL2}${BOX_H2}${titleSegment}${BOX_H2.repeat(Math.max(0, fillerWidth))}${metricsSegment}${BOX_H2}${BOX_TR2}${reset}`;
|
|
563103
|
+
}
|
|
563104
|
+
function buildToolDivider(width, colorCode) {
|
|
563105
|
+
const border = toolColorSeq(colorCode);
|
|
563106
|
+
return `${border}${BOX_TJ_L2}${BOX_H2.repeat(Math.max(0, width - 2))}${BOX_TJ_R2}${toolResetSeq()}`;
|
|
563107
|
+
}
|
|
563108
|
+
function buildToolBottom(width, colorCode) {
|
|
563109
|
+
const border = toolColorSeq(colorCode);
|
|
563110
|
+
return `${border}${BOX_BL2}${BOX_H2.repeat(Math.max(0, width - 2))}${BOX_BR2}${toolResetSeq()}`;
|
|
563111
|
+
}
|
|
563112
|
+
function buildToolContentRow(content, width, colorCode) {
|
|
563113
|
+
const border = toolColorSeq(colorCode);
|
|
563114
|
+
const reset = toolResetSeq();
|
|
563115
|
+
const innerWidth = Math.max(1, width - 4);
|
|
563116
|
+
let padded = visibleLen(content) > innerWidth ? truncateAnsiToWidth(content, innerWidth) : content;
|
|
563117
|
+
const visible = visibleLen(padded);
|
|
563118
|
+
if (visible < innerWidth) padded += " ".repeat(innerWidth - visible);
|
|
563119
|
+
return `${border}${BOX_V2}${reset} ${padded} ${border}${BOX_V2}${reset}`;
|
|
563120
|
+
}
|
|
563121
|
+
function formatToolBoxLine(line, kind) {
|
|
563122
|
+
switch (kind) {
|
|
563123
|
+
case "error":
|
|
563124
|
+
return c3.red(line);
|
|
563125
|
+
case "success":
|
|
563126
|
+
return c3.green(line);
|
|
563127
|
+
case "dim":
|
|
563128
|
+
return c3.dim(line);
|
|
563129
|
+
case "markdown": {
|
|
563130
|
+
const formatted = formatMarkdownLine(line);
|
|
563131
|
+
return formatted === line ? highlightToolOutput(line) : formatted;
|
|
563132
|
+
}
|
|
563133
|
+
case "tool":
|
|
563134
|
+
return /\x1B\[[0-?]*[ -/]*[@-~]/.test(line) ? line : highlightToolOutput(line);
|
|
563135
|
+
case "plain":
|
|
563136
|
+
default:
|
|
563137
|
+
return line;
|
|
563138
|
+
}
|
|
563139
|
+
}
|
|
563140
|
+
function wrapFooterItems(items, width) {
|
|
563141
|
+
const sep4 = " · ";
|
|
563142
|
+
const lines = [];
|
|
563143
|
+
let current = "";
|
|
563144
|
+
for (const item of items) {
|
|
563145
|
+
const clean5 = item.replace(/\s+/g, " ").trim();
|
|
563146
|
+
if (!clean5) continue;
|
|
563147
|
+
const candidate = current ? `${current}${sep4}${clean5}` : clean5;
|
|
563148
|
+
if (visibleLen(candidate) <= width) {
|
|
563149
|
+
current = candidate;
|
|
563150
|
+
continue;
|
|
563069
563151
|
}
|
|
563070
|
-
|
|
563071
|
-
|
|
563072
|
-
|
|
563073
|
-
|
|
563074
|
-
|
|
563075
|
-
|
|
563076
|
-
|
|
563077
|
-
return;
|
|
563152
|
+
if (current) lines.push(current);
|
|
563153
|
+
if (clean5.length > width) {
|
|
563154
|
+
const chunks = wrapToolTextLine(clean5, width);
|
|
563155
|
+
lines.push(...chunks.slice(0, -1));
|
|
563156
|
+
current = chunks[chunks.length - 1] ?? "";
|
|
563157
|
+
} else {
|
|
563158
|
+
current = clean5;
|
|
563078
563159
|
}
|
|
563079
|
-
|
|
563080
|
-
|
|
563081
|
-
|
|
563082
|
-
|
|
563160
|
+
}
|
|
563161
|
+
if (current) lines.push(current);
|
|
563162
|
+
return lines;
|
|
563163
|
+
}
|
|
563164
|
+
function buildToolFooterRows(footer, width, colorCode) {
|
|
563165
|
+
const items = [...new Set(footer.items.map((item) => item.trim()).filter(Boolean))];
|
|
563166
|
+
if (items.length === 0) return [];
|
|
563167
|
+
const innerWidth = Math.max(8, width - 4);
|
|
563168
|
+
const labelVisible = `${footer.label}: `.length;
|
|
563169
|
+
const label = `${toolColorSeq(colorCode, true)}${footer.label}:${toolResetSeq()} `;
|
|
563170
|
+
const wrapped = wrapFooterItems(items, Math.max(8, innerWidth - labelVisible));
|
|
563171
|
+
if (wrapped.length === 0) return [];
|
|
563172
|
+
const rows = [buildToolContentRow(`${label}${wrapped[0]}`, width, colorCode)];
|
|
563173
|
+
for (const line of wrapped.slice(1)) {
|
|
563174
|
+
rows.push(buildToolContentRow(`${" ".repeat(labelVisible)}${line}`, width, colorCode));
|
|
563175
|
+
}
|
|
563176
|
+
return rows;
|
|
563177
|
+
}
|
|
563178
|
+
function buildToolBoxLines(data, width) {
|
|
563179
|
+
const w = Math.max(40, width);
|
|
563180
|
+
const innerWidth = Math.max(1, w - 4);
|
|
563181
|
+
const lines = [
|
|
563182
|
+
buildToolTopBorder(data.title, data.metrics, w, data.colorCode),
|
|
563183
|
+
buildToolDivider(w, data.colorCode)
|
|
563184
|
+
];
|
|
563185
|
+
for (const bodyLine of data.body.length > 0 ? data.body : [{ text: "Done", mode: "wrap", kind: "dim" }]) {
|
|
563186
|
+
const chunks = bodyLine.mode === "truncate" ? [truncateAnsiToWidth(bodyLine.text, innerWidth)] : wrapToolTextLine(bodyLine.text, innerWidth);
|
|
563187
|
+
for (const chunk of chunks) {
|
|
563188
|
+
lines.push(buildToolContentRow(formatToolBoxLine(chunk, bodyLine.kind), w, data.colorCode));
|
|
563083
563189
|
}
|
|
563084
|
-
|
|
563085
|
-
|
|
563086
|
-
|
|
563190
|
+
}
|
|
563191
|
+
const footers = (data.footers ?? []).filter((footer) => footer.items.length > 0);
|
|
563192
|
+
if (footers.length > 0) {
|
|
563193
|
+
lines.push(buildToolDivider(w, data.colorCode));
|
|
563194
|
+
for (const footer of footers) {
|
|
563195
|
+
lines.push(...buildToolFooterRows(footer, w, data.colorCode));
|
|
563087
563196
|
}
|
|
563088
|
-
|
|
563089
|
-
|
|
563090
|
-
|
|
563091
|
-
|
|
563197
|
+
}
|
|
563198
|
+
lines.push(buildToolBottom(w, data.colorCode));
|
|
563199
|
+
return lines;
|
|
563200
|
+
}
|
|
563201
|
+
function renderToolDynamicBlock(kind, render2, opts) {
|
|
563202
|
+
const redir = _contentWriteHook?.redirect?.();
|
|
563203
|
+
const host = opts.host !== void 0 ? opts.host : _contentWriteHook?.dynamicBlockHost?.();
|
|
563204
|
+
if (!redir && host) {
|
|
563205
|
+
const id = `${kind}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
563206
|
+
host.registerDynamicBlock(id, render2);
|
|
563207
|
+
host.appendDynamicBlock(id);
|
|
563208
|
+
return;
|
|
563209
|
+
}
|
|
563210
|
+
const text = `${render2(getTermWidth()).join("\n")}
|
|
563211
|
+
`;
|
|
563212
|
+
if (redir) {
|
|
563213
|
+
redir(text);
|
|
563214
|
+
return;
|
|
563215
|
+
}
|
|
563216
|
+
process.stdout.write(text);
|
|
563217
|
+
}
|
|
563218
|
+
function buildToolCallBoxLines(toolName, args, verbose, width) {
|
|
563219
|
+
const icon = _emojisEnabled ? `${TOOL_ICONS[toolName] ?? "🔧"} ` : "";
|
|
563220
|
+
const label = TOOL_LABELS[toolName] ?? toolName;
|
|
563221
|
+
const body = formatToolArgsForBox(toolName, args, verbose).map((text) => ({
|
|
563222
|
+
text,
|
|
563223
|
+
mode: "wrap",
|
|
563224
|
+
kind: "tool"
|
|
563225
|
+
}));
|
|
563226
|
+
return buildToolBoxLines({
|
|
563227
|
+
title: `${icon}${label}`,
|
|
563228
|
+
metrics: "call",
|
|
563229
|
+
body,
|
|
563230
|
+
colorCode: toolColorCode(toolName)
|
|
563231
|
+
}, width);
|
|
563232
|
+
}
|
|
563233
|
+
function formatToolArgsForBox(toolName, args, verbose) {
|
|
563234
|
+
switch (toolName) {
|
|
563235
|
+
case "shell":
|
|
563236
|
+
return [`Command: ${String(args["command"] ?? "")}${args["stdin"] ? " (with stdin)" : ""}`];
|
|
563237
|
+
case "background_run":
|
|
563238
|
+
return [`Command: ${String(args["command"] ?? "")}`];
|
|
563239
|
+
case "file_read":
|
|
563240
|
+
case "file_write":
|
|
563241
|
+
case "file_edit":
|
|
563242
|
+
case "list_directory":
|
|
563243
|
+
return [`Path: ${String(args["path"] ?? ".")}`];
|
|
563244
|
+
case "grep_search":
|
|
563245
|
+
return [
|
|
563246
|
+
`Pattern: ${String(args["pattern"] ?? "")}`,
|
|
563247
|
+
args["path"] ? `Path: ${String(args["path"])}` : ""
|
|
563248
|
+
].filter(Boolean);
|
|
563249
|
+
case "find_files":
|
|
563250
|
+
return [`Pattern: ${String(args["pattern"] ?? "")}`];
|
|
563251
|
+
case "web_search":
|
|
563252
|
+
return [`Query: ${String(args["query"] ?? "")}`];
|
|
563253
|
+
case "web_fetch":
|
|
563254
|
+
return [`URL: ${String(args["url"] ?? "")}`];
|
|
563255
|
+
case "memory_read":
|
|
563256
|
+
return [`Key: ${args["topic"]}${args["key"] ? "." + args["key"] : ""}`];
|
|
563257
|
+
case "memory_write":
|
|
563258
|
+
return [`Key: ${args["topic"]}.${args["key"]}`];
|
|
563259
|
+
default: {
|
|
563260
|
+
const entries = Object.entries(args ?? {});
|
|
563261
|
+
if (entries.length === 0) return ["Starting tool call"];
|
|
563262
|
+
const maxValue2 = verbose ? 500 : 160;
|
|
563263
|
+
return entries.slice(0, verbose ? 20 : 8).map(([key, value2]) => {
|
|
563264
|
+
const rendered = typeof value2 === "string" ? value2 : JSON.stringify(value2);
|
|
563265
|
+
return `${key}: ${truncStr(String(rendered ?? ""), maxValue2)}`;
|
|
563266
|
+
});
|
|
563092
563267
|
}
|
|
563093
|
-
default:
|
|
563094
|
-
break;
|
|
563095
563268
|
}
|
|
563096
|
-
|
|
563097
|
-
|
|
563269
|
+
}
|
|
563270
|
+
function buildToolResultBoxLines(toolName, success, output, opts, width) {
|
|
563271
|
+
const label = TOOL_LABELS[toolName] ?? toolName;
|
|
563272
|
+
const status = success ? "✔" : "✖";
|
|
563273
|
+
const body = buildToolResultBody(toolName, success, output, opts.verbose);
|
|
563274
|
+
const rawLines = output.split("\n").filter((line) => line.trim()).length;
|
|
563275
|
+
const metrics2 = [
|
|
563276
|
+
success ? "ok" : "failed",
|
|
563277
|
+
rawLines > 0 ? `${rawLines} line${rawLines === 1 ? "" : "s"}` : "",
|
|
563278
|
+
output.length > 0 ? `${output.length.toLocaleString()} chars` : "",
|
|
563279
|
+
opts.durationMs && opts.durationMs > 0 ? formatDuration3(opts.durationMs) : ""
|
|
563280
|
+
].filter(Boolean).join(" · ");
|
|
563281
|
+
const provenance = detectProvenanceAnchors([output]);
|
|
563282
|
+
const artifacts = detectToolArtifacts(output);
|
|
563283
|
+
const footers = [
|
|
563284
|
+
{ label: "Artifacts", items: artifacts },
|
|
563285
|
+
{ label: "Provenance", items: provenance }
|
|
563286
|
+
];
|
|
563287
|
+
return buildToolBoxLines({
|
|
563288
|
+
title: `${status} ${label}`,
|
|
563289
|
+
metrics: metrics2,
|
|
563290
|
+
body,
|
|
563291
|
+
footers,
|
|
563292
|
+
colorCode: toolColorCode(toolName)
|
|
563293
|
+
}, width);
|
|
563294
|
+
}
|
|
563295
|
+
function buildToolResultBody(toolName, success, output, verbose) {
|
|
563296
|
+
const debug = loadConfig()?.debug ?? false;
|
|
563297
|
+
if (toolName === "file_write" || toolName === "file_edit") {
|
|
563298
|
+
const summary = extractFirstLine(output, Number.MAX_SAFE_INTEGER);
|
|
563299
|
+
return [{
|
|
563300
|
+
text: summary,
|
|
563301
|
+
mode: "wrap",
|
|
563302
|
+
kind: success ? "dim" : "error"
|
|
563303
|
+
}];
|
|
563304
|
+
}
|
|
563305
|
+
if (toolName === "file_read") {
|
|
563306
|
+
if (!success) {
|
|
563307
|
+
return [{ text: extractFirstLine(output, Number.MAX_SAFE_INTEGER), mode: "wrap", kind: "error" }];
|
|
563308
|
+
}
|
|
563309
|
+
return codePreviewLines(output, 10);
|
|
563310
|
+
}
|
|
563311
|
+
if (toolName === "task_complete") {
|
|
563312
|
+
return [{ text: "Done", mode: "wrap", kind: "success" }];
|
|
563313
|
+
}
|
|
563314
|
+
const filtered = output.split("\n").filter((line) => {
|
|
563315
|
+
const trimmed = line.trim();
|
|
563098
563316
|
if (!trimmed) return false;
|
|
563099
563317
|
if (!debug && (trimmed.startsWith("[trust_tier:") || trimmed.startsWith("[SYSTEM]:") || trimmed.includes("tool_output_untrusted") || trimmed.includes("FORCED PROGRESS BLOCK"))) return false;
|
|
563100
563318
|
return true;
|
|
563101
563319
|
});
|
|
563102
|
-
if (
|
|
563103
|
-
|
|
563104
|
-
process.stdout.write(`${prefix}${icon} ${success ? c3.dim("Done") : c3.red("Failed")}
|
|
563105
|
-
`);
|
|
563106
|
-
return;
|
|
563320
|
+
if (filtered.length === 0) {
|
|
563321
|
+
return [{ text: success ? "Done" : "Failed", mode: "wrap", kind: success ? "success" : "error" }];
|
|
563107
563322
|
}
|
|
563108
|
-
const maxLines = verbose ? 200 : 6;
|
|
563109
|
-
const shown =
|
|
563110
|
-
for (const line of
|
|
563323
|
+
const maxLines = verbose ? 200 : toolName === "shell" || toolName === "background_run" || toolName === "grep_search" ? 10 : 6;
|
|
563324
|
+
const shown = [];
|
|
563325
|
+
for (const line of filtered.slice(0, maxLines)) {
|
|
563111
563326
|
if (isRawJsonDump(line) && !verbose) {
|
|
563112
|
-
|
|
563113
|
-
|
|
563114
|
-
return;
|
|
563115
|
-
}
|
|
563116
|
-
if (verbose) {
|
|
563117
|
-
const termW = getTermWidth() - 10;
|
|
563118
|
-
if (line.length > termW) {
|
|
563119
|
-
let remaining = line;
|
|
563120
|
-
let first2 = true;
|
|
563121
|
-
while (remaining.length > 0) {
|
|
563122
|
-
if (remaining.length <= termW) {
|
|
563123
|
-
const formatted2 = formatMarkdownLine(remaining);
|
|
563124
|
-
process.stdout.write(`${first2 ? prefix : prefix + " "}${formatted2 === remaining ? highlightToolOutput(remaining) : formatted2}
|
|
563125
|
-
`);
|
|
563126
|
-
break;
|
|
563127
|
-
}
|
|
563128
|
-
let breakAt = remaining.lastIndexOf(" ", termW);
|
|
563129
|
-
if (breakAt < termW * 0.3) breakAt = termW;
|
|
563130
|
-
const chunk = remaining.slice(0, breakAt);
|
|
563131
|
-
remaining = remaining.slice(breakAt).trimStart();
|
|
563132
|
-
const formatted = formatMarkdownLine(chunk);
|
|
563133
|
-
process.stdout.write(`${first2 ? prefix : prefix + " "}${formatted === chunk ? highlightToolOutput(chunk) : formatted}
|
|
563134
|
-
`);
|
|
563135
|
-
first2 = false;
|
|
563136
|
-
}
|
|
563137
|
-
} else {
|
|
563138
|
-
const formatted = formatMarkdownLine(line);
|
|
563139
|
-
process.stdout.write(`${prefix}${formatted === line ? highlightToolOutput(line) : formatted}
|
|
563140
|
-
`);
|
|
563141
|
-
}
|
|
563142
|
-
} else {
|
|
563143
|
-
const cropped = line.length > maxW ? line.slice(0, maxW - 3) + "..." : line;
|
|
563144
|
-
const formatted = formatMarkdownLine(cropped);
|
|
563145
|
-
process.stdout.write(`${prefix}${formatted === cropped ? highlightToolOutput(cropped) : formatted}
|
|
563146
|
-
`);
|
|
563327
|
+
shown.push({ text: "(output omitted)", mode: "wrap", kind: "dim" });
|
|
563328
|
+
break;
|
|
563147
563329
|
}
|
|
563330
|
+
shown.push({
|
|
563331
|
+
text: line,
|
|
563332
|
+
mode: shouldPreserveToolLine(toolName, line) ? "truncate" : "wrap",
|
|
563333
|
+
kind: outputLineKind(toolName, line)
|
|
563334
|
+
});
|
|
563148
563335
|
}
|
|
563149
|
-
if (
|
|
563150
|
-
|
|
563151
|
-
|
|
563336
|
+
if (filtered.length > maxLines) {
|
|
563337
|
+
shown.push({
|
|
563338
|
+
text: `... ${filtered.length - maxLines} more lines`,
|
|
563339
|
+
mode: "wrap",
|
|
563340
|
+
kind: "dim"
|
|
563341
|
+
});
|
|
563152
563342
|
}
|
|
563343
|
+
return shown;
|
|
563344
|
+
}
|
|
563345
|
+
function codePreviewLines(output, maxLines) {
|
|
563346
|
+
const lines = output.split("\n");
|
|
563347
|
+
let start2 = 0;
|
|
563348
|
+
while (start2 < lines.length && !lines[start2].trim()) start2++;
|
|
563349
|
+
const shown = lines.slice(start2, start2 + maxLines);
|
|
563350
|
+
if (shown.length === 0) return [{ text: "(empty file)", mode: "wrap", kind: "dim" }];
|
|
563351
|
+
const body = shown.map((line) => ({
|
|
563352
|
+
text: line,
|
|
563353
|
+
mode: "truncate",
|
|
563354
|
+
kind: "dim"
|
|
563355
|
+
}));
|
|
563356
|
+
const remaining = lines.length - start2 - shown.length;
|
|
563357
|
+
if (remaining > 0) {
|
|
563358
|
+
body.push({ text: `... ${remaining} more lines`, mode: "wrap", kind: "dim" });
|
|
563359
|
+
}
|
|
563360
|
+
return body;
|
|
563361
|
+
}
|
|
563362
|
+
function shouldPreserveToolLine(toolName, line) {
|
|
563363
|
+
if (toolName === "file_read") return true;
|
|
563364
|
+
if (/^\s*\d+\s*(?:[|:│])/.test(line)) return true;
|
|
563365
|
+
if (/^\s*(?:@@|\+\+\+|---|\+|-)\s/.test(line)) return true;
|
|
563366
|
+
if (/^\s*(?:import|export|const|let|var|function|class|interface|type)\b/.test(line)) return true;
|
|
563367
|
+
if (/^\s*[{}[\](),.;]+\s*$/.test(line)) return true;
|
|
563368
|
+
return false;
|
|
563369
|
+
}
|
|
563370
|
+
function outputLineKind(toolName, line) {
|
|
563371
|
+
if (/\x1B\[[0-?]*[ -/]*[@-~]/.test(line)) return "plain";
|
|
563372
|
+
if (toolName === "shell" || toolName === "background_run" || toolName === "grep_search") return "tool";
|
|
563373
|
+
return "markdown";
|
|
563374
|
+
}
|
|
563375
|
+
function detectToolArtifacts(output) {
|
|
563376
|
+
const out = /* @__PURE__ */ new Set();
|
|
563377
|
+
const artifactPattern = /\b(?:Saved to|Written to|Output|File|Path|Artifact):\s*([^\s]+(?:\.(?:png|jpe?g|gif|webp|svg|json|md|txt|log|wav|mp3|mp4|mov|pdf|html|csv|ts|tsx|js|jsx|py|go|rs|java|c|cpp|h|hpp|css|scss|yaml|yml)))/gi;
|
|
563378
|
+
for (const match of output.matchAll(artifactPattern)) {
|
|
563379
|
+
const value2 = match[1]?.replace(/[),.;]+$/, "");
|
|
563380
|
+
if (value2) out.add(value2);
|
|
563381
|
+
}
|
|
563382
|
+
return [...out].slice(0, 12);
|
|
563383
|
+
}
|
|
563384
|
+
function renderToolCallStart(toolName, args, verboseOrOpts) {
|
|
563385
|
+
const opts = normalizeToolOpts(verboseOrOpts);
|
|
563386
|
+
const frozenArgs = { ...args ?? {} };
|
|
563387
|
+
renderToolDynamicBlock(
|
|
563388
|
+
"tool-call",
|
|
563389
|
+
(width) => buildToolCallBoxLines(toolName, frozenArgs, opts.verbose, width),
|
|
563390
|
+
opts
|
|
563391
|
+
);
|
|
563392
|
+
}
|
|
563393
|
+
function renderToolLine(content, isLast = false) {
|
|
563394
|
+
const connector = isLast ? "└" : "├";
|
|
563395
|
+
process.stdout.write(` ${c3.dim(connector)}─ ${content}
|
|
563396
|
+
`);
|
|
563397
|
+
}
|
|
563398
|
+
function renderToolResult(toolName, success, output, verboseOrOpts) {
|
|
563399
|
+
const opts = normalizeToolOpts(verboseOrOpts);
|
|
563400
|
+
const frozenOutput = String(output ?? "");
|
|
563401
|
+
renderToolDynamicBlock(
|
|
563402
|
+
"tool-result",
|
|
563403
|
+
(width) => buildToolResultBoxLines(toolName, success, frozenOutput, opts, width),
|
|
563404
|
+
opts
|
|
563405
|
+
);
|
|
563153
563406
|
}
|
|
563154
563407
|
function renderImageAsciiPreview(title, imagePath, ascii2, renderer) {
|
|
563155
563408
|
const prefix = ` ${c3.dim("│")} `;
|
|
@@ -563173,51 +563426,6 @@ function isRawJsonDump(line) {
|
|
|
563173
563426
|
if (/\[38;5;\d+m/.test(line) && line.length > 100) return true;
|
|
563174
563427
|
return false;
|
|
563175
563428
|
}
|
|
563176
|
-
function renderCodePreview(output, prefix, maxW, maxLines) {
|
|
563177
|
-
const lines = output.split("\n");
|
|
563178
|
-
let start2 = 0;
|
|
563179
|
-
while (start2 < lines.length && !lines[start2].trim()) start2++;
|
|
563180
|
-
const shown = lines.slice(start2, start2 + maxLines);
|
|
563181
|
-
if (shown.length === 0) {
|
|
563182
|
-
process.stdout.write(`${prefix}${c3.dim("(empty file)")}
|
|
563183
|
-
`);
|
|
563184
|
-
return;
|
|
563185
|
-
}
|
|
563186
|
-
for (const line of shown) {
|
|
563187
|
-
const cropped = line.length > maxW ? line.slice(0, maxW - 3) + "..." : line;
|
|
563188
|
-
process.stdout.write(`${prefix}${c3.dim(cropped)}
|
|
563189
|
-
`);
|
|
563190
|
-
}
|
|
563191
|
-
const remaining = lines.length - start2 - shown.length;
|
|
563192
|
-
if (remaining > 0) {
|
|
563193
|
-
process.stdout.write(`${prefix}${c3.dim(`... ${remaining} more lines`)}
|
|
563194
|
-
`);
|
|
563195
|
-
}
|
|
563196
|
-
}
|
|
563197
|
-
function renderShellOutput(output, success, prefix, maxW, maxLines) {
|
|
563198
|
-
const lines = output.split("\n").filter((l2) => l2.trim());
|
|
563199
|
-
if (lines.length === 0) {
|
|
563200
|
-
const icon = success ? c3.green("✔") : c3.red("✖");
|
|
563201
|
-
process.stdout.write(`${prefix}${icon} ${success ? c3.dim("Done") : c3.red("Failed")}
|
|
563202
|
-
`);
|
|
563203
|
-
return;
|
|
563204
|
-
}
|
|
563205
|
-
const shown = lines.slice(0, maxLines);
|
|
563206
|
-
for (const line of shown) {
|
|
563207
|
-
if (isRawJsonDump(line)) {
|
|
563208
|
-
process.stdout.write(`${prefix}${c3.dim("(output omitted)")}
|
|
563209
|
-
`);
|
|
563210
|
-
return;
|
|
563211
|
-
}
|
|
563212
|
-
const cropped = line.length > maxW ? line.slice(0, maxW - 3) + "..." : line;
|
|
563213
|
-
process.stdout.write(`${prefix}${highlightToolOutput(cropped)}
|
|
563214
|
-
`);
|
|
563215
|
-
}
|
|
563216
|
-
if (lines.length > maxLines) {
|
|
563217
|
-
process.stdout.write(`${prefix}${c3.dim(`... ${lines.length - maxLines} more lines`)}
|
|
563218
|
-
`);
|
|
563219
|
-
}
|
|
563220
|
-
}
|
|
563221
563429
|
function highlightToolOutput(line) {
|
|
563222
563430
|
if (line.startsWith("+") && !line.startsWith("+++")) return c3.green(line);
|
|
563223
563431
|
if (line.startsWith("-") && !line.startsWith("---")) return c3.red(line);
|
|
@@ -563520,113 +563728,6 @@ function renderConfig(config) {
|
|
|
563520
563728
|
}
|
|
563521
563729
|
process.stdout.write("\n");
|
|
563522
563730
|
}
|
|
563523
|
-
function formatToolArgs(toolName, args, verbose) {
|
|
563524
|
-
const maxArg = verbose ? 1e4 : Math.max(40, getTermWidth() - 20);
|
|
563525
|
-
switch (toolName) {
|
|
563526
|
-
case "file_read":
|
|
563527
|
-
case "file_write":
|
|
563528
|
-
case "file_edit":
|
|
563529
|
-
return fileLink(String(args["path"] ?? ""));
|
|
563530
|
-
case "shell": {
|
|
563531
|
-
const cmd = truncStr(String(args["command"] ?? ""), maxArg);
|
|
563532
|
-
return args["stdin"] ? `${cmd} ${c3.dim("(with stdin)")}` : cmd;
|
|
563533
|
-
}
|
|
563534
|
-
case "grep_search":
|
|
563535
|
-
return `${c3.yellow(String(args["pattern"] ?? ""))}${args["path"] ? ` in ${fileLink(String(args["path"]))}` : ""}`;
|
|
563536
|
-
case "find_files":
|
|
563537
|
-
return String(args["pattern"] ?? "");
|
|
563538
|
-
case "list_directory":
|
|
563539
|
-
return fileLink(String(args["path"] ?? "."));
|
|
563540
|
-
case "web_search":
|
|
563541
|
-
return `"${truncStr(String(args["query"] ?? ""), maxArg - 2)}"`;
|
|
563542
|
-
case "web_fetch":
|
|
563543
|
-
return truncStr(String(args["url"] ?? ""), maxArg);
|
|
563544
|
-
case "memory_read":
|
|
563545
|
-
return `${args["topic"]}${args["key"] ? "." + args["key"] : ""}`;
|
|
563546
|
-
case "memory_write":
|
|
563547
|
-
return `${args["topic"]}.${args["key"]}`;
|
|
563548
|
-
case "task_complete":
|
|
563549
|
-
return "";
|
|
563550
|
-
case "aiwg_setup":
|
|
563551
|
-
return String(args["framework"] ?? "sdlc");
|
|
563552
|
-
case "aiwg_health":
|
|
563553
|
-
return args["detailed"] ? "detailed" : "summary";
|
|
563554
|
-
case "aiwg_workflow":
|
|
563555
|
-
return truncStr(String(args["command"] ?? ""), maxArg);
|
|
563556
|
-
case "batch_edit": {
|
|
563557
|
-
const edits = args["edits"];
|
|
563558
|
-
return edits ? `${edits.length} edit(s)` : "";
|
|
563559
|
-
}
|
|
563560
|
-
case "codebase_map":
|
|
563561
|
-
return args["path"] ? String(args["path"]) : ".";
|
|
563562
|
-
case "diagnostic": {
|
|
563563
|
-
const steps = args["steps"];
|
|
563564
|
-
return steps ? steps.join(", ") : "all";
|
|
563565
|
-
}
|
|
563566
|
-
case "git_info":
|
|
563567
|
-
return args["show_diff"] ? "with diff" : "summary";
|
|
563568
|
-
case "background_run":
|
|
563569
|
-
return truncStr(String(args["command"] ?? ""), maxArg);
|
|
563570
|
-
case "task_status":
|
|
563571
|
-
case "task_output":
|
|
563572
|
-
case "task_stop":
|
|
563573
|
-
return String(args["task_id"] ?? "all");
|
|
563574
|
-
case "sub_agent": {
|
|
563575
|
-
const bg = args["background"] ? " (background)" : "";
|
|
563576
|
-
return truncStr(String(args["task"] ?? ""), maxArg - 15) + bg;
|
|
563577
|
-
}
|
|
563578
|
-
case "image_read":
|
|
563579
|
-
return String(args["path"] ?? "");
|
|
563580
|
-
case "screenshot":
|
|
563581
|
-
return String(args["region"] ?? "full screen");
|
|
563582
|
-
case "ocr":
|
|
563583
|
-
return `${args["path"] ?? ""}${args["region"] ? ` (${args["region"]})` : ""}`;
|
|
563584
|
-
case "transcribe_file":
|
|
563585
|
-
return `${args["path"] ?? ""}${args["model"] ? ` (${args["model"]})` : ""}`;
|
|
563586
|
-
case "transcribe_url":
|
|
563587
|
-
return truncStr(String(args["url"] ?? ""), maxArg);
|
|
563588
|
-
case "ask_user": {
|
|
563589
|
-
const q = truncStr(String(args["question"] ?? ""), maxArg - 10);
|
|
563590
|
-
const opts = args["options"];
|
|
563591
|
-
const count = opts ? ` (${opts.length} options)` : "";
|
|
563592
|
-
return `${q}${c3.dim(count)}`;
|
|
563593
|
-
}
|
|
563594
|
-
case "todo_write": {
|
|
563595
|
-
const todos = args["todos"];
|
|
563596
|
-
if (!Array.isArray(todos)) return "";
|
|
563597
|
-
const counts = { p: 0, i: 0, c: 0, b: 0 };
|
|
563598
|
-
for (const t2 of todos) {
|
|
563599
|
-
if (t2?.status === "completed") counts.c++;
|
|
563600
|
-
else if (t2?.status === "in_progress") counts.i++;
|
|
563601
|
-
else if (t2?.status === "blocked") counts.b++;
|
|
563602
|
-
else counts.p++;
|
|
563603
|
-
}
|
|
563604
|
-
const summary = `${todos.length} items (${counts.c}◉ ${counts.i}◐ ${counts.p}○${counts.b > 0 ? ` ${counts.b}◍` : ""})`;
|
|
563605
|
-
if (verbose) {
|
|
563606
|
-
const current = todos.find((t2) => t2?.status === "in_progress");
|
|
563607
|
-
if (current?.content) {
|
|
563608
|
-
return `${summary} — ${truncStr(current.content, maxArg - summary.length - 4)}`;
|
|
563609
|
-
}
|
|
563610
|
-
}
|
|
563611
|
-
return summary;
|
|
563612
|
-
}
|
|
563613
|
-
case "todo_read":
|
|
563614
|
-
return "";
|
|
563615
|
-
default:
|
|
563616
|
-
return Object.entries(args).map(([k, v]) => {
|
|
563617
|
-
let valStr;
|
|
563618
|
-
if (v === null || v === void 0) valStr = String(v);
|
|
563619
|
-
else if (typeof v === "object") {
|
|
563620
|
-
try {
|
|
563621
|
-
valStr = JSON.stringify(v);
|
|
563622
|
-
} catch {
|
|
563623
|
-
valStr = String(v);
|
|
563624
|
-
}
|
|
563625
|
-
} else valStr = String(v);
|
|
563626
|
-
return `${k}=${truncStr(valStr, Math.max(30, maxArg / 3))}`;
|
|
563627
|
-
}).join(", ");
|
|
563628
|
-
}
|
|
563629
|
-
}
|
|
563630
563731
|
function truncStr(s2, max) {
|
|
563631
563732
|
return s2.length > max ? s2.slice(0, max) + "..." : s2;
|
|
563632
563733
|
}
|
|
@@ -563638,7 +563739,7 @@ function formatDuration3(ms) {
|
|
|
563638
563739
|
const secs = Math.floor(totalSecs % 60);
|
|
563639
563740
|
return `${mins}m ${secs}s`;
|
|
563640
563741
|
}
|
|
563641
|
-
var isTTY2, c3, ui, pastel, _emojisEnabled, _colorsEnabled, MD, TOOL_ICONS, TOOL_LABELS,
|
|
563742
|
+
var isTTY2, c3, ui, pastel, _emojisEnabled, _colorsEnabled, MD, TOOL_ICONS, TOOL_LABELS, TOOL_COLOR_CODES, BOX_TL2, BOX_TR2, BOX_BL2, BOX_BR2, BOX_H2, BOX_V2, BOX_TJ_L2, BOX_TJ_R2, RESET2, _contentWriteHook, HINTS, TOOL_NAMES, COMMAND_NAMES, SLASH_COMMANDS2;
|
|
563642
563743
|
var init_render = __esm({
|
|
563643
563744
|
"packages/cli/src/tui/render.ts"() {
|
|
563644
563745
|
"use strict";
|
|
@@ -563646,6 +563747,8 @@ var init_render = __esm({
|
|
|
563646
563747
|
init_layout2();
|
|
563647
563748
|
init_command_registry();
|
|
563648
563749
|
init_config();
|
|
563750
|
+
init_text_selection();
|
|
563751
|
+
init_task_complete_box();
|
|
563649
563752
|
isTTY2 = process.stdout.isTTY ?? false;
|
|
563650
563753
|
c3 = {
|
|
563651
563754
|
bold: (t2) => ansi2("1", t2),
|
|
@@ -563785,43 +563888,47 @@ var init_render = __esm({
|
|
|
563785
563888
|
// User interaction
|
|
563786
563889
|
ask_user: "Ask user"
|
|
563787
563890
|
};
|
|
563788
|
-
|
|
563789
|
-
|
|
563790
|
-
|
|
563791
|
-
|
|
563792
|
-
|
|
563793
|
-
|
|
563794
|
-
|
|
563795
|
-
|
|
563796
|
-
|
|
563797
|
-
|
|
563798
|
-
|
|
563799
|
-
|
|
563800
|
-
|
|
563801
|
-
|
|
563802
|
-
|
|
563803
|
-
|
|
563804
|
-
|
|
563805
|
-
|
|
563806
|
-
|
|
563807
|
-
|
|
563808
|
-
|
|
563809
|
-
|
|
563810
|
-
|
|
563811
|
-
|
|
563812
|
-
|
|
563813
|
-
|
|
563814
|
-
|
|
563815
|
-
|
|
563816
|
-
|
|
563817
|
-
|
|
563818
|
-
|
|
563819
|
-
screenshot: accentSoft,
|
|
563820
|
-
ocr: accentSoft,
|
|
563821
|
-
transcribe_file: accentWarm,
|
|
563822
|
-
transcribe_url: accentWarm,
|
|
563823
|
-
ask_user: accentBright
|
|
563891
|
+
TOOL_COLOR_CODES = {
|
|
563892
|
+
file_read: 80,
|
|
563893
|
+
file_write: 43,
|
|
563894
|
+
file_edit: 43,
|
|
563895
|
+
shell: 44,
|
|
563896
|
+
grep_search: 30,
|
|
563897
|
+
find_files: 30,
|
|
563898
|
+
list_directory: 30,
|
|
563899
|
+
web_search: 37,
|
|
563900
|
+
web_fetch: 37,
|
|
563901
|
+
memory_read: 80,
|
|
563902
|
+
memory_write: 80,
|
|
563903
|
+
task_complete: 44,
|
|
563904
|
+
aiwg_setup: 30,
|
|
563905
|
+
aiwg_health: 30,
|
|
563906
|
+
aiwg_workflow: 30,
|
|
563907
|
+
batch_edit: 43,
|
|
563908
|
+
codebase_map: 30,
|
|
563909
|
+
diagnostic: 43,
|
|
563910
|
+
git_info: 30,
|
|
563911
|
+
background_run: 37,
|
|
563912
|
+
task_status: 37,
|
|
563913
|
+
task_output: 37,
|
|
563914
|
+
task_stop: 37,
|
|
563915
|
+
sub_agent: 44,
|
|
563916
|
+
image_read: 80,
|
|
563917
|
+
screenshot: 80,
|
|
563918
|
+
ocr: 80,
|
|
563919
|
+
transcribe_file: 43,
|
|
563920
|
+
transcribe_url: 43,
|
|
563921
|
+
ask_user: 44
|
|
563824
563922
|
};
|
|
563923
|
+
BOX_TL2 = "╭";
|
|
563924
|
+
BOX_TR2 = "╮";
|
|
563925
|
+
BOX_BL2 = "╰";
|
|
563926
|
+
BOX_BR2 = "╯";
|
|
563927
|
+
BOX_H2 = "─";
|
|
563928
|
+
BOX_V2 = "│";
|
|
563929
|
+
BOX_TJ_L2 = "├";
|
|
563930
|
+
BOX_TJ_R2 = "┤";
|
|
563931
|
+
RESET2 = "\x1B[0m";
|
|
563825
563932
|
_contentWriteHook = null;
|
|
563826
563933
|
HINTS = [
|
|
563827
563934
|
"Ask the agent to connect to the Omnius Nexus for P2P agent networking",
|
|
@@ -571409,16 +571516,16 @@ function buildTodoProgressBar(todos, maxWidth) {
|
|
|
571409
571516
|
for (let i2 = 0; i2 < cells; i2++) {
|
|
571410
571517
|
const t2 = todos[i2];
|
|
571411
571518
|
if (t2.status === "completed") {
|
|
571412
|
-
out += `\x1B[1m${DONE_Y}█${
|
|
571519
|
+
out += `\x1B[1m${DONE_Y}█${RESET3}`;
|
|
571413
571520
|
} else if (i2 === inIdx) {
|
|
571414
|
-
out += `${INPROG}▒${
|
|
571521
|
+
out += `${INPROG}▒${RESET3}`;
|
|
571415
571522
|
} else if (i2 === nextIdx && inIdx >= 0) {
|
|
571416
|
-
out += `${NEXT}▒${
|
|
571523
|
+
out += `${NEXT}▒${RESET3}`;
|
|
571417
571524
|
} else {
|
|
571418
|
-
out += `${PEND}░${
|
|
571525
|
+
out += `${PEND}░${RESET3}`;
|
|
571419
571526
|
}
|
|
571420
571527
|
}
|
|
571421
|
-
if (truncated && maxWidth > 0) out += `${DIM_LABEL}…${
|
|
571528
|
+
if (truncated && maxWidth > 0) out += `${DIM_LABEL}…${RESET3}`;
|
|
571422
571529
|
return out;
|
|
571423
571530
|
}
|
|
571424
571531
|
function render() {
|
|
@@ -571440,7 +571547,7 @@ function render() {
|
|
|
571440
571547
|
const total = _lastTodos.length;
|
|
571441
571548
|
const headerColor = ACCENT;
|
|
571442
571549
|
const lines = [];
|
|
571443
|
-
const headerPrefix = `tasks ${headerColor}${completed}/${total}${
|
|
571550
|
+
const headerPrefix = `tasks ${headerColor}${completed}/${total}${RESET3} `;
|
|
571444
571551
|
const headerPrefixWidth = visualLen(headerPrefix);
|
|
571445
571552
|
const maxBarWidth = Math.max(0, cols - 2 - headerPrefixWidth);
|
|
571446
571553
|
const progressBar = buildTodoProgressBar(_lastTodos, maxBarWidth);
|
|
@@ -571452,11 +571559,11 @@ function render() {
|
|
|
571452
571559
|
const contentWidth = Math.max(4, cols - 8);
|
|
571453
571560
|
const contentText = t2.content + (t2.blocker ? ` (blocked: ${t2.blocker})` : "");
|
|
571454
571561
|
const truncated = truncate2(contentText, contentWidth);
|
|
571455
|
-
lines.push(`${color}${mark}${
|
|
571562
|
+
lines.push(`${color}${mark}${RESET3} ${color}${truncated}${RESET3}`);
|
|
571456
571563
|
}
|
|
571457
571564
|
if (_lastTodos.length > visible.length) {
|
|
571458
571565
|
const more = _lastTodos.length - visible.length;
|
|
571459
|
-
lines[lines.length - 1] = `${DIM_LABEL}… +${more} more${
|
|
571566
|
+
lines[lines.length - 1] = `${DIM_LABEL}… +${more} more${RESET3}`;
|
|
571460
571567
|
}
|
|
571461
571568
|
let out = HIDE + SAVE;
|
|
571462
571569
|
const newTop = L.tasksTop;
|
|
@@ -571473,7 +571580,7 @@ function render() {
|
|
|
571473
571580
|
for (let i2 = 0; i2 < lines.length; i2++) {
|
|
571474
571581
|
const row = L.tasksTop + i2;
|
|
571475
571582
|
if (row > L.tasksBottom) break;
|
|
571476
|
-
out += `\x1B[${row};1H${CLEAR_LINE}${BG}${" ".repeat(cols)}\x1B[${row};2H${lines[i2]}${
|
|
571583
|
+
out += `\x1B[${row};1H${CLEAR_LINE}${BG}${" ".repeat(cols)}\x1B[${row};2H${lines[i2]}${RESET3}`;
|
|
571477
571584
|
}
|
|
571478
571585
|
out += RESTORE + SHOW;
|
|
571479
571586
|
try {
|
|
@@ -571501,7 +571608,7 @@ function clearLastPaintedRows() {
|
|
|
571501
571608
|
_lastPaintedTop = -1;
|
|
571502
571609
|
_lastPaintedBottom = -1;
|
|
571503
571610
|
}
|
|
571504
|
-
var chromeWrite, _activeSessionId, _watcher, _lastTodos, _enabled, _redrawScheduled, _onResizeChange, _scopeOverlayActive, _scopeMainViewActive, _scopeNeovimActive, _scopePagerActive, _lastPaintedTop, _lastPaintedBottom, MAX_VISIBLE_ROWS, SAVE, RESTORE, HIDE, SHOW, CLEAR_LINE,
|
|
571611
|
+
var chromeWrite, _activeSessionId, _watcher, _lastTodos, _enabled, _redrawScheduled, _onResizeChange, _scopeOverlayActive, _scopeMainViewActive, _scopeNeovimActive, _scopePagerActive, _lastPaintedTop, _lastPaintedBottom, MAX_VISIBLE_ROWS, SAVE, RESTORE, HIDE, SHOW, CLEAR_LINE, RESET3, BG, DIM_LABEL, ACCENT, DONE2, PENDING, BLOCKED;
|
|
571505
571612
|
var init_tui_tasks_renderer = __esm({
|
|
571506
571613
|
"packages/cli/src/tui/tui-tasks-renderer.ts"() {
|
|
571507
571614
|
"use strict";
|
|
@@ -571528,7 +571635,7 @@ var init_tui_tasks_renderer = __esm({
|
|
|
571528
571635
|
HIDE = "\x1B[?25l";
|
|
571529
571636
|
SHOW = "\x1B[?25h";
|
|
571530
571637
|
CLEAR_LINE = "\x1B[2K";
|
|
571531
|
-
|
|
571638
|
+
RESET3 = "\x1B[0m";
|
|
571532
571639
|
BG = tuiBgSeq();
|
|
571533
571640
|
DIM_LABEL = "";
|
|
571534
571641
|
ACCENT = "";
|
|
@@ -571575,7 +571682,7 @@ function setTerminalTitle(task, version4) {
|
|
|
571575
571682
|
const title = task ? `${task.slice(0, 60)} · ${ver}` : ver;
|
|
571576
571683
|
process.stdout.write(`\x1B]2;${title}\x07`);
|
|
571577
571684
|
}
|
|
571578
|
-
var EXPERT_TOOL_BASELINES, CONTEXT_SWITCH_OVERHEAD, TURN_PLANNING_OVERHEAD, DEFAULT_TOOL_BASELINE, CODE_READ_CHARS_PER_SEC, PROSE_READ_CHARS_PER_SEC, MIN_CONTENT_FOR_READING, CODE_CONTENT_TOOLS, PROSE_CONTENT_TOOLS, HumanSpeedTracker, PANEL_BG_SEQ, CONTENT_BG_SEQ, BOX_FG, TEXT_PRIMARY, TEXT_DIM, NO_SUB_AGENTS_HEADER_LABEL,
|
|
571685
|
+
var EXPERT_TOOL_BASELINES, CONTEXT_SWITCH_OVERHEAD, TURN_PLANNING_OVERHEAD, DEFAULT_TOOL_BASELINE, CODE_READ_CHARS_PER_SEC, PROSE_READ_CHARS_PER_SEC, MIN_CONTENT_FOR_READING, CODE_CONTENT_TOOLS, PROSE_CONTENT_TOOLS, HumanSpeedTracker, PANEL_BG_SEQ, CONTENT_BG_SEQ, BOX_FG, TEXT_PRIMARY, TEXT_DIM, NO_SUB_AGENTS_HEADER_LABEL, BOX_TL3, BOX_TR3, BOX_BL3, BOX_BR3, BOX_H3, BOX_V3, _globalFooterLock, RESET4, CURSOR_BLINK_BLOCK, _isWindows, StatusBar;
|
|
571579
571686
|
var init_status_bar = __esm({
|
|
571580
571687
|
"packages/cli/src/tui/status-bar.ts"() {
|
|
571581
571688
|
"use strict";
|
|
@@ -571754,14 +571861,14 @@ var init_status_bar = __esm({
|
|
|
571754
571861
|
TEXT_PRIMARY = tuiTextPrimary() < 0 ? 252 : tuiTextPrimary();
|
|
571755
571862
|
TEXT_DIM = tuiTextDim();
|
|
571756
571863
|
NO_SUB_AGENTS_HEADER_LABEL = " no sub-agents ";
|
|
571757
|
-
|
|
571758
|
-
|
|
571759
|
-
|
|
571760
|
-
|
|
571761
|
-
|
|
571762
|
-
|
|
571864
|
+
BOX_TL3 = "╭";
|
|
571865
|
+
BOX_TR3 = "╮";
|
|
571866
|
+
BOX_BL3 = "╰";
|
|
571867
|
+
BOX_BR3 = "╯";
|
|
571868
|
+
BOX_H3 = "─";
|
|
571869
|
+
BOX_V3 = "│";
|
|
571763
571870
|
_globalFooterLock = false;
|
|
571764
|
-
|
|
571871
|
+
RESET4 = "\x1B[0m";
|
|
571765
571872
|
CURSOR_BLINK_BLOCK = "\x1B[1 q";
|
|
571766
571873
|
_isWindows = process.platform === "win32";
|
|
571767
571874
|
StatusBar = class _StatusBar {
|
|
@@ -571965,7 +572072,10 @@ var init_status_bar = __esm({
|
|
|
571965
572072
|
this._contentLines.push(sentinel);
|
|
571966
572073
|
if (this._contentLines.length > this._contentMaxLines) {
|
|
571967
572074
|
this._contentLines.splice(0, this._contentLines.length - this._contentMaxLines);
|
|
572075
|
+
this.clampContentScrollOffset();
|
|
571968
572076
|
}
|
|
572077
|
+
if (this._autoScroll && !this._mouseSelecting)
|
|
572078
|
+
this._contentScrollOffset = 0;
|
|
571969
572079
|
if (this.active) this.repaintContent();
|
|
571970
572080
|
}
|
|
571971
572081
|
/** Force a complete footer redraw (public wrapper for renderFooterAndPositionInput).
|
|
@@ -572104,7 +572214,7 @@ var init_status_bar = __esm({
|
|
|
572104
572214
|
const segment = segments[i2];
|
|
572105
572215
|
if (i2 > 0) {
|
|
572106
572216
|
separatorOffsets.push(width);
|
|
572107
|
-
text += `${BOX_FG}${
|
|
572217
|
+
text += `${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
572108
572218
|
width += 1;
|
|
572109
572219
|
}
|
|
572110
572220
|
text += `\x1B[1;38;5;${TEXT_PRIMARY}m${PANEL_BG_SEQ}${segment}`;
|
|
@@ -572286,7 +572396,7 @@ var init_status_bar = __esm({
|
|
|
572286
572396
|
const sysSeparatorOffset = sysItems.reduce((sum, item) => sum + item.w, 0);
|
|
572287
572397
|
this._sysSeparatorOffset = sysSeparatorOffset;
|
|
572288
572398
|
sysItems.push({
|
|
572289
|
-
render: () => `${BOX_FG}│${
|
|
572399
|
+
render: () => `${BOX_FG}│${RESET4}${PANEL_BG_SEQ} `,
|
|
572290
572400
|
w: 2
|
|
572291
572401
|
});
|
|
572292
572402
|
const voiceLabel = this._voiceActive ? ` ${this._voiceModelId || "voice"} ` : " voice ";
|
|
@@ -572483,7 +572593,7 @@ var init_status_bar = __esm({
|
|
|
572483
572593
|
const hdrRow = layout().headerContent;
|
|
572484
572594
|
let buf = "\x1B7";
|
|
572485
572595
|
buf += `\x1B[${hdrRow};1H${PANEL_BG_SEQ}\x1B[2K`;
|
|
572486
|
-
buf += `${BOX_FG}│${
|
|
572596
|
+
buf += `${BOX_FG}│${RESET4}${PANEL_BG_SEQ}`;
|
|
572487
572597
|
if (chrome.showPrev) {
|
|
572488
572598
|
buf += leftArrow;
|
|
572489
572599
|
buf += ` `;
|
|
@@ -572494,7 +572604,7 @@ var init_status_bar = __esm({
|
|
|
572494
572604
|
buf += `\x1B[${hdrRow};${w - 1}H`;
|
|
572495
572605
|
buf += rightArrow;
|
|
572496
572606
|
}
|
|
572497
|
-
buf += `\x1B[${hdrRow};${w}H${BOX_FG}│${
|
|
572607
|
+
buf += `\x1B[${hdrRow};${w}H${BOX_FG}│${RESET4}${PANEL_BG_SEQ}`;
|
|
572498
572608
|
buf += "\x1B8";
|
|
572499
572609
|
this.termWrite(buf);
|
|
572500
572610
|
}
|
|
@@ -573533,6 +573643,7 @@ var init_status_bar = __esm({
|
|
|
573533
573643
|
this._activeViewId = id;
|
|
573534
573644
|
this._contentLines = view.contentLines;
|
|
573535
573645
|
this._contentScrollOffset = view.scrollOffset;
|
|
573646
|
+
this.clampContentScrollOffset();
|
|
573536
573647
|
Promise.resolve().then(() => (init_tui_tasks_renderer(), tui_tasks_renderer_exports)).then((m2) => m2.setTuiTasksScope({ mainViewActive: id === "main" })).catch(() => {
|
|
573537
573648
|
});
|
|
573538
573649
|
this.repaintContent();
|
|
@@ -573697,11 +573808,11 @@ var init_status_bar = __esm({
|
|
|
573697
573808
|
for (let i2 = 0; i2 < inputWrap.lines.length; i2++) {
|
|
573698
573809
|
const row = pos.inputStartRow + i2;
|
|
573699
573810
|
const prefix = i2 === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
573700
|
-
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${prefix}${inputWrap.lines[i2]}${
|
|
573811
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${prefix}${inputWrap.lines[i2]}${RESET4}${PANEL_BG_SEQ}`;
|
|
573701
573812
|
}
|
|
573702
573813
|
const boxInnerP = w - 2;
|
|
573703
|
-
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
573704
|
-
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${
|
|
573814
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL3}${BOX_H3.repeat(Math.max(0, boxInnerP))}${BOX_BR3}${RESET4}${PANEL_BG_SEQ}`;
|
|
573815
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET4}${PANEL_BG_SEQ}\x1B[?7h\x1B[${pos.inputStartRow};1H`;
|
|
573705
573816
|
this.termWrite(buf);
|
|
573706
573817
|
if (this._bannerRefresh) this._bannerRefresh();
|
|
573707
573818
|
} else {
|
|
@@ -573902,7 +574013,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
573902
574013
|
process.stdout.write = this._origWrite;
|
|
573903
574014
|
this._origWrite = null;
|
|
573904
574015
|
}
|
|
573905
|
-
process.stdout.write(
|
|
574016
|
+
process.stdout.write(RESET4);
|
|
573906
574017
|
this._brailleSpinner.setMetrics({ isStreaming: false });
|
|
573907
574018
|
this.renderFooterAndPositionInput();
|
|
573908
574019
|
this.parkCursorInInput();
|
|
@@ -573980,10 +574091,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
573980
574091
|
this._contentLines.length - this._contentMaxLines
|
|
573981
574092
|
);
|
|
573982
574093
|
if (this._contentScrollOffset > 0) {
|
|
573983
|
-
this.
|
|
573984
|
-
this._contentScrollOffset,
|
|
573985
|
-
Math.max(0, this._contentLines.length - this.contentHeight)
|
|
573986
|
-
);
|
|
574094
|
+
this.clampContentScrollOffset();
|
|
573987
574095
|
}
|
|
573988
574096
|
}
|
|
573989
574097
|
if (this._autoScroll && !this._mouseSelecting)
|
|
@@ -574116,7 +574224,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574116
574224
|
const endRaw = this.rawIndexForVisibleColumn(line, end);
|
|
574117
574225
|
const activeStyle = this.activeSgrAt(line, startRaw);
|
|
574118
574226
|
const raw = line.slice(startRaw, endRaw);
|
|
574119
|
-
return activeStyle ? `${activeStyle}${raw}${
|
|
574227
|
+
return activeStyle ? `${activeStyle}${raw}${RESET4}` : raw;
|
|
574120
574228
|
}
|
|
574121
574229
|
rawIndexForVisibleColumn(line, target) {
|
|
574122
574230
|
if (target <= 0) return 0;
|
|
@@ -574140,7 +574248,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574140
574248
|
let match;
|
|
574141
574249
|
while ((match = sgr.exec(line)) && match.index < rawIndex) {
|
|
574142
574250
|
const seq = match[0];
|
|
574143
|
-
if (seq ===
|
|
574251
|
+
if (seq === RESET4 || /\x1B\[(?:0|39|49)(?:;0)?m/.test(seq)) {
|
|
574144
574252
|
active = "";
|
|
574145
574253
|
} else {
|
|
574146
574254
|
active += seq;
|
|
@@ -574167,6 +574275,17 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574167
574275
|
const L = layout();
|
|
574168
574276
|
return Math.max(1, L.contentBottom - this.scrollRegionTop + 1);
|
|
574169
574277
|
}
|
|
574278
|
+
maxContentScrollOffset(width = termCols(), livePartialLine = this.getLiveBufferedLine()) {
|
|
574279
|
+
return Math.max(
|
|
574280
|
+
0,
|
|
574281
|
+
this.reflowContentLines(livePartialLine, width).length - this.contentHeight
|
|
574282
|
+
);
|
|
574283
|
+
}
|
|
574284
|
+
clampContentScrollOffset(width = termCols()) {
|
|
574285
|
+
const maxOffset = this.maxContentScrollOffset(width);
|
|
574286
|
+
this._contentScrollOffset = Math.min(this._contentScrollOffset, maxOffset);
|
|
574287
|
+
if (this._contentScrollOffset === 0) this._autoScroll = true;
|
|
574288
|
+
}
|
|
574170
574289
|
/** Whether user has scrolled back from live */
|
|
574171
574290
|
get isScrolledBack() {
|
|
574172
574291
|
return this._contentScrollOffset > 0;
|
|
@@ -574177,10 +574296,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574177
574296
|
this.cancelMouseIdle();
|
|
574178
574297
|
this.enableMouseTracking();
|
|
574179
574298
|
this._autoScroll = false;
|
|
574180
|
-
const maxOffset =
|
|
574181
|
-
0,
|
|
574182
|
-
this._contentLines.length - this.contentHeight
|
|
574183
|
-
);
|
|
574299
|
+
const maxOffset = this.maxContentScrollOffset();
|
|
574184
574300
|
this._contentScrollOffset = Math.min(
|
|
574185
574301
|
maxOffset,
|
|
574186
574302
|
this._contentScrollOffset + lines
|
|
@@ -574193,7 +574309,10 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574193
574309
|
if (!this.active) return;
|
|
574194
574310
|
this.cancelMouseIdle();
|
|
574195
574311
|
this.enableMouseTracking();
|
|
574196
|
-
this._contentScrollOffset = Math.
|
|
574312
|
+
this._contentScrollOffset = Math.min(
|
|
574313
|
+
this.maxContentScrollOffset(),
|
|
574314
|
+
Math.max(0, this._contentScrollOffset - lines)
|
|
574315
|
+
);
|
|
574197
574316
|
if (this._contentScrollOffset === 0) this._autoScroll = true;
|
|
574198
574317
|
this._syncPagerScope();
|
|
574199
574318
|
this.repaintContent();
|
|
@@ -574241,6 +574360,11 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574241
574360
|
const w = termCols();
|
|
574242
574361
|
const reflowedLines = this.reflowContentLines(livePartialLine, w);
|
|
574243
574362
|
const totalLines = reflowedLines.length;
|
|
574363
|
+
const maxOffset = Math.max(0, totalLines - h);
|
|
574364
|
+
if (this._contentScrollOffset > maxOffset) {
|
|
574365
|
+
this._contentScrollOffset = maxOffset;
|
|
574366
|
+
if (this._contentScrollOffset === 0) this._autoScroll = true;
|
|
574367
|
+
}
|
|
574244
574368
|
const startIdx = Math.max(0, totalLines - h - this._contentScrollOffset);
|
|
574245
574369
|
const headerSafeFloor = layout().headerBottom + 1;
|
|
574246
574370
|
let buf = "\x1B[?2026h";
|
|
@@ -574915,21 +575039,21 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574915
575039
|
const inputWrap = this.wrapInput(w);
|
|
574916
575040
|
let buf = "\x1B[?7l";
|
|
574917
575041
|
const boxInner = w - 2;
|
|
574918
|
-
buf += `\x1B[${pos.inputStartRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575042
|
+
buf += `\x1B[${pos.inputStartRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_TL3}${BOX_H3.repeat(Math.max(0, boxInner))}${BOX_TR3}${RESET4}${PANEL_BG_SEQ}`;
|
|
574919
575043
|
const Lspacer = layout();
|
|
574920
575044
|
const spacerRow = pos.inputStartRow - 1;
|
|
574921
575045
|
const tasksOccupiesSpacer = Lspacer.tasksHeight > 0 && spacerRow >= Lspacer.tasksTop && spacerRow <= Lspacer.tasksBottom;
|
|
574922
575046
|
if (spacerRow >= this.scrollRegionTop && !tasksOccupiesSpacer) {
|
|
574923
|
-
buf += `\x1B[${spacerRow};1H${PANEL_BG_SEQ}\x1B[2K${
|
|
575047
|
+
buf += `\x1B[${spacerRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET4}`;
|
|
574924
575048
|
}
|
|
574925
575049
|
for (let i2 = 0; i2 < inputWrap.lines.length; i2++) {
|
|
574926
575050
|
const row = pos.inputStartRow + 1 + i2;
|
|
574927
575051
|
const prefix = i2 === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
574928
575052
|
const lineContent = `${prefix}${inputWrap.lines[i2]}`;
|
|
574929
575053
|
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K`;
|
|
574930
|
-
buf += `${BOX_FG}${
|
|
575054
|
+
buf += `${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}${lineContent}`;
|
|
574931
575055
|
buf += `${PANEL_BG_SEQ}\x1B[K`;
|
|
574932
|
-
buf += `\x1B[${row};${w}H${BOX_FG}${
|
|
575056
|
+
buf += `\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
574933
575057
|
}
|
|
574934
575058
|
const cursorTermRow = pos.inputStartRow + 1 + inputWrap.cursorRow;
|
|
574935
575059
|
if (this._suggestions.length > 0 && pos.suggestStartRow > 0) {
|
|
@@ -574941,17 +575065,17 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574941
575065
|
const fg2 = isHighlighted ? `\x1B[1;38;5;${TEXT_PRIMARY}m` : `\x1B[38;5;${TEXT_PRIMARY}m`;
|
|
574942
575066
|
const slash = isHighlighted ? `\x1B[38;5;245m` : `\x1B[38;5;${TEXT_DIM}m`;
|
|
574943
575067
|
const marker = isHighlighted ? `\x1B[38;5;${TEXT_PRIMARY}m› ` : " ";
|
|
574944
|
-
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575068
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
574945
575069
|
buf += `${bg} ${marker}${slash}/${fg2}${cmd}`;
|
|
574946
575070
|
buf += `${PANEL_BG_SEQ}\x1B[K`;
|
|
574947
|
-
buf += `\x1B[${row};${w}H${BOX_FG}${
|
|
575071
|
+
buf += `\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
574948
575072
|
}
|
|
574949
575073
|
const suggestBottomRow = pos.suggestStartRow + this._suggestions.length;
|
|
574950
|
-
buf += `\x1B[${suggestBottomRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575074
|
+
buf += `\x1B[${suggestBottomRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL3}${BOX_H3.repeat(Math.max(0, boxInner))}${BOX_BR3}${RESET4}${PANEL_BG_SEQ}`;
|
|
574951
575075
|
} else {
|
|
574952
|
-
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575076
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL3}${BOX_H3.repeat(Math.max(0, boxInner))}${BOX_BR3}${RESET4}${PANEL_BG_SEQ}`;
|
|
574953
575077
|
}
|
|
574954
|
-
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${
|
|
575078
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET4}${PANEL_BG_SEQ}`;
|
|
574955
575079
|
buf += "\x1B[?7h";
|
|
574956
575080
|
if (this.writeDepth === 0) {
|
|
574957
575081
|
buf += `\x1B[${cursorTermRow};${inputWrap.cursorCol}H${CURSOR_BLINK_BLOCK}\x1B[?25h`;
|
|
@@ -574984,7 +575108,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574984
575108
|
const pos = this.rowPositions(termRows());
|
|
574985
575109
|
let buf = "\x1B7\x1B[?7l";
|
|
574986
575110
|
if (pos.tabBarRow > 0) {
|
|
574987
|
-
buf += `\x1B[${pos.tabBarRow};1H${PANEL_BG_SEQ}\x1B[2K${
|
|
575111
|
+
buf += `\x1B[${pos.tabBarRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET4}`;
|
|
574988
575112
|
}
|
|
574989
575113
|
const boxInnerR = w - 2;
|
|
574990
575114
|
if (this._suggestions.length > 0 && pos.suggestStartRow > 0) {
|
|
@@ -574994,14 +575118,14 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574994
575118
|
const isHl = si === this._suggestIndex;
|
|
574995
575119
|
const fg2 = isHl ? `\x1B[1;38;5;${TEXT_PRIMARY}m` : `\x1B[38;5;${TEXT_PRIMARY}m`;
|
|
574996
575120
|
const marker = isHl ? `\x1B[38;5;${TEXT_PRIMARY}m› ` : " ";
|
|
574997
|
-
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
574998
|
-
buf += `${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${
|
|
575121
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ} ${marker}\x1B[38;5;${TEXT_DIM}m/${fg2}${cmd}`;
|
|
575122
|
+
buf += `${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}`;
|
|
574999
575123
|
}
|
|
575000
|
-
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575124
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL3}${BOX_H3.repeat(Math.max(0, boxInnerR))}${BOX_BR3}${RESET4}`;
|
|
575001
575125
|
} else {
|
|
575002
|
-
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575126
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL3}${BOX_H3.repeat(Math.max(0, boxInnerR))}${BOX_BR3}${RESET4}`;
|
|
575003
575127
|
}
|
|
575004
|
-
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${
|
|
575128
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET4}${PANEL_BG_SEQ}\x1B[?7h\x1B8` + // DEC restore cursor
|
|
575005
575129
|
(this.writeDepth === 0 ? `${CURSOR_BLINK_BLOCK}\x1B[?25h` : "");
|
|
575006
575130
|
this.termWrite(buf);
|
|
575007
575131
|
if (pos.tabBarRow > 0) this.renderAgentTabs();
|
|
@@ -575045,12 +575169,12 @@ ${CONTENT_BG_SEQ}`);
|
|
|
575045
575169
|
}
|
|
575046
575170
|
buf += "\x1B[?7l";
|
|
575047
575171
|
const boxInnerH = w - 2;
|
|
575048
|
-
buf += `\x1B[${pos.inputStartRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575172
|
+
buf += `\x1B[${pos.inputStartRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_TL3}${BOX_H3.repeat(Math.max(0, boxInnerH))}${BOX_TR3}${RESET4}`;
|
|
575049
575173
|
for (let i2 = 0; i2 < inputWrap.lines.length; i2++) {
|
|
575050
575174
|
const row = pos.inputStartRow + 1 + i2;
|
|
575051
575175
|
const prefix = i2 === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
575052
575176
|
const lineContent = `${prefix}${inputWrap.lines[i2]}`;
|
|
575053
|
-
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575177
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}${lineContent}${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}`;
|
|
575054
575178
|
}
|
|
575055
575179
|
if (this._suggestions.length > 0 && pos.suggestStartRow > 0) {
|
|
575056
575180
|
for (let si = 0; si < this._suggestions.length; si++) {
|
|
@@ -575060,14 +575184,14 @@ ${CONTENT_BG_SEQ}`);
|
|
|
575060
575184
|
const bg = isHl ? `\x1B[48;5;235m` : PANEL_BG_SEQ;
|
|
575061
575185
|
const fg2 = isHl ? `\x1B[1;38;5;${TEXT_PRIMARY}m` : `\x1B[38;5;${TEXT_PRIMARY}m`;
|
|
575062
575186
|
const marker = isHl ? `\x1B[38;5;${TEXT_PRIMARY}m› ` : " ";
|
|
575063
|
-
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575187
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
575064
575188
|
buf += `${bg} ${marker}\x1B[38;5;${TEXT_DIM}m/${fg2}${cmd}`;
|
|
575065
|
-
buf += `${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${
|
|
575189
|
+
buf += `${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}`;
|
|
575066
575190
|
}
|
|
575067
575191
|
}
|
|
575068
575192
|
const boxInnerS = w - 2;
|
|
575069
|
-
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575070
|
-
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${
|
|
575193
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL3}${BOX_H3.repeat(Math.max(0, boxInnerS))}${BOX_BR3}${RESET4}`;
|
|
575194
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET4}`;
|
|
575071
575195
|
buf += "\x1B[?7h";
|
|
575072
575196
|
buf += "\x1B8";
|
|
575073
575197
|
if (heightDelta > 0) {
|
|
@@ -575079,17 +575203,34 @@ ${CONTENT_BG_SEQ}`);
|
|
|
575079
575203
|
w1.call(process.stdout, buf);
|
|
575080
575204
|
if (heightDelta !== 0) this.refreshTasksPanelAfterLayoutChange();
|
|
575081
575205
|
} else {
|
|
575082
|
-
let buf = "\x1B[?7l";
|
|
575206
|
+
let buf = "\x1B7\x1B[?25l\x1B[?7l";
|
|
575207
|
+
const boxInnerH = w - 2;
|
|
575208
|
+
buf += `\x1B[${pos.inputStartRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_TL3}${BOX_H3.repeat(Math.max(0, boxInnerH))}${BOX_TR3}${RESET4}${PANEL_BG_SEQ}`;
|
|
575083
575209
|
for (let i2 = 0; i2 < inputWrap.lines.length; i2++) {
|
|
575084
575210
|
const row = pos.inputStartRow + 1 + i2;
|
|
575085
575211
|
const prefix = i2 === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
575086
575212
|
const lineContent = `${prefix}${inputWrap.lines[i2]}`;
|
|
575087
575213
|
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K`;
|
|
575088
|
-
buf += `${BOX_FG}${
|
|
575214
|
+
buf += `${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}${lineContent}`;
|
|
575089
575215
|
buf += `${PANEL_BG_SEQ}\x1B[K`;
|
|
575090
|
-
buf += `\x1B[${row};${w}H${BOX_FG}${
|
|
575216
|
+
buf += `\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
575091
575217
|
}
|
|
575092
|
-
|
|
575218
|
+
if (this._suggestions.length > 0 && pos.suggestStartRow > 0) {
|
|
575219
|
+
for (let si = 0; si < this._suggestions.length; si++) {
|
|
575220
|
+
const row = pos.suggestStartRow + si;
|
|
575221
|
+
const cmd = this._suggestions[si];
|
|
575222
|
+
const isHl = si === this._suggestIndex;
|
|
575223
|
+
const bg = isHl ? `\x1B[48;5;235m` : PANEL_BG_SEQ;
|
|
575224
|
+
const fg2 = isHl ? `\x1B[1;38;5;${TEXT_PRIMARY}m` : `\x1B[38;5;${TEXT_PRIMARY}m`;
|
|
575225
|
+
const marker = isHl ? `\x1B[38;5;${TEXT_PRIMARY}m› ` : " ";
|
|
575226
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
575227
|
+
buf += `${bg} ${marker}\x1B[38;5;${TEXT_DIM}m/${fg2}${cmd}`;
|
|
575228
|
+
buf += `${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
575229
|
+
}
|
|
575230
|
+
}
|
|
575231
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL3}${BOX_H3.repeat(Math.max(0, boxInnerH))}${BOX_BR3}${RESET4}${PANEL_BG_SEQ}`;
|
|
575232
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET4}${PANEL_BG_SEQ}`;
|
|
575233
|
+
buf += "\x1B[?7h\x1B8\x1B[?25l";
|
|
575093
575234
|
this.termWrite(buf);
|
|
575094
575235
|
}
|
|
575095
575236
|
}
|
|
@@ -578237,13 +578378,13 @@ ${c3.cyan(OMNIUS_FIRST_RUN_BANNER)}
|
|
|
578237
578378
|
const sw = 24;
|
|
578238
578379
|
const boxW = 52;
|
|
578239
578380
|
const boxLine = (content) => {
|
|
578240
|
-
const visLen =
|
|
578381
|
+
const visLen = visibleLen2(content);
|
|
578241
578382
|
const pad = Math.max(0, boxW - visLen);
|
|
578242
578383
|
return ` ${c3.dim("│")}${content}${" ".repeat(pad)}${c3.dim("│")}
|
|
578243
578384
|
`;
|
|
578244
578385
|
};
|
|
578245
578386
|
const boxWrappedDimLine = (content, indent = " ") => {
|
|
578246
|
-
const lines = wrapText(content, Math.max(1, boxW -
|
|
578387
|
+
const lines = wrapText(content, Math.max(1, boxW - visibleLen2(indent)));
|
|
578247
578388
|
for (const line of lines) {
|
|
578248
578389
|
process.stdout.write(boxLine(`${indent}${c3.dim(line)}`));
|
|
578249
578390
|
}
|
|
@@ -579498,7 +579639,7 @@ export PATH="${binDir}:$PATH" # Added by omnius for nvim
|
|
|
579498
579639
|
} catch {
|
|
579499
579640
|
}
|
|
579500
579641
|
}
|
|
579501
|
-
var execAsync2, OMNIUS_FIRST_RUN_BANNER, ANSI_RE,
|
|
579642
|
+
var execAsync2, OMNIUS_FIRST_RUN_BANNER, ANSI_RE, visibleLen2, QWEN_VARIANTS, _toolSupportCache, _cloudflaredInstallPromise;
|
|
579502
579643
|
var init_setup = __esm({
|
|
579503
579644
|
"packages/cli/src/tui/setup.ts"() {
|
|
579504
579645
|
"use strict";
|
|
@@ -579518,7 +579659,7 @@ var init_setup = __esm({
|
|
|
579518
579659
|
" ░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓██████▓▒░░▒▓███████▓▒░ "
|
|
579519
579660
|
].join("\n");
|
|
579520
579661
|
ANSI_RE = /\x1B\[[0-?]*[ -/]*[@-~]/g;
|
|
579521
|
-
|
|
579662
|
+
visibleLen2 = (value2) => Array.from(value2.replace(ANSI_RE, "")).length;
|
|
579522
579663
|
QWEN_VARIANTS = [
|
|
579523
579664
|
{ tag: "qwen3.5:0.8b", sizeGB: 1, label: "0.8B params (1.0 GB)", cloud: false },
|
|
579524
579665
|
{ tag: "qwen3.5:2b", sizeGB: 2.7, label: "2B params (2.7 GB)", cloud: false },
|
|
@@ -603127,30 +603268,30 @@ function getNodeMnemonic() {
|
|
|
603127
603268
|
function createDefaultBanner(version4 = "0.120.0") {
|
|
603128
603269
|
const width = termCols();
|
|
603129
603270
|
const rows = headerHeight();
|
|
603130
|
-
const
|
|
603271
|
+
const accent = tuiAccent() < 0 ? -1 : tuiAccent();
|
|
603131
603272
|
const bgBlack = tuiBg() < 0 ? -1 : tuiBg();
|
|
603132
603273
|
const grid = [];
|
|
603133
603274
|
const innerW = width - 2;
|
|
603134
603275
|
const topRow = [];
|
|
603135
|
-
topRow.push({ char: "╭", fg:
|
|
603276
|
+
topRow.push({ char: "╭", fg: accent, bg: bgBlack, bold: false });
|
|
603136
603277
|
for (let c9 = 0; c9 < innerW; c9++) {
|
|
603137
|
-
topRow.push({ char: "─", fg:
|
|
603278
|
+
topRow.push({ char: "─", fg: accent, bg: bgBlack, bold: false });
|
|
603138
603279
|
}
|
|
603139
|
-
topRow.push({ char: "╮", fg:
|
|
603280
|
+
topRow.push({ char: "╮", fg: accent, bg: bgBlack, bold: false });
|
|
603140
603281
|
grid.push(topRow);
|
|
603141
603282
|
const midRow = [];
|
|
603142
|
-
midRow.push({ char: "│", fg:
|
|
603283
|
+
midRow.push({ char: "│", fg: accent, bg: bgBlack, bold: false });
|
|
603143
603284
|
for (let c9 = 0; c9 < innerW; c9++) {
|
|
603144
603285
|
midRow.push({ char: " ", fg: 0, bg: bgBlack, bold: false });
|
|
603145
603286
|
}
|
|
603146
|
-
midRow.push({ char: "│", fg:
|
|
603287
|
+
midRow.push({ char: "│", fg: accent, bg: bgBlack, bold: false });
|
|
603147
603288
|
grid.push(midRow);
|
|
603148
603289
|
const botRow = [];
|
|
603149
|
-
botRow.push({ char: "╰", fg:
|
|
603290
|
+
botRow.push({ char: "╰", fg: accent, bg: bgBlack, bold: false });
|
|
603150
603291
|
for (let c9 = 0; c9 < innerW; c9++) {
|
|
603151
|
-
botRow.push({ char: "─", fg:
|
|
603292
|
+
botRow.push({ char: "─", fg: accent, bg: bgBlack, bold: false });
|
|
603152
603293
|
}
|
|
603153
|
-
botRow.push({ char: "╯", fg:
|
|
603294
|
+
botRow.push({ char: "╯", fg: accent, bg: bgBlack, bold: false });
|
|
603154
603295
|
grid.push(botRow);
|
|
603155
603296
|
return {
|
|
603156
603297
|
id: "default-header",
|
|
@@ -649955,15 +650096,8 @@ ${entry.fullContent}`
|
|
|
649955
650096
|
event.toolName ?? "unknown",
|
|
649956
650097
|
event.success ?? false,
|
|
649957
650098
|
displayContent,
|
|
649958
|
-
config.verbose
|
|
650099
|
+
{ verbose: config.verbose, durationMs: toolDurationMs }
|
|
649959
650100
|
);
|
|
649960
|
-
if (config.verbose && toolDurationMs > 0) {
|
|
649961
|
-
const durStr = toolDurationMs < 1e3 ? `${toolDurationMs}ms` : `${(toolDurationMs / 1e3).toFixed(1)}s`;
|
|
649962
|
-
const sizeStr = resultLen > 0 ? ` | ${resultLen.toLocaleString()} chars (~${Math.ceil(resultLen / 4).toLocaleString()} tokens)` : "";
|
|
649963
|
-
renderVerbose(
|
|
649964
|
-
`${event.toolName ?? "unknown"}: ${durStr}${sizeStr}`
|
|
649965
|
-
);
|
|
649966
|
-
}
|
|
649967
650101
|
if (voice?.enabled && event.toolName !== "task_complete" && !displayContent.includes("[FORCED PROGRESS BLOCK") && (voice.voiceMode === "action" || voice.voiceMode === "verbose")) {
|
|
649968
650102
|
const emoState2 = emotionEngine?.getState();
|
|
649969
650103
|
const emoCtx2 = emoState2 ? {
|
|
@@ -651301,13 +651435,21 @@ ${result.summary}`
|
|
|
651301
651435
|
end: () => statusBar.endContentWrite(),
|
|
651302
651436
|
// During overlays, send render output to the alternate screen via overlayWrite;
|
|
651303
651437
|
// in neovim mode, route to the Agent Output pane. Otherwise, null (normal).
|
|
651304
|
-
redirect: () => isOverlayActive() ? overlayWrite : isNeovimActive() ? writeToNeovimOutput : null
|
|
651438
|
+
redirect: () => isOverlayActive() ? overlayWrite : isNeovimActive() ? writeToNeovimOutput : null,
|
|
651439
|
+
dynamicBlockHost: () => statusBar.isActive && !isOverlayActive() && !isNeovimActive() ? {
|
|
651440
|
+
registerDynamicBlock: (id, render2) => statusBar.registerDynamicBlock(id, render2),
|
|
651441
|
+
appendDynamicBlock: (id) => statusBar.appendDynamicBlock(id)
|
|
651442
|
+
} : null
|
|
651305
651443
|
});
|
|
651306
651444
|
}
|
|
651307
651445
|
setContentWriteHook({
|
|
651308
651446
|
begin: () => statusBar.beginContentWrite(),
|
|
651309
651447
|
end: () => statusBar.endContentWrite(),
|
|
651310
|
-
redirect: () => isNeovimActive() ? writeToNeovimOutput : null
|
|
651448
|
+
redirect: () => isNeovimActive() ? writeToNeovimOutput : null,
|
|
651449
|
+
dynamicBlockHost: () => statusBar.isActive && !isOverlayActive() && !isNeovimActive() ? {
|
|
651450
|
+
registerDynamicBlock: (id, render2) => statusBar.registerDynamicBlock(id, render2),
|
|
651451
|
+
appendDynamicBlock: (id) => statusBar.appendDynamicBlock(id)
|
|
651452
|
+
} : null
|
|
651311
651453
|
});
|
|
651312
651454
|
let resolvedContextWindowSize = 0;
|
|
651313
651455
|
queryContextSize(config.backendUrl, config.model, config.apiKey).then((ctxSize) => {
|
|
@@ -655131,9 +655273,6 @@ ${result.content.slice(0, 2e3)}${result.content.length > 2e3 ? "\n[truncated]" :
|
|
|
655131
655273
|
if (!setupReady) return;
|
|
655132
655274
|
persistHistoryLine(line);
|
|
655133
655275
|
const input = line.trim();
|
|
655134
|
-
if (statusBar?.isActive && line.length > 0) {
|
|
655135
|
-
statusBar.redrawFooter();
|
|
655136
|
-
}
|
|
655137
655276
|
if (!input) {
|
|
655138
655277
|
if (pasteBuffer.length > 0) {
|
|
655139
655278
|
if (pasteIndicatorShown) {
|