agentic-sdlc-mcp 1.4.0 → 1.6.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 +32 -9
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/github/codeowners.d.ts +24 -0
- package/dist/github/codeowners.d.ts.map +1 -0
- package/dist/github/codeowners.js +153 -0
- package/dist/github/codeowners.js.map +1 -0
- package/dist/github/context.d.ts +7 -1
- package/dist/github/context.d.ts.map +1 -1
- package/dist/github/context.js +69 -9
- package/dist/github/context.js.map +1 -1
- package/dist/github/pull-request-evidence.d.ts +123 -0
- package/dist/github/pull-request-evidence.d.ts.map +1 -0
- package/dist/github/pull-request-evidence.js +590 -0
- package/dist/github/pull-request-evidence.js.map +1 -0
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/rendering/markdown.d.ts +8 -0
- package/dist/rendering/markdown.d.ts.map +1 -0
- package/dist/rendering/markdown.js +27 -0
- package/dist/rendering/markdown.js.map +1 -0
- package/dist/review/pull-request-review.d.ts +77 -0
- package/dist/review/pull-request-review.d.ts.map +1 -0
- package/dist/review/pull-request-review.js +1185 -0
- package/dist/review/pull-request-review.js.map +1 -0
- package/dist/security/secret-scanner-evidence.d.ts +58 -0
- package/dist/security/secret-scanner-evidence.d.ts.map +1 -0
- package/dist/security/secret-scanner-evidence.js +414 -0
- package/dist/security/secret-scanner-evidence.js.map +1 -0
- package/dist/tools/create-issue-set.d.ts +46 -0
- package/dist/tools/create-issue-set.d.ts.map +1 -1
- package/dist/tools/create-issue-set.js +175 -22
- package/dist/tools/create-issue-set.js.map +1 -1
- package/dist/tools/plan-from-context.d.ts +24 -2
- package/dist/tools/plan-from-context.d.ts.map +1 -1
- package/dist/tools/plan-from-context.js +198 -59
- package/dist/tools/plan-from-context.js.map +1 -1
- package/dist/tools/quality-gate-status.d.ts +292 -5
- package/dist/tools/quality-gate-status.d.ts.map +1 -1
- package/dist/tools/quality-gate-status.js +665 -95
- package/dist/tools/quality-gate-status.js.map +1 -1
- package/dist/tools/release-readiness.d.ts.map +1 -1
- package/dist/tools/release-readiness.js +81 -39
- package/dist/tools/release-readiness.js.map +1 -1
- package/dist/tools/repo-context.d.ts +2 -0
- package/dist/tools/repo-context.d.ts.map +1 -1
- package/dist/tools/repo-context.js +16 -3
- package/dist/tools/repo-context.js.map +1 -1
- package/dist/tools/review-pr.d.ts +113 -29
- package/dist/tools/review-pr.d.ts.map +1 -1
- package/dist/tools/review-pr.js +237 -314
- package/dist/tools/review-pr.js.map +1 -1
- package/dist/tools/workflow-permissions-audit.d.ts +14 -1
- package/dist/tools/workflow-permissions-audit.d.ts.map +1 -1
- package/dist/tools/workflow-permissions-audit.js +40 -15
- package/dist/tools/workflow-permissions-audit.js.map +1 -1
- package/dist/types.d.ts +20 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/package.json +1 -1
|
@@ -6,8 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
|
+
import { type CodeownersRule, type OwnershipGap } from "../github/codeowners.js";
|
|
9
10
|
import type { Finding, Severity, RepoRef } from "../types.js";
|
|
10
11
|
import type { Octokit } from "@octokit/rest";
|
|
12
|
+
import { type SecretScannerEvidence } from "../security/secret-scanner-evidence.js";
|
|
13
|
+
import { type StructuredReviewFinding } from "../review/pull-request-review.js";
|
|
14
|
+
export { codeownersPatternMatches, fetchCodeownersRules, ownersForFile, parseCodeowners, } from "../github/codeowners.js";
|
|
15
|
+
export type { CodeownersRule } from "../github/codeowners.js";
|
|
11
16
|
export declare const ReviewPrInputSchema: z.ZodObject<{
|
|
12
17
|
owner: z.ZodOptional<z.ZodString>;
|
|
13
18
|
repo: z.ZodOptional<z.ZodString>;
|
|
@@ -17,6 +22,15 @@ export declare const ReviewPrInputSchema: z.ZodObject<{
|
|
|
17
22
|
strict: "strict";
|
|
18
23
|
"security-focused": "security-focused";
|
|
19
24
|
}>>;
|
|
25
|
+
workType: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
docs: "docs";
|
|
27
|
+
feature: "feature";
|
|
28
|
+
bugfix: "bugfix";
|
|
29
|
+
refactor: "refactor";
|
|
30
|
+
security: "security";
|
|
31
|
+
release: "release";
|
|
32
|
+
infra: "infra";
|
|
33
|
+
}>>;
|
|
20
34
|
checkOwnership: z.ZodDefault<z.ZodBoolean>;
|
|
21
35
|
}, z.core.$strip>;
|
|
22
36
|
export type ReviewPrInput = z.infer<typeof ReviewPrInputSchema>;
|
|
@@ -39,27 +53,119 @@ export declare const ReviewPrOutputSchema: {
|
|
|
39
53
|
}>;
|
|
40
54
|
category: z.ZodString;
|
|
41
55
|
description: z.ZodString;
|
|
42
|
-
suggestion: z.
|
|
56
|
+
suggestion: z.ZodString;
|
|
57
|
+
dimension: z.ZodEnum<{
|
|
58
|
+
security: "security";
|
|
59
|
+
scope: "scope";
|
|
60
|
+
evidence: "evidence";
|
|
61
|
+
intent: "intent";
|
|
62
|
+
ownership: "ownership";
|
|
63
|
+
policy: "policy";
|
|
64
|
+
fallback: "fallback";
|
|
65
|
+
}>;
|
|
66
|
+
paths: z.ZodArray<z.ZodString>;
|
|
67
|
+
reason: z.ZodString;
|
|
43
68
|
}, z.core.$strip>>;
|
|
44
69
|
hasTests: z.ZodBoolean;
|
|
45
70
|
totalChangedLines: z.ZodNumber;
|
|
46
71
|
codeownersFound: z.ZodBoolean;
|
|
72
|
+
workType: z.ZodEnum<{
|
|
73
|
+
docs: "docs";
|
|
74
|
+
feature: "feature";
|
|
75
|
+
bugfix: "bugfix";
|
|
76
|
+
refactor: "refactor";
|
|
77
|
+
security: "security";
|
|
78
|
+
release: "release";
|
|
79
|
+
infra: "infra";
|
|
80
|
+
}>;
|
|
81
|
+
workTypeConfidence: z.ZodEnum<{
|
|
82
|
+
high: "high";
|
|
83
|
+
medium: "medium";
|
|
84
|
+
low: "low";
|
|
85
|
+
}>;
|
|
86
|
+
workTypeReasoning: z.ZodString;
|
|
87
|
+
releaseRisk: z.ZodEnum<{
|
|
88
|
+
critical: "critical";
|
|
89
|
+
high: "high";
|
|
90
|
+
low: "low";
|
|
91
|
+
moderate: "moderate";
|
|
92
|
+
}>;
|
|
93
|
+
testCoverageSignal: z.ZodEnum<{
|
|
94
|
+
adequate: "adequate";
|
|
95
|
+
missing: "missing";
|
|
96
|
+
not_required: "not_required";
|
|
97
|
+
insufficient_evidence: "insufficient_evidence";
|
|
98
|
+
}>;
|
|
99
|
+
ownershipRoutingGaps: z.ZodArray<z.ZodObject<{
|
|
100
|
+
owner: z.ZodString;
|
|
101
|
+
paths: z.ZodArray<z.ZodString>;
|
|
102
|
+
}, z.core.$strip>>;
|
|
47
103
|
errors: z.ZodArray<z.ZodString>;
|
|
104
|
+
secretScannerEvidence: z.ZodNullable<z.ZodObject<{
|
|
105
|
+
status: z.ZodEnum<{
|
|
106
|
+
pending: "pending";
|
|
107
|
+
passing: "passing";
|
|
108
|
+
failing: "failing";
|
|
109
|
+
unverified: "unverified";
|
|
110
|
+
}>;
|
|
111
|
+
verified: z.ZodBoolean;
|
|
112
|
+
degraded: z.ZodBoolean;
|
|
113
|
+
providers: z.ZodArray<z.ZodEnum<{
|
|
114
|
+
gitleaks: "gitleaks";
|
|
115
|
+
trufflehog: "trufflehog";
|
|
116
|
+
secretlint: "secretlint";
|
|
117
|
+
"detect-secrets": "detect-secrets";
|
|
118
|
+
"github-secret-scanning": "github-secret-scanning";
|
|
119
|
+
}>>;
|
|
120
|
+
signals: z.ZodArray<z.ZodObject<{
|
|
121
|
+
name: z.ZodString;
|
|
122
|
+
provider: z.ZodEnum<{
|
|
123
|
+
gitleaks: "gitleaks";
|
|
124
|
+
trufflehog: "trufflehog";
|
|
125
|
+
secretlint: "secretlint";
|
|
126
|
+
"detect-secrets": "detect-secrets";
|
|
127
|
+
"github-secret-scanning": "github-secret-scanning";
|
|
128
|
+
}>;
|
|
129
|
+
source: z.ZodEnum<{
|
|
130
|
+
check_run: "check_run";
|
|
131
|
+
commit_status: "commit_status";
|
|
132
|
+
}>;
|
|
133
|
+
appId: z.ZodNullable<z.ZodNumber>;
|
|
134
|
+
trusted: z.ZodBoolean;
|
|
135
|
+
provenanceVerified: z.ZodBoolean;
|
|
136
|
+
state: z.ZodEnum<{
|
|
137
|
+
pending: "pending";
|
|
138
|
+
skipped: "skipped";
|
|
139
|
+
passing: "passing";
|
|
140
|
+
failing: "failing";
|
|
141
|
+
}>;
|
|
142
|
+
url: z.ZodNullable<z.ZodString>;
|
|
143
|
+
}, z.core.$strip>>;
|
|
144
|
+
reason: z.ZodString;
|
|
145
|
+
}, z.core.$strip>>;
|
|
48
146
|
};
|
|
49
147
|
export interface ReviewPrResult {
|
|
50
148
|
pullNumber: number;
|
|
51
149
|
title: string;
|
|
52
150
|
standard: string;
|
|
53
151
|
conclusion: "pass" | "needs_changes" | "risky_but_acceptable";
|
|
54
|
-
findings:
|
|
152
|
+
findings: StructuredReviewFinding[];
|
|
55
153
|
hasTests: boolean;
|
|
56
154
|
totalChangedLines: number;
|
|
57
155
|
codeownersFound: boolean;
|
|
156
|
+
workType: "docs" | "feature" | "bugfix" | "refactor" | "security" | "release" | "infra";
|
|
157
|
+
workTypeConfidence: "high" | "medium" | "low";
|
|
158
|
+
workTypeReasoning: string;
|
|
159
|
+
releaseRisk: "low" | "moderate" | "high" | "critical";
|
|
160
|
+
testCoverageSignal: "adequate" | "missing" | "not_required" | "insufficient_evidence";
|
|
161
|
+
ownershipRoutingGaps: OwnershipGap[];
|
|
58
162
|
errors: string[];
|
|
163
|
+
secretScannerEvidence: SecretScannerEvidence | null;
|
|
59
164
|
}
|
|
60
165
|
/** Minimal shape from octokit pulls.listFiles we care about */
|
|
61
166
|
export interface PrFile {
|
|
62
167
|
filename: string;
|
|
168
|
+
previousFilename?: string;
|
|
63
169
|
status: string;
|
|
64
170
|
additions: number;
|
|
65
171
|
deletions: number;
|
|
@@ -74,14 +180,12 @@ export interface PrMeta {
|
|
|
74
180
|
commits: number;
|
|
75
181
|
author: string;
|
|
76
182
|
}
|
|
77
|
-
/** A single CODEOWNERS rule: a gitignore-style pattern and its owners. */
|
|
78
|
-
export interface CodeownersRule {
|
|
79
|
-
pattern: string;
|
|
80
|
-
owners: string[];
|
|
81
|
-
}
|
|
82
183
|
export declare function sortFindings(findings: Finding[]): Finding[];
|
|
83
184
|
export declare function severityIcon(s: Severity): string;
|
|
84
|
-
/**
|
|
185
|
+
/**
|
|
186
|
+
* Backward-compatible wrapper around the shared heuristic scanner.
|
|
187
|
+
* Mature scanner evidence is evaluated separately from CI check runs.
|
|
188
|
+
*/
|
|
85
189
|
export declare function scanPatchForSecrets(filename: string, patch: string | undefined): Finding[];
|
|
86
190
|
/**
|
|
87
191
|
* Classify PR files into categories.
|
|
@@ -100,30 +204,10 @@ export declare function classifyFiles(files: PrFile[]): {
|
|
|
100
204
|
* Generate findings for a PR. Pure function -- no I/O.
|
|
101
205
|
*/
|
|
102
206
|
export declare function generateFindings(pr: PrMeta, files: PrFile[], standard: ReviewPrInput["standard"]): Finding[];
|
|
103
|
-
/** Parse a CODEOWNERS file's contents into ordered rules (file order matters -- last match wins). */
|
|
104
|
-
export declare function parseCodeowners(content: string): CodeownersRule[];
|
|
105
|
-
/**
|
|
106
|
-
* Match a repo-relative file path against a single CODEOWNERS/gitignore-style pattern.
|
|
107
|
-
* Handles rooted (`/path/`) vs unrooted patterns, `*`/`?`/`**` wildcards, and directory-prefix
|
|
108
|
-
* matching (a pattern matching a directory also matches everything nested under it).
|
|
109
|
-
*/
|
|
110
|
-
export declare function codeownersPatternMatches(pattern: string, filePath: string): boolean;
|
|
111
|
-
/** Owners for a file, per CODEOWNERS semantics: rules are evaluated in order, last match wins. */
|
|
112
|
-
export declare function ownersForFile(filePath: string, rules: CodeownersRule[]): string[];
|
|
113
207
|
/**
|
|
114
|
-
*
|
|
115
|
-
* nor have already reviewed, nor are the PR author. Pure function -- no I/O.
|
|
208
|
+
* @deprecated Import `findOwnershipGaps` from `../github/codeowners.js` for shared routing logic.
|
|
116
209
|
*/
|
|
117
210
|
export declare function generateOwnershipFindings(files: PrFile[], rules: CodeownersRule[], requestedUsers: string[], requestedTeams: string[], reviewedUsers: string[], prAuthor: string): Finding[];
|
|
118
|
-
/**
|
|
119
|
-
* Fetch and parse the repo's CODEOWNERS file, trying the conventional candidate paths in order.
|
|
120
|
-
* A 404 on a candidate is normal (file lives elsewhere or doesn't exist) and tries the next path;
|
|
121
|
-
* any other error (e.g. permissions) short-circuits and is reported back to the caller.
|
|
122
|
-
*/
|
|
123
|
-
export declare function fetchCodeownersRules(ref: RepoRef, octokit: Octokit): Promise<{
|
|
124
|
-
rules: CodeownersRule[];
|
|
125
|
-
error: string | null;
|
|
126
|
-
}>;
|
|
127
211
|
export declare function handleReviewPr(params: ReviewPrInput, ref: RepoRef, octokit: Octokit): Promise<{
|
|
128
212
|
text: string;
|
|
129
213
|
structured: ReviewPrResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-pr.d.ts","sourceRoot":"","sources":["../../src/tools/review-pr.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"review-pr.d.ts","sourceRoot":"","sources":["../../src/tools/review-pr.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,E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