feat(coding-agent,tui): add stacked autocomplete providers closes #2983
This commit is contained in:
@@ -29,6 +29,7 @@ export type {
|
||||
AppendEntryHandler,
|
||||
// App keybindings (for custom editors)
|
||||
AppKeybinding,
|
||||
AutocompleteProviderFactory,
|
||||
// Events - Tool (ToolCallEvent types)
|
||||
BashToolCallEvent,
|
||||
BashToolResultEvent,
|
||||
|
||||
@@ -204,6 +204,7 @@ const noOpUIContext: ExtensionUIContext = {
|
||||
setEditorText: () => {},
|
||||
getEditorText: () => "",
|
||||
editor: async () => undefined,
|
||||
addAutocompleteProvider: () => {},
|
||||
setEditorComponent: () => {},
|
||||
get theme() {
|
||||
return theme;
|
||||
|
||||
@@ -30,6 +30,7 @@ import type {
|
||||
} from "@mariozechner/pi-ai";
|
||||
import type {
|
||||
AutocompleteItem,
|
||||
AutocompleteProvider,
|
||||
Component,
|
||||
EditorComponent,
|
||||
EditorTheme,
|
||||
@@ -112,6 +113,9 @@ export interface WorkingIndicatorOptions {
|
||||
intervalMs?: number;
|
||||
}
|
||||
|
||||
/** Wrap the current autocomplete provider with additional behavior. */
|
||||
export type AutocompleteProviderFactory = (current: AutocompleteProvider) => AutocompleteProvider;
|
||||
|
||||
/**
|
||||
* UI context for extensions to request interactive UI.
|
||||
* Each mode (interactive, RPC, print) provides its own implementation.
|
||||
@@ -206,6 +210,9 @@ export interface ExtensionUIContext {
|
||||
/** Show a multi-line editor for text editing. */
|
||||
editor(title: string, prefill?: string): Promise<string | undefined>;
|
||||
|
||||
/** Stack additional autocomplete behavior on top of the built-in provider. */
|
||||
addAutocompleteProvider(factory: AutocompleteProviderFactory): void;
|
||||
|
||||
/**
|
||||
* Set a custom editor component via factory function.
|
||||
* Pass undefined to restore the default editor.
|
||||
|
||||
Reference in New Issue
Block a user