@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
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.
|
|
3
|
+
"version": "0.9.1-main.c7dcc2e112",
|
|
4
4
|
"description": "Client transformer",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -60,6 +60,7 @@
|
|
|
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
|
],
|
|
@@ -67,13 +68,13 @@
|
|
|
67
68
|
"@huggingface/transformers": "^3.8.1",
|
|
68
69
|
"@xenova/transformers": "^2.17.2",
|
|
69
70
|
"effect": "3.21.3",
|
|
70
|
-
"@dxos/app-
|
|
71
|
-
"@dxos/invariant": "0.
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/log": "0.
|
|
75
|
-
"@dxos/plugin-client": "0.
|
|
76
|
-
"@dxos/util": "0.
|
|
71
|
+
"@dxos/app-toolkit": "0.9.1-main.c7dcc2e112",
|
|
72
|
+
"@dxos/invariant": "0.9.1-main.c7dcc2e112",
|
|
73
|
+
"@dxos/app-framework": "0.9.1-main.c7dcc2e112",
|
|
74
|
+
"@dxos/keys": "0.9.1-main.c7dcc2e112",
|
|
75
|
+
"@dxos/log": "0.9.1-main.c7dcc2e112",
|
|
76
|
+
"@dxos/plugin-client": "0.9.1-main.c7dcc2e112",
|
|
77
|
+
"@dxos/util": "0.9.1-main.c7dcc2e112"
|
|
77
78
|
},
|
|
78
79
|
"devDependencies": {
|
|
79
80
|
"@types/react": "~19.2.7",
|
|
@@ -81,18 +82,18 @@
|
|
|
81
82
|
"react": "~19.2.3",
|
|
82
83
|
"react-dom": "~19.2.3",
|
|
83
84
|
"vite": "^8.0.16",
|
|
84
|
-
"@dxos/plugin-testing": "0.
|
|
85
|
-
"@dxos/random": "0.
|
|
86
|
-
"@dxos/storybook-utils": "0.
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/ui
|
|
85
|
+
"@dxos/plugin-testing": "0.9.1-main.c7dcc2e112",
|
|
86
|
+
"@dxos/random": "0.9.1-main.c7dcc2e112",
|
|
87
|
+
"@dxos/storybook-utils": "0.9.1-main.c7dcc2e112",
|
|
88
|
+
"@dxos/ui-theme": "0.9.1-main.c7dcc2e112",
|
|
89
|
+
"@dxos/react-ui": "0.9.1-main.c7dcc2e112"
|
|
89
90
|
},
|
|
90
91
|
"peerDependencies": {
|
|
91
92
|
"effect": "3.21.3",
|
|
92
93
|
"react": "~19.2.3",
|
|
93
94
|
"react-dom": "~19.2.3",
|
|
94
|
-
"@dxos/react-ui": "0.
|
|
95
|
-
"@dxos/ui-theme": "0.
|
|
95
|
+
"@dxos/react-ui": "0.9.1-main.c7dcc2e112",
|
|
96
|
+
"@dxos/ui-theme": "0.9.1-main.c7dcc2e112"
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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);
|
package/src/translations.ts
CHANGED
|
@@ -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
|
-
}
|