/** * Proactive Watcher — Inner Thoughts Pipeline * * Based on: Inner Thoughts (arxiv 2501.00383, CHI 2025) * 5-stage pipeline: Trigger → Retrieval → Formation → Evaluation → Participation * * Watches room conversations and proactively contributes when the agent * has relevant knowledge or expertise. */ import { EventEmitter } from 'events'; import type { RoomManager } from '../rooms.js'; import type { KnowledgePool } from '../knowledge.js'; import type { Identity } from '../identity.js'; export interface ProactiveWatcherConfig { level: 0 | 1 | 2; throttleMs: number; relevanceThreshold: number; specialties: string[]; ollamaUrl: string; ollamaModel: string; } export interface ProactiveDecision { shouldRespond: boolean; relevanceScore: number; response?: string; reasoning?: string; triggeredBy?: string; } export declare class ProactiveWatcher extends EventEmitter { private config; private lastResponse; private watching; private identity; private rooms?; private knowledge?; constructor(identity: Identity, config?: Partial); /** * Start watching room conversations. */ watch(rooms: RoomManager, knowledge?: KnowledgePool): void; /** * Stop watching. */ stop(): void; /** * Update proactivity level at runtime. */ setLevel(level: 0 | 1 | 2): void; getLevel(): number; /** * Set agent specialties for relevance matching. */ setSpecialties(specialties: string[]): void; private handleMessage; /** * 5-stage Inner Thoughts pipeline: * 1. Trigger: keyword/tag match against specialties * 2. Retrieval: search local knowledge for relevant context * 3. Formation: generate potential response via Ollama * 4. Evaluation: score relevance + helpfulness (0-1) * 5. Participation: decide whether to respond */ evaluate(roomId: string, messageText: string, senderName: string): Promise; /** * Stage 1: Trigger detection. * Quick keyword/pattern matching against agent specialties. */ private checkTrigger; /** * Stage 2: Retrieve relevant context from knowledge pool. */ private retrieveContext; private callOllama; private parseJsonResponse; } //# sourceMappingURL=watcher.d.ts.map