UNPKG

@fusedashlabs/ui9000-workspace

Version:

UI9000 workspace MCP. One tool, show_workspace, draws a chart from your table. Set TYPESAFE_API_KEY to let Jev choose the chart.

26 lines (25 loc) • 1.09 kB
import type { EngineCatalog } from '../spec/engine-catalog.js'; import type { WorkspaceSpec } from '../spec/workspace-spec.js'; import { type ValidationCode } from '../validate/validate-spec.js'; export type WorkspaceHost = { replaceChildren: (...nodes: unknown[]) => void; }; export type WorkspaceMounter = { mount: (host: WorkspaceHost, spec: WorkspaceSpec) => void | Promise<void>; }; export type LoadWorkspaceComponent = (id: string) => Promise<WorkspaceMounter | undefined>; export type InterpretRefuse = { mounted: false; code: ValidationCode | 'invalid_result'; reason: string; }; export type InterpretMounted = { mounted: true; spec: WorkspaceSpec; }; export type InterpretResult = InterpretRefuse | InterpretMounted; /** * Validate then mount. Hostile specs never reach load() or the host. * Mount is a catalog loader on a known id — not host markup or element registry APIs. */ export declare function interpretWorkspace(toolResult: unknown, catalog: EngineCatalog, load: LoadWorkspaceComponent, host: WorkspaceHost): Promise<InterpretResult>;