opencastle 0.38.2 → 1.1.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.
Files changed (299) hide show
  1. package/README.md +89 -4
  2. package/bin/cli.mjs +20 -3
  3. package/dist/cli/adapters/antigravity.d.ts +1 -1
  4. package/dist/cli/adapters/antigravity.d.ts.map +1 -1
  5. package/dist/cli/adapters/claude-code.d.ts +8 -4
  6. package/dist/cli/adapters/claude-code.d.ts.map +1 -1
  7. package/dist/cli/adapters/claude-code.js +13 -7
  8. package/dist/cli/adapters/claude-code.js.map +1 -1
  9. package/dist/cli/adapters/codex.d.ts +1 -1
  10. package/dist/cli/adapters/codex.d.ts.map +1 -1
  11. package/dist/cli/adapters/cursor.d.ts +1 -1
  12. package/dist/cli/adapters/cursor.d.ts.map +1 -1
  13. package/dist/cli/adapters/opencode.d.ts +1 -1
  14. package/dist/cli/adapters/opencode.d.ts.map +1 -1
  15. package/dist/cli/adapters/rules-dir-base.d.ts +3 -2
  16. package/dist/cli/adapters/rules-dir-base.d.ts.map +1 -1
  17. package/dist/cli/adapters/rules-dir-base.js +13 -25
  18. package/dist/cli/adapters/rules-dir-base.js.map +1 -1
  19. package/dist/cli/adapters/single-file-base.d.ts +8 -1
  20. package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
  21. package/dist/cli/adapters/single-file-base.js +43 -46
  22. package/dist/cli/adapters/single-file-base.js.map +1 -1
  23. package/dist/cli/adapters/vscode.d.ts +14 -3
  24. package/dist/cli/adapters/vscode.d.ts.map +1 -1
  25. package/dist/cli/adapters/vscode.js +63 -75
  26. package/dist/cli/adapters/vscode.js.map +1 -1
  27. package/dist/cli/adapters/windsurf.d.ts +1 -1
  28. package/dist/cli/adapters/windsurf.d.ts.map +1 -1
  29. package/dist/cli/baseline.d.ts +3 -0
  30. package/dist/cli/baseline.d.ts.map +1 -0
  31. package/dist/cli/baseline.js +280 -0
  32. package/dist/cli/baseline.js.map +1 -0
  33. package/dist/cli/ci.d.ts +18 -0
  34. package/dist/cli/ci.d.ts.map +1 -0
  35. package/dist/cli/ci.js +279 -0
  36. package/dist/cli/ci.js.map +1 -0
  37. package/dist/cli/command-namespace.d.ts +91 -0
  38. package/dist/cli/command-namespace.d.ts.map +1 -0
  39. package/dist/cli/command-namespace.js +218 -0
  40. package/dist/cli/command-namespace.js.map +1 -0
  41. package/dist/cli/command-namespace.test.d.ts +2 -0
  42. package/dist/cli/command-namespace.test.d.ts.map +1 -0
  43. package/dist/cli/command-namespace.test.js +356 -0
  44. package/dist/cli/command-namespace.test.js.map +1 -0
  45. package/dist/cli/copy.d.ts +1 -1
  46. package/dist/cli/copy.d.ts.map +1 -1
  47. package/dist/cli/copy.js +3 -2
  48. package/dist/cli/copy.js.map +1 -1
  49. package/dist/cli/dispatcher.test.js +2 -2
  50. package/dist/cli/dispatcher.test.js.map +1 -1
  51. package/dist/cli/docs-accuracy.test.js +5 -0
  52. package/dist/cli/docs-accuracy.test.js.map +1 -1
  53. package/dist/cli/doctor.d.ts +3 -3
  54. package/dist/cli/doctor.d.ts.map +1 -1
  55. package/dist/cli/doctor.js +66 -9
  56. package/dist/cli/doctor.js.map +1 -1
  57. package/dist/cli/doctor.test.js +2 -2
  58. package/dist/cli/doctor.test.js.map +1 -1
  59. package/dist/cli/explain.d.ts +3 -0
  60. package/dist/cli/explain.d.ts.map +1 -0
  61. package/dist/cli/explain.js +222 -0
  62. package/dist/cli/explain.js.map +1 -0
  63. package/dist/cli/fleet.d.ts +30 -0
  64. package/dist/cli/fleet.d.ts.map +1 -0
  65. package/dist/cli/fleet.js +149 -0
  66. package/dist/cli/fleet.js.map +1 -0
  67. package/dist/cli/github-report.d.ts +49 -0
  68. package/dist/cli/github-report.d.ts.map +1 -0
  69. package/dist/cli/github-report.js +161 -0
  70. package/dist/cli/github-report.js.map +1 -0
  71. package/dist/cli/github-report.test.d.ts +2 -0
  72. package/dist/cli/github-report.test.d.ts.map +1 -0
  73. package/dist/cli/github-report.test.js +146 -0
  74. package/dist/cli/github-report.test.js.map +1 -0
  75. package/dist/cli/init.d.ts.map +1 -1
  76. package/dist/cli/init.js +171 -96
  77. package/dist/cli/init.js.map +1 -1
  78. package/dist/cli/init.test.js +35 -29
  79. package/dist/cli/init.test.js.map +1 -1
  80. package/dist/cli/layers.d.ts +152 -0
  81. package/dist/cli/layers.d.ts.map +1 -0
  82. package/dist/cli/layers.js +932 -0
  83. package/dist/cli/layers.js.map +1 -0
  84. package/dist/cli/layers.test.d.ts +2 -0
  85. package/dist/cli/layers.test.d.ts.map +1 -0
  86. package/dist/cli/layers.test.js +483 -0
  87. package/dist/cli/layers.test.js.map +1 -0
  88. package/dist/cli/lock.d.ts +130 -0
  89. package/dist/cli/lock.d.ts.map +1 -0
  90. package/dist/cli/lock.js +320 -0
  91. package/dist/cli/lock.js.map +1 -0
  92. package/dist/cli/managed-paths.d.ts +18 -1
  93. package/dist/cli/managed-paths.d.ts.map +1 -1
  94. package/dist/cli/managed-paths.js +72 -2
  95. package/dist/cli/managed-paths.js.map +1 -1
  96. package/dist/cli/manifest.d.ts.map +1 -1
  97. package/dist/cli/manifest.js +2 -0
  98. package/dist/cli/manifest.js.map +1 -1
  99. package/dist/cli/mcp-audit.d.ts +164 -0
  100. package/dist/cli/mcp-audit.d.ts.map +1 -0
  101. package/dist/cli/mcp-audit.js +504 -0
  102. package/dist/cli/mcp-audit.js.map +1 -0
  103. package/dist/cli/mcp-audit.test.d.ts +2 -0
  104. package/dist/cli/mcp-audit.test.d.ts.map +1 -0
  105. package/dist/cli/mcp-audit.test.js +215 -0
  106. package/dist/cli/mcp-audit.test.js.map +1 -0
  107. package/dist/cli/mcp-upgrade.test.d.ts +2 -0
  108. package/dist/cli/mcp-upgrade.test.d.ts.map +1 -0
  109. package/dist/cli/mcp-upgrade.test.js +118 -0
  110. package/dist/cli/mcp-upgrade.test.js.map +1 -0
  111. package/dist/cli/mcp.d.ts +74 -5
  112. package/dist/cli/mcp.d.ts.map +1 -1
  113. package/dist/cli/mcp.js +340 -32
  114. package/dist/cli/mcp.js.map +1 -1
  115. package/dist/cli/policy.d.ts +58 -0
  116. package/dist/cli/policy.d.ts.map +1 -0
  117. package/dist/cli/policy.js +194 -0
  118. package/dist/cli/policy.js.map +1 -0
  119. package/dist/cli/publish-workflow.test.js +55 -1
  120. package/dist/cli/publish-workflow.test.js.map +1 -1
  121. package/dist/cli/remove.d.ts.map +1 -1
  122. package/dist/cli/remove.js +25 -6
  123. package/dist/cli/remove.js.map +1 -1
  124. package/dist/cli/review.d.ts +25 -0
  125. package/dist/cli/review.d.ts.map +1 -0
  126. package/dist/cli/review.js +437 -0
  127. package/dist/cli/review.js.map +1 -0
  128. package/dist/cli/status.d.ts +2 -0
  129. package/dist/cli/status.d.ts.map +1 -1
  130. package/dist/cli/status.js +25 -4
  131. package/dist/cli/status.js.map +1 -1
  132. package/dist/cli/status.test.js +5 -3
  133. package/dist/cli/status.test.js.map +1 -1
  134. package/dist/cli/sync-check.d.ts +16 -1
  135. package/dist/cli/sync-check.d.ts.map +1 -1
  136. package/dist/cli/sync-check.js +241 -17
  137. package/dist/cli/sync-check.js.map +1 -1
  138. package/dist/cli/sync-check.test.js +14 -8
  139. package/dist/cli/sync-check.test.js.map +1 -1
  140. package/dist/cli/sync.d.ts.map +1 -1
  141. package/dist/cli/sync.js +2 -0
  142. package/dist/cli/sync.js.map +1 -1
  143. package/dist/cli/team-ci.test.d.ts +2 -0
  144. package/dist/cli/team-ci.test.d.ts.map +1 -0
  145. package/dist/cli/team-ci.test.js +169 -0
  146. package/dist/cli/team-ci.test.js.map +1 -0
  147. package/dist/cli/team-commands.test.d.ts +2 -0
  148. package/dist/cli/team-commands.test.d.ts.map +1 -0
  149. package/dist/cli/team-commands.test.js +233 -0
  150. package/dist/cli/team-commands.test.js.map +1 -0
  151. package/dist/cli/team-config.d.ts +88 -0
  152. package/dist/cli/team-config.d.ts.map +1 -0
  153. package/dist/cli/team-config.js +261 -0
  154. package/dist/cli/team-config.js.map +1 -0
  155. package/dist/cli/team-health.d.ts +49 -0
  156. package/dist/cli/team-health.d.ts.map +1 -0
  157. package/dist/cli/team-health.js +205 -0
  158. package/dist/cli/team-health.js.map +1 -0
  159. package/dist/cli/team-sources.test.d.ts +2 -0
  160. package/dist/cli/team-sources.test.d.ts.map +1 -0
  161. package/dist/cli/team-sources.test.js +542 -0
  162. package/dist/cli/team-sources.test.js.map +1 -0
  163. package/dist/cli/types.d.ts +48 -2
  164. package/dist/cli/types.d.ts.map +1 -1
  165. package/dist/cli/types.js.map +1 -1
  166. package/dist/cli/update.d.ts.map +1 -1
  167. package/dist/cli/update.js +218 -44
  168. package/dist/cli/update.js.map +1 -1
  169. package/dist/cli/version-range.d.ts +24 -0
  170. package/dist/cli/version-range.d.ts.map +1 -0
  171. package/dist/cli/version-range.js +157 -0
  172. package/dist/cli/version-range.js.map +1 -0
  173. package/dist/cli/website-plugins.test.d.ts +2 -0
  174. package/dist/cli/website-plugins.test.d.ts.map +1 -0
  175. package/dist/cli/website-plugins.test.js +34 -0
  176. package/dist/cli/website-plugins.test.js.map +1 -0
  177. package/dist/orchestrator/plugins/chrome-devtools/config.d.ts.map +1 -1
  178. package/dist/orchestrator/plugins/chrome-devtools/config.js +11 -1
  179. package/dist/orchestrator/plugins/chrome-devtools/config.js.map +1 -1
  180. package/dist/orchestrator/plugins/contentful/config.d.ts.map +1 -1
  181. package/dist/orchestrator/plugins/contentful/config.js +11 -1
  182. package/dist/orchestrator/plugins/contentful/config.js.map +1 -1
  183. package/dist/orchestrator/plugins/convex/config.d.ts.map +1 -1
  184. package/dist/orchestrator/plugins/convex/config.js +11 -1
  185. package/dist/orchestrator/plugins/convex/config.js.map +1 -1
  186. package/dist/orchestrator/plugins/coolify/config.d.ts.map +1 -1
  187. package/dist/orchestrator/plugins/coolify/config.js +14 -1
  188. package/dist/orchestrator/plugins/coolify/config.js.map +1 -1
  189. package/dist/orchestrator/plugins/figma/config.d.ts.map +1 -1
  190. package/dist/orchestrator/plugins/figma/config.js +24 -13
  191. package/dist/orchestrator/plugins/figma/config.js.map +1 -1
  192. package/dist/orchestrator/plugins/linear/config.d.ts.map +1 -1
  193. package/dist/orchestrator/plugins/linear/config.js +27 -17
  194. package/dist/orchestrator/plugins/linear/config.js.map +1 -1
  195. package/dist/orchestrator/plugins/netlify/config.d.ts.map +1 -1
  196. package/dist/orchestrator/plugins/netlify/config.js +23 -9
  197. package/dist/orchestrator/plugins/netlify/config.js.map +1 -1
  198. package/dist/orchestrator/plugins/nextjs/config.d.ts.map +1 -1
  199. package/dist/orchestrator/plugins/nextjs/config.js +11 -1
  200. package/dist/orchestrator/plugins/nextjs/config.js.map +1 -1
  201. package/dist/orchestrator/plugins/nx/config.d.ts.map +1 -1
  202. package/dist/orchestrator/plugins/nx/config.js +11 -1
  203. package/dist/orchestrator/plugins/nx/config.js.map +1 -1
  204. package/dist/orchestrator/plugins/pins.test.d.ts +2 -0
  205. package/dist/orchestrator/plugins/pins.test.d.ts.map +1 -0
  206. package/dist/orchestrator/plugins/pins.test.js +78 -0
  207. package/dist/orchestrator/plugins/pins.test.js.map +1 -0
  208. package/dist/orchestrator/plugins/playwright/config.d.ts.map +1 -1
  209. package/dist/orchestrator/plugins/playwright/config.js +11 -1
  210. package/dist/orchestrator/plugins/playwright/config.js.map +1 -1
  211. package/dist/orchestrator/plugins/prisma/config.d.ts.map +1 -1
  212. package/dist/orchestrator/plugins/prisma/config.js +17 -2
  213. package/dist/orchestrator/plugins/prisma/config.js.map +1 -1
  214. package/dist/orchestrator/plugins/resend/config.d.ts.map +1 -1
  215. package/dist/orchestrator/plugins/resend/config.js +17 -1
  216. package/dist/orchestrator/plugins/resend/config.js.map +1 -1
  217. package/dist/orchestrator/plugins/sentry/config.d.ts.map +1 -1
  218. package/dist/orchestrator/plugins/sentry/config.js +13 -1
  219. package/dist/orchestrator/plugins/sentry/config.js.map +1 -1
  220. package/dist/orchestrator/plugins/slack/config.d.ts.map +1 -1
  221. package/dist/orchestrator/plugins/slack/config.js +20 -1
  222. package/dist/orchestrator/plugins/slack/config.js.map +1 -1
  223. package/dist/orchestrator/plugins/strapi/config.d.ts.map +1 -1
  224. package/dist/orchestrator/plugins/strapi/config.js +11 -1
  225. package/dist/orchestrator/plugins/strapi/config.js.map +1 -1
  226. package/dist/orchestrator/plugins/trello/config.d.ts.map +1 -1
  227. package/dist/orchestrator/plugins/trello/config.js +21 -1
  228. package/dist/orchestrator/plugins/trello/config.js.map +1 -1
  229. package/dist/orchestrator/plugins/types.d.ts +22 -0
  230. package/dist/orchestrator/plugins/types.d.ts.map +1 -1
  231. package/package.json +4 -2
  232. package/src/cli/adapters/claude-code.ts +13 -7
  233. package/src/cli/adapters/rules-dir-base.ts +23 -44
  234. package/src/cli/adapters/single-file-base.ts +65 -50
  235. package/src/cli/adapters/vscode.ts +75 -77
  236. package/src/cli/baseline.ts +289 -0
  237. package/src/cli/ci.ts +289 -0
  238. package/src/cli/command-namespace.test.ts +417 -0
  239. package/src/cli/command-namespace.ts +222 -0
  240. package/src/cli/copy.ts +6 -2
  241. package/src/cli/dispatcher.test.ts +2 -2
  242. package/src/cli/docs-accuracy.test.ts +5 -0
  243. package/src/cli/doctor.test.ts +2 -2
  244. package/src/cli/doctor.ts +92 -6
  245. package/src/cli/explain.ts +222 -0
  246. package/src/cli/fleet.ts +176 -0
  247. package/src/cli/github-report.test.ts +158 -0
  248. package/src/cli/github-report.ts +179 -0
  249. package/src/cli/init.test.ts +36 -31
  250. package/src/cli/init.ts +174 -96
  251. package/src/cli/layers.test.ts +525 -0
  252. package/src/cli/layers.ts +1089 -0
  253. package/src/cli/lock.ts +395 -0
  254. package/src/cli/managed-paths.ts +73 -3
  255. package/src/cli/manifest.ts +2 -0
  256. package/src/cli/mcp-audit.test.ts +259 -0
  257. package/src/cli/mcp-audit.ts +619 -0
  258. package/src/cli/mcp-upgrade.test.ts +135 -0
  259. package/src/cli/mcp.ts +373 -34
  260. package/src/cli/policy.ts +207 -0
  261. package/src/cli/publish-workflow.test.ts +60 -1
  262. package/src/cli/remove.ts +28 -6
  263. package/src/cli/review.ts +457 -0
  264. package/src/cli/status.test.ts +5 -3
  265. package/src/cli/status.ts +29 -4
  266. package/src/cli/sync-check.test.ts +16 -8
  267. package/src/cli/sync-check.ts +264 -17
  268. package/src/cli/sync.ts +2 -0
  269. package/src/cli/team-ci.test.ts +195 -0
  270. package/src/cli/team-commands.test.ts +253 -0
  271. package/src/cli/team-config.ts +289 -0
  272. package/src/cli/team-health.ts +234 -0
  273. package/src/cli/team-sources.test.ts +578 -0
  274. package/src/cli/types.ts +51 -1
  275. package/src/cli/update.ts +229 -44
  276. package/src/cli/version-range.ts +150 -0
  277. package/src/cli/website-plugins.test.ts +41 -0
  278. package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
  279. package/src/orchestrator/plugins/chrome-devtools/config.ts +11 -1
  280. package/src/orchestrator/plugins/contentful/config.ts +11 -1
  281. package/src/orchestrator/plugins/convex/config.ts +11 -1
  282. package/src/orchestrator/plugins/coolify/config.ts +14 -1
  283. package/src/orchestrator/plugins/figma/SKILL.md +18 -14
  284. package/src/orchestrator/plugins/figma/config.ts +24 -13
  285. package/src/orchestrator/plugins/linear/SKILL.md +6 -14
  286. package/src/orchestrator/plugins/linear/config.ts +27 -17
  287. package/src/orchestrator/plugins/netlify/config.ts +23 -9
  288. package/src/orchestrator/plugins/nextjs/config.ts +11 -1
  289. package/src/orchestrator/plugins/nx/config.ts +11 -1
  290. package/src/orchestrator/plugins/pins.test.ts +80 -0
  291. package/src/orchestrator/plugins/playwright/config.ts +11 -1
  292. package/src/orchestrator/plugins/prisma/config.ts +17 -2
  293. package/src/orchestrator/plugins/resend/config.ts +17 -1
  294. package/src/orchestrator/plugins/sentry/config.ts +13 -1
  295. package/src/orchestrator/plugins/slack/config.ts +20 -1
  296. package/src/orchestrator/plugins/strapi/config.ts +11 -1
  297. package/src/orchestrator/plugins/trello/config.ts +21 -1
  298. package/src/orchestrator/plugins/types.ts +24 -0
  299. package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +4 -4
@@ -0,0 +1,619 @@
1
+ import { resolve } from 'node:path'
2
+ import { existsSync, readFileSync } from 'node:fs'
3
+ import { PLUGINS } from '../orchestrator/plugins/index.js'
4
+ import { getMcpConfigRelPath, upgradeGeneratedServers, canonicalJson } from './mcp.js'
5
+ import type { IdeChoice } from './types.js'
6
+ import { disallowedBy, hostDisallowedBy, findInlineSecret, hostOfUrl, type EffectivePolicy } from './policy.js'
7
+ import { EDITOR_VARIABLES } from './team-config.js'
8
+
9
+ /**
10
+ * What a project's MCP config actually launches, read the way a supply-chain
11
+ * review would read it.
12
+ *
13
+ * An MCP server is code an agent runs with the developer's credentials, and the
14
+ * usual way to launch one — `npx -y some-server@latest` — installs whatever was
15
+ * published most recently, on every machine, with no review and no lockfile.
16
+ * `-y` is not even what makes it unattended: npx assumes yes whenever stdin is
17
+ * not a terminal, which is how every assistant starts a server. OWASP lists
18
+ * this as agentic supply-chain risk (ASI04). A team wants the opposite: the same
19
+ * server version on every laptop and in CI, changed in a reviewed diff.
20
+ *
21
+ * Three things are reported, from least to most serious:
22
+ * - a package run without an exact version (`@latest`, a range, or none);
23
+ * - a package that does not exist on npm — the server cannot start, and a name
24
+ * that was unpublished can be registered by anyone;
25
+ * - a remote server in `.mcp.json` with no `"type"`, which Claude Code reads as
26
+ * a stdio server with no command, so it never loads.
27
+ *
28
+ * What it cannot read it says so. An all-clear that counted a container image
29
+ * or an unparsed command line as "pinned" would be the false assurance this
30
+ * exists to replace.
31
+ */
32
+
33
+ export type McpProblem =
34
+ | 'unpinned'
35
+ | 'nonexistent'
36
+ | 'untyped-remote'
37
+ | 'inline-secret'
38
+ | 'not-allowed'
39
+ | 'host-not-allowed'
40
+ | 'unexpanded-variable'
41
+
42
+ /** What `opencastle sync` will do to an entry. */
43
+ export type SyncEffect = 'replaces' | 'removes' | 'keeps'
44
+
45
+ export interface McpFinding {
46
+ server: string
47
+ problem: McpProblem
48
+ /** The package spec or URL the finding is about, as written. */
49
+ subject: string
50
+ /** The package name, for findings about a package. */
51
+ pkg?: string
52
+ /**
53
+ * `replaces`: still exactly as a release wrote it, so sync moves it forward.
54
+ * `removes`: a plugin's server the project's stack no longer includes.
55
+ * `keeps`: edited since, or never ours — only a person changes it.
56
+ * A remedy that says "run sync" is only true for the first.
57
+ */
58
+ sync: SyncEffect
59
+ /** The plugin that owns this server key, if one does. */
60
+ plugin?: string
61
+ /** The team layer that defines this server, if one does — its config file. */
62
+ team?: string
63
+ /** For `removes`: whose decision the removal is. */
64
+ removal?: 'stack' | 'policy' | 'retired'
65
+ /** For policy findings: the layers whose policy refuses it. */
66
+ refusedBy?: string
67
+ }
68
+
69
+ /**
70
+ * The team's side of the audit: what its layers define, what they retired,
71
+ * and the policy every entry is held to — hand-added ones included.
72
+ */
73
+ export interface TeamAuditContext {
74
+ /** Server entries exactly as `sync` writes them into this target. */
75
+ expected: Record<string, unknown>
76
+ /** Server key → the config file that defines it. */
77
+ definedIn: Record<string, string>
78
+ /** Servers a previous sync wrote for the team that no layer defines now. */
79
+ retired: string[]
80
+ /** Integration servers the policy refuses, with why. */
81
+ blocked: Map<string, string>
82
+ policy: EffectivePolicy
83
+ }
84
+
85
+ export interface McpAudit {
86
+ findings: McpFinding[]
87
+ /** Servers `sync` would move to the current default, problem or not. */
88
+ outdated: string[]
89
+ /** Plugin servers the stack no longer includes, which `sync` deletes. */
90
+ removed: string[]
91
+ /** Integration servers the team's policy refuses, which `sync` deletes. */
92
+ blockedByPolicy: string[]
93
+ /** Team servers no layer defines any more, which `sync` deletes. */
94
+ retired: string[]
95
+ /** Servers whose launch was read and passed. */
96
+ passed: number
97
+ /** Servers that launch something this audit cannot read, with why. */
98
+ unaudited: Array<{ server: string; why: string }>
99
+ }
100
+
101
+ /**
102
+ * Packages earlier releases of this tool wrote into configs that do not exist
103
+ * on npm. Kept here, by name, because an install from before the fix still has
104
+ * them until its next `sync` — and a hand-copied config has them for good.
105
+ */
106
+ export const NONEXISTENT_PACKAGES: Record<string, string> = {
107
+ 'netlify-mcp': 'unpublished from npm in January 2026, so the name can be claimed by anyone',
108
+ '@anthropic/figma-mcp': 'never published on npm',
109
+ '@anthropic/prisma-mcp': 'never published on npm',
110
+ }
111
+
112
+ /** Runners that fetch a package from a registry and execute it. */
113
+ const RUNNERS: Record<string, string[]> = {
114
+ npx: [],
115
+ npm: ['exec'],
116
+ bunx: [],
117
+ pnpm: ['dlx'],
118
+ yarn: ['dlx'],
119
+ uvx: [],
120
+ pipx: ['run'],
121
+ }
122
+
123
+ /** Runners from the Python ecosystem, whose specs pin with `==`. */
124
+ const PYTHON_RUNNERS = new Set(['uvx', 'pipx'])
125
+
126
+ /** Container runtimes: they fetch code too, and this audit does not read images. */
127
+ const CONTAINER_RUNTIMES = new Set(['docker', 'podman'])
128
+
129
+ /** Flags that take no value, so the next token may be the package. */
130
+ const VALUELESS_FLAGS = new Set(['-y', '--yes', '--no', '--no-install', '-q', '--quiet', '--silent', '--ignore-existing'])
131
+
132
+ /** Flags followed by a value that is not the package. */
133
+ const VALUE_FLAGS: Record<string, Set<string>> = {
134
+ default: new Set(['--registry', '--cache', '--userconfig', '--prefix', '--node-options', '--workspace', '-w']),
135
+ uvx: new Set(['--python', '-p', '--with', '--index', '--index-url', '--extra-index-url', '--python-preference']),
136
+ }
137
+
138
+ const EXACT_VERSION = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/
139
+
140
+ export interface PackageLaunch {
141
+ /** The spec as written, e.g. `@playwright/mcp@0.0.83`. */
142
+ spec: string
143
+ name: string
144
+ /** The version part, or null when there is none. */
145
+ version: string | null
146
+ /**
147
+ * `npx --no` refuses to download anything, so it runs the copy the project
148
+ * already depends on — pinned by the project's own lockfile.
149
+ */
150
+ localOnly: boolean
151
+ }
152
+
153
+ function binName(command: string): string {
154
+ // Split on both separators: a config written on Windows says `C:\tools\npx.cmd`,
155
+ // and `basename` only knows the separator of the machine running the check.
156
+ return (command.split(/[\\/]/).pop() ?? '').replace(/\.(cmd|exe)$/i, '').toLowerCase()
157
+ }
158
+
159
+ /**
160
+ * The command line with any `cmd /c` wrapper removed.
161
+ *
162
+ * Claude Code's documented form for an npx server on Windows is
163
+ * `"command": "cmd", "args": ["/c", "npx", ...]`. Reading `cmd` as the command
164
+ * meant the package behind it was never audited at all.
165
+ */
166
+ export function unwrapShell(command: string, args: string[]): { command: string; args: string[] } {
167
+ if (binName(command) === 'cmd' && args.length >= 2 && /^\/c$/i.test(args[0])) {
168
+ return { command: args[1], args: args.slice(2) }
169
+ }
170
+ return { command, args }
171
+ }
172
+
173
+ /**
174
+ * The registry package a command line fetches and runs.
175
+ *
176
+ * `null` when it runs none (a local script), or when the line uses an option
177
+ * this parser does not know — see `auditMcpConfig` for how that is reported.
178
+ */
179
+ export function packageLaunch(rawCommand: string, rawArgs: string[]): PackageLaunch | null {
180
+ const { command, args } = unwrapShell(rawCommand, rawArgs)
181
+ const bin = binName(command)
182
+ const lead = RUNNERS[bin]
183
+ if (!lead) return null
184
+ if (lead.some((word, i) => args[i] !== word)) return null
185
+ const rest = args.slice(lead.length)
186
+ const python = PYTHON_RUNNERS.has(bin)
187
+ const valueFlags = python ? VALUE_FLAGS.uvx : VALUE_FLAGS.default
188
+
189
+ // Only flags *before* the package are the runner's. Everything after it is
190
+ // passed to the server, so `npx -y foo@latest --no` is not project-local.
191
+ let localOnly = false
192
+ let spec: string | undefined
193
+ for (let i = 0; i < rest.length; i++) {
194
+ const arg = rest[i]
195
+ if (python && (arg === '--from' || arg === '--spec')) {
196
+ spec = rest[i + 1]
197
+ break
198
+ }
199
+ if (!python && (arg === '-p' || arg === '--package')) {
200
+ spec = rest[i + 1]
201
+ break
202
+ }
203
+ if (arg.startsWith('--package=') || arg.startsWith('--from=') || arg.startsWith('--spec=')) {
204
+ spec = arg.slice(arg.indexOf('=') + 1)
205
+ break
206
+ }
207
+ if (arg === '--') {
208
+ spec = rest[i + 1]
209
+ break
210
+ }
211
+ // `-c` runs a shell string, not a package; nothing here to name.
212
+ if (arg === '-c' || arg === '--call') return null
213
+ if (arg.startsWith('-')) {
214
+ if (VALUELESS_FLAGS.has(arg)) {
215
+ if (arg === '--no' || arg === '--no-install') localOnly = true
216
+ continue
217
+ }
218
+ if (valueFlags.has(arg)) {
219
+ i++
220
+ continue
221
+ }
222
+ if (arg.includes('=')) continue
223
+ // An option we do not know may take a value; stop rather than guess.
224
+ return null
225
+ }
226
+ spec = arg
227
+ break
228
+ }
229
+ if (!spec) return null
230
+ // A path, a URL or a git spec is not a registry package, and pinning advice
231
+ // about it would be wrong.
232
+ if (/^(\.|\/|~|file:|git\+|git:|https?:|github:)/.test(spec)) return null
233
+
234
+ let name = spec
235
+ let version: string | null = null
236
+ const eq = spec.indexOf('==')
237
+ if (python && eq > 0) {
238
+ name = spec.slice(0, eq)
239
+ version = spec.slice(eq + 2)
240
+ } else {
241
+ const at = spec.startsWith('@') ? spec.indexOf('@', 1) : spec.indexOf('@')
242
+ if (at > 0) {
243
+ name = spec.slice(0, at)
244
+ version = spec.slice(at + 1)
245
+ }
246
+ }
247
+ return { spec, name, version, localOnly: (bin === 'npx' || bin === 'npm') && localOnly }
248
+ }
249
+
250
+ /** True when the launch always runs the same code. */
251
+ export function isPinned(launch: PackageLaunch): boolean {
252
+ return launch.localOnly || (launch.version !== null && EXACT_VERSION.test(launch.version))
253
+ }
254
+
255
+ /** Every server entry in a parsed MCP config, whatever the target's dialect. */
256
+ function serverEntries(config: unknown): Array<[string, Record<string, unknown>]> {
257
+ if (!config || typeof config !== 'object') return []
258
+ const out: Array<[string, Record<string, unknown>]> = []
259
+ for (const key of ['servers', 'mcpServers', 'mcp']) {
260
+ const container = (config as Record<string, unknown>)[key]
261
+ if (!container || typeof container !== 'object' || Array.isArray(container)) continue
262
+ for (const [name, entry] of Object.entries(container as Record<string, unknown>)) {
263
+ if (entry && typeof entry === 'object' && !Array.isArray(entry)) {
264
+ out.push([name, entry as Record<string, unknown>])
265
+ }
266
+ }
267
+ }
268
+ return out
269
+ }
270
+
271
+ /** The command line an entry launches: `command` + `args`, or OpenCode's array. */
272
+ function commandLine(entry: Record<string, unknown>): { command: string; args: string[] } | null {
273
+ const { command, args } = entry
274
+ if (Array.isArray(command) && command.length > 0 && command.every((p) => typeof p === 'string')) {
275
+ return { command: command[0] as string, args: (command as string[]).slice(1) }
276
+ }
277
+ if (typeof command === 'string') {
278
+ const list = Array.isArray(args) ? args.filter((a): a is string => typeof a === 'string') : []
279
+ return { command, args: list }
280
+ }
281
+ return null
282
+ }
283
+
284
+ /**
285
+ * Read one parsed config. `ide` decides which dialect rules apply; `included`
286
+ * is the set of plugin servers the project's stack includes — the same set a
287
+ * rebuild uses, so what this predicts about `sync` is what `sync` does. Without
288
+ * it, every plugin server present is treated as included.
289
+ *
290
+ * `team` adds what the project's layers decide: the servers they define (which
291
+ * `sync` keeps exactly as defined), the ones they retired, and the policy every
292
+ * entry is held to, including entries nobody generated.
293
+ */
294
+ export function auditMcpConfig(
295
+ config: unknown,
296
+ ide: IdeChoice,
297
+ included?: Set<string>,
298
+ team?: TeamAuditContext,
299
+ ): McpAudit {
300
+ const pluginByKey = new Map(
301
+ Object.values(PLUGINS)
302
+ .filter((p) => p.mcpServerKey)
303
+ .map((p) => [p.mcpServerKey as string, p.id]),
304
+ )
305
+ const audit: McpAudit = {
306
+ findings: [],
307
+ outdated: [],
308
+ removed: [],
309
+ blockedByPolicy: [],
310
+ retired: [],
311
+ passed: 0,
312
+ unaudited: [],
313
+ }
314
+ const present = new Set<string>()
315
+ for (const [server, entry] of serverEntries(config)) {
316
+ present.add(server)
317
+ const plugin = pluginByKey.get(server)
318
+ const teamWhere = team?.definedIn[server]
319
+ let sync: SyncEffect = 'keeps'
320
+ let removal: McpFinding['removal']
321
+ if (teamWhere && team) {
322
+ // A team server is compiled output: `sync` writes it exactly as the layer
323
+ // defines it, so any difference is one `sync` removes.
324
+ if (canonicalJson(entry) !== canonicalJson(team.expected[server])) sync = 'replaces'
325
+ } else if (team?.blocked.has(server)) {
326
+ // Refused by the policy or excluded by a layer — whoever wrote the entry,
327
+ // `sync` takes it out, so that is what the audit must say.
328
+ sync = 'removes'
329
+ removal = 'policy'
330
+ } else if (team?.retired.includes(server)) {
331
+ sync = 'removes'
332
+ removal = 'retired'
333
+ } else if (plugin) {
334
+ if (included && !included.has(server)) {
335
+ sync = 'removes'
336
+ removal = 'stack'
337
+ } else if (upgradeGeneratedServers({ [server]: structuredClone(entry) }, ide, new Set([server])).length > 0) {
338
+ sync = 'replaces'
339
+ }
340
+ }
341
+ if (sync === 'replaces') audit.outdated.push(server)
342
+ if (removal === 'stack') audit.removed.push(server)
343
+ if (removal === 'policy') audit.blockedByPolicy.push(server)
344
+ if (removal === 'retired') audit.retired.push(server)
345
+ const base = {
346
+ server,
347
+ sync,
348
+ ...(plugin ? { plugin } : {}),
349
+ ...(teamWhere ? { team: teamWhere } : {}),
350
+ ...(removal ? { removal } : {}),
351
+ }
352
+
353
+ // Policy, for every entry: a server the team does not allow is a finding
354
+ // wherever it came from — the hand-added ones are the reason to have one.
355
+ let refused = false
356
+ if (team) {
357
+ const by = disallowedBy(team.policy, server)
358
+ if (by) {
359
+ audit.findings.push({ ...base, problem: 'not-allowed', subject: server, refusedBy: by })
360
+ refused = true
361
+ }
362
+ const url = typeof entry.url === 'string' ? entry.url : typeof entry.serverUrl === 'string' ? entry.serverUrl : null
363
+ if (url && !refused) {
364
+ const hostBy = hostDisallowedBy(team.policy, url)
365
+ if (hostBy) {
366
+ // The host, never the URL: its query string may hold a credential.
367
+ audit.findings.push({ ...base, problem: 'host-not-allowed', subject: hostOfUrl(url), refusedBy: hostBy })
368
+ refused = true
369
+ }
370
+ }
371
+ }
372
+ // `${NAME}` where the assistant expands only its own spelling reaches the
373
+ // server as those characters, in place of the value. Entries sync writes
374
+ // are already right; this is for ones someone edited or added.
375
+ if (sync === 'keeps') {
376
+ const wrong = unexpandedVariable(entry, ide)
377
+ if (wrong) audit.findings.push({ ...base, problem: 'unexpanded-variable', subject: wrong })
378
+ }
379
+ // A credential in a committed file is a leak however the server launches.
380
+ const secretAt = findInlineSecret(entry)
381
+ if (secretAt) {
382
+ audit.findings.push({ ...base, problem: 'inline-secret', subject: secretAt })
383
+ refused = true
384
+ }
385
+
386
+ const line = commandLine(entry)
387
+ if (line) {
388
+ const { command, args } = unwrapShell(line.command, line.args)
389
+ const bin = binName(command)
390
+ if (CONTAINER_RUNTIMES.has(bin)) {
391
+ // A digest names exactly one image. A tag — `:latest` or `:1.2` — can be
392
+ // moved, and reading where the image sits among docker's own options is
393
+ // beyond this check, so anything else is reported, not passed.
394
+ if (args.some((a) => /@sha256:[0-9a-f]{64}$/.test(a))) {
395
+ if (!refused) audit.passed++
396
+ } else audit.unaudited.push({ server, why: 'container image without a digest' })
397
+ continue
398
+ }
399
+ const launch = packageLaunch(command, args)
400
+ if (!launch) {
401
+ // A runner we could not read is not a pass. A plain command — `node
402
+ // tools/mcp.js` — fetches nothing, and is the project's own code.
403
+ if (RUNNERS[bin]) audit.unaudited.push({ server, why: `${bin} options this check does not read` })
404
+ else if (!refused) audit.passed++
405
+ continue
406
+ }
407
+ if (NONEXISTENT_PACKAGES[launch.name]) {
408
+ audit.findings.push({ ...base, problem: 'nonexistent', subject: launch.spec, pkg: launch.name })
409
+ } else if (!isPinned(launch)) {
410
+ audit.findings.push({ ...base, problem: 'unpinned', subject: launch.spec, pkg: launch.name })
411
+ } else if (!refused) {
412
+ audit.passed++
413
+ }
414
+ continue
415
+ }
416
+ if (ide === 'claude-code' && typeof entry.url === 'string' && entry.type === undefined) {
417
+ audit.findings.push({ ...base, problem: 'untyped-remote', subject: entry.url })
418
+ continue
419
+ }
420
+ if (!refused) audit.passed++
421
+ }
422
+ // A team server missing from the file is one `sync` adds.
423
+ for (const server of Object.keys(team?.expected ?? {})) {
424
+ if (!present.has(server)) audit.outdated.push(server)
425
+ }
426
+ return audit
427
+ }
428
+
429
+ /** Whether a finding fails the check, given the policy in force. */
430
+ export function isFailure(f: McpFinding, policy?: EffectivePolicy): boolean {
431
+ if (f.problem === 'unexpanded-variable') return false
432
+ return f.problem !== 'unpinned' || Boolean(policy?.requirePinned)
433
+ }
434
+
435
+ /** How each target that does not expand `${NAME}` spells it instead. */
436
+ const OWN_SPELLING: Partial<Record<IdeChoice, (name: string) => string>> = {
437
+ cursor: (n) => `\${env:${n}}`,
438
+ windsurf: (n) => `\${env:${n}}`,
439
+ opencode: (n) => `{env:${n}}`,
440
+ }
441
+
442
+ /** The first `${NAME}` this target would pass through literally, as `NAME → spelling`, or null. */
443
+ function unexpandedVariable(entry: Record<string, unknown>, ide: IdeChoice): string | null {
444
+ const spell = OWN_SPELLING[ide]
445
+ if (!spell) return null
446
+ const values: unknown[] = []
447
+ for (const field of ['env', 'environment', 'headers']) {
448
+ const block = entry[field]
449
+ if (block && typeof block === 'object' && !Array.isArray(block)) values.push(...Object.values(block as Record<string, unknown>))
450
+ }
451
+ // A shell expands `${NAME}` in its own script, so a `sh -c` line is fine as is.
452
+ const command = Array.isArray(entry.command) ? entry.command[0] : entry.command
453
+ const shell = typeof command === 'string' && /(^|[\\/])(sh|bash|zsh|dash|fish)(\.exe)?$/.test(command)
454
+ if (!shell) {
455
+ if (Array.isArray(entry.args)) values.push(...entry.args)
456
+ if (Array.isArray(entry.command)) values.push(...entry.command)
457
+ }
458
+ values.push(entry.url, entry.serverUrl)
459
+ for (const v of values) {
460
+ if (typeof v !== 'string') continue
461
+ // Environment variables are conventionally upper case; `${name}` in a
462
+ // server's own template is more likely its business than a variable.
463
+ for (const m of v.matchAll(/\$\{([A-Z_][A-Z0-9_]*)\}/g)) {
464
+ if (!EDITOR_VARIABLES.has(m[1])) return `\${${m[1]}} → ${spell(m[1])}`
465
+ }
466
+ }
467
+ return null
468
+ }
469
+
470
+ /** One finding in words, saying so when it fails only because the team requires pinning. */
471
+ export function describeFindingUnder(f: McpFinding, policy?: EffectivePolicy): string {
472
+ if (f.problem === 'unpinned' && policy?.requirePinned) {
473
+ return `${f.server}: ${f.subject} is not pinned to an exact version, which ${policy.requirePinned} requires`
474
+ }
475
+ return describeFinding(f)
476
+ }
477
+
478
+ /** One finding in words. */
479
+ export function describeFinding(f: McpFinding): string {
480
+ switch (f.problem) {
481
+ case 'nonexistent':
482
+ return `${f.server}: ${f.subject} was ${NONEXISTENT_PACKAGES[f.pkg ?? ''] ?? 'not found on npm'}`
483
+ case 'untyped-remote':
484
+ return `${f.server}: no "type" — Claude Code reads it as a stdio server, so it never loads`
485
+ case 'unpinned':
486
+ return `${f.server}: ${f.subject}`
487
+ case 'inline-secret':
488
+ return `${f.server}: a credential is written into ${f.subject} — it is committed with the file`
489
+ case 'not-allowed':
490
+ return `${f.server}: not on the MCP allowlist of ${f.refusedBy}`
491
+ case 'host-not-allowed':
492
+ return `${f.server}: ${f.subject} is not an allowed host for ${f.refusedBy}`
493
+ case 'unexpanded-variable':
494
+ return `${f.server}: this assistant does not expand ${f.subject.split(' → ')[0]}; it reaches the server as literal text (write ${f.subject.split(' → ')[1]})`
495
+ }
496
+ }
497
+
498
+ /**
499
+ * The remedy that works for each finding, joined.
500
+ *
501
+ * Only `sync` can clear what it wrote, and only while nobody has edited it.
502
+ * Saying "run sync" over an entry someone changed would send them to a command
503
+ * that, correctly, will not touch it; and over a server the stack no longer
504
+ * includes it would not fix the entry but delete it.
505
+ */
506
+ export function remedyFor(list: McpFinding[], rel: string): string {
507
+ const names = (pick: (f: McpFinding) => boolean) =>
508
+ [...new Set(list.filter(pick).map((f) => f.server))].join(', ')
509
+ const parts: string[] = []
510
+ const replaced = names((f) => f.sync === 'replaces' && !f.team)
511
+ const rewritten = names((f) => f.sync === 'replaces' && Boolean(f.team))
512
+ const removed = list.filter((f) => f.sync === 'removes' && (f.removal ?? 'stack') === 'stack')
513
+ const blocked = names((f) => f.sync === 'removes' && f.removal === 'policy')
514
+ const retired = names((f) => f.sync === 'removes' && f.removal === 'retired')
515
+ const edited = names((f) => f.sync === 'keeps' && Boolean(f.plugin) && !f.team)
516
+ const teamSource = list.filter((f) => f.sync === 'keeps' && Boolean(f.team))
517
+ const own = names((f) => f.sync === 'keeps' && !f.plugin && !f.team)
518
+ if (replaced) parts.push(`opencastle sync fixes ${replaced} (still as OpenCastle wrote them)`)
519
+ if (rewritten) parts.push(`opencastle sync rewrites ${rewritten} as the team config defines them`)
520
+ if (removed.length > 0) {
521
+ const servers = [...new Set(removed.map((f) => f.server))].join(', ')
522
+ const packs = [...new Set(removed.map((f) => f.plugin))].join(' ')
523
+ parts.push(`opencastle sync removes ${servers}, which this project's stack does not include — opencastle add ${packs} keeps it`)
524
+ }
525
+ if (blocked) parts.push(`opencastle sync removes ${blocked}, which the team's config excludes or its MCP policy does not allow`)
526
+ if (retired) parts.push(`opencastle sync removes ${retired}, which no team layer defines any more`)
527
+ for (const where of new Set(teamSource.map((f) => f.team as string))) {
528
+ parts.push(`fix ${names((f) => f.team === where && f.sync === 'keeps')} in ${where}, where it is defined`)
529
+ }
530
+ if (edited) {
531
+ parts.push(
532
+ `${edited} changed since OpenCastle wrote them — fix by hand, or delete the entry and run opencastle sync --force for the current default`,
533
+ )
534
+ }
535
+ if (own) parts.push(`fix ${own} by hand in ${rel}`)
536
+ // A credential in a committed file needs more than an edit: it has to leave
537
+ // the file, and if the file was ever pushed, the credential is spent.
538
+ const leaked = names((f) => f.problem === 'inline-secret')
539
+ if (leaked) {
540
+ parts.push(
541
+ `move the credential in ${leaked} into .env or your shell and reference it as \${NAME}; rotate it if the file was ever committed`,
542
+ )
543
+ }
544
+ return parts.join('; ')
545
+ }
546
+
547
+ export interface McpAuditResult {
548
+ ok: boolean
549
+ label: string
550
+ detail?: string
551
+ warning?: boolean
552
+ fix?: string
553
+ }
554
+
555
+ const LABEL = 'MCP servers load and run pinned code'
556
+
557
+ /**
558
+ * The check `doctor` and `status` run for one target's MCP config.
559
+ *
560
+ * A config that is absent or will not parse is not reported here: the MCP
561
+ * configuration check beside this one already owns both of those answers, and
562
+ * saying it twice would print two remedies for one fault.
563
+ */
564
+ export function checkMcpSupplyChain(
565
+ projectRoot: string,
566
+ ide: IdeChoice,
567
+ included?: Set<string>,
568
+ team?: TeamAuditContext,
569
+ ): McpAuditResult {
570
+ const rel = getMcpConfigRelPath(ide)
571
+ const abs = resolve(projectRoot, rel)
572
+ if (!existsSync(abs)) return { ok: true, label: LABEL, detail: 'no MCP config' }
573
+ let parsed: unknown
574
+ try {
575
+ parsed = JSON.parse(readFileSync(abs, 'utf8'))
576
+ } catch {
577
+ return { ok: true, label: LABEL, detail: `${rel} could not be read (reported above)` }
578
+ }
579
+
580
+ const audit = auditMcpConfig(parsed, ide, included, team)
581
+ const broken = audit.findings.filter((f) => isFailure(f, team?.policy))
582
+ const warned = audit.findings.filter((f) => !isFailure(f, team?.policy))
583
+ const unpinned = warned.filter((f) => f.problem === 'unpinned')
584
+ const spelled = warned.filter((f) => f.problem === 'unexpanded-variable')
585
+ const unaudited = audit.unaudited.length
586
+ ? `not audited — ${audit.unaudited.map((u) => `${u.server} (${u.why})`).join(', ')}`
587
+ : ''
588
+ const warnings = [
589
+ unpinned.length > 0 ? `not pinned to an exact version — ${unpinned.map(describeFinding).join(', ')}` : '',
590
+ spelled.length > 0 ? spelled.map(describeFinding).join('; ') : '',
591
+ unaudited,
592
+ ].filter(Boolean)
593
+
594
+ if (broken.length > 0) {
595
+ // The rest in the same line: a failure used to hide them, so fixing it was
596
+ // followed by a second, surprise round of warnings.
597
+ return {
598
+ ok: false,
599
+ label: LABEL,
600
+ detail: [broken.map((f) => describeFindingUnder(f, team?.policy)).join('; '), ...warnings].join('; also '),
601
+ fix: remedyFor([...broken, ...unpinned], rel),
602
+ }
603
+ }
604
+ if (warnings.length > 0) {
605
+ const fixes = [
606
+ unpinned.length > 0
607
+ ? `${remedyFor(unpinned, rel)} (pin as name@x.y.z; each machine otherwise runs whatever was published last)`
608
+ : '',
609
+ spelled.length > 0 ? `use each assistant's own variable spelling in ${rel}, as shown` : '',
610
+ unaudited ? `check by hand what ${audit.unaudited.map((u) => u.server).join(', ')} launch` : '',
611
+ ].filter(Boolean)
612
+ return { ok: true, warning: true, label: LABEL, detail: warnings.join('; '), fix: fixes.join('; ') }
613
+ }
614
+ return {
615
+ ok: true,
616
+ label: LABEL,
617
+ detail: audit.passed === 0 ? 'no servers configured' : `${audit.passed} server(s): pinned, project-local, remote, or the project's own code`,
618
+ }
619
+ }