/** * Schema Registry * * Collects plugin manifest schemas and combines them for manifest generation. * Provides a unified view of all plugin state schemas and capabilities. */ import type { PluginManifestSchema, JSONSchema, PluginCapabilities, SliceUIMetadata } from "./manifest-schema.ts"; /** * Registry of all plugin manifest schemas * * Used by the manifest route to generate the GizmoManifest from static schemas * instead of inferring from runtime state. */ export interface SchemaRegistry { /** Map of plugin key to manifest schema */ schemas: Map; /** * Get combined state schema for all plugins * * Returns a JSON Schema with each plugin's state as a property * and plugin schemas in $defs. */ getStateSchema(): JSONSchema; /** * Get combined capabilities from all plugins */ getCapabilities(): PluginCapabilities; /** * Get UI metadata for all slices */ getSliceMetadata(): Record; /** * Get all route paths from plugins */ getRoutes(): Record; /** * Check if a plugin schema is registered */ hasSchema(pluginKey: string): boolean; /** * Get list of all registered slice keys */ getSliceKeys(): string[]; } /** * Create a schema registry from plugin manifest schemas * * @param schemas - Array of plugin manifest schemas * @returns SchemaRegistry instance * * @example * ```typescript * import { createSchemaRegistry } from "@gizmo-ai/server"; * import { AgentManifestSchema } from "@gizmo-ai/agent-plugin"; * import { HITLManifestSchema } from "@gizmo-ai/hitl-plugin"; * * const registry = createSchemaRegistry([ * AgentManifestSchema, * HITLManifestSchema, * ]); * * const stateSchema = registry.getStateSchema(); * const capabilities = registry.getCapabilities(); * ``` */ export declare function createSchemaRegistry(schemas: PluginManifestSchema[]): SchemaRegistry; //# sourceMappingURL=schema-registry.d.ts.map