Skip to main content

machi_protocol/
lib.rs

1//! Wire-agnostic protocol types shared across tools, LLM adapters, and hosts.
2//!
3//! This crate sits above [`machi_types`] in the DAG and must not depend on
4//! HTTP clients, provider SDKs, or runtime I/O.
5
6#![forbid(unsafe_code)]
7
8pub mod content;
9pub mod observability;
10pub mod tokens;
11pub mod tool_id;
12
13pub use content::{ContentBlock, ImageBlock};
14pub use observability::{
15    SPAN_COMPACT, SPAN_SAMPLE, SPAN_SESSION, SPAN_SPAWN, SPAN_TOOL, SPAN_TOOL_BATCH, SPAN_TURN,
16    SPAN_WORKFLOW, SPAN_WORKFLOW_HOST, field, required_span_names, span_catalogue_snapshot,
17};
18pub use tokens::{
19    IMAGE_TOKEN_COST, MESSAGE_FRAME_TOKENS, PreflightOverflow, check_context_overflow,
20    estimate_image_tokens, estimate_text_tokens,
21};
22pub use tool_id::ToolId;