opencastle 0.38.2 → 1.0.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.
- package/README.md +81 -1
- package/bin/cli.mjs +20 -3
- package/dist/cli/adapters/antigravity.d.ts +1 -1
- package/dist/cli/adapters/antigravity.d.ts.map +1 -1
- package/dist/cli/adapters/claude-code.d.ts +1 -1
- package/dist/cli/adapters/claude-code.d.ts.map +1 -1
- package/dist/cli/adapters/codex.d.ts +1 -1
- package/dist/cli/adapters/codex.d.ts.map +1 -1
- package/dist/cli/adapters/cursor.d.ts +1 -1
- package/dist/cli/adapters/cursor.d.ts.map +1 -1
- package/dist/cli/adapters/opencode.d.ts +1 -1
- package/dist/cli/adapters/opencode.d.ts.map +1 -1
- package/dist/cli/adapters/rules-dir-base.d.ts +3 -2
- package/dist/cli/adapters/rules-dir-base.d.ts.map +1 -1
- package/dist/cli/adapters/rules-dir-base.js +13 -25
- package/dist/cli/adapters/rules-dir-base.js.map +1 -1
- package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
- package/dist/cli/adapters/single-file-base.js +30 -43
- package/dist/cli/adapters/single-file-base.js.map +1 -1
- package/dist/cli/adapters/vscode.d.ts +3 -2
- package/dist/cli/adapters/vscode.d.ts.map +1 -1
- package/dist/cli/adapters/vscode.js +19 -71
- package/dist/cli/adapters/vscode.js.map +1 -1
- package/dist/cli/adapters/windsurf.d.ts +1 -1
- package/dist/cli/adapters/windsurf.d.ts.map +1 -1
- package/dist/cli/baseline.d.ts +3 -0
- package/dist/cli/baseline.d.ts.map +1 -0
- package/dist/cli/baseline.js +280 -0
- package/dist/cli/baseline.js.map +1 -0
- package/dist/cli/ci.d.ts +18 -0
- package/dist/cli/ci.d.ts.map +1 -0
- package/dist/cli/ci.js +279 -0
- package/dist/cli/ci.js.map +1 -0
- package/dist/cli/dispatcher.test.js +2 -2
- package/dist/cli/dispatcher.test.js.map +1 -1
- package/dist/cli/docs-accuracy.test.js +5 -0
- package/dist/cli/docs-accuracy.test.js.map +1 -1
- package/dist/cli/doctor.d.ts +3 -3
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +66 -9
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/explain.d.ts +3 -0
- package/dist/cli/explain.d.ts.map +1 -0
- package/dist/cli/explain.js +210 -0
- package/dist/cli/explain.js.map +1 -0
- package/dist/cli/fleet.d.ts +30 -0
- package/dist/cli/fleet.d.ts.map +1 -0
- package/dist/cli/fleet.js +149 -0
- package/dist/cli/fleet.js.map +1 -0
- package/dist/cli/github-report.d.ts +49 -0
- package/dist/cli/github-report.d.ts.map +1 -0
- package/dist/cli/github-report.js +161 -0
- package/dist/cli/github-report.js.map +1 -0
- package/dist/cli/github-report.test.d.ts +2 -0
- package/dist/cli/github-report.test.d.ts.map +1 -0
- package/dist/cli/github-report.test.js +146 -0
- package/dist/cli/github-report.test.js.map +1 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +135 -94
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/init.test.js +26 -25
- package/dist/cli/init.test.js.map +1 -1
- package/dist/cli/layers.d.ts +152 -0
- package/dist/cli/layers.d.ts.map +1 -0
- package/dist/cli/layers.js +932 -0
- package/dist/cli/layers.js.map +1 -0
- package/dist/cli/layers.test.d.ts +2 -0
- package/dist/cli/layers.test.d.ts.map +1 -0
- package/dist/cli/layers.test.js +483 -0
- package/dist/cli/layers.test.js.map +1 -0
- package/dist/cli/lock.d.ts +130 -0
- package/dist/cli/lock.d.ts.map +1 -0
- package/dist/cli/lock.js +320 -0
- package/dist/cli/lock.js.map +1 -0
- package/dist/cli/mcp-audit.d.ts +164 -0
- package/dist/cli/mcp-audit.d.ts.map +1 -0
- package/dist/cli/mcp-audit.js +504 -0
- package/dist/cli/mcp-audit.js.map +1 -0
- package/dist/cli/mcp-audit.test.d.ts +2 -0
- package/dist/cli/mcp-audit.test.d.ts.map +1 -0
- package/dist/cli/mcp-audit.test.js +215 -0
- package/dist/cli/mcp-audit.test.js.map +1 -0
- package/dist/cli/mcp-upgrade.test.d.ts +2 -0
- package/dist/cli/mcp-upgrade.test.d.ts.map +1 -0
- package/dist/cli/mcp-upgrade.test.js +118 -0
- package/dist/cli/mcp-upgrade.test.js.map +1 -0
- package/dist/cli/mcp.d.ts +74 -5
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +340 -32
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/policy.d.ts +58 -0
- package/dist/cli/policy.d.ts.map +1 -0
- package/dist/cli/policy.js +194 -0
- package/dist/cli/policy.js.map +1 -0
- package/dist/cli/publish-workflow.test.js +55 -1
- package/dist/cli/publish-workflow.test.js.map +1 -1
- package/dist/cli/remove.d.ts.map +1 -1
- package/dist/cli/remove.js +3 -2
- package/dist/cli/remove.js.map +1 -1
- package/dist/cli/review.d.ts +25 -0
- package/dist/cli/review.d.ts.map +1 -0
- package/dist/cli/review.js +437 -0
- package/dist/cli/review.js.map +1 -0
- package/dist/cli/status.d.ts +2 -0
- package/dist/cli/status.d.ts.map +1 -1
- package/dist/cli/status.js +25 -4
- package/dist/cli/status.js.map +1 -1
- package/dist/cli/status.test.js +5 -3
- package/dist/cli/status.test.js.map +1 -1
- package/dist/cli/sync-check.d.ts +16 -1
- package/dist/cli/sync-check.d.ts.map +1 -1
- package/dist/cli/sync-check.js +219 -13
- package/dist/cli/sync-check.js.map +1 -1
- package/dist/cli/sync-check.test.js +14 -8
- package/dist/cli/sync-check.test.js.map +1 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +2 -0
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/team-ci.test.d.ts +2 -0
- package/dist/cli/team-ci.test.d.ts.map +1 -0
- package/dist/cli/team-ci.test.js +169 -0
- package/dist/cli/team-ci.test.js.map +1 -0
- package/dist/cli/team-commands.test.d.ts +2 -0
- package/dist/cli/team-commands.test.d.ts.map +1 -0
- package/dist/cli/team-commands.test.js +233 -0
- package/dist/cli/team-commands.test.js.map +1 -0
- package/dist/cli/team-config.d.ts +88 -0
- package/dist/cli/team-config.d.ts.map +1 -0
- package/dist/cli/team-config.js +261 -0
- package/dist/cli/team-config.js.map +1 -0
- package/dist/cli/team-health.d.ts +49 -0
- package/dist/cli/team-health.d.ts.map +1 -0
- package/dist/cli/team-health.js +205 -0
- package/dist/cli/team-health.js.map +1 -0
- package/dist/cli/team-sources.test.d.ts +2 -0
- package/dist/cli/team-sources.test.d.ts.map +1 -0
- package/dist/cli/team-sources.test.js +542 -0
- package/dist/cli/team-sources.test.js.map +1 -0
- package/dist/cli/types.d.ts +16 -2
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/types.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +204 -44
- package/dist/cli/update.js.map +1 -1
- package/dist/cli/version-range.d.ts +24 -0
- package/dist/cli/version-range.d.ts.map +1 -0
- package/dist/cli/version-range.js +157 -0
- package/dist/cli/version-range.js.map +1 -0
- package/dist/cli/website-plugins.test.d.ts +2 -0
- package/dist/cli/website-plugins.test.d.ts.map +1 -0
- package/dist/cli/website-plugins.test.js +34 -0
- package/dist/cli/website-plugins.test.js.map +1 -0
- package/dist/orchestrator/plugins/chrome-devtools/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/chrome-devtools/config.js +11 -1
- package/dist/orchestrator/plugins/chrome-devtools/config.js.map +1 -1
- package/dist/orchestrator/plugins/contentful/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/contentful/config.js +11 -1
- package/dist/orchestrator/plugins/contentful/config.js.map +1 -1
- package/dist/orchestrator/plugins/convex/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/convex/config.js +11 -1
- package/dist/orchestrator/plugins/convex/config.js.map +1 -1
- package/dist/orchestrator/plugins/coolify/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/coolify/config.js +14 -1
- package/dist/orchestrator/plugins/coolify/config.js.map +1 -1
- package/dist/orchestrator/plugins/figma/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/figma/config.js +24 -13
- package/dist/orchestrator/plugins/figma/config.js.map +1 -1
- package/dist/orchestrator/plugins/linear/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/linear/config.js +27 -17
- package/dist/orchestrator/plugins/linear/config.js.map +1 -1
- package/dist/orchestrator/plugins/netlify/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/netlify/config.js +23 -9
- package/dist/orchestrator/plugins/netlify/config.js.map +1 -1
- package/dist/orchestrator/plugins/nextjs/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/nextjs/config.js +11 -1
- package/dist/orchestrator/plugins/nextjs/config.js.map +1 -1
- package/dist/orchestrator/plugins/nx/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/nx/config.js +11 -1
- package/dist/orchestrator/plugins/nx/config.js.map +1 -1
- package/dist/orchestrator/plugins/pins.test.d.ts +2 -0
- package/dist/orchestrator/plugins/pins.test.d.ts.map +1 -0
- package/dist/orchestrator/plugins/pins.test.js +78 -0
- package/dist/orchestrator/plugins/pins.test.js.map +1 -0
- package/dist/orchestrator/plugins/playwright/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/playwright/config.js +11 -1
- package/dist/orchestrator/plugins/playwright/config.js.map +1 -1
- package/dist/orchestrator/plugins/prisma/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/prisma/config.js +17 -2
- package/dist/orchestrator/plugins/prisma/config.js.map +1 -1
- package/dist/orchestrator/plugins/resend/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/resend/config.js +17 -1
- package/dist/orchestrator/plugins/resend/config.js.map +1 -1
- package/dist/orchestrator/plugins/sentry/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/sentry/config.js +13 -1
- package/dist/orchestrator/plugins/sentry/config.js.map +1 -1
- package/dist/orchestrator/plugins/slack/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/slack/config.js +20 -1
- package/dist/orchestrator/plugins/slack/config.js.map +1 -1
- package/dist/orchestrator/plugins/strapi/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/strapi/config.js +11 -1
- package/dist/orchestrator/plugins/strapi/config.js.map +1 -1
- package/dist/orchestrator/plugins/trello/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/trello/config.js +21 -1
- package/dist/orchestrator/plugins/trello/config.js.map +1 -1
- package/dist/orchestrator/plugins/types.d.ts +22 -0
- package/dist/orchestrator/plugins/types.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/cli/adapters/rules-dir-base.ts +23 -44
- package/src/cli/adapters/single-file-base.ts +43 -46
- package/src/cli/adapters/vscode.ts +28 -71
- package/src/cli/baseline.ts +289 -0
- package/src/cli/ci.ts +289 -0
- package/src/cli/dispatcher.test.ts +2 -2
- package/src/cli/docs-accuracy.test.ts +5 -0
- package/src/cli/doctor.ts +92 -6
- package/src/cli/explain.ts +210 -0
- package/src/cli/fleet.ts +176 -0
- package/src/cli/github-report.test.ts +158 -0
- package/src/cli/github-report.ts +179 -0
- package/src/cli/init.test.ts +27 -27
- package/src/cli/init.ts +135 -93
- package/src/cli/layers.test.ts +525 -0
- package/src/cli/layers.ts +1089 -0
- package/src/cli/lock.ts +395 -0
- package/src/cli/mcp-audit.test.ts +259 -0
- package/src/cli/mcp-audit.ts +619 -0
- package/src/cli/mcp-upgrade.test.ts +135 -0
- package/src/cli/mcp.ts +373 -34
- package/src/cli/policy.ts +207 -0
- package/src/cli/publish-workflow.test.ts +60 -1
- package/src/cli/remove.ts +8 -2
- package/src/cli/review.ts +457 -0
- package/src/cli/status.test.ts +5 -3
- package/src/cli/status.ts +29 -4
- package/src/cli/sync-check.test.ts +16 -8
- package/src/cli/sync-check.ts +245 -14
- package/src/cli/sync.ts +2 -0
- package/src/cli/team-ci.test.ts +195 -0
- package/src/cli/team-commands.test.ts +253 -0
- package/src/cli/team-config.ts +289 -0
- package/src/cli/team-health.ts +234 -0
- package/src/cli/team-sources.test.ts +578 -0
- package/src/cli/types.ts +19 -1
- package/src/cli/update.ts +217 -44
- package/src/cli/version-range.ts +150 -0
- package/src/cli/website-plugins.test.ts +41 -0
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
- package/src/orchestrator/plugins/chrome-devtools/config.ts +11 -1
- package/src/orchestrator/plugins/contentful/config.ts +11 -1
- package/src/orchestrator/plugins/convex/config.ts +11 -1
- package/src/orchestrator/plugins/coolify/config.ts +14 -1
- package/src/orchestrator/plugins/figma/SKILL.md +18 -14
- package/src/orchestrator/plugins/figma/config.ts +24 -13
- package/src/orchestrator/plugins/linear/SKILL.md +6 -14
- package/src/orchestrator/plugins/linear/config.ts +27 -17
- package/src/orchestrator/plugins/netlify/config.ts +23 -9
- package/src/orchestrator/plugins/nextjs/config.ts +11 -1
- package/src/orchestrator/plugins/nx/config.ts +11 -1
- package/src/orchestrator/plugins/pins.test.ts +80 -0
- package/src/orchestrator/plugins/playwright/config.ts +11 -1
- package/src/orchestrator/plugins/prisma/config.ts +17 -2
- package/src/orchestrator/plugins/resend/config.ts +17 -1
- package/src/orchestrator/plugins/sentry/config.ts +13 -1
- package/src/orchestrator/plugins/slack/config.ts +20 -1
- package/src/orchestrator/plugins/strapi/config.ts +11 -1
- package/src/orchestrator/plugins/trello/config.ts +21 -1
- package/src/orchestrator/plugins/types.ts +24 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Existing installs get corrected defaults without losing anyone's edits.
|
|
3
|
+
*
|
|
4
|
+
* `sync` leaves a server entry alone once it exists, because people tune them.
|
|
5
|
+
* That is why the broken defaults — packages missing from npm, `@latest`, remote
|
|
6
|
+
* servers in a shape Claude Code cannot load — would otherwise have stayed in
|
|
7
|
+
* every config written before the fix. An entry still exactly as a release wrote
|
|
8
|
+
* it is replaced; anything else is the user's.
|
|
9
|
+
*/
|
|
10
|
+
import { describe, it, expect, beforeEach, afterEach } from 'vitest'
|
|
11
|
+
import { mkdtempSync, writeFileSync, readFileSync, rmSync, realpathSync, mkdirSync } from 'node:fs'
|
|
12
|
+
import { join } from 'node:path'
|
|
13
|
+
import { tmpdir } from 'node:os'
|
|
14
|
+
import { upgradeGeneratedServers, rebuildMcpConfig, scaffoldMcpConfig } from './mcp.js'
|
|
15
|
+
import type { StackConfig } from './types.js'
|
|
16
|
+
|
|
17
|
+
describe('upgradeGeneratedServers', () => {
|
|
18
|
+
it('adds the type Claude Code needs to a remote server we wrote without it', () => {
|
|
19
|
+
const servers: Record<string, unknown> = { Supabase: { url: 'https://mcp.supabase.com/mcp' } }
|
|
20
|
+
const upgraded = upgradeGeneratedServers(servers, 'claude-code', new Set(['Supabase']))
|
|
21
|
+
expect(upgraded).toEqual(['Supabase'])
|
|
22
|
+
expect(servers.Supabase).toEqual({ type: 'http', url: 'https://mcp.supabase.com/mcp' })
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('moves a retired default to the current one, env vars and all', () => {
|
|
26
|
+
// What earlier releases wrote into .mcp.json for Figma: a package that was
|
|
27
|
+
// never published, with the token they asked for spelled into `env`.
|
|
28
|
+
const servers: Record<string, unknown> = {
|
|
29
|
+
Figma: {
|
|
30
|
+
command: 'npx',
|
|
31
|
+
args: ['-y', '@anthropic/figma-mcp@latest'],
|
|
32
|
+
env: { FIGMA_ACCESS_TOKEN: '${FIGMA_ACCESS_TOKEN}' },
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
expect(upgradeGeneratedServers(servers, 'claude-code', new Set(['Figma']))).toEqual(['Figma'])
|
|
36
|
+
expect(servers.Figma).toEqual({ type: 'http', url: 'https://mcp.figma.com/mcp' })
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('pins an @latest we wrote, in the VS Code dialect', () => {
|
|
40
|
+
const servers: Record<string, unknown> = {
|
|
41
|
+
Playwright: { type: 'stdio', command: 'npx', args: ['-y', '@playwright/mcp@latest'] },
|
|
42
|
+
}
|
|
43
|
+
expect(upgradeGeneratedServers(servers, 'vscode', new Set(['Playwright']))).toEqual(['Playwright'])
|
|
44
|
+
expect((servers.Playwright as { args: string[] }).args).toEqual(['-y', '@playwright/mcp@0.0.83'])
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it('leaves an entry the user changed, however slightly', () => {
|
|
48
|
+
const edited = { type: 'stdio', command: 'npx', args: ['-y', '@playwright/mcp@latest', '--headless'] }
|
|
49
|
+
const servers: Record<string, unknown> = { Playwright: edited }
|
|
50
|
+
expect(upgradeGeneratedServers(servers, 'vscode', new Set(['Playwright']))).toEqual([])
|
|
51
|
+
expect(servers.Playwright).toBe(edited)
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it('leaves an entry that is already current', () => {
|
|
55
|
+
const servers: Record<string, unknown> = { Supabase: { type: 'http', url: 'https://mcp.supabase.com/mcp' } }
|
|
56
|
+
expect(upgradeGeneratedServers(servers, 'claude-code', new Set(['Supabase']))).toEqual([])
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it('touches only servers the stack still includes, and never a user’s own', () => {
|
|
60
|
+
const servers: Record<string, unknown> = {
|
|
61
|
+
Supabase: { url: 'https://mcp.supabase.com/mcp' },
|
|
62
|
+
Mine: { url: 'https://example.com/mcp' },
|
|
63
|
+
}
|
|
64
|
+
expect(upgradeGeneratedServers(servers, 'claude-code', new Set())).toEqual([])
|
|
65
|
+
expect(servers.Mine).toEqual({ url: 'https://example.com/mcp' })
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it('is key-order blind, like the JSON it reads', () => {
|
|
69
|
+
const servers: Record<string, unknown> = {
|
|
70
|
+
Playwright: { args: ['-y', '@playwright/mcp@latest'], command: 'npx', type: 'stdio' },
|
|
71
|
+
}
|
|
72
|
+
expect(upgradeGeneratedServers(servers, 'vscode', new Set(['Playwright']))).toEqual(['Playwright'])
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
describe('rebuildMcpConfig on an install from before the fix', () => {
|
|
77
|
+
let root: string
|
|
78
|
+
beforeEach(() => {
|
|
79
|
+
root = realpathSync(mkdtempSync(join(tmpdir(), 'mcp-upgrade-')))
|
|
80
|
+
})
|
|
81
|
+
afterEach(() => {
|
|
82
|
+
rmSync(root, { recursive: true, force: true })
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
const stack: StackConfig = { ides: ['claude-code'], techTools: ['supabase', 'figma'], teamTools: [] }
|
|
86
|
+
|
|
87
|
+
it('rewrites what we wrote, keeps what they wrote, and says which', async () => {
|
|
88
|
+
const before = {
|
|
89
|
+
mcpServers: {
|
|
90
|
+
Supabase: { url: 'https://mcp.supabase.com/mcp' },
|
|
91
|
+
Figma: {
|
|
92
|
+
command: 'npx',
|
|
93
|
+
args: ['-y', '@anthropic/figma-mcp@latest'],
|
|
94
|
+
env: { FIGMA_ACCESS_TOKEN: '${FIGMA_ACCESS_TOKEN}' },
|
|
95
|
+
},
|
|
96
|
+
Mine: { command: 'node', args: ['tools/mcp.js'] },
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
writeFileSync(join(root, '.mcp.json'), JSON.stringify(before, null, 2) + '\n')
|
|
100
|
+
|
|
101
|
+
const { upgraded, removed } = await rebuildMcpConfig(root, 'claude-code', stack)
|
|
102
|
+
expect(upgraded.sort()).toEqual(['Figma', 'Supabase'])
|
|
103
|
+
expect(removed).toEqual([])
|
|
104
|
+
|
|
105
|
+
const after = JSON.parse(readFileSync(join(root, '.mcp.json'), 'utf8'))
|
|
106
|
+
expect(after.mcpServers.Supabase).toEqual({ type: 'http', url: 'https://mcp.supabase.com/mcp' })
|
|
107
|
+
expect(after.mcpServers.Figma).toEqual({ type: 'http', url: 'https://mcp.figma.com/mcp' })
|
|
108
|
+
expect(after.mcpServers.Mine).toEqual({ command: 'node', args: ['tools/mcp.js'] })
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
it('changes nothing on a second run', async () => {
|
|
112
|
+
await scaffoldMcpConfig(root, '.mcp.json', stack, undefined, 'claude-code')
|
|
113
|
+
const first = readFileSync(join(root, '.mcp.json'), 'utf8')
|
|
114
|
+
expect(await rebuildMcpConfig(root, 'claude-code', stack)).toEqual({ upgraded: [], removed: [], teamWritten: [], teamRemoved: [] })
|
|
115
|
+
expect(readFileSync(join(root, '.mcp.json'), 'utf8')).toBe(first)
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
it('names a plugin server it removes because the stack dropped it', async () => {
|
|
119
|
+
writeFileSync(
|
|
120
|
+
join(root, '.mcp.json'),
|
|
121
|
+
JSON.stringify({ mcpServers: { Linear: { type: 'http', url: 'https://mcp.linear.app/mcp' } } }) + '\n',
|
|
122
|
+
)
|
|
123
|
+
const { removed } = await rebuildMcpConfig(root, 'claude-code', stack)
|
|
124
|
+
expect(removed).toEqual(['Linear'])
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it('writes remote servers Claude Code can load on a fresh install', async () => {
|
|
128
|
+
mkdirSync(root, { recursive: true })
|
|
129
|
+
await scaffoldMcpConfig(root, '.mcp.json', stack, undefined, 'claude-code')
|
|
130
|
+
const config = JSON.parse(readFileSync(join(root, '.mcp.json'), 'utf8'))
|
|
131
|
+
for (const entry of Object.values(config.mcpServers) as Array<Record<string, unknown>>) {
|
|
132
|
+
if ('url' in entry) expect(entry.type).toBe('http')
|
|
133
|
+
}
|
|
134
|
+
})
|
|
135
|
+
})
|