Files
improvise/Cargo.toml
T
Edward Langley d25f3187d3 feat(protocol): extract improvise-protocol crate
The crate the browser epic hangs off: Command (the wire format),
ViewState, RenderCache/CellDisplay/Snapshot, and reduce_view. It depends
on improvise-core and serde and nothing else -- no IO, no command layer,
no terminal -- and improvise-command now depends on it.

ViewState, ViewCursor, ViewFrame, AppMode, Panel, MinibufferConfig,
MinibufColor, HELP_PAGE_COUNT and the key types move here. Everything
that moved is re-exported from ui::app and command::key, so no existing
path changed. The three tickets before this one are what made the move
mechanical: h0b evicted the unportable fields, a2x added the derives,
8uz took the cursor out of the shared View.

Command's client->server half is not invented. It is exactly the set of
EffectKind::ViewOnly effects whose target is the portable slice -- h0b
had already sorted the portable state from the host-local, so the
enumeration was done. Effects touching the wizard, staged drill edits,
storage or the layout cache are absent by construction. The other half
carries projections: already-formatted display values and their labels.

One thing had to be added rather than moved. reduce_view runs on a client
that holds no Workbook, and ViewState::cursors is keyed by view name, so
ViewState needs its own active_view. That makes two copies of "which view
is active"; App::switch_to_view and App::install_workbook are the only
writers, and the_two_active_view_names_never_diverge guards it. The 8uz
characterization test caught the desync the moment it appeared, because
it was calling workbook.switch_view directly.

Whether the two are *allowed* to diverge -- two clients on different
views -- is improvise-g0f, deliberately left open. It changes the shape
of improvise-cqq, and nothing here forecloses either answer.

reduce_view has 12 tests including a determinism check: folding the same
stream twice gives the same state, which is what stops the server's
mirror drifting from the client it mirrors. Every Command round-trips
through JSON. The crate is in the CI wasm job.

Closes improvise-cqi

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V69PGQfMJuGRmtSWpfVAqn
2026-09-01 02:03:45 -07:00

64 lines
1.6 KiB
TOML

[workspace]
members = [".", "crates/improvise-formula", "crates/improvise-core", "crates/improvise-protocol", "crates/improvise-io", "crates/improvise-command", "crates/gp-tree"]
[package]
name = "improvise"
version = "0.1.0-rc2"
edition = "2024"
description = "Terminal pivot-table modeling in the spirit of Lotus Improv"
license = "Apache-2.0"
repository = "https://github.com/fiddlerwoaroof/improvise"
homepage = "https://github.com/fiddlerwoaroof/improvise"
readme = "README.md"
keywords = ["tui", "pivot", "spreadsheet", "data", "improv"]
categories = ["command-line-utilities", "visualization"]
[[bin]]
name = "improvise"
path = "src/main.rs"
[dependencies]
gp-tree = { path = "crates/gp-tree" }
improvise-core = { path = "crates/improvise-core" }
improvise-formula = { path = "crates/improvise-formula" }
improvise-io = { path = "crates/improvise-io" }
improvise-command = { path = "crates/improvise-command" }
ratatui = "0.30"
crossterm = "0.29"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
anyhow = "1"
thiserror = "2"
indexmap = { version = "2", features = ["serde"] }
chrono = { version = "0.4", features = ["serde"] }
flate2 = "1"
unicode-width = "^0.2"
dirs = "6"
csv = "1"
clap = { version = "4.6.6", features = ["derive"] }
enum_dispatch = "0.3.13"
pest = "2.9.0"
pest_derive = "2.9.0"
[dev-dependencies]
pest = "2.9.0"
pest_derive = "2.9.0"
pest_meta = "2.9.0"
proptest = "1"
tempfile = "3"
[profile.release]
opt-level = 3
lto = true
codegen-units = 1
strip = true
[profile.profiling]
inherits = "release"
strip = false
debug = 2
# The profile that 'dist' will build with
[profile.dist]
inherits = "release"