@camstack/addon-provider-amcrest 0.2.28 → 0.2.29

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 (3) hide show
  1. package/dist/addon.js +184 -34
  2. package/dist/addon.mjs +184 -34
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -5806,6 +5806,13 @@ var BaseAddon = class {
5806
5806
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
5807
5807
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
5808
5808
  _registeredCapNames = [];
5809
+ /**
5810
+ * True only after `readAddonStore` actually answered. Constructor
5811
+ * defaults look like stored config when the store is down — a forked
5812
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
5813
+ * mode, 2026-08-25) is not "the operator chose this".
5814
+ */
5815
+ settingsStoreReady = false;
5809
5816
  /** Default config values. Provided via constructor. */
5810
5817
  defaults;
5811
5818
  constructor(defaults) {
@@ -6206,7 +6213,9 @@ var BaseAddon = class {
6206
6213
  ];
6207
6214
  let lastErr;
6208
6215
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
6209
- return await settings.readAddonStore() ?? {};
6216
+ const stored = await settings.readAddonStore() ?? {};
6217
+ this.settingsStoreReady = true;
6218
+ return stored;
6210
6219
  } catch (err) {
6211
6220
  lastErr = err;
6212
6221
  const msg = err instanceof Error ? err.message : String(err);
@@ -6214,6 +6223,7 @@ var BaseAddon = class {
6214
6223
  if (attempt === delaysMs.length) break;
6215
6224
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
6216
6225
  }
6226
+ this.settingsStoreReady = false;
6217
6227
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
6218
6228
  return {};
6219
6229
  }
@@ -8105,6 +8115,12 @@ var ModelVariantGroupSchema = object({
8105
8115
  */
8106
8116
  resolution: number().int().positive().optional()
8107
8117
  });
8118
+ var ModelProviderIdSchema = _enum([
8119
+ "camstack",
8120
+ "frigate",
8121
+ "scrypted",
8122
+ "custom"
8123
+ ]);
8108
8124
  var ModelCatalogEntrySchema = object({
8109
8125
  id: string(),
8110
8126
  name: string(),
@@ -8202,6 +8218,12 @@ var ModelCatalogEntrySchema = object({
8202
8218
  */
8203
8219
  group: ModelVariantGroupSchema.optional(),
8204
8220
  /**
8221
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
8222
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
8223
+ * persisted before this field existed (`inferModelProvider` fills those).
8224
+ */
8225
+ provider: ModelProviderIdSchema.optional(),
8226
+ /**
8205
8227
  * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
8206
8228
  * applies (Frigate / COCO public catalog). Set on a custom model whose raw
8207
8229
  * labels already ARE the CamStack macros (Scrypted identity map).
@@ -11993,6 +12015,27 @@ var LinkedDeviceSchema = object({
11993
12015
  features: array(string()),
11994
12016
  producesTrackedEvents: boolean().optional()
11995
12017
  });
12018
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
12019
+ * The batch answer needs the tag; the single-device answer already has it
12020
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
12021
+ var LinkedDevicesForDeviceSchema = object({
12022
+ deviceId: number(),
12023
+ mode: LinkedDevicesModeSchema,
12024
+ devices: array(LinkedDeviceSchema)
12025
+ });
12026
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
12027
+ * `getAllBindings` all answer in. Declared once: three copies of the same
12028
+ * object literal is exactly how the three drift apart. */
12029
+ var DeviceBindingsForDeviceSchema = object({
12030
+ deviceId: number(),
12031
+ entries: array(object({
12032
+ capName: string(),
12033
+ kind: _enum(["native", "wrapped"]),
12034
+ providerAddonId: string(),
12035
+ providerNodeId: string(),
12036
+ nativeAddonId: string()
12037
+ }))
12038
+ });
11996
12039
  var SavedDeviceRowSchema = object({
11997
12040
  /** Numeric id reserved at allocateDeviceId time. */
11998
12041
  id: number(),
@@ -12218,11 +12261,25 @@ method(object({
12218
12261
  projection: _enum(["full", "slim"]).optional(),
12219
12262
  /** Return only camera devices. Filtering server-side instead of
12220
12263
  * shipping 293 rows to find 12. */
12221
- isCamera: boolean().optional()
12264
+ isCamera: boolean().optional(),
12265
+ /**
12266
+ * Return only these device ids. For the caller that already KNOWS the
12267
+ * handful it wants and needs a field the id-bearing answer does not
12268
+ * carry — the viewer's linked-devices panel joins `type` and `online`
12269
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
12270
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
12271
+ * refetches on the reconcile interval, on a phone.
12272
+ *
12273
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12274
+ * keys rather than rejecting them (verified against the live hub
12275
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12276
+ * it answers today and the caller filters as it already does.
12277
+ */
12278
+ deviceIds: array(number()).optional()
12222
12279
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12223
12280
  mode: LinkedDevicesModeSchema,
12224
12281
  devices: array(LinkedDeviceSchema)
12225
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12282
+ })), 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({
12226
12283
  deviceId: number(),
12227
12284
  values: record(string(), unknown())
12228
12285
  }), object({ success: literal(true) }), {
@@ -12249,25 +12306,7 @@ method(object({
12249
12306
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
12250
12307
  kind: "mutation",
12251
12308
  auth: "admin"
12252
- }), method(object({ deviceId: number() }), object({
12253
- deviceId: number(),
12254
- entries: array(object({
12255
- capName: string(),
12256
- kind: _enum(["native", "wrapped"]),
12257
- providerAddonId: string(),
12258
- providerNodeId: string(),
12259
- nativeAddonId: string()
12260
- }))
12261
- })), method(object({}), array(object({
12262
- deviceId: number(),
12263
- entries: array(object({
12264
- capName: string(),
12265
- kind: _enum(["native", "wrapped"]),
12266
- providerAddonId: string(),
12267
- providerNodeId: string(),
12268
- nativeAddonId: string()
12269
- }))
12270
- }))), method(object({
12309
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
12271
12310
  deviceId: number(),
12272
12311
  capName: string(),
12273
12312
  wrapperAddonId: string(),
@@ -14677,12 +14716,15 @@ var NcOccupancyConditionSchema = object({
14677
14716
  * there is no second switch that can disagree with the first and every rule
14678
14717
  * authored before the decision migrates for free (`audioModeOf`):
14679
14718
  *
14680
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14681
- * classifier labels with one of them. No window, no percentage:
14682
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14683
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14684
- * the analyzer's (`classificationMinScore`, per device) a label only
14685
- * reaches this condition if the classifier was already confident enough.
14719
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
14720
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
14721
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
14722
+ * frames is the wrong question for a classifier that labels 1–3 frames
14723
+ * per episode. The count window is the brake that drops a single-frame
14724
+ * false positive; the rule's own `throttle` cooldown is the other. The
14725
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
14726
+ * per device) — a label only reaches this condition if the classifier was
14727
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14686
14728
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14687
14729
  * the condition: at least `hitPercent`% of the samples over
14688
14730
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14709,14 +14751,22 @@ var NcOccupancyConditionSchema = object({
14709
14751
  * an operator who typed `dog` mean the same thing.
14710
14752
  */
14711
14753
  var NcAudioConditionSchema = object({
14712
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14754
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14713
14755
  labels: array(string().min(1)).min(1).optional(),
14714
14756
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14715
14757
  dbThreshold: number().min(-96).max(0).optional(),
14716
14758
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14717
14759
  hitPercent: number().int().min(1).max(100).default(60),
14718
14760
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14719
- samplingSeconds: number().int().min(1).max(300).default(10)
14761
+ samplingSeconds: number().int().min(1).max(300).default(10),
14762
+ /**
14763
+ * LABEL MODE: how many labelled frames must land inside
14764
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
14765
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
14766
+ */
14767
+ confirmHits: number().int().min(1).max(20).optional(),
14768
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
14769
+ confirmWindowSec: number().int().min(1).max(60).optional()
14720
14770
  });
14721
14771
  /**
14722
14772
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -17090,6 +17140,46 @@ var RecentTracksPageSchema = object({
17090
17140
  /** Cursor for the next page, or null when this page is the last. */
17091
17141
  nextCursor: string().nullable()
17092
17142
  });
17143
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
17144
+ var LIST_GROUPS_MAX_LIMIT = 100;
17145
+ var AnalyticsGroupRecordSchema = object({
17146
+ id: string(),
17147
+ deviceId: number().int(),
17148
+ openedAt: number().int(),
17149
+ closedAt: number().int(),
17150
+ timestamp: number().int(),
17151
+ memberCount: number().int(),
17152
+ memberTrackIds: array(string()).readonly(),
17153
+ className: string(),
17154
+ classes: array(string()).readonly(),
17155
+ /** Relative event-media path, or null when the group has no picture yet. */
17156
+ mediaUrl: string().nullable(),
17157
+ singleton: boolean()
17158
+ });
17159
+ var AnalyticsGroupMemberSchema = object({
17160
+ trackId: string(),
17161
+ deviceId: number().int(),
17162
+ className: string(),
17163
+ firstSeen: number().int(),
17164
+ lastSeen: number().int(),
17165
+ mediaUrl: string().nullable()
17166
+ });
17167
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
17168
+ var ListGroupsQueryInput = object({
17169
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
17170
+ deviceIds: array(number()),
17171
+ /** Window lower bound on `closedAt` (inclusive). */
17172
+ since: number().optional(),
17173
+ /** Window upper bound on `openedAt` (inclusive). */
17174
+ until: number().optional(),
17175
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
17176
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
17177
+ cursor: string().optional()
17178
+ });
17179
+ var ListGroupsPageSchema = object({
17180
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
17181
+ nextCursor: string().nullable()
17182
+ });
17093
17183
  var KeyEventQueryInput = object({
17094
17184
  deviceId: number(),
17095
17185
  /** Window lower bound (track firstSeen ≥ since). */
@@ -17165,7 +17255,9 @@ var TrackCascadeCountsSchema = object({
17165
17255
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
17166
17256
  plates: number().int(),
17167
17257
  /** Per-track CLIP search vectors removed (best-effort). */
17168
- embeddings: number().int()
17258
+ embeddings: number().int(),
17259
+ /** Group membership + group rows removed with their last member (best-effort). */
17260
+ groups: number().int()
17169
17261
  });
17170
17262
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
17171
17263
  var DiskReconcileCountsSchema = object({
@@ -17311,7 +17403,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17311
17403
  * stationary registry). Default false: the timeline lists passages,
17312
17404
  * not parking records (operator decision, 2026-08-15). */
17313
17405
  includeStationary: boolean().optional()
17314
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17406
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17407
+ deviceId: number(),
17408
+ groupId: string().min(1)
17409
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
17315
17410
  kind: "mutation",
17316
17411
  auth: "admin"
17317
17412
  }), 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({
@@ -17621,7 +17716,8 @@ var PipelineModelOptionSchema = object({
17621
17716
  sizeMB: number()
17622
17717
  })),
17623
17718
  group: ModelVariantGroupSchema.optional(),
17624
- legacy: boolean().optional()
17719
+ legacy: boolean().optional(),
17720
+ provider: ModelProviderIdSchema.optional()
17625
17721
  });
17626
17722
  var ConfigFieldBridge = custom();
17627
17723
  var PipelineAddonSchemaSchema = object({
@@ -25868,7 +25964,12 @@ var PlateInfoSchema = object({
25868
25964
  plateBbox: BoundingBoxSchema.optional(),
25869
25965
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
25870
25966
  keyFrameMediaKey: string().optional(),
25871
- base64: string().optional()
25967
+ base64: string().optional(),
25968
+ /**
25969
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
25970
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
25971
+ */
25972
+ cropUrl: string().optional()
25872
25973
  });
25873
25974
  var MediaFileLiteSchema = object({
25874
25975
  key: string(),
@@ -31838,6 +31939,12 @@ Object.freeze({
31838
31939
  addonId: null,
31839
31940
  access: "view"
31840
31941
  },
31942
+ "deviceManager.getBindingsBatch": {
31943
+ capName: "device-manager",
31944
+ capScope: "system",
31945
+ addonId: null,
31946
+ access: "view"
31947
+ },
31841
31948
  "deviceManager.getChildren": {
31842
31949
  capName: "device-manager",
31843
31950
  capScope: "system",
@@ -31898,6 +32005,12 @@ Object.freeze({
31898
32005
  addonId: null,
31899
32006
  access: "view"
31900
32007
  },
32008
+ "deviceManager.getLinkedDevicesBatch": {
32009
+ capName: "device-manager",
32010
+ capScope: "system",
32011
+ addonId: null,
32012
+ access: "view"
32013
+ },
31901
32014
  "deviceManager.getRoleDisplayDefaults": {
31902
32015
  capName: "device-manager",
31903
32016
  capScope: "system",
@@ -33668,6 +33781,12 @@ Object.freeze({
33668
33781
  addonId: null,
33669
33782
  access: "view"
33670
33783
  },
33784
+ "pipelineAnalytics.getGroup": {
33785
+ capName: "pipeline-analytics",
33786
+ capScope: "device",
33787
+ addonId: null,
33788
+ access: "view"
33789
+ },
33671
33790
  "pipelineAnalytics.getKeyEvents": {
33672
33791
  capName: "pipeline-analytics",
33673
33792
  capScope: "device",
@@ -33752,6 +33871,12 @@ Object.freeze({
33752
33871
  addonId: null,
33753
33872
  access: "view"
33754
33873
  },
33874
+ "pipelineAnalytics.listGroups": {
33875
+ capName: "pipeline-analytics",
33876
+ capScope: "device",
33877
+ addonId: null,
33878
+ access: "view"
33879
+ },
33755
33880
  "pipelineAnalytics.listOpsLog": {
33756
33881
  capName: "pipeline-analytics",
33757
33882
  capScope: "device",
@@ -36533,6 +36658,11 @@ Object.freeze({
36533
36658
  form: "single",
36534
36659
  optional: false
36535
36660
  }],
36661
+ "deviceManager.getBindingsBatch": [{
36662
+ name: "deviceIds",
36663
+ form: "array",
36664
+ optional: false
36665
+ }],
36536
36666
  "deviceManager.getChildren": [{
36537
36667
  name: "parentDeviceId",
36538
36668
  form: "single",
@@ -36578,6 +36708,11 @@ Object.freeze({
36578
36708
  form: "single",
36579
36709
  optional: false
36580
36710
  }],
36711
+ "deviceManager.getLinkedDevicesBatch": [{
36712
+ name: "deviceIds",
36713
+ form: "array",
36714
+ optional: false
36715
+ }],
36581
36716
  "deviceManager.getSettingsSchema": [{
36582
36717
  name: "deviceId",
36583
36718
  form: "single",
@@ -36598,6 +36733,11 @@ Object.freeze({
36598
36733
  form: "single",
36599
36734
  optional: false
36600
36735
  }],
36736
+ "deviceManager.listAll": [{
36737
+ name: "deviceIds",
36738
+ form: "array",
36739
+ optional: true
36740
+ }],
36601
36741
  "deviceManager.loadConfig": [{
36602
36742
  name: "deviceId",
36603
36743
  form: "single",
@@ -37171,6 +37311,11 @@ Object.freeze({
37171
37311
  form: "single",
37172
37312
  optional: false
37173
37313
  }],
37314
+ "pipelineAnalytics.getGroup": [{
37315
+ name: "deviceId",
37316
+ form: "single",
37317
+ optional: false
37318
+ }],
37174
37319
  "pipelineAnalytics.getKeyEvents": [{
37175
37320
  name: "deviceId",
37176
37321
  form: "single",
@@ -37226,6 +37371,11 @@ Object.freeze({
37226
37371
  form: "array",
37227
37372
  optional: false
37228
37373
  }],
37374
+ "pipelineAnalytics.listGroups": [{
37375
+ name: "deviceIds",
37376
+ form: "array",
37377
+ optional: false
37378
+ }],
37229
37379
  "pipelineAnalytics.listOpsLog": [{
37230
37380
  name: "deviceId",
37231
37381
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5807,6 +5807,13 @@ var BaseAddon = class {
5807
5807
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
5808
5808
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
5809
5809
  _registeredCapNames = [];
5810
+ /**
5811
+ * True only after `readAddonStore` actually answered. Constructor
5812
+ * defaults look like stored config when the store is down — a forked
5813
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
5814
+ * mode, 2026-08-25) is not "the operator chose this".
5815
+ */
5816
+ settingsStoreReady = false;
5810
5817
  /** Default config values. Provided via constructor. */
5811
5818
  defaults;
5812
5819
  constructor(defaults) {
@@ -6207,7 +6214,9 @@ var BaseAddon = class {
6207
6214
  ];
6208
6215
  let lastErr;
6209
6216
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
6210
- return await settings.readAddonStore() ?? {};
6217
+ const stored = await settings.readAddonStore() ?? {};
6218
+ this.settingsStoreReady = true;
6219
+ return stored;
6211
6220
  } catch (err) {
6212
6221
  lastErr = err;
6213
6222
  const msg = err instanceof Error ? err.message : String(err);
@@ -6215,6 +6224,7 @@ var BaseAddon = class {
6215
6224
  if (attempt === delaysMs.length) break;
6216
6225
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
6217
6226
  }
6227
+ this.settingsStoreReady = false;
6218
6228
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
6219
6229
  return {};
6220
6230
  }
@@ -8106,6 +8116,12 @@ var ModelVariantGroupSchema = object({
8106
8116
  */
8107
8117
  resolution: number().int().positive().optional()
8108
8118
  });
8119
+ var ModelProviderIdSchema = _enum([
8120
+ "camstack",
8121
+ "frigate",
8122
+ "scrypted",
8123
+ "custom"
8124
+ ]);
8109
8125
  var ModelCatalogEntrySchema = object({
8110
8126
  id: string(),
8111
8127
  name: string(),
@@ -8203,6 +8219,12 @@ var ModelCatalogEntrySchema = object({
8203
8219
  */
8204
8220
  group: ModelVariantGroupSchema.optional(),
8205
8221
  /**
8222
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
8223
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
8224
+ * persisted before this field existed (`inferModelProvider` fills those).
8225
+ */
8226
+ provider: ModelProviderIdSchema.optional(),
8227
+ /**
8206
8228
  * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
8207
8229
  * applies (Frigate / COCO public catalog). Set on a custom model whose raw
8208
8230
  * labels already ARE the CamStack macros (Scrypted identity map).
@@ -11994,6 +12016,27 @@ var LinkedDeviceSchema = object({
11994
12016
  features: array(string()),
11995
12017
  producesTrackedEvents: boolean().optional()
11996
12018
  });
12019
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
12020
+ * The batch answer needs the tag; the single-device answer already has it
12021
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
12022
+ var LinkedDevicesForDeviceSchema = object({
12023
+ deviceId: number(),
12024
+ mode: LinkedDevicesModeSchema,
12025
+ devices: array(LinkedDeviceSchema)
12026
+ });
12027
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
12028
+ * `getAllBindings` all answer in. Declared once: three copies of the same
12029
+ * object literal is exactly how the three drift apart. */
12030
+ var DeviceBindingsForDeviceSchema = object({
12031
+ deviceId: number(),
12032
+ entries: array(object({
12033
+ capName: string(),
12034
+ kind: _enum(["native", "wrapped"]),
12035
+ providerAddonId: string(),
12036
+ providerNodeId: string(),
12037
+ nativeAddonId: string()
12038
+ }))
12039
+ });
11997
12040
  var SavedDeviceRowSchema = object({
11998
12041
  /** Numeric id reserved at allocateDeviceId time. */
11999
12042
  id: number(),
@@ -12219,11 +12262,25 @@ method(object({
12219
12262
  projection: _enum(["full", "slim"]).optional(),
12220
12263
  /** Return only camera devices. Filtering server-side instead of
12221
12264
  * shipping 293 rows to find 12. */
12222
- isCamera: boolean().optional()
12265
+ isCamera: boolean().optional(),
12266
+ /**
12267
+ * Return only these device ids. For the caller that already KNOWS the
12268
+ * handful it wants and needs a field the id-bearing answer does not
12269
+ * carry — the viewer's linked-devices panel joins `type` and `online`
12270
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
12271
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
12272
+ * refetches on the reconcile interval, on a phone.
12273
+ *
12274
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12275
+ * keys rather than rejecting them (verified against the live hub
12276
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12277
+ * it answers today and the caller filters as it already does.
12278
+ */
12279
+ deviceIds: array(number()).optional()
12223
12280
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12224
12281
  mode: LinkedDevicesModeSchema,
12225
12282
  devices: array(LinkedDeviceSchema)
12226
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12283
+ })), 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({
12227
12284
  deviceId: number(),
12228
12285
  values: record(string(), unknown())
12229
12286
  }), object({ success: literal(true) }), {
@@ -12250,25 +12307,7 @@ method(object({
12250
12307
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
12251
12308
  kind: "mutation",
12252
12309
  auth: "admin"
12253
- }), method(object({ deviceId: number() }), object({
12254
- deviceId: number(),
12255
- entries: array(object({
12256
- capName: string(),
12257
- kind: _enum(["native", "wrapped"]),
12258
- providerAddonId: string(),
12259
- providerNodeId: string(),
12260
- nativeAddonId: string()
12261
- }))
12262
- })), method(object({}), array(object({
12263
- deviceId: number(),
12264
- entries: array(object({
12265
- capName: string(),
12266
- kind: _enum(["native", "wrapped"]),
12267
- providerAddonId: string(),
12268
- providerNodeId: string(),
12269
- nativeAddonId: string()
12270
- }))
12271
- }))), method(object({
12310
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
12272
12311
  deviceId: number(),
12273
12312
  capName: string(),
12274
12313
  wrapperAddonId: string(),
@@ -14678,12 +14717,15 @@ var NcOccupancyConditionSchema = object({
14678
14717
  * there is no second switch that can disagree with the first and every rule
14679
14718
  * authored before the decision migrates for free (`audioModeOf`):
14680
14719
  *
14681
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14682
- * classifier labels with one of them. No window, no percentage:
14683
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14684
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14685
- * the analyzer's (`classificationMinScore`, per device) a label only
14686
- * reaches this condition if the classifier was already confident enough.
14720
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
14721
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
14722
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
14723
+ * frames is the wrong question for a classifier that labels 1–3 frames
14724
+ * per episode. The count window is the brake that drops a single-frame
14725
+ * false positive; the rule's own `throttle` cooldown is the other. The
14726
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
14727
+ * per device) — a label only reaches this condition if the classifier was
14728
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14687
14729
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14688
14730
  * the condition: at least `hitPercent`% of the samples over
14689
14731
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14710,14 +14752,22 @@ var NcOccupancyConditionSchema = object({
14710
14752
  * an operator who typed `dog` mean the same thing.
14711
14753
  */
14712
14754
  var NcAudioConditionSchema = object({
14713
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14755
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14714
14756
  labels: array(string().min(1)).min(1).optional(),
14715
14757
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14716
14758
  dbThreshold: number().min(-96).max(0).optional(),
14717
14759
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14718
14760
  hitPercent: number().int().min(1).max(100).default(60),
14719
14761
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14720
- samplingSeconds: number().int().min(1).max(300).default(10)
14762
+ samplingSeconds: number().int().min(1).max(300).default(10),
14763
+ /**
14764
+ * LABEL MODE: how many labelled frames must land inside
14765
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
14766
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
14767
+ */
14768
+ confirmHits: number().int().min(1).max(20).optional(),
14769
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
14770
+ confirmWindowSec: number().int().min(1).max(60).optional()
14721
14771
  });
14722
14772
  /**
14723
14773
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -17091,6 +17141,46 @@ var RecentTracksPageSchema = object({
17091
17141
  /** Cursor for the next page, or null when this page is the last. */
17092
17142
  nextCursor: string().nullable()
17093
17143
  });
17144
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
17145
+ var LIST_GROUPS_MAX_LIMIT = 100;
17146
+ var AnalyticsGroupRecordSchema = object({
17147
+ id: string(),
17148
+ deviceId: number().int(),
17149
+ openedAt: number().int(),
17150
+ closedAt: number().int(),
17151
+ timestamp: number().int(),
17152
+ memberCount: number().int(),
17153
+ memberTrackIds: array(string()).readonly(),
17154
+ className: string(),
17155
+ classes: array(string()).readonly(),
17156
+ /** Relative event-media path, or null when the group has no picture yet. */
17157
+ mediaUrl: string().nullable(),
17158
+ singleton: boolean()
17159
+ });
17160
+ var AnalyticsGroupMemberSchema = object({
17161
+ trackId: string(),
17162
+ deviceId: number().int(),
17163
+ className: string(),
17164
+ firstSeen: number().int(),
17165
+ lastSeen: number().int(),
17166
+ mediaUrl: string().nullable()
17167
+ });
17168
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
17169
+ var ListGroupsQueryInput = object({
17170
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
17171
+ deviceIds: array(number()),
17172
+ /** Window lower bound on `closedAt` (inclusive). */
17173
+ since: number().optional(),
17174
+ /** Window upper bound on `openedAt` (inclusive). */
17175
+ until: number().optional(),
17176
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
17177
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
17178
+ cursor: string().optional()
17179
+ });
17180
+ var ListGroupsPageSchema = object({
17181
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
17182
+ nextCursor: string().nullable()
17183
+ });
17094
17184
  var KeyEventQueryInput = object({
17095
17185
  deviceId: number(),
17096
17186
  /** Window lower bound (track firstSeen ≥ since). */
@@ -17166,7 +17256,9 @@ var TrackCascadeCountsSchema = object({
17166
17256
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
17167
17257
  plates: number().int(),
17168
17258
  /** Per-track CLIP search vectors removed (best-effort). */
17169
- embeddings: number().int()
17259
+ embeddings: number().int(),
17260
+ /** Group membership + group rows removed with their last member (best-effort). */
17261
+ groups: number().int()
17170
17262
  });
17171
17263
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
17172
17264
  var DiskReconcileCountsSchema = object({
@@ -17312,7 +17404,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17312
17404
  * stationary registry). Default false: the timeline lists passages,
17313
17405
  * not parking records (operator decision, 2026-08-15). */
17314
17406
  includeStationary: boolean().optional()
17315
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17407
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17408
+ deviceId: number(),
17409
+ groupId: string().min(1)
17410
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
17316
17411
  kind: "mutation",
17317
17412
  auth: "admin"
17318
17413
  }), 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({
@@ -17622,7 +17717,8 @@ var PipelineModelOptionSchema = object({
17622
17717
  sizeMB: number()
17623
17718
  })),
17624
17719
  group: ModelVariantGroupSchema.optional(),
17625
- legacy: boolean().optional()
17720
+ legacy: boolean().optional(),
17721
+ provider: ModelProviderIdSchema.optional()
17626
17722
  });
17627
17723
  var ConfigFieldBridge = custom();
17628
17724
  var PipelineAddonSchemaSchema = object({
@@ -25869,7 +25965,12 @@ var PlateInfoSchema = object({
25869
25965
  plateBbox: BoundingBoxSchema.optional(),
25870
25966
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
25871
25967
  keyFrameMediaKey: string().optional(),
25872
- base64: string().optional()
25968
+ base64: string().optional(),
25969
+ /**
25970
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
25971
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
25972
+ */
25973
+ cropUrl: string().optional()
25873
25974
  });
25874
25975
  var MediaFileLiteSchema = object({
25875
25976
  key: string(),
@@ -31839,6 +31940,12 @@ Object.freeze({
31839
31940
  addonId: null,
31840
31941
  access: "view"
31841
31942
  },
31943
+ "deviceManager.getBindingsBatch": {
31944
+ capName: "device-manager",
31945
+ capScope: "system",
31946
+ addonId: null,
31947
+ access: "view"
31948
+ },
31842
31949
  "deviceManager.getChildren": {
31843
31950
  capName: "device-manager",
31844
31951
  capScope: "system",
@@ -31899,6 +32006,12 @@ Object.freeze({
31899
32006
  addonId: null,
31900
32007
  access: "view"
31901
32008
  },
32009
+ "deviceManager.getLinkedDevicesBatch": {
32010
+ capName: "device-manager",
32011
+ capScope: "system",
32012
+ addonId: null,
32013
+ access: "view"
32014
+ },
31902
32015
  "deviceManager.getRoleDisplayDefaults": {
31903
32016
  capName: "device-manager",
31904
32017
  capScope: "system",
@@ -33669,6 +33782,12 @@ Object.freeze({
33669
33782
  addonId: null,
33670
33783
  access: "view"
33671
33784
  },
33785
+ "pipelineAnalytics.getGroup": {
33786
+ capName: "pipeline-analytics",
33787
+ capScope: "device",
33788
+ addonId: null,
33789
+ access: "view"
33790
+ },
33672
33791
  "pipelineAnalytics.getKeyEvents": {
33673
33792
  capName: "pipeline-analytics",
33674
33793
  capScope: "device",
@@ -33753,6 +33872,12 @@ Object.freeze({
33753
33872
  addonId: null,
33754
33873
  access: "view"
33755
33874
  },
33875
+ "pipelineAnalytics.listGroups": {
33876
+ capName: "pipeline-analytics",
33877
+ capScope: "device",
33878
+ addonId: null,
33879
+ access: "view"
33880
+ },
33756
33881
  "pipelineAnalytics.listOpsLog": {
33757
33882
  capName: "pipeline-analytics",
33758
33883
  capScope: "device",
@@ -36534,6 +36659,11 @@ Object.freeze({
36534
36659
  form: "single",
36535
36660
  optional: false
36536
36661
  }],
36662
+ "deviceManager.getBindingsBatch": [{
36663
+ name: "deviceIds",
36664
+ form: "array",
36665
+ optional: false
36666
+ }],
36537
36667
  "deviceManager.getChildren": [{
36538
36668
  name: "parentDeviceId",
36539
36669
  form: "single",
@@ -36579,6 +36709,11 @@ Object.freeze({
36579
36709
  form: "single",
36580
36710
  optional: false
36581
36711
  }],
36712
+ "deviceManager.getLinkedDevicesBatch": [{
36713
+ name: "deviceIds",
36714
+ form: "array",
36715
+ optional: false
36716
+ }],
36582
36717
  "deviceManager.getSettingsSchema": [{
36583
36718
  name: "deviceId",
36584
36719
  form: "single",
@@ -36599,6 +36734,11 @@ Object.freeze({
36599
36734
  form: "single",
36600
36735
  optional: false
36601
36736
  }],
36737
+ "deviceManager.listAll": [{
36738
+ name: "deviceIds",
36739
+ form: "array",
36740
+ optional: true
36741
+ }],
36602
36742
  "deviceManager.loadConfig": [{
36603
36743
  name: "deviceId",
36604
36744
  form: "single",
@@ -37172,6 +37312,11 @@ Object.freeze({
37172
37312
  form: "single",
37173
37313
  optional: false
37174
37314
  }],
37315
+ "pipelineAnalytics.getGroup": [{
37316
+ name: "deviceId",
37317
+ form: "single",
37318
+ optional: false
37319
+ }],
37175
37320
  "pipelineAnalytics.getKeyEvents": [{
37176
37321
  name: "deviceId",
37177
37322
  form: "single",
@@ -37227,6 +37372,11 @@ Object.freeze({
37227
37372
  form: "array",
37228
37373
  optional: false
37229
37374
  }],
37375
+ "pipelineAnalytics.listGroups": [{
37376
+ name: "deviceIds",
37377
+ form: "array",
37378
+ optional: false
37379
+ }],
37230
37380
  "pipelineAnalytics.listOpsLog": [{
37231
37381
  name: "deviceId",
37232
37382
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-amcrest",
3
- "version": "0.2.28",
3
+ "version": "0.2.29",
4
4
  "description": "Amcrest/Dahua camera device provider addon for CamStack — Dahua CGI over HTTP(S) with digest auth (snapshot, RTSP catalog, PTZ, image/day-night config)",
5
5
  "keywords": [
6
6
  "camstack",