Major refactor: Multi-user Chrome MCP extension with remote server architecture

This commit is contained in:
nasir@endelospay.com
2025-08-21 20:09:57 +05:00
parent d97cad1736
commit 5d869f6a7c
125 changed files with 16249 additions and 11906 deletions

View File

@@ -17,15 +17,31 @@ export interface ToolCallParam {
* Handle tool execution
*/
export const handleCallTool = async (param: ToolCallParam) => {
console.log('🛠️ [Tool Handler] Executing tool:', {
toolName: param.name,
hasArgs: !!param.args,
availableTools: Array.from(toolsMap.keys()),
args: param.args,
});
const tool = toolsMap.get(param.name);
if (!tool) {
console.error('🛠️ [Tool Handler] Tool not found:', param.name);
return createErrorResponse(`Tool ${param.name} not found`);
}
try {
return await tool.execute(param.args);
console.log('🛠️ [Tool Handler] Starting tool execution for:', param.name);
const result = await tool.execute(param.args);
console.log('🛠️ [Tool Handler] Tool execution completed:', {
toolName: param.name,
hasResult: !!result,
isError: result?.isError,
result,
});
return result;
} catch (error) {
console.error(`Tool execution failed for ${param.name}:`, error);
console.error(`🛠️ [Tool Handler] Tool execution failed for ${param.name}:`, error);
return createErrorResponse(
error instanceof Error ? error.message : ERROR_MESSAGES.TOOL_EXECUTION_FAILED,
);