sillyspec 3.20.3 → 3.20.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/sillyspec-archive/SKILL.md +21 -17
- package/.claude/skills/sillyspec-auto/SKILL.md +83 -77
- package/.claude/skills/sillyspec-brainstorm/SKILL.md +44 -17
- package/.claude/skills/sillyspec-commit/SKILL.md +106 -105
- package/.claude/skills/sillyspec-continue/SKILL.md +45 -44
- package/.claude/skills/sillyspec-doctor/SKILL.md +31 -22
- package/.claude/skills/sillyspec-execute/SKILL.md +30 -17
- package/.claude/skills/sillyspec-explore/SKILL.md +109 -96
- package/.claude/skills/sillyspec-knowledge/SKILL.md +270 -0
- package/.claude/skills/sillyspec-plan/SKILL.md +21 -52
- package/.claude/skills/sillyspec-propose/SKILL.md +21 -17
- package/.claude/skills/sillyspec-quick/SKILL.md +21 -17
- package/.claude/skills/sillyspec-resume/SKILL.md +68 -111
- package/.claude/skills/sillyspec-scan/SKILL.md +21 -17
- package/.claude/skills/sillyspec-state/SKILL.md +54 -54
- package/.claude/skills/sillyspec-status/SKILL.md +21 -17
- package/.claude/skills/sillyspec-verify/SKILL.md +21 -17
- package/.claude/skills/sillyspec-workspace/SKILL.md +157 -149
- package/.husky/pre-push +13 -0
- package/CLAUDE.md +18 -0
- package/README.md +198 -186
- package/SKILL.md +90 -87
- package/bin/sillyspec.js +2 -2
- package/docs/brainstorm-plan-contract.md +64 -0
- package/docs/plan-execute-contract.md +123 -0
- package/docs/platform-scan-protocol.md +298 -0
- package/docs/revision-mode.md +115 -0
- package/docs/sillyspec/file-lifecycle/known-implementation-gaps.md +99 -0
- package/docs/sillyspec/file-lifecycle/platform-workflows-sync.md +218 -0
- package/docs/sillyspec/file-lifecycle/stage-artifacts.md +167 -0
- package/docs/sillyspec/file-lifecycle/storage-and-state.md +148 -0
- package/docs/sillyspec/file-lifecycle/worktree-and-guard.md +211 -0
- package/docs/sillyspec/file-lifecycle.md +131 -0
- package/docs/workflow-contract-regression.md +106 -0
- package/docs/worktree-isolation.md +252 -0
- package/package.json +40 -34
- package/packages/dashboard/dist/assets/{index-D1EVTLmc.js → index-Bq_Z2hne.js} +7446 -7446
- package/packages/dashboard/dist/assets/index-O2W5RV4z.css +1 -0
- package/packages/dashboard/dist/index.html +16 -16
- package/packages/dashboard/dist/prototype-dashboard.html +836 -0
- package/packages/dashboard/dist/prototype-overview.html +256 -0
- package/packages/dashboard/index.html +15 -15
- package/packages/dashboard/package-lock.json +2384 -2384
- package/packages/dashboard/package.json +25 -25
- package/packages/dashboard/public/prototype-dashboard.html +836 -0
- package/packages/dashboard/public/prototype-overview.html +256 -0
- package/packages/dashboard/server/executor.js +86 -86
- package/packages/dashboard/server/index.js +588 -508
- package/packages/dashboard/server/parser.js +526 -458
- package/packages/dashboard/server/watcher.js +350 -342
- package/packages/dashboard/src/App.vue +558 -325
- package/packages/dashboard/src/components/ActionBar.vue +93 -84
- package/packages/dashboard/src/components/CommandPalette.vue +96 -92
- package/packages/dashboard/src/components/DetailPanel.vue +137 -137
- package/packages/dashboard/src/components/DocPreview.vue +105 -8
- package/packages/dashboard/src/components/DocTree.vue +75 -19
- package/packages/dashboard/src/components/HResizeHandle.vue +48 -0
- package/packages/dashboard/src/components/LogStream.vue +65 -65
- package/packages/dashboard/src/components/PipelineStage.vue +95 -75
- package/packages/dashboard/src/components/PipelineView.vue +156 -129
- package/packages/dashboard/src/components/ProjectCard.vue +187 -0
- package/packages/dashboard/src/components/ProjectList.vue +210 -210
- package/packages/dashboard/src/components/ProjectOverview.vue +113 -139
- package/packages/dashboard/src/components/StageBadge.vue +67 -53
- package/packages/dashboard/src/components/StepCard.vue +94 -89
- package/packages/dashboard/src/components/VResizeHandle.vue +61 -0
- package/packages/dashboard/src/components/detail/DocsDetail.vue +48 -48
- package/packages/dashboard/src/components/detail/GitDetail.vue +61 -61
- package/packages/dashboard/src/components/detail/TechDetail.vue +43 -43
- package/packages/dashboard/src/composables/useDashboard.js +192 -164
- package/packages/dashboard/src/composables/useKeyboard.js +119 -119
- package/packages/dashboard/src/composables/useLayout.js +131 -0
- package/packages/dashboard/src/composables/useWebSocket.js +129 -129
- package/packages/dashboard/src/main.js +8 -8
- package/packages/dashboard/src/style.css +132 -132
- package/packages/dashboard/vite.config.js +18 -18
- package/src/brainstorm-postcheck.js +158 -0
- package/src/change-list.js +52 -0
- package/src/change-risk-profile.js +352 -0
- package/src/classify-change.js +73 -0
- package/src/constants.js +70 -0
- package/src/contract-matrix.js +278 -0
- package/src/db.js +201 -0
- package/src/endpoint-extractor.js +315 -0
- package/src/hooks/claude-pre-tool-use.cjs +125 -0
- package/src/hooks/worktree-guard.js +761 -0
- package/src/index.js +922 -252
- package/src/init.js +470 -375
- package/src/knowledge-match.js +130 -0
- package/src/migrate.js +117 -117
- package/src/modules.js +482 -0
- package/src/progress.js +1734 -508
- package/src/run.js +3465 -652
- package/src/scan-postcheck.js +387 -0
- package/src/setup.js +398 -460
- package/src/stage-contract.js +700 -0
- package/src/stages/archive.js +160 -54
- package/src/stages/brainstorm-auto.js +229 -0
- package/src/stages/brainstorm.js +645 -239
- package/src/stages/doctor.js +365 -312
- package/src/stages/execute.js +634 -264
- package/src/stages/explore.js +34 -0
- package/src/stages/index.js +29 -35
- package/src/stages/knowledge.js +498 -0
- package/src/stages/plan-postcheck.js +518 -0
- package/src/stages/plan.js +582 -279
- package/src/stages/propose.js +174 -115
- package/src/stages/quick.js +102 -63
- package/src/stages/scan.js +558 -141
- package/src/stages/status.js +65 -65
- package/src/stages/verify.js +322 -135
- package/src/sync.js +497 -0
- package/src/task-review.js +346 -0
- package/src/workflow.js +785 -0
- package/src/worktree-apply.js +549 -0
- package/src/worktree-deps.js +185 -0
- package/src/worktree.js +982 -0
- package/templates/workflows/archive-impact.yaml +79 -0
- package/templates/workflows/scan-docs.yaml +132 -0
- package/test/brainstorm-plan-contract.test.mjs +273 -0
- package/test/check-syntax.mjs +26 -0
- package/test/cli-top-level-aliases.test.mjs +174 -0
- package/test/contract-artifacts.test.mjs +323 -0
- package/test/decision-supersede.test.mjs +277 -0
- package/test/knowledge-match.test.mjs +231 -0
- package/test/plan-execute-contract.test.mjs +357 -0
- package/test/plan-optimization.test.mjs +572 -0
- package/test/platform-artifacts.test.mjs +190 -0
- package/test/platform-failure-samples.test.mjs +199 -0
- package/test/platform-recovery-chain.test.mjs +179 -0
- package/test/platform-recovery.test.mjs +167 -0
- package/test/platform-scan-p0.test.mjs +175 -0
- package/test/revision-v1.test.mjs +1145 -0
- package/test/run-sanitize-project-name.test.mjs +51 -0
- package/test/run-scan-postcheck-fail.test.mjs +64 -0
- package/test/run-scan-project-parse.test.mjs +200 -0
- package/test/run-tests.mjs +48 -0
- package/test/runtime-cleanup-keeps-worktree.test.mjs +107 -0
- package/test/scan-docs-yaml-placeholders.test.mjs +84 -0
- package/test/scan-knowledge.test.mjs +175 -0
- package/test/scan-paths.test.mjs +68 -0
- package/test/scan-postcheck-project-priority.test.mjs +85 -0
- package/test/scan-postcheck.test.mjs +197 -0
- package/test/scan-workflow-anyfailed-block.test.mjs +52 -0
- package/test/spec-dir.test.mjs +206 -0
- package/test/stage-contract-failed-post-check.test.mjs +102 -0
- package/test/stage-contract.test.mjs +299 -0
- package/test/stage-definitions.test.mjs +39 -0
- package/test/wait-gates.test.mjs +501 -0
- package/test/workflow-spec-base.test.mjs +142 -0
- package/test/worktree-deps-provision.test.mjs +148 -0
- package/test/worktree-guard.test.mjs +136 -0
- package/test/worktree-native-overlay.test.mjs +188 -0
- package/.sillyspec/changes/archive/2026-04-08-derive-state/design.md +0 -97
- package/.sillyspec/changes/archive/2026-04-08-derive-state/plan.md +0 -51
- package/.sillyspec/changes/archive/2026-04-08-derive-state/proposal.md +0 -29
- package/.sillyspec/changes/archive/2026-04-08-derive-state/requirements.md +0 -34
- package/.sillyspec/changes/archive/2026-04-08-derive-state/tasks.md +0 -13
- package/.sillyspec/changes/archive/2026-04-08-derive-state/verify-result.md +0 -43
- package/.sillyspec/changes/auto-mode/design.md +0 -50
- package/.sillyspec/changes/auto-mode/proposal.md +0 -19
- package/.sillyspec/changes/auto-mode/requirements.md +0 -21
- package/.sillyspec/changes/auto-mode/tasks.md +0 -7
- package/.sillyspec/changes/brainstorm-archive/2026-04-05-dashboard-design.md +0 -206
- package/.sillyspec/changes/brainstorm-archive/2026-04-05-unified-docs-design.md +0 -199
- package/.sillyspec/changes/dashboard/design.md +0 -219
- package/.sillyspec/changes/dashboard/design.md.braindraft +0 -206
- package/.sillyspec/changes/run-command-design/design.md +0 -1230
- package/.sillyspec/changes/unified-docs-design/design.md +0 -199
- package/.sillyspec/docs/sillyspec/scan/.gitkeep +0 -0
- package/.sillyspec/knowledge/INDEX.md +0 -8
- package/.sillyspec/knowledge/uncategorized.md +0 -3
- package/.sillyspec/plans/2026-04-05-dashboard.md +0 -737
- package/.sillyspec/projects/sillyspec.yaml +0 -3
- package/dist/steps/brainstorm/01-load-context.md +0 -30
- package/dist/steps/brainstorm/02-reuse-check.md +0 -6
- package/dist/steps/brainstorm/03-prototype-analysis.md +0 -11
- package/dist/steps/brainstorm/04-module-split.md +0 -23
- package/dist/steps/brainstorm/05-dialog-explore.md +0 -8
- package/dist/steps/brainstorm/06-propose-approaches.md +0 -3
- package/dist/steps/brainstorm/07-present-design.md +0 -3
- package/dist/steps/brainstorm/08-write-design.md +0 -21
- package/dist/steps/brainstorm/09-self-review.md +0 -15
- package/dist/steps/brainstorm/10-user-confirm.md +0 -3
- package/dist/steps/brainstorm/11-output-spec.md +0 -7
- package/dist/steps/brainstorm/manifest.yaml +0 -26
- package/dist/steps/execute/01-load-context.md +0 -41
- package/dist/steps/execute/02-scan-conventions.md +0 -47
- package/dist/steps/execute/03-skill-mcp.md +0 -19
- package/dist/steps/execute/04-assign-task.md +0 -22
- package/dist/steps/execute/04b-prompt-template.md +0 -54
- package/dist/steps/execute/05-write-test.md +0 -7
- package/dist/steps/execute/06-write-code.md +0 -8
- package/dist/steps/execute/07-run-test.md +0 -26
- package/dist/steps/execute/08-fix-issues.md +0 -28
- package/dist/steps/execute/09-next-task.md +0 -33
- package/dist/steps/execute/manifest.yaml +0 -28
- package/dist/steps/plan/01-load-context.md +0 -22
- package/dist/steps/plan/02-anchor-confirm.md +0 -1
- package/dist/steps/plan/03-expand-tasks.md +0 -33
- package/dist/steps/plan/04-mark-order.md +0 -15
- package/dist/steps/plan/05-e2e-planning.md +0 -17
- package/dist/steps/plan/06-self-check.md +0 -16
- package/dist/steps/plan/07-save.md +0 -1
- package/dist/steps/plan/manifest.yaml +0 -18
- package/dist/steps/scan/01-env-detect.md +0 -51
- package/dist/steps/scan/02-tech-stack.md +0 -16
- package/dist/steps/scan/03-conventions.md +0 -16
- package/dist/steps/scan/04-structure.md +0 -19
- package/dist/steps/scan/05-quality.md +0 -18
- package/dist/steps/scan/06-complete.md +0 -49
- package/dist/steps/scan/manifest.yaml +0 -16
- package/dist/steps/verify/01-load-specs.md +0 -28
- package/dist/steps/verify/02-check-tasks.md +0 -1
- package/dist/steps/verify/03-check-design.md +0 -6
- package/dist/steps/verify/04-run-tests.md +0 -7
- package/dist/steps/verify/05-e2e-tests.md +0 -27
- package/dist/steps/verify/05b-e2e-fix.md +0 -33
- package/dist/steps/verify/06-code-quality.md +0 -25
- package/dist/steps/verify/07-lint-check.md +0 -27
- package/dist/steps/verify/08-output-report.md +0 -14
- package/dist/steps/verify/manifest.yaml +0 -22
- package/packages/dashboard/dist/assets/index-DGe8CqeP.css +0 -1
- package/src/derive.js +0 -147
- package/src/step.js +0 -543
package/src/setup.js
CHANGED
|
@@ -1,460 +1,398 @@
|
|
|
1
|
-
import { existsSync, readFileSync, writeFileSync, mkdirSync
|
|
2
|
-
import { join, dirname } from 'path';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
id: '
|
|
21
|
-
name: '
|
|
22
|
-
description: '
|
|
23
|
-
command: 'npx',
|
|
24
|
-
args: ['-
|
|
25
|
-
url: 'https://github.com/
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
id: '
|
|
29
|
-
name: '
|
|
30
|
-
description: '
|
|
31
|
-
command: 'npx',
|
|
32
|
-
args: ['
|
|
33
|
-
url: 'https://github.com/
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
id: '
|
|
37
|
-
name: '
|
|
38
|
-
description: '
|
|
39
|
-
command: 'npx',
|
|
40
|
-
args: ['
|
|
41
|
-
url: 'https://github.com/
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
console.log('');
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
name:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
console.log(
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
// ──
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
const selectedSkills = SKILLS.filter(s => selected.includes(`skill:${s.id}`));
|
|
400
|
-
|
|
401
|
-
if (selectedSkills.length > 0) {
|
|
402
|
-
// 跟 MCP 一样,选择安装到哪些 AI 工具
|
|
403
|
-
const skillTargets = availableTools.map(t => ({
|
|
404
|
-
name: t.tool,
|
|
405
|
-
value: t.key,
|
|
406
|
-
checked: true,
|
|
407
|
-
}));
|
|
408
|
-
|
|
409
|
-
const selectedTools = await checkbox({
|
|
410
|
-
message: 'Skill 安装到哪些 AI 工具?',
|
|
411
|
-
choices: skillTargets,
|
|
412
|
-
});
|
|
413
|
-
|
|
414
|
-
const targets = availableTools.filter(t => selectedTools.includes(t.key));
|
|
415
|
-
|
|
416
|
-
console.log('');
|
|
417
|
-
for (const { tool, path } of targets) {
|
|
418
|
-
const spinner = ora(`安装 Skills 到 ${tool}...`).start();
|
|
419
|
-
for (const skill of selectedSkills) {
|
|
420
|
-
try {
|
|
421
|
-
const targetDir = join(dir, dirname(path), 'skills', skill.target);
|
|
422
|
-
mkdirSync(targetDir, { recursive: true });
|
|
423
|
-
cpSync(skill.source, targetDir, { recursive: true });
|
|
424
|
-
spinner.succeed(`${tool} → ${dirname(path)}/skills/${skill.target}/SKILL.md`);
|
|
425
|
-
} catch (err) {
|
|
426
|
-
spinner.fail(`${skill.name} 安装失败: ${err.message}`);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
// ── 总结 ──
|
|
433
|
-
|
|
434
|
-
console.log('');
|
|
435
|
-
console.log(chalk.green(' ═══════════════════════════════════════'));
|
|
436
|
-
console.log(chalk.green(' ✅ 工具安装完成!'));
|
|
437
|
-
console.log(chalk.green(' ═══════════════════════════════════════'));
|
|
438
|
-
console.log('');
|
|
439
|
-
for (const mcp of selectedMcp) {
|
|
440
|
-
console.log(` 🔌 ${chalk.cyan(mcp.name)} — ${mcp.description}`);
|
|
441
|
-
console.log(chalk.dim(` ${mcp.url}`));
|
|
442
|
-
}
|
|
443
|
-
for (const db of selectedDb) {
|
|
444
|
-
console.log(` 🗄️ ${chalk.cyan(db.name)} — ${db.description}`);
|
|
445
|
-
console.log(chalk.dim(` ${db.url}`));
|
|
446
|
-
}
|
|
447
|
-
for (const g of selectedGlobal) {
|
|
448
|
-
console.log(` 🛠️ ${chalk.cyan(g.name)} — ${g.description}`);
|
|
449
|
-
console.log(chalk.dim(` ${g.url}`));
|
|
450
|
-
}
|
|
451
|
-
for (const s of selectedSkills) {
|
|
452
|
-
console.log(` 📚 ${chalk.cyan(s.name)} — ${s.description}`);
|
|
453
|
-
console.log(chalk.dim(` → ${s.target}/SKILL.md`));
|
|
454
|
-
}
|
|
455
|
-
console.log('');
|
|
456
|
-
if (selectedMcp.length > 0) {
|
|
457
|
-
console.log(chalk.dim(' 重启你的 AI 工具以使 MCP 配置生效。'));
|
|
458
|
-
}
|
|
459
|
-
console.log('');
|
|
460
|
-
}
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
2
|
+
import { join, dirname } from 'path';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import { checkbox, input } from '@inquirer/prompts';
|
|
7
|
+
|
|
8
|
+
// ── MCP 工具定义 ──
|
|
9
|
+
|
|
10
|
+
const MCP_TOOLS = [
|
|
11
|
+
{
|
|
12
|
+
id: 'context7',
|
|
13
|
+
name: 'Context7',
|
|
14
|
+
description: '查询最新库文档和 API 参考',
|
|
15
|
+
command: 'npx',
|
|
16
|
+
args: ['-y', '@upstash/context7-mcp@latest'],
|
|
17
|
+
url: 'https://github.com/upstash/context7-mcp',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'chrome-devtools',
|
|
21
|
+
name: 'Chrome DevTools MCP',
|
|
22
|
+
description: '浏览器自动化,支持 E2E 测试(需 Chrome 已运行)',
|
|
23
|
+
command: 'npx',
|
|
24
|
+
args: ['chrome-devtools-mcp@latest'],
|
|
25
|
+
url: 'https://github.com/ChromeDevTools/chrome-devtools-mcp',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'agent-browser',
|
|
29
|
+
name: 'Agent Browser (Vercel)',
|
|
30
|
+
description: 'Rust 原生浏览器 CLI,token 消耗极低,50+ 命令覆盖导航/表单/截图/网络',
|
|
31
|
+
command: 'npx',
|
|
32
|
+
args: ['@anthropic-ai/agent-browser@latest'],
|
|
33
|
+
url: 'https://github.com/vercel-labs/agent-browser',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'pinchtab',
|
|
37
|
+
name: 'PinchTab',
|
|
38
|
+
description: '12MB Go 二进制,零依赖,accessibility tree 极省 token,有 MCP 支持',
|
|
39
|
+
command: 'npx',
|
|
40
|
+
args: ['pinchtab-mcp@latest'],
|
|
41
|
+
url: 'https://github.com/pinchtab/pinchtab',
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
// ── 数据库 MCP 定义(需要连接信息)──
|
|
46
|
+
|
|
47
|
+
const DB_MCP_TOOLS = [
|
|
48
|
+
{
|
|
49
|
+
id: 'postgres',
|
|
50
|
+
name: 'PostgreSQL',
|
|
51
|
+
description: '只读访问 PostgreSQL 数据库',
|
|
52
|
+
command: 'npx',
|
|
53
|
+
args: ['-y', '@modelcontextprotocol/server-postgres'],
|
|
54
|
+
envTemplate: { POSTGRES_CONNECTION_STRING: 'postgresql://user:password@localhost:5432/dbname' },
|
|
55
|
+
url: 'https://github.com/modelcontextprotocol/servers/tree/main/src/postgres',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'sqlite',
|
|
59
|
+
name: 'SQLite',
|
|
60
|
+
description: '访问 SQLite 数据库文件',
|
|
61
|
+
command: 'npx',
|
|
62
|
+
args: ['-y', '@modelcontextprotocol/server-sqlite'],
|
|
63
|
+
envTemplate: { SQLITE_DB_PATH: './data.db' },
|
|
64
|
+
url: 'https://github.com/modelcontextprotocol/servers/tree/main/src/sqlite',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'mysql',
|
|
68
|
+
name: 'MySQL / MariaDB',
|
|
69
|
+
description: '访问 MySQL / MariaDB 数据库',
|
|
70
|
+
command: 'npx',
|
|
71
|
+
args: ['-y', '@nicobailon/mysql-mcp-server'],
|
|
72
|
+
envTemplate: { MYSQL_HOST: 'localhost', MYSQL_PORT: '3306', MYSQL_USER: 'root', MYSQL_PASSWORD: '', MYSQL_DATABASE: '' },
|
|
73
|
+
url: 'https://github.com/modelcontextprotocol/servers',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 'redis',
|
|
77
|
+
name: 'Redis',
|
|
78
|
+
description: '访问 Redis 数据库,查看缓存和键值数据',
|
|
79
|
+
command: 'npx',
|
|
80
|
+
args: ['-y', '@modelcontextprotocol/server-redis'],
|
|
81
|
+
envTemplate: { REDIS_URL: 'redis://localhost:6379' },
|
|
82
|
+
url: 'https://github.com/modelcontextprotocol/servers/tree/main/src/redis',
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
// ── 全局工具定义 ──
|
|
87
|
+
|
|
88
|
+
const GLOBAL_TOOLS = [
|
|
89
|
+
{
|
|
90
|
+
id: 'playwright',
|
|
91
|
+
name: 'Playwright',
|
|
92
|
+
description: 'E2E 测试框架,支持浏览器自动化测试',
|
|
93
|
+
checkCommand: 'npx playwright --version',
|
|
94
|
+
installCommand: 'npm install -g @playwright/test && npx playwright install chromium',
|
|
95
|
+
url: 'https://playwright.dev',
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
// ── MCP 配置文件路径 ──
|
|
100
|
+
|
|
101
|
+
const MCP_CONFIG_PATHS = [
|
|
102
|
+
{ tool: 'Claude Code', path: '.claude/mcp.json', key: 'claude' },
|
|
103
|
+
{ tool: 'Cursor', path: '.cursor/mcp.json', key: 'cursor' },
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
// ── 工具函数 ──
|
|
107
|
+
|
|
108
|
+
function readMcpConfig(dir, configPath) {
|
|
109
|
+
const fullPath = join(dir, configPath);
|
|
110
|
+
if (!existsSync(fullPath)) return null;
|
|
111
|
+
try {
|
|
112
|
+
return JSON.parse(readFileSync(fullPath, 'utf8'));
|
|
113
|
+
} catch {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function writeMcpConfig(dir, configPath, config) {
|
|
119
|
+
const fullPath = join(dir, configPath);
|
|
120
|
+
mkdirSync(dirname(fullPath), { recursive: true });
|
|
121
|
+
writeFileSync(fullPath, JSON.stringify(config, null, 2) + '\n');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function installMcp(config, mcpTool) {
|
|
125
|
+
if (!config.mcpServers) config.mcpServers = {};
|
|
126
|
+
const entry = {
|
|
127
|
+
command: mcpTool.command,
|
|
128
|
+
args: mcpTool.args,
|
|
129
|
+
};
|
|
130
|
+
if (mcpTool.env) entry.env = mcpTool.env;
|
|
131
|
+
config.mcpServers[mcpTool.id] = entry;
|
|
132
|
+
return config;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function hasMcpInstalled(config, mcpId) {
|
|
136
|
+
return config?.mcpServers?.[mcpId] != null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// ── 命令实现 ──
|
|
140
|
+
|
|
141
|
+
export async function cmdSetup(dir, options = {}) {
|
|
142
|
+
const { json } = options;
|
|
143
|
+
|
|
144
|
+
// 检查哪些 AI 工具有配置文件
|
|
145
|
+
const availableTools = MCP_CONFIG_PATHS.filter(({ path }) => {
|
|
146
|
+
return existsSync(join(dir, path));
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// --list 模式:只查看状态(不依赖 AI 工具配置)
|
|
150
|
+
if (options.list) {
|
|
151
|
+
const results = {};
|
|
152
|
+
|
|
153
|
+
// MCP 状态
|
|
154
|
+
for (const { tool, path } of availableTools) {
|
|
155
|
+
const config = readMcpConfig(dir, path);
|
|
156
|
+
const mcpStatus = {};
|
|
157
|
+
for (const mcp of MCP_TOOLS) {
|
|
158
|
+
mcpStatus[mcp.id] = hasMcpInstalled(config, mcp.id);
|
|
159
|
+
}
|
|
160
|
+
for (const db of DB_MCP_TOOLS) {
|
|
161
|
+
mcpStatus[db.id] = hasMcpInstalled(config, db.id);
|
|
162
|
+
}
|
|
163
|
+
results[tool] = { configPath: path, mcp: mcpStatus };
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// 全局工具状态
|
|
167
|
+
results['全局工具'] = {};
|
|
168
|
+
for (const g of GLOBAL_TOOLS) {
|
|
169
|
+
try {
|
|
170
|
+
execSync(g.checkCommand, { stdio: 'pipe', encoding: 'utf8' });
|
|
171
|
+
results['全局工具'][g.id] = true;
|
|
172
|
+
} catch {
|
|
173
|
+
results['全局工具'][g.id] = false;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (json) {
|
|
178
|
+
console.log(JSON.stringify(results, null, 2));
|
|
179
|
+
} else {
|
|
180
|
+
console.log('');
|
|
181
|
+
for (const [tool, data] of Object.entries(results)) {
|
|
182
|
+
if (data.mcp) {
|
|
183
|
+
console.log(chalk.bold(`📋 ${tool} (${data.configPath})`));
|
|
184
|
+
for (const mcp of MCP_TOOLS) {
|
|
185
|
+
const status = data.mcp[mcp.id] ? chalk.green('✅') : chalk.gray('⬜');
|
|
186
|
+
console.log(` ${status} ${mcp.name} — ${mcp.description}`);
|
|
187
|
+
}
|
|
188
|
+
for (const db of DB_MCP_TOOLS) {
|
|
189
|
+
const status = data.mcp[db.id] ? chalk.green('✅') : chalk.gray('⬜');
|
|
190
|
+
console.log(` ${status} ${db.name} — ${db.description}`);
|
|
191
|
+
}
|
|
192
|
+
} else {
|
|
193
|
+
console.log(chalk.bold(`🛠️ ${tool}`));
|
|
194
|
+
for (const g of GLOBAL_TOOLS) {
|
|
195
|
+
const status = data[g.id] ? chalk.green('✅') : chalk.gray('⬜');
|
|
196
|
+
console.log(` ${status} ${g.name} — ${g.description}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
console.log('');
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// 非交互模式(或没有 AI 工具但有全局工具要装)
|
|
206
|
+
if (!process.stdin.isTTY) {
|
|
207
|
+
if (json) {
|
|
208
|
+
console.log(JSON.stringify({ message: '交互模式需要 TTY,请运行 sillyspec setup' }));
|
|
209
|
+
} else {
|
|
210
|
+
console.log(chalk.yellow('⚠️ 请在交互式终端运行 sillyspec setup'));
|
|
211
|
+
}
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// ── 交互式安装 ──
|
|
216
|
+
|
|
217
|
+
console.log('');
|
|
218
|
+
console.log(chalk.cyan('🔧 SillySpec Setup — 增强工具安装'));
|
|
219
|
+
console.log('');
|
|
220
|
+
|
|
221
|
+
if (availableTools.length === 0) {
|
|
222
|
+
console.log(chalk.dim(' 未检测到 AI 工具配置文件,MCP 工具将跳过。'));
|
|
223
|
+
console.log(chalk.dim(' 请先运行 sillyspec init 初始化项目。'));
|
|
224
|
+
console.log('');
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
console.log(' 选择要安装的工具(已安装的会跳过):');
|
|
228
|
+
console.log('');
|
|
229
|
+
|
|
230
|
+
// ── MCP 工具选择 ──
|
|
231
|
+
|
|
232
|
+
const installedSet = new Set();
|
|
233
|
+
for (const { path } of availableTools) {
|
|
234
|
+
const config = readMcpConfig(dir, path);
|
|
235
|
+
for (const mcp of MCP_TOOLS) {
|
|
236
|
+
if (hasMcpInstalled(config, mcp.id)) installedSet.add(mcp.id);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const mcpChoices = MCP_TOOLS.filter(m => !installedSet.has(m.id)).map(m => ({
|
|
241
|
+
name: `${m.name} — ${m.description}`,
|
|
242
|
+
value: `mcp:${m.id}`,
|
|
243
|
+
checked: false,
|
|
244
|
+
}));
|
|
245
|
+
|
|
246
|
+
// ── 全局工具选择 ──
|
|
247
|
+
|
|
248
|
+
const globalInstalled = new Set();
|
|
249
|
+
for (const tool of GLOBAL_TOOLS) {
|
|
250
|
+
try {
|
|
251
|
+
execSync(tool.checkCommand, { stdio: 'pipe', encoding: 'utf8' });
|
|
252
|
+
globalInstalled.add(tool.id);
|
|
253
|
+
} catch {}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const globalChoices = GLOBAL_TOOLS.filter(t => !globalInstalled.has(t.id)).map(t => ({
|
|
257
|
+
name: `${t.name} — ${t.description}(全局安装)`,
|
|
258
|
+
value: `global:${t.id}`,
|
|
259
|
+
checked: false,
|
|
260
|
+
}));
|
|
261
|
+
|
|
262
|
+
// ── 数据库 MCP 选择 ──
|
|
263
|
+
|
|
264
|
+
const dbInstalled = new Set();
|
|
265
|
+
for (const { path } of availableTools) {
|
|
266
|
+
const config = readMcpConfig(dir, path);
|
|
267
|
+
for (const db of DB_MCP_TOOLS) {
|
|
268
|
+
if (hasMcpInstalled(config, db.id)) dbInstalled.add(db.id);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const dbChoices = DB_MCP_TOOLS.filter(d => !dbInstalled.has(d.id)).map(d => ({
|
|
273
|
+
name: `${d.name} — ${d.description}(需要连接信息)`,
|
|
274
|
+
value: `db:${d.id}`,
|
|
275
|
+
checked: false,
|
|
276
|
+
}));
|
|
277
|
+
|
|
278
|
+
const allChoices = [
|
|
279
|
+
...mcpChoices.length > 0 ? [{ name: chalk.bold('── MCP 工具(AI 能力增强)──'), value: '_mcp_header', disabled: true }] : [],
|
|
280
|
+
...mcpChoices,
|
|
281
|
+
...dbChoices.length > 0 ? [{ name: chalk.bold('── 数据库 MCP ──'), value: '_db_header', disabled: true }] : [],
|
|
282
|
+
...dbChoices,
|
|
283
|
+
...globalChoices.length > 0 ? [{ name: chalk.bold('── 全局工具 ──'), value: '_global_header', disabled: true }] : [],
|
|
284
|
+
...globalChoices,
|
|
285
|
+
];
|
|
286
|
+
|
|
287
|
+
if (allChoices.length === 0) {
|
|
288
|
+
console.log(chalk.green(' ✅ 所有推荐工具已安装!'));
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const selected = await checkbox({
|
|
293
|
+
message: '选择要安装的工具',
|
|
294
|
+
choices: allChoices,
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
if (selected.length === 0) {
|
|
298
|
+
console.log(chalk.dim(' 未选择任何工具,退出。'));
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const selectedMcp = MCP_TOOLS.filter(m => selected.includes(`mcp:${m.id}`));
|
|
303
|
+
const selectedDb = DB_MCP_TOOLS.filter(d => selected.includes(`db:${d.id}`));
|
|
304
|
+
const selectedGlobal = GLOBAL_TOOLS.filter(t => selected.includes(`global:${t.id}`));
|
|
305
|
+
|
|
306
|
+
// ── 收集数据库连接信息 ──
|
|
307
|
+
|
|
308
|
+
if (selectedDb.length > 0) {
|
|
309
|
+
console.log('');
|
|
310
|
+
console.log(chalk.yellow('📡 数据库连接配置'));
|
|
311
|
+
console.log('');
|
|
312
|
+
|
|
313
|
+
for (const db of selectedDb) {
|
|
314
|
+
console.log(chalk.cyan(` ${db.name}:`));
|
|
315
|
+
const dbWithEnv = { ...db, env: {} };
|
|
316
|
+
for (const [key, placeholder] of Object.entries(db.envTemplate)) {
|
|
317
|
+
const value = await input({
|
|
318
|
+
message: ` ${key}`,
|
|
319
|
+
default: placeholder,
|
|
320
|
+
});
|
|
321
|
+
dbWithEnv.env[key] = value;
|
|
322
|
+
}
|
|
323
|
+
// 用带 env 的版本替换
|
|
324
|
+
const idx = selectedDb.indexOf(db);
|
|
325
|
+
selectedDb[idx] = dbWithEnv;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// ── 安装 MCP 工具 ──
|
|
330
|
+
|
|
331
|
+
const allMcp = [...selectedMcp, ...selectedDb];
|
|
332
|
+
|
|
333
|
+
if (allMcp.length > 0) {
|
|
334
|
+
const toolChoices = availableTools.map(t => ({
|
|
335
|
+
name: t.tool,
|
|
336
|
+
value: t.key,
|
|
337
|
+
checked: true,
|
|
338
|
+
}));
|
|
339
|
+
|
|
340
|
+
const targetTools = await checkbox({
|
|
341
|
+
message: 'MCP 工具安装到哪些 AI 工具?',
|
|
342
|
+
choices: toolChoices,
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
const targets = availableTools.filter(t => targetTools.includes(t.key));
|
|
346
|
+
|
|
347
|
+
console.log('');
|
|
348
|
+
for (const { tool, path } of targets) {
|
|
349
|
+
const spinner = ora(`安装 MCP 到 ${tool}...`).start();
|
|
350
|
+
let config = readMcpConfig(dir, path) || { mcpServers: {} };
|
|
351
|
+
for (const mcp of allMcp) {
|
|
352
|
+
config = installMcp(config, mcp);
|
|
353
|
+
}
|
|
354
|
+
writeMcpConfig(dir, path, config);
|
|
355
|
+
spinner.succeed(`${tool} MCP 完成 (${allMcp.length} 个工具)`);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// ── 安装全局工具 ──
|
|
360
|
+
|
|
361
|
+
if (selectedGlobal.length > 0) {
|
|
362
|
+
console.log('');
|
|
363
|
+
for (const tool of selectedGlobal) {
|
|
364
|
+
const spinner = ora(`安装 ${tool.name}...`).start();
|
|
365
|
+
try {
|
|
366
|
+
execSync(tool.installCommand, { stdio: 'pipe', encoding: 'utf8', timeout: 120000 });
|
|
367
|
+
spinner.succeed(`${tool.name} 安装完成`);
|
|
368
|
+
} catch (err) {
|
|
369
|
+
spinner.fail(`${tool.name} 安装失败: ${err.message}`);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// ── 总结 ──
|
|
375
|
+
|
|
376
|
+
console.log('');
|
|
377
|
+
console.log(chalk.green(' ═══════════════════════════════════════'));
|
|
378
|
+
console.log(chalk.green(' ✅ 工具安装完成!'));
|
|
379
|
+
console.log(chalk.green(' ═══════════════════════════════════════'));
|
|
380
|
+
console.log('');
|
|
381
|
+
for (const mcp of selectedMcp) {
|
|
382
|
+
console.log(` 🔌 ${chalk.cyan(mcp.name)} — ${mcp.description}`);
|
|
383
|
+
console.log(chalk.dim(` ${mcp.url}`));
|
|
384
|
+
}
|
|
385
|
+
for (const db of selectedDb) {
|
|
386
|
+
console.log(` 🗄️ ${chalk.cyan(db.name)} — ${db.description}`);
|
|
387
|
+
console.log(chalk.dim(` ${db.url}`));
|
|
388
|
+
}
|
|
389
|
+
for (const g of selectedGlobal) {
|
|
390
|
+
console.log(` 🛠️ ${chalk.cyan(g.name)} — ${g.description}`);
|
|
391
|
+
console.log(chalk.dim(` ${g.url}`));
|
|
392
|
+
}
|
|
393
|
+
console.log('');
|
|
394
|
+
if (selectedMcp.length > 0) {
|
|
395
|
+
console.log(chalk.dim(' 重启你的 AI 工具以使 MCP 配置生效。'));
|
|
396
|
+
}
|
|
397
|
+
console.log('');
|
|
398
|
+
}
|