/** * Strategic Intent Parser for the Wundr Governance System * * Parses and validates strategic intent definitions from YAML/JSON formats * and converts them into structured data for governance enforcement. */ /** * Configuration options for the IntentParser */ export interface IntentParserConfig { /** Whether to enforce strict validation (default: true) */ readonly strict?: boolean; /** Custom conflict detection rules */ readonly conflictRules?: ConflictRule[]; /** Maximum number of values allowed (default: unlimited) */ readonly maxValues?: number; /** Maximum number of constraints allowed (default: unlimited) */ readonly maxConstraints?: number; /** Maximum number of goals allowed (default: unlimited) */ readonly maxGoals?: number; } /** * Rule for detecting conflicting constraints */ export interface ConflictRule { readonly name: string; readonly patterns: [string, string]; readonly message: string; } /** * Strategic intent structure */ export interface Intent { /** The organization's mission statement */ readonly mission: string; /** Core values that guide decision-making */ readonly values: string[]; /** Constraints or boundaries that must be respected */ readonly constraints?: string[]; /** Strategic goals to achieve */ readonly goals?: string[]; } /** * Validation error details */ export interface ValidationError { readonly path: string[]; readonly message: string; readonly code: string; } /** * Result of intent validation */ export interface ValidationResult { readonly valid: boolean; readonly errors: ValidationError[]; readonly warnings: ValidationWarning[]; } /** * Validation warning (non-fatal) */ export interface ValidationWarning { readonly path: string[]; readonly message: string; readonly code: string; } /** * JSON Schema for Intent validation * Exported for use with JSON Schema validators like ajv */ export declare const INTENT_SCHEMA: { readonly $schema: "http://json-schema.org/draft-07/schema#"; readonly type: "object"; readonly required: readonly ["mission", "values"]; readonly properties: { readonly mission: { readonly type: "string"; readonly minLength: 1; readonly description: "The organization's mission statement"; }; readonly values: { readonly type: "array"; readonly items: { readonly type: "string"; readonly minLength: 1; }; readonly minItems: 1; readonly description: "Core values that guide decision-making"; }; readonly constraints: { readonly type: "array"; readonly items: { readonly type: "string"; readonly minLength: 1; }; readonly description: "Constraints or boundaries that must be respected"; }; readonly goals: { readonly type: "array"; readonly items: { readonly type: "string"; readonly minLength: 1; }; readonly description: "Strategic goals to achieve"; }; }; readonly additionalProperties: false; }; /** * IntentParser class for parsing and validating strategic intent definitions */ export declare class IntentParser { private readonly config; /** * Creates a new IntentParser instance * @param config - Optional configuration options */ constructor(config?: IntentParserConfig); /** * Parses strategic intent from YAML content * @param yamlContent - YAML string containing intent definition * @returns Parsed Intent object * @throws Error if parsing fails or content is invalid */ parseFromYAML(yamlContent: string): Intent; /** * Parses strategic intent from JSON content * @param jsonContent - JSON string containing intent definition * @returns Parsed Intent object * @throws Error if parsing fails or content is invalid */ parseFromJSON(jsonContent: string): Intent; /** * Parses strategic intent from a file (supports .yaml, .yml, and .json) * @param filePath - Path to the intent definition file * @returns Promise resolving to parsed Intent object * @throws Error if file cannot be read or parsed */ parseFromFile(filePath: string): Promise; /** * Validates an Intent object * @param intent - Intent object to validate * @returns ValidationResult with valid flag and any errors/warnings */ validate(intent: Intent): ValidationResult; /** * Extracts values from an Intent object * @param intent - Intent object to extract values from * @returns Array of value strings */ extractValues(intent: Intent): string[]; /** * Extracts mission from an Intent object * @param intent - Intent object to extract mission from * @returns Mission string or empty string if not defined */ extractMission(intent: Intent): string; /** * Converts an Intent object to a system prompt context fragment * @param intent - Intent object to convert * @returns Formatted string suitable for inclusion in system prompts */ toPromptContext(intent: Intent): string; /** * Simple YAML parser for intent files * Handles basic YAML structures without external dependencies */ private parseYAML; /** * Parses a YAML value, handling strings, numbers, and booleans */ private parseYAMLValue; /** * Normalizes parsed content into an Intent object */ private normalizeIntent; /** * Detects potential conflicts between constraints */ private detectConflicts; } /** * Custom error class for intent parsing errors */ export declare class IntentParseError extends Error { readonly code: string; constructor(message: string, code: string); } /** * Factory function to create an IntentParser instance * @param config - Optional configuration options * @returns New IntentParser instance */ export declare function createIntentParser(config?: IntentParserConfig): IntentParser; //# sourceMappingURL=intent-parser.d.ts.map