sisyphi 1.0.10 → 1.0.12
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/daemon.js +40 -5
- package/dist/daemon.js.map +1 -1
- package/dist/templates/agent-plugin/agents/review/compliance.md +48 -0
- package/dist/templates/agent-plugin/agents/review/efficiency.md +40 -0
- package/dist/templates/agent-plugin/agents/review/quality.md +38 -0
- package/dist/templates/agent-plugin/agents/review/reuse.md +38 -0
- package/dist/templates/agent-plugin/agents/review/security.md +40 -0
- package/dist/templates/agent-plugin/agents/review-plan/code-smells.md +39 -0
- package/dist/templates/agent-plugin/agents/review-plan/pattern-consistency.md +39 -0
- package/dist/templates/agent-plugin/agents/review-plan/security.md +38 -0
- package/dist/templates/agent-plugin/agents/review-plan/spec-coverage.md +44 -0
- package/dist/templates/agent-plugin/agents/review-plan.md +10 -64
- package/dist/templates/agent-plugin/agents/review.md +21 -18
- package/dist/templates/agent-plugin/hooks/review-plan-user-prompt.sh +9 -3
- package/dist/templates/agent-plugin/hooks/review-user-prompt.sh +11 -2
- package/dist/templates/agent-suffix.md +7 -24
- package/dist/tui.js +333 -359
- package/dist/tui.js.map +1 -1
- package/package.json +1 -1
- package/templates/agent-plugin/agents/review/compliance.md +48 -0
- package/templates/agent-plugin/agents/review/efficiency.md +40 -0
- package/templates/agent-plugin/agents/review/quality.md +38 -0
- package/templates/agent-plugin/agents/review/reuse.md +38 -0
- package/templates/agent-plugin/agents/review/security.md +40 -0
- package/templates/agent-plugin/agents/review-plan/code-smells.md +39 -0
- package/templates/agent-plugin/agents/review-plan/pattern-consistency.md +39 -0
- package/templates/agent-plugin/agents/review-plan/security.md +38 -0
- package/templates/agent-plugin/agents/review-plan/spec-coverage.md +44 -0
- package/templates/agent-plugin/agents/review-plan.md +10 -64
- package/templates/agent-plugin/agents/review.md +21 -18
- package/templates/agent-plugin/hooks/review-plan-user-prompt.sh +9 -3
- package/templates/agent-plugin/hooks/review-user-prompt.sh +11 -2
- package/templates/agent-suffix.md +7 -24
package/dist/tui.js
CHANGED
|
@@ -128,8 +128,8 @@ var require_emoji_regex = __commonJS({
|
|
|
128
128
|
import { render } from "ink";
|
|
129
129
|
|
|
130
130
|
// src/tui/App.tsx
|
|
131
|
-
import { useState as
|
|
132
|
-
import { Box as
|
|
131
|
+
import { useState as useState3, useEffect as useEffect3, useCallback as useCallback2, useMemo as useMemo6, useRef as useRef3 } from "react";
|
|
132
|
+
import { Box as Box10, Text as Text10, useApp, useStdout, useInput as useInput4 } from "ink";
|
|
133
133
|
|
|
134
134
|
// src/tui/components/SessionTree.tsx
|
|
135
135
|
import { Box, Text } from "ink";
|
|
@@ -353,10 +353,49 @@ function seg(text, opts) {
|
|
|
353
353
|
function singleLine(text, opts) {
|
|
354
354
|
return [seg(text, opts)];
|
|
355
355
|
}
|
|
356
|
+
function messageSourceLabel(source, agentId) {
|
|
357
|
+
if (source === "user") return "You";
|
|
358
|
+
if (source === "agent") {
|
|
359
|
+
if (!agentId) throw new Error("agentId required when source is agent");
|
|
360
|
+
return agentId;
|
|
361
|
+
}
|
|
362
|
+
return "system";
|
|
363
|
+
}
|
|
364
|
+
function messageSourceColor(source) {
|
|
365
|
+
if (source === "user") return "yellow";
|
|
366
|
+
if (source === "agent") return "cyan";
|
|
367
|
+
return "gray";
|
|
368
|
+
}
|
|
369
|
+
function reportBadge(type) {
|
|
370
|
+
return type === "final" ? { label: "FINAL", color: "cyan" } : { label: "UPDATE", color: "yellow" };
|
|
371
|
+
}
|
|
372
|
+
function agentDisplayName(agent) {
|
|
373
|
+
return agent.name !== agent.id ? agent.name : agent.agentType;
|
|
374
|
+
}
|
|
375
|
+
function modeColor(mode) {
|
|
376
|
+
if (mode === "planning") return "blue";
|
|
377
|
+
if (mode === "implementation") return "green";
|
|
378
|
+
return "cyan";
|
|
379
|
+
}
|
|
380
|
+
function mergeStatusDisplay(status) {
|
|
381
|
+
switch (status) {
|
|
382
|
+
case "merged":
|
|
383
|
+
return { icon: "\u2295", label: "merged", color: "green" };
|
|
384
|
+
case "pending":
|
|
385
|
+
return { icon: "\u25CC", label: "pending", color: "yellow" };
|
|
386
|
+
case "no-changes":
|
|
387
|
+
return { icon: "\u2205", label: "no changes", color: "gray" };
|
|
388
|
+
case "conflict":
|
|
389
|
+
return { icon: "\u26A0", label: "conflict", color: "red" };
|
|
390
|
+
default:
|
|
391
|
+
return null;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
356
394
|
function wrapText(text, width) {
|
|
357
|
-
|
|
395
|
+
const cleaned = cleanMarkdown(text);
|
|
396
|
+
if (width <= 0) return cleaned.split("\n");
|
|
358
397
|
const result = [];
|
|
359
|
-
for (const rawLine of
|
|
398
|
+
for (const rawLine of cleaned.split("\n")) {
|
|
360
399
|
if (stringWidth(rawLine) <= width) {
|
|
361
400
|
result.push(rawLine);
|
|
362
401
|
continue;
|
|
@@ -493,7 +532,7 @@ function renderNodeContent(node, maxWidth) {
|
|
|
493
532
|
const dur = formatDuration(node.spawnedAt, node.completedAt);
|
|
494
533
|
const durClr = durationColor(node.spawnedAt, node.completedAt) || void 0;
|
|
495
534
|
const dim = node.status === "completed";
|
|
496
|
-
const displayName = node.name
|
|
535
|
+
const displayName = agentDisplayName({ name: node.name, id: node.agentId, agentType: node.agentType });
|
|
497
536
|
const maxLabel = Math.max(8, maxWidth - dur.length - 4);
|
|
498
537
|
return {
|
|
499
538
|
icon,
|
|
@@ -702,14 +741,14 @@ function buildLines(session, planContent, goalContent, _logsContent, width, pane
|
|
|
702
741
|
const elapsed = formatDuration(session.createdAt, session.completedAt);
|
|
703
742
|
const activeMs = computeActiveTimeMs(session);
|
|
704
743
|
const activeTime = formatDuration(activeMs);
|
|
705
|
-
const
|
|
744
|
+
const modeLabelColor = modeColor(mode);
|
|
706
745
|
lines.push([
|
|
707
746
|
seg(" "),
|
|
708
747
|
seg(isDead ? "\u2715 dead" : session.status, {
|
|
709
748
|
color: statusColor(isDead ? "crashed" : session.status)
|
|
710
749
|
}),
|
|
711
750
|
seg(` \xB7 cycle ${cycleNum}`, { dim: true }),
|
|
712
|
-
...mode ? [seg(" (", { dim: true }), seg(mode, { color:
|
|
751
|
+
...mode ? [seg(" (", { dim: true }), seg(mode, { color: modeLabelColor }), seg(")", { dim: true })] : [],
|
|
713
752
|
seg(` \xB7 ${elapsed} \xB7 `, { dim: true }),
|
|
714
753
|
seg(`${runningAgents} running`, { color: "green" }),
|
|
715
754
|
seg(" \xB7 ", { dim: true }),
|
|
@@ -752,7 +791,7 @@ function buildLines(session, planContent, goalContent, _logsContent, width, pane
|
|
|
752
791
|
if (session.status === "completed" && session.completionReport) {
|
|
753
792
|
lines.push(singleLine(" "));
|
|
754
793
|
lines.push([seg(" \u258E \u2713 COMPLETION", { color: "cyan", bold: true })]);
|
|
755
|
-
wrapText(
|
|
794
|
+
wrapText(session.completionReport, contentWidth - 6).forEach(
|
|
756
795
|
(l) => {
|
|
757
796
|
lines.push(singleLine(` ${l}`, { dim: true }));
|
|
758
797
|
}
|
|
@@ -765,8 +804,9 @@ function buildLines(session, planContent, goalContent, _logsContent, width, pane
|
|
|
765
804
|
]);
|
|
766
805
|
const pushMsgLine = (msg, connector) => {
|
|
767
806
|
const time = formatTime(msg.timestamp);
|
|
768
|
-
const
|
|
769
|
-
const
|
|
807
|
+
const agentId = msg.source.type === "agent" ? msg.source.agentId : void 0;
|
|
808
|
+
const label = messageSourceLabel(msg.source.type, agentId);
|
|
809
|
+
const labelColor = messageSourceColor(msg.source.type);
|
|
770
810
|
const maxContent = Math.max(10, contentWidth - label.length - 18);
|
|
771
811
|
lines.push([
|
|
772
812
|
seg(` ${connector} `, { dim: true }),
|
|
@@ -799,7 +839,7 @@ function buildLines(session, planContent, goalContent, _logsContent, width, pane
|
|
|
799
839
|
const n = cycle.agentsSpawned.length;
|
|
800
840
|
const startTime = formatTime(cycle.timestamp);
|
|
801
841
|
const modeLabel = cycle.mode ? cycle.mode === "implementation" ? "impl" : cycle.mode === "planning" ? "plan" : cycle.mode : "";
|
|
802
|
-
const cycModeColor = cycle.mode
|
|
842
|
+
const cycModeColor = modeColor(cycle.mode);
|
|
803
843
|
const cycleAgents = agents.filter((a) => cycle.agentsSpawned.includes(a.id));
|
|
804
844
|
const cyclePad = `C${cycle.cycle}`.padEnd(4);
|
|
805
845
|
const durPad = (isRunning ? "running" : duration).padEnd(9);
|
|
@@ -969,7 +1009,7 @@ function buildLines3(cycle, agents, width) {
|
|
|
969
1009
|
...cycle.mode ? [
|
|
970
1010
|
seg(" \xB7 ", { dim: true }),
|
|
971
1011
|
seg(cycle.mode, {
|
|
972
|
-
color: cycle.mode
|
|
1012
|
+
color: modeColor(cycle.mode)
|
|
973
1013
|
})
|
|
974
1014
|
] : []
|
|
975
1015
|
]);
|
|
@@ -983,7 +1023,7 @@ function buildLines3(cycle, agents, width) {
|
|
|
983
1023
|
lines.push(singleLine(" orchestrator spawning agents\u2026", { dim: true, italic: true }));
|
|
984
1024
|
} else {
|
|
985
1025
|
for (const agent of cycleAgents) {
|
|
986
|
-
const nameLabel = agent
|
|
1026
|
+
const nameLabel = agentDisplayName(agent);
|
|
987
1027
|
const instrPreview = agent.instruction.split("\n")[0] || "";
|
|
988
1028
|
const latestReport = agent.reports.length > 0 ? agent.reports[agent.reports.length - 1] : null;
|
|
989
1029
|
const reportSummary = latestReport && agent.status === "completed" ? extractFirstSentence(latestReport.summary, contentWidth - 14) : null;
|
|
@@ -1047,38 +1087,19 @@ function buildLines4(agent, reportBlocks, width) {
|
|
|
1047
1087
|
const dur = formatDuration(agent.spawnedAt, agent.completedAt);
|
|
1048
1088
|
const icon = agentStatusIcon(agent.status);
|
|
1049
1089
|
const color = statusColor(agent.status);
|
|
1050
|
-
const nameLabel = agent
|
|
1090
|
+
const nameLabel = agentDisplayName(agent);
|
|
1051
1091
|
const maxMergeLines = 3;
|
|
1052
1092
|
lines.push([
|
|
1053
1093
|
seg(" "),
|
|
1054
1094
|
seg(icon, { color }),
|
|
1055
1095
|
seg(` ${agent.id} \xB7 ${nameLabel}`, { bold: true })
|
|
1056
1096
|
]);
|
|
1057
|
-
const
|
|
1058
|
-
if (agent.mergeStatus) {
|
|
1059
|
-
mergeSegs.push(seg(" \xB7 ", { dim: true }));
|
|
1060
|
-
switch (agent.mergeStatus) {
|
|
1061
|
-
case "merged":
|
|
1062
|
-
mergeSegs.push(seg("\u2295 merged", { color: "green" }));
|
|
1063
|
-
break;
|
|
1064
|
-
case "pending":
|
|
1065
|
-
mergeSegs.push(seg("\u25CC pending", { color: "yellow" }));
|
|
1066
|
-
break;
|
|
1067
|
-
case "no-changes":
|
|
1068
|
-
mergeSegs.push(seg("\u2205 no changes", { color: "gray" }));
|
|
1069
|
-
break;
|
|
1070
|
-
case "conflict":
|
|
1071
|
-
mergeSegs.push(seg("\u26A0 conflict", { color: "red" }));
|
|
1072
|
-
break;
|
|
1073
|
-
default:
|
|
1074
|
-
mergeSegs.push(seg(agent.mergeStatus, { dim: true }));
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1097
|
+
const merge = agent.mergeStatus ? mergeStatusDisplay(agent.mergeStatus) : null;
|
|
1077
1098
|
lines.push([
|
|
1078
1099
|
seg(" "),
|
|
1079
1100
|
seg(agent.status, { color }),
|
|
1080
1101
|
seg(` \xB7 ${dur} \xB7 ${agent.agentType}`, { dim: true }),
|
|
1081
|
-
...
|
|
1102
|
+
...merge ? [seg(" \xB7 ", { dim: true }), seg(`${merge.icon} ${merge.label}`, { color: merge.color })] : agent.mergeStatus ? [seg(" \xB7 ", { dim: true }), seg(agent.mergeStatus, { dim: true })] : []
|
|
1082
1103
|
]);
|
|
1083
1104
|
if (agent.killedReason) {
|
|
1084
1105
|
lines.push(singleLine(` \u26A0 ${agent.killedReason}`, { color: "red" }));
|
|
@@ -1103,22 +1124,20 @@ function buildLines4(agent, reportBlocks, width) {
|
|
|
1103
1124
|
if (hasResolved) {
|
|
1104
1125
|
for (let i = 0; i < reportBlocks.length; i++) {
|
|
1105
1126
|
const block = reportBlocks[i];
|
|
1106
|
-
const badge = block.type
|
|
1107
|
-
const badgeColor = block.type === "final" ? "cyan" : "yellow";
|
|
1127
|
+
const { label: badge, color: badgeColor } = reportBadge(block.type);
|
|
1108
1128
|
if (i > 0) lines.push(singleLine(" "));
|
|
1109
1129
|
lines.push([
|
|
1110
1130
|
seg(" "),
|
|
1111
1131
|
seg(badge, { color: badgeColor, bold: block.type === "final" }),
|
|
1112
1132
|
seg(` ${formatTime(block.timestamp)}`, { dim: true })
|
|
1113
1133
|
]);
|
|
1114
|
-
for (const wl of wrapText(
|
|
1134
|
+
for (const wl of wrapText(block.content.trim(), contentWidth - 10)) {
|
|
1115
1135
|
lines.push(singleLine(` ${wl}`, { dim: true }));
|
|
1116
1136
|
}
|
|
1117
1137
|
}
|
|
1118
1138
|
} else {
|
|
1119
1139
|
for (const report of agent.reports) {
|
|
1120
|
-
const badge = report.type
|
|
1121
|
-
const badgeColor = report.type === "final" ? "cyan" : "yellow";
|
|
1140
|
+
const { label: badge, color: badgeColor } = reportBadge(report.type);
|
|
1122
1141
|
lines.push([
|
|
1123
1142
|
seg(" "),
|
|
1124
1143
|
seg(badge, { color: badgeColor, bold: report.type === "final" }),
|
|
@@ -1162,142 +1181,81 @@ function AgentDetail({ agent, reportBlocks, width, height, scrollOffset = 0, foc
|
|
|
1162
1181
|
}
|
|
1163
1182
|
|
|
1164
1183
|
// src/tui/components/ReportView.tsx
|
|
1165
|
-
import {
|
|
1166
|
-
import {
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
const [scrollOffset, setScrollOffset] = useState(0);
|
|
1184
|
+
import { useMemo as useMemo5 } from "react";
|
|
1185
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1186
|
+
function buildLines5(agent, reportBlocks, width) {
|
|
1187
|
+
const lines = [];
|
|
1170
1188
|
const contentWidth = width - 6;
|
|
1171
|
-
const
|
|
1172
|
-
const lines2 = [];
|
|
1173
|
-
if (reportBlocks.length === 0) {
|
|
1174
|
-
lines2.push({ text: "", dim: true });
|
|
1175
|
-
lines2.push({ text: " No reports submitted yet.", dim: true });
|
|
1176
|
-
lines2.push({ text: "", dim: true });
|
|
1177
|
-
return lines2;
|
|
1178
|
-
}
|
|
1179
|
-
for (let i = 0; i < reportBlocks.length; i++) {
|
|
1180
|
-
const report = reportBlocks[i];
|
|
1181
|
-
const time = formatTime(report.timestamp);
|
|
1182
|
-
if (i > 0) {
|
|
1183
|
-
lines2.push({ text: "" });
|
|
1184
|
-
lines2.push({ text: ` ${divider(contentWidth - 2, "\xB7")}`, dim: true });
|
|
1185
|
-
lines2.push({ text: "" });
|
|
1186
|
-
}
|
|
1187
|
-
const badge = report.type === "final" ? "FINAL" : "UPDATE";
|
|
1188
|
-
const badgeColor = report.type === "final" ? "cyan" : "yellow";
|
|
1189
|
-
lines2.push({
|
|
1190
|
-
text: ` ${badge} ${time}`,
|
|
1191
|
-
color: badgeColor,
|
|
1192
|
-
bold: report.type === "final"
|
|
1193
|
-
});
|
|
1194
|
-
lines2.push({ text: "" });
|
|
1195
|
-
const wrapped = wrapText(report.content.trim(), contentWidth - 4);
|
|
1196
|
-
for (const line of wrapped) {
|
|
1197
|
-
lines2.push({ text: ` ${line}` });
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
lines2.push({ text: "" });
|
|
1201
|
-
return lines2;
|
|
1202
|
-
}, [reportBlocks, contentWidth]);
|
|
1203
|
-
const viewableHeight = height - 7;
|
|
1204
|
-
const maxScroll = Math.max(0, lines.length - viewableHeight);
|
|
1205
|
-
useInput((input, key) => {
|
|
1206
|
-
if (key.escape || key.return) {
|
|
1207
|
-
onClose();
|
|
1208
|
-
return;
|
|
1209
|
-
}
|
|
1210
|
-
if (key.upArrow) {
|
|
1211
|
-
setScrollOffset((o) => Math.max(0, o - 1));
|
|
1212
|
-
return;
|
|
1213
|
-
}
|
|
1214
|
-
if (key.downArrow) {
|
|
1215
|
-
setScrollOffset((o) => Math.min(maxScroll, o + 1));
|
|
1216
|
-
return;
|
|
1217
|
-
}
|
|
1218
|
-
if (input === "[" || key.upArrow && key.shift) {
|
|
1219
|
-
setScrollOffset((o) => Math.max(0, o - Math.floor(viewableHeight / 2)));
|
|
1220
|
-
return;
|
|
1221
|
-
}
|
|
1222
|
-
if (input === "]" || key.downArrow && key.shift) {
|
|
1223
|
-
setScrollOffset((o) => Math.min(maxScroll, o + Math.floor(viewableHeight / 2)));
|
|
1224
|
-
return;
|
|
1225
|
-
}
|
|
1226
|
-
});
|
|
1227
|
-
const visible = lines.slice(scrollOffset, scrollOffset + viewableHeight);
|
|
1228
|
-
const scrollPct = maxScroll > 0 ? Math.round(scrollOffset / maxScroll * 100) : 100;
|
|
1229
|
-
const totalReports = agent.reports.length;
|
|
1189
|
+
const dur = formatDuration(agent.spawnedAt, agent.completedAt);
|
|
1230
1190
|
const icon = agentStatusIcon(agent.status);
|
|
1231
1191
|
const color = statusColor(agent.status);
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1234
|
-
|
|
1192
|
+
const totalReports = agent.reports.length;
|
|
1193
|
+
const nameLabel = agentDisplayName(agent);
|
|
1194
|
+
lines.push([
|
|
1195
|
+
seg(" "),
|
|
1196
|
+
seg(icon, { color }),
|
|
1197
|
+
seg(" "),
|
|
1198
|
+
seg(agent.id, { bold: true }),
|
|
1199
|
+
seg(" ", { dim: true }),
|
|
1200
|
+
seg("\xB7", { dim: true }),
|
|
1201
|
+
seg(" "),
|
|
1202
|
+
seg(nameLabel, { bold: true })
|
|
1203
|
+
]);
|
|
1204
|
+
lines.push(singleLine(
|
|
1205
|
+
` ${agent.status} \xB7 ${dur} \xB7 ${agent.agentType} \xB7 ${totalReports} report${totalReports !== 1 ? "s" : ""}`,
|
|
1206
|
+
{ dim: true }
|
|
1207
|
+
));
|
|
1208
|
+
lines.push(singleLine(" " + divider(contentWidth - 2), { dim: true }));
|
|
1209
|
+
if (reportBlocks.length === 0) {
|
|
1210
|
+
lines.push(singleLine(""));
|
|
1211
|
+
lines.push(singleLine(" No reports submitted yet.", { dim: true }));
|
|
1212
|
+
lines.push(singleLine(""));
|
|
1213
|
+
return lines;
|
|
1214
|
+
}
|
|
1215
|
+
for (let i = 0; i < reportBlocks.length; i++) {
|
|
1216
|
+
const report = reportBlocks[i];
|
|
1217
|
+
const time = formatTime(report.timestamp);
|
|
1218
|
+
if (i > 0) {
|
|
1219
|
+
lines.push(singleLine(""));
|
|
1220
|
+
lines.push(singleLine(` ${divider(contentWidth - 2, "\xB7")}`, { dim: true }));
|
|
1221
|
+
lines.push(singleLine(""));
|
|
1222
|
+
}
|
|
1223
|
+
const { label: badge, color: badgeColor } = reportBadge(report.type);
|
|
1224
|
+
lines.push([
|
|
1225
|
+
seg(` ${badge}`, { color: badgeColor, bold: report.type === "final" }),
|
|
1226
|
+
seg(` ${time}`, { color: badgeColor })
|
|
1227
|
+
]);
|
|
1228
|
+
lines.push(singleLine(""));
|
|
1229
|
+
const wrapped = wrapText(report.content.trim(), contentWidth - 4);
|
|
1230
|
+
for (const line of wrapped) {
|
|
1231
|
+
lines.push(singleLine(` ${line}`));
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
lines.push(singleLine(""));
|
|
1235
|
+
return lines;
|
|
1236
|
+
}
|
|
1237
|
+
function ReportView({ agent, reportBlocks, width, height, scrollOffset = 0, focused = false }) {
|
|
1238
|
+
const lines = useMemo5(
|
|
1239
|
+
() => buildLines5(agent, reportBlocks, width),
|
|
1240
|
+
[agent, reportBlocks, width]
|
|
1241
|
+
);
|
|
1242
|
+
return /* @__PURE__ */ jsx8(
|
|
1243
|
+
ScrollablePanel,
|
|
1235
1244
|
{
|
|
1236
|
-
|
|
1245
|
+
lines,
|
|
1237
1246
|
width,
|
|
1238
1247
|
height,
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
children: [
|
|
1243
|
-
/* @__PURE__ */ jsxs3(Text6, { bold: true, children: [
|
|
1244
|
-
" ",
|
|
1245
|
-
/* @__PURE__ */ jsx8(Text6, { color, children: icon }),
|
|
1246
|
-
" ",
|
|
1247
|
-
agent.id,
|
|
1248
|
-
" ",
|
|
1249
|
-
/* @__PURE__ */ jsx8(Text6, { dimColor: true, children: "\xB7" }),
|
|
1250
|
-
" ",
|
|
1251
|
-
agent.name !== agent.id ? agent.name : agent.agentType
|
|
1252
|
-
] }),
|
|
1253
|
-
/* @__PURE__ */ jsxs3(Text6, { dimColor: true, children: [
|
|
1254
|
-
" ",
|
|
1255
|
-
agent.status,
|
|
1256
|
-
" \xB7 ",
|
|
1257
|
-
dur,
|
|
1258
|
-
" \xB7 ",
|
|
1259
|
-
agent.agentType,
|
|
1260
|
-
" \xB7 ",
|
|
1261
|
-
totalReports,
|
|
1262
|
-
" report",
|
|
1263
|
-
totalReports !== 1 ? "s" : ""
|
|
1264
|
-
] }),
|
|
1265
|
-
/* @__PURE__ */ jsx8(Text6, { dimColor: true, children: " " + divider(contentWidth - 2) }),
|
|
1266
|
-
/* @__PURE__ */ jsx8(Box6, { flexDirection: "column", flexGrow: 1, children: visible.map((line, i) => /* @__PURE__ */ jsx8(
|
|
1267
|
-
Text6,
|
|
1268
|
-
{
|
|
1269
|
-
color: line.color,
|
|
1270
|
-
bold: line.bold,
|
|
1271
|
-
dimColor: line.dim,
|
|
1272
|
-
children: line.text
|
|
1273
|
-
},
|
|
1274
|
-
i
|
|
1275
|
-
)) }),
|
|
1276
|
-
/* @__PURE__ */ jsx8(Text6, { dimColor: true, children: " " + divider(contentWidth - 2) }),
|
|
1277
|
-
/* @__PURE__ */ jsxs3(Text6, { dimColor: true, children: [
|
|
1278
|
-
" ",
|
|
1279
|
-
"[esc] back [\u2191\u2193] scroll [",
|
|
1280
|
-
"] page",
|
|
1281
|
-
" ",
|
|
1282
|
-
/* @__PURE__ */ jsxs3(Text6, { children: [
|
|
1283
|
-
scrollPct,
|
|
1284
|
-
"%"
|
|
1285
|
-
] }),
|
|
1286
|
-
maxScroll > 0 && /* @__PURE__ */ jsxs3(Text6, { dimColor: true, children: [
|
|
1287
|
-
" \xB7 ",
|
|
1288
|
-
lines.length,
|
|
1289
|
-
" lines"
|
|
1290
|
-
] })
|
|
1291
|
-
] })
|
|
1292
|
-
]
|
|
1248
|
+
scrollOffset,
|
|
1249
|
+
focused,
|
|
1250
|
+
borderColor: "cyan"
|
|
1293
1251
|
}
|
|
1294
1252
|
);
|
|
1295
1253
|
}
|
|
1296
1254
|
|
|
1297
1255
|
// src/tui/components/InputBar.tsx
|
|
1298
|
-
import { useState
|
|
1299
|
-
import { Box as
|
|
1300
|
-
import { jsx as jsx9, jsxs as
|
|
1256
|
+
import { useState, useEffect, useRef } from "react";
|
|
1257
|
+
import { Box as Box6, Text as Text6, useInput } from "ink";
|
|
1258
|
+
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1301
1259
|
var INPUT_MODES = /* @__PURE__ */ new Set([
|
|
1302
1260
|
"resume",
|
|
1303
1261
|
"continue",
|
|
@@ -1320,8 +1278,8 @@ var PROMPTS = {
|
|
|
1320
1278
|
};
|
|
1321
1279
|
var OPTIONAL_INPUT = /* @__PURE__ */ new Set(["resume", "continue", "search"]);
|
|
1322
1280
|
function InputBar({ mode, defaultText, onSubmit, onCancel }) {
|
|
1323
|
-
const [text, setText] =
|
|
1324
|
-
const [cursorPos, setCursorPos] =
|
|
1281
|
+
const [text, setText] = useState("");
|
|
1282
|
+
const [cursorPos, setCursorPos] = useState(0);
|
|
1325
1283
|
const prevMode = useRef(mode);
|
|
1326
1284
|
useEffect(() => {
|
|
1327
1285
|
if (mode !== prevMode.current) {
|
|
@@ -1335,7 +1293,7 @@ function InputBar({ mode, defaultText, onSubmit, onCancel }) {
|
|
|
1335
1293
|
}
|
|
1336
1294
|
prevMode.current = mode;
|
|
1337
1295
|
}, [mode, defaultText]);
|
|
1338
|
-
|
|
1296
|
+
useInput(
|
|
1339
1297
|
(input, key) => {
|
|
1340
1298
|
if (key.return) {
|
|
1341
1299
|
if (OPTIONAL_INPUT.has(mode) || text.trim()) {
|
|
@@ -1391,163 +1349,163 @@ function InputBar({ mode, defaultText, onSubmit, onCancel }) {
|
|
|
1391
1349
|
{ isActive: INPUT_MODES.has(mode) }
|
|
1392
1350
|
);
|
|
1393
1351
|
if (mode === "navigate") {
|
|
1394
|
-
return /* @__PURE__ */ jsx9(
|
|
1352
|
+
return /* @__PURE__ */ jsx9(Box6, { paddingX: 1, children: /* @__PURE__ */ jsx9(Text6, { dimColor: true, children: "Press [m] to message orchestrator, [n] for new session" }) });
|
|
1395
1353
|
}
|
|
1396
1354
|
if (mode === "report-detail" || mode === "leader" || mode === "copy-menu" || mode === "help" || !INPUT_MODES.has(mode)) {
|
|
1397
1355
|
return null;
|
|
1398
1356
|
}
|
|
1399
1357
|
const prompt = PROMPTS[mode] ?? mode;
|
|
1400
|
-
return /* @__PURE__ */
|
|
1401
|
-
/* @__PURE__ */
|
|
1358
|
+
return /* @__PURE__ */ jsxs3(Box6, { paddingX: 1, children: [
|
|
1359
|
+
/* @__PURE__ */ jsxs3(Text6, { color: "yellow", children: [
|
|
1402
1360
|
prompt,
|
|
1403
1361
|
" > "
|
|
1404
1362
|
] }),
|
|
1405
|
-
/* @__PURE__ */ jsx9(
|
|
1406
|
-
/* @__PURE__ */ jsx9(
|
|
1407
|
-
/* @__PURE__ */ jsx9(
|
|
1408
|
-
/* @__PURE__ */ jsx9(
|
|
1363
|
+
/* @__PURE__ */ jsx9(Text6, { children: text.slice(0, cursorPos) }),
|
|
1364
|
+
/* @__PURE__ */ jsx9(Text6, { inverse: true, children: cursorPos < text.length ? text[cursorPos] : " " }),
|
|
1365
|
+
/* @__PURE__ */ jsx9(Text6, { children: text.slice(cursorPos + 1) }),
|
|
1366
|
+
/* @__PURE__ */ jsx9(Text6, { dimColor: true, children: " (enter to send, esc to cancel)" })
|
|
1409
1367
|
] });
|
|
1410
1368
|
}
|
|
1411
1369
|
|
|
1412
1370
|
// src/tui/components/StatusLine.tsx
|
|
1413
|
-
import { Box as
|
|
1414
|
-
import { Fragment, jsx as jsx10, jsxs as
|
|
1371
|
+
import { Box as Box7, Text as Text7 } from "ink";
|
|
1372
|
+
import { Fragment, jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1415
1373
|
function StatusLine({ mode, detailFocused = false, logsFocused = false, showLogs = false, cursorNodeType }) {
|
|
1416
1374
|
if (mode === "report-detail") {
|
|
1417
1375
|
return null;
|
|
1418
1376
|
}
|
|
1419
1377
|
if (mode === "leader") {
|
|
1420
|
-
return /* @__PURE__ */
|
|
1421
|
-
/* @__PURE__ */ jsx10(
|
|
1422
|
-
/* @__PURE__ */ jsx10(
|
|
1378
|
+
return /* @__PURE__ */ jsxs4(Box7, { paddingX: 1, children: [
|
|
1379
|
+
/* @__PURE__ */ jsx10(Text7, { color: "magenta", bold: true, children: "LEADER" }),
|
|
1380
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " press a command key or [esc] to cancel" })
|
|
1423
1381
|
] });
|
|
1424
1382
|
}
|
|
1425
1383
|
if (mode === "copy-menu") {
|
|
1426
|
-
return /* @__PURE__ */
|
|
1427
|
-
/* @__PURE__ */ jsx10(
|
|
1428
|
-
/* @__PURE__ */ jsx10(
|
|
1384
|
+
return /* @__PURE__ */ jsxs4(Box7, { paddingX: 1, children: [
|
|
1385
|
+
/* @__PURE__ */ jsx10(Text7, { color: "cyan", bold: true, children: "COPY" }),
|
|
1386
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " [p] path [C] context [l] logs [s] session ID [esc] cancel" })
|
|
1429
1387
|
] });
|
|
1430
1388
|
}
|
|
1431
1389
|
if (mode === "help") {
|
|
1432
|
-
return /* @__PURE__ */
|
|
1433
|
-
/* @__PURE__ */ jsx10(
|
|
1434
|
-
/* @__PURE__ */ jsx10(
|
|
1390
|
+
return /* @__PURE__ */ jsxs4(Box7, { paddingX: 1, children: [
|
|
1391
|
+
/* @__PURE__ */ jsx10(Text7, { color: "yellow", bold: true, children: "HELP" }),
|
|
1392
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " [esc] or [?] to dismiss" })
|
|
1435
1393
|
] });
|
|
1436
1394
|
}
|
|
1437
1395
|
if (mode === "delete-confirm") {
|
|
1438
|
-
return /* @__PURE__ */
|
|
1439
|
-
/* @__PURE__ */ jsx10(
|
|
1440
|
-
/* @__PURE__ */ jsx10(
|
|
1396
|
+
return /* @__PURE__ */ jsxs4(Box7, { paddingX: 1, children: [
|
|
1397
|
+
/* @__PURE__ */ jsx10(Text7, { color: "red", bold: true, children: "DELETE" }),
|
|
1398
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " type 'yes' to confirm, [esc] to cancel" })
|
|
1441
1399
|
] });
|
|
1442
1400
|
}
|
|
1443
1401
|
if (mode === "spawn-agent") {
|
|
1444
|
-
return /* @__PURE__ */
|
|
1445
|
-
/* @__PURE__ */ jsx10(
|
|
1446
|
-
/* @__PURE__ */ jsx10(
|
|
1402
|
+
return /* @__PURE__ */ jsxs4(Box7, { paddingX: 1, children: [
|
|
1403
|
+
/* @__PURE__ */ jsx10(Text7, { color: "green", bold: true, children: "SPAWN" }),
|
|
1404
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " enter agent instruction, [esc] to cancel" })
|
|
1447
1405
|
] });
|
|
1448
1406
|
}
|
|
1449
1407
|
if (mode === "search") {
|
|
1450
|
-
return /* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */ jsx10(
|
|
1452
|
-
/* @__PURE__ */ jsx10(
|
|
1408
|
+
return /* @__PURE__ */ jsxs4(Box7, { paddingX: 1, children: [
|
|
1409
|
+
/* @__PURE__ */ jsx10(Text7, { color: "blue", bold: true, children: "SEARCH" }),
|
|
1410
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " type to filter, enter to apply, [esc] to cancel" })
|
|
1453
1411
|
] });
|
|
1454
1412
|
}
|
|
1455
1413
|
if (mode === "message-agent") {
|
|
1456
|
-
return /* @__PURE__ */
|
|
1457
|
-
/* @__PURE__ */ jsx10(
|
|
1458
|
-
/* @__PURE__ */ jsx10(
|
|
1414
|
+
return /* @__PURE__ */ jsxs4(Box7, { paddingX: 1, children: [
|
|
1415
|
+
/* @__PURE__ */ jsx10(Text7, { color: "cyan", bold: true, children: "MESSAGE" }),
|
|
1416
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " enter message for agent, [esc] to cancel" })
|
|
1459
1417
|
] });
|
|
1460
1418
|
}
|
|
1461
1419
|
if (mode === "shell-command") {
|
|
1462
|
-
return /* @__PURE__ */
|
|
1463
|
-
/* @__PURE__ */ jsx10(
|
|
1464
|
-
/* @__PURE__ */ jsx10(
|
|
1420
|
+
return /* @__PURE__ */ jsxs4(Box7, { paddingX: 1, children: [
|
|
1421
|
+
/* @__PURE__ */ jsx10(Text7, { color: "magenta", bold: true, children: "SHELL" }),
|
|
1422
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " enter command, [esc] to cancel" })
|
|
1465
1423
|
] });
|
|
1466
1424
|
}
|
|
1467
1425
|
if (mode !== "navigate") {
|
|
1468
|
-
return /* @__PURE__ */ jsx10(
|
|
1426
|
+
return /* @__PURE__ */ jsx10(Box7, { paddingX: 1, children: /* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "[enter] send [esc] cancel" }) });
|
|
1469
1427
|
}
|
|
1470
1428
|
if (logsFocused) {
|
|
1471
|
-
return /* @__PURE__ */
|
|
1472
|
-
/* @__PURE__ */ jsx10(
|
|
1473
|
-
/* @__PURE__ */ jsx10(
|
|
1474
|
-
/* @__PURE__ */ jsx10(
|
|
1475
|
-
/* @__PURE__ */ jsx10(
|
|
1476
|
-
/* @__PURE__ */ jsx10(
|
|
1477
|
-
/* @__PURE__ */ jsx10(
|
|
1478
|
-
/* @__PURE__ */ jsx10(
|
|
1479
|
-
/* @__PURE__ */ jsx10(
|
|
1480
|
-
/* @__PURE__ */ jsx10(
|
|
1481
|
-
/* @__PURE__ */ jsx10(
|
|
1482
|
-
/* @__PURE__ */ jsx10(
|
|
1483
|
-
/* @__PURE__ */ jsx10(
|
|
1484
|
-
/* @__PURE__ */ jsx10(
|
|
1485
|
-
/* @__PURE__ */ jsx10(
|
|
1486
|
-
/* @__PURE__ */ jsx10(
|
|
1487
|
-
/* @__PURE__ */ jsx10(
|
|
1488
|
-
/* @__PURE__ */ jsx10(
|
|
1489
|
-
/* @__PURE__ */ jsx10(
|
|
1490
|
-
/* @__PURE__ */ jsx10(
|
|
1491
|
-
/* @__PURE__ */ jsx10(
|
|
1492
|
-
/* @__PURE__ */ jsx10(
|
|
1429
|
+
return /* @__PURE__ */ jsxs4(Box7, { paddingX: 1, children: [
|
|
1430
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[jk/\u2191\u2193]" }),
|
|
1431
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " scroll " }),
|
|
1432
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[h/\u2190/tab]" }),
|
|
1433
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " back " }),
|
|
1434
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[t]" }),
|
|
1435
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "oggle logs " }),
|
|
1436
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "\u2502 " }),
|
|
1437
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[m]" }),
|
|
1438
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "sg " }),
|
|
1439
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[g]" }),
|
|
1440
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "oal " }),
|
|
1441
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[n]" }),
|
|
1442
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "ew " }),
|
|
1443
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[p]" }),
|
|
1444
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "lan " }),
|
|
1445
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[w]" }),
|
|
1446
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "indow " }),
|
|
1447
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[R]" }),
|
|
1448
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "esume " }),
|
|
1449
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[q]" }),
|
|
1450
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "uit" })
|
|
1493
1451
|
] });
|
|
1494
1452
|
}
|
|
1495
1453
|
if (detailFocused) {
|
|
1496
|
-
return /* @__PURE__ */
|
|
1497
|
-
/* @__PURE__ */ jsx10(
|
|
1498
|
-
/* @__PURE__ */ jsx10(
|
|
1499
|
-
/* @__PURE__ */ jsx10(
|
|
1500
|
-
/* @__PURE__ */ jsx10(
|
|
1501
|
-
/* @__PURE__ */ jsx10(
|
|
1502
|
-
/* @__PURE__ */ jsx10(
|
|
1503
|
-
/* @__PURE__ */ jsx10(
|
|
1504
|
-
/* @__PURE__ */ jsx10(
|
|
1505
|
-
/* @__PURE__ */ jsx10(
|
|
1506
|
-
/* @__PURE__ */ jsx10(
|
|
1507
|
-
/* @__PURE__ */ jsx10(
|
|
1508
|
-
/* @__PURE__ */ jsx10(
|
|
1509
|
-
/* @__PURE__ */ jsx10(
|
|
1510
|
-
/* @__PURE__ */ jsx10(
|
|
1511
|
-
/* @__PURE__ */ jsx10(
|
|
1512
|
-
/* @__PURE__ */ jsx10(
|
|
1513
|
-
/* @__PURE__ */ jsx10(
|
|
1514
|
-
/* @__PURE__ */ jsx10(
|
|
1515
|
-
/* @__PURE__ */ jsx10(
|
|
1516
|
-
/* @__PURE__ */ jsx10(
|
|
1517
|
-
/* @__PURE__ */ jsx10(
|
|
1454
|
+
return /* @__PURE__ */ jsxs4(Box7, { paddingX: 1, children: [
|
|
1455
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[jk/\u2191\u2193]" }),
|
|
1456
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " scroll " }),
|
|
1457
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[h/\u2190/tab]" }),
|
|
1458
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " back " }),
|
|
1459
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[t]" }),
|
|
1460
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "oggle logs " }),
|
|
1461
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "\u2502 " }),
|
|
1462
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[m]" }),
|
|
1463
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "sg " }),
|
|
1464
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[g]" }),
|
|
1465
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "oal " }),
|
|
1466
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[n]" }),
|
|
1467
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "ew " }),
|
|
1468
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[p]" }),
|
|
1469
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "lan " }),
|
|
1470
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[w]" }),
|
|
1471
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "indow " }),
|
|
1472
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[R]" }),
|
|
1473
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "esume " }),
|
|
1474
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[q]" }),
|
|
1475
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "uit" })
|
|
1518
1476
|
] });
|
|
1519
1477
|
}
|
|
1520
|
-
return /* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */ jsx10(
|
|
1522
|
-
/* @__PURE__ */ jsx10(
|
|
1523
|
-
/* @__PURE__ */ jsx10(
|
|
1524
|
-
cursorNodeType === "context-file" && /* @__PURE__ */
|
|
1525
|
-
/* @__PURE__ */ jsx10(
|
|
1526
|
-
/* @__PURE__ */ jsx10(
|
|
1527
|
-
/* @__PURE__ */ jsx10(
|
|
1528
|
-
/* @__PURE__ */ jsx10(
|
|
1478
|
+
return /* @__PURE__ */ jsxs4(Box7, { paddingX: 1, children: [
|
|
1479
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[hjkl]" }),
|
|
1480
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " navigate " }),
|
|
1481
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "\u2502 " }),
|
|
1482
|
+
cursorNodeType === "context-file" && /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1483
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[e]" }),
|
|
1484
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "dit " }),
|
|
1485
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[\u23CE]" }),
|
|
1486
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " open " })
|
|
1529
1487
|
] }),
|
|
1530
|
-
/* @__PURE__ */ jsx10(
|
|
1531
|
-
/* @__PURE__ */ jsx10(
|
|
1532
|
-
/* @__PURE__ */ jsx10(
|
|
1533
|
-
/* @__PURE__ */ jsx10(
|
|
1534
|
-
/* @__PURE__ */ jsx10(
|
|
1535
|
-
/* @__PURE__ */ jsx10(
|
|
1536
|
-
/* @__PURE__ */ jsx10(
|
|
1537
|
-
/* @__PURE__ */ jsx10(
|
|
1538
|
-
/* @__PURE__ */ jsx10(
|
|
1539
|
-
/* @__PURE__ */ jsx10(
|
|
1540
|
-
/* @__PURE__ */ jsx10(
|
|
1541
|
-
/* @__PURE__ */ jsx10(
|
|
1542
|
-
/* @__PURE__ */ jsx10(
|
|
1543
|
-
/* @__PURE__ */ jsx10(
|
|
1544
|
-
/* @__PURE__ */ jsx10(
|
|
1488
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[space]" }),
|
|
1489
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " leader " }),
|
|
1490
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[tab]" }),
|
|
1491
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: " detail " }),
|
|
1492
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[t]" }),
|
|
1493
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "oggle logs " }),
|
|
1494
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "\u2502 " }),
|
|
1495
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[m]" }),
|
|
1496
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "sg " }),
|
|
1497
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[n]" }),
|
|
1498
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "ew " }),
|
|
1499
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[R]" }),
|
|
1500
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "esume " }),
|
|
1501
|
+
/* @__PURE__ */ jsx10(Text7, { bold: true, children: "[q]" }),
|
|
1502
|
+
/* @__PURE__ */ jsx10(Text7, { dimColor: true, children: "uit" })
|
|
1545
1503
|
] });
|
|
1546
1504
|
}
|
|
1547
1505
|
|
|
1548
1506
|
// src/tui/components/LeaderOverlay.tsx
|
|
1549
|
-
import { Box as
|
|
1550
|
-
import { jsx as jsx11, jsxs as
|
|
1507
|
+
import { Box as Box8, Text as Text8 } from "ink";
|
|
1508
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1551
1509
|
var LEADER_WIDTH = 26;
|
|
1552
1510
|
var LEADER_HEIGHT = 19;
|
|
1553
1511
|
var COPY_HEIGHT = 9;
|
|
@@ -1557,8 +1515,8 @@ function pad(s) {
|
|
|
1557
1515
|
}
|
|
1558
1516
|
function LeaderOverlay({ mode, rows, cols }) {
|
|
1559
1517
|
if (mode === "leader") {
|
|
1560
|
-
return /* @__PURE__ */
|
|
1561
|
-
|
|
1518
|
+
return /* @__PURE__ */ jsxs5(
|
|
1519
|
+
Box8,
|
|
1562
1520
|
{
|
|
1563
1521
|
position: "absolute",
|
|
1564
1522
|
marginTop: rows - LEADER_HEIGHT - 2,
|
|
@@ -1568,30 +1526,30 @@ function LeaderOverlay({ mode, rows, cols }) {
|
|
|
1568
1526
|
borderStyle: "round",
|
|
1569
1527
|
borderColor: "magenta",
|
|
1570
1528
|
children: [
|
|
1571
|
-
/* @__PURE__ */ jsx11(
|
|
1572
|
-
/* @__PURE__ */ jsx11(
|
|
1573
|
-
/* @__PURE__ */ jsx11(
|
|
1574
|
-
/* @__PURE__ */ jsx11(
|
|
1575
|
-
/* @__PURE__ */ jsx11(
|
|
1576
|
-
/* @__PURE__ */ jsx11(
|
|
1577
|
-
/* @__PURE__ */ jsx11(
|
|
1578
|
-
/* @__PURE__ */ jsx11(
|
|
1579
|
-
/* @__PURE__ */ jsx11(
|
|
1580
|
-
/* @__PURE__ */ jsx11(
|
|
1581
|
-
/* @__PURE__ */ jsx11(
|
|
1582
|
-
/* @__PURE__ */ jsx11(
|
|
1583
|
-
/* @__PURE__ */ jsx11(
|
|
1584
|
-
/* @__PURE__ */ jsx11(
|
|
1585
|
-
/* @__PURE__ */ jsx11(
|
|
1586
|
-
/* @__PURE__ */ jsx11(
|
|
1587
|
-
/* @__PURE__ */ jsx11(
|
|
1529
|
+
/* @__PURE__ */ jsx11(Text8, { bold: true, color: "magenta", children: pad(" LEADER") }),
|
|
1530
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" ") }),
|
|
1531
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" y copy menu") }),
|
|
1532
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" d delete session") }),
|
|
1533
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" l daemon logs") }),
|
|
1534
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" o open session dir") }),
|
|
1535
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" a spawn agent") }),
|
|
1536
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" m message agent") }),
|
|
1537
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" / search") }),
|
|
1538
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" ! shell command") }),
|
|
1539
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" j jump to pane") }),
|
|
1540
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" k kill session/agent") }),
|
|
1541
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" q quit") }),
|
|
1542
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" ? help") }),
|
|
1543
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" 1-9 jump to session") }),
|
|
1544
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" ") }),
|
|
1545
|
+
/* @__PURE__ */ jsx11(Text8, { dimColor: true, children: pad(" esc dismiss") })
|
|
1588
1546
|
]
|
|
1589
1547
|
}
|
|
1590
1548
|
);
|
|
1591
1549
|
}
|
|
1592
1550
|
if (mode === "copy-menu") {
|
|
1593
|
-
return /* @__PURE__ */
|
|
1594
|
-
|
|
1551
|
+
return /* @__PURE__ */ jsxs5(
|
|
1552
|
+
Box8,
|
|
1595
1553
|
{
|
|
1596
1554
|
position: "absolute",
|
|
1597
1555
|
marginTop: rows - COPY_HEIGHT - 2,
|
|
@@ -1601,13 +1559,13 @@ function LeaderOverlay({ mode, rows, cols }) {
|
|
|
1601
1559
|
borderStyle: "round",
|
|
1602
1560
|
borderColor: "cyan",
|
|
1603
1561
|
children: [
|
|
1604
|
-
/* @__PURE__ */ jsx11(
|
|
1605
|
-
/* @__PURE__ */ jsx11(
|
|
1606
|
-
/* @__PURE__ */ jsx11(
|
|
1607
|
-
/* @__PURE__ */ jsx11(
|
|
1608
|
-
/* @__PURE__ */ jsx11(
|
|
1609
|
-
/* @__PURE__ */ jsx11(
|
|
1610
|
-
/* @__PURE__ */ jsx11(
|
|
1562
|
+
/* @__PURE__ */ jsx11(Text8, { bold: true, color: "cyan", children: pad(" COPY") }),
|
|
1563
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" ") }),
|
|
1564
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" p session path") }),
|
|
1565
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" C LLM context") }),
|
|
1566
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" l logs content") }),
|
|
1567
|
+
/* @__PURE__ */ jsx11(Text8, { children: pad(" s session ID") }),
|
|
1568
|
+
/* @__PURE__ */ jsx11(Text8, { dimColor: true, children: pad(" esc cancel") })
|
|
1611
1569
|
]
|
|
1612
1570
|
}
|
|
1613
1571
|
);
|
|
@@ -1616,8 +1574,8 @@ function LeaderOverlay({ mode, rows, cols }) {
|
|
|
1616
1574
|
}
|
|
1617
1575
|
|
|
1618
1576
|
// src/tui/components/HelpOverlay.tsx
|
|
1619
|
-
import { Box as
|
|
1620
|
-
import { jsx as jsx12, jsxs as
|
|
1577
|
+
import { Box as Box9, Text as Text9 } from "ink";
|
|
1578
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1621
1579
|
var HELP_WIDTH = 62;
|
|
1622
1580
|
var INNER2 = HELP_WIDTH - 2;
|
|
1623
1581
|
function pad2(s) {
|
|
@@ -1652,8 +1610,8 @@ function HelpOverlay({ mode, rows, cols }) {
|
|
|
1652
1610
|
row(" y \u2192 l logs content", " y \u2192 s session ID")
|
|
1653
1611
|
];
|
|
1654
1612
|
const overlayHeight = Math.min(lines.length + 4, rows - 2);
|
|
1655
|
-
return /* @__PURE__ */
|
|
1656
|
-
|
|
1613
|
+
return /* @__PURE__ */ jsxs6(
|
|
1614
|
+
Box9,
|
|
1657
1615
|
{
|
|
1658
1616
|
position: "absolute",
|
|
1659
1617
|
marginTop: Math.max(0, Math.floor((rows - overlayHeight) / 2)),
|
|
@@ -1663,20 +1621,20 @@ function HelpOverlay({ mode, rows, cols }) {
|
|
|
1663
1621
|
borderStyle: "round",
|
|
1664
1622
|
borderColor: "yellow",
|
|
1665
1623
|
children: [
|
|
1666
|
-
/* @__PURE__ */ jsx12(
|
|
1667
|
-
/* @__PURE__ */ jsx12(
|
|
1624
|
+
/* @__PURE__ */ jsx12(Text9, { bold: true, color: "yellow", children: pad2(" KEYBINDINGS (esc or ? to close)") }),
|
|
1625
|
+
/* @__PURE__ */ jsx12(Text9, { children: pad2(" ") }),
|
|
1668
1626
|
lines.map((line, i) => {
|
|
1669
|
-
if (line === "") return /* @__PURE__ */ jsx12(
|
|
1670
|
-
return /* @__PURE__ */ jsx12(
|
|
1627
|
+
if (line === "") return /* @__PURE__ */ jsx12(Text9, { children: pad2(" ") }, i);
|
|
1628
|
+
return /* @__PURE__ */ jsx12(Text9, { children: pad2(line) }, i);
|
|
1671
1629
|
}),
|
|
1672
|
-
/* @__PURE__ */ jsx12(
|
|
1630
|
+
/* @__PURE__ */ jsx12(Text9, { children: pad2(" ") })
|
|
1673
1631
|
]
|
|
1674
1632
|
}
|
|
1675
1633
|
);
|
|
1676
1634
|
}
|
|
1677
1635
|
|
|
1678
1636
|
// src/tui/hooks/usePolling.ts
|
|
1679
|
-
import { useState as
|
|
1637
|
+
import { useState as useState2, useEffect as useEffect2, useRef as useRef2, useCallback } from "react";
|
|
1680
1638
|
|
|
1681
1639
|
// src/tui/lib/client.ts
|
|
1682
1640
|
function send(request) {
|
|
@@ -1783,7 +1741,7 @@ function openEditorPopup(cwd2, editor, filePath, size) {
|
|
|
1783
1741
|
|
|
1784
1742
|
// src/tui/hooks/usePolling.ts
|
|
1785
1743
|
function usePolling(cwd2, selectedSessionId, intervalMs = 2500) {
|
|
1786
|
-
const [state, setState] =
|
|
1744
|
+
const [state, setState] = useState2({
|
|
1787
1745
|
sessions: [],
|
|
1788
1746
|
selectedSession: null,
|
|
1789
1747
|
planContent: "",
|
|
@@ -1894,9 +1852,9 @@ function usePolling(cwd2, selectedSessionId, intervalMs = 2500) {
|
|
|
1894
1852
|
}
|
|
1895
1853
|
|
|
1896
1854
|
// src/tui/hooks/useKeybindings.ts
|
|
1897
|
-
import { useInput as
|
|
1855
|
+
import { useInput as useInput2 } from "ink";
|
|
1898
1856
|
function useKeybindings(handlers, isActive) {
|
|
1899
|
-
|
|
1857
|
+
useInput2(
|
|
1900
1858
|
(input, key) => {
|
|
1901
1859
|
if (key.upArrow) {
|
|
1902
1860
|
handlers.onMoveUp();
|
|
@@ -2004,9 +1962,9 @@ function useKeybindings(handlers, isActive) {
|
|
|
2004
1962
|
}
|
|
2005
1963
|
|
|
2006
1964
|
// src/tui/hooks/useLeaderKey.ts
|
|
2007
|
-
import { useInput as
|
|
1965
|
+
import { useInput as useInput3 } from "ink";
|
|
2008
1966
|
function useLeaderKey(mode, onAction) {
|
|
2009
|
-
|
|
1967
|
+
useInput3(
|
|
2010
1968
|
(input, key) => {
|
|
2011
1969
|
if (key.escape) {
|
|
2012
1970
|
onAction({ type: "dismiss" });
|
|
@@ -2069,7 +2027,7 @@ function useLeaderKey(mode, onAction) {
|
|
|
2069
2027
|
},
|
|
2070
2028
|
{ isActive: mode === "leader" }
|
|
2071
2029
|
);
|
|
2072
|
-
|
|
2030
|
+
useInput3(
|
|
2073
2031
|
(input, key) => {
|
|
2074
2032
|
if (key.escape) {
|
|
2075
2033
|
onAction({ type: "dismiss" });
|
|
@@ -2095,7 +2053,7 @@ function useLeaderKey(mode, onAction) {
|
|
|
2095
2053
|
},
|
|
2096
2054
|
{ isActive: mode === "copy-menu" }
|
|
2097
2055
|
);
|
|
2098
|
-
|
|
2056
|
+
useInput3(
|
|
2099
2057
|
(input, key) => {
|
|
2100
2058
|
if (key.escape || input === "?") {
|
|
2101
2059
|
onAction({ type: "dismiss" });
|
|
@@ -2225,7 +2183,8 @@ function buildTree(sessions, selectedSession, expanded, cwd2, polledContextFiles
|
|
|
2225
2183
|
});
|
|
2226
2184
|
if (msgsExpanded) {
|
|
2227
2185
|
for (const msg of messages) {
|
|
2228
|
-
const
|
|
2186
|
+
const agentId = msg.source.type === "agent" ? msg.source.agentId : void 0;
|
|
2187
|
+
const sourceLabel = messageSourceLabel(msg.source.type, agentId);
|
|
2229
2188
|
nodes.push({
|
|
2230
2189
|
id: `message:${s.id}:${msg.id}`,
|
|
2231
2190
|
type: "message",
|
|
@@ -2283,7 +2242,7 @@ function findParentIndex(nodes, index) {
|
|
|
2283
2242
|
|
|
2284
2243
|
// src/tui/App.tsx
|
|
2285
2244
|
import { readFileSync as readFileSync3, existsSync as existsSync3 } from "fs";
|
|
2286
|
-
import { jsx as jsx13, jsxs as
|
|
2245
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2287
2246
|
function resolveEditor(configEditor) {
|
|
2288
2247
|
if (configEditor) return configEditor;
|
|
2289
2248
|
if (process.env.EDITOR) return process.env.EDITOR;
|
|
@@ -2295,17 +2254,17 @@ function App({ cwd: cwd2 }) {
|
|
|
2295
2254
|
const rows = stdout.rows || 24;
|
|
2296
2255
|
const cols = stdout.columns || 80;
|
|
2297
2256
|
const config = loadConfig(cwd2);
|
|
2298
|
-
const [cursorIndex, setCursorIndex] =
|
|
2299
|
-
const [expanded, setExpanded] =
|
|
2300
|
-
const [mode, setMode] =
|
|
2301
|
-
const [notification, setNotification] =
|
|
2302
|
-
const [selectedSessionId, setSelectedSessionId] =
|
|
2303
|
-
const [detailScrollOffset, setDetailScrollOffset] =
|
|
2304
|
-
const [logsScrollOffset, setLogsScrollOffset] =
|
|
2305
|
-
const [showLogs, setShowLogs] =
|
|
2306
|
-
const [focusPane, setFocusPane] =
|
|
2307
|
-
const [searchFilter, setSearchFilter] =
|
|
2308
|
-
const [targetAgentId, setTargetAgentId] =
|
|
2257
|
+
const [cursorIndex, setCursorIndex] = useState3(0);
|
|
2258
|
+
const [expanded, setExpanded] = useState3(/* @__PURE__ */ new Set());
|
|
2259
|
+
const [mode, setMode] = useState3("navigate");
|
|
2260
|
+
const [notification, setNotification] = useState3(null);
|
|
2261
|
+
const [selectedSessionId, setSelectedSessionId] = useState3(null);
|
|
2262
|
+
const [detailScrollOffset, setDetailScrollOffset] = useState3(0);
|
|
2263
|
+
const [logsScrollOffset, setLogsScrollOffset] = useState3(0);
|
|
2264
|
+
const [showLogs, setShowLogs] = useState3(false);
|
|
2265
|
+
const [focusPane, setFocusPane] = useState3("tree");
|
|
2266
|
+
const [searchFilter, setSearchFilter] = useState3(null);
|
|
2267
|
+
const [targetAgentId, setTargetAgentId] = useState3(null);
|
|
2309
2268
|
const cursorNodeIdRef = useRef3(null);
|
|
2310
2269
|
const prevNodesRef = useRef3([]);
|
|
2311
2270
|
const { sessions, selectedSession, planContent, goalContent, logsContent, logsCycles, paneAlive, contextFiles, error } = usePolling(cwd2, selectedSessionId);
|
|
@@ -2458,6 +2417,15 @@ function App({ cwd: cwd2 }) {
|
|
|
2458
2417
|
const detailWidth = showLogs ? Math.floor(remainingWidth * 0.6) : remainingWidth;
|
|
2459
2418
|
const logsWidth = showLogs ? remainingWidth - detailWidth : 0;
|
|
2460
2419
|
const contentHeight = rows - 3;
|
|
2420
|
+
const expandSessionLatestCycle = (node) => {
|
|
2421
|
+
if (node.type === "session" && selectedSession?.id === node.sessionId) {
|
|
2422
|
+
const cycles = selectedSession.orchestratorCycles;
|
|
2423
|
+
if (cycles.length > 0) {
|
|
2424
|
+
const latest = cycles[cycles.length - 1];
|
|
2425
|
+
expandNode(`cycle:${node.sessionId}:${latest.cycle}`);
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
};
|
|
2461
2429
|
useKeybindings(
|
|
2462
2430
|
{
|
|
2463
2431
|
onMoveUp: () => {
|
|
@@ -2501,13 +2469,7 @@ function App({ cwd: cwd2 }) {
|
|
|
2501
2469
|
if (!node) return;
|
|
2502
2470
|
if (node.expandable && !node.expanded) {
|
|
2503
2471
|
expandNode(node.id);
|
|
2504
|
-
|
|
2505
|
-
const cycles = selectedSession.orchestratorCycles;
|
|
2506
|
-
if (cycles.length > 0) {
|
|
2507
|
-
const latest = cycles[cycles.length - 1];
|
|
2508
|
-
expandNode(`cycle:${node.sessionId}:${latest.cycle}`);
|
|
2509
|
-
}
|
|
2510
|
-
}
|
|
2472
|
+
expandSessionLatestCycle(node);
|
|
2511
2473
|
} else if (node.expandable && node.expanded) {
|
|
2512
2474
|
if (cursorIndex + 1 < nodes.length && nodes[cursorIndex + 1].depth > node.depth) {
|
|
2513
2475
|
setCursorIndex(cursorIndex + 1);
|
|
@@ -2538,13 +2500,7 @@ function App({ cwd: cwd2 }) {
|
|
|
2538
2500
|
if (!node) return;
|
|
2539
2501
|
if (node.expandable && !node.expanded) {
|
|
2540
2502
|
expandNode(node.id);
|
|
2541
|
-
|
|
2542
|
-
const cycles = selectedSession.orchestratorCycles;
|
|
2543
|
-
if (cycles.length > 0) {
|
|
2544
|
-
const latest = cycles[cycles.length - 1];
|
|
2545
|
-
expandNode(`cycle:${node.sessionId}:${latest.cycle}`);
|
|
2546
|
-
}
|
|
2547
|
-
}
|
|
2503
|
+
expandSessionLatestCycle(node);
|
|
2548
2504
|
} else if (node.type === "report") {
|
|
2549
2505
|
setMode("report-detail");
|
|
2550
2506
|
} else if (node.type === "context-file") {
|
|
@@ -2715,6 +2671,23 @@ function App({ cwd: cwd2 }) {
|
|
|
2715
2671
|
},
|
|
2716
2672
|
mode === "navigate"
|
|
2717
2673
|
);
|
|
2674
|
+
useInput4(
|
|
2675
|
+
(input, key) => {
|
|
2676
|
+
if (key.escape || key.return) {
|
|
2677
|
+
handleCancel();
|
|
2678
|
+
return;
|
|
2679
|
+
}
|
|
2680
|
+
if (key.upArrow) {
|
|
2681
|
+
setDetailScrollOffset((o) => Math.max(0, o - 1));
|
|
2682
|
+
return;
|
|
2683
|
+
}
|
|
2684
|
+
if (key.downArrow) {
|
|
2685
|
+
setDetailScrollOffset((o) => o + 1);
|
|
2686
|
+
return;
|
|
2687
|
+
}
|
|
2688
|
+
},
|
|
2689
|
+
{ isActive: mode === "report-detail" }
|
|
2690
|
+
);
|
|
2718
2691
|
useLeaderKey(mode, (action) => {
|
|
2719
2692
|
switch (action.type) {
|
|
2720
2693
|
case "enter-copy-menu":
|
|
@@ -3048,7 +3021,8 @@ function App({ cwd: cwd2 }) {
|
|
|
3048
3021
|
reportBlocks,
|
|
3049
3022
|
width: detailWidth2,
|
|
3050
3023
|
height: contentHeight2,
|
|
3051
|
-
|
|
3024
|
+
scrollOffset: detailScrollOffset,
|
|
3025
|
+
focused: true
|
|
3052
3026
|
}
|
|
3053
3027
|
);
|
|
3054
3028
|
}
|
|
@@ -3165,10 +3139,9 @@ function App({ cwd: cwd2 }) {
|
|
|
3165
3139
|
return originalIdx === reportIdx;
|
|
3166
3140
|
});
|
|
3167
3141
|
if (specificBlock) {
|
|
3168
|
-
const badge = specificBlock.type
|
|
3169
|
-
const badgeColor = specificBlock.type === "final" ? "cyan" : "yellow";
|
|
3142
|
+
const { label: badge, color: badgeColor } = reportBadge(specificBlock.type);
|
|
3170
3143
|
const reportContentLines = [
|
|
3171
|
-
[seg(" "), seg(badge, { color: badgeColor }), seg(` ${agent.id} \xB7 ${agent
|
|
3144
|
+
[seg(" "), seg(badge, { color: badgeColor }), seg(` ${agent.id} \xB7 ${agentDisplayName(agent)}`, { bold: true })],
|
|
3172
3145
|
singleLine(` ${formatTime(specificBlock.timestamp)}`, { dim: true }),
|
|
3173
3146
|
singleLine(" "),
|
|
3174
3147
|
[seg(" \u258E CONTENT", { color: badgeColor, bold: true })],
|
|
@@ -3207,8 +3180,9 @@ function App({ cwd: cwd2 }) {
|
|
|
3207
3180
|
} else {
|
|
3208
3181
|
for (const msg of session.messages) {
|
|
3209
3182
|
const time = formatTime(msg.timestamp);
|
|
3210
|
-
const
|
|
3211
|
-
const
|
|
3183
|
+
const agentId = msg.source.type === "agent" ? msg.source.agentId : void 0;
|
|
3184
|
+
const label = messageSourceLabel(msg.source.type, agentId);
|
|
3185
|
+
const labelColor = messageSourceColor(msg.source.type);
|
|
3212
3186
|
const maxContent = Math.max(10, detailWidth2 - label.length - 20);
|
|
3213
3187
|
msgsLines.push([
|
|
3214
3188
|
seg(` [${time}] `, { dim: true }),
|
|
@@ -3282,7 +3256,7 @@ function App({ cwd: cwd2 }) {
|
|
|
3282
3256
|
if (contextFileContent == null) {
|
|
3283
3257
|
ctxFileLines.push(singleLine(" File not found or unreadable.", { dim: true }));
|
|
3284
3258
|
} else {
|
|
3285
|
-
const wrapped = wrapText(
|
|
3259
|
+
const wrapped = wrapText(stripFrontmatter(contextFileContent), detailWidth2 - 8);
|
|
3286
3260
|
if (wrapped.length === 0) {
|
|
3287
3261
|
ctxFileLines.push(singleLine(" (empty)", { dim: true }));
|
|
3288
3262
|
} else {
|
|
@@ -3322,20 +3296,20 @@ function App({ cwd: cwd2 }) {
|
|
|
3322
3296
|
[cursorNode, session, planContent, goalContent, logsContent, paneAlive, agents, mode, reportAgent, reportBlocks, detailReportBlocks, handleCancel, detailScrollOffset, focusPane, contextFiles, contextFileContent]
|
|
3323
3297
|
);
|
|
3324
3298
|
if (cols < 60 || rows < 12) {
|
|
3325
|
-
return /* @__PURE__ */
|
|
3326
|
-
/* @__PURE__ */ jsx13(
|
|
3327
|
-
/* @__PURE__ */
|
|
3299
|
+
return /* @__PURE__ */ jsxs7(Box10, { flexDirection: "column", width: cols, height: rows, justifyContent: "center", alignItems: "center", children: [
|
|
3300
|
+
/* @__PURE__ */ jsx13(Text10, { color: "yellow", bold: true, children: "Terminal too small" }),
|
|
3301
|
+
/* @__PURE__ */ jsxs7(Text10, { dimColor: true, children: [
|
|
3328
3302
|
"Minimum: 60\xD712 (current: ",
|
|
3329
3303
|
cols,
|
|
3330
3304
|
"\xD7",
|
|
3331
3305
|
rows,
|
|
3332
3306
|
")"
|
|
3333
3307
|
] }),
|
|
3334
|
-
/* @__PURE__ */ jsx13(
|
|
3308
|
+
/* @__PURE__ */ jsx13(Text10, { dimColor: true, children: "Resize your terminal and try again." })
|
|
3335
3309
|
] });
|
|
3336
3310
|
}
|
|
3337
|
-
return /* @__PURE__ */
|
|
3338
|
-
/* @__PURE__ */
|
|
3311
|
+
return /* @__PURE__ */ jsxs7(Box10, { flexDirection: "column", width: cols, height: rows, children: [
|
|
3312
|
+
/* @__PURE__ */ jsxs7(Box10, { flexDirection: "row", height: contentHeight, children: [
|
|
3339
3313
|
/* @__PURE__ */ jsx13(
|
|
3340
3314
|
SessionTree,
|
|
3341
3315
|
{
|
|
@@ -3358,8 +3332,8 @@ function App({ cwd: cwd2 }) {
|
|
|
3358
3332
|
}
|
|
3359
3333
|
)
|
|
3360
3334
|
] }),
|
|
3361
|
-
notification && /* @__PURE__ */ jsx13(
|
|
3362
|
-
error && !notification && /* @__PURE__ */ jsx13(
|
|
3335
|
+
notification && /* @__PURE__ */ jsx13(Box10, { paddingX: 1, children: /* @__PURE__ */ jsx13(Text10, { color: "yellow", bold: true, children: /error|failed/i.test(notification) ? `\u2715 ${notification}` : /success|created|killed|sent|copied|deleted/i.test(notification) ? `\u2713 ${notification}` : `\u2139 ${notification}` }) }),
|
|
3336
|
+
error && !notification && /* @__PURE__ */ jsx13(Box10, { paddingX: 1, children: /* @__PURE__ */ jsxs7(Text10, { color: "red", children: [
|
|
3363
3337
|
"\u26A0 ",
|
|
3364
3338
|
error
|
|
3365
3339
|
] }) }),
|