claude-spp 0.1.1 → 0.1.2
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/dist/cli.js +5 -2
- package/dist/cli.js.map +1 -1
- package/dist/config/schema.d.ts +8 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +7 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/git/history.d.ts +3 -51
- package/dist/git/history.d.ts.map +1 -1
- package/dist/git/history.js +6 -366
- package/dist/git/history.js.map +1 -1
- package/dist/hooks/system-prompt.js +2 -2
- package/dist/hooks/system-prompt.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +13 -3
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +118 -40
- package/dist/init.js.map +1 -1
- package/dist/stats.js +1 -1
- package/dist/stats.js.map +1 -1
- package/dist/vcs/git-provider.d.ts +31 -0
- package/dist/vcs/git-provider.d.ts.map +1 -0
- package/dist/vcs/git-provider.js +311 -0
- package/dist/vcs/git-provider.js.map +1 -0
- package/dist/vcs/hg-provider.d.ts +31 -0
- package/dist/vcs/hg-provider.d.ts.map +1 -0
- package/dist/vcs/hg-provider.js +347 -0
- package/dist/vcs/hg-provider.js.map +1 -0
- package/dist/vcs/hooks/hg-post-commit +7 -0
- package/dist/vcs/index.d.ts +37 -0
- package/dist/vcs/index.d.ts.map +1 -0
- package/dist/vcs/index.js +76 -0
- package/dist/vcs/index.js.map +1 -0
- package/dist/vcs/types.d.ts +107 -0
- package/dist/vcs/types.d.ts.map +1 -0
- package/dist/vcs/types.js +13 -0
- package/dist/vcs/types.js.map +1 -0
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Command } from "commander";
|
|
|
3
3
|
import { runPreToolUseHook } from "./hooks/pre-tool-use.js";
|
|
4
4
|
import { generateSystemPrompt } from "./hooks/system-prompt.js";
|
|
5
5
|
import { initializeSpp, isFullyInitialized, promptUser } from "./init.js";
|
|
6
|
-
import { getHeadCommitHash } from "./
|
|
6
|
+
import { getHeadCommitHash } from "./vcs/index.js";
|
|
7
7
|
import { loadConfig, saveConfig } from "./config/loader.js";
|
|
8
8
|
import { getCurrentMode, getModeByNumber, getModeByName, MODES } from "./config/schema.js";
|
|
9
9
|
import { getStats, formatStats } from "./stats.js";
|
|
@@ -32,11 +32,14 @@ program
|
|
|
32
32
|
const config = await initializeSpp(process.cwd(), modeNum);
|
|
33
33
|
saveConfig(process.cwd(), config);
|
|
34
34
|
const currentMode = getCurrentMode(config);
|
|
35
|
+
const vcsType = config.vcsType ?? "git";
|
|
36
|
+
const hookPath = vcsType === "git" ? ".git/hooks/post-commit" : ".hg/hgrc [hooks]";
|
|
35
37
|
console.log("");
|
|
36
38
|
console.log(`✅ SPP initialized with mode ${currentMode.number}: ${currentMode.name}`);
|
|
37
39
|
console.log(`${currentMode.description}`);
|
|
38
40
|
console.log(`Install directory: .claude-spp/`);
|
|
39
|
-
console.log(`
|
|
41
|
+
console.log(`VCS: ${vcsType}`);
|
|
42
|
+
console.log(`Hook: ${hookPath}\n`);
|
|
40
43
|
console.log("Analyzing repo...");
|
|
41
44
|
const stats = getStats(process.cwd());
|
|
42
45
|
console.log(formatStats(stats));
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAsB,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|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CAAC,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,UAAU,EAAE,CAAC"}
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -30,6 +30,11 @@ export type StatsWindow = z.infer<typeof StatsWindowSchema>;
|
|
|
30
30
|
*/
|
|
31
31
|
export declare const TrackingModeSchema: z.ZodEnum<["commits", "lines"]>;
|
|
32
32
|
export type TrackingMode = z.infer<typeof TrackingModeSchema>;
|
|
33
|
+
/**
|
|
34
|
+
* VCS type options
|
|
35
|
+
*/
|
|
36
|
+
export declare const VcsTypeSchema: z.ZodEnum<["git", "hg"]>;
|
|
37
|
+
export type VcsType = z.infer<typeof VcsTypeSchema>;
|
|
33
38
|
/**
|
|
34
39
|
* Human-readable labels for tracking modes
|
|
35
40
|
*/
|
|
@@ -53,6 +58,7 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
53
58
|
trackingMode: z.ZodDefault<z.ZodEnum<["commits", "lines"]>>;
|
|
54
59
|
pausedUntil: z.ZodOptional<z.ZodString>;
|
|
55
60
|
trackingStartCommit: z.ZodOptional<z.ZodString>;
|
|
61
|
+
vcsType: z.ZodOptional<z.ZodEnum<["git", "hg"]>>;
|
|
56
62
|
}, "strip", z.ZodTypeAny, {
|
|
57
63
|
enabled: boolean;
|
|
58
64
|
mode: number;
|
|
@@ -60,6 +66,7 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
60
66
|
trackingMode: "commits" | "lines";
|
|
61
67
|
pausedUntil?: string | undefined;
|
|
62
68
|
trackingStartCommit?: string | undefined;
|
|
69
|
+
vcsType?: "git" | "hg" | undefined;
|
|
63
70
|
}, {
|
|
64
71
|
enabled?: boolean | undefined;
|
|
65
72
|
mode?: number | undefined;
|
|
@@ -67,6 +74,7 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
67
74
|
trackingMode?: "commits" | "lines" | undefined;
|
|
68
75
|
pausedUntil?: string | undefined;
|
|
69
76
|
trackingStartCommit?: string | undefined;
|
|
77
|
+
vcsType?: "git" | "hg" | undefined;
|
|
70
78
|
}>;
|
|
71
79
|
export type Config = z.infer<typeof ConfigSchema>;
|
|
72
80
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,IAAI,EAMvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAE7D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAE5D;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,6CAA2C,CAAC;AAC1E,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,kBAAkB,iCAA+B,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAG7D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAI3D,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,IA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E;AAED;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;EAuBvB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAK5B,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEnD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIxD"}
|
package/dist/config/schema.js
CHANGED
|
@@ -29,6 +29,10 @@ export const StatsWindowSchema = z.enum(["oneDay", "oneWeek", "allTime"]);
|
|
|
29
29
|
* Tracking mode options - what to count for ratio calculation
|
|
30
30
|
*/
|
|
31
31
|
export const TrackingModeSchema = z.enum(["commits", "lines"]);
|
|
32
|
+
/**
|
|
33
|
+
* VCS type options
|
|
34
|
+
*/
|
|
35
|
+
export const VcsTypeSchema = z.enum(["git", "hg"]);
|
|
32
36
|
/**
|
|
33
37
|
* Human-readable labels for tracking modes
|
|
34
38
|
*/
|
|
@@ -73,10 +77,12 @@ export const ConfigSchema = z.object({
|
|
|
73
77
|
trackingMode: TrackingModeSchema.default("commits"),
|
|
74
78
|
// ISO timestamp when SPP pause expires (set by pause command)
|
|
75
79
|
pausedUntil: z.string().optional(),
|
|
76
|
-
//
|
|
80
|
+
// VCS commit hash of the last commit to exclude from tracking
|
|
77
81
|
// Set to the 10th commit hash once we reach MIN_COMMITS_FOR_TRACKING
|
|
78
82
|
// Stats only include commits after this one
|
|
79
83
|
trackingStartCommit: z.string().optional(),
|
|
84
|
+
// VCS type (git or hg) - auto-detected if not set
|
|
85
|
+
vcsType: VcsTypeSchema.optional(),
|
|
80
86
|
});
|
|
81
87
|
/**
|
|
82
88
|
* Default configuration values
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources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@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
export interface LineCounts {
|
|
5
|
-
humanLines: number;
|
|
6
|
-
claudeLines: number;
|
|
7
|
-
humanCommits: number;
|
|
8
|
-
claudeCommits: number;
|
|
9
|
-
fromCache: boolean;
|
|
10
|
-
commitsScanned: number;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Get the current HEAD commit hash (exported version)
|
|
14
|
-
*/
|
|
15
|
-
export declare function getHeadCommitHash(projectPath: string): string | null;
|
|
16
|
-
/**
|
|
17
|
-
* Get total number of commits in the repo
|
|
18
|
-
*/
|
|
19
|
-
export declare function getTotalCommitCount(projectPath: string): number;
|
|
20
|
-
/**
|
|
21
|
-
* Commit info for display
|
|
22
|
-
*/
|
|
23
|
-
export interface CommitInfo {
|
|
24
|
-
shortHash: string;
|
|
25
|
-
title: string;
|
|
26
|
-
date: Date;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Get info about a specific commit
|
|
30
|
-
* Returns null if the commit doesn't exist
|
|
31
|
-
*/
|
|
32
|
-
export declare function getCommitInfo(projectPath: string, commitHash: string): CommitInfo | null;
|
|
33
|
-
/**
|
|
34
|
-
* Get the hash of the Nth commit (1-indexed, chronological order)
|
|
35
|
-
* Returns null if there aren't enough commits
|
|
2
|
+
* Backward compatibility re-exports from VCS module
|
|
3
|
+
* @deprecated Import from "../vcs/index.js" instead
|
|
36
4
|
*/
|
|
5
|
+
export { getLineCounts, getLineCountsWithWindow, getHeadCommitHash, getTotalCommitCount, getCommitInfo, clearCache, type LineCounts, type CommitInfo, } from "../vcs/index.js";
|
|
37
6
|
export declare function getNthCommitHash(projectPath: string, n: number): string | null;
|
|
38
|
-
/**
|
|
39
|
-
* Clear the cache
|
|
40
|
-
*/
|
|
41
|
-
export declare function clearCache(projectPath: string): void;
|
|
42
|
-
/**
|
|
43
|
-
* Calculate line counts from git history with caching
|
|
44
|
-
*/
|
|
45
|
-
export declare function getLineCounts(projectPath: string): LineCounts;
|
|
46
|
-
/**
|
|
47
|
-
* Get line counts with optional filters
|
|
48
|
-
* @param since If null, no time filter. If Date, filters commits after this date.
|
|
49
|
-
* @param afterCommit If provided, only includes commits after this commit hash (exclusive).
|
|
50
|
-
*/
|
|
51
|
-
export declare function getLineCountsWithWindow(projectPath: string, options: {
|
|
52
|
-
since: Date | null;
|
|
53
|
-
afterCommit?: string | null;
|
|
54
|
-
}): LineCounts;
|
|
55
7
|
//# sourceMappingURL=history.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/git/history.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/git/history.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC;AAKzB,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM9E"}
|
package/dist/git/history.js
CHANGED
|
@@ -1,376 +1,16 @@
|
|
|
1
|
-
import * as fs from "node:fs";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { execSync } from "node:child_process";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
const CACHE_FILE = ".claude-spp/.git_history_cache.json";
|
|
6
1
|
/**
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
const GitHistoryCacheSchema = z.object({
|
|
10
|
-
userEmail: z.string(),
|
|
11
|
-
lastCommit: z.string(),
|
|
12
|
-
humanLines: z.number().int().min(0),
|
|
13
|
-
claudeLines: z.number().int().min(0),
|
|
14
|
-
humanCommits: z.number().int().min(0),
|
|
15
|
-
claudeCommits: z.number().int().min(0),
|
|
16
|
-
});
|
|
17
|
-
/**
|
|
18
|
-
* Check if we're in a git repository
|
|
19
|
-
*/
|
|
20
|
-
function isGitRepo(projectPath) {
|
|
21
|
-
try {
|
|
22
|
-
execSync("git rev-parse --git-dir", { cwd: projectPath, stdio: "ignore" });
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Get the current HEAD commit hash
|
|
31
|
-
*/
|
|
32
|
-
function getHeadCommit(projectPath) {
|
|
33
|
-
try {
|
|
34
|
-
return execSync("git rev-parse HEAD", {
|
|
35
|
-
cwd: projectPath,
|
|
36
|
-
encoding: "utf-8",
|
|
37
|
-
}).trim();
|
|
38
|
-
}
|
|
39
|
-
catch {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Get the current HEAD commit hash (exported version)
|
|
45
|
-
*/
|
|
46
|
-
export function getHeadCommitHash(projectPath) {
|
|
47
|
-
return getHeadCommit(projectPath);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Get total number of commits in the repo
|
|
51
|
-
*/
|
|
52
|
-
export function getTotalCommitCount(projectPath) {
|
|
53
|
-
try {
|
|
54
|
-
const output = execSync("git rev-list --count HEAD", {
|
|
55
|
-
cwd: projectPath,
|
|
56
|
-
encoding: "utf-8",
|
|
57
|
-
});
|
|
58
|
-
return parseInt(output.trim(), 10) || 0;
|
|
59
|
-
}
|
|
60
|
-
catch {
|
|
61
|
-
return 0;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Get info about a specific commit
|
|
66
|
-
* Returns null if the commit doesn't exist
|
|
67
|
-
*/
|
|
68
|
-
export function getCommitInfo(projectPath, commitHash) {
|
|
69
|
-
// Format: short hash, subject (title), ISO date
|
|
70
|
-
const output = execSync(`git log -1 --format="%h%x00%s%x00%cI" ${commitHash}`, {
|
|
71
|
-
cwd: projectPath,
|
|
72
|
-
encoding: "utf-8",
|
|
73
|
-
}).trim();
|
|
74
|
-
if (!output) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
const [shortHash, title, dateStr] = output.split("\0");
|
|
78
|
-
return {
|
|
79
|
-
shortHash,
|
|
80
|
-
title,
|
|
81
|
-
date: new Date(dateStr),
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Get the hash of the Nth commit (1-indexed, chronological order)
|
|
86
|
-
* Returns null if there aren't enough commits
|
|
2
|
+
* Backward compatibility re-exports from VCS module
|
|
3
|
+
* @deprecated Import from "../vcs/index.js" instead
|
|
87
4
|
*/
|
|
5
|
+
export { getLineCounts, getLineCountsWithWindow, getHeadCommitHash, getTotalCommitCount, getCommitInfo, clearCache, } from "../vcs/index.js";
|
|
6
|
+
// Also export the getNthCommitHash function for backward compatibility
|
|
7
|
+
import { getProvider } from "../vcs/index.js";
|
|
88
8
|
export function getNthCommitHash(projectPath, n) {
|
|
89
9
|
try {
|
|
90
|
-
|
|
91
|
-
const output = execSync(`git rev-list --reverse HEAD`, {
|
|
92
|
-
cwd: projectPath,
|
|
93
|
-
encoding: "utf-8",
|
|
94
|
-
});
|
|
95
|
-
const commits = output.trim().split("\n").filter(Boolean);
|
|
96
|
-
if (commits.length >= n) {
|
|
97
|
-
return commits[n - 1]; // n is 1-indexed
|
|
98
|
-
}
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Check if a commit is an ancestor of HEAD
|
|
107
|
-
*/
|
|
108
|
-
function isAncestor(projectPath, commit) {
|
|
109
|
-
try {
|
|
110
|
-
execSync(`git merge-base --is-ancestor ${commit} HEAD`, {
|
|
111
|
-
cwd: projectPath,
|
|
112
|
-
stdio: "ignore",
|
|
113
|
-
});
|
|
114
|
-
return true;
|
|
115
|
-
}
|
|
116
|
-
catch {
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Get the cache file path
|
|
122
|
-
*/
|
|
123
|
-
function getCachePath(projectPath) {
|
|
124
|
-
return path.join(projectPath, CACHE_FILE);
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Load cache from file
|
|
128
|
-
*/
|
|
129
|
-
function loadCache(projectPath) {
|
|
130
|
-
const cachePath = getCachePath(projectPath);
|
|
131
|
-
if (!fs.existsSync(cachePath)) {
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
try {
|
|
135
|
-
const raw = fs.readFileSync(cachePath, "utf-8");
|
|
136
|
-
const json = JSON.parse(raw);
|
|
137
|
-
return GitHistoryCacheSchema.parse(json);
|
|
10
|
+
return getProvider(projectPath).getNthCommitHash(projectPath, n);
|
|
138
11
|
}
|
|
139
12
|
catch {
|
|
140
13
|
return null;
|
|
141
14
|
}
|
|
142
15
|
}
|
|
143
|
-
/**
|
|
144
|
-
* Save cache to file
|
|
145
|
-
*/
|
|
146
|
-
function saveCache(projectPath, cache) {
|
|
147
|
-
const cachePath = getCachePath(projectPath);
|
|
148
|
-
const sppDir = path.dirname(cachePath);
|
|
149
|
-
if (!fs.existsSync(sppDir)) {
|
|
150
|
-
fs.mkdirSync(sppDir, { recursive: true });
|
|
151
|
-
}
|
|
152
|
-
fs.writeFileSync(cachePath, JSON.stringify(cache, null, 2) + "\n", "utf-8");
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Clear the cache
|
|
156
|
-
*/
|
|
157
|
-
export function clearCache(projectPath) {
|
|
158
|
-
const cachePath = getCachePath(projectPath);
|
|
159
|
-
if (fs.existsSync(cachePath)) {
|
|
160
|
-
fs.unlinkSync(cachePath);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Parse a commit to get line counts and attribution
|
|
165
|
-
*/
|
|
166
|
-
function parseCommit(projectPath, commitHash, parentHash) {
|
|
167
|
-
// Check if commit is co-authored by Claude
|
|
168
|
-
const message = execSync(`git log -1 --format="%B" ${commitHash}`, {
|
|
169
|
-
cwd: projectPath,
|
|
170
|
-
encoding: "utf-8",
|
|
171
|
-
});
|
|
172
|
-
const isClaude = /Co-Authored-By:.*Claude/i.test(message);
|
|
173
|
-
// Get lines added in this commit
|
|
174
|
-
let linesAdded = 0;
|
|
175
|
-
let linesDeleted = 0;
|
|
176
|
-
try {
|
|
177
|
-
let diffCmd;
|
|
178
|
-
if (parentHash) {
|
|
179
|
-
diffCmd = `git diff --numstat ${parentHash} ${commitHash}`;
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
// First commit - diff against empty tree
|
|
183
|
-
diffCmd = `git diff --numstat 4b825dc642cb6eb9a060e54bf8d69288fbee4904 ${commitHash}`;
|
|
184
|
-
}
|
|
185
|
-
const numstat = execSync(diffCmd, {
|
|
186
|
-
cwd: projectPath,
|
|
187
|
-
encoding: "utf-8",
|
|
188
|
-
});
|
|
189
|
-
// Parse numstat output: "added\tdeleted\tfilename"
|
|
190
|
-
for (const line of numstat.split("\n")) {
|
|
191
|
-
if (!line.trim())
|
|
192
|
-
continue;
|
|
193
|
-
const parts = line.split("\t");
|
|
194
|
-
if (parts.length >= 2) {
|
|
195
|
-
const added = parseInt(parts[0], 10);
|
|
196
|
-
const deleted = parseInt(parts[1], 10);
|
|
197
|
-
if (!isNaN(added)) {
|
|
198
|
-
linesAdded += added;
|
|
199
|
-
}
|
|
200
|
-
if (!isNaN(deleted)) {
|
|
201
|
-
linesDeleted += deleted;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
catch {
|
|
207
|
-
// Ignore errors (e.g., binary files)
|
|
208
|
-
}
|
|
209
|
-
return {
|
|
210
|
-
humanLines: isClaude ? 0 : linesAdded + linesDeleted,
|
|
211
|
-
claudeLines: isClaude ? linesAdded + linesDeleted : 0,
|
|
212
|
-
isClaudeCommit: isClaude,
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
function getCurrentGitUser(projectPath) {
|
|
216
|
-
const gitUser = execSync("git config user.email", {
|
|
217
|
-
cwd: projectPath,
|
|
218
|
-
encoding: "utf-8",
|
|
219
|
-
}).trim();
|
|
220
|
-
if (!gitUser) {
|
|
221
|
-
throw new Error("git user.email is not set.");
|
|
222
|
-
}
|
|
223
|
-
return gitUser;
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Get commit hashes from startCommit (exclusive) to endCommit (inclusive)
|
|
227
|
-
* Returns array of { hash, parent } objects, oldest first
|
|
228
|
-
* @param since Optional date to filter commits (git --since flag)
|
|
229
|
-
*/
|
|
230
|
-
function getCommitRange(projectPath, startCommit, endCommit, since) {
|
|
231
|
-
try {
|
|
232
|
-
const range = startCommit ? `${startCommit}..${endCommit}` : endCommit;
|
|
233
|
-
// Build git log command with optional --since flag
|
|
234
|
-
const sinceArg = since ? `--since="${since.toISOString()}"` : "";
|
|
235
|
-
const userEmail = getCurrentGitUser(projectPath);
|
|
236
|
-
const authorArg = userEmail ? `--author="${userEmail}"` : "";
|
|
237
|
-
const cmd = `git log --reverse --format="%H %P" ${authorArg} ${sinceArg} ${range}`.trim();
|
|
238
|
-
// Get commits with their parents
|
|
239
|
-
const output = execSync(cmd, {
|
|
240
|
-
cwd: projectPath,
|
|
241
|
-
encoding: "utf-8",
|
|
242
|
-
});
|
|
243
|
-
const commits = [];
|
|
244
|
-
for (const line of output.split("\n")) {
|
|
245
|
-
if (!line.trim())
|
|
246
|
-
continue;
|
|
247
|
-
const parts = line.trim().split(" ");
|
|
248
|
-
const hash = parts[0];
|
|
249
|
-
const parent = parts[1] || null;
|
|
250
|
-
commits.push({ hash, parent });
|
|
251
|
-
}
|
|
252
|
-
return commits;
|
|
253
|
-
}
|
|
254
|
-
catch {
|
|
255
|
-
return [];
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Calculate line counts from git history with caching
|
|
260
|
-
*/
|
|
261
|
-
export function getLineCounts(projectPath) {
|
|
262
|
-
// Default result for non-git repos
|
|
263
|
-
if (!isGitRepo(projectPath)) {
|
|
264
|
-
throw new Error("Must be a git repo");
|
|
265
|
-
}
|
|
266
|
-
const head = getHeadCommit(projectPath);
|
|
267
|
-
if (!head) {
|
|
268
|
-
throw new Error("Head commit not found");
|
|
269
|
-
}
|
|
270
|
-
const currentGitUser = getCurrentGitUser(projectPath);
|
|
271
|
-
// Try to load cache
|
|
272
|
-
const cache = loadCache(projectPath);
|
|
273
|
-
// Check if cache is valid and up to date
|
|
274
|
-
if (cache && cache.lastCommit === head && cache.userEmail === currentGitUser) {
|
|
275
|
-
return {
|
|
276
|
-
humanLines: cache.humanLines,
|
|
277
|
-
claudeLines: cache.claudeLines,
|
|
278
|
-
humanCommits: cache.humanCommits,
|
|
279
|
-
claudeCommits: cache.claudeCommits,
|
|
280
|
-
fromCache: true,
|
|
281
|
-
commitsScanned: 0,
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
// Check if cache is valid but needs incremental update
|
|
285
|
-
let startCommit = null;
|
|
286
|
-
let humanLines = 0;
|
|
287
|
-
let claudeLines = 0;
|
|
288
|
-
let humanCommits = 0;
|
|
289
|
-
let claudeCommits = 0;
|
|
290
|
-
if (cache && cache.userEmail === currentGitUser && isAncestor(projectPath, cache.lastCommit)) {
|
|
291
|
-
// Cache is valid, start from there
|
|
292
|
-
startCommit = cache.lastCommit;
|
|
293
|
-
humanLines = cache.humanLines;
|
|
294
|
-
claudeLines = cache.claudeLines;
|
|
295
|
-
humanCommits = cache.humanCommits;
|
|
296
|
-
claudeCommits = cache.claudeCommits;
|
|
297
|
-
}
|
|
298
|
-
// Get commits to process
|
|
299
|
-
const commits = getCommitRange(projectPath, startCommit, head);
|
|
300
|
-
// Process each commit
|
|
301
|
-
for (const { hash, parent } of commits) {
|
|
302
|
-
const result = parseCommit(projectPath, hash, parent);
|
|
303
|
-
humanLines += result.humanLines;
|
|
304
|
-
claudeLines += result.claudeLines;
|
|
305
|
-
if (result.isClaudeCommit) {
|
|
306
|
-
claudeCommits++;
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
humanCommits++;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
// Save updated cache
|
|
313
|
-
saveCache(projectPath, {
|
|
314
|
-
userEmail: currentGitUser,
|
|
315
|
-
lastCommit: head,
|
|
316
|
-
humanLines,
|
|
317
|
-
claudeLines,
|
|
318
|
-
humanCommits,
|
|
319
|
-
claudeCommits,
|
|
320
|
-
});
|
|
321
|
-
return {
|
|
322
|
-
humanLines,
|
|
323
|
-
claudeLines,
|
|
324
|
-
humanCommits,
|
|
325
|
-
claudeCommits,
|
|
326
|
-
fromCache: false,
|
|
327
|
-
commitsScanned: commits.length,
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Get line counts with optional filters
|
|
332
|
-
* @param since If null, no time filter. If Date, filters commits after this date.
|
|
333
|
-
* @param afterCommit If provided, only includes commits after this commit hash (exclusive).
|
|
334
|
-
*/
|
|
335
|
-
export function getLineCountsWithWindow(projectPath, options) {
|
|
336
|
-
// If no filters at all, use the cached version
|
|
337
|
-
if (options.since === null && !options.afterCommit) {
|
|
338
|
-
return getLineCounts(projectPath);
|
|
339
|
-
}
|
|
340
|
-
// Filtered query bypasses cache
|
|
341
|
-
if (!isGitRepo(projectPath)) {
|
|
342
|
-
throw new Error("Must be a git repo");
|
|
343
|
-
}
|
|
344
|
-
const head = getHeadCommit(projectPath);
|
|
345
|
-
if (!head) {
|
|
346
|
-
throw new Error("Head commit not found");
|
|
347
|
-
}
|
|
348
|
-
// Get commits with optional start commit filter
|
|
349
|
-
const startCommit = options.afterCommit ?? null;
|
|
350
|
-
const commits = getCommitRange(projectPath, startCommit, head, options.since ?? undefined);
|
|
351
|
-
let humanLines = 0;
|
|
352
|
-
let claudeLines = 0;
|
|
353
|
-
let humanCommits = 0;
|
|
354
|
-
let claudeCommits = 0;
|
|
355
|
-
// Process each commit
|
|
356
|
-
for (const { hash, parent } of commits) {
|
|
357
|
-
const result = parseCommit(projectPath, hash, parent);
|
|
358
|
-
humanLines += result.humanLines;
|
|
359
|
-
claudeLines += result.claudeLines;
|
|
360
|
-
if (result.isClaudeCommit) {
|
|
361
|
-
claudeCommits++;
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
humanCommits++;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
return {
|
|
368
|
-
humanLines,
|
|
369
|
-
claudeLines,
|
|
370
|
-
humanCommits,
|
|
371
|
-
claudeCommits,
|
|
372
|
-
fromCache: false,
|
|
373
|
-
commitsScanned: commits.length,
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
16
|
//# sourceMappingURL=history.js.map
|
package/dist/git/history.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/git/history.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/git/history.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,UAAU,GAGX,MAAM,iBAAiB,CAAC;AAEzB,uEAAuE;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,UAAU,gBAAgB,CAAC,WAAmB,EAAE,CAAS;IAC7D,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,WAAW,CAAC,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loadConfig, isSppInitialized } from "../config/loader.js";
|
|
2
2
|
import { calculateRatio, isRatioHealthy } from "../stats.js";
|
|
3
3
|
import { getEffectiveRatio, getCurrentMode } from "../config/schema.js";
|
|
4
|
-
import { getLineCounts } from "../
|
|
4
|
+
import { getLineCounts } from "../vcs/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* Calculate how many more commits/lines the human needs to reach the target ratio
|
|
7
7
|
*/
|
|
@@ -50,7 +50,7 @@ export function generateSystemPrompt(projectPath) {
|
|
|
50
50
|
`- **Status:** ${isHealthy ? "✅ Healthy" : "⚠️ Below target"}`,
|
|
51
51
|
"",
|
|
52
52
|
"A note on SPP tracking:",
|
|
53
|
-
"SPP tracks commits in git
|
|
53
|
+
"SPP tracks commits in VCS history (git or mercurial), within a window and/or after a starting commit.",
|
|
54
54
|
"Commits that include 'Co-authored by: Claude...' in the message are counted as Claude commits.",
|
|
55
55
|
"Commits without that phrase are counted as human commits.",
|
|
56
56
|
"Therefore, if asked to commit human authored code, don't include the 'Co-authored by: Claude...' phrase",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/hooks/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/hooks/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAqB,MAA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A8B,MAAM,SAAS,IAAI,oCAAoC,CAAC,CAAC;QAClG,KAAK,CAAC,IAAI,CAAC,gEAAgE,CAAC,CAAC;QAC7E,KAAK,CAAC,IAAI,CAAC,mGAAmG,CAAC,CAAC;IAClH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAErB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,MAAM,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAEvC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;IAC9C,MAAM,YAAY,GAAG,cAAc,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACnF,MAAM,WAAW,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,cAAc,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAE7F,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IACtC,OAAO,QAAQ,MAAM,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;AACxG,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { loadConfig, saveConfig, isSppInitialized, getSppDir } from "./config/loader.js";
|
|
2
2
|
export { ConfigSchema, DEFAULT_CONFIG, getEffectiveRatio, type Config, } from "./config/schema.js";
|
|
3
3
|
export { calculateRatio, isRatioHealthy, } from "./stats.js";
|
|
4
|
-
export { getLineCounts, clearCache, type LineCounts, } from "./
|
|
4
|
+
export { getLineCounts, clearCache, getProvider, type LineCounts, type VcsType, type VcsProvider, } from "./vcs/index.js";
|
|
5
5
|
export { initializeSpp, isFullyInitialized, ensureInitialized } from "./init.js";
|
|
6
6
|
export { getStats, formatStats, type StatsResult } from "./stats.js";
|
|
7
7
|
export { generateSystemPrompt, generateStatusLine } from "./hooks/system-prompt.js";
|