/** * Continuous transcript ingestion (task 096). * * Receives batched, diarized transcript flushes from an external transcription * pipeline (@listen) and stores them into a thread's CONTENT STORE — never the * message history, never spawning Claude. Each flush becomes ONE dense, * speaker-labeled, timestamped block (not one entry per utterance), which is the * dilution guard from the 088–092 measurement work: aggregated blocks keep chunks * dense so retrieval hits signal, not "um, yeah, okay" fragments. * * Sessions open on first-seen `sessionId`, close on `final: true`, and auto-finalize * after 10 minutes of no flush (crash/power-loss safety). `(sessionId, seq)` is * deduped so retried flushes are no-ops. */ export interface TranscriptSegment { /** Display name — enrolled ("Alan") or fallback ("Speaker 2"). */ speaker: string; /** Stable cluster id ("spk_3f2a") — provenance only, kept in metadata. */ speakerId?: string; text: string; /** Integer ms relative to session start. */ tStart: number; /** Integer ms relative to session start. */ tEnd: number; } export interface TranscriptFlush { sessionId: string; targetThread: string; /** Monotonic flush counter per session; dedupe key together with sessionId. */ seq: number; /** ISO-8601 wall clock of session start; anchors ms offsets to real time. */ startedAt: string; title?: string; /** True closes the session (segments may be empty). */ final?: boolean; segments?: TranscriptSegment[]; } export interface IngestResult { status: 'ingested' | 'deduped' | 'empty' | 'closed'; sessionId: string; seq: number; ingestedSegments: number; threadName: string; contentId?: string; } /** No flush for this long → auto-finalize the session. */ export declare const TRANSCRIPT_IDLE_TIMEOUT_MS: number; /** ms → `MM:SS` (or `HH:MM:SS` past an hour). Negative/NaN clamps to 0. */ export declare function formatOffset(ms: number): string; /** * Render a flush as one dense, speaker-labeled, timestamped block. Segments are * sorted by start so out-of-order buffering can't scramble the transcript. */ export declare function formatTranscriptBlock(flush: TranscriptFlush): string; export type ValidationResult = { ok: true; flush: TranscriptFlush; } | { ok: false; error: string; }; export declare function validateTranscriptFlush(body: unknown): ValidationResult; /** * Ingest one validated flush: dedupe on (sessionId, seq), store a dense block in * the target thread's content store (embed-on-write), manage session lifecycle. * Store-only — never spawns Claude. */ export declare function ingestTranscriptFlush(flush: TranscriptFlush): Promise; /** Clear all in-memory sessions + timers (tests, shutdown). */ export declare function resetTranscriptSessions(): void; /** Active (non-closed) session count. */ export declare function activeTranscriptSessionCount(): number; /** Introspect a session (tests). */ export declare function getTranscriptSession(sessionId: string): { seq: number[]; segmentCount: number; flushCount: number; closed: boolean; } | undefined; //# sourceMappingURL=transcript-ingest.d.ts.map