@townco/ui 0.1.71 → 0.1.72
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/gui/components/TodoList.js +1 -1
- package/dist/gui/components/TodoSubline.d.ts +11 -0
- package/dist/gui/components/TodoSubline.js +25 -0
- package/dist/gui/components/ToolOperation.js +4 -1
- package/dist/gui/components/index.d.ts +1 -0
- package/dist/gui/components/index.js +1 -0
- package/package.json +3 -3
|
@@ -16,6 +16,6 @@ export const TodoList = React.forwardRef(({ client, todos, className, ...props }
|
|
|
16
16
|
if (todosToDisplay.length === 0) {
|
|
17
17
|
return (_jsx("div", { ref: ref, className: cn("h-full", className), ...props, children: _jsx(TodoListEmptyState, {}) }));
|
|
18
18
|
}
|
|
19
|
-
return (_jsx("div", { ref: ref, className: cn("space-y-2
|
|
19
|
+
return (_jsx("div", { ref: ref, className: cn("space-y-2 overflow-y-auto", className), ...props, children: todosToDisplay.map((todo) => (_jsx(TodoListItem, { todo: todo }, todo.id))) }));
|
|
20
20
|
});
|
|
21
21
|
TodoList.displayName = "TodoList";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface TodoItem {
|
|
2
|
+
content: string;
|
|
3
|
+
status: "pending" | "in_progress" | "completed";
|
|
4
|
+
activeForm?: string;
|
|
5
|
+
}
|
|
6
|
+
interface TodoSublineProps {
|
|
7
|
+
todos: TodoItem[];
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function TodoSubline({ todos, className }: TodoSublineProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Circle, CircleCheck } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
export function TodoSubline({ todos, className }) {
|
|
6
|
+
if (!todos || todos.length === 0)
|
|
7
|
+
return null;
|
|
8
|
+
// Find the most important item to display
|
|
9
|
+
// Priority: in_progress > completed > first item
|
|
10
|
+
const displayItem = React.useMemo(() => {
|
|
11
|
+
const inProgress = todos.find((t) => t.status === "in_progress");
|
|
12
|
+
if (inProgress)
|
|
13
|
+
return inProgress;
|
|
14
|
+
const completed = todos.find((t) => t.status === "completed");
|
|
15
|
+
if (completed)
|
|
16
|
+
return completed;
|
|
17
|
+
return todos[0];
|
|
18
|
+
}, [todos]);
|
|
19
|
+
if (!displayItem)
|
|
20
|
+
return null;
|
|
21
|
+
const displayText = displayItem.status === "in_progress"
|
|
22
|
+
? displayItem.activeForm || displayItem.content
|
|
23
|
+
: displayItem.content;
|
|
24
|
+
return (_jsxs("span", { className: cn("flex items-center gap-1.5", className), children: [displayItem.status === "completed" ? (_jsx(CircleCheck, { className: "size-3 text-muted-foreground shrink-0" })) : displayItem.status === "in_progress" ? (_jsx("span", { className: "size-2 rounded-full bg-foreground animate-pulse-scale shrink-0" })) : (_jsx(Circle, { className: "size-3 text-foreground shrink-0" })), _jsx("span", { className: "truncate", children: displayText })] }));
|
|
25
|
+
}
|
|
@@ -10,6 +10,7 @@ import { cn } from "../lib/utils.js";
|
|
|
10
10
|
import * as ChatLayout from "./ChatLayout.js";
|
|
11
11
|
import { SubAgentDetails } from "./SubAgentDetails.js";
|
|
12
12
|
import { useTheme } from "./ThemeProvider.js";
|
|
13
|
+
import { TodoSubline } from "./TodoSubline.js";
|
|
13
14
|
/**
|
|
14
15
|
* Map of icon names to Lucide components
|
|
15
16
|
*/
|
|
@@ -188,7 +189,9 @@ export function ToolOperation({ toolCalls, isGrouped = false, autoMinimize = tru
|
|
|
188
189
|
}, transition: getTransition(shouldReduceMotion ?? false, {
|
|
189
190
|
duration: motionDuration.normal,
|
|
190
191
|
ease: motionEasing.smooth,
|
|
191
|
-
}), className: "h-3 w-3 text-text-secondary/70 group-hover:text-text-secondary transition-colors", children: _jsx(ChevronDown, { className: "h-3 w-3" }) }))] }), !isGrouped &&
|
|
192
|
+
}), className: "h-3 w-3 text-text-secondary/70 group-hover:text-text-secondary transition-colors", children: _jsx(ChevronDown, { className: "h-3 w-3" }) }))] }), !isGrouped &&
|
|
193
|
+
singleToolCall &&
|
|
194
|
+
(isTodoWrite && singleToolCall.rawInput?.todos ? (_jsx(TodoSubline, { todos: singleToolCall.rawInput.todos, className: "text-paragraph-sm text-text-secondary/70 pl-4.5" })) : singleToolCall.subline ? (_jsx("span", { className: "text-paragraph-sm text-text-secondary/70 pl-4.5", children: singleToolCall.subline })) : null), isGrouped && !isExpanded && (_jsx("span", { className: "text-paragraph-sm text-text-secondary/70 pl-4.5", children: displayText }))] }), !isTodoWrite && isSubagentCall && singleToolCall && (_jsx("div", { className: "pl-4.5 mt-2", children: _jsx(SubAgentDetails, { port: singleToolCall.subagentPort, sessionId: singleToolCall.subagentSessionId, parentStatus: singleToolCall.status, agentName: singleToolCall.rawInput?.agentName, query: singleToolCall.rawInput?.query, isExpanded: isSubagentExpanded, onExpandChange: setIsSubagentExpanded, storedMessages: singleToolCall.subagentMessages, isReplay: isReplaySubagent }) })), _jsx(AnimatePresence, { initial: false, children: !isTodoWrite && isExpanded && (_jsx(motion.div, { initial: "collapsed", animate: "expanded", exit: "collapsed", variants: expandCollapseVariants, transition: getTransition(shouldReduceMotion ?? false, {
|
|
192
195
|
duration: motionDuration.normal,
|
|
193
196
|
ease: motionEasing.smooth,
|
|
194
197
|
}), className: "mt-1", children: isGrouped ? (
|
|
@@ -49,6 +49,7 @@ export { ThemeToggle } from "./ThemeToggle.js";
|
|
|
49
49
|
export { ThinkingBlock, type ThinkingBlockProps, } from "./ThinkingBlock.js";
|
|
50
50
|
export { TodoList, type TodoListProps } from "./TodoList.js";
|
|
51
51
|
export { type TodoItem, TodoListItem, type TodoListItemProps, } from "./TodoListItem.js";
|
|
52
|
+
export { TodoSubline } from "./TodoSubline.js";
|
|
52
53
|
export { ToolCallList, type ToolCallListProps } from "./ToolCallList.js";
|
|
53
54
|
export { ToolOperation, type ToolOperationProps } from "./ToolOperation.js";
|
|
54
55
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./Tooltip.js";
|
|
@@ -57,6 +57,7 @@ export { ThemeToggle } from "./ThemeToggle.js";
|
|
|
57
57
|
export { ThinkingBlock, } from "./ThinkingBlock.js";
|
|
58
58
|
export { TodoList } from "./TodoList.js";
|
|
59
59
|
export { TodoListItem, } from "./TodoListItem.js";
|
|
60
|
+
export { TodoSubline } from "./TodoSubline.js";
|
|
60
61
|
export { ToolCallList } from "./ToolCallList.js";
|
|
61
62
|
export { ToolOperation } from "./ToolOperation.js";
|
|
62
63
|
// Tooltip components
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@townco/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.72",
|
|
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.50",
|
|
53
53
|
"@uiw/react-json-view": "^2.0.0-alpha.39",
|
|
54
54
|
"bun": "^1.3.1",
|
|
55
55
|
"class-variance-authority": "^0.7.1",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@tailwindcss/postcss": "^4.1.17",
|
|
70
|
-
"@townco/tsconfig": "0.1.
|
|
70
|
+
"@townco/tsconfig": "0.1.69",
|
|
71
71
|
"@types/node": "^24.10.0",
|
|
72
72
|
"@types/react": "^19.2.2",
|
|
73
73
|
"ink": "^6.4.0",
|