@devflow-tools/plugin-git 0.12.6 → 0.13.1

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.
@@ -0,0 +1,20 @@
1
+ export declare function analyzeRepo(params: {
2
+ projectRoot: string;
3
+ }): Promise<{
4
+ success: boolean;
5
+ summary: string;
6
+ findings: {
7
+ severity: "info";
8
+ category: string;
9
+ title: string;
10
+ description: string;
11
+ }[];
12
+ data: {
13
+ currentBranch: string;
14
+ changedFiles: number;
15
+ status: string;
16
+ recentCommits: string[];
17
+ suggestion: string;
18
+ };
19
+ }>;
20
+ //# sourceMappingURL=analyze-repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-repo.d.ts","sourceRoot":"","sources":["../../src/analyzers/analyze-repo.ts"],"names":[],"mappings":"AAEA,wBAAsB,WAAW,CAAC,MAAM,EAAE;IACxC,WAAW,EAAE,MAAM,CAAC;CACrB;;;;;;;;;;;;;;;;GAuCA"}
@@ -0,0 +1,39 @@
1
+ import { execSync } from 'child_process';
2
+ export async function analyzeRepo(params) {
3
+ const cwd = params.projectRoot || process.cwd();
4
+ let branch = 'unknown';
5
+ let status = '';
6
+ let recentCommits = [];
7
+ try {
8
+ branch = execSync('git branch --show-current', { cwd, encoding: 'utf-8', timeout: 5000 }).trim();
9
+ status = execSync('git status --short', { cwd, encoding: 'utf-8', timeout: 5000 }).trim();
10
+ recentCommits = execSync('git log --oneline -5', { cwd, encoding: 'utf-8', timeout: 5000 })
11
+ .trim().split('\n').filter(Boolean);
12
+ }
13
+ catch {
14
+ // Git commands may fail outside a repo
15
+ }
16
+ const changedFiles = status ? status.split('\n').length : 0;
17
+ return {
18
+ success: true,
19
+ summary: changedFiles > 0
20
+ ? `${branch} 上有 ${changedFiles} 个变更文件`
21
+ : `${branch} 工作区干净`,
22
+ findings: changedFiles > 0 ? [{
23
+ severity: 'info',
24
+ category: 'git-working-tree',
25
+ title: '工作区存在未提交变更',
26
+ description: `${changedFiles} modified files on ${branch}. Consider committing or stashing.`,
27
+ }] : [],
28
+ data: {
29
+ currentBranch: branch,
30
+ changedFiles,
31
+ status: status || 'clean',
32
+ recentCommits,
33
+ suggestion: changedFiles > 0
34
+ ? `${changedFiles} modified files on ${branch}. Consider committing or stashing.`
35
+ : `On ${branch}, working tree clean.`,
36
+ },
37
+ };
38
+ }
39
+ //# sourceMappingURL=analyze-repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-repo.js","sourceRoot":"","sources":["../../src/analyzers/analyze-repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAEjC;IACC,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAEhD,IAAI,MAAM,GAAG,SAAS,CAAC;IACvB,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,aAAa,GAAa,EAAE,CAAC;IAEjC,IAAI,CAAC;QACH,MAAM,GAAG,QAAQ,CAAC,2BAA2B,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACjG,MAAM,GAAG,QAAQ,CAAC,oBAAoB,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1F,aAAa,GAAG,QAAQ,CAAC,sBAAsB,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;aACxF,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,uCAAuC;IACzC,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5D,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,YAAY,GAAG,CAAC;YACvB,CAAC,CAAC,GAAG,MAAM,OAAO,YAAY,QAAQ;YACtC,CAAC,CAAC,GAAG,MAAM,QAAQ;QACrB,QAAQ,EAAE,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC5B,QAAQ,EAAE,MAAe;gBACzB,QAAQ,EAAE,kBAAkB;gBAC5B,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,GAAG,YAAY,sBAAsB,MAAM,oCAAoC;aAC7F,CAAC,CAAC,CAAC,CAAC,EAAE;QACP,IAAI,EAAE;YACJ,aAAa,EAAE,MAAM;YACrB,YAAY;YACZ,MAAM,EAAE,MAAM,IAAI,OAAO;YACzB,aAAa;YACb,UAAU,EAAE,YAAY,GAAG,CAAC;gBAC1B,CAAC,CAAC,GAAG,YAAY,sBAAsB,MAAM,oCAAoC;gBACjF,CAAC,CAAC,MAAM,MAAM,uBAAuB;SACxC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface ProjectContext {
2
+ projectRoot: string;
3
+ branchName?: string;
4
+ }
5
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/analyzers/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/analyzers/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { DevFlowPlugin } from "@devflow-tools/sdk";
2
+ export declare const gitPlugin: DevFlowPlugin;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAYxD,eAAO,MAAM,SAAS,EAAE,aA2mCvB,CAAC"}