mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 18:01:22 +00:00
- Add TreeNode base type with id, parentId, timestamp - Add *Content types for clean input/output separation - Entry types are now TreeNode & *Content intersections - SessionManager assigns id/parentId on save, tracks leafId - Add migrateSessionEntries() for v1 to v2 conversion - Migration runs on load, rewrites file - buildSessionContext() uses tree traversal from leaf - Compaction returns CompactionResult (content only) - Hooks return compaction content, not full entries - Add firstKeptEntryId to before_compact hook event - Update mom package for tree fields - Better error messages for compaction failures |
||
|---|---|---|
| .. | ||
| custom-tools | ||
| hooks | ||
| sdk | ||
| README.md | ||
Examples
Example code for pi-coding-agent.
Directories
sdk/
Programmatic usage via createAgentSession(). Shows how to customize models, prompts, tools, hooks, and session management.
hooks/
Example hooks for intercepting tool calls, adding safety gates, and integrating with external systems.
custom-tools/
Example custom tools that extend the agent's capabilities.
Running Examples
cd packages/coding-agent
npx tsx examples/sdk/01-minimal.ts
npx tsx examples/hooks/permission-gate.ts