Skip to main content

Crate soma_provider_adapters

Crate soma_provider_adapters 

Source
Expand description

Reusable, product-neutral implementations of soma-provider-core contracts, plus feature-gated bridges onto other shared engines (soma-openapi, soma-codemode, soma-gateway). See plan section 3.9 and PR10’s deviation notes (in this crate’s individual module docs) for the reasoning behind what did and did not move here from soma-service.

No module here may depend on a crates/soma/* or apps/* crate under any feature — cargo tree -p soma-provider-adapters --all-features must stay shared-only.

Modules§

ai_sdk
The generic AI-SDK / sandboxed-TypeScript-handler provider kind: runs a drop-in .ts provider’s call(input) export in a bounded Node sidecar. Ported from soma-service::providers::ai_sdk with product types swapped for their soma-provider-core equivalents.
codemode
Thin bridge from a drop-in provider tool onto soma-codemode’s sandboxed JS snippet runner, satisfying plan section 3.9’s provider-adapters::codemode delegates to soma-codemode bridge.
error
Re-exports of the generic provider error type plus adapter-local error types shared across sidecar-executing adapters (ai-sdk, python).
gateway
Thin, product-neutral projections onto soma-gateway, the canonical upstream-MCP connection/routing engine (plan section “Upstream MCP decision”).
manifest_file
Generic manifest -> concrete-provider dispatch, factored out of Soma’s drop-in provider directory loader (FileProviderSource::provider_for_catalog, now in crates/soma/application/src/providers/filesystem.rs). Given an already-parsed, already-validated ProviderManifest and the file it came from, builds the matching adapter for its declared ProviderKind.
openapi
The generic OpenAPI provider kind: proxies a drop-in provider tool to a declared base_url + path/method, gated by the manifest’s capabilities.network.allowed_hosts grant.
python
The generic Python (/ LangChain / LlamaIndex) provider kind: introspects and executes a drop-in .py provider through a bounded Python sidecar running python_bridge::PYTHON_BRIDGE. Ported from soma-service::providers::python.
sidecar
Bounded child-process sidecar execution shared by the ai-sdk and python adapters (and any other adapter that shells out to a runtime process for one bounded, stdin-in/stdout-out call). Ported from soma-service::providers::sidecar with the env-var prefix generalized to a caller-supplied parameter — see the crate-level docs on why generic shared crates must not hard-code a product’s env prefix.
static_rust
The generic, declarative static-rust provider kind: a drop-in manifest with no external process, sidecar, or upstream call, whose tools either echo a canned meta.result value or, absent one, echo their own call shape back for inspection/testing. Ported from the private FileProvider struct in Soma’s filesystem loader (originally soma-service, now crates/soma/application), which is the actual product-neutral “static Rust provider abstraction” referenced by the architecture plan — Soma’s own concrete built-in-actions provider (also historically named static_rust.rs) is a distinct, product-specific instance that dispatches into SomaService and stays in crates/soma/application.
wasm
The generic WASM provider kind: runs a drop-in .wasm module’s exported soma_call ABI in a fuel-bounded wasmtime sandbox. Ported unchanged (beyond product-type swaps) from soma-service::providers::wasm.

Constants§

VERSION
Crate version from Cargo metadata.