feat(channels/telegram): add slash command support

- Local commands: /start (welcome), /help (dynamic list), /reset (clear session)
- Non-local slash commands forwarded to ACP agent as prompts
- AcpBridge captures available_commands_update to populate /help dynamically
- SessionRouter gains hasSession/removeSession for /reset support
This commit is contained in:
tanzhenxin 2026-03-24 06:08:15 +00:00
parent be838eea01
commit 2985201317
4 changed files with 88 additions and 2 deletions

View file

@ -34,4 +34,17 @@ export class SessionRouter {
getTarget(sessionId: string): SessionTarget | undefined {
return this.toTarget.get(sessionId);
}
hasSession(channelName: string, senderId: string): boolean {
return this.toSession.has(`${channelName}:${senderId}`);
}
removeSession(channelName: string, senderId: string): boolean {
const key = `${channelName}:${senderId}`;
const sessionId = this.toSession.get(key);
if (!sessionId) return false;
this.toSession.delete(key);
this.toTarget.delete(sessionId);
return true;
}
}