Class HistoryNode


public class HistoryNode extends AbstractContextNode<ContextManager>
A context tree node representing the conversation history.
  • Field Details

    • ICON

      private static final Icon ICON
      The standard pulse icon to visualize the live conversation feed.
  • Constructor Details

    • HistoryNode

      public HistoryNode(AgiPanel agiPanel, ContextManager userObject)
      Constructs a new HistoryNode.
      Parameters:
      agiPanel - The parent agi panel.
      userObject - The context manager to wrap.
  • Method Details

    • getName

      public String getName()
      Gets the human-readable display name for this node.

      Implementation details: Returns the localized "History" label for the conversation branch.

      Specified by:
      getName in class AbstractContextNode<ContextManager>
      Returns:
      The name to be displayed in the tree.
    • getIcon

      public Icon getIcon()
      Gets an optional icon for this node by delegating to the IconProvider configured in the agi session.

      Implementation details: Returns the standard PulseIcon to visualize the live conversation feed.

      Overrides:
      getIcon in class AbstractContextNode<ContextManager>
      Returns:
      The icon, or null if no specialized icon is available.
    • getDescription

      public String getDescription()
      Gets a detailed description of the node's purpose or content.

      Implementation details: Explains the contents of the history branch, spanning messages from all actors and tool interactions.

      Specified by:
      getDescription in class AbstractContextNode<ContextManager>
      Returns:
      The description string.
    • fetchChildObjects

      protected List<?> fetchChildObjects()
      Fetches the current list of domain objects that should be represented as children of this node.

      Implementation details: Retrieves the full list of AbstractMessages from the context manager's memory.

      Specified by:
      fetchChildObjects in class AbstractContextNode<ContextManager>
      Returns:
      A list of domain objects.
    • createChildNode

      protected AbstractContextNode<?> createChildNode(Object obj)
      Creates a new child node for the given domain object.

      Implementation details: Transforms each AbstractMessage in the timeline into a navigable MessageNode.

      Specified by:
      createChildNode in class AbstractContextNode<ContextManager>
      Parameters:
      obj - The domain object to wrap.
      Returns:
      A new AbstractContextNode, or null if the object type is not supported.
    • calculateLocalTokens

      protected void calculateLocalTokens()
      Calculates the token counts for this node's own content (excluding children).

      Implementation details: Token counts for history are entirely aggregated from the constituent message nodes.

      Specified by:
      calculateLocalTokens in class AbstractContextNode<ContextManager>
    • isActive

      public boolean isActive()
      Checks if the underlying domain object is currently active in the context.

      Subclasses override this method to define their specific active-state policy, allowing for clean, polymorphic evaluation without dirty instanceof chains.

      Specified by:
      isActive in class AbstractContextNode<ContextManager>
      Returns:
      true if active, false otherwise.
    • updateStatus

      protected void updateStatus()
      Updates the status string for this node.

      Implementation details: Updates the status with a count of the current message stack depth.

      Specified by:
      updateStatus in class AbstractContextNode<ContextManager>