import { type Recording, type RecordingDiarization, type RecordingPerson, type RecordingNote, type RecordingNoteKind, type RecordingSpeaker, type RecordingTranscriptionOptions, type RecordingTranscriptPage, type RecordingTranscriptSegment, type RecordingTranscriptVersion, type RecordingUnrecordedStretch, type RecordingPurpose, type RecordingTitleSource, type RecordingVisibility, type Permission } from "@opengeni/contracts"; import { type Database } from "./database.js"; import * as schema from "./schema.js"; import type { RecordingWordTiming } from "./recordings-schema.js"; import { CreditDebitAttribution } from "./credit-debit-attribution.js"; import { type RecordingSpeakerVoice } from "./recording-voices.js"; type TrackRow = typeof schema.recordingTracks.$inferSelect; type ChunkRow = typeof schema.recordingChunks.$inferSelect; type VersionRow = typeof schema.recordingTranscriptVersions.$inferSelect; export type RecordingChunk = ChunkRow; /** Who is acting: every call runs under row-level security as this subject. */ export type RecordingActor = { workspaceId: string; subjectId: string; }; export declare class RecordingNotFoundError extends Error { readonly name = "RecordingNotFoundError"; constructor(message?: string); } /** The request conflicts with what is stored (a reused id, different chunk bytes). */ export declare class RecordingConflictError extends Error { readonly code: string; readonly name = "RecordingConflictError"; constructor(message: string, code: string); } /** Only the person who recorded may do this. */ export declare class RecordingForbiddenError extends Error { readonly name = "RecordingForbiddenError"; constructor(message?: string); } export declare function recordingTranscriptVersionView(row: VersionRow): RecordingTranscriptVersion; /** Whether a title from `next` may replace one from `current`. */ export declare function recordingTitleSourceOutranks(next: RecordingTitleSource, current: RecordingTitleSource): boolean; export type CreateRecordingInput = RecordingActor & { accountId: string; recordingId: string; /** meeting unless given; browser recordings have their own constructor. */ purpose?: "meeting" | "dictation" | undefined; /** Without one the recording is named after when it starts. */ title?: string | undefined; /** Where `title` came from; `person` unless given. Ignored without a title. */ titleSource?: "person" | "calendar" | "app" | undefined; visibility?: RecordingVisibility | undefined; startedAt?: Date | undefined; externalRef?: string | undefined; metadata?: Record | undefined; tracks: ReadonlyArray<{ trackNumber: number; source: TrackRow["source"]; mimeType: string; }>; transcription?: RecordingTranscriptionOptions | undefined; /** * The owner's name. With computer or tab audio beside the microphone, the * microphone is the owner, so they are added to the speaker directory (if * not there yet) for everyone following the live preview to see who it is. */ ownerName?: string | null | undefined; }; /** Create a recording in `capturing`. Creating the same id again returns it unchanged. */ export declare function createRecording(db: Database, input: CreateRecordingInput): Promise<{ recording: Recording; created: boolean; }>; export declare function getRecording(db: Database, input: RecordingActor & { recordingId: string; }): Promise; export type ListRecordingsInput = RecordingActor & { /** Words to find in titles and current transcripts. */ query?: string | undefined; /** * A speaker named in the current transcript: a people-directory id, or part * of a name. Names only suggested from a voice don't count. */ person?: string | undefined; /** Only recordings started at or after this instant. */ startedFrom?: Date | undefined; /** Only recordings started before this instant. */ startedTo?: Date | undefined; externalRef?: string | undefined; /** Meetings unless asked otherwise: browser recordings stay out of meeting lists. */ purpose?: RecordingPurpose | undefined; /** * Only the caller's own Only me recordings: what the person's list in * another workspace shows of this one. Never anyone else's, nor shared ones. */ ownPrivateOnly?: boolean | undefined; /** * With `ownPrivateOnly`: only the Only me meetings that work in this other * workspace, the one the person is looking from. Such a meeting works in * the workspace that stores it, in its owner's Personal workspace, and in * the workspaces on its reach list (all of them when the list is null). * Null when looking from the owner's Personal workspace, where all of them * work. */ reachingWorkspaceId?: string | null | undefined; /** Only recordings started before this instant (the previous page's last `startedAt`). */ before?: { startedAt: Date; id: string; } | undefined; limit?: number | undefined; }; /** Newest first. Private recordings appear only to the person who recorded them. */ export declare function listRecordings(db: Database, input: ListRecordingsInput): Promise<{ recordings: Recording[]; nextBefore: { startedAt: string; id: string; } | null; }>; /** * The other workspaces of this organization that may store the person's own * Only me meetings: those they are a member of, with their membership's * permissions, and their Personal workspace. Within an organization those * meetings are the person's, so every workspace of it they belong to shows * them, until they leave the storing workspace or the organization. Only a * signed-in person's (a `user:` subject), never another organization's * workspaces. Callers still check the person's live access to each. */ export declare function ownRecordingWorkspaces(db: Database, input: RecordingActor & { accountId: string; }): Promise; export type OwnRecordingWorkspace = { id: string; name: string; permissions: Permission[]; /** The person's own Personal workspace, where all their Only me meetings work. */ personal?: true; }; /** * Which workspace the person's Only me meetings from their other workspaces * must reach to show in this one: this workspace, or null when it is their * own Personal workspace, where all of them work (docs/design/ * ownership-and-reach.md: an Only me thing works where its owner turned it * on, always in their Personal workspace). */ export declare function ownMeetingsReaching(db: Database, input: RecordingActor & { accountId: string; }): Promise; /** Whether this workspace has the recording and the person may see it. */ export declare function recordingVisible(db: Database, input: RecordingActor & { recordingId: string; }): Promise; /** * Which of these workspaces stores the person's own Only me meeting with this * id, so it opens in place elsewhere in the organization; null when none does * (not theirs, shared, a dictation, being deleted, in another workspace, or * not turned on where they look from: `reachingWorkspaceId`, null in their * Personal workspace). Each workspace is read as the person, under its * row-level security. */ export declare function ownRecordingHome(db: Database, input: { subjectId: string; recordingId: string; workspaces: readonly OwnRecordingWorkspace[]; reachingWorkspaceId: string | null; }): Promise; /** * The meetings this workspace lists for the person: its own, plus the * person's own Only me meetings stored in `elsewhere`, the other workspaces of * the same organization the caller checked they may read now, that work in * this one (`reachingWorkspaceId`, from `ownMeetingsReaching`), newest first * across them. `sourceWorkspaces` names the other workspaces the page's * meetings come from. */ export declare function listRecordingsWithOwnElsewhere(db: Database, input: Omit & { elsewhere: readonly { id: string; name: string; }[]; reachingWorkspaceId: string | null; }): Promise<{ recordings: Recording[]; nextBefore: { startedAt: string; id: string; } | null; sourceWorkspaces: Map; }>; export type RecordingSearchMatch = { startMilliseconds: number; /** The speaker's resolved name, or null when the model gave no label. */ speaker: string | null; text: string; }; /** * For a page of listed recordings: each one's speakers in its current * transcript and, given `query`, its first transcript segments that contain * the words. Recordings without a current transcript have neither. Set-based, * so a page costs the same few queries however many recordings it holds. */ export declare function getRecordingSearchDetails(db: Database, input: RecordingActor & { recordingIds: readonly string[]; query?: string | undefined; matchesPerRecording?: number | undefined; }): Promise>; export type UpdateRecordingInput = RecordingActor & { recordingId: string; title?: string | undefined; visibility?: RecordingVisibility | undefined; externalRef?: string | null | undefined; metadata?: Record | undefined; /** * The owner's Only me meeting: the other workspaces where it also works, * besides the one that stores it and their Personal workspace; null for * every workspace they belong to. The caller resolves the list to the * owner's own workspaces of this organization first. */ reachWorkspaceIds?: readonly string[] | null | undefined; }; /** * Anyone who can see a recording may rename it; only its owner may share or * unshare it, or change where their Only me meeting works. */ export declare function updateRecording(db: Database, input: UpdateRecordingInput): Promise; export type NameRecordingInput = RecordingActor & { recordingId: string; title: string; source: Exclude; }; /** * Name a meeting automatically: from the owner's calendar, the conversation * or the recording app. The title changes only when `source` is better than * where its current title came from, so a title a person gave is never * replaced. Anyone who can see the meeting may, as they may rename it. */ export declare function nameRecording(db: Database, input: NameRecordingInput): Promise<{ renamed: boolean; recording: Recording; }>; /** * Start deleting a recording: it disappears from every read at once, and the * deletion workflow then removes its media objects and its rows. Only the * person who recorded it may delete it. Its speakers' voices leave the * voiceprints they taught in the same step. Repeating it is harmless. */ export declare function markRecordingDeleting(db: Database, input: RecordingActor & { recordingId: string; }): Promise<{ ownerSubjectId: string; }>; /** * The media objects of a recording being deleted, for its deletion workflow. * Null when the recording is not being deleted (nothing to do). */ export declare function listDeletingRecordingObjectKeys(db: Database, input: RecordingActor & { recordingId: string; }): Promise; /** Remove a deleted recording's rows once its media is gone. */ export declare function purgeDeletingRecording(db: Database, input: RecordingActor & { recordingId: string; }): Promise; export type ReserveRecordingChunksInput = RecordingActor & { recordingId: string; trackNumber: number; chunks: ReadonlyArray<{ chunkNumber: number; byteLength: number; sha256: string; startMilliseconds: number; durationMilliseconds: number; }>; }; export declare function recordingChunkObjectKey(input: { workspaceId: string; recordingId: string; trackNumber: number; chunkNumber: number; sha256: string; }): string; /** Where the worker stores a track's prepared, seekable audio file. */ export declare function recordingPreparedTrackObjectKey(input: { workspaceId: string; recordingId: string; trackNumber: number; extension: string; }): string; /** * Where the worker keeps a meeting track's speaker scan while the meeting is * still recording, so the final run only scans the audio after it. */ export declare function recordingSpeakerScanObjectKey(input: { workspaceId: string; recordingId: string; trackNumber: number; }): string; /** * Record the worker's prepared file for a track and its measured duration. * The recording's duration becomes the longest prepared track. */ export declare function setRecordingTrackPrepared(db: Database, input: RecordingActor & { recordingId: string; trackNumber: number; objectKey: string; bytes: number; durationMilliseconds: number; }): Promise; /** * A track's prepared file, for playback and re-runs. Null until the worker * made it. `chunkObjectsDeleted`: the uploaded pieces are gone, so this * file is the track's only audio. */ export declare function getRecordingTrackPreparedObject(db: Database, input: RecordingActor & { recordingId: string; trackNumber: number; }): Promise<{ objectKey: string; bytes: number; chunkObjectsDeleted: boolean; } | null>; /** * The track's uploaded pieces are deleted: its kept file (`objectKey`) holds * everything they did. Only while that file is still the track's. */ export declare function markRecordingTrackChunkObjectsDeleted(db: Database, input: RecordingActor & { recordingId: string; trackNumber: number; objectKey: string; }): Promise; export type UncompactedRecordingTrack = { accountId: string; workspaceId: string; recordingId: string; ownerSubjectId: string; trackNumber: number; }; /** * Finished meetings' audio tracks, across every workspace, whose kept file * is not yet in the kept format (its key does not end in `keptSuffix`) or * whose uploaded pieces are still stored beside it (migration 1240). * Identity only; the caller acts on each as its owner. */ export declare function listUncompactedRecordingTracks(db: Database, input: { keptSuffix: string; limit?: number; }): Promise; /** * Browser recordings. An agent's recording of a browser tab is a recording * whose purpose is "browser", with one video track. The track's one chunk is * the frame bundle the browser host uploads; the worker encodes it into the * track's prepared MP4 and saves the action log beside it. */ export declare const BROWSER_RECORDING_BUNDLE_MIME_TYPE = "application/vnd.opengeni.browser-recording"; /** Where the browser host uploads a recording's frame bundle: its one chunk. */ export declare function browserRecordingBundleObjectKey(input: { workspaceId: string; recordingId: string; sha256: string; }): string; /** Where the worker saves a browser recording's MP4. */ export declare function browserRecordingVideoObjectKey(input: { workspaceId: string; recordingId: string; }): string; /** Where the worker saves a browser recording's action log, beside its MP4. */ export declare function browserRecordingActionLogObjectKey(input: { workspaceId: string; recordingId: string; }): string; export type CreateBrowserRecordingInput = RecordingActor & { accountId: string; /** The browser host's id for the recording. */ recordingId: string; visibility: RecordingVisibility; startedAt: Date; durationMilliseconds: number; /** The uploaded frame bundle. */ bundle: { byteLength: number; sha256: string; }; }; /** * Record a browser recording whose bundle is uploaded; its video is made * next. Creating it again with the same bundle returns it as it is now. */ export declare function createBrowserRecording(db: Database, input: CreateBrowserRecordingInput): Promise<{ recording: Recording; created: boolean; }>; /** A browser recording's state for its save, with why its video failed if it * did; null when there is none yet. */ export declare function findBrowserRecording(db: Database, input: RecordingActor & { recordingId: string; }): Promise<{ recording: Recording; errorMessage: string | null; } | null>; /** The bundle the worker encodes, while the recording still needs its video. */ export declare function claimBrowserRecordingVideo(db: Database, input: RecordingActor & { recordingId: string; }): Promise<{ recording: Recording; bundle: { objectKey: string; sha256: string; }; } | null>; /** The worker made the video: the track is playable and the recording ready. */ export declare function completeBrowserRecordingVideo(db: Database, input: RecordingActor & { recordingId: string; video: { objectKey: string; bytes: number; sha256: string; durationMilliseconds: number; width: number; height: number; frameCount: number; }; }): Promise; /** The video could not be made; `errorCode` and `errorMessage` say why. */ export declare function failBrowserRecordingVideo(db: Database, input: RecordingActor & { recordingId: string; errorCode: string; errorMessage: string; }): Promise; /** A browser recording's saved video, for copying it into a chat's files. * `readyForMilliseconds` is how long ago it became ready, on the database's * clock, so callers can time a grace window without comparing clocks. */ export declare function getBrowserRecordingVideo(db: Database, input: RecordingActor & { recordingId: string; }): Promise<{ objectKey: string; actionLogObjectKey: string; bytes: number; sha256: string; durationMilliseconds: number; width: number; height: number; frameCount: number; readyForMilliseconds: number; } | null>; /** * Reserve chunk slots before their bytes are uploaded. Reserving a chunk * again with the same bytes returns the stored row, so clients can retry. */ export declare function reserveRecordingChunks(db: Database, input: ReserveRecordingChunksInput): Promise; /** * The shortest stretch without audio that counts as unrecorded. Shorter ones * are a reopened microphone's moment of setup, not missing speech. */ export declare const RECORDING_UNRECORDED_MIN_MILLISECONDS = 2000; /** * Where one track has no audio, from the places its chunks declared on the * recording's timeline: before its first chunk, between runs of chunks (its * source was lost and came back), and after its last one when the recording * went on. `recordingEndMilliseconds` is where the recording's last track ends. */ export declare function recordingUnrecordedStretches(chunks: ReadonlyArray<{ chunkNumber: number; startMilliseconds: number; durationMilliseconds: number; }>, recordingEndMilliseconds: number): RecordingUnrecordedStretch[]; /** * Work out the unrecorded stretches of a recording finalized before they * were saved. Does nothing for one still being captured, or whose tracks * already have them. Returns whether it saved any. */ export declare function fillRecordingUnrecordedStretches(db: Database, input: RecordingActor & { recordingId: string; }): Promise; export declare function listRecordingChunks(db: Database, input: RecordingActor & { recordingId: string; trackNumber?: number | undefined; chunkNumbers?: readonly number[] | undefined; }): Promise; /** Mark chunks whose stored objects the caller has checked. Returns the updated rows. */ export declare function markRecordingChunksUploaded(db: Database, input: RecordingActor & { recordingId: string; trackNumber: number; chunkNumbers: readonly number[]; }): Promise; /** The provider and model a new transcript version uses, already resolved by the caller. */ export type RecordingTranscriptionChoice = { providerId: string; model: string; options: RecordingTranscriptionOptions; /** Who a deployment-funded transcript is billed to, from the request that asked for it. */ creditAttribution?: CreditDebitAttribution | undefined; }; export type FinalizeRecordingInput = RecordingActor & { recordingId: string; endedAt?: Date | undefined; tracks: ReadonlyArray<{ trackNumber: number; chunkCount: number; }>; transcription: RecordingTranscriptionChoice; versionId: string; /** * The transcript can't start, for example because the payer has no credits * for the model: capture still ends, and version 1 is stored already * failed with this code, so the meeting reads as failed with a reason * instead of waiting for a finalize that is refused every time. */ transcriptRefusedCode?: string | undefined; }; /** * End capture. Every track's chunks 0..chunkCount-1 must be uploaded and no * other chunk may exist. Queues transcript version 1 and records * `recording.finished` (and `recording.transcript.failed` when the transcript * was refused). Finalizing again with the same counts returns the existing * state. */ export declare function finalizeRecording(db: Database, input: FinalizeRecordingInput): Promise<{ recording: Recording; version: RecordingTranscriptVersion; finalized: boolean; }>; /** Queue another transcript version over the same audio, for example with a newer model. */ export declare function createRecordingTranscriptVersion(db: Database, input: RecordingActor & { recordingId: string; versionId: string; transcription: RecordingTranscriptionChoice; }): Promise; export declare function listRecordingTranscriptVersions(db: Database, input: RecordingActor & { recordingId: string; }): Promise; /** Everything a transcription worker needs for one version. */ export type RecordingTranscriptionJob = { recording: Recording; version: RecordingTranscriptVersion; /** Who a deployment-funded transcript is billed to; null for versions made before 0962. */ creditAttribution: CreditDebitAttribution | null; chunks: RecordingChunk[]; processingOwner: string; /** How long the version waited before its first attempt; null on later attempts. */ queuedMilliseconds: number | null; /** * Which attempt at this version this claim is, from 1. It counts every * claim, also those of a workflow started again, so each attempt can ask * the provider afresh under its own request identity. */ attempt: number; }; /** * Lease a queued version for processing. Returns null when the version is * finished, gone, or leased by a live attempt. The same processing owner * (one workflow) may take its own lease back after a crash. */ export declare function claimRecordingTranscriptVersion(db: Database, input: RecordingActor & { versionId: string; processingOwner: string; leaseSeconds: number; }): Promise; /** Give a leased version back to the queue after a retryable failure. */ export declare function releaseRecordingTranscriptVersion(db: Database, input: RecordingActor & { versionId: string; processingOwner: string; }): Promise; export type CompletedRecordingSegment = { startMilliseconds: number; endMilliseconds: number; trackNumber: number | null; speakerLabel: string | null; text: string; words?: RecordingWordTiming[] | null | undefined; }; /** Labels that name a whole track ("track-0") mean the same speaker in every version. */ export declare function isTrackSpeakerLabel(label: string): boolean; /** * A whole track's speaker that the capture itself identifies. With * `memberSubjectId` it is that workspace member's person in the directory, * added under `displayName` when they have none yet (as "It's me" does). */ export type TrackSpeaker = { label: string; displayName?: string | null | undefined; personId?: string | null | undefined; memberSubjectId?: string | null | undefined; }; type TimedLabel = { startMilliseconds: number; endMilliseconds: number; trackNumber: number | null; speakerLabel: string | null; }; /** * Match a new version's diarized labels to the previous version's named * labels by overlapping speech on the same track. A new label takes the name * of the previous label it overlaps most, when that covers at least half of * its speech. Two new labels may map to one person (the model split them); * that is the same as a merge. */ export declare function matchCarriedSpeakerLabels(previous: readonly TimedLabel[], next: readonly TimedLabel[], namedPreviousLabels: ReadonlySet): Map; /** * Store a finished transcript and make it current. Names from the previous * current version carry over: whole-track speakers by label, diarized * speakers by overlapping speech. */ export declare function completeRecordingTranscriptVersion(db: Database, input: RecordingActor & { versionId: string; processingOwner: string; languages: readonly string[]; diarized: boolean; diarization: RecordingDiarization; costUsdMicros?: number | null | undefined; /** * The Opengeni credits the version was charged, for a deployment-funded * model where credit billing is on. Such a version's cost does not count * toward allowances again (0960). */ creditCostMicros?: number | null | undefined; audioMilliseconds: number; segments: readonly CompletedRecordingSegment[]; /** Speakers the capture itself identifies, such as the microphone's owner. */ trackSpeakers?: ReadonlyArray; /** * Diarized speakers' voices, passed only while the workspace recognizes * voices. They are kept with the version and matched against the * voiceprints of people who agreed to be remembered. */ voices?: readonly RecordingSpeakerVoice[]; }): Promise; /** Record that a version cannot be made. The recording fails only if it has no transcript. */ /** One piece of one track a provider already transcribed for a version still being made. */ export type RecordingTranscriptPieceResult = { trackNumber: number; pieceIndex: number; /** SHA-256 of what was asked; a result is reused only for the same question. */ requestKey: string; result: Record; }; /** * The pieces a version's earlier attempts already got back, so a retry * reuses them instead of asking and paying the provider again. Empty unless * the version is processing under this owner. */ export declare function listRecordingTranscriptPieceResults(db: Database, input: RecordingActor & { versionId: string; processingOwner: string; }): Promise; /** * Keep a piece a provider transcribed, while the version is still being * made by this owner; a later answer for the same piece replaces it. * Returns whether it was kept. */ export declare function saveRecordingTranscriptPieceResult(db: Database, input: RecordingActor & { versionId: string; processingOwner: string; } & RecordingTranscriptPieceResult): Promise; export declare function failRecordingTranscriptVersion(db: Database, input: RecordingActor & { versionId: string; processingOwner: string; errorCode: string; }): Promise; /** One page of a transcript, with speaker names and segment overrides applied. */ export declare function getRecordingTranscriptPage(db: Database, input: RecordingActor & { recordingId: string; versionId?: string | undefined; /** Segment index to continue after; omitted starts at the beginning. */ after?: number | undefined; /** Only segments still running at or after this point of the recording. */ fromMilliseconds?: number | undefined; /** Only segments that start before this point of the recording. */ toMilliseconds?: number | undefined; limit?: number | undefined; }): Promise; export type UpdateRecordingSpeakersInput = RecordingActor & { recordingId: string; versionId?: string | undefined; assignments?: ReadonlyArray<{ label: string; personId?: string | null | undefined; name?: string | null | undefined; }> | undefined; segmentOverrides?: ReadonlyArray<{ segmentIndex: number; label: string; }> | undefined; /** Suggested names to turn down; the person is not suggested for that voice again. */ rejectSuggestions?: ReadonlyArray<{ label: string; }> | undefined; }; /** * Name speakers and move segments between them. A label with neither a * person nor a name loses its name. Returns the version's speakers. */ export declare function updateRecordingSpeakers(db: Database, input: UpdateRecordingSpeakersInput): Promise; /** * Correct segment text in one version. Setting a segment's text back to its * original, or to null, removes the correction. */ export declare function updateRecordingSegments(db: Database, input: RecordingActor & { recordingId: string; versionId?: string | undefined; edits: ReadonlyArray<{ segmentIndex: number; text: string | null; }>; }): Promise; /** * Make a finished version the one everyone reads. Any member who can see the * recording may switch it, as with re-runs. */ export declare function setCurrentRecordingTranscriptVersion(db: Database, input: RecordingActor & { recordingId: string; versionId: string; }): Promise; /** A meeting's notepad and notes, for anyone who can see it. A kind nobody wrote is absent. */ export declare function listRecordingNotes(db: Database, input: RecordingActor & { recordingId: string; }): Promise; /** * The built-in meeting summary (docs/recordings.md, "Built-in summary"): Opengeni's own * chat that writes a meeting's notes once its transcript is ready. It is * created by this service, for exactly one meeting, with exactly these tools, * and `createSession` refuses any other session claiming to be one. */ export declare const MEETING_SUMMARY_SUBJECT_ID = "meeting-summary"; export declare const MEETING_SUMMARY_POLICY_ROLE = "meeting_summary"; /** Session metadata naming the one meeting a summary chat may read and write. */ export declare const MEETING_SUMMARY_RECORDING_METADATA_KEY = "meetingSummaryRecordingId"; export declare const MEETING_SUMMARY_TOOLS: readonly ["meeting_read", "meeting_notes_save"]; /** * The built-in summary chats of a meeting that nobody has written in and that * are not archived yet. A deleted meeting's summary chat has nothing left to * read, so the deletion archives these; a chat someone wrote in is theirs and * stays. Read as the meeting's owner, who sees its Only me summary chat. */ export declare function listUntouchedMeetingSummarySessions(db: Database, input: RecordingActor & { recordingId: string; }): Promise; export type MeetingSummaryCandidate = { start: true; recording: { id: string; title: string; titleSource: RecordingTitleSource; ownerSubjectId: string; visibility: RecordingVisibility; }; /** * The revision of the notes this summary replaces: notes an earlier * built-in summary wrote that nobody has touched since. Null when the * meeting has no notes yet. */ replacesRevision: number | null; } | { start: false; reason: "not_a_meeting" | "not_current" | "turned_off" | "has_notes"; }; /** * Whether a just-completed transcript version should start the built-in * summary: a meeting (not a dictation or an agent's browser recording) whose * shown transcript is this version, in a workspace that has not turned it off * (`settings.recordings.autoSummary: false`), with no notes saved yet. It * does not guess whether an automation will write notes: whatever saves notes * first keeps them, because the summary only saves the first notes. * * A re-run also starts it when the notes are an earlier built-in summary's * that nobody has touched: last saved by a summary chat of this meeting in * which no person or other agent ever started a turn. Those notes describe the * transcript the re-run replaced, so the new summary writes them again. Notes * a person edited, an automation wrote, or someone talked to the notes chat * about are kept. */ export declare function meetingSummaryCandidate(db: Database, input: RecordingActor & { recordingId: string; versionId: string; }): Promise; export type SaveRecordingNoteInput = RecordingActor & { recordingId: string; kind: RecordingNoteKind; body: string; /** Refuse the save unless the stored revision is this one (0: nobody has written it). */ expectedRevision?: number | undefined; /** The chat whose agent saves it, when an agent does. */ sessionId?: string | null | undefined; }; /** * Replace one of a meeting's notes. Anyone who can see the meeting may, like * its title and speakers. Saving the same text again changes nothing. Saving * the notes (not the notepad, which saves as people type) is a * `recording.notes.updated` event. */ export declare function saveRecordingNote(db: Database, input: SaveRecordingNoteInput): Promise; export declare function listRecordingPeople(db: Database, input: RecordingActor & { query?: string | undefined; limit?: number | undefined; }): Promise; /** * Add a person to the workspace's speaker directory. A member or an * external reference that already has a person returns that person. */ export declare function createRecordingPerson(db: Database, input: RecordingActor & { accountId: string; personId: string; displayName: string; email?: string | undefined; memberSubjectId?: string | undefined; externalRef?: string | undefined; }): Promise<{ person: RecordingPerson; created: boolean; }>; /** * Agree to have a person's voice remembered, then learn it from every * speaker already confirmed as them. A member agrees only for themselves * (`self`); for someone outside the workspace, the caller attests that they * agreed (`attested`). The caller checks the workspace recognizes voices. */ export declare function rememberRecordingPersonVoice(db: Database, input: RecordingActor & { personId: string; consent: "self" | "attested"; }): Promise; /** * Forget a person's voice and withdraw their agreement. Members decide for * themselves; anyone in the workspace may forget someone from outside it. */ export declare function forgetRecordingPersonVoice(db: Database, input: RecordingActor & { personId: string; }): Promise; /** * Forget every voice in the workspace, for when it stops recognizing * voices: voiceprints, stored speaker voices, turned-down suggestions and * every agreement. */ export declare function forgetWorkspaceRecordingVoices(db: Database, input: RecordingActor): Promise; /** Work the recovery sweep restarts: a transcript version or a deletion. */ export type StalledRecordingWork = { kind: "transcript" | "deletion"; accountId: string; workspaceId: string; recordingId: string; versionId: string | null; ownerSubjectId: string; }; /** * Transcripts and deletions whose workflow may never have started, across * every workspace. Identity only; the caller restarts each workflow, which * does nothing when it is already running. */ export declare function listStalledRecordingWork(db: Database, limit?: number): Promise; export type DueRecordingRetention = { /** audio: delete the audio, keep the transcript. recording: delete the meeting. */ kind: "audio" | "recording"; accountId: string; workspaceId: string; recordingId: string; ownerSubjectId: string; }; /** * Meetings whose workspace retention has passed, across every workspace. * Identity only; the caller acts on each as its owner. */ export declare function listDueRecordingRetention(db: Database, limit?: number): Promise; /** * Retention is deleting a meeting's audio: stamp it, so nothing plays or * transcribes it from now on, and return the audio objects to delete. Null * when there is nothing to do (the meeting is gone, being deleted, still * being captured or transcribed). Repeating it returns the same objects. */ export declare function beginRecordingAudioExpiry(db: Database, input: RecordingActor & { recordingId: string; }): Promise; /** * The audio objects are gone: drop the chunk rows and the tracks' pointers * at prepared audio, which also takes the meeting off the retention sweep. */ export declare function completeRecordingAudioExpiry(db: Database, input: RecordingActor & { recordingId: string; }): Promise; export {};