@dxos/plugin-transcription 0.8.1-main.ae460ac → 0.8.1-staging.391c573
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-N4KQHMY4.mjs → TranscriptContainer-HAZP6CA4.mjs} +2 -2
- package/dist/lib/browser/{chunk-BDVUIRBP.mjs → chunk-6ZBM4EDB.mjs} +2 -2
- package/dist/lib/browser/chunk-7WGWZT65.mjs +393 -0
- package/dist/lib/browser/chunk-7WGWZT65.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +7 -5
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-UPTZBHVB.mjs → react-surface-Q7TXDD4O.mjs} +3 -3
- package/dist/lib/node/{TranscriptContainer-4BWXOVML.cjs → TranscriptContainer-34ARMIII.cjs} +7 -7
- package/dist/lib/node/{TranscriptContainer-4BWXOVML.cjs.map → TranscriptContainer-34ARMIII.cjs.map} +2 -2
- package/dist/lib/node/{chunk-I35KHI2G.cjs → chunk-5SKPVCFI.cjs} +5 -5
- package/dist/lib/node/{chunk-ANSWGFMS.cjs → chunk-SHYOIEFT.cjs} +226 -73
- package/dist/lib/node/chunk-SHYOIEFT.cjs.map +7 -0
- package/dist/lib/node/index.cjs +9 -7
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-NCKXB7EQ.cjs → react-surface-GDE6AIDT.cjs} +7 -7
- package/dist/lib/node-esm/{TranscriptContainer-6IKRASR6.mjs → TranscriptContainer-GJXPGREG.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-2CPKXRN6.mjs → chunk-5I6S5KWM.mjs} +2 -2
- package/dist/lib/node-esm/chunk-V2GWVMQL.mjs +394 -0
- package/dist/lib/node-esm/chunk-V2GWVMQL.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +7 -5
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-2WJQ67LB.mjs → react-surface-54E3UGAN.mjs} +3 -3
- package/dist/types/src/components/Transcript/Transcript.d.ts +3 -0
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/transcription.stories.d.ts +2 -1
- package/dist/types/src/components/transcription.stories.d.ts.map +1 -1
- package/package.json +39 -37
- package/src/components/Transcript/Transcript.stories.tsx +17 -11
- package/src/components/Transcript/Transcript.tsx +218 -49
- package/src/components/TranscriptContainer.tsx +13 -19
- package/src/components/transcription.stories.tsx +1 -1
- package/src/translations.ts +1 -1
- package/dist/lib/browser/chunk-YX447BJ4.mjs +0 -241
- package/dist/lib/browser/chunk-YX447BJ4.mjs.map +0 -7
- package/dist/lib/node/chunk-ANSWGFMS.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZMK2QLW2.mjs +0 -242
- package/dist/lib/node-esm/chunk-ZMK2QLW2.mjs.map +0 -7
- /package/dist/lib/browser/{TranscriptContainer-N4KQHMY4.mjs.map → TranscriptContainer-HAZP6CA4.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-BDVUIRBP.mjs.map → chunk-6ZBM4EDB.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-UPTZBHVB.mjs.map → react-surface-Q7TXDD4O.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-I35KHI2G.cjs.map → chunk-5SKPVCFI.cjs.map} +0 -0
- /package/dist/lib/node/{react-surface-NCKXB7EQ.cjs.map → react-surface-GDE6AIDT.cjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-6IKRASR6.mjs.map → TranscriptContainer-GJXPGREG.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-2CPKXRN6.mjs.map → chunk-5I6S5KWM.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-2WJQ67LB.mjs.map → react-surface-54E3UGAN.mjs.map} +0 -0
package/dist/lib/browser/{TranscriptContainer-N4KQHMY4.mjs → TranscriptContainer-HAZP6CA4.mjs}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TranscriptContainer_default,
|
|
3
3
|
TranscriptionContainer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7WGWZT65.mjs";
|
|
5
5
|
import "./chunk-QIHUPVQD.mjs";
|
|
6
6
|
export {
|
|
7
7
|
TranscriptionContainer,
|
|
8
8
|
TranscriptContainer_default as default
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=TranscriptContainer-
|
|
10
|
+
//# sourceMappingURL=TranscriptContainer-HAZP6CA4.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// packages/plugins/experimental/plugin-transcription/src/components/index.ts
|
|
2
2
|
import { lazy } from "react";
|
|
3
|
-
var TranscriptContainer = lazy(() => import("./TranscriptContainer-
|
|
3
|
+
var TranscriptContainer = lazy(() => import("./TranscriptContainer-HAZP6CA4.mjs"));
|
|
4
4
|
|
|
5
5
|
export {
|
|
6
6
|
TranscriptContainer
|
|
7
7
|
};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-6ZBM4EDB.mjs.map
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TRANSCRIPTION_PLUGIN,
|
|
3
|
+
TranscriptBlock
|
|
4
|
+
} from "./chunk-QIHUPVQD.mjs";
|
|
5
|
+
|
|
6
|
+
// packages/plugins/experimental/plugin-transcription/src/components/TranscriptContainer.tsx
|
|
7
|
+
import { pipe } from "effect";
|
|
8
|
+
import React2, { useCallback as useCallback2, useMemo as useMemo2, useState as useState2 } from "react";
|
|
9
|
+
import { chain, createIntent, LayoutAction, useIntentDispatcher } from "@dxos/app-framework";
|
|
10
|
+
import { Message } from "@dxos/artifact";
|
|
11
|
+
import { AIServiceEdgeClient, DEFAULT_LLM_MODEL, MixedStreamParser } from "@dxos/assistant";
|
|
12
|
+
import { create, fullyQualifiedId, getSpace, makeRef } from "@dxos/client/echo";
|
|
13
|
+
import { QueueImpl } from "@dxos/echo-db";
|
|
14
|
+
import { createStatic, isInstanceOf } from "@dxos/echo-schema";
|
|
15
|
+
import { invariant } from "@dxos/invariant";
|
|
16
|
+
import { DXN } from "@dxos/keys";
|
|
17
|
+
import { log as log2 } from "@dxos/log";
|
|
18
|
+
import { DocumentType } from "@dxos/plugin-markdown/types";
|
|
19
|
+
import { CollectionType, SpaceAction } from "@dxos/plugin-space/types";
|
|
20
|
+
import { useConfig } from "@dxos/react-client";
|
|
21
|
+
import { useEdgeClient, useQueue } from "@dxos/react-edge-client";
|
|
22
|
+
import { IconButton, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
23
|
+
import { StackItem } from "@dxos/react-ui-stack";
|
|
24
|
+
import { TextType } from "@dxos/schema";
|
|
25
|
+
|
|
26
|
+
// packages/plugins/experimental/plugin-transcription/src/components/Transcript/Transcript.tsx
|
|
27
|
+
import { intervalToDuration } from "date-fns/intervalToDuration";
|
|
28
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
29
|
+
import { useResizeDetector } from "react-resize-detector";
|
|
30
|
+
import { log } from "@dxos/log";
|
|
31
|
+
import { useAttention } from "@dxos/react-ui-attention";
|
|
32
|
+
import { Grid, toPlaneCellIndex } from "@dxos/react-ui-grid";
|
|
33
|
+
import { mx } from "@dxos/react-ui-theme";
|
|
34
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-transcription/src/components/Transcript/Transcript.tsx";
|
|
35
|
+
var timeWidth = 70;
|
|
36
|
+
var lineHeight = 24;
|
|
37
|
+
var cellSpacing = 12;
|
|
38
|
+
var authorClasses = "text-[16px] leading-[24px] dx-tag";
|
|
39
|
+
var segmentTextClasses = "text-[16px] leading-[24px] whitespace-pre-wrap break-words hyphens-none";
|
|
40
|
+
var Transcript = ({ attendableId, ignoreAttention, blocks }) => {
|
|
41
|
+
const { hasAttention } = useAttention(attendableId);
|
|
42
|
+
const { ref, width } = useResizeDetector();
|
|
43
|
+
const measureRef = useRef(null);
|
|
44
|
+
const textWidth = width ? width - timeWidth : 0;
|
|
45
|
+
const transcriptColumns = width ? {
|
|
46
|
+
grid: {
|
|
47
|
+
0: {
|
|
48
|
+
size: timeWidth
|
|
49
|
+
},
|
|
50
|
+
1: {
|
|
51
|
+
size: textWidth
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
} : void 0;
|
|
55
|
+
const transcriptRows = {
|
|
56
|
+
grid: {
|
|
57
|
+
size: lineHeight
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const [queueMap, setQueueMap] = useState([]);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (measureRef.current) {
|
|
63
|
+
void mapTranscriptQueue(measureRef.current, blocks, true).then((queueMap2) => {
|
|
64
|
+
setQueueMap(queueMap2);
|
|
65
|
+
if (measureRef.current) {
|
|
66
|
+
void mapTranscriptQueue(measureRef.current, blocks, false).then(setQueueMap);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}, [
|
|
71
|
+
blocks,
|
|
72
|
+
measureRef.current
|
|
73
|
+
]);
|
|
74
|
+
const rows = useMemo(() => ({
|
|
75
|
+
grid: queueMap.reduce((acc, row, rowIndex) => {
|
|
76
|
+
acc[rowIndex] = {
|
|
77
|
+
size: row[2]
|
|
78
|
+
};
|
|
79
|
+
return acc;
|
|
80
|
+
}, {})
|
|
81
|
+
}), [
|
|
82
|
+
queueMap
|
|
83
|
+
]);
|
|
84
|
+
const [dxGrid, setDxGrid] = useState(null);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (dxGrid && Array.isArray(blocks)) {
|
|
87
|
+
const start = blocks[0]?.segments[0]?.started ?? 0;
|
|
88
|
+
dxGrid.getCells = (range, plane) => {
|
|
89
|
+
switch (plane) {
|
|
90
|
+
case "grid": {
|
|
91
|
+
const cells = {};
|
|
92
|
+
for (let row = range.start.row; row <= range.end.row && row < queueMap.length; row++) {
|
|
93
|
+
const [blockIndex, segmentIndex] = queueMap[row];
|
|
94
|
+
const { author, segments } = blocks[blockIndex] ?? {
|
|
95
|
+
author: "",
|
|
96
|
+
segments: []
|
|
97
|
+
};
|
|
98
|
+
const { started: end, text } = segments[segmentIndex] ?? {
|
|
99
|
+
started: 0,
|
|
100
|
+
text: ""
|
|
101
|
+
};
|
|
102
|
+
cells[toPlaneCellIndex({
|
|
103
|
+
col: 0,
|
|
104
|
+
row
|
|
105
|
+
})] = segmentIndex === 0 ? {
|
|
106
|
+
readonly: true,
|
|
107
|
+
accessoryHtml: `<span class="pbs-1 text-xs text-neutral-500">${formatElapsed(start, end)}</span>`
|
|
108
|
+
} : {};
|
|
109
|
+
cells[toPlaneCellIndex({
|
|
110
|
+
col: 1,
|
|
111
|
+
row
|
|
112
|
+
})] = segmentIndex < 0 ? {
|
|
113
|
+
value: author,
|
|
114
|
+
readonly: true,
|
|
115
|
+
// TODO(burdon): Color based on username.
|
|
116
|
+
className: authorClasses
|
|
117
|
+
} : {
|
|
118
|
+
readonly: true,
|
|
119
|
+
accessoryHtml: `<div class="${segmentTextClasses}">${text.trim()}</div>`
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return cells;
|
|
123
|
+
}
|
|
124
|
+
default:
|
|
125
|
+
return {};
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}, [
|
|
130
|
+
dxGrid,
|
|
131
|
+
queueMap,
|
|
132
|
+
blocks
|
|
133
|
+
]);
|
|
134
|
+
const handleWheel = useCallback((event) => {
|
|
135
|
+
if (!ignoreAttention && !hasAttention) {
|
|
136
|
+
event.stopPropagation();
|
|
137
|
+
}
|
|
138
|
+
}, [
|
|
139
|
+
hasAttention,
|
|
140
|
+
ignoreAttention
|
|
141
|
+
]);
|
|
142
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
143
|
+
role: "none",
|
|
144
|
+
ref,
|
|
145
|
+
className: "grow"
|
|
146
|
+
}, transcriptColumns && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
147
|
+
className: "relative"
|
|
148
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
149
|
+
className: "absolute top-0 z-10 p-1 border invisible",
|
|
150
|
+
style: {
|
|
151
|
+
left: timeWidth,
|
|
152
|
+
width: transcriptColumns.grid["1"].size
|
|
153
|
+
}
|
|
154
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
155
|
+
ref: measureRef,
|
|
156
|
+
className: mx(segmentTextClasses)
|
|
157
|
+
}))), /* @__PURE__ */ React.createElement(Grid.Root, {
|
|
158
|
+
id: `${attendableId}--transcript`
|
|
159
|
+
}, /* @__PURE__ */ React.createElement(Grid.Content, {
|
|
160
|
+
ref: setDxGrid,
|
|
161
|
+
className: "[--dx-grid-base:var(--dx-baseSurface)] [--dx-grid-lines:var(--dx-baseSurface)] [&_.dx-grid]:min-bs-0 [&_.dx-grid]:select-auto",
|
|
162
|
+
columns: transcriptColumns,
|
|
163
|
+
rowDefault: transcriptRows,
|
|
164
|
+
rows,
|
|
165
|
+
limitColumns: 2,
|
|
166
|
+
limitRows: queueMap.length,
|
|
167
|
+
onWheel: handleWheel
|
|
168
|
+
}))));
|
|
169
|
+
};
|
|
170
|
+
var mapTranscriptQueue = async (div, blocks, estimate = false) => {
|
|
171
|
+
if (!blocks || !Array.isArray(blocks) || blocks.length === 0) {
|
|
172
|
+
return [];
|
|
173
|
+
} else {
|
|
174
|
+
const ts = Date.now();
|
|
175
|
+
await document.fonts.ready;
|
|
176
|
+
const rows = [];
|
|
177
|
+
let blockIndex = 0;
|
|
178
|
+
for (const block of blocks) {
|
|
179
|
+
rows.push([
|
|
180
|
+
blockIndex,
|
|
181
|
+
-1,
|
|
182
|
+
lineHeight + cellSpacing
|
|
183
|
+
]);
|
|
184
|
+
let segmentIndex = 0;
|
|
185
|
+
for (const segment of block.segments) {
|
|
186
|
+
const height = await measureSegment(div, segment.text, estimate);
|
|
187
|
+
rows.push([
|
|
188
|
+
blockIndex,
|
|
189
|
+
segmentIndex,
|
|
190
|
+
height + cellSpacing
|
|
191
|
+
]);
|
|
192
|
+
segmentIndex++;
|
|
193
|
+
}
|
|
194
|
+
blockIndex++;
|
|
195
|
+
}
|
|
196
|
+
log("render", {
|
|
197
|
+
duration: Date.now() - ts
|
|
198
|
+
}, {
|
|
199
|
+
F: __dxlog_file,
|
|
200
|
+
L: 196,
|
|
201
|
+
S: void 0,
|
|
202
|
+
C: (f, a) => f(...a)
|
|
203
|
+
});
|
|
204
|
+
return rows;
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
var measureSegment = async (div, text, estimate = false) => {
|
|
208
|
+
return new Promise((resolve) => {
|
|
209
|
+
div.innerHTML = text;
|
|
210
|
+
if (estimate) {
|
|
211
|
+
const { height } = div.getBoundingClientRect();
|
|
212
|
+
resolve(height);
|
|
213
|
+
} else {
|
|
214
|
+
requestAnimationFrame(() => {
|
|
215
|
+
const { height } = div.getBoundingClientRect();
|
|
216
|
+
resolve(height);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
var formatElapsed = (start, end) => {
|
|
222
|
+
const { hours, minutes, seconds } = intervalToDuration({
|
|
223
|
+
start,
|
|
224
|
+
end
|
|
225
|
+
});
|
|
226
|
+
const pad = (n = 0) => String(n).padStart(2, "0");
|
|
227
|
+
return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
// packages/plugins/experimental/plugin-transcription/src/components/TranscriptContainer.tsx
|
|
231
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-transcription/src/components/TranscriptContainer.tsx";
|
|
232
|
+
var TranscriptionContainer = ({ transcript }) => {
|
|
233
|
+
const { t } = useTranslation(TRANSCRIPTION_PLUGIN);
|
|
234
|
+
const edge = useEdgeClient();
|
|
235
|
+
const ai = useAiServiceClient();
|
|
236
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
237
|
+
const attendableId = fullyQualifiedId(transcript);
|
|
238
|
+
const queue = useQueue(edge, transcript.queue ? DXN.parse(transcript.queue) : void 0, {
|
|
239
|
+
pollInterval: 1e3
|
|
240
|
+
});
|
|
241
|
+
const [isSummarizing, setIsSummarizing] = useState2(false);
|
|
242
|
+
const handleSummarize = useCallback2(async () => {
|
|
243
|
+
setIsSummarizing(true);
|
|
244
|
+
try {
|
|
245
|
+
const document2 = await summarizeTranscript(edge, ai, transcript);
|
|
246
|
+
const space = getSpace(transcript);
|
|
247
|
+
const target = space?.properties[CollectionType.typename]?.target;
|
|
248
|
+
await dispatch(pipe(createIntent(SpaceAction.AddObject, {
|
|
249
|
+
object: document2,
|
|
250
|
+
target
|
|
251
|
+
}), chain(LayoutAction.Open, {
|
|
252
|
+
part: "main"
|
|
253
|
+
})));
|
|
254
|
+
} finally {
|
|
255
|
+
setIsSummarizing(false);
|
|
256
|
+
}
|
|
257
|
+
}, [
|
|
258
|
+
transcript,
|
|
259
|
+
edge
|
|
260
|
+
]);
|
|
261
|
+
return /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
262
|
+
toolbar: false,
|
|
263
|
+
classNames: "relative"
|
|
264
|
+
}, /* @__PURE__ */ React2.createElement(Toolbar.Root, {
|
|
265
|
+
classNames: "absolute block-start-1 inline-end-1 z-[1] is-min"
|
|
266
|
+
}, /* @__PURE__ */ React2.createElement(IconButton, {
|
|
267
|
+
icon: "ph--pen--regular",
|
|
268
|
+
size: 5,
|
|
269
|
+
disabled: isSummarizing,
|
|
270
|
+
onClick: handleSummarize,
|
|
271
|
+
label: t(isSummarizing ? "summarizing label" : "summary button")
|
|
272
|
+
})), /* @__PURE__ */ React2.createElement(Transcript, {
|
|
273
|
+
blocks: queue?.items,
|
|
274
|
+
attendableId
|
|
275
|
+
}));
|
|
276
|
+
};
|
|
277
|
+
var TranscriptContainer_default = TranscriptionContainer;
|
|
278
|
+
var summarizeTranscript = async (edge, ai, transcript) => {
|
|
279
|
+
invariant(transcript.queue, "No queue found for transcript", {
|
|
280
|
+
F: __dxlog_file2,
|
|
281
|
+
L: 80,
|
|
282
|
+
S: void 0,
|
|
283
|
+
A: [
|
|
284
|
+
"transcript.queue",
|
|
285
|
+
"'No queue found for transcript'"
|
|
286
|
+
]
|
|
287
|
+
});
|
|
288
|
+
const queue = new QueueImpl(edge, DXN.parse(transcript.queue));
|
|
289
|
+
await queue.refresh();
|
|
290
|
+
const content = queue.items.filter((block) => isInstanceOf(TranscriptBlock, block)).map((block) => `${block.author}: ${block.segments.map((segment) => segment.text).join("\n")}`).join("\n\n");
|
|
291
|
+
const parser = new MixedStreamParser();
|
|
292
|
+
log2.info("summarizing transcript", {
|
|
293
|
+
blockCount: queue.items.length
|
|
294
|
+
}, {
|
|
295
|
+
F: __dxlog_file2,
|
|
296
|
+
L: 91,
|
|
297
|
+
S: void 0,
|
|
298
|
+
C: (f, a) => f(...a)
|
|
299
|
+
});
|
|
300
|
+
const output = await parser.parse(await ai.exec({
|
|
301
|
+
model: DEFAULT_LLM_MODEL,
|
|
302
|
+
systemPrompt: SUMMARIZE_PROMPT,
|
|
303
|
+
history: [
|
|
304
|
+
createStatic(Message, {
|
|
305
|
+
role: "user",
|
|
306
|
+
content: [
|
|
307
|
+
{
|
|
308
|
+
type: "text",
|
|
309
|
+
text: content
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
})
|
|
313
|
+
]
|
|
314
|
+
}));
|
|
315
|
+
log2.info("transcript summary", {
|
|
316
|
+
output
|
|
317
|
+
}, {
|
|
318
|
+
F: __dxlog_file2,
|
|
319
|
+
L: 100,
|
|
320
|
+
S: void 0,
|
|
321
|
+
C: (f, a) => f(...a)
|
|
322
|
+
});
|
|
323
|
+
invariant(output[0].content[0].type === "text", "Expected text content", {
|
|
324
|
+
F: __dxlog_file2,
|
|
325
|
+
L: 101,
|
|
326
|
+
S: void 0,
|
|
327
|
+
A: [
|
|
328
|
+
"output[0].content[0].type === 'text'",
|
|
329
|
+
"'Expected text content'"
|
|
330
|
+
]
|
|
331
|
+
});
|
|
332
|
+
const summary = output[0].content[0].text;
|
|
333
|
+
const name = `Summary ${(transcript.started ?? /* @__PURE__ */ new Date()).toLocaleString("en-US", {
|
|
334
|
+
year: "numeric",
|
|
335
|
+
month: "long",
|
|
336
|
+
day: "numeric",
|
|
337
|
+
hour: "2-digit",
|
|
338
|
+
minute: "2-digit"
|
|
339
|
+
})}`;
|
|
340
|
+
return create(DocumentType, {
|
|
341
|
+
name,
|
|
342
|
+
content: makeRef(create(TextType, {
|
|
343
|
+
content: summary
|
|
344
|
+
})),
|
|
345
|
+
threads: []
|
|
346
|
+
});
|
|
347
|
+
};
|
|
348
|
+
var SUMMARIZE_PROMPT = `
|
|
349
|
+
# Goal
|
|
350
|
+
Create a markdown summary of the transcript provided.
|
|
351
|
+
|
|
352
|
+
# Formatting
|
|
353
|
+
- Format the summary as a markdown document without extra comments like "Here is the summary of the transcript:".
|
|
354
|
+
- Use markdown formatting for headings and bullet points.
|
|
355
|
+
- Format the summary as a list of key points and takeaways.
|
|
356
|
+
- All names of people should be in bold.
|
|
357
|
+
|
|
358
|
+
# Note Taking
|
|
359
|
+
- Correlate items in the summary with the person of origin to build a coherent narrative.
|
|
360
|
+
- Include short quotes verbatim where appropriate. Especially when concerned with design decisions and problem descriptions.
|
|
361
|
+
|
|
362
|
+
# Tasks
|
|
363
|
+
At the end of the summary include tasks.
|
|
364
|
+
Extract only the tasks that are:
|
|
365
|
+
- Directly actionable.
|
|
366
|
+
- Clearly assigned to a person or team (or can easily be inferred).
|
|
367
|
+
- Strongly implied by the conversation and/or user note (no speculative tasks).
|
|
368
|
+
- Specific enough that someone reading them would know exactly what to do next.
|
|
369
|
+
|
|
370
|
+
Format all tasks as markdown checkboxes using the syntax:
|
|
371
|
+
- [ ] Task description
|
|
372
|
+
|
|
373
|
+
Additional information can be included (indented).
|
|
374
|
+
|
|
375
|
+
If no actionable tasks are found, omit this tasks section.
|
|
376
|
+
`;
|
|
377
|
+
var useAiServiceClient = () => {
|
|
378
|
+
const config = useConfig();
|
|
379
|
+
const endpoint = config.values.runtime?.services?.ai?.server ?? "http://localhost:8788";
|
|
380
|
+
return useMemo2(() => new AIServiceEdgeClient({
|
|
381
|
+
endpoint
|
|
382
|
+
}), [
|
|
383
|
+
endpoint
|
|
384
|
+
]);
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
export {
|
|
388
|
+
Transcript,
|
|
389
|
+
formatElapsed,
|
|
390
|
+
TranscriptionContainer,
|
|
391
|
+
TranscriptContainer_default
|
|
392
|
+
};
|
|
393
|
+
//# sourceMappingURL=chunk-7WGWZT65.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/TranscriptContainer.tsx", "../../../src/components/Transcript/Transcript.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { pipe } from 'effect';\nimport React, { useCallback, useMemo, useState, type FC } from 'react';\n\nimport { chain, createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { Message } from '@dxos/artifact';\nimport { AIServiceEdgeClient, DEFAULT_LLM_MODEL, MixedStreamParser, type AIServiceClient } from '@dxos/assistant';\nimport { create, fullyQualifiedId, getSpace, makeRef } from '@dxos/client/echo';\nimport { QueueImpl } from '@dxos/echo-db';\nimport { createStatic, isInstanceOf } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { CollectionType, SpaceAction } from '@dxos/plugin-space/types';\nimport { useConfig } from '@dxos/react-client';\nimport { useEdgeClient, useQueue, type EdgeHttpClient } from '@dxos/react-edge-client';\nimport { IconButton, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { TextType } from '@dxos/schema';\n\nimport { Transcript } from './Transcript';\nimport { TRANSCRIPTION_PLUGIN } from '../meta';\nimport { TranscriptBlock, type TranscriptType } from '../types';\n\nexport const TranscriptionContainer: FC<{ transcript: TranscriptType }> = ({ transcript }) => {\n const { t } = useTranslation(TRANSCRIPTION_PLUGIN);\n const edge = useEdgeClient();\n const ai = useAiServiceClient();\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const attendableId = fullyQualifiedId(transcript);\n\n const queue = useQueue<TranscriptBlock>(edge, transcript.queue ? DXN.parse(transcript.queue) : undefined, {\n pollInterval: 1_000,\n });\n\n // TODO(dmaretskyi): Pending state and errors should be handled by the framework!!!\n const [isSummarizing, setIsSummarizing] = useState(false);\n const handleSummarize = useCallback(async () => {\n setIsSummarizing(true);\n try {\n const document = await summarizeTranscript(edge, ai, transcript);\n const space = getSpace(transcript);\n const target = space?.properties[CollectionType.typename]?.target;\n await dispatch(\n pipe(\n createIntent(SpaceAction.AddObject, { object: document, target }),\n chain(LayoutAction.Open, { part: 'main' }),\n ),\n );\n } finally {\n setIsSummarizing(false);\n }\n }, [transcript, edge]);\n\n // TODO(dmaretskyi): Move action to menu.\n return (\n <StackItem.Content toolbar={false} classNames='relative'>\n <Toolbar.Root classNames='absolute block-start-1 inline-end-1 z-[1] is-min'>\n <IconButton\n icon='ph--pen--regular'\n size={5}\n disabled={isSummarizing}\n onClick={handleSummarize}\n label={t(isSummarizing ? 'summarizing label' : 'summary button')}\n />\n </Toolbar.Root>\n <Transcript blocks={queue?.items} attendableId={attendableId} />\n </StackItem.Content>\n );\n};\n\nexport default TranscriptionContainer;\n\n// TODO(dmaretskyi): Extract to the new file once transcript refactoring has settled.\nconst summarizeTranscript = async (edge: EdgeHttpClient, ai: AIServiceClient, transcript: TranscriptType) => {\n invariant(transcript.queue, 'No queue found for transcript');\n\n const queue = new QueueImpl(edge, DXN.parse(transcript.queue));\n await queue.refresh();\n const content = queue.items\n .filter((block) => isInstanceOf(TranscriptBlock, block))\n .map((block) => `${block.author}: ${block.segments.map((segment) => segment.text).join('\\n')}`)\n .join('\\n\\n');\n\n const parser = new MixedStreamParser();\n\n log.info('summarizing transcript', { blockCount: queue.items.length });\n const output = await parser.parse(\n await ai.exec({\n model: DEFAULT_LLM_MODEL,\n systemPrompt: SUMMARIZE_PROMPT,\n history: [createStatic(Message, { role: 'user', content: [{ type: 'text', text: content }] })],\n }),\n );\n\n log.info('transcript summary', { output });\n invariant(output[0].content[0].type === 'text', 'Expected text content');\n const summary = output[0].content[0].text;\n\n // TODO(dmaretskyi): .started is missing.\n const name = `Summary ${(transcript.started ?? new Date()).toLocaleString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n })}`;\n\n return create(DocumentType, {\n name,\n content: makeRef(create(TextType, { content: summary })),\n threads: [],\n });\n};\n\n// TODO(dmaretskyi): Add example to set consistent structure for the summary.\nconst SUMMARIZE_PROMPT = `\n # Goal\n Create a markdown summary of the transcript provided.\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\n// TODO(dmaretskyi): Extract?\n// Also this conflicts with plugin automation providing the ai client via a capability. Need to reconcile.\nconst useAiServiceClient = (): AIServiceClient => {\n const config = useConfig();\n const endpoint = config.values.runtime?.services?.ai?.server ?? 'http://localhost:8788'; // TOOD(burdon): Standardize consts.\n return useMemo(() => new AIServiceEdgeClient({ endpoint }), [endpoint]);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { intervalToDuration } from 'date-fns/intervalToDuration';\nimport React, { type FC, useCallback, useEffect, useMemo, useRef, useState, type WheelEvent } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { log } from '@dxos/log';\nimport { useAttention } from '@dxos/react-ui-attention';\nimport {\n type DxGridCellValue,\n type DxGridElement,\n type DxGridAxisMeta,\n type DxGridPlaneCells,\n Grid,\n toPlaneCellIndex,\n} from '@dxos/react-ui-grid';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { type TranscriptBlock } from '../../types';\n\n// TODO(burdon): Actions (e.g., mark, summarize, translate, label, delete).\n\nconst timeWidth = 70;\nconst lineHeight = 24;\nconst cellSpacing = 12;\n\nconst authorClasses = 'text-[16px] leading-[24px] dx-tag';\n\n// NOTE: These classes are required for synchronous measurement.\nconst segmentTextClasses = 'text-[16px] leading-[24px] whitespace-pre-wrap break-words hyphens-none';\n\ntype QueueRows = [number, number, number][];\n\nexport type TranscriptProps = {\n attendableId?: string;\n ignoreAttention?: boolean;\n blocks?: TranscriptBlock[];\n};\n\nexport const Transcript: FC<TranscriptProps> = ({ attendableId, ignoreAttention, blocks }) => {\n const { hasAttention } = useAttention(attendableId);\n const { ref, width } = useResizeDetector();\n const measureRef = useRef<HTMLDivElement>(null);\n\n const textWidth = width ? width - timeWidth : 0;\n const transcriptColumns = width\n ? {\n grid: {\n 0: { size: timeWidth },\n 1: { size: textWidth },\n },\n }\n : undefined;\n\n const transcriptRows = {\n grid: { size: lineHeight },\n };\n\n const [queueMap, setQueueMap] = useState<QueueRows>([]);\n useEffect(() => {\n if (measureRef.current) {\n // TODO(burdon): Only measure rows that have changed. Cache other values.\n // TODO(burdon): Build into grid with estimated height and correct on the fly.\n void mapTranscriptQueue(measureRef.current, blocks, true).then((queueMap) => {\n setQueueMap(queueMap);\n if (measureRef.current) {\n void mapTranscriptQueue(measureRef.current, blocks, false).then(setQueueMap);\n }\n });\n }\n }, [blocks, measureRef.current]);\n\n const rows = useMemo(\n () =>\n ({\n grid: queueMap.reduce((acc: DxGridAxisMeta['grid'], row, rowIndex) => {\n acc[rowIndex] = { size: row[2] };\n return acc;\n }, {}),\n }) satisfies DxGridAxisMeta,\n [queueMap],\n );\n\n const [dxGrid, setDxGrid] = useState<DxGridElement | null>(null);\n useEffect(() => {\n if (dxGrid && Array.isArray(blocks)) {\n const start = blocks[0]?.segments[0]?.started ?? 0;\n\n dxGrid.getCells = (range, plane) => {\n switch (plane) {\n case 'grid': {\n const cells: DxGridPlaneCells = {};\n for (let row = range.start.row; row <= range.end.row && row < queueMap.length; row++) {\n const [blockIndex, segmentIndex] = queueMap[row];\n const { author, segments } = blocks[blockIndex] ?? { author: '', segments: [] };\n const { started: end, text } = segments[segmentIndex] ?? { started: 0, text: '' };\n\n cells[toPlaneCellIndex({ col: 0, row })] = (\n segmentIndex === 0\n ? {\n readonly: true,\n accessoryHtml: `<span class=\"pbs-1 text-xs text-neutral-500\">${formatElapsed(start, end)}</span>`,\n }\n : {}\n ) satisfies DxGridCellValue;\n\n cells[toPlaneCellIndex({ col: 1, row })] = (\n segmentIndex < 0\n ? {\n value: author,\n readonly: true,\n // TODO(burdon): Color based on username.\n className: authorClasses,\n }\n : {\n readonly: true,\n accessoryHtml: `<div class=\"${segmentTextClasses}\">${text.trim()}</div>`,\n }\n ) satisfies DxGridCellValue;\n }\n\n return cells;\n }\n default:\n return {};\n }\n };\n }\n }, [dxGrid, queueMap, blocks]);\n\n const handleWheel = useCallback(\n (event: WheelEvent) => {\n if (!ignoreAttention && !hasAttention) {\n event.stopPropagation();\n }\n },\n [hasAttention, ignoreAttention],\n );\n\n return (\n <div role='none' ref={ref} className='grow'>\n {transcriptColumns && (\n <>\n <div className='relative'>\n <div\n className='absolute top-0 z-10 p-1 border invisible'\n style={{ left: timeWidth, width: transcriptColumns.grid['1'].size }}\n >\n <div ref={measureRef} className={mx(segmentTextClasses)} />\n </div>\n </div>\n <Grid.Root id={`${attendableId}--transcript`}>\n <Grid.Content\n ref={setDxGrid}\n className='[--dx-grid-base:var(--dx-baseSurface)] [--dx-grid-lines:var(--dx-baseSurface)] [&_.dx-grid]:min-bs-0 [&_.dx-grid]:select-auto'\n columns={transcriptColumns}\n rowDefault={transcriptRows}\n rows={rows}\n limitColumns={2}\n limitRows={queueMap.length}\n onWheel={handleWheel}\n />\n </Grid.Root>\n </>\n )}\n </div>\n );\n};\n\nconst mapTranscriptQueue = async (\n div: HTMLDivElement,\n blocks?: TranscriptBlock[],\n estimate = false,\n): Promise<QueueRows> => {\n if (!blocks || !Array.isArray(blocks) || blocks.length === 0) {\n return [];\n } else {\n const ts = Date.now();\n await document.fonts.ready;\n\n const rows: QueueRows = [];\n let blockIndex = 0;\n for (const block of blocks) {\n rows.push([blockIndex, -1, lineHeight + cellSpacing]);\n let segmentIndex = 0;\n for (const segment of block.segments) {\n const height = await measureSegment(div, segment.text, estimate);\n rows.push([blockIndex, segmentIndex, height + cellSpacing]);\n segmentIndex++;\n }\n blockIndex++;\n }\n\n log('render', { duration: Date.now() - ts });\n return rows;\n\n // return blocks.flatMap((block, blockIndex) => {\n // return [\n // [blockIndex, -1, lineHeight + cellSpacing],\n // ...block.segments.map((segment, segmentIndex) => {\n // div.innerHTML = segment.text;\n // const height = measureSegmentSync(div, segment.text) + cellSpacing;\n // return [blockIndex, segmentIndex, height] as [number, number, number];\n // }),\n // ];\n // });\n }\n};\n\n// TODO(burdon): Occasional random measurement error (-1 actual lines).\n// const measureSegmentSync = (div: HTMLDivElement, text: string): number => {\n// div.innerHTML = text;\n// void div.offsetHeight;\n// return div.offsetHeight;\n// };\n\nconst measureSegment = async (div: HTMLDivElement, text: string, estimate = false): Promise<number> => {\n return new Promise((resolve) => {\n div.innerHTML = text;\n if (estimate) {\n const { height } = div.getBoundingClientRect();\n resolve(height);\n } else {\n requestAnimationFrame(() => {\n const { height } = div.getBoundingClientRect();\n resolve(height);\n });\n }\n });\n};\n\nexport const formatElapsed = (start: Date, end: Date) => {\n const { hours, minutes, seconds } = intervalToDuration({ start, end });\n const pad = (n = 0) => String(n).padStart(2, '0');\n return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,YAAY;AACrB,OAAOC,UAASC,eAAAA,cAAaC,WAAAA,UAASC,YAAAA,iBAAyB;AAE/D,SAASC,OAAOC,cAAcC,cAAcC,2BAA2B;AACvE,SAASC,eAAe;AACxB,SAASC,qBAAqBC,mBAAmBC,yBAA+C;AAChG,SAASC,QAAQC,kBAAkBC,UAAUC,eAAe;AAC5D,SAASC,iBAAiB;AAC1B,SAASC,cAAcC,oBAAoB;AAC3C,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,OAAAA,YAAW;AACpB,SAASC,oBAAoB;AAC7B,SAASC,gBAAgBC,mBAAmB;AAC5C,SAASC,iBAAiB;AAC1B,SAASC,eAAeC,gBAAqC;AAC7D,SAASC,YAAYC,SAASC,sBAAsB;AACpD,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;;;AClBzB,SAASC,0BAA0B;AACnC,OAAOC,SAAkBC,aAAaC,WAAWC,SAASC,QAAQC,gBAAiC;AACnG,SAASC,yBAAyB;AAElC,SAASC,WAAW;AACpB,SAASC,oBAAoB;AAC7B,SAKEC,MACAC,wBACK;AACP,SAASC,UAAU;;AAMnB,IAAMC,YAAY;AAClB,IAAMC,aAAa;AACnB,IAAMC,cAAc;AAEpB,IAAMC,gBAAgB;AAGtB,IAAMC,qBAAqB;AAUpB,IAAMC,aA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;YAAE2B,MAAM;YAAQlB,MAAMT;UAAQ;;MAAG,CAAA;;EAC7F,CAAA,CAAA;AAGFa,EAAAA,KAAIC,KAAK,sBAAsB;IAAEG;EAAO,GAAA;;;;;;AACxCpB,YAAUoB,OAAO,CAAA,EAAGjB,QAAQ,CAAA,EAAG2B,SAAS,QAAQ,yBAAA;;;;;;;;;AAChD,QAAMC,UAAUX,OAAO,CAAA,EAAGjB,QAAQ,CAAA,EAAGS;AAGrC,QAAMoB,OAAO,YAAYzF,WAAW0F,WAAW,oBAAIC,KAAAA,GAAQC,eAAe,SAAS;IACjFC,MAAM;IACNC,OAAO;IACPC,KAAK;IACLC,MAAM;IACNC,QAAQ;EACV,CAAA,CAAA;AAEA,SAAOC,OAAOC,cAAc;IAC1BV;IACA7B,SAASwC,QAAQF,OAAOG,UAAU;MAAEzC,SAAS4B;IAAQ,CAAA,CAAA;IACrDc,SAAS,CAAA;EACX,CAAA;AACF;AAGA,IAAMpB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCzB,IAAM3E,qBAAqB,MAAA;AACzB,QAAMgG,SAASC,UAAAA;AACf,QAAMC,WAAWF,OAAOG,OAAOC,SAASC,UAAUtG,IAAIuG,UAAU;AAChE,SAAOC,SAAQ,MAAM,IAAIC,oBAAoB;IAAEN;EAAS,CAAA,GAAI;IAACA;GAAS;AACxE;",
|
|
6
|
+
"names": ["pipe", "React", "useCallback", "useMemo", "useState", "chain", "createIntent", "LayoutAction", "useIntentDispatcher", "Message", "AIServiceEdgeClient", "DEFAULT_LLM_MODEL", "MixedStreamParser", "create", "fullyQualifiedId", "getSpace", "makeRef", "QueueImpl", "createStatic", "isInstanceOf", "invariant", "DXN", "log", "DocumentType", "CollectionType", "SpaceAction", "useConfig", "useEdgeClient", "useQueue", "IconButton", "Toolbar", "useTranslation", "StackItem", "TextType", "intervalToDuration", "React", "useCallback", "useEffect", "useMemo", "useRef", "useState", "useResizeDetector", "log", "useAttention", "Grid", "toPlaneCellIndex", "mx", "timeWidth", "lineHeight", "cellSpacing", "authorClasses", "segmentTextClasses", "Transcript", "attendableId", "ignoreAttention", "blocks", "hasAttention", "ref", "width", "measureRef", "textWidth", "transcriptColumns", "grid", "size", "undefined", "transcriptRows", "queueMap", "setQueueMap", "current", "mapTranscriptQueue", "then", "rows", "reduce", "acc", "row", "rowIndex", "dxGrid", "setDxGrid", "Array", "isArray", "start", "segments", "started", "getCells", "range", "plane", "cells", "end", "length", "blockIndex", "segmentIndex", "author", "text", "col", "readonly", "accessoryHtml", "formatElapsed", "value", "className", "trim", "handleWheel", "event", "stopPropagation", "div", "role", "style", "left", "Root", "id", "Content", "columns", "rowDefault", "limitColumns", "limitRows", "onWheel", "estimate", "ts", "Date", "now", "document", "fonts", "ready", "block", "push", "segment", "height", "measureSegment", "duration", "Promise", "resolve", "innerHTML", "getBoundingClientRect", "requestAnimationFrame", "hours", "minutes", "seconds", "pad", "n", "String", "padStart", "TranscriptionContainer", "transcript", "t", "useTranslation", "TRANSCRIPTION_PLUGIN", "edge", "useEdgeClient", "ai", "useAiServiceClient", "dispatchPromise", "dispatch", "useIntentDispatcher", "attendableId", "fullyQualifiedId", "queue", "useQueue", "DXN", "parse", "undefined", "pollInterval", "isSummarizing", "setIsSummarizing", "useState", "handleSummarize", "useCallback", "document", "summarizeTranscript", "space", "getSpace", "target", "properties", "CollectionType", "typename", "pipe", "createIntent", "SpaceAction", "AddObject", "object", "chain", "LayoutAction", "Open", "part", "React", "StackItem", "Content", "toolbar", "classNames", "Toolbar", "Root", "IconButton", "icon", "size", "disabled", "onClick", "label", "Transcript", "blocks", "items", "invariant", "QueueImpl", "refresh", "content", "filter", "block", "isInstanceOf", "TranscriptBlock", "map", "author", "segments", "segment", "text", "join", "parser", "MixedStreamParser", "log", "info", "blockCount", "length", "output", "exec", "model", "DEFAULT_LLM_MODEL", "systemPrompt", "SUMMARIZE_PROMPT", "history", "createStatic", "Message", "role", "type", "summary", "name", "started", "Date", "toLocaleString", "year", "month", "day", "hour", "minute", "create", "DocumentType", "makeRef", "TextType", "threads", "config", "useConfig", "endpoint", "values", "runtime", "services", "server", "useMemo", "AIServiceEdgeClient"]
|
|
7
|
+
}
|
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
} from "./chunk-GHTRJTEB.mjs";
|
|
4
4
|
import {
|
|
5
5
|
TranscriptContainer
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6ZBM4EDB.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Transcript,
|
|
9
|
-
TranscriptionContainer
|
|
10
|
-
|
|
9
|
+
TranscriptionContainer,
|
|
10
|
+
formatElapsed
|
|
11
|
+
} from "./chunk-7WGWZT65.mjs";
|
|
11
12
|
import {
|
|
12
13
|
TRANSCRIPTION_PLUGIN,
|
|
13
14
|
TRANSCRIPTION_URL,
|
|
@@ -29,7 +30,7 @@ var TranscriptionCapabilities;
|
|
|
29
30
|
// packages/plugins/experimental/plugin-transcription/src/capabilities/index.ts
|
|
30
31
|
var AppGraphBuilder = lazy(() => import("./app-graph-builder-ZSSJIFY7.mjs"));
|
|
31
32
|
var IntentResolver = lazy(() => import("./intent-resolver-RW6DEJC2.mjs"));
|
|
32
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
33
|
+
var ReactSurface = lazy(() => import("./react-surface-Q7TXDD4O.mjs"));
|
|
33
34
|
|
|
34
35
|
// packages/plugins/experimental/plugin-transcription/src/hooks/useAudioFile.ts
|
|
35
36
|
import { useEffect, useState } from "react";
|
|
@@ -678,7 +679,7 @@ var translations_default = [
|
|
|
678
679
|
"delete calls label": "Delete",
|
|
679
680
|
"delete button": "Delete",
|
|
680
681
|
"bookmark button": "Bookmark",
|
|
681
|
-
"summary button": "
|
|
682
|
+
"summary button": "Summarize",
|
|
682
683
|
"summarizing label": "Summarizing..."
|
|
683
684
|
}
|
|
684
685
|
}
|
|
@@ -751,6 +752,7 @@ export {
|
|
|
751
752
|
TranscriptionContainer,
|
|
752
753
|
TranscriptionManager,
|
|
753
754
|
TranscriptionPlugin,
|
|
755
|
+
formatElapsed,
|
|
754
756
|
meta,
|
|
755
757
|
useAudioFile,
|
|
756
758
|
useAudioTrack,
|