vibedrift-shared 0.1.3
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/claude-parser.d.ts +30 -0
- package/dist/claude-parser.d.ts.map +1 -0
- package/dist/claude-parser.js +222 -0
- package/dist/claude-parser.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/payload-builder.d.ts +8 -0
- package/dist/payload-builder.d.ts.map +1 -0
- package/dist/payload-builder.js +182 -0
- package/dist/payload-builder.js.map +1 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +33 -0
- package/dist/types.js.map +1 -0
- package/package.json +20 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SessionStats } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Encode a filesystem path to match Claude's project directory naming.
|
|
4
|
+
* e.g. /Users/foo/Dev -> -Users-foo-Dev
|
|
5
|
+
*/
|
|
6
|
+
export declare function encodeProjectPath(projectPath: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Find all Claude project directories that could match the given project path.
|
|
9
|
+
*/
|
|
10
|
+
export declare function findClaudeProjectDirs(projectPath: string): string[];
|
|
11
|
+
/**
|
|
12
|
+
* Get sessions from the index that overlap with the given time window.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getSessionsInWindow(projectDirs: string[], since: Date, until: Date): Array<{
|
|
15
|
+
sessionId: string;
|
|
16
|
+
fullPath: string;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Parse a single JSONL session file and count interactions within a time window.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseSessionFile(filePath: string, since: Date, until: Date): SessionStats | null;
|
|
22
|
+
/**
|
|
23
|
+
* Main entry point: parse all Claude sessions for a project within a time window.
|
|
24
|
+
* Returns aggregated stats and individual session details.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseClaudeSessions(projectPath: string, since: Date, until: Date): {
|
|
27
|
+
aggregate: SessionStats;
|
|
28
|
+
sessions: SessionStats[];
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=claude-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-parser.d.ts","sourceRoot":"","sources":["../src/claude-parser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAgB,MAAM,SAAS,CAAC;AAsErD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAgBnE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EAAE,EACrB,KAAK,EAAE,IAAI,EACX,KAAK,EAAE,IAAI,GACV,KAAK,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAgDhD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,IAAI,EACX,KAAK,EAAE,IAAI,GACV,YAAY,GAAG,IAAI,CA8ErB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,IAAI,EACX,KAAK,EAAE,IAAI,GACV;IAAE,SAAS,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,YAAY,EAAE,CAAA;CAAE,CAkCvD"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
function isCommand(content) {
|
|
4
|
+
const text = typeof content === "string" ? content : content.map((c) => c.text || "").join("");
|
|
5
|
+
return text.includes("<command-name>") || text.includes("<local-command");
|
|
6
|
+
}
|
|
7
|
+
function isSystemGenerated(content) {
|
|
8
|
+
const text = typeof content === "string"
|
|
9
|
+
? content
|
|
10
|
+
: content.map((c) => c.text || "").join("");
|
|
11
|
+
const trimmed = text.trim();
|
|
12
|
+
if (trimmed === "[Request interrupted by user]")
|
|
13
|
+
return true;
|
|
14
|
+
if (trimmed.startsWith("[Request interrupted by user for tool use]"))
|
|
15
|
+
return true;
|
|
16
|
+
if (trimmed.startsWith("Implement the following plan:"))
|
|
17
|
+
return true;
|
|
18
|
+
if (trimmed.startsWith("<task-notification>"))
|
|
19
|
+
return true;
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Strip the "[Request interrupted by user]" prefix from a message
|
|
24
|
+
* that also contains real user text (mid-processing interruption).
|
|
25
|
+
*/
|
|
26
|
+
function stripInterruptPrefix(text) {
|
|
27
|
+
const prefix = "[Request interrupted by user]";
|
|
28
|
+
if (text.startsWith(prefix)) {
|
|
29
|
+
return text.slice(prefix.length).trim();
|
|
30
|
+
}
|
|
31
|
+
return text;
|
|
32
|
+
}
|
|
33
|
+
function countToolUses(content) {
|
|
34
|
+
if (typeof content === "string")
|
|
35
|
+
return 0;
|
|
36
|
+
return content.filter((c) => c.type === "tool_use").length;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Encode a filesystem path to match Claude's project directory naming.
|
|
40
|
+
* e.g. /Users/foo/Dev -> -Users-foo-Dev
|
|
41
|
+
*/
|
|
42
|
+
export function encodeProjectPath(projectPath) {
|
|
43
|
+
return projectPath.replace(/\//g, "-");
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Find all Claude project directories that could match the given project path.
|
|
47
|
+
*/
|
|
48
|
+
export function findClaudeProjectDirs(projectPath) {
|
|
49
|
+
const claudeDir = path.join(process.env.HOME || process.env.USERPROFILE || "", ".claude", "projects");
|
|
50
|
+
if (!fs.existsSync(claudeDir))
|
|
51
|
+
return [];
|
|
52
|
+
const encoded = encodeProjectPath(projectPath);
|
|
53
|
+
const dirs = fs.readdirSync(claudeDir);
|
|
54
|
+
// Match exact or parent paths
|
|
55
|
+
return dirs
|
|
56
|
+
.filter((d) => encoded.startsWith(d) || d.startsWith(encoded))
|
|
57
|
+
.map((d) => path.join(claudeDir, d));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get sessions from the index that overlap with the given time window.
|
|
61
|
+
*/
|
|
62
|
+
export function getSessionsInWindow(projectDirs, since, until) {
|
|
63
|
+
const sessions = [];
|
|
64
|
+
for (const dir of projectDirs) {
|
|
65
|
+
const indexPath = path.join(dir, "sessions-index.json");
|
|
66
|
+
if (fs.existsSync(indexPath)) {
|
|
67
|
+
// Use the index for fast lookup
|
|
68
|
+
try {
|
|
69
|
+
const index = JSON.parse(fs.readFileSync(indexPath, "utf-8"));
|
|
70
|
+
for (const entry of index.entries) {
|
|
71
|
+
const created = new Date(entry.created);
|
|
72
|
+
const modified = new Date(entry.modified);
|
|
73
|
+
if (modified >= since && created <= until) {
|
|
74
|
+
const jsonlPath = entry.fullPath || path.join(dir, `${entry.sessionId}.jsonl`);
|
|
75
|
+
if (fs.existsSync(jsonlPath)) {
|
|
76
|
+
sessions.push({ sessionId: entry.sessionId, fullPath: jsonlPath });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// Skip malformed index files
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
// Fallback: scan .jsonl files directly when index is missing
|
|
87
|
+
try {
|
|
88
|
+
const files = fs.readdirSync(dir).filter((f) => f.endsWith(".jsonl"));
|
|
89
|
+
for (const file of files) {
|
|
90
|
+
const fullPath = path.join(dir, file);
|
|
91
|
+
const stat = fs.statSync(fullPath);
|
|
92
|
+
if (stat.mtimeMs >= since.getTime() && stat.birthtimeMs <= until.getTime()) {
|
|
93
|
+
const sessionId = file.replace(".jsonl", "");
|
|
94
|
+
sessions.push({ sessionId, fullPath });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
// Skip unreadable directories
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return sessions;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Parse a single JSONL session file and count interactions within a time window.
|
|
107
|
+
*/
|
|
108
|
+
export function parseSessionFile(filePath, since, until) {
|
|
109
|
+
if (!fs.existsSync(filePath))
|
|
110
|
+
return null;
|
|
111
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
112
|
+
const lines = content.split("\n").filter((l) => l.trim());
|
|
113
|
+
let aiResponses = 0;
|
|
114
|
+
let toolCalls = 0;
|
|
115
|
+
let startTime;
|
|
116
|
+
let endTime;
|
|
117
|
+
let sessionId = "";
|
|
118
|
+
const prompts = [];
|
|
119
|
+
for (const line of lines) {
|
|
120
|
+
let msg;
|
|
121
|
+
try {
|
|
122
|
+
msg = JSON.parse(line);
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
// Skip non-message entries (file-history-snapshot, summary, etc.)
|
|
128
|
+
if (!msg.type || msg.type === "file-history-snapshot" || msg.type === "summary") {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (msg.sessionId)
|
|
132
|
+
sessionId = msg.sessionId;
|
|
133
|
+
// Filter by time window
|
|
134
|
+
if (msg.timestamp) {
|
|
135
|
+
const ts = new Date(msg.timestamp);
|
|
136
|
+
if (ts < since || ts > until)
|
|
137
|
+
continue;
|
|
138
|
+
if (!startTime || ts.toISOString() < startTime)
|
|
139
|
+
startTime = ts.toISOString();
|
|
140
|
+
if (!endTime || ts.toISOString() > endTime)
|
|
141
|
+
endTime = ts.toISOString();
|
|
142
|
+
}
|
|
143
|
+
// Count user prompts: type=user, role=user, not meta, not commands
|
|
144
|
+
if (msg.type === "user" && msg.message?.role === "user") {
|
|
145
|
+
if (msg.isMeta)
|
|
146
|
+
continue;
|
|
147
|
+
if (msg.isSidechain)
|
|
148
|
+
continue;
|
|
149
|
+
if (msg.message.content && isCommand(msg.message.content))
|
|
150
|
+
continue;
|
|
151
|
+
if (msg.message.content && isSystemGenerated(msg.message.content))
|
|
152
|
+
continue;
|
|
153
|
+
const raw = typeof msg.message.content === "string"
|
|
154
|
+
? msg.message.content
|
|
155
|
+
: msg.message.content?.map((c) => c.text || "").join("") ?? "";
|
|
156
|
+
const trimmed = stripInterruptPrefix(raw.trim());
|
|
157
|
+
if (trimmed.length > 0) {
|
|
158
|
+
prompts.push({
|
|
159
|
+
text: trimmed.slice(0, 500),
|
|
160
|
+
timestamp: msg.timestamp || "",
|
|
161
|
+
sessionId,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// Count AI responses
|
|
166
|
+
if (msg.message?.role === "assistant") {
|
|
167
|
+
aiResponses++;
|
|
168
|
+
if (msg.message.content) {
|
|
169
|
+
toolCalls += countToolUses(msg.message.content);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const userPrompts = prompts.length;
|
|
174
|
+
if (userPrompts === 0 && aiResponses === 0)
|
|
175
|
+
return null;
|
|
176
|
+
return {
|
|
177
|
+
sessionId,
|
|
178
|
+
userPrompts,
|
|
179
|
+
aiResponses,
|
|
180
|
+
toolCalls,
|
|
181
|
+
totalInteractions: userPrompts + aiResponses,
|
|
182
|
+
startTime,
|
|
183
|
+
endTime,
|
|
184
|
+
prompts,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Main entry point: parse all Claude sessions for a project within a time window.
|
|
189
|
+
* Returns aggregated stats and individual session details.
|
|
190
|
+
*/
|
|
191
|
+
export function parseClaudeSessions(projectPath, since, until) {
|
|
192
|
+
const projectDirs = findClaudeProjectDirs(projectPath);
|
|
193
|
+
const sessionFiles = getSessionsInWindow(projectDirs, since, until);
|
|
194
|
+
const sessions = [];
|
|
195
|
+
let totalUserPrompts = 0;
|
|
196
|
+
let totalAiResponses = 0;
|
|
197
|
+
let totalToolCalls = 0;
|
|
198
|
+
for (const { fullPath } of sessionFiles) {
|
|
199
|
+
const stats = parseSessionFile(fullPath, since, until);
|
|
200
|
+
if (stats) {
|
|
201
|
+
sessions.push(stats);
|
|
202
|
+
totalUserPrompts += stats.userPrompts;
|
|
203
|
+
totalAiResponses += stats.aiResponses;
|
|
204
|
+
totalToolCalls += stats.toolCalls;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const allPrompts = sessions
|
|
208
|
+
.flatMap((s) => s.prompts ?? [])
|
|
209
|
+
.sort((a, b) => a.timestamp.localeCompare(b.timestamp));
|
|
210
|
+
return {
|
|
211
|
+
aggregate: {
|
|
212
|
+
sessionId: "aggregate",
|
|
213
|
+
userPrompts: totalUserPrompts,
|
|
214
|
+
aiResponses: totalAiResponses,
|
|
215
|
+
toolCalls: totalToolCalls,
|
|
216
|
+
totalInteractions: totalUserPrompts + totalAiResponses,
|
|
217
|
+
prompts: allPrompts,
|
|
218
|
+
},
|
|
219
|
+
sessions,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=claude-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-parser.js","sourceRoot":"","sources":["../src/claude-parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AA8B7B,SAAS,SAAS,CAAC,OAAwD;IACzE,MAAM,IAAI,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/F,OAAO,I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G,CAAC,CAAC;IACzB,IAAI,cAAc,GAAG,CAAC,CAAC;IAEvB,KAAK,MAAM,EAAE,QAAQ,EAAE,IAAI,YAAY,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACvD,IAAI,KAAK,EAAE,CAAC;YACV,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrB,gBAAgB,IAAI,KAAK,CAAC,WAAW,CAAC;YACtC,gBAAgB,IAAI,KAAK,CAAC,WAAW,CAAC;YACtC,cAAc,IAAI,KAAK,CAAC,SAAS,CAAC;QACpC,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,QAAQ;SACxB,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC;SAC/B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAE1D,OAAO;QACL,SAAS,EAAE;YACT,SAAS,EAAE,WAAW;YACtB,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,gBAAgB;YAC7B,SAAS,EAAE,cAAc;YACzB,iBAAiB,EAAE,gBAAgB,GAAG,gBAAgB;YACtD,OAAO,EAAE,UAAU;SACpB;QACD,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type CommitPayload, type FileChangePayload, type PromptDetail, type SessionStats, type SessionIndexEntry, type VibeDriftLevel, computeVibeDriftScore, getVibeDriftLevel, getVibeDriftColor, } from "./types";
|
|
2
|
+
export { encodeProjectPath, findClaudeProjectDirs, getSessionsInWindow, parseSessionFile, parseClaudeSessions, } from "./claude-parser";
|
|
3
|
+
export { buildCommitPayload, buildLivePayload } from "./payload-builder";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { computeVibeDriftScore, getVibeDriftLevel, getVibeDriftColor, } from "./types";
|
|
2
|
+
export { encodeProjectPath, findClaudeProjectDirs, getSessionsInWindow, parseSessionFile, parseClaudeSessions, } from "./claude-parser";
|
|
3
|
+
export { buildCommitPayload, buildLivePayload } from "./payload-builder";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CommitPayload } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Build a live (uncommitted) payload for the current working tree.
|
|
4
|
+
* Uses git diff HEAD for line changes and parses Claude sessions since the last commit.
|
|
5
|
+
*/
|
|
6
|
+
export declare function buildLivePayload(repoPath: string): Promise<CommitPayload>;
|
|
7
|
+
export declare function buildCommitPayload(repoPath: string, commitHash: string, source: CommitPayload["source"]): Promise<CommitPayload>;
|
|
8
|
+
//# sourceMappingURL=payload-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload-builder.d.ts","sourceRoot":"","sources":["../src/payload-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAqB,MAAM,SAAS,CAAC;AAuD3D;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,aAAa,CAAC,CAqExB;AAED,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,GAC9B,OAAO,CAAC,aAAa,CAAC,CAgFxB"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
import { parseClaudeSessions } from "./claude-parser";
|
|
3
|
+
function exec(cmd, cwd) {
|
|
4
|
+
return execSync(cmd, { cwd, encoding: "utf-8" }).trim();
|
|
5
|
+
}
|
|
6
|
+
function parseFileChanges(diffStat) {
|
|
7
|
+
const changes = [];
|
|
8
|
+
for (const line of diffStat.split("\n")) {
|
|
9
|
+
if (!line.trim())
|
|
10
|
+
continue;
|
|
11
|
+
// Format: "added\tdeleted\tfilepath" or for binary: "-\t-\tfilepath"
|
|
12
|
+
const parts = line.split("\t");
|
|
13
|
+
if (parts.length < 3)
|
|
14
|
+
continue;
|
|
15
|
+
const added = parseInt(parts[0], 10) || 0;
|
|
16
|
+
const deleted = parseInt(parts[1], 10) || 0;
|
|
17
|
+
const filePath = parts.slice(2).join("\t");
|
|
18
|
+
changes.push({ filePath, linesAdded: added, linesDeleted: deleted, status: "modified" });
|
|
19
|
+
}
|
|
20
|
+
return changes;
|
|
21
|
+
}
|
|
22
|
+
function detectFileStatus(fileChanges, statusOutput) {
|
|
23
|
+
const statusMap = new Map();
|
|
24
|
+
for (const line of statusOutput.split("\n")) {
|
|
25
|
+
if (!line.trim())
|
|
26
|
+
continue;
|
|
27
|
+
const code = line.charAt(0);
|
|
28
|
+
const file = line.substring(2).trim();
|
|
29
|
+
switch (code) {
|
|
30
|
+
case "A":
|
|
31
|
+
statusMap.set(file, "added");
|
|
32
|
+
break;
|
|
33
|
+
case "D":
|
|
34
|
+
statusMap.set(file, "deleted");
|
|
35
|
+
break;
|
|
36
|
+
case "R":
|
|
37
|
+
statusMap.set(file, "renamed");
|
|
38
|
+
break;
|
|
39
|
+
case "C":
|
|
40
|
+
statusMap.set(file, "copied");
|
|
41
|
+
break;
|
|
42
|
+
default:
|
|
43
|
+
statusMap.set(file, "modified");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return fileChanges.map((fc) => ({
|
|
47
|
+
...fc,
|
|
48
|
+
status: statusMap.get(fc.filePath) ?? fc.status,
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Build a live (uncommitted) payload for the current working tree.
|
|
53
|
+
* Uses git diff HEAD for line changes and parses Claude sessions since the last commit.
|
|
54
|
+
*/
|
|
55
|
+
export async function buildLivePayload(repoPath) {
|
|
56
|
+
const branch = exec("git rev-parse --abbrev-ref HEAD", repoPath);
|
|
57
|
+
const projectName = repoPath.split("/").pop() || "unknown";
|
|
58
|
+
let author = "unknown";
|
|
59
|
+
try {
|
|
60
|
+
author = exec("git config user.name", repoPath);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
// ignore
|
|
64
|
+
}
|
|
65
|
+
let remoteUrl;
|
|
66
|
+
try {
|
|
67
|
+
remoteUrl = exec("git remote get-url origin", repoPath) || undefined;
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
remoteUrl = undefined;
|
|
71
|
+
}
|
|
72
|
+
// Uncommitted diff stats (staged + unstaged vs HEAD)
|
|
73
|
+
let numstat = "";
|
|
74
|
+
try {
|
|
75
|
+
numstat = exec("git diff HEAD --numstat", repoPath);
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// No commits yet or other error
|
|
79
|
+
}
|
|
80
|
+
const fileChanges = parseFileChanges(numstat);
|
|
81
|
+
const linesAdded = fileChanges.reduce((s, f) => s + f.linesAdded, 0);
|
|
82
|
+
const linesDeleted = fileChanges.reduce((s, f) => s + f.linesDeleted, 0);
|
|
83
|
+
// Time window: last commit timestamp -> now
|
|
84
|
+
let sinceDate;
|
|
85
|
+
let commitHash = "HEAD";
|
|
86
|
+
try {
|
|
87
|
+
commitHash = exec("git rev-parse HEAD", repoPath);
|
|
88
|
+
const lastCommitTime = exec("git log -1 --format=%aI HEAD", repoPath);
|
|
89
|
+
sinceDate = new Date(lastCommitTime);
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
// No commits yet
|
|
93
|
+
sinceDate = new Date(Date.now() - 24 * 60 * 60 * 1000);
|
|
94
|
+
}
|
|
95
|
+
const untilDate = new Date();
|
|
96
|
+
// Parse Claude sessions in this time window
|
|
97
|
+
const { aggregate, sessions } = parseClaudeSessions(repoPath, sinceDate, untilDate);
|
|
98
|
+
return {
|
|
99
|
+
commitHash: `live-${projectName}`,
|
|
100
|
+
message: "Live session (uncommitted)",
|
|
101
|
+
author,
|
|
102
|
+
branch,
|
|
103
|
+
committedAt: new Date().toISOString(),
|
|
104
|
+
projectName,
|
|
105
|
+
remoteUrl,
|
|
106
|
+
userPrompts: aggregate.userPrompts,
|
|
107
|
+
aiResponses: aggregate.aiResponses,
|
|
108
|
+
totalInteractions: aggregate.totalInteractions,
|
|
109
|
+
toolCalls: aggregate.toolCalls,
|
|
110
|
+
filesChanged: fileChanges.length,
|
|
111
|
+
linesAdded,
|
|
112
|
+
linesDeleted,
|
|
113
|
+
source: "live",
|
|
114
|
+
sessionIds: sessions.map((s) => s.sessionId),
|
|
115
|
+
fileChanges,
|
|
116
|
+
prompts: aggregate.prompts ?? [],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export async function buildCommitPayload(repoPath, commitHash, source) {
|
|
120
|
+
// Get commit metadata
|
|
121
|
+
const message = exec(`git log -1 --format=%s ${commitHash}`, repoPath);
|
|
122
|
+
const author = exec(`git log -1 --format=%an ${commitHash}`, repoPath);
|
|
123
|
+
const committedAt = exec(`git log -1 --format=%aI ${commitHash}`, repoPath);
|
|
124
|
+
const branch = exec("git rev-parse --abbrev-ref HEAD", repoPath);
|
|
125
|
+
// Project name from directory
|
|
126
|
+
const projectName = repoPath.split("/").pop() || "unknown";
|
|
127
|
+
// Remote URL (optional)
|
|
128
|
+
let remoteUrl;
|
|
129
|
+
try {
|
|
130
|
+
remoteUrl = exec("git remote get-url origin", repoPath) || undefined;
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
remoteUrl = undefined;
|
|
134
|
+
}
|
|
135
|
+
// Diff stats for this commit
|
|
136
|
+
const numstat = exec(`git diff --numstat ${commitHash}~1 ${commitHash} 2>/dev/null || git diff --numstat --root ${commitHash}`, repoPath);
|
|
137
|
+
let fileChanges = parseFileChanges(numstat);
|
|
138
|
+
// Detect file statuses (A/D/M/R/C)
|
|
139
|
+
try {
|
|
140
|
+
const nameStatus = exec(`git diff --name-status ${commitHash}~1 ${commitHash} 2>/dev/null || git diff --name-status --root ${commitHash}`, repoPath);
|
|
141
|
+
fileChanges = detectFileStatus(fileChanges, nameStatus);
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
// Keep default "modified" status
|
|
145
|
+
}
|
|
146
|
+
const linesAdded = fileChanges.reduce((s, f) => s + f.linesAdded, 0);
|
|
147
|
+
const linesDeleted = fileChanges.reduce((s, f) => s + f.linesDeleted, 0);
|
|
148
|
+
// Time window: previous commit timestamp -> this commit timestamp
|
|
149
|
+
let sinceDate;
|
|
150
|
+
try {
|
|
151
|
+
const prevTimestamp = exec(`git log -1 --format=%aI ${commitHash}~1`, repoPath);
|
|
152
|
+
sinceDate = new Date(prevTimestamp);
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
// First commit — use 24h before
|
|
156
|
+
sinceDate = new Date(new Date(committedAt).getTime() - 24 * 60 * 60 * 1000);
|
|
157
|
+
}
|
|
158
|
+
const untilDate = new Date(committedAt);
|
|
159
|
+
// Parse Claude sessions in this time window
|
|
160
|
+
const { aggregate, sessions } = parseClaudeSessions(repoPath, sinceDate, untilDate);
|
|
161
|
+
return {
|
|
162
|
+
commitHash,
|
|
163
|
+
message,
|
|
164
|
+
author,
|
|
165
|
+
branch,
|
|
166
|
+
committedAt,
|
|
167
|
+
projectName,
|
|
168
|
+
remoteUrl,
|
|
169
|
+
userPrompts: aggregate.userPrompts,
|
|
170
|
+
aiResponses: aggregate.aiResponses,
|
|
171
|
+
totalInteractions: aggregate.totalInteractions,
|
|
172
|
+
toolCalls: aggregate.toolCalls,
|
|
173
|
+
filesChanged: fileChanges.length,
|
|
174
|
+
linesAdded,
|
|
175
|
+
linesDeleted,
|
|
176
|
+
source,
|
|
177
|
+
sessionIds: sessions.map((s) => s.sessionId),
|
|
178
|
+
fileChanges,
|
|
179
|
+
prompts: aggregate.prompts ?? [],
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=payload-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload-builder.js","sourceRoot":"","sources":["../src/payload-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,SAAS,IAAI,CAAC,GAAW,EAAE,GAAW;IACpC,OAAO,QAAQ,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC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,CAAC,CAAC;IAExC,4CAA4C;IAC5C,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,mBAAmB,CACjD,QAAQ,EACR,SAAS,EACT,SAAS,CACV,CAAC;IAEF,OAAO;QACL,UAAU;QACV,OAAO;QACP,MAAM;QACN,MAAM;QACN,WAAW;QACX,WAAW;QACX,SAAS;QACT,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,iBAAiB,EAAE,SAAS,CAAC,iBAAiB;QAC9C,SAAS,EAAE,SAAS,CAAC,SAAS;QAC9B,YAAY,EAAE,WAAW,CAAC,MAAM;QAChC,UAAU;QACV,YAAY;QACZ,MAAM;QACN,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5C,WAAW;QACX,OAAO,EAAE,SAAS,CAAC,OAAO,IAAI,EAAE;KACjC,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface PromptDetail {
|
|
2
|
+
text: string;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface FileChangePayload {
|
|
7
|
+
filePath: string;
|
|
8
|
+
linesAdded: number;
|
|
9
|
+
linesDeleted: number;
|
|
10
|
+
status: "added" | "modified" | "deleted" | "renamed" | "copied";
|
|
11
|
+
}
|
|
12
|
+
export interface CommitPayload {
|
|
13
|
+
commitHash: string;
|
|
14
|
+
message: string;
|
|
15
|
+
author: string;
|
|
16
|
+
branch: string;
|
|
17
|
+
committedAt: string;
|
|
18
|
+
projectName: string;
|
|
19
|
+
remoteUrl?: string;
|
|
20
|
+
userPrompts: number;
|
|
21
|
+
aiResponses: number;
|
|
22
|
+
totalInteractions: number;
|
|
23
|
+
toolCalls: number;
|
|
24
|
+
filesChanged: number;
|
|
25
|
+
linesAdded: number;
|
|
26
|
+
linesDeleted: number;
|
|
27
|
+
source: "vscode" | "hook" | "manual" | "live";
|
|
28
|
+
sessionIds: string[];
|
|
29
|
+
fileChanges?: FileChangePayload[];
|
|
30
|
+
prompts?: PromptDetail[];
|
|
31
|
+
}
|
|
32
|
+
export interface SessionStats {
|
|
33
|
+
sessionId: string;
|
|
34
|
+
userPrompts: number;
|
|
35
|
+
aiResponses: number;
|
|
36
|
+
toolCalls: number;
|
|
37
|
+
totalInteractions: number;
|
|
38
|
+
startTime?: string;
|
|
39
|
+
endTime?: string;
|
|
40
|
+
prompts?: PromptDetail[];
|
|
41
|
+
}
|
|
42
|
+
export interface SessionIndexEntry {
|
|
43
|
+
sessionId: string;
|
|
44
|
+
path: string;
|
|
45
|
+
lastModified: number;
|
|
46
|
+
}
|
|
47
|
+
export declare function computeVibeDriftScore(userPrompts: number, linesAdded?: number, linesDeleted?: number): number;
|
|
48
|
+
export type VibeDriftLevel = "low" | "moderate" | "high" | "vibe-drift";
|
|
49
|
+
export declare function getVibeDriftLevel(score: number): VibeDriftLevel;
|
|
50
|
+
export declare function getVibeDriftColor(level: VibeDriftLevel): string;
|
|
51
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;CACjE;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,E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E,MAAM,GAAG,cAAc,CAK/D;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAW/D"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export function computeVibeDriftScore(userPrompts, linesAdded = 0, linesDeleted = 0) {
|
|
2
|
+
const P = userPrompts;
|
|
3
|
+
const L = linesAdded + linesDeleted;
|
|
4
|
+
const linesPerPrompt = L / Math.max(1, P);
|
|
5
|
+
// Efficiency factor: lpp >= 50 → 0.7 (productive), lpp = 20 → 1.0, lpp <= 5 → 1.5 (spinning)
|
|
6
|
+
let factor = Math.min(1.5, Math.max(0.7, 1.5 - linesPerPrompt / 40));
|
|
7
|
+
// 1 prompt should never be penalised
|
|
8
|
+
if (P <= 1)
|
|
9
|
+
factor = Math.min(factor, 1.0);
|
|
10
|
+
return P * factor;
|
|
11
|
+
}
|
|
12
|
+
export function getVibeDriftLevel(score) {
|
|
13
|
+
if (score <= 1)
|
|
14
|
+
return "low";
|
|
15
|
+
if (score <= 3)
|
|
16
|
+
return "moderate";
|
|
17
|
+
if (score <= 6)
|
|
18
|
+
return "high";
|
|
19
|
+
return "vibe-drift";
|
|
20
|
+
}
|
|
21
|
+
export function getVibeDriftColor(level) {
|
|
22
|
+
switch (level) {
|
|
23
|
+
case "low":
|
|
24
|
+
return "#22c55e"; // green
|
|
25
|
+
case "moderate":
|
|
26
|
+
return "#eab308"; // yellow
|
|
27
|
+
case "high":
|
|
28
|
+
return "#f97316"; // orange
|
|
29
|
+
case "vibe-drift":
|
|
30
|
+
return "#ef4444"; // red
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAmDA,MAAM,UAAU,qBAAqB,CACnC,WAAmB,EACnB,aAAqB,CAAC,EACtB,eAAuB,CAAC;IAExB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|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@types/node": "^25.2.1",
|
|
14
|
+
"typescript": "^5.6.3"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"clean": "rm -rf dist"
|
|
19
|
+
}
|
|
20
|
+
}
|