d0fe4c5b35
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
18 lines
485 B
TypeScript
18 lines
485 B
TypeScript
import type { NativeAgent } from '../../backends/index.js';
|
|
|
|
export function isAllowedChat(chatId: number, allowedIds: number[]): boolean {
|
|
return allowedIds.includes(chatId);
|
|
}
|
|
|
|
export function createMessageHandler(agent: NativeAgent): (text: string) => Promise<string> {
|
|
return async (text: string): Promise<string> => {
|
|
return agent.process(text);
|
|
};
|
|
}
|
|
|
|
export function createResetHandler(agent: NativeAgent): () => void {
|
|
return (): void => {
|
|
agent.reset();
|
|
};
|
|
}
|