@dxos/plugin-transformer 0.9.0 → 0.9.1-staging.ee54ba693a

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/dx.config.ts ADDED
@@ -0,0 +1,34 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { Config2 } from '@dxos/app-framework/config';
6
+ import { trim } from '@dxos/util';
7
+
8
+ export default Config2.make({
9
+ plugin: {
10
+ key: 'org.dxos.plugin.transformer',
11
+ name: 'Transformer',
12
+ author: 'DXOS',
13
+ description: trim`
14
+ Browser-based machine learning plugin that runs Hugging Face Transformers.js models
15
+ entirely in-browser via WebAssembly and WebGPU — no server-side inference required.
16
+
17
+ Provides automatic speech recognition through a Whisper pipeline hook (usePipeline)
18
+ and a microphone capture hook (useAudioStream) that buffers 16 kHz mono audio into
19
+ 2-second chunks before forwarding them to the model.
20
+
21
+ Exposes a Voice component that wires the two hooks together to deliver live
22
+ transcription, accumulating the running transcript in local state and rendering
23
+ a debug panel with model status, GPU info, and audio level visualisation.
24
+
25
+ Includes a RAG embedding pipeline base class for retrieval-augmented generation
26
+ experiments, with cosine similarity ranking for selecting the most relevant
27
+ knowledge-base contexts before text generation.
28
+ `,
29
+ source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-transformer',
30
+ icon: { key: 'ph--cpu--regular' },
31
+ spec: 'PLUGIN.mdl',
32
+ tags: ['labs'],
33
+ },
34
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-transformer",
3
- "version": "0.9.0",
3
+ "version": "0.9.1-staging.ee54ba693a",
4
4
  "description": "Client transformer",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -60,39 +60,40 @@
60
60
  "types": "dist/types/src/index.d.ts",
61
61
  "files": [
62
62
  "dist",
63
+ "dx.config.ts",
63
64
  "src",
64
65
  "PLUGIN.mdl"
65
66
  ],
66
67
  "dependencies": {
67
68
  "@huggingface/transformers": "^3.8.1",
68
69
  "@xenova/transformers": "^2.17.2",
69
- "effect": "3.21.3",
70
- "@dxos/app-framework": "0.9.0",
71
- "@dxos/invariant": "0.9.0",
72
- "@dxos/app-toolkit": "0.9.0",
73
- "@dxos/keys": "0.9.0",
74
- "@dxos/log": "0.9.0",
75
- "@dxos/plugin-client": "0.9.0",
76
- "@dxos/util": "0.9.0"
70
+ "effect": "3.21.4",
71
+ "@dxos/app-framework": "0.9.1-staging.ee54ba693a",
72
+ "@dxos/app-toolkit": "0.9.1-staging.ee54ba693a",
73
+ "@dxos/invariant": "0.9.1-staging.ee54ba693a",
74
+ "@dxos/log": "0.9.1-staging.ee54ba693a",
75
+ "@dxos/keys": "0.9.1-staging.ee54ba693a",
76
+ "@dxos/util": "0.9.1-staging.ee54ba693a",
77
+ "@dxos/plugin-client": "0.9.1-staging.ee54ba693a"
77
78
  },
78
79
  "devDependencies": {
79
- "@types/react": "~19.2.7",
80
+ "@types/react": "~19.2.17",
80
81
  "@types/react-dom": "~19.2.3",
81
- "react": "~19.2.3",
82
- "react-dom": "~19.2.3",
82
+ "react": "~19.2.7",
83
+ "react-dom": "~19.2.7",
83
84
  "vite": "^8.0.16",
84
- "@dxos/plugin-testing": "0.9.0",
85
- "@dxos/random": "0.9.0",
86
- "@dxos/storybook-utils": "0.9.0",
87
- "@dxos/react-ui": "0.9.0",
88
- "@dxos/ui-theme": "0.9.0"
85
+ "@dxos/plugin-testing": "0.9.1-staging.ee54ba693a",
86
+ "@dxos/random": "0.9.1-staging.ee54ba693a",
87
+ "@dxos/storybook-utils": "0.9.1-staging.ee54ba693a",
88
+ "@dxos/ui-theme": "0.9.1-staging.ee54ba693a",
89
+ "@dxos/react-ui": "0.9.1-staging.ee54ba693a"
89
90
  },
90
91
  "peerDependencies": {
91
- "effect": "3.21.3",
92
- "react": "~19.2.3",
93
- "react-dom": "~19.2.3",
94
- "@dxos/react-ui": "0.9.0",
95
- "@dxos/ui-theme": "0.9.0"
92
+ "effect": "3.21.4",
93
+ "react": "~19.2.7",
94
+ "react-dom": "~19.2.7",
95
+ "@dxos/react-ui": "0.9.1-staging.ee54ba693a",
96
+ "@dxos/ui-theme": "0.9.1-staging.ee54ba693a"
96
97
  },
97
98
  "publishConfig": {
98
99
  "access": "public"
@@ -11,7 +11,7 @@ import { TransformerPlugin } from '#plugin';
11
11
 
12
12
  import { meta } from './meta';
13
13
 
14
- const moduleId = (name: string) => `${meta.id}.module.${name}`;
14
+ const moduleId = (name: string) => `${meta.profile.key}.module.${name}`;
15
15
 
16
16
  describe('TransformerPlugin', () => {
17
17
  test('modules activate on the expected events', async ({ expect }) => {
@@ -21,7 +21,7 @@ export const TransformerPlugin = Plugin.define(meta).pipe(
21
21
  // activate: IntentResolver,
22
22
  // }),
23
23
  AppPlugin.addPluginAssetModule({
24
- asset: { pluginId: meta.id, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },
24
+ asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },
25
25
  }),
26
26
  Plugin.make,
27
27
  );
package/src/meta.ts CHANGED
@@ -3,31 +3,7 @@
3
3
  //
4
4
 
5
5
  import { Plugin } from '@dxos/app-framework';
6
- import { DXN } from '@dxos/keys';
7
- import { trim } from '@dxos/util';
8
6
 
9
- export const meta = Plugin.makeMeta({
10
- key: DXN.make('org.dxos.plugin.transformer'),
11
- name: 'Transformer',
12
- author: 'DXOS',
13
- spec: 'PLUGIN.mdl',
14
- description: trim`
15
- Browser-based machine learning plugin that runs Hugging Face Transformers.js models
16
- entirely in-browser via WebAssembly and WebGPU — no server-side inference required.
7
+ import config from '../dx.config';
17
8
 
18
- Provides automatic speech recognition through a Whisper pipeline hook (usePipeline)
19
- and a microphone capture hook (useAudioStream) that buffers 16 kHz mono audio into
20
- 2-second chunks before forwarding them to the model.
21
-
22
- Exposes a Voice component that wires the two hooks together to deliver live
23
- transcription, accumulating the running transcript in local state and rendering
24
- a debug panel with model status, GPU info, and audio level visualisation.
25
-
26
- Includes a RAG embedding pipeline base class for retrieval-augmented generation
27
- experiments, with cosine similarity ranking for selecting the most relevant
28
- knowledge-base contexts before text generation.
29
- `,
30
- icon: 'ph--cpu--regular',
31
- source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-transformer',
32
- tags: ['labs'],
33
- });
9
+ export const meta = Plugin.getMetaFromConfig(config);
@@ -9,7 +9,7 @@ import { meta } from '#meta';
9
9
  export const translations = [
10
10
  {
11
11
  'en-US': {
12
- [meta.id]: {
12
+ [meta.profile.key]: {
13
13
  'plugin.name': 'Transformers',
14
14
  },
15
15
  },
@@ -1,36 +0,0 @@
1
- // src/meta.ts
2
- import { Plugin } from "@dxos/app-framework";
3
- import { DXN } from "@dxos/keys";
4
- import { trim } from "@dxos/util";
5
- var meta = Plugin.makeMeta({
6
- key: DXN.make("org.dxos.plugin.transformer"),
7
- name: "Transformer",
8
- author: "DXOS",
9
- spec: "PLUGIN.mdl",
10
- description: trim`
11
- Browser-based machine learning plugin that runs Hugging Face Transformers.js models
12
- entirely in-browser via WebAssembly and WebGPU — no server-side inference required.
13
-
14
- Provides automatic speech recognition through a Whisper pipeline hook (usePipeline)
15
- and a microphone capture hook (useAudioStream) that buffers 16 kHz mono audio into
16
- 2-second chunks before forwarding them to the model.
17
-
18
- Exposes a Voice component that wires the two hooks together to deliver live
19
- transcription, accumulating the running transcript in local state and rendering
20
- a debug panel with model status, GPU info, and audio level visualisation.
21
-
22
- Includes a RAG embedding pipeline base class for retrieval-augmented generation
23
- experiments, with cosine similarity ranking for selecting the most relevant
24
- knowledge-base contexts before text generation.
25
- `,
26
- icon: "ph--cpu--regular",
27
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-transformer",
28
- tags: [
29
- "labs"
30
- ]
31
- });
32
-
33
- export {
34
- meta
35
- };
36
- //# sourceMappingURL=chunk-SFEKXMAC.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const meta = Plugin.makeMeta({\n key: DXN.make('org.dxos.plugin.transformer'),\n name: 'Transformer',\n author: 'DXOS',\n spec: 'PLUGIN.mdl',\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 icon: 'ph--cpu--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-transformer',\n tags: ['labs'],\n});\n"],
5
- "mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,WAAW;AACpB,SAASC,YAAY;AAEd,IAAMC,OAAOH,OAAOI,SAAS;EAClCC,KAAKJ,IAAIK,KAAK,6BAAA;EACdC,MAAM;EACNC,QAAQ;EACRC,MAAM;EACNC,aAAaR;;;;;;;;;;;;;;;;EAgBbS,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT,CAAA;",
6
- "names": ["Plugin", "DXN", "trim", "meta", "makeMeta", "key", "make", "name", "author", "spec", "description", "icon", "source", "tags"]
7
- }