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:
Kao Félix 2026-02-07 15:55:08 +01:00 committed by GitHub
parent 828c40cf68
commit 6a3d6fe944
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 16 additions and 0 deletions

View file

@ -1556,6 +1556,9 @@ ctx.ui.setTitle("pi - my-project");
ctx.ui.setEditorText("Prefill text");
const current = ctx.ui.getEditorText();
// Paste into editor (triggers paste handling, including collapse for large content)
ctx.ui.pasteToEditor("pasted content");
// Tool output expansion
const wasExpanded = ctx.ui.getToolsExpanded();
ctx.ui.setToolsExpanded(true);