@baton-dx/cli 0.4.3 → 0.5.0

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.
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { n as detectInstalledAITools, t as clearAIToolCache } from "./ai-tool-detection-CMsBNa9e.mjs";
2
+ import { n as detectInstalledAITools, t as clearAIToolCache } from "./ai-tool-detection-DMnwwNBI.mjs";
3
3
 
4
4
  export { detectInstalledAITools };
@@ -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-CMsBNa9e.mjs.map
738
+ //# sourceMappingURL=ai-tool-detection-DMnwwNBI.mjs.map
@@ -1 +1 @@
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 cached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;AAKD,SAAS,SAAS,OAAyC;AACzD,SAAQ,MAAM,MAAd;EACE,KAAK,SACH,QAAO,cAAc,OAAO,MAAM;EACpC,KAAK,YACH,QAAO,cAAc,UAAU,MAAM;EACvC,KAAK,MACH,QAAO,cAAc,IAAI,MAAM;EACjC,KAAK,mBACH,QAAO,cAAc,oBAAoB,MAAM;EACjD,KAAK,mBACH,QAAO,cAAc,oBAAoB,MAAM;;;;;;;;AASrD,eAAsB,kBAAkB,QAA2C;AAOjF,SANqB,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-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,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,CA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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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as __require, r as __toESM, t as __commonJSMin } from "./chunk-BbwQpWto.mjs";
2
+ import { createRequire } from "node:module";
3
3
  import { access } from "node:fs/promises";
4
4
  import { dirname, join, sep } from "node:path";
5
5
  import { formatWithOptions, stripVTControlCharacters } from "node:util";
@@ -7,9 +7,38 @@ import N, { stdin, stdout } from "node:process";
7
7
  import * as tty from "node:tty";
8
8
  import { ReadStream } from "node:tty";
9
9
  import * as k from "node:readline";
10
- import f from "node:readline";
10
+ import ot from "node:readline";
11
11
  import { existsSync, lstatSync, readdirSync } from "node:fs";
12
12
 
13
+ //#region \0rolldown/runtime.js
14
+ var __create = Object.create;
15
+ var __defProp = Object.defineProperty;
16
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
17
+ var __getOwnPropNames = Object.getOwnPropertyNames;
18
+ var __getProtoOf = Object.getPrototypeOf;
19
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
20
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
24
+ key = keys[i];
25
+ if (!__hasOwnProp.call(to, key) && key !== except) {
26
+ __defProp(to, key, {
27
+ get: ((k) => from[k]).bind(null, key),
28
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
29
+ });
30
+ }
31
+ }
32
+ }
33
+ return to;
34
+ };
35
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
36
+ value: mod,
37
+ enumerable: true
38
+ }) : target, mod));
39
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
40
+
41
+ //#endregion
13
42
  //#region ../../node_modules/.bun/consola@3.4.2/node_modules/consola/dist/core.mjs
14
43
  const LogLevels = {
15
44
  silent: Number.NEGATIVE_INFINITY,
@@ -666,7 +695,7 @@ const r = Object.create(null), i = (e) => globalThis.process?.env || import.meta
666
695
  const e = i(true);
667
696
  return Object.keys(e);
668
697
  }
669
- }), t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f$1 = [
698
+ }), t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f = [
670
699
  ["APPVEYOR"],
671
700
  [
672
701
  "AWS_AMPLIFY",
@@ -758,7 +787,7 @@ const r = Object.create(null), i = (e) => globalThis.process?.env || import.meta
758
787
  ]
759
788
  ];
760
789
  function b() {
761
- if (globalThis.process?.env) for (const e of f$1) {
790
+ if (globalThis.process?.env) for (const e of f) {
762
791
  const s = e[1] || e[0];
763
792
  if (globalThis.process?.env[s]) return {
764
793
  name: e[0].toLowerCase(),
@@ -948,7 +977,7 @@ function createConsola(options = {}) {
948
977
  defaults: { level },
949
978
  stdout: process.stdout,
950
979
  stderr: process.stderr,
951
- prompt: (...args) => import("./prompt-B0zuVo8N.mjs").then((m) => m.prompt(...args)),
980
+ prompt: (...args) => import("./prompt-C7kAOs-S.mjs").then((m) => m.prompt(...args)),
952
981
  reporters: options.reporters || [options.fancy ?? !(T$1 || R$1) ? new FancyReporter() : new BasicReporter()],
953
982
  ...options
954
983
  });
@@ -8360,7 +8389,7 @@ var x$1 = class {
8360
8389
  this.state = "cancel", this.close();
8361
8390
  }, { once: !0 });
8362
8391
  }
8363
- this.rl = f.createInterface({
8392
+ this.rl = ot.createInterface({
8364
8393
  input: this.input,
8365
8394
  tabSize: 2,
8366
8395
  prompt: "",
@@ -8822,7 +8851,7 @@ const et = me(), ct = () => process.env.CI === "true", Mt = (t) => t.isTTY === !
8822
8851
  limit: Infinity,
8823
8852
  ellipsis: "",
8824
8853
  ellipsisWidth: 0
8825
- }, M = (t, r = {}) => jt(t, Ee, r).width, ot = "\x1B", Gt = "›", ve = 39, Ct = "\x07", kt = "[", Ae = "]", Vt = "m", St = `${Ae}8;;`, Ht = new RegExp(`(?:\\${kt}(?<code>\\d+)m|\\${St}(?<uri>.*)${Ct})`, "y"), we = (t) => {
8854
+ }, M = (t, r = {}) => jt(t, Ee, r).width, ot$1 = "\x1B", Gt = "›", ve = 39, Ct = "\x07", kt = "[", Ae = "]", Vt = "m", St = `${Ae}8;;`, Ht = new RegExp(`(?:\\${kt}(?<code>\\d+)m|\\${St}(?<uri>.*)${Ct})`, "y"), we = (t) => {
8826
8855
  if (t >= 30 && t <= 37 || t >= 90 && t <= 97) return 39;
8827
8856
  if (t >= 40 && t <= 47 || t >= 100 && t <= 107) return 49;
8828
8857
  if (t === 1 || t === 2) return 22;
@@ -8832,12 +8861,12 @@ const et = me(), ct = () => process.env.CI === "true", Mt = (t) => t.isTTY === !
8832
8861
  if (t === 8) return 28;
8833
8862
  if (t === 9) return 29;
8834
8863
  if (t === 0) return 0;
8835
- }, Ut = (t) => `${ot}${kt}${t}${Vt}`, Kt = (t) => `${ot}${St}${t}${Ct}`, Ce = (t) => t.map((r) => M(r)), It = (t, r, s) => {
8864
+ }, Ut = (t) => `${ot$1}${kt}${t}${Vt}`, Kt = (t) => `${ot$1}${St}${t}${Ct}`, Ce = (t) => t.map((r) => M(r)), It = (t, r, s) => {
8836
8865
  const i = r[Symbol.iterator]();
8837
8866
  let a = !1, o = !1, u = t.at(-1), l = u === void 0 ? 0 : M(u), n = i.next(), c = i.next(), g = 0;
8838
8867
  for (; !n.done;) {
8839
8868
  const F = n.value, p = M(F);
8840
- l + p <= s ? t[t.length - 1] += F : (t.push(F), l = 0), (F === ot || F === Gt) && (a = !0, o = r.startsWith(St, g + 1)), a ? o ? F === Ct && (a = !1, o = !1) : F === Vt && (a = !1) : (l += p, l === s && !c.done && (t.push(""), l = 0)), n = c, c = i.next(), g += F.length;
8869
+ l + p <= s ? t[t.length - 1] += F : (t.push(F), l = 0), (F === ot$1 || F === Gt) && (a = !0, o = r.startsWith(St, g + 1)), a ? o ? F === Ct && (a = !1, o = !1) : F === Vt && (a = !1) : (l += p, l === s && !c.done && (t.push(""), l = 0)), n = c, c = i.next(), g += F.length;
8841
8870
  }
8842
8871
  u = t.at(-1), !l && u !== void 0 && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
8843
8872
  }, Se = (t) => {
@@ -8877,7 +8906,7 @@ const et = me(), ct = () => process.env.CI === "true", Mt = (t) => t.isTTY === !
8877
8906
  let F = g.next(), p = g.next(), E = 0;
8878
8907
  for (; !F.done;) {
8879
8908
  const $ = F.value, m = p.value;
8880
- if (i += $, $ === ot || $ === Gt) {
8909
+ if (i += $, $ === ot$1 || $ === Gt) {
8881
8910
  Ht.lastIndex = E + 1;
8882
8911
  const f = Ht.exec(c)?.groups;
8883
8912
  if (f?.code !== void 0) {
@@ -9837,5 +9866,5 @@ async function findSourceRoot(cwd = process.cwd(), options) {
9837
9866
  }
9838
9867
 
9839
9868
  //#endregion
9840
- export { Ne as a, Ve as c, bt as d, je as f, runMain as g, defineCommand as h, Le as i, We as l, require_dist as m, isInSourceRepo as n, R as o, Ct$1 as p, Je as r, Re as s, findSourceRoot as t, Ze as u };
9841
- //# sourceMappingURL=context-detection-DdbrKid3.mjs.map
9869
+ export { __commonJSMin as _, Ne as a, Ve as c, bt as d, je as f, runMain as g, defineCommand as h, Le as i, We as l, require_dist as m, isInSourceRepo as n, R as o, Ct$1 as p, Je as r, Re as s, findSourceRoot as t, Ze as u, __require as v, __toESM as y };
9870
+ //# sourceMappingURL=context-detection-C7T1evnW.mjs.map