Class SwingAgiConfig

All Implemented Interfaces:
PropertyChangeSource, Rebindable
Direct Known Subclasses:
AsiDesktopAgiConfig, NetBeansAgiConfig

public class SwingAgiConfig extends AgiConfig
A concrete AgiConfig for standalone Swing applications, providing UI-specific settings like themes and colors.
Author:
anahata
  • Field Details

    • iconProvider

      private IconProvider iconProvider
      The provider for context-related icons, used to visually distinguish between different types of resources and tools.
    • showPruned

      private boolean showPruned
      If true, parts and messages that are effectively pruned will still be rendered in the UI (e.g., in a collapsed state) to allow the user to inspect and un-prune them.
    • audioFeedbackEnabled

      private boolean audioFeedbackEnabled
      If true, sound notifications will be played on status changes.
  • Constructor Details

    • SwingAgiConfig

      public SwingAgiConfig(AbstractAsiContainer aiConfig)
      Constructs a new SwingAgiConfig with a randomly generated session ID.
      Parameters:
      aiConfig - The global AI configuration.
    • SwingAgiConfig

      public SwingAgiConfig(AbstractAsiContainer aiConfig, String sessionId)
      Constructs a new SwingAgiConfig with a specific session ID.
      Parameters:
      aiConfig - The global AI configuration.
      sessionId - The unique session ID.
  • Method Details

    • setShowPruned

      public void setShowPruned(boolean showPruned)
      Sets whether pruned parts and messages should be shown in the UI. Fires a property change event for reactive UI updates.
      Parameters:
      showPruned - true to show pruned content.
    • getColor

      public static Color getColor(AgiStatus status)
      Retrieves the thematic color associated with a specific agi status.
      Parameters:
      status - The status to look up.
      Returns:
      The color representing that status in the UI.
    • getColor

      public static Color getColor(ToolExecutionStatus status)
      Retrieves the color associated with a specific tool execution status.
      Parameters:
      status - The status to look up.
      Returns:
      The color representing that execution state.
    • getColor

      public static Color getColor(ToolPermission permission)
      Retrieves the color associated with a specific tool permission level.
      Parameters:
      permission - The permission level.
      Returns:
      The color representing that permission.
    • getColorForContextUsage

      public static Color getColorForContextUsage(double percentage)
      Calculates a color representing context window usage, shifting from green to red as the usage approaches the threshold.
      Parameters:
      percentage - The usage percentage (0.0 to 1.0+).
      Returns:
      The appropriate color for the usage bar.
    • getTheme

      public SwingAgiConfig.UITheme getTheme()
      Returns a new theme object containing the color and font definitions for the UI.
      Returns:
      The UI theme.