3 Commits
Author SHA1 Message Date
azykov@mail.ru 6347e4b211 removed type: module from package.json 2026-07-01 13:18:27 +03:00
azykov@mail.ru 83dea1f728 TS2589 fixes
TS2589 fixes

TS2589
2026-07-01 13:15:10 +03:00
azykov@mail.ru 060ac0820a switch from ESNext to CommonJS 2026-07-01 12:12:07 +03:00
4 changed files with 22 additions and 14 deletions
-1
View File
@@ -17,7 +17,6 @@
"engines": {
"pnpm": ">=11.4.0 <12"
},
"type": "module",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.13.1",
"fastify": "^5.2.1",
+9 -5
View File
@@ -51,11 +51,15 @@ export default class McpSession {
this.registeredTools.push(
...toolsToRegister
.map((tool) => this.mcp.registerTool(
tool.title,
tool.config,
tool.handler,
))
.map(
(tool) => this.mcp.registerTool(
tool.title,
// ugly workaround for TS2589 error
// eslint-disable-next-line @typescript-eslint/no-explicit-any
tool.config as any,
tool.handler,
)
)
);
}
+12 -6
View File
@@ -15,13 +15,19 @@ export const listToolsTool: ToolDef = {
type: "text",
text: JSON.stringify(
Object.values(server.tools)
.map((tool) => ({
...tool,
config: {
...tool.config,
inputSchema: zodToJsonSchema(z.object(tool.config.inputSchema), { target: "jsonSchema7" }),
.map((tool) => {
// ugly workaround for TS2589 error
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const zodObject = (z.object as any)(tool.config.inputSchema);
const inputSchema = zodToJsonSchema(zodObject, { target: "jsonSchema7" });
return {
...tool,
config: {
...tool.config,
inputSchema,
}
}
})),
}),
null,
2,
)
+1 -2
View File
@@ -1,8 +1,7 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "Bundler",
"module": "CommonJS",
"lib": ["ES2022"],
"outDir": "dist",
"rootDir": "src",