Commit Graph

117 Commits

  • Add lifecycle callbacks to SandboxRuntimeProvider for abort signal support
    - Added onExecutionStart(sandboxId, signal) - called when sandbox execution begins
    - Added onExecutionEnd(sandboxId) - called when sandbox execution ends
    - Integrated callbacks in SandboxedIframe.execute()
    - Enables providers to track and cancel async operations (e.g., userScript executions)
  • 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
  • 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.
  • Handle FinishReason.NO_IMAGE and fix optional chaining
    - Add NO_IMAGE to error finish reasons in Google provider
    - Fix non-null assertion after optional chaining in Anthropic provider
    - Migrate biome config to 2.3.5
    - Ignore Tailwind CSS file from biome checks
    - Bump all packages to version 0.6.0
  • Add image support in tool results across all providers
    Tool results now use content blocks and can include both text and images.
    All providers (Anthropic, Google, OpenAI Completions, OpenAI Responses)
    correctly pass images from tool results to LLMs.
    
    - Update ToolResultMessage type to use content blocks
    - Add placeholder text for image-only tool results in Google/Anthropic
    - OpenAI providers send tool result + follow-up user message with images
    - Fix Anthropic JSON parsing for empty tool arguments
    - Add comprehensive tests for image-only and text+image tool results
    - Update README with tool result content blocks API
  • 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
  • Improve web-ui message and tool UX
    - Add collapsible thinking blocks with shimmer animation during streaming
    - Update user messages to use orange gradient pill styling (matching sitegeist)
    - Fix cost display to only show for completed messages, not while streaming
    - Update tool renderers to use ChevronsUpDown/ChevronUp icons instead of rotating ChevronRight
    - Export ThinkingBlock component from public API
  • Fix ProviderKeyInput UX: improve save button state and remove clear button
    - Add inputChanged state to track when user modifies input after save
    - Remove Clear button and removeKey() method entirely
    - Save button now disables after successful save until input changes
    - Save button stays enabled on test failure (allows immediate retry)
    - Keep input field showing stars (••••) after successful save instead of clearing
    
    This provides clearer feedback and prevents accidental key deletion.
  • Add reload button to HTML artifact header
    Adds a reload button with RefreshCw icon to HTML artifact header buttons.
    Clicking the button clears logs and re-executes the HTML content, useful
    for manually refreshing when developing HTML artifacts or testing changes.
    
    Changes:
    - Import Button, icon from mini-lit and RefreshCw from lucide
    - Add reload button to getHeaderButtons() that clears logs and calls executeContent()
    - Add "Reload HTML" i18n key in English and German translations
  • Add auto-reload for HTML artifacts when dependencies change
    HTML artifacts can read other artifacts via getArtifact() and attachments.
    When any artifact is created, updated, rewritten, or deleted, all HTML
    artifacts now automatically reload to reflect the latest data.
    
    Changes:
    - Add reloadAllHtmlArtifacts() method to ArtifactsPanel
    - Call reload after all artifact mutations (create/update/rewrite/delete)
    - Make HtmlArtifact.sandboxIframeRef and executeContent() public
    - Update runtime providers before re-executing HTML content
    
    This ensures HTML artifacts always display current data from their dependencies.
  • Fix console.log duplication bug in ConsoleRuntimeProvider
    Issue:
    Each browser_javascript execution wrapped console methods, but captured
    the current (already wrapped) console as "original". This created a chain
    of wrappers that accumulated across executions:
    - Execution 1: 1x console.log (wrapper1 → real console)
    - Execution 2: 2x console.log (wrapper2 → wrapper1 → real console)
    - Execution 3: 3x console.log (wrapper3 → wrapper2 → wrapper1 → real console)
    - Execution 4: 4x console.log (and so on...)
    
    Fix:
    Store the truly original console methods in window.__originalConsole on
    first wrap only. All subsequent executions use these stored original methods
    instead of capturing the current console. This prevents wrapper accumulation.
    
    Changes:
    - Check if window.__originalConsole exists before wrapping
    - Store original console methods with .bind() to preserve context
    - Always use window.__originalConsole for local logging
    - Now each execution logs exactly 1x regardless of execution count
  • Add paste image support to MessageEditor
    - Add handlePaste method to detect and process pasted images
    - Automatically attach pasted images as attachments
    - Support multiple images in single paste
    - Prevent default paste behavior for images (text paste still works normally)
    - Use same loadAttachment utility as drag-and-drop for consistency
  • Fix TypeScript errors and export UserMessageWithAttachments
    - Export UserMessageWithAttachments type from web-ui index
    - Remove unused i18n import from extract-document tool
    - Update models.generated.ts (model order changes from API)
    
    This fixes type errors when sitegeist uses custom user message renderer
  • Add extract_document tool and improve artifacts tab scrolling
    - Add extract_document tool for extracting text from PDF/DOCX/XLSX/PPTX from URLs
    - CORS proxy support from settings for fetching documents
    - Proper error messages guiding users on CORS issues and manual file attachment
    - Add scroll-into-view for active artifact tabs
    - Export extract_document tool from web-ui package
  • Add standalone mode for HTML artifact downloads
    When downloading HTML artifacts, the generated HTML now works standalone
    without requiring the extension runtime.
    
    Changes:
    - Add PrepareHtmlOptions config object to SandboxedIframe.prepareHtmlDocument()
    - Add isStandalone flag to skip runtime bridge and navigation interceptor
    - When isStandalone=true:
      - window.sendRuntimeMessage is NOT defined
      - Navigation interceptor is NOT injected
      - Artifact runtime providers fall back to embedded data
    - HtmlArtifact download button now uses isStandalone: true
    
    This fixes the issue where downloaded HTML artifacts would:
    - Try to call window.sendRuntimeMessage (which would fail silently)
    - Try to postMessage to non-existent parent window
    - Not work when opened via file:// protocol
    
    Now downloaded artifacts work completely standalone with embedded data.
  • Revert: Fix extension context detection - original logic was correct
    The negated approach broke browser_script which runs in page context.
    browser_script injects into web pages (http://, https://) where
    chrome.runtime.sendMessage doesn't work. The original whitelist
    approach correctly identifies extension contexts only.
    
    The real issue with artifacts in sandbox iframes needs a different fix.
  • Fix module script validation and extension context detection
    1. Skip JavaScript validation for <script type="module"> tags
       - new Function() cannot validate ES module syntax (import/export)
       - Module scripts now execute without validation errors
       - Fixes issue where HTML artifacts with modules would fail to load
    
    2. Improve __isExtensionContext detection logic
       - Changed from whitelist (chrome-extension://, moz-extension://)
       - To blacklist approach: negate http://, https://, file://
       - More robust - handles all extension protocols (about:srcdoc, etc.)
       - Fixes "offline mode" errors when using browser_script artifacts
    
    Resolves artifacts not working in extension context after document.write()
  • Intercept iframe navigation and open links externally
    - Add navigation interceptor script that prevents all iframe navigation
    - Intercept link clicks, form submissions, and window.location changes
    - Send open-external-url messages to parent window
    - Use chrome.tabs.create() in extension context, window.open() fallback
    - Fix font-size workaround to use 'initial' instead of hardcoded 16px
    - Document Chrome extension font-size bug with Stack Overflow reference
    
    This prevents HTML artifacts from navigating away when users click links,
    which would break the sandbox message system. All links now open in new
    Chrome tabs instead.
  • Fix font-size inheritance in HTML artifact iframes
    Set explicit font-size: 16px on the <html> element in sandboxed iframes
    to prevent browser default inheritance quirks that can cause unexpected
    font sizes (e.g., 75% shown in devtools).
    
    This establishes a consistent base font size while still allowing user
    HTML content to override it on body or specific elements as needed.
    
    Fixes the issue where HTML artifacts displayed with inconsistent font
    sizes due to iframe inheritance behavior.