vibe-splain 1.0.2 → 1.0.3

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/dist/index.js CHANGED
@@ -84,7 +84,7 @@ async function installCommand() {
84
84
  // dist/mcp/server.js
85
85
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
86
86
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
87
- import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
87
+ import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema } from "@modelcontextprotocol/sdk/types.js";
88
88
 
89
89
  // ../brain/dist/scanner.js
90
90
  import Parser from "web-tree-sitter";
@@ -845,7 +845,32 @@ var TOOL_HANDLERS = {
845
845
  async function startMCPServer() {
846
846
  await initParser();
847
847
  console.error("[vibe-splain] Tree-Sitter parser initialized");
848
- const server = new Server({ name: "vibe-splain", version: "1.0.0" }, { capabilities: { tools: {} } });
848
+ const server = new Server({ name: "vibe-splain", version: "1.0.0" }, { capabilities: { tools: {}, prompts: {} } });
849
+ server.setRequestHandler(ListPromptsRequestSchema, async () => ({
850
+ prompts: [
851
+ {
852
+ name: "build_dossier",
853
+ description: "Build a full architectural dossier using vibe-splain (replaces the need to copy-paste the README prompt)"
854
+ }
855
+ ]
856
+ }));
857
+ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
858
+ if (request.params.name !== "build_dossier") {
859
+ throw new Error(`Unknown prompt: ${request.params.name}`);
860
+ }
861
+ return {
862
+ description: "Build a full architectural dossier",
863
+ messages: [
864
+ {
865
+ role: "user",
866
+ content: {
867
+ type: "text",
868
+ text: "Use the vibe-splain MCP tools to build a full architectural dossier for this project. Call scan_project first. Then for each high-gravity file, call get_file_context to read the source, synthesize a 3-5 sentence narrative explaining WHY the code exists, and call write_decision_card to persist it. Include Mermaid diagrams where they help explain data flow. When you're done, share the exact file:// UI link returned by the tool so I can view the dossier in my browser. Do NOT invent a localhost URL."
869
+ }
870
+ }
871
+ ]
872
+ };
873
+ });
849
874
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
850
875
  tools: ALL_TOOLS
851
876
  }));
@@ -1,6 +1,6 @@
1
1
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
2
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
- import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
3
+ import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
4
4
  import { initParser } from '@vibe-splain/brain';
5
5
  import { handleScanProject, scanProjectTool } from './tools/scan_project.js';
6
6
  import { handleGetFileContext, getFileContextTool } from './tools/get_file_context.js';
@@ -34,7 +34,33 @@ export async function startMCPServer() {
34
34
  // Initialize Tree-Sitter WASM once at startup
35
35
  await initParser();
36
36
  console.error('[vibe-splain] Tree-Sitter parser initialized');
37
- const server = new Server({ name: 'vibe-splain', version: '1.0.0' }, { capabilities: { tools: {} } });
37
+ const server = new Server({ name: 'vibe-splain', version: '1.0.0' }, { capabilities: { tools: {}, prompts: {} } });
38
+ // Register prompts
39
+ server.setRequestHandler(ListPromptsRequestSchema, async () => ({
40
+ prompts: [
41
+ {
42
+ name: 'build_dossier',
43
+ description: 'Build a full architectural dossier using vibe-splain (replaces the need to copy-paste the README prompt)',
44
+ }
45
+ ]
46
+ }));
47
+ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
48
+ if (request.params.name !== 'build_dossier') {
49
+ throw new Error(`Unknown prompt: ${request.params.name}`);
50
+ }
51
+ return {
52
+ description: 'Build a full architectural dossier',
53
+ messages: [
54
+ {
55
+ role: 'user',
56
+ content: {
57
+ type: 'text',
58
+ text: 'Use the vibe-splain MCP tools to build a full architectural dossier for this project. Call scan_project first. Then for each high-gravity file, call get_file_context to read the source, synthesize a 3-5 sentence narrative explaining WHY the code exists, and call write_decision_card to persist it. Include Mermaid diagrams where they help explain data flow. When you\'re done, share the exact file:// UI link returned by the tool so I can view the dossier in my browser. Do NOT invent a localhost URL.',
59
+ }
60
+ }
61
+ ]
62
+ };
63
+ });
38
64
  // Register tool listing
39
65
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
40
66
  tools: ALL_TOOLS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-splain",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Architectural dossier engine for vibe-coded projects. Runs as an MCP server inside your coding agent.",
5
5
  "type": "module",
6
6
  "license": "MIT",