Class AgiPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class AgiPanel extends ScrollablePanel
The main, top-level panel for the Anahata AI Swing UI. This class acts as an aggregator for all other UI components (e.g., input panel, conversation view, status bar).

This component is designed to be thread-aware. While the UI structure is initialized on the Event Dispatch Thread (EDT), interactions with the underlying Agi orchestrator often trigger background tasks. Use SwingUtils to safely transition between threads.

Author:
anahata
See Also:
  • Field Details

    • agi

      private Agi agi
      The agi session orchestrator that manages model interactions and tool execution.
    • agiConfig

      private SwingAgiConfig agiConfig
      The UI-specific configuration for this agi session, including themes and providers.
    • tabbedPane

      private final JTabbedPane tabbedPane
      The tabbed pane for switching between chat, configuration, and metabolic metrics.
    • configPanel

      private final SessionConfigPanel configPanel
      The panel for editing request configuration such as temperature and thinking levels.
    • contextPanel

      private final ContextPanel contextPanel
      The panel for managing the AI context, including history pruning and resource browsing.
    • supportPanel

      private final SupportPanel supportPanel
      The panel providing support links, documentation, and community resources.
    • cwGcPanel

      private final CwGcPanel cwGcPanel
      The panel for monitoring Context Window Garbage Collection (CwGC) metrics.
    • inputPanel

      private final InputPanel inputPanel
      The primary user input panel, supporting multimodal attachments and command completion.
    • headerPanel

      private final HeaderPanel headerPanel
      The header panel for session identity and model/provider selection.
    • toolbarPanel

      private final ToolbarPanel toolbarPanel
      The vertical toolbar panel for primary session-level action toggles.
    • statusPanel

      private final StatusPanel statusPanel
      The status panel for real-time monitoring of API calls and token usage.
    • conversationPanel

      private final ConversationPanel conversationPanel
      The main scrollable conversation view where message panels are rendered.
    • candidateSelectionPanel

      private final CandidateSelectionPanel candidateSelectionPanel
      The panel for displaying and selecting between multiple response candidates.
  • Constructor Details

    • AgiPanel

      public AgiPanel(@NonNull @NonNull SwingAgiConfig config)
      Constructs a new AgiPanel by creating a new Agi session with the provided configuration.
      Parameters:
      config - The agi configuration.
    • AgiPanel

      public AgiPanel(@NonNull @NonNull Agi agi)
      Constructs a new AgiPanel for an existing Agi session.
      Parameters:
      agi - The existing agi session.
  • Method Details

    • initComponents

      public void initComponents()
      Initializes the components and layout of the panel.
    • createScrollPane

      private JScrollPane createScrollPane(Component component)
      Creates a standardized JScrollPane for wrapping inner panels.
      Parameters:
      component - The component to wrap.
      Returns:
      A styled JScrollPane.