`huginn-daemon` becomes a library and a binary. `Daemon` holds one mind and dispatches a `HuginnMindRequest` to the `Mind` method that answers it, with no socket and no clock: `now` is the caller's. Every read that names an instance is put to `Mind::require_instance` before the method runs, so ruling 14 is checked once, by its owner, whichever side of the wire the request came from. `IndexSink` is where Cut 11 attaches; its error is logged and the outcome is what the mind decided. `envelope` carries the vocabulary in CultNet's `cultnet.operation_request.v0` and `cultnet.operation_response.v0` as base64 of named MessagePack, which is what the C# reference and Eve's plugin ABI speak. The envelope's operation string is checked against the decoded payload rather than trusted. A message that does not decode is answered with a typed failure naming its code, and reaches no mind. `serve` binds one non-blocking socket on CultNet's operation connection id and answers each frame on the session it arrived on. A refusal is an answer with a `rejected` status, never a transport error. The two wire schemas go out on a schema catalog request. A hostile datagram and a departed peer are logged and served past. `startup` is the one place the mind opens and the socket binds, in that order, so a mind that will not open leaves the port free. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
32 lines
921 B
TOML
32 lines
921 B
TOML
[package]
|
|
name = "huginn-daemon"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
publish.workspace = true
|
|
|
|
# The organ's CultNet surface: the socket, the sessions, the process lifetime
|
|
# and the operation envelope, and no rule. Every rule, the instance check, the
|
|
# receipt, the status and the wire vocabulary are `huginn-mind`'s, and the leaf
|
|
# and the store type are reached through it so one crate pins one revision.
|
|
[lib]
|
|
name = "huginn_daemon"
|
|
path = "src/lib.rs"
|
|
|
|
[[bin]]
|
|
name = "huginn-daemon"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
anyhow = "1"
|
|
base64 = "0.22"
|
|
chrono = "0.4.44"
|
|
cultnet-rs = { git = "https://github.com/GameCult/CultLib.git", rev = "a0813c6eed24d30bf88073ef615b633c77ebfcd6", package = "cultnet-rs" }
|
|
huginn-mind = { path = "../huginn-mind" }
|
|
rmp-serde = "1"
|
|
schemars = "1"
|
|
serde = { version = "1", features = ["derive"] }
|
|
signal-hook = "0.3"
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3"
|