@camstack/addon-decoder-nodeav 1.1.15 → 1.1.17

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/index.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  let node_crypto = require("node:crypto");
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
@@ -12550,7 +12649,11 @@ array(ZoneRuleSchema).readonly();
12550
12649
  * Extend the enum here when a new gating consumer comes online (audio
12551
12650
  * gating, alert filtering, …) — no other surface needs to change.
12552
12651
  */
12553
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
12652
+ var ZoneRuleStageEnum = _enum([
12653
+ "motion",
12654
+ "detection",
12655
+ "package"
12656
+ ]);
12554
12657
  DeviceType.Camera, method(object({
12555
12658
  deviceId: number(),
12556
12659
  stage: ZoneRuleStageEnum
@@ -12563,7 +12666,8 @@ DeviceType.Camera, method(object({
12563
12666
  auth: "admin"
12564
12667
  }), object({
12565
12668
  motion: array(ZoneRuleSchema).readonly(),
12566
- detection: array(ZoneRuleSchema).readonly()
12669
+ detection: array(ZoneRuleSchema).readonly(),
12670
+ package: array(ZoneRuleSchema).readonly()
12567
12671
  });
12568
12672
  var ProviderStatusSchema = object({
12569
12673
  connected: boolean(),
@@ -15876,6 +15980,7 @@ var EventKindIconSchema = _enum([
15876
15980
  "smoke",
15877
15981
  "water",
15878
15982
  "button",
15983
+ "package",
15879
15984
  "generic"
15880
15985
  ]);
15881
15986
  var EventKindCategorySchema = _enum([
@@ -15883,7 +15988,8 @@ var EventKindCategorySchema = _enum([
15883
15988
  "audio",
15884
15989
  "detection",
15885
15990
  "sensor",
15886
- "custom"
15991
+ "custom",
15992
+ "package"
15887
15993
  ]);
15888
15994
  var EventKindDescriptorSchema = object({
15889
15995
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -16224,6 +16330,26 @@ var TrackCascadeCountsSchema = object({
16224
16330
  /** Per-track CLIP search vectors removed (best-effort). */
16225
16331
  embeddings: number().int()
16226
16332
  });
16333
+ /** Event-store footprint for one camera. */
16334
+ var EventStoreDeviceFootprintSchema = object({
16335
+ deviceId: number(),
16336
+ /** Persisted event rows (motion + object + audio) for the camera. */
16337
+ rows: number().int(),
16338
+ /** Event-owned media bytes on disk for the camera. */
16339
+ bytes: number().int()
16340
+ });
16341
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16342
+ var EventStoreFootprintSchema = object({
16343
+ totalRows: number().int(),
16344
+ totalBytes: number().int(),
16345
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16346
+ });
16347
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16348
+ var EventPruneCountsSchema = object({
16349
+ motion: number().int(),
16350
+ object: number().int(),
16351
+ audio: number().int()
16352
+ });
16227
16353
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16228
16354
  deviceId: number(),
16229
16355
  trackId: string()
@@ -16287,6 +16413,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16287
16413
  }), {
16288
16414
  kind: "mutation",
16289
16415
  auth: "admin"
16416
+ }), method(object({}), EventStoreFootprintSchema, {
16417
+ kind: "query",
16418
+ auth: "admin"
16419
+ }), method(object({
16420
+ olderThanMs: number(),
16421
+ reason: OpsLogReasonSchema.optional()
16422
+ }), EventPruneCountsSchema, {
16423
+ kind: "mutation",
16424
+ auth: "admin"
16425
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16426
+ kind: "mutation",
16427
+ auth: "admin"
16428
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16429
+ kind: "query",
16430
+ auth: "admin"
16290
16431
  }), method(object({
16291
16432
  eventId: string(),
16292
16433
  kind: MediaFileKindEnum.optional()
@@ -19520,13 +19661,131 @@ method(object({
19520
19661
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19521
19662
  kind: "mutation",
19522
19663
  auth: "admin"
19523
- }), method(object({ deviceId: number() }), object({
19664
+ }), method(object({
19665
+ deviceId: number(),
19666
+ reason: OpsLogReasonSchema.optional()
19667
+ }), object({
19524
19668
  floorMs: number().nullable(),
19525
19669
  deletedBuckets: number().int(),
19526
19670
  reclaimedBytes: number().int()
19527
19671
  }), {
19528
19672
  kind: "mutation",
19529
19673
  auth: "admin"
19674
+ }), method(object({
19675
+ deviceId: number(),
19676
+ fromMs: number().optional(),
19677
+ toMs: number().optional()
19678
+ }), object({
19679
+ deletedBuckets: number().int(),
19680
+ reclaimedBytes: number().int()
19681
+ }), {
19682
+ kind: "mutation",
19683
+ auth: "admin"
19684
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19685
+ kind: "query",
19686
+ auth: "admin"
19687
+ });
19688
+ /**
19689
+ * `recordingExport` cap — render a footage time range into a single downloadable
19690
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
19691
+ * bounded lifetime with a durable history, auto-expiry, and optional
19692
+ * delete-after-download.
19693
+ *
19694
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
19695
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
19696
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
19697
+ * input and dispatch to that single provider; the render runs on the node that
19698
+ * owns the footage (no cross-node segment transfer). Download rides the
19699
+ * framework addon data-plane. State persists in a DurableState blob (NOT
19700
+ * SQLite); history rows survive file deletion for audit.
19701
+ */
19702
+ /** Playback-speed multiplier for the render (1 = realtime). */
19703
+ var ExportSpeedSchema = number().min(.25).max(32);
19704
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
19705
+ var ExportTimelapseSchema = object({
19706
+ everyMs: number().int().positive(),
19707
+ outputFps: number().int().min(1).max(60).optional()
19708
+ });
19709
+ /**
19710
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
19711
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
19712
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
19713
+ * `deleteAfterDownload` removes it shortly after the first complete download.
19714
+ */
19715
+ var ExportOptionsSchema = object({
19716
+ speed: ExportSpeedSchema.optional(),
19717
+ timelapse: ExportTimelapseSchema.optional(),
19718
+ includeAudio: boolean(),
19719
+ maxLifeMs: number().int().positive(),
19720
+ deleteAfterDownload: boolean(),
19721
+ title: string().max(200).optional()
19722
+ }).superRefine((v, ctx) => {
19723
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
19724
+ code: ZodIssueCode.custom,
19725
+ message: "speed and timelapse are mutually exclusive",
19726
+ path: ["timelapse"]
19727
+ });
19728
+ });
19729
+ var ExportStateSchema = _enum([
19730
+ "queued",
19731
+ "rendering",
19732
+ "ready",
19733
+ "failed",
19734
+ "expired",
19735
+ "deleted"
19736
+ ]);
19737
+ /** One export job / history row. */
19738
+ var ExportRecordSchema = object({
19739
+ id: string(),
19740
+ deviceId: number(),
19741
+ profile: string(),
19742
+ fromMs: number(),
19743
+ toMs: number(),
19744
+ options: ExportOptionsSchema,
19745
+ state: ExportStateSchema,
19746
+ /** 0–100 while rendering; null otherwise. */
19747
+ progressPct: number().nullable(),
19748
+ /** File size once ready; null before. */
19749
+ fileBytes: number().nullable(),
19750
+ expiresAt: number(),
19751
+ deleteAfterDownload: boolean(),
19752
+ /** Epoch of the first complete download; null until then. */
19753
+ downloadedAt: number().nullable(),
19754
+ createdAt: number(),
19755
+ /** User id/name that requested the export. */
19756
+ createdBy: string(),
19757
+ /** Failure reason when state is 'failed'; null otherwise. */
19758
+ error: string().nullable()
19759
+ });
19760
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
19761
+ var ExportDownloadSchema = object({
19762
+ url: string(),
19763
+ endpoints: array(string())
19764
+ });
19765
+ method(object({
19766
+ deviceId: number(),
19767
+ profile: string(),
19768
+ fromMs: number(),
19769
+ toMs: number(),
19770
+ options: ExportOptionsSchema
19771
+ }), ExportRecordSchema, {
19772
+ kind: "mutation",
19773
+ auth: "protected"
19774
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
19775
+ kind: "query",
19776
+ auth: "protected"
19777
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19778
+ kind: "query",
19779
+ auth: "protected"
19780
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19781
+ kind: "mutation",
19782
+ auth: "protected"
19783
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19784
+ kind: "mutation",
19785
+ auth: "protected"
19786
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
19787
+ kind: "query",
19788
+ auth: "protected"
19530
19789
  });
19531
19790
  /**
19532
19791
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -22546,6 +22805,12 @@ Object.freeze({
22546
22805
  addonId: null,
22547
22806
  access: "delete"
22548
22807
  },
22808
+ "pipelineAnalytics.deleteDeviceEvents": {
22809
+ capName: "pipeline-analytics",
22810
+ capScope: "device",
22811
+ addonId: null,
22812
+ access: "delete"
22813
+ },
22549
22814
  "pipelineAnalytics.deleteTracks": {
22550
22815
  capName: "pipeline-analytics",
22551
22816
  capScope: "device",
@@ -22576,6 +22841,12 @@ Object.freeze({
22576
22841
  addonId: null,
22577
22842
  access: "view"
22578
22843
  },
22844
+ "pipelineAnalytics.getEventStoreFootprint": {
22845
+ capName: "pipeline-analytics",
22846
+ capScope: "device",
22847
+ addonId: null,
22848
+ access: "view"
22849
+ },
22579
22850
  "pipelineAnalytics.getKeyEvents": {
22580
22851
  capName: "pipeline-analytics",
22581
22852
  capScope: "device",
@@ -22618,6 +22889,12 @@ Object.freeze({
22618
22889
  addonId: null,
22619
22890
  access: "view"
22620
22891
  },
22892
+ "pipelineAnalytics.listOpsLog": {
22893
+ capName: "pipeline-analytics",
22894
+ capScope: "device",
22895
+ addonId: null,
22896
+ access: "view"
22897
+ },
22621
22898
  "pipelineAnalytics.listRecentTracks": {
22622
22899
  capName: "pipeline-analytics",
22623
22900
  capScope: "device",
@@ -22630,6 +22907,12 @@ Object.freeze({
22630
22907
  addonId: null,
22631
22908
  access: "view"
22632
22909
  },
22910
+ "pipelineAnalytics.pruneEvents": {
22911
+ capName: "pipeline-analytics",
22912
+ capScope: "device",
22913
+ addonId: null,
22914
+ access: "create"
22915
+ },
22633
22916
  "pipelineAnalytics.pruneEventsBefore": {
22634
22917
  capName: "pipeline-analytics",
22635
22918
  capScope: "device",
@@ -23392,6 +23675,12 @@ Object.freeze({
23392
23675
  addonId: null,
23393
23676
  access: "create"
23394
23677
  },
23678
+ "recording.deleteFootprint": {
23679
+ capName: "recording",
23680
+ capScope: "system",
23681
+ addonId: null,
23682
+ access: "delete"
23683
+ },
23395
23684
  "recording.getAvailability": {
23396
23685
  capName: "recording",
23397
23686
  capScope: "system",
@@ -23422,6 +23711,12 @@ Object.freeze({
23422
23711
  addonId: null,
23423
23712
  access: "view"
23424
23713
  },
23714
+ "recording.listOpsLog": {
23715
+ capName: "recording",
23716
+ capScope: "system",
23717
+ addonId: null,
23718
+ access: "view"
23719
+ },
23425
23720
  "recording.locateSegment": {
23426
23721
  capName: "recording",
23427
23722
  capScope: "system",
@@ -23452,6 +23747,42 @@ Object.freeze({
23452
23747
  addonId: null,
23453
23748
  access: "create"
23454
23749
  },
23750
+ "recordingExport.cancelExport": {
23751
+ capName: "recordingExport",
23752
+ capScope: "system",
23753
+ addonId: null,
23754
+ access: "create"
23755
+ },
23756
+ "recordingExport.createExport": {
23757
+ capName: "recordingExport",
23758
+ capScope: "system",
23759
+ addonId: null,
23760
+ access: "create"
23761
+ },
23762
+ "recordingExport.deleteExport": {
23763
+ capName: "recordingExport",
23764
+ capScope: "system",
23765
+ addonId: null,
23766
+ access: "delete"
23767
+ },
23768
+ "recordingExport.getDownloadUrl": {
23769
+ capName: "recordingExport",
23770
+ capScope: "system",
23771
+ addonId: null,
23772
+ access: "view"
23773
+ },
23774
+ "recordingExport.getExport": {
23775
+ capName: "recordingExport",
23776
+ capScope: "system",
23777
+ addonId: null,
23778
+ access: "view"
23779
+ },
23780
+ "recordingExport.listExports": {
23781
+ capName: "recordingExport",
23782
+ capScope: "system",
23783
+ addonId: null,
23784
+ access: "view"
23785
+ },
23455
23786
  "sceneMonitor.captureReference": {
23456
23787
  capName: "scene-monitor",
23457
23788
  capScope: "device",
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { randomUUID } from "node:crypto";
2
- //#region ../types/dist/event-category-H4AVePnn.mjs
2
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -152,6 +152,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
152
152
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
153
153
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
154
154
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
155
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
156
+ * progress bar the client reconciles via `recordingExport.getExport`. */
157
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
158
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
159
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
155
160
  EventCategory["DetectionEvent"] = "detection.event";
156
161
  EventCategory["SessionTrackNew"] = "session.track.new";
157
162
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -441,6 +446,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
441
446
  */
442
447
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
443
448
  /**
449
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
450
+ * a package zone — a newly-appeared stationary object of a package class
451
+ * that cleared the class / zone / dwell / size gates. Payload:
452
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
453
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
454
+ * Telemetry (D8): the durable record is the `package-events` store row;
455
+ * this bus topic drives notifier rules + live UI. See
456
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
457
+ */
458
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
459
+ /**
460
+ * Fired by `addon-post-analysis` when a previously-delivered package
461
+ * leaves its zone (the stationary entry departed — moved or swept).
462
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
463
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
464
+ * Telemetry (D8). See package-zones-design §5.2.
465
+ */
466
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
467
+ /**
444
468
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
445
469
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
446
470
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -5179,6 +5203,25 @@ function _instanceof(cls, params = {}) {
5179
5203
  };
5180
5204
  return inst;
5181
5205
  }
5206
+ //#endregion
5207
+ //#region ../../node_modules/zod/v4/classic/compat.js
5208
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5209
+ var ZodIssueCode = {
5210
+ invalid_type: "invalid_type",
5211
+ too_big: "too_big",
5212
+ too_small: "too_small",
5213
+ invalid_format: "invalid_format",
5214
+ not_multiple_of: "not_multiple_of",
5215
+ unrecognized_keys: "unrecognized_keys",
5216
+ invalid_union: "invalid_union",
5217
+ invalid_key: "invalid_key",
5218
+ invalid_element: "invalid_element",
5219
+ invalid_value: "invalid_value",
5220
+ custom: "custom"
5221
+ };
5222
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5223
+ var ZodFirstPartyTypeKind;
5224
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5182
5225
  Object.fromEntries([
5183
5226
  {
5184
5227
  id: "overview",
@@ -7297,6 +7340,62 @@ var RecordingConfigSchema = object({
7297
7340
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7298
7341
  });
7299
7342
  /**
7343
+ * Ops-log — the durable, append-only operations audit shared by the
7344
+ * recordings and events management surfaces.
7345
+ *
7346
+ * ONE row shape is reused for both domains so a single "Activity" view can
7347
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7348
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7349
+ * management operation, WHY it ran (reason), and its measurable effect
7350
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7351
+ * never fail the operation it records.
7352
+ */
7353
+ /** Which management domain the operation belongs to. */
7354
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7355
+ /** The kind of management operation performed. */
7356
+ var OpsLogOpSchema = _enum([
7357
+ "prune",
7358
+ "manual-delete",
7359
+ "rescan",
7360
+ "retention-run"
7361
+ ]);
7362
+ /** Why the operation ran. */
7363
+ var OpsLogReasonSchema = _enum([
7364
+ "retention",
7365
+ "quota",
7366
+ "manual",
7367
+ "operator"
7368
+ ]);
7369
+ /** One audit row, shared verbatim by both domains. */
7370
+ var OpsLogEntrySchema = object({
7371
+ /** Unique row id. */
7372
+ id: string(),
7373
+ /** Epoch ms the operation completed. */
7374
+ at: number(),
7375
+ domain: OpsLogDomainSchema,
7376
+ op: OpsLogOpSchema,
7377
+ reason: OpsLogReasonSchema,
7378
+ /** The camera the op targeted; null for a cluster/global op. */
7379
+ deviceId: number().nullable(),
7380
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7381
+ nodeId: string(),
7382
+ /** Buckets / rows deleted (op-specific unit). */
7383
+ itemsAffected: number(),
7384
+ /** Bytes reclaimed by the op (0 when not measurable). */
7385
+ bytesReclaimed: number(),
7386
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7387
+ detail: string().nullable(),
7388
+ /** Who/what triggered the op. */
7389
+ actor: string()
7390
+ });
7391
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7392
+ var OpsLogQueryInputSchema = object({
7393
+ /** Restrict to a single camera; omit for every row. */
7394
+ deviceId: number().optional(),
7395
+ /** Max rows returned, newest-first. */
7396
+ limit: number().int().min(1).max(1e3).optional()
7397
+ });
7398
+ /**
7300
7399
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7301
7400
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7302
7401
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -12546,7 +12645,11 @@ array(ZoneRuleSchema).readonly();
12546
12645
  * Extend the enum here when a new gating consumer comes online (audio
12547
12646
  * gating, alert filtering, …) — no other surface needs to change.
12548
12647
  */
12549
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
12648
+ var ZoneRuleStageEnum = _enum([
12649
+ "motion",
12650
+ "detection",
12651
+ "package"
12652
+ ]);
12550
12653
  DeviceType.Camera, method(object({
12551
12654
  deviceId: number(),
12552
12655
  stage: ZoneRuleStageEnum
@@ -12559,7 +12662,8 @@ DeviceType.Camera, method(object({
12559
12662
  auth: "admin"
12560
12663
  }), object({
12561
12664
  motion: array(ZoneRuleSchema).readonly(),
12562
- detection: array(ZoneRuleSchema).readonly()
12665
+ detection: array(ZoneRuleSchema).readonly(),
12666
+ package: array(ZoneRuleSchema).readonly()
12563
12667
  });
12564
12668
  var ProviderStatusSchema = object({
12565
12669
  connected: boolean(),
@@ -15872,6 +15976,7 @@ var EventKindIconSchema = _enum([
15872
15976
  "smoke",
15873
15977
  "water",
15874
15978
  "button",
15979
+ "package",
15875
15980
  "generic"
15876
15981
  ]);
15877
15982
  var EventKindCategorySchema = _enum([
@@ -15879,7 +15984,8 @@ var EventKindCategorySchema = _enum([
15879
15984
  "audio",
15880
15985
  "detection",
15881
15986
  "sensor",
15882
- "custom"
15987
+ "custom",
15988
+ "package"
15883
15989
  ]);
15884
15990
  var EventKindDescriptorSchema = object({
15885
15991
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -16220,6 +16326,26 @@ var TrackCascadeCountsSchema = object({
16220
16326
  /** Per-track CLIP search vectors removed (best-effort). */
16221
16327
  embeddings: number().int()
16222
16328
  });
16329
+ /** Event-store footprint for one camera. */
16330
+ var EventStoreDeviceFootprintSchema = object({
16331
+ deviceId: number(),
16332
+ /** Persisted event rows (motion + object + audio) for the camera. */
16333
+ rows: number().int(),
16334
+ /** Event-owned media bytes on disk for the camera. */
16335
+ bytes: number().int()
16336
+ });
16337
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16338
+ var EventStoreFootprintSchema = object({
16339
+ totalRows: number().int(),
16340
+ totalBytes: number().int(),
16341
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16342
+ });
16343
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16344
+ var EventPruneCountsSchema = object({
16345
+ motion: number().int(),
16346
+ object: number().int(),
16347
+ audio: number().int()
16348
+ });
16223
16349
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16224
16350
  deviceId: number(),
16225
16351
  trackId: string()
@@ -16283,6 +16409,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16283
16409
  }), {
16284
16410
  kind: "mutation",
16285
16411
  auth: "admin"
16412
+ }), method(object({}), EventStoreFootprintSchema, {
16413
+ kind: "query",
16414
+ auth: "admin"
16415
+ }), method(object({
16416
+ olderThanMs: number(),
16417
+ reason: OpsLogReasonSchema.optional()
16418
+ }), EventPruneCountsSchema, {
16419
+ kind: "mutation",
16420
+ auth: "admin"
16421
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16422
+ kind: "mutation",
16423
+ auth: "admin"
16424
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16425
+ kind: "query",
16426
+ auth: "admin"
16286
16427
  }), method(object({
16287
16428
  eventId: string(),
16288
16429
  kind: MediaFileKindEnum.optional()
@@ -19516,13 +19657,131 @@ method(object({
19516
19657
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19517
19658
  kind: "mutation",
19518
19659
  auth: "admin"
19519
- }), method(object({ deviceId: number() }), object({
19660
+ }), method(object({
19661
+ deviceId: number(),
19662
+ reason: OpsLogReasonSchema.optional()
19663
+ }), object({
19520
19664
  floorMs: number().nullable(),
19521
19665
  deletedBuckets: number().int(),
19522
19666
  reclaimedBytes: number().int()
19523
19667
  }), {
19524
19668
  kind: "mutation",
19525
19669
  auth: "admin"
19670
+ }), method(object({
19671
+ deviceId: number(),
19672
+ fromMs: number().optional(),
19673
+ toMs: number().optional()
19674
+ }), object({
19675
+ deletedBuckets: number().int(),
19676
+ reclaimedBytes: number().int()
19677
+ }), {
19678
+ kind: "mutation",
19679
+ auth: "admin"
19680
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19681
+ kind: "query",
19682
+ auth: "admin"
19683
+ });
19684
+ /**
19685
+ * `recordingExport` cap — render a footage time range into a single downloadable
19686
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
19687
+ * bounded lifetime with a durable history, auto-expiry, and optional
19688
+ * delete-after-download.
19689
+ *
19690
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
19691
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
19692
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
19693
+ * input and dispatch to that single provider; the render runs on the node that
19694
+ * owns the footage (no cross-node segment transfer). Download rides the
19695
+ * framework addon data-plane. State persists in a DurableState blob (NOT
19696
+ * SQLite); history rows survive file deletion for audit.
19697
+ */
19698
+ /** Playback-speed multiplier for the render (1 = realtime). */
19699
+ var ExportSpeedSchema = number().min(.25).max(32);
19700
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
19701
+ var ExportTimelapseSchema = object({
19702
+ everyMs: number().int().positive(),
19703
+ outputFps: number().int().min(1).max(60).optional()
19704
+ });
19705
+ /**
19706
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
19707
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
19708
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
19709
+ * `deleteAfterDownload` removes it shortly after the first complete download.
19710
+ */
19711
+ var ExportOptionsSchema = object({
19712
+ speed: ExportSpeedSchema.optional(),
19713
+ timelapse: ExportTimelapseSchema.optional(),
19714
+ includeAudio: boolean(),
19715
+ maxLifeMs: number().int().positive(),
19716
+ deleteAfterDownload: boolean(),
19717
+ title: string().max(200).optional()
19718
+ }).superRefine((v, ctx) => {
19719
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
19720
+ code: ZodIssueCode.custom,
19721
+ message: "speed and timelapse are mutually exclusive",
19722
+ path: ["timelapse"]
19723
+ });
19724
+ });
19725
+ var ExportStateSchema = _enum([
19726
+ "queued",
19727
+ "rendering",
19728
+ "ready",
19729
+ "failed",
19730
+ "expired",
19731
+ "deleted"
19732
+ ]);
19733
+ /** One export job / history row. */
19734
+ var ExportRecordSchema = object({
19735
+ id: string(),
19736
+ deviceId: number(),
19737
+ profile: string(),
19738
+ fromMs: number(),
19739
+ toMs: number(),
19740
+ options: ExportOptionsSchema,
19741
+ state: ExportStateSchema,
19742
+ /** 0–100 while rendering; null otherwise. */
19743
+ progressPct: number().nullable(),
19744
+ /** File size once ready; null before. */
19745
+ fileBytes: number().nullable(),
19746
+ expiresAt: number(),
19747
+ deleteAfterDownload: boolean(),
19748
+ /** Epoch of the first complete download; null until then. */
19749
+ downloadedAt: number().nullable(),
19750
+ createdAt: number(),
19751
+ /** User id/name that requested the export. */
19752
+ createdBy: string(),
19753
+ /** Failure reason when state is 'failed'; null otherwise. */
19754
+ error: string().nullable()
19755
+ });
19756
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
19757
+ var ExportDownloadSchema = object({
19758
+ url: string(),
19759
+ endpoints: array(string())
19760
+ });
19761
+ method(object({
19762
+ deviceId: number(),
19763
+ profile: string(),
19764
+ fromMs: number(),
19765
+ toMs: number(),
19766
+ options: ExportOptionsSchema
19767
+ }), ExportRecordSchema, {
19768
+ kind: "mutation",
19769
+ auth: "protected"
19770
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
19771
+ kind: "query",
19772
+ auth: "protected"
19773
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19774
+ kind: "query",
19775
+ auth: "protected"
19776
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19777
+ kind: "mutation",
19778
+ auth: "protected"
19779
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19780
+ kind: "mutation",
19781
+ auth: "protected"
19782
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
19783
+ kind: "query",
19784
+ auth: "protected"
19526
19785
  });
19527
19786
  /**
19528
19787
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -22542,6 +22801,12 @@ Object.freeze({
22542
22801
  addonId: null,
22543
22802
  access: "delete"
22544
22803
  },
22804
+ "pipelineAnalytics.deleteDeviceEvents": {
22805
+ capName: "pipeline-analytics",
22806
+ capScope: "device",
22807
+ addonId: null,
22808
+ access: "delete"
22809
+ },
22545
22810
  "pipelineAnalytics.deleteTracks": {
22546
22811
  capName: "pipeline-analytics",
22547
22812
  capScope: "device",
@@ -22572,6 +22837,12 @@ Object.freeze({
22572
22837
  addonId: null,
22573
22838
  access: "view"
22574
22839
  },
22840
+ "pipelineAnalytics.getEventStoreFootprint": {
22841
+ capName: "pipeline-analytics",
22842
+ capScope: "device",
22843
+ addonId: null,
22844
+ access: "view"
22845
+ },
22575
22846
  "pipelineAnalytics.getKeyEvents": {
22576
22847
  capName: "pipeline-analytics",
22577
22848
  capScope: "device",
@@ -22614,6 +22885,12 @@ Object.freeze({
22614
22885
  addonId: null,
22615
22886
  access: "view"
22616
22887
  },
22888
+ "pipelineAnalytics.listOpsLog": {
22889
+ capName: "pipeline-analytics",
22890
+ capScope: "device",
22891
+ addonId: null,
22892
+ access: "view"
22893
+ },
22617
22894
  "pipelineAnalytics.listRecentTracks": {
22618
22895
  capName: "pipeline-analytics",
22619
22896
  capScope: "device",
@@ -22626,6 +22903,12 @@ Object.freeze({
22626
22903
  addonId: null,
22627
22904
  access: "view"
22628
22905
  },
22906
+ "pipelineAnalytics.pruneEvents": {
22907
+ capName: "pipeline-analytics",
22908
+ capScope: "device",
22909
+ addonId: null,
22910
+ access: "create"
22911
+ },
22629
22912
  "pipelineAnalytics.pruneEventsBefore": {
22630
22913
  capName: "pipeline-analytics",
22631
22914
  capScope: "device",
@@ -23388,6 +23671,12 @@ Object.freeze({
23388
23671
  addonId: null,
23389
23672
  access: "create"
23390
23673
  },
23674
+ "recording.deleteFootprint": {
23675
+ capName: "recording",
23676
+ capScope: "system",
23677
+ addonId: null,
23678
+ access: "delete"
23679
+ },
23391
23680
  "recording.getAvailability": {
23392
23681
  capName: "recording",
23393
23682
  capScope: "system",
@@ -23418,6 +23707,12 @@ Object.freeze({
23418
23707
  addonId: null,
23419
23708
  access: "view"
23420
23709
  },
23710
+ "recording.listOpsLog": {
23711
+ capName: "recording",
23712
+ capScope: "system",
23713
+ addonId: null,
23714
+ access: "view"
23715
+ },
23421
23716
  "recording.locateSegment": {
23422
23717
  capName: "recording",
23423
23718
  capScope: "system",
@@ -23448,6 +23743,42 @@ Object.freeze({
23448
23743
  addonId: null,
23449
23744
  access: "create"
23450
23745
  },
23746
+ "recordingExport.cancelExport": {
23747
+ capName: "recordingExport",
23748
+ capScope: "system",
23749
+ addonId: null,
23750
+ access: "create"
23751
+ },
23752
+ "recordingExport.createExport": {
23753
+ capName: "recordingExport",
23754
+ capScope: "system",
23755
+ addonId: null,
23756
+ access: "create"
23757
+ },
23758
+ "recordingExport.deleteExport": {
23759
+ capName: "recordingExport",
23760
+ capScope: "system",
23761
+ addonId: null,
23762
+ access: "delete"
23763
+ },
23764
+ "recordingExport.getDownloadUrl": {
23765
+ capName: "recordingExport",
23766
+ capScope: "system",
23767
+ addonId: null,
23768
+ access: "view"
23769
+ },
23770
+ "recordingExport.getExport": {
23771
+ capName: "recordingExport",
23772
+ capScope: "system",
23773
+ addonId: null,
23774
+ access: "view"
23775
+ },
23776
+ "recordingExport.listExports": {
23777
+ capName: "recordingExport",
23778
+ capScope: "system",
23779
+ addonId: null,
23780
+ access: "view"
23781
+ },
23451
23782
  "sceneMonitor.captureReference": {
23452
23783
  capName: "scene-monitor",
23453
23784
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-decoder-nodeav",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "description": "Standalone in-process node-av decoder addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",