@probelabs/visor 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.
- package/README.md +1240 -0
- package/action.yml +142 -0
- package/defaults/.visor.yaml +184 -0
- package/dist/action-cli-bridge.d.ts +104 -0
- package/dist/action-cli-bridge.d.ts.map +1 -0
- package/dist/action-cli-bridge.js +372 -0
- package/dist/action-cli-bridge.js.map +1 -0
- package/dist/ai-review-service.d.ts +84 -0
- package/dist/ai-review-service.d.ts.map +1 -0
- package/dist/ai-review-service.js +674 -0
- package/dist/ai-review-service.js.map +1 -0
- package/dist/check-execution-engine.d.ts +165 -0
- package/dist/check-execution-engine.d.ts.map +1 -0
- package/dist/check-execution-engine.js +1172 -0
- package/dist/check-execution-engine.js.map +1 -0
- package/dist/cli-main.d.ts +6 -0
- package/dist/cli-main.d.ts.map +1 -0
- package/dist/cli-main.js +247 -0
- package/dist/cli-main.js.map +1 -0
- package/dist/cli.d.ts +47 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +224 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands.d.ts +10 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +53 -0
- package/dist/commands.js.map +1 -0
- package/dist/config.d.ts +63 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +369 -0
- package/dist/config.js.map +1 -0
- package/dist/dependency-resolver.d.ts +54 -0
- package/dist/dependency-resolver.d.ts.map +1 -0
- package/dist/dependency-resolver.js +163 -0
- package/dist/dependency-resolver.js.map +1 -0
- package/dist/event-mapper.d.ts +125 -0
- package/dist/event-mapper.d.ts.map +1 -0
- package/dist/event-mapper.js +311 -0
- package/dist/event-mapper.js.map +1 -0
- package/dist/failure-condition-evaluator.d.ts +81 -0
- package/dist/failure-condition-evaluator.d.ts.map +1 -0
- package/dist/failure-condition-evaluator.js +445 -0
- package/dist/failure-condition-evaluator.js.map +1 -0
- package/dist/git-repository-analyzer.d.ts +45 -0
- package/dist/git-repository-analyzer.d.ts.map +1 -0
- package/dist/git-repository-analyzer.js +285 -0
- package/dist/git-repository-analyzer.js.map +1 -0
- package/dist/github-check-service.d.ts +104 -0
- package/dist/github-check-service.d.ts.map +1 -0
- package/dist/github-check-service.js +382 -0
- package/dist/github-check-service.js.map +1 -0
- package/dist/github-comments.d.ts +109 -0
- package/dist/github-comments.d.ts.map +1 -0
- package/dist/github-comments.js +289 -0
- package/dist/github-comments.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1265 -0
- package/dist/index.js.map +1 -0
- package/dist/output-formatters.d.ts +66 -0
- package/dist/output-formatters.d.ts.map +1 -0
- package/dist/output-formatters.js +624 -0
- package/dist/output-formatters.js.map +1 -0
- package/dist/pr-analyzer.d.ts +47 -0
- package/dist/pr-analyzer.d.ts.map +1 -0
- package/dist/pr-analyzer.js +194 -0
- package/dist/pr-analyzer.js.map +1 -0
- package/dist/pr-detector.d.ts +78 -0
- package/dist/pr-detector.d.ts.map +1 -0
- package/dist/pr-detector.js +357 -0
- package/dist/pr-detector.js.map +1 -0
- package/dist/providers/ai-check-provider.d.ts +40 -0
- package/dist/providers/ai-check-provider.d.ts.map +1 -0
- package/dist/providers/ai-check-provider.js +416 -0
- package/dist/providers/ai-check-provider.js.map +1 -0
- package/dist/providers/check-provider-registry.d.ts +67 -0
- package/dist/providers/check-provider-registry.d.ts.map +1 -0
- package/dist/providers/check-provider-registry.js +138 -0
- package/dist/providers/check-provider-registry.js.map +1 -0
- package/dist/providers/check-provider.interface.d.ts +78 -0
- package/dist/providers/check-provider.interface.d.ts.map +1 -0
- package/dist/providers/check-provider.interface.js +11 -0
- package/dist/providers/check-provider.interface.js.map +1 -0
- package/dist/providers/index.d.ts +10 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +19 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/script-check-provider.d.ts +20 -0
- package/dist/providers/script-check-provider.d.ts.map +1 -0
- package/dist/providers/script-check-provider.js +163 -0
- package/dist/providers/script-check-provider.js.map +1 -0
- package/dist/providers/tool-check-provider.d.ts +19 -0
- package/dist/providers/tool-check-provider.d.ts.map +1 -0
- package/dist/providers/tool-check-provider.js +125 -0
- package/dist/providers/tool-check-provider.js.map +1 -0
- package/dist/providers/webhook-check-provider.d.ts +21 -0
- package/dist/providers/webhook-check-provider.d.ts.map +1 -0
- package/dist/providers/webhook-check-provider.js +173 -0
- package/dist/providers/webhook-check-provider.js.map +1 -0
- package/dist/reviewer.d.ts +88 -0
- package/dist/reviewer.d.ts.map +1 -0
- package/dist/reviewer.js +760 -0
- package/dist/reviewer.js.map +1 -0
- package/dist/types/cli.d.ts +41 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/cli.js +3 -0
- package/dist/types/cli.js.map +1 -0
- package/dist/types/config.d.ts +315 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +6 -0
- package/dist/types/config.js.map +1 -0
- package/dist/utils/env-resolver.d.ts +38 -0
- package/dist/utils/env-resolver.d.ts.map +1 -0
- package/dist/utils/env-resolver.js +130 -0
- package/dist/utils/env-resolver.js.map +1 -0
- package/package.json +116 -0
package/action.yml
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
name: 'Visor AI Code Review'
|
|
2
|
+
description: 'AI-powered code review tool that analyzes PRs for security, performance, style, and architecture issues. Works out-of-the-box without configuration.'
|
|
3
|
+
author: 'Visor Team'
|
|
4
|
+
branding:
|
|
5
|
+
icon: 'eye'
|
|
6
|
+
color: 'blue'
|
|
7
|
+
|
|
8
|
+
inputs:
|
|
9
|
+
github-token:
|
|
10
|
+
description: 'GitHub token for API access (use this OR app-id/private-key)'
|
|
11
|
+
required: false
|
|
12
|
+
default: ${{ github.token }}
|
|
13
|
+
|
|
14
|
+
app-id:
|
|
15
|
+
description: 'GitHub App ID for authentication (optional, use with private-key)'
|
|
16
|
+
required: false
|
|
17
|
+
|
|
18
|
+
private-key:
|
|
19
|
+
description: 'GitHub App private key for authentication (optional, use with app-id)'
|
|
20
|
+
required: false
|
|
21
|
+
|
|
22
|
+
installation-id:
|
|
23
|
+
description: 'GitHub App installation ID (optional, auto-detected if not provided)'
|
|
24
|
+
required: false
|
|
25
|
+
|
|
26
|
+
auto-review:
|
|
27
|
+
description: 'Enable automatic review on PR open/update'
|
|
28
|
+
required: false
|
|
29
|
+
default: 'true'
|
|
30
|
+
|
|
31
|
+
checks:
|
|
32
|
+
description: 'Comma-separated list of checks to run (security,performance,style,architecture,all)'
|
|
33
|
+
required: false
|
|
34
|
+
default: 'all'
|
|
35
|
+
|
|
36
|
+
output-format:
|
|
37
|
+
description: 'Output format for analysis results (table,json,markdown,sarif)'
|
|
38
|
+
required: false
|
|
39
|
+
default: 'json'
|
|
40
|
+
|
|
41
|
+
config-path:
|
|
42
|
+
description: 'Path to visor configuration file (optional - uses bundled default config if not specified)'
|
|
43
|
+
required: false
|
|
44
|
+
default: ''
|
|
45
|
+
|
|
46
|
+
comment-on-pr:
|
|
47
|
+
description: 'Post review results as PR comment'
|
|
48
|
+
required: false
|
|
49
|
+
default: 'true'
|
|
50
|
+
|
|
51
|
+
create-check:
|
|
52
|
+
description: 'Create GitHub check run with results'
|
|
53
|
+
required: false
|
|
54
|
+
default: 'true'
|
|
55
|
+
|
|
56
|
+
add-labels:
|
|
57
|
+
description: 'Add quality labels to PR'
|
|
58
|
+
required: false
|
|
59
|
+
default: 'true'
|
|
60
|
+
|
|
61
|
+
ai-model:
|
|
62
|
+
description: 'AI model to use (mock, google-gemini-pro, claude-sonnet, etc.)'
|
|
63
|
+
required: false
|
|
64
|
+
default: ''
|
|
65
|
+
|
|
66
|
+
ai-provider:
|
|
67
|
+
description: 'AI provider to use (mock, google, anthropic, openai)'
|
|
68
|
+
required: false
|
|
69
|
+
default: ''
|
|
70
|
+
|
|
71
|
+
fail-on-critical:
|
|
72
|
+
description: 'Fail the action if critical issues are found'
|
|
73
|
+
required: false
|
|
74
|
+
default: 'false'
|
|
75
|
+
|
|
76
|
+
fail-on-api-error:
|
|
77
|
+
description: 'Fail the action if API authentication or rate limit errors occur'
|
|
78
|
+
required: false
|
|
79
|
+
default: 'false'
|
|
80
|
+
|
|
81
|
+
debug:
|
|
82
|
+
description: 'Enable debug mode for detailed output in comments'
|
|
83
|
+
required: false
|
|
84
|
+
default: 'false'
|
|
85
|
+
|
|
86
|
+
# Legacy inputs for backward compatibility
|
|
87
|
+
owner:
|
|
88
|
+
description: 'Repository owner (legacy)'
|
|
89
|
+
required: false
|
|
90
|
+
repo:
|
|
91
|
+
description: 'Repository name (legacy)'
|
|
92
|
+
required: false
|
|
93
|
+
visor-config-path:
|
|
94
|
+
description: 'Path to Visor configuration file (legacy, use config-path)'
|
|
95
|
+
required: false
|
|
96
|
+
visor-checks:
|
|
97
|
+
description: 'Checks to run (legacy, use checks)'
|
|
98
|
+
required: false
|
|
99
|
+
|
|
100
|
+
outputs:
|
|
101
|
+
total-issues:
|
|
102
|
+
description: 'Total number of issues found'
|
|
103
|
+
|
|
104
|
+
critical-issues:
|
|
105
|
+
description: 'Number of critical issues found'
|
|
106
|
+
|
|
107
|
+
review-url:
|
|
108
|
+
description: 'URL to the detailed review comment'
|
|
109
|
+
|
|
110
|
+
sarif-report:
|
|
111
|
+
description: 'SARIF format report (if output-format includes sarif)'
|
|
112
|
+
|
|
113
|
+
incremental-analysis:
|
|
114
|
+
description: 'Whether incremental analysis was performed (true for synchronize events)'
|
|
115
|
+
|
|
116
|
+
pr-action:
|
|
117
|
+
description: 'The GitHub PR action that triggered this run (opened, synchronize, edited)'
|
|
118
|
+
|
|
119
|
+
check-runs-created:
|
|
120
|
+
description: 'Number of GitHub check runs created'
|
|
121
|
+
|
|
122
|
+
check-runs-urls:
|
|
123
|
+
description: 'URLs of created GitHub check runs (comma-separated)'
|
|
124
|
+
|
|
125
|
+
checks-api-available:
|
|
126
|
+
description: 'Whether GitHub Checks API was available (true/false)'
|
|
127
|
+
|
|
128
|
+
# Legacy outputs for backward compatibility
|
|
129
|
+
repo-name:
|
|
130
|
+
description: 'Name of the repository (legacy)'
|
|
131
|
+
repo-description:
|
|
132
|
+
description: 'Description of the repository (legacy)'
|
|
133
|
+
repo-stars:
|
|
134
|
+
description: 'Number of stars on the repository (legacy)'
|
|
135
|
+
issues-found:
|
|
136
|
+
description: 'Number of issues found (legacy, use total-issues)'
|
|
137
|
+
auto-review-completed:
|
|
138
|
+
description: 'Whether automatic PR review was completed (legacy)'
|
|
139
|
+
|
|
140
|
+
runs:
|
|
141
|
+
using: 'node20'
|
|
142
|
+
main: 'dist/index.js'
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
version: "1.0"
|
|
2
|
+
|
|
3
|
+
# Default Visor configuration - provides comprehensive code analysis out-of-the-box
|
|
4
|
+
# Uses mock provider for CI compatibility when no AI API keys are configured
|
|
5
|
+
# Users can override this by creating their own .visor.yaml in their project root
|
|
6
|
+
|
|
7
|
+
# Global AI provider settings - uses mock by default for CI compatibility
|
|
8
|
+
ai_provider: "mock"
|
|
9
|
+
|
|
10
|
+
# Global fail condition - fail if critical issues are found
|
|
11
|
+
fail_if: "output.issues && output.issues.some(i => i.severity === 'critical')"
|
|
12
|
+
|
|
13
|
+
checks:
|
|
14
|
+
# Security analysis - Critical for all projects
|
|
15
|
+
security:
|
|
16
|
+
type: ai
|
|
17
|
+
group: review
|
|
18
|
+
schema: code-review
|
|
19
|
+
ai_provider: "mock"
|
|
20
|
+
prompt: |
|
|
21
|
+
Please perform a comprehensive security analysis of the code changes in this pull request.
|
|
22
|
+
|
|
23
|
+
## Files Changed
|
|
24
|
+
{% for file in files %}
|
|
25
|
+
- `{{ file.filename }}` - {{ file.status }}, +{{ file.additions }}/-{{ file.deletions }} ({{ file.changes }} total changes)
|
|
26
|
+
{% endfor %}
|
|
27
|
+
|
|
28
|
+
## Instructions
|
|
29
|
+
Analyze the code for security vulnerabilities including:
|
|
30
|
+
|
|
31
|
+
**Input Validation & Injection:**
|
|
32
|
+
- SQL injection in database queries
|
|
33
|
+
- XSS vulnerabilities in user input handling
|
|
34
|
+
- Command injection in system calls
|
|
35
|
+
- Path traversal in file operations
|
|
36
|
+
|
|
37
|
+
**Authentication & Authorization:**
|
|
38
|
+
- Weak authentication mechanisms
|
|
39
|
+
- Session management flaws
|
|
40
|
+
- Access control bypasses
|
|
41
|
+
- Privilege escalation opportunities
|
|
42
|
+
|
|
43
|
+
**Data Protection:**
|
|
44
|
+
- Sensitive data exposure in logs/errors
|
|
45
|
+
- Unencrypted data storage
|
|
46
|
+
- API key or credential leaks
|
|
47
|
+
- Privacy regulation compliance
|
|
48
|
+
|
|
49
|
+
**Infrastructure Security:**
|
|
50
|
+
- Insecure configurations
|
|
51
|
+
- Missing security headers
|
|
52
|
+
- Vulnerable dependencies
|
|
53
|
+
- Resource exhaustion vulnerabilities
|
|
54
|
+
|
|
55
|
+
Provide specific findings with clear explanations and actionable remediation steps.
|
|
56
|
+
on: [pr_opened, pr_updated]
|
|
57
|
+
|
|
58
|
+
# Performance analysis - Important for all applications
|
|
59
|
+
performance:
|
|
60
|
+
type: ai
|
|
61
|
+
group: review
|
|
62
|
+
schema: code-review
|
|
63
|
+
ai_provider: "mock"
|
|
64
|
+
prompt: |
|
|
65
|
+
Review the code changes for performance issues:
|
|
66
|
+
|
|
67
|
+
## Files to Analyze
|
|
68
|
+
{% for file in files %}
|
|
69
|
+
- `{{ file.filename }}` ({{ file.changes }} changes, {{ file.status }})
|
|
70
|
+
{% endfor %}
|
|
71
|
+
|
|
72
|
+
## Analysis Areas
|
|
73
|
+
**Algorithm & Data Structure Efficiency:**
|
|
74
|
+
- Time complexity analysis (O(n), O(n²), etc.)
|
|
75
|
+
- Space complexity and memory usage
|
|
76
|
+
- Inefficient loops and nested operations
|
|
77
|
+
- Suboptimal data structure choices
|
|
78
|
+
|
|
79
|
+
**Database Performance:**
|
|
80
|
+
- N+1 query problems
|
|
81
|
+
- Missing database indexes
|
|
82
|
+
- Inefficient JOIN operations
|
|
83
|
+
- Large result set retrievals
|
|
84
|
+
|
|
85
|
+
**Resource Management:**
|
|
86
|
+
- Memory leaks and excessive allocations
|
|
87
|
+
- File handle management
|
|
88
|
+
- Connection pooling issues
|
|
89
|
+
- Resource cleanup patterns
|
|
90
|
+
|
|
91
|
+
**Async & Concurrency:**
|
|
92
|
+
- Blocking operations in async contexts
|
|
93
|
+
- Race conditions and deadlocks
|
|
94
|
+
- Inefficient parallel processing
|
|
95
|
+
|
|
96
|
+
Identify specific performance issues and provide optimization recommendations.
|
|
97
|
+
on: [pr_opened, pr_updated]
|
|
98
|
+
|
|
99
|
+
# Code quality and maintainability
|
|
100
|
+
quality:
|
|
101
|
+
type: ai
|
|
102
|
+
group: review
|
|
103
|
+
schema: code-review
|
|
104
|
+
ai_provider: "mock"
|
|
105
|
+
prompt: |
|
|
106
|
+
Evaluate the code quality and maintainability of the changes:
|
|
107
|
+
|
|
108
|
+
## Quality Assessment Areas
|
|
109
|
+
**Code Structure & Design:**
|
|
110
|
+
- SOLID principles adherence
|
|
111
|
+
- Design pattern appropriateness
|
|
112
|
+
- Separation of concerns
|
|
113
|
+
- Code organization and clarity
|
|
114
|
+
|
|
115
|
+
**Error Handling & Reliability:**
|
|
116
|
+
- Exception handling completeness
|
|
117
|
+
- Error propagation patterns
|
|
118
|
+
- Input validation thoroughness
|
|
119
|
+
- Edge case coverage
|
|
120
|
+
|
|
121
|
+
**Testing & Test Coverage:**
|
|
122
|
+
- Missing tests for critical functionality
|
|
123
|
+
- Test coverage gaps
|
|
124
|
+
- Test quality and effectiveness
|
|
125
|
+
- Edge cases and error scenarios coverage
|
|
126
|
+
|
|
127
|
+
**Maintainability:**
|
|
128
|
+
- Code testability issues
|
|
129
|
+
- Dependencies and coupling problems
|
|
130
|
+
- Technical debt introduction
|
|
131
|
+
- Code duplication (DRY violations)
|
|
132
|
+
|
|
133
|
+
**Language-Specific Best Practices:**
|
|
134
|
+
- Idiomatic code usage
|
|
135
|
+
- Framework/library best practices
|
|
136
|
+
- Type safety (if applicable)
|
|
137
|
+
|
|
138
|
+
Focus on actionable improvements that enhance code maintainability.
|
|
139
|
+
on: [pr_opened, pr_updated]
|
|
140
|
+
|
|
141
|
+
# PR overview with intelligent analysis
|
|
142
|
+
overview:
|
|
143
|
+
type: ai
|
|
144
|
+
group: overview
|
|
145
|
+
schema: plain
|
|
146
|
+
ai_provider: "mock"
|
|
147
|
+
prompt: |
|
|
148
|
+
# 📋 Pull Request Overview: {{ pr.title }}
|
|
149
|
+
|
|
150
|
+
{% if pr.body %}
|
|
151
|
+
## Description
|
|
152
|
+
{{ pr.body }}
|
|
153
|
+
{% endif %}
|
|
154
|
+
|
|
155
|
+
## Files Changed Analysis
|
|
156
|
+
|
|
157
|
+
| File | Type | Status | Changes | Impact |
|
|
158
|
+
|------|------|--------|---------|--------|
|
|
159
|
+
{% for file in files %}
|
|
160
|
+
| `{{ file.filename }}` | {{ file.filename | split: "." | last | upcase }} | {{ file.status | capitalize }} | +{{ file.additions }}/-{{ file.deletions }} | {% if file.changes > 50 %}High{% elsif file.changes > 20 %}Medium{% else %}Low{% endif %} |
|
|
161
|
+
{% endfor %}
|
|
162
|
+
|
|
163
|
+
## Instructions
|
|
164
|
+
Generate a comprehensive overview and analysis of this pull request:
|
|
165
|
+
|
|
166
|
+
1. **Change Impact Analysis**
|
|
167
|
+
- What this PR accomplishes
|
|
168
|
+
- Key technical changes introduced
|
|
169
|
+
- Affected system components
|
|
170
|
+
|
|
171
|
+
2. **Architecture Assessment**
|
|
172
|
+
- Component relationships affected
|
|
173
|
+
- Process flows modified
|
|
174
|
+
- Data flow changes
|
|
175
|
+
|
|
176
|
+
Provide a balanced technical assessment suitable for developers and stakeholders.
|
|
177
|
+
on: [pr_opened, pr_updated]
|
|
178
|
+
|
|
179
|
+
# Output configuration
|
|
180
|
+
output:
|
|
181
|
+
pr_comment:
|
|
182
|
+
format: markdown
|
|
183
|
+
group_by: check
|
|
184
|
+
collapse: true
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export interface GitHubActionInputs {
|
|
2
|
+
'github-token': string;
|
|
3
|
+
owner?: string;
|
|
4
|
+
repo?: string;
|
|
5
|
+
'auto-review'?: string;
|
|
6
|
+
'app-id'?: string;
|
|
7
|
+
'private-key'?: string;
|
|
8
|
+
'installation-id'?: string;
|
|
9
|
+
checks?: string;
|
|
10
|
+
'output-format'?: string;
|
|
11
|
+
'config-path'?: string;
|
|
12
|
+
'comment-on-pr'?: string;
|
|
13
|
+
'create-check'?: string;
|
|
14
|
+
'add-labels'?: string;
|
|
15
|
+
'fail-on-critical'?: string;
|
|
16
|
+
'fail-on-api-error'?: string;
|
|
17
|
+
'min-score'?: string;
|
|
18
|
+
debug?: string;
|
|
19
|
+
'visor-config-path'?: string;
|
|
20
|
+
'visor-checks'?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface GitHubContext {
|
|
23
|
+
event_name: string;
|
|
24
|
+
repository?: {
|
|
25
|
+
owner: {
|
|
26
|
+
login: string;
|
|
27
|
+
};
|
|
28
|
+
name: string;
|
|
29
|
+
};
|
|
30
|
+
event?: {
|
|
31
|
+
comment?: Record<string, unknown>;
|
|
32
|
+
issue?: Record<string, unknown>;
|
|
33
|
+
pull_request?: Record<string, unknown>;
|
|
34
|
+
action?: string;
|
|
35
|
+
};
|
|
36
|
+
payload?: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
export interface ActionCliOutput {
|
|
39
|
+
success: boolean;
|
|
40
|
+
output?: string;
|
|
41
|
+
error?: string;
|
|
42
|
+
exitCode?: number;
|
|
43
|
+
cliOutput?: {
|
|
44
|
+
reviewScore?: number;
|
|
45
|
+
issuesFound?: number;
|
|
46
|
+
autoReviewCompleted?: boolean;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Bridge between GitHub Action and Visor CLI
|
|
51
|
+
*/
|
|
52
|
+
export declare class ActionCliBridge {
|
|
53
|
+
private githubToken;
|
|
54
|
+
private context;
|
|
55
|
+
constructor(githubToken: string, context: GitHubContext);
|
|
56
|
+
/**
|
|
57
|
+
* Determine if Visor CLI should be used based on inputs
|
|
58
|
+
*/
|
|
59
|
+
shouldUseVisor(inputs: GitHubActionInputs): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Parse GitHub Action inputs to CLI arguments
|
|
62
|
+
*/
|
|
63
|
+
parseGitHubInputsToCliArgs(inputs: GitHubActionInputs): string[];
|
|
64
|
+
/**
|
|
65
|
+
* Execute CLI with GitHub context
|
|
66
|
+
*/
|
|
67
|
+
executeCliWithContext(inputs: GitHubActionInputs, options?: {
|
|
68
|
+
workingDir?: string;
|
|
69
|
+
timeout?: number;
|
|
70
|
+
}): Promise<ActionCliOutput>;
|
|
71
|
+
/**
|
|
72
|
+
* Merge CLI and Action outputs for backward compatibility
|
|
73
|
+
*/
|
|
74
|
+
mergeActionAndCliOutputs(actionInputs: GitHubActionInputs, cliResult: ActionCliOutput, legacyOutputs?: Record<string, string>): Record<string, string>;
|
|
75
|
+
/**
|
|
76
|
+
* Execute command with timeout and proper error handling
|
|
77
|
+
*/
|
|
78
|
+
private executeCommand;
|
|
79
|
+
/**
|
|
80
|
+
* Parse CLI JSON output to extract relevant data
|
|
81
|
+
*/
|
|
82
|
+
private parseCliOutput;
|
|
83
|
+
/**
|
|
84
|
+
* Check if a check type is valid
|
|
85
|
+
*/
|
|
86
|
+
private isValidCheck;
|
|
87
|
+
/**
|
|
88
|
+
* Create temporary config file from action inputs
|
|
89
|
+
*/
|
|
90
|
+
createTempConfigFromInputs(inputs: GitHubActionInputs, options?: {
|
|
91
|
+
workingDir?: string;
|
|
92
|
+
}): Promise<string | null>;
|
|
93
|
+
/**
|
|
94
|
+
* Get AI prompt for a specific check type
|
|
95
|
+
*/
|
|
96
|
+
private getPromptForCheck;
|
|
97
|
+
/**
|
|
98
|
+
* Cleanup temporary files
|
|
99
|
+
*/
|
|
100
|
+
cleanup(options?: {
|
|
101
|
+
workingDir?: string;
|
|
102
|
+
}): Promise<void>;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=action-cli-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-cli-bridge.d.ts","sourceRoot":"","sources":["../src/action-cli-bridge.ts"],"names":[],"mappings":"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"}
|