16 Commits

  • Add bash mode for executing shell commands
    - Add ! prefix in TUI editor to execute shell commands directly
    - Output streams in real-time and is added to LLM context
    - Supports multiline commands, cancellation (Escape), truncation
    - Preview mode shows last 20 lines, Ctrl+O expands full output
    - Commands persist in session history as bashExecution messages
    - Add bash command to RPC mode via {type:'bash',command:'...'}
    - Add RPC tests for bash command execution and context inclusion
    - Update docs: rpc.md, session.md, README.md, CHANGELOG.md
    
    Closes #112
    
    Co-authored-by: Markus Ylisiurunen <markus.ylisiurunen@gmail.com>
  • Implement tool result truncation with actionable notices (#134)
    - read: actionable notices with offset for continuation
      - First line > 30KB: return empty + bash command suggestion
      - Hit limit: '[Showing lines X-Y of Z. Use offset=N to continue]'
    
    - bash: tail truncation with temp file
      - Notice includes line range + temp file path
      - Edge case: last line > 30KB shows partial
    
    - grep: pre-truncate match lines to 500 chars
      - '[... truncated]' suffix on long lines
      - Notice for match limit and line truncation
    
    - find/ls: result/entry limit notices
      - '[N results limit reached. Use limit=M for more]'
    
    - All notices now in text content (LLM sees them)
    - TUI simplified (notices render as part of output)
    - Never return partial lines (except bash edge case)
  • docs: add under-compaction analysis
    Documents context window overflow scenarios, how OpenCode and Codex
    handle them, and what fixes are needed.
    
    Related to #128
  • fix: normalize OpenAI token counting, add branch source tracking
    pi-ai:
    - Fixed usage.input to exclude cached tokens for OpenAI providers
    - Previously input included cached tokens, causing double-counting
    - Now input + output + cacheRead + cacheWrite correctly gives total context
    
    coding-agent:
    - Session header now includes branchedFrom field for branched sessions
    - Updated compaction.md with refined implementation plan
    - Updated session.md with branchedFrom documentation
  • WIP: Add theming system with /theme command
    - Consolidated theme system into single src/theme/ directory
    - Created Theme class with fg(), bg(), bold(), italic(), underline()
    - Added dark and light built-in themes with 36 color tokens
    - Support for custom themes in ~/.pi/agent/themes/*.json
    - JSON schema for theme validation
    - Theme selector UI with /theme command
    - Save theme preference to settings
    - Uses chalk for text formatting to preserve colors
    
    TODO:
    - Replace hardcoded colors throughout TUI components
    - Apply markdown theming to Markdown components
    - Add theme support to all TUI elements
  • feat(coding-agent): add OAuth authentication for Claude Pro/Max
    - Add /login and /logout commands for OAuth flow
    - OAuth tokens stored in ~/.pi/agent/oauth.json with 0600 permissions
    - Auto-refresh tokens when expired (5min buffer)
    - Priority: OAuth > ANTHROPIC_OAUTH_TOKEN env > ANTHROPIC_API_KEY env
    - Fix model selector async loading and re-render
    - Add bracketed paste support to Input component for long codes
    - Update README.md with OAuth documentation
    - Add implementation docs and testing checklist
  • Fix lockstep versioning and improve documentation
    - Sync all packages to version 0.7.7
    - Rewrite sync-versions.js to handle ALL inter-package dependencies automatically
    - Fix web-ui dependency on pi-ai (was 0.6.0, now 0.7.7)
    - Move agent fix changelog entry to coding-agent CHANGELOG
    - Remove redundant agent CHANGELOG.md
    - Improve README.md with clearer lockstep versioning docs
    - Add /changelog command to display full changelog in TUI (newest last)
    - Fix changelog description (not a scrollable viewer, just displays in chat)
    - Update CHANGELOG for 0.7.7 release