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)

§Beside the extension points

ModuleWhat it holds
conformancethe report that grades a dialect against everything it owes, run from the dialect’s own tests
resolvea platform name, an alias or name@version, turned into the dialect that renders it
processthe one dialect registry a process resolves names against, and the plugin directory that feeds it
dynamicloading a plugin built as a shared library, and refusing one built differently from the razeri that loads it
alertingalert rules and health summaries evaluated over the event stream
sinksthe event sinks razeri ships, written against the same EventSink trait a plugin implements

§Composition Root

Use PluginRegistryBuilder to wire everything together at application startup, then pass the resulting PluginRegistry to subsystems. The builder’s own page shows it in use.

Re-exports§

pub use builder::PluginRegistryBuilder;
pub use dialect::DeployClient;
pub use dialect::DeployScript;
pub use dialect::DialectHandle;
pub use dialect::DialectInfo;
pub use dialect::PlatformDialect;
pub use dialect::PlatformRegistry;
pub use dialect::UnsupportedVersion;
pub use dynamic::BuildDeclaration;
pub use dynamic::BuildDeclarationFn;
pub use dynamic::BuildPart;
pub use dynamic::PLUGIN_BUILD_SYMBOL;
pub use dynamic::PLUGIN_REGISTER_SYMBOL;
pub use dynamic::PluginLoadResult;
pub use dynamic::PluginRefusal;
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 process::InstallError;
pub use process::PLUGIN_DIR_ENV;
pub use process::PluginDirReport;
pub use process::install_plugin_dir;
pub use process::plugin_dir_from_environment;
pub use process::plugin_dir_report;
pub use process::process_registry;
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::PluginRegistration;
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
Loading plugins built as shared libraries.
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.
process
One dialect registry per process.
registry
Unified plugin registry aggregating all sub-registries.
resolve
Resolving a platform name to the dialect that renders it.
routine_render
The named routine grammars, spelled.
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.

Macros§

export_plugin
Make a crate a razeri plugin, in one line.

Structs§

EngineVersion
A version of an engine: 17, 8.4, 2022, 23ai.

Enums§

EngineVersionError
Why a spelling is not a version, with the spelling that is, where there is one.

Functions§

render_procedure_as
Spell this procedure in a named grammar.
render_scalar_function_as
Spell this scalar function in a named grammar.
render_table_function_as
Spell this table-valued function in a named grammar.
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.