fix(coding-agent,tui): drop typebox compiler shim and fix progress

This commit is contained in:
Mario Zechner
2026-04-22 21:12:20 +02:00
parent 35ff2689ee
commit 3dacaa8ed9
18 changed files with 130 additions and 60 deletions

View File

@@ -57,7 +57,7 @@ Create `~/.pi/agent/extensions/my-extension.ts`:
```typescript
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
export default function (pi: ExtensionAPI) {
// React to events
@@ -139,7 +139,7 @@ To share extensions via npm or git as pi packages, see [packages.md](packages.md
| Package | Purpose |
|---------|---------|
| `@mariozechner/pi-coding-agent` | Extension types (`ExtensionAPI`, `ExtensionContext`, events) |
| `@sinclair/typebox` | Schema definitions for tool parameters |
| `typebox` | Schema definitions for tool parameters |
| `@mariozechner/pi-ai` | AI utilities (`StringEnum` for Google-compatible enums) |
| `@mariozechner/pi-tui` | TUI components for custom rendering |
@@ -1139,7 +1139,7 @@ Example tool the LLM can call to trigger reload:
```typescript
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
export default function (pi: ExtensionAPI) {
pi.registerCommand("reload-runtime", {
@@ -1186,7 +1186,7 @@ Use `promptSnippet` to opt a custom tool into a one-line entry in `Available too
See [dynamic-tools.ts](../examples/extensions/dynamic-tools.ts) for a full example.
```typescript
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
import { StringEnum } from "@mariozechner/pi-ai";
pi.registerTool({
@@ -1657,7 +1657,7 @@ async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
### Tool Definition
```typescript
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
import { StringEnum } from "@mariozechner/pi-ai";
import { Text } from "@mariozechner/pi-tui";

View File

@@ -158,7 +158,7 @@ If no `pi` manifest is present, pi auto-discovers resources from these directori
Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When pi installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
Pi bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@mariozechner/pi-ai`, `@mariozechner/pi-agent-core`, `@mariozechner/pi-coding-agent`, `@mariozechner/pi-tui`, `@sinclair/typebox`.
Pi bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@mariozechner/pi-ai`, `@mariozechner/pi-agent-core`, `@mariozechner/pi-coding-agent`, `@mariozechner/pi-tui`, `typebox`.
Other pi packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Pi loads packages with separate module roots, so separate installs do not collide or share modules.

View File

@@ -529,7 +529,7 @@ const { session } = await createAgentSession({
### Custom Tools
```typescript
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
import { createAgentSession, defineTool } from "@mariozechner/pi-coding-agent";
// Inline custom tool
@@ -882,7 +882,7 @@ interface LoadExtensionsResult {
```typescript
import { getModel } from "@mariozechner/pi-ai";
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
import {
AuthStorage,
bashTool,