@camstack/addon-provider-reolink 1.1.0 → 1.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.
package/dist/addon.js CHANGED
@@ -4655,7 +4655,7 @@ function _instanceof(cls, params = {}) {
4655
4655
  return inst;
4656
4656
  }
4657
4657
  //#endregion
4658
- //#region ../types/dist/sleep-B1dKJAMJ.mjs
4658
+ //#region ../types/dist/sleep-BV7rLc6Y.mjs
4659
4659
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4660
4660
  EventCategory["SystemBoot"] = "system.boot";
4661
4661
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5134,6 +5134,12 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5134
5134
  * Payload: `{ deviceId, childDeviceIds, hiddenChildIds }`.
5135
5135
  */
5136
5136
  EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
5137
+ /**
5138
+ * Progress update from a running model conversion job.
5139
+ * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
5140
+ * Emitted by `addon-model-studio` on the converting node.
5141
+ */
5142
+ EventCategory["ModelConvertProgress"] = "model-convert.progress";
5137
5143
  return EventCategory;
5138
5144
  }({});
5139
5145
  Object.fromEntries([
@@ -6683,6 +6689,13 @@ object({
6683
6689
  unreachable: number()
6684
6690
  })
6685
6691
  });
6692
+ var LabelDefinitionSchema = object({
6693
+ id: string(),
6694
+ name: string(),
6695
+ category: string().optional(),
6696
+ description: string().optional(),
6697
+ icon: string().optional()
6698
+ });
6686
6699
  var MODEL_FORMATS = [
6687
6700
  "onnx",
6688
6701
  "coreml",
@@ -6690,6 +6703,120 @@ var MODEL_FORMATS = [
6690
6703
  "tflite",
6691
6704
  "pt"
6692
6705
  ];
6706
+ /**
6707
+ * Multi-file format payload.
6708
+ *
6709
+ * - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
6710
+ * relative to the directory root — the downloader fetches each from
6711
+ * `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
6712
+ * HuggingFace API (slower).
6713
+ * - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
6714
+ * files fetched from the SAME remote directory as `url` and stored flat
6715
+ * alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
6716
+ * weights next to `camstack-yolov9t.xml`.
6717
+ */
6718
+ var ModelFormatEntrySchema = object({
6719
+ url: string(),
6720
+ sizeMB: number(),
6721
+ /** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
6722
+ isDirectory: boolean().optional(),
6723
+ /** Multi-file payload (directory members or sibling files). */
6724
+ files: array(string()).readonly().optional(),
6725
+ /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
6726
+ runtimes: array(_enum(["node", "python"])).readonly().optional()
6727
+ });
6728
+ /**
6729
+ * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
6730
+ * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
6731
+ */
6732
+ var ModelExtraFileSchema = object({
6733
+ url: string(),
6734
+ filename: string(),
6735
+ sizeMB: number()
6736
+ });
6737
+ /**
6738
+ * Per-format payload map. Modelled as an explicit object (one optional key
6739
+ * per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
6740
+ * record requires every key, but a catalog entry only ships a subset of
6741
+ * formats.
6742
+ */
6743
+ var ModelFormatsSchema = object({
6744
+ onnx: ModelFormatEntrySchema.optional(),
6745
+ coreml: ModelFormatEntrySchema.optional(),
6746
+ openvino: ModelFormatEntrySchema.optional(),
6747
+ tflite: ModelFormatEntrySchema.optional(),
6748
+ pt: ModelFormatEntrySchema.optional()
6749
+ });
6750
+ var ModelCatalogEntrySchema = object({
6751
+ id: string(),
6752
+ name: string(),
6753
+ description: string(),
6754
+ formats: ModelFormatsSchema,
6755
+ inputSize: object({
6756
+ width: number(),
6757
+ height: number()
6758
+ }),
6759
+ labels: array(LabelDefinitionSchema).readonly(),
6760
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6761
+ inputNormalization: _enum([
6762
+ "zero-one",
6763
+ "imagenet",
6764
+ "none"
6765
+ ]).optional(),
6766
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6767
+ /**
6768
+ * When true, the executor produces a landmark-aligned crop (similarity warp
6769
+ * onto the canonical template) before this step runs, instead of a plain
6770
+ * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
6771
+ * their embeddings are only discriminative on an aligned input. The face
6772
+ * detector that produced the parent detail must emit 5 landmarks.
6773
+ */
6774
+ faceAlignment: boolean().optional(),
6775
+ /**
6776
+ * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6777
+ * Downloaded into the same modelsDir alongside the model file.
6778
+ */
6779
+ extraFiles: array(ModelExtraFileSchema).readonly().optional()
6780
+ });
6781
+ var ConvertTargetSchema = discriminatedUnion("format", [object({
6782
+ format: literal("openvino"),
6783
+ precisions: array(_enum(["fp16", "int8"])).min(1).readonly()
6784
+ }), object({ format: literal("coreml") })]);
6785
+ var ModelConvertMetadataSchema = object({
6786
+ id: string().regex(/^[a-zA-Z0-9._-]+$/),
6787
+ name: string(),
6788
+ labels: array(LabelDefinitionSchema).readonly(),
6789
+ inputSize: object({
6790
+ width: number(),
6791
+ height: number()
6792
+ }),
6793
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6794
+ inputNormalization: _enum([
6795
+ "zero-one",
6796
+ "imagenet",
6797
+ "none"
6798
+ ]).optional(),
6799
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6800
+ outputFormat: _enum([
6801
+ "yolo",
6802
+ "ssd",
6803
+ "embedding",
6804
+ "classification",
6805
+ "ocr",
6806
+ "segmentation"
6807
+ ]),
6808
+ faceAlignment: boolean().optional()
6809
+ });
6810
+ var ConvertResultSchema = object({
6811
+ entry: ModelCatalogEntrySchema,
6812
+ artifacts: array(object({
6813
+ format: _enum(MODEL_FORMATS),
6814
+ precision: _enum(["fp16", "int8"]).optional(),
6815
+ sizeMB: number(),
6816
+ validated: boolean(),
6817
+ files: array(string()).readonly()
6818
+ })).readonly()
6819
+ });
6693
6820
  var EU_DST = {
6694
6821
  offsetHours: 1,
6695
6822
  startMonth: 3,
@@ -15519,6 +15646,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
15519
15646
  bundleUrl: string()
15520
15647
  });
15521
15648
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
15649
+ /**
15650
+ * `custom-model-registry` — collection cap exposing operator-registered
15651
+ * custom detection models. Each provider (today: `addon-model-studio`)
15652
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
15653
+ * them across providers (`concatCollection`).
15654
+ *
15655
+ * The detection-pipeline is *aware* of this cap: when at least one provider
15656
+ * exists it unions these descriptors into the per-step model picker and the
15657
+ * runtime model-resolution path, alongside the static catalog. When no
15658
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
15659
+ * behaviour).
15660
+ *
15661
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
15662
+ * the static catalog uses — so the existing download/resolution code consumes
15663
+ * it unchanged. `stepId` is the detection step the model targets
15664
+ * (e.g. `'object-detection'`).
15665
+ */
15666
+ var CustomModelDescriptorSchema = object({
15667
+ stepId: string(),
15668
+ entry: ModelCatalogEntrySchema
15669
+ });
15670
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
15671
+ method(object({
15672
+ nodeId: string(),
15673
+ modelId: string(),
15674
+ format: _enum(MODEL_FORMATS),
15675
+ entry: ModelCatalogEntrySchema
15676
+ }), object({
15677
+ ok: boolean(),
15678
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
15679
+ sha256: string(),
15680
+ bytes: number(),
15681
+ /** The target node's modelsDir the artifact landed in. */
15682
+ path: string()
15683
+ }), {
15684
+ kind: "mutation",
15685
+ auth: "admin"
15686
+ });
15687
+ method(object({
15688
+ sourceUrl: string(),
15689
+ metadata: ModelConvertMetadataSchema,
15690
+ targets: array(ConvertTargetSchema).min(1).readonly(),
15691
+ calibrationRef: string().optional(),
15692
+ sessionId: string().optional()
15693
+ }), ConvertResultSchema, {
15694
+ kind: "mutation",
15695
+ auth: "admin"
15696
+ });
15522
15697
  var AddonHttpRouteSchema = object({
15523
15698
  method: _enum([
15524
15699
  "GET",
@@ -20785,6 +20960,12 @@ Object.freeze({
20785
20960
  addonId: null,
20786
20961
  access: "create"
20787
20962
  },
20963
+ "customModelRegistry.listModels": {
20964
+ capName: "custom-model-registry",
20965
+ capScope: "system",
20966
+ addonId: null,
20967
+ access: "view"
20968
+ },
20788
20969
  "decoder.createSession": {
20789
20970
  capName: "decoder",
20790
20971
  capScope: "system",
@@ -22009,6 +22190,18 @@ Object.freeze({
22009
22190
  addonId: null,
22010
22191
  access: "view"
22011
22192
  },
22193
+ "modelConvert.convert": {
22194
+ capName: "model-convert",
22195
+ capScope: "system",
22196
+ addonId: null,
22197
+ access: "create"
22198
+ },
22199
+ "modelDistributor.distributeModel": {
22200
+ capName: "model-distributor",
22201
+ capScope: "system",
22202
+ addonId: null,
22203
+ access: "create"
22204
+ },
22012
22205
  "motion.isDetected": {
22013
22206
  capName: "motion",
22014
22207
  capScope: "device",
package/dist/addon.mjs CHANGED
@@ -4650,7 +4650,7 @@ function _instanceof(cls, params = {}) {
4650
4650
  return inst;
4651
4651
  }
4652
4652
  //#endregion
4653
- //#region ../types/dist/sleep-B1dKJAMJ.mjs
4653
+ //#region ../types/dist/sleep-BV7rLc6Y.mjs
4654
4654
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4655
4655
  EventCategory["SystemBoot"] = "system.boot";
4656
4656
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5129,6 +5129,12 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5129
5129
  * Payload: `{ deviceId, childDeviceIds, hiddenChildIds }`.
5130
5130
  */
5131
5131
  EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
5132
+ /**
5133
+ * Progress update from a running model conversion job.
5134
+ * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
5135
+ * Emitted by `addon-model-studio` on the converting node.
5136
+ */
5137
+ EventCategory["ModelConvertProgress"] = "model-convert.progress";
5132
5138
  return EventCategory;
5133
5139
  }({});
5134
5140
  Object.fromEntries([
@@ -6678,6 +6684,13 @@ object({
6678
6684
  unreachable: number()
6679
6685
  })
6680
6686
  });
6687
+ var LabelDefinitionSchema = object({
6688
+ id: string(),
6689
+ name: string(),
6690
+ category: string().optional(),
6691
+ description: string().optional(),
6692
+ icon: string().optional()
6693
+ });
6681
6694
  var MODEL_FORMATS = [
6682
6695
  "onnx",
6683
6696
  "coreml",
@@ -6685,6 +6698,120 @@ var MODEL_FORMATS = [
6685
6698
  "tflite",
6686
6699
  "pt"
6687
6700
  ];
6701
+ /**
6702
+ * Multi-file format payload.
6703
+ *
6704
+ * - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
6705
+ * relative to the directory root — the downloader fetches each from
6706
+ * `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
6707
+ * HuggingFace API (slower).
6708
+ * - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
6709
+ * files fetched from the SAME remote directory as `url` and stored flat
6710
+ * alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
6711
+ * weights next to `camstack-yolov9t.xml`.
6712
+ */
6713
+ var ModelFormatEntrySchema = object({
6714
+ url: string(),
6715
+ sizeMB: number(),
6716
+ /** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
6717
+ isDirectory: boolean().optional(),
6718
+ /** Multi-file payload (directory members or sibling files). */
6719
+ files: array(string()).readonly().optional(),
6720
+ /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
6721
+ runtimes: array(_enum(["node", "python"])).readonly().optional()
6722
+ });
6723
+ /**
6724
+ * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
6725
+ * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
6726
+ */
6727
+ var ModelExtraFileSchema = object({
6728
+ url: string(),
6729
+ filename: string(),
6730
+ sizeMB: number()
6731
+ });
6732
+ /**
6733
+ * Per-format payload map. Modelled as an explicit object (one optional key
6734
+ * per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
6735
+ * record requires every key, but a catalog entry only ships a subset of
6736
+ * formats.
6737
+ */
6738
+ var ModelFormatsSchema = object({
6739
+ onnx: ModelFormatEntrySchema.optional(),
6740
+ coreml: ModelFormatEntrySchema.optional(),
6741
+ openvino: ModelFormatEntrySchema.optional(),
6742
+ tflite: ModelFormatEntrySchema.optional(),
6743
+ pt: ModelFormatEntrySchema.optional()
6744
+ });
6745
+ var ModelCatalogEntrySchema = object({
6746
+ id: string(),
6747
+ name: string(),
6748
+ description: string(),
6749
+ formats: ModelFormatsSchema,
6750
+ inputSize: object({
6751
+ width: number(),
6752
+ height: number()
6753
+ }),
6754
+ labels: array(LabelDefinitionSchema).readonly(),
6755
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6756
+ inputNormalization: _enum([
6757
+ "zero-one",
6758
+ "imagenet",
6759
+ "none"
6760
+ ]).optional(),
6761
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6762
+ /**
6763
+ * When true, the executor produces a landmark-aligned crop (similarity warp
6764
+ * onto the canonical template) before this step runs, instead of a plain
6765
+ * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
6766
+ * their embeddings are only discriminative on an aligned input. The face
6767
+ * detector that produced the parent detail must emit 5 landmarks.
6768
+ */
6769
+ faceAlignment: boolean().optional(),
6770
+ /**
6771
+ * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6772
+ * Downloaded into the same modelsDir alongside the model file.
6773
+ */
6774
+ extraFiles: array(ModelExtraFileSchema).readonly().optional()
6775
+ });
6776
+ var ConvertTargetSchema = discriminatedUnion("format", [object({
6777
+ format: literal("openvino"),
6778
+ precisions: array(_enum(["fp16", "int8"])).min(1).readonly()
6779
+ }), object({ format: literal("coreml") })]);
6780
+ var ModelConvertMetadataSchema = object({
6781
+ id: string().regex(/^[a-zA-Z0-9._-]+$/),
6782
+ name: string(),
6783
+ labels: array(LabelDefinitionSchema).readonly(),
6784
+ inputSize: object({
6785
+ width: number(),
6786
+ height: number()
6787
+ }),
6788
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6789
+ inputNormalization: _enum([
6790
+ "zero-one",
6791
+ "imagenet",
6792
+ "none"
6793
+ ]).optional(),
6794
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6795
+ outputFormat: _enum([
6796
+ "yolo",
6797
+ "ssd",
6798
+ "embedding",
6799
+ "classification",
6800
+ "ocr",
6801
+ "segmentation"
6802
+ ]),
6803
+ faceAlignment: boolean().optional()
6804
+ });
6805
+ var ConvertResultSchema = object({
6806
+ entry: ModelCatalogEntrySchema,
6807
+ artifacts: array(object({
6808
+ format: _enum(MODEL_FORMATS),
6809
+ precision: _enum(["fp16", "int8"]).optional(),
6810
+ sizeMB: number(),
6811
+ validated: boolean(),
6812
+ files: array(string()).readonly()
6813
+ })).readonly()
6814
+ });
6688
6815
  var EU_DST = {
6689
6816
  offsetHours: 1,
6690
6817
  startMonth: 3,
@@ -15514,6 +15641,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
15514
15641
  bundleUrl: string()
15515
15642
  });
15516
15643
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
15644
+ /**
15645
+ * `custom-model-registry` — collection cap exposing operator-registered
15646
+ * custom detection models. Each provider (today: `addon-model-studio`)
15647
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
15648
+ * them across providers (`concatCollection`).
15649
+ *
15650
+ * The detection-pipeline is *aware* of this cap: when at least one provider
15651
+ * exists it unions these descriptors into the per-step model picker and the
15652
+ * runtime model-resolution path, alongside the static catalog. When no
15653
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
15654
+ * behaviour).
15655
+ *
15656
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
15657
+ * the static catalog uses — so the existing download/resolution code consumes
15658
+ * it unchanged. `stepId` is the detection step the model targets
15659
+ * (e.g. `'object-detection'`).
15660
+ */
15661
+ var CustomModelDescriptorSchema = object({
15662
+ stepId: string(),
15663
+ entry: ModelCatalogEntrySchema
15664
+ });
15665
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
15666
+ method(object({
15667
+ nodeId: string(),
15668
+ modelId: string(),
15669
+ format: _enum(MODEL_FORMATS),
15670
+ entry: ModelCatalogEntrySchema
15671
+ }), object({
15672
+ ok: boolean(),
15673
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
15674
+ sha256: string(),
15675
+ bytes: number(),
15676
+ /** The target node's modelsDir the artifact landed in. */
15677
+ path: string()
15678
+ }), {
15679
+ kind: "mutation",
15680
+ auth: "admin"
15681
+ });
15682
+ method(object({
15683
+ sourceUrl: string(),
15684
+ metadata: ModelConvertMetadataSchema,
15685
+ targets: array(ConvertTargetSchema).min(1).readonly(),
15686
+ calibrationRef: string().optional(),
15687
+ sessionId: string().optional()
15688
+ }), ConvertResultSchema, {
15689
+ kind: "mutation",
15690
+ auth: "admin"
15691
+ });
15517
15692
  var AddonHttpRouteSchema = object({
15518
15693
  method: _enum([
15519
15694
  "GET",
@@ -20780,6 +20955,12 @@ Object.freeze({
20780
20955
  addonId: null,
20781
20956
  access: "create"
20782
20957
  },
20958
+ "customModelRegistry.listModels": {
20959
+ capName: "custom-model-registry",
20960
+ capScope: "system",
20961
+ addonId: null,
20962
+ access: "view"
20963
+ },
20783
20964
  "decoder.createSession": {
20784
20965
  capName: "decoder",
20785
20966
  capScope: "system",
@@ -22004,6 +22185,18 @@ Object.freeze({
22004
22185
  addonId: null,
22005
22186
  access: "view"
22006
22187
  },
22188
+ "modelConvert.convert": {
22189
+ capName: "model-convert",
22190
+ capScope: "system",
22191
+ addonId: null,
22192
+ access: "create"
22193
+ },
22194
+ "modelDistributor.distributeModel": {
22195
+ capName: "model-distributor",
22196
+ capScope: "system",
22197
+ addonId: null,
22198
+ access: "create"
22199
+ },
22007
22200
  "motion.isDetected": {
22008
22201
  capName: "motion",
22009
22202
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-reolink",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Reolink camera device provider addon for CamStack — native Baichuan protocol",
5
5
  "keywords": [
6
6
  "camstack",