Skip to main content

SomaApplication

Struct SomaApplication 

Source
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

Source

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.

Source

pub async fn execute_action( &self, request: ExecuteActionRequest, context: ExecutionContext, ) -> Result<ExecuteActionResponse, ApplicationError>

Dispatch an action through the provider registry and return its output.

Source

pub fn elicited_name_greeting(&self, outcome: ElicitedName) -> Value

Build the greeting for the elicited-name demo from the collected outcome.

Source

pub fn scaffold_intent( &self, request: ScaffoldIntentRequest, ) -> Result<Value, ApplicationError>

Normalize elicited scaffold requirements into the JSON handoff contract.

Source

pub fn catalog_snapshot(&self) -> CatalogSnapshot

Return a snapshot of the currently loaded provider catalog.

Source

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.

Source

pub fn action_requires_confirmation(&self, action: &str) -> bool

Report whether the action is destructive and requires explicit confirmation.

Source

pub fn provider_for_action(&self, action: &str) -> Option<String>

Return the name of the provider that owns the given action, if any.

Source

pub fn provider_validation_summary(&self) -> Value

Return the provider validation summary for the loaded catalog.

Source

pub fn provider_inspection_report(&self) -> Value

Return the detailed provider inspection report for the loaded catalog.

Source

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.

Source

pub fn openapi_document(&self) -> Result<Value, ApplicationError>

Return the runtime OpenAPI document assembled from the provider catalog.

Source

pub fn refresh_providers(&self) -> Result<CatalogSnapshot, ApplicationError>

Reload file-backed providers and return the resulting catalog snapshot.

Source

pub fn refresh_providers_in_place(&self) -> Result<(), ApplicationError>

Reload file-backed providers without returning a snapshot.

Source

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.

Source

pub fn list_resources(&self) -> Vec<ProviderResource>

List the exact (non-templated) provider resources in the catalog.

Source

pub fn list_resource_templates(&self) -> Vec<ResourceTemplateSpec>

List the dynamic (URI-templated) provider resource templates in the catalog.

Source

pub fn list_prompts(&self) -> Vec<ProviderPrompt>

List the servable provider prompts in the catalog.

Source

pub fn get_prompt( &self, name: &str, context: &ExecutionContext, ) -> Result<ProviderPrompt, ApplicationError>

Fetch a servable prompt by name, enforcing scope visibility.

Source

pub async fn gateway_status( &self, context: ExecutionContext, ) -> Result<OperationResponse, ApplicationError>

Query the MCP gateway status via the gateway port.

Source

pub async fn gateway_reload( &self, request: GatewayReloadRequest, context: ExecutionContext, ) -> Result<OperationResponse, ApplicationError>

Reload the MCP gateway configuration via the gateway port.

Source

pub async fn gateway_execute( &self, request: GatewayExecuteRequest, context: ExecutionContext, ) -> Result<OperationResponse, ApplicationError>

Execute a gateway operation via the gateway port.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub async fn codemode_execute( &self, request: CodeModeExecuteRequest, context: ExecutionContext, ) -> Result<OperationResponse, ApplicationError>

Execute a Code Mode request via the code mode port.

Source

pub async fn openapi_execute( &self, request: OpenApiExecuteRequest, context: ExecutionContext, ) -> Result<OperationResponse, ApplicationError>

Execute an OpenAPI-backed request via the OpenAPI port.

Source

pub async fn status(&self) -> Result<Value, ApplicationError>

Return the upstream service status.

Source

pub async fn readiness(&self) -> Result<(), ApplicationError>

Probe upstream readiness; Ok(()) when the dependency is reachable.

Source

pub async fn doctor(&self) -> DoctorReport

Run readiness and status probes and collect them into a diagnostic report.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> ParallelSend for T

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,