Function: resolveGenieSpaces()
resolveGenieSpaces(
config,context):Record<string,GenieSpaceConfig>
Discover Genie space aliases from every supported source and merge them into a single record. Precedence (highest first):
- MastraPluginConfig.genieSpaces on the
mastra(...)call. Explicit Mastra wiring always wins so users can override AppKit’s defaults per-agent. - AppKit
genie({ spaces: { ... } })plugin instance. Lets users keep using the existing AppKit config format (genie({ spaces: { sales: "...", ops: "..." } })) without restating the same record on the Mastra plugin. Read off the live plugin instance via a structural cast sincePlugin.configis TS-protected (not runtime-private). DATABRICKS_GENIE_SPACE_IDenv var (registered under the well-knowndefaultalias). Matches the AppKitgenie()plugin’s fallback behavior so a baremastra()+genie()pair just works.
Aliases collide cleanly: a higher-precedence source’s value replaces a lower one’s wholesale. A source that contributes zero aliases is skipped; a source that names an alias without a space id fails through normalizeGenieSpaces.
Parameters
Section titled “Parameters”config
Section titled “config”context
Section titled “context”PluginContextLike | undefined
Returns
Section titled “Returns”Record<string, GenieSpaceConfig>