@townco/ui 0.1.125 → 0.1.127
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.
|
@@ -347,10 +347,16 @@ export function ChatView({ client, initialSessionId, error: initError, debuggerU
|
|
|
347
347
|
setEditingMessageIndex(isEditing ? index : null);
|
|
348
348
|
} })) : (_jsxs(_Fragment, { children: [
|
|
349
349
|
_jsx(MessageContent, { message: message, thinkingDisplayStyle: "collapsible" }), (() => {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
//
|
|
353
|
-
|
|
350
|
+
// "Last assistant message" for actions should mean the last
|
|
351
|
+
// assistant message that actually has text content.
|
|
352
|
+
// (Tool-only assistant messages exist and should not steal the
|
|
353
|
+
// action row from the last text response.)
|
|
354
|
+
const lastTextAssistantIndex = messages.findLastIndex((m) => m.role === "assistant" &&
|
|
355
|
+
Boolean(m.content?.trim()));
|
|
356
|
+
const isLastAssistantMessage = index === lastTextAssistantIndex;
|
|
357
|
+
// Only show MessageActions for the last assistant message,
|
|
358
|
+
// and never while it's streaming.
|
|
359
|
+
if (!isLastAssistantMessage ||
|
|
354
360
|
message.isStreaming) {
|
|
355
361
|
return null;
|
|
356
362
|
}
|
|
@@ -241,7 +241,7 @@ export function ToolOperation({ toolCalls, isGrouped = false, autoMinimize = tru
|
|
|
241
241
|
const displayText = getDisplayText();
|
|
242
242
|
// For preliminary/selecting states, show simple non-expandable text
|
|
243
243
|
if (isSelecting && !isGrouped) {
|
|
244
|
-
return (_jsx("div", { className: "flex flex-col rounded-md px-1 -mx-1 w-fit", children: _jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
244
|
+
return (_jsx("div", { className: "flex flex-col my-4 rounded-md px-1 -mx-1 w-fit", children: _jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
245
245
|
_jsx("div", { className: "text-text-secondary/70", children: _jsx(IconComponent, { className: "h-3 w-3" }) }), _jsxs("span", { className: "text-paragraph-xs text-text-muted", children: [displayText, singleToolCall?.startedAt && (_jsx(RunningDuration, { startTime: singleToolCall.startedAt, isRunning: !singleToolCall.subagentCompleted }))] })
|
|
246
246
|
] }) }));
|
|
247
247
|
}
|
|
@@ -258,14 +258,14 @@ export function ToolOperation({ toolCalls, isGrouped = false, autoMinimize = tru
|
|
|
258
258
|
})();
|
|
259
259
|
// Check if all tool calls in the group are completed
|
|
260
260
|
const allCompleted = toolCalls.every((tc) => tc.subagentCompleted);
|
|
261
|
-
return (_jsxs("div", { className: "flex flex-col rounded-md px-1 -mx-1 w-fit", children: [
|
|
261
|
+
return (_jsxs("div", { className: "flex flex-col my-4 rounded-md px-1 -mx-1 w-fit", children: [
|
|
262
262
|
_jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
263
263
|
_jsx("div", { className: "text-text-secondary/70", children: _jsx(ListVideo, { className: "h-3 w-3" }) }), _jsx("span", { className: "text-paragraph-sm text-text-secondary/70", children: "Selecting tools" }), selectingStartTime && (_jsx(RunningDuration, { startTime: selectingStartTime, isRunning: !allCompleted })), _jsx("span", { className: "text-[10px] bg-muted px-1.5 py-0.5 rounded text-text-secondary/70", children: toolCalls.length })
|
|
264
264
|
] }), _jsx("span", { className: "text-paragraph-sm text-text-secondary/70 pl-4.5", children: displayText })
|
|
265
265
|
] }));
|
|
266
266
|
}
|
|
267
267
|
// Full display (for single tool call or expanded group, includes minimized state)
|
|
268
|
-
return (_jsxs("div", { className: "flex flex-col", children: [
|
|
268
|
+
return (_jsxs("div", { className: "flex flex-col my-4", children: [
|
|
269
269
|
_jsxs("button", { type: "button", className: "flex flex-col items-start gap-0.5 cursor-pointer bg-transparent border-none p-0 text-left group w-fit rounded-md px-1 -mx-1", onClick: handleHeaderClick, "aria-expanded": isTodoWrite ? undefined : isExpanded, children: [
|
|
270
270
|
_jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
271
271
|
_jsx("div", { className: "text-text-secondary/70 group-hover:text-text-secondary transition-colors", children: _jsx(IconComponent, { className: "h-3 w-3" }) }), _jsxs("span", { className: "text-paragraph-sm text-text-secondary/70 group-hover:text-text-secondary transition-colors", children: [isGrouped && _jsx("span", { className: "mr-1", children: "Parallel operation" }), !isGrouped && displayText] }), isSubagentCall && (_jsx(ContextUsageIndicator, { contextSize: subagentHeaderContextSize, size: 12, className: "text-text-secondary/70 group-hover:text-text-secondary transition-colors" })), !isGrouped &&
|
|
@@ -331,7 +331,7 @@ export function ToolOperation({ toolCalls, isGrouped = false, autoMinimize = tru
|
|
|
331
331
|
return null;
|
|
332
332
|
})()] }), !isTodoWrite && isSubagentCall && singleToolCall && (_jsx("div", { className: "pl-4.5 mt-2", children: _jsx(SubAgentDetails, { parentStatus: singleToolCall.status, agentName: singleToolCall.rawInput?.agentName, query: singleToolCall.rawInput?.query, isExpanded: isSubagentExpanded, onExpandChange: setIsSubagentExpanded, storedMessages: singleToolCall.subagentMessages }) })), !isTodoWrite && isExpanded && (_jsx("div", { className: "mt-1", children: isGrouped ? (
|
|
333
333
|
// Render individual tool calls in group
|
|
334
|
-
_jsx("div", { className: "flex flex-col gap-
|
|
334
|
+
_jsx("div", { className: "flex flex-col gap-4 mt-2", children: toolCalls.map((toolCall) => {
|
|
335
335
|
const hookNotification = hookNotifications.find((n) => n.toolCallId === toolCall.id);
|
|
336
336
|
return (_jsx(GroupedToolCallItem, { toolCall: toolCall, ...(hookNotification ? { hookNotification } : {}) }, toolCall.id));
|
|
337
337
|
}) })) : (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@townco/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.127",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@radix-ui/react-slot": "^1.2.4",
|
|
50
50
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
51
51
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
52
|
-
"@townco/core": "0.0.
|
|
52
|
+
"@townco/core": "0.0.105",
|
|
53
53
|
"@types/mdast": "^4.0.4",
|
|
54
54
|
"@uiw/react-json-view": "^2.0.0-alpha.39",
|
|
55
55
|
"class-variance-authority": "^0.7.1",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"zustand": "^5.0.8"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@townco/tsconfig": "0.1.
|
|
70
|
+
"@townco/tsconfig": "0.1.124",
|
|
71
71
|
"@types/node": "^24.10.0",
|
|
72
72
|
"@types/react": "^19.2.2",
|
|
73
73
|
"@types/unist": "^3.0.3",
|