forma-dsl-mcp 0.1.4 → 0.1.6

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/reference.js +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forma-dsl-mcp",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "A stdio MCP server that knows the forma DSL and writes .forma documents that render.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@modelcontextprotocol/sdk": "^1.31.0",
49
- "forma-dsl": "^0.1.4",
49
+ "forma-dsl": "^0.1.6",
50
50
  "zod": "^4.1.13"
51
51
  }
52
52
  }
package/src/reference.js CHANGED
@@ -130,8 +130,13 @@ export async function searchReference(query, limit = 6) {
130
130
  /** @type {Array<{ score: number, path: string, title: string, heading: string, snippet: string }>} */
131
131
  const hits = [];
132
132
 
133
- for (const page of PAGES) {
134
- const markdown = await readFile(join(ROOT, page.path), 'utf8');
133
+ // Every page is read on every search, so the reads are independent work and belong
134
+ // together: awaiting them one at a time made a search wait on 28 round trips for nothing.
135
+ const pages = await Promise.all(
136
+ PAGES.map(async (page) => ({ page, markdown: await readFile(join(ROOT, page.path), 'utf8') })),
137
+ );
138
+
139
+ for (const { page, markdown } of pages) {
135
140
  const lower = markdown.toLowerCase();
136
141
  if (!terms.every((term) => lower.includes(term))) continue;
137
142