@dxos/pipeline-transcription 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/lib/neutral/chunk-Y44GOMGN.mjs +22 -0
  2. package/dist/lib/neutral/chunk-Y44GOMGN.mjs.map +7 -0
  3. package/dist/lib/neutral/index.mjs +886 -0
  4. package/dist/lib/neutral/index.mjs.map +7 -0
  5. package/dist/lib/neutral/meta.json +1 -0
  6. package/dist/lib/neutral/testing/index.mjs +192 -0
  7. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  8. package/dist/types/src/PipelineConfig.d.ts +49 -0
  9. package/dist/types/src/PipelineConfig.d.ts.map +1 -0
  10. package/dist/types/src/PipelineConfig.test.d.ts +2 -0
  11. package/dist/types/src/PipelineConfig.test.d.ts.map +1 -0
  12. package/dist/types/src/PipelineRuntime.d.ts +46 -0
  13. package/dist/types/src/PipelineRuntime.d.ts.map +1 -0
  14. package/dist/types/src/PipelineRuntime.test.d.ts +2 -0
  15. package/dist/types/src/PipelineRuntime.test.d.ts.map +1 -0
  16. package/dist/types/src/Stage.d.ts +80 -0
  17. package/dist/types/src/Stage.d.ts.map +1 -0
  18. package/dist/types/src/TranscriptEvent.d.ts +23 -0
  19. package/dist/types/src/TranscriptEvent.d.ts.map +1 -0
  20. package/dist/types/src/asr/audio-recorder.d.ts +47 -0
  21. package/dist/types/src/asr/audio-recorder.d.ts.map +1 -0
  22. package/dist/types/src/asr/index.d.ts +5 -0
  23. package/dist/types/src/asr/index.d.ts.map +1 -0
  24. package/dist/types/src/asr/pipeline.d.ts +42 -0
  25. package/dist/types/src/asr/pipeline.d.ts.map +1 -0
  26. package/dist/types/src/asr/sentence-buffer.d.ts +25 -0
  27. package/dist/types/src/asr/sentence-buffer.d.ts.map +1 -0
  28. package/dist/types/src/asr/sentence-buffer.test.d.ts +2 -0
  29. package/dist/types/src/asr/sentence-buffer.test.d.ts.map +1 -0
  30. package/dist/types/src/asr/transcriber.d.ts +115 -0
  31. package/dist/types/src/asr/transcriber.d.ts.map +1 -0
  32. package/dist/types/src/asr/transcriber.test.d.ts +2 -0
  33. package/dist/types/src/asr/transcriber.test.d.ts.map +1 -0
  34. package/dist/types/src/asr/util.d.ts +2 -0
  35. package/dist/types/src/asr/util.d.ts.map +1 -0
  36. package/dist/types/src/dispatch.d.ts +19 -0
  37. package/dist/types/src/dispatch.d.ts.map +1 -0
  38. package/dist/types/src/dispatch.test.d.ts +2 -0
  39. package/dist/types/src/dispatch.test.d.ts.map +1 -0
  40. package/dist/types/src/index.d.ts +11 -0
  41. package/dist/types/src/index.d.ts.map +1 -0
  42. package/dist/types/src/live.d.ts +24 -0
  43. package/dist/types/src/live.d.ts.map +1 -0
  44. package/dist/types/src/live.test.d.ts +2 -0
  45. package/dist/types/src/live.test.d.ts.map +1 -0
  46. package/dist/types/src/lookup.d.ts +35 -0
  47. package/dist/types/src/lookup.d.ts.map +1 -0
  48. package/dist/types/src/lookup.test.d.ts +2 -0
  49. package/dist/types/src/lookup.test.d.ts.map +1 -0
  50. package/dist/types/src/model-routing.d.ts +12 -0
  51. package/dist/types/src/model-routing.d.ts.map +1 -0
  52. package/dist/types/src/pipeline-integration.test.d.ts +2 -0
  53. package/dist/types/src/pipeline-integration.test.d.ts.map +1 -0
  54. package/dist/types/src/stages/correction-llm.d.ts +14 -0
  55. package/dist/types/src/stages/correction-llm.d.ts.map +1 -0
  56. package/dist/types/src/stages/correction-llm.test.d.ts +2 -0
  57. package/dist/types/src/stages/correction-llm.test.d.ts.map +1 -0
  58. package/dist/types/src/stages/correction.d.ts +29 -0
  59. package/dist/types/src/stages/correction.d.ts.map +1 -0
  60. package/dist/types/src/stages/correction.test.d.ts +2 -0
  61. package/dist/types/src/stages/correction.test.d.ts.map +1 -0
  62. package/dist/types/src/stages/diarization.d.ts +11 -0
  63. package/dist/types/src/stages/diarization.d.ts.map +1 -0
  64. package/dist/types/src/stages/extraction.d.ts +40 -0
  65. package/dist/types/src/stages/extraction.d.ts.map +1 -0
  66. package/dist/types/src/stages/extraction.test.d.ts +2 -0
  67. package/dist/types/src/stages/extraction.test.d.ts.map +1 -0
  68. package/dist/types/src/stages/index.d.ts +18 -0
  69. package/dist/types/src/stages/index.d.ts.map +1 -0
  70. package/dist/types/src/stages/summarization.d.ts +12 -0
  71. package/dist/types/src/stages/summarization.d.ts.map +1 -0
  72. package/dist/types/src/stages/translation.d.ts +11 -0
  73. package/dist/types/src/stages/translation.d.ts.map +1 -0
  74. package/dist/types/src/testing/conversation-parser.d.ts +26 -0
  75. package/dist/types/src/testing/conversation-parser.d.ts.map +1 -0
  76. package/dist/types/src/testing/conversation.test.d.ts +2 -0
  77. package/dist/types/src/testing/conversation.test.d.ts.map +1 -0
  78. package/dist/types/src/testing/fixtures.d.ts +6 -0
  79. package/dist/types/src/testing/fixtures.d.ts.map +1 -0
  80. package/dist/types/src/testing/index.d.ts +5 -0
  81. package/dist/types/src/testing/index.d.ts.map +1 -0
  82. package/dist/types/src/testing/scripted-source.d.ts +16 -0
  83. package/dist/types/src/testing/scripted-source.d.ts.map +1 -0
  84. package/dist/types/src/testing/stream-simulator.d.ts +38 -0
  85. package/dist/types/src/testing/stream-simulator.d.ts.map +1 -0
  86. package/dist/types/tsconfig.tsbuildinfo +1 -0
  87. package/package.json +61 -0
  88. package/src/PipelineConfig.test.ts +39 -0
  89. package/src/PipelineConfig.ts +71 -0
  90. package/src/PipelineRuntime.test.ts +74 -0
  91. package/src/PipelineRuntime.ts +192 -0
  92. package/src/Stage.ts +86 -0
  93. package/src/TranscriptEvent.ts +23 -0
  94. package/src/asr/audio-recorder.ts +56 -0
  95. package/src/asr/index.ts +8 -0
  96. package/src/asr/pipeline.ts +105 -0
  97. package/src/asr/sentence-buffer.test.ts +53 -0
  98. package/src/asr/sentence-buffer.ts +88 -0
  99. package/src/asr/transcriber.test.ts +104 -0
  100. package/src/asr/transcriber.ts +337 -0
  101. package/src/asr/util.ts +14 -0
  102. package/src/dispatch.test.ts +37 -0
  103. package/src/dispatch.ts +56 -0
  104. package/src/index.ts +14 -0
  105. package/src/live.test.ts +63 -0
  106. package/src/live.ts +56 -0
  107. package/src/lookup.test.ts +41 -0
  108. package/src/lookup.ts +60 -0
  109. package/src/model-routing.ts +25 -0
  110. package/src/pipeline-integration.test.ts +70 -0
  111. package/src/stages/correction-llm.test.ts +46 -0
  112. package/src/stages/correction-llm.ts +40 -0
  113. package/src/stages/correction.test.ts +26 -0
  114. package/src/stages/correction.ts +72 -0
  115. package/src/stages/diarization.ts +24 -0
  116. package/src/stages/extraction.test.ts +79 -0
  117. package/src/stages/extraction.ts +151 -0
  118. package/src/stages/index.ts +44 -0
  119. package/src/stages/summarization.ts +37 -0
  120. package/src/stages/translation.ts +26 -0
  121. package/src/testing/conversation-parser.ts +101 -0
  122. package/src/testing/conversation.test.ts +53 -0
  123. package/src/testing/conversation.txt +23 -0
  124. package/src/testing/fixtures.ts +18 -0
  125. package/src/testing/index.ts +8 -0
  126. package/src/testing/scripted-source.ts +35 -0
  127. package/src/testing/stream-simulator.ts +125 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correction.test.d.ts","sourceRoot":"","sources":["../../../../src/stages/correction.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { type ContentBlock } from '@dxos/types';
2
+ import { type Stage } from '../Stage';
3
+ export type DiarizationInput = {
4
+ window: ContentBlock.Transcript[];
5
+ };
6
+ /**
7
+ * Stage ◆ (interface only / deferred): label the speaker of the newest block.
8
+ * Conforms to the `Stage` contract and is inert until a diarization backend is wired.
9
+ */
10
+ export declare const makeDiarizationStage: () => Stage<DiarizationInput>;
11
+ //# sourceMappingURL=diarization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diarization.d.ts","sourceRoot":"","sources":["../../../../src/stages/diarization.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,KAAK,KAAK,EAAc,MAAM,UAAU,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC,UAAU,EAAE,CAAA;CAAE,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAO,KAAK,CAAC,gBAAgB,CAO5D,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { type Ref } from '@dxos/echo';
2
+ import { type ContentBlock } from '@dxos/types';
3
+ import { type EntityLookup } from '../lookup';
4
+ import { type Stage } from '../Stage';
5
+ export type ExtractionInput = {
6
+ window: ContentBlock.Transcript[];
7
+ };
8
+ /**
9
+ * Deterministic proper-noun heuristic: capitalized word runs, minus sentence-initial stop-words.
10
+ * The LLM seam (see `run`) replaces this with model-driven NER.
11
+ */
12
+ export declare const extractProperNouns: (text: string) => string[];
13
+ /** Marker that a block's text already carries inline echo links, so extraction can skip it. */
14
+ export declare const isLinked: (text: string) => boolean;
15
+ /** Result of resolving a block's proper nouns against the {@link EntityLookup}. */
16
+ export type ExtractedEntities = {
17
+ references: Ref.Ref<any>[];
18
+ quotes: {
19
+ quote: string;
20
+ id: string;
21
+ }[];
22
+ candidates: ContentBlock.Candidate[];
23
+ };
24
+ /** Resolve a block's proper nouns: matched → references/quotes, unmatched → candidates. */
25
+ export declare const resolveEntities: (text: string, lookup?: EntityLookup) => Promise<ExtractedEntities>;
26
+ /**
27
+ * Rewrite text with inline `[noun](echo:/<id>)` links for entities matched by `lookup`, so markdown
28
+ * consumers decorate them as dx-anchors. Reused by the live recording driver's post-process seam.
29
+ */
30
+ export declare const linkEntities: (text: string, lookup: EntityLookup) => Promise<string>;
31
+ /**
32
+ * Stage ②: surface proper nouns across the window, link those that match objects (via the injected
33
+ * {@link EntityLookup}), and report the rest as candidates the user can act on.
34
+ *
35
+ * Processes every not-yet-linked block in the window (not just the newest). Under `latest-wins`
36
+ * with a fast stream, earlier per-block invocations are interrupted, so the surviving invocation
37
+ * must cover the whole window — otherwise blocks behind the head never get extracted.
38
+ */
39
+ export declare const makeExtractionStage: () => Stage<ExtractionInput>;
40
+ //# sourceMappingURL=extraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../../../src/stages/extraction.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAoB,KAAK,KAAK,EAAc,MAAM,UAAU,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC,UAAU,EAAE,CAAA;CAAE,CAAC;AA4BpE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,SAAU,MAAM,KAAG,MAAM,EAGvD,CAAC;AAEF,+FAA+F;AAC/F,eAAO,MAAM,QAAQ,SAAU,MAAM,KAAG,OAAmC,CAAC;AAE5E,mFAAmF;AACnF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;IAC3B,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxC,UAAU,EAAE,YAAY,CAAC,SAAS,EAAE,CAAC;CACtC,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,eAAe,SAAgB,MAAM,WAAW,YAAY,KAAG,OAAO,CAAC,iBAAiB,CA+BpG,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,SAAgB,MAAM,UAAU,YAAY,KAAG,OAAO,CAAC,MAAM,CAMrF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,QAAO,KAAK,CAAC,eAAe,CAmC1D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=extraction.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extraction.test.d.ts","sourceRoot":"","sources":["../../../../src/stages/extraction.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import { type Stage } from '../Stage';
2
+ export * from './correction';
3
+ export * from './correction-llm';
4
+ export * from './extraction';
5
+ export * from './summarization';
6
+ export * from './translation';
7
+ export * from './diarization';
8
+ /**
9
+ * The default registry of stage factories keyed by stage id. Consumers build a stage list for a
10
+ * `PipelineConfig` by selecting enabled ids in config order.
11
+ */
12
+ export declare const STAGE_FACTORIES: Readonly<Record<string, () => Stage<any, any>>>;
13
+ /** Build the ordered, enabled stage list for a set of stage configs. */
14
+ export declare const buildStages: (configs: readonly {
15
+ id: string;
16
+ enabled: boolean;
17
+ }[]) => Stage<any, any>[];
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/stages/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAOtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAM1E,CAAC;AAEH,wEAAwE;AACxE,eAAO,MAAM,WAAW,YAAa,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAAE,KAAG,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EAUjG,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type ContentBlock } from '@dxos/types';
2
+ import { type Stage } from '../Stage';
3
+ export type SummarizationInput = {
4
+ window: ContentBlock.Transcript[];
5
+ };
6
+ /**
7
+ * Stage ④: maintain a cumulative summary. Fires on the silence edge, skips if a summary is already
8
+ * in flight. The deterministic implementation concatenates corrected utterances; the LLM seam
9
+ * (see `run`) replaces it with a cumulative model summary plus referent resolution.
10
+ */
11
+ export declare const makeSummarizationStage: () => Stage<SummarizationInput>;
12
+ //# sourceMappingURL=summarization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarization.d.ts","sourceRoot":"","sources":["../../../../src/stages/summarization.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EAAE,KAAK,KAAK,EAAc,MAAM,UAAU,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC,UAAU,EAAE,CAAA;CAAE,CAAC;AAEvE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAO,KAAK,CAAC,kBAAkB,CAkBhE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type ContentBlock } from '@dxos/types';
2
+ import { type Stage } from '../Stage';
3
+ export type TranslationInput = {
4
+ window: ContentBlock.Transcript[];
5
+ };
6
+ /**
7
+ * Stage ③ (interface only / deferred): translate the newest block into `targetLanguage`.
8
+ * Conforms to the `Stage` contract and is inert until a translation backend is wired.
9
+ */
10
+ export declare const makeTranslationStage: (_targetLanguage?: string) => Stage<TranslationInput>;
11
+ //# sourceMappingURL=translation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../../../src/stages/translation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EAAE,KAAK,KAAK,EAAc,MAAM,UAAU,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC,UAAU,EAAE,CAAA;CAAE,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,gCAA6B,KAAK,CAAC,gBAAgB,CAQlF,CAAC"}
@@ -0,0 +1,26 @@
1
+ export type ConversationEntity = {
2
+ /** Type name as written in the fixture, e.g. `Person`, `Organization`. */
3
+ kind: string;
4
+ /** Free-form field values; consumers map these to the relevant ECHO schema. */
5
+ fields: Record<string, string>;
6
+ };
7
+ export type ConversationUtterance = {
8
+ /** Speaker label as written in the fixture (e.g. `A`, `B`, `Rich`). */
9
+ speaker: string;
10
+ /** Raw utterance text. */
11
+ text: string;
12
+ };
13
+ export type ParsedConversation = {
14
+ entities: ConversationEntity[];
15
+ utterances: ConversationUtterance[];
16
+ /** Distinct speaker labels in first-seen order. */
17
+ speakers: string[];
18
+ };
19
+ /**
20
+ * Parse the on-disk conversation format into structured data.
21
+ *
22
+ * Tolerates leading whitespace inside blocks and ignores blank / `#` comment lines.
23
+ * Throws if the input doesn't contain a `Conversation:` block — `Entities:` is optional.
24
+ */
25
+ export declare const parseConversation: (input: string) => ParsedConversation;
26
+ //# sourceMappingURL=conversation-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-parser.d.ts","sourceRoot":"","sources":["../../../../src/testing/conversation-parser.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACpC,mDAAmD;IACnD,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,UAAW,MAAM,KAAG,kBAiEjD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=conversation.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.test.d.ts","sourceRoot":"","sources":["../../../../src/testing/conversation.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { type ScriptedBlock } from './scripted-source';
2
+ /** A short multi-utterance meeting transcript (raw, lower-cased — as Whisper tends to emit). */
3
+ export declare const SAMPLE_MEETING: readonly ScriptedBlock[];
4
+ /** A single-speaker dictation transcript (for the Notes preset). */
5
+ export declare const SAMPLE_NOTES: readonly ScriptedBlock[];
6
+ //# sourceMappingURL=fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../../src/testing/fixtures.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,gGAAgG;AAChG,eAAO,MAAM,cAAc,EAAE,SAAS,aAAa,EAIjD,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,YAAY,EAAE,SAAS,aAAa,EAG/C,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './conversation-parser';
2
+ export * from './fixtures';
3
+ export * from './scripted-source';
4
+ export * from './stream-simulator';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import * as Stream from 'effect/Stream';
2
+ import { TranscriptEvent } from '../TranscriptEvent';
3
+ export type ScriptedBlock = {
4
+ text: string;
5
+ started?: string;
6
+ };
7
+ export type ScriptedSourceOptions = {
8
+ /** Append a trailing silence event (drives on-silence stages). Default: true. */
9
+ readonly silence?: boolean;
10
+ };
11
+ /**
12
+ * Build a deterministic {@link TranscriptEvent} stream from a fixture of blocks. Emits a `block`
13
+ * event per entry, then (by default) a trailing `silence`. No audio or network — for testbench and CI.
14
+ */
15
+ export declare const scriptedSource: (blocks: readonly ScriptedBlock[], options?: ScriptedSourceOptions) => Stream.Stream<TranscriptEvent>;
16
+ //# sourceMappingURL=scripted-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scripted-source.d.ts","sourceRoot":"","sources":["../../../../src/testing/scripted-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG;IAClC,iFAAiF;IACjF,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,WACjB,SAAS,aAAa,EAAE,YACvB,qBAAqB,KAC7B,MAAM,CAAC,MAAM,CAAC,eAAe,CAY/B,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { type ContentBlock } from '@dxos/types';
2
+ import type { ParsedConversation } from './conversation-parser';
3
+ export type StreamSimulatorOptions = {
4
+ /**
5
+ * Average speaking rate, words per second. Used to assign a virtual duration to each
6
+ * utterance so consecutive utterances land at realistic offsets.
7
+ * @default 2.5 (≈150 wpm — typical conversational pace)
8
+ */
9
+ wordsPerSecond?: number;
10
+ /**
11
+ * Gap between consecutive utterances in seconds. Models a brief pause for turn-taking
12
+ * even when speakers don't actually overlap.
13
+ * @default 0.5
14
+ */
15
+ gapSeconds?: number;
16
+ /**
17
+ * Whisper batches typically arrive in chunks of N seconds rather than per-utterance.
18
+ * When set, utterances shorter than `batchSeconds` are merged into the same batch as
19
+ * the following utterance from the same speaker. `0` disables merging — every utterance
20
+ * is its own batch.
21
+ * @default 0
22
+ */
23
+ batchSeconds?: number;
24
+ };
25
+ export type SimulatedBatch = {
26
+ /** Speaker label from the fixture (`A`, `B`, …). Maps to a virtual `identityDid`. */
27
+ speaker: string;
28
+ /** ms offset from the conversation start when this batch is delivered. */
29
+ offsetMs: number;
30
+ /** Whisper-shaped transcript blocks (raw text, no enrichment). */
31
+ blocks: ContentBlock.Transcript[];
32
+ };
33
+ /**
34
+ * Build the chronological batch schedule for a parsed conversation. The result is a
35
+ * pure data structure — consumers iterate and drive virtual time themselves.
36
+ */
37
+ export declare const simulateStream: (conversation: ParsedConversation, options?: StreamSimulatorOptions) => SimulatedBatch[];
38
+ //# sourceMappingURL=stream-simulator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-simulator.d.ts","sourceRoot":"","sources":["../../../../src/testing/stream-simulator.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAyB,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEvF,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,qFAAqF;IACrF,OAAO,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,MAAM,EAAE,YAAY,CAAC,UAAU,EAAE,CAAC;CACnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,iBACX,kBAAkB,YACvB,sBAAsB,KAC9B,cAAc,EAgEhB,CAAC"}