deepdebug-local-agent 1.0.23 → 1.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/.claude/context.md +76 -0
- package/.claude/skills/README.md +25 -0
- package/.claude/skills/tdd-debugging/SKILL.md +53 -0
- package/.claude/skills/tdd-debugging/references/anti-patterns.md +43 -0
- package/.claude/skills/tdd-debugging/references/command-reference.md +46 -0
- package/.claude/standards/README.md +51 -0
- package/.claude/standards/clean-code.md +75 -0
- package/.claude/standards/code-review-checklist.md +61 -0
- package/.claude/standards/layered-architecture.md +163 -0
- package/.claude/standards/node.md +45 -0
- package/.claude/standards/security-owasp.md +114 -0
- package/.claude/standards/simplicity.md +42 -0
- package/.claude/standards/solid.md +64 -0
- package/.claude/standards/testing.md +59 -0
- package/.cursor/rules/standards.mdc +17 -0
- package/.github/workflows/build-byoc-image.yml +315 -0
- package/.github/workflows/deploy-gcp.yml +102 -0
- package/.github/workflows/npm-publish.yml +76 -8
- package/AGENTS.md +21 -0
- package/CHANGELOG.md +76 -0
- package/CLAUDE.md +13 -0
- package/CLAUDE_CODE_AGENT_INFINITE.md +5 -3
- package/Dockerfile +4 -0
- package/Dockerfile.full +55 -3
- package/bin/install.js +16 -5
- package/cloudbuild-full.yaml +57 -0
- package/docker-compose.yml +5 -3
- package/docs/OBSERVABILITY.md +164 -0
- package/docs/byoc-agent-image.md +70 -0
- package/docs/dlp.md +78 -0
- package/docs/graphify-packaging-plan.md +133 -0
- package/docs/graphify-validation-run-2026-10-28.md +243 -0
- package/docs/releasing.md +37 -0
- package/docs/signed-commands.md +163 -0
- package/env.example +34 -0
- package/helm/Chart.yaml +2 -2
- package/helm/templates/deployment.yaml +13 -3
- package/helm/templates/networkpolicy.yaml +22 -0
- package/helm/templates/secret.yaml +1 -0
- package/helm/values.yaml +13 -14
- package/mcp-server.js +4 -1
- package/package.json +9 -4
- package/scripts/next-version.mjs +75 -0
- package/scripts/upgrade-observability-push.sh +227 -0
- package/src/ai-engine.js +22 -22
- package/src/config/trusted-signing-keys.json +3 -0
- package/src/detectors/build-tool-detector.js +50 -0
- package/src/detectors/multi-project-detector.js +22 -22
- package/src/detectors/service-detector.js +24 -24
- package/src/dlp/engine.js +111 -0
- package/src/dlp/index.js +137 -0
- package/src/dlp/rules.js +97 -0
- package/src/dlp/validators.js +123 -0
- package/src/exec-utils.js +26 -4
- package/src/git/base-git-provider.js +117 -117
- package/src/git/bitbucket-provider.js +2 -2
- package/src/git/git-provider-registry.js +18 -18
- package/src/git/github-provider.js +13 -13
- package/src/git/multi-repo-pr.js +161 -0
- package/src/mcp-http-server.js +32 -16
- package/src/observability/bundle-files.js +418 -0
- package/src/observability/detect.js +151 -0
- package/src/observability/provision.js +212 -0
- package/src/observability/render-cli.js +59 -0
- package/src/observability/routes.js +88 -0
- package/src/patch/patch-engine.js +28 -28
- package/src/patch-manager.js +85 -85
- package/src/patch_bkp.js +14 -14
- package/src/ports.js +4 -4
- package/src/routes/workspace.route.js +47 -16
- package/src/runtimes/base-runtime.js +75 -75
- package/src/runtimes/java/gradle-runtime.js +17 -17
- package/src/runtimes/java/java-integrations.js +25 -25
- package/src/runtimes/java/maven-runtime.js +34 -34
- package/src/runtimes/node/node-integrations.js +1 -1
- package/src/runtimes/node/npm-runtime.js +14 -14
- package/src/runtimes/node/yarn-runtime.js +4 -4
- package/src/runtimes/runtime-registry.js +25 -25
- package/src/server-local.js +4 -4
- package/src/server.js +1366 -333
- package/src/siblings/burst-suppressor.js +89 -0
- package/src/siblings/capabilities.js +273 -0
- package/src/siblings/env-compat.cjs +58 -0
- package/src/siblings/incident-forwarder.js +322 -0
- package/src/siblings/logger.js +15 -0
- package/src/siblings/metrics.js +94 -0
- package/src/utils/agent-auth.js +184 -0
- package/src/utils/approval-token.js +56 -0
- package/src/utils/bind-host.js +29 -0
- package/src/utils/branch-refspec.js +98 -0
- package/src/utils/child-env.js +34 -0
- package/src/utils/environment-diagnostics.js +55 -55
- package/src/utils/exec-policy.js +962 -0
- package/src/utils/exec-utils.js +15 -15
- package/src/utils/file-count.js +46 -0
- package/src/utils/fs-utils.js +10 -10
- package/src/utils/multi-repo-open.js +132 -0
- package/src/utils/open-gate.js +183 -0
- package/src/utils/ranged-read.js +65 -0
- package/src/utils/request-guards.js +77 -0
- package/src/utils/request-signing.js +342 -0
- package/src/utils/root-recovery.js +244 -0
- package/src/utils/safe-exec-args.js +58 -0
- package/src/utils/sandbox.js +182 -0
- package/src/utils/search-outcome.js +56 -0
- package/src/utils/workspace-root.js +80 -0
- package/src/validators/syntax-validator.js +149 -0
- package/src/workspace/detect-port.js +16 -16
- package/src/workspace/file-reader.js +1 -1
- package/src/workspace/process-manager.js +46 -46
- package/src/workspace-manager.js +86 -24
- package/test/adapters/registry.test.js +9 -2
- package/test/agent-auth.test.js +194 -0
- package/test/bind-host.test.js +26 -0
- package/test/branch-refspec.test.js +224 -0
- package/test/burst-suppressor.test.js +60 -0
- package/test/capabilities-access.test.js +47 -0
- package/test/capabilities.test.js +87 -0
- package/test/child-env.test.js +23 -0
- package/test/dlp/engine.test.js +173 -0
- package/test/dlp/fixtures.js +126 -0
- package/test/dlp/index.test.js +166 -0
- package/test/env-compat.test.js +71 -0
- package/test/exec-policy.test.js +463 -0
- package/test/file-count.test.js +64 -0
- package/test/incident-forwarder.test.js +231 -0
- package/test/multi-repo-open.test.js +180 -0
- package/test/multi-repo-pr.test.js +129 -0
- package/test/next-version.test.js +48 -0
- package/test/observability-detect.test.js +199 -0
- package/test/open-gate.test.js +341 -0
- package/test/ranged-read.test.js +60 -0
- package/test/request-guards.test.js +91 -0
- package/test/request-signing.test.js +284 -0
- package/test/root-recovery-sidecar.test.js +171 -0
- package/test/root-recovery.test.js +274 -0
- package/test/safe-exec-args.test.js +58 -0
- package/test/sandbox.test.js +98 -0
- package/test/search-outcome.test.js +50 -0
- package/test/workspace-root.test.js +64 -0
- package/tools/graphify-validation/README.md +92 -0
- package/tools/graphify-validation/config/questions.json +31 -0
- package/tools/graphify-validation/config/repos.json +9 -0
- package/tools/graphify-validation/config/symbols.json +6 -0
- package/tools/graphify-validation/fixtures/spring/expected.json +34 -0
- package/tools/graphify-validation/fixtures/spring/src/main/java/com/example/fx/AppConfig.java +29 -0
- package/tools/graphify-validation/fixtures/spring/src/main/java/com/example/fx/AuditLogger.java +15 -0
- package/tools/graphify-validation/fixtures/spring/src/main/java/com/example/fx/Cache.java +7 -0
- package/tools/graphify-validation/fixtures/spring/src/main/java/com/example/fx/CheckoutService.java +25 -0
- package/tools/graphify-validation/fixtures/spring/src/main/java/com/example/fx/InMemoryCache.java +18 -0
- package/tools/graphify-validation/fixtures/spring/src/main/java/com/example/fx/OrderController.java +22 -0
- package/tools/graphify-validation/fixtures/spring/src/main/java/com/example/fx/PaymentGateway.java +5 -0
- package/tools/graphify-validation/fixtures/spring/src/main/java/com/example/fx/PaypalGateway.java +11 -0
- package/tools/graphify-validation/fixtures/spring/src/main/java/com/example/fx/RefundService.java +14 -0
- package/tools/graphify-validation/fixtures/spring/src/main/java/com/example/fx/StripeGateway.java +11 -0
- package/tools/graphify-validation/lib/affected_vs_rg.py +81 -0
- package/tools/graphify-validation/lib/audit_hook/sitecustomize.py +22 -0
- package/tools/graphify-validation/lib/graph_metrics.py +96 -0
- package/tools/graphify-validation/lib/gv_common.py +130 -0
- package/tools/graphify-validation/lib/licenses.py +47 -0
- package/tools/graphify-validation/lib/pip_audit_summary.py +18 -0
- package/tools/graphify-validation/lib/recall.py +115 -0
- package/tools/graphify-validation/lib/report.py +226 -0
- package/tools/graphify-validation/lib/run_all.py +237 -0
- package/tools/graphify-validation/lib/run_graphify.py +144 -0
- package/tools/graphify-validation/lib/rusage_helper.py +17 -0
- package/tools/graphify-validation/lib/sample_edges.py +246 -0
- package/tools/graphify-validation/lib/spring_fixture.py +81 -0
- package/tools/graphify-validation/requirements-py311.lock +508 -0
- package/tools/graphify-validation/requirements-tools.in +1 -0
- package/tools/graphify-validation/requirements-tools.lock +371 -0
- package/tools/graphify-validation/requirements.in +1 -0
- package/tools/graphify-validation/requirements.lock +502 -0
- package/tools/graphify-validation/run.sh +43 -0
- package/tools/graphify-validation/tests/test_harness.py +151 -0
- package/cloudbuild-agent-qa.yaml +0 -43
- package/cloudbuild-agent-staging.yaml +0 -40
- package/cloudbuild.yaml.deprecated +0 -42
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* BaseGitProvider
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Abstract interface for Git providers (GitHub, GitLab, Bitbucket).
|
|
5
|
+
* Each provider must implement this interface.
|
|
6
6
|
*
|
|
7
7
|
* @abstract
|
|
8
8
|
*/
|
|
@@ -22,7 +22,7 @@ export class BaseGitProvider {
|
|
|
22
22
|
// ==========================================
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Unique identifier of the provider
|
|
26
26
|
* @returns {string} Ex: 'github', 'gitlab', 'bitbucket'
|
|
27
27
|
*/
|
|
28
28
|
getId() {
|
|
@@ -30,7 +30,7 @@ export class BaseGitProvider {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Friendly name of the provider
|
|
34
34
|
* @returns {string} Ex: 'GitHub', 'GitLab', 'Bitbucket'
|
|
35
35
|
*/
|
|
36
36
|
getName() {
|
|
@@ -38,7 +38,7 @@ export class BaseGitProvider {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* URL
|
|
41
|
+
* Base URL of the API
|
|
42
42
|
* @returns {string}
|
|
43
43
|
*/
|
|
44
44
|
getApiBaseUrl() {
|
|
@@ -50,7 +50,7 @@ export class BaseGitProvider {
|
|
|
50
50
|
// ==========================================
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Sets the access token
|
|
54
54
|
* @param {string} token
|
|
55
55
|
*/
|
|
56
56
|
setAccessToken(token) {
|
|
@@ -58,9 +58,9 @@ export class BaseGitProvider {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
62
|
-
* @param {string} redirectUri - URI
|
|
63
|
-
* @param {string} state - State
|
|
61
|
+
* Returns the URL for OAuth authorization
|
|
62
|
+
* @param {string} redirectUri - Callback URI
|
|
63
|
+
* @param {string} state - State for CSRF protection
|
|
64
64
|
* @returns {string}
|
|
65
65
|
*/
|
|
66
66
|
getAuthorizationUrl(redirectUri, state) {
|
|
@@ -68,9 +68,9 @@ export class BaseGitProvider {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
71
|
+
* Exchanges an authorization code for an access token
|
|
72
72
|
* @param {string} code - Authorization code
|
|
73
|
-
* @param {string} redirectUri - URI
|
|
73
|
+
* @param {string} redirectUri - Callback URI
|
|
74
74
|
* @returns {Promise<TokenResponse>}
|
|
75
75
|
*/
|
|
76
76
|
async exchangeCodeForToken(code, redirectUri) {
|
|
@@ -78,7 +78,7 @@ export class BaseGitProvider {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
81
|
+
* Validates whether the token is still valid
|
|
82
82
|
* @returns {Promise<boolean>}
|
|
83
83
|
*/
|
|
84
84
|
async validateToken() {
|
|
@@ -90,7 +90,7 @@ export class BaseGitProvider {
|
|
|
90
90
|
// ==========================================
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
93
|
+
* Gets information about the authenticated user
|
|
94
94
|
* @returns {Promise<UserInfo>}
|
|
95
95
|
*/
|
|
96
96
|
async getCurrentUser() {
|
|
@@ -102,7 +102,7 @@ export class BaseGitProvider {
|
|
|
102
102
|
// ==========================================
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
105
|
+
* Lists the user's repositories
|
|
106
106
|
* @param {object} options - { page, perPage, sort }
|
|
107
107
|
* @returns {Promise<Repository[]>}
|
|
108
108
|
*/
|
|
@@ -111,9 +111,9 @@ export class BaseGitProvider {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
115
|
-
* @param {string} owner -
|
|
116
|
-
* @param {string} repo -
|
|
114
|
+
* Gets information about a repository
|
|
115
|
+
* @param {string} owner - Repo owner
|
|
116
|
+
* @param {string} repo - Repo name
|
|
117
117
|
* @returns {Promise<Repository>}
|
|
118
118
|
*/
|
|
119
119
|
async getRepository(owner, repo) {
|
|
@@ -121,10 +121,10 @@ export class BaseGitProvider {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
*
|
|
125
|
-
* @param {string} owner -
|
|
126
|
-
* @param {string} repo -
|
|
127
|
-
* @param {string} destPath -
|
|
124
|
+
* Clones a repository
|
|
125
|
+
* @param {string} owner - Repo owner
|
|
126
|
+
* @param {string} repo - Repo name
|
|
127
|
+
* @param {string} destPath - Destination path
|
|
128
128
|
* @param {object} options - { branch, depth }
|
|
129
129
|
* @returns {Promise<CloneResult>}
|
|
130
130
|
*/
|
|
@@ -137,9 +137,9 @@ export class BaseGitProvider {
|
|
|
137
137
|
// ==========================================
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
|
-
*
|
|
141
|
-
* @param {string} owner -
|
|
142
|
-
* @param {string} repo -
|
|
140
|
+
* Lists the repository branches
|
|
141
|
+
* @param {string} owner - Repo owner
|
|
142
|
+
* @param {string} repo - Repo name
|
|
143
143
|
* @returns {Promise<Branch[]>}
|
|
144
144
|
*/
|
|
145
145
|
async listBranches(owner, repo) {
|
|
@@ -147,11 +147,11 @@ export class BaseGitProvider {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
151
|
-
* @param {string} owner -
|
|
152
|
-
* @param {string} repo -
|
|
153
|
-
* @param {string} branchName -
|
|
154
|
-
* @param {string} fromRef -
|
|
150
|
+
* Creates a new branch
|
|
151
|
+
* @param {string} owner - Repo owner
|
|
152
|
+
* @param {string} repo - Repo name
|
|
153
|
+
* @param {string} branchName - Name of the new branch
|
|
154
|
+
* @param {string} fromRef - Source ref (sha or branch)
|
|
155
155
|
* @returns {Promise<Branch>}
|
|
156
156
|
*/
|
|
157
157
|
async createBranch(owner, repo, branchName, fromRef) {
|
|
@@ -159,10 +159,10 @@ export class BaseGitProvider {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
/**
|
|
162
|
-
*
|
|
163
|
-
* @param {string} owner -
|
|
164
|
-
* @param {string} repo -
|
|
165
|
-
* @param {string} branch -
|
|
162
|
+
* Gets information about a branch
|
|
163
|
+
* @param {string} owner - Repo owner
|
|
164
|
+
* @param {string} repo - Repo name
|
|
165
|
+
* @param {string} branch - Branch name
|
|
166
166
|
* @returns {Promise<Branch>}
|
|
167
167
|
*/
|
|
168
168
|
async getBranch(owner, repo, branch) {
|
|
@@ -174,10 +174,10 @@ export class BaseGitProvider {
|
|
|
174
174
|
// ==========================================
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
|
-
*
|
|
178
|
-
* @param {string} owner -
|
|
179
|
-
* @param {string} repo -
|
|
180
|
-
* @param {string} branch -
|
|
177
|
+
* Lists commits of a branch
|
|
178
|
+
* @param {string} owner - Repo owner
|
|
179
|
+
* @param {string} repo - Repo name
|
|
180
|
+
* @param {string} branch - Branch name
|
|
181
181
|
* @param {object} options - { page, perPage }
|
|
182
182
|
* @returns {Promise<Commit[]>}
|
|
183
183
|
*/
|
|
@@ -186,12 +186,12 @@ export class BaseGitProvider {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
|
-
*
|
|
190
|
-
* @param {string} owner -
|
|
191
|
-
* @param {string} repo -
|
|
192
|
-
* @param {string} branch -
|
|
193
|
-
* @param {string} message -
|
|
194
|
-
* @param {FileChange[]} changes -
|
|
189
|
+
* Creates a commit with changes
|
|
190
|
+
* @param {string} owner - Repo owner
|
|
191
|
+
* @param {string} repo - Repo name
|
|
192
|
+
* @param {string} branch - Branch name
|
|
193
|
+
* @param {string} message - Commit message
|
|
194
|
+
* @param {FileChange[]} changes - List of changes
|
|
195
195
|
* @returns {Promise<Commit>}
|
|
196
196
|
*/
|
|
197
197
|
async createCommit(owner, repo, branch, message, changes) {
|
|
@@ -203,11 +203,11 @@ export class BaseGitProvider {
|
|
|
203
203
|
// ==========================================
|
|
204
204
|
|
|
205
205
|
/**
|
|
206
|
-
*
|
|
207
|
-
* @param {string} owner -
|
|
208
|
-
* @param {string} repo -
|
|
209
|
-
* @param {string} path -
|
|
210
|
-
* @param {string} ref - Branch
|
|
206
|
+
* Gets the content of a file
|
|
207
|
+
* @param {string} owner - Repo owner
|
|
208
|
+
* @param {string} repo - Repo name
|
|
209
|
+
* @param {string} path - File path
|
|
210
|
+
* @param {string} ref - Branch or sha
|
|
211
211
|
* @returns {Promise<FileContent>}
|
|
212
212
|
*/
|
|
213
213
|
async getFileContent(owner, repo, path, ref = 'main') {
|
|
@@ -215,14 +215,14 @@ export class BaseGitProvider {
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
|
-
*
|
|
219
|
-
* @param {string} owner -
|
|
220
|
-
* @param {string} repo -
|
|
221
|
-
* @param {string} path -
|
|
222
|
-
* @param {string} content -
|
|
223
|
-
* @param {string} message -
|
|
218
|
+
* Creates or updates a file
|
|
219
|
+
* @param {string} owner - Repo owner
|
|
220
|
+
* @param {string} repo - Repo name
|
|
221
|
+
* @param {string} path - File path
|
|
222
|
+
* @param {string} content - Content (base64 or text)
|
|
223
|
+
* @param {string} message - Commit message
|
|
224
224
|
* @param {string} branch - Branch
|
|
225
|
-
* @param {string} sha - SHA
|
|
225
|
+
* @param {string} sha - Current SHA (for update)
|
|
226
226
|
* @returns {Promise<FileCommit>}
|
|
227
227
|
*/
|
|
228
228
|
async createOrUpdateFile(owner, repo, path, content, message, branch, sha = null) {
|
|
@@ -234,9 +234,9 @@ export class BaseGitProvider {
|
|
|
234
234
|
// ==========================================
|
|
235
235
|
|
|
236
236
|
/**
|
|
237
|
-
*
|
|
238
|
-
* @param {string} owner -
|
|
239
|
-
* @param {string} repo -
|
|
237
|
+
* Lists pull requests
|
|
238
|
+
* @param {string} owner - Repo owner
|
|
239
|
+
* @param {string} repo - Repo name
|
|
240
240
|
* @param {object} options - { state, page, perPage }
|
|
241
241
|
* @returns {Promise<PullRequest[]>}
|
|
242
242
|
*/
|
|
@@ -245,9 +245,9 @@ export class BaseGitProvider {
|
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
/**
|
|
248
|
-
*
|
|
249
|
-
* @param {string} owner -
|
|
250
|
-
* @param {string} repo -
|
|
248
|
+
* Creates a pull request
|
|
249
|
+
* @param {string} owner - Repo owner
|
|
250
|
+
* @param {string} repo - Repo name
|
|
251
251
|
* @param {object} pr - { title, body, head, base }
|
|
252
252
|
* @returns {Promise<PullRequest>}
|
|
253
253
|
*/
|
|
@@ -256,10 +256,10 @@ export class BaseGitProvider {
|
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
/**
|
|
259
|
-
*
|
|
260
|
-
* @param {string} owner -
|
|
261
|
-
* @param {string} repo -
|
|
262
|
-
* @param {number} prNumber -
|
|
259
|
+
* Gets information about a pull request
|
|
260
|
+
* @param {string} owner - Repo owner
|
|
261
|
+
* @param {string} repo - Repo name
|
|
262
|
+
* @param {number} prNumber - PR number
|
|
263
263
|
* @returns {Promise<PullRequest>}
|
|
264
264
|
*/
|
|
265
265
|
async getPullRequest(owner, repo, prNumber) {
|
|
@@ -271,10 +271,10 @@ export class BaseGitProvider {
|
|
|
271
271
|
// ==========================================
|
|
272
272
|
|
|
273
273
|
/**
|
|
274
|
-
*
|
|
275
|
-
* @param {string} owner -
|
|
276
|
-
* @param {string} repo -
|
|
277
|
-
* @param {number} prNumber -
|
|
274
|
+
* Lists comments of a pull request
|
|
275
|
+
* @param {string} owner - Repo owner
|
|
276
|
+
* @param {string} repo - Repo name
|
|
277
|
+
* @param {number} prNumber - PR number
|
|
278
278
|
* @param {object} options - { page, perPage }
|
|
279
279
|
* @returns {Promise<PRComment[]>}
|
|
280
280
|
*/
|
|
@@ -283,10 +283,10 @@ export class BaseGitProvider {
|
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
/**
|
|
286
|
-
*
|
|
287
|
-
* @param {string} owner -
|
|
288
|
-
* @param {string} repo -
|
|
289
|
-
* @param {number} prNumber -
|
|
286
|
+
* Lists only review comments (inline in the code)
|
|
287
|
+
* @param {string} owner - Repo owner
|
|
288
|
+
* @param {string} repo - Repo name
|
|
289
|
+
* @param {number} prNumber - PR number
|
|
290
290
|
* @param {object} options - { page, perPage }
|
|
291
291
|
* @returns {Promise<PRReviewComment[]>}
|
|
292
292
|
*/
|
|
@@ -295,11 +295,11 @@ export class BaseGitProvider {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
|
-
*
|
|
299
|
-
* @param {string} owner -
|
|
300
|
-
* @param {string} repo -
|
|
301
|
-
* @param {number} prNumber -
|
|
302
|
-
* @param {string|number} commentId - ID
|
|
298
|
+
* Gets a specific comment
|
|
299
|
+
* @param {string} owner - Repo owner
|
|
300
|
+
* @param {string} repo - Repo name
|
|
301
|
+
* @param {number} prNumber - PR number
|
|
302
|
+
* @param {string|number} commentId - Comment ID
|
|
303
303
|
* @returns {Promise<PRComment>}
|
|
304
304
|
*/
|
|
305
305
|
async getPRComment(owner, repo, prNumber, commentId) {
|
|
@@ -307,11 +307,11 @@ export class BaseGitProvider {
|
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
/**
|
|
310
|
-
*
|
|
311
|
-
* @param {string} owner -
|
|
312
|
-
* @param {string} repo -
|
|
313
|
-
* @param {number} prNumber -
|
|
314
|
-
* @param {string} body -
|
|
310
|
+
* Adds a general comment to the PR
|
|
311
|
+
* @param {string} owner - Repo owner
|
|
312
|
+
* @param {string} repo - Repo name
|
|
313
|
+
* @param {number} prNumber - PR number
|
|
314
|
+
* @param {string} body - Comment content
|
|
315
315
|
* @returns {Promise<PRComment>}
|
|
316
316
|
*/
|
|
317
317
|
async addPRComment(owner, repo, prNumber, body) {
|
|
@@ -319,10 +319,10 @@ export class BaseGitProvider {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
/**
|
|
322
|
-
*
|
|
323
|
-
* @param {string} owner -
|
|
324
|
-
* @param {string} repo -
|
|
325
|
-
* @param {number} prNumber -
|
|
322
|
+
* Adds an inline comment in the code (review comment)
|
|
323
|
+
* @param {string} owner - Repo owner
|
|
324
|
+
* @param {string} repo - Repo name
|
|
325
|
+
* @param {number} prNumber - PR number
|
|
326
326
|
* @param {object} comment - { body, path, line, side, commitId }
|
|
327
327
|
* @returns {Promise<PRReviewComment>}
|
|
328
328
|
*/
|
|
@@ -331,12 +331,12 @@ export class BaseGitProvider {
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
/**
|
|
334
|
-
*
|
|
335
|
-
* @param {string} owner -
|
|
336
|
-
* @param {string} repo -
|
|
337
|
-
* @param {number} prNumber -
|
|
338
|
-
* @param {string|number} commentId -
|
|
339
|
-
* @param {string} body -
|
|
334
|
+
* Replies to an existing comment (thread reply)
|
|
335
|
+
* @param {string} owner - Repo owner
|
|
336
|
+
* @param {string} repo - Repo name
|
|
337
|
+
* @param {number} prNumber - PR number
|
|
338
|
+
* @param {string|number} commentId - Parent comment ID
|
|
339
|
+
* @param {string} body - Reply content
|
|
340
340
|
* @returns {Promise<PRComment>}
|
|
341
341
|
*/
|
|
342
342
|
async replyToPRComment(owner, repo, prNumber, commentId, body) {
|
|
@@ -344,11 +344,11 @@ export class BaseGitProvider {
|
|
|
344
344
|
}
|
|
345
345
|
|
|
346
346
|
/**
|
|
347
|
-
*
|
|
348
|
-
* @param {string} owner -
|
|
349
|
-
* @param {string} repo -
|
|
350
|
-
* @param {number} prNumber -
|
|
351
|
-
* @param {string|number} commentId -
|
|
347
|
+
* Marks a comment/thread as resolved
|
|
348
|
+
* @param {string} owner - Repo owner
|
|
349
|
+
* @param {string} repo - Repo name
|
|
350
|
+
* @param {number} prNumber - PR number
|
|
351
|
+
* @param {string|number} commentId - Comment/thread ID
|
|
352
352
|
* @returns {Promise<{ resolved: boolean }>}
|
|
353
353
|
*/
|
|
354
354
|
async resolvePRComment(owner, repo, prNumber, commentId) {
|
|
@@ -356,11 +356,11 @@ export class BaseGitProvider {
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
/**
|
|
359
|
-
*
|
|
360
|
-
* @param {string} owner -
|
|
361
|
-
* @param {string} repo -
|
|
362
|
-
* @param {number} prNumber -
|
|
363
|
-
* @param {string|number} commentId -
|
|
359
|
+
* Marks a comment/thread as unresolved
|
|
360
|
+
* @param {string} owner - Repo owner
|
|
361
|
+
* @param {string} repo - Repo name
|
|
362
|
+
* @param {number} prNumber - PR number
|
|
363
|
+
* @param {string|number} commentId - Comment/thread ID
|
|
364
364
|
* @returns {Promise<{ resolved: boolean }>}
|
|
365
365
|
*/
|
|
366
366
|
async unresolvePRComment(owner, repo, prNumber, commentId) {
|
|
@@ -368,11 +368,11 @@ export class BaseGitProvider {
|
|
|
368
368
|
}
|
|
369
369
|
|
|
370
370
|
/**
|
|
371
|
-
*
|
|
372
|
-
* Convenience method -
|
|
373
|
-
* @param {string} owner -
|
|
374
|
-
* @param {string} repo -
|
|
375
|
-
* @param {number} prNumber -
|
|
371
|
+
* Lists unresolved comments of a PR
|
|
372
|
+
* Convenience method - filters listPRComments + listPRReviewComments
|
|
373
|
+
* @param {string} owner - Repo owner
|
|
374
|
+
* @param {string} repo - Repo name
|
|
375
|
+
* @param {number} prNumber - PR number
|
|
376
376
|
* @returns {Promise<PRComment[]>}
|
|
377
377
|
*/
|
|
378
378
|
async listUnresolvedPRComments(owner, repo, prNumber) {
|
|
@@ -391,9 +391,9 @@ export class BaseGitProvider {
|
|
|
391
391
|
// ==========================================
|
|
392
392
|
|
|
393
393
|
/**
|
|
394
|
-
*
|
|
395
|
-
* @param {string} owner -
|
|
396
|
-
* @param {string} repo -
|
|
394
|
+
* Creates a webhook
|
|
395
|
+
* @param {string} owner - Repo owner
|
|
396
|
+
* @param {string} repo - Repo name
|
|
397
397
|
* @param {object} webhook - { url, events, secret }
|
|
398
398
|
* @returns {Promise<Webhook>}
|
|
399
399
|
*/
|
|
@@ -406,10 +406,10 @@ export class BaseGitProvider {
|
|
|
406
406
|
// ==========================================
|
|
407
407
|
|
|
408
408
|
/**
|
|
409
|
-
*
|
|
410
|
-
* @param {string} owner -
|
|
411
|
-
* @param {string} repo -
|
|
412
|
-
* @param {boolean} useHttps -
|
|
409
|
+
* Builds a clone URL
|
|
410
|
+
* @param {string} owner - Repo owner
|
|
411
|
+
* @param {string} repo - Repo name
|
|
412
|
+
* @param {boolean} useHttps - Use HTTPS (default) or SSH
|
|
413
413
|
* @returns {string}
|
|
414
414
|
*/
|
|
415
415
|
getCloneUrl(owner, repo, useHttps = true) {
|
|
@@ -417,8 +417,8 @@ export class BaseGitProvider {
|
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
/**
|
|
420
|
-
*
|
|
421
|
-
* @param {string} url - URL
|
|
420
|
+
* Parses a repository URL to extract owner and repo
|
|
421
|
+
* @param {string} url - Repository URL
|
|
422
422
|
* @returns {{ owner: string, repo: string }}
|
|
423
423
|
*/
|
|
424
424
|
parseRepositoryUrl(url) {
|
|
@@ -4,7 +4,7 @@ import { run } from '../utils/exec-utils.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* BitbucketProvider
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Git provider implementation for Bitbucket Cloud.
|
|
8
8
|
*
|
|
9
9
|
* Bitbucket API 2.0: https://developer.atlassian.com/cloud/bitbucket/rest/intro/
|
|
10
10
|
*
|
|
@@ -661,7 +661,7 @@ export class BitbucketProvider extends BaseGitProvider {
|
|
|
661
661
|
const data = await this.apiRequest(`/repositories/${workspace}/${repoSlug}/hooks`, {
|
|
662
662
|
method: 'POST',
|
|
663
663
|
body: JSON.stringify({
|
|
664
|
-
description: webhook.description || '
|
|
664
|
+
description: webhook.description || 'VisionHammer Webhook',
|
|
665
665
|
url: webhook.url,
|
|
666
666
|
active: true,
|
|
667
667
|
events: webhook.events || ['repo:push', 'pullrequest:created', 'pullrequest:updated'],
|
|
@@ -4,7 +4,7 @@ import { BitbucketProvider } from './bitbucket-provider.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* GitProviderRegistry
|
|
6
6
|
*
|
|
7
|
-
* Factory/Registry
|
|
7
|
+
* Factory/Registry for managing Git providers.
|
|
8
8
|
*/
|
|
9
9
|
export class GitProviderRegistry {
|
|
10
10
|
|
|
@@ -14,28 +14,28 @@ export class GitProviderRegistry {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
registerDefaults() {
|
|
17
|
-
//
|
|
17
|
+
// Register the available providers
|
|
18
18
|
this.register('github', GitHubProvider);
|
|
19
19
|
this.register('bitbucket', BitbucketProvider);
|
|
20
20
|
|
|
21
|
-
// GitLab
|
|
21
|
+
// GitLab will be implemented later
|
|
22
22
|
// this.register('gitlab', GitLabProvider);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @param {string} id - ID
|
|
28
|
-
* @param {class} ProviderClass -
|
|
26
|
+
* Registers a provider
|
|
27
|
+
* @param {string} id - Provider ID
|
|
28
|
+
* @param {class} ProviderClass - Provider class
|
|
29
29
|
*/
|
|
30
30
|
register(id, ProviderClass) {
|
|
31
31
|
this.providers.set(id, ProviderClass);
|
|
32
|
-
console.log(
|
|
32
|
+
console.log(`📦 Registered git provider: ${id}`);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
* @param {string} id - ID
|
|
38
|
-
* @param {object} config -
|
|
36
|
+
* Creates an instance of a provider
|
|
37
|
+
* @param {string} id - Provider ID
|
|
38
|
+
* @param {object} config - Provider configuration
|
|
39
39
|
* @returns {BaseGitProvider}
|
|
40
40
|
*/
|
|
41
41
|
create(id, config = {}) {
|
|
@@ -49,7 +49,7 @@ export class GitProviderRegistry {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Lists the IDs of the available providers
|
|
53
53
|
* @returns {string[]}
|
|
54
54
|
*/
|
|
55
55
|
listProviders() {
|
|
@@ -57,9 +57,9 @@ export class GitProviderRegistry {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
* @param {string} url - URL
|
|
62
|
-
* @returns {string|null} - ID
|
|
60
|
+
* Detects the provider from the URL
|
|
61
|
+
* @param {string} url - Repository URL
|
|
62
|
+
* @returns {string|null} - Provider ID
|
|
63
63
|
*/
|
|
64
64
|
detectProviderFromUrl(url) {
|
|
65
65
|
if (url.includes('github.com')) {
|
|
@@ -75,9 +75,9 @@ export class GitProviderRegistry {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
79
|
-
* @param {string} url - URL
|
|
80
|
-
* @param {object} config -
|
|
78
|
+
* Creates a provider from the repository URL
|
|
79
|
+
* @param {string} url - Repository URL
|
|
80
|
+
* @param {object} config - Configuration
|
|
81
81
|
* @returns {BaseGitProvider}
|
|
82
82
|
*/
|
|
83
83
|
createFromUrl(url, config = {}) {
|
|
@@ -98,7 +98,7 @@ export class GitProviderRegistry {
|
|
|
98
98
|
let instance = null;
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* Gets the singleton instance of GitProviderRegistry
|
|
102
102
|
* @returns {GitProviderRegistry}
|
|
103
103
|
*/
|
|
104
104
|
export function getGitProviderRegistry() {
|