/** * Policy-as-YAML loader for Matimo. * * Allows the developer to configure the policy engine through a YAML file * instead of inline TypeScript, making it easy to adjust policy across * environments without rebuilding. * * Schema for policy.yaml: * * ```yaml * allowedDomains: * - api.slack.com * - slack.com * * allowedCredentials: * - SLACK_BOT_TOKEN * - OPENAI_API_KEY * * allowedHttpMethods: * - GET * - POST * * allowCommandTools: false * allowFunctionTools: false * * protectedNamespaces: * - matimo_ * ``` * * Usage: * const matimo = await MatimoInstance.init({ policyFile: './policy.yaml' }); */ import type { PolicyEngine, PolicyConfig } from './types.js'; /** * Parse a YAML policy file and return a PolicyEngine configured from it. * * Throws `MatimoError(INVALID_SCHEMA)` if the file cannot be read or fails validation. * * @param filePath - Absolute or cwd-relative path to the policy YAML file * @returns A frozen `DefaultPolicyEngine` built from the parsed config * * @example * ```ts * // Direct usage * const engine = loadPolicyFromFile('./policy.yaml'); * const matimo = await MatimoInstance.init({ policy: engine }); * * // Or use the shorthand InitOption (preferred) * const matimo = await MatimoInstance.init({ policyFile: './policy.yaml' }); * ``` */ export declare function loadPolicyFromFile(filePath: string): PolicyEngine; /** * Parse a YAML policy file into a PolicyConfig (without creating an engine). * Useful for hot-reload: parse the new file, then call engine.updateConfig(). */ export declare function parsePolicyFile(filePath: string): PolicyConfig; //# sourceMappingURL=policy-loader.d.ts.map