import type { TranslationBundle } from '@jupyterlab/translation'; import { ReactWidget } from '@jupyterlab/ui-components'; import type { IAgent } from '../launcher/agents'; import { ISessionTarget } from './targetPicker'; import type { AskAgentTarget, IAskAgentContext } from './tokens'; /** * Short human-readable descriptor of the prompted range, shown in the popup * header and the queue panel: file name, notebook cell (when applicable), * line range and, for ranges that are not current file content (such as the * old side of a diff), a clarifying tag. */ export declare function contextSummary(context: IAskAgentContext, trans: TranslationBundle): string; /** * The floating ask-agent prompt box. Hosts {@link AskAgentPopupComponent} in * a React root attached to `document.body`; `jp-ThemedContainer` makes * JupyterLab's theme variables resolve outside the shell (the omnibox uses * the same arrangement). */ export declare class AskAgentPopup extends ReactWidget { constructor(options: AskAgentPopup.IOptions); render(): JSX.Element; private _options; } /** * A namespace for `AskAgentPopup` statics. */ export declare namespace AskAgentPopup { /** * Construction options for {@link AskAgentPopup}. */ interface IOptions { /** * The code selection the prompt is about. */ context: IAskAgentContext; /** * Viewport rectangle to anchor to; `null` centers near the top. */ anchor: DOMRect | null; /** * Snapshot of the prompt-capable agents, taken when the popup opens. */ agents: IAgent[]; /** * Snapshot of the running agent terminals, taken when the popup opens. */ targets: ISessionTarget[]; /** * Preferred agent id (the last one used), when still available. */ initialAgentId: string | null; /** * Session to preselect as the target, or `null` to preselect the new * terminal. Must be `null` or the name of an entry in {@link targets}. */ initialTargetName: string | null; /** * Number of prompts already queued, shown on the queue button. Only * meaningful together with {@link onQueue}. */ queueCount?: number; /** * Translation bundle for the popup's own labels. */ trans: TranslationBundle; /** * Send the instruction to the chosen target (the plugin closes the popup). */ onSubmit: (target: AskAgentTarget, instruction: string) => void; /** * Add the instruction to the prompt queue instead of sending it, keyed * to the same chosen target (the plugin closes the popup). The queue * button is hidden when omitted. */ onQueue?: (target: AskAgentTarget, instruction: string) => void; /** * Dismiss the popup (the plugin disposes the widget). `restoreFocus` is * true when the dismissal placed no focus of its own (Escape), asking * the plugin to hand focus back to the widget the ask came from. */ onCancel: (restoreFocus: boolean) => void; } }