mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 14:03:49 +00:00
Composable agent runtime monorepo built on the pi ecosystem
Major improvements to mom's logging and cost reporting: Centralized Logging System: - Add src/log.ts with type-safe logging functions - Colored console output (green=user, yellow=mom, dim=details) - Consistent format: [HH:MM:SS] [context] message - Replace scattered console.log/error calls throughout codebase Usage Tracking & Cost Reporting: - Track tokens (input, output, cache read/write) and costs per run - Display summary at end of each run in console and Slack thread - Example: 💰 Usage: 12,543 in + 847 out (5,234 cache read) = $0.0234 Prompt Caching Optimization: - Move recent messages from system prompt to user message - System prompt now mostly static (only changes with memory files) - Enables effective use of Anthropic's prompt caching - Significantly reduces costs on subsequent requests Model & Cost Improvements: - Switch from Claude Opus 4.5 to Sonnet 4.5 (~40% cost reduction) - Fix Claude Opus 4.5 cache pricing in ai package (was 3x too expensive) - Add manual override in generate-models.ts until upstream fix merges - Submitted PR to models.dev: https://github.com/sst/models.dev/pull/439 UI/UX Improvements: - Extract actual text from tool results instead of JSON wrapper - Cleaner Slack thread formatting with duration and labels - Tool args formatting shows paths with offset:limit notation - Add chalk for colored terminal output Dependencies: - Add chalk package for terminal colors |
||
|---|---|---|
| .husky | ||
| packages | ||
| scripts | ||
| .gitignore | ||
| .npmrc | ||
| AGENTS.md | ||
| biome.json | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| pi-mono.code-workspace | ||
| README.md | ||
| tsconfig.base.json | ||
| tsconfig.json | ||
Pi Monorepo
Tools for building AI agents and managing LLM deployments.
Packages
| Package | Description |
|---|---|
| @mariozechner/pi-ai | Unified multi-provider LLM API (OpenAI, Anthropic, Google, etc.) |
| @mariozechner/pi-agent | Agent runtime with tool calling and state management |
| @mariozechner/pi-coding-agent | Interactive coding agent CLI |
| @mariozechner/pi-mom | Slack bot that delegates messages to the pi coding agent |
| @mariozechner/pi-tui | Terminal UI library with differential rendering |
| @mariozechner/pi-web-ui | Web components for AI chat interfaces |
| @mariozechner/pi-proxy | CORS proxy for browser-based LLM API calls |
| @mariozechner/pi | CLI for managing vLLM deployments on GPU pods |
Development
Setup
npm install # Install all dependencies
npm run build # Build all packages
npm run check # Lint, format, and type check
Development
Start watch builds for all packages:
npm run dev
Then run with tsx:
cd packages/coding-agent && npx tsx src/cli.ts
cd packages/pods && npx tsx src/cli.ts
Versioning (Lockstep)
All packages MUST always have the same version number. Use these commands to bump versions:
npm run version:patch # 0.7.5 -> 0.7.6
npm run version:minor # 0.7.5 -> 0.8.0
npm run version:major # 0.7.5 -> 1.0.0
These commands:
- Update all package versions to the same number
- Update inter-package dependency versions (e.g.,
pi-agentdepends onpi-ai@^0.7.7) - Update
package-lock.json
Never manually edit version numbers. The lockstep system ensures consistency across the monorepo.
Publishing
Complete release process:
-
Update CHANGELOG.md (if changes affect coding-agent):
# Add your changes to the [Unreleased] section in packages/coding-agent/CHANGELOG.md -
Bump version (all packages):
npm run version:patch # For bug fixes npm run version:minor # For new features npm run version:major # For breaking changes -
Update CHANGELOG.md version (if changes affect coding-agent):
# Move the [Unreleased] section to the new version number with today's date # e.g., ## [0.7.16] - 2025-11-17 -
Commit and tag:
git add . git commit -m "Release v0.7.16" git tag v0.7.16 git push origin main git push origin v0.7.16 -
Publish to npm:
npm run publish # Publish all packages to npm
License
MIT