SmartHopper.Infrastructure
The orchestration layer: managers, pipelines, security, settings, and the MCP server. Everything here is provider-agnostic — API specifics live in SmartHopper.Providers.*.
Layout
| Folder | Responsibility |
|---|---|
AIProviders/ | ProviderManager — discovery, cryptographic verification (Authenticode + strong-name + SHA-256), trust, registration, settings persistence. AIProvider base flow: PreCallAsync → Call → PostCall. |
AICall/ | The AI request pipeline: AIRequestCall, AIBody, interactions (AIInteraction*), AIReturn, streaming adapters, JSON-schema adapters, policy pipeline, modality fallback, batch, metrics. |
AIContext/ | AIContextManager — registers context providers and collects context for requests. |
AITools/ | AIToolManager — the tool catalog, AITool contract, AIToolCall execution, tool surfaces (WebChat / MCP). |
Consent/ | ConsentGate + MutatingOperationExecutor — the review-before-mutation pipeline shared by WebChat and MCP. |
Mcp/ | Loopback MCP server: McpServer (raw TcpListener, peer/Host/Origin guards, bearer auth), JsonRpcDispatcher, AIToolMcpAdapter, McpServerLifecycle (ref-counted), McpToolCallCache (idempotent retries), agent knowledge catalog/resources/prompts. |
Settings/ | SmartHopperSettings (single JSON file, encrypted secrets via DPAPI/Keychain), SmartHopperAssistantSettings, setting descriptors. |
Dialogs/ | Shared dialogs (ProviderVerificationDialog, StyledMessageDialog). |
Initialization/, Hosting/ | Startup (SmartHopperInitializer), provider hosting and trust gates. |
Interaction/ | Interaction model internals. |
Planning/ | Assistant task-plan support. |
Utils/ | Shared helpers. |
Security perimeter
This assembly owns the trust decisions:
- Provider trust — only verified/trusted assemblies register;
ProviderIntegrityCheckMode(Strict/Hard/Soft) and theTrustedProvidersmap gate what loads. - Secrets —
IProviderSettingsStorescopes each provider to its own encrypted keys. - Consent — every canvas mutation (component-driven or MCP) funnels through
ConsentGate; MCPBypassMutationsApprovalshort-circuits only when the owning component opted in.
More depth lives in the repo's docs/Providers and docs/Architecture/mcp-server.md.