/** * @file esm-manifest.ts * @description Package manifest interface and normalizer for ESM-loaded packages. * Defines the contract that npm packages must follow to be loadable by FrontMCP. */ /** * The manifest that ESM packages export to declare their MCP primitives. * * Package authors export this as the default export of their package: * ```typescript * export default { * name: '@acme/mcp-tools', * version: '1.0.0', * tools: [SearchTool, CreateIssueTool], * skills: [{ name: 'triage', ... }], * } satisfies FrontMcpPackageManifest; * ``` */ export interface FrontMcpPackageManifest { /** Package name (should match npm package name) */ name: string; /** Package version (should match npm package version) */ version: string; /** Package description */ description?: string; /** Tool classes or function-style tools */ tools?: unknown[]; /** Prompt classes or function-style prompts */ prompts?: unknown[]; /** Resource classes or function-style resources */ resources?: unknown[]; /** Skill definitions (can include embedded tools via the skill's tools array) */ skills?: unknown[]; /** Agent classes or function-style agents */ agents?: unknown[]; /** Job classes or function-style jobs */ jobs?: unknown[]; /** Workflow classes or function-style workflows */ workflows?: unknown[]; /** Shared providers for dependency injection */ providers?: unknown[]; } /** * Zod schema for basic manifest validation. * We validate the shape loosely since the actual primitives are validated * by their respective registries during registration. */ export declare const frontMcpPackageManifestSchema: import("@frontmcp/lazy-zod").ZodObject<{ name: import("@frontmcp/lazy-zod").ZodString; version: import("@frontmcp/lazy-zod").ZodString; description: import("@frontmcp/lazy-zod").ZodOptional; tools: import("@frontmcp/lazy-zod").ZodOptional>; prompts: import("@frontmcp/lazy-zod").ZodOptional>; resources: import("@frontmcp/lazy-zod").ZodOptional>; skills: import("@frontmcp/lazy-zod").ZodOptional>; agents: import("@frontmcp/lazy-zod").ZodOptional>; jobs: import("@frontmcp/lazy-zod").ZodOptional>; workflows: import("@frontmcp/lazy-zod").ZodOptional>; providers: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>; /** * Primitive type keys available in a manifest. */ export declare const MANIFEST_PRIMITIVE_KEYS: readonly ["tools", "prompts", "resources", "skills", "agents", "jobs", "workflows", "providers"]; export type ManifestPrimitiveKey = (typeof MANIFEST_PRIMITIVE_KEYS)[number]; /** * Normalize the default export of an ESM module into a FrontMcpPackageManifest. * * Handles five formats: * 1. A plain manifest object with tools/prompts/etc arrays * 2. A class decorated with @FrontMcp (detected via reflect-metadata) * 3. A module with named exports (tools, prompts, etc. arrays) * 4. A single default export of a decorated primitive class (@Tool, @Resource, etc.) * 5. Named exports of individual decorated classes (scanned and grouped by type) * * @param moduleExport - The raw module export (result of dynamic import()) * @returns Normalized FrontMcpPackageManifest * @throws Error if the export cannot be normalized */ export declare function normalizeEsmExport(moduleExport: unknown): FrontMcpPackageManifest; //# sourceMappingURL=esm-manifest.d.ts.map