@aiwayds/dsh-opentui 0.19.1 → 0.21.0
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/CHANGELOG.md +47 -0
- package/dist/client/index.js +733 -430
- package/dist/client/index.js.map +15 -14
- package/dist/locales/en.json +4 -0
- package/dist/locales/zh-CN.json +4 -0
- package/package.json +1 -1
package/dist/client/index.js
CHANGED
|
@@ -9370,6 +9370,7 @@ class RemoteHostSession {
|
|
|
9370
9370
|
#model;
|
|
9371
9371
|
#settings;
|
|
9372
9372
|
#journal = [];
|
|
9373
|
+
#rounds = 0;
|
|
9373
9374
|
#journalListeners = [];
|
|
9374
9375
|
#lastDurableSeq = -1;
|
|
9375
9376
|
#turnArmSeq = -1;
|
|
@@ -9645,6 +9646,7 @@ class RemoteHostSession {
|
|
|
9645
9646
|
sessionId: this.currentSessionId(),
|
|
9646
9647
|
model: this.label === "dsh-host" ? undefined : this.label,
|
|
9647
9648
|
turnCount: this.#turns,
|
|
9649
|
+
roundCount: this.#rounds,
|
|
9648
9650
|
tokensIn: this.usage.prompt,
|
|
9649
9651
|
tokensOut: this.usage.completion,
|
|
9650
9652
|
cacheRead: this.usage.cacheRead,
|
|
@@ -10439,6 +10441,7 @@ class RemoteHostSession {
|
|
|
10439
10441
|
#resetLedger() {
|
|
10440
10442
|
this.#journal = [];
|
|
10441
10443
|
this.#lastDurableSeq = -1;
|
|
10444
|
+
this.#rounds = 0;
|
|
10442
10445
|
this.#contextMeter.reset();
|
|
10443
10446
|
this.#contextPressure = undefined;
|
|
10444
10447
|
this.#contextProjections = undefined;
|
|
@@ -10525,6 +10528,8 @@ class RemoteHostSession {
|
|
|
10525
10528
|
onRecord: (entry) => {
|
|
10526
10529
|
if (entry.seq > this.#lastDurableSeq)
|
|
10527
10530
|
this.#lastDurableSeq = entry.seq;
|
|
10531
|
+
if (entry.type === "assistant/message")
|
|
10532
|
+
this.#rounds++;
|
|
10528
10533
|
this.#journal.push(entry);
|
|
10529
10534
|
if (this.#journal.length > 4000)
|
|
10530
10535
|
this.#journal.shift();
|
|
@@ -23192,6 +23197,8 @@ var init_keybind = __esm(() => {
|
|
|
23192
23197
|
"session.line.down": keybind("ctrl+alt+e", "Scroll messages down by one line"),
|
|
23193
23198
|
"session.half.page.up": keybind("ctrl+alt+u", "Scroll messages up by half page"),
|
|
23194
23199
|
"session.half.page.down": keybind("ctrl+alt+d", "Scroll messages down by half page"),
|
|
23200
|
+
"session.dock.scroll.up": keybind("ctrl+alt+up", "Scroll the activity lower zone up"),
|
|
23201
|
+
"session.dock.scroll.down": keybind("ctrl+alt+down", "Scroll the activity lower zone down"),
|
|
23195
23202
|
"session.first": keybind("ctrl+home,home,alt+home", "Navigate to first message"),
|
|
23196
23203
|
"session.last": keybind("ctrl+alt+g,end", "Navigate to last message"),
|
|
23197
23204
|
"session.message.next": keybind("none", "Navigate to next message"),
|
|
@@ -46277,14 +46284,9 @@ function clipToWidth(text, limit) {
|
|
|
46277
46284
|
const flat = text.replace(/\s+/u, " ").trim();
|
|
46278
46285
|
if (stringWidth(flat) <= limit)
|
|
46279
46286
|
return flat;
|
|
46280
|
-
|
|
46281
|
-
|
|
46282
|
-
|
|
46283
|
-
if (width > limit - 1) {
|
|
46284
|
-
return limit <= 1 ? "\u2026" : `${flat.slice(0, i)}\u2026`;
|
|
46285
|
-
}
|
|
46286
|
-
}
|
|
46287
|
-
return flat;
|
|
46287
|
+
if (limit === 1)
|
|
46288
|
+
return "\u2026";
|
|
46289
|
+
return `${takeWidth(flat, limit - 1)}\u2026`;
|
|
46288
46290
|
}
|
|
46289
46291
|
function firstWord(value) {
|
|
46290
46292
|
return value.trim().split(/\s+/u)[0] ?? "";
|
|
@@ -46424,6 +46426,7 @@ function toolResultLine(output, limit = 120) {
|
|
|
46424
46426
|
}
|
|
46425
46427
|
var TOOL_RESULT_PLACEHOLDER = "tool result";
|
|
46426
46428
|
var init_tool_summarize = __esm(() => {
|
|
46429
|
+
init_locale();
|
|
46427
46430
|
init_string_width();
|
|
46428
46431
|
});
|
|
46429
46432
|
|
|
@@ -48559,7 +48562,7 @@ function brandSegment(theme, presetLabel, mode = "dark") {
|
|
|
48559
48562
|
function providerSegment(provider, theme, mode = "dark") {
|
|
48560
48563
|
if (!provider)
|
|
48561
48564
|
return null;
|
|
48562
|
-
const label = `\
|
|
48565
|
+
const label = `\uD83C\uDF10 ${provider}`;
|
|
48563
48566
|
if (!theme)
|
|
48564
48567
|
return {
|
|
48565
48568
|
text: label,
|
|
@@ -48638,15 +48641,44 @@ function contextSegment(used, window, theme) {
|
|
|
48638
48641
|
}
|
|
48639
48642
|
};
|
|
48640
48643
|
}
|
|
48641
|
-
function
|
|
48644
|
+
function turnsSegment(n, theme) {
|
|
48642
48645
|
if (!Number.isFinite(n) || n < 0)
|
|
48643
48646
|
return null;
|
|
48644
48647
|
return {
|
|
48645
|
-
text: t("footer.
|
|
48648
|
+
text: t(n === 1 ? "footer.turns.one" : "footer.turns.many", {
|
|
48646
48649
|
n
|
|
48647
48650
|
}),
|
|
48648
48651
|
bg: resolvePalette(theme).messages,
|
|
48649
|
-
priority:
|
|
48652
|
+
priority: 75
|
|
48653
|
+
};
|
|
48654
|
+
}
|
|
48655
|
+
function roundsSegment(n, theme) {
|
|
48656
|
+
if (!Number.isFinite(n) || n < 0)
|
|
48657
|
+
return null;
|
|
48658
|
+
return {
|
|
48659
|
+
text: t(n === 1 ? "footer.rounds.one" : "footer.rounds.many", {
|
|
48660
|
+
n
|
|
48661
|
+
}),
|
|
48662
|
+
bg: resolvePalette(theme).messages,
|
|
48663
|
+
priority: 75
|
|
48664
|
+
};
|
|
48665
|
+
}
|
|
48666
|
+
function turnsRoundsSegment(turns, rounds, theme) {
|
|
48667
|
+
const turnLeaf = turnsSegment(turns, theme);
|
|
48668
|
+
if (!turnLeaf)
|
|
48669
|
+
return null;
|
|
48670
|
+
if (rounds === undefined)
|
|
48671
|
+
return {
|
|
48672
|
+
...turnLeaf,
|
|
48673
|
+
priority: 75
|
|
48674
|
+
};
|
|
48675
|
+
const roundLeaf = roundsSegment(rounds, theme);
|
|
48676
|
+
if (!roundLeaf)
|
|
48677
|
+
return null;
|
|
48678
|
+
return {
|
|
48679
|
+
text: `${turnLeaf.text} \xB7 ${roundLeaf.text}`,
|
|
48680
|
+
bg: turnLeaf.bg,
|
|
48681
|
+
priority: 75
|
|
48650
48682
|
};
|
|
48651
48683
|
}
|
|
48652
48684
|
function toolSegment(n, theme) {
|
|
@@ -48919,8 +48951,8 @@ function sessionFooterSegments(data) {
|
|
|
48919
48951
|
add(modelSegment(data.model ?? "", effectiveEffort(data.effort), theme));
|
|
48920
48952
|
add(contextSegment(data.contextTokens ?? null, data.contextWindow ?? null, theme));
|
|
48921
48953
|
add(cacheSegment(data.cacheHitRate ?? null, theme));
|
|
48922
|
-
if (data.
|
|
48923
|
-
add(
|
|
48954
|
+
if (data.turns !== undefined)
|
|
48955
|
+
add(turnsRoundsSegment(data.turns, data.rounds, theme));
|
|
48924
48956
|
add(toolSegment(data.tools ?? 0, theme));
|
|
48925
48957
|
add(elapsedSegment(data.elapsedSec ?? null, theme));
|
|
48926
48958
|
add(speedSegment(data.tps ?? null, theme));
|
|
@@ -49003,6 +49035,303 @@ var init_powerline = __esm(() => {
|
|
|
49003
49035
|
};
|
|
49004
49036
|
});
|
|
49005
49037
|
|
|
49038
|
+
// ../tui-base/src/routes/session/merged-dock.ts
|
|
49039
|
+
function activeTodos(todos) {
|
|
49040
|
+
const out = [];
|
|
49041
|
+
for (let i = 0;i < todos.length; i++) {
|
|
49042
|
+
const todo = todos[i];
|
|
49043
|
+
if (todo.status === "in_progress")
|
|
49044
|
+
out.push({ ...todo, index: i + 1 });
|
|
49045
|
+
}
|
|
49046
|
+
return out;
|
|
49047
|
+
}
|
|
49048
|
+
function attributeAgents(todos, agents) {
|
|
49049
|
+
let parent = null;
|
|
49050
|
+
for (let i = 0;i < todos.length; i++) {
|
|
49051
|
+
const todo = todos[i];
|
|
49052
|
+
if (todo.status === "in_progress")
|
|
49053
|
+
parent = { todo, index: i + 1 };
|
|
49054
|
+
}
|
|
49055
|
+
return { parent, agents: agents.filter((agent) => agent.status === "running") };
|
|
49056
|
+
}
|
|
49057
|
+
function mergedTitle(parts) {
|
|
49058
|
+
if (parts.tool)
|
|
49059
|
+
return parts.subagent ? "\uD83D\uDD27 tool \xB7 \uD83E\uDD16 subagent" : "\uD83D\uDD27 tool";
|
|
49060
|
+
if (parts.subagent)
|
|
49061
|
+
return "\uD83E\uDD16 subagent";
|
|
49062
|
+
if (parts.think)
|
|
49063
|
+
return "\uD83D\uDCAD think";
|
|
49064
|
+
return "\uD83E\uDDE9 activity";
|
|
49065
|
+
}
|
|
49066
|
+
function mergedPositionSuffix(info) {
|
|
49067
|
+
return info.overflow ? `${info.position}/${info.total}` : null;
|
|
49068
|
+
}
|
|
49069
|
+
function lineWidth(line) {
|
|
49070
|
+
return line.segments.reduce((sum, segment) => sum + stringWidth(segment.text), 0);
|
|
49071
|
+
}
|
|
49072
|
+
function padTo(text, width) {
|
|
49073
|
+
return text + " ".repeat(Math.max(0, width - stringWidth(text)));
|
|
49074
|
+
}
|
|
49075
|
+
function clearBrokenMarker(line) {
|
|
49076
|
+
const marker = line.marker;
|
|
49077
|
+
if (marker === undefined)
|
|
49078
|
+
return line;
|
|
49079
|
+
const markerAt = line.markerAt ?? 0;
|
|
49080
|
+
const joined = line.segments.map((segment) => segment.text).join("");
|
|
49081
|
+
if (markerAt < 0 || markerAt + marker.length > joined.length || joined.slice(markerAt, markerAt + marker.length) !== marker) {
|
|
49082
|
+
const { marker: _marker, markerAt: _markerAt, ...rest } = line;
|
|
49083
|
+
return rest;
|
|
49084
|
+
}
|
|
49085
|
+
return line;
|
|
49086
|
+
}
|
|
49087
|
+
function fitLine(line, innerWidth) {
|
|
49088
|
+
const width = Math.max(0, Math.floor(innerWidth));
|
|
49089
|
+
if (lineWidth(line) === width)
|
|
49090
|
+
return line;
|
|
49091
|
+
const segments = line.segments;
|
|
49092
|
+
if (segments.length === 0)
|
|
49093
|
+
return line;
|
|
49094
|
+
const prefixWidth = segments.slice(0, -1).reduce((sum, segment) => sum + stringWidth(segment.text), 0);
|
|
49095
|
+
if (prefixWidth >= width) {
|
|
49096
|
+
const first = segments[0];
|
|
49097
|
+
const full = segments.map((segment) => segment.text).join("");
|
|
49098
|
+
return clearBrokenMarker({ ...line, segments: [{ ...first, text: padTo(takeWidth(full, width), width) }] });
|
|
49099
|
+
}
|
|
49100
|
+
const last = segments[segments.length - 1];
|
|
49101
|
+
const avail = width - prefixWidth;
|
|
49102
|
+
const cropped = takeWidth(last.text, avail);
|
|
49103
|
+
return clearBrokenMarker({ ...line, segments: [...segments.slice(0, -1), { ...last, text: padTo(cropped, avail) }] });
|
|
49104
|
+
}
|
|
49105
|
+
function widthTail(text, maxWidth) {
|
|
49106
|
+
if (maxWidth <= 0)
|
|
49107
|
+
return "";
|
|
49108
|
+
const parts = graphemes(text);
|
|
49109
|
+
let out = "";
|
|
49110
|
+
let used = 0;
|
|
49111
|
+
for (let i = parts.length - 1;i >= 0; i--) {
|
|
49112
|
+
const next = stringWidth(parts[i]);
|
|
49113
|
+
if (used + next > maxWidth)
|
|
49114
|
+
break;
|
|
49115
|
+
out = parts[i] + out;
|
|
49116
|
+
used += next;
|
|
49117
|
+
}
|
|
49118
|
+
return out;
|
|
49119
|
+
}
|
|
49120
|
+
function secsFrom(startedAt, elapsedSec, now) {
|
|
49121
|
+
if (startedAt !== undefined)
|
|
49122
|
+
return `${((now - startedAt) / 1000).toFixed(1)}s`;
|
|
49123
|
+
if (elapsedSec !== undefined)
|
|
49124
|
+
return `${elapsedSec.toFixed(1)}s`;
|
|
49125
|
+
return "0.0s";
|
|
49126
|
+
}
|
|
49127
|
+
function toneForTool(status) {
|
|
49128
|
+
return status === "failed" ? "failed" : status === "done" ? "ok" : "running";
|
|
49129
|
+
}
|
|
49130
|
+
function toolElapsed(tool, now) {
|
|
49131
|
+
return tool.status === "running" ? secsFrom(tool.startedAt, undefined, now) : secsFrom(undefined, tool.elapsedSec, now);
|
|
49132
|
+
}
|
|
49133
|
+
function coexistenceToolLine(tool, now, spin) {
|
|
49134
|
+
spin();
|
|
49135
|
+
const marker = toolMarker(tool.status);
|
|
49136
|
+
const elapsed = toolElapsed(tool, now);
|
|
49137
|
+
const tone = toneForTool(tool.status);
|
|
49138
|
+
return {
|
|
49139
|
+
kind: "tool",
|
|
49140
|
+
segments: [
|
|
49141
|
+
{ text: `${marker} `, tone },
|
|
49142
|
+
{ text: `${tool.name} \xB7 ${elapsed}`, tone, accent: "tool" }
|
|
49143
|
+
],
|
|
49144
|
+
id: `dock:tool:${tool.key}`,
|
|
49145
|
+
fadeOutAt: tool.status !== "running" ? skinStopAt(tool) : undefined,
|
|
49146
|
+
marker,
|
|
49147
|
+
markerAt: 0
|
|
49148
|
+
};
|
|
49149
|
+
}
|
|
49150
|
+
function toolOnlyLine(tool, now, spin) {
|
|
49151
|
+
const text = toolLineText(tool, spin, now);
|
|
49152
|
+
const marker = toolMarker(tool.status);
|
|
49153
|
+
const tone = toneForTool(tool.status);
|
|
49154
|
+
return {
|
|
49155
|
+
kind: "tool",
|
|
49156
|
+
segments: [
|
|
49157
|
+
{ text: marker, tone },
|
|
49158
|
+
{ text: text.slice(marker.length), tone, accent: "tool" }
|
|
49159
|
+
],
|
|
49160
|
+
id: `dock:tool:${tool.key}`,
|
|
49161
|
+
fadeOutAt: tool.status !== "running" ? skinStopAt(tool) : undefined,
|
|
49162
|
+
marker,
|
|
49163
|
+
markerAt: 0
|
|
49164
|
+
};
|
|
49165
|
+
}
|
|
49166
|
+
function latestThinkRow(rows) {
|
|
49167
|
+
const live = [...rows].reverse().find((row) => row.streaming === true);
|
|
49168
|
+
if (live !== undefined)
|
|
49169
|
+
return live;
|
|
49170
|
+
for (let i = rows.length - 1;i >= 0; i--) {
|
|
49171
|
+
const row = rows[i];
|
|
49172
|
+
if (row.elapsedSec !== undefined)
|
|
49173
|
+
return row;
|
|
49174
|
+
}
|
|
49175
|
+
return;
|
|
49176
|
+
}
|
|
49177
|
+
function thinkLine(row, now, spin) {
|
|
49178
|
+
const text = thinkBlockLines(row, spin, 1, now)[0];
|
|
49179
|
+
if (text === undefined)
|
|
49180
|
+
return;
|
|
49181
|
+
return {
|
|
49182
|
+
kind: "think",
|
|
49183
|
+
segments: [{ text, tone: "running", accent: "think" }],
|
|
49184
|
+
italic: true,
|
|
49185
|
+
id: `dock:think:${row.key}`,
|
|
49186
|
+
fadeOutAt: row.streaming === true ? undefined : skinStopAt(row)
|
|
49187
|
+
};
|
|
49188
|
+
}
|
|
49189
|
+
function todoLine(todo) {
|
|
49190
|
+
const glyph = TODO_STATUS_GLYPHS.in_progress;
|
|
49191
|
+
return {
|
|
49192
|
+
kind: "todo",
|
|
49193
|
+
index: todo.index,
|
|
49194
|
+
segments: [
|
|
49195
|
+
{ text: `${glyph} ${todo.index} `, tone: "running" },
|
|
49196
|
+
{ text: todo.content, tone: "running" }
|
|
49197
|
+
]
|
|
49198
|
+
};
|
|
49199
|
+
}
|
|
49200
|
+
function agentLine(agent, position, count, parentIndex, now = Date.now()) {
|
|
49201
|
+
const branch = position === count - 1 ? "\u2514\u2500 " : "\u251C\u2500 ";
|
|
49202
|
+
const indent = parentIndex === undefined ? "" : " ".repeat(stringWidth(`${TODO_STATUS_GLYPHS.in_progress} ${parentIndex} `));
|
|
49203
|
+
const elapsed = secsFrom(agent.startedAt, agent.elapsedSec, now);
|
|
49204
|
+
const tail = widthTail(agent.lastLine ?? "", 32);
|
|
49205
|
+
const content = `${agent.label} \xB7 ${elapsed} \xB7 round ${agent.rounds} \xB7 ${tail}`;
|
|
49206
|
+
return {
|
|
49207
|
+
kind: "agent",
|
|
49208
|
+
index: parentIndex,
|
|
49209
|
+
segments: [
|
|
49210
|
+
{ text: `${indent}${branch}`, tone: "muted" },
|
|
49211
|
+
{ text: content, tone: "running" }
|
|
49212
|
+
]
|
|
49213
|
+
};
|
|
49214
|
+
}
|
|
49215
|
+
function indicatorLine(kind, count) {
|
|
49216
|
+
return {
|
|
49217
|
+
kind,
|
|
49218
|
+
segments: [{ text: `${kind === "more-top" ? "\u25B2" : "\u25BC"} ${count} more`, tone: "muted" }]
|
|
49219
|
+
};
|
|
49220
|
+
}
|
|
49221
|
+
function clamp5(value, lo, hi) {
|
|
49222
|
+
return Math.max(lo, Math.min(hi, value));
|
|
49223
|
+
}
|
|
49224
|
+
function mergedDockLines(data, options) {
|
|
49225
|
+
return buildMergedDock(data, options).lines;
|
|
49226
|
+
}
|
|
49227
|
+
function mergedWindowInfo(data, options) {
|
|
49228
|
+
return buildMergedDock(data, options).info;
|
|
49229
|
+
}
|
|
49230
|
+
function buildMergedDock(data, options) {
|
|
49231
|
+
const now = options.now ?? Date.now();
|
|
49232
|
+
const spin = options.spin ?? (() => 0);
|
|
49233
|
+
const active = activeTodos(data.todos);
|
|
49234
|
+
const attribution = attributeAgents(data.todos, data.agents);
|
|
49235
|
+
const agents = attribution.agents;
|
|
49236
|
+
const parent = attribution.parent;
|
|
49237
|
+
const hasLowerContent = active.length > 0 || agents.length > 0;
|
|
49238
|
+
const thinkRow = latestThinkRow(data.think ?? []);
|
|
49239
|
+
const thinkLines = thinkRow === undefined ? [] : [thinkLine(thinkRow, now, spin)].filter((line) => line !== undefined);
|
|
49240
|
+
const tools = data.tools;
|
|
49241
|
+
let toolLines;
|
|
49242
|
+
if (hasLowerContent) {
|
|
49243
|
+
const latest = tools.length > 0 ? tools[tools.length - 1] : undefined;
|
|
49244
|
+
toolLines = latest ? [coexistenceToolLine(latest, now, spin)] : [];
|
|
49245
|
+
} else {
|
|
49246
|
+
toolLines = tools.slice(-MERGED_DOCK_TOOL_ONLY_MAX).map((tool) => toolOnlyLine(tool, now, spin));
|
|
49247
|
+
}
|
|
49248
|
+
const upperLines = [...thinkLines, ...toolLines];
|
|
49249
|
+
const lowerRaw = [];
|
|
49250
|
+
for (const todo of active) {
|
|
49251
|
+
lowerRaw.push(todoLine(todo));
|
|
49252
|
+
if (parent && parent.index === todo.index) {
|
|
49253
|
+
agents.forEach((agent, i) => lowerRaw.push(agentLine(agent, i, agents.length, todo.index, now)));
|
|
49254
|
+
}
|
|
49255
|
+
}
|
|
49256
|
+
if (!parent) {
|
|
49257
|
+
agents.forEach((agent, i) => lowerRaw.push(agentLine(agent, i, agents.length, undefined, now)));
|
|
49258
|
+
}
|
|
49259
|
+
const assembled = assembleZones(upperLines, lowerRaw, options.totalLines ?? MERGED_DOCK_TOTAL_LINES, options.cursor);
|
|
49260
|
+
return { lines: fitAll(assembled.lines, options.innerWidth), info: assembled.info };
|
|
49261
|
+
}
|
|
49262
|
+
function assembleZones(upperLines, lowerRaw, totalLines, cursor) {
|
|
49263
|
+
const n = lowerRaw.length;
|
|
49264
|
+
const noWindow = () => ({ total: n, position: 1, start: 0, size: 0, overflow: false, maxCursor: 0 });
|
|
49265
|
+
if (totalLines <= 0)
|
|
49266
|
+
return { lines: [], info: noWindow() };
|
|
49267
|
+
const upper = upperLines.length <= totalLines ? upperLines : upperLines.slice(-totalLines);
|
|
49268
|
+
const lowerBudget = totalLines - upper.length;
|
|
49269
|
+
if (lowerBudget < 1)
|
|
49270
|
+
return { lines: [...upper], info: noWindow() };
|
|
49271
|
+
if (n <= lowerBudget) {
|
|
49272
|
+
return {
|
|
49273
|
+
lines: [...upper, ...lowerRaw],
|
|
49274
|
+
info: { total: n, position: 1, start: 0, size: n, overflow: false, maxCursor: 0 }
|
|
49275
|
+
};
|
|
49276
|
+
}
|
|
49277
|
+
if (lowerBudget === 1) {
|
|
49278
|
+
const maxCursor = n - 1;
|
|
49279
|
+
const start = clamp5(cursor ?? 0, 0, maxCursor);
|
|
49280
|
+
return {
|
|
49281
|
+
lines: [...upper, lowerRaw[start]],
|
|
49282
|
+
info: { total: n, position: start + 1, start, size: 1, overflow: true, maxCursor }
|
|
49283
|
+
};
|
|
49284
|
+
}
|
|
49285
|
+
let size = lowerBudget - 1;
|
|
49286
|
+
let maxCursor = n - size;
|
|
49287
|
+
let start = clamp5(cursor ?? 0, 0, maxCursor);
|
|
49288
|
+
let needTop = start > 0;
|
|
49289
|
+
let needBottom = start + size < n;
|
|
49290
|
+
if (needTop && needBottom) {
|
|
49291
|
+
if (lowerBudget < 3) {
|
|
49292
|
+
maxCursor = n - lowerBudget;
|
|
49293
|
+
start = clamp5(cursor ?? 0, 0, maxCursor);
|
|
49294
|
+
return {
|
|
49295
|
+
lines: [...upper, ...lowerRaw.slice(start, start + lowerBudget)],
|
|
49296
|
+
info: { total: n, position: start + 1, start, size: lowerBudget, overflow: true, maxCursor }
|
|
49297
|
+
};
|
|
49298
|
+
}
|
|
49299
|
+
size = lowerBudget - 2;
|
|
49300
|
+
maxCursor = n - size - 1;
|
|
49301
|
+
start = clamp5(cursor ?? 0, 1, maxCursor);
|
|
49302
|
+
needTop = start > 0;
|
|
49303
|
+
needBottom = start + size < n;
|
|
49304
|
+
}
|
|
49305
|
+
const topCount = start;
|
|
49306
|
+
const bottomCount = n - (start + size);
|
|
49307
|
+
const window = lowerRaw.slice(start, start + size);
|
|
49308
|
+
const lower = [];
|
|
49309
|
+
if (topCount > 0)
|
|
49310
|
+
lower.push(indicatorLine("more-top", topCount));
|
|
49311
|
+
lower.push(...window);
|
|
49312
|
+
if (bottomCount > 0)
|
|
49313
|
+
lower.push(indicatorLine("more-bottom", bottomCount));
|
|
49314
|
+
return {
|
|
49315
|
+
lines: [...upper, ...lower],
|
|
49316
|
+
info: { total: n, position: start + 1, start, size, overflow: topCount + bottomCount > 0, maxCursor }
|
|
49317
|
+
};
|
|
49318
|
+
}
|
|
49319
|
+
function fitAll(lines, innerWidth) {
|
|
49320
|
+
return lines.map((line) => fitLine(line, innerWidth));
|
|
49321
|
+
}
|
|
49322
|
+
var MERGED_DOCK_TOTAL_LINES = 10, MERGED_DOCK_TOOL_ONLY_MAX = 3, TODO_STATUS_GLYPHS;
|
|
49323
|
+
var init_merged_dock = __esm(() => {
|
|
49324
|
+
init_locale();
|
|
49325
|
+
init_string_width();
|
|
49326
|
+
init_widgets_dock();
|
|
49327
|
+
TODO_STATUS_GLYPHS = {
|
|
49328
|
+
pending: "\u25CB",
|
|
49329
|
+
in_progress: "\u25CF",
|
|
49330
|
+
completed: "\u2713",
|
|
49331
|
+
cancelled: "\u2298"
|
|
49332
|
+
};
|
|
49333
|
+
});
|
|
49334
|
+
|
|
49006
49335
|
// ../tui-base/src/routes/session/widgets-dock.tsx
|
|
49007
49336
|
import { parseColor as parseColor3, TextAttributes as TextAttributes5 } from "@opentui/core";
|
|
49008
49337
|
function mixSkinColor(a, b, t) {
|
|
@@ -49116,6 +49445,9 @@ function skinDockLineFg(ctx, target, line) {
|
|
|
49116
49445
|
const t = skinLineFadeT(id);
|
|
49117
49446
|
return t >= 1 ? target : skinFadeInColor(target, ctx.background, t * SKIN_FADE_IN_MS);
|
|
49118
49447
|
}
|
|
49448
|
+
function resetMergedDockCursor() {
|
|
49449
|
+
setMergedDockCursor(0);
|
|
49450
|
+
}
|
|
49119
49451
|
function todoArray(text) {
|
|
49120
49452
|
if (text === undefined || text.trim() === "")
|
|
49121
49453
|
return;
|
|
@@ -49129,47 +49461,6 @@ function todoArray(text) {
|
|
|
49129
49461
|
} catch {}
|
|
49130
49462
|
return;
|
|
49131
49463
|
}
|
|
49132
|
-
function todoIcon(status) {
|
|
49133
|
-
if (status === "completed")
|
|
49134
|
-
return "\u2611";
|
|
49135
|
-
if (status === "in_progress")
|
|
49136
|
-
return "\u25D0";
|
|
49137
|
-
return "\u2610";
|
|
49138
|
-
}
|
|
49139
|
-
function statusRank(status) {
|
|
49140
|
-
if (status === "in_progress")
|
|
49141
|
-
return 0;
|
|
49142
|
-
if (status === "completed")
|
|
49143
|
-
return 2;
|
|
49144
|
-
return 1;
|
|
49145
|
-
}
|
|
49146
|
-
function compactRanges(numbers) {
|
|
49147
|
-
if (numbers.length === 0)
|
|
49148
|
-
return "";
|
|
49149
|
-
const runs = [];
|
|
49150
|
-
let start = numbers[0];
|
|
49151
|
-
let prev = start;
|
|
49152
|
-
for (const n of numbers.slice(1)) {
|
|
49153
|
-
if (n === prev + 1) {
|
|
49154
|
-
prev = n;
|
|
49155
|
-
continue;
|
|
49156
|
-
}
|
|
49157
|
-
runs.push(start === prev ? `${start}` : `${start}-${prev}`);
|
|
49158
|
-
start = prev = n;
|
|
49159
|
-
}
|
|
49160
|
-
runs.push(start === prev ? `${start}` : `${start}-${prev}`);
|
|
49161
|
-
return runs.join(",");
|
|
49162
|
-
}
|
|
49163
|
-
function padCell2(text, width, align = "left") {
|
|
49164
|
-
const flat = text.replace(/[\r\n]+/g, " ").trim();
|
|
49165
|
-
const clipped = clipToWidth(flat, width);
|
|
49166
|
-
const pad = Math.max(0, width - stringWidth(clipped));
|
|
49167
|
-
return align === "right" ? " ".repeat(pad) + clipped : clipped + " ".repeat(pad);
|
|
49168
|
-
}
|
|
49169
|
-
function borderedRow(boxWidth, inner) {
|
|
49170
|
-
const pad = Math.max(0, boxWidth - 4 - stringWidth(inner));
|
|
49171
|
-
return `\u2502 ${inner}${" ".repeat(pad)} \u2502`;
|
|
49172
|
-
}
|
|
49173
49464
|
function latestTodos(rows) {
|
|
49174
49465
|
const todoTool = [...rows].reverse().find((row) => row.kind === "tool" && TODO_TOOL_NAMES.has(row.name) && row.output !== undefined && row.status !== "failed");
|
|
49175
49466
|
if (todoTool?.kind !== "tool")
|
|
@@ -49191,63 +49482,6 @@ function todosSummaryLine(rows) {
|
|
|
49191
49482
|
});
|
|
49192
49483
|
return active ? `${head} \xB7 ${active.content}` : head;
|
|
49193
49484
|
}
|
|
49194
|
-
function todosTableWidth(terminalColumns) {
|
|
49195
|
-
return Math.max(16, terminalColumns - 1);
|
|
49196
|
-
}
|
|
49197
|
-
function todosTableLines(rows, width, terminalRows) {
|
|
49198
|
-
const todos = latestTodos(rows);
|
|
49199
|
-
if (todos.length === 0 || todos.every((todo) => todo.status === "completed"))
|
|
49200
|
-
return [];
|
|
49201
|
-
if (terminalRows !== undefined && terminalRows <= COMPOSER_COMPACT_TERMINAL_ROWS) {
|
|
49202
|
-
return [{
|
|
49203
|
-
text: todosSummaryLine(rows),
|
|
49204
|
-
tone: "muted",
|
|
49205
|
-
id: "dock:todos"
|
|
49206
|
-
}];
|
|
49207
|
-
}
|
|
49208
|
-
const boxWidth = Math.max(16, width);
|
|
49209
|
-
const innerWidth = boxWidth - 4;
|
|
49210
|
-
const colWidths = [3, 2, Math.max(1, innerWidth - 5 - TABLE_SEP.length * 2)];
|
|
49211
|
-
const border = "\u2500".repeat(Math.max(0, boxWidth - 2));
|
|
49212
|
-
const window = todos.map((todo, index) => ({
|
|
49213
|
-
todo,
|
|
49214
|
-
index
|
|
49215
|
-
})).sort((a, b) => statusRank(a.todo.status) - statusRank(b.todo.status) || (a.todo.status === "completed" ? b.index - a.index : a.index - b.index)).slice(0, TODO_MAX_ROWS).sort((a, b) => a.index - b.index);
|
|
49216
|
-
const done = todos.filter((todo) => todo.status === "completed").length;
|
|
49217
|
-
const showing = window.length < todos.length ? ` \xB7 ${t("overlay.widgets.todosShowing", {
|
|
49218
|
-
ranges: compactRanges(window.map((entry) => entry.index + 1))
|
|
49219
|
-
})}` : "";
|
|
49220
|
-
const header = clipToWidth(t("overlay.widgets.todosHeader", {
|
|
49221
|
-
done,
|
|
49222
|
-
total: todos.length
|
|
49223
|
-
}) + showing, innerWidth);
|
|
49224
|
-
const out = [{
|
|
49225
|
-
text: `\u250C${border}\u2510`,
|
|
49226
|
-
tone: "muted"
|
|
49227
|
-
}, {
|
|
49228
|
-
text: borderedRow(boxWidth, header),
|
|
49229
|
-
tone: "muted"
|
|
49230
|
-
}, {
|
|
49231
|
-
text: borderedRow(boxWidth, [padCell2("#", colWidths[0], "right"), padCell2("\u2713", colWidths[1]), padCell2(t("overlay.widgets.taskColumn"), colWidths[2])].join(TABLE_SEP)),
|
|
49232
|
-
tone: "muted"
|
|
49233
|
-
}];
|
|
49234
|
-
for (const {
|
|
49235
|
-
todo,
|
|
49236
|
-
index
|
|
49237
|
-
} of window) {
|
|
49238
|
-
const cells = [padCell2(String(index + 1), colWidths[0], "right"), padCell2(todoIcon(todo.status), colWidths[1]), padCell2(todo.content, colWidths[2])].join(TABLE_SEP);
|
|
49239
|
-
const tone = todo.status === "completed" ? "ok" : todo.status === "in_progress" ? "running" : "muted";
|
|
49240
|
-
out.push({
|
|
49241
|
-
text: borderedRow(boxWidth, cells),
|
|
49242
|
-
tone
|
|
49243
|
-
});
|
|
49244
|
-
}
|
|
49245
|
-
out.push({
|
|
49246
|
-
text: `\u2514${border}\u2518`,
|
|
49247
|
-
tone: "muted"
|
|
49248
|
-
});
|
|
49249
|
-
return out;
|
|
49250
|
-
}
|
|
49251
49485
|
function toolMarker(status) {
|
|
49252
49486
|
return status === "running" ? "\u2699" : status === "failed" ? "\u2718" : "\u2714";
|
|
49253
49487
|
}
|
|
@@ -49557,6 +49791,34 @@ function createFrameLatch(ms = ACTIVITY_FRAME_DEFER_MS) {
|
|
|
49557
49791
|
dispose: clear
|
|
49558
49792
|
};
|
|
49559
49793
|
}
|
|
49794
|
+
function mergedToolRows(rows, now, decorated) {
|
|
49795
|
+
return rows.filter((row) => row.kind === "tool" && row.key.startsWith("tool:live:")).filter((row) => {
|
|
49796
|
+
if (row.faded === true && row.status !== "running")
|
|
49797
|
+
return false;
|
|
49798
|
+
if (row.status === "running")
|
|
49799
|
+
return true;
|
|
49800
|
+
const stopAt = skinStopAt(row);
|
|
49801
|
+
return stopAt === undefined || dockLineVisibility(stopAt, now, decorated).phase !== "hidden";
|
|
49802
|
+
});
|
|
49803
|
+
}
|
|
49804
|
+
function mergedThinkRows(rows, now, decorated) {
|
|
49805
|
+
return rows.filter((row) => row.kind === "reasoning").filter((row) => {
|
|
49806
|
+
if (row.streaming === true)
|
|
49807
|
+
return true;
|
|
49808
|
+
const stopAt = skinStopAt(row);
|
|
49809
|
+
return stopAt === undefined || dockLineVisibility(stopAt, now, decorated).phase !== "hidden";
|
|
49810
|
+
});
|
|
49811
|
+
}
|
|
49812
|
+
function mergedRunningAgents(rows) {
|
|
49813
|
+
const tree = [...rows].reverse().find((row) => row.kind === "subagents");
|
|
49814
|
+
return tree?.kind === "subagents" ? tree.children.filter((child) => child.status === "running") : [];
|
|
49815
|
+
}
|
|
49816
|
+
function mergedLowerHasContent(rows) {
|
|
49817
|
+
return latestTodos(rows).some((todo) => todo.status === "in_progress") || mergedRunningAgents(rows).length > 0;
|
|
49818
|
+
}
|
|
49819
|
+
function mergedCompactSummary(rows) {
|
|
49820
|
+
return todosSummaryLine(rows);
|
|
49821
|
+
}
|
|
49560
49822
|
function WidgetsDock(props) {
|
|
49561
49823
|
const dimensions = useTerminalSize();
|
|
49562
49824
|
const theme = useThemeOptional();
|
|
@@ -49568,55 +49830,136 @@ function WidgetsDock(props) {
|
|
|
49568
49830
|
});
|
|
49569
49831
|
onAnimationTick(() => motionAnimationRunning() && dockNeedsClock(props.rows) ? motionFrameRate() : undefined, () => setDockSpin((s) => s + 1));
|
|
49570
49832
|
const width = () => Math.max(16, dimensions().width - 4);
|
|
49571
|
-
const tableWidth = () => todosTableWidth(dimensions().width);
|
|
49572
|
-
const table = () => todosTableLines(props.rows, tableWidth(), dimensions().height);
|
|
49573
49833
|
const turnActive = () => props.turnActive?.() ?? dockTurnActive(props.rows);
|
|
49574
|
-
createEffect(() => activityFrameLatch.push(turnActive()));
|
|
49834
|
+
createEffect(() => activityFrameLatch.push(turnActive() || mergedLowerHasContent(props.rows)));
|
|
49575
49835
|
onCleanup(activityFrameLatch.dispose);
|
|
49576
49836
|
const frame = () => activityFrameMode(dimensions().height);
|
|
49577
49837
|
const capSpec = () => activityPanelCapSpec(activityPanelGear(), dimensions().height);
|
|
49578
49838
|
const lineCap = () => capSpec().maxLines;
|
|
49579
|
-
const
|
|
49580
|
-
|
|
49581
|
-
|
|
49582
|
-
|
|
49583
|
-
|
|
49584
|
-
|
|
49585
|
-
|
|
49839
|
+
const mergedSource = (now) => {
|
|
49840
|
+
dockSpin();
|
|
49841
|
+
return {
|
|
49842
|
+
think: mergedThinkRows(props.rows, now, motionDecorationsEnabled()),
|
|
49843
|
+
tools: mergedToolRows(props.rows, now, motionDecorationsEnabled()),
|
|
49844
|
+
todos: latestTodos(props.rows),
|
|
49845
|
+
agents: mergedRunningAgents(props.rows)
|
|
49846
|
+
};
|
|
49847
|
+
};
|
|
49848
|
+
const gearTotal = () => {
|
|
49849
|
+
const gear = activityPanelGear();
|
|
49850
|
+
if (gear === undefined || gear === "all")
|
|
49851
|
+
return MERGED_DOCK_TOTAL_LINES;
|
|
49852
|
+
return Number(gear);
|
|
49853
|
+
};
|
|
49854
|
+
const mergedFrame = () => {
|
|
49855
|
+
const now = Date.now();
|
|
49856
|
+
const data = mergedSource(now);
|
|
49857
|
+
const options = {
|
|
49858
|
+
innerWidth: width(),
|
|
49859
|
+
now,
|
|
49860
|
+
totalLines: Math.min(gearTotal(), MERGED_DOCK_TOTAL_LINES),
|
|
49861
|
+
cursor: mergedDockCursor()
|
|
49862
|
+
};
|
|
49863
|
+
return {
|
|
49864
|
+
lines: mergedDockLines(data, options),
|
|
49865
|
+
info: mergedWindowInfo(data, options)
|
|
49866
|
+
};
|
|
49867
|
+
};
|
|
49868
|
+
const titleSlotWidth = () => dimensions().width - 4;
|
|
49869
|
+
const mergedTitleText = () => {
|
|
49870
|
+
const {
|
|
49871
|
+
lines,
|
|
49872
|
+
info
|
|
49873
|
+
} = mergedFrame();
|
|
49874
|
+
const base = mergedTitle({
|
|
49875
|
+
tool: lines.some((line) => line.kind === "tool"),
|
|
49876
|
+
think: lines.some((line) => line.kind === "think"),
|
|
49877
|
+
subagent: mergedRunningAgents(props.rows).length > 0
|
|
49878
|
+
});
|
|
49879
|
+
const suffix = mergedPositionSuffix(info);
|
|
49880
|
+
if (suffix === null)
|
|
49881
|
+
return base;
|
|
49882
|
+
const gap = titleSlotWidth() - stringWidth(base) - stringWidth(suffix);
|
|
49883
|
+
if (gap < 1)
|
|
49884
|
+
return `${base} \xB7 ${suffix}`;
|
|
49885
|
+
return base + " ".repeat(gap) + suffix;
|
|
49886
|
+
};
|
|
49887
|
+
const onMergedWheel = (event) => {
|
|
49888
|
+
const info = mergedFrame().info;
|
|
49889
|
+
if (!info.overflow)
|
|
49890
|
+
return;
|
|
49891
|
+
const dir = event.scroll?.direction;
|
|
49892
|
+
if (dir !== "up" && dir !== "down")
|
|
49893
|
+
return;
|
|
49894
|
+
const step = Math.max(1, Math.floor(Math.abs(event.scroll?.delta ?? 0)));
|
|
49895
|
+
setMergedDockCursor((c) => dir === "up" ? Math.max(0, c - step) : Math.min(info.maxCursor, c + step));
|
|
49896
|
+
};
|
|
49897
|
+
const stepMergedDock = (delta) => {
|
|
49898
|
+
const info = mergedFrame().info;
|
|
49899
|
+
if (!info.overflow)
|
|
49900
|
+
return;
|
|
49901
|
+
setMergedDockCursor((c) => Math.max(0, Math.min(info.maxCursor, c + delta)));
|
|
49902
|
+
};
|
|
49903
|
+
const pageOwns = useIsPageOwner();
|
|
49904
|
+
if (Keymap2.useOptional() !== undefined) {
|
|
49905
|
+
Keymap2.createLayer(() => ({
|
|
49906
|
+
mode: "global",
|
|
49907
|
+
enabled: mergedFrame().info.overflow && pageOwns(),
|
|
49908
|
+
commands: [{
|
|
49909
|
+
id: "session.dock.scroll.up",
|
|
49910
|
+
title: "Scroll activity up",
|
|
49911
|
+
group: "Session",
|
|
49912
|
+
run: () => stepMergedDock(-1)
|
|
49913
|
+
}, {
|
|
49914
|
+
id: "session.dock.scroll.down",
|
|
49915
|
+
title: "Scroll activity down",
|
|
49916
|
+
group: "Session",
|
|
49917
|
+
run: () => stepMergedDock(1)
|
|
49918
|
+
}],
|
|
49919
|
+
bindings: ["session.dock.scroll.up", "session.dock.scroll.down"]
|
|
49920
|
+
}));
|
|
49921
|
+
}
|
|
49922
|
+
const frameHeight = () => 2 + mergedFrame().lines.length;
|
|
49923
|
+
const compactSummary = () => mergedCompactSummary(props.rows);
|
|
49924
|
+
const compactHeight = () => 2 + (compactSummary() === "" ? 0 : 1);
|
|
49586
49925
|
const accentFg = (accent) => dockAccentColor(theme, accent);
|
|
49587
49926
|
const lineView = (line) => dockLineNode(line, width(), skinCtx(), fgFor, accentFg);
|
|
49927
|
+
const mergedLineView = (line) => {
|
|
49928
|
+
const ctx = skinCtx();
|
|
49929
|
+
const lineFade = {
|
|
49930
|
+
id: line.id,
|
|
49931
|
+
fadeOutAt: line.fadeOutAt
|
|
49932
|
+
};
|
|
49933
|
+
const attributes = line.italic === true ? TextAttributes5.ITALIC : undefined;
|
|
49934
|
+
return (() => {
|
|
49935
|
+
var _el$ = createElement("text");
|
|
49936
|
+
setProp(_el$, "attributes", attributes);
|
|
49937
|
+
setProp(_el$, "wrapMode", "none");
|
|
49938
|
+
insert(_el$, createComponent2(For, {
|
|
49939
|
+
get each() {
|
|
49940
|
+
return line.segments;
|
|
49941
|
+
},
|
|
49942
|
+
children: (segment) => {
|
|
49943
|
+
const target = segment.accent !== undefined ? accentFg(segment.accent) : fgFor(segment.tone);
|
|
49944
|
+
return (() => {
|
|
49945
|
+
var _el$2 = createElement("span");
|
|
49946
|
+
insert(_el$2, () => segment.text);
|
|
49947
|
+
effect((_$p) => setProp(_el$2, "style", {
|
|
49948
|
+
fg: skinDockLineFg(ctx, target, lineFade)
|
|
49949
|
+
}, _$p));
|
|
49950
|
+
return _el$2;
|
|
49951
|
+
})();
|
|
49952
|
+
}
|
|
49953
|
+
}));
|
|
49954
|
+
return _el$;
|
|
49955
|
+
})();
|
|
49956
|
+
};
|
|
49588
49957
|
return (() => {
|
|
49589
|
-
var _el$ = createElement("box");
|
|
49590
|
-
setProp(_el
|
|
49591
|
-
setProp(_el
|
|
49592
|
-
setProp(_el
|
|
49593
|
-
insert(_el
|
|
49594
|
-
get when() {
|
|
49595
|
-
return table().length > 0;
|
|
49596
|
-
},
|
|
49597
|
-
get children() {
|
|
49598
|
-
var _el$2 = createElement("box");
|
|
49599
|
-
setProp(_el$2, "flexShrink", 0);
|
|
49600
|
-
setProp(_el$2, "flexDirection", "column");
|
|
49601
|
-
setProp(_el$2, "width", "100%");
|
|
49602
|
-
setProp(_el$2, "paddingLeft", 1);
|
|
49603
|
-
insert(_el$2, createComponent2(For, {
|
|
49604
|
-
get each() {
|
|
49605
|
-
return table();
|
|
49606
|
-
},
|
|
49607
|
-
children: (line) => (() => {
|
|
49608
|
-
var _el$4 = createElement("text");
|
|
49609
|
-
setProp(_el$4, "wrapMode", "none");
|
|
49610
|
-
insert(_el$4, () => takeWidth(line.text, tableWidth()));
|
|
49611
|
-
effect((_$p) => setProp(_el$4, "fg", fgFor(line.tone), _$p));
|
|
49612
|
-
return _el$4;
|
|
49613
|
-
})()
|
|
49614
|
-
}));
|
|
49615
|
-
effect((_$p) => setProp(_el$2, "height", table().length, _$p));
|
|
49616
|
-
return _el$2;
|
|
49617
|
-
}
|
|
49618
|
-
}), null);
|
|
49619
|
-
insert(_el$, createComponent2(Show, {
|
|
49958
|
+
var _el$3 = createElement("box");
|
|
49959
|
+
setProp(_el$3, "flexShrink", 0);
|
|
49960
|
+
setProp(_el$3, "flexDirection", "column");
|
|
49961
|
+
setProp(_el$3, "width", "100%");
|
|
49962
|
+
insert(_el$3, createComponent2(Show, {
|
|
49620
49963
|
get when() {
|
|
49621
49964
|
return activityFrameLatch.shown();
|
|
49622
49965
|
},
|
|
@@ -49652,54 +49995,61 @@ function WidgetsDock(props) {
|
|
|
49652
49995
|
setProp(_el$5, "flexShrink", 0);
|
|
49653
49996
|
setProp(_el$5, "flexDirection", "column");
|
|
49654
49997
|
setProp(_el$5, "width", "100%");
|
|
49655
|
-
setProp(_el$5, "height", 2);
|
|
49656
49998
|
setProp(_el$5, "paddingLeft", 3);
|
|
49657
49999
|
insert(_el$5, createComponent2(For, {
|
|
49658
50000
|
get each() {
|
|
49659
50001
|
return activityRuleLines(props.rows);
|
|
49660
50002
|
},
|
|
49661
50003
|
children: lineView
|
|
49662
|
-
}));
|
|
50004
|
+
}), null);
|
|
50005
|
+
insert(_el$5, createComponent2(Show, {
|
|
50006
|
+
get when() {
|
|
50007
|
+
return compactSummary() !== "";
|
|
50008
|
+
},
|
|
50009
|
+
get children() {
|
|
50010
|
+
var _el$6 = createElement("text");
|
|
50011
|
+
setProp(_el$6, "wrapMode", "none");
|
|
50012
|
+
insert(_el$6, () => takeWidth(compactSummary(), width()));
|
|
50013
|
+
effect((_$p) => setProp(_el$6, "fg", fgFor("muted"), _$p));
|
|
50014
|
+
return _el$6;
|
|
50015
|
+
}
|
|
50016
|
+
}), null);
|
|
50017
|
+
effect((_$p) => setProp(_el$5, "height", compactHeight(), _$p));
|
|
49663
50018
|
return _el$5;
|
|
49664
50019
|
})();
|
|
49665
50020
|
},
|
|
49666
50021
|
get children() {
|
|
49667
|
-
var _el$
|
|
49668
|
-
setProp(_el$
|
|
49669
|
-
setProp(_el$
|
|
49670
|
-
setProp(_el$
|
|
49671
|
-
setProp(_el$
|
|
49672
|
-
setProp(_el$
|
|
49673
|
-
setProp(_el$
|
|
49674
|
-
|
|
49675
|
-
|
|
49676
|
-
return frameBlocks().think;
|
|
49677
|
-
},
|
|
49678
|
-
children: lineView
|
|
49679
|
-
}), null);
|
|
49680
|
-
insert(_el$3, createComponent2(For, {
|
|
50022
|
+
var _el$4 = createElement("box");
|
|
50023
|
+
setProp(_el$4, "flexShrink", 0);
|
|
50024
|
+
setProp(_el$4, "flexDirection", "column");
|
|
50025
|
+
setProp(_el$4, "width", "100%");
|
|
50026
|
+
setProp(_el$4, "border", ["top", "bottom", "left", "right"]);
|
|
50027
|
+
setProp(_el$4, "borderStyle", "heavy");
|
|
50028
|
+
setProp(_el$4, "titleAlignment", "left");
|
|
50029
|
+
setProp(_el$4, "onMouseScroll", onMergedWheel);
|
|
50030
|
+
insert(_el$4, createComponent2(For, {
|
|
49681
50031
|
get each() {
|
|
49682
|
-
return
|
|
50032
|
+
return mergedFrame().lines;
|
|
49683
50033
|
},
|
|
49684
|
-
children:
|
|
49685
|
-
})
|
|
50034
|
+
children: mergedLineView
|
|
50035
|
+
}));
|
|
49686
50036
|
effect((_p$) => {
|
|
49687
|
-
var _v$ = frameHeight(), _v$2 = activityFrameBorderColor(theme), _v$3 =
|
|
49688
|
-
_v$ !== _p$.e && (_p$.e = setProp(_el$
|
|
49689
|
-
_v$2 !== _p$.t && (_p$.t = setProp(_el$
|
|
49690
|
-
_v$3 !== _p$.a && (_p$.a = setProp(_el$
|
|
50037
|
+
var _v$ = frameHeight(), _v$2 = activityFrameBorderColor(theme), _v$3 = mergedTitleText();
|
|
50038
|
+
_v$ !== _p$.e && (_p$.e = setProp(_el$4, "height", _v$, _p$.e));
|
|
50039
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$4, "borderColor", _v$2, _p$.t));
|
|
50040
|
+
_v$3 !== _p$.a && (_p$.a = setProp(_el$4, "title", _v$3, _p$.a));
|
|
49691
50041
|
return _p$;
|
|
49692
50042
|
}, {
|
|
49693
50043
|
e: undefined,
|
|
49694
50044
|
t: undefined,
|
|
49695
50045
|
a: undefined
|
|
49696
50046
|
});
|
|
49697
|
-
return _el$
|
|
50047
|
+
return _el$4;
|
|
49698
50048
|
}
|
|
49699
50049
|
});
|
|
49700
50050
|
}
|
|
49701
|
-
})
|
|
49702
|
-
return _el
|
|
50051
|
+
}));
|
|
50052
|
+
return _el$3;
|
|
49703
50053
|
})();
|
|
49704
50054
|
}
|
|
49705
50055
|
function FlatDock(props) {
|
|
@@ -49710,19 +50060,19 @@ function FlatDock(props) {
|
|
|
49710
50060
|
} : {}
|
|
49711
50061
|
});
|
|
49712
50062
|
return (() => {
|
|
49713
|
-
var _el$
|
|
49714
|
-
setProp(_el$
|
|
49715
|
-
setProp(_el$
|
|
49716
|
-
setProp(_el$
|
|
49717
|
-
setProp(_el$
|
|
49718
|
-
insert(_el$
|
|
50063
|
+
var _el$7 = createElement("box");
|
|
50064
|
+
setProp(_el$7, "flexShrink", 0);
|
|
50065
|
+
setProp(_el$7, "flexDirection", "column");
|
|
50066
|
+
setProp(_el$7, "width", "100%");
|
|
50067
|
+
setProp(_el$7, "paddingLeft", 3);
|
|
50068
|
+
insert(_el$7, createComponent2(For, {
|
|
49719
50069
|
get each() {
|
|
49720
50070
|
return dockLines(props.rows, dockOptions());
|
|
49721
50071
|
},
|
|
49722
50072
|
children: (line) => dockLineNode(line, props.width, props.skinCtx, props.fgFor, props.accentFg)
|
|
49723
50073
|
}));
|
|
49724
|
-
effect((_$p) => setProp(_el$
|
|
49725
|
-
return _el$
|
|
50074
|
+
effect((_$p) => setProp(_el$7, "height", dockLines(props.rows, dockOptions()).length, _$p));
|
|
50075
|
+
return _el$7;
|
|
49726
50076
|
})();
|
|
49727
50077
|
}
|
|
49728
50078
|
function dockLineNode(line, width, ctx, fgFor, accentFg) {
|
|
@@ -49733,12 +50083,12 @@ function dockLineNode(line, width, ctx, fgFor, accentFg) {
|
|
|
49733
50083
|
const markerAt = line.markerAt ?? 0;
|
|
49734
50084
|
if (marker === undefined || line.text.slice(markerAt, markerAt + marker.length) !== marker) {
|
|
49735
50085
|
return (() => {
|
|
49736
|
-
var _el$
|
|
49737
|
-
setProp(_el$
|
|
49738
|
-
setProp(_el$
|
|
49739
|
-
setProp(_el$
|
|
49740
|
-
insert(_el$
|
|
49741
|
-
return _el$
|
|
50086
|
+
var _el$8 = createElement("text");
|
|
50087
|
+
setProp(_el$8, "fg", bodyFg);
|
|
50088
|
+
setProp(_el$8, "attributes", attributes);
|
|
50089
|
+
setProp(_el$8, "wrapMode", "none");
|
|
50090
|
+
insert(_el$8, () => clipToWidth(line.text, width));
|
|
50091
|
+
return _el$8;
|
|
49742
50092
|
})();
|
|
49743
50093
|
}
|
|
49744
50094
|
const before = clipToWidth(line.text.slice(0, markerAt), width);
|
|
@@ -49747,21 +50097,21 @@ function dockLineNode(line, width, ctx, fgFor, accentFg) {
|
|
|
49747
50097
|
const after = clipToWidth(line.text.slice(markerAt + marker.length), Math.max(0, markerBudget - stringWidth(clippedMarker)));
|
|
49748
50098
|
const markerFg = skinDockLineFg(ctx, toneFg, line);
|
|
49749
50099
|
return (() => {
|
|
49750
|
-
var _el$
|
|
49751
|
-
insertNode(_el$
|
|
49752
|
-
setProp(_el$
|
|
49753
|
-
setProp(_el$
|
|
49754
|
-
setProp(_el$
|
|
49755
|
-
insert(_el$
|
|
49756
|
-
setProp(_el$
|
|
50100
|
+
var _el$9 = createElement("text"), _el$0 = createElement("span");
|
|
50101
|
+
insertNode(_el$9, _el$0);
|
|
50102
|
+
setProp(_el$9, "fg", bodyFg);
|
|
50103
|
+
setProp(_el$9, "attributes", attributes);
|
|
50104
|
+
setProp(_el$9, "wrapMode", "none");
|
|
50105
|
+
insert(_el$9, before, _el$0);
|
|
50106
|
+
setProp(_el$0, "style", {
|
|
49757
50107
|
fg: markerFg
|
|
49758
50108
|
});
|
|
49759
|
-
insert(_el$
|
|
49760
|
-
insert(_el$
|
|
49761
|
-
return _el$
|
|
50109
|
+
insert(_el$0, clippedMarker);
|
|
50110
|
+
insert(_el$9, after, null);
|
|
50111
|
+
return _el$9;
|
|
49762
50112
|
})();
|
|
49763
50113
|
}
|
|
49764
|
-
var SKIN_FADE_IN_MS = 400, SKIN_NOTICE_FADE_MS = 500, SKIN_PULSE_MS = 1200, SKIN_PULSE_CYCLES = 3, SKIN_PULSE_DIM = 0.45, SKIN_FAINT_MIX = 0.78, ACTIVITY_PANEL_GEARS, PANEL_UNBOUNDED_LINES = 1e6, activityPanelGear, setActivityPanelGear, LINE_FIRST_SEEN_MAX = 512, lineFirstSeen, dockSpin, setDockSpin,
|
|
50114
|
+
var SKIN_FADE_IN_MS = 400, SKIN_NOTICE_FADE_MS = 500, SKIN_PULSE_MS = 1200, SKIN_PULSE_CYCLES = 3, SKIN_PULSE_DIM = 0.45, SKIN_FAINT_MIX = 0.78, ACTIVITY_PANEL_GEARS, PANEL_UNBOUNDED_LINES = 1e6, activityPanelGear, setActivityPanelGear, LINE_FIRST_SEEN_MAX = 512, lineFirstSeen, dockSpin, setDockSpin, mergedDockCursor, setMergedDockCursor, TODO_TOOL_NAMES, ACTIVITY_FRAME_BORDER_FALLBACK = "#7aa2f7", ACTIVITY_FRAME_MIN_CONTRAST = 6, ACTIVITY_BLUE_STEPS, BLUE_HUE_MIN = 190, BLUE_HUE_MAX = 250, BLUE_MIN_SATURATION = 0.25, AUTO_POLE_LIGHT = "#ffffff", AUTO_POLE_DARK = "#000000", DOCK_ACCENT_STEPS, DOCK_ACCENT_HUES, DOCK_ACCENT_FALLBACK, ACTIVITY_FRAME_DEFER_MS = 60, activityFrameLatch;
|
|
49765
50115
|
var init_widgets_dock = __esm(() => {
|
|
49766
50116
|
init_index_bun();
|
|
49767
50117
|
init_index_bun();
|
|
@@ -49782,10 +50132,14 @@ var init_widgets_dock = __esm(() => {
|
|
|
49782
50132
|
init_semantic();
|
|
49783
50133
|
init_dock_visibility();
|
|
49784
50134
|
init_powerline();
|
|
50135
|
+
init_merged_dock();
|
|
50136
|
+
init_keymap();
|
|
50137
|
+
init_input_ownership();
|
|
49785
50138
|
ACTIVITY_PANEL_GEARS = ["1", "5", "7", "10", "all"];
|
|
49786
50139
|
[activityPanelGear, setActivityPanelGear] = createSignal(undefined);
|
|
49787
50140
|
lineFirstSeen = new Map;
|
|
49788
50141
|
[dockSpin, setDockSpin] = createSignal(0);
|
|
50142
|
+
[mergedDockCursor, setMergedDockCursor] = createSignal(0);
|
|
49789
50143
|
TODO_TOOL_NAMES = new Set(["todowrite", "todo_write"]);
|
|
49790
50144
|
ACTIVITY_BLUE_STEPS = [200, 100, 300, 400, 500, 600, 700];
|
|
49791
50145
|
DOCK_ACCENT_STEPS = {
|
|
@@ -50309,7 +50663,7 @@ function LastRequestDock(props) {
|
|
|
50309
50663
|
const fgFor = (tone) => tone === "running" ? theme?.text.feedback.warning.base ?? "#e0af68" : theme?.text.muted ?? "#9aa5ce";
|
|
50310
50664
|
const contentWidth = () => Math.max(16, dimensions().width - 1);
|
|
50311
50665
|
const lineWidth = (line) => Math.max(1, contentWidth() - (line.indent ?? 0));
|
|
50312
|
-
const lines = () => lastRequestLines(props.rows, props.lastRequest, contentWidth());
|
|
50666
|
+
const lines = () => lastRequestLines(props.rows, props.lastRequest, contentWidth()).filter((line) => line.id === "lr:echo");
|
|
50313
50667
|
const lineFg = (line) => {
|
|
50314
50668
|
const target = fgFor(line.tone);
|
|
50315
50669
|
if (!motionDecorationsEnabled() || line.id === undefined)
|
|
@@ -50486,6 +50840,120 @@ var init_notices_dock = __esm(() => {
|
|
|
50486
50840
|
noticeList = notices;
|
|
50487
50841
|
});
|
|
50488
50842
|
|
|
50843
|
+
// ../tui-base/src/routes/session/comet-track.tsx
|
|
50844
|
+
import { parseColor as parseColor4, Renderable as Renderable7 } from "@opentui/core";
|
|
50845
|
+
function cometHeadColor(theme) {
|
|
50846
|
+
return theme?.hue.accent[500] ?? COMET_FALLBACK_HEAD;
|
|
50847
|
+
}
|
|
50848
|
+
function cometFps(active) {
|
|
50849
|
+
return !active || getMotionTier() === "off" ? undefined : STREAM_FPS;
|
|
50850
|
+
}
|
|
50851
|
+
function cometPosition(step) {
|
|
50852
|
+
const span = COMET_TRACK_COLS - ASSEMBLY;
|
|
50853
|
+
const s = (step % (span * 2) + span * 2) % (span * 2);
|
|
50854
|
+
const start = s < span ? s : span * 2 - s;
|
|
50855
|
+
const dirRight = s < span;
|
|
50856
|
+
const stern = dirRight ? start : start + ASSEMBLY;
|
|
50857
|
+
const tailEnd = dirRight ? stern - TAIL : stern + TAIL;
|
|
50858
|
+
return {
|
|
50859
|
+
start,
|
|
50860
|
+
dirRight,
|
|
50861
|
+
stern,
|
|
50862
|
+
tailEnd
|
|
50863
|
+
};
|
|
50864
|
+
}
|
|
50865
|
+
function cometRampChar(behind) {
|
|
50866
|
+
return RAMP[Math.min(RAMP.length - 1, Math.floor(behind / 2) + 1)];
|
|
50867
|
+
}
|
|
50868
|
+
var TAIL = 5, RAMP, ASSEMBLY = 2, COMET_FALLBACK_TRACK = "#565f89", COMET_FALLBACK_HEAD = "#7aa2f7", COMET_TRACK_COLS = 15, CometTrackRenderable;
|
|
50869
|
+
var init_comet_track = __esm(() => {
|
|
50870
|
+
init_index_bun();
|
|
50871
|
+
init_motion();
|
|
50872
|
+
init_identity();
|
|
50873
|
+
RAMP = ["\u2588", "\u2593", "\u2592", "\u2591"];
|
|
50874
|
+
CometTrackRenderable = class CometTrackRenderable extends Renderable7 {
|
|
50875
|
+
_step = 0;
|
|
50876
|
+
constructor(ctx, options = {}) {
|
|
50877
|
+
super(ctx, options);
|
|
50878
|
+
this._headFg = parseColor4(options.headFg ?? COMET_FALLBACK_HEAD);
|
|
50879
|
+
this._trackFg = parseColor4(options.trackFg ?? COMET_FALLBACK_TRACK);
|
|
50880
|
+
this._mode = options.mode ?? "dark";
|
|
50881
|
+
this._gradient = options.gradient ?? false;
|
|
50882
|
+
this.setMeasureProvider(() => ({
|
|
50883
|
+
width: COMET_TRACK_COLS,
|
|
50884
|
+
height: 1
|
|
50885
|
+
}));
|
|
50886
|
+
}
|
|
50887
|
+
set step(value) {
|
|
50888
|
+
if (value === this._step)
|
|
50889
|
+
return;
|
|
50890
|
+
this._step = value;
|
|
50891
|
+
this.requestRender();
|
|
50892
|
+
}
|
|
50893
|
+
set headFg(value) {
|
|
50894
|
+
const next = parseColor4(value);
|
|
50895
|
+
if (next.equals(this._headFg))
|
|
50896
|
+
return;
|
|
50897
|
+
this._headFg = next;
|
|
50898
|
+
this.requestRender();
|
|
50899
|
+
}
|
|
50900
|
+
set trackFg(value) {
|
|
50901
|
+
const next = parseColor4(value);
|
|
50902
|
+
if (next.equals(this._trackFg))
|
|
50903
|
+
return;
|
|
50904
|
+
this._trackFg = next;
|
|
50905
|
+
this.requestRender();
|
|
50906
|
+
}
|
|
50907
|
+
set mode(value) {
|
|
50908
|
+
if (value === this._mode)
|
|
50909
|
+
return;
|
|
50910
|
+
this._mode = value;
|
|
50911
|
+
this.requestRender();
|
|
50912
|
+
}
|
|
50913
|
+
set gradient(value) {
|
|
50914
|
+
if (value === this._gradient)
|
|
50915
|
+
return;
|
|
50916
|
+
this._gradient = value;
|
|
50917
|
+
this.requestRender();
|
|
50918
|
+
}
|
|
50919
|
+
renderSelf(buffer) {
|
|
50920
|
+
if (!this.visible || this.isDestroyed)
|
|
50921
|
+
return;
|
|
50922
|
+
const bg = parseColor4("transparent");
|
|
50923
|
+
const {
|
|
50924
|
+
start,
|
|
50925
|
+
dirRight,
|
|
50926
|
+
stern,
|
|
50927
|
+
tailEnd
|
|
50928
|
+
} = cometPosition(this._step);
|
|
50929
|
+
let c = 0;
|
|
50930
|
+
while (c < COMET_TRACK_COLS) {
|
|
50931
|
+
if (c === start) {
|
|
50932
|
+
buffer.drawText("\uD83D\uDC33", this.screenX + c, this.screenY, this._headFg, bg);
|
|
50933
|
+
c += ASSEMBLY;
|
|
50934
|
+
continue;
|
|
50935
|
+
}
|
|
50936
|
+
const behind = dirRight ? stern - c : c - stern;
|
|
50937
|
+
const inTail = dirRight ? c < stern && c > tailEnd : c > stern && c < tailEnd;
|
|
50938
|
+
if (inTail && behind >= 0) {
|
|
50939
|
+
if (this._gradient) {
|
|
50940
|
+
const color = parseColor4(identityHexAt(Math.min(1, behind / TAIL), this._mode));
|
|
50941
|
+
buffer.drawText("\u2588", this.screenX + c, this.screenY, color, bg);
|
|
50942
|
+
} else {
|
|
50943
|
+
buffer.drawText(cometRampChar(behind), this.screenX + c, this.screenY, this._trackFg, bg);
|
|
50944
|
+
}
|
|
50945
|
+
} else {
|
|
50946
|
+
buffer.drawText("\u2591", this.screenX + c, this.screenY, this._trackFg, bg);
|
|
50947
|
+
}
|
|
50948
|
+
c += 1;
|
|
50949
|
+
}
|
|
50950
|
+
}
|
|
50951
|
+
};
|
|
50952
|
+
extend({
|
|
50953
|
+
comet_track: CometTrackRenderable
|
|
50954
|
+
});
|
|
50955
|
+
});
|
|
50956
|
+
|
|
50489
50957
|
// ../tui-base/src/routes/session/hints-line.tsx
|
|
50490
50958
|
function footerHintsFromConfig(value) {
|
|
50491
50959
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -50595,29 +51063,59 @@ function transcriptHintsText(shown = true) {
|
|
|
50595
51063
|
function HintsLine(props) {
|
|
50596
51064
|
const dimensions = useTerminalSize();
|
|
50597
51065
|
const theme = useThemeOptional();
|
|
51066
|
+
const cometActive = () => props.busy() && hintsShown();
|
|
51067
|
+
const [tick, setTick] = createSignal(0);
|
|
51068
|
+
onAnimationTick(() => cometFps(cometActive()), () => setTick((t) => t + 1));
|
|
50598
51069
|
const row = () => {
|
|
50599
|
-
const
|
|
50600
|
-
|
|
51070
|
+
const busy = cometActive();
|
|
51071
|
+
const columns = dimensions().width - (busy ? COMET_TRACK_COLS + COMET_HINT_GAP : 0);
|
|
51072
|
+
return props.pane?.() === "transcript" ? clipToWidth(transcriptHintsText(hintsShown()), Math.max(8, columns - 2)) : hintsTextAtWidth(props.busy(), hintsShown(), subagentMarkerViews().some((v) => v.status === "running"), columns);
|
|
50601
51073
|
};
|
|
50602
51074
|
return createComponent2(Show, {
|
|
50603
51075
|
get when() {
|
|
50604
|
-
return memo2(() => !!hintsShown())() && row().length > 0;
|
|
51076
|
+
return memo2(() => !!hintsShown())() && (cometActive() || row().length > 0);
|
|
50605
51077
|
},
|
|
50606
51078
|
get children() {
|
|
50607
|
-
var _el$ = createElement("box"), _el$
|
|
50608
|
-
insertNode(_el$, _el$
|
|
51079
|
+
var _el$ = createElement("box"), _el$3 = createElement("text");
|
|
51080
|
+
insertNode(_el$, _el$3);
|
|
50609
51081
|
setProp(_el$, "flexShrink", 0);
|
|
50610
51082
|
setProp(_el$, "height", 1);
|
|
50611
51083
|
setProp(_el$, "width", "100%");
|
|
50612
51084
|
setProp(_el$, "paddingLeft", 1);
|
|
50613
|
-
setProp(_el
|
|
50614
|
-
insert(_el
|
|
50615
|
-
|
|
51085
|
+
setProp(_el$, "flexDirection", "row");
|
|
51086
|
+
insert(_el$, createComponent2(Show, {
|
|
51087
|
+
get when() {
|
|
51088
|
+
return cometActive();
|
|
51089
|
+
},
|
|
51090
|
+
get children() {
|
|
51091
|
+
var _el$2 = createElement("comet_track");
|
|
51092
|
+
effect((_p$) => {
|
|
51093
|
+
var _v$ = tick(), _v$2 = cometHeadColor(theme), _v$3 = theme?.border.base ?? COMET_FALLBACK_TRACK, _v$4 = motionDecorationsEnabled();
|
|
51094
|
+
_v$ !== _p$.e && (_p$.e = setProp(_el$2, "step", _v$, _p$.e));
|
|
51095
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$2, "headFg", _v$2, _p$.t));
|
|
51096
|
+
_v$3 !== _p$.a && (_p$.a = setProp(_el$2, "trackFg", _v$3, _p$.a));
|
|
51097
|
+
_v$4 !== _p$.o && (_p$.o = setProp(_el$2, "gradient", _v$4, _p$.o));
|
|
51098
|
+
return _p$;
|
|
51099
|
+
}, {
|
|
51100
|
+
e: undefined,
|
|
51101
|
+
t: undefined,
|
|
51102
|
+
a: undefined,
|
|
51103
|
+
o: undefined
|
|
51104
|
+
});
|
|
51105
|
+
return _el$2;
|
|
51106
|
+
}
|
|
51107
|
+
}), _el$3);
|
|
51108
|
+
setProp(_el$3, "wrapMode", "none");
|
|
51109
|
+
insert(_el$3, (() => {
|
|
51110
|
+
var _c$ = memo2(() => !!(cometActive() && row().length > 0));
|
|
51111
|
+
return () => _c$() ? `${" ".repeat(COMET_HINT_GAP)}${row()}` : row();
|
|
51112
|
+
})());
|
|
51113
|
+
effect((_$p) => setProp(_el$3, "fg", theme?.text.faint ?? "#565f89", _$p));
|
|
50616
51114
|
return _el$;
|
|
50617
51115
|
}
|
|
50618
51116
|
});
|
|
50619
51117
|
}
|
|
50620
|
-
var hintsShown, setHintsShown, DEFAULT_FOOTER_HINTS, FOOTER_HINT_IDS, HINT_SEGMENT_PRIORITY, HINT_LOCALES, HINT_LABEL_KEYS, footerHints, setFooterHints, hintsLocale, setHintsLocale, TRANSCRIPT_HINT_KEY = "footer.hint.transcript";
|
|
51118
|
+
var hintsShown, setHintsShown, COMET_HINT_GAP = 1, DEFAULT_FOOTER_HINTS, FOOTER_HINT_IDS, HINT_SEGMENT_PRIORITY, HINT_LOCALES, HINT_LABEL_KEYS, footerHints, setFooterHints, hintsLocale, setHintsLocale, TRANSCRIPT_HINT_KEY = "footer.hint.transcript";
|
|
50621
51119
|
var init_hints_line = __esm(() => {
|
|
50622
51120
|
init_index_bun();
|
|
50623
51121
|
init_index_bun();
|
|
@@ -50627,12 +51125,15 @@ var init_hints_line = __esm(() => {
|
|
|
50627
51125
|
init_index_bun();
|
|
50628
51126
|
init_index_bun();
|
|
50629
51127
|
init_server();
|
|
51128
|
+
init_index_bun();
|
|
50630
51129
|
init_i18n();
|
|
50631
51130
|
init_terminal_size();
|
|
50632
51131
|
init_tool_summarize();
|
|
50633
51132
|
init_string_width();
|
|
50634
51133
|
init_theme3();
|
|
51134
|
+
init_motion();
|
|
50635
51135
|
init_subagent_markers();
|
|
51136
|
+
init_comet_track();
|
|
50636
51137
|
[hintsShown, setHintsShown] = createSignal(true);
|
|
50637
51138
|
DEFAULT_FOOTER_HINTS = Object.freeze({
|
|
50638
51139
|
send: true,
|
|
@@ -62432,7 +62933,7 @@ var init_subagents_viewer = __esm(() => {
|
|
|
62432
62933
|
import { TextAttributes as TextAttributes12 } from "@opentui/core";
|
|
62433
62934
|
function resolveVersion() {
|
|
62434
62935
|
try {
|
|
62435
|
-
return "0.
|
|
62936
|
+
return "0.21.0";
|
|
62436
62937
|
} catch {
|
|
62437
62938
|
return "dev";
|
|
62438
62939
|
}
|
|
@@ -64188,205 +64689,6 @@ var init_panel_kit_host = __esm(() => {
|
|
|
64188
64689
|
init_theme3();
|
|
64189
64690
|
});
|
|
64190
64691
|
|
|
64191
|
-
// ../tui-base/src/routes/session/status-bar.tsx
|
|
64192
|
-
import { parseColor as parseColor4, Renderable as Renderable7 } from "@opentui/core";
|
|
64193
|
-
function cometPosition(step) {
|
|
64194
|
-
const span = TRACK_COLS - ASSEMBLY;
|
|
64195
|
-
const s = (step % (span * 2) + span * 2) % (span * 2);
|
|
64196
|
-
const start = s < span ? s : span * 2 - s;
|
|
64197
|
-
const dirRight = s < span;
|
|
64198
|
-
const stern = dirRight ? start : start + ASSEMBLY;
|
|
64199
|
-
const tailEnd = dirRight ? stern - TAIL : stern + TAIL;
|
|
64200
|
-
return {
|
|
64201
|
-
start,
|
|
64202
|
-
dirRight,
|
|
64203
|
-
stern,
|
|
64204
|
-
tailEnd
|
|
64205
|
-
};
|
|
64206
|
-
}
|
|
64207
|
-
function cometRampChar(behind) {
|
|
64208
|
-
return RAMP[Math.min(RAMP.length - 1, Math.floor(behind / 2) + 1)];
|
|
64209
|
-
}
|
|
64210
|
-
function StatusBar(props) {
|
|
64211
|
-
const theme = useThemeOptional();
|
|
64212
|
-
const [tick, setTick] = createSignal(0);
|
|
64213
|
-
const fps = () => props.phase === null || getMotionTier() === "off" ? undefined : STREAM_FPS;
|
|
64214
|
-
onAnimationTick(fps, () => setTick((t) => t + 1));
|
|
64215
|
-
const pools = () => ({
|
|
64216
|
-
think: props.verbs?.think ?? DEFAULT_VERBS.think,
|
|
64217
|
-
tool: props.verbs?.tool ?? DEFAULT_VERBS.tool,
|
|
64218
|
-
stream: props.verbs?.stream ?? DEFAULT_VERBS.stream,
|
|
64219
|
-
approve: props.verbs?.approve ?? DEFAULT_VERBS.approve
|
|
64220
|
-
});
|
|
64221
|
-
const headFg = () => {
|
|
64222
|
-
switch (props.phase) {
|
|
64223
|
-
case "think":
|
|
64224
|
-
return theme?.hue.accent[400] ?? FALLBACK_HEAD;
|
|
64225
|
-
case "tool":
|
|
64226
|
-
return theme?.text.feedback.success.base ?? "#4caf50";
|
|
64227
|
-
case "approve":
|
|
64228
|
-
return theme?.text.feedback.warning.base ?? "#e0af68";
|
|
64229
|
-
default:
|
|
64230
|
-
return theme?.hue.accent[500] ?? FALLBACK_HEAD;
|
|
64231
|
-
}
|
|
64232
|
-
};
|
|
64233
|
-
const label = () => {
|
|
64234
|
-
const phase = props.phase;
|
|
64235
|
-
if (phase === null)
|
|
64236
|
-
return "";
|
|
64237
|
-
const pool = pools()[phase];
|
|
64238
|
-
const verb = pool[Math.floor(tick() * BAR_MS / VERB_MS) % pool.length];
|
|
64239
|
-
const detail = props.detail?.() ?? "";
|
|
64240
|
-
return `${PHASE_ICON[phase]} ${verb}... ${props.elapsed()}s${detail ? ` \xB7 ${detail}` : ""}`;
|
|
64241
|
-
};
|
|
64242
|
-
return createComponent2(Show, {
|
|
64243
|
-
get when() {
|
|
64244
|
-
return props.phase !== null;
|
|
64245
|
-
},
|
|
64246
|
-
get children() {
|
|
64247
|
-
var _el$ = createElement("box"), _el$2 = createElement("comet_track"), _el$3 = createElement("text");
|
|
64248
|
-
insertNode(_el$, _el$2);
|
|
64249
|
-
insertNode(_el$, _el$3);
|
|
64250
|
-
setProp(_el$, "style", {
|
|
64251
|
-
flexDirection: "row",
|
|
64252
|
-
paddingLeft: 1,
|
|
64253
|
-
paddingRight: 1,
|
|
64254
|
-
height: 1,
|
|
64255
|
-
flexGrow: 0,
|
|
64256
|
-
flexShrink: 0
|
|
64257
|
-
});
|
|
64258
|
-
setProp(_el$3, "wrapMode", "none");
|
|
64259
|
-
insert(_el$3, () => ` ${label()}`);
|
|
64260
|
-
effect((_p$) => {
|
|
64261
|
-
var _v$ = tick(), _v$2 = headFg(), _v$3 = theme?.border.base ?? FALLBACK_TRACK, _v$4 = motionDecorationsEnabled(), _v$5 = {
|
|
64262
|
-
fg: headFg()
|
|
64263
|
-
};
|
|
64264
|
-
_v$ !== _p$.e && (_p$.e = setProp(_el$2, "step", _v$, _p$.e));
|
|
64265
|
-
_v$2 !== _p$.t && (_p$.t = setProp(_el$2, "headFg", _v$2, _p$.t));
|
|
64266
|
-
_v$3 !== _p$.a && (_p$.a = setProp(_el$2, "trackFg", _v$3, _p$.a));
|
|
64267
|
-
_v$4 !== _p$.o && (_p$.o = setProp(_el$2, "gradient", _v$4, _p$.o));
|
|
64268
|
-
_v$5 !== _p$.i && (_p$.i = setProp(_el$3, "style", _v$5, _p$.i));
|
|
64269
|
-
return _p$;
|
|
64270
|
-
}, {
|
|
64271
|
-
e: undefined,
|
|
64272
|
-
t: undefined,
|
|
64273
|
-
a: undefined,
|
|
64274
|
-
o: undefined,
|
|
64275
|
-
i: undefined
|
|
64276
|
-
});
|
|
64277
|
-
return _el$;
|
|
64278
|
-
}
|
|
64279
|
-
});
|
|
64280
|
-
}
|
|
64281
|
-
var DEFAULT_VERBS, PHASE_ICON, TAIL = 5, RAMP, BAR_MS = 80, VERB_MS = 2500, FALLBACK_TRACK = "#565f89", FALLBACK_HEAD = "#7aa2f7", TRACK_COLS = 15, ASSEMBLY = 2, CometTrackRenderable;
|
|
64282
|
-
var init_status_bar = __esm(() => {
|
|
64283
|
-
init_index_bun();
|
|
64284
|
-
init_index_bun();
|
|
64285
|
-
init_index_bun();
|
|
64286
|
-
init_index_bun();
|
|
64287
|
-
init_index_bun();
|
|
64288
|
-
init_index_bun();
|
|
64289
|
-
init_server();
|
|
64290
|
-
init_index_bun();
|
|
64291
|
-
init_theme3();
|
|
64292
|
-
init_motion();
|
|
64293
|
-
init_identity();
|
|
64294
|
-
DEFAULT_VERBS = {
|
|
64295
|
-
think: ["Thinking", "Pondering", "Reasoning", "Reflecting", "Deliberating", "Mulling"],
|
|
64296
|
-
tool: ["Executing", "Running", "Processing", "Building"],
|
|
64297
|
-
stream: ["Writing", "Composing", "Typing", "Drafting"],
|
|
64298
|
-
approve: ["Waiting"]
|
|
64299
|
-
};
|
|
64300
|
-
PHASE_ICON = {
|
|
64301
|
-
think: "\uD83E\uDDE0",
|
|
64302
|
-
tool: "\uD83D\uDEE0",
|
|
64303
|
-
stream: "\uD83D\uDCDD",
|
|
64304
|
-
approve: "\u23F3"
|
|
64305
|
-
};
|
|
64306
|
-
RAMP = ["\u2588", "\u2593", "\u2592", "\u2591"];
|
|
64307
|
-
CometTrackRenderable = class CometTrackRenderable extends Renderable7 {
|
|
64308
|
-
_step = 0;
|
|
64309
|
-
constructor(ctx, options = {}) {
|
|
64310
|
-
super(ctx, options);
|
|
64311
|
-
this._headFg = parseColor4(options.headFg ?? FALLBACK_HEAD);
|
|
64312
|
-
this._trackFg = parseColor4(options.trackFg ?? FALLBACK_TRACK);
|
|
64313
|
-
this._mode = options.mode ?? "dark";
|
|
64314
|
-
this._gradient = options.gradient ?? false;
|
|
64315
|
-
this.setMeasureProvider(() => ({
|
|
64316
|
-
width: TRACK_COLS,
|
|
64317
|
-
height: 1
|
|
64318
|
-
}));
|
|
64319
|
-
}
|
|
64320
|
-
set step(value) {
|
|
64321
|
-
if (value === this._step)
|
|
64322
|
-
return;
|
|
64323
|
-
this._step = value;
|
|
64324
|
-
this.requestRender();
|
|
64325
|
-
}
|
|
64326
|
-
set headFg(value) {
|
|
64327
|
-
const next = parseColor4(value);
|
|
64328
|
-
if (next.equals(this._headFg))
|
|
64329
|
-
return;
|
|
64330
|
-
this._headFg = next;
|
|
64331
|
-
this.requestRender();
|
|
64332
|
-
}
|
|
64333
|
-
set trackFg(value) {
|
|
64334
|
-
const next = parseColor4(value);
|
|
64335
|
-
if (next.equals(this._trackFg))
|
|
64336
|
-
return;
|
|
64337
|
-
this._trackFg = next;
|
|
64338
|
-
this.requestRender();
|
|
64339
|
-
}
|
|
64340
|
-
set mode(value) {
|
|
64341
|
-
if (value === this._mode)
|
|
64342
|
-
return;
|
|
64343
|
-
this._mode = value;
|
|
64344
|
-
this.requestRender();
|
|
64345
|
-
}
|
|
64346
|
-
set gradient(value) {
|
|
64347
|
-
if (value === this._gradient)
|
|
64348
|
-
return;
|
|
64349
|
-
this._gradient = value;
|
|
64350
|
-
this.requestRender();
|
|
64351
|
-
}
|
|
64352
|
-
renderSelf(buffer) {
|
|
64353
|
-
if (!this.visible || this.isDestroyed)
|
|
64354
|
-
return;
|
|
64355
|
-
const bg = parseColor4("transparent");
|
|
64356
|
-
const {
|
|
64357
|
-
start,
|
|
64358
|
-
dirRight,
|
|
64359
|
-
stern,
|
|
64360
|
-
tailEnd
|
|
64361
|
-
} = cometPosition(this._step);
|
|
64362
|
-
let c = 0;
|
|
64363
|
-
while (c < TRACK_COLS) {
|
|
64364
|
-
if (c === start) {
|
|
64365
|
-
buffer.drawText("\uD83D\uDC33", this.screenX + c, this.screenY, this._headFg, bg);
|
|
64366
|
-
c += ASSEMBLY;
|
|
64367
|
-
continue;
|
|
64368
|
-
}
|
|
64369
|
-
const behind = dirRight ? stern - c : c - stern;
|
|
64370
|
-
const inTail = dirRight ? c < stern && c > tailEnd : c > stern && c < tailEnd;
|
|
64371
|
-
if (inTail && behind >= 0) {
|
|
64372
|
-
if (this._gradient) {
|
|
64373
|
-
const color = parseColor4(identityHexAt(Math.min(1, behind / TAIL), this._mode));
|
|
64374
|
-
buffer.drawText("\u2588", this.screenX + c, this.screenY, color, bg);
|
|
64375
|
-
} else {
|
|
64376
|
-
buffer.drawText(cometRampChar(behind), this.screenX + c, this.screenY, this._trackFg, bg);
|
|
64377
|
-
}
|
|
64378
|
-
} else {
|
|
64379
|
-
buffer.drawText("\u2591", this.screenX + c, this.screenY, this._trackFg, bg);
|
|
64380
|
-
}
|
|
64381
|
-
c += 1;
|
|
64382
|
-
}
|
|
64383
|
-
}
|
|
64384
|
-
};
|
|
64385
|
-
extend({
|
|
64386
|
-
comet_track: CometTrackRenderable
|
|
64387
|
-
});
|
|
64388
|
-
});
|
|
64389
|
-
|
|
64390
64692
|
// ../../node_modules/.pnpm/@opentui+solid@0.8.1_solid-js@1.9.17_typescript@5.9.3_web-tree-sitter@0.25.10/node_modules/@opentui/solid/jsx-runtime.js
|
|
64391
64693
|
function normalizeProps(props) {
|
|
64392
64694
|
if (!props) {
|
|
@@ -64523,15 +64825,20 @@ class RemoteSessionSeam {
|
|
|
64523
64825
|
if (sessionId === undefined)
|
|
64524
64826
|
return;
|
|
64525
64827
|
let messageCount = 0;
|
|
64828
|
+
let turnCount = 0;
|
|
64526
64829
|
try {
|
|
64527
64830
|
const rows = await this.#session.storedTranscript(sessionId);
|
|
64528
64831
|
messageCount = rows.filter((row) => row.kind === "user" || row.kind === "assistant").length;
|
|
64832
|
+
turnCount = rows.filter((row) => row.kind === "user").length;
|
|
64529
64833
|
} catch {}
|
|
64834
|
+
const roundCount = base.sessionId === undefined ? undefined : base.roundCount;
|
|
64530
64835
|
return {
|
|
64531
64836
|
...base,
|
|
64532
64837
|
sessionId,
|
|
64533
64838
|
model: base.model ?? null,
|
|
64534
64839
|
messageCount,
|
|
64840
|
+
turnCount,
|
|
64841
|
+
roundCount,
|
|
64535
64842
|
contextTokens: base.contextTokens,
|
|
64536
64843
|
contextWindow: base.contextWindow ?? null
|
|
64537
64844
|
};
|
|
@@ -64989,7 +65296,6 @@ function V2SessionPageBody(props) {
|
|
|
64989
65296
|
const [composerBusy, setComposerBusy] = createSignal(false);
|
|
64990
65297
|
const [turnBusy, setTurnBusy] = createSignal(false);
|
|
64991
65298
|
const busy = () => composerBusy() || turnBusy();
|
|
64992
|
-
const [busySince, setBusySince] = createSignal(0);
|
|
64993
65299
|
const [model, setModel] = createSignal();
|
|
64994
65300
|
const [tools, setTools] = createSignal(0);
|
|
64995
65301
|
const [effort, setEffort] = createSignal();
|
|
@@ -65056,14 +65362,12 @@ function V2SessionPageBody(props) {
|
|
|
65056
65362
|
const timer = setInterval(() => setNow(new Date), 1000);
|
|
65057
65363
|
onCleanup(() => clearInterval(timer));
|
|
65058
65364
|
});
|
|
65059
|
-
const elapsed = () => busy() ? Math.max(0, Math.floor((now().getTime() - busySince()) / 1000)) : 0;
|
|
65060
65365
|
const [lastRequest, setLastRequest] = createSignal();
|
|
65061
65366
|
const [composerPending, setComposerPending] = createSignal([]);
|
|
65062
65367
|
let turnAborted = false;
|
|
65063
65368
|
const send = (text) => {
|
|
65064
65369
|
turnAborted = false;
|
|
65065
65370
|
setTurnBusy(true);
|
|
65066
|
-
setBusySince(Date.now());
|
|
65067
65371
|
setLastRequest(text);
|
|
65068
65372
|
const done = projection.send(text);
|
|
65069
65373
|
done.finally(() => setTurnBusy(false));
|
|
@@ -65160,7 +65464,12 @@ function V2SessionPageBody(props) {
|
|
|
65160
65464
|
settleEffort();
|
|
65161
65465
|
return;
|
|
65162
65466
|
}
|
|
65163
|
-
setRemoteInfo({
|
|
65467
|
+
setRemoteInfo({
|
|
65468
|
+
messageCount: info.messageCount,
|
|
65469
|
+
turnCount: info.turnCount,
|
|
65470
|
+
roundCount: info.roundCount,
|
|
65471
|
+
tps: info.lastTurnTps ?? info.sessionAvgTps
|
|
65472
|
+
});
|
|
65164
65473
|
labelEffortWord = effortFromModelLabel(info.model);
|
|
65165
65474
|
settleEffort();
|
|
65166
65475
|
}).catch(() => {
|
|
@@ -65181,7 +65490,8 @@ function V2SessionPageBody(props) {
|
|
|
65181
65490
|
provider: model()?.providerID,
|
|
65182
65491
|
model: model()?.modelID,
|
|
65183
65492
|
effort: effort(),
|
|
65184
|
-
|
|
65493
|
+
turns: remoteInfo()?.turnCount,
|
|
65494
|
+
rounds: remoteInfo()?.roundCount,
|
|
65185
65495
|
tools: tools(),
|
|
65186
65496
|
tps: remoteInfo()?.tps ?? null,
|
|
65187
65497
|
contextTokens: ctxTokens(),
|
|
@@ -65304,6 +65614,7 @@ function V2SessionPageBody(props) {
|
|
|
65304
65614
|
setComposerPending([]);
|
|
65305
65615
|
setTools(0);
|
|
65306
65616
|
resetSkinLineFades();
|
|
65617
|
+
resetMergedDockCursor();
|
|
65307
65618
|
const settled = projection.load(sessionId);
|
|
65308
65619
|
seam.currentModelSelection().then(setModel);
|
|
65309
65620
|
resetFooterProbe();
|
|
@@ -65332,6 +65643,7 @@ function V2SessionPageBody(props) {
|
|
|
65332
65643
|
resetFooterProbe();
|
|
65333
65644
|
refreshFooterData();
|
|
65334
65645
|
resetSkinLineFades();
|
|
65646
|
+
resetMergedDockCursor();
|
|
65335
65647
|
setSkillRows(props.skills ?? []);
|
|
65336
65648
|
setContextRevision((n) => n + 1);
|
|
65337
65649
|
},
|
|
@@ -65496,12 +65808,6 @@ function V2SessionPageBody(props) {
|
|
|
65496
65808
|
projection,
|
|
65497
65809
|
focused: paneFocus.transcriptFocused,
|
|
65498
65810
|
scrollRef: (value) => transcriptScroll = value,
|
|
65499
|
-
status: createComponent2(StatusBar, {
|
|
65500
|
-
get phase() {
|
|
65501
|
-
return busy() ? "stream" : null;
|
|
65502
|
-
},
|
|
65503
|
-
elapsed
|
|
65504
|
-
}),
|
|
65505
65811
|
widgets: createComponent2(WidgetsDock, {
|
|
65506
65812
|
get rows() {
|
|
65507
65813
|
return projection.rows;
|
|
@@ -65592,9 +65898,7 @@ function V2SessionPageBody(props) {
|
|
|
65592
65898
|
theme
|
|
65593
65899
|
}),
|
|
65594
65900
|
createComponent2(HintsLine, {
|
|
65595
|
-
|
|
65596
|
-
return busy();
|
|
65597
|
-
},
|
|
65901
|
+
busy: () => busy(),
|
|
65598
65902
|
pane: paneFocus.pane
|
|
65599
65903
|
}),
|
|
65600
65904
|
overlayHost
|
|
@@ -65882,7 +66186,6 @@ var init_v2_entry = __esm(() => {
|
|
|
65882
66186
|
init_theme2();
|
|
65883
66187
|
init_motion();
|
|
65884
66188
|
init_powerline();
|
|
65885
|
-
init_status_bar();
|
|
65886
66189
|
init_jsx_dev_runtime();
|
|
65887
66190
|
SHELL = "../../" + "shell/src/client/";
|
|
65888
66191
|
overlays = new TurnOverlayController;
|
|
@@ -66070,5 +66373,5 @@ export {
|
|
|
66070
66373
|
themeNameFromConfig
|
|
66071
66374
|
};
|
|
66072
66375
|
|
|
66073
|
-
//# debugId=
|
|
66376
|
+
//# debugId=E699F36F630F501D64756E2164756E21
|
|
66074
66377
|
//# sourceMappingURL=index.js.map
|