Plugin Architecture
The SmartHopper solution is organized into layered modules with a clear rule: shared logic lives at the highest layer that owns the concern.
Modules
| Project | Responsibility |
|---|---|
| SmartHopper.Core | Component base classes (AIStatefulAsyncComponentBase, async/stateful/selecting bases, provider selection), chat UI host (WebChat), context providers, canvas button, data-tree processing, IO persistence, custom parameter/types. |
| SmartHopper.Core.Grasshopper | Grasshopper-specific utilities, converters, canvas helpers, GhJSON integration, and the AITool implementations the assistant and MCP server expose. |
| SmartHopper.Components | The 90+ production Grasshopper components, grouped by canvas subcategory (Input, Output, Grasshopper, JSON, Knowledge, Script, Img, Audio, Text, List, AI, MCP, Misc). |
| SmartHopper.Components.Test | Test-only components (never built in Release) for validation that requires Rhino/Grasshopper. |
| SmartHopper.Infrastructure | Provider manager, model/capability registry, AI context manager, AI tool manager, AICall pipeline, consent & mutation review, MCP server, settings & secure storage, dialogs, local diagnostics, initialization. |
| SmartHopper.Menu | Grasshopper menu bar (SmartHopper menu) and the settings dialog (Eto.Forms, cross-platform). |
| SmartHopper.ProviderSdk | Contracts providers implement: IAIProvider, AIProvider base, settings descriptors, hosting, logging. |
| SmartHopper.Providers.* | One project per AI provider — API-specific request/response adaptation. Discovered and cryptographically verified at runtime. |
Test projects
SmartHopper.Infrastructure.Tests, SmartHopper.Core.Tests, SmartHopper.Core.Grasshopper.Tests, SmartHopper.ProviderSdk.Tests — xUnit, no Rhino runtime required. macOS CI runs only the Infrastructure tests.
Placement rule
- Core UI/component behavior →
SmartHopper.Core - Grasshopper canvas, data tree, GhJSON →
SmartHopper.Core.Grasshopper - End-user component wiring →
SmartHopper.Components - Provider/model/context/tool orchestration, settings →
SmartHopper.Infrastructure - API-specific quirks → the matching
SmartHopper.Providers.<Name>