@camstack/addon-mqtt-broker 1.2.27 → 1.2.28

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.
@@ -5846,6 +5846,13 @@ var BaseAddon = class {
5846
5846
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
5847
5847
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
5848
5848
  _registeredCapNames = [];
5849
+ /**
5850
+ * True only after `readAddonStore` actually answered. Constructor
5851
+ * defaults look like stored config when the store is down — a forked
5852
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
5853
+ * mode, 2026-08-25) is not "the operator chose this".
5854
+ */
5855
+ settingsStoreReady = false;
5849
5856
  /** Default config values. Provided via constructor. */
5850
5857
  defaults;
5851
5858
  constructor(defaults) {
@@ -6246,7 +6253,9 @@ var BaseAddon = class {
6246
6253
  ];
6247
6254
  let lastErr;
6248
6255
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
6249
- return await settings.readAddonStore() ?? {};
6256
+ const stored = await settings.readAddonStore() ?? {};
6257
+ this.settingsStoreReady = true;
6258
+ return stored;
6250
6259
  } catch (err) {
6251
6260
  lastErr = err;
6252
6261
  const msg = err instanceof Error ? err.message : String(err);
@@ -6254,6 +6263,7 @@ var BaseAddon = class {
6254
6263
  if (attempt === delaysMs.length) break;
6255
6264
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
6256
6265
  }
6266
+ this.settingsStoreReady = false;
6257
6267
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
6258
6268
  return {};
6259
6269
  }
@@ -8141,6 +8151,12 @@ var ModelVariantGroupSchema = object({
8141
8151
  */
8142
8152
  resolution: number().int().positive().optional()
8143
8153
  });
8154
+ var ModelProviderIdSchema = _enum([
8155
+ "camstack",
8156
+ "frigate",
8157
+ "scrypted",
8158
+ "custom"
8159
+ ]);
8144
8160
  var ModelCatalogEntrySchema = object({
8145
8161
  id: string(),
8146
8162
  name: string(),
@@ -8238,6 +8254,12 @@ var ModelCatalogEntrySchema = object({
8238
8254
  */
8239
8255
  group: ModelVariantGroupSchema.optional(),
8240
8256
  /**
8257
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
8258
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
8259
+ * persisted before this field existed (`inferModelProvider` fills those).
8260
+ */
8261
+ provider: ModelProviderIdSchema.optional(),
8262
+ /**
8241
8263
  * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
8242
8264
  * applies (Frigate / COCO public catalog). Set on a custom model whose raw
8243
8265
  * labels already ARE the CamStack macros (Scrypted identity map).
@@ -11814,6 +11836,27 @@ var LinkedDeviceSchema = object({
11814
11836
  features: array(string()),
11815
11837
  producesTrackedEvents: boolean().optional()
11816
11838
  });
11839
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
11840
+ * The batch answer needs the tag; the single-device answer already has it
11841
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
11842
+ var LinkedDevicesForDeviceSchema = object({
11843
+ deviceId: number(),
11844
+ mode: LinkedDevicesModeSchema,
11845
+ devices: array(LinkedDeviceSchema)
11846
+ });
11847
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
11848
+ * `getAllBindings` all answer in. Declared once: three copies of the same
11849
+ * object literal is exactly how the three drift apart. */
11850
+ var DeviceBindingsForDeviceSchema = object({
11851
+ deviceId: number(),
11852
+ entries: array(object({
11853
+ capName: string(),
11854
+ kind: _enum(["native", "wrapped"]),
11855
+ providerAddonId: string(),
11856
+ providerNodeId: string(),
11857
+ nativeAddonId: string()
11858
+ }))
11859
+ });
11817
11860
  var SavedDeviceRowSchema = object({
11818
11861
  /** Numeric id reserved at allocateDeviceId time. */
11819
11862
  id: number(),
@@ -12039,11 +12082,25 @@ method(object({
12039
12082
  projection: _enum(["full", "slim"]).optional(),
12040
12083
  /** Return only camera devices. Filtering server-side instead of
12041
12084
  * shipping 293 rows to find 12. */
12042
- isCamera: boolean().optional()
12085
+ isCamera: boolean().optional(),
12086
+ /**
12087
+ * Return only these device ids. For the caller that already KNOWS the
12088
+ * handful it wants and needs a field the id-bearing answer does not
12089
+ * carry — the viewer's linked-devices panel joins `type` and `online`
12090
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
12091
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
12092
+ * refetches on the reconcile interval, on a phone.
12093
+ *
12094
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12095
+ * keys rather than rejecting them (verified against the live hub
12096
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12097
+ * it answers today and the caller filters as it already does.
12098
+ */
12099
+ deviceIds: array(number()).optional()
12043
12100
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12044
12101
  mode: LinkedDevicesModeSchema,
12045
12102
  devices: array(LinkedDeviceSchema)
12046
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12103
+ })), method(object({ deviceIds: array(number()) }), array(LinkedDevicesForDeviceSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12047
12104
  deviceId: number(),
12048
12105
  values: record(string(), unknown())
12049
12106
  }), object({ success: literal(true) }), {
@@ -12070,25 +12127,7 @@ method(object({
12070
12127
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
12071
12128
  kind: "mutation",
12072
12129
  auth: "admin"
12073
- }), method(object({ deviceId: number() }), object({
12074
- deviceId: number(),
12075
- entries: array(object({
12076
- capName: string(),
12077
- kind: _enum(["native", "wrapped"]),
12078
- providerAddonId: string(),
12079
- providerNodeId: string(),
12080
- nativeAddonId: string()
12081
- }))
12082
- })), method(object({}), array(object({
12083
- deviceId: number(),
12084
- entries: array(object({
12085
- capName: string(),
12086
- kind: _enum(["native", "wrapped"]),
12087
- providerAddonId: string(),
12088
- providerNodeId: string(),
12089
- nativeAddonId: string()
12090
- }))
12091
- }))), method(object({
12130
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
12092
12131
  deviceId: number(),
12093
12132
  capName: string(),
12094
12133
  wrapperAddonId: string(),
@@ -14479,12 +14518,15 @@ var NcOccupancyConditionSchema = object({
14479
14518
  * there is no second switch that can disagree with the first and every rule
14480
14519
  * authored before the decision migrates for free (`audioModeOf`):
14481
14520
  *
14482
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14483
- * classifier labels with one of them. No window, no percentage:
14484
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14485
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14486
- * the analyzer's (`classificationMinScore`, per device) a label only
14487
- * reaches this condition if the classifier was already confident enough.
14521
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
14522
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
14523
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
14524
+ * frames is the wrong question for a classifier that labels 1–3 frames
14525
+ * per episode. The count window is the brake that drops a single-frame
14526
+ * false positive; the rule's own `throttle` cooldown is the other. The
14527
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
14528
+ * per device) — a label only reaches this condition if the classifier was
14529
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14488
14530
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14489
14531
  * the condition: at least `hitPercent`% of the samples over
14490
14532
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14511,14 +14553,22 @@ var NcOccupancyConditionSchema = object({
14511
14553
  * an operator who typed `dog` mean the same thing.
14512
14554
  */
14513
14555
  var NcAudioConditionSchema = object({
14514
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14556
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14515
14557
  labels: array(string().min(1)).min(1).optional(),
14516
14558
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14517
14559
  dbThreshold: number().min(-96).max(0).optional(),
14518
14560
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14519
14561
  hitPercent: number().int().min(1).max(100).default(60),
14520
14562
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14521
- samplingSeconds: number().int().min(1).max(300).default(10)
14563
+ samplingSeconds: number().int().min(1).max(300).default(10),
14564
+ /**
14565
+ * LABEL MODE: how many labelled frames must land inside
14566
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
14567
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
14568
+ */
14569
+ confirmHits: number().int().min(1).max(20).optional(),
14570
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
14571
+ confirmWindowSec: number().int().min(1).max(60).optional()
14522
14572
  });
14523
14573
  /**
14524
14574
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -16892,6 +16942,46 @@ var RecentTracksPageSchema = object({
16892
16942
  /** Cursor for the next page, or null when this page is the last. */
16893
16943
  nextCursor: string().nullable()
16894
16944
  });
16945
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
16946
+ var LIST_GROUPS_MAX_LIMIT = 100;
16947
+ var AnalyticsGroupRecordSchema = object({
16948
+ id: string(),
16949
+ deviceId: number().int(),
16950
+ openedAt: number().int(),
16951
+ closedAt: number().int(),
16952
+ timestamp: number().int(),
16953
+ memberCount: number().int(),
16954
+ memberTrackIds: array(string()).readonly(),
16955
+ className: string(),
16956
+ classes: array(string()).readonly(),
16957
+ /** Relative event-media path, or null when the group has no picture yet. */
16958
+ mediaUrl: string().nullable(),
16959
+ singleton: boolean()
16960
+ });
16961
+ var AnalyticsGroupMemberSchema = object({
16962
+ trackId: string(),
16963
+ deviceId: number().int(),
16964
+ className: string(),
16965
+ firstSeen: number().int(),
16966
+ lastSeen: number().int(),
16967
+ mediaUrl: string().nullable()
16968
+ });
16969
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
16970
+ var ListGroupsQueryInput = object({
16971
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
16972
+ deviceIds: array(number()),
16973
+ /** Window lower bound on `closedAt` (inclusive). */
16974
+ since: number().optional(),
16975
+ /** Window upper bound on `openedAt` (inclusive). */
16976
+ until: number().optional(),
16977
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
16978
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
16979
+ cursor: string().optional()
16980
+ });
16981
+ var ListGroupsPageSchema = object({
16982
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
16983
+ nextCursor: string().nullable()
16984
+ });
16895
16985
  var KeyEventQueryInput = object({
16896
16986
  deviceId: number(),
16897
16987
  /** Window lower bound (track firstSeen ≥ since). */
@@ -16967,7 +17057,9 @@ var TrackCascadeCountsSchema = object({
16967
17057
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
16968
17058
  plates: number().int(),
16969
17059
  /** Per-track CLIP search vectors removed (best-effort). */
16970
- embeddings: number().int()
17060
+ embeddings: number().int(),
17061
+ /** Group membership + group rows removed with their last member (best-effort). */
17062
+ groups: number().int()
16971
17063
  });
16972
17064
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
16973
17065
  var DiskReconcileCountsSchema = object({
@@ -17113,7 +17205,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17113
17205
  * stationary registry). Default false: the timeline lists passages,
17114
17206
  * not parking records (operator decision, 2026-08-15). */
17115
17207
  includeStationary: boolean().optional()
17116
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17208
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17209
+ deviceId: number(),
17210
+ groupId: string().min(1)
17211
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
17117
17212
  kind: "mutation",
17118
17213
  auth: "admin"
17119
17214
  }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(EventKindsForDeviceSchema).readonly()), method(object({
@@ -17423,7 +17518,8 @@ var PipelineModelOptionSchema = object({
17423
17518
  sizeMB: number()
17424
17519
  })),
17425
17520
  group: ModelVariantGroupSchema.optional(),
17426
- legacy: boolean().optional()
17521
+ legacy: boolean().optional(),
17522
+ provider: ModelProviderIdSchema.optional()
17427
17523
  });
17428
17524
  var ConfigFieldBridge = custom();
17429
17525
  var PipelineAddonSchemaSchema = object({
@@ -24007,7 +24103,12 @@ var PlateInfoSchema = object({
24007
24103
  plateBbox: BoundingBoxSchema.optional(),
24008
24104
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
24009
24105
  keyFrameMediaKey: string().optional(),
24010
- base64: string().optional()
24106
+ base64: string().optional(),
24107
+ /**
24108
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
24109
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
24110
+ */
24111
+ cropUrl: string().optional()
24011
24112
  });
24012
24113
  var MediaFileLiteSchema = object({
24013
24114
  key: string(),
@@ -27647,6 +27748,12 @@ Object.freeze({
27647
27748
  addonId: null,
27648
27749
  access: "view"
27649
27750
  },
27751
+ "deviceManager.getBindingsBatch": {
27752
+ capName: "device-manager",
27753
+ capScope: "system",
27754
+ addonId: null,
27755
+ access: "view"
27756
+ },
27650
27757
  "deviceManager.getChildren": {
27651
27758
  capName: "device-manager",
27652
27759
  capScope: "system",
@@ -27707,6 +27814,12 @@ Object.freeze({
27707
27814
  addonId: null,
27708
27815
  access: "view"
27709
27816
  },
27817
+ "deviceManager.getLinkedDevicesBatch": {
27818
+ capName: "device-manager",
27819
+ capScope: "system",
27820
+ addonId: null,
27821
+ access: "view"
27822
+ },
27710
27823
  "deviceManager.getRoleDisplayDefaults": {
27711
27824
  capName: "device-manager",
27712
27825
  capScope: "system",
@@ -29477,6 +29590,12 @@ Object.freeze({
29477
29590
  addonId: null,
29478
29591
  access: "view"
29479
29592
  },
29593
+ "pipelineAnalytics.getGroup": {
29594
+ capName: "pipeline-analytics",
29595
+ capScope: "device",
29596
+ addonId: null,
29597
+ access: "view"
29598
+ },
29480
29599
  "pipelineAnalytics.getKeyEvents": {
29481
29600
  capName: "pipeline-analytics",
29482
29601
  capScope: "device",
@@ -29561,6 +29680,12 @@ Object.freeze({
29561
29680
  addonId: null,
29562
29681
  access: "view"
29563
29682
  },
29683
+ "pipelineAnalytics.listGroups": {
29684
+ capName: "pipeline-analytics",
29685
+ capScope: "device",
29686
+ addonId: null,
29687
+ access: "view"
29688
+ },
29564
29689
  "pipelineAnalytics.listOpsLog": {
29565
29690
  capName: "pipeline-analytics",
29566
29691
  capScope: "device",
@@ -32342,6 +32467,11 @@ Object.freeze({
32342
32467
  form: "single",
32343
32468
  optional: false
32344
32469
  }],
32470
+ "deviceManager.getBindingsBatch": [{
32471
+ name: "deviceIds",
32472
+ form: "array",
32473
+ optional: false
32474
+ }],
32345
32475
  "deviceManager.getChildren": [{
32346
32476
  name: "parentDeviceId",
32347
32477
  form: "single",
@@ -32387,6 +32517,11 @@ Object.freeze({
32387
32517
  form: "single",
32388
32518
  optional: false
32389
32519
  }],
32520
+ "deviceManager.getLinkedDevicesBatch": [{
32521
+ name: "deviceIds",
32522
+ form: "array",
32523
+ optional: false
32524
+ }],
32390
32525
  "deviceManager.getSettingsSchema": [{
32391
32526
  name: "deviceId",
32392
32527
  form: "single",
@@ -32407,6 +32542,11 @@ Object.freeze({
32407
32542
  form: "single",
32408
32543
  optional: false
32409
32544
  }],
32545
+ "deviceManager.listAll": [{
32546
+ name: "deviceIds",
32547
+ form: "array",
32548
+ optional: true
32549
+ }],
32410
32550
  "deviceManager.loadConfig": [{
32411
32551
  name: "deviceId",
32412
32552
  form: "single",
@@ -32980,6 +33120,11 @@ Object.freeze({
32980
33120
  form: "single",
32981
33121
  optional: false
32982
33122
  }],
33123
+ "pipelineAnalytics.getGroup": [{
33124
+ name: "deviceId",
33125
+ form: "single",
33126
+ optional: false
33127
+ }],
32983
33128
  "pipelineAnalytics.getKeyEvents": [{
32984
33129
  name: "deviceId",
32985
33130
  form: "single",
@@ -33035,6 +33180,11 @@ Object.freeze({
33035
33180
  form: "array",
33036
33181
  optional: false
33037
33182
  }],
33183
+ "pipelineAnalytics.listGroups": [{
33184
+ name: "deviceIds",
33185
+ form: "array",
33186
+ optional: false
33187
+ }],
33038
33188
  "pipelineAnalytics.listOpsLog": [{
33039
33189
  name: "deviceId",
33040
33190
  form: "single",
@@ -5841,6 +5841,13 @@ var BaseAddon = class {
5841
5841
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
5842
5842
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
5843
5843
  _registeredCapNames = [];
5844
+ /**
5845
+ * True only after `readAddonStore` actually answered. Constructor
5846
+ * defaults look like stored config when the store is down — a forked
5847
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
5848
+ * mode, 2026-08-25) is not "the operator chose this".
5849
+ */
5850
+ settingsStoreReady = false;
5844
5851
  /** Default config values. Provided via constructor. */
5845
5852
  defaults;
5846
5853
  constructor(defaults) {
@@ -6241,7 +6248,9 @@ var BaseAddon = class {
6241
6248
  ];
6242
6249
  let lastErr;
6243
6250
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
6244
- return await settings.readAddonStore() ?? {};
6251
+ const stored = await settings.readAddonStore() ?? {};
6252
+ this.settingsStoreReady = true;
6253
+ return stored;
6245
6254
  } catch (err) {
6246
6255
  lastErr = err;
6247
6256
  const msg = err instanceof Error ? err.message : String(err);
@@ -6249,6 +6258,7 @@ var BaseAddon = class {
6249
6258
  if (attempt === delaysMs.length) break;
6250
6259
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
6251
6260
  }
6261
+ this.settingsStoreReady = false;
6252
6262
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
6253
6263
  return {};
6254
6264
  }
@@ -8136,6 +8146,12 @@ var ModelVariantGroupSchema = object({
8136
8146
  */
8137
8147
  resolution: number().int().positive().optional()
8138
8148
  });
8149
+ var ModelProviderIdSchema = _enum([
8150
+ "camstack",
8151
+ "frigate",
8152
+ "scrypted",
8153
+ "custom"
8154
+ ]);
8139
8155
  var ModelCatalogEntrySchema = object({
8140
8156
  id: string(),
8141
8157
  name: string(),
@@ -8233,6 +8249,12 @@ var ModelCatalogEntrySchema = object({
8233
8249
  */
8234
8250
  group: ModelVariantGroupSchema.optional(),
8235
8251
  /**
8252
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
8253
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
8254
+ * persisted before this field existed (`inferModelProvider` fills those).
8255
+ */
8256
+ provider: ModelProviderIdSchema.optional(),
8257
+ /**
8236
8258
  * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
8237
8259
  * applies (Frigate / COCO public catalog). Set on a custom model whose raw
8238
8260
  * labels already ARE the CamStack macros (Scrypted identity map).
@@ -11809,6 +11831,27 @@ var LinkedDeviceSchema = object({
11809
11831
  features: array(string()),
11810
11832
  producesTrackedEvents: boolean().optional()
11811
11833
  });
11834
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
11835
+ * The batch answer needs the tag; the single-device answer already has it
11836
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
11837
+ var LinkedDevicesForDeviceSchema = object({
11838
+ deviceId: number(),
11839
+ mode: LinkedDevicesModeSchema,
11840
+ devices: array(LinkedDeviceSchema)
11841
+ });
11842
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
11843
+ * `getAllBindings` all answer in. Declared once: three copies of the same
11844
+ * object literal is exactly how the three drift apart. */
11845
+ var DeviceBindingsForDeviceSchema = object({
11846
+ deviceId: number(),
11847
+ entries: array(object({
11848
+ capName: string(),
11849
+ kind: _enum(["native", "wrapped"]),
11850
+ providerAddonId: string(),
11851
+ providerNodeId: string(),
11852
+ nativeAddonId: string()
11853
+ }))
11854
+ });
11812
11855
  var SavedDeviceRowSchema = object({
11813
11856
  /** Numeric id reserved at allocateDeviceId time. */
11814
11857
  id: number(),
@@ -12034,11 +12077,25 @@ method(object({
12034
12077
  projection: _enum(["full", "slim"]).optional(),
12035
12078
  /** Return only camera devices. Filtering server-side instead of
12036
12079
  * shipping 293 rows to find 12. */
12037
- isCamera: boolean().optional()
12080
+ isCamera: boolean().optional(),
12081
+ /**
12082
+ * Return only these device ids. For the caller that already KNOWS the
12083
+ * handful it wants and needs a field the id-bearing answer does not
12084
+ * carry — the viewer's linked-devices panel joins `type` and `online`
12085
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
12086
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
12087
+ * refetches on the reconcile interval, on a phone.
12088
+ *
12089
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12090
+ * keys rather than rejecting them (verified against the live hub
12091
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12092
+ * it answers today and the caller filters as it already does.
12093
+ */
12094
+ deviceIds: array(number()).optional()
12038
12095
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12039
12096
  mode: LinkedDevicesModeSchema,
12040
12097
  devices: array(LinkedDeviceSchema)
12041
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12098
+ })), method(object({ deviceIds: array(number()) }), array(LinkedDevicesForDeviceSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12042
12099
  deviceId: number(),
12043
12100
  values: record(string(), unknown())
12044
12101
  }), object({ success: literal(true) }), {
@@ -12065,25 +12122,7 @@ method(object({
12065
12122
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
12066
12123
  kind: "mutation",
12067
12124
  auth: "admin"
12068
- }), method(object({ deviceId: number() }), object({
12069
- deviceId: number(),
12070
- entries: array(object({
12071
- capName: string(),
12072
- kind: _enum(["native", "wrapped"]),
12073
- providerAddonId: string(),
12074
- providerNodeId: string(),
12075
- nativeAddonId: string()
12076
- }))
12077
- })), method(object({}), array(object({
12078
- deviceId: number(),
12079
- entries: array(object({
12080
- capName: string(),
12081
- kind: _enum(["native", "wrapped"]),
12082
- providerAddonId: string(),
12083
- providerNodeId: string(),
12084
- nativeAddonId: string()
12085
- }))
12086
- }))), method(object({
12125
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
12087
12126
  deviceId: number(),
12088
12127
  capName: string(),
12089
12128
  wrapperAddonId: string(),
@@ -14474,12 +14513,15 @@ var NcOccupancyConditionSchema = object({
14474
14513
  * there is no second switch that can disagree with the first and every rule
14475
14514
  * authored before the decision migrates for free (`audioModeOf`):
14476
14515
  *
14477
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14478
- * classifier labels with one of them. No window, no percentage:
14479
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14480
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14481
- * the analyzer's (`classificationMinScore`, per device) a label only
14482
- * reaches this condition if the classifier was already confident enough.
14516
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
14517
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
14518
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
14519
+ * frames is the wrong question for a classifier that labels 1–3 frames
14520
+ * per episode. The count window is the brake that drops a single-frame
14521
+ * false positive; the rule's own `throttle` cooldown is the other. The
14522
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
14523
+ * per device) — a label only reaches this condition if the classifier was
14524
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14483
14525
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14484
14526
  * the condition: at least `hitPercent`% of the samples over
14485
14527
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14506,14 +14548,22 @@ var NcOccupancyConditionSchema = object({
14506
14548
  * an operator who typed `dog` mean the same thing.
14507
14549
  */
14508
14550
  var NcAudioConditionSchema = object({
14509
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14551
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14510
14552
  labels: array(string().min(1)).min(1).optional(),
14511
14553
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14512
14554
  dbThreshold: number().min(-96).max(0).optional(),
14513
14555
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14514
14556
  hitPercent: number().int().min(1).max(100).default(60),
14515
14557
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14516
- samplingSeconds: number().int().min(1).max(300).default(10)
14558
+ samplingSeconds: number().int().min(1).max(300).default(10),
14559
+ /**
14560
+ * LABEL MODE: how many labelled frames must land inside
14561
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
14562
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
14563
+ */
14564
+ confirmHits: number().int().min(1).max(20).optional(),
14565
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
14566
+ confirmWindowSec: number().int().min(1).max(60).optional()
14517
14567
  });
14518
14568
  /**
14519
14569
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -16887,6 +16937,46 @@ var RecentTracksPageSchema = object({
16887
16937
  /** Cursor for the next page, or null when this page is the last. */
16888
16938
  nextCursor: string().nullable()
16889
16939
  });
16940
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
16941
+ var LIST_GROUPS_MAX_LIMIT = 100;
16942
+ var AnalyticsGroupRecordSchema = object({
16943
+ id: string(),
16944
+ deviceId: number().int(),
16945
+ openedAt: number().int(),
16946
+ closedAt: number().int(),
16947
+ timestamp: number().int(),
16948
+ memberCount: number().int(),
16949
+ memberTrackIds: array(string()).readonly(),
16950
+ className: string(),
16951
+ classes: array(string()).readonly(),
16952
+ /** Relative event-media path, or null when the group has no picture yet. */
16953
+ mediaUrl: string().nullable(),
16954
+ singleton: boolean()
16955
+ });
16956
+ var AnalyticsGroupMemberSchema = object({
16957
+ trackId: string(),
16958
+ deviceId: number().int(),
16959
+ className: string(),
16960
+ firstSeen: number().int(),
16961
+ lastSeen: number().int(),
16962
+ mediaUrl: string().nullable()
16963
+ });
16964
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
16965
+ var ListGroupsQueryInput = object({
16966
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
16967
+ deviceIds: array(number()),
16968
+ /** Window lower bound on `closedAt` (inclusive). */
16969
+ since: number().optional(),
16970
+ /** Window upper bound on `openedAt` (inclusive). */
16971
+ until: number().optional(),
16972
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
16973
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
16974
+ cursor: string().optional()
16975
+ });
16976
+ var ListGroupsPageSchema = object({
16977
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
16978
+ nextCursor: string().nullable()
16979
+ });
16890
16980
  var KeyEventQueryInput = object({
16891
16981
  deviceId: number(),
16892
16982
  /** Window lower bound (track firstSeen ≥ since). */
@@ -16962,7 +17052,9 @@ var TrackCascadeCountsSchema = object({
16962
17052
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
16963
17053
  plates: number().int(),
16964
17054
  /** Per-track CLIP search vectors removed (best-effort). */
16965
- embeddings: number().int()
17055
+ embeddings: number().int(),
17056
+ /** Group membership + group rows removed with their last member (best-effort). */
17057
+ groups: number().int()
16966
17058
  });
16967
17059
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
16968
17060
  var DiskReconcileCountsSchema = object({
@@ -17108,7 +17200,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17108
17200
  * stationary registry). Default false: the timeline lists passages,
17109
17201
  * not parking records (operator decision, 2026-08-15). */
17110
17202
  includeStationary: boolean().optional()
17111
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17203
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17204
+ deviceId: number(),
17205
+ groupId: string().min(1)
17206
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
17112
17207
  kind: "mutation",
17113
17208
  auth: "admin"
17114
17209
  }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(EventKindsForDeviceSchema).readonly()), method(object({
@@ -17418,7 +17513,8 @@ var PipelineModelOptionSchema = object({
17418
17513
  sizeMB: number()
17419
17514
  })),
17420
17515
  group: ModelVariantGroupSchema.optional(),
17421
- legacy: boolean().optional()
17516
+ legacy: boolean().optional(),
17517
+ provider: ModelProviderIdSchema.optional()
17422
17518
  });
17423
17519
  var ConfigFieldBridge = custom();
17424
17520
  var PipelineAddonSchemaSchema = object({
@@ -24002,7 +24098,12 @@ var PlateInfoSchema = object({
24002
24098
  plateBbox: BoundingBoxSchema.optional(),
24003
24099
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
24004
24100
  keyFrameMediaKey: string().optional(),
24005
- base64: string().optional()
24101
+ base64: string().optional(),
24102
+ /**
24103
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
24104
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
24105
+ */
24106
+ cropUrl: string().optional()
24006
24107
  });
24007
24108
  var MediaFileLiteSchema = object({
24008
24109
  key: string(),
@@ -27642,6 +27743,12 @@ Object.freeze({
27642
27743
  addonId: null,
27643
27744
  access: "view"
27644
27745
  },
27746
+ "deviceManager.getBindingsBatch": {
27747
+ capName: "device-manager",
27748
+ capScope: "system",
27749
+ addonId: null,
27750
+ access: "view"
27751
+ },
27645
27752
  "deviceManager.getChildren": {
27646
27753
  capName: "device-manager",
27647
27754
  capScope: "system",
@@ -27702,6 +27809,12 @@ Object.freeze({
27702
27809
  addonId: null,
27703
27810
  access: "view"
27704
27811
  },
27812
+ "deviceManager.getLinkedDevicesBatch": {
27813
+ capName: "device-manager",
27814
+ capScope: "system",
27815
+ addonId: null,
27816
+ access: "view"
27817
+ },
27705
27818
  "deviceManager.getRoleDisplayDefaults": {
27706
27819
  capName: "device-manager",
27707
27820
  capScope: "system",
@@ -29472,6 +29585,12 @@ Object.freeze({
29472
29585
  addonId: null,
29473
29586
  access: "view"
29474
29587
  },
29588
+ "pipelineAnalytics.getGroup": {
29589
+ capName: "pipeline-analytics",
29590
+ capScope: "device",
29591
+ addonId: null,
29592
+ access: "view"
29593
+ },
29475
29594
  "pipelineAnalytics.getKeyEvents": {
29476
29595
  capName: "pipeline-analytics",
29477
29596
  capScope: "device",
@@ -29556,6 +29675,12 @@ Object.freeze({
29556
29675
  addonId: null,
29557
29676
  access: "view"
29558
29677
  },
29678
+ "pipelineAnalytics.listGroups": {
29679
+ capName: "pipeline-analytics",
29680
+ capScope: "device",
29681
+ addonId: null,
29682
+ access: "view"
29683
+ },
29559
29684
  "pipelineAnalytics.listOpsLog": {
29560
29685
  capName: "pipeline-analytics",
29561
29686
  capScope: "device",
@@ -32337,6 +32462,11 @@ Object.freeze({
32337
32462
  form: "single",
32338
32463
  optional: false
32339
32464
  }],
32465
+ "deviceManager.getBindingsBatch": [{
32466
+ name: "deviceIds",
32467
+ form: "array",
32468
+ optional: false
32469
+ }],
32340
32470
  "deviceManager.getChildren": [{
32341
32471
  name: "parentDeviceId",
32342
32472
  form: "single",
@@ -32382,6 +32512,11 @@ Object.freeze({
32382
32512
  form: "single",
32383
32513
  optional: false
32384
32514
  }],
32515
+ "deviceManager.getLinkedDevicesBatch": [{
32516
+ name: "deviceIds",
32517
+ form: "array",
32518
+ optional: false
32519
+ }],
32385
32520
  "deviceManager.getSettingsSchema": [{
32386
32521
  name: "deviceId",
32387
32522
  form: "single",
@@ -32402,6 +32537,11 @@ Object.freeze({
32402
32537
  form: "single",
32403
32538
  optional: false
32404
32539
  }],
32540
+ "deviceManager.listAll": [{
32541
+ name: "deviceIds",
32542
+ form: "array",
32543
+ optional: true
32544
+ }],
32405
32545
  "deviceManager.loadConfig": [{
32406
32546
  name: "deviceId",
32407
32547
  form: "single",
@@ -32975,6 +33115,11 @@ Object.freeze({
32975
33115
  form: "single",
32976
33116
  optional: false
32977
33117
  }],
33118
+ "pipelineAnalytics.getGroup": [{
33119
+ name: "deviceId",
33120
+ form: "single",
33121
+ optional: false
33122
+ }],
32978
33123
  "pipelineAnalytics.getKeyEvents": [{
32979
33124
  name: "deviceId",
32980
33125
  form: "single",
@@ -33030,6 +33175,11 @@ Object.freeze({
33030
33175
  form: "array",
33031
33176
  optional: false
33032
33177
  }],
33178
+ "pipelineAnalytics.listGroups": [{
33179
+ name: "deviceIds",
33180
+ form: "array",
33181
+ optional: false
33182
+ }],
33033
33183
  "pipelineAnalytics.listOpsLog": [{
33034
33184
  name: "deviceId",
33035
33185
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-mqtt-broker",
3
- "version": "1.2.27",
3
+ "version": "1.2.28",
4
4
  "description": "MQTT broker registry addon for CamStack — manages external broker entries + an optional embedded aedes broker. Consumers spin up their own `mqtt.js` clients via the `mqtt-broker` cap.",
5
5
  "keywords": [
6
6
  "camstack",