Port the POC's control channel schema (alknet-tty-poc/src/control.rs) into crates/alknet-tty/src/control.rs: the ControlMessage tagged enum (Resize/Signal/Eof/Exit) with snake_case type tag, to_json/from_slice helpers, and the Unix-only signal_from_name mapping the 9 supported signal names to libc numbers. Unknown type tags return a serde_json error; the adapter (later task) ignores that error per the wire spec's extensibility policy. Adds libc as a target.'cfg(unix)' dependency. Refs: docs/architecture/crates/tty/tty-wire.md §"Control Channel" Refs: docs/architecture/decisions/055-exit-code-on-control-chunk.md
31 lines
806 B
TOML
31 lines
806 B
TOML
[package]
|
|
name = "alknet-tty"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "Terminal session protocol handler for the `alknet/tty` ALPN: wire format, TtyBackend trait, and TtyAdapter (ProtocolHandler)"
|
|
repository.workspace = true
|
|
|
|
[lib]
|
|
name = "alknet_tty"
|
|
|
|
[features]
|
|
default = []
|
|
# `local` re-exports `alknet_tty_local::LocalTtyBackend`. The
|
|
# `dep:alknet-tty-local` dependency is wired in task `tty/local-feature-reexport`.
|
|
local = []
|
|
|
|
[dependencies]
|
|
alknet-core = { path = "../alknet-core" }
|
|
tokio = { version = "1", features = ["full"] }
|
|
bytes = "1"
|
|
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"
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
libc = "0.2" |