feat(coding-agent): add composable editor factory access

closes #3935
This commit is contained in:
Mario Zechner
2026-04-29 23:26:25 +02:00
parent c1dd6082ee
commit d698647b12
7 changed files with 36 additions and 7 deletions

View File

@@ -47,6 +47,7 @@ export type {
ContextUsage,
CustomToolCallEvent,
CustomToolResultEvent,
EditorFactory,
EditToolCallEvent,
EditToolResultEvent,
ExecOptions,

View File

@@ -207,6 +207,7 @@ const noOpUIContext: ExtensionUIContext = {
editor: async () => undefined,
addAutocompleteProvider: () => {},
setEditorComponent: () => {},
getEditorComponent: () => undefined,
get theme() {
return theme;
},

View File

@@ -115,6 +115,7 @@ export interface WorkingIndicatorOptions {
/** Wrap the current autocomplete provider with additional behavior. */
export type AutocompleteProviderFactory = (current: AutocompleteProvider) => AutocompleteProvider;
export type EditorFactory = (tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => EditorComponent;
/**
* UI context for extensions to request interactive UI.
@@ -249,9 +250,10 @@ export interface ExtensionUIContext {
* );
* ```
*/
setEditorComponent(
factory: ((tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => EditorComponent) | undefined,
): void;
setEditorComponent(factory: EditorFactory | undefined): void;
/** Get the currently configured custom editor factory, or undefined when using the default editor. */
getEditorComponent(): EditorFactory | undefined;
/** Get the current theme for styling. */
readonly theme: Theme;