liminal-cli 0.3.1

The liminal command: serve the network, maintain its stores, or serve its discovery MCP over stdio
Documentation
//! Proposals carry paths and invocation data; the server pins and holds them.

use super::tools::ToolResult;
use crate::network::Rail;
use serde_json::{Map, Value, json};

/// The proposal names no subjects or digest: both come from the server's site.
#[must_use]
pub fn tool_entries() -> Vec<Value> {
    vec![
        json!({"name":"propose_template","description":"Propose the bound builder's command for its site. The server validates operator roots, hashes the file and holds exact path, digest, args, environment names and subjects for a person's approval.",
        "inputSchema":{"type":"object","required":["service","command","args","env","stop_timeout_ms"],"additionalProperties":false,
            "properties":{"service":{"type":"string"},"command":{"type":"string"},"args":{"type":"array","items":{"type":"string"}},
                "env":{"type":"array","items":{"type":"string"}},"stop_timeout_ms":{"type":"integer","minimum":1},"operation":{"type":"string"}}}}),
    ]
}

/// Forwards the invocation on the ticket's rail, never running the command.
#[must_use]
pub fn tool<R: Rail>(rail: &R, name: &str, arguments: &Map<String, Value>) -> Option<ToolResult> {
    (name == "propose_template").then(|| super::plan_tools::forward(rail, name, arguments))
}

#[cfg(test)]
#[path = "template_tools_tests.rs"]
mod tests;