@camstack/addon-remote-storage 1.1.26 → 1.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/s3.addon.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_shared = require("./shared-BU3WLevm.js");
5
+ const require_shared = require("./shared-EwybxG9c.js");
6
6
  let node_stream = require("node:stream");
7
7
  let _aws_sdk_client_s3 = require("@aws-sdk/client-s3");
8
8
  let _aws_sdk_lib_storage = require("@aws-sdk/lib-storage");
package/dist/s3.addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as BaseAddon, i as rearmIdleAbort, n as getOptionalBasePath, o as scheduleIdleAbort, s as storageProviderCapability, t as createSessionId } from "./shared-Djb5j9fy.mjs";
1
+ import { c as BaseAddon, i as rearmIdleAbort, n as getOptionalBasePath, o as scheduleIdleAbort, s as storageProviderCapability, t as createSessionId } from "./shared-DwOLwiOT.mjs";
2
2
  import { PassThrough } from "node:stream";
3
3
  import { DeleteObjectCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectsV2Command, PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
4
4
  import { Upload } from "@aws-sdk/lib-storage";
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_shared = require("./shared-BU3WLevm.js");
5
+ const require_shared = require("./shared-EwybxG9c.js");
6
6
  let ssh2 = require("ssh2");
7
7
  let node_path = require("node:path");
8
8
  node_path = require_shared.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-Djb5j9fy.mjs";
1
+ import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-DwOLwiOT.mjs";
2
2
  import { Client } from "ssh2";
3
3
  import * as path from "node:path";
4
4
  //#region src/providers/sftp/sftp-config-schema.ts
@@ -1,6 +1,6 @@
1
1
  import * as path from "node:path";
2
2
  import { randomUUID } from "node:crypto";
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",
@@ -7286,6 +7329,62 @@ var RecordingConfigSchema = object({
7286
7329
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7287
7330
  });
7288
7331
  /**
7332
+ * Ops-log — the durable, append-only operations audit shared by the
7333
+ * recordings and events management surfaces.
7334
+ *
7335
+ * ONE row shape is reused for both domains so a single "Activity" view can
7336
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7337
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7338
+ * management operation, WHY it ran (reason), and its measurable effect
7339
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7340
+ * never fail the operation it records.
7341
+ */
7342
+ /** Which management domain the operation belongs to. */
7343
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7344
+ /** The kind of management operation performed. */
7345
+ var OpsLogOpSchema = _enum([
7346
+ "prune",
7347
+ "manual-delete",
7348
+ "rescan",
7349
+ "retention-run"
7350
+ ]);
7351
+ /** Why the operation ran. */
7352
+ var OpsLogReasonSchema = _enum([
7353
+ "retention",
7354
+ "quota",
7355
+ "manual",
7356
+ "operator"
7357
+ ]);
7358
+ /** One audit row, shared verbatim by both domains. */
7359
+ var OpsLogEntrySchema = object({
7360
+ /** Unique row id. */
7361
+ id: string(),
7362
+ /** Epoch ms the operation completed. */
7363
+ at: number(),
7364
+ domain: OpsLogDomainSchema,
7365
+ op: OpsLogOpSchema,
7366
+ reason: OpsLogReasonSchema,
7367
+ /** The camera the op targeted; null for a cluster/global op. */
7368
+ deviceId: number().nullable(),
7369
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7370
+ nodeId: string(),
7371
+ /** Buckets / rows deleted (op-specific unit). */
7372
+ itemsAffected: number(),
7373
+ /** Bytes reclaimed by the op (0 when not measurable). */
7374
+ bytesReclaimed: number(),
7375
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7376
+ detail: string().nullable(),
7377
+ /** Who/what triggered the op. */
7378
+ actor: string()
7379
+ });
7380
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7381
+ var OpsLogQueryInputSchema = object({
7382
+ /** Restrict to a single camera; omit for every row. */
7383
+ deviceId: number().optional(),
7384
+ /** Max rows returned, newest-first. */
7385
+ limit: number().int().min(1).max(1e3).optional()
7386
+ });
7387
+ /**
7289
7388
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7290
7389
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7291
7390
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -12535,7 +12634,11 @@ array(ZoneRuleSchema).readonly();
12535
12634
  * Extend the enum here when a new gating consumer comes online (audio
12536
12635
  * gating, alert filtering, …) — no other surface needs to change.
12537
12636
  */
12538
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
12637
+ var ZoneRuleStageEnum = _enum([
12638
+ "motion",
12639
+ "detection",
12640
+ "package"
12641
+ ]);
12539
12642
  DeviceType.Camera, method(object({
12540
12643
  deviceId: number(),
12541
12644
  stage: ZoneRuleStageEnum
@@ -12548,7 +12651,8 @@ DeviceType.Camera, method(object({
12548
12651
  auth: "admin"
12549
12652
  }), object({
12550
12653
  motion: array(ZoneRuleSchema).readonly(),
12551
- detection: array(ZoneRuleSchema).readonly()
12654
+ detection: array(ZoneRuleSchema).readonly(),
12655
+ package: array(ZoneRuleSchema).readonly()
12552
12656
  });
12553
12657
  var ProviderStatusSchema = object({
12554
12658
  connected: boolean(),
@@ -15731,6 +15835,7 @@ var EventKindIconSchema = _enum([
15731
15835
  "smoke",
15732
15836
  "water",
15733
15837
  "button",
15838
+ "package",
15734
15839
  "generic"
15735
15840
  ]);
15736
15841
  var EventKindCategorySchema = _enum([
@@ -15738,7 +15843,8 @@ var EventKindCategorySchema = _enum([
15738
15843
  "audio",
15739
15844
  "detection",
15740
15845
  "sensor",
15741
- "custom"
15846
+ "custom",
15847
+ "package"
15742
15848
  ]);
15743
15849
  var EventKindDescriptorSchema = object({
15744
15850
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -16079,6 +16185,26 @@ var TrackCascadeCountsSchema = object({
16079
16185
  /** Per-track CLIP search vectors removed (best-effort). */
16080
16186
  embeddings: number().int()
16081
16187
  });
16188
+ /** Event-store footprint for one camera. */
16189
+ var EventStoreDeviceFootprintSchema = object({
16190
+ deviceId: number(),
16191
+ /** Persisted event rows (motion + object + audio) for the camera. */
16192
+ rows: number().int(),
16193
+ /** Event-owned media bytes on disk for the camera. */
16194
+ bytes: number().int()
16195
+ });
16196
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16197
+ var EventStoreFootprintSchema = object({
16198
+ totalRows: number().int(),
16199
+ totalBytes: number().int(),
16200
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16201
+ });
16202
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16203
+ var EventPruneCountsSchema = object({
16204
+ motion: number().int(),
16205
+ object: number().int(),
16206
+ audio: number().int()
16207
+ });
16082
16208
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16083
16209
  deviceId: number(),
16084
16210
  trackId: string()
@@ -16142,6 +16268,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16142
16268
  }), {
16143
16269
  kind: "mutation",
16144
16270
  auth: "admin"
16271
+ }), method(object({}), EventStoreFootprintSchema, {
16272
+ kind: "query",
16273
+ auth: "admin"
16274
+ }), method(object({
16275
+ olderThanMs: number(),
16276
+ reason: OpsLogReasonSchema.optional()
16277
+ }), EventPruneCountsSchema, {
16278
+ kind: "mutation",
16279
+ auth: "admin"
16280
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16281
+ kind: "mutation",
16282
+ auth: "admin"
16283
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16284
+ kind: "query",
16285
+ auth: "admin"
16145
16286
  }), method(object({
16146
16287
  eventId: string(),
16147
16288
  kind: MediaFileKindEnum.optional()
@@ -19420,13 +19561,131 @@ method(object({
19420
19561
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19421
19562
  kind: "mutation",
19422
19563
  auth: "admin"
19423
- }), method(object({ deviceId: number() }), object({
19564
+ }), method(object({
19565
+ deviceId: number(),
19566
+ reason: OpsLogReasonSchema.optional()
19567
+ }), object({
19424
19568
  floorMs: number().nullable(),
19425
19569
  deletedBuckets: number().int(),
19426
19570
  reclaimedBytes: number().int()
19427
19571
  }), {
19428
19572
  kind: "mutation",
19429
19573
  auth: "admin"
19574
+ }), method(object({
19575
+ deviceId: number(),
19576
+ fromMs: number().optional(),
19577
+ toMs: number().optional()
19578
+ }), object({
19579
+ deletedBuckets: number().int(),
19580
+ reclaimedBytes: number().int()
19581
+ }), {
19582
+ kind: "mutation",
19583
+ auth: "admin"
19584
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19585
+ kind: "query",
19586
+ auth: "admin"
19587
+ });
19588
+ /**
19589
+ * `recordingExport` cap — render a footage time range into a single downloadable
19590
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
19591
+ * bounded lifetime with a durable history, auto-expiry, and optional
19592
+ * delete-after-download.
19593
+ *
19594
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
19595
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
19596
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
19597
+ * input and dispatch to that single provider; the render runs on the node that
19598
+ * owns the footage (no cross-node segment transfer). Download rides the
19599
+ * framework addon data-plane. State persists in a DurableState blob (NOT
19600
+ * SQLite); history rows survive file deletion for audit.
19601
+ */
19602
+ /** Playback-speed multiplier for the render (1 = realtime). */
19603
+ var ExportSpeedSchema = number().min(.25).max(32);
19604
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
19605
+ var ExportTimelapseSchema = object({
19606
+ everyMs: number().int().positive(),
19607
+ outputFps: number().int().min(1).max(60).optional()
19608
+ });
19609
+ /**
19610
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
19611
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
19612
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
19613
+ * `deleteAfterDownload` removes it shortly after the first complete download.
19614
+ */
19615
+ var ExportOptionsSchema = object({
19616
+ speed: ExportSpeedSchema.optional(),
19617
+ timelapse: ExportTimelapseSchema.optional(),
19618
+ includeAudio: boolean(),
19619
+ maxLifeMs: number().int().positive(),
19620
+ deleteAfterDownload: boolean(),
19621
+ title: string().max(200).optional()
19622
+ }).superRefine((v, ctx) => {
19623
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
19624
+ code: ZodIssueCode.custom,
19625
+ message: "speed and timelapse are mutually exclusive",
19626
+ path: ["timelapse"]
19627
+ });
19628
+ });
19629
+ var ExportStateSchema = _enum([
19630
+ "queued",
19631
+ "rendering",
19632
+ "ready",
19633
+ "failed",
19634
+ "expired",
19635
+ "deleted"
19636
+ ]);
19637
+ /** One export job / history row. */
19638
+ var ExportRecordSchema = object({
19639
+ id: string(),
19640
+ deviceId: number(),
19641
+ profile: string(),
19642
+ fromMs: number(),
19643
+ toMs: number(),
19644
+ options: ExportOptionsSchema,
19645
+ state: ExportStateSchema,
19646
+ /** 0–100 while rendering; null otherwise. */
19647
+ progressPct: number().nullable(),
19648
+ /** File size once ready; null before. */
19649
+ fileBytes: number().nullable(),
19650
+ expiresAt: number(),
19651
+ deleteAfterDownload: boolean(),
19652
+ /** Epoch of the first complete download; null until then. */
19653
+ downloadedAt: number().nullable(),
19654
+ createdAt: number(),
19655
+ /** User id/name that requested the export. */
19656
+ createdBy: string(),
19657
+ /** Failure reason when state is 'failed'; null otherwise. */
19658
+ error: string().nullable()
19659
+ });
19660
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
19661
+ var ExportDownloadSchema = object({
19662
+ url: string(),
19663
+ endpoints: array(string())
19664
+ });
19665
+ method(object({
19666
+ deviceId: number(),
19667
+ profile: string(),
19668
+ fromMs: number(),
19669
+ toMs: number(),
19670
+ options: ExportOptionsSchema
19671
+ }), ExportRecordSchema, {
19672
+ kind: "mutation",
19673
+ auth: "protected"
19674
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
19675
+ kind: "query",
19676
+ auth: "protected"
19677
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19678
+ kind: "query",
19679
+ auth: "protected"
19680
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19681
+ kind: "mutation",
19682
+ auth: "protected"
19683
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19684
+ kind: "mutation",
19685
+ auth: "protected"
19686
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
19687
+ kind: "query",
19688
+ auth: "protected"
19430
19689
  });
19431
19690
  /**
19432
19691
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -22446,6 +22705,12 @@ Object.freeze({
22446
22705
  addonId: null,
22447
22706
  access: "delete"
22448
22707
  },
22708
+ "pipelineAnalytics.deleteDeviceEvents": {
22709
+ capName: "pipeline-analytics",
22710
+ capScope: "device",
22711
+ addonId: null,
22712
+ access: "delete"
22713
+ },
22449
22714
  "pipelineAnalytics.deleteTracks": {
22450
22715
  capName: "pipeline-analytics",
22451
22716
  capScope: "device",
@@ -22476,6 +22741,12 @@ Object.freeze({
22476
22741
  addonId: null,
22477
22742
  access: "view"
22478
22743
  },
22744
+ "pipelineAnalytics.getEventStoreFootprint": {
22745
+ capName: "pipeline-analytics",
22746
+ capScope: "device",
22747
+ addonId: null,
22748
+ access: "view"
22749
+ },
22479
22750
  "pipelineAnalytics.getKeyEvents": {
22480
22751
  capName: "pipeline-analytics",
22481
22752
  capScope: "device",
@@ -22518,6 +22789,12 @@ Object.freeze({
22518
22789
  addonId: null,
22519
22790
  access: "view"
22520
22791
  },
22792
+ "pipelineAnalytics.listOpsLog": {
22793
+ capName: "pipeline-analytics",
22794
+ capScope: "device",
22795
+ addonId: null,
22796
+ access: "view"
22797
+ },
22521
22798
  "pipelineAnalytics.listRecentTracks": {
22522
22799
  capName: "pipeline-analytics",
22523
22800
  capScope: "device",
@@ -22530,6 +22807,12 @@ Object.freeze({
22530
22807
  addonId: null,
22531
22808
  access: "view"
22532
22809
  },
22810
+ "pipelineAnalytics.pruneEvents": {
22811
+ capName: "pipeline-analytics",
22812
+ capScope: "device",
22813
+ addonId: null,
22814
+ access: "create"
22815
+ },
22533
22816
  "pipelineAnalytics.pruneEventsBefore": {
22534
22817
  capName: "pipeline-analytics",
22535
22818
  capScope: "device",
@@ -23292,6 +23575,12 @@ Object.freeze({
23292
23575
  addonId: null,
23293
23576
  access: "create"
23294
23577
  },
23578
+ "recording.deleteFootprint": {
23579
+ capName: "recording",
23580
+ capScope: "system",
23581
+ addonId: null,
23582
+ access: "delete"
23583
+ },
23295
23584
  "recording.getAvailability": {
23296
23585
  capName: "recording",
23297
23586
  capScope: "system",
@@ -23322,6 +23611,12 @@ Object.freeze({
23322
23611
  addonId: null,
23323
23612
  access: "view"
23324
23613
  },
23614
+ "recording.listOpsLog": {
23615
+ capName: "recording",
23616
+ capScope: "system",
23617
+ addonId: null,
23618
+ access: "view"
23619
+ },
23325
23620
  "recording.locateSegment": {
23326
23621
  capName: "recording",
23327
23622
  capScope: "system",
@@ -23352,6 +23647,42 @@ Object.freeze({
23352
23647
  addonId: null,
23353
23648
  access: "create"
23354
23649
  },
23650
+ "recordingExport.cancelExport": {
23651
+ capName: "recordingExport",
23652
+ capScope: "system",
23653
+ addonId: null,
23654
+ access: "create"
23655
+ },
23656
+ "recordingExport.createExport": {
23657
+ capName: "recordingExport",
23658
+ capScope: "system",
23659
+ addonId: null,
23660
+ access: "create"
23661
+ },
23662
+ "recordingExport.deleteExport": {
23663
+ capName: "recordingExport",
23664
+ capScope: "system",
23665
+ addonId: null,
23666
+ access: "delete"
23667
+ },
23668
+ "recordingExport.getDownloadUrl": {
23669
+ capName: "recordingExport",
23670
+ capScope: "system",
23671
+ addonId: null,
23672
+ access: "view"
23673
+ },
23674
+ "recordingExport.getExport": {
23675
+ capName: "recordingExport",
23676
+ capScope: "system",
23677
+ addonId: null,
23678
+ access: "view"
23679
+ },
23680
+ "recordingExport.listExports": {
23681
+ capName: "recordingExport",
23682
+ capScope: "system",
23683
+ addonId: null,
23684
+ access: "view"
23685
+ },
23355
23686
  "sceneMonitor.captureReference": {
23356
23687
  capName: "scene-monitor",
23357
23688
  capScope: "device",
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  let node_path = require("node:path");
24
24
  node_path = __toESM(node_path);
25
25
  let node_crypto = require("node:crypto");
26
- //#region ../types/dist/event-category-H4AVePnn.mjs
26
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
27
27
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
28
28
  EventCategory["SystemBoot"] = "system.boot";
29
29
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -176,6 +176,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
176
176
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
177
177
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
178
178
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
179
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
180
+ * progress bar the client reconciles via `recordingExport.getExport`. */
181
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
182
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
183
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
179
184
  EventCategory["DetectionEvent"] = "detection.event";
180
185
  EventCategory["SessionTrackNew"] = "session.track.new";
181
186
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -465,6 +470,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
465
470
  */
466
471
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
467
472
  /**
473
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
474
+ * a package zone — a newly-appeared stationary object of a package class
475
+ * that cleared the class / zone / dwell / size gates. Payload:
476
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
477
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
478
+ * Telemetry (D8): the durable record is the `package-events` store row;
479
+ * this bus topic drives notifier rules + live UI. See
480
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
481
+ */
482
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
483
+ /**
484
+ * Fired by `addon-post-analysis` when a previously-delivered package
485
+ * leaves its zone (the stationary entry departed — moved or swept).
486
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
487
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
488
+ * Telemetry (D8). See package-zones-design §5.2.
489
+ */
490
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
491
+ /**
468
492
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
469
493
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
470
494
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -5203,6 +5227,25 @@ function _instanceof(cls, params = {}) {
5203
5227
  };
5204
5228
  return inst;
5205
5229
  }
5230
+ //#endregion
5231
+ //#region ../../node_modules/zod/v4/classic/compat.js
5232
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5233
+ var ZodIssueCode = {
5234
+ invalid_type: "invalid_type",
5235
+ too_big: "too_big",
5236
+ too_small: "too_small",
5237
+ invalid_format: "invalid_format",
5238
+ not_multiple_of: "not_multiple_of",
5239
+ unrecognized_keys: "unrecognized_keys",
5240
+ invalid_union: "invalid_union",
5241
+ invalid_key: "invalid_key",
5242
+ invalid_element: "invalid_element",
5243
+ invalid_value: "invalid_value",
5244
+ custom: "custom"
5245
+ };
5246
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5247
+ var ZodFirstPartyTypeKind;
5248
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5206
5249
  Object.fromEntries([
5207
5250
  {
5208
5251
  id: "overview",
@@ -7309,6 +7352,62 @@ var RecordingConfigSchema = object({
7309
7352
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7310
7353
  });
7311
7354
  /**
7355
+ * Ops-log — the durable, append-only operations audit shared by the
7356
+ * recordings and events management surfaces.
7357
+ *
7358
+ * ONE row shape is reused for both domains so a single "Activity" view can
7359
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7360
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7361
+ * management operation, WHY it ran (reason), and its measurable effect
7362
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7363
+ * never fail the operation it records.
7364
+ */
7365
+ /** Which management domain the operation belongs to. */
7366
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7367
+ /** The kind of management operation performed. */
7368
+ var OpsLogOpSchema = _enum([
7369
+ "prune",
7370
+ "manual-delete",
7371
+ "rescan",
7372
+ "retention-run"
7373
+ ]);
7374
+ /** Why the operation ran. */
7375
+ var OpsLogReasonSchema = _enum([
7376
+ "retention",
7377
+ "quota",
7378
+ "manual",
7379
+ "operator"
7380
+ ]);
7381
+ /** One audit row, shared verbatim by both domains. */
7382
+ var OpsLogEntrySchema = object({
7383
+ /** Unique row id. */
7384
+ id: string(),
7385
+ /** Epoch ms the operation completed. */
7386
+ at: number(),
7387
+ domain: OpsLogDomainSchema,
7388
+ op: OpsLogOpSchema,
7389
+ reason: OpsLogReasonSchema,
7390
+ /** The camera the op targeted; null for a cluster/global op. */
7391
+ deviceId: number().nullable(),
7392
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7393
+ nodeId: string(),
7394
+ /** Buckets / rows deleted (op-specific unit). */
7395
+ itemsAffected: number(),
7396
+ /** Bytes reclaimed by the op (0 when not measurable). */
7397
+ bytesReclaimed: number(),
7398
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7399
+ detail: string().nullable(),
7400
+ /** Who/what triggered the op. */
7401
+ actor: string()
7402
+ });
7403
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7404
+ var OpsLogQueryInputSchema = object({
7405
+ /** Restrict to a single camera; omit for every row. */
7406
+ deviceId: number().optional(),
7407
+ /** Max rows returned, newest-first. */
7408
+ limit: number().int().min(1).max(1e3).optional()
7409
+ });
7410
+ /**
7312
7411
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7313
7412
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7314
7413
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -12558,7 +12657,11 @@ array(ZoneRuleSchema).readonly();
12558
12657
  * Extend the enum here when a new gating consumer comes online (audio
12559
12658
  * gating, alert filtering, …) — no other surface needs to change.
12560
12659
  */
12561
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
12660
+ var ZoneRuleStageEnum = _enum([
12661
+ "motion",
12662
+ "detection",
12663
+ "package"
12664
+ ]);
12562
12665
  DeviceType.Camera, method(object({
12563
12666
  deviceId: number(),
12564
12667
  stage: ZoneRuleStageEnum
@@ -12571,7 +12674,8 @@ DeviceType.Camera, method(object({
12571
12674
  auth: "admin"
12572
12675
  }), object({
12573
12676
  motion: array(ZoneRuleSchema).readonly(),
12574
- detection: array(ZoneRuleSchema).readonly()
12677
+ detection: array(ZoneRuleSchema).readonly(),
12678
+ package: array(ZoneRuleSchema).readonly()
12575
12679
  });
12576
12680
  var ProviderStatusSchema = object({
12577
12681
  connected: boolean(),
@@ -15754,6 +15858,7 @@ var EventKindIconSchema = _enum([
15754
15858
  "smoke",
15755
15859
  "water",
15756
15860
  "button",
15861
+ "package",
15757
15862
  "generic"
15758
15863
  ]);
15759
15864
  var EventKindCategorySchema = _enum([
@@ -15761,7 +15866,8 @@ var EventKindCategorySchema = _enum([
15761
15866
  "audio",
15762
15867
  "detection",
15763
15868
  "sensor",
15764
- "custom"
15869
+ "custom",
15870
+ "package"
15765
15871
  ]);
15766
15872
  var EventKindDescriptorSchema = object({
15767
15873
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -16102,6 +16208,26 @@ var TrackCascadeCountsSchema = object({
16102
16208
  /** Per-track CLIP search vectors removed (best-effort). */
16103
16209
  embeddings: number().int()
16104
16210
  });
16211
+ /** Event-store footprint for one camera. */
16212
+ var EventStoreDeviceFootprintSchema = object({
16213
+ deviceId: number(),
16214
+ /** Persisted event rows (motion + object + audio) for the camera. */
16215
+ rows: number().int(),
16216
+ /** Event-owned media bytes on disk for the camera. */
16217
+ bytes: number().int()
16218
+ });
16219
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16220
+ var EventStoreFootprintSchema = object({
16221
+ totalRows: number().int(),
16222
+ totalBytes: number().int(),
16223
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16224
+ });
16225
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16226
+ var EventPruneCountsSchema = object({
16227
+ motion: number().int(),
16228
+ object: number().int(),
16229
+ audio: number().int()
16230
+ });
16105
16231
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16106
16232
  deviceId: number(),
16107
16233
  trackId: string()
@@ -16165,6 +16291,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16165
16291
  }), {
16166
16292
  kind: "mutation",
16167
16293
  auth: "admin"
16294
+ }), method(object({}), EventStoreFootprintSchema, {
16295
+ kind: "query",
16296
+ auth: "admin"
16297
+ }), method(object({
16298
+ olderThanMs: number(),
16299
+ reason: OpsLogReasonSchema.optional()
16300
+ }), EventPruneCountsSchema, {
16301
+ kind: "mutation",
16302
+ auth: "admin"
16303
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16304
+ kind: "mutation",
16305
+ auth: "admin"
16306
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16307
+ kind: "query",
16308
+ auth: "admin"
16168
16309
  }), method(object({
16169
16310
  eventId: string(),
16170
16311
  kind: MediaFileKindEnum.optional()
@@ -19443,13 +19584,131 @@ method(object({
19443
19584
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19444
19585
  kind: "mutation",
19445
19586
  auth: "admin"
19446
- }), method(object({ deviceId: number() }), object({
19587
+ }), method(object({
19588
+ deviceId: number(),
19589
+ reason: OpsLogReasonSchema.optional()
19590
+ }), object({
19447
19591
  floorMs: number().nullable(),
19448
19592
  deletedBuckets: number().int(),
19449
19593
  reclaimedBytes: number().int()
19450
19594
  }), {
19451
19595
  kind: "mutation",
19452
19596
  auth: "admin"
19597
+ }), method(object({
19598
+ deviceId: number(),
19599
+ fromMs: number().optional(),
19600
+ toMs: number().optional()
19601
+ }), object({
19602
+ deletedBuckets: number().int(),
19603
+ reclaimedBytes: number().int()
19604
+ }), {
19605
+ kind: "mutation",
19606
+ auth: "admin"
19607
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19608
+ kind: "query",
19609
+ auth: "admin"
19610
+ });
19611
+ /**
19612
+ * `recordingExport` cap — render a footage time range into a single downloadable
19613
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
19614
+ * bounded lifetime with a durable history, auto-expiry, and optional
19615
+ * delete-after-download.
19616
+ *
19617
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
19618
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
19619
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
19620
+ * input and dispatch to that single provider; the render runs on the node that
19621
+ * owns the footage (no cross-node segment transfer). Download rides the
19622
+ * framework addon data-plane. State persists in a DurableState blob (NOT
19623
+ * SQLite); history rows survive file deletion for audit.
19624
+ */
19625
+ /** Playback-speed multiplier for the render (1 = realtime). */
19626
+ var ExportSpeedSchema = number().min(.25).max(32);
19627
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
19628
+ var ExportTimelapseSchema = object({
19629
+ everyMs: number().int().positive(),
19630
+ outputFps: number().int().min(1).max(60).optional()
19631
+ });
19632
+ /**
19633
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
19634
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
19635
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
19636
+ * `deleteAfterDownload` removes it shortly after the first complete download.
19637
+ */
19638
+ var ExportOptionsSchema = object({
19639
+ speed: ExportSpeedSchema.optional(),
19640
+ timelapse: ExportTimelapseSchema.optional(),
19641
+ includeAudio: boolean(),
19642
+ maxLifeMs: number().int().positive(),
19643
+ deleteAfterDownload: boolean(),
19644
+ title: string().max(200).optional()
19645
+ }).superRefine((v, ctx) => {
19646
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
19647
+ code: ZodIssueCode.custom,
19648
+ message: "speed and timelapse are mutually exclusive",
19649
+ path: ["timelapse"]
19650
+ });
19651
+ });
19652
+ var ExportStateSchema = _enum([
19653
+ "queued",
19654
+ "rendering",
19655
+ "ready",
19656
+ "failed",
19657
+ "expired",
19658
+ "deleted"
19659
+ ]);
19660
+ /** One export job / history row. */
19661
+ var ExportRecordSchema = object({
19662
+ id: string(),
19663
+ deviceId: number(),
19664
+ profile: string(),
19665
+ fromMs: number(),
19666
+ toMs: number(),
19667
+ options: ExportOptionsSchema,
19668
+ state: ExportStateSchema,
19669
+ /** 0–100 while rendering; null otherwise. */
19670
+ progressPct: number().nullable(),
19671
+ /** File size once ready; null before. */
19672
+ fileBytes: number().nullable(),
19673
+ expiresAt: number(),
19674
+ deleteAfterDownload: boolean(),
19675
+ /** Epoch of the first complete download; null until then. */
19676
+ downloadedAt: number().nullable(),
19677
+ createdAt: number(),
19678
+ /** User id/name that requested the export. */
19679
+ createdBy: string(),
19680
+ /** Failure reason when state is 'failed'; null otherwise. */
19681
+ error: string().nullable()
19682
+ });
19683
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
19684
+ var ExportDownloadSchema = object({
19685
+ url: string(),
19686
+ endpoints: array(string())
19687
+ });
19688
+ method(object({
19689
+ deviceId: number(),
19690
+ profile: string(),
19691
+ fromMs: number(),
19692
+ toMs: number(),
19693
+ options: ExportOptionsSchema
19694
+ }), ExportRecordSchema, {
19695
+ kind: "mutation",
19696
+ auth: "protected"
19697
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
19698
+ kind: "query",
19699
+ auth: "protected"
19700
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19701
+ kind: "query",
19702
+ auth: "protected"
19703
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19704
+ kind: "mutation",
19705
+ auth: "protected"
19706
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19707
+ kind: "mutation",
19708
+ auth: "protected"
19709
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
19710
+ kind: "query",
19711
+ auth: "protected"
19453
19712
  });
19454
19713
  /**
19455
19714
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -22469,6 +22728,12 @@ Object.freeze({
22469
22728
  addonId: null,
22470
22729
  access: "delete"
22471
22730
  },
22731
+ "pipelineAnalytics.deleteDeviceEvents": {
22732
+ capName: "pipeline-analytics",
22733
+ capScope: "device",
22734
+ addonId: null,
22735
+ access: "delete"
22736
+ },
22472
22737
  "pipelineAnalytics.deleteTracks": {
22473
22738
  capName: "pipeline-analytics",
22474
22739
  capScope: "device",
@@ -22499,6 +22764,12 @@ Object.freeze({
22499
22764
  addonId: null,
22500
22765
  access: "view"
22501
22766
  },
22767
+ "pipelineAnalytics.getEventStoreFootprint": {
22768
+ capName: "pipeline-analytics",
22769
+ capScope: "device",
22770
+ addonId: null,
22771
+ access: "view"
22772
+ },
22502
22773
  "pipelineAnalytics.getKeyEvents": {
22503
22774
  capName: "pipeline-analytics",
22504
22775
  capScope: "device",
@@ -22541,6 +22812,12 @@ Object.freeze({
22541
22812
  addonId: null,
22542
22813
  access: "view"
22543
22814
  },
22815
+ "pipelineAnalytics.listOpsLog": {
22816
+ capName: "pipeline-analytics",
22817
+ capScope: "device",
22818
+ addonId: null,
22819
+ access: "view"
22820
+ },
22544
22821
  "pipelineAnalytics.listRecentTracks": {
22545
22822
  capName: "pipeline-analytics",
22546
22823
  capScope: "device",
@@ -22553,6 +22830,12 @@ Object.freeze({
22553
22830
  addonId: null,
22554
22831
  access: "view"
22555
22832
  },
22833
+ "pipelineAnalytics.pruneEvents": {
22834
+ capName: "pipeline-analytics",
22835
+ capScope: "device",
22836
+ addonId: null,
22837
+ access: "create"
22838
+ },
22556
22839
  "pipelineAnalytics.pruneEventsBefore": {
22557
22840
  capName: "pipeline-analytics",
22558
22841
  capScope: "device",
@@ -23315,6 +23598,12 @@ Object.freeze({
23315
23598
  addonId: null,
23316
23599
  access: "create"
23317
23600
  },
23601
+ "recording.deleteFootprint": {
23602
+ capName: "recording",
23603
+ capScope: "system",
23604
+ addonId: null,
23605
+ access: "delete"
23606
+ },
23318
23607
  "recording.getAvailability": {
23319
23608
  capName: "recording",
23320
23609
  capScope: "system",
@@ -23345,6 +23634,12 @@ Object.freeze({
23345
23634
  addonId: null,
23346
23635
  access: "view"
23347
23636
  },
23637
+ "recording.listOpsLog": {
23638
+ capName: "recording",
23639
+ capScope: "system",
23640
+ addonId: null,
23641
+ access: "view"
23642
+ },
23348
23643
  "recording.locateSegment": {
23349
23644
  capName: "recording",
23350
23645
  capScope: "system",
@@ -23375,6 +23670,42 @@ Object.freeze({
23375
23670
  addonId: null,
23376
23671
  access: "create"
23377
23672
  },
23673
+ "recordingExport.cancelExport": {
23674
+ capName: "recordingExport",
23675
+ capScope: "system",
23676
+ addonId: null,
23677
+ access: "create"
23678
+ },
23679
+ "recordingExport.createExport": {
23680
+ capName: "recordingExport",
23681
+ capScope: "system",
23682
+ addonId: null,
23683
+ access: "create"
23684
+ },
23685
+ "recordingExport.deleteExport": {
23686
+ capName: "recordingExport",
23687
+ capScope: "system",
23688
+ addonId: null,
23689
+ access: "delete"
23690
+ },
23691
+ "recordingExport.getDownloadUrl": {
23692
+ capName: "recordingExport",
23693
+ capScope: "system",
23694
+ addonId: null,
23695
+ access: "view"
23696
+ },
23697
+ "recordingExport.getExport": {
23698
+ capName: "recordingExport",
23699
+ capScope: "system",
23700
+ addonId: null,
23701
+ access: "view"
23702
+ },
23703
+ "recordingExport.listExports": {
23704
+ capName: "recordingExport",
23705
+ capScope: "system",
23706
+ addonId: null,
23707
+ access: "view"
23708
+ },
23378
23709
  "sceneMonitor.captureReference": {
23379
23710
  capName: "scene-monitor",
23380
23711
  capScope: "device",
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_shared = require("./shared-BU3WLevm.js");
5
+ const require_shared = require("./shared-EwybxG9c.js");
6
6
  let node_stream = require("node:stream");
7
7
  let webdav = require("webdav");
8
8
  //#region src/providers/webdav/webdav-config-schema.ts
@@ -1,4 +1,4 @@
1
- import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-Djb5j9fy.mjs";
1
+ import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-DwOLwiOT.mjs";
2
2
  import { PassThrough } from "node:stream";
3
3
  import { AuthType, createClient } from "webdav";
4
4
  //#region src/providers/webdav/webdav-config-schema.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-remote-storage",
3
- "version": "1.1.26",
3
+ "version": "1.1.28",
4
4
  "description": "Remote storage providers (SFTP, S3, WebDAV) — unifies remote backends behind the storage-provider cap",
5
5
  "keywords": [
6
6
  "camstack",