Skip to content

API Reference

ExportDescription
CoreLoaderPlugin lifecycle orchestrator — register, boot, shutdown
CoreEventBusOrdered, typed, replayable event bus with wildcard subscriptions
CoreInvariantEngineFail-closed invariant engine with append-only registration
createLogger(scope)Structured logger scoped to a module
CoreStateRegistryVersioned, append-only state store with snapshot/restore
FactoryPurpose
createHealthSentinel()Node health monitoring via heartbeats
createReleaseVerifier()Software release hash verification
createConfigGuardian()Configuration schema validation and migration
createSandboxPlugin()Isolated simulation, replay, and amendment engine
createGovernorPlugin()Token-based execution, policy enforcement, build queue
FactoryChain
createXrplAdapter()XRPL
createEthereumAdapter()Ethereum
createCosmosAdapter()Cosmos
ExportDescription
BasePluginAbstract base class with lifecycle defaults
ManifestBuilderFluent builder for type-safe plugin manifests
validatePlugin()Pre-registration validation
AttestationPipelineRelease attestation and build provenance
ExportDescription
GovernorPluginTop-level governor orchestrator (token issuance, policy, build queue)
TokenIssuerIssues and manages execution tokens with resource limits
PolicyEngineDeclarative rule engine that gates token requests (allow/deny/throttle)
BuildQueuePriority-ordered task queue drained against execution tokens
AuditLogImmutable audit trail for all governor actions
ExportDescription
SandboxPluginIsolated simulation, replay, and amendment engine
ReplayEngineDeterministic event replay from event bus history
AmendmentSimulatorSimulate protocol amendments and their state effects
SnapshotSerializerSerialize and restore sandbox state snapshots
InMemoryContainerRuntimeIn-memory container runtime for isolated execution
import { ... } from "@mcptoolshop/consensus-os"; // Full API
import { ... } from "@mcptoolshop/consensus-os/plugin"; // Plugin SDK + types
import { ... } from "@mcptoolshop/consensus-os/cli"; // CLI dispatch

353 tests across four categories:

CategoryTestsCoverage
Architecture16Structural invariant enforcement
Security27Abuse resistance and determinism
Stress22Edge cases and throughput
Unit288Component-level coverage
Terminal window
npm test # Full suite
npx vitest # Watch mode
AspectDetail
Data accessedIn-memory state for governance tokens, audit logs, policy evaluation
Data NOT accessedNo network egress, no telemetry, no cloud services, no credentials
PermissionsStandard Node.js process — no elevated permissions required
DependenciesZero runtime dependencies