@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.mjs CHANGED
@@ -7256,8 +7256,31 @@ var AdoptionJobSchema = object({
7256
7256
  error: string().nullable()
7257
7257
  });
7258
7258
  /**
7259
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7260
- * pipeline functions an operator thinks in terms of.
7259
+ * Per-camera FUNCTION SWITCHES.
7260
+ *
7261
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7262
+ *
7263
+ * This file shipped as "the one coherent on/off surface over the pipeline
7264
+ * functions an operator thinks in terms of". The operator's verdict on
7265
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7266
+ * every function already had a settings page of its own, and a second place to
7267
+ * turn it off is a second place to look. Each switch is going back to its own
7268
+ * component's original options — detection to the detection-pipeline wrapper
7269
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7270
+ * (which was always first-class; the switch was a veneer over
7271
+ * `recording.setDeviceConfig`), notifications to a notification-center
7272
+ * per-device setting, the two camera planes to their own components.
7273
+ *
7274
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7275
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7276
+ * straight from the authorities with no group in the middle. That rule was
7277
+ * never about a control panel.
7278
+ *
7279
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7280
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7281
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7282
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7283
+ * stop; nothing new may be built on it.
7261
7284
  *
7262
7285
  * ## This file adds no state
7263
7286
  *
@@ -7602,14 +7625,21 @@ var RecordingConfigSchema = object({
7602
7625
  /**
7603
7626
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7604
7627
  *
7605
- * One shape shared by the recorder's `relocateFootage` (segments) and
7606
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7607
- * page renders both movers with one component. Jobs are in-RAM (a restart
7608
- * forgets them — re-running is safe by construction: copy-if-absent, delete
7609
- * after verify) and each completed/failed run also lands one durable ops-log
7610
- * row on the owning addon's surface.
7628
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7629
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7630
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7631
+ * Each completed/failed run also lands one durable ops-log row on its owning
7632
+ * addon surface.
7633
+ */
7634
+ /**
7635
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7636
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7637
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7638
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7639
+ * runs at all.
7611
7640
  */
7612
7641
  var RelocateJobStateSchema = _enum([
7642
+ "queued",
7613
7643
  "running",
7614
7644
  "done",
7615
7645
  "failed",
@@ -7634,19 +7664,109 @@ var RelocateJobSchema = object({
7634
7664
  finishedAt: number().nullable(),
7635
7665
  error: string().nullable()
7636
7666
  });
7667
+ /** Profile-derived footage selection used only by the migration coordinator:
7668
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7669
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7637
7670
  var RelocateFootageInputSchema = object({
7638
- deviceId: number().optional(),
7639
7671
  fromLocationId: string(),
7640
7672
  toLocationId: string(),
7641
7673
  entities: array(_enum(["segments"])).optional(),
7674
+ /** Limits relocation to the logical profile class. Omit only for the
7675
+ * pre-orchestration compatibility path. */
7676
+ footageClass: RelocateFootageClassSchema.optional(),
7677
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7678
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7679
+ * unit is a (camera, profile) pile, not a disk. */
7680
+ deviceId: number().int().optional(),
7681
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7682
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7683
+ * placement plan assigns those two independently, so a rebalance that could
7684
+ * only say "recordings" would move footage the plan never asked to move. */
7685
+ profiles: array(string()).optional(),
7642
7686
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7643
7687
  * never allowed to starve live writers. */
7644
7688
  throttleMbps: number().min(1).max(1e3).optional()
7645
7689
  });
7646
- var RelocateMediaInputSchema = object({
7647
- deviceId: number().optional(),
7690
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7691
+ * from persistent recording settings: a migration never changes
7692
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7693
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7694
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7695
+ var StorageMigrationMediaMoveInputSchema = object({
7648
7696
  toLocationId: string(),
7649
7697
  throttleMbps: number().min(1).max(1e3).optional()
7698
+ }).extend({ leaseId: string().min(1) });
7699
+ /** The independently selectable logical storage classes. `recordings`
7700
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7701
+ * segments; `eventMedia` is post-analysis blobs. */
7702
+ var StorageMigrationClassSchema = _enum([
7703
+ "recordings",
7704
+ "recordingsLow",
7705
+ "eventMedia"
7706
+ ]);
7707
+ /** A destination is always an existing, fully-qualified location id. The
7708
+ * migration API intentionally never changes a source location's `basePath`:
7709
+ * callers create a new `<type>:<slug>` location, then select it here. */
7710
+ var StorageMigrationDestinationsSchema = object({
7711
+ recordings: string().min(1).optional(),
7712
+ recordingsLow: string().min(1).optional(),
7713
+ eventMedia: string().min(1).optional()
7714
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7715
+ /** Shared input for planning and starting an orchestrated storage migration. */
7716
+ var StorageMigrationInputSchema = object({
7717
+ destinations: StorageMigrationDestinationsSchema,
7718
+ throttleMbps: number().min(1).max(1e3).optional()
7719
+ });
7720
+ /** The durable coordinator state machine. The only phase that changes default
7721
+ * locations is `repointing`, after every selected mover has completed and been
7722
+ * verified. */
7723
+ var StorageMigrationPhaseSchema = _enum([
7724
+ "planning",
7725
+ "pausing",
7726
+ "moving",
7727
+ "verifying",
7728
+ "repointing",
7729
+ "refreshing",
7730
+ "resuming",
7731
+ "done",
7732
+ "failed",
7733
+ "cancelled"
7734
+ ]);
7735
+ var StorageMigrationParticipantSchema = _enum([
7736
+ "pipeline",
7737
+ "recorder",
7738
+ "analytics"
7739
+ ]);
7740
+ var StorageMigrationMoveSchema = object({
7741
+ storageClass: StorageMigrationClassSchema,
7742
+ fromLocationId: string(),
7743
+ toLocationId: string(),
7744
+ moverJobId: string().nullable(),
7745
+ state: RelocateJobStateSchema.nullable(),
7746
+ error: string().nullable()
7747
+ });
7748
+ var StorageMigrationJobSchema = object({
7749
+ jobId: string(),
7750
+ phase: StorageMigrationPhaseSchema,
7751
+ destinations: StorageMigrationDestinationsSchema,
7752
+ throttleMbps: number(),
7753
+ moves: array(StorageMigrationMoveSchema),
7754
+ pauseLeaseId: string().nullable(),
7755
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7756
+ repointed: boolean(),
7757
+ cancelRequested: boolean(),
7758
+ startedAt: number(),
7759
+ updatedAt: number(),
7760
+ finishedAt: number().nullable(),
7761
+ error: string().nullable()
7762
+ });
7763
+ var StorageMigrationPlanSchema = object({
7764
+ destinations: StorageMigrationDestinationsSchema,
7765
+ moves: array(object({
7766
+ storageClass: StorageMigrationClassSchema,
7767
+ fromLocationId: string(),
7768
+ toLocationId: string()
7769
+ }))
7650
7770
  });
7651
7771
  /**
7652
7772
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7698,6 +7818,21 @@ var StorageLocationSchema = object({
7698
7818
  nodeId: string().optional(),
7699
7819
  isDefault: boolean().default(false),
7700
7820
  isSystem: boolean().default(false),
7821
+ /**
7822
+ * Operator opt-in: whether consumers that BALANCE across several locations
7823
+ * of a type may write here. Recordings reads it today; event media and
7824
+ * backups are the next consumers, which is why the flag lives on the
7825
+ * location rather than in any one addon's store — nothing has to be
7826
+ * extended to add the next consumer.
7827
+ *
7828
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7829
+ * flag existed reads back with no flag and keeps working exactly as before;
7830
+ * that is the whole compat story, and it is why no migration ships with it.
7831
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7832
+ * disk must not silently start writing to it); the default of a type is
7833
+ * always stamped `true`.
7834
+ */
7835
+ enabled: boolean().optional(),
7701
7836
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7702
7837
  * for node-local locations it can reach) — never persisted, absent when the
7703
7838
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12000,7 +12135,8 @@ method(object({
12000
12135
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12001
12136
  /**
12002
12137
  * filesystem-browse — per-node capability for browsing the node's local
12003
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12138
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12139
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12004
12140
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12005
12141
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12006
12142
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -13858,6 +13994,13 @@ var MaskGridDimsSchema = object({
13858
13994
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
13859
13995
  * this one field keeps the schema additive — a rule still declares exactly
13860
13996
  * one trigger.
13997
+ *
13998
+ * AUDIO rules add no member here, for the reason occupancy added none: the
13999
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14000
+ * mirror.ts` fails the build on a member the app cannot render) and every
14001
+ * member costs a release train. A sustained-sound rule is therefore an
14002
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14003
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
13861
14004
  */
13862
14005
  var NcDeliverySchema = _enum([
13863
14006
  "immediate",
@@ -13872,15 +14015,32 @@ var NcDeliverySchema = _enum([
13872
14015
  * depend on a provider's raw event name or payload shape.
13873
14016
  */
13874
14017
  var NcSystemEventKindSchema = _enum([
13875
- "camera-online",
13876
- "camera-offline",
14018
+ "device-online",
14019
+ "device-offline",
14020
+ "device-disabled",
14021
+ "device-enabled",
13877
14022
  "stream-online",
13878
14023
  "stream-offline",
13879
14024
  "node-online",
13880
14025
  "node-offline",
13881
14026
  "addon-update-available",
13882
- "server-update-available"
14027
+ "server-update-available",
14028
+ "alarm-triggered",
14029
+ "alarm-armed",
14030
+ "alarm-disarmed",
14031
+ "camera-online",
14032
+ "camera-offline",
14033
+ "camera-disabled",
14034
+ "camera-enabled"
14035
+ ]);
14036
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14037
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14038
+ "camera-online",
14039
+ "camera-offline",
14040
+ "camera-disabled",
14041
+ "camera-enabled"
13883
14042
  ]);
14043
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
13884
14044
  /**
13885
14045
  * One coherent system-event condition. `kinds` is the required opt-in safety
13886
14046
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -13889,6 +14049,18 @@ var NcSystemEventKindSchema = _enum([
13889
14049
  var NcSystemEventConditionSchema = object({
13890
14050
  kinds: array(NcSystemEventKindSchema).min(1),
13891
14051
  deviceIds: array(number().int()).min(1).optional(),
14052
+ /**
14053
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14054
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14055
+ * is what a liveness rule means when nobody said otherwise.
14056
+ *
14057
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14058
+ * one reason: the intake cannot know which devices this household cares
14059
+ * about, and a producer-side filter is one no operator can change. Fails
14060
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14061
+ * does not carry) matches no `deviceTypes` list.
14062
+ */
14063
+ deviceTypes: array(string().min(1)).min(1).optional(),
13892
14064
  nodeIds: array(string().min(1)).min(1).optional(),
13893
14065
  packageNames: array(string().min(1)).min(1).optional()
13894
14066
  });
@@ -13939,6 +14111,47 @@ var NcOccupancyConditionSchema = object({
13939
14111
  sustainSeconds: number().int().min(0).max(3600).default(15)
13940
14112
  });
13941
14113
  /**
14114
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14115
+ *
14116
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14117
+ * reference notifier uses, so an operator moving between them re-uses what
14118
+ * they already know): a rule matches when, over a sampling window of
14119
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14120
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14121
+ *
14122
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14123
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14124
+ * - `labels` — the classifier put at least one of these labels on it.
14125
+ *
14126
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14127
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14128
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14129
+ * is given** — a window in which every sample is trivially a hit would fire on
14130
+ * silence, so the engine refuses such a condition rather than notifying on
14131
+ * nothing (the schema cannot express "at least one of" without becoming a
14132
+ * ZodEffects the cap path would have to special-case).
14133
+ *
14134
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14135
+ * must be FULL before it can match — a window that has been open for two
14136
+ * seconds of its ten is 100% of nothing, and firing on it would make
14137
+ * `samplingSeconds` decorative.
14138
+ *
14139
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14140
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14141
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14142
+ * an operator who typed `dog` mean the same thing.
14143
+ */
14144
+ var NcAudioConditionSchema = object({
14145
+ /** Audio macro labels; absent = any sound (level-only rule). */
14146
+ labels: array(string().min(1)).min(1).optional(),
14147
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14148
+ dbThreshold: number().min(-96).max(0).optional(),
14149
+ /** Percentage of the window's samples that must be hits (1–100). */
14150
+ hitPercent: number().int().min(1).max(100).default(60),
14151
+ /** Length of the sampling window in seconds. */
14152
+ samplingSeconds: number().int().min(1).max(300).default(10)
14153
+ });
14154
+ /**
13942
14155
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
13943
14156
  *
13944
14157
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14211,7 +14424,33 @@ var NcConditionsSchema = object({
14211
14424
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14212
14425
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14213
14426
  */
14214
- occupancy: NcOccupancyConditionSchema.optional()
14427
+ occupancy: NcOccupancyConditionSchema.optional(),
14428
+ /**
14429
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14430
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14431
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14432
+ * a window that is not full yet, neither filter given). See
14433
+ * {@link NcAudioCondition}.
14434
+ *
14435
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14436
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14437
+ * a detection, a track or a device event (the same fail-closed pairing
14438
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14439
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14440
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14441
+ * classified sample) stays exactly as it was for rules that already use it.
14442
+ *
14443
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14444
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14445
+ * (`camstack/src/data/notification-center.ts`, guarded by
14446
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14447
+ * condition fields it does not know when a rule is saved from the phone.
14448
+ * Publishing an editor for a condition the app cannot round-trip is how an
14449
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14450
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14451
+ * does an audio rule become authorable.
14452
+ */
14453
+ audio: NcAudioConditionSchema.optional()
14215
14454
  });
14216
14455
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14217
14456
  var NcRuleTargetSchema = object({
@@ -14325,6 +14564,73 @@ var NcThrottleSchema = object({
14325
14564
  */
14326
14565
  granularity: NcThrottleGranularitySchema.optional()
14327
14566
  });
14567
+ /**
14568
+ * How long the confirm gate may hold ONE notification, and how big the picture
14569
+ * it judges may be.
14570
+ *
14571
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14572
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14573
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14574
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14575
+ * tokens for pixels the model pools away.
14576
+ */
14577
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14578
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14579
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14580
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14581
+ var NcConfirmExpectSchema = object({
14582
+ op: _enum([
14583
+ ">=",
14584
+ ">",
14585
+ "<=",
14586
+ "<",
14587
+ "=="
14588
+ ]),
14589
+ count: number().int().min(0).max(1e3)
14590
+ });
14591
+ /**
14592
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14593
+ * to ship and says whether it agrees with the rule.
14594
+ *
14595
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14596
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14597
+ * on the operator's phone is not a verdict about this notification.
14598
+ *
14599
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14600
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14601
+ * the default and every fail-open is COUNTED, because a gate that always fails
14602
+ * open looks in the log exactly like a gate that works.
14603
+ *
14604
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14605
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14606
+ * production failures in one day), so the gate reads absent as the constant
14607
+ * above rather than trusting a parse it may never have seen.
14608
+ */
14609
+ var NcConfirmSchema = object({
14610
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14611
+ * same thing, and both mean "deliver exactly as before". */
14612
+ enabled: boolean().default(false),
14613
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14614
+ profileId: string().optional(),
14615
+ /**
14616
+ * The operator's question, in his own words. Absent = a question derived
14617
+ * from the rule (its class and its expectation).
14618
+ *
14619
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14620
+ * banners, signage and plates as instructions if you let them reach the
14621
+ * prompt — proven live — so the authoritative contract stays in the system
14622
+ * turn and only rule-authored words land here.
14623
+ */
14624
+ prompt: string().max(1e3).optional(),
14625
+ /** Fire only when the model's count satisfies this. Absent = the model's
14626
+ * own boolean verdict decides. */
14627
+ expect: NcConfirmExpectSchema.optional(),
14628
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14629
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14630
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14631
+ /** Longest edge the judged image is downscaled to before it is sent. */
14632
+ maxImagePx: number().int().min(64).max(2048).default(448)
14633
+ });
14328
14634
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14329
14635
  var NcRuleInputSchema = object({
14330
14636
  name: string().min(1).max(200),
@@ -14385,7 +14691,13 @@ var NcRuleInputSchema = object({
14385
14691
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14386
14692
  * shape as every other actuation.
14387
14693
  */
14388
- actions: NcRuleActionsSchema.optional()
14694
+ actions: NcRuleActionsSchema.optional(),
14695
+ /**
14696
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14697
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14698
+ * did, and absent is the only way to say that without a migration.
14699
+ */
14700
+ confirm: NcConfirmSchema.optional()
14389
14701
  });
14390
14702
  /**
14391
14703
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14396,7 +14708,37 @@ var NcRuleInputSchema = object({
14396
14708
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14397
14709
  * `updateRule` patch.
14398
14710
  */
14399
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14711
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14712
+ disabledTargetIds: array(string()).optional(),
14713
+ /**
14714
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14715
+ *
14716
+ * It makes the key optional to SUPPLY; the parse still materialises the
14717
+ * default when the key is absent. And `NcRuleStore.update` merges with
14718
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14719
+ * one — which made every partial edit destructive:
14720
+ *
14721
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14722
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14723
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14724
+ *
14725
+ * A rule scoped to one camera and one zone silently became a rule that
14726
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14727
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14728
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14729
+ * within a minute of a two-field patch.
14730
+ *
14731
+ * So every defaulted field is re-declared here WITHOUT its default. The
14732
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14733
+ * conditions remains a real instruction ("clear them") — and only the
14734
+ * absent key is now genuinely absent.
14735
+ */
14736
+ enabled: boolean().optional(),
14737
+ conditions: NcConditionsSchema.optional(),
14738
+ media: NcMediaPolicySchema.optional(),
14739
+ throttle: NcThrottleSchema.optional(),
14740
+ priority: number().int().min(1).max(5).optional()
14741
+ });
14400
14742
  /** A persisted rule. */
14401
14743
  var NcRuleSchema = NcRuleInputSchema.extend({
14402
14744
  id: string(),
@@ -14697,6 +15039,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14697
15039
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14698
15040
  * copy would lie the first time a rule is disabled.
14699
15041
  */
15042
+ /**
15043
+ * Why a device a mode NAMES is nonetheless not armed by it.
15044
+ *
15045
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15046
+ * per-camera notification switch the Notification Center already owns,
15047
+ * `detection-off` is the device's own detection binding being inactive, and
15048
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15049
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15050
+ * with the switches the operator actually used.
15051
+ */
15052
+ var NcAlarmSkipReasonSchema = _enum([
15053
+ "muted",
15054
+ "detection-off",
15055
+ "offline"
15056
+ ]);
15057
+ var NcAlarmSkippedDeviceSchema = object({
15058
+ deviceId: number().int(),
15059
+ reason: NcAlarmSkipReasonSchema
15060
+ });
14700
15061
  var NcAlarmModeCoverageSchema = object({
14701
15062
  mode: AlarmArmModeSchema,
14702
15063
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14704,7 +15065,18 @@ var NcAlarmModeCoverageSchema = object({
14704
15065
  /** At least one covering rule has no device scope, so the mode covers all. */
14705
15066
  allDevices: boolean(),
14706
15067
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14707
- deviceIds: array(number().int())
15068
+ deviceIds: array(number().int()),
15069
+ /**
15070
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15071
+ * excludes it.
15072
+ *
15073
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15074
+ * twelve makes it false in exactly the way nobody notices until an incident.
15075
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15076
+ * still parses as "nothing known to be skipped" rather than failing the whole
15077
+ * alarm tab.
15078
+ */
15079
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14708
15080
  });
14709
15081
  var NcAlarmConfigSchema = object({
14710
15082
  /**
@@ -16067,13 +16439,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16067
16439
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16068
16440
  kind: "mutation",
16069
16441
  auth: "admin"
16070
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16442
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16071
16443
  kind: "mutation",
16072
16444
  auth: "admin"
16073
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16074
- kind: "query",
16445
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16446
+ kind: "mutation",
16075
16447
  auth: "admin"
16076
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16448
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16449
+ kind: "mutation",
16450
+ auth: "admin"
16451
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16452
+ kind: "mutation",
16453
+ auth: "admin"
16454
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16077
16455
  kind: "mutation",
16078
16456
  auth: "admin"
16079
16457
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17497,9 +17875,16 @@ var CameraStatusSchema = object({
17497
17875
  audio: CameraAudioStatusSchema.nullable(),
17498
17876
  recording: CameraRecordingStatusSchema.nullable(),
17499
17877
  /**
17500
- * Per-camera function switches an OPERATOR has turned off
17878
+ * Per-camera functions an OPERATOR has turned off
17501
17879
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17502
17880
  *
17881
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
17882
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
17883
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
17884
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
17885
+ * The badge outlives the control panel: the panel was a convenience, this is
17886
+ * the difference between a camera being off and a camera being dead.
17887
+ *
17503
17888
  * This is the difference between DISABLED and BROKEN. A camera whose
17504
17889
  * `detection` block reports zero fps and whose `switchedOff` contains
17505
17890
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17570,7 +17955,13 @@ var NodeInferenceDevicesSchema = object({
17570
17955
  reachable: boolean(),
17571
17956
  devices: array(NodeInferenceDeviceSchema).readonly()
17572
17957
  });
17573
- method(object({
17958
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17959
+ kind: "mutation",
17960
+ auth: "admin"
17961
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
17962
+ kind: "mutation",
17963
+ auth: "admin"
17964
+ }), method(object({
17574
17965
  deviceId: number(),
17575
17966
  agentNodeId: string()
17576
17967
  }), object({ success: literal(true) }), {
@@ -18244,6 +18635,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18244
18635
  locationId: string(),
18245
18636
  targetBytes: number().int().positive()
18246
18637
  }), EvictResultSchema, { kind: "mutation" });
18638
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18639
+ kind: "mutation",
18640
+ auth: "admin"
18641
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18642
+ kind: "mutation",
18643
+ auth: "admin"
18644
+ });
18247
18645
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18248
18646
  providerId: string().min(1),
18249
18647
  displayName: string().min(1),
@@ -18347,6 +18745,28 @@ var TerminalProfileInfoSchema = object({
18347
18745
  label: string(),
18348
18746
  description: string().optional()
18349
18747
  });
18748
+ /**
18749
+ * A durable operator-created Terminal instance. Profiles are templates; only
18750
+ * an instance declares a camera.
18751
+ */
18752
+ var TerminalInstanceInfoSchema = object({
18753
+ instanceId: string(),
18754
+ cameraStableId: string(),
18755
+ nodeId: string(),
18756
+ profileId: string(),
18757
+ profileLabel: string(),
18758
+ name: string(),
18759
+ enabled: boolean()
18760
+ });
18761
+ var TerminalLegacyCameraSchema = object({
18762
+ stableId: string(),
18763
+ nodeId: string(),
18764
+ profileId: string(),
18765
+ profileLabel: string(),
18766
+ name: string(),
18767
+ /** Only legacy monitor cameras can retain their historic stable identity. */
18768
+ adoptable: boolean()
18769
+ });
18350
18770
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18351
18771
  seq: number().int().positive(),
18352
18772
  kind: literal("data"),
@@ -18363,7 +18783,29 @@ var TerminalOutputBatchSchema = object({
18363
18783
  snapshot: string().optional(),
18364
18784
  events: array(TerminalOutputEventSchema).readonly()
18365
18785
  });
18366
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18786
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
18787
+ targetNodeId: string().min(1),
18788
+ profileId: string().min(1),
18789
+ name: string().trim().min(1).max(160).optional()
18790
+ }), TerminalInstanceInfoSchema, {
18791
+ kind: "mutation",
18792
+ auth: "admin"
18793
+ }), method(object({ instanceId: string().min(1) }), _void(), {
18794
+ kind: "mutation",
18795
+ auth: "admin"
18796
+ }), method(object({
18797
+ instanceId: string().min(1),
18798
+ enabled: boolean()
18799
+ }), TerminalInstanceInfoSchema, {
18800
+ kind: "mutation",
18801
+ auth: "admin"
18802
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
18803
+ stableId: string().min(1),
18804
+ name: string().trim().min(1).max(160).optional()
18805
+ }), TerminalInstanceInfoSchema, {
18806
+ kind: "mutation",
18807
+ auth: "admin"
18808
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18367
18809
  profileId: string(),
18368
18810
  cols: number().int().positive(),
18369
18811
  rows: number().int().positive()
@@ -18380,7 +18822,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18380
18822
  }), method(object({
18381
18823
  sessionId: string(),
18382
18824
  afterSeq: number().int().nonnegative(),
18383
- waitMs: number().int().min(0).max(2e3).default(0)
18825
+ waitMs: number().int().min(0).max(2e3).default(0),
18826
+ /**
18827
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
18828
+ * browser's initial repaint remains immediate; the camera snapshot
18829
+ * relay uses it to avoid encoding a blank startup frame.
18830
+ */
18831
+ waitForOutput: boolean().optional()
18384
18832
  }), TerminalOutputBatchSchema, {
18385
18833
  kind: "mutation",
18386
18834
  auth: "admin",
@@ -20321,6 +20769,7 @@ var FaceInfoSchema = object({
20321
20769
  var FaceFilterEnum = _enum([
20322
20770
  "unassigned",
20323
20771
  "recognized",
20772
+ "identified",
20324
20773
  "all"
20325
20774
  ]);
20326
20775
  var MediaFileLiteSchema$1 = object({
@@ -20349,6 +20798,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
20349
20798
  kind: "mutation",
20350
20799
  auth: "admin"
20351
20800
  }), method(object({
20801
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
20802
+ deviceId: number().int().optional(),
20352
20803
  limit: number().int().positive().optional(),
20353
20804
  filter: FaceFilterEnum.optional(),
20354
20805
  /**
@@ -22114,6 +22565,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
22114
22565
  capName: string().min(1).max(64),
22115
22566
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
22116
22567
  valuePath: string().min(1).max(64)
22568
+ }),
22569
+ object({
22570
+ kind: literal("latest-recognition"),
22571
+ recognition: _enum(["person", "plate"])
22117
22572
  })
22118
22573
  ]);
22119
22574
  var OsdSlotBindingSchema = object({
@@ -22219,6 +22674,15 @@ method(object({ deviceId: number().int() }), object({
22219
22674
  }), object({ success: literal(true) }), {
22220
22675
  kind: "mutation",
22221
22676
  auth: "admin"
22677
+ }), method(object({
22678
+ sourceDeviceId: number().int(),
22679
+ targetDeviceId: number().int()
22680
+ }), object({
22681
+ copied: number().int().nonnegative(),
22682
+ skipped: number().int().nonnegative()
22683
+ }), {
22684
+ kind: "mutation",
22685
+ auth: "admin"
22222
22686
  }), method(object({
22223
22687
  deviceId: number().int(),
22224
22688
  slotId: string().min(1),
@@ -22929,7 +23393,19 @@ var RecordingManifestSchema = object({
22929
23393
  * profiles/subtrees/locations on this node). */
22930
23394
  var RecordingDeviceUsageSchema = object({
22931
23395
  deviceId: number(),
22932
- usedBytes: number()
23396
+ usedBytes: number(),
23397
+ /**
23398
+ * Start of this camera's OLDEST indexed segment, across every profile and
23399
+ * location — the "Oldest footage" column in Recordings → Storage, and the
23400
+ * only honest answer to "is retention actually holding?" per camera.
23401
+ *
23402
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
23403
+ * predates this field omits it entirely, and a hub whose types carry the
23404
+ * field must keep validating that older provider's payload: the framework
23405
+ * (types) and the addon ship on different trains, and the addon is usually
23406
+ * the later of the two.
23407
+ */
23408
+ oldestMs: number().nullable().optional()
22933
23409
  });
22934
23410
  /** Recording storage usage + capacity for one storage location. */
22935
23411
  var RecordingLocationUsageSchema = object({
@@ -22957,6 +23433,57 @@ var RecordingStorageUsageSchema = object({
22957
23433
  locations: array(RecordingLocationUsageSchema)
22958
23434
  });
22959
23435
  /**
23436
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
23437
+ *
23438
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
23439
+ * is the operator asking for the EXISTING archive to be brought into line with
23440
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
23441
+ * location, run FIFO behind the single-flight mover.
23442
+ *
23443
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
23444
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
23445
+ * (empty on the plan).
23446
+ */
23447
+ var RecordingRebalanceMoveSchema = object({
23448
+ deviceId: number(),
23449
+ profile: string(),
23450
+ fromLocationId: string(),
23451
+ toLocationId: string(),
23452
+ bytes: number(),
23453
+ files: number().int()
23454
+ });
23455
+ /** Why a pile that is out of place is staying there. Every refusal is
23456
+ * reported: a rebalance that silently drops a camera reads exactly like one
23457
+ * that had nothing to do. */
23458
+ var RecordingRebalanceSkipReasonSchema = _enum([
23459
+ "unassigned",
23460
+ "target-not-writable",
23461
+ "below-threshold",
23462
+ "no-headroom"
23463
+ ]);
23464
+ var RecordingRebalanceSkipSchema = object({
23465
+ deviceId: number(),
23466
+ profile: string(),
23467
+ fromLocationId: string(),
23468
+ /** The location the plan wants; null when the camera has no assignment. */
23469
+ toLocationId: string().nullable(),
23470
+ bytes: number(),
23471
+ reason: RecordingRebalanceSkipReasonSchema
23472
+ });
23473
+ var RecordingRebalancePlanSchema = object({
23474
+ moves: array(RecordingRebalanceMoveSchema),
23475
+ skipped: array(RecordingRebalanceSkipSchema),
23476
+ bytesToMove: number(),
23477
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
23478
+ jobIds: array(string())
23479
+ });
23480
+ var RecordingRebalanceInputSchema = object({
23481
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
23482
+ throttleMbps: number().min(1).max(1e3).optional(),
23483
+ /** Ignore piles smaller than this (default 1 GB). */
23484
+ minMoveGb: number().min(0).optional()
23485
+ });
23486
+ /**
22960
23487
  * Result of locating footage at a wall-clock instant for one device/profile.
22961
23488
  * `segment` carries the covering segment's window; `gap` reports the forward
22962
23489
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -23104,6 +23631,21 @@ method(object({
23104
23631
  }), {
23105
23632
  kind: "mutation",
23106
23633
  auth: "admin"
23634
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23635
+ kind: "mutation",
23636
+ auth: "admin"
23637
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
23638
+ kind: "mutation",
23639
+ auth: "admin"
23640
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
23641
+ kind: "mutation",
23642
+ auth: "admin"
23643
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
23644
+ kind: "mutation",
23645
+ auth: "admin"
23646
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23647
+ kind: "mutation",
23648
+ auth: "admin"
23107
23649
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23108
23650
  kind: "mutation",
23109
23651
  auth: "admin"
@@ -23113,9 +23655,15 @@ method(object({
23113
23655
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23114
23656
  kind: "mutation",
23115
23657
  auth: "admin"
23658
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23659
+ kind: "query",
23660
+ auth: "admin"
23661
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23662
+ kind: "mutation",
23663
+ auth: "admin"
23116
23664
  });
23117
23665
  /**
23118
- * `recordingExport` cap — render a footage time range into a single downloadable
23666
+ * `recording-export` cap — render a footage time range into a single downloadable
23119
23667
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
23120
23668
  * bounded lifetime with a durable history, auto-expiry, and optional
23121
23669
  * delete-after-download.
@@ -23130,10 +23678,42 @@ method(object({
23130
23678
  */
23131
23679
  /** Playback-speed multiplier for the render (1 = realtime). */
23132
23680
  var ExportSpeedSchema = number().min(.25).max(32);
23681
+ /**
23682
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23683
+ *
23684
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
23685
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23686
+ * playlist. Handing it absolute epochs would make every call site responsible
23687
+ * for the same subtraction, and the one that forgot would emit a filter that
23688
+ * selects nothing — silently, as a uniform timelapse.
23689
+ */
23690
+ var ExportDenseRangeSchema = object({
23691
+ fromSec: number().nonnegative(),
23692
+ toSec: number().nonnegative()
23693
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
23694
+ /**
23695
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
23696
+ * listed ranges and at the base `everyMs` everywhere else.
23697
+ *
23698
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
23699
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
23700
+ */
23701
+ var ExportDenseSchema = object({
23702
+ everyMs: number().int().positive(),
23703
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
23704
+ });
23133
23705
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
23134
23706
  var ExportTimelapseSchema = object({
23135
23707
  everyMs: number().int().positive(),
23136
- outputFps: number().int().min(1).max(60).optional()
23708
+ outputFps: number().int().min(1).max(60).optional(),
23709
+ /** Optional second, FASTER rate over the intervals that matter. */
23710
+ dense: ExportDenseSchema.optional()
23711
+ }).superRefine((v, ctx) => {
23712
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
23713
+ code: ZodIssueCode.custom,
23714
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
23715
+ path: ["dense", "everyMs"]
23716
+ });
23137
23717
  });
23138
23718
  /**
23139
23719
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -23191,6 +23771,19 @@ var ExportDownloadSchema = object({
23191
23771
  url: string(),
23192
23772
  endpoints: array(string())
23193
23773
  });
23774
+ /**
23775
+ * A finished export's bytes, inline.
23776
+ *
23777
+ * `bytes` is the DECODED length — the number the caller bounds and logs
23778
+ * against, so nobody has to infer it from the base64 length.
23779
+ */
23780
+ var ExportBytesSchema = object({
23781
+ base64: string(),
23782
+ contentType: string(),
23783
+ /** Suggested filename, extension included. */
23784
+ name: string(),
23785
+ bytes: number().int().nonnegative()
23786
+ });
23194
23787
  method(object({
23195
23788
  deviceId: number(),
23196
23789
  profile: string(),
@@ -23215,6 +23808,9 @@ method(object({
23215
23808
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
23216
23809
  kind: "query",
23217
23810
  auth: "protected"
23811
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
23812
+ kind: "query",
23813
+ auth: "protected"
23218
23814
  });
23219
23815
  /**
23220
23816
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -27232,6 +27828,12 @@ Object.freeze({
27232
27828
  addonId: null,
27233
27829
  access: "delete"
27234
27830
  },
27831
+ "osdManager.copyDeviceConfiguration": {
27832
+ capName: "osd-manager",
27833
+ capScope: "system",
27834
+ addonId: null,
27835
+ access: "create"
27836
+ },
27235
27837
  "osdManager.getConditionSupport": {
27236
27838
  capName: "osd-manager",
27237
27839
  capScope: "system",
@@ -27328,7 +27930,7 @@ Object.freeze({
27328
27930
  addonId: null,
27329
27931
  access: "create"
27330
27932
  },
27331
- "pipelineAnalytics.cancelMediaRelocate": {
27933
+ "pipelineAnalytics.cancelStorageMigrationMove": {
27332
27934
  capName: "pipeline-analytics",
27333
27935
  capScope: "device",
27334
27936
  addonId: null,
@@ -27400,12 +28002,6 @@ Object.freeze({
27400
28002
  addonId: null,
27401
28003
  access: "view"
27402
28004
  },
27403
- "pipelineAnalytics.getMediaRelocateStatus": {
27404
- capName: "pipeline-analytics",
27405
- capScope: "device",
27406
- addonId: null,
27407
- access: "view"
27408
- },
27409
28005
  "pipelineAnalytics.getMotionEvents": {
27410
28006
  capName: "pipeline-analytics",
27411
28007
  capScope: "device",
@@ -27442,6 +28038,12 @@ Object.freeze({
27442
28038
  addonId: null,
27443
28039
  access: "view"
27444
28040
  },
28041
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
28042
+ capName: "pipeline-analytics",
28043
+ capScope: "device",
28044
+ addonId: null,
28045
+ access: "view"
28046
+ },
27445
28047
  "pipelineAnalytics.getTrack": {
27446
28048
  capName: "pipeline-analytics",
27447
28049
  capScope: "device",
@@ -27520,6 +28122,12 @@ Object.freeze({
27520
28122
  addonId: null,
27521
28123
  access: "view"
27522
28124
  },
28125
+ "pipelineAnalytics.pauseForStorageMigration": {
28126
+ capName: "pipeline-analytics",
28127
+ capScope: "device",
28128
+ addonId: null,
28129
+ access: "create"
28130
+ },
27523
28131
  "pipelineAnalytics.proposeRetrainAnnotations": {
27524
28132
  capName: "pipeline-analytics",
27525
28133
  capScope: "device",
@@ -27550,7 +28158,7 @@ Object.freeze({
27550
28158
  addonId: null,
27551
28159
  access: "create"
27552
28160
  },
27553
- "pipelineAnalytics.relocateMedia": {
28161
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
27554
28162
  capName: "pipeline-analytics",
27555
28163
  capScope: "device",
27556
28164
  addonId: null,
@@ -27562,6 +28170,12 @@ Object.freeze({
27562
28170
  addonId: null,
27563
28171
  access: "create"
27564
28172
  },
28173
+ "pipelineAnalytics.resumeForStorageMigration": {
28174
+ capName: "pipeline-analytics",
28175
+ capScope: "device",
28176
+ addonId: null,
28177
+ access: "create"
28178
+ },
27565
28179
  "pipelineAnalytics.saveRetrainAnnotations": {
27566
28180
  capName: "pipeline-analytics",
27567
28181
  capScope: "device",
@@ -27586,6 +28200,12 @@ Object.freeze({
27586
28200
  addonId: null,
27587
28201
  access: "create"
27588
28202
  },
28203
+ "pipelineAnalytics.startStorageMigrationMove": {
28204
+ capName: "pipeline-analytics",
28205
+ capScope: "device",
28206
+ addonId: null,
28207
+ access: "create"
28208
+ },
27589
28209
  "pipelineAnalytics.wipeAllAnalytics": {
27590
28210
  capName: "pipeline-analytics",
27591
28211
  capScope: "device",
@@ -27952,6 +28572,12 @@ Object.freeze({
27952
28572
  addonId: null,
27953
28573
  access: "view"
27954
28574
  },
28575
+ "pipelineOrchestrator.pauseForStorageMigration": {
28576
+ capName: "pipeline-orchestrator",
28577
+ capScope: "system",
28578
+ addonId: null,
28579
+ access: "create"
28580
+ },
27955
28581
  "pipelineOrchestrator.rebalance": {
27956
28582
  capName: "pipeline-orchestrator",
27957
28583
  capScope: "system",
@@ -27976,6 +28602,12 @@ Object.freeze({
27976
28602
  addonId: null,
27977
28603
  access: "view"
27978
28604
  },
28605
+ "pipelineOrchestrator.resumeForStorageMigration": {
28606
+ capName: "pipeline-orchestrator",
28607
+ capScope: "system",
28608
+ addonId: null,
28609
+ access: "create"
28610
+ },
27979
28611
  "pipelineOrchestrator.saveTemplate": {
27980
28612
  capName: "pipeline-orchestrator",
27981
28613
  capScope: "system",
@@ -28372,7 +29004,13 @@ Object.freeze({
28372
29004
  addonId: null,
28373
29005
  access: "create"
28374
29006
  },
28375
- "recording.cancelRelocate": {
29007
+ "recording.cancelRelocateJob": {
29008
+ capName: "recording",
29009
+ capScope: "system",
29010
+ addonId: null,
29011
+ access: "create"
29012
+ },
29013
+ "recording.cancelStorageMigrationMove": {
28376
29014
  capName: "recording",
28377
29015
  capScope: "system",
28378
29016
  addonId: null,
@@ -28408,7 +29046,7 @@ Object.freeze({
28408
29046
  addonId: null,
28409
29047
  access: "view"
28410
29048
  },
28411
- "recording.getRelocateStatus": {
29049
+ "recording.getStorageMigrationMoveStatus": {
28412
29050
  capName: "recording",
28413
29051
  capScope: "system",
28414
29052
  addonId: null,
@@ -28426,12 +29064,30 @@ Object.freeze({
28426
29064
  addonId: null,
28427
29065
  access: "view"
28428
29066
  },
29067
+ "recording.listRelocateJobs": {
29068
+ capName: "recording",
29069
+ capScope: "system",
29070
+ addonId: null,
29071
+ access: "view"
29072
+ },
28429
29073
  "recording.locateSegment": {
28430
29074
  capName: "recording",
28431
29075
  capScope: "system",
28432
29076
  addonId: null,
28433
29077
  access: "view"
28434
29078
  },
29079
+ "recording.pauseForStorageMigration": {
29080
+ capName: "recording",
29081
+ capScope: "system",
29082
+ addonId: null,
29083
+ access: "create"
29084
+ },
29085
+ "recording.planStorageRebalance": {
29086
+ capName: "recording",
29087
+ capScope: "system",
29088
+ addonId: null,
29089
+ access: "view"
29090
+ },
28435
29091
  "recording.pruneFootage": {
28436
29092
  capName: "recording",
28437
29093
  capScope: "system",
@@ -28450,6 +29106,12 @@ Object.freeze({
28450
29106
  addonId: null,
28451
29107
  access: "view"
28452
29108
  },
29109
+ "recording.refreshStorageLocationsForMigration": {
29110
+ capName: "recording",
29111
+ capScope: "system",
29112
+ addonId: null,
29113
+ access: "create"
29114
+ },
28453
29115
  "recording.relocateFootage": {
28454
29116
  capName: "recording",
28455
29117
  capScope: "system",
@@ -28474,44 +29136,68 @@ Object.freeze({
28474
29136
  addonId: null,
28475
29137
  access: "create"
28476
29138
  },
29139
+ "recording.resumeForStorageMigration": {
29140
+ capName: "recording",
29141
+ capScope: "system",
29142
+ addonId: null,
29143
+ access: "create"
29144
+ },
28477
29145
  "recording.setDeviceConfig": {
28478
29146
  capName: "recording",
28479
29147
  capScope: "system",
28480
29148
  addonId: null,
28481
29149
  access: "create"
28482
29150
  },
29151
+ "recording.startStorageMigrationMove": {
29152
+ capName: "recording",
29153
+ capScope: "system",
29154
+ addonId: null,
29155
+ access: "create"
29156
+ },
29157
+ "recording.startStorageRebalance": {
29158
+ capName: "recording",
29159
+ capScope: "system",
29160
+ addonId: null,
29161
+ access: "create"
29162
+ },
28483
29163
  "recordingExport.cancelExport": {
28484
- capName: "recordingExport",
29164
+ capName: "recording-export",
28485
29165
  capScope: "system",
28486
29166
  addonId: null,
28487
29167
  access: "create"
28488
29168
  },
28489
29169
  "recordingExport.createExport": {
28490
- capName: "recordingExport",
29170
+ capName: "recording-export",
28491
29171
  capScope: "system",
28492
29172
  addonId: null,
28493
29173
  access: "create"
28494
29174
  },
28495
29175
  "recordingExport.deleteExport": {
28496
- capName: "recordingExport",
29176
+ capName: "recording-export",
28497
29177
  capScope: "system",
28498
29178
  addonId: null,
28499
29179
  access: "delete"
28500
29180
  },
28501
29181
  "recordingExport.getDownloadUrl": {
28502
- capName: "recordingExport",
29182
+ capName: "recording-export",
28503
29183
  capScope: "system",
28504
29184
  addonId: null,
28505
29185
  access: "view"
28506
29186
  },
28507
29187
  "recordingExport.getExport": {
28508
- capName: "recordingExport",
29188
+ capName: "recording-export",
28509
29189
  capScope: "system",
28510
29190
  addonId: null,
28511
29191
  access: "view"
28512
29192
  },
28513
29193
  "recordingExport.listExports": {
28514
- capName: "recordingExport",
29194
+ capName: "recording-export",
29195
+ capScope: "system",
29196
+ addonId: null,
29197
+ access: "view"
29198
+ },
29199
+ "recordingExport.readExportBytes": {
29200
+ capName: "recording-export",
28515
29201
  capScope: "system",
28516
29202
  addonId: null,
28517
29203
  access: "view"
@@ -28870,6 +29556,30 @@ Object.freeze({
28870
29556
  addonId: null,
28871
29557
  access: "view"
28872
29558
  },
29559
+ "storageMigration.cancel": {
29560
+ capName: "storage-migration",
29561
+ capScope: "system",
29562
+ addonId: null,
29563
+ access: "create"
29564
+ },
29565
+ "storageMigration.plan": {
29566
+ capName: "storage-migration",
29567
+ capScope: "system",
29568
+ addonId: null,
29569
+ access: "view"
29570
+ },
29571
+ "storageMigration.start": {
29572
+ capName: "storage-migration",
29573
+ capScope: "system",
29574
+ addonId: null,
29575
+ access: "create"
29576
+ },
29577
+ "storageMigration.status": {
29578
+ capName: "storage-migration",
29579
+ capScope: "system",
29580
+ addonId: null,
29581
+ access: "view"
29582
+ },
28873
29583
  "storageProvider.abortUpload": {
28874
29584
  capName: "storage-provider",
28875
29585
  capScope: "system",
@@ -29248,12 +29958,42 @@ Object.freeze({
29248
29958
  addonId: null,
29249
29959
  access: "create"
29250
29960
  },
29961
+ "terminalSession.adoptLegacyMonitor": {
29962
+ capName: "terminal-session",
29963
+ capScope: "system",
29964
+ addonId: null,
29965
+ access: "create"
29966
+ },
29251
29967
  "terminalSession.close": {
29252
29968
  capName: "terminal-session",
29253
29969
  capScope: "system",
29254
29970
  addonId: null,
29255
29971
  access: "create"
29256
29972
  },
29973
+ "terminalSession.createInstance": {
29974
+ capName: "terminal-session",
29975
+ capScope: "system",
29976
+ addonId: null,
29977
+ access: "create"
29978
+ },
29979
+ "terminalSession.deleteInstance": {
29980
+ capName: "terminal-session",
29981
+ capScope: "system",
29982
+ addonId: null,
29983
+ access: "delete"
29984
+ },
29985
+ "terminalSession.listInstances": {
29986
+ capName: "terminal-session",
29987
+ capScope: "system",
29988
+ addonId: null,
29989
+ access: "view"
29990
+ },
29991
+ "terminalSession.listLegacyCameras": {
29992
+ capName: "terminal-session",
29993
+ capScope: "system",
29994
+ addonId: null,
29995
+ access: "view"
29996
+ },
29257
29997
  "terminalSession.listProfiles": {
29258
29998
  capName: "terminal-session",
29259
29999
  capScope: "system",
@@ -29284,6 +30024,12 @@ Object.freeze({
29284
30024
  addonId: null,
29285
30025
  access: "create"
29286
30026
  },
30027
+ "terminalSession.setInstanceEnabled": {
30028
+ capName: "terminal-session",
30029
+ capScope: "system",
30030
+ addonId: null,
30031
+ access: "create"
30032
+ },
29287
30033
  "terminalSession.writeInput": {
29288
30034
  capName: "terminal-session",
29289
30035
  capScope: "system",
@@ -29828,6 +30574,104 @@ var FramerateField = number().int().min(1).max(60);
29828
30574
  var TargetsField = array(NcRuleTargetSchema).min(1);
29829
30575
  var PriorityField = number().int().min(1).max(5);
29830
30576
  /**
30577
+ * Explicit override of the DENSE sampling cadence, seconds.
30578
+ *
30579
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
30580
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
30581
+ * made that same base 3 s and rendered a person pass as two frames.)
30582
+ *
30583
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
30584
+ * `denseCadenceSec` and played at `framerate` occupies
30585
+ *
30586
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
30587
+ *
30588
+ * 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.
30589
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
30590
+ * and therefore the length of a quiet night, does not move.
30591
+ *
30592
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
30593
+ * the recording has them returns the same frames, requested twice. Must be
30594
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
30595
+ * a uniform video the operator believes is two-rate — and upsert refuses it
30596
+ * rather than letting the export cap reject the render hours after the window.
30597
+ */
30598
+ var DenseCadenceSecField = number().min(.1).max(3600);
30599
+ /**
30600
+ * Minimum seconds of OUTPUT video each detection range must occupy.
30601
+ *
30602
+ * The operator-facing form of the arithmetic above: instead of solving for a
30603
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
30604
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
30605
+ * that range every ~583 ms.
30606
+ *
30607
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
30608
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
30609
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
30610
+ * ranges are sampled denser than they need. Per-range cadences require a cap
30611
+ * schema change and are the tracked follow-up.
30612
+ *
30613
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
30614
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
30615
+ * by real footage, never met by duplicating frames into motion that never
30616
+ * happened.
30617
+ */
30618
+ var MinDwellSecField = number().min(0).max(60);
30619
+ /**
30620
+ * Caption burned into the notification's preview frame.
30621
+ *
30622
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
30623
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
30624
+ * templating dialect for one field would be a second thing to explain.
30625
+ *
30626
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
30627
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
30628
+ * the reason this is not `.min(1)`.
30629
+ */
30630
+ var PreviewTextField = string().max(200);
30631
+ /**
30632
+ * Whether the notification's preview is a STILL or a short animation.
30633
+ *
30634
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
30635
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
30636
+ * night reads better as three seconds of motion than as one frame of it. Both
30637
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
30638
+ * simply applies it to a dozen frames sampled across the render and assembles
30639
+ * them.
30640
+ *
30641
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
30642
+ * seeks and a palette pass, and no rule that never asked for one should start
30643
+ * paying that on the deploy that shipped it.
30644
+ *
30645
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
30646
+ */
30647
+ var PreviewModeField = _enum(["image", "gif"]);
30648
+ /**
30649
+ * Which detection classes the notification reports counts for.
30650
+ *
30651
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
30652
+ * plan — no second query — aggregated per class. Absent or empty means "every
30653
+ * class the window actually contained", which is what an operator who never
30654
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
30655
+ * counts cars all night).
30656
+ *
30657
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
30658
+ * …). An unknown name simply never matches and reports nothing — it is not an
30659
+ * error, because a rule may legitimately name a class this camera's model does
30660
+ * not emit.
30661
+ *
30662
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
30663
+ * - `{{detections}}` — total over the reported classes
30664
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
30665
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
30666
+ * one per class, `count_` + the class name
30667
+ *
30668
+ * With NO custom body template the summary is appended to the derived body, and
30669
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
30670
+ * reads. With a custom template the operator owns every word — nothing is
30671
+ * appended, so `{{detectionSummary}}` is how he asks for it.
30672
+ */
30673
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
30674
+ /**
29831
30675
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
29832
30676
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
29833
30677
  * here (see the ownership note above).
@@ -29847,9 +30691,30 @@ var TimelapseRuleInputSchema = object({
29847
30691
  cadenceSec: CadenceSecField.default(15),
29848
30692
  /** Output frames per second of the assembled mp4 (predecessor parity). */
29849
30693
  framerate: FramerateField.default(10),
30694
+ /**
30695
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
30696
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
30697
+ * field gets.
30698
+ */
30699
+ denseCadenceSec: DenseCadenceSecField.optional(),
30700
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
30701
+ minDwellSec: MinDwellSecField.optional(),
29850
30702
  /** `notification-output` targets the finished video/thumbnail is sent to. */
29851
30703
  targets: TargetsField,
29852
30704
  template: TimelapseTemplateSchema.optional(),
30705
+ /**
30706
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
30707
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
30708
+ *
30709
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
30710
+ * the notification's title/body, and clearing it (`template: null`) must not
30711
+ * silently clear the caption too.
30712
+ */
30713
+ previewText: PreviewTextField.optional(),
30714
+ /** Still or animation — see {@link PreviewModeField}. */
30715
+ previewMode: PreviewModeField.default("image"),
30716
+ /** Classes the notification counts — see {@link ReportClassesField}. */
30717
+ reportClasses: ReportClassesField.optional(),
29853
30718
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
29854
30719
  priority: PriorityField.default(3)
29855
30720
  });
@@ -29860,8 +30725,13 @@ object({
29860
30725
  schedule: NcScheduleSchema.optional(),
29861
30726
  cadenceSec: CadenceSecField.optional(),
29862
30727
  framerate: FramerateField.optional(),
30728
+ denseCadenceSec: DenseCadenceSecField.optional(),
30729
+ minDwellSec: MinDwellSecField.optional(),
29863
30730
  targets: TargetsField.optional(),
29864
30731
  template: TimelapseTemplateSchema.nullable().optional(),
30732
+ previewText: PreviewTextField.optional(),
30733
+ previewMode: PreviewModeField.optional(),
30734
+ reportClasses: ReportClassesField.optional(),
29865
30735
  priority: PriorityField.optional()
29866
30736
  });
29867
30737
  TimelapseRuleInputSchema.extend({
@@ -29873,10 +30743,28 @@ TimelapseRuleInputSchema.extend({
29873
30743
  */
29874
30744
  ownerUserId: string().optional(),
29875
30745
  /**
29876
- * Epoch-ms of the last successful generation — the 1-hour re-generation
29877
- * guard's durable state (predecessor parity). Absent = never generated.
30746
+ * Epoch-ms of the NEWEST successful generation across every camera of this
30747
+ * rule. What a UI shows, and the compatibility floor for
30748
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
29878
30749
  */
29879
30750
  lastGeneratedAt: number().optional(),
30751
+ /**
30752
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
30753
+ * re-generation guard's real durable state.
30754
+ *
30755
+ * One rule covers several cameras and each renders its own video, so a rule
30756
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
30757
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
30758
+ * already done — and B's night is gone for good, because the window will not
30759
+ * come back.
30760
+ *
30761
+ * ADDITIVE, so the migration is free: a row written before this field simply
30762
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
30763
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
30764
+ * "never generated" would re-render and re-notify every camera of every rule
30765
+ * once, on the deploy that shipped the map.
30766
+ */
30767
+ generatedByDevice: record(string(), number()).optional(),
29880
30768
  /** userId of the caller who created the rule (server-stamped). */
29881
30769
  createdBy: string(),
29882
30770
  createdAt: number(),
@@ -31650,10 +32538,10 @@ async function assembleAi(deps) {
31650
32538
  registrations,
31651
32539
  runtimeProvider
31652
32540
  };
31653
- const { UsageStore } = await import("./usage-store-BVa_imkv.mjs").then((n) => n.i);
32541
+ const { UsageStore } = await import("./usage-store-1FrTJdpU.mjs").then((n) => n.i);
31654
32542
  const store = new ProfileStore(deps.settingsPort);
31655
32543
  const defaults = new DefaultsStore(deps.settingsPort);
31656
- const usage = new UsageStore(deps.settingsPort);
32544
+ const usage = new UsageStore(deps.settingsPort, Date.now, deps.logger.child("llm-usage"));
31657
32545
  await store.init();
31658
32546
  await defaults.init();
31659
32547
  await usage.init();