/** * PEAC Policy Kit Compiler * * Compiles policy documents to deployment artifacts: * - peac.txt (PEAC discovery file - canonical schema) * - robots.txt snippet for AI crawlers * - AIPREF header templates (compatibility output) * - Human-readable markdown summary * * All outputs are deterministic (stable ordering where semantically safe). * Rule order is preserved where it affects semantics (first-match-wins). * * @packageDocumentation */ import { PolicyDocument } from './types'; /** * Default PEAC protocol version for generated peac.txt * * Uses major.minor format (e.g., "0.9") by default. Pass a full version * (e.g., "0.9.17") via peacVersion option if needed. * * This matches the wire format version from @peac/kernel. */ export declare const PEAC_PROTOCOL_VERSION: "0.9"; /** * Options for compilation */ export interface CompileOptions { /** Base URL for the site (used in peac.txt) */ siteUrl?: string; /** Contact email for policy questions */ contact?: string; /** Include comments in output */ includeComments?: boolean; /** * PEAC protocol version for peac.txt (default: 0.9) * Use major.minor (0.9) or full version (0.9.17) as needed. */ peacVersion?: string; /** Attribution requirement: required, optional, or none */ attribution?: 'required' | 'optional' | 'none'; /** * Receipts requirement: required, optional, or omit (don't include field) * Default: 'required' for conditional usage, 'optional' for open usage */ receipts?: 'required' | 'optional' | 'omit'; /** Rate limit string (e.g., "100/hour", "unlimited") */ rateLimit?: string; /** Negotiate endpoint URL */ negotiateUrl?: string; } /** * AIPREF header template */ export interface AiprefTemplate { /** Header name */ header: string; /** Header value */ value: string; /** Description of when to use */ description: string; } /** * Compile policy to peac.txt format (canonical schema) * * Generates a PEAC discovery file that can be served at: * - /.well-known/peac.txt (primary) * - /peac.txt (fallback) * * Output uses canonical PEAC schema with `version` and `usage` fields. * Rule order is preserved in comments (first-match-wins semantics). * * @param policy - Policy document * @param options - Compilation options * @returns peac.txt content (YAML format) */ export declare function compilePeacTxt(policy: PolicyDocument, options?: CompileOptions): string; /** * Compile policy to robots.txt snippet for AI crawlers * * Generates User-agent blocks for known AI crawlers based on policy. * Conservative: if default is deny or review, disallows crawling. * * @param policy - Policy document * @param options - Compilation options * @returns robots.txt snippet content */ export declare function compileRobotsSnippet(policy: PolicyDocument, options?: CompileOptions): string; /** * Compile policy to AIPREF header templates * * Generates header values for HTTP responses. * These are COMPATIBILITY templates, not normative PEAC headers. * The authoritative policy is always peac.txt. * * @param policy - Policy document * @param options - Compilation options * @returns Array of header templates */ export declare function compileAiprefTemplates(policy: PolicyDocument, options?: CompileOptions): AiprefTemplate[]; /** * Render policy as human-readable markdown * * Generates an ai-policy.md file for documentation. * * @param policy - Policy document * @param options - Compilation options * @returns Markdown content */ export declare function renderPolicyMarkdown(policy: PolicyDocument, options?: CompileOptions): string; //# sourceMappingURL=compiler.d.ts.map