/** Test seam — config is resolved once per process, so tests must be able to reset it. */ export declare function __resetRunTrackingCache(): void; /** * Get or create an active run for a project. * Returns the run ID for use in event logging. * * @param projectId - The project identifier * @returns The active run ID, or null if creation failed */ export declare function getOrCreateActiveRun(projectId: string): Promise; /** * Log a tool event to the active run for a project. * Fails silently if no active run or if logging fails. * * @param projectId - The project identifier * @param toolName - Name of the tool that was called * @param result - 'success' or 'error' * @param summary - Brief summary of what happened */ export declare function logToolEvent(projectId: string, toolName: string, result: 'success' | 'error', summary: string): Promise; /** Configuration for a tracked tool */ export interface TrackedToolConfig { /** Tool name for logging */ toolName: string; /** Function to extract projectId from args (default: args.projectId || args.project_id) */ getProjectId?: (args: Record) => string | undefined; /** Function to generate summary from result (default: JSON.stringify) */ getSummary?: (args: Record, result: unknown) => string; } /** * Wrap a tool handler to automatically log successful calls. * Tracking failures are silently ignored to avoid blocking tool execution. * * @param handler - The original tool handler * @param config - Configuration for tracking * @returns Wrapped handler that logs events after successful execution */ export declare function withRunTracking>(handler: (args: T) => Promise<{ content: Array<{ type: 'text'; text: string; }>; isError?: boolean; }>, config: TrackedToolConfig): (args: T) => Promise<{ content: Array<{ type: 'text'; text: string; }>; isError?: boolean; }>; /** Common summary generators for different tool types */ export declare const summaryGenerators: { /** Summary for issue creation */ issue: (args: Record, result: unknown) => string; /** Summary for epic creation */ epic: (args: Record, result: unknown) => string; /** Summary for issue closure */ closeIssue: (args: Record, result: unknown) => string; /** Summary for proposal creation */ proposal: (args: Record, result: unknown) => string; /** Summary for wish creation */ wish: (args: Record, result: unknown) => string; /** Summary for experiment scaffold */ scaffold: (args: Record, result: unknown) => string; /** Summary for learning append */ learning: (args: Record) => string; /** Summary for friction log */ friction: (args: Record, result: unknown) => string; /** Summary for ADR creation */ adr: (args: Record, result: unknown) => string; /** Summary for design decision */ designDecision: (args: Record) => string; /** Summary for lateral thinking session */ lateralSession: (args: Record, result: unknown) => string; }; /** * Get the current active run for a project (if any). * Useful for debugging or external inspection. */ export declare function getActiveRunId(projectId: string): string | null; /** * Clear all active runs (useful for testing). */ export declare function clearActiveRuns(): void; /** * Get count of active runs (useful for debugging). */ export declare function getActiveRunCount(): number; //# sourceMappingURL=runTracker.d.ts.map