@ai-sdk/tui 0.0.0-6b196531-20260710185421

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.
@@ -0,0 +1,71 @@
1
+ import { Agent, Experimental_SandboxSession } from 'ai';
2
+
3
+ /**
4
+ * Controls how terminal UI sections for stream parts are displayed.
5
+ *
6
+ * - `full`: show the section header and full content.
7
+ * - `collapsed`: show only the section header.
8
+ * - `auto-collapsed`: show the latest section expanded until another visible
9
+ * section appears, then collapse it.
10
+ * - `hidden`: omit the section entirely.
11
+ */
12
+ type TerminalPartDisplayMode = 'full' | 'collapsed' | 'auto-collapsed' | 'hidden';
13
+ /**
14
+ * Controls which response statistic is shown.
15
+ *
16
+ * - `outputTokenCount`: show the number of output tokens in the response.
17
+ * - `outputTokensPerSecond`: show output token throughput for the response.
18
+ */
19
+ type ResponseStatisticsMode = 'outputTokenCount' | 'outputTokensPerSecond';
20
+ /**
21
+ * An agent that is compatible with the terminal UI.
22
+ */
23
+ type AgentTUIAgent = Agent<any, any, any, any>;
24
+ /**
25
+ * Options for starting an agent in the default terminal UI.
26
+ */
27
+ type RunAgentTUIOptions = {
28
+ /**
29
+ * The agent to run.
30
+ */
31
+ agent: AgentTUIAgent;
32
+ /**
33
+ * The title shown in the terminal UI.
34
+ */
35
+ title?: string;
36
+ /**
37
+ * How tool calls should render.
38
+ *
39
+ * @default "auto-collapsed"
40
+ */
41
+ tools?: TerminalPartDisplayMode;
42
+ /**
43
+ * How reasoning parts should render.
44
+ *
45
+ * @default "auto-collapsed"
46
+ */
47
+ reasoning?: TerminalPartDisplayMode;
48
+ /**
49
+ * Which response statistic to show.
50
+ *
51
+ * @default "outputTokensPerSecond"
52
+ */
53
+ responseStatistics?: ResponseStatisticsMode;
54
+ /**
55
+ * The model context window size in tokens.
56
+ *
57
+ * When provided, the terminal UI shows the current total token usage as a
58
+ * percentage of this context window.
59
+ */
60
+ contextSize?: number;
61
+ /**
62
+ * Sandbox session that is passed through to agent tool execution.
63
+ */
64
+ sandbox?: Experimental_SandboxSession;
65
+ };
66
+ /**
67
+ * Runs an agent in the default terminal UI until the user exits.
68
+ */
69
+ declare function runAgentTUI(options: RunAgentTUIOptions): Promise<void>;
70
+
71
+ export { type AgentTUIAgent, type ResponseStatisticsMode, type RunAgentTUIOptions, type TerminalPartDisplayMode, runAgentTUI };