import type { OpenClawConfig } from "../config/types.openclaw.js"; export type TranscriptSourceKind = "live-audio" | "live-caption" | "posthoc-transcript" | "recording-stt"; export type TranscriptSourceLocator = { providerId: string; kind?: TranscriptSourceKind; accountId?: string; guildId?: string; channelId?: string; meetingUrl?: string; threadTs?: string; fileId?: string; [key: string]: string | undefined; }; export type TranscriptParticipant = { id?: string; label: string; }; export type TranscriptUtterance = { id?: string; sessionId?: string; startedAt?: string; endedAt?: string; speaker?: TranscriptParticipant; text: string; final?: boolean; metadata?: Record; }; export type TranscriptSessionDescriptor = { sessionId: string; title?: string; source: TranscriptSourceLocator; startedAt: string; stoppedAt?: string; metadata?: Record; }; export type TranscriptStartRequest = { cfg?: OpenClawConfig; session: TranscriptSessionDescriptor; abortSignal?: AbortSignal; startupWaitMs?: number; onUtterance: (utterance: TranscriptUtterance) => void | Promise; onStatus?: (status: TranscriptSourceStatus) => void | Promise; }; export type TranscriptsStartResult = { ok: true; session: TranscriptSessionDescriptor; } | { ok: false; error: string; }; export type TranscriptStopRequest = { cfg?: OpenClawConfig; sessionId: string; source: TranscriptSourceLocator; reason?: string; }; export type TranscriptsStopResult = { ok: true; sessionId: string; stoppedAt?: string; } | { ok: false; error: string; }; export type TranscriptSourceStatus = { sessionId?: string; active: boolean; message?: string; source?: TranscriptSourceLocator; }; export type TranscriptImportRequest = { cfg?: OpenClawConfig; session: TranscriptSessionDescriptor; text: string; speakerLabel?: string; }; export type TranscriptSourceProvider = { id: string; aliases?: readonly string[]; name: string; sourceKinds: readonly TranscriptSourceKind[]; start?: (request: TranscriptStartRequest) => Promise; stop?: (request: TranscriptStopRequest) => Promise; status?: (source: TranscriptSourceLocator, cfg?: OpenClawConfig) => Promise; importTranscript?: (request: TranscriptImportRequest) => Promise; };