@dxos/plugin-transformer 0.8.4-main.1068cf700f → 0.8.4-main.1c7ec43d41

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.
Files changed (58) hide show
  1. package/dist/lib/browser/TransformerPlugin-TWSS3YA7.mjs +25 -0
  2. package/dist/lib/browser/TransformerPlugin-TWSS3YA7.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +6 -32
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/translations.mjs +15 -0
  7. package/dist/lib/browser/translations.mjs.map +7 -0
  8. package/dist/lib/node-esm/TransformerPlugin-JZEUE72G.mjs +27 -0
  9. package/dist/lib/node-esm/TransformerPlugin-JZEUE72G.mjs.map +7 -0
  10. package/dist/lib/node-esm/index.mjs +6 -32
  11. package/dist/lib/node-esm/index.mjs.map +4 -4
  12. package/dist/lib/node-esm/meta.json +1 -1
  13. package/dist/lib/node-esm/translations.mjs +17 -0
  14. package/dist/lib/node-esm/translations.mjs.map +7 -0
  15. package/dist/types/src/TransformerPlugin.d.ts +1 -0
  16. package/dist/types/src/TransformerPlugin.d.ts.map +1 -1
  17. package/dist/types/src/TransformerPlugin.test.d.ts +2 -0
  18. package/dist/types/src/TransformerPlugin.test.d.ts.map +1 -0
  19. package/dist/types/src/components/Voice/DebugInfo.d.ts.map +1 -0
  20. package/dist/types/src/components/Voice/Voice.d.ts.map +1 -0
  21. package/dist/types/src/components/Voice/Voice.stories.d.ts.map +1 -0
  22. package/dist/types/src/components/Voice/index.d.ts +3 -0
  23. package/dist/types/src/components/Voice/index.d.ts.map +1 -0
  24. package/dist/types/src/components/index.d.ts +2 -0
  25. package/dist/types/src/components/index.d.ts.map +1 -0
  26. package/dist/types/src/hooks/useAudioStream.d.ts.map +1 -1
  27. package/dist/types/src/hooks/usePipeline.d.ts +1 -16
  28. package/dist/types/src/hooks/usePipeline.d.ts.map +1 -1
  29. package/dist/types/src/index.d.ts +2 -1
  30. package/dist/types/src/index.d.ts.map +1 -1
  31. package/dist/types/src/testing/node-pipeline.d.ts +1 -1
  32. package/dist/types/src/testing/node-pipeline.d.ts.map +1 -1
  33. package/dist/types/src/testing/pipeline.d.ts.map +1 -1
  34. package/dist/types/src/testing/web-pipeline.d.ts +1 -1
  35. package/dist/types/src/testing/web-pipeline.d.ts.map +1 -1
  36. package/dist/types/src/translations.d.ts +2 -3
  37. package/dist/types/src/translations.d.ts.map +1 -1
  38. package/dist/types/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +42 -34
  40. package/src/TransformerPlugin.test.ts +25 -0
  41. package/src/TransformerPlugin.tsx +5 -3
  42. package/src/components/{DebugInfo.tsx → Voice/DebugInfo.tsx} +3 -3
  43. package/src/components/{Voice.stories.tsx → Voice/Voice.stories.tsx} +1 -1
  44. package/src/components/{Voice.tsx → Voice/Voice.tsx} +1 -1
  45. package/src/components/Voice/index.ts +6 -0
  46. package/src/{capabilities → components}/index.ts +2 -0
  47. package/src/hooks/usePipeline.ts +9 -33
  48. package/src/index.ts +6 -2
  49. package/src/meta.ts +1 -1
  50. package/src/translations.ts +2 -2
  51. package/dist/types/src/capabilities/index.d.ts +0 -1
  52. package/dist/types/src/capabilities/index.d.ts.map +0 -1
  53. package/dist/types/src/components/DebugInfo.d.ts.map +0 -1
  54. package/dist/types/src/components/Voice.d.ts.map +0 -1
  55. package/dist/types/src/components/Voice.stories.d.ts.map +0 -1
  56. /package/dist/types/src/components/{DebugInfo.d.ts → Voice/DebugInfo.d.ts} +0 -0
  57. /package/dist/types/src/components/{Voice.d.ts → Voice/Voice.d.ts} +0 -0
  58. /package/dist/types/src/components/{Voice.stories.d.ts → Voice/Voice.stories.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-transformer",
3
- "version": "0.8.4-main.1068cf700f",
3
+ "version": "0.8.4-main.1c7ec43d41",
4
4
  "description": "Client transformer",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -12,6 +12,14 @@
12
12
  "author": "DXOS.org",
13
13
  "sideEffects": true,
14
14
  "type": "module",
15
+ "imports": {
16
+ "#plugin": "./src/TransformerPlugin.tsx",
17
+ "#components": "./src/components/index.ts",
18
+ "#hooks": "./src/hooks/index.ts",
19
+ "#meta": "./src/meta.ts",
20
+ "#translations": "./src/translations.ts",
21
+ "#types": "./src/types/index.ts"
22
+ },
15
23
  "exports": {
16
24
  ".": {
17
25
  "source": "./src/index.ts",
@@ -19,6 +27,12 @@
19
27
  "browser": "./dist/lib/browser/index.mjs",
20
28
  "node": "./dist/lib/node-esm/index.mjs"
21
29
  },
30
+ "./translations": {
31
+ "source": "./src/translations.ts",
32
+ "types": "./dist/types/src/translations.d.ts",
33
+ "browser": "./dist/lib/browser/translations.mjs",
34
+ "node": "./dist/lib/node-esm/translations.mjs"
35
+ },
22
36
  "./types": {
23
37
  "source": "./src/types/index.ts",
24
38
  "types": "./dist/types/src/types/index.d.ts",
@@ -27,36 +41,29 @@
27
41
  }
28
42
  },
29
43
  "types": "dist/types/src/index.d.ts",
30
- "typesVersions": {
31
- "*": {
32
- "types": [
33
- "dist/types/src/types/index.d.ts"
34
- ]
35
- }
36
- },
37
44
  "files": [
38
45
  "dist",
39
46
  "src"
40
47
  ],
41
48
  "dependencies": {
42
- "@huggingface/transformers": "^3.3.3",
43
- "date-fns": "^3.3.1",
44
- "effect": "3.19.16",
45
- "@dxos/async": "0.8.4-main.1068cf700f",
46
- "@dxos/app-framework": "0.8.4-main.1068cf700f",
47
- "@dxos/app-toolkit": "0.8.4-main.1068cf700f",
48
- "@dxos/display-name": "0.8.4-main.1068cf700f",
49
- "@dxos/log": "0.8.4-main.1068cf700f",
50
- "@dxos/operation": "0.8.4-main.1068cf700f",
51
- "@dxos/echo": "0.8.4-main.1068cf700f",
52
- "@dxos/plugin-client": "0.8.4-main.1068cf700f",
53
- "@dxos/invariant": "0.8.4-main.1068cf700f",
54
- "@dxos/plugin-graph": "0.8.4-main.1068cf700f",
55
- "@dxos/react-client": "0.8.4-main.1068cf700f",
56
- "@dxos/plugin-space": "0.8.4-main.1068cf700f",
57
- "@dxos/react-ui-attention": "0.8.4-main.1068cf700f",
58
- "@dxos/react-ui-stack": "0.8.4-main.1068cf700f",
59
- "@dxos/util": "0.8.4-main.1068cf700f"
49
+ "@huggingface/transformers": "^3.8.1",
50
+ "date-fns": "^3.6.0",
51
+ "effect": "3.20.0",
52
+ "@dxos/app-framework": "0.8.4-main.1c7ec43d41",
53
+ "@dxos/app-toolkit": "0.8.4-main.1c7ec43d41",
54
+ "@dxos/async": "0.8.4-main.1c7ec43d41",
55
+ "@dxos/display-name": "0.8.4-main.1c7ec43d41",
56
+ "@dxos/echo": "0.8.4-main.1c7ec43d41",
57
+ "@dxos/log": "0.8.4-main.1c7ec43d41",
58
+ "@dxos/invariant": "0.8.4-main.1c7ec43d41",
59
+ "@dxos/operation": "0.8.4-main.1c7ec43d41",
60
+ "@dxos/plugin-client": "0.8.4-main.1c7ec43d41",
61
+ "@dxos/plugin-graph": "0.8.4-main.1c7ec43d41",
62
+ "@dxos/react-client": "0.8.4-main.1c7ec43d41",
63
+ "@dxos/plugin-space": "0.8.4-main.1c7ec43d41",
64
+ "@dxos/react-ui-attention": "0.8.4-main.1c7ec43d41",
65
+ "@dxos/react-ui-stack": "0.8.4-main.1c7ec43d41",
66
+ "@dxos/util": "0.8.4-main.1c7ec43d41"
60
67
  },
61
68
  "devDependencies": {
62
69
  "@types/react": "~19.2.7",
@@ -64,18 +71,19 @@
64
71
  "@xenova/transformers": "^2.17.2",
65
72
  "react": "~19.2.3",
66
73
  "react-dom": "~19.2.3",
67
- "vite": "7.1.9",
68
- "@dxos/react-ui": "0.8.4-main.1068cf700f",
69
- "@dxos/random": "0.8.4-main.1068cf700f",
70
- "@dxos/storybook-utils": "0.8.4-main.1068cf700f",
71
- "@dxos/ui-theme": "0.8.4-main.1068cf700f"
74
+ "vite": "^8.0.10",
75
+ "@dxos/plugin-testing": "0.8.4-main.1c7ec43d41",
76
+ "@dxos/random": "0.8.4-main.1c7ec43d41",
77
+ "@dxos/react-ui": "0.8.4-main.1c7ec43d41",
78
+ "@dxos/storybook-utils": "0.8.4-main.1c7ec43d41",
79
+ "@dxos/ui-theme": "0.8.4-main.1c7ec43d41"
72
80
  },
73
81
  "peerDependencies": {
74
- "effect": "3.19.16",
82
+ "effect": "3.20.0",
75
83
  "react": "~19.2.3",
76
84
  "react-dom": "~19.2.3",
77
- "@dxos/react-ui": "0.8.4-main.1068cf700f",
78
- "@dxos/ui-theme": "0.8.4-main.1068cf700f"
85
+ "@dxos/react-ui": "0.8.4-main.1c7ec43d41",
86
+ "@dxos/ui-theme": "0.8.4-main.1c7ec43d41"
79
87
  },
80
88
  "publishConfig": {
81
89
  "access": "public"
@@ -0,0 +1,25 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { describe, test } from 'vitest';
6
+
7
+ import { ClientPlugin } from '@dxos/plugin-client';
8
+ import { createComposerTestApp } from '@dxos/plugin-testing/harness';
9
+
10
+ import { TransformerPlugin } from '#plugin';
11
+
12
+ import { meta } from './meta';
13
+
14
+ const moduleId = (name: string) => `${meta.id}.module.${name}`;
15
+
16
+ describe('TransformerPlugin', () => {
17
+ test('modules activate on the expected events', async ({ expect }) => {
18
+ await using harness = await createComposerTestApp({
19
+ plugins: [ClientPlugin({}), TransformerPlugin()],
20
+ });
21
+
22
+ // Modules expected to be active after a normal startup.
23
+ expect(harness.manager.getActive()).toContain(moduleId('schema'));
24
+ });
25
+ });
@@ -6,11 +6,11 @@ import { Plugin } from '@dxos/app-framework';
6
6
  import { AppPlugin } from '@dxos/app-toolkit';
7
7
 
8
8
  // import { IntentResolver } from './capabilities';
9
- import { meta } from './meta';
10
- import { translations } from './translations';
9
+ import { meta } from '#meta';
10
+ import { translations } from '#translations';
11
11
 
12
12
  export const TransformerPlugin = Plugin.define(meta).pipe(
13
- AppPlugin.addSchemaModule({ schema: [], id: 'schema' }),
13
+ AppPlugin.addSchemaModule({ schema: [] }),
14
14
  AppPlugin.addTranslationsModule({ translations }),
15
15
  // Plugin.addModule({
16
16
  // id: 'intent-resolver',
@@ -19,3 +19,5 @@ export const TransformerPlugin = Plugin.define(meta).pipe(
19
19
  // }),
20
20
  Plugin.make,
21
21
  );
22
+
23
+ export default TransformerPlugin;
@@ -45,9 +45,9 @@ export const DebugInfo: FC<Partial<DebugInfoProps>> = ({
45
45
  <div className='mb-2 text-green-600'>
46
46
  <strong>Status:</strong> Microphone is active
47
47
  {debug && audioLevel && (
48
- <div className='mt-2 is-48 bs-5 bg-gray-200 rounded relative'>
48
+ <div className='mt-2 w-48 h-5 bg-gray-200 rounded-sm relative'>
49
49
  <div
50
- className='bs-full bg-green-500 transition-all duration-100 rounded'
50
+ className='h-full bg-green-500 transition-all duration-100 rounded-sm'
51
51
  style={{ width: `${(audioLevel / 255) * 100}%` }}
52
52
  />
53
53
  </div>
@@ -67,7 +67,7 @@ export const DebugInfo: FC<Partial<DebugInfoProps>> = ({
67
67
  {transcription && (
68
68
  <div className='mt-4'>
69
69
  <strong>Transcription:</strong>
70
- <p className='mt-2 p-4 bg-gray-100 rounded whitespace-pre-wrap'>{transcription}</p>
70
+ <p className='mt-2 p-4 bg-gray-100 rounded-sm whitespace-pre-wrap'>{transcription}</p>
71
71
  </div>
72
72
  )}
73
73
  </div>
@@ -9,7 +9,7 @@ import { withTheme } from '@dxos/react-ui/testing';
9
9
  import { Voice } from './Voice';
10
10
 
11
11
  const meta = {
12
- title: 'plugins/plugin-transformer/Voice',
12
+ title: 'plugins/plugin-transformer/components/Voice',
13
13
  component: Voice,
14
14
  decorators: [withTheme()],
15
15
  parameters: {
@@ -6,7 +6,7 @@ import React, { useCallback, useEffect, useState } from 'react';
6
6
 
7
7
  import { log } from '@dxos/log';
8
8
 
9
- import { useAudioStream, usePipeline } from '../hooks';
9
+ import { useAudioStream, usePipeline } from '#hooks';
10
10
 
11
11
  import { DebugInfo } from './DebugInfo';
12
12
 
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './DebugInfo';
6
+ export * from './Voice';
@@ -1,3 +1,5 @@
1
1
  //
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
+
5
+ export * from './Voice';
@@ -8,25 +8,6 @@ import { useEffect, useRef, useState } from 'react';
8
8
  import { invariant } from '@dxos/invariant';
9
9
  import { log } from '@dxos/log';
10
10
 
11
- // Add WebGPU types.
12
- declare global {
13
- interface Navigator {
14
- gpu?: {
15
- requestAdapter(): Promise<GPUAdapter | null>;
16
- };
17
- }
18
-
19
- interface GPUAdapter {
20
- requestAdapterInfo(): Promise<GPUAdapterInfo>;
21
- }
22
-
23
- interface GPUAdapterInfo {
24
- vendor: string;
25
- architecture: string;
26
- description: string;
27
- }
28
- }
29
-
30
11
  // Configure cache and runtime settings.
31
12
  env.cacheDir = './.cache';
32
13
  env.allowLocalModels = true;
@@ -87,20 +68,15 @@ export const usePipeline = ({ active, model, debug }: PipelineConfig) => {
87
68
  throw new Error('No GPU adapter found');
88
69
  }
89
70
 
90
- // Try to get adapter info if available.
91
- try {
92
- const adapterInfo = await adapter.requestAdapterInfo();
93
- if (adapterInfo) {
94
- setState((prev) => ({
95
- ...prev,
96
- gpuInfo: `${adapterInfo.description || 'GPU'} (${adapterInfo.vendor || 'Unknown'})`,
97
- }));
98
- } else {
99
- setState((prev) => ({ ...prev, gpuInfo: 'GPU Available (details unknown)' }));
100
- }
101
- } catch (err) {
102
- log.warn('could not get GPU info', { err });
103
- setState((prev) => ({ ...prev, gpuInfo: 'GPU Available (details unavailable)' }));
71
+ // Get adapter info from the info property (modern WebGPU API).
72
+ const adapterInfo = adapter.info;
73
+ if (adapterInfo) {
74
+ setState((prev) => ({
75
+ ...prev,
76
+ gpuInfo: `${adapterInfo.description || 'GPU'} (${adapterInfo.vendor || 'Unknown'})`,
77
+ }));
78
+ } else {
79
+ setState((prev) => ({ ...prev, gpuInfo: 'GPU Available (details unknown)' }));
104
80
  }
105
81
  } catch (err) {
106
82
  log.warn('WebGPU initialization failed', { err });
package/src/index.ts CHANGED
@@ -2,6 +2,10 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './meta';
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
6
8
 
7
- export * from './TransformerPlugin';
9
+ export const TransformerPlugin = Plugin.lazy(meta, () => import('./TransformerPlugin'));
10
+
11
+ export * from './meta';
package/src/meta.ts CHANGED
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
8
  export const meta: Plugin.Meta = {
9
- id: 'dxos.org/plugin/transformer',
9
+ id: 'org.dxos.plugin.transformer',
10
10
  name: 'Transformer',
11
11
  description: trim`
12
12
  Execute local machine learning transformers and AI models directly in your browser.
@@ -4,13 +4,13 @@
4
4
 
5
5
  import { type Resource } from '@dxos/react-ui';
6
6
 
7
- import { meta } from './meta';
7
+ import { meta } from '#meta';
8
8
 
9
9
  export const translations = [
10
10
  {
11
11
  'en-US': {
12
12
  [meta.id]: {
13
- 'plugin name': 'Transformers',
13
+ 'plugin.name': 'Transformers',
14
14
  },
15
15
  },
16
16
  },
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DebugInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/DebugInfo.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,CA4DjD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Voice.d.ts","sourceRoot":"","sources":["../../../../src/components/Voice.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAQhE,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,0BAAkD,UAAU,sBA4FjF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Voice.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Voice.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAIjE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,QAAA,MAAM,IAAI;;;;;;;CAOoB,CAAC;AAE/B,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC;AAEpC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC"}