@dxos/plugin-transcription 0.8.4-main.5ea62a8 → 0.8.4-main.ae835ea
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-2GSL2XB5.mjs +11 -0
- package/dist/lib/browser/{blueprint-definition-QQSGTX5F.mjs → blueprint-definition-UAAJYVLZ.mjs} +23 -15
- package/dist/lib/browser/blueprint-definition-UAAJYVLZ.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-26XDG6GQ.mjs → chunk-535OJKFO.mjs} +2 -2
- package/dist/lib/browser/{chunk-5I4BMOGE.mjs → chunk-7DR6HZEF.mjs} +119 -170
- package/dist/lib/browser/chunk-7DR6HZEF.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/{chunk-BA64VLLR.mjs → chunk-WH36ENNE.mjs} +44 -64
- package/dist/lib/browser/{chunk-BA64VLLR.mjs.map → chunk-WH36ENNE.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +12 -13
- 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-KA32A72I.mjs} +8 -8
- package/dist/lib/browser/{react-surface-QYX74JNG.mjs.map → react-surface-KA32A72I.mjs.map} +1 -1
- package/dist/lib/browser/{transcriber-JOOAQVYV.mjs → transcriber-LWOLYQHC.mjs} +7 -7
- package/dist/lib/browser/{transcriber-JOOAQVYV.mjs.map → transcriber-LWOLYQHC.mjs.map} +1 -1
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{TranscriptContainer-BUWK63SI.mjs → TranscriptContainer-GRLDCESB.mjs} +4 -4
- package/dist/lib/node-esm/{blueprint-definition-4PLCTH5Q.mjs → blueprint-definition-Z3LTZ3ID.mjs} +23 -15
- package/dist/lib/node-esm/blueprint-definition-Z3LTZ3ID.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DT3AOC3E.mjs → chunk-K4AZOB5Y.mjs} +119 -170
- package/dist/lib/node-esm/chunk-K4AZOB5Y.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-NWD757KH.mjs → chunk-Q6WD7L2J.mjs} +2 -2
- 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-YFN4FJFK.mjs} +44 -64
- package/dist/lib/node-esm/{chunk-J5GQ3KGX.mjs.map → chunk-YFN4FJFK.mjs.map} +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 +12 -13
- 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-GU7LW2JO.mjs} +8 -8
- package/dist/lib/node-esm/{react-surface-TM7XOQBR.mjs.map → react-surface-GU7LW2JO.mjs.map} +1 -1
- package/dist/lib/node-esm/{transcriber-QPS55YP2.mjs → transcriber-UGB7ECX6.mjs} +7 -7
- package/dist/lib/node-esm/{transcriber-QPS55YP2.mjs.map → transcriber-UGB7ECX6.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/capabilities.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.d.ts +3 -3
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +1 -3
- 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 +1 -5
- package/dist/types/src/components/Transcript/transcript-extension.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 +1 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
- package/dist/types/src/functions/open.d.ts.map +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/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/normalization.d.ts +31 -16
- package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +1 -1
- package/dist/types/src/testing/testing.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 +61 -62
- package/src/TranscriptionPlugin.tsx +56 -56
- package/src/capabilities/capabilities.ts +3 -3
- package/src/components/Transcript/Transcript.stories.tsx +24 -20
- package/src/components/Transcript/Transcript.tsx +15 -23
- package/src/components/Transcript/deprecated/OldTranscript.tsx +5 -5
- package/src/components/Transcript/transcript-extension.ts +2 -39
- package/src/components/TranscriptContainer.tsx +3 -3
- package/src/components/stories/FileTranscription.stories.tsx +25 -24
- package/src/components/stories/KeyWordRecognition.stories.tsx +2 -4
- package/src/components/stories/MicrophoneTranscription.stories.tsx +31 -29
- package/src/components/stories/TranscriptionStory.tsx +2 -2
- package/src/functions/open.ts +6 -4
- package/src/functions/summarize.ts +10 -4
- package/src/hooks/useAudioFile.ts +50 -45
- package/src/meta.ts +7 -4
- package/src/segments-normalization/normalization.test.ts +1 -1
- package/src/segments-normalization/normalization.ts +1 -1
- package/src/testing/testing.ts +5 -5
- 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-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-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-2GSL2XB5.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-26XDG6GQ.mjs.map → chunk-535OJKFO.mjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-BUWK63SI.mjs.map → TranscriptContainer-GRLDCESB.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-NWD757KH.mjs.map → chunk-Q6WD7L2J.mjs.map} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TranscriptContainer_default,
|
|
3
|
+
TranscriptionContainer
|
|
4
|
+
} from "./chunk-7DR6HZEF.mjs";
|
|
5
|
+
import "./chunk-3MKZ2MNQ.mjs";
|
|
6
|
+
import "./chunk-VBUIO677.mjs";
|
|
7
|
+
export {
|
|
8
|
+
TranscriptionContainer,
|
|
9
|
+
TranscriptContainer_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=TranscriptContainer-2GSL2XB5.mjs.map
|
package/dist/lib/browser/{blueprint-definition-QQSGTX5F.mjs → blueprint-definition-UAAJYVLZ.mjs}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-535OJKFO.mjs";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
renderByline
|
|
4
|
+
} from "./chunk-7DR6HZEF.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
22
|
import { DataType } from "@dxos/schema";
|
|
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(DataType.Message, message)).flatMap((message, index) =>
|
|
40
|
+
const content = queue?.objects.filter((message) => Obj.instanceOf(DataType.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-UAAJYVLZ.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 { DataType } from '@dxos/schema';\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(DataType.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", "DataType", "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", "DataType", "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,8 +1,8 @@
|
|
|
1
1
|
// src/components/index.ts
|
|
2
2
|
import { lazy } from "react";
|
|
3
|
-
var TranscriptContainer = lazy(() => import("./TranscriptContainer-
|
|
3
|
+
var TranscriptContainer = lazy(() => import("./TranscriptContainer-2GSL2XB5.mjs"));
|
|
4
4
|
|
|
5
5
|
export {
|
|
6
6
|
TranscriptContainer
|
|
7
7
|
};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-535OJKFO.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
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";
|
|
@@ -23,57 +23,66 @@ var useAudioFile = (audioUrl, constraints) => {
|
|
|
23
23
|
L: 20
|
|
24
24
|
});
|
|
25
25
|
scheduleTask(ctx, async () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
try {
|
|
27
|
+
const response = await fetch(audioUrl);
|
|
28
|
+
const blob = await response.blob();
|
|
29
|
+
const objectUrl = URL.createObjectURL(blob);
|
|
30
|
+
ctx.onDispose(() => {
|
|
31
|
+
URL.revokeObjectURL(objectUrl);
|
|
32
|
+
});
|
|
33
|
+
const audio2 = new Audio();
|
|
34
|
+
audio2.src = objectUrl;
|
|
35
|
+
await new Promise((resolve, reject) => {
|
|
36
|
+
audio2.addEventListener("error", (err) => {
|
|
37
|
+
log.error("error", {
|
|
38
|
+
err
|
|
39
|
+
}, {
|
|
40
|
+
F: __dxlog_file,
|
|
41
|
+
L: 39,
|
|
42
|
+
S: void 0,
|
|
43
|
+
C: (f, a) => f(...a)
|
|
44
|
+
});
|
|
45
|
+
reject(err);
|
|
38
46
|
}, {
|
|
47
|
+
once: true
|
|
48
|
+
});
|
|
49
|
+
audio2.addEventListener("canplay", async () => {
|
|
50
|
+
resolve();
|
|
51
|
+
}, {
|
|
52
|
+
once: true
|
|
53
|
+
});
|
|
54
|
+
audio2.load();
|
|
55
|
+
});
|
|
56
|
+
const audioCtx = new AudioContext();
|
|
57
|
+
if (audioCtx.state === "suspended") {
|
|
58
|
+
await audioCtx.resume();
|
|
59
|
+
}
|
|
60
|
+
const destination = audioCtx.createMediaStreamDestination();
|
|
61
|
+
destination.channelCount = 1;
|
|
62
|
+
const source = audioCtx.createMediaElementSource(audio2);
|
|
63
|
+
source.connect(destination);
|
|
64
|
+
const track2 = destination.stream.getAudioTracks()[0];
|
|
65
|
+
if (constraints) {
|
|
66
|
+
await track2.applyConstraints(constraints).catch((err) => log.catch(err, void 0, {
|
|
39
67
|
F: __dxlog_file,
|
|
40
|
-
L:
|
|
68
|
+
L: 68,
|
|
41
69
|
S: void 0,
|
|
42
70
|
C: (f, a) => f(...a)
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
resolve();
|
|
50
|
-
}, {
|
|
51
|
-
once: true
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
setStream({
|
|
74
|
+
audio: audio2,
|
|
75
|
+
stream: destination.stream,
|
|
76
|
+
track: destination.stream.getAudioTracks()[0]
|
|
52
77
|
});
|
|
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, {
|
|
78
|
+
} catch (err) {
|
|
79
|
+
log.catch(err, void 0, {
|
|
66
80
|
F: __dxlog_file,
|
|
67
|
-
L:
|
|
81
|
+
L: 78,
|
|
68
82
|
S: void 0,
|
|
69
83
|
C: (f, a) => f(...a)
|
|
70
|
-
})
|
|
84
|
+
});
|
|
71
85
|
}
|
|
72
|
-
setStream({
|
|
73
|
-
audio: audio2,
|
|
74
|
-
stream: destination.stream,
|
|
75
|
-
track: destination.stream.getAudioTracks()[0]
|
|
76
|
-
});
|
|
77
86
|
});
|
|
78
87
|
return () => {
|
|
79
88
|
void ctx.dispose();
|
|
@@ -125,21 +134,12 @@ import { Text } from "@codemirror/state";
|
|
|
125
134
|
import { Event } from "@dxos/async";
|
|
126
135
|
import { invariant } from "@dxos/invariant";
|
|
127
136
|
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
137
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/model/model.ts";
|
|
142
138
|
var DocumentAdapter = class {
|
|
139
|
+
_view;
|
|
140
|
+
constructor(_view) {
|
|
141
|
+
this._view = _view;
|
|
142
|
+
}
|
|
143
143
|
/** The document must always have at least one line. */
|
|
144
144
|
lineCount() {
|
|
145
145
|
return this._view.state.doc.lines - 1;
|
|
@@ -171,12 +171,25 @@ var DocumentAdapter = class {
|
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
constructor(_view) {
|
|
175
|
-
_define_property(this, "_view", void 0);
|
|
176
|
-
this._view = _view;
|
|
177
|
-
}
|
|
178
174
|
};
|
|
179
175
|
var SerializationModel = class {
|
|
176
|
+
_renderer;
|
|
177
|
+
/** Ordered set of chunks. */
|
|
178
|
+
_chunks = [];
|
|
179
|
+
/** Map of chunk IDs to their current line counts. */
|
|
180
|
+
_chunkLineCounts = /* @__PURE__ */ new Map();
|
|
181
|
+
/** Map of line numbers to chunk IDs. */
|
|
182
|
+
_lineToChunk = /* @__PURE__ */ new Map();
|
|
183
|
+
/** Track chunk changes since last sync. */
|
|
184
|
+
_changes = [];
|
|
185
|
+
/** Emits when the document is updated. */
|
|
186
|
+
update = new Event();
|
|
187
|
+
constructor(_renderer, initialChunks = []) {
|
|
188
|
+
this._renderer = _renderer;
|
|
189
|
+
initialChunks.forEach((chunk) => {
|
|
190
|
+
this.appendChunk(chunk);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
180
193
|
toJSON() {
|
|
181
194
|
return {
|
|
182
195
|
chunks: this._chunks.length,
|
|
@@ -314,23 +327,6 @@ var SerializationModel = class {
|
|
|
314
327
|
this._changes.length = 0;
|
|
315
328
|
return this;
|
|
316
329
|
}
|
|
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
330
|
};
|
|
335
331
|
|
|
336
332
|
// src/hooks/useQueueModelAdapter.ts
|
|
@@ -387,10 +383,10 @@ import { useCapabilities } from "@dxos/app-framework";
|
|
|
387
383
|
|
|
388
384
|
// src/capabilities/index.ts
|
|
389
385
|
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-
|
|
386
|
+
var BlueprintDefinition = lazy(() => import("./blueprint-definition-UAAJYVLZ.mjs"));
|
|
387
|
+
var IntentResolver = lazy(() => import("./intent-resolver-ZTKTEAQX.mjs"));
|
|
388
|
+
var ReactSurface = lazy(() => import("./react-surface-KA32A72I.mjs"));
|
|
389
|
+
var Transcriber = lazy(() => import("./transcriber-LWOLYQHC.mjs"));
|
|
394
390
|
|
|
395
391
|
// src/hooks/useTranscriber.ts
|
|
396
392
|
var useTranscriber = ({ audioStreamTrack, recorderConfig, transcriberConfig, onSegments }) => {
|
|
@@ -487,10 +483,10 @@ var useVoiceInput = ({ active, onUpdate }) => {
|
|
|
487
483
|
// src/components/Transcript/Transcript.tsx
|
|
488
484
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
489
485
|
import React from "react";
|
|
490
|
-
import {
|
|
491
|
-
import { createBasicExtensions, createMarkdownExtensions,
|
|
486
|
+
import { useThemeContext } from "@dxos/react-ui";
|
|
487
|
+
import { autoScroll, createBasicExtensions, createMarkdownExtensions, createThemeExtensions, decorateMarkdown, preview, useTextEditor } from "@dxos/react-ui-editor";
|
|
492
488
|
import { mx } from "@dxos/react-ui-theme";
|
|
493
|
-
import {
|
|
489
|
+
import { isTruthy } from "@dxos/util";
|
|
494
490
|
|
|
495
491
|
// src/components/Transcript/transcript-extension.ts
|
|
496
492
|
import { RangeSetBuilder } from "@codemirror/state";
|
|
@@ -498,20 +494,7 @@ import { EditorView, GutterMarker, ViewPlugin, gutter } from "@codemirror/view";
|
|
|
498
494
|
import { format } from "date-fns/format";
|
|
499
495
|
import { intervalToDuration } from "date-fns/intervalToDuration";
|
|
500
496
|
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 }) => {
|
|
497
|
+
var transcript = ({ model, started }) => {
|
|
515
498
|
return [
|
|
516
499
|
// Show timestamps in the gutter.
|
|
517
500
|
gutter({
|
|
@@ -539,23 +522,11 @@ var transcript = ({ model, started, renderButton }) => {
|
|
|
539
522
|
}),
|
|
540
523
|
// Listen for model updates.
|
|
541
524
|
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
|
-
}
|
|
525
|
+
_controls;
|
|
526
|
+
_cleanup;
|
|
527
|
+
_adapter;
|
|
528
|
+
_initialized = false;
|
|
554
529
|
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
530
|
this._adapter = new DocumentAdapter(view);
|
|
560
531
|
const scroller = view.scrollDOM;
|
|
561
532
|
let isAutoScrolling = false;
|
|
@@ -577,50 +548,33 @@ var transcript = ({ model, started, renderButton }) => {
|
|
|
577
548
|
})
|
|
578
549
|
});
|
|
579
550
|
};
|
|
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
551
|
this._cleanup = combine(addEventListener(view.scrollDOM, "scroll", () => {
|
|
591
552
|
if (!isAutoScrolling) {
|
|
592
553
|
hasScrolled = true;
|
|
593
554
|
this._controls?.classList.remove("opacity-0");
|
|
594
555
|
}
|
|
595
556
|
}), model.update.on(() => {
|
|
596
|
-
const
|
|
557
|
+
const autoScroll2 = scroller.scrollHeight - scroller.scrollTop - scroller.clientHeight === 0 || !hasScrolled;
|
|
597
558
|
model.sync(this._adapter);
|
|
598
|
-
if (
|
|
559
|
+
if (autoScroll2) {
|
|
599
560
|
scrollToBottom(true);
|
|
600
561
|
}
|
|
601
562
|
}));
|
|
602
563
|
}
|
|
564
|
+
update(_update) {
|
|
565
|
+
if (!this._initialized) {
|
|
566
|
+
this._initialized = true;
|
|
567
|
+
setTimeout(() => {
|
|
568
|
+
model.sync(this._adapter);
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
destroy() {
|
|
573
|
+
this._controls?.remove();
|
|
574
|
+
this._cleanup();
|
|
575
|
+
}
|
|
603
576
|
}),
|
|
604
577
|
EditorView.theme({
|
|
605
|
-
".cm-scroller": {
|
|
606
|
-
overflowY: "scroll"
|
|
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"
|
|
623
|
-
},
|
|
624
578
|
".cm-timestamp-gutter": {
|
|
625
579
|
width: "6rem",
|
|
626
580
|
paddingRight: "1rem"
|
|
@@ -634,6 +588,12 @@ var transcript = ({ model, started, renderButton }) => {
|
|
|
634
588
|
];
|
|
635
589
|
};
|
|
636
590
|
var TimestampMarker = class extends GutterMarker {
|
|
591
|
+
_line;
|
|
592
|
+
_timestamp;
|
|
593
|
+
_started;
|
|
594
|
+
constructor(_line, _timestamp, _started) {
|
|
595
|
+
super(), this._line = _line, this._timestamp = _timestamp, this._started = _started;
|
|
596
|
+
}
|
|
637
597
|
eq(other) {
|
|
638
598
|
return other._timestamp === this._timestamp;
|
|
639
599
|
}
|
|
@@ -651,9 +611,6 @@ var TimestampMarker = class extends GutterMarker {
|
|
|
651
611
|
};
|
|
652
612
|
return el;
|
|
653
613
|
}
|
|
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
614
|
};
|
|
658
615
|
var getStartTime = (started, message) => {
|
|
659
616
|
if (started) {
|
|
@@ -678,7 +635,7 @@ var formatTimestamp = (timestamp, relative) => {
|
|
|
678
635
|
};
|
|
679
636
|
|
|
680
637
|
// src/components/Transcript/Transcript.tsx
|
|
681
|
-
var
|
|
638
|
+
var renderByline = (identities) => (message, index, debug = false) => {
|
|
682
639
|
if (message.sender.role === "assistant") {
|
|
683
640
|
return [
|
|
684
641
|
message.blocks.find((block) => block._tag === "transcript")?.text ?? "",
|
|
@@ -689,12 +646,13 @@ var renderMarkdown = (identities) => (message, index, debug = false) => {
|
|
|
689
646
|
const name = identity?.profile?.displayName ?? message.sender.contact?.target?.fullName ?? message.sender.name ?? message.sender.email ?? message.sender.identityDid;
|
|
690
647
|
const blocks = message.blocks.filter((block) => block._tag === "transcript");
|
|
691
648
|
return [
|
|
649
|
+
// TODO(thure): Use an XML tag with the bits needed here.
|
|
692
650
|
`###### ${name}` + (debug ? ` [${index}]:${message.id}` : ""),
|
|
693
651
|
blocks.map((block) => block.text.trim()).join(" "),
|
|
694
652
|
""
|
|
695
653
|
];
|
|
696
654
|
};
|
|
697
|
-
var TranscriptView = ({ classNames, transcript: object,
|
|
655
|
+
var TranscriptView = ({ classNames, space, transcript: object, model }) => {
|
|
698
656
|
var _effect = _useSignals();
|
|
699
657
|
try {
|
|
700
658
|
const { themeMode } = useThemeContext();
|
|
@@ -706,25 +664,18 @@ var TranscriptView = ({ classNames, transcript: object, space, model, attendable
|
|
|
706
664
|
lineWrapping: true,
|
|
707
665
|
search: true
|
|
708
666
|
}),
|
|
709
|
-
createMarkdownExtensions(
|
|
710
|
-
themeMode
|
|
711
|
-
}),
|
|
667
|
+
createMarkdownExtensions(),
|
|
712
668
|
createThemeExtensions({
|
|
713
669
|
themeMode
|
|
714
670
|
}),
|
|
715
671
|
decorateMarkdown(),
|
|
716
|
-
|
|
672
|
+
preview(),
|
|
717
673
|
transcript({
|
|
718
674
|
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)
|
|
675
|
+
started: object?.started ? new Date(object.started) : void 0
|
|
676
|
+
}),
|
|
677
|
+
autoScroll()
|
|
678
|
+
].filter(isTruthy)
|
|
728
679
|
};
|
|
729
680
|
}, [
|
|
730
681
|
space,
|
|
@@ -732,7 +683,7 @@ var TranscriptView = ({ classNames, transcript: object, space, model, attendable
|
|
|
732
683
|
]);
|
|
733
684
|
return /* @__PURE__ */ React.createElement("div", {
|
|
734
685
|
ref: parentRef,
|
|
735
|
-
className: mx("flex grow overflow-hidden",
|
|
686
|
+
className: mx("flex grow overflow-hidden container-max-width", classNames),
|
|
736
687
|
"data-popover-collision-boundary": true
|
|
737
688
|
});
|
|
738
689
|
} finally {
|
|
@@ -750,10 +701,8 @@ var TranscriptionContainer = ({ transcript: transcript2 }) => {
|
|
|
750
701
|
const queue = useQueue(transcript2.queue.dxn, {
|
|
751
702
|
pollInterval: 1e3
|
|
752
703
|
});
|
|
753
|
-
const model = useQueueModelAdapter(
|
|
754
|
-
return /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
755
|
-
classNames: "container-max-width pli-2"
|
|
756
|
-
}, /* @__PURE__ */ React2.createElement(TranscriptView, {
|
|
704
|
+
const model = useQueueModelAdapter(renderByline(members), queue);
|
|
705
|
+
return /* @__PURE__ */ React2.createElement(StackItem.Content, null, /* @__PURE__ */ React2.createElement(TranscriptView, {
|
|
757
706
|
attendableId,
|
|
758
707
|
space,
|
|
759
708
|
model,
|
|
@@ -766,7 +715,7 @@ var TranscriptionContainer = ({ transcript: transcript2 }) => {
|
|
|
766
715
|
var TranscriptContainer_default = TranscriptionContainer;
|
|
767
716
|
|
|
768
717
|
export {
|
|
769
|
-
|
|
718
|
+
renderByline,
|
|
770
719
|
TranscriptView,
|
|
771
720
|
useAudioFile,
|
|
772
721
|
useAudioTrack,
|
|
@@ -780,4 +729,4 @@ export {
|
|
|
780
729
|
ReactSurface,
|
|
781
730
|
Transcriber
|
|
782
731
|
};
|
|
783
|
-
//# sourceMappingURL=chunk-
|
|
732
|
+
//# sourceMappingURL=chunk-7DR6HZEF.mjs.map
|