@susu-eng/trunk-sync 2.3.2 → 2.3.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trunk-sync",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "Maximum continuous integration for multi-agent coding — every edit is committed and pushed to trunk immediately",
5
5
  "author": {
6
6
  "name": "Eli Mydlarz"
@@ -113,7 +113,9 @@ function rewindTranscript(transcriptPath, commitTimestamp, worktreePath) {
113
113
  }
114
114
  function inspectOrLaunch(fileRef, inspect) {
115
115
  const { file, line } = parseFileRef(fileRef);
116
- const sha = blame(file, line);
116
+ const blameResult = blame(file, line);
117
+ const sha = blameResult.sha;
118
+ const origLine = blameResult.origLine;
117
119
  if (/^0+$/.test(sha)) {
118
120
  console.error(`Line ${line} has uncommitted changes.`);
119
121
  process.exit(1);
@@ -149,7 +151,7 @@ function inspectOrLaunch(fileRef, inspect) {
149
151
  process.exit(1);
150
152
  }
151
153
  const relFile = relative(root, resolve(file));
152
- const prompt = `*STOP*. *HALT ALL PREVIOUS OPERATIONS AND STOP IMMEDIATELY*. *DO NOT CONTINUE YOUR CURRENT CHAIN OF THOUGHT*. This session already ended. It has been resumed and rewound — including the code — so you can answer questions about why it was written this way. *DO NOT* change any code. Start by explaining ${relFile}:${line} (commit ${shortSha(sha)}) — what does it do, how does it work, and why is it written this way?`;
154
+ const prompt = `*STOP*. *HALT ALL PREVIOUS OPERATIONS AND STOP IMMEDIATELY*. *DO NOT CONTINUE YOUR CURRENT CHAIN OF THOUGHT*. This session already ended. It has been resumed and rewound — including the code — so you can answer questions about why it was written this way. *DO NOT* change any code. Start by explaining ${relFile}:${origLine} (commit ${shortSha(sha)}) — what does it do, how does it work, and why is it written this way?`;
153
155
  // Rewind the session transcript to the commit point.
154
156
  // Try snapshot from .transcripts/ in the commit first, fall back to Transcript: field.
155
157
  const snapshotRelPath = findSnapshotInCommit(sha);
package/dist/lib/git.d.ts CHANGED
@@ -3,7 +3,10 @@ export declare function parseFileRef(ref: string): {
3
3
  file: string;
4
4
  line: number;
5
5
  };
6
- export declare function blame(file: string, line: number, cwd?: string): string;
6
+ export declare function blame(file: string, line: number, cwd?: string): {
7
+ sha: string;
8
+ origLine: number;
9
+ };
7
10
  export declare function getCommitBody(sha: string, cwd?: string): string;
8
11
  export declare function getCommitSubject(sha: string, cwd?: string): string;
9
12
  export declare function getCommitDate(sha: string, cwd?: string): string;
package/dist/lib/git.js CHANGED
@@ -29,8 +29,9 @@ export function blame(file, line, cwd) {
29
29
  encoding: "utf-8",
30
30
  cwd,
31
31
  });
32
- const sha = output.split("\n")[0].split(" ")[0];
33
- return sha;
32
+ // Porcelain format first line: <sha> <orig-line> <final-line> <num-lines>
33
+ const parts = output.split("\n")[0].split(" ");
34
+ return { sha: parts[0], origLine: Number(parts[1]) };
34
35
  }
35
36
  export function getCommitBody(sha, cwd) {
36
37
  return execSync(`git log -1 --format=%b "${sha}"`, { encoding: "utf-8", cwd }).trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@susu-eng/trunk-sync",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "type": "module",
5
5
  "description": "Maximum continuous integration for multi-agent coding — every edit is committed and pushed to trunk immediately",
6
6
  "bin": {