@probelabs/visor 0.1.20 → 0.1.21
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/dist/action-cli-bridge.d.ts +0 -1
- package/dist/action-cli-bridge.d.ts.map +1 -1
- package/dist/ai-review-service.d.ts +0 -1
- package/dist/ai-review-service.d.ts.map +1 -1
- package/dist/check-execution-engine.d.ts +0 -1
- package/dist/check-execution-engine.d.ts.map +1 -1
- package/dist/cli-main.d.ts +0 -2
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands.d.ts +0 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/dependency-resolver.d.ts +0 -1
- package/dist/dependency-resolver.d.ts.map +1 -1
- package/dist/event-mapper.d.ts +0 -1
- package/dist/event-mapper.d.ts.map +1 -1
- package/dist/failure-condition-evaluator.d.ts +0 -1
- package/dist/failure-condition-evaluator.d.ts.map +1 -1
- package/dist/git-repository-analyzer.d.ts +0 -1
- package/dist/git-repository-analyzer.d.ts.map +1 -1
- package/dist/github-check-service.d.ts +0 -1
- package/dist/github-check-service.d.ts.map +1 -1
- package/dist/github-comments.d.ts +0 -1
- package/dist/github-comments.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +127704 -805
- package/dist/output-formatters.d.ts +0 -1
- package/dist/output-formatters.d.ts.map +1 -1
- package/dist/pr-analyzer.d.ts +0 -1
- package/dist/pr-analyzer.d.ts.map +1 -1
- package/dist/pr-detector.d.ts +0 -1
- package/dist/pr-detector.d.ts.map +1 -1
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/check-provider-registry.d.ts.map +1 -1
- package/dist/providers/check-provider.interface.d.ts.map +1 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/noop-check-provider.d.ts.map +1 -1
- package/dist/providers/tool-check-provider.d.ts.map +1 -1
- package/dist/providers/webhook-check-provider.d.ts.map +1 -1
- package/dist/reviewer.d.ts +0 -1
- package/dist/reviewer.d.ts.map +1 -1
- package/dist/session-registry.d.ts +0 -1
- package/dist/session-registry.d.ts.map +1 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/env-resolver.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/action-cli-bridge.js +0 -387
- package/dist/action-cli-bridge.js.map +0 -1
- package/dist/ai-review-service.js +0 -854
- package/dist/ai-review-service.js.map +0 -1
- package/dist/check-execution-engine.js +0 -1720
- package/dist/check-execution-engine.js.map +0 -1
- package/dist/cli-main.js +0 -249
- package/dist/cli-main.js.map +0 -1
- package/dist/cli.js +0 -241
- package/dist/cli.js.map +0 -1
- package/dist/commands.js +0 -53
- package/dist/commands.js.map +0 -1
- package/dist/config.js +0 -437
- package/dist/config.js.map +0 -1
- package/dist/dependency-resolver.js +0 -163
- package/dist/dependency-resolver.js.map +0 -1
- package/dist/event-mapper.js +0 -316
- package/dist/event-mapper.js.map +0 -1
- package/dist/failure-condition-evaluator.js +0 -481
- package/dist/failure-condition-evaluator.js.map +0 -1
- package/dist/git-repository-analyzer.js +0 -285
- package/dist/git-repository-analyzer.js.map +0 -1
- package/dist/github-check-service.js +0 -369
- package/dist/github-check-service.js.map +0 -1
- package/dist/github-comments.js +0 -289
- package/dist/github-comments.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/output-formatters.js +0 -624
- package/dist/output-formatters.js.map +0 -1
- package/dist/pr-analyzer.js +0 -195
- package/dist/pr-analyzer.js.map +0 -1
- package/dist/pr-detector.js +0 -357
- package/dist/pr-detector.js.map +0 -1
- package/dist/providers/ai-check-provider.js +0 -437
- package/dist/providers/ai-check-provider.js.map +0 -1
- package/dist/providers/check-provider-registry.js +0 -138
- package/dist/providers/check-provider-registry.js.map +0 -1
- package/dist/providers/check-provider.interface.js +0 -11
- package/dist/providers/check-provider.interface.js.map +0 -1
- package/dist/providers/index.js +0 -19
- package/dist/providers/index.js.map +0 -1
- package/dist/providers/noop-check-provider.js +0 -55
- package/dist/providers/noop-check-provider.js.map +0 -1
- package/dist/providers/tool-check-provider.js +0 -174
- package/dist/providers/tool-check-provider.js.map +0 -1
- package/dist/providers/webhook-check-provider.js +0 -173
- package/dist/providers/webhook-check-provider.js.map +0 -1
- package/dist/reviewer.js +0 -260
- package/dist/reviewer.js.map +0 -1
- package/dist/session-registry.js +0 -67
- package/dist/session-registry.js.map +0 -1
- package/dist/types/cli.js +0 -3
- package/dist/types/cli.js.map +0 -1
- package/dist/types/config.js +0 -6
- package/dist/types/config.js.map +0 -1
- package/dist/utils/env-resolver.js +0 -130
- package/dist/utils/env-resolver.js.map +0 -1
|
@@ -1,437 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AICheckProvider = void 0;
|
|
7
|
-
const check_provider_interface_1 = require("./check-provider.interface");
|
|
8
|
-
const ai_review_service_1 = require("../ai-review-service");
|
|
9
|
-
const env_resolver_1 = require("../utils/env-resolver");
|
|
10
|
-
const liquidjs_1 = require("liquidjs");
|
|
11
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
12
|
-
const path_1 = __importDefault(require("path"));
|
|
13
|
-
/**
|
|
14
|
-
* AI-powered check provider using probe agent
|
|
15
|
-
*/
|
|
16
|
-
class AICheckProvider extends check_provider_interface_1.CheckProvider {
|
|
17
|
-
aiReviewService;
|
|
18
|
-
liquidEngine;
|
|
19
|
-
constructor() {
|
|
20
|
-
super();
|
|
21
|
-
this.aiReviewService = new ai_review_service_1.AIReviewService();
|
|
22
|
-
this.liquidEngine = new liquidjs_1.Liquid();
|
|
23
|
-
}
|
|
24
|
-
getName() {
|
|
25
|
-
return 'ai';
|
|
26
|
-
}
|
|
27
|
-
getDescription() {
|
|
28
|
-
return 'AI-powered code review using Google Gemini, Anthropic Claude, or OpenAI GPT models';
|
|
29
|
-
}
|
|
30
|
-
async validateConfig(config) {
|
|
31
|
-
if (!config || typeof config !== 'object') {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
const cfg = config;
|
|
35
|
-
// Type must be 'ai'
|
|
36
|
-
if (cfg.type !== 'ai') {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
// Check for prompt or focus
|
|
40
|
-
const prompt = cfg.prompt || cfg.focus;
|
|
41
|
-
if (typeof prompt !== 'string') {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
// Validate focus if specified
|
|
45
|
-
if (cfg.focus && !['security', 'performance', 'style', 'all'].includes(cfg.focus)) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
// Validate AI provider config if present
|
|
49
|
-
if (cfg.ai) {
|
|
50
|
-
if (cfg.ai.provider &&
|
|
51
|
-
!['google', 'anthropic', 'openai', 'mock'].includes(cfg.ai.provider)) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Group files by their file extension for template context
|
|
59
|
-
*/
|
|
60
|
-
groupFilesByExtension(files) {
|
|
61
|
-
const grouped = {};
|
|
62
|
-
files.forEach(file => {
|
|
63
|
-
const parts = file.filename.split('.');
|
|
64
|
-
const ext = parts.length > 1 ? parts.pop()?.toLowerCase() || 'noext' : 'noext';
|
|
65
|
-
if (!grouped[ext]) {
|
|
66
|
-
grouped[ext] = [];
|
|
67
|
-
}
|
|
68
|
-
grouped[ext].push(file);
|
|
69
|
-
});
|
|
70
|
-
return grouped;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Process prompt configuration to resolve final prompt string
|
|
74
|
-
*/
|
|
75
|
-
async processPrompt(promptConfig, prInfo, eventContext, dependencyResults) {
|
|
76
|
-
let promptContent;
|
|
77
|
-
// Auto-detect if it's a file path or inline content
|
|
78
|
-
if (await this.isFilePath(promptConfig)) {
|
|
79
|
-
promptContent = await this.loadPromptFromFile(promptConfig);
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
promptContent = promptConfig;
|
|
83
|
-
}
|
|
84
|
-
// Process Liquid templates in the prompt
|
|
85
|
-
return await this.renderPromptTemplate(promptContent, prInfo, eventContext, dependencyResults);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Detect if a string is likely a file path and if the file exists
|
|
89
|
-
*/
|
|
90
|
-
async isFilePath(str) {
|
|
91
|
-
// Quick checks to exclude obvious non-file-path content
|
|
92
|
-
if (!str || str.trim() !== str || str.length > 512) {
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
// Exclude strings that are clearly content (contain common content indicators)
|
|
96
|
-
// But be more careful with paths that might contain common words as directory names
|
|
97
|
-
if (/\s{2,}/.test(str) || // Multiple consecutive spaces
|
|
98
|
-
/\n/.test(str) || // Contains newlines
|
|
99
|
-
/^(please|analyze|review|check|find|identify|look|search)/i.test(str.trim()) || // Starts with command words
|
|
100
|
-
str.split(' ').length > 8 // Too many words for a typical file path
|
|
101
|
-
) {
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
// For strings with path separators, be more lenient about common words
|
|
105
|
-
// as they might be legitimate directory names
|
|
106
|
-
if (!/[\/\\]/.test(str)) {
|
|
107
|
-
// Only apply strict English word filter to non-path strings
|
|
108
|
-
if (/\b(the|and|or|but|for|with|by|from|in|on|at|as)\b/i.test(str)) {
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
// Positive indicators for file paths
|
|
113
|
-
const hasFileExtension = /\.[a-zA-Z0-9]{1,10}$/i.test(str);
|
|
114
|
-
const hasPathSeparators = /[\/\\]/.test(str);
|
|
115
|
-
const isRelativePath = /^\.{1,2}\//.test(str);
|
|
116
|
-
const isAbsolutePath = path_1.default.isAbsolute(str);
|
|
117
|
-
const hasTypicalFileChars = /^[a-zA-Z0-9._\-\/\\:~]+$/.test(str);
|
|
118
|
-
// Must have at least one strong indicator
|
|
119
|
-
if (!(hasFileExtension || isRelativePath || isAbsolutePath || hasPathSeparators)) {
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
// Must contain only typical file path characters
|
|
123
|
-
if (!hasTypicalFileChars) {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
// Additional validation for suspected file paths
|
|
127
|
-
try {
|
|
128
|
-
// Try to resolve and check if file exists
|
|
129
|
-
let resolvedPath;
|
|
130
|
-
if (path_1.default.isAbsolute(str)) {
|
|
131
|
-
resolvedPath = path_1.default.normalize(str);
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
// Resolve relative to current working directory
|
|
135
|
-
resolvedPath = path_1.default.resolve(process.cwd(), str);
|
|
136
|
-
}
|
|
137
|
-
// Check if file exists
|
|
138
|
-
const fs = require('fs').promises;
|
|
139
|
-
try {
|
|
140
|
-
const stat = await fs.stat(resolvedPath);
|
|
141
|
-
return stat.isFile();
|
|
142
|
-
}
|
|
143
|
-
catch {
|
|
144
|
-
// File doesn't exist, but might still be a valid file path format
|
|
145
|
-
// Return true if it has strong file path indicators
|
|
146
|
-
return hasFileExtension && (isRelativePath || isAbsolutePath || hasPathSeparators);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
catch {
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Load prompt content from file with security validation
|
|
155
|
-
*/
|
|
156
|
-
async loadPromptFromFile(promptPath) {
|
|
157
|
-
// Enforce .liquid file extension for all prompt files
|
|
158
|
-
if (!promptPath.endsWith('.liquid')) {
|
|
159
|
-
throw new Error('Prompt file must have .liquid extension');
|
|
160
|
-
}
|
|
161
|
-
let resolvedPath;
|
|
162
|
-
if (path_1.default.isAbsolute(promptPath)) {
|
|
163
|
-
// Absolute path - use as-is
|
|
164
|
-
resolvedPath = promptPath;
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
// Relative path - resolve relative to current working directory
|
|
168
|
-
resolvedPath = path_1.default.resolve(process.cwd(), promptPath);
|
|
169
|
-
}
|
|
170
|
-
// Security: For relative paths, ensure they don't escape the current directory
|
|
171
|
-
if (!path_1.default.isAbsolute(promptPath)) {
|
|
172
|
-
const normalizedPath = path_1.default.normalize(resolvedPath);
|
|
173
|
-
const currentDir = path_1.default.resolve(process.cwd());
|
|
174
|
-
if (!normalizedPath.startsWith(currentDir)) {
|
|
175
|
-
throw new Error('Invalid prompt file path: path traversal detected');
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
// Security: Check for obvious path traversal patterns
|
|
179
|
-
if (promptPath.includes('../..')) {
|
|
180
|
-
throw new Error('Invalid prompt file path: path traversal detected');
|
|
181
|
-
}
|
|
182
|
-
try {
|
|
183
|
-
const promptContent = await promises_1.default.readFile(resolvedPath, 'utf-8');
|
|
184
|
-
return promptContent;
|
|
185
|
-
}
|
|
186
|
-
catch (error) {
|
|
187
|
-
throw new Error(`Failed to load prompt from ${resolvedPath}: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Render Liquid template in prompt with comprehensive event context
|
|
192
|
-
*/
|
|
193
|
-
async renderPromptTemplate(promptContent, prInfo, eventContext, dependencyResults) {
|
|
194
|
-
// Create comprehensive template context with PR and event information
|
|
195
|
-
const templateContext = {
|
|
196
|
-
// PR Information
|
|
197
|
-
pr: {
|
|
198
|
-
number: prInfo.number,
|
|
199
|
-
title: prInfo.title,
|
|
200
|
-
body: prInfo.body,
|
|
201
|
-
author: prInfo.author,
|
|
202
|
-
baseBranch: prInfo.base,
|
|
203
|
-
headBranch: prInfo.head,
|
|
204
|
-
isIncremental: prInfo.isIncremental,
|
|
205
|
-
filesChanged: prInfo.files?.map(f => f.filename) || [],
|
|
206
|
-
totalAdditions: prInfo.files?.reduce((sum, f) => sum + f.additions, 0) || 0,
|
|
207
|
-
totalDeletions: prInfo.files?.reduce((sum, f) => sum + f.deletions, 0) || 0,
|
|
208
|
-
totalChanges: prInfo.files?.reduce((sum, f) => sum + f.changes, 0) || 0,
|
|
209
|
-
base: prInfo.base,
|
|
210
|
-
head: prInfo.head,
|
|
211
|
-
},
|
|
212
|
-
// File Details
|
|
213
|
-
files: prInfo.files || [],
|
|
214
|
-
description: prInfo.body || '',
|
|
215
|
-
// GitHub Event Context
|
|
216
|
-
event: eventContext
|
|
217
|
-
? {
|
|
218
|
-
name: eventContext.event_name || 'unknown',
|
|
219
|
-
action: eventContext.action,
|
|
220
|
-
// Repository Info
|
|
221
|
-
repository: eventContext.repository
|
|
222
|
-
? {
|
|
223
|
-
owner: eventContext.repository?.owner?.login,
|
|
224
|
-
name: eventContext.repository?.name,
|
|
225
|
-
fullName: eventContext.repository
|
|
226
|
-
? `${eventContext.repository?.owner?.login}/${eventContext.repository?.name}`
|
|
227
|
-
: undefined,
|
|
228
|
-
}
|
|
229
|
-
: undefined,
|
|
230
|
-
// Comment Data (for comment events)
|
|
231
|
-
comment: eventContext.comment
|
|
232
|
-
? {
|
|
233
|
-
body: eventContext.comment?.body,
|
|
234
|
-
author: eventContext.comment?.user?.login,
|
|
235
|
-
}
|
|
236
|
-
: undefined,
|
|
237
|
-
// Issue Data (for issue events)
|
|
238
|
-
issue: eventContext.issue
|
|
239
|
-
? {
|
|
240
|
-
number: eventContext.issue?.number,
|
|
241
|
-
title: eventContext.issue?.title,
|
|
242
|
-
body: eventContext.issue?.body,
|
|
243
|
-
state: eventContext.issue?.state,
|
|
244
|
-
author: eventContext.issue?.user?.login,
|
|
245
|
-
labels: eventContext.issue?.labels || [],
|
|
246
|
-
assignees: eventContext?.issue?.assignees?.map(a => a.login) || [],
|
|
247
|
-
createdAt: eventContext.issue?.created_at,
|
|
248
|
-
updatedAt: eventContext.issue?.updated_at,
|
|
249
|
-
isPullRequest: !!eventContext.issue?.pull_request,
|
|
250
|
-
}
|
|
251
|
-
: undefined,
|
|
252
|
-
// Pull Request Event Data
|
|
253
|
-
pullRequest: eventContext.pull_request
|
|
254
|
-
? {
|
|
255
|
-
number: eventContext.pull_request?.number,
|
|
256
|
-
state: eventContext.pull_request?.state,
|
|
257
|
-
draft: eventContext.pull_request?.draft,
|
|
258
|
-
headSha: eventContext.pull_request?.head?.sha,
|
|
259
|
-
headRef: eventContext.pull_request?.head?.ref,
|
|
260
|
-
baseSha: eventContext.pull_request?.base?.sha,
|
|
261
|
-
baseRef: eventContext.pull_request?.base?.ref,
|
|
262
|
-
}
|
|
263
|
-
: undefined,
|
|
264
|
-
// Raw event payload for advanced use cases
|
|
265
|
-
payload: eventContext,
|
|
266
|
-
}
|
|
267
|
-
: undefined,
|
|
268
|
-
// Utility data for templates
|
|
269
|
-
utils: {
|
|
270
|
-
// Date/time helpers
|
|
271
|
-
now: new Date().toISOString(),
|
|
272
|
-
today: new Date().toISOString().split('T')[0],
|
|
273
|
-
// Dynamic file grouping by extension
|
|
274
|
-
filesByExtension: this.groupFilesByExtension(prInfo.files || []),
|
|
275
|
-
// File status categorizations
|
|
276
|
-
addedFiles: (prInfo.files || []).filter(f => f.status === 'added'),
|
|
277
|
-
modifiedFiles: (prInfo.files || []).filter(f => f.status === 'modified'),
|
|
278
|
-
removedFiles: (prInfo.files || []).filter(f => f.status === 'removed'),
|
|
279
|
-
renamedFiles: (prInfo.files || []).filter(f => f.status === 'renamed'),
|
|
280
|
-
// Change analysis
|
|
281
|
-
hasLargeChanges: (prInfo.files || []).some(f => f.changes > 50),
|
|
282
|
-
totalFiles: (prInfo.files || []).length,
|
|
283
|
-
},
|
|
284
|
-
// Previous check outputs (dependency results)
|
|
285
|
-
outputs: dependencyResults
|
|
286
|
-
? Object.fromEntries(Array.from(dependencyResults.entries()).map(([checkName, result]) => [
|
|
287
|
-
checkName,
|
|
288
|
-
{
|
|
289
|
-
// Summary data
|
|
290
|
-
totalIssues: result.issues?.length || 0,
|
|
291
|
-
criticalIssues: result.issues?.filter(i => i.severity === 'critical').length || 0,
|
|
292
|
-
errorIssues: result.issues?.filter(i => i.severity === 'error').length || 0,
|
|
293
|
-
warningIssues: result.issues?.filter(i => i.severity === 'warning').length || 0,
|
|
294
|
-
infoIssues: result.issues?.filter(i => i.severity === 'info').length || 0,
|
|
295
|
-
// Issues grouped by category
|
|
296
|
-
securityIssues: result.issues?.filter(i => i.category === 'security') || [],
|
|
297
|
-
performanceIssues: result.issues?.filter(i => i.category === 'performance') || [],
|
|
298
|
-
styleIssues: result.issues?.filter(i => i.category === 'style') || [],
|
|
299
|
-
logicIssues: result.issues?.filter(i => i.category === 'logic') || [],
|
|
300
|
-
documentationIssues: result.issues?.filter(i => i.category === 'documentation') || [],
|
|
301
|
-
// All issues and suggestions
|
|
302
|
-
issues: result.issues || [],
|
|
303
|
-
suggestions: result.suggestions || [],
|
|
304
|
-
// Debug information if available
|
|
305
|
-
debug: result.debug,
|
|
306
|
-
// Raw data for advanced use
|
|
307
|
-
raw: result,
|
|
308
|
-
},
|
|
309
|
-
]))
|
|
310
|
-
: {},
|
|
311
|
-
};
|
|
312
|
-
try {
|
|
313
|
-
return await this.liquidEngine.parseAndRender(promptContent, templateContext);
|
|
314
|
-
}
|
|
315
|
-
catch (error) {
|
|
316
|
-
throw new Error(`Failed to render prompt template: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
async execute(prInfo, config, _dependencyResults, sessionInfo) {
|
|
320
|
-
// Apply environment configuration if present
|
|
321
|
-
if (config.env) {
|
|
322
|
-
const result = env_resolver_1.EnvironmentResolver.withTemporaryEnv(config.env, () => {
|
|
323
|
-
// This will be executed with the temporary environment
|
|
324
|
-
return this.executeWithConfig(prInfo, config, _dependencyResults, sessionInfo);
|
|
325
|
-
});
|
|
326
|
-
if (result instanceof Promise) {
|
|
327
|
-
return result;
|
|
328
|
-
}
|
|
329
|
-
return result;
|
|
330
|
-
}
|
|
331
|
-
return this.executeWithConfig(prInfo, config, _dependencyResults, sessionInfo);
|
|
332
|
-
}
|
|
333
|
-
async executeWithConfig(prInfo, config, _dependencyResults, sessionInfo) {
|
|
334
|
-
// Extract AI configuration - only set properties that are explicitly provided
|
|
335
|
-
const aiConfig = {};
|
|
336
|
-
// Check-level AI configuration (ai object)
|
|
337
|
-
if (config.ai) {
|
|
338
|
-
// Only set properties that are actually defined to avoid overriding env vars
|
|
339
|
-
if (config.ai.apiKey !== undefined) {
|
|
340
|
-
aiConfig.apiKey = config.ai.apiKey;
|
|
341
|
-
}
|
|
342
|
-
if (config.ai.model !== undefined) {
|
|
343
|
-
aiConfig.model = config.ai.model;
|
|
344
|
-
}
|
|
345
|
-
if (config.ai.timeout !== undefined) {
|
|
346
|
-
aiConfig.timeout = config.ai.timeout;
|
|
347
|
-
}
|
|
348
|
-
if (config.ai.provider !== undefined) {
|
|
349
|
-
aiConfig.provider = config.ai.provider;
|
|
350
|
-
}
|
|
351
|
-
if (config.ai.debug !== undefined) {
|
|
352
|
-
aiConfig.debug = config.ai.debug;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
// Check-level AI model and provider (top-level properties)
|
|
356
|
-
if (config.ai_model !== undefined) {
|
|
357
|
-
aiConfig.model = config.ai_model;
|
|
358
|
-
}
|
|
359
|
-
if (config.ai_provider !== undefined) {
|
|
360
|
-
aiConfig.provider = config.ai_provider;
|
|
361
|
-
}
|
|
362
|
-
// Get custom prompt from config - REQUIRED, no fallbacks
|
|
363
|
-
const customPrompt = config.prompt;
|
|
364
|
-
if (!customPrompt) {
|
|
365
|
-
throw new Error(`No prompt defined for check. All checks must have prompts defined in .visor.yaml configuration.`);
|
|
366
|
-
}
|
|
367
|
-
// Process prompt with Liquid templates and file loading
|
|
368
|
-
const processedPrompt = await this.processPrompt(customPrompt, prInfo, config.eventContext, _dependencyResults);
|
|
369
|
-
// Create AI service with config - environment variables will be used if aiConfig is empty
|
|
370
|
-
const service = new ai_review_service_1.AIReviewService(aiConfig);
|
|
371
|
-
console.error(`🔧 Debug: AICheckProvider using processed prompt: ${processedPrompt.substring(0, 100)}...`);
|
|
372
|
-
// Pass the custom prompt and schema - no fallbacks
|
|
373
|
-
const schema = config.schema;
|
|
374
|
-
console.error(`🔧 Debug: AICheckProvider schema from config: ${JSON.stringify(schema)}`);
|
|
375
|
-
console.error(`🔧 Debug: AICheckProvider full config: ${JSON.stringify(config, null, 2)}`);
|
|
376
|
-
try {
|
|
377
|
-
console.error(`🔧 Debug: AICheckProvider passing checkName: ${config.checkName} to service`);
|
|
378
|
-
// Check if we should use session reuse
|
|
379
|
-
if (sessionInfo?.reuseSession && sessionInfo.parentSessionId) {
|
|
380
|
-
console.error(`🔄 Debug: Using session reuse with parent session: ${sessionInfo.parentSessionId}`);
|
|
381
|
-
return await service.executeReviewWithSessionReuse(prInfo, processedPrompt, sessionInfo.parentSessionId, schema, config.checkName);
|
|
382
|
-
}
|
|
383
|
-
else {
|
|
384
|
-
console.error(`🆕 Debug: Creating new AI session for check: ${config.checkName}`);
|
|
385
|
-
return await service.executeReview(prInfo, processedPrompt, schema, config.checkName, config.sessionId);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
catch (error) {
|
|
389
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
390
|
-
// Log detailed error information
|
|
391
|
-
console.error(`❌ AI Check Provider Error for check: ${errorMessage}`);
|
|
392
|
-
// Check if this is a critical error (authentication, rate limits, etc)
|
|
393
|
-
const isCriticalError = errorMessage.includes('API rate limit') ||
|
|
394
|
-
errorMessage.includes('403') ||
|
|
395
|
-
errorMessage.includes('401') ||
|
|
396
|
-
errorMessage.includes('authentication') ||
|
|
397
|
-
errorMessage.includes('API key');
|
|
398
|
-
if (isCriticalError) {
|
|
399
|
-
console.error(`🚨 CRITICAL ERROR: AI provider authentication or rate limit issue detected`);
|
|
400
|
-
console.error(`🚨 This check cannot proceed without valid API credentials`);
|
|
401
|
-
}
|
|
402
|
-
// Re-throw with more context
|
|
403
|
-
throw new Error(`AI analysis failed: ${errorMessage}`);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
getSupportedConfigKeys() {
|
|
407
|
-
return [
|
|
408
|
-
'type',
|
|
409
|
-
'prompt',
|
|
410
|
-
'focus',
|
|
411
|
-
'schema',
|
|
412
|
-
'group',
|
|
413
|
-
'ai.provider',
|
|
414
|
-
'ai.model',
|
|
415
|
-
'ai.apiKey',
|
|
416
|
-
'ai.timeout',
|
|
417
|
-
'ai_model',
|
|
418
|
-
'ai_provider',
|
|
419
|
-
'env',
|
|
420
|
-
];
|
|
421
|
-
}
|
|
422
|
-
async isAvailable() {
|
|
423
|
-
// Check if any AI API key is available
|
|
424
|
-
return !!(process.env.GOOGLE_API_KEY ||
|
|
425
|
-
process.env.ANTHROPIC_API_KEY ||
|
|
426
|
-
process.env.OPENAI_API_KEY);
|
|
427
|
-
}
|
|
428
|
-
getRequirements() {
|
|
429
|
-
return [
|
|
430
|
-
'At least one of: GOOGLE_API_KEY, ANTHROPIC_API_KEY, or OPENAI_API_KEY',
|
|
431
|
-
'Optional: MODEL_NAME environment variable',
|
|
432
|
-
'Network access to AI provider APIs',
|
|
433
|
-
];
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
exports.AICheckProvider = AICheckProvider;
|
|
437
|
-
//# sourceMappingURL=ai-check-provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-check-provider.js","sourceRoot":"","sources":["../../src/providers/ai-check-provider.ts"],"names":[],"mappings":";;;;;;AAAA,yEAAgF;AAGhF,4DAAuE;AACvE,wDAA4D;AAC5D,uCAAkC;AAClC,2DAA6B;AAC7B,gDAAwB;AAExB;;GAEG;AACH,MAAa,eAAgB,SAAQ,wCAAa;IACxC,eA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,4EAA4E,CAAC,CAAC;gBAC5F,OAAO,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;YAC9E,CAAC;YAED,6BAA6B;YAC7B,MAAM,IAAI,KAAK,CAAC,uBAAuB,YAAY,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IAED,sBAAsB;QACpB,OAAO;YACL,MAAM;YACN,QAAQ;YACR,OAAO;YACP,QAAQ;YACR,OAAO;YACP,aAAa;YACb,UAAU;YACV,WAAW;YACX,YAAY;YACZ,UAAU;YACV,aAAa;YACb,KAAK;SACN,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,WAAW;QACf,uCAAuC;QACvC,OAAO,CAAC,CAAC,CACP,OAAO,CAAC,GAAG,CAAC,cAAc;YAC1B,OAAO,CAAC,GAAG,CAAC,iBAAiB;YAC7B,OAAO,CAAC,GAAG,CAAC,cAAc,CAC3B,CAAC;IACJ,CAAC;IAED,eAAe;QACb,OAAO;YACL,uEAAuE;YACvE,2CAA2C;YAC3C,oCAAoC;SACrC,CAAC;IACJ,CAAC;CACF;AAjiBD,0CAiiBC"}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CheckProviderRegistry = void 0;
|
|
4
|
-
const ai_check_provider_1 = require("./ai-check-provider");
|
|
5
|
-
const tool_check_provider_1 = require("./tool-check-provider");
|
|
6
|
-
const webhook_check_provider_1 = require("./webhook-check-provider");
|
|
7
|
-
const noop_check_provider_1 = require("./noop-check-provider");
|
|
8
|
-
/**
|
|
9
|
-
* Registry for managing check providers
|
|
10
|
-
*/
|
|
11
|
-
class CheckProviderRegistry {
|
|
12
|
-
providers = new Map();
|
|
13
|
-
static instance;
|
|
14
|
-
constructor() {
|
|
15
|
-
// Register default providers
|
|
16
|
-
this.registerDefaultProviders();
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Get singleton instance
|
|
20
|
-
*/
|
|
21
|
-
static getInstance() {
|
|
22
|
-
if (!CheckProviderRegistry.instance) {
|
|
23
|
-
CheckProviderRegistry.instance = new CheckProviderRegistry();
|
|
24
|
-
}
|
|
25
|
-
return CheckProviderRegistry.instance;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Register default built-in providers
|
|
29
|
-
*/
|
|
30
|
-
registerDefaultProviders() {
|
|
31
|
-
// Register all built-in providers
|
|
32
|
-
this.register(new ai_check_provider_1.AICheckProvider());
|
|
33
|
-
this.register(new tool_check_provider_1.ToolCheckProvider());
|
|
34
|
-
this.register(new webhook_check_provider_1.WebhookCheckProvider());
|
|
35
|
-
this.register(new noop_check_provider_1.NoopCheckProvider());
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Register a check provider
|
|
39
|
-
*/
|
|
40
|
-
register(provider) {
|
|
41
|
-
const name = provider.getName();
|
|
42
|
-
if (this.providers.has(name)) {
|
|
43
|
-
throw new Error(`Provider '${name}' is already registered`);
|
|
44
|
-
}
|
|
45
|
-
this.providers.set(name, provider);
|
|
46
|
-
// Send provider registration messages to stderr to avoid contaminating JSON output
|
|
47
|
-
console.error(`Registered check provider: ${name}`);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Unregister a check provider
|
|
51
|
-
*/
|
|
52
|
-
unregister(name) {
|
|
53
|
-
if (!this.providers.has(name)) {
|
|
54
|
-
throw new Error(`Provider '${name}' not found`);
|
|
55
|
-
}
|
|
56
|
-
this.providers.delete(name);
|
|
57
|
-
// Send provider unregistration messages to stderr to avoid contaminating JSON output
|
|
58
|
-
console.error(`Unregistered check provider: ${name}`);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Get a provider by name
|
|
62
|
-
*/
|
|
63
|
-
getProvider(name) {
|
|
64
|
-
return this.providers.get(name);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Get provider or throw if not found
|
|
68
|
-
*/
|
|
69
|
-
getProviderOrThrow(name) {
|
|
70
|
-
const provider = this.providers.get(name);
|
|
71
|
-
if (!provider) {
|
|
72
|
-
throw new Error(`Check provider '${name}' not found. Available providers: ${this.getAvailableProviders().join(', ')}`);
|
|
73
|
-
}
|
|
74
|
-
return provider;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Check if a provider exists
|
|
78
|
-
*/
|
|
79
|
-
hasProvider(name) {
|
|
80
|
-
return this.providers.has(name);
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Get all registered provider names
|
|
84
|
-
*/
|
|
85
|
-
getAvailableProviders() {
|
|
86
|
-
return Array.from(this.providers.keys());
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Get all providers
|
|
90
|
-
*/
|
|
91
|
-
getAllProviders() {
|
|
92
|
-
return Array.from(this.providers.values());
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Get providers that are currently available (have required dependencies)
|
|
96
|
-
*/
|
|
97
|
-
async getActiveProviders() {
|
|
98
|
-
const providers = this.getAllProviders();
|
|
99
|
-
const activeProviders = [];
|
|
100
|
-
for (const provider of providers) {
|
|
101
|
-
if (await provider.isAvailable()) {
|
|
102
|
-
activeProviders.push(provider);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return activeProviders;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* List provider information
|
|
109
|
-
*/
|
|
110
|
-
async listProviders() {
|
|
111
|
-
const providers = this.getAllProviders();
|
|
112
|
-
const info = [];
|
|
113
|
-
for (const provider of providers) {
|
|
114
|
-
info.push({
|
|
115
|
-
name: provider.getName(),
|
|
116
|
-
description: provider.getDescription(),
|
|
117
|
-
available: await provider.isAvailable(),
|
|
118
|
-
requirements: provider.getRequirements(),
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
return info;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Reset registry (mainly for testing)
|
|
125
|
-
*/
|
|
126
|
-
reset() {
|
|
127
|
-
this.providers.clear();
|
|
128
|
-
this.registerDefaultProviders();
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Clear singleton instance (for testing)
|
|
132
|
-
*/
|
|
133
|
-
static clearInstance() {
|
|
134
|
-
CheckProviderRegistry.instance = undefined;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
exports.CheckProviderRegistry = CheckProviderRegistry;
|
|
138
|
-
//# sourceMappingURL=check-provider-registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-provider-registry.js","sourceRoot":"","sources":["../../src/providers/check-provider-registry.ts"],"names":[],"mappings":";;;AACA,2DAAsD;AACtD,+DAA0D;AAC1D,qEAAgE;AAChE,+DAA0D;AAE1D;;GAEG;AACH,MAAa,qBAAqB;IACxB,SAAS,GAA+B,IAAI,GAAG,EAAE,CAAC;IAClD,MAAM,CAAC,QAAQ,CAAwB;IAE/C;QACE,6BAA6B;QAC7B,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,WAAW;QAChB,IAAI,CAAC,qBAAqB,CAAC,QAAQ,EAAE,CAAC;YACpC,qBAAqB,CAAC,QAAQ,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAC/D,CAAC;QACD,OAAO,qBAAqB,CAAC,QAAQ,CAAC;IACxC,CAAC;IAED;;OAEG;IACK,wBAAwB;QAC9B,kCAAkC;QAClC,IAAI,CAAC,QAAQ,CAAC,IAAI,mCAAe,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,QAAQ,CAAC,IAAI,uCAAiB,EAAE,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,CAAC,IAAI,6CAAoB,EAAE,CAAC,CAAC;QAC1C,IAAI,CAAC,QAAQ,CAAC,IAAI,uCAAiB,EAAE,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,QAAuB;QAC9B,MAAM,IAAI,GAAG,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,CAAC;IAC9C,CAAC;CACF;AAxJD,sDAwJC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CheckProvider = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Abstract base class for all check providers
|
|
6
|
-
* Implementing classes provide specific check functionality (AI, tool, script, etc.)
|
|
7
|
-
*/
|
|
8
|
-
class CheckProvider {
|
|
9
|
-
}
|
|
10
|
-
exports.CheckProvider = CheckProvider;
|
|
11
|
-
//# sourceMappingURL=check-provider.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-provider.interface.js","sourceRoot":"","sources":["../../src/providers/check-provider.interface.ts"],"names":[],"mappings":";;;AA2CA;;;GAGG;AACH,MAAsB,aAAa;CAiDlC;AAjDD,sCAiDC"}
|
package/dist/providers/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Export all provider-related classes and interfaces
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.NoopCheckProvider = exports.WebhookCheckProvider = exports.ToolCheckProvider = exports.AICheckProvider = exports.CheckProviderRegistry = exports.CheckProvider = void 0;
|
|
7
|
-
var check_provider_interface_1 = require("./check-provider.interface");
|
|
8
|
-
Object.defineProperty(exports, "CheckProvider", { enumerable: true, get: function () { return check_provider_interface_1.CheckProvider; } });
|
|
9
|
-
var check_provider_registry_1 = require("./check-provider-registry");
|
|
10
|
-
Object.defineProperty(exports, "CheckProviderRegistry", { enumerable: true, get: function () { return check_provider_registry_1.CheckProviderRegistry; } });
|
|
11
|
-
var ai_check_provider_1 = require("./ai-check-provider");
|
|
12
|
-
Object.defineProperty(exports, "AICheckProvider", { enumerable: true, get: function () { return ai_check_provider_1.AICheckProvider; } });
|
|
13
|
-
var tool_check_provider_1 = require("./tool-check-provider");
|
|
14
|
-
Object.defineProperty(exports, "ToolCheckProvider", { enumerable: true, get: function () { return tool_check_provider_1.ToolCheckProvider; } });
|
|
15
|
-
var webhook_check_provider_1 = require("./webhook-check-provider");
|
|
16
|
-
Object.defineProperty(exports, "WebhookCheckProvider", { enumerable: true, get: function () { return webhook_check_provider_1.WebhookCheckProvider; } });
|
|
17
|
-
var noop_check_provider_1 = require("./noop-check-provider");
|
|
18
|
-
Object.defineProperty(exports, "NoopCheckProvider", { enumerable: true, get: function () { return noop_check_provider_1.NoopCheckProvider; } });
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uEAAgF;AAAvE,yHAAA,aAAa,OAAA;AACtB,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,yDAAsD;AAA7C,oHAAA,eAAe,OAAA;AACxB,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA"}
|