@camstack/addon-ai 0.1.6 → 0.1.7

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(),
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(),
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().nullable(),
7420
+ /** Who/what triggered the op. */
7421
+ actor: string()
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
@@ -16247,6 +16303,26 @@ var TrackCascadeCountsSchema = object({
16247
16303
  /** Per-track CLIP search vectors removed (best-effort). */
16248
16304
  embeddings: number().int()
16249
16305
  });
16306
+ /** Event-store footprint for one camera. */
16307
+ var EventStoreDeviceFootprintSchema = object({
16308
+ deviceId: number(),
16309
+ /** Persisted event rows (motion + object + audio) for the camera. */
16310
+ rows: number().int(),
16311
+ /** Event-owned media bytes on disk for the camera. */
16312
+ bytes: number().int()
16313
+ });
16314
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16315
+ var EventStoreFootprintSchema = object({
16316
+ totalRows: number().int(),
16317
+ totalBytes: number().int(),
16318
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16319
+ });
16320
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16321
+ var EventPruneCountsSchema = object({
16322
+ motion: number().int(),
16323
+ object: number().int(),
16324
+ audio: number().int()
16325
+ });
16250
16326
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16251
16327
  deviceId: number(),
16252
16328
  trackId: string()
@@ -16310,6 +16386,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16310
16386
  }), {
16311
16387
  kind: "mutation",
16312
16388
  auth: "admin"
16389
+ }), method(object({}), EventStoreFootprintSchema, {
16390
+ kind: "query",
16391
+ auth: "admin"
16392
+ }), method(object({
16393
+ olderThanMs: number(),
16394
+ reason: OpsLogReasonSchema.optional()
16395
+ }), EventPruneCountsSchema, {
16396
+ kind: "mutation",
16397
+ auth: "admin"
16398
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16399
+ kind: "mutation",
16400
+ auth: "admin"
16401
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16402
+ kind: "query",
16403
+ auth: "admin"
16313
16404
  }), method(object({
16314
16405
  eventId: string(),
16315
16406
  kind: MediaFileKindEnum.optional()
@@ -19543,13 +19634,29 @@ method(object({
19543
19634
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19544
19635
  kind: "mutation",
19545
19636
  auth: "admin"
19546
- }), method(object({ deviceId: number() }), object({
19637
+ }), method(object({
19638
+ deviceId: number(),
19639
+ reason: OpsLogReasonSchema.optional()
19640
+ }), object({
19547
19641
  floorMs: number().nullable(),
19548
19642
  deletedBuckets: number().int(),
19549
19643
  reclaimedBytes: number().int()
19550
19644
  }), {
19551
19645
  kind: "mutation",
19552
19646
  auth: "admin"
19647
+ }), method(object({
19648
+ deviceId: number(),
19649
+ fromMs: number().optional(),
19650
+ toMs: number().optional()
19651
+ }), object({
19652
+ deletedBuckets: number().int(),
19653
+ reclaimedBytes: number().int()
19654
+ }), {
19655
+ kind: "mutation",
19656
+ auth: "admin"
19657
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19658
+ kind: "query",
19659
+ auth: "admin"
19553
19660
  });
19554
19661
  /**
19555
19662
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22671,6 +22778,12 @@ Object.freeze({
22671
22778
  addonId: null,
22672
22779
  access: "delete"
22673
22780
  },
22781
+ "pipelineAnalytics.deleteDeviceEvents": {
22782
+ capName: "pipeline-analytics",
22783
+ capScope: "device",
22784
+ addonId: null,
22785
+ access: "delete"
22786
+ },
22674
22787
  "pipelineAnalytics.deleteTracks": {
22675
22788
  capName: "pipeline-analytics",
22676
22789
  capScope: "device",
@@ -22701,6 +22814,12 @@ Object.freeze({
22701
22814
  addonId: null,
22702
22815
  access: "view"
22703
22816
  },
22817
+ "pipelineAnalytics.getEventStoreFootprint": {
22818
+ capName: "pipeline-analytics",
22819
+ capScope: "device",
22820
+ addonId: null,
22821
+ access: "view"
22822
+ },
22704
22823
  "pipelineAnalytics.getKeyEvents": {
22705
22824
  capName: "pipeline-analytics",
22706
22825
  capScope: "device",
@@ -22743,6 +22862,12 @@ Object.freeze({
22743
22862
  addonId: null,
22744
22863
  access: "view"
22745
22864
  },
22865
+ "pipelineAnalytics.listOpsLog": {
22866
+ capName: "pipeline-analytics",
22867
+ capScope: "device",
22868
+ addonId: null,
22869
+ access: "view"
22870
+ },
22746
22871
  "pipelineAnalytics.listRecentTracks": {
22747
22872
  capName: "pipeline-analytics",
22748
22873
  capScope: "device",
@@ -22755,6 +22880,12 @@ Object.freeze({
22755
22880
  addonId: null,
22756
22881
  access: "view"
22757
22882
  },
22883
+ "pipelineAnalytics.pruneEvents": {
22884
+ capName: "pipeline-analytics",
22885
+ capScope: "device",
22886
+ addonId: null,
22887
+ access: "create"
22888
+ },
22758
22889
  "pipelineAnalytics.pruneEventsBefore": {
22759
22890
  capName: "pipeline-analytics",
22760
22891
  capScope: "device",
@@ -23517,6 +23648,12 @@ Object.freeze({
23517
23648
  addonId: null,
23518
23649
  access: "create"
23519
23650
  },
23651
+ "recording.deleteFootprint": {
23652
+ capName: "recording",
23653
+ capScope: "system",
23654
+ addonId: null,
23655
+ access: "delete"
23656
+ },
23520
23657
  "recording.getAvailability": {
23521
23658
  capName: "recording",
23522
23659
  capScope: "system",
@@ -23547,6 +23684,12 @@ Object.freeze({
23547
23684
  addonId: null,
23548
23685
  access: "view"
23549
23686
  },
23687
+ "recording.listOpsLog": {
23688
+ capName: "recording",
23689
+ capScope: "system",
23690
+ addonId: null,
23691
+ access: "view"
23692
+ },
23550
23693
  "recording.locateSegment": {
23551
23694
  capName: "recording",
23552
23695
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -7334,6 +7334,62 @@ var RecordingConfigSchema = object({
7334
7334
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7335
7335
  });
7336
7336
  /**
7337
+ * Ops-log — the durable, append-only operations audit shared by the
7338
+ * recordings and events management surfaces.
7339
+ *
7340
+ * ONE row shape is reused for both domains so a single "Activity" view can
7341
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7342
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7343
+ * management operation, WHY it ran (reason), and its measurable effect
7344
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7345
+ * never fail the operation it records.
7346
+ */
7347
+ /** Which management domain the operation belongs to. */
7348
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7349
+ /** The kind of management operation performed. */
7350
+ var OpsLogOpSchema = _enum([
7351
+ "prune",
7352
+ "manual-delete",
7353
+ "rescan",
7354
+ "retention-run"
7355
+ ]);
7356
+ /** Why the operation ran. */
7357
+ var OpsLogReasonSchema = _enum([
7358
+ "retention",
7359
+ "quota",
7360
+ "manual",
7361
+ "operator"
7362
+ ]);
7363
+ /** One audit row, shared verbatim by both domains. */
7364
+ var OpsLogEntrySchema = object({
7365
+ /** Unique row id. */
7366
+ id: string(),
7367
+ /** Epoch ms the operation completed. */
7368
+ at: number(),
7369
+ domain: OpsLogDomainSchema,
7370
+ op: OpsLogOpSchema,
7371
+ reason: OpsLogReasonSchema,
7372
+ /** The camera the op targeted; null for a cluster/global op. */
7373
+ deviceId: number().nullable(),
7374
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7375
+ nodeId: string(),
7376
+ /** Buckets / rows deleted (op-specific unit). */
7377
+ itemsAffected: number(),
7378
+ /** Bytes reclaimed by the op (0 when not measurable). */
7379
+ bytesReclaimed: number(),
7380
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7381
+ detail: string().nullable(),
7382
+ /** Who/what triggered the op. */
7383
+ actor: string()
7384
+ });
7385
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7386
+ var OpsLogQueryInputSchema = object({
7387
+ /** Restrict to a single camera; omit for every row. */
7388
+ deviceId: number().optional(),
7389
+ /** Max rows returned, newest-first. */
7390
+ limit: number().int().min(1).max(1e3).optional()
7391
+ });
7392
+ /**
7337
7393
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7338
7394
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7339
7395
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -16209,6 +16265,26 @@ var TrackCascadeCountsSchema = object({
16209
16265
  /** Per-track CLIP search vectors removed (best-effort). */
16210
16266
  embeddings: number().int()
16211
16267
  });
16268
+ /** Event-store footprint for one camera. */
16269
+ var EventStoreDeviceFootprintSchema = object({
16270
+ deviceId: number(),
16271
+ /** Persisted event rows (motion + object + audio) for the camera. */
16272
+ rows: number().int(),
16273
+ /** Event-owned media bytes on disk for the camera. */
16274
+ bytes: number().int()
16275
+ });
16276
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16277
+ var EventStoreFootprintSchema = object({
16278
+ totalRows: number().int(),
16279
+ totalBytes: number().int(),
16280
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16281
+ });
16282
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16283
+ var EventPruneCountsSchema = object({
16284
+ motion: number().int(),
16285
+ object: number().int(),
16286
+ audio: number().int()
16287
+ });
16212
16288
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16213
16289
  deviceId: number(),
16214
16290
  trackId: string()
@@ -16272,6 +16348,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16272
16348
  }), {
16273
16349
  kind: "mutation",
16274
16350
  auth: "admin"
16351
+ }), method(object({}), EventStoreFootprintSchema, {
16352
+ kind: "query",
16353
+ auth: "admin"
16354
+ }), method(object({
16355
+ olderThanMs: number(),
16356
+ reason: OpsLogReasonSchema.optional()
16357
+ }), EventPruneCountsSchema, {
16358
+ kind: "mutation",
16359
+ auth: "admin"
16360
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16361
+ kind: "mutation",
16362
+ auth: "admin"
16363
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16364
+ kind: "query",
16365
+ auth: "admin"
16275
16366
  }), method(object({
16276
16367
  eventId: string(),
16277
16368
  kind: MediaFileKindEnum.optional()
@@ -19505,13 +19596,29 @@ method(object({
19505
19596
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19506
19597
  kind: "mutation",
19507
19598
  auth: "admin"
19508
- }), method(object({ deviceId: number() }), object({
19599
+ }), method(object({
19600
+ deviceId: number(),
19601
+ reason: OpsLogReasonSchema.optional()
19602
+ }), object({
19509
19603
  floorMs: number().nullable(),
19510
19604
  deletedBuckets: number().int(),
19511
19605
  reclaimedBytes: number().int()
19512
19606
  }), {
19513
19607
  kind: "mutation",
19514
19608
  auth: "admin"
19609
+ }), method(object({
19610
+ deviceId: number(),
19611
+ fromMs: number().optional(),
19612
+ toMs: number().optional()
19613
+ }), object({
19614
+ deletedBuckets: number().int(),
19615
+ reclaimedBytes: number().int()
19616
+ }), {
19617
+ kind: "mutation",
19618
+ auth: "admin"
19619
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19620
+ kind: "query",
19621
+ auth: "admin"
19515
19622
  });
19516
19623
  /**
19517
19624
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22633,6 +22740,12 @@ Object.freeze({
22633
22740
  addonId: null,
22634
22741
  access: "delete"
22635
22742
  },
22743
+ "pipelineAnalytics.deleteDeviceEvents": {
22744
+ capName: "pipeline-analytics",
22745
+ capScope: "device",
22746
+ addonId: null,
22747
+ access: "delete"
22748
+ },
22636
22749
  "pipelineAnalytics.deleteTracks": {
22637
22750
  capName: "pipeline-analytics",
22638
22751
  capScope: "device",
@@ -22663,6 +22776,12 @@ Object.freeze({
22663
22776
  addonId: null,
22664
22777
  access: "view"
22665
22778
  },
22779
+ "pipelineAnalytics.getEventStoreFootprint": {
22780
+ capName: "pipeline-analytics",
22781
+ capScope: "device",
22782
+ addonId: null,
22783
+ access: "view"
22784
+ },
22666
22785
  "pipelineAnalytics.getKeyEvents": {
22667
22786
  capName: "pipeline-analytics",
22668
22787
  capScope: "device",
@@ -22705,6 +22824,12 @@ Object.freeze({
22705
22824
  addonId: null,
22706
22825
  access: "view"
22707
22826
  },
22827
+ "pipelineAnalytics.listOpsLog": {
22828
+ capName: "pipeline-analytics",
22829
+ capScope: "device",
22830
+ addonId: null,
22831
+ access: "view"
22832
+ },
22708
22833
  "pipelineAnalytics.listRecentTracks": {
22709
22834
  capName: "pipeline-analytics",
22710
22835
  capScope: "device",
@@ -22717,6 +22842,12 @@ Object.freeze({
22717
22842
  addonId: null,
22718
22843
  access: "view"
22719
22844
  },
22845
+ "pipelineAnalytics.pruneEvents": {
22846
+ capName: "pipeline-analytics",
22847
+ capScope: "device",
22848
+ addonId: null,
22849
+ access: "create"
22850
+ },
22720
22851
  "pipelineAnalytics.pruneEventsBefore": {
22721
22852
  capName: "pipeline-analytics",
22722
22853
  capScope: "device",
@@ -23479,6 +23610,12 @@ Object.freeze({
23479
23610
  addonId: null,
23480
23611
  access: "create"
23481
23612
  },
23613
+ "recording.deleteFootprint": {
23614
+ capName: "recording",
23615
+ capScope: "system",
23616
+ addonId: null,
23617
+ access: "delete"
23618
+ },
23482
23619
  "recording.getAvailability": {
23483
23620
  capName: "recording",
23484
23621
  capScope: "system",
@@ -23509,6 +23646,12 @@ Object.freeze({
23509
23646
  addonId: null,
23510
23647
  access: "view"
23511
23648
  },
23649
+ "recording.listOpsLog": {
23650
+ capName: "recording",
23651
+ capScope: "system",
23652
+ addonId: null,
23653
+ access: "view"
23654
+ },
23512
23655
  "recording.locateSegment": {
23513
23656
  capName: "recording",
23514
23657
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-ai",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "AI addon for CamStack — the `llm` collection provider (cloud, LAN, and camstack-managed local llama.cpp profiles) plus the per-node `llm-runtime` managed executor.",
5
5
  "keywords": [
6
6
  "camstack",