erosolar-cli 1.7.162 → 1.7.164
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/contracts/unified-schema.json +6 -6
- package/dist/core/unified/tools.d.ts.map +1 -1
- package/dist/core/unified/tools.js +12 -34
- package/dist/core/unified/tools.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts +9 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +82 -50
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/unifiedChatBox.d.ts +178 -0
- package/dist/shell/unifiedChatBox.d.ts.map +1 -0
- package/dist/shell/unifiedChatBox.js +539 -0
- package/dist/shell/unifiedChatBox.js.map +1 -0
- package/dist/tools/diffUtils.d.ts +1 -1
- package/dist/tools/diffUtils.d.ts.map +1 -1
- package/dist/tools/diffUtils.js +19 -3
- package/dist/tools/diffUtils.js.map +1 -1
- package/dist/tools/editTools.d.ts +11 -0
- package/dist/tools/editTools.d.ts.map +1 -1
- package/dist/tools/editTools.js +137 -118
- package/dist/tools/editTools.js.map +1 -1
- package/dist/tools/softwareEngineeringTools.d.ts +7 -0
- package/dist/tools/softwareEngineeringTools.d.ts.map +1 -0
- package/dist/tools/softwareEngineeringTools.js +338 -0
- package/dist/tools/softwareEngineeringTools.js.map +1 -0
- package/package.json +1 -1
|
@@ -15,4 +15,15 @@ import type { ToolDefinition } from '../core/toolRuntime.js';
|
|
|
15
15
|
* @returns Array containing the Edit tool definition
|
|
16
16
|
*/
|
|
17
17
|
export declare function createEditTools(workingDir: string): ToolDefinition[];
|
|
18
|
+
export interface EditArguments {
|
|
19
|
+
file_path?: unknown;
|
|
20
|
+
old_string?: unknown;
|
|
21
|
+
new_string?: unknown;
|
|
22
|
+
replace_all?: unknown;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Shared edit executor used by both legacy and unified tool flows.
|
|
26
|
+
* Provides consistent validation, creation/deletion handling, and diff output.
|
|
27
|
+
*/
|
|
28
|
+
export declare function performSurgicalEdit(workingDir: string, args: EditArguments | Record<string, unknown>): Promise<string>;
|
|
18
29
|
//# sourceMappingURL=editTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editTools.d.ts","sourceRoot":"","sources":["../../src/tools/editTools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI7D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,EAAE,CA+
|
|
1
|
+
{"version":3,"file":"editTools.d.ts","sourceRoot":"","sources":["../../src/tools/editTools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI7D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,EAAE,CAkCpE;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5C,OAAO,CAAC,MAAM,CAAC,CA+IjB"}
|
package/dist/tools/editTools.js
CHANGED
|
@@ -21,7 +21,7 @@ export function createEditTools(workingDir) {
|
|
|
21
21
|
return [
|
|
22
22
|
{
|
|
23
23
|
name: 'Edit',
|
|
24
|
-
description: 'Performs exact string replacements in files. Use for surgical edits when you know the exact text to replace. To
|
|
24
|
+
description: 'Performs exact string replacements in files. Use for surgical edits when you know the exact text to replace. To CREATE a new file, use empty old_string. To DELETE text, use empty new_string. The edit will FAIL if old_string is not unique unless replace_all is true.',
|
|
25
25
|
parameters: {
|
|
26
26
|
type: 'object',
|
|
27
27
|
properties: {
|
|
@@ -35,130 +35,149 @@ export function createEditTools(workingDir) {
|
|
|
35
35
|
},
|
|
36
36
|
new_string: {
|
|
37
37
|
type: 'string',
|
|
38
|
-
description: 'The text to replace it with,
|
|
38
|
+
description: 'The text to replace it with. Use empty string "" to delete the old_string. For new files, this is the full content. Defaults to "" when omitted.',
|
|
39
39
|
},
|
|
40
40
|
replace_all: {
|
|
41
41
|
type: 'boolean',
|
|
42
42
|
description: 'Replace all occurrences of old_string (default false). When false, the edit fails if old_string appears multiple times.',
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
|
-
required: ['file_path', 'old_string'
|
|
45
|
+
required: ['file_path', 'old_string'],
|
|
46
46
|
additionalProperties: false,
|
|
47
47
|
},
|
|
48
|
-
handler: async (args) =>
|
|
49
|
-
const pathArg = args['file_path'];
|
|
50
|
-
const oldString = args['old_string'];
|
|
51
|
-
const newString = args['new_string'];
|
|
52
|
-
const replaceAll = args['replace_all'] === true;
|
|
53
|
-
// Validate inputs
|
|
54
|
-
if (typeof pathArg !== 'string' || !pathArg.trim()) {
|
|
55
|
-
return 'Error: file_path must be a non-empty string.';
|
|
56
|
-
}
|
|
57
|
-
if (typeof oldString !== 'string') {
|
|
58
|
-
return 'Error: old_string must be a string.';
|
|
59
|
-
}
|
|
60
|
-
if (typeof newString !== 'string') {
|
|
61
|
-
return 'Error: new_string must be a string.';
|
|
62
|
-
}
|
|
63
|
-
if (oldString === newString) {
|
|
64
|
-
return 'Error: old_string and new_string must be different.';
|
|
65
|
-
}
|
|
66
|
-
try {
|
|
67
|
-
const filePath = resolveFilePath(workingDir, pathArg);
|
|
68
|
-
// Check if file exists
|
|
69
|
-
let fileExists = false;
|
|
70
|
-
try {
|
|
71
|
-
await stat(filePath);
|
|
72
|
-
fileExists = true;
|
|
73
|
-
}
|
|
74
|
-
catch {
|
|
75
|
-
fileExists = false;
|
|
76
|
-
}
|
|
77
|
-
// Handle file creation mode (empty old_string)
|
|
78
|
-
if (oldString === '') {
|
|
79
|
-
if (fileExists) {
|
|
80
|
-
return `Error: File already exists: ${filePath}\nTo modify an existing file, provide the exact text to replace in old_string.`;
|
|
81
|
-
}
|
|
82
|
-
// Create parent directories if needed
|
|
83
|
-
const dir = dirname(filePath);
|
|
84
|
-
await mkdir(dir, { recursive: true });
|
|
85
|
-
// Write new file
|
|
86
|
-
await writeFile(filePath, newString, 'utf-8');
|
|
87
|
-
const relativePath = relative(workingDir, filePath);
|
|
88
|
-
const displayPath = relativePath && !relativePath.startsWith('..') ? relativePath : filePath;
|
|
89
|
-
const lineCount = newString.split('\n').length;
|
|
90
|
-
return [
|
|
91
|
-
`✓ Created ${displayPath}`,
|
|
92
|
-
`${lineCount} line${lineCount === 1 ? '' : 's'} written`,
|
|
93
|
-
].join('\n');
|
|
94
|
-
}
|
|
95
|
-
// For modifications, file must exist
|
|
96
|
-
if (!fileExists) {
|
|
97
|
-
return `Error: File not found: ${filePath}\nTo create a new file, use empty old_string ("").`;
|
|
98
|
-
}
|
|
99
|
-
// Read current content (async for speed)
|
|
100
|
-
const currentContent = await readFile(filePath, 'utf-8');
|
|
101
|
-
// Check if old_string exists in file
|
|
102
|
-
if (!currentContent.includes(oldString)) {
|
|
103
|
-
// Provide helpful debugging info when match fails
|
|
104
|
-
const firstLine = oldString.split('\n')[0] || '';
|
|
105
|
-
const hints = findSimilarLines(currentContent, firstLine, filePath);
|
|
106
|
-
return [
|
|
107
|
-
'Error: old_string not found in file.',
|
|
108
|
-
'',
|
|
109
|
-
`File: ${filePath}`,
|
|
110
|
-
`Searching for: ${JSON.stringify(firstLine.substring(0, 80))}${firstLine.length > 80 ? '...' : ''}`,
|
|
111
|
-
'',
|
|
112
|
-
hints,
|
|
113
|
-
'',
|
|
114
|
-
'Tips:',
|
|
115
|
-
'- Ensure exact whitespace/indentation matches',
|
|
116
|
-
'- Copy text directly from Read output',
|
|
117
|
-
'- Check for tabs vs spaces',
|
|
118
|
-
].join('\n');
|
|
119
|
-
}
|
|
120
|
-
// Count occurrences
|
|
121
|
-
const occurrences = countOccurrences(currentContent, oldString);
|
|
122
|
-
if (!replaceAll && occurrences > 1) {
|
|
123
|
-
return `Error: old_string appears ${occurrences} times in the file. Either:\n1. Provide a larger unique string that includes more context\n2. Set replace_all: true to replace all ${occurrences} occurrences\n\nFile: ${filePath}`;
|
|
124
|
-
}
|
|
125
|
-
// Perform replacement
|
|
126
|
-
const newContent = replaceAll
|
|
127
|
-
? currentContent.split(oldString).join(newString)
|
|
128
|
-
: currentContent.replace(oldString, newString);
|
|
129
|
-
// Generate diff (fast in-memory algorithm, no git spawning)
|
|
130
|
-
const diffSegments = buildDiffSegmentsFast(currentContent, newContent);
|
|
131
|
-
// Write file (async for speed)
|
|
132
|
-
await writeFile(filePath, newContent, 'utf-8');
|
|
133
|
-
// Build summary
|
|
134
|
-
const relativePath = relative(workingDir, filePath);
|
|
135
|
-
const displayPath = relativePath && !relativePath.startsWith('..') ? relativePath : filePath;
|
|
136
|
-
const addedLines = diffSegments.filter(s => s.type === 'added').length;
|
|
137
|
-
const removedLines = diffSegments.filter(s => s.type === 'removed').length;
|
|
138
|
-
const occurrencesText = replaceAll ? ` (${occurrences} occurrence${occurrences > 1 ? 's' : ''})` : '';
|
|
139
|
-
const diffLines = formatDiffLines(diffSegments);
|
|
140
|
-
const diffBlock = diffLines.length > 0
|
|
141
|
-
? ['```diff', ...diffLines, '```'].join('\n')
|
|
142
|
-
: '(No visual diff - whitespace or formatting changes only)';
|
|
143
|
-
return [
|
|
144
|
-
`✓ Edited ${displayPath}${occurrencesText}`,
|
|
145
|
-
`Lines changed: +${addedLines} / -${removedLines}`,
|
|
146
|
-
'',
|
|
147
|
-
'Diff preview:',
|
|
148
|
-
diffBlock,
|
|
149
|
-
].join('\n');
|
|
150
|
-
}
|
|
151
|
-
catch (error) {
|
|
152
|
-
return buildError('editing file', error, {
|
|
153
|
-
file_path: pathArg,
|
|
154
|
-
old_string_length: typeof oldString === 'string' ? oldString.length : 0,
|
|
155
|
-
new_string_length: typeof newString === 'string' ? newString.length : 0,
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
},
|
|
48
|
+
handler: async (args) => performSurgicalEdit(workingDir, args),
|
|
159
49
|
},
|
|
160
50
|
];
|
|
161
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Shared edit executor used by both legacy and unified tool flows.
|
|
54
|
+
* Provides consistent validation, creation/deletion handling, and diff output.
|
|
55
|
+
*/
|
|
56
|
+
export async function performSurgicalEdit(workingDir, args) {
|
|
57
|
+
const pathArg = args['file_path'];
|
|
58
|
+
const oldString = args['old_string'];
|
|
59
|
+
const newStringRaw = args['new_string'];
|
|
60
|
+
const replaceAll = args['replace_all'] === true;
|
|
61
|
+
const newString = typeof newStringRaw === 'string' ? newStringRaw : '';
|
|
62
|
+
// Validate inputs
|
|
63
|
+
if (typeof pathArg !== 'string' || !pathArg.trim()) {
|
|
64
|
+
return 'Error: file_path must be a non-empty string.';
|
|
65
|
+
}
|
|
66
|
+
if (typeof oldString !== 'string') {
|
|
67
|
+
return 'Error: old_string must be a string (use "" for empty).';
|
|
68
|
+
}
|
|
69
|
+
if (newStringRaw !== undefined && typeof newStringRaw !== 'string') {
|
|
70
|
+
return 'Error: new_string must be a string (use "" for empty).';
|
|
71
|
+
}
|
|
72
|
+
// Only error if both are identical AND non-empty (no-op edit)
|
|
73
|
+
// Allow: empty old + content = create, content + empty new = delete
|
|
74
|
+
if (oldString === newString && oldString !== '') {
|
|
75
|
+
return 'Error: old_string and new_string are identical. No changes would be made.';
|
|
76
|
+
}
|
|
77
|
+
// Both empty is also a no-op
|
|
78
|
+
if (oldString === '' && newString === '') {
|
|
79
|
+
return 'Error: Both old_string and new_string are empty. Provide content to create a file or text to replace.';
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const filePath = resolveFilePath(workingDir, pathArg);
|
|
83
|
+
// Check if file exists
|
|
84
|
+
let fileExists = false;
|
|
85
|
+
try {
|
|
86
|
+
await stat(filePath);
|
|
87
|
+
fileExists = true;
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
fileExists = false;
|
|
91
|
+
}
|
|
92
|
+
// Handle file creation mode (empty old_string)
|
|
93
|
+
if (oldString === '') {
|
|
94
|
+
if (fileExists) {
|
|
95
|
+
return `Error: File already exists: ${filePath}\nTo modify an existing file, provide the exact text to replace in old_string.`;
|
|
96
|
+
}
|
|
97
|
+
// Create parent directories if needed
|
|
98
|
+
const dir = dirname(filePath);
|
|
99
|
+
await mkdir(dir, { recursive: true });
|
|
100
|
+
// Write new file
|
|
101
|
+
await writeFile(filePath, newString, 'utf-8');
|
|
102
|
+
const relativePath = relative(workingDir, filePath);
|
|
103
|
+
const displayPath = relativePath && !relativePath.startsWith('..') ? relativePath : filePath;
|
|
104
|
+
const lineCount = newString.split('\n').length;
|
|
105
|
+
const diffSegments = buildDiffSegmentsFast('', newString);
|
|
106
|
+
const addedLines = diffSegments.filter((s) => s.type === 'added').length;
|
|
107
|
+
const diffLines = formatDiffLines(diffSegments, true);
|
|
108
|
+
const diffBlock = diffLines.length > 0 ? diffLines.join('\n') : '(No visual diff - whitespace or formatting changes only)';
|
|
109
|
+
return [
|
|
110
|
+
`✓ Created ${displayPath}`,
|
|
111
|
+
`Lines changed: +${addedLines} / -0`,
|
|
112
|
+
`${lineCount} line${lineCount === 1 ? '' : 's'} written`,
|
|
113
|
+
'',
|
|
114
|
+
'Diff preview:',
|
|
115
|
+
diffBlock,
|
|
116
|
+
].join('\n');
|
|
117
|
+
}
|
|
118
|
+
// For modifications, file must exist
|
|
119
|
+
if (!fileExists) {
|
|
120
|
+
return `Error: File not found: ${filePath}\nTo create a new file, use empty old_string ("").`;
|
|
121
|
+
}
|
|
122
|
+
// Read current content (async for speed)
|
|
123
|
+
const currentContent = await readFile(filePath, 'utf-8');
|
|
124
|
+
// Check if old_string exists in file
|
|
125
|
+
if (!currentContent.includes(oldString)) {
|
|
126
|
+
// Provide helpful debugging info when match fails
|
|
127
|
+
const firstLine = oldString.split('\n')[0] || '';
|
|
128
|
+
const hints = findSimilarLines(currentContent, firstLine, filePath);
|
|
129
|
+
return [
|
|
130
|
+
'Error: old_string not found in file.',
|
|
131
|
+
'',
|
|
132
|
+
`File: ${filePath}`,
|
|
133
|
+
`Searching for: ${JSON.stringify(firstLine.substring(0, 80))}${firstLine.length > 80 ? '...' : ''}`,
|
|
134
|
+
'',
|
|
135
|
+
hints,
|
|
136
|
+
'',
|
|
137
|
+
'Tips:',
|
|
138
|
+
'- Ensure exact whitespace/indentation matches',
|
|
139
|
+
'- Copy text directly from Read output',
|
|
140
|
+
'- Check for tabs vs spaces',
|
|
141
|
+
].join('\n');
|
|
142
|
+
}
|
|
143
|
+
// Count occurrences
|
|
144
|
+
const occurrences = countOccurrences(currentContent, oldString);
|
|
145
|
+
if (!replaceAll && occurrences > 1) {
|
|
146
|
+
return `Error: old_string appears ${occurrences} times in the file. Either:\n1. Provide a larger unique string that includes more context\n2. Set replace_all: true to replace all ${occurrences} occurrences\n\nFile: ${filePath}`;
|
|
147
|
+
}
|
|
148
|
+
// Perform replacement
|
|
149
|
+
const newContent = replaceAll
|
|
150
|
+
? currentContent.split(oldString).join(newString)
|
|
151
|
+
: currentContent.replace(oldString, newString);
|
|
152
|
+
// Generate diff (fast in-memory algorithm, no git spawning)
|
|
153
|
+
const diffSegments = buildDiffSegmentsFast(currentContent, newContent);
|
|
154
|
+
// Write file (async for speed)
|
|
155
|
+
await writeFile(filePath, newContent, 'utf-8');
|
|
156
|
+
// Build summary
|
|
157
|
+
const relativePath = relative(workingDir, filePath);
|
|
158
|
+
const displayPath = relativePath && !relativePath.startsWith('..') ? relativePath : filePath;
|
|
159
|
+
const addedLines = diffSegments.filter((s) => s.type === 'added').length;
|
|
160
|
+
const removedLines = diffSegments.filter((s) => s.type === 'removed').length;
|
|
161
|
+
const occurrencesText = replaceAll ? ` (${occurrences} occurrence${occurrences > 1 ? 's' : ''})` : '';
|
|
162
|
+
// Format diff with colors for terminal display
|
|
163
|
+
const diffLines = formatDiffLines(diffSegments, true);
|
|
164
|
+
const diffBlock = diffLines.length > 0 ? diffLines.join('\n') : '(No visual diff - whitespace or formatting changes only)';
|
|
165
|
+
return [
|
|
166
|
+
`✓ Edited ${displayPath}${occurrencesText}`,
|
|
167
|
+
`Lines changed: +${addedLines} / -${removedLines}`,
|
|
168
|
+
'',
|
|
169
|
+
'Diff preview:',
|
|
170
|
+
diffBlock,
|
|
171
|
+
].join('\n');
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
return buildError('editing file', error, {
|
|
175
|
+
file_path: typeof pathArg === 'string' ? pathArg : '',
|
|
176
|
+
old_string_length: typeof oldString === 'string' ? oldString.length : 0,
|
|
177
|
+
new_string_length: typeof newString === 'string' ? newString.length : 0,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
162
181
|
function resolveFilePath(workingDir, path) {
|
|
163
182
|
const normalized = path.trim();
|
|
164
183
|
return normalized.startsWith('/') ? normalized : join(workingDir, normalized);
|
|
@@ -186,7 +205,7 @@ function findSimilarLines(content, searchFirstLine, _filePath) {
|
|
|
186
205
|
const searchNormalized = searchFirstLine.trim().toLowerCase();
|
|
187
206
|
const matches = [];
|
|
188
207
|
// Find lines that contain key words from the search
|
|
189
|
-
const searchWords = searchNormalized.split(/\s+/).filter(w => w.length > 2);
|
|
208
|
+
const searchWords = searchNormalized.split(/\s+/).filter((w) => w.length > 2);
|
|
190
209
|
for (let i = 0; i < lines.length; i++) {
|
|
191
210
|
const line = lines[i] || '';
|
|
192
211
|
const lineNormalized = line.trim().toLowerCase();
|
|
@@ -205,7 +224,7 @@ function findSimilarLines(content, searchFirstLine, _filePath) {
|
|
|
205
224
|
}
|
|
206
225
|
// Check for word overlap
|
|
207
226
|
if (searchWords.length > 0) {
|
|
208
|
-
const matchingWords = searchWords.filter(w => lineNormalized.includes(w));
|
|
227
|
+
const matchingWords = searchWords.filter((w) => lineNormalized.includes(w));
|
|
209
228
|
const similarity = matchingWords.length / searchWords.length;
|
|
210
229
|
if (similarity >= 0.5) {
|
|
211
230
|
matches.push({ lineNum: i + 1, line, similarity });
|
|
@@ -218,13 +237,13 @@ function findSimilarLines(content, searchFirstLine, _filePath) {
|
|
|
218
237
|
// Sort by similarity and take top 3
|
|
219
238
|
matches.sort((a, b) => b.similarity - a.similarity);
|
|
220
239
|
const topMatches = matches.slice(0, 3);
|
|
221
|
-
const suggestions = topMatches.map(m => {
|
|
240
|
+
const suggestions = topMatches.map((m) => {
|
|
222
241
|
const truncated = m.line.length > 80 ? m.line.substring(0, 77) + '...' : m.line;
|
|
223
242
|
const issueNote = m.issue ? ` (${m.issue})` : '';
|
|
224
243
|
return ` Line ${m.lineNum}${issueNote}: ${JSON.stringify(truncated)}`;
|
|
225
244
|
});
|
|
226
245
|
// Add auto-correction hint for whitespace issues
|
|
227
|
-
const whitespaceMatch = topMatches.find(m => m.issue);
|
|
246
|
+
const whitespaceMatch = topMatches.find((m) => m.issue);
|
|
228
247
|
if (whitespaceMatch) {
|
|
229
248
|
return `Similar lines found (possible whitespace mismatch):\n${suggestions.join('\n')}\n\nTip: Copy the exact text from Read output including indentation.`;
|
|
230
249
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editTools.js","sourceRoot":"","sources":["../../src/tools/editTools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAExE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UA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EAAE;QACvC,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAChF,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,OAAO,UAAU,CAAC,CAAC,OAAO,GAAG,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,iDAAiD;IACjD,MAAM,eAAe,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACxD,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,wDAAwD,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,sEAAsE,CAAC;IAC9J,CAAC;IAED,OAAO,yBAAyB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ToolDefinition } from '../core/toolRuntime.js';
|
|
2
|
+
/**
|
|
3
|
+
* Software Engineering Tools for enhanced code quality and development experience
|
|
4
|
+
* Provides real-time code analysis, complexity monitoring, and quality metrics
|
|
5
|
+
*/
|
|
6
|
+
export declare function createSoftwareEngineeringTools(workingDir: string): ToolDefinition[];
|
|
7
|
+
//# sourceMappingURL=softwareEngineeringTools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"softwareEngineeringTools.d.ts","sourceRoot":"","sources":["../../src/tools/softwareEngineeringTools.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,EAAE,CAkInF"}
|