Review #003 Session 2 (P12 + P6 + P7 + P4 + P16): - P12: primary types re-exported at the crate root (TtyAdapter, TtySession, TtyBackend/TtyHandle/TtyParams, Chunk codec, wire constants, ControlMessage, negotiation types, channels helpers; LocalTtyBackend under `local`). signal_from_name re-export is #[cfg(unix)]-gated to match its definition (wasm check caught it). - P6: ChunkWriter validates before writing — stream_type > 4 or payload > MAX_CHUNK_LEN fails locally (RawError) instead of corrupting the peer's framing; length validated as u64 before the u32 cast so oversized payloads cannot wrap past the check. Empty-payload shape unified via a single write_validated helper. - P7: ChunkReader tracks peeked state — read_chunk() after peek_stream_type() completes the peeked chunk instead of consuming a second header byte; second peek is idempotent; read_chunk_after_peek debug-asserts a peek. Session read pump drops its manual first_byte_peeked threading. - P4: README.md (alkcall structure; quick-start examples per role using the new root paths) + readme = "README.md" in [package]. - P16: CHANGELOG.md with the full [0.1.0] entry and tag link. Verification: cargo test 104 lib (default) / 147 (--all-features); clippy all-targets + wasm32 -D warnings; fmt; wasm check; doc 0 warnings; publish dry-run 44 files OK.
55 lines
1.9 KiB
TOML
55 lines
1.9 KiB
TOML
[package]
|
|
name = "alktty"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
rust-version = "1.85"
|
|
license = "MIT OR Apache-2.0"
|
|
description = "Terminal session protocol: wire format, TtyBackend trait, TtyAdapter, and typed consumer client. Producer/consumer protocol crate on top of alkcall channels."
|
|
repository = "https://git.alk.dev/alkdev/alktty"
|
|
readme = "README.md"
|
|
keywords = ["tty", "terminal", "pty", "channels", "alkcall"]
|
|
categories = ["network-programming", "asynchronous"]
|
|
exclude = [".opencode/", "docs/reviews/", "docs/research/", "docs/sdd_process.md", "Cargo.lock"]
|
|
|
|
[lib]
|
|
name = "alktty"
|
|
|
|
[features]
|
|
default = []
|
|
# `local` is inherently non-wasm (portable-pty + tokio::process need a real
|
|
# OS). The default crate (no features) targets `wasm32-unknown-unknown`;
|
|
# enabling `local` on wasm is a build error by design — use a real OS for
|
|
# the local-process backend. The protocol crate (wire, negotiation,
|
|
# control, backend trait, adapter, session, channels) stays wasm-clean so
|
|
# downstream TS/Python adapters can compile it in a sandbox.
|
|
local = ["dep:portable-pty", "dep:tokio-util", "tokio/process", "tokio/rt-multi-thread"]
|
|
|
|
[dependencies]
|
|
alkcall = "0.4.0"
|
|
# Minimal, wasm-clean tokio features. `local` adds `process` +
|
|
# `rt-multi-thread` (non-wasm). Do NOT use `features = ["full"]` — it
|
|
# pulls in `signal`/`fs`/`net` which break `wasm32-unknown-unknown`.
|
|
tokio = { version = "1", default-features = false, features = ["rt", "sync", "io-util", "macros"] }
|
|
bytes = "1"
|
|
futures = "0.3"
|
|
futures-core = "0.3"
|
|
tokio-stream = "0.1"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
async-trait = "0.1"
|
|
tracing = "0.1"
|
|
thiserror = "2"
|
|
|
|
portable-pty = { version = "0.9", optional = true }
|
|
tokio-util = { version = "0.7", features = ["io"], optional = true }
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
libc = "0.2"
|
|
|
|
[dev-dependencies]
|
|
tokio = { version = "1", features = ["full", "test-util", "macros"] }
|
|
tokio-stream = "0.1"
|
|
serde_json = "1"
|
|
tempfile = "3"
|
|
bytes = "1"
|