UNPKG

@debugmcp/mcp-debugger

Version:

Run-time step-through debugging for LLM agents.

36 lines (35 loc) 1.28 kB
/** * Message parsing and validation utilities for DAP Proxy * Pure functions with no side effects for easy testing */ import { ParentCommand, ProxyInitPayload, DapCommandPayload, TerminatePayload } from './dap-proxy-interfaces.js'; export declare class MessageParser { /** * Parse and validate a command from the parent process * @throws {Error} if the message is invalid */ static parseCommand(message: unknown): ParentCommand; /** * Validate and type-guard an init payload * @throws {Error} if validation fails */ static validateInitPayload(payload: unknown): ProxyInitPayload; /** * Validate and type-guard a DAP command payload * @throws {Error} if validation fails */ static validateDapPayload(payload: unknown): DapCommandPayload; /** * Validate and type-guard a terminate payload * @throws {Error} if validation fails */ static validateTerminatePayload(payload: unknown): TerminatePayload; /** * Helper to check if a message is a string that needs parsing */ static isStringMessage(message: unknown): message is string; /** * Helper to safely extract error message from unknown error type */ static getErrorMessage(error: unknown): string; }