@camstack/addon-provider-hikvision 1.1.25 → 1.1.27

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
@@ -6,7 +6,7 @@ let node_http = require("node:http");
6
6
  let node_https = require("node:https");
7
7
  let node_crypto = require("node:crypto");
8
8
  let node_os = require("node:os");
9
- //#region ../types/dist/event-category-H4AVePnn.mjs
9
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
10
10
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
11
11
  EventCategory["SystemBoot"] = "system.boot";
12
12
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -159,6 +159,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
159
159
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
160
160
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
161
161
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
162
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
163
+ * progress bar the client reconciles via `recordingExport.getExport`. */
164
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
165
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
166
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
162
167
  EventCategory["DetectionEvent"] = "detection.event";
163
168
  EventCategory["SessionTrackNew"] = "session.track.new";
164
169
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -448,6 +453,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
448
453
  */
449
454
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
450
455
  /**
456
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
457
+ * a package zone — a newly-appeared stationary object of a package class
458
+ * that cleared the class / zone / dwell / size gates. Payload:
459
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
460
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
461
+ * Telemetry (D8): the durable record is the `package-events` store row;
462
+ * this bus topic drives notifier rules + live UI. See
463
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
464
+ */
465
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
466
+ /**
467
+ * Fired by `addon-post-analysis` when a previously-delivered package
468
+ * leaves its zone (the stationary entry departed — moved or swept).
469
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
470
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
471
+ * Telemetry (D8). See package-zones-design §5.2.
472
+ */
473
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
474
+ /**
451
475
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
452
476
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
453
477
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -5186,6 +5210,25 @@ function _instanceof(cls, params = {}) {
5186
5210
  };
5187
5211
  return inst;
5188
5212
  }
5213
+ //#endregion
5214
+ //#region ../../node_modules/zod/v4/classic/compat.js
5215
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5216
+ var ZodIssueCode = {
5217
+ invalid_type: "invalid_type",
5218
+ too_big: "too_big",
5219
+ too_small: "too_small",
5220
+ invalid_format: "invalid_format",
5221
+ not_multiple_of: "not_multiple_of",
5222
+ unrecognized_keys: "unrecognized_keys",
5223
+ invalid_union: "invalid_union",
5224
+ invalid_key: "invalid_key",
5225
+ invalid_element: "invalid_element",
5226
+ invalid_value: "invalid_value",
5227
+ custom: "custom"
5228
+ };
5229
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5230
+ var ZodFirstPartyTypeKind;
5231
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5189
5232
  Object.fromEntries([
5190
5233
  {
5191
5234
  id: "overview",
@@ -7407,6 +7450,24 @@ var RecordingRetentionSchema = object({
7407
7450
  maxSizeGb: number().min(0).optional()
7408
7451
  });
7409
7452
  /**
7453
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7454
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7455
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7456
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7457
+ *
7458
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7459
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7460
+ * preset changed over time renders every historical window at the dims it was
7461
+ * written with.
7462
+ */
7463
+ var ScrubThumbnailPresetSchema = _enum([
7464
+ "minimal",
7465
+ "low",
7466
+ "standard",
7467
+ "high",
7468
+ "max"
7469
+ ]);
7470
+ /**
7410
7471
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7411
7472
  *
7412
7473
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7443,7 +7504,14 @@ var RecordingConfigSchema = object({
7443
7504
  * derived into bands once via `migrateConfigToBands`.
7444
7505
  */
7445
7506
  bands: array(RecordingBandSchema).optional(),
7446
- retention: RecordingRetentionSchema.optional()
7507
+ retention: RecordingRetentionSchema.optional(),
7508
+ /**
7509
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7510
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7511
+ * windows only — existing sheets are immutable, and each window's index
7512
+ * carries its own tile dims so mixed-preset history renders correctly.
7513
+ */
7514
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7447
7515
  });
7448
7516
  /**
7449
7517
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -14906,7 +14974,11 @@ array(ZoneRuleSchema).readonly();
14906
14974
  * Extend the enum here when a new gating consumer comes online (audio
14907
14975
  * gating, alert filtering, …) — no other surface needs to change.
14908
14976
  */
14909
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
14977
+ var ZoneRuleStageEnum = _enum([
14978
+ "motion",
14979
+ "detection",
14980
+ "package"
14981
+ ]);
14910
14982
  /**
14911
14983
  * Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
14912
14984
  * `state` getter looks up the cap definition here to construct a
@@ -15000,16 +15072,24 @@ var DEVICE_LOCAL_STATE_CAPS = {
15000
15072
  })
15001
15073
  },
15002
15074
  /**
15003
- * Runtime-state slice — both stages mirrored together so consumers
15075
+ * Runtime-state slice — every stage mirrored together so consumers
15004
15076
  * see one reactive handle (`device.state.zoneRules.value`) instead
15005
- * of two. Bulk-replace mutations on either stage write the full
15006
- * `{motion, detection}` shape, so subscribers always get the
15077
+ * of one per stage. Bulk-replace mutations on any stage write the full
15078
+ * `{motion, detection, package}` shape, so subscribers always get the
15007
15079
  * complete current set. Consumers that only care about one stage
15008
15080
  * just read the matching property.
15081
+ *
15082
+ * `package` backs the package-drop detector — a package zone is a
15083
+ * `ZoneRule` on the `'package'` stage referencing drawn polygons
15084
+ * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
15085
+ * The orchestrator provider that writes this stage lands in a later
15086
+ * slice; until then the mirror carries only `{motion, detection}` and
15087
+ * consumers read `package` as absent (treat as `[]`).
15009
15088
  */
15010
15089
  runtimeState: object({
15011
15090
  motion: array(ZoneRuleSchema).readonly(),
15012
- detection: array(ZoneRuleSchema).readonly()
15091
+ detection: array(ZoneRuleSchema).readonly(),
15092
+ package: array(ZoneRuleSchema).readonly()
15013
15093
  })
15014
15094
  },
15015
15095
  zones: zonesCapability
@@ -18983,6 +19063,7 @@ var EventKindIconSchema = _enum([
18983
19063
  "smoke",
18984
19064
  "water",
18985
19065
  "button",
19066
+ "package",
18986
19067
  "generic"
18987
19068
  ]);
18988
19069
  var EventKindCategorySchema = _enum([
@@ -18990,7 +19071,8 @@ var EventKindCategorySchema = _enum([
18990
19071
  "audio",
18991
19072
  "detection",
18992
19073
  "sensor",
18993
- "custom"
19074
+ "custom",
19075
+ "package"
18994
19076
  ]);
18995
19077
  var EventKindDescriptorSchema = object({
18996
19078
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -22851,6 +22933,108 @@ method(object({
22851
22933
  auth: "admin"
22852
22934
  });
22853
22935
  /**
22936
+ * `recordingExport` cap — render a footage time range into a single downloadable
22937
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
22938
+ * bounded lifetime with a durable history, auto-expiry, and optional
22939
+ * delete-after-download.
22940
+ *
22941
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
22942
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
22943
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
22944
+ * input and dispatch to that single provider; the render runs on the node that
22945
+ * owns the footage (no cross-node segment transfer). Download rides the
22946
+ * framework addon data-plane. State persists in a DurableState blob (NOT
22947
+ * SQLite); history rows survive file deletion for audit.
22948
+ */
22949
+ /** Playback-speed multiplier for the render (1 = realtime). */
22950
+ var ExportSpeedSchema = number().min(.25).max(32);
22951
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
22952
+ var ExportTimelapseSchema = object({
22953
+ everyMs: number().int().positive(),
22954
+ outputFps: number().int().min(1).max(60).optional()
22955
+ });
22956
+ /**
22957
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
22958
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
22959
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
22960
+ * `deleteAfterDownload` removes it shortly after the first complete download.
22961
+ */
22962
+ var ExportOptionsSchema = object({
22963
+ speed: ExportSpeedSchema.optional(),
22964
+ timelapse: ExportTimelapseSchema.optional(),
22965
+ includeAudio: boolean(),
22966
+ maxLifeMs: number().int().positive(),
22967
+ deleteAfterDownload: boolean(),
22968
+ title: string().max(200).optional()
22969
+ }).superRefine((v, ctx) => {
22970
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
22971
+ code: ZodIssueCode.custom,
22972
+ message: "speed and timelapse are mutually exclusive",
22973
+ path: ["timelapse"]
22974
+ });
22975
+ });
22976
+ var ExportStateSchema = _enum([
22977
+ "queued",
22978
+ "rendering",
22979
+ "ready",
22980
+ "failed",
22981
+ "expired",
22982
+ "deleted"
22983
+ ]);
22984
+ /** One export job / history row. */
22985
+ var ExportRecordSchema = object({
22986
+ id: string(),
22987
+ deviceId: number(),
22988
+ profile: string(),
22989
+ fromMs: number(),
22990
+ toMs: number(),
22991
+ options: ExportOptionsSchema,
22992
+ state: ExportStateSchema,
22993
+ /** 0–100 while rendering; null otherwise. */
22994
+ progressPct: number().nullable(),
22995
+ /** File size once ready; null before. */
22996
+ fileBytes: number().nullable(),
22997
+ expiresAt: number(),
22998
+ deleteAfterDownload: boolean(),
22999
+ /** Epoch of the first complete download; null until then. */
23000
+ downloadedAt: number().nullable(),
23001
+ createdAt: number(),
23002
+ /** User id/name that requested the export. */
23003
+ createdBy: string(),
23004
+ /** Failure reason when state is 'failed'; null otherwise. */
23005
+ error: string().nullable()
23006
+ });
23007
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
23008
+ var ExportDownloadSchema = object({
23009
+ url: string(),
23010
+ endpoints: array(string())
23011
+ });
23012
+ method(object({
23013
+ deviceId: number(),
23014
+ profile: string(),
23015
+ fromMs: number(),
23016
+ toMs: number(),
23017
+ options: ExportOptionsSchema
23018
+ }), ExportRecordSchema, {
23019
+ kind: "mutation",
23020
+ auth: "protected"
23021
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
23022
+ kind: "query",
23023
+ auth: "protected"
23024
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
23025
+ kind: "query",
23026
+ auth: "protected"
23027
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
23028
+ kind: "mutation",
23029
+ auth: "protected"
23030
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
23031
+ kind: "mutation",
23032
+ auth: "protected"
23033
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
23034
+ kind: "query",
23035
+ auth: "protected"
23036
+ });
23037
+ /**
22854
23038
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
22855
23039
  * payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
22856
23040
  * `deviceId`.
@@ -26985,6 +27169,42 @@ Object.freeze({
26985
27169
  addonId: null,
26986
27170
  access: "create"
26987
27171
  },
27172
+ "recordingExport.cancelExport": {
27173
+ capName: "recordingExport",
27174
+ capScope: "system",
27175
+ addonId: null,
27176
+ access: "create"
27177
+ },
27178
+ "recordingExport.createExport": {
27179
+ capName: "recordingExport",
27180
+ capScope: "system",
27181
+ addonId: null,
27182
+ access: "create"
27183
+ },
27184
+ "recordingExport.deleteExport": {
27185
+ capName: "recordingExport",
27186
+ capScope: "system",
27187
+ addonId: null,
27188
+ access: "delete"
27189
+ },
27190
+ "recordingExport.getDownloadUrl": {
27191
+ capName: "recordingExport",
27192
+ capScope: "system",
27193
+ addonId: null,
27194
+ access: "view"
27195
+ },
27196
+ "recordingExport.getExport": {
27197
+ capName: "recordingExport",
27198
+ capScope: "system",
27199
+ addonId: null,
27200
+ access: "view"
27201
+ },
27202
+ "recordingExport.listExports": {
27203
+ capName: "recordingExport",
27204
+ capScope: "system",
27205
+ addonId: null,
27206
+ access: "view"
27207
+ },
26988
27208
  "sceneMonitor.captureReference": {
26989
27209
  capName: "scene-monitor",
26990
27210
  capScope: "device",
package/dist/addon.mjs CHANGED
@@ -7,7 +7,7 @@ import { networkInterfaces } from "node:os";
7
7
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
8
8
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
9
9
  //#endregion
10
- //#region ../types/dist/event-category-H4AVePnn.mjs
10
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
11
11
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
12
12
  EventCategory["SystemBoot"] = "system.boot";
13
13
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -160,6 +160,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
160
160
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
161
161
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
162
162
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
163
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
164
+ * progress bar the client reconciles via `recordingExport.getExport`. */
165
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
166
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
167
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
163
168
  EventCategory["DetectionEvent"] = "detection.event";
164
169
  EventCategory["SessionTrackNew"] = "session.track.new";
165
170
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -449,6 +454,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
449
454
  */
450
455
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
451
456
  /**
457
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
458
+ * a package zone — a newly-appeared stationary object of a package class
459
+ * that cleared the class / zone / dwell / size gates. Payload:
460
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
461
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
462
+ * Telemetry (D8): the durable record is the `package-events` store row;
463
+ * this bus topic drives notifier rules + live UI. See
464
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
465
+ */
466
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
467
+ /**
468
+ * Fired by `addon-post-analysis` when a previously-delivered package
469
+ * leaves its zone (the stationary entry departed — moved or swept).
470
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
471
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
472
+ * Telemetry (D8). See package-zones-design §5.2.
473
+ */
474
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
475
+ /**
452
476
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
453
477
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
454
478
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -5187,6 +5211,25 @@ function _instanceof(cls, params = {}) {
5187
5211
  };
5188
5212
  return inst;
5189
5213
  }
5214
+ //#endregion
5215
+ //#region ../../node_modules/zod/v4/classic/compat.js
5216
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5217
+ var ZodIssueCode = {
5218
+ invalid_type: "invalid_type",
5219
+ too_big: "too_big",
5220
+ too_small: "too_small",
5221
+ invalid_format: "invalid_format",
5222
+ not_multiple_of: "not_multiple_of",
5223
+ unrecognized_keys: "unrecognized_keys",
5224
+ invalid_union: "invalid_union",
5225
+ invalid_key: "invalid_key",
5226
+ invalid_element: "invalid_element",
5227
+ invalid_value: "invalid_value",
5228
+ custom: "custom"
5229
+ };
5230
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5231
+ var ZodFirstPartyTypeKind;
5232
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5190
5233
  Object.fromEntries([
5191
5234
  {
5192
5235
  id: "overview",
@@ -7408,6 +7451,24 @@ var RecordingRetentionSchema = object({
7408
7451
  maxSizeGb: number().min(0).optional()
7409
7452
  });
7410
7453
  /**
7454
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7455
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7456
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7457
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7458
+ *
7459
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7460
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7461
+ * preset changed over time renders every historical window at the dims it was
7462
+ * written with.
7463
+ */
7464
+ var ScrubThumbnailPresetSchema = _enum([
7465
+ "minimal",
7466
+ "low",
7467
+ "standard",
7468
+ "high",
7469
+ "max"
7470
+ ]);
7471
+ /**
7411
7472
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7412
7473
  *
7413
7474
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7444,7 +7505,14 @@ var RecordingConfigSchema = object({
7444
7505
  * derived into bands once via `migrateConfigToBands`.
7445
7506
  */
7446
7507
  bands: array(RecordingBandSchema).optional(),
7447
- retention: RecordingRetentionSchema.optional()
7508
+ retention: RecordingRetentionSchema.optional(),
7509
+ /**
7510
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7511
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7512
+ * windows only — existing sheets are immutable, and each window's index
7513
+ * carries its own tile dims so mixed-preset history renders correctly.
7514
+ */
7515
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7448
7516
  });
7449
7517
  /**
7450
7518
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -14907,7 +14975,11 @@ array(ZoneRuleSchema).readonly();
14907
14975
  * Extend the enum here when a new gating consumer comes online (audio
14908
14976
  * gating, alert filtering, …) — no other surface needs to change.
14909
14977
  */
14910
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
14978
+ var ZoneRuleStageEnum = _enum([
14979
+ "motion",
14980
+ "detection",
14981
+ "package"
14982
+ ]);
14911
14983
  /**
14912
14984
  * Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
14913
14985
  * `state` getter looks up the cap definition here to construct a
@@ -15001,16 +15073,24 @@ var DEVICE_LOCAL_STATE_CAPS = {
15001
15073
  })
15002
15074
  },
15003
15075
  /**
15004
- * Runtime-state slice — both stages mirrored together so consumers
15076
+ * Runtime-state slice — every stage mirrored together so consumers
15005
15077
  * see one reactive handle (`device.state.zoneRules.value`) instead
15006
- * of two. Bulk-replace mutations on either stage write the full
15007
- * `{motion, detection}` shape, so subscribers always get the
15078
+ * of one per stage. Bulk-replace mutations on any stage write the full
15079
+ * `{motion, detection, package}` shape, so subscribers always get the
15008
15080
  * complete current set. Consumers that only care about one stage
15009
15081
  * just read the matching property.
15082
+ *
15083
+ * `package` backs the package-drop detector — a package zone is a
15084
+ * `ZoneRule` on the `'package'` stage referencing drawn polygons
15085
+ * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
15086
+ * The orchestrator provider that writes this stage lands in a later
15087
+ * slice; until then the mirror carries only `{motion, detection}` and
15088
+ * consumers read `package` as absent (treat as `[]`).
15010
15089
  */
15011
15090
  runtimeState: object({
15012
15091
  motion: array(ZoneRuleSchema).readonly(),
15013
- detection: array(ZoneRuleSchema).readonly()
15092
+ detection: array(ZoneRuleSchema).readonly(),
15093
+ package: array(ZoneRuleSchema).readonly()
15014
15094
  })
15015
15095
  },
15016
15096
  zones: zonesCapability
@@ -18984,6 +19064,7 @@ var EventKindIconSchema = _enum([
18984
19064
  "smoke",
18985
19065
  "water",
18986
19066
  "button",
19067
+ "package",
18987
19068
  "generic"
18988
19069
  ]);
18989
19070
  var EventKindCategorySchema = _enum([
@@ -18991,7 +19072,8 @@ var EventKindCategorySchema = _enum([
18991
19072
  "audio",
18992
19073
  "detection",
18993
19074
  "sensor",
18994
- "custom"
19075
+ "custom",
19076
+ "package"
18995
19077
  ]);
18996
19078
  var EventKindDescriptorSchema = object({
18997
19079
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -22852,6 +22934,108 @@ method(object({
22852
22934
  auth: "admin"
22853
22935
  });
22854
22936
  /**
22937
+ * `recordingExport` cap — render a footage time range into a single downloadable
22938
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
22939
+ * bounded lifetime with a durable history, auto-expiry, and optional
22940
+ * delete-after-download.
22941
+ *
22942
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
22943
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
22944
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
22945
+ * input and dispatch to that single provider; the render runs on the node that
22946
+ * owns the footage (no cross-node segment transfer). Download rides the
22947
+ * framework addon data-plane. State persists in a DurableState blob (NOT
22948
+ * SQLite); history rows survive file deletion for audit.
22949
+ */
22950
+ /** Playback-speed multiplier for the render (1 = realtime). */
22951
+ var ExportSpeedSchema = number().min(.25).max(32);
22952
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
22953
+ var ExportTimelapseSchema = object({
22954
+ everyMs: number().int().positive(),
22955
+ outputFps: number().int().min(1).max(60).optional()
22956
+ });
22957
+ /**
22958
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
22959
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
22960
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
22961
+ * `deleteAfterDownload` removes it shortly after the first complete download.
22962
+ */
22963
+ var ExportOptionsSchema = object({
22964
+ speed: ExportSpeedSchema.optional(),
22965
+ timelapse: ExportTimelapseSchema.optional(),
22966
+ includeAudio: boolean(),
22967
+ maxLifeMs: number().int().positive(),
22968
+ deleteAfterDownload: boolean(),
22969
+ title: string().max(200).optional()
22970
+ }).superRefine((v, ctx) => {
22971
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
22972
+ code: ZodIssueCode.custom,
22973
+ message: "speed and timelapse are mutually exclusive",
22974
+ path: ["timelapse"]
22975
+ });
22976
+ });
22977
+ var ExportStateSchema = _enum([
22978
+ "queued",
22979
+ "rendering",
22980
+ "ready",
22981
+ "failed",
22982
+ "expired",
22983
+ "deleted"
22984
+ ]);
22985
+ /** One export job / history row. */
22986
+ var ExportRecordSchema = object({
22987
+ id: string(),
22988
+ deviceId: number(),
22989
+ profile: string(),
22990
+ fromMs: number(),
22991
+ toMs: number(),
22992
+ options: ExportOptionsSchema,
22993
+ state: ExportStateSchema,
22994
+ /** 0–100 while rendering; null otherwise. */
22995
+ progressPct: number().nullable(),
22996
+ /** File size once ready; null before. */
22997
+ fileBytes: number().nullable(),
22998
+ expiresAt: number(),
22999
+ deleteAfterDownload: boolean(),
23000
+ /** Epoch of the first complete download; null until then. */
23001
+ downloadedAt: number().nullable(),
23002
+ createdAt: number(),
23003
+ /** User id/name that requested the export. */
23004
+ createdBy: string(),
23005
+ /** Failure reason when state is 'failed'; null otherwise. */
23006
+ error: string().nullable()
23007
+ });
23008
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
23009
+ var ExportDownloadSchema = object({
23010
+ url: string(),
23011
+ endpoints: array(string())
23012
+ });
23013
+ method(object({
23014
+ deviceId: number(),
23015
+ profile: string(),
23016
+ fromMs: number(),
23017
+ toMs: number(),
23018
+ options: ExportOptionsSchema
23019
+ }), ExportRecordSchema, {
23020
+ kind: "mutation",
23021
+ auth: "protected"
23022
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
23023
+ kind: "query",
23024
+ auth: "protected"
23025
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
23026
+ kind: "query",
23027
+ auth: "protected"
23028
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
23029
+ kind: "mutation",
23030
+ auth: "protected"
23031
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
23032
+ kind: "mutation",
23033
+ auth: "protected"
23034
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
23035
+ kind: "query",
23036
+ auth: "protected"
23037
+ });
23038
+ /**
22855
23039
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
22856
23040
  * payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
22857
23041
  * `deviceId`.
@@ -26986,6 +27170,42 @@ Object.freeze({
26986
27170
  addonId: null,
26987
27171
  access: "create"
26988
27172
  },
27173
+ "recordingExport.cancelExport": {
27174
+ capName: "recordingExport",
27175
+ capScope: "system",
27176
+ addonId: null,
27177
+ access: "create"
27178
+ },
27179
+ "recordingExport.createExport": {
27180
+ capName: "recordingExport",
27181
+ capScope: "system",
27182
+ addonId: null,
27183
+ access: "create"
27184
+ },
27185
+ "recordingExport.deleteExport": {
27186
+ capName: "recordingExport",
27187
+ capScope: "system",
27188
+ addonId: null,
27189
+ access: "delete"
27190
+ },
27191
+ "recordingExport.getDownloadUrl": {
27192
+ capName: "recordingExport",
27193
+ capScope: "system",
27194
+ addonId: null,
27195
+ access: "view"
27196
+ },
27197
+ "recordingExport.getExport": {
27198
+ capName: "recordingExport",
27199
+ capScope: "system",
27200
+ addonId: null,
27201
+ access: "view"
27202
+ },
27203
+ "recordingExport.listExports": {
27204
+ capName: "recordingExport",
27205
+ capScope: "system",
27206
+ addonId: null,
27207
+ access: "view"
27208
+ },
26989
27209
  "sceneMonitor.captureReference": {
26990
27210
  capName: "scene-monitor",
26991
27211
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-hikvision",
3
- "version": "1.1.25",
3
+ "version": "1.1.27",
4
4
  "description": "Hikvision camera device provider addon for CamStack — ISAPI over HTTP(S) with digest auth (snapshot, alarm stream, RTSP discovery)",
5
5
  "keywords": [
6
6
  "camstack",