Commit Graph

19 Commits

  • Add /export command to export sessions as self-contained HTML
    - Add exportSessionToHtml function that generates beautifully formatted HTML exports
    - HTML includes session metadata, all messages, tool calls, tool results, thinking blocks, and images
    - Support for ANSI color codes in tool output (converted to HTML)
    - Self-contained with inline CSS (dark theme, responsive design, print-friendly)
    - Add /export slash command to TUI with optional filename parameter
    - Add agent and coding-agent to dev script for watch mode
    - Increment coding-agent version to 0.6.1
    
    Usage: /export [optional-filename.html]
  • Fix Lit dependency duplication and update mini-lit to 0.2.0
    - Move lit from dependencies to peerDependencies in web-ui to prevent multiple Lit instances being loaded
    - Update mini-lit from 0.1.8/0.1.10 to 0.2.0 in root package.json and web-ui/package.json
    - Install @tailwindcss/vite in web-ui/example
    - Run biome formatting fixes across codebase
    
    This resolves HMR custom element re-registration errors caused by duplicate Lit registries.
  • Clean up TUI package and refactor component structure
    - Remove old TUI implementation and components (LoadingAnimation, MarkdownComponent, TextComponent, TextEditor, WhitespaceComponent)
    - Rename components-new to components with new API (Loader, Markdown, Text, Editor, Spacer)
    - Move Text and Input components to separate files in src/components/
    - Add render caching to Text component (similar to Markdown)
    - Add proper ANSI code handling in Text component using stripVTControlCharacters
    - Update coding-agent to use new TUI API (requires ProcessTerminal, uses custom Editor subclass for key handling)
    - Remove old test files, keep only chat-simple.ts and virtual-terminal.ts
    - Update README.md with new minimal API documentation
    - Switch from tsc to tsgo for type checking
    - Update package dependencies across monorepo
  • Remove browser-extension package (migrated to separate sitegeist repo)
    - Remove packages/browser-extension directory
    - Update package.json scripts to remove browser-ext from build and dev
    - Extension now lives at https://github.com/badlogic/sitegeist
    - Uses file: dependencies to pi-ai and pi-web-ui for development
  • Add Anthropic prompt caching, pluggable storage, and CORS proxy support
    Storage Architecture:
    - New pluggable storage system with backends (LocalStorage, ChromeStorage, IndexedDB)
    - SettingsRepository for app settings (proxy config, etc.)
    - ProviderKeysRepository for API key management
    - AppStorage with global accessors (getAppStorage, setAppStorage, initAppStorage)
    
    Transport Refactoring:
    - Renamed DirectTransport → ProviderTransport (calls LLM providers with optional CORS proxy)
    - Renamed ProxyTransport → AppTransport (uses app server with user auth)
    - Updated TransportMode: "direct" → "provider", "proxy" → "app"
    
    CORS Proxy Integration:
    - ProviderTransport checks proxy.enabled/proxy.url from storage
    - When enabled, modifies model baseUrl to route through proxy: {proxyUrl}/?url={originalBaseUrl}
    - ProviderKeyInput test function also honors proxy settings
    - Settings dialog with Proxy tab (Switch toggle, URL input, explanatory description)
    
    Anthropic Prompt Caching:
    - System prompt cached with cache_control markers (both OAuth and regular API keys)
    - Last user message cached to cache conversation history
    - Saves 90% on input tokens for cached content (10x cost reduction)
    
    Settings Dialog Improvements:
    - Configurable tab system with SettingsTab base class
    - ApiKeysTab and ProxyTab as custom elements
    - Switch toggle for proxy enable (instead of Checkbox)
    - Explanatory paragraphs for each tab
    - ApiKeyPromptDialog reuses ProviderKeyInput component
    
    Removed:
    - Deprecated ApiKeysDialog (replaced by ProviderKeyInput in SettingsDialog)
    - Old storage-adapter and key-store (replaced by new storage architecture)
  • Integrate JailJS for CSP-restricted execution in browser extension
    Major changes:
    - Migrate browser-extension to use web-ui package (85% code reduction)
    - Add JailJS content script with ES6+ transform support
    - Expose DOM constructors (Event, KeyboardEvent, etc.) to JailJS
    - Support top-level await by wrapping code in async IIFE
    - Add returnFile() support in JailJS execution
    - Refactor KeyStore into pluggable storage-adapter pattern
    - Make ChatPanel configurable with sandboxUrlProvider and additionalTools
    - Update jailjs to 0.1.1
    
    Files deleted (33 duplicate files):
    - All browser-extension components, dialogs, state, tools, utils
    - Now using web-ui versions via @mariozechner/pi-web-ui
    
    Files added:
    - packages/browser-extension/src/content.ts (JailJS content script)
    - packages/web-ui/src/state/storage-adapter.ts
    - packages/web-ui/src/state/key-store.ts
    
    Browser extension now has only 5 source files (down from 38).
  • 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): Rename package to @mariozechner/pi-ai and improve documentation
    - Changed package name from @mariozechner/ai to @mariozechner/pi-ai
    - Fixed generate-models.ts to fetch from models.dev API instead of local file
    - Completely rewrote README with practical examples:
      - Image input with base64 encoding
      - Proper tool calling with context management
      - Streaming with completion indicators
      - Abort signal usage
      - Provider-specific options (reasoning/thinking)
      - Custom model definitions for local/self-hosted LLMs
      - Environment variables explanation
    - Bumped version to 0.5.9 and published
  • 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 npm publishing warnings and clean up package.json files
    - Fixed repository URLs to use git+https:// format
    - Removed tsconfig.tsbuildinfo from clean scripts
    - Updated README with clearer build instructions and dependency order
    - Fixed bin paths to reference dist/cli.js correctly
    - Ready for npm publishing with no warnings
  • 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