@camstack/addon-decoder-ffmpeg 1.1.16 → 1.1.18

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