Skip to main content

SmartHopper.Core

The core layer: everything needed to build SmartHopper's Grasshopper components and host its chat UI — independent of any specific AI provider.

Layout​

FolderContents
ComponentBase/The component class hierarchy — see below.
AIContext/Built-in context providers: EnvironmentContextProvider, FileContextProvider, SelectionContextProvider, TimeContextProvider, ViewportContextProvider.
UI/WebChat host (WebChatDialog, WebChatWorker, consent & task-plan UI, suggested prompts), CanvasButton (the on-canvas assistant button), DialogCanvasLink.
DataTree/Data-tree processing: branch matching, graft/flatten, broadcasting helpers used by components.
IO/Safe, versioned persistence for component outputs.
Models/, Parameters/, Types/Shared models, custom GH parameters (e.g. AIInputPayloadParameter), goo/types (GH_AIRequestParameters).
Diagnostics/Core diagnostics helpers.

Component hierarchy​

GH_Component
└── AsyncComponentBase — async worker execution
└── StatefulComponentBase — state machine + Run button/toggle + metrics
└── SelectingStatefulComponentBase
└── AIStatefulAsyncComponentBase — Settings input, provider, AIReturn
└── AISelectingStatefulAsyncComponentBase
└── AIInputAdapterBase — emits AIInputPayload (input components)
└── AIOutputAdapterBase — Input> payload in, typed outputs out (output components)
└── ProviderComponentBase / AIProviderComponentBase
— "Select AI Provider" menu + provider badge

Key contracts:

  • AIInputPayloadParameter / AIInputPayload — the wire format between input and output components.
  • AIRequestParameters (Settings input) — model, max tokens, temperature, batch, timeout, extras.
  • ProviderSelectionCore — owns the Select AI Provider menu, badge, and per-component persistence.

Deep dives per class live in the repo's docs/Components/ComponentBase folder.