@dxos/plugin-transcription 0.7.5-staging.2ff1350
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/LICENSE +8 -0
- package/README.md +15 -0
- package/dist/lib/browser/TranscriptContainer-7J3JHI6Q.mjs +10 -0
- package/dist/lib/browser/TranscriptContainer-7J3JHI6Q.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-ZSSJIFY7.mjs +7 -0
- package/dist/lib/browser/app-graph-builder-ZSSJIFY7.mjs.map +7 -0
- package/dist/lib/browser/chunk-IHSLJZZ7.mjs +8 -0
- package/dist/lib/browser/chunk-IHSLJZZ7.mjs.map +7 -0
- package/dist/lib/browser/chunk-ORGZ2DWD.mjs +220 -0
- package/dist/lib/browser/chunk-ORGZ2DWD.mjs.map +7 -0
- package/dist/lib/browser/chunk-QIHUPVQD.mjs +80 -0
- package/dist/lib/browser/chunk-QIHUPVQD.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZMES3U2D.mjs +78 -0
- package/dist/lib/browser/chunk-ZMES3U2D.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +652 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/intent-resolver-EAR2TFK2.mjs +32 -0
- package/dist/lib/browser/intent-resolver-EAR2TFK2.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/react-surface-JM2F2QZC.mjs +26 -0
- package/dist/lib/browser/react-surface-JM2F2QZC.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +17 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/lib/node/TranscriptContainer-FFAQVGMS.cjs +31 -0
- package/dist/lib/node/TranscriptContainer-FFAQVGMS.cjs.map +7 -0
- package/dist/lib/node/app-graph-builder-YFBX3OTP.cjs +26 -0
- package/dist/lib/node/app-graph-builder-YFBX3OTP.cjs.map +7 -0
- package/dist/lib/node/chunk-JBN3P6ZF.cjs +97 -0
- package/dist/lib/node/chunk-JBN3P6ZF.cjs.map +7 -0
- package/dist/lib/node/chunk-JYADA35W.cjs +246 -0
- package/dist/lib/node/chunk-JYADA35W.cjs.map +7 -0
- package/dist/lib/node/chunk-UIHEGU6Q.cjs +103 -0
- package/dist/lib/node/chunk-UIHEGU6Q.cjs.map +7 -0
- package/dist/lib/node/chunk-Z5MTY2TU.cjs +40 -0
- package/dist/lib/node/chunk-Z5MTY2TU.cjs.map +7 -0
- package/dist/lib/node/index.cjs +661 -0
- package/dist/lib/node/index.cjs.map +7 -0
- package/dist/lib/node/intent-resolver-3KJZGGUQ.cjs +44 -0
- package/dist/lib/node/intent-resolver-3KJZGGUQ.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -0
- package/dist/lib/node/react-surface-Q676XPRP.cjs +49 -0
- package/dist/lib/node/react-surface-Q676XPRP.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +39 -0
- package/dist/lib/node/types/index.cjs.map +7 -0
- package/dist/lib/node-esm/TranscriptContainer-3BJ74CEQ.mjs +11 -0
- package/dist/lib/node-esm/TranscriptContainer-3BJ74CEQ.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-77GQG6UF.mjs +9 -0
- package/dist/lib/node-esm/app-graph-builder-77GQG6UF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-EQUSN55D.mjs +221 -0
- package/dist/lib/node-esm/chunk-EQUSN55D.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KEG3ME4O.mjs +82 -0
- package/dist/lib/node-esm/chunk-KEG3ME4O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-V3YAZI67.mjs +10 -0
- package/dist/lib/node-esm/chunk-V3YAZI67.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XYU6B73V.mjs +80 -0
- package/dist/lib/node-esm/chunk-XYU6B73V.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +653 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/intent-resolver-UGLYRD4X.mjs +33 -0
- package/dist/lib/node-esm/intent-resolver-UGLYRD4X.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/react-surface-XP3BJN4L.mjs +27 -0
- package/dist/lib/node-esm/react-surface-XP3BJN4L.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +18 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/TranscriptionPlugin.d.ts +2 -0
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +180 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +4 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +181 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/Transcript/Transcript.d.ts +7 -0
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -0
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +9 -0
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -0
- package/dist/types/src/components/Transcript/index.d.ts +2 -0
- package/dist/types/src/components/Transcript/index.d.ts.map +1 -0
- package/dist/types/src/components/TranscriptContainer.d.ts +7 -0
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +6 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/components/transcription.stories.d.ts +14 -0
- package/dist/types/src/components/transcription.stories.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +6 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useAudioFile.d.ts +7 -0
- package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -0
- package/dist/types/src/hooks/useAudioTrack.d.ts +5 -0
- package/dist/types/src/hooks/useAudioTrack.d.ts.map +1 -0
- package/dist/types/src/hooks/useIsSpeaking.d.ts +2 -0
- package/dist/types/src/hooks/useIsSpeaking.d.ts.map +1 -0
- package/dist/types/src/hooks/useTranscriber.d.ts +10 -0
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -0
- package/dist/types/src/hooks/useVoiceInput.d.ts +11 -0
- package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +7 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +11 -0
- package/dist/types/src/meta.d.ts.map +1 -0
- package/dist/types/src/sanity.test.d.ts +2 -0
- package/dist/types/src/sanity.test.d.ts.map +1 -0
- package/dist/types/src/transcriber/audio-recorder.d.ts +47 -0
- package/dist/types/src/transcriber/audio-recorder.d.ts.map +1 -0
- package/dist/types/src/transcriber/index.d.ts +4 -0
- package/dist/types/src/transcriber/index.d.ts.map +1 -0
- package/dist/types/src/transcriber/media-stream-recorder.d.ts +26 -0
- package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -0
- package/dist/types/src/transcriber/transcriber.d.ts +46 -0
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -0
- package/dist/types/src/transcriber/transcriber.test.d.ts +2 -0
- package/dist/types/src/transcriber/transcriber.test.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +40 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/schema.d.ts +63 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +28 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/src/util/array.d.ts +2 -0
- package/dist/types/src/util/array.d.ts.map +1 -0
- package/dist/types/src/util/get-time-str.d.ts +2 -0
- package/dist/types/src/util/get-time-str.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +5 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/monitor-audio-level.d.ts +6 -0
- package/dist/types/src/util/monitor-audio-level.d.ts.map +1 -0
- package/dist/types/src/util/random-queue-dxn.d.ts +3 -0
- package/dist/types/src/util/random-queue-dxn.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +93 -0
- package/src/TranscriptionPlugin.tsx +57 -0
- package/src/capabilities/app-graph-builder.ts +7 -0
- package/src/capabilities/capabilities.ts +12 -0
- package/src/capabilities/index.ts +11 -0
- package/src/capabilities/intent-resolver.ts +24 -0
- package/src/capabilities/react-surface.tsx +21 -0
- package/src/components/Transcript/Transcript.stories.tsx +65 -0
- package/src/components/Transcript/Transcript.tsx +69 -0
- package/src/components/Transcript/index.ts +5 -0
- package/src/components/TranscriptContainer.tsx +146 -0
- package/src/components/index.ts +10 -0
- package/src/components/transcription.stories.tsx +198 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/useAudioFile.ts +62 -0
- package/src/hooks/useAudioTrack.ts +35 -0
- package/src/hooks/useIsSpeaking.ts +77 -0
- package/src/hooks/useTranscriber.ts +62 -0
- package/src/hooks/useVoiceInput.ts +66 -0
- package/src/index.ts +11 -0
- package/src/meta.ts +17 -0
- package/src/sanity.test.ts +11 -0
- package/src/transcriber/audio-recorder.ts +56 -0
- package/src/transcriber/index.ts +7 -0
- package/src/transcriber/media-stream-recorder.ts +109 -0
- package/src/transcriber/transcriber.test.ts +230 -0
- package/src/transcriber/transcriber.ts +247 -0
- package/src/translations.ts +28 -0
- package/src/types/index.ts +6 -0
- package/src/types/schema.ts +60 -0
- package/src/types/types.ts +34 -0
- package/src/util/array.ts +14 -0
- package/src/util/get-time-str.ts +12 -0
- package/src/util/index.ts +8 -0
- package/src/util/monitor-audio-level.ts +58 -0
- package/src/util/random-queue-dxn.ts +9 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/index.ts", "../../../src/capabilities/capabilities.ts", "../../../src/hooks/useAudioFile.ts", "../../../src/hooks/useAudioTrack.ts", "../../../src/hooks/useIsSpeaking.ts", "../../../src/hooks/useTranscriber.ts", "../../../src/transcriber/media-stream-recorder.ts", "../../../src/transcriber/transcriber.ts", "../../../src/hooks/useVoiceInput.ts", "../../../src/TranscriptionPlugin.tsx", "../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\n\nimport { TRANSCRIPTION_PLUGIN } from '../meta';\n\nexport namespace TranscriptionCapabilities {\n // TODO(burdon): Currently this is just a marker; adapt useVoiceInput to use this.\n export const Transcription = defineCapability<null>(`${TRANSCRIPTION_PLUGIN}/capability/transcription`);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { log } from '@dxos/log';\n\nexport type UseAudioState = {\n audio?: HTMLAudioElement;\n stream?: MediaStream;\n track?: MediaStreamTrack;\n};\n\nexport const useAudioFile = (audioUrl: string): UseAudioState => {\n const [{ audio, stream, track }, setStream] = useState<UseAudioState>({});\n useEffect(() => {\n const t = setTimeout(async () => {\n const response = await fetch(audioUrl);\n const blob = await response.blob();\n const audio = new Audio();\n audio.src = URL.createObjectURL(blob);\n await new Promise<void>((resolve, reject) => {\n audio.addEventListener(\n 'error',\n (err) => {\n log.error('error', { err });\n reject(err);\n },\n { once: true },\n );\n audio.addEventListener(\n 'canplay',\n () => {\n log.info('starting...');\n resolve();\n },\n { once: true },\n );\n audio.load();\n });\n\n const ctx = new AudioContext();\n\n const destination = ctx.createMediaStreamDestination();\n destination.channelCount = 1;\n\n const source = ctx.createMediaElementSource(audio);\n source.connect(destination);\n\n setStream({\n audio,\n stream: destination.stream,\n track: destination.stream.getAudioTracks()[0],\n });\n });\n\n return () => clearTimeout(t);\n }, [audioUrl]);\n\n return { audio, stream, track };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\n/**\n *\n */\n// TODO(burdon): Reconcile with react-ui-sfx and plugin-calls.\nexport const useAudioTrack = (active?: boolean): MediaStreamTrack | undefined => {\n const [track, setTrack] = useState<MediaStreamTrack>();\n useEffect(() => {\n if (!active) {\n track?.stop();\n setTrack(undefined);\n return;\n }\n\n const initAudio = async () => {\n const audio = new Audio();\n audio.srcObject = await navigator.mediaDevices.getUserMedia({ audio: true });\n const [track] = audio.srcObject.getAudioTracks();\n if (track) {\n setTrack(track);\n }\n };\n\n if (active) {\n void initAudio();\n }\n }, [active]);\n\n return track;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { monitorAudioLevel } from '../util';\n\nexport const useIsSpeaking = (mediaStreamTrack?: MediaStreamTrack) => {\n const [isSpeaking, setIsSpeaking] = useState(false);\n\n // The audio level is monitored very rapidly, and we don't want\n // react involved in tracking the state because it causes way\n // too many re-renders. To work around this, we use the isSpeakingRef\n // to track the state and then sync it using another effect.\n const isSpeakingRef = useRef(isSpeaking);\n\n // this effect syncs the state on a 50ms interval\n useEffect(() => {\n if (!mediaStreamTrack) {\n setIsSpeaking(false);\n return;\n }\n\n isSpeakingRef.current = isSpeaking;\n const interval = window.setInterval(() => {\n // state is already in sync do nothing\n if (isSpeaking === isSpeakingRef.current) {\n return;\n }\n\n // sync state\n setIsSpeaking(isSpeakingRef.current);\n }, 50);\n\n return () => {\n clearInterval(interval);\n };\n }, [isSpeaking, isSpeakingRef, mediaStreamTrack]);\n\n useEffect(() => {\n if (!mediaStreamTrack) {\n return;\n }\n\n let timeout = -1;\n const cleanup = monitorAudioLevel({\n mediaStreamTrack,\n onMeasure: (vol) => {\n // Once the user has been determined to be speaking, we want\n // to lower the threshold because speech patterns don't always\n // kick up above 0.05\n const audioLevelAboveThreshold = vol > (isSpeakingRef.current ? 0.02 : 0.05);\n if (audioLevelAboveThreshold) {\n // user is still speaking, clear timeout & reset.\n clearTimeout(timeout);\n timeout = -1;\n // track state.\n isSpeakingRef.current = true;\n } else if (timeout === -1) {\n // user is not speaking and timeout is not set.\n timeout = window.setTimeout(() => {\n isSpeakingRef.current = false;\n // reset timeout\n timeout = -1;\n }, 1_000);\n }\n },\n });\n\n return () => {\n cleanup();\n };\n }, [isSpeaking, mediaStreamTrack]);\n\n return isSpeaking;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useMemo } from 'react';\n\nimport { MediaStreamRecorder, Transcriber, type TranscriberParams } from '../transcriber';\n\n// TODO(burdon): Move to config?\n\n/**\n * Length of the chunk in ms.\n */\nconst RECORD_INTERVAL = 200;\n\n/**\n * Number of chunks to save before the user starts speaking.\n */\nconst PREFIXED_CHUNKS_AMOUNT = 10;\n\n/**\n * Number of chunks to transcribe automatically after.\n * Combined should be mess than 25MB or whisper would fail.\n */\nconst TRANSCRIBE_AFTER_CHUNKS_AMOUNT = 50;\n\nexport type UseTranscriberProps = {\n audioStreamTrack?: MediaStreamTrack;\n onSegments?: TranscriberParams['onSegments'];\n};\n\n/**\n * Records audio while user is speaking and transcribes it after user is done speaking.\n */\nexport const useTranscriber = ({ audioStreamTrack, onSegments }: UseTranscriberProps) => {\n // Initialize audio transcription.\n const transcriber = useMemo<Transcriber | undefined>(() => {\n if (!onSegments || !audioStreamTrack) {\n return undefined;\n }\n\n return new Transcriber({\n config: {\n transcribeAfterChunksAmount: TRANSCRIBE_AFTER_CHUNKS_AMOUNT,\n prefixBufferChunksAmount: PREFIXED_CHUNKS_AMOUNT,\n },\n recorder: new MediaStreamRecorder({\n mediaStreamTrack: audioStreamTrack,\n interval: RECORD_INTERVAL,\n }),\n onSegments,\n });\n }, [audioStreamTrack, onSegments]);\n\n useEffect(() => {\n return () => {\n void transcriber?.close();\n };\n }, [transcriber]);\n\n return transcriber;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type IBlobEvent, type IMediaRecorder, MediaRecorder, register } from 'extendable-media-recorder';\nimport { WaveFile } from 'wavefile';\n\nimport { synchronized } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { trace } from '@dxos/tracing';\n\nimport { type WavConfig, type AudioChunk, type AudioRecorder } from './audio-recorder';\n\nlet initializingPromise: Promise<void> | undefined;\n\nconst initializeExtendableMediaRecorder = async () => {\n const { connect } = await import('extendable-media-recorder-wav-encoder');\n await register(await connect());\n};\n\n/**\n * Recorder that uses the MediaContext API and AudioNode API to record audio.\n *\n * It records MediaStream using https://www.npmjs.com/package/extendable-media-recorder.\n */\n@trace.resource()\nexport class MediaStreamRecorder implements AudioRecorder {\n private readonly _mediaStreamTrack: MediaStreamTrack;\n /**\n * Default MediaRecorder implementation do not support wav encoding.\n */\n private readonly _interval: number;\n private _mediaRecorder?: IMediaRecorder = undefined;\n private _header?: Uint8Array = undefined;\n private _onChunk?: (chunk: AudioChunk) => void;\n\n constructor({ mediaStreamTrack, interval }: { mediaStreamTrack: MediaStreamTrack; interval: number }) {\n this._mediaStreamTrack = mediaStreamTrack;\n this._interval = interval;\n }\n\n get wavConfig(): WavConfig {\n const settings = this._mediaStreamTrack.getSettings();\n return {\n channels: settings.channelCount ?? 1,\n sampleRate: settings.sampleRate ?? 16000,\n bitDepthCode: settings.sampleSize ? String(settings.sampleSize) : '16',\n };\n }\n\n setOnChunk(onChunk: (chunk: AudioChunk) => void): void {\n this._onChunk = onChunk;\n }\n\n async start() {\n await (initializingPromise ??= initializeExtendableMediaRecorder()).catch((err) =>\n log.info('initializeExtendableMediaRecorder', { err }),\n );\n\n if (!this._mediaRecorder) {\n const stream = new MediaStream([this._mediaStreamTrack]);\n this._mediaRecorder = new MediaRecorder(stream, { mimeType: 'audio/wav' });\n }\n\n if (this._mediaRecorder.state === 'recording') {\n return;\n }\n invariant(this._onChunk, 'MediaStreamRecorder: onChunk is not set');\n this._mediaRecorder.ondataavailable = (event) => this._ondataavailable(event);\n this._mediaRecorder.start(this._interval);\n }\n\n async stop() {\n if (this._mediaRecorder?.state !== 'recording') {\n return;\n }\n this._mediaRecorder.stop();\n }\n\n @synchronized\n private async _ondataavailable(event: IBlobEvent) {\n const blob = event.data;\n const uint8Array = new Uint8Array(await blob.arrayBuffer());\n\n // First chunk from the MediaRecorder has a header.\n const isHeader =\n uint8Array[0] === 0x52 && // R\n uint8Array[1] === 0x49 && // I\n uint8Array[2] === 0x46 && // F\n uint8Array[3] === 0x46; // F\n let wav: WaveFile;\n\n if (isHeader) {\n wav = new WaveFile(uint8Array);\n this._header = uint8Array.slice(0, 44);\n } else if (this._header) {\n wav = new WaveFile(new Uint8Array([...this._header, ...uint8Array]));\n } else {\n log.warn('MediaStreamRecorder: no header');\n return;\n }\n\n this._onChunk!({\n timestamp: Date.now(),\n data: wav.getSamples(),\n });\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { WaveFile } from 'wavefile';\n\nimport { DeferredTask, Trigger } from '@dxos/async';\nimport { type Context, LifecycleState, Resource } from '@dxos/context';\nimport { log } from '@dxos/log';\nimport { trace } from '@dxos/tracing';\n\nimport { type AudioRecorder, type AudioChunk } from './audio-recorder';\nimport { TRANSCRIPTION_URL, type TranscriptSegment } from '../types';\nimport { mergeFloat64Arrays } from '../util';\n\ntype WhisperWord = {\n word: string;\n\n /**\n * Time in seconds from the start of the audio.\n */\n start: number;\n\n /**\n * Time in seconds from the start of the audio.\n */\n end: number;\n};\n\ntype WhisperSegment = {\n text: string;\n\n /**\n * Time in seconds from the start of the audio.\n */\n start: number;\n\n /**\n * Time in seconds from the start of the audio.\n */\n end: number;\n\n /**\n * Probability of no speech in the segment.\n */\n no_speech_prob: number;\n\n words: WhisperWord[];\n};\n\nexport type TranscribeConfig = {\n /**\n * Number of chunks to transcribe automatically after.\n */\n transcribeAfterChunksAmount: number;\n\n /**\n * Number of chunks to save before the user starts speaking.\n * This is needed to catch the beginning of the user's speech.\n */\n prefixBufferChunksAmount: number;\n};\n\nexport type TranscriberParams = {\n config: TranscribeConfig;\n recorder: AudioRecorder;\n onSegments: (segments: TranscriptSegment[]) => Promise<void>;\n};\n\n/**\n * Handles transcription of audio chunks.\n * If user is not speaking, the last `minChunksAmount` chunks are saved and transcribed.\n * If user is speaking, the chunks are added to the buffer until the user is done talking.\n */\nexport class Transcriber extends Resource {\n private _audioChunks: AudioChunk[] = [];\n private _lastUsedTimestamp = 0;\n\n private readonly _openTrigger = new Trigger({ autoReset: true });\n\n private readonly _config: TranscribeConfig;\n private readonly _recorder: AudioRecorder;\n private readonly _onSegments: TranscriberParams['onSegments'];\n\n private _recording = false;\n private _transcribeTask?: DeferredTask = undefined;\n\n constructor({ config, recorder, onSegments }: TranscriberParams) {\n super();\n this._config = config;\n this._recorder = recorder;\n this._onSegments = onSegments;\n }\n\n protected override async _open(ctx: Context) {\n this._recorder.setOnChunk((chunk) => this._saveAudioChunk(chunk));\n await this._recorder.start();\n this._transcribeTask = new DeferredTask(ctx, async () => this._transcribe());\n this._openTrigger.wake();\n }\n\n protected override async _close() {\n this._recording = false;\n this._transcribeTask = undefined;\n await this._recorder.stop();\n }\n\n startChunksRecording() {\n if (this._lifecycleState !== LifecycleState.OPEN) {\n return;\n }\n this._recording = true;\n }\n\n stopChunksRecording() {\n if (this._lifecycleState !== LifecycleState.OPEN || !this._recording) {\n return;\n }\n this._recording = false;\n this._transcribeTask?.schedule();\n }\n\n private _saveAudioChunk(chunk: AudioChunk) {\n log('saving audio chunk', { chunk });\n this._audioChunks.push(chunk);\n\n // Clean the buffer if the user is not speaking and the transcription task is not scheduled.\n if (\n !this._recording &&\n (!this._transcribeTask || !this._transcribeTask.scheduled) &&\n this._audioChunks.length >= this._config.prefixBufferChunksAmount\n ) {\n this._audioChunks = this._dropOldChunks();\n } else if (this._audioChunks.length >= this._config.transcribeAfterChunksAmount && this._recording) {\n this._transcribeTask?.schedule();\n }\n }\n\n private async _transcribe() {\n log('transcribing', { chunks: this._audioChunks.length });\n const chunks = this._audioChunks;\n this._audioChunks = this._dropOldChunks();\n if (chunks.length === 0) {\n return;\n }\n\n const audio = await this._mergeAudioChunks(chunks);\n const segments = await this._fetchTranscription(audio);\n if (!Array.isArray(segments) || segments.length === 0) {\n return;\n }\n\n const alignedSegments = this._alignSegments(segments, chunks);\n if (alignedSegments.length > 0) {\n await this._onSegments(alignedSegments);\n }\n }\n\n private _dropOldChunks() {\n return this._config.prefixBufferChunksAmount > 0\n ? this._audioChunks.slice(-this._config.prefixBufferChunksAmount)\n : [];\n }\n\n @trace.span({ showInBrowserTimeline: true })\n private async _mergeAudioChunks(chunks: AudioChunk[]) {\n const file = new WaveFile();\n const wavConfig = this._recorder.wavConfig;\n\n file.fromScratch(\n wavConfig.channels,\n wavConfig.sampleRate,\n wavConfig.bitDepthCode,\n mergeFloat64Arrays(chunks.map(({ data }) => data)),\n );\n\n return file.toBase64();\n }\n\n @trace.span({ showInBrowserTimeline: true })\n private async _fetchTranscription(audio: string) {\n if (audio.length === 0) {\n this._audioChunks = [];\n throw new Error('No audio to send for transcribing');\n }\n\n const response = await fetch(`${TRANSCRIPTION_URL}/transcribe`, {\n method: 'POST',\n body: JSON.stringify({ audio }),\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n\n if (!response.ok) {\n this._audioChunks = [];\n throw new Error('Failed to transcribe');\n }\n\n const {\n segments,\n }: {\n segments: WhisperSegment[];\n } = await response.json();\n\n log.info('transcription response', {\n segments,\n string: segments.map((segments) => segments.text).join(' '),\n });\n\n return segments;\n }\n\n private _alignSegments(segments: WhisperSegment[], originalChunks: AudioChunk[]): TranscriptSegment[] {\n // Absolute zero for all relative timestamps in the segments.\n const zeroTimestamp = originalChunks.at(0)!.timestamp;\n\n const filteredSegments = segments\n // Use segments that end after the last used timestamp.\n // Segments could overlap, so we need to filter words that starts after the last used timestamp.\n .filter((segment) => zeroTimestamp + segment.end * 1_000 >= this._lastUsedTimestamp)\n // Use words that starts after the last used timestamp.\n .map((segment) => {\n const words = segment.words.filter((word) => zeroTimestamp + word.start * 1_000 >= this._lastUsedTimestamp);\n return {\n ...segment,\n words,\n text: words.map((word) => word.word).join(''),\n start: words.at(0)?.start ?? segment.end,\n };\n })\n .filter((segment) => segment.words.length > 0);\n\n if (filteredSegments.length === 0) {\n return [];\n }\n\n // Update last timestamp.\n this._lastUsedTimestamp = zeroTimestamp + filteredSegments.at(-1)!.end * 1_000;\n\n // Add absolute timestamp to each segment.\n return filteredSegments.map((segment) => ({\n started: new Date(zeroTimestamp + segment.start * 1_000),\n text: segment.text,\n }));\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useState, useEffect, useCallback } from 'react';\n\nimport { scheduleMicroTask } from '@dxos/async';\nimport { Context } from '@dxos/context';\nimport { log } from '@dxos/log';\nimport { useSoundEffect } from '@dxos/react-ui-sfx';\n\nimport { useAudioTrack } from './useAudioTrack';\nimport { useTranscriber } from './useTranscriber';\nimport { type TranscriberParams } from '../transcriber';\n\nexport type UseVoiceInputProps = {\n active?: boolean;\n onUpdate: (text: string) => void;\n};\n\n/**\n * Hook for voice input.\n */\nexport const useVoiceInput = ({ active, onUpdate }: UseVoiceInputProps) => {\n const soundStart = useSoundEffect('StartRecording');\n const soundStop = useSoundEffect('StopRecording');\n\n const handleSegments = useCallback<TranscriberParams['onSegments']>(async (segments) => {\n const text = segments.map((str) => str.text.trim().replace(/[^\\w\\s]/g, '')).join(' ');\n onUpdate(text);\n }, []);\n\n // Audio/transcription.\n const [recording, setRecording] = useState(false);\n const track = useAudioTrack(active);\n const transcriber = useTranscriber({\n audioStreamTrack: track,\n onSegments: handleSegments,\n });\n\n // Start/stop transcription.\n useEffect(() => {\n const ctx = new Context();\n scheduleMicroTask(ctx, async () => {\n if (active && transcriber) {\n await transcriber.open();\n log.info('starting...');\n setRecording(true);\n void soundStart.play();\n transcriber.startChunksRecording();\n } else if (!active && transcriber?.isOpen) {\n transcriber?.stopChunksRecording();\n await transcriber?.close();\n log.info('stopped');\n setRecording(false);\n void soundStop.play();\n }\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [active, transcriber]);\n\n return { recording };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\n\nimport { AppGraphBuilder, IntentResolver, ReactSurface, TranscriptionCapabilities } from './capabilities';\nimport { meta, TRANSCRIPTION_PLUGIN } from './meta';\nimport translations from './translations';\nimport { TranscriptType } from './types';\n\nexport const TranscriptionPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/transcription`,\n activatesOn: Events.Startup,\n activate: () => contributes(TranscriptionCapabilities.Transcription, null),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: TranscriptType.typename,\n metadata: {\n placeholder: ['transcript title placeholder', { ns: TRANSCRIPTION_PLUGIN }],\n icon: 'ph--subtitles--regular',\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => [contributes(ClientCapabilities.Schema, [TranscriptType])],\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { TRANSCRIPTION_PLUGIN } from './meta';\nimport { TranscriptType } from './types';\n\nexport default [\n {\n 'en-US': {\n [TranscriptType.typename]: {\n 'typename label': 'Transcript',\n },\n [TRANSCRIPTION_PLUGIN]: {\n 'plugin name': 'Transcription',\n 'calls label': 'Transcript',\n 'calls panel label': 'Transcription',\n 'create calls label': 'Create transcription',\n 'delete calls label': 'Delete',\n\n 'delete button': 'Delete',\n 'bookmark button': 'Bookmark',\n 'summary button': 'Create summary',\n 'summarizing label': 'Summarizing...',\n },\n },\n },\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAAqB;ACArB,IAAAA,wBAAiC;ACAjC,mBAAoC;AAEpC,iBAAoB;ACFpB,IAAAC,gBAAoC;ACApC,IAAAA,gBAA4C;ACA5C,IAAAA,gBAAmC;ACAnC,uCAA8E;AAC9E,sBAAyB;AAEzB,mBAA6B;AAC7B,uBAA0B;AAC1B,IAAAC,cAAoB;AACpB,qBAAsB;ACNtB,IAAAC,mBAAyB;AAEzB,IAAAC,gBAAsC;AACtC,qBAAuD;AACvD,IAAAF,cAAoB;AACpB,IAAAG,kBAAsB;ACLtB,IAAAJ,gBAAiD;AAEjD,IAAAG,gBAAkC;AAClC,IAAAE,kBAAwB;AACxB,IAAAJ,cAAoB;AACpB,0BAA+B;ACL/B,IAAAF,wBAA8E;AAC9E,2BAAiD;;URGhCO,4BAAAA;6BAEFC,oBAAgBC,wCAAuB,GAAGC,0CAAAA,2BAA+C;AACxG,GAHiBH,8BAAAA,4BAAAA,CAAAA,EAAAA;ADFV,IAAMI,sBAAkBC,2BAAK,MAAM,OAAO,kCAAA,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ACAhB,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAae,kCAAaC;IAC1Bb,UAAU,MAAM;UAACC,mCAAYa,wCAAmBC,QAAQ;QAACzB;OAAe;;EAC1E,CAAA;MACAK,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,6BAAOkB;IACpBhB,UAAU1N;EACZ,CAAA;MACAqN,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,6BAAOmB;IACpBjB,UAAU3N;EACZ,CAAA;MACAsN,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,6BAAOoB;IACpBlB,UAAU7N;EACZ,CAAA;CACD;",
|
|
6
|
+
"names": ["import_app_framework", "import_react", "import_log", "import_wavefile", "import_async", "import_tracing", "import_context", "TranscriptionCapabilities", "Transcription", "defineCapability", "TRANSCRIPTION_PLUGIN", "AppGraphBuilder", "lazy", "IntentResolver", "ReactSurface", "useAudioFile", "audioUrl", "audio", "stream", "track", "setStream", "useState", "useEffect", "t", "setTimeout", "response", "fetch", "blob", "Audio", "src", "URL", "createObjectURL", "Promise", "resolve", "reject", "addEventListener", "err", "log", "error", "once", "info", "load", "ctx", "AudioContext", "destination", "createMediaStreamDestination", "channelCount", "source", "createMediaElementSource", "connect", "getAudioTracks", "clearTimeout", "useAudioTrack", "active", "setTrack", "stop", "undefined", "initAudio", "srcObject", "navigator", "mediaDevices", "getUserMedia", "useIsSpeaking", "mediaStreamTrack", "isSpeaking", "setIsSpeaking", "isSpeakingRef", "useRef", "current", "interval", "window", "setInterval", "clearInterval", "timeout", "cleanup", "monitorAudioLevel", "onMeasure", "vol", "audioLevelAboveThreshold", "initializingPromise", "initializeExtendableMediaRecorder", "register", "MediaStreamRecorder", "constructor", "_mediaRecorder", "_header", "_mediaStreamTrack", "_interval", "wavConfig", "settings", "getSettings", "channels", "sampleRate", "bitDepthCode", "sampleSize", "String", "setOnChunk", "onChunk", "_onChunk", "start", "catch", "MediaStream", "MediaRecorder", "mimeType", "state", "invariant", "ondataavailable", "event", "_ondataavailable", "data", "uint8Array", "Uint8Array", "arrayBuffer", "isHeader", "wav", "WaveFile", "slice", "warn", "timestamp", "Date", "now", "getSamples", "synchronized", "trace", "resource", "Transcriber", "Resource", "config", "recorder", "onSegments", "_audioChunks", "_lastUsedTimestamp", "_openTrigger", "Trigger", "autoReset", "_recording", "_transcribeTask", "_config", "_recorder", "_onSegments", "_open", "chunk", "_saveAudioChunk", "DeferredTask", "_transcribe", "wake", "_close", "startChunksRecording", "_lifecycleState", "LifecycleState", "OPEN", "stopChunksRecording", "schedule", "push", "scheduled", "length", "prefixBufferChunksAmount", "_dropOldChunks", "transcribeAfterChunksAmount", "chunks", "_mergeAudioChunks", "segments", "_fetchTranscription", "Array", "isArray", "alignedSegments", "_alignSegments", "file", "fromScratch", "mergeFloat64Arrays", "map", "toBase64", "Error", "TRANSCRIPTION_URL", "method", "body", "JSON", "stringify", "headers", "ok", "json", "string", "text", "join", "originalChunks", "zeroTimestamp", "at", "filteredSegments", "filter", "segment", "end", "words", "word", "started", "span", "showInBrowserTimeline", "RECORD_INTERVAL", "PREFIXED_CHUNKS_AMOUNT", "TRANSCRIBE_AFTER_CHUNKS_AMOUNT", "useTranscriber", "audioStreamTrack", "transcriber", "useMemo", "close", "useVoiceInput", "onUpdate", "soundStart", "useSoundEffect", "soundStop", "handleSegments", "useCallback", "str", "trim", "replace", "recording", "setRecording", "Context", "scheduleMicroTask", "open", "play", "isOpen", "dispose", "TranscriptType", "typename", "TranscriptionPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "Startup", "SetupMetadata", "Metadata", "metadata", "placeholder", "ns", "icon", "ClientEvents", "SetupSchema", "ClientCapabilities", "Schema", "SetupReactSurface", "SetupIntentResolver", "SetupAppGraph"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var intent_resolver_3KJZGGUQ_exports = {};
|
|
20
|
+
__export(intent_resolver_3KJZGGUQ_exports, {
|
|
21
|
+
default: () => intent_resolver_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(intent_resolver_3KJZGGUQ_exports);
|
|
24
|
+
var import_chunk_JBN3P6ZF = require("./chunk-JBN3P6ZF.cjs");
|
|
25
|
+
var import_chunk_UIHEGU6Q = require("./chunk-UIHEGU6Q.cjs");
|
|
26
|
+
var import_app_framework = require("@dxos/app-framework");
|
|
27
|
+
var import_live_object = require("@dxos/live-object");
|
|
28
|
+
var intent_resolver_default = (context) => (0, import_app_framework.contributes)(import_app_framework.Capabilities.IntentResolver, [
|
|
29
|
+
(0, import_app_framework.createResolver)({
|
|
30
|
+
intent: import_chunk_UIHEGU6Q.TranscriptionAction.Create,
|
|
31
|
+
resolve: ({ name }) => {
|
|
32
|
+
const transcript = (0, import_live_object.create)(import_chunk_UIHEGU6Q.TranscriptType, {
|
|
33
|
+
queue: (0, import_chunk_JBN3P6ZF.randomQueueDxn)().toString(),
|
|
34
|
+
name: name ?? `Transcript ${(0, import_chunk_JBN3P6ZF.getTimeStr)(Date.now())}`
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
data: {
|
|
38
|
+
object: transcript
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
]);
|
|
44
|
+
//# sourceMappingURL=intent-resolver-3KJZGGUQ.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createResolver, type PluginsContext } from '@dxos/app-framework';\nimport { create } from '@dxos/live-object';\n\nimport { TranscriptionAction, TranscriptType } from '../types';\nimport { getTimeStr, randomQueueDxn } from '../util';\n\nexport default (context: PluginsContext) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: TranscriptionAction.Create,\n resolve: ({ name }) => {\n const transcript = create(TranscriptType, {\n queue: randomQueueDxn().toString(), // TODO(burdon): Associate with space.\n name: name ?? `Transcript ${getTimeStr(Date.now())}`,\n });\n\n return { data: { object: transcript } };\n },\n }),\n ]);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA+E;AAC/E,yBAAuB;AAKvB,IAAA,0BAAe,CAACA,gBACdC,kCAAYC,kCAAaC,gBAAgB;MACvCC,qCAAe;IACbC,QAAQC,0CAAoBC;IAC5BC,SAAS,CAAC,EAAEC,KAAI,MAAE;AAChB,YAAMC,iBAAaC,2BAAOC,sCAAgB;QACxCC,WAAOC,sCAAAA,EAAiBC,SAAQ;QAChCN,MAAMA,QAAQ,kBAAcO,kCAAWC,KAAKC,IAAG,CAAA,CAAA;MACjD,CAAA;AAEA,aAAO;QAAEC,MAAM;UAAEC,QAAQV;QAAW;MAAE;IACxC;EACF,CAAA;CACD;",
|
|
6
|
+
"names": ["context", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "TranscriptionAction", "Create", "resolve", "name", "transcript", "create", "TranscriptType", "queue", "randomQueueDxn", "toString", "getTimeStr", "Date", "now", "data", "object"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"packages/plugins/experimental/plugin-transcription/src/meta.ts":{"bytes":1793,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/capabilities/capabilities.ts":{"bytes":1709,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/capabilities/app-graph-builder.ts":{"bytes":1075,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/types/schema.ts":{"bytes":5111,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/types/types.ts":{"bytes":3851,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/experimental/plugin-transcription/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/types/index.ts":{"bytes":607,"imports":[{"path":"packages/plugins/experimental/plugin-transcription/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/experimental/plugin-transcription/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/util/array.ts":{"bytes":1600,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/util/get-time-str.ts":{"bytes":1354,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/util/monitor-audio-level.ts":{"bytes":5995,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/util/random-queue-dxn.ts":{"bytes":1462,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/util/index.ts":{"bytes":851,"imports":[{"path":"packages/plugins/experimental/plugin-transcription/src/util/array.ts","kind":"import-statement","original":"./array"},{"path":"packages/plugins/experimental/plugin-transcription/src/util/get-time-str.ts","kind":"import-statement","original":"./get-time-str"},{"path":"packages/plugins/experimental/plugin-transcription/src/util/monitor-audio-level.ts","kind":"import-statement","original":"./monitor-audio-level"},{"path":"packages/plugins/experimental/plugin-transcription/src/util/random-queue-dxn.ts","kind":"import-statement","original":"./random-queue-dxn"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/capabilities/intent-resolver.ts":{"bytes":3274,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/types/index.ts","kind":"import-statement","original":"../types"},{"path":"packages/plugins/experimental/plugin-transcription/src/util/index.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/components/Transcript/Transcript.tsx":{"bytes":7670,"imports":[{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/components/Transcript/index.ts":{"bytes":550,"imports":[{"path":"packages/plugins/experimental/plugin-transcription/src/components/Transcript/Transcript.tsx","kind":"import-statement","original":"./Transcript"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/components/TranscriptContainer.tsx":{"bytes":20662,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-edge-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-components","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/components/Transcript/index.ts","kind":"import-statement","original":"./Transcript"},{"path":"packages/plugins/experimental/plugin-transcription/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/experimental/plugin-transcription/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/components/index.ts":{"bytes":1062,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/components/Transcript/index.ts","kind":"import-statement","original":"./Transcript"},{"path":"packages/plugins/experimental/plugin-transcription/src/components/TranscriptContainer.tsx","kind":"import-statement","original":"./TranscriptContainer"},{"path":"packages/plugins/experimental/plugin-transcription/src/components/TranscriptContainer.tsx","kind":"dynamic-import","original":"./TranscriptContainer"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/capabilities/react-surface.tsx":{"bytes":2737,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/experimental/plugin-transcription/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/experimental/plugin-transcription/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/capabilities/index.ts":{"bytes":1473,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/capabilities/capabilities.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/experimental/plugin-transcription/src/capabilities/app-graph-builder.ts","kind":"dynamic-import","original":"./app-graph-builder"},{"path":"packages/plugins/experimental/plugin-transcription/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/experimental/plugin-transcription/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/hooks/useAudioFile.ts":{"bytes":6346,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/hooks/useAudioTrack.ts":{"bytes":3162,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/hooks/useIsSpeaking.ts":{"bytes":7780,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/util/index.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/transcriber/audio-recorder.ts":{"bytes":3252,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/transcriber/media-stream-recorder.ts":{"bytes":13121,"imports":[{"path":"extendable-media-recorder","kind":"import-statement","external":true},{"path":"wavefile","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"extendable-media-recorder-wav-encoder","kind":"dynamic-import","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/transcriber/transcriber.ts":{"bytes":24141,"imports":[{"path":"wavefile","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/types/index.ts","kind":"import-statement","original":"../types"},{"path":"packages/plugins/experimental/plugin-transcription/src/util/index.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/transcriber/index.ts":{"bytes":772,"imports":[{"path":"packages/plugins/experimental/plugin-transcription/src/transcriber/audio-recorder.ts","kind":"import-statement","original":"./audio-recorder"},{"path":"packages/plugins/experimental/plugin-transcription/src/transcriber/media-stream-recorder.ts","kind":"import-statement","original":"./media-stream-recorder"},{"path":"packages/plugins/experimental/plugin-transcription/src/transcriber/transcriber.ts","kind":"import-statement","original":"./transcriber"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/hooks/useTranscriber.ts":{"bytes":5265,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/transcriber/index.ts","kind":"import-statement","original":"../transcriber"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/hooks/useVoiceInput.ts":{"bytes":7280,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui-sfx","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/hooks/useAudioTrack.ts","kind":"import-statement","original":"./useAudioTrack"},{"path":"packages/plugins/experimental/plugin-transcription/src/hooks/useTranscriber.ts","kind":"import-statement","original":"./useTranscriber"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/hooks/index.ts":{"bytes":957,"imports":[{"path":"packages/plugins/experimental/plugin-transcription/src/hooks/useAudioFile.ts","kind":"import-statement","original":"./useAudioFile"},{"path":"packages/plugins/experimental/plugin-transcription/src/hooks/useAudioTrack.ts","kind":"import-statement","original":"./useAudioTrack"},{"path":"packages/plugins/experimental/plugin-transcription/src/hooks/useIsSpeaking.ts","kind":"import-statement","original":"./useIsSpeaking"},{"path":"packages/plugins/experimental/plugin-transcription/src/hooks/useTranscriber.ts","kind":"import-statement","original":"./useTranscriber"},{"path":"packages/plugins/experimental/plugin-transcription/src/hooks/useVoiceInput.ts","kind":"import-statement","original":"./useVoiceInput"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/translations.ts":{"bytes":2603,"imports":[{"path":"packages/plugins/experimental/plugin-transcription/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-transcription/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/TranscriptionPlugin.tsx":{"bytes":7960,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/experimental/plugin-transcription/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-transcription/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-transcription/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-transcription/src/index.ts":{"bytes":1011,"imports":[{"path":"packages/plugins/experimental/plugin-transcription/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/experimental/plugin-transcription/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-transcription/src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"packages/plugins/experimental/plugin-transcription/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-transcription/src/transcriber/index.ts","kind":"import-statement","original":"./transcriber"},{"path":"packages/plugins/experimental/plugin-transcription/src/TranscriptionPlugin.tsx","kind":"import-statement","original":"./TranscriptionPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-transcription/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":38189},"packages/plugins/experimental/plugin-transcription/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-JBN3P6ZF.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-Z5MTY2TU.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-JYADA35W.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-UIHEGU6Q.cjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/app-graph-builder-YFBX3OTP.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/intent-resolver-3KJZGGUQ.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/react-surface-Q676XPRP.cjs","kind":"dynamic-import"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"extendable-media-recorder","kind":"import-statement","external":true},{"path":"wavefile","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"extendable-media-recorder-wav-encoder","kind":"dynamic-import","external":true},{"path":"wavefile","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui-sfx","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true}],"exports":["AppGraphBuilder","IntentResolver","MediaStreamRecorder","ReactSurface","TRANSCRIPTION_PLUGIN","Transcriber","Transcript","TranscriptContainer","TranscriptionCapabilities","TranscriptionContainer","TranscriptionPlugin","meta","useAudioFile","useAudioTrack","useIsSpeaking","useTranscriber","useVoiceInput"],"entryPoint":"packages/plugins/experimental/plugin-transcription/src/index.ts","inputs":{"packages/plugins/experimental/plugin-transcription/src/capabilities/index.ts":{"bytesInOutput":268},"packages/plugins/experimental/plugin-transcription/src/capabilities/capabilities.ts":{"bytesInOutput":309},"packages/plugins/experimental/plugin-transcription/src/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-transcription/src/hooks/useAudioFile.ts":{"bytesInOutput":1681},"packages/plugins/experimental/plugin-transcription/src/hooks/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-transcription/src/hooks/useAudioTrack.ts":{"bytesInOutput":628},"packages/plugins/experimental/plugin-transcription/src/hooks/useIsSpeaking.ts":{"bytesInOutput":1387},"packages/plugins/experimental/plugin-transcription/src/hooks/useTranscriber.ts":{"bytesInOutput":848},"packages/plugins/experimental/plugin-transcription/src/transcriber/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-transcription/src/transcriber/media-stream-recorder.ts":{"bytesInOutput":3707},"packages/plugins/experimental/plugin-transcription/src/transcriber/transcriber.ts":{"bytesInOutput":5593},"packages/plugins/experimental/plugin-transcription/src/hooks/useVoiceInput.ts":{"bytesInOutput":1882},"packages/plugins/experimental/plugin-transcription/src/TranscriptionPlugin.tsx":{"bytesInOutput":1623},"packages/plugins/experimental/plugin-transcription/src/translations.ts":{"bytesInOutput":565}},"bytes":20359},"packages/plugins/experimental/plugin-transcription/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-transcription/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-UIHEGU6Q.cjs","kind":"import-statement"}],"exports":["TRANSCRIPTION_URL","TranscriptBlock","TranscriptSchema","TranscriptType","TranscriptionAction","isTranscript"],"entryPoint":"packages/plugins/experimental/plugin-transcription/src/types/index.ts","inputs":{},"bytes":320},"packages/plugins/experimental/plugin-transcription/dist/lib/node/app-graph-builder-YFBX3OTP.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":536},"packages/plugins/experimental/plugin-transcription/dist/lib/node/app-graph-builder-YFBX3OTP.cjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-transcription/src/capabilities/app-graph-builder.ts","inputs":{"packages/plugins/experimental/plugin-transcription/src/capabilities/app-graph-builder.ts":{"bytesInOutput":157}},"bytes":356},"packages/plugins/experimental/plugin-transcription/dist/lib/node/intent-resolver-3KJZGGUQ.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1617},"packages/plugins/experimental/plugin-transcription/dist/lib/node/intent-resolver-3KJZGGUQ.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-JBN3P6ZF.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-UIHEGU6Q.cjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-transcription/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/experimental/plugin-transcription/src/capabilities/intent-resolver.ts":{"bytesInOutput":558}},"bytes":903},"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-JBN3P6ZF.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5084},"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-JBN3P6ZF.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true}],"exports":["getTimeStr","mergeFloat64Arrays","monitorAudioLevel","randomQueueDxn"],"inputs":{"packages/plugins/experimental/plugin-transcription/src/util/get-time-str.ts":{"bytesInOutput":195},"packages/plugins/experimental/plugin-transcription/src/util/random-queue-dxn.ts":{"bytesInOutput":231},"packages/plugins/experimental/plugin-transcription/src/util/array.ts":{"bytesInOutput":267},"packages/plugins/experimental/plugin-transcription/src/util/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-transcription/src/util/monitor-audio-level.ts":{"bytesInOutput":1264}},"bytes":2411},"packages/plugins/experimental/plugin-transcription/dist/lib/node/TranscriptContainer-FFAQVGMS.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-transcription/dist/lib/node/TranscriptContainer-FFAQVGMS.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-JYADA35W.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-UIHEGU6Q.cjs","kind":"import-statement"}],"exports":["TranscriptionContainer","default"],"entryPoint":"packages/plugins/experimental/plugin-transcription/src/components/TranscriptContainer.tsx","inputs":{},"bytes":264},"packages/plugins/experimental/plugin-transcription/dist/lib/node/react-surface-Q676XPRP.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1326},"packages/plugins/experimental/plugin-transcription/dist/lib/node/react-surface-Q676XPRP.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-Z5MTY2TU.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-JYADA35W.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-UIHEGU6Q.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-transcription/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/experimental/plugin-transcription/src/capabilities/react-surface.tsx":{"bytesInOutput":445}},"bytes":809},"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-Z5MTY2TU.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":453},"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-Z5MTY2TU.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/TranscriptContainer-FFAQVGMS.cjs","kind":"dynamic-import"}],"exports":["TranscriptContainer"],"inputs":{"packages/plugins/experimental/plugin-transcription/src/components/index.ts":{"bytesInOutput":114}},"bytes":271},"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-JYADA35W.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14369},"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-JYADA35W.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-UIHEGU6Q.cjs","kind":"import-statement"},{"path":"effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-edge-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-components","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["Transcript","TranscriptContainer_default","TranscriptionContainer"],"inputs":{"packages/plugins/experimental/plugin-transcription/src/components/TranscriptContainer.tsx":{"bytesInOutput":5491},"packages/plugins/experimental/plugin-transcription/src/components/Transcript/Transcript.tsx":{"bytesInOutput":2030},"packages/plugins/experimental/plugin-transcription/src/components/Transcript/index.ts":{"bytesInOutput":0}},"bytes":8014},"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-UIHEGU6Q.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5170},"packages/plugins/experimental/plugin-transcription/dist/lib/node/chunk-UIHEGU6Q.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["TRANSCRIPTION_PLUGIN","TRANSCRIPTION_URL","TranscriptBlock","TranscriptSchema","TranscriptType","TranscriptionAction","isTranscript","meta"],"inputs":{"packages/plugins/experimental/plugin-transcription/src/types/schema.ts":{"bytesInOutput":844},"packages/plugins/experimental/plugin-transcription/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-transcription/src/types/types.ts":{"bytesInOutput":730},"packages/plugins/experimental/plugin-transcription/src/meta.ts":{"bytesInOutput":358}},"bytes":2426}}}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_surface_Q676XPRP_exports = {};
|
|
30
|
+
__export(react_surface_Q676XPRP_exports, {
|
|
31
|
+
default: () => react_surface_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(react_surface_Q676XPRP_exports);
|
|
34
|
+
var import_chunk_Z5MTY2TU = require("./chunk-Z5MTY2TU.cjs");
|
|
35
|
+
var import_chunk_JYADA35W = require("./chunk-JYADA35W.cjs");
|
|
36
|
+
var import_chunk_UIHEGU6Q = require("./chunk-UIHEGU6Q.cjs");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_app_framework = require("@dxos/app-framework");
|
|
39
|
+
var react_surface_default = () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.ReactSurface, [
|
|
40
|
+
(0, import_app_framework.createSurface)({
|
|
41
|
+
id: import_chunk_UIHEGU6Q.TRANSCRIPTION_PLUGIN,
|
|
42
|
+
role: "article",
|
|
43
|
+
filter: (data) => (0, import_chunk_UIHEGU6Q.isTranscript)(data.subject),
|
|
44
|
+
component: ({ data, role }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_JYADA35W.TranscriptionContainer, {
|
|
45
|
+
transcript: data.subject
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
]);
|
|
49
|
+
//# sourceMappingURL=react-surface-Q676XPRP.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\n\nimport { TranscriptionContainer } from '../components';\nimport { TRANSCRIPTION_PLUGIN } from '../meta';\nimport { isTranscript, type TranscriptType } from '../types';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: TRANSCRIPTION_PLUGIN,\n role: 'article',\n filter: (data): data is { subject: TranscriptType } => isTranscript(data.subject),\n component: ({ data, role }) => <TranscriptionContainer transcript={data.subject} />,\n }),\n ]);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BAAyD;AAMzD,IAAA,wBAAe,UACbA,kCAAYC,kCAAaC,cAAc;MACrCC,oCAAc;IACZC,IAAIC;IACJC,MAAM;IACNC,QAAQ,CAACC,aAA8CC,oCAAaD,KAAKE,OAAO;IAChFC,WAAW,CAAC,EAAEH,MAAMF,KAAI,MAAO,6BAAAM,QAAA,cAACC,8CAAAA;MAAuBC,YAAYN,KAAKE;;EAC1E,CAAA;CACD;",
|
|
6
|
+
"names": ["contributes", "Capabilities", "ReactSurface", "createSurface", "id", "TRANSCRIPTION_PLUGIN", "role", "filter", "data", "isTranscript", "subject", "component", "React", "TranscriptionContainer", "transcript"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var types_exports = {};
|
|
20
|
+
__export(types_exports, {
|
|
21
|
+
TRANSCRIPTION_URL: () => import_chunk_UIHEGU6Q.TRANSCRIPTION_URL,
|
|
22
|
+
TranscriptBlock: () => import_chunk_UIHEGU6Q.TranscriptBlock,
|
|
23
|
+
TranscriptSchema: () => import_chunk_UIHEGU6Q.TranscriptSchema,
|
|
24
|
+
TranscriptType: () => import_chunk_UIHEGU6Q.TranscriptType,
|
|
25
|
+
TranscriptionAction: () => import_chunk_UIHEGU6Q.TranscriptionAction,
|
|
26
|
+
isTranscript: () => import_chunk_UIHEGU6Q.isTranscript
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(types_exports);
|
|
29
|
+
var import_chunk_UIHEGU6Q = require("../chunk-UIHEGU6Q.cjs");
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
TRANSCRIPTION_URL,
|
|
33
|
+
TranscriptBlock,
|
|
34
|
+
TranscriptSchema,
|
|
35
|
+
TranscriptType,
|
|
36
|
+
TranscriptionAction,
|
|
37
|
+
isTranscript
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["index.cjs"],
|
|
4
|
+
"sourcesContent": ["import {\n TRANSCRIPTION_URL,\n TranscriptBlock,\n TranscriptSchema,\n TranscriptType,\n TranscriptionAction,\n isTranscript\n} from \"../chunk-UIHEGU6Q.cjs\";\nexport {\n TRANSCRIPTION_URL,\n TranscriptBlock,\n TranscriptSchema,\n TranscriptType,\n TranscriptionAction,\n isTranscript\n};\n//# sourceMappingURL=index.cjs.map\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAOO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
TranscriptContainer_default,
|
|
4
|
+
TranscriptionContainer
|
|
5
|
+
} from "./chunk-EQUSN55D.mjs";
|
|
6
|
+
import "./chunk-KEG3ME4O.mjs";
|
|
7
|
+
export {
|
|
8
|
+
TranscriptionContainer,
|
|
9
|
+
TranscriptContainer_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=TranscriptContainer-3BJ74CEQ.mjs.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// packages/plugins/experimental/plugin-transcription/src/capabilities/app-graph-builder.ts
|
|
4
|
+
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
5
|
+
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, []);
|
|
6
|
+
export {
|
|
7
|
+
app_graph_builder_default as default
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=app-graph-builder-77GQG6UF.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\n\nexport default (context: PluginsContext) => contributes(Capabilities.AppGraphBuilder, []);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,cAAcC,mBAAwC;AAE/D,IAAA,4BAAe,CAACC,YAA4BC,YAAYC,aAAaC,iBAAiB,CAAA,CAAE;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "context", "contributes", "Capabilities", "AppGraphBuilder"]
|
|
7
|
+
}
|