@agentick/tui 0.11.1 → 0.11.2

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/README.md CHANGED
@@ -154,6 +154,7 @@ All components are exported for building custom UIs.
154
154
  | `MessageList` | Prop-driven message display (Static + in-progress) |
155
155
  | `StreamingMessage` | Live streaming response with cursor |
156
156
  | `ToolCallIndicator` | Spinner during tool execution |
157
+ | `SessionTree` | Tree view of spawned agents with per-agent activity |
157
158
  | `ToolConfirmationPrompt` | Y/N/A prompt for tools with `requireConfirmation` |
158
159
  | `DiffView` | Side-by-side diff display for file changes |
159
160
  | `ErrorDisplay` | Error box with optional dismiss |
@@ -215,6 +216,31 @@ The `editor` property exposes the raw `LineEditor` instance for registering comp
215
216
 
216
217
  For framework-agnostic usage (web, Angular), use `LineEditor` from `@agentick/client` directly, or `useLineEditor` from `@agentick/react`.
217
218
 
219
+ ### SessionTree
220
+
221
+ Tree view of spawned agents. Subscribes to the root session's events and routes tool activity to the correct spawn via `spawnPath`. Shows a compact tree with box-drawing characters, per-agent tool counts, and current tool activity.
222
+
223
+ ```typescript
224
+ import { SessionTree } from "@agentick/tui";
225
+
226
+ <SessionTree sessionId={sessionId} />
227
+ ```
228
+
229
+ Automatically hides when no spawns exist. Completed spawns remain visible for 3 seconds, then the tree clears. Pair with `ToolCallIndicator` — SessionTree shows the spawn graph, ToolCallIndicator shows the root session's tools.
230
+
231
+ ### useSessionTree
232
+
233
+ Hook that builds a `SessionTreeState` from stream events. Single subscription to the root session — child events are routed via `spawnPath[0]`.
234
+
235
+ ```typescript
236
+ import { useSessionTree } from "@agentick/tui";
237
+
238
+ const tree = useSessionTree(sessionId);
239
+ // tree.spawns — SessionTreeNode[] with status, currentTool, toolCount
240
+ // tree.hasActive — whether any spawn is still running
241
+ // tree.rootTool — current tool on the root session
242
+ ```
243
+
218
244
  ### CompletionPicker
219
245
 
220
246
  Renders a windowed completion list from `CompletionState`. Emerald-themed border, inverse highlight for the selected item, loading spinner, and "No matches" empty state.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * SessionTree — compact tree view of the spawn session graph.
3
+ *
4
+ * Shows each spawned agent with its current tool activity, tool count,
5
+ * and completion status. The root session's tools are NOT shown here —
6
+ * ToolCallIndicator handles those. This component is for the spawn graph.
7
+ */
8
+ export interface SessionTreeProps {
9
+ sessionId?: string;
10
+ }
11
+ export declare function SessionTree({ sessionId }: SessionTreeProps): import("react/jsx-runtime").JSX.Element | null;
12
+ //# sourceMappingURL=SessionTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SessionTree.d.ts","sourceRoot":"","sources":["../../src/components/SessionTree.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA0CD,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,gBAAgB,kDAmB1D"}
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * SessionTree — compact tree view of the spawn session graph.
4
+ *
5
+ * Shows each spawned agent with its current tool activity, tool count,
6
+ * and completion status. The root session's tools are NOT shown here —
7
+ * ToolCallIndicator handles those. This component is for the spawn graph.
8
+ */
9
+ import { Box, Text } from "ink";
10
+ import Spinner from "ink-spinner";
11
+ import { useSessionTree } from "../hooks/use-session-tree.js";
12
+ import { formatDuration } from "../rendering/index.js";
13
+ function SpawnLine({ node, isLast }) {
14
+ const prefix = isLast ? "└─" : "├─";
15
+ const leafPrefix = isLast ? " └─ " : "│ └─ ";
16
+ const isRunning = node.status === "running";
17
+ const isDone = node.status === "done";
18
+ const labelColor = isRunning ? "cyan" : node.status === "error" ? "red" : "gray";
19
+ const toolCountText = node.toolCount > 0 ? ` · ${node.toolCount} tool${node.toolCount === 1 ? "" : "s"}` : "";
20
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", gap: 1, children: [_jsx(Text, { dimColor: true, children: prefix }), isRunning ? (_jsx(Text, { color: "cyan", children: _jsx(Spinner, { type: "dots" }) })) : isDone ? (_jsx(Text, { color: "green", children: "\u2713" })) : (_jsx(Text, { color: "red", children: "\u2717" })), _jsxs(Text, { color: labelColor, dimColor: !isRunning, children: [node.label, toolCountText] }), node.duration !== undefined && _jsx(Text, { dimColor: true, children: formatDuration(node.duration) })] }), isRunning && node.currentTool && (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: leafPrefix }), _jsx(Text, { color: "cyan", children: node.currentTool.summary ?? node.currentTool.name })] }))] }));
21
+ }
22
+ export function SessionTree({ sessionId }) {
23
+ const tree = useSessionTree(sessionId);
24
+ if (tree.spawns.length === 0)
25
+ return null;
26
+ const activeCount = tree.spawns.filter((s) => s.status === "running").length;
27
+ return (_jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [activeCount > 0 && (_jsxs(Text, { color: "cyan", bold: true, children: ["Running ", activeCount, " agent", activeCount === 1 ? "" : "s", "..."] })), tree.spawns.map((node, i) => (_jsx(SpawnLine, { node: node, isLast: i === tree.spawns.length - 1 }, node.spawnId)))] }));
28
+ }
29
+ //# sourceMappingURL=SessionTree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SessionTree.js","sourceRoot":"","sources":["../../src/components/SessionTree.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMvD,SAAS,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,EAA8C;IAC7E,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACpC,MAAM,UAA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ive tree of session nodes from stream events.
3
+ *
4
+ * Subscribes to the root session's event stream. Child session events
5
+ * arrive with `spawnPath` — the first element identifies the spawn.
6
+ * Events without `spawnPath` belong to the root session.
7
+ */
8
+ export interface SessionTreeNode {
9
+ spawnId: string;
10
+ label: string;
11
+ status: "running" | "done" | "error";
12
+ currentTool?: {
13
+ callId: string;
14
+ name: string;
15
+ summary?: string;
16
+ };
17
+ toolCount: number;
18
+ startedAt: number;
19
+ duration?: number;
20
+ }
21
+ export interface SessionTreeState {
22
+ /** Current tool activity on the root session (no spawnPath) */
23
+ rootTool?: {
24
+ callId: string;
25
+ name: string;
26
+ summary?: string;
27
+ };
28
+ rootToolCount: number;
29
+ /** Spawned child agents */
30
+ spawns: SessionTreeNode[];
31
+ /** Whether any spawn is still running */
32
+ hasActive: boolean;
33
+ }
34
+ export declare function useSessionTree(sessionId?: string): SessionTreeState;
35
+ //# sourceMappingURL=use-session-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-session-tree.d.ts","sourceRoot":"","sources":["../../src/hooks/use-session-tree.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IACrC,WAAW,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,aAAa,EAAE,MAAM,CAAC;IACtB,2BAA2B;IAC3B,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,yCAAyC;IACzC,SAAS,EAAE,OAAO,CAAC;CACpB;AASD,wBAAgB,cAAc,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAuHnE"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * useSessionTree — builds a reactive tree of session nodes from stream events.
3
+ *
4
+ * Subscribes to the root session's event stream. Child session events
5
+ * arrive with `spawnPath` — the first element identifies the spawn.
6
+ * Events without `spawnPath` belong to the root session.
7
+ */
8
+ import { useState, useEffect } from "react";
9
+ import { useEvents } from "@agentick/react";
10
+ const EMPTY_TREE = {
11
+ rootTool: undefined,
12
+ rootToolCount: 0,
13
+ spawns: [],
14
+ hasActive: false,
15
+ };
16
+ export function useSessionTree(sessionId) {
17
+ const [tree, setTree] = useState(EMPTY_TREE);
18
+ const { events } = useEvents({
19
+ sessionId,
20
+ filter: ["spawn_start", "spawn_end", "tool_call_start", "tool_call", "tool_result"],
21
+ });
22
+ useEffect(() => {
23
+ if (events.length === 0)
24
+ return;
25
+ setTree((prev) => {
26
+ let next = prev;
27
+ for (const event of events) {
28
+ // Route: events with spawnPath belong to a child spawn,
29
+ // events without belong to the root session.
30
+ const spawnId = event.spawnPath?.[0];
31
+ if (event.type === "spawn_start") {
32
+ const e = event;
33
+ if (next.spawns.find((s) => s.spawnId === e.spawnId))
34
+ continue;
35
+ const node = {
36
+ spawnId: e.spawnId,
37
+ label: e.label ?? e.componentName ?? "agent",
38
+ status: "running",
39
+ toolCount: 0,
40
+ startedAt: Date.now(),
41
+ };
42
+ next = {
43
+ ...next,
44
+ spawns: [...next.spawns, node],
45
+ hasActive: true,
46
+ };
47
+ continue;
48
+ }
49
+ if (event.type === "spawn_end") {
50
+ const e = event;
51
+ const updated = next.spawns.map((s) => s.spawnId === e.spawnId
52
+ ? {
53
+ ...s,
54
+ status: (e.isError ? "error" : "done"),
55
+ duration: Date.now() - s.startedAt,
56
+ currentTool: undefined,
57
+ }
58
+ : s);
59
+ next = {
60
+ ...next,
61
+ spawns: updated,
62
+ hasActive: updated.some((s) => s.status === "running"),
63
+ };
64
+ continue;
65
+ }
66
+ if (event.type === "tool_call_start" || event.type === "tool_call") {
67
+ const e = event;
68
+ const callId = e.callId ?? "unknown";
69
+ const name = e.name ?? "tool";
70
+ const summary = event.type === "tool_call" ? e.summary : undefined;
71
+ const tool = { callId, name, summary };
72
+ if (!spawnId) {
73
+ next = { ...next, rootTool: tool };
74
+ }
75
+ else {
76
+ next = {
77
+ ...next,
78
+ spawns: next.spawns.map((s) => s.spawnId === spawnId ? { ...s, currentTool: tool } : s),
79
+ };
80
+ }
81
+ continue;
82
+ }
83
+ if (event.type === "tool_result") {
84
+ const e = event;
85
+ const callId = e.callId ?? "unknown";
86
+ if (!spawnId) {
87
+ next = {
88
+ ...next,
89
+ rootTool: next.rootTool?.callId === callId ? undefined : next.rootTool,
90
+ rootToolCount: next.rootToolCount + 1,
91
+ };
92
+ }
93
+ else {
94
+ next = {
95
+ ...next,
96
+ spawns: next.spawns.map((s) => s.spawnId === spawnId
97
+ ? {
98
+ ...s,
99
+ toolCount: s.toolCount + 1,
100
+ currentTool: s.currentTool?.callId === callId ? undefined : s.currentTool,
101
+ }
102
+ : s),
103
+ };
104
+ }
105
+ continue;
106
+ }
107
+ }
108
+ return next;
109
+ });
110
+ }, [events]);
111
+ // Clear completed spawns after all finish — same pattern as SpawnIndicator
112
+ useEffect(() => {
113
+ const allDone = tree.spawns.length > 0 && !tree.hasActive;
114
+ if (allDone) {
115
+ const timer = setTimeout(() => setTree(EMPTY_TREE), 3000);
116
+ return () => clearTimeout(timer);
117
+ }
118
+ }, [tree.hasActive, tree.spawns.length]);
119
+ return tree;
120
+ }
121
+ //# sourceMappingURL=use-session-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-session-tree.js","sourceRoot":"","sources":["../../src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,CAC5B,CAAC,CAAC,OAAO,KAAK,OAAO;gCACnB,CAAC,CAAC;oCACE,GAAG,CAAC;oCACJ,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC;oCAC1B,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW;iCAC1E;gCACH,CAAC,CAAC,CAAC,CACN;yBACF,CAAC;oBACJ,CAAC;oBACD,SAAS;gBACX,CAAC;YACH,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,2EAA2E;IAC3E,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1D,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,CAAC;YAC1D,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAEzC,OAAO,IAAI,CAAC;AACd,CAAC"}
package/dist/index.d.ts CHANGED
@@ -36,6 +36,8 @@ export { MessageList } from "./components/MessageList.js";
36
36
  export { StreamingMessage } from "./components/StreamingMessage.js";
37
37
  export { ToolCallIndicator } from "./components/ToolCallIndicator.js";
38
38
  export { SpawnIndicator } from "./components/SpawnIndicator.js";
39
+ export { SessionTree } from "./components/SessionTree.js";
40
+ export { useSessionTree, type SessionTreeState, type SessionTreeNode, } from "./hooks/use-session-tree.js";
39
41
  export { ToolConfirmationPrompt } from "./components/ToolConfirmationPrompt.js";
40
42
  export { DiffView } from "./components/DiffView.js";
41
43
  export { ErrorDisplay, type ErrorDisplayProps } from "./components/ErrorDisplay.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGhF,OAAO,EAAE,IAAI,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,aAAa,CAA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ACzB,KAAK,YAAY,GAClB,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -38,6 +38,8 @@ export { MessageList } from "./components/MessageList.js";
38
38
  export { StreamingMessage } from "./components/StreamingMessage.js";
39
39
  export { ToolCallIndicator } from "./components/ToolCallIndicator.js";
40
40
  export { SpawnIndicator } from "./components/SpawnIndicator.js";
41
+ export { SessionTree } from "./components/SessionTree.js";
42
+ export { useSessionTree, } from "./hooks/use-session-tree.js";
41
43
  export { ToolConfirmationPrompt } from "./components/ToolConfirmationPrompt.js";
42
44
  export { DiffView } from "./components/DiffView.js";
43
45
  export { ErrorDisplay } from "./components/ErrorDisplay.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,SAAS,EAAsC,MAAM,iBAAiB,CAAC;AAEhF,eAAe;AACf,OAAO,EAAE,IAAI,EAA2B,MAAM,cAAc,CAAC;AAE7D,uCAAuC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,YAAY,EAA0B,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAsB,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAA8B,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,aAAa,E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2
  "name": "@agentick/tui",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "Terminal UI for Agentick agents using Ink",
5
5
  "keywords": [
6
6
  "agent",
@@ -42,10 +42,10 @@
42
42
  "marked": "^15.0.12",
43
43
  "marked-terminal": "^7.3.0",
44
44
  "react": "^19.0.0",
45
- "@agentick/client": "0.11.1",
46
- "@agentick/core": "0.11.1",
47
- "@agentick/react": "0.11.1",
48
- "@agentick/shared": "0.11.1"
45
+ "@agentick/client": "0.11.2",
46
+ "@agentick/core": "0.11.2",
47
+ "@agentick/react": "0.11.2",
48
+ "@agentick/shared": "0.11.2"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@testing-library/react": "^16.3.2",