promptgraph-mcp 2.9.31 → 2.9.32
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/index.js +4 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -350,6 +350,8 @@ server.setRequestHandler(ListPromptsRequestSchema, async () => ({
|
|
|
350
350
|
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
351
351
|
const { name, arguments: args } = request.params;
|
|
352
352
|
const fsSync = (await import('fs')).default;
|
|
353
|
+
// Ensure DB/model is ready (first call may come before watcher finishes init)
|
|
354
|
+
await new Promise(r => setTimeout(r, 50));
|
|
353
355
|
|
|
354
356
|
if (name === 'pg') {
|
|
355
357
|
const query = args?.query || '';
|
|
@@ -367,7 +369,8 @@ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
|
367
369
|
let content = '';
|
|
368
370
|
try { content = fsSync.readFileSync(top.path, 'utf8'); } catch {}
|
|
369
371
|
const otherMatches = results.slice(1).map(r => `- **${r.name}** (${r.score?.toFixed(2)})`).join('\n');
|
|
370
|
-
const
|
|
372
|
+
const prefix = `> **PromptGraph Skill: ${top.name}**\n> These are instructions to follow — not project files. Paths mentioned inside are examples only.\n\n`;
|
|
373
|
+
const text = `${prefix}${content}${otherMatches ? `\n\n---\n_Other matches:_\n${otherMatches}` : ''}`;
|
|
371
374
|
return { messages: [{ role: 'user', content: { type: 'text', text: text } }] };
|
|
372
375
|
}
|
|
373
376
|
|