@camstack/addon-provider-rtsp 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
@@ -4642,7 +4642,7 @@ function preprocess(fn, schema) {
4642
4642
  });
4643
4643
  }
4644
4644
  //#endregion
4645
- //#region ../types/dist/sleep-B1dKJAMJ.mjs
4645
+ //#region ../types/dist/sleep-BV7rLc6Y.mjs
4646
4646
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4647
4647
  EventCategory["SystemBoot"] = "system.boot";
4648
4648
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5121,6 +5121,12 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5121
5121
  * Payload: `{ deviceId, childDeviceIds, hiddenChildIds }`.
5122
5122
  */
5123
5123
  EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
5124
+ /**
5125
+ * Progress update from a running model conversion job.
5126
+ * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
5127
+ * Emitted by `addon-model-studio` on the converting node.
5128
+ */
5129
+ EventCategory["ModelConvertProgress"] = "model-convert.progress";
5124
5130
  return EventCategory;
5125
5131
  }({});
5126
5132
  Object.fromEntries([
@@ -6646,6 +6652,13 @@ object({
6646
6652
  unreachable: number()
6647
6653
  })
6648
6654
  });
6655
+ var LabelDefinitionSchema = object({
6656
+ id: string(),
6657
+ name: string(),
6658
+ category: string().optional(),
6659
+ description: string().optional(),
6660
+ icon: string().optional()
6661
+ });
6649
6662
  var MODEL_FORMATS = [
6650
6663
  "onnx",
6651
6664
  "coreml",
@@ -6654,6 +6667,120 @@ var MODEL_FORMATS = [
6654
6667
  "pt"
6655
6668
  ];
6656
6669
  /**
6670
+ * Multi-file format payload.
6671
+ *
6672
+ * - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
6673
+ * relative to the directory root — the downloader fetches each from
6674
+ * `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
6675
+ * HuggingFace API (slower).
6676
+ * - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
6677
+ * files fetched from the SAME remote directory as `url` and stored flat
6678
+ * alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
6679
+ * weights next to `camstack-yolov9t.xml`.
6680
+ */
6681
+ var ModelFormatEntrySchema = object({
6682
+ url: string(),
6683
+ sizeMB: number(),
6684
+ /** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
6685
+ isDirectory: boolean().optional(),
6686
+ /** Multi-file payload (directory members or sibling files). */
6687
+ files: array(string()).readonly().optional(),
6688
+ /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
6689
+ runtimes: array(_enum(["node", "python"])).readonly().optional()
6690
+ });
6691
+ /**
6692
+ * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
6693
+ * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
6694
+ */
6695
+ var ModelExtraFileSchema = object({
6696
+ url: string(),
6697
+ filename: string(),
6698
+ sizeMB: number()
6699
+ });
6700
+ /**
6701
+ * Per-format payload map. Modelled as an explicit object (one optional key
6702
+ * per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
6703
+ * record requires every key, but a catalog entry only ships a subset of
6704
+ * formats.
6705
+ */
6706
+ var ModelFormatsSchema = object({
6707
+ onnx: ModelFormatEntrySchema.optional(),
6708
+ coreml: ModelFormatEntrySchema.optional(),
6709
+ openvino: ModelFormatEntrySchema.optional(),
6710
+ tflite: ModelFormatEntrySchema.optional(),
6711
+ pt: ModelFormatEntrySchema.optional()
6712
+ });
6713
+ var ModelCatalogEntrySchema = object({
6714
+ id: string(),
6715
+ name: string(),
6716
+ description: string(),
6717
+ formats: ModelFormatsSchema,
6718
+ inputSize: object({
6719
+ width: number(),
6720
+ height: number()
6721
+ }),
6722
+ labels: array(LabelDefinitionSchema).readonly(),
6723
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6724
+ inputNormalization: _enum([
6725
+ "zero-one",
6726
+ "imagenet",
6727
+ "none"
6728
+ ]).optional(),
6729
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6730
+ /**
6731
+ * When true, the executor produces a landmark-aligned crop (similarity warp
6732
+ * onto the canonical template) before this step runs, instead of a plain
6733
+ * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
6734
+ * their embeddings are only discriminative on an aligned input. The face
6735
+ * detector that produced the parent detail must emit 5 landmarks.
6736
+ */
6737
+ faceAlignment: boolean().optional(),
6738
+ /**
6739
+ * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6740
+ * Downloaded into the same modelsDir alongside the model file.
6741
+ */
6742
+ extraFiles: array(ModelExtraFileSchema).readonly().optional()
6743
+ });
6744
+ var ConvertTargetSchema = discriminatedUnion("format", [object({
6745
+ format: literal("openvino"),
6746
+ precisions: array(_enum(["fp16", "int8"])).min(1).readonly()
6747
+ }), object({ format: literal("coreml") })]);
6748
+ var ModelConvertMetadataSchema = object({
6749
+ id: string().regex(/^[a-zA-Z0-9._-]+$/),
6750
+ name: string(),
6751
+ labels: array(LabelDefinitionSchema).readonly(),
6752
+ inputSize: object({
6753
+ width: number(),
6754
+ height: number()
6755
+ }),
6756
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6757
+ inputNormalization: _enum([
6758
+ "zero-one",
6759
+ "imagenet",
6760
+ "none"
6761
+ ]).optional(),
6762
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6763
+ outputFormat: _enum([
6764
+ "yolo",
6765
+ "ssd",
6766
+ "embedding",
6767
+ "classification",
6768
+ "ocr",
6769
+ "segmentation"
6770
+ ]),
6771
+ faceAlignment: boolean().optional()
6772
+ });
6773
+ var ConvertResultSchema = object({
6774
+ entry: ModelCatalogEntrySchema,
6775
+ artifacts: array(object({
6776
+ format: _enum(MODEL_FORMATS),
6777
+ precision: _enum(["fp16", "int8"]).optional(),
6778
+ sizeMB: number(),
6779
+ validated: boolean(),
6780
+ files: array(string()).readonly()
6781
+ })).readonly()
6782
+ });
6783
+ /**
6657
6784
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6658
6785
  * Named `RecordingWeekday` to avoid collision with the string-union
6659
6786
  * `Weekday` exported from `interfaces/timezones.ts`.
@@ -15288,6 +15415,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
15288
15415
  bundleUrl: string()
15289
15416
  });
15290
15417
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
15418
+ /**
15419
+ * `custom-model-registry` — collection cap exposing operator-registered
15420
+ * custom detection models. Each provider (today: `addon-model-studio`)
15421
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
15422
+ * them across providers (`concatCollection`).
15423
+ *
15424
+ * The detection-pipeline is *aware* of this cap: when at least one provider
15425
+ * exists it unions these descriptors into the per-step model picker and the
15426
+ * runtime model-resolution path, alongside the static catalog. When no
15427
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
15428
+ * behaviour).
15429
+ *
15430
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
15431
+ * the static catalog uses — so the existing download/resolution code consumes
15432
+ * it unchanged. `stepId` is the detection step the model targets
15433
+ * (e.g. `'object-detection'`).
15434
+ */
15435
+ var CustomModelDescriptorSchema = object({
15436
+ stepId: string(),
15437
+ entry: ModelCatalogEntrySchema
15438
+ });
15439
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
15440
+ method(object({
15441
+ nodeId: string(),
15442
+ modelId: string(),
15443
+ format: _enum(MODEL_FORMATS),
15444
+ entry: ModelCatalogEntrySchema
15445
+ }), object({
15446
+ ok: boolean(),
15447
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
15448
+ sha256: string(),
15449
+ bytes: number(),
15450
+ /** The target node's modelsDir the artifact landed in. */
15451
+ path: string()
15452
+ }), {
15453
+ kind: "mutation",
15454
+ auth: "admin"
15455
+ });
15456
+ method(object({
15457
+ sourceUrl: string(),
15458
+ metadata: ModelConvertMetadataSchema,
15459
+ targets: array(ConvertTargetSchema).min(1).readonly(),
15460
+ calibrationRef: string().optional(),
15461
+ sessionId: string().optional()
15462
+ }), ConvertResultSchema, {
15463
+ kind: "mutation",
15464
+ auth: "admin"
15465
+ });
15291
15466
  var AddonHttpRouteSchema = object({
15292
15467
  method: _enum([
15293
15468
  "GET",
@@ -20238,6 +20413,12 @@ Object.freeze({
20238
20413
  addonId: null,
20239
20414
  access: "create"
20240
20415
  },
20416
+ "customModelRegistry.listModels": {
20417
+ capName: "custom-model-registry",
20418
+ capScope: "system",
20419
+ addonId: null,
20420
+ access: "view"
20421
+ },
20241
20422
  "decoder.createSession": {
20242
20423
  capName: "decoder",
20243
20424
  capScope: "system",
@@ -21462,6 +21643,18 @@ Object.freeze({
21462
21643
  addonId: null,
21463
21644
  access: "view"
21464
21645
  },
21646
+ "modelConvert.convert": {
21647
+ capName: "model-convert",
21648
+ capScope: "system",
21649
+ addonId: null,
21650
+ access: "create"
21651
+ },
21652
+ "modelDistributor.distributeModel": {
21653
+ capName: "model-distributor",
21654
+ capScope: "system",
21655
+ addonId: null,
21656
+ access: "create"
21657
+ },
21465
21658
  "motion.isDetected": {
21466
21659
  capName: "motion",
21467
21660
  capScope: "device",
package/dist/addon.mjs CHANGED
@@ -4641,7 +4641,7 @@ function preprocess(fn, schema) {
4641
4641
  });
4642
4642
  }
4643
4643
  //#endregion
4644
- //#region ../types/dist/sleep-B1dKJAMJ.mjs
4644
+ //#region ../types/dist/sleep-BV7rLc6Y.mjs
4645
4645
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4646
4646
  EventCategory["SystemBoot"] = "system.boot";
4647
4647
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5120,6 +5120,12 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5120
5120
  * Payload: `{ deviceId, childDeviceIds, hiddenChildIds }`.
5121
5121
  */
5122
5122
  EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
5123
+ /**
5124
+ * Progress update from a running model conversion job.
5125
+ * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
5126
+ * Emitted by `addon-model-studio` on the converting node.
5127
+ */
5128
+ EventCategory["ModelConvertProgress"] = "model-convert.progress";
5123
5129
  return EventCategory;
5124
5130
  }({});
5125
5131
  Object.fromEntries([
@@ -6645,6 +6651,13 @@ object({
6645
6651
  unreachable: number()
6646
6652
  })
6647
6653
  });
6654
+ var LabelDefinitionSchema = object({
6655
+ id: string(),
6656
+ name: string(),
6657
+ category: string().optional(),
6658
+ description: string().optional(),
6659
+ icon: string().optional()
6660
+ });
6648
6661
  var MODEL_FORMATS = [
6649
6662
  "onnx",
6650
6663
  "coreml",
@@ -6653,6 +6666,120 @@ var MODEL_FORMATS = [
6653
6666
  "pt"
6654
6667
  ];
6655
6668
  /**
6669
+ * Multi-file format payload.
6670
+ *
6671
+ * - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
6672
+ * relative to the directory root — the downloader fetches each from
6673
+ * `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
6674
+ * HuggingFace API (slower).
6675
+ * - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
6676
+ * files fetched from the SAME remote directory as `url` and stored flat
6677
+ * alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
6678
+ * weights next to `camstack-yolov9t.xml`.
6679
+ */
6680
+ var ModelFormatEntrySchema = object({
6681
+ url: string(),
6682
+ sizeMB: number(),
6683
+ /** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
6684
+ isDirectory: boolean().optional(),
6685
+ /** Multi-file payload (directory members or sibling files). */
6686
+ files: array(string()).readonly().optional(),
6687
+ /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
6688
+ runtimes: array(_enum(["node", "python"])).readonly().optional()
6689
+ });
6690
+ /**
6691
+ * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
6692
+ * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
6693
+ */
6694
+ var ModelExtraFileSchema = object({
6695
+ url: string(),
6696
+ filename: string(),
6697
+ sizeMB: number()
6698
+ });
6699
+ /**
6700
+ * Per-format payload map. Modelled as an explicit object (one optional key
6701
+ * per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
6702
+ * record requires every key, but a catalog entry only ships a subset of
6703
+ * formats.
6704
+ */
6705
+ var ModelFormatsSchema = object({
6706
+ onnx: ModelFormatEntrySchema.optional(),
6707
+ coreml: ModelFormatEntrySchema.optional(),
6708
+ openvino: ModelFormatEntrySchema.optional(),
6709
+ tflite: ModelFormatEntrySchema.optional(),
6710
+ pt: ModelFormatEntrySchema.optional()
6711
+ });
6712
+ var ModelCatalogEntrySchema = object({
6713
+ id: string(),
6714
+ name: string(),
6715
+ description: string(),
6716
+ formats: ModelFormatsSchema,
6717
+ inputSize: object({
6718
+ width: number(),
6719
+ height: number()
6720
+ }),
6721
+ labels: array(LabelDefinitionSchema).readonly(),
6722
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6723
+ inputNormalization: _enum([
6724
+ "zero-one",
6725
+ "imagenet",
6726
+ "none"
6727
+ ]).optional(),
6728
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6729
+ /**
6730
+ * When true, the executor produces a landmark-aligned crop (similarity warp
6731
+ * onto the canonical template) before this step runs, instead of a plain
6732
+ * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
6733
+ * their embeddings are only discriminative on an aligned input. The face
6734
+ * detector that produced the parent detail must emit 5 landmarks.
6735
+ */
6736
+ faceAlignment: boolean().optional(),
6737
+ /**
6738
+ * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6739
+ * Downloaded into the same modelsDir alongside the model file.
6740
+ */
6741
+ extraFiles: array(ModelExtraFileSchema).readonly().optional()
6742
+ });
6743
+ var ConvertTargetSchema = discriminatedUnion("format", [object({
6744
+ format: literal("openvino"),
6745
+ precisions: array(_enum(["fp16", "int8"])).min(1).readonly()
6746
+ }), object({ format: literal("coreml") })]);
6747
+ var ModelConvertMetadataSchema = object({
6748
+ id: string().regex(/^[a-zA-Z0-9._-]+$/),
6749
+ name: string(),
6750
+ labels: array(LabelDefinitionSchema).readonly(),
6751
+ inputSize: object({
6752
+ width: number(),
6753
+ height: number()
6754
+ }),
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
+ outputFormat: _enum([
6763
+ "yolo",
6764
+ "ssd",
6765
+ "embedding",
6766
+ "classification",
6767
+ "ocr",
6768
+ "segmentation"
6769
+ ]),
6770
+ faceAlignment: boolean().optional()
6771
+ });
6772
+ var ConvertResultSchema = object({
6773
+ entry: ModelCatalogEntrySchema,
6774
+ artifacts: array(object({
6775
+ format: _enum(MODEL_FORMATS),
6776
+ precision: _enum(["fp16", "int8"]).optional(),
6777
+ sizeMB: number(),
6778
+ validated: boolean(),
6779
+ files: array(string()).readonly()
6780
+ })).readonly()
6781
+ });
6782
+ /**
6656
6783
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6657
6784
  * Named `RecordingWeekday` to avoid collision with the string-union
6658
6785
  * `Weekday` exported from `interfaces/timezones.ts`.
@@ -15287,6 +15414,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
15287
15414
  bundleUrl: string()
15288
15415
  });
15289
15416
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
15417
+ /**
15418
+ * `custom-model-registry` — collection cap exposing operator-registered
15419
+ * custom detection models. Each provider (today: `addon-model-studio`)
15420
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
15421
+ * them across providers (`concatCollection`).
15422
+ *
15423
+ * The detection-pipeline is *aware* of this cap: when at least one provider
15424
+ * exists it unions these descriptors into the per-step model picker and the
15425
+ * runtime model-resolution path, alongside the static catalog. When no
15426
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
15427
+ * behaviour).
15428
+ *
15429
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
15430
+ * the static catalog uses — so the existing download/resolution code consumes
15431
+ * it unchanged. `stepId` is the detection step the model targets
15432
+ * (e.g. `'object-detection'`).
15433
+ */
15434
+ var CustomModelDescriptorSchema = object({
15435
+ stepId: string(),
15436
+ entry: ModelCatalogEntrySchema
15437
+ });
15438
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
15439
+ method(object({
15440
+ nodeId: string(),
15441
+ modelId: string(),
15442
+ format: _enum(MODEL_FORMATS),
15443
+ entry: ModelCatalogEntrySchema
15444
+ }), object({
15445
+ ok: boolean(),
15446
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
15447
+ sha256: string(),
15448
+ bytes: number(),
15449
+ /** The target node's modelsDir the artifact landed in. */
15450
+ path: string()
15451
+ }), {
15452
+ kind: "mutation",
15453
+ auth: "admin"
15454
+ });
15455
+ method(object({
15456
+ sourceUrl: string(),
15457
+ metadata: ModelConvertMetadataSchema,
15458
+ targets: array(ConvertTargetSchema).min(1).readonly(),
15459
+ calibrationRef: string().optional(),
15460
+ sessionId: string().optional()
15461
+ }), ConvertResultSchema, {
15462
+ kind: "mutation",
15463
+ auth: "admin"
15464
+ });
15290
15465
  var AddonHttpRouteSchema = object({
15291
15466
  method: _enum([
15292
15467
  "GET",
@@ -20237,6 +20412,12 @@ Object.freeze({
20237
20412
  addonId: null,
20238
20413
  access: "create"
20239
20414
  },
20415
+ "customModelRegistry.listModels": {
20416
+ capName: "custom-model-registry",
20417
+ capScope: "system",
20418
+ addonId: null,
20419
+ access: "view"
20420
+ },
20240
20421
  "decoder.createSession": {
20241
20422
  capName: "decoder",
20242
20423
  capScope: "system",
@@ -21461,6 +21642,18 @@ Object.freeze({
21461
21642
  addonId: null,
21462
21643
  access: "view"
21463
21644
  },
21645
+ "modelConvert.convert": {
21646
+ capName: "model-convert",
21647
+ capScope: "system",
21648
+ addonId: null,
21649
+ access: "create"
21650
+ },
21651
+ "modelDistributor.distributeModel": {
21652
+ capName: "model-distributor",
21653
+ capScope: "system",
21654
+ addonId: null,
21655
+ access: "create"
21656
+ },
21464
21657
  "motion.isDetected": {
21465
21658
  capName: "motion",
21466
21659
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-rtsp",
3
- "version": "1.0.7",
3
+ "version": "1.1.1",
4
4
  "description": "Generic RTSP camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",