11import { readFileSync , existsSync } from "fs" ;
22import { join , dirname } from "path" ;
3+ import { uiMap } from "./uiMap.js" ;
34
45/**
56 * Get the default UI dist path by finding the package root.
@@ -19,15 +20,6 @@ function getDefaultUIDistPath(): string {
1920 }
2021}
2122
22- /**
23- * Mapping from tool names to their bundled UI HTML file names
24- * Tool names use kebab-case (e.g., 'list-databases')
25- * HTML files use PascalCase (e.g., 'ListDatabases.html')
26- */
27- const TOOL_TO_UI_FILE : Record < string , string > = {
28- "list-databases" : "ListDatabases.html" ,
29- } ;
30-
3123/**
3224 * UI Registry that manages bundled UI HTML strings for tools.
3325 *
@@ -75,7 +67,7 @@ export class UIRegistry {
7567 * @param toolName The name of the tool
7668 */
7769 has ( toolName : string ) : boolean {
78- return this . overrides . has ( toolName ) || toolName in TOOL_TO_UI_FILE ;
70+ return this . overrides . has ( toolName ) || toolName in uiMap ;
7971 }
8072
8173 /**
@@ -91,7 +83,7 @@ export class UIRegistry {
9183 }
9284
9385 // Check if we have a mapping for this tool
94- const htmlFileName = TOOL_TO_UI_FILE [ toolName ] ;
86+ const htmlFileName = uiMap [ toolName ] ;
9587 if ( ! htmlFileName ) {
9688 return undefined ;
9789 }
@@ -128,7 +120,7 @@ export class UIRegistry {
128120 * Get all registered tool names (both overrides and defaults)
129121 */
130122 getRegisteredTools ( ) : string [ ] {
131- const tools = new Set < string > ( [ ...this . overrides . keys ( ) , ...Object . keys ( TOOL_TO_UI_FILE ) ] ) ;
123+ const tools = new Set < string > ( [ ...this . overrides . keys ( ) , ...Object . keys ( uiMap ) ] ) ;
132124 return Array . from ( tools ) ;
133125 }
134126}
0 commit comments