chore: codebase audit — remove dead code, unused deps, clean configs

Phase 1: Delete 19 dead component/service/tool files (4,200+ lines)
Phase 2: Remove 13 unused npm packages (Radix UI, shadcn utilities, ytdl-core, etc.)
Phase 3: Database schema — drop agent_delegations, add performance indexes
Phase 4: Remove 12 dead types from database.ts/analytics.ts/helpers.ts
Phase 5: Strip shadcn/ui theme from tailwind config
Phase 6: Clean env vars, fix broken imports (LocalKeyGate, MapViewer)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
“BeeRad”
2026-01-29 08:52:15 +11:00
co-authored by Claude Opus 4.5
parent 65d22315e1
commit 9b2db68751
33 changed files with 13 additions and 5683 deletions
-137
View File
@@ -253,47 +253,6 @@ const searchEmbeddingsOutputSchema = {
)
};
// rah_list_workflows schemas
const listWorkflowsOutputSchema = {
count: z.number(),
workflows: z.array(
z.object({
key: z.string(),
displayName: z.string(),
description: z.string().nullable(),
enabled: z.boolean()
})
)
};
// rah_get_workflow schemas
const getWorkflowInputSchema = {
workflowKey: z.string().describe('Workflow key to fetch (e.g., "integrate", "prep")')
};
const getWorkflowOutputSchema = {
success: z.boolean(),
workflow: z.object({
key: z.string(),
displayName: z.string(),
description: z.string().nullable(),
instructions: z.string(),
enabled: z.boolean()
}).nullable(),
message: z.string()
};
// rah_execute_workflow schemas
const executeWorkflowInputSchema = {
workflowKey: z.string().describe('Workflow key to execute (e.g., "integrate")'),
nodeId: z.number().int().positive().optional().describe('Target node ID for the workflow')
};
const executeWorkflowOutputSchema = {
success: z.boolean(),
message: z.string()
};
// rah_extract_url schemas
const extractUrlInputSchema = {
url: z.string().url().describe('URL of the webpage to extract content from')
@@ -763,102 +722,6 @@ mcpServer.registerTool(
}
);
mcpServer.registerTool(
'rah_list_workflows',
{
title: 'List RA-H workflows',
description: 'List all available workflows.',
inputSchema: {},
outputSchema: listWorkflowsOutputSchema
},
async () => {
const result = await callRaHApi('/api/workflows', { method: 'GET' });
const workflows = Array.isArray(result.data) ? result.data : [];
return {
content: [{ type: 'text', text: `Found ${workflows.length} workflow(s).` }],
structuredContent: {
count: workflows.length,
workflows: workflows.map(w => ({
key: w.key,
displayName: w.displayName,
description: w.description || null,
enabled: w.enabled
}))
}
};
}
);
mcpServer.registerTool(
'rah_get_workflow',
{
title: 'Get RA-H workflow',
description: 'Fetch a workflow definition by key (e.g., "integrate", "prep"). Returns instructions that can be followed.',
inputSchema: getWorkflowInputSchema,
outputSchema: getWorkflowOutputSchema
},
async ({ workflowKey }) => {
try {
const result = await callRaHApi(`/api/workflows/${encodeURIComponent(workflowKey)}`, {
method: 'GET'
});
const workflow = result.data;
return {
content: [{ type: 'text', text: `Workflow "${workflowKey}": ${workflow?.displayName || 'Unknown'}` }],
structuredContent: {
success: true,
workflow: workflow ? {
key: workflow.key,
displayName: workflow.displayName,
description: workflow.description || null,
instructions: workflow.instructions,
enabled: workflow.enabled
} : null,
message: `Fetched workflow "${workflowKey}"`
}
};
} catch (e) {
return {
content: [{ type: 'text', text: `Workflow "${workflowKey}" not found.` }],
structuredContent: {
success: false,
workflow: null,
message: `Workflow "${workflowKey}" not found`
}
};
}
}
);
mcpServer.registerTool(
'rah_execute_workflow',
{
title: 'Execute RA-H workflow',
description: 'Execute a predefined workflow (e.g., "integrate" for connection discovery).',
inputSchema: executeWorkflowInputSchema,
outputSchema: executeWorkflowOutputSchema
},
async ({ workflowKey, nodeId }) => {
const payload = { workflowKey };
if (nodeId) payload.nodeId = nodeId;
const result = await callRaHApi('/api/workflows/execute', {
method: 'POST',
body: JSON.stringify(payload)
});
return {
content: [{ type: 'text', text: `Workflow "${workflowKey}" initiated.` }],
structuredContent: {
success: true,
message: result.message || `Workflow "${workflowKey}" initiated.`
}
};
}
);
mcpServer.registerTool(
'rah_extract_url',
{
-137
View File
@@ -202,47 +202,6 @@ const searchEmbeddingsOutputSchema = {
)
};
// rah_list_workflows schemas
const listWorkflowsOutputSchema = {
count: z.number(),
workflows: z.array(
z.object({
key: z.string(),
displayName: z.string(),
description: z.string().nullable(),
enabled: z.boolean()
})
)
};
// rah_get_workflow schemas
const getWorkflowInputSchema = {
workflowKey: z.string().describe('Workflow key to fetch (e.g., "integrate", "prep")')
};
const getWorkflowOutputSchema = {
success: z.boolean(),
workflow: z.object({
key: z.string(),
displayName: z.string(),
description: z.string().nullable(),
instructions: z.string(),
enabled: z.boolean()
}).nullable(),
message: z.string()
};
// rah_execute_workflow schemas
const executeWorkflowInputSchema = {
workflowKey: z.string().describe('Workflow key to execute (e.g., "integrate")'),
nodeId: z.number().int().positive().optional().describe('Target node ID for the workflow')
};
const executeWorkflowOutputSchema = {
success: z.boolean(),
message: z.string()
};
// rah_extract_url schemas
const extractUrlInputSchema = {
url: z.string().url().describe('URL of the webpage to extract content from')
@@ -735,102 +694,6 @@ server.registerTool(
}
);
server.registerTool(
'rah_list_workflows',
{
title: 'List RA-H workflows',
description: 'List all available workflows.',
inputSchema: {},
outputSchema: listWorkflowsOutputSchema
},
async () => {
const result = await callRaHApi('/api/workflows', { method: 'GET' });
const workflows = Array.isArray(result.data) ? result.data : [];
return {
content: [{ type: 'text', text: `Found ${workflows.length} workflow(s).` }],
structuredContent: {
count: workflows.length,
workflows: workflows.map(w => ({
key: w.key,
displayName: w.displayName,
description: w.description || null,
enabled: w.enabled
}))
}
};
}
);
server.registerTool(
'rah_get_workflow',
{
title: 'Get RA-H workflow',
description: 'Fetch a workflow definition by key (e.g., "integrate", "prep"). Returns instructions that can be followed.',
inputSchema: getWorkflowInputSchema,
outputSchema: getWorkflowOutputSchema
},
async ({ workflowKey }) => {
try {
const result = await callRaHApi(`/api/workflows/${encodeURIComponent(workflowKey)}`, {
method: 'GET'
});
const workflow = result.data;
return {
content: [{ type: 'text', text: `Workflow "${workflowKey}": ${workflow?.displayName || 'Unknown'}` }],
structuredContent: {
success: true,
workflow: workflow ? {
key: workflow.key,
displayName: workflow.displayName,
description: workflow.description || null,
instructions: workflow.instructions,
enabled: workflow.enabled
} : null,
message: `Fetched workflow "${workflowKey}"`
}
};
} catch (e) {
return {
content: [{ type: 'text', text: `Workflow "${workflowKey}" not found.` }],
structuredContent: {
success: false,
workflow: null,
message: `Workflow "${workflowKey}" not found`
}
};
}
}
);
server.registerTool(
'rah_execute_workflow',
{
title: 'Execute RA-H workflow',
description: 'Execute a predefined workflow (e.g., "integrate" for connection discovery).',
inputSchema: executeWorkflowInputSchema,
outputSchema: executeWorkflowOutputSchema
},
async ({ workflowKey, nodeId }) => {
const payload = { workflowKey };
if (nodeId) payload.nodeId = nodeId;
const result = await callRaHApi('/api/workflows/execute', {
method: 'POST',
body: JSON.stringify(payload)
});
return {
content: [{ type: 'text', text: `Workflow "${workflowKey}" initiated.` }],
structuredContent: {
success: true,
message: result.message || `Workflow "${workflowKey}" initiated.`
}
};
}
);
server.registerTool(
'rah_extract_url',
{