devworkspace 0.4.3 → 0.4.5

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +105 -26
  3. package/dist/cli/args.d.ts +10 -0
  4. package/dist/cli/args.js +3 -0
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/cli/help.js +15 -5
  7. package/dist/cli/help.js.map +1 -1
  8. package/dist/cli/render.d.ts +2 -1
  9. package/dist/cli/render.js +71 -4
  10. package/dist/cli/render.js.map +1 -1
  11. package/dist/cli/run.js +54 -36
  12. package/dist/cli/run.js.map +1 -1
  13. package/dist/core/artifacts.d.ts +32 -0
  14. package/dist/core/artifacts.js +46 -0
  15. package/dist/core/artifacts.js.map +1 -0
  16. package/dist/core/version.js +3 -0
  17. package/dist/core/version.js.map +1 -1
  18. package/dist/core/workspace.js +1 -0
  19. package/dist/core/workspace.js.map +1 -1
  20. package/dist/integrations/adapters/graphify.js +2 -1
  21. package/dist/integrations/adapters/graphify.js.map +1 -1
  22. package/dist/integrations/adapters/pluginSkill.js +15 -1
  23. package/dist/integrations/adapters/pluginSkill.js.map +1 -1
  24. package/dist/mcp/setup.d.ts +98 -5
  25. package/dist/mcp/setup.js +332 -82
  26. package/dist/mcp/setup.js.map +1 -1
  27. package/dist/mcp/tools.d.ts +6 -0
  28. package/dist/mcp/tools.js +67 -13
  29. package/dist/mcp/tools.js.map +1 -1
  30. package/dist/mcp/verify.d.ts +41 -0
  31. package/dist/mcp/verify.js +264 -0
  32. package/dist/mcp/verify.js.map +1 -0
  33. package/dist/services/doctor.js +64 -1
  34. package/dist/services/doctor.js.map +1 -1
  35. package/dist/services/graph.d.ts +92 -4
  36. package/dist/services/graph.js +552 -191
  37. package/dist/services/graph.js.map +1 -1
  38. package/dist/services/setup.js +3 -0
  39. package/dist/services/setup.js.map +1 -1
  40. package/dist/services/taskContext.d.ts +20 -2
  41. package/dist/services/taskContext.js +29 -15
  42. package/dist/services/taskContext.js.map +1 -1
  43. package/dist/utils/proc.js +19 -3
  44. package/dist/utils/proc.js.map +1 -1
  45. package/docs/agents.md +2 -2
  46. package/docs/claude.md +13 -0
  47. package/docs/getting-started.md +40 -1
  48. package/docs/integrations.md +16 -1
  49. package/docs/mcp.md +46 -10
  50. package/docs/troubleshooting.md +5 -0
  51. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"graphify.js","sourceRoot":"","sources":["../../../src/integrations/adapters/graphify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;;;;;;;GAQG;AAEH,MAAM,UAAU,GAAG,QAAQ,CAAC;AAO5B,KAAK,UAAU,MAAM,CAAC,CAAS;IAC7B,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,GAAmB,EAAE,IAAa;IACtD,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAClD,IAAI,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClD,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;IACpD,IAAI,IAAI;QAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MA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AG,CAAC,EAAE,CAAC;gBACpF,CAAC;gBACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,yBAAyB,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,EAAE,CAAC;YACnJ,CAAC;SACF,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC;YACT,EAAE,EAAE,iBAAiB;YACrB,WAAW,EAAE,4DAA4D;YACzE,KAAK,EAAE,SAAS;YAChB,KAAK,CAAC,GAAG;gBACP,MAAM,qBAAqB,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;gBACvD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;YACtB,CAAC;SACF,CAAC,CAAC;QACH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IAClD,CAAC;CACF,CAAC","sourcesContent":["import { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport { compareVersions, findPython, findTool } from '../exec.js';\nimport { GRAPHIFY_NOTICE, writeThirdPartyNotice } from '../notices.js';\nimport type { AdapterContext, Check, IntegrationAdapter, IntegrationReport, PlanResult, PlanStep, StepOutcome } from '../types.js';\nimport { pathExists } from '../../utils/fs.js';\nimport { persistentPathHas } from '../persistentPath.js';\n\n/**\n * Graphify. Verified against the published package (graphifyy 0.9.82) and its CLI help on 2026-10-09:\n * - PyPI package `graphifyy`, executable `graphify`; README documents pip and pipx (pipx recommended on Windows)\n * - `graphify --version` prints \"graphify <version>\"\n * - `graphify install --project` writes .claude/skills/graphify/, appends a graphify section to CLAUDE.md,\n * creates .claude/CLAUDE.md and registers PreToolUse hooks (`graphify hook-guard ...`) in .claude/settings.json.\n * It merges and is idempotent, but it does change files the user owns, so every run is snapshotted and verified.\n * uv is not mentioned in the README; `uv tool install` is used because it is the equivalent of pipx for console tools.\n */\n\nconst MIN_PYTHON = '3.10.0';\n\ninterface Located {\n path: string | null;\n onPath: boolean;\n}\n\nasync function exists(p: string): Promise<boolean> {\n return pathExists(p);\n}\n\nasync function locate(ctx: AdapterContext, deep: boolean): Promise<Located> {\n const onPath = await ctx.runner.which('graphify');\n if (onPath) return { path: onPath, onPath: true };\n const dirs = [path.join(ctx.home, '.local', 'bin')];\n if (deep) dirs.push(...(await toolBinDirs(ctx)));\n for (const d of dirs) {\n const candidate = path.join(d, ctx.platform === 'win32' ? 'graphify.exe' : 'graphify');\n if (await exists(candidate)) return { path: candidate, onPath: false };\n }\n return { path: null, onPath: false };\n}\n\n/** Where uv, pipx and `pip --user` put console scripts, asked from the tools themselves (they differ by OS and version). */\nasync function toolBinDirs(ctx: AdapterContext): Promise<string[]> {\n const out: string[] = [];\n const uv = await findTool(ctx.runner, 'uv', ctx.signal);\n if (uv) {\n const r = await ctx.runner.run({ command: uv.command, args: ['tool', 'dir', '--bin'], timeoutMs: 10_000, signal: ctx.signal });\n if (r.ok && r.stdout.trim()) out.push(r.stdout.trim().split(/\\r?\\n/)[0]!);\n }\n const pipx = await findTool(ctx.runner, 'pipx', ctx.signal);\n if (pipx) {\n const r = await ctx.runner.run({ command: pipx.command, args: ['environment', '--value', 'PIPX_BIN_DIR'], timeoutMs: 10_000, signal: ctx.signal });\n if (r.ok && r.stdout.trim()) out.push(r.stdout.trim().split(/\\r?\\n/)[0]!);\n }\n const py = await findPython(ctx.runner, ctx.platform, ctx.signal);\n if (py) {\n const code = \"import sysconfig,os;print(sysconfig.get_path('scripts', os.name + '_user'))\";\n const r = await ctx.runner.run({ command: py.command, args: [...py.args, '-c', code], timeoutMs: 10_000, signal: ctx.signal });\n if (r.ok && r.stdout.trim()) out.push(r.stdout.trim().split(/\\r?\\n/)[0]!);\n }\n return out;\n}\n\nasync function readText(p: string): Promise<string | null> {\n try {\n return await fs.readFile(p, 'utf8');\n } catch {\n return null;\n }\n}\n\nfunction pathAdvice(ctx: AdapterContext, dir: string | null): string[] {\n const where = dir ? `Add ${dir} to your PATH` : 'Add the folder containing graphify to your PATH';\n return ctx.platform === 'win32'\n ? [`${where} (Settings > System > About > Advanced system settings > Environment Variables), or run \\`pipx ensurepath\\` / \\`uv tool update-shell\\`, then open a new terminal.`]\n : [`${where}, or run \\`pipx ensurepath\\` / \\`uv tool update-shell\\`, then open a new terminal.`];\n}\n\ninterface PathDiagnosis {\n /** The folder is on the PATH new processes get, but this process started before that was set. */\n staleSession: boolean;\n /** Short, accurate description of the situation for the user. */\n explanation: string;\n nextSteps: string[];\n}\n\n/**\n * Why is graphify not on this process's PATH? On Windows the registry tells us whether the folder is already on the\n * persistent PATH (then a restart is the fix and adding it again would be wrong advice) or genuinely missing from it.\n * Elsewhere, or when the registry cannot be read, the persistent PATH is unknown and the general advice is kept.\n * Only called for deep inspections; quick checks never spawn a process.\n */\nasync function diagnoseMissingPath(ctx: AdapterContext, dir: string): Promise<PathDiagnosis> {\n const persistent = await ctx.persistentPath();\n const where = persistent ? persistentPathHas(persistent, dir) : null;\n if (persistent && where) {\n return {\n staleSession: true,\n explanation: `graphify is on your ${where} PATH (${dir}), but this terminal or editor started before that was set, so processes launched from it (including Claude Code hooks) still cannot find it.`,\n nextSteps: ['Close and reopen your terminal, or restart VS Code (and Claude Code), so it inherits the updated PATH. No change to PATH is needed. Then run: devworkspace doctor'],\n };\n }\n if (persistent) {\n return {\n staleSession: false,\n explanation: `graphify is not on your PATH: ${dir} is missing from this terminal's PATH and from your persistent user and machine PATH.`,\n nextSteps: pathAdvice(ctx, dir),\n };\n }\n return {\n staleSession: false,\n explanation: 'graphify is not on this terminal\\'s PATH.',\n nextSteps: [...pathAdvice(ctx, dir), 'If you already added it, restart the terminal or editor so it picks up the change.'],\n };\n}\n\nexport const graphify: IntegrationAdapter = {\n id: 'graphify',\n name: 'Graphify',\n required: true,\n docsUrl: 'https://github.com/Graphify-Labs/graphify',\n usage:\n 'For \"where is X / what depends on Y\" questions, query the Graphify graph first (graphify query \"<question>\", graphify path \"<A>\" \"<B>\", graphify explain \"<concept>\") ' +\n 'or use the /graphify skill. The graph is a navigation aid, not a source of truth: confirm in the actual files before relying on it. After editing code, `graphify update .` refreshes it (no LLM cost).',\n\n async inspect(ctx, deep): Promise<IntegrationReport> {\n const loc = await locate(ctx, deep);\n const projectSkill = await exists(path.join(ctx.root, '.claude', 'skills', 'graphify', 'SKILL.md'));\n const userSkill = !projectSkill && (await exists(path.join(ctx.home, '.claude', 'skills', 'graphify', 'SKILL.md')));\n const settings = (await readText(path.join(ctx.root, '.claude', 'settings.json'))) ?? '';\n const hooks = /graphify\\s+hook-guard/.test(settings);\n const graph = await exists(path.join(ctx.root, 'graphify-out', 'graph.json'));\n const skillVersion = ((await readText(path.join(ctx.root, '.claude', 'skills', 'graphify', '.graphify_version'))) ?? '').trim() || null;\n\n let version: string | null = null;\n let runnable: boolean | null = null;\n if (deep && loc.path) {\n const r = await ctx.runner.run({ command: loc.path, args: ['--version'], timeoutMs: 15_000, signal: ctx.signal });\n const m = /graphify\\s+(\\S+)/i.exec(r.stdout);\n runnable = r.ok && !!m;\n version = m?.[1] ?? null;\n }\n\n const checks: Check[] = [\n { name: 'graphify executable', ok: !!loc.path, detail: loc.path ? (loc.onPath ? 'on PATH' : 'found, but not on PATH') : 'not found' },\n ];\n if (deep && loc.path) checks.push({ name: 'graphify --version', ok: !!runnable, detail: version ? `graphify ${version}` : 'did not run' });\n checks.push({ name: 'Claude skill', ok: projectSkill || userSkill, detail: projectSkill ? 'project (.claude/skills/graphify)' : userSkill ? 'user (~/.claude/skills/graphify)' : 'missing' });\n if (projectSkill && version && skillVersion) checks.push({ name: 'skill matches CLI version', ok: skillVersion === version, detail: `skill ${skillVersion}, CLI ${version}` });\n const capabilities = { cli: !!loc.path, skill: projectSkill || userSkill, hooks, graphBuilt: graph };\n const warnings: string[] = [];\n const nextSteps: string[] = [];\n if (!graph) warnings.push('No graph built yet. In Claude Code run `/graphify .` (graph building uses the model, so DevWorkspace does not do it).');\n\n const base = { id: 'graphify', name: 'Graphify', required: true, deep, capabilities, checks } as const;\n const scope = projectSkill ? 'project' : userSkill ? 'user' : null;\n\n if (!loc.path && !projectSkill && !userSkill) {\n nextSteps.push('devworkspace setup --integrations --yes');\n return { ...base, status: 'NOT_INSTALLED', variant: null, scope: null, version: null, warnings, nextSteps };\n }\n if (!loc.path) {\n warnings.push('The Claude skill/hooks exist but the graphify command is missing, so they cannot work.');\n nextSteps.push('devworkspace integrations repair --yes');\n return { ...base, status: 'DEGRADED', variant: 'project skill without CLI', scope, version: null, warnings, nextSteps };\n }\n if (deep && runnable === false) {\n warnings.push('The graphify executable was found but `graphify --version` failed.');\n nextSteps.push('devworkspace integrations repair --yes');\n return { ...base, status: 'DEGRADED', variant: 'cli (not runnable)', scope, version, warnings, nextSteps };\n }\n if (!projectSkill && !userSkill) {\n warnings.push('The graphify CLI is installed but its Claude skill is not set up for this project.');\n nextSteps.push('devworkspace setup --integrations --yes (runs `graphify install --project`)');\n return { ...base, status: 'DEGRADED', variant: 'cli without project skill', scope: null, version, warnings, nextSteps };\n }\n if (version && skillVersion && compareVersions(version.replace(/[^0-9.]/g, '') || '0.0.0', skillVersion.replace(/[^0-9.]/g, '') || '0.0.0') !== 0) {\n warnings.push(`The project skill is from graphify ${skillVersion} but the CLI is ${version}.`);\n nextSteps.push('devworkspace integrations repair --yes');\n return { ...base, status: 'DEGRADED', variant: 'cli + stale project skill', scope, version, warnings, nextSteps };\n }\n if (!loc.onPath) {\n const dir = path.dirname(loc.path);\n // Only a deep inspection may ask the registry; a quick check keeps the general advice.\n const diag: PathDiagnosis = deep\n ? await diagnoseMissingPath(ctx, dir)\n : { staleSession: false, explanation: 'graphify is not on this terminal\\'s PATH.', nextSteps: pathAdvice(ctx, dir) };\n if (hooks) {\n warnings.push(`Claude Code hooks call \\`graphify\\` by name, so they fail until it is found. ${diag.explanation}`);\n nextSteps.push(...diag.nextSteps);\n return diag.staleSession\n ? { ...base, status: 'RESTART_REQUIRED', variant: 'cli + project skill (restart terminal)', scope, version, warnings, nextSteps }\n : { ...base, status: 'DEGRADED', variant: 'cli + project skill (PATH missing)', scope, version, warnings, nextSteps };\n }\n warnings.push(diag.explanation);\n nextSteps.push(...diag.nextSteps);\n }\n return { ...base, status: deep ? 'VERIFIED' : 'INSTALLED', variant: 'cli + project skill', scope, version, warnings, nextSteps };\n },\n\n async plan(ctx, report): Promise<PlanResult> {\n const protectPaths = ['CLAUDE.md', '.claude/CLAUDE.md', '.claude/settings.json', '.claude/settings.local.json', 'AGENTS.md'];\n const blockers: string[] = [];\n const notes: string[] = [];\n const steps: PlanStep[] = [];\n if (report.status === 'VERIFIED' && !ctx.setup.repair) return { steps, blockers, protectPaths, notes: ['already verified'] };\n\n const loc = await locate(ctx, true);\n const exeRef: { path: string | null } = { path: loc.path };\n const scope = ctx.setup.scope;\n\n if (!loc.path) {\n const uv = await findTool(ctx.runner, 'uv', ctx.signal);\n const pipx = await findTool(ctx.runner, 'pipx', ctx.signal);\n const py = await findPython(ctx.runner, ctx.platform, ctx.signal);\n const pyOk = !!py && compareVersions(py.version, MIN_PYTHON) >= 0;\n const choice: { command: string[]; how: string } | null = uv\n ? { command: [uv.command, 'tool', 'install', 'graphifyy'], how: 'uv tool install' }\n : pipx\n ? { command: [pipx.command, 'install', 'graphifyy'], how: 'pipx install' }\n : pyOk && py\n ? { command: [py.command, ...py.args, '-m', 'pip', 'install', '--user', 'graphifyy'], how: 'pip install --user' }\n : null;\n if (choice && !uv && !pipx) notes.push('uv and pipx were not found; falling back to the documented `pip install --user` (no administrator rights needed).');\n if (!choice) {\n if (py && !pyOk) blockers.push(`Python ${py.version} is too old; graphify needs Python 3.10 or newer.`);\n blockers.push(\n 'No installer found. Graphify is a Python tool: install ONE of these, then re-run setup (nothing else is required):',\n ctx.platform === 'win32'\n ? ' - uv: winget install --id astral-sh.uv (or https://docs.astral.sh/uv/getting-started/installation/)'\n : ' - uv: https://docs.astral.sh/uv/getting-started/installation/',\n ' - Python 3.10+ from https://www.python.org/downloads/ (the Microsoft Store \"python\" shortcut on Windows is not a real install)',\n ' - pipx: https://pipx.pypa.io/stable/installation/',\n );\n return { steps, blockers, protectPaths, notes };\n }\n const { command, how } = choice;\n const [cmd, ...args] = command;\n steps.push({\n id: 'graphify:tool',\n description: `Install the graphifyy package for your user account (${how}; no administrator rights, nothing system-wide)`,\n command: command.map((c, i) => (i === 0 ? path.basename(c, path.extname(c)) : c)).join(' '),\n level: 'machine',\n async run(): Promise<StepOutcome> {\n const r = await ctx.runner.run({ command: cmd!, args, cwd: ctx.root, timeoutMs: 600_000, signal: ctx.signal });\n if (r.aborted) return { ok: false, detail: 'cancelled' };\n if (r.timedOut) return { ok: false, detail: 'timed out after 10 minutes (network?)' };\n if (!r.ok) {\n const text = `${r.stderr}\\n${r.stdout}`;\n if (/externally[- ]managed/i.test(text)) return { ok: false, detail: 'pip refuses to install into this Python (externally-managed environment). Install pipx or uv instead, then re-run.' };\n if (/permission denied|access is denied|EACCES|WinError 5/i.test(text)) return { ok: false, detail: 'permission denied while installing. Run the command yourself from a terminal with the right permissions.' };\n const tail = text.split(/\\r?\\n/).map((l) => l.trim()).filter(Boolean).slice(-3).join(' ');\n return { ok: false, detail: (tail || r.error || `exit ${r.code}`).slice(0, 400) };\n }\n const found = await locate(ctx, true);\n if (!found.path) return { ok: false, detail: 'graphifyy was installed but the graphify executable could not be located. Check the Scripts/bin folder of your Python tool.' };\n exeRef.path = found.path;\n return { ok: true, detail: found.onPath ? 'installed' : 'installed (not on PATH in this terminal)' };\n },\n });\n }\n\n steps.push({\n id: 'graphify:project-skill',\n description:\n scope === 'user'\n ? 'Install the Graphify skill for your user account (graphify install)'\n : 'Install the Graphify project skill (graphify install --project): adds .claude/skills/graphify/, appends a graphify section to CLAUDE.md and registers Claude Code hooks in .claude/settings.json (existing content is preserved and verified)',\n command: scope === 'user' ? 'graphify install' : 'graphify install --project',\n level: scope === 'user' ? 'user-config' : 'project',\n async run(): Promise<StepOutcome> {\n if (!exeRef.path) return { ok: false, detail: 'the graphify executable is not available' };\n const r = await ctx.runner.run({ command: exeRef.path, args: scope === 'user' ? ['install'] : ['install', '--project'], cwd: ctx.root, timeoutMs: 120_000, signal: ctx.signal });\n if (r.aborted) return { ok: false, detail: 'cancelled' };\n if (r.timedOut) return { ok: false, detail: 'timed out after 120 s' };\n if (!r.ok) {\n const tail = `${r.stderr}\\n${r.stdout}`.split(/\\r?\\n/).map((l) => l.trim()).filter(Boolean).slice(-3).join(' ');\n return { ok: false, detail: (tail || r.error || `exit ${r.code}`).slice(0, 400) };\n }\n return { ok: true, detail: 'project skill installed', restartRequired: true, managedPaths: scope === 'user' ? [] : ['.claude/skills/graphify'] };\n },\n });\n steps.push({\n id: 'graphify:notice',\n description: 'Record attribution in .devworkspace/THIRD_PARTY_NOTICES.md',\n level: 'project',\n async run(): Promise<StepOutcome> {\n await writeThirdPartyNotice(ctx.root, GRAPHIFY_NOTICE);\n return { ok: true };\n },\n });\n return { steps, blockers, protectPaths, notes };\n },\n};\n"]}
1
+ {"version":3,"file":"graphify.js","sourceRoot":"","sources":["../../../src/integrations/adapters/graphify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;;;;;;;GAQG;AAEH,MAAM,UAAU,GAAG,QAAQ,CAAC;AAO5B,KAAK,UAAU,MAAM,CAAC,CAAS;IAC7B,OAAO,UA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AAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;oBAChH,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;gBACpF,CAAC;gBACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,yBAAyB,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,EAAE,CAAC;YACnJ,CAAC;SACF,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC;YACT,EAAE,EAAE,iBAAiB;YACrB,WAAW,EAAE,4DAA4D;YACzE,KAAK,EAAE,SAAS;YAChB,KAAK,CAAC,GAAG;gBACP,MAAM,qBAAqB,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;gBACvD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;YACtB,CAAC;SACF,CAAC,CAAC;QACH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IAClD,CAAC;CACF,CAAC","sourcesContent":["import { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport { compareVersions, findPython, findTool } from '../exec.js';\nimport { GRAPHIFY_NOTICE, writeThirdPartyNotice } from '../notices.js';\nimport type { AdapterContext, Check, IntegrationAdapter, IntegrationReport, PlanResult, PlanStep, StepOutcome } from '../types.js';\nimport { pathExists } from '../../utils/fs.js';\nimport { resolveGraphifyGraph } from '../../core/artifacts.js';\nimport { persistentPathHas } from '../persistentPath.js';\n\n/**\n * Graphify. Verified against the published package (graphifyy 0.9.82) and its CLI help on 2026-10-09:\n * - PyPI package `graphifyy`, executable `graphify`; README documents pip and pipx (pipx recommended on Windows)\n * - `graphify --version` prints \"graphify <version>\"\n * - `graphify install --project` writes .claude/skills/graphify/, appends a graphify section to CLAUDE.md,\n * creates .claude/CLAUDE.md and registers PreToolUse hooks (`graphify hook-guard ...`) in .claude/settings.json.\n * It merges and is idempotent, but it does change files the user owns, so every run is snapshotted and verified.\n * uv is not mentioned in the README; `uv tool install` is used because it is the equivalent of pipx for console tools.\n */\n\nconst MIN_PYTHON = '3.10.0';\n\ninterface Located {\n path: string | null;\n onPath: boolean;\n}\n\nasync function exists(p: string): Promise<boolean> {\n return pathExists(p);\n}\n\nasync function locate(ctx: AdapterContext, deep: boolean): Promise<Located> {\n const onPath = await ctx.runner.which('graphify');\n if (onPath) return { path: onPath, onPath: true };\n const dirs = [path.join(ctx.home, '.local', 'bin')];\n if (deep) dirs.push(...(await toolBinDirs(ctx)));\n for (const d of dirs) {\n const candidate = path.join(d, ctx.platform === 'win32' ? 'graphify.exe' : 'graphify');\n if (await exists(candidate)) return { path: candidate, onPath: false };\n }\n return { path: null, onPath: false };\n}\n\n/** Where uv, pipx and `pip --user` put console scripts, asked from the tools themselves (they differ by OS and version). */\nasync function toolBinDirs(ctx: AdapterContext): Promise<string[]> {\n const out: string[] = [];\n const uv = await findTool(ctx.runner, 'uv', ctx.signal);\n if (uv) {\n const r = await ctx.runner.run({ command: uv.command, args: ['tool', 'dir', '--bin'], timeoutMs: 10_000, signal: ctx.signal });\n if (r.ok && r.stdout.trim()) out.push(r.stdout.trim().split(/\\r?\\n/)[0]!);\n }\n const pipx = await findTool(ctx.runner, 'pipx', ctx.signal);\n if (pipx) {\n const r = await ctx.runner.run({ command: pipx.command, args: ['environment', '--value', 'PIPX_BIN_DIR'], timeoutMs: 10_000, signal: ctx.signal });\n if (r.ok && r.stdout.trim()) out.push(r.stdout.trim().split(/\\r?\\n/)[0]!);\n }\n const py = await findPython(ctx.runner, ctx.platform, ctx.signal);\n if (py) {\n const code = \"import sysconfig,os;print(sysconfig.get_path('scripts', os.name + '_user'))\";\n const r = await ctx.runner.run({ command: py.command, args: [...py.args, '-c', code], timeoutMs: 10_000, signal: ctx.signal });\n if (r.ok && r.stdout.trim()) out.push(r.stdout.trim().split(/\\r?\\n/)[0]!);\n }\n return out;\n}\n\nasync function readText(p: string): Promise<string | null> {\n try {\n return await fs.readFile(p, 'utf8');\n } catch {\n return null;\n }\n}\n\nfunction pathAdvice(ctx: AdapterContext, dir: string | null): string[] {\n const where = dir ? `Add ${dir} to your PATH` : 'Add the folder containing graphify to your PATH';\n return ctx.platform === 'win32'\n ? [`${where} (Settings > System > About > Advanced system settings > Environment Variables), or run \\`pipx ensurepath\\` / \\`uv tool update-shell\\`, then open a new terminal.`]\n : [`${where}, or run \\`pipx ensurepath\\` / \\`uv tool update-shell\\`, then open a new terminal.`];\n}\n\ninterface PathDiagnosis {\n /** The folder is on the PATH new processes get, but this process started before that was set. */\n staleSession: boolean;\n /** Short, accurate description of the situation for the user. */\n explanation: string;\n nextSteps: string[];\n}\n\n/**\n * Why is graphify not on this process's PATH? On Windows the registry tells us whether the folder is already on the\n * persistent PATH (then a restart is the fix and adding it again would be wrong advice) or genuinely missing from it.\n * Elsewhere, or when the registry cannot be read, the persistent PATH is unknown and the general advice is kept.\n * Only called for deep inspections; quick checks never spawn a process.\n */\nasync function diagnoseMissingPath(ctx: AdapterContext, dir: string): Promise<PathDiagnosis> {\n const persistent = await ctx.persistentPath();\n const where = persistent ? persistentPathHas(persistent, dir) : null;\n if (persistent && where) {\n return {\n staleSession: true,\n explanation: `graphify is on your ${where} PATH (${dir}), but this terminal or editor started before that was set, so processes launched from it (including Claude Code hooks) still cannot find it.`,\n nextSteps: ['Close and reopen your terminal, or restart VS Code (and Claude Code), so it inherits the updated PATH. No change to PATH is needed. Then run: devworkspace doctor'],\n };\n }\n if (persistent) {\n return {\n staleSession: false,\n explanation: `graphify is not on your PATH: ${dir} is missing from this terminal's PATH and from your persistent user and machine PATH.`,\n nextSteps: pathAdvice(ctx, dir),\n };\n }\n return {\n staleSession: false,\n explanation: 'graphify is not on this terminal\\'s PATH.',\n nextSteps: [...pathAdvice(ctx, dir), 'If you already added it, restart the terminal or editor so it picks up the change.'],\n };\n}\n\nexport const graphify: IntegrationAdapter = {\n id: 'graphify',\n name: 'Graphify',\n required: true,\n docsUrl: 'https://github.com/Graphify-Labs/graphify',\n usage:\n 'For \"where is X / what depends on Y\" questions, query the Graphify graph first (graphify query \"<question>\", graphify path \"<A>\" \"<B>\", graphify explain \"<concept>\") ' +\n 'or use the /graphify skill. The graph is a navigation aid, not a source of truth: confirm in the actual files before relying on it. After editing code, `graphify update .` refreshes it (no LLM cost).',\n\n async inspect(ctx, deep): Promise<IntegrationReport> {\n const loc = await locate(ctx, deep);\n const projectSkill = await exists(path.join(ctx.root, '.claude', 'skills', 'graphify', 'SKILL.md'));\n const userSkill = !projectSkill && (await exists(path.join(ctx.home, '.claude', 'skills', 'graphify', 'SKILL.md')));\n const settings = (await readText(path.join(ctx.root, '.claude', 'settings.json'))) ?? '';\n const hooks = /graphify\\s+hook-guard/.test(settings);\n const graph = (await resolveGraphifyGraph(ctx.root)).exists;\n const skillVersion = ((await readText(path.join(ctx.root, '.claude', 'skills', 'graphify', '.graphify_version'))) ?? '').trim() || null;\n\n let version: string | null = null;\n let runnable: boolean | null = null;\n if (deep && loc.path) {\n const r = await ctx.runner.run({ command: loc.path, args: ['--version'], timeoutMs: 15_000, signal: ctx.signal });\n const m = /graphify\\s+(\\S+)/i.exec(r.stdout);\n runnable = r.ok && !!m;\n version = m?.[1] ?? null;\n }\n\n const checks: Check[] = [\n { name: 'graphify executable', ok: !!loc.path, detail: loc.path ? (loc.onPath ? 'on PATH' : 'found, but not on PATH') : 'not found' },\n ];\n if (deep && loc.path) checks.push({ name: 'graphify --version', ok: !!runnable, detail: version ? `graphify ${version}` : 'did not run' });\n checks.push({ name: 'Claude skill', ok: projectSkill || userSkill, detail: projectSkill ? 'project (.claude/skills/graphify)' : userSkill ? 'user (~/.claude/skills/graphify)' : 'missing' });\n if (projectSkill && version && skillVersion) checks.push({ name: 'skill matches CLI version', ok: skillVersion === version, detail: `skill ${skillVersion}, CLI ${version}` });\n const capabilities = { cli: !!loc.path, skill: projectSkill || userSkill, hooks, graphBuilt: graph };\n const warnings: string[] = [];\n const nextSteps: string[] = [];\n if (!graph) warnings.push('No graph built yet. In Claude Code run `/graphify .` (graph building uses the model, so DevWorkspace does not do it).');\n\n const base = { id: 'graphify', name: 'Graphify', required: true, deep, capabilities, checks } as const;\n const scope = projectSkill ? 'project' : userSkill ? 'user' : null;\n\n if (!loc.path && !projectSkill && !userSkill) {\n nextSteps.push('devworkspace setup --integrations --yes');\n return { ...base, status: 'NOT_INSTALLED', variant: null, scope: null, version: null, warnings, nextSteps };\n }\n if (!loc.path) {\n warnings.push('The Claude skill/hooks exist but the graphify command is missing, so they cannot work.');\n nextSteps.push('devworkspace integrations repair --yes');\n return { ...base, status: 'DEGRADED', variant: 'project skill without CLI', scope, version: null, warnings, nextSteps };\n }\n if (deep && runnable === false) {\n warnings.push('The graphify executable was found but `graphify --version` failed.');\n nextSteps.push('devworkspace integrations repair --yes');\n return { ...base, status: 'DEGRADED', variant: 'cli (not runnable)', scope, version, warnings, nextSteps };\n }\n if (!projectSkill && !userSkill) {\n warnings.push('The graphify CLI is installed but its Claude skill is not set up for this project.');\n nextSteps.push('devworkspace setup --integrations --yes (runs `graphify install --project`)');\n return { ...base, status: 'DEGRADED', variant: 'cli without project skill', scope: null, version, warnings, nextSteps };\n }\n if (version && skillVersion && compareVersions(version.replace(/[^0-9.]/g, '') || '0.0.0', skillVersion.replace(/[^0-9.]/g, '') || '0.0.0') !== 0) {\n warnings.push(`The project skill is from graphify ${skillVersion} but the CLI is ${version}.`);\n nextSteps.push('devworkspace integrations repair --yes');\n return { ...base, status: 'DEGRADED', variant: 'cli + stale project skill', scope, version, warnings, nextSteps };\n }\n if (!loc.onPath) {\n const dir = path.dirname(loc.path);\n // Only a deep inspection may ask the registry; a quick check keeps the general advice.\n const diag: PathDiagnosis = deep\n ? await diagnoseMissingPath(ctx, dir)\n : { staleSession: false, explanation: 'graphify is not on this terminal\\'s PATH.', nextSteps: pathAdvice(ctx, dir) };\n if (hooks) {\n warnings.push(`Claude Code hooks call \\`graphify\\` by name, so they fail until it is found. ${diag.explanation}`);\n nextSteps.push(...diag.nextSteps);\n return diag.staleSession\n ? { ...base, status: 'RESTART_REQUIRED', variant: 'cli + project skill (restart terminal)', scope, version, warnings, nextSteps }\n : { ...base, status: 'DEGRADED', variant: 'cli + project skill (PATH missing)', scope, version, warnings, nextSteps };\n }\n warnings.push(diag.explanation);\n nextSteps.push(...diag.nextSteps);\n }\n return { ...base, status: deep ? 'VERIFIED' : 'INSTALLED', variant: 'cli + project skill', scope, version, warnings, nextSteps };\n },\n\n async plan(ctx, report): Promise<PlanResult> {\n const protectPaths = ['CLAUDE.md', '.claude/CLAUDE.md', '.claude/settings.json', '.claude/settings.local.json', 'AGENTS.md'];\n const blockers: string[] = [];\n const notes: string[] = [];\n const steps: PlanStep[] = [];\n if (report.status === 'VERIFIED' && !ctx.setup.repair) return { steps, blockers, protectPaths, notes: ['already verified'] };\n\n const loc = await locate(ctx, true);\n const exeRef: { path: string | null } = { path: loc.path };\n const scope = ctx.setup.scope;\n\n if (!loc.path) {\n const uv = await findTool(ctx.runner, 'uv', ctx.signal);\n const pipx = await findTool(ctx.runner, 'pipx', ctx.signal);\n const py = await findPython(ctx.runner, ctx.platform, ctx.signal);\n const pyOk = !!py && compareVersions(py.version, MIN_PYTHON) >= 0;\n const choice: { command: string[]; how: string } | null = uv\n ? { command: [uv.command, 'tool', 'install', 'graphifyy'], how: 'uv tool install' }\n : pipx\n ? { command: [pipx.command, 'install', 'graphifyy'], how: 'pipx install' }\n : pyOk && py\n ? { command: [py.command, ...py.args, '-m', 'pip', 'install', '--user', 'graphifyy'], how: 'pip install --user' }\n : null;\n if (choice && !uv && !pipx) notes.push('uv and pipx were not found; falling back to the documented `pip install --user` (no administrator rights needed).');\n if (!choice) {\n if (py && !pyOk) blockers.push(`Python ${py.version} is too old; graphify needs Python 3.10 or newer.`);\n blockers.push(\n 'No installer found. Graphify is a Python tool: install ONE of these, then re-run setup (nothing else is required):',\n ctx.platform === 'win32'\n ? ' - uv: winget install --id astral-sh.uv (or https://docs.astral.sh/uv/getting-started/installation/)'\n : ' - uv: https://docs.astral.sh/uv/getting-started/installation/',\n ' - Python 3.10+ from https://www.python.org/downloads/ (the Microsoft Store \"python\" shortcut on Windows is not a real install)',\n ' - pipx: https://pipx.pypa.io/stable/installation/',\n );\n return { steps, blockers, protectPaths, notes };\n }\n const { command, how } = choice;\n const [cmd, ...args] = command;\n steps.push({\n id: 'graphify:tool',\n description: `Install the graphifyy package for your user account (${how}; no administrator rights, nothing system-wide)`,\n command: command.map((c, i) => (i === 0 ? path.basename(c, path.extname(c)) : c)).join(' '),\n level: 'machine',\n async run(): Promise<StepOutcome> {\n const r = await ctx.runner.run({ command: cmd!, args, cwd: ctx.root, timeoutMs: 600_000, signal: ctx.signal });\n if (r.aborted) return { ok: false, detail: 'cancelled' };\n if (r.timedOut) return { ok: false, detail: 'timed out after 10 minutes (network?)' };\n if (!r.ok) {\n const text = `${r.stderr}\\n${r.stdout}`;\n if (/externally[- ]managed/i.test(text)) return { ok: false, detail: 'pip refuses to install into this Python (externally-managed environment). Install pipx or uv instead, then re-run.' };\n if (/permission denied|access is denied|EACCES|WinError 5/i.test(text)) return { ok: false, detail: 'permission denied while installing. Run the command yourself from a terminal with the right permissions.' };\n const tail = text.split(/\\r?\\n/).map((l) => l.trim()).filter(Boolean).slice(-3).join(' ');\n return { ok: false, detail: (tail || r.error || `exit ${r.code}`).slice(0, 400) };\n }\n const found = await locate(ctx, true);\n if (!found.path) return { ok: false, detail: 'graphifyy was installed but the graphify executable could not be located. Check the Scripts/bin folder of your Python tool.' };\n exeRef.path = found.path;\n return { ok: true, detail: found.onPath ? 'installed' : 'installed (not on PATH in this terminal)' };\n },\n });\n }\n\n steps.push({\n id: 'graphify:project-skill',\n description:\n scope === 'user'\n ? 'Install the Graphify skill for your user account (graphify install)'\n : 'Install the Graphify project skill (graphify install --project): adds .claude/skills/graphify/, appends a graphify section to CLAUDE.md and registers Claude Code hooks in .claude/settings.json (existing content is preserved and verified)',\n command: scope === 'user' ? 'graphify install' : 'graphify install --project',\n level: scope === 'user' ? 'user-config' : 'project',\n async run(): Promise<StepOutcome> {\n if (!exeRef.path) return { ok: false, detail: 'the graphify executable is not available' };\n const r = await ctx.runner.run({ command: exeRef.path, args: scope === 'user' ? ['install'] : ['install', '--project'], cwd: ctx.root, timeoutMs: 120_000, signal: ctx.signal });\n if (r.aborted) return { ok: false, detail: 'cancelled' };\n if (r.timedOut) return { ok: false, detail: 'timed out after 120 s' };\n if (!r.ok) {\n const tail = `${r.stderr}\\n${r.stdout}`.split(/\\r?\\n/).map((l) => l.trim()).filter(Boolean).slice(-3).join(' ');\n return { ok: false, detail: (tail || r.error || `exit ${r.code}`).slice(0, 400) };\n }\n return { ok: true, detail: 'project skill installed', restartRequired: true, managedPaths: scope === 'user' ? [] : ['.claude/skills/graphify'] };\n },\n });\n steps.push({\n id: 'graphify:notice',\n description: 'Record attribution in .devworkspace/THIRD_PARTY_NOTICES.md',\n level: 'project',\n async run(): Promise<StepOutcome> {\n await writeThirdPartyNotice(ctx.root, GRAPHIFY_NOTICE);\n return { ok: true };\n },\n });\n return { steps, blockers, protectPaths, notes };\n },\n};\n"]}
@@ -21,6 +21,7 @@ export function createPluginSkillAdapter(cfg) {
21
21
  async function observe(ctx, deep) {
22
22
  const declared = await readDeclared(ctx, cfg.native);
23
23
  let claude = null;
24
+ let nativePresent = declared.enabled !== null;
24
25
  let nativeInstalled = declared.enabled !== null;
25
26
  let nativeScope = declared.enabled;
26
27
  let nativeError = null;
@@ -33,6 +34,7 @@ export function createPluginSkillAdapter(cfg) {
33
34
  const l = await listPlugins(ctx, claude);
34
35
  if (l.ok) {
35
36
  const p = findPlugin(l.plugins, id, ctx.root);
37
+ nativePresent = !!p;
36
38
  nativeInstalled = !!p && p.enabled;
37
39
  nativeScope = p ? (p.scope === 'user' ? 'user' : 'project') : null;
38
40
  version = p?.version ?? null;
@@ -62,7 +64,7 @@ export function createPluginSkillAdapter(cfg) {
62
64
  const base = portableScope === 'user' ? ctx.home : ctx.root;
63
65
  refs = (await fileExists(path.join(base, '.claude', 'skills', cfg.referencesDir))) || (await fileExists(path.join(base, '.claude', cfg.referencesDir))) || (await fileExists(path.join(base, cfg.referencesDir)));
64
66
  }
65
- return { claude, nativeInstalled, nativeScope, nativeError, registered, version, listError, portablePresent, portableScope, refs };
67
+ return { claude, nativePresent, nativeInstalled, nativeScope, nativeError, registered, version, listError, portablePresent, portableScope, refs };
66
68
  }
67
69
  return {
68
70
  id: cfg.id,
@@ -99,6 +101,14 @@ export function createPluginSkillAdapter(cfg) {
99
101
  warnings.push('Not yet verified against `claude plugin list`; run `devworkspace doctor` or `devworkspace integrations status`.');
100
102
  return { ...base, status: degraded ? 'DEGRADED' : deep ? 'VERIFIED' : 'INSTALLED', variant: 'native plugin', scope: o.nativeScope, version: o.version, checks, capabilities: caps, warnings, nextSteps };
101
103
  }
104
+ if (o.nativePresent && !o.nativeInstalled) {
105
+ checks.push({ name: 'native plugin', ok: false, detail: `${id} is installed but disabled${o.nativeScope ? ` (${o.nativeScope} scope)` : ''}` });
106
+ caps.skills = true;
107
+ caps.commands = true;
108
+ warnings.push(`${cfg.name} plugin is installed but disabled.`);
109
+ nextSteps.push(`claude plugin enable ${id}`);
110
+ return { ...base, status: 'DEGRADED', variant: 'native plugin', scope: o.nativeScope, version: o.version, checks, capabilities: caps, warnings, nextSteps };
111
+ }
102
112
  if (o.portablePresent.length > 0) {
103
113
  const complete = o.portablePresent.length === cfg.coreSkills.length;
104
114
  caps.skills = complete;
@@ -117,6 +127,10 @@ export function createPluginSkillAdapter(cfg) {
117
127
  return { ...base, status: 'DEGRADED', variant: 'portable skills', scope: o.portableScope, version: null, checks, capabilities: caps, warnings, nextSteps };
118
128
  }
119
129
  checks.push({ name: 'marketplace', ok: o.registered, detail: o.registered ? `${cfg.native.marketplaceName} is registered but the plugin is not installed` : 'not registered' });
130
+ if (!o.registered) {
131
+ warnings.push(`Marketplace ${cfg.native.marketplaceName} is not registered.`);
132
+ nextSteps.push(`claude plugin marketplace add ${cfg.native.marketplaceUrl} --scope project`);
133
+ }
120
134
  nextSteps.push('devworkspace setup --integrations --yes');
121
135
  return { ...base, status: 'NOT_INSTALLED', variant: null, scope: null, version: null, checks, capabilities: caps, warnings, nextSteps };
122
136
  },
@@ -1 +1 @@
1
- {"version":3,"file":"pluginSkill.js","sourceRoot":"","sources":["../../../src/integrations/adapters/pluginSkill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,aAAa,EAAa,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,qBAAqB,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAmB,MAAM,mBAAmB,CAAC;AAC1J,OAAO,EAAE,qBAAqB,EAAqB,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAuB/C,MAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B,KAAK,UAAU,SAAS,CAAC,IAAY;IACnC,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CA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AAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,wBAAwB,EAAE,CAAC,CAAC;oBAC3H,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,wBAAwB,EAAE,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC;gBAClI,CAAC;aACF,CAAC,CAAC;YACH,KAAK,CAAC,IAAI,CAAC;gBACT,EAAE,EAAE,GAAG,GAAG,CAAC,EAAE,SAAS;gBACtB,WAAW,EAAE,gFAAgF;gBAC7F,KAAK,EAAE,SAAS;gBAChB,KAAK,CAAC,GAAG;oBACP,MAAM,qBAAqB,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;oBAClD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;gBACtB,CAAC;aACF,CAAC,CAAC;YACH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;QAClD,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport { compareVersions, findClaudeCli, type Tool } from '../exec.js';\nimport { findPlugin, listPlugins, marketplaceRegistered, MIN_PLUGIN_JSON, nativeSteps, pluginId, readDeclared, type NativeSpec } from './claudePlugin.js';\nimport { writeThirdPartyNotice, type NoticeSource } from '../notices.js';\nimport type { AdapterContext, Check, IntegrationAdapter, IntegrationId, IntegrationReport, PlanResult, PlanStep, StepOutcome } from '../types.js';\nimport { pathExists } from '../../utils/fs.js';\n\nexport interface PluginSkillConfig {\n id: IntegrationId;\n name: string;\n usage: string;\n docsUrl: string;\n native: NativeSpec;\n /** `owner/repo` for the portable `npx skills add` path. */\n skillsRepo: string;\n /** Skill directories whose presence means the portable skills are installed. */\n coreSkills: string[];\n notice: NoticeSource;\n /** Capabilities the native plugin provides that portable skills cannot. */\n nativeOnly: string[];\n /** True only when the plugin's own manifest registers lifecycle hooks (verified from its plugin.json). */\n nativeHooks: boolean;\n /** Extra check for the native plugin (e.g. hooks need node). */\n extraNativeChecks?(ctx: AdapterContext): Promise<{ checks: Check[]; warnings: string[]; degraded: boolean }>;\n /** Shared supplementary directory expected beside skills (agent-skills ships references/). */\n referencesDir?: string;\n}\n\nconst SKILLS_CLI = 'skills';\n\nasync function skillDirs(base: string): Promise<string[]> {\n try {\n return (await fs.readdir(path.join(base, '.claude', 'skills'), { withFileTypes: true })).filter((e) => e.isDirectory()).map((e) => e.name);\n } catch {\n return [];\n }\n}\n\nasync function fileExists(p: string): Promise<boolean> {\n return pathExists(p);\n}\n\nexport function createPluginSkillAdapter(cfg: PluginSkillConfig): IntegrationAdapter {\n const id = pluginId(cfg.native);\n\n async function observe(ctx: AdapterContext, deep: boolean): Promise<{\n claude: Tool | null;\n nativeInstalled: boolean;\n nativeScope: 'project' | 'user' | null;\n nativeError: string | null;\n registered: boolean;\n version: string | null;\n listError: string | null;\n portablePresent: string[];\n portableScope: 'project' | 'user' | null;\n refs: boolean;\n }> {\n const declared = await readDeclared(ctx, cfg.native);\n let claude: Tool | null = null;\n let nativeInstalled = declared.enabled !== null;\n let nativeScope = declared.enabled;\n let nativeError: string | null = null;\n let registered = declared.marketplace;\n let version: string | null = null;\n let listError: string | null = null;\n if (deep) {\n claude = await findClaudeCli(ctx.runner, ctx.home, ctx.signal);\n if (claude && compareVersions(claude.version, MIN_PLUGIN_JSON) >= 0) {\n const l = await listPlugins(ctx, claude);\n if (l.ok) {\n const p = findPlugin(l.plugins, id, ctx.root);\n nativeInstalled = !!p && p.enabled;\n nativeScope = p ? (p.scope === 'user' ? 'user' : 'project') : null;\n version = p?.version ?? null;\n if (p && (p.errors?.length ?? 0) > 0) nativeError = p.errors!.join('; ').slice(0, 300);\n if (p && !p.enabled) nativeError = 'the plugin is installed but disabled';\n if (!p) {\n const reg = await marketplaceRegistered(ctx, claude, cfg.native.marketplaceName);\n registered = reg ?? registered;\n } else registered = true;\n } else listError = l.error ?? 'could not list plugins';\n }\n }\n const projectSkills = await skillDirs(ctx.root);\n const userSkills = await skillDirs(ctx.home);\n const inProject = cfg.coreSkills.filter((s) => projectSkills.includes(s));\n const inUser = cfg.coreSkills.filter((s) => userSkills.includes(s));\n const portablePresent = inProject.length >= inUser.length ? inProject : inUser;\n const portableScope = portablePresent.length === 0 ? null : inProject.length >= inUser.length ? 'project' : 'user';\n let refs = true;\n if (cfg.referencesDir && portablePresent.length > 0) {\n const base = portableScope === 'user' ? ctx.home : ctx.root;\n refs = (await fileExists(path.join(base, '.claude', 'skills', cfg.referencesDir))) || (await fileExists(path.join(base, '.claude', cfg.referencesDir))) || (await fileExists(path.join(base, cfg.referencesDir)));\n }\n return { claude, nativeInstalled, nativeScope, nativeError, registered, version, listError, portablePresent, portableScope, refs };\n }\n\n return {\n id: cfg.id,\n name: cfg.name,\n required: true,\n usage: cfg.usage,\n docsUrl: cfg.docsUrl,\n\n async inspect(ctx, deep): Promise<IntegrationReport> {\n const o = await observe(ctx, deep);\n const checks: Check[] = [];\n const warnings: string[] = [];\n const nextSteps: string[] = [];\n const caps: Record<string, boolean> = { skills: false, commands: false, hooks: false };\n const base = { id: cfg.id, name: cfg.name, required: true, deep } as const;\n if (deep) checks.push({ name: 'Claude Code CLI', ok: !!o.claude, detail: o.claude ? `v${o.claude.version}` : 'not found (PATH or VS Code extension)' });\n if (o.listError) warnings.push(`Could not read the plugin list: ${o.listError}`);\n\n if (o.nativeInstalled) {\n checks.push({ name: 'native plugin', ok: !o.nativeError, detail: o.nativeError ?? `${id}${o.nativeScope ? ` (${o.nativeScope} scope)` : ''}` });\n caps.skills = true;\n caps.commands = true;\n let degraded = !!o.nativeError;\n if (o.nativeError) {\n warnings.push(`${cfg.name} plugin problem: ${o.nativeError}`);\n nextSteps.push(`claude plugin list (inspect errors), then: claude plugin enable ${id}`);\n }\n const extra = cfg.extraNativeChecks ? await cfg.extraNativeChecks(ctx) : { checks: [], warnings: [], degraded: false };\n checks.push(...extra.checks);\n warnings.push(...extra.warnings);\n caps.hooks = cfg.nativeHooks && !extra.degraded;\n degraded = degraded || extra.degraded;\n if (!deep) warnings.push('Not yet verified against `claude plugin list`; run `devworkspace doctor` or `devworkspace integrations status`.');\n return { ...base, status: degraded ? 'DEGRADED' : deep ? 'VERIFIED' : 'INSTALLED', variant: 'native plugin', scope: o.nativeScope, version: o.version, checks, capabilities: caps, warnings, nextSteps };\n }\n\n if (o.portablePresent.length > 0) {\n const complete = o.portablePresent.length === cfg.coreSkills.length;\n caps.skills = complete;\n checks.push({ name: 'portable skills', ok: complete, detail: `${o.portablePresent.length}/${cfg.coreSkills.length} core skills found (${o.portableScope} scope)` });\n if (cfg.referencesDir) checks.push({ name: 'supplementary references', ok: o.refs, detail: o.refs ? 'found' : `${cfg.referencesDir}/ not installed` });\n if (!complete) {\n const missing = cfg.coreSkills.filter((s) => !o.portablePresent.includes(s));\n warnings.push(`Partial installation: missing skills ${missing.join(', ')}.`);\n nextSteps.push('devworkspace integrations repair --yes');\n }\n if (!o.refs) warnings.push(`The shared ${cfg.referencesDir}/ checklists are not installed (known limitation of the skills CLI), so skills that point to them have broken references.`);\n warnings.push(`Portable skills only: ${cfg.nativeOnly.join(', ')} from the native plugin are not available.`);\n nextSteps.push(`For the full plugin: claude plugin marketplace add ${cfg.native.marketplaceUrl} --scope project, then claude plugin install ${id} --scope project`);\n return { ...base, status: 'DEGRADED', variant: 'portable skills', scope: o.portableScope, version: null, checks, capabilities: caps, warnings, nextSteps };\n }\n\n checks.push({ name: 'marketplace', ok: o.registered, detail: o.registered ? `${cfg.native.marketplaceName} is registered but the plugin is not installed` : 'not registered' });\n nextSteps.push('devworkspace setup --integrations --yes');\n return { ...base, status: 'NOT_INSTALLED', variant: null, scope: null, version: null, checks, capabilities: caps, warnings, nextSteps };\n },\n\n async plan(ctx, report): Promise<PlanResult> {\n const o = await observe(ctx, true);\n const blockers: string[] = [];\n const notes: string[] = [];\n const protectPaths = ['.claude/settings.json', '.claude/settings.local.json', 'CLAUDE.md', '.claude/CLAUDE.md', 'AGENTS.md'];\n const steps: PlanStep[] = [];\n const scope = ctx.setup.scope;\n\n if (report.status === 'VERIFIED' && !ctx.setup.repair) return { steps, blockers, protectPaths, notes: ['already verified'] };\n if (o.nativeInstalled && !o.nativeError) return { steps, blockers, protectPaths, notes: ['native plugin already installed'] };\n\n // If the plugin list cannot be read we do not know what is installed: installing anything now could duplicate or overwrite it.\n if (o.claude && compareVersions(o.claude.version, MIN_PLUGIN_JSON) >= 0 && o.listError) {\n blockers.push(`Could not read the installed plugin list (${o.listError}), so nothing was installed. Run \"claude plugin list --json\" yourself to see what is installed, then re-run setup.`);\n return { steps, blockers, protectPaths, notes };\n }\n if (o.claude && compareVersions(o.claude.version, MIN_PLUGIN_JSON) >= 0 && !o.listError) {\n // marketplace registered but plugin missing -> only the install step\n steps.push(...nativeSteps(ctx, o.claude, cfg.native, scope, { registered: o.registered }));\n if (o.nativeError && o.nativeScope) {\n notes.push(`The plugin is present but unhealthy (${o.nativeError}); re-running install to repair.`);\n }\n return { steps, blockers, protectPaths, notes };\n }\n if (o.claude) notes.push(`Claude Code ${o.claude.version} is older than ${MIN_PLUGIN_JSON}, which the plugin commands' --json output needs; using portable skills.`);\n else notes.push('The Claude Code CLI was not found on PATH or in the VS Code extension; using portable skills instead of the native plugin.');\n if (o.listError) notes.push(`\\`claude plugin list\\` failed (${o.listError}); using portable skills.`);\n\n // ---- portable skills via the documented Skills CLI ----\n if (o.portablePresent.length === cfg.coreSkills.length && o.refs) return { steps, blockers, protectPaths, notes: [...notes, 'portable skills already installed'] };\n const managed = new Set(ctx.prior?.managedPaths ?? []);\n const baseDir = scope === 'user' ? ctx.home : ctx.root;\n const existing = await skillDirs(baseDir);\n const conflicts = cfg.coreSkills.filter((s) => existing.includes(s) && !managed.has(`.claude/skills/${s}`));\n if (conflicts.length > 0 && o.portablePresent.length < cfg.coreSkills.length) {\n blockers.push(\n `Skill folder(s) ${conflicts.join(', ')} already exist in .claude/skills and were not installed by DevWorkspace, so they are treated as yours and will not be overwritten. Rename or remove them, or install the native plugin instead.`,\n );\n return { steps, blockers, protectPaths, notes };\n }\n const args = ['--yes', SKILLS_CLI, 'add', cfg.skillsRepo, '--agent', 'claude-code', '--skill', '*', '--copy', '-y', '--json', ...(scope === 'user' ? ['-g'] : [])];\n steps.push({\n id: `${cfg.id}:skills-cli`,\n description: `Install ${cfg.name} skills from ${cfg.skillsRepo} with the Skills CLI (${scope} scope, copied files, telemetry disabled)`,\n command: `npx ${args.join(' ')}`,\n level: 'third-party-code',\n async run(): Promise<StepOutcome> {\n const before = new Set(await skillDirs(baseDir));\n const r = await ctx.runner.runNpx(args, { cwd: ctx.root, timeoutMs: 300_000, signal: ctx.signal, env: { DISABLE_TELEMETRY: '1', DO_NOT_TRACK: '1' } });\n if (r.aborted) return { ok: false, detail: 'cancelled' };\n if (r.timedOut) return { ok: false, detail: 'timed out after 300 s (network?)' };\n if (!r.ok) {\n const tail = `${r.stderr}\\n${r.stdout}`.split(/\\r?\\n/).map((l) => l.trim()).filter(Boolean).slice(-3).join(' ');\n return { ok: false, detail: (tail || r.error || `exit ${r.code}`).slice(0, 400) };\n }\n const after = await skillDirs(baseDir);\n const created = after.filter((s) => !before.has(s));\n ctx.report({ id: cfg.id, step: `${cfg.id}:skills-cli`, state: 'info', detail: `${created.length} skill folder(s) added` });\n return { ok: true, detail: `${created.length} skill folder(s) added`, managedPaths: created.map((s) => `.claude/skills/${s}`) };\n },\n });\n steps.push({\n id: `${cfg.id}:notice`,\n description: 'Record third-party license/attribution in .devworkspace/THIRD_PARTY_NOTICES.md',\n level: 'project',\n async run(): Promise<StepOutcome> {\n await writeThirdPartyNotice(ctx.root, cfg.notice);\n return { ok: true };\n },\n });\n return { steps, blockers, protectPaths, notes };\n },\n };\n}\n\n"]}
1
+ {"version":3,"file":"pluginSkill.js","sourceRoot":"","s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ClD,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport { compareVersions, findClaudeCli, type Tool } from '../exec.js';\nimport { findPlugin, listPlugins, marketplaceRegistered, MIN_PLUGIN_JSON, nativeSteps, pluginId, readDeclared, type NativeSpec } from './claudePlugin.js';\nimport { writeThirdPartyNotice, type NoticeSource } from '../notices.js';\nimport type { AdapterContext, Check, IntegrationAdapter, IntegrationId, IntegrationReport, PlanResult, PlanStep, StepOutcome } from '../types.js';\nimport { pathExists } from '../../utils/fs.js';\n\nexport interface PluginSkillConfig {\n id: IntegrationId;\n name: string;\n usage: string;\n docsUrl: string;\n native: NativeSpec;\n /** `owner/repo` for the portable `npx skills add` path. */\n skillsRepo: string;\n /** Skill directories whose presence means the portable skills are installed. */\n coreSkills: string[];\n notice: NoticeSource;\n /** Capabilities the native plugin provides that portable skills cannot. */\n nativeOnly: string[];\n /** True only when the plugin's own manifest registers lifecycle hooks (verified from its plugin.json). */\n nativeHooks: boolean;\n /** Extra check for the native plugin (e.g. hooks need node). */\n extraNativeChecks?(ctx: AdapterContext): Promise<{ checks: Check[]; warnings: string[]; degraded: boolean }>;\n /** Shared supplementary directory expected beside skills (agent-skills ships references/). */\n referencesDir?: string;\n}\n\nconst SKILLS_CLI = 'skills';\n\nasync function skillDirs(base: string): Promise<string[]> {\n try {\n return (await fs.readdir(path.join(base, '.claude', 'skills'), { withFileTypes: true })).filter((e) => e.isDirectory()).map((e) => e.name);\n } catch {\n return [];\n }\n}\n\nasync function fileExists(p: string): Promise<boolean> {\n return pathExists(p);\n}\n\nexport function createPluginSkillAdapter(cfg: PluginSkillConfig): IntegrationAdapter {\n const id = pluginId(cfg.native);\n\n async function observe(ctx: AdapterContext, deep: boolean): Promise<{\n claude: Tool | null;\n nativePresent: boolean;\n nativeInstalled: boolean;\n nativeScope: 'project' | 'user' | null;\n nativeError: string | null;\n registered: boolean;\n version: string | null;\n listError: string | null;\n portablePresent: string[];\n portableScope: 'project' | 'user' | null;\n refs: boolean;\n }> {\n const declared = await readDeclared(ctx, cfg.native);\n let claude: Tool | null = null;\n let nativePresent = declared.enabled !== null;\n let nativeInstalled = declared.enabled !== null;\n let nativeScope = declared.enabled;\n let nativeError: string | null = null;\n let registered = declared.marketplace;\n let version: string | null = null;\n let listError: string | null = null;\n if (deep) {\n claude = await findClaudeCli(ctx.runner, ctx.home, ctx.signal);\n if (claude && compareVersions(claude.version, MIN_PLUGIN_JSON) >= 0) {\n const l = await listPlugins(ctx, claude);\n if (l.ok) {\n const p = findPlugin(l.plugins, id, ctx.root);\n nativePresent = !!p;\n nativeInstalled = !!p && p.enabled;\n nativeScope = p ? (p.scope === 'user' ? 'user' : 'project') : null;\n version = p?.version ?? null;\n if (p && (p.errors?.length ?? 0) > 0) nativeError = p.errors!.join('; ').slice(0, 300);\n if (p && !p.enabled) nativeError = 'the plugin is installed but disabled';\n if (!p) {\n const reg = await marketplaceRegistered(ctx, claude, cfg.native.marketplaceName);\n registered = reg ?? registered;\n } else registered = true;\n } else listError = l.error ?? 'could not list plugins';\n }\n }\n const projectSkills = await skillDirs(ctx.root);\n const userSkills = await skillDirs(ctx.home);\n const inProject = cfg.coreSkills.filter((s) => projectSkills.includes(s));\n const inUser = cfg.coreSkills.filter((s) => userSkills.includes(s));\n const portablePresent = inProject.length >= inUser.length ? inProject : inUser;\n const portableScope = portablePresent.length === 0 ? null : inProject.length >= inUser.length ? 'project' : 'user';\n let refs = true;\n if (cfg.referencesDir && portablePresent.length > 0) {\n const base = portableScope === 'user' ? ctx.home : ctx.root;\n refs = (await fileExists(path.join(base, '.claude', 'skills', cfg.referencesDir))) || (await fileExists(path.join(base, '.claude', cfg.referencesDir))) || (await fileExists(path.join(base, cfg.referencesDir)));\n }\n return { claude, nativePresent, nativeInstalled, nativeScope, nativeError, registered, version, listError, portablePresent, portableScope, refs };\n }\n\n return {\n id: cfg.id,\n name: cfg.name,\n required: true,\n usage: cfg.usage,\n docsUrl: cfg.docsUrl,\n\n async inspect(ctx, deep): Promise<IntegrationReport> {\n const o = await observe(ctx, deep);\n const checks: Check[] = [];\n const warnings: string[] = [];\n const nextSteps: string[] = [];\n const caps: Record<string, boolean> = { skills: false, commands: false, hooks: false };\n const base = { id: cfg.id, name: cfg.name, required: true, deep } as const;\n if (deep) checks.push({ name: 'Claude Code CLI', ok: !!o.claude, detail: o.claude ? `v${o.claude.version}` : 'not found (PATH or VS Code extension)' });\n if (o.listError) warnings.push(`Could not read the plugin list: ${o.listError}`);\n\n if (o.nativeInstalled) {\n checks.push({ name: 'native plugin', ok: !o.nativeError, detail: o.nativeError ?? `${id}${o.nativeScope ? ` (${o.nativeScope} scope)` : ''}` });\n caps.skills = true;\n caps.commands = true;\n let degraded = !!o.nativeError;\n if (o.nativeError) {\n warnings.push(`${cfg.name} plugin problem: ${o.nativeError}`);\n nextSteps.push(`claude plugin list (inspect errors), then: claude plugin enable ${id}`);\n }\n const extra = cfg.extraNativeChecks ? await cfg.extraNativeChecks(ctx) : { checks: [], warnings: [], degraded: false };\n checks.push(...extra.checks);\n warnings.push(...extra.warnings);\n caps.hooks = cfg.nativeHooks && !extra.degraded;\n degraded = degraded || extra.degraded;\n if (!deep) warnings.push('Not yet verified against `claude plugin list`; run `devworkspace doctor` or `devworkspace integrations status`.');\n return { ...base, status: degraded ? 'DEGRADED' : deep ? 'VERIFIED' : 'INSTALLED', variant: 'native plugin', scope: o.nativeScope, version: o.version, checks, capabilities: caps, warnings, nextSteps };\n }\n\n if (o.nativePresent && !o.nativeInstalled) {\n checks.push({ name: 'native plugin', ok: false, detail: `${id} is installed but disabled${o.nativeScope ? ` (${o.nativeScope} scope)` : ''}` });\n caps.skills = true;\n caps.commands = true;\n warnings.push(`${cfg.name} plugin is installed but disabled.`);\n nextSteps.push(`claude plugin enable ${id}`);\n return { ...base, status: 'DEGRADED', variant: 'native plugin', scope: o.nativeScope, version: o.version, checks, capabilities: caps, warnings, nextSteps };\n }\n\n if (o.portablePresent.length > 0) {\n const complete = o.portablePresent.length === cfg.coreSkills.length;\n caps.skills = complete;\n checks.push({ name: 'portable skills', ok: complete, detail: `${o.portablePresent.length}/${cfg.coreSkills.length} core skills found (${o.portableScope} scope)` });\n if (cfg.referencesDir) checks.push({ name: 'supplementary references', ok: o.refs, detail: o.refs ? 'found' : `${cfg.referencesDir}/ not installed` });\n if (!complete) {\n const missing = cfg.coreSkills.filter((s) => !o.portablePresent.includes(s));\n warnings.push(`Partial installation: missing skills ${missing.join(', ')}.`);\n nextSteps.push('devworkspace integrations repair --yes');\n }\n if (!o.refs) warnings.push(`The shared ${cfg.referencesDir}/ checklists are not installed (known limitation of the skills CLI), so skills that point to them have broken references.`);\n warnings.push(`Portable skills only: ${cfg.nativeOnly.join(', ')} from the native plugin are not available.`);\n nextSteps.push(`For the full plugin: claude plugin marketplace add ${cfg.native.marketplaceUrl} --scope project, then claude plugin install ${id} --scope project`);\n return { ...base, status: 'DEGRADED', variant: 'portable skills', scope: o.portableScope, version: null, checks, capabilities: caps, warnings, nextSteps };\n }\n\n checks.push({ name: 'marketplace', ok: o.registered, detail: o.registered ? `${cfg.native.marketplaceName} is registered but the plugin is not installed` : 'not registered' });\n if (!o.registered) {\n warnings.push(`Marketplace ${cfg.native.marketplaceName} is not registered.`);\n nextSteps.push(`claude plugin marketplace add ${cfg.native.marketplaceUrl} --scope project`);\n }\n nextSteps.push('devworkspace setup --integrations --yes');\n return { ...base, status: 'NOT_INSTALLED', variant: null, scope: null, version: null, checks, capabilities: caps, warnings, nextSteps };\n },\n\n async plan(ctx, report): Promise<PlanResult> {\n const o = await observe(ctx, true);\n const blockers: string[] = [];\n const notes: string[] = [];\n const protectPaths = ['.claude/settings.json', '.claude/settings.local.json', 'CLAUDE.md', '.claude/CLAUDE.md', 'AGENTS.md'];\n const steps: PlanStep[] = [];\n const scope = ctx.setup.scope;\n\n if (report.status === 'VERIFIED' && !ctx.setup.repair) return { steps, blockers, protectPaths, notes: ['already verified'] };\n if (o.nativeInstalled && !o.nativeError) return { steps, blockers, protectPaths, notes: ['native plugin already installed'] };\n\n // If the plugin list cannot be read we do not know what is installed: installing anything now could duplicate or overwrite it.\n if (o.claude && compareVersions(o.claude.version, MIN_PLUGIN_JSON) >= 0 && o.listError) {\n blockers.push(`Could not read the installed plugin list (${o.listError}), so nothing was installed. Run \"claude plugin list --json\" yourself to see what is installed, then re-run setup.`);\n return { steps, blockers, protectPaths, notes };\n }\n if (o.claude && compareVersions(o.claude.version, MIN_PLUGIN_JSON) >= 0 && !o.listError) {\n // marketplace registered but plugin missing -> only the install step\n steps.push(...nativeSteps(ctx, o.claude, cfg.native, scope, { registered: o.registered }));\n if (o.nativeError && o.nativeScope) {\n notes.push(`The plugin is present but unhealthy (${o.nativeError}); re-running install to repair.`);\n }\n return { steps, blockers, protectPaths, notes };\n }\n if (o.claude) notes.push(`Claude Code ${o.claude.version} is older than ${MIN_PLUGIN_JSON}, which the plugin commands' --json output needs; using portable skills.`);\n else notes.push('The Claude Code CLI was not found on PATH or in the VS Code extension; using portable skills instead of the native plugin.');\n if (o.listError) notes.push(`\\`claude plugin list\\` failed (${o.listError}); using portable skills.`);\n\n // ---- portable skills via the documented Skills CLI ----\n if (o.portablePresent.length === cfg.coreSkills.length && o.refs) return { steps, blockers, protectPaths, notes: [...notes, 'portable skills already installed'] };\n const managed = new Set(ctx.prior?.managedPaths ?? []);\n const baseDir = scope === 'user' ? ctx.home : ctx.root;\n const existing = await skillDirs(baseDir);\n const conflicts = cfg.coreSkills.filter((s) => existing.includes(s) && !managed.has(`.claude/skills/${s}`));\n if (conflicts.length > 0 && o.portablePresent.length < cfg.coreSkills.length) {\n blockers.push(\n `Skill folder(s) ${conflicts.join(', ')} already exist in .claude/skills and were not installed by DevWorkspace, so they are treated as yours and will not be overwritten. Rename or remove them, or install the native plugin instead.`,\n );\n return { steps, blockers, protectPaths, notes };\n }\n const args = ['--yes', SKILLS_CLI, 'add', cfg.skillsRepo, '--agent', 'claude-code', '--skill', '*', '--copy', '-y', '--json', ...(scope === 'user' ? ['-g'] : [])];\n steps.push({\n id: `${cfg.id}:skills-cli`,\n description: `Install ${cfg.name} skills from ${cfg.skillsRepo} with the Skills CLI (${scope} scope, copied files, telemetry disabled)`,\n command: `npx ${args.join(' ')}`,\n level: 'third-party-code',\n async run(): Promise<StepOutcome> {\n const before = new Set(await skillDirs(baseDir));\n const r = await ctx.runner.runNpx(args, { cwd: ctx.root, timeoutMs: 300_000, signal: ctx.signal, env: { DISABLE_TELEMETRY: '1', DO_NOT_TRACK: '1' } });\n if (r.aborted) return { ok: false, detail: 'cancelled' };\n if (r.timedOut) return { ok: false, detail: 'timed out after 300 s (network?)' };\n if (!r.ok) {\n const tail = `${r.stderr}\\n${r.stdout}`.split(/\\r?\\n/).map((l) => l.trim()).filter(Boolean).slice(-3).join(' ');\n return { ok: false, detail: (tail || r.error || `exit ${r.code}`).slice(0, 400) };\n }\n const after = await skillDirs(baseDir);\n const created = after.filter((s) => !before.has(s));\n ctx.report({ id: cfg.id, step: `${cfg.id}:skills-cli`, state: 'info', detail: `${created.length} skill folder(s) added` });\n return { ok: true, detail: `${created.length} skill folder(s) added`, managedPaths: created.map((s) => `.claude/skills/${s}`) };\n },\n });\n steps.push({\n id: `${cfg.id}:notice`,\n description: 'Record third-party license/attribution in .devworkspace/THIRD_PARTY_NOTICES.md',\n level: 'project',\n async run(): Promise<StepOutcome> {\n await writeThirdPartyNotice(ctx.root, cfg.notice);\n return { ok: true };\n },\n });\n return { steps, blockers, protectPaths, notes };\n },\n };\n}\n\n"]}
@@ -1,4 +1,5 @@
1
1
  import { type CliExecutionMode } from '../core/version.js';
2
+ import { observeClaudeCode, verifyMcpServer, type AgentObservation, type McpVerifyResult } from './verify.js';
2
3
  export type McpLauncher = 'auto' | 'direct' | 'npx';
3
4
  export interface McpServerDefOptions {
4
5
  launcher?: McpLauncher;
@@ -6,17 +7,43 @@ export interface McpServerDefOptions {
6
7
  env?: NodeJS.ProcessEnv;
7
8
  provenanceMode?: CliExecutionMode;
8
9
  whichFn?: (name: string, env?: NodeJS.ProcessEnv) => Promise<string | null>;
10
+ /** Defaults to process.platform; Windows clients cannot spawn the npx shim directly. */
11
+ platform?: NodeJS.Platform;
12
+ /** Returns the version printed by the PATH `devworkspace`, or null if unknown. Defaults to running `devworkspace --version`. */
13
+ versionFn?: (env: NodeJS.ProcessEnv) => Promise<string | null>;
14
+ /** Project root, used to reject a PATH entry that is just this project's node_modules/.bin. */
15
+ projectRoot?: string;
16
+ /** Allow configuring user-level MCP configuration (e.g. Antigravity). */
17
+ user?: boolean;
18
+ /** Override user home directory (useful for tests). */
19
+ homeDir?: string;
20
+ /** Already-resolved launcher; skips resolution so multi-agent setup resolves once. */
21
+ resolved?: McpServerDef;
9
22
  }
10
23
  export interface McpServerDef {
11
24
  command: string;
12
25
  args: string[];
13
26
  }
27
+ /** The resolved launcher plus why it was chosen, for diagnostics. */
28
+ export interface McpLauncherInfo extends McpServerDef {
29
+ mode: 'direct' | 'npx';
30
+ reason: string;
31
+ }
14
32
  export interface McpSetupOptions {
15
33
  cwd?: string;
16
34
  agent?: string;
17
35
  check?: boolean;
18
36
  launcher?: McpLauncher;
19
37
  packageVersion?: string;
38
+ /** Allow configuring user-level MCP configuration (e.g. Antigravity ~/.gemini/.../mcp_config.json). */
39
+ user?: boolean;
40
+ /** Override user home directory (useful for testing). */
41
+ homeDir?: string;
42
+ /** Start the configured server and exercise it over stdio after writing. Opt-in for library callers; the CLI enables it. */
43
+ verify?: boolean;
44
+ verifyFn?: typeof verifyMcpServer;
45
+ /** Ask the agent CLI how it sees the server (Claude Code only); used when `verify` is on. */
46
+ observeFn?: typeof observeClaudeCode;
20
47
  }
21
48
  export interface McpPlannedFileChange {
22
49
  path: string;
@@ -31,8 +58,43 @@ export interface McpSetupResult {
31
58
  changes: Omit<McpPlannedFileChange, 'content'>[];
32
59
  conflicts: number;
33
60
  notes: string[];
61
+ /** Agents actually configured (resolves `auto` and `all`). */
62
+ agents: string[];
63
+ launcher?: {
64
+ command: string;
65
+ args: string[];
66
+ mode: 'direct' | 'npx';
67
+ reason: string;
68
+ };
69
+ /** Re-read check of every generated JSON config. */
70
+ validation: {
71
+ path: string;
72
+ ok: boolean;
73
+ detail: string;
74
+ }[];
75
+ /** Live server check; absent in check mode or when skipped. Covers the server only, never the agent connection. */
76
+ verification?: McpVerifyResult;
77
+ /** What DevWorkspace cannot do for the user. */
78
+ userActions: string[];
79
+ /** Set when the server that started reports a different version than the CLI that ran setup (or the pinned one). */
80
+ versionMismatch?: {
81
+ expected: string;
82
+ actual: string;
83
+ };
84
+ /** Agent-side status as reported by the agent's own CLI, when one is installed. */
85
+ agentObservation?: AgentObservation;
86
+ /** Steps for agents whose MCP config is user-level and therefore never written automatically. */
87
+ manual: ReturnType<typeof antigravityManualSteps>[];
88
+ /** Path to backup created when modifying user-level configuration. */
89
+ backup?: string;
90
+ /** The CLI that ran setup: version, path and how it was installed. */
91
+ cli: {
92
+ version: string;
93
+ path: string;
94
+ mode: string;
95
+ };
34
96
  }
35
- export declare const SUPPORTED_MCP_AGENTS: readonly ["claude-code", "claude", "codex", "antigravity", "all"];
97
+ export declare const SUPPORTED_MCP_AGENTS: readonly ["claude-code", "claude", "codex", "antigravity", "all", "auto"];
36
98
  export declare function isSupportedMcpAgent(id: string): boolean;
37
99
  export declare const MCP_SECTION_START = "<!-- devworkspace-mcp:start (managed by DevWorkspace MCP - edit outside this block) -->";
38
100
  export declare const MCP_SECTION_END = "<!-- devworkspace-mcp:end -->";
@@ -67,11 +129,42 @@ export declare function mergeMcpJsonConfig(existingText: string | null, serverNa
67
129
  };
68
130
  /**
69
131
  * Resolves the MCP server command and arguments based on the chosen launcher strategy.
70
- * - 'direct': Uses the globally installed or PATH-accessible `devworkspace` binary.
71
- * - 'npx': Uses `npx -y devworkspace` (or `devworkspace@<version>` if packageVersion is set).
72
- * - 'auto': Detects whether `devworkspace` is on PATH and not invoked from temporary npx-cache.
73
- * If devworkspace is on PATH and not running in npx-cache, uses 'direct'; otherwise falls back to 'npx'.
132
+ * - 'direct': the `devworkspace` binary on PATH.
133
+ * - 'npx': `npx -y devworkspace[@version] mcp serve` (wrapped in `cmd /c` on Windows, where clients cannot spawn npx.cmd).
134
+ * - 'auto': direct only when a PATH binary exists, we are not running from the temporary npx cache, and the PATH binary's
135
+ * version equals the running CLI (an installed-but-different version is not silently trusted); otherwise npx.
74
136
  */
137
+ export declare function resolveMcpLauncher(options?: McpServerDefOptions): Promise<McpLauncherInfo>;
75
138
  export declare function resolveMcpServerDef(options?: McpServerDefOptions): Promise<McpServerDef>;
139
+ /** Agents whose marker files already exist in the project. */
140
+ export declare function detectMcpAgents(root: string): Promise<string[]>;
141
+ export declare const CODEX_BLOCK_START = "# devworkspace-mcp:start (managed by DevWorkspace MCP - edit outside this block)";
142
+ export declare const CODEX_BLOCK_END = "# devworkspace-mcp:end";
143
+ /** The managed Codex TOML block. JSON string syntax is valid TOML for these values; 60s covers a cold `npx` download (Codex defaults to 10s). */
144
+ export declare function buildCodexBlock(def: McpServerDef): string;
145
+ /** Merge the managed block into `.codex/config.toml` without a TOML parser: only text between our markers is ever replaced. */
146
+ export declare function mergeCodexToml(existing: string | null, def: McpServerDef): {
147
+ content: string;
148
+ kind: 'create' | 'update' | 'unchanged' | 'conflict';
149
+ note: string;
150
+ };
151
+ /** Guidance for agents whose MCP config is user-level; DevWorkspace never writes user-level config for you. */
152
+ export declare function antigravityManualSteps(def: McpServerDef): {
153
+ agent: string;
154
+ files: string[];
155
+ snippet: string;
156
+ steps: string[];
157
+ };
158
+ /**
159
+ * Detect the user-level Antigravity MCP configuration path.
160
+ * Checks candidate paths in order:
161
+ * 1. Explicitly configured env path (ANTIGRAVITY_CONFIG_PATH)
162
+ * 2. ~/.gemini/antigravity/mcp_config.json (if file exists)
163
+ * 3. ~/.gemini/config/mcp_config.json (if file exists)
164
+ * 4. ~/.gemini/antigravity/mcp_config.json (if ~/.gemini/antigravity directory exists)
165
+ * 5. ~/.gemini/config/mcp_config.json (if ~/.gemini/config directory exists)
166
+ * 6. Defaults to ~/.gemini/antigravity/mcp_config.json
167
+ */
168
+ export declare function detectAntigravityUserConfigPath(homeDir?: string): Promise<string>;
76
169
  export declare function planMcpAgentChanges(root: string, projectName: string, agentId: string, options?: McpServerDefOptions): Promise<McpPlannedFileChange[]>;
77
170
  export declare function setupMcpAgent(opts?: McpSetupOptions): Promise<McpSetupResult>;