@wrongstack/tui 0.24.0 → 0.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +40 -15
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -554,11 +554,12 @@ function FleetMonitor({
|
|
|
554
554
|
events.push({ at: e.startedAt, icon: "\u25CF", color: "cyan", text: `${e.name} spawned` });
|
|
555
555
|
if (e.status !== "running" && e.status !== "idle") {
|
|
556
556
|
const s2 = STATUS[e.status];
|
|
557
|
+
const reason = e.failureReason ? ` [${e.failureReason}]` : "";
|
|
557
558
|
events.push({
|
|
558
559
|
at: e.lastEventAt,
|
|
559
560
|
icon: s2.icon,
|
|
560
561
|
color: s2.color,
|
|
561
|
-
text: `${e.name} ${e.status} (${e.toolCalls}t)`
|
|
562
|
+
text: `${e.name} ${e.status} (${e.toolCalls}t)${reason}`
|
|
562
563
|
});
|
|
563
564
|
}
|
|
564
565
|
if (e.budgetWarning) {
|
|
@@ -873,6 +874,10 @@ function AgentsMonitor({
|
|
|
873
874
|
e.budgetWarning.limit,
|
|
874
875
|
" \u2014 extending"
|
|
875
876
|
] }) }) : null,
|
|
877
|
+
e.failureReason && e.status !== "success" ? /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: /* @__PURE__ */ jsxs(Text, { color: "red", children: [
|
|
878
|
+
"\u2717 ",
|
|
879
|
+
e.failureReason
|
|
880
|
+
] }) }) : null,
|
|
876
881
|
e.ctxPct !== void 0 ? /* @__PURE__ */ jsxs(Box, { paddingLeft: 2, children: [
|
|
877
882
|
/* @__PURE__ */ jsx(Text, { dimColor: true, children: "ctx " }),
|
|
878
883
|
/* @__PURE__ */ jsx(ContextBar, { pct: e.ctxPct, tokens: e.ctxTokens, maxTokens: e.ctxMaxTokens })
|
|
@@ -1119,8 +1124,8 @@ function FleetPanel({
|
|
|
1119
1124
|
const costLabel = totalCost > 0 ? ` \xB7 ${totalCost.toFixed(3)}` : "";
|
|
1120
1125
|
const collabLabel = hasCollab && collabSession.sessionId ? ` \xB7 collab(${collabSession.bugCount}b/${collabSession.planCount}p/${collabSession.evalCount}e)` : "";
|
|
1121
1126
|
const summaryLine = runningCount > 0 ? `${runningCount} running${costLabel}${collabLabel}` : `idle${costLabel}${collabLabel}`;
|
|
1122
|
-
const shown = running.slice(0,
|
|
1123
|
-
const overflow = running.length >
|
|
1127
|
+
const shown = running.slice(0, 5);
|
|
1128
|
+
const overflow = running.length > 5 ? running.length - 5 : 0;
|
|
1124
1129
|
const leaderTool = hasCollab ? "waiting for agents" : leader?.currentTool?.name ?? (leader?.status === "running" ? "running" : "\u2014");
|
|
1125
1130
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 1, children: [
|
|
1126
1131
|
/* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, children: [
|
|
@@ -1144,13 +1149,17 @@ function FleetPanel({
|
|
|
1144
1149
|
/* @__PURE__ */ jsx(Text, { color: "cyan", children: tool })
|
|
1145
1150
|
] }, entry.id);
|
|
1146
1151
|
}),
|
|
1147
|
-
overflow > 0 ? /* @__PURE__ */ jsxs(
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1152
|
+
overflow > 0 ? /* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 1, children: [
|
|
1153
|
+
/* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
1154
|
+
"+",
|
|
1155
|
+
overflow,
|
|
1156
|
+
":"
|
|
1157
|
+
] }),
|
|
1158
|
+
running.slice(5, 7).map((e) => /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
1159
|
+
e.name?.split(" ")[0]?.slice(0, nameMaxLen - 2) ?? "agent",
|
|
1160
|
+
","
|
|
1161
|
+
] }, e.id)),
|
|
1162
|
+
/* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2026" })
|
|
1154
1163
|
] }) : null
|
|
1155
1164
|
] });
|
|
1156
1165
|
}
|
|
@@ -4794,10 +4803,24 @@ function reducer(state, action) {
|
|
|
4794
4803
|
return { ...state, fleet: seeded, fleetCost: action.cost };
|
|
4795
4804
|
}
|
|
4796
4805
|
case "fleetSpawn": {
|
|
4797
|
-
|
|
4806
|
+
const existing = state.fleet[action.id];
|
|
4807
|
+
const incomingName = action.name ?? action.id.slice(0, 8);
|
|
4808
|
+
const isPlaceholderName = (name) => name === "adhoc" || name === "subagent" || name === "generic" || name.startsWith("slot-") || name === action.id.slice(0, 8);
|
|
4809
|
+
if (existing) {
|
|
4810
|
+
if (isPlaceholderName(existing.name) && !isPlaceholderName(incomingName) && incomingName !== existing.name) {
|
|
4811
|
+
return {
|
|
4812
|
+
...state,
|
|
4813
|
+
fleet: {
|
|
4814
|
+
...state.fleet,
|
|
4815
|
+
[action.id]: { ...existing, name: incomingName }
|
|
4816
|
+
}
|
|
4817
|
+
};
|
|
4818
|
+
}
|
|
4819
|
+
return state;
|
|
4820
|
+
}
|
|
4798
4821
|
const entry = {
|
|
4799
4822
|
id: action.id,
|
|
4800
|
-
name:
|
|
4823
|
+
name: incomingName,
|
|
4801
4824
|
provider: action.provider,
|
|
4802
4825
|
model: action.model,
|
|
4803
4826
|
status: "idle",
|
|
@@ -4935,7 +4958,8 @@ function reducer(state, action) {
|
|
|
4935
4958
|
currentTool: void 0,
|
|
4936
4959
|
budgetWarning: void 0,
|
|
4937
4960
|
// clear on done/restart
|
|
4938
|
-
lastEventAt: Date.now()
|
|
4961
|
+
lastEventAt: Date.now(),
|
|
4962
|
+
failureReason: action.failureReason
|
|
4939
4963
|
}
|
|
4940
4964
|
}
|
|
4941
4965
|
};
|
|
@@ -6600,15 +6624,16 @@ function App({
|
|
|
6600
6624
|
});
|
|
6601
6625
|
const offCompleted = events.on("subagent.task_completed", (e) => {
|
|
6602
6626
|
const lbl = labelFor(e.subagentId);
|
|
6627
|
+
const errKind = e.error?.kind;
|
|
6603
6628
|
dispatch({
|
|
6604
6629
|
type: "fleetDone",
|
|
6605
6630
|
id: e.subagentId,
|
|
6606
6631
|
status: e.status,
|
|
6607
6632
|
iterations: e.iterations,
|
|
6608
|
-
toolCalls: e.toolCalls
|
|
6633
|
+
toolCalls: e.toolCalls,
|
|
6634
|
+
failureReason: errKind
|
|
6609
6635
|
});
|
|
6610
6636
|
const icon = e.status === "success" ? "\u2713" : e.status === "timeout" ? "\u23F1" : e.status === "stopped" ? "\u2298" : "\u2717";
|
|
6611
|
-
const errKind = e.error?.kind;
|
|
6612
6637
|
const errMsg = e.error?.message;
|
|
6613
6638
|
const errMsgTail = errMsg ? ` \u2014 ${errMsg.replace(/\s+/g, " ").slice(0, 100)}${errMsg.length > 100 ? "\u2026" : ""}` : "";
|
|
6614
6639
|
const errChip = errKind ? ` [${errKind}]` : "";
|