@spaceflow/review 0.80.0 → 0.82.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/CHANGELOG.md +27 -0
- package/dist/index.js +1048 -762
- package/package.json +3 -3
- package/src/README.md +0 -1
- package/src/changed-file-collection.ts +87 -0
- package/src/mcp/index.ts +5 -1
- package/src/prompt/issue-verify.ts +8 -3
- package/src/review-context.spec.ts +214 -0
- package/src/review-context.ts +4 -2
- package/src/review-issue-filter.spec.ts +742 -0
- package/src/review-issue-filter.ts +21 -280
- package/src/review-llm.spec.ts +287 -0
- package/src/review-llm.ts +19 -23
- package/src/review-report/formatters/markdown.formatter.ts +6 -7
- package/src/review-result-model.spec.ts +35 -4
- package/src/review-result-model.ts +58 -10
- package/src/review-source-resolver.ts +636 -0
- package/src/review-spec/review-spec.service.spec.ts +94 -12
- package/src/review-spec/review-spec.service.ts +289 -59
- package/src/review.service.spec.ts +142 -1154
- package/src/review.service.ts +177 -534
- package/src/types/changed-file-collection.ts +5 -0
- package/src/types/review-source-resolver.ts +55 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { PullRequestCommit, ChangedFile } from "@spaceflow/core";
|
|
2
|
+
import type { PullRequestModel } from "../pull-request-model";
|
|
3
|
+
import type { ReviewResult, FileContentsMap } from "../review-spec";
|
|
4
|
+
import type { ChangedFileCollection } from "../changed-file-collection";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* resolve() 的最终返回类型。
|
|
8
|
+
* 包含从各模式(本地/PR/分支比较)解析出的 commits、changedFiles 等源数据。
|
|
9
|
+
*/
|
|
10
|
+
export interface SourceData {
|
|
11
|
+
prModel?: PullRequestModel;
|
|
12
|
+
commits: PullRequestCommit[];
|
|
13
|
+
changedFiles: ChangedFileCollection;
|
|
14
|
+
headSha: string;
|
|
15
|
+
isLocalMode: boolean;
|
|
16
|
+
isDirectFileMode: boolean;
|
|
17
|
+
fileContents: FileContentsMap;
|
|
18
|
+
earlyReturn?: ReviewResult;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** commits + changedFiles 的基础组合,用于分支比较 / 前置过滤返回 */
|
|
22
|
+
export interface CommitsAndFiles {
|
|
23
|
+
commits: PullRequestCommit[];
|
|
24
|
+
changedFiles: ChangedFile[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* resolveLocalFiles 的返回类型。
|
|
29
|
+
* 本地模式无变更时回退到分支比较,通过 earlyReturn 提前终止。
|
|
30
|
+
*/
|
|
31
|
+
export interface LocalFilesResult {
|
|
32
|
+
changedFiles: ChangedFile[];
|
|
33
|
+
isLocalMode: boolean;
|
|
34
|
+
effectiveBaseRef?: string;
|
|
35
|
+
effectiveHeadRef?: string;
|
|
36
|
+
earlyReturn?: {
|
|
37
|
+
commits: PullRequestCommit[];
|
|
38
|
+
changedFiles: ChangedFile[];
|
|
39
|
+
headSha: string;
|
|
40
|
+
isLocalMode: boolean;
|
|
41
|
+
earlyReturn: ReviewResult;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* resolvePrData 的返回类型。
|
|
47
|
+
* PR 模式获取到的数据,含可选的 earlyReturn(重复 workflow 检测时触发)。
|
|
48
|
+
*/
|
|
49
|
+
export interface PrDataResult {
|
|
50
|
+
prModel: PullRequestModel;
|
|
51
|
+
commits: PullRequestCommit[];
|
|
52
|
+
changedFiles: ChangedFile[];
|
|
53
|
+
headSha?: string;
|
|
54
|
+
earlyReturn?: ReviewResult;
|
|
55
|
+
}
|