@camstack/addon-agent-ui 1.1.26 → 1.1.28

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 +337 -6
  2. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
- //#region ../types/dist/event-category-H4AVePnn.mjs
3
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -153,6 +153,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
153
153
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
154
154
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
155
155
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
156
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
157
+ * progress bar the client reconciles via `recordingExport.getExport`. */
158
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
159
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
160
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
156
161
  EventCategory["DetectionEvent"] = "detection.event";
157
162
  EventCategory["SessionTrackNew"] = "session.track.new";
158
163
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -442,6 +447,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
442
447
  */
443
448
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
444
449
  /**
450
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
451
+ * a package zone — a newly-appeared stationary object of a package class
452
+ * that cleared the class / zone / dwell / size gates. Payload:
453
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
454
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
455
+ * Telemetry (D8): the durable record is the `package-events` store row;
456
+ * this bus topic drives notifier rules + live UI. See
457
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
458
+ */
459
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
460
+ /**
461
+ * Fired by `addon-post-analysis` when a previously-delivered package
462
+ * leaves its zone (the stationary entry departed — moved or swept).
463
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
464
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
465
+ * Telemetry (D8). See package-zones-design §5.2.
466
+ */
467
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
468
+ /**
445
469
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
446
470
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
447
471
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -5180,6 +5204,25 @@ function _instanceof(cls, params = {}) {
5180
5204
  };
5181
5205
  return inst;
5182
5206
  }
5207
+ //#endregion
5208
+ //#region ../../node_modules/zod/v4/classic/compat.js
5209
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5210
+ var ZodIssueCode = {
5211
+ invalid_type: "invalid_type",
5212
+ too_big: "too_big",
5213
+ too_small: "too_small",
5214
+ invalid_format: "invalid_format",
5215
+ not_multiple_of: "not_multiple_of",
5216
+ unrecognized_keys: "unrecognized_keys",
5217
+ invalid_union: "invalid_union",
5218
+ invalid_key: "invalid_key",
5219
+ invalid_element: "invalid_element",
5220
+ invalid_value: "invalid_value",
5221
+ custom: "custom"
5222
+ };
5223
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5224
+ var ZodFirstPartyTypeKind;
5225
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5183
5226
  Object.fromEntries([
5184
5227
  {
5185
5228
  id: "overview",
@@ -7295,6 +7338,62 @@ var RecordingConfigSchema = object({
7295
7338
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7296
7339
  });
7297
7340
  /**
7341
+ * Ops-log — the durable, append-only operations audit shared by the
7342
+ * recordings and events management surfaces.
7343
+ *
7344
+ * ONE row shape is reused for both domains so a single "Activity" view can
7345
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7346
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7347
+ * management operation, WHY it ran (reason), and its measurable effect
7348
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7349
+ * never fail the operation it records.
7350
+ */
7351
+ /** Which management domain the operation belongs to. */
7352
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7353
+ /** The kind of management operation performed. */
7354
+ var OpsLogOpSchema = _enum([
7355
+ "prune",
7356
+ "manual-delete",
7357
+ "rescan",
7358
+ "retention-run"
7359
+ ]);
7360
+ /** Why the operation ran. */
7361
+ var OpsLogReasonSchema = _enum([
7362
+ "retention",
7363
+ "quota",
7364
+ "manual",
7365
+ "operator"
7366
+ ]);
7367
+ /** One audit row, shared verbatim by both domains. */
7368
+ var OpsLogEntrySchema = object({
7369
+ /** Unique row id. */
7370
+ id: string(),
7371
+ /** Epoch ms the operation completed. */
7372
+ at: number(),
7373
+ domain: OpsLogDomainSchema,
7374
+ op: OpsLogOpSchema,
7375
+ reason: OpsLogReasonSchema,
7376
+ /** The camera the op targeted; null for a cluster/global op. */
7377
+ deviceId: number().nullable(),
7378
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7379
+ nodeId: string(),
7380
+ /** Buckets / rows deleted (op-specific unit). */
7381
+ itemsAffected: number(),
7382
+ /** Bytes reclaimed by the op (0 when not measurable). */
7383
+ bytesReclaimed: number(),
7384
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7385
+ detail: string().nullable(),
7386
+ /** Who/what triggered the op. */
7387
+ actor: string()
7388
+ });
7389
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7390
+ var OpsLogQueryInputSchema = object({
7391
+ /** Restrict to a single camera; omit for every row. */
7392
+ deviceId: number().optional(),
7393
+ /** Max rows returned, newest-first. */
7394
+ limit: number().int().min(1).max(1e3).optional()
7395
+ });
7396
+ /**
7298
7397
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7299
7398
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7300
7399
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -12544,7 +12643,11 @@ array(ZoneRuleSchema).readonly();
12544
12643
  * Extend the enum here when a new gating consumer comes online (audio
12545
12644
  * gating, alert filtering, …) — no other surface needs to change.
12546
12645
  */
12547
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
12646
+ var ZoneRuleStageEnum = _enum([
12647
+ "motion",
12648
+ "detection",
12649
+ "package"
12650
+ ]);
12548
12651
  DeviceType.Camera, method(object({
12549
12652
  deviceId: number(),
12550
12653
  stage: ZoneRuleStageEnum
@@ -12557,7 +12660,8 @@ DeviceType.Camera, method(object({
12557
12660
  auth: "admin"
12558
12661
  }), object({
12559
12662
  motion: array(ZoneRuleSchema).readonly(),
12560
- detection: array(ZoneRuleSchema).readonly()
12663
+ detection: array(ZoneRuleSchema).readonly(),
12664
+ package: array(ZoneRuleSchema).readonly()
12561
12665
  });
12562
12666
  var ProviderStatusSchema = object({
12563
12667
  connected: boolean(),
@@ -15740,6 +15844,7 @@ var EventKindIconSchema = _enum([
15740
15844
  "smoke",
15741
15845
  "water",
15742
15846
  "button",
15847
+ "package",
15743
15848
  "generic"
15744
15849
  ]);
15745
15850
  var EventKindCategorySchema = _enum([
@@ -15747,7 +15852,8 @@ var EventKindCategorySchema = _enum([
15747
15852
  "audio",
15748
15853
  "detection",
15749
15854
  "sensor",
15750
- "custom"
15855
+ "custom",
15856
+ "package"
15751
15857
  ]);
15752
15858
  var EventKindDescriptorSchema = object({
15753
15859
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -16088,6 +16194,26 @@ var TrackCascadeCountsSchema = object({
16088
16194
  /** Per-track CLIP search vectors removed (best-effort). */
16089
16195
  embeddings: number().int()
16090
16196
  });
16197
+ /** Event-store footprint for one camera. */
16198
+ var EventStoreDeviceFootprintSchema = object({
16199
+ deviceId: number(),
16200
+ /** Persisted event rows (motion + object + audio) for the camera. */
16201
+ rows: number().int(),
16202
+ /** Event-owned media bytes on disk for the camera. */
16203
+ bytes: number().int()
16204
+ });
16205
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16206
+ var EventStoreFootprintSchema = object({
16207
+ totalRows: number().int(),
16208
+ totalBytes: number().int(),
16209
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16210
+ });
16211
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16212
+ var EventPruneCountsSchema = object({
16213
+ motion: number().int(),
16214
+ object: number().int(),
16215
+ audio: number().int()
16216
+ });
16091
16217
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16092
16218
  deviceId: number(),
16093
16219
  trackId: string()
@@ -16151,6 +16277,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16151
16277
  }), {
16152
16278
  kind: "mutation",
16153
16279
  auth: "admin"
16280
+ }), method(object({}), EventStoreFootprintSchema, {
16281
+ kind: "query",
16282
+ auth: "admin"
16283
+ }), method(object({
16284
+ olderThanMs: number(),
16285
+ reason: OpsLogReasonSchema.optional()
16286
+ }), EventPruneCountsSchema, {
16287
+ kind: "mutation",
16288
+ auth: "admin"
16289
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16290
+ kind: "mutation",
16291
+ auth: "admin"
16292
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16293
+ kind: "query",
16294
+ auth: "admin"
16154
16295
  }), method(object({
16155
16296
  eventId: string(),
16156
16297
  kind: MediaFileKindEnum.optional()
@@ -19384,13 +19525,131 @@ method(object({
19384
19525
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19385
19526
  kind: "mutation",
19386
19527
  auth: "admin"
19387
- }), method(object({ deviceId: number() }), object({
19528
+ }), method(object({
19529
+ deviceId: number(),
19530
+ reason: OpsLogReasonSchema.optional()
19531
+ }), object({
19388
19532
  floorMs: number().nullable(),
19389
19533
  deletedBuckets: number().int(),
19390
19534
  reclaimedBytes: number().int()
19391
19535
  }), {
19392
19536
  kind: "mutation",
19393
19537
  auth: "admin"
19538
+ }), method(object({
19539
+ deviceId: number(),
19540
+ fromMs: number().optional(),
19541
+ toMs: number().optional()
19542
+ }), object({
19543
+ deletedBuckets: number().int(),
19544
+ reclaimedBytes: number().int()
19545
+ }), {
19546
+ kind: "mutation",
19547
+ auth: "admin"
19548
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19549
+ kind: "query",
19550
+ auth: "admin"
19551
+ });
19552
+ /**
19553
+ * `recordingExport` cap — render a footage time range into a single downloadable
19554
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
19555
+ * bounded lifetime with a durable history, auto-expiry, and optional
19556
+ * delete-after-download.
19557
+ *
19558
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
19559
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
19560
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
19561
+ * input and dispatch to that single provider; the render runs on the node that
19562
+ * owns the footage (no cross-node segment transfer). Download rides the
19563
+ * framework addon data-plane. State persists in a DurableState blob (NOT
19564
+ * SQLite); history rows survive file deletion for audit.
19565
+ */
19566
+ /** Playback-speed multiplier for the render (1 = realtime). */
19567
+ var ExportSpeedSchema = number().min(.25).max(32);
19568
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
19569
+ var ExportTimelapseSchema = object({
19570
+ everyMs: number().int().positive(),
19571
+ outputFps: number().int().min(1).max(60).optional()
19572
+ });
19573
+ /**
19574
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
19575
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
19576
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
19577
+ * `deleteAfterDownload` removes it shortly after the first complete download.
19578
+ */
19579
+ var ExportOptionsSchema = object({
19580
+ speed: ExportSpeedSchema.optional(),
19581
+ timelapse: ExportTimelapseSchema.optional(),
19582
+ includeAudio: boolean(),
19583
+ maxLifeMs: number().int().positive(),
19584
+ deleteAfterDownload: boolean(),
19585
+ title: string().max(200).optional()
19586
+ }).superRefine((v, ctx) => {
19587
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
19588
+ code: ZodIssueCode.custom,
19589
+ message: "speed and timelapse are mutually exclusive",
19590
+ path: ["timelapse"]
19591
+ });
19592
+ });
19593
+ var ExportStateSchema = _enum([
19594
+ "queued",
19595
+ "rendering",
19596
+ "ready",
19597
+ "failed",
19598
+ "expired",
19599
+ "deleted"
19600
+ ]);
19601
+ /** One export job / history row. */
19602
+ var ExportRecordSchema = object({
19603
+ id: string(),
19604
+ deviceId: number(),
19605
+ profile: string(),
19606
+ fromMs: number(),
19607
+ toMs: number(),
19608
+ options: ExportOptionsSchema,
19609
+ state: ExportStateSchema,
19610
+ /** 0–100 while rendering; null otherwise. */
19611
+ progressPct: number().nullable(),
19612
+ /** File size once ready; null before. */
19613
+ fileBytes: number().nullable(),
19614
+ expiresAt: number(),
19615
+ deleteAfterDownload: boolean(),
19616
+ /** Epoch of the first complete download; null until then. */
19617
+ downloadedAt: number().nullable(),
19618
+ createdAt: number(),
19619
+ /** User id/name that requested the export. */
19620
+ createdBy: string(),
19621
+ /** Failure reason when state is 'failed'; null otherwise. */
19622
+ error: string().nullable()
19623
+ });
19624
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
19625
+ var ExportDownloadSchema = object({
19626
+ url: string(),
19627
+ endpoints: array(string())
19628
+ });
19629
+ method(object({
19630
+ deviceId: number(),
19631
+ profile: string(),
19632
+ fromMs: number(),
19633
+ toMs: number(),
19634
+ options: ExportOptionsSchema
19635
+ }), ExportRecordSchema, {
19636
+ kind: "mutation",
19637
+ auth: "protected"
19638
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
19639
+ kind: "query",
19640
+ auth: "protected"
19641
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19642
+ kind: "query",
19643
+ auth: "protected"
19644
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19645
+ kind: "mutation",
19646
+ auth: "protected"
19647
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19648
+ kind: "mutation",
19649
+ auth: "protected"
19650
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
19651
+ kind: "query",
19652
+ auth: "protected"
19394
19653
  });
19395
19654
  /**
19396
19655
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -22410,6 +22669,12 @@ Object.freeze({
22410
22669
  addonId: null,
22411
22670
  access: "delete"
22412
22671
  },
22672
+ "pipelineAnalytics.deleteDeviceEvents": {
22673
+ capName: "pipeline-analytics",
22674
+ capScope: "device",
22675
+ addonId: null,
22676
+ access: "delete"
22677
+ },
22413
22678
  "pipelineAnalytics.deleteTracks": {
22414
22679
  capName: "pipeline-analytics",
22415
22680
  capScope: "device",
@@ -22440,6 +22705,12 @@ Object.freeze({
22440
22705
  addonId: null,
22441
22706
  access: "view"
22442
22707
  },
22708
+ "pipelineAnalytics.getEventStoreFootprint": {
22709
+ capName: "pipeline-analytics",
22710
+ capScope: "device",
22711
+ addonId: null,
22712
+ access: "view"
22713
+ },
22443
22714
  "pipelineAnalytics.getKeyEvents": {
22444
22715
  capName: "pipeline-analytics",
22445
22716
  capScope: "device",
@@ -22482,6 +22753,12 @@ Object.freeze({
22482
22753
  addonId: null,
22483
22754
  access: "view"
22484
22755
  },
22756
+ "pipelineAnalytics.listOpsLog": {
22757
+ capName: "pipeline-analytics",
22758
+ capScope: "device",
22759
+ addonId: null,
22760
+ access: "view"
22761
+ },
22485
22762
  "pipelineAnalytics.listRecentTracks": {
22486
22763
  capName: "pipeline-analytics",
22487
22764
  capScope: "device",
@@ -22494,6 +22771,12 @@ Object.freeze({
22494
22771
  addonId: null,
22495
22772
  access: "view"
22496
22773
  },
22774
+ "pipelineAnalytics.pruneEvents": {
22775
+ capName: "pipeline-analytics",
22776
+ capScope: "device",
22777
+ addonId: null,
22778
+ access: "create"
22779
+ },
22497
22780
  "pipelineAnalytics.pruneEventsBefore": {
22498
22781
  capName: "pipeline-analytics",
22499
22782
  capScope: "device",
@@ -23256,6 +23539,12 @@ Object.freeze({
23256
23539
  addonId: null,
23257
23540
  access: "create"
23258
23541
  },
23542
+ "recording.deleteFootprint": {
23543
+ capName: "recording",
23544
+ capScope: "system",
23545
+ addonId: null,
23546
+ access: "delete"
23547
+ },
23259
23548
  "recording.getAvailability": {
23260
23549
  capName: "recording",
23261
23550
  capScope: "system",
@@ -23286,6 +23575,12 @@ Object.freeze({
23286
23575
  addonId: null,
23287
23576
  access: "view"
23288
23577
  },
23578
+ "recording.listOpsLog": {
23579
+ capName: "recording",
23580
+ capScope: "system",
23581
+ addonId: null,
23582
+ access: "view"
23583
+ },
23289
23584
  "recording.locateSegment": {
23290
23585
  capName: "recording",
23291
23586
  capScope: "system",
@@ -23316,6 +23611,42 @@ Object.freeze({
23316
23611
  addonId: null,
23317
23612
  access: "create"
23318
23613
  },
23614
+ "recordingExport.cancelExport": {
23615
+ capName: "recordingExport",
23616
+ capScope: "system",
23617
+ addonId: null,
23618
+ access: "create"
23619
+ },
23620
+ "recordingExport.createExport": {
23621
+ capName: "recordingExport",
23622
+ capScope: "system",
23623
+ addonId: null,
23624
+ access: "create"
23625
+ },
23626
+ "recordingExport.deleteExport": {
23627
+ capName: "recordingExport",
23628
+ capScope: "system",
23629
+ addonId: null,
23630
+ access: "delete"
23631
+ },
23632
+ "recordingExport.getDownloadUrl": {
23633
+ capName: "recordingExport",
23634
+ capScope: "system",
23635
+ addonId: null,
23636
+ access: "view"
23637
+ },
23638
+ "recordingExport.getExport": {
23639
+ capName: "recordingExport",
23640
+ capScope: "system",
23641
+ addonId: null,
23642
+ access: "view"
23643
+ },
23644
+ "recordingExport.listExports": {
23645
+ capName: "recordingExport",
23646
+ capScope: "system",
23647
+ addonId: null,
23648
+ access: "view"
23649
+ },
23319
23650
  "sceneMonitor.captureReference": {
23320
23651
  capName: "scene-monitor",
23321
23652
  capScope: "device",
@@ -24495,7 +24826,7 @@ var AgentUIAddon = class extends BaseAddon {
24495
24826
  capability: adminUiCapability,
24496
24827
  provider: {
24497
24828
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
24498
- getVersion: async () => ({ version: "1.1.26" })
24829
+ getVersion: async () => ({ version: "1.1.28" })
24499
24830
  }
24500
24831
  }];
24501
24832
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-agent-ui",
3
- "version": "1.1.26",
3
+ "version": "1.1.28",
4
4
  "description": "CamStack Agent UI — lightweight status dashboard served by every agent node",
5
5
  "keywords": [
6
6
  "camstack",