/** * Astrid Configuration Loader (v2.0) * * Loads project-specific configuration from .astrid.config.json * Provides config-driven behavior for AI agents. */ export interface ProjectStructure { /** User-friendly name for this part of the project */ name?: string; /** Description of the platform/framework */ description: string; /** Root directory for this part of the project */ rootPath: string; /** File patterns to search */ filePatterns: string[]; /** Key directories to mention */ keyDirectories?: string[]; } export interface PlatformDetection { /** Name of the platform (e.g., "ios", "android", "web") */ name: string; /** Keywords that indicate this platform (regex patterns) */ keywords: string[]; /** Preferred file patterns for this platform */ filePatterns: string[]; /** Hints to give the AI for this platform */ hints?: string[]; } export interface AgentConfig { /** Planning timeout in minutes */ planningTimeoutMinutes: number; /** Execution timeout in minutes */ executionTimeoutMinutes: number; /** Max iterations for planning */ maxPlanningIterations: number; /** Max iterations for execution */ maxExecutionIterations: number; /** Additional context to always include in prompts */ additionalContext?: string; /** Model parameters per phase */ modelParameters: { planning: { temperature: number; maxTokens: number; topP?: number; }; execution: { temperature: number; maxTokens: number; topP?: number; }; }; } export interface ValidationConfig { /** Maximum files per plan */ maxFilesPerPlan: number; /** Minimum files per plan */ minFilesPerPlan: number; /** Reject plans with no files */ rejectEmptyPlans: boolean; /** Maximum file modification size in bytes */ maxModificationSize: number; /** Maximum context truncation length */ contextTruncationLength: number; /** Max glob results to return */ maxGlobResults: number; } export interface SafetyConfig { /** Blocked bash command patterns */ blockedBashPatterns: string[]; /** Require plan approval before execution */ requirePlanApproval: boolean; /** Enforce protected paths */ enforceProtectedPaths: boolean; /** Maximum budget per task in USD */ maxBudgetPerTask: number; /** Maximum cost per API call */ maxCostPerCall: number; } export interface RetryConfig { /** Maximum retry attempts */ maxRetries: number; /** Initial backoff in milliseconds */ initialBackoffMs: number; /** Maximum backoff in milliseconds */ maxBackoffMs: number; /** Backoff multiplier */ backoffMultiplier: number; /** API timeout in milliseconds */ apiTimeoutMs: number; } export interface PreviewWebConfig { /** Enable web previews */ enabled: boolean; /** Preview provider: 'vercel', 'netlify', 'custom' */ provider: 'vercel' | 'netlify' | 'custom'; /** Custom URL template. Use ${branch} for branch name. */ urlTemplate?: string; } export interface PreviewIOSConfig { /** Enable iOS previews */ enabled: boolean; /** Static TestFlight link */ testflightLink?: string; /** Show Xcode Cloud build status in comments */ showBuildStatus: boolean; } export interface PreviewConfig { /** Enable preview workflow */ enabled: boolean; /** Wait for preview to be ready before continuing workflow */ waitForReady: boolean; /** Require preview link before user can approve */ requiredForApproval: boolean; /** Polling interval for checking preview status in ms */ pollingIntervalMs: number; /** Maximum time to wait for preview in ms */ maxWaitMs: number; /** Web preview configuration */ web: PreviewWebConfig; /** iOS preview configuration */ ios: PreviewIOSConfig; /** Custom comment template. Use ${previewUrl}, ${branch}, ${prNumber} variables. */ commentTemplate?: string; } export interface AstridConfig { /** Schema version */ version: string; /** Project name */ projectName?: string; /** Brief description of the project */ description?: string; /** Project structure */ structure?: Record; /** Platform detection rules */ platforms?: PlatformDetection[]; /** Files/patterns the agent should never modify */ protectedPaths?: string[]; /** Custom instructions for the AI agent */ customInstructions?: string; /** Agent configuration */ agent?: Partial; /** Validation rules */ validation?: Partial; /** Safety rules */ safety?: Partial; /** Retry configuration */ retry?: Partial; /** Preview/staging workflow configuration */ preview?: Partial; } export interface ResolvedAstridConfig extends Omit { agent: AgentConfig; validation: ValidationConfig; safety: SafetyConfig; retry: RetryConfig; preview: PreviewConfig; } export declare const DEFAULT_BLOCKED_BASH_PATTERNS: string[]; export declare const DEFAULT_PROTECTED_PATHS: string[]; export declare const CONFIG_DEFAULTS: ResolvedAstridConfig; /** * Load Astrid configuration from a repository */ export declare function loadAstridConfig(repoPath: string): Promise; /** * Clear the cached configuration */ export declare function clearConfigCache(): void; /** * Detect which platform a task belongs to */ export declare function detectPlatform(config: ResolvedAstridConfig, taskTitle: string, taskDescription: string | null): PlatformDetection | null; /** * Generate project structure prompt from config */ export declare function generateStructurePrompt(config: ResolvedAstridConfig): string; /** * Generate platform-specific hints */ export declare function generatePlatformHints(platform: PlatformDetection | null): string; /** * Get the initial glob pattern for a task */ export declare function getInitialGlobPattern(config: ResolvedAstridConfig, platform: PlatformDetection | null): string; /** * Check if a command is blocked by safety rules */ export declare function isBlockedCommand(command: string, config: ResolvedAstridConfig): boolean; /** * Check if a path is protected */ export declare function isProtectedPath(filePath: string, config: ResolvedAstridConfig): boolean; //# sourceMappingURL=index.d.ts.map