From a94ddc504fb003702afa1bd18012d92fba71f92f Mon Sep 17 00:00:00 2001 From: Mark L <73659136+liuxiaopai-ai@users.noreply.github.com> Date: Mon, 16 Feb 2026 13:26:37 +0800 Subject: [PATCH] fix(cursor): remove obsolete cursor-hooks directory gate (#1087) Co-authored-by: root --- .../integrations/CursorHooksInstaller.ts | 38 +------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/src/services/integrations/CursorHooksInstaller.ts b/src/services/integrations/CursorHooksInstaller.ts index 8df99cff..fc1e1b5d 100644 --- a/src/services/integrations/CursorHooksInstaller.ts +++ b/src/services/integrations/CursorHooksInstaller.ts @@ -125,32 +125,6 @@ export async function updateCursorContextForProject(projectName: string, port: n // Path Finding // ============================================================================ -/** - * Find cursor-hooks directory - * Searches in order: marketplace install, source repo - * Checks for hooks.json (unified CLI mode) or legacy shell scripts - */ -export function findCursorHooksDir(): string | null { - const possiblePaths = [ - // Marketplace install location - path.join(MARKETPLACE_ROOT, 'cursor-hooks'), - // Development/source location (relative to built worker-service.cjs in plugin/scripts/) - path.join(path.dirname(__filename), '..', '..', 'cursor-hooks'), - // Alternative dev location - path.join(process.cwd(), 'cursor-hooks'), - ]; - - for (const p of possiblePaths) { - // Check for hooks.json (unified CLI mode) or legacy shell scripts - if (existsSync(path.join(p, 'hooks.json')) || - existsSync(path.join(p, 'common.sh')) || - existsSync(path.join(p, 'common.ps1'))) { - return p; - } - } - return null; -} - /** * Find MCP server script path * Searches in order: marketplace install, source repo @@ -319,7 +293,7 @@ export function configureCursorMcp(target: CursorInstallTarget): number { * Install Cursor hooks using unified CLI * No longer copies shell scripts - uses node CLI directly */ -export async function installCursorHooks(_sourceDir: string, target: CursorInstallTarget): Promise { +export async function installCursorHooks(target: CursorInstallTarget): Promise { console.log(`\nInstalling Claude-Mem Cursor hooks (${target} level)...\n`); const targetDir = getTargetDir(target); @@ -651,15 +625,7 @@ export async function handleCursorCommand(subcommand: string, args: string[]): P switch (subcommand) { case 'install': { const target = (args[0] || 'project') as CursorInstallTarget; - const cursorHooksDir = findCursorHooksDir(); - - if (!cursorHooksDir) { - console.error('Could not find cursor-hooks directory'); - console.error(' Expected at: ~/.claude/plugins/marketplaces/thedotmack/cursor-hooks/'); - return 1; - } - - return installCursorHooks(cursorHooksDir, target); + return installCursorHooks(target); } case 'uninstall': {