import { JupyterFrontEndPlugin } from '@jupyterlab/application'; import { IAskAgent } from './tokens'; /** * Select code in a file editor (or pick diff lines) and prompt a coding * agent about it. * * The plugin watches the document selection: a non-empty selection inside a * CodeMirror file editor or notebook cell grows a small floating "Ask agent" * pill next to the selection. Clicking it (or running `xtralab:ask-agent`, * bound to Accel+. in editors and notebooks) opens a popup where the user * types an instruction, picks one of the launcher's agents and picks where * the prompt goes; submitting either starts that agent in a fresh terminal * via `xtralab:start-agent:`, or pastes the prompt into an agent already * running in one of the open terminal sessions (via `IAgentTerminals`; the * agent CLIs queue prompts that arrive while they are busy). Sends to a * running agent stay in the background — focus never leaves the editor, and * a success toast offers to open the terminal. Either way the prompt embeds * the file path, cell index for notebooks, line range and selected snippet. * * The popup's Queue button (or Accel+Enter) defers the send instead: the * comment lands in a persistent queue, stamped with the popup's selected * destination — every queued prompt is independent and may aim at a * different agent or session. A right-sidebar panel reviews the queue * (edit, retarget, remove) and flushes it in one go, combining prompts that * share a destination into a single numbered message. The queue survives * page reloads. * * The same popup is provided on the `IAskAgent` token so the git diff * viewers can open it for a selected diff line range. */ declare const plugin: JupyterFrontEndPlugin; export default plugin;