@mesadev/agentblame 0.1.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/dist/blame.d.ts +14 -0
- package/dist/blame.js +252 -0
- package/dist/blame.js.map +1 -0
- package/dist/capture.d.ts +16 -0
- package/dist/capture.js +284 -0
- package/dist/capture.js.map +1 -0
- package/dist/cleanup.d.ts +10 -0
- package/dist/cleanup.js +136 -0
- package/dist/cleanup.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +240 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/db.d.ts +53 -0
- package/dist/lib/db.js +290 -0
- package/dist/lib/db.js.map +1 -0
- package/dist/lib/diff.d.ts +13 -0
- package/dist/lib/diff.js +32 -0
- package/dist/lib/diff.js.map +1 -0
- package/dist/lib/git/gitBlame.d.ts +25 -0
- package/dist/lib/git/gitBlame.js +87 -0
- package/dist/lib/git/gitBlame.js.map +1 -0
- package/dist/lib/git/gitCli.d.ts +17 -0
- package/dist/lib/git/gitCli.js +57 -0
- package/dist/lib/git/gitCli.js.map +1 -0
- package/dist/lib/git/gitConfig.d.ts +20 -0
- package/dist/lib/git/gitConfig.js +91 -0
- package/dist/lib/git/gitConfig.js.map +1 -0
- package/dist/lib/git/gitDiff.d.ts +42 -0
- package/dist/lib/git/gitDiff.js +346 -0
- package/dist/lib/git/gitDiff.js.map +1 -0
- package/dist/lib/git/gitNotes.d.ts +31 -0
- package/dist/lib/git/gitNotes.js +93 -0
- package/dist/lib/git/gitNotes.js.map +1 -0
- package/dist/lib/git/index.d.ts +5 -0
- package/dist/lib/git/index.js +22 -0
- package/dist/lib/git/index.js.map +1 -0
- package/dist/lib/hooks.d.ts +65 -0
- package/dist/lib/hooks.js +423 -0
- package/dist/lib/hooks.js.map +1 -0
- package/dist/lib/index.d.ts +10 -0
- package/dist/lib/index.js +33 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/types.d.ts +190 -0
- package/dist/lib/types.js +8 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/util.d.ts +24 -0
- package/dist/lib/util.js +82 -0
- package/dist/lib/util.js.map +1 -0
- package/dist/process.d.ts +14 -0
- package/dist/process.js +224 -0
- package/dist/process.js.map +1 -0
- package/dist/sync.d.ts +15 -0
- package/dist/sync.js +413 -0
- package/dist/sync.js.map +1 -0
- package/dist/transfer-notes.d.ts +16 -0
- package/dist/transfer-notes.js +426 -0
- package/dist/transfer-notes.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Agent Blame - Transfer Notes Action
|
|
5
|
+
*
|
|
6
|
+
* Transfers git notes from PR commits to merge/squash/rebase commits.
|
|
7
|
+
* Runs as part of GitHub Actions workflow after PR merge.
|
|
8
|
+
*
|
|
9
|
+
* Environment variables (set by GitHub Actions):
|
|
10
|
+
* PR_NUMBER - The PR number
|
|
11
|
+
* PR_TITLE - The PR title
|
|
12
|
+
* BASE_REF - Target branch (e.g., main)
|
|
13
|
+
* BASE_SHA - Base commit SHA before merge
|
|
14
|
+
* HEAD_SHA - Last commit SHA on feature branch
|
|
15
|
+
* MERGE_SHA - The merge commit SHA (for merge/squash)
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const node_child_process_1 = require("node:child_process");
|
|
19
|
+
// Get environment variables
|
|
20
|
+
const PR_NUMBER = process.env.PR_NUMBER || "";
|
|
21
|
+
const PR_TITLE = process.env.PR_TITLE || "";
|
|
22
|
+
const BASE_SHA = process.env.BASE_SHA || "";
|
|
23
|
+
const HEAD_SHA = process.env.HEAD_SHA || "";
|
|
24
|
+
const MERGE_SHA = process.env.MERGE_SHA || "";
|
|
25
|
+
function run(cmd) {
|
|
26
|
+
try {
|
|
27
|
+
return (0, node_child_process_1.execSync)(cmd, { encoding: "utf8" }).trim();
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return "";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function log(msg) {
|
|
34
|
+
console.log(`[agentblame] ${msg}`);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Detect what type of merge was performed
|
|
38
|
+
*/
|
|
39
|
+
function detectMergeType() {
|
|
40
|
+
// Get the merge commit
|
|
41
|
+
const mergeCommit = MERGE_SHA;
|
|
42
|
+
if (!mergeCommit) {
|
|
43
|
+
log("No merge commit SHA, assuming rebase");
|
|
44
|
+
return "rebase";
|
|
45
|
+
}
|
|
46
|
+
// Check number of parents
|
|
47
|
+
const parents = run(`git rev-list --parents -n 1 ${mergeCommit}`).split(" ");
|
|
48
|
+
const parentCount = parents.length - 1; // First element is the commit itself
|
|
49
|
+
if (parentCount > 1) {
|
|
50
|
+
// Multiple parents = merge commit
|
|
51
|
+
log("Detected: Merge commit (multiple parents)");
|
|
52
|
+
return "merge_commit";
|
|
53
|
+
}
|
|
54
|
+
// Single parent - could be squash or rebase
|
|
55
|
+
// Check if commit message contains PR number (squash pattern)
|
|
56
|
+
const commitMsg = run(`git log -1 --format=%s ${mergeCommit}`);
|
|
57
|
+
if (commitMsg.includes(`#${PR_NUMBER}`) || commitMsg.includes(PR_TITLE)) {
|
|
58
|
+
log("Detected: Squash merge (single commit with PR reference)");
|
|
59
|
+
return "squash";
|
|
60
|
+
}
|
|
61
|
+
log("Detected: Rebase merge");
|
|
62
|
+
return "rebase";
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Get all commits that were in the PR (between base and head)
|
|
66
|
+
*/
|
|
67
|
+
function getPRCommits() {
|
|
68
|
+
// Get commits that were in the feature branch but not in base
|
|
69
|
+
const output = run(`git rev-list ${BASE_SHA}..${HEAD_SHA}`);
|
|
70
|
+
if (!output)
|
|
71
|
+
return [];
|
|
72
|
+
return output.split("\n").filter(Boolean);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Read agentblame note from a commit
|
|
76
|
+
*/
|
|
77
|
+
function readNote(sha) {
|
|
78
|
+
const note = run(`git notes --ref=ab show ${sha} 2>/dev/null`);
|
|
79
|
+
if (!note)
|
|
80
|
+
return null;
|
|
81
|
+
try {
|
|
82
|
+
return JSON.parse(note);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Write agentblame note to a commit
|
|
90
|
+
*/
|
|
91
|
+
function writeNote(sha, attribution) {
|
|
92
|
+
const noteJson = JSON.stringify(attribution);
|
|
93
|
+
try {
|
|
94
|
+
// Use spawnSync with array args to avoid shell injection
|
|
95
|
+
const result = (0, node_child_process_1.spawnSync)("git", ["notes", "--ref=ab", "add", "-f", "-m", noteJson, sha], { encoding: "utf8" });
|
|
96
|
+
if (result.status !== 0) {
|
|
97
|
+
log(`Failed to write note to ${sha}: ${result.stderr}`);
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
log(`Failed to write note to ${sha}: ${err}`);
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Collect all attributions from PR commits, including original content
|
|
109
|
+
*/
|
|
110
|
+
function collectPRAttributions(prCommits) {
|
|
111
|
+
const byHash = new Map();
|
|
112
|
+
const withContent = [];
|
|
113
|
+
for (const sha of prCommits) {
|
|
114
|
+
const note = readNote(sha);
|
|
115
|
+
if (!note?.attributions)
|
|
116
|
+
continue;
|
|
117
|
+
// Get the commit's diff to extract original content
|
|
118
|
+
const hunks = getCommitHunks(sha);
|
|
119
|
+
const hunksByHash = new Map();
|
|
120
|
+
for (const hunk of hunks) {
|
|
121
|
+
hunksByHash.set(hunk.contentHash, hunk.content);
|
|
122
|
+
}
|
|
123
|
+
for (const attr of note.attributions) {
|
|
124
|
+
const hash = attr.content_hash;
|
|
125
|
+
if (!byHash.has(hash)) {
|
|
126
|
+
byHash.set(hash, []);
|
|
127
|
+
}
|
|
128
|
+
byHash.get(hash)?.push(attr);
|
|
129
|
+
// Store with original content for containment matching
|
|
130
|
+
const content = hunksByHash.get(hash) || "";
|
|
131
|
+
if (content) {
|
|
132
|
+
withContent.push({ ...attr, originalContent: content });
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return { byHash, withContent };
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Get the diff of a commit and extract content hashes
|
|
140
|
+
*/
|
|
141
|
+
function getCommitHunks(sha) {
|
|
142
|
+
const diff = run(`git diff-tree -p ${sha}`);
|
|
143
|
+
if (!diff)
|
|
144
|
+
return [];
|
|
145
|
+
const hunks = [];
|
|
146
|
+
let currentFile = "";
|
|
147
|
+
let lineNumber = 0;
|
|
148
|
+
let addedLines = [];
|
|
149
|
+
let startLine = 0;
|
|
150
|
+
for (const line of diff.split("\n")) {
|
|
151
|
+
// New file header
|
|
152
|
+
if (line.startsWith("+++ b/")) {
|
|
153
|
+
// Save previous hunk
|
|
154
|
+
if (addedLines.length > 0 && currentFile) {
|
|
155
|
+
const content = addedLines.join("\n");
|
|
156
|
+
const hash = computeHash(content);
|
|
157
|
+
hunks.push({
|
|
158
|
+
path: currentFile,
|
|
159
|
+
startLine,
|
|
160
|
+
endLine: startLine + addedLines.length - 1,
|
|
161
|
+
content,
|
|
162
|
+
contentHash: hash,
|
|
163
|
+
});
|
|
164
|
+
addedLines = [];
|
|
165
|
+
}
|
|
166
|
+
currentFile = line.slice(6);
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
// Hunk header
|
|
170
|
+
if (line.startsWith("@@")) {
|
|
171
|
+
// Save previous hunk
|
|
172
|
+
if (addedLines.length > 0 && currentFile) {
|
|
173
|
+
const content = addedLines.join("\n");
|
|
174
|
+
const hash = computeHash(content);
|
|
175
|
+
hunks.push({
|
|
176
|
+
path: currentFile,
|
|
177
|
+
startLine,
|
|
178
|
+
endLine: startLine + addedLines.length - 1,
|
|
179
|
+
content,
|
|
180
|
+
contentHash: hash,
|
|
181
|
+
});
|
|
182
|
+
addedLines = [];
|
|
183
|
+
}
|
|
184
|
+
// Parse line number: @@ -old,count +new,count @@
|
|
185
|
+
const match = line.match(/@@ -\d+(?:,\d+)? \+(\d+)/);
|
|
186
|
+
if (match) {
|
|
187
|
+
lineNumber = parseInt(match[1], 10);
|
|
188
|
+
startLine = lineNumber;
|
|
189
|
+
}
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
// Added line
|
|
193
|
+
if (line.startsWith("+") && !line.startsWith("+++")) {
|
|
194
|
+
if (addedLines.length === 0) {
|
|
195
|
+
startLine = lineNumber;
|
|
196
|
+
}
|
|
197
|
+
addedLines.push(line.slice(1));
|
|
198
|
+
lineNumber++;
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
// Context or removed line
|
|
202
|
+
if (!line.startsWith("-")) {
|
|
203
|
+
// Save previous hunk if we hit a non-added line
|
|
204
|
+
if (addedLines.length > 0 && currentFile) {
|
|
205
|
+
const content = addedLines.join("\n");
|
|
206
|
+
const hash = computeHash(content);
|
|
207
|
+
hunks.push({
|
|
208
|
+
path: currentFile,
|
|
209
|
+
startLine,
|
|
210
|
+
endLine: startLine + addedLines.length - 1,
|
|
211
|
+
content,
|
|
212
|
+
contentHash: hash,
|
|
213
|
+
});
|
|
214
|
+
addedLines = [];
|
|
215
|
+
}
|
|
216
|
+
lineNumber++;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// Save last hunk
|
|
220
|
+
if (addedLines.length > 0 && currentFile) {
|
|
221
|
+
const content = addedLines.join("\n");
|
|
222
|
+
const hash = computeHash(content);
|
|
223
|
+
hunks.push({
|
|
224
|
+
path: currentFile,
|
|
225
|
+
startLine,
|
|
226
|
+
endLine: startLine + addedLines.length - 1,
|
|
227
|
+
content,
|
|
228
|
+
contentHash: hash,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
return hunks;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Compute SHA256 hash of content
|
|
235
|
+
*/
|
|
236
|
+
function computeHash(content) {
|
|
237
|
+
const crypto = require("node:crypto");
|
|
238
|
+
return `sha256:${crypto.createHash("sha256").update(content).digest("hex")}`;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Find attributions whose content is contained within the hunk content
|
|
242
|
+
* Returns attributions with calculated precise line numbers
|
|
243
|
+
*/
|
|
244
|
+
function findContainedAttributions(hunk, attributions) {
|
|
245
|
+
const results = [];
|
|
246
|
+
for (const attr of attributions) {
|
|
247
|
+
// Check if file paths match
|
|
248
|
+
const attrFileName = attr.path.split("/").pop();
|
|
249
|
+
const hunkFileName = hunk.path.split("/").pop();
|
|
250
|
+
const sameFile = attrFileName === hunkFileName ||
|
|
251
|
+
attr.path.endsWith(hunk.path) ||
|
|
252
|
+
hunk.path.endsWith(attrFileName || "");
|
|
253
|
+
if (!sameFile)
|
|
254
|
+
continue;
|
|
255
|
+
// Check if AI content is contained in the hunk
|
|
256
|
+
const aiContent = attr.originalContent.trim();
|
|
257
|
+
const hunkContent = hunk.content;
|
|
258
|
+
if (!hunkContent.includes(aiContent))
|
|
259
|
+
continue;
|
|
260
|
+
// Calculate precise line numbers
|
|
261
|
+
const offset = hunkContent.indexOf(aiContent);
|
|
262
|
+
let startLine = hunk.startLine;
|
|
263
|
+
if (offset > 0) {
|
|
264
|
+
const contentBeforeAI = hunkContent.slice(0, offset);
|
|
265
|
+
const linesBeforeAI = contentBeforeAI.split("\n").length - 1;
|
|
266
|
+
startLine = hunk.startLine + linesBeforeAI;
|
|
267
|
+
}
|
|
268
|
+
const aiLineCount = aiContent.split("\n").length;
|
|
269
|
+
const endLine = startLine + aiLineCount - 1;
|
|
270
|
+
// Create clean attribution without originalContent
|
|
271
|
+
const { originalContent: _, ...cleanAttr } = attr;
|
|
272
|
+
results.push({
|
|
273
|
+
...cleanAttr,
|
|
274
|
+
path: hunk.path,
|
|
275
|
+
start_line: startLine,
|
|
276
|
+
end_line: endLine,
|
|
277
|
+
});
|
|
278
|
+
log(` Contained match: ${hunk.path}:${startLine}-${endLine} (${attr.provider})`);
|
|
279
|
+
}
|
|
280
|
+
return results;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Transfer notes for a squash merge
|
|
284
|
+
*/
|
|
285
|
+
function handleSquashMerge(prCommits) {
|
|
286
|
+
log(`Transferring notes from ${prCommits.length} PR commits to squash commit ${MERGE_SHA}`);
|
|
287
|
+
// Collect all attributions from PR commits
|
|
288
|
+
const { byHash, withContent } = collectPRAttributions(prCommits);
|
|
289
|
+
if (byHash.size === 0) {
|
|
290
|
+
log("No attributions found in PR commits");
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
log(`Found ${byHash.size} unique content hashes, ${withContent.length} with content`);
|
|
294
|
+
// Get hunks from the squash commit
|
|
295
|
+
const hunks = getCommitHunks(MERGE_SHA);
|
|
296
|
+
log(`Squash commit has ${hunks.length} hunks`);
|
|
297
|
+
// Match attributions to hunks
|
|
298
|
+
const newAttributions = [];
|
|
299
|
+
const matchedContentHashes = new Set();
|
|
300
|
+
for (const hunk of hunks) {
|
|
301
|
+
// First try exact hash match
|
|
302
|
+
const attrs = byHash.get(hunk.contentHash);
|
|
303
|
+
if (attrs && attrs.length > 0) {
|
|
304
|
+
const attr = attrs[0];
|
|
305
|
+
newAttributions.push({
|
|
306
|
+
...attr,
|
|
307
|
+
path: hunk.path,
|
|
308
|
+
start_line: hunk.startLine,
|
|
309
|
+
end_line: hunk.endLine,
|
|
310
|
+
});
|
|
311
|
+
matchedContentHashes.add(attr.content_hash);
|
|
312
|
+
log(` Exact match: ${hunk.path}:${hunk.startLine}-${hunk.endLine} (${attr.provider})`);
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
// Fallback: check if any AI content is contained within this hunk
|
|
316
|
+
const unmatchedAttrs = withContent.filter((a) => !matchedContentHashes.has(a.content_hash));
|
|
317
|
+
const containedMatches = findContainedAttributions(hunk, unmatchedAttrs);
|
|
318
|
+
for (const match of containedMatches) {
|
|
319
|
+
newAttributions.push(match);
|
|
320
|
+
matchedContentHashes.add(match.content_hash);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
if (newAttributions.length === 0) {
|
|
324
|
+
log("No attributions matched to squash commit");
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
// Write note to squash commit
|
|
328
|
+
const note = {
|
|
329
|
+
version: 1,
|
|
330
|
+
timestamp: new Date().toISOString(),
|
|
331
|
+
attributions: newAttributions,
|
|
332
|
+
};
|
|
333
|
+
if (writeNote(MERGE_SHA, note)) {
|
|
334
|
+
log(`✓ Attached ${newAttributions.length} attribution(s) to squash commit`);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Transfer notes for a rebase merge
|
|
339
|
+
*/
|
|
340
|
+
function handleRebaseMerge(prCommits) {
|
|
341
|
+
log(`Handling rebase merge: ${prCommits.length} original commits`);
|
|
342
|
+
// Collect all attributions from PR commits
|
|
343
|
+
const { byHash, withContent } = collectPRAttributions(prCommits);
|
|
344
|
+
if (byHash.size === 0) {
|
|
345
|
+
log("No attributions found in PR commits");
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
// Find the new commits on target branch after the base
|
|
349
|
+
const newCommits = run(`git rev-list ${BASE_SHA}..HEAD`)
|
|
350
|
+
.split("\n")
|
|
351
|
+
.filter(Boolean);
|
|
352
|
+
log(`Found ${newCommits.length} new commits after rebase`);
|
|
353
|
+
let totalTransferred = 0;
|
|
354
|
+
for (const newSha of newCommits) {
|
|
355
|
+
const hunks = getCommitHunks(newSha);
|
|
356
|
+
const newAttributions = [];
|
|
357
|
+
const matchedContentHashes = new Set();
|
|
358
|
+
for (const hunk of hunks) {
|
|
359
|
+
// First try exact hash match
|
|
360
|
+
const attrs = byHash.get(hunk.contentHash);
|
|
361
|
+
if (attrs && attrs.length > 0) {
|
|
362
|
+
const attr = attrs[0];
|
|
363
|
+
newAttributions.push({
|
|
364
|
+
...attr,
|
|
365
|
+
path: hunk.path,
|
|
366
|
+
start_line: hunk.startLine,
|
|
367
|
+
end_line: hunk.endLine,
|
|
368
|
+
});
|
|
369
|
+
matchedContentHashes.add(attr.content_hash);
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
// Fallback: containment matching
|
|
373
|
+
const unmatchedAttrs = withContent.filter((a) => !matchedContentHashes.has(a.content_hash));
|
|
374
|
+
const containedMatches = findContainedAttributions(hunk, unmatchedAttrs);
|
|
375
|
+
for (const match of containedMatches) {
|
|
376
|
+
newAttributions.push(match);
|
|
377
|
+
matchedContentHashes.add(match.content_hash);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (newAttributions.length > 0) {
|
|
381
|
+
const note = {
|
|
382
|
+
version: 1,
|
|
383
|
+
timestamp: new Date().toISOString(),
|
|
384
|
+
attributions: newAttributions,
|
|
385
|
+
};
|
|
386
|
+
if (writeNote(newSha, note)) {
|
|
387
|
+
log(` ✓ ${newSha.slice(0, 7)}: ${newAttributions.length} attribution(s)`);
|
|
388
|
+
totalTransferred += newAttributions.length;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
log(`✓ Transferred ${totalTransferred} attribution(s) across ${newCommits.length} commits`);
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Main entry point
|
|
396
|
+
*/
|
|
397
|
+
async function main() {
|
|
398
|
+
log("Agent Blame - Transfer Notes");
|
|
399
|
+
log(`PR #${PR_NUMBER}: ${PR_TITLE}`);
|
|
400
|
+
log(`Base: ${BASE_SHA.slice(0, 7)}, Head: ${HEAD_SHA.slice(0, 7)}, Merge: ${MERGE_SHA.slice(0, 7)}`);
|
|
401
|
+
// Detect merge type
|
|
402
|
+
const mergeType = detectMergeType();
|
|
403
|
+
if (mergeType === "merge_commit") {
|
|
404
|
+
log("Merge commit detected - notes survive automatically, nothing to do");
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
// Get PR commits
|
|
408
|
+
const prCommits = getPRCommits();
|
|
409
|
+
if (prCommits.length === 0) {
|
|
410
|
+
log("No PR commits found");
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
log(`Found ${prCommits.length} commits in PR`);
|
|
414
|
+
if (mergeType === "squash") {
|
|
415
|
+
handleSquashMerge(prCommits);
|
|
416
|
+
}
|
|
417
|
+
else if (mergeType === "rebase") {
|
|
418
|
+
handleRebaseMerge(prCommits);
|
|
419
|
+
}
|
|
420
|
+
log("Done");
|
|
421
|
+
}
|
|
422
|
+
main().catch((err) => {
|
|
423
|
+
console.error("[agentblame] Error:", err);
|
|
424
|
+
process.exit(1);
|
|
425
|
+
});
|
|
426
|
+
//# sourceMappingURL=transfer-notes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transfer-notes.js","sourceRoot":"","sources":["../src/transfer-notes.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;GAaG;;AAEH,2DAAyD;AAGzD,4BAA4B;AAC5B,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;AAC9C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;AAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;AAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;AAC5C,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;AAM9C,SAAS,GAAG,CAAC,GAAW;IACtB,IAAI,CAAC;QACH,OAAO,IAAA,6BAAQ,EAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,MAA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AAS,GAAG,YAAY,EAAE,CAAC;IACjC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,GAAG,CAAC,qBAAqB,CAAC,CAAC;QAC3B,OAAO;IACT,CAAC;IAED,GAAG,CAAC,SAAS,SAAS,CAAC,MAAM,gBAAgB,CAAC,CAAC;IAE/C,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAC3B,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;SAAM,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,GAAG,CAAC,MAAM,CAAC,CAAC;AACd,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;IAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mesadev/agentblame",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI to track AI-generated vs human-written code",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/mesa-dot-dev/agentblame",
|
|
9
|
+
"directory": "packages/cli"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/mesa-dot-dev/agentblame#readme",
|
|
12
|
+
"keywords": ["ai", "attribution", "git", "blame", "cursor", "claude", "copilot"],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=18.0.0"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"bin": {
|
|
22
|
+
"agentblame": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"files": ["dist"],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc",
|
|
27
|
+
"clean": "rm -rf dist"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"diff": "^8.0.2"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/diff": "^8.0.0",
|
|
34
|
+
"@types/node": "^20.11.30",
|
|
35
|
+
"typescript": "^5.5.4"
|
|
36
|
+
}
|
|
37
|
+
}
|