Skip to content

refactor(cli): expose core runners for MCP (Phase 0) - #130

Merged
itsflaid merged 1 commit into
mainfrom
feat/mcp-phase-0-refactor
Oct 29, 2026
Merged

itsflaid merged 1 commit into
mainfrom
feat/mcp-phase-0-refactor

Conversation

@itsflaid

Copy link
Copy Markdown
Owner

Ringkasan

Fase 0 dari rencana devmap mcp: membuat logika inti map/flow/explain bisa dipanggil dari front-end lain (mis. MCP server) tanpa efek samping CLI. Tidak ada perubahan perilaku CLI.

Perubahan

  • Export runMap, runFlow, runExplain
  • MapOptions/FlowOptions: opsi write (default true) untuk melewati penulisan .devmap/*
  • FlowOptions: opsi narrate (default true); false = tanpa AI, tanpa load config
  • MapResult.writtenPaths jadi opsional (tidak ada saat write:false)
  • cache/snapshot.ts: helper baru loadSnapshot() → { snapshot, stale }
  • Tes baru test/core-api.test.ts (6 tes): jalur senyap, tanpa tulis disk, offline

Catatan

  • Output senyap untuk MCP didapat dengan membungkus pemanggilan di withJsonOutput (semua output.* sudah no-op di mode itu). Note "AI flow narration is not configured" sengaja tidak dipindah, supaya output CLI tetap identik.
  • Hanya output.json yang menulis ke stdout.

Verifikasi

  • pnpm run test:types ✅
  • pnpm run test:unit ✅ 439/439

Fase berikutnya (MVP read-only devmap mcp) di PR terpisah.


Generated by Claude Code

…-ends

Groundwork for an MCP server (devmap mcp). No behavior change for the CLI.

- export runMap, runFlow, runExplain
- MapOptions/FlowOptions: add `write` (default true) to skip writing .devmap/*
- FlowOptions: add `narrate` (default true) to skip AI entirely
- MapResult.writtenPaths is optional (absent when write:false)
- cache/snapshot: add loadSnapshot() returning { snapshot, stale }
- add core-api tests (silent, write-free, offline paths)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AgTNRXcqugxRyJfMKL4AJ2
@vercel

vercel Bot commented Oct 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
devmap-web Skipped Skipped Oct 29, 2026 8:17am UTC

@github-actions

Copy link
Copy Markdown

✅ Welcome ke DevMap!

Terima kasih sudah buat PR. Pastikan checklist ini terpenuhi sebelum review:

  • devmap doctor lolos (tanpa error)
  • Test pnpm test:cli lolos (semua pass)
  • New commands diupdate di docs/commands.md
  • Tidak ada console.log di command files
  • Registry terms sesuai standar (baca docs/guide/05-signal-registry.md)
  • Code style match dengan CONTRIBUTING.md

CI akan jalan otomatis pada setiap update. Kalau gagal, akan muncul link run di komentar ini.

Kalau DevMap membantu, tolong star ya: https://github.com/itsflaid/devmap

Terima kasih kontribusinya! 🙏

@itsflaid
itsflaid merged commit e9517de into main Oct 29, 2026
3 checks passed
@itsflaid
itsflaid deleted the feat/mcp-phase-0-refactor branch October 29, 2026 08:19

This branch was previously deployed

1 inactive deployment
Preview — 1bbea074 Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants