@dxos/plugin-transcription 0.8.3 → 0.8.4-main.1c7ec43d41

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 (330) hide show
  1. package/dist/lib/browser/blueprints/index.mjs +31 -0
  2. package/dist/lib/browser/blueprints/index.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-3L623EVL.mjs +17 -0
  4. package/dist/lib/browser/chunk-3L623EVL.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  6. package/dist/lib/browser/chunk-KAEXRX3Y.mjs +35 -0
  7. package/dist/lib/browser/chunk-KAEXRX3Y.mjs.map +7 -0
  8. package/dist/lib/browser/chunk-L4HW35L6.mjs +111 -0
  9. package/dist/lib/browser/chunk-L4HW35L6.mjs.map +7 -0
  10. package/dist/lib/browser/chunk-MLRJWAQH.mjs +179 -0
  11. package/dist/lib/browser/chunk-MLRJWAQH.mjs.map +7 -0
  12. package/dist/lib/browser/chunk-NQQK7UZQ.mjs +244 -0
  13. package/dist/lib/browser/chunk-NQQK7UZQ.mjs.map +7 -0
  14. package/dist/lib/browser/components/index.mjs +207 -0
  15. package/dist/lib/browser/components/index.mjs.map +7 -0
  16. package/dist/lib/browser/create-ULR5DPJZ.mjs +21 -0
  17. package/dist/lib/browser/create-ULR5DPJZ.mjs.map +7 -0
  18. package/dist/lib/browser/hooks/index.mjs +17 -0
  19. package/dist/lib/browser/index.mjs +442 -94
  20. package/dist/lib/browser/index.mjs.map +4 -4
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/open-SFMPLZVW.mjs +27 -0
  23. package/dist/lib/browser/open-SFMPLZVW.mjs.map +7 -0
  24. package/dist/lib/browser/operations/index.mjs +13 -0
  25. package/dist/lib/browser/operations/index.mjs.map +7 -0
  26. package/dist/lib/browser/summarize-BDFX4APN.mjs +78 -0
  27. package/dist/lib/browser/summarize-BDFX4APN.mjs.map +7 -0
  28. package/dist/lib/browser/types/index.mjs +4 -8
  29. package/dist/lib/node-esm/blueprints/index.mjs +32 -0
  30. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  31. package/dist/lib/node-esm/chunk-7UIZWCD4.mjs +112 -0
  32. package/dist/lib/node-esm/chunk-7UIZWCD4.mjs.map +7 -0
  33. package/dist/lib/node-esm/chunk-C3AE2NYJ.mjs +181 -0
  34. package/dist/lib/node-esm/chunk-C3AE2NYJ.mjs.map +7 -0
  35. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  36. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  37. package/dist/lib/node-esm/chunk-KO3IOD2O.mjs +19 -0
  38. package/dist/lib/node-esm/chunk-KO3IOD2O.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-MQK4R6GT.mjs +245 -0
  40. package/dist/lib/node-esm/chunk-MQK4R6GT.mjs.map +7 -0
  41. package/dist/lib/node-esm/chunk-O533NBMK.mjs +37 -0
  42. package/dist/lib/node-esm/chunk-O533NBMK.mjs.map +7 -0
  43. package/dist/lib/node-esm/components/index.mjs +208 -0
  44. package/dist/lib/node-esm/components/index.mjs.map +7 -0
  45. package/dist/lib/node-esm/create-A5QHNWRF.mjs +22 -0
  46. package/dist/lib/node-esm/create-A5QHNWRF.mjs.map +7 -0
  47. package/dist/lib/node-esm/hooks/index.mjs +18 -0
  48. package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
  49. package/dist/lib/node-esm/index.mjs +442 -94
  50. package/dist/lib/node-esm/index.mjs.map +4 -4
  51. package/dist/lib/node-esm/meta.json +1 -1
  52. package/dist/lib/node-esm/open-OI24QNTO.mjs +28 -0
  53. package/dist/lib/node-esm/open-OI24QNTO.mjs.map +7 -0
  54. package/dist/lib/node-esm/operations/index.mjs +14 -0
  55. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  56. package/dist/lib/node-esm/summarize-3UNN24I2.mjs +79 -0
  57. package/dist/lib/node-esm/summarize-3UNN24I2.mjs.map +7 -0
  58. package/dist/lib/node-esm/types/index.mjs +4 -8
  59. package/dist/types/src/TranscriptionPlugin.d.ts +3 -1
  60. package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
  61. package/dist/types/src/TranscriptionPlugin.node.d.ts +4 -0
  62. package/dist/types/src/TranscriptionPlugin.node.d.ts.map +1 -0
  63. package/dist/types/src/TranscriptionPlugin.test.d.ts +2 -0
  64. package/dist/types/src/TranscriptionPlugin.test.d.ts.map +1 -0
  65. package/dist/types/src/blueprints/index.d.ts +2 -0
  66. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  67. package/dist/types/src/blueprints/transcription-blueprint.d.ts +4 -0
  68. package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -0
  69. package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
  70. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  71. package/dist/types/src/capabilities/index.d.ts +10 -4
  72. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  73. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  74. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  75. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  76. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  77. package/dist/types/src/capabilities/text-content.d.ts +8 -0
  78. package/dist/types/src/capabilities/text-content.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/transcriber.d.ts +4 -3
  80. package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
  81. package/dist/types/src/components/Transcription/Transcription.d.ts +18 -0
  82. package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
  83. package/dist/types/src/components/Transcription/Transcription.stories.d.ts +40 -0
  84. package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -0
  85. package/dist/types/src/components/Transcription/index.d.ts +2 -0
  86. package/dist/types/src/components/Transcription/index.d.ts.map +1 -0
  87. package/dist/types/src/components/Transcription/transcription-extension.d.ts +15 -0
  88. package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -0
  89. package/dist/types/src/components/index.d.ts +1 -6
  90. package/dist/types/src/components/index.d.ts.map +1 -1
  91. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +6 -0
  92. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +1 -0
  93. package/dist/types/src/containers/TranscriptionContainer/index.d.ts +2 -0
  94. package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +1 -0
  95. package/dist/types/src/containers/index.d.ts +3 -0
  96. package/dist/types/src/containers/index.d.ts.map +1 -0
  97. package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
  98. package/dist/types/src/hooks/useAudioTrack.d.ts.map +1 -1
  99. package/dist/types/src/hooks/useQueueModelAdapter.d.ts +1 -1
  100. package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
  101. package/dist/types/src/hooks/useTranscriber.d.ts +2 -2
  102. package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
  103. package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -1
  104. package/dist/types/src/index.d.ts +4 -4
  105. package/dist/types/src/index.d.ts.map +1 -1
  106. package/dist/types/src/meta.d.ts +2 -3
  107. package/dist/types/src/meta.d.ts.map +1 -1
  108. package/dist/types/src/model/model.d.ts +2 -2
  109. package/dist/types/src/model/model.d.ts.map +1 -1
  110. package/dist/types/src/{segments-normalization → normalization}/index.d.ts +1 -1
  111. package/dist/types/src/normalization/index.d.ts.map +1 -0
  112. package/dist/types/src/{segments-normalization → normalization}/message-normalizer.d.ts +5 -5
  113. package/dist/types/src/normalization/message-normalizer.d.ts.map +1 -0
  114. package/dist/types/src/normalization/normalization.d.ts +364 -0
  115. package/dist/types/src/normalization/normalization.d.ts.map +1 -0
  116. package/dist/types/src/normalization/normalization.test.d.ts.map +1 -0
  117. package/dist/types/src/normalization/utils.d.ts +3 -0
  118. package/dist/types/src/normalization/utils.d.ts.map +1 -0
  119. package/dist/types/src/operations/create.d.ts +5 -0
  120. package/dist/types/src/operations/create.d.ts.map +1 -0
  121. package/dist/types/src/operations/definitions.d.ts +917 -0
  122. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  123. package/dist/types/src/operations/index.d.ts +4 -0
  124. package/dist/types/src/operations/index.d.ts.map +1 -0
  125. package/dist/types/src/operations/open.d.ts +5 -0
  126. package/dist/types/src/operations/open.d.ts.map +1 -0
  127. package/dist/types/src/operations/summarize.d.ts +8 -0
  128. package/dist/types/src/operations/summarize.d.ts.map +1 -0
  129. package/dist/types/src/stories/FileTranscription.stories.d.ts +18 -0
  130. package/dist/types/src/stories/FileTranscription.stories.d.ts.map +1 -0
  131. package/dist/types/src/stories/KeyWordRecognition.stories.d.ts +14 -0
  132. package/dist/types/src/stories/KeyWordRecognition.stories.d.ts.map +1 -0
  133. package/dist/types/src/stories/MicrophoneTranscription.stories.d.ts +20 -0
  134. package/dist/types/src/stories/MicrophoneTranscription.stories.d.ts.map +1 -0
  135. package/dist/types/src/stories/TranscriptionStory.d.ts +23 -0
  136. package/dist/types/src/stories/TranscriptionStory.d.ts.map +1 -0
  137. package/dist/types/src/stories/useIsSpeaking.d.ts.map +1 -0
  138. package/dist/types/src/testing/testing.d.ts +10 -10
  139. package/dist/types/src/testing/testing.d.ts.map +1 -1
  140. package/dist/types/src/transcriber/media-stream-recorder.d.ts +3 -3
  141. package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
  142. package/dist/types/src/transcriber/transcriber.d.ts +60 -5
  143. package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
  144. package/dist/types/src/transcriber/transcriber.test.d.ts +2 -0
  145. package/dist/types/src/transcriber/transcriber.test.d.ts.map +1 -0
  146. package/dist/types/src/transcriber/transcription-manager.d.ts +12 -13
  147. package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
  148. package/dist/types/src/translations.d.ts +10 -11
  149. package/dist/types/src/translations.d.ts.map +1 -1
  150. package/dist/types/src/types/capabilities.d.ts +19 -0
  151. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  152. package/dist/types/src/types/defs.d.ts +5 -0
  153. package/dist/types/src/types/defs.d.ts.map +1 -0
  154. package/dist/types/src/types/index.d.ts +2 -2
  155. package/dist/types/src/types/index.d.ts.map +1 -1
  156. package/dist/types/src/util/array.d.ts.map +1 -1
  157. package/dist/types/src/util/get-time-str.d.ts.map +1 -1
  158. package/dist/types/src/util/index.d.ts +1 -0
  159. package/dist/types/src/util/index.d.ts.map +1 -1
  160. package/dist/types/src/util/monitor-audio-level.d.ts.map +1 -1
  161. package/dist/types/src/util/render-byline.d.ts +4 -0
  162. package/dist/types/src/util/render-byline.d.ts.map +1 -0
  163. package/dist/types/tsconfig.tsbuildinfo +1 -1
  164. package/package.json +127 -82
  165. package/src/TranscriptionPlugin.node.ts +20 -0
  166. package/src/TranscriptionPlugin.test.ts +31 -0
  167. package/src/TranscriptionPlugin.tsx +22 -61
  168. package/src/blueprints/index.ts +5 -0
  169. package/src/blueprints/transcription-blueprint.ts +29 -0
  170. package/src/capabilities/blueprint-definition.ts +19 -0
  171. package/src/capabilities/index.ts +11 -6
  172. package/src/capabilities/operation-handler.ts +16 -0
  173. package/src/capabilities/react-surface.tsx +23 -14
  174. package/src/capabilities/text-content.ts +33 -0
  175. package/src/capabilities/transcriber.ts +54 -42
  176. package/src/components/{Transcript/Transcript.stories.tsx → Transcription/Transcription.stories.tsx} +78 -73
  177. package/src/components/Transcription/Transcription.tsx +64 -0
  178. package/src/components/{Transcript → Transcription}/index.ts +1 -1
  179. package/src/components/{Transcript/transcript-extension.ts → Transcription/transcription-extension.ts} +15 -48
  180. package/src/components/index.ts +1 -6
  181. package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +35 -0
  182. package/src/containers/TranscriptionContainer/index.ts +5 -0
  183. package/src/containers/index.ts +7 -0
  184. package/src/hooks/useAudioFile.ts +49 -53
  185. package/src/hooks/useQueueModelAdapter.ts +1 -1
  186. package/src/hooks/useTranscriber.ts +15 -7
  187. package/src/hooks/useVoiceInput.ts +3 -3
  188. package/src/index.ts +10 -5
  189. package/src/meta.ts +9 -6
  190. package/src/model/model.test.ts +27 -21
  191. package/src/model/model.ts +3 -3
  192. package/src/{segments-normalization → normalization}/message-normalizer.ts +20 -19
  193. package/src/{segments-normalization → normalization}/normalization.test.ts +26 -33
  194. package/src/normalization/normalization.ts +77 -0
  195. package/src/{segments-normalization → normalization}/utils.ts +2 -2
  196. package/src/operations/create.ts +24 -0
  197. package/src/operations/definitions.ts +101 -0
  198. package/src/operations/index.ts +13 -0
  199. package/src/operations/open.ts +28 -0
  200. package/src/operations/summarize.ts +101 -0
  201. package/src/{components/stories → stories}/FileTranscription.stories.tsx +99 -72
  202. package/src/{components/stories → stories}/KeyWordRecognition.stories.tsx +46 -40
  203. package/src/{components/stories → stories}/MicrophoneTranscription.stories.tsx +85 -101
  204. package/src/stories/TranscriptionStory.tsx +93 -0
  205. package/src/testing/testing.ts +41 -41
  206. package/src/transcriber/media-stream-recorder.ts +4 -4
  207. package/src/transcriber/transcriber.browser.test.ts +5 -5
  208. package/src/transcriber/transcriber.test.ts +104 -0
  209. package/src/transcriber/transcriber.ts +101 -62
  210. package/src/transcriber/transcription-manager.ts +37 -52
  211. package/src/translations.ts +12 -10
  212. package/src/types/capabilities.ts +39 -0
  213. package/src/types/defs.ts +9 -0
  214. package/src/types/index.ts +2 -2
  215. package/src/util/index.ts +1 -0
  216. package/src/util/render-byline.ts +33 -0
  217. package/dist/lib/browser/TranscriptContainer-H3AZQ4CQ.mjs +0 -11
  218. package/dist/lib/browser/chunk-53AXUEIQ.mjs +0 -764
  219. package/dist/lib/browser/chunk-53AXUEIQ.mjs.map +0 -7
  220. package/dist/lib/browser/chunk-GOF7MJNV.mjs +0 -19
  221. package/dist/lib/browser/chunk-GOF7MJNV.mjs.map +0 -7
  222. package/dist/lib/browser/chunk-IQ5ZRMHZ.mjs +0 -495
  223. package/dist/lib/browser/chunk-IQ5ZRMHZ.mjs.map +0 -7
  224. package/dist/lib/browser/chunk-OSISJM2F.mjs +0 -55
  225. package/dist/lib/browser/chunk-OSISJM2F.mjs.map +0 -7
  226. package/dist/lib/browser/chunk-UDCCT32F.mjs +0 -8
  227. package/dist/lib/browser/chunk-UDCCT32F.mjs.map +0 -7
  228. package/dist/lib/browser/chunk-W2KNYJD6.mjs +0 -16
  229. package/dist/lib/browser/chunk-W2KNYJD6.mjs.map +0 -7
  230. package/dist/lib/browser/intent-resolver-BGADCHVM.mjs +0 -30
  231. package/dist/lib/browser/intent-resolver-BGADCHVM.mjs.map +0 -7
  232. package/dist/lib/browser/react-surface-HMJS5FSS.mjs +0 -34
  233. package/dist/lib/browser/react-surface-HMJS5FSS.mjs.map +0 -7
  234. package/dist/lib/browser/transcriber-OYPLZFG5.mjs +0 -56
  235. package/dist/lib/browser/transcriber-OYPLZFG5.mjs.map +0 -7
  236. package/dist/lib/node/TranscriptContainer-KIG3GMAB.cjs +0 -32
  237. package/dist/lib/node/TranscriptContainer-KIG3GMAB.cjs.map +0 -7
  238. package/dist/lib/node/chunk-3PYT3BDM.cjs +0 -40
  239. package/dist/lib/node/chunk-3PYT3BDM.cjs.map +0 -7
  240. package/dist/lib/node/chunk-6LW5RA3K.cjs +0 -75
  241. package/dist/lib/node/chunk-6LW5RA3K.cjs.map +0 -7
  242. package/dist/lib/node/chunk-AFUZI63A.cjs +0 -42
  243. package/dist/lib/node/chunk-AFUZI63A.cjs.map +0 -7
  244. package/dist/lib/node/chunk-CVUN3UO7.cjs +0 -778
  245. package/dist/lib/node/chunk-CVUN3UO7.cjs.map +0 -7
  246. package/dist/lib/node/chunk-FKDJNJ57.cjs +0 -35
  247. package/dist/lib/node/chunk-FKDJNJ57.cjs.map +0 -7
  248. package/dist/lib/node/chunk-ZFAUMZXE.cjs +0 -518
  249. package/dist/lib/node/chunk-ZFAUMZXE.cjs.map +0 -7
  250. package/dist/lib/node/index.cjs +0 -133
  251. package/dist/lib/node/index.cjs.map +0 -7
  252. package/dist/lib/node/intent-resolver-LL3TTI4H.cjs +0 -45
  253. package/dist/lib/node/intent-resolver-LL3TTI4H.cjs.map +0 -7
  254. package/dist/lib/node/meta.json +0 -1
  255. package/dist/lib/node/react-surface-N25TBBG4.cjs +0 -56
  256. package/dist/lib/node/react-surface-N25TBBG4.cjs.map +0 -7
  257. package/dist/lib/node/transcriber-6J4FVFSZ.cjs +0 -68
  258. package/dist/lib/node/transcriber-6J4FVFSZ.cjs.map +0 -7
  259. package/dist/lib/node/types/index.cjs +0 -36
  260. package/dist/lib/node/types/index.cjs.map +0 -7
  261. package/dist/lib/node-esm/TranscriptContainer-G75LDEO5.mjs +0 -12
  262. package/dist/lib/node-esm/chunk-56QHOX4A.mjs +0 -765
  263. package/dist/lib/node-esm/chunk-56QHOX4A.mjs.map +0 -7
  264. package/dist/lib/node-esm/chunk-FH75X4JC.mjs +0 -56
  265. package/dist/lib/node-esm/chunk-FH75X4JC.mjs.map +0 -7
  266. package/dist/lib/node-esm/chunk-MFJO7EKD.mjs +0 -10
  267. package/dist/lib/node-esm/chunk-MFJO7EKD.mjs.map +0 -7
  268. package/dist/lib/node-esm/chunk-MFJPEIVB.mjs +0 -17
  269. package/dist/lib/node-esm/chunk-MFJPEIVB.mjs.map +0 -7
  270. package/dist/lib/node-esm/chunk-PRL64SRU.mjs +0 -496
  271. package/dist/lib/node-esm/chunk-PRL64SRU.mjs.map +0 -7
  272. package/dist/lib/node-esm/chunk-TXMDLLBR.mjs +0 -21
  273. package/dist/lib/node-esm/chunk-TXMDLLBR.mjs.map +0 -7
  274. package/dist/lib/node-esm/intent-resolver-5LVCYSJS.mjs +0 -31
  275. package/dist/lib/node-esm/intent-resolver-5LVCYSJS.mjs.map +0 -7
  276. package/dist/lib/node-esm/react-surface-JGQSYGRR.mjs +0 -35
  277. package/dist/lib/node-esm/react-surface-JGQSYGRR.mjs.map +0 -7
  278. package/dist/lib/node-esm/transcriber-TVG2MBBN.mjs +0 -57
  279. package/dist/lib/node-esm/transcriber-TVG2MBBN.mjs.map +0 -7
  280. package/dist/types/src/capabilities/capabilities.d.ts +0 -17
  281. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  282. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  283. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  284. package/dist/types/src/components/Transcript/Transcript.d.ts +0 -20
  285. package/dist/types/src/components/Transcript/Transcript.d.ts.map +0 -1
  286. package/dist/types/src/components/Transcript/Transcript.stories.d.ts +0 -24
  287. package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +0 -1
  288. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +0 -28
  289. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +0 -1
  290. package/dist/types/src/components/Transcript/index.d.ts +0 -2
  291. package/dist/types/src/components/Transcript/index.d.ts.map +0 -1
  292. package/dist/types/src/components/Transcript/transcript-extension.d.ts +0 -19
  293. package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +0 -1
  294. package/dist/types/src/components/TranscriptContainer.d.ts +0 -8
  295. package/dist/types/src/components/TranscriptContainer.d.ts.map +0 -1
  296. package/dist/types/src/components/stories/FileTranscription.stories.d.ts +0 -17
  297. package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +0 -1
  298. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +0 -10
  299. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +0 -1
  300. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +0 -19
  301. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +0 -1
  302. package/dist/types/src/components/stories/TranscriptionStory.d.ts +0 -11
  303. package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +0 -1
  304. package/dist/types/src/components/stories/useIsSpeaking.d.ts.map +0 -1
  305. package/dist/types/src/segments-normalization/index.d.ts.map +0 -1
  306. package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +0 -1
  307. package/dist/types/src/segments-normalization/normalization.d.ts +0 -329
  308. package/dist/types/src/segments-normalization/normalization.d.ts.map +0 -1
  309. package/dist/types/src/segments-normalization/normalization.test.d.ts.map +0 -1
  310. package/dist/types/src/segments-normalization/utils.d.ts +0 -3
  311. package/dist/types/src/segments-normalization/utils.d.ts.map +0 -1
  312. package/dist/types/src/types/schema.d.ts +0 -41
  313. package/dist/types/src/types/schema.d.ts.map +0 -1
  314. package/dist/types/src/types/types.d.ts +0 -31
  315. package/dist/types/src/types/types.d.ts.map +0 -1
  316. package/src/capabilities/capabilities.ts +0 -33
  317. package/src/capabilities/intent-resolver.ts +0 -24
  318. package/src/components/Transcript/Transcript.tsx +0 -100
  319. package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -260
  320. package/src/components/TranscriptContainer.tsx +0 -30
  321. package/src/components/stories/TranscriptionStory.tsx +0 -41
  322. package/src/segments-normalization/normalization.ts +0 -105
  323. package/src/types/schema.ts +0 -41
  324. package/src/types/types.ts +0 -32
  325. package/dist/lib/browser/{TranscriptContainer-H3AZQ4CQ.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  326. package/dist/lib/{node-esm/TranscriptContainer-G75LDEO5.mjs.map → browser/hooks/index.mjs.map} +0 -0
  327. package/dist/types/src/{segments-normalization → normalization}/normalization.test.d.ts +0 -0
  328. package/dist/types/src/{components/stories → stories}/useIsSpeaking.d.ts +0 -0
  329. package/src/{segments-normalization → normalization}/index.ts +1 -1
  330. /package/src/{components/stories → stories}/useIsSpeaking.tsx +0 -0
@@ -0,0 +1,31 @@
1
+ import "../chunk-J5LGTIGS.mjs";
2
+
3
+ // src/blueprints/transcription-blueprint.ts
4
+ import { Blueprint, Template } from "@dxos/compute";
5
+ import { trim } from "@dxos/util";
6
+ import { TranscriptOperation } from "#operations";
7
+ var BLUEPRINT_KEY = "org.dxos.blueprint.transcription";
8
+ var make = () => Blueprint.make({
9
+ key: BLUEPRINT_KEY,
10
+ name: "Transcription",
11
+ tools: Blueprint.toolDefinitions({
12
+ operations: [
13
+ TranscriptOperation.Open,
14
+ TranscriptOperation.Summarize
15
+ ]
16
+ }),
17
+ instructions: Template.make({
18
+ source: trim`
19
+ You can open and summarize a meeting transcript.
20
+ `
21
+ })
22
+ });
23
+ var blueprint = {
24
+ key: BLUEPRINT_KEY,
25
+ make
26
+ };
27
+ var transcription_blueprint_default = blueprint;
28
+ export {
29
+ transcription_blueprint_default as TranscriptionBlueprint
30
+ };
31
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/blueprints/transcription-blueprint.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Blueprint, Template } from '@dxos/compute';\nimport { trim } from '@dxos/util';\n\nimport { TranscriptOperation } from '#operations';\n\nconst BLUEPRINT_KEY = 'org.dxos.blueprint.transcription';\n\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'Transcription',\n tools: Blueprint.toolDefinitions({ operations: [TranscriptOperation.Open, TranscriptOperation.Summarize] }),\n instructions: Template.make({\n source: trim`\n You can open and summarize a meeting transcript.\n `,\n }),\n });\n\nconst blueprint: Blueprint.Definition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
5
+ "mappings": ";;;AAIA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAErB,SAASC,2BAA2B;AAEpC,IAAMC,gBAAgB;AAEtB,IAAMC,OAAO,MACXL,UAAUK,KAAK;EACbC,KAAKF;EACLG,MAAM;EACNC,OAAOR,UAAUS,gBAAgB;IAAEC,YAAY;MAACP,oBAAoBQ;MAAMR,oBAAoBS;;EAAW,CAAA;EACzGC,cAAcZ,SAASI,KAAK;IAC1BS,QAAQZ;;;EAGV,CAAA;AACF,CAAA;AAEF,IAAMa,YAAkC;EACtCT,KAAKF;EACLC;AACF;AAEA,IAAA,kCAAeU;",
6
+ "names": ["Blueprint", "Template", "trim", "TranscriptOperation", "BLUEPRINT_KEY", "make", "key", "name", "tools", "toolDefinitions", "operations", "Open", "Summarize", "instructions", "source", "blueprint"]
7
+ }
@@ -0,0 +1,17 @@
1
+ // src/types/capabilities.ts
2
+ import { Capability } from "@dxos/app-framework";
3
+ import { meta } from "#meta";
4
+ (function(TranscriptionCapabilities2) {
5
+ TranscriptionCapabilities2.Transcriber = Capability.make(`${meta.id}.capability.transcriber`);
6
+ TranscriptionCapabilities2.TranscriptionManager = Capability.make(`${meta.id}.capability.transcription-manager`);
7
+ })(TranscriptionCapabilities || (TranscriptionCapabilities = {}));
8
+ var TranscriptionCapabilities;
9
+
10
+ // src/types/defs.ts
11
+ var TRANSCRIPTION_URL = "https://calls-service.dxos.workers.dev";
12
+
13
+ export {
14
+ TranscriptionCapabilities,
15
+ TRANSCRIPTION_URL
16
+ };
17
+ //# sourceMappingURL=chunk-3L623EVL.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/capabilities.ts", "../../../src/types/defs.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nimport {\n type MediaStreamRecorderProps,\n type Transcriber,\n type TranscriberProps,\n type TranscriptMessageEnricher,\n type TranscriptionManager,\n} from '../transcriber';\n\nexport namespace TranscriptionCapabilities {\n export type GetTranscriberProps = {\n audioStreamTrack: MediaStreamTrack;\n recorderConfig?: Partial<MediaStreamRecorderProps['config']>;\n transcriberConfig?: Partial<TranscriberProps['config']>;\n onSegments: TranscriberProps['onSegments'];\n transcribe?: TranscriberProps['transcribe'];\n };\n\n export type GetTranscriber = (props: GetTranscriberProps) => Transcriber;\n\n export type GetTranscriptionManagerProps = {\n messageEnricher?: TranscriptMessageEnricher;\n };\n\n export type GetTranscriptionManager = (props: GetTranscriptionManagerProps) => TranscriptionManager;\n\n export const Transcriber = Capability.make<GetTranscriber>(`${meta.id}.capability.transcriber`);\n\n export const TranscriptionManager = Capability.make<GetTranscriptionManager>(\n `${meta.id}.capability.transcription-manager`,\n );\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * Endpoint to the calls service.\n */\n// TODO(burdon): Reconfigure/move.\nexport const TRANSCRIPTION_URL = 'https://calls-service.dxos.workers.dev';\n"],
5
+ "mappings": ";AAIA,SAASA,kBAAkB;AAE3B,SAASC,YAAY;UAUJC,4BAAAA;6BAiBFC,cAAcH,WAAWI,KAAqB,GAAGH,KAAKI,EAAE,yBAAyB;6BAEjFC,uBAAuBN,WAAWI,KAC7C,GAAGH,KAAKI,EAAE,mCAAmC;AAEjD,GAtBiBH,8BAAAA,4BAAAA,CAAAA,EAAAA;;;;ACRV,IAAMK,oBAAoB;",
6
+ "names": ["Capability", "meta", "TranscriptionCapabilities", "Transcriber", "make", "id", "TranscriptionManager", "TRANSCRIPTION_URL"]
7
+ }
@@ -0,0 +1,10 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ export {
8
+ __export
9
+ };
10
+ //# sourceMappingURL=chunk-J5LGTIGS.mjs.map
@@ -0,0 +1,35 @@
1
+ // src/util/render-byline.ts
2
+ var renderByline = (identities) => (message, index, debug = false) => {
3
+ if (message.sender.role === "assistant") {
4
+ return [
5
+ message.blocks.find((block) => block._tag === "transcript")?.text ?? "",
6
+ ""
7
+ ];
8
+ }
9
+ const identity = identities.find((identity2) => identity2.did === message.sender.identityDid);
10
+ const name = identity?.profile?.displayName ?? message.sender.contact?.target?.fullName ?? message.sender.name ?? message.sender.email ?? message.sender.identityDid;
11
+ const blocks = message.blocks.filter((block) => block._tag === "transcript");
12
+ return [
13
+ // TODO(thure): Use an XML tag with the bits needed here.
14
+ `###### ${name}` + (debug ? ` [${index}]:${message.id}` : ""),
15
+ blocks.map((block) => block.text.trim()).join(" "),
16
+ ""
17
+ ];
18
+ };
19
+
20
+ // src/util/array.ts
21
+ var mergeFloat64Arrays = (arrays) => {
22
+ const newArray = new Float64Array(arrays.reduce((acc, array) => array.length + acc, 0));
23
+ let offset = 0;
24
+ for (const array of arrays) {
25
+ newArray.set(array, offset);
26
+ offset += array.length;
27
+ }
28
+ return newArray;
29
+ };
30
+
31
+ export {
32
+ mergeFloat64Arrays,
33
+ renderByline
34
+ };
35
+ //# sourceMappingURL=chunk-KAEXRX3Y.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/util/render-byline.ts", "../../../src/util/array.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Identity } from '@dxos/react-client/halo';\nimport { type Message } from '@dxos/types';\n\n// TODO(thure): Move this?\nexport const renderByline =\n (identities: Identity[]) =>\n (message: Message.Message, index: number, debug = false): string[] => {\n if (message.sender.role === 'assistant') {\n // Start/stop block.\n return [message.blocks.find((block) => block._tag === 'transcript')?.text ?? '', ''];\n }\n\n // TODO(burdon): Use link/reference markup for users (with popover).\n // TODO(burdon): Color and avatar.\n const identity = identities.find((identity) => identity.did === message.sender.identityDid);\n const name =\n identity?.profile?.displayName ??\n message.sender.contact?.target?.fullName ??\n message.sender.name ??\n message.sender.email ??\n message.sender.identityDid;\n const blocks = message.blocks.filter((block) => block._tag === 'transcript');\n return [\n // TODO(thure): Use an XML tag with the bits needed here.\n `###### ${name}` + (debug ? ` [${index}]:${message.id}` : ''),\n blocks.map((block) => block.text.trim()).join(' '),\n '',\n ];\n };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport const mergeFloat64Arrays = (arrays: Float64Array[]) => {\n const newArray = new Float64Array(arrays.reduce((acc, array) => array.length + acc, 0));\n let offset = 0;\n for (const array of arrays) {\n newArray.set(array, offset);\n offset += array.length;\n }\n\n return newArray;\n};\n"],
5
+ "mappings": ";AAQO,IAAMA,eACX,CAACC,eACD,CAACC,SAA0BC,OAAeC,QAAQ,UAAK;AACrD,MAAIF,QAAQG,OAAOC,SAAS,aAAa;AAEvC,WAAO;MAACJ,QAAQK,OAAOC,KAAK,CAACC,UAAUA,MAAMC,SAAS,YAAA,GAAeC,QAAQ;MAAI;;EACnF;AAIA,QAAMC,WAAWX,WAAWO,KAAK,CAACI,cAAaA,UAASC,QAAQX,QAAQG,OAAOS,WAAW;AAC1F,QAAMC,OACJH,UAAUI,SAASC,eACnBf,QAAQG,OAAOa,SAASC,QAAQC,YAChClB,QAAQG,OAAOU,QACfb,QAAQG,OAAOgB,SACfnB,QAAQG,OAAOS;AACjB,QAAMP,SAASL,QAAQK,OAAOe,OAAO,CAACb,UAAUA,MAAMC,SAAS,YAAA;AAC/D,SAAO;;IAEL,UAAUK,IAAAA,MAAUX,QAAQ,KAAKD,KAAAA,KAAUD,QAAQqB,EAAE,KAAK;IAC1DhB,OAAOiB,IAAI,CAACf,UAAUA,MAAME,KAAKc,KAAI,CAAA,EAAIC,KAAK,GAAA;IAC9C;;AAEJ;;;AC5BK,IAAMC,qBAAqB,CAACC,WAAAA;AACjC,QAAMC,WAAW,IAAIC,aAAaF,OAAOG,OAAO,CAACC,KAAKC,UAAUA,MAAMC,SAASF,KAAK,CAAA,CAAA;AACpF,MAAIG,SAAS;AACb,aAAWF,SAASL,QAAQ;AAC1BC,aAASO,IAAIH,OAAOE,MAAAA;AACpBA,cAAUF,MAAMC;EAClB;AAEA,SAAOL;AACT;",
6
+ "names": ["renderByline", "identities", "message", "index", "debug", "sender", "role", "blocks", "find", "block", "_tag", "text", "identity", "did", "identityDid", "name", "profile", "displayName", "contact", "target", "fullName", "email", "filter", "id", "map", "trim", "join", "mergeFloat64Arrays", "arrays", "newArray", "Float64Array", "reduce", "acc", "array", "length", "offset", "set"]
7
+ }
@@ -0,0 +1,111 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-J5LGTIGS.mjs";
4
+
5
+ // src/operations/definitions.ts
6
+ var definitions_exports = {};
7
+ __export(definitions_exports, {
8
+ Create: () => Create,
9
+ MessageWithRangeId: () => MessageWithRangeId,
10
+ Open: () => Open,
11
+ SentenceNormalization: () => SentenceNormalization,
12
+ SentenceNormalizationInput: () => SentenceNormalizationInput,
13
+ SentenceNormalizationOutput: () => SentenceNormalizationOutput,
14
+ Summarize: () => Summarize
15
+ });
16
+ import * as Schema from "effect/Schema";
17
+ import { AiService } from "@dxos/ai";
18
+ import { SpaceSchema } from "@dxos/client/echo";
19
+ import { Operation } from "@dxos/compute";
20
+ import { Database, Feed, Ref } from "@dxos/echo";
21
+ import { Message, Transcript } from "@dxos/types";
22
+ import { meta } from "#meta";
23
+ var TRANSCRIPT_OPERATION = `${meta.id}.operation`;
24
+ var Create = Operation.make({
25
+ meta: {
26
+ key: `${TRANSCRIPT_OPERATION}.create`,
27
+ name: "Create Transcript"
28
+ },
29
+ input: Schema.Struct({
30
+ name: Schema.optional(Schema.String),
31
+ space: SpaceSchema
32
+ }),
33
+ output: Schema.Struct({
34
+ object: Transcript.Transcript
35
+ })
36
+ });
37
+ var MessageWithRangeId = Schema.extend(Message.Message, Schema.Struct({
38
+ rangeId: Schema.optional(Schema.Array(Schema.String)).annotations({
39
+ description: "The IDs of the messages that contain the sentences."
40
+ })
41
+ }));
42
+ var Open = Operation.make({
43
+ meta: {
44
+ key: "org.dxos.function.transcription.open",
45
+ name: "Open",
46
+ description: "Opens and reads the contents of a transcription object."
47
+ },
48
+ input: Schema.Struct({
49
+ transcript: Ref.Ref(Transcript.Transcript).annotations({
50
+ description: "The ID of the transcription object."
51
+ })
52
+ }),
53
+ output: Schema.Struct({
54
+ content: Schema.String
55
+ }),
56
+ services: [
57
+ Database.Service,
58
+ Feed.FeedService
59
+ ]
60
+ });
61
+ var Summarize = Operation.make({
62
+ meta: {
63
+ key: "org.dxos.function.transcription.summarize",
64
+ name: "Summarize",
65
+ description: "Summarize a transcript of a meeting."
66
+ },
67
+ input: Schema.Struct({
68
+ transcript: Schema.String.annotations({
69
+ description: "The transcript of the meeting."
70
+ }),
71
+ notes: Schema.optional(Schema.String).annotations({
72
+ description: "Additional notes from the participants."
73
+ })
74
+ }),
75
+ output: Schema.Struct({
76
+ summary: Schema.String.annotations({
77
+ description: "The summary of the transcript."
78
+ })
79
+ }),
80
+ services: [
81
+ AiService.AiService
82
+ ]
83
+ });
84
+ var SentenceNormalizationInput = Schema.Struct({
85
+ messages: Schema.Array(MessageWithRangeId).annotations({
86
+ description: "Messages to normalize into sentences."
87
+ })
88
+ });
89
+ var SentenceNormalizationOutput = Schema.Struct({
90
+ sentences: Schema.Array(MessageWithRangeId.pipe(Schema.mutable)).pipe(Schema.mutable).annotations({
91
+ description: "The sentences of the transcript."
92
+ })
93
+ });
94
+ var SentenceNormalization = Operation.make({
95
+ meta: {
96
+ key: "org.dxos.function.transcription.sentence-normalization",
97
+ name: "Sentence Normalization",
98
+ description: "Post process of transcription for sentence normalization"
99
+ },
100
+ input: SentenceNormalizationInput,
101
+ output: SentenceNormalizationOutput,
102
+ services: []
103
+ });
104
+
105
+ export {
106
+ Create,
107
+ Open,
108
+ Summarize,
109
+ definitions_exports
110
+ };
111
+ //# sourceMappingURL=chunk-L4HW35L6.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/definitions.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiService } from '@dxos/ai';\nimport { SpaceSchema } from '@dxos/client/echo';\nimport { Operation } from '@dxos/compute';\nimport { Database, Feed, Ref } from '@dxos/echo';\nimport { Message, Transcript } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nconst TRANSCRIPT_OPERATION = `${meta.id}.operation`;\n\nexport const Create = Operation.make({\n meta: { key: `${TRANSCRIPT_OPERATION}.create`, name: 'Create Transcript' },\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n space: SpaceSchema,\n }),\n output: Schema.Struct({\n object: Transcript.Transcript,\n }),\n});\n\nexport const MessageWithRangeId = Schema.extend(\n Message.Message,\n Schema.Struct({\n rangeId: Schema.optional(Schema.Array(Schema.String)).annotations({\n description: 'The IDs of the messages that contain the sentences.',\n }),\n }),\n);\n\nexport type MessageWithRangeIdType = Schema.Schema.Type<typeof MessageWithRangeId>;\n\nexport const Open = Operation.make({\n meta: {\n key: 'org.dxos.function.transcription.open',\n name: 'Open',\n description: 'Opens and reads the contents of a transcription object.',\n },\n input: Schema.Struct({\n transcript: Ref.Ref(Transcript.Transcript).annotations({\n description: 'The ID of the transcription object.',\n }),\n }),\n output: Schema.Struct({\n content: Schema.String,\n }),\n services: [Database.Service, Feed.FeedService],\n});\n\nexport const Summarize = Operation.make({\n meta: {\n key: 'org.dxos.function.transcription.summarize',\n name: 'Summarize',\n description: 'Summarize a transcript of a meeting.',\n },\n input: Schema.Struct({\n transcript: Schema.String.annotations({\n description: 'The transcript of the meeting.',\n }),\n notes: Schema.optional(Schema.String).annotations({\n description: 'Additional notes from the participants.',\n }),\n }),\n output: Schema.Struct({\n summary: Schema.String.annotations({\n description: 'The summary of the transcript.',\n }),\n }),\n services: [AiService.AiService],\n});\n\nexport const SentenceNormalizationInput = Schema.Struct({\n messages: Schema.Array(MessageWithRangeId).annotations({\n description: 'Messages to normalize into sentences.',\n }),\n});\n\nexport type SentenceNormalizationInputType = Schema.Schema.Type<typeof SentenceNormalizationInput>;\n\nexport const SentenceNormalizationOutput = Schema.Struct({\n sentences: Schema.Array(MessageWithRangeId.pipe(Schema.mutable)).pipe(Schema.mutable).annotations({\n description: 'The sentences of the transcript.',\n }),\n});\n\nexport const SentenceNormalization = Operation.make({\n meta: {\n key: 'org.dxos.function.transcription.sentence-normalization',\n name: 'Sentence Normalization',\n description: 'Post process of transcription for sentence normalization',\n },\n input: SentenceNormalizationInput,\n output: SentenceNormalizationOutput,\n services: [],\n});\n"],
5
+ "mappings": ";;;;;AAAA;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1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,CAAA;AAEO,IAAMqC,6BAAoCrB,cAAO;EACtDsB,UAAiBb,aAAMH,kBAAAA,EAAoBI,YAAY;IACrDC,aAAa;EACf,CAAA;AACF,CAAA;AAIO,IAAMY,8BAAqCvB,cAAO;EACvDwB,WAAkBf,aAAMH,mBAAmBmB,KAAYC,cAAO,CAAA,EAAGD,KAAYC,cAAO,EAAEhB,YAAY;IAChGC,aAAa;EACf,CAAA;AACF,CAAA;AAEO,IAAMgB,wBAAwBzC,UAAUU,KAAK;EAClDJ,MAAM;IACJK,KAAK;IACLC,MAAM;IACNa,aAAa;EACf;EACAZ,OAAOsB;EACPjB,QAAQmB;EACRR,UAAU,CAAA;AACZ,CAAA;",
6
+ "names": ["Schema", "AiService", "SpaceSchema", "Operation", "Database", "Feed", "Ref", "Message", "Transcript", "meta", "TRANSCRIPT_OPERATION", "id", "Create", "make", "key", "name", "input", "Struct", "optional", "String", "space", "output", "object", "MessageWithRangeId", "extend", "rangeId", "Array", "annotations", "description", "Open", "transcript", "content", "services", "Service", "FeedService", "Summarize", "notes", "summary", "SentenceNormalizationInput", "messages", "SentenceNormalizationOutput", "sentences", "pipe", "mutable", "SentenceNormalization"]
7
+ }
@@ -0,0 +1,179 @@
1
+ // src/model/model.ts
2
+ import { Text } from "@codemirror/state";
3
+ import { Event } from "@dxos/async";
4
+ import { invariant } from "@dxos/invariant";
5
+ import { log } from "@dxos/log";
6
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/model/model.ts";
7
+ var DocumentAdapter = class {
8
+ _view;
9
+ constructor(_view) {
10
+ this._view = _view;
11
+ }
12
+ /** The document must always have at least one line. */
13
+ lineCount() {
14
+ return this._view.state.doc.lines - 1;
15
+ }
16
+ replaceLines(from, remove, insert) {
17
+ log("replaceLines", {
18
+ count: this._view.state.doc.lines,
19
+ from,
20
+ remove,
21
+ insert
22
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 19, S: this });
23
+ const numLines = this._view.state.doc.lines;
24
+ const posFrom = this._view.state.doc.line(from).from;
25
+ const posTo = remove === 0 ? posFrom : this._view.state.doc.line(Math.min(numLines, from + remove)).from;
26
+ let text = insert.join("\n");
27
+ if (posTo === this._view.state.doc.length) {
28
+ text += "\n";
29
+ }
30
+ this._view.dispatch({
31
+ changes: {
32
+ from: posFrom,
33
+ to: posTo,
34
+ insert: text
35
+ }
36
+ });
37
+ }
38
+ };
39
+ var SerializationModel = class {
40
+ _renderer;
41
+ /** Emits when the document is updated. */
42
+ update = new Event();
43
+ /** Ordered set of chunks. */
44
+ _chunks = [];
45
+ /** Map of chunk IDs to their current line counts. */
46
+ _chunkLineCounts = /* @__PURE__ */ new Map();
47
+ /** Map of line numbers to chunk IDs. */
48
+ _lineToChunk = /* @__PURE__ */ new Map();
49
+ /** Track chunk changes since last sync. */
50
+ _changes = [];
51
+ constructor(_renderer, initialChunks = []) {
52
+ this._renderer = _renderer;
53
+ initialChunks.forEach((chunk) => {
54
+ this.appendChunk(chunk);
55
+ });
56
+ }
57
+ toJSON() {
58
+ return {
59
+ chunks: this._chunks.length,
60
+ changes: this._changes.length
61
+ };
62
+ }
63
+ get doc() {
64
+ return Text.of([
65
+ ...this._chunks.flatMap((chunk, index) => this._renderer(chunk, index)),
66
+ ""
67
+ ]);
68
+ }
69
+ get chunks() {
70
+ return this._chunks;
71
+ }
72
+ /**
73
+ * Get the block ID at the given line number.
74
+ */
75
+ getChunkAtLine(line) {
76
+ return this._lineToChunk.get(line);
77
+ }
78
+ reset() {
79
+ this._chunks.length = 0;
80
+ this._chunkLineCounts.clear();
81
+ this._lineToChunk.clear();
82
+ this.update.emit();
83
+ return this;
84
+ }
85
+ appendChunk(chunk) {
86
+ const index = this._chunks.length;
87
+ this._chunks.push(chunk);
88
+ this._changes.push({
89
+ type: "append",
90
+ index,
91
+ chunk
92
+ });
93
+ this.update.emit();
94
+ return this;
95
+ }
96
+ updateChunk(chunk) {
97
+ const index = this._chunks.findIndex((c) => c.id === chunk.id);
98
+ invariant(index !== -1, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 102, S: this, A: ["index !== -1", ""] });
99
+ this._chunks[index] = chunk;
100
+ this._changes.push({
101
+ type: "update",
102
+ index,
103
+ chunk
104
+ });
105
+ this.update.emit();
106
+ return this;
107
+ }
108
+ deleteBlock(id) {
109
+ const index = this._chunks.findIndex((c) => c.id === id);
110
+ invariant(index !== -1, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 114, S: this, A: ["index !== -1", ""] });
111
+ this._chunks.splice(index, 1);
112
+ this._changes.push({
113
+ type: "delete",
114
+ index,
115
+ id
116
+ });
117
+ this.update.emit();
118
+ return this;
119
+ }
120
+ /**
121
+ * Syncs the tracked changes with the ChunkDocument.
122
+ */
123
+ sync(document) {
124
+ log("sync", {
125
+ changes: this._changes
126
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 127, S: this });
127
+ for (const change of this._changes) {
128
+ switch (change.type) {
129
+ case "append": {
130
+ const lines = this._renderer(change.chunk, change.index);
131
+ const lastLine = document.lineCount();
132
+ document.replaceLines(lastLine + 1, 0, lines);
133
+ break;
134
+ }
135
+ case "update": {
136
+ let lineStart = 1;
137
+ for (let i = 0; i < change.index; i++) {
138
+ lineStart += this._chunkLineCounts.get(this._chunks[i].id);
139
+ }
140
+ const previousLineCount = this._chunkLineCounts.get(change.chunk.id);
141
+ const newLines = this._renderer(change.chunk, change.index);
142
+ document.replaceLines(lineStart, previousLineCount, newLines);
143
+ break;
144
+ }
145
+ case "delete": {
146
+ let lineStart = 1;
147
+ for (let i = 0; i < change.index; i++) {
148
+ lineStart += this._chunkLineCounts.get(this._chunks[i].id);
149
+ }
150
+ const previousLineCount = this._chunkLineCounts.get(change.id);
151
+ document.replaceLines(lineStart, previousLineCount, []);
152
+ break;
153
+ }
154
+ }
155
+ }
156
+ this._lineToChunk.clear();
157
+ let currentLine = 1;
158
+ for (const [index, chunk] of this._chunks.entries()) {
159
+ const lineCount = this._renderer(chunk, index).length;
160
+ this._chunkLineCounts.set(chunk.id, lineCount);
161
+ this._lineToChunk.set(currentLine, chunk);
162
+ currentLine += lineCount;
163
+ }
164
+ const chunkIds = new Set(this._chunks.map((chunk) => chunk.id));
165
+ for (const id of this._chunkLineCounts.keys()) {
166
+ if (!chunkIds.has(id)) {
167
+ this._chunkLineCounts.delete(id);
168
+ }
169
+ }
170
+ this._changes.length = 0;
171
+ return this;
172
+ }
173
+ };
174
+
175
+ export {
176
+ DocumentAdapter,
177
+ SerializationModel
178
+ };
179
+ //# sourceMappingURL=chunk-MLRJWAQH.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/model/model.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Text } from '@codemirror/state';\nimport { type EditorView } from '@codemirror/view';\n\nimport { Event } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\n\nexport type Chunk = { id: string };\n\n/**\n * Covert block to a set of markdown lines.\n */\nexport type ChunkRenderer<T extends Chunk> = (chunk: T, index: number, debug?: boolean) => string[];\n\n/**\n * Abstract representation of the document model.\n */\nexport interface ChunkDocument {\n lineCount(): number;\n replaceLines(from: number, remove: number, insert: string[]): void;\n}\n\n/**\n * Codemirror document adapter.\n */\nexport class DocumentAdapter implements ChunkDocument {\n constructor(private readonly _view: EditorView) {}\n\n /** The document must always have at least one line. */\n lineCount(): number {\n return this._view.state.doc.lines - 1;\n }\n\n replaceLines(from: number, remove: number, insert: string[]): void {\n log('replaceLines', { count: this._view.state.doc.lines, from, remove, insert });\n\n const numLines = this._view.state.doc.lines;\n const posFrom = this._view.state.doc.line(from).from;\n const posTo = remove === 0 ? posFrom : this._view.state.doc.line(Math.min(numLines, from + remove)).from;\n\n // Don't remove the last line.\n let text = insert.join('\\n');\n if (posTo === this._view.state.doc.length) {\n text += '\\n';\n }\n\n this._view.dispatch({\n changes: { from: posFrom, to: posTo, insert: text },\n });\n }\n}\n\ntype ChunkChange<T extends Chunk> =\n | {\n type: 'append';\n index: number;\n chunk: T;\n }\n | {\n type: 'update';\n index: number;\n chunk: T;\n }\n | {\n type: 'delete';\n index: number;\n id: string;\n };\n\n/**\n * Each Chunk can be converted into a set of lines.\n * Chunks can be added, updated or deleted from the Queue.\n * A Document is an immutable projection that represents a flat list of lines corresponding to the Queue.\n *\n * Ideally we would implement a custom virtual Text model for the View, but this currently isn't possible in Codemirror.\n * Instead this model tracks changes and syncs them with the ChunkDocument.\n */\nexport class SerializationModel<T extends Chunk> {\n /** Emits when the document is updated. */\n public readonly update = new Event<void>();\n\n /** Ordered set of chunks. */\n private readonly _chunks: T[] = [];\n\n /** Map of chunk IDs to their current line counts. */\n private readonly _chunkLineCounts = new Map<string, number>();\n\n /** Map of line numbers to chunk IDs. */\n private readonly _lineToChunk = new Map<number, T>();\n\n /** Track chunk changes since last sync. */\n private readonly _changes: Array<ChunkChange<T>> = [];\n\n constructor(\n private readonly _renderer: ChunkRenderer<T>,\n initialChunks: T[] = [],\n ) {\n initialChunks.forEach((chunk) => {\n this.appendChunk(chunk);\n });\n }\n\n toJSON(): { chunks: number; changes: number } {\n return {\n chunks: this._chunks.length,\n changes: this._changes.length,\n };\n }\n\n get doc() {\n return Text.of([...this._chunks.flatMap((chunk, index) => this._renderer(chunk, index)), '']);\n }\n\n get chunks() {\n return this._chunks;\n }\n\n /**\n * Get the block ID at the given line number.\n */\n getChunkAtLine(line: number): T | undefined {\n return this._lineToChunk.get(line);\n }\n\n reset(): this {\n this._chunks.length = 0;\n this._chunkLineCounts.clear();\n this._lineToChunk.clear();\n this.update.emit();\n return this;\n }\n\n appendChunk(chunk: T): this {\n const index = this._chunks.length;\n this._chunks.push(chunk);\n this._changes.push({ type: 'append', index, chunk });\n this.update.emit();\n return this;\n }\n\n updateChunk(chunk: T): this {\n const index = this._chunks.findIndex((c) => c.id === chunk.id);\n invariant(index !== -1);\n this._chunks[index] = chunk;\n this._changes.push({ type: 'update', index, chunk });\n this.update.emit();\n return this;\n }\n\n deleteBlock(id: string): this {\n const index = this._chunks.findIndex((c) => c.id === id);\n invariant(index !== -1);\n this._chunks.splice(index, 1);\n this._changes.push({ type: 'delete', index, id });\n this.update.emit();\n return this;\n }\n\n /**\n * Syncs the tracked changes with the ChunkDocument.\n */\n sync(document: ChunkDocument): this {\n log('sync', { changes: this._changes });\n\n // Process each change in order.\n for (const change of this._changes) {\n switch (change.type) {\n case 'append': {\n // For appends, convert block to lines and add at the end.\n const lines = this._renderer(change.chunk, change.index);\n const lastLine = document.lineCount();\n document.replaceLines(lastLine + 1, 0, lines);\n break;\n }\n\n case 'update': {\n // For updates, find the block's line range and replace with new lines.\n let lineStart = 1;\n for (let i = 0; i < change.index; i++) {\n lineStart += this._chunkLineCounts.get(this._chunks[i].id)!;\n }\n const previousLineCount = this._chunkLineCounts.get(change.chunk.id)!;\n const newLines = this._renderer(change.chunk, change.index);\n document.replaceLines(lineStart, previousLineCount, newLines);\n break;\n }\n\n case 'delete': {\n // For deletes, find the block's line range and remove those lines.\n let lineStart = 1;\n for (let i = 0; i < change.index; i++) {\n lineStart += this._chunkLineCounts.get(this._chunks[i].id)!;\n }\n const previousLineCount = this._chunkLineCounts.get(change.id)!;\n document.replaceLines(lineStart, previousLineCount, []);\n break;\n }\n }\n }\n\n // Clear the line-to-block mapping.\n this._lineToChunk.clear();\n\n // Update all block line counts and line-to-block mapping after processing changes.\n let currentLine = 1;\n for (const [index, chunk] of this._chunks.entries()) {\n const lineCount = this._renderer(chunk, index).length;\n this._chunkLineCounts.set(chunk.id, lineCount);\n this._lineToChunk.set(currentLine, chunk);\n currentLine += lineCount;\n }\n\n // Clean up deleted blocks.\n const chunkIds = new Set(this._chunks.map((chunk) => chunk.id));\n for (const id of this._chunkLineCounts.keys()) {\n if (!chunkIds.has(id)) {\n this._chunkLineCounts.delete(id);\n }\n }\n\n // Clear changes after sync.\n this._changes.length = 0;\n return this;\n }\n}\n"],
5
+ "mappings": ";AAIA,S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AAA;AACF,aAAA,iBAAA,OAAA,EAAA;MAEA;IACA;AAEF,SAAA,SAAA,SAAA;AACF,WAAA;;;",
6
+ "names": ["Text", "Event", "invariant", "log", "_view", "replaceLines", "from", "remove", "insert", "count", "state", "posFrom", "line", "posTo", "text", "dispatch", "_chunkLineCounts", "_lineToChunk", "_changes", "_renderer", "initialChunks", "forEach", "chunk", "appendChunk", "toJSON", "chunks", "changes", "doc", "reset", "clear", "update", "_chunks", "push", "type", "index", "updateChunk", "deleteBlock", "splice", "id", "change", "document", "lastLine", "lines", "lineStart", "previousLineCount", "get", "newLines", "currentLine", "lineCount", "set", "chunkIds"]
7
+ }