@dxos/plugin-transcription 0.9.0 → 0.9.1-main.c7dcc2e112

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 (109) hide show
  1. package/PLUGIN.mdl +20 -0
  2. package/dist/lib/neutral/{TranscriptionArticle-L6XANBH5.mjs → TranscriptionArticle-S56VVOSF.mjs} +3 -3
  3. package/dist/lib/neutral/{TranscriptionArticle-L6XANBH5.mjs.map → TranscriptionArticle-S56VVOSF.mjs.map} +3 -3
  4. package/dist/lib/neutral/TranscriptionPlugin.mjs +6 -4
  5. package/dist/lib/neutral/TranscriptionPlugin.mjs.map +4 -4
  6. package/dist/lib/neutral/capabilities/index.mjs +5 -3
  7. package/dist/lib/neutral/capabilities/index.mjs.map +3 -3
  8. package/dist/lib/neutral/{chunk-KMT3BMMQ.mjs → chunk-2URVUJT4.mjs} +57 -22
  9. package/dist/lib/neutral/chunk-2URVUJT4.mjs.map +7 -0
  10. package/dist/lib/neutral/chunk-J4ONEYPJ.mjs +8 -0
  11. package/dist/lib/neutral/{chunk-KXJZEYS7.mjs.map → chunk-J4ONEYPJ.mjs.map} +2 -2
  12. package/dist/lib/neutral/{chunk-TO77KAQK.mjs → chunk-XMHH34NI.mjs} +25 -5
  13. package/dist/lib/neutral/{chunk-TO77KAQK.mjs.map → chunk-XMHH34NI.mjs.map} +3 -3
  14. package/dist/lib/neutral/{chunk-KAEXRX3Y.mjs → chunk-XOXHWMXR.mjs} +1 -1
  15. package/dist/lib/neutral/{chunk-TX3NQISZ.mjs → chunk-XWC5BBOY.mjs} +3 -3
  16. package/dist/lib/neutral/{chunk-TX3NQISZ.mjs.map → chunk-XWC5BBOY.mjs.map} +3 -3
  17. package/dist/lib/neutral/chunk-XZVDAYM6.mjs +54 -0
  18. package/dist/lib/neutral/chunk-XZVDAYM6.mjs.map +7 -0
  19. package/dist/lib/neutral/containers/index.mjs +1 -1
  20. package/dist/lib/neutral/{create-RVR7VC33.mjs → create-7NGOP7JP.mjs} +2 -2
  21. package/dist/lib/neutral/enrich-message-F2AOM53F.mjs +24 -0
  22. package/dist/lib/neutral/enrich-message-F2AOM53F.mjs.map +7 -0
  23. package/dist/lib/neutral/hooks/index.mjs +1 -1
  24. package/dist/lib/neutral/index.mjs +7 -5
  25. package/dist/lib/neutral/meta.json +1 -1
  26. package/dist/lib/neutral/meta.mjs +1 -1
  27. package/dist/lib/neutral/{open-A5KXKRH4.mjs → open-42H72C4G.mjs} +3 -3
  28. package/dist/lib/neutral/operations/index.mjs +1 -1
  29. package/dist/lib/neutral/plugin.mjs +2 -2
  30. package/dist/lib/neutral/settings-DUS32HOM.mjs +30 -0
  31. package/dist/lib/neutral/settings-DUS32HOM.mjs.map +7 -0
  32. package/dist/lib/neutral/{summarize-5XPPMVTE.mjs → summarize-45WVUPED.mjs} +3 -3
  33. package/dist/lib/neutral/{summarize-5XPPMVTE.mjs.map → summarize-45WVUPED.mjs.map} +1 -1
  34. package/dist/lib/neutral/{text-content-KBB37HSM.mjs → text-content-XZ3HK4OT.mjs} +9 -7
  35. package/dist/lib/neutral/text-content-XZ3HK4OT.mjs.map +7 -0
  36. package/dist/lib/neutral/{transcriber-OGSF3XO5.mjs → transcriber-KYV6NWI5.mjs} +3 -3
  37. package/dist/lib/neutral/translations.mjs +1 -1
  38. package/dist/lib/neutral/translations.mjs.map +3 -3
  39. package/dist/lib/neutral/types/index.mjs +3 -1
  40. package/dist/types/dx.config.d.ts +28 -0
  41. package/dist/types/dx.config.d.ts.map +1 -0
  42. package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
  43. package/dist/types/src/capabilities/index.d.ts +5 -8
  44. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  45. package/dist/types/src/capabilities/react-surface.d.ts +2 -2
  46. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/settings.d.ts +7 -0
  48. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  49. package/dist/types/src/hooks/useTranscriptionRecording.d.ts.map +1 -1
  50. package/dist/types/src/meta.d.ts +28 -2
  51. package/dist/types/src/meta.d.ts.map +1 -1
  52. package/dist/types/src/operations/enrich-message.d.ts +9 -0
  53. package/dist/types/src/operations/enrich-message.d.ts.map +1 -0
  54. package/dist/types/src/operations/index.d.ts.map +1 -1
  55. package/dist/types/src/stories/LiveTranscription.stories.d.ts +1 -2
  56. package/dist/types/src/stories/LiveTranscription.stories.d.ts.map +1 -1
  57. package/dist/types/src/stories/ProperNounExtraction.stories.d.ts +13 -0
  58. package/dist/types/src/stories/ProperNounExtraction.stories.d.ts.map +1 -0
  59. package/dist/types/src/stories/common.d.ts.map +1 -1
  60. package/dist/types/src/testing/testing.d.ts +0 -4
  61. package/dist/types/src/testing/testing.d.ts.map +1 -1
  62. package/dist/types/src/types/Settings.d.ts +7 -0
  63. package/dist/types/src/types/Settings.d.ts.map +1 -0
  64. package/dist/types/src/types/TranscriptOperation.d.ts +407 -0
  65. package/dist/types/src/types/TranscriptOperation.d.ts.map +1 -1
  66. package/dist/types/src/types/TranscriptionCapabilities.d.ts +3 -0
  67. package/dist/types/src/types/TranscriptionCapabilities.d.ts.map +1 -1
  68. package/dist/types/src/types/index.d.ts +1 -0
  69. package/dist/types/src/types/index.d.ts.map +1 -1
  70. package/dist/types/src/util/index.d.ts +0 -1
  71. package/dist/types/src/util/index.d.ts.map +1 -1
  72. package/dist/types/tsconfig.tsbuildinfo +1 -1
  73. package/dx.config.ts +42 -0
  74. package/package.json +43 -42
  75. package/src/TranscriptionPlugin.test.ts +1 -1
  76. package/src/TranscriptionPlugin.tsx +10 -2
  77. package/src/capabilities/index.ts +2 -7
  78. package/src/capabilities/settings.ts +33 -0
  79. package/src/capabilities/text-content.ts +9 -5
  80. package/src/containers/TranscriptionArticle/TranscriptionArticle.tsx +1 -1
  81. package/src/enrichment/operations.ts +1 -1
  82. package/src/hooks/useTranscriptionRecording.ts +26 -4
  83. package/src/meta.ts +2 -35
  84. package/src/operations/enrich-message.ts +27 -0
  85. package/src/operations/index.ts +1 -0
  86. package/src/operations/summarize.ts +1 -1
  87. package/src/stories/LiveTranscription.stories.tsx +13 -67
  88. package/src/stories/ProperNounExtraction.stories.tsx +99 -0
  89. package/src/stories/common.ts +2 -1
  90. package/src/testing/testing.ts +4 -89
  91. package/src/transcriber/transcription-manager.ts +1 -1
  92. package/src/translations.ts +1 -1
  93. package/src/types/Settings.ts +21 -0
  94. package/src/types/TranscriptOperation.ts +17 -1
  95. package/src/types/TranscriptionCapabilities.ts +7 -2
  96. package/src/types/index.ts +1 -0
  97. package/src/util/index.ts +0 -1
  98. package/dist/lib/neutral/chunk-FHNI26QW.mjs +0 -45
  99. package/dist/lib/neutral/chunk-FHNI26QW.mjs.map +0 -7
  100. package/dist/lib/neutral/chunk-KMT3BMMQ.mjs.map +0 -7
  101. package/dist/lib/neutral/chunk-KXJZEYS7.mjs +0 -8
  102. package/dist/lib/neutral/text-content-KBB37HSM.mjs.map +0 -7
  103. package/dist/types/src/util/monitor-audio-level.d.ts +0 -6
  104. package/dist/types/src/util/monitor-audio-level.d.ts.map +0 -1
  105. package/src/util/monitor-audio-level.ts +0 -58
  106. /package/dist/lib/neutral/{chunk-KAEXRX3Y.mjs.map → chunk-XOXHWMXR.mjs.map} +0 -0
  107. /package/dist/lib/neutral/{create-RVR7VC33.mjs.map → create-7NGOP7JP.mjs.map} +0 -0
  108. /package/dist/lib/neutral/{open-A5KXKRH4.mjs.map → open-42H72C4G.mjs.map} +0 -0
  109. /package/dist/lib/neutral/{transcriber-OGSF3XO5.mjs.map → transcriber-KYV6NWI5.mjs.map} +0 -0
package/PLUGIN.mdl CHANGED
@@ -69,6 +69,12 @@ type WhisperSegment
69
69
  words: WhisperWord[]
70
70
  ```
71
71
 
72
+ ```mdl
73
+ type Settings
74
+ fields:
75
+ entityExtraction: boolean # default: true — annotate transcript with references to known objects
76
+ ```
77
+
72
78
  ## Components
73
79
 
74
80
  ```mdl
@@ -169,6 +175,20 @@ op summarizeTranscript
169
175
  and clearly assigned.
170
176
  ```
171
177
 
178
+ ```mdl
179
+ op enrichMessage
180
+ desc: Extracts proper nouns from each transcript block of a Message using a small LLM, full-text-searches the space for matching objects, and rewrites the text with inline `[noun](dxn)` reference links.
181
+ input:
182
+ message: Message
183
+ output:
184
+ message: Message
185
+ effects: [echo:read, ai:inference]
186
+ requires: [AiService, Database]
187
+ note: |
188
+ Uses Claude Haiku. Falls back to the raw message if extraction fails (e.g. the AI
189
+ service is unavailable). Gated by the entityExtraction setting.
190
+ ```
191
+
172
192
  ```mdl
173
193
  op normalizeSentences
174
194
  desc: Post-processes an array of raw transcript messages, merging word-level tokens into grammatically complete sentences.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  renderByline
3
- } from "./chunk-KAEXRX3Y.mjs";
3
+ } from "./chunk-XOXHWMXR.mjs";
4
4
  import "./chunk-J5LGTIGS.mjs";
5
5
 
6
6
  // src/containers/TranscriptionArticle/TranscriptionArticle.tsx
@@ -24,7 +24,7 @@ var TranscriptionArticle = ({ role, subject: transcript, attendableId }) => {
24
24
  label: [
25
25
  recording ? "stop-recording.label" : "start-recording.label",
26
26
  {
27
- ns: meta.id
27
+ ns: meta.profile.key
28
28
  }
29
29
  ],
30
30
  icon: recording ? "ph--stop-circle--regular" : "ph--microphone--regular",
@@ -51,4 +51,4 @@ var TranscriptionArticle = ({ role, subject: transcript, attendableId }) => {
51
51
  export {
52
52
  TranscriptionArticle as default
53
53
  };
54
- //# sourceMappingURL=TranscriptionArticle-L6XANBH5.mjs.map
54
+ //# sourceMappingURL=TranscriptionArticle-S56VVOSF.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/containers/TranscriptionArticle/TranscriptionArticle.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Filter, Obj, Query } from '@dxos/echo';\nimport { useMembers, useQuery } from '@dxos/react-client/echo';\nimport { Panel } from '@dxos/react-ui';\nimport { Menu, MenuBuilder, useMenuBuilder } from '@dxos/react-ui-menu';\nimport { Message, type Transcript } from '@dxos/types';\n\nimport { Transcription } from '#components';\nimport { useFeedModelAdapter, useTranscriptionRecording } from '#hooks';\nimport { meta } from '#meta';\n\nimport { renderByline } from '../../util';\n\nexport type TranscriptionArticleProps = AppSurface.ObjectArticleProps<Transcript.Transcript>;\n\nexport const TranscriptionArticle = ({ role, subject: transcript, attendableId }: TranscriptionArticleProps) => {\n const db = Obj.getDatabase(transcript);\n const members = useMembers(db?.spaceId).map((member) => member.identity);\n const feed = transcript.feed.target;\n const messages = useQuery(\n db,\n feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),\n );\n const model = useFeedModelAdapter(renderByline(members), messages);\n const { recording, toggleRecording } = useTranscriptionRecording(transcript);\n\n const menuActions = useMenuBuilder(\n () =>\n MenuBuilder.make()\n .action(\n 'toggle-recording',\n {\n label: [recording ? 'stop-recording.label' : 'start-recording.label', { ns: meta.id }],\n icon: recording ? 'ph--stop-circle--regular' : 'ph--microphone--regular',\n disposition: 'toolbar',\n testId: 'transcription.toggle-recording',\n },\n toggleRecording,\n )\n .build(),\n [recording, toggleRecording],\n );\n\n return (\n <Panel.Root role={role}>\n <Menu.Root {...menuActions} attendableId={attendableId}>\n <Panel.Toolbar asChild>\n <Menu.Toolbar />\n </Panel.Toolbar>\n </Menu.Root>\n <Panel.Content asChild>\n <Transcription model={model} transcript={transcript} />\n </Panel.Content>\n </Panel.Root>\n );\n};\n"],
5
- "mappings": ";;;;;;AAIA,OAAOA,WAAW;AAGlB,SAASC,QAAQC,KAAKC,aAAa;AACnC,SAASC,YAAYC,gBAAgB;AACrC,SAASC,aAAa;AACtB,SAASC,MAAMC,aAAaC,sBAAsB;AAClD,SAASC,eAAgC;AAEzC,SAASC,qBAAqB;AAC9B,SAASC,qBAAqBC,iCAAiC;AAC/D,SAASC,YAAY;AAMd,IAAMC,uBAAuB,CAAC,EAAEC,MAAMC,SAASC,YAAYC,aAAY,MAA6B;AACzG,QAAMC,KAAKC,IAAIC,YAAYJ,UAAAA;AAC3B,QAAMK,UAAUC,WAAWJ,IAAIK,OAAAA,EAASC,IAAI,CAACC,WAAWA,OAAOC,QAAQ;AACvE,QAAMC,OAAOX,WAAWW,KAAKC;AAC7B,QAAMC,WAAWC,SACfZ,IACAS,OAAOI,MAAMC,OAAOC,OAAOC,KAAKC,QAAQA,OAAO,CAAA,EAAGC,KAAKT,IAAAA,IAAQI,MAAMC,OAAOC,OAAOI,QAAO,CAAA,CAAA;AAE5F,QAAMC,QAAQC,oBAAoBC,aAAanB,OAAAA,GAAUQ,QAAAA;AACzD,QAAM,EAAEY,WAAWC,gBAAe,IAAKC,0BAA0B3B,UAAAA;AAEjE,QAAM4B,cAAcC,eAClB,MACEC,YAAYC,KAAI,EACbC,OACC,oBACA;IACEC,OAAO;MAACR,YAAY,yBAAyB;MAAyB;QAAES,IAAIC,KAAKC;MAAG;;IACpFC,MAAMZ,YAAY,6BAA6B;IAC/Ca,aAAa;IACbC,QAAQ;EACV,GACAb,eAAAA,EAEDc,MAAK,GACV;IAACf;IAAWC;GAAgB;AAG9B,SACE,sBAAA,cAACe,MAAMC,MAAI;IAAC5C;KACV,sBAAA,cAAC6C,KAAKD,MAAI;IAAE,GAAGd;IAAa3B;KAC1B,sBAAA,cAACwC,MAAMG,SAAO;IAACC,SAAAA;KACb,sBAAA,cAACF,KAAKC,SAAO,IAAA,CAAA,CAAA,GAGjB,sBAAA,cAACH,MAAMK,SAAO;IAACD,SAAAA;KACb,sBAAA,cAACE,eAAAA;IAAczB;IAActB;;AAIrC;",
6
- "names": ["React", "Filter", "Obj", "Query", "useMembers", "useQuery", "Panel", "Menu", "MenuBuilder", "useMenuBuilder", "Message", "Transcription", "useFeedModelAdapter", "useTranscriptionRecording", "meta", "TranscriptionArticle", "role", "subject", "transcript", "attendableId", "db", "Obj", "getDatabase", "members", "useMembers", "spaceId", "map", "member", "identity", "feed", "target", "messages", "useQuery", "Query", "select", "Filter", "type", "Message", "from", "nothing", "model", "useFeedModelAdapter", "renderByline", "recording", "toggleRecording", "useTranscriptionRecording", "menuActions", "useMenuBuilder", "MenuBuilder", "make", "action", "label", "ns", "meta", "id", "icon", "disposition", "testId", "build", "Panel", "Root", "Menu", "Toolbar", "asChild", "Content", "Transcription"]
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Filter, Obj, Query } from '@dxos/echo';\nimport { useMembers, useQuery } from '@dxos/react-client/echo';\nimport { Panel } from '@dxos/react-ui';\nimport { Menu, MenuBuilder, useMenuBuilder } from '@dxos/react-ui-menu';\nimport { Message, type Transcript } from '@dxos/types';\n\nimport { Transcription } from '#components';\nimport { useFeedModelAdapter, useTranscriptionRecording } from '#hooks';\nimport { meta } from '#meta';\n\nimport { renderByline } from '../../util';\n\nexport type TranscriptionArticleProps = AppSurface.ObjectArticleProps<Transcript.Transcript>;\n\nexport const TranscriptionArticle = ({ role, subject: transcript, attendableId }: TranscriptionArticleProps) => {\n const db = Obj.getDatabase(transcript);\n const members = useMembers(db?.spaceId).map((member) => member.identity);\n const feed = transcript.feed.target;\n const messages = useQuery(\n db,\n feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),\n );\n const model = useFeedModelAdapter(renderByline(members), messages);\n const { recording, toggleRecording } = useTranscriptionRecording(transcript);\n\n const menuActions = useMenuBuilder(\n () =>\n MenuBuilder.make()\n .action(\n 'toggle-recording',\n {\n label: [recording ? 'stop-recording.label' : 'start-recording.label', { ns: meta.profile.key }],\n icon: recording ? 'ph--stop-circle--regular' : 'ph--microphone--regular',\n disposition: 'toolbar',\n testId: 'transcription.toggle-recording',\n },\n toggleRecording,\n )\n .build(),\n [recording, toggleRecording],\n );\n\n return (\n <Panel.Root role={role}>\n <Menu.Root {...menuActions} attendableId={attendableId}>\n <Panel.Toolbar asChild>\n <Menu.Toolbar />\n </Panel.Toolbar>\n </Menu.Root>\n <Panel.Content asChild>\n <Transcription model={model} transcript={transcript} />\n </Panel.Content>\n </Panel.Root>\n );\n};\n"],
5
+ "mappings": ";;;;;;AAIA,OAAOA,WAAW;AAGlB,SAASC,QAAQC,KAAKC,aAAa;AACnC,SAASC,YAAYC,gBAAgB;AACrC,SAASC,aAAa;AACtB,SAASC,MAAMC,aAAaC,sBAAsB;AAClD,SAASC,eAAgC;AAEzC,SAASC,qBAAqB;AAC9B,SAASC,qBAAqBC,iCAAiC;AAC/D,SAASC,YAAY;AAMd,IAAMC,uBAAuB,CAAC,EAAEC,MAAMC,SAASC,YAAYC,aAAY,MAA6B;AACzG,QAAMC,KAAKC,IAAIC,YAAYJ,UAAAA;AAC3B,QAAMK,UAAUC,WAAWJ,IAAIK,OAAAA,EAASC,IAAI,CAACC,WAAWA,OAAOC,QAAQ;AACvE,QAAMC,OAAOX,WAAWW,KAAKC;AAC7B,QAAMC,WAAWC,SACfZ,IACAS,OAAOI,MAAMC,OAAOC,OAAOC,KAAKC,QAAQA,OAAO,CAAA,EAAGC,KAAKT,IAAAA,IAAQI,MAAMC,OAAOC,OAAOI,QAAO,CAAA,CAAA;AAE5F,QAAMC,QAAQC,oBAAoBC,aAAanB,OAAAA,GAAUQ,QAAAA;AACzD,QAAM,EAAEY,WAAWC,gBAAe,IAAKC,0BAA0B3B,UAAAA;AAEjE,QAAM4B,cAAcC,eAClB,MACEC,YAAYC,KAAI,EACbC,OACC,oBACA;IACEC,OAAO;MAACR,YAAY,yBAAyB;MAAyB;QAAES,IAAIC,KAAKC,QAAQC;MAAI;;IAC7FC,MAAMb,YAAY,6BAA6B;IAC/Cc,aAAa;IACbC,QAAQ;EACV,GACAd,eAAAA,EAEDe,MAAK,GACV;IAAChB;IAAWC;GAAgB;AAG9B,SACE,sBAAA,cAACgB,MAAMC,MAAI;IAAC7C;KACV,sBAAA,cAAC8C,KAAKD,MAAI;IAAE,GAAGf;IAAa3B;KAC1B,sBAAA,cAACyC,MAAMG,SAAO;IAACC,SAAAA;KACb,sBAAA,cAACF,KAAKC,SAAO,IAAA,CAAA,CAAA,GAGjB,sBAAA,cAACH,MAAMK,SAAO;IAACD,SAAAA;KACb,sBAAA,cAACE,eAAAA;IAAc1B;IAActB;;AAIrC;",
6
+ "names": ["React", "Filter", "Obj", "Query", "useMembers", "useQuery", "Panel", "Menu", "MenuBuilder", "useMenuBuilder", "Message", "Transcription", "useFeedModelAdapter", "useTranscriptionRecording", "meta", "TranscriptionArticle", "role", "subject", "transcript", "attendableId", "db", "Obj", "getDatabase", "members", "useMembers", "spaceId", "map", "member", "identity", "feed", "target", "messages", "useQuery", "Query", "select", "Filter", "type", "Message", "from", "nothing", "model", "useFeedModelAdapter", "renderByline", "recording", "toggleRecording", "useTranscriptionRecording", "menuActions", "useMenuBuilder", "MenuBuilder", "make", "action", "label", "ns", "meta", "profile", "key", "icon", "disposition", "testId", "build", "Panel", "Root", "Menu", "Toolbar", "asChild", "Content", "Transcription"]
7
7
  }
@@ -4,12 +4,12 @@ import "./chunk-J5LGTIGS.mjs";
4
4
  import { Plugin } from "@dxos/app-framework";
5
5
  import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
6
6
  import { Transcript } from "@dxos/types";
7
- import { BlueprintDefinition, OperationHandler, ReactSurface, TextContent, Transcriber } from "#capabilities";
7
+ import { BlueprintDefinition, OperationHandler, ReactSurface, TextContent, Transcriber, TranscriptionSettings } from "#capabilities";
8
8
  import { meta } from "#meta";
9
9
  import { translations } from "#translations";
10
10
 
11
- // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-transcription/PLUGIN.mdl?raw
12
- var PLUGIN_default = '---\nid: org.dxos.plugin.transcription\nname: TranscriptionPlugin\nversion: 0.1.0\n---\n\nA real-time voice-to-text transcription plugin for DXOS Composer.\nCaptures spoken audio from a microphone, converts it to timestamped text segments via the\nWhisper speech-recognition service, and stores the results in an ECHO `Transcript` object\nbacked by a `Feed`.\nThe plugin also exposes blueprint-compatible operations that let AI assistants open and\nsummarize transcripts inside agent workflows.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype TranscriptSegment\n fields:\n text: string # transcribed text for this segment\n started: string # ISO-8601 wall-clock timestamp of segment start\n```\n\n```mdl\ntype Message\n fields:\n id: string\n created: string # ISO-8601 creation timestamp\n blocks: TranscriptSegment[]\n sender:\n identityDid?: string # DID of the speaker, if known\n```\n\n```mdl\ntype Transcript\n fields:\n id: string\n feed: Ref<Feed> # ECHO feed that stores Message objects\n started?: string # ISO-8601 timestamp when recording started\n```\n\n```mdl\ntype WhisperWord\n fields:\n word: string\n start: number # seconds from start of audio chunk\n end: number\n```\n\n```mdl\ntype WhisperSegment\n fields:\n text: string\n start: number\n end: number\n no_speech_prob: number # probability of silence; used to filter noise\n words: WhisperWord[]\n```\n\n## Components\n\n```mdl\ncomponent Transcription\n desc: Read-only CodeMirror editor that renders transcript messages as Markdown with byline headings.\n props:\n transcript?: Transcript\n model: SerializationModel<Message>\n slots:\n (none \u2014 self-contained editor viewport)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [CodeMirror editor \u2014 read-only] \u2502\n \u2502 ## Speaker \xB7 HH:MM \u2502\n \u2502 Transcribed text\u2026 \u2502\n \u2502 \u2026 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent Oracle\n desc: |\n Ambient display surface with an SVG graph canvas and a centered text overlay.\n Used to show the latest transcribed utterance alongside a live visualization.\n props:\n text?: string # latest utterance to display\n delay?: number # per-character reveal delay in ms (default 12)\n slots:\n canvas?: ReactNode # replaces default SVG.Graph when provided\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [SVG canvas \u2014 absolutely fills]\u2502\n \u2502 [Oracle.Text] \u2502\n \u2502 "latest utterance\u2026" \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent TranscriptionArticle\n desc: Full-page article panel combining the Transcription editor with a start/stop recording toolbar action.\n props:\n subject: Transcript\n role: string\n attendableId?: string\n state:\n recording: boolean # whether microphone capture is active\n actions:\n toggleRecording()\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [Toolbar] [\u{1F3A4} Start/Stop] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 [Transcription editor] \u2502\n \u2502 \u2026 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n## Operations\n\nPure operations \u2014 no side-effects.\n\n```mdl\nop openTranscript\n desc: Loads a Transcript from ECHO, reads all Messages from its Feed, and returns the full text content rendered with speaker bylines.\n input:\n transcript: Ref<Transcript>\n output: string\n errors:\n TranscriptNotFound: no Transcript object found for the given ref\n FeedNotFound: the Transcript\'s feed ref cannot be resolved\n requires: [Database, FeedService]\n```\n\nEffectful operations \u2014 produce output via AI or mutate persistent state.\n\n```mdl\nop createTranscript\n desc: Creates a new Feed and a Transcript object linked to it, then writes both into the current ECHO space.\n input:\n name?: string\n space: Space\n output: Transcript\n effects: [echo:write]\n```\n\n```mdl\nop summarizeTranscript\n desc: Sends a transcript string and optional participant notes to an LLM and returns a Markdown summary with key points, verbatim quotes, and actionable tasks extracted from the conversation.\n input:\n transcript: string\n notes?: string\n output: string\n effects: [http]\n requires: [AiService]\n note: |\n Uses Claude Sonnet. Prompt instructs the model to bold speaker names,\n include verbatim quotes, and emit only tasks that are directly actionable\n and clearly assigned.\n```\n\n```mdl\nop normalizeSentences\n desc: Post-processes an array of raw transcript messages, merging word-level tokens into grammatically complete sentences.\n input:\n messages: Message[]\n output: Message[]\n note: pure transformation; no effects or service dependencies\n```\n\n## Features\n\n```mdl\nfeat F-1: Recording Lifecycle\n\n req F-1.1: User can start microphone capture from TranscriptionArticle toolbar.\n req F-1.2: User can stop microphone capture; final buffered chunks are flushed and transcribed.\n req F-1.3: TranscriptionManager restarts the Transcriber automatically when the audio track changes.\n```\n\n```mdl\nfeat F-2: Audio Chunking and Transcription\n\n req F-2.1:\n when: user is speaking and chunk count reaches transcribeAfterChunksAmount\n then: Transcriber schedules a deferred transcription task\n\n req F-2.2:\n when: transcription task runs\n then: buffered PCM chunks are merged into a WAV file and POSTed to the Whisper endpoint\n\n req F-2.3:\n when: Whisper response is received\n then: segments are filtered by no_speech_prob and aligned to absolute wall-clock timestamps\n\n req F-2.4:\n when: user is not speaking\n then: only prefixBufferChunksAmount most-recent chunks are retained; older chunks discarded\n```\n\n```mdl\nfeat F-3: Transcript Persistence\n\n req F-3.1:\n when: aligned segments are produced\n then: a Message object with the segments is appended to the Transcript\'s ECHO Feed\n\n req F-3.2:\n when: a messageEnricher is configured\n then: Message is passed through the enricher before being written to the Feed\n\n req F-3.3:\n when: a peer\'s ECHO space receives the Feed update\n then: TranscriptionArticle re-renders with the new messages\n tags: [collaborative]\n```\n\n```mdl\nfeat F-4: Transcript Display\n\n req F-4.1:\n when: a Transcript object is opened\n then: all Messages are rendered in the Transcription editor with speaker bylines and timestamps\n\n req F-4.2:\n when: new messages arrive during live recording\n then: the SerializationModel is updated and the editor scrolls to show the latest content\n```\n\n```mdl\nfeat F-5: AI Summary\n\n req F-5.1:\n when: op:summarizeTranscript is invoked\n then: LLM returns a structured Markdown document with key points, quotes, and tasks\n\n req F-5.2:\n when: participant notes are provided\n then: notes are correlated with transcript content in the summary\n\n req F-5.3:\n when: no actionable tasks are found\n then: the tasks section is omitted from the summary\n```\n\n```mdl\nfeat F-6: Blueprint Integration\n\n req F-6.1: Blueprint exposes op:openTranscript and op:summarizeTranscript as AI tools.\n req F-6.2: An AI assistant can open a transcript by Ref and return formatted text to the user.\n req F-6.3: An AI assistant can invoke the summary operation and present the result as a message.\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create transcript\n given: a DXOS space is available\n when: op:createTranscript is invoked\n then:\n - a new Feed is created in the space\n - a Transcript object linked to the Feed is created in the space\n - the returned Transcript.feed.target is not null\n```\n\n```mdl\ntest T-2: Record and persist segment\n given: a Transcript with a Feed, microphone capture active\n when: the user speaks and silence is detected\n then:\n - Whisper returns at least one segment\n - a Message is appended to the Feed\n - Message.blocks contains at least one TranscriptSegment with non-empty text\n```\n\n```mdl\ntest T-3: Deduplicate segments across chunk boundaries\n given: two consecutive transcription tasks with overlapping Whisper output\n when: the second task produces segments whose end timestamps fall before lastTimestamp\n then:\n - duplicate segments are filtered out\n - only novel words (start >= lastTimestamp) are included\n```\n\n```mdl\ntest T-4: Open transcript\n given: a Transcript with three Messages in its Feed\n when: op:openTranscript is invoked\n then:\n - content string contains three byline sections\n - each section starts with "## <speaker> \xB7 <time>"\n```\n\n```mdl\ntest T-5: Summarize transcript\n given: a transcript string and optional notes string\n when: op:summarizeTranscript is invoked\n then:\n - summary is a non-empty Markdown string\n - speaker names appear in bold\n - a tasks section is present if actionable tasks were detected\n```\n\n```mdl\ntest T-6: Sentence normalization is pure\n given: an array of raw word-level Messages\n when: op:normalizeSentences is called\n then:\n - output messages contain complete sentences\n - no ECHO writes occur\n - input array is not mutated\n```\n\n```mdl\ntest T-7: Toggle recording in UI\n given: TranscriptionArticle is mounted with a Transcript\n when: user clicks the Start Recording toolbar button\n then:\n - recording state becomes true\n - toolbar button label changes to "Stop Recording"\n - microphone capture begins\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive \u2014 the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n';
11
+ // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-transcription/PLUGIN.mdl
12
+ var PLUGIN_default = '---\nid: org.dxos.plugin.transcription\nname: TranscriptionPlugin\nversion: 0.1.0\n---\n\nA real-time voice-to-text transcription plugin for DXOS Composer.\nCaptures spoken audio from a microphone, converts it to timestamped text segments via the\nWhisper speech-recognition service, and stores the results in an ECHO `Transcript` object\nbacked by a `Feed`.\nThe plugin also exposes blueprint-compatible operations that let AI assistants open and\nsummarize transcripts inside agent workflows.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype TranscriptSegment\n fields:\n text: string # transcribed text for this segment\n started: string # ISO-8601 wall-clock timestamp of segment start\n```\n\n```mdl\ntype Message\n fields:\n id: string\n created: string # ISO-8601 creation timestamp\n blocks: TranscriptSegment[]\n sender:\n identityDid?: string # DID of the speaker, if known\n```\n\n```mdl\ntype Transcript\n fields:\n id: string\n feed: Ref<Feed> # ECHO feed that stores Message objects\n started?: string # ISO-8601 timestamp when recording started\n```\n\n```mdl\ntype WhisperWord\n fields:\n word: string\n start: number # seconds from start of audio chunk\n end: number\n```\n\n```mdl\ntype WhisperSegment\n fields:\n text: string\n start: number\n end: number\n no_speech_prob: number # probability of silence; used to filter noise\n words: WhisperWord[]\n```\n\n```mdl\ntype Settings\n fields:\n entityExtraction: boolean # default: true \u2014 annotate transcript with references to known objects\n```\n\n## Components\n\n```mdl\ncomponent Transcription\n desc: Read-only CodeMirror editor that renders transcript messages as Markdown with byline headings.\n props:\n transcript?: Transcript\n model: SerializationModel<Message>\n slots:\n (none \u2014 self-contained editor viewport)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [CodeMirror editor \u2014 read-only] \u2502\n \u2502 ## Speaker \xB7 HH:MM \u2502\n \u2502 Transcribed text\u2026 \u2502\n \u2502 \u2026 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent Oracle\n desc: |\n Ambient display surface with an SVG graph canvas and a centered text overlay.\n Used to show the latest transcribed utterance alongside a live visualization.\n props:\n text?: string # latest utterance to display\n delay?: number # per-character reveal delay in ms (default 12)\n slots:\n canvas?: ReactNode # replaces default SVG.Graph when provided\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [SVG canvas \u2014 absolutely fills]\u2502\n \u2502 [Oracle.Text] \u2502\n \u2502 "latest utterance\u2026" \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent TranscriptionArticle\n desc: Full-page article panel combining the Transcription editor with a start/stop recording toolbar action.\n props:\n subject: Transcript\n role: string\n attendableId?: string\n state:\n recording: boolean # whether microphone capture is active\n actions:\n toggleRecording()\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [Toolbar] [\u{1F3A4} Start/Stop] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 [Transcription editor] \u2502\n \u2502 \u2026 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n## Operations\n\nPure operations \u2014 no side-effects.\n\n```mdl\nop openTranscript\n desc: Loads a Transcript from ECHO, reads all Messages from its Feed, and returns the full text content rendered with speaker bylines.\n input:\n transcript: Ref<Transcript>\n output: string\n errors:\n TranscriptNotFound: no Transcript object found for the given ref\n FeedNotFound: the Transcript\'s feed ref cannot be resolved\n requires: [Database, FeedService]\n```\n\nEffectful operations \u2014 produce output via AI or mutate persistent state.\n\n```mdl\nop createTranscript\n desc: Creates a new Feed and a Transcript object linked to it, then writes both into the current ECHO space.\n input:\n name?: string\n space: Space\n output: Transcript\n effects: [echo:write]\n```\n\n```mdl\nop summarizeTranscript\n desc: Sends a transcript string and optional participant notes to an LLM and returns a Markdown summary with key points, verbatim quotes, and actionable tasks extracted from the conversation.\n input:\n transcript: string\n notes?: string\n output: string\n effects: [http]\n requires: [AiService]\n note: |\n Uses Claude Sonnet. Prompt instructs the model to bold speaker names,\n include verbatim quotes, and emit only tasks that are directly actionable\n and clearly assigned.\n```\n\n```mdl\nop enrichMessage\n desc: Extracts proper nouns from each transcript block of a Message using a small LLM, full-text-searches the space for matching objects, and rewrites the text with inline `[noun](dxn)` reference links.\n input:\n message: Message\n output:\n message: Message\n effects: [echo:read, ai:inference]\n requires: [AiService, Database]\n note: |\n Uses Claude Haiku. Falls back to the raw message if extraction fails (e.g. the AI\n service is unavailable). Gated by the entityExtraction setting.\n```\n\n```mdl\nop normalizeSentences\n desc: Post-processes an array of raw transcript messages, merging word-level tokens into grammatically complete sentences.\n input:\n messages: Message[]\n output: Message[]\n note: pure transformation; no effects or service dependencies\n```\n\n## Features\n\n```mdl\nfeat F-1: Recording Lifecycle\n\n req F-1.1: User can start microphone capture from TranscriptionArticle toolbar.\n req F-1.2: User can stop microphone capture; final buffered chunks are flushed and transcribed.\n req F-1.3: TranscriptionManager restarts the Transcriber automatically when the audio track changes.\n```\n\n```mdl\nfeat F-2: Audio Chunking and Transcription\n\n req F-2.1:\n when: user is speaking and chunk count reaches transcribeAfterChunksAmount\n then: Transcriber schedules a deferred transcription task\n\n req F-2.2:\n when: transcription task runs\n then: buffered PCM chunks are merged into a WAV file and POSTed to the Whisper endpoint\n\n req F-2.3:\n when: Whisper response is received\n then: segments are filtered by no_speech_prob and aligned to absolute wall-clock timestamps\n\n req F-2.4:\n when: user is not speaking\n then: only prefixBufferChunksAmount most-recent chunks are retained; older chunks discarded\n```\n\n```mdl\nfeat F-3: Transcript Persistence\n\n req F-3.1:\n when: aligned segments are produced\n then: a Message object with the segments is appended to the Transcript\'s ECHO Feed\n\n req F-3.2:\n when: a messageEnricher is configured\n then: Message is passed through the enricher before being written to the Feed\n\n req F-3.3:\n when: a peer\'s ECHO space receives the Feed update\n then: TranscriptionArticle re-renders with the new messages\n tags: [collaborative]\n```\n\n```mdl\nfeat F-4: Transcript Display\n\n req F-4.1:\n when: a Transcript object is opened\n then: all Messages are rendered in the Transcription editor with speaker bylines and timestamps\n\n req F-4.2:\n when: new messages arrive during live recording\n then: the SerializationModel is updated and the editor scrolls to show the latest content\n```\n\n```mdl\nfeat F-5: AI Summary\n\n req F-5.1:\n when: op:summarizeTranscript is invoked\n then: LLM returns a structured Markdown document with key points, quotes, and tasks\n\n req F-5.2:\n when: participant notes are provided\n then: notes are correlated with transcript content in the summary\n\n req F-5.3:\n when: no actionable tasks are found\n then: the tasks section is omitted from the summary\n```\n\n```mdl\nfeat F-6: Blueprint Integration\n\n req F-6.1: Blueprint exposes op:openTranscript and op:summarizeTranscript as AI tools.\n req F-6.2: An AI assistant can open a transcript by Ref and return formatted text to the user.\n req F-6.3: An AI assistant can invoke the summary operation and present the result as a message.\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create transcript\n given: a DXOS space is available\n when: op:createTranscript is invoked\n then:\n - a new Feed is created in the space\n - a Transcript object linked to the Feed is created in the space\n - the returned Transcript.feed.target is not null\n```\n\n```mdl\ntest T-2: Record and persist segment\n given: a Transcript with a Feed, microphone capture active\n when: the user speaks and silence is detected\n then:\n - Whisper returns at least one segment\n - a Message is appended to the Feed\n - Message.blocks contains at least one TranscriptSegment with non-empty text\n```\n\n```mdl\ntest T-3: Deduplicate segments across chunk boundaries\n given: two consecutive transcription tasks with overlapping Whisper output\n when: the second task produces segments whose end timestamps fall before lastTimestamp\n then:\n - duplicate segments are filtered out\n - only novel words (start >= lastTimestamp) are included\n```\n\n```mdl\ntest T-4: Open transcript\n given: a Transcript with three Messages in its Feed\n when: op:openTranscript is invoked\n then:\n - content string contains three byline sections\n - each section starts with "## <speaker> \xB7 <time>"\n```\n\n```mdl\ntest T-5: Summarize transcript\n given: a transcript string and optional notes string\n when: op:summarizeTranscript is invoked\n then:\n - summary is a non-empty Markdown string\n - speaker names appear in bold\n - a tasks section is present if actionable tasks were detected\n```\n\n```mdl\ntest T-6: Sentence normalization is pure\n given: an array of raw word-level Messages\n when: op:normalizeSentences is called\n then:\n - output messages contain complete sentences\n - no ECHO writes occur\n - input array is not mutated\n```\n\n```mdl\ntest T-7: Toggle recording in UI\n given: TranscriptionArticle is mounted with a Transcript\n when: user clicks the Start Recording toolbar button\n then:\n - recording state becomes true\n - toolbar button label changes to "Stop Recording"\n - microphone capture begins\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive \u2014 the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n';
13
13
 
14
14
  // src/TranscriptionPlugin.tsx
15
15
  var TranscriptionPlugin = Plugin.define(meta).pipe(AppPlugin.addBlueprintDefinitionModule({
@@ -26,13 +26,15 @@ var TranscriptionPlugin = Plugin.define(meta).pipe(AppPlugin.addBlueprintDefinit
26
26
  activate: ReactSurface
27
27
  }), AppPlugin.addTranslationsModule({
28
28
  translations
29
+ }), AppPlugin.addSettingsModule({
30
+ activate: TranscriptionSettings
29
31
  }), Plugin.addModule({
30
32
  id: "transcription",
31
33
  activatesOn: AppActivationEvents.SetupAppGraph,
32
34
  activate: Transcriber
33
35
  }), AppPlugin.addPluginAssetModule({
34
36
  asset: {
35
- pluginId: meta.id,
37
+ pluginId: meta.profile.key,
36
38
  path: "PLUGIN.mdl",
37
39
  content: PLUGIN_default,
38
40
  mimeType: "application/x-mdl"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/TranscriptionPlugin.tsx", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-transcription/PLUGIN.mdl?raw"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\nimport { Transcript } from '@dxos/types';\n\nimport { BlueprintDefinition, OperationHandler, ReactSurface, TextContent, Transcriber } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const TranscriptionPlugin = Plugin.define(meta).pipe(\n AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),\n AppPlugin.addTextContentModule({ activate: TextContent }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSchemaModule({ schema: [Transcript.Transcript] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n id: 'transcription',\n activatesOn: AppActivationEvents.SetupAppGraph,\n activate: Transcriber,\n }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.id, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default TranscriptionPlugin;\n", "---\nid: org.dxos.plugin.transcription\nname: TranscriptionPlugin\nversion: 0.1.0\n---\n\nA real-time voice-to-text transcription plugin for DXOS Composer.\nCaptures spoken audio from a microphone, converts it to timestamped text segments via the\nWhisper speech-recognition service, and stores the results in an ECHO `Transcript` object\nbacked by a `Feed`.\nThe plugin also exposes blueprint-compatible operations that let AI assistants open and\nsummarize transcripts inside agent workflows.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype TranscriptSegment\n fields:\n text: string # transcribed text for this segment\n started: string # ISO-8601 wall-clock timestamp of segment start\n```\n\n```mdl\ntype Message\n fields:\n id: string\n created: string # ISO-8601 creation timestamp\n blocks: TranscriptSegment[]\n sender:\n identityDid?: string # DID of the speaker, if known\n```\n\n```mdl\ntype Transcript\n fields:\n id: string\n feed: Ref<Feed> # ECHO feed that stores Message objects\n started?: string # ISO-8601 timestamp when recording started\n```\n\n```mdl\ntype WhisperWord\n fields:\n word: string\n start: number # seconds from start of audio chunk\n end: number\n```\n\n```mdl\ntype WhisperSegment\n fields:\n text: string\n start: number\n end: number\n no_speech_prob: number # probability of silence; used to filter noise\n words: WhisperWord[]\n```\n\n## Components\n\n```mdl\ncomponent Transcription\n desc: Read-only CodeMirror editor that renders transcript messages as Markdown with byline headings.\n props:\n transcript?: Transcript\n model: SerializationModel<Message>\n slots:\n (none \u2014 self-contained editor viewport)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [CodeMirror editor \u2014 read-only] \u2502\n \u2502 ## Speaker \u00B7 HH:MM \u2502\n \u2502 Transcribed text\u2026 \u2502\n \u2502 \u2026 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent Oracle\n desc: |\n Ambient display surface with an SVG graph canvas and a centered text overlay.\n Used to show the latest transcribed utterance alongside a live visualization.\n props:\n text?: string # latest utterance to display\n delay?: number # per-character reveal delay in ms (default 12)\n slots:\n canvas?: ReactNode # replaces default SVG.Graph when provided\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [SVG canvas \u2014 absolutely fills]\u2502\n \u2502 [Oracle.Text] \u2502\n \u2502 \"latest utterance\u2026\" \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent TranscriptionArticle\n desc: Full-page article panel combining the Transcription editor with a start/stop recording toolbar action.\n props:\n subject: Transcript\n role: string\n attendableId?: string\n state:\n recording: boolean # whether microphone capture is active\n actions:\n toggleRecording()\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [Toolbar] [\uD83C\uDFA4 Start/Stop] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 [Transcription editor] \u2502\n \u2502 \u2026 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n## Operations\n\nPure operations \u2014 no side-effects.\n\n```mdl\nop openTranscript\n desc: Loads a Transcript from ECHO, reads all Messages from its Feed, and returns the full text content rendered with speaker bylines.\n input:\n transcript: Ref<Transcript>\n output: string\n errors:\n TranscriptNotFound: no Transcript object found for the given ref\n FeedNotFound: the Transcript's feed ref cannot be resolved\n requires: [Database, FeedService]\n```\n\nEffectful operations \u2014 produce output via AI or mutate persistent state.\n\n```mdl\nop createTranscript\n desc: Creates a new Feed and a Transcript object linked to it, then writes both into the current ECHO space.\n input:\n name?: string\n space: Space\n output: Transcript\n effects: [echo:write]\n```\n\n```mdl\nop summarizeTranscript\n desc: Sends a transcript string and optional participant notes to an LLM and returns a Markdown summary with key points, verbatim quotes, and actionable tasks extracted from the conversation.\n input:\n transcript: string\n notes?: string\n output: string\n effects: [http]\n requires: [AiService]\n note: |\n Uses Claude Sonnet. Prompt instructs the model to bold speaker names,\n include verbatim quotes, and emit only tasks that are directly actionable\n and clearly assigned.\n```\n\n```mdl\nop normalizeSentences\n desc: Post-processes an array of raw transcript messages, merging word-level tokens into grammatically complete sentences.\n input:\n messages: Message[]\n output: Message[]\n note: pure transformation; no effects or service dependencies\n```\n\n## Features\n\n```mdl\nfeat F-1: Recording Lifecycle\n\n req F-1.1: User can start microphone capture from TranscriptionArticle toolbar.\n req F-1.2: User can stop microphone capture; final buffered chunks are flushed and transcribed.\n req F-1.3: TranscriptionManager restarts the Transcriber automatically when the audio track changes.\n```\n\n```mdl\nfeat F-2: Audio Chunking and Transcription\n\n req F-2.1:\n when: user is speaking and chunk count reaches transcribeAfterChunksAmount\n then: Transcriber schedules a deferred transcription task\n\n req F-2.2:\n when: transcription task runs\n then: buffered PCM chunks are merged into a WAV file and POSTed to the Whisper endpoint\n\n req F-2.3:\n when: Whisper response is received\n then: segments are filtered by no_speech_prob and aligned to absolute wall-clock timestamps\n\n req F-2.4:\n when: user is not speaking\n then: only prefixBufferChunksAmount most-recent chunks are retained; older chunks discarded\n```\n\n```mdl\nfeat F-3: Transcript Persistence\n\n req F-3.1:\n when: aligned segments are produced\n then: a Message object with the segments is appended to the Transcript's ECHO Feed\n\n req F-3.2:\n when: a messageEnricher is configured\n then: Message is passed through the enricher before being written to the Feed\n\n req F-3.3:\n when: a peer's ECHO space receives the Feed update\n then: TranscriptionArticle re-renders with the new messages\n tags: [collaborative]\n```\n\n```mdl\nfeat F-4: Transcript Display\n\n req F-4.1:\n when: a Transcript object is opened\n then: all Messages are rendered in the Transcription editor with speaker bylines and timestamps\n\n req F-4.2:\n when: new messages arrive during live recording\n then: the SerializationModel is updated and the editor scrolls to show the latest content\n```\n\n```mdl\nfeat F-5: AI Summary\n\n req F-5.1:\n when: op:summarizeTranscript is invoked\n then: LLM returns a structured Markdown document with key points, quotes, and tasks\n\n req F-5.2:\n when: participant notes are provided\n then: notes are correlated with transcript content in the summary\n\n req F-5.3:\n when: no actionable tasks are found\n then: the tasks section is omitted from the summary\n```\n\n```mdl\nfeat F-6: Blueprint Integration\n\n req F-6.1: Blueprint exposes op:openTranscript and op:summarizeTranscript as AI tools.\n req F-6.2: An AI assistant can open a transcript by Ref and return formatted text to the user.\n req F-6.3: An AI assistant can invoke the summary operation and present the result as a message.\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create transcript\n given: a DXOS space is available\n when: op:createTranscript is invoked\n then:\n - a new Feed is created in the space\n - a Transcript object linked to the Feed is created in the space\n - the returned Transcript.feed.target is not null\n```\n\n```mdl\ntest T-2: Record and persist segment\n given: a Transcript with a Feed, microphone capture active\n when: the user speaks and silence is detected\n then:\n - Whisper returns at least one segment\n - a Message is appended to the Feed\n - Message.blocks contains at least one TranscriptSegment with non-empty text\n```\n\n```mdl\ntest T-3: Deduplicate segments across chunk boundaries\n given: two consecutive transcription tasks with overlapping Whisper output\n when: the second task produces segments whose end timestamps fall before lastTimestamp\n then:\n - duplicate segments are filtered out\n - only novel words (start >= lastTimestamp) are included\n```\n\n```mdl\ntest T-4: Open transcript\n given: a Transcript with three Messages in its Feed\n when: op:openTranscript is invoked\n then:\n - content string contains three byline sections\n - each section starts with \"## <speaker> \u00B7 <time>\"\n```\n\n```mdl\ntest T-5: Summarize transcript\n given: a transcript string and optional notes string\n when: op:summarizeTranscript is invoked\n then:\n - summary is a non-empty Markdown string\n - speaker names appear in bold\n - a tasks section is present if actionable tasks were detected\n```\n\n```mdl\ntest T-6: Sentence normalization is pure\n given: an array of raw word-level Messages\n when: op:normalizeSentences is called\n then:\n - output messages contain complete sentences\n - no ECHO writes occur\n - input array is not mutated\n```\n\n```mdl\ntest T-7: Toggle recording in UI\n given: TranscriptionArticle is mounted with a Transcript\n when: user clicks the Start Recording toolbar button\n then:\n - recording state becomes true\n - toolbar button label changes to \"Stop Recording\"\n - microphone capture begins\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive \u2014 the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n"],
5
- "mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,qBAAqBC,iBAAiB;AAC/C,SAASC,kBAAkB;AAE3B,SAASC,qBAAqBC,kBAAkBC,cAAcC,aAAaC,mBAAmB;AAC9F,SAASC,YAAY;AACrB,SAASC,oBAAoB;;;ACV7B;;;ADeO,IAAMC,sBAAsBC,OAAOC,OAAOC,IAAAA,EAAMC,KACrDC,UAAUC,6BAA6B;EAAEC,UAAUC;AAAoB,CAAA,GACvEH,UAAUI,qBAAqB;EAAEF,UAAUG;AAAY,CAAA,GACvDL,UAAUM,0BAA0B;EAAEJ,UAAUK;AAAiB,CAAA,GACjEP,UAAUQ,gBAAgB;EAAEC,QAAQ;IAACC,WAAWA;;AAAY,CAAA,GAC5DV,UAAUW,iBAAiB;EAAET,UAAUU;AAAa,CAAA,GACpDZ,UAAUa,sBAAsB;EAAEC;AAAa,CAAA,GAC/ClB,OAAOmB,UAAU;EACfC,IAAI;EACJC,aAAaC,oBAAoBC;EACjCjB,UAAUkB;AACZ,CAAA,GACApB,UAAUqB,qBAAqB;EAC7BC,OAAO;IAAEC,UAAUzB,KAAKkB;IAAIQ,MAAM;IAAcC,SAASC;IAAYC,UAAU;EAAoB;AACrG,CAAA,GACA/B,OAAOgC,IAAI;AAGb,IAAA,8BAAejC;",
6
- "names": ["Plugin", "AppActivationEvents", "AppPlugin", "Transcript", "BlueprintDefinition", "OperationHandler", "ReactSurface", "TextContent", "Transcriber", "meta", "translations", "TranscriptionPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addBlueprintDefinitionModule", "activate", "BlueprintDefinition", "addTextContentModule", "TextContent", "addOperationHandlerModule", "OperationHandler", "addSchemaModule", "schema", "Transcript", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "addModule", "id", "activatesOn", "AppActivationEvents", "SetupAppGraph", "Transcriber", "addPluginAssetModule", "asset", "pluginId", "path", "content", "pluginSpec", "mimeType", "make"]
3
+ "sources": ["../../../src/TranscriptionPlugin.tsx", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-transcription/PLUGIN.mdl"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\nimport { Transcript } from '@dxos/types';\n\nimport {\n BlueprintDefinition,\n OperationHandler,\n ReactSurface,\n TextContent,\n Transcriber,\n TranscriptionSettings,\n} from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const TranscriptionPlugin = Plugin.define(meta).pipe(\n AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),\n AppPlugin.addTextContentModule({ activate: TextContent }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSchemaModule({ schema: [Transcript.Transcript] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n AppPlugin.addSettingsModule({ activate: TranscriptionSettings }),\n Plugin.addModule({\n id: 'transcription',\n activatesOn: AppActivationEvents.SetupAppGraph,\n activate: Transcriber,\n }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default TranscriptionPlugin;\n", "---\nid: org.dxos.plugin.transcription\nname: TranscriptionPlugin\nversion: 0.1.0\n---\n\nA real-time voice-to-text transcription plugin for DXOS Composer.\nCaptures spoken audio from a microphone, converts it to timestamped text segments via the\nWhisper speech-recognition service, and stores the results in an ECHO `Transcript` object\nbacked by a `Feed`.\nThe plugin also exposes blueprint-compatible operations that let AI assistants open and\nsummarize transcripts inside agent workflows.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype TranscriptSegment\n fields:\n text: string # transcribed text for this segment\n started: string # ISO-8601 wall-clock timestamp of segment start\n```\n\n```mdl\ntype Message\n fields:\n id: string\n created: string # ISO-8601 creation timestamp\n blocks: TranscriptSegment[]\n sender:\n identityDid?: string # DID of the speaker, if known\n```\n\n```mdl\ntype Transcript\n fields:\n id: string\n feed: Ref<Feed> # ECHO feed that stores Message objects\n started?: string # ISO-8601 timestamp when recording started\n```\n\n```mdl\ntype WhisperWord\n fields:\n word: string\n start: number # seconds from start of audio chunk\n end: number\n```\n\n```mdl\ntype WhisperSegment\n fields:\n text: string\n start: number\n end: number\n no_speech_prob: number # probability of silence; used to filter noise\n words: WhisperWord[]\n```\n\n```mdl\ntype Settings\n fields:\n entityExtraction: boolean # default: true \u2014 annotate transcript with references to known objects\n```\n\n## Components\n\n```mdl\ncomponent Transcription\n desc: Read-only CodeMirror editor that renders transcript messages as Markdown with byline headings.\n props:\n transcript?: Transcript\n model: SerializationModel<Message>\n slots:\n (none \u2014 self-contained editor viewport)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [CodeMirror editor \u2014 read-only] \u2502\n \u2502 ## Speaker \u00B7 HH:MM \u2502\n \u2502 Transcribed text\u2026 \u2502\n \u2502 \u2026 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent Oracle\n desc: |\n Ambient display surface with an SVG graph canvas and a centered text overlay.\n Used to show the latest transcribed utterance alongside a live visualization.\n props:\n text?: string # latest utterance to display\n delay?: number # per-character reveal delay in ms (default 12)\n slots:\n canvas?: ReactNode # replaces default SVG.Graph when provided\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [SVG canvas \u2014 absolutely fills]\u2502\n \u2502 [Oracle.Text] \u2502\n \u2502 \"latest utterance\u2026\" \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent TranscriptionArticle\n desc: Full-page article panel combining the Transcription editor with a start/stop recording toolbar action.\n props:\n subject: Transcript\n role: string\n attendableId?: string\n state:\n recording: boolean # whether microphone capture is active\n actions:\n toggleRecording()\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [Toolbar] [\uD83C\uDFA4 Start/Stop] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 [Transcription editor] \u2502\n \u2502 \u2026 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n## Operations\n\nPure operations \u2014 no side-effects.\n\n```mdl\nop openTranscript\n desc: Loads a Transcript from ECHO, reads all Messages from its Feed, and returns the full text content rendered with speaker bylines.\n input:\n transcript: Ref<Transcript>\n output: string\n errors:\n TranscriptNotFound: no Transcript object found for the given ref\n FeedNotFound: the Transcript's feed ref cannot be resolved\n requires: [Database, FeedService]\n```\n\nEffectful operations \u2014 produce output via AI or mutate persistent state.\n\n```mdl\nop createTranscript\n desc: Creates a new Feed and a Transcript object linked to it, then writes both into the current ECHO space.\n input:\n name?: string\n space: Space\n output: Transcript\n effects: [echo:write]\n```\n\n```mdl\nop summarizeTranscript\n desc: Sends a transcript string and optional participant notes to an LLM and returns a Markdown summary with key points, verbatim quotes, and actionable tasks extracted from the conversation.\n input:\n transcript: string\n notes?: string\n output: string\n effects: [http]\n requires: [AiService]\n note: |\n Uses Claude Sonnet. Prompt instructs the model to bold speaker names,\n include verbatim quotes, and emit only tasks that are directly actionable\n and clearly assigned.\n```\n\n```mdl\nop enrichMessage\n desc: Extracts proper nouns from each transcript block of a Message using a small LLM, full-text-searches the space for matching objects, and rewrites the text with inline `[noun](dxn)` reference links.\n input:\n message: Message\n output:\n message: Message\n effects: [echo:read, ai:inference]\n requires: [AiService, Database]\n note: |\n Uses Claude Haiku. Falls back to the raw message if extraction fails (e.g. the AI\n service is unavailable). Gated by the entityExtraction setting.\n```\n\n```mdl\nop normalizeSentences\n desc: Post-processes an array of raw transcript messages, merging word-level tokens into grammatically complete sentences.\n input:\n messages: Message[]\n output: Message[]\n note: pure transformation; no effects or service dependencies\n```\n\n## Features\n\n```mdl\nfeat F-1: Recording Lifecycle\n\n req F-1.1: User can start microphone capture from TranscriptionArticle toolbar.\n req F-1.2: User can stop microphone capture; final buffered chunks are flushed and transcribed.\n req F-1.3: TranscriptionManager restarts the Transcriber automatically when the audio track changes.\n```\n\n```mdl\nfeat F-2: Audio Chunking and Transcription\n\n req F-2.1:\n when: user is speaking and chunk count reaches transcribeAfterChunksAmount\n then: Transcriber schedules a deferred transcription task\n\n req F-2.2:\n when: transcription task runs\n then: buffered PCM chunks are merged into a WAV file and POSTed to the Whisper endpoint\n\n req F-2.3:\n when: Whisper response is received\n then: segments are filtered by no_speech_prob and aligned to absolute wall-clock timestamps\n\n req F-2.4:\n when: user is not speaking\n then: only prefixBufferChunksAmount most-recent chunks are retained; older chunks discarded\n```\n\n```mdl\nfeat F-3: Transcript Persistence\n\n req F-3.1:\n when: aligned segments are produced\n then: a Message object with the segments is appended to the Transcript's ECHO Feed\n\n req F-3.2:\n when: a messageEnricher is configured\n then: Message is passed through the enricher before being written to the Feed\n\n req F-3.3:\n when: a peer's ECHO space receives the Feed update\n then: TranscriptionArticle re-renders with the new messages\n tags: [collaborative]\n```\n\n```mdl\nfeat F-4: Transcript Display\n\n req F-4.1:\n when: a Transcript object is opened\n then: all Messages are rendered in the Transcription editor with speaker bylines and timestamps\n\n req F-4.2:\n when: new messages arrive during live recording\n then: the SerializationModel is updated and the editor scrolls to show the latest content\n```\n\n```mdl\nfeat F-5: AI Summary\n\n req F-5.1:\n when: op:summarizeTranscript is invoked\n then: LLM returns a structured Markdown document with key points, quotes, and tasks\n\n req F-5.2:\n when: participant notes are provided\n then: notes are correlated with transcript content in the summary\n\n req F-5.3:\n when: no actionable tasks are found\n then: the tasks section is omitted from the summary\n```\n\n```mdl\nfeat F-6: Blueprint Integration\n\n req F-6.1: Blueprint exposes op:openTranscript and op:summarizeTranscript as AI tools.\n req F-6.2: An AI assistant can open a transcript by Ref and return formatted text to the user.\n req F-6.3: An AI assistant can invoke the summary operation and present the result as a message.\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create transcript\n given: a DXOS space is available\n when: op:createTranscript is invoked\n then:\n - a new Feed is created in the space\n - a Transcript object linked to the Feed is created in the space\n - the returned Transcript.feed.target is not null\n```\n\n```mdl\ntest T-2: Record and persist segment\n given: a Transcript with a Feed, microphone capture active\n when: the user speaks and silence is detected\n then:\n - Whisper returns at least one segment\n - a Message is appended to the Feed\n - Message.blocks contains at least one TranscriptSegment with non-empty text\n```\n\n```mdl\ntest T-3: Deduplicate segments across chunk boundaries\n given: two consecutive transcription tasks with overlapping Whisper output\n when: the second task produces segments whose end timestamps fall before lastTimestamp\n then:\n - duplicate segments are filtered out\n - only novel words (start >= lastTimestamp) are included\n```\n\n```mdl\ntest T-4: Open transcript\n given: a Transcript with three Messages in its Feed\n when: op:openTranscript is invoked\n then:\n - content string contains three byline sections\n - each section starts with \"## <speaker> \u00B7 <time>\"\n```\n\n```mdl\ntest T-5: Summarize transcript\n given: a transcript string and optional notes string\n when: op:summarizeTranscript is invoked\n then:\n - summary is a non-empty Markdown string\n - speaker names appear in bold\n - a tasks section is present if actionable tasks were detected\n```\n\n```mdl\ntest T-6: Sentence normalization is pure\n given: an array of raw word-level Messages\n when: op:normalizeSentences is called\n then:\n - output messages contain complete sentences\n - no ECHO writes occur\n - input array is not mutated\n```\n\n```mdl\ntest T-7: Toggle recording in UI\n given: TranscriptionArticle is mounted with a Transcript\n when: user clicks the Start Recording toolbar button\n then:\n - recording state becomes true\n - toolbar button label changes to \"Stop Recording\"\n - microphone capture begins\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive \u2014 the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n"],
5
+ "mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,qBAAqBC,iBAAiB;AAC/C,SAASC,kBAAkB;AAE3B,SACEC,qBACAC,kBACAC,cACAC,aACAC,aACAC,6BACK;AACP,SAASC,YAAY;AACrB,SAASC,oBAAoB;;;ACjB7B;;;ADsBO,IAAMC,sBAAsBC,OAAOC,OAAOC,IAAAA,EAAMC,KACrDC,UAAUC,6BAA6B;EAAEC,UAAUC;AAAoB,CAAA,GACvEH,UAAUI,qBAAqB;EAAEF,UAAUG;AAAY,CAAA,GACvDL,UAAUM,0BAA0B;EAAEJ,UAAUK;AAAiB,CAAA,GACjEP,UAAUQ,gBAAgB;EAAEC,QAAQ;IAACC,WAAWA;;AAAY,CAAA,GAC5DV,UAAUW,iBAAiB;EAAET,UAAUU;AAAa,CAAA,GACpDZ,UAAUa,sBAAsB;EAAEC;AAAa,CAAA,GAC/Cd,UAAUe,kBAAkB;EAAEb,UAAUc;AAAsB,CAAA,GAC9DpB,OAAOqB,UAAU;EACfC,IAAI;EACJC,aAAaC,oBAAoBC;EACjCnB,UAAUoB;AACZ,CAAA,GACAtB,UAAUuB,qBAAqB;EAC7BC,OAAO;IAAEC,UAAU3B,KAAK4B,QAAQC;IAAKC,MAAM;IAAcC,SAASC;IAAYC,UAAU;EAAoB;AAC9G,CAAA,GACAnC,OAAOoC,IAAI;AAGb,IAAA,8BAAerC;",
6
+ "names": ["Plugin", "AppActivationEvents", "AppPlugin", "Transcript", "BlueprintDefinition", "OperationHandler", "ReactSurface", "TextContent", "Transcriber", "TranscriptionSettings", "meta", "translations", "TranscriptionPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addBlueprintDefinitionModule", "activate", "BlueprintDefinition", "addTextContentModule", "TextContent", "addOperationHandlerModule", "OperationHandler", "addSchemaModule", "schema", "Transcript", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "addSettingsModule", "TranscriptionSettings", "addModule", "id", "activatesOn", "AppActivationEvents", "SetupAppGraph", "Transcriber", "addPluginAssetModule", "asset", "pluginId", "profile", "key", "path", "content", "pluginSpec", "mimeType", "make"]
7
7
  }
@@ -3,15 +3,17 @@ import "../chunk-J5LGTIGS.mjs";
3
3
  // src/capabilities/index.ts
4
4
  import { Capability } from "@dxos/app-framework";
5
5
  var BlueprintDefinition = Capability.lazy("BlueprintDefinition", () => import("../blueprint-definition-DA4QFRYJ.mjs"));
6
- var TextContent = Capability.lazy("TextContent", () => import("../text-content-KBB37HSM.mjs"));
6
+ var TextContent = Capability.lazy("TextContent", () => import("../text-content-XZ3HK4OT.mjs"));
7
7
  var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-NXMOAXFP.mjs"));
8
8
  var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-YMZRO242.mjs"));
9
- var Transcriber = Capability.lazy("Transcriber", () => import("../transcriber-OGSF3XO5.mjs"));
9
+ var Transcriber = Capability.lazy("Transcriber", () => import("../transcriber-KYV6NWI5.mjs"));
10
+ var TranscriptionSettings = Capability.lazy("TranscriptionSettings", () => import("../settings-DUS32HOM.mjs"));
10
11
  export {
11
12
  BlueprintDefinition,
12
13
  OperationHandler,
13
14
  ReactSurface,
14
15
  TextContent,
15
- Transcriber
16
+ Transcriber,
17
+ TranscriptionSettings
16
18
  };
17
19
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/capabilities/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { type AppCapabilities } from '@dxos/app-toolkit';\nimport type { OperationHandlerSet } from '@dxos/compute';\n\n// The contributed capability type references Blueprint types from @dxos/compute, so the lazy\n// wrapper needs an explicit annotation to keep the inferred type portable (TS2883).\nexport const BlueprintDefinition: Capability.LazyCapability<\n void,\n Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]\n> = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));\nexport const TextContent = Capability.lazy('TextContent', () => import('./text-content'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const Transcriber = Capability.lazy('Transcriber', () => import('./transcriber'));\n"],
5
- "mappings": ";;;AAIA,SAASA,kBAAkB;AAMpB,IAAMC,sBAGTD,WAAWE,KAAK,uBAAuB,MAAM,OAAO,sCAAA,CAAA;AACjD,IAAMC,cAAcH,WAAWE,KAAK,eAAe,MAAM,OAAO,8BAAA,CAAA;AAChE,IAAME,mBAAmBJ,WAAWE,KACzC,oBACA,MAAM,OAAO,mCAAA,CAAA;AAER,IAAMG,eAAeL,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMI,cAAcN,WAAWE,KAAK,eAAe,MAAM,OAAO,6BAAA,CAAA;",
6
- "names": ["Capability", "BlueprintDefinition", "lazy", "TextContent", "OperationHandler", "ReactSurface", "Transcriber"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport type { OperationHandlerSet } from '@dxos/compute';\n\nexport const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));\nexport const TextContent = Capability.lazy('TextContent', () => import('./text-content'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const Transcriber = Capability.lazy('Transcriber', () => import('./transcriber'));\nexport const TranscriptionSettings = Capability.lazy('TranscriptionSettings', () => import('./settings'));\n"],
5
+ "mappings": ";;;AAIA,SAASA,kBAAkB;AAGpB,IAAMC,sBAAsBD,WAAWE,KAAK,uBAAuB,MAAM,OAAO,sCAAA,CAAA;AAChF,IAAMC,cAAcH,WAAWE,KAAK,eAAe,MAAM,OAAO,8BAAA,CAAA;AAChE,IAAME,mBAAmBJ,WAAWE,KACzC,oBACA,MAAM,OAAO,mCAAA,CAAA;AAER,IAAMG,eAAeL,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMI,cAAcN,WAAWE,KAAK,eAAe,MAAM,OAAO,6BAAA,CAAA;AAChE,IAAMK,wBAAwBP,WAAWE,KAAK,yBAAyB,MAAM,OAAO,0BAAA,CAAA;",
6
+ "names": ["Capability", "BlueprintDefinition", "lazy", "TextContent", "OperationHandler", "ReactSurface", "Transcriber", "TranscriptionSettings"]
7
7
  }
@@ -2,21 +2,37 @@ import {
2
2
  __export
3
3
  } from "./chunk-J5LGTIGS.mjs";
4
4
 
5
+ // src/types/Settings.ts
6
+ var Settings_exports = {};
7
+ __export(Settings_exports, {
8
+ Settings: () => Settings
9
+ });
10
+ import * as Schema from "effect/Schema";
11
+ var Settings = Schema.mutable(Schema.Struct({
12
+ entityExtraction: Schema.optional(Schema.Boolean.annotations({
13
+ title: "Entity extraction",
14
+ description: "While transcribing, use the Assistant to detect and annotate mentions of known objects such as people or organizations."
15
+ })).pipe(Schema.withConstructorDefault(() => true))
16
+ }));
17
+
5
18
  // src/types/TranscriptionCapabilities.ts
6
19
  var TranscriptionCapabilities_exports = {};
7
20
  __export(TranscriptionCapabilities_exports, {
21
+ Settings: () => Settings2,
8
22
  TranscriberProvider: () => TranscriberProvider,
9
23
  TranscriptionManagerProvider: () => TranscriptionManagerProvider
10
24
  });
11
25
  import { Capability } from "@dxos/app-framework";
12
26
  import { meta } from "#meta";
13
- var TranscriberProvider = Capability.make(`${meta.id}.capability.transcriber`);
14
- var TranscriptionManagerProvider = Capability.make(`${meta.id}.capability.transcription-manager`);
27
+ var TranscriberProvider = Capability.make(`${meta.profile.key}.capability.transcriber`);
28
+ var TranscriptionManagerProvider = Capability.make(`${meta.profile.key}.capability.transcription-manager`);
29
+ var Settings2 = Capability.make(`${meta.profile.key}.capability.settings`);
15
30
 
16
31
  // src/types/TranscriptOperation.ts
17
32
  var TranscriptOperation_exports = {};
18
33
  __export(TranscriptOperation_exports, {
19
34
  Create: () => Create,
35
+ EnrichMessage: () => EnrichMessage,
20
36
  MessageWithRangeId: () => MessageWithRangeId,
21
37
  Open: () => Open,
22
38
  SentenceNormalization: () => SentenceNormalization,
@@ -24,30 +40,30 @@ __export(TranscriptOperation_exports, {
24
40
  SentenceNormalizationOutput: () => SentenceNormalizationOutput,
25
41
  Summarize: () => Summarize
26
42
  });
27
- import * as Schema from "effect/Schema";
43
+ import * as Schema2 from "effect/Schema";
28
44
  import { AiService } from "@dxos/ai";
29
45
  import { SpaceSchema } from "@dxos/client/echo";
30
46
  import { Operation } from "@dxos/compute";
31
47
  import { Database, Feed, Ref, Type, DXN } from "@dxos/echo";
32
48
  import { Message, Transcript } from "@dxos/types";
33
49
  import { meta as meta2 } from "#meta";
34
- var makeKey = (name) => DXN.make(`${meta2.id}.operation.${name}`);
50
+ var makeKey = (name) => DXN.make(`${meta2.profile.key}.operation.${name}`);
35
51
  var Create = Operation.make({
36
52
  meta: {
37
53
  key: makeKey("create"),
38
54
  name: "Create Transcript",
39
55
  icon: "ph--microphone--regular"
40
56
  },
41
- input: Schema.Struct({
42
- name: Schema.optional(Schema.String),
57
+ input: Schema2.Struct({
58
+ name: Schema2.optional(Schema2.String),
43
59
  space: SpaceSchema
44
60
  }),
45
- output: Schema.Struct({
61
+ output: Schema2.Struct({
46
62
  object: Type.getSchema(Transcript.Transcript)
47
63
  })
48
64
  });
49
- var MessageWithRangeId = Schema.extend(Type.getSchema(Message.Message), Schema.Struct({
50
- rangeId: Schema.optional(Schema.Array(Schema.String)).annotations({
65
+ var MessageWithRangeId = Schema2.extend(Type.getSchema(Message.Message), Schema2.Struct({
66
+ rangeId: Schema2.optional(Schema2.Array(Schema2.String)).annotations({
51
67
  description: "The IDs of the messages that contain the sentences."
52
68
  })
53
69
  }));
@@ -58,13 +74,13 @@ var Open = Operation.make({
58
74
  description: "Opens and reads the contents of a transcription object.",
59
75
  icon: "ph--folder-open--regular"
60
76
  },
61
- input: Schema.Struct({
77
+ input: Schema2.Struct({
62
78
  transcript: Ref.Ref(Transcript.Transcript).annotations({
63
79
  description: "The ID of the transcription object."
64
80
  })
65
81
  }),
66
- output: Schema.Struct({
67
- content: Schema.String
82
+ output: Schema2.Struct({
83
+ content: Schema2.String
68
84
  }),
69
85
  services: [
70
86
  Database.Service,
@@ -78,16 +94,16 @@ var Summarize = Operation.make({
78
94
  description: "Summarize a transcript of a meeting.",
79
95
  icon: "ph--text-align-left--regular"
80
96
  },
81
- input: Schema.Struct({
82
- transcript: Schema.String.annotations({
97
+ input: Schema2.Struct({
98
+ transcript: Schema2.String.annotations({
83
99
  description: "The transcript of the meeting."
84
100
  }),
85
- notes: Schema.optional(Schema.String).annotations({
101
+ notes: Schema2.optional(Schema2.String).annotations({
86
102
  description: "Additional notes from the participants."
87
103
  })
88
104
  }),
89
- output: Schema.Struct({
90
- summary: Schema.String.annotations({
105
+ output: Schema2.Struct({
106
+ summary: Schema2.String.annotations({
91
107
  description: "The summary of the transcript."
92
108
  })
93
109
  }),
@@ -95,13 +111,31 @@ var Summarize = Operation.make({
95
111
  AiService.AiService
96
112
  ]
97
113
  });
98
- var SentenceNormalizationInput = Schema.Struct({
99
- messages: Schema.Array(MessageWithRangeId).annotations({
114
+ var EnrichMessage = Operation.make({
115
+ meta: {
116
+ key: DXN.make("org.dxos.function.transcription.enrichMessage"),
117
+ name: "Enrich Transcript Message",
118
+ description: "Extract proper nouns from a transcript message and link them to objects in the space.",
119
+ icon: "ph--text-t--regular"
120
+ },
121
+ input: Schema2.Struct({
122
+ message: Type.getSchema(Message.Message)
123
+ }),
124
+ output: Schema2.Struct({
125
+ message: Type.getSchema(Message.Message)
126
+ }),
127
+ services: [
128
+ AiService.AiService,
129
+ Database.Service
130
+ ]
131
+ });
132
+ var SentenceNormalizationInput = Schema2.Struct({
133
+ messages: Schema2.Array(MessageWithRangeId).annotations({
100
134
  description: "Messages to normalize into sentences."
101
135
  })
102
136
  });
103
- var SentenceNormalizationOutput = Schema.Struct({
104
- sentences: Schema.Array(MessageWithRangeId.pipe(Schema.mutable)).pipe(Schema.mutable).annotations({
137
+ var SentenceNormalizationOutput = Schema2.Struct({
138
+ sentences: Schema2.Array(MessageWithRangeId.pipe(Schema2.mutable)).pipe(Schema2.mutable).annotations({
105
139
  description: "The sentences of the transcript."
106
140
  })
107
141
  });
@@ -118,7 +152,8 @@ var SentenceNormalization = Operation.make({
118
152
  });
119
153
 
120
154
  export {
155
+ Settings_exports,
121
156
  TranscriptionCapabilities_exports,
122
157
  TranscriptOperation_exports
123
158
  };
124
- //# sourceMappingURL=chunk-KMT3BMMQ.mjs.map
159
+ //# sourceMappingURL=chunk-2URVUJT4.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/Settings.ts", "../../../src/types/TranscriptionCapabilities.ts", "../../../src/types/TranscriptOperation.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nexport const Settings = Schema.mutable(\n Schema.Struct({\n entityExtraction: Schema.optional(\n Schema.Boolean.annotations({\n title: 'Entity extraction',\n description:\n 'While transcribing, use the Assistant to detect and annotate mentions of known objects such as people or organizations.',\n }),\n ).pipe(Schema.withConstructorDefault(() => true)),\n }),\n);\n\nexport interface Settings extends Schema.Schema.Type<typeof Settings> {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type Atom } from '@effect-atom/atom-react';\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nimport {\n type MediaStreamRecorderProps,\n type Transcriber as TranscriberType,\n type TranscriberProps,\n type TranscriptMessageEnricher,\n type TranscriptionManager as TranscriptionManagerType,\n} from '../transcriber';\nimport * as Settings$ from './Settings'; // eslint-disable-line\n\nexport type TranscriberProviderProps = {\n audioStreamTrack: MediaStreamTrack;\n recorderConfig?: Partial<MediaStreamRecorderProps['config']>;\n transcriberConfig?: Partial<TranscriberProps['config']>;\n onSegments: TranscriberProps['onSegments'];\n transcribe?: TranscriberProps['transcribe'];\n};\n\nexport type TranscriberProvider = (props: TranscriberProviderProps) => TranscriberType;\n\nexport type TranscriptionManagerProviderProps = {\n messageEnricher?: TranscriptMessageEnricher;\n};\n\nexport type TranscriptionManagerProvider = (props: TranscriptionManagerProviderProps) => TranscriptionManagerType;\n\nexport const TranscriberProvider = Capability.make<TranscriberProvider>(`${meta.profile.key}.capability.transcriber`);\n\nexport const TranscriptionManagerProvider = Capability.make<TranscriptionManagerProvider>(\n `${meta.profile.key}.capability.transcription-manager`,\n);\n\nexport const Settings = Capability.make<Atom.Writable<Settings$.Settings>>(`${meta.profile.key}.capability.settings`);\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\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, Type, DXN } from '@dxos/echo';\nimport { Message, Transcript } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nconst makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);\n\nexport const Create = Operation.make({\n meta: { key: makeKey('create'), name: 'Create Transcript', icon: 'ph--microphone--regular' },\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n space: SpaceSchema,\n }),\n output: Schema.Struct({\n object: Type.getSchema(Transcript.Transcript),\n }),\n});\n\nexport const MessageWithRangeId = Schema.extend(\n Type.getSchema(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: DXN.make('org.dxos.function.transcription.open'),\n name: 'Open',\n description: 'Opens and reads the contents of a transcription object.',\n icon: 'ph--folder-open--regular',\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: DXN.make('org.dxos.function.transcription.summarize'),\n name: 'Summarize',\n description: 'Summarize a transcript of a meeting.',\n icon: 'ph--text-align-left--regular',\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 EnrichMessage = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.transcription.enrichMessage'),\n name: 'Enrich Transcript Message',\n description: 'Extract proper nouns from a transcript message and link them to objects in the space.',\n icon: 'ph--text-t--regular',\n },\n input: Schema.Struct({\n message: Type.getSchema(Message.Message),\n }),\n output: Schema.Struct({\n message: Type.getSchema(Message.Message),\n }),\n services: [AiService.AiService, Database.Service],\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: DXN.make('org.dxos.function.transcription.sentenceNormalization'),\n name: 'Sentence Normalization',\n description: 'Post process of transcription for sentence normalization',\n icon: 'ph--text-t--regular',\n },\n input: SentenceNormalizationInput,\n output: SentenceNormalizationOutput,\n services: [],\n});\n"],
5
+ "mappings": ";;;;;AAAA;;;;AAMA,YAAYA,YAAY;AAEjB,IAAMC,WAAkBC,eACtBC,cAAO;EACZC,kBAAyBC,gBAChBC,eAAQC,YAAY;IACzBC,OAAO;IACPC,aACE;EACJ,CAAA,CAAA,EACAC,KAAYC,8BAAuB,MAAM,IAAA,CAAA;AAC7C,CAAA,CAAA;;;ACjBF;;kBAAAC;EAAA;;;AAQA,SAASC,kBAAkB;AAE3B,SAASC,YAAY;AA2Bd,IAAMC,sBAAsBF,WAAWG,KAA0B,GAAGF,KAAKG,QAAQC,GAAG,yBAAyB;AAE7G,IAAMC,+BAA+BN,WAAWG,KACrD,GAAGF,KAAKG,QAAQC,GAAG,mCAAmC;AAGjD,IAAMN,YAAWC,WAAWG,KAAwC,GAAGF,KAAKG,QAAQC,GAAG,sBAAsB;;;AC3CpH;;;;;;;;;;;AAMA,YAAYE,aAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,MAAMC,KAAKC,MAAMC,WAAW;AAC/C,SAASC,SAASC,kBAAkB;AAEpC,SAASC,QAAAA,aAAY;AAErB,IAAMC,UAAU,CAACC,SAAiBL,IAAIM,KAAK,GAAGH,MAAKI,QAAQC,GAAG,cAAcH,IAAAA,EAAM;AAE3E,IAAMI,SAASd,UAAUW,KAAK;EACnCH,MAAM;IAAEK,KAAKJ,QAAQ,QAAA;IAAWC,MAAM;IAAqBK,MAAM;EAA0B;EAC3FC,OAAcC,eAAO;IACnBP,MAAaQ,iBAAgBC,cAAM;IACnCC,OAAOrB;EACT,CAAA;EACAsB,QAAeJ,eAAO;IACpBK,QAAQlB,KAAKmB,UAAUhB,WAAWA,UAAU;EAC9C,CAAA;AACF,CAAA;AAEO,IAAMiB,qBAA4BC,eACvCrB,KAAKmB,UAAUjB,QAAQA,OAAO,GACvBW,eAAO;EACZS,SAAgBR,iBAAgBS,cAAaR,cAAM,CAAA,EAAGS,YAAY;IAChEC,aAAa;EACf,CAAA;AACF,CAAA,CAAA;AAKK,IAAMC,OAAO9B,UAAUW,KAAK;EACjCH,MAAM;IACJK,KAAKR,IAAIM,KAAK,sCAAA;IACdD,MAAM;IACNmB,aAAa;IACbd,MAAM;EACR;EACAC,OAAcC,eAAO;IACnBc,YAAY5B,IAAIA,IAAII,WAAWA,UAAU,EAAEqB,YAAY;MACrDC,aAAa;IACf,CAAA;EACF,CAAA;EACAR,QAAeJ,eAAO;IACpBe,SAAgBb;EAClB,CAAA;EACAc,UAAU;IAAChC,SAASiC;IAAShC,KAAKiC;;AACpC,CAAA;AAEO,IAAMC,YAAYpC,UAAUW,KAAK;EACtCH,MAAM;IACJK,KAAKR,IAAIM,KAAK,2CAAA;IACdD,MAAM;IACNmB,aAAa;IACbd,MAAM;EACR;EACAC,OAAcC,eAAO;IACnBc,YAAmBZ,eAAOS,YAAY;MACpCC,aAAa;IACf,CAAA;IACAQ,OAAcnB,iBAAgBC,cAAM,EAAES,YAAY;MAChDC,aAAa;IACf,CAAA;EACF,CAAA;EACAR,QAAeJ,eAAO;IACpBqB,SAAgBnB,eAAOS,YAAY;MACjCC,aAAa;IACf,CAAA;EACF,CAAA;EACAI,UAAU;IAACnC,UAAUA;;AACvB,CAAA;AAEO,IAAMyC,gBAAgBvC,UAAUW,KAAK;EAC1CH,MAAM;IACJK,KAAKR,IAAIM,KAAK,+CAAA;IACdD,MAAM;IACNmB,aAAa;IACbd,MAAM;EACR;EACAC,OAAcC,eAAO;IACnBuB,SAASpC,KAAKmB,UAAUjB,QAAQA,OAAO;EACzC,CAAA;EACAe,QAAeJ,eAAO;IACpBuB,SAASpC,KAAKmB,UAAUjB,QAAQA,OAAO;EACzC,CAAA;EACA2B,UAAU;IAACnC,UAAUA;IAAWG,SAASiC;;AAC3C,CAAA;AAEO,IAAMO,6BAAoCxB,eAAO;EACtDyB,UAAiBf,cAAMH,kBAAAA,EAAoBI,YAAY;IACrDC,aAAa;EACf,CAAA;AACF,CAAA;AAIO,IAAMc,8BAAqC1B,eAAO;EACvD2B,WAAkBjB,cAAMH,mBAAmBqB,KAAYC,eAAO,CAAA,EAAGD,KAAYC,eAAO,EAAElB,YAAY;IAChGC,aAAa;EACf,CAAA;AACF,CAAA;AAEO,IAAMkB,wBAAwB/C,UAAUW,KAAK;EAClDH,MAAM;IACJK,KAAKR,IAAIM,KAAK,uDAAA;IACdD,MAAM;IACNmB,aAAa;IACbd,MAAM;EACR;EACAC,OAAOyB;EACPpB,QAAQsB;EACRV,UAAU,CAAA;AACZ,CAAA;",
6
+ "names": ["Schema", "Settings", "mutable", "Struct", "entityExtraction", "optional", "Boolean", "annotations", "title", "description", "pipe", "withConstructorDefault", "Settings", "Capability", "meta", "TranscriberProvider", "make", "profile", "key", "TranscriptionManagerProvider", "Schema", "AiService", "SpaceSchema", "Operation", "Database", "Feed", "Ref", "Type", "DXN", "Message", "Transcript", "meta", "makeKey", "name", "make", "profile", "key", "Create", "icon", "input", "Struct", "optional", "String", "space", "output", "object", "getSchema", "MessageWithRangeId", "extend", "rangeId", "Array", "annotations", "description", "Open", "transcript", "content", "services", "Service", "FeedService", "Summarize", "notes", "summary", "EnrichMessage", "message", "SentenceNormalizationInput", "messages", "SentenceNormalizationOutput", "sentences", "pipe", "mutable", "SentenceNormalization"]
7
+ }
@@ -0,0 +1,8 @@
1
+ // src/operations/index.ts
2
+ import { OperationHandlerSet } from "@dxos/compute";
3
+ var TranscriptionOperationHandlerSet = OperationHandlerSet.lazy(() => import("./create-7NGOP7JP.mjs"), () => import("./open-42H72C4G.mjs"), () => import("./summarize-45WVUPED.mjs"), () => import("./enrich-message-F2AOM53F.mjs"));
4
+
5
+ export {
6
+ TranscriptionOperationHandlerSet
7
+ };
8
+ //# sourceMappingURL=chunk-J4ONEYPJ.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/operations/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const TranscriptionOperationHandlerSet = OperationHandlerSet.lazy(\n () => import('./create'),\n () => import('./open'),\n () => import('./summarize'),\n);\n"],
5
- "mappings": ";AAIA,SAASA,2BAA2B;AAE7B,IAAMC,mCAAmCD,oBAAoBE,KAClE,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,0BAAA,CAAA;",
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const TranscriptionOperationHandlerSet = OperationHandlerSet.lazy(\n () => import('./create'),\n () => import('./open'),\n () => import('./summarize'),\n () => import('./enrich-message'),\n);\n"],
5
+ "mappings": ";AAIA,SAASA,2BAA2B;AAE7B,IAAMC,mCAAmCD,oBAAoBE,KAClE,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,0BAAA,GACb,MAAM,OAAO,+BAAA,CAAA;",
6
6
  "names": ["OperationHandlerSet", "TranscriptionOperationHandlerSet", "lazy"]
7
7
  }
@@ -168,6 +168,7 @@ var useTranscriber = ({ audioStreamTrack, recorderConfig, transcriberConfig, onS
168
168
  // src/hooks/useTranscriptionRecording.ts
169
169
  import * as Effect from "effect/Effect";
170
170
  import { useCallback, useEffect as useEffect5, useState as useState3 } from "react";
171
+ import { useAtomCapability, useOperationInvoker } from "@dxos/app-framework/ui";
171
172
  import { createFeedServiceLayer } from "@dxos/client/echo";
172
173
  import { Feed, Obj } from "@dxos/echo";
173
174
  import { EffectEx } from "@dxos/effect";
@@ -175,6 +176,7 @@ import { log as log2 } from "@dxos/log";
175
176
  import { getSpace } from "@dxos/react-client/echo";
176
177
  import { useIdentity } from "@dxos/react-client/halo";
177
178
  import { Message } from "@dxos/types";
179
+ import { TranscriptOperation, TranscriptionCapabilities as TranscriptionCapabilities2 } from "#types";
178
180
  var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/hooks/useTranscriptionRecording.ts";
179
181
  var useTranscriptionRecording = (transcript) => {
180
182
  const space = getSpace(transcript);
@@ -182,6 +184,8 @@ var useTranscriptionRecording = (transcript) => {
182
184
  const feed = transcript.feed.target;
183
185
  const [recording, setRecording] = useState3(false);
184
186
  const track = useAudioTrack(recording);
187
+ const { invokePromise } = useOperationInvoker();
188
+ const settings = useAtomCapability(TranscriptionCapabilities2.Settings);
185
189
  const handleSegments = useCallback(async (blocks) => {
186
190
  if (!space || !feed || blocks.length === 0) {
187
191
  return;
@@ -190,19 +194,35 @@ var useTranscriptionRecording = (transcript) => {
190
194
  identityDid: identity.did,
191
195
  name: identity.profile?.displayName
192
196
  } : {};
193
- const message = Obj.make(Message.Message, {
197
+ let message = Obj.make(Message.Message, {
194
198
  sender,
195
199
  created: (/* @__PURE__ */ new Date()).toISOString(),
196
200
  blocks
197
201
  });
198
- const feedServiceLayer = createFeedServiceLayer(space.queues);
202
+ if (settings?.entityExtraction ?? true) {
203
+ const { data, error } = await invokePromise(TranscriptOperation.EnrichMessage, {
204
+ message
205
+ }, {
206
+ spaceId: space.id
207
+ });
208
+ if (error) {
209
+ log2.warn("entity extraction failed; using raw transcript", {
210
+ error
211
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 53, S: void 0 });
212
+ } else if (data?.message) {
213
+ message = data.message;
214
+ }
215
+ }
216
+ const feedServiceLayer = createFeedServiceLayer(space.db);
199
217
  await Feed.append(feed, [
200
218
  message
201
219
  ]).pipe(Effect.provide(feedServiceLayer), EffectEx.runAndForwardErrors);
202
220
  }, [
203
221
  space,
204
222
  feed,
205
- identity
223
+ identity,
224
+ invokePromise,
225
+ settings
206
226
  ]);
207
227
  const transcriber = useTranscriber({
208
228
  audioStreamTrack: track,
@@ -219,7 +239,7 @@ var useTranscriptionRecording = (transcript) => {
219
239
  }
220
240
  }, (err) => {
221
241
  if (!cancelled) {
222
- log2.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 67, S: void 0 });
242
+ log2.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 90, S: void 0 });
223
243
  setRecording(false);
224
244
  }
225
245
  });
@@ -295,4 +315,4 @@ export {
295
315
  useTranscriptionRecording,
296
316
  useVoiceInput
297
317
  };
298
- //# sourceMappingURL=chunk-TO77KAQK.mjs.map
318
+ //# sourceMappingURL=chunk-XMHH34NI.mjs.map