Commit Graph

33 Commits

  • fix(coding-agent): detect GNU screen TERM values and downgrade to 256color (#1809)
    GNU screen does not support truecolor escape sequences. When pi emits
    truecolor SGR sequences (e.g. \x1b[38;2;102;102;102m for the dim color
    #666666), screen misparses the semicolon-separated parameters as
    individual SGR codes. The RGB value 102;102;102 maps directly to
    SGR 102 (bright green background), which then bleeds into every
    subsequent \x1b[2K line-erase, producing a bright green background
    on most info/status messages.
    
    detectColorMode() now returns '256color' for any TERM value that is
    'screen', starts with 'screen-' (e.g. screen-256color), or starts
    with 'screen.' (e.g. screen.xterm-256color). The existing COLORTERM
    check at the top of the function already handles the opt-in case for
    users who have configured screen's truecolor passthrough.
  • feat(coding-agent): ResourceLoader, package management, and /reload command (#645)
    - Add ResourceLoader interface and DefaultResourceLoader implementation
    - Add PackageManager for npm/git extension sources with install/remove/update
    - Add session.reload() and session.bindExtensions() APIs
    - Add /reload command in interactive mode
    - Add CLI flags: --skill, --theme, --prompt-template, --no-themes, --no-prompt-templates
    - Add pi install/remove/update commands for extension management
    - Refactor settings.json to use arrays for skills, prompts, themes
    - Remove legacy SkillsSettings source flags and filters
    - Update SDK examples and documentation for ResourceLoader pattern
    - Add theme registration and loadThemeFromPath for dynamic themes
    - Add getShellEnv to include bin dir in PATH for bash commands
  • fix(export): use active theme instead of default for HTML export (#870)
    getResolvedThemeColors and getThemeExportColors now fall back to
    currentThemeName before getDefaultTheme(), so exports respect the
    user's selected theme.
  • coding-agent: update theme-schema.json to match latest theme implementation (#763)
    * feat(coding-agent): update theme-schema.json
    Added to required/properties:
    - thinkingText - thinking block text color
    - selectedBg - selected item background
    - toolTitle - tool execution box title (replaces toolText)
    - toolOutput - tool execution box output text
    - mdLinkUrl - markdown link URL color
    - thinkingOff, thinkingMinimal, thinkingLow, thinkingMedium, thinkingHigh, thinkingXhigh, bashMode added to required array (were already in properties)
    
    Removed:
    - toolText (replaced by toolTitle and toolOutput)
    
    * removed thinking* border colors from required
  • Improve light theme color contrast for WCAG compliance (#682)
    Adjust base colors (teal, blue, green, red, yellow, dimGray) to meet
    4.5:1 contrast ratio against white backgrounds. Update thinking level
    colors to reference theme vars for consistency.
    
    Refactor test-theme-colors.ts into a CLI with contrast, test, and theme
    commands for easier color validation.
    
    Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
  • Use globalThis for theme to share across module loaders
    When running with tsx in dev mode, jiti loads extensions in a separate
    module cache. This caused the theme to be undefined in jiti's copy of
    theme.ts since initTheme() was only called on tsx's copy.
    
    Using globalThis with Symbol.for() ensures all module instances share
    the same theme, regardless of which loader created them.
  • Initialize theme with default value at module load time
    Prevents undefined theme when extensions call ctx.ui.custom() in edge cases
    where module resolution could cause the theme variable to be accessed before
    initTheme() is called.
  • feat(coding-agent): add user_bash event and theme API extensions
    - user_bash event for intercepting ! and !! commands (#528)
    - Extensions can return { operations } or { result } to redirect/replace
    - executeBashWithOperations() for custom BashOperations execution
    - session.recordBashResult() for extensions handling bash themselves
    - Theme API: getAllThemes(), getTheme(), setTheme() on ctx.ui
    - mac-system-theme.ts example: sync with macOS dark/light mode
    - Updated ssh.ts to use user_bash event
  • Assume truecolor for most terminals (fixes SSH color detection)
    Only fall back to 256color for truly limited terminals (dumb, empty, linux).
    Virtually all modern terminals support truecolor, no need to be conservative.
  • revert: remove unnecessary themeOverride params from theme functions
    The optional theme parameter was added as a workaround for tsx dev mode,
    but that's a dev-only issue. Users running the built package don't need it.
  • fix(theme): add optional themeOverride param to getSettingsListTheme/getSelectListTheme
    When hooks are loaded via jiti, they get a separate module instance from
    the main app. This means the global 'theme' variable in the hook's module
    is never initialized. Adding an optional theme parameter allows hooks to
    pass the theme from ctx.ui.custom() callback.
    
    Usage in hooks:
      getSettingsListTheme(theme)  // theme from ctx.ui.custom callback
  • feat(hooks): add setWidget API for multi-line status displays
    - ctx.ui.setWidget(key, lines) for multi-line displays above editor
    - Widgets appear below 'Working...' indicator, above editor
    - Supports ANSI styling including strikethrough
    - Added theme.strikethrough() method
    - Plan-mode hook now shows todo list with checkboxes
    - Completed items show checked box and strikethrough text
  • Add theme-configurable HTML export colors (from PR #387)
    - Add optional 'export' section to theme JSON with pageBg, cardBg, infoBg
    - If not specified, colors are auto-derived from userMessageBg
    - Add export colors to dark.json and light.json
    - Update theme-schema.json and TypeBox schema
    - Add documentation to docs/theme.md
    - Add margin-top back to tool-output for spacing between header and content
  • WIP: Rewrite export-html with tree sidebar, client-side rendering
    - Add tree sidebar with search and filter (Default/All/Labels)
    - Client-side markdown/syntax highlighting via vendored marked.js + highlight.js
    - Base64 encode session data to avoid escaping issues
    - Reuse theme.ts color tokens via getResolvedThemeColors()
    - Sticky sidebar, responsive mobile layout with overlay
    - Click tree node to scroll to message
    - Keyboard shortcuts: Esc to reset, Ctrl/Cmd+F to search
  • Add thinkingText theme token, fix streaming toggle bug
    - Add configurable thinkingText color for thinking blocks (defaults to muted)
    - Make 'Thinking...' label italic when collapsed
    - Fix Ctrl+T during streaming hiding the current message
    - Track streamingMessage to properly re-render on toggle
    
    Based on #366 by @paulbettner
  • Fix tree selector: proper selectedBg theme color, correct filter logic
    - Add selectedBg theme color for active line highlight
    - Fix filter modes:
      - no-tools: default minus tool results (still hides label/custom)
      - user-only: just user messages
      - labeled-only: just labeled entries
      - all: everything
    - Update theme.md with new color tokens (50 total)
  • Add TUI rendering for CustomMessageEntry
    - Add CustomMessageComponent with purple-tinted styling
    - Add theme colors: customMessageBg, customMessageText, customMessageLabel
    - Rename renderMessages to renderSessionContext taking SessionContext directly
    - renderInitialMessages now gets context from sessionManager
    - Skip rendering for display: false entries
  • Add /settings command with unified settings menu (#312)
    * Add /settings command with unified settings menu
    
    - Add SettingsList component to tui package with support for:
      - Inline value cycling (Enter/Space toggles)
      - Submenus for complex selections
      - Selection preservation when returning from submenu
    
    - Add /settings slash command consolidating:
      - Auto-compact (toggle)
      - Show images (toggle)
      - Queue mode (cycle)
      - Hide thinking (toggle)
      - Collapse changelog (toggle)
      - Thinking level (submenu)
      - Theme (submenu with preview)
    
    - Update AGENTS.md to clarify no inline imports rule
    
    Fixes #310
    
    * Add /settings to README slash commands table
    
    * Remove old settings slash commands, consolidate into /settings
    
    - Remove /thinking, /queue, /theme, /autocompact, /show-images commands
    - Remove unused selector methods and imports
    - Update README references to use /settings
  • Add intra-line diff highlighting for edit tool
    - Extract diff rendering to dedicated diff.ts component
    - Show word-level changes with inverse highlighting when a single line is modified
    - Use diffWords for cleaner token grouping (includes adjacent whitespace)
    - Only apply intra-line diff when exactly 1 removed and 1 added line (true modification)
    - Multi-line changes show all removed then all added without incorrect pairing
    - Add theme.inverse() method for inverse text styling
  • Syntax highlighting improvements
    - Fix cli-highlight import (use static import instead of dynamic require)
    - Add syntax highlighting to read/write tool output
    - Update dark/light themes with VS Code default syntax colors
    - Add highlightCode and getLanguageFromPath exports
    - Upgrade @google/genai to 1.34.0 for IMAGE_RECITATION/IMAGE_OTHER FinishReason
    - Add AGENTS.md rule: never downgrade code to fix type errors from outdated deps
  • fixes #161: disable theme watcher in print mode
    The theme file watcher was keeping the Node.js process alive indefinitely
    even in print mode where hot-reload is unnecessary. This fix adds an
    enableWatcher parameter to initTheme() and setTheme() functions, and only
    enables watchers in interactive mode.
    
    - Modified initTheme() to accept enableWatcher parameter (default: false)
    - Modified setTheme() to accept enableWatcher parameter (default: false)
    - Updated main.ts to only enable watchers in interactive mode
    - Updated InteractiveMode to enable watchers when changing themes