@camstack/addon-provider-petkit 0.1.12 → 0.1.13

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
@@ -7360,6 +7360,62 @@ var RecordingConfigSchema = object({
7360
7360
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7361
7361
  });
7362
7362
  /**
7363
+ * Ops-log — the durable, append-only operations audit shared by the
7364
+ * recordings and events management surfaces.
7365
+ *
7366
+ * ONE row shape is reused for both domains so a single "Activity" view can
7367
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7368
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7369
+ * management operation, WHY it ran (reason), and its measurable effect
7370
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7371
+ * never fail the operation it records.
7372
+ */
7373
+ /** Which management domain the operation belongs to. */
7374
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7375
+ /** The kind of management operation performed. */
7376
+ var OpsLogOpSchema = _enum([
7377
+ "prune",
7378
+ "manual-delete",
7379
+ "rescan",
7380
+ "retention-run"
7381
+ ]);
7382
+ /** Why the operation ran. */
7383
+ var OpsLogReasonSchema = _enum([
7384
+ "retention",
7385
+ "quota",
7386
+ "manual",
7387
+ "operator"
7388
+ ]);
7389
+ /** One audit row, shared verbatim by both domains. */
7390
+ var OpsLogEntrySchema = object({
7391
+ /** Unique row id. */
7392
+ id: string(),
7393
+ /** Epoch ms the operation completed. */
7394
+ at: number(),
7395
+ domain: OpsLogDomainSchema,
7396
+ op: OpsLogOpSchema,
7397
+ reason: OpsLogReasonSchema,
7398
+ /** The camera the op targeted; null for a cluster/global op. */
7399
+ deviceId: number().nullable(),
7400
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7401
+ nodeId: string(),
7402
+ /** Buckets / rows deleted (op-specific unit). */
7403
+ itemsAffected: number(),
7404
+ /** Bytes reclaimed by the op (0 when not measurable). */
7405
+ bytesReclaimed: number(),
7406
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7407
+ detail: string().nullable(),
7408
+ /** Who/what triggered the op. */
7409
+ actor: string()
7410
+ });
7411
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7412
+ var OpsLogQueryInputSchema = object({
7413
+ /** Restrict to a single camera; omit for every row. */
7414
+ deviceId: number().optional(),
7415
+ /** Max rows returned, newest-first. */
7416
+ limit: number().int().min(1).max(1e3).optional()
7417
+ });
7418
+ /**
7363
7419
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7364
7420
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7365
7421
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -14823,9 +14879,10 @@ var DEVICE_LOCAL_STATE_CAPS = {
14823
14879
  * `package` backs the package-drop detector — a package zone is a
14824
14880
  * `ZoneRule` on the `'package'` stage referencing drawn polygons
14825
14881
  * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
14826
- * The orchestrator provider that writes this stage lands in a later
14827
- * slice; until then the mirror carries only `{motion, detection}` and
14828
- * consumers read `package` as absent (treat as `[]`).
14882
+ * The orchestrator provider writes this stage as a first-class slice
14883
+ * (Phase 4): every mutation mirrors the full `{motion, detection,
14884
+ * package}` shape, so consumers read the current package rules directly
14885
+ * off `device.state.zoneRules.value.package`.
14829
14886
  */
14830
14887
  runtimeState: object({
14831
14888
  motion: array(ZoneRuleSchema).readonly(),
@@ -19159,6 +19216,26 @@ var TrackCascadeCountsSchema = object({
19159
19216
  /** Per-track CLIP search vectors removed (best-effort). */
19160
19217
  embeddings: number().int()
19161
19218
  });
19219
+ /** Event-store footprint for one camera. */
19220
+ var EventStoreDeviceFootprintSchema = object({
19221
+ deviceId: number(),
19222
+ /** Persisted event rows (motion + object + audio) for the camera. */
19223
+ rows: number().int(),
19224
+ /** Event-owned media bytes on disk for the camera. */
19225
+ bytes: number().int()
19226
+ });
19227
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
19228
+ var EventStoreFootprintSchema = object({
19229
+ totalRows: number().int(),
19230
+ totalBytes: number().int(),
19231
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
19232
+ });
19233
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
19234
+ var EventPruneCountsSchema = object({
19235
+ motion: number().int(),
19236
+ object: number().int(),
19237
+ audio: number().int()
19238
+ });
19162
19239
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
19163
19240
  deviceId: number(),
19164
19241
  trackId: string()
@@ -19222,6 +19299,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19222
19299
  }), {
19223
19300
  kind: "mutation",
19224
19301
  auth: "admin"
19302
+ }), method(object({}), EventStoreFootprintSchema, {
19303
+ kind: "query",
19304
+ auth: "admin"
19305
+ }), method(object({
19306
+ olderThanMs: number(),
19307
+ reason: OpsLogReasonSchema.optional()
19308
+ }), EventPruneCountsSchema, {
19309
+ kind: "mutation",
19310
+ auth: "admin"
19311
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
19312
+ kind: "mutation",
19313
+ auth: "admin"
19314
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19315
+ kind: "query",
19316
+ auth: "admin"
19225
19317
  }), method(object({
19226
19318
  eventId: string(),
19227
19319
  kind: MediaFileKindEnum.optional()
@@ -22455,13 +22547,29 @@ method(object({
22455
22547
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
22456
22548
  kind: "mutation",
22457
22549
  auth: "admin"
22458
- }), method(object({ deviceId: number() }), object({
22550
+ }), method(object({
22551
+ deviceId: number(),
22552
+ reason: OpsLogReasonSchema.optional()
22553
+ }), object({
22459
22554
  floorMs: number().nullable(),
22460
22555
  deletedBuckets: number().int(),
22461
22556
  reclaimedBytes: number().int()
22462
22557
  }), {
22463
22558
  kind: "mutation",
22464
22559
  auth: "admin"
22560
+ }), method(object({
22561
+ deviceId: number(),
22562
+ fromMs: number().optional(),
22563
+ toMs: number().optional()
22564
+ }), object({
22565
+ deletedBuckets: number().int(),
22566
+ reclaimedBytes: number().int()
22567
+ }), {
22568
+ kind: "mutation",
22569
+ auth: "admin"
22570
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
22571
+ kind: "query",
22572
+ auth: "admin"
22465
22573
  });
22466
22574
  /**
22467
22575
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25583,6 +25691,12 @@ Object.freeze({
25583
25691
  addonId: null,
25584
25692
  access: "delete"
25585
25693
  },
25694
+ "pipelineAnalytics.deleteDeviceEvents": {
25695
+ capName: "pipeline-analytics",
25696
+ capScope: "device",
25697
+ addonId: null,
25698
+ access: "delete"
25699
+ },
25586
25700
  "pipelineAnalytics.deleteTracks": {
25587
25701
  capName: "pipeline-analytics",
25588
25702
  capScope: "device",
@@ -25613,6 +25727,12 @@ Object.freeze({
25613
25727
  addonId: null,
25614
25728
  access: "view"
25615
25729
  },
25730
+ "pipelineAnalytics.getEventStoreFootprint": {
25731
+ capName: "pipeline-analytics",
25732
+ capScope: "device",
25733
+ addonId: null,
25734
+ access: "view"
25735
+ },
25616
25736
  "pipelineAnalytics.getKeyEvents": {
25617
25737
  capName: "pipeline-analytics",
25618
25738
  capScope: "device",
@@ -25655,6 +25775,12 @@ Object.freeze({
25655
25775
  addonId: null,
25656
25776
  access: "view"
25657
25777
  },
25778
+ "pipelineAnalytics.listOpsLog": {
25779
+ capName: "pipeline-analytics",
25780
+ capScope: "device",
25781
+ addonId: null,
25782
+ access: "view"
25783
+ },
25658
25784
  "pipelineAnalytics.listRecentTracks": {
25659
25785
  capName: "pipeline-analytics",
25660
25786
  capScope: "device",
@@ -25667,6 +25793,12 @@ Object.freeze({
25667
25793
  addonId: null,
25668
25794
  access: "view"
25669
25795
  },
25796
+ "pipelineAnalytics.pruneEvents": {
25797
+ capName: "pipeline-analytics",
25798
+ capScope: "device",
25799
+ addonId: null,
25800
+ access: "create"
25801
+ },
25670
25802
  "pipelineAnalytics.pruneEventsBefore": {
25671
25803
  capName: "pipeline-analytics",
25672
25804
  capScope: "device",
@@ -26429,6 +26561,12 @@ Object.freeze({
26429
26561
  addonId: null,
26430
26562
  access: "create"
26431
26563
  },
26564
+ "recording.deleteFootprint": {
26565
+ capName: "recording",
26566
+ capScope: "system",
26567
+ addonId: null,
26568
+ access: "delete"
26569
+ },
26432
26570
  "recording.getAvailability": {
26433
26571
  capName: "recording",
26434
26572
  capScope: "system",
@@ -26459,6 +26597,12 @@ Object.freeze({
26459
26597
  addonId: null,
26460
26598
  access: "view"
26461
26599
  },
26600
+ "recording.listOpsLog": {
26601
+ capName: "recording",
26602
+ capScope: "system",
26603
+ addonId: null,
26604
+ access: "view"
26605
+ },
26462
26606
  "recording.locateSegment": {
26463
26607
  capName: "recording",
26464
26608
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -7359,6 +7359,62 @@ var RecordingConfigSchema = object({
7359
7359
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7360
7360
  });
7361
7361
  /**
7362
+ * Ops-log — the durable, append-only operations audit shared by the
7363
+ * recordings and events management surfaces.
7364
+ *
7365
+ * ONE row shape is reused for both domains so a single "Activity" view can
7366
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7367
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7368
+ * management operation, WHY it ran (reason), and its measurable effect
7369
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7370
+ * never fail the operation it records.
7371
+ */
7372
+ /** Which management domain the operation belongs to. */
7373
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7374
+ /** The kind of management operation performed. */
7375
+ var OpsLogOpSchema = _enum([
7376
+ "prune",
7377
+ "manual-delete",
7378
+ "rescan",
7379
+ "retention-run"
7380
+ ]);
7381
+ /** Why the operation ran. */
7382
+ var OpsLogReasonSchema = _enum([
7383
+ "retention",
7384
+ "quota",
7385
+ "manual",
7386
+ "operator"
7387
+ ]);
7388
+ /** One audit row, shared verbatim by both domains. */
7389
+ var OpsLogEntrySchema = object({
7390
+ /** Unique row id. */
7391
+ id: string(),
7392
+ /** Epoch ms the operation completed. */
7393
+ at: number(),
7394
+ domain: OpsLogDomainSchema,
7395
+ op: OpsLogOpSchema,
7396
+ reason: OpsLogReasonSchema,
7397
+ /** The camera the op targeted; null for a cluster/global op. */
7398
+ deviceId: number().nullable(),
7399
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7400
+ nodeId: string(),
7401
+ /** Buckets / rows deleted (op-specific unit). */
7402
+ itemsAffected: number(),
7403
+ /** Bytes reclaimed by the op (0 when not measurable). */
7404
+ bytesReclaimed: number(),
7405
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7406
+ detail: string().nullable(),
7407
+ /** Who/what triggered the op. */
7408
+ actor: string()
7409
+ });
7410
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7411
+ var OpsLogQueryInputSchema = object({
7412
+ /** Restrict to a single camera; omit for every row. */
7413
+ deviceId: number().optional(),
7414
+ /** Max rows returned, newest-first. */
7415
+ limit: number().int().min(1).max(1e3).optional()
7416
+ });
7417
+ /**
7362
7418
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7363
7419
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7364
7420
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -14822,9 +14878,10 @@ var DEVICE_LOCAL_STATE_CAPS = {
14822
14878
  * `package` backs the package-drop detector — a package zone is a
14823
14879
  * `ZoneRule` on the `'package'` stage referencing drawn polygons
14824
14880
  * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
14825
- * The orchestrator provider that writes this stage lands in a later
14826
- * slice; until then the mirror carries only `{motion, detection}` and
14827
- * consumers read `package` as absent (treat as `[]`).
14881
+ * The orchestrator provider writes this stage as a first-class slice
14882
+ * (Phase 4): every mutation mirrors the full `{motion, detection,
14883
+ * package}` shape, so consumers read the current package rules directly
14884
+ * off `device.state.zoneRules.value.package`.
14828
14885
  */
14829
14886
  runtimeState: object({
14830
14887
  motion: array(ZoneRuleSchema).readonly(),
@@ -19158,6 +19215,26 @@ var TrackCascadeCountsSchema = object({
19158
19215
  /** Per-track CLIP search vectors removed (best-effort). */
19159
19216
  embeddings: number().int()
19160
19217
  });
19218
+ /** Event-store footprint for one camera. */
19219
+ var EventStoreDeviceFootprintSchema = object({
19220
+ deviceId: number(),
19221
+ /** Persisted event rows (motion + object + audio) for the camera. */
19222
+ rows: number().int(),
19223
+ /** Event-owned media bytes on disk for the camera. */
19224
+ bytes: number().int()
19225
+ });
19226
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
19227
+ var EventStoreFootprintSchema = object({
19228
+ totalRows: number().int(),
19229
+ totalBytes: number().int(),
19230
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
19231
+ });
19232
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
19233
+ var EventPruneCountsSchema = object({
19234
+ motion: number().int(),
19235
+ object: number().int(),
19236
+ audio: number().int()
19237
+ });
19161
19238
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
19162
19239
  deviceId: number(),
19163
19240
  trackId: string()
@@ -19221,6 +19298,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19221
19298
  }), {
19222
19299
  kind: "mutation",
19223
19300
  auth: "admin"
19301
+ }), method(object({}), EventStoreFootprintSchema, {
19302
+ kind: "query",
19303
+ auth: "admin"
19304
+ }), method(object({
19305
+ olderThanMs: number(),
19306
+ reason: OpsLogReasonSchema.optional()
19307
+ }), EventPruneCountsSchema, {
19308
+ kind: "mutation",
19309
+ auth: "admin"
19310
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
19311
+ kind: "mutation",
19312
+ auth: "admin"
19313
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19314
+ kind: "query",
19315
+ auth: "admin"
19224
19316
  }), method(object({
19225
19317
  eventId: string(),
19226
19318
  kind: MediaFileKindEnum.optional()
@@ -22454,13 +22546,29 @@ method(object({
22454
22546
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
22455
22547
  kind: "mutation",
22456
22548
  auth: "admin"
22457
- }), method(object({ deviceId: number() }), object({
22549
+ }), method(object({
22550
+ deviceId: number(),
22551
+ reason: OpsLogReasonSchema.optional()
22552
+ }), object({
22458
22553
  floorMs: number().nullable(),
22459
22554
  deletedBuckets: number().int(),
22460
22555
  reclaimedBytes: number().int()
22461
22556
  }), {
22462
22557
  kind: "mutation",
22463
22558
  auth: "admin"
22559
+ }), method(object({
22560
+ deviceId: number(),
22561
+ fromMs: number().optional(),
22562
+ toMs: number().optional()
22563
+ }), object({
22564
+ deletedBuckets: number().int(),
22565
+ reclaimedBytes: number().int()
22566
+ }), {
22567
+ kind: "mutation",
22568
+ auth: "admin"
22569
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
22570
+ kind: "query",
22571
+ auth: "admin"
22464
22572
  });
22465
22573
  /**
22466
22574
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -25582,6 +25690,12 @@ Object.freeze({
25582
25690
  addonId: null,
25583
25691
  access: "delete"
25584
25692
  },
25693
+ "pipelineAnalytics.deleteDeviceEvents": {
25694
+ capName: "pipeline-analytics",
25695
+ capScope: "device",
25696
+ addonId: null,
25697
+ access: "delete"
25698
+ },
25585
25699
  "pipelineAnalytics.deleteTracks": {
25586
25700
  capName: "pipeline-analytics",
25587
25701
  capScope: "device",
@@ -25612,6 +25726,12 @@ Object.freeze({
25612
25726
  addonId: null,
25613
25727
  access: "view"
25614
25728
  },
25729
+ "pipelineAnalytics.getEventStoreFootprint": {
25730
+ capName: "pipeline-analytics",
25731
+ capScope: "device",
25732
+ addonId: null,
25733
+ access: "view"
25734
+ },
25615
25735
  "pipelineAnalytics.getKeyEvents": {
25616
25736
  capName: "pipeline-analytics",
25617
25737
  capScope: "device",
@@ -25654,6 +25774,12 @@ Object.freeze({
25654
25774
  addonId: null,
25655
25775
  access: "view"
25656
25776
  },
25777
+ "pipelineAnalytics.listOpsLog": {
25778
+ capName: "pipeline-analytics",
25779
+ capScope: "device",
25780
+ addonId: null,
25781
+ access: "view"
25782
+ },
25657
25783
  "pipelineAnalytics.listRecentTracks": {
25658
25784
  capName: "pipeline-analytics",
25659
25785
  capScope: "device",
@@ -25666,6 +25792,12 @@ Object.freeze({
25666
25792
  addonId: null,
25667
25793
  access: "view"
25668
25794
  },
25795
+ "pipelineAnalytics.pruneEvents": {
25796
+ capName: "pipeline-analytics",
25797
+ capScope: "device",
25798
+ addonId: null,
25799
+ access: "create"
25800
+ },
25669
25801
  "pipelineAnalytics.pruneEventsBefore": {
25670
25802
  capName: "pipeline-analytics",
25671
25803
  capScope: "device",
@@ -26428,6 +26560,12 @@ Object.freeze({
26428
26560
  addonId: null,
26429
26561
  access: "create"
26430
26562
  },
26563
+ "recording.deleteFootprint": {
26564
+ capName: "recording",
26565
+ capScope: "system",
26566
+ addonId: null,
26567
+ access: "delete"
26568
+ },
26431
26569
  "recording.getAvailability": {
26432
26570
  capName: "recording",
26433
26571
  capScope: "system",
@@ -26458,6 +26596,12 @@ Object.freeze({
26458
26596
  addonId: null,
26459
26597
  access: "view"
26460
26598
  },
26599
+ "recording.listOpsLog": {
26600
+ capName: "recording",
26601
+ capScope: "system",
26602
+ addonId: null,
26603
+ access: "view"
26604
+ },
26461
26605
  "recording.locateSegment": {
26462
26606
  capName: "recording",
26463
26607
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-petkit",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "PetKit smart-feeder device-provider addon for CamStack — wraps the @apocaliss92/nodepetkit PetKit cloud client",
5
5
  "keywords": [
6
6
  "camstack",