Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src-node/claude-code-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ async function _runQuery(requestId, prompt, projectPath, model, signal, locale,
"multiple Edit calls to make targeted changes rather than rewriting the entire " +
"file with Write. This is critical because Write replaces the entire file content " +
"which is slow and loses undo history." +
"\n\nWhen the user asks about the current file, open files, or what they are working on, " +
"call getEditorState first — it returns the active file path, working set, cursor position, " +
"and selection. Do NOT search the filesystem to answer these questions blindly." +
"\n\nAlways use full absolute paths for all file operations (Read, Edit, Write, " +
"controlEditor). Never use relative paths." +
"\n\nWhen a tool response mentions the user has typed a clarification, immediately " +
Expand Down
10 changes: 6 additions & 4 deletions src-node/mcp-editor-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,19 @@ function createEditorMcpServer(sdkModule, nodeConnector, clarificationAccessors)
"- close: Close a file (force, no save prompt). Params: filePath\n" +
"- openInWorkingSet: Open a file and pin it to the working set. Params: filePath\n" +
"- setSelection: Open a file and select a range. Params: filePath, startLine, startCh, endLine, endCh\n" +
"- setCursorPos: Open a file and set cursor position. Params: filePath, line, ch",
"- setCursorPos: Open a file and set cursor position. Params: filePath, line, ch\n" +
"- toggleLivePreview: Show or hide the live preview panel. Params: show (boolean)",
{
operations: z.array(z.object({
operation: z.enum(["open", "close", "openInWorkingSet", "setSelection", "setCursorPos"]),
filePath: z.string().describe("Absolute path to the file"),
operation: z.enum(["open", "close", "openInWorkingSet", "setSelection", "setCursorPos", "toggleLivePreview"]),
filePath: z.string().optional().describe("Absolute path to the file (not required for toggleLivePreview)"),
startLine: z.number().optional().describe("Start line (1-based) for setSelection"),
startCh: z.number().optional().describe("Start column (1-based) for setSelection"),
endLine: z.number().optional().describe("End line (1-based) for setSelection"),
endCh: z.number().optional().describe("End column (1-based) for setSelection"),
line: z.number().optional().describe("Line number (1-based) for setCursorPos"),
ch: z.number().optional().describe("Column (1-based) for setCursorPos")
ch: z.number().optional().describe("Column (1-based) for setCursorPos"),
showPreview: z.boolean().optional().describe("true to show, false to hide live preview (for toggleLivePreview)")
})).describe("Array of editor operations to execute sequentially")
},
async function (args) {
Expand Down
3 changes: 0 additions & 3 deletions src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ define(function (require, exports, module) {
require("file/FileUtils");
require("project/SidebarView");
require("view/SidebarTabs");
require("core-ai/main");
require("utils/Resizer");
require("LiveDevelopment/main");
require("utils/NodeConnection");
Expand Down Expand Up @@ -297,8 +296,6 @@ define(function (require, exports, module) {
SidebarTabs: require("view/SidebarTabs"),
SidebarView: require("project/SidebarView"),
WorkingSetView: require("project/WorkingSetView"),
AISnapshotStore: require("core-ai/AISnapshotStore"),
AIChatHistory: require("core-ai/AIChatHistory"),
doneLoading: false
};

Expand Down
Loading
Loading