@camstack/addon-export-alexa 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.
@@ -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([
@@ -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",
@@ -6686,6 +6699,120 @@ var MODEL_FORMATS = [
6686
6699
  "pt"
6687
6700
  ];
6688
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
+ });
6815
+ /**
6689
6816
  * Build an `IAddonRouteProvider` from a list of routes. Implements
6690
6817
  * both the operator-facing `getRoutes` (returning route descriptors
6691
6818
  * minus the handlers, which can't cross JSON) and the framework-
@@ -12747,6 +12874,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
12747
12874
  bundleUrl: string()
12748
12875
  });
12749
12876
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
12877
+ /**
12878
+ * `custom-model-registry` — collection cap exposing operator-registered
12879
+ * custom detection models. Each provider (today: `addon-model-studio`)
12880
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
12881
+ * them across providers (`concatCollection`).
12882
+ *
12883
+ * The detection-pipeline is *aware* of this cap: when at least one provider
12884
+ * exists it unions these descriptors into the per-step model picker and the
12885
+ * runtime model-resolution path, alongside the static catalog. When no
12886
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
12887
+ * behaviour).
12888
+ *
12889
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
12890
+ * the static catalog uses — so the existing download/resolution code consumes
12891
+ * it unchanged. `stepId` is the detection step the model targets
12892
+ * (e.g. `'object-detection'`).
12893
+ */
12894
+ var CustomModelDescriptorSchema = object({
12895
+ stepId: string(),
12896
+ entry: ModelCatalogEntrySchema
12897
+ });
12898
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
12899
+ method(object({
12900
+ nodeId: string(),
12901
+ modelId: string(),
12902
+ format: _enum(MODEL_FORMATS),
12903
+ entry: ModelCatalogEntrySchema
12904
+ }), object({
12905
+ ok: boolean(),
12906
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
12907
+ sha256: string(),
12908
+ bytes: number(),
12909
+ /** The target node's modelsDir the artifact landed in. */
12910
+ path: string()
12911
+ }), {
12912
+ kind: "mutation",
12913
+ auth: "admin"
12914
+ });
12915
+ method(object({
12916
+ sourceUrl: string(),
12917
+ metadata: ModelConvertMetadataSchema,
12918
+ targets: array(ConvertTargetSchema).min(1).readonly(),
12919
+ calibrationRef: string().optional(),
12920
+ sessionId: string().optional()
12921
+ }), ConvertResultSchema, {
12922
+ kind: "mutation",
12923
+ auth: "admin"
12924
+ });
12750
12925
  var AddonHttpRouteSchema = object({
12751
12926
  method: _enum([
12752
12927
  "GET",
@@ -17658,6 +17833,12 @@ Object.freeze({
17658
17833
  addonId: null,
17659
17834
  access: "create"
17660
17835
  },
17836
+ "customModelRegistry.listModels": {
17837
+ capName: "custom-model-registry",
17838
+ capScope: "system",
17839
+ addonId: null,
17840
+ access: "view"
17841
+ },
17661
17842
  "decoder.createSession": {
17662
17843
  capName: "decoder",
17663
17844
  capScope: "system",
@@ -18882,6 +19063,18 @@ Object.freeze({
18882
19063
  addonId: null,
18883
19064
  access: "view"
18884
19065
  },
19066
+ "modelConvert.convert": {
19067
+ capName: "model-convert",
19068
+ capScope: "system",
19069
+ addonId: null,
19070
+ access: "create"
19071
+ },
19072
+ "modelDistributor.distributeModel": {
19073
+ capName: "model-distributor",
19074
+ capScope: "system",
19075
+ addonId: null,
19076
+ access: "create"
19077
+ },
18885
19078
  "motion.isDetected": {
18886
19079
  capName: "motion",
18887
19080
  capScope: "device",
@@ -4629,7 +4629,7 @@ function _instanceof(cls, params = {}) {
4629
4629
  return inst;
4630
4630
  }
4631
4631
  //#endregion
4632
- //#region ../types/dist/sleep-B1dKJAMJ.mjs
4632
+ //#region ../types/dist/sleep-BV7rLc6Y.mjs
4633
4633
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4634
4634
  EventCategory["SystemBoot"] = "system.boot";
4635
4635
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5108,6 +5108,12 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5108
5108
  * Payload: `{ deviceId, childDeviceIds, hiddenChildIds }`.
5109
5109
  */
5110
5110
  EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
5111
+ /**
5112
+ * Progress update from a running model conversion job.
5113
+ * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
5114
+ * Emitted by `addon-model-studio` on the converting node.
5115
+ */
5116
+ EventCategory["ModelConvertProgress"] = "model-convert.progress";
5111
5117
  return EventCategory;
5112
5118
  }({});
5113
5119
  Object.fromEntries([
@@ -6652,6 +6658,13 @@ object({
6652
6658
  unreachable: number()
6653
6659
  })
6654
6660
  });
6661
+ var LabelDefinitionSchema = object({
6662
+ id: string(),
6663
+ name: string(),
6664
+ category: string().optional(),
6665
+ description: string().optional(),
6666
+ icon: string().optional()
6667
+ });
6655
6668
  var MODEL_FORMATS = [
6656
6669
  "onnx",
6657
6670
  "coreml",
@@ -6660,6 +6673,120 @@ var MODEL_FORMATS = [
6660
6673
  "pt"
6661
6674
  ];
6662
6675
  /**
6676
+ * Multi-file format payload.
6677
+ *
6678
+ * - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
6679
+ * relative to the directory root — the downloader fetches each from
6680
+ * `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
6681
+ * HuggingFace API (slower).
6682
+ * - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
6683
+ * files fetched from the SAME remote directory as `url` and stored flat
6684
+ * alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
6685
+ * weights next to `camstack-yolov9t.xml`.
6686
+ */
6687
+ var ModelFormatEntrySchema = object({
6688
+ url: string(),
6689
+ sizeMB: number(),
6690
+ /** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
6691
+ isDirectory: boolean().optional(),
6692
+ /** Multi-file payload (directory members or sibling files). */
6693
+ files: array(string()).readonly().optional(),
6694
+ /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
6695
+ runtimes: array(_enum(["node", "python"])).readonly().optional()
6696
+ });
6697
+ /**
6698
+ * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
6699
+ * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
6700
+ */
6701
+ var ModelExtraFileSchema = object({
6702
+ url: string(),
6703
+ filename: string(),
6704
+ sizeMB: number()
6705
+ });
6706
+ /**
6707
+ * Per-format payload map. Modelled as an explicit object (one optional key
6708
+ * per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
6709
+ * record requires every key, but a catalog entry only ships a subset of
6710
+ * formats.
6711
+ */
6712
+ var ModelFormatsSchema = object({
6713
+ onnx: ModelFormatEntrySchema.optional(),
6714
+ coreml: ModelFormatEntrySchema.optional(),
6715
+ openvino: ModelFormatEntrySchema.optional(),
6716
+ tflite: ModelFormatEntrySchema.optional(),
6717
+ pt: ModelFormatEntrySchema.optional()
6718
+ });
6719
+ var ModelCatalogEntrySchema = object({
6720
+ id: string(),
6721
+ name: string(),
6722
+ description: string(),
6723
+ formats: ModelFormatsSchema,
6724
+ inputSize: object({
6725
+ width: number(),
6726
+ height: number()
6727
+ }),
6728
+ labels: array(LabelDefinitionSchema).readonly(),
6729
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6730
+ inputNormalization: _enum([
6731
+ "zero-one",
6732
+ "imagenet",
6733
+ "none"
6734
+ ]).optional(),
6735
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6736
+ /**
6737
+ * When true, the executor produces a landmark-aligned crop (similarity warp
6738
+ * onto the canonical template) before this step runs, instead of a plain
6739
+ * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
6740
+ * their embeddings are only discriminative on an aligned input. The face
6741
+ * detector that produced the parent detail must emit 5 landmarks.
6742
+ */
6743
+ faceAlignment: boolean().optional(),
6744
+ /**
6745
+ * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6746
+ * Downloaded into the same modelsDir alongside the model file.
6747
+ */
6748
+ extraFiles: array(ModelExtraFileSchema).readonly().optional()
6749
+ });
6750
+ var ConvertTargetSchema = discriminatedUnion("format", [object({
6751
+ format: literal("openvino"),
6752
+ precisions: array(_enum(["fp16", "int8"])).min(1).readonly()
6753
+ }), object({ format: literal("coreml") })]);
6754
+ var ModelConvertMetadataSchema = object({
6755
+ id: string().regex(/^[a-zA-Z0-9._-]+$/),
6756
+ name: string(),
6757
+ labels: array(LabelDefinitionSchema).readonly(),
6758
+ inputSize: object({
6759
+ width: number(),
6760
+ height: number()
6761
+ }),
6762
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6763
+ inputNormalization: _enum([
6764
+ "zero-one",
6765
+ "imagenet",
6766
+ "none"
6767
+ ]).optional(),
6768
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6769
+ outputFormat: _enum([
6770
+ "yolo",
6771
+ "ssd",
6772
+ "embedding",
6773
+ "classification",
6774
+ "ocr",
6775
+ "segmentation"
6776
+ ]),
6777
+ faceAlignment: boolean().optional()
6778
+ });
6779
+ var ConvertResultSchema = object({
6780
+ entry: ModelCatalogEntrySchema,
6781
+ artifacts: array(object({
6782
+ format: _enum(MODEL_FORMATS),
6783
+ precision: _enum(["fp16", "int8"]).optional(),
6784
+ sizeMB: number(),
6785
+ validated: boolean(),
6786
+ files: array(string()).readonly()
6787
+ })).readonly()
6788
+ });
6789
+ /**
6663
6790
  * Build an `IAddonRouteProvider` from a list of routes. Implements
6664
6791
  * both the operator-facing `getRoutes` (returning route descriptors
6665
6792
  * minus the handlers, which can't cross JSON) and the framework-
@@ -12721,6 +12848,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
12721
12848
  bundleUrl: string()
12722
12849
  });
12723
12850
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
12851
+ /**
12852
+ * `custom-model-registry` — collection cap exposing operator-registered
12853
+ * custom detection models. Each provider (today: `addon-model-studio`)
12854
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
12855
+ * them across providers (`concatCollection`).
12856
+ *
12857
+ * The detection-pipeline is *aware* of this cap: when at least one provider
12858
+ * exists it unions these descriptors into the per-step model picker and the
12859
+ * runtime model-resolution path, alongside the static catalog. When no
12860
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
12861
+ * behaviour).
12862
+ *
12863
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
12864
+ * the static catalog uses — so the existing download/resolution code consumes
12865
+ * it unchanged. `stepId` is the detection step the model targets
12866
+ * (e.g. `'object-detection'`).
12867
+ */
12868
+ var CustomModelDescriptorSchema = object({
12869
+ stepId: string(),
12870
+ entry: ModelCatalogEntrySchema
12871
+ });
12872
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
12873
+ method(object({
12874
+ nodeId: string(),
12875
+ modelId: string(),
12876
+ format: _enum(MODEL_FORMATS),
12877
+ entry: ModelCatalogEntrySchema
12878
+ }), object({
12879
+ ok: boolean(),
12880
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
12881
+ sha256: string(),
12882
+ bytes: number(),
12883
+ /** The target node's modelsDir the artifact landed in. */
12884
+ path: string()
12885
+ }), {
12886
+ kind: "mutation",
12887
+ auth: "admin"
12888
+ });
12889
+ method(object({
12890
+ sourceUrl: string(),
12891
+ metadata: ModelConvertMetadataSchema,
12892
+ targets: array(ConvertTargetSchema).min(1).readonly(),
12893
+ calibrationRef: string().optional(),
12894
+ sessionId: string().optional()
12895
+ }), ConvertResultSchema, {
12896
+ kind: "mutation",
12897
+ auth: "admin"
12898
+ });
12724
12899
  var AddonHttpRouteSchema = object({
12725
12900
  method: _enum([
12726
12901
  "GET",
@@ -17632,6 +17807,12 @@ Object.freeze({
17632
17807
  addonId: null,
17633
17808
  access: "create"
17634
17809
  },
17810
+ "customModelRegistry.listModels": {
17811
+ capName: "custom-model-registry",
17812
+ capScope: "system",
17813
+ addonId: null,
17814
+ access: "view"
17815
+ },
17635
17816
  "decoder.createSession": {
17636
17817
  capName: "decoder",
17637
17818
  capScope: "system",
@@ -18856,6 +19037,18 @@ Object.freeze({
18856
19037
  addonId: null,
18857
19038
  access: "view"
18858
19039
  },
19040
+ "modelConvert.convert": {
19041
+ capName: "model-convert",
19042
+ capScope: "system",
19043
+ addonId: null,
19044
+ access: "create"
19045
+ },
19046
+ "modelDistributor.distributeModel": {
19047
+ capName: "model-distributor",
19048
+ capScope: "system",
19049
+ addonId: null,
19050
+ access: "create"
19051
+ },
18859
19052
  "motion.isDetected": {
18860
19053
  capName: "motion",
18861
19054
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-alexa",
3
- "version": "1.0.7",
3
+ "version": "1.1.1",
4
4
  "description": "Alexa Smart Home Skill export — hub-side OAuth provider + directive handler. The companion AWS Lambda forwards Alexa directives to this addon's /addon/export-alexa/directive endpoint.",
5
5
  "keywords": [
6
6
  "camstack",