@camstack/addon-matter-broker 0.1.23 → 0.1.24

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.
package/dist/addon.js CHANGED
@@ -7372,6 +7372,62 @@ var RecordingConfigSchema = object({
7372
7372
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7373
7373
  });
7374
7374
  /**
7375
+ * Ops-log — the durable, append-only operations audit shared by the
7376
+ * recordings and events management surfaces.
7377
+ *
7378
+ * ONE row shape is reused for both domains so a single "Activity" view can
7379
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7380
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7381
+ * management operation, WHY it ran (reason), and its measurable effect
7382
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7383
+ * never fail the operation it records.
7384
+ */
7385
+ /** Which management domain the operation belongs to. */
7386
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7387
+ /** The kind of management operation performed. */
7388
+ var OpsLogOpSchema = _enum([
7389
+ "prune",
7390
+ "manual-delete",
7391
+ "rescan",
7392
+ "retention-run"
7393
+ ]);
7394
+ /** Why the operation ran. */
7395
+ var OpsLogReasonSchema = _enum([
7396
+ "retention",
7397
+ "quota",
7398
+ "manual",
7399
+ "operator"
7400
+ ]);
7401
+ /** One audit row, shared verbatim by both domains. */
7402
+ var OpsLogEntrySchema = object({
7403
+ /** Unique row id. */
7404
+ id: string$2(),
7405
+ /** Epoch ms the operation completed. */
7406
+ at: number(),
7407
+ domain: OpsLogDomainSchema,
7408
+ op: OpsLogOpSchema,
7409
+ reason: OpsLogReasonSchema,
7410
+ /** The camera the op targeted; null for a cluster/global op. */
7411
+ deviceId: number().nullable(),
7412
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7413
+ nodeId: string$2(),
7414
+ /** Buckets / rows deleted (op-specific unit). */
7415
+ itemsAffected: number(),
7416
+ /** Bytes reclaimed by the op (0 when not measurable). */
7417
+ bytesReclaimed: number(),
7418
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7419
+ detail: string$2().nullable(),
7420
+ /** Who/what triggered the op. */
7421
+ actor: string$2()
7422
+ });
7423
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7424
+ var OpsLogQueryInputSchema = object({
7425
+ /** Restrict to a single camera; omit for every row. */
7426
+ deviceId: number().optional(),
7427
+ /** Max rows returned, newest-first. */
7428
+ limit: number().int().min(1).max(1e3).optional()
7429
+ });
7430
+ /**
7375
7431
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7376
7432
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7377
7433
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -14835,9 +14891,10 @@ var DEVICE_LOCAL_STATE_CAPS = {
14835
14891
  * `package` backs the package-drop detector — a package zone is a
14836
14892
  * `ZoneRule` on the `'package'` stage referencing drawn polygons
14837
14893
  * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
14838
- * The orchestrator provider that writes this stage lands in a later
14839
- * slice; until then the mirror carries only `{motion, detection}` and
14840
- * consumers read `package` as absent (treat as `[]`).
14894
+ * The orchestrator provider writes this stage as a first-class slice
14895
+ * (Phase 4): every mutation mirrors the full `{motion, detection,
14896
+ * package}` shape, so consumers read the current package rules directly
14897
+ * off `device.state.zoneRules.value.package`.
14841
14898
  */
14842
14899
  runtimeState: object({
14843
14900
  motion: array(ZoneRuleSchema).readonly(),
@@ -19220,6 +19277,26 @@ var TrackCascadeCountsSchema = object({
19220
19277
  /** Per-track CLIP search vectors removed (best-effort). */
19221
19278
  embeddings: number().int()
19222
19279
  });
19280
+ /** Event-store footprint for one camera. */
19281
+ var EventStoreDeviceFootprintSchema = object({
19282
+ deviceId: number(),
19283
+ /** Persisted event rows (motion + object + audio) for the camera. */
19284
+ rows: number().int(),
19285
+ /** Event-owned media bytes on disk for the camera. */
19286
+ bytes: number().int()
19287
+ });
19288
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
19289
+ var EventStoreFootprintSchema = object({
19290
+ totalRows: number().int(),
19291
+ totalBytes: number().int(),
19292
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
19293
+ });
19294
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
19295
+ var EventPruneCountsSchema = object({
19296
+ motion: number().int(),
19297
+ object: number().int(),
19298
+ audio: number().int()
19299
+ });
19223
19300
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
19224
19301
  deviceId: number(),
19225
19302
  trackId: string$2()
@@ -19283,6 +19360,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19283
19360
  }), {
19284
19361
  kind: "mutation",
19285
19362
  auth: "admin"
19363
+ }), method(object({}), EventStoreFootprintSchema, {
19364
+ kind: "query",
19365
+ auth: "admin"
19366
+ }), method(object({
19367
+ olderThanMs: number(),
19368
+ reason: OpsLogReasonSchema.optional()
19369
+ }), EventPruneCountsSchema, {
19370
+ kind: "mutation",
19371
+ auth: "admin"
19372
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
19373
+ kind: "mutation",
19374
+ auth: "admin"
19375
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19376
+ kind: "query",
19377
+ auth: "admin"
19286
19378
  }), method(object({
19287
19379
  eventId: string$2(),
19288
19380
  kind: MediaFileKindEnum.optional()
@@ -22533,13 +22625,29 @@ method(object({
22533
22625
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
22534
22626
  kind: "mutation",
22535
22627
  auth: "admin"
22536
- }), method(object({ deviceId: number() }), object({
22628
+ }), method(object({
22629
+ deviceId: number(),
22630
+ reason: OpsLogReasonSchema.optional()
22631
+ }), object({
22537
22632
  floorMs: number().nullable(),
22538
22633
  deletedBuckets: number().int(),
22539
22634
  reclaimedBytes: number().int()
22540
22635
  }), {
22541
22636
  kind: "mutation",
22542
22637
  auth: "admin"
22638
+ }), method(object({
22639
+ deviceId: number(),
22640
+ fromMs: number().optional(),
22641
+ toMs: number().optional()
22642
+ }), object({
22643
+ deletedBuckets: number().int(),
22644
+ reclaimedBytes: number().int()
22645
+ }), {
22646
+ kind: "mutation",
22647
+ auth: "admin"
22648
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
22649
+ kind: "query",
22650
+ auth: "admin"
22543
22651
  });
22544
22652
  /**
22545
22653
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25661,6 +25769,12 @@ Object.freeze({
25661
25769
  addonId: null,
25662
25770
  access: "delete"
25663
25771
  },
25772
+ "pipelineAnalytics.deleteDeviceEvents": {
25773
+ capName: "pipeline-analytics",
25774
+ capScope: "device",
25775
+ addonId: null,
25776
+ access: "delete"
25777
+ },
25664
25778
  "pipelineAnalytics.deleteTracks": {
25665
25779
  capName: "pipeline-analytics",
25666
25780
  capScope: "device",
@@ -25691,6 +25805,12 @@ Object.freeze({
25691
25805
  addonId: null,
25692
25806
  access: "view"
25693
25807
  },
25808
+ "pipelineAnalytics.getEventStoreFootprint": {
25809
+ capName: "pipeline-analytics",
25810
+ capScope: "device",
25811
+ addonId: null,
25812
+ access: "view"
25813
+ },
25694
25814
  "pipelineAnalytics.getKeyEvents": {
25695
25815
  capName: "pipeline-analytics",
25696
25816
  capScope: "device",
@@ -25733,6 +25853,12 @@ Object.freeze({
25733
25853
  addonId: null,
25734
25854
  access: "view"
25735
25855
  },
25856
+ "pipelineAnalytics.listOpsLog": {
25857
+ capName: "pipeline-analytics",
25858
+ capScope: "device",
25859
+ addonId: null,
25860
+ access: "view"
25861
+ },
25736
25862
  "pipelineAnalytics.listRecentTracks": {
25737
25863
  capName: "pipeline-analytics",
25738
25864
  capScope: "device",
@@ -25745,6 +25871,12 @@ Object.freeze({
25745
25871
  addonId: null,
25746
25872
  access: "view"
25747
25873
  },
25874
+ "pipelineAnalytics.pruneEvents": {
25875
+ capName: "pipeline-analytics",
25876
+ capScope: "device",
25877
+ addonId: null,
25878
+ access: "create"
25879
+ },
25748
25880
  "pipelineAnalytics.pruneEventsBefore": {
25749
25881
  capName: "pipeline-analytics",
25750
25882
  capScope: "device",
@@ -26507,6 +26639,12 @@ Object.freeze({
26507
26639
  addonId: null,
26508
26640
  access: "create"
26509
26641
  },
26642
+ "recording.deleteFootprint": {
26643
+ capName: "recording",
26644
+ capScope: "system",
26645
+ addonId: null,
26646
+ access: "delete"
26647
+ },
26510
26648
  "recording.getAvailability": {
26511
26649
  capName: "recording",
26512
26650
  capScope: "system",
@@ -26537,6 +26675,12 @@ Object.freeze({
26537
26675
  addonId: null,
26538
26676
  access: "view"
26539
26677
  },
26678
+ "recording.listOpsLog": {
26679
+ capName: "recording",
26680
+ capScope: "system",
26681
+ addonId: null,
26682
+ access: "view"
26683
+ },
26540
26684
  "recording.locateSegment": {
26541
26685
  capName: "recording",
26542
26686
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -7370,6 +7370,62 @@ var RecordingConfigSchema = object({
7370
7370
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7371
7371
  });
7372
7372
  /**
7373
+ * Ops-log — the durable, append-only operations audit shared by the
7374
+ * recordings and events management surfaces.
7375
+ *
7376
+ * ONE row shape is reused for both domains so a single "Activity" view can
7377
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7378
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7379
+ * management operation, WHY it ran (reason), and its measurable effect
7380
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7381
+ * never fail the operation it records.
7382
+ */
7383
+ /** Which management domain the operation belongs to. */
7384
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7385
+ /** The kind of management operation performed. */
7386
+ var OpsLogOpSchema = _enum([
7387
+ "prune",
7388
+ "manual-delete",
7389
+ "rescan",
7390
+ "retention-run"
7391
+ ]);
7392
+ /** Why the operation ran. */
7393
+ var OpsLogReasonSchema = _enum([
7394
+ "retention",
7395
+ "quota",
7396
+ "manual",
7397
+ "operator"
7398
+ ]);
7399
+ /** One audit row, shared verbatim by both domains. */
7400
+ var OpsLogEntrySchema = object({
7401
+ /** Unique row id. */
7402
+ id: string$2(),
7403
+ /** Epoch ms the operation completed. */
7404
+ at: number(),
7405
+ domain: OpsLogDomainSchema,
7406
+ op: OpsLogOpSchema,
7407
+ reason: OpsLogReasonSchema,
7408
+ /** The camera the op targeted; null for a cluster/global op. */
7409
+ deviceId: number().nullable(),
7410
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7411
+ nodeId: string$2(),
7412
+ /** Buckets / rows deleted (op-specific unit). */
7413
+ itemsAffected: number(),
7414
+ /** Bytes reclaimed by the op (0 when not measurable). */
7415
+ bytesReclaimed: number(),
7416
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7417
+ detail: string$2().nullable(),
7418
+ /** Who/what triggered the op. */
7419
+ actor: string$2()
7420
+ });
7421
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7422
+ var OpsLogQueryInputSchema = object({
7423
+ /** Restrict to a single camera; omit for every row. */
7424
+ deviceId: number().optional(),
7425
+ /** Max rows returned, newest-first. */
7426
+ limit: number().int().min(1).max(1e3).optional()
7427
+ });
7428
+ /**
7373
7429
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7374
7430
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7375
7431
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -14833,9 +14889,10 @@ var DEVICE_LOCAL_STATE_CAPS = {
14833
14889
  * `package` backs the package-drop detector — a package zone is a
14834
14890
  * `ZoneRule` on the `'package'` stage referencing drawn polygons
14835
14891
  * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
14836
- * The orchestrator provider that writes this stage lands in a later
14837
- * slice; until then the mirror carries only `{motion, detection}` and
14838
- * consumers read `package` as absent (treat as `[]`).
14892
+ * The orchestrator provider writes this stage as a first-class slice
14893
+ * (Phase 4): every mutation mirrors the full `{motion, detection,
14894
+ * package}` shape, so consumers read the current package rules directly
14895
+ * off `device.state.zoneRules.value.package`.
14839
14896
  */
14840
14897
  runtimeState: object({
14841
14898
  motion: array(ZoneRuleSchema).readonly(),
@@ -19218,6 +19275,26 @@ var TrackCascadeCountsSchema = object({
19218
19275
  /** Per-track CLIP search vectors removed (best-effort). */
19219
19276
  embeddings: number().int()
19220
19277
  });
19278
+ /** Event-store footprint for one camera. */
19279
+ var EventStoreDeviceFootprintSchema = object({
19280
+ deviceId: number(),
19281
+ /** Persisted event rows (motion + object + audio) for the camera. */
19282
+ rows: number().int(),
19283
+ /** Event-owned media bytes on disk for the camera. */
19284
+ bytes: number().int()
19285
+ });
19286
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
19287
+ var EventStoreFootprintSchema = object({
19288
+ totalRows: number().int(),
19289
+ totalBytes: number().int(),
19290
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
19291
+ });
19292
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
19293
+ var EventPruneCountsSchema = object({
19294
+ motion: number().int(),
19295
+ object: number().int(),
19296
+ audio: number().int()
19297
+ });
19221
19298
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
19222
19299
  deviceId: number(),
19223
19300
  trackId: string$2()
@@ -19281,6 +19358,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19281
19358
  }), {
19282
19359
  kind: "mutation",
19283
19360
  auth: "admin"
19361
+ }), method(object({}), EventStoreFootprintSchema, {
19362
+ kind: "query",
19363
+ auth: "admin"
19364
+ }), method(object({
19365
+ olderThanMs: number(),
19366
+ reason: OpsLogReasonSchema.optional()
19367
+ }), EventPruneCountsSchema, {
19368
+ kind: "mutation",
19369
+ auth: "admin"
19370
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
19371
+ kind: "mutation",
19372
+ auth: "admin"
19373
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19374
+ kind: "query",
19375
+ auth: "admin"
19284
19376
  }), method(object({
19285
19377
  eventId: string$2(),
19286
19378
  kind: MediaFileKindEnum.optional()
@@ -22531,13 +22623,29 @@ method(object({
22531
22623
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
22532
22624
  kind: "mutation",
22533
22625
  auth: "admin"
22534
- }), method(object({ deviceId: number() }), object({
22626
+ }), method(object({
22627
+ deviceId: number(),
22628
+ reason: OpsLogReasonSchema.optional()
22629
+ }), object({
22535
22630
  floorMs: number().nullable(),
22536
22631
  deletedBuckets: number().int(),
22537
22632
  reclaimedBytes: number().int()
22538
22633
  }), {
22539
22634
  kind: "mutation",
22540
22635
  auth: "admin"
22636
+ }), method(object({
22637
+ deviceId: number(),
22638
+ fromMs: number().optional(),
22639
+ toMs: number().optional()
22640
+ }), object({
22641
+ deletedBuckets: number().int(),
22642
+ reclaimedBytes: number().int()
22643
+ }), {
22644
+ kind: "mutation",
22645
+ auth: "admin"
22646
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
22647
+ kind: "query",
22648
+ auth: "admin"
22541
22649
  });
22542
22650
  /**
22543
22651
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25659,6 +25767,12 @@ Object.freeze({
25659
25767
  addonId: null,
25660
25768
  access: "delete"
25661
25769
  },
25770
+ "pipelineAnalytics.deleteDeviceEvents": {
25771
+ capName: "pipeline-analytics",
25772
+ capScope: "device",
25773
+ addonId: null,
25774
+ access: "delete"
25775
+ },
25662
25776
  "pipelineAnalytics.deleteTracks": {
25663
25777
  capName: "pipeline-analytics",
25664
25778
  capScope: "device",
@@ -25689,6 +25803,12 @@ Object.freeze({
25689
25803
  addonId: null,
25690
25804
  access: "view"
25691
25805
  },
25806
+ "pipelineAnalytics.getEventStoreFootprint": {
25807
+ capName: "pipeline-analytics",
25808
+ capScope: "device",
25809
+ addonId: null,
25810
+ access: "view"
25811
+ },
25692
25812
  "pipelineAnalytics.getKeyEvents": {
25693
25813
  capName: "pipeline-analytics",
25694
25814
  capScope: "device",
@@ -25731,6 +25851,12 @@ Object.freeze({
25731
25851
  addonId: null,
25732
25852
  access: "view"
25733
25853
  },
25854
+ "pipelineAnalytics.listOpsLog": {
25855
+ capName: "pipeline-analytics",
25856
+ capScope: "device",
25857
+ addonId: null,
25858
+ access: "view"
25859
+ },
25734
25860
  "pipelineAnalytics.listRecentTracks": {
25735
25861
  capName: "pipeline-analytics",
25736
25862
  capScope: "device",
@@ -25743,6 +25869,12 @@ Object.freeze({
25743
25869
  addonId: null,
25744
25870
  access: "view"
25745
25871
  },
25872
+ "pipelineAnalytics.pruneEvents": {
25873
+ capName: "pipeline-analytics",
25874
+ capScope: "device",
25875
+ addonId: null,
25876
+ access: "create"
25877
+ },
25746
25878
  "pipelineAnalytics.pruneEventsBefore": {
25747
25879
  capName: "pipeline-analytics",
25748
25880
  capScope: "device",
@@ -26505,6 +26637,12 @@ Object.freeze({
26505
26637
  addonId: null,
26506
26638
  access: "create"
26507
26639
  },
26640
+ "recording.deleteFootprint": {
26641
+ capName: "recording",
26642
+ capScope: "system",
26643
+ addonId: null,
26644
+ access: "delete"
26645
+ },
26508
26646
  "recording.getAvailability": {
26509
26647
  capName: "recording",
26510
26648
  capScope: "system",
@@ -26535,6 +26673,12 @@ Object.freeze({
26535
26673
  addonId: null,
26536
26674
  access: "view"
26537
26675
  },
26676
+ "recording.listOpsLog": {
26677
+ capName: "recording",
26678
+ capScope: "system",
26679
+ addonId: null,
26680
+ access: "view"
26681
+ },
26538
26682
  "recording.locateSegment": {
26539
26683
  capName: "recording",
26540
26684
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-matter-broker",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
5
5
  "keywords": [
6
6
  "camstack",