@camstack/addon-agent-ui 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.
Files changed (2) hide show
  1. package/dist/addon.js +195 -2
  2. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -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([
@@ -6638,6 +6644,13 @@ object({
6638
6644
  unreachable: number()
6639
6645
  })
6640
6646
  });
6647
+ var LabelDefinitionSchema = object({
6648
+ id: string(),
6649
+ name: string(),
6650
+ category: string().optional(),
6651
+ description: string().optional(),
6652
+ icon: string().optional()
6653
+ });
6641
6654
  var MODEL_FORMATS = [
6642
6655
  "onnx",
6643
6656
  "coreml",
@@ -6646,6 +6659,120 @@ var MODEL_FORMATS = [
6646
6659
  "pt"
6647
6660
  ];
6648
6661
  /**
6662
+ * Multi-file format payload.
6663
+ *
6664
+ * - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
6665
+ * relative to the directory root — the downloader fetches each from
6666
+ * `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
6667
+ * HuggingFace API (slower).
6668
+ * - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
6669
+ * files fetched from the SAME remote directory as `url` and stored flat
6670
+ * alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
6671
+ * weights next to `camstack-yolov9t.xml`.
6672
+ */
6673
+ var ModelFormatEntrySchema = object({
6674
+ url: string(),
6675
+ sizeMB: number(),
6676
+ /** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
6677
+ isDirectory: boolean().optional(),
6678
+ /** Multi-file payload (directory members or sibling files). */
6679
+ files: array(string()).readonly().optional(),
6680
+ /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
6681
+ runtimes: array(_enum(["node", "python"])).readonly().optional()
6682
+ });
6683
+ /**
6684
+ * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
6685
+ * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
6686
+ */
6687
+ var ModelExtraFileSchema = object({
6688
+ url: string(),
6689
+ filename: string(),
6690
+ sizeMB: number()
6691
+ });
6692
+ /**
6693
+ * Per-format payload map. Modelled as an explicit object (one optional key
6694
+ * per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
6695
+ * record requires every key, but a catalog entry only ships a subset of
6696
+ * formats.
6697
+ */
6698
+ var ModelFormatsSchema = object({
6699
+ onnx: ModelFormatEntrySchema.optional(),
6700
+ coreml: ModelFormatEntrySchema.optional(),
6701
+ openvino: ModelFormatEntrySchema.optional(),
6702
+ tflite: ModelFormatEntrySchema.optional(),
6703
+ pt: ModelFormatEntrySchema.optional()
6704
+ });
6705
+ var ModelCatalogEntrySchema = object({
6706
+ id: string(),
6707
+ name: string(),
6708
+ description: string(),
6709
+ formats: ModelFormatsSchema,
6710
+ inputSize: object({
6711
+ width: number(),
6712
+ height: number()
6713
+ }),
6714
+ labels: array(LabelDefinitionSchema).readonly(),
6715
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6716
+ inputNormalization: _enum([
6717
+ "zero-one",
6718
+ "imagenet",
6719
+ "none"
6720
+ ]).optional(),
6721
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6722
+ /**
6723
+ * When true, the executor produces a landmark-aligned crop (similarity warp
6724
+ * onto the canonical template) before this step runs, instead of a plain
6725
+ * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
6726
+ * their embeddings are only discriminative on an aligned input. The face
6727
+ * detector that produced the parent detail must emit 5 landmarks.
6728
+ */
6729
+ faceAlignment: boolean().optional(),
6730
+ /**
6731
+ * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6732
+ * Downloaded into the same modelsDir alongside the model file.
6733
+ */
6734
+ extraFiles: array(ModelExtraFileSchema).readonly().optional()
6735
+ });
6736
+ var ConvertTargetSchema = discriminatedUnion("format", [object({
6737
+ format: literal("openvino"),
6738
+ precisions: array(_enum(["fp16", "int8"])).min(1).readonly()
6739
+ }), object({ format: literal("coreml") })]);
6740
+ var ModelConvertMetadataSchema = object({
6741
+ id: string().regex(/^[a-zA-Z0-9._-]+$/),
6742
+ name: string(),
6743
+ labels: array(LabelDefinitionSchema).readonly(),
6744
+ inputSize: object({
6745
+ width: number(),
6746
+ height: number()
6747
+ }),
6748
+ inputLayout: _enum(["nchw", "nhwc"]).optional(),
6749
+ inputNormalization: _enum([
6750
+ "zero-one",
6751
+ "imagenet",
6752
+ "none"
6753
+ ]).optional(),
6754
+ preprocessMode: _enum(["letterbox", "resize"]).optional(),
6755
+ outputFormat: _enum([
6756
+ "yolo",
6757
+ "ssd",
6758
+ "embedding",
6759
+ "classification",
6760
+ "ocr",
6761
+ "segmentation"
6762
+ ]),
6763
+ faceAlignment: boolean().optional()
6764
+ });
6765
+ var ConvertResultSchema = object({
6766
+ entry: ModelCatalogEntrySchema,
6767
+ artifacts: array(object({
6768
+ format: _enum(MODEL_FORMATS),
6769
+ precision: _enum(["fp16", "int8"]).optional(),
6770
+ sizeMB: number(),
6771
+ validated: boolean(),
6772
+ files: array(string()).readonly()
6773
+ })).readonly()
6774
+ });
6775
+ /**
6649
6776
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6650
6777
  * Named `RecordingWeekday` to avoid collision with the string-union
6651
6778
  * `Weekday` exported from `interfaces/timezones.ts`.
@@ -12484,6 +12611,54 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
12484
12611
  bundleUrl: string()
12485
12612
  });
12486
12613
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
12614
+ /**
12615
+ * `custom-model-registry` — collection cap exposing operator-registered
12616
+ * custom detection models. Each provider (today: `addon-model-studio`)
12617
+ * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
12618
+ * them across providers (`concatCollection`).
12619
+ *
12620
+ * The detection-pipeline is *aware* of this cap: when at least one provider
12621
+ * exists it unions these descriptors into the per-step model picker and the
12622
+ * runtime model-resolution path, alongside the static catalog. When no
12623
+ * provider exists the consumer no-ops entirely (identical to the catalog-only
12624
+ * behaviour).
12625
+ *
12626
+ * A descriptor carries a full `ModelCatalogEntry` directly — the same shape
12627
+ * the static catalog uses — so the existing download/resolution code consumes
12628
+ * it unchanged. `stepId` is the detection step the model targets
12629
+ * (e.g. `'object-detection'`).
12630
+ */
12631
+ var CustomModelDescriptorSchema = object({
12632
+ stepId: string(),
12633
+ entry: ModelCatalogEntrySchema
12634
+ });
12635
+ method(_void(), array(CustomModelDescriptorSchema).readonly());
12636
+ method(object({
12637
+ nodeId: string(),
12638
+ modelId: string(),
12639
+ format: _enum(MODEL_FORMATS),
12640
+ entry: ModelCatalogEntrySchema
12641
+ }), object({
12642
+ ok: boolean(),
12643
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
12644
+ sha256: string(),
12645
+ bytes: number(),
12646
+ /** The target node's modelsDir the artifact landed in. */
12647
+ path: string()
12648
+ }), {
12649
+ kind: "mutation",
12650
+ auth: "admin"
12651
+ });
12652
+ method(object({
12653
+ sourceUrl: string(),
12654
+ metadata: ModelConvertMetadataSchema,
12655
+ targets: array(ConvertTargetSchema).min(1).readonly(),
12656
+ calibrationRef: string().optional(),
12657
+ sessionId: string().optional()
12658
+ }), ConvertResultSchema, {
12659
+ kind: "mutation",
12660
+ auth: "admin"
12661
+ });
12487
12662
  var AddonHttpRouteSchema = object({
12488
12663
  method: _enum([
12489
12664
  "GET",
@@ -17378,6 +17553,12 @@ Object.freeze({
17378
17553
  addonId: null,
17379
17554
  access: "create"
17380
17555
  },
17556
+ "customModelRegistry.listModels": {
17557
+ capName: "custom-model-registry",
17558
+ capScope: "system",
17559
+ addonId: null,
17560
+ access: "view"
17561
+ },
17381
17562
  "decoder.createSession": {
17382
17563
  capName: "decoder",
17383
17564
  capScope: "system",
@@ -18602,6 +18783,18 @@ Object.freeze({
18602
18783
  addonId: null,
18603
18784
  access: "view"
18604
18785
  },
18786
+ "modelConvert.convert": {
18787
+ capName: "model-convert",
18788
+ capScope: "system",
18789
+ addonId: null,
18790
+ access: "create"
18791
+ },
18792
+ "modelDistributor.distributeModel": {
18793
+ capName: "model-distributor",
18794
+ capScope: "system",
18795
+ addonId: null,
18796
+ access: "create"
18797
+ },
18605
18798
  "motion.isDetected": {
18606
18799
  capName: "motion",
18607
18800
  capScope: "device",
@@ -20830,7 +21023,7 @@ var AgentUIAddon = class extends BaseAddon {
20830
21023
  capability: adminUiCapability,
20831
21024
  provider: {
20832
21025
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
20833
- getVersion: async () => ({ version: "1.1.0" })
21026
+ getVersion: async () => ({ version: "1.1.2" })
20834
21027
  }
20835
21028
  }];
20836
21029
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-agent-ui",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "CamStack Agent UI — lightweight status dashboard served by every agent node",
5
5
  "keywords": [
6
6
  "camstack",