Skip to main content

Crate razeri_plugin_api

Crate razeri_plugin_api 

Source
Expand description

§razeri-plugin-api

Extension point traits and registries for the Razeri platform.

This crate defines the plugin API surface — the traits that third-party developers implement to extend Razeri with new database dialects, storage backends, LLM providers, language renderers, and event sinks.

§Extension Points

TraitRegistryKey Type
PlatformDialectPlatformRegistrystring (canonical name)
StorageProviderFactoryStorageRegistryStoragePlatform enum + string
LlmClientFactory / LlmClientLlmRegistrystring
LlmModelAdapterModelRegistry(provider, model) pair
LanguageRendererFactoryLanguageRegistrystring
EventSinkEventRegistryfan-out (all sinks)

§Composition Root

Use PluginRegistryBuilder to wire everything together at application startup, then pass the resulting PluginRegistry to subsystems:

ⓘ
let registry = PluginRegistryBuilder::new()
    .with_dialect("postgres", Arc::new(pg_dialect))
    .with_llm("ollama".into(), Arc::new(ollama_factory))
    .with_auto_discovered()
    .build();

Re-exports§

pub use builder::PluginRegistryBuilder;
pub use dialect::DialectInfo;
pub use dialect::PlatformDialect;
pub use dialect::PlatformRegistry;
pub use dynamic::API_VERSION;
pub use dynamic::ApiVersionFn;
pub use dynamic::PLUGIN_API_VERSION_SYMBOL;
pub use dynamic::PLUGIN_REGISTER_SYMBOL;
pub use dynamic::PluginLoadResult;
pub use dynamic::RegisterPluginFn;
pub use dynamic::load_plugins_from_dir;
pub use error::EventSinkError;
pub use error::LanguageError;
pub use error::LlmError;
pub use error::StorageError;
pub use event::EventCategory;
pub use event::EventEmitter;
pub use event::EventFilterKeys;
pub use event::EventPayload;
pub use event::EventQuery;
pub use event::EventRegistry;
pub use event::EventSeverity;
pub use event::EventSink;
pub use event::EventSubject;
pub use event::EventSubjectKind;
pub use event::EventSummary;
pub use event::EventValidationError;
pub use event::RazeriEvent;
pub use event::WorkflowContext;
pub use language::LanguageRegistry;
pub use language::LanguageRenderer;
pub use language::LanguageRendererFactory;
pub use llm::ChatResponse;
pub use llm::LlmClient;
pub use llm::LlmClientFactory;
pub use llm::LlmRegistry;
pub use llm::Message;
pub use llm::ModelInfo;
pub use llm::TokenUsage;
pub use model::LlmModelAdapter;
pub use model::ModelCapabilities;
pub use model::ModelRegistry;
pub use registry::PluginRegistry;
pub use resolve::ResolveError;
pub use storage::StorageListEntry;
pub use storage::StorageMetadata;
pub use storage::StorageOps;
pub use storage::StorageProviderFactory;
pub use storage::StorageRegistry;
pub use sinks::jsonl::JsonlSink;
pub use sinks::stdout::StdoutSink;
pub use sinks::webhook::WebhookSink;
pub use sinks::EventSinkConfig;
pub use sinks::create_sink;
pub use alerting::AlertCondition;
pub use alerting::AlertMetric;
pub use alerting::AlertResult;
pub use alerting::AlertRule;
pub use alerting::AlertScope;
pub use alerting::ComparisonOp;
pub use alerting::HealthDomain;
pub use alerting::HealthStatus;
pub use alerting::HealthSummary;
pub use alerting::SinkStatus;
pub use alerting::discover_health;
pub use alerting::evaluate_rules;
pub use alerting::health_for_domain;
pub use builder::DialectRegistration;
pub use builder::EventSinkRegistration;
pub use builder::LanguageRegistration;
pub use builder::LlmRegistration;
pub use builder::ModelRegistration;
pub use builder::StorageRegistration;
pub use razeri_plugin_contract;

Modules§

alerting
Alerting and health summary model for the canonical event stream.
builder
Fluent builder for constructing a PluginRegistry at application startup.
conformance
Every obligation a dialect owes, reported at once.
dialect
Platform dialect trait and registry for database SQL rendering.
dynamic
FFI-safe dynamic plugin loading.
error
Error types for Razeri plugin API.
event
Structured event sink trait and fan-out registry.
language
Language renderer factory trait and registry.
llm
LLM client factory trait and registry.
model
LLM model adapter trait and registry.
registry
Unified plugin registry aggregating all sub-registries.
resolve
Resolving a platform name to the dialect that renders it.
sinks
Built-in event sinks, implemented against the same public traits a third-party sink uses — nothing here has access a plugin author lacks.
storage
Storage provider factory trait and registry.

Functions§

resolve_dialect_by_name
Resolve a platform name to the dialect that renders it.
try_resolve_dialect_by_name
Resolve a dialect by string name, returning None on failure.