Milestone v1 (v2.0.0): Mokosh — Session Capture #1

Merged
strategy155 merged 297 commits from gsd/phase-04-harden-clean-up-optional into main 2026-05-31 15:34:17 +00:00
Showing only changes of commit d653283bc4 - Show all commits

View File

@@ -29,16 +29,33 @@ export type PortMessageType =
export interface PortMessage {
type: PortMessageType;
chunks?: VideoChunk[];
// Wire-format (post-D-12 fix): chunks travel as TransferredVideoChunk[]
// because chrome.runtime.Port JSON-serializes payloads, and
// JSON.stringify(blob) === "{}" loses binary content. The receive
// side reconstructs VideoChunk[] via src/shared/binary.ts.
chunks?: TransferredVideoChunk[];
}
// Видеобуфер
// In-memory chunk shape used by the offscreen ring buffer and by
// mergeVideoChunks after the SW decodes the wire format.
export interface VideoChunk {
data: Blob;
timestamp: number;
isFirst?: boolean;
}
// Wire-format for video chunks traveling across the offscreen↔SW
// chrome.runtime.Port boundary. Replaces the previous VideoChunk[]
// payload, which failed because Blob is not JSON-serializable.
// See debug session d12-blob-port-transfer-fails and the GREEN block
// of tests/offscreen/port-serialization.test.ts for the pinned shape.
export interface TransferredVideoChunk {
data: string; // base64-encoded blob bytes (no data: prefix)
type: string; // MIME type to apply when reconstructing the Blob
timestamp: number;
isFirst?: boolean;
}
// Лог событий пользователя
export interface UserEvent {
timestamp: number;