@dxos/plugin-transformer 0.8.4-main.67995b8 → 0.8.4-main.a4bbb77
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/browser/index.mjs +3 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +3 -5
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/TransformerPlugin.d.ts +1 -1
- package/dist/types/src/TransformerPlugin.d.ts.map +1 -1
- package/dist/types/src/components/Voice.d.ts.map +1 -1
- package/dist/types/src/components/Voice.stories.d.ts +9 -3
- package/dist/types/src/components/Voice.stories.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -35
- package/src/TransformerPlugin.tsx +23 -24
- package/src/components/Voice.stories.tsx +5 -7
- package/src/components/Voice.tsx +3 -2
- package/src/hooks/useAudioStream.ts +2 -2
- package/src/hooks/usePipeline.ts +2 -2
- package/src/meta.ts +1 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-transformer",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.a4bbb77",
|
|
4
4
|
"description": "Client transformer",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
|
-
"source": "./src/index.ts"
|
|
16
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
17
17
|
},
|
|
18
18
|
"./types": {
|
|
19
|
+
"source": "./src/types/index.ts",
|
|
19
20
|
"types": "./dist/types/src/types/index.d.ts",
|
|
20
21
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
21
|
-
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
22
|
-
"source": "./src/types/index.ts"
|
|
22
|
+
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -37,43 +37,43 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@huggingface/transformers": "^3.3.3",
|
|
39
39
|
"@preact-signals/safe-react": "^0.9.0",
|
|
40
|
-
"@preact/signals-core": "^1.
|
|
40
|
+
"@preact/signals-core": "^1.12.1",
|
|
41
41
|
"date-fns": "^3.3.1",
|
|
42
|
-
"effect": "3.
|
|
43
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
44
|
-
"@dxos/async": "0.8.4-main.
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
53
|
-
"@dxos/react-
|
|
54
|
-
"@dxos/plugin-space": "0.8.4-main.
|
|
55
|
-
"@dxos/react-ui-
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
42
|
+
"effect": "3.18.3",
|
|
43
|
+
"@dxos/app-framework": "0.8.4-main.a4bbb77",
|
|
44
|
+
"@dxos/async": "0.8.4-main.a4bbb77",
|
|
45
|
+
"@dxos/display-name": "0.8.4-main.a4bbb77",
|
|
46
|
+
"@dxos/echo": "0.8.4-main.a4bbb77",
|
|
47
|
+
"@dxos/echo-schema": "0.8.4-main.a4bbb77",
|
|
48
|
+
"@dxos/invariant": "0.8.4-main.a4bbb77",
|
|
49
|
+
"@dxos/live-object": "0.8.4-main.a4bbb77",
|
|
50
|
+
"@dxos/log": "0.8.4-main.a4bbb77",
|
|
51
|
+
"@dxos/plugin-client": "0.8.4-main.a4bbb77",
|
|
52
|
+
"@dxos/plugin-graph": "0.8.4-main.a4bbb77",
|
|
53
|
+
"@dxos/react-client": "0.8.4-main.a4bbb77",
|
|
54
|
+
"@dxos/plugin-space": "0.8.4-main.a4bbb77",
|
|
55
|
+
"@dxos/react-ui-attention": "0.8.4-main.a4bbb77",
|
|
56
|
+
"@dxos/react-ui-stack": "0.8.4-main.a4bbb77",
|
|
57
|
+
"@dxos/util": "0.8.4-main.a4bbb77"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@types/react": "~
|
|
61
|
-
"@types/react-dom": "~
|
|
60
|
+
"@types/react": "~19.2.0",
|
|
61
|
+
"@types/react-dom": "~19.2.0",
|
|
62
62
|
"@xenova/transformers": "^2.17.2",
|
|
63
|
-
"react": "~
|
|
64
|
-
"react-dom": "~
|
|
65
|
-
"vite": "
|
|
66
|
-
"@dxos/random": "0.8.4-main.
|
|
67
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
68
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
69
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
63
|
+
"react": "~19.2.0",
|
|
64
|
+
"react-dom": "~19.2.0",
|
|
65
|
+
"vite": "7.1.9",
|
|
66
|
+
"@dxos/random": "0.8.4-main.a4bbb77",
|
|
67
|
+
"@dxos/react-ui": "0.8.4-main.a4bbb77",
|
|
68
|
+
"@dxos/react-ui-theme": "0.8.4-main.a4bbb77",
|
|
69
|
+
"@dxos/storybook-utils": "0.8.4-main.a4bbb77"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"effect": "^3.13.3",
|
|
73
|
-
"react": "
|
|
74
|
-
"react-dom": "
|
|
75
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
76
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
73
|
+
"react": "^19.0.0",
|
|
74
|
+
"react-dom": "^19.0.0",
|
|
75
|
+
"@dxos/react-ui": "0.8.4-main.a4bbb77",
|
|
76
|
+
"@dxos/react-ui-theme": "0.8.4-main.a4bbb77"
|
|
77
77
|
},
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
@@ -2,33 +2,32 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities, contributes, defineModule, definePlugin
|
|
5
|
+
import { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';
|
|
6
6
|
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
7
7
|
|
|
8
8
|
// import { IntentResolver } from './capabilities';
|
|
9
9
|
import { meta } from './meta';
|
|
10
10
|
import { translations } from './translations';
|
|
11
11
|
|
|
12
|
-
export const TransformerPlugin = () =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
]);
|
|
12
|
+
export const TransformerPlugin = definePlugin(meta, () => [
|
|
13
|
+
defineModule({
|
|
14
|
+
id: `${meta.id}/module/translations`,
|
|
15
|
+
activatesOn: Events.SetupTranslations,
|
|
16
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
17
|
+
}),
|
|
18
|
+
defineModule({
|
|
19
|
+
id: `${meta.id}/module/metadata`,
|
|
20
|
+
activatesOn: Events.SetupMetadata,
|
|
21
|
+
activate: () => [],
|
|
22
|
+
}),
|
|
23
|
+
defineModule({
|
|
24
|
+
id: `${meta.id}/module/schema`,
|
|
25
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
26
|
+
activate: () => contributes(ClientCapabilities.Schema, []),
|
|
27
|
+
}),
|
|
28
|
+
// defineModule({
|
|
29
|
+
// id: `${meta.id}/module/intent-resolver`,
|
|
30
|
+
// activatesOn: Events.SetupIntentResolver,
|
|
31
|
+
// activate: IntentResolver,
|
|
32
|
+
// }),
|
|
33
|
+
]);
|
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
7
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
10
8
|
|
|
11
9
|
import { Voice } from './Voice';
|
|
12
10
|
|
|
13
|
-
const meta
|
|
11
|
+
const meta = {
|
|
14
12
|
title: 'plugins/plugin-transformer/Voice',
|
|
15
13
|
component: Voice,
|
|
16
|
-
decorators: [withTheme
|
|
14
|
+
decorators: [withTheme],
|
|
17
15
|
parameters: {
|
|
18
16
|
layout: 'centered',
|
|
19
17
|
},
|
|
20
|
-
}
|
|
18
|
+
} satisfies Meta<typeof Voice>;
|
|
21
19
|
|
|
22
20
|
export default meta;
|
|
23
21
|
|
package/src/components/Voice.tsx
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { log } from '@dxos/log';
|
|
8
8
|
|
|
9
|
-
import { DebugInfo } from './DebugInfo';
|
|
10
9
|
import { useAudioStream, usePipeline } from '../hooks';
|
|
11
10
|
|
|
11
|
+
import { DebugInfo } from './DebugInfo';
|
|
12
|
+
|
|
12
13
|
export type VoiceProps = {
|
|
13
14
|
active?: boolean;
|
|
14
15
|
debug?: boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { log } from '@dxos/log';
|
|
8
8
|
|
|
@@ -28,7 +28,7 @@ export const useAudioStream = ({ active, debug, onAudioData }: AudioStreamConfig
|
|
|
28
28
|
// TODO(burdon): Convert to class.
|
|
29
29
|
const audioContextRef = useRef<AudioContext | null>(null);
|
|
30
30
|
const analyserRef = useRef<AnalyserNode | null>(null);
|
|
31
|
-
const animationFrameRef = useRef<number>();
|
|
31
|
+
const animationFrameRef = useRef<number>(undefined);
|
|
32
32
|
const workletNodeRef = useRef<AudioWorkletNode | null>(null);
|
|
33
33
|
const isProcessingRef = useRef(false);
|
|
34
34
|
const mediaStreamRef = useRef<MediaStream | null>(null);
|
package/src/hooks/usePipeline.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Pipeline,
|
|
6
|
-
import {
|
|
5
|
+
import { type Pipeline, env, pipeline } from '@xenova/transformers';
|
|
6
|
+
import { useEffect, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
9
|
import { log } from '@dxos/log';
|
package/src/meta.ts
CHANGED
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
export const TRANSFORMER_PLUGIN = 'dxos.org/plugin/transformer';
|
|
8
|
-
|
|
9
7
|
export const meta: PluginMeta = {
|
|
10
|
-
id:
|
|
8
|
+
id: 'dxos.org/plugin/transformer',
|
|
11
9
|
name: 'Transformer',
|
|
12
10
|
description: 'Run local transformers.',
|
|
13
11
|
icon: 'ph--cpu--regular',
|