Fix TUI performance regression: add caching to Box, use Text directly for built-in tools

This commit is contained in:
Mario Zechner 2025-12-17 16:39:23 +01:00
parent 48b481eb85
commit 909989066a
13 changed files with 173 additions and 99 deletions

View file

@ -43,7 +43,7 @@ See [docs/custom-tools.md](../../docs/custom-tools.md) for full documentation.
**Factory pattern:**
```typescript
import { Type } from "@mariozechner/pi-coding-agent";
import { Type } from "@sinclair/typebox";
import { StringEnum } from "@mariozechner/pi-ai";
import { Text } from "@mariozechner/pi-tui";
import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";

View file

@ -1,4 +1,4 @@
import { Type } from "@mariozechner/pi-coding-agent";
import { Type } from "@sinclair/typebox";
import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";
const factory: CustomToolFactory = (pi) => ({

View file

@ -2,7 +2,7 @@
* Question Tool - Let the LLM ask the user a question with options
*/
import { Type } from "@mariozechner/pi-coding-agent";
import { Type } from "@sinclair/typebox";
import { Text } from "@mariozechner/pi-tui";
import type { CustomAgentTool, CustomToolFactory } from "@mariozechner/pi-coding-agent";

View file

@ -8,7 +8,7 @@
* The onSession callback reconstructs state by scanning past tool results.
*/
import { Type } from "@mariozechner/pi-coding-agent";
import { Type } from "@sinclair/typebox";
import { StringEnum } from "@mariozechner/pi-ai";
import { Text } from "@mariozechner/pi-tui";
import type { CustomAgentTool, CustomToolFactory, ToolSessionEvent } from "@mariozechner/pi-coding-agent";