feat(tui, coding-agent): add pasteToEditor to ExtensionUIContext (#1351)
Add pasteToEditor(text) method that pastes text into the editor via bracketed paste sequences, triggering paste handling (including collapse for large content). Unlike setEditorText which directly replaces content, pasteToEditor routes through handleInput on the active editor component. - Add pasteToEditor to ExtensionUIContext interface - Add handleInput to EditorComponent interface (was missing, all concrete implementations already had it) - Implement in interactive mode via bracketed paste sequence - Add fallback in RPC mode (delegates to setEditorText) - Document in extensions.md
This commit is contained in:
@@ -175,6 +175,7 @@ const noOpUIContext: ExtensionUIContext = {
|
||||
setHeader: () => {},
|
||||
setTitle: () => {},
|
||||
custom: async () => undefined as never,
|
||||
pasteToEditor: () => {},
|
||||
setEditorText: () => {},
|
||||
getEditorText: () => "",
|
||||
editor: async () => undefined,
|
||||
|
||||
@@ -162,6 +162,9 @@ export interface ExtensionUIContext {
|
||||
},
|
||||
): Promise<T>;
|
||||
|
||||
/** Paste text into the editor, triggering paste handling (collapse for large content). */
|
||||
pasteToEditor(text: string): void;
|
||||
|
||||
/** Set the text in the core input editor. */
|
||||
setEditorText(text: string): void;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user