@camstack/addon-model-studio 1.0.25 → 1.0.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.
@@ -4669,7 +4669,26 @@ function _instanceof(cls, params = {}) {
4669
4669
  return inst;
4670
4670
  }
4671
4671
  //#endregion
4672
- //#region ../types/dist/event-category-H4AVePnn.mjs
4672
+ //#region ../../node_modules/zod/v4/classic/compat.js
4673
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
4674
+ var ZodIssueCode = {
4675
+ invalid_type: "invalid_type",
4676
+ too_big: "too_big",
4677
+ too_small: "too_small",
4678
+ invalid_format: "invalid_format",
4679
+ not_multiple_of: "not_multiple_of",
4680
+ unrecognized_keys: "unrecognized_keys",
4681
+ invalid_union: "invalid_union",
4682
+ invalid_key: "invalid_key",
4683
+ invalid_element: "invalid_element",
4684
+ invalid_value: "invalid_value",
4685
+ custom: "custom"
4686
+ };
4687
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
4688
+ var ZodFirstPartyTypeKind;
4689
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
4690
+ //#endregion
4691
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
4673
4692
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4674
4693
  EventCategory["SystemBoot"] = "system.boot";
4675
4694
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -4822,6 +4841,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
4822
4841
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
4823
4842
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
4824
4843
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
4844
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
4845
+ * progress bar the client reconciles via `recordingExport.getExport`. */
4846
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
4847
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
4848
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
4825
4849
  EventCategory["DetectionEvent"] = "detection.event";
4826
4850
  EventCategory["SessionTrackNew"] = "session.track.new";
4827
4851
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -5111,6 +5135,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5111
5135
  */
5112
5136
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
5113
5137
  /**
5138
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
5139
+ * a package zone — a newly-appeared stationary object of a package class
5140
+ * that cleared the class / zone / dwell / size gates. Payload:
5141
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
5142
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
5143
+ * Telemetry (D8): the durable record is the `package-events` store row;
5144
+ * this bus topic drives notifier rules + live UI. See
5145
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
5146
+ */
5147
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
5148
+ /**
5149
+ * Fired by `addon-post-analysis` when a previously-delivered package
5150
+ * leaves its zone (the stationary entry departed — moved or swept).
5151
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
5152
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
5153
+ * Telemetry (D8). See package-zones-design §5.2.
5154
+ */
5155
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
5156
+ /**
5114
5157
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
5115
5158
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
5116
5159
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -7319,6 +7362,62 @@ var RecordingConfigSchema = object({
7319
7362
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7320
7363
  });
7321
7364
  /**
7365
+ * Ops-log — the durable, append-only operations audit shared by the
7366
+ * recordings and events management surfaces.
7367
+ *
7368
+ * ONE row shape is reused for both domains so a single "Activity" view can
7369
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7370
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7371
+ * management operation, WHY it ran (reason), and its measurable effect
7372
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7373
+ * never fail the operation it records.
7374
+ */
7375
+ /** Which management domain the operation belongs to. */
7376
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7377
+ /** The kind of management operation performed. */
7378
+ var OpsLogOpSchema = _enum([
7379
+ "prune",
7380
+ "manual-delete",
7381
+ "rescan",
7382
+ "retention-run"
7383
+ ]);
7384
+ /** Why the operation ran. */
7385
+ var OpsLogReasonSchema = _enum([
7386
+ "retention",
7387
+ "quota",
7388
+ "manual",
7389
+ "operator"
7390
+ ]);
7391
+ /** One audit row, shared verbatim by both domains. */
7392
+ var OpsLogEntrySchema = object({
7393
+ /** Unique row id. */
7394
+ id: string(),
7395
+ /** Epoch ms the operation completed. */
7396
+ at: number(),
7397
+ domain: OpsLogDomainSchema,
7398
+ op: OpsLogOpSchema,
7399
+ reason: OpsLogReasonSchema,
7400
+ /** The camera the op targeted; null for a cluster/global op. */
7401
+ deviceId: number().nullable(),
7402
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7403
+ nodeId: string(),
7404
+ /** Buckets / rows deleted (op-specific unit). */
7405
+ itemsAffected: number(),
7406
+ /** Bytes reclaimed by the op (0 when not measurable). */
7407
+ bytesReclaimed: number(),
7408
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7409
+ detail: string().nullable(),
7410
+ /** Who/what triggered the op. */
7411
+ actor: string()
7412
+ });
7413
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7414
+ var OpsLogQueryInputSchema = object({
7415
+ /** Restrict to a single camera; omit for every row. */
7416
+ deviceId: number().optional(),
7417
+ /** Max rows returned, newest-first. */
7418
+ limit: number().int().min(1).max(1e3).optional()
7419
+ });
7420
+ /**
7322
7421
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7323
7422
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7324
7423
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -12598,7 +12697,11 @@ array(ZoneRuleSchema).readonly();
12598
12697
  * Extend the enum here when a new gating consumer comes online (audio
12599
12698
  * gating, alert filtering, …) — no other surface needs to change.
12600
12699
  */
12601
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
12700
+ var ZoneRuleStageEnum = _enum([
12701
+ "motion",
12702
+ "detection",
12703
+ "package"
12704
+ ]);
12602
12705
  DeviceType.Camera, method(object({
12603
12706
  deviceId: number(),
12604
12707
  stage: ZoneRuleStageEnum
@@ -12611,7 +12714,8 @@ DeviceType.Camera, method(object({
12611
12714
  auth: "admin"
12612
12715
  }), object({
12613
12716
  motion: array(ZoneRuleSchema).readonly(),
12614
- detection: array(ZoneRuleSchema).readonly()
12717
+ detection: array(ZoneRuleSchema).readonly(),
12718
+ package: array(ZoneRuleSchema).readonly()
12615
12719
  });
12616
12720
  var ProviderStatusSchema = object({
12617
12721
  connected: boolean(),
@@ -15833,6 +15937,7 @@ var EventKindIconSchema = _enum([
15833
15937
  "smoke",
15834
15938
  "water",
15835
15939
  "button",
15940
+ "package",
15836
15941
  "generic"
15837
15942
  ]);
15838
15943
  var EventKindCategorySchema = _enum([
@@ -15840,7 +15945,8 @@ var EventKindCategorySchema = _enum([
15840
15945
  "audio",
15841
15946
  "detection",
15842
15947
  "sensor",
15843
- "custom"
15948
+ "custom",
15949
+ "package"
15844
15950
  ]);
15845
15951
  var EventKindDescriptorSchema = object({
15846
15952
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -16181,6 +16287,26 @@ var TrackCascadeCountsSchema = object({
16181
16287
  /** Per-track CLIP search vectors removed (best-effort). */
16182
16288
  embeddings: number().int()
16183
16289
  });
16290
+ /** Event-store footprint for one camera. */
16291
+ var EventStoreDeviceFootprintSchema = object({
16292
+ deviceId: number(),
16293
+ /** Persisted event rows (motion + object + audio) for the camera. */
16294
+ rows: number().int(),
16295
+ /** Event-owned media bytes on disk for the camera. */
16296
+ bytes: number().int()
16297
+ });
16298
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16299
+ var EventStoreFootprintSchema = object({
16300
+ totalRows: number().int(),
16301
+ totalBytes: number().int(),
16302
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16303
+ });
16304
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16305
+ var EventPruneCountsSchema = object({
16306
+ motion: number().int(),
16307
+ object: number().int(),
16308
+ audio: number().int()
16309
+ });
16184
16310
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16185
16311
  deviceId: number(),
16186
16312
  trackId: string()
@@ -16244,6 +16370,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16244
16370
  }), {
16245
16371
  kind: "mutation",
16246
16372
  auth: "admin"
16373
+ }), method(object({}), EventStoreFootprintSchema, {
16374
+ kind: "query",
16375
+ auth: "admin"
16376
+ }), method(object({
16377
+ olderThanMs: number(),
16378
+ reason: OpsLogReasonSchema.optional()
16379
+ }), EventPruneCountsSchema, {
16380
+ kind: "mutation",
16381
+ auth: "admin"
16382
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16383
+ kind: "mutation",
16384
+ auth: "admin"
16385
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16386
+ kind: "query",
16387
+ auth: "admin"
16247
16388
  }), method(object({
16248
16389
  eventId: string(),
16249
16390
  kind: MediaFileKindEnum.optional()
@@ -19477,13 +19618,131 @@ method(object({
19477
19618
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19478
19619
  kind: "mutation",
19479
19620
  auth: "admin"
19480
- }), method(object({ deviceId: number() }), object({
19621
+ }), method(object({
19622
+ deviceId: number(),
19623
+ reason: OpsLogReasonSchema.optional()
19624
+ }), object({
19481
19625
  floorMs: number().nullable(),
19482
19626
  deletedBuckets: number().int(),
19483
19627
  reclaimedBytes: number().int()
19484
19628
  }), {
19485
19629
  kind: "mutation",
19486
19630
  auth: "admin"
19631
+ }), method(object({
19632
+ deviceId: number(),
19633
+ fromMs: number().optional(),
19634
+ toMs: number().optional()
19635
+ }), object({
19636
+ deletedBuckets: number().int(),
19637
+ reclaimedBytes: number().int()
19638
+ }), {
19639
+ kind: "mutation",
19640
+ auth: "admin"
19641
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19642
+ kind: "query",
19643
+ auth: "admin"
19644
+ });
19645
+ /**
19646
+ * `recordingExport` cap — render a footage time range into a single downloadable
19647
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
19648
+ * bounded lifetime with a durable history, auto-expiry, and optional
19649
+ * delete-after-download.
19650
+ *
19651
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
19652
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
19653
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
19654
+ * input and dispatch to that single provider; the render runs on the node that
19655
+ * owns the footage (no cross-node segment transfer). Download rides the
19656
+ * framework addon data-plane. State persists in a DurableState blob (NOT
19657
+ * SQLite); history rows survive file deletion for audit.
19658
+ */
19659
+ /** Playback-speed multiplier for the render (1 = realtime). */
19660
+ var ExportSpeedSchema = number().min(.25).max(32);
19661
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
19662
+ var ExportTimelapseSchema = object({
19663
+ everyMs: number().int().positive(),
19664
+ outputFps: number().int().min(1).max(60).optional()
19665
+ });
19666
+ /**
19667
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
19668
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
19669
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
19670
+ * `deleteAfterDownload` removes it shortly after the first complete download.
19671
+ */
19672
+ var ExportOptionsSchema = object({
19673
+ speed: ExportSpeedSchema.optional(),
19674
+ timelapse: ExportTimelapseSchema.optional(),
19675
+ includeAudio: boolean(),
19676
+ maxLifeMs: number().int().positive(),
19677
+ deleteAfterDownload: boolean(),
19678
+ title: string().max(200).optional()
19679
+ }).superRefine((v, ctx) => {
19680
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
19681
+ code: ZodIssueCode.custom,
19682
+ message: "speed and timelapse are mutually exclusive",
19683
+ path: ["timelapse"]
19684
+ });
19685
+ });
19686
+ var ExportStateSchema = _enum([
19687
+ "queued",
19688
+ "rendering",
19689
+ "ready",
19690
+ "failed",
19691
+ "expired",
19692
+ "deleted"
19693
+ ]);
19694
+ /** One export job / history row. */
19695
+ var ExportRecordSchema = object({
19696
+ id: string(),
19697
+ deviceId: number(),
19698
+ profile: string(),
19699
+ fromMs: number(),
19700
+ toMs: number(),
19701
+ options: ExportOptionsSchema,
19702
+ state: ExportStateSchema,
19703
+ /** 0–100 while rendering; null otherwise. */
19704
+ progressPct: number().nullable(),
19705
+ /** File size once ready; null before. */
19706
+ fileBytes: number().nullable(),
19707
+ expiresAt: number(),
19708
+ deleteAfterDownload: boolean(),
19709
+ /** Epoch of the first complete download; null until then. */
19710
+ downloadedAt: number().nullable(),
19711
+ createdAt: number(),
19712
+ /** User id/name that requested the export. */
19713
+ createdBy: string(),
19714
+ /** Failure reason when state is 'failed'; null otherwise. */
19715
+ error: string().nullable()
19716
+ });
19717
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
19718
+ var ExportDownloadSchema = object({
19719
+ url: string(),
19720
+ endpoints: array(string())
19721
+ });
19722
+ method(object({
19723
+ deviceId: number(),
19724
+ profile: string(),
19725
+ fromMs: number(),
19726
+ toMs: number(),
19727
+ options: ExportOptionsSchema
19728
+ }), ExportRecordSchema, {
19729
+ kind: "mutation",
19730
+ auth: "protected"
19731
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
19732
+ kind: "query",
19733
+ auth: "protected"
19734
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19735
+ kind: "query",
19736
+ auth: "protected"
19737
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19738
+ kind: "mutation",
19739
+ auth: "protected"
19740
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
19741
+ kind: "mutation",
19742
+ auth: "protected"
19743
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
19744
+ kind: "query",
19745
+ auth: "protected"
19487
19746
  });
19488
19747
  /**
19489
19748
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -22503,6 +22762,12 @@ Object.freeze({
22503
22762
  addonId: null,
22504
22763
  access: "delete"
22505
22764
  },
22765
+ "pipelineAnalytics.deleteDeviceEvents": {
22766
+ capName: "pipeline-analytics",
22767
+ capScope: "device",
22768
+ addonId: null,
22769
+ access: "delete"
22770
+ },
22506
22771
  "pipelineAnalytics.deleteTracks": {
22507
22772
  capName: "pipeline-analytics",
22508
22773
  capScope: "device",
@@ -22533,6 +22798,12 @@ Object.freeze({
22533
22798
  addonId: null,
22534
22799
  access: "view"
22535
22800
  },
22801
+ "pipelineAnalytics.getEventStoreFootprint": {
22802
+ capName: "pipeline-analytics",
22803
+ capScope: "device",
22804
+ addonId: null,
22805
+ access: "view"
22806
+ },
22536
22807
  "pipelineAnalytics.getKeyEvents": {
22537
22808
  capName: "pipeline-analytics",
22538
22809
  capScope: "device",
@@ -22575,6 +22846,12 @@ Object.freeze({
22575
22846
  addonId: null,
22576
22847
  access: "view"
22577
22848
  },
22849
+ "pipelineAnalytics.listOpsLog": {
22850
+ capName: "pipeline-analytics",
22851
+ capScope: "device",
22852
+ addonId: null,
22853
+ access: "view"
22854
+ },
22578
22855
  "pipelineAnalytics.listRecentTracks": {
22579
22856
  capName: "pipeline-analytics",
22580
22857
  capScope: "device",
@@ -22587,6 +22864,12 @@ Object.freeze({
22587
22864
  addonId: null,
22588
22865
  access: "view"
22589
22866
  },
22867
+ "pipelineAnalytics.pruneEvents": {
22868
+ capName: "pipeline-analytics",
22869
+ capScope: "device",
22870
+ addonId: null,
22871
+ access: "create"
22872
+ },
22590
22873
  "pipelineAnalytics.pruneEventsBefore": {
22591
22874
  capName: "pipeline-analytics",
22592
22875
  capScope: "device",
@@ -23349,6 +23632,12 @@ Object.freeze({
23349
23632
  addonId: null,
23350
23633
  access: "create"
23351
23634
  },
23635
+ "recording.deleteFootprint": {
23636
+ capName: "recording",
23637
+ capScope: "system",
23638
+ addonId: null,
23639
+ access: "delete"
23640
+ },
23352
23641
  "recording.getAvailability": {
23353
23642
  capName: "recording",
23354
23643
  capScope: "system",
@@ -23379,6 +23668,12 @@ Object.freeze({
23379
23668
  addonId: null,
23380
23669
  access: "view"
23381
23670
  },
23671
+ "recording.listOpsLog": {
23672
+ capName: "recording",
23673
+ capScope: "system",
23674
+ addonId: null,
23675
+ access: "view"
23676
+ },
23382
23677
  "recording.locateSegment": {
23383
23678
  capName: "recording",
23384
23679
  capScope: "system",
@@ -23409,6 +23704,42 @@ Object.freeze({
23409
23704
  addonId: null,
23410
23705
  access: "create"
23411
23706
  },
23707
+ "recordingExport.cancelExport": {
23708
+ capName: "recordingExport",
23709
+ capScope: "system",
23710
+ addonId: null,
23711
+ access: "create"
23712
+ },
23713
+ "recordingExport.createExport": {
23714
+ capName: "recordingExport",
23715
+ capScope: "system",
23716
+ addonId: null,
23717
+ access: "create"
23718
+ },
23719
+ "recordingExport.deleteExport": {
23720
+ capName: "recordingExport",
23721
+ capScope: "system",
23722
+ addonId: null,
23723
+ access: "delete"
23724
+ },
23725
+ "recordingExport.getDownloadUrl": {
23726
+ capName: "recordingExport",
23727
+ capScope: "system",
23728
+ addonId: null,
23729
+ access: "view"
23730
+ },
23731
+ "recordingExport.getExport": {
23732
+ capName: "recordingExport",
23733
+ capScope: "system",
23734
+ addonId: null,
23735
+ access: "view"
23736
+ },
23737
+ "recordingExport.listExports": {
23738
+ capName: "recordingExport",
23739
+ capScope: "system",
23740
+ addonId: null,
23741
+ access: "view"
23742
+ },
23412
23743
  "sceneMonitor.captureReference": {
23413
23744
  capName: "scene-monitor",
23414
23745
  capScope: "device",