@camstack/addon-ai 0.1.4 → 0.1.6

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
@@ -43,7 +43,7 @@ let node_fs_promises = require("node:fs/promises");
43
43
  node_fs_promises = __toESM(node_fs_promises);
44
44
  let node_child_process = require("node:child_process");
45
45
  let node_net = require("node:net");
46
- //#region ../types/dist/event-category-H4AVePnn.mjs
46
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
47
47
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
48
48
  EventCategory["SystemBoot"] = "system.boot";
49
49
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -196,6 +196,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
196
196
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
197
197
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
198
198
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
199
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
200
+ * progress bar the client reconciles via `recordingExport.getExport`. */
201
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
202
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
203
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
199
204
  EventCategory["DetectionEvent"] = "detection.event";
200
205
  EventCategory["SessionTrackNew"] = "session.track.new";
201
206
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -485,6 +490,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
485
490
  */
486
491
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
487
492
  /**
493
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
494
+ * a package zone — a newly-appeared stationary object of a package class
495
+ * that cleared the class / zone / dwell / size gates. Payload:
496
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
497
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
498
+ * Telemetry (D8): the durable record is the `package-events` store row;
499
+ * this bus topic drives notifier rules + live UI. See
500
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
501
+ */
502
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
503
+ /**
504
+ * Fired by `addon-post-analysis` when a previously-delivered package
505
+ * leaves its zone (the stationary entry departed — moved or swept).
506
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
507
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
508
+ * Telemetry (D8). See package-zones-design §5.2.
509
+ */
510
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
511
+ /**
488
512
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
489
513
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
490
514
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -5223,6 +5247,25 @@ function _instanceof(cls, params = {}) {
5223
5247
  };
5224
5248
  return inst;
5225
5249
  }
5250
+ //#endregion
5251
+ //#region ../../node_modules/zod/v4/classic/compat.js
5252
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5253
+ var ZodIssueCode = {
5254
+ invalid_type: "invalid_type",
5255
+ too_big: "too_big",
5256
+ too_small: "too_small",
5257
+ invalid_format: "invalid_format",
5258
+ not_multiple_of: "not_multiple_of",
5259
+ unrecognized_keys: "unrecognized_keys",
5260
+ invalid_union: "invalid_union",
5261
+ invalid_key: "invalid_key",
5262
+ invalid_element: "invalid_element",
5263
+ invalid_value: "invalid_value",
5264
+ custom: "custom"
5265
+ };
5266
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5267
+ var ZodFirstPartyTypeKind;
5268
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5226
5269
  Object.fromEntries([
5227
5270
  {
5228
5271
  id: "overview",
@@ -7265,6 +7308,24 @@ var RecordingRetentionSchema = object({
7265
7308
  maxSizeGb: number().min(0).optional()
7266
7309
  });
7267
7310
  /**
7311
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7312
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7313
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7314
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7315
+ *
7316
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7317
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7318
+ * preset changed over time renders every historical window at the dims it was
7319
+ * written with.
7320
+ */
7321
+ var ScrubThumbnailPresetSchema = _enum([
7322
+ "minimal",
7323
+ "low",
7324
+ "standard",
7325
+ "high",
7326
+ "max"
7327
+ ]);
7328
+ /**
7268
7329
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7269
7330
  *
7270
7331
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7301,7 +7362,14 @@ var RecordingConfigSchema = object({
7301
7362
  * derived into bands once via `migrateConfigToBands`.
7302
7363
  */
7303
7364
  bands: array(RecordingBandSchema).optional(),
7304
- retention: RecordingRetentionSchema.optional()
7365
+ retention: RecordingRetentionSchema.optional(),
7366
+ /**
7367
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7368
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7369
+ * windows only — existing sheets are immutable, and each window's index
7370
+ * carries its own tile dims so mixed-preset history renders correctly.
7371
+ */
7372
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7305
7373
  });
7306
7374
  /**
7307
7375
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -12583,7 +12651,11 @@ array(ZoneRuleSchema).readonly();
12583
12651
  * Extend the enum here when a new gating consumer comes online (audio
12584
12652
  * gating, alert filtering, …) — no other surface needs to change.
12585
12653
  */
12586
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
12654
+ var ZoneRuleStageEnum = _enum([
12655
+ "motion",
12656
+ "detection",
12657
+ "package"
12658
+ ]);
12587
12659
  DeviceType.Camera, method(object({
12588
12660
  deviceId: number(),
12589
12661
  stage: ZoneRuleStageEnum
@@ -12596,7 +12668,8 @@ DeviceType.Camera, method(object({
12596
12668
  auth: "admin"
12597
12669
  }), object({
12598
12670
  motion: array(ZoneRuleSchema).readonly(),
12599
- detection: array(ZoneRuleSchema).readonly()
12671
+ detection: array(ZoneRuleSchema).readonly(),
12672
+ package: array(ZoneRuleSchema).readonly()
12600
12673
  });
12601
12674
  var ProviderStatusSchema = object({
12602
12675
  connected: boolean(),
@@ -15824,6 +15897,7 @@ var EventKindIconSchema = _enum([
15824
15897
  "smoke",
15825
15898
  "water",
15826
15899
  "button",
15900
+ "package",
15827
15901
  "generic"
15828
15902
  ]);
15829
15903
  var EventKindCategorySchema = _enum([
@@ -15831,7 +15905,8 @@ var EventKindCategorySchema = _enum([
15831
15905
  "audio",
15832
15906
  "detection",
15833
15907
  "sensor",
15834
- "custom"
15908
+ "custom",
15909
+ "package"
15835
15910
  ]);
15836
15911
  var EventKindDescriptorSchema = object({
15837
15912
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -19477,6 +19552,108 @@ method(object({
19477
19552
  auth: "admin"
19478
19553
  });
19479
19554
  /**
19555
+ * `recordingExport` cap — render a footage time range into a single downloadable
19556
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
19557
+ * bounded lifetime with a durable history, auto-expiry, and optional
19558
+ * delete-after-download.
19559
+ *
19560
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
19561
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
19562
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
19563
+ * input and dispatch to that single provider; the render runs on the node that
19564
+ * owns the footage (no cross-node segment transfer). Download rides the
19565
+ * framework addon data-plane. State persists in a DurableState blob (NOT
19566
+ * SQLite); history rows survive file deletion for audit.
19567
+ */
19568
+ /** Playback-speed multiplier for the render (1 = realtime). */
19569
+ var ExportSpeedSchema = number().min(.25).max(32);
19570
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
19571
+ var ExportTimelapseSchema = object({
19572
+ everyMs: number().int().positive(),
19573
+ outputFps: number().int().min(1).max(60).optional()
19574
+ });
19575
+ /**
19576
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
19577
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
19578
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
19579
+ * `deleteAfterDownload` removes it shortly after the first complete download.
19580
+ */
19581
+ var ExportOptionsSchema = object({
19582
+ speed: ExportSpeedSchema.optional(),
19583
+ timelapse: ExportTimelapseSchema.optional(),
19584
+ includeAudio: boolean(),
19585
+ maxLifeMs: number().int().positive(),
19586
+ deleteAfterDownload: boolean(),
19587
+ title: string().max(200).optional()
19588
+ }).superRefine((v, ctx) => {
19589
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
19590
+ code: ZodIssueCode.custom,
19591
+ message: "speed and timelapse are mutually exclusive",
19592
+ path: ["timelapse"]
19593
+ });
19594
+ });
19595
+ var ExportStateSchema = _enum([
19596
+ "queued",
19597
+ "rendering",
19598
+ "ready",
19599
+ "failed",
19600
+ "expired",
19601
+ "deleted"
19602
+ ]);
19603
+ /** One export job / history row. */
19604
+ var ExportRecordSchema = object({
19605
+ id: string(),
19606
+ deviceId: number(),
19607
+ profile: string(),
19608
+ fromMs: number(),
19609
+ toMs: number(),
19610
+ options: ExportOptionsSchema,
19611
+ state: ExportStateSchema,
19612
+ /** 0–100 while rendering; null otherwise. */
19613
+ progressPct: number().nullable(),
19614
+ /** File size once ready; null before. */
19615
+ fileBytes: number().nullable(),
19616
+ expiresAt: number(),
19617
+ deleteAfterDownload: boolean(),
19618
+ /** Epoch of the first complete download; null until then. */
19619
+ downloadedAt: number().nullable(),
19620
+ createdAt: number(),
19621
+ /** User id/name that requested the export. */
19622
+ createdBy: string(),
19623
+ /** Failure reason when state is 'failed'; null otherwise. */
19624
+ error: string().nullable()
19625
+ });
19626
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
19627
+ var ExportDownloadSchema = object({
19628
+ url: string(),
19629
+ endpoints: array(string())
19630
+ });
19631
+ method(object({
19632
+ deviceId: number(),
19633
+ profile: string(),
19634
+ fromMs: number(),
19635
+ toMs: number(),
19636
+ options: ExportOptionsSchema
19637
+ }), ExportRecordSchema, {
19638
+ kind: "mutation",
19639
+ auth: "protected"
19640
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
19641
+ kind: "query",
19642
+ auth: "protected"
19643
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19644
+ kind: "query",
19645
+ auth: "protected"
19646
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19647
+ kind: "mutation",
19648
+ auth: "protected"
19649
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19650
+ kind: "mutation",
19651
+ auth: "protected"
19652
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
19653
+ kind: "query",
19654
+ auth: "protected"
19655
+ });
19656
+ /**
19480
19657
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
19481
19658
  * payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
19482
19659
  * `deviceId`.
@@ -23400,6 +23577,42 @@ Object.freeze({
23400
23577
  addonId: null,
23401
23578
  access: "create"
23402
23579
  },
23580
+ "recordingExport.cancelExport": {
23581
+ capName: "recordingExport",
23582
+ capScope: "system",
23583
+ addonId: null,
23584
+ access: "create"
23585
+ },
23586
+ "recordingExport.createExport": {
23587
+ capName: "recordingExport",
23588
+ capScope: "system",
23589
+ addonId: null,
23590
+ access: "create"
23591
+ },
23592
+ "recordingExport.deleteExport": {
23593
+ capName: "recordingExport",
23594
+ capScope: "system",
23595
+ addonId: null,
23596
+ access: "delete"
23597
+ },
23598
+ "recordingExport.getDownloadUrl": {
23599
+ capName: "recordingExport",
23600
+ capScope: "system",
23601
+ addonId: null,
23602
+ access: "view"
23603
+ },
23604
+ "recordingExport.getExport": {
23605
+ capName: "recordingExport",
23606
+ capScope: "system",
23607
+ addonId: null,
23608
+ access: "view"
23609
+ },
23610
+ "recordingExport.listExports": {
23611
+ capName: "recordingExport",
23612
+ capScope: "system",
23613
+ addonId: null,
23614
+ access: "view"
23615
+ },
23403
23616
  "sceneMonitor.captureReference": {
23404
23617
  capName: "scene-monitor",
23405
23618
  capScope: "device",
package/dist/addon.mjs CHANGED
@@ -5,7 +5,7 @@ import { createReadStream } from "node:fs";
5
5
  import * as fsp from "node:fs/promises";
6
6
  import { spawn } from "node:child_process";
7
7
  import { createServer } from "node:net";
8
- //#region ../types/dist/event-category-H4AVePnn.mjs
8
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
9
9
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
10
10
  EventCategory["SystemBoot"] = "system.boot";
11
11
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -158,6 +158,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
158
158
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
159
159
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
160
160
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
161
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
162
+ * progress bar the client reconciles via `recordingExport.getExport`. */
163
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
164
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
165
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
161
166
  EventCategory["DetectionEvent"] = "detection.event";
162
167
  EventCategory["SessionTrackNew"] = "session.track.new";
163
168
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -447,6 +452,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
447
452
  */
448
453
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
449
454
  /**
455
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
456
+ * a package zone — a newly-appeared stationary object of a package class
457
+ * that cleared the class / zone / dwell / size gates. Payload:
458
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
459
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
460
+ * Telemetry (D8): the durable record is the `package-events` store row;
461
+ * this bus topic drives notifier rules + live UI. See
462
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
463
+ */
464
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
465
+ /**
466
+ * Fired by `addon-post-analysis` when a previously-delivered package
467
+ * leaves its zone (the stationary entry departed — moved or swept).
468
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
469
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
470
+ * Telemetry (D8). See package-zones-design §5.2.
471
+ */
472
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
473
+ /**
450
474
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
451
475
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
452
476
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -5185,6 +5209,25 @@ function _instanceof(cls, params = {}) {
5185
5209
  };
5186
5210
  return inst;
5187
5211
  }
5212
+ //#endregion
5213
+ //#region ../../node_modules/zod/v4/classic/compat.js
5214
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5215
+ var ZodIssueCode = {
5216
+ invalid_type: "invalid_type",
5217
+ too_big: "too_big",
5218
+ too_small: "too_small",
5219
+ invalid_format: "invalid_format",
5220
+ not_multiple_of: "not_multiple_of",
5221
+ unrecognized_keys: "unrecognized_keys",
5222
+ invalid_union: "invalid_union",
5223
+ invalid_key: "invalid_key",
5224
+ invalid_element: "invalid_element",
5225
+ invalid_value: "invalid_value",
5226
+ custom: "custom"
5227
+ };
5228
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5229
+ var ZodFirstPartyTypeKind;
5230
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5188
5231
  Object.fromEntries([
5189
5232
  {
5190
5233
  id: "overview",
@@ -7227,6 +7270,24 @@ var RecordingRetentionSchema = object({
7227
7270
  maxSizeGb: number().min(0).optional()
7228
7271
  });
7229
7272
  /**
7273
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7274
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7275
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7276
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7277
+ *
7278
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7279
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7280
+ * preset changed over time renders every historical window at the dims it was
7281
+ * written with.
7282
+ */
7283
+ var ScrubThumbnailPresetSchema = _enum([
7284
+ "minimal",
7285
+ "low",
7286
+ "standard",
7287
+ "high",
7288
+ "max"
7289
+ ]);
7290
+ /**
7230
7291
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7231
7292
  *
7232
7293
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7263,7 +7324,14 @@ var RecordingConfigSchema = object({
7263
7324
  * derived into bands once via `migrateConfigToBands`.
7264
7325
  */
7265
7326
  bands: array(RecordingBandSchema).optional(),
7266
- retention: RecordingRetentionSchema.optional()
7327
+ retention: RecordingRetentionSchema.optional(),
7328
+ /**
7329
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7330
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7331
+ * windows only — existing sheets are immutable, and each window's index
7332
+ * carries its own tile dims so mixed-preset history renders correctly.
7333
+ */
7334
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7267
7335
  });
7268
7336
  /**
7269
7337
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -12545,7 +12613,11 @@ array(ZoneRuleSchema).readonly();
12545
12613
  * Extend the enum here when a new gating consumer comes online (audio
12546
12614
  * gating, alert filtering, …) — no other surface needs to change.
12547
12615
  */
12548
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
12616
+ var ZoneRuleStageEnum = _enum([
12617
+ "motion",
12618
+ "detection",
12619
+ "package"
12620
+ ]);
12549
12621
  DeviceType.Camera, method(object({
12550
12622
  deviceId: number(),
12551
12623
  stage: ZoneRuleStageEnum
@@ -12558,7 +12630,8 @@ DeviceType.Camera, method(object({
12558
12630
  auth: "admin"
12559
12631
  }), object({
12560
12632
  motion: array(ZoneRuleSchema).readonly(),
12561
- detection: array(ZoneRuleSchema).readonly()
12633
+ detection: array(ZoneRuleSchema).readonly(),
12634
+ package: array(ZoneRuleSchema).readonly()
12562
12635
  });
12563
12636
  var ProviderStatusSchema = object({
12564
12637
  connected: boolean(),
@@ -15786,6 +15859,7 @@ var EventKindIconSchema = _enum([
15786
15859
  "smoke",
15787
15860
  "water",
15788
15861
  "button",
15862
+ "package",
15789
15863
  "generic"
15790
15864
  ]);
15791
15865
  var EventKindCategorySchema = _enum([
@@ -15793,7 +15867,8 @@ var EventKindCategorySchema = _enum([
15793
15867
  "audio",
15794
15868
  "detection",
15795
15869
  "sensor",
15796
- "custom"
15870
+ "custom",
15871
+ "package"
15797
15872
  ]);
15798
15873
  var EventKindDescriptorSchema = object({
15799
15874
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -19439,6 +19514,108 @@ method(object({
19439
19514
  auth: "admin"
19440
19515
  });
19441
19516
  /**
19517
+ * `recordingExport` cap — render a footage time range into a single downloadable
19518
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
19519
+ * bounded lifetime with a durable history, auto-expiry, and optional
19520
+ * delete-after-download.
19521
+ *
19522
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
19523
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
19524
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
19525
+ * input and dispatch to that single provider; the render runs on the node that
19526
+ * owns the footage (no cross-node segment transfer). Download rides the
19527
+ * framework addon data-plane. State persists in a DurableState blob (NOT
19528
+ * SQLite); history rows survive file deletion for audit.
19529
+ */
19530
+ /** Playback-speed multiplier for the render (1 = realtime). */
19531
+ var ExportSpeedSchema = number().min(.25).max(32);
19532
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
19533
+ var ExportTimelapseSchema = object({
19534
+ everyMs: number().int().positive(),
19535
+ outputFps: number().int().min(1).max(60).optional()
19536
+ });
19537
+ /**
19538
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
19539
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
19540
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
19541
+ * `deleteAfterDownload` removes it shortly after the first complete download.
19542
+ */
19543
+ var ExportOptionsSchema = object({
19544
+ speed: ExportSpeedSchema.optional(),
19545
+ timelapse: ExportTimelapseSchema.optional(),
19546
+ includeAudio: boolean(),
19547
+ maxLifeMs: number().int().positive(),
19548
+ deleteAfterDownload: boolean(),
19549
+ title: string().max(200).optional()
19550
+ }).superRefine((v, ctx) => {
19551
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
19552
+ code: ZodIssueCode.custom,
19553
+ message: "speed and timelapse are mutually exclusive",
19554
+ path: ["timelapse"]
19555
+ });
19556
+ });
19557
+ var ExportStateSchema = _enum([
19558
+ "queued",
19559
+ "rendering",
19560
+ "ready",
19561
+ "failed",
19562
+ "expired",
19563
+ "deleted"
19564
+ ]);
19565
+ /** One export job / history row. */
19566
+ var ExportRecordSchema = object({
19567
+ id: string(),
19568
+ deviceId: number(),
19569
+ profile: string(),
19570
+ fromMs: number(),
19571
+ toMs: number(),
19572
+ options: ExportOptionsSchema,
19573
+ state: ExportStateSchema,
19574
+ /** 0–100 while rendering; null otherwise. */
19575
+ progressPct: number().nullable(),
19576
+ /** File size once ready; null before. */
19577
+ fileBytes: number().nullable(),
19578
+ expiresAt: number(),
19579
+ deleteAfterDownload: boolean(),
19580
+ /** Epoch of the first complete download; null until then. */
19581
+ downloadedAt: number().nullable(),
19582
+ createdAt: number(),
19583
+ /** User id/name that requested the export. */
19584
+ createdBy: string(),
19585
+ /** Failure reason when state is 'failed'; null otherwise. */
19586
+ error: string().nullable()
19587
+ });
19588
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
19589
+ var ExportDownloadSchema = object({
19590
+ url: string(),
19591
+ endpoints: array(string())
19592
+ });
19593
+ method(object({
19594
+ deviceId: number(),
19595
+ profile: string(),
19596
+ fromMs: number(),
19597
+ toMs: number(),
19598
+ options: ExportOptionsSchema
19599
+ }), ExportRecordSchema, {
19600
+ kind: "mutation",
19601
+ auth: "protected"
19602
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
19603
+ kind: "query",
19604
+ auth: "protected"
19605
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19606
+ kind: "query",
19607
+ auth: "protected"
19608
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19609
+ kind: "mutation",
19610
+ auth: "protected"
19611
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19612
+ kind: "mutation",
19613
+ auth: "protected"
19614
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
19615
+ kind: "query",
19616
+ auth: "protected"
19617
+ });
19618
+ /**
19442
19619
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
19443
19620
  * payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
19444
19621
  * `deviceId`.
@@ -23362,6 +23539,42 @@ Object.freeze({
23362
23539
  addonId: null,
23363
23540
  access: "create"
23364
23541
  },
23542
+ "recordingExport.cancelExport": {
23543
+ capName: "recordingExport",
23544
+ capScope: "system",
23545
+ addonId: null,
23546
+ access: "create"
23547
+ },
23548
+ "recordingExport.createExport": {
23549
+ capName: "recordingExport",
23550
+ capScope: "system",
23551
+ addonId: null,
23552
+ access: "create"
23553
+ },
23554
+ "recordingExport.deleteExport": {
23555
+ capName: "recordingExport",
23556
+ capScope: "system",
23557
+ addonId: null,
23558
+ access: "delete"
23559
+ },
23560
+ "recordingExport.getDownloadUrl": {
23561
+ capName: "recordingExport",
23562
+ capScope: "system",
23563
+ addonId: null,
23564
+ access: "view"
23565
+ },
23566
+ "recordingExport.getExport": {
23567
+ capName: "recordingExport",
23568
+ capScope: "system",
23569
+ addonId: null,
23570
+ access: "view"
23571
+ },
23572
+ "recordingExport.listExports": {
23573
+ capName: "recordingExport",
23574
+ capScope: "system",
23575
+ addonId: null,
23576
+ access: "view"
23577
+ },
23365
23578
  "sceneMonitor.captureReference": {
23366
23579
  capName: "scene-monitor",
23367
23580
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-ai",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "AI addon for CamStack — the `llm` collection provider (cloud, LAN, and camstack-managed local llama.cpp profiles) plus the per-node `llm-runtime` managed executor.",
5
5
  "keywords": [
6
6
  "camstack",