π¬ A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots π
TypeScript browser-extensionchrome-extensiondocumentationfirefox-extensionguide-generatorlocal-firstmanifest-v3privacy-firstproductivityreactscreenshotstep-by-step-guidetutorialtypescriptworkflowwxt
fix(voice): make narration types fail closed and JSON-safe
Luis Ortiz1473d27707eb
diff --git a/src/core/capture/voice/types.ts b/src/core/capture/voice/types.tsindex 97cd546..5d7a790 100644--- a/src/core/capture/voice/types.ts+++ b/src/core/capture/voice/types.ts@@ -1,18 +1,26 @@+declare const secondsBrand: unique symbol;++export type AbsoluteSeconds = number & { readonly [secondsBrand]: 'absolute' };++export function absoluteSeconds(value: number): AbsoluteSeconds {+ return value as AbsoluteSeconds;+}+export interface SpeechSegment {- start: number;- end: number;+ start: AbsoluteSeconds;+ end: AbsoluteSeconds;}export interface StepWindow {stepId: string;- from: number;- to: number;+ from: AbsoluteSeconds;+ to: AbsoluteSeconds;}export interface Batch {- start: number;- end: number;- segs: SpeechSegment[];+ start: AbsoluteSeconds;+ end: AbsoluteSeconds;+ segments: SpeechSegment[];}export interface TranscriptSegment {@@ -24,24 +32,41 @@ export interface TranscriptSegment {compression_ratio?: number;}+export interface ScoredTranscriptSegment extends TranscriptSegment {+ no_speech_prob: number;+ avg_logprob: number;+ compression_ratio: number;+}+export interface TranscriptWord {word: string;start: number;end: number;}+export interface PositionedWord {+ text: string;+ batchStart: number;+ start: AbsoluteSeconds;+ end: AbsoluteSeconds;+}+export interface TranscriptionResponse {text?: string;segments?: TranscriptSegment[];words?: TranscriptWord[];}+export interface NarrationStats {+ batches: number;+ failedBatches: number;+ droppedBatches: number;+ verbatimSegments: number;+ splitSegments: number;+ rejectedSegments: number;+}+export interface NarrationResult {- byStep: Map<string, string>;- stats: {- batches: number;- verbatimSegments: number;- splitSegments: number;- rejectedSegments: number;- };+ descriptions: Array<{ stepId: string; text: string }>;+ stats: NarrationStats;}