pub struct SomaApplication { /* private fields */ }Expand description
Shared use-case facade every surface (MCP, REST, CLI) calls into.
Wraps the legacy SomaService and ProviderRegistry plus the outbound
ApplicationPorts (gateway, code mode, OpenAPI), exposing one method per
application operation.
Implementations§
Source§impl SomaApplication
impl SomaApplication
Sourcepub fn new(
legacy_service: Arc<SomaService>,
legacy_registry: Arc<ProviderRegistry>,
ports: ApplicationPorts,
) -> Self
pub fn new( legacy_service: Arc<SomaService>, legacy_registry: Arc<ProviderRegistry>, ports: ApplicationPorts, ) -> Self
Assemble the facade from its service, provider registry, and outbound ports.
Sourcepub async fn execute_action(
&self,
request: ExecuteActionRequest,
context: ExecutionContext,
) -> Result<ExecuteActionResponse, ApplicationError>
pub async fn execute_action( &self, request: ExecuteActionRequest, context: ExecutionContext, ) -> Result<ExecuteActionResponse, ApplicationError>
Dispatch an action through the provider registry and return its output.
Sourcepub fn elicited_name_greeting(&self, outcome: ElicitedName) -> Value
pub fn elicited_name_greeting(&self, outcome: ElicitedName) -> Value
Build the greeting for the elicited-name demo from the collected outcome.
Sourcepub fn scaffold_intent(
&self,
request: ScaffoldIntentRequest,
) -> Result<Value, ApplicationError>
pub fn scaffold_intent( &self, request: ScaffoldIntentRequest, ) -> Result<Value, ApplicationError>
Normalize elicited scaffold requirements into the JSON handoff contract.
Sourcepub fn catalog_snapshot(&self) -> CatalogSnapshot
pub fn catalog_snapshot(&self) -> CatalogSnapshot
Return a snapshot of the currently loaded provider catalog.
Sourcepub fn resolve_cli_action(
&self,
command: &str,
) -> Result<String, ApplicationError>
pub fn resolve_cli_action( &self, command: &str, ) -> Result<String, ApplicationError>
Resolve a CLI command name to its backing action, or a not-found error.
Sourcepub fn action_requires_confirmation(&self, action: &str) -> bool
pub fn action_requires_confirmation(&self, action: &str) -> bool
Report whether the action is destructive and requires explicit confirmation.
Sourcepub fn provider_for_action(&self, action: &str) -> Option<String>
pub fn provider_for_action(&self, action: &str) -> Option<String>
Return the name of the provider that owns the given action, if any.
Sourcepub fn provider_validation_summary(&self) -> Value
pub fn provider_validation_summary(&self) -> Value
Return the provider validation summary for the loaded catalog.
Sourcepub fn provider_inspection_report(&self) -> Value
pub fn provider_inspection_report(&self) -> Value
Return the detailed provider inspection report for the loaded catalog.
Sourcepub fn resolve_rest_route(&self, method: &str, path: &str) -> Option<String>
pub fn resolve_rest_route(&self, method: &str, path: &str) -> Option<String>
Resolve an HTTP method and path to its backing action, if a route matches.
Sourcepub fn openapi_document(&self) -> Result<Value, ApplicationError>
pub fn openapi_document(&self) -> Result<Value, ApplicationError>
Return the runtime OpenAPI document assembled from the provider catalog.
Sourcepub fn refresh_providers(&self) -> Result<CatalogSnapshot, ApplicationError>
pub fn refresh_providers(&self) -> Result<CatalogSnapshot, ApplicationError>
Reload file-backed providers and return the resulting catalog snapshot.
Sourcepub fn refresh_providers_in_place(&self) -> Result<(), ApplicationError>
pub fn refresh_providers_in_place(&self) -> Result<(), ApplicationError>
Reload file-backed providers without returning a snapshot.
Sourcepub async fn read_resource(
&self,
request: ReadResourceRequest,
context: ExecutionContext,
) -> Result<ResourceContent, ApplicationError>
pub async fn read_resource( &self, request: ReadResourceRequest, context: ExecutionContext, ) -> Result<ResourceContent, ApplicationError>
Read a provider resource by URI and return its text or blob content.
Sourcepub fn list_resources(&self) -> Vec<ProviderResource>
pub fn list_resources(&self) -> Vec<ProviderResource>
List the exact (non-templated) provider resources in the catalog.
Sourcepub fn list_resource_templates(&self) -> Vec<ResourceTemplateSpec>
pub fn list_resource_templates(&self) -> Vec<ResourceTemplateSpec>
List the dynamic (URI-templated) provider resource templates in the catalog.
Sourcepub fn list_prompts(&self) -> Vec<ProviderPrompt>
pub fn list_prompts(&self) -> Vec<ProviderPrompt>
List the servable provider prompts in the catalog.
Sourcepub fn get_prompt(
&self,
name: &str,
context: &ExecutionContext,
) -> Result<ProviderPrompt, ApplicationError>
pub fn get_prompt( &self, name: &str, context: &ExecutionContext, ) -> Result<ProviderPrompt, ApplicationError>
Fetch a servable prompt by name, enforcing scope visibility.
Sourcepub async fn gateway_status(
&self,
context: ExecutionContext,
) -> Result<OperationResponse, ApplicationError>
pub async fn gateway_status( &self, context: ExecutionContext, ) -> Result<OperationResponse, ApplicationError>
Query the MCP gateway status via the gateway port.
Sourcepub async fn gateway_reload(
&self,
request: GatewayReloadRequest,
context: ExecutionContext,
) -> Result<OperationResponse, ApplicationError>
pub async fn gateway_reload( &self, request: GatewayReloadRequest, context: ExecutionContext, ) -> Result<OperationResponse, ApplicationError>
Reload the MCP gateway configuration via the gateway port.
Sourcepub async fn gateway_execute(
&self,
request: GatewayExecuteRequest,
context: ExecutionContext,
) -> Result<OperationResponse, ApplicationError>
pub async fn gateway_execute( &self, request: GatewayExecuteRequest, context: ExecutionContext, ) -> Result<OperationResponse, ApplicationError>
Execute a gateway operation via the gateway port.
Sourcepub async fn gateway_mcp_tools(
&self,
scope: Option<&GatewayRouteScope>,
context: &ExecutionContext,
) -> Result<Vec<GatewayToolRoute>, ApplicationError>
pub async fn gateway_mcp_tools( &self, scope: Option<&GatewayRouteScope>, context: &ExecutionContext, ) -> Result<Vec<GatewayToolRoute>, ApplicationError>
List MCP tools exposed through the gateway, optionally filtered by scope.
Sourcepub async fn gateway_call_mcp_tool(
&self,
name: &str,
params: Value,
scope: Option<&GatewayRouteScope>,
context: &ExecutionContext,
) -> Result<Option<Value>, ApplicationError>
pub async fn gateway_call_mcp_tool( &self, name: &str, params: Value, scope: Option<&GatewayRouteScope>, context: &ExecutionContext, ) -> Result<Option<Value>, ApplicationError>
Call an MCP tool through the gateway, returning its result if routed.
Sourcepub async fn gateway_mcp_resources(
&self,
scope: Option<&GatewayRouteScope>,
context: &ExecutionContext,
) -> Result<Vec<GatewayResourceRoute>, ApplicationError>
pub async fn gateway_mcp_resources( &self, scope: Option<&GatewayRouteScope>, context: &ExecutionContext, ) -> Result<Vec<GatewayResourceRoute>, ApplicationError>
List MCP resources exposed through the gateway, optionally filtered by scope.
Sourcepub async fn gateway_read_mcp_resource(
&self,
uri: &str,
scope: Option<&GatewayRouteScope>,
context: &ExecutionContext,
) -> Result<Option<Value>, ApplicationError>
pub async fn gateway_read_mcp_resource( &self, uri: &str, scope: Option<&GatewayRouteScope>, context: &ExecutionContext, ) -> Result<Option<Value>, ApplicationError>
Read an MCP resource through the gateway, returning its content if routed.
Sourcepub async fn gateway_mcp_prompts(
&self,
scope: Option<&GatewayRouteScope>,
context: &ExecutionContext,
) -> Result<Vec<GatewayPromptRoute>, ApplicationError>
pub async fn gateway_mcp_prompts( &self, scope: Option<&GatewayRouteScope>, context: &ExecutionContext, ) -> Result<Vec<GatewayPromptRoute>, ApplicationError>
List MCP prompts exposed through the gateway, optionally filtered by scope.
Sourcepub async fn gateway_get_mcp_prompt(
&self,
name: &str,
arguments: Option<Map<String, Value>>,
scope: Option<&GatewayRouteScope>,
context: &ExecutionContext,
) -> Result<Option<Value>, ApplicationError>
pub async fn gateway_get_mcp_prompt( &self, name: &str, arguments: Option<Map<String, Value>>, scope: Option<&GatewayRouteScope>, context: &ExecutionContext, ) -> Result<Option<Value>, ApplicationError>
Fetch an MCP prompt through the gateway, returning its content if routed.
Sourcepub async fn codemode_execute(
&self,
request: CodeModeExecuteRequest,
context: ExecutionContext,
) -> Result<OperationResponse, ApplicationError>
pub async fn codemode_execute( &self, request: CodeModeExecuteRequest, context: ExecutionContext, ) -> Result<OperationResponse, ApplicationError>
Execute a Code Mode request via the code mode port.
Sourcepub async fn openapi_execute(
&self,
request: OpenApiExecuteRequest,
context: ExecutionContext,
) -> Result<OperationResponse, ApplicationError>
pub async fn openapi_execute( &self, request: OpenApiExecuteRequest, context: ExecutionContext, ) -> Result<OperationResponse, ApplicationError>
Execute an OpenAPI-backed request via the OpenAPI port.
Sourcepub async fn status(&self) -> Result<Value, ApplicationError>
pub async fn status(&self) -> Result<Value, ApplicationError>
Return the upstream service status.
Sourcepub async fn readiness(&self) -> Result<(), ApplicationError>
pub async fn readiness(&self) -> Result<(), ApplicationError>
Probe upstream readiness; Ok(()) when the dependency is reachable.
Sourcepub async fn doctor(&self) -> DoctorReport
pub async fn doctor(&self) -> DoctorReport
Run readiness and status probes and collect them into a diagnostic report.
Auto Trait Implementations§
impl Freeze for SomaApplication
impl !RefUnwindSafe for SomaApplication
impl Send for SomaApplication
impl Sync for SomaApplication
impl Unpin for SomaApplication
impl UnsafeUnpin for SomaApplication
impl !UnwindSafe for SomaApplication
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more