mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +00:00
feat(cursor): Enhance Cursor tool handling with a registry and improved processing
Introduced a registry for Cursor tool handlers to streamline the processing of various tool calls, including read, write, edit, delete, grep, ls, glob, semantic search, and read lints. This refactor allows for better organization and normalization of tool inputs and outputs. Additionally, updated the CursorToolCallEvent interface to accommodate new tool calls and their respective arguments. Enhanced logging for raw events and unrecognized tool call structures for improved debugging. Affected files: - cursor-provider.ts: Added CURSOR_TOOL_HANDLERS and refactored tool call processing. - log-parser.ts: Updated tool categories and added summaries for new tools. - cursor-cli.ts: Expanded CursorToolCallEvent interface to include new tool calls. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
@@ -264,7 +264,7 @@ export interface CursorToolCallEvent {
|
||||
call_id: string;
|
||||
tool_call: {
|
||||
readToolCall?: {
|
||||
args: { path: string };
|
||||
args: { path: string; offset?: number; limit?: number };
|
||||
result?: {
|
||||
success?: {
|
||||
content: string;
|
||||
@@ -285,6 +285,90 @@ export interface CursorToolCallEvent {
|
||||
};
|
||||
};
|
||||
};
|
||||
editToolCall?: {
|
||||
args: { path: string; oldText?: string; newText?: string };
|
||||
result?: {
|
||||
success?: Record<string, unknown>;
|
||||
};
|
||||
};
|
||||
shellToolCall?: {
|
||||
args: { command: string };
|
||||
result?: {
|
||||
success?: {
|
||||
exitCode: number;
|
||||
stdout?: string;
|
||||
stderr?: string;
|
||||
};
|
||||
rejected?: {
|
||||
reason: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
deleteToolCall?: {
|
||||
args: { path: string };
|
||||
result?: {
|
||||
success?: Record<string, unknown>;
|
||||
rejected?: {
|
||||
reason: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
grepToolCall?: {
|
||||
args: { pattern: string; path?: string };
|
||||
result?: {
|
||||
success?: {
|
||||
matchedLines: number;
|
||||
};
|
||||
};
|
||||
};
|
||||
lsToolCall?: {
|
||||
args: { path: string; ignore?: string[] };
|
||||
result?: {
|
||||
success?: {
|
||||
childrenFiles: number;
|
||||
childrenDirs: number;
|
||||
};
|
||||
};
|
||||
};
|
||||
globToolCall?: {
|
||||
args: { globPattern: string; targetDirectory?: string };
|
||||
result?: {
|
||||
success?: {
|
||||
totalFiles: number;
|
||||
};
|
||||
};
|
||||
};
|
||||
semSearchToolCall?: {
|
||||
args: { query: string; targetDirectories?: string[]; explanation?: string };
|
||||
result?: {
|
||||
success?: {
|
||||
results: string;
|
||||
codeResults?: Array<{
|
||||
path: string;
|
||||
content: string;
|
||||
score?: number;
|
||||
}>;
|
||||
};
|
||||
};
|
||||
};
|
||||
readLintsToolCall?: {
|
||||
args: { paths: string[] };
|
||||
result?: {
|
||||
success?: {
|
||||
fileDiagnostics: Array<{
|
||||
path: string;
|
||||
diagnostics: Array<{
|
||||
message: string;
|
||||
severity: string;
|
||||
line?: number;
|
||||
column?: number;
|
||||
}>;
|
||||
}>;
|
||||
totalFiles: number;
|
||||
totalDiagnostics: number;
|
||||
};
|
||||
};
|
||||
};
|
||||
function?: {
|
||||
name: string;
|
||||
arguments: string;
|
||||
|
||||
Reference in New Issue
Block a user