Expand description
Plugin traits, registration context, and the extension contracts
(tower::Service<R> for every plugin surface — see ADR-006).
Strongly-typed Request / Response types per domain (request,
lifecycle, auth, token, oauth, queue, mcp) live in
submodules.
Plugin traits and registration context.
Defines Plugin, RegistrationContext, VectorHook, AiHook,
ComputedFieldHook, FieldMapping, ModelInfo, VectorBatcher,
EmbeddedFile. (The former ServiceContext was unified into
yeti_types::resource::Context .)
§Errors
Result-returning methods on the traits in this file (VectorHook,
AiHook, Plugin, ComputedFieldHook) carry implementation-defined
error semantics — the trait declares the shape (Result<T, String>
for hot-path hook traits, Result<T, YetiError> for Plugin
lifecycle), but the actual conditions that produce Err belong to
each implementor.
VectorHook/AiHookimpls in yeti-ai surface model-load, tokenizer, and inference failures asString. Hook implementors should document their own error contracts.Plugin::resources/on_ready/install_event_subscriberpropagateYetiErrorfrom plugin setup (table registration, route conflicts, bootstrap failures).
Per-method # Errors sections at the trait level would just say
“implementation-defined”, so the lint is suppressed at the module
level. Each impl crate documents its own error conditions.
Re-exports§
pub use trust::PluginTrustTier;pub use lifecycle::LifecycleEvent;pub use lifecycle::TelemetryEvent;pub use lifecycle::TelemetryService;pub use mcp::CallToolRequest;pub use mcp::CallToolResponse;pub use mcp::CallToolService;pub use mcp::ListToolsRequest;pub use mcp::ListToolsResponse;pub use mcp::ListToolsService;pub use mcp::ToolAnnotations;pub use mcp::ToolDefinition;pub use oauth::OAuthRequest;pub use oauth::OAuthResponse;pub use oauth::OAuthService;pub use request::ContextService;pub use request::RequestPipeline;pub use request::YetiRequest;pub use request::YetiResponse;pub use token::TokenRequest;pub use token::TokenResponse;pub use token::TokenService;
Modules§
- auth
- Identity → access resolution.
- lifecycle
- Fire-and-forget lifecycle and telemetry taps.
- mcp
- MCP tool registry hooks.
- oauth
- OAuth callback claim mutation.
- queue
- Durable / async job execution.
- request
- HTTP-shaped per-request work and the in-pipeline
Contextservice contract. - token
- JWT mint extension.
- trust
- Plugin trust tier — ADR-014 §4.
Structs§
- BoxClone
Service - A
Clone+SendboxedService. - BoxClone
Sync Service - A
Clone+Send+SyncboxedService. - BoxService
- A boxed
Service + Sendtrait object. - Embedded
File - A file embedded in the binary at compile time for static web serving.
- Field
Mapping - Mapping from a source field to a target vector field via an embedding model.
- Model
Info - Metadata about an available AI model.
- Registration
Context - Write context passed to
Plugin::register(). - Service
Builder - Declaratively construct
Servicevalues. - Service
Fn - A
Serviceimplemented by a closure. - Startup
Context - Read-only context passed to
Plugin::is_required(). - Vector
Batcher - Server-side micro-batcher for vector embeddings.
- Vector
Context - Per-app vector capabilities. Set once at startup, never changes per-request.
Traits§
- AiHook
- Hook for local LLM inference.
- Computed
Field Hook - Hook for computing virtual field values at read time.
- Layer
- Decorates a
Service, transforming either the request or the response. - Plugin
- Contract between the yeti binary and service crates.
- Service
- An asynchronous function from a
Requestto aResponse. - Service
Ext - An extension trait for
Services that provides a variety of convenient adapters - Table
Subscriber - Subscribe to row changes on a named table from a wasm application.
- Vector
Hook - Hook for automatic vector embedding generation.
Functions§
- service_
fn - Returns a new
ServiceFnwith the given closure.
Type Aliases§
- Plugin
Registry - Ordered list of service instances.
- PubSub
Lookup Fn - Closure type for looking up
PubSubmanagers by table name.