Commit 627bb33
committed
feat(installer): configure mind-map MCP in OpenCode + fix silent-failure bug
OpenCode (https://opencode.ai) is now detected and configured alongside
Claude / Copilot / VS Code / Cursor. Its MCP shape differs:
- top-level key 'mcp' (not 'mcpServers')
- command is a JSON array (not string + separate args)
- 'enabled': true is expected
- schema URL pointer
A new configure_opencode() function emits and merges this shape. Detection
follows the same pattern used for other clients: the config file already
exists, the config directory has been created, or the 'opencode' binary
is on PATH. On Linux/macOS we write ~/.config/opencode/opencode.json; on
Windows %APPDATA%\opencode\opencode.json.
SKILL.md gets dropped into the new client's primary skill discovery path
too (~/.config/opencode/skills/mind-map/SKILL.md and
%APPDATA%\opencode\skills\mind-map\), although OpenCode already finds
SKILL.md via its ~/.claude/skills/ and ~/.agents/skills/ fallback paths
which the installer was already writing.
Also fixes a pre-existing silent-failure bug in configure_mcp_client: the
embedded python3 block interpolated the JSON entry string directly into
Python source via shell quoting. For any existing config file (i.e. any
real-world install where Claude/Copilot/Cursor/VS Code is already set
up), Python raised SyntaxError on the embedded double-quotes, the error
was redirected to /dev/null, and the script reported '! could not
update' with no diagnostics. The fix passes the JSON entry via an
environment variable instead, which sidesteps the quoting altogether.
Verified end-to-end in the devcontainer against both fresh-file and
merge-into-existing scenarios for both the OpenCode and Claude shapes.1 parent 2e677a5 commit 627bb33
2 files changed
Lines changed: 130 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 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 | + | |
291 | 348 | | |
292 | 349 | | |
293 | 350 | | |
| |||
305 | 362 | | |
306 | 363 | | |
307 | 364 | | |
308 | | - | |
| 365 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
265 | 266 | | |
266 | 267 | | |
267 | 268 | | |
268 | | - | |
269 | | - | |
270 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
271 | 276 | | |
272 | 277 | | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
277 | 281 | | |
278 | | - | |
279 | | - | |
| 282 | + | |
| 283 | + | |
280 | 284 | | |
281 | 285 | | |
282 | 286 | | |
283 | 287 | | |
284 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
285 | 331 | | |
286 | 332 | | |
287 | 333 | | |
| |||
308 | 354 | | |
309 | 355 | | |
310 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
311 | 373 | | |
312 | 374 | | |
313 | 375 | | |
| |||
321 | 383 | | |
322 | 384 | | |
323 | 385 | | |
324 | | - | |
| 386 | + | |
325 | 387 | | |
0 commit comments