@dxos/plugin-transformer 0.7.5-main.b19bfc8
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/LICENSE +8 -0
- package/README.md +15 -0
- package/dist/lib/browser/index.mjs +52 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/types/index.mjs +1 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/lib/node/index.cjs +71 -0
- package/dist/lib/node/index.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -0
- package/dist/lib/node/types/index.cjs +2 -0
- package/dist/lib/node/types/index.cjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +54 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/types/index.mjs +2 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/TransformerPlugin.d.ts +2 -0
- package/dist/types/src/TransformerPlugin.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +1 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/components/DebugInfo.d.ts +14 -0
- package/dist/types/src/components/DebugInfo.d.ts.map +1 -0
- package/dist/types/src/components/Voice.d.ts +7 -0
- package/dist/types/src/components/Voice.d.ts.map +1 -0
- package/dist/types/src/components/Voice.stories.d.ts +8 -0
- package/dist/types/src/components/Voice.stories.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +3 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useAudioStream.d.ts +12 -0
- package/dist/types/src/hooks/useAudioStream.d.ts.map +1 -0
- package/dist/types/src/hooks/usePipeline.d.ts +41 -0
- package/dist/types/src/hooks/usePipeline.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +10 -0
- package/dist/types/src/meta.d.ts.map +1 -0
- package/dist/types/src/testing/model.test.d.ts +1 -0
- package/dist/types/src/testing/model.test.d.ts.map +1 -0
- package/dist/types/src/testing/node-pipeline.d.ts +12 -0
- package/dist/types/src/testing/node-pipeline.d.ts.map +1 -0
- package/dist/types/src/testing/pipeline.d.ts +28 -0
- package/dist/types/src/testing/pipeline.d.ts.map +1 -0
- package/dist/types/src/testing/pipeline.test.d.ts +2 -0
- package/dist/types/src/testing/pipeline.test.d.ts.map +1 -0
- package/dist/types/src/testing/web-pipeline.d.ts +12 -0
- package/dist/types/src/testing/web-pipeline.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +9 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +80 -0
- package/src/TransformerPlugin.tsx +34 -0
- package/src/capabilities/index.ts +3 -0
- package/src/components/DebugInfo.tsx +79 -0
- package/src/components/Voice.stories.tsx +32 -0
- package/src/components/Voice.tsx +110 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useAudioStream.ts +252 -0
- package/src/hooks/usePipeline.ts +153 -0
- package/src/index.ts +7 -0
- package/src/meta.ts +16 -0
- package/src/testing/model.test.ts +3 -0
- package/src/testing/node-pipeline.ts +35 -0
- package/src/testing/pipeline.test.ts +90 -0
- package/src/testing/pipeline.ts +74 -0
- package/src/testing/web-pipeline.ts +46 -0
- package/src/translations.ts +15 -0
- package/src/types/index.ts +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
Copyright (c) 2022 DXOS
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
+
|
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @dxos/plugin-transformer
|
|
2
|
+
|
|
3
|
+
Run local transformers.
|
|
4
|
+
|
|
5
|
+
## DXOS Resources
|
|
6
|
+
|
|
7
|
+
- [Website](https://dxos.org)
|
|
8
|
+
- [Developer Documentation](https://docs.dxos.org)
|
|
9
|
+
- Talk to us on [Discord](https://dxos.org/discord)
|
|
10
|
+
|
|
11
|
+
## Contributions
|
|
12
|
+
|
|
13
|
+
Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
|
|
14
|
+
|
|
15
|
+
License: [MIT](./LICENSE) Copyright 2023 © DXOS
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// packages/plugins/experimental/plugin-transformer/src/meta.ts
|
|
2
|
+
var TRANSFORMER_PLUGIN = "dxos.org/plugin/transformer";
|
|
3
|
+
var meta = {
|
|
4
|
+
id: TRANSFORMER_PLUGIN,
|
|
5
|
+
name: "Transformer",
|
|
6
|
+
description: "Run local transformers.",
|
|
7
|
+
icon: "ph--cpu--regular",
|
|
8
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-transformer",
|
|
9
|
+
tags: [
|
|
10
|
+
"experimental"
|
|
11
|
+
]
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx
|
|
15
|
+
import { Capabilities, contributes, defineModule, definePlugin, Events } from "@dxos/app-framework";
|
|
16
|
+
import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
|
|
17
|
+
|
|
18
|
+
// packages/plugins/experimental/plugin-transformer/src/translations.ts
|
|
19
|
+
var translations_default = [
|
|
20
|
+
{
|
|
21
|
+
"en-US": {
|
|
22
|
+
[TRANSFORMER_PLUGIN]: {
|
|
23
|
+
"plugin name": "Transformers"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
// packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx
|
|
30
|
+
var TransformerPlugin = () => definePlugin(meta, [
|
|
31
|
+
defineModule({
|
|
32
|
+
id: `${meta.id}/module/translations`,
|
|
33
|
+
activatesOn: Events.SetupTranslations,
|
|
34
|
+
activate: () => contributes(Capabilities.Translations, translations_default)
|
|
35
|
+
}),
|
|
36
|
+
defineModule({
|
|
37
|
+
id: `${meta.id}/module/metadata`,
|
|
38
|
+
activatesOn: Events.SetupMetadata,
|
|
39
|
+
activate: () => []
|
|
40
|
+
}),
|
|
41
|
+
defineModule({
|
|
42
|
+
id: `${meta.id}/module/schema`,
|
|
43
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
44
|
+
activate: () => contributes(ClientCapabilities.Schema, [])
|
|
45
|
+
})
|
|
46
|
+
]);
|
|
47
|
+
export {
|
|
48
|
+
TRANSFORMER_PLUGIN,
|
|
49
|
+
TransformerPlugin,
|
|
50
|
+
meta
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts", "../../../src/TransformerPlugin.tsx", "../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const TRANSFORMER_PLUGIN = 'dxos.org/plugin/transformer';\n\nexport const meta = {\n id: TRANSFORMER_PLUGIN,\n name: 'Transformer',\n description: 'Run local transformers.',\n icon: 'ph--cpu--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-transformer',\n tags: ['experimental'],\n} satisfies PluginMeta;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\n\n// import { IntentResolver } from './capabilities';\nimport { meta } from './meta';\nimport translations from './translations';\n\nexport const TransformerPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () => [],\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, []),\n }),\n // defineModule({\n // id: `${meta.id}/module/intent-resolver`,\n // activatesOn: Events.SetupIntentResolver,\n // activate: IntentResolver,\n // }),\n ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { TRANSFORMER_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [TRANSFORMER_PLUGIN]: {\n 'plugin name': 'Transformers',\n },\n },\n },\n];\n"],
|
|
5
|
+
"mappings": ";AAMO,IAAMA,qBAAqB;AAE3B,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT;;;ACXA,SAASC,cAAcC,aAAaC,cAAcC,cAAcC,cAAc;AAC9E,SAASC,oBAAoBC,oBAAoB;;;ACCjD,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACC,kBAAAA,GAAqB;QACpB,eAAe;MACjB;IACF;EACF;;;;ADFK,IAAMC,oBAAoB,MAC/BC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,oBAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAU,MAAM,CAAA;EAClB,CAAA;EACAL,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaS,aAAaC;IAC1BP,UAAU,MAAMC,YAAYO,mBAAmBC,QAAQ,CAAA,CAAE;EAC3D,CAAA;CAMD;",
|
|
6
|
+
"names": ["TRANSFORMER_PLUGIN", "meta", "id", "name", "description", "icon", "source", "tags", "Capabilities", "contributes", "defineModule", "definePlugin", "Events", "ClientCapabilities", "ClientEvents", "TRANSFORMER_PLUGIN", "TransformerPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "ClientEvents", "SetupSchema", "ClientCapabilities", "Schema"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"packages/plugins/experimental/plugin-transformer/src/meta.ts":{"bytes":1664,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-transformer/src/translations.ts":{"bytes":1093,"imports":[{"path":"packages/plugins/experimental/plugin-transformer/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx":{"bytes":4004,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transformer/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-transformer/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/experimental/plugin-transformer/src/index.ts":{"bytes":625,"imports":[{"path":"packages/plugins/experimental/plugin-transformer/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx","kind":"import-statement","original":"./TransformerPlugin"}],"format":"esm"},"packages/plugins/experimental/plugin-transformer/src/types/index.ts":{"bytes":434,"imports":[],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-transformer/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3104},"packages/plugins/experimental/plugin-transformer/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true}],"exports":["TRANSFORMER_PLUGIN","TransformerPlugin","meta"],"entryPoint":"packages/plugins/experimental/plugin-transformer/src/index.ts","inputs":{"packages/plugins/experimental/plugin-transformer/src/meta.ts":{"bytesInOutput":325},"packages/plugins/experimental/plugin-transformer/src/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx":{"bytesInOutput":704},"packages/plugins/experimental/plugin-transformer/src/translations.ts":{"bytesInOutput":137}},"bytes":1558},"packages/plugins/experimental/plugin-transformer/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-transformer/dist/lib/browser/types/index.mjs":{"imports":[],"exports":[],"entryPoint":"packages/plugins/experimental/plugin-transformer/src/types/index.ts","inputs":{"packages/plugins/experimental/plugin-transformer/src/types/index.ts":{"bytesInOutput":0}},"bytes":35}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var node_exports = {};
|
|
20
|
+
__export(node_exports, {
|
|
21
|
+
TRANSFORMER_PLUGIN: () => TRANSFORMER_PLUGIN,
|
|
22
|
+
TransformerPlugin: () => TransformerPlugin,
|
|
23
|
+
meta: () => meta
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(node_exports);
|
|
26
|
+
var import_app_framework = require("@dxos/app-framework");
|
|
27
|
+
var import_plugin_client = require("@dxos/plugin-client");
|
|
28
|
+
var TRANSFORMER_PLUGIN = "dxos.org/plugin/transformer";
|
|
29
|
+
var meta = {
|
|
30
|
+
id: TRANSFORMER_PLUGIN,
|
|
31
|
+
name: "Transformer",
|
|
32
|
+
description: "Run local transformers.",
|
|
33
|
+
icon: "ph--cpu--regular",
|
|
34
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-transformer",
|
|
35
|
+
tags: [
|
|
36
|
+
"experimental"
|
|
37
|
+
]
|
|
38
|
+
};
|
|
39
|
+
var translations_default = [
|
|
40
|
+
{
|
|
41
|
+
"en-US": {
|
|
42
|
+
[TRANSFORMER_PLUGIN]: {
|
|
43
|
+
"plugin name": "Transformers"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
var TransformerPlugin = () => (0, import_app_framework.definePlugin)(meta, [
|
|
49
|
+
(0, import_app_framework.defineModule)({
|
|
50
|
+
id: `${meta.id}/module/translations`,
|
|
51
|
+
activatesOn: import_app_framework.Events.SetupTranslations,
|
|
52
|
+
activate: () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.Translations, translations_default)
|
|
53
|
+
}),
|
|
54
|
+
(0, import_app_framework.defineModule)({
|
|
55
|
+
id: `${meta.id}/module/metadata`,
|
|
56
|
+
activatesOn: import_app_framework.Events.SetupMetadata,
|
|
57
|
+
activate: () => []
|
|
58
|
+
}),
|
|
59
|
+
(0, import_app_framework.defineModule)({
|
|
60
|
+
id: `${meta.id}/module/schema`,
|
|
61
|
+
activatesOn: import_plugin_client.ClientEvents.SetupSchema,
|
|
62
|
+
activate: () => (0, import_app_framework.contributes)(import_plugin_client.ClientCapabilities.Schema, [])
|
|
63
|
+
})
|
|
64
|
+
]);
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
TRANSFORMER_PLUGIN,
|
|
68
|
+
TransformerPlugin,
|
|
69
|
+
meta
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts", "../../../src/TransformerPlugin.tsx", "../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const TRANSFORMER_PLUGIN = 'dxos.org/plugin/transformer';\n\nexport const meta = {\n id: TRANSFORMER_PLUGIN,\n name: 'Transformer',\n description: 'Run local transformers.',\n icon: 'ph--cpu--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-transformer',\n tags: ['experimental'],\n} satisfies PluginMeta;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\n\n// import { IntentResolver } from './capabilities';\nimport { meta } from './meta';\nimport translations from './translations';\n\nexport const TransformerPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () => [],\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, []),\n }),\n // defineModule({\n // id: `${meta.id}/module/intent-resolver`,\n // activatesOn: Events.SetupIntentResolver,\n // activate: IntentResolver,\n // }),\n ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { TRANSFORMER_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [TRANSFORMER_PLUGIN]: {\n 'plugin name': 'Transformers',\n },\n },\n },\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;ACIA,2BAA8E;AAC9E,2BAAiD;ADC1C,IAAMA,qBAAqB;AAE3B,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT;AETA,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACP,kBAAAA,GAAqB;QACpB,eAAe;MACjB;IACF;EACF;;ADFK,IAAMQ,oBAAoB,UAC/BC,mCAAaR,MAAM;MACjBS,mCAAa;IACXR,IAAI,GAAGD,KAAKC,EAAE;IACdS,aAAaC,4BAAOC;IACpBC,UAAU,UAAMC,kCAAYC,kCAAaC,cAAcC,oBAAAA;EACzD,CAAA;MACAR,mCAAa;IACXR,IAAI,GAAGD,KAAKC,EAAE;IACdS,aAAaC,4BAAOO;IACpBL,UAAU,MAAM,CAAA;EAClB,CAAA;MACAJ,mCAAa;IACXR,IAAI,GAAGD,KAAKC,EAAE;IACdS,aAAaS,kCAAaC;IAC1BP,UAAU,UAAMC,kCAAYO,wCAAmBC,QAAQ,CAAA,CAAE;EAC3D,CAAA;CAMD;",
|
|
6
|
+
"names": ["TRANSFORMER_PLUGIN", "meta", "id", "name", "description", "icon", "source", "tags", "TransformerPlugin", "definePlugin", "defineModule", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "ClientEvents", "SetupSchema", "ClientCapabilities", "Schema"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"packages/plugins/experimental/plugin-transformer/src/meta.ts":{"bytes":1664,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-transformer/src/translations.ts":{"bytes":1093,"imports":[{"path":"packages/plugins/experimental/plugin-transformer/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx":{"bytes":4004,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transformer/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-transformer/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/experimental/plugin-transformer/src/index.ts":{"bytes":625,"imports":[{"path":"packages/plugins/experimental/plugin-transformer/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx","kind":"import-statement","original":"./TransformerPlugin"}],"format":"esm"},"packages/plugins/experimental/plugin-transformer/src/types/index.ts":{"bytes":434,"imports":[],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-transformer/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3104},"packages/plugins/experimental/plugin-transformer/dist/lib/node/index.cjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true}],"exports":["TRANSFORMER_PLUGIN","TransformerPlugin","meta"],"entryPoint":"packages/plugins/experimental/plugin-transformer/src/index.ts","inputs":{"packages/plugins/experimental/plugin-transformer/src/meta.ts":{"bytesInOutput":325},"packages/plugins/experimental/plugin-transformer/src/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx":{"bytesInOutput":704},"packages/plugins/experimental/plugin-transformer/src/translations.ts":{"bytesInOutput":137}},"bytes":1558},"packages/plugins/experimental/plugin-transformer/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-transformer/dist/lib/node/types/index.cjs":{"imports":[],"exports":[],"entryPoint":"packages/plugins/experimental/plugin-transformer/src/types/index.ts","inputs":{"packages/plugins/experimental/plugin-transformer/src/types/index.ts":{"bytesInOutput":0}},"bytes":35}}}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// packages/plugins/experimental/plugin-transformer/src/meta.ts
|
|
4
|
+
var TRANSFORMER_PLUGIN = "dxos.org/plugin/transformer";
|
|
5
|
+
var meta = {
|
|
6
|
+
id: TRANSFORMER_PLUGIN,
|
|
7
|
+
name: "Transformer",
|
|
8
|
+
description: "Run local transformers.",
|
|
9
|
+
icon: "ph--cpu--regular",
|
|
10
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-transformer",
|
|
11
|
+
tags: [
|
|
12
|
+
"experimental"
|
|
13
|
+
]
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx
|
|
17
|
+
import { Capabilities, contributes, defineModule, definePlugin, Events } from "@dxos/app-framework";
|
|
18
|
+
import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
|
|
19
|
+
|
|
20
|
+
// packages/plugins/experimental/plugin-transformer/src/translations.ts
|
|
21
|
+
var translations_default = [
|
|
22
|
+
{
|
|
23
|
+
"en-US": {
|
|
24
|
+
[TRANSFORMER_PLUGIN]: {
|
|
25
|
+
"plugin name": "Transformers"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
// packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx
|
|
32
|
+
var TransformerPlugin = () => definePlugin(meta, [
|
|
33
|
+
defineModule({
|
|
34
|
+
id: `${meta.id}/module/translations`,
|
|
35
|
+
activatesOn: Events.SetupTranslations,
|
|
36
|
+
activate: () => contributes(Capabilities.Translations, translations_default)
|
|
37
|
+
}),
|
|
38
|
+
defineModule({
|
|
39
|
+
id: `${meta.id}/module/metadata`,
|
|
40
|
+
activatesOn: Events.SetupMetadata,
|
|
41
|
+
activate: () => []
|
|
42
|
+
}),
|
|
43
|
+
defineModule({
|
|
44
|
+
id: `${meta.id}/module/schema`,
|
|
45
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
46
|
+
activate: () => contributes(ClientCapabilities.Schema, [])
|
|
47
|
+
})
|
|
48
|
+
]);
|
|
49
|
+
export {
|
|
50
|
+
TRANSFORMER_PLUGIN,
|
|
51
|
+
TransformerPlugin,
|
|
52
|
+
meta
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts", "../../../src/TransformerPlugin.tsx", "../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const TRANSFORMER_PLUGIN = 'dxos.org/plugin/transformer';\n\nexport const meta = {\n id: TRANSFORMER_PLUGIN,\n name: 'Transformer',\n description: 'Run local transformers.',\n icon: 'ph--cpu--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-transformer',\n tags: ['experimental'],\n} satisfies PluginMeta;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\n\n// import { IntentResolver } from './capabilities';\nimport { meta } from './meta';\nimport translations from './translations';\n\nexport const TransformerPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () => [],\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, []),\n }),\n // defineModule({\n // id: `${meta.id}/module/intent-resolver`,\n // activatesOn: Events.SetupIntentResolver,\n // activate: IntentResolver,\n // }),\n ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { TRANSFORMER_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [TRANSFORMER_PLUGIN]: {\n 'plugin name': 'Transformers',\n },\n },\n },\n];\n"],
|
|
5
|
+
"mappings": ";;;AAMO,IAAMA,qBAAqB;AAE3B,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT;;;ACXA,SAASC,cAAcC,aAAaC,cAAcC,cAAcC,cAAc;AAC9E,SAASC,oBAAoBC,oBAAoB;;;ACCjD,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACC,kBAAAA,GAAqB;QACpB,eAAe;MACjB;IACF;EACF;;;;ADFK,IAAMC,oBAAoB,MAC/BC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,oBAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAU,MAAM,CAAA;EAClB,CAAA;EACAL,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaS,aAAaC;IAC1BP,UAAU,MAAMC,YAAYO,mBAAmBC,QAAQ,CAAA,CAAE;EAC3D,CAAA;CAMD;",
|
|
6
|
+
"names": ["TRANSFORMER_PLUGIN", "meta", "id", "name", "description", "icon", "source", "tags", "Capabilities", "contributes", "defineModule", "definePlugin", "Events", "ClientCapabilities", "ClientEvents", "TRANSFORMER_PLUGIN", "TransformerPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "ClientEvents", "SetupSchema", "ClientCapabilities", "Schema"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"packages/plugins/experimental/plugin-transformer/src/meta.ts":{"bytes":1664,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-transformer/src/translations.ts":{"bytes":1093,"imports":[{"path":"packages/plugins/experimental/plugin-transformer/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx":{"bytes":4004,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-transformer/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-transformer/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/experimental/plugin-transformer/src/index.ts":{"bytes":625,"imports":[{"path":"packages/plugins/experimental/plugin-transformer/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx","kind":"import-statement","original":"./TransformerPlugin"}],"format":"esm"},"packages/plugins/experimental/plugin-transformer/src/types/index.ts":{"bytes":434,"imports":[],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-transformer/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3106},"packages/plugins/experimental/plugin-transformer/dist/lib/node-esm/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true}],"exports":["TRANSFORMER_PLUGIN","TransformerPlugin","meta"],"entryPoint":"packages/plugins/experimental/plugin-transformer/src/index.ts","inputs":{"packages/plugins/experimental/plugin-transformer/src/meta.ts":{"bytesInOutput":325},"packages/plugins/experimental/plugin-transformer/src/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-transformer/src/TransformerPlugin.tsx":{"bytesInOutput":704},"packages/plugins/experimental/plugin-transformer/src/translations.ts":{"bytesInOutput":137}},"bytes":1651},"packages/plugins/experimental/plugin-transformer/dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-transformer/dist/lib/node-esm/types/index.mjs":{"imports":[],"exports":[],"entryPoint":"packages/plugins/experimental/plugin-transformer/src/types/index.ts","inputs":{"packages/plugins/experimental/plugin-transformer/src/types/index.ts":{"bytesInOutput":0}},"bytes":127}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransformerPlugin.d.ts","sourceRoot":"","sources":["../../../src/TransformerPlugin.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,iBAAiB,4CAsB1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
export type DebugInfoProps = {
|
|
3
|
+
error: string;
|
|
4
|
+
isModelLoading: boolean;
|
|
5
|
+
stream: MediaStream | null;
|
|
6
|
+
isTranscribing: boolean;
|
|
7
|
+
transcription: string;
|
|
8
|
+
audioLevel: number;
|
|
9
|
+
gpuInfo: string;
|
|
10
|
+
model: string;
|
|
11
|
+
debug: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const DebugInfo: FC<Partial<DebugInfoProps>>;
|
|
14
|
+
//# sourceMappingURL=DebugInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Voice.d.ts","sourceRoot":"","sources":["../../../../src/components/Voice.tsx"],"names":[],"mappings":"AAWA,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,6BAAsD,UAAU,4CA4FjF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import '@dxos-theme';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { Voice } from './Voice';
|
|
4
|
+
declare const meta: Meta<typeof Voice>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof Voice>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
//# sourceMappingURL=Voice.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Voice.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Voice.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CAO5B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC;AAEpC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type AudioStreamConfig = {
|
|
2
|
+
active?: boolean;
|
|
3
|
+
debug?: boolean;
|
|
4
|
+
onAudioData?: (audioData: Float32Array) => Promise<void>;
|
|
5
|
+
};
|
|
6
|
+
export type AudioStreamState = {
|
|
7
|
+
stream: MediaStream | null;
|
|
8
|
+
error: string | null;
|
|
9
|
+
audioLevel: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const useAudioStream: ({ active, debug, onAudioData }: AudioStreamConfig) => AudioStreamState;
|
|
12
|
+
//# sourceMappingURL=useAudioStream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAudioStream.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAudioStream.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,cAAc,mCAAoC,iBAAiB,qBAuO/E,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Navigator {
|
|
3
|
+
gpu?: {
|
|
4
|
+
requestAdapter(): Promise<GPUAdapter | null>;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
interface GPUAdapter {
|
|
8
|
+
requestAdapterInfo(): Promise<GPUAdapterInfo>;
|
|
9
|
+
}
|
|
10
|
+
interface GPUAdapterInfo {
|
|
11
|
+
vendor: string;
|
|
12
|
+
architecture: string;
|
|
13
|
+
description: string;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export type PipelineConfig = {
|
|
17
|
+
active?: boolean;
|
|
18
|
+
debug?: boolean;
|
|
19
|
+
model: string;
|
|
20
|
+
};
|
|
21
|
+
export type PipelineState = {
|
|
22
|
+
gpuInfo: string;
|
|
23
|
+
isLoaded: boolean;
|
|
24
|
+
isLoading: boolean;
|
|
25
|
+
error: string | null;
|
|
26
|
+
};
|
|
27
|
+
export type TranscriptionOptions = {
|
|
28
|
+
sampling_rate: number;
|
|
29
|
+
chunk_length_s: number;
|
|
30
|
+
stride_length_s: number;
|
|
31
|
+
return_timestamps: boolean;
|
|
32
|
+
language: string;
|
|
33
|
+
};
|
|
34
|
+
export declare const usePipeline: ({ active, model, debug }: PipelineConfig) => {
|
|
35
|
+
transcribe: (audioData: Float32Array, options: TranscriptionOptions) => Promise<any>;
|
|
36
|
+
gpuInfo: string;
|
|
37
|
+
isLoaded: boolean;
|
|
38
|
+
isLoading: boolean;
|
|
39
|
+
error: string | null;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=usePipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePipeline.d.ts","sourceRoot":"","sources":["../../../../src/hooks/usePipeline.ts"],"names":[],"mappings":"AAWA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,SAAS;QACjB,GAAG,CAAC,EAAE;YACJ,cAAc,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;SAC9C,CAAC;KACH;IAED,UAAU,UAAU;QAClB,kBAAkB,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;KAC/C;IAED,UAAU,cAAc;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;KACrB;CACF;AAaD,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAGF,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,WAAW,6BAA8B,cAAc;4BAgF7B,YAAY,WAAW,oBAAoB;aA/FvE,MAAM;cACL,OAAO;eACN,OAAO;WACX,MAAM,GAAG,IAAI;CAsGrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AAEvB,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,gCAAgC,CAAC;AAEhE,eAAO,MAAM,IAAI;;;;;;;CAOK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=model.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.test.d.ts","sourceRoot":"","sources":["../../../../src/testing/model.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type EmbeddingOutput, RagPipeline } from './pipeline';
|
|
2
|
+
/**
|
|
3
|
+
* Node implementation using Xenova transformers.
|
|
4
|
+
*/
|
|
5
|
+
export declare class NodeRagPipeline extends RagPipeline {
|
|
6
|
+
private embeddingModel;
|
|
7
|
+
private textModel;
|
|
8
|
+
constructor(embeddingModel?: string, textModel?: string);
|
|
9
|
+
protected generateEmbeddings(text: string | string[]): Promise<EmbeddingOutput>;
|
|
10
|
+
protected generateText(prompt: string): Promise<import("@xenova/transformers").Text2TextGenerationOutput | import("@xenova/transformers").Text2TextGenerationOutput[]>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=node-pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-pipeline.d.ts","sourceRoot":"","sources":["../../../../src/testing/node-pipeline.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE/D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,SAAS,CAAS;gBAEd,cAAc,SAA4B,EAAE,SAAS,SAAoB;cAMrE,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC;cAMrE,YAAY,CAAC,MAAM,EAAE,MAAM;CAO5C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for embeddings and model outputs.
|
|
3
|
+
*/
|
|
4
|
+
export type EmbeddingOutput = {
|
|
5
|
+
data: number[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Base class for RAG pipeline implementations.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class RagPipeline {
|
|
11
|
+
/**
|
|
12
|
+
* Generate embeddings for a text or array of texts.
|
|
13
|
+
*/
|
|
14
|
+
protected abstract generateEmbeddings(text: string | string[]): Promise<EmbeddingOutput>;
|
|
15
|
+
/**
|
|
16
|
+
* Generate text completions given a prompt.
|
|
17
|
+
*/
|
|
18
|
+
protected abstract generateText(prompt: string): Promise<any>;
|
|
19
|
+
/**
|
|
20
|
+
* Calculate cosine similarity between two vectors.
|
|
21
|
+
*/
|
|
22
|
+
protected cosineSimilarity(a: Float32Array | number[], b: Float32Array | number[]): number;
|
|
23
|
+
/**
|
|
24
|
+
* Generate completions using the RAG pipeline.
|
|
25
|
+
*/
|
|
26
|
+
generateCompletions(input: string, knowledgeBase: string[]): Promise<any>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../../src/testing/pipeline.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,8BAAsB,WAAW;IAC/B;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAExF;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAE7D;;OAEG;IACH,SAAS,CAAC,gBAAgB,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,EAAE,EAAE,CAAC,EAAE,YAAY,GAAG,MAAM,EAAE,GAAG,MAAM;IAS1F;;OAEG;IACG,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE;CA+BjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.test.d.ts","sourceRoot":"","sources":["../../../../src/testing/pipeline.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type EmbeddingOutput, RagPipeline } from './pipeline';
|
|
2
|
+
/**
|
|
3
|
+
* Web-based implementation using Hugging Face transformers.
|
|
4
|
+
*/
|
|
5
|
+
export declare class WebRagPipeline extends RagPipeline {
|
|
6
|
+
private embeddingModel;
|
|
7
|
+
private textModel;
|
|
8
|
+
constructor(embeddingModel?: string, textModel?: string);
|
|
9
|
+
protected generateEmbeddings(text: string | string[]): Promise<EmbeddingOutput>;
|
|
10
|
+
protected generateText(prompt: string): Promise<import("@huggingface/transformers").TextGenerationOutput | import("@huggingface/transformers").TextGenerationOutput[]>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=web-pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-pipeline.d.ts","sourceRoot":"","sources":["../../../../src/testing/web-pipeline.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAO/D;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,SAAS,CAAS;gBAEd,cAAc,SAA4B,EAAE,SAAS,SAAsB;cAMvE,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC;cASrE,YAAY,CAAC,MAAM,EAAE,MAAM;CAU5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;AAMA,wBAQE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"5.7.3"}
|