/** * Module ID Validation - THE CRITICAL RULE Enforcement * * Ensures that module IDs used in Frames match the module IDs defined in lexmap.policy.json * This prevents vocabulary drift between memory and policy subsystems. * * Now integrates with alias resolution to support shorthand and historical names. */ import type { Policy } from "../types/policy.js"; import type { ValidationResult } from "../types/validation.js"; import type { AliasTable } from "../aliases/types.js"; import { resolveModuleId } from "../aliases/resolver.js"; export { resolveModuleId }; /** * Validate that all module IDs in moduleScope exist in the policy * NOW WITH ALIAS RESOLUTION SUPPORT * * This function resolves aliases first, then validates canonical IDs against policy. * Returns canonical IDs for storage in Frame.module_scope. * * @param moduleScope - Array of module IDs to validate (may include aliases) * @param policy - Policy object containing module definitions * @param aliasTable - Optional pre-loaded alias table * @returns ValidationResult with errors, suggestions, and canonical IDs for storage * * @example * ```typescript * const result = await validateModuleIds( * ['auth-core', 'ui/user-panel'], // 'auth-core' is an alias * policy * ); * * if (result.valid) { * console.log(result.canonical); // ['services/auth-core', 'ui/user-panel'] * // Store result.canonical in Frame.module_scope * } else { * console.error(result.errors); * } * ``` */ export declare function validateModuleIds(moduleScope: string[], policy: Policy, aliasTable?: AliasTable): Promise;