@camstack/addon-provider-petkit 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/addon.js CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let crypto$1 = require("crypto");
3
3
  let events = require("events");
4
- //#region ../types/dist/event-category-H4AVePnn.mjs
4
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
5
5
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
6
6
  EventCategory["SystemBoot"] = "system.boot";
7
7
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -154,6 +154,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
154
154
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
155
155
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
156
156
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
157
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
158
+ * progress bar the client reconciles via `recordingExport.getExport`. */
159
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
160
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
161
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
157
162
  EventCategory["DetectionEvent"] = "detection.event";
158
163
  EventCategory["SessionTrackNew"] = "session.track.new";
159
164
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -443,6 +448,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
443
448
  */
444
449
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
445
450
  /**
451
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
452
+ * a package zone — a newly-appeared stationary object of a package class
453
+ * that cleared the class / zone / dwell / size gates. Payload:
454
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
455
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
456
+ * Telemetry (D8): the durable record is the `package-events` store row;
457
+ * this bus topic drives notifier rules + live UI. See
458
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
459
+ */
460
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
461
+ /**
462
+ * Fired by `addon-post-analysis` when a previously-delivered package
463
+ * leaves its zone (the stationary entry departed — moved or swept).
464
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
465
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
466
+ * Telemetry (D8). See package-zones-design §5.2.
467
+ */
468
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
469
+ /**
446
470
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
447
471
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
448
472
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -5195,6 +5219,25 @@ function preprocess(fn, schema) {
5195
5219
  out: schema
5196
5220
  });
5197
5221
  }
5222
+ //#endregion
5223
+ //#region ../../node_modules/zod/v4/classic/compat.js
5224
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5225
+ var ZodIssueCode = {
5226
+ invalid_type: "invalid_type",
5227
+ too_big: "too_big",
5228
+ too_small: "too_small",
5229
+ invalid_format: "invalid_format",
5230
+ not_multiple_of: "not_multiple_of",
5231
+ unrecognized_keys: "unrecognized_keys",
5232
+ invalid_union: "invalid_union",
5233
+ invalid_key: "invalid_key",
5234
+ invalid_element: "invalid_element",
5235
+ invalid_value: "invalid_value",
5236
+ custom: "custom"
5237
+ };
5238
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5239
+ var ZodFirstPartyTypeKind;
5240
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5198
5241
  Object.fromEntries([
5199
5242
  {
5200
5243
  id: "overview",
@@ -7253,6 +7296,24 @@ var RecordingRetentionSchema = object({
7253
7296
  maxSizeGb: number().min(0).optional()
7254
7297
  });
7255
7298
  /**
7299
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7300
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7301
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7302
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7303
+ *
7304
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7305
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7306
+ * preset changed over time renders every historical window at the dims it was
7307
+ * written with.
7308
+ */
7309
+ var ScrubThumbnailPresetSchema = _enum([
7310
+ "minimal",
7311
+ "low",
7312
+ "standard",
7313
+ "high",
7314
+ "max"
7315
+ ]);
7316
+ /**
7256
7317
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7257
7318
  *
7258
7319
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7289,7 +7350,14 @@ var RecordingConfigSchema = object({
7289
7350
  * derived into bands once via `migrateConfigToBands`.
7290
7351
  */
7291
7352
  bands: array(RecordingBandSchema).optional(),
7292
- retention: RecordingRetentionSchema.optional()
7353
+ retention: RecordingRetentionSchema.optional(),
7354
+ /**
7355
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7356
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7357
+ * windows only — existing sheets are immutable, and each window's index
7358
+ * carries its own tile dims so mixed-preset history renders correctly.
7359
+ */
7360
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7293
7361
  });
7294
7362
  /**
7295
7363
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -14647,7 +14715,11 @@ array(ZoneRuleSchema).readonly();
14647
14715
  * Extend the enum here when a new gating consumer comes online (audio
14648
14716
  * gating, alert filtering, …) — no other surface needs to change.
14649
14717
  */
14650
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
14718
+ var ZoneRuleStageEnum = _enum([
14719
+ "motion",
14720
+ "detection",
14721
+ "package"
14722
+ ]);
14651
14723
  /**
14652
14724
  * Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
14653
14725
  * `state` getter looks up the cap definition here to construct a
@@ -14741,16 +14813,24 @@ var DEVICE_LOCAL_STATE_CAPS = {
14741
14813
  })
14742
14814
  },
14743
14815
  /**
14744
- * Runtime-state slice — both stages mirrored together so consumers
14816
+ * Runtime-state slice — every stage mirrored together so consumers
14745
14817
  * see one reactive handle (`device.state.zoneRules.value`) instead
14746
- * of two. Bulk-replace mutations on either stage write the full
14747
- * `{motion, detection}` shape, so subscribers always get the
14818
+ * of one per stage. Bulk-replace mutations on any stage write the full
14819
+ * `{motion, detection, package}` shape, so subscribers always get the
14748
14820
  * complete current set. Consumers that only care about one stage
14749
14821
  * just read the matching property.
14822
+ *
14823
+ * `package` backs the package-drop detector — a package zone is a
14824
+ * `ZoneRule` on the `'package'` stage referencing drawn polygons
14825
+ * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
14826
+ * The orchestrator provider that writes this stage lands in a later
14827
+ * slice; until then the mirror carries only `{motion, detection}` and
14828
+ * consumers read `package` as absent (treat as `[]`).
14750
14829
  */
14751
14830
  runtimeState: object({
14752
14831
  motion: array(ZoneRuleSchema).readonly(),
14753
- detection: array(ZoneRuleSchema).readonly()
14832
+ detection: array(ZoneRuleSchema).readonly(),
14833
+ package: array(ZoneRuleSchema).readonly()
14754
14834
  })
14755
14835
  },
14756
14836
  zones: zonesCapability
@@ -18729,6 +18809,7 @@ var EventKindIconSchema = _enum([
18729
18809
  "smoke",
18730
18810
  "water",
18731
18811
  "button",
18812
+ "package",
18732
18813
  "generic"
18733
18814
  ]);
18734
18815
  var EventKindCategorySchema = _enum([
@@ -18736,7 +18817,8 @@ var EventKindCategorySchema = _enum([
18736
18817
  "audio",
18737
18818
  "detection",
18738
18819
  "sensor",
18739
- "custom"
18820
+ "custom",
18821
+ "package"
18740
18822
  ]);
18741
18823
  var EventKindDescriptorSchema = object({
18742
18824
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -22382,6 +22464,108 @@ method(object({
22382
22464
  auth: "admin"
22383
22465
  });
22384
22466
  /**
22467
+ * `recordingExport` cap — render a footage time range into a single downloadable
22468
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
22469
+ * bounded lifetime with a durable history, auto-expiry, and optional
22470
+ * delete-after-download.
22471
+ *
22472
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
22473
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
22474
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
22475
+ * input and dispatch to that single provider; the render runs on the node that
22476
+ * owns the footage (no cross-node segment transfer). Download rides the
22477
+ * framework addon data-plane. State persists in a DurableState blob (NOT
22478
+ * SQLite); history rows survive file deletion for audit.
22479
+ */
22480
+ /** Playback-speed multiplier for the render (1 = realtime). */
22481
+ var ExportSpeedSchema = number().min(.25).max(32);
22482
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
22483
+ var ExportTimelapseSchema = object({
22484
+ everyMs: number().int().positive(),
22485
+ outputFps: number().int().min(1).max(60).optional()
22486
+ });
22487
+ /**
22488
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
22489
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
22490
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
22491
+ * `deleteAfterDownload` removes it shortly after the first complete download.
22492
+ */
22493
+ var ExportOptionsSchema = object({
22494
+ speed: ExportSpeedSchema.optional(),
22495
+ timelapse: ExportTimelapseSchema.optional(),
22496
+ includeAudio: boolean(),
22497
+ maxLifeMs: number().int().positive(),
22498
+ deleteAfterDownload: boolean(),
22499
+ title: string().max(200).optional()
22500
+ }).superRefine((v, ctx) => {
22501
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
22502
+ code: ZodIssueCode.custom,
22503
+ message: "speed and timelapse are mutually exclusive",
22504
+ path: ["timelapse"]
22505
+ });
22506
+ });
22507
+ var ExportStateSchema = _enum([
22508
+ "queued",
22509
+ "rendering",
22510
+ "ready",
22511
+ "failed",
22512
+ "expired",
22513
+ "deleted"
22514
+ ]);
22515
+ /** One export job / history row. */
22516
+ var ExportRecordSchema = object({
22517
+ id: string(),
22518
+ deviceId: number(),
22519
+ profile: string(),
22520
+ fromMs: number(),
22521
+ toMs: number(),
22522
+ options: ExportOptionsSchema,
22523
+ state: ExportStateSchema,
22524
+ /** 0–100 while rendering; null otherwise. */
22525
+ progressPct: number().nullable(),
22526
+ /** File size once ready; null before. */
22527
+ fileBytes: number().nullable(),
22528
+ expiresAt: number(),
22529
+ deleteAfterDownload: boolean(),
22530
+ /** Epoch of the first complete download; null until then. */
22531
+ downloadedAt: number().nullable(),
22532
+ createdAt: number(),
22533
+ /** User id/name that requested the export. */
22534
+ createdBy: string(),
22535
+ /** Failure reason when state is 'failed'; null otherwise. */
22536
+ error: string().nullable()
22537
+ });
22538
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
22539
+ var ExportDownloadSchema = object({
22540
+ url: string(),
22541
+ endpoints: array(string())
22542
+ });
22543
+ method(object({
22544
+ deviceId: number(),
22545
+ profile: string(),
22546
+ fromMs: number(),
22547
+ toMs: number(),
22548
+ options: ExportOptionsSchema
22549
+ }), ExportRecordSchema, {
22550
+ kind: "mutation",
22551
+ auth: "protected"
22552
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
22553
+ kind: "query",
22554
+ auth: "protected"
22555
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22556
+ kind: "query",
22557
+ auth: "protected"
22558
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22559
+ kind: "mutation",
22560
+ auth: "protected"
22561
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22562
+ kind: "mutation",
22563
+ auth: "protected"
22564
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
22565
+ kind: "query",
22566
+ auth: "protected"
22567
+ });
22568
+ /**
22385
22569
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
22386
22570
  * payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
22387
22571
  * `deviceId`.
@@ -26305,6 +26489,42 @@ Object.freeze({
26305
26489
  addonId: null,
26306
26490
  access: "create"
26307
26491
  },
26492
+ "recordingExport.cancelExport": {
26493
+ capName: "recordingExport",
26494
+ capScope: "system",
26495
+ addonId: null,
26496
+ access: "create"
26497
+ },
26498
+ "recordingExport.createExport": {
26499
+ capName: "recordingExport",
26500
+ capScope: "system",
26501
+ addonId: null,
26502
+ access: "create"
26503
+ },
26504
+ "recordingExport.deleteExport": {
26505
+ capName: "recordingExport",
26506
+ capScope: "system",
26507
+ addonId: null,
26508
+ access: "delete"
26509
+ },
26510
+ "recordingExport.getDownloadUrl": {
26511
+ capName: "recordingExport",
26512
+ capScope: "system",
26513
+ addonId: null,
26514
+ access: "view"
26515
+ },
26516
+ "recordingExport.getExport": {
26517
+ capName: "recordingExport",
26518
+ capScope: "system",
26519
+ addonId: null,
26520
+ access: "view"
26521
+ },
26522
+ "recordingExport.listExports": {
26523
+ capName: "recordingExport",
26524
+ capScope: "system",
26525
+ addonId: null,
26526
+ access: "view"
26527
+ },
26308
26528
  "sceneMonitor.captureReference": {
26309
26529
  capName: "scene-monitor",
26310
26530
  capScope: "device",
package/dist/addon.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createHash } from "crypto";
2
2
  import { EventEmitter } from "events";
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
@@ -5194,6 +5218,25 @@ function preprocess(fn, schema) {
5194
5218
  out: schema
5195
5219
  });
5196
5220
  }
5221
+ //#endregion
5222
+ //#region ../../node_modules/zod/v4/classic/compat.js
5223
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5224
+ var ZodIssueCode = {
5225
+ invalid_type: "invalid_type",
5226
+ too_big: "too_big",
5227
+ too_small: "too_small",
5228
+ invalid_format: "invalid_format",
5229
+ not_multiple_of: "not_multiple_of",
5230
+ unrecognized_keys: "unrecognized_keys",
5231
+ invalid_union: "invalid_union",
5232
+ invalid_key: "invalid_key",
5233
+ invalid_element: "invalid_element",
5234
+ invalid_value: "invalid_value",
5235
+ custom: "custom"
5236
+ };
5237
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5238
+ var ZodFirstPartyTypeKind;
5239
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5197
5240
  Object.fromEntries([
5198
5241
  {
5199
5242
  id: "overview",
@@ -7252,6 +7295,24 @@ var RecordingRetentionSchema = object({
7252
7295
  maxSizeGb: number().min(0).optional()
7253
7296
  });
7254
7297
  /**
7298
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7299
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7300
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7301
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7302
+ *
7303
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7304
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7305
+ * preset changed over time renders every historical window at the dims it was
7306
+ * written with.
7307
+ */
7308
+ var ScrubThumbnailPresetSchema = _enum([
7309
+ "minimal",
7310
+ "low",
7311
+ "standard",
7312
+ "high",
7313
+ "max"
7314
+ ]);
7315
+ /**
7255
7316
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7256
7317
  *
7257
7318
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7288,7 +7349,14 @@ var RecordingConfigSchema = object({
7288
7349
  * derived into bands once via `migrateConfigToBands`.
7289
7350
  */
7290
7351
  bands: array(RecordingBandSchema).optional(),
7291
- retention: RecordingRetentionSchema.optional()
7352
+ retention: RecordingRetentionSchema.optional(),
7353
+ /**
7354
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7355
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7356
+ * windows only — existing sheets are immutable, and each window's index
7357
+ * carries its own tile dims so mixed-preset history renders correctly.
7358
+ */
7359
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7292
7360
  });
7293
7361
  /**
7294
7362
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -14646,7 +14714,11 @@ array(ZoneRuleSchema).readonly();
14646
14714
  * Extend the enum here when a new gating consumer comes online (audio
14647
14715
  * gating, alert filtering, …) — no other surface needs to change.
14648
14716
  */
14649
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
14717
+ var ZoneRuleStageEnum = _enum([
14718
+ "motion",
14719
+ "detection",
14720
+ "package"
14721
+ ]);
14650
14722
  /**
14651
14723
  * Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
14652
14724
  * `state` getter looks up the cap definition here to construct a
@@ -14740,16 +14812,24 @@ var DEVICE_LOCAL_STATE_CAPS = {
14740
14812
  })
14741
14813
  },
14742
14814
  /**
14743
- * Runtime-state slice — both stages mirrored together so consumers
14815
+ * Runtime-state slice — every stage mirrored together so consumers
14744
14816
  * see one reactive handle (`device.state.zoneRules.value`) instead
14745
- * of two. Bulk-replace mutations on either stage write the full
14746
- * `{motion, detection}` shape, so subscribers always get the
14817
+ * of one per stage. Bulk-replace mutations on any stage write the full
14818
+ * `{motion, detection, package}` shape, so subscribers always get the
14747
14819
  * complete current set. Consumers that only care about one stage
14748
14820
  * just read the matching property.
14821
+ *
14822
+ * `package` backs the package-drop detector — a package zone is a
14823
+ * `ZoneRule` on the `'package'` stage referencing drawn polygons
14824
+ * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
14825
+ * The orchestrator provider that writes this stage lands in a later
14826
+ * slice; until then the mirror carries only `{motion, detection}` and
14827
+ * consumers read `package` as absent (treat as `[]`).
14749
14828
  */
14750
14829
  runtimeState: object({
14751
14830
  motion: array(ZoneRuleSchema).readonly(),
14752
- detection: array(ZoneRuleSchema).readonly()
14831
+ detection: array(ZoneRuleSchema).readonly(),
14832
+ package: array(ZoneRuleSchema).readonly()
14753
14833
  })
14754
14834
  },
14755
14835
  zones: zonesCapability
@@ -18728,6 +18808,7 @@ var EventKindIconSchema = _enum([
18728
18808
  "smoke",
18729
18809
  "water",
18730
18810
  "button",
18811
+ "package",
18731
18812
  "generic"
18732
18813
  ]);
18733
18814
  var EventKindCategorySchema = _enum([
@@ -18735,7 +18816,8 @@ var EventKindCategorySchema = _enum([
18735
18816
  "audio",
18736
18817
  "detection",
18737
18818
  "sensor",
18738
- "custom"
18819
+ "custom",
18820
+ "package"
18739
18821
  ]);
18740
18822
  var EventKindDescriptorSchema = object({
18741
18823
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -22381,6 +22463,108 @@ method(object({
22381
22463
  auth: "admin"
22382
22464
  });
22383
22465
  /**
22466
+ * `recordingExport` cap — render a footage time range into a single downloadable
22467
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
22468
+ * bounded lifetime with a durable history, auto-expiry, and optional
22469
+ * delete-after-download.
22470
+ *
22471
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
22472
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
22473
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
22474
+ * input and dispatch to that single provider; the render runs on the node that
22475
+ * owns the footage (no cross-node segment transfer). Download rides the
22476
+ * framework addon data-plane. State persists in a DurableState blob (NOT
22477
+ * SQLite); history rows survive file deletion for audit.
22478
+ */
22479
+ /** Playback-speed multiplier for the render (1 = realtime). */
22480
+ var ExportSpeedSchema = number().min(.25).max(32);
22481
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
22482
+ var ExportTimelapseSchema = object({
22483
+ everyMs: number().int().positive(),
22484
+ outputFps: number().int().min(1).max(60).optional()
22485
+ });
22486
+ /**
22487
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
22488
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
22489
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
22490
+ * `deleteAfterDownload` removes it shortly after the first complete download.
22491
+ */
22492
+ var ExportOptionsSchema = object({
22493
+ speed: ExportSpeedSchema.optional(),
22494
+ timelapse: ExportTimelapseSchema.optional(),
22495
+ includeAudio: boolean(),
22496
+ maxLifeMs: number().int().positive(),
22497
+ deleteAfterDownload: boolean(),
22498
+ title: string().max(200).optional()
22499
+ }).superRefine((v, ctx) => {
22500
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
22501
+ code: ZodIssueCode.custom,
22502
+ message: "speed and timelapse are mutually exclusive",
22503
+ path: ["timelapse"]
22504
+ });
22505
+ });
22506
+ var ExportStateSchema = _enum([
22507
+ "queued",
22508
+ "rendering",
22509
+ "ready",
22510
+ "failed",
22511
+ "expired",
22512
+ "deleted"
22513
+ ]);
22514
+ /** One export job / history row. */
22515
+ var ExportRecordSchema = object({
22516
+ id: string(),
22517
+ deviceId: number(),
22518
+ profile: string(),
22519
+ fromMs: number(),
22520
+ toMs: number(),
22521
+ options: ExportOptionsSchema,
22522
+ state: ExportStateSchema,
22523
+ /** 0–100 while rendering; null otherwise. */
22524
+ progressPct: number().nullable(),
22525
+ /** File size once ready; null before. */
22526
+ fileBytes: number().nullable(),
22527
+ expiresAt: number(),
22528
+ deleteAfterDownload: boolean(),
22529
+ /** Epoch of the first complete download; null until then. */
22530
+ downloadedAt: number().nullable(),
22531
+ createdAt: number(),
22532
+ /** User id/name that requested the export. */
22533
+ createdBy: string(),
22534
+ /** Failure reason when state is 'failed'; null otherwise. */
22535
+ error: string().nullable()
22536
+ });
22537
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
22538
+ var ExportDownloadSchema = object({
22539
+ url: string(),
22540
+ endpoints: array(string())
22541
+ });
22542
+ method(object({
22543
+ deviceId: number(),
22544
+ profile: string(),
22545
+ fromMs: number(),
22546
+ toMs: number(),
22547
+ options: ExportOptionsSchema
22548
+ }), ExportRecordSchema, {
22549
+ kind: "mutation",
22550
+ auth: "protected"
22551
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
22552
+ kind: "query",
22553
+ auth: "protected"
22554
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22555
+ kind: "query",
22556
+ auth: "protected"
22557
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22558
+ kind: "mutation",
22559
+ auth: "protected"
22560
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22561
+ kind: "mutation",
22562
+ auth: "protected"
22563
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
22564
+ kind: "query",
22565
+ auth: "protected"
22566
+ });
22567
+ /**
22384
22568
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
22385
22569
  * payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
22386
22570
  * `deviceId`.
@@ -26304,6 +26488,42 @@ Object.freeze({
26304
26488
  addonId: null,
26305
26489
  access: "create"
26306
26490
  },
26491
+ "recordingExport.cancelExport": {
26492
+ capName: "recordingExport",
26493
+ capScope: "system",
26494
+ addonId: null,
26495
+ access: "create"
26496
+ },
26497
+ "recordingExport.createExport": {
26498
+ capName: "recordingExport",
26499
+ capScope: "system",
26500
+ addonId: null,
26501
+ access: "create"
26502
+ },
26503
+ "recordingExport.deleteExport": {
26504
+ capName: "recordingExport",
26505
+ capScope: "system",
26506
+ addonId: null,
26507
+ access: "delete"
26508
+ },
26509
+ "recordingExport.getDownloadUrl": {
26510
+ capName: "recordingExport",
26511
+ capScope: "system",
26512
+ addonId: null,
26513
+ access: "view"
26514
+ },
26515
+ "recordingExport.getExport": {
26516
+ capName: "recordingExport",
26517
+ capScope: "system",
26518
+ addonId: null,
26519
+ access: "view"
26520
+ },
26521
+ "recordingExport.listExports": {
26522
+ capName: "recordingExport",
26523
+ capScope: "system",
26524
+ addonId: null,
26525
+ access: "view"
26526
+ },
26307
26527
  "sceneMonitor.captureReference": {
26308
26528
  capName: "scene-monitor",
26309
26529
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-petkit",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "PetKit smart-feeder device-provider addon for CamStack — wraps the @apocaliss92/nodepetkit PetKit cloud client",
5
5
  "keywords": [
6
6
  "camstack",