centaurus-cli 2.9.5 → 2.9.7
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-adapter.d.ts +27 -2
- package/dist/cli-adapter.d.ts.map +1 -1
- package/dist/cli-adapter.js +410 -17
- package/dist/cli-adapter.js.map +1 -1
- package/dist/config/slash-commands.d.ts.map +1 -1
- package/dist/config/slash-commands.js +7 -0
- package/dist/config/slash-commands.js.map +1 -1
- package/dist/context/context-manager.d.ts +4 -0
- package/dist/context/context-manager.d.ts.map +1 -1
- package/dist/context/context-manager.js +6 -0
- package/dist/context/context-manager.js.map +1 -1
- package/dist/context/handlers/docker-handler.d.ts +5 -1
- package/dist/context/handlers/docker-handler.d.ts.map +1 -1
- package/dist/context/handlers/docker-handler.js +27 -10
- package/dist/context/handlers/docker-handler.js.map +1 -1
- package/dist/context/handlers/ssh-handler.d.ts +47 -1
- package/dist/context/handlers/ssh-handler.d.ts.map +1 -1
- package/dist/context/handlers/ssh-handler.js +546 -73
- package/dist/context/handlers/ssh-handler.js.map +1 -1
- package/dist/context/handlers/wsl-handler.d.ts +5 -1
- package/dist/context/handlers/wsl-handler.d.ts.map +1 -1
- package/dist/context/handlers/wsl-handler.js +24 -6
- package/dist/context/handlers/wsl-handler.js.map +1 -1
- package/dist/context/subshell-handler.d.ts +8 -2
- package/dist/context/subshell-handler.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/services/checkpoint-manager.d.ts +162 -0
- package/dist/services/checkpoint-manager.d.ts.map +1 -0
- package/dist/services/checkpoint-manager.js +926 -0
- package/dist/services/checkpoint-manager.js.map +1 -0
- package/dist/services/fast-context-agent.d.ts +12 -0
- package/dist/services/fast-context-agent.d.ts.map +1 -0
- package/dist/services/fast-context-agent.js +253 -0
- package/dist/services/fast-context-agent.js.map +1 -0
- package/dist/tools/background-command.d.ts.map +1 -1
- package/dist/tools/background-command.js +132 -24
- package/dist/tools/background-command.js.map +1 -1
- package/dist/tools/command.d.ts.map +1 -1
- package/dist/tools/command.js +14 -4
- package/dist/tools/command.js.map +1 -1
- package/dist/tools/create-image.d.ts.map +1 -1
- package/dist/tools/create-image.js +43 -18
- package/dist/tools/create-image.js.map +1 -1
- package/dist/tools/fast-context.d.ts +3 -0
- package/dist/tools/fast-context.d.ts.map +1 -0
- package/dist/tools/fast-context.js +72 -0
- package/dist/tools/fast-context.js.map +1 -0
- package/dist/tools/file-ops.d.ts.map +1 -1
- package/dist/tools/file-ops.js +12 -12
- package/dist/tools/file-ops.js.map +1 -1
- package/dist/tools/find-files.d.ts +2 -1
- package/dist/tools/find-files.d.ts.map +1 -1
- package/dist/tools/find-files.js +62 -2
- package/dist/tools/find-files.js.map +1 -1
- package/dist/tools/get-diff.d.ts +9 -45
- package/dist/tools/get-diff.d.ts.map +1 -1
- package/dist/tools/get-diff.js +288 -171
- package/dist/tools/get-diff.js.map +1 -1
- package/dist/tools/types.d.ts +4 -1
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/components/App.d.ts +8 -0
- package/dist/ui/components/App.d.ts.map +1 -1
- package/dist/ui/components/App.js +290 -85
- package/dist/ui/components/App.js.map +1 -1
- package/dist/ui/components/ConfirmPrompt.d.ts +2 -0
- package/dist/ui/components/ConfirmPrompt.d.ts.map +1 -1
- package/dist/ui/components/ConfirmPrompt.js +8 -3
- package/dist/ui/components/ConfirmPrompt.js.map +1 -1
- package/dist/ui/components/InputBox.d.ts +6 -0
- package/dist/ui/components/InputBox.d.ts.map +1 -1
- package/dist/ui/components/InputBox.js +130 -6
- package/dist/ui/components/InputBox.js.map +1 -1
- package/dist/ui/components/InteractiveShell.d.ts.map +1 -1
- package/dist/ui/components/InteractiveShell.js +50 -15
- package/dist/ui/components/InteractiveShell.js.map +1 -1
- package/dist/ui/components/MessageDisplay.d.ts.map +1 -1
- package/dist/ui/components/MessageDisplay.js +2 -2
- package/dist/ui/components/MessageDisplay.js.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.d.ts.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.js +213 -18
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
- package/dist/utils/ansi-encoder.d.ts +5 -0
- package/dist/utils/ansi-encoder.d.ts.map +1 -1
- package/dist/utils/ansi-encoder.js +5 -5
- package/dist/utils/ansi-encoder.js.map +1 -1
- package/dist/utils/editor-utils.d.ts +5 -0
- package/dist/utils/editor-utils.d.ts.map +1 -1
- package/dist/utils/editor-utils.js +67 -0
- package/dist/utils/editor-utils.js.map +1 -1
- package/dist/utils/input-classifier.d.ts.map +1 -1
- package/dist/utils/input-classifier.js +2 -1
- package/dist/utils/input-classifier.js.map +1 -1
- package/dist/utils/terminal-output.d.ts.map +1 -1
- package/dist/utils/terminal-output.js +162 -103
- package/dist/utils/terminal-output.js.map +1 -1
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-files.js","sourceRoot":"","sources":["../../src/tools/find-files.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAe7B;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IAChB,MAAM,CAAU,mBAAmB,GAAG,EAAE,CAAC;IACzC,MAAM,CAAU,gBAAgB,GAAG;QACzC,iBAAiB;QACjB,SAAS;QACT,UAAU;QACV,SAAS;QACT,UAAU;QACV,UAAU;QACV,aAAa;QACb,WAAW;QACX,QAAQ;QACR,WAAW;QACX,WAAW;KACZ,CAAC;IAEF;;OAEG;IACK,aAAa,CAAC,QAAgB;QACpC,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACK,eAAe,CAAC,OAAe;QACrC,oCAAoC;QACpC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,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staged?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface GetDiffResult {
|
|
7
|
-
diff: string;
|
|
8
|
-
filesChanged: string[];
|
|
9
|
-
hasChanges: boolean;
|
|
10
|
-
truncated: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare class GetDiffTool {
|
|
13
|
-
/**
|
|
14
|
-
* Execute git diff to show changes in the working directory
|
|
15
|
-
*/
|
|
16
|
-
execute(params: GetDiffParams, cwd: string): Promise<GetDiffResult>;
|
|
17
|
-
/**
|
|
18
|
-
* Check if git command is available
|
|
19
|
-
*/
|
|
20
|
-
private checkGitAvailable;
|
|
21
|
-
/**
|
|
22
|
-
* Check if the current directory is a git repository
|
|
23
|
-
*/
|
|
24
|
-
private checkGitRepository;
|
|
25
|
-
/**
|
|
26
|
-
* Get list of changed files
|
|
27
|
-
*/
|
|
28
|
-
private getChangedFiles;
|
|
29
|
-
/**
|
|
30
|
-
* Get the full diff output
|
|
31
|
-
*/
|
|
32
|
-
private getDiffOutput;
|
|
33
|
-
/**
|
|
34
|
-
* Truncate diff output to 500 lines maximum
|
|
35
|
-
*/
|
|
36
|
-
private truncateDiff;
|
|
37
|
-
/**
|
|
38
|
-
* Normalize file paths to use forward slashes
|
|
39
|
-
*/
|
|
40
|
-
private normalizeFilePaths;
|
|
41
|
-
/**
|
|
42
|
-
* Handle errors with helpful messages
|
|
43
|
-
*/
|
|
44
|
-
private handleError;
|
|
45
|
-
}
|
|
46
2
|
/**
|
|
47
|
-
*
|
|
3
|
+
* Rewritten get_diff tool with action-based pattern and session scope support.
|
|
4
|
+
*
|
|
5
|
+
* Actions:
|
|
6
|
+
* - "overview" (default): Shows a compact summary of files changed.
|
|
7
|
+
* - "file_diff": Shows the detailed diff for a single specific file.
|
|
8
|
+
*
|
|
9
|
+
* Scopes:
|
|
10
|
+
* - "request" (default): Changes made in the current turn (since last user message).
|
|
11
|
+
* - "session": Cumulative changes made since the start of the conversation.
|
|
48
12
|
*/
|
|
49
13
|
export declare const getDiffTool: Tool;
|
|
50
14
|
//# sourceMappingURL=get-diff.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-diff.d.ts","sourceRoot":"","sources":["../../src/tools/get-diff.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAwB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"get-diff.d.ts","sourceRoot":"","sources":["../../src/tools/get-diff.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAwB,MAAM,YAAY,CAAC;AAKxD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,EAAE,IAyGzB,CAAC"}
|
package/dist/tools/get-diff.js
CHANGED
|
@@ -1,203 +1,320 @@
|
|
|
1
1
|
import { exec } from 'child_process';
|
|
2
2
|
import { promisify } from 'util';
|
|
3
3
|
const execAsync = promisify(exec);
|
|
4
|
-
export class GetDiffTool {
|
|
5
|
-
/**
|
|
6
|
-
* Execute git diff to show changes in the working directory
|
|
7
|
-
*/
|
|
8
|
-
async execute(params, cwd) {
|
|
9
|
-
const { filePath, staged = false } = params;
|
|
10
|
-
try {
|
|
11
|
-
// Check if git is available
|
|
12
|
-
await this.checkGitAvailable();
|
|
13
|
-
// Check if directory is a git repository
|
|
14
|
-
await this.checkGitRepository(cwd);
|
|
15
|
-
// Get list of changed files
|
|
16
|
-
const filesChanged = await this.getChangedFiles(cwd, staged, filePath);
|
|
17
|
-
// If no changes, return early
|
|
18
|
-
if (filesChanged.length === 0) {
|
|
19
|
-
return {
|
|
20
|
-
diff: 'No changes detected in the working directory.',
|
|
21
|
-
filesChanged: [],
|
|
22
|
-
hasChanges: false,
|
|
23
|
-
truncated: false,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
// Get the diff output
|
|
27
|
-
const diff = await this.getDiffOutput(cwd, staged, filePath);
|
|
28
|
-
// Truncate if necessary
|
|
29
|
-
const { truncatedDiff, wasTruncated } = this.truncateDiff(diff);
|
|
30
|
-
return {
|
|
31
|
-
diff: truncatedDiff,
|
|
32
|
-
filesChanged: this.normalizeFilePaths(filesChanged),
|
|
33
|
-
hasChanges: true,
|
|
34
|
-
truncated: wasTruncated,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
throw this.handleError(error);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Check if git command is available
|
|
43
|
-
*/
|
|
44
|
-
async checkGitAvailable() {
|
|
45
|
-
try {
|
|
46
|
-
await execAsync('git --version');
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
throw new Error('Git command not found\n' +
|
|
50
|
-
'Suggestion: Install git to use diff functionality: https://git-scm.com/downloads');
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Check if the current directory is a git repository
|
|
55
|
-
*/
|
|
56
|
-
async checkGitRepository(cwd) {
|
|
57
|
-
try {
|
|
58
|
-
await execAsync('git rev-parse --git-dir', { cwd });
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
throw new Error('Not a git repository\n' +
|
|
62
|
-
'Suggestion: This directory is not under git version control. Initialize with \'git init\' to use diff functionality.');
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Get list of changed files
|
|
67
|
-
*/
|
|
68
|
-
async getChangedFiles(cwd, staged, filePath) {
|
|
69
|
-
const stagedFlag = staged ? '--staged' : '';
|
|
70
|
-
const fileArg = filePath ? `-- "${filePath}"` : '';
|
|
71
|
-
const command = `git diff --name-only ${stagedFlag} ${fileArg}`.trim();
|
|
72
|
-
try {
|
|
73
|
-
const { stdout } = await execAsync(command, { cwd });
|
|
74
|
-
return stdout
|
|
75
|
-
.trim()
|
|
76
|
-
.split('\n')
|
|
77
|
-
.filter(line => line.length > 0);
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
// If the command fails, return empty array (no changes)
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Get the full diff output
|
|
86
|
-
*/
|
|
87
|
-
async getDiffOutput(cwd, staged, filePath) {
|
|
88
|
-
const stagedFlag = staged ? '--staged' : '';
|
|
89
|
-
const fileArg = filePath ? `-- "${filePath}"` : '';
|
|
90
|
-
const command = `git diff ${stagedFlag} ${fileArg}`.trim();
|
|
91
|
-
try {
|
|
92
|
-
const { stdout } = await execAsync(command, { cwd, maxBuffer: 10 * 1024 * 1024 });
|
|
93
|
-
return stdout;
|
|
94
|
-
}
|
|
95
|
-
catch (error) {
|
|
96
|
-
if (error.code === 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER') {
|
|
97
|
-
throw new Error('Diff output too large. Try specifying a specific file with filePath parameter.');
|
|
98
|
-
}
|
|
99
|
-
throw error;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Truncate diff output to 500 lines maximum
|
|
104
|
-
*/
|
|
105
|
-
truncateDiff(diff) {
|
|
106
|
-
const lines = diff.split('\\n');
|
|
107
|
-
const maxLines = 500;
|
|
108
|
-
if (lines.length <= maxLines) {
|
|
109
|
-
return { truncatedDiff: diff, wasTruncated: false };
|
|
110
|
-
}
|
|
111
|
-
const truncatedLines = lines.slice(0, maxLines);
|
|
112
|
-
const remainingLines = lines.length - maxLines;
|
|
113
|
-
truncatedLines.push('');
|
|
114
|
-
truncatedLines.push(`[Diff truncated: ${remainingLines} more lines not shown]`);
|
|
115
|
-
truncatedLines.push(`Total lines: ${lines.length}`);
|
|
116
|
-
return {
|
|
117
|
-
truncatedDiff: truncatedLines.join('\\n'),
|
|
118
|
-
wasTruncated: true,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Normalize file paths to use forward slashes
|
|
123
|
-
*/
|
|
124
|
-
normalizeFilePaths(files) {
|
|
125
|
-
return files.map(file => file.replace(/\\\\/g, '/'));
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Handle errors with helpful messages
|
|
129
|
-
*/
|
|
130
|
-
handleError(error) {
|
|
131
|
-
if (error.message) {
|
|
132
|
-
return error;
|
|
133
|
-
}
|
|
134
|
-
return new Error(`Failed to get diff: ${error.toString()}\\n` +
|
|
135
|
-
'Suggestion: Ensure you are in a git repository and git is installed.');
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
4
|
/**
|
|
139
|
-
*
|
|
5
|
+
* Rewritten get_diff tool with action-based pattern and session scope support.
|
|
6
|
+
*
|
|
7
|
+
* Actions:
|
|
8
|
+
* - "overview" (default): Shows a compact summary of files changed.
|
|
9
|
+
* - "file_diff": Shows the detailed diff for a single specific file.
|
|
10
|
+
*
|
|
11
|
+
* Scopes:
|
|
12
|
+
* - "request" (default): Changes made in the current turn (since last user message).
|
|
13
|
+
* - "session": Cumulative changes made since the start of the conversation.
|
|
140
14
|
*/
|
|
141
15
|
export const getDiffTool = {
|
|
142
16
|
schema: {
|
|
143
17
|
name: 'get_diff',
|
|
144
|
-
description: `View changes
|
|
18
|
+
description: `View changes made during the current session.
|
|
145
19
|
|
|
146
|
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
- To check if your modifications worked as expected
|
|
150
|
-
- To see if there are any uncommitted changes
|
|
20
|
+
ACTIONS:
|
|
21
|
+
- action="overview" (default): Shows a compact summary of files changed with line counts. Does NOT show content.
|
|
22
|
+
- action="file_diff": Shows the detailed diff for ONE specific file. Requires filePath.
|
|
151
23
|
|
|
152
|
-
|
|
24
|
+
SCOPES (controlled by 'scope' parameter):
|
|
25
|
+
- scope="request" (default): Shows changes made only in the current turn (since the last user message).
|
|
26
|
+
- scope="session": Shows cumulative changes made since the beginning of the entire conversation.
|
|
27
|
+
|
|
28
|
+
WORKFLOW:
|
|
29
|
+
1. Call with action="overview" to see changed files.
|
|
30
|
+
2. If needed, call with action="file_diff" and filePath="<path>" to see details.
|
|
31
|
+
3. Use scope="session" to review all changes made during the conversation.`,
|
|
153
32
|
parameters: {
|
|
154
33
|
type: 'object',
|
|
155
34
|
properties: {
|
|
156
35
|
reason_text: {
|
|
157
36
|
type: 'string',
|
|
158
|
-
description: 'REQUIRED: Brief explanation of why you are checking the diff.
|
|
37
|
+
description: 'REQUIRED: Brief explanation of why you are checking the diff.'
|
|
159
38
|
},
|
|
160
|
-
|
|
39
|
+
action: {
|
|
161
40
|
type: 'string',
|
|
162
|
-
|
|
41
|
+
enum: ['overview', 'file_diff'],
|
|
42
|
+
description: 'The action to perform. "overview" (summary) or "file_diff" (detailed).'
|
|
163
43
|
},
|
|
164
|
-
|
|
165
|
-
type: '
|
|
166
|
-
|
|
44
|
+
scope: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
enum: ['request', 'session'],
|
|
47
|
+
description: 'Scope of changes. "request" (default): Current turn only. "session": Entire conversation history.'
|
|
48
|
+
},
|
|
49
|
+
filePath: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
description: 'The file path to get the detailed diff for. REQUIRED for action="file_diff".'
|
|
167
52
|
}
|
|
168
53
|
},
|
|
169
54
|
required: ['reason_text']
|
|
170
55
|
}
|
|
171
56
|
},
|
|
172
57
|
async execute(args, context) {
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
//
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
58
|
+
const action = args.action || 'overview';
|
|
59
|
+
const scope = args.scope || 'request';
|
|
60
|
+
const filePath = args.filePath;
|
|
61
|
+
const checkpointManager = context.checkpointManager;
|
|
62
|
+
let targetCheckpointId = context.currentCheckpointId;
|
|
63
|
+
// Determine current context (local vs remote) and handler
|
|
64
|
+
const currentContext = context.contextManager && typeof context.contextManager.getCurrentContext === 'function'
|
|
65
|
+
? context.contextManager.getCurrentContext()
|
|
66
|
+
: null;
|
|
67
|
+
const isRemote = currentContext && currentContext.type !== 'local';
|
|
68
|
+
let remoteHandler;
|
|
69
|
+
if (isRemote && currentContext.handler) {
|
|
70
|
+
if (typeof currentContext.handler.readFile === 'function' &&
|
|
71
|
+
typeof currentContext.handler.writeFile === 'function' &&
|
|
72
|
+
typeof currentContext.handler.executeCommand === 'function' &&
|
|
73
|
+
typeof currentContext.handler.isConnected === 'function') {
|
|
74
|
+
remoteHandler = currentContext.handler;
|
|
185
75
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
76
|
+
}
|
|
77
|
+
// Determine target checkpoint based on scope
|
|
78
|
+
if (checkpointManager && scope === 'session') {
|
|
79
|
+
try {
|
|
80
|
+
if (isRemote) {
|
|
81
|
+
const currentHost = currentContext?.metadata?.hostname;
|
|
82
|
+
const all = checkpointManager.list();
|
|
83
|
+
const matching = all.filter((cp) => {
|
|
84
|
+
if (cp.contextType !== currentContext.type)
|
|
85
|
+
return false;
|
|
86
|
+
if (!currentHost)
|
|
87
|
+
return true;
|
|
88
|
+
return cp.remoteSessionInfo?.hostname === currentHost;
|
|
89
|
+
});
|
|
90
|
+
if (matching.length > 0) {
|
|
91
|
+
const earliest = matching.reduce((a, b) => (a.createdAtMs < b.createdAtMs ? a : b));
|
|
92
|
+
targetCheckpointId = earliest.id;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
const initialCheckpoint = checkpointManager.getInitialCheckpoint();
|
|
97
|
+
if (initialCheckpoint) {
|
|
98
|
+
targetCheckpointId = initialCheckpoint.id;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
191
101
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
output += `\\n**Note:** Output was truncated. Use filePath parameter to see specific file changes.\\n`;
|
|
102
|
+
catch (e) {
|
|
103
|
+
// Fallback to current if getting initial fails
|
|
195
104
|
}
|
|
196
|
-
return output;
|
|
197
105
|
}
|
|
198
|
-
|
|
199
|
-
|
|
106
|
+
switch (action) {
|
|
107
|
+
case 'overview':
|
|
108
|
+
return handleOverview(checkpointManager, targetCheckpointId, context.cwd, scope, isRemote, remoteHandler);
|
|
109
|
+
case 'file_diff':
|
|
110
|
+
if (!filePath) {
|
|
111
|
+
throw new Error('Missing required parameter "filePath" for action "file_diff".');
|
|
112
|
+
}
|
|
113
|
+
return handleFileDiff(checkpointManager, targetCheckpointId, filePath, context.cwd, scope, isRemote, remoteHandler);
|
|
114
|
+
default:
|
|
115
|
+
throw new Error(`Unknown action "${action}". Valid actions are: "overview", "file_diff".`);
|
|
200
116
|
}
|
|
201
117
|
}
|
|
202
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* Handle the "overview" action
|
|
121
|
+
*/
|
|
122
|
+
async function handleOverview(checkpointManager, targetCheckpointId, cwd, scope, isRemote, remoteHandler) {
|
|
123
|
+
const scopeLabel = scope === 'session' ? 'Total Session Changes' : 'Current Request Changes';
|
|
124
|
+
// Try checkpoint-based changes
|
|
125
|
+
if (checkpointManager && targetCheckpointId) {
|
|
126
|
+
try {
|
|
127
|
+
const sessionData = await checkpointManager.getSessionChanges(targetCheckpointId, remoteHandler);
|
|
128
|
+
if (sessionData) {
|
|
129
|
+
const { changes, stats } = sessionData;
|
|
130
|
+
const totalFiles = changes.added.length + changes.modified.length + changes.deleted.length;
|
|
131
|
+
if (totalFiles === 0) {
|
|
132
|
+
// Return JSON with empty summary
|
|
133
|
+
return JSON.stringify({
|
|
134
|
+
result: `No changes detected in ${scope} scope.`,
|
|
135
|
+
summary: `No changes (${scope})`
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
let output = `## ${scopeLabel} Overview\n\n`;
|
|
139
|
+
output += `**${totalFiles} file(s) changed** (${changes.modified.length} modified, ${changes.added.length} added, ${changes.deleted.length} deleted)\n\n`;
|
|
140
|
+
let totalInsertions = 0;
|
|
141
|
+
let totalDeletions = 0;
|
|
142
|
+
if (changes.modified.length > 0) {
|
|
143
|
+
output += `**Modified:**\n`;
|
|
144
|
+
for (const filePath of changes.modified) {
|
|
145
|
+
const stat = stats.find((s) => s.filePath === filePath);
|
|
146
|
+
if (stat) {
|
|
147
|
+
output += ` - ${filePath} (+${stat.insertions}, -${stat.deletions})\n`;
|
|
148
|
+
totalInsertions += stat.insertions;
|
|
149
|
+
totalDeletions += stat.deletions;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
output += ` - ${filePath}\n`;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
output += '\n';
|
|
156
|
+
}
|
|
157
|
+
if (changes.added.length > 0) {
|
|
158
|
+
output += `**Added:**\n`;
|
|
159
|
+
for (const filePath of changes.added) {
|
|
160
|
+
const stat = stats.find((s) => s.filePath === filePath);
|
|
161
|
+
if (stat) {
|
|
162
|
+
output += ` - ${filePath} (${stat.insertions} lines)\n`;
|
|
163
|
+
totalInsertions += stat.insertions;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
output += ` - ${filePath}\n`;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
output += '\n';
|
|
170
|
+
}
|
|
171
|
+
if (changes.deleted.length > 0) {
|
|
172
|
+
output += `**Deleted:**\n`;
|
|
173
|
+
for (const filePath of changes.deleted) {
|
|
174
|
+
const stat = stats.find((s) => s.filePath === filePath);
|
|
175
|
+
if (stat) {
|
|
176
|
+
output += ` - ${filePath} (${stat.deletions} lines)\n`;
|
|
177
|
+
totalDeletions += stat.deletions;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
output += ` - ${filePath}\n`;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
output += '\n';
|
|
184
|
+
}
|
|
185
|
+
output += `To see detailed diff for a file, use action="file_diff" with filePath and scope="${scope}".`;
|
|
186
|
+
// Create concise summary for UI
|
|
187
|
+
const summary = `${totalFiles} file(s) changed (+${totalInsertions}, -${totalDeletions})`;
|
|
188
|
+
return JSON.stringify({
|
|
189
|
+
result: output,
|
|
190
|
+
summary: summary
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
// Fall through to git fallback
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// Fallback
|
|
199
|
+
if (isRemote) {
|
|
200
|
+
return JSON.stringify({
|
|
201
|
+
result: 'No checkpoint data available for this remote session. Reconnect to the session where the checkpoint was created.',
|
|
202
|
+
summary: 'No remote checkpoint'
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
return await gitDiffStatFallback(cwd, scope);
|
|
206
|
+
return await gitDiffStatFallback(cwd, scope);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Handle the "file_diff" action
|
|
210
|
+
*/
|
|
211
|
+
async function handleFileDiff(checkpointManager, targetCheckpointId, filePath, cwd, scope, isRemote, remoteHandler) {
|
|
212
|
+
const scopeLabel = scope === 'session' ? 'Session' : 'Request';
|
|
213
|
+
// Try checkpoint-based diff
|
|
214
|
+
if (checkpointManager && targetCheckpointId) {
|
|
215
|
+
try {
|
|
216
|
+
const diff = await checkpointManager.getFileDiff(targetCheckpointId, filePath, remoteHandler);
|
|
217
|
+
if (diff !== null) {
|
|
218
|
+
// Calculate lines added/deleted from diff string
|
|
219
|
+
const lines = diff.split('\n');
|
|
220
|
+
const added = lines.filter((l) => l.startsWith('+') && !l.startsWith('+++')).length;
|
|
221
|
+
const deleted = lines.filter((l) => l.startsWith('-') && !l.startsWith('---')).length;
|
|
222
|
+
const summary = `${filePath} (+${added}, -${deleted})`;
|
|
223
|
+
return JSON.stringify({
|
|
224
|
+
result: `## ${scopeLabel} Diff: ${filePath}\n\n\`\`\`diff\n${diff}\n\`\`\``,
|
|
225
|
+
summary: summary
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
return JSON.stringify({
|
|
229
|
+
result: `No changes found for "${filePath}" in ${scope} scope.`,
|
|
230
|
+
summary: `No changes: ${filePath}`
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
// Fall through to git fallback
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// Fallback
|
|
238
|
+
if (isRemote) {
|
|
239
|
+
return JSON.stringify({
|
|
240
|
+
result: `No checkpoint data available for remote diff of "${filePath}". Reconnect to the session where the checkpoint was created.`,
|
|
241
|
+
summary: `No remote checkpoint: ${filePath}`
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
return await gitDiffFileFallback(cwd, filePath, scope);
|
|
245
|
+
return await gitDiffFileFallback(cwd, filePath, scope);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Fallback: git diff --stat
|
|
249
|
+
*/
|
|
250
|
+
async function gitDiffStatFallback(cwd, scope) {
|
|
251
|
+
const scopeNote = scope === 'session' ? '(Session scope requested, but using git status as fallback)' : '(Request scope requested, using git status as fallback)';
|
|
252
|
+
try {
|
|
253
|
+
await execAsync('git rev-parse --git-dir', { cwd });
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
return JSON.stringify({
|
|
257
|
+
result: 'No active checkpoint available and not in a git repository.',
|
|
258
|
+
summary: 'No git repo'
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
try {
|
|
262
|
+
// If session scope requested but no checkpoint, we can only really show current git status
|
|
263
|
+
// which effectively IS "session changes" if user commits between sessions?
|
|
264
|
+
// Actually git diff shows uncommitted changes.
|
|
265
|
+
const { stdout } = await execAsync('git diff --stat', { cwd, maxBuffer: 5 * 1024 * 1024 });
|
|
266
|
+
if (!stdout.trim()) {
|
|
267
|
+
return JSON.stringify({
|
|
268
|
+
result: 'No changes detected (git diff --stat empty).',
|
|
269
|
+
summary: 'No git changes'
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
// Extract file count from git diff --stat output
|
|
273
|
+
// Example: " 2 files changed, 10 insertions(+), 5 deletions(-)"
|
|
274
|
+
const lines = stdout.trim().split('\n');
|
|
275
|
+
const lastLine = lines[lines.length - 1].trim();
|
|
276
|
+
return JSON.stringify({
|
|
277
|
+
result: `## Git Diff Summary ${scopeNote}\n\n\`\`\`\n${stdout.trim()}\n\`\`\`\n\nNote: This is a git-based summary because checkpoints were unavailable.`,
|
|
278
|
+
summary: lastLine || 'Git changes detected'
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
throw new Error(`Failed to get git diff stat: ${error.message}`);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Fallback: git diff file
|
|
287
|
+
*/
|
|
288
|
+
async function gitDiffFileFallback(cwd, filePath, scope) {
|
|
289
|
+
try {
|
|
290
|
+
await execAsync('git rev-parse --git-dir', { cwd });
|
|
291
|
+
}
|
|
292
|
+
catch {
|
|
293
|
+
return JSON.stringify({
|
|
294
|
+
result: `No active checkpoint and not in a git repo. Cannot diff "${filePath}".`,
|
|
295
|
+
summary: 'No git repo'
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
try {
|
|
299
|
+
const { stdout } = await execAsync(`git diff -- "${filePath}"`, { cwd, maxBuffer: 5 * 1024 * 1024 });
|
|
300
|
+
if (!stdout.trim()) {
|
|
301
|
+
return JSON.stringify({
|
|
302
|
+
result: `No changes detected in "${filePath}" (via git diff).`,
|
|
303
|
+
summary: `No changes: ${filePath}`
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
// Calculate lines added/deleted
|
|
307
|
+
const lines = stdout.split('\n');
|
|
308
|
+
const added = lines.filter((l) => l.startsWith('+') && !l.startsWith('+++')).length;
|
|
309
|
+
const deleted = lines.filter((l) => l.startsWith('-') && !l.startsWith('---')).length;
|
|
310
|
+
const summary = `${filePath} (git: +${added}, -${deleted})`;
|
|
311
|
+
return JSON.stringify({
|
|
312
|
+
result: `## Git Diff: ${filePath} (${scope})\n\n\`\`\`diff\n${stdout.trim()}\n\`\`\``,
|
|
313
|
+
summary: summary
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
catch (error) {
|
|
317
|
+
throw new Error(`Failed to get git diff for "${filePath}": ${error.message}`);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
203
320
|
//# sourceMappingURL=get-diff.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-diff.js","sourceRoot":"","sources":["../../src/tools/get-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"get-diff.js","sourceRoot":"","sources":["../../src/tools/get-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAIjC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,MAAM,EAAE;QACN,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE;;;;;;;;;;;;;2EAa0D;QACvE,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,+DAA+D;iBAC7E;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;oBAC/B,WAAW,EAAE,wEAAwE;iBACtF;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;oBAC5B,WAAW,EAAE,mGAAmG;iBACjH;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,8EAA8E;iBAC5F;aACF;YACD,QAAQ,EAAE,CAAC,aAAa,CAAC;SAC1B;KACF;IAED,KAAK,CAAC,OA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