@hackbuild/ai-views 0.1.2 → 0.1.5

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/llms.md CHANGED
@@ -96,6 +96,12 @@ interface DefineTarget {
96
96
 
97
97
  The part of a custom element registry `define` uses; `customElements` satisfies it.
98
98
 
99
+ ```ts
100
+ function droppedFiles(dt: DataTransfer | null | undefined): Promise<File[]>
101
+ ```
102
+
103
+ The files of a drop, with dropped folders read through, media only.
104
+
99
105
  ```ts
100
106
  const ELEMENT_NAMES: readonly ["model-select", "model-jobs", "chat-pane", "chat-composer", "chat-list", "chat-context", "transcribe-drop", "transcript-view", "transcribe-queue", "transcript-exports", "mask-studio", "mask-tools", "mask-verbs", "mask-rack", "frame-view", "camera-feed", "memory-inspector"]
101
107
  ```
@@ -110,6 +116,7 @@ A tag name `define` registers, before any prefix.
110
116
 
111
117
  ```ts
112
118
  interface FoundMask {
119
+ box?: { h: number; w: number; x: number; y: number };
113
120
  label: string;
114
121
  mask: Uint8Array;
115
122
  score: number;
@@ -146,9 +153,32 @@ function gateWords(row: ModelRow | undefined): string
146
153
 
147
154
  The words of a gate's one pink button for a pick: "load, 1.7 gb", then "ready".
148
155
 
156
+ ```ts
157
+ function isMedia(f: { name: string; type: string }): boolean
158
+ ```
159
+
160
+ A file a speech run can read: audio or video by type or by name.
161
+
162
+ ```ts
163
+ function isProtected(it: StoredItem): boolean
164
+ ```
165
+
166
+ True when an item is kept out of cleanup: decay never drops it.
167
+
168
+ ```ts
169
+ interface MaskEverythingOptions {
170
+ confidence?: number;
171
+ iou?: number;
172
+ minArea?: number;
173
+ sigmoid?: boolean;
174
+ }
175
+ ```
176
+
177
+ Decode settings for a segment everything model (FastSAM): confidence, overlap, smallest area, sigmoid.
178
+
149
179
  ```ts
150
180
  interface MaskModels {
151
- everything?: (image: MaskPixels) => Promise<FoundMask[]>;
181
+ everything?: (image: MaskPixels, o?: MaskEverythingOptions) => Promise<FoundMask[]>;
152
182
  segment?: (image: MaskPixels, point: { x: number; y: number }) => Promise<Uint8Array<ArrayBufferLike> | null>;
153
183
  }
154
184
  ```
@@ -157,27 +187,37 @@ The segment models a mask studio calls: a click segment for one point and a segm
157
187
 
158
188
  ```ts
159
189
  interface MaskStudio extends Mounted {
190
+ canWant: boolean;
160
191
  hasEverything: boolean;
161
192
  hasSegment: boolean;
193
+ addFound(list: FoundMask[]): void;
162
194
  clear(): void;
195
+ clearFound(): void;
163
196
  cutAt(x: number, y: number, mode?: MaskMode): Promise<void>;
164
197
  dispose(): void;
165
- everything(): Promise<void>;
198
+ everything(o?: MaskEverythingOptions): Promise<void>;
166
199
  expand(px?: number): void;
167
- exportAs(kind: MaskOutput): Promise<Blob | null>;
200
+ exportAs(kind: MaskOutput | "inverse"): Promise<Blob | null>;
168
201
  forget(id: number): void;
169
202
  invert(): void;
170
203
  mask(kind?: MaskOutput): ImageData | null;
204
+ mergeFound(): void;
171
205
  pick(): void;
206
+ pixels(): MaskPixels | null;
172
207
  redo(): void;
208
+ removeFound(index: number): void;
173
209
  restore(id: number): void;
174
210
  save(name?: string): void;
211
+ setContiguous(on: boolean): void;
175
212
  setImage(src: string | HTMLImageElement | HTMLCanvasElement | ImageBitmap | MaskPixels): Promise<void>;
213
+ setMask(mask: ArrayLike<number>): void;
176
214
  setMode(m: MaskMode): void;
177
215
  setModels(m: MaskModels): void;
178
216
  setSize(px: number): void;
179
217
  setTolerance(pct: number): void;
180
218
  setTool(t: StudioTool): void;
219
+ setView(v: StudioView): void;
220
+ showFound(index: number, on: boolean): void;
181
221
  shrink(px?: number): void;
182
222
  smooth(r?: number): void;
183
223
  state(): StudioState;
@@ -185,6 +225,7 @@ interface MaskStudio extends Mounted {
185
225
  toggleFound(index: number): void;
186
226
  undo(): void;
187
227
  zoom(dir: -1 | 0 | 1): void;
228
+ zoomTo(z: number): void;
188
229
  }
189
230
  ```
190
231
 
@@ -196,6 +237,7 @@ interface MaskStudioOptions {
196
237
  name?: string;
197
238
  note?: string;
198
239
  onSample?: () => void;
240
+ onWant?: (kind: "segment" | "everything") => void;
199
241
  sampleLabel?: string;
200
242
  title?: string;
201
243
  }
@@ -212,6 +254,44 @@ interface MemoryInspector extends Mounted {
212
254
 
213
255
  A mounted memory inspector whose `set` shows a new recall.
214
256
 
257
+ ```ts
258
+ interface MemoryLike {
259
+ add(text: string, o?: { kind?: "note" | "episode" | "gist" | "lesson" | "fact" | "rule" | "lore" | "doc"; meta?: Record<string, unknown>; section?: string }): Promise<unknown>;
260
+ all(): StoredItem[];
261
+ edit(id: number, patch: EditPatch): Promise<unknown>;
262
+ export(): ExportData;
263
+ import(data: ExportData, o?: { replace?: boolean }): Promise<number>;
264
+ recall(q: string, o?: { k?: number }): Promise<Recall>;
265
+ remove(ids: number[]): Promise<void>;
266
+ }
267
+ ```
268
+
269
+ What a memory pane needs from a store; a `Memory` from @hackbuild/memory fits.
270
+
271
+ ```ts
272
+ interface MemoryPaneHandle extends Mounted {
273
+ dispose(): void;
274
+ refresh(): void;
275
+ used(labels: readonly string[]): void;
276
+ }
277
+ ```
278
+
279
+ A memory pane over a host: `refresh` after the store changes elsewhere, `used` to mark what the last reply used.
280
+
281
+ ```ts
282
+ interface MemoryPaneOptions {
283
+ acts?: readonly { id: string; label: string }[];
284
+ by?: "source" | "kind";
285
+ exportLabel?: string;
286
+ kinds?: Readonly<Record<string, string>>;
287
+ name?: string;
288
+ onAct?: (id: string) => void;
289
+ onChange?: () => void;
290
+ }
291
+ ```
292
+
293
+ Options of a memory pane.
294
+
215
295
  ```ts
216
296
  interface ModelSelectElement extends HTMLElement {
217
297
  env: Env | undefined;
@@ -262,6 +342,12 @@ function mountContextMeter(host: HTMLElement, thread: ChatThread, o?: { budget?:
262
342
 
263
343
  The context meter (hackbuild-ui `.hb-ctxmeter`): what the next request carries against the model's context.
264
344
 
345
+ ```ts
346
+ function mountExportMenu(host: HTMLElement, queue: TranscribeQueue, o?: { go?: boolean; save?: (name: string, data: string | Uint8Array<ArrayBufferLike>, type: string) => void; tool?: string }): Mounted
347
+ ```
348
+
349
+ ExportMenu: the selected transcript as txt, srt, vtt or json, a copy, and every finished transcript as one zip with a manifest, plus undo and redo of edits.
350
+
265
351
  ```ts
266
352
  function mountFrameView(host: HTMLElement, o?: FrameViewOptions): FrameView
267
353
  ```
@@ -269,7 +355,7 @@ function mountFrameView(host: HTMLElement, o?: FrameViewOptions): FrameView
269
355
  Draws a frame in a camera tile on a host, with boxes, landmarks, a corner tag and a caption over it.
270
356
 
271
357
  ```ts
272
- function mountMaskRack(host: HTMLElement, studio: MaskStudio, part: "found" | "mask" | "saved" | "export", o?: { name?: string }): Mounted
358
+ function mountMaskRack(host: HTMLElement, studio: MaskStudio, part: "export" | "found" | "mask" | "saved", o?: { name?: string }): Mounted
273
359
  ```
274
360
 
275
361
  The rack parts: what was found, the mask tools' settings, and the exports once there is a mask.
@@ -298,6 +384,12 @@ function mountMemoryInspector(host: HTMLElement, rec?: RecallLike | null): Memor
298
384
 
299
385
  Shows a recall trace as a table on a host.
300
386
 
387
+ ```ts
388
+ function mountMemoryPane(host: HTMLElement, mem: MemoryLike, o?: MemoryPaneOptions): MemoryPaneHandle
389
+ ```
390
+
391
+ The memory pane: counts, search, a source or kind filter, add a note, the list with protect and forget, export, import, erase.
392
+
301
393
  ```ts
302
394
  function mountModelJobs(host: HTMLElement, jobs: JobsPick, o?: { go?: boolean }): Mounted
303
395
  ```
@@ -310,6 +402,24 @@ function mountModelSelect(host: HTMLElement, pick: ModelPick, o?: ModelSelectOpt
310
402
 
311
403
  The closed picker over a host; pressing it opens the sheet.
312
404
 
405
+ ```ts
406
+ function mountPersonaRack(host: HTMLElement, rack: PersonaRack): Mounted
407
+ ```
408
+
409
+ The persona rack: presets one press away, name, the three parts with their cost, the template, save, and the persona as a file.
410
+
411
+ ```ts
412
+ function mountSessionMenu(host: HTMLElement, list: ChatList, o?: { onImport?: (n: number) => void }): Mounted
413
+ ```
414
+
415
+ The session menu of a chat list: clear the open chat, export it as markdown, every chat as json, and import.
416
+
417
+ ```ts
418
+ function mountSourcesDrop(host: HTMLElement, o: SourcesDropOptions): Mounted
419
+ ```
420
+
421
+ A drop zone for sources: files or a whole folder of text, pdf, docx, zip and mail go into memory; a line per file says what came in.
422
+
313
423
  ```ts
314
424
  function mountTranscribeDrop(host: HTMLElement, queue: TranscribeQueue, o?: TranscribeDropOptions): TranscribeDropHandle
315
425
  ```
@@ -334,33 +444,63 @@ function mountTranscriptView(host: HTMLElement, queue: TranscribeQueue, o?: Tran
334
444
 
335
445
  The selected channel's transcript over a host.
336
446
 
447
+ ```ts
448
+ function mountVoiceClone(host: HTMLElement, sp: Speaker, o?: { can?: () => boolean; hint?: string; seconds?: number }): Mounted
449
+ ```
450
+
451
+ The voice clone row of a speaker: clone from an audio file, record `seconds` of mic, download the clone as wav, clear it.
452
+
453
+ ```ts
454
+ function mountVoiceRow(host: HTMLElement, row: VoiceRow, o?: { test?: string }): Mounted
455
+ ```
456
+
457
+ The voice row: auto speak, voice, rate, pitch, test and stop.
458
+
337
459
  ```ts
338
460
  function pickSheet(pick: ModelPick): Mounted & { open(): void }
339
461
  ```
340
462
 
341
463
  The sheet of one pick, in a drawer on the body.
342
464
 
465
+ ```ts
466
+ function protect(mem: Pick<MemoryLike, "edit">, it: StoredItem, on: boolean): Promise<void>
467
+ ```
468
+
469
+ Protect an item from cleanup (it becomes lore, which never decays) or give it back its kind.
470
+
343
471
  ```ts
344
472
  function shortName(name: string): string
345
473
  ```
346
474
 
347
475
  A model name cut for the bar chip: filler words (instruct, chat, quant tags) go, and a name of more than three words keeps its first two and its last, which is usually the size: "hermes 3 llama 3.2 3b" reads "hermes 3 3b".
348
476
 
477
+ ```ts
478
+ interface SourcesDropOptions {
479
+ accept?: string;
480
+ ingest: (files: File[], o: { onFile: (e: { chunks: number; name: string; note?: string }) => void }) => Promise<{ chunks: number; files: number }>;
481
+ }
482
+ ```
483
+
484
+ Options for a sources drop: what reads the files into memory, and a line per file.
485
+
349
486
  ```ts
350
487
  interface StudioState {
351
488
  busy: string;
352
489
  canRedo: boolean;
353
490
  canUndo: boolean;
491
+ contiguous: boolean;
354
492
  coverage: number;
355
493
  error: string;
356
- found: (FoundMask & { colour: string; on: boolean })[];
494
+ found: (FoundMask & { colour: string; hidden: boolean; on: boolean })[];
357
495
  height: number;
496
+ hover: number;
358
497
  mode: MaskMode;
359
498
  ready: boolean;
360
499
  saved: { coverage: number; id: number; name: string; thumb: string }[];
361
500
  size: number;
362
501
  tolerance: number;
363
502
  tool: StudioTool;
503
+ view: StudioView;
364
504
  width: number;
365
505
  zoom: number;
366
506
  }
@@ -374,10 +514,17 @@ type StudioTool = "point" | MaskTool
374
514
 
375
515
  A mask studio tool: the click segment point or one of the hackbuild-ui mask tools.
376
516
 
517
+ ```ts
518
+ type StudioView = "composite" | "mask" | "instances"
519
+ ```
520
+
521
+ What the canvas shows: the picture with the mask, the mask alone, or every found object in its colour.
522
+
377
523
  ```ts
378
524
  interface TranscribeDropHandle extends Mounted {
379
525
  dispose(): void;
380
526
  pick(): void;
527
+ pickFolder(): void;
381
528
  }
382
529
  ```
383
530
 
@@ -386,6 +533,7 @@ A mounted drop zone whose `pick` opens the file picker.
386
533
  ```ts
387
534
  interface TranscribeDropOptions extends TranscriptViewOptions {
388
535
  accept?: string;
536
+ folders?: boolean;
389
537
  note?: string;
390
538
  onSample?: () => void;
391
539
  onSeek?: (seconds: number) => void;
@@ -453,6 +601,12 @@ function boxWords(b: FrameBox): string
453
601
 
454
602
  "cup 94%", or the label alone, or the score alone.
455
603
 
604
+ ```ts
605
+ function canClone(e: unknown): e is PocketEngine
606
+ ```
607
+
608
+ True when the engine clones a voice from reference audio.
609
+
456
610
  ```ts
457
611
  interface Channel {
458
612
  dropped: Dropped[];
@@ -464,8 +618,10 @@ interface Channel {
464
618
  model?: string;
465
619
  name: string;
466
620
  pct: number;
621
+ rail?: { db: number[]; kept: number[] };
467
622
  segments: Seg[];
468
623
  size: number;
624
+ stats?: { density: number; dur: number; forced: boolean; gainDb: number; loudDb: number; noiseDb: number; reels: number; rtf: number; snrDb: number; speechDb: number; thrDb: number; wall: number };
469
625
  status: StripStatus;
470
626
  }
471
627
  ```
@@ -482,9 +638,11 @@ Creates a list of chat threads, newest first, with one open; its `thread` always
482
638
  interface ChatList {
483
639
  readonly thread: ChatThread;
484
640
  create(): string;
641
+ dump(): ChatListData;
485
642
  open(id: string): void;
486
643
  remove(id: string): void;
487
644
  rename(id: string, title: string): void;
645
+ restore(data: ChatListData, o?: { replace?: boolean }): void;
488
646
  setEngine(engine: ChatEngine | null): void;
489
647
  snapshot(): ChatListSnapshot;
490
648
  subscribe(fn: (s: ChatListSnapshot) => void): () => void;
@@ -493,6 +651,17 @@ interface ChatList {
493
651
 
494
652
  Several chats: a list with the newest first, one open.
495
653
 
654
+ ```ts
655
+ interface ChatListData {
656
+ chats: { id: string; named?: boolean; title: string; turns: Turn[]; updated: number }[];
657
+ current?: string;
658
+ format: "hackbuild-chats";
659
+ version: 1;
660
+ }
661
+ ```
662
+
663
+ A chat list as plain data: format, version, the open chat and each chat's title and turns.
664
+
496
665
  ```ts
497
666
  interface ChatListItem {
498
667
  count: number;
@@ -522,6 +691,7 @@ Creates a chat thread that streams replies from an engine, with optional memory
522
691
  ```ts
523
692
  interface ChatThread {
524
693
  clear(): void;
694
+ load(turns: readonly Turn[]): void;
525
695
  markdown(title?: string): string;
526
696
  regenerate(): Promise<void>;
527
697
  remove(id: number): void;
@@ -734,7 +904,7 @@ interface JobsPick {
734
904
  presets(): { id: string; label: string; total: string }[];
735
905
  setPresets(p: readonly PickPreset[]): void;
736
906
  subscribe(fn: () => void): () => void;
737
- update(o: { env?: Env; estimate?: StorageEstimate | null; loader?: Loader; onRemove?: (rec: ModelRecord) => void | Promise<void>; records?: readonly ModelRecord[] }): void;
907
+ update(o: { env?: Env; estimate?: StorageEstimate | null; loader?: Loader; onRemove?: (rec: ModelRecord) => void | Promise<void>; records?: readonly ModelRecord[]; stored?: Iterable<string, any, any> }): void;
738
908
  }
739
909
  ```
740
910
 
@@ -804,7 +974,7 @@ interface ModelPick {
804
974
  result(id: string): unknown;
805
975
  snapshot(): PickSnapshot;
806
976
  subscribe(fn: (s: PickSnapshot) => void): () => void;
807
- update(o: { env?: Env; estimate?: StorageEstimate | null; loader?: Loader; onRemove?: (rec: ModelRecord) => void | Promise<void>; records?: readonly ModelRecord[] }): void;
977
+ update(o: { env?: Env; estimate?: StorageEstimate | null; loader?: Loader; onRemove?: (rec: ModelRecord) => void | Promise<void>; records?: readonly ModelRecord[]; stored?: Iterable<string, any, any> }): void;
808
978
  }
809
979
  ```
810
980
 
@@ -828,6 +998,47 @@ function ownRecord(job: Job, kind: OwnKind, v: Record<string, string>): ModelRec
828
998
 
829
999
  A record for a "your own" form.
830
1000
 
1001
+ ```ts
1002
+ interface Persona {
1003
+ first?: string;
1004
+ name: string;
1005
+ notes: string;
1006
+ profile: string;
1007
+ rules: string;
1008
+ }
1009
+ ```
1010
+
1011
+ A persona in three parts, highest priority first, with its name and first line.
1012
+
1013
+ ```ts
1014
+ interface PersonaPresetX {
1015
+ label: string;
1016
+ persona: Persona;
1017
+ }
1018
+ ```
1019
+
1020
+ A named persona a person can load in one press.
1021
+
1022
+ ```ts
1023
+ function personaRack(o?: { onSave?: (saved: PersonaPresetX[]) => void; persona?: Persona; presets?: readonly PersonaPresetX[]; saved?: readonly PersonaPresetX[] }): PersonaRack
1024
+ ```
1025
+
1026
+ Creates a persona rack with built in presets and any saved ones; `onSave` keeps the saved ones.
1027
+
1028
+ ```ts
1029
+ interface PersonaRack {
1030
+ load(i: number): void;
1031
+ removePreset(i: number): void;
1032
+ save(label: string): void;
1033
+ set(p: Partial<Persona>): void;
1034
+ snapshot(): { builtIn: number; on: number; persona: Persona; presets: readonly PersonaPresetX[] };
1035
+ subscribe(fn: (s: { builtIn: number; on: number; persona: Persona; presets: readonly PersonaPresetX[] }) => void): () => void;
1036
+ system(mem?: readonly MemoryUsed[], budgetTokens?: number): { dropped: string[]; text: string };
1037
+ }
1038
+ ```
1039
+
1040
+ The persona state: the current persona, presets, and the system prompt fitted to a budget.
1041
+
831
1042
  ```ts
832
1043
  interface PickOptions {
833
1044
  chosen?: string;
@@ -885,6 +1096,16 @@ type RecallLike = Pick<Recall, "trace" | "hits" | "query" | "mode">
885
1096
 
886
1097
  The parts of a memory recall the inspector shows: trace, hits, query and mode.
887
1098
 
1099
+ ```ts
1100
+ interface RepoCheck {
1101
+ note: string;
1102
+ ok: boolean;
1103
+ onnx: number;
1104
+ }
1105
+ ```
1106
+
1107
+ What a hub repo check found: whether it exists, whether it carries onnx files, and the words a row shows.
1108
+
888
1109
  ```ts
889
1110
  interface RowContext {
890
1111
  env?: Env;
@@ -908,6 +1129,7 @@ One record as one picker row.
908
1129
  ```ts
909
1130
  interface RunContext {
910
1131
  onProgress: (fraction: number) => void;
1132
+ options?: TranscribeRunOptions;
911
1133
  signal: AbortSignal;
912
1134
  }
913
1135
  ```
@@ -920,7 +1142,9 @@ interface RunResult {
920
1142
  duration?: number;
921
1143
  language?: string;
922
1144
  model?: string;
1145
+ rail?: { db: number[]; kept: number[] };
923
1146
  segments: Seg[];
1147
+ stats?: { density: number; dur: number; forced: boolean; gainDb: number; loudDb: number; noiseDb: number; reels: number; rtf: number; snrDb: number; speechDb: number; thrDb: number; wall: number };
924
1148
  }
925
1149
  ```
926
1150
 
@@ -953,14 +1177,67 @@ function sizeWords(r: ModelRecord): string | undefined
953
1177
 
954
1178
  Download words: "1.7 gb".
955
1179
 
1180
+ ```ts
1181
+ function speaker(engine: () => Engine | null, o?: SpeakerOptions): Speaker
1182
+ ```
1183
+
1184
+ A speaker over the engine `engine()` returns at each line (null: text only, timed by `play`).
1185
+
1186
+ ```ts
1187
+ interface Speaker {
1188
+ readonly cloned: boolean;
1189
+ clearClone(): void;
1190
+ cloneFile(file: Blob): Promise<number>;
1191
+ cloneMic(seconds: number, onTick?: (left: number) => void): Promise<number>;
1192
+ cloneWav(): Blob | null;
1193
+ say(text: string): Promise<void>;
1194
+ stop(): void;
1195
+ subscribe(fn: () => void): () => void;
1196
+ }
1197
+ ```
1198
+
1199
+ Spoken lines in order, and the clone.
1200
+
1201
+ ```ts
1202
+ interface SpeakerOptions {
1203
+ config?: () => VoiceConfig;
1204
+ halt?: () => void;
1205
+ onLine?: (text: string) => void;
1206
+ play?: (line: SpokenLine) => Promise<void>;
1207
+ }
1208
+ ```
1209
+
1210
+ Options of `speaker`.
1211
+
1212
+ ```ts
1213
+ interface SpokenLine {
1214
+ audio?: AudioBuffer;
1215
+ phonemes?: readonly { phoneme?: string; t0: number; t1: number }[];
1216
+ text: string;
1217
+ words?: readonly { end?: number; start?: number; t0: number; t1: number; text?: string }[];
1218
+ }
1219
+ ```
1220
+
1221
+ One line ready to play: the text, and for a rendering engine the audio with its word and phoneme times.
1222
+
1223
+ ```ts
1224
+ function storedIds(store: Pick<WeightStore, "keys">, records: readonly ModelRecord[]): Promise<string[]>
1225
+ ```
1226
+
1227
+ The ids of records whose files are already in a weight store: the cache badge of a picker.
1228
+
956
1229
  ```ts
957
1230
  interface ThreadOptions {
958
1231
  engine?: ChatEngine | null;
1232
+ history?: () => number;
959
1233
  maxTokens?: number;
960
1234
  noEngine?: string;
961
1235
  now?: () => number;
1236
+ onReply?: (turn: Turn, said: string) => void;
962
1237
  recall?: (query: string) => Promise<MemoryUsed[]>;
963
- system?: string;
1238
+ stream?: () => Omit<StreamOptions, "signal">;
1239
+ system?: string | () => string;
1240
+ systemFor?: (mem: MemoryUsed[]) => string;
964
1241
  }
965
1242
  ```
966
1243
 
@@ -1005,7 +1282,7 @@ function traceRows(r: Pick<Recall, "trace" | "hits">, maxText?: number): TraceRo
1005
1282
  The rows of a recall trace as text, marking the hits handed to the model.
1006
1283
 
1007
1284
  ```ts
1008
- function transcribeQueue(o: { autostart?: boolean; run: Transcriber }): TranscribeQueue
1285
+ function transcribeQueue(o: { autostart?: boolean; options?: () => TranscribeRunOptions; run: Transcriber }): TranscribeQueue
1009
1286
  ```
1010
1287
 
1011
1288
  Creates a transcribe queue that runs each file through `run`, one at a time.
@@ -1025,6 +1302,7 @@ interface TranscribeQueue {
1025
1302
  stop(): void;
1026
1303
  subscribe(fn: (s: QueueSnapshot) => void): () => void;
1027
1304
  undo(): void;
1305
+ zip(o?: { date?: Date; tool?: string }): { data: Uint8Array; manifest: Manifest; name: string } | null;
1028
1306
  }
1029
1307
  ```
1030
1308
 
@@ -1036,6 +1314,23 @@ type Transcriber = (file: Blob & { name: string }, ctx: RunContext) => Promise<R
1036
1314
 
1037
1315
  Turns one file into a transcript.
1038
1316
 
1317
+ ```ts
1318
+ interface TranscribeRunOptions extends FrontEndOptions {
1319
+ channel?: "auto" | "mix" | "L" | "R";
1320
+ denoise?: 0 | 1 | 2 | 3;
1321
+ halluc?: boolean;
1322
+ hp?: number;
1323
+ language?: string;
1324
+ maxGainDb?: number;
1325
+ perReelAgc?: boolean;
1326
+ skipSilence?: boolean;
1327
+ targetDb?: number;
1328
+ vadMargin?: number;
1329
+ }
1330
+ ```
1331
+
1332
+ Run settings a transcriber reads: the capture front end (target level, lift, denoise, gate margin, rumble filter, skip silence, re-level), the channel, the language and the phantom filter.
1333
+
1039
1334
  ```ts
1040
1335
  interface Turn {
1041
1336
  at: number;
@@ -1064,6 +1359,31 @@ function useModelPick(job: Job, o?: PickOptions): ModelPick
1064
1359
 
1065
1360
  Creates a model picker for a job, with rows that say whether each model fits this machine.
1066
1361
 
1362
+ ```ts
1363
+ function verifyRepo(repo: string, o?: { fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>; host?: string }): Promise<RepoCheck>
1364
+ ```
1365
+
1366
+ Checks a hub repo id before it is used as your own model: it exists, it is public, and it carries onnx files transformers.js can run.
1367
+
1368
+ ```ts
1369
+ function voiceRow(engine: NativeEngine, o?: { auto?: boolean; onChange?: (s: { auto: boolean; pitch: number; rate: number; voice: string }) => void; pitch?: number; rate?: number; voice?: string }): VoiceRow
1370
+ ```
1371
+
1372
+ Creates the voice state over a native engine (`webSpeechEngine()` of @hackbuild/speak).
1373
+
1374
+ ```ts
1375
+ interface VoiceRow {
1376
+ reply(text: string): void;
1377
+ set(p: Partial<{ auto: boolean; pitch: number; rate: number; voice: string }>): void;
1378
+ snapshot(): { auto: boolean; error: string; pitch: number; rate: number; speaking: boolean; voice: string; voices: string[] };
1379
+ speak(text: string): Promise<void>;
1380
+ stop(): void;
1381
+ subscribe(fn: (s: { auto: boolean; error: string; pitch: number; rate: number; speaking: boolean; voice: string; voices: string[] }) => void): () => void;
1382
+ }
1383
+ ```
1384
+
1385
+ Spoken replies: auto speak, the voice, rate and pitch, speak and stop.
1386
+
1067
1387
  ```ts
1068
1388
  function weightKeys(rec: ModelRecord): string[]
1069
1389
  ```
@@ -1114,6 +1434,12 @@ const ContextMeter: DefineComponent<{ budget: number; system: string; thread: Ch
1114
1434
 
1115
1435
  Vue component that shows what the next request carries against the context budget.
1116
1436
 
1437
+ ```ts
1438
+ const ExportMenu: DefineComponent<{ go: boolean; queue: TranscribeQueue; tool: string }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, ToResolvedProps<{ go: boolean; queue: TranscribeQueue; tool: string }, {}>, { go: boolean; tool: string }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1439
+ ```
1440
+
1441
+ Vue component for the export menu of a transcribe queue: four formats, copy, all as zip, undo and redo.
1442
+
1117
1443
  ```ts
1118
1444
  const FrameView: DefineComponent<ExtractPropTypes<{ mirror: { default: boolean; type: BooleanConstructor }; results: { default: () => {}; type: PropType<FrameResults> }; source: { default: null; type: PropType<string | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | null> } }>, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "view"[], "view", PublicProps, ToResolvedProps<ExtractPropTypes<{ mirror: { default: boolean; type: BooleanConstructor }; results: { default: () => {}; type: PropType<FrameResults> }; source: { default: null; type: PropType<string | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | null> } }>, "view"[]>, { mirror: boolean; results: FrameResults; source: string | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | null }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1119
1445
  ```
@@ -1121,16 +1447,16 @@ const FrameView: DefineComponent<ExtractPropTypes<{ mirror: { default: boolean;
1121
1447
  Vue component that draws a frame with boxes, landmarks and a caption; emits `view` with the mounted view.
1122
1448
 
1123
1449
  ```ts
1124
- const MaskRack: DefineComponent<{ name: string; part: "found" | "mask" | "saved" | "export"; studio: MaskStudio }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, ToResolvedProps<{ name: string; part: "found" | "mask" | "saved" | "export"; studio: MaskStudio }, {}>, { name: string; part: "found" | "mask" | "saved" | "export" }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1450
+ const MaskRack: DefineComponent<{ name: string; part: "export" | "found" | "mask" | "saved"; studio: MaskStudio }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, ToResolvedProps<{ name: string; part: "export" | "found" | "mask" | "saved"; studio: MaskStudio }, {}>, { name: string; part: "export" | "found" | "mask" | "saved" }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1125
1451
  ```
1126
1452
 
1127
1453
  Vue component for one rack part of a mask studio: found, mask, saved or export.
1128
1454
 
1129
1455
  ```ts
1130
- const MaskStudio: DefineComponent<ExtractPropTypes<{ models: { default: () => {}; type: PropType<MaskModels> }; sampleLabel: { default: string; type: StringConstructor } }>, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("sample" | "studio")[], "sample" | "studio", PublicProps, ToResolvedProps<ExtractPropTypes<{ models: { default: () => {}; type: PropType<MaskModels> }; sampleLabel: { default: string; type: StringConstructor } }>, ("sample" | "studio")[]>, { models: MaskModels; sampleLabel: string }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1456
+ const MaskStudio: DefineComponent<ExtractPropTypes<{ demand: { default: boolean; type: BooleanConstructor }; models: { default: () => {}; type: PropType<MaskModels> }; sampleLabel: { default: string; type: StringConstructor } }>, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("sample" | "studio" | "want")[], "sample" | "studio" | "want", PublicProps, ToResolvedProps<ExtractPropTypes<{ demand: { default: boolean; type: BooleanConstructor }; models: { default: () => {}; type: PropType<MaskModels> }; sampleLabel: { default: string; type: StringConstructor } }>, ("sample" | "studio" | "want")[]>, { demand: boolean; models: MaskModels; sampleLabel: string }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1131
1457
  ```
1132
1458
 
1133
- Vue component for a mask studio; emits `studio` with the mounted studio and `sample` when the sample button is pressed.
1459
+ Vue component for a mask studio; emits `studio` with the mounted studio, `sample` when the sample button is pressed, and with `demand` set, `want` when a tool needs a model not loaded yet.
1134
1460
 
1135
1461
  ```ts
1136
1462
  const MaskTools: DefineComponent<{ studio: MaskStudio }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, ToResolvedProps<{ studio: MaskStudio }, {}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
@@ -1150,6 +1476,12 @@ const MemoryInspector: DefineComponent<ExtractPropTypes<{ recall: { default: nul
1150
1476
 
1151
1477
  Vue component that shows a recall trace as a table.
1152
1478
 
1479
+ ```ts
1480
+ const MemoryPane: DefineComponent<{ acts?: readonly { id: string; label: string }[]; by: "source" | "kind"; exportLabel: string; kinds?: Record<string, string>; memory: MemoryLike; name: string }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("change" | "pane" | "act")[], "change" | "pane" | "act", PublicProps, ToResolvedProps<{ acts?: readonly { id: string; label: string }[]; by: "source" | "kind"; exportLabel: string; kinds?: Record<string, string>; memory: MemoryLike; name: string }, ("change" | "pane" | "act")[]>, { acts: readonly { id: string; label: string }[] | undefined; by: "source" | "kind"; exportLabel: string; kinds: Record<string, string>; name: string }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1481
+ ```
1482
+
1483
+ Vue component for a memory pane over a store; emits `pane` with the handle (refresh, used).
1484
+
1153
1485
  ```ts
1154
1486
  const ModelJobs: DefineComponent<{ go: boolean; jobs: JobsPick }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, ToResolvedProps<{ go: boolean; jobs: JobsPick }, {}>, { go: boolean }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1155
1487
  ```
@@ -1163,10 +1495,28 @@ const ModelSelect: DefineComponent<{ env?: Env; go: boolean; job: Job; loader?:
1163
1495
  Vue component for a model picker of one job; emits `pick`, `choose`, `loaded` and `failed`.
1164
1496
 
1165
1497
  ```ts
1166
- const TranscribeDrop: DefineComponent<{ accept: string; queue: TranscribeQueue; sampleLabel: string }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "sample"[], "sample", PublicProps, ToResolvedProps<{ accept: string; queue: TranscribeQueue; sampleLabel: string }, "sample"[]>, { accept: string; sampleLabel: string }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1498
+ const PersonaRack: DefineComponent<{ rack: PersonaRack }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, ToResolvedProps<{ rack: PersonaRack }, {}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1499
+ ```
1500
+
1501
+ Vue component for a persona rack.
1502
+
1503
+ ```ts
1504
+ const SessionMenu: DefineComponent<{ list: ChatList }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "import"[], "import", PublicProps, ToResolvedProps<{ list: ChatList }, "import"[]>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1505
+ ```
1506
+
1507
+ Vue component for the session menu of a chat list; emits `import` with the number of chats.
1508
+
1509
+ ```ts
1510
+ const SourcesDrop: DefineComponent<{ accept: string; ingest: (files: File[], o: { onFile: (e: { chunks: number; name: string; note?: string }) => void }) => Promise<{ chunks: number; files: number }> }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, ToResolvedProps<{ accept: string; ingest: (files: File[], o: { onFile: (e: { chunks: number; name: string; note?: string }) => void }) => Promise<{ chunks: number; files: number }> }, {}>, { accept: string }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1167
1511
  ```
1168
1512
 
1169
- Vue component for the drop zone that becomes the transcript; emits `sample`.
1513
+ Vue component for a sources drop: files and folders into memory through `ingest`.
1514
+
1515
+ ```ts
1516
+ const TranscribeDrop: DefineComponent<{ accept: string; folders: boolean; note: string; queue: TranscribeQueue; sampleLabel: string; showDropped: boolean; title: string }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("drop" | "sample")[], "drop" | "sample", PublicProps, ToResolvedProps<{ accept: string; folders: boolean; note: string; queue: TranscribeQueue; sampleLabel: string; showDropped: boolean; title: string }, ("drop" | "sample")[]>, { accept: string; folders: boolean; note: string; sampleLabel: string; showDropped: boolean; title: string }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1517
+ ```
1518
+
1519
+ Vue component for the drop zone that becomes the transcript; emits `sample` and `drop` (the handle, whose `pick` opens the file picker).
1170
1520
 
1171
1521
  ```ts
1172
1522
  const TranscribeQueue: DefineComponent<{ queue: TranscribeQueue }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, ToResolvedProps<{ queue: TranscribeQueue }, {}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
@@ -1180,6 +1530,18 @@ const TranscriptView: DefineComponent<{ exports: boolean; queue: TranscribeQueue
1180
1530
 
1181
1531
  Vue component for the selected transcript, or its export buttons when `exports` is set.
1182
1532
 
1533
+ ```ts
1534
+ const VoiceClone: DefineComponent<{ can: boolean; hint: string; seconds: number; speaker: Speaker }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, ToResolvedProps<{ can: boolean; hint: string; seconds: number; speaker: Speaker }, {}>, { can: boolean; hint: string; seconds: number }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1535
+ ```
1536
+
1537
+ Vue component for the voice clone row of a speaker; `can` says the loaded voice clones.
1538
+
1539
+ ```ts
1540
+ const VoiceRow: DefineComponent<{ row: VoiceRow; test: string }, () => VNode<RendererNode, RendererElement, { [key: string]: any }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, ToResolvedProps<{ row: VoiceRow; test: string }, {}>, { test: string }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>
1541
+ ```
1542
+
1543
+ Vue component for a voice row.
1544
+
1183
1545
  ## Examples
1184
1546
 
1185
1547
  ### quick start