Files
craft-libs/crates/control/Cargo.toml
T
dotCooCoo 17ba68ff57 craft-control: read request lines with craft-control-protocol's bounded reader
The server's private line reader is replaced by
craft_control_protocol::read_bounded_line, and client::outcome now
returns craft_control_protocol::reply_result. craft-control and
craft-control-protocol read the same request framing with one reader.

Behavior changes in the server's reader:
- A line longer than the server's max_line is refused even when its
  newline arrives in the same read. Before, the limit was checked only
  between reads, so such a line was accepted and up to one buffer past
  the limit was allocated.
- A read interrupted by a signal is retried instead of closing the
  connection.
- A \r before the newline is dropped from the line.
- The refusal names the limit: "request line longer than N bytes;
  closing the connection" instead of "request too large".
2026-11-20 11:29:47 -08:00

44 lines
1.7 KiB
TOML

[package]
name = "craft-control"
description = "The control channel any app may share: token files, the loopback server, and its requests; no UI toolkit"
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
repository.workspace = true
[lints]
workspace = true
[features]
default = []
# AI agents in the open window (desktop): the ArtCraft Launcher's switch, the connection file and
# the `<id>-cli mcp` side that finds the open window. The agent settings build without it.
agents = ["dep:craft-ai-agents", "dep:craft-atomic", "dep:craft-flags", "dep:dirs", "dep:log"]
[dependencies]
serde = { workspace = true }
serde_json = { workspace = true }
# The loopback server is for desktop apps; the web app is driven through the page instead.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# The per-launch control token: 32 random bytes from the operating system (MIT OR Apache-2.0).
getrandom = "0.3"
# The request-line reader and the reply's result, shared with servers built on it (MIT OR Apache-2.0, ours).
craft-control-protocol = { workspace = true }
# The launcher's app list, read in one place for the launcher, the gateway and every app (MIT OR Apache-2.0, ours).
craft-ai-agents = { workspace = true, optional = true }
craft-atomic = { workspace = true, optional = true }
craft-flags = { workspace = true, optional = true }
# The system's Documents folder for the default agent folder, on every desktop system (MIT OR Apache-2.0).
dirs = { version = "7", optional = true }
log = { workspace = true, optional = true }
[dev-dependencies]
proptest = { workspace = true }
tempfile = "3"
[[test]]
name = "agents"
required-features = ["agents"]