@dxos/plugin-transformer 0.8.4-staging.60fe92afc8 → 0.9.1-main.c7dcc2e112
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/neutral/TransformerPlugin.mjs +2 -2
- package/dist/lib/neutral/TransformerPlugin.mjs.map +4 -4
- package/dist/lib/neutral/chunk-2UJUBMOA.mjs +45 -0
- package/dist/lib/neutral/chunk-2UJUBMOA.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1 -1
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +1 -1
- package/dist/lib/neutral/translations.mjs +1 -1
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +28 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +34 -0
- package/package.json +16 -15
- package/src/TransformerPlugin.test.ts +1 -1
- package/src/TransformerPlugin.tsx +1 -1
- package/src/meta.ts +2 -26
- package/src/translations.ts +1 -1
- package/dist/lib/neutral/chunk-SFEKXMAC.mjs +0 -36
- package/dist/lib/neutral/chunk-SFEKXMAC.mjs.map +0 -7
|
@@ -4,7 +4,7 @@ import { AppPlugin } from "@dxos/app-toolkit";
|
|
|
4
4
|
import { meta } from "#meta";
|
|
5
5
|
import { translations } from "#translations";
|
|
6
6
|
|
|
7
|
-
// raw-loader:/__w/dxos/dxos/packages/plugins/plugin-transformer/PLUGIN.mdl
|
|
7
|
+
// raw-loader:/__w/dxos/dxos/packages/plugins/plugin-transformer/PLUGIN.mdl
|
|
8
8
|
var PLUGIN_default = "---\nid: org.dxos.plugin.transformer\nname: TransformerPlugin\nversion: 0.1.0\n---\n\nA browser-based machine learning plugin for DXOS Composer that runs Hugging Face Transformers.js\nmodels entirely in-browser via WebAssembly and WebGPU. It provides automatic speech recognition\n(Whisper) through a React hook and component layer, enabling real-time voice transcription without\nany server-side inference infrastructure.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype PipelineConfig\n fields:\n model: string # Hugging Face model id, e.g. 'Xenova/whisper-base'\n active?: boolean # whether to load and run the pipeline\n debug?: boolean # enable verbose logging\n```\n\n```mdl\ntype PipelineState\n fields:\n gpuInfo: string # WebGPU adapter description, or fallback message\n isLoaded: boolean # true once the model is fully initialised\n isLoading: boolean # true while the model is being downloaded/compiled\n error: string | null # error message if loading failed\n```\n\n```mdl\ntype AudioStreamConfig\n fields:\n active?: boolean # start/stop microphone capture\n debug?: boolean\n onAudioData?(audioData: Float32Array): Promise<void>\n```\n\n```mdl\ntype AudioStreamState\n fields:\n stream: MediaStream | null # live microphone stream, or null when inactive\n error: string | null # error from getUserMedia or audio processing\n audioLevel: number # 0-255 RMS level for visualisation\n```\n\n```mdl\ntype TranscriptionOptions\n fields:\n sampling_rate: number # audio sample rate in Hz (16000)\n chunk_length_s: number # seconds of audio per chunk\n stride_length_s: number # overlap between adjacent chunks\n return_timestamps: boolean # include word-level timestamps in output\n language: string # target language hint, e.g. 'english'\n```\n\n```mdl\ntype EmbeddingOutput\n fields:\n data: number[] # embedding vector as a flat float array\n```\n\n## Components\n\n```mdl\ncomponent Voice\n desc: |\n Composite component that wires usePipeline and useAudioStream together to provide\n live Whisper transcription from the microphone. Accumulates the running transcript\n in local state and renders a DebugInfo panel showing model status, audio level, and\n the current transcription text.\n props:\n active?: boolean # start/stop the entire pipeline\n debug?: boolean\n model?: string # defaults to 'Xenova/whisper-base'\n state:\n isTranscribing: boolean # true while a transcription call is in-flight\n transcription: string # accumulated transcript text\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [DebugInfo panel] \u2502\n \u2502 model: Xenova/whisper-base \u2502\n \u2502 gpu: GPU Available \u2502\n \u2502 stream: active / inactive \u2502\n \u2502 level: \u2588\u2588\u2588\u2591\u2591\u2591\u2591 (audioLevel bar) \u2502\n \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2502\n \u2502 [transcription text] \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n## Operations\n\n```mdl\nop LoadModel\n desc: |\n Loads a Transformers.js automatic-speech-recognition pipeline for the given model id.\n Configures ONNX backend to use WebGPU if available, falling back to WASM/CPU.\n Invoked automatically when the Voice component mounts with active = true.\n input: void\n output: void\n effects: [http, fs]\n note: Model weights are cached in ./.cache by the Transformers.js env settings.\n```\n\n```mdl\nop Transcribe\n desc: |\n Runs the loaded ASR pipeline against a Float32Array of 16 kHz mono audio.\n Returns the transcribed text string from the pipeline result.\n input: void\n output: string\n effects: [gpu]\n note: Guarded by isTranscribing flag to prevent concurrent calls.\n```\n\n```mdl\nop CaptureAudio\n desc: |\n Requests microphone permission via getUserMedia and wires an AudioWorklet that\n accumulates 2-second chunks (32000 samples at 16 kHz) before forwarding them to\n the onAudioData callback.\n input: void\n output: void\n effects: [audio]\n note: Cleaned up automatically when the component unmounts or active becomes false.\n```\n\n## Features\n\n```mdl\nfeat F-1: In-Browser ASR Pipeline\n\n req F-1.1:\n when: Voice component mounts with active = true\n then: usePipeline loads the Whisper model via Transformers.js; isLoading is true until complete\n\n req F-1.2:\n when: WebGPU is available in the browser\n then: the ONNX backend is configured for WebGPU execution and gpuInfo reflects the adapter\n\n req F-1.3:\n when: WebGPU is not available\n then: the pipeline falls back to WASM/CPU and gpuInfo is set to a 'not supported' message\n\n req F-1.4:\n when: model loading fails\n then: PipelineState.error contains a human-readable message; isLoading is false\n```\n\n```mdl\nfeat F-2: Microphone Capture\n\n req F-2.1:\n when: useAudioStream is activated\n then: getUserMedia is called with mono 16 kHz audio and echo/noise cancellation enabled\n\n req F-2.2:\n when: audio is captured\n then: an AudioWorklet accumulates samples and emits 2-second chunks via the onAudioData callback\n\n req F-2.3:\n when: active is set to false or the component unmounts\n then: all MediaStream tracks are stopped, AudioContext is closed, and AnimationFrame is cancelled\n\n req F-2.4:\n when: getUserMedia is denied\n then: AudioStreamState.error is set with the underlying error message\n```\n\n```mdl\nfeat F-3: Live Transcription\n\n req F-3.1:\n when: a 2-second audio chunk arrives and the model is loaded\n then: usePipeline.transcribe is called with 16 kHz mono options and the result appended to the transcript\n\n req F-3.2:\n when: transcription is already in progress (isTranscribing = true)\n then: the incoming audio chunk is dropped to avoid concurrent inference\n\n req F-3.3:\n when: transcription returns an empty or whitespace-only string\n then: the transcript state is not updated\n```\n\n```mdl\nfeat F-4: RAG Embedding Pipeline (Testing)\n\n req F-4.1:\n when: RagPipeline.generateCompletions is called with an input and a knowledge base\n then: embeddings are generated for both the input and each knowledge-base entry\n\n req F-4.2:\n when: embeddings are available\n then: cosine similarity is computed and the top-3 most similar contexts are selected\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Model loads and transitions isLoaded\n given: Voice component mounts with active = true and model = 'Xenova/whisper-base'\n when: model download and ONNX compilation complete\n then:\n - isLoading transitions from true to false\n - isLoaded is true\n - error is null\n```\n\n```mdl\ntest T-2: Model load failure sets error state\n given: the model download throws a network error\n when: usePipeline attempts to load the model\n then:\n - isLoading is false\n - error contains the error message string\n - isLoaded is false\n```\n\n```mdl\ntest T-3: Microphone capture populates stream state\n given: getUserMedia is granted\n when: useAudioStream activates\n then:\n - AudioStreamState.stream is a non-null MediaStream\n - AudioStreamState.error is null\n```\n\n```mdl\ntest T-4: Audio chunk triggers transcription\n given: model is loaded and stream is active\n when: AudioWorklet posts a 32000-sample chunk\n then:\n - isTranscribing becomes true during the pipeline call\n - transcription string is updated with the returned text\n - isTranscribing returns to false after completion\n```\n\n```mdl\ntest T-5: Concurrent transcription calls are dropped\n given: isTranscribing is true\n when: a second audio chunk arrives\n then: the chunk is discarded and no second pipeline call is made\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive \u2014 the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n";
|
|
9
9
|
|
|
10
10
|
// src/TransformerPlugin.tsx
|
|
@@ -22,7 +22,7 @@ var TransformerPlugin = Plugin.define(meta).pipe(
|
|
|
22
22
|
// }),
|
|
23
23
|
AppPlugin.addPluginAssetModule({
|
|
24
24
|
asset: {
|
|
25
|
-
pluginId: meta.
|
|
25
|
+
pluginId: meta.profile.key,
|
|
26
26
|
path: "PLUGIN.mdl",
|
|
27
27
|
content: PLUGIN_default,
|
|
28
28
|
mimeType: "application/x-mdl"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/TransformerPlugin.tsx", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-transformer/PLUGIN.mdl
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\n// import { IntentResolver } from './capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const TransformerPlugin = Plugin.define(meta).pipe(\n AppPlugin.addSchemaModule({ schema: [] }),\n AppPlugin.addTranslationsModule({ translations }),\n // Plugin.addModule({\n // id: 'intent-resolver',\n // activatesOn: Events.SetupIntentResolver,\n // activate: IntentResolver,\n // }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.id, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default TransformerPlugin;\n", "---\nid: org.dxos.plugin.transformer\nname: TransformerPlugin\nversion: 0.1.0\n---\n\nA browser-based machine learning plugin for DXOS Composer that runs Hugging Face Transformers.js\nmodels entirely in-browser via WebAssembly and WebGPU. It provides automatic speech recognition\n(Whisper) through a React hook and component layer, enabling real-time voice transcription without\nany server-side inference infrastructure.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype PipelineConfig\n fields:\n model: string # Hugging Face model id, e.g. 'Xenova/whisper-base'\n active?: boolean # whether to load and run the pipeline\n debug?: boolean # enable verbose logging\n```\n\n```mdl\ntype PipelineState\n fields:\n gpuInfo: string # WebGPU adapter description, or fallback message\n isLoaded: boolean # true once the model is fully initialised\n isLoading: boolean # true while the model is being downloaded/compiled\n error: string | null # error message if loading failed\n```\n\n```mdl\ntype AudioStreamConfig\n fields:\n active?: boolean # start/stop microphone capture\n debug?: boolean\n onAudioData?(audioData: Float32Array): Promise<void>\n```\n\n```mdl\ntype AudioStreamState\n fields:\n stream: MediaStream | null # live microphone stream, or null when inactive\n error: string | null # error from getUserMedia or audio processing\n audioLevel: number # 0-255 RMS level for visualisation\n```\n\n```mdl\ntype TranscriptionOptions\n fields:\n sampling_rate: number # audio sample rate in Hz (16000)\n chunk_length_s: number # seconds of audio per chunk\n stride_length_s: number # overlap between adjacent chunks\n return_timestamps: boolean # include word-level timestamps in output\n language: string # target language hint, e.g. 'english'\n```\n\n```mdl\ntype EmbeddingOutput\n fields:\n data: number[] # embedding vector as a flat float array\n```\n\n## Components\n\n```mdl\ncomponent Voice\n desc: |\n Composite component that wires usePipeline and useAudioStream together to provide\n live Whisper transcription from the microphone. Accumulates the running transcript\n in local state and renders a DebugInfo panel showing model status, audio level, and\n the current transcription text.\n props:\n active?: boolean # start/stop the entire pipeline\n debug?: boolean\n model?: string # defaults to 'Xenova/whisper-base'\n state:\n isTranscribing: boolean # true while a transcription call is in-flight\n transcription: string # accumulated transcript text\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [DebugInfo panel] \u2502\n \u2502 model: Xenova/whisper-base \u2502\n \u2502 gpu: GPU Available \u2502\n \u2502 stream: active / inactive \u2502\n \u2502 level: \u2588\u2588\u2588\u2591\u2591\u2591\u2591 (audioLevel bar) \u2502\n \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2502\n \u2502 [transcription text] \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n## Operations\n\n```mdl\nop LoadModel\n desc: |\n Loads a Transformers.js automatic-speech-recognition pipeline for the given model id.\n Configures ONNX backend to use WebGPU if available, falling back to WASM/CPU.\n Invoked automatically when the Voice component mounts with active = true.\n input: void\n output: void\n effects: [http, fs]\n note: Model weights are cached in ./.cache by the Transformers.js env settings.\n```\n\n```mdl\nop Transcribe\n desc: |\n Runs the loaded ASR pipeline against a Float32Array of 16 kHz mono audio.\n Returns the transcribed text string from the pipeline result.\n input: void\n output: string\n effects: [gpu]\n note: Guarded by isTranscribing flag to prevent concurrent calls.\n```\n\n```mdl\nop CaptureAudio\n desc: |\n Requests microphone permission via getUserMedia and wires an AudioWorklet that\n accumulates 2-second chunks (32000 samples at 16 kHz) before forwarding them to\n the onAudioData callback.\n input: void\n output: void\n effects: [audio]\n note: Cleaned up automatically when the component unmounts or active becomes false.\n```\n\n## Features\n\n```mdl\nfeat F-1: In-Browser ASR Pipeline\n\n req F-1.1:\n when: Voice component mounts with active = true\n then: usePipeline loads the Whisper model via Transformers.js; isLoading is true until complete\n\n req F-1.2:\n when: WebGPU is available in the browser\n then: the ONNX backend is configured for WebGPU execution and gpuInfo reflects the adapter\n\n req F-1.3:\n when: WebGPU is not available\n then: the pipeline falls back to WASM/CPU and gpuInfo is set to a 'not supported' message\n\n req F-1.4:\n when: model loading fails\n then: PipelineState.error contains a human-readable message; isLoading is false\n```\n\n```mdl\nfeat F-2: Microphone Capture\n\n req F-2.1:\n when: useAudioStream is activated\n then: getUserMedia is called with mono 16 kHz audio and echo/noise cancellation enabled\n\n req F-2.2:\n when: audio is captured\n then: an AudioWorklet accumulates samples and emits 2-second chunks via the onAudioData callback\n\n req F-2.3:\n when: active is set to false or the component unmounts\n then: all MediaStream tracks are stopped, AudioContext is closed, and AnimationFrame is cancelled\n\n req F-2.4:\n when: getUserMedia is denied\n then: AudioStreamState.error is set with the underlying error message\n```\n\n```mdl\nfeat F-3: Live Transcription\n\n req F-3.1:\n when: a 2-second audio chunk arrives and the model is loaded\n then: usePipeline.transcribe is called with 16 kHz mono options and the result appended to the transcript\n\n req F-3.2:\n when: transcription is already in progress (isTranscribing = true)\n then: the incoming audio chunk is dropped to avoid concurrent inference\n\n req F-3.3:\n when: transcription returns an empty or whitespace-only string\n then: the transcript state is not updated\n```\n\n```mdl\nfeat F-4: RAG Embedding Pipeline (Testing)\n\n req F-4.1:\n when: RagPipeline.generateCompletions is called with an input and a knowledge base\n then: embeddings are generated for both the input and each knowledge-base entry\n\n req F-4.2:\n when: embeddings are available\n then: cosine similarity is computed and the top-3 most similar contexts are selected\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Model loads and transitions isLoaded\n given: Voice component mounts with active = true and model = 'Xenova/whisper-base'\n when: model download and ONNX compilation complete\n then:\n - isLoading transitions from true to false\n - isLoaded is true\n - error is null\n```\n\n```mdl\ntest T-2: Model load failure sets error state\n given: the model download throws a network error\n when: usePipeline attempts to load the model\n then:\n - isLoading is false\n - error contains the error message string\n - isLoaded is false\n```\n\n```mdl\ntest T-3: Microphone capture populates stream state\n given: getUserMedia is granted\n when: useAudioStream activates\n then:\n - AudioStreamState.stream is a non-null MediaStream\n - AudioStreamState.error is null\n```\n\n```mdl\ntest T-4: Audio chunk triggers transcription\n given: model is loaded and stream is active\n when: AudioWorklet posts a 32000-sample chunk\n then:\n - isTranscribing becomes true during the pipeline call\n - transcription string is updated with the returned text\n - isTranscribing returns to false after completion\n```\n\n```mdl\ntest T-5: Concurrent transcription calls are dropped\n given: isTranscribing is true\n when: a second audio chunk arrives\n then: the chunk is discarded and no second pipeline call is made\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive \u2014 the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAG1B,SAASC,YAAY;AACrB,SAASC,oBAAoB;;;ACT7B;;;ADcO,IAAMC,oBAAoBC,OAAOC,OAAOC,IAAAA,EAAMC;EACnDC,UAAUC,gBAAgB;IAAEC,QAAQ,CAAA;EAAG,CAAA;EACvCF,UAAUG,sBAAsB;IAAEC;EAAa,CAAA;;;;;;EAM/CJ,UAAUK,qBAAqB;IAC7BC,OAAO;MAAEC,UAAUT,KAAKU;
|
|
6
|
-
"names": ["Plugin", "AppPlugin", "meta", "translations", "TransformerPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addSchemaModule", "schema", "addTranslationsModule", "translations", "addPluginAssetModule", "asset", "pluginId", "
|
|
3
|
+
"sources": ["../../../src/TransformerPlugin.tsx", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-transformer/PLUGIN.mdl"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\n// import { IntentResolver } from './capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const TransformerPlugin = Plugin.define(meta).pipe(\n AppPlugin.addSchemaModule({ schema: [] }),\n AppPlugin.addTranslationsModule({ translations }),\n // Plugin.addModule({\n // id: 'intent-resolver',\n // activatesOn: Events.SetupIntentResolver,\n // activate: IntentResolver,\n // }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default TransformerPlugin;\n", "---\nid: org.dxos.plugin.transformer\nname: TransformerPlugin\nversion: 0.1.0\n---\n\nA browser-based machine learning plugin for DXOS Composer that runs Hugging Face Transformers.js\nmodels entirely in-browser via WebAssembly and WebGPU. It provides automatic speech recognition\n(Whisper) through a React hook and component layer, enabling real-time voice transcription without\nany server-side inference infrastructure.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype PipelineConfig\n fields:\n model: string # Hugging Face model id, e.g. 'Xenova/whisper-base'\n active?: boolean # whether to load and run the pipeline\n debug?: boolean # enable verbose logging\n```\n\n```mdl\ntype PipelineState\n fields:\n gpuInfo: string # WebGPU adapter description, or fallback message\n isLoaded: boolean # true once the model is fully initialised\n isLoading: boolean # true while the model is being downloaded/compiled\n error: string | null # error message if loading failed\n```\n\n```mdl\ntype AudioStreamConfig\n fields:\n active?: boolean # start/stop microphone capture\n debug?: boolean\n onAudioData?(audioData: Float32Array): Promise<void>\n```\n\n```mdl\ntype AudioStreamState\n fields:\n stream: MediaStream | null # live microphone stream, or null when inactive\n error: string | null # error from getUserMedia or audio processing\n audioLevel: number # 0-255 RMS level for visualisation\n```\n\n```mdl\ntype TranscriptionOptions\n fields:\n sampling_rate: number # audio sample rate in Hz (16000)\n chunk_length_s: number # seconds of audio per chunk\n stride_length_s: number # overlap between adjacent chunks\n return_timestamps: boolean # include word-level timestamps in output\n language: string # target language hint, e.g. 'english'\n```\n\n```mdl\ntype EmbeddingOutput\n fields:\n data: number[] # embedding vector as a flat float array\n```\n\n## Components\n\n```mdl\ncomponent Voice\n desc: |\n Composite component that wires usePipeline and useAudioStream together to provide\n live Whisper transcription from the microphone. Accumulates the running transcript\n in local state and renders a DebugInfo panel showing model status, audio level, and\n the current transcription text.\n props:\n active?: boolean # start/stop the entire pipeline\n debug?: boolean\n model?: string # defaults to 'Xenova/whisper-base'\n state:\n isTranscribing: boolean # true while a transcription call is in-flight\n transcription: string # accumulated transcript text\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [DebugInfo panel] \u2502\n \u2502 model: Xenova/whisper-base \u2502\n \u2502 gpu: GPU Available \u2502\n \u2502 stream: active / inactive \u2502\n \u2502 level: \u2588\u2588\u2588\u2591\u2591\u2591\u2591 (audioLevel bar) \u2502\n \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2502\n \u2502 [transcription text] \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n## Operations\n\n```mdl\nop LoadModel\n desc: |\n Loads a Transformers.js automatic-speech-recognition pipeline for the given model id.\n Configures ONNX backend to use WebGPU if available, falling back to WASM/CPU.\n Invoked automatically when the Voice component mounts with active = true.\n input: void\n output: void\n effects: [http, fs]\n note: Model weights are cached in ./.cache by the Transformers.js env settings.\n```\n\n```mdl\nop Transcribe\n desc: |\n Runs the loaded ASR pipeline against a Float32Array of 16 kHz mono audio.\n Returns the transcribed text string from the pipeline result.\n input: void\n output: string\n effects: [gpu]\n note: Guarded by isTranscribing flag to prevent concurrent calls.\n```\n\n```mdl\nop CaptureAudio\n desc: |\n Requests microphone permission via getUserMedia and wires an AudioWorklet that\n accumulates 2-second chunks (32000 samples at 16 kHz) before forwarding them to\n the onAudioData callback.\n input: void\n output: void\n effects: [audio]\n note: Cleaned up automatically when the component unmounts or active becomes false.\n```\n\n## Features\n\n```mdl\nfeat F-1: In-Browser ASR Pipeline\n\n req F-1.1:\n when: Voice component mounts with active = true\n then: usePipeline loads the Whisper model via Transformers.js; isLoading is true until complete\n\n req F-1.2:\n when: WebGPU is available in the browser\n then: the ONNX backend is configured for WebGPU execution and gpuInfo reflects the adapter\n\n req F-1.3:\n when: WebGPU is not available\n then: the pipeline falls back to WASM/CPU and gpuInfo is set to a 'not supported' message\n\n req F-1.4:\n when: model loading fails\n then: PipelineState.error contains a human-readable message; isLoading is false\n```\n\n```mdl\nfeat F-2: Microphone Capture\n\n req F-2.1:\n when: useAudioStream is activated\n then: getUserMedia is called with mono 16 kHz audio and echo/noise cancellation enabled\n\n req F-2.2:\n when: audio is captured\n then: an AudioWorklet accumulates samples and emits 2-second chunks via the onAudioData callback\n\n req F-2.3:\n when: active is set to false or the component unmounts\n then: all MediaStream tracks are stopped, AudioContext is closed, and AnimationFrame is cancelled\n\n req F-2.4:\n when: getUserMedia is denied\n then: AudioStreamState.error is set with the underlying error message\n```\n\n```mdl\nfeat F-3: Live Transcription\n\n req F-3.1:\n when: a 2-second audio chunk arrives and the model is loaded\n then: usePipeline.transcribe is called with 16 kHz mono options and the result appended to the transcript\n\n req F-3.2:\n when: transcription is already in progress (isTranscribing = true)\n then: the incoming audio chunk is dropped to avoid concurrent inference\n\n req F-3.3:\n when: transcription returns an empty or whitespace-only string\n then: the transcript state is not updated\n```\n\n```mdl\nfeat F-4: RAG Embedding Pipeline (Testing)\n\n req F-4.1:\n when: RagPipeline.generateCompletions is called with an input and a knowledge base\n then: embeddings are generated for both the input and each knowledge-base entry\n\n req F-4.2:\n when: embeddings are available\n then: cosine similarity is computed and the top-3 most similar contexts are selected\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Model loads and transitions isLoaded\n given: Voice component mounts with active = true and model = 'Xenova/whisper-base'\n when: model download and ONNX compilation complete\n then:\n - isLoading transitions from true to false\n - isLoaded is true\n - error is null\n```\n\n```mdl\ntest T-2: Model load failure sets error state\n given: the model download throws a network error\n when: usePipeline attempts to load the model\n then:\n - isLoading is false\n - error contains the error message string\n - isLoaded is false\n```\n\n```mdl\ntest T-3: Microphone capture populates stream state\n given: getUserMedia is granted\n when: useAudioStream activates\n then:\n - AudioStreamState.stream is a non-null MediaStream\n - AudioStreamState.error is null\n```\n\n```mdl\ntest T-4: Audio chunk triggers transcription\n given: model is loaded and stream is active\n when: AudioWorklet posts a 32000-sample chunk\n then:\n - isTranscribing becomes true during the pipeline call\n - transcription string is updated with the returned text\n - isTranscribing returns to false after completion\n```\n\n```mdl\ntest T-5: Concurrent transcription calls are dropped\n given: isTranscribing is true\n when: a second audio chunk arrives\n then: the chunk is discarded and no second pipeline call is made\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive \u2014 the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAG1B,SAASC,YAAY;AACrB,SAASC,oBAAoB;;;ACT7B;;;ADcO,IAAMC,oBAAoBC,OAAOC,OAAOC,IAAAA,EAAMC;EACnDC,UAAUC,gBAAgB;IAAEC,QAAQ,CAAA;EAAG,CAAA;EACvCF,UAAUG,sBAAsB;IAAEC;EAAa,CAAA;;;;;;EAM/CJ,UAAUK,qBAAqB;IAC7BC,OAAO;MAAEC,UAAUT,KAAKU,QAAQC;MAAKC,MAAM;MAAcC,SAASC;MAAYC,UAAU;IAAoB;EAC9G,CAAA;EACAjB,OAAOkB;AAAI;AAGb,IAAA,4BAAenB;",
|
|
6
|
+
"names": ["Plugin", "AppPlugin", "meta", "translations", "TransformerPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addSchemaModule", "schema", "addTranslationsModule", "translations", "addPluginAssetModule", "asset", "pluginId", "profile", "key", "path", "content", "pluginSpec", "mimeType", "make"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// src/meta.ts
|
|
2
|
+
import { Plugin } from "@dxos/app-framework";
|
|
3
|
+
|
|
4
|
+
// dx.config.ts
|
|
5
|
+
import { Config2 } from "@dxos/app-framework/config";
|
|
6
|
+
import { trim } from "@dxos/util";
|
|
7
|
+
var dx_config_default = Config2.make({
|
|
8
|
+
plugin: {
|
|
9
|
+
key: "org.dxos.plugin.transformer",
|
|
10
|
+
name: "Transformer",
|
|
11
|
+
author: "DXOS",
|
|
12
|
+
description: trim`
|
|
13
|
+
Browser-based machine learning plugin that runs Hugging Face Transformers.js models
|
|
14
|
+
entirely in-browser via WebAssembly and WebGPU — no server-side inference required.
|
|
15
|
+
|
|
16
|
+
Provides automatic speech recognition through a Whisper pipeline hook (usePipeline)
|
|
17
|
+
and a microphone capture hook (useAudioStream) that buffers 16 kHz mono audio into
|
|
18
|
+
2-second chunks before forwarding them to the model.
|
|
19
|
+
|
|
20
|
+
Exposes a Voice component that wires the two hooks together to deliver live
|
|
21
|
+
transcription, accumulating the running transcript in local state and rendering
|
|
22
|
+
a debug panel with model status, GPU info, and audio level visualisation.
|
|
23
|
+
|
|
24
|
+
Includes a RAG embedding pipeline base class for retrieval-augmented generation
|
|
25
|
+
experiments, with cosine similarity ranking for selecting the most relevant
|
|
26
|
+
knowledge-base contexts before text generation.
|
|
27
|
+
`,
|
|
28
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-transformer",
|
|
29
|
+
icon: {
|
|
30
|
+
key: "ph--cpu--regular"
|
|
31
|
+
},
|
|
32
|
+
spec: "PLUGIN.mdl",
|
|
33
|
+
tags: [
|
|
34
|
+
"labs"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// src/meta.ts
|
|
40
|
+
var meta = Plugin.getMetaFromConfig(dx_config_default);
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
meta
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=chunk-2UJUBMOA.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts", "../../../dx.config.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.transformer',\n name: 'Transformer',\n author: 'DXOS',\n description: trim`\n Browser-based machine learning plugin that runs Hugging Face Transformers.js models\n entirely in-browser via WebAssembly and WebGPU — no server-side inference required.\n\n Provides automatic speech recognition through a Whisper pipeline hook (usePipeline)\n and a microphone capture hook (useAudioStream) that buffers 16 kHz mono audio into\n 2-second chunks before forwarding them to the model.\n\n Exposes a Voice component that wires the two hooks together to deliver live\n transcription, accumulating the running transcript in local state and rendering\n a debug panel with model status, GPU info, and audio level visualisation.\n\n Includes a RAG embedding pipeline base class for retrieval-augmented generation\n experiments, with cosine similarity ranking for selecting the most relevant\n knowledge-base contexts before text generation.\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-transformer',\n icon: { key: 'ph--cpu--regular' },\n spec: 'PLUGIN.mdl',\n tags: ['labs'],\n },\n});\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,cAAc;;;ACAvB,SAASC,eAAe;AACxB,SAASC,YAAY;AAErB,IAAA,oBAAeD,QAAQE,KAAK;EAC1BC,QAAQ;IACNC,KAAK;IACLC,MAAM;IACNC,QAAQ;IACRC,aAAaN;;;;;;;;;;;;;;;;IAgBbO,QAAQ;IACRC,MAAM;MAAEL,KAAK;IAAmB;IAChCM,MAAM;IACNC,MAAM;MAAC;;EACT;AACF,CAAA;;;ADzBO,IAAMC,OAAOC,OAAOC,kBAAkBC,iBAAAA;",
|
|
6
|
+
"names": ["Plugin", "Config2", "trim", "make", "plugin", "key", "name", "author", "description", "source", "icon", "spec", "tags", "meta", "Plugin", "getMetaFromConfig", "config"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"
|
|
1
|
+
{"inputs":{"dx.config.ts":{"bytes":3977,"imports":[{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/meta.ts":{"bytes":799,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dx.config.ts","kind":"import-statement","original":"../dx.config"}],"format":"esm"},"src/index.ts":{"bytes":368,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-transformer/PLUGIN.mdl":{"bytes":10527,"imports":[]},"src/TransformerPlugin.tsx":{"bytes":3306,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-transformer/PLUGIN.mdl","kind":"import-statement","original":"../PLUGIN.mdl?raw"}],"format":"esm"},"src/components/Voice/DebugInfo.tsx":{"bytes":7253,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/Voice/Voice.tsx":{"bytes":9591,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"#hooks","kind":"import-statement","external":true},{"path":"src/components/Voice/DebugInfo.tsx","kind":"import-statement","original":"./DebugInfo"}],"format":"esm"},"src/components/Voice/index.ts":{"bytes":458,"imports":[{"path":"src/components/Voice/DebugInfo.tsx","kind":"import-statement","original":"./DebugInfo"},{"path":"src/components/Voice/Voice.tsx","kind":"import-statement","original":"./Voice"}],"format":"esm"},"src/components/index.ts":{"bytes":369,"imports":[{"path":"src/components/Voice/index.ts","kind":"import-statement","original":"./Voice"}],"format":"esm"},"src/hooks/useAudioStream.ts":{"bytes":26320,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/usePipeline.ts":{"bytes":13877,"imports":[{"path":"@xenova/transformers","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":489,"imports":[{"path":"src/hooks/useAudioStream.ts","kind":"import-statement","original":"./useAudioStream"},{"path":"src/hooks/usePipeline.ts","kind":"import-statement","original":"./usePipeline"}],"format":"esm"},"src/plugin.ts":{"bytes":876,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/translations.ts":{"bytes":1090,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-2UJUBMOA.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":101},"dist/lib/neutral/TransformerPlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13014},"dist/lib/neutral/TransformerPlugin.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"exports":["TransformerPlugin","default"],"entryPoint":"src/TransformerPlugin.tsx","inputs":{"src/TransformerPlugin.tsx":{"bytesInOutput":728},"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-transformer/PLUGIN.mdl":{"bytesInOutput":11274}},"bytes":12257},"dist/lib/neutral/components/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8435},"dist/lib/neutral/components/index.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"#hooks","kind":"import-statement","external":true}],"exports":["DebugInfo","Voice"],"entryPoint":"src/components/index.ts","inputs":{"src/components/Voice/DebugInfo.tsx":{"bytesInOutput":2426},"src/components/Voice/index.ts":{"bytesInOutput":0},"src/components/Voice/Voice.tsx":{"bytesInOutput":2573},"src/components/index.ts":{"bytesInOutput":0}},"bytes":5140},"dist/lib/neutral/hooks/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18099},"dist/lib/neutral/hooks/index.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@xenova/transformers","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["useAudioStream","usePipeline"],"entryPoint":"src/hooks/index.ts","inputs":{"src/hooks/useAudioStream.ts":{"bytesInOutput":7364},"src/hooks/index.ts":{"bytesInOutput":0},"src/hooks/usePipeline.ts":{"bytesInOutput":3729}},"bytes":11232},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-2UJUBMOA.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":100},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":451},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-2UJUBMOA.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["TransformerPlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":114}},"bytes":247},"dist/lib/neutral/chunk-2UJUBMOA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2163},"dist/lib/neutral/chunk-2UJUBMOA.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":102},"dx.config.ts":{"bytesInOutput":1350}},"bytes":1564},"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":576},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":157}},"bytes":249}}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.
|
|
5
|
-
"mappings": ";AAMA,SAASA,YAAY;AAEd,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACD,KAAKE,
|
|
6
|
-
"names": ["meta", "translations", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.profile.key]: {\n 'plugin.name': 'Transformers',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
+
"mappings": ";AAMA,SAASA,YAAY;AAEd,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACD,KAAKE,QAAQC,GAAG,GAAG;QAClB,eAAe;MACjB;IACF;EACF;;",
|
|
6
|
+
"names": ["meta", "translations", "profile", "key"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly plugin: {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly description?: string | undefined;
|
|
6
|
+
readonly author?: string | undefined;
|
|
7
|
+
readonly homePage?: string | undefined;
|
|
8
|
+
readonly source?: string | undefined;
|
|
9
|
+
readonly screenshots?: readonly {
|
|
10
|
+
readonly light?: string | undefined;
|
|
11
|
+
readonly dark?: string | undefined;
|
|
12
|
+
}[] | undefined;
|
|
13
|
+
readonly tags?: readonly string[] | undefined;
|
|
14
|
+
readonly icon?: {
|
|
15
|
+
readonly key: string;
|
|
16
|
+
readonly hue?: string | undefined;
|
|
17
|
+
} | undefined;
|
|
18
|
+
readonly spec?: string | undefined;
|
|
19
|
+
readonly dependsOn?: readonly string[] | undefined;
|
|
20
|
+
};
|
|
21
|
+
readonly publish?: {
|
|
22
|
+
readonly buildCommand?: string | undefined;
|
|
23
|
+
readonly outputDirectory?: string | undefined;
|
|
24
|
+
readonly assetBaseUrl?: string | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
28
|
+
//# sourceMappingURL=dx.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dx.config.d.ts","sourceRoot":"","sources":["../../dx.config.ts"],"names":[],"mappings":""}
|
package/dist/types/src/meta.d.ts
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare const meta: {
|
|
2
|
+
readonly profile: {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly description?: string | undefined;
|
|
6
|
+
readonly homePage?: string | undefined;
|
|
7
|
+
readonly source?: string | undefined;
|
|
8
|
+
readonly tags?: readonly string[] | undefined;
|
|
9
|
+
readonly screenshots?: readonly {
|
|
10
|
+
readonly light?: string | undefined;
|
|
11
|
+
readonly dark?: string | undefined;
|
|
12
|
+
}[] | undefined;
|
|
13
|
+
readonly icon?: {
|
|
14
|
+
readonly key: string;
|
|
15
|
+
readonly hue?: string | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
readonly dependsOn?: readonly string[] | undefined;
|
|
18
|
+
readonly spec?: string | undefined;
|
|
19
|
+
readonly author?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
readonly release?: {
|
|
22
|
+
readonly version: string;
|
|
23
|
+
readonly moduleUrl: string;
|
|
24
|
+
readonly dependencies?: {
|
|
25
|
+
readonly [x: string]: string;
|
|
26
|
+
} | undefined;
|
|
27
|
+
} | undefined;
|
|
28
|
+
};
|
|
3
29
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAmC,CAAC"}
|