opencastle 0.5.1 → 0.7.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 +5 -4
- package/dist/cli/adapters/claude-code.d.ts +2 -2
- package/dist/cli/adapters/claude-code.d.ts.map +1 -1
- package/dist/cli/adapters/claude-code.js +31 -4
- package/dist/cli/adapters/claude-code.js.map +1 -1
- package/dist/cli/adapters/cursor.d.ts +2 -2
- package/dist/cli/adapters/cursor.d.ts.map +1 -1
- package/dist/cli/adapters/cursor.js +28 -4
- package/dist/cli/adapters/cursor.js.map +1 -1
- package/dist/cli/adapters/opencode.d.ts +20 -0
- package/dist/cli/adapters/opencode.d.ts.map +1 -0
- package/dist/cli/adapters/opencode.js +265 -0
- package/dist/cli/adapters/opencode.js.map +1 -0
- package/dist/cli/adapters/vscode.d.ts +2 -2
- package/dist/cli/adapters/vscode.d.ts.map +1 -1
- package/dist/cli/adapters/vscode.js +38 -7
- package/dist/cli/adapters/vscode.js.map +1 -1
- package/dist/cli/copy.d.ts +12 -0
- package/dist/cli/copy.d.ts.map +1 -1
- package/dist/cli/copy.js +27 -0
- package/dist/cli/copy.js.map +1 -1
- package/dist/cli/detect.d.ts +18 -0
- package/dist/cli/detect.d.ts.map +1 -0
- package/dist/cli/detect.js +434 -0
- package/dist/cli/detect.js.map +1 -0
- package/dist/cli/gitignore.d.ts.map +1 -1
- package/dist/cli/gitignore.js +0 -2
- package/dist/cli/gitignore.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +154 -91
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/manifest.d.ts +1 -1
- package/dist/cli/manifest.d.ts.map +1 -1
- package/dist/cli/manifest.js +2 -1
- package/dist/cli/manifest.js.map +1 -1
- package/dist/cli/mcp.d.ts +6 -6
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +105 -34
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/prompt.d.ts +22 -0
- package/dist/cli/prompt.d.ts.map +1 -1
- package/dist/cli/prompt.js +239 -0
- package/dist/cli/prompt.js.map +1 -1
- package/dist/cli/stack-config.d.ts +26 -3
- package/dist/cli/stack-config.d.ts.map +1 -1
- package/dist/cli/stack-config.js +140 -125
- package/dist/cli/stack-config.js.map +1 -1
- package/dist/cli/types.d.ts +46 -10
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/types.js +26 -1
- package/dist/cli/types.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +66 -19
- package/dist/cli/update.js.map +1 -1
- package/dist/orchestrator/plugins/chrome-devtools/config.d.ts +3 -0
- package/dist/orchestrator/plugins/chrome-devtools/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/chrome-devtools/config.js +28 -0
- package/dist/orchestrator/plugins/chrome-devtools/config.js.map +1 -0
- package/dist/orchestrator/plugins/contentful/config.d.ts +3 -0
- package/dist/orchestrator/plugins/contentful/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/contentful/config.js +48 -0
- package/dist/orchestrator/plugins/contentful/config.js.map +1 -0
- package/dist/orchestrator/plugins/convex/config.d.ts +3 -0
- package/dist/orchestrator/plugins/convex/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/convex/config.js +32 -0
- package/dist/orchestrator/plugins/convex/config.js.map +1 -0
- package/dist/orchestrator/plugins/index.d.ts +28 -0
- package/dist/orchestrator/plugins/index.d.ts.map +1 -0
- package/dist/orchestrator/plugins/index.js +63 -0
- package/dist/orchestrator/plugins/index.js.map +1 -0
- package/dist/orchestrator/plugins/jira/config.d.ts +3 -0
- package/dist/orchestrator/plugins/jira/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/jira/config.js +29 -0
- package/dist/orchestrator/plugins/jira/config.js.map +1 -0
- package/dist/orchestrator/plugins/linear/config.d.ts +3 -0
- package/dist/orchestrator/plugins/linear/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/linear/config.js +33 -0
- package/dist/orchestrator/plugins/linear/config.js.map +1 -0
- package/dist/orchestrator/plugins/nx/config.d.ts +3 -0
- package/dist/orchestrator/plugins/nx/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/nx/config.js +28 -0
- package/dist/orchestrator/plugins/nx/config.js.map +1 -0
- package/dist/orchestrator/plugins/sanity/config.d.ts +3 -0
- package/dist/orchestrator/plugins/sanity/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/sanity/config.js +43 -0
- package/dist/orchestrator/plugins/sanity/config.js.map +1 -0
- package/dist/orchestrator/plugins/slack/config.d.ts +3 -0
- package/dist/orchestrator/plugins/slack/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/slack/config.js +34 -0
- package/dist/orchestrator/plugins/slack/config.js.map +1 -0
- package/dist/orchestrator/plugins/strapi/config.d.ts +3 -0
- package/dist/orchestrator/plugins/strapi/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/strapi/config.js +40 -0
- package/dist/orchestrator/plugins/strapi/config.js.map +1 -0
- package/dist/orchestrator/plugins/supabase/config.d.ts +3 -0
- package/dist/orchestrator/plugins/supabase/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/supabase/config.js +33 -0
- package/dist/orchestrator/plugins/supabase/config.js.map +1 -0
- package/dist/orchestrator/plugins/teams/config.d.ts +3 -0
- package/dist/orchestrator/plugins/teams/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/teams/config.js +43 -0
- package/dist/orchestrator/plugins/teams/config.js.map +1 -0
- package/dist/orchestrator/plugins/types.d.ts +61 -0
- package/dist/orchestrator/plugins/types.d.ts.map +1 -0
- package/dist/orchestrator/plugins/types.js +2 -0
- package/dist/orchestrator/plugins/types.js.map +1 -0
- package/dist/orchestrator/plugins/vercel/config.d.ts +3 -0
- package/dist/orchestrator/plugins/vercel/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/vercel/config.js +32 -0
- package/dist/orchestrator/plugins/vercel/config.js.map +1 -0
- package/package.json +1 -1
- package/src/cli/adapters/claude-code.ts +40 -6
- package/src/cli/adapters/cursor.ts +46 -6
- package/src/cli/adapters/opencode.ts +320 -0
- package/src/cli/adapters/vscode.ts +43 -9
- package/src/cli/copy.ts +32 -0
- package/src/cli/detect.ts +483 -0
- package/src/cli/gitignore.ts +0 -3
- package/src/cli/init.ts +169 -96
- package/src/cli/manifest.ts +2 -1
- package/src/cli/mcp.ts +131 -51
- package/src/cli/prompt.ts +299 -0
- package/src/cli/stack-config.ts +187 -145
- package/src/cli/types.ts +60 -9
- package/src/cli/update.ts +78 -20
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
- package/src/orchestrator/agent-workflows/README.md +1 -1
- package/src/orchestrator/agent-workflows/bug-fix.md +12 -12
- package/src/orchestrator/agent-workflows/data-pipeline.md +21 -20
- package/src/orchestrator/agent-workflows/database-migration.md +11 -11
- package/src/orchestrator/agent-workflows/feature-implementation.md +10 -10
- package/src/orchestrator/agent-workflows/performance-optimization.md +6 -6
- package/src/orchestrator/agent-workflows/refactoring.md +10 -10
- package/src/orchestrator/agent-workflows/schema-changes.md +8 -8
- package/src/orchestrator/agent-workflows/security-audit.md +12 -12
- package/src/orchestrator/agent-workflows/shared-delivery-phase.md +5 -5
- package/src/orchestrator/agents/api-designer.agent.md +2 -2
- package/src/orchestrator/agents/architect.agent.md +2 -2
- package/src/orchestrator/agents/content-engineer.agent.md +4 -4
- package/src/orchestrator/agents/copywriter.agent.md +2 -2
- package/src/orchestrator/agents/data-expert.agent.md +6 -6
- package/src/orchestrator/agents/database-engineer.agent.md +4 -4
- package/src/orchestrator/agents/developer.agent.md +5 -5
- package/src/orchestrator/agents/devops-expert.agent.md +5 -5
- package/src/orchestrator/agents/documentation-writer.agent.md +1 -1
- package/src/orchestrator/agents/performance-expert.agent.md +3 -3
- package/src/orchestrator/agents/release-manager.agent.md +4 -4
- package/src/orchestrator/agents/researcher.agent.md +19 -3
- package/src/orchestrator/agents/reviewer.agent.md +2 -4
- package/src/orchestrator/agents/security-expert.agent.md +4 -4
- package/src/orchestrator/agents/seo-specialist.agent.md +2 -2
- package/src/orchestrator/agents/team-lead.agent.md +97 -101
- package/src/orchestrator/agents/testing-expert.agent.md +5 -5
- package/src/orchestrator/agents/ui-ux-expert.agent.md +7 -7
- package/src/orchestrator/copilot-instructions.md +1 -1
- package/src/orchestrator/customizations/AGENT-FAILURES.md +1 -1
- package/src/orchestrator/customizations/AGENT-PERFORMANCE.md +12 -12
- package/src/orchestrator/customizations/DISPUTES.md +5 -5
- package/src/orchestrator/customizations/KNOWN-ISSUES.md +30 -0
- package/src/orchestrator/customizations/LESSONS-LEARNED.md +7 -7
- package/src/orchestrator/customizations/README.md +5 -2
- package/src/orchestrator/customizations/agents/agent-registry.md +1 -1
- package/src/orchestrator/customizations/agents/skill-matrix.md +12 -7
- package/src/orchestrator/customizations/logs/README.md +1 -1
- package/src/orchestrator/customizations/project/decisions.md +31 -0
- package/src/orchestrator/customizations/project/docs-structure.md +16 -5
- package/src/orchestrator/customizations/project/roadmap.md +24 -0
- package/src/orchestrator/customizations/project/tracker-config.md +1 -1
- package/src/orchestrator/customizations/stack/cms-config.md +1 -1
- package/src/orchestrator/customizations/stack/notifications-config.md +1 -1
- package/src/orchestrator/instructions/ai-optimization.instructions.md +2 -2
- package/src/orchestrator/instructions/general.instructions.md +102 -40
- package/src/orchestrator/{skills/browser-testing → plugins/chrome-devtools}/SKILL.md +1 -1
- package/src/orchestrator/plugins/chrome-devtools/config.ts +29 -0
- package/src/orchestrator/{skills/contentful-cms → plugins/contentful}/SKILL.md +1 -1
- package/src/orchestrator/plugins/contentful/config.ts +49 -0
- package/src/orchestrator/{skills/convex-database → plugins/convex}/SKILL.md +1 -1
- package/src/orchestrator/plugins/convex/config.ts +33 -0
- package/src/orchestrator/plugins/index.ts +85 -0
- package/src/orchestrator/{skills/jira-management → plugins/jira}/SKILL.md +3 -3
- package/src/orchestrator/plugins/jira/config.ts +30 -0
- package/src/orchestrator/{skills/task-management → plugins/linear}/SKILL.md +3 -3
- package/src/orchestrator/plugins/linear/config.ts +34 -0
- package/src/orchestrator/{skills/nx-workspace → plugins/nx}/SKILL.md +1 -1
- package/src/orchestrator/plugins/nx/config.ts +29 -0
- package/src/orchestrator/{skills/sanity-cms → plugins/sanity}/SKILL.md +1 -1
- package/src/orchestrator/plugins/sanity/config.ts +44 -0
- package/src/orchestrator/{skills/slack-notifications → plugins/slack}/SKILL.md +2 -2
- package/src/orchestrator/plugins/slack/config.ts +35 -0
- package/src/orchestrator/{skills/strapi-cms → plugins/strapi}/SKILL.md +1 -1
- package/src/orchestrator/plugins/strapi/config.ts +41 -0
- package/src/orchestrator/{skills/supabase-database → plugins/supabase}/SKILL.md +1 -1
- package/src/orchestrator/plugins/supabase/config.ts +34 -0
- package/src/orchestrator/{skills/teams-notifications → plugins/teams}/SKILL.md +2 -2
- package/src/orchestrator/plugins/teams/config.ts +44 -0
- package/src/orchestrator/plugins/types.ts +79 -0
- package/src/orchestrator/plugins/vercel/config.ts +33 -0
- package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +59 -12
- package/src/orchestrator/prompts/brainstorm.prompt.md +3 -3
- package/src/orchestrator/prompts/bug-fix.prompt.md +18 -18
- package/src/orchestrator/prompts/create-skill.prompt.md +50 -32
- package/src/orchestrator/prompts/generate-task-spec.prompt.md +3 -3
- package/src/orchestrator/prompts/implement-feature.prompt.md +26 -26
- package/src/orchestrator/prompts/metrics-report.prompt.md +11 -11
- package/src/orchestrator/prompts/quick-refinement.prompt.md +16 -16
- package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +2 -2
- package/src/orchestrator/skills/accessibility-standards/SKILL.md +1 -1
- package/src/orchestrator/skills/agent-hooks/SKILL.md +27 -18
- package/src/orchestrator/skills/agent-memory/SKILL.md +7 -7
- package/src/orchestrator/skills/api-patterns/SKILL.md +6 -6
- package/src/orchestrator/skills/code-commenting/SKILL.md +1 -1
- package/src/orchestrator/skills/context-map/SKILL.md +4 -4
- package/src/orchestrator/skills/data-engineering/SKILL.md +7 -4
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +2 -2
- package/src/orchestrator/skills/documentation-standards/SKILL.md +1 -1
- package/src/orchestrator/skills/fast-review/SKILL.md +3 -3
- package/src/orchestrator/skills/frontend-design/SKILL.md +1 -1
- package/src/orchestrator/skills/memory-merger/SKILL.md +8 -8
- package/src/orchestrator/skills/nextjs-patterns/SKILL.md +1 -1
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +2 -2
- package/src/orchestrator/skills/panel-majority-vote/panel-report.template.md +1 -1
- package/src/orchestrator/skills/performance-optimization/SKILL.md +1 -1
- package/src/orchestrator/skills/react-development/SKILL.md +3 -3
- package/src/orchestrator/skills/security-hardening/SKILL.md +27 -27
- package/src/orchestrator/skills/self-improvement/SKILL.md +14 -13
- package/src/orchestrator/skills/seo-patterns/SKILL.md +1 -1
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +19 -19
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +9 -9
- package/src/orchestrator/skills/testing-workflow/SKILL.md +13 -13
- package/src/orchestrator/skills/validation-gates/SKILL.md +8 -15
- package/src/orchestrator/mcp.json +0 -61
package/dist/cli/init.js
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
import { readFile, unlink } from 'node:fs/promises';
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
|
-
import {
|
|
4
|
+
import { multiselect, confirm, closePrompts, c } from './prompt.js';
|
|
5
5
|
import { readManifest, writeManifest, createManifest } from './manifest.js';
|
|
6
6
|
import { removeDirIfExists } from './copy.js';
|
|
7
7
|
import { updateGitignore } from './gitignore.js';
|
|
8
8
|
import { getRequiredMcpEnvVars } from './stack-config.js';
|
|
9
|
+
import { TECH_PLUGINS, TEAM_PLUGINS } from '../orchestrator/plugins/index.js';
|
|
10
|
+
import { detectRepoInfo, mergeStackIntoRepoInfo, formatRepoInfo } from './detect.js';
|
|
9
11
|
const ADAPTERS = {
|
|
10
12
|
vscode: () => import('./adapters/vscode.js'),
|
|
11
13
|
cursor: () => import('./adapters/cursor.js'),
|
|
12
14
|
'claude-code': () => import('./adapters/claude-code.js'),
|
|
15
|
+
opencode: () => import('./adapters/opencode.js'),
|
|
16
|
+
};
|
|
17
|
+
/** IDE display labels */
|
|
18
|
+
const IDE_DISPLAY = {
|
|
19
|
+
vscode: 'VS Code',
|
|
20
|
+
cursor: 'Cursor',
|
|
21
|
+
'claude-code': 'Claude Code',
|
|
22
|
+
opencode: 'OpenCode',
|
|
13
23
|
};
|
|
14
24
|
export default async function init({ pkgRoot, args }) {
|
|
15
25
|
const projectRoot = process.cwd();
|
|
@@ -18,7 +28,7 @@ export default async function init({ pkgRoot, args }) {
|
|
|
18
28
|
const existing = await readManifest(projectRoot);
|
|
19
29
|
let isReinit = false;
|
|
20
30
|
if (existing) {
|
|
21
|
-
const proceed = await confirm(`OpenCastle already installed (v${existing.version}
|
|
31
|
+
const proceed = await confirm(`OpenCastle already installed (v${existing.version}). Re-initialize?`, false);
|
|
22
32
|
if (!proceed) {
|
|
23
33
|
console.log(' Aborted.');
|
|
24
34
|
return;
|
|
@@ -26,68 +36,103 @@ export default async function init({ pkgRoot, args }) {
|
|
|
26
36
|
isReinit = true;
|
|
27
37
|
}
|
|
28
38
|
const pkg = JSON.parse(await readFile(resolve(pkgRoot, 'package.json'), 'utf8'));
|
|
29
|
-
console.log(`\n 🏰 OpenCastle v${pkg.version}`);
|
|
30
|
-
console.log('
|
|
31
|
-
// ──
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
39
|
+
console.log(`\n 🏰 ${c.bold('OpenCastle')} ${c.dim(`v${pkg.version}`)}`);
|
|
40
|
+
console.log(` ${c.dim('Multi-agent orchestration framework for AI coding assistants')}\n`);
|
|
41
|
+
// ── Repo research ───────────────────────────────────────────────
|
|
42
|
+
console.log(` ${c.dim('Scanning repository...')}`);
|
|
43
|
+
const repoInfo = await detectRepoInfo(projectRoot);
|
|
44
|
+
const summary = formatRepoInfo(repoInfo);
|
|
45
|
+
if (summary) {
|
|
46
|
+
console.log(` ${c.green('Detected:')}\n` + summary + '\n');
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
console.log(` ${c.dim('No tooling detected (empty project?)')}\n`);
|
|
50
|
+
}
|
|
51
|
+
// ── IDEs (multiselect, at least 1) ─────────────────────────────
|
|
52
|
+
console.log(` ${c.bold('── IDEs ──────────────────────────────────────')}`);
|
|
53
|
+
let ides = [];
|
|
54
|
+
while (ides.length === 0) {
|
|
55
|
+
ides = await multiselect('Which IDEs do you use?', [
|
|
56
|
+
{
|
|
57
|
+
label: 'VS Code',
|
|
58
|
+
hint: 'GitHub Copilot agents, instructions, skills',
|
|
59
|
+
value: 'vscode',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: 'Cursor',
|
|
63
|
+
hint: '.cursorrules & .cursor/rules/*.mdc',
|
|
64
|
+
value: 'cursor',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: 'Claude Code',
|
|
68
|
+
hint: 'CLAUDE.md & .claude/ commands, skills',
|
|
69
|
+
value: 'claude-code',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: 'OpenCode',
|
|
73
|
+
hint: 'AGENTS.md & opencode.json',
|
|
74
|
+
value: 'opencode',
|
|
75
|
+
},
|
|
76
|
+
]);
|
|
77
|
+
if (ides.length === 0) {
|
|
78
|
+
console.log(` ${c.yellow('Please select at least one IDE.')}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// ── Tech Tools (multiselect, 0-N) ──────────────────────────────
|
|
82
|
+
// Pre-select tools already detected in the repo
|
|
83
|
+
const detectedTools = new Set([
|
|
84
|
+
...(repoInfo.cms ?? []),
|
|
85
|
+
...(repoInfo.databases ?? []),
|
|
86
|
+
...(repoInfo.deployment ?? []),
|
|
87
|
+
...(repoInfo.monorepo ? [repoInfo.monorepo] : []),
|
|
73
88
|
]);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
89
|
+
console.log(` ${c.bold('── Tech Tools ────────────────────────────────')}`);
|
|
90
|
+
const techTools = await multiselect('Which tools does your project use?', TECH_PLUGINS.map((p) => ({
|
|
91
|
+
label: p.label,
|
|
92
|
+
hint: p.hint,
|
|
93
|
+
value: p.id,
|
|
94
|
+
...((p.preselected || detectedTools.has(p.id)) && { selected: true }),
|
|
95
|
+
})));
|
|
96
|
+
// ── Team Tools (multiselect, 0-N) ──────────────────────────────
|
|
97
|
+
console.log(` ${c.bold('── Team Tools ────────────────────────────────')}`);
|
|
98
|
+
const teamTools = await multiselect('Which team tools do you use?', TEAM_PLUGINS.map((p) => ({
|
|
99
|
+
label: p.label,
|
|
100
|
+
hint: p.hint,
|
|
101
|
+
value: p.id,
|
|
102
|
+
...(p.preselected && { selected: true }),
|
|
103
|
+
})));
|
|
104
|
+
const stack = {
|
|
105
|
+
ides: ides,
|
|
106
|
+
techTools: techTools,
|
|
107
|
+
teamTools: teamTools,
|
|
108
|
+
};
|
|
109
|
+
// ── Merge user choices into detected info ────────────────────
|
|
110
|
+
const combinedRepoInfo = mergeStackIntoRepoInfo(repoInfo, stack);
|
|
111
|
+
const ideNames = ides.map((id) => IDE_DISPLAY[id]).join(', ');
|
|
112
|
+
console.log(`\n Installing for ${c.cyan(ideNames)}...`);
|
|
113
|
+
if (techTools.length > 0) {
|
|
114
|
+
console.log(` Tech: ${c.green(techTools.join(', '))}`);
|
|
115
|
+
}
|
|
116
|
+
if (teamTools.length > 0) {
|
|
117
|
+
console.log(` Team: ${c.green(teamTools.join(', '))}`);
|
|
118
|
+
}
|
|
119
|
+
console.log();
|
|
77
120
|
// ── Dry run ─────────────────────────────────────────────────────
|
|
78
121
|
if (dryRun) {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
122
|
+
for (const ide of ides) {
|
|
123
|
+
const adapter = await ADAPTERS[ide]();
|
|
124
|
+
const managed = adapter.getManagedPaths();
|
|
125
|
+
console.log(` ${c.dim(`[dry-run] ${IDE_DISPLAY[ide]} files:`)}\n`);
|
|
126
|
+
for (const p of managed.framework) {
|
|
127
|
+
console.log(` ${c.green('+')} ${p}`);
|
|
128
|
+
}
|
|
129
|
+
for (const p of managed.customizable) {
|
|
130
|
+
console.log(` ${c.green('+')} ${p}`);
|
|
131
|
+
}
|
|
87
132
|
}
|
|
88
|
-
console.log(` + .opencastle.json`);
|
|
89
|
-
console.log(` + .gitignore (OpenCastle entries)`);
|
|
90
|
-
console.log(
|
|
133
|
+
console.log(` ${c.green('+')} .opencastle.json`);
|
|
134
|
+
console.log(` ${c.green('+')} .gitignore (OpenCastle entries)`);
|
|
135
|
+
console.log(`\n ${c.dim('No files were written.')}\n`);
|
|
91
136
|
closePrompts();
|
|
92
137
|
return;
|
|
93
138
|
}
|
|
@@ -103,11 +148,12 @@ export default async function init({ pkgRoot, args }) {
|
|
|
103
148
|
await unlink(fullPath);
|
|
104
149
|
}
|
|
105
150
|
}
|
|
106
|
-
// Remove MCP
|
|
151
|
+
// Remove MCP configs so they get regenerated with new stack
|
|
107
152
|
const mcpCandidates = [
|
|
108
153
|
'.vscode/mcp.json',
|
|
109
154
|
'.cursor/mcp.json',
|
|
110
155
|
'.claude/mcp.json',
|
|
156
|
+
'opencode.json',
|
|
111
157
|
];
|
|
112
158
|
for (const mcpPath of mcpCandidates) {
|
|
113
159
|
const fullPath = resolve(projectRoot, mcpPath);
|
|
@@ -116,56 +162,73 @@ export default async function init({ pkgRoot, args }) {
|
|
|
116
162
|
}
|
|
117
163
|
}
|
|
118
164
|
}
|
|
119
|
-
// ── Run
|
|
120
|
-
|
|
121
|
-
|
|
165
|
+
// ── Run adapters for each selected IDE ──────────────────────────
|
|
166
|
+
let totalCreated = 0;
|
|
167
|
+
let totalSkipped = 0;
|
|
168
|
+
const allManagedPaths = { framework: [], customizable: [] };
|
|
169
|
+
for (const ide of ides) {
|
|
170
|
+
const adapter = await ADAPTERS[ide]();
|
|
171
|
+
const results = await adapter.install(pkgRoot, projectRoot, stack, combinedRepoInfo);
|
|
172
|
+
totalCreated += results.created.length;
|
|
173
|
+
totalSkipped += results.skipped.length;
|
|
174
|
+
const managed = adapter.getManagedPaths();
|
|
175
|
+
allManagedPaths.framework.push(...managed.framework);
|
|
176
|
+
allManagedPaths.customizable.push(...managed.customizable);
|
|
177
|
+
}
|
|
122
178
|
// ── Write manifest ──────────────────────────────────────────────
|
|
123
|
-
const manifest = createManifest(pkg.version,
|
|
124
|
-
manifest.managedPaths =
|
|
179
|
+
const manifest = createManifest(pkg.version, ides[0], ides);
|
|
180
|
+
manifest.managedPaths = allManagedPaths;
|
|
125
181
|
manifest.stack = stack;
|
|
182
|
+
manifest.repoInfo = combinedRepoInfo;
|
|
126
183
|
await writeManifest(projectRoot, manifest);
|
|
127
184
|
// ── Update .gitignore ───────────────────────────────────────────
|
|
128
|
-
const
|
|
129
|
-
const gitignoreResult = await updateGitignore(projectRoot, managedPaths);
|
|
185
|
+
const gitignoreResult = await updateGitignore(projectRoot, allManagedPaths);
|
|
130
186
|
// ── Summary ─────────────────────────────────────────────────────
|
|
131
|
-
|
|
132
|
-
const skipped = results.skipped.length;
|
|
133
|
-
console.log(` ✓ Created ${created} files`);
|
|
187
|
+
console.log(` ${c.green('✓')} Created ${c.bold(String(totalCreated))} files`);
|
|
134
188
|
if (gitignoreResult === 'created') {
|
|
135
|
-
console.log('
|
|
189
|
+
console.log(` ${c.green('✓')} Created .gitignore with OpenCastle entries`);
|
|
136
190
|
}
|
|
137
191
|
else if (gitignoreResult === 'updated') {
|
|
138
|
-
console.log('
|
|
192
|
+
console.log(` ${c.green('✓')} Updated .gitignore with OpenCastle entries`);
|
|
139
193
|
}
|
|
140
|
-
if (
|
|
141
|
-
console.log(` → Skipped ${
|
|
194
|
+
if (totalSkipped > 0) {
|
|
195
|
+
console.log(` ${c.dim('→')} Skipped ${totalSkipped} existing files`);
|
|
142
196
|
}
|
|
143
197
|
// ── Env var notice ──────────────────────────────────────────────
|
|
144
|
-
const envVars = getRequiredMcpEnvVars(stack);
|
|
198
|
+
const envVars = getRequiredMcpEnvVars(stack, combinedRepoInfo);
|
|
145
199
|
if (envVars.length > 0) {
|
|
146
|
-
console.log(`\n ⚠ Required environment variables for MCP servers:\n`);
|
|
200
|
+
console.log(`\n ${c.yellow('⚠')} Required environment variables for MCP servers:\n`);
|
|
147
201
|
for (const { envVar, hint } of envVars) {
|
|
148
|
-
console.log(` ${envVar}`);
|
|
149
|
-
console.log(` └ ${hint}\n`);
|
|
202
|
+
console.log(` ${c.bold(envVar)}`);
|
|
203
|
+
console.log(` ${c.dim('└')} ${c.dim(hint)}\n`);
|
|
150
204
|
}
|
|
151
205
|
}
|
|
152
206
|
// ── OAuth setup guides ────────────────────────────────────────
|
|
153
|
-
if (
|
|
154
|
-
console.log(` 📖 Slack MCP requires a Slack App with a bot token.`);
|
|
155
|
-
console.log(` Setup guide: https://www.opencastle.dev/guides/slack
|
|
156
|
-
}
|
|
157
|
-
console.log(`\n Next steps:`);
|
|
158
|
-
if (ide === 'vscode') {
|
|
159
|
-
console.log(' 0. Reload VS Code window (Cmd+Shift+P → "Reload Window") to pick up agents');
|
|
207
|
+
if (teamTools.includes('slack')) {
|
|
208
|
+
console.log(` ${c.cyan('📖')} Slack MCP requires a Slack App with a bot token.`);
|
|
209
|
+
console.log(` Setup guide: ${c.cyan('https://www.opencastle.dev/guides/plugins#slack')}\n`);
|
|
160
210
|
}
|
|
161
|
-
|
|
162
|
-
|
|
211
|
+
console.log(`\n ${c.bold('Next steps:')}`);
|
|
212
|
+
let step = 0;
|
|
213
|
+
// Reload window messages for relevant IDEs
|
|
214
|
+
const needsReload = ides.filter((id) => ['vscode', 'cursor'].includes(id));
|
|
215
|
+
if (needsReload.length > 0) {
|
|
216
|
+
step++;
|
|
217
|
+
if (needsReload.includes('vscode')) {
|
|
218
|
+
console.log(` ${step}. ${c.yellow('Reload VS Code window')} (Cmd+Shift+P → "Developer: Reload Window")`);
|
|
219
|
+
}
|
|
220
|
+
if (needsReload.includes('cursor')) {
|
|
221
|
+
console.log(` ${step}. ${c.yellow('Reload Cursor window')} to pick up the new rule files`);
|
|
222
|
+
}
|
|
163
223
|
}
|
|
164
224
|
if (envVars.length > 0) {
|
|
165
|
-
|
|
225
|
+
step++;
|
|
226
|
+
console.log(` ${step}. Set the environment variable${envVars.length > 1 ? 's' : ''} listed above`);
|
|
166
227
|
}
|
|
167
|
-
|
|
168
|
-
console.log(` ${
|
|
228
|
+
step++;
|
|
229
|
+
console.log(` ${step}. Run the ${c.cyan('"Bootstrap Customizations"')} prompt to configure for your project`);
|
|
230
|
+
step++;
|
|
231
|
+
console.log(` ${step}. Commit the customizations/ folder to your repository`);
|
|
169
232
|
console.log();
|
|
170
233
|
closePrompts();
|
|
171
234
|
}
|
package/dist/cli/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,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CAAC,GAAG,CACT,KAAK,IAAI,aAAa,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,uCAAuC,CAClG,CAAA;IACD,IAAI,EAAE,CAAA;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,wDAAwD,CAAC,CAAA;IAC9E,OAAO,CAAC,GAAG,EAAE,CAAA;IAEb,YAAY,EAAE,CAAA;AAChB,CAAC"}
|
package/dist/cli/manifest.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export declare function writeManifest(projectRoot: string, manifest: Manifest):
|
|
|
10
10
|
/**
|
|
11
11
|
* Create a fresh manifest object.
|
|
12
12
|
*/
|
|
13
|
-
export declare function createManifest(version: string, ide: string): Manifest;
|
|
13
|
+
export declare function createManifest(version: string, ide: string, ides?: string[]): Manifest;
|
|
14
14
|
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/cli/manifest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C;;GAEG;AACH,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAU1B;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/cli/manifest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C;;GAEG;AACH,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAU1B;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,QAAQ,CAQtF"}
|
package/dist/cli/manifest.js
CHANGED
|
@@ -23,10 +23,11 @@ export async function writeManifest(projectRoot, manifest) {
|
|
|
23
23
|
/**
|
|
24
24
|
* Create a fresh manifest object.
|
|
25
25
|
*/
|
|
26
|
-
export function createManifest(version, ide) {
|
|
26
|
+
export function createManifest(version, ide, ides) {
|
|
27
27
|
return {
|
|
28
28
|
version,
|
|
29
29
|
ide,
|
|
30
|
+
ides: ides ?? [ide],
|
|
30
31
|
installedAt: new Date().toISOString(),
|
|
31
32
|
updatedAt: new Date().toISOString(),
|
|
32
33
|
};
|
package/dist/cli/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/cli/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,WAAmB;IAEnB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAC5B,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,EACnC,MAAM,CACP,CAAC;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAa,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;A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P,GAAG;QACH,IAAI,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC;QACnB,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACrC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;AACJ,CAAC"}
|
package/dist/cli/mcp.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { ScaffoldResult, StackConfig } from './types.js';
|
|
1
|
+
import type { ScaffoldResult, StackConfig, RepoInfo, IdeChoice } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Scaffold or merge the MCP server config into the target project.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Builds the server list from plugin configs based on the user's
|
|
6
|
+
* stack selection. Writes to `<projectRoot>/<destRelPath>`
|
|
7
|
+
* (e.g. `.vscode/mcp.json`).
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
* CMS/DB stack (plus core servers) are included.
|
|
9
|
+
* The output format is adapted to match the target IDE's expectations.
|
|
10
10
|
*
|
|
11
11
|
* If the file already exists, missing servers are merged in without
|
|
12
12
|
* overwriting any existing server configs.
|
|
13
13
|
*/
|
|
14
|
-
export declare function scaffoldMcpConfig(
|
|
14
|
+
export declare function scaffoldMcpConfig(projectRoot: string, destRelPath: string, stack?: StackConfig, repoInfo?: RepoInfo, ide?: IdeChoice): Promise<ScaffoldResult>;
|
|
15
15
|
//# sourceMappingURL=mcp.d.ts.map
|
package/dist/cli/mcp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/cli/mcp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/cli/mcp.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA6EnF;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,KAAK,CAAC,EAAE,WAAW,EACnB,QAAQ,CAAC,EAAE,QAAQ,EACnB,GAAG,CAAC,EAAE,SAAS,GACd,OAAO,CAAC,cAAc,CAAC,CAiFzB"}
|
package/dist/cli/mcp.js
CHANGED
|
@@ -1,65 +1,136 @@
|
|
|
1
1
|
import { resolve, dirname } from 'node:path';
|
|
2
2
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
|
-
import { getOrchestratorRoot } from './copy.js';
|
|
5
4
|
import { getIncludedMcpServers } from './stack-config.js';
|
|
5
|
+
import { PLUGINS } from '../orchestrator/plugins/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Transform a VS Code–format MCP config into the format
|
|
8
|
+
* expected by the given IDE.
|
|
9
|
+
*/
|
|
10
|
+
function transformMcpForIde(ide, servers, inputs) {
|
|
11
|
+
switch (ide) {
|
|
12
|
+
case 'cursor':
|
|
13
|
+
case 'claude-code': {
|
|
14
|
+
// mcpServers format — no 'type' field
|
|
15
|
+
const mcpServers = {};
|
|
16
|
+
for (const [name, server] of Object.entries(servers)) {
|
|
17
|
+
if (server.type === 'stdio') {
|
|
18
|
+
mcpServers[name] = {
|
|
19
|
+
command: server.command,
|
|
20
|
+
args: server.args,
|
|
21
|
+
...(server.env && { env: server.env }),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
else if (server.type === 'http') {
|
|
25
|
+
// Strip VS Code ${input:...} placeholders for non-VS Code IDEs
|
|
26
|
+
let url = server.url ?? '';
|
|
27
|
+
url = url.replace(/\$\{input:\w+\}/g, 'REPLACE_ME');
|
|
28
|
+
mcpServers[name] = { url };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return { mcpServers };
|
|
32
|
+
}
|
|
33
|
+
case 'opencode': {
|
|
34
|
+
// OpenCode format — type: "local"/"remote", command as array
|
|
35
|
+
const mcp = {};
|
|
36
|
+
for (const [name, server] of Object.entries(servers)) {
|
|
37
|
+
if (server.type === 'stdio') {
|
|
38
|
+
mcp[name] = {
|
|
39
|
+
type: 'local',
|
|
40
|
+
command: [server.command, ...(server.args ?? [])],
|
|
41
|
+
...(server.env && { environment: server.env }),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
else if (server.type === 'http') {
|
|
45
|
+
let url = server.url ?? '';
|
|
46
|
+
url = url.replace(/\$\{input:\w+\}/g, 'REPLACE_ME');
|
|
47
|
+
mcp[name] = {
|
|
48
|
+
type: 'remote',
|
|
49
|
+
url,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return { mcp };
|
|
54
|
+
}
|
|
55
|
+
default: {
|
|
56
|
+
// VS Code — return as-is (keep type, inputs, envFile)
|
|
57
|
+
const result = { servers };
|
|
58
|
+
if (inputs && inputs.length > 0) {
|
|
59
|
+
result.inputs = inputs;
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
6
65
|
/**
|
|
7
66
|
* Scaffold or merge the MCP server config into the target project.
|
|
8
67
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
68
|
+
* Builds the server list from plugin configs based on the user's
|
|
69
|
+
* stack selection. Writes to `<projectRoot>/<destRelPath>`
|
|
70
|
+
* (e.g. `.vscode/mcp.json`).
|
|
11
71
|
*
|
|
12
|
-
*
|
|
13
|
-
* CMS/DB stack (plus core servers) are included.
|
|
72
|
+
* The output format is adapted to match the target IDE's expectations.
|
|
14
73
|
*
|
|
15
74
|
* If the file already exists, missing servers are merged in without
|
|
16
75
|
* overwriting any existing server configs.
|
|
17
76
|
*/
|
|
18
|
-
export async function scaffoldMcpConfig(
|
|
77
|
+
export async function scaffoldMcpConfig(projectRoot, destRelPath, stack, repoInfo, ide) {
|
|
19
78
|
const destPath = resolve(projectRoot, destRelPath);
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const template = JSON.parse(content);
|
|
24
|
-
// Filter servers based on stack config
|
|
79
|
+
// Build server list from plugin configs
|
|
80
|
+
const servers = {};
|
|
81
|
+
let inputs = [];
|
|
25
82
|
if (stack) {
|
|
26
|
-
const included = getIncludedMcpServers(stack);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
delete template.inputs;
|
|
83
|
+
const included = getIncludedMcpServers(stack, repoInfo);
|
|
84
|
+
for (const plugin of Object.values(PLUGINS)) {
|
|
85
|
+
if (plugin.mcpServerKey && included.has(plugin.mcpServerKey)) {
|
|
86
|
+
servers[plugin.mcpServerKey] = plugin.mcpConfig;
|
|
87
|
+
if (plugin.mcpInputs) {
|
|
88
|
+
inputs.push(...plugin.mcpInputs);
|
|
89
|
+
}
|
|
34
90
|
}
|
|
35
91
|
}
|
|
36
92
|
}
|
|
93
|
+
// Transform to IDE-specific format
|
|
94
|
+
const resolvedIde = ide ?? 'vscode';
|
|
95
|
+
const output = transformMcpForIde(resolvedIde, servers, inputs.length > 0 ? inputs : undefined);
|
|
37
96
|
if (existsSync(destPath)) {
|
|
38
97
|
// Merge: add missing servers without overwriting existing ones
|
|
39
98
|
const existingContent = await readFile(destPath, 'utf8');
|
|
40
99
|
const existing = JSON.parse(existingContent);
|
|
41
|
-
|
|
42
|
-
|
|
100
|
+
// Determine the server container key for this IDE
|
|
101
|
+
const containerKey = resolvedIde === 'opencode'
|
|
102
|
+
? 'mcp'
|
|
103
|
+
: resolvedIde === 'vscode'
|
|
104
|
+
? 'servers'
|
|
105
|
+
: 'mcpServers';
|
|
106
|
+
if (!existing[containerKey]) {
|
|
107
|
+
existing[containerKey] = {};
|
|
43
108
|
}
|
|
109
|
+
const existingServers = existing[containerKey];
|
|
110
|
+
const newServers = output[containerKey];
|
|
44
111
|
let added = 0;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
112
|
+
if (newServers) {
|
|
113
|
+
for (const [key, value] of Object.entries(newServers)) {
|
|
114
|
+
if (!(key in existingServers)) {
|
|
115
|
+
existingServers[key] = value;
|
|
116
|
+
added++;
|
|
117
|
+
}
|
|
49
118
|
}
|
|
50
119
|
}
|
|
51
|
-
//
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
for (const input of template.inputs) {
|
|
120
|
+
// For VS Code: merge inputs
|
|
121
|
+
if (resolvedIde === 'vscode' && output.inputs) {
|
|
122
|
+
const existingInputs = existing.inputs ?? [];
|
|
123
|
+
const existingIds = new Set(existingInputs.map((i) => i.id));
|
|
124
|
+
const newInputs = output.inputs;
|
|
125
|
+
for (const input of newInputs) {
|
|
58
126
|
if (!existingIds.has(input.id)) {
|
|
59
|
-
|
|
127
|
+
existingInputs.push(input);
|
|
60
128
|
added++;
|
|
61
129
|
}
|
|
62
130
|
}
|
|
131
|
+
if (existingInputs.length > 0) {
|
|
132
|
+
existing.inputs = existingInputs;
|
|
133
|
+
}
|
|
63
134
|
}
|
|
64
135
|
if (added === 0) {
|
|
65
136
|
return { path: destPath, action: 'skipped' };
|
|
@@ -68,7 +139,7 @@ export async function scaffoldMcpConfig(pkgRoot, projectRoot, destRelPath, stack
|
|
|
68
139
|
return { path: destPath, action: 'created' };
|
|
69
140
|
}
|
|
70
141
|
await mkdir(dirname(destPath), { recursive: true });
|
|
71
|
-
await writeFile(destPath, JSON.stringify(
|
|
142
|
+
await writeFile(destPath, JSON.stringify(output, null, 2) + '\n');
|
|
72
143
|
return { path: destPath, action: 'created' };
|
|
73
144
|
}
|
|
74
145
|
//# sourceMappingURL=mcp.js.map
|