claude-ide-bridge 1.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/LICENSE +21 -0
- package/README.md +263 -0
- package/dist/activityLog.d.ts +26 -0
- package/dist/activityLog.js +76 -0
- package/dist/activityLog.js.map +1 -0
- package/dist/bridge.d.ts +19 -0
- package/dist/bridge.js +277 -0
- package/dist/bridge.js.map +1 -0
- package/dist/config.d.ts +22 -0
- package/dist/config.js +221 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +16 -0
- package/dist/errors.js +20 -0
- package/dist/errors.js.map +1 -0
- package/dist/extensionClient.d.ts +193 -0
- package/dist/extensionClient.js +698 -0
- package/dist/extensionClient.js.map +1 -0
- package/dist/fileLock.d.ts +12 -0
- package/dist/fileLock.js +30 -0
- package/dist/fileLock.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/lockfile.d.ts +12 -0
- package/dist/lockfile.js +127 -0
- package/dist/lockfile.js.map +1 -0
- package/dist/logger.d.ts +16 -0
- package/dist/logger.js +68 -0
- package/dist/logger.js.map +1 -0
- package/dist/probe.d.ts +22 -0
- package/dist/probe.js +45 -0
- package/dist/probe.js.map +1 -0
- package/dist/server.d.ts +25 -0
- package/dist/server.js +265 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/activityLog.d.ts +39 -0
- package/dist/tools/activityLog.js +49 -0
- package/dist/tools/activityLog.js.map +1 -0
- package/dist/tools/aiComments.d.ts +26 -0
- package/dist/tools/aiComments.js +196 -0
- package/dist/tools/aiComments.js.map +1 -0
- package/dist/tools/bridgeStatus.d.ts +21 -0
- package/dist/tools/bridgeStatus.js +41 -0
- package/dist/tools/bridgeStatus.js.map +1 -0
- package/dist/tools/checkDocumentDirty.d.ts +28 -0
- package/dist/tools/checkDocumentDirty.js +61 -0
- package/dist/tools/checkDocumentDirty.js.map +1 -0
- package/dist/tools/clipboard.d.ts +50 -0
- package/dist/tools/clipboard.js +82 -0
- package/dist/tools/clipboard.js.map +1 -0
- package/dist/tools/closeTabs.d.ts +49 -0
- package/dist/tools/closeTabs.js +77 -0
- package/dist/tools/closeTabs.js.map +1 -0
- package/dist/tools/debug.d.ts +154 -0
- package/dist/tools/debug.js +248 -0
- package/dist/tools/debug.js.map +1 -0
- package/dist/tools/decorations.d.ts +92 -0
- package/dist/tools/decorations.js +150 -0
- package/dist/tools/decorations.js.map +1 -0
- package/dist/tools/diffDebugger.d.ts +62 -0
- package/dist/tools/diffDebugger.js +245 -0
- package/dist/tools/diffDebugger.js.map +1 -0
- package/dist/tools/editText.d.ts +80 -0
- package/dist/tools/editText.js +274 -0
- package/dist/tools/editText.js.map +1 -0
- package/dist/tools/fileOperations.d.ts +111 -0
- package/dist/tools/fileOperations.js +280 -0
- package/dist/tools/fileOperations.js.map +1 -0
- package/dist/tools/fileWatcher.d.ts +54 -0
- package/dist/tools/fileWatcher.js +100 -0
- package/dist/tools/fileWatcher.js.map +1 -0
- package/dist/tools/findFiles.d.ts +31 -0
- package/dist/tools/findFiles.js +119 -0
- package/dist/tools/findFiles.js.map +1 -0
- package/dist/tools/fixAllLintErrors.d.ts +29 -0
- package/dist/tools/fixAllLintErrors.js +114 -0
- package/dist/tools/fixAllLintErrors.js.map +1 -0
- package/dist/tools/flowGuardian.d.ts +61 -0
- package/dist/tools/flowGuardian.js +311 -0
- package/dist/tools/flowGuardian.js.map +1 -0
- package/dist/tools/formatDocument.d.ts +30 -0
- package/dist/tools/formatDocument.js +132 -0
- package/dist/tools/formatDocument.js.map +1 -0
- package/dist/tools/formatFile.d.ts +28 -0
- package/dist/tools/formatFile.js +110 -0
- package/dist/tools/formatFile.js.map +1 -0
- package/dist/tools/getBufferContent.d.ts +38 -0
- package/dist/tools/getBufferContent.js +100 -0
- package/dist/tools/getBufferContent.js.map +1 -0
- package/dist/tools/getCurrentSelection.d.ts +43 -0
- package/dist/tools/getCurrentSelection.js +75 -0
- package/dist/tools/getCurrentSelection.js.map +1 -0
- package/dist/tools/getDiagnostics.d.ts +38 -0
- package/dist/tools/getDiagnostics.js +204 -0
- package/dist/tools/getDiagnostics.js.map +1 -0
- package/dist/tools/getDocumentSymbols.d.ts +27 -0
- package/dist/tools/getDocumentSymbols.js +133 -0
- package/dist/tools/getDocumentSymbols.js.map +1 -0
- package/dist/tools/getFileTree.d.ts +36 -0
- package/dist/tools/getFileTree.js +111 -0
- package/dist/tools/getFileTree.js.map +1 -0
- package/dist/tools/getGitDiff.d.ts +34 -0
- package/dist/tools/getGitDiff.js +57 -0
- package/dist/tools/getGitDiff.js.map +1 -0
- package/dist/tools/getGitLog.d.ts +30 -0
- package/dist/tools/getGitLog.js +65 -0
- package/dist/tools/getGitLog.js.map +1 -0
- package/dist/tools/getGitStatus.d.ts +26 -0
- package/dist/tools/getGitStatus.js +95 -0
- package/dist/tools/getGitStatus.js.map +1 -0
- package/dist/tools/getOpenEditors.d.ts +21 -0
- package/dist/tools/getOpenEditors.js +84 -0
- package/dist/tools/getOpenEditors.js.map +1 -0
- package/dist/tools/getProjectInfo.d.ts +20 -0
- package/dist/tools/getProjectInfo.js +315 -0
- package/dist/tools/getProjectInfo.js.map +1 -0
- package/dist/tools/getToolCapabilities.d.ts +23 -0
- package/dist/tools/getToolCapabilities.js +249 -0
- package/dist/tools/getToolCapabilities.js.map +1 -0
- package/dist/tools/getWorkspaceFolders.d.ts +21 -0
- package/dist/tools/getWorkspaceFolders.js +47 -0
- package/dist/tools/getWorkspaceFolders.js.map +1 -0
- package/dist/tools/gitHistory.d.ts +78 -0
- package/dist/tools/gitHistory.js +151 -0
- package/dist/tools/gitHistory.js.map +1 -0
- package/dist/tools/gitWrite.d.ts +335 -0
- package/dist/tools/gitWrite.js +859 -0
- package/dist/tools/gitWrite.js.map +1 -0
- package/dist/tools/github/actions.d.ts +67 -0
- package/dist/tools/github/actions.js +155 -0
- package/dist/tools/github/actions.js.map +1 -0
- package/dist/tools/github/index.d.ts +4 -0
- package/dist/tools/github/index.js +5 -0
- package/dist/tools/github/index.js.map +1 -0
- package/dist/tools/github/issues.d.ts +140 -0
- package/dist/tools/github/issues.js +279 -0
- package/dist/tools/github/issues.js.map +1 -0
- package/dist/tools/github/pr.d.ts +101 -0
- package/dist/tools/github/pr.js +215 -0
- package/dist/tools/github/pr.js.map +1 -0
- package/dist/tools/github/review.d.ts +101 -0
- package/dist/tools/github/review.js +292 -0
- package/dist/tools/github/review.js.map +1 -0
- package/dist/tools/github/shared.d.ts +4 -0
- package/dist/tools/github/shared.js +12 -0
- package/dist/tools/github/shared.js.map +1 -0
- package/dist/tools/github.d.ts +308 -0
- package/dist/tools/github.js +656 -0
- package/dist/tools/github.js.map +1 -0
- package/dist/tools/hoverAtCursor.d.ts +22 -0
- package/dist/tools/hoverAtCursor.js +51 -0
- package/dist/tools/hoverAtCursor.js.map +1 -0
- package/dist/tools/httpClient.d.ts +83 -0
- package/dist/tools/httpClient.js +335 -0
- package/dist/tools/httpClient.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.js +246 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/inlayHints.d.ts +38 -0
- package/dist/tools/inlayHints.js +56 -0
- package/dist/tools/inlayHints.js.map +1 -0
- package/dist/tools/linters/biome.d.ts +2 -0
- package/dist/tools/linters/biome.js +44 -0
- package/dist/tools/linters/biome.js.map +1 -0
- package/dist/tools/linters/cargo.d.ts +2 -0
- package/dist/tools/linters/cargo.js +45 -0
- package/dist/tools/linters/cargo.js.map +1 -0
- package/dist/tools/linters/eslint.d.ts +2 -0
- package/dist/tools/linters/eslint.js +59 -0
- package/dist/tools/linters/eslint.js.map +1 -0
- package/dist/tools/linters/govet.d.ts +2 -0
- package/dist/tools/linters/govet.js +37 -0
- package/dist/tools/linters/govet.js.map +1 -0
- package/dist/tools/linters/pyright.d.ts +2 -0
- package/dist/tools/linters/pyright.js +34 -0
- package/dist/tools/linters/pyright.js.map +1 -0
- package/dist/tools/linters/ruff.d.ts +2 -0
- package/dist/tools/linters/ruff.js +30 -0
- package/dist/tools/linters/ruff.js.map +1 -0
- package/dist/tools/linters/types.d.ts +16 -0
- package/dist/tools/linters/types.js +2 -0
- package/dist/tools/linters/types.js.map +1 -0
- package/dist/tools/linters/typescript.d.ts +2 -0
- package/dist/tools/linters/typescript.js +38 -0
- package/dist/tools/linters/typescript.js.map +1 -0
- package/dist/tools/lsp.d.ts +310 -0
- package/dist/tools/lsp.js +684 -0
- package/dist/tools/lsp.js.map +1 -0
- package/dist/tools/notebook.d.ts +95 -0
- package/dist/tools/notebook.js +144 -0
- package/dist/tools/notebook.js.map +1 -0
- package/dist/tools/openDiff.d.ts +41 -0
- package/dist/tools/openDiff.js +116 -0
- package/dist/tools/openDiff.js.map +1 -0
- package/dist/tools/openFile.d.ts +34 -0
- package/dist/tools/openFile.js +102 -0
- package/dist/tools/openFile.js.map +1 -0
- package/dist/tools/organizeImports.d.ts +29 -0
- package/dist/tools/organizeImports.js +64 -0
- package/dist/tools/organizeImports.js.map +1 -0
- package/dist/tools/planPersistence.d.ts +196 -0
- package/dist/tools/planPersistence.js +437 -0
- package/dist/tools/planPersistence.js.map +1 -0
- package/dist/tools/replaceBlock.d.ts +40 -0
- package/dist/tools/replaceBlock.js +105 -0
- package/dist/tools/replaceBlock.js.map +1 -0
- package/dist/tools/runCommand.d.ts +43 -0
- package/dist/tools/runCommand.js +141 -0
- package/dist/tools/runCommand.js.map +1 -0
- package/dist/tools/runTests.d.ts +32 -0
- package/dist/tools/runTests.js +160 -0
- package/dist/tools/runTests.js.map +1 -0
- package/dist/tools/saveDocument.d.ts +28 -0
- package/dist/tools/saveDocument.js +58 -0
- package/dist/tools/saveDocument.js.map +1 -0
- package/dist/tools/searchAndReplace.d.ts +50 -0
- package/dist/tools/searchAndReplace.js +203 -0
- package/dist/tools/searchAndReplace.js.map +1 -0
- package/dist/tools/searchWorkspace.d.ts +52 -0
- package/dist/tools/searchWorkspace.js +159 -0
- package/dist/tools/searchWorkspace.js.map +1 -0
- package/dist/tools/setActiveWorkspaceFolder.d.ts +28 -0
- package/dist/tools/setActiveWorkspaceFolder.js +32 -0
- package/dist/tools/setActiveWorkspaceFolder.js.map +1 -0
- package/dist/tools/tasks.d.ts +56 -0
- package/dist/tools/tasks.js +89 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/terminal.d.ts +241 -0
- package/dist/tools/terminal.js +539 -0
- package/dist/tools/terminal.js.map +1 -0
- package/dist/tools/testRunners/cargoTest.d.ts +2 -0
- package/dist/tools/testRunners/cargoTest.js +123 -0
- package/dist/tools/testRunners/cargoTest.js.map +1 -0
- package/dist/tools/testRunners/goTest.d.ts +2 -0
- package/dist/tools/testRunners/goTest.js +106 -0
- package/dist/tools/testRunners/goTest.js.map +1 -0
- package/dist/tools/testRunners/pytest.d.ts +2 -0
- package/dist/tools/testRunners/pytest.js +133 -0
- package/dist/tools/testRunners/pytest.js.map +1 -0
- package/dist/tools/testRunners/types.d.ts +18 -0
- package/dist/tools/testRunners/types.js +2 -0
- package/dist/tools/testRunners/types.js.map +1 -0
- package/dist/tools/testRunners/vitestJest.d.ts +3 -0
- package/dist/tools/testRunners/vitestJest.js +178 -0
- package/dist/tools/testRunners/vitestJest.js.map +1 -0
- package/dist/tools/typeHierarchy.d.ts +45 -0
- package/dist/tools/typeHierarchy.js +65 -0
- package/dist/tools/typeHierarchy.js.map +1 -0
- package/dist/tools/utils.d.ts +54 -0
- package/dist/tools/utils.js +267 -0
- package/dist/tools/utils.js.map +1 -0
- package/dist/tools/vscodeCommands.d.ts +59 -0
- package/dist/tools/vscodeCommands.js +108 -0
- package/dist/tools/vscodeCommands.js.map +1 -0
- package/dist/tools/watchDiagnostics.d.ts +32 -0
- package/dist/tools/watchDiagnostics.js +87 -0
- package/dist/tools/watchDiagnostics.js.map +1 -0
- package/dist/tools/workspaceSettings.d.ts +67 -0
- package/dist/tools/workspaceSettings.js +102 -0
- package/dist/tools/workspaceSettings.js.map +1 -0
- package/dist/tools/workspaceSnapshots.d.ts +174 -0
- package/dist/tools/workspaceSnapshots.js +474 -0
- package/dist/tools/workspaceSnapshots.js.map +1 -0
- package/dist/transport.d.ts +57 -0
- package/dist/transport.js +417 -0
- package/dist/transport.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/dist/wsUtils.d.ts +9 -0
- package/dist/wsUtils.js +54 -0
- package/dist/wsUtils.js.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { ExtensionTimeoutError, } from "../extensionClient.js";
|
|
2
|
+
import { error, extensionRequired, optionalInt, optionalString, requireArray, requireString, resolveFilePath, success, } from "./utils.js";
|
|
3
|
+
export function createGetDebugStateTool(extensionClient) {
|
|
4
|
+
return {
|
|
5
|
+
schema: {
|
|
6
|
+
name: "getDebugState",
|
|
7
|
+
extensionRequired: true,
|
|
8
|
+
description: "Get the current state of the VS Code debugger: active session info, paused location, " +
|
|
9
|
+
"call stack, local variables, and registered breakpoints. " +
|
|
10
|
+
"Returns hasActiveSession=false when no debug session is running. " +
|
|
11
|
+
"Requires the VS Code extension.",
|
|
12
|
+
annotations: { readOnlyHint: true },
|
|
13
|
+
inputSchema: {
|
|
14
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
15
|
+
type: "object",
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
async handler() {
|
|
20
|
+
if (!extensionClient.isConnected()) {
|
|
21
|
+
return extensionRequired("getDebugState");
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const result = await extensionClient.getDebugState();
|
|
25
|
+
if (result === null) {
|
|
26
|
+
return success({
|
|
27
|
+
hasActiveSession: false,
|
|
28
|
+
isPaused: false,
|
|
29
|
+
breakpoints: [],
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return success(result);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
if (err instanceof ExtensionTimeoutError) {
|
|
36
|
+
return error("Extension timed out getting debug state");
|
|
37
|
+
}
|
|
38
|
+
throw err;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function createEvaluateInDebuggerTool(extensionClient) {
|
|
44
|
+
return {
|
|
45
|
+
schema: {
|
|
46
|
+
name: "evaluateInDebugger",
|
|
47
|
+
extensionRequired: true,
|
|
48
|
+
description: "Evaluate an expression in the active debug session (REPL/watch). " +
|
|
49
|
+
"The session must be paused at a breakpoint for variables to be in scope. " +
|
|
50
|
+
"Requires the VS Code extension.",
|
|
51
|
+
annotations: { readOnlyHint: true },
|
|
52
|
+
inputSchema: {
|
|
53
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
54
|
+
type: "object",
|
|
55
|
+
required: ["expression"],
|
|
56
|
+
properties: {
|
|
57
|
+
expression: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "Expression to evaluate",
|
|
60
|
+
},
|
|
61
|
+
frameId: {
|
|
62
|
+
type: "integer",
|
|
63
|
+
description: "Stack frame ID from getDebugState callStack (0=top frame)",
|
|
64
|
+
},
|
|
65
|
+
context: {
|
|
66
|
+
type: "string",
|
|
67
|
+
enum: ["repl", "watch", "hover"],
|
|
68
|
+
description: "Evaluation context (default: repl)",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
additionalProperties: false,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
timeoutMs: 30_000,
|
|
75
|
+
async handler(args) {
|
|
76
|
+
if (!extensionClient.isConnected()) {
|
|
77
|
+
return extensionRequired("evaluateInDebugger");
|
|
78
|
+
}
|
|
79
|
+
const expression = requireString(args, "expression", 10_000);
|
|
80
|
+
const frameId = optionalInt(args, "frameId", 0, 10_000);
|
|
81
|
+
const context = optionalString(args, "context") ?? "repl";
|
|
82
|
+
try {
|
|
83
|
+
const result = await extensionClient.evaluateInDebugger(expression, frameId, context);
|
|
84
|
+
if (result === null)
|
|
85
|
+
return error("No active debug session or evaluation failed");
|
|
86
|
+
return success(result);
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
if (err instanceof ExtensionTimeoutError) {
|
|
90
|
+
return error("Extension timed out evaluating expression");
|
|
91
|
+
}
|
|
92
|
+
throw err;
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export function createSetDebugBreakpointsTool(workspace, extensionClient) {
|
|
98
|
+
return {
|
|
99
|
+
schema: {
|
|
100
|
+
name: "setDebugBreakpoints",
|
|
101
|
+
extensionRequired: true,
|
|
102
|
+
description: "Set breakpoints in a file, replacing any existing breakpoints for that file. " +
|
|
103
|
+
"Supports conditional breakpoints, logpoints, and hit-count conditions. " +
|
|
104
|
+
"Pass an empty breakpoints array to clear all breakpoints in the file. " +
|
|
105
|
+
"Requires the VS Code extension.",
|
|
106
|
+
inputSchema: {
|
|
107
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
108
|
+
type: "object",
|
|
109
|
+
required: ["file", "breakpoints"],
|
|
110
|
+
properties: {
|
|
111
|
+
file: {
|
|
112
|
+
type: "string",
|
|
113
|
+
description: "Absolute path to the file",
|
|
114
|
+
},
|
|
115
|
+
breakpoints: {
|
|
116
|
+
type: "array",
|
|
117
|
+
description: "Breakpoints to set (replaces existing ones for this file)",
|
|
118
|
+
items: {
|
|
119
|
+
type: "object",
|
|
120
|
+
required: ["line"],
|
|
121
|
+
properties: {
|
|
122
|
+
line: {
|
|
123
|
+
type: "integer",
|
|
124
|
+
description: "Line number (1-based)",
|
|
125
|
+
},
|
|
126
|
+
condition: {
|
|
127
|
+
type: "string",
|
|
128
|
+
description: "Conditional expression",
|
|
129
|
+
},
|
|
130
|
+
logMessage: {
|
|
131
|
+
type: "string",
|
|
132
|
+
description: "Logpoint message (no pause, just log)",
|
|
133
|
+
},
|
|
134
|
+
hitCondition: {
|
|
135
|
+
type: "string",
|
|
136
|
+
description: "Hit condition (e.g. '>5')",
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
additionalProperties: false,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
additionalProperties: false,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
async handler(args) {
|
|
147
|
+
if (!extensionClient.isConnected()) {
|
|
148
|
+
return extensionRequired("setDebugBreakpoints");
|
|
149
|
+
}
|
|
150
|
+
const file = resolveFilePath(requireString(args, "file"), workspace);
|
|
151
|
+
const rawBreakpoints = requireArray(args, "breakpoints");
|
|
152
|
+
const breakpoints = rawBreakpoints.map((b, i) => {
|
|
153
|
+
if (typeof b !== "object" || b === null)
|
|
154
|
+
throw new Error(`breakpoints[${i}] must be an object`);
|
|
155
|
+
const bp = b;
|
|
156
|
+
if (typeof bp.line !== "number")
|
|
157
|
+
throw new Error(`breakpoints[${i}].line must be a number`);
|
|
158
|
+
return bp;
|
|
159
|
+
});
|
|
160
|
+
const bps = breakpoints;
|
|
161
|
+
try {
|
|
162
|
+
const result = await extensionClient.setDebugBreakpoints(file, bps);
|
|
163
|
+
if (result === null)
|
|
164
|
+
return error("Failed to set breakpoints");
|
|
165
|
+
return success(result);
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
if (err instanceof ExtensionTimeoutError) {
|
|
169
|
+
return error("Extension timed out setting breakpoints");
|
|
170
|
+
}
|
|
171
|
+
throw err;
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
export function createStartDebuggingTool(extensionClient) {
|
|
177
|
+
return {
|
|
178
|
+
schema: {
|
|
179
|
+
name: "startDebugging",
|
|
180
|
+
extensionRequired: true,
|
|
181
|
+
description: "Start a debug session using a launch configuration from .vscode/launch.json. " +
|
|
182
|
+
"Pass configName to select a specific configuration by name, or omit to use the first one. " +
|
|
183
|
+
"Requires the VS Code extension.",
|
|
184
|
+
inputSchema: {
|
|
185
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
186
|
+
type: "object",
|
|
187
|
+
properties: {
|
|
188
|
+
configName: {
|
|
189
|
+
type: "string",
|
|
190
|
+
description: "Name of the launch configuration to use",
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
additionalProperties: false,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
async handler(args) {
|
|
197
|
+
if (!extensionClient.isConnected()) {
|
|
198
|
+
return extensionRequired("startDebugging");
|
|
199
|
+
}
|
|
200
|
+
const configName = optionalString(args, "configName");
|
|
201
|
+
try {
|
|
202
|
+
const result = await extensionClient.startDebugging(configName);
|
|
203
|
+
if (result === null)
|
|
204
|
+
return error("Failed to start debug session");
|
|
205
|
+
return success(result);
|
|
206
|
+
}
|
|
207
|
+
catch (err) {
|
|
208
|
+
if (err instanceof ExtensionTimeoutError) {
|
|
209
|
+
return error("Extension timed out starting debug session");
|
|
210
|
+
}
|
|
211
|
+
throw err;
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
export function createStopDebuggingTool(extensionClient) {
|
|
217
|
+
return {
|
|
218
|
+
schema: {
|
|
219
|
+
name: "stopDebugging",
|
|
220
|
+
extensionRequired: true,
|
|
221
|
+
description: "Stop the active debug session. Has no effect if no session is running. " +
|
|
222
|
+
"Requires the VS Code extension.",
|
|
223
|
+
inputSchema: {
|
|
224
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
225
|
+
type: "object",
|
|
226
|
+
additionalProperties: false,
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
async handler() {
|
|
230
|
+
if (!extensionClient.isConnected()) {
|
|
231
|
+
return extensionRequired("stopDebugging");
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
const result = await extensionClient.stopDebugging();
|
|
235
|
+
if (result === null)
|
|
236
|
+
return error("Failed to stop debug session");
|
|
237
|
+
return success(result);
|
|
238
|
+
}
|
|
239
|
+
catch (err) {
|
|
240
|
+
if (err instanceof ExtensionTimeoutError) {
|
|
241
|
+
return error("Extension timed out stopping debug session");
|
|
242
|
+
}
|
|
243
|
+
throw err;
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../src/tools/debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,EACL,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,aAAa,EACb,eAAe,EACf,OAAO,GACR,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,uBAAuB,CAAC,eAAgC;IACtE,OAAO;QACL,MAAM,EAAE;YACN,IAAI,EAAE,eAAe;YACrB,iBAAiB,EAAE,IAAI;YACvB,WAAW,EACT,uFAAuF;gBACvF,2DAA2D;gBAC3D,mEAAmE;gBACnE,iCAAiC;YACnC,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;YACnC,WAAW,EAAE;gBACX,OAAO,EAAE,yCAAyC;gBAClD,IAAI,EAAE,QAAiB;gBACvB,oBAAoB,EAAE,KAAc;aACrC;SACF;QACD,KAAK,CAAC,OAAO;YACX,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,CAAC;gBACnC,OAAO,iBAAiB,CAAC,eAAe,CAAC,CAAC;YAC5C,CAAC;YACD,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,aAAa,EAAE,CAAC;gBACrD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;oBACpB,OAAO,OAAO,CAAC;wBACb,gBAAgB,EAAE,KAAK;wBACvB,QAAQ,EAAE,KAAK;wBACf,WAAW,EAAE,EAAE;qBAChB,CAAC,CAAC;gBACL,CAAC;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qB,EAAE,CAAC;oBACzC,OAAO,KAAK,CAAC,4CAA4C,CAAC,CAAC;gBAC7D,CAAC;gBACD,MAAM,GAAG,CAAC;YACZ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,eAAgC;IACtE,OAAO;QACL,MAAM,EAAE;YACN,IAAI,EAAE,eAAe;YACrB,iBAAiB,EAAE,IAAI;YACvB,WAAW,EACT,yEAAyE;gBACzE,iCAAiC;YACnC,WAAW,EAAE;gBACX,OAAO,EAAE,yCAAyC;gBAClD,IAAI,EAAE,QAAiB;gBACvB,oBAAoB,EAAE,KAAc;aACrC;SACF;QACD,KAAK,CAAC,OAAO;YACX,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,CAAC;gBACnC,OAAO,iBAAiB,CAAC,eAAe,CAAC,CAAC;YAC5C,CAAC;YACD,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,aAAa,EAAE,CAAC;gBACrD,IAAI,MAAM,KAAK,IAAI;oBAAE,OAAO,KAAK,CAAC,8BAA8B,CAAC,CAAC;gBAClE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;YACzB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,GAAG,YAAY,qBAAqB,EAAE,CAAC;oBACzC,OAAO,KAAK,CAAC,4CAA4C,CAAC,CAAC;gBAC7D,CAAC;gBACD,MAAM,GAAG,CAAC;YACZ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type ExtensionClient } from "../extensionClient.js";
|
|
2
|
+
export declare function createSetEditorDecorationsTool(workspace: string, extensionClient: ExtensionClient): {
|
|
3
|
+
schema: {
|
|
4
|
+
name: string;
|
|
5
|
+
extensionRequired: boolean;
|
|
6
|
+
description: string;
|
|
7
|
+
annotations: {
|
|
8
|
+
idempotentHint: boolean;
|
|
9
|
+
};
|
|
10
|
+
inputSchema: {
|
|
11
|
+
$schema: string;
|
|
12
|
+
type: "object";
|
|
13
|
+
required: string[];
|
|
14
|
+
properties: {
|
|
15
|
+
id: {
|
|
16
|
+
type: "string";
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
file: {
|
|
20
|
+
type: "string";
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
decorations: {
|
|
24
|
+
type: "array";
|
|
25
|
+
description: string;
|
|
26
|
+
items: {
|
|
27
|
+
type: "object";
|
|
28
|
+
required: string[];
|
|
29
|
+
properties: {
|
|
30
|
+
startLine: {
|
|
31
|
+
type: "integer";
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
endLine: {
|
|
35
|
+
type: "integer";
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
message: {
|
|
39
|
+
type: "string";
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
hoverMessage: {
|
|
43
|
+
type: "string";
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
style: {
|
|
47
|
+
type: "string";
|
|
48
|
+
enum: string[];
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
additionalProperties: false;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
additionalProperties: false;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
handler(args: Record<string, unknown>): Promise<{
|
|
60
|
+
content: Array<{
|
|
61
|
+
type: string;
|
|
62
|
+
text: string;
|
|
63
|
+
}>;
|
|
64
|
+
}>;
|
|
65
|
+
};
|
|
66
|
+
export declare function createClearEditorDecorationsTool(extensionClient: ExtensionClient): {
|
|
67
|
+
schema: {
|
|
68
|
+
name: string;
|
|
69
|
+
extensionRequired: boolean;
|
|
70
|
+
description: string;
|
|
71
|
+
annotations: {
|
|
72
|
+
idempotentHint: boolean;
|
|
73
|
+
};
|
|
74
|
+
inputSchema: {
|
|
75
|
+
$schema: string;
|
|
76
|
+
type: "object";
|
|
77
|
+
properties: {
|
|
78
|
+
id: {
|
|
79
|
+
type: "string";
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
additionalProperties: false;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
handler(args: Record<string, unknown>): Promise<{
|
|
87
|
+
content: Array<{
|
|
88
|
+
type: string;
|
|
89
|
+
text: string;
|
|
90
|
+
}>;
|
|
91
|
+
}>;
|
|
92
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { ExtensionTimeoutError, } from "../extensionClient.js";
|
|
2
|
+
import { error, extensionRequired, optionalArray, optionalString, requireString, resolveFilePath, success, } from "./utils.js";
|
|
3
|
+
export function createSetEditorDecorationsTool(workspace, extensionClient) {
|
|
4
|
+
return {
|
|
5
|
+
schema: {
|
|
6
|
+
name: "setEditorDecorations",
|
|
7
|
+
extensionRequired: true,
|
|
8
|
+
description: "Place visual decorations (highlights, annotations, inline text) on lines in a file. " +
|
|
9
|
+
"Decorations are grouped by a logical ID — you can have multiple independent decoration sets. " +
|
|
10
|
+
"Each call replaces existing decorations for that ID+file. " +
|
|
11
|
+
"Styles: info (green), warning (yellow), error (red), focus (border), strikethrough, dim. " +
|
|
12
|
+
"Requires the VS Code extension.",
|
|
13
|
+
annotations: { idempotentHint: true },
|
|
14
|
+
inputSchema: {
|
|
15
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
16
|
+
type: "object",
|
|
17
|
+
required: ["id", "file", "decorations"],
|
|
18
|
+
properties: {
|
|
19
|
+
id: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Logical group name for these decorations (alphanumeric + hyphens)",
|
|
22
|
+
},
|
|
23
|
+
file: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Absolute path to the file to decorate",
|
|
26
|
+
},
|
|
27
|
+
decorations: {
|
|
28
|
+
type: "array",
|
|
29
|
+
description: "Decorations to apply",
|
|
30
|
+
items: {
|
|
31
|
+
type: "object",
|
|
32
|
+
required: ["startLine"],
|
|
33
|
+
properties: {
|
|
34
|
+
startLine: {
|
|
35
|
+
type: "integer",
|
|
36
|
+
description: "Start line (1-based)",
|
|
37
|
+
},
|
|
38
|
+
endLine: {
|
|
39
|
+
type: "integer",
|
|
40
|
+
description: "End line (1-based, defaults to startLine)",
|
|
41
|
+
},
|
|
42
|
+
message: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "Inline message shown after the line",
|
|
45
|
+
},
|
|
46
|
+
hoverMessage: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Tooltip shown on hover",
|
|
49
|
+
},
|
|
50
|
+
style: {
|
|
51
|
+
type: "string",
|
|
52
|
+
enum: [
|
|
53
|
+
"info",
|
|
54
|
+
"warning",
|
|
55
|
+
"error",
|
|
56
|
+
"focus",
|
|
57
|
+
"strikethrough",
|
|
58
|
+
"dim",
|
|
59
|
+
],
|
|
60
|
+
description: "Visual style (default: info)",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
additionalProperties: false,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
additionalProperties: false,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
async handler(args) {
|
|
71
|
+
if (!extensionClient.isConnected()) {
|
|
72
|
+
return extensionRequired("setEditorDecorations");
|
|
73
|
+
}
|
|
74
|
+
const id = requireString(args, "id", 64);
|
|
75
|
+
const file = resolveFilePath(requireString(args, "file"), workspace);
|
|
76
|
+
const rawDecorations = optionalArray(args, "decorations") ?? [];
|
|
77
|
+
const decorations = rawDecorations.map((d, i) => {
|
|
78
|
+
if (typeof d !== "object" || d === null)
|
|
79
|
+
throw new Error(`decorations[${i}] must be an object`);
|
|
80
|
+
const dec = d;
|
|
81
|
+
if (typeof dec.startLine !== "number")
|
|
82
|
+
throw new Error(`decorations[${i}].startLine must be a number`);
|
|
83
|
+
if (![
|
|
84
|
+
"info",
|
|
85
|
+
"warning",
|
|
86
|
+
"error",
|
|
87
|
+
"focus",
|
|
88
|
+
"strikethrough",
|
|
89
|
+
"dim",
|
|
90
|
+
].includes(dec.style))
|
|
91
|
+
throw new Error(`decorations[${i}].style is invalid`);
|
|
92
|
+
return dec;
|
|
93
|
+
});
|
|
94
|
+
try {
|
|
95
|
+
const result = await extensionClient.setDecorations(id, file, decorations);
|
|
96
|
+
if (result === null)
|
|
97
|
+
return error("Failed to set decorations");
|
|
98
|
+
return success(result);
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
if (err instanceof ExtensionTimeoutError) {
|
|
102
|
+
return error("Extension timed out setting decorations");
|
|
103
|
+
}
|
|
104
|
+
throw err;
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export function createClearEditorDecorationsTool(extensionClient) {
|
|
110
|
+
return {
|
|
111
|
+
schema: {
|
|
112
|
+
name: "clearEditorDecorations",
|
|
113
|
+
extensionRequired: true,
|
|
114
|
+
description: "Clear editor decorations. Pass an id to clear a specific decoration set, " +
|
|
115
|
+
"or omit to clear all Claude-managed decorations. " +
|
|
116
|
+
"Requires the VS Code extension.",
|
|
117
|
+
annotations: { idempotentHint: true },
|
|
118
|
+
inputSchema: {
|
|
119
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {
|
|
122
|
+
id: {
|
|
123
|
+
type: "string",
|
|
124
|
+
description: "Decoration set ID to clear. Omit to clear all.",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
additionalProperties: false,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
async handler(args) {
|
|
131
|
+
if (!extensionClient.isConnected()) {
|
|
132
|
+
return extensionRequired("clearEditorDecorations");
|
|
133
|
+
}
|
|
134
|
+
const id = optionalString(args, "id", 64);
|
|
135
|
+
try {
|
|
136
|
+
const result = await extensionClient.clearDecorations(id);
|
|
137
|
+
if (result === null)
|
|
138
|
+
return error("Failed to clear decorations");
|
|
139
|
+
return success(result);
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
if (err instanceof ExtensionTimeoutError) {
|
|
143
|
+
return error("Extension timed out clearing decorations");
|
|
144
|
+
}
|
|
145
|
+
throw err;
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=decorations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorations.js","sourceRoot":"","sources":["../../src/tools/decorations.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,aAAa,EACb,eAAe,EACf,OAAO,GACR,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,8BAA8B,CAC5C,SAAiB,EACjB,eAAgC;IAEhC,OAAO;QACL,MAAM,EAAE;YACN,IAAI,EAAE,sBAAsB;YAC5B,iBAAiB,EAAE,IAAI;YACvB,WAAW,EACT,sFAAsF;gBACtF,+FAA+F;gBAC/F,4DAA4D;gBAC5D,2FAA2F;gBAC3F,iCAAiC;YACnC,WAAW,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;YACrC,WAAW,EAAE;gBACX,OAAO,EAAE,yCAAyC;gBAClD,IAAI,EAAE,QAAiB;gBACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC;gBACvC,UAAU,EAAE;oBACV,EAAE,EAAE;wBACF,IAAI,EAAE,QAAiB;wBACvB,WAAW,EACT,mEAAmE;qBACtE;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAiB;wBACvB,WAAW,EAAE,uCAAuC;qBACrD;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,OAAgB;wBACtB,WAAW,EAAE,sBAAsB;wBAC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AAE;oBACV,EAAE,EAAE;wBACF,IAAI,EAAE,QAAiB;wBACvB,WAAW,EAAE,gDAAgD;qBAC9D;iBACF;gBACD,oBAAoB,EAAE,KAAc;aACrC;SACF;QACD,KAAK,CAAC,OAAO,CAAC,IAA6B;YACzC,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,CAAC;gBACnC,OAAO,iBAAiB,CAAC,wBAAwB,CAAC,CAAC;YACrD,CAAC;YACD,MAAM,EAAE,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1C,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;gBAC1D,IAAI,MAAM,KAAK,IAAI;oBAAE,OAAO,KAAK,CAAC,6BAA6B,CAAC,CAAC;gBACjE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;YACzB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,GAAG,YAAY,qBAAqB,EAAE,CAAC;oBACzC,OAAO,KAAK,CAAC,0CAA0C,CAAC,CAAC;gBAC3D,CAAC;gBACD,MAAM,GAAG,CAAC;YACZ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ToolHandler } from "../transport.js";
|
|
2
|
+
export declare function createDiffDebugTool(workspace: string, getDiagnosticsFn: ToolHandler): {
|
|
3
|
+
schema: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
annotations: {
|
|
7
|
+
readOnlyHint: boolean;
|
|
8
|
+
};
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object";
|
|
11
|
+
properties: {
|
|
12
|
+
commitRange: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
staged: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
filePath: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
proximity: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
severity: {
|
|
29
|
+
oneOf: ({
|
|
30
|
+
type: string;
|
|
31
|
+
items?: undefined;
|
|
32
|
+
} | {
|
|
33
|
+
type: string;
|
|
34
|
+
items: {
|
|
35
|
+
type: string;
|
|
36
|
+
};
|
|
37
|
+
})[];
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
source: {
|
|
41
|
+
oneOf: ({
|
|
42
|
+
type: string;
|
|
43
|
+
items?: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
type: string;
|
|
46
|
+
items: {
|
|
47
|
+
type: string;
|
|
48
|
+
};
|
|
49
|
+
})[];
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
additionalProperties: false;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
handler: (args: Record<string, unknown>, signal?: AbortSignal) => Promise<{
|
|
57
|
+
content: Array<{
|
|
58
|
+
type: string;
|
|
59
|
+
text: string;
|
|
60
|
+
}>;
|
|
61
|
+
}>;
|
|
62
|
+
};
|