Class OpenToolWindowsContextProvider
java.lang.Object
uno.anahata.asi.agi.event.BasicPropertyChangeSource
uno.anahata.asi.agi.context.BasicContextProvider
uno.anahata.asi.intellij.tools.ide.context.OpenToolWindowsContextProvider
- All Implemented Interfaces:
ContextProvider, PropertyChangeSource, Rebindable
Injects a live snapshot of the IntelliJ windowing system — every registered tool
window per open project, flagged with its visible/active state — into the RAG
message.
This is the IntelliJ analogue of the NetBeans OpenTopComponentsContextProvider.
Tool-window state is read on the EDT because ToolWindow.isVisible() and
ToolWindow.isActive() are UI-model queries, while context is assembled on a
background AI thread.
- Author:
- anahata
-
Field Summary
Fields inherited from class BasicContextProvider
children, parentFields inherited from class BasicPropertyChangeSource
propertyChangeSupport -
Constructor Summary
ConstructorsConstructorDescriptionConstructs the tool-windows context provider with a stable id and label. -
Method Summary
Modifier and TypeMethodDescriptionvoidpopulateMessage(RagMessage ragMessage) Populates the givenRagMessagewith dynamic, just-in-time context parts.Methods inherited from class BasicContextProvider
getAgi, getChildrenProviders, getParentProvider, setParentProviderMethods inherited from class BasicPropertyChangeSource
addPropertyChangeListener, addPropertyChangeListener, rebind, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContextProvider
getContextPosition, getDescription, getFlattenedHierarchy, getFullyQualifiedId, getHeader, getIconId, getId, getInstructionsTokenCount, getName, getRagTokenCount, getSystemInstructions, isEffectivelyProviding, isProviding, setProvidingMethods inherited from interface PropertyChangeSource
getPropertyChangeSupport
-
Constructor Details
-
OpenToolWindowsContextProvider
public OpenToolWindowsContextProvider()Constructs the tool-windows context provider with a stable id and label.
-
-
Method Details
-
populateMessage
Populates the givenRagMessagewith dynamic, just-in-time context parts. These parts are appended to the end of the user's prompt (RAG).Renders a Markdown table (Tool Window | Project | Visible | Active) covering all registered tool windows across every open project.
- Parameters:
ragMessage- The message to be augmented with context.- Throws:
Exception- if an error occurs during context generation.
-

