Class AnahataToolkit
java.lang.Object
uno.anahata.asi.agi.tool.ToolContext
uno.anahata.asi.agi.tool.AnahataToolkit
- All Implemented Interfaces:
ContextProvider, PropertyChangeSource, Rebindable
- Direct Known Subclasses:
AbstractBrowser, AsiContainer, Audio, BatchCodeRefiner, BatchCodeRefiner, Benchmarks, CodeModel, CodeModel, CodeRefiner, CodeRefiner, Debugger, Editor, Editor, Gradle, Hints, Hints, History, Host, IDE, IDE, Java, Maven, Maven, NbTerminal, Projects, Projects, Radio, Refactor, Refactor, Resources, RunConfigurations, Screens, Session, Shell, Speech, Terminals, Vcs, YouTube
public abstract class AnahataToolkit
extends ToolContext
implements ContextProvider, Rebindable, PropertyChangeSource
The base class for all AI toolkits. It integrates the tool execution context
with the hierarchical context provider system, allowing toolkits to natively
contribute system instructions and RAG data.
This class is designed for autonomy: toolkits manage their own state and can
notify the UI of changes via the PropertyChangeSource interface.
- Author:
- anahata
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<ContextProvider> The list of child context providers managed by this toolkit.protected PropertyChangeSupportSupport for firing property change events.private booleanWhether this toolkit is currently providing context augmentation.Fields inherited from class ToolContext
toolkit -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the list of immediate child context providers.Gets a detailed description of what this context provider does.getId()Gets the unique identifier for this context provider.getName()Gets the human-readable name of this context provider.Gets the parent context provider in the hierarchy, if any.Gets the PropertyChangeSupport instance for this object.voidPerforms initial setup for a newly created toolkit instance.booleanOverride to also take into consideration theAbstractToolkit.enabledvoidCallback method triggered by the Asi Container once the Agi session has been fully deserialized and associated to the ASI container.voidrebind()Rebinds the toolkit after deserialization.Methods inherited from class ToolContext
addAttachment, addAttachment, addAttachment, addAttachment, error, error, error, getAgi, getApplicationMap, getAsiContainer, getAsiContainerMap, getCall, getExecutorService, getModelId, getModelMessage, getResourceManager, getResponse, getSessionMap, getThreadSafeLogger, getTool, getToolContext, getToolkit, getToolManager, getTurnMap, isToolExecution, log, peekResponse, runAsyncMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContextProvider
getAgi, getContextPosition, getFlattenedHierarchy, getFullyQualifiedId, getHeader, getIconId, getInstructionsTokenCount, getRagTokenCount, getSystemInstructions, isProviding, populateMessage, setParentProvider, setProviding
-
Field Details
-
providing
private boolean providingWhether this toolkit is currently providing context augmentation. -
propertyChangeSupport
Support for firing property change events. Marked transient to avoid serializing listeners. -
childrenProviders
The list of child context providers managed by this toolkit. Uses CopyOnWriteArrayList for thread-safe concurrent access during IDE events.
-
-
Constructor Details
-
AnahataToolkit
public AnahataToolkit()
-
-
Method Details
-
isEffectivelyProviding
public boolean isEffectivelyProviding()Override to also take into consideration theAbstractToolkit.enabled- Specified by:
isEffectivelyProvidingin interfaceContextProvider- Returns:
- true if the providing flag is true and the toolkit is enabled
-
initialize
public void initialize()Performs initial setup for a newly created toolkit instance.This method is called exactly once by the
ToolManagerafter the toolkit has been instantiated and registered. It provides a clean hook for toolkits to perform one-time initialization logic that requires the tool environment to be fully configured, such as scanning for project instructions or registering default resources. -
rebind
public void rebind()Rebinds the toolkit after deserialization.This method is called by the framework during session activation to restore transient state, reconnect listeners, or refresh cached project instances. It ensures the
propertyChangeSupportis re-initialized.- Specified by:
rebindin interfaceRebindable
-
postActivate
public void postActivate()Callback method triggered by the Asi Container once the Agi session has been fully deserialized and associated to the ASI container. -
getId
Gets the unique identifier for this context provider.- Specified by:
getIdin interfaceContextProvider- Returns:
- The provider's ID.
-
getName
Gets the human-readable name of this context provider.- Specified by:
getNamein interfaceContextProvider- Returns:
- The provider's name.
-
getDescription
Gets a detailed description of what this context provider does.- Specified by:
getDescriptionin interfaceContextProvider- Returns:
- The provider's description.
-
getParentProvider
Gets the parent context provider in the hierarchy, if any.- Specified by:
getParentProviderin interfaceContextProvider- Returns:
- The parent provider, or null if this is a root provider.
-
getChildrenProviders
Gets the list of immediate child context providers.- Specified by:
getChildrenProvidersin interfaceContextProvider- Returns:
- The list of children, or an empty list if none.
-
getPropertyChangeSupport
Gets the PropertyChangeSupport instance for this object.- Specified by:
getPropertyChangeSupportin interfacePropertyChangeSource- Returns:
- The PropertyChangeSupport.
-

