/** * tool_registry.js - Centralized Tool Catalog for Anomalous Model Browser * * Provides stable IDs, display keys, icons, and metadata for both * the Toolbox catalog and the customizable Shortcut Bar. */ export const TOOL_ICONS = Object.freeze({ TOOLBOX: ``, SCAN: ``, DOCTOR: ``, ASSISTANT: ``, MATERIALS: ``, SETTINGS: ``, TRANSFER: ``, STUDIO: ``, TRANSLATOR: ``, SOURCES: ``, NOTEBOOK: ``, }); /** * Fixed non-movable anchors: * - Toolbox (left end) * - Settings (right end) */ export const FIXED_ANCHORS = Object.freeze({ TOOLBOX: Object.freeze({ id: 'toolbox', domId: 'anomalous-toolbox-btn', labelKey: 'actionTools', nameKey: 'sidebarToolbox', hintKey: 'actionToolsHint', icon: TOOL_ICONS.TOOLBOX, isAnchor: true, }), SETTINGS: Object.freeze({ id: 'settings', domId: 'anomalous-global-settings-btn', labelKey: 'actionSettings', nameKey: 'sidebarSettings', hintKey: 'actionSettingsHint', icon: TOOL_ICONS.SETTINGS, isAnchor: true, }), }); /** * All customizable tools available in the Toolbox catalog * that can be pinned to the Shortcut Bar (up to 4 items). */ export const CATALOG_TOOLS = Object.freeze([ Object.freeze({ id: 'scan', domId: 'anomalous-scan-btn', labelKey: 'actionScan', nameKey: 'sidebarScanWizard', hintKey: 'actionScanHint', icon: TOOL_ICONS.SCAN, isPinnedDefault: true, }), Object.freeze({ id: 'doctor', domId: 'anomalous-doctor-btn', labelKey: 'actionDoctor', nameKey: 'sidebarDoctor', hintKey: 'actionDoctorHint', icon: TOOL_ICONS.DOCTOR, isPinnedDefault: true, }), Object.freeze({ id: 'assistant', domId: 'anomalous-assistant-btn', labelKey: 'actionAssistant', nameKey: 'sidebarAssistant', hintKey: 'actionAssistantHint', icon: TOOL_ICONS.ASSISTANT, isPinnedDefault: true, }), Object.freeze({ id: 'materials', domId: 'anomalous-materials-btn', labelKey: 'actionMaterials', nameKey: 'materialLibrary', hintKey: 'actionMaterialsHint', icon: TOOL_ICONS.MATERIALS, isPinnedDefault: true, }), Object.freeze({ id: 'workflow-transfer', domId: 'anomalous-transfer-btn', labelKey: 'toolWorkflowTransferShort', nameKey: 'toolWorkflowTransferTitle', hintKey: 'toolWorkflowTransferDesc', icon: TOOL_ICONS.TRANSFER, isPinnedDefault: false, }), Object.freeze({ id: 'prompt-studio', domId: 'anomalous-studio-btn', labelKey: 'toolPromptStudioShort', nameKey: 'toolPromptStudioTitle', hintKey: 'toolPromptStudioDesc', icon: TOOL_ICONS.STUDIO, isPinnedDefault: false, }), Object.freeze({ id: 'prompt-translator', domId: 'anomalous-translator-btn', labelKey: 'toolPromptTranslatorShort', nameKey: 'toolPromptTranslatorTitle', hintKey: 'toolPromptTranslatorDesc', icon: TOOL_ICONS.TRANSLATOR, isPinnedDefault: false, }), Object.freeze({ id: 'model-sources', domId: 'anomalous-sources-btn', labelKey: 'toolModelSourcesShort', nameKey: 'toolModelSourcesTitle', hintKey: 'toolModelSourcesDesc', icon: TOOL_ICONS.SOURCES, isPinnedDefault: false, }), Object.freeze({ id: 'prompt-notes', domId: 'anomalous-prompt-notes-btn', labelKey: 'toolPromptNotesShort', nameKey: 'toolPromptNotesTitle', hintKey: 'toolPromptNotesDesc', icon: TOOL_ICONS.NOTEBOOK, isPinnedDefault: false, }), ]); export function getToolDefinition(toolId) { if (!toolId) return null; if (toolId === FIXED_ANCHORS.TOOLBOX.id || toolId === FIXED_ANCHORS.TOOLBOX.domId) return FIXED_ANCHORS.TOOLBOX; if (toolId === FIXED_ANCHORS.SETTINGS.id || toolId === FIXED_ANCHORS.SETTINGS.domId) return FIXED_ANCHORS.SETTINGS; return CATALOG_TOOLS.find(tool => tool.id === toolId || tool.domId === toolId) || null; } export function getAllToolDefinitions() { return [FIXED_ANCHORS.TOOLBOX, ...CATALOG_TOOLS, FIXED_ANCHORS.SETTINGS]; }