33 lines
865 B
JavaScript
33 lines
865 B
JavaScript
// Generated, do not edit. sha256:a80e6dd97d8d48819bc999d4057ab86d1dddc182a1d9038097a88796139bb3df
|
|||
|
|
import { logAiToolCall } from '../data/ai-audit.js';
|
||
|
|
import { createMcpServer } from './protocol.mjs';
|
||
|
|
import { allTools } from './tools.mjs';
|
||
|
|
|
||
|
|
let server = null;
|
||
|
|
|
||
|
|
function ensureServer() {
|
||
|
|
if (!server) {
|
||
|
|
server = createMcpServer({
|
||
|
|
tools: allTools(),
|
||
|
|
logCall: logAiToolCall,
|
||
|
|
onLogError: (e) => console.error('[assetapp] een MCP-aanroep is NIET vastgelegd:', e.message),
|
||
|
|
});
|
||
|
|
}
|
||
|
|
return server;
|
||
|
|
}
|
||
|
|
|
||
|
|
export function dryRunTools() {
|
||
|
|
return allTools().map(t => ({
|
||
|
|
name: t.name,
|
||
|
|
title: t.title,
|
||
|
|
description: t.description,
|
||
|
|
scope: t.scope,
|
||
|
|
inputSchema: t.inputSchema,
|
||
|
|
}));
|
||
|
|
}
|
||
|
|
|
||
|
|
export function dryRunTool(naam, args) {
|
||
|
|
return ensureServer().dryRun(naam, args);
|
||
|
|
}
|
||
|
|
|
||
|
|
export function _resetDryRunServer() { server = null; }
|