import type { ToolRequestContext } from "./tool-request-context.interface.js"; export type EnrichmentRunStatus = "queued" | "running" | "succeeded" | "failed" | "cancelled"; export type EnrichmentRunOperation = "preview_user_context" | "update_user_context" | "preview_user_profile" | "update_user_profile"; export interface PreviewUserEnrichmentRunInput { name?: string; location?: string; bioOrDescription?: string; linkedinUrl?: string; githubUrl?: string; twitterUrl?: string; websites?: string[]; } export interface UpdateUserEnrichmentRunInput { profileId?: string; action?: string; details?: string; socials?: Record; } export type EnrichmentRunInput = PreviewUserEnrichmentRunInput | UpdateUserEnrichmentRunInput; export interface EnrichmentRunRecord { id: string; userId: string; agentId?: string | null; operation: EnrichmentRunOperation; status: EnrichmentRunStatus; input: EnrichmentRunInput; context: Pick; progress?: Record | null; result?: unknown; error?: string | null; cancelRequestedAt?: Date | null; createdAt: Date; startedAt?: Date | null; completedAt?: Date | null; expiresAt?: Date | null; } export interface CreateEnrichmentRunInput { userId: string; agentId?: string | null; operation: EnrichmentRunOperation; input: EnrichmentRunInput; context: EnrichmentRunRecord["context"]; expiresAt?: Date; } export interface EnrichmentRunStore { create(input: CreateEnrichmentRunInput): Promise; get(runId: string, userId: string): Promise; markRunning(runId: string): Promise; updateProgress(runId: string, progress: Record): Promise; markSucceeded(runId: string, result: unknown): Promise; markFailed(runId: string, error: string): Promise; requestCancel(runId: string, userId: string): Promise; markCancelled(runId: string, reason?: string): Promise; isCancelRequested(runId: string): Promise; listActive(userId: string, limit?: number): Promise; } export interface EnrichmentRunQueue { enqueue(runId: string): Promise<{ jobId?: string | number; } | void>; cancel(runId: string): Promise; }