The channels path no longer carries a second negotiation frame on the channel's data stream (ADR-009). The open op's registry-validated input IS the negotiation: - producer: make_tty_open_handler parses the open op's input into a NegotiateRequest and drives the new drive_session_pre_negotiated (same three-pump driver as drive_session, minus the wire-frame negotiation phase; validate/allocate factored into validate_and_allocate, shared by both paths). Post-open failures (unknown backend, allocate_failed, ownership denial) still go to the client as a 0x00-prefixed negotiation error frame, so the consumer's M1 disambiguation read applies unchanged. The tty:open scope gate is enforced by the registry's AccessControl (not re-checked in the handler). - consumer: open_via_channels parses params locally (fail-fast before a channel is allocated), opens the channel, and starts raw-chunk mode directly (from_halves_raw — no negotiation write; the 0x00-error-frame peek retained). - tty_open_spec's input schema is now the partial NegotiateRequest shape (carriage/backend/cmd required; backend params stay free-form — raw JSON Schema is permissive on unknown keys). Prerequisites landed upstream: alkcall 0.4.0 enforces OperationSpec.input_schema at dispatch (the registry check this design leans on never existed before); alkcall 0.4.1 parks early-arrival chunks for un-adopted channels instead of dropping them — the open response / producer's-first-write race was silently losing the first chunks (found by L3's test; the session never resolved). L3: open_via_channels + from_bidi_stream_via now covered end-to-end (5 session tests + pre-negotiated adapter test + shared-harness tests in the new crate::testing module; the channels harness moved there so session tests share it). Verification: cargo test 93 lib (default), 116 lib + 19 integration (--all-features); clippy -D warnings native + wasm clean; fmt clean; doc 0 warnings; wasm check clean.
54 lines
1.9 KiB
TOML
54 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"
|
|
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"
|