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/stack-config.js
CHANGED
|
@@ -1,132 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { PLUGINS, TECH_PLUGINS, TEAM_PLUGINS, CMS_PLUGINS, DB_PLUGINS, ALL_PLUGIN_SKILL_NAMES, getSelectedSkillNames, } from '../orchestrator/plugins/index.js';
|
|
2
|
+
/** All tech-tool metadata — derived from plugin configs. */
|
|
3
|
+
const TECH_TOOL_INFO = Object.fromEntries(TECH_PLUGINS.map((p) => [p.id, { tech: p.name, skill: p.skillName, mcpServer: p.mcpServerKey }]));
|
|
4
|
+
/** All team-tool metadata — derived from plugin configs. */
|
|
5
|
+
const TEAM_TOOL_INFO = Object.fromEntries(TEAM_PLUGINS.map((p) => [p.id, { tech: p.name, skill: p.skillName, mcpServer: p.mcpServerKey }]));
|
|
6
|
+
/** CMS-related tech tools. */
|
|
7
|
+
const CMS_TOOLS = CMS_PLUGINS.map((p) => p.id);
|
|
8
|
+
/** Database-related tech tools. */
|
|
9
|
+
const DB_TOOLS = DB_PLUGINS.map((p) => p.id);
|
|
10
|
+
/** MCP servers auto-included when detected in the repo. */
|
|
11
|
+
const DETECTED_MCP_MAP = {
|
|
12
|
+
vercel: 'Vercel',
|
|
7
13
|
};
|
|
8
|
-
/** Display name for each DB choice */
|
|
9
|
-
const DB_LABELS = {
|
|
10
|
-
supabase: { tech: 'Supabase', skill: 'supabase-database' },
|
|
11
|
-
convex: { tech: 'Convex', skill: 'convex-database' },
|
|
12
|
-
};
|
|
13
|
-
/** Display name for each PM choice */
|
|
14
|
-
const PM_LABELS = {
|
|
15
|
-
linear: { tech: 'Linear', skill: 'task-management' },
|
|
16
|
-
jira: { tech: 'Jira', skill: 'jira-management' },
|
|
17
|
-
};
|
|
18
|
-
/** Display name for each notifications choice */
|
|
19
|
-
const NOTIF_LABELS = {
|
|
20
|
-
slack: { tech: 'Slack', skill: 'slack-notifications' },
|
|
21
|
-
teams: { tech: 'Teams', skill: 'teams-notifications' },
|
|
22
|
-
};
|
|
23
|
-
// ── Exclusion / inclusion maps ────────────────────────────────
|
|
24
|
-
/** Skills to EXCLUDE based on CMS choice */
|
|
25
|
-
const CMS_SKILL_MAP = {
|
|
26
|
-
sanity: ['contentful-cms', 'strapi-cms'],
|
|
27
|
-
contentful: ['sanity-cms', 'strapi-cms'],
|
|
28
|
-
strapi: ['sanity-cms', 'contentful-cms'],
|
|
29
|
-
none: ['sanity-cms', 'contentful-cms', 'strapi-cms'],
|
|
30
|
-
};
|
|
31
|
-
/** Skills to EXCLUDE based on DB choice */
|
|
32
|
-
const DB_SKILL_MAP = {
|
|
33
|
-
supabase: ['convex-database'],
|
|
34
|
-
convex: ['supabase-database'],
|
|
35
|
-
none: ['supabase-database', 'convex-database'],
|
|
36
|
-
};
|
|
37
|
-
/** Skills to EXCLUDE based on PM choice */
|
|
38
|
-
const PM_SKILL_MAP = {
|
|
39
|
-
linear: ['jira-management'],
|
|
40
|
-
jira: ['task-management'],
|
|
41
|
-
none: ['task-management', 'jira-management'],
|
|
42
|
-
};
|
|
43
|
-
/** Agents to EXCLUDE based on CMS choice */
|
|
44
|
-
const CMS_AGENT_EXCLUSIONS = {
|
|
45
|
-
sanity: [],
|
|
46
|
-
contentful: [],
|
|
47
|
-
strapi: [],
|
|
48
|
-
none: ['content-engineer.agent.md'],
|
|
49
|
-
};
|
|
50
|
-
/** Agents to EXCLUDE based on DB choice */
|
|
51
|
-
const DB_AGENT_EXCLUSIONS = {
|
|
52
|
-
supabase: [],
|
|
53
|
-
convex: [],
|
|
54
|
-
none: ['database-engineer.agent.md'],
|
|
55
|
-
};
|
|
56
|
-
/** MCP server keys to INCLUDE based on CMS choice */
|
|
57
|
-
const CMS_MCP_MAP = {
|
|
58
|
-
sanity: ['Sanity'],
|
|
59
|
-
contentful: ['Contentful'],
|
|
60
|
-
strapi: ['Strapi'],
|
|
61
|
-
none: [],
|
|
62
|
-
};
|
|
63
|
-
/** MCP server keys to INCLUDE based on DB choice */
|
|
64
|
-
const DB_MCP_MAP = {
|
|
65
|
-
supabase: ['Supabase'],
|
|
66
|
-
convex: ['Convex'],
|
|
67
|
-
none: [],
|
|
68
|
-
};
|
|
69
|
-
/** MCP server keys to INCLUDE based on PM choice */
|
|
70
|
-
const PM_MCP_MAP = {
|
|
71
|
-
linear: ['Linear'],
|
|
72
|
-
jira: ['Jira'],
|
|
73
|
-
none: [],
|
|
74
|
-
};
|
|
75
|
-
/** Skills to EXCLUDE based on notifications choice */
|
|
76
|
-
const NOTIF_SKILL_MAP = {
|
|
77
|
-
slack: ['teams-notifications'],
|
|
78
|
-
teams: ['slack-notifications'],
|
|
79
|
-
none: ['slack-notifications', 'teams-notifications'],
|
|
80
|
-
};
|
|
81
|
-
/** MCP server keys to INCLUDE based on notifications choice */
|
|
82
|
-
const NOTIF_MCP_MAP = {
|
|
83
|
-
slack: ['Slack'],
|
|
84
|
-
teams: ['Teams'],
|
|
85
|
-
none: [],
|
|
86
|
-
};
|
|
87
|
-
/** Always-included MCP servers */
|
|
88
|
-
const CORE_MCP_SERVERS = ['chrome-devtools', 'Vercel'];
|
|
89
14
|
/**
|
|
90
15
|
* Registry of MCP servers that require API keys via environment variables.
|
|
91
|
-
*
|
|
92
|
-
|
|
16
|
+
* Derived from plugin configs — only plugins with envVars are included.
|
|
17
|
+
*/
|
|
18
|
+
const MCP_ENV_REQUIREMENTS = Object.values(PLUGINS)
|
|
19
|
+
.filter((p) => p.envVars.length > 0 && p.mcpServerKey)
|
|
20
|
+
.flatMap((p) => p.envVars.map((ev) => ({
|
|
21
|
+
server: p.mcpServerKey,
|
|
22
|
+
envVar: ev.name,
|
|
23
|
+
hint: ev.hint,
|
|
24
|
+
})));
|
|
25
|
+
// ── Exported helpers ──────────────────────────────────────────
|
|
26
|
+
/**
|
|
27
|
+
* Skills to EXCLUDE — all tool-specific skills that are NOT selected.
|
|
93
28
|
*/
|
|
94
|
-
const MCP_ENV_REQUIREMENTS = [
|
|
95
|
-
{
|
|
96
|
-
server: 'Linear',
|
|
97
|
-
envVar: 'LINEAR_API_KEY',
|
|
98
|
-
hint: 'Create at linear.app → Settings → API → Personal API keys',
|
|
99
|
-
},
|
|
100
|
-
];
|
|
101
29
|
export function getExcludedSkills(stack) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
...PM_SKILL_MAP[stack.pm ?? 'none'],
|
|
106
|
-
...NOTIF_SKILL_MAP[stack.notifications ?? 'none'],
|
|
107
|
-
]);
|
|
30
|
+
const selectedIds = [...stack.techTools, ...stack.teamTools];
|
|
31
|
+
const includedSkills = new Set(getSelectedSkillNames(selectedIds));
|
|
32
|
+
return new Set(ALL_PLUGIN_SKILL_NAMES.filter((s) => !includedSkills.has(s)));
|
|
108
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Plugin IDs to INCLUDE — the user's selected tools.
|
|
36
|
+
*/
|
|
37
|
+
export function getIncludedPluginIds(stack) {
|
|
38
|
+
return new Set([...stack.techTools, ...stack.teamTools]);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Agents to EXCLUDE — content-engineer if no CMS, database-engineer if no DB.
|
|
42
|
+
*/
|
|
109
43
|
export function getExcludedAgents(stack) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
44
|
+
const excluded = new Set();
|
|
45
|
+
const hasCms = stack.techTools.some((t) => CMS_TOOLS.includes(t));
|
|
46
|
+
const hasDb = stack.techTools.some((t) => DB_TOOLS.includes(t));
|
|
47
|
+
if (!hasCms)
|
|
48
|
+
excluded.add('content-engineer.agent.md');
|
|
49
|
+
if (!hasDb)
|
|
50
|
+
excluded.add('database-engineer.agent.md');
|
|
51
|
+
return excluded;
|
|
114
52
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
53
|
+
/**
|
|
54
|
+
* MCP servers to INCLUDE — core + selected tools + auto-detected from repo.
|
|
55
|
+
*/
|
|
56
|
+
export function getIncludedMcpServers(stack, repoInfo) {
|
|
57
|
+
const servers = new Set();
|
|
58
|
+
for (const tool of stack.techTools) {
|
|
59
|
+
const server = TECH_TOOL_INFO[tool]?.mcpServer;
|
|
60
|
+
if (server)
|
|
61
|
+
servers.add(server);
|
|
62
|
+
}
|
|
63
|
+
for (const tool of stack.teamTools) {
|
|
64
|
+
const server = TEAM_TOOL_INFO[tool]?.mcpServer;
|
|
65
|
+
if (server)
|
|
66
|
+
servers.add(server);
|
|
67
|
+
}
|
|
68
|
+
// Add servers for detected deployment targets
|
|
69
|
+
for (const dep of repoInfo?.deployment ?? []) {
|
|
70
|
+
const server = DETECTED_MCP_MAP[dep];
|
|
71
|
+
if (server)
|
|
72
|
+
servers.add(server);
|
|
73
|
+
}
|
|
74
|
+
// Auto-detect NX from monorepo info
|
|
75
|
+
if (repoInfo?.monorepo === 'nx' && !stack.techTools.includes('nx')) {
|
|
76
|
+
servers.add('Nx');
|
|
77
|
+
}
|
|
78
|
+
return servers;
|
|
123
79
|
}
|
|
124
80
|
/**
|
|
125
81
|
* Returns env var requirements for the MCP servers included in the stack.
|
|
126
82
|
* Only returns entries for servers that actually need API keys.
|
|
127
83
|
*/
|
|
128
|
-
export function getRequiredMcpEnvVars(stack) {
|
|
129
|
-
const included = getIncludedMcpServers(stack);
|
|
84
|
+
export function getRequiredMcpEnvVars(stack, repoInfo) {
|
|
85
|
+
const included = getIncludedMcpServers(stack, repoInfo);
|
|
130
86
|
return MCP_ENV_REQUIREMENTS.filter((req) => included.has(req.server));
|
|
131
87
|
}
|
|
132
88
|
// ── Customization file transforms ─────────────────────────────
|
|
@@ -138,7 +94,6 @@ export function getRequiredMcpEnvVars(stack) {
|
|
|
138
94
|
*/
|
|
139
95
|
export function getCustomizationsTransform(stack) {
|
|
140
96
|
return (content, srcPath) => {
|
|
141
|
-
// Pre-fill skill matrix with CMS and DB bindings
|
|
142
97
|
if (srcPath.endsWith('skill-matrix.md')) {
|
|
143
98
|
return transformSkillMatrix(content, stack);
|
|
144
99
|
}
|
|
@@ -151,16 +106,76 @@ export function getCustomizationsTransform(stack) {
|
|
|
151
106
|
*/
|
|
152
107
|
function transformSkillMatrix(content, stack) {
|
|
153
108
|
let result = content;
|
|
154
|
-
//
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
109
|
+
// Find first selected DB tool
|
|
110
|
+
const db = stack.techTools.find((t) => DB_TOOLS.includes(t));
|
|
111
|
+
if (db) {
|
|
112
|
+
const info = TECH_TOOL_INFO[db];
|
|
113
|
+
if (info?.skill) {
|
|
114
|
+
result = result.replace(/(\| `database`\s*\|)\s*\|(\s*\|)/, `$1 ${info.tech} | \`${info.skill}\` $2`);
|
|
115
|
+
}
|
|
158
116
|
}
|
|
159
|
-
//
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
117
|
+
// Find first selected CMS tool
|
|
118
|
+
const cms = stack.techTools.find((t) => CMS_TOOLS.includes(t));
|
|
119
|
+
if (cms) {
|
|
120
|
+
const info = TECH_TOOL_INFO[cms];
|
|
121
|
+
if (info?.skill) {
|
|
122
|
+
result = result.replace(/(\| `cms`\s*\|)\s*\|(\s*\|)/, `$1 ${info.tech} | \`${info.skill}\` $2`);
|
|
123
|
+
}
|
|
163
124
|
}
|
|
164
125
|
return result;
|
|
165
126
|
}
|
|
127
|
+
// ── Agent tool injection ──────────────────────────────────────
|
|
128
|
+
/**
|
|
129
|
+
* Compute tool injections per agent based on the user's selected stack.
|
|
130
|
+
* Returns a Map where key = agent name (e.g. 'content-engineer'), value = tools to inject.
|
|
131
|
+
*/
|
|
132
|
+
export function getAgentToolInjections(stack) {
|
|
133
|
+
const injections = new Map();
|
|
134
|
+
const selectedIds = [...stack.techTools, ...stack.teamTools];
|
|
135
|
+
for (const id of selectedIds) {
|
|
136
|
+
const plugin = PLUGINS[id];
|
|
137
|
+
if (!plugin?.agentToolMap)
|
|
138
|
+
continue;
|
|
139
|
+
for (const [agentName, tools] of Object.entries(plugin.agentToolMap)) {
|
|
140
|
+
const existing = injections.get(agentName) ?? [];
|
|
141
|
+
existing.push(...tools);
|
|
142
|
+
injections.set(agentName, existing);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return injections;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Returns a transform callback that injects plugin-specific tools
|
|
149
|
+
* into agent file frontmatter based on the user's stack selection.
|
|
150
|
+
*/
|
|
151
|
+
export function getAgentTransform(stack) {
|
|
152
|
+
const injections = getAgentToolInjections(stack);
|
|
153
|
+
return (content, srcPath) => {
|
|
154
|
+
// Extract agent name from filename (e.g., 'content-engineer' from 'content-engineer.agent.md')
|
|
155
|
+
const match = srcPath.match(/([^/\\]+)\.agent\.md$/);
|
|
156
|
+
if (!match)
|
|
157
|
+
return content;
|
|
158
|
+
const agentName = match[1];
|
|
159
|
+
const toolsToInject = injections.get(agentName);
|
|
160
|
+
if (!toolsToInject || toolsToInject.length === 0)
|
|
161
|
+
return content;
|
|
162
|
+
// Parse the frontmatter to find the tools array
|
|
163
|
+
const fmMatch = content.match(/^(---\n)([\s\S]*?)\n(---\n)([\s\S]*)$/);
|
|
164
|
+
if (!fmMatch)
|
|
165
|
+
return content;
|
|
166
|
+
const frontmatter = fmMatch[2];
|
|
167
|
+
const body = fmMatch[4];
|
|
168
|
+
// Find and modify the tools line
|
|
169
|
+
const toolsMatch = frontmatter.match(/^(tools:\s*\[)(.*?)(\]\s*)$/m);
|
|
170
|
+
if (!toolsMatch)
|
|
171
|
+
return content;
|
|
172
|
+
const existingTools = toolsMatch[2];
|
|
173
|
+
const injectedToolsList = toolsToInject.map((t) => `'${t}'`).join(', ');
|
|
174
|
+
const newTools = existingTools
|
|
175
|
+
? `${existingTools}, ${injectedToolsList}`
|
|
176
|
+
: injectedToolsList;
|
|
177
|
+
const newFrontmatter = frontmatter.replace(toolsMatch[0], `${toolsMatch[1]}${newTools}${toolsMatch[3]}`);
|
|
178
|
+
return `---\n${newFrontmatter}\n---\n${body}`;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
166
181
|
//# sourceMappingURL=stack-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-config.js","sourceRoot":"","sources":["../../src/cli/stack-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stack-config.js","sourceRoot":"","sources":["../../src/cli/stack-config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,kCAAkC,CAAC;AAW1C,4DAA4D;AAC5D,MAAM,cAAc,GAA+B,MAAM,CAAC,WAAW,CACnE,Y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AAC,aAAa,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,OAAO,CAAC;QAEjE,gDAAgD;QAChD,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACvE,IAAI,CAAC,OAAO;YAAE,OAAO,OAAO,CAAC;QAE7B,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAExB,iCAAiC;QACjC,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACrE,IAAI,CAAC,UAAU;YAAE,OAAO,OAAO,CAAC;QAEhC,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,iBAAiB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,aAAa;YAC5B,CAAC,CAAC,GAAG,aAAa,KAAK,iBAAiB,EAAE;YAC1C,CAAC,CAAC,iBAAiB,CAAC;QAEtB,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,CACxC,UAAU,CAAC,CAAC,CAAC,EACb,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAC9C,CAAC;QAEF,OAAO,QAAQ,cAAc,UAAU,IAAI,EAAE,CAAC;IAChD,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/cli/types.d.ts
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
import type { ChildProcess } from 'node:child_process';
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type NotifChoice = 'slack' | 'teams' | 'none';
|
|
2
|
+
export type IdeChoice = 'vscode' | 'cursor' | 'claude-code' | 'opencode';
|
|
3
|
+
export type TechTool = 'sanity' | 'contentful' | 'strapi' | 'supabase' | 'convex' | 'vercel' | 'nx' | 'chrome-devtools';
|
|
4
|
+
export type TeamTool = 'linear' | 'jira' | 'slack' | 'teams';
|
|
6
5
|
export interface StackConfig {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
ides: IdeChoice[];
|
|
7
|
+
techTools: TechTool[];
|
|
8
|
+
teamTools: TeamTool[];
|
|
9
|
+
}
|
|
10
|
+
/** Check if a stack config uses the legacy v1 format (individual choices with 'none'). */
|
|
11
|
+
export declare function isLegacyStack(stack: unknown): stack is {
|
|
12
|
+
cms: string;
|
|
13
|
+
db: string;
|
|
14
|
+
pm?: string;
|
|
15
|
+
notifications?: string;
|
|
16
|
+
};
|
|
17
|
+
/** Migrate a legacy v1 stack config to the v2 array format. */
|
|
18
|
+
export declare function migrateStackConfig(legacy: {
|
|
19
|
+
cms: string;
|
|
20
|
+
db: string;
|
|
21
|
+
pm?: string;
|
|
22
|
+
notifications?: string;
|
|
23
|
+
}, ide?: string): StackConfig;
|
|
12
24
|
/** Context passed from bin/cli.mjs to every command handler. */
|
|
13
25
|
export interface CliContext {
|
|
14
26
|
pkgRoot: string;
|
|
@@ -26,14 +38,34 @@ export interface CopyDirOptions {
|
|
|
26
38
|
filter?: (_name: string, _srcPath: string) => boolean;
|
|
27
39
|
transform?: (_content: string, _srcPath: string) => Promise<string | null> | string | null;
|
|
28
40
|
}
|
|
41
|
+
/** Combined repository tooling info — auto-detected + user-declared. */
|
|
42
|
+
export interface RepoInfo {
|
|
43
|
+
packageManager?: string;
|
|
44
|
+
monorepo?: string;
|
|
45
|
+
language?: string;
|
|
46
|
+
frameworks?: string[];
|
|
47
|
+
databases?: string[];
|
|
48
|
+
cms?: string[];
|
|
49
|
+
deployment?: string[];
|
|
50
|
+
testing?: string[];
|
|
51
|
+
cicd?: string[];
|
|
52
|
+
styling?: string[];
|
|
53
|
+
auth?: string[];
|
|
54
|
+
pm?: string[];
|
|
55
|
+
notifications?: string[];
|
|
56
|
+
mcpConfig?: boolean;
|
|
57
|
+
configFiles?: string[];
|
|
58
|
+
}
|
|
29
59
|
/** OpenCastle project manifest (.opencastle.json). */
|
|
30
60
|
export interface Manifest {
|
|
31
61
|
version: string;
|
|
32
62
|
ide: string;
|
|
63
|
+
ides?: string[];
|
|
33
64
|
installedAt: string;
|
|
34
65
|
updatedAt: string;
|
|
35
66
|
managedPaths?: ManagedPaths;
|
|
36
67
|
stack?: StackConfig;
|
|
68
|
+
repoInfo?: RepoInfo;
|
|
37
69
|
}
|
|
38
70
|
/** Framework vs customizable file paths. */
|
|
39
71
|
export interface ManagedPaths {
|
|
@@ -42,7 +74,7 @@ export interface ManagedPaths {
|
|
|
42
74
|
}
|
|
43
75
|
/** IDE adapter interface (init/update commands). */
|
|
44
76
|
export interface IdeAdapter {
|
|
45
|
-
install(_pkgRoot: string, _projectRoot: string, _stack?: StackConfig): Promise<CopyResults>;
|
|
77
|
+
install(_pkgRoot: string, _projectRoot: string, _stack?: StackConfig, _repoInfo?: RepoInfo): Promise<CopyResults>;
|
|
46
78
|
update(_pkgRoot: string, _projectRoot: string, _stack?: StackConfig): Promise<CopyResults>;
|
|
47
79
|
getManagedPaths(): ManagedPaths;
|
|
48
80
|
}
|
|
@@ -51,12 +83,16 @@ export interface SelectOption {
|
|
|
51
83
|
label: string;
|
|
52
84
|
hint?: string;
|
|
53
85
|
value: string;
|
|
86
|
+
/** Whether this option starts selected (preselected). */
|
|
87
|
+
selected?: boolean;
|
|
54
88
|
}
|
|
55
89
|
/** Scaffold result from MCP config. */
|
|
56
90
|
export interface ScaffoldResult {
|
|
57
91
|
path: string;
|
|
58
92
|
action: 'created' | 'skipped';
|
|
59
93
|
}
|
|
94
|
+
/** IDE display labels. */
|
|
95
|
+
export declare const IDE_LABELS: Record<IdeChoice, string>;
|
|
60
96
|
/** Validated task spec from YAML. */
|
|
61
97
|
export interface TaskSpec {
|
|
62
98
|
name: string;
|
package/dist/cli/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cli/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvD,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cli/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvD,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,GAAG,UAAU,CAAC;AACzE,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,IAAI,GAAG,iBAAiB,CAAC;AACxH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAEvH;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,CAChC,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE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E,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,2CAA2C;AAC3C,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,yBAAyB;AACzB,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,2CAA2C;AAC3C,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,2CAA2C;AAC3C,MAAM,WAAW,QAAQ;IACvB,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1B,SAAS,IAAI,IAAI,EAAE,EAAE,CAAC;CACvB"}
|
package/dist/cli/types.js
CHANGED
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
/** Check if a stack config uses the legacy v1 format (individual choices with 'none'). */
|
|
2
|
+
export function isLegacyStack(stack) {
|
|
3
|
+
return typeof stack === 'object' && stack !== null && 'cms' in stack;
|
|
4
|
+
}
|
|
5
|
+
/** Migrate a legacy v1 stack config to the v2 array format. */
|
|
6
|
+
export function migrateStackConfig(legacy, ide) {
|
|
7
|
+
const techTools = [];
|
|
8
|
+
const teamTools = [];
|
|
9
|
+
if (legacy.cms && legacy.cms !== 'none')
|
|
10
|
+
techTools.push(legacy.cms);
|
|
11
|
+
if (legacy.db && legacy.db !== 'none')
|
|
12
|
+
techTools.push(legacy.db);
|
|
13
|
+
if (legacy.pm && legacy.pm !== 'none')
|
|
14
|
+
teamTools.push(legacy.pm);
|
|
15
|
+
if (legacy.notifications && legacy.notifications !== 'none')
|
|
16
|
+
teamTools.push(legacy.notifications);
|
|
17
|
+
const ides = ide ? [ide] : [];
|
|
18
|
+
return { ides, techTools, teamTools };
|
|
19
|
+
}
|
|
20
|
+
/** IDE display labels. */
|
|
21
|
+
export const IDE_LABELS = {
|
|
22
|
+
vscode: 'VS Code',
|
|
23
|
+
cursor: 'Cursor',
|
|
24
|
+
'claude-code': 'Claude Code',
|
|
25
|
+
opencode: 'OpenCode',
|
|
26
|
+
};
|
|
2
27
|
//# sourceMappingURL=types.js.map
|
package/dist/cli/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/cli/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/cli/types.ts"],"names":[],"mappings":"AAcA,0FAA0F;AAC1F,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,IAAI,KAAK,CAAC;AACvE,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,kBAAkB,CAChC,MAAwE,EACxE,GAAY;IAEZ,MAAM,SAAS,GAAe,EAAE,CAAC;IACjC,MAAM,SAAS,GAAe,EAAE,CAAC;IAEjC,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,KAAK,MAAM;QAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,GAAe,CAAC,CAAC;IAChF,IAAI,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,EAAE,KAAK,MAAM;QAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAc,CAAC,CAAC;IAC7E,IAAI,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,EAAE,KAAK,MAAM;QAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAc,CAAC,CAAC;IAC7E,IAAI,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,KAAK,MAAM;QAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,aAAyB,CAAC,CAAC;IAE9G,MAAM,IAAI,GAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,GAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACxD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AACxC,CAAC;AAoFD,0BAA0B;AAC1B,MAAM,CAAC,MAAM,UAAU,GAA8B;IACnD,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,QAAQ;IAChB,aAAa,EAAE,aAAa;IAC5B,QAAQ,EAAE,UAAU;CACrB,CAAC"}
|
package/dist/cli/update.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/cli/update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/cli/update.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAyB,MAAM,YAAY,CAAA;AAqBnE,wBAA8B,MAAM,CAAC,EACnC,OAAO,EACP,IAAI,GACL,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAsH5B"}
|
package/dist/cli/update.js
CHANGED
|
@@ -1,44 +1,62 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { readManifest, writeManifest } from './manifest.js';
|
|
4
|
-
import { confirm, closePrompts } from './prompt.js';
|
|
4
|
+
import { confirm, closePrompts, c } from './prompt.js';
|
|
5
|
+
import { isLegacyStack, migrateStackConfig } from './types.js';
|
|
5
6
|
const ADAPTERS = {
|
|
6
7
|
vscode: () => import('./adapters/vscode.js'),
|
|
7
8
|
cursor: () => import('./adapters/cursor.js'),
|
|
8
9
|
'claude-code': () => import('./adapters/claude-code.js'),
|
|
10
|
+
opencode: () => import('./adapters/opencode.js'),
|
|
9
11
|
};
|
|
10
12
|
const VALID_IDES = Object.keys(ADAPTERS);
|
|
13
|
+
/** IDE display labels */
|
|
14
|
+
const IDE_DISPLAY = {
|
|
15
|
+
vscode: 'VS Code',
|
|
16
|
+
cursor: 'Cursor',
|
|
17
|
+
'claude-code': 'Claude Code',
|
|
18
|
+
opencode: 'OpenCode',
|
|
19
|
+
};
|
|
11
20
|
export default async function update({ pkgRoot, args, }) {
|
|
12
21
|
const projectRoot = process.cwd();
|
|
13
22
|
const manifest = await readManifest(projectRoot);
|
|
14
23
|
if (!manifest) {
|
|
15
|
-
console.error('
|
|
24
|
+
console.error(` ${c.red('✗')} No OpenCastle installation found. Run "npx opencastle init" first.`);
|
|
16
25
|
process.exit(1);
|
|
17
26
|
}
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
// Determine list of IDEs to update (support legacy single-IDE manifests)
|
|
28
|
+
const ides = manifest.ides?.length ? manifest.ides : [manifest.ide];
|
|
29
|
+
const invalidIdes = ides.filter((id) => !VALID_IDES.includes(id));
|
|
30
|
+
if (invalidIdes.length > 0) {
|
|
31
|
+
console.error(` ${c.red('✗')} Invalid IDE(s) "${invalidIdes.join(', ')}" in .opencastle.json. Valid: ${VALID_IDES.join(', ')}`);
|
|
20
32
|
process.exit(1);
|
|
21
33
|
}
|
|
34
|
+
// Migrate legacy stack config if needed
|
|
35
|
+
if (manifest.stack && isLegacyStack(manifest.stack)) {
|
|
36
|
+
manifest.stack = migrateStackConfig(manifest.stack, manifest.ide);
|
|
37
|
+
manifest.stack.ides = ides;
|
|
38
|
+
}
|
|
22
39
|
const pkg = JSON.parse(await readFile(resolve(pkgRoot, 'package.json'), 'utf8'));
|
|
23
40
|
const dryRun = args.includes('--dry-run');
|
|
24
41
|
if (manifest.version === pkg.version && !args.includes('--force') && !dryRun) {
|
|
25
42
|
console.log(` Already up to date (v${pkg.version}).`);
|
|
26
43
|
return;
|
|
27
44
|
}
|
|
28
|
-
|
|
29
|
-
console.log(
|
|
30
|
-
console.log(
|
|
31
|
-
console.log('
|
|
45
|
+
const ideNames = ides.map((id) => IDE_DISPLAY[id] ?? id).join(', ');
|
|
46
|
+
console.log(`\n 🏰 ${c.bold('OpenCastle')} ${dryRun ? 'dry-run' : 'update'}: ${c.dim(`v${manifest.version}`)} → ${c.green(`v${pkg.version}`)}\n`);
|
|
47
|
+
console.log(` IDEs: ${c.cyan(ideNames)}`);
|
|
48
|
+
console.log(` ${c.dim('Framework files will be overwritten.')}`);
|
|
49
|
+
console.log(` ${c.dim('Customization files will be preserved.')}\n`);
|
|
32
50
|
if (dryRun) {
|
|
33
|
-
console.log('
|
|
51
|
+
console.log(` ${c.dim('[dry-run]')} Framework files that would be updated:\n`);
|
|
34
52
|
for (const p of manifest.managedPaths?.framework ?? []) {
|
|
35
|
-
console.log(` ↻ ${p}`);
|
|
53
|
+
console.log(` ${c.yellow('↻')} ${p}`);
|
|
36
54
|
}
|
|
37
|
-
console.log(
|
|
55
|
+
console.log(`\n ${c.dim('[dry-run]')} Customization files that would be preserved:\n`);
|
|
38
56
|
for (const p of manifest.managedPaths?.customizable ?? []) {
|
|
39
|
-
console.log(` ✓ ${p}`);
|
|
57
|
+
console.log(` ${c.green('✓')} ${p}`);
|
|
40
58
|
}
|
|
41
|
-
console.log(
|
|
59
|
+
console.log(`\n ${c.dim('No files were written.')}\n`);
|
|
42
60
|
return;
|
|
43
61
|
}
|
|
44
62
|
const proceed = await confirm('Proceed with update?');
|
|
@@ -46,16 +64,45 @@ export default async function update({ pkgRoot, args, }) {
|
|
|
46
64
|
console.log(' Aborted.');
|
|
47
65
|
return;
|
|
48
66
|
}
|
|
49
|
-
|
|
50
|
-
|
|
67
|
+
// Update each IDE
|
|
68
|
+
let totalCopied = 0;
|
|
69
|
+
let totalCreated = 0;
|
|
70
|
+
const allManagedPaths = { framework: [], customizable: [] };
|
|
71
|
+
for (const ide of ides) {
|
|
72
|
+
const adapter = await ADAPTERS[ide]();
|
|
73
|
+
const results = await adapter.update(pkgRoot, projectRoot, manifest.stack);
|
|
74
|
+
totalCopied += results.copied.length;
|
|
75
|
+
totalCreated += results.created.length;
|
|
76
|
+
const managed = adapter.getManagedPaths();
|
|
77
|
+
allManagedPaths.framework.push(...managed.framework);
|
|
78
|
+
allManagedPaths.customizable.push(...managed.customizable);
|
|
79
|
+
}
|
|
80
|
+
// Refresh repo research on update
|
|
81
|
+
const { detectRepoInfo, mergeStackIntoRepoInfo } = await import('./detect.js');
|
|
82
|
+
const repoInfo = await detectRepoInfo(projectRoot);
|
|
51
83
|
// Update manifest
|
|
52
84
|
manifest.version = pkg.version;
|
|
85
|
+
manifest.ides = ides;
|
|
53
86
|
manifest.updatedAt = new Date().toISOString();
|
|
54
|
-
manifest.managedPaths =
|
|
87
|
+
manifest.managedPaths = allManagedPaths;
|
|
88
|
+
manifest.repoInfo = manifest.stack
|
|
89
|
+
? mergeStackIntoRepoInfo(repoInfo, manifest.stack)
|
|
90
|
+
: repoInfo;
|
|
55
91
|
await writeManifest(projectRoot, manifest);
|
|
56
|
-
console.log(`\n ✓ Updated ${
|
|
57
|
-
if (
|
|
58
|
-
console.log(` + Created ${
|
|
92
|
+
console.log(`\n ${c.green('✓')} Updated ${c.bold(String(totalCopied))} framework files`);
|
|
93
|
+
if (totalCreated > 0) {
|
|
94
|
+
console.log(` ${c.green('+')} Created ${c.bold(String(totalCreated))} new files`);
|
|
95
|
+
}
|
|
96
|
+
// ── Reload window message ─────────────────────────────────────
|
|
97
|
+
const needsReload = ides.filter((id) => ['vscode', 'cursor'].includes(id));
|
|
98
|
+
if (needsReload.length > 0) {
|
|
99
|
+
console.log();
|
|
100
|
+
if (needsReload.includes('vscode')) {
|
|
101
|
+
console.log(` ${c.yellow('⟳')} Reload VS Code window (Cmd+Shift+P → "Developer: Reload Window") to pick up changes`);
|
|
102
|
+
}
|
|
103
|
+
if (needsReload.includes('cursor')) {
|
|
104
|
+
console.log(` ${c.yellow('⟳')} Reload Cursor window to pick up the updated rule files`);
|
|
105
|
+
}
|
|
59
106
|
}
|
|
60
107
|
console.log();
|
|
61
108
|
closePrompts();
|