omnius 1.0.91 → 1.0.93
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 +665 -408
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -562459,9 +562459,11 @@ var init_text_selection = __esm({
|
|
|
562459
562459
|
var task_complete_box_exports = {};
|
|
562460
562460
|
__export(task_complete_box_exports, {
|
|
562461
562461
|
buildBoxLines: () => buildBoxLines,
|
|
562462
|
+
buildSessionHistoryBoxLines: () => buildSessionHistoryBoxLines,
|
|
562462
562463
|
deriveTitle: () => deriveTitle,
|
|
562463
562464
|
detectProvenanceAnchors: () => detectProvenanceAnchors,
|
|
562464
562465
|
detectTestRuns: () => detectTestRuns,
|
|
562466
|
+
renderSessionHistoryBox: () => renderSessionHistoryBox,
|
|
562465
562467
|
renderTaskCompleteBox: () => renderTaskCompleteBox
|
|
562466
562468
|
});
|
|
562467
562469
|
function deriveTitle(task) {
|
|
@@ -562506,6 +562508,37 @@ function buildMetricsChip(data) {
|
|
|
562506
562508
|
}
|
|
562507
562509
|
return parts.join(" · ");
|
|
562508
562510
|
}
|
|
562511
|
+
function formatShortTimestamp(value2) {
|
|
562512
|
+
if (!value2) return "unknown";
|
|
562513
|
+
const date = new Date(value2);
|
|
562514
|
+
if (Number.isNaN(date.getTime())) return "unknown";
|
|
562515
|
+
return date.toISOString().slice(0, 16).replace("T", " ");
|
|
562516
|
+
}
|
|
562517
|
+
function buildSessionHistoryMetricsChip(data) {
|
|
562518
|
+
const total = data.totalEntries ?? data.entries.length;
|
|
562519
|
+
const completed = data.entries.filter((entry) => entry.completed).length;
|
|
562520
|
+
const parts = [];
|
|
562521
|
+
parts.push(`${total} entr${total === 1 ? "y" : "ies"}`);
|
|
562522
|
+
if (completed > 0) parts.push(`${completed} done`);
|
|
562523
|
+
if (data.updatedAt) parts.push(`updated ${formatShortTimestamp(data.updatedAt)}`);
|
|
562524
|
+
return parts.join(" · ");
|
|
562525
|
+
}
|
|
562526
|
+
function compactDisplayText(value2, maxLen) {
|
|
562527
|
+
const text = String(value2 ?? "").replace(/\s+/g, " ").trim();
|
|
562528
|
+
if (text.length <= maxLen) return text;
|
|
562529
|
+
return text.slice(0, Math.max(1, maxLen - 1)) + "…";
|
|
562530
|
+
}
|
|
562531
|
+
function uniqueNonEmpty(values) {
|
|
562532
|
+
const seen = /* @__PURE__ */ new Set();
|
|
562533
|
+
const out = [];
|
|
562534
|
+
for (const value2 of values) {
|
|
562535
|
+
const clean5 = compactDisplayText(value2, 220);
|
|
562536
|
+
if (!clean5 || seen.has(clean5)) continue;
|
|
562537
|
+
seen.add(clean5);
|
|
562538
|
+
out.push(clean5);
|
|
562539
|
+
}
|
|
562540
|
+
return out;
|
|
562541
|
+
}
|
|
562509
562542
|
function wrapToWidth(text, width) {
|
|
562510
562543
|
if (width <= 0) return [text];
|
|
562511
562544
|
const out = [];
|
|
@@ -562654,6 +562687,51 @@ function buildBoxLines(data, width) {
|
|
|
562654
562687
|
lines.push(buildBottomBorder(w));
|
|
562655
562688
|
return lines;
|
|
562656
562689
|
}
|
|
562690
|
+
function buildSessionHistoryBoxLines(data, width) {
|
|
562691
|
+
const w = Math.max(40, width);
|
|
562692
|
+
const title = deriveTitle(data.title || "Session History");
|
|
562693
|
+
const metrics2 = buildSessionHistoryMetricsChip(data);
|
|
562694
|
+
const entries = data.entries.slice(-8);
|
|
562695
|
+
const lines = [];
|
|
562696
|
+
const innerWidth = Math.max(1, w - 4);
|
|
562697
|
+
lines.push(buildTopBorder(`${GREEN}✔${RESET} ${title}`, metrics2, w));
|
|
562698
|
+
lines.push(buildInnerDivider(w));
|
|
562699
|
+
lines.push(buildEmptyRow(w));
|
|
562700
|
+
const bodyLines = [];
|
|
562701
|
+
if (entries.length === 0) {
|
|
562702
|
+
bodyLines.push("No session history found.");
|
|
562703
|
+
} else {
|
|
562704
|
+
for (const entry of entries) {
|
|
562705
|
+
const status = entry.completed ? "✔" : "○";
|
|
562706
|
+
const task = compactDisplayText(entry.task || entry.summary || "Untitled session", 180);
|
|
562707
|
+
bodyLines.push(`${status} [${formatShortTimestamp(entry.savedAt)}] ${task}`);
|
|
562708
|
+
const summary = compactDisplayText(entry.summary, 220);
|
|
562709
|
+
if (summary) bodyLines.push(` Summary: ${summary}`);
|
|
562710
|
+
const model = compactDisplayText(entry.model, 80);
|
|
562711
|
+
const calls = Number.isFinite(entry.toolCalls) && (entry.toolCalls ?? 0) > 0 ? `${entry.toolCalls} call${entry.toolCalls === 1 ? "" : "s"}` : "";
|
|
562712
|
+
const meta = [model, calls].filter(Boolean).join(" · ");
|
|
562713
|
+
if (meta) bodyLines.push(` ${meta}`);
|
|
562714
|
+
}
|
|
562715
|
+
}
|
|
562716
|
+
for (const line of bodyLines) {
|
|
562717
|
+
for (const wrapped of wrapToWidth(line, innerWidth)) {
|
|
562718
|
+
lines.push(buildContentRow(wrapped, w));
|
|
562719
|
+
}
|
|
562720
|
+
}
|
|
562721
|
+
lines.push(buildEmptyRow(w));
|
|
562722
|
+
const footerFiles = uniqueNonEmpty(entries.flatMap((entry) => entry.filesModified ?? [])).slice(0, 16);
|
|
562723
|
+
const footerTools = uniqueNonEmpty(entries.flatMap((entry) => entry.toolsUsed ?? [])).slice(0, 16);
|
|
562724
|
+
const footerProvenance = uniqueNonEmpty(entries.map((entry) => entry.provenance)).slice(0, 8);
|
|
562725
|
+
const hasFooter = footerFiles.length > 0 || footerTools.length > 0 || footerProvenance.length > 0;
|
|
562726
|
+
if (hasFooter) {
|
|
562727
|
+
lines.push(buildInnerDivider(w));
|
|
562728
|
+
lines.push(...buildLabeledFooterLines("Files", footerFiles, w));
|
|
562729
|
+
lines.push(...buildLabeledFooterLines("Tools", footerTools, w));
|
|
562730
|
+
lines.push(...buildLabeledFooterLines("Provenance", footerProvenance, w));
|
|
562731
|
+
}
|
|
562732
|
+
lines.push(buildBottomBorder(w));
|
|
562733
|
+
return lines;
|
|
562734
|
+
}
|
|
562657
562735
|
function renderTaskCompleteBox(host, data) {
|
|
562658
562736
|
const blockId = `task-complete-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
562659
562737
|
const frozen = {
|
|
@@ -562671,6 +562749,28 @@ function renderTaskCompleteBox(host, data) {
|
|
|
562671
562749
|
host.appendDynamicBlock(blockId);
|
|
562672
562750
|
return blockId;
|
|
562673
562751
|
}
|
|
562752
|
+
function renderSessionHistoryBox(host, data) {
|
|
562753
|
+
const blockId = `session-history-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
562754
|
+
const frozen = {
|
|
562755
|
+
title: data.title,
|
|
562756
|
+
totalEntries: data.totalEntries,
|
|
562757
|
+
updatedAt: data.updatedAt ?? null,
|
|
562758
|
+
entries: data.entries.map((entry) => ({
|
|
562759
|
+
savedAt: entry.savedAt,
|
|
562760
|
+
task: entry.task,
|
|
562761
|
+
summary: entry.summary,
|
|
562762
|
+
filesModified: entry.filesModified ? [...entry.filesModified] : [],
|
|
562763
|
+
toolsUsed: entry.toolsUsed ? [...entry.toolsUsed] : [],
|
|
562764
|
+
toolCalls: entry.toolCalls,
|
|
562765
|
+
provenance: entry.provenance,
|
|
562766
|
+
completed: entry.completed,
|
|
562767
|
+
model: entry.model
|
|
562768
|
+
}))
|
|
562769
|
+
};
|
|
562770
|
+
host.registerDynamicBlock(blockId, (width) => buildSessionHistoryBoxLines(frozen, width));
|
|
562771
|
+
host.appendDynamicBlock(blockId);
|
|
562772
|
+
return blockId;
|
|
562773
|
+
}
|
|
562674
562774
|
function detectTestRuns(shellCommands) {
|
|
562675
562775
|
const out = /* @__PURE__ */ new Set();
|
|
562676
562776
|
const runners = [
|
|
@@ -562793,13 +562893,6 @@ function fileLink(filePath) {
|
|
|
562793
562893
|
}
|
|
562794
562894
|
return filePath;
|
|
562795
562895
|
}
|
|
562796
|
-
function linkifyPaths(text) {
|
|
562797
|
-
if (!isTTY2) return text;
|
|
562798
|
-
return text.replace(/(\/[\w./\-@+]+)/g, (match) => {
|
|
562799
|
-
if (match.length < 3 || match.endsWith("/")) return match;
|
|
562800
|
-
return hyperlink(`file://${match}`, match);
|
|
562801
|
-
});
|
|
562802
|
-
}
|
|
562803
562896
|
function setEmojisEnabled(enabled2) {
|
|
562804
562897
|
_emojisEnabled = enabled2;
|
|
562805
562898
|
}
|
|
@@ -562925,131 +563018,391 @@ function renderTaskAborted() {
|
|
|
562925
563018
|
${c3.yellow("⚠")} ${c3.bold("Task aborted by user")}
|
|
562926
563019
|
`);
|
|
562927
563020
|
}
|
|
562928
|
-
function
|
|
562929
|
-
|
|
562930
|
-
const label = TOOL_LABELS[toolName] ?? toolName;
|
|
562931
|
-
const argsSummary = formatToolArgs(toolName, args, verbose);
|
|
562932
|
-
const colorFn = _colorsEnabled ? TOOL_COLORS[toolName] ?? c3.dim : (t2) => t2;
|
|
562933
|
-
const emojiPrefix = _emojisEnabled ? `${icon} ` : "";
|
|
562934
|
-
process.stdout.write(`
|
|
562935
|
-
${emojiPrefix}${colorFn(c3.bold(label))}${argsSummary ? c3.dim(": ") + argsSummary : ""}
|
|
562936
|
-
`);
|
|
563021
|
+
function normalizeToolOpts(arg) {
|
|
563022
|
+
return typeof arg === "boolean" ? { verbose: arg } : arg ?? {};
|
|
562937
563023
|
}
|
|
562938
|
-
function
|
|
562939
|
-
|
|
562940
|
-
process.stdout.write(` ${c3.dim(connector)}─ ${content}
|
|
562941
|
-
`);
|
|
563024
|
+
function toolColorCode(toolName) {
|
|
563025
|
+
return TOOL_COLOR_CODES[toolName] ?? tuiTextDim();
|
|
562942
563026
|
}
|
|
562943
|
-
function
|
|
562944
|
-
|
|
562945
|
-
|
|
562946
|
-
|
|
562947
|
-
|
|
562948
|
-
|
|
562949
|
-
|
|
562950
|
-
|
|
562951
|
-
|
|
562952
|
-
|
|
562953
|
-
|
|
562954
|
-
|
|
562955
|
-
|
|
562956
|
-
|
|
562957
|
-
|
|
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;
|
|
562958
563052
|
}
|
|
562959
|
-
|
|
562960
|
-
|
|
562961
|
-
|
|
562962
|
-
|
|
562963
|
-
|
|
562964
|
-
|
|
562965
|
-
|
|
562966
|
-
|
|
562967
|
-
|
|
562968
|
-
|
|
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;
|
|
562969
563151
|
}
|
|
562970
|
-
|
|
562971
|
-
|
|
562972
|
-
|
|
562973
|
-
|
|
562974
|
-
|
|
562975
|
-
|
|
562976
|
-
|
|
562977
|
-
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;
|
|
562978
563159
|
}
|
|
562979
|
-
|
|
562980
|
-
|
|
562981
|
-
|
|
562982
|
-
|
|
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));
|
|
562983
563189
|
}
|
|
562984
|
-
|
|
562985
|
-
|
|
562986
|
-
|
|
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));
|
|
562987
563196
|
}
|
|
562988
|
-
|
|
562989
|
-
|
|
562990
|
-
|
|
562991
|
-
|
|
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
|
+
});
|
|
562992
563267
|
}
|
|
562993
|
-
default:
|
|
562994
|
-
break;
|
|
562995
563268
|
}
|
|
562996
|
-
|
|
562997
|
-
|
|
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();
|
|
562998
563316
|
if (!trimmed) return false;
|
|
562999
563317
|
if (!debug && (trimmed.startsWith("[trust_tier:") || trimmed.startsWith("[SYSTEM]:") || trimmed.includes("tool_output_untrusted") || trimmed.includes("FORCED PROGRESS BLOCK"))) return false;
|
|
563000
563318
|
return true;
|
|
563001
563319
|
});
|
|
563002
|
-
if (
|
|
563003
|
-
|
|
563004
|
-
process.stdout.write(`${prefix}${icon} ${success ? c3.dim("Done") : c3.red("Failed")}
|
|
563005
|
-
`);
|
|
563006
|
-
return;
|
|
563320
|
+
if (filtered.length === 0) {
|
|
563321
|
+
return [{ text: success ? "Done" : "Failed", mode: "wrap", kind: success ? "success" : "error" }];
|
|
563007
563322
|
}
|
|
563008
|
-
const maxLines = verbose ? 200 : 6;
|
|
563009
|
-
const shown =
|
|
563010
|
-
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)) {
|
|
563011
563326
|
if (isRawJsonDump(line) && !verbose) {
|
|
563012
|
-
|
|
563013
|
-
|
|
563014
|
-
return;
|
|
563015
|
-
}
|
|
563016
|
-
if (verbose) {
|
|
563017
|
-
const termW = getTermWidth() - 10;
|
|
563018
|
-
if (line.length > termW) {
|
|
563019
|
-
let remaining = line;
|
|
563020
|
-
let first2 = true;
|
|
563021
|
-
while (remaining.length > 0) {
|
|
563022
|
-
if (remaining.length <= termW) {
|
|
563023
|
-
const formatted2 = formatMarkdownLine(remaining);
|
|
563024
|
-
process.stdout.write(`${first2 ? prefix : prefix + " "}${formatted2 === remaining ? highlightToolOutput(remaining) : formatted2}
|
|
563025
|
-
`);
|
|
563026
|
-
break;
|
|
563027
|
-
}
|
|
563028
|
-
let breakAt = remaining.lastIndexOf(" ", termW);
|
|
563029
|
-
if (breakAt < termW * 0.3) breakAt = termW;
|
|
563030
|
-
const chunk = remaining.slice(0, breakAt);
|
|
563031
|
-
remaining = remaining.slice(breakAt).trimStart();
|
|
563032
|
-
const formatted = formatMarkdownLine(chunk);
|
|
563033
|
-
process.stdout.write(`${first2 ? prefix : prefix + " "}${formatted === chunk ? highlightToolOutput(chunk) : formatted}
|
|
563034
|
-
`);
|
|
563035
|
-
first2 = false;
|
|
563036
|
-
}
|
|
563037
|
-
} else {
|
|
563038
|
-
const formatted = formatMarkdownLine(line);
|
|
563039
|
-
process.stdout.write(`${prefix}${formatted === line ? highlightToolOutput(line) : formatted}
|
|
563040
|
-
`);
|
|
563041
|
-
}
|
|
563042
|
-
} else {
|
|
563043
|
-
const cropped = line.length > maxW ? line.slice(0, maxW - 3) + "..." : line;
|
|
563044
|
-
const formatted = formatMarkdownLine(cropped);
|
|
563045
|
-
process.stdout.write(`${prefix}${formatted === cropped ? highlightToolOutput(cropped) : formatted}
|
|
563046
|
-
`);
|
|
563327
|
+
shown.push({ text: "(output omitted)", mode: "wrap", kind: "dim" });
|
|
563328
|
+
break;
|
|
563047
563329
|
}
|
|
563330
|
+
shown.push({
|
|
563331
|
+
text: line,
|
|
563332
|
+
mode: shouldPreserveToolLine(toolName, line) ? "truncate" : "wrap",
|
|
563333
|
+
kind: outputLineKind(toolName, line)
|
|
563334
|
+
});
|
|
563048
563335
|
}
|
|
563049
|
-
if (
|
|
563050
|
-
|
|
563051
|
-
|
|
563336
|
+
if (filtered.length > maxLines) {
|
|
563337
|
+
shown.push({
|
|
563338
|
+
text: `... ${filtered.length - maxLines} more lines`,
|
|
563339
|
+
mode: "wrap",
|
|
563340
|
+
kind: "dim"
|
|
563341
|
+
});
|
|
563052
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
|
+
);
|
|
563053
563406
|
}
|
|
563054
563407
|
function renderImageAsciiPreview(title, imagePath, ascii2, renderer) {
|
|
563055
563408
|
const prefix = ` ${c3.dim("│")} `;
|
|
@@ -563073,51 +563426,6 @@ function isRawJsonDump(line) {
|
|
|
563073
563426
|
if (/\[38;5;\d+m/.test(line) && line.length > 100) return true;
|
|
563074
563427
|
return false;
|
|
563075
563428
|
}
|
|
563076
|
-
function renderCodePreview(output, prefix, maxW, maxLines) {
|
|
563077
|
-
const lines = output.split("\n");
|
|
563078
|
-
let start2 = 0;
|
|
563079
|
-
while (start2 < lines.length && !lines[start2].trim()) start2++;
|
|
563080
|
-
const shown = lines.slice(start2, start2 + maxLines);
|
|
563081
|
-
if (shown.length === 0) {
|
|
563082
|
-
process.stdout.write(`${prefix}${c3.dim("(empty file)")}
|
|
563083
|
-
`);
|
|
563084
|
-
return;
|
|
563085
|
-
}
|
|
563086
|
-
for (const line of shown) {
|
|
563087
|
-
const cropped = line.length > maxW ? line.slice(0, maxW - 3) + "..." : line;
|
|
563088
|
-
process.stdout.write(`${prefix}${c3.dim(cropped)}
|
|
563089
|
-
`);
|
|
563090
|
-
}
|
|
563091
|
-
const remaining = lines.length - start2 - shown.length;
|
|
563092
|
-
if (remaining > 0) {
|
|
563093
|
-
process.stdout.write(`${prefix}${c3.dim(`... ${remaining} more lines`)}
|
|
563094
|
-
`);
|
|
563095
|
-
}
|
|
563096
|
-
}
|
|
563097
|
-
function renderShellOutput(output, success, prefix, maxW, maxLines) {
|
|
563098
|
-
const lines = output.split("\n").filter((l2) => l2.trim());
|
|
563099
|
-
if (lines.length === 0) {
|
|
563100
|
-
const icon = success ? c3.green("✔") : c3.red("✖");
|
|
563101
|
-
process.stdout.write(`${prefix}${icon} ${success ? c3.dim("Done") : c3.red("Failed")}
|
|
563102
|
-
`);
|
|
563103
|
-
return;
|
|
563104
|
-
}
|
|
563105
|
-
const shown = lines.slice(0, maxLines);
|
|
563106
|
-
for (const line of shown) {
|
|
563107
|
-
if (isRawJsonDump(line)) {
|
|
563108
|
-
process.stdout.write(`${prefix}${c3.dim("(output omitted)")}
|
|
563109
|
-
`);
|
|
563110
|
-
return;
|
|
563111
|
-
}
|
|
563112
|
-
const cropped = line.length > maxW ? line.slice(0, maxW - 3) + "..." : line;
|
|
563113
|
-
process.stdout.write(`${prefix}${highlightToolOutput(cropped)}
|
|
563114
|
-
`);
|
|
563115
|
-
}
|
|
563116
|
-
if (lines.length > maxLines) {
|
|
563117
|
-
process.stdout.write(`${prefix}${c3.dim(`... ${lines.length - maxLines} more lines`)}
|
|
563118
|
-
`);
|
|
563119
|
-
}
|
|
563120
|
-
}
|
|
563121
563429
|
function highlightToolOutput(line) {
|
|
563122
563430
|
if (line.startsWith("+") && !line.startsWith("+++")) return c3.green(line);
|
|
563123
563431
|
if (line.startsWith("-") && !line.startsWith("---")) return c3.red(line);
|
|
@@ -563420,113 +563728,6 @@ function renderConfig(config) {
|
|
|
563420
563728
|
}
|
|
563421
563729
|
process.stdout.write("\n");
|
|
563422
563730
|
}
|
|
563423
|
-
function formatToolArgs(toolName, args, verbose) {
|
|
563424
|
-
const maxArg = verbose ? 1e4 : Math.max(40, getTermWidth() - 20);
|
|
563425
|
-
switch (toolName) {
|
|
563426
|
-
case "file_read":
|
|
563427
|
-
case "file_write":
|
|
563428
|
-
case "file_edit":
|
|
563429
|
-
return fileLink(String(args["path"] ?? ""));
|
|
563430
|
-
case "shell": {
|
|
563431
|
-
const cmd = truncStr(String(args["command"] ?? ""), maxArg);
|
|
563432
|
-
return args["stdin"] ? `${cmd} ${c3.dim("(with stdin)")}` : cmd;
|
|
563433
|
-
}
|
|
563434
|
-
case "grep_search":
|
|
563435
|
-
return `${c3.yellow(String(args["pattern"] ?? ""))}${args["path"] ? ` in ${fileLink(String(args["path"]))}` : ""}`;
|
|
563436
|
-
case "find_files":
|
|
563437
|
-
return String(args["pattern"] ?? "");
|
|
563438
|
-
case "list_directory":
|
|
563439
|
-
return fileLink(String(args["path"] ?? "."));
|
|
563440
|
-
case "web_search":
|
|
563441
|
-
return `"${truncStr(String(args["query"] ?? ""), maxArg - 2)}"`;
|
|
563442
|
-
case "web_fetch":
|
|
563443
|
-
return truncStr(String(args["url"] ?? ""), maxArg);
|
|
563444
|
-
case "memory_read":
|
|
563445
|
-
return `${args["topic"]}${args["key"] ? "." + args["key"] : ""}`;
|
|
563446
|
-
case "memory_write":
|
|
563447
|
-
return `${args["topic"]}.${args["key"]}`;
|
|
563448
|
-
case "task_complete":
|
|
563449
|
-
return "";
|
|
563450
|
-
case "aiwg_setup":
|
|
563451
|
-
return String(args["framework"] ?? "sdlc");
|
|
563452
|
-
case "aiwg_health":
|
|
563453
|
-
return args["detailed"] ? "detailed" : "summary";
|
|
563454
|
-
case "aiwg_workflow":
|
|
563455
|
-
return truncStr(String(args["command"] ?? ""), maxArg);
|
|
563456
|
-
case "batch_edit": {
|
|
563457
|
-
const edits = args["edits"];
|
|
563458
|
-
return edits ? `${edits.length} edit(s)` : "";
|
|
563459
|
-
}
|
|
563460
|
-
case "codebase_map":
|
|
563461
|
-
return args["path"] ? String(args["path"]) : ".";
|
|
563462
|
-
case "diagnostic": {
|
|
563463
|
-
const steps = args["steps"];
|
|
563464
|
-
return steps ? steps.join(", ") : "all";
|
|
563465
|
-
}
|
|
563466
|
-
case "git_info":
|
|
563467
|
-
return args["show_diff"] ? "with diff" : "summary";
|
|
563468
|
-
case "background_run":
|
|
563469
|
-
return truncStr(String(args["command"] ?? ""), maxArg);
|
|
563470
|
-
case "task_status":
|
|
563471
|
-
case "task_output":
|
|
563472
|
-
case "task_stop":
|
|
563473
|
-
return String(args["task_id"] ?? "all");
|
|
563474
|
-
case "sub_agent": {
|
|
563475
|
-
const bg = args["background"] ? " (background)" : "";
|
|
563476
|
-
return truncStr(String(args["task"] ?? ""), maxArg - 15) + bg;
|
|
563477
|
-
}
|
|
563478
|
-
case "image_read":
|
|
563479
|
-
return String(args["path"] ?? "");
|
|
563480
|
-
case "screenshot":
|
|
563481
|
-
return String(args["region"] ?? "full screen");
|
|
563482
|
-
case "ocr":
|
|
563483
|
-
return `${args["path"] ?? ""}${args["region"] ? ` (${args["region"]})` : ""}`;
|
|
563484
|
-
case "transcribe_file":
|
|
563485
|
-
return `${args["path"] ?? ""}${args["model"] ? ` (${args["model"]})` : ""}`;
|
|
563486
|
-
case "transcribe_url":
|
|
563487
|
-
return truncStr(String(args["url"] ?? ""), maxArg);
|
|
563488
|
-
case "ask_user": {
|
|
563489
|
-
const q = truncStr(String(args["question"] ?? ""), maxArg - 10);
|
|
563490
|
-
const opts = args["options"];
|
|
563491
|
-
const count = opts ? ` (${opts.length} options)` : "";
|
|
563492
|
-
return `${q}${c3.dim(count)}`;
|
|
563493
|
-
}
|
|
563494
|
-
case "todo_write": {
|
|
563495
|
-
const todos = args["todos"];
|
|
563496
|
-
if (!Array.isArray(todos)) return "";
|
|
563497
|
-
const counts = { p: 0, i: 0, c: 0, b: 0 };
|
|
563498
|
-
for (const t2 of todos) {
|
|
563499
|
-
if (t2?.status === "completed") counts.c++;
|
|
563500
|
-
else if (t2?.status === "in_progress") counts.i++;
|
|
563501
|
-
else if (t2?.status === "blocked") counts.b++;
|
|
563502
|
-
else counts.p++;
|
|
563503
|
-
}
|
|
563504
|
-
const summary = `${todos.length} items (${counts.c}◉ ${counts.i}◐ ${counts.p}○${counts.b > 0 ? ` ${counts.b}◍` : ""})`;
|
|
563505
|
-
if (verbose) {
|
|
563506
|
-
const current = todos.find((t2) => t2?.status === "in_progress");
|
|
563507
|
-
if (current?.content) {
|
|
563508
|
-
return `${summary} — ${truncStr(current.content, maxArg - summary.length - 4)}`;
|
|
563509
|
-
}
|
|
563510
|
-
}
|
|
563511
|
-
return summary;
|
|
563512
|
-
}
|
|
563513
|
-
case "todo_read":
|
|
563514
|
-
return "";
|
|
563515
|
-
default:
|
|
563516
|
-
return Object.entries(args).map(([k, v]) => {
|
|
563517
|
-
let valStr;
|
|
563518
|
-
if (v === null || v === void 0) valStr = String(v);
|
|
563519
|
-
else if (typeof v === "object") {
|
|
563520
|
-
try {
|
|
563521
|
-
valStr = JSON.stringify(v);
|
|
563522
|
-
} catch {
|
|
563523
|
-
valStr = String(v);
|
|
563524
|
-
}
|
|
563525
|
-
} else valStr = String(v);
|
|
563526
|
-
return `${k}=${truncStr(valStr, Math.max(30, maxArg / 3))}`;
|
|
563527
|
-
}).join(", ");
|
|
563528
|
-
}
|
|
563529
|
-
}
|
|
563530
563731
|
function truncStr(s2, max) {
|
|
563531
563732
|
return s2.length > max ? s2.slice(0, max) + "..." : s2;
|
|
563532
563733
|
}
|
|
@@ -563538,7 +563739,7 @@ function formatDuration3(ms) {
|
|
|
563538
563739
|
const secs = Math.floor(totalSecs % 60);
|
|
563539
563740
|
return `${mins}m ${secs}s`;
|
|
563540
563741
|
}
|
|
563541
|
-
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;
|
|
563542
563743
|
var init_render = __esm({
|
|
563543
563744
|
"packages/cli/src/tui/render.ts"() {
|
|
563544
563745
|
"use strict";
|
|
@@ -563546,6 +563747,8 @@ var init_render = __esm({
|
|
|
563546
563747
|
init_layout2();
|
|
563547
563748
|
init_command_registry();
|
|
563548
563749
|
init_config();
|
|
563750
|
+
init_text_selection();
|
|
563751
|
+
init_task_complete_box();
|
|
563549
563752
|
isTTY2 = process.stdout.isTTY ?? false;
|
|
563550
563753
|
c3 = {
|
|
563551
563754
|
bold: (t2) => ansi2("1", t2),
|
|
@@ -563685,43 +563888,47 @@ var init_render = __esm({
|
|
|
563685
563888
|
// User interaction
|
|
563686
563889
|
ask_user: "Ask user"
|
|
563687
563890
|
};
|
|
563688
|
-
|
|
563689
|
-
|
|
563690
|
-
|
|
563691
|
-
|
|
563692
|
-
|
|
563693
|
-
|
|
563694
|
-
|
|
563695
|
-
|
|
563696
|
-
|
|
563697
|
-
|
|
563698
|
-
|
|
563699
|
-
|
|
563700
|
-
|
|
563701
|
-
|
|
563702
|
-
|
|
563703
|
-
|
|
563704
|
-
|
|
563705
|
-
|
|
563706
|
-
|
|
563707
|
-
|
|
563708
|
-
|
|
563709
|
-
|
|
563710
|
-
|
|
563711
|
-
|
|
563712
|
-
|
|
563713
|
-
|
|
563714
|
-
|
|
563715
|
-
|
|
563716
|
-
|
|
563717
|
-
|
|
563718
|
-
|
|
563719
|
-
screenshot: accentSoft,
|
|
563720
|
-
ocr: accentSoft,
|
|
563721
|
-
transcribe_file: accentWarm,
|
|
563722
|
-
transcribe_url: accentWarm,
|
|
563723
|
-
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
|
|
563724
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";
|
|
563725
563932
|
_contentWriteHook = null;
|
|
563726
563933
|
HINTS = [
|
|
563727
563934
|
"Ask the agent to connect to the Omnius Nexus for P2P agent networking",
|
|
@@ -569019,6 +569226,7 @@ __export(omnius_directory_exports, {
|
|
|
569019
569226
|
saveSession: () => saveSession,
|
|
569020
569227
|
saveSessionContext: () => saveSessionContext,
|
|
569021
569228
|
saveSessionHistory: () => saveSessionHistory,
|
|
569229
|
+
sessionContextToHistoryBoxData: () => sessionContextToHistoryBoxData,
|
|
569022
569230
|
writeIndexData: () => writeIndexData,
|
|
569023
569231
|
writeIndexMeta: () => writeIndexMeta,
|
|
569024
569232
|
writeTaskHandoff: () => writeTaskHandoff2
|
|
@@ -569708,25 +569916,29 @@ function loadSessionContext(repoRoot) {
|
|
|
569708
569916
|
}
|
|
569709
569917
|
}
|
|
569710
569918
|
function formatSessionHistoryDisplay(ctx3) {
|
|
569711
|
-
|
|
569712
|
-
|
|
569713
|
-
|
|
569714
|
-
|
|
569715
|
-
|
|
569716
|
-
|
|
569717
|
-
|
|
569718
|
-
|
|
569719
|
-
|
|
569720
|
-
|
|
569721
|
-
|
|
569722
|
-
|
|
569723
|
-
|
|
569724
|
-
|
|
569725
|
-
|
|
569726
|
-
|
|
569727
|
-
}
|
|
569728
|
-
|
|
569729
|
-
|
|
569919
|
+
return buildSessionHistoryBoxLines(
|
|
569920
|
+
sessionContextToHistoryBoxData(ctx3),
|
|
569921
|
+
process.stdout.columns ?? 80
|
|
569922
|
+
).join("\n");
|
|
569923
|
+
}
|
|
569924
|
+
function sessionContextToHistoryBoxData(ctx3, title = "Session History") {
|
|
569925
|
+
const entries = (ctx3?.entries ?? []).slice(-8).map((e2) => ({
|
|
569926
|
+
savedAt: e2.savedAt,
|
|
569927
|
+
task: normalizeSessionText(cleanPromptForDiary(e2.task), 220),
|
|
569928
|
+
summary: normalizeSessionText(e2.assistantResponse || e2.summary, 260),
|
|
569929
|
+
filesModified: e2.filesModified?.slice(0, 16) ?? [],
|
|
569930
|
+
toolsUsed: e2.toolsUsed?.slice(0, 16) ?? [],
|
|
569931
|
+
toolCalls: e2.toolCalls,
|
|
569932
|
+
provenance: normalizeSessionText(e2.provenance, 300),
|
|
569933
|
+
completed: e2.completed,
|
|
569934
|
+
model: normalizeSessionText(e2.model, 120)
|
|
569935
|
+
}));
|
|
569936
|
+
return {
|
|
569937
|
+
title,
|
|
569938
|
+
entries,
|
|
569939
|
+
totalEntries: ctx3?.entries.length ?? 0,
|
|
569940
|
+
updatedAt: ctx3?.updatedAt ?? null
|
|
569941
|
+
};
|
|
569730
569942
|
}
|
|
569731
569943
|
function buildContextRestorePrompt(repoRoot) {
|
|
569732
569944
|
const ctx3 = loadSessionContext(repoRoot);
|
|
@@ -570061,6 +570273,7 @@ var OMNIUS_DIR, LEGACY_DIRS, SUBDIRS, CONTEXT_FILES, PENDING_TASK_FILE, HANDOFF_
|
|
|
570061
570273
|
var init_omnius_directory = __esm({
|
|
570062
570274
|
"packages/cli/src/tui/omnius-directory.ts"() {
|
|
570063
570275
|
"use strict";
|
|
570276
|
+
init_task_complete_box();
|
|
570064
570277
|
OMNIUS_DIR = ".omnius";
|
|
570065
570278
|
LEGACY_DIRS = [".oa", ".open-agents"];
|
|
570066
570279
|
SUBDIRS = ["memory", "index", "context", "history", "notes", "embedded", "provenance", "tools", "dreams"];
|
|
@@ -571303,16 +571516,16 @@ function buildTodoProgressBar(todos, maxWidth) {
|
|
|
571303
571516
|
for (let i2 = 0; i2 < cells; i2++) {
|
|
571304
571517
|
const t2 = todos[i2];
|
|
571305
571518
|
if (t2.status === "completed") {
|
|
571306
|
-
out += `\x1B[1m${DONE_Y}█${
|
|
571519
|
+
out += `\x1B[1m${DONE_Y}█${RESET3}`;
|
|
571307
571520
|
} else if (i2 === inIdx) {
|
|
571308
|
-
out += `${INPROG}▒${
|
|
571521
|
+
out += `${INPROG}▒${RESET3}`;
|
|
571309
571522
|
} else if (i2 === nextIdx && inIdx >= 0) {
|
|
571310
|
-
out += `${NEXT}▒${
|
|
571523
|
+
out += `${NEXT}▒${RESET3}`;
|
|
571311
571524
|
} else {
|
|
571312
|
-
out += `${PEND}░${
|
|
571525
|
+
out += `${PEND}░${RESET3}`;
|
|
571313
571526
|
}
|
|
571314
571527
|
}
|
|
571315
|
-
if (truncated && maxWidth > 0) out += `${DIM_LABEL}…${
|
|
571528
|
+
if (truncated && maxWidth > 0) out += `${DIM_LABEL}…${RESET3}`;
|
|
571316
571529
|
return out;
|
|
571317
571530
|
}
|
|
571318
571531
|
function render() {
|
|
@@ -571334,7 +571547,7 @@ function render() {
|
|
|
571334
571547
|
const total = _lastTodos.length;
|
|
571335
571548
|
const headerColor = ACCENT;
|
|
571336
571549
|
const lines = [];
|
|
571337
|
-
const headerPrefix = `tasks ${headerColor}${completed}/${total}${
|
|
571550
|
+
const headerPrefix = `tasks ${headerColor}${completed}/${total}${RESET3} `;
|
|
571338
571551
|
const headerPrefixWidth = visualLen(headerPrefix);
|
|
571339
571552
|
const maxBarWidth = Math.max(0, cols - 2 - headerPrefixWidth);
|
|
571340
571553
|
const progressBar = buildTodoProgressBar(_lastTodos, maxBarWidth);
|
|
@@ -571346,11 +571559,11 @@ function render() {
|
|
|
571346
571559
|
const contentWidth = Math.max(4, cols - 8);
|
|
571347
571560
|
const contentText = t2.content + (t2.blocker ? ` (blocked: ${t2.blocker})` : "");
|
|
571348
571561
|
const truncated = truncate2(contentText, contentWidth);
|
|
571349
|
-
lines.push(`${color}${mark}${
|
|
571562
|
+
lines.push(`${color}${mark}${RESET3} ${color}${truncated}${RESET3}`);
|
|
571350
571563
|
}
|
|
571351
571564
|
if (_lastTodos.length > visible.length) {
|
|
571352
571565
|
const more = _lastTodos.length - visible.length;
|
|
571353
|
-
lines[lines.length - 1] = `${DIM_LABEL}… +${more} more${
|
|
571566
|
+
lines[lines.length - 1] = `${DIM_LABEL}… +${more} more${RESET3}`;
|
|
571354
571567
|
}
|
|
571355
571568
|
let out = HIDE + SAVE;
|
|
571356
571569
|
const newTop = L.tasksTop;
|
|
@@ -571367,7 +571580,7 @@ function render() {
|
|
|
571367
571580
|
for (let i2 = 0; i2 < lines.length; i2++) {
|
|
571368
571581
|
const row = L.tasksTop + i2;
|
|
571369
571582
|
if (row > L.tasksBottom) break;
|
|
571370
|
-
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}`;
|
|
571371
571584
|
}
|
|
571372
571585
|
out += RESTORE + SHOW;
|
|
571373
571586
|
try {
|
|
@@ -571395,7 +571608,7 @@ function clearLastPaintedRows() {
|
|
|
571395
571608
|
_lastPaintedTop = -1;
|
|
571396
571609
|
_lastPaintedBottom = -1;
|
|
571397
571610
|
}
|
|
571398
|
-
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;
|
|
571399
571612
|
var init_tui_tasks_renderer = __esm({
|
|
571400
571613
|
"packages/cli/src/tui/tui-tasks-renderer.ts"() {
|
|
571401
571614
|
"use strict";
|
|
@@ -571422,7 +571635,7 @@ var init_tui_tasks_renderer = __esm({
|
|
|
571422
571635
|
HIDE = "\x1B[?25l";
|
|
571423
571636
|
SHOW = "\x1B[?25h";
|
|
571424
571637
|
CLEAR_LINE = "\x1B[2K";
|
|
571425
|
-
|
|
571638
|
+
RESET3 = "\x1B[0m";
|
|
571426
571639
|
BG = tuiBgSeq();
|
|
571427
571640
|
DIM_LABEL = "";
|
|
571428
571641
|
ACCENT = "";
|
|
@@ -571469,7 +571682,7 @@ function setTerminalTitle(task, version4) {
|
|
|
571469
571682
|
const title = task ? `${task.slice(0, 60)} · ${ver}` : ver;
|
|
571470
571683
|
process.stdout.write(`\x1B]2;${title}\x07`);
|
|
571471
571684
|
}
|
|
571472
|
-
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;
|
|
571473
571686
|
var init_status_bar = __esm({
|
|
571474
571687
|
"packages/cli/src/tui/status-bar.ts"() {
|
|
571475
571688
|
"use strict";
|
|
@@ -571648,14 +571861,14 @@ var init_status_bar = __esm({
|
|
|
571648
571861
|
TEXT_PRIMARY = tuiTextPrimary() < 0 ? 252 : tuiTextPrimary();
|
|
571649
571862
|
TEXT_DIM = tuiTextDim();
|
|
571650
571863
|
NO_SUB_AGENTS_HEADER_LABEL = " no sub-agents ";
|
|
571651
|
-
|
|
571652
|
-
|
|
571653
|
-
|
|
571654
|
-
|
|
571655
|
-
|
|
571656
|
-
|
|
571864
|
+
BOX_TL3 = "╭";
|
|
571865
|
+
BOX_TR3 = "╮";
|
|
571866
|
+
BOX_BL3 = "╰";
|
|
571867
|
+
BOX_BR3 = "╯";
|
|
571868
|
+
BOX_H3 = "─";
|
|
571869
|
+
BOX_V3 = "│";
|
|
571657
571870
|
_globalFooterLock = false;
|
|
571658
|
-
|
|
571871
|
+
RESET4 = "\x1B[0m";
|
|
571659
571872
|
CURSOR_BLINK_BLOCK = "\x1B[1 q";
|
|
571660
571873
|
_isWindows = process.platform === "win32";
|
|
571661
571874
|
StatusBar = class _StatusBar {
|
|
@@ -571998,7 +572211,7 @@ var init_status_bar = __esm({
|
|
|
571998
572211
|
const segment = segments[i2];
|
|
571999
572212
|
if (i2 > 0) {
|
|
572000
572213
|
separatorOffsets.push(width);
|
|
572001
|
-
text += `${BOX_FG}${
|
|
572214
|
+
text += `${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
572002
572215
|
width += 1;
|
|
572003
572216
|
}
|
|
572004
572217
|
text += `\x1B[1;38;5;${TEXT_PRIMARY}m${PANEL_BG_SEQ}${segment}`;
|
|
@@ -572180,7 +572393,7 @@ var init_status_bar = __esm({
|
|
|
572180
572393
|
const sysSeparatorOffset = sysItems.reduce((sum, item) => sum + item.w, 0);
|
|
572181
572394
|
this._sysSeparatorOffset = sysSeparatorOffset;
|
|
572182
572395
|
sysItems.push({
|
|
572183
|
-
render: () => `${BOX_FG}│${
|
|
572396
|
+
render: () => `${BOX_FG}│${RESET4}${PANEL_BG_SEQ} `,
|
|
572184
572397
|
w: 2
|
|
572185
572398
|
});
|
|
572186
572399
|
const voiceLabel = this._voiceActive ? ` ${this._voiceModelId || "voice"} ` : " voice ";
|
|
@@ -572377,7 +572590,7 @@ var init_status_bar = __esm({
|
|
|
572377
572590
|
const hdrRow = layout().headerContent;
|
|
572378
572591
|
let buf = "\x1B7";
|
|
572379
572592
|
buf += `\x1B[${hdrRow};1H${PANEL_BG_SEQ}\x1B[2K`;
|
|
572380
|
-
buf += `${BOX_FG}│${
|
|
572593
|
+
buf += `${BOX_FG}│${RESET4}${PANEL_BG_SEQ}`;
|
|
572381
572594
|
if (chrome.showPrev) {
|
|
572382
572595
|
buf += leftArrow;
|
|
572383
572596
|
buf += ` `;
|
|
@@ -572388,7 +572601,7 @@ var init_status_bar = __esm({
|
|
|
572388
572601
|
buf += `\x1B[${hdrRow};${w - 1}H`;
|
|
572389
572602
|
buf += rightArrow;
|
|
572390
572603
|
}
|
|
572391
|
-
buf += `\x1B[${hdrRow};${w}H${BOX_FG}│${
|
|
572604
|
+
buf += `\x1B[${hdrRow};${w}H${BOX_FG}│${RESET4}${PANEL_BG_SEQ}`;
|
|
572392
572605
|
buf += "\x1B8";
|
|
572393
572606
|
this.termWrite(buf);
|
|
572394
572607
|
}
|
|
@@ -573591,11 +573804,11 @@ var init_status_bar = __esm({
|
|
|
573591
573804
|
for (let i2 = 0; i2 < inputWrap.lines.length; i2++) {
|
|
573592
573805
|
const row = pos.inputStartRow + i2;
|
|
573593
573806
|
const prefix = i2 === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
573594
|
-
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${prefix}${inputWrap.lines[i2]}${
|
|
573807
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${prefix}${inputWrap.lines[i2]}${RESET4}${PANEL_BG_SEQ}`;
|
|
573595
573808
|
}
|
|
573596
573809
|
const boxInnerP = w - 2;
|
|
573597
|
-
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
573598
|
-
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${
|
|
573810
|
+
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}`;
|
|
573811
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET4}${PANEL_BG_SEQ}\x1B[?7h\x1B[${pos.inputStartRow};1H`;
|
|
573599
573812
|
this.termWrite(buf);
|
|
573600
573813
|
if (this._bannerRefresh) this._bannerRefresh();
|
|
573601
573814
|
} else {
|
|
@@ -573796,7 +574009,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
573796
574009
|
process.stdout.write = this._origWrite;
|
|
573797
574010
|
this._origWrite = null;
|
|
573798
574011
|
}
|
|
573799
|
-
process.stdout.write(
|
|
574012
|
+
process.stdout.write(RESET4);
|
|
573800
574013
|
this._brailleSpinner.setMetrics({ isStreaming: false });
|
|
573801
574014
|
this.renderFooterAndPositionInput();
|
|
573802
574015
|
this.parkCursorInInput();
|
|
@@ -574010,7 +574223,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574010
574223
|
const endRaw = this.rawIndexForVisibleColumn(line, end);
|
|
574011
574224
|
const activeStyle = this.activeSgrAt(line, startRaw);
|
|
574012
574225
|
const raw = line.slice(startRaw, endRaw);
|
|
574013
|
-
return activeStyle ? `${activeStyle}${raw}${
|
|
574226
|
+
return activeStyle ? `${activeStyle}${raw}${RESET4}` : raw;
|
|
574014
574227
|
}
|
|
574015
574228
|
rawIndexForVisibleColumn(line, target) {
|
|
574016
574229
|
if (target <= 0) return 0;
|
|
@@ -574034,7 +574247,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574034
574247
|
let match;
|
|
574035
574248
|
while ((match = sgr.exec(line)) && match.index < rawIndex) {
|
|
574036
574249
|
const seq = match[0];
|
|
574037
|
-
if (seq ===
|
|
574250
|
+
if (seq === RESET4 || /\x1B\[(?:0|39|49)(?:;0)?m/.test(seq)) {
|
|
574038
574251
|
active = "";
|
|
574039
574252
|
} else {
|
|
574040
574253
|
active += seq;
|
|
@@ -574809,21 +575022,21 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574809
575022
|
const inputWrap = this.wrapInput(w);
|
|
574810
575023
|
let buf = "\x1B[?7l";
|
|
574811
575024
|
const boxInner = w - 2;
|
|
574812
|
-
buf += `\x1B[${pos.inputStartRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575025
|
+
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}`;
|
|
574813
575026
|
const Lspacer = layout();
|
|
574814
575027
|
const spacerRow = pos.inputStartRow - 1;
|
|
574815
575028
|
const tasksOccupiesSpacer = Lspacer.tasksHeight > 0 && spacerRow >= Lspacer.tasksTop && spacerRow <= Lspacer.tasksBottom;
|
|
574816
575029
|
if (spacerRow >= this.scrollRegionTop && !tasksOccupiesSpacer) {
|
|
574817
|
-
buf += `\x1B[${spacerRow};1H${PANEL_BG_SEQ}\x1B[2K${
|
|
575030
|
+
buf += `\x1B[${spacerRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET4}`;
|
|
574818
575031
|
}
|
|
574819
575032
|
for (let i2 = 0; i2 < inputWrap.lines.length; i2++) {
|
|
574820
575033
|
const row = pos.inputStartRow + 1 + i2;
|
|
574821
575034
|
const prefix = i2 === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
574822
575035
|
const lineContent = `${prefix}${inputWrap.lines[i2]}`;
|
|
574823
575036
|
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K`;
|
|
574824
|
-
buf += `${BOX_FG}${
|
|
575037
|
+
buf += `${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}${lineContent}`;
|
|
574825
575038
|
buf += `${PANEL_BG_SEQ}\x1B[K`;
|
|
574826
|
-
buf += `\x1B[${row};${w}H${BOX_FG}${
|
|
575039
|
+
buf += `\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
574827
575040
|
}
|
|
574828
575041
|
const cursorTermRow = pos.inputStartRow + 1 + inputWrap.cursorRow;
|
|
574829
575042
|
if (this._suggestions.length > 0 && pos.suggestStartRow > 0) {
|
|
@@ -574835,17 +575048,17 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574835
575048
|
const fg2 = isHighlighted ? `\x1B[1;38;5;${TEXT_PRIMARY}m` : `\x1B[38;5;${TEXT_PRIMARY}m`;
|
|
574836
575049
|
const slash = isHighlighted ? `\x1B[38;5;245m` : `\x1B[38;5;${TEXT_DIM}m`;
|
|
574837
575050
|
const marker = isHighlighted ? `\x1B[38;5;${TEXT_PRIMARY}m› ` : " ";
|
|
574838
|
-
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575051
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
574839
575052
|
buf += `${bg} ${marker}${slash}/${fg2}${cmd}`;
|
|
574840
575053
|
buf += `${PANEL_BG_SEQ}\x1B[K`;
|
|
574841
|
-
buf += `\x1B[${row};${w}H${BOX_FG}${
|
|
575054
|
+
buf += `\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
574842
575055
|
}
|
|
574843
575056
|
const suggestBottomRow = pos.suggestStartRow + this._suggestions.length;
|
|
574844
|
-
buf += `\x1B[${suggestBottomRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575057
|
+
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}`;
|
|
574845
575058
|
} else {
|
|
574846
|
-
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575059
|
+
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}`;
|
|
574847
575060
|
}
|
|
574848
|
-
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${
|
|
575061
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET4}${PANEL_BG_SEQ}`;
|
|
574849
575062
|
buf += "\x1B[?7h";
|
|
574850
575063
|
if (this.writeDepth === 0) {
|
|
574851
575064
|
buf += `\x1B[${cursorTermRow};${inputWrap.cursorCol}H${CURSOR_BLINK_BLOCK}\x1B[?25h`;
|
|
@@ -574878,7 +575091,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574878
575091
|
const pos = this.rowPositions(termRows());
|
|
574879
575092
|
let buf = "\x1B7\x1B[?7l";
|
|
574880
575093
|
if (pos.tabBarRow > 0) {
|
|
574881
|
-
buf += `\x1B[${pos.tabBarRow};1H${PANEL_BG_SEQ}\x1B[2K${
|
|
575094
|
+
buf += `\x1B[${pos.tabBarRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET4}`;
|
|
574882
575095
|
}
|
|
574883
575096
|
const boxInnerR = w - 2;
|
|
574884
575097
|
if (this._suggestions.length > 0 && pos.suggestStartRow > 0) {
|
|
@@ -574888,14 +575101,14 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574888
575101
|
const isHl = si === this._suggestIndex;
|
|
574889
575102
|
const fg2 = isHl ? `\x1B[1;38;5;${TEXT_PRIMARY}m` : `\x1B[38;5;${TEXT_PRIMARY}m`;
|
|
574890
575103
|
const marker = isHl ? `\x1B[38;5;${TEXT_PRIMARY}m› ` : " ";
|
|
574891
|
-
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
574892
|
-
buf += `${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${
|
|
575104
|
+
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}`;
|
|
575105
|
+
buf += `${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}`;
|
|
574893
575106
|
}
|
|
574894
|
-
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575107
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL3}${BOX_H3.repeat(Math.max(0, boxInnerR))}${BOX_BR3}${RESET4}`;
|
|
574895
575108
|
} else {
|
|
574896
|
-
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575109
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL3}${BOX_H3.repeat(Math.max(0, boxInnerR))}${BOX_BR3}${RESET4}`;
|
|
574897
575110
|
}
|
|
574898
|
-
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${
|
|
575111
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET4}${PANEL_BG_SEQ}\x1B[?7h\x1B8` + // DEC restore cursor
|
|
574899
575112
|
(this.writeDepth === 0 ? `${CURSOR_BLINK_BLOCK}\x1B[?25h` : "");
|
|
574900
575113
|
this.termWrite(buf);
|
|
574901
575114
|
if (pos.tabBarRow > 0) this.renderAgentTabs();
|
|
@@ -574939,12 +575152,12 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574939
575152
|
}
|
|
574940
575153
|
buf += "\x1B[?7l";
|
|
574941
575154
|
const boxInnerH = w - 2;
|
|
574942
|
-
buf += `\x1B[${pos.inputStartRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575155
|
+
buf += `\x1B[${pos.inputStartRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_TL3}${BOX_H3.repeat(Math.max(0, boxInnerH))}${BOX_TR3}${RESET4}`;
|
|
574943
575156
|
for (let i2 = 0; i2 < inputWrap.lines.length; i2++) {
|
|
574944
575157
|
const row = pos.inputStartRow + 1 + i2;
|
|
574945
575158
|
const prefix = i2 === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
574946
575159
|
const lineContent = `${prefix}${inputWrap.lines[i2]}`;
|
|
574947
|
-
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575160
|
+
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}`;
|
|
574948
575161
|
}
|
|
574949
575162
|
if (this._suggestions.length > 0 && pos.suggestStartRow > 0) {
|
|
574950
575163
|
for (let si = 0; si < this._suggestions.length; si++) {
|
|
@@ -574954,14 +575167,14 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574954
575167
|
const bg = isHl ? `\x1B[48;5;235m` : PANEL_BG_SEQ;
|
|
574955
575168
|
const fg2 = isHl ? `\x1B[1;38;5;${TEXT_PRIMARY}m` : `\x1B[38;5;${TEXT_PRIMARY}m`;
|
|
574956
575169
|
const marker = isHl ? `\x1B[38;5;${TEXT_PRIMARY}m› ` : " ";
|
|
574957
|
-
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
575170
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
574958
575171
|
buf += `${bg} ${marker}\x1B[38;5;${TEXT_DIM}m/${fg2}${cmd}`;
|
|
574959
|
-
buf += `${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${
|
|
575172
|
+
buf += `${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}`;
|
|
574960
575173
|
}
|
|
574961
575174
|
}
|
|
574962
575175
|
const boxInnerS = w - 2;
|
|
574963
|
-
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${
|
|
574964
|
-
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${
|
|
575176
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL3}${BOX_H3.repeat(Math.max(0, boxInnerS))}${BOX_BR3}${RESET4}`;
|
|
575177
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET4}`;
|
|
574965
575178
|
buf += "\x1B[?7h";
|
|
574966
575179
|
buf += "\x1B8";
|
|
574967
575180
|
if (heightDelta > 0) {
|
|
@@ -574973,17 +575186,34 @@ ${CONTENT_BG_SEQ}`);
|
|
|
574973
575186
|
w1.call(process.stdout, buf);
|
|
574974
575187
|
if (heightDelta !== 0) this.refreshTasksPanelAfterLayoutChange();
|
|
574975
575188
|
} else {
|
|
574976
|
-
let buf = "\x1B[?7l";
|
|
575189
|
+
let buf = "\x1B7\x1B[?25l\x1B[?7l";
|
|
575190
|
+
const boxInnerH = w - 2;
|
|
575191
|
+
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}`;
|
|
574977
575192
|
for (let i2 = 0; i2 < inputWrap.lines.length; i2++) {
|
|
574978
575193
|
const row = pos.inputStartRow + 1 + i2;
|
|
574979
575194
|
const prefix = i2 === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
574980
575195
|
const lineContent = `${prefix}${inputWrap.lines[i2]}`;
|
|
574981
575196
|
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K`;
|
|
574982
|
-
buf += `${BOX_FG}${
|
|
575197
|
+
buf += `${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}${lineContent}`;
|
|
574983
575198
|
buf += `${PANEL_BG_SEQ}\x1B[K`;
|
|
574984
|
-
buf += `\x1B[${row};${w}H${BOX_FG}${
|
|
575199
|
+
buf += `\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
574985
575200
|
}
|
|
574986
|
-
|
|
575201
|
+
if (this._suggestions.length > 0 && pos.suggestStartRow > 0) {
|
|
575202
|
+
for (let si = 0; si < this._suggestions.length; si++) {
|
|
575203
|
+
const row = pos.suggestStartRow + si;
|
|
575204
|
+
const cmd = this._suggestions[si];
|
|
575205
|
+
const isHl = si === this._suggestIndex;
|
|
575206
|
+
const bg = isHl ? `\x1B[48;5;235m` : PANEL_BG_SEQ;
|
|
575207
|
+
const fg2 = isHl ? `\x1B[1;38;5;${TEXT_PRIMARY}m` : `\x1B[38;5;${TEXT_PRIMARY}m`;
|
|
575208
|
+
const marker = isHl ? `\x1B[38;5;${TEXT_PRIMARY}m› ` : " ";
|
|
575209
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
575210
|
+
buf += `${bg} ${marker}\x1B[38;5;${TEXT_DIM}m/${fg2}${cmd}`;
|
|
575211
|
+
buf += `${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${BOX_V3}${RESET4}${PANEL_BG_SEQ}`;
|
|
575212
|
+
}
|
|
575213
|
+
}
|
|
575214
|
+
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}`;
|
|
575215
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET4}${PANEL_BG_SEQ}`;
|
|
575216
|
+
buf += "\x1B[?7h\x1B8\x1B[?25l";
|
|
574987
575217
|
this.termWrite(buf);
|
|
574988
575218
|
}
|
|
574989
575219
|
}
|
|
@@ -578131,13 +578361,13 @@ ${c3.cyan(OMNIUS_FIRST_RUN_BANNER)}
|
|
|
578131
578361
|
const sw = 24;
|
|
578132
578362
|
const boxW = 52;
|
|
578133
578363
|
const boxLine = (content) => {
|
|
578134
|
-
const visLen =
|
|
578364
|
+
const visLen = visibleLen2(content);
|
|
578135
578365
|
const pad = Math.max(0, boxW - visLen);
|
|
578136
578366
|
return ` ${c3.dim("│")}${content}${" ".repeat(pad)}${c3.dim("│")}
|
|
578137
578367
|
`;
|
|
578138
578368
|
};
|
|
578139
578369
|
const boxWrappedDimLine = (content, indent = " ") => {
|
|
578140
|
-
const lines = wrapText(content, Math.max(1, boxW -
|
|
578370
|
+
const lines = wrapText(content, Math.max(1, boxW - visibleLen2(indent)));
|
|
578141
578371
|
for (const line of lines) {
|
|
578142
578372
|
process.stdout.write(boxLine(`${indent}${c3.dim(line)}`));
|
|
578143
578373
|
}
|
|
@@ -579392,7 +579622,7 @@ export PATH="${binDir}:$PATH" # Added by omnius for nvim
|
|
|
579392
579622
|
} catch {
|
|
579393
579623
|
}
|
|
579394
579624
|
}
|
|
579395
|
-
var execAsync2, OMNIUS_FIRST_RUN_BANNER, ANSI_RE,
|
|
579625
|
+
var execAsync2, OMNIUS_FIRST_RUN_BANNER, ANSI_RE, visibleLen2, QWEN_VARIANTS, _toolSupportCache, _cloudflaredInstallPromise;
|
|
579396
579626
|
var init_setup = __esm({
|
|
579397
579627
|
"packages/cli/src/tui/setup.ts"() {
|
|
579398
579628
|
"use strict";
|
|
@@ -579412,7 +579642,7 @@ var init_setup = __esm({
|
|
|
579412
579642
|
" ░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓██████▓▒░░▒▓███████▓▒░ "
|
|
579413
579643
|
].join("\n");
|
|
579414
579644
|
ANSI_RE = /\x1B\[[0-?]*[ -/]*[@-~]/g;
|
|
579415
|
-
|
|
579645
|
+
visibleLen2 = (value2) => Array.from(value2.replace(ANSI_RE, "")).length;
|
|
579416
579646
|
QWEN_VARIANTS = [
|
|
579417
579647
|
{ tag: "qwen3.5:0.8b", sizeGB: 1, label: "0.8B params (1.0 GB)", cloud: false },
|
|
579418
579648
|
{ tag: "qwen3.5:2b", sizeGB: 2.7, label: "2B params (2.7 GB)", cloud: false },
|
|
@@ -589511,6 +589741,13 @@ function formatCodegraphEventLine(ev) {
|
|
|
589511
589741
|
return `${ev.type} ${JSON.stringify(ev).slice(0, 120)}`;
|
|
589512
589742
|
}
|
|
589513
589743
|
}
|
|
589744
|
+
function renderContextHistory(ctx3, title = "Session History") {
|
|
589745
|
+
if (ctx3.renderSessionHistory?.(title)) return;
|
|
589746
|
+
const historyDisplay = ctx3.contextHistoryDisplay?.();
|
|
589747
|
+
if (!historyDisplay) return;
|
|
589748
|
+
process.stdout.write(historyDisplay.endsWith("\n") ? historyDisplay : `${historyDisplay}
|
|
589749
|
+
`);
|
|
589750
|
+
}
|
|
589514
589751
|
async function handleSlashCommand(input, ctx3) {
|
|
589515
589752
|
const trimmed = input.trim();
|
|
589516
589753
|
if (!trimmed.startsWith("/")) return "not_a_command";
|
|
@@ -594229,8 +594466,7 @@ sleep 1
|
|
|
594229
594466
|
renderInfo(
|
|
594230
594467
|
`Context restored from ${info?.entries ?? 0} saved session(s). Will be injected into your next task.`
|
|
594231
594468
|
);
|
|
594232
|
-
|
|
594233
|
-
if (historyDisplay) renderInfo(historyDisplay);
|
|
594469
|
+
renderContextHistory(ctx3, "Session History");
|
|
594234
594470
|
ctx3.setRestoredContext?.(prompt);
|
|
594235
594471
|
} else {
|
|
594236
594472
|
renderWarning(
|
|
@@ -594246,8 +594482,7 @@ sleep 1
|
|
|
594246
594482
|
renderInfo(
|
|
594247
594483
|
`Session context: ${info.entries} entries saved. Last saved: ${info.lastSaved ? new Date(info.lastSaved).toLocaleString() : "unknown"}`
|
|
594248
594484
|
);
|
|
594249
|
-
|
|
594250
|
-
if (historyDisplay) renderInfo(historyDisplay);
|
|
594485
|
+
renderContextHistory(ctx3, "Session History");
|
|
594251
594486
|
} else {
|
|
594252
594487
|
renderInfo(
|
|
594253
594488
|
"No session context saved yet. Context auto-saves on task completion."
|
|
@@ -603016,30 +603251,30 @@ function getNodeMnemonic() {
|
|
|
603016
603251
|
function createDefaultBanner(version4 = "0.120.0") {
|
|
603017
603252
|
const width = termCols();
|
|
603018
603253
|
const rows = headerHeight();
|
|
603019
|
-
const
|
|
603254
|
+
const accent = tuiAccent() < 0 ? -1 : tuiAccent();
|
|
603020
603255
|
const bgBlack = tuiBg() < 0 ? -1 : tuiBg();
|
|
603021
603256
|
const grid = [];
|
|
603022
603257
|
const innerW = width - 2;
|
|
603023
603258
|
const topRow = [];
|
|
603024
|
-
topRow.push({ char: "╭", fg:
|
|
603259
|
+
topRow.push({ char: "╭", fg: accent, bg: bgBlack, bold: false });
|
|
603025
603260
|
for (let c9 = 0; c9 < innerW; c9++) {
|
|
603026
|
-
topRow.push({ char: "─", fg:
|
|
603261
|
+
topRow.push({ char: "─", fg: accent, bg: bgBlack, bold: false });
|
|
603027
603262
|
}
|
|
603028
|
-
topRow.push({ char: "╮", fg:
|
|
603263
|
+
topRow.push({ char: "╮", fg: accent, bg: bgBlack, bold: false });
|
|
603029
603264
|
grid.push(topRow);
|
|
603030
603265
|
const midRow = [];
|
|
603031
|
-
midRow.push({ char: "│", fg:
|
|
603266
|
+
midRow.push({ char: "│", fg: accent, bg: bgBlack, bold: false });
|
|
603032
603267
|
for (let c9 = 0; c9 < innerW; c9++) {
|
|
603033
603268
|
midRow.push({ char: " ", fg: 0, bg: bgBlack, bold: false });
|
|
603034
603269
|
}
|
|
603035
|
-
midRow.push({ char: "│", fg:
|
|
603270
|
+
midRow.push({ char: "│", fg: accent, bg: bgBlack, bold: false });
|
|
603036
603271
|
grid.push(midRow);
|
|
603037
603272
|
const botRow = [];
|
|
603038
|
-
botRow.push({ char: "╰", fg:
|
|
603273
|
+
botRow.push({ char: "╰", fg: accent, bg: bgBlack, bold: false });
|
|
603039
603274
|
for (let c9 = 0; c9 < innerW; c9++) {
|
|
603040
|
-
botRow.push({ char: "─", fg:
|
|
603275
|
+
botRow.push({ char: "─", fg: accent, bg: bgBlack, bold: false });
|
|
603041
603276
|
}
|
|
603042
|
-
botRow.push({ char: "╯", fg:
|
|
603277
|
+
botRow.push({ char: "╯", fg: accent, bg: bgBlack, bold: false });
|
|
603043
603278
|
grid.push(botRow);
|
|
603044
603279
|
return {
|
|
603045
603280
|
id: "default-header",
|
|
@@ -649844,15 +650079,8 @@ ${entry.fullContent}`
|
|
|
649844
650079
|
event.toolName ?? "unknown",
|
|
649845
650080
|
event.success ?? false,
|
|
649846
650081
|
displayContent,
|
|
649847
|
-
config.verbose
|
|
650082
|
+
{ verbose: config.verbose, durationMs: toolDurationMs }
|
|
649848
650083
|
);
|
|
649849
|
-
if (config.verbose && toolDurationMs > 0) {
|
|
649850
|
-
const durStr = toolDurationMs < 1e3 ? `${toolDurationMs}ms` : `${(toolDurationMs / 1e3).toFixed(1)}s`;
|
|
649851
|
-
const sizeStr = resultLen > 0 ? ` | ${resultLen.toLocaleString()} chars (~${Math.ceil(resultLen / 4).toLocaleString()} tokens)` : "";
|
|
649852
|
-
renderVerbose(
|
|
649853
|
-
`${event.toolName ?? "unknown"}: ${durStr}${sizeStr}`
|
|
649854
|
-
);
|
|
649855
|
-
}
|
|
649856
650084
|
if (voice?.enabled && event.toolName !== "task_complete" && !displayContent.includes("[FORCED PROGRESS BLOCK") && (voice.voiceMode === "action" || voice.voiceMode === "verbose")) {
|
|
649857
650085
|
const emoState2 = emotionEngine?.getState();
|
|
649858
650086
|
const emoCtx2 = emoState2 ? {
|
|
@@ -651190,13 +651418,21 @@ ${result.summary}`
|
|
|
651190
651418
|
end: () => statusBar.endContentWrite(),
|
|
651191
651419
|
// During overlays, send render output to the alternate screen via overlayWrite;
|
|
651192
651420
|
// in neovim mode, route to the Agent Output pane. Otherwise, null (normal).
|
|
651193
|
-
redirect: () => isOverlayActive() ? overlayWrite : isNeovimActive() ? writeToNeovimOutput : null
|
|
651421
|
+
redirect: () => isOverlayActive() ? overlayWrite : isNeovimActive() ? writeToNeovimOutput : null,
|
|
651422
|
+
dynamicBlockHost: () => statusBar.isActive && !isOverlayActive() && !isNeovimActive() ? {
|
|
651423
|
+
registerDynamicBlock: (id, render2) => statusBar.registerDynamicBlock(id, render2),
|
|
651424
|
+
appendDynamicBlock: (id) => statusBar.appendDynamicBlock(id)
|
|
651425
|
+
} : null
|
|
651194
651426
|
});
|
|
651195
651427
|
}
|
|
651196
651428
|
setContentWriteHook({
|
|
651197
651429
|
begin: () => statusBar.beginContentWrite(),
|
|
651198
651430
|
end: () => statusBar.endContentWrite(),
|
|
651199
|
-
redirect: () => isNeovimActive() ? writeToNeovimOutput : null
|
|
651431
|
+
redirect: () => isNeovimActive() ? writeToNeovimOutput : null,
|
|
651432
|
+
dynamicBlockHost: () => statusBar.isActive && !isOverlayActive() && !isNeovimActive() ? {
|
|
651433
|
+
registerDynamicBlock: (id, render2) => statusBar.registerDynamicBlock(id, render2),
|
|
651434
|
+
appendDynamicBlock: (id) => statusBar.appendDynamicBlock(id)
|
|
651435
|
+
} : null
|
|
651200
651436
|
});
|
|
651201
651437
|
let resolvedContextWindowSize = 0;
|
|
651202
651438
|
queryContextSize(config.backendUrl, config.model, config.apiKey).then((ctxSize) => {
|
|
@@ -654695,6 +654931,18 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
654695
654931
|
contextHistoryDisplay() {
|
|
654696
654932
|
const ctx3 = loadSessionContext(repoRoot);
|
|
654697
654933
|
return formatSessionHistoryDisplay(ctx3);
|
|
654934
|
+
},
|
|
654935
|
+
renderSessionHistory(title = "Session History") {
|
|
654936
|
+
const ctx3 = loadSessionContext(repoRoot);
|
|
654937
|
+
if (!statusBar.isActive || isNeovimActive() || isOverlayActive()) return false;
|
|
654938
|
+
renderSessionHistoryBox(
|
|
654939
|
+
{
|
|
654940
|
+
registerDynamicBlock: (id, render2) => statusBar.registerDynamicBlock(id, render2),
|
|
654941
|
+
appendDynamicBlock: (id) => statusBar.appendDynamicBlock(id)
|
|
654942
|
+
},
|
|
654943
|
+
sessionContextToHistoryBoxData(ctx3, title)
|
|
654944
|
+
);
|
|
654945
|
+
return true;
|
|
654698
654946
|
}
|
|
654699
654947
|
};
|
|
654700
654948
|
commandCtxRef = commandCtx;
|
|
@@ -654818,8 +655066,19 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
654818
655066
|
renderInfo(
|
|
654819
655067
|
auto ? `Context auto-restored from ${info?.entries.length ?? 0} session(s).` : `Context restored from ${info?.entries.length ?? 0} session(s).`
|
|
654820
655068
|
);
|
|
654821
|
-
|
|
654822
|
-
|
|
655069
|
+
if (statusBar.isActive && !isNeovimActive() && !isOverlayActive()) {
|
|
655070
|
+
renderSessionHistoryBox(
|
|
655071
|
+
{
|
|
655072
|
+
registerDynamicBlock: (id, render2) => statusBar.registerDynamicBlock(id, render2),
|
|
655073
|
+
appendDynamicBlock: (id) => statusBar.appendDynamicBlock(id)
|
|
655074
|
+
},
|
|
655075
|
+
sessionContextToHistoryBoxData(info, "Session History")
|
|
655076
|
+
);
|
|
655077
|
+
} else {
|
|
655078
|
+
const historyDisplay = formatSessionHistoryDisplay(info);
|
|
655079
|
+
process.stdout.write(historyDisplay.endsWith("\n") ? historyDisplay : `${historyDisplay}
|
|
655080
|
+
`);
|
|
655081
|
+
}
|
|
654823
655082
|
});
|
|
654824
655083
|
} else {
|
|
654825
655084
|
writeContent(
|
|
@@ -654997,9 +655256,6 @@ ${result.content.slice(0, 2e3)}${result.content.length > 2e3 ? "\n[truncated]" :
|
|
|
654997
655256
|
if (!setupReady) return;
|
|
654998
655257
|
persistHistoryLine(line);
|
|
654999
655258
|
const input = line.trim();
|
|
655000
|
-
if (statusBar?.isActive && line.length > 0) {
|
|
655001
|
-
statusBar.redrawFooter();
|
|
655002
|
-
}
|
|
655003
655259
|
if (!input) {
|
|
655004
655260
|
if (pasteBuffer.length > 0) {
|
|
655005
655261
|
if (pasteIndicatorShown) {
|
|
@@ -656370,6 +656626,7 @@ var init_interactive = __esm({
|
|
|
656370
656626
|
init_dist7();
|
|
656371
656627
|
init_omnius_directory();
|
|
656372
656628
|
init_render();
|
|
656629
|
+
init_task_complete_box();
|
|
656373
656630
|
init_audio_waveform();
|
|
656374
656631
|
init_carousel();
|
|
656375
656632
|
init_banner();
|