@camstack/addon-static-turn 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.
@@ -4628,7 +4628,7 @@ function _instanceof(cls, params = {}) {
4628
4628
  return inst;
4629
4629
  }
4630
4630
  //#endregion
4631
- //#region ../types/dist/sleep-B1dKJAMJ.mjs
4631
+ //#region ../types/dist/sleep-BV7rLc6Y.mjs
4632
4632
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4633
4633
  EventCategory["SystemBoot"] = "system.boot";
4634
4634
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5107,6 +5107,12 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5107
5107
  * Payload: `{ deviceId, childDeviceIds, hiddenChildIds }`.
5108
5108
  */
5109
5109
  EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
5110
+ /**
5111
+ * Progress update from a running model conversion job.
5112
+ * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
5113
+ * Emitted by `addon-model-studio` on the converting node.
5114
+ */
5115
+ EventCategory["ModelConvertProgress"] = "model-convert.progress";
5110
5116
  return EventCategory;
5111
5117
  }({});
5112
5118
  Object.fromEntries([
@@ -6628,6 +6634,13 @@ object({
6628
6634
  unreachable: number()
6629
6635
  })
6630
6636
  });
6637
+ var LabelDefinitionSchema = object({
6638
+ id: string(),
6639
+ name: string(),
6640
+ category: string().optional(),
6641
+ description: string().optional(),
6642
+ icon: string().optional()
6643
+ });
6631
6644
  var MODEL_FORMATS = [
6632
6645
  "onnx",
6633
6646
  "coreml",
@@ -6636,6 +6649,120 @@ var MODEL_FORMATS = [
6636
6649
  "pt"
6637
6650
  ];
6638
6651
  /**
6652
+ * Multi-file format payload.
6653
+ *
6654
+ * - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
6655
+ * relative to the directory root — the downloader fetches each from
6656
+ * `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
6657
+ * HuggingFace API (slower).
6658
+ * - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
6659
+ * files fetched from the SAME remote directory as `url` and stored flat
6660
+ * alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
6661
+ * weights next to `camstack-yolov9t.xml`.
6662
+ */
6663
+ var ModelFormatEntrySchema = object({
6664
+ url: string(),
6665
+ sizeMB: number(),
6666
+ /** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
6667
+ isDirectory: boolean().optional(),
6668
+ /** Multi-file payload (directory members or sibling files). */
6669
+ files: array(string()).readonly().optional(),
6670
+ /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
6671
+ runtimes: array(_enum(["node", "python"])).readonly().optional()
6672
+ });
6673
+ /**
6674
+ * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
6675
+ * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
6676
+ */
6677
+ var ModelExtraFileSchema = object({
6678
+ url: string(),
6679
+ filename: string(),
6680
+ sizeMB: number()
6681
+ });
6682
+ /**
6683
+ * Per-format payload map. Modelled as an explicit object (one optional key
6684
+ * per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
6685
+ * record requires every key, but a catalog entry only ships a subset of
6686
+ * formats.
6687
+ */
6688
+ var ModelFormatsSchema = object({
6689
+ onnx: ModelFormatEntrySchema.optional(),
6690
+ coreml: ModelFormatEntrySchema.optional(),
6691
+ openvino: ModelFormatEntrySchema.optional(),
6692
+ tflite: ModelFormatEntrySchema.optional(),
6693
+ pt: ModelFormatEntrySchema.optional()
6694
+ });
6695
+ var ModelCatalogEntrySchema = object({
6696
+ id: string(),
6697
+ name: string(),
6698
+ description: string(),
6699
+ formats: ModelFormatsSchema,
6700
+ inputSize: object({
6701
+ width: number(),
6702
+ height: number()
6703
+ }),
6704
+ labels: array(LabelDefinitionSchema).readonly(),
6705
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6706
+ inputNormalization: _enum([
6707
+ "zero-one",
6708
+ "imagenet",
6709
+ "none"
6710
+ ]).optional(),
6711
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6712
+ /**
6713
+ * When true, the executor produces a landmark-aligned crop (similarity warp
6714
+ * onto the canonical template) before this step runs, instead of a plain
6715
+ * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
6716
+ * their embeddings are only discriminative on an aligned input. The face
6717
+ * detector that produced the parent detail must emit 5 landmarks.
6718
+ */
6719
+ faceAlignment: boolean().optional(),
6720
+ /**
6721
+ * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6722
+ * Downloaded into the same modelsDir alongside the model file.
6723
+ */
6724
+ extraFiles: array(ModelExtraFileSchema).readonly().optional()
6725
+ });
6726
+ var ConvertTargetSchema = discriminatedUnion("format", [object({
6727
+ format: literal("openvino"),
6728
+ precisions: array(_enum(["fp16", "int8"])).min(1).readonly()
6729
+ }), object({ format: literal("coreml") })]);
6730
+ var ModelConvertMetadataSchema = object({
6731
+ id: string().regex(/^[a-zA-Z0-9._-]+$/),
6732
+ name: string(),
6733
+ labels: array(LabelDefinitionSchema).readonly(),
6734
+ inputSize: object({
6735
+ width: number(),
6736
+ height: number()
6737
+ }),
6738
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6739
+ inputNormalization: _enum([
6740
+ "zero-one",
6741
+ "imagenet",
6742
+ "none"
6743
+ ]).optional(),
6744
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6745
+ outputFormat: _enum([
6746
+ "yolo",
6747
+ "ssd",
6748
+ "embedding",
6749
+ "classification",
6750
+ "ocr",
6751
+ "segmentation"
6752
+ ]),
6753
+ faceAlignment: boolean().optional()
6754
+ });
6755
+ var ConvertResultSchema = object({
6756
+ entry: ModelCatalogEntrySchema,
6757
+ artifacts: array(object({
6758
+ format: _enum(MODEL_FORMATS),
6759
+ precision: _enum(["fp16", "int8"]).optional(),
6760
+ sizeMB: number(),
6761
+ validated: boolean(),
6762
+ files: array(string()).readonly()
6763
+ })).readonly()
6764
+ });
6765
+ /**
6639
6766
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6640
6767
  * Named `RecordingWeekday` to avoid collision with the string-union
6641
6768
  * `Weekday` exported from `interfaces/timezones.ts`.
@@ -12474,6 +12601,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
12474
12601
  bundleUrl: string()
12475
12602
  });
12476
12603
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
12604
+ /**
12605
+ * `custom-model-registry` — collection cap exposing operator-registered
12606
+ * custom detection models. Each provider (today: `addon-model-studio`)
12607
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
12608
+ * them across providers (`concatCollection`).
12609
+ *
12610
+ * The detection-pipeline is *aware* of this cap: when at least one provider
12611
+ * exists it unions these descriptors into the per-step model picker and the
12612
+ * runtime model-resolution path, alongside the static catalog. When no
12613
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
12614
+ * behaviour).
12615
+ *
12616
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
12617
+ * the static catalog uses — so the existing download/resolution code consumes
12618
+ * it unchanged. `stepId` is the detection step the model targets
12619
+ * (e.g. `'object-detection'`).
12620
+ */
12621
+ var CustomModelDescriptorSchema = object({
12622
+ stepId: string(),
12623
+ entry: ModelCatalogEntrySchema
12624
+ });
12625
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
12626
+ method(object({
12627
+ nodeId: string(),
12628
+ modelId: string(),
12629
+ format: _enum(MODEL_FORMATS),
12630
+ entry: ModelCatalogEntrySchema
12631
+ }), object({
12632
+ ok: boolean(),
12633
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
12634
+ sha256: string(),
12635
+ bytes: number(),
12636
+ /** The target node's modelsDir the artifact landed in. */
12637
+ path: string()
12638
+ }), {
12639
+ kind: "mutation",
12640
+ auth: "admin"
12641
+ });
12642
+ method(object({
12643
+ sourceUrl: string(),
12644
+ metadata: ModelConvertMetadataSchema,
12645
+ targets: array(ConvertTargetSchema).min(1).readonly(),
12646
+ calibrationRef: string().optional(),
12647
+ sessionId: string().optional()
12648
+ }), ConvertResultSchema, {
12649
+ kind: "mutation",
12650
+ auth: "admin"
12651
+ });
12477
12652
  var AddonHttpRouteSchema = object({
12478
12653
  method: _enum([
12479
12654
  "GET",
@@ -17391,6 +17566,12 @@ Object.freeze({
17391
17566
  addonId: null,
17392
17567
  access: "create"
17393
17568
  },
17569
+ "customModelRegistry.listModels": {
17570
+ capName: "custom-model-registry",
17571
+ capScope: "system",
17572
+ addonId: null,
17573
+ access: "view"
17574
+ },
17394
17575
  "decoder.createSession": {
17395
17576
  capName: "decoder",
17396
17577
  capScope: "system",
@@ -18615,6 +18796,18 @@ Object.freeze({
18615
18796
  addonId: null,
18616
18797
  access: "view"
18617
18798
  },
18799
+ "modelConvert.convert": {
18800
+ capName: "model-convert",
18801
+ capScope: "system",
18802
+ addonId: null,
18803
+ access: "create"
18804
+ },
18805
+ "modelDistributor.distributeModel": {
18806
+ capName: "model-distributor",
18807
+ capScope: "system",
18808
+ addonId: null,
18809
+ access: "create"
18810
+ },
18618
18811
  "motion.isDetected": {
18619
18812
  capName: "motion",
18620
18813
  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([
@@ -6627,6 +6633,13 @@ object({
6627
6633
  unreachable: number()
6628
6634
  })
6629
6635
  });
6636
+ var LabelDefinitionSchema = object({
6637
+ id: string(),
6638
+ name: string(),
6639
+ category: string().optional(),
6640
+ description: string().optional(),
6641
+ icon: string().optional()
6642
+ });
6630
6643
  var MODEL_FORMATS = [
6631
6644
  "onnx",
6632
6645
  "coreml",
@@ -6635,6 +6648,120 @@ var MODEL_FORMATS = [
6635
6648
  "pt"
6636
6649
  ];
6637
6650
  /**
6651
+ * Multi-file format payload.
6652
+ *
6653
+ * - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
6654
+ * relative to the directory root — the downloader fetches each from
6655
+ * `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
6656
+ * HuggingFace API (slower).
6657
+ * - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
6658
+ * files fetched from the SAME remote directory as `url` and stored flat
6659
+ * alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
6660
+ * weights next to `camstack-yolov9t.xml`.
6661
+ */
6662
+ var ModelFormatEntrySchema = object({
6663
+ url: string(),
6664
+ sizeMB: number(),
6665
+ /** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
6666
+ isDirectory: boolean().optional(),
6667
+ /** Multi-file payload (directory members or sibling files). */
6668
+ files: array(string()).readonly().optional(),
6669
+ /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
6670
+ runtimes: array(_enum(["node", "python"])).readonly().optional()
6671
+ });
6672
+ /**
6673
+ * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
6674
+ * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
6675
+ */
6676
+ var ModelExtraFileSchema = object({
6677
+ url: string(),
6678
+ filename: string(),
6679
+ sizeMB: number()
6680
+ });
6681
+ /**
6682
+ * Per-format payload map. Modelled as an explicit object (one optional key
6683
+ * per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
6684
+ * record requires every key, but a catalog entry only ships a subset of
6685
+ * formats.
6686
+ */
6687
+ var ModelFormatsSchema = object({
6688
+ onnx: ModelFormatEntrySchema.optional(),
6689
+ coreml: ModelFormatEntrySchema.optional(),
6690
+ openvino: ModelFormatEntrySchema.optional(),
6691
+ tflite: ModelFormatEntrySchema.optional(),
6692
+ pt: ModelFormatEntrySchema.optional()
6693
+ });
6694
+ var ModelCatalogEntrySchema = object({
6695
+ id: string(),
6696
+ name: string(),
6697
+ description: string(),
6698
+ formats: ModelFormatsSchema,
6699
+ inputSize: object({
6700
+ width: number(),
6701
+ height: number()
6702
+ }),
6703
+ labels: array(LabelDefinitionSchema).readonly(),
6704
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6705
+ inputNormalization: _enum([
6706
+ "zero-one",
6707
+ "imagenet",
6708
+ "none"
6709
+ ]).optional(),
6710
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6711
+ /**
6712
+ * When true, the executor produces a landmark-aligned crop (similarity warp
6713
+ * onto the canonical template) before this step runs, instead of a plain
6714
+ * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
6715
+ * their embeddings are only discriminative on an aligned input. The face
6716
+ * detector that produced the parent detail must emit 5 landmarks.
6717
+ */
6718
+ faceAlignment: boolean().optional(),
6719
+ /**
6720
+ * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6721
+ * Downloaded into the same modelsDir alongside the model file.
6722
+ */
6723
+ extraFiles: array(ModelExtraFileSchema).readonly().optional()
6724
+ });
6725
+ var ConvertTargetSchema = discriminatedUnion("format", [object({
6726
+ format: literal("openvino"),
6727
+ precisions: array(_enum(["fp16", "int8"])).min(1).readonly()
6728
+ }), object({ format: literal("coreml") })]);
6729
+ var ModelConvertMetadataSchema = object({
6730
+ id: string().regex(/^[a-zA-Z0-9._-]+$/),
6731
+ name: string(),
6732
+ labels: array(LabelDefinitionSchema).readonly(),
6733
+ inputSize: object({
6734
+ width: number(),
6735
+ height: number()
6736
+ }),
6737
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6738
+ inputNormalization: _enum([
6739
+ "zero-one",
6740
+ "imagenet",
6741
+ "none"
6742
+ ]).optional(),
6743
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6744
+ outputFormat: _enum([
6745
+ "yolo",
6746
+ "ssd",
6747
+ "embedding",
6748
+ "classification",
6749
+ "ocr",
6750
+ "segmentation"
6751
+ ]),
6752
+ faceAlignment: boolean().optional()
6753
+ });
6754
+ var ConvertResultSchema = object({
6755
+ entry: ModelCatalogEntrySchema,
6756
+ artifacts: array(object({
6757
+ format: _enum(MODEL_FORMATS),
6758
+ precision: _enum(["fp16", "int8"]).optional(),
6759
+ sizeMB: number(),
6760
+ validated: boolean(),
6761
+ files: array(string()).readonly()
6762
+ })).readonly()
6763
+ });
6764
+ /**
6638
6765
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6639
6766
  * Named `RecordingWeekday` to avoid collision with the string-union
6640
6767
  * `Weekday` exported from `interfaces/timezones.ts`.
@@ -12473,6 +12600,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
12473
12600
  bundleUrl: string()
12474
12601
  });
12475
12602
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
12603
+ /**
12604
+ * `custom-model-registry` — collection cap exposing operator-registered
12605
+ * custom detection models. Each provider (today: `addon-model-studio`)
12606
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
12607
+ * them across providers (`concatCollection`).
12608
+ *
12609
+ * The detection-pipeline is *aware* of this cap: when at least one provider
12610
+ * exists it unions these descriptors into the per-step model picker and the
12611
+ * runtime model-resolution path, alongside the static catalog. When no
12612
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
12613
+ * behaviour).
12614
+ *
12615
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
12616
+ * the static catalog uses — so the existing download/resolution code consumes
12617
+ * it unchanged. `stepId` is the detection step the model targets
12618
+ * (e.g. `'object-detection'`).
12619
+ */
12620
+ var CustomModelDescriptorSchema = object({
12621
+ stepId: string(),
12622
+ entry: ModelCatalogEntrySchema
12623
+ });
12624
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
12625
+ method(object({
12626
+ nodeId: string(),
12627
+ modelId: string(),
12628
+ format: _enum(MODEL_FORMATS),
12629
+ entry: ModelCatalogEntrySchema
12630
+ }), object({
12631
+ ok: boolean(),
12632
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
12633
+ sha256: string(),
12634
+ bytes: number(),
12635
+ /** The target node's modelsDir the artifact landed in. */
12636
+ path: string()
12637
+ }), {
12638
+ kind: "mutation",
12639
+ auth: "admin"
12640
+ });
12641
+ method(object({
12642
+ sourceUrl: string(),
12643
+ metadata: ModelConvertMetadataSchema,
12644
+ targets: array(ConvertTargetSchema).min(1).readonly(),
12645
+ calibrationRef: string().optional(),
12646
+ sessionId: string().optional()
12647
+ }), ConvertResultSchema, {
12648
+ kind: "mutation",
12649
+ auth: "admin"
12650
+ });
12476
12651
  var AddonHttpRouteSchema = object({
12477
12652
  method: _enum([
12478
12653
  "GET",
@@ -17390,6 +17565,12 @@ Object.freeze({
17390
17565
  addonId: null,
17391
17566
  access: "create"
17392
17567
  },
17568
+ "customModelRegistry.listModels": {
17569
+ capName: "custom-model-registry",
17570
+ capScope: "system",
17571
+ addonId: null,
17572
+ access: "view"
17573
+ },
17393
17574
  "decoder.createSession": {
17394
17575
  capName: "decoder",
17395
17576
  capScope: "system",
@@ -18614,6 +18795,18 @@ Object.freeze({
18614
18795
  addonId: null,
18615
18796
  access: "view"
18616
18797
  },
18798
+ "modelConvert.convert": {
18799
+ capName: "model-convert",
18800
+ capScope: "system",
18801
+ addonId: null,
18802
+ access: "create"
18803
+ },
18804
+ "modelDistributor.distributeModel": {
18805
+ capName: "model-distributor",
18806
+ capScope: "system",
18807
+ addonId: null,
18808
+ access: "create"
18809
+ },
18617
18810
  "motion.isDetected": {
18618
18811
  capName: "motion",
18619
18812
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-static-turn",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Static / self-hosted (coturn) TURN provider for CamStack",
5
5
  "keywords": [
6
6
  "camstack",