Commit Graph
4 Commits
Author SHA1 Message Date
glm-5.2 ae75a61722 Merge remote-tracking branch 'origin/feat/tty/control-messages' into develop 2026-07-07 13:52:01 +00:00
glm-5.2 8b8de61186 feat(tty): implement ControlMessage enum and signal_from_name
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
2026-07-07 13:51:32 +00:00
glm-5.2 17713a5c27 feat(tty): implement raw chunk codec (ChunkReader/ChunkWriter, RawError)
Port of the alknet-tty POC's raw.rs into crates/alknet-tty/src/wire.rs.
The Phase 2 'raw carriage' wire format (ADR-052):
[stream_type: u8][length: u32 be][payload bytes].

- STREAM_STDIN/STDOUT/STDERR/CONTROL constants (0-3)
- CHUNK_HEADER_LEN (5) and MAX_CHUNK_LEN (16 MiB)
- RawError: Io / ConnectionClosed / InvalidStreamType / ChunkTooLarge
- Chunk struct with stdin/stdout/stderr/control constructors
- ChunkReader::read_chunk validates stream_type and length, returns
  ConnectionClosed on clean UnexpectedEof (header or payload)
- ChunkWriter::write_chunk/write_stdin/write_control_json write
  header + payload + flush
- Round-trip tests for all four stream types, InvalidStreamType (4),
  ChunkTooLarge (> MAX_CHUNK_LEN), ConnectionClosed on truncated
  header and payload, via tokio::io::duplex
2026-07-07 13:51:31 +00:00
glm-5.2 da6333c206 feat(tty): initialize alknet-tty crate skeleton
Create crates/alknet-tty with Cargo.toml (alknet-core path dep, tokio,
bytes, futures-core, tokio-stream, serde, serde_json, async-trait,
tracing, thiserror — no portable_pty/bollard/russh/alknet-call per
ADR-057), the `local` feature gate (dep wiring deferred to
tty/local-feature-reexport), src/lib.rs with the crate doc comment and
module declarations, and skeleton modules (wire, control, negotiation,
backend, adapter) with doc comments and TODO markers. Add the crate to
the workspace members list.

cargo check, clippy -D warnings, and fmt --check all pass.
2026-07-07 13:46:11 +00:00