Skip to main content

Crate soma_application

Crate soma_application 

Source
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 CapabilityBroker decides 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 ProviderRegistry resolves 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§

ApplicationError
Error type surfaced by the application layer, carrying a stable code, remediation guidance, and structured source-specific details.
ApplicationPorts
Bundle of the engine ports the application depends on.
CatalogSnapshot
Snapshot of the provider catalogs at a point in time.
CodeModeExecuteRequest
Request to execute a code-mode script with optional JSON input.
DoctorReport
Result of the doctor pre-flight readiness check.
ExecuteActionRequest
Request to execute a named action with free-form JSON parameters.
ExecuteActionResponse
Result of executing an action, pairing its output with a correlation id.
ExecutionContext
Per-request execution context threaded through the application layer, carrying caller identity, authorization mode, surface, and limits.
GatewayExecuteRequest
Request to execute a gateway action with free-form JSON parameters.
GatewayPromptRoute
A prompt advertised through the gateway routing layer.
GatewayReloadRequest
Request to reload the gateway with an optional replacement config.
GatewayResourceRoute
A resource advertised through the gateway routing layer.
GatewayRouteScope
Scope constraining which gateway upstreams and services a route may reach.
GatewayToolRoute
A tool advertised through the gateway routing layer.
OpenApiExecuteRequest
Request to invoke an OpenAPI operation with free-form JSON parameters.
OperationResponse
Result of an operation, pairing its output with a correlation id.
PortError
Error returned by an engine port when an operation cannot be completed.
ProviderError
ProviderOutput
ProviderPrompt
ProviderResource
ReadResourceRequest
Request to read a resource identified by URI.
ResourceTemplateSpec
Specification of a templated resource with a parameterized URI.
ScaffoldIntent
Elicited requirements for scaffolding a new Soma-based project.
ScaffoldIntentRequest
Parameters collected by the scaffold-intent wizard to generate a new server.
ScaffoldIntentValidationError
Validation failure for a ScaffoldIntent, carrying a stable code and remediation hint.
SomaApplication
Shared use-case facade every surface (MCP, REST, CLI) calls into.
SomaService
The service layer — wraps the transport client and adds business logic.

Enums§

ApplicationErrorDetails
Source-specific detail attached to an ApplicationError.
ElicitedName
Outcome of an MCP elicitation prompt asking the client for a name.
ElicitedNameOutcome
Outcome of the elicited-name demo, mirroring the MCP elicitation result states.
ResourceContent
Content returned when reading a resource, either text or binary blob.

Traits§

CodeModePort
Port to the Code Mode engine that runs sandboxed JavaScript against the tool catalog.
GatewayPort
Port to the MCP gateway engine: status, reload, execution, and tool/resource/prompt routing.
OpenApiPort
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_DIR or providers).
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 matching SomaService method.
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.