add editor subsystem — daemon state + editor.* IPC

EditorBuffer + Selection + EditorRegistry hold the daemon-side
active-file model (D-006 subsystem 'editor'). Active buffer
tracking means `clide insert "…"` and `clide replace-selection
"…"` target the UI's focused file without the caller supplying an
id. Mutations mark buffers dirty; editor.save writes back to disk
through the workspace root; events fire on every state change so
subscribers can mirror.

IPC surface matches CLAUDE.md's tier-2 list + the natural extras
(list, read, activate, set-selection, set-content, close). Tests
cover open-idempotence, insert at caret, replace-selection range
swap, dirty→save→clean round-trip, close picks a new active
buffer, out-of-range selection clamping.

69 core tests pass.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-04-22 10:10:42 +02:00
co-authored by Claude
parent 37108230f2
commit d32e8fdc17
8 changed files with 705 additions and 0 deletions
+1
View File
@@ -17,6 +17,7 @@ library;
// they're pure data types that both the app and the daemon reference.
export 'src/daemon/dispatcher.dart';
export 'src/editor/buffer.dart';
export 'src/files/ignore.dart';
export 'src/files/listing.dart' show FileEntry, listDir;
export 'src/ipc/envelope.dart';