diff --git a/src/hooks/directory-agents-injector/index.ts b/src/hooks/directory-agents-injector/index.ts index e25d114eb..b1f29e046 100644 --- a/src/hooks/directory-agents-injector/index.ts +++ b/src/hooks/directory-agents-injector/index.ts @@ -25,11 +25,6 @@ interface ToolExecuteBeforeOutput { args: unknown; } -interface BatchToolCall { - tool: string; - parameters: Record; -} - interface EventInput { event: { type: string; @@ -39,7 +34,6 @@ interface EventInput { export function createDirectoryAgentsInjectorHook(ctx: PluginInput) { const sessionCaches = new Map>(); - const pendingBatchReads = new Map(); const truncator = createDynamicTruncator(ctx); function getSessionCache(sessionID: string): Set { @@ -110,27 +104,6 @@ export function createDirectoryAgentsInjectorHook(ctx: PluginInput) { saveInjectedPaths(sessionID, cache); } - const toolExecuteBefore = async ( - input: ToolExecuteInput, - output: ToolExecuteBeforeOutput, - ) => { - if (input.tool.toLowerCase() !== "batch") return; - - const args = output.args as { tool_calls?: BatchToolCall[] } | undefined; - if (!args?.tool_calls) return; - - const readFilePaths: string[] = []; - for (const call of args.tool_calls) { - if (call.tool.toLowerCase() === "read" && call.parameters?.filePath) { - readFilePaths.push(call.parameters.filePath as string); - } - } - - if (readFilePaths.length > 0) { - pendingBatchReads.set(input.callID, readFilePaths); - } - }; - const toolExecuteAfter = async ( input: ToolExecuteInput, output: ToolExecuteOutput, @@ -141,16 +114,14 @@ export function createDirectoryAgentsInjectorHook(ctx: PluginInput) { await processFilePathForInjection(output.title, input.sessionID, output); return; } + }; - if (toolName === "batch") { - const filePaths = pendingBatchReads.get(input.callID); - if (filePaths) { - for (const filePath of filePaths) { - await processFilePathForInjection(filePath, input.sessionID, output); - } - pendingBatchReads.delete(input.callID); - } - } + const toolExecuteBefore = async ( + input: ToolExecuteInput, + output: ToolExecuteBeforeOutput, + ): Promise => { + void input; + void output; }; const eventHandler = async ({ event }: EventInput) => { diff --git a/src/hooks/directory-readme-injector/index.ts b/src/hooks/directory-readme-injector/index.ts index a47364461..7487743cc 100644 --- a/src/hooks/directory-readme-injector/index.ts +++ b/src/hooks/directory-readme-injector/index.ts @@ -25,11 +25,6 @@ interface ToolExecuteBeforeOutput { args: unknown; } -interface BatchToolCall { - tool: string; - parameters: Record; -} - interface EventInput { event: { type: string; @@ -39,7 +34,6 @@ interface EventInput { export function createDirectoryReadmeInjectorHook(ctx: PluginInput) { const sessionCaches = new Map>(); - const pendingBatchReads = new Map(); const truncator = createDynamicTruncator(ctx); function getSessionCache(sessionID: string): Set { @@ -105,27 +99,6 @@ export function createDirectoryReadmeInjectorHook(ctx: PluginInput) { saveInjectedPaths(sessionID, cache); } - const toolExecuteBefore = async ( - input: ToolExecuteInput, - output: ToolExecuteBeforeOutput, - ) => { - if (input.tool.toLowerCase() !== "batch") return; - - const args = output.args as { tool_calls?: BatchToolCall[] } | undefined; - if (!args?.tool_calls) return; - - const readFilePaths: string[] = []; - for (const call of args.tool_calls) { - if (call.tool.toLowerCase() === "read" && call.parameters?.filePath) { - readFilePaths.push(call.parameters.filePath as string); - } - } - - if (readFilePaths.length > 0) { - pendingBatchReads.set(input.callID, readFilePaths); - } - }; - const toolExecuteAfter = async ( input: ToolExecuteInput, output: ToolExecuteOutput, @@ -136,16 +109,14 @@ export function createDirectoryReadmeInjectorHook(ctx: PluginInput) { await processFilePathForInjection(output.title, input.sessionID, output); return; } + }; - if (toolName === "batch") { - const filePaths = pendingBatchReads.get(input.callID); - if (filePaths) { - for (const filePath of filePaths) { - await processFilePathForInjection(filePath, input.sessionID, output); - } - pendingBatchReads.delete(input.callID); - } - } + const toolExecuteBefore = async ( + input: ToolExecuteInput, + output: ToolExecuteBeforeOutput, + ): Promise => { + void input; + void output; }; const eventHandler = async ({ event }: EventInput) => { diff --git a/src/hooks/rules-injector/constants.ts b/src/hooks/rules-injector/constants.ts index bd66102df..3f8b9f6f3 100644 --- a/src/hooks/rules-injector/constants.ts +++ b/src/hooks/rules-injector/constants.ts @@ -17,6 +17,7 @@ export const PROJECT_RULE_SUBDIRS: [string, string][] = [ [".github", "instructions"], [".cursor", "rules"], [".claude", "rules"], + [".sisyphus", "rules"], ]; export const PROJECT_RULE_FILES: string[] = [ diff --git a/src/hooks/rules-injector/index.ts b/src/hooks/rules-injector/index.ts index 949a5f70f..bc594121e 100644 --- a/src/hooks/rules-injector/index.ts +++ b/src/hooks/rules-injector/index.ts @@ -33,11 +33,6 @@ interface ToolExecuteBeforeOutput { args: unknown; } -interface BatchToolCall { - tool: string; - parameters: Record; -} - interface EventInput { event: { type: string; @@ -59,7 +54,6 @@ export function createRulesInjectorHook(ctx: PluginInput) { string, { contentHashes: Set; realPaths: Set } >(); - const pendingBatchFiles = new Map(); const truncator = createDynamicTruncator(ctx); function getSessionCache(sessionID: string): { @@ -143,35 +137,6 @@ export function createRulesInjectorHook(ctx: PluginInput) { saveInjectedRules(sessionID, cache); } - function extractFilePathFromToolCall(call: BatchToolCall): string | null { - const params = call.parameters; - return (params?.filePath ?? params?.file_path ?? params?.path) as string | null; - } - - const toolExecuteBefore = async ( - input: ToolExecuteInput, - output: ToolExecuteBeforeOutput - ) => { - if (input.tool.toLowerCase() !== "batch") return; - - const args = output.args as { tool_calls?: BatchToolCall[] } | undefined; - if (!args?.tool_calls) return; - - const filePaths: string[] = []; - for (const call of args.tool_calls) { - if (TRACKED_TOOLS.includes(call.tool.toLowerCase())) { - const filePath = extractFilePathFromToolCall(call); - if (filePath) { - filePaths.push(filePath); - } - } - } - - if (filePaths.length > 0) { - pendingBatchFiles.set(input.callID, filePaths); - } - }; - const toolExecuteAfter = async ( input: ToolExecuteInput, output: ToolExecuteOutput @@ -182,16 +147,14 @@ export function createRulesInjectorHook(ctx: PluginInput) { await processFilePathForInjection(output.title, input.sessionID, output); return; } + }; - if (toolName === "batch") { - const filePaths = pendingBatchFiles.get(input.callID); - if (filePaths) { - for (const filePath of filePaths) { - await processFilePathForInjection(filePath, input.sessionID, output); - } - pendingBatchFiles.delete(input.callID); - } - } + const toolExecuteBefore = async ( + input: ToolExecuteInput, + output: ToolExecuteBeforeOutput + ): Promise => { + void input; + void output; }; const eventHandler = async ({ event }: EventInput) => {