/** * IAssetKindProvider — pluggable asset kind extension interface. * * Each asset kind (skill, flow, knowledge, etc.) is backed by an * IAssetKindProvider implementation. Core kinds (skill, agent, connector, * mount, mcp-server, contract, prompt, persona, ruleset) ship as built-in * providers in @skaile/discovery. Extension kinds (flow, knowledge, future * custom kinds) ship from their owning runtime packages and are explicitly * registered by the CLI at bootstrap. * * Lives in workspaces/plugins alongside other pluggable interface * contracts (ISecretsProvider, ICatalogSource, IKnowledgeBackend). * * Design decision A2: locked in Phase 1.7 planning. */ import type { ManifestValidationResult } from "@skaile/workspaces/types/manifests"; export interface AssetKindFileFilter { /** Root directory of the asset (usually the manifest's parent dir). */ assetRoot: string; /** Relative paths (from assetRoot) to include in the tarball. */ files: string[]; } export interface AssetKindRequiresEdge { /** Asset ref of the requiring asset. */ from: string; /** Asset ref of the required asset. */ to: string; /** Manifest field that produced this edge. */ field: string; } /** * Pluggable asset kind provider. * * Implementations: * - 9 core kinds: built-in providers in @skaile/discovery (skill, agent, * connector, mount, mcp-server, contract, prompt, persona, ruleset) * - flow: @skaile/workspaces/factory-assets/connectors/flow/engine (extension kind) * - knowledge: @skaile/workspaces/library/knowledge (extension kind, Phase 4 runtime) * - Custom kinds: any third-party package (future) */ export interface IAssetKindProvider { /** Unique kind identifier (e.g. "flow", "knowledge", "notebook"). */ readonly kind: string; /** Human-readable display name (e.g. "Flow", "Knowledge Base"). */ readonly displayName: string; /** * Version of this provider implementation. * Independent of asset version — tracks schema/logic evolution. * Stored alongside cached assets as `kind_provider_version`. * Mismatch between stored and current is informational WARN, not blocking. */ readonly providerVersion: string; /** * Glob patterns that identify assets of this kind. * Used for deterministic discovery (e.g. ["** / *.flow.yaml", "** / *.flow.json"]). * Must not overlap with any other registered provider's patterns. */ readonly discoveryPatterns: string[]; /** * Test if a relative path (from source root) matches this kind. * Called during discovery for path -> kind resolution. * Must be consistent with discoveryPatterns but may use filename-based * logic for efficiency (avoiding full glob matching). */ matchesPath(relativePath: string): boolean; /** * Validate a parsed manifest against this kind's schema. * Returns the validated data on success, or structured errors on failure. */ validateManifest(data: unknown): ManifestValidationResult; /** * Compute the default file filter for an asset of this kind. * Returns the asset root directory and the list of files to include * in the content-addressed tarball. */ defaultFileFilter(manifestPath: string): AssetKindFileFilter; /** * Extract cross-asset dependency edges from a manifest. * Optional — kinds with no cross-references can omit this. * * @param assetRef - Canonical ref of the asset being analyzed * @param manifest - Parsed manifest data * @returns Array of dependency edges */ extractRequires?(assetRef: string, manifest: Record): AssetKindRequiresEdge[]; /** * Install hook — runs after the asset is cached in the Library. * Optional — used for kinds that need post-install setup (e.g. * downloading additional resources, compiling schemas). */ install?(assetDef: Record): Promise; /** * Resolve hook — runs when the asset is loaded for runtime composition. * Optional — used for kinds that need runtime transformation (e.g. * flow schema normalization, knowledge indexing). */ resolve?(assetDef: Record): Promise>; } //# sourceMappingURL=asset-kind-provider.d.ts.map