@hackbuild/ai-views 0.1.0 → 0.1.2

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.
@@ -3874,7 +3874,7 @@ Component that was made reactive: `, type);
3874
3874
  skipped
3875
3875
  };
3876
3876
  }
3877
- /** The onnxruntime-web ladder the earlier transcription tool walks after one fetch: webgpu at basic, all, disabled, then wasm. */
3877
+ /** The onnxruntime-web ladder to walk after one fetch: webgpu at basic, all, disabled, then wasm. */
3878
3878
  function ortLadder() {
3879
3879
  return [
3880
3880
  {
@@ -3908,6 +3908,7 @@ Component that was made reactive: `, type);
3908
3908
  ];
3909
3909
  }
3910
3910
  // packages/models/src/pins.ts
3911
+ /** Pinned commits and file hashes per Hugging Face repo, written by tools/pin-weights.mjs. */
3911
3912
  const PINS = {
3912
3913
  "HuggingFaceTB/SmolLM2-135M-Instruct": {
3913
3914
  "revision": "12fd25f77366fa6b3b4b768ec3050bf629380bac",
@@ -6756,6 +6757,7 @@ Component that was made reactive: `, type);
6756
6757
  * added to a registry, so every loader resolves `resolve/<commit>/` URLs,
6757
6758
  * and pinnedSha gives the SHA-256 for such a URL.
6758
6759
  */
6760
+ /** The pin of a repo, or undefined when the repo is not pinned. */
6759
6761
  function pinOf(repo) {
6760
6762
  return repo && Object.hasOwn(PINS, repo) ? PINS[repo] : void 0;
6761
6763
  }
@@ -6765,15 +6767,15 @@ Component that was made reactive: `, type);
6765
6767
  }
6766
6768
  // packages/models/src/catalog.ts
6767
6769
  /**
6768
- * Starter records. Sizes marked "inferred" come from the builds' tables or
6770
+ * Starter records. Sizes marked "inferred" come from published tables or
6769
6771
  * from parameter count times bits and are not measured downloads. Chat rows
6770
6772
  * marked "measured" sum the Content-Length of a HEAD request on every file
6771
6773
  * the runtime loads, at the repo head of 2026-11-24, in MiB; no weight was
6772
6774
  * downloaded. WebLLM rows count the Hugging Face repo and leave out the
6773
6775
  * model library wasm, which comes from another host. Licences on the older rows are the ones on each model card as
6774
6776
  * of 2026-11-22; on the chat rows added 2026-11-24 they are the model card
6775
- * licence field the Hugging Face API returns, or the design harvest's
6776
- * string, and were not checked (owner decision). Recheck before shipping a
6777
+ * licence field the Hugging Face API returns, or a recorded string, and
6778
+ * were not checked (owner decision). Recheck before shipping a
6777
6779
  * product on them. Add your own records with registry.add().
6778
6780
  *
6779
6781
  * vramMB marked "computed" on the 14 WebLLM rows added 2026-11-25 is the
@@ -6782,13 +6784,13 @@ Component that was made reactive: `, type);
6782
6784
  * Rows with sizeSource "vendor" added 2026-11-25 sum the file sizes of the
6783
6785
  * Hugging Face listing of the repo (no download), converted to MiB.
6784
6786
  * Every row carries a speed word and a verdict of one to four words: what
6785
- * a person picks by, in the owner's voice, as the earlier tools wrote them.
6787
+ * a person picks by, in the owner's voice.
6786
6788
  *
6787
6789
  * Catalogue facts (params, quant, VRAM, censorship, tags, note) are copied
6788
- * from the owners' tool labels and the WebLLM catalogue as recorded in the
6789
- * design harvest; VRAM figures are the catalogue's own (vendor). Licence
6790
+ * from the owner's model labels and the WebLLM catalogue; VRAM figures are the catalogue's own (vendor). Licence
6790
6791
  * strings are shown as recorded and were not verified for these facts.
6791
6792
  */
6793
+ /** The starter model records, each with its size source and weight licence. */
6792
6794
  const CATALOG = [
6793
6795
  {
6794
6796
  id: "smollm2-135m-instruct",
@@ -7344,7 +7346,7 @@ Component that was made reactive: `, type);
7344
7346
  tier: "large",
7345
7347
  family: "gemma",
7346
7348
  tags: [],
7347
- note: "an uncensored gemma 4 brain. the earlier clone chat's default; it warns with no webgpu.",
7349
+ note: "an uncensored gemma 4 brain. it warns with no webgpu.",
7348
7350
  group: "uncensored",
7349
7351
  badge: "best",
7350
7352
  speed: "slow",
@@ -7378,7 +7380,7 @@ Component that was made reactive: `, type);
7378
7380
  tier: "medium",
7379
7381
  family: "gemma",
7380
7382
  tags: [],
7381
- note: "lighter gemma 4. the earlier room's default with webgpu.",
7383
+ note: "lighter gemma 4. a chat default with webgpu.",
7382
7384
  group: "uncensored",
7383
7385
  badge: "lighter",
7384
7386
  speed: "steady",
@@ -7554,7 +7556,7 @@ Component that was made reactive: `, type);
7554
7556
  tier: "small",
7555
7557
  family: "qwen3.5",
7556
7558
  tags: ["no gpu"],
7557
- note: "the earlier room's default with no webgpu. thin for long chats.",
7559
+ note: "a chat default with no webgpu. thin for long chats.",
7558
7560
  group: "uncensored",
7559
7561
  badge: "faster",
7560
7562
  speed: "fast",
@@ -7686,7 +7688,7 @@ Component that was made reactive: `, type);
7686
7688
  tier: "small",
7687
7689
  family: "qwen3",
7688
7690
  tags: ["think"],
7689
- note: "a small qwen3 with a think trace. an earlier room's deliberator.",
7691
+ note: "a small qwen3 with a think trace. fits a deliberator role.",
7690
7692
  group: "reasoning",
7691
7693
  badge: "think, easier on memory",
7692
7694
  speed: "fast",
@@ -8356,25 +8358,25 @@ Component that was made reactive: `, type);
8356
8358
  }
8357
8359
  return spec.wasmFirst ? [...cpu, ...gpu] : [...gpu, ...cpu];
8358
8360
  }
8359
- /** onnxruntime-web rungs: the earlier transcription tool walk, or wasm only when the graph is known to fail on webgpu. */
8361
+ /** onnxruntime-web rungs: webgpu then wasm, or wasm only when the graph is known to fail on webgpu. */
8360
8362
  function ortRungs(opts = {}) {
8361
8363
  const all = ortLadder();
8362
8364
  return opts.webgpu === false ? all.filter((r) => r.device === "wasm") : all;
8363
8365
  }
8364
- /** Ladders by name, from the builds. Each model record may copy one or write its own. */
8366
+ /** Ladders by name, one per model family. Each model record may copy one or write its own. */
8365
8367
  const LADDERS = {
8366
- /** an earlier relief bench runDepth. */
8368
+ /** Depth: fp16 then fp32 on webgpu, q8 then fp32 on wasm. */
8367
8369
  depth: () => tjsLadder({
8368
8370
  webgpu: ["fp16", "fp32"],
8369
8371
  wasm: ["q8", "fp32"]
8370
8372
  }),
8371
- /** earlier builds: perception models on cpu by default. */
8373
+ /** Perception models on cpu by default. */
8372
8374
  perceptionCpu: () => tjsLadder({
8373
8375
  webgpu: ["fp32"],
8374
8376
  wasm: ["q8", "fp32"],
8375
8377
  wasmFirst: true
8376
8378
  }),
8377
- /** whisper-large-v3-turbo (weights MIT), as the earlier transcription tool ran it. */
8379
+ /** whisper-large-v3-turbo (weights MIT). */
8378
8380
  whisperTurbo: () => tjsLadder({
8379
8381
  webgpu: [{
8380
8382
  encoder_model: "fp16",
@@ -8399,7 +8401,7 @@ Component that was made reactive: `, type);
8399
8401
  decoder_model_merged: "q8"
8400
8402
  }]
8401
8403
  }),
8402
- /** SmolVLM (weights Apache-2.0): fp16 embed and vision, q4 decoder on webgpu; q8 vision on wasm, as earlier builds ran it. */
8404
+ /** SmolVLM (weights Apache-2.0): fp16 embed and vision, q4 decoder on webgpu; q8 vision on wasm. */
8403
8405
  smolvlm: () => tjsLadder({
8404
8406
  webgpu: [{
8405
8407
  embed_tokens: "fp32",
@@ -8417,7 +8419,7 @@ Component that was made reactive: `, type);
8417
8419
  }],
8418
8420
  freshHeapRetry: true
8419
8421
  }),
8420
- /** earlier builds: q4f16 on webgpu only. */
8422
+ /** q4f16 on webgpu only. */
8421
8423
  vlmGpuOnly: () => tjsLadder({ webgpu: ["q4f16", "q4"] }),
8422
8424
  ort: ortRungs
8423
8425
  };
@@ -8426,6 +8428,7 @@ Component that was made reactive: `, type);
8426
8428
  * Embedder records for the models hub. Sizes are inferred from the model
8427
8429
  * repos' file lists; licences are the model cards' as of 2026-11-22.
8428
8430
  */
8431
+ /** Hub records for potion-base-8M, all-MiniLM-L6-v2 and bge-small-en-v1.5. */
8429
8432
  const EMBED_RECORDS = [
8430
8433
  {
8431
8434
  id: "potion-base-8m",
@@ -8445,7 +8448,7 @@ Component that was made reactive: `, type);
8445
8448
  licence: "MIT",
8446
8449
  commercial: true,
8447
8450
  place: "main",
8448
- notes: ["256 dims, no runtime, about 0.08 ms per sentence in an earlier build (measured there, not here)", "misses paraphrase"]
8451
+ notes: ["256 dims, no runtime, about 0.08 ms per sentence (measured outside this repository)", "misses paraphrase"]
8449
8452
  },
8450
8453
  {
8451
8454
  id: "minilm-l6",
@@ -8467,7 +8470,7 @@ Component that was made reactive: `, type);
8467
8470
  commercial: true,
8468
8471
  place: "cpu-worker",
8469
8472
  runtime: "@huggingface/transformers@4.3.2",
8470
- notes: ["384 dims; webgpu with q8 garbled other models in earlier builds, so q8 stays on wasm"]
8473
+ notes: ["384 dims; webgpu with q8 garbled other models, so q8 stays on wasm"]
8471
8474
  },
8472
8475
  {
8473
8476
  id: "bge-small-en",
@@ -8513,6 +8516,7 @@ Component that was made reactive: `, type);
8513
8516
  height_latent: 64,
8514
8517
  width_latent: 64
8515
8518
  } };
8519
+ /** The image models {@link attachImagegen} registers: SD-Turbo and SD 1.5, each with its licence, size and form. */
8516
8520
  const IMAGEGEN_RECORDS = [{
8517
8521
  id: "sd-turbo",
8518
8522
  label: "sd-turbo 512",
@@ -8537,9 +8541,9 @@ Component that was made reactive: `, type);
8537
8541
  place: "gpu",
8538
8542
  runtime: "onnxruntime-web@1.27.0",
8539
8543
  notes: [
8540
- "webgpu only in an earlier build, no wasm floor",
8544
+ "webgpu only, no wasm floor",
8541
8545
  "tokenizer: Xenova/clip-vit-base-patch16 through transformers.js (CLIP weights MIT)",
8542
- "graph file paths inferred from an earlier build, not checked against the repo"
8546
+ "graph file paths inferred, not checked against the repo"
8543
8547
  ],
8544
8548
  form: {
8545
8549
  steps: {
@@ -8579,7 +8583,7 @@ Component that was made reactive: `, type);
8579
8583
  place: "gpu",
8580
8584
  runtime: "onnxruntime-web@1.27.0",
8581
8585
  notes: [
8582
- "about 2 GB by an earlier bench's label (vendor); the repo, its file paths and its input dtypes are inferred and not checked",
8586
+ "about 2 GB (vendor); the repo, its file paths and its input dtypes are inferred and not checked",
8583
8587
  "runs the unet twice a step for guidance, so a step costs about twice an sd-turbo step (inferred)",
8584
8588
  "tokenizer: Xenova/clip-vit-base-patch16 through transformers.js (CLIP weights MIT)"
8585
8589
  ],
@@ -8636,7 +8640,7 @@ Component that was made reactive: `, type);
8636
8640
  commercial: "unknown",
8637
8641
  place: "gpu",
8638
8642
  runtime: "onnxruntime-web@1.27.0",
8639
- notes: ["two text encoders; the pipeline in this package runs one, so this record is listed and not run yet", "an earlier image bench offered it as the highest quality of three"],
8643
+ notes: ["two text encoders; the pipeline in this package runs one, so this record is listed and not run yet", "the highest quality of the three image models"],
8640
8644
  form: {
8641
8645
  steps: {
8642
8646
  min: 1,
@@ -8653,6 +8657,7 @@ Component that was made reactive: `, type);
8653
8657
  }
8654
8658
  }];
8655
8659
  // packages/speak/src/records.ts
8660
+ /** Model records for the voices this package drives, for pickers and the models registry. */
8656
8661
  const SPEAK_RECORDS = [
8657
8662
  {
8658
8663
  id: "kokoro-82m",
@@ -8677,7 +8682,7 @@ Component that was made reactive: `, type);
8677
8682
  commercial: true,
8678
8683
  place: "cpu-worker",
8679
8684
  runtime: "kokoro-js@1.2.1",
8680
- notes: ["webgpu with q8 gave garbled audio in an earlier build", "fp32 weights (about 330 MB, inferred) do not cache on file://, so webgpu needs http"]
8685
+ notes: ["webgpu with q8 has given garbled audio", "fp32 weights (about 330 MB, inferred) do not cache on file://, so webgpu needs http"]
8681
8686
  },
8682
8687
  {
8683
8688
  id: "pocket-tts",
@@ -8745,8 +8750,7 @@ Component that was made reactive: `, type);
8745
8750
  // packages/transcribe/src/records.ts
8746
8751
  /**
8747
8752
  * Speech to text records for the models hub. Ladders and dtypes are
8748
- * the earlier transcription tool's per model table; sizes are inferred from the builds'
8749
- * notes, except rows marked vendor: those sum the quantized encoder and
8753
+ * one per model table; sizes are inferred from the model notes, except rows marked vendor: those sum the quantized encoder and
8750
8754
  * decoder in the hub listing (no download, 2026-11-25), in MiB. Licences are the model cards' as of 2026-11-22.
8751
8755
  */
8752
8756
  const asr = (r) => ({
@@ -8758,6 +8762,7 @@ Component that was made reactive: `, type);
8758
8762
  runtime: "@huggingface/transformers@4.3.2",
8759
8763
  ...r
8760
8764
  });
8765
+ /** The Whisper and Moonshine model records for the models hub. */
8761
8766
  const TRANSCRIBE_RECORDS = [
8762
8767
  asr({
8763
8768
  id: "whisper-large-v3-turbo",
@@ -8771,7 +8776,7 @@ Component that was made reactive: `, type);
8771
8776
  ladder: LADDERS.whisperTurbo(),
8772
8777
  licence: "MIT",
8773
8778
  place: "gpu",
8774
- notes: ["best accuracy, multilingual, wants webgpu (as earlier builds did)", "download per rung: 1.5 gb fp16 encoder and q4 decoder, 2.7 gb fp32 encoder, 1.0 gb q8 on wasm (vendor)"]
8779
+ notes: ["best accuracy, multilingual, wants webgpu", "download per rung: 1.5 gb fp16 encoder and q4 decoder, 2.7 gb fp32 encoder, 1.0 gb q8 on wasm (vendor)"]
8775
8780
  }),
8776
8781
  asr({
8777
8782
  id: "whisper-base",
@@ -8808,7 +8813,7 @@ Component that was made reactive: `, type);
8808
8813
  sizeMB: 90,
8809
8814
  ladder: LADDERS.whisperSmall(false),
8810
8815
  licence: "MIT (the OpenAI Whisper release; the Xenova ONNX card says apache-2.0)",
8811
- notes: ["english only; the earlier transcription tool's no gpu default"]
8816
+ notes: ["english only; the default with no gpu"]
8812
8817
  }),
8813
8818
  asr({
8814
8819
  id: "whisper-tiny.en",
@@ -8857,6 +8862,7 @@ Component that was made reactive: `, type);
8857
8862
  * only for a URL the app supplies; YOLOv10 n, s and m, FastSAM and the face
8858
8863
  * swap set sit in PICKER_RECORDS.
8859
8864
  */
8865
+ /** The MediaPipe model storage base URL the MediaPipe records load from. */
8860
8866
  const MP_MODELS = "https://storage.googleapis.com/mediapipe-models/";
8861
8867
  /** MediaPipe ladder: GPU delegate (webgl), then the CPU delegate (wasm). */
8862
8868
  const mediapipeLadder = () => [{ device: "webgl" }, { device: "wasm" }];
@@ -8877,6 +8883,7 @@ Component that was made reactive: `, type);
8877
8883
  place: "main",
8878
8884
  runtime: "@mediapipe/tasks-vision@1.2.3"
8879
8885
  });
8886
+ /** The vision records registered by `attachVision`: Depth Anything V2 small, MediaPipe detection, segmentation and landmarks, SlimSAM, SmolVLM 256M and LFM2-VL 450M. */
8880
8887
  const VISION_RECORDS = [
8881
8888
  {
8882
8889
  id: "depth-anything-v2-small",
@@ -8894,7 +8901,7 @@ Component that was made reactive: `, type);
8894
8901
  commercial: true,
8895
8902
  place: "cpu-worker",
8896
8903
  runtime: "@huggingface/transformers@4.3.2",
8897
- notes: ["earlier builds: fp16 on webgpu, fp32 on the same device after a failure"]
8904
+ notes: ["fp16 on webgpu, fp32 on the same device after a failure"]
8898
8905
  },
8899
8906
  mp("efficientdet-lite0", "detect", "object_detector/efficientdet_lite0/float16/1/efficientdet_lite0.tflite", 7, "mediapipe efficientdet lite0 (coco, 80 classes)", "light, 80 things"),
8900
8907
  mp("selfie-segmenter", "segment.person", "image_segmenter/selfie_segmenter/float16/latest/selfie_segmenter.tflite", 1, "mediapipe selfie segmenter"),
@@ -8926,7 +8933,7 @@ Component that was made reactive: `, type);
8926
8933
  commercial: true,
8927
8934
  place: "cpu-worker",
8928
8935
  runtime: "@huggingface/transformers@4.3.2",
8929
- notes: ["earlier builds: one image embedding, then any number of point prompts"]
8936
+ notes: ["one image embedding, then any number of point prompts"]
8930
8937
  },
8931
8938
  {
8932
8939
  id: "smolvlm-256m-instruct",
@@ -8969,13 +8976,12 @@ Component that was made reactive: `, type);
8969
8976
  commercial: "unknown",
8970
8977
  place: "gpu",
8971
8978
  runtime: "@huggingface/transformers@4.3.2",
8972
- notes: ["earlier builds: q4f16 on webgpu only; the licence limits commercial use by revenue, read it before shipping"]
8979
+ notes: ["q4f16 on webgpu only; the licence limits commercial use by revenue, read it before shipping"]
8973
8980
  }
8974
8981
  ];
8975
8982
  /**
8976
8983
  * Records listed for pickers and never registered by default, so a hub's
8977
- * routing by capability keeps its small defaults: larger alternates the
8978
- * earlier tools offered (smolvlm 500m and 2 video, gemma 4 e2b, two more
8984
+ * routing by capability keeps its small defaults: larger alternates (smolvlm 500m and 2 video, gemma 4 e2b, two more
8979
8985
  * depth models), and records under licences that limit use (YOLOv10 and
8980
8986
  * FastSAM are AGPL-3.0 upstream, Ultralytics; the face swap set is
8981
8987
  * InsightFace, non-commercial). A hub that runs one adds it itself. Sizes
@@ -9009,8 +9015,9 @@ Component that was made reactive: `, type);
9009
9015
  licence: "AGPL-3.0 (Ultralytics weights, the model card's licence field)",
9010
9016
  commercial: false,
9011
9017
  place: "gpu",
9012
- notes: ["output [1, 300, 6] after the model's own selection, so no nms pass (vendor, the yolov10 paper)", "an earlier room offered nano, small and medium"]
9018
+ notes: ["output [1, 300, 6] after the model's own selection, so no nms pass (vendor, the yolov10 paper)", "comes in nano, small and medium"]
9013
9019
  });
9020
+ /** Records listed for pickers and never registered by default: larger alternates, and records under licences that limit use (YOLOv10, FastSAM, the face swap set). */
9014
9021
  const PICKER_RECORDS = [
9015
9022
  {
9016
9023
  id: "smolvlm-500m-instruct",
@@ -9053,7 +9060,7 @@ Component that was made reactive: `, type);
9053
9060
  commercial: true,
9054
9061
  place: "cpu-worker",
9055
9062
  runtime: "@huggingface/transformers@4.3.2",
9056
- notes: ["an earlier room offered it beside smolvlm 256m and 500m"]
9063
+ notes: ["an option beside smolvlm 256m and 500m"]
9057
9064
  },
9058
9065
  {
9059
9066
  id: "depth-anything-v2-base",
@@ -9110,7 +9117,7 @@ Component that was made reactive: `, type);
9110
9117
  commercial: true,
9111
9118
  place: "gpu",
9112
9119
  runtime: "@huggingface/transformers@4.3.2",
9113
- notes: ["an earlier dog sim used it as the cortex at about 3.3 GB (vendor there)"]
9120
+ notes: ["about 3.3 GB (vendor)"]
9114
9121
  },
9115
9122
  yolo10("n", 9, "instant", "nano, quick"),
9116
9123
  yolo10("s", 28, "fast", "small, sharper"),
@@ -9139,7 +9146,7 @@ Component that was made reactive: `, type);
9139
9146
  licence: "AGPL-3.0 upstream (Ultralytics FastSAM); the export's card says apache-2.0",
9140
9147
  commercial: false,
9141
9148
  place: "cpu-worker",
9142
- notes: ["an earlier mask tool found every mask in one pass on onnxruntime-web (93 MB there, vendor)", "segment everything: prototype masks, nms, then a pick by click"]
9149
+ notes: ["finds every mask in one pass on onnxruntime-web (93 MB, vendor)", "segment everything: prototype masks, nms, then a pick by click"]
9143
9150
  },
9144
9151
  {
9145
9152
  id: "scrfd-10g",
@@ -9212,7 +9219,7 @@ Component that was made reactive: `, type);
9212
9219
  licence: "InsightFace: non-commercial research only; the mirror's card says gpl-3.0",
9213
9220
  commercial: false,
9214
9221
  place: "gpu",
9215
- notes: ["128 px faces; an earlier face swap tool pasted the result back with a feathered mask"]
9222
+ notes: ["128 px faces; paste the result back with a feathered mask"]
9216
9223
  }
9217
9224
  ];
9218
9225
  /** A face landmark fallback record over face-api.js tiny nets (code MIT; weights MIT from @vladmandic/face-api). */
@@ -9241,9 +9248,10 @@ Component that was made reactive: `, type);
9241
9248
  * records come from the packages that run them; a record listed in more
9242
9249
  * than one place counts once, the running package's copy first.
9243
9250
  */
9244
- /** face-api weights (MIT) as an earlier face swap tool loaded them, from the package CDN. */
9251
+ /** Base URL of the face-api weights (MIT) on the package CDN. */
9245
9252
  const FACE_API_BASE = "https://cdn.jsdelivr.net/npm/@vladmandic/face-api@1.7.12/model/";
9246
9253
  const has = (...want) => (caps) => caps.some((c) => want.includes(c));
9254
+ /** The words and capability test of every job. */
9247
9255
  const JOBS = {
9248
9256
  chat: {
9249
9257
  label: "brain",
@@ -9352,9 +9360,11 @@ Component that was made reactive: `, type);
9352
9360
  "no download": "none",
9353
9361
  own: "own"
9354
9362
  };
9363
+ /** Whether a record has nothing to download: a built in, system or zero size model. */
9355
9364
  function isNoDownload(r) {
9356
9365
  return !!r.noDownload || r.sizeMB === 0 || r.provider === "prompt-api" || r.provider === "system";
9357
9366
  }
9367
+ /** Whether a record's censorship is "uncensored" or "abliterated". */
9358
9368
  function isUncensored(r) {
9359
9369
  return r.censorship === "uncensored" || r.censorship === "abliterated";
9360
9370
  }
@@ -9587,6 +9597,7 @@ Component that was made reactive: `, type);
9587
9597
  }).unfit === void 0);
9588
9598
  return (fits.find((r) => r.group === "start here") ?? fits.find((r) => r.speed === "fast" || r.speed === "steady") ?? fits[0] ?? records[0])?.id ?? "";
9589
9599
  }
9600
+ /** Creates a model picker for a job, with rows that say whether each model fits this machine. */
9590
9601
  function useModelPick(job, o = {}) {
9591
9602
  const def = JOBS[job];
9592
9603
  let records = jobRecords(job, o.records ?? ALL_RECORDS);
@@ -9841,9 +9852,29 @@ Component that was made reactive: `, type);
9841
9852
  }
9842
9853
  };
9843
9854
  }
9855
+ const FILLER = /^(instruct|chat|it|mlc|onnx|gguf|hf|q\d\w*|f16|f32|fp16|int8|bf16|uniform)$/i;
9856
+ /**
9857
+ * A model name cut for the bar chip: filler words (instruct, chat, quant tags)
9858
+ * go, and a name of more than three words keeps its first two and its last,
9859
+ * which is usually the size: "hermes 3 llama 3.2 3b" reads "hermes 3 3b".
9860
+ * A note in brackets goes first: "slimsam 77 uniform (point prompts)" reads "slimsam 77".
9861
+ */
9862
+ function shortName(name) {
9863
+ const w = name.replace(/\s*\([^)]*\)/g, "").split(/\s+/).filter((x) => x && !FILLER.test(x));
9864
+ return (w.length > 3 ? [
9865
+ w[0],
9866
+ w[1],
9867
+ w[w.length - 1]
9868
+ ] : w).join(" ") || name;
9869
+ }
9870
+ /** The chip's words: the short name, then the download size, or the state once it moves. */
9844
9871
  function chipWords(s) {
9845
- const w = $r(s.row, s.empty);
9846
- return w.state ? `${w.name}, ${w.state}` : w.name;
9872
+ const r = s.row;
9873
+ if (!r) return s.empty;
9874
+ const w = $r(r, s.empty);
9875
+ const name = shortName(r.name);
9876
+ if ((r.state === "loading" || r.state === "loaded" || r.state === "error") && w.state) return `${name}, ${w.state}`;
9877
+ return `${name}, ${r.noDownload ? "no download" : r.size ?? "size unknown"}`;
9847
9878
  }
9848
9879
  /** The closed picker over a host; pressing it opens the sheet. */
9849
9880
  function mountModelSelect(host, pick, o = {}) {
@@ -9853,7 +9884,8 @@ Component that was made reactive: `, type);
9853
9884
  if (o.variant === "chip") {
9854
9885
  const draw = (s) => {
9855
9886
  const words = chipWords(s);
9856
- host.innerHTML = `<button type="button" class="hb-msel-chip${s.row?.state ? ` is-${s.row.state}` : ""}" aria-haspopup="dialog" aria-label="model: ${esc(words)}"><span>${esc(words)}</span></button>`;
9887
+ const full = s.row ? `model: ${s.row.name}${s.row.size ? `, ${s.row.size}` : ""}${$r(s.row, s.empty).state ? `, ${$r(s.row, s.empty).state}` : ""}` : `model: ${s.empty}`;
9888
+ host.innerHTML = `<button type="button" class="hb-msel-chip${s.row?.state ? ` is-${s.row.state}` : ""}" aria-haspopup="dialog" aria-label="${esc(full)}" title="${esc(full)}"><span>${esc(words)}</span></button>`;
9857
9889
  };
9858
9890
  l.on(host, "click", (e) => {
9859
9891
  if (e.target.closest(".hb-msel-chip")) sheet.open();
@@ -9932,13 +9964,14 @@ Component that was made reactive: `, type);
9932
9964
  }
9933
9965
  // packages/ai-views/src/mount-chat.ts
9934
9966
  /**
9935
- * ChatPane and Composer in the DOM, after the earlier chat tools: the
9967
+ * ChatPane and Composer in the DOM: the
9936
9968
  * thread as hackbuild-ui messages, the reasoning in a fold that is open
9937
9969
  * while it streams, the memory a reply used in a fold under it, copy and
9938
9970
  * redo on the last reply only, and a composer whose send is the one pink
9939
9971
  * action and turns into stop while a reply streams.
9940
9972
  */
9941
9973
  const paras = (t) => t.split(/\n{2,}/).map((p) => p.trim()).filter(Boolean).map((p) => `<div class="hb-msg-text">${esc(p).replace(/\n/g, "<br>")}</div>`).join("");
9974
+ /** The HTML of one chat turn, with its reasoning fold, memory used and stats. */
9942
9975
  function turnHtml(t, o) {
9943
9976
  if (t.role === "user") return `<div class="hb-msg is-user" data-turn="${t.id}"><span class="hb-msg-who"><span class="hb-msg-name">you</span></span><div class="hb-msg-parts">${paras(t.text)}</div></div>`;
9944
9977
  const live = !t.done;
@@ -10077,11 +10110,11 @@ Component that was made reactive: `, type);
10077
10110
  }
10078
10111
  // packages/ai-views/src/mount-transcribe.ts
10079
10112
  /**
10080
- * TranscribeDrop, TranscriptView and their rack parts in the DOM, after the
10081
- * earlier transcription tool: the drop zone is the page until a file is in
10113
+ * TranscribeDrop, TranscriptView and their rack parts in the DOM: the drop zone is the page until a file is in
10082
10114
  * it, then the transcript is. Lines carry their time, edit in place (one
10083
10115
  * undo step each), and export as txt, srt, vtt and json once there is text.
10084
10116
  */
10117
+ /** The HTML of one channel's transcript, or an empty note when there is none. */
10085
10118
  function transcriptHtml(c, o = {}) {
10086
10119
  if (!c) return `<p class="hb-lay-empty-note">nothing yet. drop a file.</p>`;
10087
10120
  const st = di(c.status);
@@ -10238,7 +10271,7 @@ Component that was made reactive: `, type);
10238
10271
  }
10239
10272
  // packages/ai-views/src/mount-mask.ts
10240
10273
  /**
10241
- * MaskStudio, after the earlier mask studio: drop an image, press a thing
10274
+ * MaskStudio: drop an image, press a thing
10242
10275
  * to cut it out (a click segment model such as SlimSAM), fix the mask by
10243
10276
  * hand with the wand, brush and lasso of hackbuild-ui maskEditor (x swaps
10244
10277
  * add and erase, [ and ] size the brush, ctrl z undoes), zoom and fit, and
@@ -10282,6 +10315,10 @@ Component that was made reactive: `, type);
10282
10315
  t.getContext("2d")?.drawImage(c, 0, 0, t.width, t.height);
10283
10316
  return t.toDataURL("image/png");
10284
10317
  }
10318
+ /**
10319
+ * Mounts a mask studio on a host: drop or open an image, then cut masks with the point, wand, brush
10320
+ * and lasso tools or a segment model.
10321
+ */
10285
10322
  function mountMaskStudio(host, o = {}) {
10286
10323
  let models = o.models ?? {};
10287
10324
  const l = listeners();
@@ -10633,6 +10670,7 @@ Component that was made reactive: `, type);
10633
10670
  // packages/ai-views/src/memory.ts
10634
10671
  const n3 = (x) => Number.isFinite(x) ? x.toFixed(3) : "none";
10635
10672
  const rank = (r) => r >= 0 ? `#${r + 1}` : "none";
10673
+ /** The rows of a recall trace as text, marking the hits handed to the model. */
10636
10674
  function traceRows(r, maxText = 80) {
10637
10675
  const used = new Set(r.hits.map((h) => h.item.id));
10638
10676
  return r.trace.map((t, i) => ({
@@ -10647,11 +10685,13 @@ Component that was made reactive: `, type);
10647
10685
  used: used.has(t.id)
10648
10686
  }));
10649
10687
  }
10688
+ /** The HTML of a recall trace table, or an empty note before any recall. */
10650
10689
  function inspectorHtml(rec) {
10651
10690
  if (!rec) return `<p class="hb-lay-empty-note">no recall yet. ask something to see what memory finds.</p>`;
10652
10691
  const rows = traceRows(rec);
10653
10692
  return `<p class="hb-lay-empty-note" role="status">"${esc(rec.query)}", ${esc(rec.mode)} recall, ${rows.length} found, ${rows.filter((x) => x.used).length} used.</p><div class="hb-scroll-x" data-ux="detail"><table class="hb-table"><thead><tr><th class="num">#</th><th>kind</th><th>text</th><th>bm25</th><th>cosine</th><th class="num">rrf</th><th class="num">score</th></tr></thead><tbody>` + rows.map((x) => `<tr class="${x.used ? "is-mark" : ""}" data-used="${x.used}"><td class="num">${x.rank}</td><td>${esc(x.kind)}</td><td>${esc(x.text)}</td><td>${esc(x.bm25)}</td><td>${esc(x.cos)}</td><td class="num">${x.rrf}</td><td class="num">${x.score}</td></tr>`).join("") + `</tbody></table></div>`;
10654
10693
  }
10694
+ /** Shows a recall trace as a table on a host. */
10655
10695
  function mountMemoryInspector(host, rec = null) {
10656
10696
  host.innerHTML = inspectorHtml(rec);
10657
10697
  return {
@@ -10707,7 +10747,7 @@ Component that was made reactive: `, type);
10707
10747
  }
10708
10748
  // packages/ai-views/src/mount-frame.ts
10709
10749
  /**
10710
- * FrameView and CameraFeed, after the eyes view of an earlier room: a
10750
+ * FrameView and CameraFeed: a
10711
10751
  * frame in a hackbuild-ui camera tile with what the models found drawn
10712
10752
  * over it (boxes with their word and score, landmark points and lines),
10713
10753
  * a count in the corner and the caption under it. CameraFeed opens the
@@ -10720,6 +10760,7 @@ Component that was made reactive: `, type);
10720
10760
  return fb;
10721
10761
  }
10722
10762
  };
10763
+ /** Draws a frame in a camera tile on a host, with boxes, landmarks, a corner tag and a caption over it. */
10723
10764
  function mountFrameView(host, o = {}) {
10724
10765
  host.innerHTML = `<div class="hb-frameview"><figure class="hb-camtile" aria-label="frame"><div class="hb-camtile-none" role="status">${esc(o.empty ?? "no frame yet")}</div><canvas aria-hidden="true"></canvas><span class="hb-camtile-tag is-tl" hidden></span></figure><p class="hb-frameview-cap" data-caption aria-live="polite" hidden></p></div>`;
10725
10766
  const fig = host.querySelector("figure");
@@ -10875,6 +10916,7 @@ Component that was made reactive: `, type);
10875
10916
  dispose: () => l.off()
10876
10917
  };
10877
10918
  }
10919
+ /** Opens the camera into a host and hands the video to `onFrame` at the set rate while it is live. */
10878
10920
  function mountCameraFeed(host, o = {}) {
10879
10921
  const video = document.createElement("video");
10880
10922
  video.autoplay = true;
@@ -10978,6 +11020,7 @@ Component that was made reactive: `, type);
10978
11020
  });
10979
11021
  };
10980
11022
  }
11023
+ /** Vue component for a model picker of one job; emits `pick`, `choose`, `loaded` and `failed`. */
10981
11024
  const ModelSelect = /* @__PURE__ */ defineComponent({
10982
11025
  name: "ModelSelect",
10983
11026
  props: {
@@ -11039,6 +11082,7 @@ Component that was made reactive: `, type);
11039
11082
  p.go
11040
11083
  ])
11041
11084
  });
11085
+ /** Vue component for the turns of a chat thread. */
11042
11086
  const ChatPane = /* @__PURE__ */ defineComponent({
11043
11087
  name: "ChatPane",
11044
11088
  props: {
@@ -11065,6 +11109,7 @@ Component that was made reactive: `, type);
11065
11109
  emptyNote: p.emptyNote
11066
11110
  }), (p) => [p.thread])
11067
11111
  });
11112
+ /** Vue component for the message box of a chat thread. */
11068
11113
  const Composer = /* @__PURE__ */ defineComponent({
11069
11114
  name: "Composer",
11070
11115
  props: {
@@ -11079,6 +11124,7 @@ Component that was made reactive: `, type);
11079
11124
  },
11080
11125
  setup: hosted((host, p) => mountComposer(host, p.thread, { placeholder: p.placeholder }), (p) => [p.thread])
11081
11126
  });
11127
+ /** Vue component for the drop zone that becomes the transcript; emits `sample`. */
11082
11128
  const TranscribeDrop = /* @__PURE__ */ defineComponent({
11083
11129
  name: "TranscribeDrop",
11084
11130
  props: {
@@ -11104,6 +11150,7 @@ Component that was made reactive: `, type);
11104
11150
  } : {}
11105
11151
  }), (p) => [p.queue])
11106
11152
  });
11153
+ /** Vue component for the selected transcript, or its export buttons when `exports` is set. */
11107
11154
  const TranscriptView = /* @__PURE__ */ defineComponent({
11108
11155
  name: "TranscriptView",
11109
11156
  props: {
@@ -11118,6 +11165,10 @@ Component that was made reactive: `, type);
11118
11165
  },
11119
11166
  setup: hosted((host, p) => p.exports ? mountTranscriptExports(host, p.queue) : mountTranscriptView(host, p.queue), (p) => [p.queue, p.exports])
11120
11167
  });
11168
+ /**
11169
+ * Vue component for a mask studio; emits `studio` with the mounted studio and `sample` when the
11170
+ * sample button is pressed.
11171
+ */
11121
11172
  const MaskStudio = /* @__PURE__ */ defineComponent({
11122
11173
  name: "MaskStudio",
11123
11174
  props: {
@@ -11154,6 +11205,7 @@ Component that was made reactive: `, type);
11154
11205
  });
11155
11206
  }
11156
11207
  });
11208
+ /** Vue component for the tool rail of a mask studio. */
11157
11209
  const MaskTools = /* @__PURE__ */ defineComponent({
11158
11210
  name: "MaskTools",
11159
11211
  props: { studio: {
@@ -11162,6 +11214,7 @@ Component that was made reactive: `, type);
11162
11214
  } },
11163
11215
  setup: hosted((host, p) => mountMaskTools(host, p.studio), (p) => [p.studio])
11164
11216
  });
11217
+ /** Vue component for the undo, redo and zoom row of a mask studio. */
11165
11218
  const MaskVerbs = /* @__PURE__ */ defineComponent({
11166
11219
  name: "MaskVerbs",
11167
11220
  props: { studio: {
@@ -11170,6 +11223,7 @@ Component that was made reactive: `, type);
11170
11223
  } },
11171
11224
  setup: hosted((host, p) => mountMaskVerbs(host, p.studio), (p) => [p.studio])
11172
11225
  });
11226
+ /** Vue component for one rack part of a mask studio: found, mask, saved or export. */
11173
11227
  const MaskRack = /* @__PURE__ */ defineComponent({
11174
11228
  name: "MaskRack",
11175
11229
  props: {
@@ -11188,6 +11242,7 @@ Component that was made reactive: `, type);
11188
11242
  },
11189
11243
  setup: hosted((host, p) => mountMaskRack(host, p.studio, p.part, { name: p.name }), (p) => [p.studio, p.part])
11190
11244
  });
11245
+ /** Vue component for a jobs rack: a line per job, presets and load all. */
11191
11246
  const ModelJobs = /* @__PURE__ */ defineComponent({
11192
11247
  name: "ModelJobs",
11193
11248
  props: {
@@ -11202,6 +11257,7 @@ Component that was made reactive: `, type);
11202
11257
  },
11203
11258
  setup: hosted((host, p) => mountModelJobs(host, p.jobs, { go: p.go }), (p) => [p.jobs, p.go])
11204
11259
  });
11260
+ /** Vue component for the file list of a transcribe queue. */
11205
11261
  const TranscribeQueue = /* @__PURE__ */ defineComponent({
11206
11262
  name: "TranscribeQueue",
11207
11263
  props: { queue: {
@@ -11210,6 +11266,7 @@ Component that was made reactive: `, type);
11210
11266
  } },
11211
11267
  setup: hosted((host, p) => mountTranscribeQueue(host, p.queue), (p) => [p.queue])
11212
11268
  });
11269
+ /** Vue component that shows a recall trace as a table. */
11213
11270
  const MemoryInspector = /* @__PURE__ */ defineComponent({
11214
11271
  name: "MemoryInspector",
11215
11272
  props: { recall: {
@@ -11228,6 +11285,7 @@ Component that was made reactive: `, type);
11228
11285
  });
11229
11286
  }
11230
11287
  });
11288
+ /** Vue component for the chat list rail of a `chatList`. */
11231
11289
  const ChatList = /* @__PURE__ */ defineComponent({
11232
11290
  name: "ChatList",
11233
11291
  props: {
@@ -11242,6 +11300,7 @@ Component that was made reactive: `, type);
11242
11300
  },
11243
11301
  setup: hosted((host, p) => mountChatList(host, p.list, { label: p.label }), (p) => [p.list])
11244
11302
  });
11303
+ /** Vue component that shows what the next request carries against the context budget. */
11245
11304
  const ContextMeter = /* @__PURE__ */ defineComponent({
11246
11305
  name: "ContextMeter",
11247
11306
  props: {
@@ -11263,6 +11322,10 @@ Component that was made reactive: `, type);
11263
11322
  system: () => p.system
11264
11323
  }), (p) => [p.thread])
11265
11324
  });
11325
+ /**
11326
+ * Vue component that draws a frame with boxes, landmarks and a caption; emits `view` with the
11327
+ * mounted view.
11328
+ */
11266
11329
  const FrameView = /* @__PURE__ */ defineComponent({
11267
11330
  name: "FrameView",
11268
11331
  props: {