@camstack/addon-pipeline 1.2.341 → 1.2.343

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.
Files changed (35) hide show
  1. package/dist/audio-analyzer/index.js +5 -4
  2. package/dist/audio-analyzer/index.mjs +5 -4
  3. package/dist/{custom-model-catalog-CoJEC8nz.js → custom-model-catalog-CC8vgYZ8.js} +3 -3
  4. package/dist/{custom-model-catalog-DNSmyZTT.mjs → custom-model-catalog-m7EBV9wu.mjs} +3 -3
  5. package/dist/detection-pipeline/index.js +4 -118
  6. package/dist/detection-pipeline/index.mjs +4 -118
  7. package/dist/{dist-B8oPeJDI.mjs → dist-BAHBDujp.mjs} +257 -654
  8. package/dist/{dist-PiNPe8uQ.js → dist-BwipY6K1.js} +256 -659
  9. package/dist/{model-catalogs-RM3pkuZm.mjs → model-catalogs-CUU_L1ec.mjs} +1 -1
  10. package/dist/{model-catalogs-CEphd9Va.js → model-catalogs-Dotb1OFs.js} +1 -1
  11. package/dist/motion-wasm/index.js +1 -1
  12. package/dist/motion-wasm/index.mjs +1 -1
  13. package/dist/{node-CMTBIa3-.js → node-BHYEkNaS.js} +1 -1
  14. package/dist/{node-DFUmMJ_f.mjs → node-BPwelwyj.mjs} +1 -1
  15. package/dist/pipeline-runner/index.js +11 -13
  16. package/dist/pipeline-runner/index.mjs +11 -13
  17. package/dist/{process-memory-CzAfDP9P.js → process-memory-BRCKXa-P.js} +1 -1
  18. package/dist/{process-memory-C4v8DBKn.mjs → process-memory-_8o1iZnL.mjs} +1 -1
  19. package/dist/recorder/index.js +14 -16
  20. package/dist/recorder/index.mjs +14 -16
  21. package/dist/{segment-demux-js-CIpCdbx4.mjs → segment-demux-js-DK8jbZy6.mjs} +1 -1
  22. package/dist/{segment-demux-js-C-n_ZsMK.js → segment-demux-js-DveVPFl9.js} +1 -1
  23. package/dist/stream-broker/_stub.js +48 -130
  24. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-CIDS0Tr9.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-CF-T-9YU.mjs} +3 -3
  25. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BUfCTcDV.mjs +26 -0
  26. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-uAQqU5lv.mjs +26 -0
  27. package/dist/stream-broker/demux-worker-child.js +1 -1
  28. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  29. package/dist/stream-broker/{hostInit-CW_cmeNQ.mjs → hostInit-C6jr8fSt.mjs} +3 -3
  30. package/dist/stream-broker/index.js +49 -1693
  31. package/dist/stream-broker/index.mjs +54 -1696
  32. package/dist/stream-broker/remoteEntry.js +1 -1
  33. package/package.json +1 -6
  34. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BvfT5BVP.mjs +0 -26
  35. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-LU_e-xJm.mjs +0 -26
@@ -3,9 +3,9 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-emK7D4bc.js");
6
- const require_dist = require("../dist-PiNPe8uQ.js");
7
- const require_model_catalogs = require("../model-catalogs-CEphd9Va.js");
8
- const require_process_memory = require("../process-memory-CzAfDP9P.js");
6
+ const require_dist = require("../dist-BwipY6K1.js");
7
+ const require_model_catalogs = require("../model-catalogs-Dotb1OFs.js");
8
+ const require_process_memory = require("../process-memory-BRCKXa-P.js");
9
9
  let node_fs = require("node:fs");
10
10
  node_fs = require_chunk.__toESM(node_fs);
11
11
  let node_path = require("node:path");
@@ -1727,7 +1727,7 @@ var AudioAnalyzerAddon = class extends require_dist.BaseAddon {
1727
1727
  title: "Audio",
1728
1728
  tab: "engine",
1729
1729
  order: 10,
1730
- description: "Audio classification backend (Apple SoundAnalysis or YAMNet ONNX). Independent from the vision-detection engine above. \"Auto\" picks Apple SoundAnalysis on macOS, YAMNet on Linux. Click the refresh icon next to \"Probed best\" to re-run the probe.",
1730
+ description: "The audio classifier. \"Auto\" uses Apple SoundAnalysis on macOS and YAMNet elsewhere. The backend choice is one value for the cluster (Cluster → Settings); the probed best is each node's own.",
1731
1731
  fields: [{
1732
1732
  type: "text",
1733
1733
  key: "probedBestAudioBackend",
@@ -1745,6 +1745,7 @@ var AudioAnalyzerAddon = class extends require_dist.BaseAddon {
1745
1745
  type: "select",
1746
1746
  key: "audioBackend",
1747
1747
  label: "Audio backend",
1748
+ description: "One value for every node. Auto picks the best backend on each node; a choice a node cannot run falls back to Auto there.",
1748
1749
  options: require_dist.AUDIO_BACKEND_CHOICES.map((o) => ({
1749
1750
  value: o.value,
1750
1751
  label: o.label
@@ -1,7 +1,7 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { Dn as errMsg, In as expandAudioChunkToF32le, Ln as hydrateSchema, Mn as audioChunkBytesPerSample, N as PoolMemoryWatchdog, Nt as mapAudioLabelToMacro, Vn as nodePin, X as audioAnalyzerCapability, Y as audioAnalysisCapability, an as resolvePoolMemoryPolicy, h as DEFAULT_AUDIO_ANALYZER_CONFIG, ir as EventCategory, kn as BaseAddon, r as AUDIO_BACKEND_CHOICES } from "../dist-B8oPeJDI.mjs";
3
- import { n as AUDIO_CLASSIFIER_MODELS } from "../model-catalogs-RM3pkuZm.mjs";
4
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-C4v8DBKn.mjs";
2
+ import { Dn as errMsg, In as expandAudioChunkToF32le, Ln as hydrateSchema, Mn as audioChunkBytesPerSample, N as PoolMemoryWatchdog, Nt as mapAudioLabelToMacro, Vn as nodePin, X as audioAnalyzerCapability, Y as audioAnalysisCapability, an as resolvePoolMemoryPolicy, h as DEFAULT_AUDIO_ANALYZER_CONFIG, kn as BaseAddon, r as AUDIO_BACKEND_CHOICES, rr as EventCategory } from "../dist-BAHBDujp.mjs";
3
+ import { n as AUDIO_CLASSIFIER_MODELS } from "../model-catalogs-CUU_L1ec.mjs";
4
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-_8o1iZnL.mjs";
5
5
  import * as fs from "node:fs";
6
6
  import * as path$1 from "node:path";
7
7
  import { ensureModel } from "@camstack/system/addon-utils";
@@ -1721,7 +1721,7 @@ var AudioAnalyzerAddon = class extends BaseAddon {
1721
1721
  title: "Audio",
1722
1722
  tab: "engine",
1723
1723
  order: 10,
1724
- description: "Audio classification backend (Apple SoundAnalysis or YAMNet ONNX). Independent from the vision-detection engine above. \"Auto\" picks Apple SoundAnalysis on macOS, YAMNet on Linux. Click the refresh icon next to \"Probed best\" to re-run the probe.",
1724
+ description: "The audio classifier. \"Auto\" uses Apple SoundAnalysis on macOS and YAMNet elsewhere. The backend choice is one value for the cluster (Cluster → Settings); the probed best is each node's own.",
1725
1725
  fields: [{
1726
1726
  type: "text",
1727
1727
  key: "probedBestAudioBackend",
@@ -1739,6 +1739,7 @@ var AudioAnalyzerAddon = class extends BaseAddon {
1739
1739
  type: "select",
1740
1740
  key: "audioBackend",
1741
1741
  label: "Audio backend",
1742
+ description: "One value for every node. Auto picks the best backend on each node; a choice a node cannot run falls back to Auto there.",
1742
1743
  options: AUDIO_BACKEND_CHOICES.map((o) => ({
1743
1744
  value: o.value,
1744
1745
  label: o.label
@@ -1,5 +1,5 @@
1
- const require_dist = require("./dist-PiNPe8uQ.js");
2
- const require_model_catalogs = require("./model-catalogs-CEphd9Va.js");
1
+ const require_dist = require("./dist-BwipY6K1.js");
2
+ const require_model_catalogs = require("./model-catalogs-Dotb1OFs.js");
3
3
  const require_worker_protocol = require("./worker-protocol-C-G8qmye.js");
4
4
  let node_crypto = require("node:crypto");
5
5
  //#region src/detection-pipeline/registry/effective-confidence.ts
@@ -420,7 +420,7 @@ var FaceEmbeddingStep = class extends PipelineStepBase {
420
420
  return [{
421
421
  type: "slider",
422
422
  key: "minLandmarkFaceSize",
423
- label: "Min face size for recognition (detection px)",
423
+ label: "Min face size to embed (detection-frame px)",
424
424
  description: "Refuse to embed a face smaller than this IN THE DETECTION FRAME — not at native resolution. The 5 landmarks that align the crop are regressed at detection scale, so below this floor the aligned crop is not reliably a face, and a native-resolution cutout cannot fix it. Measured on 60 live crops: at 24px, 61% come out correctly aligned versus 20% with no floor, at the cost of about 70% of the volume. Lower it if you are losing too many faces; 0 disables the gate. A degenerate crop is worse than no crop — it scores high similarity against everyone and poisons the gallery.",
425
425
  min: 0,
426
426
  max: 64,
@@ -1,5 +1,5 @@
1
- import { Dt as inferModelProvider, Z as audioKindId, b as DEVICE_BACKEND_TO_FORMAT, f as COCO_80_LABELS, i as AUDIO_MACRO_LABELS, k as LABEL_SUPPLY_VOCABULARIES, p as COCO_TO_MACRO, un as stepModelRunsOnFormat } from "./dist-B8oPeJDI.mjs";
2
- import { a as FACE_DETECTION_MODELS, c as OBJECT_DETECTION_MODELS, d as PLATE_OCR_MODELS, f as SEGMENTATION_REFINER_MODELS, i as CLIP_EMBEDDING_MODELS, l as PACKAGE_DETECTION_MODELS, n as AUDIO_CLASSIFIER_MODELS, o as FACE_EMBEDDING_MODELS, p as VEHICLE_CLASSIFIER_MODELS, r as BIRD_CLASSIFIER_MODELS, s as INSTANCE_SEGMENTATION_MODELS, t as ANIMAL_CLASSIFIER_MODELS, u as PLATE_DETECTION_MODELS } from "./model-catalogs-RM3pkuZm.mjs";
1
+ import { Dt as inferModelProvider, Z as audioKindId, b as DEVICE_BACKEND_TO_FORMAT, f as COCO_80_LABELS, i as AUDIO_MACRO_LABELS, k as LABEL_SUPPLY_VOCABULARIES, p as COCO_TO_MACRO, un as stepModelRunsOnFormat } from "./dist-BAHBDujp.mjs";
2
+ import { a as FACE_DETECTION_MODELS, c as OBJECT_DETECTION_MODELS, d as PLATE_OCR_MODELS, f as SEGMENTATION_REFINER_MODELS, i as CLIP_EMBEDDING_MODELS, l as PACKAGE_DETECTION_MODELS, n as AUDIO_CLASSIFIER_MODELS, o as FACE_EMBEDDING_MODELS, p as VEHICLE_CLASSIFIER_MODELS, r as BIRD_CLASSIFIER_MODELS, s as INSTANCE_SEGMENTATION_MODELS, t as ANIMAL_CLASSIFIER_MODELS, u as PLATE_DETECTION_MODELS } from "./model-catalogs-CUU_L1ec.mjs";
3
3
  import { t as isWorkerReply } from "./worker-protocol-D_NzPcnh.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  //#region src/detection-pipeline/registry/effective-confidence.ts
@@ -420,7 +420,7 @@ var FaceEmbeddingStep = class extends PipelineStepBase {
420
420
  return [{
421
421
  type: "slider",
422
422
  key: "minLandmarkFaceSize",
423
- label: "Min face size for recognition (detection px)",
423
+ label: "Min face size to embed (detection-frame px)",
424
424
  description: "Refuse to embed a face smaller than this IN THE DETECTION FRAME — not at native resolution. The 5 landmarks that align the crop are regressed at detection scale, so below this floor the aligned crop is not reliably a face, and a native-resolution cutout cannot fix it. Measured on 60 live crops: at 24px, 61% come out correctly aligned versus 20% with no floor, at the cost of about 70% of the volume. Lower it if you are losing too many faces; 0 disables the gate. A degenerate crop is worse than no crop — it scores high similarity against everyone and poisons the gallery.",
425
425
  min: 0,
426
426
  max: 64,
@@ -3,11 +3,11 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-emK7D4bc.js");
6
- const require_dist = require("../dist-PiNPe8uQ.js");
7
- const require_node = require("../node-CMTBIa3-.js");
8
- const require_custom_model_catalog = require("../custom-model-catalog-CoJEC8nz.js");
6
+ const require_dist = require("../dist-BwipY6K1.js");
7
+ const require_node = require("../node-BHYEkNaS.js");
8
+ const require_custom_model_catalog = require("../custom-model-catalog-CC8vgYZ8.js");
9
9
  const require_lazy_sharp = require("../lazy-sharp-BuwKlQLR.js");
10
- const require_process_memory = require("../process-memory-CzAfDP9P.js");
10
+ const require_process_memory = require("../process-memory-BRCKXa-P.js");
11
11
  let node_os = require("node:os");
12
12
  node_os = require_chunk.__toESM(node_os);
13
13
  let node_fs = require("node:fs");
@@ -8024,7 +8024,6 @@ var TIMEOUT_GUARD_SOURCE = {
8024
8024
  type: "addon",
8025
8025
  id: "detection-pipeline"
8026
8026
  };
8027
- var KEY_TEMPLATES = "pipelineTemplates";
8028
8027
  function pythonModuleForBackend(backend) {
8029
8028
  switch (backend) {
8030
8029
  case "coreml": return "coremltools";
@@ -8088,75 +8087,6 @@ function assembleBatchedFrameResult(raw, frame, modelId, deviceId, inferenceMs,
8088
8087
  }
8089
8088
  };
8090
8089
  }
8091
- /**
8092
- * Typed stored-config reader — reads a JSON string this provider
8093
- * itself wrote, performs a runtime shape check against the caller
8094
- * predicate, and returns the narrowed value or null.
8095
- *
8096
- * All persisted shapes in this file are written by the provider, so
8097
- * the predicates can be minimal (they're primarily a runtime assertion
8098
- * that the on-disk state hasn't been corrupted).
8099
- */
8100
- function readStored(raw, guard) {
8101
- if (!raw) return null;
8102
- try {
8103
- const parsed = require_dist.parseJsonUnknown(raw);
8104
- return guard(parsed) ? parsed : null;
8105
- } catch {
8106
- return null;
8107
- }
8108
- }
8109
- /**
8110
- * Phase 7 (settings redesign) template migration.
8111
- *
8112
- * Walks every template → step tree and removes the obsolete generic
8113
- * `confidence` key that existed on `PipelineTemplateStep` pre-Phase-7.
8114
- * The step's threshold (if any) now lives in its own `configSchema`-
8115
- * declared `minConfidence` field inside `step.settings`.
8116
- *
8117
- * Idempotent: running twice returns `changed: false` on the second
8118
- * call, because after the first pass no `confidence` property remains.
8119
- * Returns the cleaned template array + a flag indicating whether at
8120
- * least one step actually carried the obsolete key, so `listTemplates`
8121
- * can skip the rewrite when nothing changed.
8122
- */
8123
- function migrateTemplates(templates) {
8124
- let stripped = 0;
8125
- function stripStep(step) {
8126
- const hasLegacyConfidence = "confidence" in step;
8127
- const cleanedChildren = step.children.map(stripStep);
8128
- const childrenChanged = cleanedChildren.some((c, i) => c !== step.children[i]);
8129
- if (!hasLegacyConfidence && !childrenChanged) return step;
8130
- if (hasLegacyConfidence) stripped++;
8131
- return {
8132
- addonId: step.addonId,
8133
- enabled: step.enabled,
8134
- modelId: step.modelId,
8135
- children: cleanedChildren,
8136
- ...step.settings !== void 0 ? { settings: step.settings } : {}
8137
- };
8138
- }
8139
- const nextTemplates = [];
8140
- let anyChanged = false;
8141
- for (const t of templates) {
8142
- const cleanedSteps = t.steps.map(stripStep);
8143
- if (cleanedSteps.some((s, i) => s !== t.steps[i])) {
8144
- anyChanged = true;
8145
- nextTemplates.push({
8146
- ...t,
8147
- steps: cleanedSteps
8148
- });
8149
- } else nextTemplates.push(t);
8150
- }
8151
- return {
8152
- templates: nextTemplates,
8153
- changed: anyChanged,
8154
- stripped
8155
- };
8156
- }
8157
- function isTemplateArray(v) {
8158
- return Array.isArray(v);
8159
- }
8160
8090
  function resolveReferenceAudioDir() {
8161
8091
  return [
8162
8092
  node_path.resolve(__dirname, "assets/reference-audio"),
@@ -10613,50 +10543,6 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
10613
10543
  node_path.resolve(process.cwd(), "../../../assets/reference-images")
10614
10544
  ].find((p) => node_fs.existsSync(p)) ?? null;
10615
10545
  }
10616
- async listTemplates() {
10617
- const raw = (await this.readStore())[KEY_TEMPLATES];
10618
- const migrated = migrateTemplates(readStored(raw, isTemplateArray) ?? []);
10619
- if (migrated.changed) {
10620
- this.writeStore({ [KEY_TEMPLATES]: JSON.stringify(migrated.templates) });
10621
- this.log.info("Migrated stored template steps — removed obsolete \"confidence\" field", { meta: { stripped: migrated.stripped } });
10622
- }
10623
- return migrated.templates;
10624
- }
10625
- async saveTemplate(input) {
10626
- const { name, steps, engine } = input;
10627
- const templates = await this.listTemplates();
10628
- const template = {
10629
- id: `tpl-${Date.now()}`,
10630
- name,
10631
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
10632
- updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
10633
- engine,
10634
- steps: [...steps]
10635
- };
10636
- templates.push(template);
10637
- await this.writeStore({ [KEY_TEMPLATES]: JSON.stringify(templates) });
10638
- return template;
10639
- }
10640
- async updateTemplate(input) {
10641
- const { id, ...update } = input;
10642
- const templates = await this.listTemplates();
10643
- const idx = templates.findIndex((t) => t.id === id);
10644
- if (idx === -1) throw new Error(`Template not found: ${id}`);
10645
- const updated = {
10646
- ...templates[idx],
10647
- ...update.name !== void 0 ? { name: update.name } : {},
10648
- ...update.steps !== void 0 ? { steps: [...update.steps] } : {},
10649
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
10650
- };
10651
- templates[idx] = updated;
10652
- await this.writeStore({ [KEY_TEMPLATES]: JSON.stringify(templates) });
10653
- return updated;
10654
- }
10655
- async deleteTemplate(input) {
10656
- const { id } = input;
10657
- const templates = (await this.listTemplates()).filter((t) => t.id !== id);
10658
- await this.writeStore({ [KEY_TEMPLATES]: JSON.stringify(templates) });
10659
- }
10660
10546
  async getDeviceSettingsContribution(_input) {
10661
10547
  return null;
10662
10548
  }
@@ -1,9 +1,9 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { $n as object, Bt as modelBindingKey, Dn as errMsg$1, Et as hfModelUrl, G as YAMNET_TO_MACRO, Gn as sleep, Hn as parseJsonUnknown, Ht as overlayClusterStepSettings, J as applyModelBoundSettings, Ln as hydrateSchema, N as PoolMemoryWatchdog, Nn as createEvent, O as LABEL_SUPPLY_MACRO, Vn as nodePin, Wt as pickClusterStepSettings, _t as evaluateZoneRules, an as resolvePoolMemoryPolicy, cn as rootSuppliesOf, ct as defaultDeviceFor$1, d as CLUSTER_MODEL_SCOPED_STEPS, en as resolveClusterStepModelId, g as DEFAULT_CLUSTER_STEP_SETTINGS, gt as enumerateInferenceDevices, hn as supportedRuntimes$1, ir as EventCategory, it as containingParentIndex, jt as loadContributionCapability, kn as BaseAddon, kt as linkedLabelStepId, ln as runtimeDevices$1, n as APPLE_SA_TO_MACRO, nr as string, pt as detectionPipelineCapability, qn as array, qt as pipelineExecutorCapability, rr as union, rt as collectModelBoundKeys, un as stepModelRunsOnFormat } from "../dist-B8oPeJDI.mjs";
3
- import { s as readProcessCost } from "../node-DFUmMJ_f.mjs";
4
- import { C as resolveModelDefaultConfidence, S as landmarkPrecisionVerdict, _ as ALL_STEPS, b as getStepDefinition, f as localFrameRegistry, g as ALL_PIPELINE_STEPS, l as resolveDefaultDetectionModel, n as mergeCustomModels, o as deviceKeyOf, r as buildSubtreeCanRun, s as resolveDeviceEngine, t as CustomModelCatalog, u as macroGateVerdict, v as getDefaultModelForFormat, x as resolveModelForFormat, y as getStep } from "../custom-model-catalog-DNSmyZTT.mjs";
2
+ import { Bt as modelBindingKey, Dn as errMsg$1, Et as hfModelUrl, G as YAMNET_TO_MACRO, Ht as overlayClusterStepSettings, J as applyModelBoundSettings, Kn as array, Ln as hydrateSchema, N as PoolMemoryWatchdog, Nn as createEvent, O as LABEL_SUPPLY_MACRO, Qn as object, Vn as nodePin, Wn as sleep, Wt as pickClusterStepSettings, _t as evaluateZoneRules, an as resolvePoolMemoryPolicy, cn as rootSuppliesOf, ct as defaultDeviceFor$1, d as CLUSTER_MODEL_SCOPED_STEPS, en as resolveClusterStepModelId, g as DEFAULT_CLUSTER_STEP_SETTINGS, gt as enumerateInferenceDevices, hn as supportedRuntimes$1, it as containingParentIndex, jt as loadContributionCapability, kn as BaseAddon, kt as linkedLabelStepId, ln as runtimeDevices$1, n as APPLE_SA_TO_MACRO, nr as union, pt as detectionPipelineCapability, qt as pipelineExecutorCapability, rr as EventCategory, rt as collectModelBoundKeys, tr as string, un as stepModelRunsOnFormat } from "../dist-BAHBDujp.mjs";
3
+ import { s as readProcessCost } from "../node-BPwelwyj.mjs";
4
+ import { C as resolveModelDefaultConfidence, S as landmarkPrecisionVerdict, _ as ALL_STEPS, b as getStepDefinition, f as localFrameRegistry, g as ALL_PIPELINE_STEPS, l as resolveDefaultDetectionModel, n as mergeCustomModels, o as deviceKeyOf, r as buildSubtreeCanRun, s as resolveDeviceEngine, t as CustomModelCatalog, u as macroGateVerdict, v as getDefaultModelForFormat, x as resolveModelForFormat, y as getStep } from "../custom-model-catalog-m7EBV9wu.mjs";
5
5
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
6
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-C4v8DBKn.mjs";
6
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-_8o1iZnL.mjs";
7
7
  import * as os from "node:os";
8
8
  import * as fs from "node:fs";
9
9
  import * as path$1 from "node:path";
@@ -8017,7 +8017,6 @@ var TIMEOUT_GUARD_SOURCE = {
8017
8017
  type: "addon",
8018
8018
  id: "detection-pipeline"
8019
8019
  };
8020
- var KEY_TEMPLATES = "pipelineTemplates";
8021
8020
  function pythonModuleForBackend(backend) {
8022
8021
  switch (backend) {
8023
8022
  case "coreml": return "coremltools";
@@ -8081,75 +8080,6 @@ function assembleBatchedFrameResult(raw, frame, modelId, deviceId, inferenceMs,
8081
8080
  }
8082
8081
  };
8083
8082
  }
8084
- /**
8085
- * Typed stored-config reader — reads a JSON string this provider
8086
- * itself wrote, performs a runtime shape check against the caller
8087
- * predicate, and returns the narrowed value or null.
8088
- *
8089
- * All persisted shapes in this file are written by the provider, so
8090
- * the predicates can be minimal (they're primarily a runtime assertion
8091
- * that the on-disk state hasn't been corrupted).
8092
- */
8093
- function readStored(raw, guard) {
8094
- if (!raw) return null;
8095
- try {
8096
- const parsed = parseJsonUnknown(raw);
8097
- return guard(parsed) ? parsed : null;
8098
- } catch {
8099
- return null;
8100
- }
8101
- }
8102
- /**
8103
- * Phase 7 (settings redesign) template migration.
8104
- *
8105
- * Walks every template → step tree and removes the obsolete generic
8106
- * `confidence` key that existed on `PipelineTemplateStep` pre-Phase-7.
8107
- * The step's threshold (if any) now lives in its own `configSchema`-
8108
- * declared `minConfidence` field inside `step.settings`.
8109
- *
8110
- * Idempotent: running twice returns `changed: false` on the second
8111
- * call, because after the first pass no `confidence` property remains.
8112
- * Returns the cleaned template array + a flag indicating whether at
8113
- * least one step actually carried the obsolete key, so `listTemplates`
8114
- * can skip the rewrite when nothing changed.
8115
- */
8116
- function migrateTemplates(templates) {
8117
- let stripped = 0;
8118
- function stripStep(step) {
8119
- const hasLegacyConfidence = "confidence" in step;
8120
- const cleanedChildren = step.children.map(stripStep);
8121
- const childrenChanged = cleanedChildren.some((c, i) => c !== step.children[i]);
8122
- if (!hasLegacyConfidence && !childrenChanged) return step;
8123
- if (hasLegacyConfidence) stripped++;
8124
- return {
8125
- addonId: step.addonId,
8126
- enabled: step.enabled,
8127
- modelId: step.modelId,
8128
- children: cleanedChildren,
8129
- ...step.settings !== void 0 ? { settings: step.settings } : {}
8130
- };
8131
- }
8132
- const nextTemplates = [];
8133
- let anyChanged = false;
8134
- for (const t of templates) {
8135
- const cleanedSteps = t.steps.map(stripStep);
8136
- if (cleanedSteps.some((s, i) => s !== t.steps[i])) {
8137
- anyChanged = true;
8138
- nextTemplates.push({
8139
- ...t,
8140
- steps: cleanedSteps
8141
- });
8142
- } else nextTemplates.push(t);
8143
- }
8144
- return {
8145
- templates: nextTemplates,
8146
- changed: anyChanged,
8147
- stripped
8148
- };
8149
- }
8150
- function isTemplateArray(v) {
8151
- return Array.isArray(v);
8152
- }
8153
8083
  function resolveReferenceAudioDir() {
8154
8084
  return [
8155
8085
  path$1.resolve(__dirname, "assets/reference-audio"),
@@ -10606,50 +10536,6 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
10606
10536
  path$1.resolve(process.cwd(), "../../../assets/reference-images")
10607
10537
  ].find((p) => fs.existsSync(p)) ?? null;
10608
10538
  }
10609
- async listTemplates() {
10610
- const raw = (await this.readStore())[KEY_TEMPLATES];
10611
- const migrated = migrateTemplates(readStored(raw, isTemplateArray) ?? []);
10612
- if (migrated.changed) {
10613
- this.writeStore({ [KEY_TEMPLATES]: JSON.stringify(migrated.templates) });
10614
- this.log.info("Migrated stored template steps — removed obsolete \"confidence\" field", { meta: { stripped: migrated.stripped } });
10615
- }
10616
- return migrated.templates;
10617
- }
10618
- async saveTemplate(input) {
10619
- const { name, steps, engine } = input;
10620
- const templates = await this.listTemplates();
10621
- const template = {
10622
- id: `tpl-${Date.now()}`,
10623
- name,
10624
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
10625
- updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
10626
- engine,
10627
- steps: [...steps]
10628
- };
10629
- templates.push(template);
10630
- await this.writeStore({ [KEY_TEMPLATES]: JSON.stringify(templates) });
10631
- return template;
10632
- }
10633
- async updateTemplate(input) {
10634
- const { id, ...update } = input;
10635
- const templates = await this.listTemplates();
10636
- const idx = templates.findIndex((t) => t.id === id);
10637
- if (idx === -1) throw new Error(`Template not found: ${id}`);
10638
- const updated = {
10639
- ...templates[idx],
10640
- ...update.name !== void 0 ? { name: update.name } : {},
10641
- ...update.steps !== void 0 ? { steps: [...update.steps] } : {},
10642
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
10643
- };
10644
- templates[idx] = updated;
10645
- await this.writeStore({ [KEY_TEMPLATES]: JSON.stringify(templates) });
10646
- return updated;
10647
- }
10648
- async deleteTemplate(input) {
10649
- const { id } = input;
10650
- const templates = (await this.listTemplates()).filter((t) => t.id !== id);
10651
- await this.writeStore({ [KEY_TEMPLATES]: JSON.stringify(templates) });
10652
- }
10653
10539
  async getDeviceSettingsContribution(_input) {
10654
10540
  return null;
10655
10541
  }