mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 04:02:35 +00:00
Update custom tools README for subdirectory/index.ts structure
This commit is contained in:
parent
a930eb8489
commit
48e792aa52
1 changed files with 11 additions and 8 deletions
|
|
@ -4,13 +4,15 @@ Example custom tools for pi-coding-agent.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### hello.ts
|
Each example uses the `subdirectory/index.ts` structure required for tool discovery.
|
||||||
|
|
||||||
|
### hello/
|
||||||
Minimal example showing the basic structure of a custom tool.
|
Minimal example showing the basic structure of a custom tool.
|
||||||
|
|
||||||
### question.ts
|
### question/
|
||||||
Demonstrates `pi.ui.select()` for asking the user questions with options.
|
Demonstrates `pi.ui.select()` for asking the user questions with options.
|
||||||
|
|
||||||
### todo.ts
|
### todo/
|
||||||
Full-featured example demonstrating:
|
Full-featured example demonstrating:
|
||||||
- `onSession` for state reconstruction from session history
|
- `onSession` for state reconstruction from session history
|
||||||
- Custom `renderCall` and `renderResult`
|
- Custom `renderCall` and `renderResult`
|
||||||
|
|
@ -19,7 +21,8 @@ Full-featured example demonstrating:
|
||||||
|
|
||||||
### subagent/
|
### subagent/
|
||||||
Delegate tasks to specialized subagents with isolated context windows. Includes:
|
Delegate tasks to specialized subagents with isolated context windows. Includes:
|
||||||
- `subagent.ts` - The custom tool (single, parallel, and chain modes)
|
- `index.ts` - The custom tool (single, parallel, and chain modes)
|
||||||
|
- `agents.ts` - Agent discovery helper
|
||||||
- `agents/` - Sample agent definitions (scout, planner, reviewer, worker)
|
- `agents/` - Sample agent definitions (scout, planner, reviewer, worker)
|
||||||
- `commands/` - Workflow presets (/implement, /scout-and-plan, /implement-and-review)
|
- `commands/` - Workflow presets (/implement, /scout-and-plan, /implement-and-review)
|
||||||
|
|
||||||
|
|
@ -28,11 +31,11 @@ See [subagent/README.md](subagent/README.md) for full documentation.
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Test directly
|
# Test directly (can point to any .ts file)
|
||||||
pi --tool examples/custom-tools/todo.ts
|
pi --tool examples/custom-tools/todo/index.ts
|
||||||
|
|
||||||
# Or copy to tools directory for persistent use
|
# Or copy entire folder to tools directory for persistent use
|
||||||
cp todo.ts ~/.pi/agent/tools/
|
cp -r todo ~/.pi/agent/tools/
|
||||||
```
|
```
|
||||||
|
|
||||||
Then in pi:
|
Then in pi:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue