claude-ide-bridge 2.4.2 → 2.4.4
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/README.md +8 -6
- package/dist/bridge.js +5 -0
- package/dist/bridge.js.map +1 -1
- package/dist/config.d.ts +8 -0
- package/dist/config.js +33 -1
- package/dist/config.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/oauth.d.ts +47 -32
- package/dist/oauth.js +331 -275
- package/dist/oauth.js.map +1 -1
- package/dist/server.d.ts +13 -0
- package/dist/server.js +93 -54
- package/dist/server.js.map +1 -1
- package/dist/tools/getBufferContent.js +2 -1
- package/dist/tools/getBufferContent.js.map +1 -1
- package/dist/tools/getDiagnostics.js +2 -1
- package/dist/tools/getDiagnostics.js.map +1 -1
- package/dist/tools/git-utils.js.map +1 -1
- package/dist/tools/handoffNote.d.ts +1 -0
- package/dist/tools/handoffNote.js +1 -1
- package/dist/tools/handoffNote.js.map +1 -1
- package/dist/tools/lsp.js +7 -2
- package/dist/tools/lsp.js.map +1 -1
- package/dist/tools/openFile.js +3 -1
- package/dist/tools/openFile.js.map +1 -1
- package/dist/tools/openInBrowser.js +49 -0
- package/dist/tools/openInBrowser.js.map +1 -1
- package/dist/tools/searchAndReplace.js.map +1 -1
- package/dist/tools/searchWorkspace.js.map +1 -1
- package/dist/tools/terminal.js +8 -7
- package/dist/tools/terminal.js.map +1 -1
- package/package.json +3 -3
- package/dist/tools/aiComments.d.ts +0 -26
- package/dist/tools/aiComments.js +0 -196
- package/dist/tools/aiComments.js.map +0 -1
- package/dist/tools/diffDebugger.d.ts +0 -62
- package/dist/tools/diffDebugger.js +0 -245
- package/dist/tools/diffDebugger.js.map +0 -1
- package/dist/tools/flowGuardian.d.ts +0 -61
- package/dist/tools/flowGuardian.js +0 -311
- package/dist/tools/flowGuardian.js.map +0 -1
- package/dist/tools/formatFile.d.ts +0 -28
- package/dist/tools/formatFile.js +0 -110
- package/dist/tools/formatFile.js.map +0 -1
- package/dist/tools/github/review.d.ts +0 -101
- package/dist/tools/github/review.js +0 -292
- package/dist/tools/github/review.js.map +0 -1
- package/dist/tools/github.d.ts +0 -308
- package/dist/tools/github.js +0 -656
- package/dist/tools/github.js.map +0 -1
- package/dist/tools/notebook.d.ts +0 -93
- package/dist/tools/notebook.js +0 -207
- package/dist/tools/notebook.js.map +0 -1
- package/dist/tools/tasks.d.ts +0 -56
- package/dist/tools/tasks.js +0 -170
- package/dist/tools/tasks.js.map +0 -1
- package/dist/tools/workspaceSnapshots.d.ts +0 -174
- package/dist/tools/workspaceSnapshots.js +0 -474
- package/dist/tools/workspaceSnapshots.js.map +0 -1
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
import fsp from "node:fs/promises";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { error, optionalString, requireString, resolveFilePath, success, } from "./utils.js";
|
|
4
|
-
function parseScopeSection(lines) {
|
|
5
|
-
const entries = [];
|
|
6
|
-
for (const line of lines) {
|
|
7
|
-
const match = line.match(/^- (.+)/);
|
|
8
|
-
if (!match)
|
|
9
|
-
continue;
|
|
10
|
-
let pattern = match[1]?.trim();
|
|
11
|
-
if (!pattern)
|
|
12
|
-
continue;
|
|
13
|
-
const isNegation = pattern.startsWith("!");
|
|
14
|
-
if (isNegation)
|
|
15
|
-
pattern = pattern.slice(1);
|
|
16
|
-
entries.push({
|
|
17
|
-
pattern,
|
|
18
|
-
isDirectory: pattern.endsWith("/"),
|
|
19
|
-
isGlob: pattern.includes("*"),
|
|
20
|
-
isNegation,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
return entries;
|
|
24
|
-
}
|
|
25
|
-
function matchesScopeEntry(relativePath, entry) {
|
|
26
|
-
if (entry.isGlob)
|
|
27
|
-
return matchesGlob(relativePath, entry.pattern);
|
|
28
|
-
if (entry.isDirectory) {
|
|
29
|
-
return (relativePath.startsWith(entry.pattern) ||
|
|
30
|
-
relativePath.startsWith(entry.pattern.slice(0, -1)));
|
|
31
|
-
}
|
|
32
|
-
return relativePath === entry.pattern;
|
|
33
|
-
}
|
|
34
|
-
function extractImplicitPaths(content) {
|
|
35
|
-
const paths = new Set();
|
|
36
|
-
// Backtick-wrapped paths
|
|
37
|
-
const backtickRegex = /`([\w./-]+(?:\.\w+)?)`/g;
|
|
38
|
-
let m;
|
|
39
|
-
while ((m = backtickRegex.exec(content)) !== null) {
|
|
40
|
-
const p = m[1];
|
|
41
|
-
if (p.includes("/") || p.includes("."))
|
|
42
|
-
paths.add(p);
|
|
43
|
-
}
|
|
44
|
-
// Bare path-like mentions (word/word.ext or word/word/)
|
|
45
|
-
const bareRegex = /(?:^|\s)((?:[\w-]+\/)+[\w.-]+)/gm;
|
|
46
|
-
while ((m = bareRegex.exec(content)) !== null) {
|
|
47
|
-
paths.add(m[1]);
|
|
48
|
-
}
|
|
49
|
-
return [...paths];
|
|
50
|
-
}
|
|
51
|
-
function matchesGlob(filePath, pattern) {
|
|
52
|
-
// Guard against ReDoS: reject overly complex patterns
|
|
53
|
-
if (pattern.length > 200)
|
|
54
|
-
return false;
|
|
55
|
-
if ((pattern.match(/\*/g) || []).length > 10)
|
|
56
|
-
return false;
|
|
57
|
-
// Collapse consecutive * (same fix as minimatch 10.2.1 for CVE-2026-27904)
|
|
58
|
-
const collapsed = pattern.replace(/\*{3,}/g, "**");
|
|
59
|
-
// Simple glob matching: ** matches any path segments, * matches within segment
|
|
60
|
-
const regexStr = collapsed
|
|
61
|
-
.replace(/[.+^${}()|[\]\\?]/g, "\\$&")
|
|
62
|
-
.replace(/\*\*/g, "§§")
|
|
63
|
-
.replace(/\*/g, "[^/]*")
|
|
64
|
-
.replace(/§§/g, ".*");
|
|
65
|
-
return new RegExp(`^${regexStr}$`).test(filePath);
|
|
66
|
-
}
|
|
67
|
-
export function createCheckScopeTool(workspace) {
|
|
68
|
-
return {
|
|
69
|
-
schema: {
|
|
70
|
-
name: "checkScope",
|
|
71
|
-
description: "Check whether a file path and operation are in-scope for the active plan (.claude-plan.md). Advisory only — returns scope status and suggested action.",
|
|
72
|
-
annotations: { readOnlyHint: true },
|
|
73
|
-
inputSchema: {
|
|
74
|
-
type: "object",
|
|
75
|
-
required: ["filePath"],
|
|
76
|
-
properties: {
|
|
77
|
-
filePath: {
|
|
78
|
-
type: "string",
|
|
79
|
-
description: "File path to check (absolute or relative to workspace)",
|
|
80
|
-
},
|
|
81
|
-
operation: {
|
|
82
|
-
type: "string",
|
|
83
|
-
enum: ["read", "write", "delete", "create"],
|
|
84
|
-
description: "Type of operation being considered. Default: 'write'",
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
additionalProperties: false,
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
handler: async (args) => {
|
|
91
|
-
const rawPath = requireString(args, "filePath");
|
|
92
|
-
const operation = optionalString(args, "operation") ?? "write";
|
|
93
|
-
const resolved = resolveFilePath(rawPath, workspace);
|
|
94
|
-
const relativePath = path.relative(workspace, resolved);
|
|
95
|
-
// Try to read the plan file
|
|
96
|
-
const planPath = path.join(workspace, ".claude-plan.md");
|
|
97
|
-
if (!(await fsp.access(planPath).then(() => true, () => false))) {
|
|
98
|
-
return success({
|
|
99
|
-
planFound: false,
|
|
100
|
-
inScope: true,
|
|
101
|
-
reason: "No active plan found — all operations permitted",
|
|
102
|
-
suggestedAction: "proceed",
|
|
103
|
-
scopeSection: false,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
const content = await fsp.readFile(planPath, "utf-8");
|
|
107
|
-
// Read operations are always in scope
|
|
108
|
-
if (operation === "read") {
|
|
109
|
-
return success({
|
|
110
|
-
planFound: true,
|
|
111
|
-
inScope: true,
|
|
112
|
-
reason: "Read operations are always in scope",
|
|
113
|
-
suggestedAction: "proceed",
|
|
114
|
-
scopeSection: false,
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
// Parse ## Scope section
|
|
118
|
-
const lines = content.split("\n");
|
|
119
|
-
let inScopeSection = false;
|
|
120
|
-
const scopeLines = [];
|
|
121
|
-
for (const line of lines) {
|
|
122
|
-
if (line.match(/^## Scope/i)) {
|
|
123
|
-
inScopeSection = true;
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
if (inScopeSection && line.match(/^## /))
|
|
127
|
-
break;
|
|
128
|
-
if (inScopeSection)
|
|
129
|
-
scopeLines.push(line);
|
|
130
|
-
}
|
|
131
|
-
const hasExplicitScope = scopeLines.length > 0;
|
|
132
|
-
const scopeEntries = parseScopeSection(scopeLines);
|
|
133
|
-
const implicitPaths = extractImplicitPaths(content);
|
|
134
|
-
// Check explicit scope entries
|
|
135
|
-
if (hasExplicitScope) {
|
|
136
|
-
// Check negations first — if a negation matches, block immediately
|
|
137
|
-
for (const entry of scopeEntries) {
|
|
138
|
-
if (entry.isNegation && matchesScopeEntry(relativePath, entry)) {
|
|
139
|
-
return success({
|
|
140
|
-
planFound: true,
|
|
141
|
-
inScope: false,
|
|
142
|
-
reason: `Excluded by negation pattern: !${entry.pattern}`,
|
|
143
|
-
suggestedAction: "block",
|
|
144
|
-
scopeSection: true,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
// Check positive scope entries
|
|
149
|
-
for (const entry of scopeEntries) {
|
|
150
|
-
if (entry.isNegation)
|
|
151
|
-
continue;
|
|
152
|
-
if (matchesScopeEntry(relativePath, entry)) {
|
|
153
|
-
const reason = entry.isGlob
|
|
154
|
-
? `Matches scope glob pattern: ${entry.pattern}`
|
|
155
|
-
: entry.isDirectory
|
|
156
|
-
? `Within scoped directory: ${entry.pattern}`
|
|
157
|
-
: `Exact match in scope: ${entry.pattern}`;
|
|
158
|
-
return success({
|
|
159
|
-
planFound: true,
|
|
160
|
-
inScope: true,
|
|
161
|
-
reason,
|
|
162
|
-
suggestedAction: "proceed",
|
|
163
|
-
scopeSection: true,
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
// Check if it's in a mentioned directory but not explicitly scoped
|
|
168
|
-
for (const p of implicitPaths) {
|
|
169
|
-
if (relativePath === p || relativePath.startsWith(`${p}/`)) {
|
|
170
|
-
return success({
|
|
171
|
-
planFound: true,
|
|
172
|
-
inScope: true,
|
|
173
|
-
reason: `Mentioned in plan body but not in explicit Scope section: ${p}`,
|
|
174
|
-
suggestedAction: "warn",
|
|
175
|
-
scopeSection: true,
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
const positiveEntries = scopeEntries.filter((e) => !e.isNegation);
|
|
180
|
-
return success({
|
|
181
|
-
planFound: true,
|
|
182
|
-
inScope: false,
|
|
183
|
-
reason: `Not matched by any Scope entry. Scoped to: ${positiveEntries.map((e) => e.pattern).join(", ")}`,
|
|
184
|
-
suggestedAction: "block",
|
|
185
|
-
scopeSection: true,
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
// No explicit scope — use implicit mentions
|
|
189
|
-
for (const p of implicitPaths) {
|
|
190
|
-
if (relativePath === p || relativePath.startsWith(`${p}/`)) {
|
|
191
|
-
return success({
|
|
192
|
-
planFound: true,
|
|
193
|
-
inScope: true,
|
|
194
|
-
reason: `Mentioned in plan: ${p}`,
|
|
195
|
-
suggestedAction: "proceed",
|
|
196
|
-
scopeSection: false,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
// Check if any implicit path shares a directory prefix
|
|
201
|
-
const relativeDir = path.dirname(relativePath);
|
|
202
|
-
for (const p of implicitPaths) {
|
|
203
|
-
const pDir = path.dirname(p);
|
|
204
|
-
if (relativeDir === pDir || relativeDir.startsWith(`${pDir}/`)) {
|
|
205
|
-
return success({
|
|
206
|
-
planFound: true,
|
|
207
|
-
inScope: true,
|
|
208
|
-
reason: `In same directory as plan-mentioned file: ${p}`,
|
|
209
|
-
suggestedAction: "proceed",
|
|
210
|
-
scopeSection: false,
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return success({
|
|
215
|
-
planFound: true,
|
|
216
|
-
inScope: false,
|
|
217
|
-
reason: "File not mentioned in plan",
|
|
218
|
-
suggestedAction: "warn",
|
|
219
|
-
scopeSection: false,
|
|
220
|
-
});
|
|
221
|
-
},
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
export function createExpandScopeTool(workspace) {
|
|
225
|
-
return {
|
|
226
|
-
schema: {
|
|
227
|
-
name: "expandScope",
|
|
228
|
-
description: "Add entries to the ## Scope section of the active plan (.claude-plan.md). Creates the section if it doesn't exist.",
|
|
229
|
-
inputSchema: {
|
|
230
|
-
type: "object",
|
|
231
|
-
required: ["entries"],
|
|
232
|
-
properties: {
|
|
233
|
-
entries: {
|
|
234
|
-
type: "array",
|
|
235
|
-
items: { type: "string" },
|
|
236
|
-
description: "Scope entries to add (e.g., 'src/utils/', '!dist/', '**/*.test.ts')",
|
|
237
|
-
},
|
|
238
|
-
fileName: {
|
|
239
|
-
type: "string",
|
|
240
|
-
description: "Plan filename (default: .claude-plan.md)",
|
|
241
|
-
},
|
|
242
|
-
},
|
|
243
|
-
additionalProperties: false,
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
|
-
handler: async (args) => {
|
|
247
|
-
const rawEntries = args.entries;
|
|
248
|
-
if (!Array.isArray(rawEntries) || rawEntries.length === 0) {
|
|
249
|
-
return error("entries must be a non-empty array of strings");
|
|
250
|
-
}
|
|
251
|
-
if (rawEntries.length > 100) {
|
|
252
|
-
return error("Maximum 100 scope entries allowed at once");
|
|
253
|
-
}
|
|
254
|
-
const entries = rawEntries
|
|
255
|
-
.filter((e) => typeof e === "string")
|
|
256
|
-
.map((e) => e.replace(/[\n\r]/g, "").trim())
|
|
257
|
-
.filter((e) => e.length > 0 && e.length <= 200);
|
|
258
|
-
if (entries.length === 0) {
|
|
259
|
-
return error("No valid entries provided");
|
|
260
|
-
}
|
|
261
|
-
const fileName = optionalString(args, "fileName") ?? ".claude-plan.md";
|
|
262
|
-
const planPath = resolveFilePath(fileName, workspace);
|
|
263
|
-
if (!(await fsp.access(planPath).then(() => true, () => false))) {
|
|
264
|
-
return error(`Plan file "${fileName}" not found. Use createPlan to create one.`);
|
|
265
|
-
}
|
|
266
|
-
const content = await fsp.readFile(planPath, "utf-8");
|
|
267
|
-
const lines = content.split("\n");
|
|
268
|
-
// Find ## Scope section
|
|
269
|
-
let scopeStart = -1;
|
|
270
|
-
let scopeEnd = lines.length;
|
|
271
|
-
for (let i = 0; i < lines.length; i++) {
|
|
272
|
-
if (lines[i]?.match(/^## Scope/i)) {
|
|
273
|
-
scopeStart = i;
|
|
274
|
-
for (let j = i + 1; j < lines.length; j++) {
|
|
275
|
-
if (lines[j]?.match(/^## /)) {
|
|
276
|
-
scopeEnd = j;
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
break;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
const newLines = entries.map((e) => `- ${e.trim()}`);
|
|
284
|
-
if (scopeStart === -1) {
|
|
285
|
-
// No Scope section — insert after frontmatter
|
|
286
|
-
let insertAt = 0;
|
|
287
|
-
if (lines[0]?.trim() === "---") {
|
|
288
|
-
for (let i = 1; i < lines.length; i++) {
|
|
289
|
-
if (lines[i]?.trim() === "---") {
|
|
290
|
-
insertAt = i + 1;
|
|
291
|
-
break;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
const section = ["", "## Scope", "", ...newLines, ""];
|
|
296
|
-
lines.splice(insertAt, 0, ...section);
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
// Insert before the next section (or end)
|
|
300
|
-
lines.splice(scopeEnd, 0, ...newLines);
|
|
301
|
-
}
|
|
302
|
-
await fsp.writeFile(planPath, lines.join("\n"), "utf-8");
|
|
303
|
-
return success({
|
|
304
|
-
expanded: true,
|
|
305
|
-
entriesAdded: entries.length,
|
|
306
|
-
entries,
|
|
307
|
-
});
|
|
308
|
-
},
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
//# sourceMappingURL=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AAE,EAAE,UAAU,EAAE,EAAE,EAAE,GAAG,QAAQ,EAAE,EAAE,CAAC,CAAC;gBACtD,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC;YACxC,CAAC;iBAAM,CAAC;gBACN,0CAA0C;gBAC1C,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC;YACzC,CAAC;YAED,MAAM,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;YAEzD,OAAO,OAAO,CAAC;gBACb,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,OAAO,CAAC,MAAM;gBAC5B,OAAO;aACR,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ProbeResults } from "../probe.js";
|
|
2
|
-
export declare function createFormatFileTool(workspace: string, probes: ProbeResults): {
|
|
3
|
-
schema: {
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
annotations: {
|
|
7
|
-
destructiveHint: boolean;
|
|
8
|
-
idempotentHint: boolean;
|
|
9
|
-
};
|
|
10
|
-
inputSchema: {
|
|
11
|
-
type: "object";
|
|
12
|
-
properties: {
|
|
13
|
-
filePath: {
|
|
14
|
-
type: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
required: string[];
|
|
19
|
-
additionalProperties: false;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
handler: (args: Record<string, unknown>, signal?: AbortSignal) => Promise<{
|
|
23
|
-
content: Array<{
|
|
24
|
-
type: string;
|
|
25
|
-
text: string;
|
|
26
|
-
}>;
|
|
27
|
-
}>;
|
|
28
|
-
};
|
package/dist/tools/formatFile.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { execSafe, requireString, resolveFilePath, success } from "./utils.js";
|
|
3
|
-
const JS_FORMATTERS = [
|
|
4
|
-
{
|
|
5
|
-
cmd: "prettier",
|
|
6
|
-
args: (f) => ["--write", f],
|
|
7
|
-
probe: "prettier",
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
cmd: "biome",
|
|
11
|
-
args: (f) => ["format", "--write", f],
|
|
12
|
-
probe: "biome",
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
cmd: "eslint",
|
|
16
|
-
args: (f) => ["--fix", f],
|
|
17
|
-
probe: "eslint",
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
const PY_FORMATTERS = [
|
|
21
|
-
{
|
|
22
|
-
cmd: "black",
|
|
23
|
-
args: (f) => [f],
|
|
24
|
-
probe: "black",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
cmd: "ruff",
|
|
28
|
-
args: (f) => ["format", f],
|
|
29
|
-
probe: "ruff",
|
|
30
|
-
},
|
|
31
|
-
];
|
|
32
|
-
const GO_FORMATTERS = [
|
|
33
|
-
{
|
|
34
|
-
cmd: "gofmt",
|
|
35
|
-
args: (f) => ["-w", f],
|
|
36
|
-
probe: "gofmt",
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
const RS_FORMATTERS = [
|
|
40
|
-
{
|
|
41
|
-
cmd: "rustfmt",
|
|
42
|
-
args: (f) => [f],
|
|
43
|
-
probe: "rustfmt",
|
|
44
|
-
},
|
|
45
|
-
];
|
|
46
|
-
const EXT_FORMATTERS = {
|
|
47
|
-
".ts": JS_FORMATTERS,
|
|
48
|
-
".tsx": JS_FORMATTERS,
|
|
49
|
-
".js": JS_FORMATTERS,
|
|
50
|
-
".jsx": JS_FORMATTERS,
|
|
51
|
-
".py": PY_FORMATTERS,
|
|
52
|
-
".go": GO_FORMATTERS,
|
|
53
|
-
".rs": RS_FORMATTERS,
|
|
54
|
-
};
|
|
55
|
-
export function createFormatFileTool(workspace, probes) {
|
|
56
|
-
return {
|
|
57
|
-
schema: {
|
|
58
|
-
name: "formatFile",
|
|
59
|
-
description: "Format a file in-place using the appropriate formatter for its language. Auto-detects the formatter based on file extension and available tools (e.g. prettier, biome, black, gofmt, rustfmt).",
|
|
60
|
-
annotations: { destructiveHint: true, idempotentHint: true },
|
|
61
|
-
inputSchema: {
|
|
62
|
-
type: "object",
|
|
63
|
-
properties: {
|
|
64
|
-
filePath: {
|
|
65
|
-
type: "string",
|
|
66
|
-
description: "Path to the file to format (relative to workspace)",
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
required: ["filePath"],
|
|
70
|
-
additionalProperties: false,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
handler: async (args, signal) => {
|
|
74
|
-
const rawPath = requireString(args, "filePath");
|
|
75
|
-
const resolved = resolveFilePath(rawPath, workspace);
|
|
76
|
-
const ext = path.extname(resolved).toLowerCase();
|
|
77
|
-
const candidates = EXT_FORMATTERS[ext];
|
|
78
|
-
if (!candidates || candidates.length === 0) {
|
|
79
|
-
return success({
|
|
80
|
-
success: false,
|
|
81
|
-
formatterUsed: null,
|
|
82
|
-
stdout: "",
|
|
83
|
-
stderr: `No formatter configured for extension "${ext}"`,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
const formatter = candidates.find((f) => probes[f.probe]);
|
|
87
|
-
if (!formatter) {
|
|
88
|
-
const names = candidates.map((f) => f.cmd).join(", ");
|
|
89
|
-
return success({
|
|
90
|
-
success: false,
|
|
91
|
-
formatterUsed: null,
|
|
92
|
-
stdout: "",
|
|
93
|
-
stderr: `No available formatter found. Tried: ${names}`,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
const result = await execSafe(formatter.cmd, formatter.args(resolved), {
|
|
97
|
-
cwd: workspace,
|
|
98
|
-
timeout: 30_000,
|
|
99
|
-
signal,
|
|
100
|
-
});
|
|
101
|
-
return success({
|
|
102
|
-
success: result.exitCode === 0,
|
|
103
|
-
formatterUsed: formatter.cmd,
|
|
104
|
-
stdout: result.stdout,
|
|
105
|
-
stderr: result.stderr,
|
|
106
|
-
});
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=formatFile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatFile.js","sourceRoot":"","sources":["../../src/tools/formatFile.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAQ/E,MAAM,aAAa,GAAsB;IACvC;QACE,GAAG,EAAE,UAAU;QACf,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;QAC3B,KAAK,EAAE,UAAU;KAClB;IACD;QACE,GAAG,EAAE,OAAO;QACZ,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;QACrC,KAAK,EAAE,OAAO;KACf;IACD;QACE,GAAG,EAAE,QAAQ;QACb,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACzB,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC;AAEF,MAAM,aAAa,GAAsB;IACvC;QACE,GAAG,EAAE,OAAO;QACZ,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAChB,KAAK,EAAE,OAAO;KACf;IACD;QACE,GAAG,EAAE,MAAM;QACX,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1B,KAAK,EAAE,MAAM;KACd;CACF,CAAC;AAEF,MAAM,aAAa,GAAsB;IACvC;QACE,GAAG,EAAE,OAAO;QACZ,IA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|
|
3
|
-
name: string;
|
|
4
|
-
description: string;
|
|
5
|
-
annotations: {
|
|
6
|
-
readOnlyHint: boolean;
|
|
7
|
-
openWorldHint: boolean;
|
|
8
|
-
};
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: "object";
|
|
11
|
-
required: string[];
|
|
12
|
-
properties: {
|
|
13
|
-
prNumber: {
|
|
14
|
-
type: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
repo: {
|
|
18
|
-
type: string;
|
|
19
|
-
description: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
additionalProperties: false;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
handler: (args: Record<string, unknown>, signal?: AbortSignal) => Promise<{
|
|
26
|
-
content: Array<{
|
|
27
|
-
type: string;
|
|
28
|
-
text: string;
|
|
29
|
-
}>;
|
|
30
|
-
}>;
|
|
31
|
-
timeoutMs: number;
|
|
32
|
-
};
|
|
33
|
-
export declare function createGithubPostPRReviewTool(workspace: string): {
|
|
34
|
-
schema: {
|
|
35
|
-
name: string;
|
|
36
|
-
description: string;
|
|
37
|
-
annotations: {
|
|
38
|
-
destructiveHint: boolean;
|
|
39
|
-
openWorldHint: boolean;
|
|
40
|
-
};
|
|
41
|
-
inputSchema: {
|
|
42
|
-
type: "object";
|
|
43
|
-
required: string[];
|
|
44
|
-
properties: {
|
|
45
|
-
prNumber: {
|
|
46
|
-
type: string;
|
|
47
|
-
description: string;
|
|
48
|
-
};
|
|
49
|
-
body: {
|
|
50
|
-
type: string;
|
|
51
|
-
description: string;
|
|
52
|
-
};
|
|
53
|
-
comments: {
|
|
54
|
-
type: string;
|
|
55
|
-
description: string;
|
|
56
|
-
items: {
|
|
57
|
-
type: string;
|
|
58
|
-
required: string[];
|
|
59
|
-
properties: {
|
|
60
|
-
path: {
|
|
61
|
-
type: string;
|
|
62
|
-
description: string;
|
|
63
|
-
};
|
|
64
|
-
line: {
|
|
65
|
-
type: string;
|
|
66
|
-
description: string;
|
|
67
|
-
};
|
|
68
|
-
side: {
|
|
69
|
-
type: string;
|
|
70
|
-
enum: string[];
|
|
71
|
-
description: string;
|
|
72
|
-
};
|
|
73
|
-
body: {
|
|
74
|
-
type: string;
|
|
75
|
-
description: string;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
additionalProperties: boolean;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
event: {
|
|
82
|
-
type: string;
|
|
83
|
-
enum: string[];
|
|
84
|
-
description: string;
|
|
85
|
-
};
|
|
86
|
-
repo: {
|
|
87
|
-
type: string;
|
|
88
|
-
description: string;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
additionalProperties: false;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
handler: (args: Record<string, unknown>, signal?: AbortSignal) => Promise<{
|
|
95
|
-
content: Array<{
|
|
96
|
-
type: string;
|
|
97
|
-
text: string;
|
|
98
|
-
}>;
|
|
99
|
-
}>;
|
|
100
|
-
timeoutMs: number;
|
|
101
|
-
};
|