archicore 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/README.md +530 -0
  2. package/dist/analyzers/dead-code.d.ts +95 -0
  3. package/dist/analyzers/dead-code.js +327 -0
  4. package/dist/analyzers/duplication.d.ts +90 -0
  5. package/dist/analyzers/duplication.js +344 -0
  6. package/dist/analyzers/security.d.ts +79 -0
  7. package/dist/analyzers/security.js +484 -0
  8. package/dist/architecture/index.d.ts +35 -0
  9. package/dist/architecture/index.js +249 -0
  10. package/dist/cli/commands/analyzers.d.ts +6 -0
  11. package/dist/cli/commands/analyzers.js +431 -0
  12. package/dist/cli/commands/export.d.ts +6 -0
  13. package/dist/cli/commands/export.js +78 -0
  14. package/dist/cli/commands/index.d.ts +8 -0
  15. package/dist/cli/commands/index.js +8 -0
  16. package/dist/cli/commands/init.d.ts +26 -0
  17. package/dist/cli/commands/init.js +140 -0
  18. package/dist/cli/commands/interactive.d.ts +7 -0
  19. package/dist/cli/commands/interactive.js +522 -0
  20. package/dist/cli/commands/projects.d.ts +6 -0
  21. package/dist/cli/commands/projects.js +249 -0
  22. package/dist/cli/index.d.ts +7 -0
  23. package/dist/cli/index.js +7 -0
  24. package/dist/cli/ui/box.d.ts +17 -0
  25. package/dist/cli/ui/box.js +62 -0
  26. package/dist/cli/ui/colors.d.ts +49 -0
  27. package/dist/cli/ui/colors.js +86 -0
  28. package/dist/cli/ui/index.d.ts +9 -0
  29. package/dist/cli/ui/index.js +9 -0
  30. package/dist/cli/ui/prompt.d.ts +34 -0
  31. package/dist/cli/ui/prompt.js +122 -0
  32. package/dist/cli/ui/spinner.d.ts +29 -0
  33. package/dist/cli/ui/spinner.js +80 -0
  34. package/dist/cli/ui/table.d.ts +33 -0
  35. package/dist/cli/ui/table.js +84 -0
  36. package/dist/cli/utils/config.d.ts +23 -0
  37. package/dist/cli/utils/config.js +73 -0
  38. package/dist/cli/utils/index.d.ts +6 -0
  39. package/dist/cli/utils/index.js +6 -0
  40. package/dist/cli/utils/session.d.ts +27 -0
  41. package/dist/cli/utils/session.js +117 -0
  42. package/dist/cli.d.ts +8 -0
  43. package/dist/cli.js +295 -0
  44. package/dist/code-index/ast-parser.d.ts +16 -0
  45. package/dist/code-index/ast-parser.js +330 -0
  46. package/dist/code-index/dependency-graph.d.ts +16 -0
  47. package/dist/code-index/dependency-graph.js +161 -0
  48. package/dist/code-index/index.d.ts +44 -0
  49. package/dist/code-index/index.js +124 -0
  50. package/dist/code-index/symbol-extractor.d.ts +13 -0
  51. package/dist/code-index/symbol-extractor.js +150 -0
  52. package/dist/export/index.d.ts +92 -0
  53. package/dist/export/index.js +676 -0
  54. package/dist/github/github-service.d.ts +146 -0
  55. package/dist/github/github-service.js +609 -0
  56. package/dist/impact-engine/index.d.ts +25 -0
  57. package/dist/impact-engine/index.js +284 -0
  58. package/dist/index.d.ts +60 -0
  59. package/dist/index.js +149 -0
  60. package/dist/metrics/index.d.ts +136 -0
  61. package/dist/metrics/index.js +525 -0
  62. package/dist/orchestrator/deepseek-optimizer.d.ts +67 -0
  63. package/dist/orchestrator/deepseek-optimizer.js +320 -0
  64. package/dist/orchestrator/index.d.ts +34 -0
  65. package/dist/orchestrator/index.js +305 -0
  66. package/dist/pr-guardian/index.d.ts +143 -0
  67. package/dist/pr-guardian/index.js +553 -0
  68. package/dist/refactoring/index.d.ts +108 -0
  69. package/dist/refactoring/index.js +580 -0
  70. package/dist/rules-engine/index.d.ts +129 -0
  71. package/dist/rules-engine/index.js +482 -0
  72. package/dist/semantic-memory/embedding-service.d.ts +24 -0
  73. package/dist/semantic-memory/embedding-service.js +120 -0
  74. package/dist/semantic-memory/index.d.ts +45 -0
  75. package/dist/semantic-memory/index.js +206 -0
  76. package/dist/semantic-memory/vector-store.d.ts +27 -0
  77. package/dist/semantic-memory/vector-store.js +166 -0
  78. package/dist/server/index.d.ts +28 -0
  79. package/dist/server/index.js +141 -0
  80. package/dist/server/middleware/api-auth.d.ts +43 -0
  81. package/dist/server/middleware/api-auth.js +256 -0
  82. package/dist/server/routes/admin.d.ts +5 -0
  83. package/dist/server/routes/admin.js +123 -0
  84. package/dist/server/routes/api.d.ts +7 -0
  85. package/dist/server/routes/api.js +362 -0
  86. package/dist/server/routes/auth.d.ts +16 -0
  87. package/dist/server/routes/auth.js +191 -0
  88. package/dist/server/routes/developer.d.ts +8 -0
  89. package/dist/server/routes/developer.js +439 -0
  90. package/dist/server/routes/github.d.ts +7 -0
  91. package/dist/server/routes/github.js +495 -0
  92. package/dist/server/routes/upload.d.ts +7 -0
  93. package/dist/server/routes/upload.js +196 -0
  94. package/dist/server/services/api-key-service.d.ts +81 -0
  95. package/dist/server/services/api-key-service.js +281 -0
  96. package/dist/server/services/auth-service.d.ts +40 -0
  97. package/dist/server/services/auth-service.js +315 -0
  98. package/dist/server/services/project-service.d.ts +123 -0
  99. package/dist/server/services/project-service.js +533 -0
  100. package/dist/server/services/token-service.d.ts +107 -0
  101. package/dist/server/services/token-service.js +416 -0
  102. package/dist/server/services/upload-service.d.ts +93 -0
  103. package/dist/server/services/upload-service.js +464 -0
  104. package/dist/types/api.d.ts +188 -0
  105. package/dist/types/api.js +86 -0
  106. package/dist/types/github.d.ts +335 -0
  107. package/dist/types/github.js +5 -0
  108. package/dist/types/index.d.ts +265 -0
  109. package/dist/types/index.js +32 -0
  110. package/dist/types/user.d.ts +69 -0
  111. package/dist/types/user.js +42 -0
  112. package/dist/utils/file-utils.d.ts +20 -0
  113. package/dist/utils/file-utils.js +163 -0
  114. package/dist/utils/logger.d.ts +17 -0
  115. package/dist/utils/logger.js +41 -0
  116. package/dist/watcher/index.d.ts +125 -0
  117. package/dist/watcher/index.js +397 -0
  118. package/package.json +71 -0
@@ -0,0 +1,86 @@
1
+ /**
2
+ * API Types for ArchiCore Developer API
3
+ *
4
+ * Система токенизированной тарификации как у OpenAI/Anthropic
5
+ */
6
+ export const PRICING_TIERS = {
7
+ free: {
8
+ name: 'Free',
9
+ pricePerMillionTokens: 0,
10
+ includedTokens: 10_000, // 10K tokens free
11
+ monthlyPrice: 0
12
+ },
13
+ starter: {
14
+ name: 'Starter',
15
+ pricePerMillionTokens: 5.00, // $5 per 1M tokens
16
+ includedTokens: 100_000, // 100K tokens included
17
+ monthlyPrice: 0 // Pay-as-you-go
18
+ },
19
+ developer: {
20
+ name: 'Developer',
21
+ pricePerMillionTokens: 3.00, // $3 per 1M tokens (40% discount)
22
+ includedTokens: 1_000_000, // 1M tokens included
23
+ monthlyPrice: 29
24
+ },
25
+ team: {
26
+ name: 'Team',
27
+ pricePerMillionTokens: 2.00, // $2 per 1M tokens (60% discount)
28
+ includedTokens: 10_000_000, // 10M tokens included
29
+ monthlyPrice: 99
30
+ },
31
+ enterprise: {
32
+ name: 'Enterprise',
33
+ pricePerMillionTokens: 1.00, // $1 per 1M tokens (80% discount)
34
+ includedTokens: 100_000_000, // 100M tokens included
35
+ monthlyPrice: 499
36
+ }
37
+ };
38
+ // Токены за операцию (примерные значения)
39
+ export const OPERATION_TOKEN_COSTS = {
40
+ index: { base: 100, perFile: 50, perKb: 10 },
41
+ analyze_impact: { base: 500, perFile: 100, perKb: 5 },
42
+ analyze_security: { base: 300, perFile: 80, perKb: 3 },
43
+ analyze_full: { base: 2000, perFile: 200, perKb: 10 },
44
+ search_semantic: { base: 50, perFile: 0, perKb: 0 },
45
+ ask_architect: { base: 200, perFile: 0, perKb: 2 },
46
+ export: { base: 100, perFile: 10, perKb: 1 },
47
+ refactoring: { base: 500, perFile: 150, perKb: 5 },
48
+ metrics: { base: 100, perFile: 20, perKb: 2 },
49
+ rules_check: { base: 200, perFile: 30, perKb: 2 },
50
+ dead_code: { base: 300, perFile: 50, perKb: 3 },
51
+ duplication: { base: 400, perFile: 60, perKb: 4 }
52
+ };
53
+ // Default rate limits by tier
54
+ export const DEFAULT_RATE_LIMITS = {
55
+ free: {
56
+ requestsPerMinute: 10,
57
+ requestsPerDay: 100,
58
+ tokensPerMinute: 1000,
59
+ tokensPerDay: 10000
60
+ },
61
+ starter: {
62
+ requestsPerMinute: 30,
63
+ requestsPerDay: 1000,
64
+ tokensPerMinute: 10000,
65
+ tokensPerDay: 100000
66
+ },
67
+ developer: {
68
+ requestsPerMinute: 60,
69
+ requestsPerDay: 5000,
70
+ tokensPerMinute: 50000,
71
+ tokensPerDay: 1000000
72
+ },
73
+ team: {
74
+ requestsPerMinute: 120,
75
+ requestsPerDay: 20000,
76
+ tokensPerMinute: 200000,
77
+ tokensPerDay: 10000000
78
+ },
79
+ enterprise: {
80
+ requestsPerMinute: 300,
81
+ requestsPerDay: 100000,
82
+ tokensPerMinute: 1000000,
83
+ tokensPerDay: 100000000
84
+ }
85
+ };
86
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1,335 @@
1
+ /**
2
+ * GitHub Integration Types for ArchiCore
3
+ */
4
+ export interface GitHubOAuthConfig {
5
+ clientId: string;
6
+ clientSecret: string;
7
+ redirectUri: string;
8
+ scope: string[];
9
+ }
10
+ export interface GitHubTokenResponse {
11
+ access_token: string;
12
+ token_type: string;
13
+ scope: string;
14
+ refresh_token?: string;
15
+ expires_in?: number;
16
+ }
17
+ export interface GitHubUser {
18
+ id: number;
19
+ login: string;
20
+ name: string | null;
21
+ email: string | null;
22
+ avatar_url: string;
23
+ html_url: string;
24
+ type: 'User' | 'Organization';
25
+ public_repos: number;
26
+ private_repos?: number;
27
+ created_at: string;
28
+ }
29
+ export interface GitHubRepository {
30
+ id: number;
31
+ name: string;
32
+ full_name: string;
33
+ description: string | null;
34
+ html_url: string;
35
+ clone_url: string;
36
+ ssh_url: string;
37
+ private: boolean;
38
+ owner: {
39
+ login: string;
40
+ id: number;
41
+ avatar_url: string;
42
+ type: 'User' | 'Organization';
43
+ };
44
+ default_branch: string;
45
+ language: string | null;
46
+ languages_url: string;
47
+ stargazers_count: number;
48
+ forks_count: number;
49
+ size: number;
50
+ pushed_at: string;
51
+ created_at: string;
52
+ updated_at: string;
53
+ permissions?: {
54
+ admin: boolean;
55
+ push: boolean;
56
+ pull: boolean;
57
+ };
58
+ }
59
+ export interface GitHubBranch {
60
+ name: string;
61
+ commit: {
62
+ sha: string;
63
+ url: string;
64
+ };
65
+ protected: boolean;
66
+ }
67
+ export interface GitHubCommit {
68
+ sha: string;
69
+ message: string;
70
+ author: {
71
+ name: string;
72
+ email: string;
73
+ date: string;
74
+ };
75
+ committer: {
76
+ name: string;
77
+ email: string;
78
+ date: string;
79
+ };
80
+ html_url: string;
81
+ stats?: {
82
+ additions: number;
83
+ deletions: number;
84
+ total: number;
85
+ };
86
+ files?: GitHubFile[];
87
+ }
88
+ export interface GitHubFile {
89
+ sha: string;
90
+ filename: string;
91
+ status: 'added' | 'removed' | 'modified' | 'renamed';
92
+ additions: number;
93
+ deletions: number;
94
+ changes: number;
95
+ patch?: string;
96
+ }
97
+ export interface GitHubPullRequest {
98
+ id: number;
99
+ number: number;
100
+ title: string;
101
+ body: string | null;
102
+ state: 'open' | 'closed';
103
+ html_url: string;
104
+ user: {
105
+ login: string;
106
+ avatar_url: string;
107
+ };
108
+ head: {
109
+ ref: string;
110
+ sha: string;
111
+ repo: {
112
+ full_name: string;
113
+ };
114
+ };
115
+ base: {
116
+ ref: string;
117
+ sha: string;
118
+ repo: {
119
+ full_name: string;
120
+ };
121
+ };
122
+ merged: boolean;
123
+ mergeable: boolean | null;
124
+ mergeable_state: string;
125
+ changed_files: number;
126
+ additions: number;
127
+ deletions: number;
128
+ commits: number;
129
+ created_at: string;
130
+ updated_at: string;
131
+ merged_at: string | null;
132
+ }
133
+ export interface GitHubPRReview {
134
+ id: number;
135
+ user: {
136
+ login: string;
137
+ avatar_url: string;
138
+ };
139
+ body: string;
140
+ state: 'APPROVED' | 'CHANGES_REQUESTED' | 'COMMENTED' | 'PENDING';
141
+ submitted_at: string;
142
+ html_url: string;
143
+ }
144
+ export interface GitHubPRComment {
145
+ id: number;
146
+ body: string;
147
+ path?: string;
148
+ line?: number;
149
+ user: {
150
+ login: string;
151
+ avatar_url: string;
152
+ };
153
+ created_at: string;
154
+ updated_at: string;
155
+ html_url: string;
156
+ }
157
+ export type GitHubWebhookEvent = 'push' | 'pull_request' | 'pull_request_review' | 'pull_request_review_comment' | 'issue_comment' | 'issues' | 'create' | 'delete' | 'repository';
158
+ export interface GitHubWebhook {
159
+ id: number;
160
+ type: string;
161
+ name: string;
162
+ active: boolean;
163
+ events: GitHubWebhookEvent[];
164
+ config: {
165
+ url: string;
166
+ content_type: 'json' | 'form';
167
+ secret?: string;
168
+ insecure_ssl?: string;
169
+ };
170
+ created_at: string;
171
+ updated_at: string;
172
+ }
173
+ export interface GitHubPushPayload {
174
+ ref: string;
175
+ before: string;
176
+ after: string;
177
+ repository: GitHubRepository;
178
+ pusher: {
179
+ name: string;
180
+ email: string;
181
+ };
182
+ sender: GitHubUser;
183
+ commits: Array<{
184
+ id: string;
185
+ message: string;
186
+ timestamp: string;
187
+ author: {
188
+ name: string;
189
+ email: string;
190
+ username: string;
191
+ };
192
+ added: string[];
193
+ removed: string[];
194
+ modified: string[];
195
+ }>;
196
+ head_commit: {
197
+ id: string;
198
+ message: string;
199
+ timestamp: string;
200
+ author: {
201
+ name: string;
202
+ email: string;
203
+ };
204
+ } | null;
205
+ }
206
+ export interface GitHubPRPayload {
207
+ action: 'opened' | 'closed' | 'reopened' | 'synchronize' | 'edited' | 'ready_for_review';
208
+ number: number;
209
+ pull_request: GitHubPullRequest;
210
+ repository: GitHubRepository;
211
+ sender: GitHubUser;
212
+ }
213
+ export interface GitHubConnection {
214
+ id: string;
215
+ userId: string;
216
+ githubUserId: number;
217
+ githubUsername: string;
218
+ accessToken: string;
219
+ refreshToken?: string;
220
+ tokenExpiresAt?: Date;
221
+ scope: string[];
222
+ createdAt: Date;
223
+ updatedAt: Date;
224
+ }
225
+ export interface ConnectedRepository {
226
+ id: string;
227
+ connectionId: string;
228
+ userId: string;
229
+ projectId?: string;
230
+ githubRepoId: number;
231
+ fullName: string;
232
+ name: string;
233
+ owner: string;
234
+ private: boolean;
235
+ defaultBranch: string;
236
+ cloneUrl: string;
237
+ webhookId?: number;
238
+ webhookSecret?: string;
239
+ autoAnalyze: boolean;
240
+ analyzePRs: boolean;
241
+ lastAnalyzedAt?: Date;
242
+ lastSyncAt?: Date;
243
+ status: 'active' | 'syncing' | 'error' | 'disconnected';
244
+ error?: string;
245
+ createdAt: Date;
246
+ updatedAt: Date;
247
+ }
248
+ export interface RepositoryAnalysisResult {
249
+ repositoryId: string;
250
+ commitSha: string;
251
+ branch: string;
252
+ analyzedAt: Date;
253
+ duration: number;
254
+ filesAnalyzed: number;
255
+ impactScore: number;
256
+ riskLevel: 'low' | 'medium' | 'high' | 'critical';
257
+ issues: Array<{
258
+ type: 'security' | 'architecture' | 'quality' | 'performance';
259
+ severity: 'info' | 'warning' | 'error' | 'critical';
260
+ message: string;
261
+ file?: string;
262
+ line?: number;
263
+ }>;
264
+ recommendations: string[];
265
+ }
266
+ export interface PRAnalysisResult {
267
+ pullRequestId: number;
268
+ pullRequestNumber: number;
269
+ repositoryId: string;
270
+ analyzedAt: Date;
271
+ riskScore: number;
272
+ riskLevel: 'low' | 'medium' | 'high' | 'critical';
273
+ impactSummary: string;
274
+ affectedModules: string[];
275
+ architectureViolations: Array<{
276
+ rule: string;
277
+ severity: 'warning' | 'error';
278
+ message: string;
279
+ file?: string;
280
+ }>;
281
+ securityIssues: Array<{
282
+ type: string;
283
+ severity: 'low' | 'medium' | 'high' | 'critical';
284
+ message: string;
285
+ file?: string;
286
+ line?: number;
287
+ }>;
288
+ suggestions: string[];
289
+ approved: boolean;
290
+ comment?: string;
291
+ }
292
+ export interface GitHubConnectionResponse {
293
+ success: boolean;
294
+ connection?: {
295
+ id: string;
296
+ username: string;
297
+ avatar: string;
298
+ connectedAt: Date;
299
+ repositories: number;
300
+ };
301
+ error?: string;
302
+ }
303
+ export interface RepositoryListResponse {
304
+ success: boolean;
305
+ repositories?: Array<{
306
+ id: number;
307
+ name: string;
308
+ fullName: string;
309
+ description: string | null;
310
+ private: boolean;
311
+ language: string | null;
312
+ stars: number;
313
+ connected: boolean;
314
+ projectId?: string;
315
+ }>;
316
+ error?: string;
317
+ }
318
+ export interface ConnectRepositoryRequest {
319
+ repositoryId: number;
320
+ autoAnalyze?: boolean;
321
+ analyzePRs?: boolean;
322
+ createProject?: boolean;
323
+ projectName?: string;
324
+ }
325
+ export interface ConnectRepositoryResponse {
326
+ success: boolean;
327
+ repository?: {
328
+ id: string;
329
+ fullName: string;
330
+ projectId?: string;
331
+ webhookActive: boolean;
332
+ };
333
+ error?: string;
334
+ }
335
+ //# sourceMappingURL=github.d.ts.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * GitHub Integration Types for ArchiCore
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=github.js.map
@@ -0,0 +1,265 @@
1
+ /**
2
+ * Основные типы системы ИИ-архитектор
3
+ */
4
+ export interface ASTNode {
5
+ id: string;
6
+ type: string;
7
+ name: string;
8
+ filePath: string;
9
+ startLine: number;
10
+ endLine: number;
11
+ children: ASTNode[];
12
+ metadata: Record<string, unknown>;
13
+ }
14
+ export interface Symbol {
15
+ id: string;
16
+ name: string;
17
+ kind: SymbolKind;
18
+ filePath: string;
19
+ location: Location;
20
+ references: Reference[];
21
+ exports?: boolean;
22
+ imports?: Import[];
23
+ }
24
+ export declare enum SymbolKind {
25
+ Function = "function",
26
+ Class = "class",
27
+ Interface = "interface",
28
+ Variable = "variable",
29
+ Constant = "constant",
30
+ Type = "type",
31
+ Module = "module",
32
+ Namespace = "namespace"
33
+ }
34
+ export interface Location {
35
+ filePath: string;
36
+ startLine: number;
37
+ endLine: number;
38
+ startColumn: number;
39
+ endColumn: number;
40
+ }
41
+ export interface Reference {
42
+ location: Location;
43
+ kind: 'read' | 'write' | 'call' | 'type';
44
+ }
45
+ export interface Import {
46
+ source: string;
47
+ specifiers: string[];
48
+ location: Location;
49
+ }
50
+ export interface DependencyGraph {
51
+ nodes: Map<string, GraphNode>;
52
+ edges: Map<string, GraphEdge[]>;
53
+ }
54
+ export interface GraphNode {
55
+ id: string;
56
+ type: 'file' | 'module' | 'function' | 'class';
57
+ filePath: string;
58
+ name: string;
59
+ metadata: {
60
+ linesOfCode?: number;
61
+ complexity?: number;
62
+ domain?: string;
63
+ };
64
+ }
65
+ export interface GraphEdge {
66
+ from: string;
67
+ to: string;
68
+ type: EdgeType;
69
+ weight: number;
70
+ }
71
+ export declare enum EdgeType {
72
+ Import = "import",
73
+ Call = "call",
74
+ Inheritance = "inheritance",
75
+ Composition = "composition",
76
+ DataFlow = "data_flow"
77
+ }
78
+ export interface SemanticChunk {
79
+ id: string;
80
+ content: string;
81
+ embedding: number[];
82
+ metadata: ChunkMetadata;
83
+ }
84
+ export interface ChunkMetadata {
85
+ filePath: string;
86
+ startLine: number;
87
+ endLine: number;
88
+ type: 'module' | 'function' | 'class' | 'comment' | 'documentation';
89
+ symbols: string[];
90
+ purpose?: string;
91
+ domain?: string;
92
+ tags: string[];
93
+ }
94
+ export interface SemanticSearchResult {
95
+ chunk: SemanticChunk;
96
+ score: number;
97
+ context: string;
98
+ }
99
+ export interface ArchitectureModel {
100
+ boundedContexts: BoundedContext[];
101
+ entities: DomainEntity[];
102
+ rules: ArchitecturalRule[];
103
+ invariants: Invariant[];
104
+ }
105
+ export interface BoundedContext {
106
+ id: string;
107
+ name: string;
108
+ description: string;
109
+ modules: string[];
110
+ dependencies: string[];
111
+ prohibitedDependencies: string[];
112
+ }
113
+ export interface DomainEntity {
114
+ id: string;
115
+ name: string;
116
+ context: string;
117
+ properties: EntityProperty[];
118
+ relationships: EntityRelationship[];
119
+ invariants: string[];
120
+ }
121
+ export interface EntityProperty {
122
+ name: string;
123
+ type: string;
124
+ required: boolean;
125
+ description?: string;
126
+ }
127
+ export interface EntityRelationship {
128
+ target: string;
129
+ type: 'owns' | 'references' | 'aggregates' | 'depends_on';
130
+ cardinality: '1:1' | '1:N' | 'N:M';
131
+ }
132
+ export interface ArchitecturalRule {
133
+ id: string;
134
+ description: string;
135
+ type: 'dependency' | 'naming' | 'structure' | 'pattern';
136
+ severity: 'error' | 'warning' | 'info';
137
+ pattern?: string;
138
+ validator: (context: ValidationContext) => RuleViolation[];
139
+ }
140
+ export interface Invariant {
141
+ id: string;
142
+ description: string;
143
+ expression: string;
144
+ entities: string[];
145
+ }
146
+ export interface ValidationContext {
147
+ graph: DependencyGraph;
148
+ architecture: ArchitectureModel;
149
+ changedFiles: string[];
150
+ }
151
+ export interface RuleViolation {
152
+ rule: string;
153
+ severity: 'error' | 'warning' | 'info';
154
+ message: string;
155
+ location?: Location;
156
+ suggestion?: string;
157
+ }
158
+ export interface ChangeImpact {
159
+ change: Change;
160
+ affectedNodes: AffectedNode[];
161
+ risks: Risk[];
162
+ recommendations: Recommendation[];
163
+ impactGraph: ImpactGraph;
164
+ }
165
+ export interface Change {
166
+ type: 'add' | 'modify' | 'delete' | 'refactor';
167
+ description: string;
168
+ files: string[];
169
+ symbols: string[];
170
+ }
171
+ export interface AffectedNode {
172
+ id: string;
173
+ name: string;
174
+ type: string;
175
+ filePath: string;
176
+ impactLevel: 'critical' | 'high' | 'medium' | 'low';
177
+ reason: string;
178
+ distance: number;
179
+ }
180
+ export interface Risk {
181
+ id: string;
182
+ severity: 'critical' | 'high' | 'medium' | 'low';
183
+ category: 'breaking_change' | 'data_migration' | 'performance' | 'security' | 'compatibility';
184
+ description: string;
185
+ affectedComponents: string[];
186
+ mitigation?: string;
187
+ }
188
+ export interface Recommendation {
189
+ type: 'check' | 'test' | 'refactor' | 'review';
190
+ priority: 'critical' | 'high' | 'medium' | 'low';
191
+ description: string;
192
+ details?: string;
193
+ }
194
+ export interface ImpactGraph {
195
+ nodes: Map<string, ImpactNode>;
196
+ edges: ImpactEdge[];
197
+ }
198
+ export interface ImpactNode {
199
+ id: string;
200
+ name: string;
201
+ impactLevel: 'critical' | 'high' | 'medium' | 'low';
202
+ metadata: Record<string, unknown>;
203
+ }
204
+ export interface ImpactEdge {
205
+ from: string;
206
+ to: string;
207
+ reason: string;
208
+ }
209
+ export interface LLMConfig {
210
+ provider: 'anthropic' | 'openai' | 'deepseek';
211
+ model: string;
212
+ temperature: number;
213
+ maxTokens: number;
214
+ baseURL?: string;
215
+ }
216
+ export interface LLMPrompt {
217
+ system: string;
218
+ user: string;
219
+ context?: LLMContext;
220
+ }
221
+ export interface LLMContext {
222
+ codeIndex?: Partial<DependencyGraph>;
223
+ semanticMemory?: SemanticSearchResult[];
224
+ architecture?: Partial<ArchitectureModel>;
225
+ recentChanges?: Change[];
226
+ language?: 'en' | 'ru';
227
+ }
228
+ export interface LLMResponse {
229
+ content: string;
230
+ metadata: {
231
+ tokensUsed: number;
232
+ model: string;
233
+ timestamp: number;
234
+ };
235
+ }
236
+ export interface RefactoringTask {
237
+ id: string;
238
+ type: RefactoringType;
239
+ description: string;
240
+ targetFiles: string[];
241
+ validation: RefactoringValidation;
242
+ }
243
+ export declare enum RefactoringType {
244
+ ExtractFunction = "extract_function",
245
+ RenameSymbol = "rename_symbol",
246
+ MoveFile = "move_file",
247
+ InlineVariable = "inline_variable",
248
+ ExtractInterface = "extract_interface",
249
+ OptimizeImports = "optimize_imports"
250
+ }
251
+ export interface RefactoringValidation {
252
+ preservesBehavior: boolean;
253
+ testsPass: boolean;
254
+ noBreakingChanges: boolean;
255
+ violations: RuleViolation[];
256
+ }
257
+ export interface DocumentationNode {
258
+ id: string;
259
+ type: 'architecture' | 'module' | 'flow' | 'decision';
260
+ title: string;
261
+ content: string;
262
+ linkedCode: string[];
263
+ updatedAt: number;
264
+ }
265
+ //# sourceMappingURL=index.d.ts.map