@camstack/addon-pipeline 1.0.8 → 1.1.1

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 (55) hide show
  1. package/dist/audio-analyzer/index.js +104 -29
  2. package/dist/audio-analyzer/index.mjs +100 -25
  3. package/dist/audio-codec-nodeav/index.js +1 -1
  4. package/dist/audio-codec-nodeav/index.mjs +1 -1
  5. package/dist/decoder-nodeav/index.js +1 -1
  6. package/dist/decoder-nodeav/index.mjs +1 -1
  7. package/dist/detection-pipeline/index.js +685 -577
  8. package/dist/detection-pipeline/index.mjs +673 -565
  9. package/dist/{dist-BA6DR_jV.mjs → dist-BWc-HYQz.mjs} +194 -1
  10. package/dist/{dist-BLcTVvol.js → dist-DnD2tm7T.js} +194 -1
  11. package/dist/{model-download-service-C7AjBsX9-B0ekM6dF.mjs → model-download-service-C-IHWnXx-3Mmeob3l.mjs} +36 -6
  12. package/dist/{model-download-service-C7AjBsX9-rXY-VFDk.js → model-download-service-C-IHWnXx-BnQ_awK4.js} +36 -6
  13. package/dist/motion-wasm/index.js +1 -1
  14. package/dist/motion-wasm/index.mjs +1 -1
  15. package/dist/pipeline-runner/index.js +14 -10
  16. package/dist/pipeline-runner/index.mjs +14 -10
  17. package/dist/recorder/index.js +4 -4
  18. package/dist/recorder/index.mjs +2 -2
  19. package/dist/stream-broker/_stub.js +1 -1
  20. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BFy9iszl.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-Do7lgO8N.mjs} +3 -3
  21. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-FRD2eBuz.mjs +26 -0
  22. package/dist/stream-broker/{hostInit-zRy9SzlX.mjs → hostInit-D5y5VMK8.mjs} +3 -3
  23. package/dist/stream-broker/index.js +8 -8
  24. package/dist/stream-broker/index.mjs +2 -2
  25. package/dist/stream-broker/remoteEntry.js +1 -1
  26. package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-DJ7ztnFv.js → MaskShapeCanvas-DI4BY7W2-5UPreLSr.js} +1 -1
  27. package/embed-dist/assets/{MotionZonesSettings-NcxxQN8r-CQzEnQoq.js → MotionZonesSettings-NcxxQN8r-Bxqs-CpZ.js} +1 -1
  28. package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-Cl0eOy_U.js → PrivacyMaskSettings-APgPLF7p-BDMPeMJd.js} +1 -1
  29. package/embed-dist/assets/{index-CSuLwWK-.js → index-BgGwqHYl.js} +9 -9
  30. package/embed-dist/index.html +1 -1
  31. package/package.json +1 -1
  32. package/python/inference_pool.py +65 -6
  33. package/python/postprocessors/saliency.py +47 -1
  34. package/python/postprocessors/test_saliency.py +23 -0
  35. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-COa17XL2.mjs +0 -26
  36. package/python/__pycache__/inference_pool.cpython-313.pyc +0 -0
  37. package/python/postprocessors/__pycache__/__init__.cpython-312.pyc +0 -0
  38. package/python/postprocessors/__pycache__/__init__.cpython-313.pyc +0 -0
  39. package/python/postprocessors/__pycache__/_safety.cpython-313.pyc +0 -0
  40. package/python/postprocessors/__pycache__/arcface.cpython-312.pyc +0 -0
  41. package/python/postprocessors/__pycache__/arcface.cpython-313.pyc +0 -0
  42. package/python/postprocessors/__pycache__/ctc.cpython-312.pyc +0 -0
  43. package/python/postprocessors/__pycache__/ctc.cpython-313.pyc +0 -0
  44. package/python/postprocessors/__pycache__/saliency.cpython-312.pyc +0 -0
  45. package/python/postprocessors/__pycache__/saliency.cpython-313.pyc +0 -0
  46. package/python/postprocessors/__pycache__/scrfd.cpython-312.pyc +0 -0
  47. package/python/postprocessors/__pycache__/scrfd.cpython-313.pyc +0 -0
  48. package/python/postprocessors/__pycache__/softmax.cpython-312.pyc +0 -0
  49. package/python/postprocessors/__pycache__/softmax.cpython-313.pyc +0 -0
  50. package/python/postprocessors/__pycache__/yamnet.cpython-312.pyc +0 -0
  51. package/python/postprocessors/__pycache__/yamnet.cpython-313.pyc +0 -0
  52. package/python/postprocessors/__pycache__/yolo.cpython-312.pyc +0 -0
  53. package/python/postprocessors/__pycache__/yolo.cpython-313.pyc +0 -0
  54. package/python/postprocessors/__pycache__/yolo_seg.cpython-312.pyc +0 -0
  55. package/python/postprocessors/__pycache__/yolo_seg.cpython-313.pyc +0 -0
@@ -4627,7 +4627,7 @@ function _instanceof(cls, params = {}) {
4627
4627
  return inst;
4628
4628
  }
4629
4629
  //#endregion
4630
- //#region ../types/dist/sleep-B1dKJAMJ.mjs
4630
+ //#region ../types/dist/sleep-BV7rLc6Y.mjs
4631
4631
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4632
4632
  EventCategory["SystemBoot"] = "system.boot";
4633
4633
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5106,6 +5106,12 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5106
5106
  * Payload: `{ deviceId, childDeviceIds, hiddenChildIds }`.
5107
5107
  */
5108
5108
  EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
5109
+ /**
5110
+ * Progress update from a running model conversion job.
5111
+ * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
5112
+ * Emitted by `addon-model-studio` on the converting node.
5113
+ */
5114
+ EventCategory["ModelConvertProgress"] = "model-convert.progress";
5109
5115
  return EventCategory;
5110
5116
  }({});
5111
5117
  Object.fromEntries([
@@ -6756,6 +6762,13 @@ object({
6756
6762
  unreachable: number()
6757
6763
  })
6758
6764
  });
6765
+ var LabelDefinitionSchema = object({
6766
+ id: string(),
6767
+ name: string(),
6768
+ category: string().optional(),
6769
+ description: string().optional(),
6770
+ icon: string().optional()
6771
+ });
6759
6772
  var MODEL_FORMATS = [
6760
6773
  "onnx",
6761
6774
  "coreml",
@@ -6764,6 +6777,120 @@ var MODEL_FORMATS = [
6764
6777
  "pt"
6765
6778
  ];
6766
6779
  /**
6780
+ * Multi-file format payload.
6781
+ *
6782
+ * - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
6783
+ * relative to the directory root — the downloader fetches each from
6784
+ * `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
6785
+ * HuggingFace API (slower).
6786
+ * - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
6787
+ * files fetched from the SAME remote directory as `url` and stored flat
6788
+ * alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
6789
+ * weights next to `camstack-yolov9t.xml`.
6790
+ */
6791
+ var ModelFormatEntrySchema = object({
6792
+ url: string(),
6793
+ sizeMB: number(),
6794
+ /** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
6795
+ isDirectory: boolean().optional(),
6796
+ /** Multi-file payload (directory members or sibling files). */
6797
+ files: array(string()).readonly().optional(),
6798
+ /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
6799
+ runtimes: array(_enum(["node", "python"])).readonly().optional()
6800
+ });
6801
+ /**
6802
+ * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
6803
+ * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
6804
+ */
6805
+ var ModelExtraFileSchema = object({
6806
+ url: string(),
6807
+ filename: string(),
6808
+ sizeMB: number()
6809
+ });
6810
+ /**
6811
+ * Per-format payload map. Modelled as an explicit object (one optional key
6812
+ * per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
6813
+ * record requires every key, but a catalog entry only ships a subset of
6814
+ * formats.
6815
+ */
6816
+ var ModelFormatsSchema = object({
6817
+ onnx: ModelFormatEntrySchema.optional(),
6818
+ coreml: ModelFormatEntrySchema.optional(),
6819
+ openvino: ModelFormatEntrySchema.optional(),
6820
+ tflite: ModelFormatEntrySchema.optional(),
6821
+ pt: ModelFormatEntrySchema.optional()
6822
+ });
6823
+ var ModelCatalogEntrySchema = object({
6824
+ id: string(),
6825
+ name: string(),
6826
+ description: string(),
6827
+ formats: ModelFormatsSchema,
6828
+ inputSize: object({
6829
+ width: number(),
6830
+ height: number()
6831
+ }),
6832
+ labels: array(LabelDefinitionSchema).readonly(),
6833
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6834
+ inputNormalization: _enum([
6835
+ "zero-one",
6836
+ "imagenet",
6837
+ "none"
6838
+ ]).optional(),
6839
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6840
+ /**
6841
+ * When true, the executor produces a landmark-aligned crop (similarity warp
6842
+ * onto the canonical template) before this step runs, instead of a plain
6843
+ * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
6844
+ * their embeddings are only discriminative on an aligned input. The face
6845
+ * detector that produced the parent detail must emit 5 landmarks.
6846
+ */
6847
+ faceAlignment: boolean().optional(),
6848
+ /**
6849
+ * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6850
+ * Downloaded into the same modelsDir alongside the model file.
6851
+ */
6852
+ extraFiles: array(ModelExtraFileSchema).readonly().optional()
6853
+ });
6854
+ var ConvertTargetSchema = discriminatedUnion("format", [object({
6855
+ format: literal("openvino"),
6856
+ precisions: array(_enum(["fp16", "int8"])).min(1).readonly()
6857
+ }), object({ format: literal("coreml") })]);
6858
+ var ModelConvertMetadataSchema = object({
6859
+ id: string().regex(/^[a-zA-Z0-9._-]+$/),
6860
+ name: string(),
6861
+ labels: array(LabelDefinitionSchema).readonly(),
6862
+ inputSize: object({
6863
+ width: number(),
6864
+ height: number()
6865
+ }),
6866
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6867
+ inputNormalization: _enum([
6868
+ "zero-one",
6869
+ "imagenet",
6870
+ "none"
6871
+ ]).optional(),
6872
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6873
+ outputFormat: _enum([
6874
+ "yolo",
6875
+ "ssd",
6876
+ "embedding",
6877
+ "classification",
6878
+ "ocr",
6879
+ "segmentation"
6880
+ ]),
6881
+ faceAlignment: boolean().optional()
6882
+ });
6883
+ var ConvertResultSchema = object({
6884
+ entry: ModelCatalogEntrySchema,
6885
+ artifacts: array(object({
6886
+ format: _enum(MODEL_FORMATS),
6887
+ precision: _enum(["fp16", "int8"]).optional(),
6888
+ sizeMB: number(),
6889
+ validated: boolean(),
6890
+ files: array(string()).readonly()
6891
+ })).readonly()
6892
+ });
6893
+ /**
6767
6894
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6768
6895
  * Named `RecordingWeekday` to avoid collision with the string-union
6769
6896
  * `Weekday` exported from `interfaces/timezones.ts`.
@@ -13667,6 +13794,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
13667
13794
  bundleUrl: string()
13668
13795
  });
13669
13796
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
13797
+ /**
13798
+ * `custom-model-registry` — collection cap exposing operator-registered
13799
+ * custom detection models. Each provider (today: `addon-model-studio`)
13800
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
13801
+ * them across providers (`concatCollection`).
13802
+ *
13803
+ * The detection-pipeline is *aware* of this cap: when at least one provider
13804
+ * exists it unions these descriptors into the per-step model picker and the
13805
+ * runtime model-resolution path, alongside the static catalog. When no
13806
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
13807
+ * behaviour).
13808
+ *
13809
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
13810
+ * the static catalog uses — so the existing download/resolution code consumes
13811
+ * it unchanged. `stepId` is the detection step the model targets
13812
+ * (e.g. `'object-detection'`).
13813
+ */
13814
+ var CustomModelDescriptorSchema = object({
13815
+ stepId: string(),
13816
+ entry: ModelCatalogEntrySchema
13817
+ });
13818
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
13819
+ method(object({
13820
+ nodeId: string(),
13821
+ modelId: string(),
13822
+ format: _enum(MODEL_FORMATS),
13823
+ entry: ModelCatalogEntrySchema
13824
+ }), object({
13825
+ ok: boolean(),
13826
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
13827
+ sha256: string(),
13828
+ bytes: number(),
13829
+ /** The target node's modelsDir the artifact landed in. */
13830
+ path: string()
13831
+ }), {
13832
+ kind: "mutation",
13833
+ auth: "admin"
13834
+ });
13835
+ method(object({
13836
+ sourceUrl: string(),
13837
+ metadata: ModelConvertMetadataSchema,
13838
+ targets: array(ConvertTargetSchema).min(1).readonly(),
13839
+ calibrationRef: string().optional(),
13840
+ sessionId: string().optional()
13841
+ }), ConvertResultSchema, {
13842
+ kind: "mutation",
13843
+ auth: "admin"
13844
+ });
13670
13845
  var AddonHttpRouteSchema = object({
13671
13846
  method: _enum([
13672
13847
  "GET",
@@ -18916,6 +19091,12 @@ Object.freeze({
18916
19091
  addonId: null,
18917
19092
  access: "create"
18918
19093
  },
19094
+ "customModelRegistry.listModels": {
19095
+ capName: "custom-model-registry",
19096
+ capScope: "system",
19097
+ addonId: null,
19098
+ access: "view"
19099
+ },
18919
19100
  "decoder.createSession": {
18920
19101
  capName: "decoder",
18921
19102
  capScope: "system",
@@ -20140,6 +20321,18 @@ Object.freeze({
20140
20321
  addonId: null,
20141
20322
  access: "view"
20142
20323
  },
20324
+ "modelConvert.convert": {
20325
+ capName: "model-convert",
20326
+ capScope: "system",
20327
+ addonId: null,
20328
+ access: "create"
20329
+ },
20330
+ "modelDistributor.distributeModel": {
20331
+ capName: "model-distributor",
20332
+ capScope: "system",
20333
+ addonId: null,
20334
+ access: "create"
20335
+ },
20143
20336
  "motion.isDetected": {
20144
20337
  capName: "motion",
20145
20338
  capScope: "device",
@@ -4627,7 +4627,7 @@ function _instanceof(cls, params = {}) {
4627
4627
  return inst;
4628
4628
  }
4629
4629
  //#endregion
4630
- //#region ../types/dist/sleep-B1dKJAMJ.mjs
4630
+ //#region ../types/dist/sleep-BV7rLc6Y.mjs
4631
4631
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4632
4632
  EventCategory["SystemBoot"] = "system.boot";
4633
4633
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5106,6 +5106,12 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5106
5106
  * Payload: `{ deviceId, childDeviceIds, hiddenChildIds }`.
5107
5107
  */
5108
5108
  EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
5109
+ /**
5110
+ * Progress update from a running model conversion job.
5111
+ * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
5112
+ * Emitted by `addon-model-studio` on the converting node.
5113
+ */
5114
+ EventCategory["ModelConvertProgress"] = "model-convert.progress";
5109
5115
  return EventCategory;
5110
5116
  }({});
5111
5117
  Object.fromEntries([
@@ -6756,6 +6762,13 @@ object({
6756
6762
  unreachable: number()
6757
6763
  })
6758
6764
  });
6765
+ var LabelDefinitionSchema = object({
6766
+ id: string(),
6767
+ name: string(),
6768
+ category: string().optional(),
6769
+ description: string().optional(),
6770
+ icon: string().optional()
6771
+ });
6759
6772
  var MODEL_FORMATS = [
6760
6773
  "onnx",
6761
6774
  "coreml",
@@ -6764,6 +6777,120 @@ var MODEL_FORMATS = [
6764
6777
  "pt"
6765
6778
  ];
6766
6779
  /**
6780
+ * Multi-file format payload.
6781
+ *
6782
+ * - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
6783
+ * relative to the directory root — the downloader fetches each from
6784
+ * `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
6785
+ * HuggingFace API (slower).
6786
+ * - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
6787
+ * files fetched from the SAME remote directory as `url` and stored flat
6788
+ * alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
6789
+ * weights next to `camstack-yolov9t.xml`.
6790
+ */
6791
+ var ModelFormatEntrySchema = object({
6792
+ url: string(),
6793
+ sizeMB: number(),
6794
+ /** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
6795
+ isDirectory: boolean().optional(),
6796
+ /** Multi-file payload (directory members or sibling files). */
6797
+ files: array(string()).readonly().optional(),
6798
+ /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
6799
+ runtimes: array(_enum(["node", "python"])).readonly().optional()
6800
+ });
6801
+ /**
6802
+ * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
6803
+ * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
6804
+ */
6805
+ var ModelExtraFileSchema = object({
6806
+ url: string(),
6807
+ filename: string(),
6808
+ sizeMB: number()
6809
+ });
6810
+ /**
6811
+ * Per-format payload map. Modelled as an explicit object (one optional key
6812
+ * per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
6813
+ * record requires every key, but a catalog entry only ships a subset of
6814
+ * formats.
6815
+ */
6816
+ var ModelFormatsSchema = object({
6817
+ onnx: ModelFormatEntrySchema.optional(),
6818
+ coreml: ModelFormatEntrySchema.optional(),
6819
+ openvino: ModelFormatEntrySchema.optional(),
6820
+ tflite: ModelFormatEntrySchema.optional(),
6821
+ pt: ModelFormatEntrySchema.optional()
6822
+ });
6823
+ var ModelCatalogEntrySchema = object({
6824
+ id: string(),
6825
+ name: string(),
6826
+ description: string(),
6827
+ formats: ModelFormatsSchema,
6828
+ inputSize: object({
6829
+ width: number(),
6830
+ height: number()
6831
+ }),
6832
+ labels: array(LabelDefinitionSchema).readonly(),
6833
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6834
+ inputNormalization: _enum([
6835
+ "zero-one",
6836
+ "imagenet",
6837
+ "none"
6838
+ ]).optional(),
6839
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6840
+ /**
6841
+ * When true, the executor produces a landmark-aligned crop (similarity warp
6842
+ * onto the canonical template) before this step runs, instead of a plain
6843
+ * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
6844
+ * their embeddings are only discriminative on an aligned input. The face
6845
+ * detector that produced the parent detail must emit 5 landmarks.
6846
+ */
6847
+ faceAlignment: boolean().optional(),
6848
+ /**
6849
+ * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6850
+ * Downloaded into the same modelsDir alongside the model file.
6851
+ */
6852
+ extraFiles: array(ModelExtraFileSchema).readonly().optional()
6853
+ });
6854
+ var ConvertTargetSchema = discriminatedUnion("format", [object({
6855
+ format: literal("openvino"),
6856
+ precisions: array(_enum(["fp16", "int8"])).min(1).readonly()
6857
+ }), object({ format: literal("coreml") })]);
6858
+ var ModelConvertMetadataSchema = object({
6859
+ id: string().regex(/^[a-zA-Z0-9._-]+$/),
6860
+ name: string(),
6861
+ labels: array(LabelDefinitionSchema).readonly(),
6862
+ inputSize: object({
6863
+ width: number(),
6864
+ height: number()
6865
+ }),
6866
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6867
+ inputNormalization: _enum([
6868
+ "zero-one",
6869
+ "imagenet",
6870
+ "none"
6871
+ ]).optional(),
6872
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6873
+ outputFormat: _enum([
6874
+ "yolo",
6875
+ "ssd",
6876
+ "embedding",
6877
+ "classification",
6878
+ "ocr",
6879
+ "segmentation"
6880
+ ]),
6881
+ faceAlignment: boolean().optional()
6882
+ });
6883
+ var ConvertResultSchema = object({
6884
+ entry: ModelCatalogEntrySchema,
6885
+ artifacts: array(object({
6886
+ format: _enum(MODEL_FORMATS),
6887
+ precision: _enum(["fp16", "int8"]).optional(),
6888
+ sizeMB: number(),
6889
+ validated: boolean(),
6890
+ files: array(string()).readonly()
6891
+ })).readonly()
6892
+ });
6893
+ /**
6767
6894
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6768
6895
  * Named `RecordingWeekday` to avoid collision with the string-union
6769
6896
  * `Weekday` exported from `interfaces/timezones.ts`.
@@ -13667,6 +13794,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
13667
13794
  bundleUrl: string()
13668
13795
  });
13669
13796
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
13797
+ /**
13798
+ * `custom-model-registry` — collection cap exposing operator-registered
13799
+ * custom detection models. Each provider (today: `addon-model-studio`)
13800
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
13801
+ * them across providers (`concatCollection`).
13802
+ *
13803
+ * The detection-pipeline is *aware* of this cap: when at least one provider
13804
+ * exists it unions these descriptors into the per-step model picker and the
13805
+ * runtime model-resolution path, alongside the static catalog. When no
13806
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
13807
+ * behaviour).
13808
+ *
13809
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
13810
+ * the static catalog uses — so the existing download/resolution code consumes
13811
+ * it unchanged. `stepId` is the detection step the model targets
13812
+ * (e.g. `'object-detection'`).
13813
+ */
13814
+ var CustomModelDescriptorSchema = object({
13815
+ stepId: string(),
13816
+ entry: ModelCatalogEntrySchema
13817
+ });
13818
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
13819
+ method(object({
13820
+ nodeId: string(),
13821
+ modelId: string(),
13822
+ format: _enum(MODEL_FORMATS),
13823
+ entry: ModelCatalogEntrySchema
13824
+ }), object({
13825
+ ok: boolean(),
13826
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
13827
+ sha256: string(),
13828
+ bytes: number(),
13829
+ /** The target node's modelsDir the artifact landed in. */
13830
+ path: string()
13831
+ }), {
13832
+ kind: "mutation",
13833
+ auth: "admin"
13834
+ });
13835
+ method(object({
13836
+ sourceUrl: string(),
13837
+ metadata: ModelConvertMetadataSchema,
13838
+ targets: array(ConvertTargetSchema).min(1).readonly(),
13839
+ calibrationRef: string().optional(),
13840
+ sessionId: string().optional()
13841
+ }), ConvertResultSchema, {
13842
+ kind: "mutation",
13843
+ auth: "admin"
13844
+ });
13670
13845
  var AddonHttpRouteSchema = object({
13671
13846
  method: _enum([
13672
13847
  "GET",
@@ -18916,6 +19091,12 @@ Object.freeze({
18916
19091
  addonId: null,
18917
19092
  access: "create"
18918
19093
  },
19094
+ "customModelRegistry.listModels": {
19095
+ capName: "custom-model-registry",
19096
+ capScope: "system",
19097
+ addonId: null,
19098
+ access: "view"
19099
+ },
18919
19100
  "decoder.createSession": {
18920
19101
  capName: "decoder",
18921
19102
  capScope: "system",
@@ -20140,6 +20321,18 @@ Object.freeze({
20140
20321
  addonId: null,
20141
20322
  access: "view"
20142
20323
  },
20324
+ "modelConvert.convert": {
20325
+ capName: "model-convert",
20326
+ capScope: "system",
20327
+ addonId: null,
20328
+ access: "create"
20329
+ },
20330
+ "modelDistributor.distributeModel": {
20331
+ capName: "model-distributor",
20332
+ capScope: "system",
20333
+ addonId: null,
20334
+ access: "create"
20335
+ },
20143
20336
  "motion.isDetected": {
20144
20337
  capName: "motion",
20145
20338
  capScope: "device",
@@ -3,7 +3,7 @@ import { createReadStream, promises } from "node:fs";
3
3
  import * as path$1 from "node:path";
4
4
  import path from "node:path";
5
5
  import "node:crypto";
6
- //#region ../system/dist/model-download-service-C7AjBsX9.mjs
6
+ //#region ../system/dist/model-download-service-C-IHWnXx.mjs
7
7
  /**
8
8
  * Map a rel path to one candidate absolute path PER root, keeping only roots the
9
9
  * path stays within (traversal guard). The handler serves the first candidate
@@ -151,6 +151,24 @@ function createFileDataPlaneHandler(opts) {
151
151
  createReadStream(absPath).pipe(res);
152
152
  };
153
153
  }
154
+ function isNonEmptyFile(filePath) {
155
+ return fs.existsSync(filePath) && fs.statSync(filePath).size > 0;
156
+ }
157
+ /**
158
+ * Sibling files of a single-file (non-directory) format — extra files the
159
+ * format needs, fetched from the same remote directory as `url` and stored
160
+ * flat alongside the main file in `modelsDir`. Catalog-declared via
161
+ * `formatEntry.files`, e.g. OpenVINO IR lists its `.bin` weights next to the
162
+ * `.xml`. The downloader stays format-agnostic; the convention lives in the
163
+ * catalog data (like `MLPACKAGE_FILES` for the directory case).
164
+ */
165
+ function siblingFilesFor(formatEntry) {
166
+ return formatEntry.isDirectory ? [] : formatEntry.files ?? [];
167
+ }
168
+ /** Resolve a sibling's remote URL relative to the main file's directory. */
169
+ function siblingUrl(mainUrl, sibling) {
170
+ return mainUrl.replace(/[^/]+$/, sibling);
171
+ }
154
172
  /** Build fetch headers, including HF auth token for huggingface.co URLs */
155
173
  function buildHeaders(url) {
156
174
  const headers = { "User-Agent": "CamStack/1.0" };
@@ -260,14 +278,18 @@ async function ensureModel(modelsDir, entry, format, onProgress) {
260
278
  if (entry.extraFiles) for (const extra of entry.extraFiles) await downloadFile(extra.url, path$1.join(modelsDir, extra.filename));
261
279
  const filename = formatEntry.url.split("/").pop() ?? `${entry.id}.${format}`;
262
280
  const modelPath = path$1.join(modelsDir, filename);
281
+ const siblings = siblingFilesFor(formatEntry);
263
282
  if (fs.existsSync(modelPath)) if (formatEntry.isDirectory && !fs.existsSync(path$1.join(modelPath, "Manifest.json"))) fs.rmSync(modelPath, {
264
283
  recursive: true,
265
284
  force: true
266
285
  });
267
- else return modelPath;
286
+ else if (siblings.some((f) => !isNonEmptyFile(path$1.join(modelsDir, f)))) {} else return modelPath;
268
287
  fs.mkdirSync(modelsDir, { recursive: true });
269
288
  if (formatEntry.isDirectory) await downloadDirectory(formatEntry.url, modelPath, formatEntry.files, onProgress);
270
- else await downloadFile(formatEntry.url, modelPath, (downloaded, total) => onProgress?.(downloaded, total === 0 ? void 0 : total));
289
+ else {
290
+ await downloadFile(formatEntry.url, modelPath, (downloaded, total) => onProgress?.(downloaded, total === 0 ? void 0 : total));
291
+ for (const sibling of siblings) await downloadFile(siblingUrl(formatEntry.url, sibling), path$1.join(modelsDir, sibling));
292
+ }
271
293
  return modelPath;
272
294
  }
273
295
  /** Compute the on-disk path for a given model + format, even when not yet downloaded. */
@@ -284,17 +306,25 @@ function isModelDownloaded(modelsDir, entry, format) {
284
306
  const modelPath = getModelFilePath(modelsDir, entry, format);
285
307
  if (!modelPath || !fs.existsSync(modelPath)) return false;
286
308
  if (formatEntry.isDirectory) return fs.existsSync(path$1.join(modelPath, "Manifest.json"));
287
- return fs.statSync(modelPath).size > 0;
309
+ if (fs.statSync(modelPath).size <= 0) return false;
310
+ return siblingFilesFor(formatEntry).every((f) => isNonEmptyFile(path$1.join(modelsDir, f)));
288
311
  }
289
312
  /** Remove the on-disk model file/directory. Returns true if something was deleted. */
290
313
  function deleteModelFromDisk(modelsDir, entry, format) {
291
314
  const modelPath = getModelFilePath(modelsDir, entry, format);
292
315
  if (!modelPath || !fs.existsSync(modelPath)) return false;
293
- if (entry.formats[format]?.isDirectory) fs.rmSync(modelPath, {
316
+ const formatEntry = entry.formats[format];
317
+ if (formatEntry?.isDirectory) fs.rmSync(modelPath, {
294
318
  recursive: true,
295
319
  force: true
296
320
  });
297
- else fs.unlinkSync(modelPath);
321
+ else {
322
+ fs.unlinkSync(modelPath);
323
+ if (formatEntry) for (const sibling of siblingFilesFor(formatEntry)) {
324
+ const sibPath = path$1.join(modelsDir, sibling);
325
+ if (fs.existsSync(sibPath)) fs.unlinkSync(sibPath);
326
+ }
327
+ }
298
328
  return true;
299
329
  }
300
330
  //#endregion
@@ -25,7 +25,7 @@ node_fs = __toESM(node_fs, 1);
25
25
  let node_path = require("node:path");
26
26
  node_path = __toESM(node_path, 1);
27
27
  require("node:crypto");
28
- //#region ../system/dist/model-download-service-C7AjBsX9.mjs
28
+ //#region ../system/dist/model-download-service-C-IHWnXx.mjs
29
29
  /**
30
30
  * Map a rel path to one candidate absolute path PER root, keeping only roots the
31
31
  * path stays within (traversal guard). The handler serves the first candidate
@@ -173,6 +173,24 @@ function createFileDataPlaneHandler(opts) {
173
173
  (0, node_fs.createReadStream)(absPath).pipe(res);
174
174
  };
175
175
  }
176
+ function isNonEmptyFile(filePath) {
177
+ return node_fs.existsSync(filePath) && node_fs.statSync(filePath).size > 0;
178
+ }
179
+ /**
180
+ * Sibling files of a single-file (non-directory) format — extra files the
181
+ * format needs, fetched from the same remote directory as `url` and stored
182
+ * flat alongside the main file in `modelsDir`. Catalog-declared via
183
+ * `formatEntry.files`, e.g. OpenVINO IR lists its `.bin` weights next to the
184
+ * `.xml`. The downloader stays format-agnostic; the convention lives in the
185
+ * catalog data (like `MLPACKAGE_FILES` for the directory case).
186
+ */
187
+ function siblingFilesFor(formatEntry) {
188
+ return formatEntry.isDirectory ? [] : formatEntry.files ?? [];
189
+ }
190
+ /** Resolve a sibling's remote URL relative to the main file's directory. */
191
+ function siblingUrl(mainUrl, sibling) {
192
+ return mainUrl.replace(/[^/]+$/, sibling);
193
+ }
176
194
  /** Build fetch headers, including HF auth token for huggingface.co URLs */
177
195
  function buildHeaders(url) {
178
196
  const headers = { "User-Agent": "CamStack/1.0" };
@@ -282,14 +300,18 @@ async function ensureModel(modelsDir, entry, format, onProgress) {
282
300
  if (entry.extraFiles) for (const extra of entry.extraFiles) await downloadFile(extra.url, node_path.join(modelsDir, extra.filename));
283
301
  const filename = formatEntry.url.split("/").pop() ?? `${entry.id}.${format}`;
284
302
  const modelPath = node_path.join(modelsDir, filename);
303
+ const siblings = siblingFilesFor(formatEntry);
285
304
  if (node_fs.existsSync(modelPath)) if (formatEntry.isDirectory && !node_fs.existsSync(node_path.join(modelPath, "Manifest.json"))) node_fs.rmSync(modelPath, {
286
305
  recursive: true,
287
306
  force: true
288
307
  });
289
- else return modelPath;
308
+ else if (siblings.some((f) => !isNonEmptyFile(node_path.join(modelsDir, f)))) {} else return modelPath;
290
309
  node_fs.mkdirSync(modelsDir, { recursive: true });
291
310
  if (formatEntry.isDirectory) await downloadDirectory(formatEntry.url, modelPath, formatEntry.files, onProgress);
292
- else await downloadFile(formatEntry.url, modelPath, (downloaded, total) => onProgress?.(downloaded, total === 0 ? void 0 : total));
311
+ else {
312
+ await downloadFile(formatEntry.url, modelPath, (downloaded, total) => onProgress?.(downloaded, total === 0 ? void 0 : total));
313
+ for (const sibling of siblings) await downloadFile(siblingUrl(formatEntry.url, sibling), node_path.join(modelsDir, sibling));
314
+ }
293
315
  return modelPath;
294
316
  }
295
317
  /** Compute the on-disk path for a given model + format, even when not yet downloaded. */
@@ -306,17 +328,25 @@ function isModelDownloaded(modelsDir, entry, format) {
306
328
  const modelPath = getModelFilePath(modelsDir, entry, format);
307
329
  if (!modelPath || !node_fs.existsSync(modelPath)) return false;
308
330
  if (formatEntry.isDirectory) return node_fs.existsSync(node_path.join(modelPath, "Manifest.json"));
309
- return node_fs.statSync(modelPath).size > 0;
331
+ if (node_fs.statSync(modelPath).size <= 0) return false;
332
+ return siblingFilesFor(formatEntry).every((f) => isNonEmptyFile(node_path.join(modelsDir, f)));
310
333
  }
311
334
  /** Remove the on-disk model file/directory. Returns true if something was deleted. */
312
335
  function deleteModelFromDisk(modelsDir, entry, format) {
313
336
  const modelPath = getModelFilePath(modelsDir, entry, format);
314
337
  if (!modelPath || !node_fs.existsSync(modelPath)) return false;
315
- if (entry.formats[format]?.isDirectory) node_fs.rmSync(modelPath, {
338
+ const formatEntry = entry.formats[format];
339
+ if (formatEntry?.isDirectory) node_fs.rmSync(modelPath, {
316
340
  recursive: true,
317
341
  force: true
318
342
  });
319
- else node_fs.unlinkSync(modelPath);
343
+ else {
344
+ node_fs.unlinkSync(modelPath);
345
+ if (formatEntry) for (const sibling of siblingFilesFor(formatEntry)) {
346
+ const sibPath = node_path.join(modelsDir, sibling);
347
+ if (node_fs.existsSync(sibPath)) node_fs.unlinkSync(sibPath);
348
+ }
349
+ }
320
350
  return true;
321
351
  }
322
352
  //#endregion
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-BLcTVvol.js");
5
+ const require_dist = require("../dist-DnD2tm7T.js");
6
6
  let node_fs = require("node:fs");
7
7
  let node_path = require("node:path");
8
8
  //#region src/motion-wasm/wasm-motion-detector.ts
@@ -1,4 +1,4 @@
1
- import { B as BaseAddon, J as hydrateSchema, U as DeviceType, k as motionDetectionCapability, w as evaluateZoneRules } from "../dist-BA6DR_jV.mjs";
1
+ import { B as BaseAddon, J as hydrateSchema, U as DeviceType, k as motionDetectionCapability, w as evaluateZoneRules } from "../dist-BWc-HYQz.mjs";
2
2
  import { readFileSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  //#region src/motion-wasm/wasm-motion-detector.ts