Expand description
Soma application layer.
Hosts SomaApplication, the shared use-case facade every surface (MCP,
REST, CLI) calls into, along with the SomaService business layer, the
provider registry, and the free functions that dispatch actions across
surfaces with consistent observability.
Re-exports§
pub use provider_registry::DynamicResourceTemplate;pub use provider_registry::ProviderAuthMode;pub use provider_registry::ProviderCall;pub use provider_registry::ProviderPrincipal;pub use provider_registry::ProviderRegistry;pub use provider_registry::ProviderRequestLimits;pub use provider_registry::ProviderSurface;pub use provider_registry::RegistrySnapshot;pub use provider_registry::ResourceReadOutput;pub use providers::filesystem::FileProviderSource;pub use providers::remote::RemoteCatalogProvider;pub use providers::static_rust::StaticRustProvider;
Modules§
- capabilities
- Capability brokering: the
CapabilityBrokerdecides which host capabilities a provider dispatch may use, defaulting to deny. - provider_
errors - Compatibility exports for generic provider errors now owned by
soma-provider-core. - provider_
registry - Provider dispatch registry: the
ProviderRegistryresolves actions to providers, builds catalog snapshots, and indexes resources and prompts. - providers
- Provider source implementations feeding the
ProviderRegistry: static Rust actions, file-backed manifests and resources, and remote catalogs.
Structs§
- Application
Error - Error type surfaced by the application layer, carrying a stable code, remediation guidance, and structured source-specific details.
- Application
Ports - Bundle of the engine ports the application depends on.
- Catalog
Snapshot - Snapshot of the provider catalogs at a point in time.
- Code
Mode Execute Request - Request to execute a code-mode script with optional JSON input.
- Doctor
Report - Result of the
doctorpre-flight readiness check. - Execute
Action Request - Request to execute a named action with free-form JSON parameters.
- Execute
Action Response - Result of executing an action, pairing its output with a correlation id.
- Execution
Context - Per-request execution context threaded through the application layer, carrying caller identity, authorization mode, surface, and limits.
- Gateway
Execute Request - Request to execute a gateway action with free-form JSON parameters.
- Gateway
Prompt Route - A prompt advertised through the gateway routing layer.
- Gateway
Reload Request - Request to reload the gateway with an optional replacement config.
- Gateway
Resource Route - A resource advertised through the gateway routing layer.
- Gateway
Route Scope - Scope constraining which gateway upstreams and services a route may reach.
- Gateway
Tool Route - A tool advertised through the gateway routing layer.
- Open
ApiExecute Request - Request to invoke an OpenAPI operation with free-form JSON parameters.
- Operation
Response - Result of an operation, pairing its output with a correlation id.
- Port
Error - Error returned by an engine port when an operation cannot be completed.
- Provider
Error - Provider
Output - Provider
Prompt - Provider
Resource - Read
Resource Request - Request to read a resource identified by URI.
- Resource
Template Spec - Specification of a templated resource with a parameterized URI.
- Scaffold
Intent - Elicited requirements for scaffolding a new Soma-based project.
- Scaffold
Intent Request - Parameters collected by the scaffold-intent wizard to generate a new server.
- Scaffold
Intent Validation Error - Validation failure for a
ScaffoldIntent, carrying a stable code and remediation hint. - Soma
Application - Shared use-case facade every surface (MCP, REST, CLI) calls into.
- Soma
Service - The service layer — wraps the transport client and adds business logic.
Enums§
- Application
Error Details - Source-specific detail attached to an
ApplicationError. - Elicited
Name - Outcome of an MCP elicitation prompt asking the client for a name.
- Elicited
Name Outcome - Outcome of the elicited-name demo, mirroring the MCP elicitation result states.
- Resource
Content - Content returned when reading a resource, either text or binary blob.
Traits§
- Code
Mode Port - Port to the Code Mode engine that runs sandboxed JavaScript against the tool catalog.
- Gateway
Port - Port to the MCP gateway engine: status, reload, execution, and tool/resource/prompt routing.
- Open
ApiPort - Port to the OpenAPI engine that dispatches requests against described APIs.
Functions§
- classify_
service_ error - Classify an arbitrary error into a structured [
ServiceError] taxonomy, recognizing action-validation and scaffold-intent validation failures. - dispatch_
action - Unified dispatch seam shared by every surface (MCP, REST, CLI).
- dynamic_
provider_ registry - Build a registry combining the static provider with file-backed providers
loaded from the default provider directory (
SOMA_PROVIDER_DIRorproviders). - dynamic_
provider_ registry_ from_ dir - Build a registry combining the static provider with file-backed providers loaded from the given directory.
- execute_
service_ action - Route a [
SomaAction] to the matchingSomaServicemethod. - is_
validation_ error - Report whether the error classifies as a validation failure.
- remote_
provider_ registry - Build a registry of
RemoteCatalogProviders from a remote server’s live provider catalog inspection. - static_
provider_ registry - Build a registry backed solely by the built-in
StaticRustProvider.