Location: universal-refiner/src/core/
The core module handles the MCP server lifecycle, tool registration, configuration management, and the visual dashboard.
- server.ts: The entry point for the MCP server. Registers all tools and dispatches to specialists.
- config.ts: Manages global and project-specific settings.
- dashboard.ts: Backend for the local Command Center UI.
- blackboard.ts: Shared state for active agent intents.
- logger.ts: Runtime logging system.
- Tool Registration: All new tools must be registered in the
setupToolHandlersmethod ofPromptRefinerServer. - Output Logging: Agents MUST use
record_agent_outputto close the loop on refined prompts using the injectedPROMPT_ID. - Sampling Logic: Always check for
samplingUnavailableReasonbefore attempting LLM sampling. - Error Handling: Use
McpErrorfor server-side failures to ensure compatible client responses. - Dashboard Updates: Important events should be pushed to
CommandCenterDashboard.log()for real-time visibility.