open-standards/eoc/eoc-rs/crates/eoc-tools/src/lib.rs
Transaction Science 3fe109d58f ingest batch 4: 9 crates · table-stakes completers across all three workspaces
OpenPay (3 crates, ~13k LOC, 175 tests)
  op-connect           sub-merchant onboarding + KYB + split-payments + payouts + 1099-K
  op-3ds2              3DS2.3 SCA processor (AReq/ARes/CReq/CRes/RReq/RRes + exemptions)
  op-tax               US/EU/UK/AU/CA/IN tax with Avalara/Stripe/CCH/Vertex/TaxJar adapters

Smart Byte (3 crates, ~7k LOC, 57 tests)
  smart-byte-libp2p    libp2p transport (kad/gossipsub/mdns/autonat/relay/dcutr/identify/ping/req_resp)
  smart-byte-crdt      LWW/GCounter/PnCounter/OrSet/LwwMap/RgaList/2P-Set + HLC + vector clock + Automerge/Yjs interop
  smart-byte-keri-witness  KERI key-rotation cycle + witness layer + watchers + recovery + delegation

EOC (3 crates, ~8k LOC, 108 tests)
  eoc-tools            function-calling across Anthropic/OpenAI/Google/Mistral/Cohere + parallel exec + sandbox
  eoc-multimodal       vision (CLIP/SigLIP/ColPali) + audio (Whisper/MMS) + video sampling + modality router
  eoc-spec-decode      vanilla + SpS-with-temp + lookahead speculative decoding + EAGLE/Medusa stubs

All three workspaces compile cleanly. Forbidden-unsafe, no unwrap outside tests.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-24 04:00:04 -04:00

47 lines
1.8 KiB
Rust

//! EOC tool-use / function-calling substrate.
//!
//! Modern LLM workflows are not single-turn completions: the model emits
//! a structured *tool-call request*, an orchestrator runs the tool, the
//! result is fed back in, and the loop repeats until the model returns a
//! plain answer. To be a complete substrate EOC ingests the protocol
//! surface that sits underneath that pattern:
//!
//! * [`schema`] — canonical [`ToolSchema`] derived from a Rust type via
//! `schemars` (`#[derive(JsonSchema)]`).
//! * [`tool`] — the [`Tool`] trait + [`ToolRegistry`] dispatcher.
//! * Per-vendor adapters ([`anthropic_schema`], [`openai_schema`],
//! [`google_schema`], [`mistral_schema`], [`cohere_schema`]) that
//! translate the canonical schema to/from each provider's wire shape.
//! * [`parallel`] — bounded-concurrency parallel tool execution.
//! * [`tool_loop`] — the multi-turn orchestration loop with joule-cost
//! accumulation.
//! * [`builtins`] — sandboxed reference tools (shell, http, sql, file,
//! search).
//! * [`safety`] — pre/post invocation policies (rate limit, jailbreak
//! match, PII redaction).
//!
//! The crate is `#![forbid(unsafe_code)]` and contains no `unwrap`
//! outside of `#[test]` blocks.
#![forbid(unsafe_code)]
#![warn(missing_docs)]
pub mod anthropic_schema;
pub mod builtins;
pub mod cohere_schema;
pub mod error;
pub mod google_schema;
pub mod mistral_schema;
pub mod openai_schema;
pub mod parallel;
pub mod safety;
pub mod schema;
pub mod tool;
pub mod tool_loop;
pub use error::{ToolError, ToolResult};
pub use parallel::{ParallelConfig, ToolCallResult, execute_parallel};
pub use safety::{Decision, ToolPolicy};
pub use schema::{ToolSchema, schema_for};
pub use tool::{Tool, ToolCallRequest, ToolRegistry};
pub use tool_loop::{SchemaTranslator, ToolLoop};