@camstack/addon-provider-onvif 1.0.7 → 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.
package/dist/addon.js CHANGED
@@ -4631,7 +4631,7 @@ function _instanceof(cls, params = {}) {
4631
4631
  return inst;
4632
4632
  }
4633
4633
  //#endregion
4634
- //#region ../types/dist/sleep-B1dKJAMJ.mjs
4634
+ //#region ../types/dist/sleep-BV7rLc6Y.mjs
4635
4635
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4636
4636
  EventCategory["SystemBoot"] = "system.boot";
4637
4637
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5110,6 +5110,12 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5110
5110
  * Payload: `{ deviceId, childDeviceIds, hiddenChildIds }`.
5111
5111
  */
5112
5112
  EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
5113
+ /**
5114
+ * Progress update from a running model conversion job.
5115
+ * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
5116
+ * Emitted by `addon-model-studio` on the converting node.
5117
+ */
5118
+ EventCategory["ModelConvertProgress"] = "model-convert.progress";
5113
5119
  return EventCategory;
5114
5120
  }({});
5115
5121
  Object.fromEntries([
@@ -6643,6 +6649,13 @@ object({
6643
6649
  unreachable: number()
6644
6650
  })
6645
6651
  });
6652
+ var LabelDefinitionSchema = object({
6653
+ id: string(),
6654
+ name: string(),
6655
+ category: string().optional(),
6656
+ description: string().optional(),
6657
+ icon: string().optional()
6658
+ });
6646
6659
  var MODEL_FORMATS = [
6647
6660
  "onnx",
6648
6661
  "coreml",
@@ -6651,6 +6664,120 @@ var MODEL_FORMATS = [
6651
6664
  "pt"
6652
6665
  ];
6653
6666
  /**
6667
+ * Multi-file format payload.
6668
+ *
6669
+ * - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
6670
+ * relative to the directory root — the downloader fetches each from
6671
+ * `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
6672
+ * HuggingFace API (slower).
6673
+ * - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
6674
+ * files fetched from the SAME remote directory as `url` and stored flat
6675
+ * alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
6676
+ * weights next to `camstack-yolov9t.xml`.
6677
+ */
6678
+ var ModelFormatEntrySchema = object({
6679
+ url: string(),
6680
+ sizeMB: number(),
6681
+ /** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
6682
+ isDirectory: boolean().optional(),
6683
+ /** Multi-file payload (directory members or sibling files). */
6684
+ files: array(string()).readonly().optional(),
6685
+ /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
6686
+ runtimes: array(_enum(["node", "python"])).readonly().optional()
6687
+ });
6688
+ /**
6689
+ * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
6690
+ * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
6691
+ */
6692
+ var ModelExtraFileSchema = object({
6693
+ url: string(),
6694
+ filename: string(),
6695
+ sizeMB: number()
6696
+ });
6697
+ /**
6698
+ * Per-format payload map. Modelled as an explicit object (one optional key
6699
+ * per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
6700
+ * record requires every key, but a catalog entry only ships a subset of
6701
+ * formats.
6702
+ */
6703
+ var ModelFormatsSchema = object({
6704
+ onnx: ModelFormatEntrySchema.optional(),
6705
+ coreml: ModelFormatEntrySchema.optional(),
6706
+ openvino: ModelFormatEntrySchema.optional(),
6707
+ tflite: ModelFormatEntrySchema.optional(),
6708
+ pt: ModelFormatEntrySchema.optional()
6709
+ });
6710
+ var ModelCatalogEntrySchema = object({
6711
+ id: string(),
6712
+ name: string(),
6713
+ description: string(),
6714
+ formats: ModelFormatsSchema,
6715
+ inputSize: object({
6716
+ width: number(),
6717
+ height: number()
6718
+ }),
6719
+ labels: array(LabelDefinitionSchema).readonly(),
6720
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6721
+ inputNormalization: _enum([
6722
+ "zero-one",
6723
+ "imagenet",
6724
+ "none"
6725
+ ]).optional(),
6726
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6727
+ /**
6728
+ * When true, the executor produces a landmark-aligned crop (similarity warp
6729
+ * onto the canonical template) before this step runs, instead of a plain
6730
+ * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
6731
+ * their embeddings are only discriminative on an aligned input. The face
6732
+ * detector that produced the parent detail must emit 5 landmarks.
6733
+ */
6734
+ faceAlignment: boolean().optional(),
6735
+ /**
6736
+ * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6737
+ * Downloaded into the same modelsDir alongside the model file.
6738
+ */
6739
+ extraFiles: array(ModelExtraFileSchema).readonly().optional()
6740
+ });
6741
+ var ConvertTargetSchema = discriminatedUnion("format", [object({
6742
+ format: literal("openvino"),
6743
+ precisions: array(_enum(["fp16", "int8"])).min(1).readonly()
6744
+ }), object({ format: literal("coreml") })]);
6745
+ var ModelConvertMetadataSchema = object({
6746
+ id: string().regex(/^[a-zA-Z0-9._-]+$/),
6747
+ name: string(),
6748
+ labels: array(LabelDefinitionSchema).readonly(),
6749
+ inputSize: object({
6750
+ width: number(),
6751
+ height: number()
6752
+ }),
6753
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6754
+ inputNormalization: _enum([
6755
+ "zero-one",
6756
+ "imagenet",
6757
+ "none"
6758
+ ]).optional(),
6759
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6760
+ outputFormat: _enum([
6761
+ "yolo",
6762
+ "ssd",
6763
+ "embedding",
6764
+ "classification",
6765
+ "ocr",
6766
+ "segmentation"
6767
+ ]),
6768
+ faceAlignment: boolean().optional()
6769
+ });
6770
+ var ConvertResultSchema = object({
6771
+ entry: ModelCatalogEntrySchema,
6772
+ artifacts: array(object({
6773
+ format: _enum(MODEL_FORMATS),
6774
+ precision: _enum(["fp16", "int8"]).optional(),
6775
+ sizeMB: number(),
6776
+ validated: boolean(),
6777
+ files: array(string()).readonly()
6778
+ })).readonly()
6779
+ });
6780
+ /**
6654
6781
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6655
6782
  * Named `RecordingWeekday` to avoid collision with the string-union
6656
6783
  * `Weekday` exported from `interfaces/timezones.ts`.
@@ -12853,6 +12980,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
12853
12980
  bundleUrl: string()
12854
12981
  });
12855
12982
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
12983
+ /**
12984
+ * `custom-model-registry` — collection cap exposing operator-registered
12985
+ * custom detection models. Each provider (today: `addon-model-studio`)
12986
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
12987
+ * them across providers (`concatCollection`).
12988
+ *
12989
+ * The detection-pipeline is *aware* of this cap: when at least one provider
12990
+ * exists it unions these descriptors into the per-step model picker and the
12991
+ * runtime model-resolution path, alongside the static catalog. When no
12992
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
12993
+ * behaviour).
12994
+ *
12995
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
12996
+ * the static catalog uses — so the existing download/resolution code consumes
12997
+ * it unchanged. `stepId` is the detection step the model targets
12998
+ * (e.g. `'object-detection'`).
12999
+ */
13000
+ var CustomModelDescriptorSchema = object({
13001
+ stepId: string(),
13002
+ entry: ModelCatalogEntrySchema
13003
+ });
13004
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
13005
+ method(object({
13006
+ nodeId: string(),
13007
+ modelId: string(),
13008
+ format: _enum(MODEL_FORMATS),
13009
+ entry: ModelCatalogEntrySchema
13010
+ }), object({
13011
+ ok: boolean(),
13012
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
13013
+ sha256: string(),
13014
+ bytes: number(),
13015
+ /** The target node's modelsDir the artifact landed in. */
13016
+ path: string()
13017
+ }), {
13018
+ kind: "mutation",
13019
+ auth: "admin"
13020
+ });
13021
+ method(object({
13022
+ sourceUrl: string(),
13023
+ metadata: ModelConvertMetadataSchema,
13024
+ targets: array(ConvertTargetSchema).min(1).readonly(),
13025
+ calibrationRef: string().optional(),
13026
+ sessionId: string().optional()
13027
+ }), ConvertResultSchema, {
13028
+ kind: "mutation",
13029
+ auth: "admin"
13030
+ });
12856
13031
  var AddonHttpRouteSchema = object({
12857
13032
  method: _enum([
12858
13033
  "GET",
@@ -17832,6 +18007,12 @@ Object.freeze({
17832
18007
  addonId: null,
17833
18008
  access: "create"
17834
18009
  },
18010
+ "customModelRegistry.listModels": {
18011
+ capName: "custom-model-registry",
18012
+ capScope: "system",
18013
+ addonId: null,
18014
+ access: "view"
18015
+ },
17835
18016
  "decoder.createSession": {
17836
18017
  capName: "decoder",
17837
18018
  capScope: "system",
@@ -19056,6 +19237,18 @@ Object.freeze({
19056
19237
  addonId: null,
19057
19238
  access: "view"
19058
19239
  },
19240
+ "modelConvert.convert": {
19241
+ capName: "model-convert",
19242
+ capScope: "system",
19243
+ addonId: null,
19244
+ access: "create"
19245
+ },
19246
+ "modelDistributor.distributeModel": {
19247
+ capName: "model-distributor",
19248
+ capScope: "system",
19249
+ addonId: null,
19250
+ access: "create"
19251
+ },
19059
19252
  "motion.isDetected": {
19060
19253
  capName: "motion",
19061
19254
  capScope: "device",
package/dist/addon.mjs CHANGED
@@ -4632,7 +4632,7 @@ function _instanceof(cls, params = {}) {
4632
4632
  return inst;
4633
4633
  }
4634
4634
  //#endregion
4635
- //#region ../types/dist/sleep-B1dKJAMJ.mjs
4635
+ //#region ../types/dist/sleep-BV7rLc6Y.mjs
4636
4636
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4637
4637
  EventCategory["SystemBoot"] = "system.boot";
4638
4638
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5111,6 +5111,12 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5111
5111
  * Payload: `{ deviceId, childDeviceIds, hiddenChildIds }`.
5112
5112
  */
5113
5113
  EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
5114
+ /**
5115
+ * Progress update from a running model conversion job.
5116
+ * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
5117
+ * Emitted by `addon-model-studio` on the converting node.
5118
+ */
5119
+ EventCategory["ModelConvertProgress"] = "model-convert.progress";
5114
5120
  return EventCategory;
5115
5121
  }({});
5116
5122
  Object.fromEntries([
@@ -6644,6 +6650,13 @@ object({
6644
6650
  unreachable: number()
6645
6651
  })
6646
6652
  });
6653
+ var LabelDefinitionSchema = object({
6654
+ id: string(),
6655
+ name: string(),
6656
+ category: string().optional(),
6657
+ description: string().optional(),
6658
+ icon: string().optional()
6659
+ });
6647
6660
  var MODEL_FORMATS = [
6648
6661
  "onnx",
6649
6662
  "coreml",
@@ -6652,6 +6665,120 @@ var MODEL_FORMATS = [
6652
6665
  "pt"
6653
6666
  ];
6654
6667
  /**
6668
+ * Multi-file format payload.
6669
+ *
6670
+ * - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
6671
+ * relative to the directory root — the downloader fetches each from
6672
+ * `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
6673
+ * HuggingFace API (slower).
6674
+ * - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
6675
+ * files fetched from the SAME remote directory as `url` and stored flat
6676
+ * alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
6677
+ * weights next to `camstack-yolov9t.xml`.
6678
+ */
6679
+ var ModelFormatEntrySchema = object({
6680
+ url: string(),
6681
+ sizeMB: number(),
6682
+ /** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
6683
+ isDirectory: boolean().optional(),
6684
+ /** Multi-file payload (directory members or sibling files). */
6685
+ files: array(string()).readonly().optional(),
6686
+ /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
6687
+ runtimes: array(_enum(["node", "python"])).readonly().optional()
6688
+ });
6689
+ /**
6690
+ * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
6691
+ * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
6692
+ */
6693
+ var ModelExtraFileSchema = object({
6694
+ url: string(),
6695
+ filename: string(),
6696
+ sizeMB: number()
6697
+ });
6698
+ /**
6699
+ * Per-format payload map. Modelled as an explicit object (one optional key
6700
+ * per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
6701
+ * record requires every key, but a catalog entry only ships a subset of
6702
+ * formats.
6703
+ */
6704
+ var ModelFormatsSchema = object({
6705
+ onnx: ModelFormatEntrySchema.optional(),
6706
+ coreml: ModelFormatEntrySchema.optional(),
6707
+ openvino: ModelFormatEntrySchema.optional(),
6708
+ tflite: ModelFormatEntrySchema.optional(),
6709
+ pt: ModelFormatEntrySchema.optional()
6710
+ });
6711
+ var ModelCatalogEntrySchema = object({
6712
+ id: string(),
6713
+ name: string(),
6714
+ description: string(),
6715
+ formats: ModelFormatsSchema,
6716
+ inputSize: object({
6717
+ width: number(),
6718
+ height: number()
6719
+ }),
6720
+ labels: array(LabelDefinitionSchema).readonly(),
6721
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6722
+ inputNormalization: _enum([
6723
+ "zero-one",
6724
+ "imagenet",
6725
+ "none"
6726
+ ]).optional(),
6727
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6728
+ /**
6729
+ * When true, the executor produces a landmark-aligned crop (similarity warp
6730
+ * onto the canonical template) before this step runs, instead of a plain
6731
+ * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
6732
+ * their embeddings are only discriminative on an aligned input. The face
6733
+ * detector that produced the parent detail must emit 5 landmarks.
6734
+ */
6735
+ faceAlignment: boolean().optional(),
6736
+ /**
6737
+ * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6738
+ * Downloaded into the same modelsDir alongside the model file.
6739
+ */
6740
+ extraFiles: array(ModelExtraFileSchema).readonly().optional()
6741
+ });
6742
+ var ConvertTargetSchema = discriminatedUnion("format", [object({
6743
+ format: literal("openvino"),
6744
+ precisions: array(_enum(["fp16", "int8"])).min(1).readonly()
6745
+ }), object({ format: literal("coreml") })]);
6746
+ var ModelConvertMetadataSchema = object({
6747
+ id: string().regex(/^[a-zA-Z0-9._-]+$/),
6748
+ name: string(),
6749
+ labels: array(LabelDefinitionSchema).readonly(),
6750
+ inputSize: object({
6751
+ width: number(),
6752
+ height: number()
6753
+ }),
6754
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6755
+ inputNormalization: _enum([
6756
+ "zero-one",
6757
+ "imagenet",
6758
+ "none"
6759
+ ]).optional(),
6760
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6761
+ outputFormat: _enum([
6762
+ "yolo",
6763
+ "ssd",
6764
+ "embedding",
6765
+ "classification",
6766
+ "ocr",
6767
+ "segmentation"
6768
+ ]),
6769
+ faceAlignment: boolean().optional()
6770
+ });
6771
+ var ConvertResultSchema = object({
6772
+ entry: ModelCatalogEntrySchema,
6773
+ artifacts: array(object({
6774
+ format: _enum(MODEL_FORMATS),
6775
+ precision: _enum(["fp16", "int8"]).optional(),
6776
+ sizeMB: number(),
6777
+ validated: boolean(),
6778
+ files: array(string()).readonly()
6779
+ })).readonly()
6780
+ });
6781
+ /**
6655
6782
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6656
6783
  * Named `RecordingWeekday` to avoid collision with the string-union
6657
6784
  * `Weekday` exported from `interfaces/timezones.ts`.
@@ -12854,6 +12981,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
12854
12981
  bundleUrl: string()
12855
12982
  });
12856
12983
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
12984
+ /**
12985
+ * `custom-model-registry` — collection cap exposing operator-registered
12986
+ * custom detection models. Each provider (today: `addon-model-studio`)
12987
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
12988
+ * them across providers (`concatCollection`).
12989
+ *
12990
+ * The detection-pipeline is *aware* of this cap: when at least one provider
12991
+ * exists it unions these descriptors into the per-step model picker and the
12992
+ * runtime model-resolution path, alongside the static catalog. When no
12993
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
12994
+ * behaviour).
12995
+ *
12996
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
12997
+ * the static catalog uses — so the existing download/resolution code consumes
12998
+ * it unchanged. `stepId` is the detection step the model targets
12999
+ * (e.g. `'object-detection'`).
13000
+ */
13001
+ var CustomModelDescriptorSchema = object({
13002
+ stepId: string(),
13003
+ entry: ModelCatalogEntrySchema
13004
+ });
13005
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
13006
+ method(object({
13007
+ nodeId: string(),
13008
+ modelId: string(),
13009
+ format: _enum(MODEL_FORMATS),
13010
+ entry: ModelCatalogEntrySchema
13011
+ }), object({
13012
+ ok: boolean(),
13013
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
13014
+ sha256: string(),
13015
+ bytes: number(),
13016
+ /** The target node's modelsDir the artifact landed in. */
13017
+ path: string()
13018
+ }), {
13019
+ kind: "mutation",
13020
+ auth: "admin"
13021
+ });
13022
+ method(object({
13023
+ sourceUrl: string(),
13024
+ metadata: ModelConvertMetadataSchema,
13025
+ targets: array(ConvertTargetSchema).min(1).readonly(),
13026
+ calibrationRef: string().optional(),
13027
+ sessionId: string().optional()
13028
+ }), ConvertResultSchema, {
13029
+ kind: "mutation",
13030
+ auth: "admin"
13031
+ });
12857
13032
  var AddonHttpRouteSchema = object({
12858
13033
  method: _enum([
12859
13034
  "GET",
@@ -17833,6 +18008,12 @@ Object.freeze({
17833
18008
  addonId: null,
17834
18009
  access: "create"
17835
18010
  },
18011
+ "customModelRegistry.listModels": {
18012
+ capName: "custom-model-registry",
18013
+ capScope: "system",
18014
+ addonId: null,
18015
+ access: "view"
18016
+ },
17836
18017
  "decoder.createSession": {
17837
18018
  capName: "decoder",
17838
18019
  capScope: "system",
@@ -19057,6 +19238,18 @@ Object.freeze({
19057
19238
  addonId: null,
19058
19239
  access: "view"
19059
19240
  },
19241
+ "modelConvert.convert": {
19242
+ capName: "model-convert",
19243
+ capScope: "system",
19244
+ addonId: null,
19245
+ access: "create"
19246
+ },
19247
+ "modelDistributor.distributeModel": {
19248
+ capName: "model-distributor",
19249
+ capScope: "system",
19250
+ addonId: null,
19251
+ access: "create"
19252
+ },
19060
19253
  "motion.isDetected": {
19061
19254
  capName: "motion",
19062
19255
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-onvif",
3
- "version": "1.0.7",
3
+ "version": "1.1.1",
4
4
  "description": "ONVIF camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",