@camstack/addon-provider-onvif 1.1.27 → 1.1.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.
package/dist/addon.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region \0rolldown/runtime.js
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
4
  //#endregion
5
- //#region ../types/dist/event-category-H4AVePnn.mjs
5
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
6
6
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
7
7
  EventCategory["SystemBoot"] = "system.boot";
8
8
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -155,6 +155,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
155
155
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
156
156
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
157
157
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
158
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
159
+ * progress bar the client reconciles via `recordingExport.getExport`. */
160
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
161
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
162
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
158
163
  EventCategory["DetectionEvent"] = "detection.event";
159
164
  EventCategory["SessionTrackNew"] = "session.track.new";
160
165
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -444,6 +449,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
444
449
  */
445
450
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
446
451
  /**
452
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
453
+ * a package zone — a newly-appeared stationary object of a package class
454
+ * that cleared the class / zone / dwell / size gates. Payload:
455
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
456
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
457
+ * Telemetry (D8): the durable record is the `package-events` store row;
458
+ * this bus topic drives notifier rules + live UI. See
459
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
460
+ */
461
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
462
+ /**
463
+ * Fired by `addon-post-analysis` when a previously-delivered package
464
+ * leaves its zone (the stationary entry departed — moved or swept).
465
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
466
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
467
+ * Telemetry (D8). See package-zones-design §5.2.
468
+ */
469
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
470
+ /**
447
471
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
448
472
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
449
473
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -5182,6 +5206,25 @@ function _instanceof(cls, params = {}) {
5182
5206
  };
5183
5207
  return inst;
5184
5208
  }
5209
+ //#endregion
5210
+ //#region ../../node_modules/zod/v4/classic/compat.js
5211
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5212
+ var ZodIssueCode = {
5213
+ invalid_type: "invalid_type",
5214
+ too_big: "too_big",
5215
+ too_small: "too_small",
5216
+ invalid_format: "invalid_format",
5217
+ not_multiple_of: "not_multiple_of",
5218
+ unrecognized_keys: "unrecognized_keys",
5219
+ invalid_union: "invalid_union",
5220
+ invalid_key: "invalid_key",
5221
+ invalid_element: "invalid_element",
5222
+ invalid_value: "invalid_value",
5223
+ custom: "custom"
5224
+ };
5225
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5226
+ var ZodFirstPartyTypeKind;
5227
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5185
5228
  Object.fromEntries([
5186
5229
  {
5187
5230
  id: "overview",
@@ -7300,6 +7343,62 @@ var RecordingConfigSchema = object({
7300
7343
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7301
7344
  });
7302
7345
  /**
7346
+ * Ops-log — the durable, append-only operations audit shared by the
7347
+ * recordings and events management surfaces.
7348
+ *
7349
+ * ONE row shape is reused for both domains so a single "Activity" view can
7350
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7351
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7352
+ * management operation, WHY it ran (reason), and its measurable effect
7353
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7354
+ * never fail the operation it records.
7355
+ */
7356
+ /** Which management domain the operation belongs to. */
7357
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7358
+ /** The kind of management operation performed. */
7359
+ var OpsLogOpSchema = _enum([
7360
+ "prune",
7361
+ "manual-delete",
7362
+ "rescan",
7363
+ "retention-run"
7364
+ ]);
7365
+ /** Why the operation ran. */
7366
+ var OpsLogReasonSchema = _enum([
7367
+ "retention",
7368
+ "quota",
7369
+ "manual",
7370
+ "operator"
7371
+ ]);
7372
+ /** One audit row, shared verbatim by both domains. */
7373
+ var OpsLogEntrySchema = object({
7374
+ /** Unique row id. */
7375
+ id: string(),
7376
+ /** Epoch ms the operation completed. */
7377
+ at: number(),
7378
+ domain: OpsLogDomainSchema,
7379
+ op: OpsLogOpSchema,
7380
+ reason: OpsLogReasonSchema,
7381
+ /** The camera the op targeted; null for a cluster/global op. */
7382
+ deviceId: number().nullable(),
7383
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7384
+ nodeId: string(),
7385
+ /** Buckets / rows deleted (op-specific unit). */
7386
+ itemsAffected: number(),
7387
+ /** Bytes reclaimed by the op (0 when not measurable). */
7388
+ bytesReclaimed: number(),
7389
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7390
+ detail: string().nullable(),
7391
+ /** Who/what triggered the op. */
7392
+ actor: string()
7393
+ });
7394
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7395
+ var OpsLogQueryInputSchema = object({
7396
+ /** Restrict to a single camera; omit for every row. */
7397
+ deviceId: number().optional(),
7398
+ /** Max rows returned, newest-first. */
7399
+ limit: number().int().min(1).max(1e3).optional()
7400
+ });
7401
+ /**
7303
7402
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7304
7403
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7305
7404
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -12719,7 +12818,11 @@ array(ZoneRuleSchema).readonly();
12719
12818
  * Extend the enum here when a new gating consumer comes online (audio
12720
12819
  * gating, alert filtering, …) — no other surface needs to change.
12721
12820
  */
12722
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
12821
+ var ZoneRuleStageEnum = _enum([
12822
+ "motion",
12823
+ "detection",
12824
+ "package"
12825
+ ]);
12723
12826
  DeviceType.Camera, method(object({
12724
12827
  deviceId: number(),
12725
12828
  stage: ZoneRuleStageEnum
@@ -12732,7 +12835,8 @@ DeviceType.Camera, method(object({
12732
12835
  auth: "admin"
12733
12836
  }), object({
12734
12837
  motion: array(ZoneRuleSchema).readonly(),
12735
- detection: array(ZoneRuleSchema).readonly()
12838
+ detection: array(ZoneRuleSchema).readonly(),
12839
+ package: array(ZoneRuleSchema).readonly()
12736
12840
  });
12737
12841
  var ProviderStatusSchema = object({
12738
12842
  connected: boolean(),
@@ -16209,6 +16313,7 @@ var EventKindIconSchema = _enum([
16209
16313
  "smoke",
16210
16314
  "water",
16211
16315
  "button",
16316
+ "package",
16212
16317
  "generic"
16213
16318
  ]);
16214
16319
  var EventKindCategorySchema = _enum([
@@ -16216,7 +16321,8 @@ var EventKindCategorySchema = _enum([
16216
16321
  "audio",
16217
16322
  "detection",
16218
16323
  "sensor",
16219
- "custom"
16324
+ "custom",
16325
+ "package"
16220
16326
  ]);
16221
16327
  var EventKindDescriptorSchema = object({
16222
16328
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -16557,6 +16663,26 @@ var TrackCascadeCountsSchema = object({
16557
16663
  /** Per-track CLIP search vectors removed (best-effort). */
16558
16664
  embeddings: number().int()
16559
16665
  });
16666
+ /** Event-store footprint for one camera. */
16667
+ var EventStoreDeviceFootprintSchema = object({
16668
+ deviceId: number(),
16669
+ /** Persisted event rows (motion + object + audio) for the camera. */
16670
+ rows: number().int(),
16671
+ /** Event-owned media bytes on disk for the camera. */
16672
+ bytes: number().int()
16673
+ });
16674
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16675
+ var EventStoreFootprintSchema = object({
16676
+ totalRows: number().int(),
16677
+ totalBytes: number().int(),
16678
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16679
+ });
16680
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16681
+ var EventPruneCountsSchema = object({
16682
+ motion: number().int(),
16683
+ object: number().int(),
16684
+ audio: number().int()
16685
+ });
16560
16686
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16561
16687
  deviceId: number(),
16562
16688
  trackId: string()
@@ -16620,6 +16746,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16620
16746
  }), {
16621
16747
  kind: "mutation",
16622
16748
  auth: "admin"
16749
+ }), method(object({}), EventStoreFootprintSchema, {
16750
+ kind: "query",
16751
+ auth: "admin"
16752
+ }), method(object({
16753
+ olderThanMs: number(),
16754
+ reason: OpsLogReasonSchema.optional()
16755
+ }), EventPruneCountsSchema, {
16756
+ kind: "mutation",
16757
+ auth: "admin"
16758
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16759
+ kind: "mutation",
16760
+ auth: "admin"
16761
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16762
+ kind: "query",
16763
+ auth: "admin"
16623
16764
  }), method(object({
16624
16765
  eventId: string(),
16625
16766
  kind: MediaFileKindEnum.optional()
@@ -19946,13 +20087,131 @@ method(object({
19946
20087
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19947
20088
  kind: "mutation",
19948
20089
  auth: "admin"
19949
- }), method(object({ deviceId: number() }), object({
20090
+ }), method(object({
20091
+ deviceId: number(),
20092
+ reason: OpsLogReasonSchema.optional()
20093
+ }), object({
19950
20094
  floorMs: number().nullable(),
19951
20095
  deletedBuckets: number().int(),
19952
20096
  reclaimedBytes: number().int()
19953
20097
  }), {
19954
20098
  kind: "mutation",
19955
20099
  auth: "admin"
20100
+ }), method(object({
20101
+ deviceId: number(),
20102
+ fromMs: number().optional(),
20103
+ toMs: number().optional()
20104
+ }), object({
20105
+ deletedBuckets: number().int(),
20106
+ reclaimedBytes: number().int()
20107
+ }), {
20108
+ kind: "mutation",
20109
+ auth: "admin"
20110
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20111
+ kind: "query",
20112
+ auth: "admin"
20113
+ });
20114
+ /**
20115
+ * `recordingExport` cap — render a footage time range into a single downloadable
20116
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
20117
+ * bounded lifetime with a durable history, auto-expiry, and optional
20118
+ * delete-after-download.
20119
+ *
20120
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
20121
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
20122
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
20123
+ * input and dispatch to that single provider; the render runs on the node that
20124
+ * owns the footage (no cross-node segment transfer). Download rides the
20125
+ * framework addon data-plane. State persists in a DurableState blob (NOT
20126
+ * SQLite); history rows survive file deletion for audit.
20127
+ */
20128
+ /** Playback-speed multiplier for the render (1 = realtime). */
20129
+ var ExportSpeedSchema = number().min(.25).max(32);
20130
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
20131
+ var ExportTimelapseSchema = object({
20132
+ everyMs: number().int().positive(),
20133
+ outputFps: number().int().min(1).max(60).optional()
20134
+ });
20135
+ /**
20136
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
20137
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
20138
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
20139
+ * `deleteAfterDownload` removes it shortly after the first complete download.
20140
+ */
20141
+ var ExportOptionsSchema = object({
20142
+ speed: ExportSpeedSchema.optional(),
20143
+ timelapse: ExportTimelapseSchema.optional(),
20144
+ includeAudio: boolean(),
20145
+ maxLifeMs: number().int().positive(),
20146
+ deleteAfterDownload: boolean(),
20147
+ title: string().max(200).optional()
20148
+ }).superRefine((v, ctx) => {
20149
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
20150
+ code: ZodIssueCode.custom,
20151
+ message: "speed and timelapse are mutually exclusive",
20152
+ path: ["timelapse"]
20153
+ });
20154
+ });
20155
+ var ExportStateSchema = _enum([
20156
+ "queued",
20157
+ "rendering",
20158
+ "ready",
20159
+ "failed",
20160
+ "expired",
20161
+ "deleted"
20162
+ ]);
20163
+ /** One export job / history row. */
20164
+ var ExportRecordSchema = object({
20165
+ id: string(),
20166
+ deviceId: number(),
20167
+ profile: string(),
20168
+ fromMs: number(),
20169
+ toMs: number(),
20170
+ options: ExportOptionsSchema,
20171
+ state: ExportStateSchema,
20172
+ /** 0–100 while rendering; null otherwise. */
20173
+ progressPct: number().nullable(),
20174
+ /** File size once ready; null before. */
20175
+ fileBytes: number().nullable(),
20176
+ expiresAt: number(),
20177
+ deleteAfterDownload: boolean(),
20178
+ /** Epoch of the first complete download; null until then. */
20179
+ downloadedAt: number().nullable(),
20180
+ createdAt: number(),
20181
+ /** User id/name that requested the export. */
20182
+ createdBy: string(),
20183
+ /** Failure reason when state is 'failed'; null otherwise. */
20184
+ error: string().nullable()
20185
+ });
20186
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
20187
+ var ExportDownloadSchema = object({
20188
+ url: string(),
20189
+ endpoints: array(string())
20190
+ });
20191
+ method(object({
20192
+ deviceId: number(),
20193
+ profile: string(),
20194
+ fromMs: number(),
20195
+ toMs: number(),
20196
+ options: ExportOptionsSchema
20197
+ }), ExportRecordSchema, {
20198
+ kind: "mutation",
20199
+ auth: "protected"
20200
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
20201
+ kind: "query",
20202
+ auth: "protected"
20203
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
20204
+ kind: "query",
20205
+ auth: "protected"
20206
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
20207
+ kind: "mutation",
20208
+ auth: "protected"
20209
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
20210
+ kind: "mutation",
20211
+ auth: "protected"
20212
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
20213
+ kind: "query",
20214
+ auth: "protected"
19956
20215
  });
19957
20216
  /**
19958
20217
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -22972,6 +23231,12 @@ Object.freeze({
22972
23231
  addonId: null,
22973
23232
  access: "delete"
22974
23233
  },
23234
+ "pipelineAnalytics.deleteDeviceEvents": {
23235
+ capName: "pipeline-analytics",
23236
+ capScope: "device",
23237
+ addonId: null,
23238
+ access: "delete"
23239
+ },
22975
23240
  "pipelineAnalytics.deleteTracks": {
22976
23241
  capName: "pipeline-analytics",
22977
23242
  capScope: "device",
@@ -23002,6 +23267,12 @@ Object.freeze({
23002
23267
  addonId: null,
23003
23268
  access: "view"
23004
23269
  },
23270
+ "pipelineAnalytics.getEventStoreFootprint": {
23271
+ capName: "pipeline-analytics",
23272
+ capScope: "device",
23273
+ addonId: null,
23274
+ access: "view"
23275
+ },
23005
23276
  "pipelineAnalytics.getKeyEvents": {
23006
23277
  capName: "pipeline-analytics",
23007
23278
  capScope: "device",
@@ -23044,6 +23315,12 @@ Object.freeze({
23044
23315
  addonId: null,
23045
23316
  access: "view"
23046
23317
  },
23318
+ "pipelineAnalytics.listOpsLog": {
23319
+ capName: "pipeline-analytics",
23320
+ capScope: "device",
23321
+ addonId: null,
23322
+ access: "view"
23323
+ },
23047
23324
  "pipelineAnalytics.listRecentTracks": {
23048
23325
  capName: "pipeline-analytics",
23049
23326
  capScope: "device",
@@ -23056,6 +23333,12 @@ Object.freeze({
23056
23333
  addonId: null,
23057
23334
  access: "view"
23058
23335
  },
23336
+ "pipelineAnalytics.pruneEvents": {
23337
+ capName: "pipeline-analytics",
23338
+ capScope: "device",
23339
+ addonId: null,
23340
+ access: "create"
23341
+ },
23059
23342
  "pipelineAnalytics.pruneEventsBefore": {
23060
23343
  capName: "pipeline-analytics",
23061
23344
  capScope: "device",
@@ -23818,6 +24101,12 @@ Object.freeze({
23818
24101
  addonId: null,
23819
24102
  access: "create"
23820
24103
  },
24104
+ "recording.deleteFootprint": {
24105
+ capName: "recording",
24106
+ capScope: "system",
24107
+ addonId: null,
24108
+ access: "delete"
24109
+ },
23821
24110
  "recording.getAvailability": {
23822
24111
  capName: "recording",
23823
24112
  capScope: "system",
@@ -23848,6 +24137,12 @@ Object.freeze({
23848
24137
  addonId: null,
23849
24138
  access: "view"
23850
24139
  },
24140
+ "recording.listOpsLog": {
24141
+ capName: "recording",
24142
+ capScope: "system",
24143
+ addonId: null,
24144
+ access: "view"
24145
+ },
23851
24146
  "recording.locateSegment": {
23852
24147
  capName: "recording",
23853
24148
  capScope: "system",
@@ -23878,6 +24173,42 @@ Object.freeze({
23878
24173
  addonId: null,
23879
24174
  access: "create"
23880
24175
  },
24176
+ "recordingExport.cancelExport": {
24177
+ capName: "recordingExport",
24178
+ capScope: "system",
24179
+ addonId: null,
24180
+ access: "create"
24181
+ },
24182
+ "recordingExport.createExport": {
24183
+ capName: "recordingExport",
24184
+ capScope: "system",
24185
+ addonId: null,
24186
+ access: "create"
24187
+ },
24188
+ "recordingExport.deleteExport": {
24189
+ capName: "recordingExport",
24190
+ capScope: "system",
24191
+ addonId: null,
24192
+ access: "delete"
24193
+ },
24194
+ "recordingExport.getDownloadUrl": {
24195
+ capName: "recordingExport",
24196
+ capScope: "system",
24197
+ addonId: null,
24198
+ access: "view"
24199
+ },
24200
+ "recordingExport.getExport": {
24201
+ capName: "recordingExport",
24202
+ capScope: "system",
24203
+ addonId: null,
24204
+ access: "view"
24205
+ },
24206
+ "recordingExport.listExports": {
24207
+ capName: "recordingExport",
24208
+ capScope: "system",
24209
+ addonId: null,
24210
+ access: "view"
24211
+ },
23881
24212
  "sceneMonitor.captureReference": {
23882
24213
  capName: "scene-monitor",
23883
24214
  capScope: "device",
package/dist/addon.mjs CHANGED
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
4
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
5
5
  //#endregion
6
- //#region ../types/dist/event-category-H4AVePnn.mjs
6
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
7
7
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
8
8
  EventCategory["SystemBoot"] = "system.boot";
9
9
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -156,6 +156,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
156
156
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
157
157
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
158
158
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
159
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
160
+ * progress bar the client reconciles via `recordingExport.getExport`. */
161
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
162
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
163
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
159
164
  EventCategory["DetectionEvent"] = "detection.event";
160
165
  EventCategory["SessionTrackNew"] = "session.track.new";
161
166
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -445,6 +450,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
445
450
  */
446
451
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
447
452
  /**
453
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
454
+ * a package zone — a newly-appeared stationary object of a package class
455
+ * that cleared the class / zone / dwell / size gates. Payload:
456
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
457
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
458
+ * Telemetry (D8): the durable record is the `package-events` store row;
459
+ * this bus topic drives notifier rules + live UI. See
460
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
461
+ */
462
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
463
+ /**
464
+ * Fired by `addon-post-analysis` when a previously-delivered package
465
+ * leaves its zone (the stationary entry departed — moved or swept).
466
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
467
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
468
+ * Telemetry (D8). See package-zones-design §5.2.
469
+ */
470
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
471
+ /**
448
472
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
449
473
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
450
474
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -5183,6 +5207,25 @@ function _instanceof(cls, params = {}) {
5183
5207
  };
5184
5208
  return inst;
5185
5209
  }
5210
+ //#endregion
5211
+ //#region ../../node_modules/zod/v4/classic/compat.js
5212
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5213
+ var ZodIssueCode = {
5214
+ invalid_type: "invalid_type",
5215
+ too_big: "too_big",
5216
+ too_small: "too_small",
5217
+ invalid_format: "invalid_format",
5218
+ not_multiple_of: "not_multiple_of",
5219
+ unrecognized_keys: "unrecognized_keys",
5220
+ invalid_union: "invalid_union",
5221
+ invalid_key: "invalid_key",
5222
+ invalid_element: "invalid_element",
5223
+ invalid_value: "invalid_value",
5224
+ custom: "custom"
5225
+ };
5226
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5227
+ var ZodFirstPartyTypeKind;
5228
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5186
5229
  Object.fromEntries([
5187
5230
  {
5188
5231
  id: "overview",
@@ -7301,6 +7344,62 @@ var RecordingConfigSchema = object({
7301
7344
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7302
7345
  });
7303
7346
  /**
7347
+ * Ops-log — the durable, append-only operations audit shared by the
7348
+ * recordings and events management surfaces.
7349
+ *
7350
+ * ONE row shape is reused for both domains so a single "Activity" view can
7351
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7352
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7353
+ * management operation, WHY it ran (reason), and its measurable effect
7354
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7355
+ * never fail the operation it records.
7356
+ */
7357
+ /** Which management domain the operation belongs to. */
7358
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7359
+ /** The kind of management operation performed. */
7360
+ var OpsLogOpSchema = _enum([
7361
+ "prune",
7362
+ "manual-delete",
7363
+ "rescan",
7364
+ "retention-run"
7365
+ ]);
7366
+ /** Why the operation ran. */
7367
+ var OpsLogReasonSchema = _enum([
7368
+ "retention",
7369
+ "quota",
7370
+ "manual",
7371
+ "operator"
7372
+ ]);
7373
+ /** One audit row, shared verbatim by both domains. */
7374
+ var OpsLogEntrySchema = object({
7375
+ /** Unique row id. */
7376
+ id: string(),
7377
+ /** Epoch ms the operation completed. */
7378
+ at: number(),
7379
+ domain: OpsLogDomainSchema,
7380
+ op: OpsLogOpSchema,
7381
+ reason: OpsLogReasonSchema,
7382
+ /** The camera the op targeted; null for a cluster/global op. */
7383
+ deviceId: number().nullable(),
7384
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7385
+ nodeId: string(),
7386
+ /** Buckets / rows deleted (op-specific unit). */
7387
+ itemsAffected: number(),
7388
+ /** Bytes reclaimed by the op (0 when not measurable). */
7389
+ bytesReclaimed: number(),
7390
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7391
+ detail: string().nullable(),
7392
+ /** Who/what triggered the op. */
7393
+ actor: string()
7394
+ });
7395
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7396
+ var OpsLogQueryInputSchema = object({
7397
+ /** Restrict to a single camera; omit for every row. */
7398
+ deviceId: number().optional(),
7399
+ /** Max rows returned, newest-first. */
7400
+ limit: number().int().min(1).max(1e3).optional()
7401
+ });
7402
+ /**
7304
7403
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7305
7404
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7306
7405
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -12720,7 +12819,11 @@ array(ZoneRuleSchema).readonly();
12720
12819
  * Extend the enum here when a new gating consumer comes online (audio
12721
12820
  * gating, alert filtering, …) — no other surface needs to change.
12722
12821
  */
12723
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
12822
+ var ZoneRuleStageEnum = _enum([
12823
+ "motion",
12824
+ "detection",
12825
+ "package"
12826
+ ]);
12724
12827
  DeviceType.Camera, method(object({
12725
12828
  deviceId: number(),
12726
12829
  stage: ZoneRuleStageEnum
@@ -12733,7 +12836,8 @@ DeviceType.Camera, method(object({
12733
12836
  auth: "admin"
12734
12837
  }), object({
12735
12838
  motion: array(ZoneRuleSchema).readonly(),
12736
- detection: array(ZoneRuleSchema).readonly()
12839
+ detection: array(ZoneRuleSchema).readonly(),
12840
+ package: array(ZoneRuleSchema).readonly()
12737
12841
  });
12738
12842
  var ProviderStatusSchema = object({
12739
12843
  connected: boolean(),
@@ -16210,6 +16314,7 @@ var EventKindIconSchema = _enum([
16210
16314
  "smoke",
16211
16315
  "water",
16212
16316
  "button",
16317
+ "package",
16213
16318
  "generic"
16214
16319
  ]);
16215
16320
  var EventKindCategorySchema = _enum([
@@ -16217,7 +16322,8 @@ var EventKindCategorySchema = _enum([
16217
16322
  "audio",
16218
16323
  "detection",
16219
16324
  "sensor",
16220
- "custom"
16325
+ "custom",
16326
+ "package"
16221
16327
  ]);
16222
16328
  var EventKindDescriptorSchema = object({
16223
16329
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -16558,6 +16664,26 @@ var TrackCascadeCountsSchema = object({
16558
16664
  /** Per-track CLIP search vectors removed (best-effort). */
16559
16665
  embeddings: number().int()
16560
16666
  });
16667
+ /** Event-store footprint for one camera. */
16668
+ var EventStoreDeviceFootprintSchema = object({
16669
+ deviceId: number(),
16670
+ /** Persisted event rows (motion + object + audio) for the camera. */
16671
+ rows: number().int(),
16672
+ /** Event-owned media bytes on disk for the camera. */
16673
+ bytes: number().int()
16674
+ });
16675
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16676
+ var EventStoreFootprintSchema = object({
16677
+ totalRows: number().int(),
16678
+ totalBytes: number().int(),
16679
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16680
+ });
16681
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16682
+ var EventPruneCountsSchema = object({
16683
+ motion: number().int(),
16684
+ object: number().int(),
16685
+ audio: number().int()
16686
+ });
16561
16687
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16562
16688
  deviceId: number(),
16563
16689
  trackId: string()
@@ -16621,6 +16747,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16621
16747
  }), {
16622
16748
  kind: "mutation",
16623
16749
  auth: "admin"
16750
+ }), method(object({}), EventStoreFootprintSchema, {
16751
+ kind: "query",
16752
+ auth: "admin"
16753
+ }), method(object({
16754
+ olderThanMs: number(),
16755
+ reason: OpsLogReasonSchema.optional()
16756
+ }), EventPruneCountsSchema, {
16757
+ kind: "mutation",
16758
+ auth: "admin"
16759
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16760
+ kind: "mutation",
16761
+ auth: "admin"
16762
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16763
+ kind: "query",
16764
+ auth: "admin"
16624
16765
  }), method(object({
16625
16766
  eventId: string(),
16626
16767
  kind: MediaFileKindEnum.optional()
@@ -19947,13 +20088,131 @@ method(object({
19947
20088
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19948
20089
  kind: "mutation",
19949
20090
  auth: "admin"
19950
- }), method(object({ deviceId: number() }), object({
20091
+ }), method(object({
20092
+ deviceId: number(),
20093
+ reason: OpsLogReasonSchema.optional()
20094
+ }), object({
19951
20095
  floorMs: number().nullable(),
19952
20096
  deletedBuckets: number().int(),
19953
20097
  reclaimedBytes: number().int()
19954
20098
  }), {
19955
20099
  kind: "mutation",
19956
20100
  auth: "admin"
20101
+ }), method(object({
20102
+ deviceId: number(),
20103
+ fromMs: number().optional(),
20104
+ toMs: number().optional()
20105
+ }), object({
20106
+ deletedBuckets: number().int(),
20107
+ reclaimedBytes: number().int()
20108
+ }), {
20109
+ kind: "mutation",
20110
+ auth: "admin"
20111
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
20112
+ kind: "query",
20113
+ auth: "admin"
20114
+ });
20115
+ /**
20116
+ * `recordingExport` cap — render a footage time range into a single downloadable
20117
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
20118
+ * bounded lifetime with a durable history, auto-expiry, and optional
20119
+ * delete-after-download.
20120
+ *
20121
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
20122
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
20123
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
20124
+ * input and dispatch to that single provider; the render runs on the node that
20125
+ * owns the footage (no cross-node segment transfer). Download rides the
20126
+ * framework addon data-plane. State persists in a DurableState blob (NOT
20127
+ * SQLite); history rows survive file deletion for audit.
20128
+ */
20129
+ /** Playback-speed multiplier for the render (1 = realtime). */
20130
+ var ExportSpeedSchema = number().min(.25).max(32);
20131
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
20132
+ var ExportTimelapseSchema = object({
20133
+ everyMs: number().int().positive(),
20134
+ outputFps: number().int().min(1).max(60).optional()
20135
+ });
20136
+ /**
20137
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
20138
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
20139
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
20140
+ * `deleteAfterDownload` removes it shortly after the first complete download.
20141
+ */
20142
+ var ExportOptionsSchema = object({
20143
+ speed: ExportSpeedSchema.optional(),
20144
+ timelapse: ExportTimelapseSchema.optional(),
20145
+ includeAudio: boolean(),
20146
+ maxLifeMs: number().int().positive(),
20147
+ deleteAfterDownload: boolean(),
20148
+ title: string().max(200).optional()
20149
+ }).superRefine((v, ctx) => {
20150
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
20151
+ code: ZodIssueCode.custom,
20152
+ message: "speed and timelapse are mutually exclusive",
20153
+ path: ["timelapse"]
20154
+ });
20155
+ });
20156
+ var ExportStateSchema = _enum([
20157
+ "queued",
20158
+ "rendering",
20159
+ "ready",
20160
+ "failed",
20161
+ "expired",
20162
+ "deleted"
20163
+ ]);
20164
+ /** One export job / history row. */
20165
+ var ExportRecordSchema = object({
20166
+ id: string(),
20167
+ deviceId: number(),
20168
+ profile: string(),
20169
+ fromMs: number(),
20170
+ toMs: number(),
20171
+ options: ExportOptionsSchema,
20172
+ state: ExportStateSchema,
20173
+ /** 0–100 while rendering; null otherwise. */
20174
+ progressPct: number().nullable(),
20175
+ /** File size once ready; null before. */
20176
+ fileBytes: number().nullable(),
20177
+ expiresAt: number(),
20178
+ deleteAfterDownload: boolean(),
20179
+ /** Epoch of the first complete download; null until then. */
20180
+ downloadedAt: number().nullable(),
20181
+ createdAt: number(),
20182
+ /** User id/name that requested the export. */
20183
+ createdBy: string(),
20184
+ /** Failure reason when state is 'failed'; null otherwise. */
20185
+ error: string().nullable()
20186
+ });
20187
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
20188
+ var ExportDownloadSchema = object({
20189
+ url: string(),
20190
+ endpoints: array(string())
20191
+ });
20192
+ method(object({
20193
+ deviceId: number(),
20194
+ profile: string(),
20195
+ fromMs: number(),
20196
+ toMs: number(),
20197
+ options: ExportOptionsSchema
20198
+ }), ExportRecordSchema, {
20199
+ kind: "mutation",
20200
+ auth: "protected"
20201
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
20202
+ kind: "query",
20203
+ auth: "protected"
20204
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
20205
+ kind: "query",
20206
+ auth: "protected"
20207
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
20208
+ kind: "mutation",
20209
+ auth: "protected"
20210
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
20211
+ kind: "mutation",
20212
+ auth: "protected"
20213
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
20214
+ kind: "query",
20215
+ auth: "protected"
19957
20216
  });
19958
20217
  /**
19959
20218
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -22973,6 +23232,12 @@ Object.freeze({
22973
23232
  addonId: null,
22974
23233
  access: "delete"
22975
23234
  },
23235
+ "pipelineAnalytics.deleteDeviceEvents": {
23236
+ capName: "pipeline-analytics",
23237
+ capScope: "device",
23238
+ addonId: null,
23239
+ access: "delete"
23240
+ },
22976
23241
  "pipelineAnalytics.deleteTracks": {
22977
23242
  capName: "pipeline-analytics",
22978
23243
  capScope: "device",
@@ -23003,6 +23268,12 @@ Object.freeze({
23003
23268
  addonId: null,
23004
23269
  access: "view"
23005
23270
  },
23271
+ "pipelineAnalytics.getEventStoreFootprint": {
23272
+ capName: "pipeline-analytics",
23273
+ capScope: "device",
23274
+ addonId: null,
23275
+ access: "view"
23276
+ },
23006
23277
  "pipelineAnalytics.getKeyEvents": {
23007
23278
  capName: "pipeline-analytics",
23008
23279
  capScope: "device",
@@ -23045,6 +23316,12 @@ Object.freeze({
23045
23316
  addonId: null,
23046
23317
  access: "view"
23047
23318
  },
23319
+ "pipelineAnalytics.listOpsLog": {
23320
+ capName: "pipeline-analytics",
23321
+ capScope: "device",
23322
+ addonId: null,
23323
+ access: "view"
23324
+ },
23048
23325
  "pipelineAnalytics.listRecentTracks": {
23049
23326
  capName: "pipeline-analytics",
23050
23327
  capScope: "device",
@@ -23057,6 +23334,12 @@ Object.freeze({
23057
23334
  addonId: null,
23058
23335
  access: "view"
23059
23336
  },
23337
+ "pipelineAnalytics.pruneEvents": {
23338
+ capName: "pipeline-analytics",
23339
+ capScope: "device",
23340
+ addonId: null,
23341
+ access: "create"
23342
+ },
23060
23343
  "pipelineAnalytics.pruneEventsBefore": {
23061
23344
  capName: "pipeline-analytics",
23062
23345
  capScope: "device",
@@ -23819,6 +24102,12 @@ Object.freeze({
23819
24102
  addonId: null,
23820
24103
  access: "create"
23821
24104
  },
24105
+ "recording.deleteFootprint": {
24106
+ capName: "recording",
24107
+ capScope: "system",
24108
+ addonId: null,
24109
+ access: "delete"
24110
+ },
23822
24111
  "recording.getAvailability": {
23823
24112
  capName: "recording",
23824
24113
  capScope: "system",
@@ -23849,6 +24138,12 @@ Object.freeze({
23849
24138
  addonId: null,
23850
24139
  access: "view"
23851
24140
  },
24141
+ "recording.listOpsLog": {
24142
+ capName: "recording",
24143
+ capScope: "system",
24144
+ addonId: null,
24145
+ access: "view"
24146
+ },
23852
24147
  "recording.locateSegment": {
23853
24148
  capName: "recording",
23854
24149
  capScope: "system",
@@ -23879,6 +24174,42 @@ Object.freeze({
23879
24174
  addonId: null,
23880
24175
  access: "create"
23881
24176
  },
24177
+ "recordingExport.cancelExport": {
24178
+ capName: "recordingExport",
24179
+ capScope: "system",
24180
+ addonId: null,
24181
+ access: "create"
24182
+ },
24183
+ "recordingExport.createExport": {
24184
+ capName: "recordingExport",
24185
+ capScope: "system",
24186
+ addonId: null,
24187
+ access: "create"
24188
+ },
24189
+ "recordingExport.deleteExport": {
24190
+ capName: "recordingExport",
24191
+ capScope: "system",
24192
+ addonId: null,
24193
+ access: "delete"
24194
+ },
24195
+ "recordingExport.getDownloadUrl": {
24196
+ capName: "recordingExport",
24197
+ capScope: "system",
24198
+ addonId: null,
24199
+ access: "view"
24200
+ },
24201
+ "recordingExport.getExport": {
24202
+ capName: "recordingExport",
24203
+ capScope: "system",
24204
+ addonId: null,
24205
+ access: "view"
24206
+ },
24207
+ "recordingExport.listExports": {
24208
+ capName: "recordingExport",
24209
+ capScope: "system",
24210
+ addonId: null,
24211
+ access: "view"
24212
+ },
23882
24213
  "sceneMonitor.captureReference": {
23883
24214
  capName: "scene-monitor",
23884
24215
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-onvif",
3
- "version": "1.1.27",
3
+ "version": "1.1.29",
4
4
  "description": "ONVIF camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",