1+ /**
2+ * Core configuration type definitions
3+ */
4+
5+ export interface StatusLine {
6+ type : 'command' ;
7+ command : string ;
8+ }
9+
10+ export interface CodeRules {
11+ eslint ?: Record < string , unknown > ;
12+ prettier ?: Record < string , unknown > ;
13+ typescript ?: Record < string , unknown > ;
14+ biome ?: Record < string , unknown > ;
15+ }
16+
17+ export interface ComponentPatterns {
18+ directory ?: string ;
19+ naming ?: 'camelCase' | 'PascalCase' | 'kebab-case' | 'snake_case' ;
20+ extension ?: string ;
21+ indexFiles ?: boolean ;
22+ }
23+
24+ export interface ImportOrder {
25+ groups ?: string [ ] [ ] ;
26+ alphabetize ?: {
27+ order ?: 'asc' | 'desc' ;
28+ caseInsensitive ?: boolean ;
29+ } ;
30+ }
31+
32+ export interface TestingFramework {
33+ framework ?: 'vitest' | 'jest' | 'mocha' | 'cypress' | 'playwright' ;
34+ coverage ?: boolean ;
35+ setupFiles ?: string [ ] ;
36+ testMatch ?: string [ ] ;
37+ }
38+
39+ export interface BuildTools {
40+ bundler ?: 'webpack' | 'vite' | 'rollup' | 'esbuild' | 'turbopack' ;
41+ target ?: string ;
42+ optimization ?: Record < string , unknown > ;
43+ }
44+
45+ export type HookCommand = {
46+ type : 'command' ;
47+ command : string ;
48+ timeout ?: number ;
49+ } ;
50+
51+ export type HookEntry = {
52+ matcher ?: string ;
53+ hooks : HookCommand [ ] ;
54+ } ;
55+
56+ export interface HooksConfig {
57+ PreToolUse ?: HookEntry [ ] ;
58+ PostToolUse ?: HookEntry [ ] ;
59+ Stop ?: HookEntry [ ] ;
60+ UserPromptSubmit ?: HookEntry [ ] ;
61+ Notification ?: HookEntry [ ] ;
62+ SubagentStop ?: HookEntry [ ] ;
63+ SessionEnd ?: HookEntry [ ] ;
64+ SessionStart ?: HookEntry [ ] ;
65+ PreCompact ?: HookEntry [ ] ;
66+ [ hookName : string ] : HookEntry [ ] | undefined ;
67+ }
68+
69+ export interface ConfigSettings {
70+ name ?: string ;
71+ description ?: string ;
72+ version ?: string ;
73+ statusLine ?: StatusLine ;
74+ codeRules ?: CodeRules ;
75+ componentPatterns ?: ComponentPatterns ;
76+ importOrder ?: ImportOrder ;
77+ testingFramework ?: TestingFramework ;
78+ buildTools ?: BuildTools ;
79+ hooks ?: HooksConfig ;
80+ [ key : string ] : unknown ;
81+ }
82+
83+ export interface ConfigComponent {
84+ type : 'agent' | 'command' | 'hook' | 'setting' ;
85+ name : string ;
86+ content : string ;
87+ metadata ?: ConfigMetadata ;
88+ }
89+
90+ export interface ConfigMetadata {
91+ title ?: string ;
92+ description ?: string ;
93+ version ?: string ;
94+ author ?: string ;
95+ tags ?: string [ ] ;
96+ dependencies ?: string [ ] ;
97+ optionalDependencies ?: string [ ] ;
98+ category ?: string ;
99+ priority ?: number ;
100+ [ key : string ] : unknown ;
101+ }
102+
103+ export interface ParsedConfig {
104+ agents : ConfigComponent [ ] ;
105+ commands : ConfigComponent [ ] ;
106+ hooks : ConfigComponent [ ] ;
107+ settings : ConfigSettings ;
108+ metadata ?: ConfigMetadata ;
109+ }
110+
111+ export interface ConfigurationSource {
112+ path : string ;
113+ name : string ;
114+ description ?: string ;
115+ category ?: 'frameworks' | 'ui' | 'databases' | 'tooling' | 'mcp-servers' ;
116+ tags ?: string [ ] ;
117+ }
118+
119+ export interface MergeOptions {
120+ overwriteConflicts ?: boolean ;
121+ preserveComments ?: boolean ;
122+ validateAfterMerge ?: boolean ;
123+ backupBeforeMerge ?: boolean ;
124+ }
125+
126+ export interface GenerateOptions {
127+ outputDir : string ;
128+ configurations : string [ ] ;
129+ mergeOptions ?: MergeOptions ;
130+ dryRun ?: boolean ;
131+ force ?: boolean ;
132+ verbose ?: boolean ;
133+ }
134+
135+ export interface ValidationResult {
136+ isValid : boolean ;
137+ errors : ValidationError [ ] ;
138+ warnings : ValidationWarning [ ] ;
139+ }
140+
141+ export interface ValidationError {
142+ type : 'syntax' | 'semantic' | 'dependency' | 'conflict' ;
143+ message : string ;
144+ location ?: {
145+ file ?: string ;
146+ line ?: number ;
147+ column ?: number ;
148+ } ;
149+ severity : 'error' | 'warning' | 'info' ;
150+ }
151+
152+ export interface ValidationWarning {
153+ type : 'deprecation' | 'performance' | 'best-practice' ;
154+ message : string ;
155+ location ?: {
156+ file ?: string ;
157+ line ?: number ;
158+ column ?: number ;
159+ } ;
160+ }
161+
162+ export interface BackupInfo {
163+ timestamp : string ;
164+ originalPath : string ;
165+ backupPath : string ;
166+ reason : string ;
167+ }
168+
169+ export interface OperationResult < T = unknown > {
170+ success : boolean ;
171+ data ?: T ;
172+ errors ?: string [ ] ;
173+ warnings ?: string [ ] ;
174+ backups ?: BackupInfo [ ] ;
175+ }
0 commit comments