mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 12:03:49 +00:00
Clean-up
This commit is contained in:
parent
59ce62bffc
commit
256761e410
4 changed files with 1 additions and 1487 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -29,3 +29,4 @@ compaction-results/
|
|||
.opencode/
|
||||
syntax.jsonl
|
||||
out.jsonl
|
||||
pi-*.html
|
||||
|
|
|
|||
|
|
@ -1,496 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Session Export - 2025-12-28T17-08-16-800Z_d1555962-63f5-402c-b6e5-24fa5d528fb2.jsonl</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
color: rgb(229, 229, 231);
|
||||
background: rgb(24, 24, 30);
|
||||
padding: 24px;
|
||||
}
|
||||
.container { max-width: 700px; margin: 0 auto; }
|
||||
.header {
|
||||
margin-bottom: 24px;
|
||||
padding: 16px;
|
||||
background: rgb(30, 30, 36);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.header h1 {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 12px;
|
||||
color: rgb(0, 215, 255);
|
||||
}
|
||||
.header-info { display: flex; flex-direction: column; gap: 3px; font-size: 11px; }
|
||||
.info-item { color: rgb(102, 102, 102); display: flex; align-items: baseline; }
|
||||
.info-label { font-weight: 600; margin-right: 8px; min-width: 100px; }
|
||||
.info-value { color: rgb(229, 229, 231); flex: 1; }
|
||||
.info-value.cost { font-family: 'SF Mono', monospace; }
|
||||
.messages { display: flex; flex-direction: column; gap: 16px; }
|
||||
.message-timestamp { font-size: 10px; color: rgb(102, 102, 102); margin-bottom: 4px; opacity: 0.8; }
|
||||
.user-message {
|
||||
background: rgb(52, 53, 65);
|
||||
color: rgb(229, 229, 231);
|
||||
padding: 12px 16px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.assistant-message { padding: 0; }
|
||||
.assistant-text, .thinking-text {
|
||||
padding: 12px 16px;
|
||||
}
|
||||
.thinking-text { color: rgb(102, 102, 102); font-style: italic; white-space: pre-wrap; }
|
||||
.model-change { padding: 8px 16px; background: rgb(40, 40, 50); border-radius: 4px; }
|
||||
.model-change-text { color: rgb(102, 102, 102); font-size: 11px; }
|
||||
.model-name { color: rgb(0, 215, 255); font-weight: bold; }
|
||||
.compaction-container { background: rgb(60, 55, 35); border-radius: 4px; overflow: hidden; }
|
||||
.compaction-header { padding: 12px 16px; cursor: pointer; }
|
||||
.compaction-header:hover { background: rgba(255, 255, 255, 0.05); }
|
||||
.compaction-header-row { display: flex; align-items: center; gap: 8px; }
|
||||
.compaction-toggle { color: rgb(0, 215, 255); font-size: 10px; transition: transform 0.2s; }
|
||||
.compaction-container.expanded .compaction-toggle { transform: rotate(90deg); }
|
||||
.compaction-title { color: rgb(229, 229, 231); font-weight: bold; }
|
||||
.compaction-hint { color: rgb(102, 102, 102); font-size: 11px; }
|
||||
.compaction-content { display: none; padding: 0 16px 16px 16px; }
|
||||
.compaction-container.expanded .compaction-content { display: block; }
|
||||
.compaction-summary { background: rgba(0, 0, 0, 0.1); border-radius: 4px; padding: 12px; }
|
||||
.compaction-summary-header { font-weight: bold; color: rgb(0, 215, 255); margin-bottom: 8px; font-size: 11px; }
|
||||
.compaction-summary-content { color: rgb(229, 229, 231); white-space: pre-wrap; word-wrap: break-word; }
|
||||
.tool-execution { padding: 12px 16px; border-radius: 4px; margin-top: 8px; }
|
||||
.tool-execution.user-bash { background: rgb(50, 48, 35); }
|
||||
.tool-execution.user-bash-error { background: rgb(60, 45, 35); }
|
||||
.tool-header, .tool-name { font-weight: bold; }
|
||||
.tool-path { color: rgb(0, 215, 255); word-break: break-all; }
|
||||
.line-numbers { color: rgb(255, 255, 0); }
|
||||
.line-count { color: rgb(102, 102, 102); }
|
||||
.tool-command { font-weight: bold; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; }
|
||||
.tool-output {
|
||||
margin-top: 12px;
|
||||
color: rgb(128, 128, 128);
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
word-break: break-word;
|
||||
font-family: inherit;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.tool-output > div { line-height: 1.4; }
|
||||
.tool-output pre { margin: 0; font-family: inherit; color: inherit; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }
|
||||
.tool-output.expandable { cursor: pointer; }
|
||||
.tool-output.expandable:hover { opacity: 0.9; }
|
||||
.tool-output.expandable .output-full { display: none; }
|
||||
.tool-output.expandable.expanded .output-preview { display: none; }
|
||||
.tool-output.expandable.expanded .output-full { display: block; }
|
||||
.expand-hint { color: rgb(0, 215, 255); font-style: italic; margin-top: 4px; }
|
||||
.system-prompt, .tools-list { background: rgb(60, 55, 40); padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
|
||||
.system-prompt-header, .tools-header { font-weight: bold; color: rgb(255, 255, 0); margin-bottom: 8px; }
|
||||
.system-prompt-content, .tools-content { color: rgb(102, 102, 102); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; font-size: 11px; }
|
||||
.tool-item { margin: 4px 0; }
|
||||
.tool-item-name { font-weight: bold; color: rgb(229, 229, 231); }
|
||||
.tool-diff { margin-top: 12px; font-size: 11px; font-family: inherit; overflow-x: auto; max-width: 100%; }
|
||||
.diff-line-old { color: rgb(204, 102, 102); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }
|
||||
.diff-line-new { color: rgb(181, 189, 104); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }
|
||||
.diff-line-context { color: rgb(128, 128, 128); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }
|
||||
.error-text { color: rgb(204, 102, 102); padding: 12px 16px; }
|
||||
.bash-status.warning { color: rgb(255, 255, 0); }
|
||||
.bash-status.error { color: rgb(204, 102, 102); }
|
||||
.bash-truncation.warning { color: rgb(255, 255, 0); }
|
||||
.footer { margin-top: 48px; padding: 20px; text-align: center; color: rgb(102, 102, 102); font-size: 10px; }
|
||||
.streaming-notice { background: rgb(50, 45, 35); padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; color: rgb(102, 102, 102); font-size: 11px; }
|
||||
|
||||
/* Image styles */
|
||||
.message-images { margin-bottom: 12px; }
|
||||
.message-image { max-width: 100%; max-height: 400px; border-radius: 4px; margin: 4px 0; }
|
||||
|
||||
/* Markdown styles */
|
||||
.markdown-content h1, .markdown-content h2, .markdown-content h3,
|
||||
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
|
||||
color: rgb(240, 198, 116);
|
||||
margin: 1em 0 0.5em 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
.markdown-content h1 { font-size: 1.4em; text-decoration: underline; }
|
||||
.markdown-content h2 { font-size: 1.2em; }
|
||||
.markdown-content h3 { font-size: 1.1em; }
|
||||
.markdown-content p { margin: 0.5em 0; }
|
||||
.markdown-content a { color: rgb(129, 162, 190); text-decoration: underline; }
|
||||
.markdown-content a:hover { opacity: 0.8; }
|
||||
.markdown-content code {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: rgb(138, 190, 183);
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
font-family: inherit;
|
||||
}
|
||||
.markdown-content pre {
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 0;
|
||||
margin: 0.5em 0;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.markdown-content pre code {
|
||||
display: block;
|
||||
background: none;
|
||||
color: rgb(181, 189, 104);
|
||||
padding: 8px 12px;
|
||||
}
|
||||
.code-block-wrapper {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
.code-block-header {
|
||||
color: rgb(128, 128, 128);
|
||||
font-size: 11px;
|
||||
}
|
||||
.code-block-footer {
|
||||
color: rgb(128, 128, 128);
|
||||
font-size: 11px;
|
||||
}
|
||||
.markdown-content blockquote {
|
||||
border-left: 3px solid rgb(128, 128, 128);
|
||||
padding-left: 12px;
|
||||
margin: 0.5em 0;
|
||||
color: rgb(128, 128, 128);
|
||||
font-style: italic;
|
||||
}
|
||||
.markdown-content ul, .markdown-content ol {
|
||||
margin: 0.5em 0;
|
||||
padding-left: 24px;
|
||||
}
|
||||
.markdown-content li { margin: 0.25em 0; }
|
||||
.markdown-content li::marker { color: rgb(138, 190, 183); }
|
||||
.markdown-content hr {
|
||||
border: none;
|
||||
border-top: 1px solid rgb(128, 128, 128);
|
||||
margin: 1em 0;
|
||||
}
|
||||
.markdown-content table {
|
||||
border-collapse: collapse;
|
||||
margin: 0.5em 0;
|
||||
width: 100%;
|
||||
}
|
||||
.markdown-content th, .markdown-content td {
|
||||
border: 1px solid rgb(128, 128, 128);
|
||||
padding: 6px 10px;
|
||||
text-align: left;
|
||||
}
|
||||
.markdown-content th {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
font-weight: bold;
|
||||
}
|
||||
.markdown-content img {
|
||||
max-width: 100%;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Syntax highlighting (highlight.js) */
|
||||
.hljs { background: transparent; }
|
||||
.hljs-comment, .hljs-quote { color: rgb(106, 153, 85); }
|
||||
.hljs-keyword, .hljs-selector-tag, .hljs-addition { color: rgb(86, 156, 214); }
|
||||
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: rgb(181, 206, 168); }
|
||||
.hljs-string, .hljs-doctag, .hljs-regexp { color: rgb(206, 145, 120); }
|
||||
.hljs-title, .hljs-section, .hljs-name, .hljs-selector-id, .hljs-selector-class { color: rgb(220, 220, 170); }
|
||||
.hljs-type, .hljs-class, .hljs-built_in { color: rgb(78, 201, 176); }
|
||||
.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-params { color: rgb(156, 220, 254); }
|
||||
.hljs-attribute { color: rgb(156, 220, 254); }
|
||||
.hljs-meta { color: rgb(86, 156, 214); }
|
||||
.hljs-formula { background: rgba(255, 255, 255, 0.05); }
|
||||
.hljs-deletion { color: rgb(204, 102, 102); }
|
||||
.hljs-emphasis { font-style: italic; }
|
||||
.hljs-strong { font-weight: bold; }
|
||||
.hljs-link { color: rgb(129, 162, 190); text-decoration: underline; }
|
||||
|
||||
@media print { body { background: white; color: black; } .tool-execution { border: 1px solid #ddd; } }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>pi v0.30.2</h1>
|
||||
<div class="header-info">
|
||||
<div class="info-item"><span class="info-label">Session:</span><span class="info-value">d1555962-63f5-402c-b6e5-24fa5d528fb2</span></div>
|
||||
<div class="info-item"><span class="info-label">Date:</span><span class="info-value">12/28/2025, 6:08:16 PM</span></div>
|
||||
<div class="info-item"><span class="info-label">Models:</span><span class="info-value">unknown</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<h1>Messages</h1>
|
||||
<div class="header-info">
|
||||
<div class="info-item"><span class="info-label">User:</span><span class="info-value">1</span></div>
|
||||
<div class="info-item"><span class="info-label">Assistant:</span><span class="info-value">2</span></div>
|
||||
<div class="info-item"><span class="info-label">Tool Calls:</span><span class="info-value">1</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<h1>Tokens & Cost</h1>
|
||||
<div class="header-info">
|
||||
<div class="info-item"><span class="info-label">Input:</span><span class="info-value">9 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Output:</span><span class="info-value">268 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Cache Read:</span><span class="info-value">2,462 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Cache Write:</span><span class="info-value">3,505 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Total:</span><span class="info-value">6,244 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Input Cost:</span><span class="info-value cost">$0.0000</span></div>
|
||||
<div class="info-item"><span class="info-label">Output Cost:</span><span class="info-value cost">$0.0040</span></div>
|
||||
<div class="info-item"><span class="info-label">Cache Read Cost:</span><span class="info-value cost">$0.0007</span></div>
|
||||
<div class="info-item"><span class="info-label">Cache Write Cost:</span><span class="info-value cost">$0.0131</span></div>
|
||||
<div class="info-item"><span class="info-label">Total Cost:</span><span class="info-value cost"><strong>$0.0179</strong></span></div>
|
||||
<div class="info-item"><span class="info-label">Context Usage:</span><span class="info-value">3,647 / 200,000 tokens (1.8%) - anthropic/claude-sonnet-4-5</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="system-prompt">
|
||||
<div class="system-prompt-header">System Prompt</div>
|
||||
<div class="system-prompt-content">You are an expert coding assistant. You help users with coding tasks by reading files, executing commands, editing code, and writing new files.
|
||||
|
||||
Available tools:
|
||||
- read: Read file contents
|
||||
- bash: Execute bash commands (ls, grep, find, etc.)
|
||||
- edit: Make surgical edits to files (find exact text and replace)
|
||||
- write: Create or overwrite files
|
||||
|
||||
Guidelines:
|
||||
- Use bash for file operations like ls, grep, find
|
||||
- Use read to examine files before editing. You must use this tool instead of cat or sed.
|
||||
- Use edit for precise changes (old text must match exactly)
|
||||
- Use write only for new files or complete rewrites
|
||||
- When summarizing your actions, output plain text directly - do NOT use cat or bash to display what you did
|
||||
- Be concise in your responses
|
||||
- Show file paths clearly when working with files
|
||||
|
||||
Documentation:
|
||||
- Main documentation: /Users/badlogic/workspaces/pi-mono/packages/coding-agent/README.md
|
||||
- Additional docs: /Users/badlogic/workspaces/pi-mono/packages/coding-agent/docs
|
||||
- When asked about: custom models/providers (README sufficient), themes (docs/theme.md), skills (docs/skills.md), hooks (docs/hooks.md), custom tools (docs/custom-tools.md), RPC (docs/rpc.md)
|
||||
|
||||
# Project Context
|
||||
|
||||
The following project context files have been loaded:
|
||||
|
||||
## /Users/badlogic/workspaces/pi-mono/AGENTS.md
|
||||
|
||||
# Development Rules
|
||||
|
||||
## First Message
|
||||
If the user did not give you a concrete task in their first message,
|
||||
read README.md, then ask which module(s) to work on. Based on the answer, read the relevant README.md files in parallel.
|
||||
- packages/ai/README.md
|
||||
- packages/tui/README.md
|
||||
- packages/agent/README.md
|
||||
- packages/coding-agent/README.md
|
||||
- packages/mom/README.md
|
||||
- packages/pods/README.md
|
||||
- packages/web-ui/README.md
|
||||
|
||||
## Code Quality
|
||||
- No `any` types unless absolutely necessary
|
||||
- Check node_modules for external API type definitions instead of guessing
|
||||
- **NEVER use inline imports** - no `await import("./foo.js")`, no `import("pkg").Type` in type positions, no dynamic imports for types. Always use standard top-level imports.
|
||||
- NEVER remove or downgrade code to fix type errors from outdated dependencies; upgrade the dependency instead
|
||||
- Always ask before removing functionality or code that appears to be intentional
|
||||
|
||||
## Commands
|
||||
- After code changes: `npm run check` (get full output, no tail)
|
||||
- NEVER run: `npm run dev`, `npm run build`, `npm test`
|
||||
- Only run specific tests if user instructs: `npm test -- test/specific.test.ts`
|
||||
- NEVER commit unless user asks
|
||||
|
||||
## GitHub Issues
|
||||
When reading issues:
|
||||
- Always read all comments on the issue
|
||||
|
||||
When creating issues:
|
||||
- Add `pkg:*` labels to indicate which package(s) the issue affects
|
||||
- Available labels: `pkg:agent`, `pkg:ai`, `pkg:coding-agent`, `pkg:mom`, `pkg:pods`, `pkg:tui`, `pkg:web-ui`
|
||||
- If an issue spans multiple packages, add all relevant labels
|
||||
|
||||
When closing issues via commit:
|
||||
- Include `fixes #<number>` or `closes #<number>` in the commit message
|
||||
- This automatically closes the issue when the commit is merged
|
||||
|
||||
## Tools
|
||||
- GitHub CLI for issues/PRs
|
||||
- Add package labels to issues/PRs: pkg:agent, pkg:ai, pkg:coding-agent, pkg:mom, pkg:pods, pkg:tui, pkg:web-ui
|
||||
- TUI interaction: use tmux
|
||||
|
||||
## Style
|
||||
- Keep answers short and concise
|
||||
- No emojis in commits, issues, PR comments, or code
|
||||
- No fluff or cheerful filler text
|
||||
- Technical prose only, be kind but direct (e.g., "Thanks @user" not "Thanks so much @user!")
|
||||
|
||||
## Changelog
|
||||
Location: `packages/*/CHANGELOG.md` (each package has its own)
|
||||
|
||||
### Format
|
||||
Use these sections under `## [Unreleased]`:
|
||||
- `### Breaking Changes` - API changes requiring migration
|
||||
- `### Added` - New features
|
||||
- `### Changed` - Changes to existing functionality
|
||||
- `### Fixed` - Bug fixes
|
||||
- `### Removed` - Removed features
|
||||
|
||||
### Rules
|
||||
- New entries ALWAYS go under `## [Unreleased]` section
|
||||
- NEVER modify already-released version sections (e.g., `## [0.12.2]`)
|
||||
- Each version section is immutable once released
|
||||
|
||||
### Attribution
|
||||
- **Internal changes (from issues)**: `Fixed foo bar ([#123](https://github.com/badlogic/pi-mono/issues/123))`
|
||||
- **External contributions**: `Added feature X ([#456](https://github.com/badlogic/pi-mono/pull/456) by [@username](https://github.com/username))`
|
||||
|
||||
## Releasing
|
||||
|
||||
1. **Update CHANGELOGs**: Ensure all changes since last release are documented in the `[Unreleased]` section of each affected package's CHANGELOG.md
|
||||
|
||||
2. **Run release script**:
|
||||
```bash
|
||||
npm run release:patch # Bug fixes
|
||||
npm run release:minor # New features
|
||||
npm run release:major # Breaking changes
|
||||
```
|
||||
|
||||
The script handles: version bump, CHANGELOG finalization, commit, tag, publish, and adding new `[Unreleased]` sections.
|
||||
|
||||
### Tool Usage
|
||||
**CTRICIAL**: NEVER use sed/cat to read a file or a range of a file. Always use the read tool (use offset + limit for ranged reads).
|
||||
|
||||
|
||||
Current date and time: Sunday, December 28, 2025 at 06:08:16 PM GMT+1
|
||||
Current working directory: /Users/badlogic/workspaces/pi-mono/packages/coding-agent</div>
|
||||
</div>
|
||||
<div class="tools-list">
|
||||
<div class="tools-header">Available Tools</div>
|
||||
<div class="tools-content">
|
||||
<div class="tool-item"><span class="tool-item-name">read</span> - Read the contents of a file. Supports text files and images (jpg, png, gif, webp). Images are sent as attachments. For text files, output is truncated to 2000 lines or 50KB (whichever is hit first). Use offset/limit for large files.</div><div class="tool-item"><span class="tool-item-name">bash</span> - Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.</div><div class="tool-item"><span class="tool-item-name">edit</span> - Edit a file by replacing exact text. The oldText must match exactly (including whitespace). Use this for precise, surgical edits.</div><div class="tool-item"><span class="tool-item-name">write</span> - Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="messages">
|
||||
<div class="user-message"><div class="message-timestamp">06:08:16 PM</div><div class="markdown-content"><p>Hello</p>
|
||||
</div></div><div class="assistant-message"><div class="message-timestamp">06:08:16 PM</div><div class="assistant-text markdown-content"><p>Hello! I'm Claude Code, here to help you with coding tasks in this pi-mono monorepo.</p>
|
||||
<p>Since you haven't given me a specific task yet, let me read the main README to understand the project better, then I can ask which module(s) you'd like to work on.</p>
|
||||
</div><div class="tool-execution" style="background-color: rgb(40, 50, 40)"><div class="tool-header"><span class="tool-name">read</span> <span class="tool-path">~/workspaces/pi-mono/README.md</span></div><div class="tool-output expandable" onclick="this.classList.toggle('expanded')"><div class="output-preview"><pre><code class="hljs"><span class="hljs-section"># Pi Monorepo</span>
|
||||
|
||||
Tools for building AI agents and managing LLM deployments.
|
||||
|
||||
<span class="hljs-section">## Packages</span>
|
||||
|
||||
| Package | Description |
|
||||
|---------|-------------|
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-ai</span>](<span class="hljs-link">packages/ai</span>)**</span> | Unified multi-provider LLM API (OpenAI, Anthropic, Google, etc.) |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-agent-core</span>](<span class="hljs-link">packages/agent</span>)**</span> | Agent runtime with tool calling and state management |</code></pre><div class="expand-hint">... (78 more lines) - click to expand</div></div><div class="output-full"><pre><code class="hljs"><span class="hljs-section"># Pi Monorepo</span>
|
||||
|
||||
Tools for building AI agents and managing LLM deployments.
|
||||
|
||||
<span class="hljs-section">## Packages</span>
|
||||
|
||||
| Package | Description |
|
||||
|---------|-------------|
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-ai</span>](<span class="hljs-link">packages/ai</span>)**</span> | Unified multi-provider LLM API (OpenAI, Anthropic, Google, etc.) |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-agent-core</span>](<span class="hljs-link">packages/agent</span>)**</span> | Agent runtime with tool calling and state management |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-coding-agent</span>](<span class="hljs-link">packages/coding-agent</span>)**</span> | Interactive coding agent CLI |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-mom</span>](<span class="hljs-link">packages/mom</span>)**</span> | Slack bot that delegates messages to the pi coding agent |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-tui</span>](<span class="hljs-link">packages/tui</span>)**</span> | Terminal UI library with differential rendering |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-web-ui</span>](<span class="hljs-link">packages/web-ui</span>)**</span> | Web components for AI chat interfaces |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-pods</span>](<span class="hljs-link">packages/pods</span>)**</span> | CLI for managing vLLM deployments on GPU pods |
|
||||
|
||||
<span class="hljs-section">## Development</span>
|
||||
|
||||
<span class="hljs-section">### Setup</span>
|
||||
|
||||
<span class="hljs-code">```bash
|
||||
npm install # Install all dependencies
|
||||
npm run build # Build all packages
|
||||
npm run check # Lint, format, and type check
|
||||
```</span>
|
||||
|
||||
<span class="hljs-quote">> <span class="hljs-strong">**Note:**</span> `npm run check` requires `npm run build` to be run first. The web-ui package uses `tsc` which needs compiled `.d.ts` files from dependencies.</span>
|
||||
|
||||
<span class="hljs-section">### CI</span>
|
||||
|
||||
GitHub Actions runs on push to <span class="hljs-code">`main`</span> and on pull requests. The workflow runs <span class="hljs-code">`npm run check`</span> and <span class="hljs-code">`npm run test`</span> for each package in parallel.
|
||||
|
||||
<span class="hljs-strong">**Do not add LLM API keys as secrets to this repository.**</span> Tests that require LLM access use <span class="hljs-code">`describe.skipIf()`</span> to skip when API keys are missing. This is intentional:
|
||||
|
||||
<span class="hljs-bullet">-</span> PRs from external contributors would have access to secrets in the CI environment
|
||||
<span class="hljs-bullet">-</span> Malicious PR code could exfiltrate API keys
|
||||
<span class="hljs-bullet">-</span> Tests that need LLM calls are skipped on CI and run locally by developers who have keys configured
|
||||
|
||||
If you need to run LLM-dependent tests, run them locally with your own API keys.
|
||||
|
||||
<span class="hljs-section">### Development</span>
|
||||
|
||||
Start watch builds for all packages:
|
||||
<span class="hljs-code">```bash
|
||||
npm run dev
|
||||
```</span>
|
||||
|
||||
Then run with tsx:
|
||||
<span class="hljs-code">```bash
|
||||
cd packages/coding-agent && npx tsx src/cli.ts
|
||||
cd packages/pods && npx tsx src/cli.ts
|
||||
```</span>
|
||||
|
||||
<span class="hljs-section">### Versioning (Lockstep)</span>
|
||||
|
||||
<span class="hljs-strong">**All packages MUST always have the same version number.**</span> Use these commands to bump versions:
|
||||
|
||||
<span class="hljs-code">```bash
|
||||
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
|
||||
```</span>
|
||||
|
||||
These commands:
|
||||
<span class="hljs-bullet">1.</span> Update all package versions to the same number
|
||||
<span class="hljs-bullet">2.</span> Update inter-package dependency versions (e.g., <span class="hljs-code">`pi-agent`</span> depends on <span class="hljs-code">`pi-ai@^0.7.7`</span>)
|
||||
<span class="hljs-bullet">3.</span> Update <span class="hljs-code">`package-lock.json`</span>
|
||||
|
||||
<span class="hljs-strong">**Never manually edit version numbers.**</span> The lockstep system ensures consistency across the monorepo.
|
||||
|
||||
<span class="hljs-section">### Publishing</span>
|
||||
|
||||
<span class="hljs-code">```bash
|
||||
npm run release:patch # Bug fixes
|
||||
npm run release:minor # New features
|
||||
npm run release:major # Breaking changes
|
||||
```</span>
|
||||
|
||||
This handles version bump, CHANGELOG updates, commit, tag, publish, and push.
|
||||
|
||||
<span class="hljs-strong">**NPM Token Setup**</span>: Requires a granular access token with "Bypass 2FA on publish" enabled.
|
||||
<span class="hljs-bullet">-</span> Go to https://www.npmjs.com/settings/badlogic/tokens/
|
||||
<span class="hljs-bullet">-</span> Create a new "Granular Access Token" with "Bypass 2FA on publish"
|
||||
<span class="hljs-bullet">-</span> Set the token: <span class="hljs-code">`npm config set //registry.npmjs.org/:_authToken=YOUR_TOKEN`</span>
|
||||
|
||||
<span class="hljs-section">## License</span>
|
||||
|
||||
MIT</code></pre></div></div></div></div><div class="assistant-message"><div class="message-timestamp">06:08:20 PM</div><div class="assistant-text markdown-content"><p>Great! This is a monorepo with several packages for building AI agents and managing LLM deployments. </p>
|
||||
<p>Which module(s) would you like to work on?</p>
|
||||
<ul>
|
||||
<li><strong>ai</strong> - Unified multi-provider LLM API</li>
|
||||
<li><strong>agent</strong> - Agent runtime with tool calling and state management </li>
|
||||
<li><strong>coding-agent</strong> - Interactive coding agent CLI</li>
|
||||
<li><strong>mom</strong> - Slack bot that delegates to the coding agent</li>
|
||||
<li><strong>tui</strong> - Terminal UI library</li>
|
||||
<li><strong>web-ui</strong> - Web components for AI chat interfaces</li>
|
||||
<li><strong>pods</strong> - CLI for managing vLLM deployments</li>
|
||||
</ul>
|
||||
</div></div>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
Generated by pi coding-agent on 12/28/2025, 6:08:24 PM
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,496 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Session Export - 2025-12-28T18-08-12-562Z_6646a9e5-779b-4f81-8d45-d8d32f99aa25.jsonl</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
color: rgb(229, 229, 231);
|
||||
background: rgb(24, 24, 30);
|
||||
padding: 24px;
|
||||
}
|
||||
.container { max-width: 700px; margin: 0 auto; }
|
||||
.header {
|
||||
margin-bottom: 24px;
|
||||
padding: 16px;
|
||||
background: rgb(30, 30, 36);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.header h1 {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 12px;
|
||||
color: rgb(0, 215, 255);
|
||||
}
|
||||
.header-info { display: flex; flex-direction: column; gap: 3px; font-size: 11px; }
|
||||
.info-item { color: rgb(102, 102, 102); display: flex; align-items: baseline; }
|
||||
.info-label { font-weight: 600; margin-right: 8px; min-width: 100px; }
|
||||
.info-value { color: rgb(229, 229, 231); flex: 1; }
|
||||
.info-value.cost { font-family: 'SF Mono', monospace; }
|
||||
.messages { display: flex; flex-direction: column; gap: 16px; }
|
||||
.message-timestamp { font-size: 10px; color: rgb(102, 102, 102); margin-bottom: 4px; opacity: 0.8; }
|
||||
.user-message {
|
||||
background: rgb(52, 53, 65);
|
||||
color: rgb(229, 229, 231);
|
||||
padding: 12px 16px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.assistant-message { padding: 0; }
|
||||
.assistant-text, .thinking-text {
|
||||
padding: 12px 16px;
|
||||
}
|
||||
.thinking-text { color: rgb(102, 102, 102); font-style: italic; white-space: pre-wrap; }
|
||||
.model-change { padding: 8px 16px; background: rgb(40, 40, 50); border-radius: 4px; }
|
||||
.model-change-text { color: rgb(102, 102, 102); font-size: 11px; }
|
||||
.model-name { color: rgb(0, 215, 255); font-weight: bold; }
|
||||
.compaction-container { background: rgb(60, 55, 35); border-radius: 4px; overflow: hidden; }
|
||||
.compaction-header { padding: 12px 16px; cursor: pointer; }
|
||||
.compaction-header:hover { background: rgba(255, 255, 255, 0.05); }
|
||||
.compaction-header-row { display: flex; align-items: center; gap: 8px; }
|
||||
.compaction-toggle { color: rgb(0, 215, 255); font-size: 10px; transition: transform 0.2s; }
|
||||
.compaction-container.expanded .compaction-toggle { transform: rotate(90deg); }
|
||||
.compaction-title { color: rgb(229, 229, 231); font-weight: bold; }
|
||||
.compaction-hint { color: rgb(102, 102, 102); font-size: 11px; }
|
||||
.compaction-content { display: none; padding: 0 16px 16px 16px; }
|
||||
.compaction-container.expanded .compaction-content { display: block; }
|
||||
.compaction-summary { background: rgba(0, 0, 0, 0.1); border-radius: 4px; padding: 12px; }
|
||||
.compaction-summary-header { font-weight: bold; color: rgb(0, 215, 255); margin-bottom: 8px; font-size: 11px; }
|
||||
.compaction-summary-content { color: rgb(229, 229, 231); white-space: pre-wrap; word-wrap: break-word; }
|
||||
.tool-execution { padding: 12px 16px; border-radius: 4px; margin-top: 8px; }
|
||||
.tool-execution.user-bash { background: rgb(50, 48, 35); }
|
||||
.tool-execution.user-bash-error { background: rgb(60, 45, 35); }
|
||||
.tool-header, .tool-name { font-weight: bold; }
|
||||
.tool-path { color: rgb(0, 215, 255); word-break: break-all; }
|
||||
.line-numbers { color: rgb(255, 255, 0); }
|
||||
.line-count { color: rgb(102, 102, 102); }
|
||||
.tool-command { font-weight: bold; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; }
|
||||
.tool-output {
|
||||
margin-top: 12px;
|
||||
color: rgb(128, 128, 128);
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
word-break: break-word;
|
||||
font-family: inherit;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.tool-output > div { line-height: 1.4; }
|
||||
.tool-output pre { margin: 0; font-family: inherit; color: inherit; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }
|
||||
.tool-output.expandable { cursor: pointer; }
|
||||
.tool-output.expandable:hover { opacity: 0.9; }
|
||||
.tool-output.expandable .output-full { display: none; }
|
||||
.tool-output.expandable.expanded .output-preview { display: none; }
|
||||
.tool-output.expandable.expanded .output-full { display: block; }
|
||||
.expand-hint { color: rgb(0, 215, 255); font-style: italic; margin-top: 4px; }
|
||||
.system-prompt, .tools-list { background: rgb(60, 55, 40); padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
|
||||
.system-prompt-header, .tools-header { font-weight: bold; color: rgb(255, 255, 0); margin-bottom: 8px; }
|
||||
.system-prompt-content, .tools-content { color: rgb(102, 102, 102); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; font-size: 11px; }
|
||||
.tool-item { margin: 4px 0; }
|
||||
.tool-item-name { font-weight: bold; color: rgb(229, 229, 231); }
|
||||
.tool-diff { margin-top: 12px; font-size: 11px; font-family: inherit; overflow-x: auto; max-width: 100%; }
|
||||
.diff-line-old { color: rgb(204, 102, 102); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }
|
||||
.diff-line-new { color: rgb(181, 189, 104); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }
|
||||
.diff-line-context { color: rgb(128, 128, 128); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }
|
||||
.error-text { color: rgb(204, 102, 102); padding: 12px 16px; }
|
||||
.bash-status.warning { color: rgb(255, 255, 0); }
|
||||
.bash-status.error { color: rgb(204, 102, 102); }
|
||||
.bash-truncation.warning { color: rgb(255, 255, 0); }
|
||||
.footer { margin-top: 48px; padding: 20px; text-align: center; color: rgb(102, 102, 102); font-size: 10px; }
|
||||
.streaming-notice { background: rgb(50, 45, 35); padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; color: rgb(102, 102, 102); font-size: 11px; }
|
||||
|
||||
/* Image styles */
|
||||
.message-images { margin-bottom: 12px; }
|
||||
.message-image { max-width: 100%; max-height: 400px; border-radius: 4px; margin: 4px 0; }
|
||||
|
||||
/* Markdown styles */
|
||||
.markdown-content h1, .markdown-content h2, .markdown-content h3,
|
||||
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
|
||||
color: rgb(240, 198, 116);
|
||||
margin: 1em 0 0.5em 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
.markdown-content h1 { font-size: 1.4em; text-decoration: underline; }
|
||||
.markdown-content h2 { font-size: 1.2em; }
|
||||
.markdown-content h3 { font-size: 1.1em; }
|
||||
.markdown-content p { margin: 0.5em 0; }
|
||||
.markdown-content a { color: rgb(129, 162, 190); text-decoration: underline; }
|
||||
.markdown-content a:hover { opacity: 0.8; }
|
||||
.markdown-content code {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: rgb(138, 190, 183);
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
font-family: inherit;
|
||||
}
|
||||
.markdown-content pre {
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 0;
|
||||
margin: 0.5em 0;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.markdown-content pre code {
|
||||
display: block;
|
||||
background: none;
|
||||
color: rgb(181, 189, 104);
|
||||
padding: 8px 12px;
|
||||
}
|
||||
.code-block-wrapper {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
.code-block-header {
|
||||
color: rgb(128, 128, 128);
|
||||
font-size: 11px;
|
||||
}
|
||||
.code-block-footer {
|
||||
color: rgb(128, 128, 128);
|
||||
font-size: 11px;
|
||||
}
|
||||
.markdown-content blockquote {
|
||||
border-left: 3px solid rgb(128, 128, 128);
|
||||
padding-left: 12px;
|
||||
margin: 0.5em 0;
|
||||
color: rgb(128, 128, 128);
|
||||
font-style: italic;
|
||||
}
|
||||
.markdown-content ul, .markdown-content ol {
|
||||
margin: 0.5em 0;
|
||||
padding-left: 24px;
|
||||
}
|
||||
.markdown-content li { margin: 0.25em 0; }
|
||||
.markdown-content li::marker { color: rgb(138, 190, 183); }
|
||||
.markdown-content hr {
|
||||
border: none;
|
||||
border-top: 1px solid rgb(128, 128, 128);
|
||||
margin: 1em 0;
|
||||
}
|
||||
.markdown-content table {
|
||||
border-collapse: collapse;
|
||||
margin: 0.5em 0;
|
||||
width: 100%;
|
||||
}
|
||||
.markdown-content th, .markdown-content td {
|
||||
border: 1px solid rgb(128, 128, 128);
|
||||
padding: 6px 10px;
|
||||
text-align: left;
|
||||
}
|
||||
.markdown-content th {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
font-weight: bold;
|
||||
}
|
||||
.markdown-content img {
|
||||
max-width: 100%;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Syntax highlighting (highlight.js) */
|
||||
.hljs { background: transparent; }
|
||||
.hljs-comment, .hljs-quote { color: rgb(106, 153, 85); }
|
||||
.hljs-keyword, .hljs-selector-tag, .hljs-addition { color: rgb(86, 156, 214); }
|
||||
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: rgb(181, 206, 168); }
|
||||
.hljs-string, .hljs-doctag, .hljs-regexp { color: rgb(206, 145, 120); }
|
||||
.hljs-title, .hljs-section, .hljs-name, .hljs-selector-id, .hljs-selector-class { color: rgb(220, 220, 170); }
|
||||
.hljs-type, .hljs-class, .hljs-built_in { color: rgb(78, 201, 176); }
|
||||
.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-params { color: rgb(156, 220, 254); }
|
||||
.hljs-attribute { color: rgb(156, 220, 254); }
|
||||
.hljs-meta { color: rgb(86, 156, 214); }
|
||||
.hljs-formula { background: rgba(255, 255, 255, 0.05); }
|
||||
.hljs-deletion { color: rgb(204, 102, 102); }
|
||||
.hljs-emphasis { font-style: italic; }
|
||||
.hljs-strong { font-weight: bold; }
|
||||
.hljs-link { color: rgb(129, 162, 190); text-decoration: underline; }
|
||||
|
||||
@media print { body { background: white; color: black; } .tool-execution { border: 1px solid #ddd; } }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>pi v0.30.2</h1>
|
||||
<div class="header-info">
|
||||
<div class="info-item"><span class="info-label">Session:</span><span class="info-value">6646a9e5-779b-4f81-8d45-d8d32f99aa25</span></div>
|
||||
<div class="info-item"><span class="info-label">Date:</span><span class="info-value">12/28/2025, 7:08:12 PM</span></div>
|
||||
<div class="info-item"><span class="info-label">Models:</span><span class="info-value">unknown</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<h1>Messages</h1>
|
||||
<div class="header-info">
|
||||
<div class="info-item"><span class="info-label">User:</span><span class="info-value">1</span></div>
|
||||
<div class="info-item"><span class="info-label">Assistant:</span><span class="info-value">2</span></div>
|
||||
<div class="info-item"><span class="info-label">Tool Calls:</span><span class="info-value">1</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<h1>Tokens & Cost</h1>
|
||||
<div class="header-info">
|
||||
<div class="info-item"><span class="info-label">Input:</span><span class="info-value">9 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Output:</span><span class="info-value">302 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Cache Read:</span><span class="info-value">2,462 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Cache Write:</span><span class="info-value">3,487 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Total:</span><span class="info-value">6,260 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Input Cost:</span><span class="info-value cost">$0.0000</span></div>
|
||||
<div class="info-item"><span class="info-label">Output Cost:</span><span class="info-value cost">$0.0045</span></div>
|
||||
<div class="info-item"><span class="info-label">Cache Read Cost:</span><span class="info-value cost">$0.0007</span></div>
|
||||
<div class="info-item"><span class="info-label">Cache Write Cost:</span><span class="info-value cost">$0.0131</span></div>
|
||||
<div class="info-item"><span class="info-label">Total Cost:</span><span class="info-value cost"><strong>$0.0184</strong></span></div>
|
||||
<div class="info-item"><span class="info-label">Context Usage:</span><span class="info-value">3,681 / 200,000 tokens (1.8%) - anthropic/claude-sonnet-4-5</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="system-prompt">
|
||||
<div class="system-prompt-header">System Prompt</div>
|
||||
<div class="system-prompt-content">You are an expert coding assistant. You help users with coding tasks by reading files, executing commands, editing code, and writing new files.
|
||||
|
||||
Available tools:
|
||||
- read: Read file contents
|
||||
- bash: Execute bash commands (ls, grep, find, etc.)
|
||||
- edit: Make surgical edits to files (find exact text and replace)
|
||||
- write: Create or overwrite files
|
||||
|
||||
Guidelines:
|
||||
- Use bash for file operations like ls, grep, find
|
||||
- Use read to examine files before editing. You must use this tool instead of cat or sed.
|
||||
- Use edit for precise changes (old text must match exactly)
|
||||
- Use write only for new files or complete rewrites
|
||||
- When summarizing your actions, output plain text directly - do NOT use cat or bash to display what you did
|
||||
- Be concise in your responses
|
||||
- Show file paths clearly when working with files
|
||||
|
||||
Documentation:
|
||||
- Main documentation: /Users/badlogic/workspaces/pi-mono/packages/coding-agent/README.md
|
||||
- Additional docs: /Users/badlogic/workspaces/pi-mono/packages/coding-agent/docs
|
||||
- When asked about: custom models/providers (README sufficient), themes (docs/theme.md), skills (docs/skills.md), hooks (docs/hooks.md), custom tools (docs/custom-tools.md), RPC (docs/rpc.md)
|
||||
|
||||
# Project Context
|
||||
|
||||
The following project context files have been loaded:
|
||||
|
||||
## /Users/badlogic/workspaces/pi-mono/AGENTS.md
|
||||
|
||||
# Development Rules
|
||||
|
||||
## First Message
|
||||
If the user did not give you a concrete task in their first message,
|
||||
read README.md, then ask which module(s) to work on. Based on the answer, read the relevant README.md files in parallel.
|
||||
- packages/ai/README.md
|
||||
- packages/tui/README.md
|
||||
- packages/agent/README.md
|
||||
- packages/coding-agent/README.md
|
||||
- packages/mom/README.md
|
||||
- packages/pods/README.md
|
||||
- packages/web-ui/README.md
|
||||
|
||||
## Code Quality
|
||||
- No `any` types unless absolutely necessary
|
||||
- Check node_modules for external API type definitions instead of guessing
|
||||
- **NEVER use inline imports** - no `await import("./foo.js")`, no `import("pkg").Type` in type positions, no dynamic imports for types. Always use standard top-level imports.
|
||||
- NEVER remove or downgrade code to fix type errors from outdated dependencies; upgrade the dependency instead
|
||||
- Always ask before removing functionality or code that appears to be intentional
|
||||
|
||||
## Commands
|
||||
- After code changes: `npm run check` (get full output, no tail)
|
||||
- NEVER run: `npm run dev`, `npm run build`, `npm test`
|
||||
- Only run specific tests if user instructs: `npm test -- test/specific.test.ts`
|
||||
- NEVER commit unless user asks
|
||||
|
||||
## GitHub Issues
|
||||
When reading issues:
|
||||
- Always read all comments on the issue
|
||||
|
||||
When creating issues:
|
||||
- Add `pkg:*` labels to indicate which package(s) the issue affects
|
||||
- Available labels: `pkg:agent`, `pkg:ai`, `pkg:coding-agent`, `pkg:mom`, `pkg:pods`, `pkg:tui`, `pkg:web-ui`
|
||||
- If an issue spans multiple packages, add all relevant labels
|
||||
|
||||
When closing issues via commit:
|
||||
- Include `fixes #<number>` or `closes #<number>` in the commit message
|
||||
- This automatically closes the issue when the commit is merged
|
||||
|
||||
## Tools
|
||||
- GitHub CLI for issues/PRs
|
||||
- Add package labels to issues/PRs: pkg:agent, pkg:ai, pkg:coding-agent, pkg:mom, pkg:pods, pkg:tui, pkg:web-ui
|
||||
- TUI interaction: use tmux
|
||||
|
||||
## Style
|
||||
- Keep answers short and concise
|
||||
- No emojis in commits, issues, PR comments, or code
|
||||
- No fluff or cheerful filler text
|
||||
- Technical prose only, be kind but direct (e.g., "Thanks @user" not "Thanks so much @user!")
|
||||
|
||||
## Changelog
|
||||
Location: `packages/*/CHANGELOG.md` (each package has its own)
|
||||
|
||||
### Format
|
||||
Use these sections under `## [Unreleased]`:
|
||||
- `### Breaking Changes` - API changes requiring migration
|
||||
- `### Added` - New features
|
||||
- `### Changed` - Changes to existing functionality
|
||||
- `### Fixed` - Bug fixes
|
||||
- `### Removed` - Removed features
|
||||
|
||||
### Rules
|
||||
- New entries ALWAYS go under `## [Unreleased]` section
|
||||
- NEVER modify already-released version sections (e.g., `## [0.12.2]`)
|
||||
- Each version section is immutable once released
|
||||
|
||||
### Attribution
|
||||
- **Internal changes (from issues)**: `Fixed foo bar ([#123](https://github.com/badlogic/pi-mono/issues/123))`
|
||||
- **External contributions**: `Added feature X ([#456](https://github.com/badlogic/pi-mono/pull/456) by [@username](https://github.com/username))`
|
||||
|
||||
## Releasing
|
||||
|
||||
1. **Update CHANGELOGs**: Ensure all changes since last release are documented in the `[Unreleased]` section of each affected package's CHANGELOG.md
|
||||
|
||||
2. **Run release script**:
|
||||
```bash
|
||||
npm run release:patch # Bug fixes
|
||||
npm run release:minor # New features
|
||||
npm run release:major # Breaking changes
|
||||
```
|
||||
|
||||
The script handles: version bump, CHANGELOG finalization, commit, tag, publish, and adding new `[Unreleased]` sections.
|
||||
|
||||
### Tool Usage
|
||||
**CTRICIAL**: NEVER use sed/cat to read a file or a range of a file. Always use the read tool (use offset + limit for ranged reads).
|
||||
|
||||
|
||||
Current date and time: Sunday, December 28, 2025 at 07:08:12 PM GMT+1
|
||||
Current working directory: /Users/badlogic/workspaces/pi-mono/packages/coding-agent</div>
|
||||
</div>
|
||||
<div class="tools-list">
|
||||
<div class="tools-header">Available Tools</div>
|
||||
<div class="tools-content">
|
||||
<div class="tool-item"><span class="tool-item-name">read</span> - Read the contents of a file. Supports text files and images (jpg, png, gif, webp). Images are sent as attachments. For text files, output is truncated to 2000 lines or 50KB (whichever is hit first). Use offset/limit for large files.</div><div class="tool-item"><span class="tool-item-name">bash</span> - Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.</div><div class="tool-item"><span class="tool-item-name">edit</span> - Edit a file by replacing exact text. The oldText must match exactly (including whitespace). Use this for precise, surgical edits.</div><div class="tool-item"><span class="tool-item-name">write</span> - Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="messages">
|
||||
<div class="user-message"><div class="message-timestamp">07:08:12 PM</div><div class="markdown-content"><p>Hello</p>
|
||||
</div></div><div class="assistant-message"><div class="message-timestamp">07:08:12 PM</div><div class="assistant-text markdown-content"><p>Hello! I'm Claude Code, ready to help with coding tasks in this pi-mono project.</p>
|
||||
<p>Since you haven't given me a specific task yet, let me first read the main README to understand the project structure:</p>
|
||||
</div><div class="tool-execution" style="background-color: rgb(40, 50, 40)"><div class="tool-header"><span class="tool-name">read</span> <span class="tool-path">~/workspaces/pi-mono/README.md</span></div><div class="tool-output expandable" onclick="this.classList.toggle('expanded')"><div class="output-preview"><pre><code class="hljs"><span class="hljs-section"># Pi Monorepo</span>
|
||||
|
||||
Tools for building AI agents and managing LLM deployments.
|
||||
|
||||
<span class="hljs-section">## Packages</span>
|
||||
|
||||
| Package | Description |
|
||||
|---------|-------------|
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-ai</span>](<span class="hljs-link">packages/ai</span>)**</span> | Unified multi-provider LLM API (OpenAI, Anthropic, Google, etc.) |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-agent-core</span>](<span class="hljs-link">packages/agent</span>)**</span> | Agent runtime with tool calling and state management |</code></pre><div class="expand-hint">... (78 more lines) - click to expand</div></div><div class="output-full"><pre><code class="hljs"><span class="hljs-section"># Pi Monorepo</span>
|
||||
|
||||
Tools for building AI agents and managing LLM deployments.
|
||||
|
||||
<span class="hljs-section">## Packages</span>
|
||||
|
||||
| Package | Description |
|
||||
|---------|-------------|
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-ai</span>](<span class="hljs-link">packages/ai</span>)**</span> | Unified multi-provider LLM API (OpenAI, Anthropic, Google, etc.) |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-agent-core</span>](<span class="hljs-link">packages/agent</span>)**</span> | Agent runtime with tool calling and state management |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-coding-agent</span>](<span class="hljs-link">packages/coding-agent</span>)**</span> | Interactive coding agent CLI |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-mom</span>](<span class="hljs-link">packages/mom</span>)**</span> | Slack bot that delegates messages to the pi coding agent |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-tui</span>](<span class="hljs-link">packages/tui</span>)**</span> | Terminal UI library with differential rendering |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-web-ui</span>](<span class="hljs-link">packages/web-ui</span>)**</span> | Web components for AI chat interfaces |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-pods</span>](<span class="hljs-link">packages/pods</span>)**</span> | CLI for managing vLLM deployments on GPU pods |
|
||||
|
||||
<span class="hljs-section">## Development</span>
|
||||
|
||||
<span class="hljs-section">### Setup</span>
|
||||
|
||||
<span class="hljs-code">```bash
|
||||
npm install # Install all dependencies
|
||||
npm run build # Build all packages
|
||||
npm run check # Lint, format, and type check
|
||||
```</span>
|
||||
|
||||
<span class="hljs-quote">> <span class="hljs-strong">**Note:**</span> `npm run check` requires `npm run build` to be run first. The web-ui package uses `tsc` which needs compiled `.d.ts` files from dependencies.</span>
|
||||
|
||||
<span class="hljs-section">### CI</span>
|
||||
|
||||
GitHub Actions runs on push to <span class="hljs-code">`main`</span> and on pull requests. The workflow runs <span class="hljs-code">`npm run check`</span> and <span class="hljs-code">`npm run test`</span> for each package in parallel.
|
||||
|
||||
<span class="hljs-strong">**Do not add LLM API keys as secrets to this repository.**</span> Tests that require LLM access use <span class="hljs-code">`describe.skipIf()`</span> to skip when API keys are missing. This is intentional:
|
||||
|
||||
<span class="hljs-bullet">-</span> PRs from external contributors would have access to secrets in the CI environment
|
||||
<span class="hljs-bullet">-</span> Malicious PR code could exfiltrate API keys
|
||||
<span class="hljs-bullet">-</span> Tests that need LLM calls are skipped on CI and run locally by developers who have keys configured
|
||||
|
||||
If you need to run LLM-dependent tests, run them locally with your own API keys.
|
||||
|
||||
<span class="hljs-section">### Development</span>
|
||||
|
||||
Start watch builds for all packages:
|
||||
<span class="hljs-code">```bash
|
||||
npm run dev
|
||||
```</span>
|
||||
|
||||
Then run with tsx:
|
||||
<span class="hljs-code">```bash
|
||||
cd packages/coding-agent && npx tsx src/cli.ts
|
||||
cd packages/pods && npx tsx src/cli.ts
|
||||
```</span>
|
||||
|
||||
<span class="hljs-section">### Versioning (Lockstep)</span>
|
||||
|
||||
<span class="hljs-strong">**All packages MUST always have the same version number.**</span> Use these commands to bump versions:
|
||||
|
||||
<span class="hljs-code">```bash
|
||||
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
|
||||
```</span>
|
||||
|
||||
These commands:
|
||||
<span class="hljs-bullet">1.</span> Update all package versions to the same number
|
||||
<span class="hljs-bullet">2.</span> Update inter-package dependency versions (e.g., <span class="hljs-code">`pi-agent`</span> depends on <span class="hljs-code">`pi-ai@^0.7.7`</span>)
|
||||
<span class="hljs-bullet">3.</span> Update <span class="hljs-code">`package-lock.json`</span>
|
||||
|
||||
<span class="hljs-strong">**Never manually edit version numbers.**</span> The lockstep system ensures consistency across the monorepo.
|
||||
|
||||
<span class="hljs-section">### Publishing</span>
|
||||
|
||||
<span class="hljs-code">```bash
|
||||
npm run release:patch # Bug fixes
|
||||
npm run release:minor # New features
|
||||
npm run release:major # Breaking changes
|
||||
```</span>
|
||||
|
||||
This handles version bump, CHANGELOG updates, commit, tag, publish, and push.
|
||||
|
||||
<span class="hljs-strong">**NPM Token Setup**</span>: Requires a granular access token with "Bypass 2FA on publish" enabled.
|
||||
<span class="hljs-bullet">-</span> Go to https://www.npmjs.com/settings/badlogic/tokens/
|
||||
<span class="hljs-bullet">-</span> Create a new "Granular Access Token" with "Bypass 2FA on publish"
|
||||
<span class="hljs-bullet">-</span> Set the token: <span class="hljs-code">`npm config set //registry.npmjs.org/:_authToken=YOUR_TOKEN`</span>
|
||||
|
||||
<span class="hljs-section">## License</span>
|
||||
|
||||
MIT</code></pre></div></div></div></div><div class="assistant-message"><div class="message-timestamp">07:08:16 PM</div><div class="assistant-text markdown-content"><p>Great! I can see this is a monorepo for building AI agents and managing LLM deployments with several packages. </p>
|
||||
<p>Which module(s) would you like to work on?</p>
|
||||
<ul>
|
||||
<li><strong>@mariozechner/pi-ai</strong> - Unified multi-provider LLM API</li>
|
||||
<li><strong>@mariozechner/pi-agent-core</strong> - Agent runtime with tool calling</li>
|
||||
<li><strong>@mariozechner/pi-coding-agent</strong> - Interactive coding agent CLI (current directory)</li>
|
||||
<li><strong>@mariozechner/pi-mom</strong> - Slack bot integration</li>
|
||||
<li><strong>@mariozechner/pi-tui</strong> - Terminal UI library</li>
|
||||
<li><strong>@mariozechner/pi-web-ui</strong> - Web components for chat interfaces</li>
|
||||
<li><strong>@mariozechner/pi-pods</strong> - vLLM deployment CLI</li>
|
||||
</ul>
|
||||
</div></div>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
Generated by pi coding-agent on 12/28/2025, 7:08:19 PM
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,495 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Session Export - 2025-12-28T19-05-42-296Z_7225b2a7-7612-440d-84f1-fbcd8037d2f2.jsonl</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
color: rgb(229, 229, 231);
|
||||
background: rgb(24, 24, 30);
|
||||
padding: 24px;
|
||||
}
|
||||
.container { max-width: 700px; margin: 0 auto; }
|
||||
.header {
|
||||
margin-bottom: 24px;
|
||||
padding: 16px;
|
||||
background: rgb(30, 30, 36);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.header h1 {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 12px;
|
||||
color: rgb(0, 215, 255);
|
||||
}
|
||||
.header-info { display: flex; flex-direction: column; gap: 3px; font-size: 11px; }
|
||||
.info-item { color: rgb(102, 102, 102); display: flex; align-items: baseline; }
|
||||
.info-label { font-weight: 600; margin-right: 8px; min-width: 100px; }
|
||||
.info-value { color: rgb(229, 229, 231); flex: 1; }
|
||||
.info-value.cost { font-family: 'SF Mono', monospace; }
|
||||
.messages { display: flex; flex-direction: column; gap: 16px; }
|
||||
.message-timestamp { font-size: 10px; color: rgb(102, 102, 102); margin-bottom: 4px; opacity: 0.8; }
|
||||
.user-message {
|
||||
background: rgb(52, 53, 65);
|
||||
color: rgb(229, 229, 231);
|
||||
padding: 12px 16px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.assistant-message { padding: 0; }
|
||||
.assistant-text, .thinking-text {
|
||||
padding: 12px 16px;
|
||||
}
|
||||
.thinking-text { color: rgb(102, 102, 102); font-style: italic; white-space: pre-wrap; }
|
||||
.model-change { padding: 8px 16px; background: rgb(40, 40, 50); border-radius: 4px; }
|
||||
.model-change-text { color: rgb(102, 102, 102); font-size: 11px; }
|
||||
.model-name { color: rgb(0, 215, 255); font-weight: bold; }
|
||||
.compaction-container { background: rgb(60, 55, 35); border-radius: 4px; overflow: hidden; }
|
||||
.compaction-header { padding: 12px 16px; cursor: pointer; }
|
||||
.compaction-header:hover { background: rgba(255, 255, 255, 0.05); }
|
||||
.compaction-header-row { display: flex; align-items: center; gap: 8px; }
|
||||
.compaction-toggle { color: rgb(0, 215, 255); font-size: 10px; transition: transform 0.2s; }
|
||||
.compaction-container.expanded .compaction-toggle { transform: rotate(90deg); }
|
||||
.compaction-title { color: rgb(229, 229, 231); font-weight: bold; }
|
||||
.compaction-hint { color: rgb(102, 102, 102); font-size: 11px; }
|
||||
.compaction-content { display: none; padding: 0 16px 16px 16px; }
|
||||
.compaction-container.expanded .compaction-content { display: block; }
|
||||
.compaction-summary { background: rgba(0, 0, 0, 0.1); border-radius: 4px; padding: 12px; }
|
||||
.compaction-summary-header { font-weight: bold; color: rgb(0, 215, 255); margin-bottom: 8px; font-size: 11px; }
|
||||
.compaction-summary-content { color: rgb(229, 229, 231); white-space: pre-wrap; word-wrap: break-word; }
|
||||
.tool-execution { padding: 12px 16px; border-radius: 4px; margin-top: 8px; }
|
||||
.tool-execution.user-bash { background: rgb(50, 48, 35); }
|
||||
.tool-execution.user-bash-error { background: rgb(60, 45, 35); }
|
||||
.tool-header, .tool-name { font-weight: bold; }
|
||||
.tool-path { color: rgb(0, 215, 255); word-break: break-all; }
|
||||
.line-numbers { color: rgb(255, 255, 0); }
|
||||
.line-count { color: rgb(102, 102, 102); }
|
||||
.tool-command { font-weight: bold; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; }
|
||||
.tool-output {
|
||||
margin-top: 12px;
|
||||
color: rgb(128, 128, 128);
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
word-break: break-word;
|
||||
font-family: inherit;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.tool-output > div { line-height: 1.4; }
|
||||
.tool-output pre { margin: 0; font-family: inherit; color: inherit; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }
|
||||
.tool-output.expandable { cursor: pointer; }
|
||||
.tool-output.expandable:hover { opacity: 0.9; }
|
||||
.tool-output.expandable .output-full { display: none; }
|
||||
.tool-output.expandable.expanded .output-preview { display: none; }
|
||||
.tool-output.expandable.expanded .output-full { display: block; }
|
||||
.expand-hint { color: rgb(0, 215, 255); font-style: italic; margin-top: 4px; }
|
||||
.system-prompt, .tools-list { background: rgb(60, 55, 40); padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
|
||||
.system-prompt-header, .tools-header { font-weight: bold; color: rgb(255, 255, 0); margin-bottom: 8px; }
|
||||
.system-prompt-content, .tools-content { color: rgb(102, 102, 102); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; font-size: 11px; }
|
||||
.tool-item { margin: 4px 0; }
|
||||
.tool-item-name { font-weight: bold; color: rgb(229, 229, 231); }
|
||||
.tool-diff { margin-top: 12px; font-size: 11px; font-family: inherit; overflow-x: auto; max-width: 100%; }
|
||||
.diff-line-old { color: rgb(204, 102, 102); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }
|
||||
.diff-line-new { color: rgb(181, 189, 104); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }
|
||||
.diff-line-context { color: rgb(128, 128, 128); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }
|
||||
.error-text { color: rgb(204, 102, 102); padding: 12px 16px; }
|
||||
.bash-status.warning { color: rgb(255, 255, 0); }
|
||||
.bash-status.error { color: rgb(204, 102, 102); }
|
||||
.bash-truncation.warning { color: rgb(255, 255, 0); }
|
||||
.footer { margin-top: 48px; padding: 20px; text-align: center; color: rgb(102, 102, 102); font-size: 10px; }
|
||||
.streaming-notice { background: rgb(50, 45, 35); padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; color: rgb(102, 102, 102); font-size: 11px; }
|
||||
|
||||
/* Image styles */
|
||||
.message-images { margin-bottom: 12px; }
|
||||
.message-image { max-width: 100%; max-height: 400px; border-radius: 4px; margin: 4px 0; }
|
||||
|
||||
/* Markdown styles */
|
||||
.markdown-content h1, .markdown-content h2, .markdown-content h3,
|
||||
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
|
||||
color: rgb(240, 198, 116);
|
||||
margin: 1em 0 0.5em 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
.markdown-content h1 { font-size: 1.4em; text-decoration: underline; }
|
||||
.markdown-content h2 { font-size: 1.2em; }
|
||||
.markdown-content h3 { font-size: 1.1em; }
|
||||
.markdown-content p { margin: 0.5em 0; }
|
||||
.markdown-content a { color: rgb(129, 162, 190); text-decoration: underline; }
|
||||
.markdown-content a:hover { opacity: 0.8; }
|
||||
.markdown-content code {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: rgb(138, 190, 183);
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
font-family: inherit;
|
||||
}
|
||||
.markdown-content pre {
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 0;
|
||||
margin: 0.5em 0;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.markdown-content pre code {
|
||||
display: block;
|
||||
background: none;
|
||||
color: rgb(181, 189, 104);
|
||||
padding: 8px 12px;
|
||||
}
|
||||
.code-block-wrapper {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
.code-block-header {
|
||||
color: rgb(128, 128, 128);
|
||||
font-size: 11px;
|
||||
}
|
||||
.code-block-footer {
|
||||
color: rgb(128, 128, 128);
|
||||
font-size: 11px;
|
||||
}
|
||||
.markdown-content blockquote {
|
||||
border-left: 3px solid rgb(128, 128, 128);
|
||||
padding-left: 12px;
|
||||
margin: 0.5em 0;
|
||||
color: rgb(128, 128, 128);
|
||||
font-style: italic;
|
||||
}
|
||||
.markdown-content ul, .markdown-content ol {
|
||||
margin: 0.5em 0;
|
||||
padding-left: 24px;
|
||||
}
|
||||
.markdown-content li { margin: 0.25em 0; }
|
||||
.markdown-content li::marker { color: rgb(138, 190, 183); }
|
||||
.markdown-content hr {
|
||||
border: none;
|
||||
border-top: 1px solid rgb(128, 128, 128);
|
||||
margin: 1em 0;
|
||||
}
|
||||
.markdown-content table {
|
||||
border-collapse: collapse;
|
||||
margin: 0.5em 0;
|
||||
width: 100%;
|
||||
}
|
||||
.markdown-content th, .markdown-content td {
|
||||
border: 1px solid rgb(128, 128, 128);
|
||||
padding: 6px 10px;
|
||||
text-align: left;
|
||||
}
|
||||
.markdown-content th {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
font-weight: bold;
|
||||
}
|
||||
.markdown-content img {
|
||||
max-width: 100%;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Syntax highlighting (highlight.js) */
|
||||
.hljs { background: transparent; }
|
||||
.hljs-comment, .hljs-quote { color: rgb(106, 153, 85); }
|
||||
.hljs-keyword, .hljs-selector-tag, .hljs-addition { color: rgb(86, 156, 214); }
|
||||
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: rgb(181, 206, 168); }
|
||||
.hljs-string, .hljs-doctag, .hljs-regexp { color: rgb(206, 145, 120); }
|
||||
.hljs-title, .hljs-section, .hljs-name, .hljs-selector-id, .hljs-selector-class { color: rgb(220, 220, 170); }
|
||||
.hljs-type, .hljs-class, .hljs-built_in { color: rgb(78, 201, 176); }
|
||||
.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-params { color: rgb(156, 220, 254); }
|
||||
.hljs-attribute { color: rgb(156, 220, 254); }
|
||||
.hljs-meta { color: rgb(86, 156, 214); }
|
||||
.hljs-formula { background: rgba(255, 255, 255, 0.05); }
|
||||
.hljs-deletion { color: rgb(204, 102, 102); }
|
||||
.hljs-emphasis { font-style: italic; }
|
||||
.hljs-strong { font-weight: bold; }
|
||||
.hljs-link { color: rgb(129, 162, 190); text-decoration: underline; }
|
||||
|
||||
@media print { body { background: white; color: black; } .tool-execution { border: 1px solid #ddd; } }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>pi v0.30.2</h1>
|
||||
<div class="header-info">
|
||||
<div class="info-item"><span class="info-label">Session:</span><span class="info-value">7225b2a7-7612-440d-84f1-fbcd8037d2f2</span></div>
|
||||
<div class="info-item"><span class="info-label">Date:</span><span class="info-value">12/28/2025, 8:05:42 PM</span></div>
|
||||
<div class="info-item"><span class="info-label">Models:</span><span class="info-value">unknown</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<h1>Messages</h1>
|
||||
<div class="header-info">
|
||||
<div class="info-item"><span class="info-label">User:</span><span class="info-value">1</span></div>
|
||||
<div class="info-item"><span class="info-label">Assistant:</span><span class="info-value">2</span></div>
|
||||
<div class="info-item"><span class="info-label">Tool Calls:</span><span class="info-value">1</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<h1>Tokens & Cost</h1>
|
||||
<div class="header-info">
|
||||
<div class="info-item"><span class="info-label">Input:</span><span class="info-value">9 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Output:</span><span class="info-value">269 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Cache Read:</span><span class="info-value">2,462 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Cache Write:</span><span class="info-value">3,470 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Total:</span><span class="info-value">6,210 tokens</span></div>
|
||||
<div class="info-item"><span class="info-label">Input Cost:</span><span class="info-value cost">$0.0000</span></div>
|
||||
<div class="info-item"><span class="info-label">Output Cost:</span><span class="info-value cost">$0.0040</span></div>
|
||||
<div class="info-item"><span class="info-label">Cache Read Cost:</span><span class="info-value cost">$0.0007</span></div>
|
||||
<div class="info-item"><span class="info-label">Cache Write Cost:</span><span class="info-value cost">$0.0130</span></div>
|
||||
<div class="info-item"><span class="info-label">Total Cost:</span><span class="info-value cost"><strong>$0.0178</strong></span></div>
|
||||
<div class="info-item"><span class="info-label">Context Usage:</span><span class="info-value">3,648 / 200,000 tokens (1.8%) - anthropic/claude-sonnet-4-5</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="system-prompt">
|
||||
<div class="system-prompt-header">System Prompt</div>
|
||||
<div class="system-prompt-content">You are an expert coding assistant. You help users with coding tasks by reading files, executing commands, editing code, and writing new files.
|
||||
|
||||
Available tools:
|
||||
- read: Read file contents
|
||||
- bash: Execute bash commands (ls, grep, find, etc.)
|
||||
- edit: Make surgical edits to files (find exact text and replace)
|
||||
- write: Create or overwrite files
|
||||
|
||||
Guidelines:
|
||||
- Use bash for file operations like ls, grep, find
|
||||
- Use read to examine files before editing. You must use this tool instead of cat or sed.
|
||||
- Use edit for precise changes (old text must match exactly)
|
||||
- Use write only for new files or complete rewrites
|
||||
- When summarizing your actions, output plain text directly - do NOT use cat or bash to display what you did
|
||||
- Be concise in your responses
|
||||
- Show file paths clearly when working with files
|
||||
|
||||
Documentation:
|
||||
- Main documentation: /Users/badlogic/workspaces/pi-mono/packages/coding-agent/README.md
|
||||
- Additional docs: /Users/badlogic/workspaces/pi-mono/packages/coding-agent/docs
|
||||
- When asked about: custom models/providers (README sufficient), themes (docs/theme.md), skills (docs/skills.md), hooks (docs/hooks.md), custom tools (docs/custom-tools.md), RPC (docs/rpc.md)
|
||||
|
||||
# Project Context
|
||||
|
||||
The following project context files have been loaded:
|
||||
|
||||
## /Users/badlogic/workspaces/pi-mono/AGENTS.md
|
||||
|
||||
# Development Rules
|
||||
|
||||
## First Message
|
||||
If the user did not give you a concrete task in their first message,
|
||||
read README.md, then ask which module(s) to work on. Based on the answer, read the relevant README.md files in parallel.
|
||||
- packages/ai/README.md
|
||||
- packages/tui/README.md
|
||||
- packages/agent/README.md
|
||||
- packages/coding-agent/README.md
|
||||
- packages/mom/README.md
|
||||
- packages/pods/README.md
|
||||
- packages/web-ui/README.md
|
||||
|
||||
## Code Quality
|
||||
- No `any` types unless absolutely necessary
|
||||
- Check node_modules for external API type definitions instead of guessing
|
||||
- **NEVER use inline imports** - no `await import("./foo.js")`, no `import("pkg").Type` in type positions, no dynamic imports for types. Always use standard top-level imports.
|
||||
- NEVER remove or downgrade code to fix type errors from outdated dependencies; upgrade the dependency instead
|
||||
- Always ask before removing functionality or code that appears to be intentional
|
||||
|
||||
## Commands
|
||||
- After code changes: `npm run check` (get full output, no tail)
|
||||
- NEVER run: `npm run dev`, `npm run build`, `npm test`
|
||||
- Only run specific tests if user instructs: `npm test -- test/specific.test.ts`
|
||||
- NEVER commit unless user asks
|
||||
|
||||
## GitHub Issues
|
||||
When reading issues:
|
||||
- Always read all comments on the issue
|
||||
|
||||
When creating issues:
|
||||
- Add `pkg:*` labels to indicate which package(s) the issue affects
|
||||
- Available labels: `pkg:agent`, `pkg:ai`, `pkg:coding-agent`, `pkg:mom`, `pkg:pods`, `pkg:tui`, `pkg:web-ui`
|
||||
- If an issue spans multiple packages, add all relevant labels
|
||||
|
||||
When closing issues via commit:
|
||||
- Include `fixes #<number>` or `closes #<number>` in the commit message
|
||||
- This automatically closes the issue when the commit is merged
|
||||
|
||||
## Tools
|
||||
- GitHub CLI for issues/PRs
|
||||
- Add package labels to issues/PRs: pkg:agent, pkg:ai, pkg:coding-agent, pkg:mom, pkg:pods, pkg:tui, pkg:web-ui
|
||||
- TUI interaction: use tmux
|
||||
|
||||
## Style
|
||||
- Keep answers short and concise
|
||||
- No emojis in commits, issues, PR comments, or code
|
||||
- No fluff or cheerful filler text
|
||||
- Technical prose only, be kind but direct (e.g., "Thanks @user" not "Thanks so much @user!")
|
||||
|
||||
## Changelog
|
||||
Location: `packages/*/CHANGELOG.md` (each package has its own)
|
||||
|
||||
### Format
|
||||
Use these sections under `## [Unreleased]`:
|
||||
- `### Breaking Changes` - API changes requiring migration
|
||||
- `### Added` - New features
|
||||
- `### Changed` - Changes to existing functionality
|
||||
- `### Fixed` - Bug fixes
|
||||
- `### Removed` - Removed features
|
||||
|
||||
### Rules
|
||||
- New entries ALWAYS go under `## [Unreleased]` section
|
||||
- NEVER modify already-released version sections (e.g., `## [0.12.2]`)
|
||||
- Each version section is immutable once released
|
||||
|
||||
### Attribution
|
||||
- **Internal changes (from issues)**: `Fixed foo bar ([#123](https://github.com/badlogic/pi-mono/issues/123))`
|
||||
- **External contributions**: `Added feature X ([#456](https://github.com/badlogic/pi-mono/pull/456) by [@username](https://github.com/username))`
|
||||
|
||||
## Releasing
|
||||
|
||||
1. **Update CHANGELOGs**: Ensure all changes since last release are documented in the `[Unreleased]` section of each affected package's CHANGELOG.md
|
||||
|
||||
2. **Run release script**:
|
||||
```bash
|
||||
npm run release:patch # Bug fixes
|
||||
npm run release:minor # New features
|
||||
npm run release:major # Breaking changes
|
||||
```
|
||||
|
||||
The script handles: version bump, CHANGELOG finalization, commit, tag, publish, and adding new `[Unreleased]` sections.
|
||||
|
||||
### Tool Usage
|
||||
**CTRICIAL**: NEVER use sed/cat to read a file or a range of a file. Always use the read tool (use offset + limit for ranged reads).
|
||||
|
||||
|
||||
Current date and time: Sunday, December 28, 2025 at 08:05:42 PM GMT+1
|
||||
Current working directory: /Users/badlogic/workspaces/pi-mono/packages/coding-agent</div>
|
||||
</div>
|
||||
<div class="tools-list">
|
||||
<div class="tools-header">Available Tools</div>
|
||||
<div class="tools-content">
|
||||
<div class="tool-item"><span class="tool-item-name">read</span> - Read the contents of a file. Supports text files and images (jpg, png, gif, webp). Images are sent as attachments. For text files, output is truncated to 2000 lines or 50KB (whichever is hit first). Use offset/limit for large files.</div><div class="tool-item"><span class="tool-item-name">bash</span> - Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.</div><div class="tool-item"><span class="tool-item-name">edit</span> - Edit a file by replacing exact text. The oldText must match exactly (including whitespace). Use this for precise, surgical edits.</div><div class="tool-item"><span class="tool-item-name">write</span> - Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="messages">
|
||||
<div class="user-message"><div class="message-timestamp">08:05:42 PM</div><div class="markdown-content"><p>Hello</p>
|
||||
</div></div><div class="assistant-message"><div class="message-timestamp">08:05:42 PM</div><div class="assistant-text markdown-content"><p>Hello! I see you haven't given me a specific task yet. Let me start by reading the main README to understand the project structure.</p>
|
||||
</div><div class="tool-execution" style="background-color: rgb(40, 50, 40)"><div class="tool-header"><span class="tool-name">read</span> <span class="tool-path">~/workspaces/pi-mono/README.md</span></div><div class="tool-output expandable" onclick="this.classList.toggle('expanded')"><div class="output-preview"><pre><code class="hljs"><span class="hljs-section"># Pi Monorepo</span>
|
||||
|
||||
Tools for building AI agents and managing LLM deployments.
|
||||
|
||||
<span class="hljs-section">## Packages</span>
|
||||
|
||||
| Package | Description |
|
||||
|---------|-------------|
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-ai</span>](<span class="hljs-link">packages/ai</span>)**</span> | Unified multi-provider LLM API (OpenAI, Anthropic, Google, etc.) |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-agent-core</span>](<span class="hljs-link">packages/agent</span>)**</span> | Agent runtime with tool calling and state management |</code></pre><div class="expand-hint">... (78 more lines) - click to expand</div></div><div class="output-full"><pre><code class="hljs"><span class="hljs-section"># Pi Monorepo</span>
|
||||
|
||||
Tools for building AI agents and managing LLM deployments.
|
||||
|
||||
<span class="hljs-section">## Packages</span>
|
||||
|
||||
| Package | Description |
|
||||
|---------|-------------|
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-ai</span>](<span class="hljs-link">packages/ai</span>)**</span> | Unified multi-provider LLM API (OpenAI, Anthropic, Google, etc.) |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-agent-core</span>](<span class="hljs-link">packages/agent</span>)**</span> | Agent runtime with tool calling and state management |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-coding-agent</span>](<span class="hljs-link">packages/coding-agent</span>)**</span> | Interactive coding agent CLI |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-mom</span>](<span class="hljs-link">packages/mom</span>)**</span> | Slack bot that delegates messages to the pi coding agent |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-tui</span>](<span class="hljs-link">packages/tui</span>)**</span> | Terminal UI library with differential rendering |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-web-ui</span>](<span class="hljs-link">packages/web-ui</span>)**</span> | Web components for AI chat interfaces |
|
||||
| <span class="hljs-strong">**[<span class="hljs-string">@mariozechner/pi-pods</span>](<span class="hljs-link">packages/pods</span>)**</span> | CLI for managing vLLM deployments on GPU pods |
|
||||
|
||||
<span class="hljs-section">## Development</span>
|
||||
|
||||
<span class="hljs-section">### Setup</span>
|
||||
|
||||
<span class="hljs-code">```bash
|
||||
npm install # Install all dependencies
|
||||
npm run build # Build all packages
|
||||
npm run check # Lint, format, and type check
|
||||
```</span>
|
||||
|
||||
<span class="hljs-quote">> <span class="hljs-strong">**Note:**</span> `npm run check` requires `npm run build` to be run first. The web-ui package uses `tsc` which needs compiled `.d.ts` files from dependencies.</span>
|
||||
|
||||
<span class="hljs-section">### CI</span>
|
||||
|
||||
GitHub Actions runs on push to <span class="hljs-code">`main`</span> and on pull requests. The workflow runs <span class="hljs-code">`npm run check`</span> and <span class="hljs-code">`npm run test`</span> for each package in parallel.
|
||||
|
||||
<span class="hljs-strong">**Do not add LLM API keys as secrets to this repository.**</span> Tests that require LLM access use <span class="hljs-code">`describe.skipIf()`</span> to skip when API keys are missing. This is intentional:
|
||||
|
||||
<span class="hljs-bullet">-</span> PRs from external contributors would have access to secrets in the CI environment
|
||||
<span class="hljs-bullet">-</span> Malicious PR code could exfiltrate API keys
|
||||
<span class="hljs-bullet">-</span> Tests that need LLM calls are skipped on CI and run locally by developers who have keys configured
|
||||
|
||||
If you need to run LLM-dependent tests, run them locally with your own API keys.
|
||||
|
||||
<span class="hljs-section">### Development</span>
|
||||
|
||||
Start watch builds for all packages:
|
||||
<span class="hljs-code">```bash
|
||||
npm run dev
|
||||
```</span>
|
||||
|
||||
Then run with tsx:
|
||||
<span class="hljs-code">```bash
|
||||
cd packages/coding-agent && npx tsx src/cli.ts
|
||||
cd packages/pods && npx tsx src/cli.ts
|
||||
```</span>
|
||||
|
||||
<span class="hljs-section">### Versioning (Lockstep)</span>
|
||||
|
||||
<span class="hljs-strong">**All packages MUST always have the same version number.**</span> Use these commands to bump versions:
|
||||
|
||||
<span class="hljs-code">```bash
|
||||
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
|
||||
```</span>
|
||||
|
||||
These commands:
|
||||
<span class="hljs-bullet">1.</span> Update all package versions to the same number
|
||||
<span class="hljs-bullet">2.</span> Update inter-package dependency versions (e.g., <span class="hljs-code">`pi-agent`</span> depends on <span class="hljs-code">`pi-ai@^0.7.7`</span>)
|
||||
<span class="hljs-bullet">3.</span> Update <span class="hljs-code">`package-lock.json`</span>
|
||||
|
||||
<span class="hljs-strong">**Never manually edit version numbers.**</span> The lockstep system ensures consistency across the monorepo.
|
||||
|
||||
<span class="hljs-section">### Publishing</span>
|
||||
|
||||
<span class="hljs-code">```bash
|
||||
npm run release:patch # Bug fixes
|
||||
npm run release:minor # New features
|
||||
npm run release:major # Breaking changes
|
||||
```</span>
|
||||
|
||||
This handles version bump, CHANGELOG updates, commit, tag, publish, and push.
|
||||
|
||||
<span class="hljs-strong">**NPM Token Setup**</span>: Requires a granular access token with "Bypass 2FA on publish" enabled.
|
||||
<span class="hljs-bullet">-</span> Go to https://www.npmjs.com/settings/badlogic/tokens/
|
||||
<span class="hljs-bullet">-</span> Create a new "Granular Access Token" with "Bypass 2FA on publish"
|
||||
<span class="hljs-bullet">-</span> Set the token: <span class="hljs-code">`npm config set //registry.npmjs.org/:_authToken=YOUR_TOKEN`</span>
|
||||
|
||||
<span class="hljs-section">## License</span>
|
||||
|
||||
MIT</code></pre></div></div></div></div><div class="assistant-message"><div class="message-timestamp">08:05:45 PM</div><div class="assistant-text markdown-content"><p>Great! I can see this is a monorepo with several packages for building AI agents and managing LLM deployments. The main packages are:</p>
|
||||
<ul>
|
||||
<li><strong>pi-ai</strong> - Unified multi-provider LLM API</li>
|
||||
<li><strong>pi-agent-core</strong> - Agent runtime with tool calling and state management</li>
|
||||
<li><strong>pi-coding-agent</strong> - Interactive coding agent CLI (the package we're currently in)</li>
|
||||
<li><strong>pi-mom</strong> - Slack bot that delegates to the coding agent</li>
|
||||
<li><strong>pi-tui</strong> - Terminal UI library</li>
|
||||
<li><strong>pi-web-ui</strong> - Web components for AI chat interfaces</li>
|
||||
<li><strong>pi-pods</strong> - CLI for managing vLLM deployments on GPU pods</li>
|
||||
</ul>
|
||||
<p><strong>Which package(s) would you like to work on today?</strong></p>
|
||||
</div></div>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
Generated by pi coding-agent on 12/28/2025, 8:05:48 PM
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue