40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { Injectable } from '@nestjs/common';
|
|
import type { WecomBotRuntimeConfig } from './wecom-bot.types';
|
|
import { WecomBotCapabilityService } from './wecom-bot-capability.service';
|
|
|
|
/** 兼容层:AI / Aibot 仍通过 Actions 入口调用 Capability */
|
|
@Injectable()
|
|
export class WecomBotActionsService {
|
|
constructor(private readonly capability: WecomBotCapabilityService) {}
|
|
|
|
buildHelp(bot: WecomBotRuntimeConfig): string {
|
|
return this.capability.buildHelp(bot);
|
|
}
|
|
|
|
handleCommand(
|
|
bot: WecomBotRuntimeConfig,
|
|
wecomUserId: string,
|
|
text: string,
|
|
opts?: { skipNaturalFallback?: boolean },
|
|
): Promise<string | null> {
|
|
return this.capability.dispatch(bot, wecomUserId, text, opts);
|
|
}
|
|
|
|
runTool(
|
|
bot: WecomBotRuntimeConfig,
|
|
wecomUserId: string,
|
|
toolName: string,
|
|
args: string,
|
|
): Promise<string> {
|
|
return this.capability.runTool(bot, wecomUserId, toolName, args);
|
|
}
|
|
|
|
tryNaturalLanguageQuery(
|
|
bot: WecomBotRuntimeConfig,
|
|
wecomUserId: string,
|
|
content: string,
|
|
): Promise<string | null> {
|
|
return this.capability.tryNaturalLanguageQuery(bot, wecomUserId, content);
|
|
}
|
|
}
|