-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
171 lines (151 loc) · 3.75 KB
/
types.ts
File metadata and controls
171 lines (151 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// ── Core Index Types ─────────────────────────────────────────────────────────
export interface CCSIndex {
version: string;
timestamp: string;
root: string;
stats: ProjectStats;
files: Record<string, FileNode>;
symbols: Record<string, SymbolRef[]>;
conventions: Conventions;
}
export interface ProjectStats {
totalFiles: number;
totalDirs: number;
totalLines: number;
languages: LanguageStat[];
techStack: string[];
entryPoints: string[];
}
export interface LanguageStat {
language: string;
files: number;
lines: number;
percentage: number;
}
export interface FileNode {
path: string;
role: FileRole;
language: string;
lines: number;
size: number;
hash: string;
lastModified: number;
imports: string[];
importedBy: string[];
exports: string[];
symbols: SymbolEntry[];
rank: FileRank;
centrality: number;
}
export interface SymbolEntry {
name: string;
type: SymbolType;
line: number;
endLine?: number;
exported: boolean;
signature?: string;
}
export interface SymbolRef {
file: string;
line: number;
type: SymbolType;
exported: boolean;
}
export type FileRole =
| 'entry'
| 'component'
| 'page'
| 'service'
| 'controller'
| 'model'
| 'util'
| 'helper'
| 'config'
| 'test'
| 'type'
| 'style'
| 'middleware'
| 'hook'
| 'context'
| 'store'
| 'api'
| 'schema'
| 'script'
| 'unknown';
export type FileRank = 'S' | 'A' | 'B' | 'C' | 'D';
export type SymbolType =
| 'function'
| 'class'
| 'interface'
| 'type'
| 'enum'
| 'variable'
| 'const'
| 'method'
| 'property';
// ── Conventions ─────────────────────────────────────────────────────────────
export interface Conventions {
naming: {
files: string;
variables: string;
classes: string;
functions: string;
};
imports: string;
testing: {
framework: string;
pattern: string;
location: string;
};
errorHandling: string;
architecture: string;
}
// ── Search & Context Types ──────────────────────────────────────────────────
export interface SearchResult {
file: string;
score: number;
matchType: 'path' | 'symbol' | 'import' | 'content' | 'dependency';
matchDetail: string;
node: FileNode;
}
export interface ContextBlock {
file: string;
sections: FileSection[];
rank: FileRank;
importerCount: number;
role: FileRole;
}
export interface FileSection {
startLine: number;
endLine: number;
content: string;
reason: string;
}
export interface ContextOutput {
query: string;
files: ContextBlock[];
conventions: Conventions;
totalLines: number;
totalFiles: number;
}
// ── Graph Types ─────────────────────────────────────────────────────────────
export interface DependencyGraph {
adjacency: Record<string, string[]>;
reverseAdjacency: Record<string, string[]>;
centrality: Record<string, number>;
}
// ── CLI Types ───────────────────────────────────────────────────────────────
export interface HookInput {
session_id?: string;
cwd?: string;
hook_event_name?: string;
prompt?: string;
tool_name?: string;
tool_input?: {
file_path?: string;
path?: string;
command?: string;
content?: string;
pattern?: string;
};
}