merge(dev): 修复 MCP Factory 注入
CI / verify (push) Waiting to run

This commit is contained in:
2026-09-08 17:01:49 +08:00
@@ -1,10 +1,10 @@
import { Injectable, Logger } from '@nestjs/common'; import { Inject, Injectable, Logger } from '@nestjs/common';
import { allowedWecomPluginMcpTools } from '@dukang/shared-types'; import { allowedWecomPluginMcpTools } from '@dukang/shared-types';
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js'; import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
import type { IncomingMessage, ServerResponse } from 'node:http'; import type { IncomingMessage, ServerResponse } from 'node:http';
import { WECOM_PLUGIN_MCP_TOOL_DEFS } from './wecom-plugin-mcp.tools'; import { WECOM_PLUGIN_MCP_TOOL_DEFS } from './wecom-plugin-mcp.tools';
import type { WecomPluginQueryService } from './wecom-plugin-query.service'; import { WecomPluginQueryService } from './wecom-plugin-query.service';
import type { WecomPluginRuntime } from './wecom-plugin.types'; import type { WecomPluginRuntime } from './wecom-plugin.types';
import { wecomPluginCaller } from './wecom-plugin.util'; import { wecomPluginCaller } from './wecom-plugin.util';
@@ -34,7 +34,7 @@ export function createWecomPluginMcpServer(
export class WecomPluginMcpFactory { export class WecomPluginMcpFactory {
private readonly logger = new Logger(WecomPluginMcpFactory.name); private readonly logger = new Logger(WecomPluginMcpFactory.name);
constructor(private readonly query: WecomPluginQueryService) {} constructor(@Inject(WecomPluginQueryService) private readonly query: WecomPluginQueryService) {}
async handle( async handle(
req: IncomingMessage & { body?: unknown; headers: IncomingMessage['headers'] }, req: IncomingMessage & { body?: unknown; headers: IncomingMessage['headers'] },