@hackbuild/ai-views 0.1.8 → 0.1.9

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
@@ -254,7 +254,7 @@ Changes are in the repository [CHANGELOG](../../CHANGELOG.md). Code is MIT ([LIC
254
254
 
255
255
  | file | gzip (measured) | ceiling |
256
256
  |---|---|---|
257
- | `dist/index.js` (main entry, imports external) | 21,595 bytes | 22,674 bytes |
257
+ | `dist/index.js` (main entry, imports external) | 21,606 bytes | 22,686 bytes |
258
258
  | `dist/single/elements.iife.js` (single file build) | 100,083 bytes | 105,087 bytes |
259
259
 
260
260
  Measured 2026-11-26 by `node tools/lint-packages.mjs` (gzip level 9) from the packed
@@ -18897,7 +18897,7 @@ self.onmessage = async (ev) => {
18897
18897
  },
18898
18898
  say(text) {
18899
18899
  const signal = ctl.signal;
18900
- chain = chain.then(() => speak(text, signal)).catch(() => void 0);
18900
+ chain = chain.then(() => speak(text, signal)).catch((err) => o.onError?.(err, text));
18901
18901
  return chain;
18902
18902
  },
18903
18903
  stop() {
@@ -18895,7 +18895,7 @@ function speaker(engine, o = {}) {
18895
18895
  },
18896
18896
  say(text) {
18897
18897
  const signal = ctl.signal;
18898
- chain = chain.then(() => speak(text, signal)).catch(() => void 0);
18898
+ chain = chain.then(() => speak(text, signal)).catch((err) => o.onError?.(err, text));
18899
18899
  return chain;
18900
18900
  },
18901
18901
  stop() {
package/dist/speaker.d.ts CHANGED
@@ -33,6 +33,8 @@ export interface SpeakerOptions {
33
33
  halt?: () => void;
34
34
  /** Each line as it starts, for a caption. */
35
35
  onLine?: (text: string) => void;
36
+ /** A line that failed to render or play, with the reason; the chain goes on with the next line. */
37
+ onError?: (err: unknown, text: string) => void;
36
38
  /** The voice config each line uses; a clone sets its own. */
37
39
  config?: () => VoiceConfig;
38
40
  }
package/dist/speaker.js CHANGED
@@ -62,7 +62,7 @@ export function speaker(engine, o = {}) {
62
62
  },
63
63
  say(text) {
64
64
  const signal = ctl.signal;
65
- chain = chain.then(() => speak(text, signal)).catch(() => undefined);
65
+ chain = chain.then(() => speak(text, signal)).catch((err) => o.onError?.(err, text));
66
66
  return chain;
67
67
  },
68
68
  stop() {
package/llms.md CHANGED
@@ -1202,6 +1202,7 @@ Spoken lines in order, and the clone.
1202
1202
  interface SpeakerOptions {
1203
1203
  config?: () => VoiceConfig;
1204
1204
  halt?: () => void;
1205
+ onError?: (err: unknown, text: string) => void;
1205
1206
  onLine?: (text: string) => void;
1206
1207
  play?: (line: SpokenLine) => Promise<void>;
1207
1208
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackbuild/ai-views",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Views that bind the browser AI packages to hackbuild-ui: a model picker per job, a chat pane and composer, a drop first transcriber, a mask studio, a frame view and a camera feed. Each ships as a Vue component and a custom element.",
5
5
  "type": "module",
6
6
  "license": "MIT",