State holds the open project (VFS project, watcher, watched directories)
and versioned buffers. New commands: project.open/close/children,
file.open/save/saveAll, buffer.get/edit/close. buffer.edit takes UTF-16
change sets based on a version and fails with the new stale_version code;
closing dirty buffers or projects without force fails with
unsaved_changes. Commands queue events (projectOpened, treeChanged,
bufferChanged, dirtyChanged, fileChangedOnDisk, ...) that the engine
returns in Outcome.events; Engine::pump_vfs maps changes on disk to
events and reloads clean buffers. project.children watches listed
directories, capped at 256 native / 32 polling, least recently listed
dropped first.
Control channel: events.subscribe streams {"event": ...} lines, with
bounded per-subscriber queues (lutra_control::Subscribers) and method docs
in methods.rs. testkit's EngineBackend and the desktop Host implement the
new Backend::subscribe. Verified with 14 engine integration tests, a TCP
events test and the running app over the control channel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
543 B
TOML
25 lines
543 B
TOML
[package]
|
|
name = "lutra-engine"
|
|
description = "Command registry, workspace state, guard and recovery journal"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
authors.workspace = true
|
|
publish.workspace = true
|
|
|
|
[package.metadata.lutra]
|
|
layer = 4
|
|
|
|
[dependencies]
|
|
lutra-text.workspace = true
|
|
lutra-vfs.workspace = true
|
|
serde = { version = "1.0.229", features = ["derive"] }
|
|
serde_json = "1.0.154"
|
|
thiserror = "2.0.21"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dev-dependencies]
|
|
tempfile.workspace = true
|