{"record":{"id":"a59b8e6a88738303","repo":"affaan-m/ECC","slug":"unknown-install-target-adapter-targetoradapteri","errorCode":null,"errorMessage":"Unknown install target adapter: ${targetOrAdapterId}","messagePattern":"Unknown install target adapter: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/install-targets/registry.js","lineNumber":41,"sourceCode":"  hermesHome,\n  opencodeHome,\n  openclawHome,\n  codebuddyProject,\n  joycodeProject,\n  kimiProject,\n  qwenHome,\n  zedProject,\n]);\n\nfunction listInstallTargetAdapters() {\n  return ADAPTERS.slice();\n}\n\nfunction getInstallTargetAdapter(targetOrAdapterId) {\n  const adapter = ADAPTERS.find(candidate => candidate.supports(targetOrAdapterId));\n\n  if (!adapter) {\n    throw new Error(`Unknown install target adapter: ${targetOrAdapterId}`);\n  }\n\n  return adapter;\n}\n\nfunction planInstallTargetScaffold(options = {}) {\n  const adapter = getInstallTargetAdapter(options.target);\n  const modules = Array.isArray(options.modules) ? options.modules : [];\n  const exemptValidationCodes = new Set(Array.isArray(options.exemptValidationCodes) ? options.exemptValidationCodes : []);\n  const planningInput = {\n    repoRoot: options.repoRoot,\n    projectRoot: options.projectRoot || options.repoRoot,\n    homeDir: options.homeDir,\n  };\n  const validationIssues = adapter.validate(planningInput);\n  const blockingIssues = validationIssues.filter(issue => (\n    issue.severity === 'error' && !exemptValidationCodes.has(issue.code)\n  ));","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/install-targets/registry.js#L23-L59","documentation":"Thrown by getInstallTargetAdapter in scripts/lib/install-targets/registry.js when no registered adapter's supports(target) returns true. supports() matches only exact-string equality with the adapter's target or id field. The registered set is fixed at module load (claude, claude-project, cursor, antigravity, codex, gemini, hermes, opencode, openclaw, codebuddy, joycode, kimi, qwen, zed). Any other string — including a target with different casing, a hyphenated id where the target is wanted, or an unsupported harness name — throws.","triggerScenarios":"Calling planInstallTargetScaffold({ target: 'kimi-project' }) (adapter id, not target), getInstallTargetAdapter('vscode'), or passing a camelCase variant like 'claudeCode'.","commonSituations":"Misspelling or wrong casing ('Cl ude', 'Kimi'); confusing adapter.id with adapter.target; version drift after a target rename; assuming a harness ECC never supported.","solutions":["Call listInstallTargetAdapters() and print each adapter's target and id to see the exact supported strings.","Use the canonical target string (e.g. 'kimi', not the id 'kimi-project').","If you genuinely need a new target, write a new adapter module, register it in the ADAPTERS array in registry.js, and ensure its supports() accepts the string you pass."],"exampleFix":"// before\nplanInstallTargetScaffold({ target: 'kimi-project', modules });\n\n// after\nplanInstallTargetScaffold({ target: 'kimi', modules });","handlingStrategy":"validation","validationCode":"const { listInstallTargetAdapters } = require('./registry');\nconst VALID = new Set(\n  listInstallTargetAdapters().flatMap(a => [a.target, a.id])\n);\nif (!VALID.has(userTarget)) {\n  throw new Error(\n    `Unsupported target '${userTarget}'. Valid: ${[...VALID].join(', ')}`\n  );\n}","typeGuard":"const VALID_TARGETS = new Set([\n  'claude','claude-project','cursor','antigravity','codex','gemini',\n  'hermes','opencode','openclaw','codebuddy','joycode','kimi','qwen','zed'\n]);\nfunction isInstallTarget(value) {\n  return typeof value === 'string' && VALID_TARGETS.has(value);\n}","tryCatchPattern":"try {\n  getInstallTargetAdapter(target);\n} catch (err) {\n  if (/Unknown install target adapter/.test(err.message)) {\n    console.error('Valid targets:', listInstallTargetAdapters().map(a => a.target).join(', '));\n  }\n  throw err;\n}","preventionTips":["Surface the canonical target list in your CLI's --help output.","Pin to a specific ECC version so the target list cannot shift under you.","Use adapter.target rather than adapter.id when configuring installs."],"tags":["install-target","adapter","config-validation"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}