UNPKG

@vibeship/devtools

Version:

Comprehensive markdown-based project management system with AI capabilities for Next.js applications

2,098 lines (2,088 loc) 81 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import React, { ReactNode, ComponentType, ErrorInfo, CSSProperties, MouseEvent, ChangeEvent, KeyboardEvent, Component } from 'react'; import { V as VibeshipConfig$2 } from './types-ChLtbM8s.js'; export { d as defaultConfig, m as mergeConfigurations } from './merger-DifSCgKo.js'; /** * Task-related type definitions */ /** * Supported task types */ type TaskType = 'TODO' | 'FIXME' | 'HACK' | 'NOTE' | 'BUG' | 'OPTIMIZE' | 'REFACTOR'; /** * Task priority levels */ type TaskPriority = 'low' | 'medium' | 'high' | 'critical'; /** * Task status */ type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'cancelled'; /** * Represents a single task extracted from code */ interface Task { /** Unique identifier for the task */ id: string; /** Type of task (TODO, FIXME, etc.) */ type: TaskType; /** Task description text */ text: string; /** File path where the task was found */ filePath: string; /** Line number in the file */ lineNumber: number; /** Task status */ status: TaskStatus; /** Priority level */ priority?: TaskPriority; /** Assigned user */ assignee?: string; /** Creation timestamp */ createdAt: Date; /** Last update timestamp */ updatedAt: Date; /** Additional metadata */ metadata?: TaskMetadata; } /** * Task metadata */ interface TaskMetadata { /** Issue or ticket reference */ issue?: string; /** Due date */ dueDate?: Date; /** Tags */ tags?: string[]; /** Estimated time in hours */ estimatedHours?: number; /** Custom fields */ [key: string]: any; } /** * Task extraction options */ interface TaskExtractionOptions { /** Task patterns to search for */ patterns: TaskPatterns; /** Custom patterns */ customPatterns?: CustomTaskPattern[]; /** Include completed tasks */ includeCompleted?: boolean; /** Maximum tasks per file */ maxTasksPerFile?: number; } /** * Task patterns configuration */ interface TaskPatterns { /** Enable TODO pattern */ todo: boolean; /** Enable FIXME pattern */ fixme: boolean; /** Enable HACK pattern */ hack: boolean; /** Enable NOTE pattern */ note: boolean; /** Enable BUG pattern */ bug: boolean; /** Enable OPTIMIZE pattern */ optimize: boolean; /** Enable REFACTOR pattern */ refactor?: boolean; } /** * Custom task pattern definition */ interface CustomTaskPattern { /** Pattern name */ pattern: string; /** Regular expression to match */ regex: RegExp | string; /** Whether this pattern is enabled */ enabled: boolean; /** Default priority for tasks matched by this pattern */ defaultPriority?: TaskPriority; } /** * Task statistics */ interface TaskStats { /** Total number of tasks */ total: number; /** Tasks by type */ byType: Record<TaskType, number>; /** Tasks by status */ byStatus: Record<TaskStatus, number>; /** Tasks by priority */ byPriority: Record<TaskPriority, number>; /** Tasks by file */ byFile: Record<string, number>; /** Completion rate */ completionRate: number; } /** * File group containing tasks */ interface FileGroup { /** File path */ path: string; /** Phase identifier */ phase?: string; /** Milestone */ milestone?: string; /** Tasks in this file */ tasks: Task[]; /** Progress percentage */ progress: number; } /** * Phase group containing multiple files */ interface PhaseGroup { /** Phase name */ name: string; /** Milestone */ milestone: string; /** Phase description */ description: string; /** File groups in this phase */ fileGroups: FileGroup[]; /** Total tasks */ totalTasks: number; /** Completed tasks */ completedTasks: number; } /** * Task scan result */ interface ScanResult { /** Scanned files */ files: Array<{ /** File path */ path: string; /** File content */ content?: string; /** Extracted tasks */ tasks: Task[]; }>; /** Total tasks found */ totalTasks: number; /** Completed tasks */ completedTasks: number; /** Scan duration in milliseconds */ scanTime: number; /** Errors encountered */ errors?: Array<{ file: string; error: string; }>; } /** * Configuration-related type definitions */ /** * Main Vibeship configuration */ interface VibeshipConfig$1 { /** Paths to scan for tasks */ scanPaths: string[]; /** File patterns to include */ include: string[]; /** File patterns to exclude */ exclude: string[]; /** Feature flags */ features: FeatureFlags; /** Security configuration */ security?: SecurityConfig; /** Task patterns */ taskPatterns?: TaskPatterns; /** UI configuration */ ui?: UIConfig; /** API configuration */ api?: APIConfig; /** Cache configuration */ cache?: CacheConfig; /** Experimental features */ experimental?: ExperimentalConfig; } /** * Partial configuration for merging */ type PartialVibeshipConfig = DeepPartial<VibeshipConfig$1>; type PartialVibecodeConfig = PartialVibeshipConfig; type VibecodeConfig = VibeshipConfig$1; /** * Deep partial type helper */ type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P]; }; /** * Feature flags */ interface FeatureFlags { /** Enable task management */ tasks?: boolean; /** Enable AI features */ ai?: boolean; /** Enable real-time updates */ realtime?: boolean; /** Enable command palette */ commandPalette?: boolean; /** Enable file editing */ fileEditing?: boolean; /** Enable markdown preview */ markdownPreview?: boolean; /** Enable DevTools UI */ devtools?: boolean; } /** * Security configuration */ interface SecurityConfig { /** Enable authentication */ authentication: boolean; /** Authentication configuration */ authConfig?: AuthConfig; /** Enable rate limiting */ rateLimit: boolean; /** Rate limit configuration */ rateLimitConfig?: RateLimitConfig; /** Enable CORS */ cors: boolean; /** CORS configuration */ corsConfig?: CORSConfig; /** Allowed file paths */ allowedPaths: string[]; /** Blocked file patterns */ blockedPatterns?: string[]; } /** * Authentication configuration */ interface AuthConfig { /** Authentication providers */ providers: AuthProvider[]; /** JWT secret */ jwtSecret?: string; /** Session configuration */ session?: { /** Session duration in seconds */ maxAge: number; /** Session cookie name */ cookieName?: string; }; } /** * Authentication provider */ interface AuthProvider { /** Provider name */ name: string; /** Provider type */ type: 'oauth' | 'password' | 'token'; /** Provider configuration */ config: Record<string, any>; } /** * Rate limiting configuration */ interface RateLimitConfig { /** Time window in milliseconds */ windowMs: number; /** Maximum requests per window */ maxRequests: number; /** Skip successful requests */ skipSuccessfulRequests?: boolean; /** Custom key generator */ keyGenerator?: string; } /** * CORS configuration */ interface CORSConfig { /** Allowed origins */ origins: string[] | '*'; /** Allowed methods */ methods?: string[]; /** Allowed headers */ allowedHeaders?: string[]; /** Exposed headers */ exposedHeaders?: string[]; /** Allow credentials */ credentials?: boolean; } /** * UI configuration */ interface UIConfig { /** Theme */ theme: 'light' | 'dark' | 'system'; /** UI position */ position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'fixed' | 'absolute' | 'relative'; /** Default size */ defaultSize?: { width: number; height: number; }; /** Hotkey for opening UI */ hotkey: string; /** Show in production */ showInProduction: boolean; /** Custom styles */ customStyles?: Record<string, any>; } /** * API configuration */ interface APIConfig { /** Base path for API routes */ basePath: string; /** API version */ version?: string; /** Enable API documentation */ documentation?: boolean; /** Request timeout in milliseconds */ timeout: number; /** Custom middleware */ middleware?: string[]; } /** * Cache configuration */ interface CacheConfig { /** Enable caching */ enabled: boolean; /** Cache directory */ directory?: string; /** Default TTL in seconds */ ttl: number; /** Maximum cache size in MB */ maxSize: number; /** Cache strategy */ strategy?: 'lru' | 'fifo' | 'lfu'; /** Enable compression */ compression?: boolean; } /** * Experimental configuration */ interface ExperimentalConfig { /** Enable experimental features */ [key: string]: any; } /** * Configuration loading options */ interface LoadConfigOptions { /** Configuration file path */ configPath?: string; /** Environment */ env?: 'development' | 'production' | 'test'; /** Override with environment variables */ useEnv?: boolean; /** Validate configuration */ validate?: boolean; } /** * Configuration validation result */ interface ConfigValidationResult { /** Is configuration valid */ valid: boolean; /** Validation errors */ errors?: Array<{ path: string; message: string; }>; /** Validation warnings */ warnings?: Array<{ path: string; message: string; }>; } /** * Define configuration function */ type DefineConfigFunction = (config: PartialVibecodeConfig) => PartialVibecodeConfig; /** * Server-related type definitions */ /** * File scanner options */ interface FileScannerOptions { /** File patterns to include */ include: string[]; /** File patterns to exclude */ exclude: string[]; /** Base path for scanning */ basePath: string; /** Maximum file size in bytes */ maxFileSize?: number; /** Follow symbolic links */ followSymlinks?: boolean; /** Ignore hidden files */ ignoreHidden?: boolean; /** Custom file filter */ fileFilter?: (path: string) => boolean; } /** * Scanned file information */ interface ScannedFile { /** File path relative to base path */ path: string; /** Absolute file path */ absolutePath: string; /** File content */ content?: string; /** File size in bytes */ size: number; /** File extension */ extension: string; /** Last modified timestamp */ lastModified: Date; /** File encoding */ encoding?: string; } /** * File scan statistics */ interface FileScanStats { /** Total files scanned */ totalFiles: number; /** Total size in bytes */ totalSize: number; /** Files by type */ fileTypes: Record<string, number>; /** Scan duration in milliseconds */ duration?: number; /** Errors encountered */ errors?: number; } /** * Cache options */ interface CacheOptions { /** Cache directory */ cacheDir: string; /** Time to live in milliseconds */ ttl: number; /** Maximum cache entries */ maxSize: number; /** Enable compression */ compression?: boolean; /** Cache key prefix */ prefix?: string; } /** * Cache entry */ interface CacheEntry<T = any> { /** Cached data */ data: T; /** Timestamp when cached */ timestamp: number; /** Cache key */ key: string; /** Entry size in bytes */ size?: number; /** Expiration timestamp */ expires?: number; } /** * Cache statistics */ interface CacheStats { /** Number of entries */ entries: number; /** Total size in bytes */ totalSize: number; /** Cache hit rate */ hitRate: number; /** Oldest entry timestamp */ oldestEntry?: number; /** Newest entry timestamp */ newestEntry?: number; } /** * Path validation options */ interface PathValidationOptions { /** Base path */ basePath: string; /** Allowed paths */ allowedPaths: string[]; /** Blocked patterns */ blockedPatterns?: string[]; /** Allow absolute paths */ allowAbsolute?: boolean; /** Check file existence */ checkExists?: boolean; } /** * Path validation result */ interface PathValidationResult { /** Is path valid */ valid: boolean; /** Normalized path */ normalizedPath?: string; /** Validation error */ error?: string; /** Path type */ type?: 'file' | 'directory' | 'unknown'; } /** * Rate limiter options */ interface RateLimiterOptions { /** Time window in milliseconds */ windowMs: number; /** Maximum requests per window */ maxRequests: number; /** Key generator function */ keyGenerator?: (req: any) => string; /** Skip successful requests */ skipSuccessfulRequests?: boolean; /** Custom storage */ storage?: RateLimiterStorage; } /** * Rate limiter storage interface */ interface RateLimiterStorage { /** Get request count */ get(key: string): Promise<number>; /** Increment request count */ increment(key: string): Promise<number>; /** Reset request count */ reset(key: string): Promise<void>; /** Clean expired entries */ cleanup(): Promise<void>; } /** * Rate limit info */ interface RateLimitInfo { /** Requests remaining */ remaining: number; /** Total limit */ limit: number; /** Reset timestamp */ resetAt: number; /** Is request allowed */ allowed: boolean; } /** * Logger options */ interface LoggerOptions { /** Log level */ level: 'debug' | 'info' | 'warn' | 'error'; /** Enable timestamps */ timestamps?: boolean; /** Enable colors */ colors?: boolean; /** Log file path */ logFile?: string; /** Maximum log file size */ maxFileSize?: number; /** Custom transports */ transports?: LogTransport[]; } /** * Log transport interface */ interface LogTransport { /** Transport name */ name: string; /** Log method */ log(level: string, message: string, meta?: any): void; } /** * Server-sent events options */ interface SSEOptions { /** Heartbeat interval in milliseconds */ heartbeatInterval?: number; /** Retry timeout for client */ retryTimeout?: number; /** Maximum connections per client */ maxConnections?: number; /** Enable compression */ compress?: boolean; } /** * SSE message */ interface SSEMessage { /** Event type */ event?: string; /** Message data */ data: any; /** Message ID */ id?: string; /** Retry timeout */ retry?: number; } /** * Task processor options */ interface TaskProcessorOptions { /** Batch size for processing */ batchSize?: number; /** Processing timeout */ timeout?: number; /** Retry failed tasks */ retryFailedTasks?: boolean; /** Maximum retries */ maxRetries?: number; } /** * Task processing result */ interface TaskProcessingResult { /** Processed tasks */ processed: Task[]; /** Failed tasks */ failed: Array<{ task: Task; error: string; }>; /** Processing time in milliseconds */ duration: number; /** Success rate */ successRate: number; } /** * CLI-related type definitions */ /** * CLI command definition */ interface CLICommand { /** Command name */ name: string; /** Command description */ description: string; /** Command aliases */ aliases?: string[]; /** Command options */ options?: CLIOption[]; /** Command arguments */ arguments?: CLIArgument[]; /** Command action handler */ action: (args: any, options: any) => void | Promise<void>; /** Subcommands */ subcommands?: CLICommand[]; /** Examples */ examples?: CLIExample[]; } /** * CLI option definition */ interface CLIOption { /** Option flags (e.g., '-p, --port') */ flags: string; /** Option description */ description: string; /** Default value */ defaultValue?: any; /** Value parser */ parser?: (value: string) => any; /** Required option */ required?: boolean; /** Option choices */ choices?: string[]; /** Environment variable */ env?: string; } /** * CLI argument definition */ interface CLIArgument { /** Argument name */ name: string; /** Argument description */ description: string; /** Required argument */ required?: boolean; /** Default value */ defaultValue?: any; /** Variadic argument */ variadic?: boolean; /** Value parser */ parser?: (value: string) => any; } /** * CLI example */ interface CLIExample { /** Example command */ command: string; /** Example description */ description: string; } /** * CLI configuration */ interface CLIConfig { /** Program name */ name: string; /** Program version */ version: string; /** Program description */ description: string; /** Usage string */ usage?: string; /** Help footer */ helpFooter?: string; /** Enable interactive mode */ interactive?: boolean; /** Output format */ outputFormat?: 'text' | 'json' | 'table'; /** Color output */ colors?: boolean; /** Verbosity level */ verbosity?: 'quiet' | 'normal' | 'verbose' | 'debug'; } /** * CLI context passed to commands */ interface CLIContext { /** CLI configuration */ config: CLIConfig; /** Logger instance */ logger: CLILogger; /** Prompt helper */ prompt: CLIPrompt; /** Spinner helper */ spinner: CLISpinner; /** Process exit handler */ exit: (code?: number) => void; /** Current working directory */ cwd: string; /** Environment variables */ env: NodeJS.ProcessEnv; } /** * CLI logger interface */ interface CLILogger { /** Log debug message */ debug(message: string, ...args: any[]): void; /** Log info message */ info(message: string, ...args: any[]): void; /** Log warning message */ warn(message: string, ...args: any[]): void; /** Log error message */ error(message: string, ...args: any[]): void; /** Log success message */ success(message: string, ...args: any[]): void; /** Create a child logger */ child(prefix: string): CLILogger; } /** * CLI prompt interface */ interface CLIPrompt { /** Ask for text input */ text(message: string, options?: PromptTextOptions): Promise<string>; /** Ask for password input */ password(message: string, options?: PromptPasswordOptions): Promise<string>; /** Ask for confirmation */ confirm(message: string, options?: PromptConfirmOptions): Promise<boolean>; /** Ask to select from list */ select<T = string>(message: string, options: PromptSelectOptions<T>): Promise<T>; /** Ask to select multiple from list */ multiselect<T = string>(message: string, options: PromptMultiselectOptions<T>): Promise<T[]>; } /** * Text prompt options */ interface PromptTextOptions { /** Default value */ defaultValue?: string; /** Validation function */ validate?: (value: string) => boolean | string; /** Input placeholder */ placeholder?: string; /** Required input */ required?: boolean; } /** * Password prompt options */ interface PromptPasswordOptions { /** Mask character */ mask?: string; /** Validation function */ validate?: (value: string) => boolean | string; /** Required input */ required?: boolean; } /** * Confirm prompt options */ interface PromptConfirmOptions { /** Default value */ defaultValue?: boolean; /** Yes text */ yesText?: string; /** No text */ noText?: string; } /** * Select prompt options */ interface PromptSelectOptions<T = string> { /** Choice items */ choices: Array<{ /** Display title */ title: string; /** Choice value */ value: T; /** Choice description */ description?: string; /** Disabled choice */ disabled?: boolean; }>; /** Default value */ defaultValue?: T; /** Maximum visible choices */ maxVisible?: number; } /** * Multiselect prompt options */ interface PromptMultiselectOptions<T = string> extends Omit<PromptSelectOptions<T>, 'defaultValue'> { /** Minimum selections */ min?: number; /** Maximum selections */ max?: number; /** Default selected values */ defaultValue?: T[]; } /** * CLI spinner interface */ interface CLISpinner { /** Start spinner with message */ start(message?: string): void; /** Update spinner message */ update(message: string): void; /** Stop spinner with success */ succeed(message?: string): void; /** Stop spinner with failure */ fail(message?: string): void; /** Stop spinner with warning */ warn(message?: string): void; /** Stop spinner with info */ info(message?: string): void; /** Stop spinner */ stop(): void; /** Check if spinner is running */ isSpinning: boolean; } /** * CLI output formatter */ interface CLIFormatter { /** Format as table */ table(data: any[], options?: TableOptions): string; /** Format as JSON */ json(data: any, options?: JSONOptions): string; /** Format as tree */ tree(data: TreeNode, options?: TreeOptions): string; /** Format as list */ list(items: string[], options?: ListOptions): string; /** Format with syntax highlighting */ code(code: string, language?: string): string; /** Format diff */ diff(oldText: string, newText: string, options?: DiffOptions): string; } /** * Table formatting options */ interface TableOptions { /** Column headers */ headers?: string[]; /** Column widths */ widths?: number[]; /** Border style */ borderStyle?: 'none' | 'single' | 'double' | 'round'; /** Compact mode */ compact?: boolean; } /** * JSON formatting options */ interface JSONOptions { /** Indentation */ indent?: number; /** Sort keys */ sortKeys?: boolean; /** Syntax highlighting */ highlight?: boolean; } /** * Tree node structure */ interface TreeNode { /** Node label */ label: string; /** Child nodes */ children?: TreeNode[]; /** Node metadata */ metadata?: any; } /** * Tree formatting options */ interface TreeOptions { /** Tree style */ style?: 'ascii' | 'unicode'; /** Show metadata */ showMetadata?: boolean; /** Maximum depth */ maxDepth?: number; } /** * List formatting options */ interface ListOptions { /** List style */ style?: 'bullet' | 'number' | 'dash'; /** Indentation */ indent?: number; /** Item prefix */ prefix?: string; } /** * Diff formatting options */ interface DiffOptions { /** Context lines */ context?: number; /** Show line numbers */ lineNumbers?: boolean; /** Color output */ color?: boolean; } /** * CLI plugin interface */ interface CLIPlugin { /** Plugin name */ name: string; /** Plugin version */ version?: string; /** Plugin initialization */ init(cli: CLIContext): void | Promise<void>; /** Plugin commands */ commands?: CLICommand[]; /** Plugin middleware */ middleware?: CLIMiddleware[]; } /** * CLI middleware */ type CLIMiddleware = (args: any, options: any, context: CLIContext, next: () => void | Promise<void>) => void | Promise<void>; /** * Provider-related type definitions */ /** * Vibecode provider props */ interface VibecodeProviderProps { /** Child components */ children: ReactNode; /** Configuration override */ config?: Partial<VibecodeConfig>; /** Initial state */ initialState?: VibecodeState; /** Error fallback component */ errorFallback?: ComponentType<ErrorFallbackProps>; /** Loading component */ loadingComponent?: ComponentType; /** Enable dev mode */ devMode?: boolean; /** Theme override */ theme?: VibecodeTheme; } /** * Vibecode provider with dependencies props */ interface VibecodeProviderWithDepsProps extends VibecodeProviderProps { /** Function to get project tasks */ getProjectTasks: (params: { scanDirectory: string; maxDepth: string | number; filePatterns: string; excludePatterns: string; }) => Promise<any[]>; /** SSE endpoint URL */ sseEndpoint?: string; /** SSE client getter */ getSSEClient?: (endpoint: string) => any; /** API key loader */ onLoadApiKey?: (provider: string) => Promise<string>; /** Chat API endpoint */ chatApiEndpoint?: string; /** AI settings panel component */ AISettingsPanel?: ComponentType; /** Hotkey input component */ HotkeyInput?: ComponentType<any>; /** File content loader */ loadFileContent?: (path: string) => Promise<string>; /** File content saver */ saveFileContent?: (path: string, content: string) => Promise<void>; } /** * Vibecode context value */ interface VibecodeContextValue { /** Configuration */ config: VibecodeConfig; /** Current state */ state: VibecodeState; /** State actions */ actions: VibecodeActions; /** Services */ services: VibecodeServices; /** Theme */ theme: VibecodeTheme; /** Dev mode flag */ devMode: boolean; } /** * Vibecode state */ interface VibecodeState { /** Loading state */ loading: boolean; /** Error state */ error?: VibecodeError$1; /** Current user */ user?: User; /** Active project */ project?: Project; /** Tasks */ tasks: Task[]; /** UI state */ ui: UIState; /** Feature flags */ features: Record<string, boolean>; } /** * Vibecode actions */ interface VibecodeActions { /** Set loading state */ setLoading(loading: boolean): void; /** Set error */ setError(error: VibecodeError$1 | undefined): void; /** Set user */ setUser(user: User | undefined): void; /** Set project */ setProject(project: Project | undefined): void; /** Update tasks */ updateTasks(tasks: Task[]): void; /** Update UI state */ updateUI(updates: Partial<UIState>): void; /** Toggle feature */ toggleFeature(feature: string): void; /** Reset state */ reset(): void; } /** * Vibecode services */ interface VibecodeServices { /** API service */ api: APIService; /** File service */ files: FileService; /** Task service */ tasks: TaskService; /** AI service */ ai: AIService$2; /** Analytics service */ analytics: AnalyticsService; /** Storage service */ storage: StorageService; } /** * API service interface */ interface APIService { /** Make GET request */ get<T = any>(path: string, options?: RequestOptions): Promise<T>; /** Make POST request */ post<T = any>(path: string, data?: any, options?: RequestOptions): Promise<T>; /** Make PUT request */ put<T = any>(path: string, data?: any, options?: RequestOptions): Promise<T>; /** Make DELETE request */ delete<T = any>(path: string, options?: RequestOptions): Promise<T>; /** Set auth token */ setAuthToken(token: string): void; /** Clear auth token */ clearAuthToken(): void; } /** * Request options */ interface RequestOptions { /** Request headers */ headers?: Record<string, string>; /** Query parameters */ params?: Record<string, any>; /** Request timeout */ timeout?: number; /** Abort signal */ signal?: AbortSignal; /** Response type */ responseType?: 'json' | 'text' | 'blob' | 'arraybuffer'; } /** * File service interface */ interface FileService { /** Read file content */ read(path: string): Promise<string>; /** Write file content */ write(path: string, content: string): Promise<void>; /** Delete file */ delete(path: string): Promise<void>; /** List files */ list(directory: string, options?: FileListOptions): Promise<FileInfo[]>; /** Check if file exists */ exists(path: string): Promise<boolean>; /** Get file info */ getInfo(path: string): Promise<FileInfo>; } /** * File list options */ interface FileListOptions { /** Include subdirectories */ recursive?: boolean; /** File patterns to include */ include?: string[]; /** File patterns to exclude */ exclude?: string[]; /** Maximum depth */ maxDepth?: number; } /** * File information */ interface FileInfo { /** File path */ path: string; /** File name */ name: string; /** File size */ size: number; /** Is directory */ isDirectory: boolean; /** Last modified */ lastModified: Date; /** File extension */ extension?: string; } /** * Task service interface */ interface TaskService { /** Get all tasks */ getTasks(): Promise<Task[]>; /** Get task by ID */ getTask(id: string): Promise<Task | null>; /** Create task */ createTask(task: Omit<Task, 'id' | 'createdAt' | 'updatedAt'>): Promise<Task>; /** Update task */ updateTask(id: string, updates: Partial<Task>): Promise<Task>; /** Delete task */ deleteTask(id: string): Promise<void>; /** Search tasks */ searchTasks(query: string, options?: TaskSearchOptions): Promise<Task[]>; } /** * Task search options */ interface TaskSearchOptions { /** Filter by type */ type?: string[]; /** Filter by status */ status?: string[]; /** Filter by priority */ priority?: string[]; /** Filter by file */ filePath?: string; /** Sort by field */ sortBy?: keyof Task; /** Sort order */ sortOrder?: 'asc' | 'desc'; } /** * AI service interface */ interface AIService$2 { /** Send chat message */ chat(message: string, options?: ChatOptions$1): Promise<string>; /** Generate code */ generateCode(prompt: string, options?: CodeGenerationOptions): Promise<string>; /** Analyze code */ analyzeCode(code: string, options?: CodeAnalysisOptions): Promise<CodeAnalysis>; /** Get suggestions */ getSuggestions(context: string, options?: SuggestionOptions): Promise<string[]>; /** Stream chat response */ streamChat(message: string, options?: ChatOptions$1): AsyncIterable<string>; } /** * Chat options */ interface ChatOptions$1 { /** System prompt */ systemPrompt?: string; /** Temperature */ temperature?: number; /** Maximum tokens */ maxTokens?: number; /** Stop sequences */ stopSequences?: string[]; /** Include context */ includeContext?: boolean; } /** * Code generation options */ interface CodeGenerationOptions { /** Programming language */ language?: string; /** Framework */ framework?: string; /** Style guide */ styleGuide?: string; /** Include comments */ includeComments?: boolean; } /** * Code analysis options */ interface CodeAnalysisOptions { /** Analysis type */ type?: 'security' | 'performance' | 'quality' | 'all'; /** Include suggestions */ includeSuggestions?: boolean; /** Severity threshold */ severityThreshold?: 'info' | 'warning' | 'error'; } /** * Code analysis result */ interface CodeAnalysis { /** Analysis issues */ issues: AnalysisIssue[]; /** Code metrics */ metrics: CodeMetrics; /** Suggestions */ suggestions?: string[]; } /** * Analysis issue */ interface AnalysisIssue { /** Issue type */ type: string; /** Severity */ severity: 'info' | 'warning' | 'error'; /** Issue message */ message: string; /** Line number */ line?: number; /** Column number */ column?: number; } /** * Code metrics */ interface CodeMetrics { /** Lines of code */ linesOfCode: number; /** Cyclomatic complexity */ complexity?: number; /** Test coverage */ coverage?: number; /** Code quality score */ qualityScore?: number; } /** * Suggestion options */ interface SuggestionOptions { /** Maximum suggestions */ maxSuggestions?: number; /** Suggestion type */ type?: 'completion' | 'refactor' | 'fix'; /** Include documentation */ includeDocumentation?: boolean; } /** * Analytics service interface */ interface AnalyticsService { /** Track event */ track(event: string, properties?: Record<string, any>): void; /** Identify user */ identify(userId: string, traits?: Record<string, any>): void; /** Track page view */ page(name?: string, properties?: Record<string, any>): void; /** Set super properties */ setSuperProperties(properties: Record<string, any>): void; /** Reset analytics */ reset(): void; } /** * Storage service interface */ interface StorageService { /** Get item */ get<T = any>(key: string): T | null; /** Set item */ set<T = any>(key: string, value: T): void; /** Remove item */ remove(key: string): void; /** Clear storage */ clear(): void; /** Get all keys */ keys(): string[]; } /** * User interface */ interface User { /** User ID */ id: string; /** Username */ username: string; /** Email */ email?: string; /** Display name */ displayName?: string; /** Avatar URL */ avatar?: string; /** User roles */ roles?: string[]; /** User preferences */ preferences?: UserPreferences; } /** * User preferences */ interface UserPreferences { /** Theme preference */ theme?: 'light' | 'dark' | 'system'; /** Language */ language?: string; /** Editor settings */ editor?: EditorPreferences; /** Notification settings */ notifications?: NotificationPreferences; } /** * Editor preferences */ interface EditorPreferences { /** Font size */ fontSize?: number; /** Font family */ fontFamily?: string; /** Tab size */ tabSize?: number; /** Word wrap */ wordWrap?: boolean; /** Line numbers */ lineNumbers?: boolean; } /** * Notification preferences */ interface NotificationPreferences { /** Enable notifications */ enabled?: boolean; /** Email notifications */ email?: boolean; /** Push notifications */ push?: boolean; /** Notification types */ types?: Record<string, boolean>; } /** * Project interface */ interface Project { /** Project ID */ id: string; /** Project name */ name: string; /** Project description */ description?: string; /** Project path */ path: string; /** Project type */ type?: string; /** Project metadata */ metadata?: Record<string, any>; } /** * UI state */ interface UIState { /** Panel visibility */ panelOpen: boolean; /** Active tab */ activeTab?: string; /** Selected file */ selectedFile?: string; /** Search query */ searchQuery?: string; /** Filters */ filters?: Record<string, any>; /** Sort settings */ sort?: { field: string; order: 'asc' | 'desc'; }; } /** * Vibecode theme */ interface VibecodeTheme { /** Color palette */ colors: ThemeColors; /** Typography */ typography: ThemeTypography; /** Spacing */ spacing: ThemeSpacing; /** Breakpoints */ breakpoints: ThemeBreakpoints; /** Shadows */ shadows?: ThemeShadows; /** Border radius */ borderRadius?: ThemeBorderRadius; } /** * Theme colors */ interface ThemeColors { /** Primary color */ primary: string; /** Secondary color */ secondary: string; /** Background colors */ background: { default: string; paper: string; elevated: string; }; /** Text colors */ text: { primary: string; secondary: string; disabled: string; }; /** Status colors */ error: string; warning: string; info: string; success: string; } /** * Theme typography */ interface ThemeTypography { /** Font families */ fontFamily: { sans: string; mono: string; }; /** Font sizes */ fontSize: { xs: string; sm: string; md: string; lg: string; xl: string; }; /** Font weights */ fontWeight: { normal: number; medium: number; bold: number; }; /** Line heights */ lineHeight: { tight: number; normal: number; relaxed: number; }; } /** * Theme spacing */ interface ThemeSpacing { unit: number; xs: string; sm: string; md: string; lg: string; xl: string; } /** * Theme breakpoints */ interface ThemeBreakpoints { xs: number; sm: number; md: number; lg: number; xl: number; } /** * Theme shadows */ interface ThemeShadows { sm: string; md: string; lg: string; xl: string; } /** * Theme border radius */ interface ThemeBorderRadius { sm: string; md: string; lg: string; full: string; } /** * Error fallback props */ interface ErrorFallbackProps { /** Error object */ error: Error; /** Error info */ errorInfo?: ErrorInfo; /** Reset error boundary */ resetError?: () => void; } /** * Vibecode error */ interface VibecodeError$1 extends Error { /** Error code */ code?: string; /** Error details */ details?: Record<string, any>; /** Recoverable error */ recoverable?: boolean; } /** * UI component type definitions */ /** * Base component props */ interface BaseComponentProps { /** Component ID */ id?: string; /** CSS class names */ className?: string; /** Inline styles */ style?: CSSProperties; /** Data attributes */ data?: Record<string, string>; /** ARIA attributes */ aria?: Record<string, string>; } /** * Panel component props */ interface PanelProps extends BaseComponentProps { /** Panel visibility */ isOpen: boolean; /** Toggle panel */ onToggle?: () => void; /** Panel position */ position?: 'left' | 'right' | 'bottom' | 'top'; /** Panel size */ size?: 'small' | 'medium' | 'large' | 'full'; /** Resizable panel */ resizable?: boolean; /** Minimum size */ minSize?: number; /** Maximum size */ maxSize?: number; /** Panel title */ title?: string; /** Panel content */ children: ReactNode; /** Close button */ showCloseButton?: boolean; /** On close callback */ onClose?: () => void; } /** * Button component props */ interface ButtonProps extends BaseComponentProps { /** Button variant */ variant?: 'primary' | 'secondary' | 'ghost' | 'danger'; /** Button size */ size?: 'small' | 'medium' | 'large'; /** Disabled state */ disabled?: boolean; /** Loading state */ loading?: boolean; /** Full width */ fullWidth?: boolean; /** Icon before text */ startIcon?: ReactNode; /** Icon after text */ endIcon?: ReactNode; /** Button content */ children: ReactNode; /** Click handler */ onClick?: (event: MouseEvent<HTMLButtonElement>) => void; /** Button type */ type?: 'button' | 'submit' | 'reset'; /** Tooltip */ tooltip?: string; } /** * Icon button component props */ interface IconButtonProps extends Omit<ButtonProps, 'children'> { /** Icon component */ icon: ReactNode; /** Icon size */ iconSize?: 'small' | 'medium' | 'large'; /** Rounded button */ rounded?: boolean; } /** * Input component props */ interface InputProps extends BaseComponentProps { /** Input type */ type?: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url'; /** Input value */ value?: string | number; /** Default value */ defaultValue?: string | number; /** Placeholder text */ placeholder?: string; /** Disabled state */ disabled?: boolean; /** Read-only state */ readOnly?: boolean; /** Required field */ required?: boolean; /** Input size */ size?: 'small' | 'medium' | 'large'; /** Full width */ fullWidth?: boolean; /** Error state */ error?: boolean; /** Helper text */ helperText?: string; /** Label */ label?: string; /** Start adornment */ startAdornment?: ReactNode; /** End adornment */ endAdornment?: ReactNode; /** Change handler */ onChange?: (event: ChangeEvent<HTMLInputElement>) => void; /** Focus handler */ onFocus?: (event: FocusEvent) => void; /** Blur handler */ onBlur?: (event: FocusEvent) => void; /** Key press handler */ onKeyPress?: (event: KeyboardEvent<HTMLInputElement>) => void; } /** * Textarea component props */ interface TextareaProps extends Omit<InputProps, 'type' | 'startAdornment' | 'endAdornment'> { /** Number of rows */ rows?: number; /** Minimum rows */ minRows?: number; /** Maximum rows */ maxRows?: number; /** Auto resize */ autoResize?: boolean; /** Maximum length */ maxLength?: number; /** Show character count */ showCharCount?: boolean; } /** * Select component props */ interface SelectProps extends BaseComponentProps { /** Selected value */ value?: string | string[]; /** Default value */ defaultValue?: string | string[]; /** Select options */ options: SelectOption[]; /** Multiple selection */ multiple?: boolean; /** Disabled state */ disabled?: boolean; /** Select size */ size?: 'small' | 'medium' | 'large'; /** Full width */ fullWidth?: boolean; /** Error state */ error?: boolean; /** Helper text */ helperText?: string; /** Label */ label?: string; /** Placeholder */ placeholder?: string; /** Searchable */ searchable?: boolean; /** Clear button */ clearable?: boolean; /** Change handler */ onChange?: (value: string | string[]) => void; /** Search handler */ onSearch?: (query: string) => void; } /** * Select option */ interface SelectOption { /** Option value */ value: string; /** Option label */ label: string; /** Option disabled */ disabled?: boolean; /** Option group */ group?: string; /** Option icon */ icon?: ReactNode; } /** * Checkbox component props */ interface CheckboxProps extends BaseComponentProps { /** Checked state */ checked?: boolean; /** Default checked */ defaultChecked?: boolean; /** Indeterminate state */ indeterminate?: boolean; /** Disabled state */ disabled?: boolean; /** Checkbox size */ size?: 'small' | 'medium' | 'large'; /** Label */ label?: string; /** Error state */ error?: boolean; /** Change handler */ onChange?: (checked: boolean) => void; } /** * Radio component props */ interface RadioProps extends Omit<CheckboxProps, 'indeterminate'> { /** Radio name */ name: string; /** Radio value */ value: string; } /** * Switch component props */ interface SwitchProps extends Omit<CheckboxProps, 'indeterminate'> { /** Switch color */ color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error'; } /** * Tab component props */ interface TabsProps extends BaseComponentProps { /** Active tab */ activeTab?: string; /** Default active tab */ defaultActiveTab?: string; /** Tab items */ tabs: TabItem[]; /** Tab variant */ variant?: 'default' | 'pills' | 'underline'; /** Tab size */ size?: 'small' | 'medium' | 'large'; /** Full width tabs */ fullWidth?: boolean; /** Scrollable tabs */ scrollable?: boolean; /** Tab change handler */ onChange?: (tabId: string) => void; } /** * Tab item */ interface TabItem { /** Tab ID */ id: string; /** Tab label */ label: string; /** Tab icon */ icon?: ReactNode; /** Tab content */ content?: ReactNode; /** Tab disabled */ disabled?: boolean; /** Tab badge */ badge?: string | number; } /** * Modal component props */ interface ModalProps extends BaseComponentProps { /** Modal visibility */ isOpen: boolean; /** Close modal */ onClose?: () => void; /** Modal title */ title?: string; /** Modal size */ size?: 'small' | 'medium' | 'large' | 'full'; /** Close on backdrop click */ closeOnBackdropClick?: boolean; /** Close on escape */ closeOnEscape?: boolean; /** Show close button */ showCloseButton?: boolean; /** Modal content */ children: ReactNode; /** Footer content */ footer?: ReactNode; /** Centered modal */ centered?: boolean; /** Animation type */ animation?: 'fade' | 'scale' | 'slide'; } /** * Tooltip component props */ interface TooltipProps extends BaseComponentProps { /** Tooltip content */ content: ReactNode; /** Trigger element */ children: ReactNode; /** Tooltip position */ position?: 'top' | 'bottom' | 'left' | 'right'; /** Trigger type */ trigger?: 'hover' | 'click' | 'focus'; /** Show delay */ delay?: number; /** Show arrow */ arrow?: boolean; /** Interactive tooltip */ interactive?: boolean; /** Disabled state */ disabled?: boolean; } /** * Dropdown component props */ interface DropdownProps extends BaseComponentProps { /** Dropdown trigger */ trigger: ReactNode; /** Dropdown items */ items: DropdownItem[]; /** Dropdown position */ position?: 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end'; /** Close on item click */ closeOnItemClick?: boolean; /** Show arrow */ arrow?: boolean; /** Disabled state */ disabled?: boolean; } /** * Dropdown item */ interface DropdownItem { /** Item ID */ id: string; /** Item label */ label: string; /** Item icon */ icon?: ReactNode; /** Item disabled */ disabled?: boolean; /** Item divider */ divider?: boolean; /** Item handler */ onClick?: () => void; /** Sub items */ items?: DropdownItem[]; } /** * Alert component props */ interface AlertProps extends BaseComponentProps { /** Alert type */ type: 'info' | 'success' | 'warning' | 'error'; /** Alert title */ title?: string; /** Alert message */ message: string; /** Show icon */ showIcon?: boolean; /** Custom icon */ icon?: ReactNode; /** Closable alert */ closable?: boolean; /** On close handler */ onClose?: () => void; /** Action buttons */ actions?: ReactNode; } /** * Badge component props */ interface BadgeProps extends BaseComponentProps { /** Badge content */ content?: string | number; /** Badge color */ color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error'; /** Badge variant */ variant?: 'standard' | 'dot'; /** Badge position */ position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; /** Show zero */ showZero?: boolean; /** Maximum value */ max?: number; /** Badge children */ children: ReactNode; } /** * Progress component props */ interface ProgressProps extends BaseComponentProps { /** Progress value */ value?: number; /** Maximum value */ max?: number; /** Progress variant */ variant?: 'linear' | 'circular'; /** Progress size */ size?: 'small' | 'medium' | 'large'; /** Progress color */ color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error'; /** Show label */ showLabel?: boolean; /** Custom label */ label?: string; /** Indeterminate state */ indeterminate?: boolean; } /** * Skeleton component props */ interface SkeletonProps extends BaseComponentProps { /** Skeleton variant */ variant?: 'text' | 'circular' | 'rectangular'; /** Skeleton width */ width?: string | number; /** Skeleton height */ height?: string | number; /** Animation type */ animation?: 'pulse' | 'wave' | false; } /** * List component props */ interface ListProps extends BaseComponentProps { /** List items */ items: ListItem[]; /** List variant */ variant?: 'default' | 'bordered' | 'separated'; /** List size */ size?: 'small' | 'medium' | 'large'; /** Selectable items */ selectable?: boolean; /** Selected items */ selectedItems?: string[]; /** Item click handler */ onItemClick?: (item: ListItem) => void; /** Selection change handler */ onSelectionChange?: (selectedIds: string[]) => void; } /** * List item */ interface ListItem { /** Item ID */ id: string; /** Primary text */ primary: string; /** Secondary text */ secondary?: string; /** Item icon */ icon?: ReactNode; /** Item avatar */ avatar?: string; /** Item actions */ actions?: ReactNode; /** Item disabled */ disabled?: boolean; /** Item metadata */ metadata?: Record<string, any>; } /** * Card component props */ interface CardProps extends BaseComponentProps { /** Card variant */ variant?: 'outlined' | 'elevated'; /** Card padding */ padding?: 'none' | 'small' | 'medium' | 'large'; /** Card header */ header?: ReactNode; /** Card footer */ footer?: ReactNode; /** Card content */ children: ReactNode; /** Clickable card */ clickable?: boolean; /** Click handler */ onClick?: () => void; } /** * Avatar component props */ interface AvatarProps extends BaseComponentProps { /** Avatar source */ src?: string; /** Avatar alt text */ alt?: string; /** Avatar size */ size?: 'small' | 'medium' | 'large' | numbe