@sidevoice/engine 0.3.1 → 0.4.0

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/README.md CHANGED
@@ -25,7 +25,7 @@ const engine = await WebEngine.create({
25
25
  },
26
26
  });
27
27
  const local = engine.localCatalog();
28
- const models = await local.models(); // LocalModelInfo[]: each with its builds ranked, whether it is installed
28
+ const models = await local.models(); // LocalModelInfo[]: each with its builds ranked, whether it is installed, lastUsedAt
29
29
  const whisper = await engine.load("whisper-small", undefined, (progress) => show(progress), abort.signal);
30
30
  const stt = whisper.asStt();
31
31
  const text = await stt.transcribe(samples, 48000, "es"); // any rate: the engine resamples
@@ -18,10 +18,13 @@ export interface ModelInfo {
18
18
  id: string; capabilities: ("stt" | "tts" | "vad" | "end-of-turn")[]; languages: string[];
19
19
  voices: Voice[]; speed?: SpeedRange;
20
20
  }
21
- /** A model of the local catalogue: its family, size, licence, builds ranked and what is installed. */
21
+ /** A model of the local catalogue: its family, size, licence, builds ranked, what is installed and when it was
22
+ * last loaded. */
22
23
  export interface LocalModelInfo extends ModelInfo {
23
- family: string; parametersM: number; license: string; installed: boolean; builds: ModelBuild[];
24
- recommendedBuild?: string;
24
+ family: string; parametersM: number; license: string; installed: boolean;
25
+ /** When it was last loaded, in milliseconds since the epoch; absent when it is not installed or not loaded since. */
26
+ lastUsedAt?: number;
27
+ builds: ModelBuild[]; recommendedBuild?: string;
25
28
  }
26
29
  /** A model of a remote provider, as listed. */
27
30
  export interface RemoteModelInfo extends ModelInfo {}
@@ -79,7 +82,8 @@ export class LocalCatalog {
79
82
  load(model: string, onProgress: (progress: Progress) => void, signal?: AbortSignal | null): Promise<LocalModel>;
80
83
  /**
81
84
  * Its models, those of `capability` alone when given (`"stt"`, `"tts"`, `"vad"`, `"end-of-turn"`), each with its
82
- * builds ranked and what is installed; rejects with `invalid-capability` for any other.
85
+ * builds ranked, what is installed and when it was last loaded (`lastUsedAt`); rejects with `invalid-capability`
86
+ * for any other.
83
87
  */
84
88
  models(capability: "stt" | "tts" | "vad" | "end-of-turn"): Promise<LocalModelInfo[]>;
85
89
  /**
@@ -1,11 +1,11 @@
1
1
  /* @ts-self-types="./sidevoice_engine.d.ts" */
2
- import { importEspeak } from './snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline0.js';
3
- import { importTransformers } from './snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline1.js';
4
- import { detectLanguage } from './snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline2.js';
5
- import { serve } from './snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline3.js';
6
- import { smartTurnRun } from './snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline5.js';
7
- import { sileroRun } from './snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline6.js';
8
- import * as import1 from "./snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline4.js"
2
+ import { importTransformers } from './snippets/sidevoice-engine-a85788d87fd0a079/inline0.js';
3
+ import { detectLanguage } from './snippets/sidevoice-engine-a85788d87fd0a079/inline1.js';
4
+ import { serve } from './snippets/sidevoice-engine-a85788d87fd0a079/inline2.js';
5
+ import { importEspeak } from './snippets/sidevoice-engine-a85788d87fd0a079/inline3.js';
6
+ import { smartTurnRun } from './snippets/sidevoice-engine-a85788d87fd0a079/inline5.js';
7
+ import { sileroRun } from './snippets/sidevoice-engine-a85788d87fd0a079/inline6.js';
8
+ import * as import1 from "./snippets/sidevoice-engine-a85788d87fd0a079/inline4.js"
9
9
 
10
10
 
11
11
  /**
@@ -104,7 +104,8 @@ export class LocalCatalog {
104
104
  }
105
105
  /**
106
106
  * Its models, those of `capability` alone when given (`"stt"`, `"tts"`, `"vad"`, `"end-of-turn"`), each with its
107
- * builds ranked and what is installed; rejects with `invalid-capability` for any other.
107
+ * builds ranked, what is installed and when it was last loaded (`lastUsedAt`); rejects with `invalid-capability`
108
+ * for any other.
108
109
  * @param {"stt" | "tts" | "vad" | "end-of-turn"} capability
109
110
  * @returns {Promise<LocalModelInfo[]>}
110
111
  */
@@ -818,7 +819,7 @@ function __wbg_get_imports() {
818
819
  __wbg__wbg_cb_unref_dcc1a90847f04c41: function(arg0) {
819
820
  arg0._wbg_cb_unref();
820
821
  },
821
- __wbg_abort_a5cdc6b1270f69c3: function() { return handleError(function (arg0) {
822
+ __wbg_abort_b8b9f2355a5f3aff: function() { return handleError(function (arg0) {
822
823
  const ret = arg0.abort();
823
824
  return ret;
824
825
  }, arguments); },
@@ -868,11 +869,11 @@ function __wbg_get_imports() {
868
869
  const ret = arg0.cancel();
869
870
  return ret;
870
871
  },
871
- __wbg_capabilities_b5e5bcc733db48b8: function() { return handleError(function (arg0) {
872
+ __wbg_capabilities_ffd129ff8443efcd: function() { return handleError(function (arg0) {
872
873
  const ret = arg0.capabilities();
873
874
  return ret;
874
875
  }, arguments); },
875
- __wbg_close_8ab7ac8467136953: function() { return handleError(function (arg0) {
876
+ __wbg_close_0766f697f077df99: function() { return handleError(function (arg0) {
876
877
  const ret = arg0.close();
877
878
  return ret;
878
879
  }, arguments); },
@@ -880,11 +881,11 @@ function __wbg_get_imports() {
880
881
  const ret = Reflect.construct(arg0, arg1);
881
882
  return ret;
882
883
  }, arguments); },
883
- __wbg_createWritable_3d194713b844bc79: function() { return handleError(function (arg0) {
884
+ __wbg_createWritable_9cfae58ccc200d2f: function() { return handleError(function (arg0) {
884
885
  const ret = arg0.createWritable();
885
886
  return ret;
886
887
  }, arguments); },
887
- __wbg_detectLanguage_c88793e5c87907fa: function() { return handleError(function (arg0, arg1, arg2) {
888
+ __wbg_detectLanguage_dced020a38eb4a90: function() { return handleError(function (arg0, arg1, arg2) {
888
889
  const ret = detectLanguage(arg0, arg1, arg2);
889
890
  return ret;
890
891
  }, arguments); },
@@ -892,15 +893,15 @@ function __wbg_get_imports() {
892
893
  const ret = Array.from(arg0);
893
894
  return ret;
894
895
  },
895
- __wbg_getDirectoryHandle_cc672697ce111750: function() { return handleError(function (arg0, arg1, arg2, arg3) {
896
+ __wbg_getDirectoryHandle_fa7413c3f771e4cd: function() { return handleError(function (arg0, arg1, arg2, arg3) {
896
897
  const ret = arg0.getDirectoryHandle(getStringFromWasm0(arg1, arg2), arg3);
897
898
  return ret;
898
899
  }, arguments); },
899
- __wbg_getFileHandle_3a422892559f72a8: function() { return handleError(function (arg0, arg1, arg2, arg3) {
900
+ __wbg_getFileHandle_bba2e89de047aca6: function() { return handleError(function (arg0, arg1, arg2, arg3) {
900
901
  const ret = arg0.getFileHandle(getStringFromWasm0(arg1, arg2), arg3);
901
902
  return ret;
902
903
  }, arguments); },
903
- __wbg_getFile_6b82a941e9dae613: function() { return handleError(function (arg0) {
904
+ __wbg_getFile_5287aa8d4b50db4a: function() { return handleError(function (arg0) {
904
905
  const ret = arg0.getFile();
905
906
  return ret;
906
907
  }, arguments); },
@@ -931,11 +932,11 @@ function __wbg_get_imports() {
931
932
  const ret = arg0.headers;
932
933
  return ret;
933
934
  },
934
- __wbg_importEspeak_7cb11e9098aaa69f: function() { return handleError(function () {
935
+ __wbg_importEspeak_76d1a3dc2d17fe5c: function() { return handleError(function () {
935
936
  const ret = importEspeak();
936
937
  return ret;
937
938
  }, arguments); },
938
- __wbg_importTransformers_4771fbafdde6b11d: function() { return handleError(function () {
939
+ __wbg_importTransformers_c50948ad730c61b2: function() { return handleError(function () {
939
940
  const ret = importTransformers();
940
941
  return ret;
941
942
  }, arguments); },
@@ -997,7 +998,7 @@ function __wbg_get_imports() {
997
998
  const ret = LocalModel.__wrap(arg0);
998
999
  return ret;
999
1000
  },
1000
- __wbg_move_a1b9d32f9dbee886: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1001
+ __wbg_move_1fc26f5041388062: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1001
1002
  const ret = arg0.move(arg1, getStringFromWasm0(arg2, arg3));
1002
1003
  return ret;
1003
1004
  }, arguments); },
@@ -1073,6 +1074,10 @@ function __wbg_get_imports() {
1073
1074
  state0.a = 0;
1074
1075
  }
1075
1076
  },
1077
+ __wbg_now_aa4ccb83129e9e55: function() {
1078
+ const ret = Date.now();
1079
+ return ret;
1080
+ },
1076
1081
  __wbg_now_e7c6795a7f81e10f: function(arg0) {
1077
1082
  const ret = arg0.now();
1078
1083
  return ret;
@@ -1122,7 +1127,7 @@ function __wbg_get_imports() {
1122
1127
  const ret = RemoteModel.__wrap(arg0);
1123
1128
  return ret;
1124
1129
  },
1125
- __wbg_removeEntry_e800316632dd1389: function() { return handleError(function (arg0, arg1, arg2) {
1130
+ __wbg_removeEntry_5c302d02c765666c: function() { return handleError(function (arg0, arg1, arg2) {
1126
1131
  const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2));
1127
1132
  return ret;
1128
1133
  }, arguments); },
@@ -1133,7 +1138,7 @@ function __wbg_get_imports() {
1133
1138
  const ret = Promise.resolve(arg0);
1134
1139
  return ret;
1135
1140
  },
1136
- __wbg_serve_42dd3893fad4deab: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1141
+ __wbg_serve_acf419c16af0725d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1137
1142
  const ret = serve(arg0, getStringFromWasm0(arg1, arg2), arg3);
1138
1143
  return ret;
1139
1144
  }, arguments); },
@@ -1145,7 +1150,7 @@ function __wbg_get_imports() {
1145
1150
  const ret = arg0.signal;
1146
1151
  return ret;
1147
1152
  },
1148
- __wbg_sileroRun_6e3299c95fe3ca5c: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1153
+ __wbg_sileroRun_a581396554b5e6f0: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1149
1154
  const ret = sileroRun(arg0, arg1, arg2, arg3, arg4 >>> 0);
1150
1155
  return ret;
1151
1156
  }, arguments); },
@@ -1153,7 +1158,7 @@ function __wbg_get_imports() {
1153
1158
  const ret = arg0.size;
1154
1159
  return ret;
1155
1160
  },
1156
- __wbg_smartTurnRun_8100ba2230364530: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1161
+ __wbg_smartTurnRun_e019e392ee39240e: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1157
1162
  const ret = smartTurnRun(arg0, arg1, getStringFromWasm0(arg2, arg3), arg4, arg5 >>> 0, arg6 >>> 0);
1158
1163
  return ret;
1159
1164
  }, arguments); },
@@ -1213,26 +1218,26 @@ function __wbg_get_imports() {
1213
1218
  const ret = WebEngine.__wrap(arg0);
1214
1219
  return ret;
1215
1220
  },
1216
- __wbg_write_a0f6ab8ae32cfdaf: function() { return handleError(function (arg0, arg1) {
1221
+ __wbg_write_42540e0a6db7b637: function() { return handleError(function (arg0, arg1) {
1217
1222
  const ret = arg0.write(arg1);
1218
1223
  return ret;
1219
1224
  }, arguments); },
1220
- __wbg_write_edd5321b89ebd6e9: function() { return handleError(function (arg0, arg1) {
1225
+ __wbg_write_5ab11532342d2d3f: function() { return handleError(function (arg0, arg1) {
1221
1226
  const ret = arg0.write(arg1);
1222
1227
  return ret;
1223
1228
  }, arguments); },
1224
1229
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
1225
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 752, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1230
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 756, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1226
1231
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke___wasm_bindgen_63a46d96b29ae508___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_63a46d96b29ae508___JsError___true_);
1227
1232
  return ret;
1228
1233
  },
1229
1234
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
1230
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [String], shim_idx: 181, ret: NamedExternref("Promise<any>"), inner_ret: Some(NamedExternref("Promise<any>")) }, mutable: true }) -> Externref`.
1235
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [String], shim_idx: 290, ret: NamedExternref("Promise<any>"), inner_ret: Some(NamedExternref("Promise<any>")) }, mutable: true }) -> Externref`.
1231
1236
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke___alloc_508e33bd5656020b___string__String__js_sys_9a9f93f03cc98e8d___Promise__true_);
1232
1237
  return ret;
1233
1238
  },
1234
1239
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
1235
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 183, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1240
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 292, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1236
1241
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke_______true_);
1237
1242
  return ret;
1238
1243
  },
@@ -1259,7 +1264,7 @@ function __wbg_get_imports() {
1259
1264
  return {
1260
1265
  __proto__: null,
1261
1266
  "./sidevoice_engine_bg.js": import0,
1262
- "./snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline4.js": import1,
1267
+ "./snippets/sidevoice-engine-a85788d87fd0a079/inline4.js": import1,
1263
1268
  };
1264
1269
  }
1265
1270
 
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sidevoice/engine",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Sidevoice engine for the web: local voice models in the browser, as WebAssembly.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",