UNPKG

@bonginkan/maria

Version:

MARIA OS v5.9.5 – Self-Evolving Organizational Intelligence OS | Speed Improvement Phase 3: LLM Optimization + Command Refactoring | Performance Measurement + Run Evidence System | Zero ESLint/TypeScript Errors | 人とAIが役割を持ち、学び、進化し続けるための仕事のOS | GraphRAG ×

142 lines (141 loc) 3.9 kB
/** * Type definitions for filename inference system */ export interface FilenameCandidate { path: string; filename: string; extension: string; confidence: number; reasoning: string; source?: InferenceSource; alternatives?: string[]; directory?: string; } export interface FilenameResult extends FilenameCandidate { source: InferenceSource; alternatives: string[]; } export interface ProjectContext { root?: string; directory?: string; /** * Optional plan identifier used by some higher-level orchestration layers. * - Not required by the core filename inference logic. */ planId?: string; conventions?: ProjectConventions; directories?: Record<string, string[]>; existingFiles?: string[]; framework?: string; language?: string; } export interface ProjectConventions { fileNaming: 'camelCase' | 'kebab-case' | 'PascalCase' | 'snake_case'; directories: { components?: string; pages?: string; utils?: string; services?: string; styles?: string; tests?: string; }; extensions: { react?: '.tsx' | '.jsx'; typescript?: '.ts'; javascript?: '.js'; styles?: '.css' | '.scss' | '.module.css'; }; } export interface InferenceConfig { priority: 'explicit' | 'contextual' | 'semantic' | 'default'; fallbackStrategy: 'timestamp' | 'generic' | 'random'; projectConventions?: ProjectConventions; confidenceThreshold: number; } export interface FilenameInferenceOptions { priority?: 'explicit' | 'contextual' | 'semantic' | 'default'; fallbackStrategy?: 'timestamp' | 'generic' | 'random'; projectConventions?: ProjectConventions; confidenceThreshold?: number; } export interface Language { name: string; confidence: number; indicators: string[]; extension: string; } export interface Framework { name: string; confidence: number; indicators: string[]; } export interface FilenamePattern { pattern: RegExp; extractor: (match: RegExpMatchArray) => string; confidence: number; priority: number; } export interface ContextualMapping { keywords: string[]; suggest: string; confidence: number; category?: string; } export type NamingConvention = 'kebab-case' | 'camelCase' | 'PascalCase' | 'snake_case'; export type SaveMode = 'immediate' | 'interactive' | 'dry-run'; export type InferenceSource = 'explicit' | 'project' | 'contextual' | 'semantic' | 'default' | 'combined' | 'dry-run' | 'alternative'; export interface ExtensionResult { ext: string; source: 'project' | 'fence' | 'mime' | 'syntax' | 'default'; confidence: number; } export interface SaveOperation { type?: 'create' | 'overwrite' | 'rename'; filename?: string; filepath?: string; path?: string; content: string; previousPath?: string; timestamp: number; planId: string; } export interface SaveResult { success: boolean; path?: string; undoId?: string; error?: string; dryRun?: boolean; suggested?: FilenameCandidate[]; alternatives?: string[]; } export interface PlanFileSaveConfig { fileSave: { allowExtensions: string[]; maxFileSizeMB: number; defaultDir: string; }; naming: { convention: NamingConvention; }; dirs: { [key: string]: string; }; } export interface InferenceResult { candidates: FilenameCandidate[]; selectedIndex: number; mode: SaveMode; timedOut?: boolean; } export declare class SecurityError extends Error { constructor(message: string); } export declare class PlanViolationError extends Error { constructor(message: string); } export declare class UserCancelledError extends Error { constructor(); } export declare class PermissionError extends Error { constructor(message: string); }