Re-export Type from typebox, update examples to import from pi-coding-agent
This commit is contained in:
@@ -7,7 +7,7 @@ Custom tools extend pi with new capabilities beyond the built-in read/write/edit
|
||||
Create a file `~/.pi/agent/tools/hello.ts`:
|
||||
|
||||
```typescript
|
||||
import { Type } from "@sinclair/typebox";
|
||||
import { Type } from "@mariozechner/pi-coding-agent";
|
||||
import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
const factory: CustomToolFactory = (pi) => ({
|
||||
@@ -47,7 +47,7 @@ The tool is automatically discovered and available in your next pi session.
|
||||
## Tool Definition
|
||||
|
||||
```typescript
|
||||
import { Type } from "@sinclair/typebox";
|
||||
import { Type } from "@mariozechner/pi-coding-agent";
|
||||
import { StringEnum } from "@mariozechner/pi-ai";
|
||||
import { Text } from "@mariozechner/pi-tui";
|
||||
import type { CustomToolFactory, ToolSessionEvent } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
@@ -43,7 +43,7 @@ See [docs/custom-tools.md](../../docs/custom-tools.md) for full documentation.
|
||||
|
||||
**Factory pattern:**
|
||||
```typescript
|
||||
import { Type } from "@sinclair/typebox";
|
||||
import { Type } from "@mariozechner/pi-coding-agent";
|
||||
import { StringEnum } from "@mariozechner/pi-ai";
|
||||
import { Text } from "@mariozechner/pi-tui";
|
||||
import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Type } from "@sinclair/typebox";
|
||||
import { Type } from "@mariozechner/pi-coding-agent";
|
||||
import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
const factory: CustomToolFactory = (pi) => ({
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Question Tool - Let the LLM ask the user a question with options
|
||||
*/
|
||||
|
||||
import { Type } from "@sinclair/typebox";
|
||||
import { Type } from "@mariozechner/pi-coding-agent";
|
||||
import { Text } from "@mariozechner/pi-tui";
|
||||
import type { CustomAgentTool, CustomToolFactory } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* The onSession callback reconstructs state by scanning past tool results.
|
||||
*/
|
||||
|
||||
import { Type } from "@sinclair/typebox";
|
||||
import { Type } from "@mariozechner/pi-coding-agent";
|
||||
import { StringEnum } from "@mariozechner/pi-ai";
|
||||
import { Text } from "@mariozechner/pi-tui";
|
||||
import type { CustomAgentTool, CustomToolFactory, ToolSessionEvent } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// Core session management
|
||||
|
||||
// Re-export Type from typebox for custom tools
|
||||
export { Type } from "@sinclair/typebox";
|
||||
export {
|
||||
AgentSession,
|
||||
type AgentSessionConfig,
|
||||
@@ -86,7 +89,6 @@ export {
|
||||
type Skill,
|
||||
type SkillFrontmatter,
|
||||
} from "./core/skills.js";
|
||||
|
||||
// Tools
|
||||
export { bashTool, codingTools, editTool, readTool, writeTool } from "./core/tools/index.js";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user