Skip to main content

Crate quorum_rs

Crate quorum_rs 

Source
Expand description

§quorum-rs

Trait definitions, data types, and runtime for building deliberation agents.

This crate provides the agent SDK plus a reference runtime: traits to code against, batteries-included implementations to compose with, and the NATS JetStream worker that ties them together.

Dual-licensed Apache-2.0 OR MIT.

Re-exports§

pub use agents::DeliberationPhase;
pub use agents::ProposalRecord;
pub use agents::config::AgentConfig;
pub use agents::config::TaskPrecision;
pub use agents::exec_agent::ExecAgent;
pub use agents::mcp_agent::ClaudeAgent;
pub use agents::mcp_agent::McpAgent;
pub use agents::AgentContext;
pub use agents::AgentHeartbeat;
pub use agents::AgentLiveStatus;
pub use agents::AgentPricingInfo;
pub use agents::AnnotationType;
pub use agents::CandidateProposal;
pub use agents::ChatCapable;
pub use agents::Evaluation;
pub use agents::EvaluationRecord;
pub use agents::HeuristicTokenEstimator;
pub use agents::InjectionPriority;
pub use agents::NsedAgent;
pub use agents::OperatorAnnotation;
pub use agents::OrchestratorPing;
pub use agents::PendingToolCall;
pub use agents::PersistenceStore;
pub use agents::Proposal;
pub use agents::TokenEstimator;
pub use agents::TokenUsage;
pub use agents::ToolCallStatus;
pub use agents::ToolChanges;
pub use agents::UserInjection;
pub use agents::UserToolDefinition;
pub use control_plane::AgentControlPlane;
pub use control_plane::ConfigPatch;
pub use crypto::AgentKeyPair;
pub use crypto::SigningHook;
pub use events::CategoryScoreBreakdown;
pub use events::JobCompleteEvent;
pub use events::ProposalControversyEntry;
pub use events::ProposalScoreEntry;
pub use events::RoundSummaryEvent;
pub use llms::AiModel;
pub use llms::ChatCompletionResult;
pub use llms::LlmRequestSpan;
pub use llms::RequestConfig;
pub use llms::SimpleOpenAIModel;
pub use llms::TimingMetadata;
pub use nats_utils::NatsAuth;
pub use nats_utils::OrchestratorEntry;
pub use nats_utils::connect_nats;
pub use nats_utils::sha256_hex;
pub use prompts::PromptSet;
pub use scheduling::PolicySla;
pub use status::AgentStatusSnapshot;
pub use status::EventLogEntry;
pub use status::ScoreEntry;
pub use status::SharedAgentStatus;
pub use status::TaskLogEntry;
pub use telemetry::AgentEventCommon;
pub use telemetry::FinishReason;
pub use telemetry::LlmError;
pub use telemetry::LlmErrorClass;
pub use telemetry::NatsConnectionState;
pub use telemetry::PromptExposureDetected;
pub use telemetry::RetryReason;
pub use telemetry::TaskFailureClass;
pub use telemetry::TelemetryConfig;
pub use telemetry::TelemetryContext;
pub use telemetry::TelemetryEmitter;
pub use telemetry::TelemetryEvent;
pub use telemetry::TelemetrySource;
pub use telemetry::derive_trace_id;
pub use telemetry::trace_id_for;
pub use tools::Tool;
pub use workers::buffer::AckHandle;
pub use workers::buffer::BufferEntryDetail;
pub use workers::buffer::BufferEntrySummary;
pub use workers::buffer::ResponseBuffer;
pub use workers::JobManifest;
pub use workers::NatsNsedWorker;
pub use workers::NatsScratchpadStore;
pub use workers::UserToolHandlerFactory;
pub use workers::WorkerConfig;
pub use workers::WorkerHook;
pub use quorum_crypto_core;

Modules§

agent_manager
Agent Lifecycle Manager
agents
api_error_middleware
Reusable axum middleware that emits TelemetryEvent::ApiError on every HTTP response with status >= 400. Mounts on any axum router an agent crate exposes (status-server dashboard, MCP HTTP front-end, etc.).
brand
Brand strings — banner ASCII, copy snippets used by quorum init and quorum validate. Kept in one module so a future rebrand changes one file, not 12 string-literal sites. “The Noolog Aesthetic” — all ANSI styling routes through this module.
cli
config
Agent fleet configuration loading and resolution.
control_plane
HITL control plane traits and types.
conversation
Canonical conversation → task-string flattening.
crypto
Transparent cryptographic signing for NSED agents.
dump_prompts
Opt-in outgoing prompt / request dumps for token-efficiency analysis.
events
Shared SSE event types used by both the orchestrator (publisher) and agent workers (consumer). These live in the SDK so that the dependency direction is always orchestrator → sdk, never the reverse.
init
Workspace + agent-fleet config primitives that quorum init composes: provider catalog, persona presets, yaml renderer, env-file merger, generic wizard helpers. No CLI surface — the binary-facing wizard lives at cli::commands::init_wizard. Interactive first-run setup wizard shared by nsed-orchestrator init and nsed-agent init.
llms
Defines the low-level traits for interacting with language models.
middleware
Agent middleware system — pluggable validation, transformation, and moderation.
multi_agent
Multi-Agent Runner
nats_utils
NATS utility functions for subject validation, KV bucket management, and authenticated connections.
orchestrator_registry
Dynamic orchestrator registry for runtime orchestrator management.
project_registry
Project registry — maps a project id (the epic’s root-commit key from patch-deliberation) to the agents that currently hold it.
project_sync
Client-side epic sync: clone the epic once (a full local replica for fast, offline browsing), then git pull on each project_advanced notification (delta sync).
prompts
Defines the traits and structs for managing prompt templates.
providers
Provider registry + factory pattern.
scheduling
Shared scheduling types used by both orchestrators and agents.
serve
serve_fleet — bring up multiple agents from a fleet config.
status
Agent status monitoring types + optional HTTP dashboard.
telemetry
Operational telemetry — independent log streams for orchestrator and agent processes.
tools
version_check
Best-effort “newer version available” check against crates.io.
workers
NATS JetStream worker that bridges the orchestrator’s task subjects to the agent’s propose/evaluate methods.

Macros§

emit_event
Emit a telemetry event when an emitter is available.
emit_for
Emit a telemetry event scoped to the task on the given context.