@baton-dx/cli 0.6.1 → 0.7.1
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/dist/{ai-tool-detection-Bw4qveB8.mjs → ai-tool-detection-46GECWyV.mjs} +1 -1
- package/dist/{ai-tool-detection-DMnwwNBI.mjs → ai-tool-detection-CMsBNa9e.mjs} +1 -1
- package/dist/{ai-tool-detection-DMnwwNBI.mjs.map → ai-tool-detection-CMsBNa9e.mjs.map} +1 -1
- package/dist/context-detection-DO0ZeRyQ.mjs +3191 -0
- package/dist/context-detection-DO0ZeRyQ.mjs.map +1 -0
- package/dist/{create-Cq7dvT9C.mjs → create-BiE2_2Fo.mjs} +5 -4
- package/dist/{create-Cq7dvT9C.mjs.map → create-BiE2_2Fo.mjs.map} +1 -1
- package/dist/{context-detection-CGh_5f6N.mjs → dist-BoZnMvNi.mjs} +2 -3188
- package/dist/dist-BoZnMvNi.mjs.map +1 -0
- package/dist/index.mjs +111 -59
- package/dist/index.mjs.map +1 -1
- package/dist/{list-xZTyCWwl.mjs → list-7GvmRp3q.mjs} +5 -4
- package/dist/{list-xZTyCWwl.mjs.map → list-7GvmRp3q.mjs.map} +1 -1
- package/dist/{prompt-JYaE4U2w.mjs → prompt-DXfUeR3X.mjs} +4 -4
- package/dist/prompt-DXfUeR3X.mjs.map +1 -0
- package/dist/{remove-DSBMNbtP.mjs → remove-Cx8jC2vY.mjs} +3 -2
- package/dist/{remove-DSBMNbtP.mjs.map → remove-Cx8jC2vY.mjs.map} +1 -1
- package/dist/src-C-rwSQpx.mjs +6 -0
- package/dist/{src-B-Z49jsg.mjs → src-C0c228gb.mjs} +76 -16
- package/dist/src-C0c228gb.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/context-detection-CGh_5f6N.mjs.map +0 -1
- package/dist/prompt-JYaE4U2w.mjs.map +0 -1
- package/dist/src-B-Z49jsg.mjs.map +0 -1
|
@@ -735,4 +735,4 @@ function clearAIToolCache() {
|
|
|
735
735
|
|
|
736
736
|
//#endregion
|
|
737
737
|
export { AI_TOOL_PATHS as i, detectInstalledAITools as n, evaluateDetection as r, clearAIToolCache as t };
|
|
738
|
-
//# sourceMappingURL=ai-tool-detection-
|
|
738
|
+
//# sourceMappingURL=ai-tool-detection-CMsBNa9e.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-tool-detection-DMnwwNBI.mjs","names":[],"sources":["../../ai-tool-paths/src/registry.ts","../../core/src/detection/mechanisms.ts","../../core/src/detection/ai-tool-detection.ts"],"sourcesContent":["import type { AIToolPathConfig } from \"./types.js\";\n\n/**\n * Registry of all supported AI agents and their path configurations.\n * Each agent defines where it expects skills, rules, agents, memory, and commands.\n */\nexport const AI_TOOL_PATHS: readonly AIToolPathConfig[] = [\n {\n key: \"claude-code\",\n name: \"Claude Code\",\n skills: {\n project: \".claude/skills/{name}\",\n global: \"~/.claude/skills/{name}\",\n },\n rules: {\n project: \".claude/rules/{name}.md\",\n global: \"~/.claude/rules/{name}.md\",\n },\n agents: {\n project: \".claude/agents/{name}.md\",\n global: \"~/.claude/agents/{name}.md\",\n },\n memory: {\n project: \"CLAUDE.md\",\n global: \"~/.claude/CLAUDE.md\",\n },\n commands: {\n project: \".claude/commands/{name}.md\",\n global: \"~/.claude/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"binary\", name: \"claude\", versionPattern: /claude/i }],\n [{ type: \"directory\", path: \"~/.claude/\", markerFile: \"settings.json\" }],\n ],\n },\n legacy: {},\n },\n {\n key: \"cursor\",\n name: \"Cursor\",\n skills: {\n project: \".cursor/skills/{name}\",\n global: \"~/.cursor/skills/{name}\",\n },\n rules: {\n project: \".cursor/rules/{name}.mdc\",\n global: \"~/.cursor/rules/{name}.mdc\",\n },\n agents: {\n project: \".cursor/agents/{name}.md\",\n global: \"~/.cursor/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.cursor/AGENTS.md\",\n },\n commands: {\n project: \".cursor/commands/{name}.md\",\n global: \"~/.cursor/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"app\", name: \"Cursor.app\" }],\n [{ type: \"binary\", name: \"cursor\" }],\n [{ type: \"directory\", path: \"~/.cursor/\", markerFile: \"extensions\" }],\n ],\n },\n legacy: {\n rules: [\".cursorrules\"],\n },\n },\n {\n key: \"windsurf\",\n name: \"Windsurf\",\n skills: {\n project: \".windsurf/skills/{name}\",\n global: \"~/.codeium/windsurf/skills/{name}\",\n },\n rules: {\n project: \".windsurf/rules/{name}.md\",\n global: \"~/.codeium/windsurf/rules/{name}.md\",\n },\n agents: {\n project: \".windsurf/agents/{name}.md\",\n global: \"~/.codeium/windsurf/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.codeium/windsurf/AGENTS.md\",\n },\n commands: {\n project: \".windsurf/workflows/{name}.md\",\n global: \"~/.codeium/windsurf/workflows/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"app\", name: \"Windsurf.app\" }],\n [{ type: \"binary\", name: \"windsurf\" }],\n [\n {\n type: \"directory\",\n path: \"~/.codeium/windsurf/\",\n markerFile: \"settings.json\",\n },\n ],\n ],\n },\n legacy: {\n rules: [\".windsurfrules\"],\n },\n },\n {\n key: \"antigravity\",\n name: \"Antigravity\",\n skills: {\n project: \".agent/skills/{name}\",\n global: \"~/.gemini/antigravity/skills/{name}\",\n },\n rules: {\n project: \".agent/rules/{name}.md\",\n global: \"~/.gemini/antigravity/rules/{name}.md\",\n },\n agents: {\n project: \".agent/agents/{name}.md\",\n global: \"~/.gemini/antigravity/agents/{name}.md\",\n },\n memory: {\n project: \"GEMINI.md\",\n global: \"~/.gemini/antigravity/GEMINI.md\",\n },\n commands: {\n project: \".agent/workflows/{name}.md\",\n global: \"~/.gemini/antigravity/workflows/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"app\", name: \"Antigravity.app\" }],\n [{ type: \"binary\", name: \"agy\" }],\n [{ type: \"binary\", name: \"antigravity\", platforms: [\"linux\"] }],\n [\n {\n type: \"directory\",\n path: \"~/.gemini/antigravity/\",\n markerFile: \"settings.json\",\n },\n ],\n ],\n },\n legacy: {},\n },\n {\n key: \"codex\",\n name: \"Codex CLI\",\n skills: {\n project: \".codex/skills/{name}\",\n global: \"~/.codex/skills/{name}\",\n },\n rules: {\n project: \".codex/rules/{name}.md\",\n global: \"~/.codex/rules/{name}.md\",\n },\n agents: {\n project: \".codex/agents/{name}.md\",\n global: \"~/.codex/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.codex/AGENTS.md\",\n },\n commands: {\n project: \".codex/commands/{name}.md\",\n global: \"~/.codex/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"binary\", name: \"codex\", versionPattern: /codex/i }],\n [{ type: \"directory\", path: \"~/.codex/\", markerFile: \"config.toml\" }],\n ],\n },\n legacy: {},\n },\n {\n key: \"github-copilot\",\n name: \"GitHub Copilot\",\n skills: {\n project: \".github/skills/{name}\",\n global: \"~/.github/skills/{name}\",\n },\n rules: {\n project: \".github/copilot-instructions.md\",\n global: \"~/.github/copilot-instructions.md\",\n },\n agents: {\n project: \".github/agents/{name}.md\",\n global: \"~/.github/agents/{name}.md\",\n },\n memory: {\n project: \".github/copilot-instructions.md\",\n global: \"~/.github/copilot-instructions.md\",\n },\n commands: {\n project: \".github/copilot/commands/{name}.md\",\n global: \"~/.github/copilot/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [\n {\n type: \"binary\",\n name: \"copilot\",\n versionPattern: /copilot|github/i,\n },\n ],\n [\n {\n type: \"vscode-extension\",\n extensionId: \"GitHub.copilot\",\n editors: [\"vscode\", \"cursor\"],\n },\n ],\n [{ type: \"directory\", path: \"~/.github/copilot/\" }],\n ],\n },\n legacy: {},\n },\n {\n key: \"opencode\",\n name: \"OpenCode\",\n skills: {\n project: \".opencode/skills/{name}\",\n global: \"~/.config/opencode/skills/{name}\",\n },\n rules: {\n project: \".opencode/rules/{name}.md\",\n global: \"~/.config/opencode/rules/{name}.md\",\n },\n agents: {\n project: \".opencode/agents/{name}.md\",\n global: \"~/.config/opencode/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.config/opencode/AGENTS.md\",\n },\n commands: {\n project: \".opencode/commands/{name}.md\",\n global: \"~/.config/opencode/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"binary\", name: \"opencode\", versionPattern: /opencode|sst/i }],\n [\n {\n type: \"directory\",\n path: \"~/.config/opencode/\",\n markerFile: \"config.yaml\",\n },\n ],\n ],\n },\n legacy: {},\n },\n {\n key: \"amp\",\n name: \"Amp\",\n skills: {\n project: \".agents/skills/{name}\",\n global: \"~/.config/agents/skills/{name}\",\n },\n rules: {\n project: \".agents/rules/{name}.md\",\n global: \"~/.config/agents/rules/{name}.md\",\n },\n agents: {\n project: \".agents/agents/{name}.md\",\n global: \"~/.config/agents/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.config/agents/AGENTS.md\",\n },\n commands: {\n project: \".agents/commands/{name}.md\",\n global: \"~/.config/agents/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"binary\", name: \"amp\", versionPattern: /amp|sourcegraph/i }],\n [{ type: \"directory\", path: \"~/.ampcache/\" }],\n ],\n },\n legacy: {},\n },\n {\n key: \"kiro\",\n name: \"Kiro\",\n skills: {\n project: \".kiro/skills/{name}\",\n global: \"~/.kiro/skills/{name}\",\n },\n rules: {\n project: \".kiro/rules/{name}.md\",\n global: \"~/.kiro/rules/{name}.md\",\n },\n agents: {\n project: \".kiro/agents/{name}.md\",\n global: \"~/.kiro/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.kiro/AGENTS.md\",\n },\n commands: {\n project: \".kiro/commands/{name}.md\",\n global: \"~/.kiro/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"app\", name: \"Kiro.app\" }],\n [{ type: \"binary\", name: \"kiro\" }],\n [{ type: \"directory\", path: \"~/.kiro/\", markerFile: \"settings.json\" }],\n ],\n },\n legacy: {},\n },\n {\n key: \"zed\",\n name: \"Zed\",\n skills: {\n project: \".zed/skills/{name}\",\n global: \"~/.zed/skills/{name}\",\n },\n rules: {\n project: \".zed/rules/{name}.md\",\n global: \"~/.zed/rules/{name}.md\",\n },\n agents: {\n project: \".zed/agents/{name}.md\",\n global: \"~/.zed/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.zed/AGENTS.md\",\n },\n commands: {\n project: \".zed/commands/{name}.md\",\n global: \"~/.zed/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"app\", name: \"Zed.app\" }],\n [{ type: \"binary\", name: \"zed\" }],\n [\n {\n type: \"directory\",\n path: \"~/.config/zed/\",\n markerFile: \"settings.json\",\n },\n ],\n ],\n },\n legacy: {},\n },\n {\n key: \"cline\",\n name: \"Cline\",\n skills: {\n project: \".cline/skills/{name}\",\n global: \"~/.cline/skills/{name}\",\n },\n rules: {\n project: \".cline/rules/{name}.md\",\n global: \"~/.cline/rules/{name}.md\",\n },\n agents: {\n project: \".cline/agents/{name}.md\",\n global: \"~/.cline/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.cline/AGENTS.md\",\n },\n commands: {\n project: \".cline/commands/{name}.md\",\n global: \"~/.cline/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [\n {\n type: \"vscode-extension\",\n extensionId: \"saoudrizwan.claude-dev\",\n editors: [\"vscode\", \"cursor\", \"windsurf\"],\n },\n ],\n [\n {\n type: \"directory\",\n path: \"~/.cline/\",\n markerFile: \"settings.json\",\n },\n ],\n ],\n },\n legacy: {},\n },\n {\n key: \"roo\",\n name: \"Roo\",\n skills: {\n project: \".roo/skills/{name}\",\n global: \"~/.roo/skills/{name}\",\n },\n rules: {\n project: \".roo/rules/{name}.md\",\n global: \"~/.roo/rules/{name}.md\",\n },\n agents: {\n project: \".roo/agents/{name}.md\",\n global: \"~/.roo/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.roo/AGENTS.md\",\n },\n commands: {\n project: \".roo/commands/{name}.md\",\n global: \"~/.roo/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [\n {\n type: \"vscode-extension\",\n extensionId: \"RooVeterinaryInc.roo-cline\",\n editors: [\"vscode\", \"cursor\", \"windsurf\"],\n },\n ],\n [{ type: \"directory\", path: \"~/.roo/\", markerFile: \"settings.json\" }],\n ],\n },\n legacy: {},\n },\n {\n key: \"junie\",\n name: \"Junie\",\n skills: {\n project: \".junie/skills/{name}\",\n global: \"~/.junie/skills/{name}\",\n },\n rules: {\n project: \".junie/rules/{name}.md\",\n global: \"~/.junie/rules/{name}.md\",\n },\n agents: {\n project: \".junie/agents/{name}.md\",\n global: \"~/.junie/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.junie/AGENTS.md\",\n },\n commands: {\n project: \".junie/commands/{name}.md\",\n global: \"~/.junie/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"jetbrains-plugin\", pluginId: \"junie\" }],\n [\n {\n type: \"directory\",\n path: \"~/.junie/\",\n markerFile: \"settings.json\",\n },\n ],\n ],\n },\n legacy: {},\n },\n {\n key: \"trae\",\n name: \"Trae\",\n skills: {\n project: \".trae/skills/{name}\",\n global: \"~/.trae/skills/{name}\",\n },\n rules: {\n project: \".trae/rules/{name}.md\",\n global: \"~/.trae/rules/{name}.md\",\n },\n agents: {\n project: \".trae/agents/{name}.md\",\n global: \"~/.trae/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.trae/AGENTS.md\",\n },\n commands: {\n project: \".trae/commands/{name}.md\",\n global: \"~/.trae/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"app\", name: \"Trae.app\" }],\n [{ type: \"directory\", path: \"~/.trae/\", markerFile: \"settings.json\" }],\n ],\n },\n legacy: {},\n },\n];\n","import { execFile } from \"node:child_process\";\nimport { constants, access, readdir } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type {\n AppBundleCheck,\n BinaryCheck,\n DetectionCheck,\n DetectionConfig,\n DirectoryCheck,\n JetbrainsPluginCheck,\n Platform,\n VscodeExtensionCheck,\n} from \"@baton-dx/ai-tool-paths\";\n\n/**\n * Execute a command and return stdout/stderr as a promise.\n * Rejects on non-zero exit code or timeout.\n */\nfunction execAsync(\n command: string,\n args: string[],\n options: { timeout?: number } = {},\n): Promise<{ stdout: string; stderr: string }> {\n return new Promise((resolve, reject) => {\n execFile(command, args, options, (error, stdout, stderr) => {\n if (error) {\n reject(error);\n } else {\n resolve({ stdout: String(stdout), stderr: String(stderr) });\n }\n });\n });\n}\n\n/**\n * Check if a binary exists in PATH and optionally verify its identity via version output.\n * Prevents false positives from binary name collisions (e.g., `opencode` by Litestar vs SST).\n */\nexport async function checkBinary(check: BinaryCheck): Promise<boolean> {\n if (check.platforms && !check.platforms.includes(process.platform as Platform)) {\n return false;\n }\n\n const lookupCommand = process.platform === \"win32\" ? \"where\" : \"which\";\n\n try {\n await execAsync(lookupCommand, [check.name]);\n } catch {\n return false;\n }\n\n if (!check.versionPattern) {\n return true;\n }\n\n const versionFlag = check.versionFlag ?? \"--version\";\n try {\n const { stdout, stderr } = await execAsync(check.name, [versionFlag], {\n timeout: 5000,\n });\n const output = `${stdout}\\n${stderr}`;\n return check.versionPattern.test(output);\n } catch {\n return false;\n }\n}\n\n/**\n * Check if a directory exists and optionally contains a marker file.\n * Prevents false positives from leftover empty directories (e.g., ~/.cline/ without settings.json).\n */\nexport async function checkDirectory(check: DirectoryCheck): Promise<boolean> {\n if (check.platforms && !check.platforms.includes(process.platform as Platform)) {\n return false;\n }\n\n const expandedPath = check.path.startsWith(\"~/\")\n ? join(homedir(), check.path.slice(2))\n : check.path;\n\n try {\n await access(expandedPath, constants.R_OK);\n } catch {\n return false;\n }\n\n if (!check.markerFile) {\n return true;\n }\n\n try {\n await access(join(expandedPath, check.markerFile));\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Check if a macOS .app bundle exists in /Applications or ~/Applications.\n * Returns false immediately on non-darwin platforms.\n */\nexport async function checkAppBundle(check: AppBundleCheck): Promise<boolean> {\n if (process.platform !== \"darwin\") {\n return false;\n }\n\n const searchPaths = check.searchPaths ?? [\"/Applications\", join(homedir(), \"Applications\")];\n\n for (const dir of searchPaths) {\n try {\n await access(join(dir, check.name));\n return true;\n } catch {\n // not found in this path, try next\n }\n }\n\n return false;\n}\n\n/** Map of editor names to their extension directory paths. */\nconst EDITOR_EXTENSION_DIRS: Record<string, string> = {\n vscode: join(homedir(), \".vscode\", \"extensions\"),\n cursor: join(homedir(), \".cursor\", \"extensions\"),\n windsurf: join(homedir(), \".windsurf\", \"extensions\"),\n};\n\n/**\n * Check if a VS Code extension is installed in VS Code, Cursor, or Windsurf.\n * Matches extension directories by prefix (case-insensitive) since directories\n * are named `<extensionId>-<version>`.\n */\nexport async function checkVscodeExtension(check: VscodeExtensionCheck): Promise<boolean> {\n const editors = check.editors ?? [\"vscode\"];\n const prefix = check.extensionId.toLowerCase();\n\n for (const editor of editors) {\n const extDir = EDITOR_EXTENSION_DIRS[editor];\n if (!extDir) {\n // skip unknown editor\n } else {\n try {\n const entries = await readdir(extDir);\n if (entries.some((entry) => entry.toLowerCase().startsWith(prefix))) {\n return true;\n }\n } catch {\n // extension directory missing (ENOENT) — skip, not throw\n }\n }\n }\n\n return false;\n}\n\n/**\n * Get the JetBrains config base directory for the current platform.\n * macOS: ~/Library/Application Support/JetBrains/\n * Linux: ~/.config/JetBrains/\n * Windows: %APPDATA%/JetBrains/\n */\nfunction getJetbrainsConfigBase(): string | undefined {\n switch (process.platform) {\n case \"darwin\":\n return join(homedir(), \"Library\", \"Application Support\", \"JetBrains\");\n case \"linux\":\n return join(homedir(), \".config\", \"JetBrains\");\n case \"win32\":\n return process.env.APPDATA ? join(process.env.APPDATA, \"JetBrains\") : undefined;\n default:\n return undefined;\n }\n}\n\n/**\n * Check if a JetBrains plugin is installed by scanning IDE config directories.\n * Looks for pluginId as a subdirectory under <version>/plugins/ across all IDE versions.\n */\nexport async function checkJetbrainsPlugin(check: JetbrainsPluginCheck): Promise<boolean> {\n const base = getJetbrainsConfigBase();\n if (!base) {\n return false;\n }\n\n let versionDirs: string[];\n try {\n versionDirs = await readdir(base);\n } catch {\n return false;\n }\n\n for (const versionDir of versionDirs) {\n try {\n const pluginEntries = await readdir(join(base, versionDir, \"plugins\"));\n if (pluginEntries.some((entry) => entry.toLowerCase() === check.pluginId.toLowerCase())) {\n return true;\n }\n } catch {\n // plugins directory missing for this version — skip\n }\n }\n\n return false;\n}\n\n/**\n * Handler map for dispatching detection checks by type.\n * Uses an object so that individual handlers can be spied on in tests\n * (ESM module exports are not interceptable for intra-module calls).\n */\nexport const checkHandlers = {\n binary: checkBinary,\n directory: checkDirectory,\n app: checkAppBundle,\n \"vscode-extension\": checkVscodeExtension,\n \"jetbrains-plugin\": checkJetbrainsPlugin,\n};\n\n/**\n * Dispatch a single detection check to the appropriate mechanism function.\n */\nfunction runCheck(check: DetectionCheck): Promise<boolean> {\n switch (check.type) {\n case \"binary\":\n return checkHandlers.binary(check);\n case \"directory\":\n return checkHandlers.directory(check);\n case \"app\":\n return checkHandlers.app(check);\n case \"vscode-extension\":\n return checkHandlers[\"vscode-extension\"](check);\n case \"jetbrains-plugin\":\n return checkHandlers[\"jetbrains-plugin\"](check);\n }\n}\n\n/**\n * Evaluate a DetectionConfig using OR-of-ANDs logic.\n * Each group is evaluated in parallel. Within a group, ALL checks must pass (AND).\n * ANY group passing means the tool is detected (OR across groups).\n */\nexport async function evaluateDetection(config: DetectionConfig): Promise<boolean> {\n const groupResults = await Promise.all(\n config.groups.map(async (group) => {\n const results = await Promise.all(group.map(runCheck));\n return results.every(Boolean);\n }),\n );\n return groupResults.some(Boolean);\n}\n","import { AI_TOOL_PATHS } from \"@baton-dx/ai-tool-paths\";\nimport { evaluateDetection } from \"./mechanisms.js\";\n\n/**\n * Cache for detected AI tools (valid for process lifetime)\n */\nlet cachedAITools: string[] | null = null;\n\n/**\n * Detect if a specific AI tool is installed using structured detectionConfig.\n */\nasync function isAIToolInstalled(toolKey: string): Promise<boolean> {\n const toolConfig = AI_TOOL_PATHS.find((agent) => agent.key === toolKey);\n if (!toolConfig?.detectionConfig) return false;\n\n return evaluateDetection(toolConfig.detectionConfig);\n}\n\n/**\n * Detect all installed AI tools\n * Results are cached for the duration of the process\n */\nexport async function detectInstalledAITools(): Promise<string[]> {\n // Return cached result if available\n if (cachedAITools !== null) {\n return cachedAITools;\n }\n\n const installedAITools: string[] = [];\n\n // Check each tool in parallel\n const detectionPromises = AI_TOOL_PATHS.map(async (agent) => {\n const isInstalled = await isAIToolInstalled(agent.key);\n return isInstalled ? agent.key : null;\n });\n\n const results = await Promise.all(detectionPromises);\n\n // Filter out null results\n for (const result of results) {\n if (result !== null) {\n installedAITools.push(result);\n }\n }\n\n // Cache the result\n cachedAITools = installedAITools;\n\n return installedAITools;\n}\n\n/**\n * Clear the AI tool detection cache\n * Useful for testing or when tool installation state may have changed\n */\nexport function clearAIToolCache(): void {\n cachedAITools = null;\n}\n\n/**\n * Override AI tool detection with a specific list of tools\n * Used when --agents flag is provided\n */\nexport function setDetectedAITools(tools: string[]): void {\n cachedAITools = [...tools];\n}\n"],"mappings":";;;;;;;;;;;AAMA,MAAa,gBAA6C;CACxD;EACE,KAAK;EACL,MAAM;EACN,QAAQ;GACN,SAAS;GACT,QAAQ;GACT;EACD,OAAO;GACL,SAAS;GACT,QAAQ;GACT;EACD,QAAQ;GACN,SAAS;GACT,QAAQ;GACT;EACD,QAAQ;GACN,SAAS;GACT,QAAQ;GACT;EACD,UAAU;GACR,SAAS;GACT,QAAQ;GACT;EACD,iBAAiB,EACf,QAAQ,CAC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B,MAAM,QAAQ,IACjC,OAAO,OAAO,IAAI,OAAO,UAAU;AAEjC,UADgB,MAAM,QAAQ,IAAI,MAAM,IAAI,SAAS,CAAC,EACvC,MAAM,QAAQ;GAC7B,CACH,EACmB,KAAK,QAAQ;;;;;;;;ACpPnC,IAAI,gBAAiC;;;;AAKrC,eAAe,kBAAkB,SAAmC;CAClE,MAAM,aAAa,cAAc,MAAM,UAAU,MAAM,QAAQ,QAAQ;AACvE,KAAI,CAAC,YAAY,gBAAiB,QAAO;AAEzC,QAAO,kBAAkB,WAAW,gBAAgB;;;;;;AAOtD,eAAsB,yBAA4C;AAEhE,KAAI,kBAAkB,KACpB,QAAO;CAGT,MAAM,mBAA6B,EAAE;CAGrC,MAAM,oBAAoB,cAAc,IAAI,OAAO,UAAU;AAE3D,SADoB,MAAM,kBAAkB,MAAM,IAAI,GACjC,MAAM,MAAM;GACjC;CAEF,MAAM,UAAU,MAAM,QAAQ,IAAI,kBAAkB;AAGpD,MAAK,MAAM,UAAU,QACnB,KAAI,WAAW,KACb,kBAAiB,KAAK,OAAO;AAKjC,iBAAgB;AAEhB,QAAO;;;;;;AAOT,SAAgB,mBAAyB;AACvC,iBAAgB"}
|
|
1
|
+
{"version":3,"file":"ai-tool-detection-CMsBNa9e.mjs","names":[],"sources":["../../ai-tool-paths/src/registry.ts","../../core/src/detection/mechanisms.ts","../../core/src/detection/ai-tool-detection.ts"],"sourcesContent":["import type { AIToolPathConfig } from \"./types.js\";\n\n/**\n * Registry of all supported AI agents and their path configurations.\n * Each agent defines where it expects skills, rules, agents, memory, and commands.\n */\nexport const AI_TOOL_PATHS: readonly AIToolPathConfig[] = [\n {\n key: \"claude-code\",\n name: \"Claude Code\",\n skills: {\n project: \".claude/skills/{name}\",\n global: \"~/.claude/skills/{name}\",\n },\n rules: {\n project: \".claude/rules/{name}.md\",\n global: \"~/.claude/rules/{name}.md\",\n },\n agents: {\n project: \".claude/agents/{name}.md\",\n global: \"~/.claude/agents/{name}.md\",\n },\n memory: {\n project: \"CLAUDE.md\",\n global: \"~/.claude/CLAUDE.md\",\n },\n commands: {\n project: \".claude/commands/{name}.md\",\n global: \"~/.claude/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"binary\", name: \"claude\", versionPattern: /claude/i }],\n [{ type: \"directory\", path: \"~/.claude/\", markerFile: \"settings.json\" }],\n ],\n },\n legacy: {},\n },\n {\n key: \"cursor\",\n name: \"Cursor\",\n skills: {\n project: \".cursor/skills/{name}\",\n global: \"~/.cursor/skills/{name}\",\n },\n rules: {\n project: \".cursor/rules/{name}.mdc\",\n global: \"~/.cursor/rules/{name}.mdc\",\n },\n agents: {\n project: \".cursor/agents/{name}.md\",\n global: \"~/.cursor/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.cursor/AGENTS.md\",\n },\n commands: {\n project: \".cursor/commands/{name}.md\",\n global: \"~/.cursor/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"app\", name: \"Cursor.app\" }],\n [{ type: \"binary\", name: \"cursor\" }],\n [{ type: \"directory\", path: \"~/.cursor/\", markerFile: \"extensions\" }],\n ],\n },\n legacy: {\n rules: [\".cursorrules\"],\n },\n },\n {\n key: \"windsurf\",\n name: \"Windsurf\",\n skills: {\n project: \".windsurf/skills/{name}\",\n global: \"~/.codeium/windsurf/skills/{name}\",\n },\n rules: {\n project: \".windsurf/rules/{name}.md\",\n global: \"~/.codeium/windsurf/rules/{name}.md\",\n },\n agents: {\n project: \".windsurf/agents/{name}.md\",\n global: \"~/.codeium/windsurf/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.codeium/windsurf/AGENTS.md\",\n },\n commands: {\n project: \".windsurf/workflows/{name}.md\",\n global: \"~/.codeium/windsurf/workflows/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"app\", name: \"Windsurf.app\" }],\n [{ type: \"binary\", name: \"windsurf\" }],\n [\n {\n type: \"directory\",\n path: \"~/.codeium/windsurf/\",\n markerFile: \"settings.json\",\n },\n ],\n ],\n },\n legacy: {\n rules: [\".windsurfrules\"],\n },\n },\n {\n key: \"antigravity\",\n name: \"Antigravity\",\n skills: {\n project: \".agent/skills/{name}\",\n global: \"~/.gemini/antigravity/skills/{name}\",\n },\n rules: {\n project: \".agent/rules/{name}.md\",\n global: \"~/.gemini/antigravity/rules/{name}.md\",\n },\n agents: {\n project: \".agent/agents/{name}.md\",\n global: \"~/.gemini/antigravity/agents/{name}.md\",\n },\n memory: {\n project: \"GEMINI.md\",\n global: \"~/.gemini/antigravity/GEMINI.md\",\n },\n commands: {\n project: \".agent/workflows/{name}.md\",\n global: \"~/.gemini/antigravity/workflows/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"app\", name: \"Antigravity.app\" }],\n [{ type: \"binary\", name: \"agy\" }],\n [{ type: \"binary\", name: \"antigravity\", platforms: [\"linux\"] }],\n [\n {\n type: \"directory\",\n path: \"~/.gemini/antigravity/\",\n markerFile: \"settings.json\",\n },\n ],\n ],\n },\n legacy: {},\n },\n {\n key: \"codex\",\n name: \"Codex CLI\",\n skills: {\n project: \".codex/skills/{name}\",\n global: \"~/.codex/skills/{name}\",\n },\n rules: {\n project: \".codex/rules/{name}.md\",\n global: \"~/.codex/rules/{name}.md\",\n },\n agents: {\n project: \".codex/agents/{name}.md\",\n global: \"~/.codex/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.codex/AGENTS.md\",\n },\n commands: {\n project: \".codex/commands/{name}.md\",\n global: \"~/.codex/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"binary\", name: \"codex\", versionPattern: /codex/i }],\n [{ type: \"directory\", path: \"~/.codex/\", markerFile: \"config.toml\" }],\n ],\n },\n legacy: {},\n },\n {\n key: \"github-copilot\",\n name: \"GitHub Copilot\",\n skills: {\n project: \".github/skills/{name}\",\n global: \"~/.github/skills/{name}\",\n },\n rules: {\n project: \".github/copilot-instructions.md\",\n global: \"~/.github/copilot-instructions.md\",\n },\n agents: {\n project: \".github/agents/{name}.md\",\n global: \"~/.github/agents/{name}.md\",\n },\n memory: {\n project: \".github/copilot-instructions.md\",\n global: \"~/.github/copilot-instructions.md\",\n },\n commands: {\n project: \".github/copilot/commands/{name}.md\",\n global: \"~/.github/copilot/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [\n {\n type: \"binary\",\n name: \"copilot\",\n versionPattern: /copilot|github/i,\n },\n ],\n [\n {\n type: \"vscode-extension\",\n extensionId: \"GitHub.copilot\",\n editors: [\"vscode\", \"cursor\"],\n },\n ],\n [{ type: \"directory\", path: \"~/.github/copilot/\" }],\n ],\n },\n legacy: {},\n },\n {\n key: \"opencode\",\n name: \"OpenCode\",\n skills: {\n project: \".opencode/skills/{name}\",\n global: \"~/.config/opencode/skills/{name}\",\n },\n rules: {\n project: \".opencode/rules/{name}.md\",\n global: \"~/.config/opencode/rules/{name}.md\",\n },\n agents: {\n project: \".opencode/agents/{name}.md\",\n global: \"~/.config/opencode/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.config/opencode/AGENTS.md\",\n },\n commands: {\n project: \".opencode/commands/{name}.md\",\n global: \"~/.config/opencode/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"binary\", name: \"opencode\", versionPattern: /opencode|sst/i }],\n [\n {\n type: \"directory\",\n path: \"~/.config/opencode/\",\n markerFile: \"config.yaml\",\n },\n ],\n ],\n },\n legacy: {},\n },\n {\n key: \"amp\",\n name: \"Amp\",\n skills: {\n project: \".agents/skills/{name}\",\n global: \"~/.config/agents/skills/{name}\",\n },\n rules: {\n project: \".agents/rules/{name}.md\",\n global: \"~/.config/agents/rules/{name}.md\",\n },\n agents: {\n project: \".agents/agents/{name}.md\",\n global: \"~/.config/agents/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.config/agents/AGENTS.md\",\n },\n commands: {\n project: \".agents/commands/{name}.md\",\n global: \"~/.config/agents/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"binary\", name: \"amp\", versionPattern: /amp|sourcegraph/i }],\n [{ type: \"directory\", path: \"~/.ampcache/\" }],\n ],\n },\n legacy: {},\n },\n {\n key: \"kiro\",\n name: \"Kiro\",\n skills: {\n project: \".kiro/skills/{name}\",\n global: \"~/.kiro/skills/{name}\",\n },\n rules: {\n project: \".kiro/rules/{name}.md\",\n global: \"~/.kiro/rules/{name}.md\",\n },\n agents: {\n project: \".kiro/agents/{name}.md\",\n global: \"~/.kiro/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.kiro/AGENTS.md\",\n },\n commands: {\n project: \".kiro/commands/{name}.md\",\n global: \"~/.kiro/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"app\", name: \"Kiro.app\" }],\n [{ type: \"binary\", name: \"kiro\" }],\n [{ type: \"directory\", path: \"~/.kiro/\", markerFile: \"settings.json\" }],\n ],\n },\n legacy: {},\n },\n {\n key: \"zed\",\n name: \"Zed\",\n skills: {\n project: \".zed/skills/{name}\",\n global: \"~/.zed/skills/{name}\",\n },\n rules: {\n project: \".zed/rules/{name}.md\",\n global: \"~/.zed/rules/{name}.md\",\n },\n agents: {\n project: \".zed/agents/{name}.md\",\n global: \"~/.zed/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.zed/AGENTS.md\",\n },\n commands: {\n project: \".zed/commands/{name}.md\",\n global: \"~/.zed/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"app\", name: \"Zed.app\" }],\n [{ type: \"binary\", name: \"zed\" }],\n [\n {\n type: \"directory\",\n path: \"~/.config/zed/\",\n markerFile: \"settings.json\",\n },\n ],\n ],\n },\n legacy: {},\n },\n {\n key: \"cline\",\n name: \"Cline\",\n skills: {\n project: \".cline/skills/{name}\",\n global: \"~/.cline/skills/{name}\",\n },\n rules: {\n project: \".cline/rules/{name}.md\",\n global: \"~/.cline/rules/{name}.md\",\n },\n agents: {\n project: \".cline/agents/{name}.md\",\n global: \"~/.cline/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.cline/AGENTS.md\",\n },\n commands: {\n project: \".cline/commands/{name}.md\",\n global: \"~/.cline/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [\n {\n type: \"vscode-extension\",\n extensionId: \"saoudrizwan.claude-dev\",\n editors: [\"vscode\", \"cursor\", \"windsurf\"],\n },\n ],\n [\n {\n type: \"directory\",\n path: \"~/.cline/\",\n markerFile: \"settings.json\",\n },\n ],\n ],\n },\n legacy: {},\n },\n {\n key: \"roo\",\n name: \"Roo\",\n skills: {\n project: \".roo/skills/{name}\",\n global: \"~/.roo/skills/{name}\",\n },\n rules: {\n project: \".roo/rules/{name}.md\",\n global: \"~/.roo/rules/{name}.md\",\n },\n agents: {\n project: \".roo/agents/{name}.md\",\n global: \"~/.roo/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.roo/AGENTS.md\",\n },\n commands: {\n project: \".roo/commands/{name}.md\",\n global: \"~/.roo/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [\n {\n type: \"vscode-extension\",\n extensionId: \"RooVeterinaryInc.roo-cline\",\n editors: [\"vscode\", \"cursor\", \"windsurf\"],\n },\n ],\n [{ type: \"directory\", path: \"~/.roo/\", markerFile: \"settings.json\" }],\n ],\n },\n legacy: {},\n },\n {\n key: \"junie\",\n name: \"Junie\",\n skills: {\n project: \".junie/skills/{name}\",\n global: \"~/.junie/skills/{name}\",\n },\n rules: {\n project: \".junie/rules/{name}.md\",\n global: \"~/.junie/rules/{name}.md\",\n },\n agents: {\n project: \".junie/agents/{name}.md\",\n global: \"~/.junie/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.junie/AGENTS.md\",\n },\n commands: {\n project: \".junie/commands/{name}.md\",\n global: \"~/.junie/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"jetbrains-plugin\", pluginId: \"junie\" }],\n [\n {\n type: \"directory\",\n path: \"~/.junie/\",\n markerFile: \"settings.json\",\n },\n ],\n ],\n },\n legacy: {},\n },\n {\n key: \"trae\",\n name: \"Trae\",\n skills: {\n project: \".trae/skills/{name}\",\n global: \"~/.trae/skills/{name}\",\n },\n rules: {\n project: \".trae/rules/{name}.md\",\n global: \"~/.trae/rules/{name}.md\",\n },\n agents: {\n project: \".trae/agents/{name}.md\",\n global: \"~/.trae/agents/{name}.md\",\n },\n memory: {\n project: \"AGENTS.md\",\n global: \"~/.trae/AGENTS.md\",\n },\n commands: {\n project: \".trae/commands/{name}.md\",\n global: \"~/.trae/commands/{name}.md\",\n },\n detectionConfig: {\n groups: [\n [{ type: \"app\", name: \"Trae.app\" }],\n [{ type: \"directory\", path: \"~/.trae/\", markerFile: \"settings.json\" }],\n ],\n },\n legacy: {},\n },\n];\n","import { execFile } from \"node:child_process\";\nimport { constants, access, readdir } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type {\n AppBundleCheck,\n BinaryCheck,\n DetectionCheck,\n DetectionConfig,\n DirectoryCheck,\n JetbrainsPluginCheck,\n Platform,\n VscodeExtensionCheck,\n} from \"@baton-dx/ai-tool-paths\";\n\n/**\n * Execute a command and return stdout/stderr as a promise.\n * Rejects on non-zero exit code or timeout.\n */\nfunction execAsync(\n command: string,\n args: string[],\n options: { timeout?: number } = {},\n): Promise<{ stdout: string; stderr: string }> {\n return new Promise((resolve, reject) => {\n execFile(command, args, options, (error, stdout, stderr) => {\n if (error) {\n reject(error);\n } else {\n resolve({ stdout: String(stdout), stderr: String(stderr) });\n }\n });\n });\n}\n\n/**\n * Check if a binary exists in PATH and optionally verify its identity via version output.\n * Prevents false positives from binary name collisions (e.g., `opencode` by Litestar vs SST).\n */\nexport async function checkBinary(check: BinaryCheck): Promise<boolean> {\n if (check.platforms && !check.platforms.includes(process.platform as Platform)) {\n return false;\n }\n\n const lookupCommand = process.platform === \"win32\" ? \"where\" : \"which\";\n\n try {\n await execAsync(lookupCommand, [check.name]);\n } catch {\n return false;\n }\n\n if (!check.versionPattern) {\n return true;\n }\n\n const versionFlag = check.versionFlag ?? \"--version\";\n try {\n const { stdout, stderr } = await execAsync(check.name, [versionFlag], {\n timeout: 5000,\n });\n const output = `${stdout}\\n${stderr}`;\n return check.versionPattern.test(output);\n } catch {\n return false;\n }\n}\n\n/**\n * Check if a directory exists and optionally contains a marker file.\n * Prevents false positives from leftover empty directories (e.g., ~/.cline/ without settings.json).\n */\nexport async function checkDirectory(check: DirectoryCheck): Promise<boolean> {\n if (check.platforms && !check.platforms.includes(process.platform as Platform)) {\n return false;\n }\n\n const expandedPath = check.path.startsWith(\"~/\")\n ? join(homedir(), check.path.slice(2))\n : check.path;\n\n try {\n await access(expandedPath, constants.R_OK);\n } catch {\n return false;\n }\n\n if (!check.markerFile) {\n return true;\n }\n\n try {\n await access(join(expandedPath, check.markerFile));\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Check if a macOS .app bundle exists in /Applications or ~/Applications.\n * Returns false immediately on non-darwin platforms.\n */\nexport async function checkAppBundle(check: AppBundleCheck): Promise<boolean> {\n if (process.platform !== \"darwin\") {\n return false;\n }\n\n const searchPaths = check.searchPaths ?? [\"/Applications\", join(homedir(), \"Applications\")];\n\n for (const dir of searchPaths) {\n try {\n await access(join(dir, check.name));\n return true;\n } catch {\n // not found in this path, try next\n }\n }\n\n return false;\n}\n\n/** Map of editor names to their extension directory paths. */\nconst EDITOR_EXTENSION_DIRS: Record<string, string> = {\n vscode: join(homedir(), \".vscode\", \"extensions\"),\n cursor: join(homedir(), \".cursor\", \"extensions\"),\n windsurf: join(homedir(), \".windsurf\", \"extensions\"),\n};\n\n/**\n * Check if a VS Code extension is installed in VS Code, Cursor, or Windsurf.\n * Matches extension directories by prefix (case-insensitive) since directories\n * are named `<extensionId>-<version>`.\n */\nexport async function checkVscodeExtension(check: VscodeExtensionCheck): Promise<boolean> {\n const editors = check.editors ?? [\"vscode\"];\n const prefix = check.extensionId.toLowerCase();\n\n for (const editor of editors) {\n const extDir = EDITOR_EXTENSION_DIRS[editor];\n if (!extDir) {\n // skip unknown editor\n } else {\n try {\n const entries = await readdir(extDir);\n if (entries.some((entry) => entry.toLowerCase().startsWith(prefix))) {\n return true;\n }\n } catch {\n // extension directory missing (ENOENT) — skip, not throw\n }\n }\n }\n\n return false;\n}\n\n/**\n * Get the JetBrains config base directory for the current platform.\n * macOS: ~/Library/Application Support/JetBrains/\n * Linux: ~/.config/JetBrains/\n * Windows: %APPDATA%/JetBrains/\n */\nfunction getJetbrainsConfigBase(): string | undefined {\n switch (process.platform) {\n case \"darwin\":\n return join(homedir(), \"Library\", \"Application Support\", \"JetBrains\");\n case \"linux\":\n return join(homedir(), \".config\", \"JetBrains\");\n case \"win32\":\n return process.env.APPDATA ? join(process.env.APPDATA, \"JetBrains\") : undefined;\n default:\n return undefined;\n }\n}\n\n/**\n * Check if a JetBrains plugin is installed by scanning IDE config directories.\n * Looks for pluginId as a subdirectory under <version>/plugins/ across all IDE versions.\n */\nexport async function checkJetbrainsPlugin(check: JetbrainsPluginCheck): Promise<boolean> {\n const base = getJetbrainsConfigBase();\n if (!base) {\n return false;\n }\n\n let versionDirs: string[];\n try {\n versionDirs = await readdir(base);\n } catch {\n return false;\n }\n\n for (const versionDir of versionDirs) {\n try {\n const pluginEntries = await readdir(join(base, versionDir, \"plugins\"));\n if (pluginEntries.some((entry) => entry.toLowerCase() === check.pluginId.toLowerCase())) {\n return true;\n }\n } catch {\n // plugins directory missing for this version — skip\n }\n }\n\n return false;\n}\n\n/**\n * Handler map for dispatching detection checks by type.\n * Uses an object so that individual handlers can be spied on in tests\n * (ESM module exports are not interceptable for intra-module calls).\n */\nexport const checkHandlers = {\n binary: checkBinary,\n directory: checkDirectory,\n app: checkAppBundle,\n \"vscode-extension\": checkVscodeExtension,\n \"jetbrains-plugin\": checkJetbrainsPlugin,\n};\n\n/**\n * Dispatch a single detection check to the appropriate mechanism function.\n */\nfunction runCheck(check: DetectionCheck): Promise<boolean> {\n switch (check.type) {\n case \"binary\":\n return checkHandlers.binary(check);\n case \"directory\":\n return checkHandlers.directory(check);\n case \"app\":\n return checkHandlers.app(check);\n case \"vscode-extension\":\n return checkHandlers[\"vscode-extension\"](check);\n case \"jetbrains-plugin\":\n return checkHandlers[\"jetbrains-plugin\"](check);\n }\n}\n\n/**\n * Evaluate a DetectionConfig using OR-of-ANDs logic.\n * Each group is evaluated in parallel. Within a group, ALL checks must pass (AND).\n * ANY group passing means the tool is detected (OR across groups).\n */\nexport async function evaluateDetection(config: DetectionConfig): Promise<boolean> {\n const groupResults = await Promise.all(\n config.groups.map(async (group) => {\n const results = await Promise.all(group.map(runCheck));\n return results.every(Boolean);\n }),\n );\n return groupResults.some(Boolean);\n}\n","import { AI_TOOL_PATHS } from \"@baton-dx/ai-tool-paths\";\nimport { evaluateDetection } from \"./mechanisms.js\";\n\n/**\n * Cache for detected AI tools (valid for process lifetime)\n */\nlet cachedAITools: string[] | null = null;\n\n/**\n * Detect if a specific AI tool is installed using structured detectionConfig.\n */\nasync function isAIToolInstalled(toolKey: string): Promise<boolean> {\n const toolConfig = AI_TOOL_PATHS.find((agent) => agent.key === toolKey);\n if (!toolConfig?.detectionConfig) return false;\n\n return evaluateDetection(toolConfig.detectionConfig);\n}\n\n/**\n * Detect all installed AI tools\n * Results are cached for the duration of the process\n */\nexport async function detectInstalledAITools(): Promise<string[]> {\n // Return cached result if available\n if (cachedAITools !== null) {\n return cachedAITools;\n }\n\n const installedAITools: string[] = [];\n\n // Check each tool in parallel\n const detectionPromises = AI_TOOL_PATHS.map(async (agent) => {\n const isInstalled = await isAIToolInstalled(agent.key);\n return isInstalled ? agent.key : null;\n });\n\n const results = await Promise.all(detectionPromises);\n\n // Filter out null results\n for (const result of results) {\n if (result !== null) {\n installedAITools.push(result);\n }\n }\n\n // Cache the result\n cachedAITools = installedAITools;\n\n return installedAITools;\n}\n\n/**\n * Clear the AI tool detection cache\n * Useful for testing or when tool installation state may have changed\n */\nexport function clearAIToolCache(): void {\n cachedAITools = null;\n}\n\n/**\n * Override AI tool detection with a specific list of tools\n * Used when --agents flag is provided\n */\nexport function setDetectedAITools(tools: string[]): void {\n cachedAITools = [...tools];\n}\n"],"mappings":";;;;;;;;;;;AAMA,MAAa,gBAA6C;CACxD;EACE,KAAK;EACL,MAAM;EACN,QAAQ;GACN,SAAS;GACT,QAAQ;GACT;EACD,OAAO;GACL,SAAS;GACT,QAAQ;GACT;EACD,QAAQ;GACN,SAAS;GACT,QAAQ;GACT;EACD,QAAQ;GACN,SAAS;GACT,QAAQ;GACT;EACD,UAAU;GACR,SAAS;GACT,QAAQ;GACT;EACD,iBAAiB,EACf,QAAQ,CACN,CAAC;GAAE,MAAM;GAAU,MAAM;GAAU,gBAAgB;GAAW,CAAC,EAC/D,CAAC;GAAE,MAAM;GAAa,MAAM;GAAc,YAAY;GAAiB,CAAC,CACzE,EACF;EACD,QAAQ,EAAE;EACX;CACD;EACE,KAAK;EACL,MAAM;EACN,QAAQ;GACN,SAAS;GACT,QAAQ;GACT;EACD,OAAO;GACL,SAAS;GACT,QAAQ;GACT;EACD,QAAQ;GACN,SAAS;GACT,QAAQ;GACT;EACD,QAAQ;GACN,SAAS;GACT,QAAQ;GACT;EACD,UAAU;GACR,SAAS;GACT,QAAQ;GACT;EACD,iBAAiB,EACf,QAAQ;GACN,CAAC;IAAE,MAAM;IAAO,MAAM;IAAc,CAAC;GACrC,CAAC;IAAE,MAAM;IAAU,MAAM;IAAU,CAAC;GACpC,CAAC;IAAE,MAAM;IAAa,MAAM;IAAc,YAAY;IAAc,CAAC;GACtE,EACF;EACD,QAAQ,EACN,OAAO,CAAC,eAAe,EACxB;EACF;CACD;EACE,KAAK;EACL,MAAM;EACN,QAAQ;GACN,SAAS;GACT,QAAQ;GACT;EACD,OAAO;GACL,SAAS;GACT,QAAQ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