@dxos/plugin-transcription 0.8.2-main.12df754 → 0.8.2-main.2f9c567

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 (193) hide show
  1. package/dist/lib/browser/{TranscriptContainer-4D4BHE7G.mjs → TranscriptContainer-3LU3XBEB.mjs} +3 -3
  2. package/dist/lib/browser/app-graph-builder-YXELPN6F.mjs +349 -0
  3. package/dist/lib/browser/app-graph-builder-YXELPN6F.mjs.map +7 -0
  4. package/dist/lib/browser/{chunk-DR3NBV6Q.mjs → chunk-GWY2Q2NE.mjs} +105 -78
  5. package/dist/lib/browser/chunk-GWY2Q2NE.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-RHHJZQPM.mjs → chunk-HNIKXVCG.mjs} +135 -117
  7. package/dist/lib/browser/chunk-HNIKXVCG.mjs.map +7 -0
  8. package/dist/lib/browser/chunk-HRDAILQX.mjs +27 -0
  9. package/dist/lib/browser/chunk-HRDAILQX.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-5BE6RTNC.mjs → chunk-LTIQFX4W.mjs} +1 -1
  11. package/dist/lib/browser/{chunk-5BE6RTNC.mjs.map → chunk-LTIQFX4W.mjs.map} +1 -1
  12. package/dist/lib/browser/{chunk-5Q3R53U3.mjs → chunk-TGOKX32G.mjs} +21 -31
  13. package/dist/lib/browser/chunk-TGOKX32G.mjs.map +7 -0
  14. package/dist/lib/browser/index.mjs +29 -17
  15. package/dist/lib/browser/index.mjs.map +3 -3
  16. package/dist/lib/browser/{intent-resolver-ZQQEH27F.mjs → intent-resolver-BBB3DWV4.mjs} +4 -4
  17. package/dist/lib/browser/{intent-resolver-ZQQEH27F.mjs.map → intent-resolver-BBB3DWV4.mjs.map} +2 -2
  18. package/dist/lib/browser/{meeting-transcription-state-5D52VTHU.mjs → meeting-transcription-state-MNA2XROE.mjs} +2 -2
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/{react-surface-HETJ5XY6.mjs → react-surface-R277DACJ.mjs} +18 -7
  21. package/dist/lib/browser/react-surface-R277DACJ.mjs.map +7 -0
  22. package/dist/lib/browser/settings-I226DZ27.mjs +24 -0
  23. package/dist/lib/browser/settings-I226DZ27.mjs.map +7 -0
  24. package/dist/lib/browser/{transcriber-SMRLU2KY.mjs → transcriber-QRSS6X6S.mjs} +4 -4
  25. package/dist/lib/browser/types/index.mjs +3 -3
  26. package/dist/lib/node/{TranscriptContainer-ZWP6UKY6.cjs → TranscriptContainer-DICOMZLM.cjs} +8 -8
  27. package/dist/lib/node/{TranscriptContainer-ZWP6UKY6.cjs.map → TranscriptContainer-DICOMZLM.cjs.map} +2 -2
  28. package/dist/lib/node/app-graph-builder-I6LYVIYY.cjs +350 -0
  29. package/dist/lib/node/app-graph-builder-I6LYVIYY.cjs.map +7 -0
  30. package/dist/lib/node/{chunk-3QEJ5EBO.cjs → chunk-34WFY7M7.cjs} +22 -32
  31. package/dist/lib/node/chunk-34WFY7M7.cjs.map +7 -0
  32. package/dist/lib/node/{chunk-KO6MKCED.cjs → chunk-4JOJCZPJ.cjs} +138 -119
  33. package/dist/lib/node/chunk-4JOJCZPJ.cjs.map +7 -0
  34. package/dist/lib/node/{chunk-HYGDHS6X.cjs → chunk-JUGOXWES.cjs} +4 -4
  35. package/dist/lib/node/{chunk-HYGDHS6X.cjs.map → chunk-JUGOXWES.cjs.map} +1 -1
  36. package/dist/lib/node/{chunk-WXG4Z2EZ.cjs → chunk-K553L7CZ.cjs} +23 -8
  37. package/dist/lib/node/chunk-K553L7CZ.cjs.map +7 -0
  38. package/dist/lib/node/{chunk-LA73IHCB.cjs → chunk-RK4BEN5E.cjs} +108 -80
  39. package/dist/lib/node/chunk-RK4BEN5E.cjs.map +7 -0
  40. package/dist/lib/node/index.cjs +46 -34
  41. package/dist/lib/node/index.cjs.map +3 -3
  42. package/dist/lib/node/{intent-resolver-VY3XWYAA.cjs → intent-resolver-7XY3WITN.cjs} +8 -8
  43. package/dist/lib/node/{intent-resolver-VY3XWYAA.cjs.map → intent-resolver-7XY3WITN.cjs.map} +2 -2
  44. package/dist/lib/node/{meeting-transcription-state-OYWCY5XE.cjs → meeting-transcription-state-5XLTMWPA.cjs} +6 -6
  45. package/dist/lib/node/meta.json +1 -1
  46. package/dist/lib/node/{react-surface-M2JQIIDY.cjs → react-surface-HUSWAORU.cjs} +20 -11
  47. package/dist/lib/node/react-surface-HUSWAORU.cjs.map +7 -0
  48. package/dist/lib/node/settings-NDMU3EWQ.cjs +38 -0
  49. package/dist/lib/node/settings-NDMU3EWQ.cjs.map +7 -0
  50. package/dist/lib/node/{transcriber-E6AAB4SU.cjs → transcriber-UZJMG44C.cjs} +10 -10
  51. package/dist/lib/node/types/index.cjs +8 -8
  52. package/dist/lib/node/types/index.cjs.map +1 -1
  53. package/dist/lib/node-esm/{TranscriptContainer-3HJ752CP.mjs → TranscriptContainer-K4E4P5T6.mjs} +3 -3
  54. package/dist/lib/node-esm/app-graph-builder-6FY2UQOH.mjs +350 -0
  55. package/dist/lib/node-esm/app-graph-builder-6FY2UQOH.mjs.map +7 -0
  56. package/dist/lib/node-esm/chunk-3I7AC3D3.mjs +28 -0
  57. package/dist/lib/node-esm/chunk-3I7AC3D3.mjs.map +7 -0
  58. package/dist/lib/node-esm/{chunk-YXZOLOFT.mjs → chunk-5E2MR5XK.mjs} +1 -1
  59. package/dist/lib/node-esm/{chunk-YXZOLOFT.mjs.map → chunk-5E2MR5XK.mjs.map} +1 -1
  60. package/dist/lib/node-esm/{chunk-SDMGJZLN.mjs → chunk-6C34FO4C.mjs} +135 -117
  61. package/dist/lib/node-esm/chunk-6C34FO4C.mjs.map +7 -0
  62. package/dist/lib/node-esm/{chunk-K3R3YK3S.mjs → chunk-CKANLRS4.mjs} +105 -78
  63. package/dist/lib/node-esm/chunk-CKANLRS4.mjs.map +7 -0
  64. package/dist/lib/node-esm/{chunk-54HDN33F.mjs → chunk-KUQ3ZTRX.mjs} +21 -31
  65. package/dist/lib/node-esm/chunk-KUQ3ZTRX.mjs.map +7 -0
  66. package/dist/lib/node-esm/index.mjs +29 -17
  67. package/dist/lib/node-esm/index.mjs.map +3 -3
  68. package/dist/lib/node-esm/{intent-resolver-FCTNJPWY.mjs → intent-resolver-ACGAPLDZ.mjs} +4 -4
  69. package/dist/lib/node-esm/{intent-resolver-FCTNJPWY.mjs.map → intent-resolver-ACGAPLDZ.mjs.map} +2 -2
  70. package/dist/lib/node-esm/{meeting-transcription-state-XMZJ45P4.mjs → meeting-transcription-state-3WOZ52BQ.mjs} +2 -2
  71. package/dist/lib/node-esm/meta.json +1 -1
  72. package/dist/lib/node-esm/{react-surface-PXFSIM6V.mjs → react-surface-G2OY4MWL.mjs} +18 -7
  73. package/dist/lib/node-esm/react-surface-G2OY4MWL.mjs.map +7 -0
  74. package/dist/lib/node-esm/settings-O7X2UQQG.mjs +25 -0
  75. package/dist/lib/node-esm/settings-O7X2UQQG.mjs.map +7 -0
  76. package/dist/lib/node-esm/{transcriber-REAGRCPY.mjs → transcriber-NVVFH7IF.mjs} +4 -4
  77. package/dist/lib/node-esm/types/index.mjs +3 -3
  78. package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
  79. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  80. package/dist/types/src/capabilities/capabilities.d.ts +1 -1
  81. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  82. package/dist/types/src/capabilities/index.d.ts +1 -0
  83. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  84. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/settings.d.ts +4 -0
  86. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  87. package/dist/types/src/components/Transcript/Transcript.d.ts +6 -4
  88. package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
  89. package/dist/types/src/components/Transcript/Transcript.stories.d.ts +8 -4
  90. package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
  91. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +27 -0
  92. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +1 -0
  93. package/dist/types/src/components/Transcript/transcript-extension.d.ts +4 -4
  94. package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +1 -1
  95. package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
  96. package/dist/types/src/components/TranscriptionSettings/TranscriptionSettings.d.ts +6 -0
  97. package/dist/types/src/components/TranscriptionSettings/TranscriptionSettings.d.ts.map +1 -0
  98. package/dist/types/src/components/TranscriptionSettings/index.d.ts +2 -0
  99. package/dist/types/src/components/TranscriptionSettings/index.d.ts.map +1 -0
  100. package/dist/types/src/components/index.d.ts +1 -0
  101. package/dist/types/src/components/index.d.ts.map +1 -1
  102. package/dist/types/src/components/transcription.stories.d.ts +6 -3
  103. package/dist/types/src/components/transcription.stories.d.ts.map +1 -1
  104. package/dist/types/src/entity-extraction/entity-extraction.d.ts +33 -7
  105. package/dist/types/src/entity-extraction/entity-extraction.d.ts.map +1 -1
  106. package/dist/types/src/hooks/useQueueModelAdapter.d.ts +2 -2
  107. package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
  108. package/dist/types/src/model/model.d.ts +23 -23
  109. package/dist/types/src/model/model.d.ts.map +1 -1
  110. package/dist/types/src/testing/index.d.ts +2 -0
  111. package/dist/types/src/testing/index.d.ts.map +1 -0
  112. package/dist/types/src/testing/testing.d.ts +40 -0
  113. package/dist/types/src/testing/testing.d.ts.map +1 -0
  114. package/dist/types/src/transcriber/transcriber.d.ts +2 -2
  115. package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
  116. package/dist/types/src/transcriber/transcription-manager.d.ts +17 -15
  117. package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
  118. package/dist/types/src/translations.d.ts +3 -0
  119. package/dist/types/src/translations.d.ts.map +1 -1
  120. package/dist/types/src/types/schema.d.ts +26 -40
  121. package/dist/types/src/types/schema.d.ts.map +1 -1
  122. package/dist/types/src/types/types.d.ts +11 -7
  123. package/dist/types/src/types/types.d.ts.map +1 -1
  124. package/package.json +51 -46
  125. package/src/TranscriptionPlugin.tsx +29 -12
  126. package/src/capabilities/app-graph-builder.ts +99 -29
  127. package/src/capabilities/capabilities.ts +1 -1
  128. package/src/capabilities/index.ts +1 -0
  129. package/src/capabilities/intent-resolver.ts +2 -2
  130. package/src/capabilities/react-surface.tsx +12 -4
  131. package/src/capabilities/settings.ts +20 -0
  132. package/src/components/Transcript/Transcript.stories.tsx +71 -35
  133. package/src/components/Transcript/Transcript.tsx +37 -30
  134. package/src/components/Transcript/deprecated/{Transcript.tsx → OldTranscript.tsx} +30 -1
  135. package/src/components/Transcript/transcript-extension.ts +20 -17
  136. package/src/components/TranscriptContainer.tsx +6 -4
  137. package/src/components/TranscriptionSettings/TranscriptionSettings.tsx +26 -0
  138. package/src/components/TranscriptionSettings/index.ts +5 -0
  139. package/src/components/index.ts +1 -0
  140. package/src/components/transcription.stories.tsx +83 -29
  141. package/src/entity-extraction/entity-extraction.test.ts +75 -10
  142. package/src/entity-extraction/entity-extraction.ts +110 -55
  143. package/src/entity-extraction/system-prompt.tpl +38 -9
  144. package/src/hooks/useQueueModelAdapter.ts +44 -11
  145. package/src/model/model.test.ts +90 -44
  146. package/src/model/model.ts +59 -59
  147. package/src/testing/index.ts +5 -0
  148. package/src/testing/testing.ts +221 -0
  149. package/src/transcriber/transcriber.browser.test.ts +3 -3
  150. package/src/transcriber/transcriber.ts +19 -10
  151. package/src/transcriber/transcription-manager.ts +66 -57
  152. package/src/translations.ts +2 -0
  153. package/src/types/schema.ts +10 -31
  154. package/src/types/types.ts +17 -7
  155. package/dist/lib/browser/app-graph-builder-I4SSIQMW.mjs +0 -168
  156. package/dist/lib/browser/app-graph-builder-I4SSIQMW.mjs.map +0 -7
  157. package/dist/lib/browser/chunk-5Q3R53U3.mjs.map +0 -7
  158. package/dist/lib/browser/chunk-DR3NBV6Q.mjs.map +0 -7
  159. package/dist/lib/browser/chunk-GI5LZ4SV.mjs +0 -8
  160. package/dist/lib/browser/chunk-GI5LZ4SV.mjs.map +0 -7
  161. package/dist/lib/browser/chunk-RHHJZQPM.mjs.map +0 -7
  162. package/dist/lib/browser/react-surface-HETJ5XY6.mjs.map +0 -7
  163. package/dist/lib/node/app-graph-builder-WWC4WNTG.cjs +0 -177
  164. package/dist/lib/node/app-graph-builder-WWC4WNTG.cjs.map +0 -7
  165. package/dist/lib/node/chunk-3QEJ5EBO.cjs.map +0 -7
  166. package/dist/lib/node/chunk-KO6MKCED.cjs.map +0 -7
  167. package/dist/lib/node/chunk-LA73IHCB.cjs.map +0 -7
  168. package/dist/lib/node/chunk-WXG4Z2EZ.cjs.map +0 -7
  169. package/dist/lib/node/react-surface-M2JQIIDY.cjs.map +0 -7
  170. package/dist/lib/node-esm/app-graph-builder-PPJQAFSI.mjs +0 -169
  171. package/dist/lib/node-esm/app-graph-builder-PPJQAFSI.mjs.map +0 -7
  172. package/dist/lib/node-esm/chunk-54HDN33F.mjs.map +0 -7
  173. package/dist/lib/node-esm/chunk-K3R3YK3S.mjs.map +0 -7
  174. package/dist/lib/node-esm/chunk-SDMGJZLN.mjs.map +0 -7
  175. package/dist/lib/node-esm/chunk-XY22OP6H.mjs +0 -10
  176. package/dist/lib/node-esm/chunk-XY22OP6H.mjs.map +0 -7
  177. package/dist/lib/node-esm/react-surface-PXFSIM6V.mjs.map +0 -7
  178. package/dist/types/src/components/Transcript/deprecated/Transcript.d.ts +0 -13
  179. package/dist/types/src/components/Transcript/deprecated/Transcript.d.ts.map +0 -1
  180. package/dist/types/src/components/Transcript/testings.d.ts +0 -51
  181. package/dist/types/src/components/Transcript/testings.d.ts.map +0 -1
  182. package/dist/types/src/testing/test-data.d.ts +0 -73
  183. package/dist/types/src/testing/test-data.d.ts.map +0 -1
  184. package/src/components/Transcript/testings.ts +0 -182
  185. package/src/testing/test-data.ts +0 -314
  186. /package/dist/lib/browser/{TranscriptContainer-4D4BHE7G.mjs.map → TranscriptContainer-3LU3XBEB.mjs.map} +0 -0
  187. /package/dist/lib/browser/{meeting-transcription-state-5D52VTHU.mjs.map → meeting-transcription-state-MNA2XROE.mjs.map} +0 -0
  188. /package/dist/lib/browser/{transcriber-SMRLU2KY.mjs.map → transcriber-QRSS6X6S.mjs.map} +0 -0
  189. /package/dist/lib/node/{meeting-transcription-state-OYWCY5XE.cjs.map → meeting-transcription-state-5XLTMWPA.cjs.map} +0 -0
  190. /package/dist/lib/node/{transcriber-E6AAB4SU.cjs.map → transcriber-UZJMG44C.cjs.map} +0 -0
  191. /package/dist/lib/node-esm/{TranscriptContainer-3HJ752CP.mjs.map → TranscriptContainer-K4E4P5T6.mjs.map} +0 -0
  192. /package/dist/lib/node-esm/{meeting-transcription-state-XMZJ45P4.mjs.map → meeting-transcription-state-3WOZ52BQ.mjs.map} +0 -0
  193. /package/dist/lib/node-esm/{transcriber-REAGRCPY.mjs.map → transcriber-NVVFH7IF.mjs.map} +0 -0
@@ -0,0 +1,350 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var app_graph_builder_I6LYVIYY_exports = {};
20
+ __export(app_graph_builder_I6LYVIYY_exports, {
21
+ default: () => app_graph_builder_default
22
+ });
23
+ module.exports = __toCommonJS(app_graph_builder_I6LYVIYY_exports);
24
+ var import_chunk_RK4BEN5E = require("./chunk-RK4BEN5E.cjs");
25
+ var import_chunk_J72PUQ3C = require("./chunk-J72PUQ3C.cjs");
26
+ var import_chunk_34WFY7M7 = require("./chunk-34WFY7M7.cjs");
27
+ var import_chunk_JUGOXWES = require("./chunk-JUGOXWES.cjs");
28
+ var import_chunk_NVZWGFJL = require("./chunk-NVZWGFJL.cjs");
29
+ var import_app_framework = require("@dxos/app-framework");
30
+ var import_assistant = require("@dxos/assistant");
31
+ var import_testing = require("@dxos/assistant/testing");
32
+ var import_echo = require("@dxos/client/echo");
33
+ var import_echo_schema = require("@dxos/echo-schema");
34
+ var import_invariant = require("@dxos/invariant");
35
+ var import_keys = require("@dxos/keys");
36
+ var import_log = require("@dxos/log");
37
+ var import_plugin_client = require("@dxos/plugin-client");
38
+ var import_types = require("@dxos/plugin-deck/types");
39
+ var import_plugin_graph = require("@dxos/plugin-graph");
40
+ var import_types2 = require("@dxos/plugin-markdown/types");
41
+ var import_plugin_meeting = require("@dxos/plugin-meeting");
42
+ var import_types3 = require("@dxos/plugin-meeting/types");
43
+ var import_schema = require("@dxos/schema");
44
+ var import_effect = require("effect");
45
+ var import_artifact = require("@dxos/artifact");
46
+ var import_assistant2 = require("@dxos/assistant");
47
+ var import_async = require("@dxos/async");
48
+ var import_echo_schema2 = require("@dxos/echo-schema");
49
+ var import_keys2 = require("@dxos/keys");
50
+ var import_log2 = require("@dxos/log");
51
+ var import_schema2 = require("@dxos/schema");
52
+ var system_prompt_default = 'You are an AI assistant specialized in processing and enhancing transcripts with contextual information.\nYour task is to analyze a given transcript and extract references to the context objects.\n\nThe context and transcript are provided in the user message in `context` and `transcript` XML tags.\n\nHere are your instructions:\n\n1. Read the transcript and context information provided above.\n\n2. Process each segment of the transcript separately.\n\n3. For each segment:\n a. Analyze the content and identify relevant information from the context.\n b. Extract a number of references to the context objects that are mentioned in the segment.\n c. Output the references in the format `{ "quote": "earnings report", "id": "01JT0JP9AX0XKGZX4MV4B69VT6" }`.\n d. If there are no references, just output an empty array.\n\n4. Maintain the exact order and structure of the original transcript segments.\n\nOutput Format:\nThe final output should be a JSON array of references.\n\nExample output structure:\n```json\n{\n "references": [\n { "quote": "earnings report", "id": "01JT0JP9AX0XKGZX4MV4B69VT6" },\n { "quote": "John", "id": "01JT0VM0VN3ZKN7GDBM8CV9BA7" }\n ]\n}\n```\n\nRemember:\n- Only quote the text that is in the transcript.\n- Analyze each segment carefully before processing it.\n- Only reference objects that appear in the context and exactly by their id, If the object is not in the context, do not insert a reference. \n\nNow, process the transcript and context provided below according to these instructions.';
53
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-transcription/src/entity-extraction/entity-extraction.ts";
54
+ var createSystemPrompt = () => {
55
+ const template = (0, import_artifact.createTemplate)(system_prompt_default);
56
+ return template({});
57
+ };
58
+ var ReferencedQuotes = import_effect.Schema.Struct({
59
+ references: import_effect.Schema.Array(import_effect.Schema.Struct({
60
+ quote: import_effect.Schema.String,
61
+ id: import_effect.Schema.String
62
+ })).annotations({
63
+ description: "The references to the context objects that are mentioned in the transcript. quote should match the original transcript text exactly, while id is the id of the context object."
64
+ })
65
+ });
66
+ var processTranscriptMessage = async (params) => {
67
+ try {
68
+ const outputParser = (0, import_artifact.structuredOutputParser)(ReferencedQuotes);
69
+ const runParser = async () => {
70
+ const startTime = performance.now();
71
+ const result = outputParser.getResult(await new import_assistant2.MixedStreamParser().parse(await params.aiService.execStream({
72
+ model: "@anthropic/claude-3-5-haiku-20241022",
73
+ systemPrompt: createSystemPrompt(),
74
+ history: [
75
+ (0, import_echo_schema2.create)(import_artifact.Message, {
76
+ role: "user",
77
+ content: [
78
+ {
79
+ type: "text",
80
+ text: `<context>${JSON.stringify(params.context.objects)}</context>`
81
+ },
82
+ {
83
+ type: "text",
84
+ text: `<transcript>${JSON.stringify(params.message.blocks)}</transcript>`
85
+ }
86
+ ]
87
+ })
88
+ ],
89
+ tools: [
90
+ outputParser.tool
91
+ ]
92
+ })));
93
+ import_log2.log.info("entity extraction result", {
94
+ refs: result.references
95
+ }, {
96
+ F: __dxlog_file,
97
+ L: 98,
98
+ S: void 0,
99
+ C: (f, a) => f(...a)
100
+ });
101
+ return {
102
+ message: (0, import_echo_schema2.create)(import_schema2.DataType.Message, {
103
+ ...params.message,
104
+ blocks: params.message.blocks.map((block, i) => block.type !== "transcription" ? block : {
105
+ ...block,
106
+ text: postprocessText(block.text, result)
107
+ })
108
+ }),
109
+ timeElapsed: performance.now() - startTime
110
+ };
111
+ };
112
+ if (params.options?.timeout && params.options.timeout > 0) {
113
+ return await (0, import_async.asyncTimeout)(runParser(), params.options.timeout);
114
+ } else {
115
+ return await runParser();
116
+ }
117
+ } catch (error) {
118
+ if (params.options?.fallbackToRaw) {
119
+ import_log2.log.warn("failed to process transcript message, falling back to raw text", {
120
+ error
121
+ }, {
122
+ F: __dxlog_file,
123
+ L: 123,
124
+ S: void 0,
125
+ C: (f, a) => f(...a)
126
+ });
127
+ return {
128
+ message: params.message,
129
+ timeElapsed: 0
130
+ };
131
+ } else {
132
+ throw error;
133
+ }
134
+ }
135
+ };
136
+ var postprocessText = (text, quotes) => {
137
+ for (const quote of quotes.references) {
138
+ if (!import_echo_schema2.ObjectId.isValid(quote.id)) {
139
+ continue;
140
+ }
141
+ const regex = new RegExp(quote.quote.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gi");
142
+ text = text.replace(regex, `[${quote.quote}][${import_keys2.DXN.fromLocalObjectId(quote.id).toString()}]`);
143
+ }
144
+ return text;
145
+ };
146
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-transcription/src/capabilities/app-graph-builder.ts";
147
+ var getMeetingTranscript = async (context, meeting) => {
148
+ const { dispatchPromise: dispatch } = context.requestCapability(import_app_framework.Capabilities.IntentDispatcher);
149
+ const typename = (0, import_echo_schema.getSchemaTypename)(import_chunk_34WFY7M7.TranscriptType);
150
+ const existing = await meeting.artifacts[typename]?.load();
151
+ if (existing instanceof import_chunk_34WFY7M7.TranscriptType) {
152
+ return existing;
153
+ }
154
+ const space = (0, import_echo.getSpace)(meeting);
155
+ (0, import_invariant.invariant)(space, void 0, {
156
+ F: __dxlog_file2,
157
+ L: 48,
158
+ S: void 0,
159
+ A: [
160
+ "space",
161
+ ""
162
+ ]
163
+ });
164
+ const { data } = await dispatch((0, import_app_framework.createIntent)(import_chunk_34WFY7M7.TranscriptionAction.Create, {
165
+ spaceId: space.id
166
+ }));
167
+ meeting.artifacts[typename] = (0, import_echo.makeRef)(data.object);
168
+ return data?.object;
169
+ };
170
+ var app_graph_builder_default = (context) => (0, import_app_framework.contributes)(import_app_framework.Capabilities.AppGraphBuilder, [
171
+ (0, import_plugin_graph.createExtension)({
172
+ id: `${import_chunk_NVZWGFJL.TRANSCRIPTION_PLUGIN}/meeting-transcript`,
173
+ filter: (node) => (0, import_echo_schema.isInstanceOf)(import_types3.MeetingType, node.data),
174
+ actions: ({ node }) => {
175
+ const meeting = node.data;
176
+ const state = context.requestCapability(import_chunk_JUGOXWES.TranscriptionCapabilities.MeetingTranscriptionState);
177
+ return [
178
+ {
179
+ id: `${(0, import_echo.fullyQualifiedId)(meeting)}/action/start-stop-transcription`,
180
+ data: async () => {
181
+ const transcript = await getMeetingTranscript(context, meeting);
182
+ (0, import_invariant.invariant)(transcript, "Failed to create transcript", {
183
+ F: __dxlog_file2,
184
+ L: 71,
185
+ S: void 0,
186
+ A: [
187
+ "transcript",
188
+ "'Failed to create transcript'"
189
+ ]
190
+ });
191
+ const callManager = context.requestCapability(import_plugin_meeting.MeetingCapabilities.CallManager);
192
+ callManager.setActivity((0, import_echo_schema.getSchemaTypename)(import_chunk_34WFY7M7.TranscriptType), {
193
+ queueDxn: transcript.queue.dxn.toString(),
194
+ enabled: !state.enabled
195
+ });
196
+ },
197
+ properties: {
198
+ label: state.enabled ? [
199
+ "stop transcription label",
200
+ {
201
+ ns: import_chunk_NVZWGFJL.TRANSCRIPTION_PLUGIN
202
+ }
203
+ ] : [
204
+ "start transcription label",
205
+ {
206
+ ns: import_chunk_NVZWGFJL.TRANSCRIPTION_PLUGIN
207
+ }
208
+ ],
209
+ icon: "ph--subtitles--regular",
210
+ disposition: "toolbar",
211
+ classNames: state.enabled ? "bg-callAlert" : ""
212
+ }
213
+ }
214
+ ];
215
+ },
216
+ connector: ({ node }) => {
217
+ const meeting = node.data;
218
+ const client = context.requestCapability(import_plugin_client.ClientCapabilities.Client);
219
+ const state = context.requestCapability(import_chunk_JUGOXWES.TranscriptionCapabilities.MeetingTranscriptionState);
220
+ const settings = context.requestCapability(import_app_framework.Capabilities.SettingsStore).getStore(import_chunk_NVZWGFJL.TRANSCRIPTION_PLUGIN).value;
221
+ const aiClient = new import_assistant.AIServiceEdgeClient({
222
+ endpoint: import_testing.AI_SERVICE_ENDPOINT.REMOTE
223
+ });
224
+ return [
225
+ {
226
+ id: `${(0, import_echo.fullyQualifiedId)(meeting)}${import_types.ATTENDABLE_PATH_SEPARATOR}${(0, import_echo_schema.getSchemaTypename)(import_chunk_34WFY7M7.TranscriptType)}`,
227
+ type: import_types.PLANK_COMPANION_TYPE,
228
+ data: meeting.artifacts[(0, import_echo_schema.getSchemaTypename)(import_chunk_34WFY7M7.TranscriptType)]?.target,
229
+ properties: {
230
+ label: [
231
+ "transcript companion label",
232
+ {
233
+ ns: import_chunk_NVZWGFJL.TRANSCRIPTION_PLUGIN
234
+ }
235
+ ],
236
+ icon: "ph--subtitles--regular",
237
+ position: "hoist",
238
+ disposition: "hidden",
239
+ schema: import_chunk_34WFY7M7.TranscriptType,
240
+ getIntent: ({ space }) => (0, import_app_framework.createIntent)(import_chunk_34WFY7M7.TranscriptionAction.Create, {
241
+ spaceId: space.id
242
+ }),
243
+ // TODO(burdon): Is this the right place to inisitalize the state? Change to a capability?
244
+ onJoin: async ({ meeting: meeting2 }) => {
245
+ const identity = client.halo.identity.get();
246
+ (0, import_invariant.invariant)(identity, void 0, {
247
+ F: __dxlog_file2,
248
+ L: 120,
249
+ S: void 0,
250
+ A: [
251
+ "identity",
252
+ ""
253
+ ]
254
+ });
255
+ const space = (0, import_echo.getSpace)(meeting2);
256
+ (0, import_invariant.invariant)(space, void 0, {
257
+ F: __dxlog_file2,
258
+ L: 122,
259
+ S: void 0,
260
+ A: [
261
+ "space",
262
+ ""
263
+ ]
264
+ });
265
+ let messageEnricher;
266
+ if (aiClient && settings.entityExtraction) {
267
+ messageEnricher = createEntityExtractionEnricher({
268
+ aiClient,
269
+ // TODO(dmaretskyi): Have those be discovered from the schema graph or contributed by capabilities?
270
+ // This forced me to add a dependency on markdown plugin.
271
+ // This will be replaced with a vector search index anyway, so its not a big deal.
272
+ contextTypes: [
273
+ import_types2.DocumentType,
274
+ import_schema.DataType.Person,
275
+ import_schema.DataType.Organization
276
+ ],
277
+ space
278
+ });
279
+ }
280
+ state.transcriptionManager = await new import_chunk_RK4BEN5E.TranscriptionManager({
281
+ edgeClient: client.edge,
282
+ messageEnricher
283
+ }).setIdentityDid(identity.did).open();
284
+ },
285
+ onLeave: async () => {
286
+ await state.transcriptionManager?.close();
287
+ state.transcriptionManager = void 0;
288
+ state.enabled = false;
289
+ },
290
+ onCallStateUpdated: async (callState) => {
291
+ const typename = (0, import_echo_schema.getSchemaTypename)(import_chunk_34WFY7M7.TranscriptType);
292
+ const transcription = typename ? callState.activities?.[typename] : void 0;
293
+ if (!transcription?.payload) {
294
+ return;
295
+ }
296
+ const payload = transcription.payload;
297
+ state.enabled = !!payload.enabled;
298
+ if (payload.queueDxn) {
299
+ state.transcriptionManager?.setQueue(import_keys.DXN.parse(payload.queueDxn));
300
+ }
301
+ await state.transcriptionManager?.setEnabled(payload.enabled);
302
+ },
303
+ onMediaStateUpdated: async ([mediaState, isSpeaking]) => {
304
+ void state.transcriptionManager?.setAudioTrack(mediaState.audioTrack);
305
+ void state.transcriptionManager?.setRecording(isSpeaking);
306
+ }
307
+ }
308
+ }
309
+ ];
310
+ }
311
+ })
312
+ ]);
313
+ var createEntityExtractionEnricher = ({ aiClient, contextTypes, space }) => {
314
+ return async (message) => {
315
+ const { objects } = await space.db.query(import_echo.Filter.or(...contextTypes.map((s) => import_echo.Filter.schema(s)))).run();
316
+ import_log.log.info("context", {
317
+ objects
318
+ }, {
319
+ F: __dxlog_file2,
320
+ L: 184,
321
+ S: void 0,
322
+ C: (f, a) => f(...a)
323
+ });
324
+ const { message: enhancedMessage, timeElapsed } = await processTranscriptMessage({
325
+ aiService: aiClient,
326
+ message,
327
+ context: {
328
+ objects: await Promise.all(objects.map(processContextObject))
329
+ },
330
+ options: {
331
+ timeout: ENTITY_EXTRACTOR_TIMEOUT,
332
+ fallbackToRaw: true
333
+ }
334
+ });
335
+ import_log.log.info("entity extraction time", {
336
+ timeElapsed
337
+ }, {
338
+ F: __dxlog_file2,
339
+ L: 193,
340
+ S: void 0,
341
+ C: (f, a) => f(...a)
342
+ });
343
+ return enhancedMessage;
344
+ };
345
+ };
346
+ var processContextObject = async (object) => {
347
+ return object;
348
+ };
349
+ var ENTITY_EXTRACTOR_TIMEOUT = 25e3;
350
+ //# sourceMappingURL=app-graph-builder-I6LYVIYY.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/app-graph-builder.ts", "../../../src/entity-extraction/entity-extraction.ts", "raw-loader:./system-prompt.tpl?raw"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport type { Schema } from 'effect';\n\nimport { Capabilities, contributes, createIntent, type PluginsContext } from '@dxos/app-framework';\nimport { AIServiceEdgeClient, type AIServiceClient } from '@dxos/assistant';\nimport { AI_SERVICE_ENDPOINT } from '@dxos/assistant/testing';\nimport { Filter, fullyQualifiedId, getSpace, makeRef, type Space } from '@dxos/client/echo';\nimport { getSchemaTypename, isInstanceOf, type BaseEchoObject } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { MeetingCapabilities, type CallState, type MediaState } from '@dxos/plugin-meeting';\nimport { MeetingType, type MeetingCallProperties } from '@dxos/plugin-meeting/types';\nimport { type buf } from '@dxos/protocols/buf';\nimport { type TranscriptionPayloadSchema } from '@dxos/protocols/buf/dxos/edge/calls_pb';\nimport { DataType } from '@dxos/schema';\n\nimport { TranscriptionCapabilities } from './capabilities';\nimport { processTranscriptMessage } from '../entity-extraction';\nimport { TRANSCRIPTION_PLUGIN } from '../meta';\nimport { TranscriptionManager } from '../transcriber';\nimport { TranscriptionAction, type TranscriptionSettingsProps, TranscriptType } from '../types';\n\n// TODO(wittjosiah): Factor out.\n// TODO(wittjosiah): Can we stop using protobuf for this?\ntype TranscriptionPayload = buf.MessageInitShape<typeof TranscriptionPayloadSchema>;\n\nconst getMeetingTranscript = async (\n context: PluginsContext,\n meeting: MeetingType,\n): Promise<TranscriptType | undefined> => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n\n const typename = getSchemaTypename(TranscriptType)!;\n const existing = await meeting.artifacts[typename]?.load();\n if (existing instanceof TranscriptType) {\n return existing;\n }\n\n const space = getSpace(meeting);\n invariant(space);\n const { data } = await dispatch(createIntent(TranscriptionAction.Create, { spaceId: space.id }));\n meeting.artifacts[typename] = makeRef(data!.object);\n return data?.object;\n};\n\n// TODO(wittjosiah): Introduce a sound that plays when transcription is activated/deactivated.\nexport default (context: PluginsContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${TRANSCRIPTION_PLUGIN}/meeting-transcript`,\n filter: (node): node is Node<MeetingType> => isInstanceOf(MeetingType, node.data),\n actions: ({ node }) => {\n const meeting = node.data;\n const state = context.requestCapability(TranscriptionCapabilities.MeetingTranscriptionState);\n return [\n {\n id: `${fullyQualifiedId(meeting)}/action/start-stop-transcription`,\n data: async () => {\n // NOTE: We are not saving the state of the transcription manager here.\n // We expect the state to be updated through `onCallStateUpdated` once it is propagated through Swarm.\n // This is done to avoid race conditions and to not handle optimistic updates.\n const transcript = await getMeetingTranscript(context, meeting);\n invariant(transcript, 'Failed to create transcript');\n\n const callManager = context.requestCapability(MeetingCapabilities.CallManager);\n callManager.setActivity(getSchemaTypename(TranscriptType)!, {\n queueDxn: transcript.queue.dxn.toString(),\n enabled: !state.enabled,\n });\n },\n properties: {\n label: state.enabled\n ? ['stop transcription label', { ns: TRANSCRIPTION_PLUGIN }]\n : ['start transcription label', { ns: TRANSCRIPTION_PLUGIN }],\n icon: 'ph--subtitles--regular',\n disposition: 'toolbar',\n classNames: state.enabled ? 'bg-callAlert' : '',\n },\n },\n ];\n },\n connector: ({ node }) => {\n const meeting = node.data;\n const client = context.requestCapability(ClientCapabilities.Client);\n const state = context.requestCapability(TranscriptionCapabilities.MeetingTranscriptionState);\n const settings = context\n .requestCapability(Capabilities.SettingsStore)\n .getStore<TranscriptionSettingsProps>(TRANSCRIPTION_PLUGIN)!.value;\n\n // TODO(dmaretskyi): Request via capability.\n const aiClient: AIServiceClient | undefined = new AIServiceEdgeClient({\n endpoint: AI_SERVICE_ENDPOINT.REMOTE,\n });\n\n return [\n {\n id: `${fullyQualifiedId(meeting)}${ATTENDABLE_PATH_SEPARATOR}${getSchemaTypename(TranscriptType)}`,\n type: PLANK_COMPANION_TYPE,\n data: meeting.artifacts[getSchemaTypename(TranscriptType)!]?.target,\n properties: {\n label: ['transcript companion label', { ns: TRANSCRIPTION_PLUGIN }],\n icon: 'ph--subtitles--regular',\n position: 'hoist',\n disposition: 'hidden',\n schema: TranscriptType,\n getIntent: ({ space }: { space: Space }) =>\n createIntent(TranscriptionAction.Create, { spaceId: space.id }),\n\n // TODO(burdon): Is this the right place to inisitalize the state? Change to a capability?\n onJoin: async ({ meeting }: { meeting: MeetingType; roomId: string }) => {\n const identity = client.halo.identity.get();\n invariant(identity);\n const space = getSpace(meeting);\n invariant(space);\n\n let messageEnricher;\n if (aiClient && settings.entityExtraction) {\n messageEnricher = createEntityExtractionEnricher({\n aiClient,\n // TODO(dmaretskyi): Have those be discovered from the schema graph or contributed by capabilities?\n // This forced me to add a dependency on markdown plugin.\n // This will be replaced with a vector search index anyway, so its not a big deal.\n contextTypes: [DocumentType, DataType.Person, DataType.Organization],\n space,\n });\n }\n\n // TODO(burdon): The TranscriptionManager singleton is part of the state and should just be updated here.\n state.transcriptionManager = await new TranscriptionManager({\n edgeClient: client.edge,\n messageEnricher,\n })\n .setIdentityDid(identity.did)\n .open();\n },\n onLeave: async () => {\n await state.transcriptionManager?.close();\n state.transcriptionManager = undefined;\n state.enabled = false;\n },\n onCallStateUpdated: async (callState: CallState) => {\n const typename = getSchemaTypename(TranscriptType);\n const transcription = typename ? callState.activities?.[typename] : undefined;\n if (!transcription?.payload) {\n return;\n }\n\n const payload: TranscriptionPayload = transcription.payload;\n state.enabled = !!payload.enabled;\n if (payload.queueDxn) {\n // NOTE: Must set queue before enabling transcription.\n state.transcriptionManager?.setQueue(DXN.parse(payload.queueDxn));\n }\n await state.transcriptionManager?.setEnabled(payload.enabled);\n },\n onMediaStateUpdated: async ([mediaState, isSpeaking]: [MediaState, boolean]) => {\n void state.transcriptionManager?.setAudioTrack(mediaState.audioTrack);\n void state.transcriptionManager?.setRecording(isSpeaking);\n },\n } satisfies MeetingCallProperties,\n },\n ];\n },\n }),\n ]);\n\ntype EntityExtractionEnricherFactoryOptions = {\n aiClient: AIServiceClient;\n contextTypes: Schema.Schema.AnyNoContext[];\n space: Space;\n};\n\nconst createEntityExtractionEnricher = ({ aiClient, contextTypes, space }: EntityExtractionEnricherFactoryOptions) => {\n return async (message: DataType.Message) => {\n const { objects } = await space.db.query(Filter.or(...contextTypes.map((s) => Filter.schema(s)))).run();\n log.info('context', { objects });\n\n const { message: enhancedMessage, timeElapsed } = await processTranscriptMessage({\n aiService: aiClient,\n message,\n context: { objects: await Promise.all(objects.map(processContextObject)) },\n options: { timeout: ENTITY_EXTRACTOR_TIMEOUT, fallbackToRaw: true },\n });\n\n log.info('entity extraction time', { timeElapsed });\n return enhancedMessage;\n };\n};\n\nconst processContextObject = async (object: BaseEchoObject): Promise<any> => {\n // TODO(dmaretskyi): Documents need special processing is the content is behind a ref.\n // TODO(dmaretskyi): Think about a way to handle this serialization with a decorator.\n // if (isInstanceOf(DocumentType, object)) {\n // return {\n // ...object,\n // content: await object.content.load(),\n // };\n // }\n\n return object;\n};\n\nconst ENTITY_EXTRACTOR_TIMEOUT = 25_000;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { createTemplate, Message, structuredOutputParser } from '@dxos/artifact';\nimport type { AIServiceClient } from '@dxos/assistant';\nimport { MixedStreamParser } from '@dxos/assistant';\nimport { asyncTimeout } from '@dxos/async';\nimport { type BaseEchoObject, create, ObjectId } from '@dxos/echo-schema';\nimport { DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { DataType } from '@dxos/schema';\n\nimport SYSTEM_PROMPT from './system-prompt.tpl?raw';\n\ntype ProcessTranscriptMessageParams = {\n message: DataType.Message;\n aiService: AIServiceClient;\n context: {\n objects?: BaseEchoObject[];\n };\n\n options?: {\n /**\n * Timeout for the entity extraction.\n */\n timeout?: number;\n\n /**\n * Fallback to raw text if the entity extraction fails.\n * Otherwise the function will throw an error.\n * @default false\n */\n fallbackToRaw?: boolean;\n };\n};\n\ntype ProcessTranscriptMessageResult = {\n message: DataType.Message;\n timeElapsed: number;\n};\n\n/**\n * Process Handlebars template.\n */\nconst createSystemPrompt = (): string => {\n const template = createTemplate(SYSTEM_PROMPT);\n return template({});\n};\n\nconst ReferencedQuotes = Schema.Struct({\n references: Schema.Array(\n Schema.Struct({\n quote: Schema.String,\n id: Schema.String,\n }),\n ).annotations({\n description:\n 'The references to the context objects that are mentioned in the transcript. quote should match the original transcript text exactly, while id is the id of the context object.',\n }),\n});\ninterface ReferencedQuotes extends Schema.Schema.Type<typeof ReferencedQuotes> {}\n\n// TODO(dmaretskyi): Move context to a vector search index.\nexport const processTranscriptMessage = async (\n params: ProcessTranscriptMessageParams,\n): Promise<ProcessTranscriptMessageResult> => {\n try {\n const outputParser = structuredOutputParser(ReferencedQuotes);\n const runParser = async (): Promise<ProcessTranscriptMessageResult> => {\n const startTime = performance.now();\n const result = outputParser.getResult(\n await new MixedStreamParser().parse(\n await params.aiService.execStream({\n model: '@anthropic/claude-3-5-haiku-20241022',\n systemPrompt: createSystemPrompt(),\n history: [\n create(Message, {\n role: 'user',\n content: [\n {\n type: 'text',\n text: `<context>${JSON.stringify(params.context.objects)}</context>`,\n },\n {\n type: 'text',\n text: `<transcript>${JSON.stringify(params.message.blocks)}</transcript>`,\n },\n ],\n }),\n ],\n tools: [outputParser.tool],\n }),\n ),\n );\n log.info('entity extraction result', { refs: result.references });\n\n return {\n message: create(DataType.Message, {\n ...params.message,\n blocks: params.message.blocks.map((block, i) =>\n block.type !== 'transcription'\n ? block\n : {\n ...block,\n text: postprocessText(block.text, result),\n },\n ),\n }),\n timeElapsed: performance.now() - startTime,\n };\n };\n\n if (params.options?.timeout && params.options.timeout > 0) {\n return await asyncTimeout(runParser(), params.options.timeout);\n } else {\n return await runParser();\n }\n } catch (error) {\n if (params.options?.fallbackToRaw) {\n log.warn('failed to process transcript message, falling back to raw text', { error });\n return {\n message: params.message,\n timeElapsed: 0,\n };\n } else {\n throw error;\n }\n }\n};\n\n/**\n * Finds and replaces all quotes with DXNs references.\n */\n// TODO(dmaretskyi): Lookup and verifiy ids from provided context.\nexport const postprocessText = (text: string, quotes: ReferencedQuotes) => {\n for (const quote of quotes.references) {\n if (!ObjectId.isValid(quote.id)) {\n continue;\n }\n\n // Use a case-insensitive regular expression to replace the quote\n const regex = new RegExp(quote.quote.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'gi');\n text = text.replace(regex, `[${quote.quote}][${DXN.fromLocalObjectId(quote.id).toString()}]`);\n }\n return text;\n};\n", "You are an AI assistant specialized in processing and enhancing transcripts with contextual information.\nYour task is to analyze a given transcript and extract references to the context objects.\n\nThe context and transcript are provided in the user message in `context` and `transcript` XML tags.\n\nHere are your instructions:\n\n1. Read the transcript and context information provided above.\n\n2. Process each segment of the transcript separately.\n\n3. For each segment:\n a. Analyze the content and identify relevant information from the context.\n b. Extract a number of references to the context objects that are mentioned in the segment.\n c. Output the references in the format `{ \"quote\": \"earnings report\", \"id\": \"01JT0JP9AX0XKGZX4MV4B69VT6\" }`.\n d. If there are no references, just output an empty array.\n\n4. Maintain the exact order and structure of the original transcript segments.\n\nOutput Format:\nThe final output should be a JSON array of references.\n\nExample output structure:\n```json\n{\n \"references\": [\n { \"quote\": \"earnings report\", \"id\": \"01JT0JP9AX0XKGZX4MV4B69VT6\" },\n { \"quote\": \"John\", \"id\": \"01JT0VM0VN3ZKN7GDBM8CV9BA7\" }\n ]\n}\n```\n\nRemember:\n- Only quote the text that is in the transcript.\n- Analyze each segment carefully before processing it.\n- Only reference objects that appear in the context and exactly by their id, If the object is not in the context, do not insert a reference. \n\nNow, process the transcript and context provided below according to these instructions."],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,2BAA6E;AAC7E,uBAA0D;AAC1D,qBAAoC;AACpC,kBAAwE;AACxE,yBAAqE;AACrE,uBAA0B;AAC1B,kBAAoB;AACpB,iBAAoB;AACpB,2BAAmC;AACnC,mBAAgE;AAChE,0BAA2C;AAC3C,IAAAA,gBAA6B;AAC7B,4BAAqE;AACrE,IAAAA,gBAAwD;AAGxD,oBAAyB;AClBzB,oBAAuB;AAEvB,sBAAgE;AAEhE,IAAAC,oBAAkC;AAClC,mBAA6B;AAC7B,IAAAC,sBAAsD;AACtD,IAAAC,eAAoB;AACpB,IAAAC,cAAoB;AACpB,IAAAC,iBAAyB;ACbzB,IAAA,wBAAA;;AD+CA,I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,uBAAuB,OAAO3F,WAAAA;AAUlC,SAAOA;AACT;AAEA,IAAM4F,2BAA2B;",
6
+ "names": ["import_types", "import_assistant", "import_echo_schema", "import_keys", "import_log", "import_schema", "createSystemPrompt", "template", "createTemplate", "SYSTEM_PROMPT", "ReferencedQuotes", "Schema", "Struct", "references", "Array", "quote", "String", "id", "annotations", "description", "processTranscriptMessage", "params", "outputParser", "structuredOutputParser", "runParser", "startTime", "performance", "now", "result", "getResult", "MixedStreamParser", "parse", "aiService", "execStream", "model", "systemPrompt", "history", "create", "Message", "role", "content", "type", "text", "JSON", "stringify", "context", "objects", "message", "blocks", "tools", "tool", "log", "info", "refs", "DataType", "map", "block", "i", "postprocessText", "timeElapsed", "options", "timeout", "asyncTimeout", "error", "fallbackToRaw", "warn", "quotes", "ObjectId", "isValid", "regex", "RegExp", "replace", "DXN", "fromLocalObjectId", "toString", "getMeetingTranscript", "meeting", "dispatchPromise", "dispatch", "requestCapability", "Capabilities", "IntentDispatcher", "typename", "getSchemaTypename", "TranscriptType", "existing", "artifacts", "load", "space", "getSpace", "invariant", "data", "createIntent", "TranscriptionAction", "Create", "spaceId", "makeRef", "object", "contributes", "AppGraphBuilder", "createExtension", "TRANSCRIPTION_PLUGIN", "filter", "node", "isInstanceOf", "MeetingType", "actions", "state", "TranscriptionCapabilities", "MeetingTranscriptionState", "fullyQualifiedId", "transcript", "callManager", "MeetingCapabilities", "CallManager", "setActivity", "queueDxn", "queue", "dxn", "enabled", "properties", "label", "ns", "icon", "disposition", "classNames", "connector", "client", "ClientCapabilities", "Client", "settings", "SettingsStore", "getStore", "value", "aiClient", "AIServiceEdgeClient", "endpoint", "AI_SERVICE_ENDPOINT", "REMOTE", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "target", "position", "schema", "getIntent", "onJoin", "identity", "halo", "get", "messageEnricher", "entityExtraction", "createEntityExtractionEnricher", "contextTypes", "DocumentType", "Person", "Organization", "transcriptionManager", "TranscriptionManager", "edgeClient", "edge", "setIdentityDid", "did", "open", "onLeave", "close", "undefined", "onCallStateUpdated", "callState", "transcription", "activities", "payload", "setQueue", "setEnabled", "onMediaStateUpdated", "mediaState", "isSpeaking", "setAudioTrack", "audioTrack", "setRecording", "db", "query", "Filter", "or", "s", "run", "enhancedMessage", "Promise", "all", "processContextObject", "ENTITY_EXTRACTOR_TIMEOUT"]
7
+ }
@@ -16,25 +16,27 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_3QEJ5EBO_exports = {};
20
- __export(chunk_3QEJ5EBO_exports, {
19
+ var chunk_34WFY7M7_exports = {};
20
+ __export(chunk_34WFY7M7_exports, {
21
21
  TRANSCRIPTION_URL: () => TRANSCRIPTION_URL,
22
- TranscriptBlock: () => TranscriptBlock,
23
22
  TranscriptSchema: () => TranscriptSchema,
24
23
  TranscriptType: () => TranscriptType,
25
24
  TranscriptionAction: () => TranscriptionAction,
25
+ TranscriptionSettingsSchema: () => TranscriptionSettingsSchema,
26
26
  isTranscript: () => isTranscript
27
27
  });
28
- module.exports = __toCommonJS(chunk_3QEJ5EBO_exports);
28
+ module.exports = __toCommonJS(chunk_34WFY7M7_exports);
29
29
  var import_chunk_NVZWGFJL = require("./chunk-NVZWGFJL.cjs");
30
+ var import_effect = require("effect");
30
31
  var import_echo_schema = require("@dxos/echo-schema");
32
+ var import_effect2 = require("effect");
31
33
  var import_echo_schema2 = require("@dxos/echo-schema");
32
34
  var import_echo = require("@dxos/react-client/echo");
33
- var TranscriptSchema = import_echo_schema.S.Struct({
34
- name: import_echo_schema.S.String,
35
+ var TranscriptSchema = import_effect.Schema.Struct({
36
+ name: import_effect.Schema.String,
35
37
  // TODO(burdon): Use Date or string?
36
- started: import_echo_schema.S.optional(import_echo_schema.S.String),
37
- ended: import_echo_schema.S.optional(import_echo_schema.S.String),
38
+ started: import_effect.Schema.optional(import_effect.Schema.String),
39
+ ended: import_effect.Schema.optional(import_effect.Schema.String),
38
40
  /**
39
41
  * Queue containing TranscriptBlock objects.
40
42
  */
@@ -46,34 +48,19 @@ var TranscriptType = class extends (0, import_echo_schema.TypedObject)({
46
48
  version: "0.1.0"
47
49
  })(TranscriptSchema.fields) {
48
50
  };
49
- var TranscriptHeader = import_echo_schema.S.Struct({
50
- started: import_echo_schema.S.optional(import_echo_schema.S.String)
51
+ var TranscriptHeader = import_effect.Schema.Struct({
52
+ started: import_effect.Schema.optional(import_effect.Schema.String)
51
53
  });
52
- var TranscriptSegment = import_echo_schema.S.Struct({
53
- // TODO(burdon): TS from service is not Unix TS (x1000).
54
- started: import_echo_schema.S.String,
55
- text: import_echo_schema.S.String
56
- });
57
- var TranscriptBlock = import_echo_schema.S.Struct({
58
- id: import_echo_schema.S.String,
59
- authorName: import_echo_schema.S.optional(import_echo_schema.S.String),
60
- authorHue: import_echo_schema.S.optional(import_echo_schema.S.String),
61
- segments: import_echo_schema.S.Array(TranscriptSegment)
62
- }).pipe((0, import_echo_schema.EchoObject)({
63
- typename: "dxos.org/type/TranscriptBlock",
64
- version: "0.1.0"
65
- }));
66
54
  var TRANSCRIPTION_URL = "https://calls-service.dxos.workers.dev";
67
55
  var TranscriptionAction;
68
56
  (function(TranscriptionAction2) {
69
57
  const TRANSCRIPTION_ACTION = `${import_chunk_NVZWGFJL.TRANSCRIPTION_PLUGIN}/action`;
70
- class Create extends import_echo_schema2.S.TaggedClass()(`${TRANSCRIPTION_ACTION}/create`, {
71
- input: import_echo_schema2.S.Struct({
72
- name: import_echo_schema2.S.optional(import_echo_schema2.S.String),
73
- // TODO(wittjosiah): SpaceId.
74
- spaceId: import_echo_schema2.S.String
58
+ class Create extends import_effect2.Schema.TaggedClass()(`${TRANSCRIPTION_ACTION}/create`, {
59
+ input: import_effect2.Schema.Struct({
60
+ name: import_effect2.Schema.optional(import_effect2.Schema.String),
61
+ spaceId: import_echo_schema2.SpaceIdSchema
75
62
  }),
76
- output: import_echo_schema2.S.Struct({
63
+ output: import_effect2.Schema.Struct({
77
64
  object: TranscriptType
78
65
  })
79
66
  }) {
@@ -83,13 +70,16 @@ var TranscriptionAction;
83
70
  var isTranscript = (object) => {
84
71
  return (0, import_echo.isLiveObject)(object) && (0, import_echo_schema2.isInstanceOf)(TranscriptType, object);
85
72
  };
73
+ var TranscriptionSettingsSchema = import_effect2.Schema.mutable(import_effect2.Schema.Struct({
74
+ entityExtraction: import_effect2.Schema.optional(import_effect2.Schema.Boolean).pipe(import_effect2.Schema.withConstructorDefault(() => true))
75
+ }));
86
76
  // Annotate the CommonJS export names for ESM import in node:
87
77
  0 && (module.exports = {
88
78
  TRANSCRIPTION_URL,
89
- TranscriptBlock,
90
79
  TranscriptSchema,
91
80
  TranscriptType,
92
81
  TranscriptionAction,
82
+ TranscriptionSettingsSchema,
93
83
  isTranscript
94
84
  });
95
- //# sourceMappingURL=chunk-3QEJ5EBO.cjs.map
85
+ //# sourceMappingURL=chunk-34WFY7M7.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Expando, Ref, TypedObject } from '@dxos/echo-schema';\n\n/**\n * Root transcript object created when the user starts a transcription.\n */\nexport const TranscriptSchema = Schema.Struct({\n name: Schema.String,\n\n // TODO(burdon): Use Date or string?\n started: Schema.optional(Schema.String),\n ended: Schema.optional(Schema.String),\n\n /**\n * Queue containing TranscriptBlock objects.\n */\n // TODO(wittjosiah): Should be a ref to a queue.\n queue: Ref(Expando),\n});\n\nexport class TranscriptType extends TypedObject({\n typename: 'dxos.org/type/Transcript',\n version: '0.1.0',\n})(TranscriptSchema.fields) {}\n\n// TODO(burdon): Do these need to be kept in sync with EDGE?\n\n/**\n * First message in queue.\n * Contains metadata for the recording and transcript.\n */\nconst TranscriptHeader = Schema.Struct({\n started: Schema.optional(Schema.String),\n});\n\nexport type TranscriptHeader = Schema.Schema.Type<typeof TranscriptHeader>;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { SpaceIdSchema, isInstanceOf } from '@dxos/echo-schema';\nimport { isLiveObject } from '@dxos/react-client/echo';\n\nimport { TranscriptType } from './schema';\nimport { TRANSCRIPTION_PLUGIN } from '../meta';\n\n// TODO(burdon): Move to separate proto.\n\n/**\n * Endpoint to the calls service.\n */\n// TODO(burdon): Reconfigure/move.\nexport const TRANSCRIPTION_URL = 'https://calls-service.dxos.workers.dev';\n\nexport namespace TranscriptionAction {\n const TRANSCRIPTION_ACTION = `${TRANSCRIPTION_PLUGIN}/action`;\n\n export class Create extends Schema.TaggedClass<Create>()(`${TRANSCRIPTION_ACTION}/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n spaceId: SpaceIdSchema,\n }),\n output: Schema.Struct({\n object: TranscriptType,\n }),\n }) {}\n}\n\nexport const isTranscript = (object: unknown): object is typeof TranscriptType => {\n return isLiveObject(object) && isInstanceOf(TranscriptType, object);\n};\n\n// TODO(burdon): Create with decode consistently: Schema.decodeSync(TranscriptionSettingsSchema)({}))\nexport const TranscriptionSettingsSchema = Schema.mutable(\n Schema.Struct({\n entityExtraction: Schema.optional(Schema.Boolean).pipe(Schema.withConstructorDefault(() => true)),\n }),\n);\n\nexport type TranscriptionSettingsProps = Schema.Schema.Type<typeof TranscriptionSettingsSchema>;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,oBAAuB;AAEvB,yBAA0C;ACF1C,IAAAA,iBAAuB;AAEvB,IAAAC,sBAA4C;AAC5C,kBAA6B;ADItB,IAAMC,mBAAmBC,qBAAOC,OAAO;EAC5CC,MAAMF,qBAAOG;;EAGbC,SAASJ,qBAAOK,SAASL,qBAAOG,MAAM;EACtCG,OAAON,qBAAOK,SAASL,qBAAOG,MAAM;;;;;EAMpCI,WAAOC,wBAAIC,0BAAAA;AACb,CAAA;AAEO,IAAMC,iBAAN,kBAA6BC,gCAAY;EAC9CC,UAAU;EACVC,SAAS;AACX,CAAA,EAAGd,iBAAiBe,MAAM,EAAA;AAAG;AAQ7B,IAAMC,mBAAmBf,qBAAOC,OAAO;EACrCG,SAASJ,qBAAOK,SAASL,qBAAOG,MAAM;AACxC,CAAA;ACpBO,IAAMa,oBAAoB;;UAEhBC,sBAAAA;AACf,QAAMC,uBAAuB,GAAGC,0CAAAA;EAEzB,MAAMC,eAAepB,eAAAA,OAAOqB,YAAW,EAAW,GAAGH,oBAAAA,WAA+B;IACzFI,OAAOtB,eAAAA,OAAOC,OAAO;MACnBC,MAAMF,eAAAA,OAAOK,SAASL,eAAAA,OAAOG,MAAM;MACnCoB,SAASC;IACX,CAAA;IACAC,QAAQzB,eAAAA,OAAOC,OAAO;MACpByB,QAAQhB;IACV,CAAA;EACF,CAAA,EAAA;EAAI;uBARSU,SAAAA;AASf,GAZiBH,wBAAAA,sBAAAA,CAAAA,EAAAA;AAcV,IAAMU,eAAe,CAACD,WAAAA;AAC3B,aAAOE,0BAAaF,MAAAA,SAAWG,kCAAanB,gBAAgBgB,MAAAA;AAC9D;AAGO,IAAMI,8BAA8B9B,eAAAA,OAAO+B,QAChD/B,eAAAA,OAAOC,OAAO;EACZ+B,kBAAkBhC,eAAAA,OAAOK,SAASL,eAAAA,OAAOiC,OAAO,EAAEC,KAAKlC,eAAAA,OAAOmC,uBAAuB,MAAM,IAAA,CAAA;AAC7F,CAAA,CAAA;",
6
+ "names": ["import_effect", "import_echo_schema", "TranscriptSchema", "Schema", "Struct", "name", "String", "started", "optional", "ended", "queue", "Ref", "Expando", "TranscriptType", "TypedObject", "typename", "version", "fields", "TranscriptHeader", "TRANSCRIPTION_URL", "TranscriptionAction", "TRANSCRIPTION_ACTION", "TRANSCRIPTION_PLUGIN", "Create", "TaggedClass", "input", "spaceId", "SpaceIdSchema", "output", "object", "isTranscript", "isLiveObject", "isInstanceOf", "TranscriptionSettingsSchema", "mutable", "entityExtraction", "Boolean", "pipe", "withConstructorDefault"]
7
+ }