{"record":{"id":"d22388ab673f4a24","repo":"affaan-m/ECC","slug":"capability-reason-capability-action","errorCode":null,"errorMessage":"${capability.reason}: ${capability.action}","messagePattern":"\\$\\{capability\\.reason\\}: \\$\\{capability\\.action\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/terminal-opener/scripts/open-terminal.js","lineNumber":289,"sourceCode":"    throw new Error('Terminal process did not start correctly.');\n  }\n  if (typeof child.once === 'function') {\n    child.once('error', error => {\n      onDetachedError(\n        new Error(`Unable to start ${command}: ${error.message}`, { cause: error })\n      );\n    });\n  }\n  child.unref();\n}\n\nfunction launch(plan, dependencies = {}) {\n  const spawnSyncImpl = dependencies.spawnSync || childProcess.spawnSync;\n  const spawnImpl = dependencies.spawn || childProcess.spawn;\n  const onDetachedError = dependencies.onDetachedError || reportDetachedError;\n  const capability = detectTerminalCapability(plan, spawnSyncImpl);\n  if (!capability.available) {\n    throw new Error(`${capability.reason}: ${capability.action}`);\n  }\n\n  if (plan.launchMode === 'recover') {\n    launchDetached(plan.command, plan.args, plan.cwd, spawnImpl, onDetachedError);\n    return { strategy: 'detached-recover', capability };\n  }\n\n  const muxResult = spawnSyncImpl(plan.command, plan.args, {\n    cwd: plan.cwd,\n    encoding: 'utf8',\n    killSignal: SPAWN_KILL_SIGNAL,\n    shell: false,\n    timeout: SYNC_TIMEOUT_MS,\n  });\n  if (!muxResult.error && muxResult.status === 0) {\n    return { strategy: 'mux', capability };\n  }\n","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/skills/terminal-opener/scripts/open-terminal.js#L271-L307","documentation":"Error \"${capability.reason}: ${capability.action}\" thrown in affaan-m/ECC.","triggerScenarios":"Thrown at skills/terminal-opener/scripts/open-terminal.js:289 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install the terminal emulator named in the error (e.g. wezterm) or choose a supported adapter that is already installed.","Run with --dry-run first to see which capability check fails, then install the missing mux/terminal and retry.","If running headless (no GUI session), use --launch recover/detached mode or open the terminal on a machine with a desktop session."],"exampleFix":"$ node open-terminal.js --terminal wezterm --dry-run -- echo hi\n# error: wezterm not found on PATH: install wezterm or pick another adapter\n$ brew install wezterm   # then retry without --dry-run","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}