@camstack/addon-agent-ui 1.2.28 → 1.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 (2) hide show
  1. package/dist/addon.js +185 -35
  2. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -5802,6 +5802,13 @@ var BaseAddon = class {
5802
5802
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
5803
5803
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
5804
5804
  _registeredCapNames = [];
5805
+ /**
5806
+ * True only after `readAddonStore` actually answered. Constructor
5807
+ * defaults look like stored config when the store is down — a forked
5808
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
5809
+ * mode, 2026-08-25) is not "the operator chose this".
5810
+ */
5811
+ settingsStoreReady = false;
5805
5812
  /** Default config values. Provided via constructor. */
5806
5813
  defaults;
5807
5814
  constructor(defaults) {
@@ -6202,7 +6209,9 @@ var BaseAddon = class {
6202
6209
  ];
6203
6210
  let lastErr;
6204
6211
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
6205
- return await settings.readAddonStore() ?? {};
6212
+ const stored = await settings.readAddonStore() ?? {};
6213
+ this.settingsStoreReady = true;
6214
+ return stored;
6206
6215
  } catch (err) {
6207
6216
  lastErr = err;
6208
6217
  const msg = err instanceof Error ? err.message : String(err);
@@ -6210,6 +6219,7 @@ var BaseAddon = class {
6210
6219
  if (attempt === delaysMs.length) break;
6211
6220
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
6212
6221
  }
6222
+ this.settingsStoreReady = false;
6213
6223
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
6214
6224
  return {};
6215
6225
  }
@@ -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).
@@ -11730,6 +11752,27 @@ var LinkedDeviceSchema = object({
11730
11752
  features: array(string()),
11731
11753
  producesTrackedEvents: boolean().optional()
11732
11754
  });
11755
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
11756
+ * The batch answer needs the tag; the single-device answer already has it
11757
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
11758
+ var LinkedDevicesForDeviceSchema = object({
11759
+ deviceId: number(),
11760
+ mode: LinkedDevicesModeSchema,
11761
+ devices: array(LinkedDeviceSchema)
11762
+ });
11763
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
11764
+ * `getAllBindings` all answer in. Declared once: three copies of the same
11765
+ * object literal is exactly how the three drift apart. */
11766
+ var DeviceBindingsForDeviceSchema = object({
11767
+ deviceId: number(),
11768
+ entries: array(object({
11769
+ capName: string(),
11770
+ kind: _enum(["native", "wrapped"]),
11771
+ providerAddonId: string(),
11772
+ providerNodeId: string(),
11773
+ nativeAddonId: string()
11774
+ }))
11775
+ });
11733
11776
  var SavedDeviceRowSchema = object({
11734
11777
  /** Numeric id reserved at allocateDeviceId time. */
11735
11778
  id: number(),
@@ -11955,11 +11998,25 @@ method(object({
11955
11998
  projection: _enum(["full", "slim"]).optional(),
11956
11999
  /** Return only camera devices. Filtering server-side instead of
11957
12000
  * shipping 293 rows to find 12. */
11958
- isCamera: boolean().optional()
12001
+ isCamera: boolean().optional(),
12002
+ /**
12003
+ * Return only these device ids. For the caller that already KNOWS the
12004
+ * handful it wants and needs a field the id-bearing answer does not
12005
+ * carry — the viewer's linked-devices panel joins `type` and `online`
12006
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
12007
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
12008
+ * refetches on the reconcile interval, on a phone.
12009
+ *
12010
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12011
+ * keys rather than rejecting them (verified against the live hub
12012
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12013
+ * it answers today and the caller filters as it already does.
12014
+ */
12015
+ deviceIds: array(number()).optional()
11959
12016
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
11960
12017
  mode: LinkedDevicesModeSchema,
11961
12018
  devices: array(LinkedDeviceSchema)
11962
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12019
+ })), 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({
11963
12020
  deviceId: number(),
11964
12021
  values: record(string(), unknown())
11965
12022
  }), object({ success: literal(true) }), {
@@ -11986,25 +12043,7 @@ method(object({
11986
12043
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
11987
12044
  kind: "mutation",
11988
12045
  auth: "admin"
11989
- }), method(object({ deviceId: number() }), object({
11990
- deviceId: number(),
11991
- entries: array(object({
11992
- capName: string(),
11993
- kind: _enum(["native", "wrapped"]),
11994
- providerAddonId: string(),
11995
- providerNodeId: string(),
11996
- nativeAddonId: string()
11997
- }))
11998
- })), method(object({}), array(object({
11999
- deviceId: number(),
12000
- entries: array(object({
12001
- capName: string(),
12002
- kind: _enum(["native", "wrapped"]),
12003
- providerAddonId: string(),
12004
- providerNodeId: string(),
12005
- nativeAddonId: string()
12006
- }))
12007
- }))), method(object({
12046
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
12008
12047
  deviceId: number(),
12009
12048
  capName: string(),
12010
12049
  wrapperAddonId: string(),
@@ -14376,12 +14415,15 @@ var NcOccupancyConditionSchema = object({
14376
14415
  * there is no second switch that can disagree with the first and every rule
14377
14416
  * authored before the decision migrates for free (`audioModeOf`):
14378
14417
  *
14379
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14380
- * classifier labels with one of them. No window, no percentage:
14381
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14382
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14383
- * the analyzer's (`classificationMinScore`, per device) a label only
14384
- * reaches this condition if the classifier was already confident enough.
14418
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
14419
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
14420
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
14421
+ * frames is the wrong question for a classifier that labels 1–3 frames
14422
+ * per episode. The count window is the brake that drops a single-frame
14423
+ * false positive; the rule's own `throttle` cooldown is the other. The
14424
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
14425
+ * per device) — a label only reaches this condition if the classifier was
14426
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14385
14427
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14386
14428
  * the condition: at least `hitPercent`% of the samples over
14387
14429
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14408,14 +14450,22 @@ var NcOccupancyConditionSchema = object({
14408
14450
  * an operator who typed `dog` mean the same thing.
14409
14451
  */
14410
14452
  var NcAudioConditionSchema = object({
14411
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14453
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14412
14454
  labels: array(string().min(1)).min(1).optional(),
14413
14455
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14414
14456
  dbThreshold: number().min(-96).max(0).optional(),
14415
14457
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14416
14458
  hitPercent: number().int().min(1).max(100).default(60),
14417
14459
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14418
- samplingSeconds: number().int().min(1).max(300).default(10)
14460
+ samplingSeconds: number().int().min(1).max(300).default(10),
14461
+ /**
14462
+ * LABEL MODE: how many labelled frames must land inside
14463
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
14464
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
14465
+ */
14466
+ confirmHits: number().int().min(1).max(20).optional(),
14467
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
14468
+ confirmWindowSec: number().int().min(1).max(60).optional()
14419
14469
  });
14420
14470
  /**
14421
14471
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -16789,6 +16839,46 @@ var RecentTracksPageSchema = object({
16789
16839
  /** Cursor for the next page, or null when this page is the last. */
16790
16840
  nextCursor: string().nullable()
16791
16841
  });
16842
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
16843
+ var LIST_GROUPS_MAX_LIMIT = 100;
16844
+ var AnalyticsGroupRecordSchema = object({
16845
+ id: string(),
16846
+ deviceId: number().int(),
16847
+ openedAt: number().int(),
16848
+ closedAt: number().int(),
16849
+ timestamp: number().int(),
16850
+ memberCount: number().int(),
16851
+ memberTrackIds: array(string()).readonly(),
16852
+ className: string(),
16853
+ classes: array(string()).readonly(),
16854
+ /** Relative event-media path, or null when the group has no picture yet. */
16855
+ mediaUrl: string().nullable(),
16856
+ singleton: boolean()
16857
+ });
16858
+ var AnalyticsGroupMemberSchema = object({
16859
+ trackId: string(),
16860
+ deviceId: number().int(),
16861
+ className: string(),
16862
+ firstSeen: number().int(),
16863
+ lastSeen: number().int(),
16864
+ mediaUrl: string().nullable()
16865
+ });
16866
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
16867
+ var ListGroupsQueryInput = object({
16868
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
16869
+ deviceIds: array(number()),
16870
+ /** Window lower bound on `closedAt` (inclusive). */
16871
+ since: number().optional(),
16872
+ /** Window upper bound on `openedAt` (inclusive). */
16873
+ until: number().optional(),
16874
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
16875
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
16876
+ cursor: string().optional()
16877
+ });
16878
+ var ListGroupsPageSchema = object({
16879
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
16880
+ nextCursor: string().nullable()
16881
+ });
16792
16882
  var KeyEventQueryInput = object({
16793
16883
  deviceId: number(),
16794
16884
  /** Window lower bound (track firstSeen ≥ since). */
@@ -16864,7 +16954,9 @@ var TrackCascadeCountsSchema = object({
16864
16954
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
16865
16955
  plates: number().int(),
16866
16956
  /** Per-track CLIP search vectors removed (best-effort). */
16867
- embeddings: number().int()
16957
+ embeddings: number().int(),
16958
+ /** Group membership + group rows removed with their last member (best-effort). */
16959
+ groups: number().int()
16868
16960
  });
16869
16961
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
16870
16962
  var DiskReconcileCountsSchema = object({
@@ -17010,7 +17102,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17010
17102
  * stationary registry). Default false: the timeline lists passages,
17011
17103
  * not parking records (operator decision, 2026-08-15). */
17012
17104
  includeStationary: boolean().optional()
17013
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17105
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17106
+ deviceId: number(),
17107
+ groupId: string().min(1)
17108
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
17014
17109
  kind: "mutation",
17015
17110
  auth: "admin"
17016
17111
  }), 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({
@@ -17320,7 +17415,8 @@ var PipelineModelOptionSchema = object({
17320
17415
  sizeMB: number()
17321
17416
  })),
17322
17417
  group: ModelVariantGroupSchema.optional(),
17323
- legacy: boolean().optional()
17418
+ legacy: boolean().optional(),
17419
+ provider: ModelProviderIdSchema.optional()
17324
17420
  });
17325
17421
  var ConfigFieldBridge = custom();
17326
17422
  var PipelineAddonSchemaSchema = object({
@@ -23904,7 +24000,12 @@ var PlateInfoSchema = object({
23904
24000
  plateBbox: BoundingBoxSchema.optional(),
23905
24001
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
23906
24002
  keyFrameMediaKey: string().optional(),
23907
- base64: string().optional()
24003
+ base64: string().optional(),
24004
+ /**
24005
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
24006
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
24007
+ */
24008
+ cropUrl: string().optional()
23908
24009
  });
23909
24010
  var MediaFileLiteSchema = object({
23910
24011
  key: string(),
@@ -27544,6 +27645,12 @@ Object.freeze({
27544
27645
  addonId: null,
27545
27646
  access: "view"
27546
27647
  },
27648
+ "deviceManager.getBindingsBatch": {
27649
+ capName: "device-manager",
27650
+ capScope: "system",
27651
+ addonId: null,
27652
+ access: "view"
27653
+ },
27547
27654
  "deviceManager.getChildren": {
27548
27655
  capName: "device-manager",
27549
27656
  capScope: "system",
@@ -27604,6 +27711,12 @@ Object.freeze({
27604
27711
  addonId: null,
27605
27712
  access: "view"
27606
27713
  },
27714
+ "deviceManager.getLinkedDevicesBatch": {
27715
+ capName: "device-manager",
27716
+ capScope: "system",
27717
+ addonId: null,
27718
+ access: "view"
27719
+ },
27607
27720
  "deviceManager.getRoleDisplayDefaults": {
27608
27721
  capName: "device-manager",
27609
27722
  capScope: "system",
@@ -29374,6 +29487,12 @@ Object.freeze({
29374
29487
  addonId: null,
29375
29488
  access: "view"
29376
29489
  },
29490
+ "pipelineAnalytics.getGroup": {
29491
+ capName: "pipeline-analytics",
29492
+ capScope: "device",
29493
+ addonId: null,
29494
+ access: "view"
29495
+ },
29377
29496
  "pipelineAnalytics.getKeyEvents": {
29378
29497
  capName: "pipeline-analytics",
29379
29498
  capScope: "device",
@@ -29458,6 +29577,12 @@ Object.freeze({
29458
29577
  addonId: null,
29459
29578
  access: "view"
29460
29579
  },
29580
+ "pipelineAnalytics.listGroups": {
29581
+ capName: "pipeline-analytics",
29582
+ capScope: "device",
29583
+ addonId: null,
29584
+ access: "view"
29585
+ },
29461
29586
  "pipelineAnalytics.listOpsLog": {
29462
29587
  capName: "pipeline-analytics",
29463
29588
  capScope: "device",
@@ -32239,6 +32364,11 @@ Object.freeze({
32239
32364
  form: "single",
32240
32365
  optional: false
32241
32366
  }],
32367
+ "deviceManager.getBindingsBatch": [{
32368
+ name: "deviceIds",
32369
+ form: "array",
32370
+ optional: false
32371
+ }],
32242
32372
  "deviceManager.getChildren": [{
32243
32373
  name: "parentDeviceId",
32244
32374
  form: "single",
@@ -32284,6 +32414,11 @@ Object.freeze({
32284
32414
  form: "single",
32285
32415
  optional: false
32286
32416
  }],
32417
+ "deviceManager.getLinkedDevicesBatch": [{
32418
+ name: "deviceIds",
32419
+ form: "array",
32420
+ optional: false
32421
+ }],
32287
32422
  "deviceManager.getSettingsSchema": [{
32288
32423
  name: "deviceId",
32289
32424
  form: "single",
@@ -32304,6 +32439,11 @@ Object.freeze({
32304
32439
  form: "single",
32305
32440
  optional: false
32306
32441
  }],
32442
+ "deviceManager.listAll": [{
32443
+ name: "deviceIds",
32444
+ form: "array",
32445
+ optional: true
32446
+ }],
32307
32447
  "deviceManager.loadConfig": [{
32308
32448
  name: "deviceId",
32309
32449
  form: "single",
@@ -32877,6 +33017,11 @@ Object.freeze({
32877
33017
  form: "single",
32878
33018
  optional: false
32879
33019
  }],
33020
+ "pipelineAnalytics.getGroup": [{
33021
+ name: "deviceId",
33022
+ form: "single",
33023
+ optional: false
33024
+ }],
32880
33025
  "pipelineAnalytics.getKeyEvents": [{
32881
33026
  name: "deviceId",
32882
33027
  form: "single",
@@ -32932,6 +33077,11 @@ Object.freeze({
32932
33077
  form: "array",
32933
33078
  optional: false
32934
33079
  }],
33080
+ "pipelineAnalytics.listGroups": [{
33081
+ name: "deviceIds",
33082
+ form: "array",
33083
+ optional: false
33084
+ }],
32935
33085
  "pipelineAnalytics.listOpsLog": [{
32936
33086
  name: "deviceId",
32937
33087
  form: "single",
@@ -34148,7 +34298,7 @@ var AgentUIAddon = class extends BaseAddon {
34148
34298
  capability: adminUiCapability,
34149
34299
  provider: {
34150
34300
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
34151
- getVersion: async () => ({ version: "1.2.28" })
34301
+ getVersion: async () => ({ version: "1.2.29" })
34152
34302
  }
34153
34303
  }];
34154
34304
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-agent-ui",
3
- "version": "1.2.28",
3
+ "version": "1.2.29",
4
4
  "description": "Agent UI — lightweight status dashboard served by every agent node",
5
5
  "keywords": [
6
6
  "camstack",