Skip to main content
Glama

Spec Workflow MCP

by kingkongshot
confirmationStatus.ts2.63 kB
/** * Confirmation status management */ import { readFileSync, writeFileSync, existsSync } from 'fs'; import { join } from 'path'; export interface ConfirmationStatus { requirements: boolean; design: boolean; tasks: boolean; } export interface SkipStatus { requirements: boolean; design: boolean; tasks: boolean; } export interface WorkflowConfirmations { confirmed: ConfirmationStatus; skipped: SkipStatus; } const CONFIRMATION_FILE = '.workflow-confirmations.json'; export function getWorkflowConfirmations(path: string): WorkflowConfirmations { const filePath = join(path, CONFIRMATION_FILE); const defaultStatus: WorkflowConfirmations = { confirmed: { requirements: false, design: false, tasks: false }, skipped: { requirements: false, design: false, tasks: false } }; if (!existsSync(filePath)) { return defaultStatus; } try { const content = readFileSync(filePath, 'utf-8'); const parsed = JSON.parse(content); // Compatible with old format if (!parsed.confirmed && !parsed.skipped) { return { confirmed: parsed, skipped: { requirements: false, design: false, tasks: false } }; } return parsed; } catch { return defaultStatus; } } // Keep old function for compatibility with existing code export function getConfirmationStatus(path: string): ConfirmationStatus { const confirmations = getWorkflowConfirmations(path); return confirmations.confirmed; } export function updateStageConfirmation( path: string, stage: keyof ConfirmationStatus, confirmed: boolean ): void { const confirmations = getWorkflowConfirmations(path); confirmations.confirmed[stage] = confirmed; const filePath = join(path, CONFIRMATION_FILE); writeFileSync(filePath, JSON.stringify(confirmations, null, 2)); } export function updateStageSkipped( path: string, stage: keyof SkipStatus, skipped: boolean ): void { const confirmations = getWorkflowConfirmations(path); confirmations.skipped[stage] = skipped; const filePath = join(path, CONFIRMATION_FILE); writeFileSync(filePath, JSON.stringify(confirmations, null, 2)); } export function isStageConfirmed( path: string, stage: keyof ConfirmationStatus ): boolean { const confirmations = getWorkflowConfirmations(path); return confirmations.confirmed[stage]; } export function isStageSkipped( path: string, stage: keyof SkipStatus ): boolean { const confirmations = getWorkflowConfirmations(path); return confirmations.skipped[stage]; }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kingkongshot/specs-workflow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server