/** * Tool Status Tracker for Slack & Discord * * Provides real-time tool usage feedback via platform-specific placeholder messages. * Uses a PlatformAdapter pattern to abstract Slack/Discord API differences. * * Rendering format: * ⏳ Working... (12s) * ✅ Read: config.yaml * ✅ Bash: pnpm test * 🔧 Grep: searching... */ export interface PlatformAdapter { /** Post a new placeholder message, returns an opaque handle for later edits */ postPlaceholder(content: string): Promise; /** Edit an existing placeholder message */ editPlaceholder(handle: string, content: string): Promise; /** Delete a placeholder message */ deletePlaceholder(handle: string): Promise; } export interface ToolStatusTrackerOptions { /** Minimum ms between edits (Discord: 3000, Slack: 1500) */ throttleMs?: number; /** Delay before showing placeholder (Discord: 5000, Slack: 3000) */ initialDelayMs?: number; /** Max completed tools to show (oldest get trimmed) */ maxCompletedTools?: number; } /** * Build a human-readable label from tool name + input */ export declare function buildToolLabel(name: string, input?: Record): string; export declare class ToolStatusTracker { private adapter; private tools; private handle; private startTime; private throttleMs; private initialDelayMs; private maxCompleted; private delayHandle; private pendingEditHandle; private lastEditTime; private placeholderPosted; private destroyed; constructor(adapter: PlatformAdapter, options?: ToolStatusTrackerOptions); /** * Called when a tool starts executing. * If previous tool had no explicit complete, auto-complete it. */ onToolUse(name: string, input?: Record): void; /** * Called when a tool finishes executing. */ onToolComplete(name: string, _toolUseId: string, isError: boolean): void; /** * Render the current status as a string. */ render(): string; /** * Clean up: delete placeholder and cancel timers. */ cleanup(): Promise; /** * Schedule the initial placeholder post after initialDelayMs. */ private scheduleStart; /** * Schedule a throttled edit of the placeholder. */ private scheduleEdit; private doEdit; /** * Build StreamCallbacks that feed into this tracker. */ toStreamCallbacks(): { onToolUse: (name: string, input: Record) => void; onToolComplete: (name: string, toolUseId: string, isError: boolean) => void; }; /** * Build PromptCallbacks (for multi-agent sendMessage). */ toPromptCallbacks(): { onToolUse: (name: string, input: Record) => void; }; } //# sourceMappingURL=tool-status-tracker.d.ts.map