@camstack/addon-ai 0.2.16 → 0.2.18

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
@@ -7294,8 +7294,31 @@ var AdoptionJobSchema = object({
7294
7294
  error: string().nullable()
7295
7295
  });
7296
7296
  /**
7297
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7298
- * pipeline functions an operator thinks in terms of.
7297
+ * Per-camera FUNCTION SWITCHES.
7298
+ *
7299
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7300
+ *
7301
+ * This file shipped as "the one coherent on/off surface over the pipeline
7302
+ * functions an operator thinks in terms of". The operator's verdict on
7303
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7304
+ * every function already had a settings page of its own, and a second place to
7305
+ * turn it off is a second place to look. Each switch is going back to its own
7306
+ * component's original options — detection to the detection-pipeline wrapper
7307
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7308
+ * (which was always first-class; the switch was a veneer over
7309
+ * `recording.setDeviceConfig`), notifications to a notification-center
7310
+ * per-device setting, the two camera planes to their own components.
7311
+ *
7312
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7313
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7314
+ * straight from the authorities with no group in the middle. That rule was
7315
+ * never about a control panel.
7316
+ *
7317
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7318
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7319
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7320
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7321
+ * stop; nothing new may be built on it.
7299
7322
  *
7300
7323
  * ## This file adds no state
7301
7324
  *
@@ -7640,14 +7663,21 @@ var RecordingConfigSchema = object({
7640
7663
  /**
7641
7664
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7642
7665
  *
7643
- * One shape shared by the recorder's `relocateFootage` (segments) and
7644
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7645
- * page renders both movers with one component. Jobs are in-RAM (a restart
7646
- * forgets them — re-running is safe by construction: copy-if-absent, delete
7647
- * after verify) and each completed/failed run also lands one durable ops-log
7648
- * row on the owning addon's surface.
7666
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7667
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7668
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7669
+ * Each completed/failed run also lands one durable ops-log row on its owning
7670
+ * addon surface.
7671
+ */
7672
+ /**
7673
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7674
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7675
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7676
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7677
+ * runs at all.
7649
7678
  */
7650
7679
  var RelocateJobStateSchema = _enum([
7680
+ "queued",
7651
7681
  "running",
7652
7682
  "done",
7653
7683
  "failed",
@@ -7672,19 +7702,109 @@ var RelocateJobSchema = object({
7672
7702
  finishedAt: number().nullable(),
7673
7703
  error: string().nullable()
7674
7704
  });
7705
+ /** Profile-derived footage selection used only by the migration coordinator:
7706
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7707
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7675
7708
  var RelocateFootageInputSchema = object({
7676
- deviceId: number().optional(),
7677
7709
  fromLocationId: string(),
7678
7710
  toLocationId: string(),
7679
7711
  entities: array(_enum(["segments"])).optional(),
7712
+ /** Limits relocation to the logical profile class. Omit only for the
7713
+ * pre-orchestration compatibility path. */
7714
+ footageClass: RelocateFootageClassSchema.optional(),
7715
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7716
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7717
+ * unit is a (camera, profile) pile, not a disk. */
7718
+ deviceId: number().int().optional(),
7719
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7720
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7721
+ * placement plan assigns those two independently, so a rebalance that could
7722
+ * only say "recordings" would move footage the plan never asked to move. */
7723
+ profiles: array(string()).optional(),
7680
7724
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7681
7725
  * never allowed to starve live writers. */
7682
7726
  throttleMbps: number().min(1).max(1e3).optional()
7683
7727
  });
7684
- var RelocateMediaInputSchema = object({
7685
- deviceId: number().optional(),
7728
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7729
+ * from persistent recording settings: a migration never changes
7730
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7731
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7732
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7733
+ var StorageMigrationMediaMoveInputSchema = object({
7686
7734
  toLocationId: string(),
7687
7735
  throttleMbps: number().min(1).max(1e3).optional()
7736
+ }).extend({ leaseId: string().min(1) });
7737
+ /** The independently selectable logical storage classes. `recordings`
7738
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7739
+ * segments; `eventMedia` is post-analysis blobs. */
7740
+ var StorageMigrationClassSchema = _enum([
7741
+ "recordings",
7742
+ "recordingsLow",
7743
+ "eventMedia"
7744
+ ]);
7745
+ /** A destination is always an existing, fully-qualified location id. The
7746
+ * migration API intentionally never changes a source location's `basePath`:
7747
+ * callers create a new `<type>:<slug>` location, then select it here. */
7748
+ var StorageMigrationDestinationsSchema = object({
7749
+ recordings: string().min(1).optional(),
7750
+ recordingsLow: string().min(1).optional(),
7751
+ eventMedia: string().min(1).optional()
7752
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7753
+ /** Shared input for planning and starting an orchestrated storage migration. */
7754
+ var StorageMigrationInputSchema = object({
7755
+ destinations: StorageMigrationDestinationsSchema,
7756
+ throttleMbps: number().min(1).max(1e3).optional()
7757
+ });
7758
+ /** The durable coordinator state machine. The only phase that changes default
7759
+ * locations is `repointing`, after every selected mover has completed and been
7760
+ * verified. */
7761
+ var StorageMigrationPhaseSchema = _enum([
7762
+ "planning",
7763
+ "pausing",
7764
+ "moving",
7765
+ "verifying",
7766
+ "repointing",
7767
+ "refreshing",
7768
+ "resuming",
7769
+ "done",
7770
+ "failed",
7771
+ "cancelled"
7772
+ ]);
7773
+ var StorageMigrationParticipantSchema = _enum([
7774
+ "pipeline",
7775
+ "recorder",
7776
+ "analytics"
7777
+ ]);
7778
+ var StorageMigrationMoveSchema = object({
7779
+ storageClass: StorageMigrationClassSchema,
7780
+ fromLocationId: string(),
7781
+ toLocationId: string(),
7782
+ moverJobId: string().nullable(),
7783
+ state: RelocateJobStateSchema.nullable(),
7784
+ error: string().nullable()
7785
+ });
7786
+ var StorageMigrationJobSchema = object({
7787
+ jobId: string(),
7788
+ phase: StorageMigrationPhaseSchema,
7789
+ destinations: StorageMigrationDestinationsSchema,
7790
+ throttleMbps: number(),
7791
+ moves: array(StorageMigrationMoveSchema),
7792
+ pauseLeaseId: string().nullable(),
7793
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7794
+ repointed: boolean(),
7795
+ cancelRequested: boolean(),
7796
+ startedAt: number(),
7797
+ updatedAt: number(),
7798
+ finishedAt: number().nullable(),
7799
+ error: string().nullable()
7800
+ });
7801
+ var StorageMigrationPlanSchema = object({
7802
+ destinations: StorageMigrationDestinationsSchema,
7803
+ moves: array(object({
7804
+ storageClass: StorageMigrationClassSchema,
7805
+ fromLocationId: string(),
7806
+ toLocationId: string()
7807
+ }))
7688
7808
  });
7689
7809
  /**
7690
7810
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7736,6 +7856,21 @@ var StorageLocationSchema = object({
7736
7856
  nodeId: string().optional(),
7737
7857
  isDefault: boolean().default(false),
7738
7858
  isSystem: boolean().default(false),
7859
+ /**
7860
+ * Operator opt-in: whether consumers that BALANCE across several locations
7861
+ * of a type may write here. Recordings reads it today; event media and
7862
+ * backups are the next consumers, which is why the flag lives on the
7863
+ * location rather than in any one addon's store — nothing has to be
7864
+ * extended to add the next consumer.
7865
+ *
7866
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7867
+ * flag existed reads back with no flag and keeps working exactly as before;
7868
+ * that is the whole compat story, and it is why no migration ships with it.
7869
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7870
+ * disk must not silently start writing to it); the default of a type is
7871
+ * always stamped `true`.
7872
+ */
7873
+ enabled: boolean().optional(),
7739
7874
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7740
7875
  * for node-local locations it can reach) — never persisted, absent when the
7741
7876
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12038,7 +12173,8 @@ method(object({
12038
12173
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12039
12174
  /**
12040
12175
  * filesystem-browse — per-node capability for browsing the node's local
12041
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12176
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12177
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12042
12178
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12043
12179
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12044
12180
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -13896,6 +14032,13 @@ var MaskGridDimsSchema = object({
13896
14032
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
13897
14033
  * this one field keeps the schema additive — a rule still declares exactly
13898
14034
  * one trigger.
14035
+ *
14036
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14037
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14038
+ * mirror.ts` fails the build on a member the app cannot render) and every
14039
+ * member costs a release train. A sustained-sound rule is therefore an
14040
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14041
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
13899
14042
  */
13900
14043
  var NcDeliverySchema = _enum([
13901
14044
  "immediate",
@@ -13910,15 +14053,32 @@ var NcDeliverySchema = _enum([
13910
14053
  * depend on a provider's raw event name or payload shape.
13911
14054
  */
13912
14055
  var NcSystemEventKindSchema = _enum([
13913
- "camera-online",
13914
- "camera-offline",
14056
+ "device-online",
14057
+ "device-offline",
14058
+ "device-disabled",
14059
+ "device-enabled",
13915
14060
  "stream-online",
13916
14061
  "stream-offline",
13917
14062
  "node-online",
13918
14063
  "node-offline",
13919
14064
  "addon-update-available",
13920
- "server-update-available"
14065
+ "server-update-available",
14066
+ "alarm-triggered",
14067
+ "alarm-armed",
14068
+ "alarm-disarmed",
14069
+ "camera-online",
14070
+ "camera-offline",
14071
+ "camera-disabled",
14072
+ "camera-enabled"
14073
+ ]);
14074
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14075
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14076
+ "camera-online",
14077
+ "camera-offline",
14078
+ "camera-disabled",
14079
+ "camera-enabled"
13921
14080
  ]);
14081
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
13922
14082
  /**
13923
14083
  * One coherent system-event condition. `kinds` is the required opt-in safety
13924
14084
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -13927,6 +14087,18 @@ var NcSystemEventKindSchema = _enum([
13927
14087
  var NcSystemEventConditionSchema = object({
13928
14088
  kinds: array(NcSystemEventKindSchema).min(1),
13929
14089
  deviceIds: array(number().int()).min(1).optional(),
14090
+ /**
14091
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14092
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14093
+ * is what a liveness rule means when nobody said otherwise.
14094
+ *
14095
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14096
+ * one reason: the intake cannot know which devices this household cares
14097
+ * about, and a producer-side filter is one no operator can change. Fails
14098
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14099
+ * does not carry) matches no `deviceTypes` list.
14100
+ */
14101
+ deviceTypes: array(string().min(1)).min(1).optional(),
13930
14102
  nodeIds: array(string().min(1)).min(1).optional(),
13931
14103
  packageNames: array(string().min(1)).min(1).optional()
13932
14104
  });
@@ -13977,6 +14149,47 @@ var NcOccupancyConditionSchema = object({
13977
14149
  sustainSeconds: number().int().min(0).max(3600).default(15)
13978
14150
  });
13979
14151
  /**
14152
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14153
+ *
14154
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14155
+ * reference notifier uses, so an operator moving between them re-uses what
14156
+ * they already know): a rule matches when, over a sampling window of
14157
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14158
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14159
+ *
14160
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14161
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14162
+ * - `labels` — the classifier put at least one of these labels on it.
14163
+ *
14164
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14165
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14166
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14167
+ * is given** — a window in which every sample is trivially a hit would fire on
14168
+ * silence, so the engine refuses such a condition rather than notifying on
14169
+ * nothing (the schema cannot express "at least one of" without becoming a
14170
+ * ZodEffects the cap path would have to special-case).
14171
+ *
14172
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14173
+ * must be FULL before it can match — a window that has been open for two
14174
+ * seconds of its ten is 100% of nothing, and firing on it would make
14175
+ * `samplingSeconds` decorative.
14176
+ *
14177
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14178
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14179
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14180
+ * an operator who typed `dog` mean the same thing.
14181
+ */
14182
+ var NcAudioConditionSchema = object({
14183
+ /** Audio macro labels; absent = any sound (level-only rule). */
14184
+ labels: array(string().min(1)).min(1).optional(),
14185
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14186
+ dbThreshold: number().min(-96).max(0).optional(),
14187
+ /** Percentage of the window's samples that must be hits (1–100). */
14188
+ hitPercent: number().int().min(1).max(100).default(60),
14189
+ /** Length of the sampling window in seconds. */
14190
+ samplingSeconds: number().int().min(1).max(300).default(10)
14191
+ });
14192
+ /**
13980
14193
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
13981
14194
  *
13982
14195
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14249,7 +14462,33 @@ var NcConditionsSchema = object({
14249
14462
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14250
14463
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14251
14464
  */
14252
- occupancy: NcOccupancyConditionSchema.optional()
14465
+ occupancy: NcOccupancyConditionSchema.optional(),
14466
+ /**
14467
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14468
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14469
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14470
+ * a window that is not full yet, neither filter given). See
14471
+ * {@link NcAudioCondition}.
14472
+ *
14473
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14474
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14475
+ * a detection, a track or a device event (the same fail-closed pairing
14476
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14477
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14478
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14479
+ * classified sample) stays exactly as it was for rules that already use it.
14480
+ *
14481
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14482
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14483
+ * (`camstack/src/data/notification-center.ts`, guarded by
14484
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14485
+ * condition fields it does not know when a rule is saved from the phone.
14486
+ * Publishing an editor for a condition the app cannot round-trip is how an
14487
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14488
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14489
+ * does an audio rule become authorable.
14490
+ */
14491
+ audio: NcAudioConditionSchema.optional()
14253
14492
  });
14254
14493
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14255
14494
  var NcRuleTargetSchema = object({
@@ -14363,6 +14602,73 @@ var NcThrottleSchema = object({
14363
14602
  */
14364
14603
  granularity: NcThrottleGranularitySchema.optional()
14365
14604
  });
14605
+ /**
14606
+ * How long the confirm gate may hold ONE notification, and how big the picture
14607
+ * it judges may be.
14608
+ *
14609
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14610
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14611
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14612
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14613
+ * tokens for pixels the model pools away.
14614
+ */
14615
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14616
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14617
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14618
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14619
+ var NcConfirmExpectSchema = object({
14620
+ op: _enum([
14621
+ ">=",
14622
+ ">",
14623
+ "<=",
14624
+ "<",
14625
+ "=="
14626
+ ]),
14627
+ count: number().int().min(0).max(1e3)
14628
+ });
14629
+ /**
14630
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14631
+ * to ship and says whether it agrees with the rule.
14632
+ *
14633
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14634
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14635
+ * on the operator's phone is not a verdict about this notification.
14636
+ *
14637
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14638
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14639
+ * the default and every fail-open is COUNTED, because a gate that always fails
14640
+ * open looks in the log exactly like a gate that works.
14641
+ *
14642
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14643
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14644
+ * production failures in one day), so the gate reads absent as the constant
14645
+ * above rather than trusting a parse it may never have seen.
14646
+ */
14647
+ var NcConfirmSchema = object({
14648
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14649
+ * same thing, and both mean "deliver exactly as before". */
14650
+ enabled: boolean().default(false),
14651
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14652
+ profileId: string().optional(),
14653
+ /**
14654
+ * The operator's question, in his own words. Absent = a question derived
14655
+ * from the rule (its class and its expectation).
14656
+ *
14657
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14658
+ * banners, signage and plates as instructions if you let them reach the
14659
+ * prompt — proven live — so the authoritative contract stays in the system
14660
+ * turn and only rule-authored words land here.
14661
+ */
14662
+ prompt: string().max(1e3).optional(),
14663
+ /** Fire only when the model's count satisfies this. Absent = the model's
14664
+ * own boolean verdict decides. */
14665
+ expect: NcConfirmExpectSchema.optional(),
14666
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14667
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14668
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14669
+ /** Longest edge the judged image is downscaled to before it is sent. */
14670
+ maxImagePx: number().int().min(64).max(2048).default(448)
14671
+ });
14366
14672
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14367
14673
  var NcRuleInputSchema = object({
14368
14674
  name: string().min(1).max(200),
@@ -14423,7 +14729,13 @@ var NcRuleInputSchema = object({
14423
14729
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14424
14730
  * shape as every other actuation.
14425
14731
  */
14426
- actions: NcRuleActionsSchema.optional()
14732
+ actions: NcRuleActionsSchema.optional(),
14733
+ /**
14734
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14735
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14736
+ * did, and absent is the only way to say that without a migration.
14737
+ */
14738
+ confirm: NcConfirmSchema.optional()
14427
14739
  });
14428
14740
  /**
14429
14741
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14434,7 +14746,37 @@ var NcRuleInputSchema = object({
14434
14746
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14435
14747
  * `updateRule` patch.
14436
14748
  */
14437
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14749
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14750
+ disabledTargetIds: array(string()).optional(),
14751
+ /**
14752
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14753
+ *
14754
+ * It makes the key optional to SUPPLY; the parse still materialises the
14755
+ * default when the key is absent. And `NcRuleStore.update` merges with
14756
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14757
+ * one — which made every partial edit destructive:
14758
+ *
14759
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14760
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14761
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14762
+ *
14763
+ * A rule scoped to one camera and one zone silently became a rule that
14764
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14765
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14766
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14767
+ * within a minute of a two-field patch.
14768
+ *
14769
+ * So every defaulted field is re-declared here WITHOUT its default. The
14770
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14771
+ * conditions remains a real instruction ("clear them") — and only the
14772
+ * absent key is now genuinely absent.
14773
+ */
14774
+ enabled: boolean().optional(),
14775
+ conditions: NcConditionsSchema.optional(),
14776
+ media: NcMediaPolicySchema.optional(),
14777
+ throttle: NcThrottleSchema.optional(),
14778
+ priority: number().int().min(1).max(5).optional()
14779
+ });
14438
14780
  /** A persisted rule. */
14439
14781
  var NcRuleSchema = NcRuleInputSchema.extend({
14440
14782
  id: string(),
@@ -14735,6 +15077,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14735
15077
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14736
15078
  * copy would lie the first time a rule is disabled.
14737
15079
  */
15080
+ /**
15081
+ * Why a device a mode NAMES is nonetheless not armed by it.
15082
+ *
15083
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15084
+ * per-camera notification switch the Notification Center already owns,
15085
+ * `detection-off` is the device's own detection binding being inactive, and
15086
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15087
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15088
+ * with the switches the operator actually used.
15089
+ */
15090
+ var NcAlarmSkipReasonSchema = _enum([
15091
+ "muted",
15092
+ "detection-off",
15093
+ "offline"
15094
+ ]);
15095
+ var NcAlarmSkippedDeviceSchema = object({
15096
+ deviceId: number().int(),
15097
+ reason: NcAlarmSkipReasonSchema
15098
+ });
14738
15099
  var NcAlarmModeCoverageSchema = object({
14739
15100
  mode: AlarmArmModeSchema,
14740
15101
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14742,7 +15103,18 @@ var NcAlarmModeCoverageSchema = object({
14742
15103
  /** At least one covering rule has no device scope, so the mode covers all. */
14743
15104
  allDevices: boolean(),
14744
15105
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14745
- deviceIds: array(number().int())
15106
+ deviceIds: array(number().int()),
15107
+ /**
15108
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15109
+ * excludes it.
15110
+ *
15111
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15112
+ * twelve makes it false in exactly the way nobody notices until an incident.
15113
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15114
+ * still parses as "nothing known to be skipped" rather than failing the whole
15115
+ * alarm tab.
15116
+ */
15117
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14746
15118
  });
14747
15119
  var NcAlarmConfigSchema = object({
14748
15120
  /**
@@ -16105,13 +16477,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16105
16477
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16106
16478
  kind: "mutation",
16107
16479
  auth: "admin"
16108
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16480
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16109
16481
  kind: "mutation",
16110
16482
  auth: "admin"
16111
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16112
- kind: "query",
16483
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16484
+ kind: "mutation",
16113
16485
  auth: "admin"
16114
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16486
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16487
+ kind: "mutation",
16488
+ auth: "admin"
16489
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16490
+ kind: "mutation",
16491
+ auth: "admin"
16492
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16115
16493
  kind: "mutation",
16116
16494
  auth: "admin"
16117
16495
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17535,9 +17913,16 @@ var CameraStatusSchema = object({
17535
17913
  audio: CameraAudioStatusSchema.nullable(),
17536
17914
  recording: CameraRecordingStatusSchema.nullable(),
17537
17915
  /**
17538
- * Per-camera function switches an OPERATOR has turned off
17916
+ * Per-camera functions an OPERATOR has turned off
17539
17917
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17540
17918
  *
17919
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
17920
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
17921
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
17922
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
17923
+ * The badge outlives the control panel: the panel was a convenience, this is
17924
+ * the difference between a camera being off and a camera being dead.
17925
+ *
17541
17926
  * This is the difference between DISABLED and BROKEN. A camera whose
17542
17927
  * `detection` block reports zero fps and whose `switchedOff` contains
17543
17928
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17608,7 +17993,13 @@ var NodeInferenceDevicesSchema = object({
17608
17993
  reachable: boolean(),
17609
17994
  devices: array(NodeInferenceDeviceSchema).readonly()
17610
17995
  });
17611
- method(object({
17996
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17997
+ kind: "mutation",
17998
+ auth: "admin"
17999
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
18000
+ kind: "mutation",
18001
+ auth: "admin"
18002
+ }), method(object({
17612
18003
  deviceId: number(),
17613
18004
  agentNodeId: string()
17614
18005
  }), object({ success: literal(true) }), {
@@ -18282,6 +18673,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18282
18673
  locationId: string(),
18283
18674
  targetBytes: number().int().positive()
18284
18675
  }), EvictResultSchema, { kind: "mutation" });
18676
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18677
+ kind: "mutation",
18678
+ auth: "admin"
18679
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18680
+ kind: "mutation",
18681
+ auth: "admin"
18682
+ });
18285
18683
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18286
18684
  providerId: string().min(1),
18287
18685
  displayName: string().min(1),
@@ -18385,6 +18783,28 @@ var TerminalProfileInfoSchema = object({
18385
18783
  label: string(),
18386
18784
  description: string().optional()
18387
18785
  });
18786
+ /**
18787
+ * A durable operator-created Terminal instance. Profiles are templates; only
18788
+ * an instance declares a camera.
18789
+ */
18790
+ var TerminalInstanceInfoSchema = object({
18791
+ instanceId: string(),
18792
+ cameraStableId: string(),
18793
+ nodeId: string(),
18794
+ profileId: string(),
18795
+ profileLabel: string(),
18796
+ name: string(),
18797
+ enabled: boolean()
18798
+ });
18799
+ var TerminalLegacyCameraSchema = object({
18800
+ stableId: string(),
18801
+ nodeId: string(),
18802
+ profileId: string(),
18803
+ profileLabel: string(),
18804
+ name: string(),
18805
+ /** Only legacy monitor cameras can retain their historic stable identity. */
18806
+ adoptable: boolean()
18807
+ });
18388
18808
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18389
18809
  seq: number().int().positive(),
18390
18810
  kind: literal("data"),
@@ -18401,7 +18821,29 @@ var TerminalOutputBatchSchema = object({
18401
18821
  snapshot: string().optional(),
18402
18822
  events: array(TerminalOutputEventSchema).readonly()
18403
18823
  });
18404
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18824
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
18825
+ targetNodeId: string().min(1),
18826
+ profileId: string().min(1),
18827
+ name: string().trim().min(1).max(160).optional()
18828
+ }), TerminalInstanceInfoSchema, {
18829
+ kind: "mutation",
18830
+ auth: "admin"
18831
+ }), method(object({ instanceId: string().min(1) }), _void(), {
18832
+ kind: "mutation",
18833
+ auth: "admin"
18834
+ }), method(object({
18835
+ instanceId: string().min(1),
18836
+ enabled: boolean()
18837
+ }), TerminalInstanceInfoSchema, {
18838
+ kind: "mutation",
18839
+ auth: "admin"
18840
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
18841
+ stableId: string().min(1),
18842
+ name: string().trim().min(1).max(160).optional()
18843
+ }), TerminalInstanceInfoSchema, {
18844
+ kind: "mutation",
18845
+ auth: "admin"
18846
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18405
18847
  profileId: string(),
18406
18848
  cols: number().int().positive(),
18407
18849
  rows: number().int().positive()
@@ -18418,7 +18860,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18418
18860
  }), method(object({
18419
18861
  sessionId: string(),
18420
18862
  afterSeq: number().int().nonnegative(),
18421
- waitMs: number().int().min(0).max(2e3).default(0)
18863
+ waitMs: number().int().min(0).max(2e3).default(0),
18864
+ /**
18865
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
18866
+ * browser's initial repaint remains immediate; the camera snapshot
18867
+ * relay uses it to avoid encoding a blank startup frame.
18868
+ */
18869
+ waitForOutput: boolean().optional()
18422
18870
  }), TerminalOutputBatchSchema, {
18423
18871
  kind: "mutation",
18424
18872
  auth: "admin",
@@ -20359,6 +20807,7 @@ var FaceInfoSchema = object({
20359
20807
  var FaceFilterEnum = _enum([
20360
20808
  "unassigned",
20361
20809
  "recognized",
20810
+ "identified",
20362
20811
  "all"
20363
20812
  ]);
20364
20813
  var MediaFileLiteSchema$1 = object({
@@ -20387,6 +20836,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
20387
20836
  kind: "mutation",
20388
20837
  auth: "admin"
20389
20838
  }), method(object({
20839
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
20840
+ deviceId: number().int().optional(),
20390
20841
  limit: number().int().positive().optional(),
20391
20842
  filter: FaceFilterEnum.optional(),
20392
20843
  /**
@@ -22152,6 +22603,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
22152
22603
  capName: string().min(1).max(64),
22153
22604
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
22154
22605
  valuePath: string().min(1).max(64)
22606
+ }),
22607
+ object({
22608
+ kind: literal("latest-recognition"),
22609
+ recognition: _enum(["person", "plate"])
22155
22610
  })
22156
22611
  ]);
22157
22612
  var OsdSlotBindingSchema = object({
@@ -22257,6 +22712,15 @@ method(object({ deviceId: number().int() }), object({
22257
22712
  }), object({ success: literal(true) }), {
22258
22713
  kind: "mutation",
22259
22714
  auth: "admin"
22715
+ }), method(object({
22716
+ sourceDeviceId: number().int(),
22717
+ targetDeviceId: number().int()
22718
+ }), object({
22719
+ copied: number().int().nonnegative(),
22720
+ skipped: number().int().nonnegative()
22721
+ }), {
22722
+ kind: "mutation",
22723
+ auth: "admin"
22260
22724
  }), method(object({
22261
22725
  deviceId: number().int(),
22262
22726
  slotId: string().min(1),
@@ -22967,7 +23431,19 @@ var RecordingManifestSchema = object({
22967
23431
  * profiles/subtrees/locations on this node). */
22968
23432
  var RecordingDeviceUsageSchema = object({
22969
23433
  deviceId: number(),
22970
- usedBytes: number()
23434
+ usedBytes: number(),
23435
+ /**
23436
+ * Start of this camera's OLDEST indexed segment, across every profile and
23437
+ * location — the "Oldest footage" column in Recordings → Storage, and the
23438
+ * only honest answer to "is retention actually holding?" per camera.
23439
+ *
23440
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
23441
+ * predates this field omits it entirely, and a hub whose types carry the
23442
+ * field must keep validating that older provider's payload: the framework
23443
+ * (types) and the addon ship on different trains, and the addon is usually
23444
+ * the later of the two.
23445
+ */
23446
+ oldestMs: number().nullable().optional()
22971
23447
  });
22972
23448
  /** Recording storage usage + capacity for one storage location. */
22973
23449
  var RecordingLocationUsageSchema = object({
@@ -22995,6 +23471,57 @@ var RecordingStorageUsageSchema = object({
22995
23471
  locations: array(RecordingLocationUsageSchema)
22996
23472
  });
22997
23473
  /**
23474
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
23475
+ *
23476
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
23477
+ * is the operator asking for the EXISTING archive to be brought into line with
23478
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
23479
+ * location, run FIFO behind the single-flight mover.
23480
+ *
23481
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
23482
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
23483
+ * (empty on the plan).
23484
+ */
23485
+ var RecordingRebalanceMoveSchema = object({
23486
+ deviceId: number(),
23487
+ profile: string(),
23488
+ fromLocationId: string(),
23489
+ toLocationId: string(),
23490
+ bytes: number(),
23491
+ files: number().int()
23492
+ });
23493
+ /** Why a pile that is out of place is staying there. Every refusal is
23494
+ * reported: a rebalance that silently drops a camera reads exactly like one
23495
+ * that had nothing to do. */
23496
+ var RecordingRebalanceSkipReasonSchema = _enum([
23497
+ "unassigned",
23498
+ "target-not-writable",
23499
+ "below-threshold",
23500
+ "no-headroom"
23501
+ ]);
23502
+ var RecordingRebalanceSkipSchema = object({
23503
+ deviceId: number(),
23504
+ profile: string(),
23505
+ fromLocationId: string(),
23506
+ /** The location the plan wants; null when the camera has no assignment. */
23507
+ toLocationId: string().nullable(),
23508
+ bytes: number(),
23509
+ reason: RecordingRebalanceSkipReasonSchema
23510
+ });
23511
+ var RecordingRebalancePlanSchema = object({
23512
+ moves: array(RecordingRebalanceMoveSchema),
23513
+ skipped: array(RecordingRebalanceSkipSchema),
23514
+ bytesToMove: number(),
23515
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
23516
+ jobIds: array(string())
23517
+ });
23518
+ var RecordingRebalanceInputSchema = object({
23519
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
23520
+ throttleMbps: number().min(1).max(1e3).optional(),
23521
+ /** Ignore piles smaller than this (default 1 GB). */
23522
+ minMoveGb: number().min(0).optional()
23523
+ });
23524
+ /**
22998
23525
  * Result of locating footage at a wall-clock instant for one device/profile.
22999
23526
  * `segment` carries the covering segment's window; `gap` reports the forward
23000
23527
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -23142,6 +23669,21 @@ method(object({
23142
23669
  }), {
23143
23670
  kind: "mutation",
23144
23671
  auth: "admin"
23672
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23673
+ kind: "mutation",
23674
+ auth: "admin"
23675
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
23676
+ kind: "mutation",
23677
+ auth: "admin"
23678
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
23679
+ kind: "mutation",
23680
+ auth: "admin"
23681
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
23682
+ kind: "mutation",
23683
+ auth: "admin"
23684
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23685
+ kind: "mutation",
23686
+ auth: "admin"
23145
23687
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23146
23688
  kind: "mutation",
23147
23689
  auth: "admin"
@@ -23151,9 +23693,15 @@ method(object({
23151
23693
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23152
23694
  kind: "mutation",
23153
23695
  auth: "admin"
23696
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23697
+ kind: "query",
23698
+ auth: "admin"
23699
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23700
+ kind: "mutation",
23701
+ auth: "admin"
23154
23702
  });
23155
23703
  /**
23156
- * `recordingExport` cap — render a footage time range into a single downloadable
23704
+ * `recording-export` cap — render a footage time range into a single downloadable
23157
23705
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
23158
23706
  * bounded lifetime with a durable history, auto-expiry, and optional
23159
23707
  * delete-after-download.
@@ -23168,10 +23716,42 @@ method(object({
23168
23716
  */
23169
23717
  /** Playback-speed multiplier for the render (1 = realtime). */
23170
23718
  var ExportSpeedSchema = number().min(.25).max(32);
23719
+ /**
23720
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23721
+ *
23722
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
23723
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23724
+ * playlist. Handing it absolute epochs would make every call site responsible
23725
+ * for the same subtraction, and the one that forgot would emit a filter that
23726
+ * selects nothing — silently, as a uniform timelapse.
23727
+ */
23728
+ var ExportDenseRangeSchema = object({
23729
+ fromSec: number().nonnegative(),
23730
+ toSec: number().nonnegative()
23731
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
23732
+ /**
23733
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
23734
+ * listed ranges and at the base `everyMs` everywhere else.
23735
+ *
23736
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
23737
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
23738
+ */
23739
+ var ExportDenseSchema = object({
23740
+ everyMs: number().int().positive(),
23741
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
23742
+ });
23171
23743
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
23172
23744
  var ExportTimelapseSchema = object({
23173
23745
  everyMs: number().int().positive(),
23174
- outputFps: number().int().min(1).max(60).optional()
23746
+ outputFps: number().int().min(1).max(60).optional(),
23747
+ /** Optional second, FASTER rate over the intervals that matter. */
23748
+ dense: ExportDenseSchema.optional()
23749
+ }).superRefine((v, ctx) => {
23750
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
23751
+ code: ZodIssueCode.custom,
23752
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
23753
+ path: ["dense", "everyMs"]
23754
+ });
23175
23755
  });
23176
23756
  /**
23177
23757
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -23229,6 +23809,19 @@ var ExportDownloadSchema = object({
23229
23809
  url: string(),
23230
23810
  endpoints: array(string())
23231
23811
  });
23812
+ /**
23813
+ * A finished export's bytes, inline.
23814
+ *
23815
+ * `bytes` is the DECODED length — the number the caller bounds and logs
23816
+ * against, so nobody has to infer it from the base64 length.
23817
+ */
23818
+ var ExportBytesSchema = object({
23819
+ base64: string(),
23820
+ contentType: string(),
23821
+ /** Suggested filename, extension included. */
23822
+ name: string(),
23823
+ bytes: number().int().nonnegative()
23824
+ });
23232
23825
  method(object({
23233
23826
  deviceId: number(),
23234
23827
  profile: string(),
@@ -23253,6 +23846,9 @@ method(object({
23253
23846
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
23254
23847
  kind: "query",
23255
23848
  auth: "protected"
23849
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
23850
+ kind: "query",
23851
+ auth: "protected"
23256
23852
  });
23257
23853
  /**
23258
23854
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -27270,6 +27866,12 @@ Object.freeze({
27270
27866
  addonId: null,
27271
27867
  access: "delete"
27272
27868
  },
27869
+ "osdManager.copyDeviceConfiguration": {
27870
+ capName: "osd-manager",
27871
+ capScope: "system",
27872
+ addonId: null,
27873
+ access: "create"
27874
+ },
27273
27875
  "osdManager.getConditionSupport": {
27274
27876
  capName: "osd-manager",
27275
27877
  capScope: "system",
@@ -27366,7 +27968,7 @@ Object.freeze({
27366
27968
  addonId: null,
27367
27969
  access: "create"
27368
27970
  },
27369
- "pipelineAnalytics.cancelMediaRelocate": {
27971
+ "pipelineAnalytics.cancelStorageMigrationMove": {
27370
27972
  capName: "pipeline-analytics",
27371
27973
  capScope: "device",
27372
27974
  addonId: null,
@@ -27438,12 +28040,6 @@ Object.freeze({
27438
28040
  addonId: null,
27439
28041
  access: "view"
27440
28042
  },
27441
- "pipelineAnalytics.getMediaRelocateStatus": {
27442
- capName: "pipeline-analytics",
27443
- capScope: "device",
27444
- addonId: null,
27445
- access: "view"
27446
- },
27447
28043
  "pipelineAnalytics.getMotionEvents": {
27448
28044
  capName: "pipeline-analytics",
27449
28045
  capScope: "device",
@@ -27480,6 +28076,12 @@ Object.freeze({
27480
28076
  addonId: null,
27481
28077
  access: "view"
27482
28078
  },
28079
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
28080
+ capName: "pipeline-analytics",
28081
+ capScope: "device",
28082
+ addonId: null,
28083
+ access: "view"
28084
+ },
27483
28085
  "pipelineAnalytics.getTrack": {
27484
28086
  capName: "pipeline-analytics",
27485
28087
  capScope: "device",
@@ -27558,6 +28160,12 @@ Object.freeze({
27558
28160
  addonId: null,
27559
28161
  access: "view"
27560
28162
  },
28163
+ "pipelineAnalytics.pauseForStorageMigration": {
28164
+ capName: "pipeline-analytics",
28165
+ capScope: "device",
28166
+ addonId: null,
28167
+ access: "create"
28168
+ },
27561
28169
  "pipelineAnalytics.proposeRetrainAnnotations": {
27562
28170
  capName: "pipeline-analytics",
27563
28171
  capScope: "device",
@@ -27588,7 +28196,7 @@ Object.freeze({
27588
28196
  addonId: null,
27589
28197
  access: "create"
27590
28198
  },
27591
- "pipelineAnalytics.relocateMedia": {
28199
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
27592
28200
  capName: "pipeline-analytics",
27593
28201
  capScope: "device",
27594
28202
  addonId: null,
@@ -27600,6 +28208,12 @@ Object.freeze({
27600
28208
  addonId: null,
27601
28209
  access: "create"
27602
28210
  },
28211
+ "pipelineAnalytics.resumeForStorageMigration": {
28212
+ capName: "pipeline-analytics",
28213
+ capScope: "device",
28214
+ addonId: null,
28215
+ access: "create"
28216
+ },
27603
28217
  "pipelineAnalytics.saveRetrainAnnotations": {
27604
28218
  capName: "pipeline-analytics",
27605
28219
  capScope: "device",
@@ -27624,6 +28238,12 @@ Object.freeze({
27624
28238
  addonId: null,
27625
28239
  access: "create"
27626
28240
  },
28241
+ "pipelineAnalytics.startStorageMigrationMove": {
28242
+ capName: "pipeline-analytics",
28243
+ capScope: "device",
28244
+ addonId: null,
28245
+ access: "create"
28246
+ },
27627
28247
  "pipelineAnalytics.wipeAllAnalytics": {
27628
28248
  capName: "pipeline-analytics",
27629
28249
  capScope: "device",
@@ -27990,6 +28610,12 @@ Object.freeze({
27990
28610
  addonId: null,
27991
28611
  access: "view"
27992
28612
  },
28613
+ "pipelineOrchestrator.pauseForStorageMigration": {
28614
+ capName: "pipeline-orchestrator",
28615
+ capScope: "system",
28616
+ addonId: null,
28617
+ access: "create"
28618
+ },
27993
28619
  "pipelineOrchestrator.rebalance": {
27994
28620
  capName: "pipeline-orchestrator",
27995
28621
  capScope: "system",
@@ -28014,6 +28640,12 @@ Object.freeze({
28014
28640
  addonId: null,
28015
28641
  access: "view"
28016
28642
  },
28643
+ "pipelineOrchestrator.resumeForStorageMigration": {
28644
+ capName: "pipeline-orchestrator",
28645
+ capScope: "system",
28646
+ addonId: null,
28647
+ access: "create"
28648
+ },
28017
28649
  "pipelineOrchestrator.saveTemplate": {
28018
28650
  capName: "pipeline-orchestrator",
28019
28651
  capScope: "system",
@@ -28410,7 +29042,13 @@ Object.freeze({
28410
29042
  addonId: null,
28411
29043
  access: "create"
28412
29044
  },
28413
- "recording.cancelRelocate": {
29045
+ "recording.cancelRelocateJob": {
29046
+ capName: "recording",
29047
+ capScope: "system",
29048
+ addonId: null,
29049
+ access: "create"
29050
+ },
29051
+ "recording.cancelStorageMigrationMove": {
28414
29052
  capName: "recording",
28415
29053
  capScope: "system",
28416
29054
  addonId: null,
@@ -28446,7 +29084,7 @@ Object.freeze({
28446
29084
  addonId: null,
28447
29085
  access: "view"
28448
29086
  },
28449
- "recording.getRelocateStatus": {
29087
+ "recording.getStorageMigrationMoveStatus": {
28450
29088
  capName: "recording",
28451
29089
  capScope: "system",
28452
29090
  addonId: null,
@@ -28464,12 +29102,30 @@ Object.freeze({
28464
29102
  addonId: null,
28465
29103
  access: "view"
28466
29104
  },
29105
+ "recording.listRelocateJobs": {
29106
+ capName: "recording",
29107
+ capScope: "system",
29108
+ addonId: null,
29109
+ access: "view"
29110
+ },
28467
29111
  "recording.locateSegment": {
28468
29112
  capName: "recording",
28469
29113
  capScope: "system",
28470
29114
  addonId: null,
28471
29115
  access: "view"
28472
29116
  },
29117
+ "recording.pauseForStorageMigration": {
29118
+ capName: "recording",
29119
+ capScope: "system",
29120
+ addonId: null,
29121
+ access: "create"
29122
+ },
29123
+ "recording.planStorageRebalance": {
29124
+ capName: "recording",
29125
+ capScope: "system",
29126
+ addonId: null,
29127
+ access: "view"
29128
+ },
28473
29129
  "recording.pruneFootage": {
28474
29130
  capName: "recording",
28475
29131
  capScope: "system",
@@ -28488,6 +29144,12 @@ Object.freeze({
28488
29144
  addonId: null,
28489
29145
  access: "view"
28490
29146
  },
29147
+ "recording.refreshStorageLocationsForMigration": {
29148
+ capName: "recording",
29149
+ capScope: "system",
29150
+ addonId: null,
29151
+ access: "create"
29152
+ },
28491
29153
  "recording.relocateFootage": {
28492
29154
  capName: "recording",
28493
29155
  capScope: "system",
@@ -28512,44 +29174,68 @@ Object.freeze({
28512
29174
  addonId: null,
28513
29175
  access: "create"
28514
29176
  },
29177
+ "recording.resumeForStorageMigration": {
29178
+ capName: "recording",
29179
+ capScope: "system",
29180
+ addonId: null,
29181
+ access: "create"
29182
+ },
28515
29183
  "recording.setDeviceConfig": {
28516
29184
  capName: "recording",
28517
29185
  capScope: "system",
28518
29186
  addonId: null,
28519
29187
  access: "create"
28520
29188
  },
29189
+ "recording.startStorageMigrationMove": {
29190
+ capName: "recording",
29191
+ capScope: "system",
29192
+ addonId: null,
29193
+ access: "create"
29194
+ },
29195
+ "recording.startStorageRebalance": {
29196
+ capName: "recording",
29197
+ capScope: "system",
29198
+ addonId: null,
29199
+ access: "create"
29200
+ },
28521
29201
  "recordingExport.cancelExport": {
28522
- capName: "recordingExport",
29202
+ capName: "recording-export",
28523
29203
  capScope: "system",
28524
29204
  addonId: null,
28525
29205
  access: "create"
28526
29206
  },
28527
29207
  "recordingExport.createExport": {
28528
- capName: "recordingExport",
29208
+ capName: "recording-export",
28529
29209
  capScope: "system",
28530
29210
  addonId: null,
28531
29211
  access: "create"
28532
29212
  },
28533
29213
  "recordingExport.deleteExport": {
28534
- capName: "recordingExport",
29214
+ capName: "recording-export",
28535
29215
  capScope: "system",
28536
29216
  addonId: null,
28537
29217
  access: "delete"
28538
29218
  },
28539
29219
  "recordingExport.getDownloadUrl": {
28540
- capName: "recordingExport",
29220
+ capName: "recording-export",
28541
29221
  capScope: "system",
28542
29222
  addonId: null,
28543
29223
  access: "view"
28544
29224
  },
28545
29225
  "recordingExport.getExport": {
28546
- capName: "recordingExport",
29226
+ capName: "recording-export",
28547
29227
  capScope: "system",
28548
29228
  addonId: null,
28549
29229
  access: "view"
28550
29230
  },
28551
29231
  "recordingExport.listExports": {
28552
- capName: "recordingExport",
29232
+ capName: "recording-export",
29233
+ capScope: "system",
29234
+ addonId: null,
29235
+ access: "view"
29236
+ },
29237
+ "recordingExport.readExportBytes": {
29238
+ capName: "recording-export",
28553
29239
  capScope: "system",
28554
29240
  addonId: null,
28555
29241
  access: "view"
@@ -28908,6 +29594,30 @@ Object.freeze({
28908
29594
  addonId: null,
28909
29595
  access: "view"
28910
29596
  },
29597
+ "storageMigration.cancel": {
29598
+ capName: "storage-migration",
29599
+ capScope: "system",
29600
+ addonId: null,
29601
+ access: "create"
29602
+ },
29603
+ "storageMigration.plan": {
29604
+ capName: "storage-migration",
29605
+ capScope: "system",
29606
+ addonId: null,
29607
+ access: "view"
29608
+ },
29609
+ "storageMigration.start": {
29610
+ capName: "storage-migration",
29611
+ capScope: "system",
29612
+ addonId: null,
29613
+ access: "create"
29614
+ },
29615
+ "storageMigration.status": {
29616
+ capName: "storage-migration",
29617
+ capScope: "system",
29618
+ addonId: null,
29619
+ access: "view"
29620
+ },
28911
29621
  "storageProvider.abortUpload": {
28912
29622
  capName: "storage-provider",
28913
29623
  capScope: "system",
@@ -29286,12 +29996,42 @@ Object.freeze({
29286
29996
  addonId: null,
29287
29997
  access: "create"
29288
29998
  },
29999
+ "terminalSession.adoptLegacyMonitor": {
30000
+ capName: "terminal-session",
30001
+ capScope: "system",
30002
+ addonId: null,
30003
+ access: "create"
30004
+ },
29289
30005
  "terminalSession.close": {
29290
30006
  capName: "terminal-session",
29291
30007
  capScope: "system",
29292
30008
  addonId: null,
29293
30009
  access: "create"
29294
30010
  },
30011
+ "terminalSession.createInstance": {
30012
+ capName: "terminal-session",
30013
+ capScope: "system",
30014
+ addonId: null,
30015
+ access: "create"
30016
+ },
30017
+ "terminalSession.deleteInstance": {
30018
+ capName: "terminal-session",
30019
+ capScope: "system",
30020
+ addonId: null,
30021
+ access: "delete"
30022
+ },
30023
+ "terminalSession.listInstances": {
30024
+ capName: "terminal-session",
30025
+ capScope: "system",
30026
+ addonId: null,
30027
+ access: "view"
30028
+ },
30029
+ "terminalSession.listLegacyCameras": {
30030
+ capName: "terminal-session",
30031
+ capScope: "system",
30032
+ addonId: null,
30033
+ access: "view"
30034
+ },
29295
30035
  "terminalSession.listProfiles": {
29296
30036
  capName: "terminal-session",
29297
30037
  capScope: "system",
@@ -29322,6 +30062,12 @@ Object.freeze({
29322
30062
  addonId: null,
29323
30063
  access: "create"
29324
30064
  },
30065
+ "terminalSession.setInstanceEnabled": {
30066
+ capName: "terminal-session",
30067
+ capScope: "system",
30068
+ addonId: null,
30069
+ access: "create"
30070
+ },
29325
30071
  "terminalSession.writeInput": {
29326
30072
  capName: "terminal-session",
29327
30073
  capScope: "system",
@@ -29866,6 +30612,104 @@ var FramerateField = number().int().min(1).max(60);
29866
30612
  var TargetsField = array(NcRuleTargetSchema).min(1);
29867
30613
  var PriorityField = number().int().min(1).max(5);
29868
30614
  /**
30615
+ * Explicit override of the DENSE sampling cadence, seconds.
30616
+ *
30617
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
30618
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
30619
+ * made that same base 3 s and rendered a person pass as two frames.)
30620
+ *
30621
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
30622
+ * `denseCadenceSec` and played at `framerate` occupies
30623
+ *
30624
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
30625
+ *
30626
+ * so a 7 s pass at 1 s / 12 fps is 0.58 s of video, and at 0.5 s it is 1.17 s.
30627
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
30628
+ * and therefore the length of a quiet night, does not move.
30629
+ *
30630
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
30631
+ * the recording has them returns the same frames, requested twice. Must be
30632
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
30633
+ * a uniform video the operator believes is two-rate — and upsert refuses it
30634
+ * rather than letting the export cap reject the render hours after the window.
30635
+ */
30636
+ var DenseCadenceSecField = number().min(.1).max(3600);
30637
+ /**
30638
+ * Minimum seconds of OUTPUT video each detection range must occupy.
30639
+ *
30640
+ * The operator-facing form of the arithmetic above: instead of solving for a
30641
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
30642
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
30643
+ * that range every ~583 ms.
30644
+ *
30645
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
30646
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
30647
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
30648
+ * ranges are sampled denser than they need. Per-range cadences require a cap
30649
+ * schema change and are the tracked follow-up.
30650
+ *
30651
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
30652
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
30653
+ * by real footage, never met by duplicating frames into motion that never
30654
+ * happened.
30655
+ */
30656
+ var MinDwellSecField = number().min(0).max(60);
30657
+ /**
30658
+ * Caption burned into the notification's preview frame.
30659
+ *
30660
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
30661
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
30662
+ * templating dialect for one field would be a second thing to explain.
30663
+ *
30664
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
30665
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
30666
+ * the reason this is not `.min(1)`.
30667
+ */
30668
+ var PreviewTextField = string().max(200);
30669
+ /**
30670
+ * Whether the notification's preview is a STILL or a short animation.
30671
+ *
30672
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
30673
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
30674
+ * night reads better as three seconds of motion than as one frame of it. Both
30675
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
30676
+ * simply applies it to a dozen frames sampled across the render and assembles
30677
+ * them.
30678
+ *
30679
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
30680
+ * seeks and a palette pass, and no rule that never asked for one should start
30681
+ * paying that on the deploy that shipped it.
30682
+ *
30683
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
30684
+ */
30685
+ var PreviewModeField = _enum(["image", "gif"]);
30686
+ /**
30687
+ * Which detection classes the notification reports counts for.
30688
+ *
30689
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
30690
+ * plan — no second query — aggregated per class. Absent or empty means "every
30691
+ * class the window actually contained", which is what an operator who never
30692
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
30693
+ * counts cars all night).
30694
+ *
30695
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
30696
+ * …). An unknown name simply never matches and reports nothing — it is not an
30697
+ * error, because a rule may legitimately name a class this camera's model does
30698
+ * not emit.
30699
+ *
30700
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
30701
+ * - `{{detections}}` — total over the reported classes
30702
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
30703
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
30704
+ * one per class, `count_` + the class name
30705
+ *
30706
+ * With NO custom body template the summary is appended to the derived body, and
30707
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
30708
+ * reads. With a custom template the operator owns every word — nothing is
30709
+ * appended, so `{{detectionSummary}}` is how he asks for it.
30710
+ */
30711
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
30712
+ /**
29869
30713
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
29870
30714
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
29871
30715
  * here (see the ownership note above).
@@ -29885,9 +30729,30 @@ var TimelapseRuleInputSchema = object({
29885
30729
  cadenceSec: CadenceSecField.default(15),
29886
30730
  /** Output frames per second of the assembled mp4 (predecessor parity). */
29887
30731
  framerate: FramerateField.default(10),
30732
+ /**
30733
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
30734
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
30735
+ * field gets.
30736
+ */
30737
+ denseCadenceSec: DenseCadenceSecField.optional(),
30738
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
30739
+ minDwellSec: MinDwellSecField.optional(),
29888
30740
  /** `notification-output` targets the finished video/thumbnail is sent to. */
29889
30741
  targets: TargetsField,
29890
30742
  template: TimelapseTemplateSchema.optional(),
30743
+ /**
30744
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
30745
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
30746
+ *
30747
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
30748
+ * the notification's title/body, and clearing it (`template: null`) must not
30749
+ * silently clear the caption too.
30750
+ */
30751
+ previewText: PreviewTextField.optional(),
30752
+ /** Still or animation — see {@link PreviewModeField}. */
30753
+ previewMode: PreviewModeField.default("image"),
30754
+ /** Classes the notification counts — see {@link ReportClassesField}. */
30755
+ reportClasses: ReportClassesField.optional(),
29891
30756
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
29892
30757
  priority: PriorityField.default(3)
29893
30758
  });
@@ -29898,8 +30763,13 @@ object({
29898
30763
  schedule: NcScheduleSchema.optional(),
29899
30764
  cadenceSec: CadenceSecField.optional(),
29900
30765
  framerate: FramerateField.optional(),
30766
+ denseCadenceSec: DenseCadenceSecField.optional(),
30767
+ minDwellSec: MinDwellSecField.optional(),
29901
30768
  targets: TargetsField.optional(),
29902
30769
  template: TimelapseTemplateSchema.nullable().optional(),
30770
+ previewText: PreviewTextField.optional(),
30771
+ previewMode: PreviewModeField.optional(),
30772
+ reportClasses: ReportClassesField.optional(),
29903
30773
  priority: PriorityField.optional()
29904
30774
  });
29905
30775
  TimelapseRuleInputSchema.extend({
@@ -29911,10 +30781,28 @@ TimelapseRuleInputSchema.extend({
29911
30781
  */
29912
30782
  ownerUserId: string().optional(),
29913
30783
  /**
29914
- * Epoch-ms of the last successful generation — the 1-hour re-generation
29915
- * guard's durable state (predecessor parity). Absent = never generated.
30784
+ * Epoch-ms of the NEWEST successful generation across every camera of this
30785
+ * rule. What a UI shows, and the compatibility floor for
30786
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
29916
30787
  */
29917
30788
  lastGeneratedAt: number().optional(),
30789
+ /**
30790
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
30791
+ * re-generation guard's real durable state.
30792
+ *
30793
+ * One rule covers several cameras and each renders its own video, so a rule
30794
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
30795
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
30796
+ * already done — and B's night is gone for good, because the window will not
30797
+ * come back.
30798
+ *
30799
+ * ADDITIVE, so the migration is free: a row written before this field simply
30800
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
30801
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
30802
+ * "never generated" would re-render and re-notify every camera of every rule
30803
+ * once, on the deploy that shipped the map.
30804
+ */
30805
+ generatedByDevice: record(string(), number()).optional(),
29918
30806
  /** userId of the caller who created the rule (server-stamped). */
29919
30807
  createdBy: string(),
29920
30808
  createdAt: number(),
@@ -31688,10 +32576,10 @@ async function assembleAi(deps) {
31688
32576
  registrations,
31689
32577
  runtimeProvider
31690
32578
  };
31691
- const { UsageStore } = await Promise.resolve().then(() => require("./usage-store-DK494_zK.js")).then((n) => n.usage_store_exports);
32579
+ const { UsageStore } = await Promise.resolve().then(() => require("./usage-store-8hfWI98H.js")).then((n) => n.usage_store_exports);
31692
32580
  const store = new ProfileStore(deps.settingsPort);
31693
32581
  const defaults = new DefaultsStore(deps.settingsPort);
31694
- const usage = new UsageStore(deps.settingsPort);
32582
+ const usage = new UsageStore(deps.settingsPort, Date.now, deps.logger.child("llm-usage"));
31695
32583
  await store.init();
31696
32584
  await defaults.init();
31697
32585
  await usage.init();