Commit Graph

22 Commits

  • remove mom and pods packages
    People should check out pi-chat (earendil-works/pi-chat on GitHub), or use an older commit for mom and fork.
  • fix(typebox): migrate to v1 with extension compat (#3474)
    * fix(typebox): migrate to v1 with extension compat
    
    Replace AJV-based validation with TypeBox-native validation, keep legacy extension imports working (including @sinclair/typebox/compiler), and restore coercion for serialized/plain JSON schemas.
    
    This change closes #3112.
    
    * fix(typebox): use canonical imports and harden coercion
    
    Switch first-party code to canonical typebox imports while retaining legacy extension aliases in the loader.
    
    Remove obsolete runtime codegen guards, expand serialized JSON-schema coercion coverage, and update related tests and fixtures.
    
    Fixes #3112.
    
    ---------
    
    Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
  • Remove proxy package
    The proxy functionality is now handled by web-ui's createStreamFn
    with external proxy servers.
  • Refactor OAuth/API key handling: AuthStorage and ModelRegistry
    - Add AuthStorage class for credential storage (auth.json)
    - Add ModelRegistry class for model management with API key resolution
    - Add discoverAuthStorage() and discoverModels() discovery functions
    - Add migration from legacy oauth.json and settings.json apiKeys to auth.json
    - Remove configureOAuthStorage, defaultGetApiKey, findModel, discoverAvailableModels
    - Remove apiKeys from Settings type and SettingsManager methods
    - Rename getOAuthPath to getAuthPath
    - Update SDK, examples, docs, tests, and mom package
    
    Fixes #296
  • WIP: Remove global state from pi-ai OAuth/API key handling
    - Remove setApiKey, resolveApiKey, and global apiKeys Map from stream.ts
    - Rename getApiKey to getApiKeyFromEnv (only checks env vars)
    - Remove OAuth storage layer (storage.ts deleted)
    - OAuth login/refresh functions now return credentials instead of saving
    - getOAuthApiKey/refreshOAuthToken now take credentials as params
    - Add test/oauth.ts helper for ai package tests
    - Simplify root npm run check (single biome + tsgo pass)
    - Remove redundant check scripts from most packages
    - Add web-ui and coding-agent examples to biome/tsgo includes
    
    coding-agent still has compile errors - needs refactoring for new API
  • Custom tools with session lifecycle, examples for hooks and tools
    - Custom tools: TypeScript modules that extend pi with new tools
      - Custom TUI rendering via renderCall/renderResult
      - User interaction via pi.ui (select, confirm, input, notify)
      - Session lifecycle via onSession callback for state reconstruction
      - Examples: todo.ts, question.ts, hello.ts
    
    - Hook examples: permission-gate, git-checkpoint, protected-paths
    
    - Session lifecycle centralized in AgentSession
      - Works across all modes (interactive, print, RPC)
      - Unified session event for hooks (replaces session_start/session_switch)
    
    - Box component added to pi-tui
    
    - Examples bundled in npm and binary releases
    
    Fixes #190
  • Clean up browser-extension references from monorepo
    - Update README.md to reference sitegeist repo
    - Update CLAUDE.md to replace browser-extension with web-ui
    - Update packages/web-ui/README.md examples to point to sitegeist
    - Remove browser-extension exclude from tsconfig.json
    - Remove browser-extension from .claude/settings.local.json permissions
  • feat: add cross-browser extension with AI reading assistant
    - Create Pi Reader browser extension for Chrome/Firefox
    - Chrome uses Side Panel API, Firefox uses Sidebar Action API
    - Supports both browsers with separate manifests and unified codebase
    - Built with mini-lit components and Tailwind CSS v4
    - Features model selection dialog with Ollama support
    - Hot reload development server watches both browser builds
    - Add useDefineForClassFields: false to fix LitElement reactivity
  • feat(ai): Create unified AI package with OpenAI, Anthropic, and Gemini support
    - Set up @mariozechner/ai package structure following monorepo patterns
    - Install OpenAI, Anthropic, and Google Gemini SDK dependencies
    - Document comprehensive API investigation for all three providers
    - Design minimal unified API with streaming-first architecture
    - Add models.dev integration for pricing and capabilities
    - Implement automatic caching strategy for all providers
    - Update project documentation with package creation guide
  • fix(tui): Container change detection for proper differential rendering
    Fixed rendering artifact where duplicate bottom borders appeared when components
    dynamically shifted positions (e.g., Ctrl+C in agent clearing status container).
    
    Root cause: Container wasn't reporting as "changed" when cleared (0 children),
    causing differential renderer to skip re-rendering that area.
    
    Solution: Container now tracks previousChildCount and reports changed when
    child count changes, ensuring proper re-rendering when containers are cleared.
    
    - Added comprehensive test reproducing the layout shift artifact
    - Fixed Container to track and report child count changes
    - All tests pass including new layout shift artifact test
  • tui-double-buffer: Implement smart differential rendering with terminal abstraction
    - Create Terminal interface abstracting stdin/stdout operations for dependency injection
    - Implement ProcessTerminal for production use with process.stdin/stdout
    - Implement VirtualTerminal using @xterm/headless for accurate terminal emulation in tests
    - Fix TypeScript imports for @xterm/headless module
    - Move all component files to src/components/ directory for better organization
    - Add comprehensive test suite with async/await patterns for proper render timing
    - Fix critical TUI differential rendering bug when components grow in height
      - Issue: Old content wasn't properly cleared when component line count increased
      - Solution: Clear each old line individually before redrawing, ensure cursor at line start
    - Add test verifying terminal content preservation and text editor growth behavior
    - Update tsconfig.json to include test files in type checking
    - Add benchmark test comparing single vs double buffer performance
    
    The implementation successfully reduces flicker by only updating changed lines
    rather than clearing entire sections. Both TUI implementations maintain the
    same interface for backward compatibility.
  • Initial monorepo setup with npm workspaces and dual TypeScript configuration
    - Set up npm workspaces for three packages: pi-tui, pi-agent, and pi (pods)
    - Implemented dual TypeScript configuration:
      - Root tsconfig.json with path mappings for development and type checking
      - Package-specific tsconfig.build.json for clean production builds
    - Configured lockstep versioning with sync script for inter-package dependencies
    - Added comprehensive documentation for development and publishing workflows
    - All packages at version 0.5.0 ready for npm publishing