@dxos/plugin-transcription 0.8.4-main.5ea62a8 → 0.8.4-main.72ec0f3
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.
- package/dist/lib/browser/TranscriptContainer-EKSP5DQ6.mjs +11 -0
- package/dist/lib/browser/{blueprint-definition-QQSGTX5F.mjs → blueprint-definition-WBWHO4OH.mjs} +24 -16
- package/dist/lib/browser/blueprint-definition-WBWHO4OH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TNEQFHIU.mjs → chunk-3MKZ2MNQ.mjs} +5 -5
- package/dist/lib/browser/chunk-3MKZ2MNQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5I4BMOGE.mjs → chunk-EHT3TE6U.mjs} +129 -174
- package/dist/lib/browser/chunk-EHT3TE6U.mjs.map +7 -0
- package/dist/lib/browser/{chunk-26XDG6GQ.mjs → chunk-OCI42DWB.mjs} +2 -2
- package/dist/lib/browser/{chunk-BA64VLLR.mjs → chunk-PVU4XCKI.mjs} +46 -66
- package/dist/lib/browser/chunk-PVU4XCKI.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3X7HP44M.mjs → chunk-VBUIO677.mjs} +8 -5
- package/dist/lib/browser/chunk-VBUIO677.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HXVGV7T6.mjs → chunk-W7WKZTM4.mjs} +4 -4
- package/dist/lib/browser/chunk-W7WKZTM4.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +13 -14
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-T3EGLS3L.mjs → intent-resolver-ZTKTEAQX.mjs} +5 -5
- package/dist/lib/browser/{intent-resolver-T3EGLS3L.mjs.map → intent-resolver-ZTKTEAQX.mjs.map} +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-QYX74JNG.mjs → react-surface-NARMYO2O.mjs} +8 -8
- package/dist/lib/browser/{react-surface-QYX74JNG.mjs.map → react-surface-NARMYO2O.mjs.map} +1 -1
- package/dist/lib/browser/{transcriber-JOOAQVYV.mjs → transcriber-E2KAOXPS.mjs} +7 -7
- package/dist/lib/browser/{transcriber-JOOAQVYV.mjs.map → transcriber-E2KAOXPS.mjs.map} +1 -1
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{TranscriptContainer-BUWK63SI.mjs → TranscriptContainer-WU3EDQR3.mjs} +4 -4
- package/dist/lib/node-esm/{blueprint-definition-4PLCTH5Q.mjs → blueprint-definition-WUHZFRWZ.mjs} +24 -16
- package/dist/lib/node-esm/blueprint-definition-WUHZFRWZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DT3AOC3E.mjs → chunk-7XASA7DX.mjs} +129 -174
- package/dist/lib/node-esm/chunk-7XASA7DX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-W72HVQMD.mjs → chunk-OLMSTF3M.mjs} +4 -4
- package/dist/lib/node-esm/chunk-OLMSTF3M.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3QAIZGMW.mjs → chunk-SWUVPFKR.mjs} +5 -5
- package/dist/lib/node-esm/chunk-SWUVPFKR.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-J5GQ3KGX.mjs → chunk-UVOYXXDJ.mjs} +46 -66
- package/dist/lib/node-esm/chunk-UVOYXXDJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-NWD757KH.mjs → chunk-X5BKN32O.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-QARUDLHN.mjs → chunk-YVNQN2J6.mjs} +8 -5
- package/dist/lib/node-esm/chunk-YVNQN2J6.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +13 -14
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-VDHCUAIO.mjs → intent-resolver-55WH2GY6.mjs} +5 -5
- package/dist/lib/node-esm/{intent-resolver-VDHCUAIO.mjs.map → intent-resolver-55WH2GY6.mjs.map} +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-TM7XOQBR.mjs → react-surface-5MQA3IUS.mjs} +8 -8
- package/dist/lib/node-esm/{react-surface-TM7XOQBR.mjs.map → react-surface-5MQA3IUS.mjs.map} +1 -1
- package/dist/lib/node-esm/{transcriber-QPS55YP2.mjs → transcriber-ZPJM4U2W.mjs} +7 -7
- package/dist/lib/node-esm/{transcriber-QPS55YP2.mjs.map → transcriber-ZPJM4U2W.mjs.map} +1 -1
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/TranscriptionPlugin.d.ts +1 -1
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.d.ts +5 -5
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +3 -5
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +1 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/transcript-extension.d.ts +3 -7
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +1 -1
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts +0 -2
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +0 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +0 -2
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +3 -3
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
- package/dist/types/src/functions/open.d.ts +1 -1
- package/dist/types/src/functions/open.d.ts.map +1 -1
- package/dist/types/src/functions/summarize.d.ts +1 -1
- package/dist/types/src/functions/summarize.d.ts.map +1 -1
- package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/message-normalizer.d.ts +3 -3
- package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/normalization.d.ts +32 -17
- package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/utils.d.ts +2 -2
- package/dist/types/src/segments-normalization/utils.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +6 -6
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts +2 -2
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcription-manager.d.ts +3 -3
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/types/Transcript.d.ts +3 -3
- package/dist/types/src/types/Transcript.d.ts.map +1 -1
- package/dist/types/src/types/TranscriptAction.d.ts +1 -1
- package/dist/types/src/types/TranscriptAction.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +64 -63
- package/src/TranscriptionPlugin.tsx +57 -57
- package/src/capabilities/capabilities.ts +3 -3
- package/src/components/Transcript/Transcript.stories.tsx +28 -24
- package/src/components/Transcript/Transcript.tsx +20 -27
- package/src/components/Transcript/deprecated/OldTranscript.tsx +5 -5
- package/src/components/Transcript/transcript-extension.ts +11 -44
- package/src/components/TranscriptContainer.tsx +8 -7
- package/src/components/stories/FileTranscription.stories.tsx +33 -31
- package/src/components/stories/KeyWordRecognition.stories.tsx +4 -6
- package/src/components/stories/MicrophoneTranscription.stories.tsx +40 -37
- package/src/components/stories/TranscriptionStory.tsx +8 -9
- package/src/functions/open.ts +8 -6
- package/src/functions/summarize.ts +10 -4
- package/src/hooks/useAudioFile.ts +50 -45
- package/src/hooks/useTranscriber.ts +7 -2
- package/src/meta.ts +7 -4
- package/src/model/model.test.ts +11 -11
- package/src/segments-normalization/message-normalizer.ts +6 -6
- package/src/segments-normalization/normalization.test.ts +6 -6
- package/src/segments-normalization/normalization.ts +7 -7
- package/src/segments-normalization/utils.ts +2 -2
- package/src/testing/testing.ts +25 -20
- package/src/transcriber/transcriber.browser.test.ts +3 -3
- package/src/transcriber/transcriber.ts +3 -3
- package/src/transcriber/transcription-manager.ts +6 -6
- package/src/types/Transcript.ts +1 -1
- package/src/types/TranscriptAction.ts +1 -1
- package/dist/lib/browser/TranscriptContainer-OX7OOODC.mjs +0 -11
- package/dist/lib/browser/blueprint-definition-QQSGTX5F.mjs.map +0 -7
- package/dist/lib/browser/chunk-3X7HP44M.mjs.map +0 -7
- package/dist/lib/browser/chunk-5I4BMOGE.mjs.map +0 -7
- package/dist/lib/browser/chunk-BA64VLLR.mjs.map +0 -7
- package/dist/lib/browser/chunk-HXVGV7T6.mjs.map +0 -7
- package/dist/lib/browser/chunk-TNEQFHIU.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-4PLCTH5Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3QAIZGMW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DT3AOC3E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J5GQ3KGX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QARUDLHN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-W72HVQMD.mjs.map +0 -7
- /package/dist/lib/browser/{TranscriptContainer-OX7OOODC.mjs.map → TranscriptContainer-EKSP5DQ6.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-26XDG6GQ.mjs.map → chunk-OCI42DWB.mjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-BUWK63SI.mjs.map → TranscriptContainer-WU3EDQR3.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-NWD757KH.mjs.map → chunk-X5BKN32O.mjs.map} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TranscriptContainer_default,
|
|
3
|
+
TranscriptionContainer
|
|
4
|
+
} from "./chunk-EHT3TE6U.mjs";
|
|
5
|
+
import "./chunk-3MKZ2MNQ.mjs";
|
|
6
|
+
import "./chunk-VBUIO677.mjs";
|
|
7
|
+
export {
|
|
8
|
+
TranscriptionContainer,
|
|
9
|
+
TranscriptContainer_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=TranscriptContainer-EKSP5DQ6.mjs.map
|
package/dist/lib/browser/{blueprint-definition-QQSGTX5F.mjs → blueprint-definition-WBWHO4OH.mjs}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-OCI42DWB.mjs";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
renderByline
|
|
4
|
+
} from "./chunk-EHT3TE6U.mjs";
|
|
5
|
+
import "./chunk-3MKZ2MNQ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
Transcript_exports
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-W7WKZTM4.mjs";
|
|
9
|
+
import "./chunk-VBUIO677.mjs";
|
|
10
10
|
|
|
11
11
|
// src/capabilities/blueprint-definition.ts
|
|
12
12
|
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
@@ -14,13 +14,15 @@ import { Blueprint, Template } from "@dxos/blueprints";
|
|
|
14
14
|
import { trim as trim2 } from "@dxos/util";
|
|
15
15
|
|
|
16
16
|
// src/functions/open.ts
|
|
17
|
-
import
|
|
17
|
+
import * as Effect from "effect/Effect";
|
|
18
|
+
import * as Schema from "effect/Schema";
|
|
18
19
|
import { ArtifactId } from "@dxos/assistant";
|
|
19
20
|
import { Obj } from "@dxos/echo";
|
|
20
21
|
import { DatabaseService, QueueService, defineFunction } from "@dxos/functions";
|
|
21
|
-
import {
|
|
22
|
+
import { Message } from "@dxos/types";
|
|
22
23
|
var open_default = defineFunction({
|
|
23
|
-
|
|
24
|
+
key: "dxos.org/function/transcription/open",
|
|
25
|
+
name: "Open",
|
|
24
26
|
description: "Opens and reads the contents of a transcription object.",
|
|
25
27
|
inputSchema: Schema.Struct({
|
|
26
28
|
id: ArtifactId.annotations({
|
|
@@ -35,7 +37,7 @@ var open_default = defineFunction({
|
|
|
35
37
|
const { dxn } = yield* Effect.promise(() => transcript.queue.load());
|
|
36
38
|
const queue = yield* QueueService.getQueue(dxn);
|
|
37
39
|
yield* Effect.promise(() => queue?.queryObjects());
|
|
38
|
-
const content = queue?.objects.filter((message) => Obj.instanceOf(
|
|
40
|
+
const content = queue?.objects.filter((message) => Obj.instanceOf(Message.Message, message)).flatMap((message, index) => renderByline([])(message, index)).join("\n\n");
|
|
39
41
|
return {
|
|
40
42
|
content
|
|
41
43
|
};
|
|
@@ -43,13 +45,19 @@ var open_default = defineFunction({
|
|
|
43
45
|
});
|
|
44
46
|
|
|
45
47
|
// src/functions/summarize.ts
|
|
46
|
-
import
|
|
48
|
+
import * as Array from "effect/Array";
|
|
49
|
+
import * as Effect2 from "effect/Effect";
|
|
50
|
+
import * as Function from "effect/Function";
|
|
51
|
+
import * as Layer from "effect/Layer";
|
|
52
|
+
import * as Option from "effect/Option";
|
|
53
|
+
import * as Schema2 from "effect/Schema";
|
|
47
54
|
import { AiService, ConsolePrinter, ToolExecutionService, ToolResolverService } from "@dxos/ai";
|
|
48
55
|
import { AiSession, GenerationObserver } from "@dxos/assistant";
|
|
49
56
|
import { TracingService, defineFunction as defineFunction2 } from "@dxos/functions";
|
|
50
57
|
import { trim } from "@dxos/util";
|
|
51
58
|
var summarize_default = defineFunction2({
|
|
52
|
-
|
|
59
|
+
key: "dxos.org/function/transcription/summarize",
|
|
60
|
+
name: "Summarize",
|
|
53
61
|
description: "Summarize a transcript of a meeting.",
|
|
54
62
|
inputSchema: Schema2.Struct({
|
|
55
63
|
transcript: Schema2.String.annotations({
|
|
@@ -75,7 +83,7 @@ Notes: ${notes}`,
|
|
|
75
83
|
tag: "summarize"
|
|
76
84
|
}))
|
|
77
85
|
});
|
|
78
|
-
const summary = pipe(result, Array.findLast((msg) => msg.sender.role === "assistant" && msg.blocks.some((block) => block._tag === "text")), Option.flatMap((msg) => pipe(msg.blocks, Array.findLast((block) => block._tag === "text"), Option.map((block) => block.text))), Option.getOrThrowWith(() => new Error("No summary found")));
|
|
86
|
+
const summary = Function.pipe(result, Array.findLast((msg) => msg.sender.role === "assistant" && msg.blocks.some((block) => block._tag === "text")), Option.flatMap((msg) => Function.pipe(msg.blocks, Array.findLast((block) => block._tag === "text"), Option.map((block) => block.text))), Option.getOrThrowWith(() => new Error("No summary found")));
|
|
79
87
|
return {
|
|
80
88
|
summary
|
|
81
89
|
};
|
|
@@ -119,7 +127,7 @@ var functions = [
|
|
|
119
127
|
open_default,
|
|
120
128
|
summarize_default
|
|
121
129
|
];
|
|
122
|
-
var blueprint_definition_default = () => {
|
|
130
|
+
var blueprint_definition_default = (() => {
|
|
123
131
|
return [
|
|
124
132
|
contributes(Capabilities.Functions, functions),
|
|
125
133
|
contributes(Capabilities.BlueprintDefinition, Blueprint.make({
|
|
@@ -135,8 +143,8 @@ var blueprint_definition_default = () => {
|
|
|
135
143
|
})
|
|
136
144
|
}))
|
|
137
145
|
];
|
|
138
|
-
};
|
|
146
|
+
});
|
|
139
147
|
export {
|
|
140
148
|
blueprint_definition_default as default
|
|
141
149
|
};
|
|
142
|
-
//# sourceMappingURL=blueprint-definition-
|
|
150
|
+
//# sourceMappingURL=blueprint-definition-WBWHO4OH.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/blueprint-definition.ts", "../../../src/functions/open.ts", "../../../src/functions/summarize.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { type FunctionDefinition } from '@dxos/functions';\nimport { trim } from '@dxos/util';\n\nimport { open, summarize } from '../functions';\n\nconst functions: FunctionDefinition[] = [open, summarize];\n\nexport default () => {\n return [\n contributes(Capabilities.Functions, functions),\n contributes(\n Capabilities.BlueprintDefinition,\n Blueprint.make({\n key: 'dxos.org/blueprint/transcription',\n name: 'Transcription',\n tools: Blueprint.toolDefinitions({ functions }),\n instructions: Template.make({\n source: trim`\n You can open and summarize a meeting transcript.\n `,\n }),\n }),\n ),\n ];\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { ArtifactId } from '@dxos/assistant';\nimport { Obj } from '@dxos/echo';\nimport { DatabaseService, QueueService, defineFunction } from '@dxos/functions';\nimport { Message } from '@dxos/types';\n\nimport { renderByline } from '../components';\nimport { Transcript } from '../types';\n\nexport default defineFunction({\n key: 'dxos.org/function/transcription/open',\n name: 'Open',\n description: 'Opens and reads the contents of a transcription object.',\n inputSchema: Schema.Struct({\n id: ArtifactId.annotations({\n description: 'The ID of the transcription object.',\n }),\n }),\n outputSchema: Schema.Struct({\n content: Schema.String,\n }),\n handler: Effect.fn(function* ({ data: { id } }) {\n const transcript = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Transcript.Transcript);\n const { dxn } = yield* Effect.promise(() => transcript.queue.load());\n const queue = yield* QueueService.getQueue(dxn);\n yield* Effect.promise(() => queue?.queryObjects());\n const content = queue?.objects\n .filter((message) => Obj.instanceOf(Message.Message, message))\n .flatMap((message, index) => renderByline([])(message, index))\n .join('\\n\\n');\n return { content };\n }),\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport * as Schema from 'effect/Schema';\n\nimport { AiService, ConsolePrinter, ToolExecutionService, ToolResolverService } from '@dxos/ai';\nimport { AiSession, GenerationObserver } from '@dxos/assistant';\nimport { TracingService, defineFunction } from '@dxos/functions';\nimport { trim } from '@dxos/util';\n\n/**\n * Summarize a transcript of a meeting.\n */\nexport default defineFunction({\n key: 'dxos.org/function/transcription/summarize',\n name: 'Summarize',\n description: 'Summarize a transcript of a meeting.',\n inputSchema: 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 outputSchema: Schema.Struct({\n summary: Schema.String.annotations({\n description: 'The summary of the transcript.',\n }),\n }),\n handler: Effect.fnUntraced(\n function* ({ data: { transcript, notes } }) {\n const result = yield* new AiSession().run({\n prompt: `Transcript: ${transcript}\\n\\nNotes: ${notes}`,\n history: [],\n system: systemPrompt,\n observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'summarize' })),\n });\n\n const summary = Function.pipe(\n result,\n Array.findLast((msg) => msg.sender.role === 'assistant' && msg.blocks.some((block) => block._tag === 'text')),\n Option.flatMap((msg) =>\n Function.pipe(\n msg.blocks,\n Array.findLast((block) => block._tag === 'text'),\n Option.map((block) => block.text),\n ),\n ),\n Option.getOrThrowWith(() => new Error('No summary found')),\n );\n\n return { summary };\n },\n Effect.provide(\n Layer.mergeAll(\n AiService.model('@anthropic/claude-sonnet-4-0'),\n ToolResolverService.layerEmpty,\n ToolExecutionService.layerEmpty,\n TracingService.layerNoop,\n ),\n ),\n ),\n});\n\nconst systemPrompt = trim`\n You are a helpful assistant that summarizes transcripts of meetings.\n\n # Goal\n Create a markdown summary of the meeting transcript with text notes provided.\n Notes are very important so make sure to include them in the summary if they contain meaningful information.\n\n # Formatting\n - Format the summary as a markdown document without extra comments like \"Here is the summary of the transcript:\".\n - Use markdown formatting for headings and bullet points.\n - Format the summary as a list of key points and takeaways.\n - All names of people should be in bold.\n\n # Note Taking\n - Correlate items in the summary with the person of origin to build a coherent narrative.\n - Include short quotes verbatim where appropriate. Especially when concerned with design decisions and problem descriptions.\n\n # Tasks\n At the end of the summary include tasks.\n Extract only the tasks that are:\n - Directly actionable.\n - Clearly assigned to a person or team (or can easily be inferred).\n - Strongly implied by the conversation and/or user note (no speculative tasks).\n - Specific enough that someone reading them would know exactly what to do next.\n\n Format all tasks as markdown checkboxes using the syntax:\n - [ ] Task description.\n\n Additional information can be included (indented).\n\n If no actionable tasks are found, omit this tasks section.\n`;\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Capabilities", "contributes", "Blueprint", "Template", "trim", "Effect", "Schema", "ArtifactId", "Obj", "DatabaseService", "QueueService", "defineFunction", "Message", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "id", "ArtifactId", "annotations", "outputSchema", "content", "String", "handler", "fn", "data", "transcript", "DatabaseService", "resolve", "toDXN", "Transcript", "dxn", "promise", "queue", "load", "QueueService", "getQueue", "queryObjects", "objects", "filter", "message", "Obj", "instanceOf", "Message", "flatMap", "index", "renderByline", "join", "Array", "Effect", "Function", "Layer", "Option", "Schema", "AiService", "ConsolePrinter", "ToolExecutionService", "ToolResolverService", "AiSession", "GenerationObserver", "TracingService", "defineFunction", "trim", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "transcript", "String", "annotations", "notes", "optional", "outputSchema", "summary", "handler", "fnUntraced", "data", "result", "AiSession", "run", "prompt", "history", "system", "systemPrompt", "observer", "GenerationObserver", "fromPrinter", "ConsolePrinter", "tag", "pipe", "findLast", "msg", "sender", "role", "blocks", "some", "block", "_tag", "flatMap", "map", "text", "getOrThrowWith", "Error", "provide", "mergeAll", "AiService", "model", "ToolResolverService", "layerEmpty", "ToolExecutionService", "TracingService", "layerNoop", "trim", "functions", "open", "summarize", "contributes", "Capabilities", "Functions", "BlueprintDefinition", "Blueprint", "make", "key", "name", "tools", "toolDefinitions", "instructions", "Template", "source", "trim"]
|
|
7
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-VBUIO677.mjs";
|
|
4
4
|
|
|
5
5
|
// src/capabilities/capabilities.ts
|
|
6
6
|
import { defineCapability } from "@dxos/app-framework";
|
|
7
7
|
(function(TranscriptionCapabilities2) {
|
|
8
|
-
TranscriptionCapabilities2.Transcriber = defineCapability(`${
|
|
9
|
-
TranscriptionCapabilities2.TranscriptionManager = defineCapability(`${
|
|
8
|
+
TranscriptionCapabilities2.Transcriber = defineCapability(`${meta.id}/capability/transcriber`);
|
|
9
|
+
TranscriptionCapabilities2.TranscriptionManager = defineCapability(`${meta.id}/capability/transcription-manager`);
|
|
10
10
|
})(TranscriptionCapabilities || (TranscriptionCapabilities = {}));
|
|
11
11
|
var TranscriptionCapabilities;
|
|
12
12
|
|
|
13
13
|
export {
|
|
14
14
|
TranscriptionCapabilities
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-3MKZ2MNQ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\n\nimport { meta } from '../meta';\nimport {\n type MediaStreamRecorderParams,\n type Transcriber,\n type TranscriberParams,\n type TranscriptMessageEnricher,\n type TranscriptionManager,\n} from '../transcriber';\n\nexport namespace TranscriptionCapabilities {\n export type GetTranscriberProps = {\n audioStreamTrack: MediaStreamTrack;\n recorderConfig?: Partial<MediaStreamRecorderParams['config']>;\n transcriberConfig?: Partial<TranscriberParams['config']>;\n onSegments: TranscriberParams['onSegments'];\n };\n export type GetTranscriber = (props: GetTranscriberProps) => Transcriber;\n export const Transcriber = defineCapability<GetTranscriber>(`${meta.id}/capability/transcriber`);\n\n export type GetTranscriptionManagerProps = {\n messageEnricher?: TranscriptMessageEnricher;\n };\n export type GetTranscriptionManager = (props: GetTranscriptionManagerProps) => TranscriptionManager;\n export const TranscriptionManager = defineCapability<GetTranscriptionManager>(\n `${meta.id}/capability/transcription-manager`,\n );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,wBAAwB;UAWhBC,4BAAAA;6BAQFC,cAAcC,iBAAiC,GAAGC,KAAKC,EAAE,yBAAyB;6BAMlFC,uBAAuBH,iBAClC,GAAGC,KAAKC,EAAE,mCAAmC;AAEjD,GAjBiBJ,8BAAAA,4BAAAA,CAAAA,EAAAA;;",
|
|
6
|
+
"names": ["defineCapability", "TranscriptionCapabilities", "Transcriber", "defineCapability", "meta", "id", "TranscriptionManager"]
|
|
7
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TranscriptionCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3MKZ2MNQ.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/TranscriptContainer.tsx
|
|
6
6
|
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
7
7
|
import React2 from "react";
|
|
8
|
-
import {
|
|
8
|
+
import { getSpace } from "@dxos/client/echo";
|
|
9
|
+
import { Obj } from "@dxos/echo";
|
|
9
10
|
import { useMembers, useQueue } from "@dxos/react-client/echo";
|
|
10
11
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
11
12
|
|
|
@@ -23,57 +24,66 @@ var useAudioFile = (audioUrl, constraints) => {
|
|
|
23
24
|
L: 20
|
|
24
25
|
});
|
|
25
26
|
scheduleTask(ctx, async () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
try {
|
|
28
|
+
const response = await fetch(audioUrl);
|
|
29
|
+
const blob = await response.blob();
|
|
30
|
+
const objectUrl = URL.createObjectURL(blob);
|
|
31
|
+
ctx.onDispose(() => {
|
|
32
|
+
URL.revokeObjectURL(objectUrl);
|
|
33
|
+
});
|
|
34
|
+
const audio2 = new Audio();
|
|
35
|
+
audio2.src = objectUrl;
|
|
36
|
+
await new Promise((resolve, reject) => {
|
|
37
|
+
audio2.addEventListener("error", (err) => {
|
|
38
|
+
log.error("error", {
|
|
39
|
+
err
|
|
40
|
+
}, {
|
|
41
|
+
F: __dxlog_file,
|
|
42
|
+
L: 39,
|
|
43
|
+
S: void 0,
|
|
44
|
+
C: (f, a) => f(...a)
|
|
45
|
+
});
|
|
46
|
+
reject(err);
|
|
38
47
|
}, {
|
|
48
|
+
once: true
|
|
49
|
+
});
|
|
50
|
+
audio2.addEventListener("canplay", async () => {
|
|
51
|
+
resolve();
|
|
52
|
+
}, {
|
|
53
|
+
once: true
|
|
54
|
+
});
|
|
55
|
+
audio2.load();
|
|
56
|
+
});
|
|
57
|
+
const audioCtx = new AudioContext();
|
|
58
|
+
if (audioCtx.state === "suspended") {
|
|
59
|
+
await audioCtx.resume();
|
|
60
|
+
}
|
|
61
|
+
const destination = audioCtx.createMediaStreamDestination();
|
|
62
|
+
destination.channelCount = 1;
|
|
63
|
+
const source = audioCtx.createMediaElementSource(audio2);
|
|
64
|
+
source.connect(destination);
|
|
65
|
+
const track2 = destination.stream.getAudioTracks()[0];
|
|
66
|
+
if (constraints) {
|
|
67
|
+
await track2.applyConstraints(constraints).catch((err) => log.catch(err, void 0, {
|
|
39
68
|
F: __dxlog_file,
|
|
40
|
-
L:
|
|
69
|
+
L: 68,
|
|
41
70
|
S: void 0,
|
|
42
71
|
C: (f, a) => f(...a)
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
resolve();
|
|
50
|
-
}, {
|
|
51
|
-
once: true
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
setStream({
|
|
75
|
+
audio: audio2,
|
|
76
|
+
stream: destination.stream,
|
|
77
|
+
track: destination.stream.getAudioTracks()[0]
|
|
52
78
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const audioCtx = new AudioContext();
|
|
56
|
-
if (audioCtx.state === "suspended") {
|
|
57
|
-
await audioCtx.resume();
|
|
58
|
-
}
|
|
59
|
-
const destination = audioCtx.createMediaStreamDestination();
|
|
60
|
-
destination.channelCount = 1;
|
|
61
|
-
const source = audioCtx.createMediaElementSource(audio2);
|
|
62
|
-
source.connect(destination);
|
|
63
|
-
const track2 = destination.stream.getAudioTracks()[0];
|
|
64
|
-
if (constraints) {
|
|
65
|
-
await track2.applyConstraints(constraints).catch((err) => log.catch(err, void 0, {
|
|
79
|
+
} catch (err) {
|
|
80
|
+
log.catch(err, void 0, {
|
|
66
81
|
F: __dxlog_file,
|
|
67
|
-
L:
|
|
82
|
+
L: 78,
|
|
68
83
|
S: void 0,
|
|
69
84
|
C: (f, a) => f(...a)
|
|
70
|
-
})
|
|
85
|
+
});
|
|
71
86
|
}
|
|
72
|
-
setStream({
|
|
73
|
-
audio: audio2,
|
|
74
|
-
stream: destination.stream,
|
|
75
|
-
track: destination.stream.getAudioTracks()[0]
|
|
76
|
-
});
|
|
77
87
|
});
|
|
78
88
|
return () => {
|
|
79
89
|
void ctx.dispose();
|
|
@@ -125,21 +135,12 @@ import { Text } from "@codemirror/state";
|
|
|
125
135
|
import { Event } from "@dxos/async";
|
|
126
136
|
import { invariant } from "@dxos/invariant";
|
|
127
137
|
import { log as log2 } from "@dxos/log";
|
|
128
|
-
function _define_property(obj, key, value) {
|
|
129
|
-
if (key in obj) {
|
|
130
|
-
Object.defineProperty(obj, key, {
|
|
131
|
-
value,
|
|
132
|
-
enumerable: true,
|
|
133
|
-
configurable: true,
|
|
134
|
-
writable: true
|
|
135
|
-
});
|
|
136
|
-
} else {
|
|
137
|
-
obj[key] = value;
|
|
138
|
-
}
|
|
139
|
-
return obj;
|
|
140
|
-
}
|
|
141
138
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/model/model.ts";
|
|
142
139
|
var DocumentAdapter = class {
|
|
140
|
+
_view;
|
|
141
|
+
constructor(_view) {
|
|
142
|
+
this._view = _view;
|
|
143
|
+
}
|
|
143
144
|
/** The document must always have at least one line. */
|
|
144
145
|
lineCount() {
|
|
145
146
|
return this._view.state.doc.lines - 1;
|
|
@@ -171,12 +172,25 @@ var DocumentAdapter = class {
|
|
|
171
172
|
}
|
|
172
173
|
});
|
|
173
174
|
}
|
|
174
|
-
constructor(_view) {
|
|
175
|
-
_define_property(this, "_view", void 0);
|
|
176
|
-
this._view = _view;
|
|
177
|
-
}
|
|
178
175
|
};
|
|
179
176
|
var SerializationModel = class {
|
|
177
|
+
_renderer;
|
|
178
|
+
/** Ordered set of chunks. */
|
|
179
|
+
_chunks = [];
|
|
180
|
+
/** Map of chunk IDs to their current line counts. */
|
|
181
|
+
_chunkLineCounts = /* @__PURE__ */ new Map();
|
|
182
|
+
/** Map of line numbers to chunk IDs. */
|
|
183
|
+
_lineToChunk = /* @__PURE__ */ new Map();
|
|
184
|
+
/** Track chunk changes since last sync. */
|
|
185
|
+
_changes = [];
|
|
186
|
+
/** Emits when the document is updated. */
|
|
187
|
+
update = new Event();
|
|
188
|
+
constructor(_renderer, initialChunks = []) {
|
|
189
|
+
this._renderer = _renderer;
|
|
190
|
+
initialChunks.forEach((chunk) => {
|
|
191
|
+
this.appendChunk(chunk);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
180
194
|
toJSON() {
|
|
181
195
|
return {
|
|
182
196
|
chunks: this._chunks.length,
|
|
@@ -314,23 +328,6 @@ var SerializationModel = class {
|
|
|
314
328
|
this._changes.length = 0;
|
|
315
329
|
return this;
|
|
316
330
|
}
|
|
317
|
-
constructor(_renderer, initialChunks = []) {
|
|
318
|
-
_define_property(this, "_renderer", void 0);
|
|
319
|
-
_define_property(this, "_chunks", void 0);
|
|
320
|
-
_define_property(this, "_chunkLineCounts", void 0);
|
|
321
|
-
_define_property(this, "_lineToChunk", void 0);
|
|
322
|
-
_define_property(this, "_changes", void 0);
|
|
323
|
-
_define_property(this, "update", void 0);
|
|
324
|
-
this._renderer = _renderer;
|
|
325
|
-
this._chunks = [];
|
|
326
|
-
this._chunkLineCounts = /* @__PURE__ */ new Map();
|
|
327
|
-
this._lineToChunk = /* @__PURE__ */ new Map();
|
|
328
|
-
this._changes = [];
|
|
329
|
-
this.update = new Event();
|
|
330
|
-
initialChunks.forEach((chunk) => {
|
|
331
|
-
this.appendChunk(chunk);
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
331
|
};
|
|
335
332
|
|
|
336
333
|
// src/hooks/useQueueModelAdapter.ts
|
|
@@ -383,14 +380,14 @@ var useQueueModelAdapter = (renderer, queue, initialChunks = []) => {
|
|
|
383
380
|
|
|
384
381
|
// src/hooks/useTranscriber.ts
|
|
385
382
|
import { useEffect as useEffect4, useMemo as useMemo2 } from "react";
|
|
386
|
-
import { useCapabilities } from "@dxos/app-framework";
|
|
383
|
+
import { useCapabilities } from "@dxos/app-framework/react";
|
|
387
384
|
|
|
388
385
|
// src/capabilities/index.ts
|
|
389
386
|
import { lazy } from "@dxos/app-framework";
|
|
390
|
-
var BlueprintDefinition = lazy(() => import("./blueprint-definition-
|
|
391
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
392
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
393
|
-
var Transcriber = lazy(() => import("./transcriber-
|
|
387
|
+
var BlueprintDefinition = lazy(() => import("./blueprint-definition-WBWHO4OH.mjs"));
|
|
388
|
+
var IntentResolver = lazy(() => import("./intent-resolver-ZTKTEAQX.mjs"));
|
|
389
|
+
var ReactSurface = lazy(() => import("./react-surface-NARMYO2O.mjs"));
|
|
390
|
+
var Transcriber = lazy(() => import("./transcriber-E2KAOXPS.mjs"));
|
|
394
391
|
|
|
395
392
|
// src/hooks/useTranscriber.ts
|
|
396
393
|
var useTranscriber = ({ audioStreamTrack, recorderConfig, transcriberConfig, onSegments }) => {
|
|
@@ -487,10 +484,10 @@ var useVoiceInput = ({ active, onUpdate }) => {
|
|
|
487
484
|
// src/components/Transcript/Transcript.tsx
|
|
488
485
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
489
486
|
import React from "react";
|
|
490
|
-
import {
|
|
491
|
-
import { createBasicExtensions, createMarkdownExtensions,
|
|
487
|
+
import { useThemeContext } from "@dxos/react-ui";
|
|
488
|
+
import { autoScroll, createBasicExtensions, createMarkdownExtensions, createThemeExtensions, decorateMarkdown, editorSlots, preview, useTextEditor } from "@dxos/react-ui-editor";
|
|
492
489
|
import { mx } from "@dxos/react-ui-theme";
|
|
493
|
-
import {
|
|
490
|
+
import { isTruthy } from "@dxos/util";
|
|
494
491
|
|
|
495
492
|
// src/components/Transcript/transcript-extension.ts
|
|
496
493
|
import { RangeSetBuilder } from "@codemirror/state";
|
|
@@ -498,20 +495,7 @@ import { EditorView, GutterMarker, ViewPlugin, gutter } from "@codemirror/view";
|
|
|
498
495
|
import { format } from "date-fns/format";
|
|
499
496
|
import { intervalToDuration } from "date-fns/intervalToDuration";
|
|
500
497
|
import { addEventListener, combine } from "@dxos/async";
|
|
501
|
-
|
|
502
|
-
if (key in obj) {
|
|
503
|
-
Object.defineProperty(obj, key, {
|
|
504
|
-
value,
|
|
505
|
-
enumerable: true,
|
|
506
|
-
configurable: true,
|
|
507
|
-
writable: true
|
|
508
|
-
});
|
|
509
|
-
} else {
|
|
510
|
-
obj[key] = value;
|
|
511
|
-
}
|
|
512
|
-
return obj;
|
|
513
|
-
}
|
|
514
|
-
var transcript = ({ model, started, renderButton }) => {
|
|
498
|
+
var transcript = ({ model, started }) => {
|
|
515
499
|
return [
|
|
516
500
|
// Show timestamps in the gutter.
|
|
517
501
|
gutter({
|
|
@@ -539,23 +523,11 @@ var transcript = ({ model, started, renderButton }) => {
|
|
|
539
523
|
}),
|
|
540
524
|
// Listen for model updates.
|
|
541
525
|
ViewPlugin.fromClass(class {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
model.sync(this._adapter);
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
destroy() {
|
|
551
|
-
this._controls?.remove();
|
|
552
|
-
this._cleanup();
|
|
553
|
-
}
|
|
526
|
+
_controls;
|
|
527
|
+
_cleanup;
|
|
528
|
+
_adapter;
|
|
529
|
+
_initialized = false;
|
|
554
530
|
constructor(view) {
|
|
555
|
-
_define_property2(this, "_controls", void 0);
|
|
556
|
-
_define_property2(this, "_cleanup", void 0);
|
|
557
|
-
_define_property2(this, "_adapter", void 0);
|
|
558
|
-
_define_property2(this, "_initialized", false);
|
|
559
531
|
this._adapter = new DocumentAdapter(view);
|
|
560
532
|
const scroller = view.scrollDOM;
|
|
561
533
|
let isAutoScrolling = false;
|
|
@@ -577,52 +549,39 @@ var transcript = ({ model, started, renderButton }) => {
|
|
|
577
549
|
})
|
|
578
550
|
});
|
|
579
551
|
};
|
|
580
|
-
if (renderButton) {
|
|
581
|
-
this._controls = document.createElement("div");
|
|
582
|
-
this._controls.classList.add("cm-controls", "transition-opacity", "duration-300", "opacity-0");
|
|
583
|
-
view.dom.appendChild(this._controls);
|
|
584
|
-
renderButton(this._controls, {
|
|
585
|
-
onClick: () => {
|
|
586
|
-
scrollToBottom(false);
|
|
587
|
-
}
|
|
588
|
-
}, view);
|
|
589
|
-
}
|
|
590
552
|
this._cleanup = combine(addEventListener(view.scrollDOM, "scroll", () => {
|
|
591
553
|
if (!isAutoScrolling) {
|
|
592
554
|
hasScrolled = true;
|
|
593
555
|
this._controls?.classList.remove("opacity-0");
|
|
594
556
|
}
|
|
595
557
|
}), model.update.on(() => {
|
|
596
|
-
const
|
|
558
|
+
const autoScroll2 = scroller.scrollHeight - scroller.scrollTop - scroller.clientHeight === 0 || !hasScrolled;
|
|
597
559
|
model.sync(this._adapter);
|
|
598
|
-
if (
|
|
560
|
+
if (autoScroll2) {
|
|
599
561
|
scrollToBottom(true);
|
|
600
562
|
}
|
|
601
563
|
}));
|
|
602
564
|
}
|
|
565
|
+
update(_update) {
|
|
566
|
+
if (!this._initialized) {
|
|
567
|
+
this._initialized = true;
|
|
568
|
+
setTimeout(() => {
|
|
569
|
+
model.sync(this._adapter);
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
destroy() {
|
|
574
|
+
this._controls?.remove();
|
|
575
|
+
this._cleanup();
|
|
576
|
+
}
|
|
603
577
|
}),
|
|
604
578
|
EditorView.theme({
|
|
605
|
-
".cm-
|
|
606
|
-
|
|
607
|
-
},
|
|
608
|
-
".cm-hide-scrollbar": {
|
|
609
|
-
scrollbarWidth: "none",
|
|
610
|
-
"-ms-overflow-style": "none"
|
|
611
|
-
},
|
|
612
|
-
".cm-hide-scrollbar::-webkit-scrollbar": {
|
|
613
|
-
display: "none"
|
|
614
|
-
},
|
|
615
|
-
".cm-controls": {
|
|
616
|
-
position: "absolute",
|
|
617
|
-
bottom: "0.5rem",
|
|
618
|
-
right: "0.5rem",
|
|
619
|
-
zIndex: 1e3
|
|
620
|
-
},
|
|
621
|
-
".cm-line": {
|
|
622
|
-
paddingRight: "1rem"
|
|
579
|
+
".cm-gutters": {
|
|
580
|
+
backgroundColor: "var(--dx-baseSurface)"
|
|
623
581
|
},
|
|
624
582
|
".cm-timestamp-gutter": {
|
|
625
583
|
width: "6rem",
|
|
584
|
+
paddingLeft: "0.5rem",
|
|
626
585
|
paddingRight: "1rem"
|
|
627
586
|
},
|
|
628
587
|
".cm-timestamp-gutter > .cm-gutterElement > div": {
|
|
@@ -634,8 +593,14 @@ var transcript = ({ model, started, renderButton }) => {
|
|
|
634
593
|
];
|
|
635
594
|
};
|
|
636
595
|
var TimestampMarker = class extends GutterMarker {
|
|
596
|
+
_line;
|
|
597
|
+
_timestamp;
|
|
598
|
+
_started;
|
|
599
|
+
constructor(_line, _timestamp, _started) {
|
|
600
|
+
super(), this._line = _line, this._timestamp = _timestamp, this._started = _started;
|
|
601
|
+
}
|
|
637
602
|
eq(other) {
|
|
638
|
-
return
|
|
603
|
+
return this._timestamp === other._timestamp;
|
|
639
604
|
}
|
|
640
605
|
toDOM(view) {
|
|
641
606
|
const el = document.createElement("div");
|
|
@@ -651,9 +616,6 @@ var TimestampMarker = class extends GutterMarker {
|
|
|
651
616
|
};
|
|
652
617
|
return el;
|
|
653
618
|
}
|
|
654
|
-
constructor(_line, _timestamp, _started) {
|
|
655
|
-
super(), _define_property2(this, "_line", void 0), _define_property2(this, "_timestamp", void 0), _define_property2(this, "_started", void 0), this._line = _line, this._timestamp = _timestamp, this._started = _started;
|
|
656
|
-
}
|
|
657
619
|
};
|
|
658
620
|
var getStartTime = (started, message) => {
|
|
659
621
|
if (started) {
|
|
@@ -678,7 +640,7 @@ var formatTimestamp = (timestamp, relative) => {
|
|
|
678
640
|
};
|
|
679
641
|
|
|
680
642
|
// src/components/Transcript/Transcript.tsx
|
|
681
|
-
var
|
|
643
|
+
var renderByline = (identities) => (message, index, debug = false) => {
|
|
682
644
|
if (message.sender.role === "assistant") {
|
|
683
645
|
return [
|
|
684
646
|
message.blocks.find((block) => block._tag === "transcript")?.text ?? "",
|
|
@@ -689,12 +651,13 @@ var renderMarkdown = (identities) => (message, index, debug = false) => {
|
|
|
689
651
|
const name = identity?.profile?.displayName ?? message.sender.contact?.target?.fullName ?? message.sender.name ?? message.sender.email ?? message.sender.identityDid;
|
|
690
652
|
const blocks = message.blocks.filter((block) => block._tag === "transcript");
|
|
691
653
|
return [
|
|
654
|
+
// TODO(thure): Use an XML tag with the bits needed here.
|
|
692
655
|
`###### ${name}` + (debug ? ` [${index}]:${message.id}` : ""),
|
|
693
656
|
blocks.map((block) => block.text.trim()).join(" "),
|
|
694
657
|
""
|
|
695
658
|
];
|
|
696
659
|
};
|
|
697
|
-
var TranscriptView = ({ classNames, transcript: object,
|
|
660
|
+
var TranscriptView = ({ classNames, space, transcript: object, model }) => {
|
|
698
661
|
var _effect = _useSignals();
|
|
699
662
|
try {
|
|
700
663
|
const { themeMode } = useThemeContext();
|
|
@@ -706,25 +669,19 @@ var TranscriptView = ({ classNames, transcript: object, space, model, attendable
|
|
|
706
669
|
lineWrapping: true,
|
|
707
670
|
search: true
|
|
708
671
|
}),
|
|
709
|
-
createMarkdownExtensions(
|
|
710
|
-
themeMode
|
|
711
|
-
}),
|
|
672
|
+
createMarkdownExtensions(),
|
|
712
673
|
createThemeExtensions({
|
|
713
|
-
themeMode
|
|
674
|
+
themeMode,
|
|
675
|
+
slots: editorSlots
|
|
714
676
|
}),
|
|
715
677
|
decorateMarkdown(),
|
|
716
|
-
|
|
678
|
+
preview(),
|
|
717
679
|
transcript({
|
|
718
680
|
model,
|
|
719
|
-
started: object?.started ? new Date(object.started) : void 0
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
label: "Scroll to bottom",
|
|
724
|
-
onClick
|
|
725
|
-
}))
|
|
726
|
-
})
|
|
727
|
-
].filter(isNotFalsy)
|
|
681
|
+
started: object?.started ? new Date(object.started) : void 0
|
|
682
|
+
}),
|
|
683
|
+
autoScroll()
|
|
684
|
+
].filter(isTruthy)
|
|
728
685
|
};
|
|
729
686
|
}, [
|
|
730
687
|
space,
|
|
@@ -732,7 +689,7 @@ var TranscriptView = ({ classNames, transcript: object, space, model, attendable
|
|
|
732
689
|
]);
|
|
733
690
|
return /* @__PURE__ */ React.createElement("div", {
|
|
734
691
|
ref: parentRef,
|
|
735
|
-
className: mx("flex grow overflow-hidden",
|
|
692
|
+
className: mx("flex grow overflow-hidden container-max-width", classNames),
|
|
736
693
|
"data-popover-collision-boundary": true
|
|
737
694
|
});
|
|
738
695
|
} finally {
|
|
@@ -744,16 +701,14 @@ var TranscriptView = ({ classNames, transcript: object, space, model, attendable
|
|
|
744
701
|
var TranscriptionContainer = ({ transcript: transcript2 }) => {
|
|
745
702
|
var _effect = _useSignals2();
|
|
746
703
|
try {
|
|
747
|
-
const attendableId =
|
|
704
|
+
const attendableId = Obj.getDXN(transcript2).toString();
|
|
748
705
|
const space = getSpace(transcript2);
|
|
749
706
|
const members = useMembers(space?.key).map((member) => member.identity);
|
|
750
707
|
const queue = useQueue(transcript2.queue.dxn, {
|
|
751
708
|
pollInterval: 1e3
|
|
752
709
|
});
|
|
753
|
-
const model = useQueueModelAdapter(
|
|
754
|
-
return /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
755
|
-
classNames: "container-max-width pli-2"
|
|
756
|
-
}, /* @__PURE__ */ React2.createElement(TranscriptView, {
|
|
710
|
+
const model = useQueueModelAdapter(renderByline(members), queue);
|
|
711
|
+
return /* @__PURE__ */ React2.createElement(StackItem.Content, null, /* @__PURE__ */ React2.createElement(TranscriptView, {
|
|
757
712
|
attendableId,
|
|
758
713
|
space,
|
|
759
714
|
model,
|
|
@@ -766,7 +721,7 @@ var TranscriptionContainer = ({ transcript: transcript2 }) => {
|
|
|
766
721
|
var TranscriptContainer_default = TranscriptionContainer;
|
|
767
722
|
|
|
768
723
|
export {
|
|
769
|
-
|
|
724
|
+
renderByline,
|
|
770
725
|
TranscriptView,
|
|
771
726
|
useAudioFile,
|
|
772
727
|
useAudioTrack,
|
|
@@ -780,4 +735,4 @@ export {
|
|
|
780
735
|
ReactSurface,
|
|
781
736
|
Transcriber
|
|
782
737
|
};
|
|
783
|
-
//# sourceMappingURL=chunk-
|
|
738
|
+
//# sourceMappingURL=chunk-EHT3TE6U.mjs.map
|