mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 17:00:59 +00:00
Update docs for ctx.ui.editor() and handoff example
- Added ctx.ui.editor() to hooks.md and custom-tools.md - Added ctx.ui.editor() to CHANGELOG.md - Added handoff.ts to examples/hooks/README.md
This commit is contained in:
parent
af4c66117b
commit
02175d908b
4 changed files with 20 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Examples
|
||||
|
||||
Example code for pi-coding-agent.
|
||||
Example code for pi-coding-agent SDK, hooks, and custom tools.
|
||||
|
||||
## Directories
|
||||
|
||||
|
|
@ -13,14 +13,6 @@ Example hooks for intercepting tool calls, adding safety gates, and integrating
|
|||
### [custom-tools/](custom-tools/)
|
||||
Example custom tools that extend the agent's capabilities.
|
||||
|
||||
## Running Examples
|
||||
|
||||
```bash
|
||||
cd packages/coding-agent
|
||||
npx tsx examples/sdk/01-minimal.ts
|
||||
npx tsx examples/hooks/permission-gate.ts
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
- [SDK Reference](sdk/README.md)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ cp permission-gate.ts ~/.pi/agent/hooks/
|
|||
| `qna.ts` | Extracts questions from last response into editor via `ctx.ui.setEditorText()` |
|
||||
| `snake.ts` | Snake game with custom UI, keyboard handling, and session persistence |
|
||||
| `status-line.ts` | Shows turn progress in footer via `ctx.ui.setStatus()` with themed colors |
|
||||
| `handoff.ts` | Transfer context to a new focused session via `/handoff <goal>` |
|
||||
|
||||
## Writing Hooks
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue