codeflow-hook 2.1.0 → 2.2.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.
- package/bin/codeflow-hook.js +232 -164
- package/lib/ai-reviewer.cjs +422 -0
- package/lib/cli-integration/src/index.ts +133 -220
- package/lib/cli-integration/src/simulationEngine.ts +118 -4
- package/package.json +2 -2
- package/lib/cli-integration/dist/index.d.ts +0 -128
- package/lib/cli-integration/dist/index.js +0 -585
- package/lib/cli-integration/dist/pipelineConfigs.d.ts +0 -60
- package/lib/cli-integration/dist/pipelineConfigs.js +0 -549
- package/lib/cli-integration/dist/simulationEngine.d.ts +0 -86
- package/lib/cli-integration/dist/simulationEngine.js +0 -475
- package/lib/cli-integration/dist/types.d.ts +0 -156
- package/lib/cli-integration/dist/types.js +0 -15
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* CLI Integration Service - Phase 4
|
|
4
|
-
*
|
|
5
|
-
* Bridges the local CLI commands with EKG backend services.
|
|
6
|
-
* Transforms CLI operations from local processing to backend-driven workflows.
|
|
7
|
-
*
|
|
8
|
-
* Key transformations:
|
|
9
|
-
* - `codeflow index` → EKG Ingestion Service webhook simulation
|
|
10
|
-
* - `codeflow analyze-diff` → EKG Query Service context-enhanced analysis
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* CLI Integration Service
|
|
14
|
-
* Provides methods that CLI commands can call to interact with EKG backend
|
|
15
|
-
*/
|
|
16
|
-
export declare class CLIIntegrationService {
|
|
17
|
-
private config;
|
|
18
|
-
private git;
|
|
19
|
-
constructor();
|
|
20
|
-
/**
|
|
21
|
-
* Index repository for EKG - equivalent to `codeflow index`
|
|
22
|
-
*
|
|
23
|
-
* Sends repository URL to EKG Ingestion Service for analysis and graph population
|
|
24
|
-
*/
|
|
25
|
-
indexRepository(options?: {
|
|
26
|
-
repositoryUrl?: string;
|
|
27
|
-
dryRun?: boolean;
|
|
28
|
-
}): Promise<{
|
|
29
|
-
success: boolean;
|
|
30
|
-
repositoryId?: string;
|
|
31
|
-
message: string;
|
|
32
|
-
stats?: {
|
|
33
|
-
indexedFiles: number;
|
|
34
|
-
analysisTime: number;
|
|
35
|
-
webhookAccepted: boolean;
|
|
36
|
-
};
|
|
37
|
-
}>;
|
|
38
|
-
/**
|
|
39
|
-
* Analyze code diff with EKG context enhancement
|
|
40
|
-
*
|
|
41
|
-
* Sends diff to Query Service for EKG-enhanced analysis instead of local RAG
|
|
42
|
-
*/
|
|
43
|
-
analyzeDiff(diffContent: string, options?: {
|
|
44
|
-
legacy?: boolean;
|
|
45
|
-
outputFormat?: 'console' | 'json';
|
|
46
|
-
}): Promise<{
|
|
47
|
-
success: boolean;
|
|
48
|
-
analysis: any;
|
|
49
|
-
message: string;
|
|
50
|
-
stats?: {
|
|
51
|
-
ekg_queries: number;
|
|
52
|
-
similar_repos_found: number;
|
|
53
|
-
analysis_time: number;
|
|
54
|
-
};
|
|
55
|
-
}>;
|
|
56
|
-
/**
|
|
57
|
-
* Analyze diff content and extract structured information
|
|
58
|
-
*/
|
|
59
|
-
private analyzeDiffContent;
|
|
60
|
-
/**
|
|
61
|
-
* Query EKG for context on affected files
|
|
62
|
-
*/
|
|
63
|
-
private getEKGContext;
|
|
64
|
-
/**
|
|
65
|
-
* Generate enhanced analysis using EKG context
|
|
66
|
-
*/
|
|
67
|
-
private generateEKGEnhancedAnalysis;
|
|
68
|
-
/**
|
|
69
|
-
* Get current repository information
|
|
70
|
-
*/
|
|
71
|
-
private getRepositoryInfo;
|
|
72
|
-
/**
|
|
73
|
-
* Get list of files that would be indexed
|
|
74
|
-
*/
|
|
75
|
-
private getIndexableFiles;
|
|
76
|
-
/**
|
|
77
|
-
* Make HTTP request to backend service with retry logic
|
|
78
|
-
*/
|
|
79
|
-
private makeBackendRequest;
|
|
80
|
-
/**
|
|
81
|
-
* Make GraphQL request to Query Service
|
|
82
|
-
*/
|
|
83
|
-
private makeGraphQLRequest;
|
|
84
|
-
/**
|
|
85
|
-
* Generate repository ID (similar to ingestion service)
|
|
86
|
-
*/
|
|
87
|
-
private generateRepositoryId;
|
|
88
|
-
/**
|
|
89
|
-
* Get current user information
|
|
90
|
-
*/
|
|
91
|
-
private getCurrentUser;
|
|
92
|
-
/**
|
|
93
|
-
* Detect language from file extension
|
|
94
|
-
*/
|
|
95
|
-
private detectLanguage;
|
|
96
|
-
/**
|
|
97
|
-
* Format error for logging and display
|
|
98
|
-
*/
|
|
99
|
-
private formatError;
|
|
100
|
-
}
|
|
101
|
-
export declare const cliIntegrationService: CLIIntegrationService;
|
|
102
|
-
export declare const indexProject: (options?: {
|
|
103
|
-
repositoryUrl?: string;
|
|
104
|
-
dryRun?: boolean;
|
|
105
|
-
}) => Promise<{
|
|
106
|
-
success: boolean;
|
|
107
|
-
repositoryId?: string;
|
|
108
|
-
message: string;
|
|
109
|
-
stats?: {
|
|
110
|
-
indexedFiles: number;
|
|
111
|
-
analysisTime: number;
|
|
112
|
-
webhookAccepted: boolean;
|
|
113
|
-
};
|
|
114
|
-
}>;
|
|
115
|
-
export declare const analyzeDiff: (diffContent: string, options?: {
|
|
116
|
-
legacy?: boolean;
|
|
117
|
-
outputFormat?: 'console' | 'json';
|
|
118
|
-
}) => Promise<{
|
|
119
|
-
success: boolean;
|
|
120
|
-
analysis: any;
|
|
121
|
-
message: string;
|
|
122
|
-
stats?: {
|
|
123
|
-
ekg_queries: number;
|
|
124
|
-
similar_repos_found: number;
|
|
125
|
-
analysis_time: number;
|
|
126
|
-
};
|
|
127
|
-
}>;
|
|
128
|
-
export default cliIntegrationService;
|