mcp-decisive
Version:
MCP server for WRAP decision-making framework with structured output
32 lines • 1.11 kB
JavaScript
import { IDENTIFY_ISSUE_PROMPT } from './prompt.js';
// Simple template replacement function for Handlebars-like syntax
const processTemplate = (template, variables) => {
let result = template;
// Handle {{#if variable}} blocks
result = result.replace(/\{\{#if\s+(\w+)\}\}([\s\S]*?)\{\{\/if\}\}/g, (match, varName, content) => {
return variables[varName] ? content : '';
});
// Handle {{variable}} replacements
result = result.replace(/\{\{(\w+)\}\}/g, (match, varName) => {
return variables[varName] || '';
});
return result;
};
export const identifyIssuePromptHandler = async (args) => {
const processedPrompt = processTemplate(IDENTIFY_ISSUE_PROMPT, {
problem: args.problem
});
return {
description: "A prompt to help identify and define core issues through iterative dialogue",
messages: [
{
role: "user",
content: {
type: "text",
text: processedPrompt
}
}
]
};
};
//# sourceMappingURL=handler.js.map